@diagc/cli 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,11 +16,11 @@ Error generating stack: `+e.message+`
16
16
  M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}F_.displayName=`MiniMap`,(0,v.memo)(F_);var I_=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,L_={[Oh.Line]:`right`,[Oh.Handle]:`bottom-right`};function R_({nodeId:e,position:t,variant:n=Oh.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let y=Og(),b=typeof e==`string`?e:y,x=Hh(),S=(0,v.useRef)(null),C=n===Oh.Handle,w=Vh((0,v.useCallback)(I_(C&&p),[C,p]),Lh),T=(0,v.useRef)(null),E=t??L_[n];return(0,v.useEffect)(()=>{if(!(!S.current||!b))return T.current||=qne({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=dh([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Kte({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]),(0,D.jsx)(`div`,{className:Fl([`react-flow__resize-control`,`nodrag`,...E.split(`-`),n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}var z_=(0,v.memo)(R_);function B_({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:i,lineStyle:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,autoScale:f=!0,shouldResize:p,onResizeStart:m,onResize:h,onResizeEnd:g}){return t?(0,D.jsxs)(D.Fragment,{children:[zne.map(t=>(0,D.jsx)(z_,{className:i,style:a,nodeId:e,position:t,variant:Oh.Line,color:o,minWidth:s,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:m,keepAspectRatio:d,autoScale:f,shouldResize:p,onResize:h,onResizeEnd:g},t)),Rne.map(t=>(0,D.jsx)(z_,{className:n,style:r,nodeId:e,position:t,color:o,minWidth:s,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:m,keepAspectRatio:d,autoScale:f,shouldResize:p,onResize:h,onResizeEnd:g},t))]}):null}var V_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),H_=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Qie=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),U_=e=>{let t=Qie(e);return t.charAt(0).toUpperCase()+t.slice(1)},W_={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`},$ie=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},eae=(0,v.createContext)({}),tae=()=>(0,v.useContext)(eae),nae=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=tae()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...W_,width:t??l??W_.width,height:t??l??W_.height,stroke:e??f,strokeWidth:m,className:V_(`lucide`,p,i),...!a&&!$ie(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),G_=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(nae,{ref:i,iconNode:t,className:V_(`lucide-${H_(U_(e))}`,`lucide-${e}`,n),...r}));return n.displayName=U_(e),n},K_=G_(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),j=G_(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),rae=G_(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),iae=G_(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),aae=G_(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),oae=G_(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),sae=G_(`brick-wall`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 9v6`,key:`199k2o`}],[`path`,{d:`M16 15v6`,key:`8rj2es`}],[`path`,{d:`M16 3v6`,key:`1j6rpj`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 15v6`,key:`1stoo3`}],[`path`,{d:`M8 3v6`,key:`vlvjmk`}]]),cae=G_(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),lae=G_(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),q_=G_(`component`,[[`path`,{d:`M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z`,key:`1uwlt4`}],[`path`,{d:`M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z`,key:`10291m`}],[`path`,{d:`M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z`,key:`1tqoq1`}],[`path`,{d:`M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z`,key:`1x6lto`}]]),J_=G_(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),uae=G_(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Y_=G_(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),dae=G_(`door-open`,[[`path`,{d:`M11 20H2`,key:`nlcfvz`}],[`path`,{d:`M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z`,key:`au4z13`}],[`path`,{d:`M11 4H8a2 2 0 0 0-2 2v14`,key:`74r1mk`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M22 20h-3`,key:`vhrsz`}]]),X_=G_(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),fae=G_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),pae=G_(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),mae=G_(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),hae=G_(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),gae=G_(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),_ae=G_(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),vae=G_(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),yae=G_(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),bae=G_(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),xae=G_(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Sae=G_(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Cae=G_(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Z_=G_(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Q_=G_(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),$_=G_(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),ev=G_(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),tv=G_(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),nv=G_(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),rv=G_(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),iv=G_(`square-function`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]]),av=G_(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),ov=G_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),sv={database:Y_,postgres:Y_,table:av,user:G_(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),users:G_(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),cloud:lae,mail:yae,service:iae,system:aae,queue:gae,server:tv,kubernetes:J_,infra:mae,comment:xae,browser:fae,spa:K_,mobile:nv,desktop:Cae,api:G_(`webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),function:iv,cli:ov,blob:j,search:ev,component:q_,interface:$_,class:oae,node:uae,instance:rae,plus:Q_,minus:Sae,dot:cae,decision:X_,environment:hae,region:bae,zone:pae,network:Z_,"subnet-public":_ae,"subnet-private":vae,"load-balancer":rv,gateway:dae,firewall:sae,internet:fae},cv=Object.keys(sv);function lv(e){let t=new Map(Object.entries({...sv,...e}));return{resolve:e=>t.get(e),register:(e,n)=>{t.set(e,n)}}}function wae({path:e,nameOf:t,onCrumb:n}){return e.length===0?null:(0,D.jsx)(qh,{position:`top-left`,className:`dg-breadcrumbs`,children:(0,D.jsxs)(`nav`,{className:`dg-breadcrumbs-nav`,"aria-label":`Nested zoom breadcrumb`,children:[(0,D.jsx)(`button`,{type:`button`,className:`dg-crumb dg-crumb-home`,title:`Zoom out to the bird’s-eye view`,onClick:()=>n(null),children:`⌂`}),e.map((r,i)=>{let a=i===e.length-1;return(0,D.jsxs)(`span`,{className:`dg-crumb-item`,children:[(0,D.jsx)(`span`,{className:`dg-crumb-sep`,"aria-hidden":`true`,children:`›`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-crumb${a?` dg-crumb-current`:``}`,"aria-current":a?`page`:void 0,onClick:()=>n(r),children:t(r)})]},r)})]})})}var uv=new Set,dv={nodes:uv,edges:uv,active:!1,variant:`loop`,activeKey:null,focusId:null,toggle:()=>void 0,clear:()=>void 0},fv=(0,v.createContext)(dv);function pv(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tae(e,t,n,r){switch(e){case ym.Left:return{x:t.x-pv(t.x-n.x,r),y:t.y};case ym.Right:return{x:t.x+pv(n.x-t.x,r),y:t.y};case ym.Top:return{x:t.x,y:t.y-pv(t.y-n.y,r)};case ym.Bottom:default:return{x:t.x,y:t.y+pv(n.y-t.y,r)}}}function Eae(e,t){let n={x:e.sourceX,y:e.sourceY},r={x:e.targetX,y:e.targetY};return[n,Tae(e.sourcePosition,n,r,t),Tae(e.targetPosition,r,n,t),r]}var mv=.6,Dae=24,Oae=160;function hv(e,t,n=`left`,r){let i={x:e.sourceX,y:e.sourceY},a={x:e.targetX,y:e.targetY},o=a.x-i.x,s=a.y-i.y,c=Math.hypot(o,s);if(c===0)return[i,i,i,i];let l=o/c,u=s/c,d=n===`right`?-1:1,f=-u*d,p=l*d,m=r??Math.min(Oae,Math.max(Dae,t*c*mv));return[i,{x:i.x+c/3*l+f*m,y:i.y+c/3*u+p*m},{x:i.x+l*(2*c/3)+f*m,y:i.y+u*(2*c/3)+p*m},a]}function gv(e,t,n=`left`,r){let[i,a,o,s]=hv(e,t,n,r);return`M${i.x},${i.y} C${a.x},${a.y} ${o.x},${o.y} ${s.x},${s.y}`}function _v([e,t,n,r],i){let a=1-i,o=a*a*a,s=3*a*a*i,c=3*a*i*i,l=i*i*i;return{x:o*e.x+s*t.x+c*n.x+l*r.x,y:o*e.y+s*t.y+c*n.y+l*r.y}}function kae([e,t,n,r],i){let a=1-i,o=3*a*a,s=6*a*i,c=3*i*i;return{x:o*(t.x-e.x)+s*(n.x-t.x)+c*(r.x-n.x),y:o*(t.y-e.y)+s*(n.y-t.y)+c*(r.y-n.y)}}function vv(e){let t=e.targetX-e.sourceX,n=e.targetY-e.sourceY,r=Math.hypot(t,n);return r===0?{x:0,y:0}:{x:t/r,y:n/r}}function yv({shape:e,params:t,curvature:n,side:r=`left`,bulge:i}){if(e===`curved`)return Eae(t,n??.25);if(e===`bow`)return hv(t,n??.25,r,i)}function Aae(e,t){let n=yv(e);if(n!==void 0)return _v(n,t);let{params:r}=e;return{x:r.sourceX+(r.targetX-r.sourceX)*t,y:r.sourceY+(r.targetY-r.sourceY)*t}}function bv(e,t){let n=yv(e);if(n===void 0)return vv(e.params);let r=kae(n,t),i=Math.hypot(r.x,r.y);return i===0?vv(e.params):{x:r.x/i,y:r.y/i}}function jae(e){return{point:t=>Aae(e,t),tangent:t=>bv(e,t)}}function xv(e){let t=e[0]??{x:0,y:0},n=[],r=0;for(let t=1;t<e.length;t++){let i=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y);n.push(i),r+=i}let i=e=>{let t=Math.min(1,Math.max(0,e))*r;for(let e=0;e<n.length;e++){let r=n[e];if(r>0&&(t<=r||e===n.length-1))return{i:e,u:Math.min(1,t/r)};t-=r}return{i:Math.max(0,n.length-1),u:0}};return{point:n=>{if(r===0)return t;let{i:a,u:o}=i(n),s=e[a],c=e[a+1];return{x:s.x+(c.x-s.x)*o,y:s.y+(c.y-s.y)*o}},tangent:t=>{if(r===0)return{x:0,y:0};let{i:a}=i(t),o=e[a],s=e[a+1],c=n[a];return c===0?{x:0,y:0}:{x:(s.x-o.x)/c,y:(s.y-o.y)/c}}}}function Sv(e,t){let n=e.point(t),r=e.tangent(t);return{point:n,tangent:r,normal:{x:-r.y,y:r.x}}}function Cv(e,t,n=40){let r=.5,i=1/0;for(let a=0;a<=n;a++){let o=a/n,s=e.point(o),c=(s.x-t.x)**2+(s.y-t.y)**2;c<i&&(i=c,r=o)}let a=e.point(r),o=e.tangent(r),s=-o.y,c=o.x;return c>0&&(s=-s,c=-c),{t:r,perp:(t.x-a.x)*s+(t.y-a.y)*c}}function wv(e,t){let n=e[0]??t,r=1/0;for(let i=0;i+1<e.length;i++){let a=e[i],o=e[i+1],s=o.x-a.x,c=o.y-a.y,l=s*s+c*c,u=l===0?0:Math.min(1,Math.max(0,((t.x-a.x)*s+(t.y-a.y)*c)/l)),d={x:a.x+u*s,y:a.y+u*c},f=(d.x-t.x)**2+(d.y-t.y)**2;f<r&&(r=f,n=d)}return n}function Tv(e,t){if(e.length<2)return``;if(e.length===2)return`M${e[0].x},${e[0].y} L${e[1].x},${e[1].y}`;let n=`M${e[0].x},${e[0].y}`;for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y)||1,c=Math.hypot(o.x-a.x,o.y-a.y)||1,l=Math.min(t,s/2,c/2),u=a.x-(a.x-i.x)/s*l,d=a.y-(a.y-i.y)/s*l,f=a.x+(o.x-a.x)/c*l,p=a.y+(o.y-a.y)/c*l;n+=` L${u},${d} Q${a.x},${a.y} ${f},${p}`}let r=e[e.length-1];return n+=` L${r.x},${r.y}`,n}function Mae(e,t=10){let n=e.map(e=>({...e}));for(let e=1;e+2<n.length;){let r=n[e-1],i=n[e],a=n[e+1],o=n[e+2],s=i.y===a.y&&Math.abs(a.x-i.x)>0&&Math.abs(a.x-i.x)<=t&&r.x===i.x&&a.x===o.x,c=i.x===a.x&&Math.abs(a.y-i.y)>0&&Math.abs(a.y-i.y)<=t&&r.y===i.y&&a.y===o.y;if(!s&&!c){e++;continue}let l=s?i.x:i.y;for(let t=e;t>=0;t--){let e=n[t];if((s?e.x:e.y)!==l)break;s?e.x=a.x:e.y=a.y}n.splice(e,2)}return n}function Ev(e){let t=(e,t)=>e===void 0||t===void 0?void 0:e.x===t.x&&e.y!==t.y?t.y>e.y?`bottom`:`top`:e.y===t.y&&e.x!==t.x?t.x>e.x?`right`:`left`:void 0;return{from:t(e[0],e[1]),to:t(e[e.length-1],e[e.length-2])}}function Nae(e,t,n){let r=e.map(e=>({...e}));if(r.length<2)return r;let i=(e,t,n,r)=>t<n?n:t>r?r:e-n<=r-e?n:r,a=(e,t,n)=>{if(n===void 0||n.width<=0||n.height<=0)return;let r=n.x+n.width,a=n.y+n.height;e.x===t.x&&e.x>=n.x&&e.x<=r?e.y=i(e.y,t.y,n.y,a):e.y===t.y&&e.y>=n.y&&e.y<=a&&(e.x=i(e.x,t.x,n.x,r))};return a(r[0],r[1],t),a(r[r.length-1],r[r.length-2],n),r}var Dv=20,Pae=16,Ov={sm:{char:5.5,line:13},md:{char:7.2,line:17},lg:{char:11,line:26}};function kv(e,t=`md`){let{char:n,line:r}=Ov[t],i=260-Dv,a=0,o=0;for(let t of e.split(`
17
17
  `)){let e=t.length*n;o=Math.max(o,Math.min(e,i)),a+=Math.max(1,Math.ceil(e/i))}return{width:Math.min(260,Math.max(120,Math.round(o+Dv))),height:Math.round(Math.max(1,a)*r+Pae)}}var Av=7,jv=8;function Mv(e){return Math.round(e.length*Av+jv)}var Nv=180,Fae=16;function Pv(e){let t=0,n=0;for(let r of e.split(`
18
18
  `)){let e=Mv(r);t=Math.max(t,Math.min(e,Nv)),n+=Math.max(1,Math.ceil(e/Nv))}return{width:t,height:n*Fae+3}}var Fv=14,Iae=8,Lae=3;function Iv(e){return e>Iae?`top`:e<-8?`bottom`:`center`}function Lv(e,t,n){let r=e.point(t);if(n!==`top`&&n!==`bottom`)return r;let i=e.tangent(t),a=-i.y,o=i.x;o>0&&(a=-a,o=-o);let s=n===`top`?1:-1;return{x:r.x+s*Fv*a,y:r.y+s*Fv*o}}var Rv=e=>(e.t===void 0||e.t===.5)&&(e.side??`center`)===`center`;function zv({data:e,curve:t,label:n,labelSpot:r}){let[i,a]=(0,v.useState)(null),o=Bv(e,t),s=e.editableLabels===!0,c=jn(e.kind),l=e=>c?Fn(e,24).join(`
19
- `):e,u=c?` dg-edge-label-wrap`:``;return(0,D.jsxs)(D.Fragment,{children:[e.labels===void 0&&e.label!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-chip${u}`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${n.x}px, ${n.y}px)`},children:l(e.label)})}),e.labels!==void 0&&e.labels.map(n=>{let c=n.t??.5,d=n.side??`center`,f=r!==void 0&&e.labels?.length===1&&Rv(n)?r:Lv(t,c,d),p=o.drag!==null&&o.drag.labelId===n.id?o.drag:null,m=p?.x??f.x,h=p?.y??f.y,g=i!==null&&i.labelId===n.id;return(0,D.jsx)(c_,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-label-${d}${u} nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${m}px, ${h}px)`,pointerEvents:`all`},...o.handlers(n.id,g),onDoubleClick:e=>{s&&(e.stopPropagation(),a({labelId:n.id,t:c,side:d,x:f.x,y:f.y}))},children:g?(0,D.jsx)(Vv,{label:n.text,onCommit:t=>{a(null),t!==null&&e.onEditLabel?.(n.id,t.trim())}}):l(n.text)})},n.id)}),s&&e.pendingAdd!==void 0&&(0,D.jsx)(Rae,{data:e,curve:t,at:e.pendingAdd})]})}function Bv(e,t){let n=gg(),[r,i]=(0,v.useState)(null),a=(0,v.useRef)(null),o=(e,r)=>{let{t:i,perp:a}=Cv(t,n.screenToFlowPosition({x:e,y:r}));return{t:i,side:Iv(a)}},s=t=>e.editableLabels===!0||e.movableLabels===!0&&t.altKey;return{drag:r,handlers:(n,r)=>({onPointerDown:e=>{!s(e)||r||(e.stopPropagation(),a.current={labelId:n,startX:e.clientX,startY:e.clientY,moved:!1},typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{let r=a.current;if(r===null||r.labelId!==n||!r.moved&&Math.hypot(e.clientX-r.startX,e.clientY-r.startY)<Lae)return;r.moved=!0;let{t:s,side:c}=o(e.clientX,e.clientY),l=Lv(t,s,c);i({labelId:n,x:l.x,y:l.y})},onPointerUp:t=>{let r=a.current;if(a.current=null,!(r===null||r.labelId!==n)){if(typeof t.currentTarget.releasePointerCapture==`function`&&t.currentTarget.releasePointerCapture(t.pointerId),r.moved){let{t:r,side:i}=o(t.clientX,t.clientY);e.onMoveLabel?.(n,r,i)}i(null)}}})}}function Rae({data:e,curve:t,at:n}){let{t:r,perp:i}=Cv(t,n),a=Iv(i),o=Lv(t,r,a);return(0,D.jsx)(c_,{children:(0,D.jsx)(`div`,{className:`dg-edge-label-edit nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${o.x}px, ${o.y}px)`,pointerEvents:`all`},children:(0,D.jsx)(Vv,{label:``,onCommit:t=>{t!==null&&t.trim()!==``&&e.onAddLabel?.(t.trim(),r,a),e.onPendingAddConsumed?.()}})})})}function Vv({label:e,onCommit:t}){let n=(0,v.useRef)(!1),r=e=>{n.current||(n.current=!0,t?.(e))};return(0,D.jsx)(`input`,{"aria-label":`Edge label`,defaultValue:e,autoFocus:!0,onFocus:e=>e.target.select(),onBlur:e=>r(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(e.target.value):e.key===`Escape`&&r(null)}})}var Hv={arrow:{refX:9,el:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`})},dot:{refX:5,el:(0,D.jsx)(`circle`,{cx:`5`,cy:`5`,r:`4`})},square:{refX:5,el:(0,D.jsx)(`rect`,{x:`1.2`,y:`1.2`,width:`7.6`,height:`7.6`})},diamond:{refX:5,el:(0,D.jsx)(`path`,{d:`M5,0 L10,5 L5,10 L0,5 z`})},crowsfoot:{refX:10,el:(0,D.jsx)(`path`,{d:`M10,1 L0,5 L10,9 M0,5 L10,5`,fill:`none`})},one:{refX:8,el:(0,D.jsx)(`path`,{d:`M5,1 L5,9`,fill:`none`})},none:void 0},Uv={refX:9,el:(0,D.jsx)(`path`,{d:`M1,1 L9,5 L1,9`,fill:`none`})},Wv=new Set([`crowsfoot`,`one`,`open-arrow`]);function zae({end:e,start:t,stroke:n,size:r}){return(0,D.jsxs)(D.Fragment,{children:[e!==void 0&&(0,D.jsx)(Gv,{marker:e,stroke:n,size:r}),t!==void 0&&(0,D.jsx)(Gv,{marker:t,stroke:n,size:r})]})}function Gv({marker:e,stroke:t,size:n}){return(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:e.id,viewBox:`0 0 10 10`,refX:e.shape.refX,refY:`5`,markerWidth:n,markerHeight:n,markerUnits:`userSpaceOnUse`,orient:`auto-start-reverse`,fill:t,...Wv.has(e.style)?{stroke:t,strokeWidth:1.2}:{},children:e.shape.el})})}var Bae=12,Kv=6,Vae=3,qv=12;function Hae({curve:e,data:t,profile:n,look:r}){let i=n.edge?.marks===!0,a=i&&t.polarity!==void 0?Sv(e,.82):void 0,o=i&&t.delay===!0?Sv(e,.5):void 0,s=r.kind.zigzag===!0?Sv(e,.5):void 0;return(0,D.jsxs)(D.Fragment,{children:[a!==void 0&&t.polarity!==void 0&&(0,D.jsx)(`text`,{className:`dg-polarity`,x:a.point.x+a.normal.x*Bae,y:a.point.y+a.normal.y*Bae,textAnchor:`middle`,dominantBaseline:`central`,style:r.polarityColor===void 0?void 0:{fill:r.stroke},children:t.polarity===`-`?`−`:`+`}),o!==void 0&&(0,D.jsx)(`g`,{className:`dg-delay`,children:[-3,Vae].map(e=>{let t=o.point.x+o.tangent.x*e,n=o.point.y+o.tangent.y*e;return(0,D.jsx)(`line`,{x1:t-o.normal.x*Kv,y1:n-o.normal.y*Kv,x2:t+o.normal.x*Kv,y2:n+o.normal.y*Kv},e)})}),s!==void 0&&(0,D.jsx)(`polyline`,{className:`dg-edge-zigzag`,points:[[-12,4],[2,-2],[-2,2],[qv,-4]].map(([e,t])=>{let{point:n,tangent:r,normal:i}=s;return`${n.x+e*r.x+t*i.x},${n.y+e*r.y+t*i.y}`}).join(` `),fill:`none`,strokeWidth:1.75,stroke:r.stroke})]})}function Jv({comments:e,links:t}){if(e===0&&t===0)return;let n=[];return e>0&&n.push(`${e} comment${e===1?``:`s`}`),t>0&&n.push(`${t} link${t===1?``:`s`}`),{text:e>0?String(e):`↗`,title:n.join(`, `)}}var Yv=(0,v.createContext)(null);function Xv({className:e,target:t,edge:n,state:r,title:i,text:a,style:o}){let s=(0,v.useContext)(Yv);if(s===null||t===void 0)return(0,D.jsx)(`span`,{className:e,"data-edge":n,"data-state":r,title:i,style:o,children:a});let c=s.isOpen(zt(t));return(0,D.jsx)(`button`,{type:`button`,className:`${e} nodrag${n===void 0?``:` nopan`}`,"data-edge":n,"data-state":r,title:i,"aria-expanded":c,"aria-label":`${i} — ${c?`hide`:`show`}`,style:o,onMouseDown:Qv,onClick:e=>{e.stopPropagation(),s.toggle(t)},children:a})}function Zv({className:e,edge:t,state:n,style:r,onAdd:i,onPointerDown:a}){return(0,D.jsx)(`button`,{type:`button`,className:e,"data-edge":t,"data-state":n,"aria-label":`Add a threat`,title:`Add a threat`,style:r,onMouseDown:Qv,onPointerDown:a,onClick:e=>{e.stopPropagation(),i()},children:`+`})}var Qv=e=>e.stopPropagation();function $v({open:e,total:t}){return{state:e>0?`open`:`handled`,text:e>0?String(e):`✓`,title:`${e} open of ${t} threat${t===1?``:`s`}`}}var ey=10,Uae=24,Wae=e=>({x:e.point.x+e.normal.x*ey,y:e.point.y+e.normal.y*ey});function ty(e,t){let n=Sv(e,t),r=Wae(n);return{frame:n,at:r,transform:`translate(-50%, -50%) translate(${r.x}px, ${r.y}px)`}}function Gae({id:e,data:t,curve:n,profile:r}){let{threatBadge:i,addThreat:a}=Kae(t,r),o=i!==void 0||a!==void 0?ty(n,.75):void 0,s=t.annotations===void 0?void 0:Jv(t.annotations),c=s===void 0?void 0:ty(n,.25),l=(0,v.useContext)(Yv),u=t.threatRelation===void 0?void 0:{relation:t.threatRelation};return qae(l,{relation:i!==void 0||s!==void 0?t.threatRelation:void 0,spot:i===void 0?c:o,curve:n}),(0,D.jsxs)(D.Fragment,{children:[o!==void 0&&i!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(Xv,{className:`dg-threat-badge dg-edge-threat`,target:u,edge:e,state:i.state,title:i.title,text:i.text,style:{transform:o.transform}})}),c!==void 0&&s!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(Xv,{className:`dg-comment-badge dg-edge-comment`,target:u,edge:e,title:s.title,text:s.text,style:{transform:c.transform}})}),o!==void 0&&a!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(Zv,{className:`dg-threat-badge dg-edge-threat nodrag nopan`,edge:e,state:`empty`,style:{transform:o.transform},onAdd:a})})]})}function Kae(e,t){let n=e.threats!==void 0&&e.threats.total>0?e.threats:void 0,r=n===void 0&&e.onAddThreat!==void 0&&t.offersThreats===!0?e.onAddThreat:void 0;return{threatBadge:n===void 0?void 0:$v(n),addThreat:r}}function qae(e,t){let{relation:n,curve:r}=t,i=t.spot?.at.x,a=t.spot?.at.y,o=t.spot?.frame.normal.x,s=t.spot?.frame.normal.y,c=(0,v.useRef)([]),l=``;e!==null&&n!==void 0&&(c.current=Array.from({length:25},(e,t)=>{let n=r.point(t/Uae);return{x:Math.round(n.x),y:Math.round(n.y)}}),l=c.current.map(e=>`${e.x},${e.y}`).join(`;`)),(0,v.useEffect)(()=>{e!==null&&n!==void 0&&i!==void 0&&a!==void 0&&o!==void 0&&s!==void 0&&e.placeBadge(n,{x:i,y:a},{x:o,y:s},c.current)},[e,n,i,a,o,s,l])}function Jae(e,t,n){let r=t?.relStyle,i=t?.kindRegistry.resolve(t.kind)??{},a=r?.width??i.width??1.5,o=r?.line??(i.dashed===!0?`dashed`:`solid`),s=r?.animated??i.animated===!0;return{kind:i,...Xae(t,n),strokeWidth:a,line:o,animated:s,dashArray:Zae(o,a,s,t?.edgeLook?.dash),...Qae(e,{end:r?.end??i.endMarker??`arrow`,start:i.startMarker},t?.edgeLook?.openArrow),markerSize:10+a*2}}function Yae(e){return{stroke:e.stroke,strokeWidth:e.strokeWidth,...e.dashArray===void 0?{}:{strokeDasharray:e.dashArray},...e.line===`dotted`?{strokeLinecap:`round`}:{},...e.animated?{animation:`dg-flow 0.7s linear infinite`}:{}}}function Xae(e,t){let n=e?.polarity===void 0?void 0:t.edge?.polarityColors?.[e.polarity];return{stroke:e?.relStyle?.color??e?.tint??e?.notationColor??n??`var(--dg-edge)`,polarityColor:n}}function Zae(e,t,n,r){return e===`dashed`?r?.dashed??`6 4`:e===`dotted`?`0.1 ${Math.max(5,t*3)}`:n?`6 4`:r?.solid}function Qae(e,t,n){let r=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return{end:ny(`dg-end-${r}`,t.end,n),start:ny(`dg-start-${r}`,t.start,n)}}function ny(e,t,n){if(t===void 0)return;if(t===`arrow`&&n===!0)return{id:e,style:`open-arrow`,shape:Uv};let r=Hv[t];return r===void 0?void 0:{id:e,style:t,shape:r}}var ry=e=>({x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0});function iy(e,t){let n=ry(e),r=ry(t),i=n.width/2||1,a=n.height/2||1,o=n.x+i,s=n.y+a,c=r.x+(r.width/2||1),l=r.y+(r.height/2||1),u=(c-o)/(2*i)-(l-s)/(2*a),d=(c-o)/(2*i)+(l-s)/(2*a),f=1/(Math.abs(u)+Math.abs(d)||1),p=f*u,m=f*d;return{x:i*(p+m)+o,y:a*(-p+m)+s}}function ay(e,t){let n=ry(e),r=Math.round(n.x),i=Math.round(n.y),a=Math.round(t.x),o=Math.round(t.y);return a<=r+1?ym.Left:a>=r+n.width-1?ym.Right:o<=i+1?ym.Top:o>=i+n.height-1?ym.Bottom:ym.Top}var $ae=e=>e!=null&&ee.includes(e)?e:void 0,eoe={top:ym.Top,right:ym.Right,bottom:ym.Bottom,left:ym.Left};function toe(e){switch(e){case ym.Top:return`top`;case ym.Right:return`right`;case ym.Bottom:return`bottom`;case ym.Left:return`left`}}function noe(e,t,n){let r=e??(t.source===n.from?t.target===n.to?null:`target`:`source`);if(r===`source`)return{end:`from`,side:t.source===n.from?$ae(t.sourceHandle)??null:null};if(r===`target`)return{end:`to`,side:t.target===n.to?$ae(t.targetHandle)??null:null}}function roe(e,t){let n=ry(e);switch(t){case`top`:return{x:n.x+n.width/2,y:n.y};case`bottom`:return{x:n.x+n.width/2,y:n.y+n.height};case`left`:return{x:n.x,y:n.y+n.height/2};case`right`:return{x:n.x+n.width,y:n.y+n.height/2}}}function ioe(e,t,n){let r=n?.sourceSide===void 0?iy(e,t):roe(e,n.sourceSide),i=n?.targetSide===void 0?iy(t,e):roe(t,n.targetSide);return{sx:r.x,sy:r.y,tx:i.x,ty:i.y,sourcePos:n?.sourceSide===void 0?ay(e,r):eoe[n.sourceSide],targetPos:n?.targetSide===void 0?ay(t,i):eoe[n.targetSide]}}var aoe=5,ooe=16;function soe({ends:e,data:t}){let n=t.onSetSide;if(n===void 0||t.fixedSideDotsShown!==!0||t.constituentCount!==1)return null;let r=e.tx-e.sx,i=e.ty-e.sy,a=Math.hypot(r,i)||1,o=-i/a*ooe,s=r/a*ooe,c=t.relStyle?.fromSide!==void 0,l=t.relStyle?.toSide!==void 0;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(oy,{end:`from`,cx:e.sx+o,cy:e.sy+s,fixed:c,onToggle:()=>n(`from`,c?null:toe(e.sourcePos))}),(0,D.jsx)(oy,{end:`to`,cx:e.tx+o,cy:e.ty+s,fixed:l,onToggle:()=>n(`to`,l?null:toe(e.targetPos))})]})}function oy({end:e,cx:t,cy:n,fixed:r,onToggle:i}){return(0,D.jsx)(`circle`,{className:`dg-edge-pin${r?` pinned`:``}`,"data-end":e,cx:t,cy:n,r:aoe,role:`button`,"aria-label":`${r?`Unpin`:`Pin`} ${e===`from`?`source`:`target`} end`,onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),i()}})}var sy=7.2,cy=20,ly=24,coe=16,loe=160,uoe=340;function doe(e,t=``){let n=e=>ly+e.name.length*sy+coe+(e.type?.length??0)*sy,r=e.reduce((e,t)=>Math.max(e,n(t)),0),i=t.length*sy;return{width:Math.min(uoe,Math.max(loe,Math.round(Math.max(r,i)+cy))),height:30+e.length*22}}function uy(e,t,n){let r=t,i=e=>{e.columns!==void 0&&e.node.type===`db-table`&&n?.[e.id]===void 0&&(r===t&&(r=new Map(t)),r.set(e.id,doe(e.columns,e.node.name))),e.children.forEach(i)};return e.forEach(i),r}function dy(e){return 30+e*22+22/2}function fy(e,t,n){if(n===void 0||t.columns===void 0||e.pos!==ym.Left&&e.pos!==ym.Right)return e;let r=t.columns.findIndex(e=>e.name===n);return r<0?e:{x:e.pos===ym.Left?t.x:t.x+t.width,y:t.y+dy(r),pos:e.pos}}function foe(e,t){let n=A(e.source),r=A(e.target),i=(n?.measured?.width??0)>0&&(r?.measured?.width??0)>0,a=t?.relStyle,o={ends:i&&n!==void 0&&r!==void 0?ioe(n,r,{sourceSide:a?.fromSide,targetSide:a?.toSide}):{sx:e.sourceX,sy:e.sourceY,tx:e.targetX,ty:e.targetY,sourcePos:e.sourcePosition,targetPos:e.targetPosition},measured:i,selfLoop:e.source===e.target,source:poe(n),target:poe(r)};return{...o,...moe(o,t)}}function poe(e){if(e!==void 0)return{node:e,rect:{x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0,columns:e.data.columns}}}function moe(e,t){let{ends:n,measured:r,source:i,target:a}=e,o={x:n.sx,y:n.sy},s={x:n.tx,y:n.ty};if(r&&t?.fromColumn!==void 0&&i?.rect.columns!==void 0){let e=fy({x:n.sx,y:n.sy,pos:n.sourcePos},i.rect,t.fromColumn);o={x:e.x,y:e.y}}let c=t?.toColumn??a?.rect.columns?.find(e=>e.pk===!0)?.name;if(r&&c!==void 0&&a?.rect.columns!==void 0&&(t?.fromColumn!==void 0||t?.toColumn!==void 0)){let e=fy({x:n.tx,y:n.ty,pos:n.targetPos},a.rect,c);s={x:e.x,y:e.y}}return{from:o,to:s}}function py(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function hoe(e,t){return e[0]===t[0]&&e[1]===t[1]}function goe(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)py(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];hoe(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)py(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),py(r,t,n)})(c,s,-i)}return c}function my(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),goe(e,r,n,i||1)}var hy=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=my(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function gy(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var _y=class extends hy{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=my(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)gy([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},vy=class extends hy{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},_oe=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=my(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=gy(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},voe=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=my(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=gy(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},yoe=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=my(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=gy(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},yy={},by=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},boe=0,xy=1,xoe=2,Sy={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Soe(e,t){return e.type===t}function Cy(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:boe,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:xy,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:xoe,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!Soe(a,xoe);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return Cy(`M0,0`+e);i++,o=Sy[a.text],r=a.text}else Soe(a,xy)?o=Sy[r]:(i++,o=Sy[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!Soe(t,xy))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof Sy[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function wy(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Ty(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(Dy(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function Ey(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Dy(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=Ey(e,t,-u),[n,r]=Ey(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Dy(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],ee=[n+C*x,r-w*b],te=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,ee,te].concat(f);{f=[E,ee,te].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=Ey(f[t][0],f[t][1],u),r=Ey(f[t+1][0],f[t+1][1],u),i=Ey(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var Oy={randOffset:function(e,t){return zy(e,t)},randOffsetWithRange:function(e,t,n){return Ry(e,t,n)},ellipse:function(e,t,n,r,i){return Ny(e,t,i,Coe(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return By(e,t,n,r,i,!0)}};function ky(e,t,n,r,i){return{type:`path`,ops:By(e,t,n,r,i)}}function Ay(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...By(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...By(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?ky(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function jy(e,t,n,r,i){return function(e,t){return Ay(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function My(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=Vy(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Vy(n[0],1.5*(1+.22*t.roughness),Ly(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=Vy(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Vy(a,1.5*(1+.22*t.roughness),Ly(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function Coe(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=zy(o*c,n),s+=zy(s*c,n),{increment:a,rx:o,ry:s}}function Ny(e,t,n,r){let[i,a]=Doe(r.increment,e,t,r.rx,r.ry,1,r.increment*Ry(.1,Ry(.4,1,n),n),n),o=Hy(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Doe(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Hy(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function Py(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=zy(.01*d,c),f+=zy(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=Ooe(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=Ooe(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...By(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...By(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function woe(e,t){let n=Ty(wy(Cy(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...By(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Uy(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...By(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function Fy(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+zy(e,t),r[0][1]+zy(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+zy(e,t),r[a][1]+zy(e,t)]})}}return{type:`fillPath`,ops:n}}function Iy(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!yy[n])switch(n){case`zigzag`:yy[n]||(yy[n]=new _y(t));break;case`cross-hatch`:yy[n]||(yy[n]=new vy(t));break;case`dots`:yy[n]||(yy[n]=new _oe(t));break;case`dashed`:yy[n]||(yy[n]=new voe(t));break;case`zigzag-line`:yy[n]||(yy[n]=new yoe(t));break;default:n=`hachure`,yy[n]||(yy[n]=new hy(t))}return yy[n]}(t,Oy).fillPolygons(e,t)}function Ly(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Toe(e){return e.randomizer||=new by(e.seed||0),e.randomizer.next()}function Ry(e,t,n,r=1){return n.roughness*r*(Toe(n)*(t-e)+e)}function zy(e,t,n=1){return Ry(-e,e,t,n)}function By(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Eoe(e,t,n,r,i,!0,!1);if(o)return s;let c=Eoe(e,t,n,r,i,!0,!0);return s.concat(c)}function Eoe(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*Toe(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=zy(p,i,l),m=zy(m,i,l);let h=[],g=()=>zy(d,i,l),_=()=>zy(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:zy(u,i,l)),t+(v?0:zy(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function Vy(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+zy(t,n),e[0][1]+zy(t,n)]),r.push([e[0][0]+zy(t,n),e[0][1]+zy(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+zy(t,n),e[i][1]+zy(t,n)]),i===e.length-1&&r.push([e[i][0]+zy(t,n),e[i][1]+zy(t,n)]);return Hy(r,null,n)}function Hy(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+zy(e,n),t[1]+zy(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Eoe(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Doe(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=zy(.5,s)-Math.PI/2;l.push([zy(a,s)+t+.9*r*Math.cos(u-e),zy(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[zy(a,s)+t+r*Math.cos(o),zy(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([zy(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),zy(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([zy(a,s)+t+.98*r*Math.cos(u+o),zy(a,s)+n+.98*i*Math.sin(u+o)]),l.push([zy(a,s)+t+.9*r*Math.cos(u+.5*o),zy(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function Ooe(e,t,n,r,i,a,o,s,c){let l=a+zy(.1,c),u=[];u.push([zy(s,c)+t+.9*r*Math.cos(l-e),zy(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([zy(s,c)+t+r*Math.cos(a),zy(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Hy(u,null,c)}function Uy(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:zy(l[0],s)),o[1]+(f?0:zy(l[0],s))]}),u=f?[i,a]:[i+zy(l[p],s),a+zy(l[p],s)],c.push({op:`bcurveTo`,data:[e+zy(l[p],s),t+zy(l[p],s),n+zy(l[p],s),r+zy(l[p],s),u[0],u[1]]});return c}function Wy(e){return[...e]}function Gy(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(Wy(e[0]),Wy(e[1]),Wy(e[2]),Wy(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(Wy(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function Ky(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function qy(e,t,n){let r=Ky(t,n);if(r===0)return Ky(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Ky(e,Jy(t,n,i))}function Jy(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Yy(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(Ky(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Jy(a,o,r),u=Jy(o,s,r),d=Jy(s,c,r),f=Jy(l,u,r),p=Jy(u,d,r),m=Jy(f,p,r);Yy([a,l,f,m],0,n,i),Yy([m,p,d,c],0,n,i)}var a,o;return i}function koe(e,t){return Xy(e,0,e.length,t)}function Xy(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=qy(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Xy(e,t,l+1,r,a),Xy(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Zy(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Yy(e,3*n,t,r);return n&&n>0?Xy(r,0,r.length,n):r}var Qy=`none`,$y=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[ky(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=jy(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(Fy([i],a)):o.push(Iy([i],a))}return a.stroke!==Qy&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=Coe(n,r,a),c=Ny(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=Ny(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(Iy([c.estimatedPoints],a));return a.stroke!==Qy&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[Ay(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=Py(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=Py(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=zy(.01*l,o),u+=zy(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),Iy([m],o)}(e,t,n,r,i,a,c));return c.stroke!==Qy&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=My(e,n);if(n.fill&&n.fill!==Qy)if(n.fillStyle===`solid`){let t=My(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Zy(Gy([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Zy(Gy(r),10,(1+n.roughness)/2))}t.length&&r.push(Iy([t],n))}return n.stroke!==Qy&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=Ay(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(Fy([e],n)):r.push(Iy([e],n))),n.stroke!==Qy&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Qy,a=n.stroke!==Qy,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=Ty(wy(Cy(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Zy(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=koe(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=woe(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=woe(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(Fy(s,n));else r.push(Iy(s,n));return a&&(o?s.forEach((e=>{r.push(Ay(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Qy};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Qy,strokeWidth:0,fill:n.fill||Qy};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Qy,strokeWidth:n,fill:Qy}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},Aoe=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new $y(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},eb=`http://www.w3.org/2000/svg`,tb=class{constructor(e,t){this.svg=e,this.gen=new $y(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(eb,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(eb,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(eb,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(eb,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},nb={canvas:(e,t)=>new Aoe(e,t),svg:(e,t)=>new tb(e,t),generator:e=>new $y(e),newSeed:()=>$y.newSeed()}.generator(),rb=`sentinel-fill`,ib=`sentinel-stroke`;function ab(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0||1}var ob=({style:e,seed:t})=>({roughness:e.roughness,bowing:e.bowing,strokeWidth:e.strokeWidth,fillStyle:e.fillStyle,...e.fillWeight===void 0?{}:{fillWeight:e.fillWeight},...e.hachureGap===void 0?{}:{hachureGap:e.hachureGap},fill:rb,stroke:ib,seed:t});function sb(e){let t=t=>e.filter(t).map(e=>e.d).join(` `);return{fill:t(e=>e.fill===rb),hatch:t(e=>e.stroke===rb),stroke:t(e=>e.stroke===ib)}}function cb(e,t){let n=Math.min(e*.2,24);return[[n,1],[e-n,1],[e-1,t/2],[e-n,t-1],[n,t-1],[1,t/2]]}var lb={left:14,width:16,height:12};function joe(e,t,n,r=(e,t,n)=>[`L ${n} ${t}`]){let i=e-1,a=t-1,o=Math.max(0,Math.min(n,(i-1)/2,(a-1)/2));return[`M ${1+o} 1`,`L ${i-o} 1`,`Q ${i} 1 ${i} ${1+o}`,`L ${i} ${a-o}`,`Q ${i} ${a} ${i-o} ${a}`,...r(i-o,a,1+o),`Q 1 ${a} 1 ${a-o}`,`L 1 ${1+o}`,`Q 1 1 ${1+o} 1`,`Z`].join(` `)}function Moe(e,t,n){return joe(e,t,n,(e,t,n)=>{let r=Math.max(n,Math.min(n+lb.left,e));return[`L ${Math.min(r+lb.width,e)} ${t}`,`L ${r} ${t+lb.height}`,`L ${r} ${t}`,`L ${n} ${t}`]})}function Noe(e,t,n,r=0){let i=Math.max(2,t.width),a=Math.max(2,t.height),o=ob(n);return sb((e===`circle`?[nb.circle(i/2,a/2,Math.min(i,a)-2,o)]:e===`person`?[nb.circle(i/2,Math.min(a*.22,18),Math.min(i,a)*.32,o),nb.rectangle(i*.12,Math.min(a*.38,30),i*.76,a-Math.min(a*.38,30)-1,o)]:e===`hexagon`?[nb.polygon(cb(i,a),o)]:e===`cylinder`?[nb.rectangle(1,8,i-2,a-10,o),nb.ellipse(i/2,8,i-6,14,o)]:e===`bubble`?[nb.path(Moe(i,a,r),o)]:e===`diamond`?[nb.polygon([[i/2,1],[i-1,a/2],[i/2,a-1],[1,a/2]],o)]:e===`bar`?[nb.rectangle(1,1,i-2,a-2,{...o,fillStyle:`solid`})]:e===`start-dot`?[nb.circle(i/2,a/2,Math.min(i,a)-2,{...o,fillStyle:`solid`})]:e===`end-bullseye`?[nb.circle(i/2,a/2,Math.min(i,a)-2,o),nb.circle(i/2,a/2,(Math.min(i,a)-2)*.55,{...o,fillStyle:`solid`})]:e===`send-signal`?[nb.polygon([[1,1],[i-15,1],[i-1,a/2],[i-15,a-1],[1,a-1]],o)]:e===`receive-signal`?[nb.polygon([[1,1],[i-1,1],[i-1,a-1],[1,a-1],[15,a/2]],o)]:e===`note`?[nb.polygon([[1,1],[i-15,1],[i-1,15],[i-1,a-1],[1,a-1]],o),nb.linearPath([[i-15,1],[i-15,15],[i-1,15]],o)]:e===`ellipse`?[nb.ellipse(i/2,a/2,i-2,a-2,o)]:e===`store`?[nb.line(1,1,i-1,1,o),nb.line(1,a-1,i-1,a-1,o)]:r>0?[nb.path(joe(i,a,r),o)]:[nb.rectangle(1,1,i-2,a-2,o)]).flatMap(e=>nb.toPaths(e)))}function Poe(e,t,n){let r=Math.max(2,t);return sb(nb.toPaths(nb.circle(e.x,e.y,r,ob(n))))}function Foe(e,t){let n={...ob(t),fill:void 0,disableMultiStroke:!0},r=nb.toPaths(nb.path(e,n)).filter(e=>e.stroke===ib).map(e=>e.d).join(` `);return r===``?e:r}function ub(e){let t=new Map;for(let n of e){if(n.from===n.to)continue;let e=n.from<n.to,r=e?`${n.from}\0${n.to}`:`${n.to}\0${n.from}`,i=t.get(r)??[];i.push({id:n.id,forward:e}),t.set(r,i)}let n=new Map;for(let e of t.values())e.forEach(({id:e,forward:t},r)=>{if(r===0)return;let i=Math.ceil(r/2)*32*(r%2==1?1:-1);n.set(e,t?i:-i)});return n}var db=e=>Math.abs(e)*4/3;function fb(e){let t=e.shape===`curved`,n=t&&!e.profileBows?e.parallelBow??0:0;return n===0?{bowed:t&&e.profileBows,side:e.side??`left`,bulge:void 0}:{bowed:!0,side:n>0?`left`:`right`,bulge:db(n)}}var pb=28,Ioe=18,Loe=.2,Roe=10,mb=4,zoe=16,hb=4.5,gb=e=>pb+e*Ioe,_b=e=>Math.max(vb(e),zoe),vb=e=>Math.max(e*Loe,Math.min(e/2-mb,Roe),0);function yb(e,t,n,r){let i=gb(n),a=i*4/3,o=t===`DOWN`||t===`UP`,s=o?e.height:e.width,c=vb(s),l=(_b(s)-c)*hb,u=(t,n)=>o?{x:e.x+e.width+n,y:e.y+s/2+t}:{x:e.x+s/2+t,y:e.y-n},d=i+10+(o?r/2:0);return{from:u(-c,0),c1:u(-c-l,a),c2:u(c+l,a),to:u(c,0),label:u(0,d)}}function bb(e,t,n=0,r=0){let{from:i,c1:a,c2:o,to:s,label:c}=yb(e,t,n,r);return{path:`M ${i.x} ${i.y} C ${a.x} ${a.y} ${o.x} ${o.y} ${s.x} ${s.y}`,labelX:c.x,labelY:c.y}}function xb(e,t,n=0){let{from:r,c1:i,c2:a,to:o}=yb(e,t,n,0),s=e=>[r[e],i[e],a[e],o[e]],c=(e,[t,n,r,i])=>(1-e)**3*t+3*(1-e)**2*e*n+3*(1-e)*e**2*r+e**3*i,l=(e,[t,n,r,i])=>3*(1-e)**2*(n-t)+6*(1-e)*e*(r-n)+3*e**2*(i-r);return{point:e=>({x:c(e,s(`x`)),y:c(e,s(`y`))}),tangent:e=>{let t=l(e,s(`x`)),n=l(e,s(`y`)),r=Math.hypot(t,n)||1;return{x:t/r,y:n/r}}}}function Sb(e){let t=new Map,n=new Map;for(let r of e){if(r.from!==r.to)continue;let e=t.get(r.from)??0;n.set(r.id,e),t.set(r.from,e+1)}return n}function Boe(e,t,n,r){let i=Cb(t,n),{path:a,curve:o,label:s,labelSpot:c}=t.selfLoop?Uoe(t,n):i!==void 0&&n!==void 0?Hoe(i,t,n):Woe(t,n,r);return{path:a,renderPath:(0,v.useMemo)(()=>n?.stylePreset?.rough===void 0?a:Foe(a,{style:n.stylePreset.rough,seed:ab(e)}),[n?.stylePreset,a,e]),curve:o,label:s,labelSpot:c}}function Cb(e,t){let n=t?.route;if(t===void 0||n===void 0||n.length<2||t.fromColumn!==void 0||t.toColumn!==void 0)return;let r=t.relStyle;return r?.shape===void 0&&(r?.fromSide===void 0||r.fromSide===Ev(n).from)&&(r?.toSide===void 0||r.toSide===Ev(n).to)&&Voe(e.source,t.routeFrom)&&Voe(e.target,t.routeTo)?n:void 0}var Voe=(e,t)=>e!==void 0&&t!==void 0&&Math.abs(e.node.internals.positionAbsolute.x-t.x)<.5&&Math.abs(e.node.internals.positionAbsolute.y-t.y)<.5;function Hoe(e,t,n){let r=e=>!t.measured||e===void 0?void 0:{...e.rect,height:e.rect.height+Goe(e.node.data)},i=Nae(Mae(e),r(t.source),r(t.target)),a=xv(i),o=n.labelSpot===void 0?void 0:wv(i,n.labelSpot);return{path:Tv(i,n.routeCorner??8),curve:a,label:o??a.point(.5),labelSpot:o}}function Uoe(e,t){let n=t?.selfLoop?.direction??`RIGHT`,r=t?.selfLoop?.index??0,i=e.source?.rect??{x:e.from.x,y:e.from.y,width:0,height:0},a=bb(i,n,r,t?.selfLoop?.labelWidth),o={x:a.labelX,y:a.labelY};return{path:a.path,curve:xb(i,n,r),label:o,labelSpot:o}}function Woe(e,t,n){let r=t?.relStyle,i=r?.shape??`curved`,a={sourceX:e.from.x,sourceY:e.from.y,targetX:e.to.x,targetY:e.to.y,sourcePosition:e.ends.sourcePos,targetPosition:e.ends.targetPos},o=r?.curvature??n.edgeCurvature,{bowed:s,side:c,bulge:l}=fb({shape:i,profileBows:n.edge?.bowed===!0,side:r?.bow,parallelBow:t?.parallelBow}),u=jae({shape:s?`bow`:i,params:a,curvature:o,side:c,bulge:l}),d,f,p;if(i===`straight`)[d,f,p]=Jm({sourceX:a.sourceX,sourceY:a.sourceY,targetX:a.targetX,targetY:a.targetY});else if(i===`step`)[d,f,p]=Zm(a);else if(s){let e=u.point(.5);d=gv(a,o??.25,c,l),f=e.x,p=e.y}else[d,f,p]=qm({...a,...o===void 0?{}:{curvature:o}});return{path:d,curve:u,label:{x:f,y:p},labelSpot:void 0}}function Goe(e){return e.state!==`leaf`||e.label===``?0:e.image===void 0&&e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).captionBelow===!0?Pv(e.label).height:e.image===void 0||e.shape!==void 0||e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).cornerBadge===!0?0:20}function Koe({id:e,source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,data:l}){let u=foe({source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c},l),d=Nl(l?.notation),{path:f,renderPath:p,curve:m,label:h,labelSpot:g}=Boe(e,u,l,d),_=Jae(e,l,d);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`g`,{className:Tb((0,v.useContext)(fv),e),children:[(0,D.jsx)(zae,{end:_.end,start:_.start,stroke:_.stroke,size:_.markerSize}),(0,D.jsx)(Hg,{id:e,path:p,..._.end===void 0?{}:{markerEnd:`url(#${_.end.id})`},..._.start===void 0?{}:{markerStart:`url(#${_.start.id})`},style:Yae(_)}),(0,D.jsx)(`path`,{d:f,fill:`none`,stroke:`transparent`,strokeWidth:14,children:(0,D.jsx)(`title`,{children:wb(l)})}),l!==void 0&&(0,D.jsx)(Hae,{curve:m,data:l,profile:d,look:_})]}),l!==void 0&&(0,D.jsx)(soe,{ends:u.ends,data:l}),l!==void 0&&(0,D.jsx)(zv,{data:l,curve:m,label:h,labelSpot:g}),l!==void 0&&(0,D.jsx)(Gae,{id:e,data:l,curve:m,profile:d})]})}function wb(e){return`${e?.kind??``}${e!==void 0&&e.constituentCount>1?` ×${e.constituentCount}`:``}${e?.labels===void 0&&e?.label!==void 0?` — ${e.label}`:``}`}function Tb(e,t){return e.active?e.edges.has(t)?e.variant===`loop`?`dg-loop-edge-hl`:void 0:e.variant===`loop`?`dg-loop-edge-dim`:`dg-focus-edge-dim`:void 0}var qoe={fill:14,stroke:100},Eb=.35;function Joe({id:e,kind:t,width:n,height:r,color:i,preset:a,fill:o=`preset`}){let s=a.rough,c=(0,v.useMemo)(()=>ab(e),[e]),l=s!==void 0&&s.fillStyle!==`solid`&&o===`preset`,u=(0,v.useMemo)(()=>{if(s===void 0)return null;let e=a.cornerRadius??0,i={width:n,height:r},o=Noe(t,i,{style:{...s,fillStyle:`solid`},seed:c},e);return l?{...Noe(t,i,{style:s,seed:c},e),fill:o.fill}:o},[t,n,r,c,s,l,a.cornerRadius]);if(u===null||s===void 0)return null;let d=a.colorMix??qoe,f=(e,t)=>i===void 0?void 0:`color-mix(in srgb, ${i} ${e}%, var(${t}))`,p=f(d.fill,`--dg-node-fill`),m=f(d.stroke,`--dg-node-stroke`);return(0,D.jsxs)(`svg`,{className:`dg-sketch-shape`,width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`,children:[o!==`none`&&u.fill!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-fill`,d:u.fill,style:p===void 0?void 0:{fill:p}}),l&&u.hatch!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-hatch`,d:u.hatch,style:{strokeWidth:s.fillWeight??1,opacity:s.hatchOpacity??Eb,stroke:m}}),(0,D.jsx)(`path`,{className:`dg-sketch-stroke`,d:u.stroke,style:{strokeWidth:s.strokeWidth,stroke:m}})]})}var Db=e=>e.startsWith(`var(`)?e:`color-mix(in srgb, ${e} var(--dg-outline-ink, 100%), var(--dg-text))`;function Ob(e){if(e!==void 0)return{borderColor:e,background:`color-mix(in srgb, ${e} var(--dg-node-accent-tint, 14%), var(--dg-node-fill))`}}var Yoe=e=>e===`circle`||e===`cylinder`||e===`hexagon`||e===`bubble`||e===`person`||e===`diamond`||e===`bar`||e===`start-dot`||e===`end-bullseye`||e===`send-signal`||e===`receive-signal`||e===`note`||e===`ellipse`||e===`store`?e:`box`,kb=(e,t,n)=>t!==void 0&&n.startsWith(`/library/`)?`${t}${n.slice(9)}`:n.startsWith(`/`)||/^https?:/.test(n)?n:`${e??``}${n}`,Ab=(e,t,{id:n,width:r,height:i},a=`preset`)=>e.stylePreset?.rough!==void 0&&r!==void 0&&i!==void 0&&r>0&&i>0?(0,D.jsx)(Joe,{id:n,kind:Yoe(t),width:r,height:i,preset:e.stylePreset,fill:a,color:e.color===void 0?void 0:a===`none`?Db(e.color):e.color}):null;function jb({id:e,data:t,selected:n}){if(t.resizeAxis!==`x`||t.onResize===void 0||n!==!0)return null;let r=t.onResize,i=(t,n)=>r(e,n.width,n.height,{x:n.x,y:n.y});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(z_,{position:`left`,resizeDirection:`horizontal`,minWidth:js.DAY,className:`dg-x-resize`,onResizeEnd:i}),(0,D.jsx)(z_,{position:`right`,resizeDirection:`horizontal`,minWidth:js.DAY,className:`dg-x-resize`,onResizeEnd:i})]})}var Mb=(e,t)=>t.node?.typelessAsText===!0&&e.typeId===void 0&&e.state!==`leaf`,Xoe=(e,t)=>e.icon===void 0?e.typeId===void 0?void 0:e.icons.resolve(t.icon??``):e.icons.resolve(e.icon);function Nb({data:e}){return e.metaBadges!==void 0&&e.metaBadges.length>0?(0,D.jsx)(`span`,{className:`dg-meta`,children:e.metaBadges.map(e=>(0,D.jsx)(`span`,{className:`dg-meta-badge`,children:e},e))}):null}function Zoe(e,t,n,r){let i=r.focusId,a=i===null?void 0:t.chips?.find(e=>e.refId===i),o=t.typeId!==void 0&&n.node?.actorOutline?.(t.typeId)===!0,s=a===void 0?i!==null&&o&&e!==i&&r.nodes.has(e)?t.color??`var(--dg-accent)`:void 0:a.color??`var(--dg-accent)`;return{hitStyle:s===void 0?void 0:{"--dg-hit":s},hitAttrs:s===void 0?{}:{"data-plan-hit":!0}}}var Pb=e=>e.dropTarget===!0?{"data-drop-target":!0}:{};function Qoe({data:e,style:t}){let n=e.typeId===void 0?void 0:$s(t.label??e.typeId,e.technology);return n!==void 0&&n!==``?(0,D.jsx)(`span`,{className:`dg-type`,children:n}):null}var Fb=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(kg,{id:`top`,type:`source`,position:ym.Top,className:`dg-handle`}),(0,D.jsx)(kg,{id:`right`,type:`source`,position:ym.Right,className:`dg-handle`}),(0,D.jsx)(kg,{id:`bottom`,type:`source`,position:ym.Bottom,className:`dg-handle`}),(0,D.jsx)(kg,{id:`left`,type:`source`,position:ym.Left,className:`dg-handle`})]});function $oe({data:e}){if(e.link===void 0)return null;let t=e.link;return(0,D.jsx)(`button`,{type:`button`,className:`dg-link-badge`,title:t,"aria-label":`Open ${t}`,onClick:n=>{n.stopPropagation(),e.onOpenLink===void 0?/^https?:/.test(t)&&window.open(t,`_blank`,`noopener`):e.onOpenLink(t)},children:`🔗`})}function ese({id:e,data:t}){let n=t.threats;if(n===void 0||n.total===0){if(t.onAddThreat===void 0||Nl(t.notation).offersThreats!==!0)return null;let n=t.onAddThreat;return(0,D.jsx)(Zv,{className:`dg-threat-badge nodrag`,state:`empty`,onAdd:()=>n({node:e})})}let{state:r,text:i,title:a}=$v(n);return(0,D.jsx)(Xv,{className:`dg-threat-badge`,target:nse(e,t),state:r,title:a,text:i})}function tse({id:e,data:t}){let n=t.annotations===void 0?void 0:Jv(t.annotations);return n===void 0?null:(0,D.jsx)(Xv,{className:`dg-comment-badge`,target:nse(e,t),title:n.title,text:n.text})}var nse=(e,t)=>t.external===!0?void 0:{node:e};function Ib({id:e,data:t,selected:n,side:r}){if(n!==!0||t.quickAdd===void 0)return null;let i=t.quickAdd.label(e,r);if(i===void 0)return null;let a=t.quickAdd.run;return(0,D.jsx)(`button`,{type:`button`,className:`dg-quick-add nodrag`,title:r===`before`?i:`${i} (Tab)`,"aria-label":i,"data-side":r,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),r===void 0?a(e):a(e,r)},children:`+`})}function Lb({id:e,data:t,selected:n,uses:r}){return(0,D.jsxs)(D.Fragment,{children:[r.includes(`link`)&&(0,D.jsx)($oe,{data:t}),r.includes(`threat`)&&(0,D.jsx)(ese,{id:e,data:t}),r.includes(`comment`)&&(0,D.jsx)(tse,{id:e,data:t}),r.includes(`quickAdd`)&&(0,D.jsx)(Ib,{id:e,data:t,selected:n}),r.includes(`handles`)&&Fb]})}function Rb({id:e,data:t,selected:n,parts:r}){let i=t.typeId===fe;return(0,D.jsxs)(`div`,{className:`${i?`dg-activity-frame`:`dg-activity-lane`}${r.loopClass}`,style:t.color===void 0?void 0:{"--dg-act-accent":t.color},children:[(0,D.jsx)(`span`,{className:`dg-activity-strip`,children:(0,D.jsx)(`span`,{className:`dg-activity-name`,children:r.name})}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]}),!i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ib,{id:e,data:t,selected:n,side:`before`}),(0,D.jsx)(Ib,{id:e,data:t,selected:n,side:`after`})]})]})}function zb({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-activity-region${r.loopClass}`,children:[(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-activity-region-name`,children:r.name}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]})]})}function Bb(e,t){let n=new Set(e.containment.map(e=>e.parent)),r=[...e.nodes.filter(e=>!n.has(e.id)),...e.nodes.filter(e=>n.has(e.id))],i=new Map,a=new Map;for(let e of r){if(e.type===void 0||a.has(e.type))continue;let n=t.resolve(e.type).fill??`type:${e.type}`,r=i.get(n)??i.size;i.set(n,r),a.set(e.type,r)}return a}function Vb(e,t,n){if(!(e.palette===void 0||e.palette.length===0))return{palette:e.palette,slots:Bb(t,n)}}function Hb(e,t,n){if(t!==void 0)return t;let r=e===void 0?void 0:n.slots.get(e);return r===void 0?void 0:n.palette[r%n.palette.length]}function Ub(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e)?.[1];if(t===void 0)return;let n=t.length===3?[...t].map(e=>e+e).join(``):t,[r,i,a]=[0,2,4].map(e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a>.179?`#000`:`#fff`}function Wb({chip:e,className:t,zoneId:n,onSetRole:r}){let[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useId)(),u=e=>{a(!1),e&&s.current?.focus()};(0,v.useEffect)(()=>{if(!i)return;c.current?.querySelector(`[role="menuitem"]`)?.focus();let e=e=>{let t=e.target;o.current?.contains(t)||c.current?.contains(t)||u(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[i]);let d=[...Rr.filter(t=>t!==e.role).map(e=>({id:e,label:El[e].title,next:e})),{id:`remove`,label:`Remove`,next:null}],f=t=>{r(n,e.refId,t),u(!0)},p=e=>{if(e.key===`Escape`)e.preventDefault(),u(!0);else if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=[...c.current?.querySelectorAll(`[role="menuitem"]`)??[]];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},m=i?s.current?.getBoundingClientRect():void 0;return(0,D.jsxs)(`span`,{className:`dg-role-chip-anchor`,ref:o,children:[(0,D.jsx)(`button`,{ref:s,type:`button`,className:`${t} nodrag`,title:e.title,"aria-haspopup":`menu`,"aria-expanded":i,"aria-controls":i?l:void 0,style:e.color===void 0?void 0:{"--dg-chip":e.color},onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a(e=>!e)},children:e.text}),i&&m!==void 0&&(0,Rh.createPortal)((0,D.jsx)(`div`,{id:l,ref:c,className:`dg-role-chip-menu nodrag nopan`,style:{position:`fixed`,top:m.bottom,left:m.left},role:`menu`,"aria-label":e.title,onKeyDown:p,children:d.map(e=>(0,D.jsx)(`button`,{type:`button`,role:`menuitem`,className:`dg-role-chip-menu-item`,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),f(e.next)},children:e.label},e.id))}),document.body)]})}function rse({id:e,data:t,profile:n,focusId:r}){let i=t.state!==`leaf`,a=Mb(t,n);return(0,D.jsxs)(`span`,{className:`dg-badges`,children:[t.promoted&&(0,D.jsx)(`span`,{className:`dg-badge`,"data-testid":`promoted-marker`,title:`Promoted shared node`,children:`▲`}),t.sharedMembers.length>0&&(0,D.jsxs)(`span`,{className:`dg-badge`,"data-testid":`shared-badge`,title:`Shared members: ${t.sharedMembers.join(`, `)}`,children:[`⚭ `,t.sharedMembers.length]}),t.chips?.map(i=>{let a=`dg-badge dg-role-chip${r!==null&&i.refId===r?` dg-role-chip-active`:``}`,o=`${i.role}:${i.refId}`;return t.onSetRole!==void 0&&n.node?.roleChips===!0?(0,D.jsx)(Wb,{chip:i,className:a,zoneId:e,onSetRole:t.onSetRole},o):(0,D.jsx)(`span`,{className:a,title:i.title,style:i.color===void 0?void 0:{"--dg-chip":i.color},children:i.text},o)}),i&&!a&&t.onEnterNode!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:`dg-enter`,"data-testid":`enter-chip`,title:`Enter — zoom into this node as its own diagram`,"aria-label":`Enter node`,onClick:n=>{n.stopPropagation(),t.onEnterNode?.(e)},children:`⤢`}),i&&!a&&(0,D.jsx)(Gb,{id:e,data:t}),a&&(0,D.jsx)(Gb,{id:e,data:t,group:!0})]})}function Gb({id:e,data:t,group:n=!1}){let r=t.state===`expanded`,i=n?r?`Collapse group`:`Expand group`:r?`Collapse`:`Expand`;return(0,D.jsx)(`button`,{type:`button`,className:n?`dg-disclose`:`dg-fold`,"data-testid":n?`disclose-chip`:`fold-chip`,title:i,"aria-label":i,"aria-expanded":n?void 0:r,onClick:n=>{n.stopPropagation(),t.onToggleExpand?.(e,r?`collapsed`:`expanded`)},children:r?`▾`:`▸`})}var ise=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);function ase(e){return e.map(e=>{let t=e.text.split(`
19
+ `):e,u=`${c?` dg-edge-label-wrap`:``}${e.diff===void 0?``:` dg-diff-${e.diff}`}`;return(0,D.jsxs)(D.Fragment,{children:[e.labels===void 0&&e.label!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-chip${u}`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${n.x}px, ${n.y}px)`},children:l(e.label)})}),e.labels!==void 0&&e.labels.map(n=>{let c=n.t??.5,d=n.side??`center`,f=r!==void 0&&e.labels?.length===1&&Rv(n)?r:Lv(t,c,d),p=o.drag!==null&&o.drag.labelId===n.id?o.drag:null,m=p?.x??f.x,h=p?.y??f.y,g=i!==null&&i.labelId===n.id;return(0,D.jsx)(c_,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-label-${d}${u} nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${m}px, ${h}px)`,pointerEvents:`all`},...o.handlers(n.id,g),onDoubleClick:e=>{s&&(e.stopPropagation(),a({labelId:n.id,t:c,side:d,x:f.x,y:f.y}))},children:g?(0,D.jsx)(Vv,{label:n.text,onCommit:t=>{a(null),t!==null&&e.onEditLabel?.(n.id,t.trim())}}):l(n.text)})},n.id)}),s&&e.pendingAdd!==void 0&&(0,D.jsx)(Rae,{data:e,curve:t,at:e.pendingAdd})]})}function Bv(e,t){let n=gg(),[r,i]=(0,v.useState)(null),a=(0,v.useRef)(null),o=(e,r)=>{let{t:i,perp:a}=Cv(t,n.screenToFlowPosition({x:e,y:r}));return{t:i,side:Iv(a)}},s=t=>e.editableLabels===!0||e.movableLabels===!0&&t.altKey;return{drag:r,handlers:(n,r)=>({onPointerDown:e=>{!s(e)||r||(e.stopPropagation(),a.current={labelId:n,startX:e.clientX,startY:e.clientY,moved:!1},typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{let r=a.current;if(r===null||r.labelId!==n||!r.moved&&Math.hypot(e.clientX-r.startX,e.clientY-r.startY)<Lae)return;r.moved=!0;let{t:s,side:c}=o(e.clientX,e.clientY),l=Lv(t,s,c);i({labelId:n,x:l.x,y:l.y})},onPointerUp:t=>{let r=a.current;if(a.current=null,!(r===null||r.labelId!==n)){if(typeof t.currentTarget.releasePointerCapture==`function`&&t.currentTarget.releasePointerCapture(t.pointerId),r.moved){let{t:r,side:i}=o(t.clientX,t.clientY);e.onMoveLabel?.(n,r,i)}i(null)}}})}}function Rae({data:e,curve:t,at:n}){let{t:r,perp:i}=Cv(t,n),a=Iv(i),o=Lv(t,r,a);return(0,D.jsx)(c_,{children:(0,D.jsx)(`div`,{className:`dg-edge-label-edit nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${o.x}px, ${o.y}px)`,pointerEvents:`all`},children:(0,D.jsx)(Vv,{label:``,onCommit:t=>{t!==null&&t.trim()!==``&&e.onAddLabel?.(t.trim(),r,a),e.onPendingAddConsumed?.()}})})})}function Vv({label:e,onCommit:t}){let n=(0,v.useRef)(!1),r=e=>{n.current||(n.current=!0,t?.(e))};return(0,D.jsx)(`input`,{"aria-label":`Edge label`,defaultValue:e,autoFocus:!0,onFocus:e=>e.target.select(),onBlur:e=>r(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(e.target.value):e.key===`Escape`&&r(null)}})}var Hv={arrow:{refX:9,el:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`})},dot:{refX:5,el:(0,D.jsx)(`circle`,{cx:`5`,cy:`5`,r:`4`})},square:{refX:5,el:(0,D.jsx)(`rect`,{x:`1.2`,y:`1.2`,width:`7.6`,height:`7.6`})},diamond:{refX:5,el:(0,D.jsx)(`path`,{d:`M5,0 L10,5 L5,10 L0,5 z`})},crowsfoot:{refX:10,el:(0,D.jsx)(`path`,{d:`M10,1 L0,5 L10,9 M0,5 L10,5`,fill:`none`})},one:{refX:8,el:(0,D.jsx)(`path`,{d:`M5,1 L5,9`,fill:`none`})},none:void 0},Uv={refX:9,el:(0,D.jsx)(`path`,{d:`M1,1 L9,5 L1,9`,fill:`none`})},Wv=new Set([`crowsfoot`,`one`,`open-arrow`]);function zae({end:e,start:t,stroke:n,size:r}){return(0,D.jsxs)(D.Fragment,{children:[e!==void 0&&(0,D.jsx)(Gv,{marker:e,stroke:n,size:r}),t!==void 0&&(0,D.jsx)(Gv,{marker:t,stroke:n,size:r})]})}function Gv({marker:e,stroke:t,size:n}){return(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:e.id,viewBox:`0 0 10 10`,refX:e.shape.refX,refY:`5`,markerWidth:n,markerHeight:n,markerUnits:`userSpaceOnUse`,orient:`auto-start-reverse`,fill:t,...Wv.has(e.style)?{stroke:t,strokeWidth:1.2}:{},children:e.shape.el})})}var Bae=12,Kv=6,Vae=3,qv=12;function Hae({curve:e,data:t,profile:n,look:r}){let i=n.edge?.marks===!0,a=i&&t.polarity!==void 0?Sv(e,.82):void 0,o=i&&t.delay===!0?Sv(e,.5):void 0,s=r.kind.zigzag===!0?Sv(e,.5):void 0;return(0,D.jsxs)(D.Fragment,{children:[a!==void 0&&t.polarity!==void 0&&(0,D.jsx)(`text`,{className:`dg-polarity`,x:a.point.x+a.normal.x*Bae,y:a.point.y+a.normal.y*Bae,textAnchor:`middle`,dominantBaseline:`central`,style:r.polarityColor===void 0?void 0:{fill:r.stroke},children:t.polarity===`-`?`−`:`+`}),o!==void 0&&(0,D.jsx)(`g`,{className:`dg-delay`,children:[-3,Vae].map(e=>{let t=o.point.x+o.tangent.x*e,n=o.point.y+o.tangent.y*e;return(0,D.jsx)(`line`,{x1:t-o.normal.x*Kv,y1:n-o.normal.y*Kv,x2:t+o.normal.x*Kv,y2:n+o.normal.y*Kv},e)})}),s!==void 0&&(0,D.jsx)(`polyline`,{className:`dg-edge-zigzag`,points:[[-12,4],[2,-2],[-2,2],[qv,-4]].map(([e,t])=>{let{point:n,tangent:r,normal:i}=s;return`${n.x+e*r.x+t*i.x},${n.y+e*r.y+t*i.y}`}).join(` `),fill:`none`,strokeWidth:1.75,stroke:r.stroke})]})}function Jv({comments:e,links:t}){if(e===0&&t===0)return;let n=[];return e>0&&n.push(`${e} comment${e===1?``:`s`}`),t>0&&n.push(`${t} link${t===1?``:`s`}`),{text:e>0?String(e):`↗`,title:n.join(`, `)}}var Yv=(0,v.createContext)(null);function Xv({className:e,target:t,edge:n,state:r,title:i,text:a,style:o}){let s=(0,v.useContext)(Yv);if(s===null||t===void 0)return(0,D.jsx)(`span`,{className:e,"data-edge":n,"data-state":r,title:i,style:o,children:a});let c=s.isOpen(zt(t));return(0,D.jsx)(`button`,{type:`button`,className:`${e} nodrag${n===void 0?``:` nopan`}`,"data-edge":n,"data-state":r,title:i,"aria-expanded":c,"aria-label":`${i} — ${c?`hide`:`show`}`,style:o,onMouseDown:Qv,onClick:e=>{e.stopPropagation(),s.toggle(t)},children:a})}function Zv({className:e,edge:t,state:n,style:r,onAdd:i,onPointerDown:a}){return(0,D.jsx)(`button`,{type:`button`,className:e,"data-edge":t,"data-state":n,"aria-label":`Add a threat`,title:`Add a threat`,style:r,onMouseDown:Qv,onPointerDown:a,onClick:e=>{e.stopPropagation(),i()},children:`+`})}var Qv=e=>e.stopPropagation();function $v({open:e,total:t}){return{state:e>0?`open`:`handled`,text:e>0?String(e):`✓`,title:`${e} open of ${t} threat${t===1?``:`s`}`}}var ey=10,Uae=24,Wae=e=>({x:e.point.x+e.normal.x*ey,y:e.point.y+e.normal.y*ey});function ty(e,t){let n=Sv(e,t),r=Wae(n);return{frame:n,at:r,transform:`translate(-50%, -50%) translate(${r.x}px, ${r.y}px)`}}function Gae({id:e,data:t,curve:n,profile:r}){let{threatBadge:i,addThreat:a}=Kae(t,r),o=i!==void 0||a!==void 0?ty(n,.75):void 0,s=t.annotations===void 0?void 0:Jv(t.annotations),c=s===void 0?void 0:ty(n,.25),l=(0,v.useContext)(Yv),u=t.threatRelation===void 0?void 0:{relation:t.threatRelation};return qae(l,{relation:i!==void 0||s!==void 0?t.threatRelation:void 0,spot:i===void 0?c:o,curve:n}),(0,D.jsxs)(D.Fragment,{children:[o!==void 0&&i!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(Xv,{className:`dg-threat-badge dg-edge-threat`,target:u,edge:e,state:i.state,title:i.title,text:i.text,style:{transform:o.transform}})}),c!==void 0&&s!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(Xv,{className:`dg-comment-badge dg-edge-comment`,target:u,edge:e,title:s.title,text:s.text,style:{transform:c.transform}})}),o!==void 0&&a!==void 0&&(0,D.jsx)(c_,{children:(0,D.jsx)(Zv,{className:`dg-threat-badge dg-edge-threat nodrag nopan`,edge:e,state:`empty`,style:{transform:o.transform},onAdd:a})})]})}function Kae(e,t){let n=e.threats!==void 0&&e.threats.total>0?e.threats:void 0,r=n===void 0&&e.onAddThreat!==void 0&&t.offersThreats===!0?e.onAddThreat:void 0;return{threatBadge:n===void 0?void 0:$v(n),addThreat:r}}function qae(e,t){let{relation:n,curve:r}=t,i=t.spot?.at.x,a=t.spot?.at.y,o=t.spot?.frame.normal.x,s=t.spot?.frame.normal.y,c=(0,v.useRef)([]),l=``;e!==null&&n!==void 0&&(c.current=Array.from({length:25},(e,t)=>{let n=r.point(t/Uae);return{x:Math.round(n.x),y:Math.round(n.y)}}),l=c.current.map(e=>`${e.x},${e.y}`).join(`;`)),(0,v.useEffect)(()=>{e!==null&&n!==void 0&&i!==void 0&&a!==void 0&&o!==void 0&&s!==void 0&&e.placeBadge(n,{x:i,y:a},{x:o,y:s},c.current)},[e,n,i,a,o,s,l])}function Jae(e,t,n){let r=t?.relStyle,i=t?.kindRegistry.resolve(t.kind)??{},a=r?.width??i.width??1.5,o=r?.line??(i.dashed===!0?`dashed`:`solid`),s=r?.animated??i.animated===!0;return{kind:i,...Xae(t,n),strokeWidth:a,line:o,animated:s,dashArray:Zae(o,a,s,t?.edgeLook?.dash),...Qae(e,{end:r?.end??i.endMarker??`arrow`,start:i.startMarker},t?.edgeLook?.openArrow),markerSize:10+a*2}}function Yae(e){return{stroke:e.stroke,strokeWidth:e.strokeWidth,...e.dashArray===void 0?{}:{strokeDasharray:e.dashArray},...e.line===`dotted`?{strokeLinecap:`round`}:{},...e.animated?{animation:`dg-flow 0.7s linear infinite`}:{}}}function Xae(e,t){let n=e?.polarity===void 0?void 0:t.edge?.polarityColors?.[e.polarity];return{stroke:e?.relStyle?.color??e?.tint??e?.notationColor??n??`var(--dg-edge)`,polarityColor:n}}function Zae(e,t,n,r){return e===`dashed`?r?.dashed??`6 4`:e===`dotted`?`0.1 ${Math.max(5,t*3)}`:n?`6 4`:r?.solid}function Qae(e,t,n){let r=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return{end:ny(`dg-end-${r}`,t.end,n),start:ny(`dg-start-${r}`,t.start,n)}}function ny(e,t,n){if(t===void 0)return;if(t===`arrow`&&n===!0)return{id:e,style:`open-arrow`,shape:Uv};let r=Hv[t];return r===void 0?void 0:{id:e,style:t,shape:r}}var ry=e=>({x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0});function iy(e,t){let n=ry(e),r=ry(t),i=n.width/2||1,a=n.height/2||1,o=n.x+i,s=n.y+a,c=r.x+(r.width/2||1),l=r.y+(r.height/2||1),u=(c-o)/(2*i)-(l-s)/(2*a),d=(c-o)/(2*i)+(l-s)/(2*a),f=1/(Math.abs(u)+Math.abs(d)||1),p=f*u,m=f*d;return{x:i*(p+m)+o,y:a*(-p+m)+s}}function ay(e,t){let n=ry(e),r=Math.round(n.x),i=Math.round(n.y),a=Math.round(t.x),o=Math.round(t.y);return a<=r+1?ym.Left:a>=r+n.width-1?ym.Right:o<=i+1?ym.Top:o>=i+n.height-1?ym.Bottom:ym.Top}var $ae=e=>e!=null&&ee.includes(e)?e:void 0,eoe={top:ym.Top,right:ym.Right,bottom:ym.Bottom,left:ym.Left};function toe(e){switch(e){case ym.Top:return`top`;case ym.Right:return`right`;case ym.Bottom:return`bottom`;case ym.Left:return`left`}}function noe(e,t,n){let r=e??(t.source===n.from?t.target===n.to?null:`target`:`source`);if(r===`source`)return{end:`from`,side:t.source===n.from?$ae(t.sourceHandle)??null:null};if(r===`target`)return{end:`to`,side:t.target===n.to?$ae(t.targetHandle)??null:null}}function roe(e,t){let n=ry(e);switch(t){case`top`:return{x:n.x+n.width/2,y:n.y};case`bottom`:return{x:n.x+n.width/2,y:n.y+n.height};case`left`:return{x:n.x,y:n.y+n.height/2};case`right`:return{x:n.x+n.width,y:n.y+n.height/2}}}function ioe(e,t,n){let r=n?.sourceSide===void 0?iy(e,t):roe(e,n.sourceSide),i=n?.targetSide===void 0?iy(t,e):roe(t,n.targetSide);return{sx:r.x,sy:r.y,tx:i.x,ty:i.y,sourcePos:n?.sourceSide===void 0?ay(e,r):eoe[n.sourceSide],targetPos:n?.targetSide===void 0?ay(t,i):eoe[n.targetSide]}}var aoe=5,ooe=16;function soe({ends:e,data:t}){let n=t.onSetSide;if(n===void 0||t.fixedSideDotsShown!==!0||t.constituentCount!==1)return null;let r=e.tx-e.sx,i=e.ty-e.sy,a=Math.hypot(r,i)||1,o=-i/a*ooe,s=r/a*ooe,c=t.relStyle?.fromSide!==void 0,l=t.relStyle?.toSide!==void 0;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(oy,{end:`from`,cx:e.sx+o,cy:e.sy+s,fixed:c,onToggle:()=>n(`from`,c?null:toe(e.sourcePos))}),(0,D.jsx)(oy,{end:`to`,cx:e.tx+o,cy:e.ty+s,fixed:l,onToggle:()=>n(`to`,l?null:toe(e.targetPos))})]})}function oy({end:e,cx:t,cy:n,fixed:r,onToggle:i}){return(0,D.jsx)(`circle`,{className:`dg-edge-pin${r?` pinned`:``}`,"data-end":e,cx:t,cy:n,r:aoe,role:`button`,"aria-label":`${r?`Unpin`:`Pin`} ${e===`from`?`source`:`target`} end`,onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),i()}})}var sy=7.2,cy=20,ly=24,coe=16,loe=160,uoe=340;function doe(e,t=``){let n=e=>ly+e.name.length*sy+coe+(e.type?.length??0)*sy,r=e.reduce((e,t)=>Math.max(e,n(t)),0),i=t.length*sy;return{width:Math.min(uoe,Math.max(loe,Math.round(Math.max(r,i)+cy))),height:30+e.length*22}}function uy(e,t,n){let r=t,i=e=>{e.columns!==void 0&&e.node.type===`db-table`&&n?.[e.id]===void 0&&(r===t&&(r=new Map(t)),r.set(e.id,doe(e.columns,e.node.name))),e.children.forEach(i)};return e.forEach(i),r}function dy(e){return 30+e*22+22/2}function fy(e,t,n){if(n===void 0||t.columns===void 0||e.pos!==ym.Left&&e.pos!==ym.Right)return e;let r=t.columns.findIndex(e=>e.name===n);return r<0?e:{x:e.pos===ym.Left?t.x:t.x+t.width,y:t.y+dy(r),pos:e.pos}}function foe(e,t){let n=A(e.source),r=A(e.target),i=(n?.measured?.width??0)>0&&(r?.measured?.width??0)>0,a=t?.relStyle,o={ends:i&&n!==void 0&&r!==void 0?ioe(n,r,{sourceSide:a?.fromSide,targetSide:a?.toSide}):{sx:e.sourceX,sy:e.sourceY,tx:e.targetX,ty:e.targetY,sourcePos:e.sourcePosition,targetPos:e.targetPosition},measured:i,selfLoop:e.source===e.target,source:poe(n),target:poe(r)};return{...o,...moe(o,t)}}function poe(e){if(e!==void 0)return{node:e,rect:{x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0,columns:e.data.columns}}}function moe(e,t){let{ends:n,measured:r,source:i,target:a}=e,o={x:n.sx,y:n.sy},s={x:n.tx,y:n.ty};if(r&&t?.fromColumn!==void 0&&i?.rect.columns!==void 0){let e=fy({x:n.sx,y:n.sy,pos:n.sourcePos},i.rect,t.fromColumn);o={x:e.x,y:e.y}}let c=t?.toColumn??a?.rect.columns?.find(e=>e.pk===!0)?.name;if(r&&c!==void 0&&a?.rect.columns!==void 0&&(t?.fromColumn!==void 0||t?.toColumn!==void 0)){let e=fy({x:n.tx,y:n.ty,pos:n.targetPos},a.rect,c);s={x:e.x,y:e.y}}return{from:o,to:s}}function py(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function hoe(e,t){return e[0]===t[0]&&e[1]===t[1]}function goe(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)py(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];hoe(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)py(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),py(r,t,n)})(c,s,-i)}return c}function my(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),goe(e,r,n,i||1)}var hy=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=my(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function gy(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var _y=class extends hy{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=my(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)gy([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},vy=class extends hy{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},_oe=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=my(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=gy(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},voe=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=my(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=gy(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},yoe=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=my(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=gy(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},yy={},by=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},boe=0,xy=1,xoe=2,Sy={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Soe(e,t){return e.type===t}function Cy(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:boe,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:xy,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:xoe,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!Soe(a,xoe);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return Cy(`M0,0`+e);i++,o=Sy[a.text],r=a.text}else Soe(a,xy)?o=Sy[r]:(i++,o=Sy[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!Soe(t,xy))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof Sy[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function wy(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Ty(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(Dy(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function Ey(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Dy(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=Ey(e,t,-u),[n,r]=Ey(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Dy(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],ee=[n+C*x,r-w*b],te=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,ee,te].concat(f);{f=[E,ee,te].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=Ey(f[t][0],f[t][1],u),r=Ey(f[t+1][0],f[t+1][1],u),i=Ey(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var Oy={randOffset:function(e,t){return zy(e,t)},randOffsetWithRange:function(e,t,n){return Ry(e,t,n)},ellipse:function(e,t,n,r,i){return Ny(e,t,i,Coe(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return By(e,t,n,r,i,!0)}};function ky(e,t,n,r,i){return{type:`path`,ops:By(e,t,n,r,i)}}function Ay(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...By(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...By(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?ky(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function jy(e,t,n,r,i){return function(e,t){return Ay(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function My(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=Vy(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Vy(n[0],1.5*(1+.22*t.roughness),Ly(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=Vy(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Vy(a,1.5*(1+.22*t.roughness),Ly(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function Coe(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=zy(o*c,n),s+=zy(s*c,n),{increment:a,rx:o,ry:s}}function Ny(e,t,n,r){let[i,a]=Doe(r.increment,e,t,r.rx,r.ry,1,r.increment*Ry(.1,Ry(.4,1,n),n),n),o=Hy(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Doe(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Hy(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function Py(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=zy(.01*d,c),f+=zy(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=Ooe(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=Ooe(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...By(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...By(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function woe(e,t){let n=Ty(wy(Cy(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...By(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Uy(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...By(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function Fy(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+zy(e,t),r[0][1]+zy(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+zy(e,t),r[a][1]+zy(e,t)]})}}return{type:`fillPath`,ops:n}}function Iy(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!yy[n])switch(n){case`zigzag`:yy[n]||(yy[n]=new _y(t));break;case`cross-hatch`:yy[n]||(yy[n]=new vy(t));break;case`dots`:yy[n]||(yy[n]=new _oe(t));break;case`dashed`:yy[n]||(yy[n]=new voe(t));break;case`zigzag-line`:yy[n]||(yy[n]=new yoe(t));break;default:n=`hachure`,yy[n]||(yy[n]=new hy(t))}return yy[n]}(t,Oy).fillPolygons(e,t)}function Ly(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Toe(e){return e.randomizer||=new by(e.seed||0),e.randomizer.next()}function Ry(e,t,n,r=1){return n.roughness*r*(Toe(n)*(t-e)+e)}function zy(e,t,n=1){return Ry(-e,e,t,n)}function By(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Eoe(e,t,n,r,i,!0,!1);if(o)return s;let c=Eoe(e,t,n,r,i,!0,!0);return s.concat(c)}function Eoe(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*Toe(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=zy(p,i,l),m=zy(m,i,l);let h=[],g=()=>zy(d,i,l),_=()=>zy(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:zy(u,i,l)),t+(v?0:zy(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function Vy(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+zy(t,n),e[0][1]+zy(t,n)]),r.push([e[0][0]+zy(t,n),e[0][1]+zy(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+zy(t,n),e[i][1]+zy(t,n)]),i===e.length-1&&r.push([e[i][0]+zy(t,n),e[i][1]+zy(t,n)]);return Hy(r,null,n)}function Hy(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+zy(e,n),t[1]+zy(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Eoe(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Doe(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=zy(.5,s)-Math.PI/2;l.push([zy(a,s)+t+.9*r*Math.cos(u-e),zy(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[zy(a,s)+t+r*Math.cos(o),zy(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([zy(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),zy(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([zy(a,s)+t+.98*r*Math.cos(u+o),zy(a,s)+n+.98*i*Math.sin(u+o)]),l.push([zy(a,s)+t+.9*r*Math.cos(u+.5*o),zy(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function Ooe(e,t,n,r,i,a,o,s,c){let l=a+zy(.1,c),u=[];u.push([zy(s,c)+t+.9*r*Math.cos(l-e),zy(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([zy(s,c)+t+r*Math.cos(a),zy(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Hy(u,null,c)}function Uy(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:zy(l[0],s)),o[1]+(f?0:zy(l[0],s))]}),u=f?[i,a]:[i+zy(l[p],s),a+zy(l[p],s)],c.push({op:`bcurveTo`,data:[e+zy(l[p],s),t+zy(l[p],s),n+zy(l[p],s),r+zy(l[p],s),u[0],u[1]]});return c}function Wy(e){return[...e]}function Gy(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(Wy(e[0]),Wy(e[1]),Wy(e[2]),Wy(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(Wy(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function Ky(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function qy(e,t,n){let r=Ky(t,n);if(r===0)return Ky(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Ky(e,Jy(t,n,i))}function Jy(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Yy(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(Ky(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Jy(a,o,r),u=Jy(o,s,r),d=Jy(s,c,r),f=Jy(l,u,r),p=Jy(u,d,r),m=Jy(f,p,r);Yy([a,l,f,m],0,n,i),Yy([m,p,d,c],0,n,i)}var a,o;return i}function koe(e,t){return Xy(e,0,e.length,t)}function Xy(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=qy(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Xy(e,t,l+1,r,a),Xy(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Zy(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Yy(e,3*n,t,r);return n&&n>0?Xy(r,0,r.length,n):r}var Qy=`none`,$y=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[ky(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=jy(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(Fy([i],a)):o.push(Iy([i],a))}return a.stroke!==Qy&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=Coe(n,r,a),c=Ny(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=Ny(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(Iy([c.estimatedPoints],a));return a.stroke!==Qy&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[Ay(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=Py(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=Py(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=zy(.01*l,o),u+=zy(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),Iy([m],o)}(e,t,n,r,i,a,c));return c.stroke!==Qy&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=My(e,n);if(n.fill&&n.fill!==Qy)if(n.fillStyle===`solid`){let t=My(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Zy(Gy([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Zy(Gy(r),10,(1+n.roughness)/2))}t.length&&r.push(Iy([t],n))}return n.stroke!==Qy&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=Ay(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(Fy([e],n)):r.push(Iy([e],n))),n.stroke!==Qy&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Qy,a=n.stroke!==Qy,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=Ty(wy(Cy(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Zy(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=koe(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=woe(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=woe(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(Fy(s,n));else r.push(Iy(s,n));return a&&(o?s.forEach((e=>{r.push(Ay(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Qy};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Qy,strokeWidth:0,fill:n.fill||Qy};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Qy,strokeWidth:n,fill:Qy}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},Aoe=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new $y(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},eb=`http://www.w3.org/2000/svg`,tb=class{constructor(e,t){this.svg=e,this.gen=new $y(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(eb,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(eb,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(eb,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(eb,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},nb={canvas:(e,t)=>new Aoe(e,t),svg:(e,t)=>new tb(e,t),generator:e=>new $y(e),newSeed:()=>$y.newSeed()}.generator(),rb=`sentinel-fill`,ib=`sentinel-stroke`;function ab(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0||1}var ob=({style:e,seed:t})=>({roughness:e.roughness,bowing:e.bowing,strokeWidth:e.strokeWidth,fillStyle:e.fillStyle,...e.fillWeight===void 0?{}:{fillWeight:e.fillWeight},...e.hachureGap===void 0?{}:{hachureGap:e.hachureGap},fill:rb,stroke:ib,seed:t});function sb(e){let t=t=>e.filter(t).map(e=>e.d).join(` `);return{fill:t(e=>e.fill===rb),hatch:t(e=>e.stroke===rb),stroke:t(e=>e.stroke===ib)}}function cb(e,t){let n=Math.min(e*.2,24);return[[n,1],[e-n,1],[e-1,t/2],[e-n,t-1],[n,t-1],[1,t/2]]}var lb={left:14,width:16,height:12};function joe(e,t,n,r=(e,t,n)=>[`L ${n} ${t}`]){let i=e-1,a=t-1,o=Math.max(0,Math.min(n,(i-1)/2,(a-1)/2));return[`M ${1+o} 1`,`L ${i-o} 1`,`Q ${i} 1 ${i} ${1+o}`,`L ${i} ${a-o}`,`Q ${i} ${a} ${i-o} ${a}`,...r(i-o,a,1+o),`Q 1 ${a} 1 ${a-o}`,`L 1 ${1+o}`,`Q 1 1 ${1+o} 1`,`Z`].join(` `)}function Moe(e,t,n){return joe(e,t,n,(e,t,n)=>{let r=Math.max(n,Math.min(n+lb.left,e));return[`L ${Math.min(r+lb.width,e)} ${t}`,`L ${r} ${t+lb.height}`,`L ${r} ${t}`,`L ${n} ${t}`]})}function Noe(e,t,n,r=0){let i=Math.max(2,t.width),a=Math.max(2,t.height),o=ob(n);return sb((e===`circle`?[nb.circle(i/2,a/2,Math.min(i,a)-2,o)]:e===`person`?[nb.circle(i/2,Math.min(a*.22,18),Math.min(i,a)*.32,o),nb.rectangle(i*.12,Math.min(a*.38,30),i*.76,a-Math.min(a*.38,30)-1,o)]:e===`hexagon`?[nb.polygon(cb(i,a),o)]:e===`cylinder`?[nb.rectangle(1,8,i-2,a-10,o),nb.ellipse(i/2,8,i-6,14,o)]:e===`bubble`?[nb.path(Moe(i,a,r),o)]:e===`diamond`?[nb.polygon([[i/2,1],[i-1,a/2],[i/2,a-1],[1,a/2]],o)]:e===`bar`?[nb.rectangle(1,1,i-2,a-2,{...o,fillStyle:`solid`})]:e===`start-dot`?[nb.circle(i/2,a/2,Math.min(i,a)-2,{...o,fillStyle:`solid`})]:e===`end-bullseye`?[nb.circle(i/2,a/2,Math.min(i,a)-2,o),nb.circle(i/2,a/2,(Math.min(i,a)-2)*.55,{...o,fillStyle:`solid`})]:e===`send-signal`?[nb.polygon([[1,1],[i-15,1],[i-1,a/2],[i-15,a-1],[1,a-1]],o)]:e===`receive-signal`?[nb.polygon([[1,1],[i-1,1],[i-1,a-1],[1,a-1],[15,a/2]],o)]:e===`note`?[nb.polygon([[1,1],[i-15,1],[i-1,15],[i-1,a-1],[1,a-1]],o),nb.linearPath([[i-15,1],[i-15,15],[i-1,15]],o)]:e===`ellipse`?[nb.ellipse(i/2,a/2,i-2,a-2,o)]:e===`store`?[nb.line(1,1,i-1,1,o),nb.line(1,a-1,i-1,a-1,o)]:r>0?[nb.path(joe(i,a,r),o)]:[nb.rectangle(1,1,i-2,a-2,o)]).flatMap(e=>nb.toPaths(e)))}function Poe(e,t,n){let r=Math.max(2,t);return sb(nb.toPaths(nb.circle(e.x,e.y,r,ob(n))))}function Foe(e,t){let n={...ob(t),fill:void 0,disableMultiStroke:!0},r=nb.toPaths(nb.path(e,n)).filter(e=>e.stroke===ib).map(e=>e.d).join(` `);return r===``?e:r}function ub(e){let t=new Map;for(let n of e){if(n.from===n.to)continue;let e=n.from<n.to,r=e?`${n.from}\0${n.to}`:`${n.to}\0${n.from}`,i=t.get(r)??[];i.push({id:n.id,forward:e}),t.set(r,i)}let n=new Map;for(let e of t.values())e.forEach(({id:e,forward:t},r)=>{if(r===0)return;let i=Math.ceil(r/2)*32*(r%2==1?1:-1);n.set(e,t?i:-i)});return n}var db=e=>Math.abs(e)*4/3;function fb(e){let t=e.shape===`curved`,n=t&&!e.profileBows?e.parallelBow??0:0;return n===0?{bowed:t&&e.profileBows,side:e.side??`left`,bulge:void 0}:{bowed:!0,side:n>0?`left`:`right`,bulge:db(n)}}var pb=28,Ioe=18,Loe=.2,Roe=10,mb=4,zoe=16,hb=4.5,gb=e=>pb+e*Ioe,_b=e=>Math.max(vb(e),zoe),vb=e=>Math.max(e*Loe,Math.min(e/2-mb,Roe),0);function yb(e,t,n,r){let i=gb(n),a=i*4/3,o=t===`DOWN`||t===`UP`,s=o?e.height:e.width,c=vb(s),l=(_b(s)-c)*hb,u=(t,n)=>o?{x:e.x+e.width+n,y:e.y+s/2+t}:{x:e.x+s/2+t,y:e.y-n},d=i+10+(o?r/2:0);return{from:u(-c,0),c1:u(-c-l,a),c2:u(c+l,a),to:u(c,0),label:u(0,d)}}function bb(e,t,n=0,r=0){let{from:i,c1:a,c2:o,to:s,label:c}=yb(e,t,n,r);return{path:`M ${i.x} ${i.y} C ${a.x} ${a.y} ${o.x} ${o.y} ${s.x} ${s.y}`,labelX:c.x,labelY:c.y}}function xb(e,t,n=0){let{from:r,c1:i,c2:a,to:o}=yb(e,t,n,0),s=e=>[r[e],i[e],a[e],o[e]],c=(e,[t,n,r,i])=>(1-e)**3*t+3*(1-e)**2*e*n+3*(1-e)*e**2*r+e**3*i,l=(e,[t,n,r,i])=>3*(1-e)**2*(n-t)+6*(1-e)*e*(r-n)+3*e**2*(i-r);return{point:e=>({x:c(e,s(`x`)),y:c(e,s(`y`))}),tangent:e=>{let t=l(e,s(`x`)),n=l(e,s(`y`)),r=Math.hypot(t,n)||1;return{x:t/r,y:n/r}}}}function Sb(e){let t=new Map,n=new Map;for(let r of e){if(r.from!==r.to)continue;let e=t.get(r.from)??0;n.set(r.id,e),t.set(r.from,e+1)}return n}function Boe(e,t,n,r){let i=Cb(t,n),{path:a,curve:o,label:s,labelSpot:c}=t.selfLoop?Uoe(t,n):i!==void 0&&n!==void 0?Hoe(i,t,n):Woe(t,n,r);return{path:a,renderPath:(0,v.useMemo)(()=>n?.stylePreset?.rough===void 0?a:Foe(a,{style:n.stylePreset.rough,seed:ab(e)}),[n?.stylePreset,a,e]),curve:o,label:s,labelSpot:c}}function Cb(e,t){let n=t?.route;if(t===void 0||n===void 0||n.length<2||t.fromColumn!==void 0||t.toColumn!==void 0)return;let r=t.relStyle;return r?.shape===void 0&&(r?.fromSide===void 0||r.fromSide===Ev(n).from)&&(r?.toSide===void 0||r.toSide===Ev(n).to)&&Voe(e.source,t.routeFrom)&&Voe(e.target,t.routeTo)?n:void 0}var Voe=(e,t)=>e!==void 0&&t!==void 0&&Math.abs(e.node.internals.positionAbsolute.x-t.x)<.5&&Math.abs(e.node.internals.positionAbsolute.y-t.y)<.5;function Hoe(e,t,n){let r=e=>!t.measured||e===void 0?void 0:{...e.rect,height:e.rect.height+Goe(e.node.data)},i=Nae(Mae(e),r(t.source),r(t.target)),a=xv(i),o=n.labelSpot===void 0?void 0:wv(i,n.labelSpot);return{path:Tv(i,n.routeCorner??8),curve:a,label:o??a.point(.5),labelSpot:o}}function Uoe(e,t){let n=t?.selfLoop?.direction??`RIGHT`,r=t?.selfLoop?.index??0,i=e.source?.rect??{x:e.from.x,y:e.from.y,width:0,height:0},a=bb(i,n,r,t?.selfLoop?.labelWidth),o={x:a.labelX,y:a.labelY};return{path:a.path,curve:xb(i,n,r),label:o,labelSpot:o}}function Woe(e,t,n){let r=t?.relStyle,i=r?.shape??`curved`,a={sourceX:e.from.x,sourceY:e.from.y,targetX:e.to.x,targetY:e.to.y,sourcePosition:e.ends.sourcePos,targetPosition:e.ends.targetPos},o=r?.curvature??n.edgeCurvature,{bowed:s,side:c,bulge:l}=fb({shape:i,profileBows:n.edge?.bowed===!0,side:r?.bow,parallelBow:t?.parallelBow}),u=jae({shape:s?`bow`:i,params:a,curvature:o,side:c,bulge:l}),d,f,p;if(i===`straight`)[d,f,p]=Jm({sourceX:a.sourceX,sourceY:a.sourceY,targetX:a.targetX,targetY:a.targetY});else if(i===`step`)[d,f,p]=Zm(a);else if(s){let e=u.point(.5);d=gv(a,o??.25,c,l),f=e.x,p=e.y}else[d,f,p]=qm({...a,...o===void 0?{}:{curvature:o}});return{path:d,curve:u,label:{x:f,y:p},labelSpot:void 0}}function Goe(e){return e.state!==`leaf`||e.label===``?0:e.image===void 0&&e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).captionBelow===!0?Pv(e.label).height:e.image===void 0||e.shape!==void 0||e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).cornerBadge===!0?0:20}function Koe({id:e,source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,data:l}){let u=foe({source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c},l),d=Nl(l?.notation),{path:f,renderPath:p,curve:m,label:h,labelSpot:g}=Boe(e,u,l,d),_=Jae(e,l,d);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`g`,{className:Tb((0,v.useContext)(fv),e),children:[(0,D.jsx)(zae,{end:_.end,start:_.start,stroke:_.stroke,size:_.markerSize}),(0,D.jsx)(Hg,{id:e,path:p,..._.end===void 0?{}:{markerEnd:`url(#${_.end.id})`},..._.start===void 0?{}:{markerStart:`url(#${_.start.id})`},style:Yae(_)}),(0,D.jsx)(`path`,{d:f,fill:`none`,stroke:`transparent`,strokeWidth:14,children:(0,D.jsx)(`title`,{children:wb(l)})}),l!==void 0&&(0,D.jsx)(Hae,{curve:m,data:l,profile:d,look:_})]}),l!==void 0&&(0,D.jsx)(soe,{ends:u.ends,data:l}),l!==void 0&&(0,D.jsx)(zv,{data:l,curve:m,label:h,labelSpot:g}),l!==void 0&&(0,D.jsx)(Gae,{id:e,data:l,curve:m,profile:d})]})}function wb(e){return`${e?.kind??``}${e!==void 0&&e.constituentCount>1?` ×${e.constituentCount}`:``}${e?.labels===void 0&&e?.label!==void 0?` — ${e.label}`:``}`}function Tb(e,t){return e.active?e.edges.has(t)?e.variant===`loop`?`dg-loop-edge-hl`:void 0:e.variant===`loop`?`dg-loop-edge-dim`:`dg-focus-edge-dim`:void 0}var qoe={fill:14,stroke:100},Eb=.35;function Joe({id:e,kind:t,width:n,height:r,color:i,preset:a,fill:o=`preset`}){let s=a.rough,c=(0,v.useMemo)(()=>ab(e),[e]),l=s!==void 0&&s.fillStyle!==`solid`&&o===`preset`,u=(0,v.useMemo)(()=>{if(s===void 0)return null;let e=a.cornerRadius??0,i={width:n,height:r},o=Noe(t,i,{style:{...s,fillStyle:`solid`},seed:c},e);return l?{...Noe(t,i,{style:s,seed:c},e),fill:o.fill}:o},[t,n,r,c,s,l,a.cornerRadius]);if(u===null||s===void 0)return null;let d=a.colorMix??qoe,f=(e,t)=>i===void 0?void 0:`color-mix(in srgb, ${i} ${e}%, var(${t}))`,p=f(d.fill,`--dg-node-fill`),m=f(d.stroke,`--dg-node-stroke`);return(0,D.jsxs)(`svg`,{className:`dg-sketch-shape`,width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`,children:[o!==`none`&&u.fill!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-fill`,d:u.fill,style:p===void 0?void 0:{fill:p}}),l&&u.hatch!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-hatch`,d:u.hatch,style:{strokeWidth:s.fillWeight??1,opacity:s.hatchOpacity??Eb,stroke:m}}),(0,D.jsx)(`path`,{className:`dg-sketch-stroke`,d:u.stroke,style:{strokeWidth:s.strokeWidth,stroke:m}})]})}var Db=e=>e.startsWith(`var(`)?e:`color-mix(in srgb, ${e} var(--dg-outline-ink, 100%), var(--dg-text))`;function Ob(e){if(e!==void 0)return{borderColor:e,background:`color-mix(in srgb, ${e} var(--dg-node-accent-tint, 14%), var(--dg-node-fill))`}}var Yoe=e=>e===`circle`||e===`cylinder`||e===`hexagon`||e===`bubble`||e===`person`||e===`diamond`||e===`bar`||e===`start-dot`||e===`end-bullseye`||e===`send-signal`||e===`receive-signal`||e===`note`||e===`ellipse`||e===`store`?e:`box`,kb=(e,t,n)=>t!==void 0&&n.startsWith(`/library/`)?`${t}${n.slice(9)}`:n.startsWith(`/`)||/^https?:/.test(n)?n:`${e??``}${n}`,Ab=(e,t,{id:n,width:r,height:i},a=`preset`)=>e.stylePreset?.rough!==void 0&&r!==void 0&&i!==void 0&&r>0&&i>0?(0,D.jsx)(Joe,{id:n,kind:Yoe(t),width:r,height:i,preset:e.stylePreset,fill:a,color:e.color===void 0?void 0:a===`none`?Db(e.color):e.color}):null;function jb({id:e,data:t,selected:n}){if(t.resizeAxis!==`x`||t.onResize===void 0||n!==!0)return null;let r=t.onResize,i=(t,n)=>r(e,n.width,n.height,{x:n.x,y:n.y});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(z_,{position:`left`,resizeDirection:`horizontal`,minWidth:js.DAY,className:`dg-x-resize`,onResizeEnd:i}),(0,D.jsx)(z_,{position:`right`,resizeDirection:`horizontal`,minWidth:js.DAY,className:`dg-x-resize`,onResizeEnd:i})]})}var Mb=(e,t)=>t.node?.typelessAsText===!0&&e.typeId===void 0&&e.state!==`leaf`,Xoe=(e,t)=>e.icon===void 0?e.typeId===void 0?void 0:e.icons.resolve(t.icon??``):e.icons.resolve(e.icon);function Nb({data:e}){return e.metaBadges!==void 0&&e.metaBadges.length>0?(0,D.jsx)(`span`,{className:`dg-meta`,children:e.metaBadges.map(e=>(0,D.jsx)(`span`,{className:`dg-meta-badge`,children:e},e))}):null}function Zoe(e,t,n,r){let i=r.focusId,a=i===null?void 0:t.chips?.find(e=>e.refId===i),o=t.typeId!==void 0&&n.node?.actorOutline?.(t.typeId)===!0,s=a===void 0?i!==null&&o&&e!==i&&r.nodes.has(e)?t.color??`var(--dg-accent)`:void 0:a.color??`var(--dg-accent)`;return{hitStyle:s===void 0?void 0:{"--dg-hit":s},hitAttrs:s===void 0?{}:{"data-plan-hit":!0}}}var Pb=e=>e.dropTarget===!0?{"data-drop-target":!0}:{};function Qoe({data:e,style:t}){let n=e.typeId===void 0?void 0:$s(t.label??e.typeId,e.technology);return n!==void 0&&n!==``?(0,D.jsx)(`span`,{className:`dg-type`,children:n}):null}var Fb=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(kg,{id:`top`,type:`source`,position:ym.Top,className:`dg-handle`}),(0,D.jsx)(kg,{id:`right`,type:`source`,position:ym.Right,className:`dg-handle`}),(0,D.jsx)(kg,{id:`bottom`,type:`source`,position:ym.Bottom,className:`dg-handle`}),(0,D.jsx)(kg,{id:`left`,type:`source`,position:ym.Left,className:`dg-handle`})]});function $oe({data:e}){if(e.link===void 0)return null;let t=e.link;return(0,D.jsx)(`button`,{type:`button`,className:`dg-link-badge`,title:t,"aria-label":`Open ${t}`,onClick:n=>{n.stopPropagation(),e.onOpenLink===void 0?/^https?:/.test(t)&&window.open(t,`_blank`,`noopener`):e.onOpenLink(t)},children:`🔗`})}function ese({id:e,data:t}){let n=t.threats;if(n===void 0||n.total===0){if(t.onAddThreat===void 0||Nl(t.notation).offersThreats!==!0)return null;let n=t.onAddThreat;return(0,D.jsx)(Zv,{className:`dg-threat-badge nodrag`,state:`empty`,onAdd:()=>n({node:e})})}let{state:r,text:i,title:a}=$v(n);return(0,D.jsx)(Xv,{className:`dg-threat-badge`,target:nse(e,t),state:r,title:a,text:i})}function tse({id:e,data:t}){let n=t.annotations===void 0?void 0:Jv(t.annotations);return n===void 0?null:(0,D.jsx)(Xv,{className:`dg-comment-badge`,target:nse(e,t),title:n.title,text:n.text})}var nse=(e,t)=>t.external===!0?void 0:{node:e};function Ib({id:e,data:t,selected:n,side:r}){if(n!==!0||t.quickAdd===void 0)return null;let i=t.quickAdd.label(e,r);if(i===void 0)return null;let a=t.quickAdd.run;return(0,D.jsx)(`button`,{type:`button`,className:`dg-quick-add nodrag`,title:r===`before`?i:`${i} (Tab)`,"aria-label":i,"data-side":r,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),r===void 0?a(e):a(e,r)},children:`+`})}function Lb({id:e,data:t,selected:n,uses:r}){return(0,D.jsxs)(D.Fragment,{children:[r.includes(`link`)&&(0,D.jsx)($oe,{data:t}),r.includes(`threat`)&&(0,D.jsx)(ese,{id:e,data:t}),r.includes(`comment`)&&(0,D.jsx)(tse,{id:e,data:t}),r.includes(`quickAdd`)&&(0,D.jsx)(Ib,{id:e,data:t,selected:n}),r.includes(`handles`)&&Fb]})}function Rb({id:e,data:t,selected:n,parts:r}){let i=t.typeId===fe;return(0,D.jsxs)(`div`,{className:`${i?`dg-activity-frame`:`dg-activity-lane`}${r.loopClass}`,style:t.color===void 0?void 0:{"--dg-act-accent":t.color},children:[(0,D.jsx)(`span`,{className:`dg-activity-strip`,children:(0,D.jsx)(`span`,{className:`dg-activity-name`,children:r.name})}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]}),!i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ib,{id:e,data:t,selected:n,side:`before`}),(0,D.jsx)(Ib,{id:e,data:t,selected:n,side:`after`})]})]})}function zb({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-activity-region${r.loopClass}`,children:[(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-activity-region-name`,children:r.name}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]})]})}function Bb(e,t){let n=new Set(e.containment.map(e=>e.parent)),r=[...e.nodes.filter(e=>!n.has(e.id)),...e.nodes.filter(e=>n.has(e.id))],i=new Map,a=new Map;for(let e of r){if(e.type===void 0||a.has(e.type))continue;let n=t.resolve(e.type).fill??`type:${e.type}`,r=i.get(n)??i.size;i.set(n,r),a.set(e.type,r)}return a}function Vb(e,t,n){if(!(e.palette===void 0||e.palette.length===0))return{palette:e.palette,slots:Bb(t,n)}}function Hb(e,t,n){if(t!==void 0)return t;let r=e===void 0?void 0:n.slots.get(e);return r===void 0?void 0:n.palette[r%n.palette.length]}function Ub(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e)?.[1];if(t===void 0)return;let n=t.length===3?[...t].map(e=>e+e).join(``):t,[r,i,a]=[0,2,4].map(e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a>.179?`#000`:`#fff`}function Wb({chip:e,className:t,zoneId:n,onSetRole:r}){let[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useId)(),u=e=>{a(!1),e&&s.current?.focus()};(0,v.useEffect)(()=>{if(!i)return;c.current?.querySelector(`[role="menuitem"]`)?.focus();let e=e=>{let t=e.target;o.current?.contains(t)||c.current?.contains(t)||u(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[i]);let d=[...Rr.filter(t=>t!==e.role).map(e=>({id:e,label:El[e].title,next:e})),{id:`remove`,label:`Remove`,next:null}],f=t=>{r(n,e.refId,t),u(!0)},p=e=>{if(e.key===`Escape`)e.preventDefault(),u(!0);else if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=[...c.current?.querySelectorAll(`[role="menuitem"]`)??[]];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},m=i?s.current?.getBoundingClientRect():void 0;return(0,D.jsxs)(`span`,{className:`dg-role-chip-anchor`,ref:o,children:[(0,D.jsx)(`button`,{ref:s,type:`button`,className:`${t} nodrag`,title:e.title,"aria-haspopup":`menu`,"aria-expanded":i,"aria-controls":i?l:void 0,style:e.color===void 0?void 0:{"--dg-chip":e.color},onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a(e=>!e)},children:e.text}),i&&m!==void 0&&(0,Rh.createPortal)((0,D.jsx)(`div`,{id:l,ref:c,className:`dg-role-chip-menu nodrag nopan`,style:{position:`fixed`,top:m.bottom,left:m.left},role:`menu`,"aria-label":e.title,onKeyDown:p,children:d.map(e=>(0,D.jsx)(`button`,{type:`button`,role:`menuitem`,className:`dg-role-chip-menu-item`,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),f(e.next)},children:e.label},e.id))}),document.body)]})}function rse({id:e,data:t,profile:n,focusId:r}){let i=t.state!==`leaf`,a=Mb(t,n);return(0,D.jsxs)(`span`,{className:`dg-badges`,children:[t.promoted&&(0,D.jsx)(`span`,{className:`dg-badge`,"data-testid":`promoted-marker`,title:`Promoted shared node`,children:`▲`}),t.sharedMembers.length>0&&(0,D.jsxs)(`span`,{className:`dg-badge`,"data-testid":`shared-badge`,title:`Shared members: ${t.sharedMembers.join(`, `)}`,children:[`⚭ `,t.sharedMembers.length]}),t.chips?.map(i=>{let a=`dg-badge dg-role-chip${r!==null&&i.refId===r?` dg-role-chip-active`:``}`,o=`${i.role}:${i.refId}`;return t.onSetRole!==void 0&&n.node?.roleChips===!0?(0,D.jsx)(Wb,{chip:i,className:a,zoneId:e,onSetRole:t.onSetRole},o):(0,D.jsx)(`span`,{className:a,title:i.title,style:i.color===void 0?void 0:{"--dg-chip":i.color},children:i.text},o)}),i&&!a&&t.onEnterNode!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:`dg-enter`,"data-testid":`enter-chip`,title:`Enter — zoom into this node as its own diagram`,"aria-label":`Enter node`,onClick:n=>{n.stopPropagation(),t.onEnterNode?.(e)},children:`⤢`}),i&&!a&&(0,D.jsx)(Gb,{id:e,data:t}),a&&(0,D.jsx)(Gb,{id:e,data:t,group:!0})]})}function Gb({id:e,data:t,group:n=!1}){let r=t.state===`expanded`,i=n?r?`Collapse group`:`Expand group`:r?`Collapse`:`Expand`;return(0,D.jsx)(`button`,{type:`button`,className:n?`dg-disclose`:`dg-fold`,"data-testid":n?`disclose-chip`:`fold-chip`,title:i,"aria-label":i,"aria-expanded":n?void 0:r,onClick:n=>{n.stopPropagation(),t.onToggleExpand?.(e,r?`collapsed`:`expanded`)},children:r?`▾`:`▸`})}var ise=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);function ase(e){return e.map(e=>{let t=e.text.split(`
20
20
  `).map(ise).join(`<br>`);return e.italic===!0&&(t=`<i>${t}</i>`),e.bold===!0&&(t=`<b>${t}</b>`),t}).join(``)}function Kb(e,t,n){let r=e.tagName.toLowerCase(),i=t||r===`b`||r===`strong`,a=n||r===`i`||r===`em`,o=e.style.fontWeight;if(o!==``){let e=Number.parseInt(o,10);o===`bold`||o===`bolder`||!Number.isNaN(e)&&e>=600?i=!0:(o===`normal`||o===`lighter`||!Number.isNaN(e)&&e<600)&&(i=!1)}let s=e.style.fontStyle;return s===`italic`||s===`oblique`?a=!0:s===`normal`&&(a=!1),{bold:i,italic:a}}function qb(e){let t=[],n=(e,n,r)=>t.push({text:e,...n?{bold:!0}:{},...r?{italic:!0}:{}}),r=(e,i,a)=>{for(let o of Array.from(e.childNodes))if(o.nodeType===Node.TEXT_NODE)n(o.textContent??``,i,a);else if(o.nodeType===Node.ELEMENT_NODE){let e=o,s=e.tagName.toLowerCase();if(s===`br`)n(`
21
21
  `,i,a);else{(s===`div`||s===`p`)&&t.length>0&&t.push({text:`
22
22
  `});let n=Kb(e,i,a);r(e,n.bold,n.italic)}}};return r(e,!1,!1),Ne(t)}function ose(e){return e.map((e,t)=>({key:t,text:e.text,bold:e.bold===!0,italic:e.italic===!0}))}function Jb({runs:e,onCommit:t,onTab:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(!1),[a,o]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=r.current;if(t===null)return;t.innerHTML=ase(e),t.focus();let n=document.createRange();n.selectNodeContents(t),n.collapse(!1);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(n)},[]);let s=e=>{i.current||(i.current=!0,t(e))},c=()=>s(r.current===null?[]:qb(r.current)),l=()=>{let e=window.getSelection();if(e===null||e.isCollapsed||e.rangeCount===0){o(null);return}let t=e.getRangeAt(0).getBoundingClientRect();o({position:`fixed`,left:t.left,top:Math.max(0,t.top-30)})},u=e=>{document.execCommand(e),r.current?.focus(),l()};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{ref:r,className:`dg-label-input dg-rich-input nodrag nopan`,role:`textbox`,"aria-label":`Edit text`,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:c,onMouseUp:l,onKeyUp:l,onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onPaste:e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`);document.execCommand(`insertText`,!1,t)},onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`?s(null):e.key===`Tab`&&!e.shiftKey?(e.preventDefault(),c(),n?.()):e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),c()):(e.metaKey||e.ctrlKey)&&(e.key===`b`||e.key===`B`)?(e.preventDefault(),u(`bold`)):(e.metaKey||e.ctrlKey)&&(e.key===`i`||e.key===`I`)&&(e.preventDefault(),u(`italic`))}}),a!==null&&(0,Rh.createPortal)((0,D.jsxs)(`div`,{className:`dg-rich-toolbar nodrag nopan`,style:a,onMouseDown:e=>e.preventDefault(),children:[(0,D.jsx)(`button`,{type:`button`,"aria-label":`Bold`,onClick:()=>u(`bold`),children:(0,D.jsx)(`b`,{children:`B`})}),(0,D.jsx)(`button`,{type:`button`,"aria-label":`Italic`,onClick:()=>u(`italic`),children:(0,D.jsx)(`i`,{children:`I`})})]}),document.body)]})}function Yb(e){let{id:t,data:n,selected:r,width:i,height:a,profile:o,parts:s}=e,{style:c,loopClass:l,ghost:u,highlight:d}=s,{hitStyle:f,hitAttrs:p}=Zoe(t,n,o,d),m=Xb(n,o),h=Zb(n,c);return(0,D.jsxs)(`div`,{className:m?`dg-node dg-text-node${u.className}${l}`:`${h.className}${u.className}${l}`,style:n.stylePreset?.rough!==void 0||m||h.neutralGlyph?f:{...Qb(c.shape,h.accent),...f},"data-type":n.typeId,...p,...Pb(n),...u.title,children:[(0,D.jsx)(jb,{id:t,data:n,selected:r}),!m&&Ab(n,c.shape,{id:t,width:i,height:a}),c.shape===`diamond`&&n.stylePreset?.rough===void 0&&(0,D.jsx)($b,{accent:h.accent}),(0,D.jsx)(ex,{...e}),(0,D.jsx)(Qoe,{data:n,style:c}),(0,D.jsx)(Nb,{data:n}),(0,D.jsx)(Lb,{id:t,data:n,selected:r,uses:[`link`,`threat`,`comment`,`quickAdd`,`handles`]})]})}var Xb=(e,t)=>t.node?.typelessAsText===!0&&e.typeId===void 0&&(e.state===`leaf`||e.state===`collapsed`)&&e.image===void 0,sse=e=>e===`bar`||e===`start-dot`||e===`end-bullseye`;function Zb(e,t){if(e.hue!==void 0)return lse(e,t,e.hue);let n=t.outline===!0&&e.color!==void 0?Db(e.color):void 0,r=n!==void 0,i=e.color===void 0&&t.fill!==void 0?{background:t.fill,borderColor:t.fill,color:t.textOn}:void 0;return{className:`dg-node dg-shape-${t.shape}${t.dashed===!0?` dg-dashed`:``}${r?` dg-c4-outline`:``}${i!==void 0&&e.stylePreset?.rough===void 0?` dg-solid`:``}`,accent:{...i??(n===void 0?Ob(e.color):{borderColor:n,color:n}),...e.textColor===void 0?{}:{color:e.textColor}},neutralGlyph:sse(t.shape)}}var cse=new Set([`box`,`rounded`,`cylinder`,`pill`,`hexagon`,`person`]);function lse(e,t,n){let r=Ub(n);return{className:`dg-node dg-shape-${t.shape}${t.dashed===!0?` dg-dashed`:``}`,accent:{"--dg-hue":n,...r===void 0?{}:{"--dg-hue-ink":r},...cse.has(t.shape)?{}:Ob(n),...e.textColor===void 0?{}:{color:e.textColor}},neutralGlyph:sse(t.shape)}}function Qb(e,t){if(e!==`diamond`)return t;let n={...t};return delete n.background,delete n.borderColor,n}function $b({accent:e}){return(0,D.jsx)(`svg`,{className:`dg-diamond-glyph`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,D.jsx)(`polygon`,{points:`50,1 99,50 50,99 1,50`,vectorEffect:`non-scaling-stroke`,fill:String(e.background??`var(--dg-node-fill)`),stroke:e.borderColor??`var(--dg-node-stroke)`})})}function ex({id:e,data:t,profile:n,parts:r}){let{style:i,ghost:a,highlight:o,onTab:s}=r,c=Xoe(t,i);return(0,D.jsxs)(`div`,{className:i.captionBelow===!0?`dg-node-row dg-glyph-caption`:`dg-node-row`,children:[a.arrow,t.image!==void 0&&(0,D.jsx)(`img`,{className:`dg-image-thumb`,src:kb(t.assetBase,t.libraryBase,t.image),alt:``,draggable:!1}),c!==void 0&&(0,D.jsx)(c,{size:16,className:`dg-icon`}),t.labelEditing===!0?(0,D.jsx)(Jb,{runs:t.rich??(t.label===``?[]:[{text:t.label}]),onCommit:e=>(t.onRichCommit??(e=>{}))(e),onTab:s}):(0,D.jsx)(dse,{data:t}),t.state===`collapsed`&&!Mb(t,n)&&(0,D.jsx)(`span`,{className:`dg-count`,children:t.hiddenCount}),(0,D.jsx)(rse,{id:e,data:t,profile:n,focusId:o.focusId})]})}var use=e=>e===`sm`?` dg-fs-sm`:e===`lg`?` dg-fs-lg`:``;function dse({data:e}){let t={whiteSpace:`pre-wrap`,color:e.textColor,textAlign:e.textAlign};return e.rich===void 0?(0,D.jsx)(`span`,{className:`dg-label${use(e.fontScale)}`,style:t,children:e.label}):(0,D.jsx)(`span`,{className:`dg-label dg-rich-label${use(e.fontScale)}`,style:t,children:ose(e.rich).map(e=>{let t=e.text;return e.italic&&(t=(0,D.jsx)(`i`,{children:t})),e.bold&&(t=(0,D.jsx)(`b`,{children:t})),(0,D.jsx)(`span`,{children:t},e.key)})})}function fse({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-cld-group${r.loopClass}`,children:[(0,D.jsxs)(`span`,{className:`dg-group-tag`,children:[(0,D.jsx)(`span`,{className:`dg-label`,children:t.label}),(0,D.jsx)(Gb,{id:e,data:t,group:!0})]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]})]})}function pse({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{name:o,loopClass:s,ghost:c}=a,l=t.textColor??t.color;return(0,D.jsxs)(`div`,{className:`dg-node dg-circle-node${c.className}${s}`,style:t.stylePreset?.rough===void 0?Ob(t.color):void 0,...c.title,children:[Ab(t,`circle`,{id:e,width:r,height:i}),(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-commit-tag`,style:l===void 0?void 0:{color:l},children:o}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`link`,`quickAdd`,`handles`]})]})}function mse({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-fb-cause${r.loopClass}`,style:t.textColor===void 0?void 0:{color:t.textColor},children:[r.name,(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function hse({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-fb-head${r.loopClass}`,children:[(0,D.jsx)(`span`,{className:`dg-fb-spine`,"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:`dg-fb-head-box`,children:r.name}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function gse({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-lane${r.loopClass}`,children:[(0,D.jsx)(`span`,{className:`dg-lane-label`,style:t.color===void 0?void 0:{...Ob(t.color),color:t.textColor??t.color},children:r.name}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function _se({data:e,parts:t}){return(0,D.jsx)(`div`,{className:`dg-git-stage${t.loopClass}`,style:e.color===void 0?void 0:{"--dg-stage":e.color},children:(0,D.jsx)(`span`,{className:`dg-git-stage-name`,style:e.textColor===void 0?void 0:{color:e.textColor},children:t.name})})}function vse({id:e,data:t,selected:n,width:r,height:i,profile:a,parts:o}){let{style:s,name:c,loopClass:l,highlight:u}=o,{hitStyle:d,hitAttrs:f}=Zoe(e,t,a,u),p=Xoe(t,s),m=s.outline===!0&&t.color!==void 0?Db(t.color):void 0,h=m!==void 0,g=s.cornerBadge===!0,_=t.hue!==void 0&&t.color!==void 0?{"--dg-hue":Db(t.color)}:void 0;return(0,D.jsxs)(`div`,{className:`dg-group${s.dashed===!0?` dg-dashed`:``}${h?` dg-group-outline`:``}${g?` dg-group-corner`:``}${l}`,style:t.stylePreset?.rough===void 0?{...m===void 0?Ob(t.color):{borderColor:m,color:t.textColor??m},..._,...t.textColor===void 0?{}:{color:t.textColor},...d}:d,"data-type":t.typeId,...f,...Pb(t),children:[(0,D.jsx)(jb,{id:e,data:t,selected:n}),Ab(t,s.shape,{id:e,width:r,height:i},h?`none`:`wash`),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`threat`,`comment`,`quickAdd`]}),(0,D.jsxs)(`div`,{className:`dg-group-header`,children:[t.image!==void 0&&(0,D.jsx)(`img`,{className:g?`dg-corner-badge`:`dg-image-thumb`,src:kb(t.assetBase,t.libraryBase,t.image),alt:``,draggable:!1}),p!==void 0&&(0,D.jsx)(p,{size:14,className:`dg-icon`}),c,(0,D.jsx)(Nb,{data:t}),(0,D.jsx)(rse,{id:e,data:t,profile:a,focusId:u.focusId})]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]})]})}function yse({id:e,data:t,selected:n,parts:r}){let{name:i,loopClass:a,ghost:o}=r;return(0,D.jsxs)(D.Fragment,{children:[t.onResize!==void 0&&(0,D.jsx)(B_,{isVisible:n===!0,keepAspectRatio:!0,minWidth:40,minHeight:40,onResizeEnd:(n,r)=>t.onResize?.(e,r.width,r.height,{x:r.x,y:r.y})}),(0,D.jsxs)(`div`,{className:`dg-node dg-image-node${o.className}${a}`,style:t.textColor===void 0?void 0:{color:t.textColor},...o.title,children:[(0,D.jsx)(`img`,{className:`dg-image`,src:kb(t.assetBase,t.libraryBase,t.image),alt:t.label,draggable:!1}),(0,D.jsxs)(`div`,{className:`dg-image-caption`,children:[o.arrow,i]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`link`,`quickAdd`,`handles`]})]})]})}function bse({id:e,data:t,selected:n,width:r,height:i,parts:a}){return(0,D.jsxs)(`div`,{className:`dg-sm-machine${a.loopClass}`,style:t.color===void 0?void 0:{"--dg-sm-accent":t.color},"data-type":t.typeId,children:[Ab(t,`box`,{id:e,width:r,height:i},`none`),(0,D.jsxs)(`span`,{className:`dg-sm-machine-tab`,children:[`sm `,a.name]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function xse({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{name:o,loopClass:s,ghost:c}=a;return(0,D.jsxs)(`div`,{className:`dg-node dg-event-node${c.className}${s}`,style:t.stylePreset?.rough!==void 0||t.color===void 0?void 0:{color:t.color},"data-type":t.typeId,...c.title,children:[Ab(t,`diamond`,{id:e,width:r,height:i}),(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-event-tag`,children:o}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`link`,`comment`,`quickAdd`,`handles`]})]})}function Sse({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-sm-region${t.regionSeparator===void 0?``:` dg-sm-region-sep-${t.regionSeparator}`}${r.loopClass}`,"data-type":t.typeId,children:[(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-sm-region-name`,children:r.name}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function Cse({id:e,data:t,selected:n,parts:r}){let{style:i,name:a,loopClass:o,ghost:s}=r,c=`url("${kb(t.assetBase,t.libraryBase,t.shape)}")`,l=t.textColor??t.color;return(0,D.jsxs)(`div`,{className:`dg-node dg-shape-node${s.className}${o}`,...s.title,children:[(0,D.jsx)(`span`,{className:`dg-shape-fill`,"aria-hidden":`true`,style:{WebkitMaskImage:c,maskImage:c,background:t.color??`var(--dg-shape-default)`}}),(0,D.jsxs)(`div`,{className:`dg-shape-label`,style:l===void 0?void 0:{color:l},children:[s.arrow,a,(0,D.jsx)(Qoe,{data:t,style:i})]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`link`,`quickAdd`,`handles`]})]})}var wse=new Set([bn,xn,Sn,Cn,wn]),Tse=`M3 3 L21 21 M21 3 L3 21`;function Ese({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{loopClass:o,name:s}=a,c=t.typeId!==wn;return(0,D.jsxs)(`div`,{className:`dg-sm-glyph${c?` dg-sm-ring`:``}${o}`,"data-type":t.typeId,children:[c&&Ab({...t,color:void 0},`circle`,{id:e,width:r,height:i}),(0,D.jsx)(Dse,{type:t.typeId}),(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`div`,{className:`dg-node-row dg-glyph-caption`,children:s}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function Dse({type:e}){return e===`sm-history`?`H`:e===`sm-deep-history`?`H*`:e!==`sm-exit`&&e!==`sm-terminate`?null:(0,D.jsx)(`svg`,{className:`dg-sm-x`,"data-testid":e===`sm-exit`?`sm-exit-x`:`sm-terminate-x`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,D.jsx)(`path`,{d:Tse})})}function tx({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{style:o,name:s,loopClass:c,ghost:l}=a,u=t.state===`expanded`,d=t.stylePreset?.rough===void 0?{...Ob(t.color),...t.textColor===void 0?{}:{color:t.textColor}}:void 0,f=t.composite===!0&&!u,p=t.behaviors??[];return(0,D.jsxs)(`div`,{className:u?`dg-group dg-sm-state dg-sm-state-open${c}`:`dg-node dg-shape-rounded dg-sm-state${l.className}${c}`,style:d,"data-type":t.typeId,...Pb(t),...l.title,children:[Ab(t,o.shape,{id:e,width:r,height:i},u?`wash`:`preset`),u?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`threat`,`comment`,`quickAdd`]}),(0,D.jsxs)(`div`,{className:`dg-group-header`,children:[s,(0,D.jsx)(Nb,{data:t})]}),p.length>0&&(0,D.jsx)(`div`,{className:`dg-sm-open-behaviors`,children:(0,D.jsx)(nx,{lines:p})})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`dg-node-row dg-sm-state-name`,children:[l.arrow,s,f&&(0,D.jsx)(Ose,{})]}),p.length>0&&(0,D.jsx)(nx,{lines:p}),(0,D.jsx)(Nb,{data:t}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`link`,`threat`,`comment`,`quickAdd`]})]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`handles`]})]})}function nx({lines:e}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`hr`,{className:`dg-sm-divider`}),(0,D.jsx)(`ul`,{className:`dg-sm-behaviors`,children:e.map((e,t)=>(0,D.jsx)(`li`,{className:`dg-sm-behavior`,children:e},t))})]})}function Ose(){return(0,D.jsxs)(`svg`,{className:`dg-sm-composite-glyph`,"data-testid":`sm-composite-glyph`,viewBox:`0 0 24 12`,width:`24`,height:`12`,"aria-hidden":`true`,children:[(0,D.jsx)(`rect`,{x:`1`,y:`2`,width:`8`,height:`8`,rx:`4`}),(0,D.jsx)(`rect`,{x:`15`,y:`2`,width:`8`,height:`8`,rx:`4`}),(0,D.jsx)(`line`,{x1:`9`,y1:`6`,x2:`15`,y2:`6`})]})}var rx=[`uuid`,`int`,`bigint`,`text`,`varchar`,`bool`,`timestamp`,`timestamptz`,`jsonb`,`numeric`],ix=`dg-col-types`,ax=e=>e.pk===!0?`🔑`:e.fk===!0?`FK`:``,ox=e=>e.pk!==!0&&e.fk!==!0?{...e,pk:!0,fk:!1}:e.pk===!0?{...e,pk:!1,fk:!0}:{...e,pk:!1,fk:!1},sx=(e,t)=>{if(!t.has(e))return e;for(let n=2;;n++)if(!t.has(`${e}_${n}`))return`${e}_${n}`},cx=e=>e.stopPropagation();function lx({id:e,data:t,selected:n,titleEditor:r}){let i=t.columns??[],a=t.onColumnsChange,o=a!==void 0,s=(e,t)=>a?.(i.map((n,r)=>r===e?t:n)),c=e=>a?.(i.filter((t,n)=>n!==e)),l=(e,t)=>{let n=e+t;if(n<0||n>=i.length)return;let r=i.slice();[r[e],r[n]]=[r[n],r[e]],a?.(r)},u=()=>a?.([...i,{name:sx(`column`,new Set(i.map(e=>e.name))),type:``}]);return(0,D.jsxs)(`div`,{className:`dg-node dg-table${o?` dg-table-edit`:``}`,style:t.color===void 0?void 0:{borderColor:t.color},children:[(0,D.jsx)(`div`,{className:`dg-table-header`,style:{height:30},children:r??(0,D.jsx)(`span`,{className:`dg-table-title`,children:t.label})}),(0,D.jsx)(`div`,{className:`dg-table-body`,children:i.map((e,t)=>o?(0,D.jsx)(dx,{column:e,first:t===0,last:t===i.length-1,onSet:e=>s(t,e),onMove:e=>l(t,e),onRemove:()=>c(t)},t):(0,D.jsx)(kse,{column:e},e.name))}),o&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:`dg-table-add nodrag nopan`,onPointerDown:cx,onClick:e=>{cx(e),u()},children:`+ add column`}),(0,D.jsx)(`datalist`,{id:ix,children:rx.map(e=>(0,D.jsx)(`option`,{value:e},e))})]}),(0,D.jsx)($oe,{data:t}),(0,D.jsx)(Ib,{id:e,data:t,selected:n})]})}function ux({column:e}){return(0,D.jsx)(kg,{id:e.name,type:`source`,position:ym.Right,className:`dg-handle dg-row-handle`,style:{top:22/2}})}function kse({column:e}){return(0,D.jsxs)(`div`,{className:`dg-table-row`,style:{height:22},children:[(0,D.jsx)(`span`,{className:`dg-table-key`,"aria-hidden":`true`,children:ax(e)}),(0,D.jsx)(`span`,{className:`dg-table-col${e.pk===!0?` dg-pk`:``}`,children:e.name}),e.type!==void 0&&(0,D.jsx)(`span`,{className:`dg-table-type`,children:e.type}),(0,D.jsx)(ux,{column:e})]})}function dx({column:e,first:t,last:n,onSet:r,onMove:i,onRemove:a}){return(0,D.jsxs)(`div`,{className:`dg-table-row dg-table-row-edit`,style:{height:22},children:[(0,D.jsx)(`button`,{type:`button`,className:`dg-table-badge nodrag nopan`,title:`Cycle none / PK / FK`,onPointerDown:cx,onClick:t=>{cx(t),r(ox(e))},children:ax(e)===``?`○`:ax(e)}),(0,D.jsx)(`input`,{className:`dg-table-name-input nodrag nopan`,"aria-label":`Column name`,value:e.name,onPointerDown:cx,onChange:t=>r({...e,name:t.target.value})}),(0,D.jsx)(`input`,{className:`dg-table-type-input nodrag nopan`,"aria-label":`Column type`,list:ix,value:e.type??``,onPointerDown:cx,onChange:t=>r({...e,type:t.target.value})}),(0,D.jsx)(`button`,{type:`button`,className:`dg-table-move nodrag nopan`,"aria-label":`Move up`,disabled:t,onPointerDown:cx,onClick:e=>{cx(e),i(-1)},children:`↑`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-table-move nodrag nopan`,"aria-label":`Move down`,disabled:n,onPointerDown:cx,onClick:e=>{cx(e),i(1)},children:`↓`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-table-del nodrag nopan`,"aria-label":`Delete column`,onPointerDown:cx,onClick:e=>{cx(e),a()},children:`✕`}),(0,D.jsx)(ux,{column:e})]})}function fx({id:e,data:t,selected:n,parts:r}){return(0,D.jsx)(lx,{id:e,data:t,selected:n,titleEditor:t.labelEditing===!0?r.name:void 0})}function px({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-sm-zone${r.loopClass}`,style:t.color===void 0?void 0:{"--dg-sm-zone":t.color},"data-type":t.typeId,children:[(0,D.jsxs)(`div`,{className:`dg-sm-zone-head`,children:[(0,D.jsx)(`span`,{className:`dg-sm-zone-title`,children:r.name}),t.zoneNote!==void 0&&(0,D.jsx)(`span`,{className:`dg-sm-zone-note`,children:t.zoneNote})]}),(0,D.jsx)(Lb,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}var mx=[{match:e=>e.typeId===dn,Body:bse},{match:e=>e.typeId===pn,Body:Sse},{match:e=>e.typeId===mn,Body:px},{match:e=>e.typeId===fn,Body:tx},{match:e=>e.typeId!==void 0&&wse.has(e.typeId),Body:Ese},{match:(e,t,n)=>n.shape===`table`&&e.state===`leaf`,Body:fx},{match:(e,t,n)=>n.shape===`circle`&&e.state===`leaf`,Body:pse},{match:e=>e.typeId===`plan-event`&&e.state===`leaf`,Body:xse},{match:e=>e.shape!==void 0&&e.state===`leaf`,Body:Cse},{match:(e,t,n)=>e.image!==void 0&&e.state===`leaf`&&n.cornerBadge!==!0,Body:yse},{match:(e,t)=>e.typeId!==void 0&&t.node?.isLane?.(e.typeId)===!0,Body:gse},{match:e=>e.typeId===fr,Body:hse},{match:e=>e.typeId===mr,Body:mse},{match:e=>e.typeId===Wn,Body:_se},{match:e=>De(e.typeId),Body:Rb},{match:e=>e.typeId===me,Body:zb},{match:(e,t)=>Mb(e,t)&&e.state===`expanded`,Body:fse},{match:e=>e.state===`expanded`,Body:vse},{match:()=>!0,Body:Yb}];function hx({label:e,onCommit:t,onTab:n,ariaLabel:r=`Rename`}){let i=(0,v.useRef)(!1),a=e=>{i.current||(i.current=!0,t?.(e))};return(0,D.jsx)(`input`,{className:`dg-label-input nodrag nopan`,"aria-label":r,defaultValue:e,autoFocus:!0,onFocus:e=>e.target.select(),onBlur:e=>a(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?a(e.target.value):e.key===`Escape`?a(null):e.key===`Tab`&&!e.shiftKey&&(e.preventDefault(),a(e.target.value),n?.())},onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function gx({id:e,data:t,selected:n,width:r,height:i}){let a=t.typeId===void 0?{shape:`box`}:t.typeRegistry.resolve(t.typeId),o=Nl(t.notation),s=(0,v.useContext)(fv),c=s.active?s.nodes.has(e)?s.variant===`loop`?` dg-loop-node-hl`:``:s.variant===`loop`?` dg-loop-node-dim`:` dg-focus-node-dim`:``,l=t.quickAdd,u=l===void 0?void 0:()=>l.run(e),d=t.labelEditing===!0?(0,D.jsx)(hx,{label:t.label,onCommit:t.onLabelCommit,onTab:u}):(0,D.jsx)(`span`,{className:`dg-label`,children:t.label}),f=t.external===!0,p={className:f?` dg-ghost`:``,title:f?{title:`${t.label} — click to enter`}:{},arrow:f?(0,D.jsx)(`span`,{className:`dg-external-arrow`,"aria-hidden":`true`,children:`↗`}):null},{Body:m}=mx.find(e=>e.match(t,o,a));return(0,D.jsx)(m,{id:e,data:t,selected:n,width:r,height:i,profile:o,parts:{style:a,name:d,loopClass:c,highlight:s,ghost:p,onTab:u}})}var _x={open:`open`,mitigated:`mitigated`,accepted:`accepted`,"not-applicable":`n/a`},vx=24,Ase=240,yx=[0,20,40,60,80,100,120],bx=8,xx=28,Sx=2;function Cx(e,t){switch(t){case`ellipse`:return{x:e.x+16+9,y:e.y+8+9};case`group`:return{x:e.x+e.width-48-9,y:e.y+4+9};default:return{x:e.x-6+9,y:e.y-6+9}}}function wx(e){let t=[];for(let{rect:n,kind:r}of e){if(r===`box`){t.push(n);continue}let{x:e,y:i,width:a,height:o}=n;t.push({x:e,y:i,width:a,height:xx}),t.push({x:e,y:i+o-Sx,width:a,height:Sx}),t.push({x:e,y:i,width:Sx,height:o}),t.push({x:e+a-Sx,y:i,width:Sx,height:o})}return t}function Tx(e){return e.map(e=>({x:e.x-bx/2,y:e.y-bx/2,width:bx,height:bx}))}var jse=(e,t)=>{let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),r=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);return n>0&&r>0?n*r:0},Ex=(e,t)=>{let n=Math.max(t.x-e.x,0,e.x-(t.x+t.width)),r=Math.max(t.y-e.y,0,e.y-(t.y+t.height));return Math.hypot(n,r)};function Dx(e,t){let{badge:n,element:r,size:i,away:a}=e,o=r??{x:n.x-9,y:n.y-9,width:18,height:18},{width:s,height:c}=i,l=o.y-14-c,u=o.y+o.height+14,d=o.x-14-s,f=o.x+o.width+14,p={x:0,y:-1},m={x:0,y:1},h={x:-1,y:0},g={x:1,y:0},_=[{at:{x:n.x+vx-s,y:l},out:p},{at:{x:n.x-vx,y:l},out:p},{at:{x:d,y:n.y-vx},out:h},{at:{x:f,y:n.y-vx},out:g},{at:{x:n.x+vx-s,y:u},out:m},{at:{x:n.x-vx,y:u},out:m},{at:{x:d,y:n.y+vx-c},out:h},{at:{x:f,y:n.y+vx-c},out:g}],v=[_];if(a!==void 0){let e=e=>(e.at.x+s/2-n.x)*a.x+(e.at.y+c/2-n.y)*a.y;v=[_.filter(t=>e(t)>0),_.filter(t=>e(t)<=0)]}let y,b=1/0;for(let e of v)for(let r of yx)for(let i of e){let e={x:i.at.x+i.out.x*r,y:i.at.y+i.out.y*r},a={...e,width:s,height:c};if(Ex(n,a)>Ase)continue;let o=0;for(let e of t)o+=jse(a,e);if(o===0)return e;o<b&&(y=e,b=o)}return y??_[0].at}var Ox=16,kx=10,Ax=16,jx=6,Mse=5,Nse=24,Mx=6.2,Pse=5.6,Fse=162,Ise=47,Lse=12,Rse=22,zse=26,Nx=13;function Bse(e,t){let{name:n,threats:r,comments:i=[],links:a=[]}=e,o=(e,t,n)=>Math.max(1,Math.ceil(e.length*n/t)),s=Ox+o(n,Fse,Mx)*Ax+jx;for(let e of r){let n=_x[e.status??`open`],r=t||(e.description??``)!==``||(e.mitigation??``)!==``,i=220-Ise-(Lse+n.length*Pse)-(r?Rse:0);s+=o(e.title,i,Mx)*Ax+Mse}if(i.length>0){s+=zse;for(let e of i)s+=o(e.text,220-2*kx,Mx)*Ax+(e.by!==void 0||e.at!==void 0?Nx:0)+Mse}return a.length>0&&(s+=zse+a.length*21),t&&(s+=Nse),s}var Px=7,Vse=12,Fx=2,Ix=11,Hse=4;function Use(e,t){let{width:n,height:r}=t,i=[{side:`top`,gap:-e.y},{side:`bottom`,gap:e.y-r},{side:`left`,gap:-e.x},{side:`right`,gap:e.x-n}],a=i[0];for(let e of i)e.gap>a.gap&&(a=e);if(a.gap<=0)return null;let o=(e,t)=>Math.min(Math.max(t,19),e-Vse-Px),s,c;switch(a.side){case`top`:{let t=o(n,e.x);s=[{x:t-Px,y:Fx},{x:t+Px,y:Fx}],c={x:t,y:Fx};break}case`bottom`:{let t=o(n,e.x);s=[{x:t-Px,y:r-Fx},{x:t+Px,y:r-Fx}],c={x:t,y:r-Fx};break}case`left`:{let t=o(r,e.y);s=[{x:Fx,y:t-Px},{x:Fx,y:t+Px}],c={x:Fx,y:t};break}default:{let t=o(r,e.y);s=[{x:n-Fx,y:t-Px},{x:n-Fx,y:t+Px}],c={x:n-Fx,y:t}}}let l=e.x-c.x,u=e.y-c.y,d=Math.hypot(l,u);if(d-Ix<Hse)return null;let f={x:e.x-l/d*Ix,y:e.y-u/d*Ix};return{side:a.side,base:s,tip:f}}var Lx=e=>e.stopPropagation();function Rx({data:e,positionAbsoluteX:t,positionAbsoluteY:n,width:r,height:i}){let[a,o]=(0,v.useState)(null),s=e.editing?a??e.editingId:void 0,[c,l]=(0,v.useState)(()=>new Set);(0,v.useEffect)(()=>{e.editing||o(null)},[e.editing]);let u=e.threats.filter($i).length,d=$v({open:u,total:e.threats.length}),f=()=>{o(null),e.onEndEdit?.()},p=e=>l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),m=r!==void 0&&i!==void 0&&r>0&&i>0?Use({x:e.badge.x-(t??0),y:e.badge.y-(n??0)},{width:r,height:i}):null;return(0,D.jsxs)(`div`,{className:`dg-note`,"data-target":zt(e.target),style:{width:220},children:[m!==null&&(0,D.jsx)(`svg`,{className:`dg-note-tail`,"data-side":m.side,"aria-hidden":`true`,children:(0,D.jsx)(`path`,{d:`M${m.base[0].x} ${m.base[0].y} L${m.tip.x} ${m.tip.y} L${m.base[1].x} ${m.base[1].y}`})}),(0,D.jsxs)(`div`,{className:`dg-note-head`,children:[(0,D.jsx)(`span`,{className:`dg-note-name`,children:e.name}),e.threats.length>0&&(0,D.jsx)(`span`,{className:`dg-note-count`,"data-state":d.state,title:d.title,children:`${u} / ${e.threats.length}`})]}),e.threats.length>0&&(0,D.jsx)(`ul`,{className:`dg-note-rows`,children:e.threats.map(t=>(0,D.jsx)(zx,{threat:t,data:e,renaming:s===t.id,expanded:c.has(t.id),onRename:()=>o(t.id),onRenamed:f,onToggle:()=>p(t.id)},t.id))}),e.comments.length>0&&(0,D.jsx)(Wse,{comments:e.comments}),e.links.length>0&&(0,D.jsx)(Gse,{links:e.links,onOpenLink:e.onOpenLink}),e.editing&&e.onAddThreat!==void 0&&(0,D.jsx)(Zv,{className:`dg-note-add nodrag nopan`,onAdd:()=>e.onAddThreat?.(e.target),onPointerDown:Lx})]})}function zx({threat:e,data:t,renaming:n,expanded:r,onRename:i,onRenamed:a,onToggle:o}){let s=e.status??`open`,c=(e.description??``)!==``||(e.mitigation??``)!==``,l=r&&(t.editing||c);return(0,D.jsxs)(`li`,{className:`dg-note-row`,"data-open":$i(e)?`true`:`false`,children:[(0,D.jsxs)(`div`,{className:`dg-note-line`,children:[(0,D.jsx)(`span`,{className:`dg-stride`,"data-category":e.category,title:Yi[e.category],children:e.category}),n?(0,D.jsx)(`span`,{className:`nodrag nopan`,onMouseDown:Lx,onPointerDown:Lx,children:(0,D.jsx)(hx,{label:e.title,ariaLabel:`Rename threat`,onCommit:n=>{t.onRetitleThreat?.(t.target,e.id,n===null?``:n.trim()),a()}})}):(0,D.jsx)(`span`,{className:`dg-note-title`,onDoubleClick:t.editing?e=>{e.stopPropagation(),i()}:void 0,children:e.title}),(0,D.jsx)(Bx,{threat:e,status:s,data:t}),(t.editing||c)&&(0,D.jsx)(`button`,{type:`button`,className:`dg-note-expand nodrag nopan`,"aria-expanded":l,"aria-label":l?`Hide details`:`Show details`,onMouseDown:Lx,onPointerDown:Lx,onClick:e=>{e.stopPropagation(),o()},children:l?`▾`:`▸`})]}),l&&(0,D.jsx)(Vx,{threat:e,data:t})]})}function Bx({threat:e,status:t,data:n}){let r=_x[t];return!n.editing||n.onSetThreatStatus===void 0?(0,D.jsx)(`span`,{className:`dg-note-status`,"data-status":t,children:r}):(0,D.jsx)(`button`,{type:`button`,className:`dg-note-status nodrag nopan`,"data-status":t,"aria-label":`Set status`,title:`Status: ${r} — click to change`,onMouseDown:Lx,onPointerDown:Lx,onClick:t=>{t.stopPropagation(),n.onSetThreatStatus?.(n.target,e.id,sa(e))},children:r})}function Vx({threat:e,data:t}){return(0,D.jsx)(`div`,{className:`dg-note-details`,children:t.editing&&t.onEditThreatText!==void 0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Kse,{label:`Description`,value:e.description??``,onCommit:n=>t.onEditThreatText?.(t.target,e.id,`description`,n)}),(0,D.jsx)(Kse,{label:`Mitigation`,value:e.mitigation??``,onCommit:n=>t.onEditThreatText?.(t.target,e.id,`mitigation`,n)})]}):(0,D.jsxs)(D.Fragment,{children:[(e.description??``)!==``&&(0,D.jsx)(`p`,{className:`dg-note-text`,children:e.description}),(e.mitigation??``)!==``&&(0,D.jsxs)(`p`,{className:`dg-note-text`,children:[(0,D.jsx)(`span`,{className:`dg-note-text-label`,children:`Mitigation`}),` `,e.mitigation]})]})})}function Wse({comments:e}){return(0,D.jsxs)(`section`,{className:`dg-note-section`,"aria-label":`Comments`,children:[(0,D.jsx)(`h4`,{className:`dg-note-section-title`,children:`Comments`}),(0,D.jsx)(`ul`,{className:`dg-note-comments`,children:e.map(e=>(0,D.jsxs)(`li`,{className:`dg-note-comment`,children:[(0,D.jsx)(`p`,{className:`dg-note-text`,children:e.text}),(e.by!==void 0||e.at!==void 0)&&(0,D.jsx)(`span`,{className:`dg-note-meta`,children:[e.by,e.at].filter(e=>e!==void 0).join(` · `)})]},e.id))})]})}function Gse({links:e,onOpenLink:t}){return(0,D.jsxs)(`section`,{className:`dg-note-section`,"aria-label":`Links`,children:[(0,D.jsx)(`h4`,{className:`dg-note-section-title`,children:`Links`}),(0,D.jsx)(`ul`,{className:`dg-note-links`,children:e.map(e=>(0,D.jsx)(`li`,{children:(0,D.jsx)(`a`,{className:`dg-note-link nodrag nopan`,.../^https?:/.test(e.url)?{href:e.url,target:`_blank`,rel:`noopener noreferrer`}:{},onMouseDown:Lx,onPointerDown:Lx,onClick:n=>{n.stopPropagation(),t!==void 0&&(n.preventDefault(),t(e.url))},children:e.label})},`${e.label}\u0000${e.url}`))})]})}function Kse({label:e,value:t,onCommit:n}){let[r,i]=(0,v.useState)(t);(0,v.useEffect)(()=>{i(t)},[t]);let a=(0,v.useRef)(!1);return(0,D.jsx)(`textarea`,{className:`dg-note-field nodrag nopan`,"aria-label":e,placeholder:e,rows:2,value:r,onMouseDown:Lx,onPointerDown:Lx,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(i(t),a.current=!0,e.target.blur())},onBlur:()=>{if(a.current){a.current=!1;return}let e=r.trim();e!==t.trim()&&n(e)}})}var qse={diagram:gx,note:Rx},Jse={diagram:Koe};function Yse({data:e,...t}){return{...Ge(t),type:`diagram`,data:e}}function Hx({data:e,...t}){return{...Ge(t),type:`note`,data:e,selectable:!1,zIndex:2}}function Xse({data:e,...t}){return{...Ge(t),type:`diagram`,data:e}}function Ux(e){let t=e.length/2;if(t===0)return``;let n=t=>e[2*t],r=t=>e[2*t+1];if(t===1)return`M ${n(0)} ${r(0)} L ${n(0)} ${r(0)}`;if(t===2)return`M ${n(0)} ${r(0)} L ${n(1)} ${r(1)}`;let i=[`M ${n(0)} ${r(0)}`];for(let e=1;e<t-1;e++)i.push(`Q ${n(e)} ${r(e)} ${(n(e)+n(e+1))/2} ${(r(e)+r(e+1))/2}`);return i.push(`L ${n(t-1)} ${r(t-1)}`),i.join(` `)}function Wx(e,t=.75){let n=e.length/2;if(n<=2)return e;let r=Array(n).fill(!1);r[0]=!0,r[n-1]=!0;let i=[[0,n-1]];for(;i.length>0;){let[n,a]=i.pop(),o=e[2*n],s=e[2*n+1],c=e[2*a],l=e[2*a+1],u=c-o,d=l-s,f=Math.hypot(u,d),p=-1,m=t;for(let t=n+1;t<a;t++){let n=e[2*t],r=e[2*t+1],i=f===0?Math.hypot(n-o,r-s):Math.abs(d*n-u*r+c*s-l*o)/f;i>m&&(p=t,m=i)}p!==-1&&(r[p]=!0,i.push([n,p],[p,a]))}let a=[];for(let t=0;t<n;t++)r[t]&&a.push(e[2*t],e[2*t+1]);return a}function Gx(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e){let e=(a.width??3)/2;for(let o=0;o<a.points.length;o+=2){let s=a.points[o],c=a.points[o+1];t=Math.min(t,s-e),r=Math.max(r,s+e),n=Math.min(n,c-e),i=Math.max(i,c+e)}}if(t!==1/0)return{x:t,y:n,width:r-t,height:i-n}}function Kx(e,t){return e===null?null:{points:e,width:t?.width??3,color:t?.color}}var qx=12;function Jx({strokes:e,live:t,visible:n,erasing:r,onErase:i}){let{x:a,y:o,zoom:s}=m_();return(0,D.jsx)(`svg`,{className:`dg-drawings`,"aria-hidden":`true`,style:n?void 0:{display:`none`},children:(0,D.jsxs)(`g`,{transform:`translate(${a} ${o}) scale(${s})`,children:[e.map(e=>(0,D.jsx)(`path`,{className:`dg-stroke`,"data-stroke-id":e.id,d:Ux(e.points),stroke:e.color??`var(--dg-ink)`,strokeWidth:e.width??3},e.id)),r&&e.map(e=>(0,D.jsx)(`path`,{className:`dg-stroke-hit`,"data-stroke-id":e.id,d:Ux(e.points),strokeWidth:Math.max(e.width??3,qx/s),onClick:()=>i?.(e.id)},`hit-${e.id}`)),t!=null&&t.points.length>=2&&(0,D.jsx)(`path`,{className:`dg-stroke dg-stroke-live`,d:Ux(t.points),stroke:t.color??`var(--dg-ink)`,strokeWidth:t.width})]})})}function Zse({trails:e,live:t}){let{x:n,y:r,zoom:i}=m_(),a=(e,t,n)=>{let r=Ux(t);return(0,D.jsxs)(`g`,{className:`dg-laser-trail ${n?`dg-laser-fade`:`dg-laser-live`}`,children:[(0,D.jsx)(`path`,{className:`dg-laser-halo`,d:r,vectorEffect:`non-scaling-stroke`}),(0,D.jsx)(`path`,{className:`dg-laser-core`,d:r,vectorEffect:`non-scaling-stroke`})]},e)};return(0,D.jsx)(`svg`,{className:`dg-laser`,"aria-hidden":`true`,children:(0,D.jsxs)(`g`,{transform:`translate(${n} ${r}) scale(${i})`,children:[e.map(e=>a(e.id,e.points,!0)),t!==null&&t.length>=2&&a(`live`,t,!1)]})})}function Yx({enabled:e,toFlow:t,onStroke:n,simplify:r=!0}){let[i,a]=(0,v.useState)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useCallback)(e=>{let n=o.current;if(n===null)return;let r=e.nativeEvent,i=typeof r.getCoalescedEvents==`function`?r.getCoalescedEvents():[];for(let e of i.length>0?i:[r]){let r=t({x:e.clientX,y:e.clientY});n.push(r.x,r.y)}a([...n])},[t]),l=(0,v.useCallback)(n=>{if(!e||n.button!==0||n.target?.closest?.(`.react-flow__panel`)!==null)return;if(s.current!==null){n.stopPropagation(),n.preventDefault();return}n.stopPropagation(),n.preventDefault(),n.currentTarget.setPointerCapture?.(n.pointerId),s.current=n.pointerId;let r=t({x:n.clientX,y:n.clientY});o.current=[r.x,r.y],a([r.x,r.y])},[e,t]),u=(0,v.useCallback)(e=>{s.current===e.pointerId&&(e.stopPropagation(),c(e))},[c]),d=(0,v.useCallback)((e,t)=>{if(s.current!==e.pointerId)return;e.stopPropagation();let i=o.current;if(o.current=null,s.current=null,a(null),t&&i!==null){let e=i.map(e=>Math.round(e));n(r?Wx(e):e)}},[n,r]);return{live:i,handlers:{onPointerDownCapture:l,onPointerMoveCapture:u,onPointerUpCapture:(0,v.useCallback)(e=>d(e,!0),[d]),onPointerCancelCapture:(0,v.useCallback)(e=>d(e,!1),[d])}}}var Xx=1e3;function Zx({enabled:e,toFlow:t}){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(0),a=(0,v.useRef)(new Set),o=(0,v.useCallback)(e=>{let t=i.current++;r(n=>[...n,{id:t,points:e}]);let n=setTimeout(()=>{a.current.delete(n),r(e=>e.filter(e=>e.id!==t))},Xx);a.current.add(n)},[]);(0,v.useEffect)(()=>{let e=a.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]);let s=Yx({enabled:e,toFlow:t,onStroke:o,simplify:!1});return{live:s.live,trails:n,handlers:s.handlers}}function Qx(e){let t=e.target,n=t?.tagName;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable===!0?!1:!(e.metaKey||e.ctrlKey||e.altKey)}function Qse(e){let t=(0,v.useRef)(e.fit);t.current=e.fit,(0,v.useEffect)(()=>{if(e.chromeless||!e.builtinKeys)return;let n=e=>{e.repeat||e.key.toLowerCase()!==`f`||!Qx(e)||(e.preventDefault(),t.current())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e.chromeless,e.builtinKeys])}function $x(e){let[t,n]=(0,v.useState)(!1),r=e.editing&&e.tool===`pen`&&e.drillRoot===void 0&&!t,i=e.editing&&e.tool===`eraser`&&e.drillRoot===void 0&&!t,a=r||t;(0,v.useEffect)(()=>{n(!1)},[e.modelId]),(0,v.useEffect)(()=>{if(e.chromeless)return;let t=t=>{Qx(t)&&(t.key===`Escape`?n(!1):e.builtinKeys&&t.key.toLowerCase()===`l`&&!t.repeat&&(t.preventDefault(),n(e=>!e)))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.chromeless,e.builtinKeys]);let o=Yx({enabled:r&&e.onAddStroke!==void 0,toFlow:e.toFlow,onStroke:t=>e.onAddStroke?.({points:t,...e.pen?.color===void 0?{}:{color:e.pen.color},width:e.pen?.width??3})}),s=Zx({enabled:t,toFlow:e.toFlow});return{laserOn:t,setLaserOn:n,penActive:r,eraserActive:i,gestureCaptured:a,pen:o,laser:s,gestureHandlers:(0,v.useMemo)(()=>{let e=e=>t=>{s.handlers[e](t),o.handlers[e](t)};return{onPointerDownCapture:e(`onPointerDownCapture`),onPointerMoveCapture:e(`onPointerMoveCapture`),onPointerUpCapture:e(`onPointerUpCapture`),onPointerCancelCapture:e(`onPointerCancelCapture`)}},[s.handlers,o.handlers])}}function $se(e){let t=(0,v.useMemo)(()=>e.drawings?.planes[yt(e.model,e.plane)]??[],[e.drawings,e.model,e.plane]),n=(0,v.useRef)([]);n.current=t;let[r,i]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{i(!0)},[e.model.id]),{strokes:t,strokesRef:n,drawingsVisible:r,setDrawingsVisible:i}}function ece({lines:e}){let{zoom:t}=m_();if(e.length===0)return null;let n=1/t,r=`${4/t} ${3/t}`;return(0,D.jsx)(u_,{children:(0,D.jsx)(`svg`,{className:`dg-guides`,"aria-hidden":`true`,children:e.map((e,t)=>e.axis===`x`?(0,D.jsx)(`line`,{className:`dg-guide`,x1:e.at,x2:e.at,y1:e.from,y2:e.to,strokeWidth:n,strokeDasharray:r},t):(0,D.jsx)(`line`,{className:`dg-guide`,y1:e.at,y2:e.at,x1:e.from,x2:e.to,strokeWidth:n,strokeDasharray:r},t))})})}var tce=[{mode:`left`,glyph:`⇤`,label:`Align left`},{mode:`centerX`,glyph:`⇹`,label:`Align centre`},{mode:`right`,glyph:`⇥`,label:`Align right`},{mode:`top`,glyph:`⤒`,label:`Align top`},{mode:`middle`,glyph:`⇳`,label:`Align middle`},{mode:`bottom`,glyph:`⤓`,label:`Align bottom`}];function nce({ids:e,onAlign:t,onDistribute:n}){if(e.length<2)return null;let r=e.length>=3;return(0,D.jsxs)(qh,{position:`top-center`,className:`dg-selection-toolbar`,"aria-label":`Arrange selection`,children:[tce.map(e=>(0,D.jsx)(`button`,{type:`button`,className:`dg-arrange-btn`,title:e.label,"aria-label":e.label,onClick:()=>t(e.mode),children:e.glyph},e.mode)),(0,D.jsx)(`span`,{className:`dg-arrange-sep`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-arrange-btn`,title:`Distribute horizontally (3+ nodes)`,"aria-label":`Distribute horizontally`,disabled:!r,onClick:()=>n(`x`),children:`⋯`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-arrange-btn`,title:`Distribute vertically (3+ nodes)`,"aria-label":`Distribute vertically`,disabled:!r,onClick:()=>n(`y`),children:`⋮`})]})}var rce={layers:`Layers`,kinds:`Connections`,types:`Elements`,marks:`Marks`,items:`Notes`},ice=[`layers`,`kinds`,`types`,`marks`,`items`],ace=`var(--dg-node-stroke, var(--dg-border))`,eS=.75;function tS({name:e,at:t,x:n,color:r}){let i=Hv[e];return i===void 0?null:(0,D.jsx)(`g`,{transform:`translate(${n} 6) scale(${t===`start`?-.75:eS} ${eS}) translate(${-i.refX} -5)`,...Wv.has(e)?{stroke:r,strokeWidth:1.25,vectorEffect:`non-scaling-stroke`,fill:`none`}:{fill:r},children:i.el})}function nS({style:e,color:t}){let n=e.width??1.5,r=e.dashed===!0||e.animated===!0?`6 4`:void 0,i=e.endMarker??`arrow`,a=Hv[i];return(0,D.jsxs)(`svg`,{className:`dg-legend-swatch`,viewBox:`0 0 24 12`,width:`24`,height:`12`,"aria-hidden":`true`,children:[(0,D.jsx)(`line`,{x1:`1`,y1:`6`,x2:a!==void 0&&!Wv.has(i)?23-(a.refX-2)*eS:23,y2:`6`,stroke:t,strokeWidth:n,strokeDasharray:r}),e.zigzag===!0&&(0,D.jsx)(`polyline`,{points:`8,9 12.5,4.5 10.5,7.5 15,3`,fill:`none`,stroke:t,strokeWidth:1.25}),e.startMarker!==void 0&&(0,D.jsx)(tS,{name:e.startMarker,at:`start`,x:1,color:t}),(0,D.jsx)(tS,{name:i,at:`end`,x:23,color:t})]})}function rS({s:e,stroke:t}){let n={fill:`var(--dg-surface)`,stroke:t,strokeDasharray:e.dashed===!0?`4 3`:void 0};switch(e.shape){case`cylinder`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`ellipse`,{cx:`12`,cy:`4`,rx:`8`,ry:`3`,fill:`var(--dg-surface)`,stroke:t}),(0,D.jsx)(`path`,{d:`M4 4 v8 a8 3 0 0 0 16 0 v-8`,fill:`var(--dg-surface)`,stroke:t})]});case`pill`:return(0,D.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`10`,rx:`5`,...n});case`rounded`:return(0,D.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`10`,rx:`4.5`,...n});case`hexagon`:return(0,D.jsx)(`polygon`,{points:`6,3 18,3 22,8 18,13 6,13 2,8`,fill:`var(--dg-surface)`,stroke:t});case`bubble`:return(0,D.jsx)(`path`,{d:`M 4 3 L 20 3 Q 22 3 22 5 L 22 11 Q 22 13 20 13 L 10 13 L 6 16 L 6 13 L 4 13 Q 2 13 2 11 L 2 5 Q 2 3 4 3 Z`,...n});case`person`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`path`,{d:`M5 15 v-3 a4 4 0 0 1 4 -4 h6 a4 4 0 0 1 4 4 v3 z`,...n}),(0,D.jsx)(`circle`,{cx:`12`,cy:`4.5`,r:`3`,...n})]});case`table`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`12`,rx:`1.5`,...n}),(0,D.jsx)(`path`,{d:`M2 6.5 h20 M2 10.25 h20`,fill:`none`,stroke:t})]});case`circle`:return(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`5.5`,...n});case`ellipse`:return(0,D.jsx)(`ellipse`,{cx:`12`,cy:`8`,rx:`10`,ry:`5.5`,...n});case`diamond`:return(0,D.jsx)(`polygon`,{points:`12,1.5 20,8 12,14.5 4,8`,...n});case`bar`:return(0,D.jsx)(`rect`,{x:`10.5`,y:`1`,width:`3`,height:`14`,rx:`1`,fill:t});case`start-dot`:return(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`5`,fill:t});case`end-bullseye`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`6`,fill:`var(--dg-surface)`,stroke:t}),(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`3.25`,fill:t})]});case`send-signal`:return(0,D.jsx)(`polygon`,{points:`2,3 17,3 22,8 17,13 2,13`,...n});case`receive-signal`:return(0,D.jsx)(`polygon`,{points:`2,3 22,3 22,13 2,13 7,8`,...n});case`note`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`polygon`,{points:`2,2 17,2 22,7 22,14 2,14`,...n}),(0,D.jsx)(`path`,{d:`M17 2 v5 h5`,fill:`none`,stroke:t})]});case`store`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`line`,{x1:`2`,y1:`3.5`,x2:`22`,y2:`3.5`,stroke:t}),(0,D.jsx)(`line`,{x1:`2`,y1:`12.5`,x2:`22`,y2:`12.5`,stroke:t})]});case`box`:return(0,D.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`10`,rx:`2`,...n})}}function iS({mark:e}){let t=e===`threat-open`?$v({open:1,total:1}):e===`threat-handled`?$v({open:0,total:1}):void 0;return(0,D.jsx)(`span`,{className:`dg-legend-swatch dg-legend-mark`,"data-mark":e,"aria-hidden":`true`,children:t===void 0?(0,D.jsx)(`span`,{className:`dg-table-key`,children:e===`pk`?`🔑`:`FK`}):(0,D.jsx)(`span`,{className:`dg-legend-badge`,"data-state":t.state,children:t.text})})}function aS({swatch:e,icons:t}){if(e===void 0)return(0,D.jsx)(`span`,{className:`dg-legend-swatch`,"aria-hidden":`true`});if(e.draw===`chip`)return(0,D.jsx)(`span`,{className:`dg-legend-swatch dg-legend-chip`,style:{background:e.color},"aria-hidden":`true`});if(e.draw===`mark`)return(0,D.jsx)(iS,{mark:e.mark});if(e.draw===`line`)return(0,D.jsx)(nS,{style:e.style,color:e.color??`var(--dg-edge)`});let n=e.icon===void 0?void 0:t?.resolve(e.icon),r=e.color===void 0?ace:e.style.outline===!0?Db(e.color):e.color;return(0,D.jsxs)(`span`,{className:`dg-legend-swatch dg-legend-shape`,children:[(0,D.jsx)(`svg`,{viewBox:`0 0 24 16`,width:`24`,height:`16`,"aria-hidden":`true`,children:(0,D.jsx)(rS,{s:e.style,stroke:r})}),n!==void 0&&(0,D.jsx)(n,{size:9,className:`dg-legend-icon`})]})}function oS({rows:e,title:t=`Legend`,interactive:n,onToggleLayer:r,onToggleDrawings:i,icons:a,onMeasure:o}){let[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),u=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(o===void 0||l.current===null)return;let{width:e,height:t}=l.current.getBoundingClientRect(),n={width:Math.ceil(e),height:Math.ceil(t)},r=u.current;r!==null&&r.width===n.width&&r.height===n.height||(u.current=n,o(n))},[o,e,s]),e.length===0)return null;let d=ice.map(t=>[t,e.filter(e=>e.section===t)]).filter(([,e])=>e.length>0);return(0,D.jsxs)(`div`,{className:`dg-legend`,ref:l,children:[(0,D.jsxs)(`div`,{className:`dg-legend-head`,children:[(0,D.jsx)(`span`,{className:`dg-legend-title`,children:t}),n&&(0,D.jsx)(`button`,{type:`button`,className:`dg-legend-collapse`,"aria-label":s?`Expand legend`:`Collapse legend`,"aria-expanded":!s,onClick:()=>c(e=>!e),children:(0,D.jsx)(`span`,{"aria-hidden":`true`,children:s?`▸`:`▾`})})]}),!s&&(0,D.jsx)(`div`,{className:`dg-legend-body`,children:d.map(([e,t])=>(0,D.jsxs)(`div`,{className:`dg-legend-section`,children:[(0,D.jsx)(`div`,{className:`dg-legend-section-title`,children:rce[e]}),t.map(e=>{let t=(0,D.jsx)(aS,{swatch:e.swatch,icons:a}),n=e.layer;return e.drawings===!0&&i!==void 0?(0,D.jsxs)(`button`,{type:`button`,className:`dg-legend-row dg-legend-toggle${e.active===!0?``:` dg-legend-off`}`,"aria-pressed":e.active===!0,onClick:i,children:[t,(0,D.jsx)(`span`,{className:`dg-legend-label`,children:e.label})]},e.id):n!==void 0&&r!==void 0?(0,D.jsxs)(`button`,{type:`button`,className:`dg-legend-row dg-legend-toggle${e.active===!0?``:` dg-legend-off`}`,"aria-pressed":e.active===!0,onClick:()=>r(n),children:[t,(0,D.jsx)(`span`,{className:`dg-legend-label`,children:e.label})]},e.id):(0,D.jsxs)(`div`,{className:`dg-legend-row${(n!==void 0||e.drawings===!0)&&e.active!==!0?` dg-legend-off`:``}`,children:[t,(0,D.jsx)(`span`,{className:`dg-legend-label`,children:e.label})]},e.id)})]},e))})]})}function sS({legend:e,interactive:t,onToggleLayer:n,onToggleDrawings:r,icons:i}){return!e.showLegend||e.legendRowList.length===0?null:(0,D.jsx)(qh,{position:e.legendConfig?.position??`bottom-right`,children:(0,D.jsx)(oS,{rows:e.legendRowList,title:e.legendConfig?.title,interactive:t,onToggleLayer:n,onToggleDrawings:t?r:void 0,icons:i,onMeasure:e.setLegendSize})})}var cS=e=>(e.behaviors??[]).map(e=>on(e)),lS=15.4,uS=e=>cS(e).flatMap(e=>e.split(`
23
- `));function dS(e){let t=uS(e);return t.length===0?0:Math.ceil(9+t.length*lS)}var fS={TITLE_STRIP_W:28,LANE_STRIP_W:28,LANE_MIN_W:320,LANE_MIN_H:120,PAD:24};function pS(e,t){let n=new Map;return _t(e,dt(e,t)).forEach((e,t)=>{let r=`${e.parent}\u0000${e.child}`;n.has(r)||n.set(r,t)}),(e,t)=>n.get(`${e}\u0000${t}`)??2**53-1}function mS(e,t,n){if(!t.nodes.some(e=>e.type===`activity-frame`))return e;let r=pS(t,n),i=!1,a=e=>{let t=e.children.map(a);if(e.node.type===`activity-frame`){let n=[...t].sort((t,n)=>r(e.id,t.id)-r(e.id,n.id));n.some((e,n)=>e!==t[n])&&(t=n)}return t.every((t,n)=>t===e.children[n])?e:(i=!0,{...e,children:t})},o=e.roots.map(a);return i?{...e,roots:o}:e}function hS(e,t,n,{plane:r,sizes:i}={}){if(!n.nodes.some(e=>e.type===`activity-frame`))return e;let a=new Map(n.nodes.map(e=>[e.id,e.type])),o=new Map(e),{TITLE_STRIP_W:s,LANE_MIN_W:c,LANE_MIN_H:l,PAD:u}=fS,d=pS(n,r),f=e=>{let t=e.children.filter(e=>a.get(e.id)===`activity-lane`&&o.has(e.id)).sort((t,n)=>d(e.id,t.id)-d(e.id,n.id));if(t.length===0){let t=o.get(e.id);o.set(e.id,{...t,width:Math.max(t.width,s+c),height:Math.max(t.height,l)});return}let n=[],r=c;for(let e of t){let t=0,a=0;for(let n of e.children){let e=o.get(n.id);e!==void 0&&(t=Math.max(t,e.x+e.width),a=Math.max(a,e.y+e.height))}let s=i?.[e.id];n.push(Math.max(l,a+u,s?.h??0)),r=Math.max(r,t+u,s?.w??0)}let f=0;t.forEach((e,t)=>{let i=o.get(e.id);o.set(e.id,{...i,x:s,y:f,width:r,height:n[t]}),f+=n[t]});let p=o.get(e.id);o.set(e.id,{...p,width:s+r,height:f})},p=e=>{a.get(e.id)===`activity-frame`&&o.has(e.id)&&f(e),e.children.forEach(p)};return t.roots.forEach(p),o}function gS(e,t,n){let r=[...e].sort((e,t)=>e.y-t.y),i=r.findIndex(e=>e.id===t);if(i===-1)return 0;let a=n+r[i].height/2;return r.filter(e=>e.id!==t&&e.y+e.height/2<a).length-i}var _S={"elk.nodeLabels.placement":`OUTSIDE V_TOP H_CENTER`},vS={"elk.nodeLabels.placement":`OUTSIDE H_RIGHT V_CENTER`};function yS(e,t,n){let r=new Map;for(let t of e)t.from===t.to&&r.set(t.from,[...r.get(t.from)??[],t]);let i=t===`RIGHT`||t===`LEFT`,a=new Map;for(let[e,t]of r){let r=gb(t.length-1),o=t.map(n).filter(e=>e!==void 0),s=Math.max(0,...o.map(e=>e.width)),c=Math.max(0,...o.map(e=>e.height)),l=e=>r+(o.length>0?10+e:0);a.set(e,i?{width:Math.max(1,s),height:l(c/2),text:`self-loops`,layoutOptions:_S}:{width:l(s),height:Math.max(2*_b(0),c),text:`self-loops`,layoutOptions:vS})}return a}var bS={width:200,height:88};function xS(e){return{width:e.width,height:e.height+(e.reserveBottom??0)}}var oce=`layered`,sce=new Set([`force`,`stress`,`mrtree`,`radial`]);function cce(e){return sce.has(e?.algorithm??`layered`)}function SS(e){let t=e?.algorithm??`layered`,n=e?.spacing,r=String(n===void 0?40:n),i=r,a={"elk.algorithm":t,"elk.direction":e?.direction??`DOWN`,"elk.spacing.nodeNode":r,"elk.spacing.edgeNode":`20`,"elk.spacing.edgeEdge":`12`,"elk.spacing.componentComponent":`48`,"elk.spacing.edgeLabel":`6`,"elk.separateConnectedComponents":`true`,...cce(e)?{}:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`}};return t===`layered`&&(a[`elk.layered.spacing.nodeNodeBetweenLayers`]=i,a[`elk.layered.thoroughness`]=`10`,a[`elk.layered.crossingMinimization.strategy`]=`LAYER_SWEEP`,a[`elk.layered.nodePlacement.strategy`]=`BRANDES_KOEPF`,a[`elk.layered.nodePlacement.bk.fixedAlignment`]=`BALANCED`,e?.aspectRatio!==void 0&&(a[`elk.layered.wrapping.strategy`]=`MULTI_EDGE`,a[`elk.aspectRatio`]=String(e.aspectRatio))),t===`stress`&&(a[`elk.stress.desiredEdgeLength`]=`240`),(t===`layered`||e?.edgeRouting===`orthogonal`)&&(a[`elk.edgeRouting`]=`ORTHOGONAL`),a}function lce(e){let t=new Map,n=(e,r)=>{t.set(e.id,r),e.children.forEach(t=>n(t,e.id))};e.roots.forEach(e=>n(e,null));let r=e=>{let n=[],r=e;for(;r!=null;)n.push(r),r=t.get(r);return n.reverse()},i=new Map;for(let t of e.layoutEdges){let e=r(t.from),n=r(t.to);if(e.length===0||n.length===0)continue;let a=0;for(;a<e.length&&a<n.length&&e[a]===n[a];)a++;let o=a===0?null:e[a-1],s=e[a],c=n[a];if(s===void 0||c===void 0||s===c)continue;let l=i.get(o)??[];l.push({id:t.id,sources:[s],targets:[c]}),i.set(o,l)}return i}var CS={top:36,left:16,bottom:16,right:16},uce={top:fS.PAD,left:fS.LANE_STRIP_W+fS.PAD,bottom:fS.PAD,right:fS.PAD},wS={top:0,left:fS.TITLE_STRIP_W,bottom:0,right:0};function TS(e){if(e.node.type===`activity-lane`)return uce;if(e.node.type===`activity-frame`)return wS;if(e.node.type===`sm-zone`)return ES(e.node)===void 0?dce:fce;let t=e.node.type===`sm-state`?dS(e.node):0;return t>0?{...CS,top:CS.top+t}:CS}var ES=e=>e.description!==void 0&&e.description.trim()!==``?e.description.trim():void 0,dce={...CS,top:36},fce={...CS,top:53},pce=24;function mce(e){if(e.node.type!==`sm-zone`)return 0;let t=ES(e.node),n=Sc(e.node.name,12)*1.08;return Math.ceil(Math.max(n,t===void 0?0:Sc(t,11)))+pce}var hce=e=>`[top=${e.top}.0,left=${e.left}.0,bottom=${e.bottom}.0,right=${e.right}.0]`,gce=hce({top:0,left:0,bottom:0,right:0});function _ce(e,t){let n=e?.spacing??40;return t?n:Math.round(n*1.2)}function vce(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e.includes(`.spacing.`)))}var yce=6,bce=12,xce=18,Sce=14;function DS(e){return e.labels!==void 0&&e.labels.length>0?e.labels.reduce((e,t)=>t.text.length>e.length?t.text:e,``):e.label??``}var OS={"elk.edgeLabels.inline":`true`};function kS(e){let t=DS(e).trim();if(t===``)return;let n=jn(e.kind)?Fn(t,24):[t],r=Math.min(Math.max(...n.map(e=>[...e].length)),24);return{width:Math.round(r*yce+bce),height:xce+(n.length-1)*Sce}}var Cce={"elk.nodeLabels.placement":`OUTSIDE V_BOTTOM H_CENTER`},wce=`note-link`,Tce=new Set([ve,hn]);function AS(e){let t=e=>Tce.has(e.node.type)||e.children.some(t);return e.roots.some(t)}var Ece=(e,t)=>!t&&[`DOWN`,`UP`].includes(e?.direction??`DOWN`),Dce=(e,t)=>({"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":t?`(0.0, ${e}.0)`:`(${e}.0, 0.0)`}),jS=(e,t)=>{let n=mce(t);return{...e.sharedContainerOptions,"elk.padding":hce(TS(t)),...n>0?Dce(n,e.swapsMinimum):{}}};function MS(e,t){e.emitted.add(t.id);let n=e.substitute?.prelaid.get(t.id);if(n!==void 0)return{id:t.id,width:n.width,height:n.height};let r=e.substitute?.packs.get(t.id);if(r!==void 0)return{id:t.id,children:[...t.children.filter(e=>!r.members.has(e.id)).map(t=>MS(e,t)),{id:r.id,width:r.width,height:r.height}],layoutOptions:jS(e,t)};if(t.state===`expanded`){let n=e.byOwner?.get(t.id),r=n!==void 0&&n.length>0;return r&&(e.attachedToContainer=!0),{id:t.id,children:t.children.map(t=>MS(e,t)),layoutOptions:jS(e,t),...r?{edges:n}:{}}}if(t.state===`collapsed`){let n=e.sizes?.get(t.id)??bS,r=e.loopRooms.get(t.id);return{id:t.id,width:n.width,height:n.height,...r===void 0?{}:{labels:[r]}}}return Oce(e,t)}function Oce(e,t){let n=e.sizes?.get(t.id)?.caption,r=[...n===void 0?[]:[{...n,text:`caption`,layoutOptions:Cce}],...e.loopRooms.has(t.id)?[e.loopRooms.get(t.id)]:[]];return{id:t.id,...xS(e.sizes?.get(t.id)??Zo),...r.length>0?{labels:r}:{},...e.fromStart&&Tce.has(t.node.type)?{layoutOptions:{"elk.layered.layering.layerConstraint":`FIRST`}}:{}}}function kce(e,t){let n=t?.get(e.id);return n===void 0?e:{...e,layoutOptions:{...e.layoutOptions,"elk.partitioning.partition":String(n)}}}var Ace=`__order__`,jce={"elk.layered.priority.direction":`100`};function Mce(e,t,n){return e.layoutEdges.filter(e=>e.from!==e.to&&(t.substitute===void 0||t.emitted.has(e.from)&&t.emitted.has(e.to))).map(e=>{let r=DS(e).trim(),i=kS(e),a=t.fromStart&&e.kind===wce;return a&&n.add(e.id),{id:e.id,sources:[a?e.to:e.from],targets:[a?e.from:e.to],...i===void 0?{}:{labels:[{...i,text:r,layoutOptions:OS}]},...e.kind===`__order__`?{layoutOptions:jce}:{}}})}function Nce(e,t){let n=new Map(e.layoutEdges.map(e=>[e.id,e]));return t.some(e=>{let t=n.get(e.id);return t===void 0||e.sources[0]!==t.from||e.targets[0]!==t.to})}function NS(e,t,n){return{...SS(e),...t===void 0?{}:{"elk.padding":gce},...n===void 0?{}:{"elk.partitioning.activate":`true`}}}var PS=(e,t)=>(t?.algorithm??`layered`)===`layered`&&AS(e);function FS(e,t,n,r){let i=r?.substitute,a=r?.partitions!==void 0&&r.partitions.size>0?r.partitions:void 0,o=NS(n,i,a),s=PS(e,n),c=s?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{};Object.assign(o,c);let l=cce(n)&&r?.flat!==!0,u={sizes:t,substitute:i,byOwner:l?lce(e):void 0,sharedContainerOptions:l?o:{...vce(o),...c},fromStart:s,emitted:new Set,attachedToContainer:!1,loopRooms:yS(e.edges,n?.direction??`DOWN`,kS),swapsMinimum:Ece(n,l)},d=(i?.roots??e.roots).map(e=>kce(MS(u,e),a)),f=new Set,p=l?u.byOwner?.get(null)??[]:Mce(e,u,f),m=u.attachedToContainer||l&&Nce(e,p);return{graph:{id:Ae,layoutOptions:o,children:d,edges:p},lifted:m,reversed:f}}function IS(e,t){if(e.node.color!==void 0)return e.node.color;let n=t.nodeColors?.get(e.id);if(n!==void 0)return n;let r=t.typeColors;if(r!==void 0)return(e.node.type===void 0?void 0:r[e.node.type])??r[`*`]}function M(e,t){return t.map(t=>e.node.metadata?.[t]).filter(e=>e!=null).map(String)}function LS(e){let t=e.node.comments?.length??0,n=e.node.links?.length??0;return t>0||n>0?{comments:t,links:n}:void 0}function RS(e,t){let n=oa(e.node.threats),r=IS(e,t),i={label:e.node.name,state:e.state,promoted:e.promoted,sharedMembers:e.sharedMembers,hiddenCount:t.hiddenCounts.get(e.id)??0,metaBadges:M(e,t.metaKeys),typeRegistry:t.typeRegistry,icons:t.icons,typeId:e.node.type,icon:e.node.icon,color:r,hue:t.hues===void 0?void 0:Hb(e.node.type,r,t.hues),textColor:e.node.textColor,technology:e.node.technology,rich:e.node.rich,textAlign:e.node.textAlign,fontScale:e.node.fontScale,onToggleExpand:t.onToggleExpand,onEnterNode:e.state===`leaf`?void 0:t.onEnterNode,external:e.external!==void 0,image:e.node.image,shape:e.node.shape,link:e.node.link,columns:e.columns??e.node.columns,quickAdd:t.editing?t.quickAdd:void 0,onSetRole:t.editing?t.onSetRole:void 0,onAddThreat:t.editing?t.onAddThreat:void 0,stylePreset:t.stylePreset,notation:t.notation,threats:n.total>0?n:void 0,annotations:LS(e),chips:t.nodeChips?.get(e.id),...e.node.type===`sm-state`?{behaviors:cS(e.node),composite:e.state!==`leaf`}:{},...e.node.type===`sm-zone`&&ES(e.node)!==void 0?{zoneNote:ES(e.node)}:{}},a=t.regionSeparators?.get(e.id);return a!==void 0&&(i.regionSeparator=a),t.labelEditingId===e.id&&Pce(i,e,t),(e.node.image!==void 0||e.node.shape!==void 0)&&(i.assetBase=t.assetBase,i.libraryBase=t.libraryBase),e.node.link!==void 0&&(i.onOpenLink=t.onOpenLink),t.editing&&zS(i,e,t),i}function Pce(e,t,n){e.labelEditing=!0,e.onLabelCommit=e=>{n.endLabelEdit?.();let r=e?.trim()??``;r!==``&&r!==t.node.name&&n.onRenameNode?.(t.id,r)},e.onRichCommit=e=>{n.endLabelEdit?.(),e!==null&&Me(e).trim()!==``&&n.onSetNodeRich?.(t.id,e)}}function zS(e,t,n){t.node.type===`db-table`&&n.onSetTableColumns!==void 0&&(e.onColumnsChange=e=>{let r=t.node.columns??[];n.onSetTableColumns?.(t.id,ho(r,t.columns??r,e))}),n.onResize!==void 0&&(t.node.image!==void 0&&(e.onResize=n.onResize),n.resizable?.(t.node)===`x`&&(e.resizeAxis=`x`,e.onResize=n.onResize))}function BS(e,t){let n=e.labels??[],r=Ro(e),i=r===void 0?void 0:t?.[r.id];return i===void 0?n:n.map(e=>{let t=i[e.id];return t===void 0?e:{...e,t:t.t,side:t.side}})}function Fce(e){return e.constituents.reduce((e,t)=>{let n=oa(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0})}function Ice(e){let t=e.constituents.reduce((e,t)=>e+(t.comments?.length??0),0);return t>0?{comments:t,links:0}:void 0}function Lce(e,t){let n=Fce(e),r={kind:e.kind,constituentCount:e.constituents.length,kindRegistry:t.kindRegistry,label:e.label,labels:e.labels===void 0?void 0:BS(e,t.labelMoves),tint:e.tint,relStyle:e.style,stylePreset:t.stylePreset,edgeLook:t.edgeLook,notation:t.notation,polarity:e.polarity,delay:e.delay,notationColor:t.edgeColors?.get(e.id),threats:n.total>0?n:void 0,annotations:Ice(e)},i=Ro(e);i!==void 0&&(r.threatRelation=i.id),i?.fromColumn!==void 0&&(r.fromColumn=i.fromColumn),i?.toColumn!==void 0&&(r.toColumn=i.toColumn),i!==void 0&&(t.editing?Rce(r,e,i,t):zce(r,i,t)),e.from===e.to&&(r.selfLoop={direction:t.flowDirection,index:t.selfLoopIndex.get(e.id)??0,labelWidth:kS(e)?.width??0});let a=t.parallelBow.get(e.id);return a!==void 0&&(r.parallelBow=a),t.routing!==void 0&&VS(r,e,t,t.routing),r}function Rce(e,t,n,r){if(e.editableLabels=!0,e.onAddLabel=(e,t,i)=>r.onAddEdgeLabel?.(n.id,e,t,i),e.onEditLabel=(e,t)=>r.onEditEdgeLabel?.(n.id,e,t),e.onMoveLabel=(e,t,i)=>r.onMoveEdgeLabel?.(n.id,e,t,i),r.onAddThreat!==void 0){let t=r.onAddThreat;e.onAddThreat=()=>t({relation:n.id})}No(n,t.from,t.to)&&r.onSetEdgeSide!==void 0&&(e.onSetSide=(e,t)=>r.onSetEdgeSide?.(n.id,e,t),n.id===r.fixedSideRelation&&(e.fixedSideDotsShown=!0)),r.pendingAdd?.edgeId===t.id&&(e.pendingAdd={x:r.pendingAdd.x,y:r.pendingAdd.y},e.onPendingAddConsumed=r.onPendingAddConsumed)}function zce(e,t,n){n.onViewMoveEdgeLabel!==void 0&&(e.movableLabels=!0,e.onMoveLabel=(e,r,i)=>n.onViewMoveEdgeLabel?.(t.id,e,r,i))}function VS(e,t,n,r){let i=n.routes.get(t.id),a=n.laidAt.get(t.from),o=n.laidAt.get(t.to);if(i===void 0||i.length<2||a===void 0||o===void 0)return;e.route=i,e.routeCorner=n.edgeLook?.corner??r.corner,e.routeFrom=a,e.routeTo=o;let s=n.labelSpots.get(t.id);s!==void 0&&(e.labelSpot=s)}var HS=new WeakMap,US=new WeakMap,WS=`metaKeys.hiddenCounts.typeRegistry.icons.typeColors.onOpenLink.onToggleExpand.onEnterNode.editing.labelEditingId.endLabelEdit.onRenameNode.onSetNodeRich.assetBase.libraryBase.onResize.onSetTableColumns.quickAdd.onSetRole.onAddThreat.stylePreset.notation.nodeColors.hues.nodeChips.resizable.regionSeparators`.split(`.`),Bce=[`kindRegistry`,`editing`,`onAddEdgeLabel`,`onEditEdgeLabel`,`onMoveEdgeLabel`,`onSetEdgeSide`,`onAddThreat`,`fixedSideRelation`,`pendingAdd`,`onPendingAddConsumed`,`stylePreset`,`edgeLook`,`notation`,`routing`,`routes`,`laidAt`,`labelSpots`,`labelMoves`,`onViewMoveEdgeLabel`,`edgeColors`,`flowDirection`,`selfLoopIndex`,`parallelBow`],Vce=e=>(t,n)=>e.every(e=>t[e]===n[e]),Hce=Vce(WS),GS=Vce(Bce);function KS(e,t){let n=HS.get(e);if(n!==void 0&&Hce(n.ctx,t))return n.data;let r=RS(e,t);return HS.set(e,{ctx:t,data:r}),r}function qS(e,t){let n=US.get(e);if(n!==void 0&&GS(n.ctx,t))return n.data;let r=Lce(e,t);return US.set(e,{ctx:t,data:r}),r}var JS=[`layers`,`kinds`,`marks`],YS=new Set([`bar`,`start-dot`,`end-bullseye`]);function XS(e,t){let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>{let r=n.get(e),i=n.get(t);return r!==void 0&&i!==void 0?r-i:r===void 0?i===void 0?e.localeCompare(t):1:-1})}function Uce(e){let t=e.model,n=Ln(t,e.plane?.id),r=e.plane?.id??t.planes[0]?.id,i=e=>mt(e,r);if(e.root!==void 0&&n.childrenOf.has(e.root)){let{model:r}=Bo(t,n,e.root);return{nodes:r.nodes,relations:r.relations.filter(i)}}let a=new Set(n.childrenOf.keys());return{nodes:t.nodes.filter(e=>a.has(e.id)),relations:t.relations.filter(e=>i(e)&&a.has(e.from)&&a.has(e.to))}}function Wce(e){let{nodes:t,relations:n}=Uce(e),r=new Set;for(let e of t){e.layer!==void 0&&r.add(e.layer);for(let t of e.columns??[])t.layer!==void 0&&r.add(t.layer)}for(let t of n){let n=Do(e.model,t);n!==void 0&&r.add(n)}return r}function Gce(e){let t=Wce(e),n=new Set(e.activeLayers??e.plane?.layers??[]),r=[];for(let i of e.model.layers){if(!t.has(i.id))continue;let a=n.has(i.id);!a&&!e.canToggleLayers||r.push({id:`layers:${i.id}`,section:`layers`,label:i.name,swatch:{draw:`chip`,color:i.tint??`var(--dg-edge)`},layer:i.id,active:a})}return r}function ZS(e){let t=new Map,n=[];for(let r of e.compiled.edges)t.has(r.kind)?t.get(r.kind)!==r.tint&&t.set(r.kind,void 0):(n.push(r.kind),t.set(r.kind,r.tint));return XS(n,Object.keys(Ys)).map(n=>{let r=t.get(n),i=e.kindRegistry.resolve(n);return{id:`kinds:${n}`,section:`kinds`,label:i.legendLabel??n,swatch:{draw:`line`,style:i,color:r},vocabulary:i.legendLabel!==void 0||void 0}})}function Kce(e){let t=new Map,n={nodeColors:e.nodeColors,typeColors:e.model.typeColors},r=e=>{for(let i of e){let e=i.node.type;if(e!==void 0){let r=IS(i,n);t.has(e)?t.get(e)!==r&&t.set(e,void 0):t.set(e,r)}r(i.children)}};return r(e.compiled.roots),XS([...t.keys()],Object.keys(Js)).map(n=>{let r=e.typeRegistry.resolve(n),i=YS.has(r.shape)?void 0:e.hues===void 0?t.get(n):Hb(n,t.get(n),e.hues),a=r.label;return{id:`types:${n}`,section:`types`,label:r.legendLabel??(a===void 0||a===``?n:a),swatch:{draw:`shape`,style:r,color:i,icon:r.icon},vocabulary:r.legendLabel!==void 0||void 0}})}function qce(e){let t=new Set,n=e=>{e.total!==0&&t.add(e.open>0?`threat-open`:`threat-handled`)},r=e=>{for(let i of e){n(oa(i.node.threats));for(let e of i.columns??i.node.columns??[])e.pk===!0?t.add(`pk`):e.fk===!0&&t.add(`fk`);r(i.children)}};r(e.compiled.roots);for(let t of e.compiled.edges)n(t.constituents.reduce((e,t)=>{let n=oa(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0}));let i={"threat-open":`Open threats`,"threat-handled":`All threats handled`,pk:`Primary key`,fk:`Foreign key column`};return Object.keys(i).filter(e=>t.has(e)).map(e=>({id:`marks:${e}`,section:`marks`,label:i[e],swatch:{draw:`mark`,mark:e},vocabulary:!0}))}function Jce(e){let t=new Set,n=e=>{for(let r of e){let{type:e,stateKind:i,color:a}=r.node;e===`sm-state`&&i!==void 0&&a===void 0&&t.add(i),n(r.children)}};n(e.compiled.roots);let r=e.typeRegistry.resolve(fn);return ie.filter(e=>t.has(e)).map(e=>({id:`marks:state-${e}`,section:`marks`,label:$c[e],swatch:{draw:`shape`,style:r,color:Qc[e]},vocabulary:!0}))}function Yce(e,t){if(e.kind!==void 0)return{draw:`line`,style:t.kindRegistry.resolve(e.kind),color:e.color};if(e.type!==void 0){let n=t.typeRegistry.resolve(e.type),r=e.icon??n.icon;return{draw:`shape`,style:n,color:e.color,icon:r}}if(e.color!==void 0)return{draw:`chip`,color:e.color}}function Xce(e){return e.drawings===void 0?[]:[{id:`layers:$drawings`,section:`layers`,label:`Drawings`,swatch:{draw:`line`,style:{width:2.5},color:`var(--dg-ink)`},drawings:!0,active:e.drawings.active}]}function Zce(e){let t=e.config.show??JS,n=t.includes(`types`)?Kce(e):e.config.show===void 0?Kce(e).filter(e=>e.vocabulary===!0):[],r=[...t.includes(`layers`)?[...Gce(e),...Xce(e)]:[],...t.includes(`kinds`)?ZS(e):[],...n,...t.includes(`marks`)?[...Jce(e),...qce(e)]:[]],i=[];return(e.config.items??[]).forEach((t,n)=>{let a=t.kind===void 0?t.type===void 0?void 0:`types:${t.type}`:`kinds:${t.kind}`,o=a===void 0?void 0:r.find(e=>e.id===a);if(o!==void 0){o.label=t.label,t.color!==void 0&&(o.swatch?.draw===`line`||o.swatch?.draw===`shape`)&&(o.swatch={...o.swatch,color:t.color}),t.icon!==void 0&&o.swatch!==void 0&&o.swatch.draw===`shape`&&(o.swatch={...o.swatch,icon:t.icon});return}let s=Yce(t,e);i.push({id:`items:${n}`,section:`items`,label:t.label,swatch:s})}),[...r,...i]}var Qce={};function $ce(e){let[t,n]=(0,v.useState)(e.model.legend!==void 0),[r,i]=(0,v.useState)(null),a=e.model.legend;(0,v.useEffect)(()=>{n(a!==void 0)},[e.model.id,a]);let o=(0,v.useMemo)(()=>ut(e.model.planes,e.plane),[e.model.planes,e.plane]),s=(0,v.useMemo)(()=>{let t=Zce({model:e.model,compiled:e.compiled,plane:o,root:e.drillRoot,activeLayers:e.activeLayers,nodeColors:e.nodeColors,hues:e.hues,typeRegistry:e.typeRegistry,kindRegistry:e.kindRegistry,config:a??Qce,canToggleLayers:e.canToggleLayers,drawings:e.strokes.length>0?{active:e.drawingsVisible}:void 0});return a!==void 0||t.some(e=>e.vocabulary===!0)?t:[]},[a,e.model,e.compiled,o,e.drillRoot,e.activeLayers,e.typeRegistry,e.kindRegistry,e.canToggleLayers,e.strokes,e.drawingsVisible,e.nodeColors,e.hues]),c=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=a?.position??`bottom-right`;c.current=!t||r===null||s.length===0?null:{side:e.startsWith(`top`)?`top`:`bottom`,px:r.height+16}},[t,r,s,a]),{legendConfig:a,showLegend:t,setShowLegend:n,setLegendSize:i,legendRowList:s,legendReserveRef:c}}function QS(e){let t;for(let n of e){if(n===void 0)return;if(t===void 0)t=n;else if(t!==n)return}return t}function $S(e){let t=new Map;for(let n of e){let e=`${n.from}\0${n.to}`,r=t.get(e);if(r===void 0){t.set(e,{from:n.from,to:n.to,polarity:n.polarity,edgeIds:[n.id]});continue}r.edgeIds.push(n.id),r.polarity=QS([r.polarity,n.polarity])}return t}function eC(e){let t=0;for(let n of e){if(n.polarity===void 0)return`unknown`;n.polarity===`-`&&t++}return t%2==0?`R`:`B`}function tC(e,t){return{key:e.join(`→`),nodes:[...e],edgeIds:t.flatMap(e=>e.edgeIds),kind:eC(t)}}var nC=(e,t)=>e<t?-1:+(e>t);function rC(e,t){let n=t?.maxLength??20,r=t?.maxLoops??50,i=t?.budget??2e5,a=[...$S(e).values()],o=new Set;for(let e of a)o.add(e.from),o.add(e.to);let s=[...o].sort(nC),c=new Map(s.map((e,t)=>[e,t])),l=s.length,u=Array.from({length:l},()=>[]),d=[];for(let e of a){if(e.from===e.to){d.push(e);continue}let t=c.get(e.from),n=c.get(e.to);t===void 0||n===void 0||u[t]?.push({to:n,arc:e})}for(let e of u)e.sort((e,t)=>e.to-t.to);d.sort((e,t)=>nC(e.from,t.from));let f=[],p=0,m=!1;for(let e of d)f.push(tC([e.from],[e]));let h=[],g=[],_=new Set;function v(e,t){if(m)return;let r=u[t];if(r!==void 0)for(let{to:t,arc:a}of r){if(p>=i){m=!0;return}if(p++,t===e){h.length>=2&&f.push(tC(h,[...g,a]));continue}if(t>e&&!_.has(t)&&h.length<n){let n=s[t];if(n===void 0)continue;if(_.add(t),h.push(n),g.push(a),v(e,t),g.pop(),h.pop(),_.delete(t),m)return}}}for(let e=0;e<l&&!m;e++){let t=s[e];t!==void 0&&(h.length=0,g.length=0,_.clear(),h.push(t),_.add(e),v(e,e))}return f.sort((e,t)=>e.nodes.length-t.nodes.length||nC(e.key,t.key)),{loops:f.slice(0,r),truncated:m||f.length>r}}var iC=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),ele=6;function aC(e,t,n){let r=[{x:e,y:t}],i=Math.max(24,n);for(let n=1;n<=ele;n++){let a=n*i,o=Math.max(4,Math.floor(2*Math.PI*a/i));for(let n=0;n<o;n++){let i=-Math.PI/2+2*Math.PI*n/o;r.push({x:e+Math.cos(i)*a,y:t+Math.sin(i)*a})}}return r}function oC(e,t,n){let r=Math.max(n.x,Math.min(e.x,n.x+n.width)),i=Math.max(n.y,Math.min(e.y,n.y+n.height)),a=e.x-r,o=e.y-i;return a*a+o*o<t*t}var tle=1e-6;function sC(e){if(e.length<3)return`none`;let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];r===void 0||i===void 0||(t+=r.x*i.y-i.x*r.y)}return t/=2,Math.abs(t)<tle?`none`:t>0?`cw`:`ccw`}function nle(e,t,n){let r=n?.labelRadius??15,i=n?.minLabelGap??36,a=n?.nodeMargin??8,o=n?.obstacles??[...t.values()],s=r+a,c=i*i,l=[...e.filter(e=>e.nodes.every(e=>t.has(e)))].sort((e,t)=>e.nodes.length-t.nodes.length||nC(e.key,t.key)),u=[],d=[];for(let e of l){let n=e.nodes.map(e=>t.get(e)).filter(e=>e!==void 0).map(iC);if(n.length===0)continue;let r=n.reduce((e,t)=>e+t.x,0)/n.length,a=n.reduce((e,t)=>e+t.y,0)/n.length,l=sC(n),f={x:r,y:a};for(let e of aC(r,a,i))if(!o.some(t=>oC(e,s,t))&&!d.some(t=>{let n=t.x-e.x,r=t.y-e.y;return n*n+r*r<c})){f=e;break}d.push(f),u.push({key:e.key,kind:e.kind,x:f.x,y:f.y,direction:l})}return u}function cC(e){let t=new Map(e.map(e=>[e.id,e])),n=new Set;function r(e){let i=t.get(e);if(i===void 0)return{x:0,y:0};if(i.parentId===void 0||n.has(e))return i.position;n.add(e);let a=r(i.parentId);return n.delete(e),{x:i.position.x+a.x,y:i.position.y+a.y}}let i=new Map;for(let t of e){let e=t.measured?.width,n=t.measured?.height;if(e===void 0||n===void 0)continue;let a=r(t.id);i.set(t.id,{x:a.x,y:a.y,width:e,height:n})}return i}function lC(e){let t=e.profile.canvasOverlay===`loop-labels`,n=(0,v.useMemo)(()=>t?e.compiled.edges.map(e=>{let t=QS(e.constituents.map(e=>e.polarity));return{id:e.id,from:e.from,to:e.to,polarity:t}}):null,[e.compiled,t]),{onCldEdges:r}=e;(0,v.useEffect)(()=>{r?.(n??[])},[n,r]);let[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(null),f=e.externalHighlight,{profile:p,model:m,plane:h}=e,g=(0,v.useMemo)(()=>{if(!c||o===null)return null;let t=new Set([o]),n=new Set;for(let r of e.compiled.edges)r.from===o?(t.add(r.to),n.add(r.id)):r.to===o&&(t.add(r.from),n.add(r.id));for(let e of p.related?.(m,h,o)??[])t.add(e);return{nodes:t,edges:n}},[c,o,e.compiled.edges,p,m,h]),_=(0,v.useMemo)(()=>{let e=f==null?u===null?null:{nodes:u.nodes,edges:u.edges}:{nodes:new Set(f.nodes),edges:new Set(f.edges)},t=e??g;return{nodes:t?.nodes??uv,edges:t?.edges??uv,active:t!==null,variant:e===null?`focus`:`loop`,activeKey:u?.key??null,focusId:o,toggle:(e,t,n)=>d(r=>r?.key===e?null:{key:e,nodes:new Set(t),edges:new Set(n)}),clear:()=>d(null)}},[u,f,g,o]);return(0,v.useEffect)(()=>{d(null),s(null)},[e.compiled]),{cld:t,loopEdges:n,showLoops:i,setShowLoops:a,selectedNode:o,setSelectedNode:s,focusConnected:c,setFocusConnected:l,loopHighlight:_}}var rle=8,uC=14,dC=`stroke='black' stroke-width='1.4' fill='none' stroke-linecap='round'`,ile={plus:`<rect x='1.5' y='6.25' width='5' height='1.5'/><rect x='3.25' y='4.5' width='1.5' height='5'/>`,dash:`<rect x='1.5' y='6.25' width='5' height='1.5'/>`,equals:`<rect x='1.5' y='4.8' width='5' height='1.3'/><rect x='1.5' y='7.9' width='5' height='1.3'/>`,pipe:`<rect x='3.25' y='1' width='1.5' height='12'/>`,colon:`<circle cx='4' cy='4.5' r='1'/><circle cx='4' cy='9.5' r='1'/>`,dot:`<circle cx='4' cy='7' r='1'/>`,baseDot:`<circle cx='4' cy='10' r='1.05'/>`,tick:`<rect x='3.35' y='2.5' width='1.3' height='4'/>`,slash:`<path d='M1.8 12 L6.2 2' ${dC}/>`,backslash:`<path d='M1.8 2 L6.2 12' ${dC}/>`,openParen:`<path d='M5.6 1.5 Q1.6 7 5.6 12.5' ${dC}/>`,closeParen:`<path d='M2.4 1.5 Q6.4 7 2.4 12.5' ${dC}/>`},fC=[[0,0],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1]];function pC(e){let t=e.map((e,t)=>{let[n,r]=fC[t];return`<g transform='translate(${n*rle} ${r*uC})'>${ile[e]}</g>`});return`url("data:image/svg+xml,${`<svg xmlns='http://www.w3.org/2000/svg' width='${3*rle}' height='${3*uC}'>${t.join(``)}</svg>`.replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/#/g,`%23`)}")`}function ale(){return{"--dg-ascii-box":pC([`plus`,`dash`,`plus`,`pipe`,`plus`,`dash`,`plus`,`pipe`]),"--dg-ascii-table":pC([`plus`,`equals`,`plus`,`pipe`,`plus`,`equals`,`plus`,`pipe`]),"--dg-ascii-hex":pC([`slash`,`dash`,`backslash`,`pipe`,`slash`,`dash`,`backslash`,`pipe`]),"--dg-ascii-pill":pC([`baseDot`,`dash`,`baseDot`,`closeParen`,`tick`,`dash`,`tick`,`openParen`]),"--dg-ascii-group":pC([`dot`,`dot`,`dot`,`colon`,`dot`,`dot`,`dot`,`colon`])}}var mC={id:`clean`,label:`Clean`},ole={id:`sketch`,label:`Sketch`,rough:{roughness:1.15,bowing:1,strokeWidth:1.5,fillStyle:`solid`},fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:14,stroke:100}},sle={id:`hand-drawn`,label:`Hand-drawn`,rough:{roughness:.9,bowing:.8,strokeWidth:1.2,fillStyle:`hachure`,fillWeight:.8,hachureGap:5,hatchOpacity:.45},cornerRadius:14,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},hC={id:`blueprint`,label:`Blueprint`,fontFamily:`ui-monospace, 'Cascadia Mono', 'Source Code Pro', monospace`,cssVars:{"--dg-canvas-bg":`#0d2740`,"--dg-surface":`#0d2740`,"--dg-node-fill":`#103052`,"--dg-node-stroke":`#9ec8e8`,"--dg-group-fill":`#0f2c4a`,"--dg-group-stroke":`#5f8ab0`,"--dg-text":`#e4f1fb`,"--dg-text-muted":`#8fb3cf`,"--dg-border":`#2a4a6b`,"--dg-edge":`#9ec8e8`,"--dg-edge-label-bg":`#103052`}},cle={id:`pencil`,label:`Pencil`,rough:{roughness:.3,bowing:.1,strokeWidth:1.4,fillStyle:`hachure`,fillWeight:.55,hachureGap:5,hatchOpacity:.5},cornerRadius:16,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},lle={id:`marker`,label:`Marker`,rough:{roughness:1.6,bowing:1.2,strokeWidth:2.5,fillStyle:`zigzag`,fillWeight:1.8,hachureGap:7,hatchOpacity:.25},cornerRadius:8,fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:28,stroke:100}},gC=`'diagc Inter', 'Inter', system-ui, sans-serif`,_C=`'diagc JetBrains Mono', 'JetBrains Mono', ui-monospace, monospace`,vC=[`#3b82f6`,`#f59e0b`,`#10b981`,`#8b5cf6`,`#f43f5e`,`#06b6d4`,`#84cc16`,`#d946ef`],yC=e=>`color-mix(in srgb, var(--dg-text) ${e}%, var(--dg-bg))`,ule={id:`soft`,label:`Soft`,fontFamily:gC,cssVars:{"--dg-edge":yC(38)}},dle=C(x),bC=[mC,ole,sle,cle,hC,lle,ule,{id:`pastel`,label:`Pastel`,fontFamily:gC,palette:vC,cssVars:{"--dg-edge":yC(38)}},{id:`cards`,label:`Cards`,fontFamily:gC,palette:vC,cssVars:{"--dg-edge":yC(40)}},{id:`layered`,label:`Layered`,fontFamily:gC,grid:`none`,cssVars:{"--dg-canvas-bg":`color-mix(in srgb, #3b82f6 3%, var(--dg-bg))`,"--dg-edge":`color-mix(in srgb, #64748b 75%, var(--dg-text))`}},{id:`neon`,label:`Neon`,fontFamily:`'diagc Chakra Petch', 'Chakra Petch', system-ui, sans-serif`,palette:[`#00e5ff`,`#ff2bd6`,`#f2ff3d`,`#5cff7a`,`#ff9d2b`,`#b18cff`,`#ff4d6d`],grid:`lines`,cssVars:{...dle,"--dg-canvas-bg":`#07080f`,"--dg-bg":`#07080f`,"--dg-surface":`#0b0d17`,"--dg-node-fill":`#0b0d17`,"--dg-node-stroke":`#00e5ff`,"--dg-group-fill":`rgba(255, 43, 214, 0.035)`,"--dg-group-stroke":`#ff2bd6`,"--dg-text":`#e8f9ff`,"--dg-text-muted":`#86a4bb`,"--dg-border":`#1f2a3d`,"--dg-edge":`#22d3ee`,"--dg-edge-label-bg":`#07080f`,"--dg-accent":`#00e5ff`,"--dg-badge-bg":`#ff2bd6`,"--dg-badge-text":`#07080f`,"--dg-ink":`#e8f9ff`,"--dg-table-header-bg":`#111a2e`,"--dg-table-header-text":`#e8f9ff`,"--dg-table-border":`#22d3ee`,"--dg-table-row-text":`#c6e6f2`,"--dg-table-type-text":`#86a4bb`,"--dg-table-pk":`#f2ff3d`,"--dg-table-fk":`#ff79e6`}},{id:`terminal`,label:`Terminal`,fontFamily:_C,palette:[`#39ff88`,`#5ef2ff`,`#ffb000`,`#ff79c6`,`#bd93f9`,`#ff5555`,`#f1fa8c`],grid:`none`,cssVars:{...dle,"--dg-canvas-bg":`#050805`,"--dg-bg":`#050805`,"--dg-surface":`#0a110b`,"--dg-node-fill":`#0a110b`,"--dg-node-stroke":`#39ff88`,"--dg-group-fill":`rgba(255, 176, 0, 0.03)`,"--dg-group-stroke":`#ffb000`,"--dg-text":`#d4ffe2`,"--dg-text-muted":`#6fbf8a`,"--dg-border":`#1d3a24`,"--dg-edge":`#2fd16f`,"--dg-edge-label-bg":`#050805`,"--dg-accent":`#39ff88`,"--dg-badge-bg":`#39ff88`,"--dg-badge-text":`#050805`,"--dg-ink":`#d4ffe2`,"--dg-table-header-bg":`#0f2414`,"--dg-table-header-text":`#d4ffe2`,"--dg-table-border":`#2fd16f`,"--dg-table-row-text":`#b9f5cb`,"--dg-table-type-text":`#6fbf8a`,"--dg-table-pk":`#ffb000`,"--dg-table-fk":`#5ef2ff`}},{id:`ascii`,label:`ASCII`,fontFamily:_C,palette:vC,grid:`none`,edges:{corner:0,dash:{solid:`5 3`,dashed:`5 11`},openArrow:!0},cssVars:{"--dg-canvas-bg":`var(--dg-bg)`,"--dg-edge":yC(62),...ale()}},{id:`dos`,label:`DOS`,fontFamily:_C,palette:[`#aaaaaa`,`#00aaaa`,`#00aa00`,`#55ffff`,`#ffff55`,`#55ff55`,`#ff55ff`,`#ff5555`],grid:`none`,edges:{corner:0},cssVars:{...dle,"--dg-canvas-bg":`#0000aa`,"--dg-bg":`#0000aa`,"--dg-surface":`#0000aa`,"--dg-node-fill":`#aaaaaa`,"--dg-node-stroke":`#ffffff`,"--dg-group-fill":`transparent`,"--dg-group-stroke":`#ffffff`,"--dg-text":`#ffffff`,"--dg-text-muted":`#55ffff`,"--dg-border":`#5555ff`,"--dg-edge":`#ffffff`,"--dg-edge-label-bg":`#0000aa`,"--dg-accent":`#ffff55`,"--dg-badge-bg":`#ffff55`,"--dg-badge-text":`#000000`,"--dg-ink":`#ffffff`,"--dg-table-header-bg":`#00aaaa`,"--dg-table-header-text":`#000000`,"--dg-table-border":`#ffffff`,"--dg-table-row-text":`#000000`,"--dg-table-type-text":`#0000aa`,"--dg-table-pk":`#000000`,"--dg-table-fk":`#0000aa`}}],fle=e=>bC.find(t=>t.id===e)??mC,xC=e=>bC.some(t=>t.id===e);function ple(e){return[`dg-canvas`,e.chromeless&&`dg-no-chrome`,e.editing&&`dg-mode-edit`,!e.editing&&e.altHeld&&`dg-alt-move`,e.dragging&&`dg-dragging`,e.preset.id!==`clean`&&`dg-style-${e.preset.id}`,e.preset.rough!==void 0&&`dg-style-rough`,e.preset.fontFamily!==void 0&&`dg-style-font`,e.notationClass,e.penActive&&`dg-tool-pen`,e.eraserActive&&`dg-tool-eraser`,e.laserOn&&`dg-tool-laser`].filter(e=>typeof e==`string`).join(` `)}function mle(e){return{width:`100%`,height:`100%`,"--dg-style-font":e.fontFamily,...e.cssVars??{}}}function SC(e,t){return t===void 0?e.grid===`none`?null:e.grid===`lines`?{variant:g_.Lines,gap:32}:{}:{gap:t,className:`dg-grid-on`}}var CC=([,e])=>()=>e(e=>!e);function hle(e){let{dim:t,laser:n,drawings:r,legend:i,loops:a}=e;return[{key:`dim`,on:t[0],offered:!0,flip:CC(t),className:`dg-focus-toggle${t[0]?``:` dg-focus-toggle-off`}`,title:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,label:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,glyph:`◎`},{key:`laser`,on:n[0],offered:!0,flip:CC(n),className:`dg-laser-toggle${n[0]?` dg-laser-toggle-on`:``}`,title:n[0]?`Laser pointer off`:`Laser pointer`,label:`Laser pointer`,glyph:`◉`},{key:`drawings`,on:r[0],offered:e.drawingsOffered,flip:CC(r),className:`dg-drawings-toggle${r[0]?``:` dg-drawings-toggle-off`}`,title:r[0]?`Hide drawings`:`Show drawings`,label:r[0]?`Hide drawings`:`Show drawings`,glyph:`✎`},{key:`legend`,on:i[0],offered:e.legendOffered,flip:CC(i),className:`dg-legend-toggle-btn${i[0]?``:` dg-legend-toggle-btn-off`}`,title:i[0]?`Hide legend`:`Show legend`,label:i[0]?`Hide legend`:`Show legend`,glyph:`▤`},{key:`loops`,on:a[0],offered:e.loopsOffered,flip:()=>{a[0]&&e.clearLoopHighlight(),a[1](e=>!e)},className:`dg-loop-toggle${a[0]?``:` dg-loop-toggle-off`}`,title:a[0]?`Hide loop badges`:`Show loop badges`,label:a[0]?`Hide loop badges`:`Show loop badges`,glyph:`↻`}]}var wC=(e,t)=>e.find(e=>e.key===t);function TC(e){let t=t=>{let n=e.keyHints?.[t]??(t===`laser`&&e.builtinKeys!==!1?`L`:void 0);return n!==void 0&&n!==``?` (${n})`:``};return(0,D.jsxs)(E_,{children:[e.toggles.filter(e=>e.offered).map(e=>(0,D.jsx)(C_,{className:e.className,title:`${e.title}${t(e.key)}`,"aria-label":e.label,"aria-pressed":e.on,onClick:e.flip,children:e.glyph},e.key)),e.onToggleTheme!==void 0&&(0,D.jsx)(C_,{className:`dg-theme-toggle`,title:e.colorMode===`dark`?`Light theme`:`Dark theme`,"aria-label":e.colorMode===`dark`?`Switch to light theme`:`Switch to dark theme`,onClick:e.onToggleTheme,children:e.colorMode===`dark`?`☀`:`☾`})]})}var EC=48,DC=EC/2,OC=15,kC=`M ${DC} ${DC-OC} A ${OC} ${OC} 0 1 1 ${DC-OC} ${DC}`;function AC({placement:e,rough:t,active:n,dimmed:r,onSelect:i}){let a=(0,v.useMemo)(()=>t===void 0?null:Poe({x:DC,y:DC},OC*2,{style:t,seed:ab(e.key)}),[e.key,t]),o=e.kind===`unknown`?`?`:e.kind,s=e.kind!==`unknown`&&e.direction!==`none`,c=`dg-loop-arrow-${e.key.replace(/[^a-zA-Z0-9_-]/g,`_`)}`;return(0,D.jsx)(`div`,{className:`dg-loop-badge${n?` active`:``}${r?` dimmed`:``}`,"data-kind":e.kind,role:`button`,"aria-pressed":n,title:`Highlight this loop`,onClick:e=>{e.stopPropagation(),i?.()},style:{position:`absolute`,transform:`translate(${e.x-DC}px, ${e.y-DC}px)`,pointerEvents:`auto`},children:(0,D.jsxs)(`svg`,{width:EC,height:EC,viewBox:`0 0 ${EC} ${EC}`,"aria-hidden":`true`,children:[s&&(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:c,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--dg-text-muted)`})})}),a===null?(0,D.jsx)(`circle`,{className:`dg-loop-badge-circle`,cx:DC,cy:DC,r:OC}):(0,D.jsxs)(D.Fragment,{children:[a.fill===``?(0,D.jsx)(`circle`,{className:`dg-loop-badge-fill`,cx:DC,cy:DC,r:OC}):(0,D.jsx)(`path`,{className:`dg-loop-badge-fill`,d:a.fill}),(0,D.jsx)(`path`,{className:`dg-loop-badge-circle`,d:a.stroke})]}),s&&(0,D.jsx)(`path`,{className:`dg-loop-badge-arc`,d:kC,markerEnd:`url(#${c})`,style:e.direction===`ccw`?{transform:`scale(-1,1)`,transformOrigin:`${DC}px ${DC}px`}:void 0}),(0,D.jsx)(`text`,{x:DC,y:DC,textAnchor:`middle`,dominantBaseline:`central`,children:o})]})})}function gle({edges:e,rough:t,nodeFilter:n}){let{loops:r}=(0,v.useMemo)(()=>rC(e),[e]),i=(0,v.useMemo)(()=>n==null?r:r.filter(e=>e.nodes.includes(n)),[r,n]),a=(0,v.useMemo)(()=>new Map(i.map(e=>[e.key,e])),[i]),o=(0,v.useContext)(fv),s=f_(),c=(0,v.useMemo)(()=>cC(s),[s]),l=(0,v.useMemo)(()=>s.filter(e=>e.data.state!==`expanded`).map(e=>c.get(e.id)).filter(e=>e!==void 0),[s,c]);return(0,D.jsx)(u_,{children:(0,D.jsx)(`div`,{className:`dg-loop-layer`,children:(0,v.useMemo)(()=>nle(i,c,{obstacles:l,labelRadius:DC,minLabelGap:56}),[i,c,l]).map(e=>{let n=a.get(e.key);return(0,D.jsx)(AC,{placement:e,rough:t,active:o.activeKey===e.key,dimmed:o.active&&o.activeKey!==e.key,onSelect:n===void 0?void 0:()=>o.toggle(e.key,n.nodes,n.edgeIds)},e.key)})})})}var _le=4;function vle({model:e,plane:t}){let n=f_(),r=(0,v.useMemo)(()=>cC(n),[n]);return(0,D.jsx)(u_,{children:(0,D.jsx)(`svg`,{className:`dg-git-lanes`,"aria-hidden":`true`,children:(0,v.useMemo)(()=>{let n=Ac(e,t),i=Mc(e,t),{MARGIN:a,LABEL_W:o}=Dc,s=[];for(let t of n.lanes){let c=Xn(n,t.id),l=r.get(t.id);if(c===void 0||l===void 0||eee(e,c.id))continue;let u=r.get(c.id);if(u===void 0)continue;let d=u.x+u.width+_le,f=l.x+l.width-a-o;f<=d||s.push({id:t.id,x1:d,x2:f,y:u.y+u.height/2,color:i.get(t.id)})}return s},[e,t,r]).map(e=>(0,D.jsx)(`line`,{className:`dg-git-tail`,x1:e.x1,y1:e.y,x2:e.x2,y2:e.y,stroke:e.color??`var(--dg-edge)`},e.id))})})}var jC=8,yle=[`th`,`st`,`nd`,`rd`];function MC(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:yle[e%10]??`th`}`}var NC=(e,t)=>e===0?t>1?`Decisions`:`Decision`:`${MC(e)} order`;function PC(e,t,n){let r=n===`DOWN`||n===`UP`,i=new Map,a=1/0,o=-1/0;for(let[n,s]of t){let t=e.get(n);if(t===void 0)continue;let c=r?t.y:t.x,l=r?t.y+t.height:t.x+t.width,u=i.get(s);i.set(s,u===void 0?{lo:c,hi:l}:{lo:Math.min(u.lo,c),hi:Math.max(u.hi,l)}),a=Math.min(a,r?t.x:t.y),o=Math.max(o,r?t.x+t.width:t.y+t.height)}let s=a-20-(r?96:28),c=o+20-s;return[...i.entries()].sort(([e],[t])=>e-t).map(([e,{lo:t,hi:n}])=>{let i=t-20,a=n-t+40,o=r?{x:s,y:i,width:c,height:a}:{x:i,y:s,width:a,height:c};return{order:e,...o,header:{x:o.x+jC,y:o.y+jC}}})}function FC({model:e,direction:t}){let n=f_(),r=(0,v.useMemo)(()=>ci(e).orders,[e]),i=(0,v.useMemo)(()=>e.nodes.filter(e=>e.type===`so-decision`&&r.get(e.id)===0).length,[e,r]),a=(0,v.useMemo)(()=>PC(cC(n),r,t),[n,r,t]);return a.length===0?null:(0,D.jsx)(u_,{children:(0,D.jsx)(`svg`,{className:`dg-order-bands`,"aria-hidden":`true`,children:a.map((e,t)=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`rect`,{className:`dg-order-band${t%2==1?` dg-order-band-alt`:``}`,x:e.x,y:e.y,width:e.width,height:e.height,rx:6}),(0,D.jsx)(`text`,{className:`dg-order-band-header`,x:e.header.x,y:e.header.y,dominantBaseline:`hanging`,children:NC(e.order,i)})]},e.order))})})}var IC=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],LC=3,RC=e=>((e+4)%7+7)%7,zC=e=>Number(Hr(e).slice(0,4)),BC=e=>Number(Hr(e).slice(5,7))-1,VC=e=>Date.parse(`${e}T00:00:00Z`)/864e5;function HC(e){let t=e+(3-(RC(e)+6)%7),n=zC(t),r=VC(`${String(n)}-01-04`),i=r-(RC(r)+6)%7;return Math.floor((t-i)/7)+1}var UC=e=>{let t=zC(e),n=BC(e);return VC(n===11?`${String(t+1)}-01-01`:`${String(t)}-${String(n+2).padStart(2,`0`)}-01`)};function WC(e,t){let n=e.start-7,r=e.end+8,i=e=>Fs(e,t),a=[];for(let e=n;e<r;e=UC(e)){let t=Math.min(UC(e),r);a.push({x:i(e),width:i(t)-i(e),label:`${IC[BC(e)]} ${String(zC(e))}`})}let o=[];for(let e=n;e<r;){let t=e+((8-RC(e))%7||7),n=Math.min(t,r),a=n-e;o.push({x:i(e),width:a*js.DAY,label:a>=LC?`W${String(HC(e)).padStart(2,`0`)}`:``}),e=n}return{x0:i(n),x1:i(r),months:a,weeks:o}}function ble(e=new Date){let t=e=>String(e).padStart(2,`0`);return`${String(e.getFullYear())}-${t(e.getMonth()+1)}-${t(e.getDate())}`}var GC=js.HEADER_H/2;function xle({model:e,plane:t,today:n}){let r=f_(),i=(0,v.useMemo)(()=>cC(r),[r]),a=Ps(e,t),o=(0,v.useMemo)(()=>a.range!==void 0&&a.origin!==void 0?WC(a.range,a.origin):void 0,[a]);if(o===void 0||a.origin===void 0||a.range===void 0)return null;let{DAY:s,HEADER_H:c,PAD:l}=js,u=a.origin,d=0;for(let e of i.values())d=Math.max(d,e.y+e.height);d+=l;let f=new Map(e.nodes.map(e=>[e.id,e])),p=a.events.filter(e=>!a.parent.has(e)&&Ir(f.get(e))),m=n==null?void 0:Vr(n),h=m!==void 0&&m>=a.range.start-7&&m<a.range.end+8?Fs(m,u)+s/2:void 0;return(0,D.jsx)(u_,{children:(0,D.jsxs)(`svg`,{className:`dg-time-axis`,"aria-hidden":`true`,children:[(0,D.jsx)(`rect`,{className:`dg-time-axis-frame`,x:o.x0,y:-c,width:o.x1-o.x0,height:c}),o.months.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-c,x2:e.x,y2:0}),(0,D.jsx)(`text`,{className:`dg-time-axis-month`,x:e.x+6,y:-c+GC/2,dominantBaseline:`middle`,children:e.label})]},e.x)),o.weeks.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-GC,x2:e.x,y2:0}),(0,D.jsx)(`line`,{className:`dg-time-axis-grid`,x1:e.x,y1:0,x2:e.x,y2:d}),e.label!==``&&(0,D.jsx)(`text`,{className:`dg-time-axis-week`,x:e.x+4,y:-GC/2,dominantBaseline:`middle`,children:e.label})]},e.x)),p.map(e=>{let t=Wr(f.get(e));if(t===void 0)return null;let n=Fs(t,u)+s/2;return(0,D.jsx)(`line`,{className:`dg-time-axis-event`,x1:n,y1:0,x2:n,y2:d},e)}),h!==void 0&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-today`,x1:h,y1:-GC,x2:h,y2:d}),(0,D.jsx)(`text`,{className:`dg-time-axis-today-label`,x:h+4,y:-GC/2,dominantBaseline:`middle`,children:`today`})]})]})})}function Sle(e){return e.placed?(0,D.jsxs)(D.Fragment,{children:[e.loopEdges!==null&&(0,D.jsx)(gle,{edges:e.loopEdges,rough:e.rough,nodeFilter:e.loopNodeFilter}),e.overlay===`git-lanes`&&(0,D.jsx)(vle,{model:e.model,plane:e.plane}),e.overlay===`order-bands`&&(0,D.jsx)(FC,{model:e.model,direction:e.flowDirection}),e.overlay===`time-axis`&&(0,D.jsx)(xle,{model:e.model,plane:e.plane,today:e.today})]}):null}var Cle=()=>typeof document.elementsFromPoint==`function`?document.elementsFromPoint.bind(document):void 0;function wle(e,t=Cle()){if(t===void 0)return null;let{target:n}=e;if(!(n instanceof Element)||n.closest(`.react-flow__edge`)===null)return null;for(let n of t(e.clientX,e.clientY)){if(!(n instanceof HTMLElement)||n.closest(`.react-flow__node`)===null)continue;let e=n.closest(`button, a`);if(e instanceof HTMLElement)return e}return null}function Tle(e){let t=wle(e);return t===null?!1:(e.stopPropagation(),e.preventDefault(),t.click(),!0)}var Ele=(e,t)=>e.map(e=>e.selected===!0==(e.id===t)?e:{...e,selected:e.id===t}),Dle=e=>e.map(e=>e.selected===!0?{...e,selected:!1}:e),KC=(e,t)=>e.map(e=>{let n=e.data.dropTarget===!0,r=e.id===t;return n===r?e:{...e,data:{...e.data,dropTarget:r}}}),Ole=500,qC=40;function kle(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),n=(e,t)=>e!==null&&Date.now()-e.at<Ole&&Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)<qC,r=(e,t,n)=>{e.current={id:t,clientX:n.clientX,clientY:n.clientY,at:Date.now()}};return{recordNodeClick:(t,n)=>r(e,t,n),clearNodeClick:()=>{e.current=null},consumeNodeDrill:(t,r,i)=>{let a=e.current;return a!==null&&a.id===t&&i>=2&&n(a,r)?(e.current=null,!0):!1},takePaneNodeDrill:(t,r)=>{let i=e.current;return i!==null&&r>=2&&n(i,t)?(e.current=null,i.id):null},recordEdgeClick:(e,n)=>r(t,e,n),clearEdgeClick:()=>{t.current=null},consumeEdgeAdd:(e,r)=>{let i=t.current;return i!==null&&i.id===e&&n(i,r)?(t.current=null,!0):!1},takePaneEdgeAdd:e=>{let r=t.current;return r!==null&&n(r,e)?(t.current=null,r.id):null},clearAll:()=>{e.current=null,t.current=null}}}function Ale(e){let{props:t,editing:n,edit:r,reactFlow:i,compiled:a,enterNode:o,setLabelEdit:s}=e,{selectOnAppearRef:c,setFixedSideRelation:l,setAddLabelAt:u,setSelectedNode:d,loopHighlight:f}=e,p=(0,v.useRef)(null),m=kle(),h=(e,t)=>{let n=i.screenToFlowPosition({x:t.clientX,y:t.clientY});u({edgeId:e,x:n.x,y:n.y})},g=(0,v.useRef)(t.onMultiSelect);g.current=t.onMultiSelect;let _=(0,v.useRef)([]),y=(0,v.useCallback)(({nodes:e})=>{let t=e.map(e=>e.id),n=_.current;t.length===n.length&&t.every((e,t)=>e===n[t])||(_.current=t,c.current=null,g.current?.(t))},[]);return{onNodeClick:(r,i)=>{if(l(null),m.clearEdgeClick(),i.type===`note`){m.clearNodeClick(),jle(e,i);return}let s=a.externals?.get(i.id);if(s!==void 0){m.clearNodeClick(),o(s);return}if(!n&&(r.ctrlKey||r.metaKey)&&t.onCompareSelect!==void 0){m.clearNodeClick(),t.onCompareSelect(i.id);return}d(i.id),t.onSelect?.({kind:`node`,id:i.id}),n||r.shiftKey?m.clearNodeClick():m.consumeNodeDrill(i.id,r,r.detail)?o(i.id):m.recordNodeClick(i.id,r)},onNodeDoubleClick:(e,t)=>{n&&t.type!==`note`&&s({kind:`node`,id:t.id})},onReconnectStart:(e,t,n)=>{p.current=n},onReconnect:(t,n)=>Mle(e,p.current,t,n),onReconnectEnd:()=>{p.current=null},onConnect:e=>{e.source!==null&&e.target!==null&&r?.onConnect?.(e.source,e.target,e.sourceHandle,e.targetHandle)},onEdgeClick:(e,r)=>{let i=a.edges.find(e=>e.id===r.id),o=i===void 0?void 0:Ro(i)?.id;l(n&&o!==void 0?o:null),d(null),m.clearNodeClick(),t.onSelect?.({kind:`edge`,id:r.id,constituentIds:i?.constituents.map(e=>e.id)}),n&&o!==void 0?m.consumeEdgeAdd(r.id,e)?h(r.id,e):m.recordEdgeClick(r.id,e):m.clearEdgeClick()},onPaneClick:r=>{if(n){let e=m.takePaneEdgeAdd(r);if(e!==null){h(e,r);return}}let i=n?null:m.takePaneNodeDrill(r,r.detail);if(i!==null){o(i);return}r.detail===2?Nle(e,r):(l(null),m.clearAll(),d(null),t.onSelect?.(null),f.clear())},deleteKeyCode:n&&r?.onDeleteSelection!==void 0?[`Backspace`,`Delete`]:null,onDelete:t=>JC(e,t),onSelectionChange:y}}function jle(e,t){let{props:n,editing:r,compiled:i,setRfNodes:a,setFixedSideRelation:o,setSelectedNode:s}=e,c=t.data.target;if(Rt(c)){s(c.node),a(e=>Ele(e,c.node)),n.onSelect?.({kind:`node`,id:c.node});return}let l=i.edges.find(e=>Ro(e)?.id===c.relation);l!==void 0&&(r&&o(c.relation),s(null),a(Dle),n.onSelect?.({kind:`edge`,id:l.id,constituentIds:[c.relation]}))}function Mle(e,t,n,r){let{editing:i,edit:a,compiled:o}=e;if(!i||r.source===null||r.target===null)return;let s=o.edges.find(e=>e.id===n.id),c=s===void 0?void 0:Ro(s);if(c===void 0)return;let l=noe(t,{source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle},c);a?.onReconnect?.(c.id,r.source,r.target,l)}function Nle(e,t){let{editing:n,edit:r,reactFlow:i,setLabelEdit:a}=e;if(n&&r?.onCreateAt!==void 0){let e=r.onCreateAt(i.screenToFlowPosition({x:t.clientX,y:t.clientY}));typeof e==`string`&&a({kind:`node`,id:e})}else i.fitView({padding:.1,duration:500})}function JC(e,{nodes:t,edges:n}){let r=t.map(e=>e.id),i=n.filter(e=>e.selected===!0).flatMap(t=>e.compiled.edges.find(e=>e.id===t.id)?.constituents.map(e=>e.id)??[]);(r.length>0||i.length>0)&&e.edit?.onDeleteSelection?.({nodeIds:r,relationIds:i})}var YC=e=>()=>e.offered?(e.flip(),!0):!1;function XC(e){let{reactFlow:t,toggles:n}=e,{canArrange:r,selectedIds:i,alignSelection:a,distributeSelection:o}=e.arrange,s={toggleLaser:YC(wC(n,`laser`)),toggleDim:YC(wC(n,`dim`)),toggleLegend:YC(wC(n,`legend`)),toggleDrawings:YC(wC(n,`drawings`)),toggleLoops:YC(wC(n,`loops`)),zoomIn:()=>(t.zoomIn(),!0),zoomOut:()=>(t.zoomOut(),!0),fitView:()=>{let n=e.layoutApiRef?.current;return n==null?t.fitView():n.fitView(),!0},align:e=>!r||i.length<2?!1:(a(e),!0),distribute:e=>!r||i.length<3?!1:(o(e),!0)};return(0,v.useEffect)(()=>{let t=e.canvasCommandsRef;if(t!==void 0)return t.current=s,()=>{t.current=null}}),s}var Ple=new Map,ZC=.5;function QC(e,t,n,r=()=>!1){let i,a,o=t=>(i??e).get(t),s=(t,n)=>{i??=new Map(e),i.set(t,n)},c=e=>{if(e.children.forEach(c),e.state!==`expanded`||r(e))return;let t=o(e.id);if(t===void 0)return;let i=e.children.map(e=>o(e.id)).filter(e=>e!==void 0);if(i.length===0)return;let l=n(e),u=Math.min(...i.map(e=>e.x))-l.left,d=Math.min(...i.map(e=>e.y))-l.top,f=u<-.5?u:0,p=d<-.5?d:0;if(f!==0||p!==0){for(let t of e.children){let e=o(t.id);e!==void 0&&s(t.id,{...e,x:e.x-f,y:e.y-p})}(a??=new Map).set(e.id,{dx:f,dy:p})}let m=(e,t)=>t>e+ZC?t:e,h=m(t.width-f,Math.max(...i.map(e=>e.x+e.width))-f+l.right),g=m(t.height-p,Math.max(...i.map(e=>e.y+e.height))-p+l.bottom);(f!==0||p!==0||h!==t.width||g!==t.height)&&s(e.id,{...t,x:t.x+f,y:t.y+p,width:h,height:g})};return t.forEach(c),{geometry:i??e,shifts:a??Ple}}function $C(e,t,n,r){return{x:e.x+(t.x-n.x)-(r?.dx??0),y:e.y+(t.y-n.y)-(r?.dy??0)}}var Fle={x:0,y:0};function Ile(e,t,{bases:n,shifts:r},i=()=>!1){let a=new Map(t.map(e=>[e.id,e])),o=e=>{let t=e===void 0?void 0:a.get(e);if(t===void 0)return Fle;let n=o(t.parentId);return{x:n.x+t.position.x,y:n.y+t.position.y}},s={};for(let[t,c]of Object.entries(e)){let e=a.get(t)?.parentId,l=o(e),u=$C(c,l,(e===void 0?void 0:n.get(e))??l,r.get(t));s[t]=e!==void 0&&i(e)?{x:Math.max(0,u.x),y:Math.max(0,u.y)}:u}return s}function Lle(e){let{editing:t,edit:n,rfNodesRef:r,containerBasesRef:i,containerShiftsRef:a,arrangedRef:o,setViewPositions:s}=e;return(0,v.useCallback)(e=>{if(Object.keys(e).length===0)return;let c=e=>r.current.find(t=>t.id===e)?.data?.typeId,l=Ile(e,r.current,{bases:i.current,shifts:a.current},e=>De(c(e))),u=o.current,d=Object.fromEntries(Object.entries(l).map(([e,t])=>{let n=u?.get(e);return[e,n===void 0?{dx:0,dy:0}:{dx:t.x-n.x,dy:t.y-n.y}]}));if(t)if(n?.onNodesMoved!==void 0)n.onNodesMoved(l,d);else for(let[e,t]of Object.entries(l))n?.onNodeMoved?.(e,t);else s(e=>({...e,...l}))},[t,n])}function Rle(e,t,n){return t.node?.alwaysExpanded?.(e)===!0||e.type!==void 0&&n.resolve(e.type).alwaysExpanded===!0}function zle(e){let t=(0,v.useMemo)(()=>Nl(e.notation),[e.notation]),n=(0,v.useMemo)(()=>e.typeRegistry??Zs(t.typeStyles),[e.typeRegistry,t]);return{profile:t,typeRegistry:n,kindRegistry:(0,v.useMemo)(()=>e.kindRegistry??Qs(t.kindStyles),[e.kindRegistry,t]),isAlwaysExpanded:(0,v.useCallback)(r=>{let i=e.model.nodes.find(e=>e.id===r);return i!==void 0&&Rle(i,t,n)},[e.model.nodes,t,n]),nodeColors:(0,v.useMemo)(()=>t.node?.colorOf?.(e.model,e.plane),[t,e.model,e.plane]),nodeChips:(0,v.useMemo)(()=>t.node?.chips?.(e.model,e.plane),[t,e.model,e.plane])}}function ew(e){let{props:t,profile:n,typeRegistry:r,focus:i,drillRoot:a,visibleRef:o}=e,s=(0,v.useMemo)(()=>{let e=t.model.nodes.filter(e=>Rle(e,n,r));if(e.length===0)return t.pins;let i={...t.pins??{}};for(let t of e)i[t.id]=`expanded`;return i},[n,t.pins,t.model.nodes,r]),c=(0,v.useMemo)(()=>{let e=Jo(t.model,{focus:a===void 0?i:void 0,pins:s,activeLayers:t.activeLayers,plane:t.plane,root:a}),r=n.edge?.hidden;return r===void 0||!e.edges.some(e=>r(e.kind))?e:{...e,edges:e.edges.filter(e=>!r(e.kind))}},[t.model,t.plane,i,a,s,t.activeLayers,n]),l=(0,v.useRef)(c);return l.current=c,(0,v.useEffect)(()=>{let e=[],t=n=>{e.push(n.id),n.children.forEach(t)};c.roots.forEach(t),o.current=e},[c]),{compiled:c,compiledRef:l}}function Ble(e,t,n=[]){if(!e.has(t))return[];let r=new Set(n),i=[t],a=new Set([t]),o=t;for(;;){let t=e.get(o)??[],n=t.find(e=>r.has(e))??t[0];if(n===void 0||a.has(n))break;i.unshift(n),a.add(n),o=n}return i}function tw(e,t){let n=e.indexOf(t);return n<0?[]:e.slice(0,n+1)}function nw(e,t,n){let r=Ln(e,t),i=new Set;for(let e of n){let t=[...r.parentsOf.get(e)??[]];for(;t.length>0;){let e=t.pop();e===void 0||i.has(e)||(i.add(e),t.push(...r.parentsOf.get(e)??[]))}}return[...i]}function rw(e,t){let n=new Set(t.nodes.map(e=>e.id)),r=e.findIndex(e=>!n.has(e));return r<0?e:e.slice(0,r)}function iw(e,t){let n=t.next;return e.seen.modelId===n.modelId?e.seen.plane===n.plane?e.seen.model===n.model?e.seen.enteredPathProp===n.enteredPathProp?{seen:n,transition:`none`}:{seen:n,transition:`entered-path`}:{seen:n,transition:`model-edit`}:{seen:n,transition:`plane-switch`}:{seen:n,transition:`model-switch`}}function aw(e){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(()=>e.enteredPathProp===void 0?[]:rw(e.enteredPathProp,e.model)),a=(0,v.useRef)([]);a.current=r;let{onEnteredPathChange:o}=e;(0,v.useEffect)(()=>{o?.(r)},[r,o]);let s=(0,v.useRef)(null),c=()=>({modelId:e.model.id,model:e.model,plane:e.plane,enteredPathProp:e.enteredPathProp}),[l,u]=(0,v.useReducer)(iw,void 0,()=>({seen:c(),transition:`none`})),d=r;if(l.seen.modelId===e.model.id?l.seen.plane===e.plane?l.seen.model!==e.model&&(u({type:`sync`,next:c()}),i(t=>rw(t,e.model)),d=rw(r,e.model)):(u({type:`sync`,next:c()}),n(nw(e.model,e.plane,e.visibleRef.current)),i([]),d=[],e.onPlaneSwitch()):(u({type:`sync`,next:c()}),e.visibleRef.current=[],n([]),i([]),d=[],s.current=`jump`),l.seen.enteredPathProp!==e.enteredPathProp&&(u({type:`sync`,next:c()}),e.enteredPathProp!==void 0)){let t=rw(e.enteredPathProp,e.model);(t.length!==d.length||t.some((e,t)=>e!==d[t]))&&(s.current??=`glide`,i(t),n([]))}let f=(0,v.useMemo)(()=>Ln(e.model,e.plane),[e.model,e.plane]),p=r.length>0?r[r.length-1]:void 0,{isAlwaysExpanded:m}=e;return{enteredPath:r,drillRoot:p,focus:t,enterNode:(0,v.useCallback)(e=>{if(m(e)||(f.childrenOf.get(e)?.length??0)===0)return;let t=Ble(f.parentsOf,e,a.current);t.length!==0&&(s.current=`glide`,i(t),n([]))},[f,m]),exitTo:e=>{let t=e===null?[]:tw(r,e);s.current=`glide`,i(t),n([])},pendingRootFitRef:s}}var ow=`note:`,sw=e=>e.startsWith(ow);function cw(e){let{abs:t,obstacles:n}=lw(e.compiled.roots,e.geometry);for(let t of e.compiled.edges){let r=Ro(t),i=r===void 0?void 0:e.badgeSpots.get(r.id);i!==void 0&&n.push(...Tx(i.line))}let r=[...Vle(e.compiled.roots,t,e.typeRegistry),...Hle(e.compiled.edges,t,e.badgeSpots,e.nameOf)],i=[];for(let a of r){let r=Ule(a,e,{abs:t,obstacles:n});r!==void 0&&i.push(r)}return i}function lw(e,t){let n=new Map,r=[],i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c={x:s.x+a,y:s.y+o,width:s.width,height:s.height};n.set(e.id,c),r.push(...wx([{rect:c,kind:e.state===`expanded`?`group`:`box`}])),e.children.forEach(e=>i(e,s.x+a,s.y+o))};return e.forEach(e=>i(e,0,0)),{abs:n,obstacles:r}}function Vle(e,t,n){let r=e=>e.state===`expanded`?`group`:(e.node.type===void 0?void 0:n.resolve(e.node.type).shape)===`ellipse`?`ellipse`:`box`,i=[],a=(e,n)=>{let o=t.get(e.id);o!==void 0&&(e.external===void 0&&tn(e.node)&&i.push({target:{node:e.id},name:e.node.name,threats:e.node.threats??[],comments:e.node.comments??[],links:e.node.links??[],badge:Cx(o,r(e)),element:o,parentId:n}),e.children.forEach(t=>a(t,e.id)))};return e.forEach(e=>a(e)),i}function Hle(e,t,n,r){let i=[];for(let a of e){let e=Ro(a);if(e===void 0||!tn(e))continue;let o=t.get(a.from),s=t.get(a.to);if(o===void 0||s===void 0)continue;let c=n.get(e.id),l=c?.at??{x:(o.x+o.width/2+s.x+s.width/2)/2,y:(o.y+o.height/2+s.y+s.height/2)/2},u=e.label!==void 0&&e.label!==``?` (${e.label})`:``;i.push({target:{relation:e.id},name:`${r.get(e.from)??e.from} → ${r.get(e.to)??e.to}${u}`,threats:e.threats??[],comments:e.comments??[],links:[],badge:l,element:null,away:c?.away})}return i}function Ule(e,t,n){let{target:r,name:i,threats:a,comments:o,links:s,badge:c,element:l,parentId:u,away:d}=e,f=zt(r);if(!t.open.has(f))return;let{editing:p}=t,m=p&&(a.length>0||t.offersThreats),h={width:220,height:Bse({name:i,threats:a,comments:o,links:s},m)},g=t.placements?.[f],_=g!==void 0&&(g.dx!==0||g.dy!==0)?{x:c.x+g.dx,y:c.y+g.dy}:Dx({badge:c,element:l,size:h,away:d},n.obstacles);n.obstacles.push({..._,...h});let v=(u===void 0?void 0:n.abs.get(u))??{x:0,y:0},y={target:r,name:i,threats:a,comments:o,links:s,anchor:{x:c.x-v.x,y:c.y-v.y},badge:c,editing:p,editingId:t.editingRow!==null&&t.editingRow.key===f?t.editingRow.id:void 0,onAddThreat:m?t.onAddThreat:void 0,onRetitleThreat:p?t.onRetitleThreat:void 0,onSetThreatStatus:p?t.onSetThreatStatus:void 0,onEditThreatText:p?t.onEditThreatText:void 0,onOpenLink:t.onOpenLink,onEndEdit:t.onEndEdit};return Hx({id:ow+f,position:{x:_.x-v.x,y:_.y-v.y},data:y,parentId:u,draggable:p})}var Wle=`application/x-dg-library-entry`,Gle=[`framework`,`language`,`tool`],uw=e=>[...e??[]].filter(e=>e.type.startsWith(`image/`)),Kle=e=>document.elementFromPoint(e.clientX,e.clientY)?.closest(`.react-flow__node`)?.getAttribute(`data-id`)??void 0;function dw(e){let{editing:t,edit:n,reactFlow:r,wrapperRef:i}=e,a=n?.onImageFiles;return(0,v.useEffect)(()=>{if(!t||a===void 0)return;let e=e=>{let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`)return;let n=uw(e.clipboardData?.files);if(n.length===0)return;e.preventDefault();let o=i.current?.getBoundingClientRect(),s=o===void 0?void 0:r.screenToFlowPosition({x:o.left+o.width/2,y:o.top+o.height/2});a(n,s)};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[t,a,r]),{onDragOver:e=>{if(!t)return;let r=n?.onDropLibraryEntry!==void 0&&e.dataTransfer.types.includes(`application/x-dg-library-entry`);(n?.onImageFiles!==void 0||r)&&e.preventDefault()},onDrop:e=>{if(!t)return;let i=n?.onDropLibraryEntry!==void 0&&typeof e.dataTransfer?.getData==`function`?e.dataTransfer.getData(Wle):``;if(i!==void 0&&i!==``){e.preventDefault();let t=Kle(e),a=t!==void 0&&sw(t)?void 0:t;n?.onDropLibraryEntry?.(i,r.screenToFlowPosition({x:e.clientX,y:e.clientY}),a);return}if(n?.onImageFiles===void 0)return;e.preventDefault();let a=uw(e.dataTransfer?.files);a.length!==0&&n.onImageFiles(a,r.screenToFlowPosition({x:e.clientX,y:e.clientY}))}}}function qle(e){let{editing:t,edit:n,derivedNodes:r,setLabelEdit:i,setNoteEdit:a,setRfNodes:o,selectOnAppearRef:s}=e,c=n?.editLabelRequest,l=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{!t||c===void 0||c.nonce===l.current||(l.current=c.nonce,i({kind:`node`,id:c.id}),r.some(e=>e.id===c.id)?o(e=>Ele(e,c.id)):s.current=c.id)},[c?.nonce]);let u=n?.editThreatRequest,d=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{!t||u===void 0||u.nonce===d.current||(d.current=u.nonce,a({key:zt(u.target),id:u.id}))},[u?.nonce])}function Jle(e,t){let n=new Map(Object.entries(t.nodes)),r=new Map;for(let t of e.containment)r.set(t.child,[...r.get(t.child)??[],t.parent]);let i=(e,t)=>{for(let a of r.get(e)??[])t.has(a)||(t.add(a),n.has(a)||n.set(a,`inside`),i(a,t))};for(let e of Object.keys(t.nodes))i(e,new Set([e]));for(let n of e.relations)if(t.relations[n.id]!==void 0)for(let e of[n.from,n.to])i(e,new Set([e]));return n}function fw(e,t){let n=e.map(e=>t.relations[e.id]);if(n.every(e=>e===void 0))return;let r=n[0];return n.every(e=>e===r)?r:`changed`}function pw(e,t){return t===void 0?e:e===void 0?`dg-diff-${t}`:`${e} dg-diff-${t}`}function Yle(e){let{props:t,editing:n,edit:r,preset:i,compiled:a}=e,{profile:o,kindRegistry:s}=e.notation,{labelMoves:c,moveViewLabel:l}=e.moves,{placedGeometry:u,routing:d,routes:f,laidAt:p,labelSpots:m,flowDirection:h}=e.layout,[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=(0,v.useMemo)(()=>{let e=o.edge?.colorOf;if(e===void 0)return;let n=new Map;for(let r of a.edges){let i=e(r,t.model,t.plane);i!==void 0&&n.set(r.id,i)}return n},[o,a,t.model,t.plane]),S=(0,v.useCallback)(()=>b(null),[]),C=(0,v.useMemo)(()=>Sb(a.edges),[a]),w=(0,v.useMemo)(()=>ub(a.edges),[a]),T=(0,v.useMemo)(()=>({kindRegistry:s,editing:n,onAddEdgeLabel:r?.onAddEdgeLabel,onEditEdgeLabel:r?.onEditEdgeLabel,onMoveEdgeLabel:r?.onMoveEdgeLabel,onSetEdgeSide:r?.onSetEdgeSide,onAddThreat:r?.onAddThreat,fixedSideRelation:g,pendingAdd:y,onPendingAddConsumed:S,stylePreset:i.rough===void 0?void 0:i,edgeLook:i.edges,notation:t.notation,routing:d,routes:f,laidAt:p,labelSpots:m,labelMoves:c,onViewMoveEdgeLabel:!n&&t.onViewLabelMovesChange!==void 0?l:void 0,edgeColors:x,flowDirection:h,selfLoopIndex:C,parallelBow:w}),[s,n,r?.onAddEdgeLabel,r?.onEditEdgeLabel,r?.onMoveEdgeLabel,r?.onSetEdgeSide,r?.onAddThreat,g,y,S,i,t.notation,d,f,p,m,c,t.onViewLabelMovesChange,l,x,h,C,w]),{diffMarks:E}=t,ee=(0,v.useMemo)(()=>u===null?[]:a.edges.map(e=>{let t=qS(e,T),r=Ro(e),i=pw(void 0,E===void 0?void 0:fw(e.constituents,E));return Xse({id:e.id,source:e.from,target:e.to,data:t,reconnectable:n&&r!==void 0,className:i})}),[a,u,T,n,E]),[te,ne]=(0,v.useState)(()=>new Set);return{rfEdges:(0,v.useMemo)(()=>te.size===0?ee:ee.map(e=>te.has(e.id)?{...e,selected:!0}:e),[ee,te]),onEdgesChange:e=>{let t=e.filter(e=>e.type===`select`);t.length!==0&&ne(e=>{let n=new Set(e);for(let e of t)e.selected?n.add(e.id):n.delete(e.id);return n.size===e.size&&[...n].every(t=>e.has(t))?e:n})},setFixedSideRelation:_,setAddLabelAt:b}}function Xle(e,t,n,r){let i=r.fixed.has(e.id)&&r.profile.node?.draggableWhenFixed?.(e.node)!==!0;return{draggable:!i&&void 0,className:i&&r.editing?`nopan`:void 0,...Zle(e,n,r),...Qle(e,t,r)}}function Zle(e,t,n){return t===void 0||n.profile.node?.dropTarget!==void 0&&n.profile.node?.canDrop?.(e.node)===!0?{}:n.profile.layout===void 0?{expandParent:!0}:n.editing?{extent:`parent`}:{}}function Qle(e,t,n){return e.state===`expanded`?{style:{width:t.width,height:t.height},zIndex:-1}:e.node.type===`git-stage`?{style:{width:t.width,height:t.height},zIndex:-2}:(e.node.image!==void 0||e.node.shape!==void 0)&&e.state===`leaf`||e.state===`leaf`&&e.node.type!==void 0&&mw(e.node.type,n)?{style:{width:t.width,height:t.height}}:n.profile.layout===void 0&&!(n.profile.node?.typelessAsText===!0&&e.node.type===void 0)?{style:{minWidth:t.width}}:{}}function mw(e,t){return ec.has(t.typeRegistry.resolve(e).shape)||Ee(e)||tc.has(e)||t.profile.node?.isLane?.(e)===!0}function $le(e){let{props:t,editing:n,edit:r,compiled:i,labelEdit:a,preset:o,setLabelEdit:s}=e,{profile:c,typeRegistry:l,nodeColors:u,nodeChips:d}=e.notation,{arrangedGeometry:f,fixed:p,regionSeparators:m}=e.layout,h=(0,v.useCallback)(()=>s(null),[s]),g=(0,v.useMemo)(()=>({metaKeys:e.metaKeys,hiddenCounts:e.hiddenCounts,typeRegistry:l,icons:e.icons,typeColors:t.model.typeColors,onOpenLink:t.onOpenLink,onToggleExpand:t.onToggleExpand,onEnterNode:e.enterNode,editing:n,labelEditingId:a?.kind===`node`?a.id:void 0,endLabelEdit:h,onRenameNode:r?.onRenameNode,onSetNodeRich:r?.onSetNodeRich,assetBase:t.assetBase,libraryBase:t.libraryBase,onResize:r?.onResize,onSetTableColumns:r?.onSetTableColumns,quickAdd:r?.quickAdd,onSetRole:r?.onSetRole,onAddThreat:r?.onAddThreat,stylePreset:o.rough===void 0?void 0:o,notation:t.notation,nodeColors:u,hues:e.hues,nodeChips:d,resizable:c.node?.resizable,regionSeparators:m}),[e.metaKeys,e.hiddenCounts,l,e.icons,t.model.typeColors,t.onOpenLink,t.onToggleExpand,e.enterNode,n,a,h,r?.onRenameNode,r?.onSetNodeRich,t.assetBase,t.libraryBase,r?.onResize,r?.onSetTableColumns,r?.quickAdd,r?.onSetRole,r?.onAddThreat,o,t.notation,u,e.hues,d,c,m]),_=(0,v.useMemo)(()=>{if(f===null)return[];let e=[],t={editing:n,profile:c,typeRegistry:l,fixed:p},r=(n,i)=>{let a=f.get(n.id);if(a===void 0)return;let o=KS(n,g);e.push(Yse({id:n.id,position:{x:a.x,y:a.y},data:o,parentId:i,...Xle(n,a,i,t)})),n.children.forEach(e=>r(e,n.id))};return i.roots.forEach(e=>r(e)),e},[i,f,g,n,l,c,p]),{diffMarks:y,model:b}=t,x=(0,v.useMemo)(()=>y===void 0?null:Jle(b,y),[y,b]),{noteNodes:S}=e,C=(0,v.useMemo)(()=>{let e=x===null?_:_.map(e=>{let t=x.get(e.id);if(t===void 0||t===`inside`&&e.data.state===`expanded`)return e;let n=pw(e.className,t);return n===void 0?e:{...e,className:n}});return S.length===0?e:[...e,...S]},[_,S,x]),w=(0,v.useRef)(C);w.current=C;let[T,E]=(0,v.useState)([]),ee=(0,v.useRef)([]);return ee.current=T,{derivedNodes:_,allNodes:C,allNodesRef:w,rfNodes:T,setRfNodes:E,rfNodesRef:ee}}function hw(e){let t=e.filter(e=>e!==void 0);if(t.length===0)return;let n=Math.min(...t.map(e=>e.x)),r=Math.min(...t.map(e=>e.y));return{x:n,y:r,width:Math.max(...t.map(e=>e.x+e.width))-n,height:Math.max(...t.map(e=>e.y+e.height))-r}}var eue=`.react-flow__edge, .react-flow__edgelabel-renderer > *, .dg-loop-badge, .dg-image-caption, .dg-order-band-header, .dg-time-axis-frame`;function gw(e,t){if(e==null)return;let n=[];for(let r of e.querySelectorAll(eue)){let e=r.getBoundingClientRect();if(e.width===0&&e.height===0)continue;let i=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});n.push({x:i.x,y:i.y,width:a.x-i.x,height:a.y-i.y})}return hw(n)}function _w(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var vw=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function yw(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function bw(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function xw(e){let t=bw(e,`border-left-width`),n=bw(e,`border-right-width`);return e.clientWidth+t+n}function N(e){let t=bw(e,`border-top-width`),n=bw(e,`border-bottom-width`);return e.clientHeight+t+n}function Sw(e,t={}){return{width:t.width||xw(e),height:t.height||N(e)}}function Cw(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var ww=16384;function tue(e){(e.width>ww||e.height>ww)&&(e.width>ww&&e.height>ww?e.width>e.height?(e.height*=ww/e.width,e.width=ww):(e.width*=ww/e.height,e.height=ww):e.width>ww?(e.height*=ww/e.width,e.width=ww):(e.width*=ww/e.height,e.height=ww))}function nue(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:`image/png`,t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(`,`)[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e+=1)a[e]=r.charCodeAt(e);n(new Blob([a],{type:t.type?t.type:`image/png`}))})}function Tw(e){return new Promise((t,n)=>{let r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function rue(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Ew(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),rue(i)}var Dw=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Dw(n,t)};function iue(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function aue(e){return yw(e).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function oue(e,t,n){let r=`.${e}:${t}`,i=n.cssText?iue(n):aue(n);return document.createTextNode(`${r}{${i}}`)}function Ow(e,t,n){let r=window.getComputedStyle(e,n),i=r.getPropertyValue(`content`);if(i===``||i===`none`)return;let a=vw();try{t.className=`${t.className} ${a}`}catch{return}let o=document.createElement(`style`);o.appendChild(oue(a,n,r)),t.appendChild(o)}function sue(e,t){Ow(e,t,`:before`),Ow(e,t,`:after`)}var kw=`application/font-woff`,Aw=`image/jpeg`,cue={woff:kw,woff2:kw,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:Aw,jpeg:Aw,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function jw(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function Mw(e){return cue[jw(e).toLowerCase()]||``}function lue(e){return e.split(/,/)[1]}function Nw(e){return e.search(/^(data:)/)!==-1}function uue(e,t){return`data:${t};base64,${e}`}async function due(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var Pw={};function fue(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function Fw(e,t,n){let r=fue(e,t,n.includeQueryParams);if(Pw[r]!=null)return Pw[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=uue(await due(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,lue(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return Pw[r]=i,i}async function pue(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):Tw(t)}async function Iw(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),Tw(t.toDataURL())}let n=e.poster;return Tw(await Fw(n,Mw(n),t))}async function mue(e){try{if(e?.contentDocument?.body)return await Vw(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function hue(e,t){return Dw(e,HTMLCanvasElement)?pue(e):Dw(e,HTMLVideoElement)?Iw(e,t):Dw(e,HTMLIFrameElement)?mue(e):e.cloneNode(!1)}var gue=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`;async function _ue(e,t,n){let r=[];return r=gue(e)&&e.assignedNodes?yw(e.assignedNodes()):Dw(e,HTMLIFrameElement)&&e.contentDocument?.body?yw(e.contentDocument.body.childNodes):yw((e.shadowRoot??e).childNodes),r.length===0||Dw(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>Vw(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function Lw(e,t){let n=t.style;if(!n)return;let r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):yw(r).forEach(i=>{let a=r.getPropertyValue(i);i===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Dw(e,HTMLIFrameElement)&&i===`display`&&a===`inline`&&(a=`block`),i===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function Rw(e,t){Dw(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Dw(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function zw(e,t){if(Dw(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function vue(e,t){return Dw(t,Element)&&(Lw(e,t),sue(e,t),Rw(e,t),zw(e,t)),t}async function Bw(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await Vw(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function Vw(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>hue(e,t)).then(n=>_ue(e,n,t)).then(t=>vue(e,t)).then(e=>Bw(e,t))}var Hw=/url\((['"]?)([^'"]+?)\1\)/g,yue=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bue=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Uw(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function xue(e){let t=[];return e.replace(Hw,(e,n,r)=>(t.push(r),e)),t.filter(e=>!Nw(e))}async function Ww(e,t,n,r,i){try{let a=n?_w(t,n):t,o=Mw(t),s;return s=i?uue(await i(a),o):await Fw(a,o,r),e.replace(Uw(t),`$1${s}$3`)}catch{}return e}function Gw(e,{preferredFontFormat:t}){return t?e.replace(bue,e=>{for(;;){let[n,,r]=yue.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function Kw(e){return e.search(Hw)!==-1}async function qw(e,t,n){if(!Kw(e))return e;let r=Gw(e,n);return xue(r).reduce((e,r)=>e.then(e=>Ww(e,r,t,n)),Promise.resolve(r))}async function Jw(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await qw(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Yw(e,t){await Jw(`background`,e,t)||await Jw(`background-image`,e,t),await Jw(`mask`,e,t)||await Jw(`mask-image`,e,t)}async function Xw(e,t){let n=Dw(e,HTMLImageElement);if(!(n&&!Nw(e.src))&&!(Dw(e,SVGImageElement)&&!Nw(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await Fw(r,Mw(r),t);await new Promise((t,r)=>{e.onload=t,e.onerror=r;let a=e;a.decode&&=t,a.loading===`lazy`&&(a.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function Zw(e,t){let n=yw(e.childNodes).map(e=>Qw(e,t));await Promise.all(n).then(()=>e)}async function Qw(e,t){Dw(e,Element)&&(await Yw(e,t),await Xw(e,t),await Zw(e,t))}function $w(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var eT={};async function tT(e){let t=eT[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},eT[e]=t,t)}async function nT(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),due(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function Sue(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function Cue(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{yw(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=tT(o).then(e=>nT(e,t)).then(e=>Sue(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(tT(n.href).then(e=>nT(e,t)).then(e=>Sue(e).forEach(e=>{a.insertRule(e,n.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{yw(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function wue(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Kw(e.style.getPropertyValue(`src`)))}async function Tue(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return wue(await Cue(yw(e.ownerDocument.styleSheets),t))}async function rT(e,t){let n=await Tue(e,t);return(await Promise.all(n.map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return qw(e.cssText,n,t)}))).join(`
23
+ `));function dS(e){let t=uS(e);return t.length===0?0:Math.ceil(9+t.length*lS)}var fS={TITLE_STRIP_W:28,LANE_STRIP_W:28,LANE_MIN_W:320,LANE_MIN_H:120,PAD:24};function pS(e,t){let n=new Map;return _t(e,dt(e,t)).forEach((e,t)=>{let r=`${e.parent}\u0000${e.child}`;n.has(r)||n.set(r,t)}),(e,t)=>n.get(`${e}\u0000${t}`)??2**53-1}function mS(e,t,n){if(!t.nodes.some(e=>e.type===`activity-frame`))return e;let r=pS(t,n),i=!1,a=e=>{let t=e.children.map(a);if(e.node.type===`activity-frame`){let n=[...t].sort((t,n)=>r(e.id,t.id)-r(e.id,n.id));n.some((e,n)=>e!==t[n])&&(t=n)}return t.every((t,n)=>t===e.children[n])?e:(i=!0,{...e,children:t})},o=e.roots.map(a);return i?{...e,roots:o}:e}function hS(e,t,n,{plane:r,sizes:i}={}){if(!n.nodes.some(e=>e.type===`activity-frame`))return e;let a=new Map(n.nodes.map(e=>[e.id,e.type])),o=new Map(e),{TITLE_STRIP_W:s,LANE_MIN_W:c,LANE_MIN_H:l,PAD:u}=fS,d=pS(n,r),f=e=>{let t=e.children.filter(e=>a.get(e.id)===`activity-lane`&&o.has(e.id)).sort((t,n)=>d(e.id,t.id)-d(e.id,n.id));if(t.length===0){let t=o.get(e.id);o.set(e.id,{...t,width:Math.max(t.width,s+c),height:Math.max(t.height,l)});return}let n=[],r=c;for(let e of t){let t=0,a=0;for(let n of e.children){let e=o.get(n.id);e!==void 0&&(t=Math.max(t,e.x+e.width),a=Math.max(a,e.y+e.height))}let s=i?.[e.id];n.push(Math.max(l,a+u,s?.h??0)),r=Math.max(r,t+u,s?.w??0)}let f=0;t.forEach((e,t)=>{let i=o.get(e.id);o.set(e.id,{...i,x:s,y:f,width:r,height:n[t]}),f+=n[t]});let p=o.get(e.id);o.set(e.id,{...p,width:s+r,height:f})},p=e=>{a.get(e.id)===`activity-frame`&&o.has(e.id)&&f(e),e.children.forEach(p)};return t.roots.forEach(p),o}function gS(e,t,n){let r=[...e].sort((e,t)=>e.y-t.y),i=r.findIndex(e=>e.id===t);if(i===-1)return 0;let a=n+r[i].height/2;return r.filter(e=>e.id!==t&&e.y+e.height/2<a).length-i}var _S={"elk.nodeLabels.placement":`OUTSIDE V_TOP H_CENTER`},vS={"elk.nodeLabels.placement":`OUTSIDE H_RIGHT V_CENTER`};function yS(e,t,n){let r=new Map;for(let t of e)t.from===t.to&&r.set(t.from,[...r.get(t.from)??[],t]);let i=t===`RIGHT`||t===`LEFT`,a=new Map;for(let[e,t]of r){let r=gb(t.length-1),o=t.map(n).filter(e=>e!==void 0),s=Math.max(0,...o.map(e=>e.width)),c=Math.max(0,...o.map(e=>e.height)),l=e=>r+(o.length>0?10+e:0);a.set(e,i?{width:Math.max(1,s),height:l(c/2),text:`self-loops`,layoutOptions:_S}:{width:l(s),height:Math.max(2*_b(0),c),text:`self-loops`,layoutOptions:vS})}return a}var bS={width:200,height:88};function xS(e){return{width:e.width,height:e.height+(e.reserveBottom??0)}}var oce=`layered`,sce=new Set([`force`,`stress`,`mrtree`,`radial`]);function cce(e){return sce.has(e?.algorithm??`layered`)}function SS(e){let t=e?.algorithm??`layered`,n=e?.spacing,r=String(n===void 0?40:n),i=r,a={"elk.algorithm":t,"elk.direction":e?.direction??`DOWN`,"elk.spacing.nodeNode":r,"elk.spacing.edgeNode":`20`,"elk.spacing.edgeEdge":`12`,"elk.spacing.componentComponent":`48`,"elk.spacing.edgeLabel":`6`,"elk.separateConnectedComponents":`true`,...cce(e)?{}:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`}};return t===`layered`&&(a[`elk.layered.spacing.nodeNodeBetweenLayers`]=i,a[`elk.layered.thoroughness`]=`10`,a[`elk.layered.crossingMinimization.strategy`]=`LAYER_SWEEP`,a[`elk.layered.nodePlacement.strategy`]=`BRANDES_KOEPF`,a[`elk.layered.nodePlacement.bk.fixedAlignment`]=`BALANCED`,e?.aspectRatio!==void 0&&(a[`elk.layered.wrapping.strategy`]=`MULTI_EDGE`,a[`elk.aspectRatio`]=String(e.aspectRatio))),t===`stress`&&(a[`elk.stress.desiredEdgeLength`]=`240`),(t===`layered`||e?.edgeRouting===`orthogonal`)&&(a[`elk.edgeRouting`]=`ORTHOGONAL`),a}function lce(e){let t=new Map,n=(e,r)=>{t.set(e.id,r),e.children.forEach(t=>n(t,e.id))};e.roots.forEach(e=>n(e,null));let r=e=>{let n=[],r=e;for(;r!=null;)n.push(r),r=t.get(r);return n.reverse()},i=new Map;for(let t of e.layoutEdges){let e=r(t.from),n=r(t.to);if(e.length===0||n.length===0)continue;let a=0;for(;a<e.length&&a<n.length&&e[a]===n[a];)a++;let o=a===0?null:e[a-1],s=e[a],c=n[a];if(s===void 0||c===void 0||s===c)continue;let l=i.get(o)??[];l.push({id:t.id,sources:[s],targets:[c]}),i.set(o,l)}return i}var CS={top:36,left:16,bottom:16,right:16},uce={top:fS.PAD,left:fS.LANE_STRIP_W+fS.PAD,bottom:fS.PAD,right:fS.PAD},wS={top:0,left:fS.TITLE_STRIP_W,bottom:0,right:0};function TS(e){if(e.node.type===`activity-lane`)return uce;if(e.node.type===`activity-frame`)return wS;if(e.node.type===`sm-zone`)return ES(e.node)===void 0?dce:fce;let t=e.node.type===`sm-state`?dS(e.node):0;return t>0?{...CS,top:CS.top+t}:CS}var ES=e=>e.description!==void 0&&e.description.trim()!==``?e.description.trim():void 0,dce={...CS,top:36},fce={...CS,top:53},pce=24;function mce(e){if(e.node.type!==`sm-zone`)return 0;let t=ES(e.node),n=Sc(e.node.name,12)*1.08;return Math.ceil(Math.max(n,t===void 0?0:Sc(t,11)))+pce}var hce=e=>`[top=${e.top}.0,left=${e.left}.0,bottom=${e.bottom}.0,right=${e.right}.0]`,gce=hce({top:0,left:0,bottom:0,right:0});function _ce(e,t){let n=e?.spacing??40;return t?n:Math.round(n*1.2)}function vce(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e.includes(`.spacing.`)))}var yce=6,bce=12,xce=18,Sce=14;function DS(e){return e.labels!==void 0&&e.labels.length>0?e.labels.reduce((e,t)=>t.text.length>e.length?t.text:e,``):e.label??``}var OS={"elk.edgeLabels.inline":`true`};function kS(e){let t=DS(e).trim();if(t===``)return;let n=jn(e.kind)?Fn(t,24):[t],r=Math.min(Math.max(...n.map(e=>[...e].length)),24);return{width:Math.round(r*yce+bce),height:xce+(n.length-1)*Sce}}var Cce={"elk.nodeLabels.placement":`OUTSIDE V_BOTTOM H_CENTER`},wce=`note-link`,Tce=new Set([ve,hn]);function AS(e){let t=e=>Tce.has(e.node.type)||e.children.some(t);return e.roots.some(t)}var Ece=(e,t)=>!t&&[`DOWN`,`UP`].includes(e?.direction??`DOWN`),Dce=(e,t)=>({"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":t?`(0.0, ${e}.0)`:`(${e}.0, 0.0)`}),jS=(e,t)=>{let n=mce(t);return{...e.sharedContainerOptions,"elk.padding":hce(TS(t)),...n>0?Dce(n,e.swapsMinimum):{}}};function MS(e,t){e.emitted.add(t.id);let n=e.substitute?.prelaid.get(t.id);if(n!==void 0)return{id:t.id,width:n.width,height:n.height};let r=e.substitute?.packs.get(t.id);if(r!==void 0)return{id:t.id,children:[...t.children.filter(e=>!r.members.has(e.id)).map(t=>MS(e,t)),{id:r.id,width:r.width,height:r.height}],layoutOptions:jS(e,t)};if(t.state===`expanded`){let n=e.byOwner?.get(t.id),r=n!==void 0&&n.length>0;return r&&(e.attachedToContainer=!0),{id:t.id,children:t.children.map(t=>MS(e,t)),layoutOptions:jS(e,t),...r?{edges:n}:{}}}if(t.state===`collapsed`){let n=e.sizes?.get(t.id)??bS,r=e.loopRooms.get(t.id);return{id:t.id,width:n.width,height:n.height,...r===void 0?{}:{labels:[r]}}}return Oce(e,t)}function Oce(e,t){let n=e.sizes?.get(t.id)?.caption,r=[...n===void 0?[]:[{...n,text:`caption`,layoutOptions:Cce}],...e.loopRooms.has(t.id)?[e.loopRooms.get(t.id)]:[]];return{id:t.id,...xS(e.sizes?.get(t.id)??Zo),...r.length>0?{labels:r}:{},...e.fromStart&&Tce.has(t.node.type)?{layoutOptions:{"elk.layered.layering.layerConstraint":`FIRST`}}:{}}}function kce(e,t){let n=t?.get(e.id);return n===void 0?e:{...e,layoutOptions:{...e.layoutOptions,"elk.partitioning.partition":String(n)}}}var Ace=`__order__`,jce={"elk.layered.priority.direction":`100`};function Mce(e,t,n){return e.layoutEdges.filter(e=>e.from!==e.to&&(t.substitute===void 0||t.emitted.has(e.from)&&t.emitted.has(e.to))).map(e=>{let r=DS(e).trim(),i=kS(e),a=t.fromStart&&e.kind===wce;return a&&n.add(e.id),{id:e.id,sources:[a?e.to:e.from],targets:[a?e.from:e.to],...i===void 0?{}:{labels:[{...i,text:r,layoutOptions:OS}]},...e.kind===`__order__`?{layoutOptions:jce}:{}}})}function Nce(e,t){let n=new Map(e.layoutEdges.map(e=>[e.id,e]));return t.some(e=>{let t=n.get(e.id);return t===void 0||e.sources[0]!==t.from||e.targets[0]!==t.to})}function NS(e,t,n){return{...SS(e),...t===void 0?{}:{"elk.padding":gce},...n===void 0?{}:{"elk.partitioning.activate":`true`}}}var PS=(e,t)=>(t?.algorithm??`layered`)===`layered`&&AS(e);function FS(e,t,n,r){let i=r?.substitute,a=r?.partitions!==void 0&&r.partitions.size>0?r.partitions:void 0,o=NS(n,i,a),s=PS(e,n),c=s?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{};Object.assign(o,c);let l=cce(n)&&r?.flat!==!0,u={sizes:t,substitute:i,byOwner:l?lce(e):void 0,sharedContainerOptions:l?o:{...vce(o),...c},fromStart:s,emitted:new Set,attachedToContainer:!1,loopRooms:yS(e.edges,n?.direction??`DOWN`,kS),swapsMinimum:Ece(n,l)},d=(i?.roots??e.roots).map(e=>kce(MS(u,e),a)),f=new Set,p=l?u.byOwner?.get(null)??[]:Mce(e,u,f),m=u.attachedToContainer||l&&Nce(e,p);return{graph:{id:Ae,layoutOptions:o,children:d,edges:p},lifted:m,reversed:f}}function IS(e,t){if(e.node.color!==void 0)return e.node.color;let n=t.nodeColors?.get(e.id);if(n!==void 0)return n;let r=t.typeColors;if(r!==void 0)return(e.node.type===void 0?void 0:r[e.node.type])??r[`*`]}function M(e,t){return t.map(t=>e.node.metadata?.[t]).filter(e=>e!=null).map(String)}function LS(e){let t=e.node.comments?.length??0,n=e.node.links?.length??0;return t>0||n>0?{comments:t,links:n}:void 0}function RS(e,t){let n=oa(e.node.threats),r=IS(e,t),i={label:e.node.name,state:e.state,promoted:e.promoted,sharedMembers:e.sharedMembers,hiddenCount:t.hiddenCounts.get(e.id)??0,metaBadges:M(e,t.metaKeys),typeRegistry:t.typeRegistry,icons:t.icons,typeId:e.node.type,icon:e.node.icon,color:r,hue:t.hues===void 0?void 0:Hb(e.node.type,r,t.hues),textColor:e.node.textColor,technology:e.node.technology,rich:e.node.rich,textAlign:e.node.textAlign,fontScale:e.node.fontScale,onToggleExpand:t.onToggleExpand,onEnterNode:e.state===`leaf`?void 0:t.onEnterNode,external:e.external!==void 0,image:e.node.image,shape:e.node.shape,link:e.node.link,columns:e.columns??e.node.columns,quickAdd:t.editing?t.quickAdd:void 0,onSetRole:t.editing?t.onSetRole:void 0,onAddThreat:t.editing?t.onAddThreat:void 0,stylePreset:t.stylePreset,notation:t.notation,threats:n.total>0?n:void 0,annotations:LS(e),chips:t.nodeChips?.get(e.id),...e.node.type===`sm-state`?{behaviors:cS(e.node),composite:e.state!==`leaf`}:{},...e.node.type===`sm-zone`&&ES(e.node)!==void 0?{zoneNote:ES(e.node)}:{}},a=t.regionSeparators?.get(e.id);return a!==void 0&&(i.regionSeparator=a),t.labelEditingId===e.id&&Pce(i,e,t),(e.node.image!==void 0||e.node.shape!==void 0)&&(i.assetBase=t.assetBase,i.libraryBase=t.libraryBase),e.node.link!==void 0&&(i.onOpenLink=t.onOpenLink),t.editing&&zS(i,e,t),i}function Pce(e,t,n){e.labelEditing=!0,e.onLabelCommit=e=>{n.endLabelEdit?.();let r=e?.trim()??``;r!==``&&r!==t.node.name&&n.onRenameNode?.(t.id,r)},e.onRichCommit=e=>{n.endLabelEdit?.(),e!==null&&Me(e).trim()!==``&&n.onSetNodeRich?.(t.id,e)}}function zS(e,t,n){t.node.type===`db-table`&&n.onSetTableColumns!==void 0&&(e.onColumnsChange=e=>{let r=t.node.columns??[];n.onSetTableColumns?.(t.id,ho(r,t.columns??r,e))}),n.onResize!==void 0&&(t.node.image!==void 0&&(e.onResize=n.onResize),n.resizable?.(t.node)===`x`&&(e.resizeAxis=`x`,e.onResize=n.onResize))}function BS(e,t){let n=e.labels??[],r=Ro(e),i=r===void 0?void 0:t?.[r.id];return i===void 0?n:n.map(e=>{let t=i[e.id];return t===void 0?e:{...e,t:t.t,side:t.side}})}function Fce(e){return e.constituents.reduce((e,t)=>{let n=oa(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0})}function Ice(e){let t=e.constituents.reduce((e,t)=>e+(t.comments?.length??0),0);return t>0?{comments:t,links:0}:void 0}function Lce(e,t){let n=Fce(e),r={kind:e.kind,constituentCount:e.constituents.length,kindRegistry:t.kindRegistry,label:e.label,labels:e.labels===void 0?void 0:BS(e,t.labelMoves),tint:e.tint,relStyle:e.style,stylePreset:t.stylePreset,edgeLook:t.edgeLook,notation:t.notation,polarity:e.polarity,delay:e.delay,notationColor:t.edgeColors?.get(e.id),threats:n.total>0?n:void 0,annotations:Ice(e)},i=Ro(e);i!==void 0&&(r.threatRelation=i.id),i?.fromColumn!==void 0&&(r.fromColumn=i.fromColumn),i?.toColumn!==void 0&&(r.toColumn=i.toColumn),i!==void 0&&(t.editing?Rce(r,e,i,t):zce(r,i,t)),e.from===e.to&&(r.selfLoop={direction:t.flowDirection,index:t.selfLoopIndex.get(e.id)??0,labelWidth:kS(e)?.width??0});let a=t.parallelBow.get(e.id);return a!==void 0&&(r.parallelBow=a),t.routing!==void 0&&VS(r,e,t,t.routing),r}function Rce(e,t,n,r){if(e.editableLabels=!0,e.onAddLabel=(e,t,i)=>r.onAddEdgeLabel?.(n.id,e,t,i),e.onEditLabel=(e,t)=>r.onEditEdgeLabel?.(n.id,e,t),e.onMoveLabel=(e,t,i)=>r.onMoveEdgeLabel?.(n.id,e,t,i),r.onAddThreat!==void 0){let t=r.onAddThreat;e.onAddThreat=()=>t({relation:n.id})}No(n,t.from,t.to)&&r.onSetEdgeSide!==void 0&&(e.onSetSide=(e,t)=>r.onSetEdgeSide?.(n.id,e,t),n.id===r.fixedSideRelation&&(e.fixedSideDotsShown=!0)),r.pendingAdd?.edgeId===t.id&&(e.pendingAdd={x:r.pendingAdd.x,y:r.pendingAdd.y},e.onPendingAddConsumed=r.onPendingAddConsumed)}function zce(e,t,n){n.onViewMoveEdgeLabel!==void 0&&(e.movableLabels=!0,e.onMoveLabel=(e,r,i)=>n.onViewMoveEdgeLabel?.(t.id,e,r,i))}function VS(e,t,n,r){let i=n.routes.get(t.id),a=n.laidAt.get(t.from),o=n.laidAt.get(t.to);if(i===void 0||i.length<2||a===void 0||o===void 0)return;e.route=i,e.routeCorner=n.edgeLook?.corner??r.corner,e.routeFrom=a,e.routeTo=o;let s=n.labelSpots.get(t.id);s!==void 0&&(e.labelSpot=s)}var HS=new WeakMap,US=new WeakMap,WS=`metaKeys.hiddenCounts.typeRegistry.icons.typeColors.onOpenLink.onToggleExpand.onEnterNode.editing.labelEditingId.endLabelEdit.onRenameNode.onSetNodeRich.assetBase.libraryBase.onResize.onSetTableColumns.quickAdd.onSetRole.onAddThreat.stylePreset.notation.nodeColors.hues.nodeChips.resizable.regionSeparators`.split(`.`),Bce=[`kindRegistry`,`editing`,`onAddEdgeLabel`,`onEditEdgeLabel`,`onMoveEdgeLabel`,`onSetEdgeSide`,`onAddThreat`,`fixedSideRelation`,`pendingAdd`,`onPendingAddConsumed`,`stylePreset`,`edgeLook`,`notation`,`routing`,`routes`,`laidAt`,`labelSpots`,`labelMoves`,`onViewMoveEdgeLabel`,`edgeColors`,`flowDirection`,`selfLoopIndex`,`parallelBow`],Vce=e=>(t,n)=>e.every(e=>t[e]===n[e]),Hce=Vce(WS),GS=Vce(Bce);function KS(e,t){let n=HS.get(e);if(n!==void 0&&Hce(n.ctx,t))return n.data;let r=RS(e,t);return HS.set(e,{ctx:t,data:r}),r}function qS(e,t){let n=US.get(e);if(n!==void 0&&GS(n.ctx,t))return n.data;let r=Lce(e,t);return US.set(e,{ctx:t,data:r}),r}var JS=[`layers`,`kinds`,`marks`],YS=new Set([`bar`,`start-dot`,`end-bullseye`]);function XS(e,t){let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>{let r=n.get(e),i=n.get(t);return r!==void 0&&i!==void 0?r-i:r===void 0?i===void 0?e.localeCompare(t):1:-1})}function Uce(e){let t=e.model,n=Ln(t,e.plane?.id),r=e.plane?.id??t.planes[0]?.id,i=e=>mt(e,r);if(e.root!==void 0&&n.childrenOf.has(e.root)){let{model:r}=Bo(t,n,e.root);return{nodes:r.nodes,relations:r.relations.filter(i)}}let a=new Set(n.childrenOf.keys());return{nodes:t.nodes.filter(e=>a.has(e.id)),relations:t.relations.filter(e=>i(e)&&a.has(e.from)&&a.has(e.to))}}function Wce(e){let{nodes:t,relations:n}=Uce(e),r=new Set;for(let e of t){e.layer!==void 0&&r.add(e.layer);for(let t of e.columns??[])t.layer!==void 0&&r.add(t.layer)}for(let t of n){let n=Do(e.model,t);n!==void 0&&r.add(n)}return r}function Gce(e){let t=Wce(e),n=new Set(e.activeLayers??e.plane?.layers??[]),r=[];for(let i of e.model.layers){if(!t.has(i.id))continue;let a=n.has(i.id);!a&&!e.canToggleLayers||r.push({id:`layers:${i.id}`,section:`layers`,label:i.name,swatch:{draw:`chip`,color:i.tint??`var(--dg-edge)`},layer:i.id,active:a})}return r}function ZS(e){let t=new Map,n=[];for(let r of e.compiled.edges)t.has(r.kind)?t.get(r.kind)!==r.tint&&t.set(r.kind,void 0):(n.push(r.kind),t.set(r.kind,r.tint));return XS(n,Object.keys(Ys)).map(n=>{let r=t.get(n),i=e.kindRegistry.resolve(n);return{id:`kinds:${n}`,section:`kinds`,label:i.legendLabel??n,swatch:{draw:`line`,style:i,color:r},vocabulary:i.legendLabel!==void 0||void 0}})}function Kce(e){let t=new Map,n={nodeColors:e.nodeColors,typeColors:e.model.typeColors},r=e=>{for(let i of e){let e=i.node.type;if(e!==void 0){let r=IS(i,n);t.has(e)?t.get(e)!==r&&t.set(e,void 0):t.set(e,r)}r(i.children)}};return r(e.compiled.roots),XS([...t.keys()],Object.keys(Js)).map(n=>{let r=e.typeRegistry.resolve(n),i=YS.has(r.shape)?void 0:e.hues===void 0?t.get(n):Hb(n,t.get(n),e.hues),a=r.label;return{id:`types:${n}`,section:`types`,label:r.legendLabel??(a===void 0||a===``?n:a),swatch:{draw:`shape`,style:r,color:i,icon:r.icon},vocabulary:r.legendLabel!==void 0||void 0}})}function qce(e){let t=new Set,n=e=>{e.total!==0&&t.add(e.open>0?`threat-open`:`threat-handled`)},r=e=>{for(let i of e){n(oa(i.node.threats));for(let e of i.columns??i.node.columns??[])e.pk===!0?t.add(`pk`):e.fk===!0&&t.add(`fk`);r(i.children)}};r(e.compiled.roots);for(let t of e.compiled.edges)n(t.constituents.reduce((e,t)=>{let n=oa(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0}));let i={"threat-open":`Open threats`,"threat-handled":`All threats handled`,pk:`Primary key`,fk:`Foreign key column`};return Object.keys(i).filter(e=>t.has(e)).map(e=>({id:`marks:${e}`,section:`marks`,label:i[e],swatch:{draw:`mark`,mark:e},vocabulary:!0}))}function Jce(e){let t=new Set,n=e=>{for(let r of e){let{type:e,stateKind:i,color:a}=r.node;e===`sm-state`&&i!==void 0&&a===void 0&&t.add(i),n(r.children)}};n(e.compiled.roots);let r=e.typeRegistry.resolve(fn);return ie.filter(e=>t.has(e)).map(e=>({id:`marks:state-${e}`,section:`marks`,label:$c[e],swatch:{draw:`shape`,style:r,color:Qc[e]},vocabulary:!0}))}function Yce(e,t){if(e.kind!==void 0)return{draw:`line`,style:t.kindRegistry.resolve(e.kind),color:e.color};if(e.type!==void 0){let n=t.typeRegistry.resolve(e.type),r=e.icon??n.icon;return{draw:`shape`,style:n,color:e.color,icon:r}}if(e.color!==void 0)return{draw:`chip`,color:e.color}}function Xce(e){return e.drawings===void 0?[]:[{id:`layers:$drawings`,section:`layers`,label:`Drawings`,swatch:{draw:`line`,style:{width:2.5},color:`var(--dg-ink)`},drawings:!0,active:e.drawings.active}]}function Zce(e){let t=e.config.show??JS,n=t.includes(`types`)?Kce(e):e.config.show===void 0?Kce(e).filter(e=>e.vocabulary===!0):[],r=[...t.includes(`layers`)?[...Gce(e),...Xce(e)]:[],...t.includes(`kinds`)?ZS(e):[],...n,...t.includes(`marks`)?[...Jce(e),...qce(e)]:[]],i=[];return(e.config.items??[]).forEach((t,n)=>{let a=t.kind===void 0?t.type===void 0?void 0:`types:${t.type}`:`kinds:${t.kind}`,o=a===void 0?void 0:r.find(e=>e.id===a);if(o!==void 0){o.label=t.label,t.color!==void 0&&(o.swatch?.draw===`line`||o.swatch?.draw===`shape`)&&(o.swatch={...o.swatch,color:t.color}),t.icon!==void 0&&o.swatch!==void 0&&o.swatch.draw===`shape`&&(o.swatch={...o.swatch,icon:t.icon});return}let s=Yce(t,e);i.push({id:`items:${n}`,section:`items`,label:t.label,swatch:s})}),[...r,...i]}var Qce={};function $ce(e){let[t,n]=(0,v.useState)(e.model.legend!==void 0),[r,i]=(0,v.useState)(null),a=e.model.legend;(0,v.useEffect)(()=>{n(a!==void 0)},[e.model.id,a]);let o=(0,v.useMemo)(()=>ut(e.model.planes,e.plane),[e.model.planes,e.plane]),s=(0,v.useMemo)(()=>{let t=Zce({model:e.model,compiled:e.compiled,plane:o,root:e.drillRoot,activeLayers:e.activeLayers,nodeColors:e.nodeColors,hues:e.hues,typeRegistry:e.typeRegistry,kindRegistry:e.kindRegistry,config:a??Qce,canToggleLayers:e.canToggleLayers,drawings:e.strokes.length>0?{active:e.drawingsVisible}:void 0});return a!==void 0||t.some(e=>e.vocabulary===!0)?t:[]},[a,e.model,e.compiled,o,e.drillRoot,e.activeLayers,e.typeRegistry,e.kindRegistry,e.canToggleLayers,e.strokes,e.drawingsVisible,e.nodeColors,e.hues]),c=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=a?.position??`bottom-right`;c.current=!t||r===null||s.length===0?null:{side:e.startsWith(`top`)?`top`:`bottom`,px:r.height+16}},[t,r,s,a]),{legendConfig:a,showLegend:t,setShowLegend:n,setLegendSize:i,legendRowList:s,legendReserveRef:c}}function QS(e){let t;for(let n of e){if(n===void 0)return;if(t===void 0)t=n;else if(t!==n)return}return t}function $S(e){let t=new Map;for(let n of e){let e=`${n.from}\0${n.to}`,r=t.get(e);if(r===void 0){t.set(e,{from:n.from,to:n.to,polarity:n.polarity,edgeIds:[n.id]});continue}r.edgeIds.push(n.id),r.polarity=QS([r.polarity,n.polarity])}return t}function eC(e){let t=0;for(let n of e){if(n.polarity===void 0)return`unknown`;n.polarity===`-`&&t++}return t%2==0?`R`:`B`}function tC(e,t){return{key:e.join(`→`),nodes:[...e],edgeIds:t.flatMap(e=>e.edgeIds),kind:eC(t)}}var nC=(e,t)=>e<t?-1:+(e>t);function rC(e,t){let n=t?.maxLength??20,r=t?.maxLoops??50,i=t?.budget??2e5,a=[...$S(e).values()],o=new Set;for(let e of a)o.add(e.from),o.add(e.to);let s=[...o].sort(nC),c=new Map(s.map((e,t)=>[e,t])),l=s.length,u=Array.from({length:l},()=>[]),d=[];for(let e of a){if(e.from===e.to){d.push(e);continue}let t=c.get(e.from),n=c.get(e.to);t===void 0||n===void 0||u[t]?.push({to:n,arc:e})}for(let e of u)e.sort((e,t)=>e.to-t.to);d.sort((e,t)=>nC(e.from,t.from));let f=[],p=0,m=!1;for(let e of d)f.push(tC([e.from],[e]));let h=[],g=[],_=new Set;function v(e,t){if(m)return;let r=u[t];if(r!==void 0)for(let{to:t,arc:a}of r){if(p>=i){m=!0;return}if(p++,t===e){h.length>=2&&f.push(tC(h,[...g,a]));continue}if(t>e&&!_.has(t)&&h.length<n){let n=s[t];if(n===void 0)continue;if(_.add(t),h.push(n),g.push(a),v(e,t),g.pop(),h.pop(),_.delete(t),m)return}}}for(let e=0;e<l&&!m;e++){let t=s[e];t!==void 0&&(h.length=0,g.length=0,_.clear(),h.push(t),_.add(e),v(e,e))}return f.sort((e,t)=>e.nodes.length-t.nodes.length||nC(e.key,t.key)),{loops:f.slice(0,r),truncated:m||f.length>r}}var iC=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),ele=6;function aC(e,t,n){let r=[{x:e,y:t}],i=Math.max(24,n);for(let n=1;n<=ele;n++){let a=n*i,o=Math.max(4,Math.floor(2*Math.PI*a/i));for(let n=0;n<o;n++){let i=-Math.PI/2+2*Math.PI*n/o;r.push({x:e+Math.cos(i)*a,y:t+Math.sin(i)*a})}}return r}function oC(e,t,n){let r=Math.max(n.x,Math.min(e.x,n.x+n.width)),i=Math.max(n.y,Math.min(e.y,n.y+n.height)),a=e.x-r,o=e.y-i;return a*a+o*o<t*t}var tle=1e-6;function sC(e){if(e.length<3)return`none`;let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];r===void 0||i===void 0||(t+=r.x*i.y-i.x*r.y)}return t/=2,Math.abs(t)<tle?`none`:t>0?`cw`:`ccw`}function nle(e,t,n){let r=n?.labelRadius??15,i=n?.minLabelGap??36,a=n?.nodeMargin??8,o=n?.obstacles??[...t.values()],s=r+a,c=i*i,l=[...e.filter(e=>e.nodes.every(e=>t.has(e)))].sort((e,t)=>e.nodes.length-t.nodes.length||nC(e.key,t.key)),u=[],d=[];for(let e of l){let n=e.nodes.map(e=>t.get(e)).filter(e=>e!==void 0).map(iC);if(n.length===0)continue;let r=n.reduce((e,t)=>e+t.x,0)/n.length,a=n.reduce((e,t)=>e+t.y,0)/n.length,l=sC(n),f={x:r,y:a};for(let e of aC(r,a,i))if(!o.some(t=>oC(e,s,t))&&!d.some(t=>{let n=t.x-e.x,r=t.y-e.y;return n*n+r*r<c})){f=e;break}d.push(f),u.push({key:e.key,kind:e.kind,x:f.x,y:f.y,direction:l})}return u}function cC(e){let t=new Map(e.map(e=>[e.id,e])),n=new Set;function r(e){let i=t.get(e);if(i===void 0)return{x:0,y:0};if(i.parentId===void 0||n.has(e))return i.position;n.add(e);let a=r(i.parentId);return n.delete(e),{x:i.position.x+a.x,y:i.position.y+a.y}}let i=new Map;for(let t of e){let e=t.measured?.width,n=t.measured?.height;if(e===void 0||n===void 0)continue;let a=r(t.id);i.set(t.id,{x:a.x,y:a.y,width:e,height:n})}return i}function lC(e){let t=e.profile.canvasOverlay===`loop-labels`,n=(0,v.useMemo)(()=>t?e.compiled.edges.map(e=>{let t=QS(e.constituents.map(e=>e.polarity));return{id:e.id,from:e.from,to:e.to,polarity:t}}):null,[e.compiled,t]),{onCldEdges:r}=e;(0,v.useEffect)(()=>{r?.(n??[])},[n,r]);let[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(null),f=e.externalHighlight,{profile:p,model:m,plane:h}=e,g=(0,v.useMemo)(()=>{if(!c||o===null)return null;let t=new Set([o]),n=new Set;for(let r of e.compiled.edges)r.from===o?(t.add(r.to),n.add(r.id)):r.to===o&&(t.add(r.from),n.add(r.id));for(let e of p.related?.(m,h,o)??[])t.add(e);return{nodes:t,edges:n}},[c,o,e.compiled.edges,p,m,h]),_=(0,v.useMemo)(()=>{let e=f==null?u===null?null:{nodes:u.nodes,edges:u.edges}:{nodes:new Set(f.nodes),edges:new Set(f.edges)},t=e??g;return{nodes:t?.nodes??uv,edges:t?.edges??uv,active:t!==null,variant:e===null?`focus`:`loop`,activeKey:u?.key??null,focusId:o,toggle:(e,t,n)=>d(r=>r?.key===e?null:{key:e,nodes:new Set(t),edges:new Set(n)}),clear:()=>d(null)}},[u,f,g,o]);return(0,v.useEffect)(()=>{d(null),s(null)},[e.compiled]),{cld:t,loopEdges:n,showLoops:i,setShowLoops:a,selectedNode:o,setSelectedNode:s,focusConnected:c,setFocusConnected:l,loopHighlight:_}}var rle=8,uC=14,dC=`stroke='black' stroke-width='1.4' fill='none' stroke-linecap='round'`,ile={plus:`<rect x='1.5' y='6.25' width='5' height='1.5'/><rect x='3.25' y='4.5' width='1.5' height='5'/>`,dash:`<rect x='1.5' y='6.25' width='5' height='1.5'/>`,equals:`<rect x='1.5' y='4.8' width='5' height='1.3'/><rect x='1.5' y='7.9' width='5' height='1.3'/>`,pipe:`<rect x='3.25' y='1' width='1.5' height='12'/>`,colon:`<circle cx='4' cy='4.5' r='1'/><circle cx='4' cy='9.5' r='1'/>`,dot:`<circle cx='4' cy='7' r='1'/>`,baseDot:`<circle cx='4' cy='10' r='1.05'/>`,tick:`<rect x='3.35' y='2.5' width='1.3' height='4'/>`,slash:`<path d='M1.8 12 L6.2 2' ${dC}/>`,backslash:`<path d='M1.8 2 L6.2 12' ${dC}/>`,openParen:`<path d='M5.6 1.5 Q1.6 7 5.6 12.5' ${dC}/>`,closeParen:`<path d='M2.4 1.5 Q6.4 7 2.4 12.5' ${dC}/>`},fC=[[0,0],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1]];function pC(e){let t=e.map((e,t)=>{let[n,r]=fC[t];return`<g transform='translate(${n*rle} ${r*uC})'>${ile[e]}</g>`});return`url("data:image/svg+xml,${`<svg xmlns='http://www.w3.org/2000/svg' width='${3*rle}' height='${3*uC}'>${t.join(``)}</svg>`.replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/#/g,`%23`)}")`}function ale(){return{"--dg-ascii-box":pC([`plus`,`dash`,`plus`,`pipe`,`plus`,`dash`,`plus`,`pipe`]),"--dg-ascii-table":pC([`plus`,`equals`,`plus`,`pipe`,`plus`,`equals`,`plus`,`pipe`]),"--dg-ascii-hex":pC([`slash`,`dash`,`backslash`,`pipe`,`slash`,`dash`,`backslash`,`pipe`]),"--dg-ascii-pill":pC([`baseDot`,`dash`,`baseDot`,`closeParen`,`tick`,`dash`,`tick`,`openParen`]),"--dg-ascii-group":pC([`dot`,`dot`,`dot`,`colon`,`dot`,`dot`,`dot`,`colon`])}}var mC={id:`clean`,label:`Clean`},ole={id:`sketch`,label:`Sketch`,rough:{roughness:1.15,bowing:1,strokeWidth:1.5,fillStyle:`solid`},fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:14,stroke:100}},sle={id:`hand-drawn`,label:`Hand-drawn`,rough:{roughness:.9,bowing:.8,strokeWidth:1.2,fillStyle:`hachure`,fillWeight:.8,hachureGap:5,hatchOpacity:.45},cornerRadius:14,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},hC={id:`blueprint`,label:`Blueprint`,fontFamily:`ui-monospace, 'Cascadia Mono', 'Source Code Pro', monospace`,cssVars:{"--dg-canvas-bg":`#0d2740`,"--dg-surface":`#0d2740`,"--dg-node-fill":`#103052`,"--dg-node-stroke":`#9ec8e8`,"--dg-group-fill":`#0f2c4a`,"--dg-group-stroke":`#5f8ab0`,"--dg-text":`#e4f1fb`,"--dg-text-muted":`#8fb3cf`,"--dg-border":`#2a4a6b`,"--dg-edge":`#9ec8e8`,"--dg-edge-label-bg":`#103052`}},cle={id:`pencil`,label:`Pencil`,rough:{roughness:.3,bowing:.1,strokeWidth:1.4,fillStyle:`hachure`,fillWeight:.55,hachureGap:5,hatchOpacity:.5},cornerRadius:16,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},lle={id:`marker`,label:`Marker`,rough:{roughness:1.6,bowing:1.2,strokeWidth:2.5,fillStyle:`zigzag`,fillWeight:1.8,hachureGap:7,hatchOpacity:.25},cornerRadius:8,fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:28,stroke:100}},gC=`'diagc Inter', 'Inter', system-ui, sans-serif`,_C=`'diagc JetBrains Mono', 'JetBrains Mono', ui-monospace, monospace`,vC=[`#3b82f6`,`#f59e0b`,`#10b981`,`#8b5cf6`,`#f43f5e`,`#06b6d4`,`#84cc16`,`#d946ef`],yC=e=>`color-mix(in srgb, var(--dg-text) ${e}%, var(--dg-bg))`,ule={id:`soft`,label:`Soft`,fontFamily:gC,cssVars:{"--dg-edge":yC(38)}},dle=C(x),bC=[mC,ole,sle,cle,hC,lle,ule,{id:`pastel`,label:`Pastel`,fontFamily:gC,palette:vC,cssVars:{"--dg-edge":yC(38)}},{id:`cards`,label:`Cards`,fontFamily:gC,palette:vC,cssVars:{"--dg-edge":yC(40)}},{id:`layered`,label:`Layered`,fontFamily:gC,grid:`none`,cssVars:{"--dg-canvas-bg":`color-mix(in srgb, #3b82f6 3%, var(--dg-bg))`,"--dg-edge":`color-mix(in srgb, #64748b 75%, var(--dg-text))`}},{id:`neon`,label:`Neon`,fontFamily:`'diagc Chakra Petch', 'Chakra Petch', system-ui, sans-serif`,palette:[`#00e5ff`,`#ff2bd6`,`#f2ff3d`,`#5cff7a`,`#ff9d2b`,`#b18cff`,`#ff4d6d`],grid:`lines`,cssVars:{...dle,"--dg-canvas-bg":`#07080f`,"--dg-bg":`#07080f`,"--dg-surface":`#0b0d17`,"--dg-node-fill":`#0b0d17`,"--dg-node-stroke":`#00e5ff`,"--dg-group-fill":`rgba(255, 43, 214, 0.035)`,"--dg-group-stroke":`#ff2bd6`,"--dg-text":`#e8f9ff`,"--dg-text-muted":`#86a4bb`,"--dg-border":`#1f2a3d`,"--dg-edge":`#22d3ee`,"--dg-edge-label-bg":`#07080f`,"--dg-accent":`#00e5ff`,"--dg-badge-bg":`#ff2bd6`,"--dg-badge-text":`#07080f`,"--dg-ink":`#e8f9ff`,"--dg-table-header-bg":`#111a2e`,"--dg-table-header-text":`#e8f9ff`,"--dg-table-border":`#22d3ee`,"--dg-table-row-text":`#c6e6f2`,"--dg-table-type-text":`#86a4bb`,"--dg-table-pk":`#f2ff3d`,"--dg-table-fk":`#ff79e6`}},{id:`terminal`,label:`Terminal`,fontFamily:_C,palette:[`#39ff88`,`#5ef2ff`,`#ffb000`,`#ff79c6`,`#bd93f9`,`#ff5555`,`#f1fa8c`],grid:`none`,cssVars:{...dle,"--dg-canvas-bg":`#050805`,"--dg-bg":`#050805`,"--dg-surface":`#0a110b`,"--dg-node-fill":`#0a110b`,"--dg-node-stroke":`#39ff88`,"--dg-group-fill":`rgba(255, 176, 0, 0.03)`,"--dg-group-stroke":`#ffb000`,"--dg-text":`#d4ffe2`,"--dg-text-muted":`#6fbf8a`,"--dg-border":`#1d3a24`,"--dg-edge":`#2fd16f`,"--dg-edge-label-bg":`#050805`,"--dg-accent":`#39ff88`,"--dg-badge-bg":`#39ff88`,"--dg-badge-text":`#050805`,"--dg-ink":`#d4ffe2`,"--dg-table-header-bg":`#0f2414`,"--dg-table-header-text":`#d4ffe2`,"--dg-table-border":`#2fd16f`,"--dg-table-row-text":`#b9f5cb`,"--dg-table-type-text":`#6fbf8a`,"--dg-table-pk":`#ffb000`,"--dg-table-fk":`#5ef2ff`}},{id:`ascii`,label:`ASCII`,fontFamily:_C,palette:vC,grid:`none`,edges:{corner:0,dash:{solid:`5 3`,dashed:`5 11`},openArrow:!0},cssVars:{"--dg-canvas-bg":`var(--dg-bg)`,"--dg-edge":yC(62),...ale()}},{id:`dos`,label:`DOS`,fontFamily:_C,palette:[`#aaaaaa`,`#00aaaa`,`#00aa00`,`#55ffff`,`#ffff55`,`#55ff55`,`#ff55ff`,`#ff5555`],grid:`none`,edges:{corner:0},cssVars:{...dle,"--dg-canvas-bg":`#0000aa`,"--dg-bg":`#0000aa`,"--dg-surface":`#0000aa`,"--dg-node-fill":`#aaaaaa`,"--dg-node-stroke":`#ffffff`,"--dg-group-fill":`transparent`,"--dg-group-stroke":`#ffffff`,"--dg-text":`#ffffff`,"--dg-text-muted":`#55ffff`,"--dg-border":`#5555ff`,"--dg-edge":`#ffffff`,"--dg-edge-label-bg":`#0000aa`,"--dg-accent":`#ffff55`,"--dg-badge-bg":`#ffff55`,"--dg-badge-text":`#000000`,"--dg-ink":`#ffffff`,"--dg-table-header-bg":`#00aaaa`,"--dg-table-header-text":`#000000`,"--dg-table-border":`#ffffff`,"--dg-table-row-text":`#000000`,"--dg-table-type-text":`#0000aa`,"--dg-table-pk":`#000000`,"--dg-table-fk":`#0000aa`}}],fle=e=>bC.find(t=>t.id===e)??mC,xC=e=>bC.some(t=>t.id===e);function ple(e){return[`dg-canvas`,e.chromeless&&`dg-no-chrome`,e.editing&&`dg-mode-edit`,!e.editing&&e.altHeld&&`dg-alt-move`,e.dragging&&`dg-dragging`,e.preset.id!==`clean`&&`dg-style-${e.preset.id}`,e.preset.rough!==void 0&&`dg-style-rough`,e.preset.fontFamily!==void 0&&`dg-style-font`,e.notationClass,e.penActive&&`dg-tool-pen`,e.eraserActive&&`dg-tool-eraser`,e.laserOn&&`dg-tool-laser`].filter(e=>typeof e==`string`).join(` `)}function mle(e){return{width:`100%`,height:`100%`,"--dg-style-font":e.fontFamily,...e.cssVars??{}}}function SC(e,t){return t===void 0?e.grid===`none`?null:e.grid===`lines`?{variant:g_.Lines,gap:32}:{}:{gap:t,className:`dg-grid-on`}}var CC=([,e])=>()=>e(e=>!e);function hle(e){let{dim:t,laser:n,drawings:r,legend:i,loops:a}=e;return[{key:`dim`,on:t[0],offered:!0,flip:CC(t),className:`dg-focus-toggle${t[0]?``:` dg-focus-toggle-off`}`,title:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,label:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,glyph:`◎`},{key:`laser`,on:n[0],offered:!0,flip:CC(n),className:`dg-laser-toggle${n[0]?` dg-laser-toggle-on`:``}`,title:n[0]?`Laser pointer off`:`Laser pointer`,label:`Laser pointer`,glyph:`◉`},{key:`drawings`,on:r[0],offered:e.drawingsOffered,flip:CC(r),className:`dg-drawings-toggle${r[0]?``:` dg-drawings-toggle-off`}`,title:r[0]?`Hide drawings`:`Show drawings`,label:r[0]?`Hide drawings`:`Show drawings`,glyph:`✎`},{key:`legend`,on:i[0],offered:e.legendOffered,flip:CC(i),className:`dg-legend-toggle-btn${i[0]?``:` dg-legend-toggle-btn-off`}`,title:i[0]?`Hide legend`:`Show legend`,label:i[0]?`Hide legend`:`Show legend`,glyph:`▤`},{key:`loops`,on:a[0],offered:e.loopsOffered,flip:()=>{a[0]&&e.clearLoopHighlight(),a[1](e=>!e)},className:`dg-loop-toggle${a[0]?``:` dg-loop-toggle-off`}`,title:a[0]?`Hide loop badges`:`Show loop badges`,label:a[0]?`Hide loop badges`:`Show loop badges`,glyph:`↻`}]}var wC=(e,t)=>e.find(e=>e.key===t);function TC(e){let t=t=>{let n=e.keyHints?.[t]??(t===`laser`&&e.builtinKeys!==!1?`L`:void 0);return n!==void 0&&n!==``?` (${n})`:``};return(0,D.jsxs)(E_,{children:[e.toggles.filter(e=>e.offered).map(e=>(0,D.jsx)(C_,{className:e.className,title:`${e.title}${t(e.key)}`,"aria-label":e.label,"aria-pressed":e.on,onClick:e.flip,children:e.glyph},e.key)),e.onToggleTheme!==void 0&&(0,D.jsx)(C_,{className:`dg-theme-toggle`,title:e.colorMode===`dark`?`Light theme`:`Dark theme`,"aria-label":e.colorMode===`dark`?`Switch to light theme`:`Switch to dark theme`,onClick:e.onToggleTheme,children:e.colorMode===`dark`?`☀`:`☾`})]})}var EC=48,DC=EC/2,OC=15,kC=`M ${DC} ${DC-OC} A ${OC} ${OC} 0 1 1 ${DC-OC} ${DC}`;function AC({placement:e,rough:t,active:n,dimmed:r,onSelect:i}){let a=(0,v.useMemo)(()=>t===void 0?null:Poe({x:DC,y:DC},OC*2,{style:t,seed:ab(e.key)}),[e.key,t]),o=e.kind===`unknown`?`?`:e.kind,s=e.kind!==`unknown`&&e.direction!==`none`,c=`dg-loop-arrow-${e.key.replace(/[^a-zA-Z0-9_-]/g,`_`)}`;return(0,D.jsx)(`div`,{className:`dg-loop-badge${n?` active`:``}${r?` dimmed`:``}`,"data-kind":e.kind,role:`button`,"aria-pressed":n,title:`Highlight this loop`,onClick:e=>{e.stopPropagation(),i?.()},style:{position:`absolute`,transform:`translate(${e.x-DC}px, ${e.y-DC}px)`,pointerEvents:`auto`},children:(0,D.jsxs)(`svg`,{width:EC,height:EC,viewBox:`0 0 ${EC} ${EC}`,"aria-hidden":`true`,children:[s&&(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:c,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--dg-text-muted)`})})}),a===null?(0,D.jsx)(`circle`,{className:`dg-loop-badge-circle`,cx:DC,cy:DC,r:OC}):(0,D.jsxs)(D.Fragment,{children:[a.fill===``?(0,D.jsx)(`circle`,{className:`dg-loop-badge-fill`,cx:DC,cy:DC,r:OC}):(0,D.jsx)(`path`,{className:`dg-loop-badge-fill`,d:a.fill}),(0,D.jsx)(`path`,{className:`dg-loop-badge-circle`,d:a.stroke})]}),s&&(0,D.jsx)(`path`,{className:`dg-loop-badge-arc`,d:kC,markerEnd:`url(#${c})`,style:e.direction===`ccw`?{transform:`scale(-1,1)`,transformOrigin:`${DC}px ${DC}px`}:void 0}),(0,D.jsx)(`text`,{x:DC,y:DC,textAnchor:`middle`,dominantBaseline:`central`,children:o})]})})}function gle({edges:e,rough:t,nodeFilter:n}){let{loops:r}=(0,v.useMemo)(()=>rC(e),[e]),i=(0,v.useMemo)(()=>n==null?r:r.filter(e=>e.nodes.includes(n)),[r,n]),a=(0,v.useMemo)(()=>new Map(i.map(e=>[e.key,e])),[i]),o=(0,v.useContext)(fv),s=f_(),c=(0,v.useMemo)(()=>cC(s),[s]),l=(0,v.useMemo)(()=>s.filter(e=>e.data.state!==`expanded`).map(e=>c.get(e.id)).filter(e=>e!==void 0),[s,c]);return(0,D.jsx)(u_,{children:(0,D.jsx)(`div`,{className:`dg-loop-layer`,children:(0,v.useMemo)(()=>nle(i,c,{obstacles:l,labelRadius:DC,minLabelGap:56}),[i,c,l]).map(e=>{let n=a.get(e.key);return(0,D.jsx)(AC,{placement:e,rough:t,active:o.activeKey===e.key,dimmed:o.active&&o.activeKey!==e.key,onSelect:n===void 0?void 0:()=>o.toggle(e.key,n.nodes,n.edgeIds)},e.key)})})})}var _le=4;function vle({model:e,plane:t}){let n=f_(),r=(0,v.useMemo)(()=>cC(n),[n]);return(0,D.jsx)(u_,{children:(0,D.jsx)(`svg`,{className:`dg-git-lanes`,"aria-hidden":`true`,children:(0,v.useMemo)(()=>{let n=Ac(e,t),i=Mc(e,t),{MARGIN:a,LABEL_W:o}=Dc,s=[];for(let t of n.lanes){let c=Xn(n,t.id),l=r.get(t.id);if(c===void 0||l===void 0||eee(e,c.id))continue;let u=r.get(c.id);if(u===void 0)continue;let d=u.x+u.width+_le,f=l.x+l.width-a-o;f<=d||s.push({id:t.id,x1:d,x2:f,y:u.y+u.height/2,color:i.get(t.id)})}return s},[e,t,r]).map(e=>(0,D.jsx)(`line`,{className:`dg-git-tail`,x1:e.x1,y1:e.y,x2:e.x2,y2:e.y,stroke:e.color??`var(--dg-edge)`},e.id))})})}var jC=8,yle=[`th`,`st`,`nd`,`rd`];function MC(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:yle[e%10]??`th`}`}var NC=(e,t)=>e===0?t>1?`Decisions`:`Decision`:`${MC(e)} order`;function PC(e,t,n){let r=n===`DOWN`||n===`UP`,i=new Map,a=1/0,o=-1/0;for(let[n,s]of t){let t=e.get(n);if(t===void 0)continue;let c=r?t.y:t.x,l=r?t.y+t.height:t.x+t.width,u=i.get(s);i.set(s,u===void 0?{lo:c,hi:l}:{lo:Math.min(u.lo,c),hi:Math.max(u.hi,l)}),a=Math.min(a,r?t.x:t.y),o=Math.max(o,r?t.x+t.width:t.y+t.height)}let s=a-20-(r?96:28),c=o+20-s;return[...i.entries()].sort(([e],[t])=>e-t).map(([e,{lo:t,hi:n}])=>{let i=t-20,a=n-t+40,o=r?{x:s,y:i,width:c,height:a}:{x:i,y:s,width:a,height:c};return{order:e,...o,header:{x:o.x+jC,y:o.y+jC}}})}function FC({model:e,direction:t}){let n=f_(),r=(0,v.useMemo)(()=>ci(e).orders,[e]),i=(0,v.useMemo)(()=>e.nodes.filter(e=>e.type===`so-decision`&&r.get(e.id)===0).length,[e,r]),a=(0,v.useMemo)(()=>PC(cC(n),r,t),[n,r,t]);return a.length===0?null:(0,D.jsx)(u_,{children:(0,D.jsx)(`svg`,{className:`dg-order-bands`,"aria-hidden":`true`,children:a.map((e,t)=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`rect`,{className:`dg-order-band${t%2==1?` dg-order-band-alt`:``}`,x:e.x,y:e.y,width:e.width,height:e.height,rx:6}),(0,D.jsx)(`text`,{className:`dg-order-band-header`,x:e.header.x,y:e.header.y,dominantBaseline:`hanging`,children:NC(e.order,i)})]},e.order))})})}var IC=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],LC=3,RC=e=>((e+4)%7+7)%7,zC=e=>Number(Hr(e).slice(0,4)),BC=e=>Number(Hr(e).slice(5,7))-1,VC=e=>Date.parse(`${e}T00:00:00Z`)/864e5;function HC(e){let t=e+(3-(RC(e)+6)%7),n=zC(t),r=VC(`${String(n)}-01-04`),i=r-(RC(r)+6)%7;return Math.floor((t-i)/7)+1}var UC=e=>{let t=zC(e),n=BC(e);return VC(n===11?`${String(t+1)}-01-01`:`${String(t)}-${String(n+2).padStart(2,`0`)}-01`)};function WC(e,t){let n=e.start-7,r=e.end+8,i=e=>Fs(e,t),a=[];for(let e=n;e<r;e=UC(e)){let t=Math.min(UC(e),r);a.push({x:i(e),width:i(t)-i(e),label:`${IC[BC(e)]} ${String(zC(e))}`})}let o=[];for(let e=n;e<r;){let t=e+((8-RC(e))%7||7),n=Math.min(t,r),a=n-e;o.push({x:i(e),width:a*js.DAY,label:a>=LC?`W${String(HC(e)).padStart(2,`0`)}`:``}),e=n}return{x0:i(n),x1:i(r),months:a,weeks:o}}function ble(e=new Date){let t=e=>String(e).padStart(2,`0`);return`${String(e.getFullYear())}-${t(e.getMonth()+1)}-${t(e.getDate())}`}var GC=js.HEADER_H/2;function xle({model:e,plane:t,today:n}){let r=f_(),i=(0,v.useMemo)(()=>cC(r),[r]),a=Ps(e,t),o=(0,v.useMemo)(()=>a.range!==void 0&&a.origin!==void 0?WC(a.range,a.origin):void 0,[a]);if(o===void 0||a.origin===void 0||a.range===void 0)return null;let{DAY:s,HEADER_H:c,PAD:l}=js,u=a.origin,d=0;for(let e of i.values())d=Math.max(d,e.y+e.height);d+=l;let f=new Map(e.nodes.map(e=>[e.id,e])),p=a.events.filter(e=>!a.parent.has(e)&&Ir(f.get(e))),m=n==null?void 0:Vr(n),h=m!==void 0&&m>=a.range.start-7&&m<a.range.end+8?Fs(m,u)+s/2:void 0;return(0,D.jsx)(u_,{children:(0,D.jsxs)(`svg`,{className:`dg-time-axis`,"aria-hidden":`true`,children:[(0,D.jsx)(`rect`,{className:`dg-time-axis-frame`,x:o.x0,y:-c,width:o.x1-o.x0,height:c}),o.months.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-c,x2:e.x,y2:0}),(0,D.jsx)(`text`,{className:`dg-time-axis-month`,x:e.x+6,y:-c+GC/2,dominantBaseline:`middle`,children:e.label})]},e.x)),o.weeks.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-GC,x2:e.x,y2:0}),(0,D.jsx)(`line`,{className:`dg-time-axis-grid`,x1:e.x,y1:0,x2:e.x,y2:d}),e.label!==``&&(0,D.jsx)(`text`,{className:`dg-time-axis-week`,x:e.x+4,y:-GC/2,dominantBaseline:`middle`,children:e.label})]},e.x)),p.map(e=>{let t=Wr(f.get(e));if(t===void 0)return null;let n=Fs(t,u)+s/2;return(0,D.jsx)(`line`,{className:`dg-time-axis-event`,x1:n,y1:0,x2:n,y2:d},e)}),h!==void 0&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-today`,x1:h,y1:-GC,x2:h,y2:d}),(0,D.jsx)(`text`,{className:`dg-time-axis-today-label`,x:h+4,y:-GC/2,dominantBaseline:`middle`,children:`today`})]})]})})}function Sle(e){return e.placed?(0,D.jsxs)(D.Fragment,{children:[e.loopEdges!==null&&(0,D.jsx)(gle,{edges:e.loopEdges,rough:e.rough,nodeFilter:e.loopNodeFilter}),e.overlay===`git-lanes`&&(0,D.jsx)(vle,{model:e.model,plane:e.plane}),e.overlay===`order-bands`&&(0,D.jsx)(FC,{model:e.model,direction:e.flowDirection}),e.overlay===`time-axis`&&(0,D.jsx)(xle,{model:e.model,plane:e.plane,today:e.today})]}):null}var Cle=()=>typeof document.elementsFromPoint==`function`?document.elementsFromPoint.bind(document):void 0;function wle(e,t=Cle()){if(t===void 0)return null;let{target:n}=e;if(!(n instanceof Element)||n.closest(`.react-flow__edge`)===null)return null;for(let n of t(e.clientX,e.clientY)){if(!(n instanceof HTMLElement)||n.closest(`.react-flow__node`)===null)continue;let e=n.closest(`button, a`);if(e instanceof HTMLElement)return e}return null}function Tle(e){let t=wle(e);return t===null?!1:(e.stopPropagation(),e.preventDefault(),t.click(),!0)}var Ele=(e,t)=>e.map(e=>e.selected===!0==(e.id===t)?e:{...e,selected:e.id===t}),Dle=e=>e.map(e=>e.selected===!0?{...e,selected:!1}:e),KC=(e,t)=>e.map(e=>{let n=e.data.dropTarget===!0,r=e.id===t;return n===r?e:{...e,data:{...e.data,dropTarget:r}}}),Ole=500,qC=40;function kle(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),n=(e,t)=>e!==null&&Date.now()-e.at<Ole&&Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)<qC,r=(e,t,n)=>{e.current={id:t,clientX:n.clientX,clientY:n.clientY,at:Date.now()}};return{recordNodeClick:(t,n)=>r(e,t,n),clearNodeClick:()=>{e.current=null},consumeNodeDrill:(t,r,i)=>{let a=e.current;return a!==null&&a.id===t&&i>=2&&n(a,r)?(e.current=null,!0):!1},takePaneNodeDrill:(t,r)=>{let i=e.current;return i!==null&&r>=2&&n(i,t)?(e.current=null,i.id):null},recordEdgeClick:(e,n)=>r(t,e,n),clearEdgeClick:()=>{t.current=null},consumeEdgeAdd:(e,r)=>{let i=t.current;return i!==null&&i.id===e&&n(i,r)?(t.current=null,!0):!1},takePaneEdgeAdd:e=>{let r=t.current;return r!==null&&n(r,e)?(t.current=null,r.id):null},clearAll:()=>{e.current=null,t.current=null}}}function Ale(e){let{props:t,editing:n,edit:r,reactFlow:i,compiled:a,enterNode:o,setLabelEdit:s}=e,{selectOnAppearRef:c,setFixedSideRelation:l,setAddLabelAt:u,setSelectedNode:d,loopHighlight:f}=e,p=(0,v.useRef)(null),m=kle(),h=(e,t)=>{let n=i.screenToFlowPosition({x:t.clientX,y:t.clientY});u({edgeId:e,x:n.x,y:n.y})},g=(0,v.useRef)(t.onMultiSelect);g.current=t.onMultiSelect;let _=(0,v.useRef)([]),y=(0,v.useCallback)(({nodes:e})=>{let t=e.map(e=>e.id),n=_.current;t.length===n.length&&t.every((e,t)=>e===n[t])||(_.current=t,c.current=null,g.current?.(t))},[]);return{onNodeClick:(r,i)=>{if(l(null),m.clearEdgeClick(),i.type===`note`){m.clearNodeClick(),jle(e,i);return}let s=a.externals?.get(i.id);if(s!==void 0){m.clearNodeClick(),o(s);return}if(!n&&(r.ctrlKey||r.metaKey)&&t.onCompareSelect!==void 0){m.clearNodeClick(),t.onCompareSelect(i.id);return}d(i.id),t.onSelect?.({kind:`node`,id:i.id}),n||r.shiftKey?m.clearNodeClick():m.consumeNodeDrill(i.id,r,r.detail)?o(i.id):m.recordNodeClick(i.id,r)},onNodeDoubleClick:(e,t)=>{n&&t.type!==`note`&&s({kind:`node`,id:t.id})},onReconnectStart:(e,t,n)=>{p.current=n},onReconnect:(t,n)=>Mle(e,p.current,t,n),onReconnectEnd:()=>{p.current=null},onConnect:e=>{e.source!==null&&e.target!==null&&r?.onConnect?.(e.source,e.target,e.sourceHandle,e.targetHandle)},onEdgeClick:(e,r)=>{let i=a.edges.find(e=>e.id===r.id),o=i===void 0?void 0:Ro(i)?.id;l(n&&o!==void 0?o:null),d(null),m.clearNodeClick(),t.onSelect?.({kind:`edge`,id:r.id,constituentIds:i?.constituents.map(e=>e.id)}),n&&o!==void 0?m.consumeEdgeAdd(r.id,e)?h(r.id,e):m.recordEdgeClick(r.id,e):m.clearEdgeClick()},onPaneClick:r=>{if(n){let e=m.takePaneEdgeAdd(r);if(e!==null){h(e,r);return}}let i=n?null:m.takePaneNodeDrill(r,r.detail);if(i!==null){o(i);return}r.detail===2?Nle(e,r):(l(null),m.clearAll(),d(null),t.onSelect?.(null),f.clear())},deleteKeyCode:n&&r?.onDeleteSelection!==void 0?[`Backspace`,`Delete`]:null,onDelete:t=>JC(e,t),onSelectionChange:y}}function jle(e,t){let{props:n,editing:r,compiled:i,setRfNodes:a,setFixedSideRelation:o,setSelectedNode:s}=e,c=t.data.target;if(Rt(c)){s(c.node),a(e=>Ele(e,c.node)),n.onSelect?.({kind:`node`,id:c.node});return}let l=i.edges.find(e=>Ro(e)?.id===c.relation);l!==void 0&&(r&&o(c.relation),s(null),a(Dle),n.onSelect?.({kind:`edge`,id:l.id,constituentIds:[c.relation]}))}function Mle(e,t,n,r){let{editing:i,edit:a,compiled:o}=e;if(!i||r.source===null||r.target===null)return;let s=o.edges.find(e=>e.id===n.id),c=s===void 0?void 0:Ro(s);if(c===void 0)return;let l=noe(t,{source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle},c);a?.onReconnect?.(c.id,r.source,r.target,l)}function Nle(e,t){let{editing:n,edit:r,reactFlow:i,setLabelEdit:a}=e;if(n&&r?.onCreateAt!==void 0){let e=r.onCreateAt(i.screenToFlowPosition({x:t.clientX,y:t.clientY}));typeof e==`string`&&a({kind:`node`,id:e})}else i.fitView({padding:.1,duration:500})}function JC(e,{nodes:t,edges:n}){let r=t.map(e=>e.id),i=n.filter(e=>e.selected===!0).flatMap(t=>e.compiled.edges.find(e=>e.id===t.id)?.constituents.map(e=>e.id)??[]);(r.length>0||i.length>0)&&e.edit?.onDeleteSelection?.({nodeIds:r,relationIds:i})}var YC=e=>()=>e.offered?(e.flip(),!0):!1;function XC(e){let{reactFlow:t,toggles:n}=e,{canArrange:r,selectedIds:i,alignSelection:a,distributeSelection:o}=e.arrange,s={toggleLaser:YC(wC(n,`laser`)),toggleDim:YC(wC(n,`dim`)),toggleLegend:YC(wC(n,`legend`)),toggleDrawings:YC(wC(n,`drawings`)),toggleLoops:YC(wC(n,`loops`)),zoomIn:()=>(t.zoomIn(),!0),zoomOut:()=>(t.zoomOut(),!0),fitView:()=>{let n=e.layoutApiRef?.current;return n==null?t.fitView():n.fitView(),!0},align:e=>!r||i.length<2?!1:(a(e),!0),distribute:e=>!r||i.length<3?!1:(o(e),!0)};return(0,v.useEffect)(()=>{let t=e.canvasCommandsRef;if(t!==void 0)return t.current=s,()=>{t.current=null}}),s}var Ple=new Map,ZC=.5;function QC(e,t,n,r=()=>!1){let i,a,o=t=>(i??e).get(t),s=(t,n)=>{i??=new Map(e),i.set(t,n)},c=e=>{if(e.children.forEach(c),e.state!==`expanded`||r(e))return;let t=o(e.id);if(t===void 0)return;let i=e.children.map(e=>o(e.id)).filter(e=>e!==void 0);if(i.length===0)return;let l=n(e),u=Math.min(...i.map(e=>e.x))-l.left,d=Math.min(...i.map(e=>e.y))-l.top,f=u<-.5?u:0,p=d<-.5?d:0;if(f!==0||p!==0){for(let t of e.children){let e=o(t.id);e!==void 0&&s(t.id,{...e,x:e.x-f,y:e.y-p})}(a??=new Map).set(e.id,{dx:f,dy:p})}let m=(e,t)=>t>e+ZC?t:e,h=m(t.width-f,Math.max(...i.map(e=>e.x+e.width))-f+l.right),g=m(t.height-p,Math.max(...i.map(e=>e.y+e.height))-p+l.bottom);(f!==0||p!==0||h!==t.width||g!==t.height)&&s(e.id,{...t,x:t.x+f,y:t.y+p,width:h,height:g})};return t.forEach(c),{geometry:i??e,shifts:a??Ple}}function $C(e,t,n,r){return{x:e.x+(t.x-n.x)-(r?.dx??0),y:e.y+(t.y-n.y)-(r?.dy??0)}}var Fle={x:0,y:0};function Ile(e,t,{bases:n,shifts:r},i=()=>!1){let a=new Map(t.map(e=>[e.id,e])),o=e=>{let t=e===void 0?void 0:a.get(e);if(t===void 0)return Fle;let n=o(t.parentId);return{x:n.x+t.position.x,y:n.y+t.position.y}},s={};for(let[t,c]of Object.entries(e)){let e=a.get(t)?.parentId,l=o(e),u=$C(c,l,(e===void 0?void 0:n.get(e))??l,r.get(t));s[t]=e!==void 0&&i(e)?{x:Math.max(0,u.x),y:Math.max(0,u.y)}:u}return s}function Lle(e){let{editing:t,edit:n,rfNodesRef:r,containerBasesRef:i,containerShiftsRef:a,arrangedRef:o,setViewPositions:s}=e;return(0,v.useCallback)(e=>{if(Object.keys(e).length===0)return;let c=e=>r.current.find(t=>t.id===e)?.data?.typeId,l=Ile(e,r.current,{bases:i.current,shifts:a.current},e=>De(c(e))),u=o.current,d=Object.fromEntries(Object.entries(l).map(([e,t])=>{let n=u?.get(e);return[e,n===void 0?{dx:0,dy:0}:{dx:t.x-n.x,dy:t.y-n.y}]}));if(t)if(n?.onNodesMoved!==void 0)n.onNodesMoved(l,d);else for(let[e,t]of Object.entries(l))n?.onNodeMoved?.(e,t);else s(e=>({...e,...l}))},[t,n])}function Rle(e,t,n){return t.node?.alwaysExpanded?.(e)===!0||e.type!==void 0&&n.resolve(e.type).alwaysExpanded===!0}function zle(e){let t=(0,v.useMemo)(()=>Nl(e.notation),[e.notation]),n=(0,v.useMemo)(()=>e.typeRegistry??Zs(t.typeStyles),[e.typeRegistry,t]);return{profile:t,typeRegistry:n,kindRegistry:(0,v.useMemo)(()=>e.kindRegistry??Qs(t.kindStyles),[e.kindRegistry,t]),isAlwaysExpanded:(0,v.useCallback)(r=>{let i=e.model.nodes.find(e=>e.id===r);return i!==void 0&&Rle(i,t,n)},[e.model.nodes,t,n]),nodeColors:(0,v.useMemo)(()=>t.node?.colorOf?.(e.model,e.plane),[t,e.model,e.plane]),nodeChips:(0,v.useMemo)(()=>t.node?.chips?.(e.model,e.plane),[t,e.model,e.plane])}}function ew(e){let{props:t,profile:n,typeRegistry:r,focus:i,drillRoot:a,visibleRef:o}=e,s=(0,v.useMemo)(()=>{let e=t.model.nodes.filter(e=>Rle(e,n,r));if(e.length===0)return t.pins;let i={...t.pins??{}};for(let t of e)i[t.id]=`expanded`;return i},[n,t.pins,t.model.nodes,r]),c=(0,v.useMemo)(()=>{let e=Jo(t.model,{focus:a===void 0?i:void 0,pins:s,activeLayers:t.activeLayers,plane:t.plane,root:a}),r=n.edge?.hidden;return r===void 0||!e.edges.some(e=>r(e.kind))?e:{...e,edges:e.edges.filter(e=>!r(e.kind))}},[t.model,t.plane,i,a,s,t.activeLayers,n]),l=(0,v.useRef)(c);return l.current=c,(0,v.useEffect)(()=>{let e=[],t=n=>{e.push(n.id),n.children.forEach(t)};c.roots.forEach(t),o.current=e},[c]),{compiled:c,compiledRef:l}}function Ble(e,t,n=[]){if(!e.has(t))return[];let r=new Set(n),i=[t],a=new Set([t]),o=t;for(;;){let t=e.get(o)??[],n=t.find(e=>r.has(e))??t[0];if(n===void 0||a.has(n))break;i.unshift(n),a.add(n),o=n}return i}function tw(e,t){let n=e.indexOf(t);return n<0?[]:e.slice(0,n+1)}function nw(e,t,n){let r=Ln(e,t),i=new Set;for(let e of n){let t=[...r.parentsOf.get(e)??[]];for(;t.length>0;){let e=t.pop();e===void 0||i.has(e)||(i.add(e),t.push(...r.parentsOf.get(e)??[]))}}return[...i]}function rw(e,t){let n=new Set(t.nodes.map(e=>e.id)),r=e.findIndex(e=>!n.has(e));return r<0?e:e.slice(0,r)}function iw(e,t){let n=t.next;return e.seen.modelId===n.modelId?e.seen.plane===n.plane?e.seen.model===n.model?e.seen.enteredPathProp===n.enteredPathProp?{seen:n,transition:`none`}:{seen:n,transition:`entered-path`}:{seen:n,transition:`model-edit`}:{seen:n,transition:`plane-switch`}:{seen:n,transition:`model-switch`}}function aw(e){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(()=>e.enteredPathProp===void 0?[]:rw(e.enteredPathProp,e.model)),a=(0,v.useRef)([]);a.current=r;let{onEnteredPathChange:o}=e;(0,v.useEffect)(()=>{o?.(r)},[r,o]);let s=(0,v.useRef)(null),c=()=>({modelId:e.model.id,model:e.model,plane:e.plane,enteredPathProp:e.enteredPathProp}),[l,u]=(0,v.useReducer)(iw,void 0,()=>({seen:c(),transition:`none`})),d=r;if(l.seen.modelId===e.model.id?l.seen.plane===e.plane?l.seen.model!==e.model&&(u({type:`sync`,next:c()}),i(t=>rw(t,e.model)),d=rw(r,e.model)):(u({type:`sync`,next:c()}),n(nw(e.model,e.plane,e.visibleRef.current)),i([]),d=[],e.onPlaneSwitch()):(u({type:`sync`,next:c()}),e.visibleRef.current=[],n([]),i([]),d=[],s.current=`jump`),l.seen.enteredPathProp!==e.enteredPathProp&&(u({type:`sync`,next:c()}),e.enteredPathProp!==void 0)){let t=rw(e.enteredPathProp,e.model);(t.length!==d.length||t.some((e,t)=>e!==d[t]))&&(s.current??=`glide`,i(t),n([]))}let f=(0,v.useMemo)(()=>Ln(e.model,e.plane),[e.model,e.plane]),p=r.length>0?r[r.length-1]:void 0,{isAlwaysExpanded:m}=e;return{enteredPath:r,drillRoot:p,focus:t,enterNode:(0,v.useCallback)(e=>{if(m(e)||(f.childrenOf.get(e)?.length??0)===0)return;let t=Ble(f.parentsOf,e,a.current);t.length!==0&&(s.current=`glide`,i(t),n([]))},[f,m]),exitTo:e=>{let t=e===null?[]:tw(r,e);s.current=`glide`,i(t),n([])},pendingRootFitRef:s}}var ow=`note:`,sw=e=>e.startsWith(ow);function cw(e){let{abs:t,obstacles:n}=lw(e.compiled.roots,e.geometry);for(let t of e.compiled.edges){let r=Ro(t),i=r===void 0?void 0:e.badgeSpots.get(r.id);i!==void 0&&n.push(...Tx(i.line))}let r=[...Vle(e.compiled.roots,t,e.typeRegistry),...Hle(e.compiled.edges,t,e.badgeSpots,e.nameOf)],i=[];for(let a of r){let r=Ule(a,e,{abs:t,obstacles:n});r!==void 0&&i.push(r)}return i}function lw(e,t){let n=new Map,r=[],i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c={x:s.x+a,y:s.y+o,width:s.width,height:s.height};n.set(e.id,c),r.push(...wx([{rect:c,kind:e.state===`expanded`?`group`:`box`}])),e.children.forEach(e=>i(e,s.x+a,s.y+o))};return e.forEach(e=>i(e,0,0)),{abs:n,obstacles:r}}function Vle(e,t,n){let r=e=>e.state===`expanded`?`group`:(e.node.type===void 0?void 0:n.resolve(e.node.type).shape)===`ellipse`?`ellipse`:`box`,i=[],a=(e,n)=>{let o=t.get(e.id);o!==void 0&&(e.external===void 0&&tn(e.node)&&i.push({target:{node:e.id},name:e.node.name,threats:e.node.threats??[],comments:e.node.comments??[],links:e.node.links??[],badge:Cx(o,r(e)),element:o,parentId:n}),e.children.forEach(t=>a(t,e.id)))};return e.forEach(e=>a(e)),i}function Hle(e,t,n,r){let i=[];for(let a of e){let e=Ro(a);if(e===void 0||!tn(e))continue;let o=t.get(a.from),s=t.get(a.to);if(o===void 0||s===void 0)continue;let c=n.get(e.id),l=c?.at??{x:(o.x+o.width/2+s.x+s.width/2)/2,y:(o.y+o.height/2+s.y+s.height/2)/2},u=e.label!==void 0&&e.label!==``?` (${e.label})`:``;i.push({target:{relation:e.id},name:`${r.get(e.from)??e.from} → ${r.get(e.to)??e.to}${u}`,threats:e.threats??[],comments:e.comments??[],links:[],badge:l,element:null,away:c?.away})}return i}function Ule(e,t,n){let{target:r,name:i,threats:a,comments:o,links:s,badge:c,element:l,parentId:u,away:d}=e,f=zt(r);if(!t.open.has(f))return;let{editing:p}=t,m=p&&(a.length>0||t.offersThreats),h={width:220,height:Bse({name:i,threats:a,comments:o,links:s},m)},g=t.placements?.[f],_=g!==void 0&&(g.dx!==0||g.dy!==0)?{x:c.x+g.dx,y:c.y+g.dy}:Dx({badge:c,element:l,size:h,away:d},n.obstacles);n.obstacles.push({..._,...h});let v=(u===void 0?void 0:n.abs.get(u))??{x:0,y:0},y={target:r,name:i,threats:a,comments:o,links:s,anchor:{x:c.x-v.x,y:c.y-v.y},badge:c,editing:p,editingId:t.editingRow!==null&&t.editingRow.key===f?t.editingRow.id:void 0,onAddThreat:m?t.onAddThreat:void 0,onRetitleThreat:p?t.onRetitleThreat:void 0,onSetThreatStatus:p?t.onSetThreatStatus:void 0,onEditThreatText:p?t.onEditThreatText:void 0,onOpenLink:t.onOpenLink,onEndEdit:t.onEndEdit};return Hx({id:ow+f,position:{x:_.x-v.x,y:_.y-v.y},data:y,parentId:u,draggable:p})}var Wle=`application/x-dg-library-entry`,Gle=[`framework`,`language`,`tool`],uw=e=>[...e??[]].filter(e=>e.type.startsWith(`image/`)),Kle=e=>document.elementFromPoint(e.clientX,e.clientY)?.closest(`.react-flow__node`)?.getAttribute(`data-id`)??void 0;function dw(e){let{editing:t,edit:n,reactFlow:r,wrapperRef:i}=e,a=n?.onImageFiles;return(0,v.useEffect)(()=>{if(!t||a===void 0)return;let e=e=>{let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`)return;let n=uw(e.clipboardData?.files);if(n.length===0)return;e.preventDefault();let o=i.current?.getBoundingClientRect(),s=o===void 0?void 0:r.screenToFlowPosition({x:o.left+o.width/2,y:o.top+o.height/2});a(n,s)};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[t,a,r]),{onDragOver:e=>{if(!t)return;let r=n?.onDropLibraryEntry!==void 0&&e.dataTransfer.types.includes(`application/x-dg-library-entry`);(n?.onImageFiles!==void 0||r)&&e.preventDefault()},onDrop:e=>{if(!t)return;let i=n?.onDropLibraryEntry!==void 0&&typeof e.dataTransfer?.getData==`function`?e.dataTransfer.getData(Wle):``;if(i!==void 0&&i!==``){e.preventDefault();let t=Kle(e),a=t!==void 0&&sw(t)?void 0:t;n?.onDropLibraryEntry?.(i,r.screenToFlowPosition({x:e.clientX,y:e.clientY}),a);return}if(n?.onImageFiles===void 0)return;e.preventDefault();let a=uw(e.dataTransfer?.files);a.length!==0&&n.onImageFiles(a,r.screenToFlowPosition({x:e.clientX,y:e.clientY}))}}}function qle(e){let{editing:t,edit:n,derivedNodes:r,setLabelEdit:i,setNoteEdit:a,setRfNodes:o,selectOnAppearRef:s}=e,c=n?.editLabelRequest,l=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{!t||c===void 0||c.nonce===l.current||(l.current=c.nonce,i({kind:`node`,id:c.id}),r.some(e=>e.id===c.id)?o(e=>Ele(e,c.id)):s.current=c.id)},[c?.nonce]);let u=n?.editThreatRequest,d=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{!t||u===void 0||u.nonce===d.current||(d.current=u.nonce,a({key:zt(u.target),id:u.id}))},[u?.nonce])}function Jle(e,t){let n=new Map(Object.entries(t.nodes)),r=new Map;for(let t of e.containment)r.set(t.child,[...r.get(t.child)??[],t.parent]);let i=(e,t)=>{for(let a of r.get(e)??[])t.has(a)||(t.add(a),n.has(a)||n.set(a,`inside`),i(a,t))};for(let e of Object.keys(t.nodes))i(e,new Set([e]));for(let n of e.relations)if(t.relations[n.id]!==void 0)for(let e of[n.from,n.to])i(e,new Set([e]));return n}function fw(e,t){let n=e.map(e=>t.relations[e.id]);if(n.every(e=>e===void 0))return;let r=n[0];return n.every(e=>e===r)?r:`changed`}function pw(e,t){return t===void 0?e:e===void 0?`dg-diff-${t}`:`${e} dg-diff-${t}`}function Yle(e){let{props:t,editing:n,edit:r,preset:i,compiled:a}=e,{profile:o,kindRegistry:s}=e.notation,{labelMoves:c,moveViewLabel:l}=e.moves,{placedGeometry:u,routing:d,routes:f,laidAt:p,labelSpots:m,flowDirection:h}=e.layout,[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=(0,v.useMemo)(()=>{let e=o.edge?.colorOf;if(e===void 0)return;let n=new Map;for(let r of a.edges){let i=e(r,t.model,t.plane);i!==void 0&&n.set(r.id,i)}return n},[o,a,t.model,t.plane]),S=(0,v.useCallback)(()=>b(null),[]),C=(0,v.useMemo)(()=>Sb(a.edges),[a]),w=(0,v.useMemo)(()=>ub(a.edges),[a]),T=(0,v.useMemo)(()=>({kindRegistry:s,editing:n,onAddEdgeLabel:r?.onAddEdgeLabel,onEditEdgeLabel:r?.onEditEdgeLabel,onMoveEdgeLabel:r?.onMoveEdgeLabel,onSetEdgeSide:r?.onSetEdgeSide,onAddThreat:r?.onAddThreat,fixedSideRelation:g,pendingAdd:y,onPendingAddConsumed:S,stylePreset:i.rough===void 0?void 0:i,edgeLook:i.edges,notation:t.notation,routing:d,routes:f,laidAt:p,labelSpots:m,labelMoves:c,onViewMoveEdgeLabel:!n&&t.onViewLabelMovesChange!==void 0?l:void 0,edgeColors:x,flowDirection:h,selfLoopIndex:C,parallelBow:w}),[s,n,r?.onAddEdgeLabel,r?.onEditEdgeLabel,r?.onMoveEdgeLabel,r?.onSetEdgeSide,r?.onAddThreat,g,y,S,i,t.notation,d,f,p,m,c,t.onViewLabelMovesChange,l,x,h,C,w]),{diffMarks:E}=t,ee=(0,v.useMemo)(()=>u===null?[]:a.edges.map(e=>{let t=qS(e,T),r=Ro(e),i=E===void 0?void 0:fw(e.constituents,E);return Xse({id:e.id,source:e.from,target:e.to,data:i===void 0?t:{...t,diff:i},reconnectable:n&&r!==void 0,className:pw(void 0,i)})}),[a,u,T,n,E]),[te,ne]=(0,v.useState)(()=>new Set);return{rfEdges:(0,v.useMemo)(()=>te.size===0?ee:ee.map(e=>te.has(e.id)?{...e,selected:!0}:e),[ee,te]),onEdgesChange:e=>{let t=e.filter(e=>e.type===`select`);t.length!==0&&ne(e=>{let n=new Set(e);for(let e of t)e.selected?n.add(e.id):n.delete(e.id);return n.size===e.size&&[...n].every(t=>e.has(t))?e:n})},setFixedSideRelation:_,setAddLabelAt:b}}function Xle(e,t,n,r){let i=r.fixed.has(e.id)&&r.profile.node?.draggableWhenFixed?.(e.node)!==!0;return{draggable:!i&&void 0,className:i&&r.editing?`nopan`:void 0,...Zle(e,n,r),...Qle(e,t,r)}}function Zle(e,t,n){return t===void 0||n.profile.node?.dropTarget!==void 0&&n.profile.node?.canDrop?.(e.node)===!0?{}:n.profile.layout===void 0?{expandParent:!0}:n.editing?{extent:`parent`}:{}}function Qle(e,t,n){return e.state===`expanded`?{style:{width:t.width,height:t.height},zIndex:-1}:e.node.type===`git-stage`?{style:{width:t.width,height:t.height},zIndex:-2}:(e.node.image!==void 0||e.node.shape!==void 0)&&e.state===`leaf`||e.state===`leaf`&&e.node.type!==void 0&&mw(e.node.type,n)?{style:{width:t.width,height:t.height}}:n.profile.layout===void 0&&!(n.profile.node?.typelessAsText===!0&&e.node.type===void 0)?{style:{minWidth:t.width}}:{}}function mw(e,t){return ec.has(t.typeRegistry.resolve(e).shape)||Ee(e)||tc.has(e)||t.profile.node?.isLane?.(e)===!0}function $le(e){let{props:t,editing:n,edit:r,compiled:i,labelEdit:a,preset:o,setLabelEdit:s}=e,{profile:c,typeRegistry:l,nodeColors:u,nodeChips:d}=e.notation,{arrangedGeometry:f,fixed:p,regionSeparators:m}=e.layout,h=(0,v.useCallback)(()=>s(null),[s]),g=(0,v.useMemo)(()=>({metaKeys:e.metaKeys,hiddenCounts:e.hiddenCounts,typeRegistry:l,icons:e.icons,typeColors:t.model.typeColors,onOpenLink:t.onOpenLink,onToggleExpand:t.onToggleExpand,onEnterNode:e.enterNode,editing:n,labelEditingId:a?.kind===`node`?a.id:void 0,endLabelEdit:h,onRenameNode:r?.onRenameNode,onSetNodeRich:r?.onSetNodeRich,assetBase:t.assetBase,libraryBase:t.libraryBase,onResize:r?.onResize,onSetTableColumns:r?.onSetTableColumns,quickAdd:r?.quickAdd,onSetRole:r?.onSetRole,onAddThreat:r?.onAddThreat,stylePreset:o.rough===void 0?void 0:o,notation:t.notation,nodeColors:u,hues:e.hues,nodeChips:d,resizable:c.node?.resizable,regionSeparators:m}),[e.metaKeys,e.hiddenCounts,l,e.icons,t.model.typeColors,t.onOpenLink,t.onToggleExpand,e.enterNode,n,a,h,r?.onRenameNode,r?.onSetNodeRich,t.assetBase,t.libraryBase,r?.onResize,r?.onSetTableColumns,r?.quickAdd,r?.onSetRole,r?.onAddThreat,o,t.notation,u,e.hues,d,c,m]),_=(0,v.useMemo)(()=>{if(f===null)return[];let e=[],t={editing:n,profile:c,typeRegistry:l,fixed:p},r=(n,i)=>{let a=f.get(n.id);if(a===void 0)return;let o=KS(n,g);e.push(Yse({id:n.id,position:{x:a.x,y:a.y},data:o,parentId:i,...Xle(n,a,i,t)})),n.children.forEach(e=>r(e,n.id))};return i.roots.forEach(e=>r(e)),e},[i,f,g,n,l,c,p]),{diffMarks:y,model:b}=t,x=(0,v.useMemo)(()=>y===void 0?null:Jle(b,y),[y,b]),{noteNodes:S}=e,C=(0,v.useMemo)(()=>{let e=x===null?_:_.map(e=>{let t=x.get(e.id);if(t===void 0||t===`inside`&&e.data.state===`expanded`)return e;let n=pw(e.className,t);return n===void 0?e:{...e,className:n}});return S.length===0?e:[...e,...S]},[_,S,x]),w=(0,v.useRef)(C);w.current=C;let[T,E]=(0,v.useState)([]),ee=(0,v.useRef)([]);return ee.current=T,{derivedNodes:_,allNodes:C,allNodesRef:w,rfNodes:T,setRfNodes:E,rfNodesRef:ee}}function hw(e){let t=e.filter(e=>e!==void 0);if(t.length===0)return;let n=Math.min(...t.map(e=>e.x)),r=Math.min(...t.map(e=>e.y));return{x:n,y:r,width:Math.max(...t.map(e=>e.x+e.width))-n,height:Math.max(...t.map(e=>e.y+e.height))-r}}var eue=`.react-flow__edge, .react-flow__edgelabel-renderer > *, .dg-loop-badge, .dg-image-caption, .dg-order-band-header, .dg-time-axis-frame`;function gw(e,t){if(e==null)return;let n=[];for(let r of e.querySelectorAll(eue)){let e=r.getBoundingClientRect();if(e.width===0&&e.height===0)continue;let i=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});n.push({x:i.x,y:i.y,width:a.x-i.x,height:a.y-i.y})}return hw(n)}function _w(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var vw=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function yw(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function bw(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function xw(e){let t=bw(e,`border-left-width`),n=bw(e,`border-right-width`);return e.clientWidth+t+n}function N(e){let t=bw(e,`border-top-width`),n=bw(e,`border-bottom-width`);return e.clientHeight+t+n}function Sw(e,t={}){return{width:t.width||xw(e),height:t.height||N(e)}}function Cw(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var ww=16384;function tue(e){(e.width>ww||e.height>ww)&&(e.width>ww&&e.height>ww?e.width>e.height?(e.height*=ww/e.width,e.width=ww):(e.width*=ww/e.height,e.height=ww):e.width>ww?(e.height*=ww/e.width,e.width=ww):(e.width*=ww/e.height,e.height=ww))}function nue(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:`image/png`,t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(`,`)[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e+=1)a[e]=r.charCodeAt(e);n(new Blob([a],{type:t.type?t.type:`image/png`}))})}function Tw(e){return new Promise((t,n)=>{let r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function rue(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Ew(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),rue(i)}var Dw=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Dw(n,t)};function iue(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function aue(e){return yw(e).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function oue(e,t,n){let r=`.${e}:${t}`,i=n.cssText?iue(n):aue(n);return document.createTextNode(`${r}{${i}}`)}function Ow(e,t,n){let r=window.getComputedStyle(e,n),i=r.getPropertyValue(`content`);if(i===``||i===`none`)return;let a=vw();try{t.className=`${t.className} ${a}`}catch{return}let o=document.createElement(`style`);o.appendChild(oue(a,n,r)),t.appendChild(o)}function sue(e,t){Ow(e,t,`:before`),Ow(e,t,`:after`)}var kw=`application/font-woff`,Aw=`image/jpeg`,cue={woff:kw,woff2:kw,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:Aw,jpeg:Aw,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function jw(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function Mw(e){return cue[jw(e).toLowerCase()]||``}function lue(e){return e.split(/,/)[1]}function Nw(e){return e.search(/^(data:)/)!==-1}function uue(e,t){return`data:${t};base64,${e}`}async function due(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var Pw={};function fue(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function Fw(e,t,n){let r=fue(e,t,n.includeQueryParams);if(Pw[r]!=null)return Pw[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=uue(await due(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,lue(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return Pw[r]=i,i}async function pue(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):Tw(t)}async function Iw(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),Tw(t.toDataURL())}let n=e.poster;return Tw(await Fw(n,Mw(n),t))}async function mue(e){try{if(e?.contentDocument?.body)return await Vw(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function hue(e,t){return Dw(e,HTMLCanvasElement)?pue(e):Dw(e,HTMLVideoElement)?Iw(e,t):Dw(e,HTMLIFrameElement)?mue(e):e.cloneNode(!1)}var gue=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`;async function _ue(e,t,n){let r=[];return r=gue(e)&&e.assignedNodes?yw(e.assignedNodes()):Dw(e,HTMLIFrameElement)&&e.contentDocument?.body?yw(e.contentDocument.body.childNodes):yw((e.shadowRoot??e).childNodes),r.length===0||Dw(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>Vw(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function Lw(e,t){let n=t.style;if(!n)return;let r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):yw(r).forEach(i=>{let a=r.getPropertyValue(i);i===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Dw(e,HTMLIFrameElement)&&i===`display`&&a===`inline`&&(a=`block`),i===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function Rw(e,t){Dw(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Dw(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function zw(e,t){if(Dw(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function vue(e,t){return Dw(t,Element)&&(Lw(e,t),sue(e,t),Rw(e,t),zw(e,t)),t}async function Bw(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await Vw(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function Vw(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>hue(e,t)).then(n=>_ue(e,n,t)).then(t=>vue(e,t)).then(e=>Bw(e,t))}var Hw=/url\((['"]?)([^'"]+?)\1\)/g,yue=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bue=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Uw(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function xue(e){let t=[];return e.replace(Hw,(e,n,r)=>(t.push(r),e)),t.filter(e=>!Nw(e))}async function Ww(e,t,n,r,i){try{let a=n?_w(t,n):t,o=Mw(t),s;return s=i?uue(await i(a),o):await Fw(a,o,r),e.replace(Uw(t),`$1${s}$3`)}catch{}return e}function Gw(e,{preferredFontFormat:t}){return t?e.replace(bue,e=>{for(;;){let[n,,r]=yue.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function Kw(e){return e.search(Hw)!==-1}async function qw(e,t,n){if(!Kw(e))return e;let r=Gw(e,n);return xue(r).reduce((e,r)=>e.then(e=>Ww(e,r,t,n)),Promise.resolve(r))}async function Jw(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await qw(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Yw(e,t){await Jw(`background`,e,t)||await Jw(`background-image`,e,t),await Jw(`mask`,e,t)||await Jw(`mask-image`,e,t)}async function Xw(e,t){let n=Dw(e,HTMLImageElement);if(!(n&&!Nw(e.src))&&!(Dw(e,SVGImageElement)&&!Nw(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await Fw(r,Mw(r),t);await new Promise((t,r)=>{e.onload=t,e.onerror=r;let a=e;a.decode&&=t,a.loading===`lazy`&&(a.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function Zw(e,t){let n=yw(e.childNodes).map(e=>Qw(e,t));await Promise.all(n).then(()=>e)}async function Qw(e,t){Dw(e,Element)&&(await Yw(e,t),await Xw(e,t),await Zw(e,t))}function $w(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var eT={};async function tT(e){let t=eT[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},eT[e]=t,t)}async function nT(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),due(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function Sue(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function Cue(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{yw(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=tT(o).then(e=>nT(e,t)).then(e=>Sue(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(tT(n.href).then(e=>nT(e,t)).then(e=>Sue(e).forEach(e=>{a.insertRule(e,n.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{yw(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function wue(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Kw(e.style.getPropertyValue(`src`)))}async function Tue(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return wue(await Cue(yw(e.ownerDocument.styleSheets),t))}async function rT(e,t){let n=await Tue(e,t);return(await Promise.all(n.map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return qw(e.cssText,n,t)}))).join(`
24
24
  `)}async function Eue(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await rT(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function Due(e,t={}){let{width:n,height:r}=Sw(e,t),i=await Vw(e,t,!0);return await Eue(i,t),await Qw(i,t),$w(i,t),await Ew(i,n,r)}async function Oue(e,t={}){let{width:n,height:r}=Sw(e,t),i=await Tw(await Due(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),s=t.pixelRatio||Cw(),c=t.canvasWidth||n,l=t.canvasHeight||r;return a.width=c*s,a.height=l*s,t.skipAutoScale||tue(a),a.style.width=`${c}`,a.style.height=`${l}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function iT(e,t={}){return await nue(await Oue(e,t))}var kue=12e3;function Aue(e,t={}){let n=t.padding??32,r=Math.ceil(e.width+2*n),i=Math.ceil(e.height+2*n),a=t.pixelRatio??2,o=Math.min(a,kue/Math.max(r,i,1));return{width:r,height:i,viewport:{x:n-e.x,y:n-e.y,zoom:1},pixelRatio:o}}var jue=[`react-flow__panel`,`react-flow__handle`,`react-flow__resize-control`,`react-flow__minimap`,`react-flow__background`,`dg-no-export`];function Mue(e){return e instanceof Element?!jue.some(t=>e.classList.contains(t)):!0}async function aT(e,t){let n=getComputedStyle(e),r=n.getPropertyValue(`--xy-background-color`).trim()||n.backgroundColor;return iT(e,{width:t.width,height:t.height,pixelRatio:t.pixelRatio,...r===``?{}:{backgroundColor:r},style:{width:`${t.width}px`,height:`${t.height}px`},filter:Mue})}var oT=.02,sT=1,cT=.35,lT=300;function Nue(e){let{layoutApiRef:t,reactFlow:n,rfNodesRef:r,compiledRef:i,geometryRef:a,wrapperRef:o,strokesRef:s,legendReserveRef:c}=e;(0,v.useEffect)(()=>{let e=t;if(e!==void 0)return e.current={snapshotPositions:()=>Object.fromEntries(r.current.filter(e=>!(i.current.externals?.has(e.id)??!1)&&!sw(e.id)).map(e=>[e.id,{x:e.position.x,y:e.position.y}])),autoPositions:()=>a.current===null?{}:Object.fromEntries([...a.current].map(([e,t])=>[e,{x:t.x,y:t.y}])),viewportCenter:()=>{let e=o.current?.getBoundingClientRect();return e===void 0?void 0:n.screenToFlowPosition({x:e.left+e.width/2,y:e.top+e.height/2})},nodeBounds:e=>{let t=n.getInternalNode(e);if(t!==void 0)return{...t.internals.positionAbsolute,width:t.measured.width??0,height:t.measured.height??0}},contentBounds:()=>{let e=n.getNodes();return hw([e.length===0?void 0:n.getNodesBounds(e),Gx(s.current),gw(o.current,e=>n.screenToFlowPosition(e,{snapToGrid:!1}))])},fitView:(t=.06)=>{let r=typeof t==`number`?t:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,`${t}px`])),i=e.current?.contentBounds(),a=o.current?.getBoundingClientRect();if(i!==void 0&&a!==void 0&&a.width>0&&a.height>0){n.setViewport(zm(i,a.width,a.height,oT,4,r));return}n.fitView({padding:r})},focusNodes:t=>{let r=t.map(t=>e.current?.nodeBounds(t)),i=o.current?.getBoundingClientRect();if(r.length===0||r.includes(void 0)||i===void 0||i.width<=0)return!1;let a=hw(r);if(a===void 0)return!1;let s=zm(a,i.width,i.height,oT,sT,cT);return n.setViewport(s,{duration:lT}),!0},legendReserve:()=>c.current,exportPng:async t=>{let r=o.current?.querySelector(`.react-flow`),i=e.current?.contentBounds();if(r==null||i===void 0)return null;let a=Aue(i,t),s=n.getViewport();await n.setViewport(a.viewport),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));try{return await aT(r,a)}finally{n.setViewport(s)}}},()=>{e.current=null}},[t,n])}function Pue(e,t,n){let r=(0,v.useRef)(t);r.current=t;let i=(0,v.useMemo)(()=>{let r=new Map;if(t===null)return r;let i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c=a+s.x,l=o+s.y;if(e.children.length===0)return;let u=n.get(e.id);r.set(e.id,{x:c-(u?.dx??0),y:l-(u?.dy??0)}),e.children.forEach(e=>i(e,c,l))};return e.roots.forEach(e=>i(e,0,0)),r},[e,t,n]),a=(0,v.useRef)(i);a.current=i;let o=(0,v.useRef)(n);return o.current=n,{arrangedRef:r,containerBasesRef:a,containerShiftsRef:o}}function Fue(e,t){let n=[],r={};for(let i of e){let e=t.get(i.id)??i.position;if(i.type!==`note`){r[i.id]=e;continue}let a=i.data;a.target===void 0||a.anchor===void 0||n.push({target:a.target,offset:{dx:Math.round(e.x-a.anchor.x),dy:Math.round(e.y-a.anchor.y)}})}return{notes:n,boxes:r}}function Iue(e,t,n){let r=[],i={};for(let a of e){if(!t(a))continue;r.push(a);let e=n(a);e!==void 0&&(i[a]=e)}return{skip:r,resets:i}}function Lue(e,t,n){let r=e=>e.data.typeId,i=e.find(e=>e.id===t),a=i?.parentId;if(!(i===void 0||a===void 0||r(i)!==`activity-lane`))return{frameId:a,offset:gS(e.filter(e=>e.parentId===a&&r(e)===`activity-lane`).flatMap(e=>{let t=n?.get(e.id);return t===void 0?[]:[{id:e.id,y:t.y,height:t.height}]}),t,i.position.y)}}var uT=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),dT=(e,t)=>t.size===0?e:Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e))),fT=e=>e.type===`dimensions`&&e.setAttributes===!0&&e.resizing===void 0;function pT(e,t){return t||!e.some(fT)?e:e.filter(e=>!fT(e)&&e.type!==`position`)}var mT={dx:0,dy:0,lines:[]};function hT(e,t,n){let r=(e,t)=>t===`x`?[e.x,e.x+e.w/2,e.x+e.w]:[e.y,e.y+e.h/2,e.y+e.h],i=i=>{let a=r(e,i),o;for(let s of t)if(s.id!==e.id)for(let e of r(s,i))for(let t of a){let r=e-t;Math.abs(r)<=n&&(o===void 0||Math.abs(r)<Math.abs(o.d))&&(o={d:r,at:e,other:s})}return o},a=i(`x`),o=i(`y`);if(a===void 0&&o===void 0)return mT;let s=a?.d??0,c=o?.d??0,l=[];return a!==void 0&&l.push({axis:`x`,at:a.at,from:Math.min(e.y+c,a.other.y),to:Math.max(e.y+c+e.h,a.other.y+a.other.h)}),o!==void 0&&l.push({axis:`y`,at:o.at,from:Math.min(e.x+s,o.other.x),to:Math.max(e.x+s+e.w,o.other.x+o.other.w)}),{dx:s,dy:c,lines:l}}var gT=e=>{if(e===void 0)return;let t=e.measured?.width??(typeof e.style?.width==`number`?e.style.width:void 0),n=e.measured?.height??(typeof e.style?.height==`number`?e.style.height:void 0);return t!==void 0&&n!==void 0?{width:t,height:n}:void 0};function Rue(e,t,n){let r={changes:e,lines:[]},i=e.filter(e=>e.type===`position`&&e.dragging===!0&&e.position!==void 0);if(i.length!==1)return r;let a=i[0],o=t.nodes.find(e=>e.id===a.id),s=gT(o);if(o===void 0||s===void 0||a.position===void 0)return r;let c=o.parentId===void 0?{x:0,y:0}:t.absoluteOf(o.parentId);if(c===void 0)return r;let l={id:o.id,x:c.x+a.position.x,y:c.y+a.position.y,w:s.width,h:s.height},u=[];for(let e of t.nodes){if(e.id===o.id||e.parentId!==o.parentId)continue;let n=gT(e),r=t.absoluteOf(e.id);n===void 0||r===void 0||u.push({id:e.id,x:r.x,y:r.y,w:n.width,h:n.height})}let d=hT(l,u,n);return d.lines.length===0?r:(a.position.x+=d.dx,a.position.y+=d.dy,a.positionAbsolute!==void 0&&(a.positionAbsolute.x+=d.dx,a.positionAbsolute.y+=d.dy),{changes:e,lines:d.lines})}function zue(e,t,n,r){let i=e=>e.type===`position`&&e.position!==void 0,a=r.current;if(a!==null){let t=e.find(e=>i(e)&&e.dragging!==!0&&e.id===a.id);if(t?.position!==void 0)return r.current=null,t.position.x===a.x&&t.position.y===a.y&&(t.position={x:a.x+a.dx,y:a.y+a.dy}),{changes:e,lines:[]}}let o=e.filter(e=>i(e)&&e.dragging===!0),s=o.length===1?{id:o[0].id,...o[0].position}:void 0,c=Rue(e,t,n),l=o.length===1?o[0].position:void 0;return r.current=s!==void 0&&l!==void 0&&c.lines.length>0?{...s,dx:l.x-s.x,dy:l.y-s.y}:null,c}function _T(e,t,n){let r;for(let i of t)n.has(i.id)||e.x<i.x||e.x>i.x+i.w||e.y<i.y||e.y>i.y+i.h||(r===void 0||i.w*i.h<r.w*r.h)&&(r=i);return r?.id}function vT(e,t,n){let r=new Set([t]),i=e.find(e=>e.id===t)?.parentId;i!==void 0&&r.add(i);let a=new Map;for(let t of e)t.parentId!==void 0&&a.set(t.parentId,[...a.get(t.parentId)??[],t.id]);let o=[...a.get(t)??[]];for(let e=0;e<o.length;e++){let t=o[e];r.has(t)||(r.add(t),o.push(...a.get(t)??[]))}for(let e of n)r.add(e);return r}var yT=e=>`clientX`in e?{x:e.clientX,y:e.clientY}:{x:e.touches[0]?.clientX??0,y:e.touches[0]?.clientY??0};function bT(e,t,n){let{model:r,profile:i,reactFlow:a}=e,o=i.node?.dropTarget;if(o===void 0)return;let s=r.nodes.find(e=>e.id===t);if(s===void 0||i.node?.canDrop?.(s)!==!0)return;let c=vT(e.rfNodesRef.current,t,i.related?.(r,e.plane,t)??[]),l=[];for(let e of r.nodes){if(!o(e))continue;let t=a.getInternalNode(e.id),n=t?.internals.positionAbsolute,r=t?.measured?.width,i=t?.measured?.height;n===void 0||r===void 0||i===void 0||l.push({id:e.id,x:n.x,y:n.y,w:r,h:i})}return _T(n,l,c)}function xT(e){let{editing:t,edit:n,model:r,profile:i,reactFlow:a,rfNodesRef:o,setRfNodes:s,commitMoves:c}=e,[l,u]=(0,v.useState)([]),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),m=(0,v.useRef)(!1),h=(0,v.useRef)(void 0),g=t&&n?.onDropInto!==void 0&&i.node?.dropTarget!==void 0,_=(t,n,r)=>{let i=r.length===1?bT(e,n.id,a.screenToFlowPosition(yT(t))):void 0;i!==h.current&&(h.current=i,s(e=>KC(e,i)))},y=e=>{let t=Object.entries(e).map(([e,t])=>({type:`position`,id:e,position:t}));o.current=ig(t,o.current),s(e=>ig(t,e))},b=(t,r)=>{if(n?.onDropInto===void 0||i.node?.dropTarget===void 0)return!1;let o=bT(e,t,a.screenToFlowPosition(yT(r))),s=o===void 0?void 0:a.getInternalNode(t)?.internals.positionAbsolute,c=o===void 0?void 0:a.getInternalNode(o)?.internals.positionAbsolute;return o===void 0||s===void 0||c===void 0?!1:(n.onDropInto(t,o,uT(s,c)),!0)},x=t=>e.allNodesRef.current.find(e=>e.id===t)?.position,S=e=>{let t=i.node?.snapsBack;return t===void 0?{skip:[],resets:{}}:Iue(e,e=>{let n=r.nodes.find(t=>t.id===e);return n!==void 0&&t(n)},x)},C=(t,r)=>{if(n?.onMoveLane===void 0)return!1;let i=Lue(o.current,t,e.arrangedRef.current);if(i===void 0)return!1;let a=x(t);return a!==void 0&&(r[t]=a),i.offset!==0&&n.onMoveLane(i.frameId,t,i.offset),!0},w=(e,t,r)=>{m.current=!1,p(!1),h.current!==void 0&&(h.current=void 0,o.current=KC(o.current,void 0),s(e=>KC(e,void 0)));let{notes:i,boxes:a}=Fue(r,new Map(o.current.map(e=>[e.id,e.position])));for(let e of i)n?.onNoteMoved?.(e.target,e.offset);let l=new Set,u=Object.keys(a);u.length===1&&b(u[0],e)&&l.add(u[0]);let{skip:d,resets:f}=S(u);for(let e of d)l.add(e);u.length===1&&C(u[0],f)&&l.add(u[0]),Object.keys(f).length>0&&y(f),c(dT(a,l))};return{guides:l,dragging:f,handlers:{onNodesChange:e=>{let t=zue(e,{nodes:o.current,absoluteOf:e=>a.getInternalNode(e)?.internals.positionAbsolute},8/a.getZoom(),d);u(e=>e.length===0&&t.lines.length===0?e:t.lines);let n=pT(t.changes,m.current).filter(e=>e.type!==`remove`);o.current=ig(n,o.current),s(e=>ig(n,e))},onNodeDragStart:()=>{e.flushNudge(),m.current=!0,p(!0)},...g?{onNodeDrag:_}:{},onNodeDragStop:w}}}function ST(e){let{allNodes:t,derivedNodes:n,setRfNodes:r,selectOnAppearRef:i,pendingRef:a}=e;(0,v.useLayoutEffect)(()=>{let e=i.current,o=e!==null&&n.some(t=>t.id===e)?e:null;o!==null&&(i.current=null),r(e=>{let n=o===null?new Set(e.filter(e=>e.selected===!0).map(e=>e.id)):new Set([o]),r=a.current;return n.size===0&&Object.keys(r).length===0?t:t.map(e=>{let t=r[e.id],i=n.has(e.id);return!i&&t===void 0?e:{...e,...i?{selected:!0}:{},...t===void 0?{}:{position:t}}})})},[t])}function CT(e){let{session:t,editing:n,edit:r,compiled:i,arrangedGeometry:a,profile:o,nameOf:s,typeRegistry:c}=e,{noteEdit:l,setNoteEdit:u,noteOverrides:d,setNoteOverrides:f}=t,[p,m]=(0,v.useState)(()=>new Map),h=(0,v.useCallback)((e,t,n,r)=>{m(i=>{let a=i.get(e);return a!==void 0&&a.at.x===t.x&&a.at.y===t.y&&a.away.x===n.x&&a.away.y===n.y&&a.line.length===r.length&&a.line.every((e,t)=>e.x===r[t].x&&e.y===r[t].y)?i:new Map(i).set(e,{at:t,away:n,line:r})})},[]),g=yt(e.model,e.plane),_=e.notes===!1,y=e.layout?.notes?.[g],b=(0,v.useMemo)(()=>{let e=new Set;for(let[t,n]of Object.entries(y??{}))n.open===!0&&e.add(t);for(let[t,n]of d)n?e.add(t):e.delete(t);return e},[y,d]),x=r?.onToggleNote,S=(0,v.useMemo)(()=>_?null:{isOpen:e=>b.has(e),toggle:e=>{let t=zt(e),r=!b.has(t);n&&x!==void 0?x(e,r):f(e=>new Map(e).set(t,r))},placeBadge:h},[_,b,n,x,h]),C=e.onOpenLink;return{noteState:S,noteNodes:(0,v.useMemo)(()=>_||b.size===0||a===null?[]:cw({compiled:i,geometry:a,open:b,placements:y,badgeSpots:p,editing:n,offersThreats:o.offersThreats===!0,editingRow:l,onAddThreat:r?.onAddThreat,onRetitleThreat:r?.onRetitleThreat,onSetThreatStatus:r?.onSetThreatStatus,onEditThreatText:r?.onEditThreatText,onOpenLink:C,onEndEdit:()=>u(null),nameOf:s,typeRegistry:c}),[_,b,a,i,y,p,n,r?.onAddThreat,r?.onRetitleThreat,r?.onSetThreatStatus,r?.onEditThreatText,C,o,l,s,c])}}function wT(e,t){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(()=>new Map);return(0,v.useEffect)(()=>{e&&a(new Map)},[e]),(0,v.useEffect)(()=>{a(new Map)},[t]),{noteEdit:n,setNoteEdit:r,noteOverrides:i,setNoteOverrides:a}}var TT=new Set([`left`,`centerX`,`right`]),Bue=(e,t)=>{switch(t){case`left`:return e.x;case`centerX`:return e.x+e.w/2;case`right`:return e.x+e.w;case`top`:return e.y;case`middle`:return e.y+e.h/2;case`bottom`:return e.y+e.h}};function Vue(e,t){if(e.length<2)return{};let n=e.map(e=>Bue(e,t)),r=t===`left`||t===`top`?Math.min(...n):t===`right`||t===`bottom`?Math.max(...n):n.reduce((e,t)=>e+t,0)/n.length,i={};return e.forEach((e,a)=>{let o=r-n[a];o!==0&&(i[e.id]=TT.has(t)?{dx:o,dy:0}:{dx:0,dy:o})}),i}function Hue(e,t){if(e.length<3)return{};let n=e=>t===`x`?e.x:e.y,r=e=>t===`x`?e.w:e.h,i=[...e].sort((e,t)=>n(e)-n(t)),a=i[0],o=i[i.length-1],s=(n(o)+r(o)-n(a)-i.reduce((e,t)=>e+r(t),0))/(i.length-1),c={},l=n(a)+r(a)+s;for(let e of i.slice(1,-1)){let i=l-n(e);i!==0&&(c[e.id]=t===`x`?{dx:i,dy:0}:{dx:0,dy:i}),l+=r(e)+s}return c}function ET(e,t){let n=new Set(e);return e.filter(e=>{for(let r=t(e);r!==void 0;r=t(r))if(n.has(r))return!1;return!0})}var Uue={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Wue=e=>{let t=e?.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e?.isContentEditable===!0};function DT(e){let t=(0,v.useRef)({}),n=(0,v.useRef)(null),r=(0,v.useRef)(e);r.current=e;let i=(0,v.useCallback)(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null);let e=t.current;Object.keys(e).length!==0&&(t.current={},r.current.commit(e))},[]),a=(0,v.useCallback)(e=>{let{enabled:a,step:o,nodesRef:s,applyMoves:c}=r.current,l=Uue[e.key];if(!a||l===void 0)return;let u=e.target;if(Wue(u)||(u?.closest(`.react-flow__node, .react-flow__nodesselection-rect`)??null)===null)return;let d=s.current.filter(e=>e.selected===!0&&e.draggable!==!1);if(d.length===0)return;if(e.metaKey||e.ctrlKey||e.altKey){e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let f=o*(e.shiftKey?4:1),p={};for(let e of d){let n=t.current[e.id]??e.position;p[e.id]={x:n.x+l.x*f,y:n.y+l.y*f}}t.current={...t.current,...p},c(p),n.current!==null&&clearTimeout(n.current),n.current=setTimeout(i,300)},[i]),o=(0,v.useCallback)(e=>{(e.target?.closest(`.react-flow__node`)??null)!==null&&i()},[i]);return(0,v.useEffect)(()=>i,[i]),{onKeyDownCapture:a,onBlurCapture:o,flush:i,pendingRef:t}}function Gue(e){let{chromeless:t,gestureCaptured:n,reactFlow:r,rfNodes:i,rfNodesRef:a,setRfNodes:o,commitMoves:s}=e,c=DT({enabled:!t&&!n,step:e.snapGrid??5,nodesRef:a,applyMoves:e=>o(t=>ig(Object.entries(e).map(([e,t])=>({type:`position`,id:e,position:t})),t)),commit:s}),l=(0,v.useMemo)(()=>i.filter(e=>e.selected===!0&&e.draggable!==!1).map(e=>e.id),[i]),u=!t&&!n&&(e.editing||e.savesViewPositions),d=e=>{c.flush();let t=new Map(a.current.map(e=>[e.id,e])),n=ET(l,e=>t.get(e)?.parentId),i=[];for(let e of n){let n=t.get(e),a=r.getInternalNode(e)?.internals.positionAbsolute,o=n?.measured?.width,s=n?.measured?.height;n===void 0||a===void 0||o===void 0||s===void 0||i.push({id:e,x:a.x,y:a.y,w:o,h:s})}let u={};for(let[n,r]of Object.entries(e(i))){let e=t.get(n);u[n]={x:e.position.x+r.dx,y:e.position.y+r.dy}}Object.keys(u).length!==0&&(o(e=>ig(Object.entries(u).map(([e,t])=>({type:`position`,id:e,position:t})),e)),s(u))};return{nudge:c,selectedIds:l,canArrange:u,arrangeSelection:d,alignSelection:e=>d(t=>Vue(t,e)),distributeSelection:e=>d(t=>Hue(t,e))}}function Kue(e,t,n,r){let{zoom:i}=t,a=e.x*i+t.x,o=e.y*i+t.y,s=a+e.width*i,c=o+e.height*i,l=n.width-r,u=n.height-r;if(a>=r&&o>=r&&s<=l&&c<=u)return null;if(e.width*i+2*r<=n.width&&e.height*i+2*r<=n.height){let e=a<r?r-a:s>l?l-s:0,n=o<r?r-o:c>u?u-c:0;return{x:t.x+e,y:t.y+n,zoom:i}}let d=Math.max(oT,Math.min((n.width-2*r)/e.width,(n.height-2*r)/e.height,i));return{x:(n.width-e.width*d)/2-e.x*d,y:(n.height-e.height*d)/2-e.y*d,zoom:d}}function que(e){let{pendingRevealRef:t,pendingRootFitRef:n,compiled:r,reactFlow:i,wrapperRef:a}=e,{arrangedGeometry:o,settledFor:s}=e.layout;(0,v.useEffect)(()=>{let e=t.current;if(e===null||o===null||s!==r||(t.current=null,n.current!==null))return;let c=OT(r,o,e),l=a.current?.getBoundingClientRect();if(c===void 0||l===void 0||l.width===0||l.height===0)return;let u=Kue(c,i.getViewport(),l,24);u!==null&&i.setViewport(u,{duration:300})},[r,o,s,i])}function OT(e,t,n){let r,i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c=a+s.x,l=o+s.y;if(e.id===n){e.state===`expanded`&&(r={x:c,y:l,width:s.width,height:s.height});return}e.state===`expanded`&&e.children.forEach(e=>i(e,c,l))};return e.roots.forEach(e=>i(e,0,0)),r}function Jue(e){let{pendingRootFitRef:t,compiled:n,reactFlow:r}=e,{arrangedGeometry:i,settledFor:a}=e.layout;(0,v.useEffect)(()=>{let e=t.current;e===null||i===null||a!==n||(t.current=null,r.fitView(e===`glide`?{padding:.15,duration:500}:void 0))},[n,i,a,r])}var kT=c(o(((e,t)=>{(function(n){if(typeof e==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=n()}})(function(){return(function(){function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o<r.length;o++)i(r[o]);return i}return e})()({1:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=c(e,`string`);return r(t)==`symbol`?t:t+``}function c(e,t){if(r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||`default`);if(r(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}n.default=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,a=r===void 0?{}:r,o=n.algorithms,s=o===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:o,c=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,u===void 0&&c===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=c;u!==void 0&&c===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new l(f),this.worker.postMessage({cmd:`register`,algorithms:s}).then(function(e){return t.initialized=!0}).catch(console.err)}return o(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}])}();var l=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return o(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}])}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function C(){}function w(){}function T(){}function E(){}function ee(){}function te(){}function ne(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function Re(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function Je(){}function Ye(){}function Xe(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function it(){}function at(){}function ot(){}function st(){}function ct(){}function lt(){}function ut(){}function dt(){}function ft(){}function pt(){}function mt(){}function ht(){}function gt(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function Et(){}function Dt(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function Nt(){}function Pt(){}function Ft(){}function It(){}function Lt(){}function Rt(){}function zt(){}function Bt(){}function Vt(){}function Ht(){}function Ut(){}function Wt(){}function Gt(){}function Kt(){}function qt(){}function Jt(){}function Yt(){}function Xt(){}function Zt(){}function Qt(){}function $t(){}function en(){}function tn(){}function nn(){}function rn(){}function an(){}function on(){}function sn(){}function cn(){}function ln(){}function un(){}function dn(){}function fn(){}function pn(){}function mn(){}function hn(){}function gn(){}function _n(){}function vn(){}function yn(){}function bn(){}function xn(){}function Sn(){}function Cn(){}function wn(){}function Tn(){}function En(){}function Dn(){}function On(){}function kn(){}function An(){}function jn(){}function Mn(){}function Nn(){}function Pn(){}function Fn(){}function In(){}function Ln(){}function Rn(){}function zn(){}function Bn(){}function Vn(){}function Hn(){}function Un(){}function Wn(){}function Gn(){}function Kn(){}function qn(){}function eee(){}function Jn(){}function Yn(){}function Xn(){}function Zn(){}function tee(){}function nee(){}function ree(){}function iee(){}function aee(){}function Qn(){}function $n(){}function oee(){}function er(){}function tr(){}function nr(){}function rr(){}function ir(){}function ar(){}function or(){}function sr(){}function see(){}function cr(){}function lr(){}function ur(){}function dr(){}function fr(){}function pr(){}function mr(){}function hr(){}function gr(){}function _r(){}function vr(){}function yr(){}function br(){}function xr(){}function Sr(){}function cee(){}function lee(){}function Cr(){}function wr(){}function Tr(){}function Er(){}function Dr(){}function Or(){}function kr(){}function Ar(){}function jr(){}function Mr(){}function Nr(){}function Pr(){}function Fr(){}function Ir(){}function Lr(){}function Rr(){}function zr(){}function Br(){}function Vr(){}function Hr(){}function Ur(){}function Wr(){}function Gr(){}function Kr(){}function uee(){}function qr(){}function Jr(){}function Yr(){}function Xr(){}function Zr(){}function Qr(){}function $r(){}function ei(){}function ti(){}function ni(){}function ri(){}function ii(){}function ai(){}function oi(){}function si(){}function ci(){}function li(){}function ui(){}function di(){}function fi(){}function pi(){}function mi(){}function hi(){}function gi(){}function _i(){}function vi(){}function yi(){}function bi(){}function xi(){}function Si(){}function Ci(){}function wi(){}function Ti(){}function Ei(){}function Di(){}function Oi(){}function ki(){}function Ai(){}function ji(){}function Mi(){}function Ni(){}function Pi(){}function Fi(){}function Ii(){}function Li(){}function Ri(){}function zi(){}function Bi(){}function Vi(){}function Hi(){}function Ui(){}function Wi(){}function Gi(){}function Ki(){}function qi(){}function Ji(){}function Yi(){}function Xi(){}function Zi(){}function Qi(){}function $i(){}function ea(){}function ta(){}function na(){}function ra(){}function ia(){}function aa(){}function dee(){}function fee(){}function oa(){}function sa(){}function ca(){}function la(){}function ua(){}function da(){}function fa(){}function pa(){}function ma(){}function ha(){}function pee(){}function ga(){}function _a(){}function va(){}function ya(){}function ba(){}function xa(){}function Sa(){}function Ca(){}function wa(){}function Ta(){}function Ea(){}function Da(){}function Oa(){}function ka(){}function Aa(){}function ja(){}function Ma(){}function Na(){}function Pa(){}function Fa(){}function Ia(){}function La(){}function Ra(){}function za(){}function Ba(){}function Va(){}function Ha(){}function Ua(){}function Wa(){}function Ga(){}function Ka(){}function qa(){}function Ja(){}function Ya(){}function Xa(){}function Za(){}function Qa(){}function $a(){}function eo(){}function to(){}function no(){}function ro(){}function io(){}function ao(){}function oo(){}function so(){}function co(){}function lo(){}function uo(){}function fo(){}function po(){}function mo(){}function ho(){}function go(){}function _o(){}function vo(){}function yo(){}function bo(){}function xo(){}function mee(){}function So(){}function Co(){}function wo(){}function To(){}function Eo(){}function Do(){}function Oo(){}function ko(){}function Ao(){}function jo(){}function Mo(){}function No(){}function Po(){}function Fo(){}function Io(){}function Lo(){}function Ro(){}function zo(){}function Bo(){}function Vo(){}function Ho(){}function Uo(){}function Wo(){}function Go(){}function Ko(){}function qo(){}function Jo(){}function Yo(){}function Xo(){}function Zo(){}function Qo(){}function $o(){}function es(){}function ts(){}function ns(){}function rs(){}function is(){}function hee(){}function as(){}function os(){}function ss(){}function cs(){}function ls(){}function us(){}function ds(){}function gee(){}function fs(){}function ps(){}function ms(){}function hs(){}function gs(){}function _s(){}function vs(){}function ys(){}function bs(){}function xs(){}function Ss(){}function Cs(){}function ws(){}function Ts(){}function Es(){}function Ds(){}function Os(){}function ks(){}function As(){}function js(){}function Ms(){}function Ns(){}function Ps(){}function Fs(){}function Is(){}function Ls(){}function Rs(){}function zs(){}function Bs(){}function Vs(){}function Hs(){}function Us(){}function Ws(){}function Gs(){}function Ks(){}function qs(){}function Js(){}function Ys(){}function Xs(){}function Zs(){}function Qs(){}function $s(){}function ec(){}function tc(){}function nc(){}function rc(){}function ic(){}function ac(){}function oc(){}function sc(){}function cc(){}function lc(){}function uc(){}function dc(){}function fc(){}function pc(){}function mc(){}function hc(){}function gc(){}function _c(){}function vc(){}function yc(){}function bc(){}function xc(){}function Sc(){}function Cc(){}function wc(){}function Tc(){}function Ec(){}function Dc(){}function Oc(){}function kc(){}function Ac(){}function jc(){}function Mc(){}function Nc(){}function Pc(){}function Fc(){}function Ic(){}function Lc(){}function Rc(){}function zc(){}function Bc(){}function Vc(){}function Hc(){}function Uc(){}function Wc(){}function Gc(){}function Kc(){}function qc(){}function Jc(){}function Yc(){}function Xc(){}function Zc(){}function Qc(){}function $c(){}function el(){}function tl(){}function nl(){}function rl(){}function il(){}function al(){}function ol(){}function sl(){}function cl(){}function ll(){}function ul(){}function dl(){}function fl(){}function pl(){}function ml(){}function _ee(){}function hl(){}function gl(){}function _l(){}function vl(){}function yl(){}function bl(){}function xl(){}function Sl(){}function Cl(){}function wl(){}function Tl(){}function El(){}function Dl(){}function Ol(){}function kl(){}function Al(){}function jl(){}function Ml(){}function Nl(){}function Pl(){}function D(){}function Fl(){}function Il(){}function Ll(){}function Rl(){}function zl(){}function Bl(){}function Vl(){}function Hl(){}function Ul(){}function Wl(){}function Gl(){}function Kl(){}function ql(){}function Jl(){}function Yl(){}function Xl(){}function Zl(){}function Ql(){}function $l(){}function eu(){}function tu(){}function nu(){}function ru(){}function iu(){}function au(){}function ou(){}function su(){}function cu(){}function lu(){}function uu(){}function du(){}function fu(){}function pu(){}function mu(){}function hu(){}function gu(){}function _u(){}function vu(){}function yu(){}function bu(){}function xu(){}function Su(){}function vee(){}function Cu(){}function wu(){}function Tu(){}function Eu(){}function Du(){}function Ou(){}function ku(){}function Au(){}function ju(){}function Mu(){}function Nu(){}function Pu(){}function Fu(){}function Iu(){}function Lu(){}function Ru(){}function zu(){}function Bu(){}function Vu(){}function Hu(){}function Uu(){}function Wu(){}function Gu(){}function Ku(){}function qu(){}function Ju(){}function Yu(){}function Xu(){}function Zu(){}function Qu(){}function $u(){}function yee(){}function bee(){}function ed(){}function td(){}function nd(){}function rd(){}function id(){}function ad(){}function od(){}function sd(){}function cd(){}function ld(){}function ud(){}function dd(){}function fd(){}function xee(){}function pd(){}function md(){}function hd(){}function gd(){}function _d(){}function vd(){}function yd(){qg()}function See(){SYe()}function bd(){cG()}function xd(){TWe()}function Sd(){jH()}function Cd(){Yy()}function wd(){nb()}function Td(){EL()}function Ed(){UDe()}function Dd(){tb()}function Od(){XD()}function Cee(){iz()}function kd(){fU()}function Ad(){ab()}function jd(){mat()}function Md(){fSe()}function Nd(){JOe()}function Pd(){jMe()}function Fd(){lSe()}function Id(){cSe()}function Ld(){uSe()}function Rd(){rK()}function zd(){IMe()}function Bd(){Zwe()}function Vd(){NMe()}function Hd(){PMe()}function Ud(){FMe()}function Wd(){LMe()}function Gd(){_Se()}function Kd(){CI()}function wee(){uPe()}function qd(){Y6e()}function Jd(){yU()}function Yd(){mSe()}function Xd(){MWe()}function Zd(){hSe()}function Qd(){L8e()}function $d(){D$e()}function ef(){pG()}function tf(){BW()}function nf(){E5e()}function Tee(){CRe()}function rf(){wI()}function af(){lU()}function of(){U3e()}function Eee(){XHe()}function sf(){hF()}function cf(){oK()}function lf(){uU()}function uf(){gz()}function df(){mBe()}function ff(){CG()}function pf(){VL()}function mf(){xpe()}function hf(){F5e()}function gf(e){Rj(e)}function _f(e){this.a=e}function vf(e){this.a=e}function yf(e){this.a=e}function bf(e){this.a=e}function xf(e){this.a=e}function Sf(e){this.a=e}function Cf(e){this.a=e}function wf(e){this.a=e}function Tf(e){this.a=e}function Ef(e){this.a=e}function Df(e){this.a=e}function Of(e){this.a=e}function kf(e){this.a=e}function Af(e){this.c=e}function jf(e){this.a=e}function Mf(e){this.a=e}function Nf(e){this.a=e}function Pf(e){this.a=e}function Ff(e){this.a=e}function If(e){this.a=e}function Lf(e){this.a=e}function Rf(e){this.a=e}function zf(e){this.a=e}function Bf(e){this.a=e}function Vf(e){this.a=e}function Dee(e){this.a=e}function Hf(e){this.a=e}function Oee(e){this.a=e}function Uf(e){this.a=e}function Wf(e){this.a=e}function Gf(e){this.a=e}function Kf(e){this.a=e}function qf(e){this.a=e}function Jf(e){this.a=e}function Yf(e){this.a=e}function Xf(e){this.a=e}function Zf(e){this.a=e}function Qf(e){this.a=e}function $f(e){this.a=e}function ep(e){this.a=e}function tp(e){this.a=e}function np(e){this.a=e}function rp(e){this.a=e}function ip(e){this.b=e}function ap(){this.a=[]}function op(e,t){e.a=t}function sp(e,t){e.a=t}function cp(e,t){e.b=t}function lp(e,t){e.c=t}function up(e,t){e.c=t}function dp(e,t){e.d=t}function fp(e,t){e.d=t}function pp(e,t){e.k=t}function mp(e,t){e.j=t}function hp(e,t){e.c=t}function gp(e,t){e.c=t}function _p(e,t){e.a=t}function vp(e,t){e.a=t}function kee(e,t){e.f=t}function yp(e,t){e.a=t}function bp(e,t){e.b=t}function xp(e,t){e.d=t}function Sp(e,t){e.i=t}function Cp(e,t){e.o=t}function wp(e,t){e.r=t}function Aee(e,t){e.a=t}function Tp(e,t){e.b=t}function Ep(e,t){e.e=t}function Dp(e,t){e.e=t}function Op(e,t){e.f=t}function jee(e,t){e.f=t}function kp(e,t){e.g=t}function Ap(e,t){e.f=t}function jp(e,t){e.a=t}function Mp(e,t){e.b=t}function Np(e,t){e.n=t}function Pp(e,t){e.a=t}function Mee(e,t){e.a=t}function Nee(e,t){e.a=t}function Pee(e,t){e.c=t}function Fee(e,t){e.c=t}function Iee(e,t){e.c=t}function Lee(e,t){e.d=t}function Ree(e,t){e.d=t}function zee(e,t){e.e=t}function Bee(e,t){e.e=t}function Vee(e,t){e.g=t}function Hee(e,t){e.f=t}function Uee(e,t){e.j=t}function Wee(e,t){e.a=t}function Gee(e,t){e.a=t}function Kee(e,t){e.b=t}function qee(e){e.b=e.a}function Jee(e){e.c=e.d.d}function Yee(e){this.a=e}function Fp(e){this.a=e}function Xee(e){this.a=e}function Ip(e){this.a=e}function Zee(e){this.a=e}function Qee(e){this.a=e}function Lp(e){this.a=e}function Rp(e){this.a=e}function zp(e){this.a=e}function Bp(e){this.a=e}function Vp(e){this.a=e}function Hp(e){this.a=e}function Up(e){this.a=e}function Wp(e){this.b=e}function Gp(e){this.b=e}function Kp(e){this.b=e}function qp(e){this.d=e}function Jp(e){this.a=e}function $ee(e){this.a=e}function Yp(e){this.a=e}function ete(e){this.a=e}function tte(e){this.a=e}function nte(e){this.a=e}function Xp(e){this.a=e}function rte(e){this.a=e}function Zp(e){this.c=e}function O(e){this.c=e}function ite(e){this.c=e}function ate(e){this.a=e}function ote(e){this.a=e}function ste(e){this.a=e}function cte(e){this.a=e}function Qp(e){this.a=e}function lte(e){this.a=e}function ute(e){this.a=e}function $p(e){this.a=e}function dte(e){this.a=e}function fte(e){this.a=e}function pte(e){this.a=e}function mte(e){this.a=e}function em(e){this.a=e}function hte(e){this.a=e}function gte(e){this.a=e}function tm(e){this.a=e}function _te(e){this.a=e}function vte(e){this.a=e}function yte(e){this.a=e}function nm(e){this.a=e}function rm(e){this.a=e}function bte(e){this.a=e}function im(e){this.a=e}function am(e){this.a=e}function xte(e){this.a=e}function om(e){this.a=e}function sm(e){this.a=e}function Ste(e){this.a=e}function Cte(e){this.a=e}function cm(e){this.a=e}function wte(e){this.a=e}function Tte(e){this.a=e}function lm(e){this.a=e}function um(e){this.a=e}function dm(e){this.a=e}function fm(e){this.a=e}function pm(e){this.a=e}function Ete(e){this.a=e}function mm(e){this.a=e}function hm(e){this.a=e}function gm(e){this.a=e}function Dte(e){this.a=e}function _m(e){this.a=e}function vm(e){this.a=e}function ym(e){this.a=e}function Ote(e){this.a=e}function kte(e){this.a=e}function Ate(e){this.a=e}function jte(e){this.a=e}function bm(e){this.a=e}function xm(e){this.a=e}function Mte(e){this.a=e}function Sm(e){this.a=e}function Cm(e){this.a=e}function Nte(e){this.a=e}function Pte(e){this.a=e}function Fte(e){this.a=e}function Ite(e){this.a=e}function wm(e){this.e=e}function Tm(e){this.a=e}function Em(e){this.a=e}function Lte(e){this.a=e}function Rte(e){this.a=e}function Dm(e){this.a=e}function Om(e){this.a=e}function km(e){this.a=e}function Am(e){this.a=e}function jm(e){this.a=e}function Mm(e){this.a=e}function zte(e){this.a=e}function Bte(e){this.a=e}function Nm(e){this.a=e}function Vte(e){this.a=e}function Pm(e){this.a=e}function Hte(e){this.a=e}function Fm(e){this.a=e}function Im(e){this.a=e}function Lm(e){this.a=e}function Rm(e){this.a=e}function Ute(e){this.a=e}function Wte(e){this.a=e}function zm(e){this.a=e}function Bm(e){this.a=e}function Vm(e){this.a=e}function Hm(e){this.a=e}function Gte(e){this.a=e}function Kte(e){this.a=e}function qte(e){this.a=e}function Jte(e){this.a=e}function Yte(e){this.a=e}function Um(e){this.a=e}function Wm(e){this.a=e}function Xte(e){this.c=e}function Zte(e){this.b=e}function Qte(e){this.a=e}function $te(e){this.a=e}function Gm(e){this.a=e}function ene(e){this.a=e}function tne(e){this.a=e}function Km(e){this.a=e}function nne(e){this.a=e}function qm(e){this.a=e}function rne(e){this.a=e}function ine(e){this.a=e}function ane(e){this.a=e}function one(e){this.a=e}function sne(e){this.a=e}function cne(e){this.a=e}function Jm(e){this.a=e}function Ym(e){this.a=e}function lne(e){this.a=e}function Xm(e){this.a=e}function une(e){this.a=e}function dne(e){this.a=e}function Zm(e){this.a=e}function Qm(e){this.a=e}function fne(e){this.a=e}function $m(e){this.a=e}function eh(e){this.a=e}function th(e){this.a=e}function nh(e){this.a=e}function rh(e){this.a=e}function ih(e){this.a=e}function pne(e){this.a=e}function ah(e){this.a=e}function mne(e){this.a=e}function oh(e){this.a=e}function hne(e){this.a=e}function gne(e){this.a=e}function sh(e){this.a=e}function ch(e){this.a=e}function _ne(e){this.a=e}function lh(e){this.a=e}function uh(e){this.a=e}function vne(e){this.a=e}function dh(e){this.a=e}function yne(e){this.a=e}function bne(e){this.a=e}function fh(e){this.a=e}function ph(e){this.a=e}function mh(e){this.a=e}function hh(e){this.a=e}function xne(e){this.a=e}function gh(e){this.a=e}function Sne(e){this.a=e}function Cne(e){this.a=e}function wne(e){this.a=e}function Tne(e){this.a=e}function Ene(e){this.a=e}function _h(e){this.a=e}function vh(e){this.a=e}function Dne(e){this.a=e}function yh(e){this.a=e}function One(e){this.a=e}function bh(e){this.a=e}function xh(e){this.a=e}function kne(e){this.a=e}function Sh(e){this.a=e}function Ch(e){this.a=e}function wh(e){this.a=e}function Th(e){this.a=e}function Ane(e){this.a=e}function Eh(e){this.a=e}function Dh(e){this.a=e}function jne(e){this.a=e}function Mne(e){this.a=e}function Nne(e){this.a=e}function Pne(e){this.a=e}function Fne(e){this.a=e}function Ine(e){this.a=e}function Lne(e){this.a=e}function Oh(e){this.a=e}function Rne(e){this.a=e}function zne(e){this.a=e}function Bne(e){this.a=e}function Vne(e){this.a=e}function kh(e){this.a=e}function Ah(e){this.a=e}function jh(e){this.b=e}function Hne(e){this.f=e}function Une(e){this.a=e}function Wne(e){this.a=e}function Gne(e){this.a=e}function Kne(e){this.a=e}function qne(e){this.a=e}function Jne(e){this.a=e}function Yne(e){this.a=e}function Xne(e){this.a=e}function Zne(e){this.a=e}function Mh(e){this.a=e}function Qne(e){this.a=e}function $ne(e){this.a=e}function Nh(e){this.a=e}function Ph(e){this.a=e}function ere(e){this.b=e}function Fh(e){this.c=e}function Ih(e){this.e=e}function Lh(e){this.d=e}function Rh(e){this.a=e}function zh(e){this.a=e}function tre(e){this.a=e}function Bh(e){this.a=e}function Vh(e){this.e=e}function Hh(){this.a=0}function Uh(){WC(this)}function Wh(){FA(this)}function Gh(){wve(this)}function nre(){}function Kh(){this.c=qBt}function rre(e,t){e.b+=t}function ire(e,t){t.Wb(e)}function are(e){return e.a}function ore(e){return e.a}function qh(e){return e.a}function sre(e){return e.a}function cre(e){return e.a}function k(e){return e.e}function Jh(){return null}function lre(){return null}function ure(e){throw k(e)}function Yh(e){this.a=uj(e)}function dre(){this.a=this}function Xh(){zue.call(this)}function fre(e){e.b.Mf(e.e)}function pre(e){e.b=new O_}function Zh(e,t){e.b=t-e.b}function Qh(e,t){e.a=t-e.a}function mre(e,t){t.gd(e.a)}function hre(e,t){PU(t,e)}function $h(e,t){e.push(t)}function gre(e,t){e.sort(t)}function eg(e,t,n){e.Wd(n,t)}function tg(e,t){e.e=t,t.b=e}function _re(e){jM(),Zgt.je(e)}function vre(){xv(),dit()}function ng(){Xh.call(this)}function rg(){Xh.call(this)}function ig(){zue.call(this)}function yre(){Xh.call(this)}function ag(){Xh.call(this)}function og(){Xh.call(this)}function sg(){Xh.call(this)}function cg(){Xh.call(this)}function lg(){Xh.call(this)}function ug(){Xh.call(this)}function dg(){Xh.call(this)}function bre(){Xh.call(this)}function fg(){this.Bb|=256}function xre(){this.b=new Qce}function pg(){pg=E,new Wh}function mg(e,t){e.length=t}function hg(e,t){Rw(e.a,t)}function Sre(e,t){HYe(e.c,t)}function Cre(e,t){MA(e.b,t)}function wre(e,t){fH(e.a,t)}function gg(e,t){gB(e.a,t)}function _g(e,t){tR(e.e,t)}function vg(e){YU(e.c,e.b)}function Tre(e,t){e.kc().Nb(t)}function Ere(e){this.a=qRe(e)}function yg(){this.a=new Wh}function Dre(){this.a=new Wh}function bg(){this.a=new Uh}function xg(){this.a=new Uh}function Ore(){this.a=new Uh}function Sg(){this.a=new Re}function Cg(){this.a=new LDe}function wg(){this.a=new woe}function Tg(){this.a=new Hxe}function Eg(){this.a=new aD}function kre(){this.a=new it}function Are(){this.a=new ACe}function Dg(){this.a=new Uh}function jre(){this.a=new Uh}function Og(){this.a=new Uh}function Mre(){this.a=new Uh}function Nre(){this.d=new Uh}function Pre(){this.a=new yg}function Fre(){this.a=new Wh}function Ire(){this.b=new Wh}function Lre(){this.b=new Uh}function Rre(){this.e=new Uh}function kg(){this.a=new kd}function zre(){this.d=new Uh}function Bre(){Uh.call(this)}function Vre(){ng.call(this)}function Ag(){bg.call(this)}function jg(){Og.call(this)}function Mg(){nre.call(this)}function Ng(){Mg.call(this)}function Hre(){sD.call(this)}function Pg(){nre.call(this)}function Fg(){Pg.call(this)}function Ure(){Abe.call(this)}function Wre(){Abe.call(this)}function Gre(){Ug.call(this)}function Kre(){Ug.call(this)}function qre(){Ug.call(this)}function Jre(){Wg.call(this)}function Ig(){Uc.call(this)}function Yre(){Uc.call(this)}function Lg(){Dy.call(this)}function Xre(){die.call(this)}function Zre(){die.call(this)}function Qre(){Wh.call(this)}function $re(){Wh.call(this)}function eie(){Wh.call(this)}function Rg(){hMe.call(this)}function tie(){yg.call(this)}function nie(){fg.call(this)}function zg(){Yw.call(this)}function rie(){Wh.call(this)}function Bg(){Yw.call(this)}function Vg(){Wh.call(this)}function iie(){Wh.call(this)}function aie(){ol.call(this)}function Hg(){aie.call(this)}function oie(){ol.call(this)}function sie(){gd.call(this)}function Ug(){this.a=new yg}function cie(){this.a=new Wh}function Wg(){this.a=new Wh}function Gg(){this.a=new Dy}function lie(){this.a=new Uh}function uie(){this.j=new Uh}function die(){this.a=new nl}function fie(){this.a=new Ss}function pie(){this.a=new Xv}function Kg(){Kg=E,Fgt=new hie}function qg(){qg=E,jgt=new o}function Jg(){Jg=E,Pgt=new mie}function mie(){zf.call(this,``)}function hie(){zf.call(this,``)}function gie(e){bje.call(this,e)}function _ie(e){bje.call(this,e)}function Yg(e){Sf.call(this,e)}function vie(e){$ae.call(this,e)}function yie(e){$ae.call(this,e)}function bie(e){vie.call(this,e)}function xie(e){vie.call(this,e)}function Sie(e){vie.call(this,e)}function Cie(e){pEe.call(this,e)}function wie(e){pEe.call(this,e)}function Tie(e){Ow.call(this,e)}function Eie(e){moe.call(this,e)}function Xg(e){dy.call(this,e)}function Zg(e){dy.call(this,e)}function Die(e){dy.call(this,e)}function Qg(e){r_e.call(this,e)}function Oie(e){Qg.call(this,e)}function $g(){rp.call(this,{})}function e_(e){nT(),this.a=e}function kie(e){e.b=null,e.c=0}function Aie(e,t){e.e=t,h4e(e,t)}function jie(e,t){e.a=t,qXe(e)}function t_(e,t,n){e.a[t.g]=n}function Mie(e,t,n){KGe(n,e,t)}function Nie(e,t){kfe(t.i,e.n)}function Pie(e,t){bIe(e).Ad(t)}function Fie(e,t){return e*e/t}function Iie(e,t){return e.g-t.g}function Lie(e,t){e.a.ec().Kc(t)}function Rie(e){return new np(e)}function zie(e){return new wj(e)}function n_(e){Qg.call(this,e)}function r_(e){Qg.call(this,e)}function Bie(e){Qg.call(this,e)}function i_(e){r_e.call(this,e)}function a_(e){lPe(),this.a=e}function o_(e){qk(),this.f=e}function s_(e){qk(),this.f=e}function c_(e){bpe(),this.a=e}function l_(e){Qg.call(this,e)}function u_(e){Qg.call(this,e)}function d_(e){Qg.call(this,e)}function f_(e){Qg.call(this,e)}function p_(e){Qg.call(this,e)}function m_(e){return Rj(e),e}function A(e){return Rj(e),e}function h_(e){return Rj(e),e}function Vie(e){return Rj(e),e}function g_(e){return Rj(e),e}function __(e){return e.b==e.c}function v_(e){return!!e&&e.b}function Hie(e){return!!e&&e.k}function Uie(e){return!!e&&e.j}function y_(e){Rj(e),this.a=e}function Wie(e){return tz(e),e}function b_(e){C_e(e,e.length)}function x_(e){Qg.call(this,e)}function S_(e){Qg.call(this,e)}function C_(e){Qg.call(this,e)}function w_(e){Qg.call(this,e)}function T_(e){Qg.call(this,e)}function E_(e){Qg.call(this,e)}function D_(e){KT.call(this,e,0)}function O_(){OCe.call(this,12,3)}function k_(){this.a=EE(uj(yK))}function A_(){throw k(new ug)}function Gie(){throw k(new ug)}function Kie(){throw k(new ug)}function qie(){throw k(new ug)}function Jie(){throw k(new ug)}function Yie(){throw k(new ug)}function Xie(){Xie=E,Kgt=new a}function j_(){j_=E,Xgt=new v}function M_(){M_=E,hQ=new x}function N_(){N_=E,Rgt=new oue}function Zie(){Zie=E,t_t=new C}function P_(){P_=E,jM()}function F_(){Ip.call(this,``)}function I_(){Ip.call(this,``)}function L_(){Ip.call(this,``)}function R_(){Ip.call(this,``)}function z_(e){r_.call(this,e)}function B_(e){r_.call(this,e)}function V_(e){u_.call(this,e)}function H_(e){Gp.call(this,e)}function Qie(e){H_.call(this,e)}function U_(e){pT.call(this,e)}function W_(e,t,n){e.c.Cf(t,n)}function $ie(e,t,n){t.Ad(e.a[n])}function eae(e,t,n){t.Ne(e.a[n])}function tae(e,t){return e.a-t.a}function nae(e,t){return e.a-t.a}function G_(e,t){return e.a-t.a}function K_(e,t){return yF(e,t)}function j(e,t){return nSe(e,t)}function rae(e,t){return t in e.a}function iae(e){return e.a?e.b:0}function aae(e){return e.a?e.b:0}function oae(e,t){return e.f=t,e}function sae(e,t){return e.b=t,e}function cae(e,t){return e.c=t,e}function lae(e,t){return e.g=t,e}function q_(e,t){return e.a=t,e}function J_(e,t){return e.f=t,e}function uae(e,t){return e.k=t,e}function Y_(e,t){return e.a=t,e}function dae(e,t){return e.e=t,e}function X_(e,t){return e.e=t,e}function fae(e,t){return e.f=t,e}function pae(e,t){e.b=new SC(t)}function mae(e,t){e._d(t),t.$d(e)}function hae(e,t){QD(),t.n.a+=e}function gae(e,t){fU(),tN(t,e)}function _ae(e,t){return e.b-t.b}function vae(e,t){return e.g-t.g}function yae(e,t){return e.s-t.s}function bae(e,t){return e?0:t-1}function xae(e,t){return e?0:t-1}function Sae(e,t){return e?t-1:0}function Cae(e,t){return t.pg(e)}function Z_(e,t){return e.b=t,e}function Q_(e,t){return e.a=t,e}function $_(e,t){return e.c=t,e}function ev(e,t){return e.d=t,e}function tv(e,t){return e.e=t,e}function nv(e,t){return e.f=t,e}function rv(e,t){return e.a=t,e}function iv(e,t){return e.b=t,e}function av(e,t){return e.c=t,e}function ov(e,t){return e.c=t,e}function sv(e,t){return e.b=t,e}function cv(e,t){return e.d=t,e}function lv(e,t){return e.e=t,e}function wae(e,t){return e.f=t,e}function uv(e,t){return e.g=t,e}function dv(e,t){return e.a=t,e}function fv(e,t){return e.i=t,e}function pv(e,t){return e.j=t,e}function Tae(e,t){return e.j=t,e}function Eae(e,t){return e.k=t,e}function mv(){this.a=0,this.b=0}function Dae(){this.b=0,this.a=0}function Oae(e){jye.call(this,e)}function hv(e){jye.call(this,e)}function gv(e){ND.call(this,e)}function _v(e){mI.call(this,e)}function kae(e){Mye.call(this,e)}function vv(e){Mye.call(this,e)}function yv(){dw.call(this,``)}function Aae(){Aae=E,H_t=BKe()}function bv(){bv=E,Bzt=TGe()}function jae(){jae=E,l7=kqe()}function xv(){xv=E,T7=XI()}function Sv(){Sv=E,NBt=EGe()}function Cv(){Cv=E,bVt=DGe()}function wv(){wv=E,x9=WXe()}function Tv(e){return e.e&&e.e()}function Mae(e,t){return e.c._b(t)}function Ev(e,t){return LLe(e.b,t)}function Nae(e,t){return Goe(e.a,t)}function Dv(e,t){e.b=0,HI(e,t)}function Pae(e,t){e.c=t,e.b=!0}function Ov(e,t){return e.a+=t,e}function kv(e,t){return e.a+=t,e}function Av(e,t){return e.a+=t,e}function jv(e,t){return e.a+=t,e}function Mv(e){return wE(e),e.o}function Nv(e){urt(),Nit(this,e)}function Fae(){throw k(new ug)}function Pv(){throw k(new ug)}function Fv(){throw k(new ug)}function Iae(){throw k(new ug)}function Lae(){throw k(new ug)}function Iv(){throw k(new ug)}function Lv(e){this.a=new Py(e)}function Rv(e){this.a=new pA(e)}function zv(e,t){for(;e.Pe(t););}function Bv(e,t){for(;e.zd(t););}function Rae(e,t,n){zge(e.a,t,n)}function Vv(e,t,n){e.splice(t,n)}function Hv(e,t){return $9e(t,e)}function Uv(e,t){return e.d[t.p]}function Wv(e){return e.b!=e.d.c}function zae(e){return e.l|e.m<<22}function Gv(e){return e?e.d:null}function Bae(e){return e?e.g:null}function Kv(e){return e?e.i:null}function Vae(e,t){return p4e(e,t)}function qv(e){return Nj(e),e.a}function Hae(e){e.c?u3e(e):d3e(e)}function Jv(){this.b=new TW(gjt)}function Yv(){this.b=new TW(yFt)}function Xv(){this.b=new TW(yFt)}function Zv(){this.a=new TW(GMt)}function Qv(){this.a=new TW($Nt)}function $v(e){this.a=0,this.b=e}function ey(){throw k(new ug)}function Uae(){throw k(new ug)}function Wae(){throw k(new ug)}function ty(){throw k(new ug)}function Gae(){throw k(new ug)}function Kae(){throw k(new ug)}function qae(){throw k(new ug)}function Jae(){throw k(new ug)}function Yae(){throw k(new ug)}function Xae(){throw k(new ug)}function Zae(){throw k(new dg)}function Qae(){throw k(new dg)}function ny(e){this.a=new _oe(e)}function ry(e){this.b=F(uj(e),92)}function iy(e,t){this.b=e,this.c=t}function ay(e,t){this.e=e,this.d=t}function $ae(e){Qw(e.dc()),this.c=e}function eoe(e,t){this.a=e,this.b=t}function toe(e,t){this.a=e,this.b=t}function noe(e,t){this.a=e,this.b=t}function roe(e,t){this.a=e,this.b=t}function ioe(e,t){this.a=e,this.b=t}function aoe(e,t){this.a=e,this.b=t}function ooe(e,t){this.a=e,this.b=t}function soe(e,t){this.b=e,this.a=t}function oy(e,t){this.g=e,this.i=t}function sy(e,t){this.b=e,this.a=t}function cy(e,t){Xw.call(this,e,t)}function ly(e,t){cy.call(this,e,t)}function coe(e,t){this.a=e,this.b=t}function loe(e,t){this.a=e,this.b=t}function uoe(e,t){this.b=e,this.a=t}function doe(e,t){this.b=e,this.a=t}function uy(e,t){this.f=e,this.g=t}function dy(e){this.b=F(uj(e),50)}function fy(e,t){this.a=e,this.b=t}function foe(e,t){this.a=e,this.f=t}function poe(e){this.a=F(uj(e),16)}function moe(e){this.a=F(uj(e),16)}function py(e,t){this.b=e,this.c=t}function hoe(e){this.a=F(uj(e),92)}function goe(e,t){this.a=e,this.b=t}function my(e,t){this.a=e,this.b=t}function hy(e,t){return EA(e.b,t)}function gy(e,t){return e>t&&t<qK}function _y(e){return j9[e]!=-1}function vy(e){return!e||yve(e)}function _oe(e){KMe(this,e,EYe())}function voe(e,t){y$e(V(e.a),t)}function yoe(e,t){y$e(V(e.a),t)}function yy(e,t){return e.b.Hc(t)}function by(e,t){return e.b.Gc(t)}function boe(e,t){return e.b.Oc(t)}function xy(e,t){return e.c.uc(t)}function xoe(e,t){return e.b.Gc(t)}function Sy(e,t){return Qz(e.c,t)}function Soe(e){return ij(),e?e_t:$gt}function Cy(e){return e.f.c+e.i.c}function wy(e,t){return e.a._b(t)}function Ty(e,t){this.a=e,this.b=t}function Ey(e){this.c=e,AAe(this)}function Dy(){pw(this),mM(this)}function Oy(){Oy=E,J_t=new $ce}function ky(){ky=E,zQ=new re}function Ay(){Ay=E,b_t=new ee}function jy(){jy=E,Y_t=new QS}function My(){My=E,cvt=new _e}function Coe(){pQ!=0&&(pQ=0),mQ=-1}function Ny(){wgt??=[]}function Py(e){mIe.call(this,e,0)}function woe(){pA.call(this,null)}function Fy(){eF.call(this,null)}function Iy(){Iy=E,WQ=new De}function Ly(e,t){Nj(e),e.a.Nb(t)}function Toe(e,t){return e.a.Vc(t)}function Ry(e,t){return e.a.Wc(t)}function zy(e,t){return e.a.Yc(t)}function By(e,t){return e.a.Zc(t)}function Eoe(e,t){return e.Fc(t),e}function Vy(e,t){return e.a.f=t,e}function Hy(e,t){return e.a.d=t,e}function Doe(e,t){return e.a.g=t,e}function Ooe(e,t){return e.a.j=t,e}function Uy(e,t){return e.a.a=t,e}function Wy(e,t){return e.a.d=t,e}function Gy(e,t){return e.a.e=t,e}function Ky(e,t){return e.a.g=t,e}function qy(e,t){return e.a.f=t,e}function Jy(e){return e.b=!1,e}function Yy(){Yy=E,axt=new mv}function koe(){koe=E,wbt=new ft}function Xy(){Xy=E,Tbt=new gt}function Zy(){Zy=E,kbt=new Bk}function Qy(){Qy=E,xvt=new Me}function $y(){$y=E,zbt=new bt}function Aoe(){Aoe=E,Gbt=new jt}function eb(){eb=E,qbt=new Mt}function tb(){tb=E,oxt=new cn}function nb(){nb=E,Xxt=new Gn}function rb(){rb=E,$Ot=new zc}function ib(){ib=E,uSt=new xi}function ab(){ab=E,E1=new Ki}function ob(){ob=E,xFt=new joe}function sb(){sb=E,wFt=new mde}function cb(){cb=E,l6=new Eve}function lb(){MMe(),this.c=new O_}function joe(){uy.call(this,gct,0)}function Moe(e,t,n,r){yHe(e,r,t,n)}function Noe(e,t,n,r){i2e(r,e,t,n)}function Poe(e,t,n,r){ort(r,e,t,n)}function Foe(e,t,n){nN(e.d,t.f,n)}function ub(e,t){BV(e.c.b,t.c,t)}function db(e,t){BV(e.c.c,t.b,t)}function fb(e,t){return e.a=t.g,e}function pb(){pb=E,Rzt=new Hc}function Ioe(){Ioe=E,Zzt=new al}function Loe(){Loe=E,ABt=new $re}function Roe(){Roe=E,jBt=new eie}function mb(){mb=E,V7=new rie}function zoe(){zoe=E,MBt=new iie}function hb(){hb=E,D7=new Wh}function gb(){gb=E,aVt=new Uh}function _b(){_b=E,JBt=new iue}function vb(){vb=E,u9=new aue}function yb(){yb=E,fVt=new vu}function bb(){bb=E,mVt=new yu}function xb(){xb=E,G9=new vd}function Sb(){this.q=new r.Date}function Boe(e){this.a=F(uj(e),229)}function Cb(e){return F(e,45).jd()}function Voe(e){return(e.c+e.a)/2}function Hoe(e){return e.e.a+e.f.a}function Uoe(e){return e.e.b+e.f.b}function Woe(e){return e.b?e.b:e.a}function Goe(e,t){return e.a.a.cc(t)}function Koe(e,t){return BWe(e.a,t)}function wb(e,t){return Iz(e,t)>0}function Tb(e,t){return Iz(e,t)<0}function qoe(e,t){return t.split(e)}function Eb(e){return e.b<e.d.gc()}function Joe(e,t){return Ak(e.a,t)}function Db(e,t){jxe.call(this,e,t)}function Ob(e){uye(),bYe.call(this,e)}function Yoe(e){uye(),Ob.call(this,e)}function kb(e){ok(),Ow.call(this,e)}function Ab(e,t){Nge(e,e.length,t)}function jb(e,t){tj(e,e.length,t)}function Mb(e,t){return e.a.get(t)}function Xoe(e,t){return EA(e.e,t)}function Nb(e){return Rj(e),!1}function Zoe(){return Aae(),new H_t}function Pb(e){return tE(e.a),e.b}function Qoe(e,t){this.b=e,this.a=t}function Fb(e,t){this.d=e,this.e=t}function $oe(e,t){this.a=e,this.b=t}function ese(e,t){this.a=e,this.b=t}function tse(e,t){this.a=e,this.b=t}function nse(e,t){this.a=e,this.b=t}function Ib(e,t){this.b=e,this.a=t}function Lb(e,t){this.a=e,this.b=t}function Rb(e,t){uy.call(this,e,t)}function zb(e,t){uy.call(this,e,t)}function Bb(e,t){uy.call(this,e,t)}function Vb(e,t){uy.call(this,e,t)}function Hb(e,t){uy.call(this,e,t)}function Ub(e,t){uy.call(this,e,t)}function Wb(e){pN.call(this,e,21)}function rse(e,t){this.b=e,this.a=t}function Gb(e,t){this.b=e,this.a=t}function ise(e,t){this.b=e,this.a=t}function ase(e,t){uy.call(this,e,t)}function Kb(e,t){uy.call(this,e,t)}function qb(e,t){uy.call(this,e,t)}function ose(e,t){this.b=e,this.a=t}function Jb(e,t){this.c=e,this.d=t}function Yb(e,t){uy.call(this,e,t)}function Xb(e,t){uy.call(this,e,t)}function sse(e,t){this.e=e,this.d=t}function Zb(e,t){uy.call(this,e,t)}function cse(e,t){this.a=e,this.b=t}function lse(e,t){uy.call(this,e,t)}function Qb(e,t){uy.call(this,e,t)}function $b(e,t){uy.call(this,e,t)}function ex(e,t,n){e.splice(t,0,n)}function use(e,t,n){e.Mb(n)&&t.Ad(n)}function dse(e,t,n){t.Ne(e.a.We(n))}function fse(e,t,n){t.Bd(e.a.Xe(n))}function pse(e,t,n){t.Ad(e.a.Kb(n))}function mse(e,t){return DT(e.c,t)}function hse(e,t){return DT(e.e,t)}function gse(e,t){this.a=e,this.b=t}function _se(e,t){this.a=e,this.b=t}function vse(e,t){this.a=e,this.b=t}function yse(e,t){this.a=e,this.b=t}function bse(e,t){this.a=e,this.b=t}function xse(e,t){this.a=e,this.b=t}function Sse(e,t){this.a=e,this.b=t}function Cse(e,t){this.a=e,this.b=t}function wse(e,t){this.b=e,this.a=t}function Tse(e,t){this.b=e,this.a=t}function Ese(e,t){this.b=e,this.a=t}function Dse(e,t){this.b=t,this.c=e}function tx(e,t){uy.call(this,e,t)}function nx(e,t){uy.call(this,e,t)}function Ose(e,t){uy.call(this,e,t)}function rx(e,t){uy.call(this,e,t)}function ix(e,t){uy.call(this,e,t)}function ax(e,t){uy.call(this,e,t)}function ox(e,t){uy.call(this,e,t)}function sx(e,t){uy.call(this,e,t)}function cx(e,t){uy.call(this,e,t)}function lx(e,t){uy.call(this,e,t)}function ux(e,t){uy.call(this,e,t)}function kse(e,t){uy.call(this,e,t)}function dx(e,t){uy.call(this,e,t)}function fx(e,t){uy.call(this,e,t)}function px(e,t){uy.call(this,e,t)}function mx(e,t){uy.call(this,e,t)}function hx(e,t){uy.call(this,e,t)}function gx(e,t){uy.call(this,e,t)}function _x(e,t){uy.call(this,e,t)}function vx(e,t){uy.call(this,e,t)}function Ase(e,t){uy.call(this,e,t)}function yx(e,t){uy.call(this,e,t)}function bx(e,t){uy.call(this,e,t)}function xx(e,t){uy.call(this,e,t)}function Sx(e,t){uy.call(this,e,t)}function Cx(e,t){uy.call(this,e,t)}function wx(e,t){uy.call(this,e,t)}function Tx(e,t){uy.call(this,e,t)}function jse(e,t){uy.call(this,e,t)}function Ex(e,t){uy.call(this,e,t)}function Dx(e,t){uy.call(this,e,t)}function Ox(e,t){uy.call(this,e,t)}function kx(e,t){uy.call(this,e,t)}function Ax(e,t){uy.call(this,e,t)}function jx(e,t){uy.call(this,e,t)}function Mse(e,t){this.b=e,this.a=t}function Nse(e,t){uy.call(this,e,t)}function Mx(e,t){this.a=e,this.b=t}function Pse(e,t){this.a=e,this.b=t}function Fse(e,t){this.a=e,this.b=t}function Ise(e,t){uy.call(this,e,t)}function Lse(e,t){uy.call(this,e,t)}function Rse(e,t){this.a=e,this.b=t}function zse(e,t){return xO(),t!=e}function Nx(e){return d$e(e,e.c),e}function Bse(e){r.clearTimeout(e)}function Px(e,t){uy.call(this,e,t)}function Vse(e,t){uy.call(this,e,t)}function Fx(e,t){this.a=e,this.b=t}function Ix(e,t){this.a=e,this.b=t}function Hse(e,t){this.b=e,this.d=t}function Use(e,t){this.a=e,this.b=t}function Lx(e,t){this.b=e,this.a=t}function Rx(e,t){uy.call(this,e,t)}function zx(e,t){uy.call(this,e,t)}function Bx(e,t){uy.call(this,e,t)}function Vx(e,t){uy.call(this,e,t)}function Wse(e,t){uy.call(this,e,t)}function Gse(e,t){this.b=e,this.a=t}function Kse(e,t){this.b=e,this.a=t}function qse(e,t){this.b=e,this.a=t}function Jse(e,t){this.b=e,this.a=t}function Yse(e,t){uy.call(this,e,t)}function Hx(e,t){uy.call(this,e,t)}function Xse(e,t){uy.call(this,e,t)}function Ux(e,t){uy.call(this,e,t)}function Wx(e,t){uy.call(this,e,t)}function Gx(e,t){uy.call(this,e,t)}function Kx(e,t){uy.call(this,e,t)}function qx(e,t){uy.call(this,e,t)}function Jx(e,t){uy.call(this,e,t)}function Zse(e,t){uy.call(this,e,t)}function Yx(e,t){uy.call(this,e,t)}function Xx(e,t){uy.call(this,e,t)}function Zx(e,t){uy.call(this,e,t)}function Qx(e,t){uy.call(this,e,t)}function Qse(e,t){uy.call(this,e,t)}function $x(e,t){uy.call(this,e,t)}function $se(e,t){uy.call(this,e,t)}function ece(e,t){this.a=e,this.b=t}function tce(e,t){this.a=e,this.b=t}function nce(e,t){this.a=e,this.b=t}function rce(e,t){return DT(e.g,t)}function ice(e,t){return DT(t.b,e)}function ace(e,t){return-e.b.$e(t)}function eS(e,t){uy.call(this,e,t)}function tS(e,t){uy.call(this,e,t)}function nS(e,t){uy.call(this,e,t)}function rS(e,t){uy.call(this,e,t)}function iS(e,t){uy.call(this,e,t)}function aS(e,t){uy.call(this,e,t)}function oS(e,t){uy.call(this,e,t)}function sS(e,t){uy.call(this,e,t)}function cS(e,t){uy.call(this,e,t)}function lS(e,t){uy.call(this,e,t)}function uS(e,t){uy.call(this,e,t)}function dS(e,t){uy.call(this,e,t)}function fS(e,t){uy.call(this,e,t)}function pS(e,t){uy.call(this,e,t)}function mS(e,t){uy.call(this,e,t)}function hS(e,t){uy.call(this,e,t)}function gS(e,t){uy.call(this,e,t)}function _S(e,t){uy.call(this,e,t)}function vS(e,t){uy.call(this,e,t)}function yS(e,t){uy.call(this,e,t)}function bS(e,t){uy.call(this,e,t)}function xS(e,t){uy.call(this,e,t)}function oce(e,t){this.a=e,this.b=t}function sce(e,t){this.a=e,this.b=t}function cce(e,t){this.a=e,this.b=t}function SS(e,t){this.a=e,this.b=t}function lce(e,t){this.a=e,this.b=t}function CS(e,t){this.a=e,this.b=t}function uce(e,t){this.a=e,this.b=t}function wS(e,t){this.a=e,this.b=t}function TS(e,t){uy.call(this,e,t)}function ES(e,t){this.a=e,this.b=t}function dce(e,t){this.a=e,this.b=t}function fce(e,t){this.a=e,this.b=t}function pce(e,t){this.a=e,this.b=t}function mce(e,t){this.a=e,this.b=t}function hce(e,t){this.a=e,this.b=t}function gce(e,t){this.b=e,this.a=t}function _ce(e,t){this.b=e,this.a=t}function vce(e,t){this.b=e,this.a=t}function yce(e,t){this.b=e,this.a=t}function bce(e,t){this.a=e,this.b=t}function xce(e,t){this.a=e,this.b=t}function Sce(e,t){this.a=e,this.b=t}function DS(e,t){this.a=e,this.b=t}function OS(e,t){uy.call(this,e,t)}function kS(e,t){this.f=e,this.c=t}function Cce(){gSe(),this.b=new yg}function wce(){AW(),this.a=new yg}function Tce(){ZD(),this.a=new dfe}function AS(e,t){this.a=e,this.b=t}function Ece(e,t){this.a=e,this.b=t}function Dce(e,t){this.i=e,this.g=t}function jS(e,t){this.d=e,this.e=t}function MS(e,t){this.a=e,this.b=t}function Oce(e,t){this.a=e,this.b=t}function kce(e,t){this.d=e,this.b=t}function Ace(e,t){this.e=e,this.a=t}function jce(e,t){e.i=null,pL(e,t)}function Mce(e,t){e&&Uj(C7,e,t)}function Nce(e,t){return sV(e.a,t)}function NS(e){return cV(e.c,e.b)}function PS(e){return typeof e===mK}function FS(e){return typeof e===Sat}function IS(e){return typeof e===Cat}function M(e){return e??null}function LS(e){return RO(e==null),e}function RS(e){return e?e.kd():null}function Pce(e){return KB(e),e.d.gc()}function zS(e,t){return e.Pd().Xb(t)}function BS(e,t){return KNe(e.Jc(),t)}function Fce(e,t){kAe(new Jw(e),t)}function Ice(e,t,n){fKe(t,OXe(e,n))}function Lce(e,t,n){fKe(t,OXe(e,n))}function Rce(e,t){aAe(e.a,F(t,12))}function zce(e,t){this.a=e,this.b=t}function VS(e,t){this.b=e,this.c=t}function HS(e,t){return Iz(e,t)==0}function US(e,t){return Iz(e,t)>=0}function WS(e,t){return Iz(e,t)!=0}function Bce(e,t){return e.a+=``+t,e}function Vce(e){return``+(Rj(e),e)}function Hce(e,t){e.q.setTime(PN(t))}function GS(e,t){return e.a+=``+t,e}function KS(e,t){return e.a+=``+t,e}function qS(e,t){return e.a+=``+t,e}function JS(e,t){return e.a+=``+t,e}function YS(e,t){return e.a+=``+t,e}function XS(e){return mN(e,0),null}function Uce(e){FA(this),GL(this,e)}function Wce(e,t){uA.call(this,e,t)}function Gce(e,t){uA.call(this,e,t)}function ZS(e,t){uA.call(this,e,t)}function Kce(){pSe(),jbe.call(this)}function qce(){pSe(),jbe.call(this)}function Jce(){dSe(),Xge.call(this)}function Yce(){Yce=E,jjt=kz(cPe())}function Xce(){Xce=E,ayt=kz(FVe())}function Zce(){Zce=E,Yxt=kz(z2e())}function Qce(){this.b=new Py(aR(12))}function $ce(){this.b=0,this.a=!1}function QS(){this.b=0,this.a=!1}function $S(e,t){lP(e,t,e.a,e.a.a)}function eC(e,t){lP(e,t,e.c.b,e.c)}function tC(e,t){hb(),Uj(D7,e,t)}function nC(e,t){nD.call(this,e,t)}function rC(e,t){hD.call(this,e,t)}function iC(e,t){Dce.call(this,e,t)}function ele(e,t){NT.call(this,e,t)}function aC(e,t){hR.call(this,e,t)}function oC(e){this.a=e,yd.call(this)}function tle(e){this.a=e,yd.call(this)}function sC(e){return e.a=0,e.b=0,e}function nle(e,t){return e.a=t.g+1,e}function cC(e,t){return e.j[t.p]==2}function lC(e,t){return EM(e.a,0,t)}function rle(e,t){return sB(e.a,t.a)}function uC(e,t){return sw(e.a,t.a)}function dC(e,t){return M_e(e.a,t.a)}function ile(e,t){return M(e)===M(t)}function fC(e,t){return e.indexOf(t)}function pC(e){return uj(e),new oC(e)}function ale(e){return lw(e.l,e.m,e.h)}function mC(e){return zM((Rj(e),e))}function ole(e){return zM((Rj(e),e))}function sle(e,t){return sw(e.g,t.g)}function hC(e){return typeof e===Sat}function cle(e){return e==w$||e==T$}function lle(e){return e==w$||e==D$}function gC(e){return e<10?`0`+e:``+e}function _C(e){return AF(e.b.b,e,0)}function vC(e,t){vF(e,0,e.length,t)}function yC(e,t){return Rw(e.a,t),t}function ule(e,t){return QD(),t.a+=e}function dle(e,t){return QD(),t.a+=e}function bC(e,t){return QD(),t.c+=e}function fle(e,t){return Rw(e.c,t),e}function xC(e,t){return eR(e.a,t),e}function ple(e){this.a=Zoe(),this.b=e}function mle(e){this.a=Zoe(),this.b=e}function SC(e){this.a=e.a,this.b=e.b}function CC(){Xp.call(this,new aP)}function hle(){pk.call(this,0,0,0,0)}function wC(){oM.call(this,0,0,0,0)}function TC(e){return eR(new Ij,e)}function EC(e){return eye(F(e,125))}function DC(e){return e.sh()&&e.th()}function OC(e){return e!=i5&&e!=a5}function kC(e){return e==y8||e==b8}function AC(e){return e==S8||e==v8}function gle(e){return e==T4||e==w4}function _le(e,t){return sB(t.f,e.f)}function vle(e,t){return sw(e.g,t.g)}function jC(e,t){return new hR(t,e)}function yle(e,t){return new hR(t,e)}function MC(e,t,n){jI(e,t),MI(e,n)}function NC(e,t,n){FI(e,t),AI(e,n)}function PC(e,t,n){II(e,t),LI(e,n)}function FC(e,t,n){NI(e,t),PI(e,n)}function IC(e,t,n){RI(e,t),zI(e,n)}function LC(e,t){Tz(e,t),UI(e,e.D)}function RC(e){kS.call(this,e,!0)}function zC(e,t,n){jE.call(this,e,t,n)}function BC(){Rb.call(this,`Head`,1)}function VC(){Rb.call(this,`Tail`,3)}function HC(e){JW(),XNe.call(this,e)}function UC(e){pk.call(this,e,e,e,e)}function WC(e){e.c=U(sQ,bK,1,0,5,1)}function ble(e){vI(e.Qf(),new bte(e))}function GC(e){return e==null?0:DL(e)}function xle(e,t){return hI(t,qM(e))}function Sle(e,t){return hI(t,qM(e))}function Cle(e,t){return e[e.length]=t}function wle(e,t){return e[e.length]=t}function Tle(e,t){return sL(gj(e.f),t)}function Ele(e,t){return sL(gj(e.n),t)}function Dle(e,t){return sL(gj(e.p),t)}function KC(e){return bhe(e.b.Jc(),e.a)}function Ole(e){return e==null?0:DL(e)}function qC(e,t){nD.call(this,e.b,t)}function kle(e,t){iF(nP(e.a),TSe(t))}function Ale(e,t){iF(IF(e.a),ESe(t))}function jle(e,t,n){PC(n,n.i+e,n.j+t)}function Mle(e,t,n){_j(e.c[t.g],t.g,n)}function Nle(e,t,n){F(e.c,72).Ei(t,n)}function JC(e,t,n){return _j(e,t,n),n}function YC(e,t){VQ||(e.b=t)}function XC(){XC=E,pg(),Qgt=new Wh}function Ple(){Ple=E,qAt=new JB(kRt)}function ZC(){ZC=E,r.Math.log(2)}function QC(){QC=E,f9=(Ioe(),Zzt)}function $C(){$C=E,new Fle,new Uh}function Fle(){new Wh,new Wh,new Wh}function Ile(){throw k(new x_(xgt))}function Lle(){throw k(new x_(bgt))}function Rle(){throw k(new x_(bgt))}function zle(){throw k(new x_(xgt))}function ew(e){cK(),Vh.call(this,e)}function Ble(e){this.a=e,dO.call(this,e)}function tw(e){this.a=e,ry.call(this,e)}function nw(e){this.a=e,ry.call(this,e)}function rw(e,t){kk(e.c,e.c.length,t)}function iw(e){return e.a<e.c.c.length}function aw(e){return e.a<e.c.a.length}function ow(e,t){return e.a?e.b:t.Ue()}function sw(e,t){return e<t?-1:+(e>t)}function cw(e,t){return Iz(e,t)>0?e:t}function lw(e,t,n){return{l:e,m:t,h:n}}function Vle(e,t){e.a!=null&&Rce(t,e.a)}function Hle(e){QM(e,null),eN(e,null)}function Ule(e,t,n){return Uj(e.g,n,t)}function Wle(e,t){uj(t),Xj(e).Ic(new h)}function Gle(){NGe(),this.a=new TW(Sbt)}function uw(e){this.b=e,this.a=new Uh}function Kle(e){this.b=new nt,this.a=e}function dw(e){lfe.call(this),this.a=e}function qle(e){Mbe.call(this),this.b=e}function Jle(){Rb.call(this,`Range`,2)}function fw(e){e.j=U(y_t,NK,325,0,0,1)}function pw(e){e.a=new de,e.c=new de}function Yle(e){e.a=new Wh,e.e=new Wh}function Xle(e){ySe(e,null),bSe(e,null)}function Zle(e,t,n){return nnt(e,t,n),n}function Qle(e,t){return oN(),t.n.b+=e}function mw(e,t,n){return bBe(t,n,e.c)}function $le(e,t,n){return Uj(e.k,n,t)}function hw(e,t){return Uj(e.a,t.a,t)}function eue(e,t){return ont(e.a,t,null)}function gw(e,t){return P(vj(e.i,t))}function _w(e,t){return P(vj(e.j,t))}function vw(e,t){return Ket(e.c,e.b,t)}function yw(e){return new SS(e.c,e.d)}function bw(e){return new SS(e.c,e.d)}function xw(e){return new SS(e.a,e.b)}function N(e,t){return e!=null&&bHe(e,t)}function Sw(e,t){return mFe(e.Jc(),t)!=-1}function Cw(e){return e.Ob()?e.Pb():null}function ww(e,t){return new Mue(e.Jc(),t)}function tue(e,t){e.q.setHours(t),vG(e,t)}function nue(e,t,n){e.c._c(t,F(n,136))}function Tw(e,t,n){e.c.Si(t,F(n,136))}function rue(e,t){IG(e),e.Fc(F(t,16))}function Ew(e,t){return e.a.Ac(t)!=null}function Dw(e){return TV(e,0,e.length)}function iue(){NT.call(this,null,null)}function aue(){PT.call(this,null,null)}function oue(){uy.call(this,`INSTANCE`,0)}function Ow(e){this.a=(dM(),new H_(e))}function sue(e){this.b=(dM(),new Zp(e))}function kw(e){this.a=e,Wh.call(this)}function Aw(){this.a=U(sQ,bK,1,8,5,1)}function cue(e,t,n,r){_j(e.a[t.g],n.g,r)}function jw(e,t,n){return e.a[t.g][n.g]}function Mw(e,t){return e.a[t.c.p][t.p]}function lue(e,t){return e.c[t.c.p][t.p]}function Nw(e,t){return e.e[t.c.p][t.p]}function uue(e,t){return e.j[t.p]=b0e(t)}function due(e,t){return NDe(e.f,t.Og())}function Pw(e,t){return A(P(t.a))<=e}function fue(e,t){return A(P(t.a))>=e}function Fw(e,t){return e.a.Ac(t)!=null}function pue(e,t){return e.a<jD(t)?-1:1}function Iw(e,t){return e.a*t.a+e.b*t.b}function mue(e,t){return NDe(e.b,t.Og())}function hue(e,t,n){return n?t!=0:t!=e-1}function gue(e,t,n){e.a=t^1502,e.b=n^Not}function _ue(e,t,n){return e.a=t,e.b=n,e}function Lw(e,t){return e.a*=t,e.b*=t,e}function Rw(e,t){return $h(e.c,t),!0}function zw(e,t,n){return _j(e.g,t,n),n}function vue(e,t){e.c&&(Ghe(t),_xe(t))}function Bw(e,t,n){Vw.call(this,e,t,n)}function Vw(e,t,n){CO.call(this,e,t,n)}function Hw(e,t,n){EO.call(this,e,t,n)}function yue(e,t,n){EO.call(this,e,t,n)}function bue(e,t,n){Hw.call(this,e,t,n)}function Uw(e,t,n){Vw.call(this,e,t,n)}function xue(e,t,n){Bw.call(this,e,t,n)}function Ww(e,t,n){CO.call(this,e,t,n)}function Gw(e,t,n){CO.call(this,e,t,n)}function Kw(e,t,n){Ww.call(this,e,t,n)}function qw(e){this.c=e,this.a=this.c.a}function Jw(e){this.i=e,this.f=this.i.j}function Yw(){this.Bb|=256,this.Bb|=512}function Xw(e,t){this.a=e,ry.call(this,t)}function Zw(e,t){return GRe(e,new L_,t).a}function Qw(e){if(!e)throw k(new sg)}function $w(e){if(!e)throw k(new cg)}function eT(){eT=E,eT(),$_t=new me}function tT(){tT=E,yb(),pVt=new hf}function nT(){nT=E,q_t=new e_(null)}function Sue(e){OM(e,amt),hW(e,Trt(e))}function Cue(e){e.a=F(lR(e.b.a,4),129)}function wue(e){e.a=F(lR(e.b.a,4),129)}function Tue(e){e.b.Qb(),--e.d.f.d,Pk(e.d)}function rT(e){this.a=e,Af.call(this,e.d)}function Eue(e,t){this.a=e,D_.call(this,t)}function Due(e,t){this.a=e,D_.call(this,t)}function Oue(e,t){this.a=e,D_.call(this,t)}function iT(e,t){this.a=t,D_.call(this,e)}function kue(e,t){this.a=t,pEe.call(this,e)}function Aue(e,t){this.a=e,pEe.call(this,t)}function jue(e,t){this.a=t,dy.call(this,e)}function Mue(e,t){this.a=t,dy.call(this,e)}function aT(e,t){return uj(t),new jue(e,t)}function oT(e,t){return new kXe(e.a,e.b,t)}function sT(e,t){return e.lastIndexOf(t)}function cT(e,t,n){return e.indexOf(t,n)}function lT(e){return e==null?xK:UB(e)}function Nue(e){return e==null?null:e.name}function Pue(e){return e.l+e.m*pq+e.h*mq}function Fue(e){return Wv(e.a)?DSe(e):null}function Iue(e){zf.call(this,F(uj(e),35))}function Lue(e){zf.call(this,F(uj(e),35))}function uT(e){Ip.call(this,(Rj(e),e))}function dT(e){Ip.call(this,(Rj(e),e))}function fT(e){Xp.call(this,new GOe(e))}function pT(e){Gp.call(this,e),this.a=e}function mT(e){Kp.call(this,e),this.a=e}function hT(e){H_.call(this,e),this.a=e}function gT(e){wg.call(this),FL(this,e)}function Rue(e){this.a=e,Wp.call(this,e)}function zue(){fw(this),hM(this),this.he()}function _T(){_T=E,vQ=!1,yQ=!0}function vT(e,t,n){return $L(e,t,t,n),e}function yT(e,t){return Rw(t.b,e.a),e.a}function bT(e,t){return Rw(t.a,e.a),e.a}function xT(e,t){return Rw(t.a,e.a),e.a}function ST(e){return tE(e.a!=null),e.a}function CT(e){return e.a==null?null:e.a}function wT(e){return e.$H||=++vvt}function TT(e){return iw(e.a)||iw(e.b)}function Bue(e,t){return sB(e.c.d,t.c.d)}function Vue(e,t){return sB(e.c.c,t.c.c)}function Hue(e,t){return sB(e.n.a,t.n.a)}function ET(e,t){return F(OP(e.b,t),16)}function Uue(e,t){return e.n.b=(Rj(t),t)}function Wue(e,t){return e.n.b=(Rj(t),t)}function DT(e,t){return!!t&&e.b[t.g]==t}function Gue(e,t){return sB(e.e.b,t.e.b)}function Kue(e,t){return sB(e.e.a,t.e.a)}function que(e,t,n){return vTe(e,t,n,e.b)}function OT(e,t,n){return vTe(e,t,n,e.c)}function Jue(e){return QD(),!!e&&!e.dc()}function kT(e,t){return++e.b,Rw(e.a,t)}function AT(e,t){return++e.b,kF(e.a,t)}function jT(e,t){aVe.call(this,e,t,null)}function MT(e,t){qk(),this.f=t,this.d=e}function NT(e,t){_b(),this.a=e,this.b=t}function PT(e,t){vb(),this.b=e,this.c=t}function Yue(){ib(),this.b=new Mm(this)}function FT(e){this.d=e,Jw.call(this,e)}function IT(e){this.c=e,Jw.call(this,e)}function LT(e){this.c=e,FT.call(this,e)}function Xue(e,t,n,r){i_e.call(this,e,t,n,r)}function RT(e,t,n){F(MF(e,t),22).Ec(n)}function zT(e,t,n){gB(e.a,n),fH(e.a,t)}function Zue(e,t){return Gk(e.c).Kd().Xb(t)}function BT(e,t){return new Ufe(e,e.gc(),t)}function VT(e){return++W9,new eP(3,e)}function HT(e){return oL(e,JK),new nF(e)}function Que(e){return N_(),JI((Bxe(),Bgt),e)}function $ue(e){return jM(),parseInt(e)||-1}function UT(e,t,n){return cT(e,iU(t),n)}function WT(e,t,n){e.dd(t).Rb(n)}function GT(e){var t=e.a;e.a=e.b,e.b=t}function KT(e,t){jDe(t,e),this.c=e,this.b=t}function ede(e,t){return $L(e,t,t+1,``),e}function qT(e){return tE(e.b!=0),e.a.a.c}function JT(e){return tE(e.b!=0),e.c.b.c}function YT(){YT=E,r$=new nD(_st,0)}function XT(e){return e.b=F(Hye(e.a),45)}function tde(e){return e.f==null?``+e.g:e.f}function ZT(e){return e.f==null?``+e.g:e.f}function nde(e){e.d=new aE(e),e.e=new Wh}function rde(e){if(!e)throw k(new ag)}function QT(e){if(!e)throw k(new sg)}function $T(e){if(!e)throw k(new cg)}function eE(e){if(!e)throw k(new rg)}function tE(e){if(!e)throw k(new dg)}function nE(e){jy(),this.b=e,this.a=!0}function rE(e){Oy(),this.b=e,this.a=!0}function iE(e){jit(),pre(this),this.Df(e)}function aE(e){fO.call(this,e,null,null)}function oE(e){this.c=e,this.a=1,this.b=1}function sE(e){return wI(),e.e.b+e.f.b/2}function ide(e){return wI(),e.e.a+e.f.a/2}function cE(e,t,n){return wI(),n.e.a-e*t}function ade(e,t,n){return wI(),n.e.b-e*t}function ode(e,t,n){return rb(),n.Lg(e,t)}function sde(e,t){return fU(),UU(e,t.e,t)}function cde(e,t,n){return Rw(t,Dze(e,n))}function lE(e,t){return F(YF(e.a,t),35)}function uE(e,t){return!!e.q&&EA(e.q,t)}function lde(e,t){return e>0?t*t/e:t*t*100}function ude(e,t){return e>0?t/(e*e):t*100}function dE(e,t){return e.a=t.a,e.b=t.b,e}function fE(e){return e.a=-e.a,e.b=-e.b,e}function pE(e,t,n){return e.a-=t,e.b-=n,e}function mE(e,t,n){return e.a+=t,e.b+=n,e}function dde(e,t,n){hF(),e.nf(t)&&n.Ad(e)}function fde(e){this.c=e,II(e,0),LI(e,0)}function pde(e){Dy.call(this),tL(this,e)}function mde(){uy.call(this,`GROW_TREE`,0)}function hE(e,t,n){cF.call(this,e,t,n,2)}function hde(e,t){_b(),NT.call(this,e,t)}function gE(e,t){vb(),PT.call(this,e,t)}function _E(e,t){vb(),PT.call(this,e,t)}function gde(e,t){vb(),gE.call(this,e,t)}function _de(e,t){return e.c.Ec(F(t,136))}function vde(e,t){return F(vj(e.e,t),26)}function yde(e,t){return F(vj(e.e,t),26)}function bde(e,t,n){aB(IF(e.a),t,ESe(n))}function xde(e,t,n){aB(nP(e.a),t,TSe(n))}function vE(e,t){QC(),yk.call(this,e,t)}function yE(e,t){QC(),yk.call(this,e,t)}function bE(e,t){QC(),yk.call(this,e,t)}function Sde(e,t){QC(),vE.call(this,e,t)}function xE(e,t){QC(),vE.call(this,e,t)}function Cde(e,t){QC(),xE.call(this,e,t)}function wde(e,t){QC(),yE.call(this,e,t)}function SE(e,t,n){return MG(NF(e,t),n)}function Tde(e,t,n){return t.xl(e.e,e.c,n)}function Ede(e,t,n){return t.yl(e.e,e.c,n)}function CE(e,t){return Uz(e.e,F(t,52))}function Dde(e,t){return(Rj(e),e)+jD(t)}function Ode(e){return e==null?null:UB(e)}function kde(e){return e==null?null:UB(e)}function Ade(e){return e==null?null:frt(e)}function jde(e){return e==null?null:MYe(e)}function wE(e){e.o??E1e(e)}function TE(e){return RO(e==null||PS(e)),e}function P(e){return RO(e==null||FS(e)),e}function EE(e){return RO(e==null||IS(e)),e}function DE(e){N(e,161)&&F(e,161).mi()}function OE(){hMe.call(this),this.Bb|=Cq}function Mde(e,t){this.d=e,Jee(this),this.b=t}function kE(e,t){this.c=e,ay.call(this,e,t)}function AE(e,t){this.a=e,kE.call(this,e,t)}function jE(e,t,n){qP.call(this,e,t,n,null)}function ME(e,t,n){qP.call(this,e,t,n,null)}function NE(e,t){eF.call(this,e),this.a=t}function PE(e,t){eF.call(this,e),this.a=t}function Nde(e,t){return eUe(e,t),new Hve(e,t)}function Pde(e,t,n){return e.Le(t,n)<=0?n:t}function Fde(e,t,n){return e.Le(t,n)<=0?t:n}function Ide(e){return Rj(e),e?1231:1237}function Lde(e,t){t.a?b$e(e,t):Fw(e.a,t.b)}function Rde(e,t){VQ||Rw(e.a,t)}function zde(e,t){return Yy(),iR(t.d.i,e)}function Bde(e,t){return EL(),new N6e(t,e)}function Vde(e,t){return F(YF(e.b,t),144)}function Hde(e,t){return F(YF(e.c,t),233)}function FE(e){return F(ck(e.a,e.b),295)}function Ude(e){return new SS(e.c,e.d+e.a)}function Wde(e){return oN(),gle(F(e,203))}function IE(e,t){return F(vj(e.b,t),278)}function LE(e,t){return OM(t,pst),e.f=t,e}function RE(e,t,n){return n=aG(e,t,3,n),n}function zE(e,t,n){return n=aG(e,t,6,n),n}function BE(e,t,n){return n=aG(e,t,9,n),n}function VE(e,t,n){++e.j,e.rj(),ZP(e,t,n)}function Gde(e,t,n){++e.j,e.oj(t,e.Xi(t,n))}function Kde(e,t,n){e.dd(t).Rb(n)}function qde(e,t){this.c=e,mI.call(this,t)}function Jde(e,t){this.a=e,ere.call(this,t)}function HE(e,t){this.a=e,ere.call(this,t)}function Yde(e){this.q=new r.Date(PN(e))}function Xde(){this.a=new PM,this.b=new PM}function UE(){UE=E,E7=new Xre,new Zre}function WE(){WE=E,M3=new jh(`root`)}function GE(){GE=E,oyt=LB((yV(),z5))}function KE(e){e.b?KE(e.b):e.f.c.yc(e.e,e.d)}function qE(e){this.a=(dM(),new Vp(uj(e)))}function Zde(e){this.a=(oL(e,JK),new nF(e))}function Qde(e){this.a=(oL(e,JK),new nF(e))}function $de(e){return e==null?null:e.message}function JE(e){return String.fromCharCode(e)}function efe(e){return wk(Zk(e,32))^wk(e)}function YE(e,t){return(t&hK)%e.d.length}function XE(e,t,n){return l9e(e.c,e.b,t,n)}function tfe(e,t,n){return e.apply(t,n)}function nfe(e,t,n){return jA(e,F(t,24),n)}function ZE(e,t,n){return e.a+=TV(t,0,n),e}function QE(e,t){var n=e.e;return e.e=t,n}function rfe(e,t){var n=t;return!!e.De(n)}function ife(e,t){e[Mot].call(e,t)}function afe(e,t){e[Mot].call(e,t)}function $E(e,t){e.a._c(e.b,t),++e.b,e.c=-1}function ofe(e){FA(e.e),e.d.b=e.d,e.d.a=e.d}function sfe(e,t,n){Iy(),op(e,t.Te(e.a,n))}function eD(e,t){return _T(),e==t?0:e?1:-1}function tD(e,t){return K_(Array(t),e)}function nD(e,t){jh.call(this,e),this.a=t}function cfe(e,t){Fh.call(this,e),this.a=t}function rD(e,t){Fh.call(this,e),this.a=t}function iD(){sD.call(this),this.a=new mv}function lfe(){this.n=new mv,this.o=new mv}function aD(){this.b=new mv,this.c=new Uh}function ufe(){this.a=new Uh,this.b=new Uh}function oD(){this.a=new it,this.b=new xre}function dfe(){this.b=new aP,this.a=new aP}function ffe(){this.b=new yg,this.a=new yg}function pfe(){this.a=new Uh,this.d=new Uh}function mfe(){this.b=new Wh,this.a=new Wh}function hfe(){this.b=new Jv,this.a=new po}function gfe(){this.a=new Ad,this.b=new Yi}function sD(){this.n=new Pg,this.i=new wC}function cD(e){return!e.a&&(e.a=new w),e.a}function lD(e,t){return e.a+=t.a,e.b+=t.b,e}function uD(e,t){return e.a-=t.a,e.b-=t.b,e}function _fe(e){return mg(e.j.c,0),e.a=-1,e}function vfe(e,t,n){return n=aG(e,t,11,n),n}function yfe(e,t,n){n!=null&&dL(t,kUe(e,n))}function bfe(e,t,n){n!=null&&fL(t,kUe(e,n))}function dD(e,t,n,r){R.call(this,e,t,n,r)}function fD(e,t,n,r){pk.call(this,e,t,n,r)}function xfe(e,t,n,r){R.call(this,e,t,n,r)}function Sfe(e,t,n,r){xfe.call(this,e,t,n,r)}function Cfe(e,t,n,r){vA.call(this,e,t,n,r)}function pD(e,t,n,r){vA.call(this,e,t,n,r)}function wfe(e,t,n,r){pD.call(this,e,t,n,r)}function Tfe(e,t,n,r){vA.call(this,e,t,n,r)}function mD(e,t,n,r){Tfe.call(this,e,t,n,r)}function Efe(e,t,n,r){pD.call(this,e,t,n,r)}function Dfe(e,t,n,r){Efe.call(this,e,t,n,r)}function Ofe(e,t,n,r){yA.call(this,e,t,n,r)}function hD(e,t){r_.call(this,dZ+e+nZ+t)}function kfe(e,t){kC(e.f)?h1e(e,t):Wqe(e,t)}function Afe(e,t){return e.hk().ti().oi(e,t)}function gD(e,t){return e.hk().ti().qi(e,t)}function jfe(e,t){return e.n.a=(Rj(t),t)+10}function Mfe(e,t){return e.n.a=(Rj(t),t)+10}function Nfe(e,t){return e.e=F(e.d.Kb(t),162)}function Pfe(e,t){return t==e||BH(pW(t),e)}function _D(e,t,n){return e.lastIndexOf(t,n)}function vD(e,t){return Rj(e),M(e)===M(t)}function yD(e,t){return Rj(e),M(e)===M(t)}function Ffe(e,t){return Uj(e.a,t,``)==null}function bD(e,t){return e.b.zd(new ese(e,t))}function Ife(e,t){return e.b.zd(new tse(e,t))}function Lfe(e,t){return e.b.zd(new nse(e,t))}function Rfe(e,t){return K(t,(rK(),g2),e)}function zfe(e,t,n){return sB(e[t.a],e[n.a])}function xD(e,t){return sw(e.a.d.p,t.a.d.p)}function Bfe(e,t){return sw(t.a.d.p,e.a.d.p)}function Vfe(e,t){return Yy(),!iR(t.d.i,e)}function Hfe(e,t){VQ||t&&(e.d=t)}function SD(e,t){Ehe.call(this,e,e.length,t)}function CD(e){this.c=e,ZS.call(this,RK,0)}function Ufe(e,t,n){this.a=e,KT.call(this,t,n)}function Wfe(e,t){this.c=e,GA.call(this,e,t)}function Gfe(e,t,n){this.c=t,this.b=n,this.a=e}function wD(e){xO(),this.d=e,this.a=new Aw}function Kfe(e){return e<100?null:new _v(e)}function qfe(e){return e.c?AF(e.c.a,e,0):-1}function Jfe(e,t){return sB(e.c.e.a,t.c.e.a)}function TD(e,t){return sB(e.b.e.a,t.b.e.a)}function Yfe(e,t){return sB(e.c-e.s,t.c-t.s)}function ED(e,t,n){return F(e.c,72).Uk(t,n)}function DD(e,t,n){return F(e.c,72).Vk(t,n)}function Xfe(e,t,n){return Tde(e,F(t,344),n)}function OD(e,t,n){return Ede(e,F(t,344),n)}function Zfe(e,t,n){return iqe(e,F(t,344),n)}function Qfe(e,t,n){return fJe(e,F(t,344),n)}function $fe(e,t){return N(t,16)&&D3e(e.c,t)}function kD(e,t){return t==null?null:Fz(e.b,t)}function AD(e){return e==e5||e==n5||e==t5}function jD(e){return FS(e)?(Rj(e),e):e.se()}function MD(e){return!isNaN(e)&&!isFinite(e)}function ND(e){pw(this),mM(this),FL(this,e)}function PD(e){WC(this),Ohe(this.c,0,e.Nc())}function FD(e,t,n){this.a=e,this.b=t,this.c=n}function ID(e,t,n){this.a=e,this.b=t,this.c=n}function epe(e,t,n){this.d=e,this.b=n,this.a=t}function tpe(e){this.a=e,Ay(),oR(Date.now())}function LD(e){if(!e)throw k(new d_(Dat))}function npe(e,t){if(!e)throw k(new u_(t))}function RD(e,t){if(e!=t)throw k(new ag)}function zD(){zD=E,G_t=new fe,K_t=new pe}function BD(e){var t=new Ue;return t.e=e,t}function rpe(e,t){return t.ni(e.a)}function ipe(e,t,n){return Iy(),e.a.Wd(t,n),t}function VD(e){Fj(e.a),zOe(e.c,e.b),e.b=null}function ape(e){return lK(),JI((Xce(),ayt),e)}function ope(e){return QF(),JI((iOe(),Fvt),e)}function HD(e){return bF(),JI((rOe(),Mvt),e)}function spe(e){return xF(),JI((jke(),avt),e)}function cpe(e){return bz(),JI((oOe(),gvt),e)}function lpe(e){return xI(),JI((aOe(),kvt),e)}function upe(e){return SR(),JI((Pke(),uyt),e)}function UD(e){return iI(),JI((LEe(),Eyt),e)}function WD(e){return LF(),JI((sOe(),vbt),e)}function GD(e){return cU(),JI((BAe(),Cbt),e)}function dpe(e){return zR(),JI((Fke(),Nbt),e)}function KD(e){return FV(),JI((Nke(),Wbt),e)}function fpe(e){return cW(),JI((oPe(),Xbt),e)}function ppe(e){pk.call(this,e.d,e.c,e.a,e.b)}function qD(e){pk.call(this,e.d,e.c,e.a,e.b)}function mpe(e,t,n){this.b=e,this.c=t,this.a=n}function JD(e,t,n){this.b=e,this.a=t,this.c=n}function hpe(e,t,n){this.a=e,this.b=t,this.c=n}function gpe(e,t,n){this.a=e,this.b=t,this.c=n}function _pe(e,t,n){this.a=e,this.b=t,this.c=n}function vpe(e,t,n){this.b=e,this.a=t,this.c=n}function YD(e,t,n){this.e=t,this.b=e,this.d=n}function ype(e){var t=new Nre;return t.b=e,t}function XD(){XD=E,H$=new kn,U$=new An}function ZD(){ZD=E,rSt=new $n,nSt=new er}function QD(){QD=E,dSt=new ii,fSt=new ai}function bpe(){bpe=E,pBt=U(sQ,bK,1,0,5,1)}function xpe(){xpe=E,HBt=U(sQ,bK,1,0,5,1)}function Spe(){Spe=E,UBt=U(sQ,bK,1,0,5,1)}function Cpe(e){return CL(),JI((REe(),lxt),e)}function wpe(e){return sK(),JI((Zce(),Yxt),e)}function Tpe(e){return RR(),JI((Mke(),tSt),e)}function Epe(e){return xR(),JI((zke(),gSt),e)}function Dpe(e){return ZH(),JI((HAe(),vSt),e)}function Ope(e){return JP(),JI((SEe(),zSt),e)}function kpe(e){return EU(),JI((Vje(),FSt),e)}function Ape(e){return XB(),JI((Ike(),USt),e)}function $D(e){return QI(),JI((SOe(),qSt),e)}function jpe(e){return lW(),JI((zPe(),rCt),e)}function Mpe(e){return aI(),JI((CEe(),oCt),e)}function Npe(e){return VR(),JI((COe(),lCt),e)}function Ppe(e){return TL(),JI((dOe(),wSt),e)}function Fpe(e){return HH(),JI((Uje(),ECt),e)}function Ipe(e){return hU(),JI((Hje(),gCt),e)}function eO(e){return SF(),JI((xEe(),yCt),e)}function Lpe(e){return pU(),JI((Wje(),NCt),e)}function Rpe(e){return IW(),JI((bFe(),FCt),e)}function zpe(e){return yR(),JI((cOe(),zCt),e)}function Bpe(e){return BR(),JI((lOe(),HCt),e)}function Vpe(e){return $F(),JI((uOe(),WCt),e)}function Hpe(e){return YN(),JI((wEe(),JCt),e)}function Upe(e){return VW(),JI((sPe(),PSt),e)}function Wpe(e){return YB(),JI((KAe(),_wt),e)}function Gpe(e){return dP(),JI((TEe(),xwt),e)}function Kpe(e){return xW(),JI((BPe(),ukt),e)}function qpe(e){return zz(),JI((gOe(),mkt),e)}function Jpe(e){return iH(),JI((Lke(),_kt),e)}function Ype(e){return ZV(),JI((VAe(),Skt),e)}function Xpe(e){return XW(),JI((yFe(),Okt),e)}function Zpe(e){return EV(),JI((Rke(),Nkt),e)}function Qpe(e){return RF(),JI((EEe(),Lkt),e)}function $pe(e){return $I(),JI((mOe(),zkt),e)}function eme(e){return vR(),JI((pOe(),Wkt),e)}function tme(e){return yz(),JI((fOe(),Jkt),e)}function nme(e){return Cz(),JI((hOe(),Qkt),e)}function rme(e){return ZI(),JI((_Oe(),rAt),e)}function ime(e){return wR(),JI((vOe(),oAt),e)}function ame(e){return Rz(),JI((Bke(),DAt),e)}function ome(e){return XN(),JI((DEe(),PAt),e)}function sme(e){return IM(),JI((OEe(),UAt),e)}function cme(e){return JM(),JI((kEe(),GAt),e)}function lme(e){return VP(),JI((AEe(),cjt),e)}function ume(e){return FM(),JI((jEe(),hjt),e)}function dme(e){return OH(),JI((Uke(),_jt),e)}function fme(e){return ZW(),JI((Yce(),jjt),e)}function pme(e){return az(),JI((yOe(),Fjt),e)}function mme(e){return Sz(),JI((Hke(),IMt),e)}function hme(e){return CN(),JI((MEe(),BMt),e)}function gme(e){return wL(),JI((NEe(),KMt),e)}function _me(e){return $H(),JI((UAe(),$Mt),e)}function vme(e){return vz(),JI((bOe(),sNt),e)}function yme(e){return gF(),JI((PEe(),rNt),e)}function bme(e){return _H(),JI((Vke(),KNt),e)}function xme(e){return bR(),JI((TOe(),ZNt),e)}function Sme(e){return vV(),JI((wOe(),ePt),e)}function Cme(e){return aU(),JI((Wke(),oPt),e)}function wme(e){return RB(),JI((xOe(),hPt),e)}function Tme(e){return _P(),JI((FEe(),aFt),e)}function Eme(e){return CF(),JI((DOe(),uFt),e)}function Dme(e){return dB(),JI((EOe(),hFt),e)}function tO(e){return sb(),JI(($we(),EFt),e)}function Ome(e){return uB(),JI((OOe(),bFt),e)}function kme(e){return ob(),JI((Qwe(),CFt),e)}function Ame(e){return HP(),JI((IEe(),kFt),e)}function jme(e){return _U(),JI((GAe(),IFt),e)}function Mme(e){return _W(),JI((WAe(),vFt),e)}function Nme(e){return cb(),JI((eTe(),_It),e)}function Pme(e){return TR(),JI((zEe(),bIt),e)}function Fme(e){return HV(),JI((qAe(),MIt),e)}function Ime(e){return CU(),JI((iPe(),FIt),e)}function Lme(e){return aH(),JI((Gje(),BIt),e)}function Rme(e){return JH(),JI((Jje(),nLt),e)}function zme(e){return cB(),JI((JAe(),xRt),e)}function Bme(e){return Bz(),JI((Gke(),TRt),e)}function Vme(e){return SI(),JI((kOe(),DRt),e)}function Hme(e){return fB(),JI((Kke(),ARt),e)}function Ume(e){return oU(),JI((Yje(),RRt),e)}function Wme(e){return _z(),JI((AOe(),KRt),e)}function Gme(e){return kH(),JI((qke(),YRt),e)}function Kme(e){return eW(),JI((LPe(),XRt),e)}function qme(e){return UV(),JI((XAe(),$Rt),e)}function Jme(e){return QH(),JI((Kje(),tzt),e)}function Yme(e){return IU(),JI((qje(),nzt),e)}function Xme(e){return YG(),JI((YAe(),rzt),e)}function Zme(e){return kI(),JI((jOe(),fzt),e)}function Qme(e){return yV(),JI((Yke(),pzt),e)}function $me(e){return tG(),JI((RPe(),gzt),e)}function ehe(e){return lB(),JI((MOe(),yzt),e)}function the(e){return uP(),JI((Jke(),wzt),e)}function nhe(e){return ZB(),JI((Xke(),Azt),e)}function rhe(e){return xz(),JI((Zke(),Lzt),e)}function ihe(e,t){return(Rj(e),e)+(Rj(t),t)}function nO(e,t){this.c=e,this.a=t,this.b=t-e}function ahe(e,t,n){this.a=e,this.c=t,this.b=n}function rO(e,t,n){this.a=e,this.c=t,this.b=n}function ohe(e,t,n){this.a=e,this.b=t,this.c=n}function iO(e,t,n){this.a=e,this.b=t,this.c=n}function she(e,t,n){this.a=e,this.b=t,this.c=n}function aO(e,t,n){this.a=e,this.b=t,this.c=n}function che(e,t,n){this.a=e,this.b=t,this.c=n}function lhe(e,t,n){this.a=e,this.b=t,this.c=n}function oO(e,t,n){this.e=e,this.a=t,this.c=n}function uhe(e,t,n){QC(),fxe.call(this,e,t,n)}function sO(e,t,n){QC(),dve.call(this,e,t,n)}function dhe(e,t,n){QC(),dve.call(this,e,t,n)}function fhe(e,t,n){QC(),dve.call(this,e,t,n)}function phe(e,t,n){QC(),sO.call(this,e,t,n)}function mhe(e,t,n){QC(),sO.call(this,e,t,n)}function hhe(e,t,n){QC(),mhe.call(this,e,t,n)}function ghe(e,t,n){QC(),dhe.call(this,e,t,n)}function _he(e,t,n){QC(),fhe.call(this,e,t,n)}function vhe(e){return QU(),JI((aPe(),oBt),e)}function cO(e,t){return uj(e),uj(t),new toe(e,t)}function lO(e,t){return uj(e),uj(t),new PO(e,t)}function yhe(e,t){return uj(e),uj(t),new FO(e,t)}function bhe(e,t){return uj(e),uj(t),new doe(e,t)}function uO(e,t){goe.call(this,e,OB(new y_(t)))}function xhe(e,t){this.c=e,this.b=t,this.a=!1}function dO(e){this.d=e,Jee(this),this.b=$ge(e.d)}function fO(e,t,n){this.c=e,Fb.call(this,t,n)}function She(e){return!e.c&&(e.c=new El),e.c}function Che(e){return!e.e&&(e.e=new Uh),e.e}function pO(e){var t=new Uh;return JF(t,e),t}function whe(e){var t=new yg;return JF(t,e),t}function The(e){var t=new wg;return OL(t,e),t}function mO(e){var t=new Dy;return OL(t,e),t}function F(e,t){return RO(e==null||bHe(e,t)),e}function Ehe(e,t,n){dA.call(this,t,n),this.a=e}function Dhe(e,t,n){this.b=e,Wce.call(this,t,n)}function Ohe(e,t,n){HQe(n,0,e,t,n.length,!1)}function hO(e,t){if(!e)throw k(new u_(t))}function gO(e,t){if(!e)throw k(new d_(t))}function khe(e,t){if(!e)throw k(new Bie(t))}function Ahe(e,t){t&&(e.b=t,e.a=(Nj(t),t.a))}function _O(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function jhe(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function vO(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Mhe(e){var t=e.b;e.b=e.c,e.c=t}function Nhe(e){return tE(e.b!=0),gI(e,e.c.b)}function yO(e){return tE(e.b!=0),gI(e,e.a.a)}function Phe(e,t){return wI(),sB(e.e.a,t.e.a)}function Fhe(e,t){return wI(),sB(e.e.b,t.e.b)}function Ihe(e,t){return ab(),sw(e.d.p,t.d.p)}function Lhe(e,t){return sw(Yhe(e.d),Yhe(t.d))}function bO(e,t){return t&&Aj(e,t.d)?t:null}function Rhe(e,t){return t==(YG(),N5)?e.c:e.d}function xO(){xO=E,AAt=(YG(),N5),q4=p5}function zhe(){this.b=A(P(GV((cG(),Gyt))))}function Bhe(){this.a=`;,;`,this.b=``,this.c=``}function SO(e,t,n){Jb.call(this,e,t),this.b=n}function CO(e,t,n){jS.call(this,e,t),this.c=n}function wO(e){Spe(),ol.call(this),this._h(e)}function TO(e,t,n){this.a=e,iC.call(this,t,n)}function I(e,t,n){this.a=e,iC.call(this,t,n)}function EO(e,t,n){jS.call(this,e,t),this.c=n}function DO(){BP(),mve.call(this,(mb(),V7))}function Vhe(e){return cK(),++W9,new vk(0,e)}function OO(){OO=E,hVt=(dM(),new Vp(Iht))}function Hhe(e){return new SS(e.c+e.b,e.d+e.a)}function L(e){return e!=null&&!qB(e,O7,k7)}function Uhe(e,t){return(dRe(e)<<4|dRe(t))&aq}function Whe(e,t){var n=e.c;return VMe(e,t),n}function kO(e,t){return t<0?e.g=-1:e.g=t,e}function AO(e,t){return Oje(e),e.a*=t,e.b*=t,e}function jO(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function MO(e,t){return lP(e,t,e.c.b,e.c),!0}function Ghe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function NO(e){this.b=e,this.a=Wk(this.b.a).Md()}function PO(e,t){this.b=e,this.a=t,yd.call(this)}function FO(e,t){this.a=e,this.b=t,yd.call(this)}function IO(e,t){dA.call(this,t,1040),this.a=e}function LO(e){KT.call(this,e.length,0),this.a=e}function RO(e){if(!e)throw k(new l_(null))}function zO(e){return yF(e.slice(),e)}function BO(e){var t=e.n;return e.a.b+t.d+t.a}function Khe(e){var t=e.n;return e.e.b+t.d+t.a}function VO(e){var t=e.n;return e.e.a+t.b+t.c}function HO(e){return e.a?e.a:kye(e)}function UO(e,t){return LH(e,new Jb(t.a,t.b))}function qhe(e){return!yP(e)&&e.c.i.c==e.d.i.c}function Jhe(e,t){return e.c<t.c?-1:e.c==t.c?0:1}function WO(e){return e.b.c.length-e.e.c.length}function Yhe(e){return e.e.c.length-e.g.c.length}function GO(e){return e.e.c.length+e.g.c.length}function KO(e){return e==0||isNaN(e)?e:e<0?-1:1}function Xhe(e){return CI(),U(d3,QY,40,e,0,1)}function qO(e,t,n){return Uj(e.b,F(n.b,17),t)}function Zhe(e,t,n){return Uj(e.b,F(n.b,17),t)}function JO(e,t,n){return wI(),n.e.b+n.f.b+e*t}function Qhe(e,t,n){return wI(),n.e.a+n.f.a+e*t}function YO(e){return oN(),(YG(),v5).Gc(e.j)}function $he(e,t){return Rw(e,new SS(t.a,t.b))}function XO(e,t,n){sI(e,t,new wj(n))}function ZO(e,t,n){var r=e[t];return e[t]=n,r}function QO(e,t){var n;return++e.j,n=e.Aj(t),n}function $O(e,t,n){return e.a=-1,RT(e,t.g,n),e}function ek(e,t,n,r){FBe.call(this,e,t,n,r,0,0)}function tk(e,t){VS.call(this,e,t),this.a=this}function ege(e){Spe(),wO.call(this,e),this.a=-1}function nk(){bS.call(this,`COUNT_CHILDREN`,0)}function tge(){_O(this,!1,!1,!1,!1)}function nge(){nge=E,d_t=U(TQ,NK,15,256,0,1)}function rk(){rk=E,new kHe((Kg(),Fgt),(Jg(),Pgt))}function rge(e){e.a.jd(),F(e.a.kd(),18).gc(),Gie()}function ige(e){return e.e.Pd().gc()*e.c.Pd().gc()}function ik(e,t,n){return new Gfe(kve(e).Ze(),n,t)}function ak(){ak=E,Hgt=new xCe((dM(),dM(),IQ))}function ok(){ok=E,Wgt=new kb((dM(),dM(),RQ))}function age(){age=E,c_t=U(xQ,NK,221,256,0,1)}function oge(){oge=E,u_t=U(SQ,NK,180,128,0,1)}function sge(){sge=E,p_t=U(EQ,NK,190,256,0,1)}function cge(){cge=E,v_t=U(DQ,NK,191,256,0,1)}function lge(e,t){HMe(e,t==null?null:(Rj(t),t))}function uge(e,t){GMe(e,t==null?null:(Rj(t),t))}function dge(e,t){GMe(e,t==null?null:(Rj(t),t))}function sk(e,t){var n=lj(e,t);return n.i=2,n}function fge(e,t){return e.a+=TV(t,0,t.length),e}function ck(e,t){return mN(t,e.c.length),e.c[t]}function pge(e,t){return mN(t,e.a.length),e.a[t]}function mge(e,t){var n;for(n=0;n<t;++n)e[n]=-1}function hge(e,t){return Rj(e),KL(e,(Rj(t),t))}function gge(e,t){return Rj(t),KL(t,(Rj(e),e))}function lk(e){return e.q?e.q:(dM(),dM(),LQ)}function uk(e){for(uj(e);e.Ob();)e.Pb(),e.Qb()}function _ge(e){if(e.c.e!=e.a)throw k(new ag)}function vge(e){if(e.e.c!=e.b)throw k(new ag)}function yge(e){this.c=e,this.a=new Ey(this.c.a)}function bge(e){this.a=e,this.c=new Wh,AFe(this)}function xge(e){this.c=e,this.b=this.c.d.vc().Jc()}function dk(e){this.a=new Py(e.gc()),FL(this,e)}function Sge(e){Xp.call(this,new aP),FL(this,e)}function fk(e,t){Iy(),eF.call(this,e),this.a=t}function pk(e,t,n,r){jhe(this,e,t,n,r)}function mk(e,t,n,r,i,a){return SKe(e,t,n,r,i,0,a)}function Cge(e,t,n){return sw(t.d[e.g],n.d[e.g])}function wge(e,t,n){return sw(e.d[t.p],e.d[n.p])}function Tge(e,t,n){return sw(e.d[t.p],e.d[n.p])}function Ege(e,t,n){return sw(e.d[t.p],e.d[n.p])}function Dge(e,t,n){return sw(e.d[t.p],e.d[n.p])}function hk(e,t,n){return r.Math.min(n/e,1/t)}function Oge(e,t){return e?0:r.Math.max(0,t-1)}function kge(e){return e.c-F(ck(e.a,e.b),295).b}function gk(e,t){return e==null?t==null:vD(e,t)}function Age(e,t){return e==null?t==null:NV(e,t)}function _k(e,t){return cK(),++W9,new KA(e,t)}function vk(e,t){cK(),Vh.call(this,e),this.a=t}function yk(e,t){QC(),Ih.call(this,t),this.a=e}function bk(e){mI.call(this,e.gc()),sj(this,e)}function xk(e,t,n){this.a=e,Vw.call(this,t,n,2)}function jge(e){this.b=new Dy,this.a=e,this.c=-1}function Sk(e){return e.c?e.c.f:e.e.b}function Ck(e){return e.c?e.c.g:e.e.a}function wk(e){return hC(e)?e|0:zae(e)}function Mge(e){var t=kKe(e);return t?Mge(t):e}function Tk(e,t){return e.a??q3e(e),e.a[t]}function Ek(e,t){return!e&&(e=[]),e[e.length]=t,e}function Dk(e,t){var n=LB(e);return VFe(n,t),n}function Nge(e,t,n){var r;for(r=0;r<t;++r)e[r]=n}function Ok(e,t,n){iN(t,e.c.length),ex(e.c,t,n)}function kk(e,t,n){zIe(0,t,e.length),vF(e,0,t,n)}function Ak(e,t){return N(t,24)&&DT(e,F(t,24))}function Pge(e,t){return N(t,24)&&xje(e,F(t,24))}function jk(e,t){return ZIe(e,t,YEe(e,e.b.Ae(t)))}function Fge(e,t){return e.a.get(t)!==void 0}function Ige(e){return Array.isArray(e)&&e.Rm===T}function Mk(e){return dW(e,26)*jq+dW(e,27)*Mq}function Lge(e,t){Nk(e,uD(new SS(t.a,t.b),e.c))}function Nk(e,t){lD(e.c,t),e.b.c+=t.a,e.b.d+=t.b}function Pk(e){e.b?Pk(e.b):e.d.dc()&&e.f.c.Ac(e.e)}function Fk(e,t,n){var r;e&&(r=e.i,r.c=t,r.b=n)}function Ik(e,t,n){var r;e&&(r=e.i,r.d=t,r.a=n)}function Rge(e,t,n){return-sw(e.f[t.p],e.f[n.p])}function zge(e,t,n){return MA(e,new Lb(t.a,n.a))}function Bge(e,t,n){l1e(n,e,1),Rw(t,new yse(n,e))}function Vge(e,t,n){IH(n,e,1),Rw(t,new Tse(n,e))}function Hge(e,t,n){return n=aG(e,F(t,52),7,n),n}function Uge(e,t,n){return n=aG(e,F(t,52),3,n),n}function Lk(e,t,n){return e.a=-1,RT(e,t.g+1,n),e}function Wge(e,t,n){this.a=e,Bw.call(this,t,n,22)}function Rk(e,t,n){this.a=e,Bw.call(this,t,n,14)}function Gge(e,t,n,r){QC(),awe.call(this,e,t,n,r)}function Kge(e,t,n,r){QC(),awe.call(this,e,t,n,r)}function qge(e,t){(t.Bb&IX)!=0&&!e.a.o&&(e.a.o=t)}function zk(e,t){this.b=new Dy,this.a=e,this.c=t}function Bk(){this.b=new yt,this.c=new Obe(this)}function Jge(){this.d=new Ve,this.e=new Dbe(this)}function Yge(){oN(),this.k=new Wh,this.d=new yg}function Xge(){dSe(),this.g=new Dy,this.f=new Dy}function Vk(e){xb(),this.a=0,this.b=e-1,this.c=1}function Zge(e){return cK(),++W9,new pxe(10,e,0)}function Qge(e){return e.f||=e.Cc()}function Hk(e){return e.i||=e.bc()}function Uk(e){if(e.e.j!=e.d)throw k(new ag)}function Wk(e){return e.c?e.c:e.c=e.Qd()}function Gk(e){return e.d?e.d:e.d=e.Rd()}function Kk(e,t){return QBe(NF(e,t))?t.wi():null}function $ge(e){return N(e,16)?F(e,16).cd():e.Jc()}function e_e(e){return e.Oc(U(sQ,bK,1,e.gc(),5,1))}function t_e(){t_e=E,Lgt=new LO(U(sQ,bK,1,0,5,1))}function qk(){qk=E,zzt=new qC((oK(),n8),0)}function n_e(){bS.call(this,`LOOKAHEAD_LAYOUT`,1)}function r_e(e){fw(this),this.g=e,hM(this),this.he()}function i_e(e,t,n,r){this.a=e,qP.call(this,e,t,n,r)}function Jk(e){this.a=(t_e(),Lgt),this.d=F(uj(e),50)}function Yk(e,t){return rR(fYe(hC(e)?pR(e):e,t))}function Xk(e,t){return rR(H$e(hC(e)?pR(e):e,t))}function Zk(e,t){return rR(YYe(hC(e)?pR(e):e,t))}function a_e(e,t){return eD((Rj(e),e),(Rj(t),t))}function Qk(e,t){return sB((Rj(e),e),(Rj(t),t))}function $k(e,t){return uj(t),e.a.Hd(t)&&!e.b.Hd(t)}function eA(e,t){return lw(e.l&t.l,e.m&t.m,e.h&t.h)}function o_e(e,t){return lw(e.l|t.l,e.m|t.m,e.h|t.h)}function tA(e,t){return lw(e.l^t.l,e.m^t.m,e.h^t.h)}function nA(e){return e!=null&&TA(e)&&e.Rm!==T}function rA(e){return!Array.isArray(e)&&e.Rm===T}function iA(e,t){return Zz(e,(Rj(t),new lte(t)))}function aA(e,t){return Zz(e,(Rj(t),new ute(t)))}function s_e(e){return HL(),F(e,12).e.c.length!=0}function c_e(e){return HL(),F(e,12).g.c.length!=0}function l_e(e,t){return EL(),sB(t.a.o.a,e.a.o.a)}function oA(e){return hC(e)?``+e:S3e(e)}function sA(e,t){if(e<0||e>=t)throw k(new Vre)}function u_e(e,t,n){e.a.Mb(n)&&(e.b=!0,t.Ad(n))}function cA(e){e.d||(e.d=e.b.Jc(),e.c=e.b.gc())}function d_e(e){return e.e?WDe(e.e):null}function f_e(e,t,n){return fat(e,F(t,12),F(n,12))}function p_e(e,t,n){t.of(n,A(P(vj(e.b,n)))*e.a)}function m_e(e,t,n){return LW(),JL(e,t)&&JL(e,n)}function h_e(e,t){t.Tg(`General 'Rotator`,1),Knt(e)}function lA(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function g_e(e){for(var t=e;t.f;)t=t.f;return t}function uA(e,t){this.e=e,this.d=t&64?t|PK:t}function dA(e,t){this.c=0,this.d=e,this.b=t|64|PK}function fA(e){this.b=new nF(11),this.a=(fM(),e)}function pA(e){this.b=null,this.a=(fM(),e||F_t)}function __e(e){this.a=CHe(e.a),this.b=new PD(e.b)}function v_e(e){this.b=e,FT.call(this,e),Cue(this)}function mA(e){this.b=e,LT.call(this,e),wue(this)}function hA(e,t,n){this.a=e,dD.call(this,t,n,5,6)}function gA(e,t,n,r,i){lF.call(this,e,t,n,r,i,-1)}function _A(e,t,n,r,i){uF.call(this,e,t,n,r,i,-1)}function R(e,t,n,r){Vw.call(this,e,t,n),this.b=r}function vA(e,t,n,r){CO.call(this,e,t,n),this.b=r}function y_e(e){kS.call(this,e,!1),this.a=!1}function b_e(){bS.call(this,`LAYOUT_NEXT_LEVEL`,3)}function yA(e,t,n,r){this.b=e,Vw.call(this,t,n,r)}function bA(e,t){this.b=e,Af.call(this,e.b),this.a=t}function xA(e,t){var n=e.a.gc();return jDe(t,n),n-t}function SA(e,t){return t.Sh()?Uz(e.b,F(t,52)):t}function x_e(e,t){return vD(e.substr(0,t.length),t)}function CA(e){return new Jk(new iT(e.a.length,e.a))}function wA(e){return new SS(e.c+e.b/2,e.d+e.a/2)}function S_e(e){return lw(~e.l&uq,~e.m&uq,~e.h&dq)}function TA(e){return typeof e===pK||typeof e===wat}function EA(e,t){return IS(t)?Sbe(e,t):!!jk(e.f,t)}function DA(e,t){return cK(),++W9,new gve(e,t,0)}function OA(e,t){return cK(),++W9,new gve(6,e,t)}function kA(e,t){for(Rj(t);e.Ob();)t.Ad(e.Pb())}function AA(e,t,n){JW(),this.e=e,this.d=t,this.a=n}function z(e,t,n,r){zIe(t,n,e.length),w_e(e,t,n,r)}function jA(e,t,n){return gL(e.a,t),ZO(e.b,t.g,n)}function MA(e,t){return e.a.yc(t,e)==null}function C_e(e,t){var n;for(n=0;n<t;++n)e[n]=!1}function w_e(e,t,n,r){var i;for(i=t;i<n;++i)e[i]=r}function T_e(e,t,n){this.c=e,this.a=t,dM(),this.b=n}function E_e(e,t,n){sA(n,e.a.c.length),fP(e.a,n,t)}function NA(e,t){return e.a.yc(t,(_T(),vQ))==null}function D_e(e,t){return e>0?r.Math.log(e/t):-100}function PA(e){return new fk(null,N_e(e,e.length))}function FA(e){e.f=new ple(e),e.i=new mle(e),++e.g}function O_e(e){if(!e)throw k(new dg);return e.d}function IA(e,t){if(e==null)throw k(new p_(t))}function LA(e,t){return t?FL(e,t):!1}function RA(e){return IU(),!e.Gc(c5)&&!e.Gc(u5)}function zA(e){$T(e.b!=-1),NP(e.c,e.a=e.b),e.b=-1}function BA(e,t,n){return RIe(e,t.g,n),gL(e.c,t),e}function VA(e,t,n){Qnt(e.a,e.b,e.d,e.c,F(t,170),n)}function HA(e,t){rue(e,N(t,163)?t:F(t,2001).Pl())}function k_e(e){return KG(e,(cB(),y8)),e.d=!0,e}function UA(e){return!e.j&&Uee(e,c8e(e.g,e.b)),e.j}function WA(e){var t=JR(e);return tE(t!=null),t}function A_e(e){var t=yRe(e);return tE(t!=null),t}function j_e(e,t,n){var r=nI(e,t);return aEe(e,t,n),r}function GA(e,t){this.d=e,Jw.call(this,e),this.e=t}function KA(e,t){Vh.call(this,1),this.a=e,this.b=t}function M_e(e,t){return Iz(e,t)<0?-1:+(Iz(e,t)>0)}function N_e(e,t){return yje(t,e.length),new IO(e,t)}function qA(e){return e.e==0?e:new AA(-e.e,e.d,e.a)}function P_e(e){return e==yq?ZZ:e==bq?`-INF`:``+e}function JA(e){return e==yq?ZZ:e==bq?`-INF`:``+e}function YA(e,t){return sB(e.c.c+e.c.b,t.c.c+t.c.b)}function XA(e,t){lP(e.d,t,e.b.b,e.b),++e.a,e.c=null}function ZA(e,t){return e.c?ZA(e.c,t):Rw(e.b,t),e}function QA(e,t){Ly(tM(e.Mc(),new Di),new Ute(t))}function $A(e,t,n,r,i){$qe(e,F(OP(t.k,n),16),n,r,i)}function ej(e,t,n,r,i){for(;t<n;)r[i++]=Hj(e,t++)}function tj(e,t,n){var r;for(r=0;r<t;++r)_j(e,r,n)}function nj(e){e.s=NaN,e.c=NaN,v$e(e,e.e),v$e(e,e.j)}function F_e(e){e.a=null,e.e=null,FA(e.b),e.d=0,++e.c}function rj(e){return r.Math.abs(e.d.e-e.e.e)-e.a}function I_e(e,t){return sB(e.e.a+e.f.a,t.e.a+t.f.a)}function L_e(e,t){return sB(e.e.b+e.f.b,t.e.b+t.f.b)}function R_e(e,t,n){return F(e.c.fd(t,F(n,136)),45)}function z_e(){return N_(),G(j(zgt,1),YK,538,0,[Rgt])}function ij(){ij=E,$gt=new tp(!1),e_t=new tp(!0)}function aj(){aj=E,K7=bQe(),(uK(),J7)&&yGe()}function oj(e){return(e.i??mG(e),e.i).length}function B_e(e,t){Cj(e,new wj(t.f==null?``+t.g:t.f))}function V_e(e,t){Cj(e,new wj(t.f==null?``+t.g:t.f))}function sj(e,t){return e.Qi()&&(t=Yxe(e,t)),e.Di(t)}function cj(e,t){return t=e.Wk(null,t),qqe(e,null,t)}function H_e(e,t,n){return cK(),++W9,new kCe(e,t,n)}function U_e(e,t){++e.j,Aqe(e,e.i,t),xQe(e,F(t,344))}function B(e,t,n){var r=lj(e,t);return lMe(n,r),r}function lj(e,t){var n=new IFe;return n.j=e,n.d=t,n}function uj(e){if(e==null)throw k(new lg);return e}function W_e(e){Mbe.call(this),this.a=e,Rw(e.a,this)}function G_e(){aP.call(this),this.a=!0,this.b=!0}function dj(e){this.d=(Rj(e),e),this.a=0,this.c=RK}function fj(e,t){this.d=TRe(e),this.c=t,this.a=.5*t}function K_e(e,t){return F(Wk(e.a).Kd().Xb(t),45).jd()}function pj(e){var t;return t=e.g,t||(e.g=new Sf(e))}function mj(e){var t;return t=e.k,t||(e.k=new Cf(e))}function q_e(e){var t;return t=e.k,t||(e.k=new Cf(e))}function J_e(e){var t;return t=e.i,t||(e.i=new Ef(e))}function hj(e){return e.j||=new Yf(e)}function Y_e(e){return e.f||=new rT(e)}function gj(e){return e.d||=new Vf(e)}function X_e(e){return N(e,607)?e:new Axe(e)}function Z_e(e,t){return FN(t,e.c.b.c.gc()),new eoe(e,t)}function Q_e(e,t){return hN(t,e.length+1),e.substr(t)}function _j(e,t,n){return eE(n==null||y5e(e,n)),e[t]=n}function $_e(e,t){var n=e.a.gc();return FN(t,n),n-1-t}function eve(e,t){console[e].call(console,t)}function vj(e,t){return IS(t)?RM(e,t):RS(jk(e.f,t))}function yj(e){e?Tqe(e,(Ay(),b_t),``):Bbe((Ay(),e))}function tve(e){pg(),this.b=new Uh,this.a=e,Ctt(this,e)}function nve(e){this.b=new Uh,this.a=new Uh,this.c=e}function bj(e){this.c=new mv,this.a=new Uh,this.b=e}function xj(e){this.d=e,this.c=e.a.d.a,this.b=e.a.e.g}function rve(e){this.b=e,this.a=F(Oj(this.b.a.e),227)}function ive(e){for(;e.a.b!=0;)Snt(e,F(vxe(e.a),9))}function Sj(e,t){for(Rj(t);e.c<e.d;)e.Qe(t,e.c++)}function ave(e,t){return EL(),F(Gj(e,t.d),16).Ec(t)}function ove(e,t){return F(J(t,(rK(),J2)),15).a<e}function sve(e,t,n,r){return n==0||(n-r)/n<e.e||t>=e.g}function cve(e,t,n){return f6e(e,bL(e,t,n))}function Cj(e,t){var n=e.a.length;nI(e,n),aEe(e,n,t)}function lve(e,t){var n;++e.j,n=e.Cj(),e.pj(e.Xi(n,t))}function uve(e,t,n){F(t.b,68),vI(t.a,new iO(e,n,t))}function dve(e,t,n){Ih.call(this,t),this.a=e,this.b=n}function fve(e,t,n){this.a=e,Fh.call(this,t),this.b=n}function pve(e,t,n){this.a=e,Hwe.call(this,8,t,null,n)}function mve(e){this.a=(Rj(TZ),TZ),this.b=e,new rie}function hve(e){this.c=e,this.a=new Dy,this.b=new Dy}function gve(e,t,n){Vh.call(this,e),this.a=t,this.b=n}function wj(e){if(e==null)throw k(new lg);this.a=e}function _ve(e){return!e.a&&(e.a=new Vw(Q5,e,4)),e.a}function Tj(e){return!e.d&&(e.d=new Vw(z7,e,1)),e.d}function Ej(e,t){return e.a+=String.fromCharCode(t),e}function Dj(e,t){return e.a+=String.fromCharCode(t),e}function Oj(e){if(e==null)throw k(new lg);return e}function vve(e){return z9?Sbe(z9,e):!1}function yve(e){return e?e.dc():!e.Jc().Ob()}function bve(e){return Oj(e),N(e,472)?F(e,472):UB(e)}function xve(e){return N(e,103)&&(F(e,19).Bb&IX)!=0}function kj(e){return r.Math.sqrt(e.a*e.a+e.b*e.b)}function Aj(e,t){return vWe(e.c,e.f,t,e.b,e.a,e.e,e.d)}function jj(e,t){return sA(t,e.a.c.length),ck(e.a,t)}function Mj(e,t){return M(e)===M(t)||e!=null&&Qz(e,t)}function Sve(e,t){Nk(F(t.b,68),e),vI(t.a,new om(e))}function Nj(e){e.c?Nj(e.c):(CB(e),e.d=!0)}function Pj(e){e.c?e.c.Ye():(e.d=!0,g2e(e))}function Cve(e){mye(e.a),e.b=U(sQ,bK,1,e.b.length,5,1)}function Fj(e){$T(e.c!=-1),e.d.ed(e.c),e.b=e.c,e.c=-1}function wve(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function Tve(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function Ij(){uie.call(this),mg(this.j.c,0),this.a=-1}function Eve(){uy.call(this,`DELAUNAY_TRIANGULATION`,0)}function Dve(e,t){var n=e.Fh(t);n>=0?e.hi(n):BZe(e,t)}function Ove(e){return e.c.i.c==e.d.i.c}function Lj(e){return!e.a&&e.c?e.c.b:e.a}function kve(e){return 0>=e?new Fy:JMe(e-1)}function Rj(e){if(e==null)throw k(new lg);return e}function Ave(e){if(e.p!=6)throw k(new cg);return e.f}function jve(e){if(e.p!=6)throw k(new cg);return e.k}function Mve(e){if(e.p!=3)throw k(new cg);return e.e}function Nve(e){if(e.p!=4)throw k(new cg);return e.e}function Pve(e){if(e.p!=4)throw k(new cg);return e.j}function Fve(e){if(e.p!=3)throw k(new cg);return e.j}function Ive(e){return!e.b&&(e.b=new Nh(new Vg)),e.b}function zj(e){return e.c==-2&&Iee(e,vJe(e.g,e.b)),e.c}function Bj(e,t){var n=lj(``,e);return n.n=t,n.i=1,n}function Vj(e,t,n,r){oy.call(this,e,n),this.a=t,this.f=r}function Lve(e,t,n,r){oy.call(this,e,t),this.d=n,this.a=r}function Rve(e,t){this.b=e,GA.call(this,e,t),Cue(this)}function zve(e,t){this.b=e,Wfe.call(this,e,t),wue(this)}function Bve(){kJe.call(this,NZ,(Sv(),NBt)),B9e(this)}function Vve(){kJe.call(this,KZ,(Cv(),bVt)),Zet(this)}function Hve(e,t){sue.call(this,YMe(uj(e),uj(t))),this.a=t}function Uve(e,t){e.c<0||e.b.b<e.c?eC(e.b,t):e.a.vf(t)}function Wve(e,t){iF((!e.a&&(e.a=new HE(e,e)),e.a),t)}function Hj(e,t){return hN(t,e.length),e.charCodeAt(t)}function Gve(e,t){return sw(t.j.c.length,e.j.c.length)}function Uj(e,t,n){return IS(t)?nN(e,t,n):jU(e.f,t,n)}function Kve(e){return dM(),e?e.Me():(fM(),fM(),L_t)}function qve(e){return oL(e,Hat),lI(kB(kB(5,e),e/10|0))}function Jve(e,t,n){return HR(),n.Kg(e,F(t.jd(),147))}function Yve(e,t){return rk(),new kHe(new Lue(e),new Iue(t))}function Wj(e,t){return M(e)===M(t)||e!=null&&Qz(e,t)}function Gj(e,t){return Ak(e.a,t)?e.b[F(t,24).g]:null}function Xve(e){return String.fromCharCode.apply(null,e)}function Zve(e){return!e.d&&(e.d=new Gp(e.c.Bc())),e.d}function Kj(e){return!e.a&&(e.a=new Qie(e.c.vc())),e.a}function Qve(e){return!e.b&&(e.b=new H_(e.c.ec())),e.b}function qj(e){return e.j.c.length=0,mye(e.c),_fe(e.a),e}function $ve(e,t){var n=new bj(e);return $h(t.c,n),n}function eye(e){return!e.n&&(e.n=new R(f7,e,1,7)),e.n}function tye(e){return!e.b&&(e.b=new mD(r7,e,4,7)),e.b}function nye(e){return!e.c&&(e.c=new mD(r7,e,5,8)),e.c}function rye(e){return!e.c&&(e.c=new R(m7,e,9,9)),e.c}function Jj(e,t,n,r){return rPe(e,t,n,!1),rB(e,r),e}function Yj(e,t){for(;t-->0;)e=e<<1|e<0;return e}function iye(e,t){e.u.Gc((IU(),c5))&&sQe(e,t),$De(e,t)}function aye(e,t){WRe(e,A(GI(t,`x`)),A(GI(t,`y`)))}function oye(e,t){WRe(e,A(GI(t,`x`)),A(GI(t,`y`)))}function sye(){return cb(),G(j(gIt,1),YK,528,0,[l6])}function cye(){return sb(),G(j(TFt,1),YK,547,0,[wFt])}function lye(){return ob(),G(j(SFt,1),YK,477,0,[xFt])}function uye(){uye=E,Ugt=new Yoe(G(j(dQ,1),VK,45,0,[]))}function dye(e){return e!=null&&by(A7,e.toLowerCase())}function fye(e,t){return new mbe(F(uj(e),51),F(uj(t),51))}function pye(e,t,n){var r=F(e.d.Kb(n),162);r&&r.Nb(t)}function mye(e){var t;for(t=e.Jc();t.Ob();)t.Pb(),t.Qb()}function Xj(e){var t=e.b;return!t&&(e.b=t=new wf(e)),t}function Zj(e){return e.e==qZ&&Bee(e,dVe(e.g,e.b)),e.e}function Qj(e){return e.f==qZ&&Hee(e,nGe(e.g,e.b)),e.f}function $j(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function hye(e,t){this.b=e,this.c=t,this.a=new Ey(this.b)}function gye(e,t,n){this.a=Yat,this.d=e,this.b=t,this.c=n}function _ye(e,t){this.d=(Rj(e),e),this.a=16449,this.c=t}function vye(e,t){return sB(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function yye(e,t){return sB(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function bye(e,t){return $y(),sB((Rj(e),e),(Rj(t),t))}function eM(e,t){return CB(e),new fk(e,new Oke(t,e.a))}function tM(e,t){return CB(e),new fk(e,new HDe(t,e.a))}function nM(e,t){return CB(e),new NE(e,new BDe(t,e.a))}function rM(e,t){return CB(e),new PE(e,new VDe(t,e.a))}function xye(e,t,n){j9e(e.a,n),$Pe(n),K$e(e.b,n),det(t,n)}function iM(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function Sye(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function Cye(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function aM(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function wye(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function oM(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function sM(e,t,n,r){uy.call(this,e,t),this.a=n,this.b=r}function Tye(e,t,n,r){iIe.call(this,e,n,r,!1),this.f=t}function Eye(e,t,n){var r=jrt(e);return t.qi(n,r)}function cM(e){var t,n=(t=new Kh,t);return TI(n,e),n}function Dye(e){var t,n=(t=new Kh,t);return UJe(n,e),n}function Oye(e){return!e.b&&(e.b=new R(i7,e,12,3)),e.b}function kye(e){return eNe(e)||null}function Aye(e){QD();var t=F(e.g,9);t.n.a=e.d.c+t.d.b}function jye(e){this.a=new Uh,this.e=U(q9,NK,54,e,0,2)}function Mye(e){this.f=e,this.c=this.f.e,e.f>0&&HGe(this)}function Nye(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Pye(e,t,n,r){this.a=e,this.b=t,this.d=n,this.c=r}function Fye(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function Iye(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function lM(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function Lye(e,t,n,r){QC(),FDe.call(this,t,n,r),this.a=e}function Rye(e,t,n,r){QC(),FDe.call(this,t,n,r),this.a=e}function zye(e,t){this.a=e,Mde.call(this,e,F(e.d,16).dd(t))}function Bye(e,t){return sB(Ck(e)*Sk(e),Ck(t)*Sk(t))}function Vye(e,t){return sB(Ck(e)*Sk(e),Ck(t)*Sk(t))}function uM(e){var t;return t=e.f,t||(e.f=new ay(e,e.c))}function dM(){dM=E,IQ=new ne,LQ=new ie,RQ=new ae}function fM(){fM=E,F_t=new se,I_t=new se,L_t=new ce}function pM(e){if(KB(e.d),e.d.d!=e.c)throw k(new ag)}function Hye(e){return tE(e.b<e.d.gc()),e.d.Xb(e.c=e.b++)}function mM(e){e.a.a=e.c,e.c.b=e.a,e.a.b=e.c.a=null,e.b=0}function Uye(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function Wye(e,t,n){return Rw(e.a,(eUe(t,n),new oy(t,n))),e}function Gye(e){return RO(e==null||TA(e)&&e.Rm!==T),e}function hM(e){return e.n&&(e.e!==Wat&&e.he(),e.j=null),e}function Kye(e){return e.length>0?kP(e):new Uh}function qye(e,t){return F(J(e,(Z(),w0)),16).Ec(t),t}function Jye(e,t){return UU(e,F(J(t,(rK(),J2)),15),t)}function Yye(e){return HU(e)&&m_(TE(X(e,(rK(),A2))))}function Xye(e,t,n){return ib(),sze(F(vj(e.e,t),517),n)}function Zye(e,t,n){e.i=0,e.e=0,t!=n&&eIe(e,t,n)}function Qye(e,t,n){e.i=0,e.e=0,t!=n&&tIe(e,t,n)}function $ye(e,t,n,r){this.b=e,this.c=r,ZS.call(this,t,n)}function ebe(e,t){this.g=e,this.d=G(j(M$,1),KJ,9,0,[t])}function tbe(e,t){e.d&&!e.d.a&&(rre(e.d,t),tbe(e.d,t))}function nbe(e,t){e.e&&!e.e.a&&(rre(e.e,t),nbe(e.e,t))}function rbe(e,t){return qz(e.j,t.s,t.c)+qz(t.e,e.s,e.c)}function ibe(e){return F(e.jd(),147).Og()+`:`+UB(e.kd())}function abe(e,t){return-sB(Ck(e)*Sk(e),Ck(t)*Sk(t))}function obe(e,t){return mz(e),mz(t),Iie(F(e,24),F(t,24))}function gM(e,t,n){sI(e,t,new np(jD(n)))}function sbe(e,t){new Dy,this.a=new Lg,this.b=e,this.c=t}function cbe(e){this.b=new Uh,jR(this.b,this.b),this.a=e}function lbe(e){this.b=new _a,this.a=e,r.Math.random()}function ube(){iYe(this,new ff),this.wb=(aj(),K7),Sv()}function dbe(){Qg.call(this,`There is no more element.`)}function fbe(e,t,n,r){jS.call(this,t,n),this.b=e,this.a=r}function pbe(e,t,n,r,i,a){uF.call(this,e,t,n,r,i,a?-2:-1)}function _M(e){return!e.a&&(e.a=new R(p7,e,10,11)),e.a}function vM(e){return!e.q&&(e.q=new R(B7,e,11,10)),e.q}function V(e){return!e.s&&(e.s=new R(N7,e,21,17)),e.s}function yM(e,t){if(e==null)throw k(new p_(t));return e}function mbe(e,t){bie.call(this,new pA(e)),this.a=e,this.b=t}function hbe(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function gbe(e){P_(),r.setTimeout(function(){throw e},0)}function _be(e){return uj(e),uUe(new Jk(aT(e.a.Jc(),new f)))}function bM(e){return dM(),N(e,59)?new U_(e):new pT(e)}function vbe(e){return N(e,18)?new dk(F(e,18)):whe(e.Jc())}function ybe(e){return new Eue(e,e.e.Pd().gc()*e.c.Pd().gc())}function bbe(e){return new Due(e,e.e.Pd().gc()*e.c.Pd().gc())}function xbe(e){return e&&e.hashCode?e.hashCode():wT(e)}function Sbe(e,t){return t==null?!!jk(e.f,null):Fge(e.i,t)}function Cbe(e,t){var n=Ew(e.a,t);return n&&(t.d=null),n}function wbe(e,t,n){return e.f?e.f.cf(t,n):!1}function xM(e,t,n,r){_j(e.c[t.g],n.g,r),_j(e.c[n.g],t.g,r)}function Tbe(e,t,n,r){_j(e.c[t.g],t.g,n),_j(e.b[t.g],t.g,r)}function Ebe(e){e.Tg(`No crossing minimization`,1),e.Ug()}function Dbe(e){this.c=e,this.b=new Rv(F(uj(new Be),51))}function Obe(e){this.c=e,this.b=new Rv(F(uj(new vt),51))}function kbe(e){this.b=e,this.a=new Rv(F(uj(new tt),51))}function Abe(){this.b=new yg,this.d=new Dy,this.e=new Ag}function jbe(){this.d=new Dy,this.b=new Wh,this.c=new Uh}function Mbe(){this.c=new mv,this.d=new mv,this.e=new mv}function SM(){this.a=new Lg,this.b=(oL(3,JK),new nF(3))}function CM(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function Nbe(e,t,n,r,i,a){this.a=e,rL.call(this,t,n,r,i,a)}function Pbe(e,t,n,r,i,a){this.a=e,rL.call(this,t,n,r,i,a)}function wM(e,t){this.e=e,this.a=sQ,this.b=p6e(t),this.c=t}function Fbe(e,t){return N(t,147)&&vD(e.b,F(t,147).Og())}function Ibe(e,t){return e.a?t.Dh().Jc():F(t.Dh(),72).Gi()}function Lbe(e,t,n){return A(P(n.a))<=e&&A(P(n.b))>=t}function Rbe(e,t,n){return n>=0&&vD(e.substr(n,t.length),t)}function TM(e,t,n,r,i,a,o){return new gEe(e.e,t,n,r,i,a,o)}function EM(e,t,n){return $P(t,n,e.length),e.substr(t,n-t)}function DM(e,t){var n=Mv(e.Pm);return t==null?n:n+`: `+t}function zbe(e,t){var n=e.b.Oc(t);return nEe(n,e.b.gc()),n}function OM(e,t){if(e==null)throw k(new p_(t));return e}function kM(e){return e.u||=(bP(e),new Jde(e,e)),e.u}function AM(e){return F(lR(e,16),29)||e.fi()}function Bbe(e){!e||DM(e,e.ge())}function Vbe(){Vbe=E,Svt=new Ne,wvt=new Jge,Cvt=new ze}function jM(){jM=E;var e,t=!EBe();e=new b,Zgt=t?new y:e}function Hbe(){return JP(),G(j(RSt,1),YK,422,0,[ISt,LSt])}function Ube(){return aI(),G(j(aCt,1),YK,419,0,[R1,iCt])}function Wbe(){return SF(),G(j(vCt,1),YK,476,0,[_Ct,H1])}function Gbe(){return YN(),G(j(qCt,1),YK,420,0,[GCt,KCt])}function Kbe(){return dP(),G(j(bwt,1),YK,423,0,[ywt,vwt])}function qbe(){return RF(),G(j(Ikt,1),YK,421,0,[Pkt,Fkt])}function Jbe(){return XN(),G(j(NAt,1),YK,519,0,[Y4,J4])}function Ybe(){return IM(),G(j(HAt,1),YK,510,0,[$4,Q4])}function Xbe(){return JM(),G(j(WAt,1),YK,509,0,[e3,t3])}function Zbe(){return VP(),G(j(sjt,1),YK,516,0,[i3,r3])}function Qbe(){return FM(),G(j(mjt,1),YK,454,0,[a3,o3])}function $be(){return CN(),G(j(zMt,1),YK,425,0,[RMt,LMt])}function exe(){return wL(),G(j(GMt,1),YK,487,0,[N3,P3])}function txe(){return gF(),G(j(nNt,1),YK,426,0,[eNt,tNt])}function nxe(){return _P(),G(j(iFt,1),YK,478,0,[nFt,rFt])}function rxe(){return HP(),G(j(OFt,1),YK,428,0,[DFt,s6])}function ixe(){return iI(),G(j(Tyt,1),YK,424,0,[wyt,l$])}function axe(){return CL(),G(j(cxt,1),YK,503,0,[V$,sxt])}function oxe(){return TR(),G(j(yIt,1),YK,427,0,[u6,vIt])}function MM(e,t,n,r){return n>=0?e.Rh(t,n,r):e.zh(null,n,r)}function NM(e){return e.b.b==0?e.a.uf():yO(e.b)}function sxe(e){if(e.p!=5)throw k(new cg);return wk(e.f)}function cxe(e){if(e.p!=5)throw k(new cg);return wk(e.k)}function lxe(e){return M(e.a)===M((VL(),GBt))&&Get(e),e.a}function uxe(e,t){Aee(this,new SS(e.a,e.b)),Tp(this,mO(t))}function dxe(e,t){sD.call(this),kje(this),this.a=e,this.c=t}function fxe(e,t,n){QC(),Ih.call(this,t),this.a=e,this.b=n}function pxe(e,t,n){cK(),Vh.call(this,e),this.b=t,this.a=n}function PM(){xie.call(this,new Py(aR(12))),Qw(!0),this.a=2}function mxe(){bS.call(this,`FIXED_INTEGER_RATIO_BOXES`,2)}function FM(){FM=E,a3=new Vse(Kq,0),o3=new Vse(qq,1)}function IM(){IM=E,$4=new Ise(qq,0),Q4=new Ise(Kq,1)}function hxe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=hk(e.c,e.b,e.a))}function gxe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=hk(e.c,e.b,e.a))}function _xe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function LM(e){var t;xMe(e.a),ble(e.a),t=new im(e.a),QB(t)}function RM(e,t){return t==null?RS(jk(e.f,null)):Mb(e.i,t)}function vxe(e){return e.b==0?null:(tE(e.b!=0),gI(e,e.a.a))}function zM(e){return Math.max(Math.min(e,hK),-2147483648)|0}function yxe(e,t,n,r,i){return new VYe(e,(xF(),rvt),t,n,r,i)}function BM(e,t){return oEe(t),uMe(e,U(q9,cq,30,t,15,1),t)}function bxe(e,t){return wI(),F(J(t,(pG(),A3)),15).a==e}function xxe(e,t){z3e(e,!0),vI(e.e.Pf(),new mpe(e,!0,t))}function VM(e,t){return yM(e,`set1`),yM(t,`set2`),new my(e,t)}function Sxe(e,t){return Jgt[e.charCodeAt(0)]??e}function Cxe(e,t){return lD(fE(zje(e.f,t)),e.f.d)}function wxe(e,t){var n=t,r=new he;return ant(e,n,r),r.d}function Txe(e,t,n,r){var i=new iD;t.a[n.g]=i,jA(e.b,r,i)}function Exe(e,t,n){var r=e.Fh(t);r>=0?e.$h(r,n):E0e(e,t,n)}function HM(e,t,n){aN(),e&&Uj(uBt,e,t),e&&Uj(C7,e,n)}function Dxe(e,t,n){this.i=new Uh,this.b=e,this.g=t,this.a=n}function UM(e,t,n){this.c=new Uh,this.e=e,this.f=t,this.b=n}function Oxe(e,t,n){this.a=new Uh,this.e=e,this.f=t,this.c=n}function kxe(e){sD.call(this),kje(this),this.a=e,this.c=!0}function Axe(e){this.a=F(uj(e),277),this.b=(dM(),new hT(e))}function jxe(e,t){fw(this),this.f=t,this.g=e,hM(this),this.he()}function WM(e,t){var n=e.q.getHours();e.q.setDate(t),vG(e,n)}function Mxe(e,t){var n;for(uj(t),n=e.a;n;n=n.c)t.Wd(n.g,n.i)}function Nxe(e){var t=new Lv(aR(e.length));return VFe(t,e),t}function Pxe(e){function t(){}return t.prototype=e||{},new t}function Fxe(e,t){return YPe(e,t)?(gMe(e),!0):!1}function GM(e,t){if(t==null)throw k(new lg);return IBe(e,t)}function Ixe(e){if(e.ye())return null;var t=e.n;return oQ[t]}function KM(e){return e.Db>>16==3?F(e.Cb,26):null}function qM(e){return e.Db>>16==9?F(e.Cb,26):null}function Lxe(e){return e.Db>>16==6?F(e.Cb,85):null}function Rxe(e,t){var n=e.Fh(t);return n>=0?e.Th(n):yQe(e,t)}function zxe(e,t,n){e.b=new yL(GFe(e,t,n).c.length)}function JM(){JM=E,e3=new Lse(vst,0),t3=new Lse(`UP`,1)}function Bxe(){Bxe=E,Bgt=kz((N_(),G(j(zgt,1),YK,538,0,[Rgt])))}function Vxe(e){this.a=e,this.b=U(OAt,NK,2008,e.e.length,0,2)}function Hxe(){this.a=new CC,this.e=new yg,this.g=0,this.i=0}function Uxe(e){return!e.a&&(e.a=new R(p7,e,10,11)),e.a.i>0}function Wxe(e,t){return r.Math.abs(e)<r.Math.abs(t)?e:t}function Gxe(e,t){return ZD(),_T(),F(t.a,15).a<e}function Kxe(e,t){return ZD(),_T(),F(t.b,15).a<e}function qxe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function Jxe(e){var t=e.d;return t=e._i(e.f),iF(e,t),t.Ob()}function Yxe(e,t){var n=new Sge(t);return yJe(n,e),new PD(n)}function Xxe(e){if(e.p!=0)throw k(new cg);return WS(e.f,0)}function Zxe(e){if(e.p!=0)throw k(new cg);return WS(e.k,0)}function Qxe(e){return e.Db>>16==7?F(e.Cb,241):null}function YM(e){return e.Db>>16==6?F(e.Cb,241):null}function $xe(e){return e.Db>>16==7?F(e.Cb,174):null}function eSe(e){return e.Db>>16==3?F(e.Cb,158):null}function XM(e){return e.Db>>16==11?F(e.Cb,26):null}function ZM(e){return e.Db>>16==17?F(e.Cb,29):null}function tSe(e){var t;return CB(e),t=new yg,eM(e,new hte(t))}function nSe(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.te(t))}function rSe(e,t){var n=e.q.getHours();e.q.setMonth(t),vG(e,n)}function QM(e,t){e.c&&kF(e.c.g,e),e.c=t,e.c&&Rw(e.c.g,e)}function $M(e,t){e.c&&kF(e.c.a,e),e.c=t,e.c&&Rw(e.c.a,e)}function eN(e,t){e.d&&kF(e.d.e,e),e.d=t,e.d&&Rw(e.d.e,e)}function tN(e,t){e.i&&kF(e.i.j,e),e.i=t,e.i&&Rw(e.i.j,e)}function nN(e,t,n){return t==null?jU(e.f,null,n):wB(e.i,t,n)}function rN(e,t,n,r,i,a){return new BF(e.e,t,e.Jj(),n,r,i,a)}function iSe(e){return hz(),_T(),F(e.a,82).d.e!=0}function aSe(e,t){this.a=e,this.c=xw(this.a),this.b=new CM(t)}function oSe(e,t,n){this.a=t,this.c=e,this.b=(uj(n),new PD(n))}function sSe(e,t,n){this.a=t,this.c=e,this.b=(uj(n),new PD(n))}function iN(e,t){if(e<0||e>t)throw k(new r_(Kot+e+qot+t))}function aN(){aN=E,uBt=new Wh,C7=new Wh,Mce(B_t,new $c)}function cSe(){cSe=E,sAt=Lk(new Ij,(cU(),S$),(sK(),s1))}function lSe(){lSe=E,cAt=Lk(new Ij,(cU(),S$),(sK(),s1))}function uSe(){uSe=E,lAt=Lk(new Ij,(cU(),S$),(sK(),s1))}function dSe(){dSe=E,uAt=Lk(new Ij,(cU(),S$),(sK(),s1))}function fSe(){fSe=E,fAt=Lk(new Ij,(cU(),S$),(sK(),s1))}function pSe(){pSe=E,pAt=Lk(new Ij,(cU(),S$),(sK(),s1))}function mSe(){mSe=E,FAt=$O(new Ij,(cU(),S$),(sK(),q$))}function oN(){oN=E,RAt=$O(new Ij,(cU(),S$),(sK(),q$))}function hSe(){hSe=E,VAt=$O(new Ij,(cU(),S$),(sK(),q$))}function gSe(){gSe=E,KAt=$O(new Ij,(cU(),S$),(sK(),q$))}function _Se(){_Se=E,VMt=Lk(new Ij,(OH(),l3),(ZW(),bjt))}function sN(e,t,n,r){this.c=e,this.d=r,ySe(this,t),bSe(this,n)}function cN(e){this.c=new Dy,this.b=e.b,this.d=e.c,this.a=e.a}function vSe(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function ySe(e,t){e.a&&kF(e.a.k,e),e.a=t,e.a&&Rw(e.a.k,e)}function bSe(e,t){e.b&&kF(e.b.f,e),e.b=t,e.b&&Rw(e.b.f,e)}function xSe(e,t){uve(e,e.b,e.c),F(e.b.b,68),t&&F(t.b,68).b}function SSe(e,t){JRe(e,t),N(e.Cb,88)&&NU(bP(F(e.Cb,88)),2)}function CSe(e,t){N(e.Cb,88)&&NU(bP(F(e.Cb,88)),4),kL(e,t)}function lN(e,t){N(e.Cb,184)&&(F(e.Cb,184).tb=null),kL(e,t)}function wSe(e,t){var n=F(Fz(uM(e.a),t),18);return n?n.gc():0}function TSe(e){var t,n=(Sv(),t=new Kh,t);return TI(n,e),n}function ESe(e){var t,n=(Sv(),t=new Kh,t);return TI(n,e),n}function DSe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function uN(e){return JW(),Iz(e,0)>=0?fV(e):qA(fV(DF(e)))}function OSe(e,t){gue(e,wk(bN(Xk(t,24),Pq)),wk(bN(t,Pq)))}function kSe(e,t){return sB(F(e.c,65).c.e.b,F(t.c,65).c.e.b)}function ASe(e,t){return sB(F(e.c,65).c.e.a,F(t.c,65).c.e.a)}function dN(e,t){return bb(),qF(t)?new tk(t,e):new VS(t,e)}function jSe(e,t,n){return new VYe(e,(xF(),nvt),null,!1,t,n)}function MSe(e,t,n){return new VYe(e,(xF(),ivt),t,n,null,!1)}function NSe(e,t,n){var r;iRe(t,n,e.c.length),r=n-t,Vv(e.c,t,r)}function fN(e,t,n){iRe(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function pN(e,t){this.b=(Rj(e),e),this.a=(t&xq)==0?t|64|PK:t}function mN(e,t){if(e<0||e>=t)throw k(new r_(Kot+e+qot+t))}function hN(e,t){if(e<0||e>=t)throw k(new z_(Kot+e+qot+t))}function PSe(e,t){t.c!=null&&Cj(e,new wj(t.c))}function FSe(e,t,n){var r=new SC(n.d);lD(r,e),WRe(t,r.a,r.b)}function ISe(e){var t;return CB(e),t=(fM(),fM(),I_t),dI(e,t)}function gN(e){return QR(G(j(T6,1),NK,8,0,[e.i.n,e.n,e.a]))}function LSe(){return LF(),G(j(_bt,1),YK,384,0,[hbt,mbt,gbt])}function RSe(){return bz(),G(j(UQ,1),YK,130,0,[mvt,HQ,hvt])}function zSe(){return xI(),G(j(YQ,1),YK,237,0,[KQ,qQ,JQ])}function BSe(){return bF(),G(j(jvt,1),YK,461,0,[QQ,ZQ,$Q])}function VSe(){return QF(),G(j(Pvt,1),YK,462,0,[n$,t$,e$])}function HSe(){return zz(),G(j(pkt,1),YK,352,0,[dkt,fkt,C4])}function USe(){return yR(),G(j(RCt,1),YK,302,0,[ICt,LCt,t0])}function WSe(){return BR(),G(j(VCt,1),YK,329,0,[r0,BCt,n0])}function GSe(){return $F(),G(j(UCt,1),YK,316,0,[a0,o0,i0])}function KSe(){return TL(),G(j(CSt,1),YK,368,0,[T1,w1,C1])}function qSe(){return yz(),G(j(qkt,1),YK,348,0,[Kkt,Gkt,z4])}function JSe(){return vR(),G(j(Ukt,1),YK,381,0,[Bkt,Vkt,Hkt])}function YSe(){return $I(),G(j(Rkt,1),YK,452,0,[R4,I4,L4])}function XSe(){return Cz(),G(j(Zkt,1),YK,349,0,[Ykt,Xkt,B4])}function ZSe(){return ZI(),G(j(nAt,1),YK,351,0,[tAt,$kt,eAt])}function QSe(){return wR(),G(j(aAt,1),YK,382,0,[iAt,H4,V4])}function $Se(){return az(),G(j(Pjt,1),YK,385,0,[Njt,Mjt,f3])}function eCe(){return vz(),G(j(oNt,1),YK,386,0,[F3,iNt,aNt])}function tCe(){return RB(),G(j(mPt,1),YK,387,0,[fPt,pPt,dPt])}function nCe(){return QI(),G(j(KSt,1),YK,350,0,[WSt,I1,GSt])}function rCe(){return VR(),G(j(cCt,1),YK,449,0,[sCt,z1,B1])}function iCe(){return vV(),G(j($Nt,1),YK,436,0,[z3,B3,QNt])}function aCe(){return bR(),G(j(XNt,1),YK,304,0,[JNt,YNt,qNt])}function oCe(){return dB(),G(j(mFt,1),YK,430,0,[dFt,pFt,fFt])}function sCe(){return CF(),G(j(lFt,1),YK,429,0,[oFt,cFt,sFt])}function cCe(){return uB(),G(j(yFt,1),YK,435,0,[i6,a6,o6])}function lCe(){return SI(),G(j(ERt,1),YK,279,0,[E8,D8,O8])}function uCe(){return _z(),G(j(GRt,1),YK,347,0,[P8,N8,F8])}function dCe(){return kI(),G(j(dzt,1),YK,300,0,[F5,lzt,uzt])}function fCe(){return lB(),G(j(vzt,1),YK,281,0,[_zt,Y5,X5])}function _N(e){return ib(),N(e.g,9)?F(e.g,9):null}function pCe(e){return e.a==(BP(),h9)&&Nee(e,k3e(e.g,e.b)),e.a}function vN(e){return e.d==(BP(),h9)&&Ree(e,v7e(e.g,e.b)),e.d}function mCe(e,t){var n=(Rj(e),e).g;return QT(!!n),Rj(t),n(t)}function hCe(e,t,n){var r=new qa;r.b=t,r.a=n,++t.b,Rw(e.d,r)}function gCe(e,t,n){var r=wG(e,t,!1);return r.b<=t&&r.a<=n}function _Ce(e,t){var n,r=xA(e,t);return n=e.a.dd(r),new py(e,n)}function vCe(e){return e.Db>>16==6?F(S$e(e),241):null}function yCe(e){if(e.p!=2)throw k(new cg);return wk(e.f)&aq}function bCe(e){if(e.p!=2)throw k(new cg);return wk(e.k)&aq}function yN(e){return uj(e),N(e,18)?new PD(F(e,18)):pO(e.Jc())}function xCe(e){ak(),this.a=(dM(),N(e,59)?new U_(e):new pT(e))}function bN(e,t){return rR(eA(hC(e)?pR(e):e,hC(t)?pR(t):t))}function xN(e,t){return rR(o_e(hC(e)?pR(e):e,hC(t)?pR(t):t))}function SCe(e,t){return rR(tA(hC(e)?pR(e):e,hC(t)?pR(t):t))}function CCe(e,t){return Pge(e.a,t)?ZO(e.b,F(t,24).g,null):null}function wCe(e){return kB(Yk(oR(dW(e,32)),32),oR(dW(e,32)))}function TCe(e){var t=F(zO(e.b),10);return new FD(e.a,t,e.c)}function ECe(e,t){Grt(e,t,A(P(e.a.mf((oK(),u8)))))}function DCe(e,t){AA.call(this,1,2,G(j(q9,1),cq,30,15,[e,t]))}function OCe(e,t){yie.call(this,new Py(aR(e))),oL(t,Pat),this.a=t}function kCe(e,t,n){Vh.call(this,25),this.b=e,this.a=t,this.c=n}function SN(e){cK(),Vh.call(this,e),this.c=!1,this.a=!1}function ACe(){this.c=new Gle,this.a=new RDe,this.b=new Ire,Aoe()}function CN(){CN=E,RMt=new Wse(`DFS`,0),LMt=new Wse(`BFS`,1)}function jCe(e){return e.b==null||e.b.length==0?`n_`+e.a:`n_`+e.b}function wN(e){return F(RV(e,U(M$,KJ,9,e.c.length,0,1)),199)}function MCe(e,t){return e&&e.equals?e.equals(t):M(e)===M(t)}function NCe(e,t){return eI(),e.c==t.c?sB(t.d,e.d):sB(e.c,t.c)}function PCe(e,t){return eI(),e.c==t.c?sB(e.d,t.d):sB(e.c,t.c)}function FCe(e,t){return eI(),e.c==t.c?sB(e.d,t.d):sB(t.c,e.c)}function ICe(e,t){return eI(),e.c==t.c?sB(t.d,e.d):sB(t.c,e.c)}function LCe(e,t){e.b|=t.b,e.c|=t.c,e.d|=t.d,e.a|=t.a}function RCe(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function zCe(e,t,n){var r;e.n&&t&&n&&(r=new Pc,Rw(e.e,r))}function BCe(e,t){var n=F(vj(e.g,t),60);vI(t.d,new Sse(e,n))}function VCe(e,t){var n=WUe(e),r=WUe(t);return n<r?-1:+(n>r)}function HCe(e,t){var n=FF(t);return F(vj(e.c,n),15).a}function UCe(e,t){for(var n=e+``;n.length<t;)n=`0`+n;return n}function TN(e){return e.c==null||e.c.length==0?`n_`+e.g:`n_`+e.c}function WCe(e){return!!e.u&&nP(e.u.a).i!=0&&!(e.n&&UHe(e.n))}function GCe(e,t){return t==0?!!e.o&&e.o.f!=0:KVe(e,t)}function H(e){return tE(e.a<e.c.c.length),e.b=e.a++,e.c.c[e.b]}function KCe(e,t){if(MA(e.a,t),t.d)throw k(new Qg(Xot));t.d=e}function qCe(e,t){this.a=new Uh,this.d=new Uh,this.f=e,this.c=t}function JCe(){HR(),this.b=new Wh,this.a=new Wh,this.c=new Uh}function YCe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function XCe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function ZCe(e,t,n,r,i,a){mDe.call(this,e,t,n,r,i),a&&(this.o=-2)}function QCe(e,t,n,r,i,a){eMe.call(this,e,t,n,r,i),a&&(this.o=-2)}function $Ce(e,t,n,r,i,a){tMe.call(this,e,t,n,r,i),a&&(this.o=-2)}function ewe(e,t,n,r,i,a){gDe.call(this,e,t,n,r,i),a&&(this.o=-2)}function twe(e,t,n,r,i,a){iMe.call(this,e,t,n,r,i),a&&(this.o=-2)}function nwe(e,t,n,r,i,a){hDe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rwe(e,t,n,r,i,a){nMe.call(this,e,t,n,r,i),a&&(this.o=-2)}function iwe(e,t,n,r,i,a){rMe.call(this,e,t,n,r,i),a&&(this.o=-2)}function awe(e,t,n,r){Ih.call(this,n),this.b=e,this.c=t,this.d=r}function owe(e,t){this.f=e,this.a=(BP(),m9),this.c=m9,this.b=t}function swe(e,t){this.g=e,this.d=(BP(),h9),this.a=h9,this.b=t}function cwe(e,t){!e.c&&(e.c=new ZL(e,0)),jG(e.c,(BG(),T9),t)}function lwe(e,t){return M1e(e,t,N(t,103)&&(F(t,19).Bb&Cq)!=0)}function uwe(e,t){return M_e(oR(e.q.getTime()),oR(t.q.getTime()))}function dwe(e){return ik(e.e.Pd().gc()*e.c.Pd().gc(),16,new Of(e))}function fwe(e){return!!e.a&&IF(e.a.a).i!=0&&!(e.b&&WHe(e.b))}function pwe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function EN(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function mwe(e){return tE(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function hwe(e,t){var n=1-t;return e.a[n]=vL(e.a[n],n),vL(e,t)}function gwe(e,t){var n,r=bN(e,Eq);return n=Yk(t,32),xN(n,r)}function _we(e,t,n){var r=F(e.Zb().xc(t),18);return!!r&&r.Gc(n)}function vwe(e,t,n){var r=F(e.Zb().xc(t),18);return!!r&&r.Kc(n)}function ywe(e,t,n){SWe(new oSe((uj(e),new PD(e)),t,n))}function DN(e,t,n){CWe(new sSe((uj(e),new PD(e)),t,n))}function bwe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),mM(e.d),mg(e.e.a.c,0)}function ON(e,t,n,r,i,a){return rPe(e,t,n,a),aRe(e,r),oRe(e,i),e}function xwe(e,t,n,r){return e.a+=``+EM(t==null?xK:UB(t),n,r),e}function kN(e,t){this.a=e,qp.call(this,e),iN(t,e.gc()),this.b=t}function Swe(e,t){var n;e.e=new fie,n=PW(t),rw(n,e.c),s3e(e,n,0)}function AN(e,t,n,r){var i=new ic;i.a=t,i.b=n,i.c=r,MO(e.a,i)}function jN(e,t,n,r){var i=new ic;i.a=t,i.b=n,i.c=r,MO(e.b,i)}function Cwe(e,t){return new aO(t,pE(xw(t.e),e,e),(_T(),!0))}function wwe(e,t){return CI(),F(J(t,(pG(),O3)),15).a>=e.gc()}function Twe(e){return oN(),!yP(e)&&!(!yP(e)&&e.c.i.c==e.d.i.c)}function MN(e){return F(RV(e,U(j$,GJ,17,e.c.length,0,1)),324)}function NN(e){return new nF((oL(e,Hat),lI(kB(kB(5,e),e/10|0))))}function Ewe(e){return ik(e.e.Pd().gc()*e.c.Pd().gc(),273,new Df(e))}function Dwe(e){gze((!e.a&&(e.a=new R(p7,e,10,11)),e.a),new Ds)}function Owe(){var e,t=(n=(e=new Kh,e),n),n;return Rw(aVt,t),t}function PN(e){var t;return hC(e)?(t=e,t==-0?0:t):SAe(e)}function kwe(e,t){return N(t,45)?TUe(e.a,F(t,45)):!1}function Awe(e,t){return N(t,45)?TUe(e.a,F(t,45)):!1}function jwe(e,t){return N(t,45)?TUe(e.a,F(t,45)):!1}function Mwe(e,t){return e.a<=e.b?(t.Bd(e.a++),!0):!1}function FN(e,t){if(e<0||e>=t)throw k(new r_(bZe(e,t)));return e}function Nwe(e,t,n){if(e<0||t<e||t>n)throw k(new r_(aXe(e,t,n)))}function Pwe(e,t,n){e.d&&kF(e.d.e,e),e.d=t,e.d&&Ok(e.d.e,n,e)}function IN(e,t){mit(t,e),Mhe(e.d),Mhe(F(J(e,(rK(),R2)),213))}function Fwe(e,t){hit(t,e),vO(e.d),vO(F(J(e,(rK(),R2)),213))}function Iwe(e){var t;return Nj(e),t=new le,zv(e.a,new pte(t)),t}function LN(e){var t;return Nj(e),t=new ue,zv(e.a,new mte(t)),t}function Lwe(e){return Xj(e).dc()?!1:(Wle(e,new g),!0)}function Rwe(e){if(!(`stack`in e))try{throw e}catch{}return e}function zwe(e,t,n){var r=gVe();try{return tfe(e,t,n)}finally{vDe(r)}}function RN(e,t){var n=GM(e,t),r=null;return n&&(r=n.ne()),r}function zN(e,t){var n=nI(e,t),r=null;return n&&(r=n.qe()),r}function BN(e,t){var n=GM(e,t),r=null;return n&&(r=n.qe()),r}function VN(e,t){var n=GM(e,t),r=null;return n&&(r=mXe(n)),r}function Bwe(e,t,n){var r=DV(n);return YW(e.n,r,t),YW(e.o,t,n),t}function Vwe(e,t,n){this.d=new Um(this),this.e=e,this.i=t,this.f=n}function Hwe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function Uwe(e,t,n,r){return N(n,59)?new Xue(e,t,n,r):new i_e(e,t,n,r)}function Wwe(e){return F(RV(e,U(ixt,Yst,12,e.c.length,0,1)),2007)}function Gwe(e){this.a=U(sQ,bK,1,NFe(r.Math.max(8,e))<<1,5,1)}function Kwe(e){IL.call(this,e,(xF(),tvt),null,!1,null,!1)}function qwe(e){var t=e.Dh();this.a=N(t,72)?F(t,72).Gi():t.Jc()}function Jwe(e){return new pN(Nje(F(e.a.kd(),18).gc(),e.a.jd()),16)}function HN(e){return N(e,18)?F(e,18).dc():!e.Jc().Ob()}function Ywe(e){if(e.e.g!=e.b)throw k(new ag);return!!e.c&&e.d>0}function UN(e){return tE(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function Xwe(e,t){Rj(t),_j(e.a,e.c,t),e.c=e.c+1&e.a.length-1,sWe(e)}function WN(e,t){Rj(t),e.b=e.b-1&e.a.length-1,_j(e.a,e.b,t),sWe(e)}function Zwe(){Zwe=E,bAt=Yve(q(1),q(4)),yAt=Yve(q(1),q(2))}function Qwe(){Qwe=E,CFt=kz((ob(),G(j(SFt,1),YK,477,0,[xFt])))}function $we(){$we=E,EFt=kz((sb(),G(j(TFt,1),YK,547,0,[wFt])))}function eTe(){eTe=E,_It=kz((cb(),G(j(gIt,1),YK,528,0,[l6])))}function tTe(){return zR(),G(j(Mbt,1),YK,408,0,[w$,D$,T$,E$])}function nTe(){return SR(),G(j(lyt,1),YK,409,0,[a$,i$,syt,cyt])}function rTe(){return xF(),G(j(BQ,1),YK,310,0,[tvt,nvt,rvt,ivt])}function iTe(){return RR(),G(j(eSt,1),YK,367,0,[$xt,p1,m1,f1])}function aTe(){return FV(),G(j(Ubt,1),YK,383,0,[k$,Vbt,Bbt,Hbt])}function oTe(){return xR(),G(j(hSt,1),YK,413,0,[h1,g1,_1,mSt])}function sTe(e){var t;return e.j==(YG(),j5)&&(t=g$e(e),DT(t,p5))}function cTe(){return XB(),G(j(HSt,1),YK,301,0,[F1,BSt,P1,VSt])}function lTe(){return iH(),G(j(gkt,1),YK,203,0,[E4,hkt,T4,w4])}function uTe(){return EV(),G(j(Mkt,1),YK,269,0,[F4,kkt,Akt,jkt])}function dTe(e,t){return F(ST(iA(F(OP(e.k,t),16).Mc(),E1)),113)}function fTe(e,t){return F(ST(aA(F(OP(e.k,t),16).Mc(),E1)),113)}function pTe(e,t){var n=t.a;QM(n,t.c.d),eN(n,t.d.d),qL(n.a,e.n)}function mTe(e,t){var n=F(YF(e.b,t),66);return!n&&(n=new Dy),n}function GN(e){return ib(),N(e.g,156)?F(e.g,156):null}function hTe(e){e.a=null,e.e=null,mg(e.b.c,0),mg(e.f.c,0),e.c=null}function gTe(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function _Te(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function vTe(e,t,n,r){var i=r[t.g][n.g];return A(P(J(e.a,i)))}function yTe(e,t){var n;for(n=e.j.c.length;n<t;n++)Rw(e.j,e.Mg())}function bTe(e,t){return Iw(new SS(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function xTe(){return Sz(),G(j(FMt,1),YK,353,0,[PMt,j3,NMt,MMt])}function STe(){return _H(),G(j(GNt,1),YK,354,0,[WNt,HNt,UNt,VNt])}function CTe(){return Rz(),G(j(EAt,1),YK,404,0,[U4,G4,K4,W4])}function wTe(){return aU(),G(j(aPt,1),YK,401,0,[iPt,tPt,rPt,nPt])}function TTe(){return OH(),G(j(gjt,1),YK,398,0,[s3,c3,l3,u3])}function ETe(){return Bz(),G(j(wRt,1),YK,278,0,[T8,w8,SRt,CRt])}function DTe(){return uP(),G(j(Z5,1),YK,288,0,[bzt,Czt,xzt,Szt])}function OTe(){return yV(),G(j(B5,1),YK,380,0,[R5,z5,L5,I5])}function kTe(){return fB(),G(j(kRt,1),YK,222,0,[ORt,A8,k8,j8])}function ATe(){return kH(),G(j(JRt,1),YK,292,0,[z8,I8,L8,R8])}function jTe(){return ZB(),G(j(kzt,1),YK,327,0,[Ozt,Tzt,Dzt,Ezt])}function MTe(){return xz(),G(j(Izt,1),YK,407,0,[Nzt,Pzt,Mzt,Fzt])}function NTe(e){return aN(),EA(uBt,e)?F(vj(uBt,e),342).Pg():null}function KN(e,t,n){return t<0?yQe(e,n):F(n,69).uk().zk(e,e.ei(),t)}function PTe(e,t,n){var r=DV(n);return YW(e.f,r,t),Uj(e.g,t,n),t}function FTe(e,t,n){var r=DV(n);return YW(e.p,r,t),Uj(e.q,t,n),t}function ITe(e){var t=(bv(),n=new Wc,n),n;return e&&hW(t,e),t}function LTe(e){var t=e.$i(e.i);return e.i>0&&dG(e.g,0,t,0,e.i),t}function qN(e){for(var t=0;e.Ob();)e.Pb(),t=kB(t,1);return lI(t)}function RTe(e,t){var n=new R_;return e.Ed(n),n.a+=`..`,t.Fd(n),n.a}function zTe(e,t){hb();var n=F(vj(D7,e),58);return!n||n.dk(t)}function BTe(e,t,n){if(n){var r=n.me();e.a[t]=r(n)}else delete e.a[t]}function JN(e,t){return t.e==0||e.e==0?MQ:(RW(),w2e(e,t))}function VTe(e){if(e.p!=1)throw k(new cg);return wk(e.f)<<24>>24}function HTe(e){if(e.p!=1)throw k(new cg);return wk(e.k)<<24>>24}function UTe(e){if(e.p!=7)throw k(new cg);return wk(e.k)<<16>>16}function WTe(e){if(e.p!=7)throw k(new cg);return wk(e.f)<<16>>16}function YN(){YN=E,GCt=new _x(Gq,0),KCt=new _x(`TOP_LEFT`,1)}function XN(){XN=E,Y4=new Nse(`UPPER`,0),J4=new Nse(`LOWER`,1)}function GTe(e,t,n){var r=F(vj(e.g,n),60);Rw(e.a.c,new wS(t,r))}function KTe(e,t,n,r,i){Rw(t,aZe(i,i0e(i,n,r))),XJe(e,i,t)}function qTe(e,t,n){e.i=0,e.e=0,t!=n&&(tIe(e,t,n),eIe(e,t,n))}function JTe(e,t,n){return Qk(P(RS(jk(e.f,t))),P(RS(jk(e.f,n))))}function YTe(e,t){return F(t==null?RS(jk(e.f,null)):Mb(e.i,t),290)}function XTe(e,t){return M(t)===M(e)?`(this Map)`:t==null?xK:UB(t)}function ZTe(e,t){return e==(cW(),R$)&&t==R$?4:e==R$||t==R$?8:32}function ZN(e,t,n){return hG(e,t,n,N(t,103)&&(F(t,19).Bb&Cq)!=0)}function QTe(e,t,n){return yG(e,t,n,N(t,103)&&(F(t,19).Bb&Cq)!=0)}function $Te(e,t,n){return G1e(e,t,n,N(t,103)&&(F(t,19).Bb&Cq)!=0)}function QN(e,t){bb();var n=F(e,69).tk();return CYe(n,t),n.vl(t)}function $N(e,t){JW(),AA.call(this,e,1,G(j(q9,1),cq,30,15,[t]))}function eP(e,t){cK(),Vh.call(this,e),this.a=t,this.c=-1,this.b=-1}function eEe(e,t){Mbe.call(this),this.a=e,this.b=t,Rw(this.a.b,this)}function tP(e){return tE(e.a<e.c.a.length),e.b=e.a,AAe(e),e.c.b[e.b]}function nP(e){return e.n||(bP(e),e.n=new Wge(e,z7,e),kM(e)),e.n}function tEe(e,t){for(var n=t;n;)mE(e,n.i,n.j),n=XM(n);return e}function nEe(e,t){var n;for(n=0;n<t;++n)_j(e,n,new Yp(F(e[n],45)))}function rEe(e,t){var n=e.q.getHours();e.q.setFullYear(t+sq),vG(e,n)}function iEe(e,t){iz();var n=e.j.g-t.j.g;return n==0?0:n}function aEe(e,t,n){n=n?n.me()(n):void 0,e.a[t]=n}function oEe(e){if(e<0)throw k(new f_(`Negative array size: `+e))}function sEe(e){N(e,206)&&!m_(TE(e.mf((oK(),$6))))&&u7e(F(e,26))}function cEe(e){return e.c&&e.d?jCe(e.c)+`->`+jCe(e.d):`e_`+wT(e)}function lEe(e,t){var n;return n=t==null?RS(jk(e.f,t)):RM(e,t),LS(n)}function uEe(e,t){var n;return n=t==null?RS(jk(e.f,t)):RM(e,t),LS(n)}function dEe(e,t){return Ay(),iF(V(e.a),t)}function fEe(e,t){return Ay(),iF(V(e.a),t)}function rP(e,t,n){this.e=e,this.a=sQ,this.b=p6e(t),this.c=t,this.d=n}function pEe(e){this.e=e,this.c=this.e.a,this.b=this.e.g,this.d=this.e.i}function mEe(e){this.c=e,this.a=F(FH(e),159),this.b=this.a.hk().ti()}function iP(e,t,n,r){YCe.call(this,1,n,r),this.c=e,this.b=t}function hEe(e,t,n,r){XCe.call(this,1,n,r),this.c=e,this.b=t}function gEe(e,t,n,r,i,a,o){rL.call(this,t,r,i,a,o),this.c=e,this.a=n}function aP(){Wh.call(this),nde(this),this.d.b=this.d,this.d.a=this.d}function _Ee(e){this.d=e,this.b=this.d.a.entries(),this.a=this.b.next()}function oP(e){Rqe(),gue(this,wk(bN(Xk(e,24),Pq)),wk(bN(e,Pq)))}function sP(e,t){var n;return t.b.Kb(eAe(e,t.c.Ve(),(n=new tm(t),n)))}function vEe(e,t){var n;return oEe(t),n=e.slice(0,t),n.length=t,yF(n,e)}function cP(e){var t;return e?new Sge(e):(t=new CC,OL(t,e),t)}function yEe(e,t){var n;for(n=e.d-1;n>=0&&e.a[n]===t[n];n--);return n<0}function bEe(e,t){var n,r=!1;do n=kFe(e,t),r|=n;while(n);return r}function lP(e,t,n,r){var i=new de;i.c=t,i.b=n,i.a=r,r.b=n.a=i,++e.b}function uP(){uP=E,bzt=new nk,Czt=new n_e,xzt=new mxe,Szt=new b_e}function dP(){dP=E,ywt=new Ase(BJ,0),vwt=new Ase(`ALTERNATING`,1)}function xEe(){xEe=E,yCt=kz((SF(),G(j(vCt,1),YK,476,0,[_Ct,H1])))}function SEe(){SEe=E,zSt=kz((JP(),G(j(RSt,1),YK,422,0,[ISt,LSt])))}function CEe(){CEe=E,oCt=kz((aI(),G(j(aCt,1),YK,419,0,[R1,iCt])))}function wEe(){wEe=E,JCt=kz((YN(),G(j(qCt,1),YK,420,0,[GCt,KCt])))}function TEe(){TEe=E,xwt=kz((dP(),G(j(bwt,1),YK,423,0,[ywt,vwt])))}function EEe(){EEe=E,Lkt=kz((RF(),G(j(Ikt,1),YK,421,0,[Pkt,Fkt])))}function DEe(){DEe=E,PAt=kz((XN(),G(j(NAt,1),YK,519,0,[Y4,J4])))}function OEe(){OEe=E,UAt=kz((IM(),G(j(HAt,1),YK,510,0,[$4,Q4])))}function kEe(){kEe=E,GAt=kz((JM(),G(j(WAt,1),YK,509,0,[e3,t3])))}function AEe(){AEe=E,cjt=kz((VP(),G(j(sjt,1),YK,516,0,[i3,r3])))}function jEe(){jEe=E,hjt=kz((FM(),G(j(mjt,1),YK,454,0,[a3,o3])))}function MEe(){MEe=E,BMt=kz((CN(),G(j(zMt,1),YK,425,0,[RMt,LMt])))}function NEe(){NEe=E,KMt=kz((wL(),G(j(GMt,1),YK,487,0,[N3,P3])))}function PEe(){PEe=E,rNt=kz((gF(),G(j(nNt,1),YK,426,0,[eNt,tNt])))}function FEe(){FEe=E,aFt=kz((_P(),G(j(iFt,1),YK,478,0,[nFt,rFt])))}function IEe(){IEe=E,kFt=kz((HP(),G(j(OFt,1),YK,428,0,[DFt,s6])))}function LEe(){LEe=E,Eyt=kz((iI(),G(j(Tyt,1),YK,424,0,[wyt,l$])))}function REe(){REe=E,lxt=kz((CL(),G(j(cxt,1),YK,503,0,[V$,sxt])))}function zEe(){zEe=E,bIt=kz((TR(),G(j(yIt,1),YK,427,0,[u6,vIt])))}function BEe(){return cB(),G(j(C8,1),YK,86,0,[x8,b8,y8,v8,S8])}function VEe(){return YG(),G(j(P5,1),VJ,64,0,[M5,m5,p5,j5,N5])}function HEe(e,t,n){return F(t==null?jU(e.f,null,n):wB(e.i,t,n),290)}function UEe(e){return(e.k==(cW(),R$)||e.k==P$)&&uE(e,(Z(),m0))}function WEe(e){e.b!=e.c&&(e.a=U(sQ,bK,1,8,5,1),e.b=0,e.c=0)}function GEe(e,t){var n=t.jd();return new oy(n,e.e.pc(n,F(t.kd(),18)))}function KEe(e,t){for(var n=t;n;)mE(e,-n.i,-n.j),n=XM(n);return e}function qEe(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function fP(e,t,n){var r=(mN(t,e.c.length),e.c[t]);return e.c[t]=n,r}function pP(e,t){var n,r;for(Rj(t),r=e.Jc();r.Ob();)n=r.Pb(),t.Ad(n)}function JEe(e,t){var n=t.jd(),r=e.De(n);return!!r&&Wj(r.e,t.kd())}function YEe(e,t){return e.a.get(t)??U(sQ,bK,1,0,5,1)}function mP(e){e.i=0,jb(e.b,null),jb(e.c,null),e.a=null,e.e=null,++e.g}function XEe(e,t,n){e.a.c.length=0,Xet(e,t,n),e.a.c.length==0||z8e(e,t)}function ZEe(e,t){this.c=0,this.b=t,Gce.call(this,e,17493),this.a=this.c}function QEe(e){tat(),pre(this),this.a=new Dy,gIe(this,e),MO(this.a,e)}function $Ee(){WC(this),this.b=new SS(yq,yq),this.a=new SS(bq,bq)}function hP(e){gP(),!VQ&&(this.c=e,this.e=!0,this.a=new Uh)}function gP(){gP=E,VQ=!0,uvt=!1,dvt=!1,pvt=!1,fvt=!1}function _P(){_P=E,nFt=new Zse(hct,0),rFt=new Zse(`TARGET_WIDTH`,1)}function vP(e,t){return(CB(e),qv(new fk(e,new Oke(t,e.a)))).zd(WQ)}function eDe(){return cU(),G(j(Sbt,1),YK,363,0,[v$,y$,b$,x$,S$])}function tDe(){return $H(),G(j(QMt,1),YK,364,0,[XMt,qMt,ZMt,JMt,YMt])}function nDe(){return _W(),G(j(_Ft,1),YK,369,0,[e6,$3,n6,t6,r6])}function rDe(){return _U(),G(j(FFt,1),YK,330,0,[AFt,jFt,PFt,MFt,NFt])}function iDe(){return ZH(),G(j(_St,1),YK,371,0,[y1,x1,S1,b1,v1])}function aDe(){return ZV(),G(j(xkt,1),YK,303,0,[bkt,vkt,ykt,D4,O4])}function oDe(){return YB(),G(j(gwt,1),YK,165,0,[t2,Z0,Q0,$0,e2])}function sDe(){return HV(),G(j(g6,1),YK,160,0,[m6,p6,d6,h6,f6])}function cDe(){return UV(),G(j($8,1),YK,257,0,[Z8,Q8,ZRt,X8,QRt])}function lDe(e){return P_(),function(){return zwe(e,this,arguments)}}function yP(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function uDe(e,t){return N(t,144)?vD(e.c,F(t,144).c):!1}function bP(e){return e.t||(e.t=new Yne(e),aB(new c_(e),0,e.t)),e.t}function dDe(e){var t;return e.c||(t=e.r,N(t,88)&&(e.c=F(t,29))),e.c}function xP(e,t){return F(YF(e.d,t),21)||F(YF(e.e,t),21)}function fDe(e){this.b=e,Jw.call(this,e),this.a=F(lR(this.b.a,4),129)}function pDe(e){this.b=e,IT.call(this,e),this.a=F(lR(this.b.a,4),129)}function SP(e,t,n,r,i){IDe.call(this,t,r,i),this.c=e,this.b=n}function mDe(e,t,n,r,i){IDe.call(this,t,r,i),this.c=e,this.a=n}function hDe(e,t,n,r,i){XCe.call(this,t,r,i),this.c=e,this.a=n}function gDe(e,t,n,r,i){YCe.call(this,t,r,i),this.c=e,this.a=n}function _De(e){Db.call(this,e==null?xK:UB(e),N(e,80)?F(e,80):null)}function vDe(e){e&&MAe((j_(),Xgt)),--pQ,e&&mQ!=-1&&(Bse(mQ),mQ=-1)}function yDe(e,t){var n=F(hLe(e.c,t),18),r;n&&(r=n.gc(),n.$b(),e.d-=r)}function CP(e){return lw(e&uq,e>>22&uq,e<0?dq:0)}function bDe(e){var t=e.c.i,n=e.d.i;return t.k==(cW(),P$)&&n.k==P$}function xDe(e){var t=e.length;return vD(Sq.substr(Sq.length-t,t),e)}function wP(e){if($U(e))return e.c=e.a,e.a.Pb();throw k(new dg)}function TP(e,t){return t==0||e.e==0?e:t>0?_Be(e,t):g4e(e,-t)}function SDe(e,t){return t==0||e.e==0?e:t>0?g4e(e,t):_Be(e,-t)}function CDe(e){return e.e=3,e.d=e.Yb(),e.e==2?!1:(e.e=0,!0)}function EP(e){var t=new SM;return mR(t,e),K(t,(rK(),j2),null),t}function DP(e,t,n){var r;return r=e.Fh(t),r>=0?e.Ih(r,n,!0):GU(e,t,n)}function wDe(e,t,n){return sB(Iw(VV(e),xw(t.b)),Iw(VV(e),xw(n.b)))}function TDe(e,t,n){return sB(Iw(VV(e),xw(t.e)),Iw(VV(e),xw(n.e)))}function EDe(e,t){return r.Math.min(rF(t.a,e.d.d.c),rF(t.b,e.d.d.c))}function DDe(e,t,n){var r=new kw(e.a);GL(r,e.a.a),jU(r.f,t,n),e.a.a=r}function ODe(e,t,n,r){var i;for(i=0;i<XQ;i++)Fk(e.a[i][t.g],n,r[t.g])}function kDe(e,t,n,r){var i;for(i=0;i<Avt;i++)Ik(e.a[t.g][i],n,r[t.g])}function OP(e,t){var n=F(e.c.xc(t),18);return!n&&(n=e.ic(t)),e.pc(t,n)}function ADe(e){var t=(uj(e),e?new PD(e):pO(e.Jc()));return kU(t),OB(t)}function kP(e){var t,n;return uj(e),t=qve(e.length),n=new nF(t),VFe(n,e),n}function AP(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Mi(n,t),e.Li()}function jP(e,t){e.Zi(e.i+1),zw(e,e.i,e.Xi(e.i,t)),e.Ki(e.i++,t),e.Li()}function MP(e,t){return IS(t)?t==null?C$e(e.f,null):kPe(e.i,t):C$e(e.f,t)}function NP(e,t){var n=(mN(t,e.c.length),e.c[t]);return Vv(e.c,t,1),n}function PP(e,t,n,r){var i=U(q9,cq,30,t,15,1);return Iqe(i,e,t,n,r),i}function FP(e,t){return e.a?YS(e.a,e.b):e.a=new dT(e.d),qS(e.a,t),e}function jDe(e,t){if(e<0||e>t)throw k(new r_(eZe(e,t,`index`)));return e}function MDe(e){var t=e.e+e.f;return isNaN(t)&&MD(e.d)?e.d:t}function NDe(e,t){var n=(Rj(e),e),r=(Rj(t),t);return n==r?0:n<r?-1:1}function PDe(e,t){var n=e.q.getHours()+(t/60|0);e.q.setMinutes(t),vG(e,n)}function FDe(e,t,n){Ih.call(this,n),this.b=e,this.c=t,this.d=(_V(),rVt)}function IDe(e,t,n){this.d=e,this.k=+!!t,this.f=+!!n,this.o=-1,this.p=0}function IP(e){this.c=e,this.a=new O(this.c.a),this.b=new O(this.c.b)}function LP(){this.e=new Uh,this.c=new Uh,this.d=new Uh,this.b=new Uh}function LDe(){this.g=new Ore,this.b=new Ore,this.a=new Uh,this.k=new Uh}function RDe(){this.a=new Og,this.b=new jg,this.d=new kt,this.e=new Ot}function zDe(e,t,n){this.a=e,this.c=t,this.d=n,Rw(t.e,this),Rw(n.b,this)}function BDe(e,t){Wce.call(this,t.xd(),t.wd()&-6),Rj(e),this.a=e,this.b=t}function VDe(e,t){Gce.call(this,t.xd(),t.wd()&-6),Rj(e),this.a=e,this.b=t}function HDe(e,t){ZS.call(this,t.xd(),t.wd()&-6),Rj(e),this.a=e,this.b=t}function RP(e,t,n){this.a=e,this.b=t,this.c=n,Rw(e.t,this),Rw(t.i,this)}function zP(){this.b=new Dy,this.a=new Dy,this.b=new Dy,this.a=new Dy}function BP(){BP=E;var e,t;m9=(Sv(),t=new fg,t),h9=(e=new Rg,e)}function VP(){VP=E,i3=new Px(`REGULAR`,0),r3=new Px(`CRITICAL`,1)}function HP(){HP=E,DFt=new Qse(`FIXED`,0),s6=new Qse(`CENTER_NODE`,1)}function UDe(){UDe=E,Qxt=new nD(`separateLayerConnections`,(RR(),$xt))}function UP(){UP=E,w6=new jh(`org.eclipse.elk.labels.labelManager`)}function WDe(e){if(e.a){if(e.e)return WDe(e.e)}else return e;return null}function GDe(e,t){return e.p<t.p?1:e.p>t.p?-1:0}function KDe(e,t){return EA(e.a,t)?(MP(e.a,t),!0):!1}function qDe(e){var t=e.jd();return cO(F(e.kd(),18).Lc(),new xf(t))}function WP(e){var t=e.b;return t.b==0?null:F(eH(t,0),65).b}function JDe(e,t){var n=xtt(e,t);return e.b=new yL(n.c.length),Tet(e,n)}function YDe(e){var t;return CB(e),t=new Dhe(e,e.a.e,e.a.d|4),new NE(e,t)}function XDe(e){var t;for(Nj(e),t=0;e.a.zd(new Oe);)t=kB(t,1);return t}function ZDe(e){var t;return e.a||(t=e.r,N(t,159)&&(e.a=F(t,159))),e.a}function QDe(e,t,n){var r;return++e.e,--e.f,r=F(e.d[t].ed(n),136),r.kd()}function GP(e,t,n){return FN(t,e.e.Pd().gc()),FN(n,e.c.Pd().gc()),e.a[t][n]}function KP(e,t){return Rj(t),e.c<e.d?(e.Qe(t,e.c++),!0):!1}function $De(e,t){var n;e.C&&(n=F(Gj(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function eOe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function tOe(e,t,n){var r=0,i;for(i=0;i<t.length;i++)r+=e.sg(t[i],r,n)}function qP(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function nOe(e,t){t.Tg(`Label management`,1),LS(J(e,(UP(),w6))),t.Ug()}function rOe(){rOe=E,Mvt=kz((bF(),G(j(jvt,1),YK,461,0,[QQ,ZQ,$Q])))}function iOe(){iOe=E,Fvt=kz((QF(),G(j(Pvt,1),YK,462,0,[n$,t$,e$])))}function aOe(){aOe=E,kvt=kz((xI(),G(j(YQ,1),YK,237,0,[KQ,qQ,JQ])))}function oOe(){oOe=E,gvt=kz((bz(),G(j(UQ,1),YK,130,0,[mvt,HQ,hvt])))}function sOe(){sOe=E,vbt=kz((LF(),G(j(_bt,1),YK,384,0,[hbt,mbt,gbt])))}function cOe(){cOe=E,zCt=kz((yR(),G(j(RCt,1),YK,302,0,[ICt,LCt,t0])))}function lOe(){lOe=E,HCt=kz((BR(),G(j(VCt,1),YK,329,0,[r0,BCt,n0])))}function uOe(){uOe=E,WCt=kz(($F(),G(j(UCt,1),YK,316,0,[a0,o0,i0])))}function dOe(){dOe=E,wSt=kz((TL(),G(j(CSt,1),YK,368,0,[T1,w1,C1])))}function fOe(){fOe=E,Jkt=kz((yz(),G(j(qkt,1),YK,348,0,[Kkt,Gkt,z4])))}function pOe(){pOe=E,Wkt=kz((vR(),G(j(Ukt,1),YK,381,0,[Bkt,Vkt,Hkt])))}function mOe(){mOe=E,zkt=kz(($I(),G(j(Rkt,1),YK,452,0,[R4,I4,L4])))}function hOe(){hOe=E,Qkt=kz((Cz(),G(j(Zkt,1),YK,349,0,[Ykt,Xkt,B4])))}function gOe(){gOe=E,mkt=kz((zz(),G(j(pkt,1),YK,352,0,[dkt,fkt,C4])))}function _Oe(){_Oe=E,rAt=kz((ZI(),G(j(nAt,1),YK,351,0,[tAt,$kt,eAt])))}function vOe(){vOe=E,oAt=kz((wR(),G(j(aAt,1),YK,382,0,[iAt,H4,V4])))}function yOe(){yOe=E,Fjt=kz((az(),G(j(Pjt,1),YK,385,0,[Njt,Mjt,f3])))}function bOe(){bOe=E,sNt=kz((vz(),G(j(oNt,1),YK,386,0,[F3,iNt,aNt])))}function xOe(){xOe=E,hPt=kz((RB(),G(j(mPt,1),YK,387,0,[fPt,pPt,dPt])))}function SOe(){SOe=E,qSt=kz((QI(),G(j(KSt,1),YK,350,0,[WSt,I1,GSt])))}function COe(){COe=E,lCt=kz((VR(),G(j(cCt,1),YK,449,0,[sCt,z1,B1])))}function wOe(){wOe=E,ePt=kz((vV(),G(j($Nt,1),YK,436,0,[z3,B3,QNt])))}function TOe(){TOe=E,ZNt=kz((bR(),G(j(XNt,1),YK,304,0,[JNt,YNt,qNt])))}function EOe(){EOe=E,hFt=kz((dB(),G(j(mFt,1),YK,430,0,[dFt,pFt,fFt])))}function DOe(){DOe=E,uFt=kz((CF(),G(j(lFt,1),YK,429,0,[oFt,cFt,sFt])))}function OOe(){OOe=E,bFt=kz((uB(),G(j(yFt,1),YK,435,0,[i6,a6,o6])))}function kOe(){kOe=E,DRt=kz((SI(),G(j(ERt,1),YK,279,0,[E8,D8,O8])))}function AOe(){AOe=E,KRt=kz((_z(),G(j(GRt,1),YK,347,0,[P8,N8,F8])))}function jOe(){jOe=E,fzt=kz((kI(),G(j(dzt,1),YK,300,0,[F5,lzt,uzt])))}function MOe(){MOe=E,yzt=kz((lB(),G(j(vzt,1),YK,281,0,[_zt,Y5,X5])))}function JP(){JP=E,ISt=new Ose(`QUADRATIC`,0),LSt=new Ose(`SCANLINE`,1)}function YP(e){return!e.g&&(e.g=new tl),!e.g.c&&(e.g.c=new Jne(e)),e.g.c}function NOe(e){return!e.g&&(e.g=new tl),!e.g.a&&(e.g.a=new qne(e)),e.g.a}function POe(e){return!e.g&&(e.g=new tl),!e.g.b&&(e.g.b=new Gne(e)),e.g.b}function FOe(e){return!e.g&&(e.g=new tl),!e.g.d&&(e.g.d=new Kne(e)),e.g.d}function IOe(e,t,n,r){return n&&(r=n.Oh(t,rV(n.Ah(),e.c.sk()),null,r)),r}function LOe(e,t,n,r){return n&&(r=n.Qh(t,rV(n.Ah(),e.c.sk()),null,r)),r}function XP(e,t,n,r){var i=U(q9,cq,30,t+1,15,1);return Q5e(i,e,t,n,r),i}function U(e,t,n,r,i,a){var o=HUe(i,r);return i!=10&&G(j(e,a),t,n,i,o),o}function ROe(e,t,n){var r,i=new hR(t,e);for(r=0;r<n;++r)rH(i);return i}function ZP(e,t,n){var r,i;if(n!=null)for(r=0;r<t;++r)i=n[r],e.Oi(r,i)}function zOe(e,t){var n=new he;return n.c=!0,n.d=t.kd(),ant(e,t.jd(),n)}function BOe(e,t){var n=e.q.getHours()+(t/3600|0);e.q.setSeconds(t),vG(e,n)}function VOe(e,t){var n=t,r=bM(pO(new OF(e,n)));return uk(new OF(e,n)),r}function QP(e,t){return!e.o&&(e.o=new cF((eK(),d7),g7,e,0)),sV(e.o,t)}function HOe(e,t,n){F(e.b,68),F(e.b,68),F(e.b,68),vI(e.a,new hpe(n,t,e))}function UOe(e,t,n,r){z5e(e,t,n,yG(e,t,r,N(t,103)&&(F(t,19).Bb&Cq)!=0))}function $P(e,t,n){if(e<0||t>n||t<e)throw k(new z_(Lq+e+Got+t+Fot+n))}function WOe(e,t,n){this.d=new Ag,this.c=new Wh,this.a=e,this.e=t,this.c=n}function eF(e){e?(this.c=e,this.b=null):(this.c=null,this.b=new Uh)}function tF(e,t){Fb.call(this,e,t),this.a=U(evt,VK,438,2,0,1),this.b=!0}function GOe(e){mIe.call(this,e,0),nde(this),this.d.b=this.d,this.d.a=this.d}function KOe(e){this.e=e,this.b=this.e.a.entries(),this.a=U(sQ,bK,1,0,5,1)}function nF(e){WC(this),hO(e>=0,`Initial capacity must not be negative`)}function rF(e,t){var n=e.a-t.a,i=e.b-t.b;return r.Math.sqrt(n*n+i*i)}function qOe(e,t,n){var r=e.b[n.c.p][n.p];r.b+=t.b,r.c+=t.c,r.a+=t.a,++r.a}function JOe(){JOe=E,dAt=Lk($O(new Ij,(cU(),v$),(sK(),Pxt)),S$,s1)}function YOe(){return EU(),G(j(N1,1),YK,231,0,[k1,j1,O1,A1,M1,D1])}function XOe(){return hU(),G(j(hCt,1),YK,284,0,[dCt,uCt,pCt,fCt,mCt,V1])}function ZOe(){return HH(),G(j(TCt,1),YK,282,0,[U1,SCt,wCt,xCt,CCt,bCt])}function QOe(){return pU(),G(j(MCt,1),YK,283,0,[W1,OCt,jCt,ACt,kCt,DCt])}function $Oe(){return aH(),G(j(zIt,1),YK,256,0,[RIt,O6,k6,A6,E6,D6])}function eke(){return QH(),G(j(ezt,1),YK,102,0,[a5,i5,r5,e5,n5,t5])}function tke(){return IU(),G(j(f5,1),YK,280,0,[u5,c5,l5,s5,o5,d5])}function nke(){return JH(),G(j(tLt,1),YK,299,0,[eLt,P6,N6,$It,j6,M6])}function rke(){return oU(),G(j(LRt,1),YK,328,0,[FRt,NRt,IRt,jRt,PRt,MRt])}function ike(e){var t;return!e.a&&e.b!=-1&&(t=e.c.Ah(),e.a=cI(t,e.b)),e.a}function iF(e,t){return e.Qi()&&e.Gc(t)?!1:(e.Fi(t),!0)}function aF(e,t){return OM(t,`Horizontal alignment cannot be null`),e.b=t,e}function ake(e,t,n){cK();var r=QG(e,t);return n&&r&&vve(e)&&(r=null),r}function oF(e,t,n){var r,i;for(i=e.Jc();i.Ob();)r=F(i.Pb(),36),GW(r,t,n)}function oke(e,t){var n,r;for(r=t.Jc();r.Ob();)n=F(r.Pb(),36),a8e(e,n,0,0)}function ske(e){var t,n;for(n=WV(e.a,0);n.b!=n.d.c;)t=F(UN(n),65),eQe(t)}function cke(e,t){return Xoe(e.e,t)||BV(e.e,t,new zVe(t)),F(YF(e.e,t),113)}function sF(e,t,n,r){return Rj(e),Rj(t),Rj(n),Rj(r),new T_e(e,t,new Ce)}function cF(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=new yA(this,t,n,r)}function lF(e,t,n,r,i,a){Hwe.call(this,t,r,i,a),this.c=e,this.b=n}function uF(e,t,n,r,i,a){Hwe.call(this,t,r,i,a),this.c=e,this.a=n}function dF(e,t){var n,r,i=e.r;return r=e.d,n=wG(e,t,!0),n.b!=i||n.a!=r}function fF(e,t,n){var r,i=(r=aW(e.b,t),r);return i?MG(NF(e,i),n):null}function lke(e,t,n){var r=GM(e,n),i=null,a;r&&(i=mXe(r)),a=i,kVe(t,n,a)}function uke(e,t,n){var r=GM(e,n),i=null,a;r&&(i=mXe(r)),a=i,kVe(t,n,a)}function dke(e,t,n){var i;e.d[t.g]=n,i=e.g.c,i[t.g]=r.Math.max(i[t.g],n+1)}function pF(e,t){var n;return n=e.Fh(t),n>=0?e.Ih(n,!0,!0):GU(e,t,!0)}function fke(e,t){var n=vj(e.k,t);return m2e(e,t),q6e(e,t),O1e(e,t,n),null}function pke(e){var t;if(!e.a)throw k(new dbe);return t=e.a,e.a=XM(e.a),t}function mke(e){if(e.b<=0)throw k(new dg);return--e.b,e.a-=e.c.c,q(e.a)}function hke(e,t,n){var r=GFe(e,t,n);return e.b=new yL(r.c.length),W4e(e,r)}function mF(e){var t;return uj(e),N(e,204)?(t=F(e,204),t):new Hf(e)}function gke(e){for(;!e.a;)if(!Lfe(e.c,new em(e)))return!1;return!0}function _ke(e,t){e.a.Le(t.d,e.b)>0&&(Rw(e.c,new SO(t.c,t.d,e.d)),e.b=t.d)}function vke(e,t){if(e.g==null||t>=e.i)throw k(new rC(t,e.i));return e.g[t]}function yke(e){var t;if(e.ll())for(t=e.i-1;t>=0;--t)W(e,t);return LTe(e)}function bke(e){hF(),F(e.mf((oK(),i8)),182).Ec((IU(),l5)),e.of(JLt,null)}function hF(){hF=E,EIt=new $s,OIt=new ec,DIt=xFe((oK(),JLt),EIt,Q6,OIt)}function gF(){gF=E,eNt=new Xse(`LEAF_NUMBER`,0),tNt=new Xse(`NODE_SIZE`,1)}function xke(){xke=E,CG(),LVt=yq,IVt=bq,zVt=new Fp(yq),RVt=new Fp(bq)}function Ske(e){return N(e,180)?``+F(e,180).a:e==null?null:UB(e)}function Cke(e){return N(e,180)?``+F(e,180).a:e==null?null:UB(e)}function _F(e,t,n,r,i){return t<0?GU(e,n,r):F(n,69).uk().wk(e,e.ei(),t,r,i)}function vF(e,t,n,r){var i;r=(fM(),r||F_t),i=e.slice(t,n),tZe(i,e,t,n,-t,r)}function wke(e,t){var n,r=t/e.c.Pd().gc()|0;return n=t%e.c.Pd().gc(),GP(e,r,n)}function Tke(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function Eke(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function Dke(e,t,n){if(sz(e,n),n!=null&&!e.dk(n))throw k(new rg);return n}function yF(e,t){return rI(t)!=10&&G(mz(t),t.Qm,t.__elementTypeId$,rI(t),e),e}function Oke(e,t){ZS.call(this,t.xd(),t.wd()&-16449),Rj(e),this.a=e,this.c=t}function kke(e,t,n,r,i){Yle(this),this.b=e,this.d=t,this.f=n,this.g=r,this.c=i}function Ake(e,t){if(t.a)throw k(new Qg(Xot));MA(e.a,t),t.a=e,!e.j&&(e.j=t)}function bF(){bF=E,QQ=new Vb(Kq,0),ZQ=new Vb(Gq,1),$Q=new Vb(qq,2)}function xF(){xF=E,tvt=new Rb(`All`,0),nvt=new BC,rvt=new Jle,ivt=new VC}function jke(){jke=E,avt=kz((xF(),G(j(BQ,1),YK,310,0,[tvt,nvt,rvt,ivt])))}function Mke(){Mke=E,tSt=kz((RR(),G(j(eSt,1),YK,367,0,[$xt,p1,m1,f1])))}function Nke(){Nke=E,Wbt=kz((FV(),G(j(Ubt,1),YK,383,0,[k$,Vbt,Bbt,Hbt])))}function Pke(){Pke=E,uyt=kz((SR(),G(j(lyt,1),YK,409,0,[a$,i$,syt,cyt])))}function Fke(){Fke=E,Nbt=kz((zR(),G(j(Mbt,1),YK,408,0,[w$,D$,T$,E$])))}function Ike(){Ike=E,USt=kz((XB(),G(j(HSt,1),YK,301,0,[F1,BSt,P1,VSt])))}function Lke(){Lke=E,_kt=kz((iH(),G(j(gkt,1),YK,203,0,[E4,hkt,T4,w4])))}function Rke(){Rke=E,Nkt=kz((EV(),G(j(Mkt,1),YK,269,0,[F4,kkt,Akt,jkt])))}function zke(){zke=E,gSt=kz((xR(),G(j(hSt,1),YK,413,0,[h1,g1,_1,mSt])))}function Bke(){Bke=E,DAt=kz((Rz(),G(j(EAt,1),YK,404,0,[U4,G4,K4,W4])))}function Vke(){Vke=E,KNt=kz((_H(),G(j(GNt,1),YK,354,0,[WNt,HNt,UNt,VNt])))}function Hke(){Hke=E,IMt=kz((Sz(),G(j(FMt,1),YK,353,0,[PMt,j3,NMt,MMt])))}function Uke(){Uke=E,_jt=kz((OH(),G(j(gjt,1),YK,398,0,[s3,c3,l3,u3])))}function Wke(){Wke=E,oPt=kz((aU(),G(j(aPt,1),YK,401,0,[iPt,tPt,rPt,nPt])))}function Gke(){Gke=E,TRt=kz((Bz(),G(j(wRt,1),YK,278,0,[T8,w8,SRt,CRt])))}function Kke(){Kke=E,ARt=kz((fB(),G(j(kRt,1),YK,222,0,[ORt,A8,k8,j8])))}function qke(){qke=E,YRt=kz((kH(),G(j(JRt,1),YK,292,0,[z8,I8,L8,R8])))}function Jke(){Jke=E,wzt=kz((uP(),G(j(Z5,1),YK,288,0,[bzt,Czt,xzt,Szt])))}function Yke(){Yke=E,pzt=kz((yV(),G(j(B5,1),YK,380,0,[R5,z5,L5,I5])))}function Xke(){Xke=E,Azt=kz((ZB(),G(j(kzt,1),YK,327,0,[Ozt,Tzt,Dzt,Ezt])))}function Zke(){Zke=E,Lzt=kz((xz(),G(j(Izt,1),YK,407,0,[Nzt,Pzt,Mzt,Fzt])))}function SF(){SF=E,_Ct=new kse(BJ,0),H1=new kse(`IMPROVE_STRAIGHTNESS`,1)}function CF(){CF=E,oFt=new Yx(ydt,0),cFt=new Yx(Vut,1),sFt=new Yx(BJ,2)}function wF(e){e.a=U(q9,cq,30,e.b+1,15,1),e.c=U(q9,cq,30,e.b,15,1),e.d=0}function TF(e){var t;for(t=e.p+1;t<e.c.a.c.length;++t)--F(ck(e.c.a,t),9).p}function EF(e){var t=e.hj();t!=null&&e.d!=-1&&F(t,94).uh(e),e.i&&e.i.mj()}function DF(e){var t;return hC(e)&&(t=0-e,!isNaN(t))?t:rR(qR(e))}function Qke(e){var t;if(!xL(e))throw k(new dg);return e.e=1,t=e.d,e.d=null,t}function OF(e,t){var n;this.f=e,this.b=t,n=F(vj(e.b,t),262),this.c=n?n.b:null}function kF(e,t){var n=AF(e,t,0);return n==-1?!1:(NP(e,n),!0)}function $ke(e,t){var n=F(MP(e.e,t),393);return n?(Ghe(n),n.e):null}function AF(e,t,n){for(;n<e.c.length;++n)if(Wj(t,e.c[n]))return n;return-1}function eAe(e,t,n){var r;return Nj(e),r=new Ee,r.a=t,e.a.Nb(new Ib(r,n)),r.a}function tAe(e){var t;return Nj(e),t=U(Z9,Tq,30,0,15,1),zv(e.a,new fte(t)),t}function nAe(e,t){return sB(A(P(J(e,(Z(),I0)))),A(P(J(t,I0))))}function rAe(e,t){return new aO(t,mE(xw(t.e),t.f.a+e,t.f.b+e),(_T(),!1))}function iAe(e,t){return xO(),Rw(e,new wS(t,q(t.e.c.length+t.g.c.length)))}function aAe(e,t){return xO(),Rw(e,new wS(t,q(t.e.c.length+t.g.c.length)))}function jF(e,t){return Wj(t,ck(e.f,0))||Wj(t,ck(e.f,1))||Wj(t,ck(e.f,2))}function MF(e,t){if(t<0)throw k(new r_(Tft+t));return yTe(e,t+1),ck(e.j,t)}function oAe(e,t,n,r,i){return Rj(e),Rj(t),Rj(n),Rj(r),Rj(i),new T_e(e,t,r)}function sAe(e,t){ib();var n=GN(e),r=GN(t);return!!n&&!!r&&!oHe(n.k,r.k)}function NF(e,t){var n=F(t,680),r=n.ui();return!r&&n.xi(r=new Ace(e,t)),r}function PF(e,t){var n=F(t,682),r=n.Yk();return!r&&n.al(r=new swe(e,t)),r}function FF(e){return F(J(F(ck(e.j,0),12),(Z(),N0)),12)}function IF(e){return e.b||(e.b=new Rk(e,z7,e),!e.a&&(e.a=new HE(e,e))),e.b}function LF(){LF=E,hbt=new Kb(`XY`,0),mbt=new Kb(`X`,1),gbt=new Kb(`Y`,2)}function RF(){RF=E,Pkt=new jse(`INPUT_ORDER`,0),Fkt=new jse(`PORT_DEGREE`,1)}function cAe(){QD(),this.b=new Wh,this.f=new Wh,this.g=new Wh,this.e=new Wh}function zF(e){fw(this),this.g=e?DM(e,e.ge()):null,this.f=e,hM(this),this.he()}function BF(e,t,n,r,i,a,o){rL.call(this,t,r,i,a,o),this.c=e,this.b=n}function lAe(e,t,n,r){if(!e)throw k(new u_(WW(t,G(j(sQ,1),bK,1,5,[n,r]))))}function VF(e,t,n){var r=10,i;for(i=0;i<n-1;i++)t<r&&(e.a+=`0`),r*=10;e.a+=t}function uAe(e,t){fyt=new rt,dyt=t,o$=e,F(o$.b,68),HOe(o$,fyt,null),_et(o$)}function HF(e){var t,n=e.length;return t=U(K9,rq,30,n,15,1),ej(e,0,n,t,0),t}function UF(e){age();var t=e+128,n=c_t[t];return!n&&(n=c_t[t]=new Zee(e)),n}function dAe(e){return RD(e.d.a.e.g,e.b),tE(e.c!=e.d.a.d),e.a=e.c,e.c=e.c.a,e.a}function fAe(e){$T(!!e.c),RD(e.f.g,e.d),e.c.Qb(),e.c=null,e.b=XPe(e),e.d=e.f.g}function pAe(e){var t;return e.Lh()||(t=oj(e.Ah())-e.gi(),e.Xh().Kk(t)),e.wh()}function mAe(e){var t=OI(lR(e,32));return t??=(jV(e),OI(lR(e,32))),t}function WF(e,t){var n=rV(e.d,t);return n>=0?nH(e,n,!0,!0):GU(e,t,!0)}function hAe(e,t){AD(F(F(e.f,26).mf((oK(),r8)),102))&&gze(rye(F(e.f,26)),t)}function gAe(e,t){II(e,t==null||MD((Rj(t),t))||isNaN((Rj(t),t))?0:(Rj(t),t))}function _Ae(e,t){FI(e,t==null||MD((Rj(t),t))||isNaN((Rj(t),t))?0:(Rj(t),t))}function vAe(e,t){AI(e,t==null||MD((Rj(t),t))||isNaN((Rj(t),t))?0:(Rj(t),t))}function yAe(e,t){LI(e,t==null||MD((Rj(t),t))||isNaN((Rj(t),t))?0:(Rj(t),t))}function bAe(e){(this.q?this.q:(dM(),dM(),LQ)).zc(e.q?e.q:(dM(),dM(),LQ))}function GF(e,t,n){var r=e.g[t];return zw(e,t,e.Xi(t,n)),e.Pi(t,n,r),e.Li(),r}function KF(e,t){var n=e.bd(t);return n>=0?(e.ed(n),!0):!1}function qF(e){var t;return e.d!=e.r&&(t=FH(e),e.e=!!t&&t.jk()==fht,e.d=t),e.e}function JF(e,t){var n;for(uj(e),uj(t),n=!1;t.Ob();)n|=e.Ec(t.Pb());return n}function YF(e,t){var n=F(vj(e.e,t),393);return n?(vue(e,n),n.e):null}function XF(e){var t=e.b.c.length==0?null:ck(e.b,0);return t!=null&&_L(e,0),t}function ZF(e,t){var n,r;return CB(e),r=new HDe(t,e.a),n=new CD(r),new fk(e,n)}function QF(){QF=E,n$=new Hb(`TOP`,0),t$=new Hb(Gq,1),e$=new Hb(mst,2)}function $F(){$F=E,a0=new gx(BJ,0),o0=new gx(`TOP`,1),i0=new gx(mst,2)}function eI(){eI=E,Ibt=new xt,Lbt=new St,Pbt=new Ct,Fbt=new wt,Rbt=new Tt}function tI(){tI=E,r_t=lw(uq,uq,524287),i_t=lw(0,0,fq),a_t=CP(1),CP(2),o_t=CP(0)}function nI(e,t){var n=e.a[t],r=(UR(),n_t)[typeof n];return r?r(n):gLe(typeof n)}function xAe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function SAe(e){return bGe(e,(tI(),o_t))<0?-Pue(qR(e)):e.l+e.m*pq+e.h*mq}function CAe(e){switch(e.g){case 0:return hK;case 1:return eq;default:return 0}}function rI(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function wAe(e,t){return N(t,103)&&(F(t,19).Bb&Cq)!=0?new aC(t,e):new hR(t,e)}function TAe(e,t){return N(t,103)&&(F(t,19).Bb&Cq)!=0?new aC(t,e):new hR(t,e)}function EAe(e,t,n){return Iw(new SS(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)==(Rj(t),t)}function DAe(e,t){var n,r,i=t.c.i;n=F(vj(e.f,i),60),r=n.d.c-n.e.c,ANe(t.a,r,0)}function OAe(e,t){var n;for(++e.d,++e.c[t],n=t+1;n<e.a.length;)++e.a[n],n+=n&-n}function kAe(e,t){for(var n=0;e.e!=e.i.gc();)VA(t,KV(e),q(n)),n!=hK&&++n}function AAe(e){var t;for(++e.a,t=e.c.a.length;e.a<t;++e.a)if(e.c.b[e.a])return}function jAe(e){var t,n;if(e.a){n=null;do t=e.a,e.a=null,n=oXe(t,n);while(e.a);e.a=n}}function MAe(e){var t,n;if(e.b){n=null;do t=e.b,e.b=null,n=oXe(t,n);while(e.b);e.b=n}}function NAe(e){if(!e.c)throw k(new dg);return e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function PAe(e){if(!e.e)throw k(new dg);return e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function FAe(e,t){var n=WB(e.e.c,t.e.c);return n==0?sB(e.e.d,t.e.d):n}function IAe(e,t){var n,r=t.c;for(n=r+1;n<=t.f;n++)e.a[n]>e.a[r]&&(r=n);return r}function LAe(e){var t=F(J(e,(Z(),c0)),318);return t?t.a==e:!1}function RAe(e){var t=F(J(e,(Z(),c0)),318);return t?t.i==e:!1}function zAe(e,t){return t==(zD(),zD(),K_t)?e.toLocaleLowerCase():e.toLowerCase()}function BAe(){BAe=E,Cbt=kz((cU(),G(j(Sbt,1),YK,363,0,[v$,y$,b$,x$,S$])))}function VAe(){VAe=E,Skt=kz((ZV(),G(j(xkt,1),YK,303,0,[bkt,vkt,ykt,D4,O4])))}function HAe(){HAe=E,vSt=kz((ZH(),G(j(_St,1),YK,371,0,[y1,x1,S1,b1,v1])))}function UAe(){UAe=E,$Mt=kz(($H(),G(j(QMt,1),YK,364,0,[XMt,qMt,ZMt,JMt,YMt])))}function WAe(){WAe=E,vFt=kz((_W(),G(j(_Ft,1),YK,369,0,[e6,$3,n6,t6,r6])))}function GAe(){GAe=E,IFt=kz((_U(),G(j(FFt,1),YK,330,0,[AFt,jFt,PFt,MFt,NFt])))}function KAe(){KAe=E,_wt=kz((YB(),G(j(gwt,1),YK,165,0,[t2,Z0,Q0,$0,e2])))}function qAe(){qAe=E,MIt=kz((HV(),G(j(g6,1),YK,160,0,[m6,p6,d6,h6,f6])))}function JAe(){JAe=E,xRt=kz((cB(),G(j(C8,1),YK,86,0,[x8,b8,y8,v8,S8])))}function YAe(){YAe=E,rzt=kz((YG(),G(j(P5,1),VJ,64,0,[M5,m5,p5,j5,N5])))}function XAe(){XAe=E,$Rt=kz((UV(),G(j($8,1),YK,257,0,[Z8,Q8,ZRt,X8,QRt])))}function iI(){iI=E,wyt=new ase(`EADES`,0),l$=new ase(`FRUCHTERMAN_REINGOLD`,1)}function aI(){aI=E,R1=new cx(`READING_DIRECTION`,0),iCt=new cx(`ROTATION`,1)}function ZAe(e){this.g=e,this.f=new Uh,this.a=r.Math.min(this.g.c.c,this.g.d.c)}function QAe(e){this.b=new Uh,this.a=new Uh,this.c=new Uh,this.d=new Uh,this.e=e}function $Ae(e,t,n,r){cK(),Vh.call(this,26),this.c=e,this.a=t,this.d=n,this.b=r}function eje(e,t,n){sD.call(this),kje(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function tje(e,t,n){var r,i;for(i=new O(n);i.a<i.c.c.length;)r=H(i),uqe(e,t,r)}function nje(e,t,n){return zM(KO(e.a.e[F(t.a,9).p]-e.a.e[F(n.a,9).p]))}function oI(e,t){var n=F(vj(e.a,t),150);return n||(n=new ot,Uj(e.a,t,n)),n}function sI(e,t,n){var r;if(t==null)throw k(new lg);return r=GM(e,t),BTe(e,t,n),r}function cI(e,t){var n=(e.i??mG(e),e.i);return t>=0&&t<n.length?n[t]:null}function rje(e,t){return Rj(t),cA(e),e.d.Ob()?(t.Ad(e.d.Pb()),!0):!1}function lI(e){return Iz(e,hK)>0?hK:Iz(e,eq)<0?eq:wk(e)}function ije(e,t){return CI(),-sw(F(J(e,(pG(),O3)),15).a,F(J(t,O3),15).a)}function aje(){return cW(),G(j(Ybt,1),YK,249,0,[R$,I$,P$,z$,F$,N$,B$,L$])}function oje(){return QU(),G(j(S7,1),YK,244,0,[aBt,b7,x7,y7,iBt,v7,_7,rBt])}function sje(){return CU(),G(j(PIt,1),YK,285,0,[NIt,_6,x6,C6,v6,y6,b6,S6])}function cje(){return VW(),G(j(NSt,1),YK,275,0,[ESt,kSt,TSt,MSt,OSt,DSt,jSt,ASt])}function lje(e,t){return!!RL(e,t,wk(AB(WK,Yj(wk(AB(t==null?0:DL(t),GK)),15))))}function uje(e,t){var n=t>0?t-1:t;return Eae(Tae(Zje(kO(new Gg,n),e.n),e.j),e.k)}function uI(e){var t,n=(t=new zg,t);iF((!e.q&&(e.q=new R(B7,e,11,10)),e.q),n)}function dje(e,t){var n=F(Fz(e.d,t),18),r;return n?(r=t,e.e.pc(r,n)):null}function dI(e,t){var n;return CB(e),n=new $ye(e,e.a.xd(),e.a.wd()|4,t),new fk(e,n)}function fI(e){var t;$T(!!e.c),t=e.c.a,gI(e.d,e.c),e.b==e.c?e.b=t:--e.a,e.c=null}function fje(e){return e.a>=-.01&&e.a<=Xq&&(e.a=0),e.b>=-.01&&e.b<=Xq&&(e.b=0),e}function pje(e){var t=A(P(J(e,(rK(),E2))));return t<0&&(t=0,K(e,E2,t)),t}function mje(e,t){AD(F(J(F(e.e,9),(rK(),Z2)),102))&&(dM(),rw(F(e.e,9).j,t))}function pI(e,t){var n,r;for(r=e.Jc();r.Ob();)n=F(r.Pb(),70),K(n,(Z(),T0),t)}function hje(e,t,n){var i=r.Math.max(0,e.b/2-.5);IH(n,i,1),Rw(t,new _se(n,i))}function gje(e,t,n,r){var i;e.j=-1,n$e(e,hXe(e,t,n),(bb(),i=F(t,69).tk(),i.vl(r)))}function _je(e,t,n,r,i,a){var o=EP(r);QM(o,i),eN(o,a),UU(e.a,r,new JD(o,t,n.f))}function vje(e,t){$V(e,(HW(),uPt),t.f),$V(e,cPt,t.e),$V(e,lPt,t.d),$V(e,sPt,t.c)}function yje(e,t){if(0>e||e>t)throw k(new B_(`fromIndex: 0, toIndex: `+e+Fot+t))}function mI(e){if(e<0)throw k(new u_(`Illegal Capacity: `+e));this.g=this.$i(e)}function bje(e){this.d=e,this.c=e.c.vc().Jc(),this.b=null,this.a=null,this.e=(N_(),Rgt)}function hI(e,t){for(var n=e;XM(n);)if(n=XM(n),n==t)return!0;return!1}function xje(e,t){return t&&e.b[t.g]==t?(_j(e.b,t.g,null),--e.c,!0):!1}function gI(e,t){var n=t.c;return t.a.b=t.b,t.b.a=t.a,t.a=t.b=null,t.c=null,--e.b,n}function Sje(e,t){var n=SW(e.Ah(),t);if(!n)throw k(new u_(PX+t+Dpt));return n}function _I(e){LW();var t,n=ndt;for(t=0;t<e.length;t++)e[t]>n&&(n=e[t]);return n}function Cje(e){var t;for(t=0;t<e.c.length;t++)(mN(t,e.c.length),F(e.c[t],12)).p=t}function wje(e){for(var t=e.a.d.j,n=e.c.d.j;t!=n;)gL(e.b,t),t=mB(t);gL(e.b,t)}function Tje(e,t){var n,r=t.a.jd(),i;for(n=F(t.a.kd(),18).gc(),i=0;i<n;i++)e.Ad(r)}function vI(e,t){var n,r,i,a;for(Rj(t),r=e.c,i=0,a=r.length;i<a;++i)n=r[i],t.Ad(n)}function yI(e,t){var n,r,i,a;for(r=e.d,i=0,a=r.length;i<a;++i)n=r[i],Mw(e.g,n).a=t}function Eje(e,t,n){var r,i=t[n],a;for(r=0;r<i.length;r++)a=i[r],e.e[a.c.p][a.p]=r}function Dje(e,t,n){var r=t,i;do i=A(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function Oje(e){var t=r.Math.sqrt(e.a*e.a+e.b*e.b);return t>0&&(e.a/=t,e.b/=t),e}function bI(e){this.b=(uj(e),new PD(e)),this.a=new Uh,this.d=new Uh,this.e=new mv}function kje(e){e.b=(bF(),ZQ),e.f=(QF(),t$),e.d=(oL(2,JK),new nF(2)),e.e=new mv}function xI(){xI=E,KQ=new Bb(`BEGIN`,0),qQ=new Bb(Gq,1),JQ=new Bb(`END`,2)}function SI(){SI=E,E8=new oS(Gq,0),D8=new oS(`HEAD`,1),O8=new oS(`TAIL`,2)}function CI(){CI=E,HMt=AV(AV(AV(fb(new Ij,(OH(),c3)),(ZW(),kjt)),Sjt),Ejt)}function wI(){wI=E,WMt=AV(AV(AV(fb(new Ij,(OH(),u3)),(ZW(),wjt)),yjt),Cjt)}function Aje(){Aje=E,XQ=(xI(),G(j(YQ,1),YK,237,0,[KQ,qQ,JQ])).length,Avt=XQ}function jje(e,t){for(;t[0]<e.length&&fC(` \r
25
25
  `,iU(Hj(e,t[0])))>=0;)++t[0]}function TI(e,t){var n,r=e.a;n=cRe(e,t,null),r!=t&&!e.e&&(n=WG(e,t,n)),n&&n.mj()}function EI(e){var t;return e.w?e.w:(t=vCe(e),t&&!t.Sh()&&(e.w=t),t)}function Mje(e){var t;return e==null?null:(t=F(e,195),cJe(t,t.length))}function W(e,t){if(e.g==null||t>=e.i)throw k(new rC(t,e.i));return e.Ui(t,e.g[t])}function Nje(e,t){dM();var n,r=new Uh;for(n=0;n<e;++n)$h(r.c,t);return new U_(r)}function Pje(e){return CB(e),gO(!0,`n may not be negative`),new fk(e,new TMe(e.a))}function Fje(e){return(e.i&2?`interface `:e.i&1?``:`class `)+(wE(e),e.o)}function Ije(e,t){return ZC(),YI($K),r.Math.abs(e-t)<=$K||e==t||isNaN(e)&&isNaN(t)}function Lje(e,t){return ZC(),YI($K),r.Math.abs(e-t)<=$K||e==t||isNaN(e)&&isNaN(t)}function Rje(e,t){return fU(),sw(e.b.c.length-e.e.c.length,t.b.c.length-t.e.c.length)}function DI(e,t){return Kv(LL(e,t,wk(AB(WK,Yj(wk(AB(t==null?0:DL(t),GK)),15)))))}function zje(e,t){return uD(xw(F(vj(e.g,t),8)),yw(F(vj(e.f,t),460).b))}function Bje(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function OI(e){var t;return RO(e==null||Array.isArray(e)&&(t=rI(e),!(t>=14&&t<=16))),e}function Vje(){Vje=E,FSt=kz((EU(),G(j(N1,1),YK,231,0,[k1,j1,O1,A1,M1,D1])))}function Hje(){Hje=E,gCt=kz((hU(),G(j(hCt,1),YK,284,0,[dCt,uCt,pCt,fCt,mCt,V1])))}function Uje(){Uje=E,ECt=kz((HH(),G(j(TCt,1),YK,282,0,[U1,SCt,wCt,xCt,CCt,bCt])))}function Wje(){Wje=E,NCt=kz((pU(),G(j(MCt,1),YK,283,0,[W1,OCt,jCt,ACt,kCt,DCt])))}function Gje(){Gje=E,BIt=kz((aH(),G(j(zIt,1),YK,256,0,[RIt,O6,k6,A6,E6,D6])))}function Kje(){Kje=E,tzt=kz((QH(),G(j(ezt,1),YK,102,0,[a5,i5,r5,e5,n5,t5])))}function qje(){qje=E,nzt=kz((IU(),G(j(f5,1),YK,280,0,[u5,c5,l5,s5,o5,d5])))}function Jje(){Jje=E,nLt=kz((JH(),G(j(tLt,1),YK,299,0,[eLt,P6,N6,$It,j6,M6])))}function Yje(){Yje=E,RRt=kz((oU(),G(j(LRt,1),YK,328,0,[FRt,NRt,IRt,jRt,PRt,MRt])))}function Xje(){return eW(),G(j(Y8,1),YK,96,0,[V8,B8,U8,J8,q8,K8,W8,G8,H8])}function kI(){kI=E,F5=new hS(dpt,0),lzt=new hS(`PARENT`,1),uzt=new hS(`ROOT`,2)}function Zje(e,t){return e.n=t,e.n?(e.f=new Uh,e.e=new Uh):(e.f=null,e.e=null),e}function AI(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,3,n,e.f))}function jI(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,0,n,e.a))}function MI(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,1,n,e.b))}function NI(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,3,n,e.b))}function PI(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,4,n,e.c))}function FI(e,t){var n=e.g;e.g=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,4,n,e.g))}function II(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,5,n,e.i))}function LI(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,6,n,e.j))}function RI(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,1,n,e.j))}function zI(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&tR(e,new iP(e,2,n,e.k))}function BI(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&tR(e,new hEe(e,2,n,e.d))}function VI(e,t){var n=e.s;e.s=t,e.Db&4&&!(e.Db&1)&&tR(e,new hEe(e,4,n,e.s))}function HI(e,t){var n=e.t;e.t=t,e.Db&4&&!(e.Db&1)&&tR(e,new hEe(e,5,n,e.t))}function UI(e,t){var n=e.F;e.F=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,5,n,t))}function WI(e,t){var n=F(vj((hb(),D7),e),58);return n?n.ek(t):U(sQ,bK,1,t,5,1)}function GI(e,t){var n=t in e.a,r;return n&&(r=GM(e,t).pe(),r)?r.a:null}function Qje(e,t){var n=(r=(bv(),i=new Jc,i),t&&S2e(r,t),r),r,i;return UMe(n,e),n}function $je(e,t,n){var r=DV(n);return Uj(e.c,r,t),Uj(e.d,t,n),Uj(e.e,t,KM(t)),t}function KI(e,t,n,r,i,a){var o=lj(e,t);return lMe(n,o),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function eMe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function tMe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function nMe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function rMe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function iMe(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function aMe(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],Ake(e.a,n);return e}function qI(e){var t,n,r,i;for(n=e,r=0,i=n.length;r<i;++r)t=n[r],uj(t);return new tle(e)}function oMe(e){var t=uD(xw(e.d.d),e.c.d);return RH(t,e.c.e.a,e.c.e.b),lD(t,e.c.d)}function sMe(e){var t=uD(xw(e.c.d),e.d.d);return RH(t,e.d.e.a,e.d.e.b),lD(t,e.d.d)}function cMe(e){var t=/function(?:\s+([\w$]+))?\s*\(/.exec(e);return t&&t[1]||qat}function lMe(e,t){if(e){t.n=e;var n=Ixe(t);if(!n){oQ[e]=[t];return}n.Pm=t}}function uMe(e,t,n){var i,a=e.length;return i=r.Math.min(n,a),HQe(e,0,t,0,i,!0),t}function dMe(e,t,n){if(sz(e,n),!e.il()&&n!=null&&!e.dk(n))throw k(new rg);return n}function JI(e,t){var n;return Rj(t),n=e[`:`+t],hO(!!n,`Enum constant undefined: `+t),n}function fMe(e,t){var n=e.c,r=t.e[e.p];return r>0?F(ck(n.a,r-1),9):null}function YI(e){if(!(e>=0))throw k(new u_(`tolerance (`+e+`) must be >= 0`));return e}function XI(){return AIt||(AIt=new d6e,dz(AIt,G(j(c$,1),bK,148,0,[new cf]))),AIt}function ZI(){ZI=E,tAt=new kx(`NO`,0),$kt=new kx(hct,1),eAt=new kx(`LOOK_BACK`,2)}function QI(){QI=E,WSt=new ox(`ARD`,0),I1=new ox(`MSD`,1),GSt=new ox(`MANUAL`,2)}function $I(){$I=E,R4=new Ex(Yq,0),I4=new Ex(`INPUT`,1),L4=new Ex(`OUTPUT`,2)}function eL(e,t){var n=e.gc();if(t<0||t>n)throw k(new hD(t,n));return new Wfe(e,t)}function tL(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],lP(e,n,e.c.b,e.c)}function pMe(e,t){var n;return N(t,45)?e.c.Kc(t):(n=sV(e,t),kV(e,t),n)}function nL(e,t,n){return Nz(e,t),kL(e,n),VI(e,0),HI(e,1),nB(e,!0),tB(e,!0),e}function rL(e,t,n,r,i){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1,i||(this.o=-2-r-1)}function mMe(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=null,this.c=new Ofe(this,t,n,r)}function hMe(){Yw.call(this),this.n=-1,this.g=null,this.i=null,this.j=null,this.Bb|=fZ}function gMe(e){$T(e.c>=0),WBe(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function iL(e,t){e.b=r.Math.max(e.b,t.d),e.e+=t.r+(e.a.c.length==0?0:e.c),Rw(e.a,t)}function _Me(e,t){t.Tg(`Hierarchical port constraint processing`,1),tHe(e),Git(e),t.Ug()}function aL(e){var t,n;for(n=e.c.Bc().Jc();n.Ob();)t=F(n.Pb(),18),t.$b();e.c.$b(),e.d=0}function vMe(e,t){var n,r;for(n=0,r=e.gc();n<r;++n)if(Wj(t,e.Xb(n)))return n;return-1}function yMe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r<i;++r)t=n[r],tj(t,t.length,null)}function bMe(){Ny();for(var e=wgt,t=0;t<arguments.length;t++)e.push(arguments[t])}function xMe(e){var t,n;for(n=new O($Ue(e));n.a<n.c.c.length;)t=F(H(n),685),t.Zf()}function SMe(e){var t,n;if(e==0)return 32;for(n=0,t=1;(t&e)==0;t<<=1)++n;return n}function oL(e,t){if(e<0)throw k(new u_(t+` cannot be negative but was: `+e));return e}function CMe(e){koe(),this.g=new Wh,this.f=new Wh,this.b=new Wh,this.c=new PM,this.i=e}function wMe(){this.f=new mv,this.d=new Fg,this.c=new mv,this.a=new Uh,this.b=new Uh}function TMe(e){ZS.call(this,e.yd(64)?cw(0,jB(e.xd(),1)):RK,e.wd()),this.b=1,this.a=e}function EMe(e,t){var n,r,i=t.c.i;n=F(vj(e.f,i),60),r=n.d.c-n.e.c,vI(t.b,new Lm(r))}function sL(e,t){return Bae(RL(e.a,t,wk(AB(WK,Yj(wk(AB(t==null?0:DL(t),GK)),15)))))}function DMe(){return tG(),G(j(hzt,1),YK,266,0,[U5,W5,H5,G5,K5,J5,q5,mzt,V5])}function OMe(){return lW(),G(j(nCt,1),YK,267,0,[ZSt,YSt,$St,eCt,QSt,tCt,L1,XSt,JSt])}function kMe(){return xW(),G(j(lkt,1),YK,268,0,[skt,akt,okt,nkt,ikt,ckt,S4,tkt,rkt])}function AMe(){AMe=E,f_t=G(j(q9,1),cq,30,15,[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15])}function jMe(){jMe=E,mAt=$O($O($O(new Ij,(cU(),v$),(sK(),W$)),y$,t1),b$,e1)}function MMe(){MMe=E,hAt=$O($O($O(new Ij,(cU(),v$),(sK(),W$)),y$,t1),b$,e1)}function NMe(){NMe=E,gAt=$O($O($O(new Ij,(cU(),v$),(sK(),W$)),y$,t1),b$,e1)}function PMe(){PMe=E,_At=$O($O($O(new Ij,(cU(),v$),(sK(),W$)),y$,t1),b$,e1)}function FMe(){FMe=E,vAt=$O($O($O(new Ij,(cU(),v$),(sK(),W$)),y$,t1),b$,e1)}function IMe(){IMe=E,xAt=$O($O($O(new Ij,(cU(),v$),(sK(),W$)),y$,t1),b$,e1)}function LMe(){LMe=E,wAt=Lk($O($O(new Ij,(cU(),b$),(sK(),r1)),x$,Y$),S$,n1)}function RMe(e,t){return CI(),F(J(t,(pG(),O3)),15).a<e.gc()&&F(J(t,O3),15).a>=0}function zMe(e,t){e.r>0&&e.c<e.r&&(e.c+=t,e.i&&e.i.d>0&&e.g!=0&&zMe(e.i,t/e.r*e.i.d))}function BMe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,1,n,e.c))}function cL(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,4,n,e.c))}function VMe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,1,n,e.c))}function HMe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,1,n,e.d))}function lL(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,2,n,e.k))}function uL(e,t){var n=e.D;e.D=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,2,n,e.D))}function dL(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,8,n,e.f))}function fL(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,7,n,e.i))}function UMe(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,8,n,e.a))}function WMe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,0,n,e.b))}function GMe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,0,n,e.b))}function KMe(e,t,n){var r;e.b=t,e.a=n,r=(e.a&512)==512?new sie:new gd,e.c=L4e(r,e.b,e.a)}function qMe(e,t){return MW(e.e,t)?(bb(),qF(t)?new tk(t,e):new VS(t,e)):new zce(t,e)}function JMe(e){var t,n;return 0>e?new Fy:(t=e+1,n=new ZEe(t,e),new PE(null,n))}function YMe(e,t){dM();var n=new Py(1);return IS(e)?nN(n,e,t):jU(n.f,e,t),new Zp(n)}function XMe(e,t){var n=new rt;F(t.b,68),F(t.b,68),F(t.b,68),vI(t.a,new she(e,n,t))}function ZMe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,11,n,e.d))}function QMe(e,t){var n,r;for(r=t.vc().Jc();r.Ob();)n=F(r.Pb(),45),zH(e,n.jd(),n.kd())}function pL(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,13,n,e.j))}function $Me(e,t){var n;return N(t,8)?(n=F(t,8),e.a==n.a&&e.b==n.b):!1}function eNe(e){var t=J(e,(Z(),N0));return N(t,174)?Rze(F(t,174)):null}function tNe(e){var t;return e=r.Math.max(e,2),t=NFe(e),e>t?(t<<=1,t>0?t:qK):t}function nNe(e){var t;return e.b==null?(vb(),vb(),u9):(t=e.sl()?e.rl():e.ql(),t)}function mL(e){var t;return RD(e.f.g,e.d),tE(e.b),e.c=e.a,t=F(e.a.Pb(),45),e.b=XPe(e),t}function hL(e,t){var n=e.a,r=0;for(var i in n)n.hasOwnProperty(i)&&(t[r++]=i);return t}function gL(e,t){var n;return Rj(t),n=t.g,e.b[n]?!1:(_j(e.b,n,t),++e.c,!0)}function rNe(e,t){var n=t==null?-1:AF(e.b,t,0);return n<0?!1:(_L(e,n),!0)}function _L(e,t){var n=NP(e.b,e.b.c.length-1);t<e.b.c.length&&(fP(e.b,t,n),TZe(e,t))}function iNe(e,t){(gP(),VQ?null:t.c).length==0&&Rde(t,new ve),nN(e.a,VQ?null:t.c,t)}function aNe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,21,n,e.b))}function vL(e,t){var n=1-t,r=e.a[n];return e.a[n]=r.a[t],r.a[t]=e,e.b=!0,r.b=!1,r}function oNe(e,t){var n=F(J(e,(rK(),t4)),8),r=F(J(t,t4),8);return sB(n.b,r.b)}function sNe(e){Jge.call(this),this.b=A(P(J(e,(rK(),o4)))),this.a=F(J(e,T2),222)}function cNe(e,t,n){Vwe.call(this,e,t,n),this.a=new Wh,this.b=new Wh,this.d=new tne(this)}function lNe(e){this.e=e,this.d=new Lv(aR(Hk(this.e).gc())),this.c=this.e.a,this.b=this.e.c}function yL(e){this.b=e,this.a=U(q9,cq,30,e+1,15,1),this.c=U(q9,cq,30,e,15,1),this.d=0}function bL(e,t,n){var r=new Uh;return l4e(e,t,r,n,!0,!0),e.b=new yL(r.c.length),r}function uNe(e,t){var n,r=new Uh;n=t;do $h(r.c,n),n=F(vj(e.k,n),17);while(n);return r}function dNe(e,t){var n=F(vj(e.c,t),456);return n||(n=new zre,n.c=t,Uj(e.c,n.c,n)),n}function xL(e){switch($w(e.e!=3),e.e){case 2:return!1;case 0:return!0}return CDe(e)}function SL(){SL=E,h$=new jh(Nst),g$=new jh(Pst),m$=new jh(Fst),p$=new jh(Ist)}function CL(){CL=E,V$=new lse(`TO_INTERNAL_LTR`,0),sxt=new lse(`TO_INPUT_DIRECTION`,1)}function wL(){wL=E,N3=new Yse(`P1_NODE_PLACEMENT`,0),P3=new Yse(`P2_EDGE_ROUTING`,1)}function TL(){TL=E,T1=new ax(`START`,0),w1=new ax(`MIDDLE`,1),C1=new ax(`END`,2)}function EL(){EL=E,Zxt=new nD(`edgelabelcenterednessanalysis.includelabel`,(_T(),vQ))}function fNe(e,t){Ly(eM(new fk(null,new pN(new Rp(e.b),1)),new oce(e,t)),new cce(e,t))}function pNe(e,t){t.Tg(act,1),Ly(ZF(new fk(null,new pN(e.b,16)),new qt),new Jt),t.Ug()}function DL(e){return IS(e)?oz(e):FS(e)?mC(e):PS(e)?Ide(e):rA(e)?e.Hb():Ige(e)?wT(e):xbe(e)}function OL(e,t){var n;return N(t,18)?(n=F(t,18),e.Fc(n)):JF(e,F(uj(t),20).Jc())}function kL(e,t){var n=e.zb;e.zb=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,1,n,e.zb))}function AL(e,t){var n=(r=new Rg,r),r;n.n=t,iF((!e.s&&(e.s=new R(N7,e,21,17)),e.s),n)}function jL(e,t){var n,r=(n=new OE,n);r.n=t,iF((!e.s&&(e.s=new R(N7,e,21,17)),e.s),r)}function mNe(e){var t,n;for(n=new Jw(e);n.e!=n.i.gc();)t=F(KV(n),26),II(t,0),LI(t,0)}function hNe(e){var t,n;for(n=e.c.a.ec().Jc();n.Ob();)t=F(n.Pb(),218),vp(t,new __e(t.f))}function gNe(e){var t,n;for(n=e.c.a.ec().Jc();n.Ob();)t=F(n.Pb(),218),kee(t,new KJe(t.e))}function ML(e,t){var n=e.xb;e.xb=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,3,n,e.xb))}function NL(e,t){var n=e.yb;e.yb=t,e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,1,2,n,e.yb))}function PL(e,t){var n=e.Nc(),r;for(vF(n,0,n.length,t),r=0;r<n.length;r++)e.fd(r,n[r])}function _Ne(e,t,n){var r,i,a=e.a.length-1;for(i=e.b,r=0;r<n;i=i+1&a,++r)_j(t,r,e.a[i])}function FL(e,t){var n,r,i;for(Rj(t),n=!1,i=t.Jc();i.Ob();)r=i.Pb(),n|=e.Ec(r);return n}function vNe(e){var t=0,n,r;for(r=e.Jc();r.Ob();)n=r.Pb(),t+=n==null?0:DL(n),t=~~t;return t}function yNe(e){var t;return e==0?`UTC`:(e<0?(e=-e,t=`UTC+`):t=`UTC-`,t+xAe(e))}function bNe(e){return e.a<54?e.f<0?-1:+(e.f>0):(!e.c&&(e.c=uN(oR(e.f))),e.c).e}function xNe(e,t){t?e.B??(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function SNe(e,t){typeof window===pK&&typeof window.$gwt===pK&&(window.$gwt[e]=t)}function CNe(e,t,n){var r=0,i,a;for(i=0;i<n;i++)a=t[i],e[i]=a<<1|r,r=a>>>31;r!=0&&(e[n]=r)}function IL(e,t,n,r,i,a){var o;this.c=e,o=new Uh,CUe(e,o,t,e.b,n,r,i,a),this.a=new kN(o,0)}function wNe(){this.c=new $v(0),this.b=new $v(edt),this.d=new $v(Qut),this.a=new $v($ut)}function TNe(e,t){return A(P(ST(Zz(tM(new fk(null,new pN(e.c.b,16)),new Gte(e)),t))))}function ENe(e,t){return A(P(ST(Zz(tM(new fk(null,new pN(e.c.b,16)),new Hm(e)),t))))}function DNe(e,t){var n=F(X(e,(yU(),I3)),15),r=F(X(t,I3),15);return sw(n.a,r.a)}function ONe(e,t){var n;t.Tg(`General Compactor`,1),n=Aze(F(X(e,(yU(),ENt)),386)),n.Bg(e)}function kNe(e,t,n){n.Tg(`DFS Treeifying phase`,1),vBe(e,t),H2e(e,t),e.a=null,e.b=null,n.Ug()}function ANe(e,t,n){var r,i;for(i=WV(e,0);i.b!=i.d.c;)r=F(UN(i),8),r.a+=t,r.b+=n;return e}function LL(e,t,n){var r;for(r=e.b[n&e.f];r;r=r.b)if(n==r.a&&Mj(t,r.g))return r;return null}function RL(e,t,n){var r;for(r=e.c[n&e.f];r;r=r.d)if(n==r.f&&Mj(t,r.i))return r;return null}function jNe(e,t,n,r){var i=new $g;gM(i,`x`,YH(e,t,r.a)),gM(i,`y`,XH(e,t,r.b)),Cj(n,i)}function MNe(e,t,n,r){var i=new $g;gM(i,`x`,YH(e,t,r.a)),gM(i,`y`,XH(e,t,r.b)),Cj(n,i)}function zL(e,t,n,r,i,a,o,s,c,l,u,d,f){return $Xe(e,t,n,r,i,a,o,s,c,l,u,d,f),IB(e,!1),e}function BL(e,t,n,r,i,a,o){uy.call(this,e,t),this.d=n,this.e=r,this.c=i,this.b=a,this.a=kP(o)}function NNe(e,t){return ZC(),YI(Xq),r.Math.abs(0-t)<=Xq||t==0?0:e/t}function PNe(e,t){return zR(),e==w$&&t==D$||e==D$&&t==w$||e==E$&&t==T$||e==T$&&t==E$}function FNe(e,t){return zR(),e==w$&&t==T$||e==w$&&t==E$||e==D$&&t==E$||e==D$&&t==T$}function INe(){return IW(),G(j(PCt,1),YK,261,0,[K1,J1,Y1,X1,Z1,Q1,e0,G1,q1,$1])}function LNe(){return XW(),G(j(Dkt,1),YK,243,0,[N4,j4,M4,wkt,Tkt,Ckt,Ekt,P4,k4,A4])}function VL(){VL=E,l9=new tie,GBt=G(j(N7,1),SZ,179,0,[]),WBt=G(j(B7,1),mht,62,0,[])}function HL(){HL=E,txt=new It,$bt=new Ft,ext=new Lt,Qbt=new Rt,nxt=new zt,rxt=new Bt}function RNe(e,t){t.Tg(act,1),QB(Jy(new im((eb(),new aM(e,!1,!1,new Nt))))),t.Ug()}function UL(e){var t=Iwe(e);return HS(t.a,0)?(Oy(),Oy(),J_t):(Oy(),new rE(t.b))}function WL(e){var t=Iwe(e);return HS(t.a,0)?(Oy(),Oy(),J_t):(Oy(),new rE(t.c))}function zNe(e){var t=LN(e);return HS(t.a,0)?(jy(),jy(),Y_t):(jy(),new nE(t.b))}function BNe(e){return e.b.c.i.k==(cW(),P$)?F(J(e.b.c.i,(Z(),N0)),12):e.b.c}function VNe(e){return e.b.d.i.k==(cW(),P$)?F(J(e.b.d.i,(Z(),N0)),12):e.b.d}function HNe(e){switch(e.g){case 2:return YG(),N5;case 4:return YG(),p5;default:return e}}function UNe(e){switch(e.g){case 1:return YG(),j5;case 3:return YG(),m5;default:return e}}function WNe(e,t){var n=tJe(e);return fQe(new SS(n.c,n.d),new SS(n.b,n.a),e.Kf(),t,e.$f())}function GL(e,t){var n,r;for(Rj(t),r=t.vc().Jc();r.Ob();)n=F(r.Pb(),45),e.yc(n.jd(),n.kd())}function GNe(e,t,n){var r;for(r=n.Jc();r.Ob();)if(!ZN(e,t,r.Pb()))return!1;return!0}function KNe(e,t){var n;for(uj(t);e.Ob();)if(n=e.Pb(),!IPe(F(n,9)))return!1;return!0}function qNe(e,t,n,r,i){var a;return n&&(a=rV(t.Ah(),e.c),i=n.Oh(t,-1-(a==-1?r:a),null,i)),i}function JNe(e,t,n,r,i){var a;return n&&(a=rV(t.Ah(),e.c),i=n.Qh(t,-1-(a==-1?r:a),null,i)),i}function YNe(e){var t;if(e.b==-2){if(e.e==0)t=-1;else for(t=0;e.a[t]==0;t++);e.b=t}return e.b}function XNe(e){if(Rj(e),e.length==0)throw k(new V_(`Zero length BigInteger`));m8e(this,e)}function ZNe(e){this.i=e.gc(),this.i>0&&(this.g=this.$i(this.i+(this.i/8|0)+1),e.Oc(this.g))}function QNe(e,t,n){this.g=e,this.d=t,this.e=n,this.a=new Uh,MZe(this),dM(),rw(this.a,null)}function $Ne(e,t){t.q=e,e.d=r.Math.max(e.d,t.r),e.b+=t.d+(e.a.c.length==0?0:e.c),Rw(e.a,t)}function ePe(e,t){return t<e.b.gc()?F(e.b.Xb(t),9):t==e.b.gc()?e.a:F(ck(e.e,t-e.b.gc()-1),9)}function KL(e,t){return _T(),IS(e)?NDe(e,EE(t)):FS(e)?Qk(e,P(t)):PS(e)?a_e(e,TE(t)):e.Dd(t)}function tPe(e){var t,n,r;return e.j==(YG(),m5)&&(t=g$e(e),n=DT(t,p5),r=DT(t,N5),r||r&&n)}function nPe(e){var t,n,r=0;for(n=new O(e.b);n.a<n.c.c.length;)t=F(H(n),25),t.p=r,++r}function qL(e,t){var n,r;for(r=WV(e,0);r.b!=r.d.c;)n=F(UN(r),8),n.a+=t.a,n.b+=t.b;return e}function JL(e,t){var n,r,i=e.c,a;return n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.a<n&&t.b>a&&t.b<r}function YL(e,t){var n;N(t,92)?(F(e.c,78).Ek(),n=F(t,92),QMe(e,n)):F(e.c,78).Wb(t)}function XL(e,t){var n,r;for(Rj(t),r=e.vc().Jc();r.Ob();)n=F(r.Pb(),45),t.Wd(n.jd(),n.kd())}function ZL(e,t){EO.call(this,YBt,e,t),this.b=this,this.a=kW(e.Ah(),cI(this.e.Ah(),this.c))}function QL(e){this.f=e,this.e=new _Ee(this.f.i),this.a=this.e,this.b=XPe(this),this.d=this.f.g}function $L(e,t,n,r){var i=e.a.length;n>i?n=i:hN(t,n+1),e.a=EM(e.a,0,t)+(``+r)+Q_e(e.a,n)}function rPe(e,t,n,r){N(e.Cb,184)&&(F(e.Cb,184).tb=null),kL(e,n),t&&_Qe(e,t),r&&e.el(!0)}function iPe(){iPe=E,FIt=kz((CU(),G(j(PIt,1),YK,285,0,[NIt,_6,x6,C6,v6,y6,b6,S6])))}function aPe(){aPe=E,oBt=kz((QU(),G(j(S7,1),YK,244,0,[aBt,b7,x7,y7,iBt,v7,_7,rBt])))}function oPe(){oPe=E,Xbt=kz((cW(),G(j(Ybt,1),YK,249,0,[R$,I$,P$,z$,F$,N$,B$,L$])))}function sPe(){sPe=E,PSt=kz((VW(),G(j(NSt,1),YK,275,0,[ESt,kSt,TSt,MSt,OSt,DSt,jSt,ASt])))}function cPe(){return ZW(),G(j(Ajt,1),YK,264,0,[kjt,Sjt,Ejt,Djt,Tjt,xjt,Ojt,yjt,wjt,Cjt,bjt])}function lPe(){lPe=E,TAt=AV(nle($O($O(new Ij,(cU(),b$),(sK(),r1)),x$,Y$),S$),n1)}function uPe(){uPe=E,kAt=AV(nle($O($O(new Ij,(cU(),b$),(sK(),r1)),x$,Y$),S$),n1)}function dPe(){var e;return lvt||(lvt=new Dre,e=new hP(``),YC(e,(My(),cvt)),iNe(lvt,e)),lvt}function fPe(e){return GE(),e.A.Gc((yV(),I5))&&!e.B.Gc((tG(),W5))?tBe(e):null}function pPe(e,t){var n=O6e(XI(),e);return n?($V(t,(oK(),c8),n),!0):!1}function eR(e,t){var n;for(n=0;n<t.j.c.length;n++)F(MF(e,n),22).Fc(F(MF(t,n),18));return e}function mPe(e,t){var n,r;for(r=new O(t.b);r.a<r.c.c.length;)n=F(H(r),25),e.a[n.p]=WJe(n)}function tR(e,t){var n=e.qh(),r,i;if(n!=null&&e.th())for(r=0,i=n.length;r<i;++r)n[r].bj(t)}function hPe(e,t,n){return e==(Rz(),K4)?new Ma:dW(t,1)==0?new Oae(n.length):new hv(n.length)}function gPe(e,t,n){return sB(Iw(VV(e),new SS(t.e.a,t.e.b)),Iw(VV(e),new SS(n.e.a,n.e.b)))}function nR(e,t,n){var r,i=F(kD(e.d,t),15);return r=F(kD(e.b,n),15),!i||!r?null:GP(e,i.a,r.a)}function rR(e){var t=e.h;return t==0?e.l+e.m*pq:t==dq?e.l+e.m*pq-mq:e}function _Pe(e){var t;if(e.a==e.b.a)throw k(new dg);return t=e.a,e.c=t,e.a=F(Oj(e.a.e),227),t}function vPe(e){var t;e.d==null?(++e.e,e.f=0,OLe(null)):(++e.e,t=e.d,e.d=null,e.f=0,OLe(t))}function yPe(e,t){var n,r;for(r=new O(t);r.a<r.c.c.length;)n=F(H(r),70),Rw(e.d,n),GJe(e,n)}function iR(e,t){for(var n=e,r=Lj(n).e;r;){if(n=r,n==t)return!0;r=Lj(n).e}return!1}function bPe(e,t,n){var r=e.a.f[t.p],i=e.a.f[n.p];return r<i?-1:r==i?0:1}function aR(e){return e<3?(oL(e,Vat),e+1):e<qK?zM(r.Math.ceil(e/.75)):hK}function oR(e){return gq<e&&e<mq?e<0?r.Math.ceil(e):r.Math.floor(e):rR(h2e(e))}function xPe(e,t){e.a=kB(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d=kB(e.d,t)}function SPe(e,t){var n;t.Tg(`Edge and layer constraint edge reversal`,1),n=Z3e(e),znt(n),t.Ug()}function CPe(e,t){var n,r;for(r=new Jw(e);r.e!=r.i.gc();)n=F(KV(r),26),PC(n,n.i+t.b,n.j+t.d)}function wPe(e,t){e.c&&(U6e(e,t,!0),Ly(new fk(null,new pN(t,16)),new Wm(e))),U6e(e,t,!1)}function sR(e,t){var n=(r=new pf,r),r;return n.G=t,!e.rb&&(e.rb=new hA(e,F7,e)),iF(e.rb,n),n}function cR(e,t){var n=(r=new fg,r),r;return n.G=t,!e.rb&&(e.rb=new hA(e,F7,e)),iF(e.rb,n),n}function lR(e,t){var n;return(e.Db&t)==0?null:(n=zUe(e,t),n==-1?e.Eb:OI(e.Eb)[n])}function uR(e){var t;if(e.g>1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw k(new dg)}function TPe(e){Ple();var t;return Joe(qAt,e)||(t=new Ya,t.a=e,nfe(qAt,e,t)),F(Gj(qAt,e),636)}function EPe(e){switch(e.a.g){case 1:return new wce;case 3:return new rWe;default:return new Qd}}function DPe(e,t){switch(t){case 1:return!!e.n&&e.n.i!=0;case 2:return e.k!=null}return GCe(e,t)}function dR(e){var t;return e<128?(oge(),t=u_t[e],!t&&(t=u_t[e]=new Qee(e)),t):new Qee(e)}function OPe(e){var t=1,n,r;for(r=e.Jc();r.Ob();)n=r.Pb(),t=31*t+(n==null?0:DL(n)),t=~~t;return t}function fR(e){var t,n,r=0;for(n=new Ey(e.a);n.a<n.c.a.length;)t=tP(n),e.b.Gc(t)&&++r;return r}function pR(e){var t,n,r,i=e;return r=0,i<0&&(i+=mq,r=dq),n=zM(i/pq),t=zM(i-n*pq),lw(t,n,r)}function kPe(e,t){var n=e.a.get(t);return n===void 0?++e.d:(afe(e.a,t),--e.c,++e.b.g),n}function mR(e,t){var n;return t?(n=t.lf(),n.dc()||(e.q?GL(e.q,n):e.q=new Uce(n)),e):e}function APe(e,t){var n=t.p-e.p,r,i;return n==0?(r=e.f.a*e.f.b,i=t.f.a*t.f.b,sB(r,i)):n}function jPe(e,t){var n;try{t.be()}catch(t){if(t=NR(t),N(t,80))n=t,$h(e.c,n);else throw k(t)}}function MPe(e){return e.b.c.length!=0&&F(ck(e.b,0),70).a?F(ck(e.b,0),70).a:kye(e)}function NPe(){this.a=F(GV((cG(),u$)),15).a,this.c=A(P(GV(f$))),this.b=A(P(GV(Vyt)))}function hR(e,t){this.b=e,this.e=t,this.d=t.j,this.f=(bb(),F(e,69).vk()),this.k=kW(t.e.Ah(),e)}function gR(e,t,n){this.b=(Rj(e),e),this.d=(Rj(t),t),this.e=(Rj(n),n),this.c=this.d+(``+this.e)}function PPe(e,t,n,r,i){iIe.call(this,e,n,r,i),this.f=U(M$,KJ,9,t.a.c.length,0,1),RV(t.a,this.f)}function _R(e,t,n,r,i){_j(e.c[t.g],n.g,r),_j(e.c[n.g],t.g,r),_j(e.b[t.g],n.g,i),_j(e.b[n.g],t.g,i)}function FPe(e,t){var n=e.j,r=t.j;return n==r?e.p==t.p?0:n==(YG(),m5)?e.p-t.p:t.p-e.p:n.g-r.g}function IPe(e){var t=F(J(e,(Z(),v0)),64);return e.k==(cW(),P$)&&(t==(YG(),N5)||t==p5)}function LPe(){LPe=E,XRt=kz((eW(),G(j(Y8,1),YK,96,0,[V8,B8,U8,J8,q8,K8,W8,G8,H8])))}function RPe(){RPe=E,gzt=kz((tG(),G(j(hzt,1),YK,266,0,[U5,W5,H5,G5,K5,J5,q5,mzt,V5])))}function zPe(){zPe=E,rCt=kz((lW(),G(j(nCt,1),YK,267,0,[ZSt,YSt,$St,eCt,QSt,tCt,L1,XSt,JSt])))}function BPe(){BPe=E,ukt=kz((xW(),G(j(lkt,1),YK,268,0,[skt,akt,okt,nkt,ikt,ckt,S4,tkt,rkt])))}function vR(){vR=E,Bkt=new wx(`EQUALLY`,0),Vkt=new wx(`NORTH`,1),Hkt=new wx(`NORTH_SOUTH`,2)}function yR(){yR=E,ICt=new mx(`ONE_SIDED`,0),LCt=new mx(`TWO_SIDED`,1),t0=new mx(`OFF`,2)}function bR(){bR=E,JNt=new Gx(BJ,0),YNt=new Gx(`POLAR_COORDINATE`,1),qNt=new Gx(`ID`,2)}function xR(){xR=E,h1=new tx(Gq,0),g1=new tx(Kq,1),_1=new tx(qq,2),mSt=new tx(`TOP`,3)}function SR(){SR=E,a$=new Ub(`UP`,0),i$=new Ub(vst,1),syt=new Ub(Kq,2),cyt=new Ub(qq,3)}function CR(){CR=E,s$=new nD(`debugSVG`,(_T(),!1)),pyt=new nD(`overlapsExisted`,!0)}function wR(){wR=E,iAt=new Ax(`OFF`,0),H4=new Ax(`SINGLE_EDGE`,1),V4=new Ax(`MULTI_EDGE`,2)}function TR(){TR=E,u6=new $se(`MINIMUM_SPANNING_TREE`,0),vIt=new $se(`MAXIMUM_SPANNING_TREE`,1)}function VPe(e){e.r=new yg,e.w=new yg,e.t=new Uh,e.i=new Uh,e.d=new yg,e.a=new wC,e.c=new Wh}function ER(e){this.n=new Uh,this.e=new Dy,this.j=new Dy,this.k=new Uh,this.f=new Uh,this.p=e}function HPe(e){switch(e.g){case 0:return new Rs;case 1:return new zs;default:return null}}function UPe(){return gP(),VQ?new hP(null):c$e(dPe(),`com.google.common.base.Strings`)}function WPe(e){var t;if(e){if(t=e,t.dc())throw k(new dg);return t.Xb(t.gc()-1)}return DSe(e.Jc())}function DR(e){var t;return(!e.a||!(e.Bb&1)&&e.a.Sh())&&(t=FH(e),N(t,159)&&(e.a=F(t,159))),e.a}function GPe(e,t,n){var r,i,a=null;return i=RN(t,Vpt),r=new ES(e,n),a=(YGe(r.a,r.b,i),i),a}function OR(e,t){var n,r=(n=new Dl,n);return kL(r,t),iF((!e.A&&(e.A=new Uw(W7,e,7)),e.A),r),r}function kR(e,t,n,r){return n==1?(!e.n&&(e.n=new R(f7,e,1,7)),tH(e.n,t,r)):rYe(e,t,n,r)}function KPe(e,t,n,r){F(n.b,68),F(n.b,68),F(r.b,68),F(r.b,68),F(r.b,68),vI(r.a,new iO(e,t,r))}function qPe(e,t){e.d==(cB(),y8)||e.d==S8?F(t.a,60).c.Ec(F(t.b,60)):F(t.b,60).c.Ec(F(t.a,60))}function AR(e,t,n){var r,i,a,o=Lj(e);r=o.d,i=o.c,a=e.n,t&&(a.a=a.a-r.b-i.a),n&&(a.b=a.b-r.d-i.b)}function JPe(e,t,n){var r,i=F(J(e,(rK(),j2)),79);i&&(r=new Lg,wz(r,0,i),qL(r,n),FL(t,r))}function jR(e,t){var n=t.Nc();return n.length==0?!1:(Ohe(e.c,e.c.length,n),!0)}function MR(e,t){var n,r;for(Rj(t),r=t.Jc();r.Ob();)if(n=r.Pb(),!e.Gc(n))return!1;return!0}function YPe(e,t){if(t==null)return!1;for(;e.a!=e.b;)if(Qz(t,Hz(e)))return!0;return!1}function XPe(e){return e.a.Ob()?!0:e.a==e.e?(e.a=new KOe(e.f.f),e.a.Ob()):!1}function NR(e){var t;return N(e,80)?e:(t=e&&e.__java$exception,t||(t=new UIe(e),_re(t)),t)}function PR(e){if(N(e,193))return F(e,125);if(e)return null;throw k(new p_(imt))}function ZPe(e){switch(F(J(e,(rK(),M2)),165).g){case 2:case 4:return!0;default:return!1}}function QPe(e,t){var n=e.c,r=t.e[e.p];return r<n.a.c.length-1?F(ck(n.a,r+1),9):null}function $Pe(e){var t,n;for(t9e(e),n=new O(e.d);n.a<n.c.c.length;)t=F(H(n),107),t.i&&UYe(t)}function eFe(e,t){var n,r;for(r=new O(e.b);r.a<r.c.c.length;)n=F(H(r),70),K(n,(Z(),T0),t)}function tFe(e,t,n){var r,i;for(i=new O(e.b);i.a<i.c.c.length;)r=F(H(i),26),PC(r,r.i+t,r.j+n)}function FR(e){var t=new Dy,n,r;for(r=WV(e.d,0);r.b!=r.d.c;)n=F(UN(r),65),MO(t,n.c);return t}function nFe(e){var t=1,n,r,i;for(n=0,i=e.gc();n<i;++n)r=e.Ti(n),t=31*t+(r==null?0:DL(r));return t}function rFe(e){var t,n=(t=new Dl,t);return kL(n,`T`),iF((!e.d&&(e.d=new Uw(W7,e,11)),e.d),n),n}function iFe(e,t){var n=HT(t.a.gc());return Ly(dI(new fk(null,new pN(t,1)),e.i),new nce(e,n)),n}function aFe(e,t,n,r){var i;return FN(t,e.e.Pd().gc()),FN(n,e.c.Pd().gc()),i=e.a[t][n],_j(e.a[t],n,r),i}function G(e,t,n,r,i){return i.Pm=e,i.Qm=t,i.Rm=T,i.__elementTypeId$=n,i.__elementTypeCategory$=r,i}function oFe(e,t){var n=e.l+t.l,r=e.m+t.m+(n>>22),i=e.h+t.h+(r>>22);return lw(n&uq,r&uq,i&dq)}function sFe(e,t){var n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22);return lw(n&uq,r&uq,i&dq)}function cFe(e){var t;gG(e,!0),t=iq,uE(e,(rK(),n4))&&(t+=F(J(e,n4),15).a),K(e,n4,q(t))}function IR(e){var t,n,r,i=new Uh;for(r=e.Jc();r.Ob();)n=F(r.Pb(),26),t=PW(n),jR(i,t);return i}function lFe(e,t,n){var r;FA(e.a),vI(n.i,new mh(e)),r=new uw(F(vj(e.a,t.b),68)),eVe(e,r,t),n.f=r}function uFe(e,t){return!e||!t||e==t?!1:NBe(e.d.c,t.d.c+t.d.b)&&NBe(t.d.c,e.d.c+e.d.b)}function dFe(e,t,n,i,a){return LW(),r.Math.min(Ztt(e,t,n,i,a),Ztt(n,i,e,t,fE(new SS(a.a,a.b))))}function fFe(e,t){if(!e)throw k(new u_(WW(`value already present: %s`,G(j(sQ,1),bK,1,5,[t]))))}function pFe(e){var t,n=(bv(),t=new Kc,t);return e&&iF((!e.a&&(e.a=new R(a7,e,6,6)),e.a),n),n}function LR(e,t){var n,r=0;if(e<64&&e<=t)for(t=t<64?t:63,n=e;n<=t;n++)r=xN(r,Yk(1,n));return r}function mFe(e,t){var n,r;for(yM(t,`predicate`),r=0;e.Ob();r++)if(n=e.Pb(),t.Lb(n))return r;return-1}function hFe(e,t){switch(t){case 0:!e.o&&(e.o=new cF((eK(),d7),g7,e,0)),e.o.c.$b();return}pXe(e,t)}function gFe(e){switch(e.g){case 1:return L8;case 2:return I8;case 3:return R8;default:return z8}}function _Fe(e){dM();var t,n,r=0;for(n=e.Jc();n.Ob();)t=n.Pb(),r+=t==null?0:DL(t),r|=0;return r}function vFe(e){var t=new S;return t.a=e,t.b=PFe(e),t.c=U(OQ,NK,2,2,6,1),t.c[0]=yNe(e),t.c[1]=yNe(e),t}function RR(){RR=E,$xt=new $b(BJ,0),p1=new $b(dct,1),m1=new $b(fct,2),f1=new $b(`BOTH`,3)}function zR(){zR=E,w$=new Yb(`Q1`,0),D$=new Yb(`Q4`,1),T$=new Yb(`Q2`,2),E$=new Yb(`Q3`,3)}function BR(){BR=E,r0=new hx(`ONLY_WITHIN_GROUP`,0),BCt=new hx(Wst,1),n0=new hx(`ENFORCED`,2)}function VR(){VR=E,sCt=new lx(BJ,0),z1=new lx(`INCOMING_ONLY`,1),B1=new lx(`OUTGOING_ONLY`,2)}function HR(){HR=E,new jh(`org.eclipse.elk.addLayoutConfig`),CIt=new qs,SIt=new Js,wIt=new Ks}function UR(){UR=E,n_t={boolean:Soe,number:Rie,string:zie,object:dZe,function:dZe,undefined:lre}}function yFe(){yFe=E,Okt=kz((XW(),G(j(Dkt,1),YK,243,0,[N4,j4,M4,wkt,Tkt,Ckt,Ekt,P4,k4,A4])))}function bFe(){bFe=E,FCt=kz((IW(),G(j(PCt,1),YK,261,0,[K1,J1,Y1,X1,Z1,Q1,e0,G1,q1,$1])))}function xFe(e,t,n,r){return new Yoe(G(j(dQ,1),VK,45,0,[(eUe(e,t),new oy(e,t)),(eUe(n,r),new oy(n,r))]))}function SFe(e,t){return U5e(F(F(vj(e.g,t.a),49).a,68),F(F(vj(e.g,t.b),49).a,68))}function CFe(e,t,n){var r=e.gc();if(t>r)throw k(new hD(t,r));return e.Qi()&&(n=Yxe(e,n)),e.Ci(t,n)}function wFe(e){var t,n=e.n,r=e.o;return t=e.d,new oM(n.a-t.b,n.b-t.d,r.a+(t.b+t.c),r.b+(t.d+t.a))}function TFe(e,t){return!e||!t||e==t?!1:WB(e.b.c,t.b.c+t.b.b)<0&&WB(t.b.c,e.b.c+e.b.b)<0}function WR(e,t,n){return e>=128?!1:WS(e<64?bN(Yk(1,e),n):bN(Yk(1,e-64),t),0)}function GR(e,t,n){switch(n.g){case 2:e.b=t;break;case 1:e.c=t;break;case 4:e.d=t;break;case 3:e.a=t}}function EFe(e,t){for(;e.g==null&&!e.c?Jxe(e):e.g==null||e.i!=0&&F(e.g[e.i-1],50).Ob();)t.Bi(sW(e))}function KR(e,t,n){return n==null?(!e.q&&(e.q=new Wh),MP(e.q,t)):(!e.q&&(e.q=new Wh),Uj(e.q,t,n)),e}function K(e,t,n){return n==null?(!e.q&&(e.q=new Wh),MP(e.q,t)):(!e.q&&(e.q=new Wh),Uj(e.q,t,n)),e}function DFe(e){var t,n=new LP;return mR(n,e),K(n,(SL(),h$),e),t=new Wh,A7e(e,n,t),knt(e,n,t),n}function OFe(e){LW();var t,n=U(T6,NK,8,2,0,1),r=0;for(t=0;t<2;t++)r+=.5,n[t]=_Ue(r,e);return n}function kFe(e,t){var n=!1,r=e.a[t].length,i,a;for(a=0;a<r-1;a++)i=a+1,n|=CBe(e,t,a,i);return n}function AFe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r<i;++r)t=n[r],UFe(e,t,(YG(),j5)),UFe(e,t,m5)}function qR(e){var t=~e.l+1&uq,n=~e.m+ +(t==0)&uq;return lw(t,n,~e.h+ +(t==0&&n==0)&dq)}function jFe(e){var t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d;return t||n}function MFe(e){var t;return(!e.c||!(e.Bb&1)&&e.c.Db&64)&&(t=FH(e),N(t,88)&&(e.c=F(t,29))),e.c}function NFe(e){var t;if(e<0)return eq;if(e==0)return 0;for(t=qK;(t&e)==0;t>>=1);return t}function PFe(e){var t;return e==0?`Etc/GMT`:(e<0?(e=-e,t=`Etc/GMT-`):t=`Etc/GMT+`,t+xAe(e))}function FFe(e){var t,n=WU(e.h);return n==32?(t=WU(e.m),t==32?WU(e.l)+32:t+20-10):n-12}function JR(e){var t=e.a[e.b];return t==null?null:(_j(e.a,e.b,null),e.b=e.b+1&e.a.length-1,t)}function IFe(){++kgt,this.o=null,this.k=null,this.j=null,this.d=null,this.b=null,this.n=null,this.a=null}function LFe(e,t){this.c=e,this.d=t,this.b=this.d/this.c.c.Pd().gc()|0,this.a=this.d%this.c.c.Pd().gc()}function RFe(e,t){this.b=e,iC.call(this,(F(W(V((aj(),K7).o),10),19),t.i),t.g),this.a=(VL(),GBt)}function zFe(e,t,n){this.q=new r.Date,this.q.setFullYear(e+sq,t,n),this.q.setHours(0,0,0,0),vG(this,0)}function BFe(e,t,n){var r=new tF(t,n),i=new he;return e.b=j4e(e,e.b,r,i),i.b||++e.c,e.b.b=!1,i.d}function VFe(e,t){dM();var n,r,i,a,o=!1;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],o|=e.Ec(n);return o}function HFe(e,t,n,r,i){var a,o=e.length;if(a=n.length,t<0||r<0||i<0||t+i>o||r+i>a)throw k(new ng)}function UFe(e,t,n){var r,i,a,o=$z(t,n);for(a=0,i=o.Jc();i.Ob();)r=F(i.Pb(),12),Uj(e.c,r,q(a++))}function YR(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)t=F(H(n),82),t.g.c=-t.g.c-t.g.b;bW(e)}function XR(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)t=F(H(n),60),t.d.c=-t.d.c-t.d.b;v2e(e)}function WFe(e){var t=F(e.e&&e.e(),10),n;return new FD(t,(n=t.slice(),F(yF(n,t),10)),t.length)}function ZR(e){var t=~e.l+1&uq,n=~e.m+ +(t==0)&uq,r=~e.h+ +(t==0&&n==0)&dq;e.l=t,e.m=n,e.h=r}function QR(e){var t=new mv,n,r,i,a;for(r=e,i=0,a=r.length;i<a;++i)n=r[i],t.a+=n.a,t.b+=n.b;return t}function $R(e,t,n){var r,i,a=null;return i=RN(t,`labels`),r=new bce(e,n),a=(s1e(r.a,r.b,i),i),a}function GFe(e,t,n){var r=new Uh;return l4e(e,t,r,(YG(),p5),!0,!1),l4e(e,n,r,N5,!1,!1),r}function KFe(e,t,n,r){var i=A1e(e,t,n,r);return!i&&(i=_Re(e,n,r),i&&!zG(e,t,i))?null:i}function qFe(e,t,n,r){var i=j1e(e,t,n,r);return!i&&(i=oB(e,n,r),i&&!zG(e,t,i))?null:i}function JFe(e,t){var n;for(n=0;n<e.a.a.length;n++)if(!F(pge(e.a,n),178).Lb(t))return!1;return!0}function YFe(e,t,n){if(uj(t),n.Ob())for(Bce(t,bve(n.Pb()));n.Ob();)Bce(t,e.a),Bce(t,bve(n.Pb()));return t}function XFe(e){dM();var t,n,r=1;for(n=e.Jc();n.Ob();)t=n.Pb(),r=31*r+(t==null?0:DL(t)),r|=0;return r}function ZFe(e,t,n,r,i){var a=H$e(e,t);return n&&ZR(a),i&&(e=EUe(e,t),_Q=r?qR(e):lw(e.l,e.m,e.h)),a}function ez(e){var t;return Nj(e),t=new Ee,e.a.zd(t)?(nT(),new e_(Rj(t.a))):(nT(),nT(),q_t)}function tz(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)t=F(H(n),82),t.f.$b();jie(e.b,e),A2e(e)}function QFe(e,t){switch(t.g){case 0:N(e.b,632)||(e.b=new NPe);break;case 1:N(e.b,633)||(e.b=new zhe)}}function $Fe(e,t){switch(t){case 7:return!!e.e&&e.e.i!=0;case 8:return!!e.d&&e.d.i!=0}return kze(e,t)}function eIe(e,t,n){e.g=CXe(e,t,(YG(),p5),e.b),e.d=CXe(e,n,p5,e.b),!(e.g.c==0||e.d.c==0)&&YJe(e)}function tIe(e,t,n){e.g=CXe(e,t,(YG(),N5),e.j),e.d=CXe(e,n,N5,e.j),!(e.g.c==0||e.d.c==0)&&YJe(e)}function nIe(e,t){return Iw(VV(F(J(t,(pG(),D3)),86)),new SS(e.c.e.a-e.b.e.a,e.c.e.b-e.b.e.b))<=0}function rIe(e,t,n){return!qv(eM(new fk(null,new pN(e.c,16)),new $p(new sce(t,n)))).zd((Iy(),WQ))}function nz(e,t,n){this.g=e,this.e=new mv,this.f=new mv,this.d=new Dy,this.b=new Dy,this.a=t,this.c=n}function rz(e,t,n,r){this.b=new Uh,this.n=new Uh,this.i=r,this.j=n,this.s=e,this.t=t,this.r=0,this.d=0}function iIe(e,t,n,r){this.b=new Wh,this.g=new Wh,this.d=(zz(),C4),this.c=e,this.e=t,this.d=n,this.a=r}function aIe(e,t,n){switch(t){case 0:!e.o&&(e.o=new cF((eK(),d7),g7,e,0)),YL(e.o,n);return}oZe(e,t,n)}function oIe(e){switch(e.g){case 0:return new Gs;default:throw k(new u_(pX+(e.f==null?``+e.g:e.f)))}}function sIe(e){switch(e.g){case 0:return new Us;default:throw k(new u_(pX+(e.f==null?``+e.g:e.f)))}}function iz(){iz=E,cSt=new pr,lSt=new mr,sSt=new dr,oSt=new hr,aSt=new fr,iSt=(Rj(aSt),new oe)}function az(){az=E,Njt=new Bx(BJ,0),Mjt=new Bx(`MIDDLE_TO_MIDDLE`,1),f3=new Bx(`AVOID_OVERLAP`,2)}function cIe(e){var t=new Lg,n,r;for(r=WV(e,0);r.b!=r.d.c;)n=F(UN(r),8),WT(t,0,new SC(n));return t}function oz(e){var t=0,n;for(n=0;n<e.length;n++)t=(t<<5)-t+(hN(n,e.length),e.charCodeAt(n))|0;return t}function lIe(e){var t=F(J(e,(Z(),F0)),9),n;t&&(n=t.c,kF(n.a,t),n.a.c.length==0&&kF(Lj(t).b,n))}function uIe(e){return VQ?U(svt,Vot,567,0,0,1):F(RV(e.a,U(svt,Vot,567,e.a.c.length,0,1)),841)}function dIe(e){var t;return e.b<=0?!1:(t=fC(`MLydhHmsSDkK`,iU(Hj(e.c,0))),t>1||t>=0&&e.b<3)}function fIe(){cK();var e;return WVt||(e=VT(QG(`M`,!0)),e=_k(QG(`M`,!1),e),WVt=e,WVt)}function pIe(e){switch(e.g){case 1:return Qut;default:case 2:return 0;case 3:return $ut;case 4:return edt}}function sz(e,t){if(!e.Ji()&&t==null)throw k(new u_(`The 'no null' constraint is violated`));return t}function mIe(e,t){hO(e>=0,`Negative initial capacity`),hO(t>=0,`Non-positive load factor`),FA(this)}function hIe(e,t){for(var n,r,i=e.b;i;){if(n=e.a.Le(t,i.d),n==0)return i;r=n<0?0:1,i=i.a[r]}return null}function cz(e,t){var n;return t===e?!0:N(t,229)?(n=F(t,229),Qz(e.Zb(),n.Zb())):!1}function gIe(e,t){return d2e(e,t)?(UU(e.b,F(J(t,(Z(),g0)),22),t),MO(e.a,t),!0):!1}function _Ie(e,t){return uE(e,(Z(),M0))&&uE(t,M0)?F(J(t,M0),15).a-F(J(e,M0),15).a:0}function vIe(e,t){return uE(e,(Z(),M0))&&uE(t,M0)?F(J(e,M0),15).a-F(J(t,M0),15).a:0}function yIe(e,t){var n=F(X(e,(BW(),Y3)),15).a,r=F(X(t,Y3),15).a;return n==r||n<r?-1:+(n>r)}function bIe(e){return Rw(e.c,(HR(),CIt)),Lje(e.a,A(P(GV((pV(),x4)))))?new Bc:new wne(e)}function xIe(e){for(;!e.d||!e.d.Ob();)if(e.b&&!__(e.b))e.d=F(WA(e.b),50);else return null;return e.d}function SIe(e,t,n){return e.d[t.p][n.p]||(SHe(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function lz(e,t,n){var r,i=(r=new zg,r);return nL(i,t,n),iF((!e.q&&(e.q=new R(B7,e,11,10)),e.q),i),i}function uz(e){var t,n,r,i=qoe($zt,e);for(n=i.length,r=U(OQ,NK,2,n,6,1),t=0;t<n;++t)r[t]=i[t];return r}function dz(e,t){var n,r,i,a,o;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],o=new hve(e),n.tf(o),Z7e(o);FA(e.f)}function CIe(e,t){var n;t*2+1>=e.b.c.length||(CIe(e,2*t+1),n=2*t+2,n<e.b.c.length&&CIe(e,n),TZe(e,t))}function wIe(e,t){var n,r;for(r=WV(e,0);r.b!=r.d.c;)n=F(UN(r),218),n.e.length>0&&(t.Ad(n),n.i&&BVe(n))}function TIe(e,t,n){var r;for(r=n-1;r>=0&&e[r]===t[r];r--);return r<0?0:Tb(bN(e[r],Eq),bN(t[r],Eq))?-1:1}function EIe(e,t){var n;return!e||e==t||!uE(t,(Z(),C0))?!1:(n=F(J(t,(Z(),C0)),9),n!=e)}function fz(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.Yl()}}function DIe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e.Zl()}}function OIe(e,t){var n,r;for(r=e.Zb().Bc().Jc();r.Ob();)if(n=F(r.Pb(),18),n.Gc(t))return!0;return!1}function kIe(e,t,n){var r,i,a,o;for(Rj(n),o=!1,a=e.dd(t),i=n.Jc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function AIe(e,t,n){var r,i;this.g=e,this.c=t,this.a=this,this.d=this,i=tNe(n),r=U(Vgt,KK,227,i,0,1),this.b=r}function pz(e,t){var n,r=F(lR(e.a,4),129);return n=U(dBt,qmt,415,t,0,1),r!=null&&dG(r,0,n,0,r.length),n}function jIe(e,t){var n=new F3e((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,t);return e.e??(n.c=e),n}function MIe(e,t){var n;return e===t?!0:N(t,92)?(n=F(t,92),BYe(Wk(e),n.vc())):!1}function NIe(e,t,n){var r,i;for(i=n.Jc();i.Ob();)if(r=F(i.Pb(),45),e.ze(t,r.kd()))return!0;return!1}function mz(e){return IS(e)?OQ:FS(e)?CQ:PS(e)?bQ:rA(e)||Ige(e)?e.Pm:e.Pm||Array.isArray(e)&&j(qgt,1)||qgt}function hz(){hz=E,Dbt=Nxe(G(j(C8,1),YK,86,0,[(cB(),y8),b8])),Obt=Nxe(G(j(C8,1),YK,86,0,[S8,v8]))}function gz(){gz=E,WRt=new UC(15),URt=new qC((oK(),t8),WRt),M8=o8,zRt=aLt,BRt=Y6,HRt=Z6,VRt=X6}function _z(){_z=E,P8=new lS(dpt,0),N8=new lS(`INCLUDE_CHILDREN`,1),F8=new lS(`SEPARATE_CHILDREN`,2)}function vz(){vz=E,F3=new Ux(BJ,0),iNt=new Ux(`RADIAL_COMPACTION`,1),aNt=new Ux(`WEDGE_COMPACTION`,2)}function yz(){yz=E,Kkt=new Dx(`STACKED`,0),Gkt=new Dx(`REVERSE_STACKED`,1),z4=new Dx(`SEQUENCED`,2)}function bz(){bz=E,mvt=new zb(`CONCURRENT`,0),HQ=new zb(`IDENTITY_FINISH`,1),hvt=new zb(`UNORDERED`,2)}function xz(){xz=E,Nzt=new TS(`ELK`,0),Pzt=new TS(`JSON`,1),Mzt=new TS(`DOT`,2),Fzt=new TS(`SVG`,3)}function Sz(){Sz=E,PMt=new Vx(Wst,0),j3=new Vx(adt,1),NMt=new Vx(`FAN`,2),MMt=new Vx(`CONSTRAINT`,3)}function Cz(){Cz=E,Ykt=new Ox(`CONSERVATIVE`,0),Xkt=new Ox(`CONSERVATIVE_SOFT`,1),B4=new Ox(`SLOPPY`,2)}function wz(e,t,n){var r=new Dy,i,a;for(a=WV(n,0);a.b!=a.d.c;)i=F(UN(a),8),MO(r,new SC(i));kIe(e,t,r)}function PIe(e){var t=0,n,r=U(T6,NK,8,e.b,0,1);for(n=WV(e,0);n.b!=n.d.c;)r[t++]=F(UN(n),8);return r}function FIe(e,t){var n=F(e.d.Ac(t),18),r;return n?(r=e.e.hc(),r.Fc(n),e.e.d-=n.gc(),n.$b(),r):null}function IIe(e,t){var n,r=e.c[t];if(r!=0)for(e.c[t]=0,e.d-=r,n=t+1;n<e.a.length;)e.a[n]-=r,n+=n&-n}function LIe(e){var t=e.a.c.length;if(t>0)return sA(t-1,e.a.c.length),NP(e.a,t-1);throw k(new og)}function RIe(e,t,n){if(t<0)throw k(new r_(Tft+t));t<e.j.c.length?fP(e.j,t,n):(yTe(e,t),Rw(e.j,n))}function zIe(e,t,n){if(e>t)throw k(new u_(Lq+e+Wot+t));if(e<0||t>n)throw k(new B_(Lq+e+Got+t+Fot+n))}function BIe(e){if(!e.a||!(e.a.i&8))throw k(new d_(`Enumeration class expected for layout option `+e.f))}function VIe(e){jxe.call(this,`The given string does not match the expected format for individual spacings.`,e)}function HIe(){Sie.call(this,new GOe(aR(16))),oL(2,Pat),this.b=2,this.a=new Lve(null,null,0,null),tg(this.a,this.a)}function UIe(e){Xie(),fw(this),hM(this),this.e=e,h4e(this,e),this.g=e==null?xK:UB(e),this.a=``,this.b=e,this.a=``}function Tz(e,t){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),uL(e,t==null?null:(Rj(t),t)),e.C&&e.fl(null)}function WIe(e,t){var n=e.a.length-1,r;for(e.c=e.c-1&n;t!=e.c;)r=t+1&n,_j(e.a,t,e.a[r]),t=r;_j(e.a,e.c,null)}function GIe(e,t){for(var n=e.a.length-1,r;t!=e.b;)r=t-1&n,_j(e.a,t,e.a[r]),t=r;_j(e.a,e.b,null),e.b=e.b+1&n}function KIe(e,t,n){var r,i;return iN(t,e.c.length),r=n.Nc(),i=r.length,i==0?!1:(Ohe(e.c,t,r),!0)}function qIe(e){var t=(!e.a&&(e.a=new R(R7,e,9,5)),e.a);return t.i==0?null:Woe(F(W(t,0),684))}function JIe(e,t){var n=kB(e,t);return Tb(SCe(e,t),0)|US(SCe(e,n),0)?n:kB(RK,SCe(Zk(n,63),1))}function YIe(e,t){var n=GV((pV(),x4))!=null&&t.Rg()!=null?A(P(t.Rg()))/A(P(GV(x4))):1;Uj(e.b,t,n)}function Ez(e){var t;++e.j,e.i==0?e.g=null:e.i<e.g.length&&(t=e.g,e.g=e.$i(e.i),dG(t,0,e.g,0,e.i))}function Dz(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(mg(e.a.c,0),jR(e.a,e.b),jR(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function XIe(e){var t,n;if(e==null)return null;for(t=0,n=e.length;t<n;t++)if(!L(e[t]))return e[t];return null}function ZIe(e,t,n){var r,i,a,o;for(i=n,a=0,o=i.length;a<o;++a)if(r=i[a],e.b.ze(t,r.jd()))return r;return null}function Oz(e){var t,n,r,i,a=1;for(n=e,r=0,i=n.length;r<i;++r)t=n[r],a=31*a+(t==null?0:DL(t)),a|=0;return a}function kz(e){var t={},n,r,i,a;for(r=e,i=0,a=r.length;i<a;++i)n=r[i],t[`:`+(n.f==null?``+n.g:n.f)]=n;return t}function QIe(e){var t;for(uj(e),npe(!0,`numberToAdvance must be nonnegative`),t=0;t<0&&$U(e);t++)wP(e);return t}function $Ie(e){var t,n,r=0;for(n=new Jk(aT(e.a.Jc(),new f));$U(n);)t=F(wP(n),17),t.c.i==t.d.i||++r;return r}function eLe(e,t){var n=e,r,i=0;do{if(n==t)return i;if(r=n.e,!r)throw k(new sg);n=Lj(r),++i}while(!0)}function tLe(e,t){var n,r,i=t-e.f;for(r=new O(e.d);r.a<r.c.c.length;)n=F(H(r),320),yBe(n,n.e,n.f+i);e.f=t}function Az(e,t){return!e||t&&!e.j||N(e,127)&&F(e,127).a.b==0?0:e.ff()}function jz(e,t){return!e||t&&!e.k||N(e,127)&&F(e,127).a.a==0?0:e.gf()}function Mz(e){switch(e.c){case 0:return ok(),Wgt;case 1:return new Yh(LZe(new Ey(e)));default:return new Tie(e)}}function nLe(e){switch(e.gc()){case 0:return ok(),Wgt;case 1:return new Yh(e.Jc().Pb());default:return new kb(e)}}function rLe(e,t){var n;for(n=0;n<t.length;n++)if(e==(hN(n,t.length),t.charCodeAt(n)))return!0;return!1}function iLe(e,t){return t<e.length&&(hN(t,e.length),e.charCodeAt(t)!=63)&&(hN(t,e.length),e.charCodeAt(t)!=35)}function aLe(e,t,n,r){var i,a;e.a=t,a=+!r,e.f=(i=new XYe(e.c,e.a,n,a),new R3e(n,e.a,i,e.e,e.b,e.c==(Rz(),G4)))}function Nz(e,t){var n,r=e.Wk(t,null),i=null;t&&(i=(Sv(),n=new Kh,n),TI(i,e.r)),r=rU(e,i,r),r&&r.mj()}function oLe(e,t){var n,r=dW(e.d,1)!=0;for(n=!0;n;)n=!1,n=t.c.kg(t.e,r),n|=CW(e,t,r,!1),r=!r;gNe(e)}function sLe(e,t){var n,i,a,o,s,c,l=t.i,u=t.j;return i=e.f,a=i.i,o=i.j,s=l-a,c=u-o,n=r.Math.sqrt(s*s+c*c),n}function cLe(e,t){var n,r=!1,i;return n=t.q.d,t.d<e.b&&(i=p2e(t.q,e.b),t.q.d>i&&(LKe(t.q,i),r=n!=t.q.d)),r}function lLe(e,t){var n;for(n=0;n<t.length;n++)if(e==(hN(n,t.length),t.charCodeAt(n)))return!0;return!1}function uLe(e){var t,n;for(n=new O(e.r);n.a<n.c.c.length;)if(t=F(H(n),9),e.n[t.p]<=0)return t;return null}function dLe(e){var t=new ZAe(e);return DN(e.a,Rbt,new y_(G(j(C$,1),bK,377,0,[t]))),t.d&&Rw(t.f,t.d),t.f}function fLe(e,t){var n,r=IV(e);return r||(!eBt&&(eBt=new hl),n=(G9e(),k1e(t)),r=new Lh(n),iF(r.Cl(),e)),r}function pLe(e){var t,n;if(e==null)return!1;for(t=0,n=e.length;t<n;t++)if(!L(e[t]))return!1;return!0}function mLe(e){var t;if(!(e.c.c<0?e.a>=e.c.b:e.a<=e.c.b))throw k(new dg);return t=e.a,e.a+=e.c.c,++e.b,q(t)}function Pz(e,t){var n=F(e.c.Ac(t),18),r;return n?(r=e.hc(),r.Fc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function hLe(e,t){uj(e);try{return e.Ac(t)}catch(e){if(e=NR(e),N(e,211)||N(e,172))return null;throw k(e)}}function Fz(e,t){uj(e);try{return e.xc(t)}catch(e){if(e=NR(e),N(e,211)||N(e,172))return null;throw k(e)}}function Iz(e,t){var n;return hC(e)&&hC(t)&&(n=e-t,!isNaN(n))?n:bGe(hC(e)?pR(e):e,hC(t)?pR(t):t)}function Lz(e,t,n){return r.Math.abs(t-e)<qY||r.Math.abs(n-e)<qY?!0:t-e>qY?e-n>qY:n-e>qY}function gLe(e){throw UR(),k(new Oie(`Unexpected typeof result '`+e+`'; please report this bug to the GWT team`))}function _Le(){this.a=new Bs,this.f=new uh(this),this.b=new vne(this),this.i=new dh(this),this.e=new yne(this)}function Rz(){Rz=E,U4=new jx(`BARYCENTER`,0),G4=new jx(oct,1),K4=new jx(sct,2),W4=new jx(`MEDIAN`,3)}function zz(){zz=E,dkt=new xx(`DUMMY_NODE_OVER`,0),fkt=new xx(`DUMMY_NODE_UNDER`,1),C4=new xx(`EQUAL`,2)}function Bz(){Bz=E,T8=new aS(dpt,0),w8=new aS(`CONTAINER`,1),SRt=new aS(`PARENT`,2),CRt=new aS(`ROOT`,3)}function vLe(e,t,n){var r=new KQe(e,t);UU(e.r,t.$f(),r),n&&!RA(e.u)&&(r.c=new kxe(e.d),vI(t.Pf(),new am(r)))}function Vz(e){var t=new dw(e.a);return mR(t,e),K(t,(Z(),N0),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function Hz(e){var t;return tE(e.a!=e.b),t=e.d.a[e.a],rde(e.b==e.d.c&&t!=null),e.c=e.a,e.a=e.a+1&e.d.a.length-1,t}function yLe(e){var t;if(e.c!=0)return e.c;for(t=0;t<e.a.length;t++)e.c=e.c*33+(e.a[t]&-1);return e.c*=e.e,e.c}function bLe(e){var t,n,r,i=new yg;for(r=new O(e);r.a<r.c.c.length;)n=F(H(r),26),t=Q4e(n),FL(i,t);return i}function xLe(e,t,n){var r,i;for(i=t.a.a.ec().Jc();i.Ob();)if(r=F(i.Pb(),60),wbe(e,r,n))return!0;return!1}function SLe(e,t,n,r){var i,a;for(a=e.Jc();a.Ob();)i=F(a.Pb(),70),i.n.a=t.a+(r.a-i.o.a)/2,i.n.b=t.b,t.b+=i.o.b+n}function CLe(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new gA(e,1,1,i,t),n?n.lj(r):n=r),n}function Uz(e,t){var n,r,i,a=(i=e?IV(e):null,cZe((r=t,i&&i.El(),r)));return a==t&&(n=IV(e),n&&n.El()),a}function wLe(e,t,n){var r,i=e.b;return e.b=t,e.Db&4&&!(e.Db&1)&&(r=new gA(e,1,3,i,t),n?n.lj(r):n=r),n}function TLe(e,t,n){var r,i=e.f;return e.f=t,e.Db&4&&!(e.Db&1)&&(r=new gA(e,1,0,i,t),n?n.lj(r):n=r),n}function ELe(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function DLe(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function OLe(e){var t,n,r,i;if(e!=null){for(n=0;n<e.length;++n)if(t=e[n],t)for(F(t.g,374),i=t.i,r=0;r<i;++r);}}function kLe(e){var t=TC(wAt);return F(J(e,(Z(),b0)),22).Gc((IW(),Z1))&&$O(t,(cU(),b$),(sK(),o1)),t}function Wz(e){return(YG(),T5).Gc(e.j)?A(P(J(e,(Z(),W0)))):QR(G(j(T6,1),NK,8,0,[e.i.n,e.n,e.a])).b}function ALe(e,t){var n=new mH(e);return pp(n,(cW(),I$)),K(n,(Z(),N0),t),K(n,(rK(),Z2),(QH(),t5)),n}function jLe(e,t,n){var r,i;for(i=e.Jc();i.Ob();){if(r=F(i.Pb(),9),r==t)return-1;if(r==n)return 1}return 0}function MLe(e,t,n){var r=n/e.gc(),i=0,a,o;for(o=e.Jc();o.Ob();)a=F(o.Pb(),186),tLe(a,a.f+r*i),VGe(a,t,r),++i}function NLe(e){var t,n,r;for(r=new O(e.b);r.a<r.c.c.length;)n=F(H(r),218),t=n.c.ig()?n.f:n.a,t&&net(t,n.j)}function PLe(e){var t,n,i=0;for(n=new O(e.a);n.a<n.c.c.length;)t=F(H(n),173),i=r.Math.max(i,t.g);return i}function FLe(e){switch(e.g){case 0:return new Fs;case 1:return new Ls;case 2:return new Is;default:return null}}function ILe(e,t){switch(t){case 1:!e.n&&(e.n=new R(f7,e,1,7)),IG(e.n);return;case 2:lL(e,null);return}hFe(e,t)}function LLe(e,t){uj(e);try{return e._b(t)}catch(e){if(e=NR(e),N(e,211)||N(e,172))return!1;throw k(e)}}function RLe(e,t){uj(e);try{return e.Gc(t)}catch(e){if(e=NR(e),N(e,211)||N(e,172))return!1;throw k(e)}}function zLe(e,t){uj(e);try{return e.Kc(t)}catch(e){if(e=NR(e),N(e,211)||N(e,172))return!1;throw k(e)}}function BLe(e,t){var n;e.a.c.length>0&&(n=F(ck(e.a,e.a.c.length-1),565),gIe(n,t))||Rw(e.a,new QEe(t))}function VLe(e,t){var n;e.c.length!=0&&(n=F(RV(e,U(M$,KJ,9,e.c.length,0,1)),199),vC(n,new Tn),EQe(n,t))}function HLe(e,t){var n;e.c.length!=0&&(n=F(RV(e,U(M$,KJ,9,e.c.length,0,1)),199),vC(n,new En),EQe(n,t))}function ULe(e,t,n,r,i){t==0||r==0||(t==1?i[r]=AHe(i,n,r,e[0]):r==1?i[t]=AHe(i,e,t,n[0]):h$e(e,n,i,t,r))}function q(e){var t,n;return e>-129&&e<128?(nge(),t=e+128,n=d_t[t],!n&&(n=d_t[t]=new Xee(e)),n):new Xee(e)}function Gz(e){var t,n;return e>-129&&e<128?(cge(),t=e+128,n=v_t[t],!n&&(n=v_t[t]=new zp(e)),n):new zp(e)}function WLe(e){var t=new L_;return t.a+=`VerticalSegment `,JS(t,e.e),t.a+=` `,YS(t,Zw(new k_,new O(e.k))),t.a}function GLe(e){QD();var t=e.d.c-e.e.c,n=F(e.g,156);vI(n.b,new Bte(t)),vI(n.c,new Nm(t)),pP(n.i,new Vte(t))}function KLe(e,t){var n;e.c=t,e.a=Ize(t),e.a<54&&(e.f=(n=t.d>1?gwe(t.a[0],t.a[1]):gwe(t.a[0],0),PN(t.e>0?n:DF(n))))}function Kz(e,t){var n=0,r,i;for(i=TB(e,t).Jc();i.Ob();)r=F(i.Pb(),12),n+=J(r,(Z(),F0))==null?0:1;return n}function qz(e,t,n){var r=0,i,a;for(a=WV(e,0);a.b!=a.d.c&&(i=A(P(UN(a))),!(i>n));)i>=t&&++r;return r}function qLe(e,t,n){var r,i=e.sb;return e.sb=t,e.Db&4&&!(e.Db&1)&&(r=new gA(e,1,4,i,t),n?n.lj(r):n=r),n}function JLe(e){var t=F(YF(e.c.c,``),233);return t||(t=new cN(av(iv(new rc,``),`Other`)),BV(e.c.c,``,t)),t}function Jz(e){var t;return e.Db&64?rW(e):(t=new uT(rW(e)),t.a+=` (name: `,KS(t,e.zb),t.a+=`)`,t.a)}function YLe(e,t,n){var r,i=e.r;return e.r=t,e.Db&4&&!(e.Db&1)&&(r=new gA(e,1,8,i,e.r),n?n.lj(r):n=r),n}function XLe(e,t,n){var r=new BF(e.e,4,13,(i=t.c,i||(uK(),e9)),null,sH(e,t),!1),i;return n?n.lj(r):n=r,n}function ZLe(e,t,n){var r=new BF(e.e,3,13,null,(i=t.c,i||(uK(),e9)),sH(e,t),!1),i;return n?n.lj(r):n=r,n}function Yz(e,t){var n=F(t,681),r=n.cl();return!r&&n.dl(r=N(t,88)?new kce(e,F(t,29)):new owe(e,F(t,159))),r}function Xz(e,t,n){var r;e.Zi(e.i+1),r=e.Xi(t,n),t!=e.i&&dG(e.g,t,e.g,t+1,e.i-t),_j(e.g,t,r),++e.i,e.Ki(t,n),e.Li()}function QLe(e,t,n,r,i,a,o,s){for(var c=n;a<o;)c>=r||t<n&&s.Le(e[t],e[c])<=0?_j(i,a++,e[t++]):_j(i,a++,e[c++])}function $Le(e,t){var n,r,i,a;if(t.cj(e.a),a=F(lR(e.a,8),2e3),a!=null)for(n=a,r=0,i=n.length;r<i;++r)null.Sm()}function eRe(e,t){var n;return t.a&&(n=t.a.a.length,e.a?YS(e.a,e.b):e.a=new dT(e.d),xwe(e.a,t.a,t.d.length,n)),e}function Zz(e,t){var n=new Ee;return e.a.zd(n)?(nT(),new e_(Rj(eAe(e,n.a,t)))):(Nj(e),nT(),nT(),q_t)}function tRe(e){var t;return Iz(e,0)<0&&(e=rR(S_e(hC(e)?pR(e):e))),t=wk(Zk(e,32)),64-(t==0?WU(wk(e))+32:WU(t))}function Qz(e,t){return IS(e)?vD(e,t):FS(e)?yD(e,t):PS(e)?(Rj(e),M(e)===M(t)):rA(e)?e.Fb(t):Ige(e)?ile(e,t):MCe(e,t)}function nRe(e){return e?e.i&1?e==J9?bQ:e==q9?TQ:e==Q9?wQ:e==Z9?CQ:e==Y9?EQ:e==$9?DQ:e==X9?xQ:SQ:e:null}function $z(e,t){switch(t.g){case 2:case 1:return TB(e,t);case 3:case 4:return tV(TB(e,t))}return dM(),dM(),IQ}function rRe(e,t,n,r){switch(t){case 1:return!e.n&&(e.n=new R(f7,e,1,7)),e.n;case 2:return e.k}return pWe(e,t,n,r)}function eB(e,t,n){if(t<0)BZe(e,n);else{if(!n.pk())throw k(new u_(PX+n.ve()+FX));F(n,69).uk().Ck(e,e.ei(),t)}}function iRe(e,t,n){if(e<0||t>n)throw k(new r_(Lq+e+Got+t+`, size: `+n));if(e>t)throw k(new u_(Lq+e+Wot+t))}function tB(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,2,n,t))}function nB(e,t){var n=(e.Bb&512)!=0;t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,3,n,t))}function aRe(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,8,n,t))}function oRe(e,t){var n=(e.Bb&512)!=0;t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,9,n,t))}function sRe(e){var t;return e.Db&64?rW(e):(t=new uT(rW(e)),t.a+=` (source: `,KS(t,e.d),t.a+=`)`,t.a)}function rB(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,8,n,t))}function cRe(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new gA(e,1,5,i,e.a),n?rqe(n,r):n=r),n}function iB(e,t){var n;return e.b==-1&&e.a&&(n=e.a.nk(),e.b=n?e.c.Eh(e.a.Jj(),n):rV(e.c.Ah(),e.a)),e.c.vh(e.b,t)}function lRe(e,t){var n,r;for(r=new Jw(e);r.e!=r.i.gc();)if(n=F(KV(r),29),M(t)===M(n))return!0;return!1}function uRe(e){lK();var t,n,r,i;for(n=FVe(),r=0,i=n.length;r<i;++r)if(t=n[r],AF(t.a,e,0)!=-1)return t;return ryt}function dRe(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function fRe(e){return e-=e>>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function pRe(e){var t=e.k,n;return t==(cW(),P$)?(n=F(J(e,(Z(),v0)),64),n==(YG(),m5)||n==j5):!1}function mRe(e){var t=Iwe(e);return HS(t.a,0)?(Oy(),Oy(),J_t):(Oy(),new rE(wb(t.a,0)?MDe(t)/PN(t.a):0))}function hRe(e,t){var n=SW(e,t);if(N(n,335))return F(n,38);throw k(new u_(PX+t+`' is not a valid attribute`))}function aB(e,t,n){var r=e.gc();if(t>r)throw k(new hD(t,r));if(e.Qi()&&e.Gc(n))throw k(new u_(tZ));e.Ei(t,n)}function gRe(e,t){var n,r;for(r=new Jw(e);r.e!=r.i.gc();)if(n=F(KV(r),143),M(t)===M(n))return!0;return!1}function _Re(e,t,n){var r,i,a=(i=aW(e.b,t),i);return a&&(r=F(MG(NF(e,a),``),29),r)?A1e(e,r,t,n):null}function oB(e,t,n){var r,i,a=(i=aW(e.b,t),i);return a&&(r=F(MG(NF(e,a),``),29),r)?j1e(e,r,t,n):null}function vRe(e){var t,n,r=0;for(n=e.length,t=0;t<n;t++)e[t]==32||e[t]==13||e[t]==10||e[t]==9||(e[r++]=e[t]);return r}function yRe(e){var t=e.a[e.c-1&e.a.length-1];return t==null?null:(e.c=e.c-1&e.a.length-1,_j(e.a,e.c,null),t)}function bRe(e){var t,n;for(n=e.p.a.ec().Jc();n.Ob();)if(t=F(n.Pb(),217),t.f&&e.b[t.c]<-1e-10)return t;return null}function xRe(e,t){switch(e.b.g){case 0:case 1:return t;case 2:case 3:return new oM(t.d,0,t.a,t.b);default:return null}}function sB(e,t){return e<t?-1:e>t?1:e==t?e==0?sB(1/e,1/t):0:isNaN(e)?+!isNaN(t):-1}function SRe(e,t){t.Tg(`Sort end labels`,1),Ly(eM(ZF(new fk(null,new pN(e.b,16)),new ln),new un),new dn),t.Ug()}function cB(){cB=E,x8=new iS(Yq,0),b8=new iS(qq,1),y8=new iS(Kq,2),v8=new iS(vst,3),S8=new iS(`UP`,4)}function lB(){lB=E,_zt=new yS(`PARALLEL_NODE`,0),Y5=new yS(`HIERARCHICAL_NODE`,1),X5=new yS(`ROOT_NODE`,2)}function uB(){uB=E,i6=new Qx(`P1_STRUCTURE`,0),a6=new Qx(`P2_PROCESSING_ORDER`,1),o6=new Qx(`P3_EXECUTION`,2)}function dB(){dB=E,dFt=new Xx(`EQUAL_BETWEEN_STRUCTURES`,0),pFt=new Xx(`TO_ASPECT_RATIO`,1),fFt=new Xx(BJ,2)}function fB(){fB=E,ORt=new sS(Yq,0),A8=new sS(`POLYLINE`,1),k8=new sS(`ORTHOGONAL`,2),j8=new sS(`SPLINES`,3)}function CRe(){CRe=E,UMt=AV(AV(fb(AV(AV(fb($O(new Ij,(OH(),c3),(ZW(),kjt)),l3),Tjt),Djt),u3),xjt),Ojt)}function wRe(e){switch(F(J(e,(Z(),S0)),316).g){case 1:K(e,S0,($F(),i0));break;case 2:K(e,S0,($F(),o0))}}function TRe(e){switch(e){case 0:return new qre;case 1:return new Gre;case 2:return new Kre;default:throw k(new sg)}}function ERe(e){switch(e.g){case 2:return b8;case 1:return y8;case 4:return v8;case 3:return S8;default:return x8}}function DRe(e){switch(e.g){case 1:return N5;case 2:return m5;case 3:return p5;case 4:return j5;default:return M5}}function pB(e){switch(e.g){case 1:return j5;case 2:return N5;case 3:return m5;case 4:return p5;default:return M5}}function mB(e){switch(e.g){case 1:return p5;case 2:return j5;case 3:return N5;case 4:return m5;default:return M5}}function hB(e,t,n){var r,i;return e.Nj()?(i=e.Oj(),r=CQe(e,t,n),e.Hj(e.Gj(7,q(n),r,t,i)),r):CQe(e,t,n)}function gB(e,t){var n,r,i;e.d==null?(++e.e,--e.f):(i=t.jd(),n=t.yi(),r=(n&hK)%e.d.length,QDe(e,r,H1e(e,r,n,i)))}function _B(e,t){var n=(e.Bb&mZ)!=0;t?e.Bb|=mZ:e.Bb&=-8193,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,15,n,t))}function vB(e,t){var n=(e.Bb&fZ)!=0;t?e.Bb|=fZ:e.Bb&=-1025,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,10,n,t))}function yB(e,t){var n=(e.Bb&xq)!=0;t?e.Bb|=xq:e.Bb&=-4097,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,12,n,t))}function bB(e,t){var n=(e.Bb&RX)!=0;t?e.Bb|=RX:e.Bb&=-2049,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,11,n,t))}function ORe(e,t){var n=sB(e.b.c,t.b.c);return n!=0||(n=sB(e.a.a,t.a.a),n!=0)?n:sB(e.a.b,t.a.b)}function kRe(e){var t,n=Dj(new L_,91);for(t=!0;e.Ob();)t||(n.a+=yK),t=!1,JS(n,e.Pb());return(n.a+=`]`,n).a}function ARe(e){var t=new Uh,n,r;for(r=new O(e.b);r.a<r.c.c.length;)n=F(H(r),592),jR(t,F(n.Af(),18));return t}function xB(e,t){var n,r;for(r=new O(t);r.a<r.c.c.length;)n=F(H(r),49),kF(e.b.b,n.b),Cbe(F(n.a,194),F(n.b,82))}function jRe(e){var t,n;for(n=N1e(EI(e)).Jc();n.Ob();)if(t=EE(n.Pb()),oG(e,t))return lEe((Loe(),ABt),t);return null}function MRe(e,t,n){var r,i;for(i=e.a.ec().Jc();i.Ob();)if(r=F(i.Pb(),9),MR(n,F(ck(t,r.p),18)))return r;return null}function NRe(e,t,n){var r,i=N(t,103)&&(F(t,19).Bb&Cq)!=0?new aC(t,e):new hR(t,e);for(r=0;r<n;++r)rH(i);return i}function PRe(e,t){var n,r,i,a,o=kW(e.e.Ah(),t);for(a=0,n=F(e.g,122),i=0;i<e.i;++i)r=n[i],o.$l(r.Jk())&&++a;return a}function SB(e){var t,n=F(J(e,(rK(),b2)),86);return n==(cB(),x8)?(t=A(P(J(e,r2))),t>=1?b8:v8):n}function FRe(e){switch(F(J(e,(rK(),T2)),222).g){case 1:return new Gi;case 3:return new Xi;default:return new Wi}}function CB(e){if(e.c)CB(e.c);else if(e.d)throw k(new d_(`Stream already terminated, can't be modified or used`))}function IRe(e){var t;if(!e.a)throw k(new d_(`Cannot offset an unassigned cut.`));t=e.c-e.b,e.b+=t,tbe(e,t),nbe(e,t)}function LRe(e,t,n){var r,i;if(e.c)CJe(e.c,t,n);else for(i=new O(e.b);i.a<i.c.c.length;)r=F(H(i),167),LRe(r,t,n)}function RRe(e,t){var n,r,i;for(Rj(t),n=!1,r=new O(e);r.a<r.c.c.length;)i=H(r),t.Gc(i)&&(zA(r),n=!0);return n}function wB(e,t,n){var r=e.a.get(t);return e.a.set(t,n===void 0?null:n),r===void 0?(++e.c,++e.b.g):++e.d,r}function zRe(e,t,n){var r=F(t.mf(e.a),35),i=F(n.mf(e.a),35);return r!=null&&i!=null?KL(r,i):r==null?i==null?0:1:-1}function TB(e,t){var n;return e.i||zZe(e),n=F(Gj(e.g,t),49),n?new fN(e.j,F(n.a,15).a,F(n.b,15).a):(dM(),dM(),IQ)}function EB(e,t){this.e=t,this.a=tRe(e),this.a<54?this.f=PN(e):this.c=(JW(),Iz(e,0)>=0?fV(e):qA(fV(DF(e))))}function BRe(e,t,n,r,i,a){this.e=new Uh,this.f=($I(),R4),Rw(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function VRe(e,t,n,r,i){Yle(this),this.b=e,this.d=U(M$,KJ,9,t.a.c.length,0,1),this.f=n,RV(t.a,this.d),this.g=r,this.c=i}function HRe(e,t,n){var r=n;!r&&(r=kO(new Gg,0)),r.Tg(Ust,2),THe(e.b,t,r.dh(1)),Ret(e,t,r.dh(1)),Rrt(t,r.dh(1)),r.Ug()}function URe(e,t,n){var r=0;return t&&(AC(e.a)?r+=t.f.a/2:r+=t.f.b/2),n&&(AC(e.a)?r+=n.f.a/2:r+=n.f.b/2),r}function WRe(e,t,n){var r=(bv(),i=new Gc,i),i;return jI(r,t),MI(r,n),e&&iF((!e.a&&(e.a=new Vw(e7,e,5)),e.a),r),r}function DB(e){var t;return e.Db&64?rW(e):(t=new uT(rW(e)),t.a+=` (identifier: `,KS(t,e.k),t.a+=`)`,t.a)}function OB(e){var t;switch(e.gc()){case 0:return ak(),Hgt;case 1:return new qE(uj(e.Xb(0)));default:return t=e,new xCe(t)}}function kB(e,t){var n;return hC(e)&&hC(t)&&(n=e+t,gq<n&&n<mq)?n:rR(oFe(hC(e)?pR(e):e,hC(t)?pR(t):t))}function AB(e,t){var n;return hC(e)&&hC(t)&&(n=e*t,gq<n&&n<mq)?n:rR(bet(hC(e)?pR(e):e,hC(t)?pR(t):t))}function jB(e,t){var n;return hC(e)&&hC(t)&&(n=e-t,gq<n&&n<mq)?n:rR(sFe(hC(e)?pR(e):e,hC(t)?pR(t):t))}function GRe(e,t,n){var r;try{YFe(e,t,n)}catch(e){throw e=NR(e),N(e,596)?(r=e,k(new _De(r))):k(e)}return t}function KRe(e){var t=U(K9,rq,30,2,15,1);return e-=Cq,t[0]=(e>>10)+wq&aq,t[1]=(e&1023)+56320&aq,TV(t,0,t.length)}function MB(e){var t=new Uh,n,r;for(r=new O(e.j);r.a<r.c.c.length;)n=F(H(r),12),Rw(t,n.e);return uj(t),new oC(t)}function NB(e){var t=new Uh,n,r;for(r=new O(e.j);r.a<r.c.c.length;)n=F(H(r),12),Rw(t,n.b);return uj(t),new oC(t)}function PB(e){var t=new Uh,n,r;for(r=new O(e.j);r.a<r.c.c.length;)n=F(H(r),12),Rw(t,n.g);return uj(t),new oC(t)}function qRe(e){var t=mU(e);return t>34028234663852886e22?yq:t<-34028234663852886e22?bq:t}function FB(e,t){var n=(e.Bb&PK)!=0;t?e.Bb|=PK:e.Bb&=-16385,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,16,n,t))}function IB(e,t){var n=(e.Bb&IX)!=0;t?e.Bb|=IX:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,18,n,t))}function JRe(e,t){var n=(e.Bb&IX)!=0;t?e.Bb|=IX:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,18,n,t))}function YRe(e,t){var n=(e.Bb&Cq)!=0;t?e.Bb|=Cq:e.Bb&=-65537,e.Db&4&&!(e.Db&1)&&tR(e,new SP(e,1,20,n,t))}function XRe(e,t){e.n.c.length==0&&Rw(e.n,new UM(e.s,e.t,e.i)),Rw(e.b,t),gUe(F(ck(e.n,e.n.c.length-1),208),t),p7e(e,t)}function ZRe(e,t,n){var r;n.Tg(`Straight Line Edge Routing`,1),n.bh(t,_dt),r=F(X(t,(WE(),M3)),26),_9e(e,r),n.bh(t,iX)}function QRe(e){var t,n;for(n=W$e(EI(ZM(e))).Jc();n.Ob();)if(t=EE(n.Pb()),oG(e,t))return uEe((Roe(),jBt),t);return null}function $Re(e){var t=new Qde(e.Pd().gc()),n,r,i=0;for(r=mF(e.Pd().Jc());r.Ob();)n=r.Pb(),Wye(t,n,q(i++));return NYe(t.a)}function LB(e){var t,n=(t=F(Tv((r=e.Pm,i=r.f,i==fQ?r:i)),10),new FD(t,F(tD(t,t.length),10),0)),r,i;return gL(n,e),n}function eze(e){var t,n,r;for(n=0,r=e.length;n<r;n++)if(e[n]==null)throw k(new p_(`at index `+n));return t=e,new y_(t)}function RB(){RB=E,fPt=new Jx(`ASPECT_RATIO_DRIVEN`,0),pPt=new Jx(`MAX_SCALE_DRIVEN`,1),dPt=new Jx(`AREA_DRIVEN`,2)}function zB(){Rqe();var e,t,n=Q_t+++Date.now();e=zM(r.Math.floor(n*Nq))&Pq,t=zM(n-e*Pot),this.a=e^1502,this.b=t^Not}function tze(e){return hz(),_T(),!!(cze(F(e.a,82).j,F(e.b,86))||F(e.a,82).d.e!=0&&cze(F(e.a,82).j,F(e.b,86)))}function BB(e,t){var n,r,i=0;for(r=F(t.Kb(e),20).Jc();r.Ob();)n=F(r.Pb(),17),m_(TE(J(n,(Z(),z0))))||++i;return i}function nze(e,t){var n,i=A(P(bV(_N(t),(rK(),o4))));n=r.Math.max(0,i/2-.5),IH(t,n,1),Rw(e,new wse(t,n))}function rze(e,t){for(var n=WV(e,0),r;n.b!=n.d.c;){if(r=h_(P(UN(n))),r==t)return;if(r>t){mwe(n);break}}XA(n,t)}function VB(e,t){var n=t.f,r,i,a,o;if(BV(e.c.d,n,t),t.g!=null)for(i=t.g,a=0,o=i.length;a<o;++a)r=i[a],BV(e.c.e,r,t)}function ize(e,t,n,r){var i,a,o;for(i=t+1;i<n;++i)for(a=i;a>t&&r.Le(e[a-1],e[a])>0;--a)o=e[a],_j(e,a,e[a-1]),_j(e,a-1,o)}function HB(e,t,n,r){if(t<0)E0e(e,n,r);else{if(!n.pk())throw k(new u_(PX+n.ve()+FX));F(n,69).uk().Ak(e,e.ei(),t,r)}}function aze(e,t){var n=SW(e.Ah(),t);if(N(n,103))return F(n,19);throw k(new u_(PX+t+`' is not a valid reference`))}function UB(e){var t;return Array.isArray(e)&&e.Rm===T?Mv(mz(e))+`@`+(t=DL(e)>>>0,t.toString(16)):e.toString()}function oze(e,t){return e.h==fq&&e.m==0&&e.l==0?(t&&(_Q=lw(0,0,0)),ale((tI(),a_t))):(t&&(_Q=lw(e.l,e.m,e.h)),lw(0,0,0))}function sze(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function cze(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function lze(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return rRe(e,t,n,r)}function uze(e,t,n){switch(t.g){case 1:e.b-=n.b/2;break;case 3:e.b+=n.b/2;break;case 4:e.a-=n.a/2;break;case 2:e.a+=n.a/2}}function dze(e,t){return vD(t.b&&t.c?TN(t.b)+`->`+TN(t.c):`e_`+DL(t),e.b&&e.c?TN(e.b)+`->`+TN(e.c):`e_`+DL(e))}function fze(e,t){return vD(t.b&&t.c?TN(t.b)+`->`+TN(t.c):`e_`+DL(t),e.b&&e.c?TN(e.b)+`->`+TN(e.c):`e_`+DL(e))}function WB(e,t){return ZC(),YI($K),r.Math.abs(e-t)<=$K||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:eD(isNaN(e),isNaN(t))}function GB(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw k(new u_(`Node `+t+` not part of edge `+e))}function pze(e){return e.e==null?e:(!e.c&&(e.c=new F3e((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,null)),e.c)}function mze(e){return e.k==(cW(),R$)&&vP(new fk(null,new dj(new Jk(aT(PB(e).a.Jc(),new f)))),new Si)}function KB(e){var t;if(e.b){if(KB(e.b),e.b.d!=e.c)throw k(new ag)}else e.d.dc()&&(t=F(e.f.c.xc(e.e),18),t&&(e.d=t))}function hze(e){GE();var t=e.o.b,n,r,i;for(r=F(F(OP(e.r,(YG(),j5)),22),83).Jc();r.Ob();)n=F(r.Pb(),115),i=n.e,i.b+=t}function gze(e,t){UE();var n,r=yke(e),i=t,a;for(vF(r,0,r.length,i),n=0;n<r.length;n++)a=tGe(e,r[n],n),n!=a&&hB(e,n,a)}function _ze(e,t){var n,r=v6e(e,t),i=r[r.length-1]/2;for(n=0;n<r.length;n++)if(r[n]>=i)return t.c+n;return t.c+t.b.gc()}function qB(e,t,n){var r,i;for(r=0,i=e.length;r<i;r++)if(WR((hN(r,e.length),e.charCodeAt(r)),t,n))return!0;return!1}function vze(e){var t;return e==null?!0:(t=e.length,t>0&&(hN(t-1,e.length),e.charCodeAt(t-1)==58)&&!qB(e,O7,k7))}function JB(e){var t;this.a=(t=F(e.e&&e.e(),10),new FD(t,F(tD(t,t.length),10),0)),this.b=U(sQ,bK,1,this.a.a.length,5,1)}function yze(e){pV(),this.c=kP(G(j(TIt,1),bK,830,0,[$Ot])),this.b=new Wh,this.a=e,Uj(this.b,x4,1),vI(ekt,new Cne(this))}function YB(){YB=E,t2=new vx(BJ,0),Z0=new vx(`FIRST`,1),Q0=new vx(dct,2),$0=new vx(`LAST`,3),e2=new vx(fct,4)}function XB(){XB=E,F1=new ix(`LAYER_SWEEP`,0),BSt=new ix(`MEDIAN_LAYER_SWEEP`,1),P1=new ix(mct,2),VSt=new ix(BJ,3)}function ZB(){ZB=E,Ozt=new xS(Vut,0),Tzt=new xS(`GROUP_DEC`,1),Dzt=new xS(`GROUP_MIXED`,2),Ezt=new xS(`GROUP_INC`,3)}function bze(e){var t,n,r,i,a=Kqe(e);return n=vy(e.c),r=!n,r&&(i=new ap,sI(a,`knownLayouters`,i),t=new Vne(i),pP(e.c,t)),a}function xze(e,t,n,r,i){for(var a,o=i,s;t.b!=t.c;)a=F(WA(t),9),s=F(TB(a,r).Xb(0),12),e.d[s.p]=o++,$h(n.c,s);return o}function Sze(e,t){var n,r=0,i,a,o,s;for(n=0,a=t,o=0,s=a.length;o<s;++o)i=a[o],i>0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function Cze(e){var t,n,r=new F_;for(r.a+=`[`,t=0,n=e.gc();t<n;)KS(r,lT(e.Ti(t))),++t<n&&(r.a+=yK);return r.a+=`]`,r.a}function QB(e){var t,n,r=A(P(e.a.mf((oK(),u8))));for(n=new O(e.a.Qf());n.a<n.c.c.length;)t=F(H(n),685),Grt(e,t,r)}function wze(e){var t,n,r,i;for(t=(e.j??=(jM(),i=Zgt.ke(e),oKe(i)),e.j),n=0,r=t.length;n<r;++n);}function $B(e,t){var n,r;for(r=new O(t);r.a<r.c.c.length;)n=F(H(r),49),Rw(e.b.b,F(n.b,82)),KCe(F(n.a,194),F(n.b,82))}function Tze(e,t,n){var r,i=e.a.b;for(r=i.c.length;r<n;r++)Ok(i,0,new bj(e.a));$M(t,F(ck(i,i.c.length-n),25)),e.b[t.p]=n}function Eze(e,t,n,r,i){oN(),DW(Gy(Wy(Uy(Ky(new Sg,0),i.d.e-e),t),i.d)),DW(Gy(Wy(Uy(Ky(new Sg,0),n-i.a.e),i.a),r))}function Dze(e,t){var n;return e.d?EA(e.b,t)?F(vj(e.b,t),43):(n=t.bg(),Uj(e.b,t,n),n):t.bg()}function Oze(e,t){var n;return M(e)===M(t)?!0:N(t,91)?(n=F(t,91),e.e==n.e&&e.d==n.d&&yEe(e,n.a)):!1}function eV(e){switch(YG(),e.g){case 4:return m5;case 1:return p5;case 3:return j5;case 2:return N5;default:return M5}}function kze(e,t){switch(t){case 3:return e.f!=0;case 4:return e.g!=0;case 5:return e.i!=0;case 6:return e.j!=0}return DPe(e,t)}function Aze(e){switch(e.g){case 1:return new gee;case 2:return new Xde;default:throw k(new u_(Cdt+(e.f==null?``+e.g:e.f)))}}function jze(e){switch(e.g){case 0:return new ys;case 1:return new bs;default:throw k(new u_(Cdt+(e.f==null?``+e.g:e.f)))}}function Mze(e){switch(e.g){case 0:return new vs;case 1:return new xs;default:throw k(new u_(cct+(e.f==null?``+e.g:e.f)))}}function Nze(e){switch(e.g){case 0:return new Wg;case 1:return new Jre;default:throw k(new u_(pX+(e.f==null?``+e.g:e.f)))}}function tV(e){var t,n;return N(e,312)?(n=ADe(F(e,312)),t=n,t):N(e,432)?F(e,432).a:N(e,59)?new Eie(e):new moe(e)}function Pze(e){var t=e.e;function n(e){return!e||e.length==0?``:` `+e.join(`
26
26
  `)}return t&&(t.stack||n(e[Jat]))}function Fze(e){var t,n;if(e.b)return e.b;for(n=VQ?null:e.d;n;){if(t=VQ?null:n.b,t)return t;n=VQ?null:n.d}return My(),cvt}function Ize(e){var t,n,r;return e.e==0?0:(t=e.d<<5,n=e.a[e.d-1],e.e<0&&(r=YNe(e),r==e.d-1&&(--n,n|=0)),t-=WU(n),t)}function Lze(e){var t,n,r;return e<jQ.length?jQ[e]:(n=e>>5,t=e&31,r=U(q9,cq,30,n+1,15,1),r[n]=1<<t,new AA(1,n+1,r))}function Rze(e){var t,n=e.ih(),r;return n?(t=e.Bh(),N(t,174)&&(r=Rze(F(t,174)),r!=null)?r+`.`+n:n):null}function nV(e,t,n){var r,i;for(i=e.Jc();i.Ob();)if(r=i.Pb(),M(t)===M(r)||t!=null&&Qz(t,r))return n&&i.Qb(),!0;return!1}function zze(e,t){var n,r,i=new nF(t.gc()),a;for(r=t.Jc();r.Ob();)n=r.Pb(),a=D8e(e,F(n,57)),a&&$h(i.c,a);return i}function Bze(e){var t=new ap,n,r,i;for(i=new Kp(e.b.Jc());i.b.Ob();)r=F(i.b.Pb(),690),n=KYe(r),j_e(t,t.a.length,n);return t.a}function Vze(e,t,n){var r,i;if(++e.j,n.dc())return!1;for(i=n.Jc();i.Ob();)r=i.Pb(),e.oj(t,e.Xi(t,r)),++t;return!0}function Hze(e,t){var n,r;if(t){for(n=0;n<e.i;++n)if(r=F(e.g[n],373),r.kj(t))return!1;return iF(e,t)}else return!1}function rV(e,t){var n=(e.i??mG(e),e.i),r=t.Jj(),i;if(r!=-1){for(i=n.length;r<i;++r)if(n[r]==t)return r}return-1}function Uze(e){var t,n=F(e.g,679),r,i,a;for(r=e.i-1;r>=0;--r)for(t=n[r],i=0;i<r;++i)if(a=n[i],R5e(e,t,a)){DH(e,r);break}}function Wze(e,t){var n,r,i,a;t&&(i=GI(t,`x`),n=new Pne(e),RI(n.a,(Rj(i),i)),a=GI(t,`y`),r=new Fne(e),zI(r.a,(Rj(a),a)))}function Gze(e,t){var n,r,i,a;t&&(i=GI(t,`x`),n=new Lne(e),NI(n.a,(Rj(i),i)),a=GI(t,`y`),r=new Oh(e),PI(r.a,(Rj(a),a)))}function Kze(e,t){var n=F(sP(e,sF(new xe,new be,new we,G(j(UQ,1),YK,130,0,[(bz(),HQ)]))),16);return n.Oc(Xhe(n.gc()))}function qze(e){var t;return!e.c&&(e.c=new Xe),rw(e.d,new Qe),r3e(e),t=K4e(e),Ly(new fk(null,new pN(e.d,16)),new xte(e)),t}function Jze(e,t){t.Tg(`End label post-processing`,1),Ly(eM(ZF(new fk(null,new pN(e.b,16)),new en),new tn),new nn),t.Ug()}function iV(e,t){switch(t.g){case 1:return lO(e.j,(HL(),$bt));case 2:return lO(e.j,(HL(),txt));default:return dM(),dM(),IQ}}function Yze(e,t){switch(t){case 3:AI(e,0);return;case 4:FI(e,0);return;case 5:II(e,0);return;case 6:LI(e,0);return}ILe(e,t)}function Xze(e,t){var n,r=new Qp(e.a.$c(t,!0));if(r.a.gc()<=1)throw k(new lg);return n=r.a.ec().Jc(),n.Pb(),F(n.Pb(),40)}function Zze(e,t,n){var r=A(e.p[t.i.p])+A(e.d[t.i.p])+t.n.b+t.a.b;return A(e.p[n.i.p])+A(e.d[n.i.p])+n.n.b+n.a.b-r}function Qze(e,t){var n;return e.i>0&&(t.length<e.i&&(n=WI(mz(t).c,e.i),t=n),dG(e.g,0,t,0,e.i)),t.length>e.i&&_j(t,e.i,null),t}function aV(e){var t;return e.Db&64?Jz(e):(t=new uT(Jz(e)),t.a+=` (instanceClassName: `,KS(t,e.D),t.a+=`)`,t.a)}function oV(e){var t,n,r,i=0;for(n=0,r=e.length;n<r;n++)t=(hN(n,e.length),e.charCodeAt(n)),t<64&&(i=xN(i,Yk(1,t)));return i}function sV(e,t){var n,r,i;return e.f>0?(e.Zj(),r=t==null?0:DL(t),i=(r&hK)%e.d.length,n=H1e(e,i,r,t),n!=-1):!1}function cV(e,t){var n,r,i,a=kW(e.e.Ah(),t);for(n=F(e.g,122),i=0;i<e.i;++i)if(r=n[i],a.$l(r.Jk()))return!1;return!0}function $ze(e,t,n,r){var i,a=n-t;if(a<3)for(;a<3;)e*=10,++a;else{for(i=1;a>3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function eBe(e,t,n){var r=bN(n,Eq),i;for(i=0;Iz(r,0)!=0&&i<t;i++)r=kB(r,bN(e[i],Eq)),e[i]=wk(r),r=Xk(r,32);return wk(r)}function lV(e,t){XC();var n=cD((M_(),M_(),hQ)),r=null;return t==n&&(r=F(RM(Qgt,e),616)),r||(r=new tve(e),t==n&&nN(Qgt,e,r)),r}function tBe(e){GE();var t=new SC(F(e.e.mf((oK(),Z6)),8));return e.B.Gc((tG(),U5))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function nBe(e){hF(),F(e.mf((oK(),Q6)),182).Gc((tG(),q5))&&(F(e.mf(i8),182).Ec((IU(),d5)),F(e.mf(Q6),182).Kc(q5))}function rBe(e){var t=e.d==(EU(),O1),n=eqe(e);t&&!n||!t&&n?K(e.a,(rK(),n2),(aH(),k6)):K(e.a,(rK(),n2),(aH(),O6))}function iBe(e){var t,n,r=JXe(e),i;for(rw(r,oxt),i=e.d,i.c.length=0,n=new O(r);n.a<n.c.c.length;)t=F(H(n),455),jR(i,t.b)}function uV(e,t,n){var r,i,a;return e.Nj()?(r=e.i,a=e.Oj(),Xz(e,r,t),i=e.Gj(3,null,t,r,a),n?n.lj(i):n=i):Xz(e,e.i,t),n}function aBe(e,t,n){var r=new BF(e.e,4,10,(i=t.c,N(i,88)?F(i,29):(uK(),t9)),null,sH(e,t),!1),i;return n?n.lj(r):n=r,n}function oBe(e,t,n){var r=new BF(e.e,3,10,null,(i=t.c,N(i,88)?F(i,29):(uK(),t9)),sH(e,t),!1),i;return n?n.lj(r):n=r,n}function dV(e,t){var n,r,i;return e.f>0&&(e.Zj(),r=t==null?0:DL(t),i=(r&hK)%e.d.length,n=kQe(e,i,r,t),n)?n.kd():null}function sBe(e,t){var n,r,i;return N(t,45)?(n=F(t,45),r=n.jd(),i=Fz(e.Pc(),r),Mj(i,n.kd())&&(i!=null||e.Pc()._b(r))):!1}function fV(e){JW();var t,n=wk(e);return t=wk(Zk(e,32)),t==0?n>10||n<0?new $N(1,n):A_t[n]:new DCe(n,t)}function cBe(e){return iH(),(e.q?e.q:(dM(),dM(),LQ))._b((rK(),V2))?F(J(e,V2),203):F(J(Lj(e),H2),203)}function pV(){pV=E,rb(),x4=(rK(),h4),ekt=kP(G(j(jIt,1),zut,147,0,[a4,o4,c4,l4,f4,FOt,p4,m4,IOt,v4,s4,u4,g4]))}function lBe(e,t,n){Aje(),Hre.call(this),this.a=mk(Ovt,[NK,fst],[593,216],0,[XQ,Avt],2),this.c=new wC,this.g=e,this.f=t,this.d=n}function uBe(e){this.e=U(q9,cq,30,e.length,15,1),this.c=U(J9,Uq,30,e.length,16,1),this.b=U(J9,Uq,30,e.length,16,1),this.f=0}function dBe(e){var t,n;for(e.j=U(Z9,Tq,30,e.p.c.length,15,1),n=new O(e.p);n.a<n.c.c.length;)t=F(H(n),9),e.j[t.p]=t.o.b/e.i}function fBe(e,t){var n,i;e.a=kB(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d+=t,n=t-e.f,i=e.e+n,e.f=i-e.e-n,e.e=i}function mV(e,t){var n,r=t.length;for(n=0;n<r;n+=2)NW(e,(hN(n,t.length),t.charCodeAt(n)),(hN(n+1,t.length),t.charCodeAt(n+1)))}function hV(e,t){var n;Int(t),n=F(J(e,(rK(),w2)),284),n&&K(e,w2,bWe(n)),GT(e.c),GT(e.f),eOe(e.d),eOe(F(J(e,R2),213))}function gV(e,t){var n;return hC(e)&&hC(t)&&(n=e%t,gq<n&&n<mq)?n:rR((Het(hC(e)?pR(e):e,hC(t)?pR(t):t,!0),_Q))}function pBe(e,t){e.Vj();try{e.d._c(e.e++,t),e.f=e.d.j,e.g=-1}catch(e){throw e=NR(e),N(e,99)?k(new ag):k(e)}}function _V(){_V=E,rVt=new _l,XBt=new vl,ZBt=new yl,QBt=new bl,$Bt=new xl,eVt=new Sl,tVt=new Cl,nVt=new wl,iVt=new Tl}function mBe(){mBe=E,ozt=new UC(15),azt=new qC((oK(),t8),ozt),czt=new qC(d8,15),szt=new qC(QLt,q(0)),izt=new qC(I6,uJ)}function vV(){vV=E,z3=new Kx(`P1_WIDTH_APPROXIMATION`,0),B3=new Kx(`P2_PACKING`,1),QNt=new Kx(`P3_WHITESPACE_ELIMINATION`,2)}function yV(){yV=E,R5=new _S(`PORTS`,0),z5=new _S(`PORT_LABELS`,1),L5=new _S(`NODE_LABELS`,2),I5=new _S(`MINIMUM_SIZE`,3)}function hBe(e,t){t.Tg(`Min Size Postprocessing`,1),$V(e,(HW(),q3),r.Math.max(A(P(X(e,q3))),A(P(X(e,G3))))),t.Ug()}function gBe(e){if(e.b==null){for(;e.a.Ob();)if(e.b=e.a.Pb(),!F(e.b,52).Gh())return!0;return e.b=null,!1}else return!0}function bV(e,t){var n,r=null;return uE(e,(rK(),d4))&&(n=F(J(e,d4),105),n.nf(t)&&(r=n.mf(t))),r??=J(Lj(e),t),r}function _Be(e,t){var n=t>>5,r,i,a;return t&=31,i=e.d+n+(t==0?0:1),r=U(q9,cq,30,i,15,1),Xqe(r,e.a,n,t),a=new AA(e.e,i,r),EN(a),a}function vBe(e,t){var n,r,i,a=t.b.b;for(e.a=new Dy,e.b=U(q9,cq,30,a,15,1),n=0,i=WV(t.b,0);i.b!=i.d.c;)r=F(UN(i),40),r.g=n++}function yBe(e,t,n){var r,i,a=t-e.e,o=n-e.f;for(i=new O(e.a);i.a<i.c.c.length;)r=F(H(i),173),lH(r,r.s+a,r.t+o);e.e=t,e.f=n}function bBe(e,t,n){var i,a,o,s=e.k,c=t.k;return i=n[s.g][c.g],a=P(bV(e,i)),o=P(bV(t,i)),r.Math.max((Rj(a),a),(Rj(o),o))}function xBe(e,t,n){var r=F(RM(L9,t),121),i=F(RM(R9,t),121);n?(nN(L9,e,r),nN(R9,e,i)):(nN(R9,e,r),nN(L9,e,i))}function xV(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Le(t,a.d),n&&r==0)return a;r>=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function SV(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Le(t,a.d),n&&r==0)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function SBe(e,t,n){var r,i=F(vj(e.b,n),171),a,o;for(r=0,o=new O(t.j);o.a<o.c.c.length;)a=F(H(o),113),i[a.d.p]&&++r;return r}function CBe(e,t,n,r){var i=!1,a,o;return ztt(e.f,n,r)&&(bVe(e.f,e.a[t][n],e.a[t][r]),a=e.a[t],o=a[r],a[r]=a[n],a[n]=o,i=!0),i}function wBe(e,t){var n,r,i;for(r=new Jk(aT(PB(e).a.Jc(),new f));$U(r);)if(n=F(wP(r),17),i=n.d.i,i.c==t)return!1;return!0}function TBe(e){var t=e.a;do t=F(wP(new Jk(aT(PB(t).a.Jc(),new f))),17).d.i,t.k==(cW(),I$)&&Rw(e.e,t);while(t.k==(cW(),I$))}function EBe(){return Error.stackTraceLimit>0?(r.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):`stack`in Error()}function CV(e){var t;e.c!=0&&(t=F(ck(e.a,e.b),295),t.b==1?(++e.b,e.b<e.a.c.length&&qee(F(ck(e.a,e.b),295))):--t.b,--e.c)}function wV(e,t){for(var n=0;!t[n]||t[n]==``;)n++;for(var r=t[n++];n<t.length;n++)!t[n]||t[n]==``||(r+=e+t[n]);return r}function DBe(e){var t=F(lR(e.a,4),129),n;return t==null?pBt:(n=U(dBt,qmt,415,t.length,0,1),dG(t,0,n,0,t.length),n)}function OBe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Uh,n=uz(e),r=0,i=n.length;r<i;++r)t=n[r],Rw(a,kG(t,!0));return a}function kBe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Uh,n=uz(e),r=0,i=n.length;r<i;++r)t=n[r],Rw(a,kG(t,!0));return a}function ABe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Uh,n=uz(e),r=0,i=n.length;r<i;++r)t=n[r],Rw(a,kG(t,!0));return a}function TV(e,t,n){var i,a,o=t+n,s;for($P(t,o,e.length),s=``,a=t;a<o;)i=r.Math.min(a+1e4,o),s+=Xve(e.slice(a,i)),a=i;return s}function jBe(e,t){return ZC(),ZC(),YI($K),(r.Math.abs(e-t)<=$K||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:eD(isNaN(e),isNaN(t)))>0}function MBe(e,t){return ZC(),ZC(),YI($K),(r.Math.abs(e-t)<=$K||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:eD(isNaN(e),isNaN(t)))<0}function NBe(e,t){return ZC(),ZC(),YI($K),(r.Math.abs(e-t)<=$K||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:eD(isNaN(e),isNaN(t)))<=0}function PBe(e){switch(e.g){case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:return!0;default:return!1}}function EV(){EV=E,F4=new Tx(BJ,0),kkt=new Tx(`NODES_AND_EDGES`,1),Akt=new Tx(`PREFER_EDGES`,2),jkt=new Tx(`PREFER_NODES`,3)}function FBe(e,t,n,r,i,a){this.a=e,this.c=t,this.b=n,this.f=r,this.d=i,this.e=a,this.c>0&&this.b>0&&(this.g=hk(this.c,this.b,this.a))}function IBe(e,t){var n=e.a,r;t=String(t),n.hasOwnProperty(t)&&(r=n[t]);var i=(UR(),n_t)[typeof r];return i?i(r):gLe(typeof r)}function DV(e){var t,n,r=null;if(t=JX in e.a,n=!t,n)throw k(new w_(`Every element must have an id.`));return r=LU(GM(e,JX)),r}function OV(e){var t,n=iXe(e);for(t=null;e.c==2;)nK(e),t||(t=(cK(),cK(),++W9,new ew(2)),FG(t,n),n=t),n.Hm(iXe(e));return n}function kV(e,t){var n,r,i;return e.Zj(),r=t==null?0:DL(t),i=(r&hK)%e.d.length,n=kQe(e,i,r,t),n?(pMe(e,n),n.kd()):null}function LBe(e,t){return e.e>t.e?1:e.e<t.e?-1:e.d>t.d?e.e:e.d<t.d?-t.e:e.e*TIe(e.a,t.a,e.d)}function RBe(e){return e>=48&&e<48+r.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function zBe(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw k(new u_(`Input edge is not connected to the input port.`))}function AV(e,t){if(e.a<0)throw k(new d_(`Did not call before(...) or after(...) before calling add(...).`));return RT(e,e.a,t),e}function BBe(e,t){var n,r,i;if(e.c)AI(e.c,t);else for(n=t-Sk(e),i=new O(e.a);i.a<i.c.c.length;)r=F(H(i),167),BBe(r,Sk(r)+n)}function VBe(e,t){var n,r,i;if(e.c)FI(e.c,t);else for(n=t-Ck(e),i=new O(e.d);i.a<i.c.c.length;)r=F(H(i),167),VBe(r,Ck(r)+n)}function HBe(e){return aN(),N(e,166)?F(vj(C7,B_t),296).Qg(e):EA(C7,mz(e))?F(vj(C7,mz(e)),296).Qg(e):null}function jV(e){var t,n;return e.Db&32||(n=(t=F(lR(e,16),29),oj(t||e.fi())-oj(e.fi())),n!=0&&MV(e,32,U(sQ,bK,1,n,5,1))),e}function MV(e,t,n){var r;(e.Db&t)==0?n!=null&&s4e(e,t,n):n==null?p$e(e,t):(r=zUe(e,t),r==-1?e.Eb=n:_j(OI(e.Eb),r,n))}function UBe(e,t,n,r){var i,a;t.c.length!=0&&(i=k0e(n,r),a=HZe(t),Ly(dI(new fk(null,new pN(a,1)),new ro),new wye(e,n,i,r)))}function WBe(e,t){var n,r=e.a.length-1,i,a;return n=t-e.b&r,a=e.c-t&r,i=e.c-e.b&r,rde(n<i),n>=a?(WIe(e,t),-1):(GIe(e,t),1)}function GBe(e,t){for(var n=(hN(t,e.length),e.charCodeAt(t)),r=t+1;r<e.length&&(hN(r,e.length),e.charCodeAt(r)==n);)++r;return r-t}function KBe(e){var t,n=e.Nc();switch(n.length){case 0:return ak(),Hgt;case 1:return t=n[0],new qE(uj(t));default:return new xCe(eze(n))}}function qBe(e){switch(typeof e){case Cat:return oz(e);case Sat:return mC(e);case mK:return Ide(e);default:return e==null?0:wT(e)}}function JBe(e){if(NV(xX,e))return _T(),yQ;if(NV(Oft,e))return _T(),vQ;throw k(new u_(`Expecting true or false`))}function YBe(e,t){return e.e<t.e?-1:e.e>t.e?1:e.f<t.f?-1:e.f>t.f?1:DL(e)-DL(t)}function XBe(e,t){var n;return M(t)===M(e)?!0:!N(t,22)||(n=F(t,22),n.gc()!=e.gc())?!1:e.Hc(n)}function NV(e,t){return Rj(e),t==null?!1:vD(e,t)?!0:e.length==t.length&&vD(e.toLowerCase(),t.toLowerCase())}function PV(e){var t,n;return Iz(e,-129)>0&&Iz(e,128)<0?(sge(),t=wk(e)+128,n=p_t[t],!n&&(n=p_t[t]=new Yee(e)),n):new Yee(e)}function ZBe(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)if(t=F(H(n),70),m_(TE(J(t,(rK(),S2)))))return!0;return!1}function QBe(e){var t;return e.b||Pae(e,(t=rpe(e.e,e.a),!t||!vD(Oft,dV((!t.b&&(t.b=new hE((uK(),o9),d9,t)),t.b),`qualified`)))),e.c}function FV(){FV=E,k$=new Xb(BJ,0),Vbt=new Xb(`INSIDE_PORT_SIDE_GROUPS`,1),Bbt=new Xb(`GROUP_MODEL_ORDER`,2),Hbt=new Xb(Wst,3)}function IV(e){var t,n,r=e.Gh();if(!r)for(t=0,n=e.Mh();n;n=n.Mh()){if(++t>wot)return n.Nh();if(r=n.Gh(),r||n==e)break}return r}function $Be(e,t,n){var r=F(W(IF(e.a),t),87),i,a=(i=r.c,i||(uK(),e9));return(a.Sh()?Uz(e.b,F(a,52)):a)==n?lG(r):TI(r,n),a}function eVe(e,t,n){var r,i,a;for(a=new O(n.a);a.a<a.c.c.length;)i=F(H(a),225),r=new uw(F(vj(e.a,i.b),68)),Rw(t.a,r),eVe(e,r,i)}function tVe(e,t,n){var r=t.c.p,i,a=t.p;e.b[r][a]=new ebe(e,t),n&&(e.a[r][a]=new Xte(t),i=F(J(t,(Z(),C0)),9),i&&UU(e.d,i,t))}function nVe(e,t){(!t&&console.groupCollapsed!=null?console.groupCollapsed:console.group==null?console.log:console.group).call(console,e)}function rVe(e,t,n,r){F(n.b,68),F(n.b,68),F(r.b,68),F(r.b,68).c.b,HOe(r,t,e)}function iVe(e,t,n){t.b=r.Math.max(t.b,-n.a),t.c=r.Math.max(t.c,n.a-e.a),t.d=r.Math.max(t.d,-n.b),t.a=r.Math.max(t.a,n.b-e.b)}function aVe(e,t,n){this.c=e,this.f=new Uh,this.e=new mv,this.j=new tge,this.n=new tge,this.b=t,this.g=new oM(t.c,t.d,t.b,t.a),this.a=n}function oVe(e){var t,n,r,i;for(this.a=new CC,this.d=new yg,this.e=0,n=e,r=0,i=n.length;r<i;++r)t=n[r],!this.f&&(this.f=t),KCe(this,t)}function sVe(e){JW(),e.length==0?(this.e=0,this.d=1,this.a=G(j(q9,1),cq,30,15,[0])):(this.e=1,this.d=e.length,this.a=e,EN(this))}function LV(e,t,n){Hre.call(this),this.a=U(Ovt,fst,216,(xI(),G(j(YQ,1),YK,237,0,[KQ,qQ,JQ])).length,0,1),this.b=e,this.d=t,this.c=n}function cVe(e){var t,n,r,i,a,o=F(J(e,(Z(),N0)),12);for(K(o,W0,e.i.n.b),t=MN(e.e),r=t,i=0,a=r.length;i<a;++i)n=r[i],eN(n,o)}function lVe(e){var t,n=F(J(e,(Z(),N0)),12),r,i,a,o;for(K(n,W0,e.i.n.b),t=MN(e.g),i=t,a=0,o=i.length;a<o;++a)r=i[a],QM(r,n)}function uVe(e,t){gSe();var n,r;for(r=new Jk(aT(NB(e).a.Jc(),new f));$U(r);)if(n=F(wP(r),17),n.d.i==t||n.c.i==t)return n;return null}function dVe(e,t){var n=t.ni(e.a),r;return n&&(r=EE(dV((!n.b&&(n.b=new hE((uK(),o9),d9,n)),n.b),$X)),r!=null)?r:t.ve()}function fVe(e,t){var n=t.ni(e.a),r;return n&&(r=EE(dV((!n.b&&(n.b=new hE((uK(),o9),d9,n)),n.b),$X)),r!=null)?r:t.ve()}function pVe(e,t){var n=sw(e.a.c.p,t.a.c.p),r;return n==0?(r=sw(e.a.d.i.p,t.a.d.i.p),r==0?sw(t.a.d.p,e.a.d.p):r):n}function mVe(e,t,n){var r,i,a=t.j,o=n.j;return a==o?(r=e.f[t.p],i=e.f[n.p],r==0&&i==0?0:r==0?-1:i==0?1:sB(r,i)):a.g-o.g}function hVe(e,t){var n,r,i,a;for(r=0,i=t.gc();r<i;++r)n=t.Rl(r),N(n,103)&&(F(n,19).Bb&IX)!=0&&(a=t.Sl(r),a!=null&&D8e(e,F(a,57)))}function gVe(){var e;return pQ!=0&&(e=Date.now(),e-Ygt>2e3&&(Ygt=e,mQ=r.setTimeout(Coe,10))),pQ++==0?(jAe((j_(),Xgt)),!0):!1}function _Ve(e,t,n){var r;(uvt?(Fze(e),!0):dvt||pvt?(My(),!0):fvt&&(My(),!1))&&(r=new tpe(t),r.b=n,sYe(e,r))}function vVe(e,t){var n=!e.A.Gc((yV(),z5))||e.q==(QH(),t5);e.u.Gc((IU(),c5))?n?Ort(e,t):rrt(e,t):e.u.Gc(u5)&&(n?Nnt(e,t):Xrt(e,t))}function yVe(e){var t;M(X(e,(oK(),U6)))===M((_z(),P8))&&(XM(e)?(t=F(X(XM(e),U6),347),$V(e,U6,t)):$V(e,U6,F8))}function bVe(e,t,n){var r,i;SJe(e.e,t,n,(YG(),N5)),SJe(e.i,t,n,p5),e.a&&(i=F(J(t,(Z(),N0)),12),r=F(J(n,N0),12),RCe(e.g,i,r))}function xVe(e,t,n){return new oM(r.Math.min(e.a,t.a)-n/2,r.Math.min(e.b,t.b)-n/2,r.Math.abs(e.a-t.a)+n,r.Math.abs(e.b-t.b)+n)}function SVe(e){var t;this.d=new Uh,this.j=new mv,this.g=new mv,t=e.g.b,this.f=F(J(Lj(t),(rK(),b2)),86),this.e=A(P(JV(t,f4)))}function CVe(e){this.d=new Uh,this.e=new aP,this.c=U(q9,cq,30,(YG(),G(j(P5,1),VJ,64,0,[M5,m5,p5,j5,N5])).length,15,1),this.b=e}function wVe(e,t,n){var r=n[e.g][t];switch(e.g){case 1:case 3:return new SS(0,r);case 2:case 4:return new SS(r,0);default:return null}}function TVe(e,t){var n=DI(e.o,t);if(n==null)throw k(new w_(`Node did not exist in input.`));return m2e(e,t),q6e(e,t),O1e(e,t,n),null}function EVe(e,t){var n,r=e.a.length;for(t.length<r&&(t=K_(Array(r),t)),n=0;n<r;++n)_j(t,n,e.a[n]);return t.length>r&&_j(t,r,null),t}function RV(e,t){var n,r=e.c.length;for(t.length<r&&(t=K_(Array(r),t)),n=0;n<r;++n)_j(t,n,e.c[n]);return t.length>r&&_j(t,r,null),t}function DVe(e,t,n,r){var i=e.length;if(t>=i)return i;for(t=t>0?t:0;t<i&&!WR((hN(t,e.length),e.charCodeAt(t)),n,r);t++);return t}function OVe(e,t,n){var r,i=F(NM(t.f),214);try{i.kf(e,n),Uve(t.f,i)}catch(e){throw e=NR(e),N(e,101)?(r=e,k(r)):k(e)}}function kVe(e,t,n){var r=null,i,a,o,s=Stt(XI(),t),c;return a=null,s&&(i=null,c=stt(s,n),o=null,c!=null&&(o=e.of(s,c)),i=o,a=i),r=a,r}function AVe(e,t,n,r){var i=new BF(e.e,1,13,(o=t.c,o||(uK(),e9)),(a=n.c,a||(uK(),e9)),sH(e,t),!1),a,o;return r?r.lj(i):r=i,r}function jVe(e){var t;if(e==null)return null;if(t=U1e(kG(e,!0)),t==null)throw k(new E_(`Invalid hexBinary value: '`+e+`'`));return t}function zV(e,t,n){var r;t.a.length>0&&(Rw(e.b,new xhe(t.a,n)),r=t.a.length,0<r?t.a=EM(t.a,0,0):0>r&&(t.a+=Dw(U(K9,rq,30,-r,15,1))))}function MVe(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new O(Dz(t));i.a<i.c.c.length;)r=F(H(i),217),a=GB(r,t),MVe(e,a,n)}function NVe(e,t){var n=0,i,a,o;for(a=new O(t.a);a.a<a.c.c.length;)i=F(H(a),9),o=i.o.a+i.d.c+i.d.b+e.j,n=r.Math.max(n,o);return n}function BV(e,t,n){var r,i=F(vj(e.e,t),393),a;return i?(a=QE(i,n),vue(e,i),a):(r=new fO(e,t,n),Uj(e.e,t,r),_xe(r),null)}function PVe(e,t){var n=vj(e.q,t);if(n==null)throw k(new w_(`Port did not exist in input.`));return m2e(e,t),q6e(e,t),O1e(e,t,n),null}function FVe(){return lK(),G(j(iyt,1),YK,168,0,[tyt,eyt,nyt,Kvt,Gvt,qvt,Xvt,Yvt,Jvt,$vt,Qvt,Zvt,Uvt,Hvt,Wvt,Bvt,zvt,Vvt,Lvt,Ivt,Rvt,ryt])}function VV(e){switch(e.g){case 4:return new SS(0,-1);case 1:return new SS(1,0);case 2:return new SS(-1,0);default:return new SS(0,1)}}function IVe(e){switch(e.g){case 1:return cB(),S8;case 4:return cB(),y8;case 2:return cB(),b8;case 3:return cB(),v8}return cB(),x8}function LVe(e){switch(e.fj(null)){case 10:return 0;case 15:return 1;case 14:return 2;case 11:return 3;case 21:return 4}return-1}function HV(){HV=E,m6=new eS(`PARENTS`,0),p6=new eS(`NODES`,1),d6=new eS(`EDGES`,2),h6=new eS(`PORTS`,3),f6=new eS(`LABELS`,4)}function UV(){UV=E,Z8=new fS(`DISTRIBUTED`,0),Q8=new fS(`JUSTIFIED`,1),ZRt=new fS(`BEGIN`,2),X8=new fS(Gq,3),QRt=new fS(`END`,4)}function RVe(e,t,n){var r=n.q.getFullYear()-sq+sq;switch(r<0&&(r=-r),t){case 1:e.a+=r;break;case 2:VF(e,r%100,2);break;default:VF(e,r,t)}}function WV(e,t){var n,r;if(iN(t,e.b),t>=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(r=e.a.a,n=0;n<t;++n)r=r.a;return new epe(e,t,r)}function zVe(e){this.b=new Uh,this.e=new Uh,this.d=e,this.a=!qv(eM(new fk(null,new dj(new IP(e.b))),new $p(new Ci))).zd((Iy(),WQ))}function BVe(e){var t;e.g&&(e.c.ig()?e.f:e.a)&&(t=e.c.ig()?e.f:e.a,b4e(t.a,e.o,!0),b4e(t.a,e.o,!1),K(e.o,(rK(),Z2),(QH(),e5)))}function VVe(e,t){var n,r,i=t.d.i;r=i.k,!(r==(cW(),R$)||r==N$)&&(n=new Jk(aT(PB(i).a.Jc(),new f)),$U(n)&&Uj(e.k,t,F(wP(n),17)))}function HVe(e,t){return wI(),sB((e.a.b==0?new SS(e.c.e.a,e.c.e.b):F(qT(e.a),8)).b,(t.a.b==0?new SS(t.c.e.a,t.c.e.b):F(qT(t.a),8)).b)}function UVe(e,t){return wI(),sB((e.a.b==0?new SS(e.c.e.a,e.c.e.b):F(qT(e.a),8)).a,(t.a.b==0?new SS(t.c.e.a,t.c.e.b):F(qT(t.a),8)).a)}function WVe(e,t){return wI(),sB((e.a.b==0?new SS(e.b.e.a,e.b.e.b):F(JT(e.a),8)).a,(t.a.b==0?new SS(t.b.e.a,t.b.e.b):F(JT(t.a),8)).a)}function GVe(e,t){return wI(),sB((e.a.b==0?new SS(e.b.e.a,e.b.e.b):F(JT(e.a),8)).b,(t.a.b==0?new SS(t.b.e.a,t.b.e.b):F(JT(t.a),8)).b)}function KVe(e,t){var n,r=cI(e.Ah(),t),i;return n=t-e.gi(),n<0?(i=e.Fh(r),i>=0?e.Th(i):yQe(e,r)):n<0?yQe(e,r):F(r,69).uk().zk(e,e.ei(),n)}function qVe(e){var t,n,r=(!e.o&&(e.o=new cF((eK(),d7),g7,e,0)),e.o);for(n=r.c.Jc();n.e!=n.i.gc();)t=F(n.Wj(),45),t.kd();return YP(r)}function GV(e){var t;if(N(e.a,4)){if(t=HBe(e.a),t==null)throw k(new d_(kft+e.b+`'. `+Eft+(wE(w7),w7.k)+Dft));return t}else return e.a}function JVe(e){var t;if(e==null)return null;if(t=Vrt(kG(e,!0)),t==null)throw k(new E_(`Invalid base64Binary value: '`+e+`'`));return t}function KV(e){var t;try{return t=e.i.Xb(e.e),e.Vj(),e.g=e.e++,t}catch(t){throw t=NR(t),N(t,99)?(e.Vj(),k(new dg)):k(t)}}function YVe(e){var t;try{return t=e.c.Ti(e.e),e.Vj(),e.g=e.e++,t}catch(t){throw t=NR(t),N(t,99)?(e.Vj(),k(new dg)):k(t)}}function qV(e){var t,n,r,i=0;for(n=0,r=e.length;n<r;n++)t=(hN(n,e.length),e.charCodeAt(n)),t>=64&&t<128&&(i=xN(i,Yk(1,t-64)));return i}function JV(e,t){var n,r=null;return uE(e,(oK(),l8))&&(n=F(J(e,l8),105),n.nf(t)&&(r=n.mf(t))),r==null&&Lj(e)&&(r=J(Lj(e),t)),r}function XVe(e,t){var n=F(J(e,(rK(),j2)),79);return Sw(t,Gbt)?n?mM(n):(n=new Lg,K(e,j2,n)):n&&K(e,j2,null),n}function ZVe(e,t){var n,r,i=new nF(t.gc());for(r=t.Jc();r.Ob();)n=F(r.Pb(),294),n.c==n.f?xU(e,n,n.c):eXe(e,n)||$h(i.c,n);return i}function QVe(e,t){var n=e.o,r,i;for(i=F(F(OP(e.r,t),22),83).Jc();i.Ob();)r=F(i.Pb(),115),r.e.a=cWe(r,n.a),r.e.b=n.b*A(P(r.b.mf(r$)))}function $Ve(e,t){var n,r,i=e.k,a;return n=A(P(J(e,(Z(),I0)))),a=t.k,r=A(P(J(t,I0))),a==(cW(),P$)?i==P$?n==r?0:n<r?-1:1:1:-1}function eHe(e,t){var n=F(F(vj(e.g,t.a),49).a,68),r=F(F(vj(e.g,t.b),49).a,68);return rF(t.a,t.b)-rF(t.a,yw(n.b))-rF(t.b,yw(r.b))}function YV(e,t){var n,r;if(++e.j,t!=null&&(n=(r=e.a.Cb,N(r,100)?F(r,100).qh():null),jQe(t,n))){MV(e.a,4,n);return}MV(e.a,4,F(t,129))}function XV(e){switch($y(),this.c=new Uh,this.d=e,e.g){case 0:case 2:this.a=Kve(zbt),this.b=yq;break;case 3:case 1:this.a=zbt,this.b=bq}}function tHe(e){var t;AD(F(J(e,(rK(),Z2)),102))&&(t=e.b,FQe((mN(0,t.c.length),F(t.c[0],25))),FQe(F(ck(t,t.c.length-1),25)))}function nHe(e,t){t.Tg(`Self-Loop post-processing`,1),Ly(eM(eM(ZF(new fk(null,new pN(e.b,16)),new lee),new Cr),new wr),new Tr),t.Ug()}function rHe(e,t,n){var r,i;if(e.c)II(e.c,e.c.i+t),LI(e.c,e.c.j+n);else for(i=new O(e.b);i.a<i.c.c.length;)r=F(H(i),167),rHe(r,t,n)}function iHe(e){var t,n,r=e.c.a;for(e.p=(uj(r),new PD(r)),n=new O(r);n.a<n.c.c.length;)t=F(H(n),9),t.p=ZXe(t).a;dM(),rw(e.p,new Ca)}function aHe(e,t){var n,r;if(e.j.length!=t.j.length)return!1;for(n=0,r=e.j.length;n<r;n++)if(!vD(e.j[n],t.j[n]))return!1;return!0}function oHe(e,t){dM();var n=e,r,i,a=t;for(N(e,22)&&!N(t,22)&&(n=t,a=e),i=n.Jc();i.Ob();)if(r=i.Pb(),a.Gc(r))return!1;return!0}function sHe(e,t,n,r){return t.a<r.a||t.a==r.a&&(t.b<r.b||t.b==r.b&&e.b>n.b)}function cHe(e){var t=new L_;return t.a+=`n`,e.k!=(cW(),R$)&&YS(YS((t.a+=`(`,t),ZT(e.k).toLowerCase()),`)`),YS((t.a+=`_`,t),CH(e)),t.a}function ZV(){ZV=E,bkt=new Cx(Vut,0),vkt=new Cx(mct,1),ykt=new Cx(`LINEAR_SEGMENTS`,2),D4=new Cx(`BRANDES_KOEPF`,3),O4=new Cx(But,4)}function QV(e,t,n,r){var i;return n>=0?e.Ph(t,n,r):(e.Mh()&&(r=(i=e.Ch(),i>=0?e.xh(r):e.Mh().Qh(e,-1-i,null,r))),e.zh(t,n,r))}function lHe(e,t){switch(t){case 7:!e.e&&(e.e=new mD(i7,e,7,4)),IG(e.e);return;case 8:!e.d&&(e.d=new mD(i7,e,8,5)),IG(e.d);return}Yze(e,t)}function $V(e,t,n){return n==null?(!e.o&&(e.o=new cF((eK(),d7),g7,e,0)),kV(e.o,t)):(!e.o&&(e.o=new cF((eK(),d7),g7,e,0)),zH(e.o,t,n)),e}function eH(e,t){var n=e.dd(t);try{return n.Pb()}catch(e){throw e=NR(e),N(e,112)?k(new r_(`Can't get element `+t)):k(e)}}function uHe(e,t){var n=F(Gj(e.b,t),127).n;switch(t.g){case 1:e.t>=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function dHe(e){var t=e.a;do t=F(wP(new Jk(aT(MB(t).a.Jc(),new f))),17).c.i,t.k==(cW(),I$)&&e.b.Ec(t);while(t.k==(cW(),I$));e.b=tV(e.b)}function fHe(e,t){var n,i,a=e;for(i=new Jk(aT(MB(t).a.Jc(),new f));$U(i);)n=F(wP(i),17),n.c.i.c&&(a=r.Math.max(a,n.c.i.c.p));return a}function pHe(e,t){var n,r,i=0;for(r=F(F(OP(e.r,t),22),83).Jc();r.Ob();)n=F(r.Pb(),115),i+=n.d.d+n.b.Kf().b+n.d.a,r.Ob()&&(i+=e.w);return i}function mHe(e,t){var n,r,i=0;for(r=F(F(OP(e.r,t),22),83).Jc();r.Ob();)n=F(r.Pb(),115),i+=n.d.b+n.b.Kf().a+n.d.c,r.Ob()&&(i+=e.w);return i}function hHe(e){var t,n,r=0,i=PW(e);if(i.c.length==0)return 1;for(n=new O(i);n.a<n.c.c.length;)t=F(H(n),26),r+=hHe(t);return r}function gHe(e){var t,n;for(this.b=new Uh,this.c=e,this.a=!1,n=new O(e.a);n.a<n.c.c.length;)t=F(H(n),9),this.a|=t.k==(cW(),R$)}function _He(e,t,n){var r=e.bd(t),i,a,o;return r!=-1&&(e.Nj()?(a=e.Oj(),o=QO(e,r),i=e.Gj(4,o,null,r,a),n?n.lj(i):n=i):QO(e,r)),n}function tH(e,t,n){var r=e.bd(t),i,a,o;return r!=-1&&(e.Nj()?(a=e.Oj(),o=DH(e,r),i=e.Gj(4,o,null,r,a),n?n.lj(i):n=i):DH(e,r)),n}function vHe(e,t,n,r){var i,a,o;n.Uh(t)&&(bb(),qF(t)?(i=F(n.Jh(t),163),hVe(e,i)):(a=(o=t,o?F(r,52).di(o):null),a&&ire(n.Jh(t),a)))}function nH(e,t,n,r){var i,a=cI(e.Ah(),t),o;return i=t-e.gi(),i<0?(o=e.Fh(a),o>=0?e.Ih(o,n,!0):GU(e,a,n)):F(a,69).uk().wk(e,e.ei(),i,n,r)}function yHe(e,t,n,r){var i=uRe(t.nf((oK(),J6))?F(t.mf(J6),22):e.j);i!=(lK(),ryt)&&(n&&!PBe(i)||HYe(W1e(e,i,r),t))}function bHe(e,t){return IS(e)?!!Ogt[t]:e.Qm?!!e.Qm[t]:FS(e)?!!Dgt[t]:PS(e)?!!Egt[t]:!1}function xHe(e){switch(e.g){case 1:return SR(),a$;case 3:return SR(),i$;case 2:return SR(),cyt;case 4:return SR(),syt;default:return null}}function SHe(e,t,n){if(e.e)switch(e.b){case 1:Zye(e.c,t,n);break;case 0:Qye(e.c,t,n)}else qTe(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function CHe(e){var t,n;if(e==null)return null;for(n=U(M$,NK,199,e.length,0,2),t=0;t<n.length;t++)n[t]=F(vEe(e[t],e[t].length),199);return n}function wHe(e){var t=F(J(e,(pG(),yMt)),104);K(e,(JG(),m3),new SS(0,0)),w8e(new zP,e,t.b-A(P(J(e,Hjt))),t.d-A(P(J(e,Wjt))))}function rH(e){var t;if(fz(e))return Uk(e),e.sl()&&(t=BU(e.e,e.b,e.c,e.a,e.j),e.j=t),e.g=e.a,++e.a,++e.c,e.i=0,e.j;throw k(new dg)}function THe(e,t,n){n.Tg(`Compound graph preprocessor`,1),e.a=new PM,Pnt(e,t,null),tet(e,t),Z0e(e),K(t,(Z(),QCt),e.a),e.a=null,FA(e.b),n.Ug()}function EHe(e,t,n){var r,i,a;for(i=new Jk(aT((t?MB(e):PB(e)).a.Jc(),new f));$U(i);)r=F(wP(i),17),a=t?r.c.i:r.d.i,a.k==(cW(),F$)&&$M(a,n)}function DHe(e,t,n){var r=t.i.j.c.length,i,a;return uE(t,(Z(),M0))&&uE(n,M0)?(i=EW(t,n,e.b,r),a=EW(n,t,e.b,r),i<a?-1:+(i>a)):0}function iH(){iH=E,E4=new Sx(BJ,0),hkt=new Sx(`PORT_POSITION`,1),T4=new Sx(`NODE_SIZE_WHERE_SPACE_PERMITS`,2),w4=new Sx(`NODE_SIZE`,3)}function OHe(e,t){var n,r,i;for(t.Tg(`Untreeify`,1),n=F(J(e,(JG(),Kjt)),16),i=n.Jc();i.Ob();)r=F(i.Pb(),65),MO(r.b.d,r),MO(r.c.b,r);t.Ug()}function aH(){aH=E,RIt=new nS(`AUTOMATIC`,0),O6=new nS(Kq,1),k6=new nS(qq,2),A6=new nS(`TOP`,3),E6=new nS(mst,4),D6=new nS(Gq,5)}function oH(e,t,n){var r,i=e.gc();if(t>=i)throw k(new hD(t,i));if(e.Qi()&&(r=e.bd(n),r>=0&&r!=t))throw k(new u_(tZ));return e.Vi(t,n)}function sH(e,t){var n,r,i=IWe(e,t);if(i>=0)return i;if(e.ml()){for(r=0;r<e.i;++r)if(n=e.nl(F(e.g[r],57)),M(n)===M(t))return r}return-1}function kHe(e,t){if(this.a=F(uj(e),254),this.b=F(uj(t),254),e.Cd(t)>0||e==(Jg(),Pgt)||t==(Kg(),Fgt))throw k(new u_(`Invalid range: `+RTe(e,t)))}function AHe(e,t,n,r){RW();var i=0,a;for(a=0;a<n;a++)i=kB(AB(bN(t[a],Eq),bN(r,Eq)),bN(wk(i),Eq)),e[a]=wk(i),i=Zk(i,32);return wk(i)}function jHe(e,t,n){var i,a=0;for(i=0;i<Avt;i++)a=r.Math.max(a,Az(e.a[t.g][i],n));return t==(xI(),qQ)&&e.b&&(a=r.Math.max(a,e.b.b)),a}function cH(e,t){var n,r;if(QT(t>0),(t&-t)==t)return zM(t*dW(e,31)*4656612873077393e-25);do n=dW(e,31),r=n%t;while(n-r+(t-1)<0);return zM(r)}function MHe(e,t){var n=xT(new Cg,e),r,i;for(i=new O(t);i.a<i.c.c.length;)r=F(H(i),124),DW(Gy(Wy(Ky(Uy(new Sg,0),0),n),r));return n}function lH(e,t,n){var r,i;for(tFe(e,t-e.s,n-e.t),i=new O(e.n);i.a<i.c.c.length;)r=F(H(i),208),Dp(r,r.e+t-e.s),Op(r,r.f+n-e.t);e.s=t,e.t=n}function NHe(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function uH(e,t,n,r){var i,a;for(i=t;i<e.c.length;i++)if(a=(mN(i,e.c.length),F(e.c[i],12)),n.Mb(a))$h(r.c,a);else return i;return e.c.length}function PHe(e){var t,n,r;for(r=F(OP(e.a,(ZH(),x1)),16).Jc();r.Ob();)n=F(r.Pb(),107),t=AWe(n),$A(e,n,t[0],(TL(),C1),0),$A(e,n,t[1],T1,1)}function FHe(e){var t,n,r;for(r=F(OP(e.a,(ZH(),S1)),16).Jc();r.Ob();)n=F(r.Pb(),107),t=AWe(n),$A(e,n,t[0],(TL(),C1),0),$A(e,n,t[1],T1,1)}function IHe(e){switch(e.g){case 0:return null;case 1:return new wNe;case 2:return new fie;default:throw k(new u_(Cdt+(e.f==null?``+e.g:e.f)))}}function LHe(e){var t=A(P(X(e,(oK(),p8))))*r.Math.sqrt((!e.a&&(e.a=new R(p7,e,10,11)),e.a).i);return new SS(t,t/A(P(X(e,f8))))}function RHe(e){var t;return e.f&&e.f.Sh()&&(t=F(e.f,52),e.f=F(Uz(e,t),84),e.f!=t&&e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,9,8,t,e.f))),e.f}function zHe(e){var t;return e.i&&e.i.Sh()&&(t=F(e.i,52),e.i=F(Uz(e,t),84),e.i!=t&&e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,9,7,t,e.i))),e.i}function dH(e){var t;return e.b&&e.b.Db&64&&(t=e.b,e.b=F(Uz(e,t),19),e.b!=t&&e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,9,21,t,e.b))),e.b}function fH(e,t){var n,r,i;e.d==null?(++e.e,++e.f):(r=t.yi(),l2e(e,e.f+1),i=(r&hK)%e.d.length,n=e.d[i],!n&&(n=e.d[i]=e.bk()),n.Ec(t),++e.f)}function BHe(e,t,n){var r;return t.rk()?!1:t.Gk()==-2?t.ok()==e.e.Ah()&&n==null:(r=t.gk(),r==null?n==null:Qz(r,n))}function pH(){var e;oL(16,Vat),e=tNe(16),this.b=U(Igt,KK,309,e,0,1),this.c=U(Igt,KK,309,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function mH(e){lfe.call(this),this.k=(cW(),R$),this.j=(oL(6,JK),new nF(6)),this.b=(oL(2,JK),new nF(2)),this.d=new Ng,this.f=new Fg,this.a=e}function VHe(e){var t,n=0,r,i,a;for(i=new O(e.a);i.a<i.c.c.length;)r=F(H(i),124),r.d=n++;return t=TJe(e),a=null,t.c.length>1&&(a=MHe(e,t)),a}function HHe(e){var t=0,n,r;for(r=new O(e.c.a);r.a<r.c.c.length;)n=F(H(r),9),t+=qN(new Jk(aT(PB(n).a.Jc(),new f)));return t/e.c.a.c.length}function UHe(e){var t,n;for(n=new Jw(e);n.e!=n.i.gc();)if(t=F(KV(n),87),t.e||(!t.d&&(t.d=new Vw(z7,t,1)),t.d).i!=0)return!0;return!1}function WHe(e){var t,n;for(n=new Jw(e);n.e!=n.i.gc();)if(t=F(KV(n),87),t.e||(!t.d&&(t.d=new Vw(z7,t,1)),t.d).i!=0)return!0;return!1}function GHe(e,t,n,r){var i=F(OP(r?e.a:e.b,t),22),a,o;for(o=i.Jc();o.Ob();)if(a=F(o.Pb(),26),zW(e,n,a))return!0;return!1}function KHe(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(M(n)===M(r)||n!=null&&Qz(n,r))))return!1;return!t.Ob()}function qHe(e){var t,n;e.c.length<=1||(t=$4e(e,(YG(),j5)),dXe(e,F(t.a,15).a,F(t.b,15).a),n=$4e(e,N5),dXe(e,F(n.a,15).a,F(n.b,15).a))}function JHe(e,t,n){var r,i=e.a.b;for(r=i.c.length;r<n;r++)Ok(i,i.c.length,new bj(e.a));$M(t,(mN(n-1,i.c.length),F(i.c[n-1],25))),e.b[t.p]=n}function YHe(e,t){var n,r,i;for(e.b[t.g]=1,r=WV(t.d,0);r.b!=r.d.c;)n=F(UN(r),65),i=n.c,e.b[i.g]==1?MO(e.a,n):e.b[i.g]==2?e.b[i.g]=1:YHe(e,i)}function XHe(){XHe=E,hIt=(U3e(),lIt),pIt=new UC(8),new qC((oK(),t8),pIt),new qC(d8,8),mIt=sIt,dIt=ZFt,fIt=QFt,uIt=new qC(B6,(_T(),!1))}function ZHe(e,t,n){var r;n.Tg(`Shrinking tree compaction`,1),m_(TE(J(t,(CR(),s$))))?(XMe(e,t.f),uAe(t.f,(r=t.c,r))):uAe(t.f,t.c),n.Ug()}function QHe(e,t,n,r){switch(t){case 7:return!e.e&&(e.e=new mD(i7,e,7,4)),e.e;case 8:return!e.d&&(e.d=new mD(i7,e,8,5)),e.d}return lze(e,t,n,r)}function $He(e){var t;return e.a&&e.a.Sh()&&(t=F(e.a,52),e.a=F(Uz(e,t),143),e.a!=t&&e.Db&4&&!(e.Db&1)&&tR(e,new gA(e,9,5,t,e.a))),e.a}function hH(e){return e<48||e>102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function eUe(e,t){if(e==null)throw k(new p_(`null key in entry: null=`+t));if(t==null)throw k(new p_(`null value in entry: `+e+`=null`))}function tUe(e,t){var n=G(j(Z9,1),Tq,30,15,[Az(e.a[0],t),Az(e.a[1],t),Az(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function nUe(e,t){var n=G(j(Z9,1),Tq,30,15,[jz(e.a[0],t),jz(e.a[1],t),jz(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function rUe(e,t,n){AD(F(J(t,(rK(),Z2)),102))||(XEe(e,t,vU(t,n)),XEe(e,t,vU(t,(YG(),j5))),XEe(e,t,vU(t,m5)),dM(),rw(t.j,new Yte(e)))}function iUe(e){var t,n;for(e.c||Yet(e),n=new Lg,t=new O(e.a),H(t);t.a<t.c.c.length;)MO(n,F(H(t),410).a);return tE(n.b!=0),gI(n,n.c.b),n}function aUe(e,t,n){var r,i,a,o,s=e.r+t;for(e.r+=t,e.d+=n,r=n/e.n.c.length,i=0,o=new O(e.n);o.a<o.c.c.length;)a=F(H(o),208),w1e(a,s,r,i),++i}function oUe(e){var t,n,r;for(e.b.a.$b(),e.a=U(GQ,bK,60,e.c.c.a.b.c.length,0,1),t=0,r=new O(e.c.c.a.b);r.a<r.c.c.length;)n=F(H(r),60),n.f=t++}function sUe(e){var t,n,r;for(e.b.a.$b(),e.a=U(Ebt,bK,82,e.c.a.a.b.c.length,0,1),t=0,r=new O(e.c.a.a.b);r.a<r.c.c.length;)n=F(H(r),82),n.i=t++}function cUe(e){var t,n,r,i,a;for(r=new O(e.b);r.a<r.c.c.length;)for(n=F(H(r),25),t=0,a=new O(n.a);a.a<a.c.c.length;)i=F(H(a),9),i.p=t++}function lUe(e,t,n){var r,i,a,o=0;for(r=n/e.a.c.length,a=new O(e.a);a.a<a.c.c.length;)i=F(H(a),173),lH(i,i.s,i.t+o*r),aUe(i,e.d-i.r+t,r),++o}function uUe(e){var t=QIe(e);if(!$U(e))throw k(new r_(`position (0) must be less than the number of elements that remained (`+t+`)`));return wP(e)}function dUe(e,t){var n;return e.a||=(n=U(Z9,Tq,30,0,15,1),zv(e.b.a,new dte(n)),gre(n,Bje(te.prototype.Ke,te,[])),new SD(n,e.d)),KP(e.a,t)}function fUe(e){switch(e.g){case 1:return YG(),N5;case 4:return YG(),m5;case 3:return YG(),p5;case 2:return YG(),j5;default:return YG(),M5}}function pUe(e,t,n){t.k==(cW(),R$)&&n.k==I$&&(e.d=Kz(t,(YG(),j5)),e.b=Kz(t,m5)),n.k==R$&&t.k==I$&&(e.d=Kz(n,(YG(),m5)),e.b=Kz(n,j5))}function mUe(e,t){var n,r;for(r=TB(e,t).Jc();r.Ob();)if(n=F(r.Pb(),12),J(n,(Z(),F0))!=null||TT(new IP(n.b)))return!0;return!1}function hUe(e,t,n){n.Tg(`Linear segments node placement`,1),e.b=F(J(t,(Z(),H0)),317),Kit(e,t),w9e(e,t),oet(e,t),sit(e),e.a=null,e.b=null,n.Ug()}function gUe(e,t){return II(t,e.e+e.d+(e.c.c.length==0?0:e.b)),LI(t,e.f),e.a=r.Math.max(e.a,t.f),e.d+=t.g+(e.c.c.length==0?0:e.b),Rw(e.c,t),!0}function _Ue(e,t){var n,r,i=t.length-1,a,o=0,s=0;for(r=0;r<=i;r++)a=t[r],n=_Ye(i,r)*ELe(1-e,i-r)*ELe(e,r),o+=a.a*n,s+=a.b*n;return new SS(o,s)}function vUe(e,t){var n=t.gc(),r,i,a,o;for(e.Zi(e.i+n),a=t.Jc(),o=e.i,e.i+=n,r=o;r<e.i;++r)i=a.Pb(),zw(e,r,e.Xi(r,i)),e.Ki(r,i),e.Li();return n!=0}function yUe(e,t,n){var r,i,a;return e.Nj()?(r=e.Cj(),a=e.Oj(),++e.j,e.oj(r,e.Xi(r,t)),i=e.Gj(3,null,t,r,a),n?n.lj(i):n=i):Gde(e,e.Cj(),t),n}function bUe(e,t,n){var r=F(W(nP(e.a),t),87),i,a=(i=r.c,N(i,88)?F(i,29):(uK(),t9));return(a.Db&64?Uz(e.b,a):a)==n?lG(r):TI(r,n),a}function xUe(e){var t;return e==null?null:new HC((t=kG(e,!0),t.length>0&&(hN(0,t.length),t.charCodeAt(0)==43)?(hN(1,t.length+1),t.substr(1)):t))}function SUe(e){var t;return e==null?null:new HC((t=kG(e,!0),t.length>0&&(hN(0,t.length),t.charCodeAt(0)==43)?(hN(1,t.length+1),t.substr(1)):t))}function CUe(e,t,n,r,i,a,o,s){var c,l;r&&(c=r.a[0],c&&CUe(e,t,n,c,i,a,o,s),vWe(e,n,r.d,i,a,o,s)&&t.Ec(r),l=r.a[1],l&&CUe(e,t,n,l,i,a,o,s))}function gH(e,t){var n,r,i,a=e.gc();for(t.length<a&&(t=K_(Array(a),t)),i=t,r=e.Jc(),n=0;n<a;++n)_j(i,n,r.Pb());return t.length>a&&_j(t,a,null),t}function wUe(e,t){var n,r=e.gc();if(t==null){for(n=0;n<r;n++)if(e.Xb(n)==null)return n}else for(n=0;n<r;n++)if(Qz(t,e.Xb(n)))return n;return-1}function TUe(e,t){var n=t.jd(),r,i=t.kd();return r=e.xc(n),!(!(M(i)===M(r)||i!=null&&Qz(i,r))||r==null&&!e._b(n))}function EUe(e,t){var n,r,i;return t<=22?(n=e.l&(1<<t)-1,r=i=0):t<=44?(n=e.l,r=e.m&(1<<t-22)-1,i=0):(n=e.l,r=e.m,i=e.h&(1<<t-44)-1),lw(n,r,i)}function DUe(e,t){switch(t.g){case 1:return e.f.n.d+e.t;case 3:return e.f.n.a+e.t;case 2:return e.f.n.c+e.s;case 4:return e.f.n.b+e.s;default:return 0}}function OUe(e,t){var n,r=t.c;switch(n=t.a,e.b.g){case 0:n.d=e.e-r.a-r.d;break;case 1:n.d+=e.e;break;case 2:n.c=e.e-r.a-r.d;break;case 3:n.c=e.e+r.d}}function _H(){_H=E,WNt=new Wx(BJ,0),HNt=new Wx(_ct,1),UNt=new Wx(`EDGE_LENGTH_BY_POSITION`,2),VNt=new Wx(`CROSSING_MINIMIZATION_BY_POSITION`,3)}function kUe(e,t){var n=F(DI(e.n,t),26),r;if(n)return n;if(r=F(DI(e.p,t),125),r)return r;throw k(new w_(`Referenced shape does not exist: `+t))}function AUe(e,t){if(e.g==-1)throw k(new cg);e.Vj();try{e.d.fd(e.g,t),e.f=e.d.j}catch(e){throw e=NR(e),N(e,99)?k(new ag):k(e)}}function jUe(e,t){var n,r;if(N(t,254)){r=F(t,254);try{return n=e.Cd(r),n==0}catch(e){if(e=NR(e),N(e,211))return!1;throw k(e)}}return!1}function MUe(e,t){if(e.c==t)return e.d;if(e.d==t)return e.c;throw k(new u_(`Node 'one' must be either source or target of edge 'edge'.`))}function NUe(e,t){if(e.c.i==t)return e.d.i;if(e.d.i==t)return e.c.i;throw k(new u_(`Node `+t+` is neither source nor target of edge `+e))}function PUe(e,t,n){n.Tg(`Self-Loop ordering`,1),Ly(tM(eM(eM(ZF(new fk(null,new pN(t.b,16)),new vr),new yr),new br),new xr),new Lte(e)),n.Ug()}function FUe(e,t,n,r,i,a){var o=FGe(t,n,a),s=n==(YG(),m5)||n==N5?-1:1,c,l=e[n.g],u;for(u=0;u<l.length;u++)c=l[u],c>0&&(c+=i),l[u]=o,o+=s*(c+r)}function IUe(e){var t;for(t=0;t<e.a.c.length;t++)if(uE(F(ck(e.a,t),9),(rK(),cOt))&&m_(TE(J(F(ck(e.a,t),9),cOt))))return!0;return!1}function LUe(e){var t,n,r=e.f;for(e.n=U(Z9,Tq,30,r,15,1),e.d=U(Z9,Tq,30,r,15,1),t=0;t<r;t++)n=F(ck(e.c.b,t),25),e.n[t]=NVe(e,n),e.d[t]=V0e(e,n)}function RUe(e,t,n,r){var i;this.c=e,this.d=t,i=new Dy,lP(i,n,i.c.b,i.c),this.a=i,this.b=F(J(r,(pG(),D3)),86),this.e=A(P(J(r,wMt))),oat(this)}function zUe(e,t){var n,r,i=0;for(r=2;r<t;r<<=1)(e.Db&r)!=0&&++i;if(i==0){for(n=t<<=1;n<=128;n<<=1)if((e.Db&n)!=0)return 0;return-1}else return i}function BUe(e,t){var n,r,i,a,o=kW(e.e.Ah(),t);for(a=null,n=F(e.g,122),i=0;i<e.i;++i)r=n[i],o.$l(r.Jk())&&(!a&&(a=new Zc),iF(a,r));a&&rit(e,a)}function VUe(e){var t,n,r;if(!e)return null;if(e.dc())return``;for(r=new F_,n=e.Jc();n.Ob();)t=n.Pb(),KS(r,EE(t)),r.a+=` `;return lC(r,r.a.length-1)}function HUe(e,t){var n=Array(t),r;switch(e){case 14:case 15:r=0;break;case 16:r=!1;break;default:return n}for(var i=0;i<t;++i)n[i]=r;return n}function vH(e){var t,n,r;for(n=new O(e.a.b);n.a<n.c.c.length;)t=F(H(n),60),t.c.$b();r=kC(e.d)?e.a.c:e.a.d,vI(r,new rm(e)),e.c.bf(e),T4e(e)}function UUe(e){var t,n,r,i;for(n=new O(e.e.c);n.a<n.c.c.length;){for(t=F(H(n),291),i=new O(t.b);i.a<i.c.c.length;)r=F(H(i),445),e9e(r);JQe(t)}}function WUe(e){var t,n,i=hK;for(n=new O(e.a);n.a<n.c.c.length;)t=F(H(n),9),uE(t,(Z(),M0))&&(i=r.Math.min(i,F(J(t,M0),15).a));return i}function yH(e){var t,n,i=0,a,o=0;for(a=0,n=new O(e.a);n.a<n.c.c.length;)t=F(H(n),173),o=r.Math.max(o,t.r),i+=t.d+(a>0?e.c:0),++a;e.b=i,e.d=o}function GUe(e,t){var n=G(j(Z9,1),Tq,30,15,[jHe(e,(xI(),KQ),t),jHe(e,qQ,t),jHe(e,JQ,t)]);return e.f&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function KUe(e){var t;uE(e,(rK(),z2))&&(t=F(J(e,z2),22),t.Gc((eW(),V8))?(t.Kc(V8),t.Ec(U8)):t.Gc(U8)&&(t.Kc(U8),t.Ec(V8)))}function qUe(e){var t;uE(e,(rK(),z2))&&(t=F(J(e,z2),22),t.Gc((eW(),J8))?(t.Kc(J8),t.Ec(K8)):t.Gc(K8)&&(t.Kc(K8),t.Ec(J8)))}function JUe(e,t,n,r){var i,a,o,s;return e.a??gYe(e,t),o=t.b.j.c.length,a=n.d.p,s=r.d.p,i=s-1,i<0&&(i=o-1),a<=i?e.a[i]-e.a[a]:e.a[o-1]-e.a[a]+e.a[i]}function YUe(e){var t;for(t=0;t<e.a.c.length;t++)if(uE(F(ck(e.a,t),9),(rK(),lOt))&&!m_(TE(J(F(ck(e.a,t),9),lOt))))return!1;return!0}function XUe(e,t,n){var r,i,a=e.c,o,s=n?t:e;for(r=n?e:t,i=s.p+1;i<r.p;++i)if(o=F(ck(a.a,i),9),!(o.k==(cW(),N$)||pGe(o)))return!1;return!0}function ZUe(e){var t,n;if(!e.b)for(e.b=NN(F(e.f,26).jh().i),n=new Jw(F(e.f,26).jh());n.e!=n.i.gc();)t=F(KV(n),157),Rw(e.b,new o_(t));return e.b}function QUe(e){var t,n;if(!e.e)for(e.e=NN(rye(F(e.f,26)).i),n=new Jw(rye(F(e.f,26)));n.e!=n.i.gc();)t=F(KV(n),125),Rw(e.e,new Hne(t));return e.e}function $Ue(e){var t,n;if(!e.a)for(e.a=NN(_M(F(e.f,26)).i),n=new Jw(_M(F(e.f,26)));n.e!=n.i.gc();)t=F(KV(n),26),Rw(e.a,new MT(e,t));return e.a}function bH(e){var t;if(!e.C&&(e.D!=null||e.B!=null))if(t=Cnt(e),t)e.fl(t);else try{e.fl(null)}catch(e){if(e=NR(e),!N(e,63))throw k(e)}return e.C}function eWe(e){switch(e.q.g){case 5:QGe(e,(YG(),m5)),QGe(e,j5);break;case 4:utt(e,(YG(),m5)),utt(e,j5);break;default:jXe(e,(YG(),m5)),jXe(e,j5)}}function tWe(e){switch(e.q.g){case 5:$Ge(e,(YG(),p5)),$Ge(e,N5);break;case 4:dtt(e,(YG(),p5)),dtt(e,N5);break;default:MXe(e,(YG(),p5)),MXe(e,N5)}}function xH(e,t){var n,i,a=new mv;for(i=e.Jc();i.Ob();)n=F(i.Pb(),36),GW(n,a.a,0),a.a+=n.f.a+t,a.b=r.Math.max(a.b,n.f.b);return a.b>0&&(a.b+=t),a}function SH(e,t){var n,i,a=new mv;for(i=e.Jc();i.Ob();)n=F(i.Pb(),36),GW(n,0,a.b),a.b+=n.f.b+t,a.a=r.Math.max(a.a,n.f.a);return a.a>0&&(a.a+=t),a}function nWe(e,t){var n,r;if(t.length==0)return 0;for(n=cve(e.a,t[0],(YG(),N5)),n+=cve(e.a,t[t.length-1],p5),r=0;r<t.length;r++)n+=qJe(e,r,t);return n}function rWe(){jW(),this.c=new Uh,this.i=new Uh,this.e=new CC,this.f=new CC,this.g=new CC,this.j=new Uh,this.a=new Uh,this.b=new Wh,this.k=new Wh}function iWe(e,t){var n,r;return e.Db>>16==6?e.Cb.Qh(e,5,c7,t):(r=dH(F(cI((n=F(lR(e,16),29),n||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,r.n,r.f,t))}function aWe(e){jM();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+`