onepipeline-ui 0.80.2 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,87 @@
1
+ import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,Ft as p,G as m,Gt as h,H as g,Ht as _,I as v,It as y,J as b,Jt as x,K as S,Kt as C,L as w,Lt as T,M as E,Mt as D,N as O,Nt as k,O as A,Ot as j,P as M,Pt as N,Q as P,Qt as F,R as I,Rt as L,S as R,St as z,T as ee,Tt as te,U as ne,Ut as re,V as ie,Vt as B,W as ae,Wt as oe,X as se,Xt as ce,Y as le,Yt as ue,Z as de,Zt as fe,_ as pe,_t as me,a as he,an as ge,at as _e,b as ve,bt as ye,c as be,cn as xe,ct as Se,d as Ce,en as we,et as Te,f as Ee,ft as De,g as Oe,gt as ke,h as Ae,ht as je,i as Me,in as Ne,it as Pe,j as Fe,jt as Ie,k as Le,kt as Re,l as ze,ln as Be,lt as Ve,m as He,mt as Ue,n as We,nn as Ge,nt as Ke,o as qe,on as Je,ot as Ye,p as Xe,pt as Ze,q as Qe,qt as $e,r as et,rn as tt,rt as nt,s as rt,sn as it,st as at,t as ot,tn as st,tt as ct,u as lt,un as ut,ut as dt,v as ft,vt as pt,w as mt,wt as ht,x as gt,xt as _t,y as vt,yt,z as bt,zt as xt}from"./index-DbHFqLk6.js";var St=x(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Ct=x(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),wt=x(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Tt=x(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Et=x(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Dt=x(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ot=x(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),kt=x(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),At=x(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),jt=x(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Mt=x(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),Nt=x(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Pt=x(`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`}]]),Ft=x(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),It=x(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Lt=x(`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`}]]),Rt=x(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),zt=x(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Bt=x(`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`}]]),Vt=x(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Ht=x(`message-square-off`,[[`path`,{d:`M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826`,key:`1wyg69`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v11.344`,key:`mhl4k6`}]]),Ut=x(`message-square-plus`,[[`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`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Wt=x(`message-square-reply`,[[`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`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]),Gt=x(`octagon-pause`,[[`path`,{d:`M10 15V9`,key:`1lckn7`}],[`path`,{d:`M14 15V9`,key:`1muqhk`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}]]),Kt=x(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),qt=x(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Jt=x(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Yt=x(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Xt=x(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Zt=x(`satellite`,[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]),Qt=x(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),$t=x(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),en=x(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),tn=x(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),nn=x(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),rn=x(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),an=x(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),V=ut(ge(),1),H=re(),on=[`bg-spectrum-blue`,`bg-spectrum-green`,`bg-spectrum-orange`,`bg-spectrum-violet`,`bg-spectrum-red`,`bg-spectrum-indigo`,`bg-spectrum-yellow`],sn=`__timeline_implicit_lane__`;function cn(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return on[(t>>>0)%on.length]??on[0]}function ln(e){return e.laneId??sn}function un(e){return typeof e.end==`number`&&Number.isFinite(e.end)?e.end:typeof e.duration==`number`&&Number.isFinite(e.duration)?e.start+e.duration:e.start}function dn(e){return e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function fn(e){return`+${dn(e)}`}function pn(e){let t=new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toISOString()}function mn(e,t){let n=new Date(e);return`${Number.isNaN(n.valueOf())?String(e):n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})} ${fn(e-t)}`}function hn(e,t){let n=un(e),r=[e.label,`Lane: ${ln(e)}`,`Status: ${e.status??`unknown`}`,`Start: ${pn(e.start)}`];return n>e.start?r.push(`End: ${pn(n)}`,`Duration: ${dn(n-e.start)}`):r.push(`Duration: not recorded`),e.status===`failed`&&t?.trim()&&r.push(`Failure: ${t.trim().slice(0,160)}`),r.join(` · `)}function gn(e,t,n){let[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(null),s=(0,V.useRef)(null),c=(t&&t[1]>t[0]?{end:t[1],start:t[0]}:null)??r??e,l=Math.max(1,c.end-c.start),u=e=>{n?.([e.start,e.end]),t||i(e)},d=e=>{let t=s.current?.getBoundingClientRect(),n=t?.width||1e3;return c.start+Math.min(1,Math.max(0,(e-(t?.left??0))/n))*l};return{axis:s,brushStart:e=>o(d(e)),finishBrush:e=>{if(a===null)return;let t=d(e);Math.abs(t-a)>=l*.02&&u({end:Math.max(t,a),start:Math.min(t,a)}),o(null)},range:c,reset:()=>{n?.([e.start,e.end]),t||i(null)},viewChanged:c.start!==e.start||c.end!==e.end,zoom:(t,n)=>{let r=d(t),i=n<0?.75:1.25,a=Math.max(1,e.end-e.start),o=Math.min(a,Math.max(a/100,l*i)),s=r-o*((r-c.start)/l);s=Math.max(e.start,Math.min(s,e.end-o)),u({end:s+o,start:s})}}}function _n({axis:e,cursor:t,crosshair:n=!0,ticks:r,expanded:i=!1,getFailureExcerpt:a,items:o,label:s=`Timeline`,lanes:c,markers:l=[],onExpandedChange:u,onRangeChange:d,onSelect:f,range:p,selectedId:m}){let h=(0,V.useId)(),[g,_]=(0,V.useState)(1e3),[v,y]=(0,V.useState)(null),[b,x]=(0,V.useState)(null),S=(0,V.useMemo)(()=>o.filter(e=>Number.isFinite(e.start)),[o]),w=(0,V.useMemo)(()=>l.filter(e=>Number.isFinite(e.at)),[l]),T=(0,V.useMemo)(()=>c?[...c]:[...new Set(S.map(ln))].map(e=>({id:e,label:e===sn?`Events`:e})),[c,S]),E=(0,V.useMemo)(()=>{let e=[...S.flatMap(e=>[e.start,un(e)]),...w.map(e=>e.at)];if(e.length===0)return{end:1,start:0};let t=Math.min(...e),n=Math.max(...e);return{end:n>t?n:t+1,start:t}},[S,w]),D=gn(E,p,d),{axis:O,range:k}=D,A=S.length>0||w.length>0;(0,V.useEffect)(()=>{if(!A)return;let e=O.current;if(!e)return;let t=()=>_(e.getBoundingClientRect().width||1e3);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[O,A]),(0,V.useEffect)(()=>{m&&O.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[O,m]);let j=Math.max(1,k.end-k.start),M=e=>(e-k.start)/j*100,N=i?T:[{id:`overlay`,label:`All events`}],P=e?.origin??E.start,F=r?.minSpacingPx,I=j*(F!==void 0&&Number.isFinite(F)&&F>0?F:80)/g,L=[1e3,2e3,5e3,1e4,15e3,3e4,6e4,12e4,3e5,6e5,9e5,18e5,36e5].find(e=>e>=I)??Math.ceil(I/36e5)*36e5,R=[];for(let e=Math.ceil(k.start/L)*L;e<=k.end;e+=L)R.push(e);let z=v===null?null:k.start+v*j,ee=e=>{let t=un(e);if(t<k.start||e.start>k.end)return null;let n=Math.max(0,M(Math.max(e.start,k.start))),r=Math.max(.8,M(Math.min(t,k.end))-n),i=t<=e.start,o=`timeline-detail-${h}-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,s=cn(ln(e));return(0,H.jsxs)(`div`,{className:`absolute inset-y-0`,style:{left:`${n}%`},children:[(0,H.jsx)(`button`,{"aria-describedby":o,"aria-label":`${e.label}, ${i?`point event`:`span`}`,"aria-pressed":m===e.id,"aria-current":m===e.id?`true`:void 0,"data-turn-id":e.turnId,"data-tool-call-id":e.toolCallId,"data-event-index":e.eventIndex,className:B(`absolute top-0 h-5 border-2 border-card shadow-sm hover:opacity-80 focus-visible:z-20`,i?`w-5 -translate-x-1/2 rounded-full`:`min-w-1 rounded-md`,m===e.id&&`ring-2 ring-foreground ring-offset-1`,s),"data-lane-color":s,"data-selected":m===e.id?`true`:`false`,"data-timeline-shape":i?`point`:`span`,onBlur:()=>x(null),onClick:t=>{t.stopPropagation(),x(e.id),f?.(e)},onFocus:()=>x(e.id),onMouseEnter:()=>x(e.id),onMouseLeave:()=>x(null),style:{width:i?void 0:`${r}cqw`},type:`button`,children:i?(0,H.jsx)($e,{"aria-hidden":`true`,className:`m-auto size-2 fill-current text-white`}):null}),(0,H.jsx)(`span`,{className:B(`pointer-events-none absolute z-30 w-80 rounded-md bg-popover px-2.5 py-2 text-[10px] text-popover-foreground shadow-lg`,b===e.id?`block`:`sr-only`),id:o,role:b===e.id?`tooltip`:void 0,style:{top:`1.4rem`},children:hn(e,a?.(e))})]},e.id)};return(0,H.jsxs)(`section`,{"aria-label":s,className:`timeline rounded-xl border bg-card p-4`,children:[(0,H.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(`div`,{"aria-label":`Timeline legend`,className:`flex flex-wrap gap-3`,role:`list`,children:T.map(e=>(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,role:`listitem`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:B(`size-2 rounded-full`,cn(e.id))}),e.label]},e.id))}),(0,H.jsxs)(`div`,{className:`flex gap-1`,children:[(0,H.jsxs)(`button`,{"aria-label":i?`Collapse timeline`:`Expand timeline`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,onClick:()=>u?.(!i),type:`button`,children:[i?(0,H.jsx)(At,{"aria-hidden":`true`,className:`size-3`}):(0,H.jsx)(Ot,{"aria-hidden":`true`,className:`size-3`}),i?`Collapse`:`Expand`]}),(0,H.jsxs)(`button`,{"aria-label":`Reset timeline zoom`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted disabled:opacity-40`,disabled:!D.viewChanged,onClick:D.reset,type:`button`,children:[(0,H.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),` Reset zoom`]})]})]}),S.length===0&&w.length===0?(0,H.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No timeline events recorded.`}):(0,H.jsxs)(`div`,{"aria-label":`Timeline plot. Scroll to zoom or drag to select a range.`,className:`relative touch-none select-none overflow-hidden rounded-lg border bg-muted/40 pb-3 pt-7`,onPointerMove:e=>{let t=e.currentTarget.getBoundingClientRect();y(Math.min(1,Math.max(0,(e.clientX-t.left)/(t.width||1e3))))},onPointerLeave:()=>y(null),onPointerDown:e=>D.brushStart(e.clientX),onPointerUp:e=>D.finishBrush(e.clientX),onWheel:e=>{e.preventDefault(),D.zoom(e.clientX,e.deltaY)},ref:O,children:[n&&z!==null?(0,H.jsx)(`div`,{"aria-label":`Timeline crosshair`,className:`pointer-events-none absolute inset-y-0 z-30 border-l border-foreground`,style:{left:`${(v??0)*100}%`},children:(0,H.jsxs)(`span`,{className:`absolute top-0 whitespace-nowrap bg-popover text-[10px] text-popover-foreground`,style:{transform:(v??0)>.5?`translateX(-100%)`:void 0},children:[pn(z),` `,fn(z-P)]})}):null,(0,H.jsxs)(`div`,{className:`relative grid gap-2`,style:{containerType:`inline-size`},children:[N.map(e=>(0,H.jsxs)(`div`,{className:`relative h-6 border-b border-border/60`,"data-lane-id":e.id,"data-testid":`timeline-lane`,children:[i?(0,H.jsx)(`span`,{className:`sr-only`,children:e.label}):null,(i?S.filter(t=>ln(t)===e.id):S).map(ee)]},e.id)),w.map(e=>e.at<k.start||e.at>k.end?null:(0,H.jsxs)(`div`,{className:`pointer-events-none absolute inset-y-0 z-20`,style:{left:`${M(e.at)}%`},children:[(0,H.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-foreground/60`,"data-testid":`timeline-marker-line`}),(0,H.jsx)(`button`,{"aria-label":`${e.label}, marker`,"aria-pressed":m===e.id,className:B(`pointer-events-auto absolute bottom-full left-1/2 mb-1 flex size-5 -translate-x-1/2 items-center justify-center rounded-full bg-card text-foreground shadow`,m===e.id&&`ring-2 ring-foreground`),"data-selected":m===e.id?`true`:`false`,onClick:t=>{t.stopPropagation(),f?.(e)},type:`button`,children:e.icon??(0,H.jsx)(Bt,{"aria-hidden":`true`,className:`size-3`})})]},e.id)),typeof t==`number`&&Number.isFinite(t)&&t>=k.start&&t<=k.end?(0,H.jsx)(`span`,{"aria-label":`Timeline cursor`,className:`pointer-events-none absolute inset-y-0 z-10 w-px bg-primary`,"data-testid":`timeline-cursor`,style:{left:`${M(t)}%`}}):null]}),(0,H.jsx)(`div`,{className:`relative mt-2 h-4 font-mono text-[9px] text-subtle`,"data-testid":`timeline-axis`,"data-timeline-axis":!0,children:R.map(e=>(0,H.jsx)(`span`,{"data-tick-time":e,className:`absolute`,style:{left:`${M(e)}%`,transform:e===k.end?`translateX(-100%)`:void 0},children:mn(e,P)},e))})]})]})}var vn=Object.defineProperty,yn=(e,t)=>vn(e,`name`,{value:t,configurable:!0});function bn(e,t){let n=V.createContext(t);n.displayName=e+`Context`;let r=yn(e=>{let{children:t,...r}=e,i=V.useMemo(()=>r,Object.values(r));return(0,H.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=V.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return yn(i,`useContext`),[r,i]}yn(bn,`createContext`);function xn(e,t=[]){let n=[];function r(t,r){let i=V.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=yn(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=V.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=V.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return yn(s,`useContext`),[o,s]}yn(r,`createContext`);let i=yn(()=>{let t=n.map(e=>V.createContext(e));return yn(function(n){let r=n?.[e]||t;return V.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Sn(i,...t)]}yn(xn,`createContextScope`);function Sn(...e){let t=e[0];if(e.length===1)return t;let n=yn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return yn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return V.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}yn(Sn,`composeContextScopes`);var Cn=Object.defineProperty,wn=(e,t)=>Cn(e,`name`,{value:t,configurable:!0});function Tn(e){let t=e+`CollectionProvider`,[n,r]=xn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=wn(e=>{let{scope:t,children:n}=e,r=V.useRef(null),a=V.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=L(c),u=V.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(t,o(c,n).collectionRef);return(0,H.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=L(d),m=V.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=V.useRef(null),c=a(t,s),l=o(d,n);return V.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,H.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=o(e+`CollectionConsumer`,t);return V.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return wn(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}wn(Tn,`createCollection`);var En=new WeakMap,Dn=class e extends Map{static{wn(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],En.set(this,!0)}set(e,t){return En.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=An(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=On(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=On(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return On(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function On(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=kn(e,t);return n===-1?void 0:e[n]}wn(On,`at`);function kn(e,t){let n=e.length,r=An(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}wn(kn,`toSafeIndex`);function An(e){return e!==e||e===0?0:Math.trunc(e)}wn(An,`toSafeInteger`);function jn(e){let t=e+`CollectionProvider`,[n,r]=xn(t),[i,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Dn,setItemMap:wn(()=>void 0,`setItemMap`)}),s=wn(({state:e,...t})=>e?(0,H.jsx)(l,{...t,state:e}):(0,H.jsx)(c,{...t}),`CollectionProvider`);s.displayName=t;let c=wn(e=>{let t=g();return(0,H.jsx)(l,{...e,state:t})},`CollectionInit`);c.displayName=t+`Init`;let l=wn(e=>{let{scope:t,children:n,state:r}=e,o=V.useRef(null),[s,c]=V.useState(null),l=a(o,c),[u,d]=r;return V.useEffect(()=>{if(!s)return;let e=Fn(()=>{});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s]),(0,H.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:o,collectionElement:s,children:n})},`CollectionProviderImpl`);l.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=L(u),f=V.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(t,o(u,n).collectionRef);return(0,H.jsx)(d,{ref:i,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=L(p),h=V.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=V.useRef(null),[c,l]=V.useState(null),u=a(t,s,l),{setItemMap:d}=o(p,n),f=V.useRef(i);Mn(f.current,i)||(f.current=i);let h=f.current;return V.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(Pn):(t.set(c,{...e,element:c}),t.toSorted(Pn)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new Dn(e)))}},[c,h,d]),(0,H.jsx)(m,{"data-radix-collection-item":``,ref:u,children:r})});h.displayName=p;function g(){return V.useState(new Dn)}wn(g,`useInitCollection`);function _(t){let{itemMap:n}=o(e+`CollectionConsumer`,t);return n}return wn(_,`useCollection`),[{Provider:s,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}wn(jn,`createCollection`);function Mn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}wn(Mn,`shallowEqual`);function Nn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}wn(Nn,`isElementPreceding`);function Pn(e,t){return!e[1].element||!t[1].element?0:Nn(e[1].element,t[1].element)?-1:1}wn(Pn,`sortByDocumentPosition`);function Fn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}wn(Fn,`getChildListObserver`);var In=Object.defineProperty,Ln=(e,t)=>In(e,`name`,{value:t,configurable:!0}),Rn=!!(typeof window<`u`&&window.document&&window.document.createElement);function U(e,t,{checkForDefaultPrevented:n=!0}={}){return Ln(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Ln(U,`composeEventHandlers`);function zn(e){if(!Rn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Ln(zn,`getOwnerWindow`);function Bn(e){if(!Rn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Ln(Bn,`getOwnerDocument`);function Vn(e,t=!1){let{activeElement:n}=Bn(e);if(!n?.nodeName)return null;if(Hn(n)&&n.contentDocument)return Vn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Bn(n).getElementById(e);if(t)return t}}return n}Ln(Vn,`getActiveElement`);function Hn(e){return e.tagName===`IFRAME`}Ln(Hn,`isFrame`);var Un=globalThis?.document?V.useLayoutEffect:()=>{},Wn=Object.defineProperty,Gn=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Kn=V.useEffectEvent,qn=V.useInsertionEffect;function Jn(e){if(typeof Kn==`function`)return Kn(e);let t=V.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof qn==`function`?qn(()=>{t.current=e}):Un(()=>{t.current=e}),V.useMemo(()=>((...e)=>t.current?.(...e)),[])}Gn(Jn,`useEffectEvent`);var Yn=Object.defineProperty,Xn=(e,t)=>Yn(e,`name`,{value:t,configurable:!0}),Zn=V.useInsertionEffect||Un;function Qn({prop:e,defaultProp:t,onChange:n=Xn(()=>{},`onChange`),caller:r}){let[i,a,o]=$n({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,V.useCallback(t=>{if(s){let n=er(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Xn(Qn,`useControllableState`);function $n({defaultProp:e,onChange:t}){let[n,r]=V.useState(e),i=V.useRef(n),a=V.useRef(t);return Zn(()=>{a.current=t},[t]),V.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Xn($n,`useUncontrolledState`);function er(e){return typeof e==`function`}Xn(er,`isFunction`);var tr=Symbol(`RADIX:SYNC_STATE`);function nr(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Jn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=V.useReducer((t,n)=>{if(n.type===tr)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=V.useRef(p);V.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=V.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return V.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:tr,state:i})},[i,d.state,c]),[h,f]}Xn(nr,`useControllableStateReducer`);var rr=ut(Ne(),1),ir=Object.defineProperty,ar=(e,t)=>ir(e,`name`,{value:t,configurable:!0}),W=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=L(`Primitive.${t}`),r=V.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function or(e,t){e&&rr.flushSync(()=>e.dispatchEvent(t))}ar(or,`dispatchDiscreteCustomEvent`);var sr=Object.defineProperty,cr=(e,t)=>sr(e,`name`,{value:t,configurable:!0});function lr(e,t){return V.useReducer((e,n)=>t[e][n]??e,e)}cr(lr,`useStateMachine`);var ur=cr(e=>{let{present:t,children:n}=e,r=dr(t),i=typeof n==`function`?n({present:r.isPresent}):V.Children.only(n),a=pr(r.ref,hr(i));return typeof n==`function`||r.isPresent?V.cloneElement(i,{ref:a}):null},`Presence`);function dr(e){let[t,n]=V.useState(),r=V.useRef(null),i=V.useRef(e),a=V.useRef(`none`),o=V.useRef(void 0),[s,c]=lr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return V.useEffect(()=>{s===`mounted`?(a.current=o.current??mr(r.current),o.current=void 0):a.current=`none`},[s]),Un(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=mr(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Un(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=cr(a=>{let o=mr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=cr(e=>{e.target===t&&(a.current=mr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:V.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=mr(t)}else r.current=null;n(e)},[])}}cr(dr,`usePresence`);function fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}cr(fr,`setRef`);function pr(...e){let t=V.useRef(e);return t.current=e,V.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=fr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():fr(n[e],null)}}},[])}cr(pr,`useStableComposedRefs`);function mr(e){return e?.animationName||`none`}cr(mr,`getAnimationName`);function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}cr(hr,`getElementRef`);var gr=Object.defineProperty,_r=(e,t)=>gr(e,`name`,{value:t,configurable:!0}),vr=V.useId||(()=>void 0),yr=0;function br(e){let[t,n]=V.useState(vr());return Un(()=>{e||n(e=>e??String(yr++))},[e]),e||(t?`radix-${t}`:``)}_r(br,`useId`);var xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0}),Cr=`Collapsible`,[wr,Tr]=xn(Cr),[Er,Dr]=wr(Cr),Or=V.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Qn({prop:r,defaultProp:i??!1,onChange:o,caller:Cr});return(0,H.jsx)(Er,{scope:n,disabled:a,contentId:br(),open:c,onOpenToggle:V.useCallback(()=>l(e=>!e),[l]),children:(0,H.jsx)(W.div,{"data-state":Pr(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),kr=`CollapsibleTrigger`,Ar=V.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Dr(kr,n);return(0,H.jsx)(W.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Pr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:U(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),jr=`CollapsibleContent`,Mr=V.forwardRef(Sr(function(e,t){let{forceMount:n,...r}=e,i=Dr(jr,e.__scopeCollapsible);return(0,H.jsx)(ur,{present:n||i.open,children:({present:e})=>(0,H.jsx)(Nr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Nr=V.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Dr(jr,n),[c,l]=V.useState(r),u=V.useRef(null),d=a(t,u),f=V.useRef(0),p=f.current,m=V.useRef(0),h=m.current,g=s.open||c,_=V.useRef(g),v=V.useRef(void 0);return V.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Un(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[s.open,r]),(0,H.jsx)(W.div,{"data-state":Pr(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!g,...o,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Pr(e){return e?`open`:`closed`}Sr(Pr,`getState`);var Fr=Or,Ir=Ar,Lr=Mr,Rr=Object.defineProperty,zr=(e,t)=>Rr(e,`name`,{value:t,configurable:!0}),Br=V.createContext(void 0);function Vr(e){let t=V.useContext(Br);return e||t||`ltr`}zr(Vr,`useDirection`);var Hr=Object.defineProperty,Ur=(e,t)=>Hr(e,`name`,{value:t,configurable:!0}),Wr=`Accordion`,Gr=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[Kr,qr,Jr]=Tn(Wr),[Yr,Xr]=xn(Wr,[Jr,Tr]),Zr=Tr(),Qr=V.forwardRef(Ur(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,H.jsx)(Kr.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,H.jsx)(ii,{...a,ref:t}):(0,H.jsx)(ri,{...i,ref:t})})},`Accordion`)),[$r,ei]=Yr(Wr),[ti,ni]=Yr(Wr,{collapsible:!1}),ri=V.forwardRef(Ur(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Ur(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=Qn({prop:n,defaultProp:r??``,onChange:i,caller:Wr});return(0,H.jsx)($r,{scope:e.__scopeAccordion,value:V.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:V.useCallback(()=>a&&c(``),[a,c]),children:(0,H.jsx)(ti,{scope:e.__scopeAccordion,collapsible:a,children:(0,H.jsx)(si,{...o,ref:t})})})},`AccordionImplSingle`)),ii=V.forwardRef(Ur(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Ur(()=>{},`onValueChange`),...a}=e,[o,s]=Qn({prop:n,defaultProp:r??[],onChange:i,caller:Wr}),c=V.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=V.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,H.jsx)($r,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,H.jsx)(ti,{scope:e.__scopeAccordion,collapsible:!0,children:(0,H.jsx)(si,{...a,ref:t})})})},`AccordionImplMultiple`)),[ai,oi]=Yr(Wr),si=V.forwardRef(Ur(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:o=`vertical`,...s}=e,c=a(V.useRef(null),t),l=qr(n),u=Vr(i)===`ltr`,d=U(e.onKeyDown,e=>{if(!Gr.includes(e.key))return;let t=e.target,n=l().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let a=r,s=i-1,c=Ur(()=>{a=r+1,a>s&&(a=0)},`moveNext`),d=Ur(()=>{a=r-1,a<0&&(a=s)},`movePrev`);switch(e.key){case`Home`:a=0;break;case`End`:a=s;break;case`ArrowRight`:o===`horizontal`&&(u?c():d());break;case`ArrowDown`:o===`vertical`&&c();break;case`ArrowLeft`:o===`horizontal`&&(u?d():c());break;case`ArrowUp`:o===`vertical`&&d();break}n[a%i].ref.current?.focus()});return(0,H.jsx)(ai,{scope:n,disabled:r,direction:i,orientation:o,children:(0,H.jsx)(Kr.Slot,{scope:n,children:(0,H.jsx)(W.div,{...s,"data-orientation":o,ref:c,onKeyDown:r?void 0:d})})})},`AccordionImpl`)),ci=`AccordionItem`,[li,ui]=Yr(ci),di=V.forwardRef(Ur(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=oi(ci,n),o=ei(ci,n),s=Zr(n),c=br(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,H.jsx)(li,{scope:n,open:l,disabled:u,triggerId:c,children:(0,H.jsx)(Fr,{"data-orientation":a.orientation,"data-state":vi(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),fi=`AccordionHeader`,pi=V.forwardRef(Ur(function(e,t){let{__scopeAccordion:n,...r}=e,i=oi(Wr,n),a=ui(fi,n);return(0,H.jsx)(W.h3,{"data-orientation":i.orientation,"data-state":vi(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),mi=`AccordionTrigger`,hi=V.forwardRef(Ur(function(e,t){let{__scopeAccordion:n,...r}=e,i=oi(Wr,n),a=ui(mi,n),o=ni(mi,n),s=Zr(n);return(0,H.jsx)(Kr.ItemSlot,{scope:n,children:(0,H.jsx)(Ir,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),gi=`AccordionContent`,_i=V.forwardRef(Ur(function(e,t){let{__scopeAccordion:n,...r}=e,i=oi(Wr,n),a=ui(gi,n),o=Zr(n);return(0,H.jsx)(Lr,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})},`AccordionContent`));function vi(e){return e?`open`:`closed`}Ur(vi,`getState`);var yi=Qr,bi=di,xi=pi,Si=hi,Ci=_i;function wi({...e}){return(0,H.jsx)(yi,{"data-slot":`accordion`,...e})}function Ti({className:e,...t}){return(0,H.jsx)(bi,{"data-slot":`accordion-item`,className:B(`border-b last:border-b-0`,e),...t})}function Ei({className:e,children:t,...n}){return(0,H.jsx)(xi,{className:`flex`,children:(0,H.jsxs)(Si,{"data-slot":`accordion-trigger`,className:B(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,H.jsx)(Ot,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function Di({className:e,children:t,...n}){return(0,H.jsx)(Ci,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,H.jsx)(`div`,{className:B(`pt-0 pb-4`,e),children:t})})}var Oi=y(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive bg-destructive-surface text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function ki({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:B(Oi({variant:t}),e),...n})}function Ai({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-title`,className:B(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function ji({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-description`,className:B(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Mi=Object.defineProperty,Ni=(e,t)=>Mi(e,`name`,{value:t,configurable:!0});function Pi(e){let t=V.useRef(e);return V.useEffect(()=>{t.current=e}),V.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ni(Pi,`useCallbackRef`);var Fi=Object.defineProperty,Ii=(e,t)=>Fi(e,`name`,{value:t,configurable:!0}),Li=`Avatar`,[Ri,zi]=xn(Li),Bi=[0,()=>void 0],[Vi,Hi]=Ri(Li),Ui=V.forwardRef(Ii(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=V.useState(`idle`),[o,s]=Ji();return(0,H.jsx)(Vi,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,H.jsx)(W.span,{...r,ref:t})})},`Avatar`)),Wi=`AvatarFallback`,Gi=V.forwardRef(Ii(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Hi(Wi,n),[o,s]=V.useState(r===void 0);return V.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,H.jsx)(W.span,{...i,ref:t}):null},`AvatarFallback`));function Ki(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Un(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Ii(e=>{let t=e.currentTarget;n(qi(t))},`handleLoad`),o=Ii(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(qi(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Ii(Ki,`useImageLoadingStatus`);function qi(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Ii(qi,`getImageLoadingStatus`);function Ji(){return Bi}Ii(Ji,`useImageCount`);function Yi(e){}Ii(Yi,`useUpdateImageCount`);function Xi({className:e,size:t=`default`,...n}){return(0,H.jsx)(Ui,{"data-slot":`avatar`,"data-size":t,className:B(`group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6`,e),...n})}function Zi({className:e,...t}){return(0,H.jsx)(Gi,{"data-slot":`avatar-fallback`,className:B(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Qi({className:e,...t}){return(0,H.jsx)(`img`,{className:B(`aspect-square size-full object-cover`,e),"data-slot":`avatar-image`,...t})}var $i=y(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`border border-destructive bg-destructive-surface text-destructive hover:bg-destructive-surface/80 focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function G({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,H.jsx)(r?T:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:B($i({variant:t,size:n,className:e})),...i})}function ea({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card`,className:B(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function ta({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-content`,className:B(`px-6`,e),...t})}var na=Object.defineProperty,ra=(e,t)=>na(e,`name`,{value:t,configurable:!0}),ia=`dismissableLayer.update`,aa=`dismissableLayer.pointerDownOutside`,oa=`dismissableLayer.focusOutside`,sa,ca=V.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),la=V.forwardRef(ra(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=V.useContext(ca),[f,p]=V.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=V.useState({}),g=a(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=V.useRef(!1),w=fa(e=>{o?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:V.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=pa(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),E=f?b===_.length-1:!1,D=Pi(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return V.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),V.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(sa=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ma(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=sa))}},[f,m,n,d]),V.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ma())},[f,d]),V.useEffect(()=>{let e=ra(()=>h({}),`handleUpdate`);return document.addEventListener(ia,e),()=>document.removeEventListener(ia,e)},[]),(0,H.jsx)(W.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:U(e.onFocusCapture,T.onFocusCapture),onBlurCapture:U(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ua(){let e=V.useContext(ca),[t,n]=V.useState(null);return V.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ra(ua,`useDismissableLayerSurface`);var da=ra(()=>!0,`IS_TRUE`);function fa(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=da}=t,s=Pi(e),c=V.useRef(!1),l=V.useRef(!1),u=V.useRef(new Map),d=V.useRef(()=>{});return V.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}ra(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}ra(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}ra(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}ra(p,`handleInteractionBubble`);let m=ra(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||ha(aa,s,p,{discrete:!0})};if(ra(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:ra(()=>c.current=!0,`onPointerDownCapture`)}}ra(fa,`usePointerDownOutside`);function pa(e,t=globalThis?.document){let n=Pi(e),r=V.useRef(!1);return V.useEffect(()=>{let e=ra(e=>{e.target&&!r.current&&ha(oa,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:ra(()=>r.current=!0,`onFocusCapture`),onBlurCapture:ra(()=>r.current=!1,`onBlurCapture`)}}ra(pa,`useFocusOutside`);function ma(){let e=new CustomEvent(ia);document.dispatchEvent(e)}ra(ma,`dispatchUpdate`);function ha(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?or(i,a):i.dispatchEvent(a)}ra(ha,`handleAndDispatchCustomEvent`);var ga=Object.defineProperty,_a=(e,t)=>ga(e,`name`,{value:t,configurable:!0}),va=`focusScope.autoFocusOnMount`,ya=`focusScope.autoFocusOnUnmount`,ba={bubbles:!1,cancelable:!0},xa=V.forwardRef(_a(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[c,l]=V.useState(null),u=Pi(i),d=Pi(o),f=V.useRef(null),p=a(t,l),m=V.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:Oa(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||Oa(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Oa(c)};_a(e,`handleFocusIn`),_a(t,`handleFocusOut`),_a(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),V.useEffect(()=>{if(c){ka.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(va,ba);c.addEventListener(va,u),c.dispatchEvent(t),t.defaultPrevented||(Sa(Ma(wa(c)),{select:!0}),document.activeElement===e&&Oa(c))}return()=>{c.removeEventListener(va,u),setTimeout(()=>{let t=new CustomEvent(ya,ba);c.addEventListener(ya,d),c.dispatchEvent(t),t.defaultPrevented||Oa(e??document.body,{select:!0}),c.removeEventListener(ya,d),ka.remove(m)},0)}}},[c,u,d,m]);let h=V.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ca(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Oa(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Oa(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,H.jsx)(W.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})},`FocusScope`));function Sa(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Oa(r,{select:t}),document.activeElement!==n)return}_a(Sa,`focusFirst`);function Ca(e){let t=wa(e);return[Ta(t,e),Ta(t.reverse(),e)]}_a(Ca,`getTabbableEdges`);function wa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:_a(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}_a(wa,`getTabbableCandidates`);function Ta(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ea(r,{upTo:t})))return r}_a(Ta,`findVisible`);function Ea(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}_a(Ea,`isHidden`);function Da(e){return e instanceof HTMLInputElement&&`select`in e}_a(Da,`isSelectableInput`);function Oa(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Da(e)&&t&&e.select()}}_a(Oa,`focus`);var ka=Aa();function Aa(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ja(e,t),e.unshift(t)},remove(t){e=ja(e,t),e[0]?.resume()}}}_a(Aa,`createFocusScopesStack`);function ja(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}_a(ja,`arrayRemove`);function Ma(e){return e.filter(e=>e.tagName!==`A`)}_a(Ma,`removeLinks`);var Na=Object.defineProperty,Pa=V.forwardRef(((e,t)=>Na(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=V.useState(!1);Un(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?rr.createPortal((0,H.jsx)(W.div,{...r,ref:t}),o):null},`Portal`)),Fa=Object.defineProperty,Ia=(e,t)=>Fa(e,`name`,{value:t,configurable:!0}),La=0,Ra=null;function za(e){return Ba(),e.children}Ia(za,`FocusGuards`);function Ba(){V.useEffect(()=>{Ra||={start:Va(),end:Va()};let{start:e,end:t}=Ra;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),La++,()=>{La===1&&(Ra?.start.remove(),Ra?.end.remove(),Ra=null),La=Math.max(0,La-1)}},[])}Ia(Ba,`useFocusGuards`);function Va(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ia(Va,`createFocusGuard`);var Ha=function(){return Ha=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ha.apply(this,arguments)};function Ua(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Wa(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ga=`right-scroll-bar-position`,Ka=`width-before-scroll-bar`,qa=`with-scroll-bars-hidden`,Ja=`--removed-body-scroll-bar-size`;function Ya(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Xa(e,t){var n=(0,V.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Za=typeof window<`u`?V.useLayoutEffect:V.useEffect,Qa=new WeakMap;function $a(e,t){var n=Xa(t||null,function(t){return e.forEach(function(e){return Ya(e,t)})});return Za(function(){var t=Qa.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ya(e,null)}),i.forEach(function(e){r.has(e)||Ya(e,a)})}Qa.set(n,e)},[e]),n}function eo(e){return e}function to(e,t){t===void 0&&(t=eo);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function no(e){e===void 0&&(e={});var t=to(null);return t.options=Ha({async:!0,ssr:!1},e),t}var ro=function(e){var t=e.sideCar,n=Ua(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return V.createElement(r,Ha({},n))};ro.isSideCarExport=!0;function io(e,t){return e.useMedium(t),ro}var ao=no(),oo=function(){},so=V.forwardRef(function(e,t){var n=V.useRef(null),r=V.useState({onScrollCapture:oo,onWheelCapture:oo,onTouchMoveCapture:oo}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ua(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=$a([n,t]),C=Ha(Ha({},b),i);return V.createElement(V.Fragment,null,u&&V.createElement(x,{sideCar:ao,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?V.cloneElement(V.Children.only(s),Ha(Ha({},C),{ref:S})):V.createElement(v,Ha({},C,{className:c,ref:S}),s))});so.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},so.classNames={fullWidth:Ka,zeroRight:Ga};var co,lo=function(){if(co)return co;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function uo(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lo();return t&&e.setAttribute(`nonce`,t),e}function fo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function po(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var mo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uo())&&(fo(t,n),po(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ho=function(){var e=mo();return function(t,n){V.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},go=function(){var e=ho();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},_o={left:0,top:0,right:0,gap:0},vo=function(e){return parseInt(e||``,10)||0},yo=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[vo(n),vo(r),vo(i)]},bo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return _o;var t=yo(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xo=go(),So=`data-scroll-locked`,Co=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${qa} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${So}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${Ga} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${Ka} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${Ga} .${Ga} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${Ka} .${Ka} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${So}] {
36
+ ${Ja}: ${s}px;
37
+ }
38
+ `},wo=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},To=function(){V.useEffect(function(){return document.body.setAttribute(So,(wo()+1).toString()),function(){var e=wo()-1;e<=0?document.body.removeAttribute(So):document.body.setAttribute(So,e.toString())}},[])},Eo=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;To();var a=V.useMemo(function(){return bo(i)},[i]);return V.createElement(xo,{styles:Co(a,!t,i,n?``:`!important`)})},Do=!1;if(typeof window<`u`)try{var Oo=Object.defineProperty({},"passive",{get:function(){return Do=!0,!0}});window.addEventListener(`test`,Oo,Oo),window.removeEventListener(`test`,Oo,Oo)}catch{Do=!1}var ko=Do?{passive:!1}:!1,Ao=function(e){return e.tagName===`TEXTAREA`},jo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ao(e)&&n[t]===`visible`)},Mo=function(e){return jo(e,`overflowY`)},No=function(e){return jo(e,`overflowX`)},Po=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Lo(e,r)){var i=Ro(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fo=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Io=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Lo=function(e,t){return e===`v`?Mo(t):No(t)},Ro=function(e,t){return e===`v`?Fo(t):Io(t)},zo=function(e,t){return e===`h`&&t===`rtl`?-1:1},Bo=function(e,t,n,r,i){var a=zo(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ro(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Lo(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Vo=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ho=function(e){return[e.deltaX,e.deltaY]},Uo=function(e){return e&&`current`in e?e.current:e},Wo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Go=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},Ko=0,qo=[];function Jo(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),i=V.useState(Ko++)[0],a=V.useState(go)[0],o=V.useRef(e);V.useEffect(function(){o.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Wa([e.lockRef.current],(e.shards||[]).map(Uo),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=V.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Vo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Po(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Po(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Bo(h,t,e,h===`h`?s:c,!0)},[]),c=V.useCallback(function(e){var n=e;if(!(!qo.length||qo[qo.length-1]!==a)){var r=`deltaY`in n?Ho(n):Vo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Wo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Uo).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=V.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Yo(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=V.useCallback(function(e){n.current=Vo(e),r.current=void 0},[]),d=V.useCallback(function(t){l(t.type,Ho(t),t.target,s(t,e.lockRef.current))},[]),f=V.useCallback(function(t){l(t.type,Vo(t),t.target,s(t,e.lockRef.current))},[]);V.useEffect(function(){return qo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ko),document.addEventListener(`touchmove`,c,ko),document.addEventListener(`touchstart`,u,ko),function(){qo=qo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ko),document.removeEventListener(`touchmove`,c,ko),document.removeEventListener(`touchstart`,u,ko)}},[]);var p=e.removeScrollBar,m=e.inert;return V.createElement(V.Fragment,null,m?V.createElement(a,{styles:Go(i)}):null,p?V.createElement(Eo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xo=io(ao,Jo),Zo=V.forwardRef(function(e,t){return V.createElement(so,Ha({},e,{ref:t,sideCar:Xo}))});Zo.classNames=so.classNames;var Qo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},$o=new WeakMap,es=new WeakMap,ts={},ns=0,rs=function(e){return e&&(e.host||rs(e.parentNode))},is=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=rs(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},as=function(e,t,n,r){var i=is(t,Array.isArray(e)?e:[e]);ts[n]||(ts[n]=new WeakMap);var a=ts[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=($o.get(e)||0)+1,l=(a.get(e)||0)+1;$o.set(e,c),a.set(e,l),o.push(e),c===1&&i&&es.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ns++,function(){o.forEach(function(e){var t=$o.get(e)-1,i=a.get(e)-1;$o.set(e,t),a.set(e,i),t||(es.has(e)||e.removeAttribute(r),es.delete(e)),i||e.removeAttribute(n)}),ns--,ns||($o=new WeakMap,$o=new WeakMap,es=new WeakMap,ts={})}},os=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),as(r,i,n,`aria-hidden`)):function(){return null}},ss=Object.defineProperty,cs=(e,t)=>ss(e,`name`,{value:t,configurable:!0}),ls=`Dialog`,[us,ds]=xn(ls),[fs,ps]=us(ls),ms=cs(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=V.useRef(null),c=V.useRef(null),[l,u]=Qn({prop:r,defaultProp:i??!1,onChange:a,caller:ls}),[d,f]=V.useState(0),[p,m]=V.useState(0);return(0,H.jsx)(fs,{scope:t,triggerRef:s,contentRef:c,contentId:br(),titleId:br(),descriptionId:br(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:V.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),hs=`DialogPortal`,[gs,_s]=us(hs,{forceMount:void 0}),vs=cs(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ps(hs,t);return(0,H.jsx)(gs,{scope:t,forceMount:n,children:V.Children.map(r,e=>(0,H.jsx)(ur,{present:n||a.open,children:(0,H.jsx)(Pa,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ys=`DialogOverlay`,bs=V.forwardRef(cs(function(e,t){let n=_s(ys,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ps(ys,e.__scopeDialog);return a.modal?(0,H.jsx)(ur,{present:r||a.open,children:(0,H.jsx)(Ss,{...i,ref:t})}):null},`DialogOverlay`)),xs=L(`DialogOverlay.RemoveScroll`),Ss=V.forwardRef(cs(function(e,t){let{__scopeDialog:n,...r}=e,i=ps(ys,n),o=a(t,ua());return(0,H.jsx)(Zo,{as:xs,allowPinchZoom:!0,shards:[i.contentRef],children:(0,H.jsx)(W.div,{"data-state":Ps(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Cs=`DialogContent`,ws=V.forwardRef(cs(function(e,t){let n=_s(Cs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ps(Cs,e.__scopeDialog);return(0,H.jsx)(ur,{present:r||a.open,children:a.modal?(0,H.jsx)(Ts,{...i,ref:t}):(0,H.jsx)(Es,{...i,ref:t})})},`DialogContent`)),Ts=V.forwardRef(cs(function(e,t){let n=ps(Cs,e.__scopeDialog),r=V.useRef(null),i=a(t,n.contentRef,r);return V.useEffect(()=>{let e=r.current;if(e)return os(e)},[]),(0,H.jsx)(Ds,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Es=V.forwardRef(cs(function(e,t){let n=ps(Cs,e.__scopeDialog),r=V.useRef(!1),i=V.useRef(!1);return(0,H.jsx)(Ds,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ds=V.forwardRef(cs(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ps(Cs,n);return Ba(),(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(la,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ps(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Os=`DialogTitle`,ks=V.forwardRef(cs(function(e,t){let{__scopeDialog:n,...r}=e,i=ps(Os,n),{setTitleCount:a}=i;return Un(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(W.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),As=`DialogDescription`,js=V.forwardRef(cs(function(e,t){let{__scopeDialog:n,...r}=e,i=ps(As,n),{setDescriptionCount:a}=i;return Un(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(W.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Ms=`DialogClose`,Ns=V.forwardRef(cs(function(e,t){let{__scopeDialog:n,...r}=e,i=ps(Ms,n);return(0,H.jsx)(W.button,{type:`button`,...r,ref:t,onClick:U(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ps(e){return e?`open`:`closed`}cs(Ps,`getState`);function Fs({...e}){return(0,H.jsx)(ms,{"data-slot":`dialog`,...e})}function Is({...e}){return(0,H.jsx)(vs,{"data-slot":`dialog-portal`,...e})}function Ls({...e}){return(0,H.jsx)(Ns,{"data-slot":`dialog-close`,...e})}function Rs({className:e,...t}){return(0,H.jsx)(bs,{"data-slot":`dialog-overlay`,className:B(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function zs({className:e,children:t,showCloseButton:n=!0,...r}){return(0,H.jsxs)(Is,{"data-slot":`dialog-portal`,children:[(0,H.jsx)(Rs,{}),(0,H.jsxs)(ws,{"data-slot":`dialog-content`,className:B(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,H.jsxs)(Ns,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,H.jsx)(an,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Bs({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-header`,className:B(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Vs({className:e,showCloseButton:t=!1,children:n,...r}){return(0,H.jsxs)(`div`,{"data-slot":`dialog-footer`,className:B(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,H.jsx)(Ns,{asChild:!0,children:(0,H.jsx)(G,{variant:`outline`,children:`Close`})})]})}function Hs({className:e,...t}){return(0,H.jsx)(ks,{"data-slot":`dialog-title`,className:B(`text-lg leading-none font-semibold`,e),...t})}function Us({className:e,...t}){return(0,H.jsx)(js,{"data-slot":`dialog-description`,className:B(`text-sm text-muted-foreground`,e),...t})}function Ws({className:e,type:t,...n}){return(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:B(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}var Gs=Object.defineProperty,Ks=V.forwardRef(((e,t)=>Gs(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,H.jsx)(W.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function qs({className:e,...t}){return(0,H.jsx)(Ks,{"data-slot":`label`,className:B(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Js=[`top`,`right`,`bottom`,`left`],Ys=Math.min,Xs=Math.max,Zs=Math.round,Qs=Math.floor,$s=e=>({x:e,y:e}),ec={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function tc(e,t,n){return Xs(e,Ys(t,n))}function nc(e,t){return typeof e==`function`?e(t):e}function rc(e){return e.split(`-`)[0]}function ic(e){return e.split(`-`)[1]}function ac(e){return e===`x`?`y`:`x`}function oc(e){return e===`y`?`height`:`width`}function sc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function cc(e){return ac(sc(e))}function lc(e,t,n){n===void 0&&(n=!1);let r=ic(e),i=cc(e),a=oc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=vc(o)),[o,vc(o)]}function uc(e){let t=vc(e);return[dc(e),t,dc(t)]}function dc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fc=[`left`,`right`],pc=[`right`,`left`],mc=[`top`,`bottom`],hc=[`bottom`,`top`];function gc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pc:fc:t?fc:pc;case`left`:case`right`:return t?mc:hc;default:return[]}}function _c(e,t,n,r){let i=ic(e),a=gc(rc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dc)))),a}function vc(e){let t=rc(e);return ec[t]+e.slice(t.length)}function yc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function bc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:yc(e)}function xc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Sc(e,t,n){let{reference:r,floating:i}=e,a=sc(t),o=cc(t),s=oc(o),c=rc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ic(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Cc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=nc(t,e),p=bc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=xc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var wc=50,Tc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Cc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Sc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<wc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Sc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ec=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=nc(e,t)||{};if(l==null)return{};let d=bc(u),f={x:n,y:r},p=cc(i),m=oc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ys(d[_],T),D=Ys(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=tc(E,k,O),j=!c.arrow&&ic(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Dc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=nc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=rc(r),_=sc(o),v=rc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[vc(o)]:uc(o)),x=p!==`none`;!d&&x&&b.push(..._c(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=lc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==sc(t))||T.every(e=>sc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=sc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Oc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kc(e){return Js.some(t=>e[t]>=0)}var Ac=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=nc(e,t);switch(i){case`referenceHidden`:{let e=Oc(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kc(e)}}}case`escaped`:{let e=Oc(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kc(e)}}}default:return{}}}}},jc=new Set([`left`,`top`]);async function Mc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rc(n),s=ic(n),c=sc(n)===`y`,l=jc.has(o)?-1:1,u=a&&c?-1:1,d=nc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Nc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Mc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Pc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=nc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=sc(i),p=ac(f),m=u[p],h=u[f],g=(e,t)=>tc(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Fc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=nc(e,t),u={x:n,y:r},d=sc(i),f=ac(d),p=u[f],m=u[d],h=nc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=jc.has(rc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ic=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=nc(e,t),c=await i.detectOverflow(t,s),l=rc(n),u=ic(n),d=sc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ys(p-c[m],g),y=Ys(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Xs(c.left,c.right):S=p-2*Xs(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Lc(){return typeof window<`u`}function Rc(e){return Vc(e)?(e.nodeName||``).toLowerCase():`#document`}function zc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bc(e){return((Vc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Vc(e){return Lc()?e instanceof Node||e instanceof zc(e).Node:!1}function Hc(e){return Lc()?e instanceof Element||e instanceof zc(e).Element:!1}function Uc(e){return Lc()?e instanceof HTMLElement||e instanceof zc(e).HTMLElement:!1}function Wc(e){return!Lc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof zc(e).ShadowRoot}function Gc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=nl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Kc(e){return/^(table|td|th)$/.test(Rc(e))}function qc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Jc=/transform|translate|scale|rotate|perspective|filter/,Yc=/paint|layout|strict|content/,Xc=e=>!!e&&e!==`none`,Zc;function Qc(e){let t=Hc(e)?nl(e):e;return Xc(t.transform)||Xc(t.translate)||Xc(t.scale)||Xc(t.rotate)||Xc(t.perspective)||!el()&&(Xc(t.backdropFilter)||Xc(t.filter))||Jc.test(t.willChange||``)||Yc.test(t.contain||``)}function $c(e){let t=il(e);for(;Uc(t)&&!tl(t);){if(Qc(t))return t;if(qc(t))return null;t=il(t)}return null}function el(){return Zc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Zc}function tl(e){return/^(html|body|#document)$/.test(Rc(e))}function nl(e){return zc(e).getComputedStyle(e)}function rl(e){return Hc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(Rc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Wc(e)&&e.host||Bc(e);return Wc(t)?t.host:t}function al(e){let t=il(e);return tl(t)?(e.ownerDocument||e).body:Uc(t)&&Gc(t)?t:al(t)}function ol(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=al(e),i=r===e.ownerDocument?.body,a=zc(r);if(i){let e=sl(a);return t.concat(a,a.visualViewport||[],Gc(r)?r:[],e&&n?ol(e):[])}else return t.concat(r,ol(r,[],n))}function sl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cl(e){let t=nl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Uc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Zs(n)!==a||Zs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ll(e){return Hc(e)?e:e.contextElement}function ul(e){let t=ll(e);if(!Uc(t))return $s(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=cl(t),o=(a?Zs(n.width):n.width)/r,s=(a?Zs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var dl=$s(0);function fl(e){let t=zc(e);return!el()||!t.visualViewport?dl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===zc(e)}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ll(e),o=$s(1);t&&(r?Hc(r)&&(o=ul(r)):o=ul(e));let s=pl(a,n,r)?fl(a):$s(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=zc(a),t=Hc(r)?zc(r):r,n=e,i=sl(n);for(;i&&t!==n;){let e=ul(i),t=i.getBoundingClientRect(),r=nl(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=zc(i),i=sl(n)}}return xc({width:u,height:d,x:c,y:l})}function hl(e,t){let n=rl(e).scrollLeft;return t?t.left+n:ml(Bc(e)).left+n}function gl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hl(e,n),y:n.top+t.scrollTop}}function _l(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Bc(r),s=t?qc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$s(1),u=$s(0),d=Uc(r);if((d||!a)&&((Rc(r)!==`body`||Gc(o))&&(c=rl(r)),d)){let e=ml(r);l=ul(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gl(o,c):$s(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function vl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yl(e){let t=rl(e),n=e.ownerDocument.body,r=Xs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+hl(e),o=-t.scrollTop;return nl(n).direction===`rtl`&&(a+=Xs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var bl=25;function xl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=zc(e),a=Bc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!el()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(hl(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=bl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Sl(e,t){let n=ml(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ul(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=xl(e,n,t);else if(t===`document`)r=yl(Bc(e));else if(Hc(t))r=Sl(t,n);else{let n=fl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xc(r)}function wl(e,t){let n=t.get(e);if(n)return n;let r=ol(e,[],!1).filter(e=>Hc(e)&&Rc(e)!==`body`),i=null,a=nl(e).position===`fixed`,o=a?il(e):e;for(;Hc(o)&&!tl(o);){let e=nl(o),t=Qc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=il(o)}return t.set(e,r),r}function Tl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?qc(t)?[]:wl(t,this._c):[].concat(n),r],o=Cl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Cl(t,a[e],i);s=Xs(n.top,s),c=Ys(n.right,c),l=Ys(n.bottom,l),u=Xs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function El(e){let{width:t,height:n}=cl(e);return{width:t,height:n}}function Dl(e,t,n){let r=Uc(t),i=Bc(t),a=n===`fixed`,o=ml(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$s(0);if((r||!a)&&((Rc(t)!==`body`||Gc(i))&&(s=rl(t)),r)){let e=ml(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=hl(i));let l=i&&!r&&!a?gl(i,s):$s(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ol(e){return nl(e).position===`static`}function kl(e,t){if(!Uc(e)||nl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Bc(e)===n&&(n=n.ownerDocument.body),n}function Al(e,t){let n=zc(e);if(qc(e))return n;if(!Uc(e)){let t=il(e);for(;t&&!tl(t);){if(Hc(t)&&!Ol(t))return t;t=il(t)}return n}let r=kl(e,t);for(;r&&Kc(r)&&Ol(r);)r=kl(r,t);return r&&tl(r)&&Ol(r)&&!Qc(r)?n:r||$c(e)||n}var jl=async function(e){let t=this.getOffsetParent||Al,n=this.getDimensions,r=await n(e.floating);return{reference:Dl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ml(e){return nl(e).direction===`rtl`}var Nl={convertOffsetParentRelativeRectToViewportRelativeRect:_l,getDocumentElement:Bc,getClippingRect:Tl,getOffsetParent:Al,getElementRects:jl,getClientRects:vl,getDimensions:El,getScale:ul,isElement:Hc,isRTL:Ml};function Pl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fl(e,t,n){let r=null,i,a=Bc(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Qs(d),h=Qs(a.clientWidth-(u+f)),g=Qs(a.clientHeight-(d+p)),_=Qs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Xs(0,Ys(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Pl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=zc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Il(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ll(e),u=i||a?[...l?ol(l):[],...t?ol(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ml(e):null;c&&g();function g(){let t=ml(e);h&&!Pl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ll=Nc,Rl=Pc,zl=Dc,Bl=Ic,Vl=Ac,Hl=Ec,Ul=Fc,Wl=(e,t,n)=>{let r=new Map,i=n??{},a={...Nl,...i.platform,_c:r};return Tc(e,t,{...i,platform:a})},Gl=typeof document<`u`?V.useLayoutEffect:function(){};function Kl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ql(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jl(e,t){let n=ql(e);return Math.round(t*n)/n}function Yl(e){let t=V.useRef(e);return Gl(()=>{t.current=e}),t}function Xl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=V.useState(r);Kl(f,r)||p(r);let[m,h]=V.useState(null),[g,_]=V.useState(null),v=V.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=V.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=V.useRef(null),C=V.useRef(null),w=V.useRef(u),T=c!=null,E=Yl(c),D=Yl(i),O=Yl(l),k=V.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Wl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Kl(w.current,t)&&(w.current=t,rr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Gl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=V.useRef(!1);Gl(()=>(A.current=!0,()=>{A.current=!1}),[]),Gl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=V.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=V.useMemo(()=>({reference:b,floating:x}),[b,x]),N=V.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Jl(M.floating,u.x),r=Jl(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ql(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return V.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Zl=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Hl({element:r.current,padding:i}).fn(n):r?Hl({element:r,padding:i}).fn(n):{}}}},Ql=(e,t)=>{let n=Ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},$l=(e,t)=>{let n=Rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},eu=(e,t)=>({fn:Ul(e).fn,options:[e,t]}),tu=(e,t)=>{let n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{let n=Bl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ru=(e,t)=>{let n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{let n=Zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},au=Object.defineProperty,ou=V.forwardRef(((e,t)=>au(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,H.jsx)(W.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),su=Object.defineProperty,cu=(e,t)=>su(e,`name`,{value:t,configurable:!0});function lu(e){let[t,n]=V.useState(void 0);return Un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}cu(lu,`useSize`);var uu=Object.defineProperty,du=(e,t)=>uu(e,`name`,{value:t,configurable:!0}),fu=`Popper`,[pu,mu]=xn(fu),[hu,gu]=pu(fu),_u=du(e=>{let{__scopePopper:t,children:n}=e,[r,i]=V.useState(null),[a,o]=V.useState(void 0);return(0,H.jsx)(hu,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),vu=`PopperAnchor`,yu=V.forwardRef(du(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,o=gu(vu,n),s=V.useRef(null),c=o.onAnchorChange,l=a(t,V.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=V.useRef(null);V.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=o.placementState&&ku(o.placementState),f=d?.[0],p=d?.[1];return r?null:(0,H.jsx)(W.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),bu=`PopperContent`,[xu,Su]=pu(bu),Cu=V.forwardRef(du(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=gu(bu,n),[v,y]=V.useState(null),b=a(t,y),[x,S]=V.useState(null),C=lu(x),w=C?.width??0,T=C?.height??0,E=r+(o===`center`?``:`-`+o),D=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],k=O.length>0,A={padding:D,boundary:O.filter(Du),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Xl({strategy:`fixed`,placement:E,whileElementsMounted:du((...e)=>Il(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Ql({mainAxis:i+T,alignmentAxis:s}),l&&$l({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?eu():void 0,...A}),l&&tu({...A}),nu({...A,apply:du(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&iu({element:x,padding:c}),Ou({arrowWidth:w,arrowHeight:T}),p&&ru({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=_.setPlacementState;Un(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,R]=ku(N),z=Pi(h);Un(()=>{P&&z?.()},[P,z]);let ee=F.arrow?.x,te=F.arrow?.y,ne=F.arrow?.centerOffset!==0,[re,ie]=V.useState();return Un(()=>{v&&ie(window.getComputedStyle(v).zIndex)},[v]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(xu,{scope:n,placedSide:L,placedAlign:R,onArrowChange:S,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:(0,H.jsx)(W.div,{"data-side":L,"data-align":R,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),wu=`PopperArrow`,Tu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Eu=V.forwardRef(du(function(e,t){let{__scopePopper:n,...r}=e,i=Su(wu,n),a=Tu[i.placedSide];return(0,H.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,H.jsx)(ou,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Du(e){return e!==null}du(Du,`isNotNull`);var Ou=du(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ku(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ku(e){let[t,n=`center`]=e.split(`-`);return[t,n]}du(ku,`getSideAndAlignFromPlacement`);var Au=_u,ju=yu,Mu=Cu,Nu=Eu,Pu=Object.defineProperty,Fu=(e,t)=>Pu(e,`name`,{value:t,configurable:!0});function Iu(e,[t,n]){return Math.min(n,Math.max(t,e))}Fu(Iu,`clamp`);var Lu=Object.defineProperty,K=(e,t)=>Lu(e,`name`,{value:t,configurable:!0});function Ru(e,t){return V.useReducer((e,n)=>t[e][n]??e,e)}K(Ru,`useStateMachine`);var zu=`ScrollArea`,[Bu,Vu]=xn(zu),[Hu,Uu]=Bu(zu),Wu=V.forwardRef(K(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:o=600,...s}=e,[c,l]=V.useState(null),[u,d]=V.useState(null),[f,p]=V.useState(null),[m,h]=V.useState(null),[g,_]=V.useState(null),[v,y]=V.useState(0),[b,x]=V.useState(0),[S,C]=V.useState(!1),[w,T]=V.useState(!1),E=a(t,l),D=Vr(i);return(0,H.jsx)(Hu,{scope:n,type:r,dir:D,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,H.jsx)(W.div,{dir:D,...s,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),Gu=`ScrollAreaViewport`,Ku=V.forwardRef(K(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=Uu(Gu,n),c=a(t,V.useRef(null),s.onViewportChange);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(qu,{nonce:i}),(0,H.jsx)(W.div,{"data-radix-scroll-area-viewport":``,...o,ref:c,style:{overflowX:s.scrollbarXEnabled?`scroll`:`hidden`,overflowY:s.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,H.jsx)(`div`,{ref:s.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),qu=V.memo(K(function({nonce:e}){return(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),Ju=`ScrollAreaScrollbar`,Yu=V.forwardRef(K(function(e,t){let{forceMount:n,...r}=e,i=Uu(Ju,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return V.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,H.jsx)(Xu,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,H.jsx)(Zu,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,H.jsx)(Qu,{...r,ref:t,forceMount:n}):i.type===`always`?(0,H.jsx)($u,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),Xu=V.forwardRef(K(function(e,t){let{forceMount:n,...r}=e,i=Uu(Ju,e.__scopeScrollArea),[a,o]=V.useState(!1);return V.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=K(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=K(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,H.jsx)(ur,{present:n||a,children:(0,H.jsx)(Qu,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),Zu=V.forwardRef(K(function(e,t){let{forceMount:n,...r}=e,i=Uu(Ju,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=yd(()=>c(`SCROLL_END`),100),[s,c]=Ru(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return V.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),V.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=K(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,H.jsx)(ur,{present:n||s!==`hidden`,children:(0,H.jsx)($u,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:U(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:U(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),Qu=V.forwardRef(K(function(e,t){let n=Uu(Ju,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=V.useState(!1),s=e.orientation===`horizontal`,c=yd(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return bd(n.viewport,c),bd(n.content,c),(0,H.jsx)(ur,{present:r||a,children:(0,H.jsx)($u,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),$u=V.forwardRef(K(function(e,t){let{orientation:n=`vertical`,...r}=e,i=Uu(Ju,e.__scopeScrollArea),a=V.useRef(null),o=V.useRef(0),[s,c]=V.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=fd(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:K(e=>a.current=e,`onThumbChange`),onThumbPointerUp:K(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:K(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return md(e,o.current,s,t)}return K(d,`getScrollPosition`),n===`horizontal`?(0,H.jsx)(ed,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=hd(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,H.jsx)(td,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=hd(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),ed=V.forwardRef(K(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,o=Uu(Ju,e.__scopeScrollArea),[s,c]=V.useState(),l=V.useRef(null),u=a(t,l,o.onScrollbarXChange);return V.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,H.jsx)(id,{"data-orientation":`horizontal`,...i,ref:u,sizes:n,style:{bottom:0,left:o.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:o.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":pd(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),_d(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:dd(s.paddingLeft),paddingEnd:dd(s.paddingRight)}})}})},`ScrollAreaScrollbarX`)),td=V.forwardRef(K(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,o=Uu(Ju,e.__scopeScrollArea),[s,c]=V.useState(),l=V.useRef(null),u=a(t,l,o.onScrollbarYChange);return V.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,H.jsx)(id,{"data-orientation":`vertical`,...i,ref:u,sizes:n,style:{top:0,right:o.dir===`ltr`?0:void 0,left:o.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":pd(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),_d(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:dd(s.paddingTop),paddingEnd:dd(s.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[nd,rd]=Bu(Ju),id=V.forwardRef(K(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,m=Uu(Ju,n),[h,g]=V.useState(null),_=a(t,g),v=V.useRef(null),y=V.useRef(``),b=m.viewport,x=r.content-r.viewport,S=Pi(d),C=Pi(l),w=yd(f,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;u({x:t,y:n})}}return K(T,`handleDragScroll`),V.useEffect(()=>{let e=K(e=>{let t=e.target;h?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,h,x,S]),V.useEffect(C,[r,C]),bd(h,w),bd(m.content,w),(0,H.jsx)(nd,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:Pi(o),onThumbPointerUp:Pi(s),onThumbPositionChange:C,onThumbPointerDown:Pi(c),children:(0,H.jsx)(W.div,{...p,ref:_,style:{position:`absolute`,...p.style},onPointerDown:U(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,m.viewport&&(m.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:U(e.onPointerMove,T),onPointerUp:U(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=``),v.current=null})})})},`ScrollAreaScrollbarImpl`)),ad=`ScrollAreaThumb`,od=V.forwardRef(K(function(e,t){let{forceMount:n,...r}=e,i=rd(ad,e.__scopeScrollArea);return(0,H.jsx)(ur,{present:n||i.hasThumb,children:(0,H.jsx)(sd,{ref:t,...r})})},`ScrollAreaThumb`)),sd=V.forwardRef(K(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,o=Uu(ad,n),s=rd(ad,n),{onThumbPositionChange:c}=s,l=a(t,s.onThumbChange),u=V.useRef(void 0),d=yd(()=>{u.current&&=(u.current(),void 0)},100);return V.useEffect(()=>{let e=o.viewport;if(e){let t=K(()=>{if(d(),!u.current){let t=vd(e,c);u.current=t,c()}},`handleScroll`);return c(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[o.viewport,d,c]),(0,H.jsx)(W.div,{"data-state":s.hasThumb?`visible`:`hidden`,...i,ref:l,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:U(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;s.onThumbPointerDown({x:n,y:r})}),onPointerUp:U(e.onPointerUp,s.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),cd=`ScrollAreaCorner`,ld=V.forwardRef(K(function(e,t){let n=Uu(cd,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,H.jsx)(ud,{...e,ref:t}):null},`ScrollAreaCorner`)),ud=V.forwardRef(K(function(e,t){let{__scopeScrollArea:n,...r}=e,i=Uu(cd,n),[a,o]=V.useState(0),[s,c]=V.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return bd(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),bd(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),V.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,H.jsx)(W.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function dd(e){return e?parseInt(e,10):0}K(dd,`toInt`);function fd(e,t){let n=e/t;return isNaN(n)?0:n}K(fd,`getThumbRatio`);function pd(e){let t=fd(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}K(pd,`getThumbSize`);function md(e,t,n,r=`ltr`){let i=pd(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return gd([c,l],d)(e)}K(md,`getScrollPositionFromPointer`);function hd(e,t,n=`ltr`){let r=pd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Iu(e,n===`ltr`?[0,o]:[o*-1,0]);return gd([0,o],[0,s])(c)}K(hd,`getThumbOffsetFromScroll`);function gd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}K(gd,`linearScale`);function _d(e,t){return e>0&&e<t}K(_d,`isScrollingWithinScrollbarBounds`);var vd=K((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return K((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function yd(e,t){let n=Pi(e),r=V.useRef(0);return V.useEffect(()=>()=>window.clearTimeout(r.current),[]),V.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}K(yd,`useDebounceCallback`);function bd(e,t){let n=Pi(t);Un(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}K(bd,`useResizeObserver`);var xd=Wu,Sd=Ku,Cd=ld;function wd({className:e,children:t,...n}){return(0,H.jsxs)(xd,{"data-slot":`scroll-area`,className:B(`relative`,e),...n,children:[(0,H.jsx)(Sd,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,H.jsx)(Td,{}),(0,H.jsx)(Cd,{})]})}function Td({className:e,orientation:t=`vertical`,...n}){return(0,H.jsx)(Yu,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:B(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,H.jsx)(od,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var Ed=Object.defineProperty,Dd=(e,t)=>Ed(e,`name`,{value:t,configurable:!0}),Od=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),kd=V.forwardRef(Dd(function(e,t){return(0,H.jsx)(W.span,{...e,ref:t,style:{...Od,...e.style}})},`VisuallyHidden`)),Ad=Object.defineProperty,jd=(e,t)=>Ad(e,`name`,{value:t,configurable:!0}),Md=`horizontal`,Nd=[`horizontal`,`vertical`],Pd=V.forwardRef(jd(function(e,t){let{decorative:n,orientation:r=Md,...i}=e,a=Fd(r)?r:Md,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,H.jsx)(W.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function Fd(e){return Nd.includes(e)}jd(Fd,`isValidOrientation`);var Id=Pd;function Ld({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,H.jsx)(Id,{"data-slot":`separator`,decorative:n,orientation:t,className:B(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function Rd({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`skeleton`,className:B(`animate-pulse rounded-md bg-accent`,e),...t})}var zd=Object.defineProperty,Bd=(e,t)=>zd(e,`name`,{value:t,configurable:!0}),Vd=!1;function Hd(){let[e,t]=V.useState(Vd);return V.useEffect(()=>{Vd||(Vd=!0,t(!0))},[]),e}Bd(Hd,`useIsHydrated`);var Ud=V.useSyncExternalStore;function Wd(){return()=>{}}Bd(Wd,`subscribe`);function Gd(){return Ud(Wd,()=>!0,()=>!1)}Bd(Gd,`useIsHydratedModern`);var Kd=typeof Ud==`function`?Gd:Hd,qd=Object.defineProperty,Jd=(e,t)=>qd(e,`name`,{value:t,configurable:!0}),Yd=`rovingFocusGroup.onEntryFocus`,Xd={bubbles:!1,cancelable:!0},Zd=`RovingFocusGroup`,[Qd,$d,ef]=Tn(Zd),[tf,nf]=xn(Zd,[ef]),[rf,af]=tf(Zd),of=V.forwardRef(Jd(function(e,t){return(0,H.jsx)(Qd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Qd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(sf,{...e,ref:t})})})},`RovingFocusGroup`)),sf=V.forwardRef(Jd(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=V.useRef(null),m=a(t,p),h=Vr(o),[g,_]=Qn({prop:s,defaultProp:c??null,onChange:l,caller:Zd}),[v,y]=V.useState(!1),b=Pi(u),x=$d(n),S=V.useRef(!1),[C,w]=V.useState(0);return V.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Yd,b),()=>e.removeEventListener(Yd,b)},[b]),(0,H.jsx)(rf,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:V.useCallback(e=>_(e),[_]),onItemShiftTab:V.useCallback(()=>y(!0),[]),onFocusableItemAdd:V.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:V.useCallback(()=>w(e=>e-1),[]),children:(0,H.jsx)(W.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:U(e.onMouseDown,()=>{S.current=!0}),onFocus:U(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Yd,Xd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);pf([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:U(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),cf=`RovingFocusGroupItem`,lf=V.forwardRef(Jd(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=br(),l=a||c,u=af(cf,n),d=u.currentTabStopId===l,f=$d(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Kd();return Un(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),V.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,H.jsx)(Qd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:U(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:U(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:U(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ff(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?mf(n,r+1):n.slice(r+1)}setTimeout(()=>pf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),uf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function df(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Jd(df,`getDirectionAwareKey`);function ff(e,t,n){let r=df(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return uf[r]}Jd(ff,`getFocusIntent`);function pf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Jd(pf,`focusFirst`);function mf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Jd(mf,`wrapArray`);var hf=of,gf=lf,_f=Object.defineProperty,vf=(e,t)=>_f(e,`name`,{value:t,configurable:!0}),yf=`Tabs`,[bf,xf]=xn(yf,[nf]),Sf=nf(),[Cf,wf]=bf(yf),Tf=V.forwardRef(vf(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Vr(s),[d,f]=Qn({prop:r,onChange:i,defaultProp:a??``,caller:yf});return(0,H.jsx)(Cf,{scope:n,baseId:br(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,H.jsx)(W.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Ef=`TabsList`,Df=V.forwardRef(vf(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=wf(Ef,n),o=Sf(n);return(0,H.jsx)(hf,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,H.jsx)(W.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Of=`TabsTrigger`,kf=V.forwardRef(vf(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=wf(Of,n),s=Sf(n),c=Mf(o.baseId,r),l=Nf(o.baseId,r),u=r===o.value;return(0,H.jsx)(gf,{asChild:!0,...s,focusable:!i,active:u,children:(0,H.jsx)(W.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:U(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:U(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Af=`TabsContent`,jf=V.forwardRef(vf(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=wf(Af,n),c=Mf(s.baseId,r),l=Nf(s.baseId,r),u=r===s.value,d=V.useRef(u);return V.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,H.jsx)(ur,{present:i||u,children:({present:n})=>(0,H.jsx)(W.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Mf(e,t){return`${e}-trigger-${t}`}vf(Mf,`makeTriggerId`);function Nf(e,t){return`${e}-content-${t}`}vf(Nf,`makeContentId`);var Pf=Tf,Ff=Df,If=kf,Lf=jf;function Rf({className:e,orientation:t=`horizontal`,...n}){return(0,H.jsx)(Pf,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:B(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var zf=y(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Bf({className:e,variant:t=`default`,...n}){return(0,H.jsx)(Ff,{"data-slot":`tabs-list`,"data-variant":t,className:B(zf({variant:t}),e),...n})}function Vf({className:e,...t}){return(0,H.jsx)(If,{"data-slot":`tabs-trigger`,className:B(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function Hf({className:e,...t}){return(0,H.jsx)(Lf,{"data-slot":`tabs-content`,className:B(`flex-1 outline-none`,e),...t})}function Uf({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,className:B(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}var Wf=Object.defineProperty,Gf=(e,t)=>Wf(e,`name`,{value:t,configurable:!0}),[Kf,qf]=xn(`Tooltip`,[mu]),Jf=mu(),Yf=`TooltipProvider`,Xf=700,Zf=`tooltip.open`,[Qf,$f]=Kf(Yf),ep=Gf(e=>{let{__scopeTooltip:t,delayDuration:n=Xf,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=V.useRef(!0),s=V.useRef(!1),c=V.useRef(0);return V.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,H.jsx)(Qf,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:V.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:V.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:V.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),tp=`Tooltip`,[np,rp]=Kf(tp),ip=Gf(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=$f(tp,e.__scopeTooltip),l=Jf(t),[u,d]=V.useState(null),[f,p]=V.useState(void 0),m=br(),h=V.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=V.useRef(!1),[y,b]=Qn({prop:r,defaultProp:i??!1,onChange:Gf(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zf))):c.onClose(),a?.(e)},`onChange`),caller:tp}),x=V.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=V.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=V.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=V.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);V.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,H.jsx)(Au,{...l,children:(0,H.jsx)(np,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:V.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:V.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),ap=`TooltipTrigger`,op=V.forwardRef(Gf(function(e,t){let{__scopeTooltip:n,...r}=e,i=rp(ap,n),o=$f(ap,n),s=Jf(n),c=a(t,V.useRef(null),i.onTriggerChange),l=V.useRef(!1),u=V.useRef(!1),d=V.useCallback(()=>l.current=!1,[]);return V.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,H.jsx)(ju,{asChild:!0,...s,children:(0,H.jsx)(W.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:U(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:U(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:U(e.onBlur,i.onClose),onClick:U(e.onClick,i.onClose)})})},`TooltipTrigger`)),sp=`TooltipPortal`,[cp,lp]=Kf(sp,{forceMount:void 0}),up=Gf(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=rp(sp,t);return(0,H.jsx)(cp,{scope:t,forceMount:n,children:(0,H.jsx)(ur,{present:n||a.open,children:(0,H.jsx)(Pa,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),dp=`TooltipContent`,fp=V.forwardRef(Gf(function(e,t){let n=lp(dp,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=rp(dp,e.__scopeTooltip);return(0,H.jsx)(ur,{present:r||o.open,children:o.disableHoverableContent?(0,H.jsx)(hp,{side:i,...a,ref:t}):(0,H.jsx)(pp,{side:i,...a,ref:t})})},`TooltipContent`)),pp=V.forwardRef(Gf(function(e,t){let n=rp(dp,e.__scopeTooltip),r=$f(dp,e.__scopeTooltip),i=V.useRef(null),o=a(t,i),[s,c]=V.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=V.useCallback(()=>{c(null),f(!1)},[f]),m=V.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=vp(r,_p(r,n.getBoundingClientRect())),a=yp(t.getBoundingClientRect()),o=xp([...i,...a]);c(o),f(!0)},[f]);return V.useEffect(()=>()=>p(),[p]),V.useEffect(()=>{if(l&&d){let e=Gf(e=>m(e,d),`handleTriggerLeave`),t=Gf(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),V.useEffect(()=>{if(s){let e=Gf(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!bp(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,H.jsx)(hp,{...e,ref:o})},`TooltipContentHoverable`)),mp=xt(`TooltipContent`),hp=V.forwardRef(Gf(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=rp(dp,n),u=Jf(n),{onClose:d}=l;V.useEffect(()=>(document.addEventListener(Zf,d),()=>document.removeEventListener(Zf,d)),[d]),V.useEffect(()=>{if(l.trigger){let e=Gf(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Un(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,H.jsx)(la,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,H.jsxs)(Mu,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,H.jsx)(mp,{children:r}),i?(0,H.jsx)(kd,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),gp=V.forwardRef(Gf(function(e,t){let{__scopeTooltip:n,...r}=e,i=Jf(n);return(0,H.jsx)(Nu,{...i,...r,ref:t})},`TooltipArrow`));function _p(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Gf(_p,`getExitSideFromRect`);function vp(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Gf(vp,`getPaddedExitPoints`);function yp(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Gf(yp,`getPointsFromRect`);function bp(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Gf(bp,`isPointInPolygon`);function xp(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Sp(t)}Gf(xp,`getHull`);function Sp(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Gf(Sp,`getHullPresorted`);var Cp=ep,wp=ip,Tp=op,Ep=up,Dp=fp,Op=gp;function kp({delayDuration:e=0,...t}){return(0,H.jsx)(Cp,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Ap({...e}){return(0,H.jsx)(wp,{"data-slot":`tooltip`,...e})}function jp({...e}){return(0,H.jsx)(Tp,{"data-slot":`tooltip-trigger`,...e})}function Mp({className:e,sideOffset:t=0,children:n,...r}){return(0,H.jsx)(Ep,{children:(0,H.jsxs)(Dp,{"data-slot":`tooltip-content`,sideOffset:t,className:B(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,H.jsx)(Op,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Np={completed:`Completed`,failed:`Failed`,running:`Running`,stopped:`Stopped`};function Pp({state:e}){let t=Object.hasOwn(Np,e)?e:`unknown`;return(0,H.jsxs)(p,{className:B(`gap-1.5 uppercase tracking-[.03em]`,{"border-destructive bg-destructive-surface text-destructive":t===`failed`,"border-info bg-info-surface text-info":t===`running`,"border-success bg-success-surface text-success":t===`completed`,"border-warning bg-warning-surface text-warning":t===`stopped`}),variant:`outline`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:B(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),Np[e]??e]})}var Fp=`tool_result`;function Ip(...e){for(let t of e)if(t!=null)return t;return null}function Lp(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.call&&!n.result)return n}}function Rp({call:e,result:t}){let n=e??t,r=n?.kind??Fp;return{eventIndices:[e?.index,t?.index].filter(e=>e!==void 0),durationMs:Ip(e?.durationMs,t?.durationMs),finishedAt:Ip(e?.finishedAt,t?.finishedAt),id:`tool-${n?.index??0}`,input:e?.input??t?.input,kind:r,name:Ip(e?.name,t?.name)??r,output:Ip(t?.output,e?.output),startedAt:Ip(e?.startedAt,t?.startedAt),status:Ip(e?.status,t?.status),timingSource:Ip(e?.timingSource,t?.timingSource),toolCallId:Ip(e?.toolCallId,t?.toolCallId)}}function zp(e){let t=[],n=new Map;for(let r of e){if(r.kind===Fp){let e=r.toolCallId?n.get(r.toolCallId):Lp(t);if(e&&!e.result){e.result=r,e.call?.toolCallId&&n.delete(e.call.toolCallId);continue}t.push({call:null,result:r});continue}let e={call:r,result:null};t.push(e),r.toolCallId&&n.set(r.toolCallId,e)}return t.map(Rp)}var Bp=[{id:`turns`,label:`Turns`},{id:`phases`,label:`Phases`},{id:`tools`,label:`Tools`}];function Vp(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function Hp(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function Up(e){let t=[],n=[];for(let r of e.turns){let e=Vp(r.startedAt)??Vp(r.timestamp);if(e===null)continue;let i=Hp(r.durationMs),a=Vp(r.finishedAt);t.push({...i===void 0?a===null?{}:{end:a}:{duration:i},turnId:r.id,id:r.id,kind:`turn`,label:`${r.harness} turn`,laneId:`turns`,payload:{turn:r,type:`turn`},start:e,status:r.status});let o=[[`model`,r.modelMs],[`tools`,r.toolMs]],s=e;for(let[e,n]of o){let i=Hp(n);i!==void 0&&(t.push({duration:i,id:`${r.id}-phase-${e}`,kind:`${e} phase`,label:`${e===`model`?`Model`:`Tool`} time`,laneId:`phases`,parent:r.id,payload:{turn:r,type:`phase`},start:s,status:r.status}),s+=i)}let c=Hp(r.timeToFirstTokenMs);c!==void 0&&n.push({at:e+c,id:`${r.id}-first-token`,label:`First token`,payload:{turn:r,type:`milestone`},status:r.status});for(let n of zp(r.tools)){let i=Vp(n.startedAt)??e,a=Hp(n.durationMs),o=Vp(n.finishedAt);t.push({...a===void 0?o===null?{}:{end:o}:{duration:a},turnId:r.id,...n.toolCallId===null?{}:{toolCallId:n.toolCallId},eventIndex:Number(n.id.slice(5)),id:`${r.id}-${n.id}`,kind:n.kind,label:n.name,laneId:`tools`,parent:r.id,payload:{turn:r,type:`tool`},start:i,status:n.status})}}let r=Vp(e.startedAt);return{items:t,lanes:Bp.filter(e=>t.some(t=>t.laneId===e.id)),markers:n,...r===null?{}:{origin:r}}}function Wp({cursor:e,focus:t,expanded:n,onExpandedChange:r,onSelectTurn:i,selectedTurnId:a,turns:o}){let[s,c]=(0,V.useState)(!1),l=n??s,u=Up({turns:o}),d=o.find(e=>e.id===t?.turnId),f=d&&t?zp(d.tools).find(e=>t.toolCallId===void 0?t.eventIndex!==void 0&&e.eventIndices.includes(t.eventIndex):e.toolCallId===t.toolCallId):void 0,p=t?u.items.find(e=>e.turnId===t.turnId&&e.id===(f?`${t.turnId}-${f.id}`:t.turnId)):void 0;return(0,H.jsx)(_n,{...e===void 0?{}:{cursor:e},expanded:t?!0:l,onExpandedChange:e=>{n===void 0&&c(e),r?.(e)},getFailureExcerpt:e=>e.payload.turn.failureKind,items:u.items,label:`Conversation timeline`,lanes:u.lanes,markers:u.markers,onSelect:e=>i(e.payload.turn.id),...p?{selectedId:p.id}:a?{selectedId:a}:{}})}function Gp(e){let t=(0,V.useRef)(null),n=(0,V.useRef)(new Map),[r,i]=(0,V.useState)(),a=(0,V.useRef)(new Map);a.current=new Map(e.map(e=>[e.id,e.time]));let o=(0,V.useCallback)(()=>{let r=t.current;if(!r)return;let a=r.getBoundingClientRect().top+Math.min(r.clientHeight*.25,160),o=e.map(e=>({element:n.current.get(e.id),...e})).filter(e=>!!e.element);if(o.length===0)return;let s=o[0];if(!s)return;let c=s;for(let e of o)if(e.element.getBoundingClientRect().top<=a)c=e;else break;i(c.time)},[e]),s=(0,V.useCallback)(e=>{t.current?.removeEventListener(`scroll`,o),t.current=e,e?.addEventListener(`scroll`,o,{passive:!0}),o()},[o]);return(0,V.useEffect)(()=>{o();let e=t.current;return()=>e?.removeEventListener(`scroll`,o)},[o]),{containerRef:s,cursor:r,register:(0,V.useCallback)((e,t)=>{t?n.current.set(e,t):n.current.delete(e)},[]),scrollTo:(0,V.useCallback)(e=>{n.current.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`});let t=a.current.get(e);t!==void 0&&i(t)},[])}}function Kp({className:e,from:t,...n}){return(0,H.jsx)(`div`,{className:B(t===`user`?`flex justify-end`:`grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-3.5`,e),"data-message-author":t,...n})}function qp({className:e,...t}){return(0,H.jsx)(`div`,{className:B(`min-w-0`,e),...t})}function Jp({children:e,src:t}){return(0,H.jsxs)(Xi,{"aria-hidden":`true`,className:`size-8 rounded-[9px]`,children:[t?(0,H.jsx)(Qi,{alt:``,src:t}):null,(0,H.jsx)(Zi,{className:`bg-primary text-[9px] font-extrabold text-primary-foreground`,children:e})]})}var Yp=/"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g;function Xp(e){try{return JSON.parse(e)}catch{return}}function Zp(e,t=2){try{return JSON.stringify(e,null,t)??String(e)}catch{return String(e)}}function Qp(e){return Zp(e,0)}function $p(e,t){return e.startsWith(`"`)?t?`hljs-attr`:`hljs-string`:e===`true`||e===`false`||e===`null`?`hljs-literal`:`hljs-number`}function em(e){let t=[],n=0;for(let r of e.matchAll(Yp)){let i=r[0],a=r.index;a>n&&t.push(e.slice(n,a)),n=a+i.length;let o=/^\s*:/.test(e.slice(n));t.push((0,H.jsx)(`span`,{className:$p(i,o),children:i},`${a}-${i.length}`))}return n<e.length&&t.push(e.slice(n)),t}function tm({className:e,label:t,value:n}){return(0,H.jsx)(`pre`,{"aria-label":t,className:B(`message-json`,e),children:(0,H.jsx)(`code`,{children:em(Zp(n))})})}function nm(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var rm=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,im=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,am={};function om(e,t){return((t||am).jsx?im:rm).test(e)}var sm=/[ \t\n\f\r]/g;function cm(e){return typeof e==`object`?e.type===`text`&&lm(e.value):lm(e)}function lm(e){return e.replace(sm,``)===``}var um=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};um.prototype.normal={},um.prototype.property={},um.prototype.space=void 0;function dm(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new um(n,r,t)}function fm(e){return e.toLowerCase()}var pm=class{constructor(e,t){this.attribute=t,this.property=e}};pm.prototype.attribute=``,pm.prototype.booleanish=!1,pm.prototype.boolean=!1,pm.prototype.commaOrSpaceSeparated=!1,pm.prototype.commaSeparated=!1,pm.prototype.defined=!1,pm.prototype.mustUseProperty=!1,pm.prototype.number=!1,pm.prototype.overloadedBoolean=!1,pm.prototype.property=``,pm.prototype.spaceSeparated=!1,pm.prototype.space=void 0;var mm=Be({boolean:()=>q,booleanish:()=>gm,commaOrSpaceSeparated:()=>bm,commaSeparated:()=>ym,number:()=>J,overloadedBoolean:()=>_m,spaceSeparated:()=>vm}),hm=0,q=xm(),gm=xm(),_m=xm(),J=xm(),vm=xm(),ym=xm(),bm=xm();function xm(){return 2**++hm}var Sm=Object.keys(mm),Cm=class extends pm{constructor(e,t,n,r){let i=-1;if(super(e,t),wm(this,`space`,r),typeof n==`number`)for(;++i<Sm.length;){let e=Sm[i];wm(this,Sm[i],(n&mm[e])===mm[e])}}};Cm.prototype.defined=!0;function wm(e,t,n){n&&(e[t]=n)}function Tm(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Cm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[fm(r)]=r,n[fm(a.attribute)]=r}return new um(t,n,e.space)}var Em=Tm({properties:{ariaActiveDescendant:null,ariaAtomic:gm,ariaAutoComplete:null,ariaBusy:gm,ariaChecked:gm,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:vm,ariaCurrent:null,ariaDescribedBy:vm,ariaDetails:null,ariaDisabled:gm,ariaDropEffect:vm,ariaErrorMessage:null,ariaExpanded:gm,ariaFlowTo:vm,ariaGrabbed:gm,ariaHasPopup:null,ariaHidden:gm,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vm,ariaLevel:J,ariaLive:null,ariaModal:gm,ariaMultiLine:gm,ariaMultiSelectable:gm,ariaOrientation:null,ariaOwns:vm,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:gm,ariaReadOnly:gm,ariaRelevant:null,ariaRequired:gm,ariaRoleDescription:vm,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:gm,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Dm(e,t){return t in e?e[t]:t}function Om(e,t){return Dm(e,t.toLowerCase())}var km=Tm({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ym,acceptCharset:vm,accessKey:vm,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alpha:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:vm,autoFocus:q,autoPlay:q,blocking:vm,capture:null,charSet:null,checked:q,cite:null,className:vm,closedBy:null,colorSpace:null,cols:J,colSpan:J,command:null,commandFor:null,content:null,contentEditable:gm,controls:q,controlsList:vm,coords:J|ym,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:_m,draggable:gm,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:vm,height:J,hidden:_m,high:J,href:null,hrefLang:null,htmlFor:vm,httpEquiv:vm,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:vm,itemRef:vm,itemScope:q,itemType:vm,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:q,optimum:J,pattern:null,ping:vm,placeholder:null,playsInline:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:vm,required:q,reversed:q,rows:J,rowSpan:J,sandbox:vm,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootCustomElementRegistry:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shadowRootSerializable:q,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:gm,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:q,useMap:null,value:gm,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vm,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:gm,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:q,disablePictureInPicture:q,disableRemotePlayback:q,exportParts:ym,part:vm,prefix:null,property:null,results:J,security:null,unselectable:null},space:`html`,transform:Om}),Am=Tm({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:bm,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:vm,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:q,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ym,g2:ym,glyphName:ym,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:bm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vm,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bm,rev:bm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bm,requiredFeatures:bm,requiredFonts:bm,requiredFormats:bm,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:bm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bm,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Dm}),jm=Tm({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Mm=Tm({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Om}),Nm=Tm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Pm={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Fm=/[A-Z]/g,Im=/-[a-z]/g,Lm=/^data[-\w.:]+$/i;function Rm(e,t){let n=fm(t),r=t,i=pm;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Lm.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Im,Bm);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Im.test(e)){let n=e.replace(Fm,zm);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Cm}return new i(r,t)}function zm(e){return`-`+e.toLowerCase()}function Bm(e){return e.charAt(1).toUpperCase()}var Vm=dm([Em,km,jm,Mm,Nm],`html`),Hm=dm([Em,Am,jm,Mm,Nm],`svg`);function Um(e){return e.join(` `).trim()}var Wm=xe(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
42
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(!(e.charAt(0)!=`/`||e.charAt(1)!=`*`)){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Gm=xe((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Wm());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Km=xe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),qm=xe(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Gm()),r=Km();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Jm=Xm(`end`),Ym=Xm(`start`);function Xm(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Zm(e){let t=Ym(e),n=Jm(e);if(t&&n)return{start:t,end:n}}function Qm(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?eh(e.position):`start`in e||`end`in e?eh(e):`line`in e||`column`in e?$m(e):``}function $m(e){return th(e&&e.line)+`:`+th(e&&e.column)}function eh(e){return $m(e&&e.start)+`-`+$m(e&&e.end)}function th(e){return e&&typeof e==`number`?e:1}var nh=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Qm(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};nh.prototype.file=``,nh.prototype.name=``,nh.prototype.reason=``,nh.prototype.message=``,nh.prototype.stack=``,nh.prototype.column=void 0,nh.prototype.line=void 0,nh.prototype.ancestors=void 0,nh.prototype.cause=void 0,nh.prototype.fatal=void 0,nh.prototype.place=void 0,nh.prototype.ruleId=void 0,nh.prototype.source=void 0;var rh=ut(qm(),1),ih={}.hasOwnProperty,ah=new Map,oh=/[A-Z]/g,sh=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ch=new Set([`td`,`th`]);function lh(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=bh(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=yh(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Hm:Vm,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=uh(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function uh(e,t,n){if(t.type===`element`)return dh(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return fh(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return mh(e,t,n);if(t.type===`mdxjsEsm`)return ph(e,t);if(t.type===`root`)return hh(e,t,n);if(t.type===`text`)return gh(e,t)}function dh(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Hm,e.schema=i),e.ancestors.push(t);let a=Eh(e,t.tagName,!1),o=xh(e,t),s=Ch(e,t);return sh.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!cm(e)})),_h(e,o,a,t),vh(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function fh(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Dh(e,t.position)}function ph(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dh(e,t.position)}function mh(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Hm,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Eh(e,t.name,!0),o=Sh(e,t),s=Ch(e,t);return _h(e,o,a,t),vh(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function hh(e,t,n){let r={};return vh(r,Ch(e,t)),e.create(t,e.Fragment,r,n)}function gh(e,t){return t.value}function _h(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function vh(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function yh(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function bh(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Ym(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function xh(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ih.call(t.properties,i)){let a=wh(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ch.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Sh(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Dh(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Dh(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function Ch(e,t){let n=[],r=-1,i=e.passKeys?new Map:ah;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=uh(e,a,o);s!==void 0&&n.push(s)}return n}function wh(e,t,n){let r=Rm(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nm(n):Um(n)),r.property===`style`){let t=typeof n==`object`?n:Th(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Oh(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Pm[r.property]||r.property:r.attribute,n]}}function Th(e,t){try{return(0,rh.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new nh("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Eh(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=om(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=om(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ih.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Dh(e)}function Dh(e,t){let n=new nh("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Oh(e){let t={},n;for(n in e)ih.call(e,n)&&(t[kh(n)]=e[n]);return t}function kh(e){let t=e.replace(oh,Ah);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ah(e){return`-`+e.toLowerCase()}var jh={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Mh={};function Nh(e,t){let n=t||Mh;return Ph(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Ph(e,t,n){if(Ih(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Fh(e.children,t,n)}return Array.isArray(e)?Fh(e,t,n):``}function Fh(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ph(e[i],t,n);return r.join(``)}function Ih(e){return!!(e&&typeof e==`object`)}var Lh=document.createElement(`i`);function Rh(e){let t=`&`+e+`;`;Lh.innerHTML=t;let n=Lh.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function zh(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Bh(e,t){return e.length>0?(zh(e,e.length,0,t),e):t}var Vh={}.hasOwnProperty;function Hh(e){let t={},n=-1;for(;++n<e.length;)Uh(t,e[n]);return t}function Uh(e,t){let n;for(n in t){let r=(Vh.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Vh.call(r,a)||(r[a]=[]);let e=i[a];Wh(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Wh(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);zh(e,0,0,r)}function Gh(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Kh(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var qh=rg(/[A-Za-z]/),Jh=rg(/[\dA-Za-z]/),Yh=rg(/[#-'*+\--9=?A-Z^-~]/);function Xh(e){return e!==null&&(e<32||e===127)}var Zh=rg(/\d/),Qh=rg(/[\dA-Fa-f]/),$h=rg(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function eg(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}var tg=rg(/\p{P}|\p{S}/u),ng=rg(/\s/);function rg(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ig(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Jh(e.charCodeAt(n+1))&&Jh(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var ag={tokenize:og};function og(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var sg={tokenize:lg},cg={tokenize:ug};function lg(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return zh(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(cg,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(cg,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;zh(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ug(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function dg(e){if(e===null||eg(e)||ng(e))return 1;if(tg(e))return 2}function fg(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var pg={name:`attention`,resolveAll:mg,tokenize:hg};function mg(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};gg(d,-c),gg(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Bh(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Bh(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Bh(l,fg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Bh(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Bh(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,zh(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function hg(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=dg(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=dg(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function gg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var _g={name:`autolink`,tokenize:vg};function vg(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return qh(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Jh(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Jh(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Xh(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Yh(t)?(e.consume(t),l):n(t)}function u(e){return Jh(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Jh(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var yg={partial:!0,tokenize:bg};function bg(e,t,n){return r;function r(t){return X(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var xg={continuation:{tokenize:Cg},exit:wg,name:`blockQuote`,tokenize:Sg};function Sg(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Cg(e,t,n){let r=this;return i;function i(t){return X(t)?Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(xg,t,n)(r)}}function wg(e){e.exit(`blockQuote`)}var Tg={name:`characterEscape`,tokenize:Eg};function Eg(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return $h(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Dg={name:`characterReference`,tokenize:Og};function Og(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Jh,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Qh,u):(e.enter(`characterReferenceValue`),a=7,o=Zh,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Jh&&!Rh(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var kg={partial:!0,tokenize:Mg},Ag={concrete:!0,name:`codeFenced`,tokenize:jg};function jg(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(kg,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&X(t)?Z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(kg,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),X(t)?Z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Mg(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Ng={name:`codeIndented`,tokenize:Fg},Pg={partial:!0,tokenize:Ig};function Fg(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(Pg,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Ig(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}var Lg={name:`codeText`,previous:zg,resolve:Rg,tokenize:Bg};function Rg(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function zg(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Bg(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Vg=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Hg(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Hg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Hg(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Hg(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Hg(this.left,t.reverse())}}};function Hg(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ug(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Vg(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Wg(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return zh(e,0,1/0,u.slice(0)),!l}function Wg(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Gg={resolve:qg,tokenize:Jg},Kg={partial:!0,tokenize:Yg};function qg(e){return Ug(e),e}function Jg(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(Kg,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Yg(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Xg(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Xh(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||eg(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Xh(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Zg(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Qg(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function $g(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var e_={name:`definition`,tokenize:n_},t_={partial:!0,tokenize:r_};function n_(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Zg.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Kh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return eg(t)?$g(e,l)(t):l(t)}function l(t){return Xg(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(t_,d,d)(t)}function d(t){return X(t)?Z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function r_(e,t,n){return r;function r(t){return eg(t)?$g(e,i)(t):n(t)}function i(t){return Qg(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var i_={name:`hardBreakEscape`,tokenize:a_};function a_(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var o_={name:`headingAtx`,resolve:s_,tokenize:c_};function s_(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},zh(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function c_(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||eg(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):X(n)?Z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||eg(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var l_=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),u_=[`pre`,`script`,`style`,`textarea`],d_={concrete:!0,name:`htmlFlow`,resolveTo:m_,tokenize:h_},f_={partial:!0,tokenize:__},p_={partial:!0,tokenize:g_};function m_(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function h_(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):qh(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):qh(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return qh(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||eg(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&u_.includes(l)?(i=1,r.interrupt?t(s):O(s)):l_.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Jh(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||qh(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Jh(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||eg(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(f_,R,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(p_,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return u_.includes(n)?(e.consume(t),L):O(t)}return qh(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function g_(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function __(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(yg,t,n)}}var v_={name:`htmlText`,tokenize:y_};function y_(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):qh(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):qh(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return qh(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Jh(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,N(t)):X(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Jh(t)?(e.consume(t),w):t===47||t===62||eg(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||qh(t)?(e.consume(t),E):Y(t)?(o=T,N(t)):X(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Jh(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,N(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,N(t)):X(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||eg(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||eg(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return X(t)?Z(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var b_={name:`labelEnd`,resolveAll:w_,resolveTo:T_,tokenize:E_},x_={tokenize:D_},S_={tokenize:O_},C_={tokenize:k_};function w_(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&zh(e,0,e.length,n),e}function T_(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Bh(s,e.slice(a+1,a+r+3)),s=Bh(s,[[`enter`,u,t]]),s=Bh(s,fg(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Bh(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Bh(s,e.slice(o+1)),s=Bh(s,[[`exit`,c,t]]),zh(e,a,e.length,s),e}function E_(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Kh(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(x_,u,o?u:d)(t):t===91?e.attempt(S_,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(C_,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function D_(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return eg(t)?$g(e,a)(t):a(t)}function a(t){return t===41?u(t):Xg(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return eg(t)?$g(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Qg(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return eg(t)?$g(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function O_(e,t,n){let r=this;return i;function i(t){return Zg.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Kh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function k_(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var A_={name:`labelStartImage`,resolveAll:b_.resolveAll,tokenize:j_};function j_(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var M_={name:`labelStartLink`,resolveAll:b_.resolveAll,tokenize:N_};function N_(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var P_={name:`lineEnding`,tokenize:F_};function F_(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}}var I_={name:`thematicBreak`,tokenize:L_};function L_(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),X(t)?Z(e,s,`whitespace`)(t):s(t))}}var R_={continuation:{tokenize:H_},exit:W_,name:`list`,tokenize:V_},z_={partial:!0,tokenize:G_},B_={partial:!0,tokenize:U_};function V_(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Zh(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(I_,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Zh(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(yg,r.interrupt?n:u,e.attempt(z_,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return X(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function H_(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(yg,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!X(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(B_,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(R_,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function U_(e,t,n){let r=this;return Z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function W_(e){e.exit(this.containerState.type)}function G_(e,t,n){let r=this;return Z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var K_={name:`setextUnderline`,resolveTo:q_,tokenize:J_};function q_(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function J_(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),X(t)?Z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Y_={tokenize:X_};function X_(e){let t=this,n=e.attempt(yg,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Gg,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Z_={resolveAll:tv()},Q_=ev(`string`),$_=ev(`text`);function ev(e){return{resolveAll:tv(e===`text`?nv:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function tv(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function nv(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var rv=Be({attentionMarkers:()=>dv,contentInitial:()=>av,disable:()=>fv,document:()=>iv,flow:()=>sv,flowInitial:()=>ov,insideSpan:()=>uv,string:()=>cv,text:()=>lv}),iv={42:R_,43:R_,45:R_,48:R_,49:R_,50:R_,51:R_,52:R_,53:R_,54:R_,55:R_,56:R_,57:R_,62:xg},av={91:e_},ov={[-2]:Ng,[-1]:Ng,32:Ng},sv={35:o_,42:I_,45:[K_,I_],60:d_,61:K_,95:I_,96:Ag,126:Ag},cv={38:Dg,92:Tg},lv={[-5]:P_,[-4]:P_,[-3]:P_,33:A_,38:Dg,42:pg,60:[_g,v_],91:M_,92:[i_,Tg],93:b_,95:pg,96:Lg},uv={null:[pg,Z_]},dv={null:[42,95]},fv={null:[]};function pv(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Bh(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=fg(a,l.events,l),l.events):[]}function f(e,t){return hv(p(e),t)}function p(e){return mv(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&zh(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function mv(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function hv(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
43
+ `;break;case-3:o=`\r
44
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function gv(e){let t={constructs:Hh([rv,...(e||{}).extensions||[]]),content:n(ag),defined:[],document:n(sg),flow:n(Y_),lazy:{},string:n(Q_),text:n($_)};return t;function n(e){return n;function n(n){return pv(t,e,n)}}}function _v(e){for(;!Ug(e););return e}var vv=/[\0\t\n\r]/g;function yv(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(vv.lastIndex=u,c=vv.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var bv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xv(e){return e.replace(bv,Sv)}function Sv(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Gh(n.slice(t?2:1),t?16:10)}return Rh(n)||e}var Cv={}.hasOwnProperty;function wv(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Tv(n)(_v(gv(n).document().write(yv()(e,t,!0))))}function Tv(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:B,autolinkProtocol:ie,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:re,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Dv(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Cv.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||kv).call(a,void 0,e[0])}for(r.position={start:Ev(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ev(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Ev(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||kv).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Qm({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Ev(e.end)}function u(){return Nh(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Kh(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:Ev(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Ev(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Ev(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=xv(t),n.identifier=Kh(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Kh(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Gh(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Rh(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=Ev(e.end)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function B(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function Ev(e){return{line:e.line,column:e.column,offset:e.offset}}function Dv(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Dv(e,r):Ov(e,r)}}function Ov(e,t){let n;for(n in t)if(Cv.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function kv(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Qm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qm({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Qm({start:t.start,end:t.end})+`) is still open`)}function Av(e){let t=this;t.parser=n;function n(n){return wv(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function jv(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Mv(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
45
+ `}]}function Nv(e,t){let n=t.value?t.value+`
46
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Pv(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fv(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Iv(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=ig(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Lv(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rv(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zv(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Bv(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zv(e,t);let i={src:ig(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Vv(e,t){let n={src:ig(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Hv(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Uv(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zv(e,t);let i={href:ig(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Wv(e,t){let n={href:ig(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Gv(e,t,n){let r=e.all(t),i=n?Kv(n):qv(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
47
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
48
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Kv(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=qv(n[r])}return t}function qv(e){return e.spread??e.children.length>1}function Jv(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Yv(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xv(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Zv(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qv(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Ym(t.children[1]),o=Jm(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function $v(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function ey(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var ty=9,ny=32;function ry(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(iy(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(iy(t.slice(i),i>0,!1)),a.join(``)}function iy(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===ty||t===ny;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===ty||t===ny;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function ay(e,t){let n={type:`text`,value:ry(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function oy(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var sy={blockquote:jv,break:Mv,code:Nv,delete:Pv,emphasis:Fv,footnoteReference:Iv,heading:Lv,html:Rv,imageReference:Bv,image:Vv,inlineCode:Hv,linkReference:Uv,link:Wv,listItem:Gv,list:Jv,paragraph:Yv,root:Xv,strong:Zv,table:Qv,tableCell:ey,tableRow:$v,text:ay,thematicBreak:oy,toml:cy,yaml:cy,definition:cy,footnoteDefinition:cy};function cy(){}var ly=typeof self==`object`?self:globalThis,uy=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ly[e](t)},dy=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof ly[e]==`function`?uy(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(uy(a,o),i)};return r},fy=e=>dy(new Map,e)(0),py=``,{toString:my}={},{keys:hy}=Object,gy=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=my.call(e).slice(8,-1);switch(n){case`Array`:return[1,py];case`Object`:return[2,py];case`Date`:return[3,py];case`RegExp`:return[4,py];case`Map`:return[5,py];case`Set`:return[6,py];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},_y=([e,t])=>e===0&&(t===`function`||t===`symbol`),vy=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=gy(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of hy(r))(e||!_y(gy(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?py:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(_y(gy(n))||_y(gy(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!_y(gy(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},yy=(e,{json:t,lossy:n}={})=>{let r=[];return vy(!(t||n),!!t,new Map,r)(e),r},by=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?fy(yy(e,t)):structuredClone(e):(e,t)=>fy(yy(e,t));function xy(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Sy(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Cy(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||xy,r=e.options.footnoteBackLabel||Sy,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=ig(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...by(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
49
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
50
+ `}]}}var wy=(function(e){if(e==null)return ky;if(typeof e==`function`)return Oy(e);if(typeof e==`object`)return Array.isArray(e)?Ty(e):Ey(e);if(typeof e==`string`)return Dy(e);throw Error(`Expected function, string, or object as test`)});function Ty(e){let t=[],n=-1;for(;++n<e.length;)t[n]=wy(e[n]);return Oy(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ey(e){let t=e;return Oy(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Dy(e){return Oy(t);function t(t){return t&&t.type===e}}function Oy(e){return t;function t(t,n,r){return!!(Ay(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ky(){return!0}function Ay(e){return typeof e==`object`&&!!e&&`type`in e}function jy(e){return e}var My=[];function Ny(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=wy(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+jy(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=My,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Py(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Py(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?My:[e]}function Fy(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Ny(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Iy={}.hasOwnProperty,Ly={};function Ry(e,t){let n=t||Ly,r=new Map,i=new Map,a={all:s,applyData:By,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...sy,...n.handlers},one:o,options:n,patch:zy,wrap:Hy};return Fy(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Iy.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=by(n);return r.children=a.all(e),r}return by(e)}return(a.options.unknownHandler||Vy)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Uy(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Uy(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function zy(e,t){e.position&&(t.position=Zm(e))}function By(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,by(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Vy(e,t){let n=t.data||{},r=`value`in t&&!(Iy.call(n,`hProperties`)||Iy.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Hy(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
51
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
52
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
53
+ `}),n}function Uy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wy(e,t){let n=Ry(e,t),r=n.one(e,void 0),i=Cy(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
54
+ `},i)),a}function Gy(e,t){return e&&`run`in e?async function(n,r){let i=Wy(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wy(n,{file:r,...e||t})}}function Ky(e){if(e)throw e}var qy=xe(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Jy(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Yy(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Xy(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Xy(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Zy={basename:Qy,dirname:$y,extname:eb,join:tb,sep:`/`};function Qy(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ib(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function $y(e){if(ib(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function eb(e){ib(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function tb(...e){let t=-1,n;for(;++t<e.length;)ib(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:nb(n)}function nb(e){ib(e);let t=e.codePointAt(0)===47,n=rb(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function rb(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function ib(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var ab={cwd:ob};function ob(){return`/`}function sb(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function cb(e){if(typeof e==`string`)e=new URL(e);else if(!sb(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return lb(e)}function lb(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var ub=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],db=class{constructor(e){let t;t=e?sb(e)?{path:e}:typeof e==`string`||hb(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ab.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ub.length;){let e=ub[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)ub.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Zy.basename(this.path):void 0}set basename(e){pb(e,`basename`),fb(e,`basename`),this.path=Zy.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Zy.dirname(this.path):void 0}set dirname(e){mb(this.basename,`dirname`),this.path=Zy.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Zy.extname(this.path):void 0}set extname(e){if(fb(e,`extname`),mb(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Zy.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){sb(e)&&(e=cb(e)),pb(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Zy.basename(this.path,this.extname):void 0}set stem(e){pb(e,`stem`),fb(e,`stem`),this.path=Zy.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new nh(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function fb(e,t){if(e&&e.includes(Zy.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Zy.sep+"`")}function pb(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function mb(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function hb(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var gb=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),_b=ut(qy(),1),vb={}.hasOwnProperty,yb=new class e extends gb{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Yy()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,_b.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Sb(`data`,this.frozen),this.namespace[e]=t,this):vb.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Sb(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Tb(e),n=this.parser||this.Parser;return bb(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),bb(`process`,this.parser||this.Parser),xb(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Tb(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Db(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),bb(`processSync`,this.parser||this.Parser),xb(`processSync`,this.compiler||this.Compiler),this.process(e,r),wb(`processSync`,`process`,t),n;function r(e,r){t=!0,Ky(e),n=r}}run(e,t,n){Cb(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Tb(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),wb(`runSync`,`run`,n),r;function i(e,t){Ky(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Tb(t),r=this.compiler||this.Compiler;return xb(`stringify`,r),Cb(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Sb(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,_b.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Jy(o)&&Jy(r)&&(r=(0,_b.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function bb(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function xb(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Sb(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Cb(e){if(!Jy(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function wb(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tb(e){return Eb(e)?e:new db(e)}function Eb(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Db(e){return typeof e==`string`||Ob(e)}function Ob(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var kb=[],Ab={allowDangerousHtml:!0},jb=/^(https?|ircs?|mailto|xmpp)$/i,Mb=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Nb(e){let t=Pb(e),n=Fb(e);return Ib(t.runSync(t.parse(n),n),e)}function Pb(e){let t=e.rehypePlugins||kb,n=e.remarkPlugins||kb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ab}:Ab;return yb().use(Av).use(n).use(Gy,r).use(t)}function Fb(e){let t=e.children||``,n=new db;return typeof t==`string`?n.value=t:``+t,n}function Ib(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Lb;for(let e of Mb)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Fy(e,l),lh(e,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in jh)if(Object.hasOwn(jh,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=jh[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Lb(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||jb.test(e.slice(0,t))?e:``}var Rb=(function(e,t,n){let r=wy(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),zb=(function(e){if(e==null)return Ub;if(typeof e==`string`)return Vb(e);if(typeof e==`object`)return Bb(e);if(typeof e==`function`)return Hb(e);throw Error("Expected function, string, or array as `test`")});function Bb(e){let t=[],n=-1;for(;++n<e.length;)t[n]=zb(e[n]);return Hb(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Vb(e){return Hb(t);function t(t){return t.tagName===e}}function Hb(e){return t;function t(t,n,r){return!!(Wb(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Ub(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Wb(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var Gb=/\n/g,Kb=/[\t ]+/g,qb=zb(`br`),Jb=zb(sx),Yb=zb(`p`),Xb=zb(`tr`),Zb=zb([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,ox,cx]),Qb=zb(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function $b(e,t){let n=t||{},r=`children`in e?e.children:[],i=Qb(e),a=ax(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...nx(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...ex(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?qb(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
55
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function ex(e,t,n){return e.type===`element`?tx(e,t,n):e.type===`text`?n.whitespace===`normal`?nx(e,n):rx(e):[]}function tx(e,t,n){let r=ax(e,n),i=e.children||[],a=-1,o=[];if(Zb(e))return o;let s,c;for(qb(e)||Xb(e)&&Rb(t,e,Xb)?c=`
56
+ `:Yb(e)?(s=2,c=2):Qb(e)&&(s=1,c=1);++a<i.length;)o=o.concat(ex(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?qb(i[a+1]):c}));return Jb(e)&&Rb(t,e,Jb)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function nx(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Gb.lastIndex=a;let e=Gb.exec(n),i=e&&`index`in e?e.index:n.length;r.push(ix(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function rx(e){return[String(e.value)]}function ix(e,t,n){let r=[],i=0,a;for(;i<e.length;){Kb.lastIndex=i;let n=Kb.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function ax(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function ox(e){return!!(e.properties||{}).hidden}function sx(e){return e.tagName===`td`||e.tagName===`th`}function cx(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function lx(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function ux(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=lx(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function dx(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function fx(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},f=[c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],p={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat([`self`]),relevance:0}]),relevance:0},m={begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(l,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C`,aliases:[`h`],keywords:d,disableAutodetect:!0,illegal:`</`,contains:[].concat(p,m,f,[c,{begin:e.IDENT_RE+`::`,keywords:d},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:o,keywords:d}}}function px(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function mx(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:`<!--|-->`},{begin:`</?`,end:`>`}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var hx=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),gx=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),_x=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),vx=[...gx,..._x],yx=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),bx=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),xx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Sx=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Cx(e){let t=e.regex,n=hx(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+bx.join(`|`)+`)`},{begin:`:(:)?(`+xx.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Sx.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:yx.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+vx.join(`|`)+`)\\b`}]}}function wx(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function Tx(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function Ex(e){let t=e.regex;return{name:`GraphQL`,aliases:[`gql`],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:[`query`,`mutation`,`subscription`,`type`,`input`,`schema`,`directive`,`interface`,`union`,`scalar`,`fragment`,`enum`,`on`],literal:[`true`,`false`,`null`]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:`punctuation`,match:/[.]{3}/,relevance:0},{scope:`punctuation`,begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:`variable`,begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:`meta`,match:/@\w+/,excludeEnd:!0},{scope:`symbol`,begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Dx(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var Ox=`[0-9](_*[0-9])*`,kx=`\\.(${Ox})`,Ax=`[0-9a-fA-F](_*[0-9a-fA-F])*`,jx={className:`number`,variants:[{begin:`(\\b(${Ox})((${kx})|\\.)?|(${kx}))[eE][+-]?(${Ox})[fFdD]?\\b`},{begin:`\\b(${Ox})((${kx})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${kx})[fFdD]?\\b`},{begin:`\\b(${Ox})[fFdD]\\b`},{begin:`\\b0[xX]((${Ax})\\.?|(${Ax})?\\.(${Ax}))[pP][+-]?(${Ox})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Ax})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Mx(e,t,n){return n===-1?``:e.replace(t,r=>Mx(e,t,n-1))}function Nx(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Mx(`(?:<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,jx,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},jx,a]}}var Px=`[A-Za-z$_][0-9A-Za-z$_]*`,Fx=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Ix=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Lx=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Rx=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],zx=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Bx=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Vx=[].concat(zx,Lx,Rx);function Hx(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Px,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Px,keyword:Fx,literal:Ix,built_in:Vx,"variable.language":Bx},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Lx,...Rx]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...zx,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Ux(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}var Wx=`[0-9](_*[0-9])*`,Gx=`\\.(${Wx})`,Kx=`[0-9a-fA-F](_*[0-9a-fA-F])*`,qx={className:`number`,variants:[{begin:`(\\b(${Wx})((${Gx})|\\.)?|(${Gx}))[eE][+-]?(${Wx})[fFdD]?\\b`},{begin:`\\b(${Wx})((${Gx})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Gx})[fFdD]?\\b`},{begin:`\\b(${Wx})[fFdD]\\b`},{begin:`\\b0[xX]((${Kx})\\.?|(${Kx})?\\.(${Kx}))[pP][+-]?(${Wx})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Kx})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Jx(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},o={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[a,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);let s={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},c={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:`string`}),`self`]}]},l=qx,u=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,c,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin:/</,end:/>/,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,c,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},o,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:`
57
+ `},l]}}var Yx=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Xx=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Zx=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Qx=[...Xx,...Zx],$x=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),eS=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),tS=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),nS=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),rS=eS.concat(tS).sort().reverse();function iS(e){let t=Yx(e),n=rS,r=`([\\w-]+|@\\{[\\w-]+\\})`,i=[],a=[],o=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},s=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:$x.join(` `)},l={begin:`\\(`,end:`\\)`,contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o(`'`),o(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,l,s(`variable`,`@@?[\\w-]+`,10),s(`variable`,`@\\{[\\w-]+\\}`),s(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:`[\\w-]+\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let u=a.concat({begin:/\{/,end:/\}/,contains:i}),d={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(a)},f={begin:`([\\w-]+|@\\{[\\w-]+\\})\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+nS.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:a}}]},p={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:c,returnEnd:!0,contains:a,relevance:0}},m={className:`variable`,variants:[{begin:`@[\\w-]+\\s*:`,relevance:15},{begin:`@[\\w-]+`}],starts:{end:`[;}]`,returnEnd:!0,contains:u}},h={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,s(`keyword`,`all\\b`),s(`variable`,`@\\{[\\w-]+\\}`),{begin:`\\b(`+Qx.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,s(`selector-tag`,r,0),s(`selector-id`,`#([\\w-]+|@\\{[\\w-]+\\})`),s(`selector-class`,`\\.([\\w-]+|@\\{[\\w-]+\\})`,0),s(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+eS.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+tS.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:`!important`},t.FUNCTION_DISPATCH]},g={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[h]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,m,g,f,h,d,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}}function aS(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!\\[=*\\[)`,`$`),e.COMMENT(`--\\[=*\\[`,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function oS(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function sS(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function cS(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function lS(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function uS(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
58
+ ]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function dS(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function fS(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function pS(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function mS(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function hS(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function gS(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:`alias.and.begin.BEGIN.break.case.class.defined.do.else.elsif.end.END.ensure.for.if.in.module.next.not.or.redo.require.rescue.retry.return.then.undef.unless.until.when.while.yield.include.extend.prepend.public.private.protected.raise.throw`.split(`.`),built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function _S(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),l=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?`}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:c,type:l}},{className:`punctuation`,begin:`->`},a]}}var vS=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),yS=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),bS=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),xS=[...yS,...bS],SS=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),CS=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),wS=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),TS=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function ES(e){let t=vS(e),n=wS,r=CS,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+xS.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+TS.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:SS.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function DS(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function OS(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function kS(e){return e?typeof e==`string`?e:e.source:null}function AS(e){return jS(`(?=`,e,`)`)}function jS(...e){return e.map(e=>kS(e)).join(``)}function MS(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function NS(...e){return`(`+(MS(e).capture?``:`?:`)+e.map(e=>kS(e)).join(`|`)+`)`}var PS=e=>jS(/\b/,e,/\w$/.test(e)?/\b/:/\B/),FS=[`Protocol`,`Type`].map(PS),IS=[`init`,`self`].map(PS),LS=[`Any`,`Self`],RS=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],zS=[`false`,`nil`,`true`],BS=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],VS=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],HS=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),US=NS(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),WS=NS(US,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),GS=jS(US,WS,`*`),KS=NS(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),qS=NS(KS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),JS=jS(KS,qS,`*`),YS=jS(/[A-Z]/,qS,`*`),XS=[`attached`,`autoclosure`,jS(/convention\(/,NS(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,jS(/objc\(/,JS,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],ZS=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function QS(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,NS(...FS,...IS)],className:{2:`keyword`}},a={match:jS(/\./,NS(...RS)),relevance:0},o=RS.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:NS(...RS.filter(e=>typeof e!=`string`).concat(LS).map(PS),...IS)}]},c={$pattern:NS(/\b\w+/,/#\w+/),keyword:o.concat(VS),literal:zS},l=[i,a,s],u=[{match:jS(/\./,NS(...HS)),relevance:0},{className:`built_in`,match:jS(/\b/,NS(...HS),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:GS},{match:`\\.(\\.|${WS})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:jS(/\\/,e,/[0\\tnr"']/)},{match:jS(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:jS(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:jS(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:jS(e,/"""/),end:jS(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:jS(e,/"/),end:jS(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=jS(e,/\//),n=jS(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:jS(/`/,JS,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${qS}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:ZS,contains:[...f,h,x]}]}},{scope:`keyword`,match:jS(/@/,NS(...XS),AS(NS(/\(/,/\s+/)))},{scope:`meta`,match:jS(/@/,JS)}],k={match:AS(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:jS(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,qS,`+`)},{className:`type`,match:YS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:jS(/\s+&\s+/,AS(YS)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:jS(JS,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:NS(AS(jS(JS,/\s*:/)),AS(jS(JS,/\s+/,JS,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:JS}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,NS(E.match,JS,GS)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,GS],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,YS],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...BS,...zS],end:/}/},R={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},z={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,JS,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:YS},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,R,z,ee,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var $S=`[A-Za-z$_][0-9A-Za-z$_]*`,eC=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),tC=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],nC=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),rC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],iC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],aC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],oC=[].concat(iC,nC,rC);function sC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=$S,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:$S,keyword:eC,literal:tC,built_in:oC,"variable.language":aC},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...nC,...rC]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...iC,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function cC(e){let t=e.regex,n=sC(e),r=$S,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:$S,keyword:eC.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:tC,built_in:oC.concat(i),"variable.language":aC},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function lC(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function uC(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function dC(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function fC(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var pC={arduino:ux,bash:dx,c:fx,cpp:px,csharp:mx,css:Cx,diff:wx,go:Tx,graphql:Ex,ini:Dx,java:Nx,javascript:Hx,json:Ux,kotlin:Jx,less:iS,lua:aS,makefile:oS,markdown:sS,objectivec:cS,perl:lS,php:uS,"php-template":dS,plaintext:fS,python:pS,"python-repl":mS,r:hS,ruby:gS,rust:_S,scss:ES,shell:DS,sql:OS,swift:QS,typescript:cC,vbnet:lC,wasm:uC,xml:dC,yaml:fC},mC=ut(xe(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),z=I(`#`,`$`),ee=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function te(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ne(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function re(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=te,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ie(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function B(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ae(e,t){e.relevance===void 0&&(e.relevance=1)}var oe=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},se=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ce=`keyword`;function le(e,t,n=ce){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,le(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ue(n[0],n[1])]})}}function ue(e,t){return t?Number(t):+!de(e)}function de(e){return se.includes(e.toLowerCase())}var fe={},pe=e=>{console.error(e)},me=(e,...t)=>{console.log(`WARN: ${e}`,...t)},he=(e,t)=>{fe[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),fe[`${e}/${t}`]=!0)},ge=Error();function _e(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function ve(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw pe(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ge;if(typeof e.beginScope!=`object`||e.beginScope===null)throw pe(`beginScope must be object`),ge;_e(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function ye(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw pe(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ge;if(typeof e.endScope!=`object`||e.endScope===null)throw pe(`endScope must be object`),ge;_e(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function be(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function xe(e){be(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),ve(e),ye(e)}function Se(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ne,B,xe,oe].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[re,ie,ae].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=le(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return we(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Ce(e){return e?e.endsWithParent||Ce(e.starts):!1}function we(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ce(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Te=`11.11.1`,Ee=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},De=i,Oe=a,ke=Symbol(`nomatch`),Ae=7,je=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(me(s.replace(`{}`,n[1])),me(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(he(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),he(`10.7.0`,`Please use highlight(code, options) instead.
59
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};z(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,z(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ae&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return ke;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==ke)return e}if(r.type===`illegal`&&a===``)return P+=`
60
+ `,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw pe(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Se(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:De(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:De(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:De(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(z(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ee(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),z(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Oe(l,e)}let E=()=>{k(),he(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),he(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(pe(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)pe(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function z(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function te(e){return he(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),he(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:te,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Oe,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Te,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ee)typeof ee[e]==`object`&&n(ee[e]);return Object.assign(e,ee),e},Me=je({});Me.newInstance=()=>je({}),t.exports=Me,Me.HighlightJS=Me,Me.default=Me}))()).default,hC={},gC=`hljs-`;function _C(e){let t=mC.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||hC,a=typeof i.prefix==`string`?i.prefix:gC;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:vC,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||hC).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var vC=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},yC={};function bC(e){let t=e||yC,n=t.aliases,r=t.detect||!1,i=t.languages||pC,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=_C(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){Fy(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=xC(e);if(u===!1||!u&&!r||u&&a&&a.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(c)||e.properties.className.unshift(c);let d=$b(e,{whitespace:`pre`}),f;try{f=u?l.highlight(u,d,{prefix:o}):l.highlightAuto(d,{prefix:o,subset:s})}catch(n){let r=n;if(u&&/Unknown language/.test(r.message)){t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[i,e],cause:r,place:e.position,ruleId:`missing-language`,source:`rehype-highlight`});return}throw r}!u&&f.data&&f.data.language&&e.properties.className.push(`language-`+f.data.language),f.children.length>0&&(e.children=f.children)})}}function xC(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){let e=String(t[n]);if(e===`no-highlight`||e===`nohighlight`)return!1;!r&&e.slice(0,5)===`lang-`&&(r=e.slice(5)),!r&&e.slice(0,9)===`language-`&&(r=e.slice(9))}return r}var SC=`a.blockquote.br.code.del.em.h1.h2.h3.h4.h5.h6.hr.li.ol.p.pre.span.strong.table.tbody.td.th.thead.tr.ul`.split(`.`);function CC({children:e,label:t}){let n=Xp(e);return n===void 0?(0,H.jsx)(`div`,{className:`message-markdown`,children:(0,H.jsx)(Nb,{allowedElements:[...SC],rehypePlugins:[bC],skipHtml:!0,children:e})}):(0,H.jsx)(tm,{className:`whitespace-pre`,label:`${t} formatted JSON`,value:n})}var wC=200,TC=`mt-0 max-h-72 whitespace-pre-wrap rounded-none border-0 text-[11px]`,EC={completed:`text-success`,failed:`text-destructive`,interrupted:`text-warning`,timeout:`text-warning`};function DC({label:e,value:t}){return(0,H.jsx)(tm,{className:`mt-0 max-h-90 whitespace-pre-wrap rounded-none border-0 text-[11px]`,label:e,value:t})}function OC(e){return e===null||!Number.isFinite(e)?null:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function kC(e){return e.input===void 0||e.input===null?e.output??``:typeof e.input==`string`?e.input:Qp(e.input)}function AC(e){return kC(e).split(`
61
+ `,1)[0]?.trim().slice(0,wC)??``}function jC({status:e}){return e?(0,H.jsxs)(`span`,{className:B(`flex shrink-0 items-center gap-1 text-[9px] uppercase tracking-[.08em]`,EC[e]??`text-subtle`),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-current`}),e]}):null}function MC({invocation:e}){let t=[[`Call ID`,e.toolCallId],[`Started`,e.startedAt],[`Finished`,e.finishedAt],[`Timing`,e.timingSource]].filter(([,e])=>e!==null);return t.length===0?null:(0,H.jsx)(`dl`,{"aria-label":`${e.name} tool timing`,className:`flex flex-wrap gap-2 px-3.5 py-2`,children:t.map(([e,t])=>(0,H.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,H.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,H.jsx)(`dd`,{className:`m-0 font-mono text-[10px] text-muted-foreground`,children:t})]},e))})}function NC({children:e,title:t}){return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h4`,{className:`m-0 px-3.5 pt-2 text-[9px] font-bold uppercase tracking-[.08em] text-subtle`,children:t}),e]})}function PC({invocation:e,current:t}){let n=OC(e.durationMs),r=AC(e),i=e.input!==void 0&&e.input!==null,a=e.output===null?void 0:Xp(e.output);return(0,H.jsxs)(Ti,{"aria-current":t?`true`:void 0,"data-tool-call-id":e.toolCallId??void 0,"data-event-index":e.id.slice(5),className:`rounded-[10px] border bg-card px-3`,value:e.id,children:[(0,H.jsxs)(Ei,{"aria-label":`${e.name} tool details`,className:`items-center gap-2 py-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(en,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,H.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:e.name}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] font-normal text-subtle`,children:r}),n?(0,H.jsx)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-subtle`,children:n}):null,(0,H.jsx)(jC,{status:e.status})]}),(0,H.jsxs)(Di,{className:`-mx-3 border-t p-0`,children:[(0,H.jsx)(MC,{invocation:e}),i?(0,H.jsx)(NC,{title:`Input`,children:(0,H.jsx)(tm,{className:TC,label:`${e.name} tool input`,value:e.input})}):null,e.output===null?null:(0,H.jsx)(NC,{title:`Output`,children:a===void 0?(0,H.jsx)(`pre`,{"aria-label":`${e.name} tool output`,className:B(`message-json`,TC),children:e.output}):(0,H.jsx)(tm,{className:TC,label:`${e.name} tool output`,value:a})}),!i&&e.output===null?(0,H.jsxs)(`p`,{className:`m-0 px-3.5 py-2 text-[11px] italic text-muted-foreground`,children:[`This `,e.kind,` event carried no input or output.`]}):null]})]})}function FC({usage:e}){let t=[[`Input`,`inputTokens`,e.inputTokens],[`Output`,`outputTokens`,e.outputTokens],[`Cache read`,`cacheReadTokens`,e.cacheReadTokens],[`Cache write`,`cacheWriteTokens`,e.cacheWriteTokens],[`Cost`,`costUsd`,e.costUsd]].filter(([,t])=>Object.hasOwn(e,t));return t.length===0?null:(0,H.jsx)(`dl`,{"aria-label":`Usage`,className:`mt-4.5 flex flex-wrap gap-2`,children:t.map(([e,t,n])=>(0,H.jsxs)(`div`,{className:`flex gap-1.5 rounded-md bg-muted px-2 py-1`,children:[(0,H.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,H.jsx)(`dd`,{className:`m-0 text-[10px] text-muted-foreground`,children:n===null?`Not reported`:t===`costUsd`&&typeof n==`number`?`$${n.toFixed(4)}`:n??`Not reported`})]},t))})}function IC({events:e}){return(0,H.jsx)(`section`,{"aria-label":`Agent activity`,className:`my-3 space-y-2`,children:[...e].sort((e,t)=>e.index-t.index).map(e=>e.kind===`reasoning`?(0,H.jsx)(wi,{collapsible:!0,type:`single`,children:(0,H.jsxs)(Ti,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:`reasoning-${e.index}`,children:[(0,H.jsx)(Ei,{className:`py-1.5 text-xs text-muted-foreground`,children:`Reasoning`}),(0,H.jsx)(Di,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:e.text})]})},`reasoning-${e.index}`):(0,H.jsx)(`div`,{"aria-label":`Agent message`,className:`border-l-2 border-primary pl-3`,role:`group`,children:(0,H.jsx)(CC,{label:`Agent message`,children:e.text})},`message-${e.index}`))})}function LC({author:e,focus:t,turn:n}){let r=(0,V.useRef)(null),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)([]),c=t?.turnId===n.id,l=c?zp(n.tools).find(e=>t.toolCallId===void 0?t.eventIndex!==void 0&&e.eventIndices.includes(t.eventIndex):e.toolCallId===t.toolCallId):void 0,u=l?.id,d=c?JSON.stringify(t):void 0;(0,V.useEffect)(()=>{d&&(a(!1),u&&s(e=>e.includes(u)?e:[...e,u]))},[d,u]),(0,V.useEffect)(()=>{!d||i||u&&!o.includes(u)||(r.current?.scrollIntoView?.({block:`nearest`}),r.current?.querySelector(`[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`}))},[d,i,o,u]);let f=Object.keys(n.unknown).length>0,m=zp(n.tools),h=n.status===`running`;return(0,H.jsxs)(`article`,{ref:r,"data-turn-id":n.id,"aria-current":c&&!l?`true`:void 0,"aria-label":`Turn ${n.id} from ${n.harness}`,className:`mx-auto mb-10.5 max-w-[850px]`,children:[(0,H.jsxs)(`button`,{className:`mb-2 text-[10px] text-muted-foreground hover:text-foreground`,type:`button`,"aria-expanded":!i,onClick:()=>a(!i),children:[i?`Expand`:`Collapse`,` turn `,n.id]}),(0,H.jsxs)(`div`,{hidden:i,children:[(0,H.jsx)(Kp,{from:`user`,children:(0,H.jsxs)(qp,{className:`mb-8 ml-auto max-w-[min(680px,88%)] rounded-[22px_22px_5px_22px] border bg-popover px-5 py-4.5`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:`You`}),h&&!n.user?(0,H.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`The prompt is recorded when this run finishes.`}):(0,H.jsx)(CC,{label:`User message`,children:n.user})]})}),(0,H.jsxs)(Kp,{from:`assistant`,children:[(0,H.jsx)(Jp,{...e?.avatar?{src:e.avatar}:{},children:e?e.label.slice(0,2).toUpperCase():`OH`}),(0,H.jsxs)(qp,{className:`pt-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:[(0,H.jsx)(`span`,{children:e?.label??n.harness}),n.model?(0,H.jsx)(p,{variant:`secondary`,className:`font-medium normal-case tracking-normal`,children:n.model}):null]}),n.reasoning?(0,H.jsx)(wi,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,H.jsxs)(Ti,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:`reasoning`,children:[(0,H.jsx)(Ei,{className:`text-xs text-muted-foreground`,children:`Reasoning`}),(0,H.jsx)(Di,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:n.reasoning})]})}):null,n.agentEvents?.length?(0,H.jsx)(IC,{events:n.agentEvents}):null,m.length>0?(0,H.jsx)(`section`,{"aria-label":`Tool calls`,className:`my-3`,children:(0,H.jsx)(wi,{className:`space-y-1`,type:`multiple`,value:o,onValueChange:s,children:m.map(e=>(0,H.jsx)(PC,{current:l?.id===e.id,invocation:e},e.id))})}):null,n.assistant?(0,H.jsx)(CC,{label:`Assistant message`,children:n.assistant}):h?(0,H.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,role:`status`,children:`Still running. Its final answer appears when the run finishes.`}):(0,H.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`No assistant text was captured for this run.`}),n.failureKind?(0,H.jsxs)(`p`,{"aria-label":`Failure: ${n.failureKind}`,className:`border-l-2 border-destructive pl-2.5 text-xs text-destructive`,role:`note`,children:[`Failure: `,n.failureKind]}):null,(0,H.jsx)(FC,{usage:n.usage}),f?(0,H.jsx)(wi,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,H.jsxs)(Ti,{className:`rounded-[10px] border bg-card px-3`,value:`unknown`,children:[(0,H.jsx)(Ei,{className:`text-xs text-muted-foreground`,children:`Additional upstream data`}),(0,H.jsx)(Di,{className:`-mx-3 border-t p-0`,children:(0,H.jsx)(DC,{label:`Additional upstream data detail`,value:n.unknown})})]})}):null]})]})]})]})}var RC=tt(),zC=1e3;function BC(e){let t=e.lastIndexOf(`:`);return{epoch:e.slice(0,t),seq:BigInt(e.slice(t+1))}}var VC=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=!1;#l=!1;#u=0;#d;#f=()=>{this.#x(),this.#t.onDisconnected?.()};#p=()=>this.#y();#m=()=>this.close(!0);constructor(e,t){this.#e=e,this.#t=t,this.#n=t.view,this.#d=t.paused??!1,globalThis.addEventListener?.(`offline`,this.#f),globalThis.addEventListener?.(`online`,this.#p),globalThis.addEventListener?.(`pagehide`,this.#m);let n=t.initial;if(n===void 0)this.#h({});else{let e=++this.#u;queueMicrotask(()=>{e===this.#u&&!this.#c&&this.#g(n)})}}get view(){return this.#n}change(e){this.#c||ZC(e,this.#n)||(this.#n=e,this.#l=!1,this.#x(),this.#h(this.#r===void 0?{}:{replaces:this.#r}))}pause(){this.#d||(this.#d=!0,this.#x())}resume(){this.#d&&(this.#d=!1,this.#y())}close(e=!1){this.#c||(this.#c=!0,this.#u+=1,globalThis.removeEventListener?.(`offline`,this.#f),globalThis.removeEventListener?.(`online`,this.#p),globalThis.removeEventListener?.(`pagehide`,this.#m),this.#x(),this.#r!==void 0&&this.#e.retire(this.#r,e).catch(()=>void 0))}async#h(e){let t=++this.#u,n;try{n=await this.#e.subscribe({view:this.#n,...e})}catch(e){if(t!==this.#u)return;this.#t.onError?.($C(e));return}if(t!==this.#u||this.#c){this.#e.retire(n.subscription).catch(()=>void 0);return}this.#_(n)}#g(e){let t;try{t=this.#e.parseSubscribed(e)}catch(e){this.#t.onError?.(Error(`The first answer failed contract validation: ${QC(e)}`));return}this.#_(t)}#_(e){let t=XC(this.#n,e);if(t!==void 0){this.#w(Error(`The subscription answered ${t}`));return}this.#r=e.subscription;let n=e.initial;if(n.type===`snapshot`)this.#v(n.snapshot,{kind:`snapshot`});else if(n.subscription!==e.subscription||n.snapshot.id!==n.id){this.#w(Error(`A recreated subscription's reset is not its own snapshot`));return}else this.#v(n.snapshot,{kind:`reset`,reason:n.reason});this.#y()}#v(e,t){this.#i={sidebar:e.sidebar??this.#i?.sidebar,visible:e.visible,applied:e.id},this.#t.onState(this.#i,t)}#y(){if(this.#c||this.#l||this.#d||this.#a!==void 0||this.#r===void 0||this.#i===void 0)return;this.#o!==void 0&&clearTimeout(this.#o),this.#o=void 0;let e=this.#e.url(Ae.events);e.searchParams.set(Oe.subscription,this.#r),e.searchParams.set(Oe.after,this.#i.applied);let t=this.#e.open(e);this.#a=t;let n=!1;this.#s=setTimeout(()=>{this.#a===t&&this.#w(new it(`Opening the live stream`))},Je),t.onopen=()=>{this.#b(),n&&this.#t.onConnected?.(),n=!0};for(let e of vt)t.addEventListener(e,n=>{this.#a===t&&n instanceof MessageEvent&&typeof n.data==`string`&&(this.#b(),this.#C(n.data,e,n.lastEventId))});t.onerror=()=>{this.#a===t&&(this.#t.onDisconnected?.(),t.readyState===2&&(this.#a=void 0,this.#o=setTimeout(()=>{this.#o=void 0,!(this.#c||this.#l||this.#i===void 0)&&this.#h({resume:this.#i.applied})},zC)))}}#b(){this.#s!==void 0&&clearTimeout(this.#s),this.#s=void 0}#x(){this.#b(),this.#a?.close(),this.#a=void 0,this.#o!==void 0&&clearTimeout(this.#o),this.#o=void 0}#S(){this.#x(),this.#y()}#C(e,t,n){let r=this.#i;if(r===void 0||this.#l)return;let i;try{i=se.parse(JSON.parse(e))}catch(e){this.#w(Error(`A frame failed contract validation: ${QC(e)}`));return}if(i.subscription!==this.#r)return;if(i.type!==t||i.id!==n){this.#w(Error(`A frame's SSE event or id is not the frame's own type and id`));return}let a=BC(r.applied),o=BC(i.id);if(o.epoch===a.epoch&&o.seq<=a.seq)return;if(i.type===`reset`){if(i.snapshot.id!==i.id){this.#w(Error(`A reset frame names a snapshot other than itself`));return}let e=YC(this.#n,i.snapshot);if(e!==void 0){this.#w(Error(`A reset frame re-sent ${e}`));return}this.#v(i.snapshot,{kind:`reset`,reason:i.reason});return}if(o.epoch!==a.epoch){this.#w(Error(`A frame names another server's epoch`));return}if(i.base!==r.applied){this.#S();return}let s;try{s={...HC(r,i,this.#n),applied:i.id}}catch(e){this.#w(Error(`A patch could not be applied: ${QC(e)}`));return}this.#i=s,this.#t.onState(s,{kind:`frame`,frame:i})}#w(e){this.#l=!0,this.#x(),this.#t.onError?.(e)}};function HC(e,t,n){switch(t.type){case`sidebar.snapshot`:return{sidebar:t.rows,visible:e.visible};case`run.changed`:{let n=e.sidebar??[],r=n.findIndex(e=>e.id===t.row.id);return{sidebar:r===-1?[...n,t.row]:n.map((e,n)=>n===r?t.row:e),visible:e.visible}}case`run.removed`:return{sidebar:e.sidebar?.filter(e=>e.id!==t.run_id),visible:e.visible};default:return{sidebar:e.sidebar,visible:WC(e.visible,t,n)}}}function UC(e,t,n,r){let i=e.safeParse(gt(t,n));if(!i.success)throw Error(`the patched ${r} failed contract validation`);return i.data}function WC(e,t,n){let r=e=>Error(`a ${t.type} for ${e} this tab does not show`);if(t.type===`human-items.patch`){if(e.type!==`human-items`)throw r(`human items`);let i=UC(Ye,e,t.ops,`human items`);if(JC(n,i))throw Error(`a human-items.patch moved its detail to another item`);return i}if(e.type===`sidebar`||e.type===`human-items`||e.run_id!==t.run_id)throw r(`a run`);let i=n=>{if(n.run_id!==e.run_id)throw Error(`a ${t.type} moved its payload to another run`);return n};switch(t.type){case`detail.patch`:return{...e,detail:(()=>{let n=UC(Le,e.detail,t.ops,`detail`);return i(n.run),n})()};case`timeline.patch`:if(e.type!==`timeline`||e.scope!==t.scope)throw r(`a timeline`);if(t.scope===`node`&&(e.scope!==`node`||e.node!==t.node))throw r(`a node's timeline`);return{...e,timeline:i(UC(ne,e.timeline,t.ops,`timeline`))};case`channel.patch`:if(e.type!==`channel`)throw r(`a channel`);return{...e,channel:i(UC(mt,e.channel,t.ops,`channel`))}}}function GC(e){return[e.type,e.run_id,e.scope,e.node].join(`\0`)}function KC(e){return Array.isArray(e)?e.map(KC):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,KC(t)])):e}function qC(e){if(e!==void 0){if(typeof e!=`string`)return JSON.stringify(KC(e));if(!e.startsWith(`{`))return e;try{return JSON.stringify(KC(JSON.parse(e)))}catch{return e}}}function JC(e,t){return t.detail===null?!1:!(`item`in e)||t.detail.item.id!==e.item}function YC(e,t){let n=t.visible;if(GC(n)!==GC(e))return`the state of another view`;if(n.type===`human-items`)return JC(e,n)?`the detail of another item`:void 0;if(n.type!==`sidebar`)return[n.detail.run.run_id,`timeline`in n?n.timeline.run_id:n.run_id,`channel`in n?n.channel.run_id:n.run_id].every(e=>e===n.run_id)?void 0:`a payload of another run`}function XC(e,t){if(GC(t.view)!==GC(e))return`another view`;let n=e=>`filter`in e?e.filter:void 0;if(qC(n(t.view))!==qC(n(e)))return`another filter`;let r=e=>`item`in e?e.item:void 0;return r(t.view)===r(e)?YC(e,t.initial.snapshot):`another item`}function ZC(e,t){return JSON.stringify(e)===JSON.stringify(t)}function QC(e){return e instanceof Error?e.message:String(e)}function $C(e){return e instanceof Error?e:Error(String(e))}var ew=class extends Error{status;code;constructor(e,t,n,r){super(e,r),this.status=t,this.code=n,this.name=`TelemetryClientError`}},tw=50,nw=class{#e;#t;#n;constructor(e,t={}){this.#e=new URL(e),this.#t=t.fetch??globalThis.fetch,this.#n=t.eventSource}async listRuns(e=!1,t,n=tw){let r=this.#r(Ae.runs);return r.searchParams.set(Oe.includeSettled,String(e)),r.searchParams.set(Oe.limit,String(n)),t!==void 0&&r.searchParams.set(Oe.cursor,t),this.#a(r,ie.parse)}async selectRuns(e){if(e.length===0)throw new ew(`Invalid selection`);for(let t of e)if(aw(t,`run ID`),t.includes(`,`))throw new ew(`Invalid run ID`);let t=this.#r(Ae.runs);return t.searchParams.set(Oe.select,e.join(`,`)),this.#a(t,ie.parse)}async getRun(e,t={}){aw(e,`run ID`);let n=this.#r(Ae.run(e));return t.includeConversations!==void 0&&n.searchParams.set(Oe.includeConversations,String(t.includeConversations)),t.filter!==void 0&&n.searchParams.set(Oe.filter,t.filter),this.#a(n,i.parse)}async getTimeline(e,t,n){aw(e,`run ID`);let r=this.#r(Ae.timeline(e));return n!==void 0&&r.searchParams.set(Oe.filter,n),t===void 0?r.searchParams.set(Oe.scope,pe.run):(r.searchParams.set(Oe.scope,pe.node),r.searchParams.set(Oe.node,t)),this.#a(r,ne.parse)}async getConversation(e,t){return aw(e,`run ID`),aw(t,`conversation ID`),this.#a(this.#r(Ae.conversation(e,t)),ee.parse)}async getArtifact(e,t){return aw(e,`run ID`),aw(t,`artifact ID`),this.#a(this.#r(Ae.artifact(e,t)),R.parse)}async getTimelineEvents(e,t){aw(e,`run ID`),t.node!==void 0&&aw(t.node,`node ID`);let n=this.#r(Ae.timelineEvents(e));n.searchParams.set(Oe.scope,t.scope===`node`&&t.node!==void 0?pe.node:pe.run);for(let[e,r]of[[Oe.node,t.node],[Oe.span,t.span],[Oe.cursor,t.cursor],[Oe.from,t.from],[Oe.to,t.to],[Oe.filter,t.filter],[Oe.limit,t.limit===void 0?void 0:String(t.limit)]])r!==void 0&&n.searchParams.set(e,r);return this.#a(n,P.parse,void 0,`This page of the run's history`)}subscribe(e){e.runId!==void 0&&aw(e.runId,`run ID`),e.after!==void 0&&aw(e.after,`cursor`);let t=this.#r(Ae.events);e.runId!==void 0&&t.searchParams.set(Oe.runId,e.runId),e.after!==void 0&&t.searchParams.set(Oe.after,e.after),e.filter!==void 0&&t.searchParams.set(Oe.filter,e.filter);let n=this.#i(t);for(let t of Qe.options)n.addEventListener(t,n=>{try{let r=n,i=JSON.parse(r.data),a=t===`snapshot`?ie.parse(i):S.parse(i);e.onEvent({id:r.lastEventId,event:t,data:a})}catch(t){e.onError?.(t)}});return n.onerror=t=>e.onError?.(t),{close:()=>n.close()}}live(e){return new VC({subscribe:e=>this.createSubscription(e),retire:(e,t)=>this.retireSubscription(e,t),open:e=>this.#i(e),url:e=>this.#r(e),parseSubscribed:e=>le.parse(e)},e)}async createSubscription(e){return this.#a(this.#r(Ae.subscriptions),le.parse,iw(`POST`,e),e.view.type===`sidebar`||e.view.type===`human-items`?`The read of this page`:`The read of this run's history`)}async retireSubscription(e,t=!1){aw(e,`subscription ID`);let n;try{n=await this.#t(this.#r(Ae.subscription(e)),{method:`DELETE`,...t?{keepalive:t}:{}})}catch(e){throw new ew(`Telemetry request failed`,void 0,void 0,{cause:e})}if(!n.ok&&n.status!==204)throw new ew(`Retiring a subscription failed with status ${n.status}`,n.status)}async listProjects(){return this.#a(this.#r(Ae.projects),M.parse)}async getProject(e){return aw(e,`project ID`),this.#a(this.#r(Ae.project(e)),O.parse)}async getChannel(e){return aw(e,`run ID`),this.#a(this.#r(Ae.channel(e)),mt.parse)}async claimNext(e,t){aw(e,`run ID`);let n=this.#r(Ae.channelNext(e));return t!==void 0&&n.searchParams.set(Oe.filter,t),this.#a(n,o.parse,{method:`POST`})}async reply(e,t,n){aw(e,`run ID`);let r=this.#r(Ae.channelReply(e));return n!==void 0&&r.searchParams.set(Oe.correlation,n),this.#a(r,I.parse,{method:`POST`,headers:{"content-type":`application/json`},body:t})}async surface(e,t){return aw(e,`run ID`),this.#a(this.#r(Ae.channelSurface(e)),de.parse,iw(`POST`,t))}async attest(e,t){return aw(e,`run ID`),this.#a(this.#r(Ae.attest(e)),I.parse,iw(`POST`,{reference:t}))}async stop(e,t=!1){return aw(e,`run ID`),this.#a(this.#r(Ae.stop(e)),b.parse,iw(`POST`,{force:t}))}async listHumanItems(e={}){let t=this.#r(ct.list);for(let[n,r]of Object.entries(e))r!=null&&t.searchParams.set(n,String(r));return this.#a(t,Pe.parse)}async getHumanItem(e){return aw(e,`human-item ID`),this.#a(this.#r(ct.item(e)),nt.parse)}async answerHumanItem(e,t){return aw(e,`human-item ID`),this.#a(this.#r(ct.answer(e)),_e.parse,iw(`POST`,typeof t==`string`?{text:t}:t))}async answerHumanItems(e){return this.#a(this.#r(ct.answers),Ke.parse,iw(`POST`,{answers:e}))}async completeHumanItem(e){return aw(e,`human-item ID`),this.#a(this.#r(ct.complete(e)),_e.parse,iw(`POST`,{}))}async dismissHumanItem(e,t){return aw(e,`human-item ID`),this.#a(this.#r(ct.dismiss(e)),_e.parse,iw(`POST`,t?.trim()?{reason:t}:{}))}async reopenHumanItem(e){return aw(e,`human-item ID`),this.#a(this.#r(ct.reopen(e)),_e.parse,iw(`POST`,{}))}async noteHumanItem(e,t){return aw(e,`human-item ID`),this.#a(this.#r(ct.note(e)),_e.parse,iw(`POST`,{text:t}))}async shutdown(e,t={}){return this.#a(this.#r(Ae.shutdown),m.parse,iw(`POST`,{scope:e,...rw(t)}))}async unwatched(){return this.#a(this.#r(Ae.unwatched),Te.parse)}async host(){return this.#a(this.#r(Ae.host),v.parse)}async getStatus(e){return aw(e,`run ID`),this.#a(this.#r(Ae.status(e)),g.parse)}async getAgents(e){return aw(e,`run ID`),this.#a(this.#r(Ae.agents(e)),bt.parse)}async getNodeAgents(e,t){return aw(e,`run ID`),aw(t,`node ID`),this.#a(this.#r(Ae.nodeAgents(e,t)),bt.parse)}async getProjectAgents(e){return aw(e,`project ID`),this.#a(this.#r(Ae.projectAgents(e)),E.parse)}#r(e){return new URL(e,this.#e)}#i(e){return(this.#n??(e=>{if(typeof EventSource>`u`)throw new ew(`EventSource is unavailable; provide an eventSource factory`);return new EventSource(e)}))(e.toString())}async#a(e,t,n,r){let i=r===void 0?void 0:new AbortController,a=i===void 0?void 0:setTimeout(()=>i.abort(),Je);try{return await this.#o(e,t,{...n,...i===void 0?{}:{signal:i.signal}})}catch(e){throw i?.signal.aborted===!0&&r!==void 0?new ew(new it(r).message,void 0,`deadline`,{cause:e}):e}finally{a!==void 0&&clearTimeout(a)}}async#o(e,t,n){let r;try{r=await this.#t(e,n)}catch(e){throw new ew(`Telemetry request failed`,void 0,void 0,{cause:e})}let i=await r.json().catch(e=>{throw r.ok?new ew(`Telemetry server returned invalid JSON`,r.status,void 0,{cause:e}):new ew(`Telemetry request failed with status ${r.status}`,r.status,void 0,{cause:e})});if(!r.ok){let e=ve.safeParse(i);throw new ew(e.success?e.data.error.message:`Telemetry request failed with status ${r.status}`,r.status,e.success?e.data.error.code:void 0)}try{return t(i)}catch(e){throw new ew(`Telemetry response failed contract validation`,r.status,void 0,{cause:e})}}};function rw(e){let{grace:t,force:n=!1}=e;if(t===void 0)return{force:n};if(!Number.isSafeInteger(t)||t<0)throw new ew(`Invalid grace: whole seconds, 0 or more`);return{grace:t,force:n}}function iw(e,t){return{method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}}function aw(e,t){let n=[...e].some(e=>e.charCodeAt(0)<32);if(e.length===0||n||/[/?#]/u.test(e))throw new ew(`Invalid ${t}`)}function ow({outcome:e,label:t}){if(e===void 0)return null;if(e.kind===`refused`){let n=e.error,r=n instanceof ew?n.code:void 0,i=n instanceof ew?n.status:void 0;return(0,H.jsxs)(ki,{"aria-label":`${t} refused`,variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsxs)(Ai,{children:[e.title,i!==void 0&&` · ${i}`,r!==void 0&&` ${r}`]}),(0,H.jsx)(ji,{children:(0,H.jsx)(`pre`,{className:`verb-text`,children:n.message})})]})}return(0,H.jsxs)(ki,{"aria-label":`${t} receipt`,children:[(0,H.jsx)(jt,{}),(0,H.jsx)(Ai,{children:e.title}),(0,H.jsx)(ji,{children:(0,H.jsx)(`pre`,{className:`verb-text`,children:JSON.stringify(e.payload,null,2)})})]})}async function sw(e,t){try{return{kind:`answered`,title:e,payload:await t()}}catch(t){return{kind:`refused`,title:e,error:t instanceof Error?t:Error(String(t))}}}var cw={approve:`Approve`,reject:`Reject`,continue:`Continue`},lw=[`review`,`readjust`,`decline`,`withdraw-note`],uw=[`approve`,`reject`,`continue`,...ft.filter(e=>!lw.some(t=>t===e))];function dw(e){return uw.some(t=>t===e)}var fw={approve:[`message`,`reason`],reject:[`message`,`reason`],continue:[`message`],add:[`json`],drop:[`id`,`dependents`],reparent:[`id`,`deps`],retry:[`id`,`json`],rework:[`id`,`reason`,`instruction`,`comments`,`title`,`replacement`],retitle:[`id`,`title`,`reason`],cancel:[`id`,`reason`],requeue:[`id`,`json`],"set-node-sets":[`id`,`sets`],"set-run-node-sets":[`runSets`],attest:[`reference`],complete:[`reason`],amend:[`id`,`text`],note:[`id`,`addressee`,`text`,`criterion`,`deliver`,`persist`],finding:[`message`,`blocking`,`id`],settle:[`id`,`outcome`,`evidence`,`landing`]};function pw(e,t){let n=mw(e,t);if(`problem`in n)return n;let r=w.safeParse(n.envelope);if(!r.success){let e=r.error.issues[0];return{problem:`${e?.path.join(`.`)||`envelope`}: ${e?.message??`not an envelope`}`}}return{envelope:r.data,bytes:JSON.stringify(r.data,null,2)}}function mw(e,t){let n=e=>{let n=t[e];return typeof n==`string`&&n.trim().length>0?n:void 0};switch(e){case`approve`:return{envelope:{completion:!0,...gw(`message`,n(`message`)),...gw(`reason`,n(`reason`))}};case`reject`:return{envelope:{completion:!1,...gw(`message`,n(`message`)),...gw(`reason`,n(`reason`))}};case`continue`:return{envelope:{message:n(`message`)??``}};default:{let r=hw(e,t,n);return`problem`in r?r:{envelope:{version:4,commands:[r.command]}}}}}function hw(e,t,n){let r=n(`id`);switch(e){case`add`:case`retry`:case`requeue`:{let t=n(`json`);if(t===void 0&&e!==`requeue`)return{problem:`node: a node mapping is required`};let i;if(t!==void 0)try{i=JSON.parse(t)}catch(t){return{problem:`${e===`requeue`?`amend`:`node`}: ${t instanceof Error?t.message:`not JSON`}`}}return e===`add`?{command:{op:e,node:i}}:e===`retry`?{command:{op:e,id:r,node:i}}:{command:{op:e,id:r,...gw(`amend`,i)}}}case`set-node-sets`:case`set-run-node-sets`:{let n=[...(e===`set-node-sets`?t.sets:t.runSets)??[]],i=n.findIndex(e=>e.trim().length===0);return i>=0?{problem:`sets.${i}: an override needs a PATH=VALUE`}:e===`set-node-sets`?{command:{op:e,id:r,sets:n}}:{command:{op:e,sets:n}}}case`drop`:return{command:{op:e,id:r,dependents:n(`dependents`)}};case`reparent`:return{command:{op:e,id:r,deps:(t.deps??``).split(`
62
+ `).map(e=>e.trim()).filter(e=>e.length>0)}};case`rework`:{let t,i=n(`comments`);if(i!==void 0)try{t=JSON.parse(i)}catch(e){return{problem:`comments: ${e instanceof Error?e.message:`not JSON`}`}}return{command:{op:e,id:r,reason:n(`reason`),instruction:n(`instruction`),...gw(`comments`,t),...gw(`title`,n(`title`)),...gw(`replacement`,n(`replacement`))}}}case`retitle`:return{command:{op:e,id:r,title:n(`title`),reason:n(`reason`)}};case`cancel`:return{command:{op:e,id:r,...gw(`reason`,n(`reason`))}};case`attest`:return{command:{op:e,ref:n(`reference`)}};case`complete`:return{command:{op:e,reason:n(`reason`)}};case`amend`:return{command:{op:e,id:r,text:n(`text`)}};case`note`:return{command:{op:e,id:r,addressee:n(`addressee`),text:n(`text`),...gw(`criterion`,n(`criterion`)),...gw(`deliver`,n(`deliver`)===`live`?void 0:n(`deliver`)),...t.persist===!1?{persist:!1}:{}}};case`finding`:return{command:{op:e,message:n(`message`),...t.blocking===!0?{blocking:!0}:{},...gw(`id`,r)}};case`settle`:return{command:{op:e,id:r,outcome:n(`outcome`),evidence:n(`evidence`),...gw(`landing`,n(`landing`))}};default:return{problem:`op: ${String(e)} is not an op`}}}function gw(e,t){let n={};return t!==void 0&&(n[e]=t),n}function _w(e){let t=e.op;return typeof t==`string`?t:`?`}function vw({legend:e,sets:t,onChange:n,current:r}){let i=(0,V.useId)(),a=(e,r)=>n(t.map((t,n)=>n===e?r:t)),o=(e,r)=>{let i=[...t],[a]=i.splice(e,1);a!==void 0&&i.splice(r,0,a),n(i)};return(0,H.jsxs)(`fieldset`,{"aria-describedby":`${i}-hint`,className:`sets-editor`,children:[(0,H.jsx)(`legend`,{children:e}),(0,H.jsx)(`p`,{className:`sets-hint`,id:`${i}-hint`,children:`One PATH=VALUE a row, applied in order — the whole list is replaced, and an empty list clears it.`}),t.length===0?(0,H.jsx)(`p`,{className:`sets-empty`,children:`No overrides: sends an empty list.`}):(0,H.jsx)(`ol`,{className:`sets-list`,children:t.map((e,r)=>{let i=r+1;return(0,H.jsxs)(`li`,{className:`sets-row`,children:[(0,H.jsx)(Ws,{"aria-label":`Override ${i}`,className:`sets-entry`,onChange:e=>a(r,e.target.value),placeholder:`members.worker.agent.model=VALUE`,spellCheck:!1,value:e}),(0,H.jsx)(G,{"aria-label":`Move override ${i} up`,disabled:r===0,onClick:()=>o(r,r-1),size:`icon`,type:`button`,variant:`ghost`,children:(0,H.jsx)(Tt,{})}),(0,H.jsx)(G,{"aria-label":`Move override ${i} down`,disabled:r===t.length-1,onClick:()=>o(r,r+1),size:`icon`,type:`button`,variant:`ghost`,children:(0,H.jsx)(Ct,{})}),(0,H.jsx)(G,{"aria-label":`Remove override ${i}`,onClick:()=>n(t.filter((e,t)=>t!==r)),size:`icon`,type:`button`,variant:`ghost`,children:(0,H.jsx)(an,{})})]},r)})}),(0,H.jsxs)(`div`,{className:`composer-actions`,children:[(0,H.jsxs)(G,{onClick:()=>n([...t,``]),size:`sm`,type:`button`,variant:`outline`,children:[(0,H.jsx)(qt,{size:14}),` Add override`]}),(0,H.jsxs)(G,{disabled:r===void 0,onClick:()=>{r!==void 0&&n([...r])},size:`sm`,type:`button`,variant:`outline`,children:[(0,H.jsx)(C,{size:14}),` Load current list`]}),(0,H.jsx)(`span`,{className:`sets-current`,children:r===void 0?`No current list to load`:r.length===0?`Current list: none`:`Current list: ${r.join(` · `)}`})]})]})}function yw(e,t,n){let[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)();return{run:(0,V.useCallback)(async(...r)=>{i(!0);let a=await sw(typeof e==`string`?e:e(...r),()=>t(...r));return o(a),i(!1),a.kind===`answered`&&n?.(),a},[e,t,n]),pending:r,outcome:a}}function bw(e,t,n,r){let[i,a]=(0,V.useState)(`continue`),[o,s]=(0,V.useState)({}),[c,l]=(0,V.useState)(),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(``);return{shortcut:i,setShortcut:a,fields:o,setField:(0,V.useCallback)((e,t)=>s(n=>({...n,[e]:t})),[]),problem:c,compose:(0,V.useCallback)(()=>{let e=pw(i,{...n,...o});if(`problem`in e){l(e.problem);return}l(void 0),d(e.bytes)},[i,o,n]),envelope:u,setEnvelope:d,correlation:f,setCorrelation:p,send:yw(`Reply`,(0,V.useCallback)(()=>e.reply(t,u,f.trim()===``?void 0:f.trim()),[e,t,u,f]),r)}}var xw={message:`Message`,reason:`Reason`,instruction:`Instruction`,title:`Title`,replacement:`Replacement node id (optional)`,comments:`Review comments (JSON, optional)`,id:`Node id`,text:`Text`,addressee:`Addressee`,deliver:`Deliver`,persist:`Carry to the next dispatch if no turn takes it`,criterion:`Criterion (optional)`,dependents:`Dependents`,deps:`Dependencies, one per line`,reference:`Reference`,outcome:`Outcome`,evidence:`Evidence`,landing:`Landing (optional)`,blocking:`Blocking`,json:`Mapping (JSON)`,sets:`Node overrides`,runSets:`Run-wide overrides`},Sw={addressee:n.options,deliver:Fe.options,dependents:u.options,outcome:ae.options},Cw=Object.fromEntries(Object.entries(Sw).map(([e,t])=>[e,t[0]]));function ww({client:e,runId:t,onSent:n,overrides:r}){let i=(0,V.useId)(),{shortcut:a,setShortcut:o,fields:s,setField:c,problem:l,compose:u,envelope:d,setEnvelope:f,correlation:p,setCorrelation:m,send:h}=bw(e,t,Cw,n);return(0,H.jsxs)(`section`,{"aria-labelledby":`${i}-heading`,className:`composer`,children:[(0,H.jsx)(`h3`,{id:`${i}-heading`,children:`Reply`}),(0,H.jsxs)(`div`,{className:`composer-shortcut`,children:[(0,H.jsx)(qs,{htmlFor:`${i}-shortcut`,children:`Shortcut`}),(0,H.jsxs)(`select`,{className:`composer-select`,id:`${i}-shortcut`,onChange:e=>{let t=e.target.value;dw(t)&&o(t)},value:a,children:[(0,H.jsx)(`optgroup`,{label:`Verdict`,children:Object.entries(cw).map(([e,t])=>(0,H.jsx)(`option`,{value:e,children:t},e))}),(0,H.jsx)(`optgroup`,{label:`Edit`,children:uw.filter(e=>!(e in cw)).map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})]})]}),(0,H.jsx)(`div`,{className:`composer-fields`,children:fw[a].map(e=>{let t=`${i}-${e}`,n=Sw[e];if(e===`sets`||e===`runSets`){let t=typeof s.id==`string`?s.id.trim():``;return(0,H.jsx)(vw,{current:e===`runSets`?r?.run:r?.nodes.get(t),legend:`${xw[e]}, in order`,onChange:t=>c(e,t),sets:s[e]??[]},e)}if(e===`persist`||e===`blocking`)return(0,H.jsxs)(`div`,{className:`composer-check`,children:[(0,H.jsx)(`input`,{checked:e===`persist`?s.persist!==!1:s.blocking===!0,id:t,onChange:t=>c(e,t.target.checked),type:`checkbox`}),(0,H.jsx)(qs,{htmlFor:t,children:xw[e]})]},e);let a=s[e],o=typeof a==`string`?a:``;return(0,H.jsxs)(`div`,{className:`composer-field`,children:[(0,H.jsx)(qs,{htmlFor:t,children:xw[e]}),n===void 0?e===`message`||e===`text`||e===`json`||e===`deps`||e===`evidence`?(0,H.jsx)(Uf,{id:t,onChange:t=>c(e,t.target.value),rows:e===`json`?5:2,value:o}):(0,H.jsx)(Ws,{id:t,onChange:t=>c(e,t.target.value),value:o}):(0,H.jsx)(`select`,{className:`composer-select`,id:t,onChange:t=>c(e,t.target.value),value:o||n[0],children:n.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})]},e)})}),(0,H.jsxs)(`div`,{className:`composer-actions`,children:[(0,H.jsxs)(G,{onClick:u,size:`sm`,type:`button`,variant:`outline`,children:[(0,H.jsx)(nn,{size:14}),` Compose envelope`]}),l!==void 0&&(0,H.jsx)(`p`,{"aria-label":`Envelope not composed`,className:`composer-problem`,role:`alert`,children:l})]}),(0,H.jsxs)(`div`,{className:`composer-field`,children:[(0,H.jsx)(qs,{htmlFor:`${i}-envelope`,children:`Envelope (sent as typed)`}),(0,H.jsx)(Uf,{className:`composer-envelope`,id:`${i}-envelope`,onChange:e=>f(e.target.value),rows:8,spellCheck:!1,value:d})]}),(0,H.jsxs)(`div`,{className:`composer-field composer-correlation`,children:[(0,H.jsx)(qs,{htmlFor:`${i}-correlation`,children:`Correlation (optional)`}),(0,H.jsx)(Ws,{id:`${i}-correlation`,onChange:e=>m(e.target.value),value:p})]}),(0,H.jsxs)(`div`,{className:`composer-actions`,children:[(0,H.jsxs)(G,{disabled:h.pending||d.trim()===``,onClick:()=>void h.run(),size:`sm`,type:`button`,children:[(0,H.jsx)(Qt,{size:14}),` Send reply`]}),(0,H.jsx)(`span`,{"aria-live":`polite`,className:`run-list-status`,children:h.pending?`Sending…`:``})]}),(0,H.jsx)(ow,{label:`Reply`,outcome:h.outcome})]})}function Tw(e){return(0,V.useMemo)(()=>{let t=new Set(e.surfaces.flatMap(e=>e.correlation?[e.correlation]:[]));return{exchanges:[...e.surfaces].reverse().map(t=>({surface:t,replies:e.replies.filter(e=>t.correlation!==void 0&&e.correlation===t.correlation)})),otherReplies:e.replies.filter(e=>!t.has(e.correlation??``))}},[e])}function Ew({client:e,runId:t,filter:n,decisions:r,observedAt:i,channel:a,journalSeq:o,overrides:s}){let c=(0,V.useCallback)(()=>void 0,[]),l=yw(`Next`,(0,V.useCallback)(()=>e.claimNext(t,n),[e,t,n]),c);return(0,H.jsx)(wd,{className:`h-full`,children:(0,H.jsxs)(`div`,{className:`channel-view`,"data-journal-seq":o,children:[(0,H.jsxs)(`section`,{"aria-labelledby":`channel-queue-heading`,className:`channel-section`,children:[(0,H.jsxs)(`div`,{className:`section-heading channel-heading`,children:[(0,H.jsxs)(`h3`,{id:`channel-queue-heading`,children:[(0,H.jsx)(It,{size:15}),` Channel queue`]}),(0,H.jsx)(G,{disabled:l.pending,onClick:()=>void l.run(),size:`sm`,type:`button`,children:`Next`})]}),a===void 0?(0,H.jsxs)(`div`,{"aria-live":`polite`,className:`loading-state`,children:[(0,H.jsx)(Rd,{className:`h-2 w-48`}),`Loading channel…`]}):(0,H.jsx)(Dw,{observedAt:i,queue:a}),(0,H.jsx)(ow,{label:`Next`,outcome:l.outcome})]}),(0,H.jsx)(Fw,{client:e,decisions:r,onWrote:c,runId:t}),(0,H.jsx)(ww,{client:e,onSent:c,overrides:s,runId:t}),(0,H.jsx)(Iw,{client:e,onRaised:c,runId:t})]})})}function Dw({queue:e,observedAt:t}){let{exchanges:n,otherReplies:r}=Tw(e);return(0,H.jsxs)(`div`,{className:`channel-queue`,children:[(0,H.jsxs)(`section`,{"aria-label":`Surfaces`,className:`channel-list`,children:[(0,H.jsx)(`h4`,{children:`Conversation`}),e.surfaces.length===0&&(0,H.jsx)(`p`,{className:`channel-empty`,children:`No surfaces yet.`}),(0,H.jsx)(`ul`,{children:n.map(({surface:e,replies:n})=>(0,H.jsxs)(`li`,{"aria-label":`Surface ${e.id}`,children:[(0,H.jsx)(Mw,{observedAt:t,surface:e}),n.length===0?(0,H.jsx)(`p`,{className:`channel-empty`,children:`Waiting for reply`}):n.map(e=>(0,H.jsx)(kw,{reply:e},e.id))]},e.id))})]}),(0,H.jsxs)(`section`,{"aria-label":`Replies`,className:`channel-list`,children:[(0,H.jsx)(`h4`,{children:`Other replies`}),r.map(e=>(0,H.jsx)(kw,{reply:e},e.id))]}),(0,H.jsxs)(`section`,{"aria-label":`Queued commands`,className:`channel-list`,children:[(0,H.jsx)(`h4`,{children:`Queued commands`}),e.commands.length===0?(0,H.jsx)(`p`,{className:`channel-empty`,children:`Nothing awaits the reconciler.`}):(0,H.jsx)(`ul`,{children:e.commands.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(ea,{className:`channel-card`,children:(0,H.jsxs)(ta,{children:[(0,H.jsxs)(`div`,{className:`channel-card-head`,children:[(0,H.jsxs)(`strong`,{className:`channel-card-title`,children:[`Envelope `,e.id,` · from`,` `,Aw(f(e.provenance))]}),(0,H.jsx)(`span`,{className:`channel-age`,children:e.commands.map(_w).join(`, `)})]}),(0,H.jsx)(jw,{commands:e.commands})]})})},e.id))})]}),(0,H.jsxs)(`section`,{"aria-label":`Command outcomes`,className:`channel-list`,children:[(0,H.jsx)(`h4`,{children:`Command outcomes`}),e.outcomes.length===0?(0,H.jsx)(`p`,{className:`channel-empty`,children:`The reconciler has answered nothing yet.`}):(0,H.jsx)(`ul`,{children:e.outcomes.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(ea,{className:`channel-card`,children:(0,H.jsxs)(ta,{children:[(0,H.jsxs)(`div`,{className:`channel-card-head`,children:[(0,H.jsxs)(`strong`,{className:`channel-card-title`,children:[`Envelope `,e.id]}),(0,H.jsx)(p,{variant:e.applied?`default`:`destructive`,children:e.applied?`applied`:`not applied`})]}),e.reason!==void 0&&(0,H.jsx)(`pre`,{className:`verb-text`,children:e.reason}),e.results!==void 0&&e.results.length>0&&(0,H.jsx)(`pre`,{className:`verb-text`,children:JSON.stringify(e.results,null,2)})]})})},e.id))})]})]})}function Ow({text:e,children:t,meta:n,label:r}){let i=e.split(/\r?\n/,1)[0];return(0,H.jsxs)(`details`,{"aria-label":r,className:`channel-message-details`,children:[(0,H.jsxs)(`summary`,{"aria-label":`${r}: ${i}`,children:[(0,H.jsx)(`span`,{className:`channel-message-meta`,children:n}),(0,H.jsxs)(`span`,{className:`channel-message-preview`,children:[i,`…`]})]}),(0,H.jsx)(`pre`,{className:`verb-text`,children:e}),t]})}function kw({reply:e}){let t=typeof e.reply.message==`string`?e.reply.message:`Reply without message`;return(0,H.jsx)(ea,{className:`channel-card py-2`,children:(0,H.jsx)(ta,{children:(0,H.jsx)(Ow,{label:`Reply ${e.id} message`,text:t,meta:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`strong`,{className:`channel-card-title`,children:[`Reply `,e.id,` · from`,` `,Aw(f(e.reply.provenance))]}),(0,H.jsx)(N,{at:fe(e.at),className:`channel-age`,relative:!0})]}),children:(0,H.jsxs)(`details`,{"aria-label":`Raw envelope for reply ${e.id}`,children:[(0,H.jsx)(`summary`,{children:`Raw envelope`}),(0,H.jsx)(`pre`,{className:`verb-text`,children:JSON.stringify(e.reply,null,2)})]})})})})}function Aw(e){return e===`user`?`you`:`the manager`}function jw({commands:e}){let t=e.flatMap((e,t)=>e.op===`note`&&typeof e.id==`string`&&typeof e.text==`string`?[{index:t,node:e.id,text:e.text}]:[]);return t.length===0?null:(0,H.jsx)(`ul`,{"aria-label":`Notes`,className:`channel-envelope-notes`,children:t.map(e=>(0,H.jsxs)(`li`,{children:[`Note to `,e.node,`: `,e.text]},e.index))})}function Mw({surface:e,observedAt:t}){let n=Math.max(0,(Date.parse(t)-e.queued_at)/1e3),r=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p,{children:e.kind}),e.blocking&&(0,H.jsx)(p,{variant:`destructive`,children:`blocking`}),(0,H.jsxs)(`span`,{className:`channel-age`,children:[`from `,e.source,e.workstream!==void 0&&` · node ${e.workstream}`,` · surface ${e.id} · ${ce(n)} old`]})]}),i=e.declined_ruling;return(0,H.jsx)(ea,{className:`channel-card py-2`,children:(0,H.jsx)(ta,{children:i===void 0?(0,H.jsx)(Ow,{label:`Surface ${e.id} message`,text:e.message,meta:r}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`channel-card-head`,children:r}),(0,H.jsx)(Pw,{ruling:i,source:e.source})]})})})}var Nw={note:`note`,amendment:`amendment`,answer:`answer`};function Pw({ruling:e,source:t}){let n=e.provenance===`user`?`your`:`the manager's`;return(0,H.jsxs)(`section`,{"aria-label":`Declined ruling`,className:`declined-ruling`,children:[(0,H.jsxs)(`p`,{children:[`The `,t,` on `,e.node,` declined `,n,` `,Nw[e.kind],` from reply `,e.reply]}),(0,H.jsx)(`blockquote`,{children:e.text}),(0,H.jsxs)(`p`,{children:[`Reason: `,e.reason]})]})}function Fw({client:e,runId:t,decisions:n,onWrote:r}){let i=Lw(e,t,r);return(0,H.jsxs)(`section`,{"aria-labelledby":`attest-heading`,className:`channel-section`,children:[(0,H.jsxs)(`h3`,{id:`attest-heading`,children:[(0,H.jsx)(Et,{size:15}),` Ready human actions`]}),n===void 0?(0,H.jsx)(`p`,{className:`channel-empty`,children:De}):n.length===0?(0,H.jsx)(`p`,{className:`channel-empty`,children:`No decision point is holding the graph.`}):(0,H.jsx)(`ul`,{className:`attest-list`,children:n.map(e=>(0,H.jsxs)(`li`,{className:`attest-row`,children:[(0,H.jsxs)(`span`,{children:[(0,H.jsx)(p,{variant:`outline`,children:e.kind}),` `,(0,H.jsx)(`span`,{className:`attest-reference`,children:e.id}),e.unblocks.length>0&&(0,H.jsxs)(`span`,{className:`channel-age`,children:[` `,`· unblocks `,e.unblocks.join(`, `)]})]}),(0,H.jsxs)(G,{disabled:i.pending,onClick:()=>void i.run(e.id),size:`sm`,type:`button`,variant:`outline`,children:[`Attest `,e.id]})]},e.id))}),(0,H.jsx)(ow,{label:`Attest`,outcome:i.outcome})]})}function Iw({client:e,runId:t,onRaised:n}){let r=(0,V.useId)(),{kind:i,setKind:a,message:o,setMessage:s,raise:c}=Rw(e,t,n);return(0,H.jsxs)(`section`,{"aria-labelledby":`${r}-heading`,className:`channel-section`,children:[(0,H.jsxs)(`h3`,{id:`${r}-heading`,children:[(0,H.jsx)(Ut,{size:15}),` Surface`]}),(0,H.jsxs)(`div`,{className:`composer-fields`,children:[(0,H.jsxs)(`div`,{className:`composer-field`,children:[(0,H.jsx)(qs,{htmlFor:`${r}-kind`,children:`Kind`}),(0,H.jsx)(Ws,{id:`${r}-kind`,onChange:e=>a(e.target.value),placeholder:`finding`,value:i})]}),(0,H.jsxs)(`div`,{className:`composer-field`,children:[(0,H.jsx)(qs,{htmlFor:`${r}-message`,children:`Message`}),(0,H.jsx)(Uf,{id:`${r}-message`,onChange:e=>s(e.target.value),rows:2,value:o})]})]}),(0,H.jsx)(`div`,{className:`composer-actions`,children:(0,H.jsx)(G,{disabled:c.pending||i.trim()===``,onClick:()=>void c.run(),size:`sm`,type:`button`,variant:`outline`,children:`Raise surface`})}),(0,H.jsx)(ow,{label:`Surface`,outcome:c.outcome})]})}function Lw(e,t,n){return yw(e=>`Attest ${e}`,(0,V.useCallback)(n=>e.attest(t,n),[e,t]),n)}function Rw(e,t,n){let[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(``);return{kind:r,setKind:i,message:a,setMessage:o,raise:yw(`Surface`,(0,V.useCallback)(()=>e.surface(t,{kind:r,message:a}),[e,t,r,a]),(0,V.useCallback)(()=>{o(``),n()},[n]))}}function zw(e){return/\[[^\]]+\]/.exec(e)?.[0]}function Bw({runId:e,control:t,ended:n}){let{stop:r,stopOpen:i,setStopOpen:a,forceOpen:o,setForceOpen:s,refusal:c}=Vw(t),l=c===void 0?void 0:zw(c.message),u=r.outcome,d=r.pending,f=t.status.value?.liveness;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`run-actions`,children:[f!==void 0&&(0,H.jsx)(p,{"aria-label":`Liveness ${f}`,className:`run-actions-badge`,variant:`outline`,children:f}),!n&&(0,H.jsxs)(G,{"aria-label":`Stop`,disabled:d,onClick:()=>a(!0),size:`sm`,title:`Stop`,type:`button`,variant:`destructive`,children:[(0,H.jsx)(Kt,{size:14}),(0,H.jsx)(`span`,{className:`run-action-label`,children:`Stop`})]})]}),(0,H.jsx)(Fs,{onOpenChange:a,open:i,children:(0,H.jsxs)(zs,{children:[(0,H.jsxs)(Bs,{children:[(0,H.jsxs)(Hs,{children:[`Stop `,e,`?`]}),(0,H.jsx)(Us,{children:`The run is stopped as the acting session. A run another session owns is refused, naming its owner.`})]}),(0,H.jsxs)(Vs,{children:[(0,H.jsx)(Ls,{asChild:!0,children:(0,H.jsx)(G,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,H.jsx)(G,{disabled:d,onClick:()=>void r.run(!1),type:`button`,variant:`destructive`,children:`Stop run`})]})]})}),(0,H.jsx)(Fs,{onOpenChange:s,open:o,children:(0,H.jsxs)(zs,{children:[(0,H.jsxs)(Bs,{children:[(0,H.jsxs)(Hs,{children:[`Force-stop `,e,l!==void 0&&`, overriding ${l}`,`?`]}),(0,H.jsxs)(Us,{children:[c?.message,` — `,`a forced stop is journalled forced with the owner it overrode.`]})]}),(0,H.jsxs)(Vs,{children:[(0,H.jsx)(Ls,{asChild:!0,children:(0,H.jsx)(G,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,H.jsxs)(G,{disabled:d,onClick:()=>void r.run(!0),type:`button`,variant:`destructive`,children:[`Force stop`,l!==void 0&&`, overriding ${l}`]})]})]})}),u!==void 0&&(0,H.jsxs)(`div`,{className:`run-outcomes`,children:[(0,H.jsx)(ow,{label:`Stop`,outcome:u}),c!==void 0&&(0,H.jsx)(`div`,{className:`composer-actions`,children:(0,H.jsx)(G,{onClick:()=>s(!0),size:`sm`,type:`button`,variant:`destructive`,children:`Force stop…`})})]})]})}function Vw(e){let[t,n]=(0,V.useState)(!1),[r,i]=(0,V.useState)(!1),a=yw(e=>e?`Forced stop`:`Stop`,(0,V.useCallback)(async t=>{try{return await e.stop(t)}finally{n(!1),i(!1)}},[e.stop]));return{stop:a,stopOpen:t,setStopOpen:n,forceOpen:r,setForceOpen:i,refusal:a.outcome?.kind===`refused`&&a.outcome.error instanceof ew&&a.outcome.error.code===`not_owner`?a.outcome.error:void 0}}function Hw(e,t,n){let[r,i]=(0,V.useState)({}),a=(0,V.useRef)({key:e});(0,V.useEffect)(()=>{a.current.key=e},[e]),(0,V.useEffect)(()=>{if(e===void 0)return;let n=a.current.out;if(n?.key===e){n.again=!0;return}let r=()=>{let n={key:e,again:!1};a.current.out=n;let o=t=>{a.current.out===n&&(a.current.out=void 0),a.current.key===e&&(t(),n.again&&r())};t().then(t=>o(()=>i({key:e,value:t}))).catch(t=>o(()=>i(n=>({...n.key===e?n:{},key:e,error:Uw(t)}))))};r()},[e,n]);let o=r.key===e?r:void 0;return{value:o?.value,error:o?.error,loading:e!==void 0&&o?.value===void 0&&o?.error===void 0}}function Uw(e){return e instanceof Error?e:Error(String(e))}function Ww(e,t){let[n,r]=(0,V.useState)(0),i=(0,V.useCallback)(()=>r(e=>e+1),[]);return{status:Hw(t,()=>e.getStatus(t??``),n),stop:(0,V.useCallback)(async n=>{try{return await e.stop(t??``,n)}finally{i()}},[e,t,i]),reread:i}}function Gw(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Gw(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Kw={value:()=>{}};function qw(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Jw(n)}function Jw(e){this._=e}function Yw(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Jw.prototype=qw.prototype={constructor:Jw,on:function(e,t){var n=this._,r=Yw(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Xw(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Zw(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Zw(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Jw(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Xw(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Zw(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Kw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Qw={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function $w(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Qw.hasOwnProperty(t)?{space:Qw[t],local:e}:e}function eT(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function tT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function nT(e){var t=$w(e);return(t.local?tT:eT)(t)}function rT(){}function iT(e){return e==null?rT:function(){return this.querySelector(e)}}function aT(e){typeof e!=`function`&&(e=iT(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new qE(r,this._parents)}function oT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function sT(){return[]}function cT(e){return e==null?sT:function(){return this.querySelectorAll(e)}}function lT(e){return function(){return oT(e.apply(this,arguments))}}function uT(e){e=typeof e==`function`?lT(e):cT(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new qE(r,i)}function dT(e){return function(){return this.matches(e)}}function fT(e){return function(t){return t.matches(e)}}var pT=Array.prototype.find;function mT(e){return function(){return pT.call(this.children,e)}}function hT(){return this.firstElementChild}function gT(e){return this.select(e==null?hT:mT(typeof e==`function`?e:fT(e)))}var _T=Array.prototype.filter;function vT(){return Array.from(this.children)}function yT(e){return function(){return _T.call(this.children,e)}}function bT(e){return this.selectAll(e==null?vT:yT(typeof e==`function`?e:fT(e)))}function xT(e){typeof e!=`function`&&(e=dT(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new qE(r,this._parents)}function ST(e){return Array(e.length)}function CT(){return new qE(this._enter||this._groups.map(ST),this._parents)}function wT(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}wT.prototype={constructor:wT,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function TT(e){return function(){return e}}function ET(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new wT(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function DT(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new wT(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function OT(e){return e.__data__}function kT(e,t){if(!arguments.length)return Array.from(this,OT);var n=t?DT:ET,r=this._parents,i=this._groups;typeof e!=`function`&&(e=TT(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=AT(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new qE(o,r),o._enter=s,o._exit=c,o}function AT(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function jT(){return new qE(this._exit||this._groups.map(ST),this._parents)}function MT(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function NT(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new qE(s,this._parents)}function PT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function FT(e){e||=IT;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new qE(i,this._parents).order()}function IT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function LT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function RT(){return Array.from(this)}function zT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function BT(){let e=0;for(let t of this)++e;return e}function VT(){return!this.node()}function HT(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function UT(e){return function(){this.removeAttribute(e)}}function WT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function GT(e,t){return function(){this.setAttribute(e,t)}}function KT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function JT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function YT(e,t){var n=$w(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?WT:UT:typeof t==`function`?n.local?JT:qT:n.local?KT:GT)(n,t))}function XT(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ZT(e){return function(){this.style.removeProperty(e)}}function QT(e,t,n){return function(){this.style.setProperty(e,t,n)}}function $T(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function eE(e,t,n){return arguments.length>1?this.each((t==null?ZT:typeof t==`function`?$T:QT)(e,t,n??``)):tE(this.node(),e)}function tE(e,t){return e.style.getPropertyValue(t)||XT(e).getComputedStyle(e,null).getPropertyValue(t)}function nE(e){return function(){delete this[e]}}function rE(e,t){return function(){this[e]=t}}function iE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function aE(e,t){return arguments.length>1?this.each((t==null?nE:typeof t==`function`?iE:rE)(e,t)):this.node()[e]}function oE(e){return e.trim().split(/^|\s+/)}function sE(e){return e.classList||new cE(e)}function cE(e){this._node=e,this._names=oE(e.getAttribute(`class`)||``)}cE.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function lE(e,t){for(var n=sE(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function uE(e,t){for(var n=sE(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function dE(e){return function(){lE(this,e)}}function fE(e){return function(){uE(this,e)}}function pE(e,t){return function(){(t.apply(this,arguments)?lE:uE)(this,e)}}function mE(e,t){var n=oE(e+``);if(arguments.length<2){for(var r=sE(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?pE:t?dE:fE)(n,t))}function hE(){this.textContent=``}function gE(e){return function(){this.textContent=e}}function _E(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function vE(e){return arguments.length?this.each(e==null?hE:(typeof e==`function`?_E:gE)(e)):this.node().textContent}function yE(){this.innerHTML=``}function bE(e){return function(){this.innerHTML=e}}function xE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function SE(e){return arguments.length?this.each(e==null?yE:(typeof e==`function`?xE:bE)(e)):this.node().innerHTML}function CE(){this.nextSibling&&this.parentNode.appendChild(this)}function wE(){return this.each(CE)}function TE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function EE(){return this.each(TE)}function DE(e){var t=typeof e==`function`?e:nT(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function OE(){return null}function kE(e,t){var n=typeof e==`function`?e:nT(e),r=t==null?OE:typeof t==`function`?t:iT(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function AE(){var e=this.parentNode;e&&e.removeChild(this)}function jE(){return this.each(AE)}function ME(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function NE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function PE(e){return this.select(e?NE:ME)}function FE(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function IE(e){return function(t){e.call(this,t,this.__data__)}}function LE(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function RE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function zE(e,t,n){return function(){var r=this.__on,i,a=IE(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function BE(e,t,n){var r=LE(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?zE:RE,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function VE(e,t,n){var r=XT(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function HE(e,t){return function(){return VE(this,e,t)}}function UE(e,t){return function(){return VE(this,e,t.apply(this,arguments))}}function WE(e,t){return this.each((typeof t==`function`?UE:HE)(e,t))}function*GE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var KE=[null];function qE(e,t){this._groups=e,this._parents=t}function JE(){return new qE([[document.documentElement]],KE)}function YE(){return this}qE.prototype=JE.prototype={constructor:qE,select:aT,selectAll:uT,selectChild:gT,selectChildren:bT,filter:xT,data:kT,enter:CT,exit:jT,join:MT,merge:NT,selection:YE,order:PT,sort:FT,call:LT,nodes:RT,node:zT,size:BT,empty:VT,each:HT,attr:YT,style:eE,property:aE,classed:mE,text:vE,html:SE,raise:wE,lower:EE,append:DE,insert:kE,remove:jE,clone:PE,datum:FE,on:BE,dispatch:WE,[Symbol.iterator]:GE};function XE(e){return typeof e==`string`?new qE([[document.querySelector(e)]],[document.documentElement]):new qE([[e]],KE)}function ZE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function QE(e,t){if(e=ZE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var $E={passive:!1},eD={capture:!0,passive:!1};function tD(e){e.stopImmediatePropagation()}function nD(e){e.preventDefault(),e.stopImmediatePropagation()}function rD(e){var t=e.document.documentElement,n=XE(e).on(`dragstart.drag`,nD,eD);`onselectstart`in t?n.on(`selectstart.drag`,nD,eD):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function iD(e,t){var n=e.document.documentElement,r=XE(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,nD,eD),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var aD=e=>()=>e;function oD(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}oD.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function sD(e){return!e.ctrlKey&&!e.button}function cD(){return this.parentNode}function lD(e,t){return t??{x:e.x,y:e.y}}function uD(){return navigator.maxTouchPoints||`ontouchstart`in this}function dD(){var e=sD,t=cD,n=lD,r=uD,i={},a=qw(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,$E).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(XE(n.view).on(`mousemove.drag`,m,eD).on(`mouseup.drag`,h,eD),rD(n.view),tD(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(nD(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){XE(e.view).on(`mousemove.drag mouseup.drag`,null),iD(e.view,l),nD(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(tD(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(nD(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(tD(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=QE(l||r,t),p,m,h;if((h=n.call(e,new oD(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=QE(l||a,t),_=o;break}u.call(r,e,new oD(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:aD(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:aD(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:aD(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:aD(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function fD(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pD(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mD(){}var hD=.7,gD=1/hD,_D=`\\s*([+-]?\\d+)\\s*`,vD=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,yD=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,bD=/^#([0-9a-f]{3,8})$/,xD=RegExp(`^rgb\\(${_D},${_D},${_D}\\)$`),SD=RegExp(`^rgb\\(${yD},${yD},${yD}\\)$`),CD=RegExp(`^rgba\\(${_D},${_D},${_D},${vD}\\)$`),wD=RegExp(`^rgba\\(${yD},${yD},${yD},${vD}\\)$`),TD=RegExp(`^hsl\\(${vD},${yD},${yD}\\)$`),ED=RegExp(`^hsla\\(${vD},${yD},${yD},${vD}\\)$`),DD={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};fD(mD,MD,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:OD,formatHex:OD,formatHex8:kD,formatHsl:AD,formatRgb:jD,toString:jD});function OD(){return this.rgb().formatHex()}function kD(){return this.rgb().formatHex8()}function AD(){return GD(this).formatHsl()}function jD(){return this.rgb().formatRgb()}function MD(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=bD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ND(t):n===3?new LD(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?PD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?PD(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=xD.exec(e))?new LD(t[1],t[2],t[3],1):(t=SD.exec(e))?new LD(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CD.exec(e))?PD(t[1],t[2],t[3],t[4]):(t=wD.exec(e))?PD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=TD.exec(e))?WD(t[1],t[2]/100,t[3]/100,1):(t=ED.exec(e))?WD(t[1],t[2]/100,t[3]/100,t[4]):DD.hasOwnProperty(e)?ND(DD[e]):e===`transparent`?new LD(NaN,NaN,NaN,0):null}function ND(e){return new LD(e>>16&255,e>>8&255,e&255,1)}function PD(e,t,n,r){return r<=0&&(e=t=n=NaN),new LD(e,t,n,r)}function FD(e){return e instanceof mD||(e=MD(e)),e?(e=e.rgb(),new LD(e.r,e.g,e.b,e.opacity)):new LD}function ID(e,t,n,r){return arguments.length===1?FD(e):new LD(e,t,n,r??1)}function LD(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}fD(LD,ID,pD(mD,{brighter(e){return e=e==null?gD:gD**+e,new LD(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hD:hD**+e,new LD(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new LD(HD(this.r),HD(this.g),HD(this.b),VD(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:RD,formatHex:RD,formatHex8:zD,formatRgb:BD,toString:BD}));function RD(){return`#${UD(this.r)}${UD(this.g)}${UD(this.b)}`}function zD(){return`#${UD(this.r)}${UD(this.g)}${UD(this.b)}${UD((isNaN(this.opacity)?1:this.opacity)*255)}`}function BD(){let e=VD(this.opacity);return`${e===1?`rgb(`:`rgba(`}${HD(this.r)}, ${HD(this.g)}, ${HD(this.b)}${e===1?`)`:`, ${e})`}`}function VD(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function HD(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function UD(e){return e=HD(e),(e<16?`0`:``)+e.toString(16)}function WD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qD(e,t,n,r)}function GD(e){if(e instanceof qD)return new qD(e.h,e.s,e.l,e.opacity);if(e instanceof mD||(e=MD(e)),!e)return new qD;if(e instanceof qD)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new qD(o,s,c,e.opacity)}function KD(e,t,n,r){return arguments.length===1?GD(e):new qD(e,t,n,r??1)}function qD(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}fD(qD,KD,pD(mD,{brighter(e){return e=e==null?gD:gD**+e,new qD(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hD:hD**+e,new qD(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new LD(XD(e>=240?e-240:e+120,i,r),XD(e,i,r),XD(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new qD(JD(this.h),YD(this.s),YD(this.l),VD(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=VD(this.opacity);return`${e===1?`hsl(`:`hsla(`}${JD(this.h)}, ${YD(this.s)*100}%, ${YD(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function JD(e){return e=(e||0)%360,e<0?e+360:e}function YD(e){return Math.max(0,Math.min(1,e||0))}function XD(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ZD=e=>()=>e;function QD(e,t){return function(n){return e+n*t}}function $D(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function eO(e){return(e=+e)==1?tO:function(t,n){return n-t?$D(t,n,e):ZD(isNaN(t)?n:t)}}function tO(e,t){var n=t-e;return n?QD(e,n):ZD(isNaN(e)?t:e)}var nO=(function e(t){var n=eO(t);function r(e,t){var r=n((e=ID(e)).r,(t=ID(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=tO(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function rO(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function iO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function aO(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=mO(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function oO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function sO(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function cO(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=mO(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var lO=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uO=new RegExp(lO.source,`g`);function dO(e){return function(){return e}}function fO(e){return function(t){return e(t)+``}}function pO(e,t){var n=lO.lastIndex=uO.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=lO.exec(e))&&(i=uO.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:sO(r,i)})),n=uO.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?fO(c[0].x):dO(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function mO(e,t){var n=typeof t,r;return t==null||n===`boolean`?ZD(t):(n===`number`?sO:n===`string`?(r=MD(t))?(t=r,nO):pO:t instanceof MD?nO:t instanceof Date?oO:iO(t)?rO:Array.isArray(t)?aO:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?cO:sO)(e,t)}var hO=180/Math.PI,gO={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _O(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*hO,skewX:Math.atan(c)*hO,scaleX:o,scaleY:s}}var vO;function yO(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?gO:_O(t.a,t.b,t.c,t.d,t.e,t.f)}function bO(e){return e==null||(vO||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),vO.setAttribute(`transform`,e),!(e=vO.transform.baseVal.consolidate()))?gO:(e=e.matrix,_O(e.a,e.b,e.c,e.d,e.e,e.f))}function xO(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:sO(e,i)},{i:c-2,x:sO(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:sO(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:sO(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:sO(e,n)},{i:s-2,x:sO(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var SO=xO(yO,`px, `,`px)`,`deg)`),CO=xO(bO,`, `,`)`,`)`),wO=1e-12;function TO(e){return((e=Math.exp(e))+1/e)/2}function EO(e){return((e=Math.exp(e))-1/e)/2}function DO(e){return((e=Math.exp(2*e))-1)/(e+1)}var OO=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<wO)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=TO(y),c=s/(n*g)*(i*DO(t*r+y)-EO(y));return[a+c*d,o+c*f,s*i/TO(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),kO=0,AO=0,jO=0,MO=1e3,NO,PO,FO=0,IO=0,LO=0,RO=typeof performance==`object`&&performance.now?performance:Date,zO=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function BO(){return IO||=(zO(VO),RO.now()+LO)}function VO(){IO=0}function HO(){this._call=this._time=this._next=null}HO.prototype=UO.prototype={constructor:HO,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?BO():+n)+(t==null?0:+t),!this._next&&PO!==this&&(PO?PO._next=this:NO=this,PO=this),this._call=e,this._time=n,JO()},stop:function(){this._call&&(this._call=null,this._time=1/0,JO())}};function UO(e,t,n){var r=new HO;return r.restart(e,t,n),r}function WO(){BO(),++kO;for(var e=NO,t;e;)(t=IO-e._time)>=0&&e._call.call(void 0,t),e=e._next;--kO}function GO(){IO=(FO=RO.now())+LO,kO=AO=0;try{WO()}finally{kO=0,qO(),IO=0}}function KO(){var e=RO.now(),t=e-FO;t>MO&&(LO-=t,FO=e)}function qO(){for(var e,t=NO,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:NO=n);PO=e,JO(r)}function JO(e){kO||(AO&&=clearTimeout(AO),e-IO>24?(e<1/0&&(AO=setTimeout(GO,e-RO.now()-LO)),jO&&=clearInterval(jO)):(jO||=(FO=RO.now(),setInterval(KO,MO)),kO=1,zO(GO)))}function YO(e,t,n){var r=new HO;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var XO=qw(`start`,`end`,`cancel`,`interrupt`),ZO=[];function QO(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;nk(e,n,{name:t,index:r,group:i,on:XO,tween:ZO,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function $O(e,t){var n=tk(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function ek(e,t){var n=tk(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function tk(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function nk(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=UO(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return YO(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(YO(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function rk(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function ik(e){return this.each(function(){rk(this,e)})}function ak(e,t){var n,r;return function(){var i=ek(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ok(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ek(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function sk(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=tk(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ak:ok)(n,e,t))}function ck(e,t,n){var r=e._id;return e.each(function(){var e=ek(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return tk(e,r).value[t]}}function lk(e,t){var n;return(typeof t==`number`?sO:t instanceof MD?nO:(n=MD(t))?(t=n,nO):pO)(e,t)}function uk(e){return function(){this.removeAttribute(e)}}function dk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fk(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function pk(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function mk(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function hk(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function gk(e,t){var n=$w(e),r=n===`transform`?CO:lk;return this.attrTween(e,typeof t==`function`?(n.local?hk:mk)(n,r,ck(this,`attr.`+e,t)):t==null?(n.local?dk:uk)(n):(n.local?pk:fk)(n,r,t))}function _k(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vk(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yk(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&vk(e,i)),n}return i._value=t,i}function bk(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&_k(e,i)),n}return i._value=t,i}function xk(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=$w(e);return this.tween(n,(r.local?yk:bk)(r,t))}function Sk(e,t){return function(){$O(this,e).delay=+t.apply(this,arguments)}}function Ck(e,t){return t=+t,function(){$O(this,e).delay=t}}function wk(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Sk:Ck)(t,e)):tk(this.node(),t).delay}function Tk(e,t){return function(){ek(this,e).duration=+t.apply(this,arguments)}}function Ek(e,t){return t=+t,function(){ek(this,e).duration=t}}function Dk(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Tk:Ek)(t,e)):tk(this.node(),t).duration}function Ok(e,t){if(typeof t!=`function`)throw Error();return function(){ek(this,e).ease=t}}function kk(e){var t=this._id;return arguments.length?this.each(Ok(t,e)):tk(this.node(),t).ease}function Ak(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ek(this,e).ease=n}}function jk(e){if(typeof e!=`function`)throw Error();return this.each(Ak(this._id,e))}function Mk(e){typeof e!=`function`&&(e=dT(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new sA(r,this._parents,this._name,this._id)}function Nk(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new sA(o,this._parents,this._name,this._id)}function Pk(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Fk(e,t,n){var r,i,a=Pk(t)?$O:ek;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ik(e,t){var n=this._id;return arguments.length<2?tk(this.node(),n).on.on(e):this.each(Fk(n,e,t))}function Lk(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Rk(){return this.on(`end.remove`,Lk(this._id))}function zk(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=iT(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,QO(l[f],t,n,f,l,tk(u,n)));return new sA(a,this._parents,t,n)}function Bk(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=cT(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=tk(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&QO(p,t,n,h,f,m);a.push(f),o.push(u)}return new sA(a,o,t,n)}var Vk=JE.prototype.constructor;function Hk(){return new Vk(this._groups,this._parents)}function Uk(e,t){var n,r,i;return function(){var a=tE(this,e),o=(this.style.removeProperty(e),tE(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Wk(e){return function(){this.style.removeProperty(e)}}function Gk(e,t,n){var r,i=n+``,a;return function(){var o=tE(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Kk(e,t,n){var r,i,a;return function(){var o=tE(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),tE(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function qk(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ek(this,e),l=c.on,u=c.value[a]==null?s||=Wk(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Jk(e,t,n){var r=(e+=``)==`transform`?SO:lk;return t==null?this.styleTween(e,Uk(e,r)).on(`end.style.`+e,Wk(e)):typeof t==`function`?this.styleTween(e,Kk(e,r,ck(this,`style.`+e,t))).each(qk(this._id,e)):this.styleTween(e,Gk(e,r,t),n).on(`end.style.`+e,null)}function Yk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Xk(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Yk(e,a,n)),r}return a._value=t,a}function Zk(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Xk(e,t,n??``))}function Qk(e){return function(){this.textContent=e}}function $k(e){return function(){var t=e(this);this.textContent=t??``}}function eA(e){return this.tween(`text`,typeof e==`function`?$k(ck(this,`text`,e)):Qk(e==null?``:e+``))}function tA(e){return function(t){this.textContent=e.call(this,t)}}function nA(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&tA(r)),t}return r._value=e,r}function rA(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,nA(e))}function iA(){for(var e=this._name,t=this._id,n=lA(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=tk(c,t);QO(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new sA(r,this._parents,e,n)}function aA(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ek(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var oA=0;function sA(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function cA(e){return JE().transition(e)}function lA(){return++oA}var uA=JE.prototype;sA.prototype=cA.prototype={constructor:sA,select:zk,selectAll:Bk,selectChild:uA.selectChild,selectChildren:uA.selectChildren,filter:Mk,merge:Nk,selection:Hk,transition:iA,call:uA.call,nodes:uA.nodes,node:uA.node,size:uA.size,empty:uA.empty,each:uA.each,on:Ik,attr:gk,attrTween:xk,style:Jk,styleTween:Zk,text:eA,textTween:rA,remove:Rk,tween:sk,delay:wk,duration:Dk,ease:kk,easeVarying:jk,end:aA,[Symbol.iterator]:uA[Symbol.iterator]};function dA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var fA={time:null,delay:0,duration:250,ease:dA};function pA(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function mA(e){var t,n;e instanceof sA?(t=e._id,e=e._name):(t=lA(),(n=fA).time=BO(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&QO(c,e,t,l,o,n||pA(c,t));return new sA(r,this._parents,e,t)}JE.prototype.interrupt=ik,JE.prototype.transition=mA;var hA=e=>()=>e;function gA(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function _A(e,t,n){this.k=e,this.x=t,this.y=n}_A.prototype={constructor:_A,scale:function(e){return e===1?this:new _A(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new _A(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var vA=new _A(1,0,0);yA.prototype=_A.prototype;function yA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vA;return e.__zoom}function bA(e){e.stopImmediatePropagation()}function xA(e){e.preventDefault(),e.stopImmediatePropagation()}function SA(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function CA(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function wA(){return this.__zoom||vA}function TA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function EA(){return navigator.maxTouchPoints||`ontouchstart`in this}function DA(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function OA(){var e=SA,t=CA,n=DA,r=TA,i=EA,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=OO,l=qw(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,wA).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,wA),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(vA.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new _A(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new _A(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new _A(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=XE(this.that).datum();l.call(e,this.that,new gA(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=QE(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],rk(this),s.start();xA(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=XE(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=QE(t,i),l=t.clientX,u=t.clientY;rD(t.view),bA(t),a.mouse=[c,this.__zoom.invert(c)],rk(this),a.start();function d(e){if(xA(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=QE(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),iD(e.view,a.moved),xA(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=QE(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);xA(r),s>0?XE(this).transition().duration(s).call(x,d,c,r):XE(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(bA(t),s=0;s<i;++s)c=r[s],l=QE(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),rk(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(xA(e),s=0;s<a;++s)c=i[s],l=QE(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(bA(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=QE(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=XE(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:hA(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:hA(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:hA(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:hA([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var kA={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},AA=[[-1/0,-1/0],[1/0,1/0]],jA=[`Enter`,` `,`Escape`],MA={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},NA;(function(e){e.Strict=`strict`,e.Loose=`loose`})(NA||={});var PA;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(PA||={});var FA;(function(e){e.Partial=`partial`,e.Full=`full`})(FA||={});var IA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},LA;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(LA||={});var RA;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(RA||={});var Q;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Q||={});var zA={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function BA(e){return e===null?null:e?`valid`:`invalid`}var VA=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,HA=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),UA=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),WA=(e,t=[0,0])=>{let{width:n,height:r}=wj(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},GA=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:oj(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):UA(n)?n:t.nodeLookup.get(n.id)),ij(e,i?cj(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),KA=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=ij(n,cj(e)),r=!0)}),r?oj(n):{x:0,y:0,width:0,height:0}},qA=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=uj(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},JA=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function YA(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=wj(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function XA({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=xj(KA(YA(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function ZA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,kA.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Cj(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Cj(d)?ej(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,kA.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function QA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=JA(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var $A=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ej=(e={x:0,y:0},t,n)=>({x:$A(e.x,t[0][0],t[1][0]-(n?.width??0)),y:$A(e.y,t[0][1],t[1][1]-(n?.height??0))});function tj(e,t,n){let{width:r,height:i}=wj(n),{x:a,y:o}=n.internals.positionAbsolute;return ej(e,[[a,o],[a+r,o+i]],t)}var nj=(e,t,n)=>e<t?$A(Math.abs(e-t),1,t)/t:e>n?-$A(Math.abs(e-n),1,t)/t:0,rj=(e,t,n=15,r=40)=>[nj(e.x,r,t.width-r)*n,nj(e.y,r,t.height-r)*n],ij=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),aj=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),oj=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),sj=(e,t=[0,0])=>{let{x:n,y:r}=UA(e)?e.internals.positionAbsolute:WA(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},cj=(e,t=[0,0])=>{let{x:n,y:r}=UA(e)?e.internals.positionAbsolute:WA(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},lj=(e,t)=>oj(ij(aj(e),aj(t))),uj=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},dj=(e,t)=>uj(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),fj=e=>pj(e.width)&&pj(e.height)&&pj(e.x)&&pj(e.y),pj=e=>!isNaN(e)&&isFinite(e),mj=(e,t)=>(e,t)=>{},hj=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),gj=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?hj(s,o):s},_j=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function vj(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yj(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=vj(e,n),i=vj(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=vj(e.top??e.y??0,n),i=vj(e.bottom??e.y??0,n),a=vj(e.left??e.x??0,t),o=vj(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function bj(e,t,n,r,i,a){let{x:o,y:s}=_j(e,[t,n,r]),{x:c,y:l}=_j({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var xj=(e,t,n,r,i,a)=>{let o=yj(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=$A(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=bj(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Sj=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Cj(e){return e!=null&&e!==`parent`}function wj(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Tj(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ej(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Dj(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Oj(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function kj(e){return{...MA,...e||{}}}function Aj(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Ij(e),s=gj({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?hj(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var jj=e=>({width:e.offsetWidth,height:e.offsetHeight}),Mj=e=>e?.getRootNode?.()||window?.document,Nj=[`INPUT`,`SELECT`,`TEXTAREA`];function Pj(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Nj.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Fj=e=>`clientX`in e,Ij=(e,t)=>{let n=Fj(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Lj=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...jj(t)}})};function Rj({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function zj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Bj({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Q.Left:return[t-zj(t-r,a),n];case Q.Right:return[t+zj(r-t,a),n];case Q.Top:return[t,n-zj(n-i,a)];case Q.Bottom:return[t,n+zj(i-n,a)]}}function Vj({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,curvature:o=.25}){let[s,c]=Bj({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Bj({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Rj({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function Hj({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Uj({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Wj({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=ij(cj(e),cj(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),dj({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},oj(a))>0}var Gj=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Kj=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),qj=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,kA.error006()),t;let r=n.getEdgeId||Gj,i;return i=VA(e)?{...e}:{...e,id:r(e)},Kj(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function Jj({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=Hj({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var Yj={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},Xj=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Zj=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Qj({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:i,offset:a,stepPosition:o}){let s=Yj[t],c=Yj[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Xj({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=Hj({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function $j(e,t,n,r){let i=Math.min(Zj(e,t)/2,Zj(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function eM({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Qj({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=$j(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function tM(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function nM(e){let{sourceNode:t,targetNode:n}=e;if(!tM(t)||!tM(n))return null;let r=t.internals.handleBounds||rM(t.handles),i=n.internals.handleBounds||rM(n.handles),a=aM(r?.source??[],e.sourceHandle),o=aM(e.connectionMode===NA.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,kA.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Q.Bottom,c=o?.position||Q.Top,l=iM(t,a,s),u=iM(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function rM(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function iM(e,t,n=Q.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??wj(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Q.Top:return{x:i+o/2,y:a};case Q.Right:return{x:i+o,y:a+s/2};case Q.Bottom:return{x:i+o/2,y:a+s};case Q.Left:return{x:i,y:a+s/2}}}function aM(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function oM(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function sM(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=oM(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var cM=1e3,lM=10,uM={nodeOrigin:[0,0],nodeExtent:AA,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},dM={...uM,checkEquality:!0};function fM(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function pM(e,t,n){let r=fM(uM,n);for(let n of e.values())if(n.parentId)vM(n,e,t,r);else{let e=ej(WA(n,r.nodeOrigin),Cj(n.extent)?n.extent:r.nodeExtent,wj(n));n.internals.positionAbsolute=e}}function mM(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function hM(e){return e===`manual`}function gM(e,t,n,r={}){let i=fM(dM,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!hM(i.zIndexMode)?cM:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=ej(WA(u,i.nodeOrigin),Cj(u.extent)?u.extent:i.nodeExtent,wj(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:mM(u,e),z:yM(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&vM(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function _M(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function vM(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=fM(uM,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}_M(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*lM),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=bM(e,u,o,s,a&&!hM(c)?cM:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function yM(e,t,n){let r=pj(e.zIndex)?e.zIndex:0;return hM(n)?r:r+(e.selected?t:0)}function bM(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=wj(e),l=WA(e,n),u=Cj(e.extent)?ej(l,e.extent,c):l,d=ej({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=tj(d,c,t));let f=yM(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function xM(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=lj(a.get(n.parentId)?.expandedRect??sj(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=wj(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function SM(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=jj(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Cj(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=tj(h,s,n))}else m&&(h=ej(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Lj(`source`,r.nodeElement,p,d,e.id),target:Lj(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&vM(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:sj(g,i)}))}}if(f.length>0){let e=xM(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function CM({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function wM(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function TM(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;wM(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),wM(`target`,s,c,e,i,o),t.set(r.id,r)}}function EM(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:EM(n,t):!1}function DM(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function OM(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!EM(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function kM({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function AM({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=hj(a,t);return{x:o.x-a.x,y:o.y-a.y}}function jM({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=XE(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?aj(KA(s)):null,x=v&&l?AM({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:hj(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=ZA({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=kM({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=rj(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=Aj(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=OM(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=kM({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=dD().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=Aj(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Ij(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Aj(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=Ij(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Ij(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=kM({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!DM(t,`.${g}`,v))&&(!_||DM(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function MM(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())dj(i,sj(e))>0&&r.push(e);return r}var NM=250;function PM(e,t,n,r){let i=[],a=1/0,o=MM(e,n,t+NM);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=iM(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function FM(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...iM(o,c,c.position,!0)}:c}function IM(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function LM(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var RM=()=>!0;function zM(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=RM,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Mj(e.target),E=0,D,{x:O,y:k}=Ij(e),A=IM(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=FM(i,A,r,c,t);if(!N)return;let P=Ij(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=rj(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let ee={...N,nodeId:i,type:A,position:N.position},te=c.get(i),ne={inProgress:!0,isValid:null,from:iM(te,ee,Q.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:te,to:P,toHandle:null,toPosition:zA[ee.position],toNode:null,pointer:P};function re(){M=!0,y(ne),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&re();function ie(e){if(!M){let{x:t,y:n}=Ij(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;re()}if(!x()||!ee){B(e);return}let a=b();P=Ij(e,j),D=PM(gj(P,a,!1,[1,1]),n,c,ee),F||=(z(),!0);let s=BM(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=LM(!!D,s.isValid);let u=c.get(i),f=u?iM(u,ee,Q.Left,!0):ne.from,p={...ne,from:f,isValid:L,to:s.toHandle&&L?_j({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:zA[ee.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),ne=p}function B(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=ne,r={...n,toPosition:ne.toHandle?ne.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,ie),T.removeEventListener(`mouseup`,B),T.removeEventListener(`touchmove`,ie),T.removeEventListener(`touchend`,B)}}T.addEventListener(`mousemove`,ie),T.addEventListener(`mouseup`,B),T.addEventListener(`touchmove`,ie),T.addEventListener(`touchend`,B)}function BM(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=RM,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Ij(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=IM(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===NA.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=FM(t,e,a,u,n,!0)}return _}var VM={onPointerDown:zM,isValid:BM};function HM({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=XE(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Sj()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=OA().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:QE}}var UM=e=>({x:e.x,y:e.y,zoom:e.k}),WM=({x:e,y:t,zoom:n})=>vA.translate(e,t).scale(n),GM=(e,t)=>e.target.closest(`.${t}`),KM=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,JM=(e,t=0,n=qM,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},YM=e=>{let t=e.ctrlKey&&Sj()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function XM({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(GM(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=QE(u),t=d*2**YM(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===PA.Vertical?0:u.deltaX*f,m=i===PA.Horizontal?0:u.deltaY*f;!Sj()&&u.shiftKey&&i!==PA.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=UM(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function ZM({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=GM(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function QM({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=UM(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function $M({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&KM(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,UM(a.transform))}}function eN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&KM(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=UM(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function tN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(GM(d,`${l}-flow__node`)||GM(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||GM(d,s)&&m||GM(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function nN({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=OA().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=XE(e).call(f);y({x:i.x,y:i.y,zoom:$A(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(YM);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?mO:OO).transform(JM(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!pj(E)||E<0?0:E);let k=O?XM({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):ZM({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=QM({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=$M({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=eN({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=tN({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=WM(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=WM(e);return await g(n,t),n}function x(e){if(p){let t=WM(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?yA(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?mO:OO).scaleTo(JM(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?mO:OO).scaleBy(JM(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!pj(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var rN;(function(e){e.Line=`line`,e.Handle=`handle`})(rN||={});function iN({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function aN(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function oN(e,t){return Math.max(0,t-e)}function sN(e,t){return Math.max(0,e-t)}function cN(e,t,n){return Math.max(0,t-e,e-n)}function lN(e,t){return e?!t:t}function uN(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=cN(E,h,g),j=cN(D,_,v);if(o){let e=0,t=0;c&&w<0?e=oN(y+w+O,o[0][0]):!c&&w>0&&(e=sN(y+E+O,o[1][0])),l&&T<0?t=oN(b+T+k,o[0][1]):!l&&T>0&&(t=sN(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=sN(y+w,s[0][0]):!c&&w<0&&(e=oN(y+E,s[1][0])),l&&T>0?t=sN(b+T,s[0][1]):!l&&T<0&&(t=oN(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=cN(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?sN(b+k+E/C,o[1][1])*C:oN(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?oN(b+E/C,s[1][1])*C:sN(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=cN(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?sN(y+D*C+O,o[1][0])/C:oN(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?oN(y+D*C,s[1][0])/C:sN(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(lN(c,l)?-w:w)/C:w=(lN(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var dN={width:0,height:0,x:0,y:0},fN={...dN,pointerX:0,pointerY:0,aspectRatio:1};function pN(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function mN({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=XE(e),o={controlDirection:aN(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...dN},h={...fN};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:aN(e)};let g,_=null,v=[],y,b,x,S=!1,C=dD().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=Aj(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Cj(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=pN(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=Aj(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=uN(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=iN({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var hN=xe((e=>{var t=ge();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),gN=xe(((e,t)=>{t.exports=hN()})),_N=xe((e=>{var t=ge(),n=gN();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),vN=ut(xe(((e,t)=>{t.exports=_N()}))(),1),yN=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},bN=e=>e?yN(e):yN,{useDebugValue:xN}=V.default,{useSyncExternalStoreWithSelector:SN}=vN.default,CN=e=>e;function wN(e,t=CN,n){let r=SN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return xN(r),r}var TN=(e,t)=>{let n=bN(e),r=(e,r=t)=>wN(n,e,r);return Object.assign(r,n),r},EN=(e,t)=>e?TN(e,t):TN;function DN(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var ON=(0,V.createContext)(null),kN=ON.Provider,AN=kA.error001(`react`);function $(e,t){let n=(0,V.useContext)(ON);if(n===null)throw Error(AN);return wN(n,e,t)}function jN(){let e=(0,V.useContext)(ON);if(e===null)throw Error(AN);return(0,V.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var MN={display:`none`},NN={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},PN=`react-flow__node-desc`,FN=`react-flow__edge-desc`,IN=`react-flow__aria-live`,LN=e=>e.ariaLiveMessage,RN=e=>e.ariaLabelConfig;function zN({rfId:e}){let t=$(LN);return(0,H.jsx)(`div`,{id:`${IN}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:NN,children:t})}function BN({rfId:e,disableKeyboardA11y:t}){let n=$(RN);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{id:`${PN}-${e}`,style:MN,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,H.jsx)(`div`,{id:`${FN}-${e}`,style:MN,children:n[`edge.a11yDescription.default`]}),!t&&(0,H.jsx)(zN,{rfId:e})]})}var VN=(0,V.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,H.jsx)(`div`,{className:Gw([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));VN.displayName=`Panel`;var HN=`https://reactflow.dev?utm_source=attribution`;function UN({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,H.jsx)(VN,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${HN}`,children:(0,H.jsx)(`a`,{href:HN,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var WN=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},GN=e=>e.id;function KN(e,t){return DN(e.selectedNodes.map(GN),t.selectedNodes.map(GN))&&DN(e.selectedEdges.map(GN),t.selectedEdges.map(GN))}function qN({onSelectionChange:e}){let t=jN(),{selectedNodes:n,selectedEdges:r}=$(WN,KN);return(0,V.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var JN=e=>!!e.onSelectionChangeHandlers;function YN({onSelectionChange:e}){let t=$(JN);return e||t?(0,H.jsx)(qN,{onSelectionChange:e}):null}var XN=[0,0],ZN={x:0,y:0,zoom:1},QN=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],$N=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),eP={translateExtent:AA,nodeOrigin:XN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function tP(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=$($N,DN),l=jN();(0,V.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=eP,s()}),[]);let u=(0,V.useRef)(eP);return(0,V.useEffect)(()=>{for(let s of QN){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:kj(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},QN.map(t=>e[t])),null}function nP(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function rP(e){let[t,n]=(0,V.useState)(e===`system`?null:e);return(0,V.useEffect)(()=>{if(e!==`system`){n(e);return}let t=nP(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?nP()?.matches?`dark`:`light`:t}var iP=typeof document<`u`?document:null;function aP(e=null,t={target:iP,actInsideInputWithModifier:!0}){let[n,r]=(0,V.useState)(!1),i=(0,V.useRef)(!1),a=(0,V.useRef)(new Set([])),[o,s]=(0,V.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
63
+ `).replace(`
64
+
65
+ `,`
66
+ +`).split(`
67
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,V.useEffect)(()=>{let n=t?.target??iP,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&Pj(e))return!1;let n=sP(e.code,s);if(a.current.add(e[n]),oP(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=sP(e.code,s);oP(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function oP(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function sP(e,t){return t.includes(e)?`code`:`key`}var cP=()=>{let e=jN();return(0,V.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=xj(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return gj(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=_j(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function lP(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)uP(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function uP(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function dP(e,t){return lP(e,t)}function fP(e,t){return lP(e,t)}function pP(e,t){return{id:e,type:`select`,selected:t}}function mP(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(pP(a.id,e)))}return r}function hP({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function gP(e){return{id:e.id,type:`remove`}}var _P=mj(`React Flow`,`https://reactflow.dev/`);function vP(e,t,n={}){return qj(e,t,{...n,onError:n.onError??_P})}var yP=e=>HA(e),bP=e=>VA(e);function xP(e){return(0,V.forwardRef)(e)}var SP=typeof window<`u`?V.useLayoutEffect:V.useEffect;function CP(e){let[t,n]=(0,V.useState)(BigInt(0)),[r]=(0,V.useState)(()=>wP(()=>n(e=>e+BigInt(1))));return SP(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function wP(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var TP=(0,V.createContext)(null);function EP({children:e}){let t=jN(),n=CP((0,V.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=hP({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=CP((0,V.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(hP({items:s,lookup:o}))},[])),i=(0,V.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,H.jsx)(TP.Provider,{value:i,children:e})}function DP(){let e=(0,V.useContext)(TP);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var OP=e=>!!e.panZoom;function kP(){let e=cP(),t=jN(),n=DP(),r=$(OP),i=(0,V.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=yP(e)?e:n.get(e.id),a=i.parentId?Ej(i.position,i.measured,i.parentId,n,r):i.position;return sj({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&yP(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&bP(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await QA({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(gP);o?.(f),c(e)}if(m){let e=d.map(gP);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=fj(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=sj(s?r:a),l=dj(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=fj(e)?e:a(e);if(!r)return!1;let i=dj(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return GA(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Oj();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,V.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var AP=e=>e.selected,jP=typeof window<`u`?window:void 0;function MP({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=jN(),{deleteElements:r}=kP(),i=aP(e,{actInsideInputWithModifier:!1}),a=aP(t,{target:jP});(0,V.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(AP),edges:e.filter(AP)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,V.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function NP(e){let t=jN();(0,V.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=jj(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,kA.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var PP={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},FP=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function IP({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=PA.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=jN(),S=(0,V.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=$(FP,DN),E=aP(f),D=(0,V.useRef)();NP(S);let O=(0,V.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,V.useEffect)(()=>{if(S.current){D.current=nN({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,V.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,H.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:PP,children:m})}var LP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function RP(){let{userSelectionActive:e,userSelectionRect:t}=$(LP,DN);return e&&t?(0,H.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var zP=(e,t)=>n=>{n.target===t.current&&e?.(n)},BP=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function VP({isSelecting:e,selectionKeyPressed:t,selectionMode:n=FA.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,V.useRef)(0),_=jN(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=$(BP,DN),C=y&&(e||v),w=(0,V.useRef)(null),T=(0,V.useRef)(),E=(0,V.useRef)(new Set),D=(0,V.useRef)(new Set),O=(0,V.useRef)(!1),k=(0,V.useRef)(!1),A=(0,V.useRef)({x:0,y:0}),j=(0,V.useRef)(!1),M=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},N=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},P=d?e=>d(e):void 0,F=e=>{k.current&&=(e.stopPropagation(),!1)},I=n=>{let{domNode:r,transform:i}=_.getState();if(T.current=r?.getBoundingClientRect(),!T.current)return;let a=n.target===w.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:s,y:c}=Ij(n.nativeEvent,T.current),l=gj({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function L(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=_j(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=E.current,g=D.current;E.current=new Set(qA(a,m,i,n===FA.Partial,!0).map(e=>e.id)),D.current=new Set;let v=u?.selectable??!0;for(let e of E.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&D.current.add(e)}}Dj(h,E.current)||c(mP(a,E.current,!0)),Dj(g,D.current)||l(mP(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function R(){if(!i||!T.current)return;let[e,t]=rj(A.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(R);return}let{x:t,y:n}=A.current;L(t,n),g.current=requestAnimationFrame(R)})}let z=()=>{cancelAnimationFrame(g.current),g.current=0,j.current=!1};return(0,V.useEffect)(()=>()=>z(),[]),(0,H.jsxs)(`div`,{className:Gw([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:b,selection:e}]),onClick:C?void 0:zP(M,w),onContextMenu:zP(N,w),onWheel:zP(P,w),onPointerEnter:C?void 0:f,onPointerMove:C?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=Ij(e.nativeEvent,T.current);A.current={x:o,y:c};let l=_j({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,j.current||=(R(),!0),L(o,c)}:p,onPointerUp:e=>{if(!C){e.target===w.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&M?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),z())},onPointerCancel:C?e=>{e.target?.releasePointerCapture?.(e.pointerId),z()}:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?F:void 0,onPointerLeave:m,ref:w,style:PP,children:[h,(0,H.jsx)(RP,{})]})}function HP({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,kA.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function UP({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=jN(),[c,l]=(0,V.useState)(!1),u=(0,V.useRef)();return(0,V.useEffect)(()=>{if(!t)return u.current=jM({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{HP({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,V.useEffect)(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var WP=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function GP(){let e=jN();return(0,V.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=WP(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=hj(t,i));let{position:a,positionAbsolute:s}=ZA({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var KP=(0,V.createContext)(null),qP=KP.Provider;KP.Consumer;var JP=()=>(0,V.useContext)(KP),YP=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),XP=(0,V.createContext)(null);function ZP({children:e}){let t=$(YP,DN);return(0,H.jsx)(XP.Provider,{value:t,children:e})}function QP(){let e=(0,V.useContext)(XP);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var $P={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},eF=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return $P;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===NA.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function tF({type:e=`source`,position:t=Q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=jN(),_=JP(),{connectOnClick:v,noPanClassName:y,rfId:b}=QP(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=$(eF(_,m,e),DN);_||g.getState().onError?.(`010`,kA.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(vP(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=Fj(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();VM.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,H.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Gw([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=Mj(t.target),h=n||c,{connection:v,isValid:y}=VM.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var nF=(0,V.memo)(xP(tF));function rF({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return(0,H.jsxs)(H.Fragment,{children:[e?.label,(0,H.jsx)(nF,{type:`source`,position:n,isConnectable:t})]})}function iF({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:r=Q.Bottom}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(nF,{type:`target`,position:n,isConnectable:t}),e?.label,(0,H.jsx)(nF,{type:`source`,position:r,isConnectable:t})]})}function aF(){return null}function oF({data:e,isConnectable:t,targetPosition:n=Q.Top}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(nF,{type:`target`,position:n,isConnectable:t}),e?.label]})}var sF={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cF={input:rF,default:iF,output:oF,group:aF};function lF(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var uF=e=>{let{width:t,height:n,x:r,y:i}=KA(e.nodeLookup,{filter:e=>!!e.selected});return{width:pj(t)?t:null,height:pj(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function dF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=jN(),{width:i,height:a,transformString:o,userSelectionActive:s}=$(uF,DN),c=GP(),l=(0,V.useRef)(null);(0,V.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(UP({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,H.jsx)(`div`,{className:Gw([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,H.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(sF,e.key)&&(e.preventDefault(),c({direction:sF[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var fF=typeof window<`u`?window:void 0,pF=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function mF({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:R}=$(pF,DN),z=aP(l,{target:fF}),ee=aP(h,{target:fF}),te=ee||w,ne=ee||b,re=u&&te!==!0,ie=z||R||re;return MP({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,H.jsx)(IP,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ne,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!z&&te,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:re,children:(0,H.jsxs)(VP,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:te,autoPanOnSelection:T,isSelecting:!!ie,selectionMode:d,selectionKeyPressed:z,paneClickDistance:s,selectionOnDrag:re,children:[e,L&&(0,H.jsx)(dF,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}mF.displayName=`FlowRenderer`;var hF=(0,V.memo)(mF),gF=e=>t=>e?qA(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function _F(e){return $((0,V.useCallback)(gF(e),[e]),DN)}var vF=e=>e.updateNodeInternals;function yF(){let e=$(vF),[t]=(0,V.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,V.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function bF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=jN(),a=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)(e.sourcePosition),c=(0,V.useRef)(e.targetPosition),l=(0,V.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,V.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,V.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,V.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function xF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=$(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},DN),S=y.type||`default`,C=g?.[S]||cF[S];C===void 0&&(v?.(`003`,kA.error003(S)),S=`default`,C=g?.default||cF.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=jN(),k=Tj(y),A=bF({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=UP({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=GP();if(y.hidden)return null;let N=wj(y),P=lF(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,R=i?e=>i(e,{...b.userNode}):void 0,z=a?e=>a(e,{...b.userNode}):void 0,ee=o?e=>o(e,{...b.userNode}):void 0,te=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&HP({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},ne=t=>{if(!(Pj(t.nativeEvent)||m)){if(jA.includes(t.key)&&T){let n=t.key===`Escape`;HP({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(sF,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:sF[t.key],factor:t.shiftKey?4:1})}}},re=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(qA(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,H.jsx)(`div`,{className:Gw([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:R,onContextMenu:z,onClick:te,onDoubleClick:ee,onKeyDown:D?ne:void 0,tabIndex:D?0:void 0,onFocus:D?re:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${PN}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,H.jsx)(qP,{value:e,children:(0,H.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var SF=(0,V.memo)(xF),CF=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function wF(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=$(CF,DN),a=_F(e.onlyRenderVisibleElements),o=yF();return(0,H.jsx)(`div`,{className:`react-flow__nodes`,style:PP,children:a.map(a=>(0,H.jsx)(SF,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}wF.displayName=`NodeRenderer`;var TF=(0,V.memo)(wF);function EF(e){return $((0,V.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Wj({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),DN)}var DF=({color:e=`none`,strokeWidth:t=1})=>(0,H.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),OF=({color:e=`none`,strokeWidth:t=1})=>(0,H.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),kF={[RA.Arrow]:DF,[RA.ArrowClosed]:OF};function AF(e){let t=jN();return(0,V.useMemo)(()=>Object.prototype.hasOwnProperty.call(kF,e)?kF[e]:(t.getState().onError?.(`009`,kA.error009(e)),null),[e])}var jF=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=AF(t);return c?(0,H.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,H.jsx)(c,{color:n,strokeWidth:o})}):null},MF=({defaultColor:e,rfId:t})=>{let n=$(e=>e.edges),r=$(e=>e.defaultEdgeOptions),i=(0,V.useMemo)(()=>sM(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,H.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,H.jsx)(`defs`,{children:i.map(e=>(0,H.jsx)(jF,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};MF.displayName=`MarkerDefinitions`;var NF=(0,V.memo)(MF);function PF({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,V.useState)({x:1,y:0,width:0,height:0}),p=Gw([`react-flow__edge-textwrapper`,l]),m=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,H.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,H.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,H.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}PF.displayName=`EdgeText`;var FF=(0,V.memo)(PF);function IF({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{...u,d:e,fill:`none`,className:Gw([`react-flow__edge-path`,u.className])}),l?(0,H.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&pj(t)&&pj(n)?(0,H.jsx)(FF,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function LF({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Q.Left||e===Q.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function RF({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top}){let[o,s]=LF({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=LF({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Rj({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function zF(e){return(0,V.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=RF({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,H.jsx)(IF,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var BF=zF({isInternal:!1}),VF=zF({isInternal:!0});BF.displayName=`SimpleBezierEdge`,VF.displayName=`SimpleBezierEdgeInternal`;function HF(e){return(0,V.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Q.Bottom,targetPosition:m=Q.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=eM({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,H.jsx)(IF,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var UF=HF({isInternal:!1}),WF=HF({isInternal:!0});UF.displayName=`SmoothStepEdge`,WF.displayName=`SmoothStepEdgeInternal`;function GF(e){return(0,V.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,H.jsx)(UF,{...n,id:r,pathOptions:(0,V.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var KF=GF({isInternal:!1}),qF=GF({isInternal:!0});KF.displayName=`StepEdge`,qF.displayName=`StepEdgeInternal`;function JF(e){return(0,V.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=Jj({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,H.jsx)(IF,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var YF=JF({isInternal:!1}),XF=JF({isInternal:!0});YF.displayName=`StraightEdge`,XF.displayName=`StraightEdgeInternal`;function ZF(e){return(0,V.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Q.Bottom,targetPosition:s=Q.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Vj({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,H.jsx)(IF,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var QF=ZF({isInternal:!1}),$F=ZF({isInternal:!0});QF.displayName=`BezierEdge`,$F.displayName=`BezierEdgeInternal`;var eI={default:$F,straight:XF,step:qF,smoothstep:WF,simplebezier:VF},tI={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},nI=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,rI=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,iI=`react-flow__edgeupdater`;function aI({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,H.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Gw([iI,`${iI}-${s}`]),cx:nI(t,r,e),cy:rI(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function oI({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=jN(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;VM.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,H.jsxs)(H.Fragment,{children:[(e===!0||e===`source`)&&(0,H.jsx)(aI,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,H.jsx)(aI,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function sI({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=$(t=>t.edgeLookup.get(e)),b=$(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||eI[x];S===void 0&&(_?.(`011`,kA.error011(x)),x=`default`,S=h?.default||eI.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,V.useRef)(null),[D,O]=(0,V.useState)(!1),[k,A]=(0,V.useState)(!1),j=jN(),{zIndex:M=y.zIndex,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R}=$((0,V.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return tI;let i=nM({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=Uj({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||tI,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),DN),z=(0,V.useMemo)(()=>y.markerStart?`url('#${oM(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ee=(0,V.useMemo)(()=>y.markerEnd?`url('#${oM(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||F===null||I===null)return null;let te=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},ne=a?e=>{a(e,{...y})}:void 0,re=o?e=>{o(e,{...y})}:void 0,ie=s?e=>{s(e,{...y})}:void 0,B=c?e=>{c(e,{...y})}:void 0,ae=l?e=>{l(e,{...y})}:void 0;return(0,H.jsx)(`svg`,{style:{zIndex:M},children:(0,H.jsxs)(`g`,{className:Gw([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:te,onDoubleClick:ne,onContextMenu:re,onMouseEnter:ie,onMouseMove:B,onMouseLeave:ae,onKeyDown:C?t=>{if(!v&&jA.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${FN}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,H.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:z,markerEnd:ee,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,H.jsx)(oI,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,setUpdateHover:O,setReconnecting:A})]})})}var cI=(0,V.memo)(sI),lI=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function uI({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=$(lI,DN),b=EF(t);return(0,H.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,H.jsx)(NF,{defaultColor:e,rfId:n}),b.map(e=>(0,H.jsx)(cI,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}uI.displayName=`EdgeRenderer`;var dI=(0,V.memo)(uI),fI=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function pI({children:e}){let t=jN(),n=(0,V.useRef)(null),[r]=(0,V.useState)(()=>t.getState().transform);return SP(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=fI(r)))};return r(),t.subscribe(r)},[t]),(0,H.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:fI(r)},children:e})}function mI(e){let t=kP(),n=(0,V.useRef)(!1);(0,V.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var hI=e=>e.panZoom?.syncViewport;function gI(e){let t=$(hI),n=jN();return(0,V.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function _I(e){return e.connection.inProgress?{...e.connection,to:gj(e.connection.to,e.transform)}:{...e.connection}}function vI(e){return e?t=>e(_I(t)):_I}function yI(e){return $(vI(e),DN)}var bI=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function xI({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=$(bI,DN);return a&&i&&c?(0,H.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,H.jsx)(`g`,{className:Gw([`react-flow__connection`,BA(s)]),children:(0,H.jsx)(SI,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var SI=({style:e,type:t=LA.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=yI();if(!i)return;if(n)return(0,H.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:BA(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case LA.Bezier:[m]=Vj(h);break;case LA.SimpleBezier:[m]=RF(h);break;case LA.Step:[m]=eM({...h,borderRadius:0});break;case LA.SmoothStep:[m]=eM(h);break;default:[m]=Jj(h)}return(0,H.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};SI.displayName=`ConnectionLine`;var CI={};function wI(e=CI){(0,V.useRef)(e),jN(),(0,V.useEffect)(()=>{},[e])}function TI(){jN(),(0,V.useRef)(!1),(0,V.useEffect)(()=>{},[])}function EI({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:R,panOnDrag:z,autoPanOnSelection:ee,onPaneClick:te,onPaneMouseEnter:ne,onPaneMouseMove:re,onPaneMouseLeave:ie,onPaneScroll:B,onPaneContextMenu:ae,paneClickDistance:oe,nodeClickDistance:se,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe,viewport:Se,onViewportChange:Ce,nodesDraggable:we}){return wI(e),wI(t),TI(),mI(n),gI(Se),(0,H.jsx)(hF,{onPaneClick:te,onPaneMouseEnter:ne,onPaneMouseMove:re,onPaneMouseLeave:ie,onPaneContextMenu:ae,onPaneScroll:B,paneClickDistance:oe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:R,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:z,autoPanOnSelection:ee,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,onViewportChange:Ce,isControlledViewport:!!Se,children:(0,H.jsxs)(pI,{children:[(0,H.jsx)(dI,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,onlyRenderVisibleElements:T,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,defaultMarkerColor:M,noPanClassName:ve,disableKeyboardA11y:ye,rfId:xe}),(0,H.jsx)(xI,{style:h,type:m,component:g,containerStyle:_}),(0,H.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,H.jsx)(TF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:se,onlyRenderVisibleElements:T,noPanClassName:ve,noDragClassName:ge,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe,nodesDraggable:we}),(0,H.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}EI.displayName=`GraphView`;var DI=(0,V.memo)(EI),OI=mj(`React Flow`,`https://reactflow.dev/`),kI=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??AA;TM(h,g,_);let{nodesInitialized:x}=gM(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=xj(KA(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:AA,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:NA.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...IA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:OI,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:MA,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},AI=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>EN((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await XA({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...kI({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=gM(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();TM(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=SM(e,n,r,i,a,o,l);d&&(pM(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=iM(e,o.fromHandle,Q.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=xM(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(dP(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(fP(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>pP(e,!0)));return}i(mP(r,new Set([...e]),!0)),a(mP(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>pP(e,!0)));return}a(mP(n,new Set([...e]))),i(mP(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(pP(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(pP(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,pP(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,pP(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(gM(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return CM({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...IA}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...kI()})}},Object.is);function jI({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,V.useState)(()=>AI({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,H.jsx)(kN,{value:m,children:(0,H.jsx)(EP,{children:(0,H.jsx)(ZP,{children:p})})})}function MI({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,V.useContext)(ON)?(0,H.jsx)(H.Fragment,{children:e}):(0,H.jsx)(jI,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var NI={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function PI({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onBeforeDelete:I,connectionMode:L,connectionLineType:R=LA.Bezier,connectionLineStyle:z,connectionLineComponent:ee,connectionLineContainerStyle:te,deleteKeyCode:ne=`Backspace`,selectionKeyCode:re=`Shift`,selectionOnDrag:ie=!1,selectionMode:B=FA.Full,panActivationKeyCode:ae=`Space`,multiSelectionKeyCode:oe=Sj()?`Meta`:`Control`,zoomActivationKeyCode:se=Sj()?`Meta`:`Control`,snapToGrid:ce,snapGrid:le,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:de,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:me,nodesFocusable:he,nodeOrigin:ge=XN,edgesFocusable:_e,edgesReconnectable:ve,elementsSelectable:ye=!0,defaultViewport:be=ZN,minZoom:xe=.5,maxZoom:Se=2,translateExtent:Ce=AA,preventScrolling:we=!0,nodeExtent:Te,defaultMarkerColor:Ee=`#b1b1b7`,zoomOnScroll:De=!0,zoomOnPinch:Oe=!0,panOnScroll:ke=!1,panOnScrollSpeed:Ae=.5,panOnScrollMode:je=PA.Free,zoomOnDoubleClick:Me=!0,panOnDrag:Ne=!0,onPaneClick:Pe,onPaneMouseEnter:Fe,onPaneMouseMove:Ie,onPaneMouseLeave:Le,onPaneScroll:Re,onPaneContextMenu:ze,paneClickDistance:Be=1,nodeClickDistance:Ve=0,children:He,onReconnect:Ue,onReconnectStart:We,onReconnectEnd:Ge,onEdgeContextMenu:Ke,onEdgeDoubleClick:qe,onEdgeMouseEnter:Je,onEdgeMouseMove:Ye,onEdgeMouseLeave:Xe,reconnectRadius:Ze=10,onNodesChange:Qe,onEdgesChange:$e,noDragClassName:et=`nodrag`,noWheelClassName:tt=`nowheel`,noPanClassName:nt=`nopan`,fitView:rt,fitViewOptions:it,connectOnClick:at,attributionPosition:ot,proOptions:st,defaultEdgeOptions:ct,elevateNodesOnSelect:lt=!0,elevateEdgesOnSelect:ut=!1,disableKeyboardA11y:dt=!1,autoPanOnConnect:ft,autoPanOnNodeDrag:pt,autoPanOnSelection:mt=!0,autoPanSpeed:ht,connectionRadius:gt,isValidConnection:_t,onError:vt,style:yt,id:bt,nodeDragThreshold:xt,connectionDragThreshold:St,viewport:Ct,onViewportChange:wt,width:Tt,height:Et,colorMode:Dt=`light`,debug:Ot,onScroll:kt,ariaLabelConfig:At,zIndexMode:jt=`basic`,...Mt},Nt){let Pt=bt||`1`,Ft=rP(Dt),It=(0,V.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),kt?.(e)},[kt]);return(0,H.jsx)(`div`,{"data-testid":`rf__wrapper`,...Mt,onScroll:It,style:{...yt,...NI},ref:Nt,className:Gw([`react-flow`,i,Ft]),id:bt,role:`application`,children:(0,H.jsxs)(MI,{nodes:e,edges:t,width:Tt,height:Et,fitView:rt,fitViewOptions:it,minZoom:xe,maxZoom:Se,nodeOrigin:ge,nodeExtent:Te,zIndexMode:jt,children:[(0,H.jsx)(tP,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:me,nodesFocusable:he,edgesFocusable:_e,edgesReconnectable:ve,elementsSelectable:ye,elevateNodesOnSelect:lt,elevateEdgesOnSelect:ut,minZoom:xe,maxZoom:Se,nodeExtent:Te,onNodesChange:Qe,onEdgesChange:$e,snapToGrid:ce,snapGrid:le,connectionMode:L,translateExtent:Ce,connectOnClick:at,defaultEdgeOptions:ct,fitView:rt,fitViewOptions:it,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:nt,nodeOrigin:ge,rfId:Pt,autoPanOnConnect:ft,autoPanOnNodeDrag:pt,autoPanSpeed:ht,onError:vt,connectionRadius:gt,isValidConnection:_t,selectNodesOnDrag:de,nodeDragThreshold:xt,connectionDragThreshold:St,onBeforeDelete:I,debug:Ot,ariaLabelConfig:At,zIndexMode:jt}),(0,H.jsx)(DI,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:R,connectionLineStyle:z,connectionLineComponent:ee,connectionLineContainerStyle:te,selectionKeyCode:re,selectionOnDrag:ie,selectionMode:B,deleteKeyCode:ne,multiSelectionKeyCode:oe,panActivationKeyCode:ae,zoomActivationKeyCode:se,onlyRenderVisibleElements:ue,defaultViewport:be,translateExtent:Ce,minZoom:xe,maxZoom:Se,preventScrolling:we,zoomOnScroll:De,zoomOnPinch:Oe,zoomOnDoubleClick:Me,panOnScroll:ke,panOnScrollSpeed:Ae,panOnScrollMode:je,panOnDrag:Ne,autoPanOnSelection:mt,onPaneClick:Pe,onPaneMouseEnter:Fe,onPaneMouseMove:Ie,onPaneMouseLeave:Le,onPaneScroll:Re,onPaneContextMenu:ze,paneClickDistance:Be,nodeClickDistance:Ve,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onReconnect:Ue,onReconnectStart:We,onReconnectEnd:Ge,onEdgeContextMenu:Ke,onEdgeDoubleClick:qe,onEdgeMouseEnter:Je,onEdgeMouseMove:Ye,onEdgeMouseLeave:Xe,reconnectRadius:Ze,defaultMarkerColor:Ee,noDragClassName:et,noWheelClassName:tt,noPanClassName:nt,rfId:Pt,disableKeyboardA11y:dt,nodeExtent:Te,viewport:Ct,onViewportChange:wt,nodesDraggable:fe}),(0,H.jsx)(YN,{onSelectionChange:k}),He,(0,H.jsx)(UN,{proOptions:st,position:ot}),(0,H.jsx)(BN,{rfId:Pt,disableKeyboardA11y:dt})]})})}var FI=xP(PI);kA.error014();function II({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,H.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Gw([`react-flow__background-pattern`,n,r])})}function LI({radius:e,className:t}){return(0,H.jsx)(`circle`,{cx:e,cy:e,r:e,className:Gw([`react-flow__background-pattern`,`dots`,t])})}var RI;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(RI||={});var zI={[RI.Dots]:1,[RI.Lines]:1,[RI.Cross]:6},BI=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function VI({id:e,variant:t=RI.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,V.useRef)(null),{transform:f,patternId:p}=$(BI,DN),m=r||zI[t],h=t===RI.Dots,g=t===RI.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,H.jsxs)(`svg`,{className:Gw([`react-flow__background`,l]),style:{...c,...PP,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,H.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,H.jsx)(LI,{radius:y/2,className:u}):(0,H.jsx)(II,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,H.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}VI.displayName=`Background`;var HI=(0,V.memo)(VI);function UI(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,H.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function WI(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,H.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function GI(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,H.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function KI(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,H.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function qI(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,H.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function JI({children:e,className:t,...n}){return(0,H.jsx)(`button`,{type:`button`,className:Gw([`react-flow__controls-button`,t]),...n,children:e})}var YI=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function XI({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=jN(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=$(YI,DN),{zoomIn:y,zoomOut:b,fitView:x}=kP();return(0,H.jsxs)(VN,{className:Gw([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(JI,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,H.jsx)(UI,{})}),(0,H.jsx)(JI,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,H.jsx)(WI,{})})]}),n&&(0,H.jsx)(JI,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,H.jsx)(GI,{})}),r&&(0,H.jsx)(JI,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,H.jsx)(qI,{}):(0,H.jsx)(KI,{})}),u]})}XI.displayName=`Controls`;var ZI=(0,V.memo)(XI);function QI({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,H.jsx)(`rect`,{className:Gw([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var $I=(0,V.memo)(QI),eL=e=>e.nodes.map(e=>e.id),tL=e=>e instanceof Function?e:()=>e;function nL({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=$I,onClick:o}){let s=$(eL,DN),c=tL(t),l=tL(e),u=tL(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,H.jsx)(H.Fragment,{children:s.map(e=>(0,H.jsx)(iL,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function rL({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=$(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=wj(r);return{node:r,x:i,y:a,width:o,height:s}},DN);return!l||l.hidden||!Tj(l)?null:(0,H.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var iL=(0,V.memo)(rL),aL=(0,V.memo)(nL),oL=200,sL=150,cL=e=>!e.hidden,lL=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?lj(KA(e.nodeLookup,{filter:cL}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},uL=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,dL=(e,t)=>uL(e.viewBB,t.viewBB)&&uL(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,fL=`react-flow__minimap-desc`;function pL({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=jN(),S=(0,V.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=$(lL,dL),j=e?.width??oL,M=e?.height??sL,N=C.width/j,P=C.height/M,F=Math.max(N,P),I=F*j,L=F*M,R=b*F,z=C.x-(I-C.width)/2-R,ee=C.y-(L-C.height)/2-R,te=I+R*2,ne=L+R*2,re=`${fL}-${T}`,ie=(0,V.useRef)(0),B=(0,V.useRef)();ie.current=F,(0,V.useEffect)(()=>{if(S.current&&E)return B.current=HM({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>ie.current}),()=>{B.current?.destroy()}},[E]),(0,V.useEffect)(()=>{B.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let ae=p?e=>{let[t,n]=B.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,oe=m?(0,V.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,se=_??A[`minimap.ariaLabel`];return(0,H.jsx)(VN,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*F:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Gw([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,H.jsxs)(`svg`,{width:j,height:M,viewBox:`${z} ${ee} ${te} ${ne}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":re,ref:S,onClick:ae,children:[se&&(0,H.jsx)(`title`,{id:re,children:se}),(0,H.jsx)(aL,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,H.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${z-R},${ee-R}h${te+R*2}v${ne+R*2}h${-te-R*2}z
68
+ M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}pL.displayName=`MiniMap`,(0,V.memo)(pL);var mL=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,hL={[rN.Line]:`right`,[rN.Handle]:`bottom-right`};function gL({nodeId:e,position:t,variant:n=rN.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 v=JP(),y=typeof e==`string`?e:v,b=jN(),x=(0,V.useRef)(null),S=n===rN.Handle,C=$((0,V.useCallback)(mL(S&&p),[S,p]),DN),w=(0,V.useRef)(null),T=t??hL[n];return(0,V.useEffect)(()=>{if(!(!x.current||!y))return w.current||=mN({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.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}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);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=xM([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Ej({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:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,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:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]),(0,H.jsx)(`div`,{className:Gw([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,V.memo)(gL);function _L({data:e}){let t=e.style===`success`?Dt:e.style===`danger`||e.style===`muted`?an:e.style===`active`?Mt:Nt;return(0,H.jsxs)(`article`,{"aria-label":`${e.label}: ${e.state}`,className:B(`dag-node`,`state-${e.state}`,`token-${e.style}`),"data-selected":e.selected,children:[(0,H.jsx)(nF,{type:`target`,position:Q.Left}),(0,H.jsxs)(`div`,{className:`node-heading`,children:[(0,H.jsx)(p,{className:`px-1.5 py-0 text-[9px] tracking-[.1em] uppercase`,variant:`outline`,children:e.kind}),(0,H.jsx)(t,{className:B(e.style===`active`&&`spin`),size:17})]}),(0,H.jsx)(`strong`,{children:e.label}),(0,H.jsx)(`span`,{className:`node-status`,children:e.state}),e.reason!==void 0&&(0,H.jsx)(`span`,{className:`node-reason`,title:e.reason,children:e.reason}),e.awaits!==void 0&&(0,H.jsx)(`span`,{className:`node-awaits`,title:e.awaits,children:e.awaits}),(0,H.jsx)(nF,{type:`source`,position:Q.Right})]})}function vL({data:e,id:t,markerEnd:n,style:r}){return(0,H.jsx)(IF,{id:t,path:yL(e?.points??[]),markerEnd:n,style:r})}function yL(e){let[t,...n]=e;return t?`M ${t.x} ${t.y} ${n.map(e=>`L ${e.x} ${e.y}`).join(` `)}`:``}var bL={dagNode:_L},xL={routed:vL};function SL({nodes:e,selectedNodeId:n,onSelectNode:r,journalSeq:i}){let a=(0,V.useMemo)(()=>{let t=new Map;for(let n of e)qe(n.status)&&t.set(n.id,lt(n));return t},[e]),o=(0,V.useMemo)(()=>new Map(e.map(e=>[e.id,ot(e)])),[e]),{nodes:s,edges:c}=(0,V.useMemo)(()=>{let r=new Set(e.map(e=>e.id)),i=t({nodes:e.map(e=>({id:e.id,label:e.label,kind:e.kind,state:e.status,...o.get(e.id)===void 0?{}:{lines:1}})),edges:e.flatMap(e=>(e.task?.deps??[]).filter(e=>r.has(e)).map(t=>({id:`${t}->${e.id}`,source:t,target:e.id})))});return{nodes:i.nodes.map(e=>({id:e.id,type:`dagNode`,position:{x:e.x,y:e.y},data:{label:e.label,kind:e.kind,state:e.state,style:e.style,selected:e.id===n,...a.get(e.id)===void 0?{}:{reason:a.get(e.id)},...o.get(e.id)===void 0?{}:{awaits:o.get(e.id)}},width:e.width,height:e.height,measured:{width:e.width,height:e.height},handles:[{type:`target`,position:Q.Left,x:0,y:e.height/2,width:0,height:0},{type:`source`,position:Q.Right,x:e.width,y:e.height/2,width:0,height:0}]})),edges:i.edges.map(t=>({id:t.id,source:t.source,target:t.target,type:`routed`,data:{points:t.points},animated:e.find(({id:e})=>e===t.target)?.status===`running`}))}},[e,a,o,n]);return(0,H.jsxs)(`div`,{className:`graph-wrap`,"data-journal-seq":i,children:[(0,H.jsxs)(FI,{nodes:s,edges:c,colorMode:`dark`,nodeTypes:bL,edgeTypes:xL,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,onInit:e=>void e.fitView(),onNodeClick:(e,t)=>r(t.id),"aria-label":`DAG execution graph`,children:[(0,H.jsx)(HI,{color:`var(--border)`,gap:22}),(0,H.jsx)(ZI,{showInteractive:!1})]}),(0,H.jsx)(`ol`,{className:`accessible-node-list`,"aria-label":`DAG nodes`,children:e.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),children:[e.label,`: `,e.status,a.get(e.id)===void 0?``:` — ${a.get(e.id)}`,o.get(e.id)===void 0?``:` — ${o.get(e.id)}`]})},e.id))})]})}function CL({value:e,label:t=`Record`}){return e==null?(0,H.jsx)(`span`,{children:`Not recorded`}):typeof e==`boolean`?(0,H.jsx)(`span`,{children:e?`Yes`:`No`}):typeof e==`string`||typeof e==`number`?(0,H.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:String(e)}):Array.isArray(e)?e.length===0?(0,H.jsx)(`span`,{children:`None`}):(0,H.jsx)(`ol`,{"aria-label":t,children:e.map((e,n)=>(0,H.jsx)(`li`,{"aria-label":`${t}.${n}`,children:(0,H.jsx)(CL,{label:`${t}.${n}`,value:e})},n))}):typeof e==`object`?(0,H.jsx)(`div`,{className:`structured-fields`,children:Object.entries(e).map(([e,n])=>(0,H.jsxs)(`fieldset`,{"aria-label":`${t}.${e}`,children:[(0,H.jsx)(`legend`,{children:e.replaceAll(`_`,` `)}),(0,H.jsx)(CL,{label:`${t}.${e}`,value:n})]},e))}):(0,H.jsx)(`span`,{children:`Not recorded`})}function wL(e,t){let[n,r]=(0,V.useState)(0);return{host:Hw(`host`,()=>e.host(),n),unwatched:Hw(`unwatched`,()=>e.unwatched(),n),refresh:(0,V.useCallback)(()=>{r(e=>e+1),t?.()},[t])}}var TL=[`Run`,`Node`,`Provider`,`Age (ms)`,`Proof`];function EL(e,t){let n=e?.runs??[];if(t===void 0)return n;let r=new Map(t.map(e=>[e.id,e])),i=new Set(n.map(e=>e.run_id));return[...n.flatMap(e=>{let t=r.get(e.run_id);if(t===void 0)return[];let{done:n,failed:i,running:a}=t.nodes;return[{run_id:e.run_id,state:t.state,node_counts:{...e.node_counts,done:n,failed:i,running:a}}]}),...(e===void 0?[]:t).filter(e=>!i.has(e.id)).map(({id:e,state:t,nodes:{done:n,failed:r,running:i}})=>({run_id:e,state:t,node_counts:{done:n,failed:r,running:i}}))]}function DL({client:e,onRefresh:t,list:n,rows:r,listError:i,children:a}){let{host:o,unwatched:s,refresh:c}=wL(e,t),l=o.value?.reading;return(0,H.jsx)(wd,{className:`min-h-0 flex-1`,children:(0,H.jsxs)(`section`,{"aria-label":`Host`,className:`channel-view host-page`,children:[(0,H.jsxs)(`h2`,{children:[`This host`,l&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`output`,{"aria-label":`Host name`,className:`host-name`,children:l.host})]})]}),(0,H.jsx)(G,{onClick:c,children:`Refresh host`}),(o.error||s.error)&&(0,H.jsx)(`p`,{role:`alert`,children:o.error?.message??s.error?.message}),o.loading&&(0,H.jsx)(`p`,{role:`status`,children:`Reading host…`}),l&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{children:[(0,H.jsx)(`dt`,{children:`Runs root`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`output`,{"aria-label":`Runs root path`,children:l.root})})]}),l.root_error&&(0,H.jsx)(`p`,{role:`alert`,children:l.root_error}),(0,H.jsxs)(`section`,{"aria-label":`Free space`,children:[(0,H.jsx)(`h3`,{children:`Free space`}),l.free_space.map((e,t)=>(0,H.jsxs)(`dl`,{children:[(0,H.jsx)(`dt`,{children:`Filesystem`}),(0,H.jsx)(`dd`,{children:e.roots.map((e,t)=>(0,H.jsxs)(`span`,{children:[t>0&&` · `,e.role,`:`,` `,(0,H.jsx)(`output`,{"aria-label":`Filesystem root path`,children:e.path??`unresolved`}),e.measured_at&&(0,H.jsxs)(H.Fragment,{children:[` `,`(measured at`,` `,(0,H.jsx)(`output`,{"aria-label":`Measured root ancestor`,children:e.measured_at}),`)`]})]},e.role))}),(0,H.jsx)(`dt`,{children:`Free bytes`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`output`,{"aria-label":`Free capacity bytes`,children:e.free_bytes??`Unknown`})}),(0,H.jsx)(`dt`,{children:`Total bytes`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`output`,{"aria-label":`Total capacity bytes`,children:e.total_bytes??`Unknown`})}),e.error&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:`Error`}),(0,H.jsx)(`dd`,{children:e.error})]})]},e.roots[0]?.path??t))]}),(0,H.jsxs)(`section`,{"aria-label":`Providers and dispatches`,children:[(0,H.jsx)(`h3`,{children:`Providers and dispatches`}),l.dispatches.length===0?(0,H.jsx)(`p`,{children:`No live dispatches`}):(0,H.jsx)(`section`,{"aria-label":`Providers and dispatches table`,className:`host-table`,children:(0,H.jsxs)(`table`,{children:[(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{children:TL.map(e=>(0,H.jsx)(`th`,{children:e},e))})}),(0,H.jsx)(`tbody`,{children:l.dispatches.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{"data-label":`Run`,children:e.run}),(0,H.jsx)(`td`,{"data-label":`Node`,children:e.node}),(0,H.jsx)(`td`,{"data-label":`Provider`,children:e.launcher}),(0,H.jsx)(`td`,{"data-label":`Age (ms)`,children:(0,H.jsx)(`output`,{"aria-label":`Dispatch age milliseconds`,className:`host-age`,children:e.age_ms??`Unknown`})}),(0,H.jsxs)(`td`,{"data-label":`Proof`,children:[e.proof,e.unproven&&`: ${e.unproven}`]})]},`${e.run}/${e.node}`))})]})})]}),(0,H.jsxs)(`section`,{"aria-label":`Gone dispatches`,children:[(0,H.jsx)(`h3`,{children:`Gone dispatches`}),l.gone.map(e=>(0,H.jsxs)(`p`,{children:[e.run,` · `,e.node,` · `,e.reason]},`${e.run}/${e.node}`))]}),l.skipped.map(e=>(0,H.jsxs)(`p`,{children:[e.path,`: `,e.reason]},e.path))]}),(0,H.jsxs)(`section`,{"aria-label":`Unwatched runs`,children:[(0,H.jsxs)(`h3`,{children:[`Unwatched runs: `,s.value?.reported.length??`…`]}),s.value?.reported.map(e=>(0,H.jsxs)(`dl`,{children:[(0,H.jsx)(`dt`,{children:e.run}),(0,H.jsxs)(`dd`,{children:[e.standing,` · `,e.why_not_watched]})]},e.run)),s.value?.unresolved.map(e=>(0,H.jsx)(`p`,{children:e},e))]}),(0,H.jsxs)(`section`,{"aria-label":`Runs on the host`,children:[(0,H.jsx)(`h3`,{children:`Runs on the host`}),i&&(0,H.jsxs)(`p`,{role:`alert`,children:[`Listing unavailable: `,i.message]}),EL(n,r).map(e=>(0,H.jsx)(`p`,{children:[e.run_id,e.state,be(e.node_counts)].filter(Boolean).join(` · `)},e.run_id))]}),(0,H.jsxs)(`details`,{"aria-label":`Provider health`,children:[(0,H.jsx)(`summary`,{children:`Provider health`}),(0,H.jsx)(CL,{value:n?.provider_health})]}),a]})})}function OL(e,t,n){let{value:r,error:i}=Hw(t?`host-listing`:void 0,async()=>{let[t,n]=await Promise.all([e.listRuns(!0),e.listProjects()]);return{...t,runs:n.projects.flatMap(e=>e.runs),next_cursor:void 0}},n);return t?{list:r,error:i}:{}}function kL(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function AL(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function jL(e){return e}var ML=[],NL=`skip`;function PL(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(!(o.enter===null||o.enter===void 0))if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor");if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=wy(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+jL(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=ML;if(s&&r&&(o=FL(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=FL(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function FL(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ML:[e]}function IL(e,t,n){let r=wy((n||{}).ignore||[]),i=LL(t),a=-1;for(;++a<i.length;)PL(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return NL}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function LL(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([RL(e[0]),zL(e[1])])}return t}function RL(e){return typeof e==`string`?new RegExp(AL(e),`g`):e}function zL(e){return typeof e==`function`?e:function(){return e}}var BL=`phrasing`,VL=[`autolink`,`link`,`image`,`label`];function HL(){return{transforms:[XL],enter:{literalAutolink:WL,literalAutolinkEmail:GL,literalAutolinkHttp:GL,literalAutolinkWww:GL},exit:{literalAutolink:YL,literalAutolinkEmail:JL,literalAutolinkHttp:KL,literalAutolinkWww:qL}}}function UL(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:BL,notInConstruct:VL},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:BL,notInConstruct:VL},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:BL,notInConstruct:VL}]}}function WL(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function GL(e){this.config.enter.autolinkProtocol.call(this,e)}function KL(e){this.config.exit.autolinkProtocol.call(this,e)}function qL(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function JL(e){this.config.exit.autolinkEmail.call(this,e)}function YL(e){this.exit(e)}function XL(e){IL(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,ZL],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,eR],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,$L],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,QL]],{ignore:[`link`,`linkReference`]})}function ZL(e,t,n,r,i){if(!rR(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),tg(n.charCodeAt(0))||!tR(n))return!1;let o=nR(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function QL(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function $L(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function eR(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function tR(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function nR(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=kL(e,`(`),a=kL(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function rR(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||ng(t)||tg(t)}pR.peek=fR;function iR(){this.buffer()}function aR(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function oR(){this.buffer()}function sR(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function cR(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Kh(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lR(e){this.exit(e)}function uR(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Kh(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dR(e){this.exit(e)}function fR(){return`[`}function pR(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function mR(){return{enter:{gfmFootnoteCallString:iR,gfmFootnoteCall:aR,gfmFootnoteDefinitionLabelString:oR,gfmFootnoteDefinition:sR},exit:{gfmFootnoteCallString:cR,gfmFootnoteCall:lR,gfmFootnoteDefinitionLabelString:uR,gfmFootnoteDefinition:dR}}}function hR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:pR},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
69
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?_R:gR))),s(),o}}function gR(e,t,n){return t===0?e:_R(e,t,n)}function _R(e,t,n){return(n?``:` `)+e}var vR=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];CR.attention=wR,CR.peek=TR;function yR(){return{canContainEols:[`delete`],enter:{strikethrough:xR},exit:{strikethrough:SR}}}function bR(){return{handlers:{delete:CR},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:vR}]}}function xR(e){this.enter({type:`delete`,children:[],position:void 0},e)}function SR(e){this.exit(e)}function CR(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function wR(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function TR(){return`~`}function ER(e){return e.length}function DR(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ER,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=OR(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=kR(r[d]);else{let e=kR(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&o===``)&&(n.delimiterStart!==!1||d)&&i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
70
+ `)}function OR(e){return e==null?``:String(e)}function kR(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function AR(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),jR);return i(),o}function jR(e,t,n){return`>`+(n?``:` `)+e}function MR(e,t){return NR(e,t.inConstruct,!0)&&!NR(e,t.notInConstruct,!1)}function NR(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function PR(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
71
+ `&&MR(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
72
+ `}function FR(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function IR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function LR(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function RR(e,t,n,r){let i=LR(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(IR(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,zR);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(FR(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
73
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
74
+ `),a&&(u+=s.move(a+`
75
+ `)),u+=s.move(c),l(),u}function zR(e,t,n){return(n?``:` `)+e}function BR(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function VR(e,t,n,r){let i=BR(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
76
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function HR(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function UR(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function WR(e,t,n){let r=dg(e),i=dg(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}GR.peek=KR;function GR(e,t,n,r){let i=HR(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=WR(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=UR(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=WR(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+UR(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function KR(e,t,n){return n.options.emphasis||`*`}function qR(e,t){let n=!1;return Fy(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Nh(e)&&(t.options.setext||n))}function JR(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(qR(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
77
+ `,after:`
78
+ `});return r(),t(),o+`
79
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
80
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
81
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=UR(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}YR.peek=XR;function YR(e){return e.value||``}function XR(){return`<`}ZR.peek=QR;function ZR(e,t,n,r){let i=BR(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function QR(){return`!`}$R.peek=ez;function $R(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ez(){return`!`}tz.peek=nz;function tz(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function nz(){return"`"}function rz(e,t){let n=Nh(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}iz.peek=az;function iz(e,t,n,r){let i=BR(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(rz(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function az(e,t,n){return rz(e,n)?`<`:`[`}oz.peek=sz;function oz(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function sz(){return`[`}function cz(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lz(e){let t=cz(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function uz(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dz(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function fz(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?uz(n):cz(n),s=e.ordered?o===`.`?`)`:`.`:lz(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),dz(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function pz(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function mz(e,t,n,r){let i=pz(n),a=n.bulletCurrent||cz(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function hz(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var gz=wy([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function _z(e,t,n,r){return(e.children.some(function(e){return gz(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function vz(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yz.peek=bz;function yz(e,t,n,r){let i=vz(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=WR(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=UR(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=WR(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+UR(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function bz(e,t,n){return n.options.strong||`*`}function xz(e,t,n,r){return n.safe(e.value,r)}function Sz(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Cz(e,t,n){let r=(dz(n)+(n.options.ruleSpaces?` `:``)).repeat(Sz(n));return n.options.ruleSpaces?r.slice(0,-1):r}var wz={blockquote:AR,break:PR,code:RR,definition:VR,emphasis:GR,hardBreak:PR,heading:JR,html:YR,image:ZR,imageReference:$R,inlineCode:tz,link:iz,linkReference:oz,list:fz,listItem:mz,paragraph:hz,root:_z,strong:yz,text:xz,thematicBreak:Cz};function Tz(){return{enter:{table:Ez,tableData:Az,tableHeader:Az,tableRow:Oz},exit:{codeText:jz,table:Dz,tableData:kz,tableHeader:kz,tableRow:kz}}}function Ez(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function Dz(e){this.exit(e),this.data.inTable=void 0}function Oz(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function kz(e){this.exit(e)}function Az(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function jz(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Mz));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Mz(e,t){return t===`|`?t:e}function Nz(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[Pz],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
82
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
83
+ `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return DR(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=wz.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function Pz(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&Fz(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function Fz(e,t){let n=!1;return Fy(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&Nh(e)&&(t.options.setext||n))}function Iz(){return{exit:{taskListCheckValueChecked:Rz,taskListCheckValueUnchecked:Rz,paragraph:zz}}}function Lz(){return{handlers:{paragraph:Bz},join:[Vz]}}function Rz(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function zz(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function Bz(e,t,n,r){if(!t||t.type!==`listItem`||Hz(t)!==e)return wz.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+wz.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function Vz(e,t,n){if(!(e.type===`definition`&&n.type===`listItem`))return;let r=Hz(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function Hz(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function Uz(){return[HL(),mR(),yR(),Tz(),Iz()]}function Wz(e){return{extensions:[UL(),hR(e),bR(),Nz(e),Lz()]}}var Gz={tokenize:aB,partial:!0},Kz={tokenize:oB,partial:!0},qz={tokenize:sB,partial:!0},Jz={tokenize:cB,partial:!0},Yz={tokenize:lB,partial:!0},Xz={name:`wwwAutolink`,tokenize:rB,previous:uB},Zz={name:`protocolAutolink`,tokenize:iB,previous:dB},Qz={name:`emailAutolink`,tokenize:nB,previous:fB},$z={};function eB(){return{text:$z}}for(var tB=48;tB<123;)$z[tB]=Qz,tB++,tB===58?tB=65:tB===91&&(tB=97);$z[43]=Qz,$z[45]=Qz,$z[46]=Qz,$z[95]=Qz,$z[72]=[Qz,Zz],$z[104]=[Qz,Zz],$z[87]=[Qz,Xz],$z[119]=[Qz,Xz];function nB(e,t,n){let r=this,i,a;return o;function o(t){return!pB(t)||!fB.call(r,r.previous)||mB(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return pB(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Yz,u,l)(t):t===45||t===95||Jh(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&qh(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function rB(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!uB.call(r,r.previous)||mB(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Gz,e.attempt(Kz,e.attempt(qz,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function iB(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&dB.call(r,r.previous)&&!mB(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(qh(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Xh(t)||eg(t)||ng(t)||tg(t)?n(t):e.attempt(Kz,e.attempt(qz,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function aB(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function oB(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Jz,c,s)(t):t===null||eg(t)||ng(t)||t!==45&&tg(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function sB(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Jz,t,a)(o):o===null||eg(o)||ng(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function cB(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||eg(o)||ng(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||eg(e)||ng(e)?t(e):r(e)}function a(e){return qh(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):qh(t)?(e.consume(t),o):n(t)}}function lB(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Jh(e)?n(e):t(e)}}function uB(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||eg(e)}function dB(e){return!qh(e)}function fB(e){return!(e===47||pB(e))}function pB(e){return e===43||e===45||e===46||e===95||Jh(e)}function mB(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hB={tokenize:CB,partial:!0};function gB(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bB,continuation:{tokenize:xB},exit:SB}},text:{91:{name:`gfmFootnoteCall`,tokenize:yB},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_B,resolveTo:vB}}}}function _B(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Kh(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vB(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yB(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||eg(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Kh(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return eg(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bB(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||eg(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Kh(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return eg(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xB(e,t,n){return e.check(yg,t,e.attempt(hB,t,n))}function SB(e){e.exit(`gfmFootnoteDefinition`)}function CB(e,t,n){let r=this;return Z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wB(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&zh(o,o.length,0,fg(s,e.slice(r+1,n),t)),zh(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),zh(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=dg(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=dg(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var TB=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){EB(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function EB(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function DB(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function OB(){return{flow:{null:{name:`table`,tokenize:kB,resolveAll:AB}}}}function kB(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):X(t)?Z(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||eg(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,X(t)?Z(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return X(t)?Z(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return X(t)?Z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):X(n)?Z(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||eg(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function AB(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new TB;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(MB(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=jB(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=jB(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=jB(f,t,o,i,n,d)):(o[0]=o[1],d=jB(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&MB(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=DB(t.events,n))}return e}function jB(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},NB(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=NB(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=NB(t.events,n[2]),a=NB(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},NB(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function MB(e,t,n,r,i){let a=[],o=NB(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function NB(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var PB={name:`tasklistCheck`,tokenize:IB};function FB(){return{text:{91:PB}}}function IB(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return eg(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):X(r)?e.check({tokenize:LB},t,n)(r):n(r)}}function LB(e,t,n){return Z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function RB(e){return Hh([eB(),gB(),wB(e),OB(),FB()])}var zB={};function BB(e){let t=this,n=e||zB,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(RB(n)),a.push(Uz()),o.push(Wz(n))}var VB=new Set([`http:`,`https:`,`mailto:`]);function HB(e){try{return new URL(e)}catch{return}}function UB(e){let t=e===void 0?void 0:HB(e)?.protocol;return t!==void 0&&VB.has(t)?e:void 0}var WB={target:`_blank`,rel:`noopener noreferrer`},GB=typeof window>`u`?V.useEffect:V.useLayoutEffect;function KB(e,t){let n=(0,V.useRef)(null);return GB(()=>{let t=n.current;if(!t||e===void 0)return;let r=()=>{t.removeAttribute(`data-otg-table-cut`);let e=t.querySelector(`table`);if(!e||t.scrollHeight<=t.clientHeight)return;let n=e.getBoundingClientRect().top-t.getBoundingClientRect().top;t.toggleAttribute(`data-otg-table-cut`,n<t.clientHeight)};r();let i=t.clientWidth,a=new ResizeObserver(()=>{t.clientWidth!==i&&(i=t.clientWidth,r())});a.observe(t);let o=!0;return document.fonts?.ready.then(()=>{o&&r()}),()=>{o=!1,a.disconnect()}},[e,t]),n}function qB(e){return e.tagName===`img`?{type:`text`,value:String(e.properties?.alt||`image`)}:(e.children&&=e.children.map(qB),e)}function JB(){let e=t=>{t.tagName===`a`?qB(t):t.children?.forEach(e)};return e}function YB({href:e,children:t}){let n=UB(e);return(0,H.jsx)(`a`,{href:n,...n===void 0?{}:WB,children:t})}var XB={a:({href:e,children:t})=>(0,H.jsx)(YB,{href:e,children:t}),img:({src:e,alt:t})=>(0,H.jsx)(YB,{href:typeof e==`string`?e:void 0,children:t||`image`})},ZB=[BB],QB=[JB];function $B({source:e,clamp:t}){let n=t!==void 0&&Number.isInteger(t)&&t>0?t:void 0,r=KB(n,e),i=n===void 0?void 0:{WebkitLineClamp:n,maxHeight:`calc(${n} * 1lh)`};return(0,H.jsx)(`div`,{className:n===void 0?`otg-markdown`:`otg-markdown otg-markdown--clamped`,ref:r,style:i,children:(0,H.jsx)(Nb,{components:XB,rehypePlugins:QB,remarkPlugins:ZB,children:e})})}function eV({title:e,body:t,badges:n,meta:r,links:i,actions:a,clamp:o,children:s,className:c,...l}){let u=(0,V.useId)();return(0,H.jsx)(`article`,{...l,"aria-labelledby":u,className:c?`otg-card ${c}`:`otg-card`,children:(0,H.jsxs)(`div`,{className:`otg-card__surface`,children:[(0,H.jsxs)(`div`,{className:`otg-card__header`,children:[n!=null&&(0,H.jsx)(`div`,{className:`otg-card__badges`,children:n}),(0,H.jsx)(`h3`,{className:`otg-card__title`,id:u,children:e}),a!=null&&(0,H.jsx)(`div`,{className:`otg-card__actions`,children:a})]}),r!=null&&(0,H.jsx)(`div`,{className:`otg-card__meta`,children:r}),i!=null&&(0,H.jsx)(`div`,{className:`otg-card__links`,children:i}),t?(0,H.jsx)($B,{source:t,...o===void 0?{}:{clamp:o}}):null,s]})})}var tV=new Map([[`github.com`,`GitHub`],[`linear.app`,`Linear`]]);function nV(e){return tV.get(HB(e)?.hostname??``)??`tracker`}function rV({url:e,label:t,...n}){let r=UB(e);return(0,H.jsx)(`a`,{"aria-label":`Open ${nV(e)} issue ${t}`,...n,href:r,...WB,className:[`otg-source-link`,n.className].filter(Boolean).join(` `),children:t})}var iV=15e3;function aV(e,t,n){let[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(!1),p=(0,V.useRef)(null),{key:m,phase:h,followUp:g}=e,_=h===`sending`||g?.phase===`failed`||g?.phase===`sending`;return(0,V.useLayoutEffect)(()=>{if(f(!1),_)return;let e=setTimeout(()=>f(!0),iV);return()=>clearTimeout(e)},[`${m}:${h}:${g?.kind??``}:${g?.phase??``}`,_]),(0,V.useEffect)(()=>{c(!1),u(``)},[m]),(0,V.useEffect)(()=>{g?.kind===`note`&&g.phase===`done`&&(c(!1),u(``))},[g]),(0,V.useEffect)(()=>{if(!d||r||s)return;let e=p.current?.contains(document.activeElement)??!1;a&&e||t()},[d,r,a,s,t]),(0,V.useEffect)(()=>{let e=p.current;if(e===null)return;let t=()=>n(e.getBoundingClientRect().height);t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect(),n(0)}},[n]),{holds:{ref:p,onFocus:()=>o(!0),onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||o(!1)},onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1)},writing:s,setWriting:c,text:l,setText:u}}var oV={complete:`Completed`,dismiss:`Dismissed`},sV={complete:`Completing`,dismiss:`Dismissing`},cV={complete:`Reopened`,dismiss:`Restored`};function lV(e){let{action:t,title:n,phase:r,error:i,followUp:a}=e;if(r===`failed`)return`Not ${oV[t].toLowerCase()}: ${n}. ${i??``}`.trim();let o=cV[t],s=t===`dismiss`?`Reason`:`Comment`;return a?.phase===`failed`?a.kind===`undo`?`Not ${o.toLowerCase()}: ${n}. ${a.error??``}`.trim():`${s} not saved: ${n}. ${a.error??``}`.trim():a?.phase===`done`?a.kind===`undo`?`${o}: ${n}`:`${s} saved: ${n}`:r===`sending`?`${sV[t]}: ${n}…`:`${oV[t]}: ${n}`}function uV({toast:e,onUndo:t,onNote:n,onClose:r,onRoom:i}){let{holds:a,writing:o,setWriting:s,text:c,setText:l}=aV(e,r,i),u=(0,V.useId)(),{action:d,phase:f,followUp:p}=e,m=f===`failed`||p?.phase===`failed`,h=f!==`failed`,g=p?.kind===`undo`&&p.phase===`done`,_=d===`dismiss`?`Add reason`:`Add comment`,v=d===`dismiss`?`Reason`:`Comment`;return(0,H.jsxs)(`section`,{"aria-label":`Action result`,className:`human-items-toast`,"data-phase":p?.phase??f,"data-tone":m?`failure`:`success`,...a,children:[(0,H.jsx)(`p`,{className:`human-items-toast-message`,role:m?`alert`:`status`,children:lV(e)}),h&&!g&&(0,H.jsxs)(`div`,{className:`human-items-toast-actions`,children:[(0,H.jsx)(dV,{label:d===`dismiss`?`Restore`:`Reopen`,onPress:t,reopen:e.reopen,sending:p?.kind===`undo`&&p.phase===`sending`}),!o&&(0,H.jsx)(`button`,{className:`human-items-toast-action`,onClick:()=>s(!0),type:`button`,children:_})]}),h&&!g&&o&&(0,H.jsxs)(`form`,{className:`human-items-toast-note`,onSubmit:e=>{e.preventDefault(),c.trim()!==``&&n(c)},children:[(0,H.jsx)(`label`,{className:`sr-only`,htmlFor:u,children:v}),(0,H.jsx)(`input`,{autoFocus:!0,id:u,onChange:e=>l(e.target.value),placeholder:`${v}, then Enter`,readOnly:p?.kind===`note`&&p.phase===`sending`,value:c}),(0,H.jsx)(`button`,{className:`human-items-toast-action`,type:`submit`,children:p?.kind===`note`&&p.phase===`failed`?`Send again`:`Send`})]}),(0,H.jsx)(`button`,{"aria-label":`Close`,className:`human-items-toast-close`,onClick:r,type:`button`,children:(0,H.jsx)(an,{"aria-hidden":`true`,size:14})})]})}function dV({label:e,reopen:t,sending:n,onPress:r}){let[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(!1),c=(0,V.useId)();return t?.available===!1?(0,H.jsxs)(`fieldset`,{"aria-label":`${e} (unavailable)`,className:`human-items-toast-action human-items-unavailable`,onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),children:[(0,H.jsx)(`button`,{"aria-describedby":c,disabled:!0,type:`button`,children:e}),(0,H.jsx)(`sup`,{className:`human-items-why-anchor`,children:(0,H.jsx)(`button`,{"aria-controls":c,"aria-expanded":i,"aria-label":`Why ${e} is unavailable`,className:`human-items-why`,onClick:()=>a(e=>!e),type:`button`,children:`?`})}),(0,H.jsx)(`span`,{className:`human-items-why-tip`,hidden:!(i||o),id:c,role:`tooltip`,children:t.reason})]}):(0,H.jsx)(`button`,{"aria-busy":n,className:`human-items-toast-action`,onClick:()=>{n||r()},type:`button`,children:n?`${e}…`:e})}var fV=at.map(e=>({wire:e,label:Se[e]}));function pV(e){return Se[e.priority]}function mV(e){return e.kind===`task`?`Task`:`Question`}var hV={open:`Open`,answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`},gV=[`open`,`answered`,`completed`,`dismissed`],_V=gV.map(e=>({state:e,label:hV[e]}));function vV(e){return hV[e.state]}function yV(e){return e.state===`open`&&e.block.scope!==`nothing`}function bV(e){return e===1?`1 step`:`${e} steps`}function xV(e){let{item:t,blocked:n}=e;if(!yV(t))return[];switch(t.block.scope){case`host`:return[`blocks all work on this host`];case`plan`:return[`blocks all of ${t.block.plan}`];case`work`:return n.plans.map(({plan:e,count:t})=>`blocks ${bV(t)} in ${e}`);default:return[]}}function SV(e){let t=xV(e);return e.item.block.scope===`work`?e.blocked.plans.map(({count:e,preview:n},r)=>{let i=e-n.length,a=n.map(({node:e})=>e).join(`, `);return`${t[r]}: ${a}${i>0?` +${i} more`:``}`}).join(`; `):t.join(`; `)}function CV(e){if(e.block.scope===`host`)return`host`;let{plan:t,run:n,session:r}=e.owner;return t!==null&&n!==null?`plan ${t} / run ${n}`:t===null?n===null?`session ${r}`:`run ${n}`:`plan ${t}`}function wV(e){let t=xV(e);if(e.item.block.scope!==`work`)return t.map(t=>({phrase:t,nodes:e.nodes}));let n=0;return e.blocked.plans.map(({count:r},i)=>{let a=e.nodes.slice(n,n+r);return n+=r,{phrase:t[i]??``,nodes:a}})}function TV(e){return e===`user`?`you`:`the manager`}function EV(e){return e.resolution?.provenance??`manager`}var DV={"human-item-raised":`Raised`,"human-item-answered":`Answered`,"human-item-completed":`Completed`,"human-item-dismissed":`Dismissed`,"human-item-auto-resolved":`Resolved`,"human-item-reopened":`Reopened`,"human-item-noted":`Note`};function OV(e){return`${DV[e.action]} by ${TV(e.provenance)}`}function kV(e){let{item:t}=e,{plan:n,run:r}=t.owner,i=xV(e).join(`; `),a={answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`}[t.state];return[{label:`Priority`,value:pV(t)},{label:`Kind`,value:mV(t)},{label:`State`,value:vV(t)},{label:`Source`,value:CV(t)},...n===null?[]:[{label:`Plan`,value:n}],...r===null?[]:[{label:`Run`,value:r}],{label:`Blocks`,value:i===``?`Nothing`:i},{label:`Raised`,at:t.created_at},...a===void 0?[]:[{label:a,at:t.updated_at,party:TV(EV(t))}]]}function AV(e,t){return e.find(e=>e===t)}var jV=[``,`task`,`question`],MV=[``,`yes`,`no`],NV=[``,...at],PV=gV,FV=[``,`session`,`run`,`plan`,`host`],IV={kind:``,blocking:``,priority:``,state:`open`,source:``,sourceId:``};function LV(e){let t=e.sourceId.trim();return{...e.kind===``?{}:{kind:e.kind},...e.blocking===``?{}:{blocking:e.blocking===`yes`},...e.priority===``?{}:{priority:e.priority},...e.state===`open`?{}:{state:e.state},...e.source===`host`?{host:!0}:{},...e.source!==``&&e.source!==`host`&&t!==``?{[e.source]:t}:{}}}function RV(e){return Number(e.kind!==IV.kind)+Number(e.blocking!==IV.blocking)+Number(e.priority!==IV.priority)+Number(e.state!==IV.state)+Number(e.source!==IV.source)}var zV=[`priority`,`kind`,`source`,`blocking`,`none`],BV=`priority`,VV=[{value:`priority`,label:`Priority`},{value:`kind`,label:`Kind`},{value:`source`,label:`Source`},{value:`blocking`,label:`Blocking`},{value:`none`,label:`None`}];function HV(e,t){let{item:n}=e;switch(t){case`priority`:return{key:n.priority,label:pV(n),rank:at.indexOf(n.priority)};case`kind`:return{key:n.kind,label:mV(n),rank:n.kind===`task`?0:1};case`blocking`:return yV(n)?{key:`blocking`,label:`Blocking`,rank:0}:{key:`not-blocking`,label:`Not blocking`,rank:1};case`source`:{let e=CV(n);return{key:e,label:`Source: ${e}`,rank:0}}}}function UV(e,t){if(t===`none`)return[{key:`all`,items:e}];let n=new Map;return e.forEach((e,r)=>{let{key:i,label:a,rank:o}=HV(e,t),s=n.get(i);s?s.items.push(e):n.set(i,{label:a,rank:o,first:r,items:[e]})}),[...n.entries()].sort(([,e],[,t])=>e.rank-t.rank||e.first-t.first).map(([e,{label:t,items:n}])=>({key:e,label:t,items:n}))}function WV({answers:e,onRoom:t}){let n=(0,V.useRef)(null),{count:r,remaining:i,sending:a,sendError:o,notices:s}=e,c=r>0||o!==void 0||s.length>0;return(0,V.useEffect)(()=>{let e=n.current;if(e===null)return;let r=()=>t(e.getBoundingClientRect().height);r();let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect(),t(0)}},[t,c]),c?(0,H.jsxs)(`section`,{"aria-label":`Drafted answers`,className:`human-items-send`,ref:n,children:[r>0&&(0,H.jsxs)(`div`,{className:`human-items-send-bar`,children:[(0,H.jsx)(`button`,{className:`human-items-send-action`,"data-primary":`true`,disabled:a,onClick:()=>void e.send(),type:`button`,children:a?`Sending…`:`Send ${r} ${r===1?`answer`:`answers`}`}),(0,H.jsx)(`button`,{className:`human-items-send-action`,disabled:a,onClick:e.discard,type:`button`,children:`Discard`}),i>0&&(0,H.jsxs)(`span`,{className:`human-items-send-more`,children:[i,` more after this`]})]}),o!==void 0&&(0,H.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent, and your drafts are kept: `,o]}),s.length>0&&(0,H.jsx)(`ul`,{"aria-label":`Not sent`,className:`human-items-not-sent`,children:s.map(t=>(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`p`,{children:[(0,H.jsxs)(`strong`,{children:[`Not sent: `,t.title]}),` (`,t.reason,`)`]}),t.choiceTitle!==void 0&&(0,H.jsxs)(`p`,{children:[`Choice: `,t.choiceTitle]}),t.text!==void 0&&(0,H.jsx)($B,{source:t.text}),(0,H.jsx)(`button`,{className:`human-items-send-action`,onClick:()=>e.clearNotice(t.key),type:`button`,children:`Clear`})]},t.key))})]}):null}var GV=`onepipeline-ui.human-items.group-by`;function KV(){try{return AV(zV,window.localStorage.getItem(`onepipeline-ui.human-items.group-by`)??``)??`priority`}catch{return BV}}function qV(){let[e,t]=(0,V.useState)(KV);return{groupBy:e,setGroupBy:(0,V.useCallback)(e=>{t(e);try{window.localStorage.setItem(GV,e)}catch{}},[])}}var JV=`answered or dismissed elsewhere`,YV=`onepipeline-ui.human-items.draft.`,XV=/^[^\s/?#]+$/u,ZV=Ve({title:dt(),choice:dt().optional(),choiceTitle:dt().optional(),text:dt().optional()});function QV(){try{let e={};for(let t=0;t<window.localStorage.length;t+=1){let n=window.localStorage.key(t);if(n===null||!n.startsWith(YV))continue;let r=n.slice(33),i=$V(window.localStorage.getItem(n));i!==void 0&&XV.test(r)&&(e[r]=i)}return e}catch{return}}function $V(e){if(e!==null)try{let t=ZV.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}}function eH(e,t){try{t===void 0?window.localStorage.removeItem(`${YV}${e}`):window.localStorage.setItem(`${YV}${e}`,JSON.stringify(t))}catch{}}function tH(e){return e!==void 0&&e.trim()!==``}function nH(e){return e.choice!==void 0||tH(e.text)}function rH(e,t){return{id:e,...t.choice===void 0?{}:{choice:t.choice},...tH(t.text)?{text:t.text}:{}}}function iH(e){return e.kind===`conflict`?e.reason:`human items are unavailable on this host`}async function aH(e,t){try{return(await e.getHumanItem(t)).item.state!==`open`}catch(e){return e instanceof ew&&e.status===404||void 0}}function oH(e,t){return e[t]===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function sH(e,t,n,r,i,a){let[o,s]=(0,V.useState)(()=>QV()??{}),[c,l]=(0,V.useState)({}),[u,d]=(0,V.useState)([]),[f,p]=(0,V.useState)(!1),[m,h]=(0,V.useState)(),g=(0,V.useRef)(!1),_=(0,V.useRef)(0),v=(0,V.useRef)(o);v.current=o;let y=(0,V.useRef)(new Set),b=(0,V.useRef)(new Set),x=(0,V.useRef)(0),S=(0,V.useCallback)((e,t)=>{eH(e,t),s(n=>t===void 0?oH(n,e):{...n,[e]:t}),l(t=>oH(t,e)),h(void 0)},[]),C=(0,V.useCallback)((e,t)=>{let n=v.current[e];if(n===void 0)return;eH(e,void 0),s(t=>oH(t,e)),l(t=>oH(t,e)),_.current+=1;let r=_.current;d(e=>[...e,{...n,key:r,reason:t}])},[]),w=(0,V.useCallback)((e,t)=>{let{id:n,title:r}=e.item,{text:i}=v.current[n]??{},a={title:r,...v.current[n]?.choice===t.id?{}:{choice:t.id,choiceTitle:t.title},...i===void 0?{}:{text:i}};S(n,nH(a)?a:void 0)},[S]),T=(0,V.useCallback)((e,t)=>{let{id:n,title:r}=e.item,{choice:i,choiceTitle:a}=v.current[n]??{},o={title:r,...i===void 0?{}:{choice:i},...a===void 0?{}:{choiceTitle:a},...t===``?{}:{text:t}};S(n,o.choice===void 0&&t===``?void 0:o)},[S]),E=Object.entries(o).filter(([,e])=>nH(e)),D=E.slice(0,50),O=(0,V.useCallback)(async(t,n)=>{await aH(e,t)===!0?C(t,n):l(e=>({...e,[t]:n}))},[e,C]),k=(0,V.useCallback)(async()=>{if(g.current)return;let t=QV(),n=D.filter(([e])=>t!==void 0&&t[e]===void 0);for(let[e]of n)s(t=>oH(t,e));let r=D.flatMap(([e,t])=>n.some(([t])=>t===e)?[]:[rH(e,t)]);if(r.length!==0){g.current=!0,p(!0),h(void 0),a(r.map(({id:e})=>e));try{let t=await e.answerHumanItems(r);for(let{item:e}of t.answered)eH(e.item.id,void 0),s(t=>oH(t,e.item.id)),l(t=>oH(t,e.item.id));i(t.answered),await Promise.all(t.refused.map(({id:e,refusal:t})=>O(e,iH(t))))}catch(e){h(e instanceof Error?e.message:String(e))}finally{g.current=!1,p(!1),a([])}}},[D,e,i,a,O]),A=(0,V.useCallback)(()=>{for(let e of Object.keys(v.current))eH(e,void 0);s({}),l({}),h(void 0)},[]),j=(0,V.useCallback)(e=>{d(t=>t.filter(t=>t.key!==e))},[]);return(0,V.useEffect)(()=>{y.current.clear(),x.current+=1},[n]),(0,V.useEffect)(()=>{if(t===void 0||f)return;for(let e of Object.keys(o)){if(r(e))continue;let i=t.find(({item:t})=>t.id===e);if(i!==void 0){y.current.delete(e),i.item.state!==`open`&&C(e,JV);continue}y.current.has(e)||b.current.has(e)||n(e)}function n(t){let r=x.current;b.current.add(t),aH(e,t).then(e=>{if(e===!1&&r!==x.current&&!g.current){n(t);return}b.current.delete(t),!g.current&&(e===!0?C(t,JV):e===!1&&y.current.add(t))})}},[e,o,t,C,f,r]),{drafts:o,refusals:c,notices:u,sending:f,sendError:m,count:D.length,remaining:E.length-D.length,pressChoice:w,setText:T,retire:C,send:k,discard:A,clearNotice:j}}function cH(e){let[t,n]=(0,V.useState)(IV),[r,i]=(0,V.useState)(),a=(0,V.useMemo)(()=>{if(!e)return;let n=LV(t);return{type:`human-items`,...Object.keys(n).length===0?{}:{filter:n},...r===void 0?{}:{item:r}}},[e,JSON.stringify(LV(t)),r]);return(0,V.useEffect)(()=>{e||(n(IV),i(void 0))},[e]),{choice:t,setChoice:n,selectedId:r,setSelectedId:i,view:a}}function lH(e,t,n,r,i=``){let[a,o]=(0,V.useState)({}),[s,c]=(0,V.useState)(),[l,u]=(0,V.useState)([]),[d,f]=(0,V.useState)({}),[p,m]=(0,V.useState)({}),[h,g]=(0,V.useState)(),_=(0,V.useRef)(new Set),v=(0,V.useRef)(new Map),y=(0,V.useRef)(0),b=(0,V.useRef)(void 0);b.current=s;let x=t.items,S=(0,V.useRef)(i);S.current=i,(0,V.useEffect)(()=>{m(e=>Object.keys(e).length===0?e:{})},[i]);let C=(0,V.useMemo)(()=>{if(x===void 0)return;let e=x.flatMap(e=>{if(d[e.item.id]!==void 0)return[];let t=p[e.item.id]?.view;return t===void 0||!dH(t,e)?[e]:t.item.state===r?[t]:[]}),t=t=>e.some(({item:e})=>e.id===t);for(let{view:n,at:a,filter:o}of Object.values(p))o===i&&n.item.state===r&&!t(n.item.id)&&e.splice(Math.min(a,e.length),0,n);for(let{view:n,at:r}of l)t(n.item.id)||e.splice(Math.min(r,e.length),0,n);return e},[x,l,p,d,r,i]);(0,V.useEffect)(()=>{x!==void 0&&m(e=>{let t=Object.entries(e).filter(([e,{view:t}])=>{let n=x.find(({item:t})=>t.id===e);return n===void 0?t.item.state===r:dH(t,n)});return t.length===Object.keys(e).length?e:Object.fromEntries(t)})},[x,r]);let w=t.error===void 0&&t.item===n?t.detail:void 0,T=n===void 0?void 0:p[n]?.view,E=w&&T!==void 0&&dH(T,{item:w.item})?{...w,item:T.item,reopen:T.reopen}:w,D=(0,V.useRef)(x);D.current=x;let O=sH(e,x,i,(0,V.useCallback)(e=>_.current.has(e),[]),(0,V.useCallback)(e=>{let t=S.current;m(n=>{let r={...n};for(let{item:n}of e){let e=Math.max(0,D.current?.findIndex(({item:e})=>e.id===n.item.id)??0);r[n.item.id]={view:n,at:e,filter:t}}return r});let n=new Set(e.map(({item:e})=>e.item.id));u(e=>e.filter(({view:e})=>!n.has(e.item.id)))},[]),(0,V.useCallback)(e=>{let t=D.current??[];u(e.flatMap(e=>{let n=t.findIndex(({item:t})=>t.id===e),r=t[n];return r===void 0?[]:[{view:r,at:n}]}))},[])),{retire:k}=O,A=(0,V.useCallback)((e,t)=>c(n=>n?.key===e?t(n):n),[]),j=(0,V.useCallback)((t,n)=>{let{id:r,title:i}=t.item;if(_.current.has(r))return;_.current.add(r);let a=++y.current,s=S.current,l=Math.max(0,D.current?.findIndex(({item:e})=>e.id===r)??0);o(e=>({...e,[r]:{}})),f(e=>({...e,[r]:{view:t,at:l}})),c({key:a,id:r,title:i,action:n.action,phase:`sending`});let u=n.action===`complete`?e.completeHumanItem(r):e.dismissHumanItem(r,n.reason);v.current.set(a,u),u.then(e=>{m(t=>({...t,[r]:{view:e.item,at:l,filter:s}})),o(e=>({...e,[r]:{}})),k(r,`dismissed here`),A(a,t=>({...t,phase:`done`,reopen:e.item.reopen}))},e=>{let t=fH(e);o(e=>({...e,[r]:{error:t}})),A(a,e=>({...e,phase:`failed`,error:t})),g({id:r})}).finally(()=>{_.current.delete(r),f(uH(r))})},[e,A,k]),M=(0,V.useCallback)((e,t)=>{let n=b.current;if(n===void 0)return;let r=v.current.get(n.key);if(r===void 0||n.followUp?.phase===`sending`)return;let{key:i,id:a}=n,o=S.current;A(i,t=>({...t,followUp:{kind:e,phase:`sending`}})),r.then(n=>{if(e===`undo`&&!n.item.reopen.available){A(i,e=>({...e,followUp:void 0}));return}t(a).then(t=>{m(e=>({...e,[a]:{view:t.item,at:e[a]?.at??0,filter:o}})),A(i,n=>({...n,reopen:t.item.reopen,followUp:{kind:e,phase:`done`}}))},t=>A(i,n=>({...n,followUp:{kind:e,phase:`failed`,error:fH(t)}})))},()=>A(i,e=>({...e,followUp:void 0})))},[A]),N=(0,V.useCallback)(()=>M(`undo`,t=>e.reopenHumanItem(t)),[e,M]),P=(0,V.useCallback)(t=>M(`note`,n=>e.noteHumanItem(n,t)),[e,M]),F=(0,V.useCallback)(()=>c(void 0),[]);return{items:C,listError:n===void 0||C===void 0?t.error:void 0,detail:E===null?void 0:E,gone:n!==void 0&&E===null,detailError:n===void 0?void 0:t.error,writes:a,answers:O,write:j,toast:s,undo:N,note:P,closeToast:F,returned:h}}function uH(e){return t=>t[e]===void 0?t:Object.fromEntries(Object.entries(t).filter(([t])=>t!==e))}function dH(e,t){return Date.parse(e.item.updated_at)>Date.parse(t.item.updated_at)}function fH(e){return e instanceof Error?e.message:String(e)}var pH=`data-card-action`,mH=4;function hH({client:e,live:t,choice:n,setChoice:r,selectedId:i,setSelectedId:a}){let o=lH(e,t,i,n.state,JSON.stringify(n)),{groupBy:s,setGroupBy:c}=qV(),[l,u]=(0,V.useState)(0),[d,f]=(0,V.useState)(0),p=(0,V.useRef)(null),m=o.items?.find(({item:e})=>e.id===i)??o.detail,h=(0,V.useRef)(void 0);m===void 0?h.current?.item.id!==i&&(h.current=void 0):h.current=m;let g=(e,t)=>{e.item.id===i&&a(void 0),o.write(e,t)},_=o.returned;(0,V.useEffect)(()=>{_!==void 0&&p.current?.querySelector(`[data-item-id="${CSS.escape(_.id)}"]`)?.scrollIntoView({block:`nearest`})},[_]);let v=UV(o.items??[],s);return(0,H.jsxs)(`section`,{"aria-label":`Action items`,className:`human-items-page`,"data-detail-open":i!==void 0,style:gH(l,d),children:[(0,H.jsx)(yH,{choice:n,groupBy:s,onChange:r,onGroupBy:c}),(0,H.jsxs)(`div`,{className:`human-items-body`,children:[(0,H.jsxs)(`section`,{"aria-label":`Action item list`,className:`human-items-list`,children:[o.listError&&(0,H.jsx)(`p`,{role:`alert`,children:o.listError}),o.items===void 0&&!o.listError&&(0,H.jsx)(`p`,{role:`status`,children:`Reading action items…`}),o.items?.length===0&&(0,H.jsx)(`p`,{role:`status`,children:`No action items match these filters.`}),(0,H.jsx)(`div`,{className:`human-items-groups`,onKeyDown:e=>vH(e,p.current),ref:p,children:v.map(e=>(0,H.jsx)(_H,{answering:o.answers,group:e,groupBy:s,onSelect:a,onWrite:g,selectedId:i,writes:o.writes},e.key))}),(o.items?.length??0)>0&&(0,H.jsx)(`button`,{className:`card-actions-entry`,onFocus:()=>p.current?.querySelector(`[${pH}]`)?.focus(),type:`button`,children:`Card actions: use the arrow keys`})]}),i!==void 0&&(0,H.jsx)(kH,{answering:o.answers,error:o.detailError,detail:o.detail,gone:o.gone,lastShown:h.current,onClose:()=>a(void 0),onWrite:g,state:o.writes[i],view:m})]}),(0,H.jsx)(WV,{answers:o.answers,onRoom:f}),o.toast&&(0,H.jsx)(uV,{onClose:o.closeToast,onNote:o.note,onRoom:u,onUndo:o.undo,toast:o.toast})]})}function gH(e,t){return{"--toast-room":`${e}px`,"--send-room":`${t}px`}}function _H({group:e,groupBy:t,selectedId:n,writes:r,answering:i,onSelect:a,onWrite:o}){let s=(0,V.useId)(),c=e.items.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(SH,{answering:i,groupBy:t,onSelect:()=>a(e.item.id),onWrite:o,selected:e.item.id===n,state:r[e.item.id],view:e})},e.item.id));return e.label===void 0?(0,H.jsx)(`ul`,{"aria-label":`Action items`,children:c}):(0,H.jsxs)(`section`,{"aria-labelledby":s,className:`human-items-group`,children:[(0,H.jsxs)(`h2`,{className:`human-items-group-heading`,id:s,children:[e.label,` `,(0,H.jsxs)(`span`,{className:`human-items-group-count`,children:[`(`,e.items.length,`)`]})]}),(0,H.jsx)(`ul`,{"aria-labelledby":s,children:c})]})}function vH(e,t){let n=e.target;if(t===null||!(n instanceof HTMLElement)||!n.hasAttribute(pH))return;let r=[...t.querySelectorAll(`[${pH}]`)],i=r.indexOf(n),a=e.key===`ArrowRight`||e.key===`ArrowDown`?r[Math.min(i+1,r.length-1)]:e.key===`ArrowLeft`||e.key===`ArrowUp`?r[Math.max(i-1,0)]:e.key===`Home`?r[0]:e.key===`End`?r.at(-1):void 0;a!==void 0&&(e.preventDefault(),a.focus())}function yH({choice:e,groupBy:t,onChange:n,onGroupBy:r}){let i=(0,V.useId)(),[a,o]=(0,V.useState)(!1),s=(t,r)=>n({...e,[t]:r}),c=e.source!==``&&e.source!==`host`,l=RV(e)+Number(t!==BV);return(0,H.jsxs)(`div`,{className:`human-items-controls`,"data-open":a,children:[(0,H.jsxs)(`button`,{"aria-controls":`${i}-filters`,"aria-expanded":a,"aria-label":l>0?`Filters, ${l} changed`:`Filters`,className:`human-items-filters-toggle`,onClick:()=>o(e=>!e),type:`button`,children:[(0,H.jsx)($t,{"aria-hidden":`true`,size:14}),`Filters`,l>0&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`human-items-filters-count`,children:l})]}),(0,H.jsxs)(`fieldset`,{className:`human-items-filters`,id:`${i}-filters`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Filter action items`}),(0,H.jsx)(`label`,{htmlFor:`${i}-group`,children:`Group by`}),(0,H.jsx)(`select`,{id:`${i}-group`,onChange:e=>r(AV(zV,e.target.value)??`priority`),value:t,children:VV.map(({value:e,label:t})=>(0,H.jsx)(`option`,{value:e,children:t},e))}),(0,H.jsx)(`label`,{htmlFor:`${i}-kind`,children:`Kind`}),(0,H.jsxs)(`select`,{id:`${i}-kind`,onChange:e=>s(`kind`,AV(jV,e.target.value)??``),value:e.kind,children:[(0,H.jsx)(`option`,{value:``,children:`Any kind`}),(0,H.jsx)(`option`,{value:`task`,children:`Task`}),(0,H.jsx)(`option`,{value:`question`,children:`Question`})]}),(0,H.jsx)(`label`,{htmlFor:`${i}-blocking`,children:`Blocking`}),(0,H.jsxs)(`select`,{id:`${i}-blocking`,onChange:e=>s(`blocking`,AV(MV,e.target.value)??``),value:e.blocking,children:[(0,H.jsx)(`option`,{value:``,children:`Any`}),(0,H.jsx)(`option`,{value:`yes`,children:`Yes`}),(0,H.jsx)(`option`,{value:`no`,children:`No`})]}),(0,H.jsx)(`label`,{htmlFor:`${i}-priority`,children:`Priority`}),(0,H.jsxs)(`select`,{id:`${i}-priority`,onChange:e=>s(`priority`,AV(NV,e.target.value)??``),value:e.priority,children:[(0,H.jsx)(`option`,{value:``,children:`Any priority`}),fV.map(({wire:e,label:t})=>(0,H.jsx)(`option`,{value:e,children:t},e))]}),(0,H.jsx)(`label`,{htmlFor:`${i}-state`,children:`State`}),(0,H.jsx)(`select`,{id:`${i}-state`,onChange:e=>s(`state`,AV(PV,e.target.value)??`open`),value:e.state,children:_V.map(({state:e,label:t})=>(0,H.jsx)(`option`,{value:e,children:t},e))}),(0,H.jsx)(`label`,{htmlFor:`${i}-source`,children:`Source`}),(0,H.jsxs)(`select`,{id:`${i}-source`,onChange:e=>s(`source`,AV(FV,e.target.value)??``),value:e.source,children:[(0,H.jsx)(`option`,{value:``,children:`Any source`}),(0,H.jsx)(`option`,{value:`session`,children:`Session`}),(0,H.jsx)(`option`,{value:`run`,children:`Run`}),(0,H.jsx)(`option`,{value:`plan`,children:`Plan`}),(0,H.jsx)(`option`,{value:`host`,children:`Host`})]}),c&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`label`,{htmlFor:`${i}-source-id`,children:`Source identifier`}),(0,H.jsx)(`input`,{id:`${i}-source-id`,onChange:e=>s(`sourceId`,e.target.value),placeholder:`${e.source} id`,type:`search`,value:e.sourceId})]})]})]})}function bH(e){return e.target instanceof Element&&e.target.closest(`a, button, textarea, input, select`)===null}function xH({view:e,groupBy:t}){let{item:n}=e;return(0,H.jsxs)(H.Fragment,{children:[t!==`priority`&&(0,H.jsx)(`span`,{className:`human-item-priority`,"data-priority":n.priority,children:pV(n)}),t!==`kind`&&(0,H.jsx)(`span`,{className:`human-item-kind`,children:mV(n)}),t!==`blocking`&&yV(n)&&(0,H.jsx)(`span`,{className:`human-item-blocking`,children:`Blocking`})]})}function SH({view:e,groupBy:t,selected:n,state:r,answering:i,onSelect:a,onWrite:o}){let{item:s}=e,c=s.state===`open`,l=SV(e),u=[...c?[]:[vV(s)],...l?[l]:[],...t===`source`?[]:[`Source: ${CV(s)}`]],d=(s.choices?.length??0)>0;return(0,H.jsxs)(eV,{actions:(0,H.jsx)(CH,{item:e,onSelect:a,onWrite:o}),badges:(0,H.jsx)(xH,{groupBy:t,view:e}),body:s.body,className:`human-item-card`,clamp:mH,"data-blocking":yV(s),"data-item-id":s.id,"data-selected":n,meta:u.length===0?void 0:u.map((e,t)=>(0,H.jsxs)(V.Fragment,{children:[t>0&&` · `,(0,H.jsx)(`span`,{children:e})]},e)),onClick:e=>{bH(e)&&a()},title:s.title,children:[s.kind===`question`&&c&&d&&(0,H.jsxs)(`fieldset`,{className:`human-item-choices`,children:[(0,H.jsxs)(`legend`,{className:`sr-only`,children:[`Choices: `,s.title]}),s.choices?.map(t=>(0,H.jsx)(wH,{answering:i,choice:t,view:e},t.id))]}),s.kind===`question`&&c&&!d&&(0,H.jsx)(TH,{answering:i,label:`Answer: ${s.title}`,view:e}),(0,H.jsx)(EH,{view:e}),(0,H.jsx)(DH,{reason:i.refusals[s.id]}),(0,H.jsx)(OH,{state:r})]})}function CH({item:e,onSelect:t,onWrite:n}){let{item:r}=e,i=r.state===`open`;return(0,H.jsxs)(H.Fragment,{children:[r.tracker&&(0,H.jsx)(rV,{className:`human-item-tracker`,"data-card-action":``,label:r.tracker.task,title:r.tracker.task,onClick:e=>e.stopPropagation(),tabIndex:-1,url:r.tracker.url}),(0,H.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:t,type:`button`,"aria-label":`Details: ${r.title}`,children:`Details`}),i&&r.kind===`task`&&(0,H.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:()=>n(e,{action:`complete`}),type:`button`,"aria-label":`Complete: ${r.title}`,children:`Complete`}),i&&(0,H.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:()=>n(e,{action:`dismiss`}),type:`button`,"aria-label":`Dismiss: ${r.title}`,children:`Dismiss`})]})}function wH({view:e,choice:t,answering:n}){return(0,H.jsx)(`button`,{"aria-pressed":n.drafts[e.item.id]?.choice===t.id,className:`human-item-choice`,disabled:n.sending,onClick:()=>n.pressChoice(e,t),type:`button`,children:t.title})}function TH({view:e,label:t,answering:n}){return(0,H.jsx)(`textarea`,{"aria-busy":n.sending,"aria-label":t,className:`human-item-answer`,onChange:t=>n.setText(e,t.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||e.preventDefault()},placeholder:`Write an answer`,readOnly:n.sending,rows:1,value:n.drafts[e.item.id]?.text??``})}function EH({view:e}){let{item:t}=e;if(t.state!==`answered`||t.resolution===null)return null;let{choice:n,text:r}=t.resolution,i=t.choices?.find(({id:e})=>e===n);return(0,H.jsxs)(`section`,{"aria-label":`Answer`,className:`human-item-answered`,children:[i&&(0,H.jsx)(`p`,{className:`human-item-answered-choice`,children:i.title}),r!==null&&(0,H.jsx)($B,{source:r})]})}function DH({reason:e}){return e===void 0?null:(0,H.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent: `,e]})}function OH({state:e}){return e?.error?(0,H.jsx)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:e.error}):null}function kH({view:e,detail:t,gone:n,lastShown:r,error:i,state:a,answering:o,onWrite:s,onClose:c}){if(n&&e===void 0)return(0,H.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,H.jsxs)(`header`,{className:`human-item-detail-head`,children:[r&&(0,H.jsx)(`h2`,{children:r.item.title}),(0,H.jsx)(G,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,H.jsx)(an,{size:14})})]}),(0,H.jsx)(`p`,{role:`status`,children:`Resolved: this item needs nothing more from you.`})]});let l=t??e;if(l===void 0)return(0,H.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,H.jsx)(G,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,H.jsx)(an,{size:14})}),i?(0,H.jsx)(`p`,{role:`alert`,children:i}):(0,H.jsx)(`p`,{role:`status`,children:`Reading…`})]});let{item:u}=l,d=u.state===`open`,f=u.choices??[],p=u.kind===`question`&&d;return(0,H.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,tabIndex:0,children:[(0,H.jsxs)(`header`,{className:`human-item-detail-head`,children:[(0,H.jsx)(`h2`,{children:u.title}),(0,H.jsx)(G,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,H.jsx)(an,{size:14})})]}),i&&(0,H.jsx)(`p`,{role:`alert`,children:i}),(0,H.jsx)(`section`,{"aria-label":`Full body`,className:`human-item-detail-body`,children:(0,H.jsx)($B,{source:u.body})}),p&&f.length>0&&(0,H.jsxs)(`fieldset`,{className:`human-item-choice-list`,children:[(0,H.jsx)(`legend`,{children:`Choices`}),f.map(e=>(0,H.jsxs)(`div`,{className:`human-item-choice-entry`,children:[(0,H.jsx)(wH,{answering:o,choice:e,view:l}),(0,H.jsx)(`div`,{className:`human-item-choice-description`,children:(0,H.jsx)($B,{source:e.description})})]},e.id))]}),p&&(0,H.jsx)(TH,{answering:o,label:`Answer in detail: ${u.title}`,view:l}),(0,H.jsx)(EH,{view:l}),(0,H.jsx)(DH,{reason:o.refusals[u.id]}),(0,H.jsxs)(`div`,{className:`human-item-detail-actions`,children:[d&&u.kind===`task`&&(0,H.jsx)(G,{onClick:()=>s(l,{action:`complete`}),size:`sm`,type:`button`,children:`Complete`}),d&&(0,H.jsx)(G,{onClick:()=>s(l,{action:`dismiss`}),size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`}),(0,H.jsx)(OH,{state:a})]}),t?.history!==void 0&&t.history.length>0&&(0,H.jsx)(AH,{history:t.history}),(0,H.jsxs)(`dl`,{className:`human-item-metadata`,children:[kV(l).map(e=>(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(`dt`,{children:e.label}),(0,H.jsx)(`dd`,{children:`value`in e?e.value:(0,H.jsxs)(H.Fragment,{children:[e.party!==void 0&&`By ${e.party} · `,(0,H.jsx)(N,{at:e.at,relative:!0})]})})]},e.label)),t&&t.nodes.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:`Blocked steps`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`section`,{"aria-label":`Blocked steps`,className:`human-item-steps`,children:wV(t).map(({phrase:e,nodes:t})=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{children:e}),(0,H.jsx)(`ul`,{children:t.map(e=>(0,H.jsxs)(`li`,{children:[e.run,` / `,e.node,`: `,e.title]},`${e.run}/${e.node}`))})]},e))})})]}),u.tracker&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:`Tracker`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(rV,{className:`human-item-tracker-full`,label:u.tracker.task,url:u.tracker.url})})]})]})]})}function AH({history:e}){return(0,H.jsxs)(`section`,{"aria-label":`History`,className:`human-item-history`,children:[(0,H.jsx)(`h3`,{children:`History`}),(0,H.jsx)(`ol`,{children:e.map((e,t)=>(0,H.jsxs)(`li`,{children:[OV(e),` · `,(0,H.jsx)(N,{at:e.at,relative:!0})]},t))})]})}function jH({className:e,state:t}){let n=MH(t);return(0,H.jsxs)(p,{className:B(`gap-1.5 tracking-[.03em] uppercase`,n&&PH[n],e),variant:`outline`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:B(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),t]})}function MH(e){return BH[e]}var NH=e=>{let t=MH(e);return B(`size-2 shrink-0 rounded-full bg-current`,t===void 0?`text-muted-foreground`:FH[t])},PH={success:`border-success bg-success-surface text-success`,destructive:`border-destructive bg-destructive-surface text-destructive`,warning:`border-warning bg-warning-surface text-warning`,info:`border-info bg-info-surface text-info`},FH={success:`text-success`,destructive:`text-destructive`,warning:`text-warning`,info:`text-info`},IH=`success`,LH=`destructive`,RH=`warning`,zH={blocked:RH,cancelled:LH,"complete-but-draft":RH,"complete-but-held":RH,done:IH,failed:LH,"not-completed":LH,parked:void 0,pending:void 0,ready:void 0,running:`info`,skipped:RH,unknown:void 0,waiting:void 0},BH={...zH,complete:zH.done,settled:zH.done,active:zH.running},VH=`/human-items`;function HH(e){return e===`/human-items`||e===`/human-items/`}function UH(e){return HH(e)?`/`:e}function WH(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}var GH=()=>window.location.pathname;function KH(){let e=(0,V.useSyncExternalStore)(WH,GH,GH),t=(0,V.useCallback)(()=>{let e=new URLSearchParams;for(let t of new URLSearchParams(window.location.search).getAll(`hide-kind`))e.append(`hide-kind`,t);let t=e.size>0?`?${e}`:``;window.history.pushState(null,``,`${VH}${t}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{active:HH(e),open:t}}var qH={graph:`graph`,overall:`overall`,channel:`channel`};function JH(e){return e!==null&&Object.hasOwn(qH,e)}var YH={projects:`projects`,runs:`runs`};function XH(e){return e!==null&&Object.hasOwn(YH,e)}var ZH={decisions:{label:`Decisions`,description:`Decision points and settlements only`,profile:He.planner},activity:{label:`Detailed activity`,description:`Every record all three producers put on the stream`,profile:He.detailed}};function QH(e){return e!==null&&Object.hasOwn(ZH,e)}var $H={timeline:`Timeline`,task:`Task`,criteria:`Acceptance criteria`,dependencies:`Dependencies`,remote:`Remote`};function eU(e){return e!==null&&Object.hasOwn($H,e)}function tU(e,t){let n=e.get(t);return n!==null&&we(n)?n:void 0}function nU(){let e=(0,V.useSyncExternalStore)(rU,iU,iU),t=new URLSearchParams(e),n=t.get(`list`),r=XH(n)?n:`projects`,i=t.get(`project`),a=i!==null&&(i===`none`||c(i))?i:void 0,o=tU(t,`run`),s=tU(t,`node`),l=tU(t,`event`),u=t.get(`view`),d=t.get(`tab`),f=t.get(`detail`),p=QH(f)?f:`activity`,m=d===`pr`||d===`checks`?`remote`:eU(d)?d:`timeline`,h=JH(u)?u:s===void 0?`overall`:`graph`,g=(0,V.useCallback)((e,t=!1)=>{let n=new URLSearchParams(window.location.search);e(n);let r=t?window.location.pathname:UH(window.location.pathname);window.history.pushState(null,``,`${r}?${n}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{list:r,host:t.get(`page`)===`host`,hiddenKinds:t.getAll(`hide-kind`),selectHost:()=>g(e=>{e.set(`page`,`host`)}),selectKinds:e=>g(t=>{t.delete(`hide-kind`);for(let n of e)t.append(`hide-kind`,n)},!0),projectKey:a,runId:o,nodeId:s,itemId:l,view:h,detail:p,nodeTab:m,selectList:e=>g(t=>{e===`projects`?t.delete(`list`):t.set(`list`,e),t.delete(`project`)}),selectProject:e=>g(t=>{e===void 0?t.delete(`project`):t.set(`project`,e),t.delete(`list`),t.delete(`run`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectRun:e=>g(t=>{t.set(`run`,e),t.delete(`page`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectNode:e=>g(t=>{e?t.set(`node`,e):t.delete(`node`),t.delete(`event`),t.delete(`tab`),t.set(`view`,`graph`)}),selectItem:e=>g(t=>{e?t.set(`event`,e):t.delete(`event`)}),showOverall:()=>g(e=>{e.set(`view`,`overall`),e.delete(`node`),e.delete(`event`),e.delete(`tab`)}),selectDetail:e=>g(t=>{e===`activity`?t.delete(`detail`):t.set(`detail`,e)}),selectNodeTab:e=>g(t=>{e===`timeline`?t.delete(`tab`):t.set(`tab`,e),e!==`timeline`&&t.delete(`event`)}),selectView:e=>g(t=>{t.set(`view`,e),t.delete(`node`),t.delete(`event`),t.delete(`tab`)})}}function rU(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function iU(){return window.location.search}function aU(e){return[...e].sort((e,t)=>{let n=e.started_at,r=t.started_at;return n!==void 0&&r===void 0?-1:n===void 0&&r!==void 0?1:(r===void 0?0:Date.parse(r))-(n===void 0?0:Date.parse(n))||Date.parse(t.updated_at)-Date.parse(e.updated_at)||e.id.localeCompare(t.id)})}function oU(e){let t=new Map;for(let n of e){let e=n.group?.project??`none`,r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t].map(([e,t])=>{let n=aU(t),r=t[0]?.group?.project??null,i=t.map(e=>e.updated_at).reduce((e,t)=>Date.parse(t)>Date.parse(e)?t:e);return{key:e,project:r,label:r===null?`Other runs`:n.find(e=>e.group?.name)?.group?.name??r,rows:n,updatedAt:i}}).sort((e,t)=>Number(e.project===null)-Number(t.project===null)||Date.parse(t.updatedAt)-Date.parse(e.updatedAt)||e.key.localeCompare(t.key))}function sU(e){let{done:t,failed:n,running:r}=e.nodes;return be({done:t,failed:n,running:r})}function cU(e,t){let n=new Map(e.map(e=>[e.id,JSON.stringify(e)])),r=t.filter(e=>n.get(e.id)!==JSON.stringify(e)).length,i=new Set(t.map(e=>e.id));return r+e.filter(e=>!i.has(e.id)).length}function lU(e,t,n,r){let[i,a]=(0,V.useState)(new Set),o=(0,V.useCallback)(e=>{a(t=>t.has(e)?t:new Set(t).add(e))},[]),s=(0,V.useCallback)(e=>{a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),c=(0,V.useMemo)(()=>oU(e??[]),[e]),l=c.find(e=>e.rows.some(e=>e.id===n))?.key,[u,d]=(0,V.useState)();return l!==u&&(d(l),l!==void 0&&o(l)),(0,V.useMemo)(()=>({kinds:[...new Set(e?.flatMap(e=>e.kind?[e.kind]:[])??[])].sort(),groups:c.map(e=>{let n=e.rows.filter(e=>!e.kind||!t.includes(e.kind)),a=n[0];return{key:e.key,label:e.label,runs:n,expanded:i.has(e.key),toggle:()=>s(e.key),open:()=>{o(e.key),a&&r(a.id)}}})}),[e,c,t,i,o,s,r])}var uU=240,dU=`data-row-key`;function fU(e,t){let n=(0,V.useRef)(new Map);(0,V.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let r=t.getBoundingClientRect().top,i=[...t.querySelectorAll(`[${dU}]`)],a=new Map(i.map(e=>[e.getAttribute(`data-row-key`)??``,e.getBoundingClientRect().top-r])),o=[...n.current.keys()].filter(e=>a.has(e)),s=[...a.keys()].filter(e=>n.current.has(e));if(o.join(`
84
+ `)!==s.join(`
85
+ `)&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)for(let e of i){let t=n.current.get(e.getAttribute(`data-row-key`)??``),r=a.get(e.getAttribute(`data-row-key`)??``);t===void 0||r===void 0||t===r||e.animate([{transform:`translateY(${t-r}px)`},{transform:`translateY(0)`}],{duration:uU,easing:`ease-out`})}n.current=a},[e,t])}function pU({rows:e,failed:t=!1,selectedRunId:n,onSelect:r,onOpenProject:i,onHost:a,hostCurrent:o=!1,onActionItems:s,actionItemsCurrent:c=!1,hiddenKinds:l,onKindsChange:u,updates:d,drawerOpen:f=!1,drawerRef:p}){let{kinds:m,groups:h}=lU(e,l,n,i??r),g=(0,V.useRef)(null);return fU(g,h),(0,H.jsx)(`nav`,{"aria-label":`Projects`,className:`run-nav`,"data-open":f,id:`run-navigation`,ref:p,children:(0,H.jsx)(wd,{className:`h-full`,children:(0,H.jsxs)(`div`,{className:`px-[18px] py-6 max-sm:px-2`,children:[(0,H.jsxs)(`div`,{className:`brand`,children:[(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`brand-mark`,children:(0,H.jsx)(St,{size:20})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`eyebrow`,children:`Local orchestration`}),(0,H.jsx)(`h1`,{children:`DAG Observatory`})]})]}),(0,H.jsx)(Ld,{className:`my-[22px]`}),(0,H.jsxs)(`div`,{className:`nav-pages`,children:[(0,H.jsx)(G,{"aria-current":o?`page`:void 0,onClick:a,variant:`ghost`,children:`Host`}),s&&(0,H.jsx)(G,{"aria-current":c?`page`:void 0,onClick:s,variant:`ghost`,children:`Action items`})]}),m.length>0&&(0,H.jsxs)(`details`,{className:`kind-filter`,children:[(0,H.jsxs)(`summary`,{children:[(0,H.jsxs)(`span`,{children:[`Run kinds:`,` `,m.filter(e=>!l.includes(e)).length,` of`,` `,m.length]}),(0,H.jsx)(Ot,{"aria-hidden":`true`,size:14})]}),(0,H.jsxs)(`fieldset`,{children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Run kinds`}),m.map(e=>(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:!l.includes(e),onChange:t=>u(t.target.checked?l.filter(t=>t!==e):[...l,e])}),e]},e))]})]}),d,e===void 0?(0,H.jsx)(`p`,{role:`status`,children:t?`Projects did not load`:`Loading projects…`}):(0,H.jsx)(`div`,{className:`nav-rows`,ref:g,children:h.map(e=>(0,H.jsxs)(`fieldset`,{"aria-label":`Project ${e.label}`,className:`project-group`,children:[(0,H.jsxs)(`div`,{className:`project-row`,[dU]:`project:${e.key}`,children:[(0,H.jsx)(`button`,{"aria-expanded":e.expanded,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${e.label}`,className:`project-toggle`,onClick:e.toggle,type:`button`,children:(0,H.jsx)(kt,{"aria-hidden":`true`,"data-open":e.expanded,size:12})}),(0,H.jsxs)(`button`,{className:`project-open`,onClick:e.open,type:`button`,children:[(0,H.jsx)(`span`,{className:`project-name`,children:e.label}),(0,H.jsxs)(`span`,{className:`project-count`,children:[e.runs.length,(0,H.jsx)(`span`,{className:`sr-only`,children:` shown runs`})]})]})]}),e.expanded&&e.runs.length===0&&(0,H.jsx)(`p`,{className:`run-list-status`,role:`status`,children:`No runs of the shown kinds.`}),e.expanded&&e.runs.length>0&&(0,H.jsx)(`ul`,{"aria-label":`Runs of ${e.label}`,className:`run-list`,children:e.runs.map(e=>{let t=n===e.id,i=[e.state,sU(e)].filter(Boolean).join(` · `);return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:`run-link`,"data-active":t,onClick:()=>r(e.id),title:i,type:`button`,"data-row-key":`run:${e.id}`,children:[(0,H.jsxs)(Ap,{children:[(0,H.jsx)(jp,{asChild:!0,children:(0,H.jsx)(`span`,{role:`img`,"aria-label":e.state,className:B(`run-dot`,NH(e.state))})}),(0,H.jsx)(Mp,{children:e.state})]}),(0,H.jsx)(`span`,{className:`run-link-name`,children:e.name}),e.kind&&(0,H.jsx)(`span`,{"aria-label":e.kind,className:`run-link-tag`,role:`note`,children:e.kind}),t&&(0,H.jsx)(`span`,{className:`run-link-counts`,children:i})]})},e.id)})})]},e.key))})]})})})}function mU(){let[e,t]=(0,V.useState)(!1),n=(0,V.useRef)(null),r=(0,V.useRef)(null),i=(0,V.useRef)(!1),a=(0,V.useCallback)(()=>t(!1),[]),o=(0,V.useCallback)(()=>t(e=>!e),[]);return(0,V.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&t(!1)},i=()=>{n.current?.offsetParent===null&&t(!1)};return document.addEventListener(`keydown`,r),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`keydown`,r),window.removeEventListener(`resize`,i)}},[e]),(0,V.useEffect)(()=>{e?r.current?.querySelector(`button`)?.focus():i.current&&n.current?.focus(),i.current=e},[e]),{open:e,close:a,toggle:o,menuButton:n,drawer:r}}function hU(e,t){let[n,r]=(0,V.useState)(0),i=(0,V.useRef)(void 0),a=(0,V.useRef)(t);a.current=t;let o=e===`live`,s=(0,V.useRef)(o);s.current=o;let c=(0,V.useCallback)(e=>{i.current=void 0,r(0),a.current(e)},[]),l=(0,V.useCallback)(()=>{i.current!==void 0&&c(i.current.value)},[c]),u=(0,V.useCallback)((e,t=1)=>{s.current?c(e):(i.current={value:e},r(e=>e+t))},[c]),d=(0,V.useCallback)(()=>{i.current=void 0,r(0)},[]);return(0,V.useEffect)(()=>{o&&l()},[o,l]),(0,V.useEffect)(()=>{if(typeof e!=`number`)return;let t=setInterval(l,e*1e3);return()=>clearInterval(t)},[e,l]),{waiting:n,show:c,take:l,offer:u,drop:d}}function gU(e,t){let[n,r]=(0,V.useState)(),[i,a]=(0,V.useState)(),[o,s]=(0,V.useState)({}),c=(0,V.useRef)([]),[l,u]=(0,V.useState)(),[d,f]=(0,V.useState)(),[p,m]=(0,V.useState)(),[h,g]=(0,V.useState)(),[_,v]=(0,V.useState)(),[y,b]=(0,V.useState)(),[x,S]=(0,V.useState)(0),C=t.runId,w=l===void 0||C!==void 0&&l.some(e=>e.id===C)?C:C!==void 0||t.selectFirst?aU(l)[0]?.id:void 0,T=(0,V.useMemo)(()=>t.humanItems??Ge(t.host?void 0:w,t.view,t.nodeId,t.filter),[t.humanItems,t.host,w,t.view,t.nodeId,t.filter]),E=(0,V.useRef)(void 0),D=(0,V.useRef)(T);D.current=T;let O=(0,V.useRef)(t.first),k=hU(t.navigationUpdates,f),A=hU(t.mainUpdates,(0,V.useCallback)(e=>{r(e.state),a(e.view);let{visible:t}=e.state;if(t.type===`human-items`){let{items:n,detail:r}=t;s({items:n,detail:r,...e.view.type===`human-items`&&e.view.item!==void 0?{item:e.view.item}:{}})}m(new Date().toISOString()),e.reset!==void 0&&b(`The live view was re-sent whole: ${e.reset}.`)},[])),j=t.navigationUpdates!==`off`||t.mainUpdates!==`off`,M=(0,V.useRef)(j);M.current=j,(0,V.useEffect)(()=>{g(void 0);let t=!0,n=O.current;if(O.current=void 0,n?.error!==void 0){g(n.error);return}let r=e.live({view:D.current,paused:!M.current,...n?.answer!==void 0&&JSON.stringify(n.address.view)===JSON.stringify(D.current)?{initial:n.answer}:{},onState:(e,n)=>{let i=c.current;e.sidebar!==void 0&&(c.current=e.sidebar,u(e.sidebar)),g(void 0),v(void 0);let a={state:e,view:r.view,...n.kind===`reset`?{reset:n.reason}:{}};if(n.kind===`snapshot`){if(A.show(a),e.sidebar!==void 0){if(t)k.show(e.sidebar);else if(i!==e.sidebar){let t=cU(i,e.sidebar);t>0&&k.offer(e.sidebar,t)}}t=!1;return}if(n.kind===`reset`){e.sidebar!==void 0&&k.offer(e.sidebar),A.offer(a);return}if(n.frame.type===`sidebar.snapshot`){k.show(n.frame.rows);return}let o=n.frame.type===`run.changed`||n.frame.type===`run.removed`;o&&e.sidebar!==void 0&&k.offer(e.sidebar),(!o||e.visible.type===`sidebar`)&&A.offer(a)},onError:e=>{if(r.view.type===`human-items`){s(t=>({...t.items===void 0?{}:{items:t.items},error:e.message})),r.change({type:`sidebar`});return}if(e instanceof ew&&(e.code===`run_not_found`||e.code===`node_not_found`)){r.change({type:`sidebar`});return}g(e)},onDisconnected:()=>v(Error(`Live telemetry stream disconnected`)),onConnected:()=>v(void 0)});return E.current=r,()=>{r.close(),E.current===r&&(E.current=void 0)}},[e,x,A.show,A.offer,k.show,k.offer]),(0,V.useEffect)(()=>{JSON.stringify(E.current?.view)!==JSON.stringify(T)&&A.drop(),E.current?.change(T),T.type!==`human-items`&&s(e=>Object.keys(e).length===0?e:{})},[T,A.drop]),(0,V.useEffect)(()=>{j?E.current?.resume():E.current?.pause()},[j]);let N=(0,V.useCallback)(()=>{k.take(),A.take()},[k.take,A.take]),P=(0,V.useCallback)(()=>{b(void 0),N(),S(e=>e+1)},[N]),F=n?.visible,I=F!==void 0&&F.type!==`sidebar`&&F.type!==`human-items`&&F.run_id===w&&_U(F,T)&&JSON.stringify(i)===JSON.stringify(T)?F:void 0,L=(0,V.useRef)(void 0),R=I?.detail??(L.current?.run.run_id===w?L.current:void 0);L.current=R;let z=(0,V.useMemo)(()=>vU(R),[R]),ee=h!==void 0&&T.type===`timeline`&&R!==void 0;return{rows:l,navigationRows:d,navigationWaiting:k.waiting,hostRows:n?.sidebar,mainWaiting:A.waiting,runId:w,detail:R,timeline:I&&`timeline`in I?I.timeline:void 0,channel:I&&`channel`in I?I.channel:void 0,humanItems:o,timelineError:ee?h:void 0,loading:n===void 0&&h===void 0,lastUpdated:p,activity:z,error:ee?_:h??_,notice:y,refresh:P}}function _U(e,t){return t.type===e.type?t.type===`timeline`&&e.type===`timeline`?t.scope===e.scope&&(t.scope===`run`||e.scope===`node`&&e.node===t.node):!0:!1}function vU(e){let t=e?.run.live_activity;if(t===void 0)return[];let n=A.safeParse(t);return n.success?n.data:[]}var yU={minutes:60,seconds:1},bU=e=>Object.hasOwn(yU,e),xU=600%yU.minutes==0?{amount:String(600/yU.minutes),unit:`minutes`}:{amount:`600`,unit:`seconds`};function SU(e){let t=e.amount.trim();if(!/^\d+$/u.test(t))return;let n=Number(t)*yU[e.unit];return Number.isSafeInteger(n)?n:void 0}function CU(e){if(e===0)return`no grace`;let t=Math.floor(e/60),n=e%60,r=(e,t)=>`${e} ${t}${e===1?``:`s`}`;return t===0?r(n,`second`):n===0?r(t,`minute`):`${r(t,`minute`)} ${r(n,`second`)}`}function wU(e){return e.map(e=>({runId:e.run_id,owner:rt(e.launch)}))}function TU(e,t){return t instanceof ew&&t.status!==void 0&&t.code!==void 0?{phase:`refused`,sent:e,error:t}:{phase:`lost`,sent:e,error:t instanceof Error?t:Error(String(t))}}var EU={dispatchStopped:`dispatch-stopped`,hostShutdown:`host-shutdown`};function DU(e,t,n){let r=new Set(e.runs.map(({runId:e})=>e)),i=Object.values(EU);return n.flatMap(e=>{if(!r.has(e.run_id))return[];let n=e.last_event;if(n===null||!i.includes(n))return[];let a=t.get(e.run_id);return a!==void 0&&a.last_event===n&&a.last_progress_at===e.last_progress_at?[]:[{runId:e.run_id,recorded:n===EU.hostShutdown?EU.hostShutdown:EU.dispatchStopped}]})}function OU(e){return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).format(e)}function kU(e){return(0,V.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.owner,(t.get(n.owner)??0)+1);return[...t].map(([e,t])=>({owner:e,count:t}))},[e])}var AU=`Each live dispatch is asked to stop and commit, and given the grace to end itself; whatever is still standing then is torn down, and every branch the run's records name is pushed to its origin. Nothing is sent until you confirm.`;function jU({open:e,onOpenChange:t,runs:n,blocked:r,unreadable:i=0,onConfirm:a}){let o=(0,V.useId)(),[s,c]=(0,V.useState)(xU),[l,u]=(0,V.useState)(!1),d=SU(s),f=n!==void 0&&r===void 0,p=()=>{c(xU),u(!1),t(!1)};return(0,H.jsx)(Fs,{onOpenChange:e=>e?t(!0):p(),open:e,children:(0,H.jsxs)(zs,{className:`shutdown-dialog`,children:[(0,H.jsxs)(Bs,{children:[(0,H.jsx)(Hs,{children:`Shut down the entire host?`}),(0,H.jsx)(Us,{children:AU})]}),(0,H.jsxs)(`div`,{className:`shutdown-dialog-body`,children:[r===void 0?n===void 0?(0,H.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:`Reading which runs this acts on…`}):(0,H.jsx)(NU,{caption:`It acts on all ${MU(n.length)} on this host, over their owners — each is interrupted, torn down and pushed:`,label:`Runs on this host`,runs:n,warning:!0}):(0,H.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:r}),i>0&&(0,H.jsxs)(`p`,{className:`shutdown-scope-note`,children:[i===1?`1 run root on this host could not be read`:`${i} run roots on this host could not be read`,`: the engine cannot read them either, so this shutdown signals nothing in them and pushes none of their branches.`]}),(0,H.jsxs)(`fieldset`,{className:`shutdown-grace`,children:[(0,H.jsx)(`legend`,{children:`Grace`}),(0,H.jsxs)(`div`,{className:`shutdown-grace-row`,children:[(0,H.jsx)(qs,{className:`sr-only`,htmlFor:`${o}-grace`,children:`Grace`}),(0,H.jsx)(Ws,{"aria-describedby":`${o}-grace-help`,"aria-invalid":d===void 0,id:`${o}-grace`,inputMode:`numeric`,min:0,onChange:e=>c({...s,amount:e.target.value}),step:1,type:`number`,value:s.amount}),(0,H.jsx)(qs,{className:`sr-only`,htmlFor:`${o}-unit`,children:`Grace unit`}),(0,H.jsx)(`select`,{className:`composer-select`,id:`${o}-unit`,onChange:e=>{let t=e.target.value;bU(t)&&c({...s,unit:t})},value:s.unit,children:Object.keys(yU).map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})]}),(0,H.jsx)(`p`,{className:`channel-age`,id:`${o}-grace-help`,children:d===void 0?`The grace is a whole number of minutes or seconds, 0 or more.`:`How long each live dispatch has to end itself once asked: ${CU(d)}. The engine's default is ${CU(SU(xU)??0)}.`})]}),(0,H.jsxs)(`div`,{className:`composer-check shutdown-force`,children:[(0,H.jsx)(`input`,{checked:l,id:`${o}-force`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,H.jsx)(qs,{htmlFor:`${o}-force`,children:`Force: skip the interrupt and the wait and go straight to the teardown — whatever a worker had not committed is lost.`})]})]}),(0,H.jsxs)(Vs,{children:[(0,H.jsx)(Ls,{asChild:!0,children:(0,H.jsx)(G,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,H.jsx)(G,{disabled:!f||d===void 0,onClick:()=>{d!==void 0&&(a(d,l),p())},type:`button`,variant:`destructive`,children:`Shut down the host`})]})]})})}var MU=e=>e===1?`1 run`:`${e} runs`;function NU({caption:e,label:t,runs:n,warning:r=!1}){let i=kU(n);return(0,H.jsxs)(`div`,{className:`shutdown-runs`,"data-warning":r,children:[(0,H.jsx)(`p`,{className:`shutdown-scope-note`,children:e}),(0,H.jsx)(`ul`,{"aria-label":t,children:i.map(({owner:e,count:t})=>(0,H.jsxs)(`li`,{children:[e,` — `,MU(t)]},e))})]})}function PU(e,t,n){let[r,i]=(0,V.useState)(),a=FU(r!==void 0,e,t,n);return{open:r,setOpen:i,opener:e=>()=>i(e),runs:a.rows===void 0||r===void 0?void 0:wU(a.rows),blocked:a.blocked,unreadable:e?.unreadable?.length??0}}function FU(e,t,n,r){let i=(0,V.useRef)(new Set),a=t?.next_cursor;return(0,V.useEffect)(()=>{if(!e){i.current.clear();return}a===void 0||r||i.current.has(a)||(i.current.add(a),n())},[e,a,r,n]),t===void 0?{blocked:`Reading the runs listing this view holds…`}:a===void 0?{rows:t.runs}:!r&&i.current.has(a)?{blocked:`The rest of the runs listing could not be read (${t.runs.length} runs read), so the runs this acts on cannot all be named. Close this and try again.`}:{blocked:`Reading the rest of the runs listing so every run this acts on can be named (${t.runs.length} read so far)…`}}function IU(e,t){let[n,r]=(0,V.useState)({phase:`idle`}),i=(0,V.useRef)(!1);return{state:n,confirm:(0,V.useCallback)((n,a,o)=>{if(i.current)return;i.current=!0;let s={scope:e,runs:n,grace:a,force:o,sentAt:Date.now()};r({phase:`sending`,sent:s}),t({grace:a,force:o}).then(e=>r({phase:`answered`,sent:s,report:e}),e=>r(TU(s,e))).finally(()=>{i.current=!1})},[e,t]),dismiss:(0,V.useCallback)(()=>{i.current||r({phase:`idle`})},[])}}var LU=[`host`];function RU(e){return{host:IU(`host`,(0,V.useCallback)(t=>e.shutdown(`host`,t),[e]))}}function zU({list:e,loadMore:t,loadingMore:n,shutdowns:r}){let{open:i,setOpen:a,opener:o,runs:s,blocked:c,unreadable:l}=PU(e,t,n),u=r.host.state.phase===`sending`;return(0,H.jsxs)(`fieldset`,{"aria-label":`Shut down runs on this host`,className:`host-shutdown`,children:[(0,H.jsx)(`p`,{className:`eyebrow`,children:`This host`}),(0,H.jsx)(`div`,{className:`host-shutdown-actions`,children:(0,H.jsxs)(G,{disabled:u,onClick:o(`host`),size:`sm`,type:`button`,variant:`destructive`,children:[(0,H.jsx)(Jt,{size:14}),` Shut down the entire host`]})}),LU.map(e=>(0,H.jsx)(jU,{blocked:c,onConfirm:(e,t)=>s!==void 0&&r.host.confirm(s,e,t),onOpenChange:t=>a(t?e:void 0),open:i===e,runs:i===e?s:void 0,unreadable:l},e))]})}var BU=1e3;function VU(e,t){let[n,r]=(0,V.useState)(()=>Date.now());(0,V.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),BU);return()=>clearInterval(e)},[]);let i=DU(e,(0,V.useRef)(new Map(t.filter(t=>e.runs.some(({runId:e})=>e===t.run_id)).map(e=>[e.run_id,e]))).current,t);return{now:n,progress:i,done:i.filter(({recorded:e})=>e===EU.hostShutdown).length,deadline:e.sentAt+e.grace*1e3,asks:!e.force&&e.grace>0}}function HU({label:e,state:t,rows:n,onDismiss:r}){return t.phase===`idle`?null:(0,H.jsxs)(`section`,{"aria-label":e,className:`shutdown-status`,children:[t.phase===`sending`?(0,H.jsx)(WU,{rows:n,sent:t.sent}):t.phase===`lost`?(0,H.jsxs)(ki,{"aria-label":`${e} lost`,variant:`destructive`,children:[(0,H.jsx)(tn,{}),(0,H.jsx)(Ai,{children:`Shutdown lost: no answer came back`}),(0,H.jsxs)(ji,{children:[(0,H.jsxs)(`p`,{children:[`The request sent at `,OU(t.sent.sentAt),` ended without an answer (`,t.error.message,`). The engine may still be carrying out the shutdown — check the runs before sending another.`]}),(0,H.jsx)(UU,{sent:t.sent})]})]}):t.phase===`refused`?(0,H.jsxs)(ki,{"aria-label":`${e} refused`,variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsxs)(Ai,{children:[`Shutdown refused · `,t.error.status,` `,t.error.code]}),(0,H.jsxs)(ji,{children:[(0,H.jsx)(`pre`,{className:`verb-text`,children:t.error.message}),(0,H.jsx)(`p`,{children:`Nothing was signalled and nothing was pushed.`})]})]}):(0,H.jsx)(KU,{label:e,report:t.report}),t.phase!==`sending`&&(0,H.jsx)(`div`,{className:`composer-actions`,children:(0,H.jsx)(G,{onClick:r,size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`})})]})}function UU({sent:e}){return(0,H.jsxs)(`p`,{className:`channel-age`,children:[`Sent `,OU(e.sentAt),` · scope `,e.scope,` · grace`,` `,CU(e.grace),e.force?` · forced`:``,` · `,e.runs.length,` `,e.runs.length===1?`run`:`runs`,` in scope`]})}function WU({sent:e,rows:t}){let{now:n,progress:r,done:i,deadline:a,asks:o}=VU(e,t);return(0,H.jsxs)(`div`,{"aria-live":`polite`,className:`shutdown-inflight`,role:`status`,children:[(0,H.jsxs)(`p`,{className:`shutdown-inflight-head`,children:[(0,H.jsx)(zt,{"aria-hidden":`true`,className:`animate-spin`,size:14}),(0,H.jsx)(`strong`,{children:`Shutdown in progress`}),` — still waiting for the engine's answer, `,ue(Math.max(0,n-e.sentAt)),` after it was sent.`]}),(0,H.jsx)(UU,{sent:e}),(0,H.jsx)(`p`,{children:o?n<a?`Waiting out the ${CU(e.grace)} grace until ${OU(a)} (${ue(a-n)} left) for each live dispatch to end itself; runs are worked through one after another, each with its own grace.`:`The first grace ran out at ${OU(a)}; the engine is tearing down what is still standing and pushing branches, run by run.`:`Forced: nothing is asked or waited for; the engine is tearing the runs down and pushing their branches.`}),(0,H.jsxs)(`p`,{children:[i,` of `,e.runs.length,` `,e.runs.length===1?`run has`:`runs have`,` recorded their shutdown.`]}),r.length>0&&(0,H.jsx)(`ul`,{"aria-label":`Recorded so far`,children:r.map(({runId:e,recorded:t})=>(0,H.jsxs)(`li`,{children:[e,`:`,` `,t===EU.hostShutdown?`put down — host-shutdown recorded after its teardown and pushes`:`its dispatches are stopping — dispatch-stopped recorded`]},e))})]})}function GU(e){let t=e.remote===null?``:` to ${e.remote}`,n=e.commit===null?``:` at ${e.commit}`;switch(e.result){case`pushed`:return`pushed${t}${n}`;case`already-on-origin`:return`already on its origin${t}${n}; nothing was pushed`;case`no-remote`:return`not pushed: this identity has no origin${n}`;case`refused`:return`could not be preserved${n}`}}function KU({label:e,report:t}){return(0,H.jsxs)(ki,{"aria-label":`${e} report`,variant:t.complete?`default`:`destructive`,children:[t.complete?(0,H.jsx)(jt,{}):(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:t.complete?`Shutdown complete`:`Shutdown incomplete`}),(0,H.jsxs)(ji,{className:`shutdown-report`,children:[!t.complete&&(0,H.jsx)(`p`,{children:`Not everything went as asked: a dispatch was killed at the deadline or is still running, a teardown was not clean, or a branch could not be preserved. Read the runs below.`}),(0,H.jsxs)(`p`,{className:`channel-age`,children:[`Scope `,t.scope,` · grace `,CU(t.grace_seconds),t.forced?` · forced`:``,` · runs root `,t.root]}),t.runs.length===0?(0,H.jsx)(`p`,{children:`No run was selected: nothing was signalled.`}):t.runs.map(e=>(0,H.jsxs)(`section`,{"aria-label":`Shutdown of ${e.run_id}`,className:`shutdown-report-run`,children:[(0,H.jsxs)(`h4`,{children:[e.run_id,` · owner `,e.owner,e.forced_over_owner&&` — another session's run, acted on over its owner`]}),e.dispatches.length===0?(0,H.jsx)(`p`,{children:`No live dispatch to interrupt.`}):(0,H.jsx)(`ul`,{"aria-label":`Dispatches of ${e.run_id}`,children:e.dispatches.map(e=>(0,H.jsxs)(`li`,{children:[e.node,` (pid `,e.pid,`): interrupt`,` `,e.interrupt,`; ended `,e.ended,` after`,` `,ue(e.waited_ms),(0,H.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.node}-${e.pid}`))}),(0,H.jsxs)(`p`,{children:[`Teardown: `,e.teardown]}),e.branches.length===0?(0,H.jsx)(`p`,{children:`No branch this run's records name.`}):(0,H.jsx)(`ul`,{"aria-label":`Branches of ${e.run_id}`,children:e.branches.map(e=>(0,H.jsxs)(`li`,{children:[e.identity,`@`,e.branch,`: `,GU(e),(0,H.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.identity}@${e.branch}`))})]},e.run_id)),t.not_pushed_unread===null?t.not_pushed.length===0?(0,H.jsx)(`p`,{children:`Other unpublished branches on this host: none.`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{children:[`Other unpublished branches on this host, which this shutdown did not push (`,t.not_pushed.length,`):`]}),(0,H.jsx)(`ul`,{"aria-label":`Branches not pushed`,children:t.not_pushed.map(({identity:e,branch:t})=>(0,H.jsxs)(`li`,{children:[e,`@`,t]},`${e}@${t}`))})]}):(0,H.jsxs)(`p`,{children:[`Other unpublished branches on this host: not read —`,` `,t.not_pushed_unread,`. This is not a count of zero: there may be work on this host nothing outside it carries.`]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`The engine's own report`}),(0,H.jsx)(`pre`,{className:`verb-text`,children:t.rendered})]})]})]})}var qU={crosshair:!0,ticks:{minSpacingPx:80}},JU=2e3;function YU(e){let[t,n]=e;if(n-t>=2e3)return e;let r=(t+n)/2;return[r-JU/2,r+JU/2]}var XU=1e3;function ZU({completedAt:e,startedAt:t}){let n=t===void 0?void 0:F(t),r=e===void 0?void 0:F(e),i=QU(n!==void 0&&r===void 0);return n===void 0?null:r===void 0?(0,H.jsxs)(H.Fragment,{children:[ue(i-n.getTime()),` · running`]}):(0,H.jsx)(H.Fragment,{children:ue(r.getTime()-n.getTime())})}function QU(e){let[t,n]=(0,V.useState)(()=>Date.now());return(0,V.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),XU);return()=>clearInterval(t)},[e]),t}function $U({control:e}){if(e===void 0)return null;let t=e.addressable?`Turn reachable`:`No turn to reach`,n=e.addressable?`a planner's note can be delivered into the ${e.member??`member`} turn in flight`:e.reason,r=e.addressable?Wt:Ht;return(0,H.jsxs)(p,{"aria-label":`${t}: ${n}`,className:B(`node-view-control gap-1.5`,e.addressable?`border-info bg-info-surface text-info`:`border-warning bg-warning-surface text-warning`),title:n,variant:`outline`,children:[(0,H.jsx)(r,{"aria-hidden":`true`,size:12}),t]})}function eW({failure:e}){return(0,H.jsxs)(`p`,{className:`page-failed`,role:`alert`,children:[(0,H.jsxs)(`span`,{children:[`Earlier rows did not load: `,e.message]}),(0,H.jsx)(`button`,{onClick:e.retry,type:`button`,children:`Try again`})]})}function tW({failure:e,loading:t,onLoad:n}){return e===void 0?(0,H.jsx)(`button`,{className:`load-earlier`,disabled:t,onClick:n,type:`button`,children:t?`Loading earlier rows…`:`Load earlier rows`}):(0,H.jsx)(eW,{failure:e})}function nW(e,t){let[n,r]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{n!==null&&!n.isConnected&&r(null)}),(0,V.useLayoutEffect)(()=>{let i=e.current;if(!t||n!==null||i===null)return;let a=()=>{let e=i.querySelector(`[aria-label^="Timeline plot"]`);return e===null?!1:(getComputedStyle(e).position===`static`&&(e.style.position=`relative`),r(e),!0)};if(a())return;let o=new MutationObserver(()=>{a()&&o.disconnect()});return o.observe(i,{childList:!0,subtree:!0}),()=>o.disconnect()}),n}function rW({container:e,range:t,stretches:n}){let r=nW(e,n.length>0);if(r===null)return null;let i=Math.max(t[1]-t[0],1),a=e=>(Math.min(Math.max(e,t[0]),t[1])-t[0])/i*100;return(0,rr.createPortal)(n.map(([e,t])=>(0,H.jsx)(`span`,{className:`history-hatch`,"data-from":e,"data-to":t,style:{left:`${a(e)}%`,width:`${a(t)-a(e)}%`},children:(0,H.jsx)(`span`,{className:`history-hatch-label`,children:Ze})},`${e}-${t}`)),r)}function iW(e){return e===`human-step`?`human step`:e}function aW(e){return e.style===`human-step`}function oW(e){switch(e){case`not-released`:return`not released yet`;case`awaiting-human-step`:return`waiting for the human step`;case`not-answered`:return`the registry did not answer`;case`not-landed`:return`released, but not carrying this work yet`;default:return e}}function sW(e){if(e!==void 0)return e?`yes — a later acknowledgement replaced this one`:`no`}function cW(e){if(e!==void 0)return e===`live`?`Live — into the turn that was already running`:e===`next`?`Deferred — onto the node's next dispatch`:e}function lW(e){return[e.identity,e.target].filter(Boolean).join(` · `)||e.dep}function uW({release:e}){let t=[[`Dependency`,e.dep],[`Identity`,e.identity],[`Release target`,e.target],[`Style`,e.style===void 0?void 0:iW(e.style)],[`Version`,e.version],[`Probe outcome`,e.outcome],[`Probed through`,e.form],[`Probe took`,e.elapsed_ms===void 0?void 0:`${e.elapsed_ms} ms`],[`Acknowledged by`,e.actor],[`Superseded`,sW(e.superseded)],[`Landed as`,e.landing_commit],[`Adopted`,cW(e.delivery)]].filter(([,e])=>e!==void 0);return(0,H.jsxs)(H.Fragment,{children:[t.length>0&&(0,H.jsx)(`dl`,{className:`facts`,children:t.map(([e,t])=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:e}),(0,H.jsx)(`dd`,{children:t})]},e))}),e.awaiting!==void 0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Held on`}),(0,H.jsx)(`ul`,{className:`release-awaiting`,children:e.awaiting.map(e=>(0,H.jsxs)(`li`,{children:[aW(e)?(0,H.jsxs)(ki,{children:[(0,H.jsx)(oe,{}),(0,H.jsxs)(Ai,{children:[`Waiting on a person · `,lW(e)]}),(0,H.jsx)(ji,{children:e.action??`The release is a human step and the run recorded no action for it.`})]}):(0,H.jsxs)(`p`,{className:`detail-note`,children:[`Waiting on an automated release · `,lW(e)]}),(0,H.jsx)(`p`,{className:`detail-note`,children:[e.last_answer===void 0?void 0:oW(e.last_answer),e.waited_seconds===void 0?void 0:`waited ${e.waited_seconds}s`].filter(e=>e!==void 0).join(` · `)})]},`${e.dep}·${e.identity??``}·${e.target??``}`))})]}),e.versions!==void 0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Versions adopted`}),(0,H.jsx)(`ul`,{className:`release-awaiting`,children:e.versions.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`p`,{className:`detail-note`,children:[e.identity,` · `,e.target,` · `,e.version]})},`${e.identity}·${e.target}`))})]})]})}function dW({node:e}){let t=e.result?.release??void 0;if(t===void 0)return(0,H.jsx)(H.Fragment,{children:`Not recorded`});let n=t.identity!==e.task?.repo;return(0,H.jsx)(H.Fragment,{children:[t.target,t.style===void 0?void 0:iW(t.style),t.version,n?t.identity:void 0].filter(e=>e!==void 0).join(` · `)})}function fW({artifactId:e,client:t,runId:n}){let r=Hw(`${n}/${e}`,()=>t.getArtifact(n,e),0),i=r.value?.turns??[];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Oneharness conversation`}),r.loading?(0,H.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading conversation…`}):r.value===void 0?(0,H.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`The history store holds no readable copy of that conversation.`}):r.value.unavailable===void 0?(0,H.jsx)(ea,{className:`gap-0 py-3`,children:(0,H.jsx)(ta,{className:`px-3`,children:i.map(e=>(0,H.jsx)(LC,{turn:e},e.id))})}):(0,H.jsxs)(ki,{variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`Transcript unavailable`}),(0,H.jsx)(ji,{children:r.value.unavailable})]})]})}function pW({artifactId:e,client:t,heading:n,missing:r,noun:i,runId:a,unreadable:o}){let s=mW(e),c=Hw(s===void 0?void 0:`${a}/${s}`,()=>t.getArtifact(a,s??``),0),l=c.value?.content;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:n}),s===void 0?(0,H.jsx)(`p`,{className:`detail-note`,children:r}):c.loading?(0,H.jsxs)(`p`,{"aria-live":`polite`,className:`detail-note`,children:[`Loading `,i,`…`]}):l===void 0?(0,H.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:o}):(0,H.jsxs)(H.Fragment,{children:[c.value?.truncated===!0&&(0,H.jsxs)(`p`,{className:`detail-note`,children:[`The server keeps the end of a `,i,` this long; its beginning is not shown.`]}),(0,H.jsx)(`section`,{"aria-label":n,children:(0,H.jsx)(`pre`,{children:l})})]})]})}function mW(e){if(!(e===void 0||/[/?#]/u.test(e)))return e}function hW(e,t,n,r){let[i,a]=(0,V.useState)(),o=t===void 0||n===void 0?void 0:JSON.stringify([t,n]);(0,V.useEffect)(()=>{if(o===void 0||t===void 0||n===void 0)return;let r=!0;return e.getConversation(t,n).then(e=>{r&&a({key:o,conversation:e})}).catch(e=>{if(!r)return;let t=e instanceof Error?e:Error(String(e));a(e=>e?.key===o&&e.conversation!==void 0?e:{key:o,error:t})}),()=>{r=!1}},[e,t,n,o,r]);let s=i?.key===o?i:void 0;return(0,V.useMemo)(()=>({conversation:s?.conversation,error:s?.error,loading:o!==void 0&&s===void 0}),[s,o])}var gW=32;function _W(e){return e===null?null:e.closest(`[data-slot="scroll-area-viewport"]`)??e.parentElement}function vW(e,t){let n=(0,V.useRef)(null),r=(0,V.useRef)(!0),i=(0,V.useRef)({key:e,count:t}),a=(0,V.useCallback)(()=>{let e=n.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<=gW)},[]),o=(0,V.useCallback)(e=>{n.current?.removeEventListener(`scroll`,a),n.current=_W(e),n.current?.addEventListener(`scroll`,a,{passive:!0}),a()},[a]);return(0,V.useLayoutEffect)(()=>{let a=i.current;i.current={key:e,count:t};let o=a.key===e&&a.count>0&&t>a.count,s=n.current;!o||s===null||!r.current||(s.scrollTop=s.scrollHeight)},[e,t]),o}var yW=25;function bW({client:e,runId:t,node:n,row:r}){let i=r===void 0?void 0:VW(r),a=i?.kind===`conversation`?i.value:void 0,o=hW(e,t,a,r===void 0?void 0:IW(r));return(0,H.jsx)(`section`,{"aria-label":`Timeline item detail`,className:`timeline-detail`,children:(0,H.jsx)(wd,{className:`h-full`,children:(0,H.jsx)(`div`,{className:`p-[22px] max-sm:p-3`,ref:vW(a,LW(r,o)),children:r===void 0?(0,H.jsxs)(`div`,{className:`detail-placeholder`,children:[(0,H.jsx)(Rt,{size:30}),(0,H.jsx)(`p`,{children:`Select an item in the timeline to read what it recorded.`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(D,{row:r}),(0,H.jsx)(Ld,{className:`my-4`}),(0,H.jsx)(xW,{client:e,runId:t,node:n,reference:i,row:r,transcript:o})]})})})})}function xW({client:e,runId:t,row:n,node:r,reference:i,transcript:a}){let o=RW(n);if(o!==void 0)return(0,H.jsx)(jW,{redirection:o,row:n});let s=zW(n);if(s!==void 0)return(0,H.jsx)(uW,{release:s});let c=BW(n);return c===void 0?i?.kind===`conversation`?(0,H.jsxs)(H.Fragment,{children:[n.rowKind===`event`&&(0,H.jsx)(PW,{row:n,reference:i}),(0,H.jsx)(EW,{row:n,transcript:a})]}):UW(n)?(0,H.jsx)(DW,{client:e,runId:t,reference:i,row:n}):i?.kind===`worker_report`&&mW(i.value)!==void 0?(0,H.jsx)(OW,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):i?.kind===`oneharness_session`&&mW(i.value)!==void 0?(0,H.jsx)(kW,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):WW(n,i)&&r!==void 0?(0,H.jsx)(AW,{node:r,reference:i}):(0,H.jsx)(PW,{reference:i,row:n}):(0,H.jsx)(NW,{row:n,surface:c})}function SW({turn:e}){return e.judges===void 0||e.judges.length===0?null:(0,H.jsx)(`ul`,{"aria-label":`Judges on turn ${e.id}`,className:`judge-decisions`,children:e.judges.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`span`,{className:`judge-decision-who`,children:[e.judge,` (`,e.kind,`)`]}),` `,e.decision,` — `,e.reason]},e.judge))})}function CW(e){return e.tool?.turn??e.id}function wW(e,t){if(e.rowKind!==`event`||e.event.tool===void 0)return;let n=CW(e.event),r=t.find(({id:e})=>e===n);if(r===void 0)return;let{index:i,tool_call_id:a}=e.event.tool;return a!==void 0&&r.tools.some(e=>e.toolCallId===a)?{turnId:r.id,toolCallId:a}:{turnId:r.id,eventIndex:i}}function TW({turn:e}){let t=[e.unknown.instruction_truncated===!0?`its prompt`:void 0,e.unknown.truncated===!0?`its reply`:void 0,e.tools.some(e=>e.output_truncated===!0)?`a tool's output`:void 0,e.tools.some(e=>e.input_truncated===!0)?`a tool's input`:void 0].filter(e=>e!==void 0);return t.length===0?null:(0,H.jsxs)(ki,{className:`mb-3`,role:`note`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`Cut by the recorder`}),(0,H.jsxs)(ji,{children:[`The run's recorder cut `,t.join(`, `),` to its bound, and no whole copy exists: neither the member's report nor a history file this run names holds it.`]})]})}function EW({row:e,transcript:t}){let[n,r]=(0,V.useState)(yW),i=t.conversation?.conversation.turns??[],a=e.rowKind===`event`?CW(e.event):void 0,o=a===void 0?i:i.filter(({id:e})=>e===a),s=Gp(o.map(e=>({id:e.id,time:Date.parse(e.timestamp)})));if(t.loading)return(0,H.jsxs)(`div`,{"aria-live":`polite`,className:`loading-inline`,children:[(0,H.jsx)(Rd,{className:`h-2 w-40`}),(0,H.jsx)(Rd,{className:`h-2 w-24`}),`Loading transcript…`]});if(t.conversation===void 0)return(0,H.jsxs)(ki,{variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`Transcript unavailable`}),(0,H.jsx)(ji,{children:t.error?.message??`The server recorded no transcript.`})]});let{conversation:c,attribution:l}=t.conversation,u=GW(l.agentRole,l.transportRole),d=wW(e,o);return(0,H.jsx)(ea,{className:`gap-0 py-3`,children:(0,H.jsxs)(ta,{className:`px-3`,children:[(0,H.jsxs)(`header`,{className:`transcript-header`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`p`,{className:`eyebrow`,children:[e.dispatch===void 0?``:`${e.dispatch.label} · `,u,l.persona?` · ${l.persona}`:``]}),(0,H.jsx)(`h4`,{children:c.name})]}),(0,H.jsx)(Pp,{state:c.state})]}),(0,H.jsx)(Ld,{className:`my-2.5`}),(0,H.jsx)(`div`,{className:`conversation-timeline-sticky`,children:(0,H.jsx)(Wp,{cursor:s.cursor,...d===void 0?{}:{focus:d},onSelectTurn:s.scrollTo,turns:[...o]})}),o.length===0?(0,H.jsx)(`p`,{className:`detail-note`,children:`This turn is no longer part of the recorded transcript.`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{ref:s.containerRef,children:o.slice(0,n).map(e=>(0,H.jsxs)(`div`,{ref:t=>s.register(e.id,t),children:[(0,H.jsx)(TW,{turn:e}),(0,H.jsx)(LC,{author:{label:u},...d?.turnId===e.id?{focus:d}:{},turn:e}),(0,H.jsx)(SW,{turn:e})]},e.id))}),o.length>n&&(0,H.jsxs)(G,{onClick:()=>r(n+yW),size:`sm`,type:`button`,variant:`outline`,children:[`Show more of `,o.length,` turns`]})]})]})})}function DW({row:e,client:t,runId:n,reference:r}){let i=e.rowKind===`span`?e.span.detail:void 0,a=i?.artifact_id??(r?.kind===`gate_log`?r.value:void 0);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Verification record`}),(0,H.jsx)(`dl`,{className:`facts`,children:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Result`}),(0,H.jsx)(`dd`,{children:i?.ok===void 0?e.status??`in progress`:i.ok?`passed`:`failed`})]})}),i?.output_tail&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Output`}),(0,H.jsx)(`pre`,{children:i.output_tail})]}),(0,H.jsx)(pW,{artifactId:a,client:t,heading:`Full log`,missing:`No readable log was recorded.`,noun:`log`,runId:n,unreadable:`No readable log was recorded.`}),(0,H.jsxs)(`p`,{className:`detail-note`,children:[`Verification `,e.status??`in progress`,`.`]})]})}function OW({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(pW,{artifactId:e,client:t,heading:`Worker report`,missing:`This settlement recorded no report.`,noun:`report`,runId:i,unreadable:`This run kept no readable copy of that report.`}),(0,H.jsx)(PW,{reference:n,row:r})]})}function kW({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(fW,{artifactId:e,client:t,runId:i}),(0,H.jsx)(PW,{reference:n,row:r})]})}function AW({node:e,reference:t}){let n=e.detail?.verification.checks??[],r=e.detail?.publication;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Publication`}),r?.pr_url&&(0,H.jsx)(FW,{fallback:``,reference:{kind:`pr`,value:r.pr_url}}),r?.merged&&r.commit_url?(0,H.jsx)(`p`,{className:`detail-link`,children:(0,H.jsxs)(`a`,{href:r.commit_url,rel:`noreferrer`,target:`_blank`,children:[`Merged commit `,r.commit?.slice(0,8),` `,(0,H.jsx)(Ft,{size:13})]})}):r?.branch_url?(0,H.jsx)(`p`,{className:`detail-link`,children:(0,H.jsxs)(`a`,{href:r.branch_url,rel:`noreferrer`,target:`_blank`,children:[`Branch `,r.branch,` `,(0,H.jsx)(Ft,{size:13})]})}):!r?.pr_url&&(0,H.jsx)(FW,{fallback:`No publication was recorded.`,reference:t}),(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Observed checks`}),n.length===0?(0,H.jsx)(`p`,{className:`detail-note`,children:`No checks were observed on this node.`}):(0,H.jsx)(`dl`,{className:`facts`,children:n.map(e=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:e.name}),(0,H.jsx)(`dd`,{children:e.url?(0,H.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.state}):e.state})]},e.name))})]})}function jW({redirection:e,row:t}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{className:`facts`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Delivery`}),(0,H.jsx)(`dd`,{children:e.delivered?`Live — into the turn that was already running`:`Deferred — onto the node's next dispatch`})]}),e.turn!==void 0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Turn`}),(0,H.jsx)(`dd`,{children:e.turn===`turn-end`?`Left to end — the note reached it as it ended`:`Interrupted — its replacement opened on the note`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Redirected at`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(N,{at:t.startedAt,relative:!0})})]}),e.member!==void 0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Member`}),(0,H.jsx)(`dd`,{children:e.member})]}),e.input_bytes!==void 0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Note`}),(0,H.jsxs)(`dd`,{children:[e.input_bytes,` bytes offered`]})]}),(0,H.jsx)(MW,{row:t})]}),e.reason!==void 0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Why it was not delivered`}),(0,H.jsx)(`p`,{className:`detail-note`,children:e.reason})]})]})}function MW({row:e}){let t=e.rowKind===`event`?z(e.event):void 0;return t===void 0?null:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Author`}),(0,H.jsx)(`dd`,{children:t})]})}function NW({surface:e,row:t}){let n=[[`Kind`,e.kind],[`Raised by`,e.source],[`Blocking`,e.blocking===void 0?void 0:e.blocking?`yes — dependents wait on the answer`:`no — nothing waits on it`]].filter(([,e])=>e!==void 0);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{className:`facts`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Recorded at`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(N,{at:t.startedAt,relative:!0})})]}),n.map(([e,t])=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:e}),(0,H.jsx)(`dd`,{children:t})]},e))]}),e.message!==void 0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Message`}),(0,H.jsx)(`p`,{className:`detail-note`,children:e.message})]})]})}function PW({row:e,reference:t}){if(e.rowKind===`event`)return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{className:`facts`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Recorded at`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(N,{at:e.startedAt,relative:!0})})]}),Object.entries(e.event.fields??{}).map(([e,t])=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:e}),(0,H.jsx)(`dd`,{children:typeof t==`string`?t:JSON.stringify(t)})]},e))]}),t!==void 0&&(0,H.jsx)(FW,{reference:t,fallback:`No recorded artifact.`})]});let n=e.rowKind===`group`?void 0:e,r=e.rowKind===`span`&&e.span.count!==void 0?`${e.span.count} records`:void 0,i=(e.rowKind===`span`?e.span.reasons:void 0)??[];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{className:`facts`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Recorded at`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(N,{at:e.startedAt,relative:!0})})]}),e.rowKind===`span`&&(e.endedAt!==null||e.status===`running`)&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Ended`}),(0,H.jsx)(`dd`,{children:e.endedAt===null?`Still running`:(0,H.jsx)(N,{at:e.endedAt,relative:!0})})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Status`}),(0,H.jsx)(`dd`,{children:e.status??`Not recorded`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Duration`}),(0,H.jsx)(`dd`,{children:e.durationMs===null?`Not recorded`:ue(e.durationMs)})]}),r!==void 0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Aggregated`}),(0,H.jsx)(`dd`,{children:r})]}),i.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Waiting on`}),(0,H.jsx)(`dd`,{children:i.map(te).join(` and `)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Step`}),(0,H.jsx)(`dd`,{children:HW(n)??`None`})]}),(0,H.jsx)(MW,{row:e})]}),(0,H.jsx)(`h3`,{className:`detail-heading`,children:`Reference`}),(0,H.jsx)(FW,{fallback:e.rowKind===`span`&&e.span.kind===`dispatch`?`No transcript was recorded for this dispatch.`:`This item points at no recorded artifact.`,reference:t})]})}function FW({reference:e,fallback:t}){return e===void 0?(0,H.jsx)(`p`,{className:`detail-note`,children:t}):e.value.startsWith(`http`)?(0,H.jsx)(`p`,{className:`detail-link`,children:(0,H.jsxs)(`a`,{href:e.value,rel:`noreferrer`,target:`_blank`,children:[e.value,` `,(0,H.jsx)(Ft,{size:13})]})}):(0,H.jsxs)(`p`,{className:`detail-note`,children:[(0,H.jsx)(`span`,{className:`detail-reference-kind`,children:e.kind}),(0,H.jsx)(`code`,{children:e.value})]})}function IW(e){if(e.rowKind!==`span`)return e.id;let t=e.span.events.at(-1);return[e.span.id,e.span.status??``,e.span.ended_at??``,e.span.events.length,t?.id??``,t?.at??``,t?.status??``].join(`|`)}function LW(e,t){return t.conversation===void 0?0:e?.rowKind===`event`?1:t.conversation.conversation.turns.length}function RW(e){return e.rowKind===`event`?e.event.redirection:void 0}function zW(e){return e.rowKind===`event`?e.event.release:void 0}function BW(e){return e.rowKind===`event`?e.event.surface:void 0}function VW(e){if(e.rowKind===`span`)return e.span.reference;if(e.rowKind===`event`)return e.event.reference}function HW(e){if(e?.rowKind===`span`)return e.span.step_id;if(e?.rowKind===`event`)return e.event.step_id}function UW(e){return e.kind===`verification`||e.kind.startsWith(`verification-`)}function WW(e,t){return t?.kind===`pr`||e.kind===`publication`||e.kind.startsWith(`pr-`)||e.kind.startsWith(`publication-`)}function GW(e,t){return _t(e,t)}var KW=500,qW=e.omit({events:!0});function JW(e,t){if(t===void 0)return e;let n=new Set(e.events.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length===0?e:{...e,events:[...e.events,...r].sort((e,t)=>Date.parse(e.at)-Date.parse(t.at)||(e.journal_order??0)-(t.journal_order??0))}}function YW(e){let t=e.flatMap(e=>{let t=e.events_total;if(t===void 0||t<=e.events.length)return[];let n=e.events[0],r=Date.parse(e.started_at),i=n===void 0?Date.parse(e.ended_at??e.started_at):Date.parse(n.at);return i>r?[[r,i]]:[]}).sort((e,t)=>e[0]-t[0]),n=[];for(let[e,r]of t){let t=n.at(-1);t!==void 0&&e<=t[1]?t[1]=Math.max(t[1],r):n.push([e,r])}return n}function XW({client:e,runId:t,scope:n,nodeId:r,filter:i,timeline:a}){let o=(0,V.useRef)(new Map),s=(0,V.useRef)(new Map),c=(0,V.useRef)(new Map),l=(0,V.useRef)(new Set),u=(0,V.useRef)(new Set),[d,f]=(0,V.useState)(0),[p,m]=(0,V.useState)(),[h,g]=(0,V.useState)(!1),_=(0,V.useRef)(!1),v=(0,V.useCallback)(()=>f(e=>e+1),[]),y=(0,V.useCallback)(e=>{for(let t of e.rows)o.current.set(t.id,t)},[]),b=(0,V.useCallback)((e,t)=>{m({message:e instanceof Error?e.message:String(e),retry:()=>{m(void 0),t()}}),v()},[v]),x=(0,V.useMemo)(()=>{if(a===void 0)return a;if(n===`node`)for(let e of a.spans)for(let t of e.events)o.current.has(t.id)||o.current.set(t.id,{...t,span_id:e.id});let e=new Map;for(let t of o.current.values()){let n=e.get(t.span_id);n===void 0?e.set(t.span_id,[t]):n.push(t)}return e.size===0&&s.current.size===0?a:{...a,spans:a.spans.map(t=>{let n=JW(t,e.get(t.id)),r=s.current.get(t.id);return r===void 0?n:{...r,...n,events:n.events}})}},[a,d,n]),S=r??``,C=(0,V.useMemo)(()=>n!==`node`||c.current.get(S)===null?[]:YW((x?.spans??[]).filter(e=>!u.current.has(e.id))),[x,n,S,d]),w=n===`node`&&c.current.has(S)?c.current.get(S)!==null:(a?.spans??[]).some(e=>e.events_total!==void 0&&e.events_total>e.events.length),T=n===`node`&&c.current.get(S)===null,E=(0,V.useCallback)(a=>{if(_.current||n!==`node`||r===void 0||c.current.get(S)===null)return;_.current=!0,g(!0);let o=c.current.get(S)??void 0;e.getTimelineEvents(t,{scope:n,node:r,...a===!0?{limit:KW}:{},...o===void 0?{}:{cursor:o},...i===void 0?{}:{filter:i}}).then(e=>{y(e),c.current.set(S,e.next_cursor),v()}).catch(e=>b(e,()=>E(a))).finally(()=>{_.current=!1,g(!1)})},[v,e,S,b,i,r,t,n,y]),D=(0,V.useCallback)(async(r,a)=>{try{let a;for(;;){let o=await e.getTimelineEvents(t,{scope:n,limit:KW,...r,...a===void 0?{}:{cursor:a},...i===void 0?{}:{filter:i}});y(o);let{span:c}=o;if(r.span!==void 0&&c!==void 0&&s.current.set(r.span,qW.parse(c)),o.next_cursor===null&&r.span!==void 0&&r.from===void 0&&r.to===void 0&&u.current.add(r.span),v(),o.next_cursor===null)return;a=o.next_cursor}}catch(e){b(e,a)}},[v,e,b,i,t,n,y]),O=(0,V.useCallback)(e=>{let t=`span:${e}`;l.current.has(t)||(l.current.add(t),D({span:e,...r===void 0?{}:{node:r}},()=>{l.current.delete(t),O(e)}))},[r,D]),k=(0,V.useCallback)(e=>{let t=`row:${e??``}`;l.current.has(t)||(l.current.add(t),D(e===void 0?{}:{node:e},()=>{l.current.delete(t),k(e)}))},[D]),A=(0,V.useCallback)((e,t,n)=>{let r=`stretch:${n??``}:${e}:${t}`;l.current.has(r)||(l.current.add(r),D({...n===void 0?{}:{node:n},from:new Date(e).toISOString(),to:new Date(t).toISOString()},()=>{l.current.delete(r),A(e,t,n)}))},[D]);return{...x===void 0?{}:{timeline:x},unheld:C,canLoadEarlier:w,readToStart:T,loadingEarlier:h,loadEarlier:E,loadSpan:O,loadRow:k,loadStretch:A,...p===void 0?{}:{failure:p}}}var ZW=`No earlier history remains`,QW=`This node is not on the run's graph, so the plan holds no task for it.`;function $W({client:e,runId:t,node:n,nodes:r,timeline:i,timelineError:a,filter:o,runLoaded:s=!0,onRetry:c,selectedItemId:l,onSelectItem:u,onBack:f,selectedTab:p,onSelectTab:m}){let g=(0,V.useMemo)(()=>d(i,n.id),[i,n.id]);(0,V.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(l===void 0?f():u())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[f,u,l]);let _=n.detail?.publication===void 0?n.result?.pr??void 0:n.detail.publication.pr_url;return(0,H.jsxs)(`section`,{"aria-label":`Timeline for ${n.label}`,className:`node-view`,children:[(0,H.jsxs)(`header`,{className:`node-view-head`,children:[(0,H.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,H.jsxs)(`ol`,{className:`breadcrumb`,children:[(0,H.jsx)(`li`,{children:(0,H.jsxs)(G,{onClick:f,size:`sm`,type:`button`,variant:`ghost`,children:[(0,H.jsx)(wt,{size:14}),` Graph`]})}),(0,H.jsx)(`li`,{"aria-current":`page`,children:(0,H.jsx)(`span`,{className:`breadcrumb-node`,children:n.label})})]})}),(0,H.jsxs)(`div`,{className:`node-view-facts`,children:[(0,H.jsx)(jH,{className:`node-view-state`,state:n.status}),(0,H.jsx)($U,{control:n.control}),(0,H.jsxs)(`span`,{className:`node-view-meta`,children:[ze(n),` node ·`,` `,s?`${n.telemetry?.turns??0} turns · ${n.telemetry?.lint??0} lint turns`:`turns ${De}`]}),_!==void 0&&(0,H.jsxs)(`a`,{className:`node-view-pr`,href:_,rel:`noreferrer`,target:`_blank`,children:[`Pull request `,(0,H.jsx)(Ft,{size:12})]})]})]}),(0,H.jsx)(pG,{node:n,nodes:r}),(0,H.jsx)(fG,{node:n}),(0,H.jsxs)(Rf,{className:`node-tabs`,onValueChange:e=>{eU(e)&&m(e)},value:p,children:[(0,H.jsx)(Bf,{"aria-label":`Node details`,variant:`line`,children:Object.entries($H).map(([e,t])=>(0,H.jsx)(Vf,{value:e,children:t},e))}),(0,H.jsxs)(Hf,{className:`node-tab-panel`,value:`task`,children:[n.task===void 0?(0,H.jsx)(`p`,{children:QW}):s?(0,H.jsx)($B,{source:lG(n.task)}):(0,H.jsx)(`p`,{className:`loading-value`,children:De}),(0,H.jsxs)(`dl`,{className:`facts`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Settled as`}),(0,H.jsx)(`dd`,{children:mG(n.result?.outcome)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Outcome`}),(0,H.jsx)(`dd`,{children:mG(n.result?.detail)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Graph overrides`}),(0,H.jsx)(`dd`,{children:s?(n.task?.sets??[]).length===0?`None`:(0,H.jsx)(`ol`,{"aria-label":`Graph overrides`,className:`sets-served`,children:n.task?.sets?.map((e,t)=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`code`,{children:e})},t))}):De})]})]})]}),(0,H.jsx)(Hf,{className:`node-tab-panel`,value:`criteria`,children:n.task===void 0?(0,H.jsx)(`p`,{children:QW}):s?(0,H.jsx)($B,{source:uG(n.task)}):(0,H.jsx)(`p`,{className:`loading-value`,children:De})}),(0,H.jsx)(Hf,{className:`node-tab-panel`,value:`dependencies`,children:(0,H.jsxs)(`dl`,{className:`facts`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Dependencies`}),(0,H.jsx)(`dd`,{children:(n.task?.deps??[]).map(e=>{let t=r.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `)||`None`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Unblocks`}),(0,H.jsx)(`dd`,{children:n.dependents.join(`, `)||`None`})]})]})}),(0,H.jsxs)(Hf,{className:`node-tab-panel`,value:`remote`,children:[!s&&(0,H.jsx)(`p`,{className:`loading-value`,children:`Loading…`}),(0,H.jsxs)(`dl`,{className:`facts`,hidden:!s,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Publication`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(dG,{node:n})})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Branch`}),(0,H.jsx)(`dd`,{children:n.detail?.publication?.branch??`Not recorded`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Merge`}),(0,H.jsx)(`dd`,{children:n.detail?.publication?n.detail.publication.merged?`Merged`:`Not merged`:`Not recorded`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Release`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(dW,{node:n})})]}),(0,H.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,H.jsx)(`dt`,{children:`Verification coverage`}),(0,H.jsxs)(`dd`,{children:[`Hook:`,` `,n.detail?.verification.pre_push_hook?`present`:`not recorded`,` · `,`Required checks:`,` `,n.detail?.verification.required_checks?.join(`, `)||`none configured`]})]}),(0,H.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,H.jsx)(`dt`,{children:`Observed checks`}),(0,H.jsx)(`dd`,{children:(n.detail?.verification.checks??[]).length===0?`No checks observed`:(0,H.jsxs)(`table`,{"aria-label":`Remote checks`,className:`remote-checks`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`Name`}),(0,H.jsx)(`th`,{children:`Status`}),(0,H.jsx)(`th`,{children:`Conclusion`}),(0,H.jsx)(`th`,{children:`Runtime`}),(0,H.jsx)(`th`,{children:`Required`})]})}),(0,H.jsx)(`tbody`,{children:n.detail?.verification.checks?.map(e=>(0,H.jsxs)(`tr`,{className:e.status===`completed`&&![`success`,`neutral`,`skipped`].includes(e.conclusion??``)?`check-failing`:void 0,children:[(0,H.jsx)(`th`,{scope:`row`,children:e.url?(0,H.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.name}):e.name}),(0,H.jsx)(`td`,{children:e.status??`Not recorded`}),(0,H.jsx)(`td`,{children:e.conclusion??`—`}),(0,H.jsx)(`td`,{children:(0,H.jsx)(ZU,{...e.started_at===void 0?{}:{startedAt:e.started_at},...e.completed_at===void 0?{}:{completedAt:e.completed_at}})}),(0,H.jsxs)(`td`,{title:e.requirement,className:e.required?`check-required`:`check-optional`,children:[(0,H.jsx)(`svg`,{role:`img`,"aria-label":e.required?`required`:`not required`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:e.required?(0,H.jsx)(`path`,{d:`M6 0.5 L11 2.5 V6 C11 9 8.5 11 6 11.5 C3.5 11 1 9 1 6 V2.5 Z`,fill:`currentColor`}):(0,H.jsx)(`circle`,{cx:`6`,cy:`6`,r:`4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`2 1.5`})}),e.required?`Required`:`Optional`]})]},e.name))})]})})]})]})]}),(0,H.jsx)(Hf,{className:`node-timeline-panel`,value:`timeline`,children:a===void 0?i===void 0?(0,H.jsx)(`div`,{"aria-live":`polite`,className:`loading-state`,children:`Loading the recorded timeline…`}):g.rows.length===0?(0,H.jsxs)(ea,{className:`m-5 items-center gap-2 p-8 text-muted-foreground`,children:[(0,H.jsx)(`p`,{className:`m-0`,children:`This node has no recorded timeline yet.`}),(0,H.jsx)(`p`,{className:`m-0 text-[11px]`,children:`Spans and events appear here as the run records them.`})]}):(0,H.jsx)(eG,{client:e,...o===void 0?{}:{filter:o},node:n,onSelectItem:u,runId:t,selectedItemId:l,timeline:i}):(0,H.jsxs)(ki,{className:`m-5 w-auto`,variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`Timeline unavailable`}),(0,H.jsxs)(ji,{children:[a.message,` `,c!==void 0&&(0,H.jsx)(G,{onClick:c,size:`sm`,variant:`outline`,children:`Try again`})]})]})})]})]})}function eG({client:e,filter:t,node:n,onSelectItem:i,runId:a,selectedItemId:o,timeline:s}){let c=XW({client:e,runId:a,scope:`node`,nodeId:n.id,timeline:s,...t===void 0?{}:{filter:t}}),u=c.timeline??s,d=(0,V.useMemo)(()=>l(u,n.id),[u,n.id]),[f,p]=(0,V.useState)(()=>new Set),m=(0,V.useMemo)(()=>{if(o!==void 0)return j(d.tree,o).find(e=>e.rowKind===`group`)?.id},[d.tree,o]),h=(0,V.useMemo)(()=>m===void 0?f:new Set([...f,m]),[f,m]),g=(0,V.useMemo)(()=>r(d.tree,h),[d.tree,h]),_=(0,V.useMemo)(()=>g.flatMap(e=>e.entryKind===`row`?[{id:e.row.id,time:Date.parse(e.row.startedAt)}]:[]),[g]),v=Gp(_),[y,b]=(0,V.useState)(!1),[x,S]=(0,V.useState)(),C=(0,V.useMemo)(()=>yt(d.items,d.lanes),[d.items,d.lanes]),w=(0,V.useMemo)(()=>ye(d.markers,d.items,o),[d.items,d.markers,o]),T=(0,V.useMemo)(()=>tG([...d.items,...d.markers.map(({at:e})=>({start:e}))]),[d.items,d.markers]),E=(0,V.useMemo)(()=>tG([...y?d.items:C,...w.map(({at:e})=>({start:e}))]),[y,d.items,C,w]),D=v.cursor===void 0?void 0:Math.min(Math.max(v.cursor,T[0]),T[1]),O=o===void 0?void 0:ht(d.rows,o),k=(0,V.useRef)(0),A=e=>{k.current=Date.now()+500,i(e),v.scrollTo(e)},M=(0,V.useRef)(A);M.current=A;let N=(0,V.useCallback)(e=>M.current(e),[]),P=(0,V.useRef)(null),{containerRef:F}=v,I=(0,V.useCallback)(e=>{P.current=e,F(e)},[F]),L=(0,V.useRef)(null),R=(0,V.useRef)(void 0),{loadEarlier:z,loadSpan:ee,loadStretch:te}=c,ne=(0,V.useRef)(void 0),re=()=>{R.current=aG(P.current),ne.current=_.length,z()},ie=()=>{c.canLoadEarlier&&!c.loadingEarlier&&c.failure===void 0&&re()};(0,V.useLayoutEffect)(()=>{let e=P.current,t=R.current;if(e===null||t===void 0||c.loadingEarlier)return;R.current=void 0;let n=!1;for(let[r,i]of aG(e)){let a=t.get(r);if(a===void 0)n=!0;else if(n){e.scrollTop+=i-a;return}}},[u,c.loadingEarlier]);let{canLoadEarlier:B,loadingEarlier:ae}=c,oe=_.length;(0,V.useEffect)(()=>{let e=ne.current;if(!(e===void 0||ae)){if(oe>e||!B||c.failure!==void 0){ne.current=void 0;return}R.current=aG(P.current),z(!0)}},[oe,B,ae,z,c.failure]),(0,V.useEffect)(()=>{o!==void 0&&O===void 0&&B&&!ae&&c.failure===void 0&&z()},[o,O,B,ae,z,c.failure]);let se=O?.rowKind===`span`?O.span.id:void 0;(0,V.useEffect)(()=>{se!==void 0&&ee(se)},[se,ee]),(0,V.useEffect)(()=>{if(x===void 0)return;let e=setTimeout(()=>te(x[0],x[1],n.id),250);return()=>clearTimeout(e)},[x,te,n.id]);let{scrollTo:ce}=v;return(0,V.useEffect)(()=>{o!==void 0&&(k.current=Date.now()+500,ce(o))},[o,ce]),(0,H.jsxs)(`div`,{className:`node-execution`,"data-expanded":y,children:[(0,H.jsxs)(`section`,{"aria-label":`Node timeline`,className:`node-timeline-sticky`,"data-testid":`node-timeline`,ref:L,children:[(0,H.jsx)(rW,{container:L,range:x??E,stretches:c.unheld}),(0,H.jsx)(_n,{...qU,axis:{origin:T[0]},cursor:D,expanded:y,getFailureExcerpt:e=>e.payload.rowKind===`span`?e.payload.span.detail?.output_tail:void 0,items:y?d.items:C,lanes:d.lanes,markers:w,onExpandedChange:b,onRangeChange:e=>S(e[0]<=E[0]&&e[1]>=E[1]?void 0:YU(e)),onSelect:e=>A(e.id),range:x??E,selectedId:o})]}),(0,H.jsxs)(`section`,{"aria-label":`Node transcript`,className:`node-transcript`,onKeyDown:e=>{rG.has(e.key)&&iG(e.currentTarget)&&ie()},onScroll:e=>{iG(e.currentTarget)&&Date.now()>k.current&&ie()},onWheel:e=>{e.deltaY<0&&iG(e.currentTarget)&&ie()},ref:I,children:[c.readToStart&&c.failure===void 0&&(0,H.jsx)(`p`,{className:`history-start`,role:`status`,children:ZW}),(c.canLoadEarlier||c.failure!==void 0)&&(0,H.jsx)(tW,{...c.failure===void 0?{}:{failure:c.failure},loading:c.loadingEarlier,onLoad:re}),Ie(g).map(e=>{let t=e.entries.map(e=>e.entryKind===`row`?(0,H.jsx)(cG,{onOpen:N,register:v.register,row:e.row,selected:e.row.id===o},e.row.id):(0,H.jsx)(oG,{entry:e,onToggle:()=>p(t=>{let n=new Set(t);return n.has(e.group.id)?n.delete(e.group.id):n.add(e.group.id),n})},`collapse-${e.group.id}`));return e.dispatch===void 0?(0,H.jsx)(V.Fragment,{children:t},e.id):(0,H.jsxs)(`section`,{"aria-label":e.dispatch.label,className:`transcript-dispatch`,children:[(0,H.jsx)(`h3`,{children:e.dispatch.label}),t]},e.id)})]}),O!==void 0&&(0,H.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,H.jsx)(G,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>i(),size:`icon`,variant:`ghost`,children:(0,H.jsx)(an,{})}),(0,H.jsx)(bW,{client:e,node:n,row:O,runId:a})]})]})}function tG(e){let t=e.map(({start:e})=>e),n=e.map(e=>e.end??e.start);if(t.length===0)return[0,1];let r=Math.min(...t),i=Math.max(...n);return[r,i>r?i:r+1]}var nG=120,rG=new Set([`ArrowUp`,`PageUp`,`Home`]);function iG(e){return e.scrollTop<nG}function aG(e){let t=new Map;for(let n of e?.querySelectorAll(`article.transcript-item[data-row-id]`)??[])t.set(n.dataset.rowId??``,n.getBoundingClientRect().top);return t}function oG({entry:e,onToggle:t}){let n=pt(e.hidden,e.group.kind);return(0,H.jsx)(`p`,{className:`transcript-collapsed`,children:(0,H.jsxs)(`button`,{"aria-expanded":e.expanded,onClick:t,type:`button`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`…`}),e.expanded?`Collapse ${n}`:`Show ${n}`]})})}function sG(e,t){let[n,r]=[e.row,t.row];return e.selected===t.selected&&e.register===t.register&&e.onOpen===t.onOpen&&n.id===r.id&&n.rowKind===r.rowKind&&n.displayLabel===r.displayLabel&&n.displayKind===r.displayKind&&n.startedAt===r.startedAt&&n.durationMs===r.durationMs&&n.status===r.status&&n.sessionName===r.sessionName&&n.dispatch?.label===r.dispatch?.label&&(n.rowKind===`event`&&r.rowKind===`event`?n.category===r.category&&n.event.seq===r.event.seq:n.rowKind!==`event`&&r.rowKind!==`event`)}var cG=(0,V.memo)(function({row:e,selected:t,register:n,onOpen:r}){let{id:i}=e,a=(0,V.useCallback)(e=>n(i,e),[n,i]);return(0,H.jsx)(`article`,{"aria-label":e.displayLabel,className:`transcript-item`,"data-dispatch-group":e.dispatch?.label,"data-journal-seq":e.rowKind===`event`?e.event.seq:void 0,"data-row-id":e.id,"data-selected":t,ref:a,children:(0,H.jsxs)(`button`,{"aria-label":`Open ${e.displayLabel}`,onClick:()=>r(e.id),type:`button`,children:[(0,H.jsxs)(`span`,{className:`eyebrow`,children:[e.rowKind===`event`&&(0,H.jsx)(_,{category:e.category}),e.displayKind]}),(0,H.jsx)(`strong`,{children:e.displayLabel}),(0,H.jsxs)(`span`,{className:`transcript-facts`,children:[(0,H.jsx)(N,{at:e.startedAt}),e.durationMs!==null&&` · ${ue(e.durationMs)}`,` · ${e.status??`recorded`}`,e.sessionName!==void 0&&` · ${e.sessionName}`]})]})})},sG);function lG(e){if(e.task!==void 0)return e.task;let t=e.steps??[];return t.length===0?`No task prose recorded.`:t.map(e=>`## ${e.id}\n\n${e.task}`).join(`
86
+
87
+ `)}function uG(e){let t=lG(e),n=/(?:^|\n)##[ \t]*acceptance[ \t]+criteria[ \t]*\r?\n([\s\S]*?)(?=\r?\n##[ \t]|$)/i.exec(t)?.[1]?.trim();return n===void 0||n.length===0?`No acceptance criteria recorded in this node's task.`:n}function dG({node:e}){let t=e.detail?.publication;if(t===void 0)return typeof e.result?.pr==`string`&&e.result.pr?(0,H.jsxs)(`a`,{className:`node-view-pr`,href:e.result.pr,rel:`noreferrer`,target:`_blank`,children:[`Pull request `,(0,H.jsx)(Ft,{size:12})]}):(0,H.jsx)(H.Fragment,{children:`Not recorded`});let n=(t.merged?[[t.pr_url,`Pull request`],[t.commit_url,`Commit ${t.commit?.slice(0,8)??``}`]]:[[t.pr_url,`Pull request`],[t.branch_url,t.branch??`Branch`]]).filter(([e])=>e);return n.length===0?(0,H.jsx)(H.Fragment,{children:`Not recorded`}):(0,H.jsx)(H.Fragment,{children:n.map(([e,t],n)=>(0,H.jsxs)(`span`,{children:[n>0&&` · `,(0,H.jsxs)(`a`,{className:`node-view-pr`,href:e,rel:`noreferrer`,target:`_blank`,children:[t,` `,(0,H.jsx)(Ft,{size:12})]})]},e))})}function fG({node:e}){let t=We(e);if(t.length===0)return null;let n=e.result?.detail?.trim()||void 0;return(0,H.jsxs)(`section`,{"aria-label":`Awaited releases`,className:`node-awaiting m-5 rounded-lg border border-warning bg-warning-surface px-4 py-3 text-warning`,children:[(0,H.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,H.jsx)(Gt,{size:16}),e.status===`complete-but-held`?`Complete, and held unlanded until its releases arrive`:`Complete, and held as a draft until its releases arrive`]}),(0,H.jsxs)(`dl`,{className:`facts facts-stacked`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:t.length===1?`Awaits`:`Awaits ${t.length}`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`ul`,{className:`awaited-releases`,children:t.map(e=>(0,H.jsxs)(`li`,{children:[`the `,(0,H.jsx)(`strong`,{children:e.target}),` release of`,` `,(0,H.jsx)(`code`,{children:e.producer})]},`${e.producer} ${e.target}`))})})]}),n!==void 0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Detail`}),(0,H.jsx)(`dd`,{children:n})]})]})]})}function pG({node:e,nodes:t}){if(!qe(e.status))return null;let n=e.status===`blocked`||e.status===`skipped`,r=Xe(e),i=e.result?.error||void 0,a=e.result?.exit_code;return(0,H.jsxs)(ki,{className:B(`m-5 w-auto`,n&&`border-warning bg-warning-surface text-warning`),variant:n?`default`:`destructive`,children:[n?(0,H.jsx)(Gt,{}):(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:n?`This node is ${e.status}`:`This node ${e.status===`cancelled`?`was cancelled`:e.status===`not-completed`?`did not complete`:`failed`}${e.failure?`: ${e.failure.class}`:``}`}),(0,H.jsx)(ji,{children:(0,H.jsxs)(`dl`,{className:`facts`,children:[n&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:e.status===`skipped`?`Unmet`:`Blocked by`}),(0,H.jsx)(`dd`,{children:e.blockers.length>0?e.blockers.map(e=>{let n=t.find(t=>t.id===e)?.status;return n===void 0?e:`${e} (${n})`}).join(`, `):`Nothing recorded; the run has not written what holds it.`})]}),e.status===`skipped`&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Attempts`}),(0,H.jsx)(`dd`,{children:`Never attempted`})]}),!n&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Detail`}),(0,H.jsx)(`dd`,{children:r??`No reason was recorded for this outcome.`})]}),i!==void 0&&i!==r&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Error`}),(0,H.jsx)(`dd`,{children:i})]}),typeof a==`number`&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Exit code`}),(0,H.jsx)(`dd`,{children:a})]})]})})]})}function mG(e){return e==null||e===``?`Not recorded`:typeof e==`string`?e:JSON.stringify(e,null,2)}function hG(e){let[t,n]=(0,V.useState)(!1);return{open:t,onToggle:(0,V.useCallback)(t=>{let r=t.currentTarget.open;n(r),r&&e?.()},[e])}}function gG({label:e,className:t,onOpen:n,children:r}){let i=hG(n);return(0,H.jsxs)(`details`,{"aria-label":e,className:t,open:i.open,onToggle:i.onToggle,children:[(0,H.jsx)(`summary`,{children:e}),i.open&&r]})}function _G({client:e,detail:t,nodes:n,timeline:r,timelineError:i,filter:a,onRetry:o,journalSeq:c,onSelectNode:l,selectedItemId:u,onSelectItem:d}){let f=t.run.run_id,p=XW({client:e,runId:f,scope:`run`,...a===void 0?{}:{filter:a},...r===void 0?{}:{timeline:r}}),m=p.timeline,g=Ue(t.progress),_=!g||je(t,`telemetry`)||je(t,`run.timing`)||je(t,`run.usage`),v=ke(t),y=(0,V.useMemo)(()=>me(m,n),[m,n]),b=(m?.spans??[]).filter(e=>e.node_id===void 0),x=b.find(e=>e.id===u),S=b.flatMap(e=>e.events).find(e=>(e.record_id??e.id)===u)??b.flatMap(e=>e.events).find(e=>e.id===u),C=x===void 0?S===void 0?void 0:s(S):Re(x),{loadSpan:w,loadRow:T}=p;(0,V.useEffect)(()=>{u!==void 0&&C===void 0&&m!==void 0&&T(void 0)},[u,C,m,T]);let E=x?.id;return(0,V.useEffect)(()=>{E!==void 0&&w(E)},[E,w]),(0,V.useEffect)(()=>{let e=e=>{e.key===`Escape`&&u!==void 0&&d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,u]),(0,H.jsxs)(`div`,{className:`overall-view`,"data-journal-seq":c,children:[(0,H.jsx)(wd,{className:`h-full`,children:(0,H.jsxs)(`div`,{className:`p-[34px] max-sm:p-3`,children:[(0,H.jsxs)(`section`,{className:`overall-hero`,children:[(0,H.jsx)(`p`,{className:`eyebrow`,children:`Whole DAG`}),(0,H.jsx)(`h2`,{children:f}),t.graph?.plan.goal?.text&&(0,H.jsx)(`p`,{className:`run-goal`,children:t.graph.plan.goal.text}),(0,H.jsxs)(`p`,{children:[t.run.phase,` ·`,` `,t.run.last_event?`last event ${t.run.last_event}`:`no events recorded yet`]})]}),(0,H.jsxs)(`section`,{"aria-label":`Run records`,children:[(0,H.jsx)(gG,{label:`Timing and usage`,children:_?(0,H.jsx)(`p`,{className:`loading-value`,children:De}):(0,H.jsxs)(H.Fragment,{children:[v!==void 0&&(0,H.jsxs)(`p`,{className:`loading-value`,children:[`as of `,(0,H.jsx)(N,{at:v}),`, updating`]}),(0,H.jsx)(CL,{value:t.telemetry})]})}),(0,H.jsx)(gG,{label:`Goal and repository identities`,children:(0,H.jsx)(CL,{value:{goal:t.graph?.plan.goal,repositories:[...new Set(t.graph?.plan.tasks.flatMap(e=>e.repo?[e.repo]:[])??[])]}})}),(0,H.jsx)(gG,{label:`Recorded results`,children:(0,H.jsx)(CL,{value:t.graph?.result})}),(0,H.jsx)(gG,{label:`Provider health`,children:g?(0,H.jsx)(CL,{value:t.provider_health}):(0,H.jsx)(`p`,{className:`loading-value`,children:De})})]}),(0,H.jsxs)(`section`,{"aria-label":`Run metrics`,className:`metric-grid`,children:[(0,H.jsx)(bG,{icon:(0,H.jsx)(St,{}),label:`Status`,value:t.run.state}),(0,H.jsx)(bG,{icon:(0,H.jsx)(Lt,{}),label:`Nodes`,value:String(t.run.nodes.length)}),(0,H.jsx)(bG,{icon:(0,H.jsx)(Nt,{}),label:`Wall time`,value:t.run.timing.wall_seconds===null?`not measured`:ce(t.run.timing.wall_seconds)}),(0,H.jsx)(bG,{icon:(0,H.jsx)(Pt,{}),label:`Turns`,value:typeof t.run.turns==`number`?String(t.run.turns):De})]}),(0,H.jsx)(ea,{className:`gap-0 py-[15px]`,children:(0,H.jsxs)(ta,{className:`px-[15px]`,children:[(0,H.jsxs)(`div`,{className:`section-heading`,children:[(0,H.jsx)(St,{size:16}),(0,H.jsx)(`h3`,{children:`Graph timeline`})]}),i===void 0?m===void 0?(0,H.jsx)(`p`,{"aria-live":`polite`,className:`m-0 text-[11px] text-muted-foreground`,children:`Loading the run's timeline…`}):m.spans.length===0?(0,H.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`This run has recorded no timeline yet.`}):(0,H.jsx)(vG,{failureShown:C===void 0,graph:y,history:p,runRecordsToLoad:b.some(e=>e.events_total===void 0||e.events_total>e.events.length),onOpenNode:l,onOpenItem:d,selectedItemId:u}):(0,H.jsxs)(ki,{className:`live-issue`,variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`Timeline unavailable`}),(0,H.jsxs)(ji,{children:[i.message,` `,o!==void 0&&(0,H.jsx)(G,{onClick:o,size:`sm`,variant:`outline`,children:`Try again`})]})]})]})})]})}),C!==void 0&&(0,H.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,H.jsx)(G,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>d(),size:`icon`,variant:`ghost`,children:(0,H.jsx)(an,{})}),(0,H.jsx)(bW,{client:e,row:C,runId:f}),p.failure!==void 0&&(0,H.jsx)(eW,{failure:p.failure})]})]})}function vG({failureShown:e,graph:t,history:n,runRecordsToLoad:r,onOpenNode:i,onOpenItem:a,selectedItemId:o}){let[s,c]=(0,V.useState)(),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(new Set),p=s??t.range,[m,h]=(0,V.useState)(!1),{loadRow:g,loadStretch:_}=n;(0,V.useEffect)(()=>{if(s===void 0)return;let e=setTimeout(()=>_(s[0],s[1],void 0),250);return()=>clearTimeout(e)},[s,_]);let v=e=>{e.kind===`record`&&e.nodeId===void 0||e.nodeId===void 0?a(e.id):i(e.nodeId)},y=t.line.lanes.filter(({id:e})=>t.line.items.some(t=>t.laneId===e));return(0,H.jsxs)(`div`,{className:`graph-timeline`,"data-rows-open":l,children:[(0,H.jsx)(_n,{...qU,axis:{origin:t.range[0]},expanded:!1,items:t.line.items,label:`Graph timeline`,lanes:y,markers:t.line.markers,onExpandedChange:u,onRangeChange:e=>c(YU(e)),onSelect:e=>v(e.payload),range:p,selectedId:o}),t.line.markers.some(e=>e.at>t.range[1])&&(0,H.jsxs)(`section`,{"aria-label":`Records after execution`,className:`p-3 border-t`,children:[(0,H.jsx)(`h3`,{className:`eyebrow`,children:`After execution ended`}),t.line.markers.filter(e=>e.at>t.range[1]).map(e=>(0,H.jsxs)(G,{onClick:()=>v(e.payload),variant:`outline`,size:`sm`,children:[e.payload.label,` ·`,` `,(0,H.jsx)(N,{at:e.payload.startedAt})]},e.id))]}),e&&n.failure!==void 0&&(0,H.jsx)(eW,{failure:n.failure}),r&&!m&&(0,H.jsx)(`button`,{className:`load-earlier`,onClick:()=>{h(!0),g(void 0)},type:`button`,children:`Load the run's own records`}),l&&(0,H.jsx)(`ol`,{className:`graph-rows`,children:t.rows.map(e=>(0,H.jsx)(yG,{onOpen:v,onOpenNode:i,onExpandedChange:t=>{t&&g(e.nodeId),f(n=>{let r=new Set(n);return t?r.add(e.id):r.delete(e.id),r})},expanded:d.has(e.id),origin:t.range[0],range:p,onRangeChange:e=>c(YU(e)),row:e,selectedItemId:o},e.id))})]})}function yG({row:e,range:t,origin:n,expanded:r,onExpandedChange:i,onRangeChange:a,onOpen:o,onOpenNode:s,selectedItemId:c}){let l=e.nodeId;return(0,H.jsxs)(`li`,{className:`graph-row`,"data-row-kind":e.kind,children:[(0,H.jsxs)(`header`,{className:`graph-row-head`,children:[l===void 0?(0,H.jsx)(`span`,{className:`graph-row-name`,children:e.label}):(0,H.jsx)(`button`,{className:`graph-row-name`,onClick:()=>s(l),type:`button`,children:e.label}),(0,H.jsxs)(`span`,{className:`graph-row-facts`,children:[ue(e.workedMs),` recorded · `,ue(e.idleMs),` `,`idle`]})]}),(0,H.jsx)(_n,{...qU,axis:{origin:n},expanded:r,items:r?e.items:e.line,label:`${e.label} timeline`,lanes:e.lanes,markers:e.markers,onExpandedChange:i,onRangeChange:a,onSelect:e=>o(e.payload),range:t,selectedId:c})]})}function bG({icon:e,label:t,value:n}){return(0,H.jsxs)(ea,{"aria-label":t,className:`metric flex-row items-center gap-3 p-4`,role:`group`,children:[e,(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{children:t}),(0,H.jsx)(`strong`,{children:n})]})]})}var xG=6,SG=8,CG=`[aria-describedby^="timeline-detail-"]`,wG=e=>{if(!(e instanceof Element))return;let t=k(e);if(t!==void 0)return t;let n=e.closest(CG);if(!(n instanceof HTMLElement))return;let r=document.getElementById(n.getAttribute(`aria-describedby`)??``)?.textContent?.trim();return r?{element:n,detail:r}:void 0},TG=(e,t)=>t!==void 0&&e?.element===t.element&&e.detail===t.detail?e:t;function EG(){let e=(0,V.useRef)(null),[t,n]=(0,V.useState)(),[r,i]=(0,V.useState)(),a=t??r,o=(0,V.useCallback)(()=>{n(void 0),i(void 0)},[]);(0,V.useEffect)(()=>{let e=e=>n(t=>TG(t,wG(e.target))),t=e=>i(t=>TG(t,wG(e.target))),r=e=>i(t=>TG(t,wG(e.relatedTarget))),a=()=>n(void 0);return document.addEventListener(`pointerover`,e),document.addEventListener(`pointerleave`,a),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,r),()=>{document.removeEventListener(`pointerover`,e),document.removeEventListener(`pointerleave`,a),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,r)}},[]);let s=(0,V.useCallback)(()=>{let t=e.current;if(t===null||a===void 0)return;if(!a.element.isConnected)return o();let n=a.element.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth-r.width-SG,s=Math.min(Math.max(n.left,SG),Math.max(SG,i)),c=n.bottom+xG,l=n.top-r.height-xG,u=Math.max(SG,window.innerHeight-r.height-SG),d=c+r.height<=window.innerHeight-SG?c:l,f=Math.min(Math.max(d,SG),u);t.style.left=`${Math.round(s)}px`,t.style.top=`${Math.round(f)}px`,t.style.visibility=`visible`},[a,o]);return(0,V.useLayoutEffect)(s,[s]),(0,V.useEffect)(()=>{if(a!==void 0)return window.addEventListener(`scroll`,s,!0),window.addEventListener(`resize`,s),()=>{window.removeEventListener(`scroll`,s,!0),window.removeEventListener(`resize`,s)}},[a,s]),a===void 0?null:(0,rr.createPortal)((0,H.jsx)(`div`,{"aria-hidden":`true`,className:`timeline-popover`,"data-testid":`timeline-popover`,ref:e,style:{visibility:`hidden`},children:a.detail},a.detail),document.body)}var DG=[{setting:`live`,label:`Live`},{setting:10,label:`Every 10 seconds`},{setting:30,label:`Every 30 seconds`},{setting:60,label:`Every minute`},{setting:300,label:`Every 5 minutes`},{setting:`off`,label:`Off`}],OG=`live`,kG={navigation:`dag-ui.updates.navigation`,main:`dag-ui.updates.main`};function AG(e){return DG.find(({setting:t})=>String(t)===e)?.setting}function jG(e){try{return window.localStorage.getItem(e)}catch{return null}}function MG(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function NG(e,t){let[n,r]=(0,V.useState)(()=>AG(jG(e))??t);return[n,(0,V.useCallback)(t=>{r(t),MG(e,t)},[e])]}function PG(){let[e,t]=NG(kG.navigation,30),[n,r]=NG(kG.main,OG);return{navigation:e,setNavigation:t,main:n,setMain:r}}function FG({name:e,caption:t,setting:n,waiting:r,onChange:i}){return(0,H.jsxs)(`div`,{className:`update-setting`,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:t}),(0,H.jsx)(`select`,{"aria-label":e,onChange:e=>{let t=AG(e.target.value);t!==void 0&&i(t)},value:String(n),children:DG.map(({setting:e,label:t})=>(0,H.jsx)(`option`,{value:String(e),children:t},e))})]}),r>0&&(0,H.jsxs)(`output`,{"aria-label":`${e} waiting`,className:`update-waiting`,children:[r,` waiting`]})]})}var IG=new nw(window.location.origin,{fetch:window.fetch.bind(window)}),LG=Object.entries(ZH);function RG(e){let t=(0,V.useRef)({value:e,count:0});return t.current.value!==e&&(t.current={value:e,count:t.current.count+1}),t.current.count}var zG=()=>Promise.resolve();function BG({client:e=IG,first:t,onDrawn:n}){let r=nU(),i=KH(),a=r.host||i.active,o=cH(i.active),s=ZH[r.detail].profile,c=PG(),l=mU(),u=gU(e,{runId:r.runId,view:st(r.view,r.nodeId),nodeId:r.nodeId,filter:s,selectFirst:!a,host:a,humanItems:o.view,navigationUpdates:c.navigation,mainUpdates:c.main,...t===void 0?{}:{first:t}}),d=u.rows,f=u.runId,p=u.activity.at(-1),m=u.detail,g=(0,V.useMemo)(()=>m?Ce(m):[],[m]),_=Ww(e,f),v=RU(e),[y,b]=(0,V.useState)(0),x=v.host.state.phase===`sending`,S=RG(d),{list:C,error:w}=OL(e,r.host||x,y+(x?S:0)),T=m===void 0?void 0:Me(m),E=Ue(m?.progress),D=m?.progress?.failed??u.timeline?.progress?.failed,O=!a&&(m?.progress?.complete===!1||u.timeline?.progress?.complete===!1),k=!a&&m===void 0&&u.error!==void 0,A=(0,V.useRef)(!1);(0,V.useLayoutEffect)(()=>{A.current||(m!==void 0||u.error!==void 0)&&(A.current=!0,n?.())},[m,u.error,n]);let j=Ee(m,g,r.nodeId);return(0,V.useEffect)(()=>{if(a||!d)return;let e=oU(d),t=e.find(e=>e.rows.some(e=>e.id===r.runId)),n=t?.rows.find(e=>e.id===r.runId),i=(t?.rows??e.flatMap(e=>e.rows)).filter(e=>!e.kind||!r.hiddenKinds.includes(e.kind));(!r.runId||n?.kind&&r.hiddenKinds.includes(n.kind))&&i[0]&&r.selectRun(i[0].id)},[d,r,a]),(0,V.useEffect)(()=>{if(f&&r.runId&&r.runId!==f){let e=new URLSearchParams(window.location.search);e.set(`run`,f),e.delete(`node`),e.delete(`event`),e.set(`view`,r.view),window.history.replaceState(null,``,`${window.location.pathname}?${e}`),window.dispatchEvent(new PopStateEvent(`popstate`))}},[r.runId,f,r.view]),(0,H.jsxs)(kp,{children:[(0,H.jsx)(EG,{}),(0,H.jsxs)(`div`,{className:`app-shell`,children:[(0,H.jsx)(pU,{rows:u.navigationRows,failed:u.rows===void 0&&u.error!==void 0,selectedRunId:f,onSelect:e=>{r.selectRun(e),l.close()},onOpenProject:r.selectRun,onHost:()=>{r.selectHost(),l.close()},hostCurrent:r.host&&!i.active,onActionItems:()=>{i.open(),l.close()},actionItemsCurrent:i.active,hiddenKinds:r.hiddenKinds,onKindsChange:r.selectKinds,drawerOpen:l.open,drawerRef:l.drawer,updates:(0,H.jsx)(FG,{caption:`Navigation`,name:`Navigation updates`,onChange:c.setNavigation,setting:c.navigation,waiting:u.navigationWaiting})}),l.open&&(0,H.jsx)(`button`,{"aria-label":`Close navigation`,className:`nav-scrim`,onClick:l.close,type:`button`}),(0,H.jsxs)(`main`,{className:`workspace`,inert:l.open,children:[(0,H.jsxs)(`section`,{"aria-label":f&&!a?`Run header`:`Workspace header`,className:`topbar${f&&!a?` run-topbar`:``}`,children:[(0,H.jsx)(`button`,{"aria-controls":`run-navigation`,"aria-expanded":l.open,"aria-label":`Open navigation`,className:`nav-menu`,onClick:l.toggle,ref:l.menuButton,type:`button`,children:(0,H.jsx)(Vt,{"aria-hidden":`true`,size:18})}),(0,H.jsx)(`div`,{className:`topbar-title`,children:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`eyebrow`,children:`Execution telemetry`}),(0,H.jsx)(`h2`,{children:i.active?`Action items`:r.host?`Host`:f??`No DAG selected`})]})}),(0,H.jsxs)(`div`,{className:`topbar-actions`,children:[!a&&f!==void 0&&(0,H.jsx)(Bw,{control:_,runId:f,ended:m!==void 0&&(m.run.state===`settled`||m.run.state.startsWith(`ended-`))}),(0,H.jsxs)(`span`,{className:`connection`,children:[(0,H.jsx)(Zt,{size:15}),u.lastUpdated===void 0?`Waiting for first update`:(0,H.jsxs)(H.Fragment,{children:[`Last updated`,` `,(0,H.jsx)(N,{at:u.lastUpdated,relative:!0})]})]}),!a&&p!==void 0&&(0,H.jsxs)(`button`,{className:`last-activity connection`,type:`button`,title:`${p.node}: ${VG(p)}`,onClick:()=>{r.selectNode(p.node),r.selectItem(p.event_id)},children:[p.node,`: `,VG(p)]})]}),(0,H.jsxs)(`div`,{className:`main-updates`,children:[(0,H.jsx)(FG,{caption:`Updates`,name:`Main area updates`,onChange:c.setMain,setting:c.main,waiting:u.mainWaiting}),(0,H.jsxs)(G,{onClick:()=>{b(e=>e+1),u.refresh()},size:`sm`,type:`button`,variant:`outline`,children:[(0,H.jsx)(Yt,{size:14}),` Refresh`]})]})]}),!a&&m&&(0,H.jsxs)(gG,{label:`Run details`,className:`run-header-details`,onOpen:_.reread,children:[(0,H.jsxs)(`p`,{children:[`Launching session:`,` `,E?rt(m.launch):`Loading…`]}),_.status.error&&(0,H.jsxs)(`p`,{role:`alert`,children:[`Status unavailable: `,_.status.error.message]}),_.status.value&&(0,H.jsxs)(`dl`,{children:[(0,H.jsx)(`dt`,{children:`Summary`}),(0,H.jsx)(`dd`,{children:_.status.value.summary}),(0,H.jsx)(`dt`,{children:`Graph state`}),(0,H.jsx)(`dd`,{children:he(_.status.value.node_status)}),(0,H.jsx)(`dt`,{children:`Unread surfaces`}),(0,H.jsx)(`dd`,{children:_.status.value.unread_surfaces.count}),(0,H.jsx)(`dt`,{children:`Oldest unread (seconds)`}),(0,H.jsx)(`dd`,{children:_.status.value.unread_surfaces.oldest_seconds??`None`}),(0,H.jsx)(`dt`,{children:`Last progress`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`output`,{"aria-label":`Last progress`,children:E?m.run.last_progress_at===void 0?`Not recorded`:(0,H.jsx)(N,{at:new Date(m.run.last_progress_at*1e3).toISOString(),relative:!0}):`Loading…`})})]}),_.status.value&&(0,H.jsx)(`section`,{"aria-label":`Node statuses`,children:(0,H.jsx)(CL,{value:_.status.value.node_status})})]}),u.error&&!k&&(0,H.jsxs)(ki,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`Live telemetry issue`}),(0,H.jsxs)(ji,{children:[u.error.message,` `,(0,H.jsx)(G,{onClick:u.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),D!==void 0&&(0,H.jsxs)(ki,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,H.jsx)(h,{}),(0,H.jsx)(Ai,{children:`The rest of this run's history did not load`}),(0,H.jsxs)(ji,{children:[D,` `,(0,H.jsx)(G,{onClick:u.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),u.notice&&(0,H.jsx)(`p`,{className:`live-notice`,role:`status`,children:u.notice}),(0,H.jsx)(HU,{label:`Shutdown of the entire host`,onDismiss:v.host.dismiss,rows:C?.runs??[],state:v.host.state}),i.active?(0,H.jsx)(hH,{client:e,live:u.humanItems,choice:o.choice,setChoice:o.setChoice,selectedId:o.selectedId,setSelectedId:o.setSelectedId}):r.host?(0,H.jsx)(DL,{client:e,listError:w,onRefresh:()=>b(e=>e+1),list:C,rows:u.hostRows,children:(0,H.jsx)(zU,{list:C,loadMore:zG,loadingMore:!1,shutdowns:v})}):(0,H.jsxs)(Rf,{className:`min-h-0 flex-1 gap-0`,onValueChange:e=>e===`overall`?r.showOverall():e===`graph`?r.selectNode(void 0):JH(e)?r.selectView(e):void 0,value:r.view,children:[(0,H.jsxs)(`div`,{className:`view-tabs`,children:[(0,H.jsxs)(Bf,{"aria-label":`DAG views`,variant:`line`,children:[(0,H.jsxs)(Vf,{value:`graph`,children:[(0,H.jsx)(rn,{size:15}),` Graph`]}),(0,H.jsxs)(Vf,{value:`overall`,children:[(0,H.jsx)(Xt,{size:15}),` Overall`]}),(0,H.jsxs)(Vf,{value:`channel`,children:[(0,H.jsx)(It,{size:15}),` Channel`]})]}),(0,H.jsxs)(`fieldset`,{className:`detail-switch`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Level of detail`}),LG.map(([e,{label:t,description:n}])=>(0,H.jsx)(G,{"aria-pressed":r.detail===e,onClick:()=>r.selectDetail(e),size:`sm`,title:n,type:`button`,variant:r.detail===e?`default`:`outline`,children:t},e))]})]}),(0,H.jsx)(Hf,{className:`min-h-0`,value:r.view,children:k&&u.error?(0,H.jsx)(`div`,{className:`loading-state`,children:(0,H.jsxs)(`div`,{className:`read-failed`,role:`alert`,children:[(0,H.jsx)(`strong`,{children:`This run's history did not load`}),(0,H.jsx)(`p`,{children:u.error.message}),(0,H.jsx)(`button`,{onClick:u.refresh,type:`button`,children:`Try again`})]})}):!m&&(u.loading||f!==void 0)?(0,H.jsxs)(`div`,{"aria-live":`polite`,className:`loading-state`,children:[(0,H.jsx)(Rd,{className:`h-2 w-48`}),(0,H.jsx)(Rd,{className:`h-2 w-32`}),`Loading execution history…`]}):m&&f?r.view===`channel`?(0,H.jsx)(Ew,{channel:u.channel,client:e,decisions:T?.decisions,filter:s,journalSeq:T?.last_seq,observedAt:m.observed_at,overrides:T&&E?et(T):void 0,runId:f}):r.view===`overall`?(0,H.jsx)(_G,{client:e,detail:m,filter:s,journalSeq:T?.last_seq,nodes:g,onRetry:u.refresh,timeline:u.timeline,timelineError:u.timelineError,onSelectNode:r.selectNode,onSelectItem:r.selectItem,selectedItemId:r.itemId},`${f}:${s??``}`):j?(0,H.jsx)($W,{client:e,filter:s,runLoaded:E,onRetry:u.refresh,node:j,nodes:g,onBack:()=>r.selectNode(void 0),onSelectItem:r.selectItem,runId:f,selectedItemId:r.itemId,selectedTab:r.nodeTab,onSelectTab:r.selectNodeTab,timeline:u.timeline,timelineError:u.timelineError},`${f}:${j.id}:${s??``}`):(0,H.jsx)(SL,{journalSeq:T?.last_seq,nodes:g,selectedNodeId:r.nodeId,onSelectNode:r.selectNode}):(0,H.jsxs)(`div`,{className:`empty-state`,children:[(0,H.jsx)(rn,{size:34}),(0,H.jsx)(`h2`,{children:`No DAG runs found`}),(0,H.jsx)(`p`,{children:`Start an orchestrated run to see it appear here.`})]})})]})]}),O&&D===void 0&&(0,H.jsx)(`p`,{className:`history-loading`,role:`status`,children:`The rest of this run's history is still loading`})]})]})}function VG(e){return e.description||e.kind}var HG=class extends V.Component{state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`DAG UI render failed`,e,t.componentStack)}render(){return this.state.error?(0,H.jsxs)(`main`,{className:`fatal-error`,role:`alert`,children:[(0,H.jsx)(`p`,{className:`eyebrow`,children:`Rendering error`}),(0,H.jsx)(`h1`,{children:`The DAG view could not be displayed.`}),(0,H.jsx)(`p`,{children:this.state.error.message}),(0,H.jsx)(G,{onClick:()=>(this.props.onReload??(()=>window.location.reload()))(),type:`button`,variant:`secondary`,children:`Reload`})]}):this.props.children}};function UG(e,t,n){let r=n===void 0?e:document.createElement(`div`);r!==e&&(r.setAttribute(`data-app-behind-first-screen`,``),r.style.cssText=`position:fixed;inset:0;visibility:hidden;`,document.body.appendChild(r)),(0,RC.createRoot)(r).render((0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(HG,{children:(0,H.jsx)(BG,{first:t,onDrawn:()=>{r!==e&&(n?.unmount(),e.replaceWith(r),r.id=`root`,r.removeAttribute(`data-app-behind-first-screen`),r.style.cssText=``)}})})}))}export{UG as mountApp};