onepipeline-ui 0.87.0 → 0.87.2

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.
@@ -1,9 +1,9 @@
1
- import{$ as e,A as t,B as n,C as r,Ct as i,D as a,E as o,Et as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,S as x,St as S,T as C,Tt as w,U as T,V as E,W as D,X as O,Y as k,Z as A,_ as j,_t as M,a as N,at as P,b as F,bt as I,c as ee,ct as L,d as te,dt as ne,et as re,f as ie,ft as ae,g as oe,gt as se,ht as ce,i as le,it as ue,j as de,k as fe,l as pe,lt as me,m as he,mt as ge,n as _e,nt as ve,o as ye,ot as be,p as xe,pt as Se,q as Ce,r as we,rt as R,s as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as je,vt as Me,w as Ne,wt as Pe,x as Fe,xt as Ie,y as Le,yt as Re,z as ze}from"./index-BGWGzWrD.js";var Be=R(`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`}]]),Ve=R(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),He=R(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ue=R(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),We=R(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ge=R(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ke=R(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),qe=R(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Je=R(`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`}]]),Ye=R(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Xe=R(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Ze=R(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Qe=R(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),$e=R(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),et=R(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),tt=R(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),nt=R(`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`}]]),rt=R(`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=R(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),at=R(`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`}]]),ot=R(`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`}]]),st=R(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ct=R(`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`}]]),lt=R(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ut=R(`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`}]]),dt=R(`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`}]]),ft=R(`octagon-minus`,[[`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:`M8 12h8`,key:`1wcyev`}]]),pt=R(`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`}]]),mt=R(`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`}]]),ht=R(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),gt=R(`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`}]]),_t=R(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),vt=R(`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`}]]),yt=R(`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`}]]),bt=R(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),xt=R(`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`}]]),St=R(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Ct=R(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),wt=R(`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`}]]),Tt=R(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Et=R(`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`}]]),Dt=R(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ot=1e3,kt=60*Ot,At=60*kt,jt=24*At,Mt=[1,2,5,10,20,50,100,200,500,Ot,2*Ot,5*Ot,10*Ot,15*Ot,20*Ot,30*Ot,kt,2*kt,5*kt,10*kt,15*kt,20*kt,30*kt,At,2*At,3*At,6*At,12*At,jt,2*jt,7*jt,14*jt,30*jt,60*jt,90*jt,180*jt,365*jt],Nt=5.6,Pt=8,Ft=160;function It(e,t=2){return String(e).padStart(t,`0`)}function Lt(e){let t=new Date(e);if(Number.isNaN(t.valueOf()))return String(e);let n=`${It(t.getHours())}:${It(t.getMinutes())}`,r=t.getMilliseconds();if(t.getSeconds()===0&&r===0)return n;let i=`${n}:${It(t.getSeconds())}`;if(r===0)return i;let a=r%100==0?1:r%10==0?2:3;return`${i}.${It(r,3).slice(0,a)}`}function Rt(e,t){let n=e<0?`-`:`+`,r=Math.round(Math.abs(e)/t)*t,i=Math.floor(r/At),a=Math.floor(r%At/kt),o=Math.round(r%kt),s=[];if(i>0&&s.push(`${i} h`),a>0&&s.push(`${a} min`),o>0){let e=t<Ot?Math.round(Math.log10(Ot/t)):0;s.push(`${Number((o/Ot).toFixed(e))} s`)}return s.length===0?`+0 ${t>=kt?`min`:`s`}`:`${n}${s.join(` `)}`}function zt(e){return e>=kt?kt:e>=Ot?Ot:10**Math.floor(Math.log10(e))}function Bt(e){return[1,10,100,Ot].find(t=>t>=e)??kt}function Vt(e,t,n){let r=Bt(n),i=Math.round(e/r)*r;return{clock:Lt(i),offset:Rt(i-t,r)}}function Ht(e,t){return Math.max(e.length,t.length)*Nt}function Ut(e,t){let n=t>=At?-new Date(e).getTimezoneOffset()*kt:0;return Math.ceil((e+n)/t)*t-n}function Wt(e,t,n,r){let i=t.end-t.start,a=zt(e),o=[],s=0,c=-1/0;for(let l=Ut(t.start,e);l<=t.end;l+=e){let e=Lt(l),u=Rt(l-n,a),d=Ht(e,u);s=Math.max(s,d);let f=(l-t.start)/i*r-d/2,p=`center`;f<0?(f=0,p=`start`):f+d>r&&(f=r-d,p=`end`),!(f<c+Pt)&&(c=f+d,o.push({alignment:p,clock:e,offset:u,value:l}))}return{regular:e/i*r>=s+Pt,ticks:o}}function Gt({minSpacingPx:e=0,origin:t,range:n,width:r}){let i=n.end-n.start;if(!(i>0)||!(r>0))return[];let a=Math.max(2,Math.floor(r/Ft)),o=null,s=null,c=[];for(let l of Mt){if(l/i*r<Math.max(e,36))continue;let{regular:u,ticks:d}=Wt(l,n,t,r);c=d,u&&(o??=d,d.length>=a&&(s=d))}return s??o??c}var z=s(Ie(),1),B=A(),Kt=[`bg-spectrum-blue`,`bg-spectrum-green`,`bg-spectrum-orange`,`bg-spectrum-violet`,`bg-spectrum-red`,`bg-spectrum-indigo`,`bg-spectrum-yellow`],qt=`__timeline_implicit_lane__`;function Jt(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return Kt[(t>>>0)%Kt.length]??Kt[0]}function Yt(e){return e.laneId??qt}function Xt(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 Zt(e){return e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function Qt(e){let t=new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toISOString()}function $t(e,t){let n=Xt(e),r=[e.label,`Lane: ${Yt(e)}`,`Status: ${e.status??`unknown`}`,`Start: ${Qt(e.start)}`];return n>e.start?r.push(`End: ${Qt(n)}`,`Duration: ${Zt(n-e.start)}`):r.push(`Duration: not recorded`),e.status===`failed`&&t?.trim()&&r.push(`Failure: ${t.trim().slice(0,160)}`),r.join(` · `)}function en(e,t,n){let[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),s=(0,z.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 tn({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,z.useId)(),[g,_]=(0,z.useState)(1e3),[v,y]=(0,z.useState)(null),[b,x]=(0,z.useState)(null),S=(0,z.useMemo)(()=>o.filter(e=>Number.isFinite(e.start)),[o]),C=(0,z.useMemo)(()=>l.filter(e=>Number.isFinite(e.at)),[l]),w=(0,z.useMemo)(()=>c?[...c]:[...new Set(S.map(Yt))].map(e=>({id:e,label:e===qt?`Events`:e})),[c,S]),T=(0,z.useMemo)(()=>{let e=[...S.flatMap(e=>[e.start,Xt(e)]),...C.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,C]),E=en(T,p,d),{axis:D,range:O}=E,A=S.length>0||C.length>0;(0,z.useEffect)(()=>{if(!A)return;let e=D.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()},[D,A]),(0,z.useEffect)(()=>{m&&D.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[D,m]);let j=Math.max(1,O.end-O.start),M=e=>(e-O.start)/j*100,N=i?w:[{id:`overlay`,label:`All events`}],P=e?.origin??T.start,F=r?.minSpacingPx,I=F!==void 0&&Number.isFinite(F)&&F>0?F:0,ee=(0,z.useMemo)(()=>Gt({minSpacingPx:I,origin:P,range:{end:O.end,start:O.start},width:g}),[I,P,g,O.end,O.start]),L=v===null?null:O.start+v*j,te=L===null?null:Vt(L,P,j/g),ne=e=>{let t=Xt(e);if(t<O.start||e.start>O.end)return null;let n=Math.max(0,M(Math.max(e.start,O.start))),r=Math.max(.8,M(Math.min(t,O.end))-n),i=t<=e.start,o=`timeline-detail-${h}-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,s=Jt(Yt(e));return(0,B.jsxs)(`div`,{className:`absolute inset-y-0`,style:{left:`${n}%`},children:[(0,B.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:k(`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,B.jsx)(ve,{"aria-hidden":`true`,className:`m-auto size-2 fill-current text-white`}):null}),(0,B.jsx)(`span`,{className:k(`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:$t(e,a?.(e))})]},e.id)};return(0,B.jsxs)(`section`,{"aria-label":s,className:`timeline rounded-xl border bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`div`,{"aria-label":`Timeline legend`,className:`flex flex-wrap gap-3`,role:`list`,children:w.map(e=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,role:`listitem`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-2 rounded-full`,Jt(e.id))}),e.label]},e.id))}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.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,B.jsx)(Ke,{"aria-hidden":`true`,className:`size-3`}):(0,B.jsx)(We,{"aria-hidden":`true`,className:`size-3`}),i?`Collapse`:`Expand`]}),(0,B.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:!E.viewChanged,onClick:E.reset,type:`button`,children:[(0,B.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),` Reset zoom`]})]})]}),S.length===0&&C.length===0?(0,B.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No timeline events recorded.`}):(0,B.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=>E.brushStart(e.clientX),onPointerUp:e=>E.finishBrush(e.clientX),onWheel:e=>{e.preventDefault(),E.zoom(e.clientX,e.deltaY)},ref:D,children:[n&&te!==null?(0,B.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,B.jsxs)(`span`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap bg-popover px-1 text-[10px] leading-3 text-popover-foreground`,style:{transform:(v??0)>.5?`translateX(-100%)`:void 0},children:[(0,B.jsx)(`span`,{children:te.clock}),(0,B.jsx)(`span`,{children:te.offset})]})}):null,(0,B.jsxs)(`div`,{className:`relative grid gap-2`,style:{containerType:`inline-size`},children:[N.map(e=>(0,B.jsxs)(`div`,{className:`relative h-6 border-b border-border/60`,"data-lane-id":e.id,"data-testid":`timeline-lane`,children:[i?(0,B.jsx)(`span`,{className:`sr-only`,children:e.label}):null,(i?S.filter(t=>Yt(t)===e.id):S).map(ne)]},e.id)),C.map(e=>e.at<O.start||e.at>O.end?null:(0,B.jsxs)(`div`,{className:`pointer-events-none absolute inset-y-0 z-20`,style:{left:`${M(e.at)}%`},children:[(0,B.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-foreground/60`,"data-testid":`timeline-marker-line`}),(0,B.jsx)(`button`,{"aria-label":`${e.label}, marker`,"aria-pressed":m===e.id,className:k(`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,B.jsx)(ct,{"aria-hidden":`true`,className:`size-3`})})]},e.id)),typeof t==`number`&&Number.isFinite(t)&&t>=O.start&&t<=O.end?(0,B.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,B.jsx)(`ol`,{"aria-label":`Timeline axis`,className:`relative m-0 mt-2 h-6 list-none p-0 font-mono text-[9px] leading-3 text-subtle`,"data-testid":`timeline-axis`,"data-timeline-axis":!0,children:ee.map(e=>(0,B.jsxs)(`li`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap`,"data-tick-time":e.value,style:e.alignment===`start`?{left:0}:e.alignment===`end`?{right:0}:{left:`${M(e.value)}%`,transform:`translateX(-50%)`},children:[(0,B.jsx)(`span`,{children:e.clock}),(0,B.jsx)(`span`,{children:e.offset})]},e.value))})]})]})}var nn=Object.defineProperty,rn=(e,t)=>nn(e,`name`,{value:t,configurable:!0});function an(e,t){let n=z.createContext(t);n.displayName=e+`Context`;let r=rn(e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=z.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return rn(i,`useContext`),[r,i]}rn(an,`createContext`);function on(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=rn(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,B.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=z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return rn(s,`useContext`),[o,s]}rn(r,`createContext`);let i=rn(()=>{let t=n.map(e=>z.createContext(e));return rn(function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,sn(i,...t)]}rn(on,`createContextScope`);function sn(...e){let t=e[0];if(e.length===1)return t;let n=rn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return rn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}rn(sn,`composeContextScopes`);var cn=Object.defineProperty,ln=(e,t)=>cn(e,`name`,{value:t,configurable:!0});function un(e){let t=e+`CollectionProvider`,[n,r]=on(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ln(e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=p(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,m=p(u),h=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=f(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(m,{[d]:``,ref:s,children:r})});h.displayName=u;function g(t){let n=a(e+`CollectionConsumer`,t);return z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ln(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}ln(un,`createCollection`);var dn=new WeakMap,fn=class e extends Map{static{ln(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],dn.set(this,!0)}set(e,t){return dn.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=hn(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=pn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=pn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return pn(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 pn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=mn(e,t);return n===-1?void 0:e[n]}ln(pn,`at`);function mn(e,t){let n=e.length,r=hn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ln(mn,`toSafeIndex`);function hn(e){return e!==e||e===0?0:Math.trunc(e)}ln(hn,`toSafeInteger`);function gn(e){let t=e+`CollectionProvider`,[n,r]=on(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new fn,setItemMap:ln(()=>void 0,`setItemMap`)}),o=ln(({state:e,...t})=>e?(0,B.jsx)(c,{...t,state:e}):(0,B.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=ln(e=>{let t=_();return(0,B.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=ln(e=>{let{scope:t,children:n,state:r}=e,a=z.useRef(null),[o,s]=z.useState(null),c=f(a,s),[l,u]=r;return z.useEffect(()=>{if(!o)return;let e=bn(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,B.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=p(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(l,n).collectionRef);return(0,B.jsx)(u,{ref:i,children:r})});d.displayName=l;let m=e+`CollectionItemSlot`,h=p(m),g=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),[s,c]=z.useState(null),l=f(t,o,c),{setItemMap:u}=a(m,n),d=z.useRef(i);_n(d.current,i)||(d.current=i);let p=d.current;return z.useEffect(()=>{let e=p;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(yn):(t.set(s,{...e,element:s}),t.toSorted(yn)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new fn(e)))}},[s,p,u]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=m;function _(){return z.useState(new fn)}ln(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return ln(v,`useCollection`),[{Provider:o,Slot:d,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}ln(gn,`createCollection`);function _n(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}ln(_n,`shallowEqual`);function vn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ln(vn,`isElementPreceding`);function yn(e,t){return!e[1].element||!t[1].element?0:vn(e[1].element,t[1].element)?-1:1}ln(yn,`sortByDocumentPosition`);function bn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ln(bn,`getChildListObserver`);var xn=Object.defineProperty,Sn=(e,t)=>xn(e,`name`,{value:t,configurable:!0}),Cn=!!(typeof window<`u`&&window.document&&window.document.createElement);function wn(e,t,{checkForDefaultPrevented:n=!0}={}){return Sn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Sn(wn,`composeEventHandlers`);function Tn(e){if(!Cn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Sn(Tn,`getOwnerWindow`);function En(e){if(!Cn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Sn(En,`getOwnerDocument`);function Dn(e,t=!1){let{activeElement:n}=En(e);if(!n?.nodeName)return null;if(On(n)&&n.contentDocument)return Dn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=En(n).getElementById(e);if(t)return t}}return n}Sn(Dn,`getActiveElement`);function On(e){return e.tagName===`IFRAME`}Sn(On,`isFrame`);var kn=globalThis?.document?z.useLayoutEffect:()=>{},An=Object.defineProperty,jn=(e,t)=>An(e,`name`,{value:t,configurable:!0}),Mn=z.useEffectEvent,Nn=z.useInsertionEffect;function Pn(e){if(typeof Mn==`function`)return Mn(e);let t=z.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Nn==`function`?Nn(()=>{t.current=e}):kn(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}jn(Pn,`useEffectEvent`);var Fn=Object.defineProperty,In=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),Ln=z.useInsertionEffect||kn;function Rn({prop:e,defaultProp:t,onChange:n=In(()=>{},`onChange`),caller:r}){let[i,a,o]=zn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,z.useCallback(t=>{if(s){let n=Bn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}In(Rn,`useControllableState`);function zn({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Ln(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}In(zn,`useUncontrolledState`);function Bn(e){return typeof e==`function`}In(Bn,`isFunction`);var Vn=Symbol(`RADIX:SYNC_STATE`);function Hn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Pn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=z.useReducer((t,n)=>{if(n.type===Vn)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=z.useRef(p);z.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=z.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return z.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Vn,state:i})},[i,d.state,c]),[h,f]}In(Hn,`useControllableStateReducer`);var Un=s(I(),1),Wn=Object.defineProperty,Gn=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Kn=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=p(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qn(e,t){e&&Un.flushSync(()=>e.dispatchEvent(t))}Gn(qn,`dispatchDiscreteCustomEvent`);var Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0});function Xn(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}Yn(Xn,`useStateMachine`);var Zn=Yn(e=>{let{present:t,children:n}=e,r=Qn(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=er(r.ref,nr(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null},`Presence`);function Qn(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),o=z.useRef(void 0),[s,c]=Xn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{s===`mounted`?(a.current=o.current??tr(r.current),o.current=void 0):a.current=`none`},[s]),kn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=tr(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]),kn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Yn(a=>{let o=tr(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=Yn(e=>{e.target===t&&(a.current=tr(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:z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=tr(t)}else r.current=null;n(e)},[])}}Yn(Qn,`usePresence`);function $n(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Yn($n,`setRef`);function er(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=$n(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():$n(n[e],null)}}},[])}Yn(er,`useStableComposedRefs`);function tr(e){return e?.animationName||`none`}Yn(tr,`getAnimationName`);function nr(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)}Yn(nr,`getElementRef`);var rr=Object.defineProperty,ir=(e,t)=>rr(e,`name`,{value:t,configurable:!0}),ar=z.useId||(()=>void 0),or=0;function sr(e){let[t,n]=z.useState(ar());return kn(()=>{e||n(e=>e??String(or++))},[e]),e||(t?`radix-${t}`:``)}ir(sr,`useId`);var cr=Object.defineProperty,lr=(e,t)=>cr(e,`name`,{value:t,configurable:!0}),ur=`Collapsible`,[dr,fr]=on(ur),[pr,mr]=dr(ur),hr=z.forwardRef(lr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Rn({prop:r,defaultProp:i??!1,onChange:o,caller:ur});return(0,B.jsx)(pr,{scope:n,disabled:a,contentId:sr(),open:c,onOpenToggle:z.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(Kn.div,{"data-state":xr(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),gr=`CollapsibleTrigger`,_r=z.forwardRef(lr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=mr(gr,n);return(0,B.jsx)(Kn.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":xr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:wn(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),vr=`CollapsibleContent`,yr=z.forwardRef(lr(function(e,t){let{forceMount:n,...r}=e,i=mr(vr,e.__scopeCollapsible);return(0,B.jsx)(Zn,{present:n||i.open,children:({present:e})=>(0,B.jsx)(br,{...r,ref:t,present:e})})},`CollapsibleContent`)),br=z.forwardRef(lr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=mr(vr,n),[s,c]=z.useState(r),l=z.useRef(null),u=f(t,l),d=z.useRef(0),p=d.current,m=z.useRef(0),h=m.current,g=o.open||s,_=z.useRef(g),v=z.useRef(void 0);return z.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),kn(()=>{let e=l.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();d.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,B.jsx)(Kn.div,{"data-state":xr(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,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 xr(e){return e?`open`:`closed`}lr(xr,`getState`);var Sr=hr,Cr=_r,wr=yr,Tr=Object.defineProperty,Er=(e,t)=>Tr(e,`name`,{value:t,configurable:!0}),Dr=z.createContext(void 0);function Or(e){let t=z.useContext(Dr);return e||t||`ltr`}Er(Or,`useDirection`);var kr=Object.defineProperty,Ar=(e,t)=>kr(e,`name`,{value:t,configurable:!0}),jr=`Accordion`,Mr=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[Nr,Pr,Fr]=un(jr),[Ir,Lr]=on(jr,[Fr,fr]),Rr=fr(),zr=z.forwardRef(Ar(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(Nr.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(Gr,{...a,ref:t}):(0,B.jsx)(Wr,{...i,ref:t})})},`Accordion`)),[Br,Vr]=Ir(jr),[Hr,Ur]=Ir(jr,{collapsible:!1}),Wr=z.forwardRef(Ar(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Ar(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=Rn({prop:n,defaultProp:r??``,onChange:i,caller:jr});return(0,B.jsx)(Br,{scope:e.__scopeAccordion,value:z.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:z.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(Hr,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(Jr,{...o,ref:t})})})},`AccordionImplSingle`)),Gr=z.forwardRef(Ar(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Ar(()=>{},`onValueChange`),...a}=e,[o,s]=Rn({prop:n,defaultProp:r??[],onChange:i,caller:jr}),c=z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(Br,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(Hr,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(Jr,{...a,ref:t})})})},`AccordionImplMultiple`)),[Kr,qr]=Ir(jr),Jr=z.forwardRef(Ar(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=f(z.useRef(null),t),c=Pr(n),l=Or(i)===`ltr`,u=wn(e.onKeyDown,e=>{if(!Mr.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=Ar(()=>{o=r+1,o>s&&(o=0)},`moveNext`),d=Ar(()=>{o=r-1,o<0&&(o=s)},`movePrev`);switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(Kr,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(Nr.Slot,{scope:n,children:(0,B.jsx)(Kn.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})},`AccordionImpl`)),Yr=`AccordionItem`,[Xr,Zr]=Ir(Yr),Qr=z.forwardRef(Ar(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=qr(Yr,n),o=Vr(Yr,n),s=Rr(n),c=sr(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)(Xr,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Sr,{"data-orientation":a.orientation,"data-state":ai(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),$r=`AccordionHeader`,ei=z.forwardRef(Ar(function(e,t){let{__scopeAccordion:n,...r}=e,i=qr(jr,n),a=Zr($r,n);return(0,B.jsx)(Kn.h3,{"data-orientation":i.orientation,"data-state":ai(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),ti=`AccordionTrigger`,ni=z.forwardRef(Ar(function(e,t){let{__scopeAccordion:n,...r}=e,i=qr(jr,n),a=Zr(ti,n),o=Ur(ti,n),s=Rr(n);return(0,B.jsx)(Nr.ItemSlot,{scope:n,children:(0,B.jsx)(Cr,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),ri=`AccordionContent`,ii=z.forwardRef(Ar(function(e,t){let{__scopeAccordion:n,...r}=e,i=qr(jr,n),a=Zr(ri,n),o=Rr(n);return(0,B.jsx)(wr,{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 ai(e){return e?`open`:`closed`}Ar(ai,`getState`);var oi=zr,si=Qr,ci=ei,li=ni,ui=ii;function di({...e}){return(0,B.jsx)(oi,{"data-slot":`accordion`,...e})}function fi({className:e,...t}){return(0,B.jsx)(si,{"data-slot":`accordion-item`,className:k(`border-b last:border-b-0`,e),...t})}function pi({className:e,children:t,...n}){return(0,B.jsx)(ci,{className:`flex`,children:(0,B.jsxs)(li,{"data-slot":`accordion-trigger`,className:k(`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,B.jsx)(We,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function mi({className:e,children:t,...n}){return(0,B.jsx)(ui,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,B.jsx)(`div`,{className:k(`pt-0 pb-4`,e),children:t})})}var hi=D(`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 gi({className:e,variant:t,...n}){return(0,B.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:k(hi({variant:t}),e),...n})}function _i({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-title`,className:k(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function vi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-description`,className:k(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var yi=Object.defineProperty,bi=(e,t)=>yi(e,`name`,{value:t,configurable:!0});function xi(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}bi(xi,`useCallbackRef`);var Si=Object.defineProperty,Ci=(e,t)=>Si(e,`name`,{value:t,configurable:!0}),wi=`Avatar`,[Ti,Ei]=on(wi),Di=[0,()=>void 0],[Oi,ki]=Ti(wi),Ai=z.forwardRef(Ci(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=z.useState(`idle`),[o,s]=Fi();return(0,B.jsx)(Oi,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,B.jsx)(Kn.span,{...r,ref:t})})},`Avatar`)),ji=`AvatarFallback`,Mi=z.forwardRef(Ci(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=ki(ji,n),[o,s]=z.useState(r===void 0);return z.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,B.jsx)(Kn.span,{...i,ref:t}):null},`AvatarFallback`));function Ni(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return kn(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Ci(e=>{let t=e.currentTarget;n(Pi(t))},`handleLoad`),o=Ci(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Pi(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Ci(Ni,`useImageLoadingStatus`);function Pi(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Ci(Pi,`getImageLoadingStatus`);function Fi(){return Di}Ci(Fi,`useImageCount`);function Ii(e){}Ci(Ii,`useUpdateImageCount`);function Li({className:e,size:t=`default`,...n}){return(0,B.jsx)(Ai,{"data-slot":`avatar`,"data-size":t,className:k(`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 Ri({className:e,...t}){return(0,B.jsx)(Mi,{"data-slot":`avatar-fallback`,className:k(`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 zi({className:e,...t}){return(0,B.jsx)(`img`,{className:k(`aspect-square size-full object-cover`,e),"data-slot":`avatar-image`,...t})}var Bi=D(`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 Vi({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?l:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:k(Bi({variant:t,size:n,className:e})),...i})}function Hi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card`,className:k(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function Ui({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-6`,e),...t})}var Wi=Object.defineProperty,Gi=(e,t)=>Wi(e,`name`,{value:t,configurable:!0}),Ki=`dismissableLayer.update`,qi=`dismissableLayer.pointerDownOutside`,Ji=`dismissableLayer.focusOutside`,Yi,Xi=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zi=z.forwardRef(Gi(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=z.useContext(Xi),[d,p]=z.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=z.useState({}),g=f(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=z.useRef(!1),w=ea(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=ta(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=d?b===_.length-1:!1,D=xi(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return z.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yi=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),na(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Yi))}},[d,m,n,u]),z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),na())},[d,u]),z.useEffect(()=>{let e=Gi(()=>h({}),`handleUpdate`);return document.addEventListener(Ki,e),()=>document.removeEventListener(Ki,e)},[]),(0,B.jsx)(Kn.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:wn(e.onFocusCapture,T.onFocusCapture),onBlurCapture:wn(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:wn(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Qi(){let e=z.useContext(Xi),[t,n]=z.useState(null);return z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gi(Qi,`useDismissableLayerSurface`);var $i=Gi(()=>!0,`IS_TRUE`);function ea(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=$i}=t,s=xi(e),c=z.useRef(!1),l=z.useRef(!1),u=z.useRef(new Map),d=z.useRef(()=>{});return z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Gi(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Gi(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)}Gi(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Gi(p,`handleInteractionBubble`);let m=Gi(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||ra(qi,s,p,{discrete:!0})};if(Gi(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:Gi(()=>c.current=!0,`onPointerDownCapture`)}}Gi(ea,`usePointerDownOutside`);function ta(e,t=globalThis?.document){let n=xi(e),r=z.useRef(!1);return z.useEffect(()=>{let e=Gi(e=>{e.target&&!r.current&&ra(Ji,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gi(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gi(()=>r.current=!1,`onBlurCapture`)}}Gi(ta,`useFocusOutside`);function na(){let e=new CustomEvent(Ki);document.dispatchEvent(e)}Gi(na,`dispatchUpdate`);function ra(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?qn(i,a):i.dispatchEvent(a)}Gi(ra,`handleAndDispatchCustomEvent`);var ia=Object.defineProperty,aa=(e,t)=>ia(e,`name`,{value:t,configurable:!0}),oa=`focusScope.autoFocusOnMount`,sa=`focusScope.autoFocusOnUnmount`,ca={bubbles:!1,cancelable:!0},la=z.forwardRef(aa(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=xi(i),u=xi(a),d=z.useRef(null),p=f(t,c),m=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ga(d.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ga(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ga(s)};aa(e,`handleFocusIn`),aa(t,`handleFocusOut`),aa(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),z.useEffect(()=>{if(s){_a.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(oa,ca);s.addEventListener(oa,l),s.dispatchEvent(t),t.defaultPrevented||(ua(ba(fa(s)),{select:!0}),document.activeElement===e&&ga(s))}return()=>{s.removeEventListener(oa,l),setTimeout(()=>{let t=new CustomEvent(sa,ca);s.addEventListener(sa,u),s.dispatchEvent(t),t.defaultPrevented||ga(e??document.body,{select:!0}),s.removeEventListener(sa,u),_a.remove(m)},0)}}},[s,l,u,m]);let h=z.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]=da(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ga(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ga(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,B.jsx)(Kn.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function ua(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ga(r,{select:t}),document.activeElement!==n)return}aa(ua,`focusFirst`);function da(e){let t=fa(e);return[pa(t,e),pa(t.reverse(),e)]}aa(da,`getTabbableEdges`);function fa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:aa(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}aa(fa,`getTabbableCandidates`);function pa(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ma(r,{upTo:t})))return r}aa(pa,`findVisible`);function ma(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}aa(ma,`isHidden`);function ha(e){return e instanceof HTMLInputElement&&`select`in e}aa(ha,`isSelectableInput`);function ga(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ha(e)&&t&&e.select()}}aa(ga,`focus`);var _a=va();function va(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ya(e,t),e.unshift(t)},remove(t){e=ya(e,t),e[0]?.resume()}}}aa(va,`createFocusScopesStack`);function ya(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}aa(ya,`arrayRemove`);function ba(e){return e.filter(e=>e.tagName!==`A`)}aa(ba,`removeLinks`);var xa=Object.defineProperty,Sa=z.forwardRef(((e,t)=>xa(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=z.useState(!1);kn(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Un.createPortal((0,B.jsx)(Kn.div,{...r,ref:t}),o):null},`Portal`)),Ca=Object.defineProperty,wa=(e,t)=>Ca(e,`name`,{value:t,configurable:!0}),Ta=0,Ea=null;function Da(e){return Oa(),e.children}wa(Da,`FocusGuards`);function Oa(){z.useEffect(()=>{Ea||={start:ka(),end:ka()};let{start:e,end:t}=Ea;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ta++,()=>{Ta===1&&(Ea?.start.remove(),Ea?.end.remove(),Ea=null),Ta=Math.max(0,Ta-1)}},[])}wa(Oa,`useFocusGuards`);function ka(){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}wa(ka,`createFocusGuard`);var Aa=function(){return Aa=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},Aa.apply(this,arguments)};function ja(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 Ma(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 Na=`right-scroll-bar-position`,Pa=`width-before-scroll-bar`,Fa=`with-scroll-bars-hidden`,Ia=`--removed-body-scroll-bar-size`;function La(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ra(e,t){var n=(0,z.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`?z.useLayoutEffect:z.useEffect,Ba=new WeakMap;function Va(e,t){var n=Ra(t||null,function(t){return e.forEach(function(e){return La(e,t)})});return za(function(){var t=Ba.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||La(e,null)}),i.forEach(function(e){r.has(e)||La(e,a)})}Ba.set(n,e)},[e]),n}function Ha(e){return e}function Ua(e,t){t===void 0&&(t=Ha);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 Wa(e){e===void 0&&(e={});var t=Ua(null);return t.options=Aa({async:!0,ssr:!1},e),t}var Ga=function(e){var t=e.sideCar,n=ja(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 z.createElement(r,Aa({},n))};Ga.isSideCarExport=!0;function Ka(e,t){return e.useMedium(t),Ga}var qa=Wa(),Ja=function(){},Ya=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Ja,onWheelCapture:Ja,onTouchMoveCapture:Ja}),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=ja(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Va([n,t]),C=Aa(Aa({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:qa,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),Aa(Aa({},C),{ref:S})):z.createElement(v,Aa({},C,{className:c,ref:S}),s))});Ya.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ya.classNames={fullWidth:Pa,zeroRight:Na};var Xa,Za=function(){if(Xa)return Xa;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Qa(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Za();return t&&e.setAttribute(`nonce`,t),e}function $a(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eo(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var to=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Qa())&&($a(t,n),eo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},no=function(){var e=to();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ro=function(){var e=no();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},io={left:0,top:0,right:0,gap:0},ao=function(e){return parseInt(e||``,10)||0},oo=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[ao(n),ao(r),ao(i)]},so=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return io;var t=oo(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])}},co=ro(),lo=`data-scroll-locked`,uo=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
- .${Fa} {
1
+ import{$ as e,A as t,B as n,C as r,Ct as i,D as a,E as o,Et as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,S as x,St as S,T as C,Tt as w,U as T,V as E,W as D,X as O,Y as k,Z as A,_ as j,_t as M,a as N,at as P,b as F,bt as I,c as ee,ct as L,d as te,dt as ne,et as re,f as ie,ft as ae,g as oe,gt as se,ht as ce,i as le,it as ue,j as de,k as fe,l as pe,lt as me,m as he,mt as ge,n as _e,nt as ve,o as ye,ot as be,p as xe,pt as Se,q as Ce,r as we,rt as R,s as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as je,vt as Me,w as Ne,wt as Pe,x as Fe,xt as Ie,y as Le,yt as Re,z as ze}from"./index-D13bjAOF.js";var Be=R(`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`}]]),Ve=R(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),He=R(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ue=R(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),We=R(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ge=R(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ke=R(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),qe=R(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Je=R(`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`}]]),Ye=R(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Xe=R(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Ze=R(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Qe=R(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),$e=R(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),et=R(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),tt=R(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),nt=R(`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`}]]),rt=R(`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=R(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),at=R(`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`}]]),ot=R(`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`}]]),st=R(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ct=R(`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`}]]),lt=R(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ut=R(`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`}]]),dt=R(`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`}]]),ft=R(`octagon-minus`,[[`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:`M8 12h8`,key:`1wcyev`}]]),pt=R(`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`}]]),mt=R(`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`}]]),ht=R(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),gt=R(`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`}]]),_t=R(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),vt=R(`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`}]]),yt=R(`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`}]]),bt=R(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),xt=R(`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`}]]),St=R(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Ct=R(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),wt=R(`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`}]]),Tt=R(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Et=R(`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`}]]),Dt=R(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ot=1e3,kt=60*Ot,At=60*kt,jt=24*At,Mt=[1,2,5,10,20,50,100,200,500,Ot,2*Ot,5*Ot,10*Ot,15*Ot,20*Ot,30*Ot,kt,2*kt,5*kt,10*kt,15*kt,20*kt,30*kt,At,2*At,3*At,6*At,12*At,jt,2*jt,7*jt,14*jt,30*jt,60*jt,90*jt,180*jt,365*jt],Nt=5.6,Pt=8,Ft=160;function It(e,t=2){return String(e).padStart(t,`0`)}function Lt(e){let t=new Date(e);if(Number.isNaN(t.valueOf()))return String(e);let n=`${It(t.getHours())}:${It(t.getMinutes())}`,r=t.getMilliseconds();if(t.getSeconds()===0&&r===0)return n;let i=`${n}:${It(t.getSeconds())}`;if(r===0)return i;let a=r%100==0?1:r%10==0?2:3;return`${i}.${It(r,3).slice(0,a)}`}function Rt(e,t){let n=e<0?`-`:`+`,r=Math.round(Math.abs(e)/t)*t,i=Math.floor(r/At),a=Math.floor(r%At/kt),o=Math.round(r%kt),s=[];if(i>0&&s.push(`${i} h`),a>0&&s.push(`${a} min`),o>0){let e=t<Ot?Math.round(Math.log10(Ot/t)):0;s.push(`${Number((o/Ot).toFixed(e))} s`)}return s.length===0?`+0 ${t>=kt?`min`:`s`}`:`${n}${s.join(` `)}`}function zt(e){return e>=kt?kt:e>=Ot?Ot:10**Math.floor(Math.log10(e))}function Bt(e){return[1,10,100,Ot].find(t=>t>=e)??kt}function Vt(e,t,n){let r=Bt(n),i=Math.round(e/r)*r;return{clock:Lt(i),offset:Rt(i-t,r)}}function Ht(e,t){return Math.max(e.length,t.length)*Nt}function Ut(e,t){let n=t>=At?-new Date(e).getTimezoneOffset()*kt:0;return Math.ceil((e+n)/t)*t-n}function Wt(e,t,n,r){let i=t.end-t.start,a=zt(e),o=[],s=0,c=-1/0;for(let l=Ut(t.start,e);l<=t.end;l+=e){let e=Lt(l),u=Rt(l-n,a),d=Ht(e,u);s=Math.max(s,d);let f=(l-t.start)/i*r-d/2,p=`center`;f<0?(f=0,p=`start`):f+d>r&&(f=r-d,p=`end`),!(f<c+Pt)&&(c=f+d,o.push({alignment:p,clock:e,offset:u,value:l}))}return{regular:e/i*r>=s+Pt,ticks:o}}function Gt({minSpacingPx:e=0,origin:t,range:n,width:r}){let i=n.end-n.start;if(!(i>0)||!(r>0))return[];let a=Math.max(2,Math.floor(r/Ft)),o=null,s=null,c=[];for(let l of Mt){if(l/i*r<Math.max(e,36))continue;let{regular:u,ticks:d}=Wt(l,n,t,r);c=d,u&&(o??=d,d.length>=a&&(s=d))}return s??o??c}var z=s(Ie(),1),B=A(),Kt=[`bg-spectrum-blue`,`bg-spectrum-green`,`bg-spectrum-orange`,`bg-spectrum-violet`,`bg-spectrum-red`,`bg-spectrum-indigo`,`bg-spectrum-yellow`],qt=`__timeline_implicit_lane__`;function Jt(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return Kt[(t>>>0)%Kt.length]??Kt[0]}function Yt(e){return e.laneId??qt}function Xt(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 Zt(e){return e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function Qt(e){let t=new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toISOString()}function $t(e,t){let n=Xt(e),r=[e.label,`Lane: ${Yt(e)}`,`Status: ${e.status??`unknown`}`,`Start: ${Qt(e.start)}`];return n>e.start?r.push(`End: ${Qt(n)}`,`Duration: ${Zt(n-e.start)}`):r.push(`Duration: not recorded`),e.status===`failed`&&t?.trim()&&r.push(`Failure: ${t.trim().slice(0,160)}`),r.join(` · `)}var en=e=>`item:${e.id}`,tn=e=>`marker:${e.id}`;function nn(e,t,n,r){let i=(0,z.useRef)(new Map),a=(0,z.useRef)(null),[o,s]=(0,z.useState)(null),c=(0,z.useCallback)((e,t)=>{t?i.current.set(e,t):i.current.delete(e)},[]),l=(e,t)=>{if(e===a.current)return;a.current=e,s(e);let n=e===null?void 0:i.current.get(e);r?.(t&&n?{element:n,entry:t}:null)};return{hoveredKey:o,leave:()=>l(null,null),register:c,resolve:(r,a,o)=>{let s=[...e.flatMap(e=>{let t=Xt(e);return t<n.start||e.start>n.end?[]:[{distance:r<e.start?e.start-r:r>t?r-t:0,entry:e,key:en(e),marker:!1}]}),...t.flatMap(e=>e.at<n.start||e.at>n.end?[]:[{distance:Math.abs(e.at-r),entry:e,key:tn(e),marker:!0}])],c=a instanceof Element?a.closest(`[data-timeline-entry]`):null,u=s.find(e=>i.current.get(e.key)===c),d=s.reduce((e,t)=>!e||t.distance<e.distance||t.distance===e.distance&&t.marker===o&&e.marker!==o?t:e,null),f=u??d;l(f?.key??null,f?.entry??null)}}}function rn(e,t,n){let[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),s=(0,z.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 an({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,onHover:d,onRangeChange:f,onSelect:p,range:m,selectedId:h}){let g=(0,z.useId)(),[_,v]=(0,z.useState)(1e3),[y,b]=(0,z.useState)(null),[x,S]=(0,z.useState)(null),C=(0,z.useMemo)(()=>o.filter(e=>Number.isFinite(e.start)),[o]),w=(0,z.useMemo)(()=>l.filter(e=>Number.isFinite(e.at)),[l]),T=(0,z.useMemo)(()=>c?[...c]:[...new Set(C.map(Yt))].map(e=>({id:e,label:e===qt?`Events`:e})),[c,C]),E=(0,z.useMemo)(()=>{let e=[...C.flatMap(e=>[e.start,Xt(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}},[C,w]),D=rn(E,m,f),{axis:O,range:A}=D,j=nn(C,w,A,d),M=(0,z.useRef)(null),N=C.length>0||w.length>0;(0,z.useEffect)(()=>{if(!N)return;let e=O.current;if(!e)return;let t=()=>v(e.getBoundingClientRect().width||1e3);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[O,N]),(0,z.useEffect)(()=>{h&&O.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[O,h]);let P=Math.max(1,A.end-A.start),F=e=>(e-A.start)/P*100,I=i?T:[{id:`overlay`,label:`All events`}],ee=e?.origin??E.start,L=r?.minSpacingPx,te=L!==void 0&&Number.isFinite(L)&&L>0?L:0,ne=(0,z.useMemo)(()=>Gt({minSpacingPx:te,origin:ee,range:{end:A.end,start:A.start},width:_}),[te,ee,_,A.end,A.start]),ie=y===null?null:A.start+y*P,ae=ie===null?null:Vt(ie,ee,P/_),oe=e=>{let t=Xt(e);if(t<A.start||e.start>A.end)return null;let n=Math.max(0,F(Math.max(e.start,A.start))),r=Math.max(.8,F(Math.min(t,A.end))-n),i=t<=e.start,o=`timeline-detail-${g}-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,s=Jt(Yt(e));return(0,B.jsxs)(`div`,{className:`absolute inset-y-0`,style:{left:`${n}%`},children:[(0,B.jsx)(`button`,{"aria-describedby":o,"aria-label":`${e.label}, ${i?`point event`:`span`}`,"aria-pressed":h===e.id,"aria-current":h===e.id?`true`:void 0,"data-turn-id":e.turnId,"data-tool-call-id":e.toolCallId,"data-event-index":e.eventIndex,"data-timeline-entry":``,"data-timeline-hovered":j.hoveredKey===en(e)?`true`:void 0,className:k(`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`,h===e.id&&`ring-2 ring-foreground ring-offset-1`,s),"data-lane-color":s,"data-selected":h===e.id?`true`:`false`,"data-timeline-shape":i?`point`:`span`,onBlur:()=>S(null),onClick:t=>{t.stopPropagation(),S(e.id),p?.(e)},onFocus:()=>S(e.id),onMouseEnter:()=>S(e.id),onMouseLeave:()=>S(null),ref:t=>j.register(en(e),t),style:{width:i?void 0:`${r}cqw`},type:`button`,children:i?(0,B.jsx)(ve,{"aria-hidden":`true`,className:`m-auto size-2 fill-current text-white`}):null}),(0,B.jsx)(`span`,{className:k(`pointer-events-none absolute z-30 w-80 rounded-md bg-popover px-2.5 py-2 text-[10px] text-popover-foreground shadow-lg`,x===e.id?`block`:`sr-only`),id:o,role:x===e.id?`tooltip`:void 0,style:{top:`1.4rem`},children:$t(e,a?.(e))})]},e.id)};return(0,B.jsxs)(`section`,{"aria-label":s,className:`timeline rounded-xl border bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`div`,{"aria-label":`Timeline legend`,className:`flex flex-wrap gap-3`,role:`list`,children:T.map(e=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,role:`listitem`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-2 rounded-full`,Jt(e.id))}),e.label]},e.id))}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.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,B.jsx)(Ke,{"aria-hidden":`true`,className:`size-3`}):(0,B.jsx)(We,{"aria-hidden":`true`,className:`size-3`}),i?`Collapse`:`Expand`]}),(0,B.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,B.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),` Reset zoom`]})]})]}),C.length===0&&w.length===0?(0,B.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No timeline events recorded.`}):(0,B.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,n=t.getBoundingClientRect(),r=Math.min(1,Math.max(0,(e.clientX-n.left-t.clientLeft)/(t.clientWidth||n.width||1e3)));b(r);let i=M.current?.getBoundingClientRect().top??n.top;j.resolve(A.start+r*P,e.target,e.clientY<i)},onPointerLeave:()=>{b(null),j.leave()},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&&ae!==null?(0,B.jsx)(`div`,{"aria-label":`Timeline crosshair`,className:`pointer-events-none absolute inset-y-0 z-30 w-0.5 -translate-x-1/2 bg-foreground shadow-[0_0_0_1px_var(--card)]`,style:{left:`${(y??0)*100}%`},children:(0,B.jsxs)(`span`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap rounded-sm border bg-popover px-1 text-[10px] leading-3 text-popover-foreground shadow-sm`,style:{transform:(y??0)>.5?`translateX(-100%)`:void 0},children:[(0,B.jsx)(`span`,{children:ae.clock}),(0,B.jsx)(`span`,{children:ae.offset})]})}):null,(0,B.jsxs)(`div`,{className:`relative grid gap-2`,ref:M,style:{containerType:`inline-size`},children:[I.map(e=>(0,B.jsxs)(`div`,{className:`relative h-6 border-b border-border/60`,"data-lane-id":e.id,"data-testid":`timeline-lane`,children:[i?(0,B.jsx)(`span`,{className:`sr-only`,children:e.label}):null,(i?C.filter(t=>Yt(t)===e.id):C).map(oe)]},e.id)),w.map(e=>e.at<A.start||e.at>A.end?null:(0,B.jsxs)(`div`,{className:`pointer-events-none absolute inset-y-0 z-20`,style:{left:`${F(e.at)}%`},children:[(0,B.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-foreground/60`,"data-testid":`timeline-marker-line`}),(0,B.jsx)(`button`,{"aria-label":`${e.label}, marker`,"aria-pressed":h===e.id,className:k(`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`,h===e.id&&`ring-2 ring-foreground`),"data-selected":h===e.id?`true`:`false`,"data-timeline-entry":``,"data-timeline-hovered":j.hoveredKey===tn(e)?`true`:void 0,onClick:t=>{t.stopPropagation(),p?.(e)},ref:t=>j.register(tn(e),t),type:`button`,children:e.icon??(0,B.jsx)(ct,{"aria-hidden":`true`,className:`size-3`})})]},e.id)),typeof t==`number`&&Number.isFinite(t)&&t>=A.start&&t<=A.end?(0,B.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:`${F(t)}%`}}):null]}),(0,B.jsx)(`ol`,{"aria-label":`Timeline axis`,className:`relative m-0 mt-2 h-6 list-none p-0 font-mono text-[9px] leading-3 text-subtle`,"data-testid":`timeline-axis`,"data-timeline-axis":!0,children:ne.map(e=>(0,B.jsxs)(`li`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap`,"data-tick-time":e.value,style:e.alignment===`start`?{left:0}:e.alignment===`end`?{right:0}:{left:`${F(e.value)}%`,transform:`translateX(-50%)`},children:[(0,B.jsx)(`span`,{children:e.clock}),(0,B.jsx)(`span`,{children:e.offset})]},e.value))})]})]})}var on=Object.defineProperty,sn=(e,t)=>on(e,`name`,{value:t,configurable:!0});function cn(e,t){let n=z.createContext(t);n.displayName=e+`Context`;let r=sn(e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=z.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return sn(i,`useContext`),[r,i]}sn(cn,`createContext`);function ln(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=sn(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,B.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=z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return sn(s,`useContext`),[o,s]}sn(r,`createContext`);let i=sn(()=>{let t=n.map(e=>z.createContext(e));return sn(function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,un(i,...t)]}sn(ln,`createContextScope`);function un(...e){let t=e[0];if(e.length===1)return t;let n=sn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return sn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}sn(un,`composeContextScopes`);var dn=Object.defineProperty,fn=(e,t)=>dn(e,`name`,{value:t,configurable:!0});function pn(e){let t=e+`CollectionProvider`,[n,r]=ln(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=fn(e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=p(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,m=p(u),h=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=f(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(m,{[d]:``,ref:s,children:r})});h.displayName=u;function g(t){let n=a(e+`CollectionConsumer`,t);return z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return fn(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}fn(pn,`createCollection`);var mn=new WeakMap,hn=class e extends Map{static{fn(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],mn.set(this,!0)}set(e,t){return mn.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=vn(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=gn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=gn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return gn(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 gn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=_n(e,t);return n===-1?void 0:e[n]}fn(gn,`at`);function _n(e,t){let n=e.length,r=vn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}fn(_n,`toSafeIndex`);function vn(e){return e!==e||e===0?0:Math.trunc(e)}fn(vn,`toSafeInteger`);function yn(e){let t=e+`CollectionProvider`,[n,r]=ln(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new hn,setItemMap:fn(()=>void 0,`setItemMap`)}),o=fn(({state:e,...t})=>e?(0,B.jsx)(c,{...t,state:e}):(0,B.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=fn(e=>{let t=_();return(0,B.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=fn(e=>{let{scope:t,children:n,state:r}=e,a=z.useRef(null),[o,s]=z.useState(null),c=f(a,s),[l,u]=r;return z.useEffect(()=>{if(!o)return;let e=Cn(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,B.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=p(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(l,n).collectionRef);return(0,B.jsx)(u,{ref:i,children:r})});d.displayName=l;let m=e+`CollectionItemSlot`,h=p(m),g=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),[s,c]=z.useState(null),l=f(t,o,c),{setItemMap:u}=a(m,n),d=z.useRef(i);bn(d.current,i)||(d.current=i);let p=d.current;return z.useEffect(()=>{let e=p;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Sn):(t.set(s,{...e,element:s}),t.toSorted(Sn)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new hn(e)))}},[s,p,u]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=m;function _(){return z.useState(new hn)}fn(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return fn(v,`useCollection`),[{Provider:o,Slot:d,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}fn(yn,`createCollection`);function bn(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}fn(bn,`shallowEqual`);function xn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}fn(xn,`isElementPreceding`);function Sn(e,t){return!e[1].element||!t[1].element?0:xn(e[1].element,t[1].element)?-1:1}fn(Sn,`sortByDocumentPosition`);function Cn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}fn(Cn,`getChildListObserver`);var wn=Object.defineProperty,Tn=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),En=!!(typeof window<`u`&&window.document&&window.document.createElement);function Dn(e,t,{checkForDefaultPrevented:n=!0}={}){return Tn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Tn(Dn,`composeEventHandlers`);function On(e){if(!En)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Tn(On,`getOwnerWindow`);function kn(e){if(!En)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Tn(kn,`getOwnerDocument`);function An(e,t=!1){let{activeElement:n}=kn(e);if(!n?.nodeName)return null;if(jn(n)&&n.contentDocument)return An(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=kn(n).getElementById(e);if(t)return t}}return n}Tn(An,`getActiveElement`);function jn(e){return e.tagName===`IFRAME`}Tn(jn,`isFrame`);var Mn=globalThis?.document?z.useLayoutEffect:()=>{},Nn=Object.defineProperty,Pn=(e,t)=>Nn(e,`name`,{value:t,configurable:!0}),Fn=z.useEffectEvent,In=z.useInsertionEffect;function Ln(e){if(typeof Fn==`function`)return Fn(e);let t=z.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof In==`function`?In(()=>{t.current=e}):Mn(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}Pn(Ln,`useEffectEvent`);var Rn=Object.defineProperty,zn=(e,t)=>Rn(e,`name`,{value:t,configurable:!0}),Bn=z.useInsertionEffect||Mn;function Vn({prop:e,defaultProp:t,onChange:n=zn(()=>{},`onChange`),caller:r}){let[i,a,o]=Hn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,z.useCallback(t=>{if(s){let n=Un(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}zn(Vn,`useControllableState`);function Hn({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Bn(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}zn(Hn,`useUncontrolledState`);function Un(e){return typeof e==`function`}zn(Un,`isFunction`);var Wn=Symbol(`RADIX:SYNC_STATE`);function Gn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ln(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=z.useReducer((t,n)=>{if(n.type===Wn)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=z.useRef(p);z.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=z.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return z.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Wn,state:i})},[i,d.state,c]),[h,f]}zn(Gn,`useControllableStateReducer`);var Kn=s(I(),1),qn=Object.defineProperty,Jn=(e,t)=>qn(e,`name`,{value:t,configurable:!0}),Yn=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=p(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xn(e,t){e&&Kn.flushSync(()=>e.dispatchEvent(t))}Jn(Xn,`dispatchDiscreteCustomEvent`);var Zn=Object.defineProperty,Qn=(e,t)=>Zn(e,`name`,{value:t,configurable:!0});function $n(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}Qn($n,`useStateMachine`);var er=Qn(e=>{let{present:t,children:n}=e,r=tr(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=rr(r.ref,ar(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null},`Presence`);function tr(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),o=z.useRef(void 0),[s,c]=$n(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{s===`mounted`?(a.current=o.current??ir(r.current),o.current=void 0):a.current=`none`},[s]),Mn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ir(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]),Mn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Qn(a=>{let o=ir(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=Qn(e=>{e.target===t&&(a.current=ir(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:z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ir(t)}else r.current=null;n(e)},[])}}Qn(tr,`usePresence`);function nr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qn(nr,`setRef`);function rr(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=nr(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():nr(n[e],null)}}},[])}Qn(rr,`useStableComposedRefs`);function ir(e){return e?.animationName||`none`}Qn(ir,`getAnimationName`);function ar(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)}Qn(ar,`getElementRef`);var or=Object.defineProperty,sr=(e,t)=>or(e,`name`,{value:t,configurable:!0}),cr=z.useId||(()=>void 0),lr=0;function ur(e){let[t,n]=z.useState(cr());return Mn(()=>{e||n(e=>e??String(lr++))},[e]),e||(t?`radix-${t}`:``)}sr(ur,`useId`);var dr=Object.defineProperty,fr=(e,t)=>dr(e,`name`,{value:t,configurable:!0}),pr=`Collapsible`,[mr,hr]=ln(pr),[gr,_r]=mr(pr),vr=z.forwardRef(fr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Vn({prop:r,defaultProp:i??!1,onChange:o,caller:pr});return(0,B.jsx)(gr,{scope:n,disabled:a,contentId:ur(),open:c,onOpenToggle:z.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(Yn.div,{"data-state":wr(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),yr=`CollapsibleTrigger`,br=z.forwardRef(fr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=_r(yr,n);return(0,B.jsx)(Yn.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":wr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Dn(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),xr=`CollapsibleContent`,Sr=z.forwardRef(fr(function(e,t){let{forceMount:n,...r}=e,i=_r(xr,e.__scopeCollapsible);return(0,B.jsx)(er,{present:n||i.open,children:({present:e})=>(0,B.jsx)(Cr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Cr=z.forwardRef(fr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=_r(xr,n),[s,c]=z.useState(r),l=z.useRef(null),u=f(t,l),d=z.useRef(0),p=d.current,m=z.useRef(0),h=m.current,g=o.open||s,_=z.useRef(g),v=z.useRef(void 0);return z.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Mn(()=>{let e=l.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();d.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,B.jsx)(Yn.div,{"data-state":wr(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,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 wr(e){return e?`open`:`closed`}fr(wr,`getState`);var Tr=vr,Er=br,Dr=Sr,Or=Object.defineProperty,kr=(e,t)=>Or(e,`name`,{value:t,configurable:!0}),Ar=z.createContext(void 0);function jr(e){let t=z.useContext(Ar);return e||t||`ltr`}kr(jr,`useDirection`);var Mr=Object.defineProperty,Nr=(e,t)=>Mr(e,`name`,{value:t,configurable:!0}),Pr=`Accordion`,Fr=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[Ir,Lr,Rr]=pn(Pr),[zr,Br]=ln(Pr,[Rr,hr]),Vr=hr(),Hr=z.forwardRef(Nr(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(Ir.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(Jr,{...a,ref:t}):(0,B.jsx)(qr,{...i,ref:t})})},`Accordion`)),[Ur,Wr]=zr(Pr),[Gr,Kr]=zr(Pr,{collapsible:!1}),qr=z.forwardRef(Nr(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Nr(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=Vn({prop:n,defaultProp:r??``,onChange:i,caller:Pr});return(0,B.jsx)(Ur,{scope:e.__scopeAccordion,value:z.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:z.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(Gr,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(Zr,{...o,ref:t})})})},`AccordionImplSingle`)),Jr=z.forwardRef(Nr(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Nr(()=>{},`onValueChange`),...a}=e,[o,s]=Vn({prop:n,defaultProp:r??[],onChange:i,caller:Pr}),c=z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(Ur,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(Gr,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(Zr,{...a,ref:t})})})},`AccordionImplMultiple`)),[Yr,Xr]=zr(Pr),Zr=z.forwardRef(Nr(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=f(z.useRef(null),t),c=Lr(n),l=jr(i)===`ltr`,u=Dn(e.onKeyDown,e=>{if(!Fr.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=Nr(()=>{o=r+1,o>s&&(o=0)},`moveNext`),d=Nr(()=>{o=r-1,o<0&&(o=s)},`movePrev`);switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(Yr,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(Ir.Slot,{scope:n,children:(0,B.jsx)(Yn.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})},`AccordionImpl`)),Qr=`AccordionItem`,[$r,ei]=zr(Qr),ti=z.forwardRef(Nr(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=Xr(Qr,n),o=Wr(Qr,n),s=Vr(n),c=ur(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)($r,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Tr,{"data-orientation":a.orientation,"data-state":ci(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),ni=`AccordionHeader`,ri=z.forwardRef(Nr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Xr(Pr,n),a=ei(ni,n);return(0,B.jsx)(Yn.h3,{"data-orientation":i.orientation,"data-state":ci(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),ii=`AccordionTrigger`,ai=z.forwardRef(Nr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Xr(Pr,n),a=ei(ii,n),o=Kr(ii,n),s=Vr(n);return(0,B.jsx)(Ir.ItemSlot,{scope:n,children:(0,B.jsx)(Er,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),oi=`AccordionContent`,si=z.forwardRef(Nr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Xr(Pr,n),a=ei(oi,n),o=Vr(n);return(0,B.jsx)(Dr,{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 ci(e){return e?`open`:`closed`}Nr(ci,`getState`);var li=Hr,ui=ti,di=ri,fi=ai,pi=si;function mi({...e}){return(0,B.jsx)(li,{"data-slot":`accordion`,...e})}function hi({className:e,...t}){return(0,B.jsx)(ui,{"data-slot":`accordion-item`,className:k(`border-b last:border-b-0`,e),...t})}function gi({className:e,children:t,...n}){return(0,B.jsx)(di,{className:`flex`,children:(0,B.jsxs)(fi,{"data-slot":`accordion-trigger`,className:k(`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,B.jsx)(We,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function _i({className:e,children:t,...n}){return(0,B.jsx)(pi,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,B.jsx)(`div`,{className:k(`pt-0 pb-4`,e),children:t})})}var vi=D(`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 yi({className:e,variant:t,...n}){return(0,B.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:k(vi({variant:t}),e),...n})}function bi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-title`,className:k(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function xi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-description`,className:k(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Si=Object.defineProperty,Ci=(e,t)=>Si(e,`name`,{value:t,configurable:!0});function wi(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ci(wi,`useCallbackRef`);var Ti=Object.defineProperty,Ei=(e,t)=>Ti(e,`name`,{value:t,configurable:!0}),Di=`Avatar`,[Oi,ki]=ln(Di),Ai=[0,()=>void 0],[ji,Mi]=Oi(Di),Ni=z.forwardRef(Ei(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=z.useState(`idle`),[o,s]=Ri();return(0,B.jsx)(ji,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,B.jsx)(Yn.span,{...r,ref:t})})},`Avatar`)),Pi=`AvatarFallback`,Fi=z.forwardRef(Ei(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Mi(Pi,n),[o,s]=z.useState(r===void 0);return z.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,B.jsx)(Yn.span,{...i,ref:t}):null},`AvatarFallback`));function Ii(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Mn(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Ei(e=>{let t=e.currentTarget;n(Li(t))},`handleLoad`),o=Ei(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Li(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Ei(Ii,`useImageLoadingStatus`);function Li(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Ei(Li,`getImageLoadingStatus`);function Ri(){return Ai}Ei(Ri,`useImageCount`);function zi(e){}Ei(zi,`useUpdateImageCount`);function Bi({className:e,size:t=`default`,...n}){return(0,B.jsx)(Ni,{"data-slot":`avatar`,"data-size":t,className:k(`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 Vi({className:e,...t}){return(0,B.jsx)(Fi,{"data-slot":`avatar-fallback`,className:k(`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 Hi({className:e,...t}){return(0,B.jsx)(`img`,{className:k(`aspect-square size-full object-cover`,e),"data-slot":`avatar-image`,...t})}var Ui=D(`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 Wi({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?l:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:k(Ui({variant:t,size:n,className:e})),...i})}function Gi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card`,className:k(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function Ki({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-6`,e),...t})}var qi=Object.defineProperty,Ji=(e,t)=>qi(e,`name`,{value:t,configurable:!0}),Yi=`dismissableLayer.update`,Xi=`dismissableLayer.pointerDownOutside`,Zi=`dismissableLayer.focusOutside`,Qi,$i=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ea=z.forwardRef(Ji(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=z.useContext($i),[d,p]=z.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=z.useState({}),g=f(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=z.useRef(!1),w=ra(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=ia(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=d?b===_.length-1:!1,D=wi(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return z.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Qi=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),aa(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Qi))}},[d,m,n,u]),z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),aa())},[d,u]),z.useEffect(()=>{let e=Ji(()=>h({}),`handleUpdate`);return document.addEventListener(Yi,e),()=>document.removeEventListener(Yi,e)},[]),(0,B.jsx)(Yn.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Dn(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Dn(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Dn(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ta(){let e=z.useContext($i),[t,n]=z.useState(null);return z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ji(ta,`useDismissableLayerSurface`);var na=Ji(()=>!0,`IS_TRUE`);function ra(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=na}=t,s=wi(e),c=z.useRef(!1),l=z.useRef(!1),u=z.useRef(new Map),d=z.useRef(()=>{});return z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ji(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ji(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)}Ji(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ji(p,`handleInteractionBubble`);let m=Ji(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||oa(Xi,s,p,{discrete:!0})};if(Ji(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:Ji(()=>c.current=!0,`onPointerDownCapture`)}}Ji(ra,`usePointerDownOutside`);function ia(e,t=globalThis?.document){let n=wi(e),r=z.useRef(!1);return z.useEffect(()=>{let e=Ji(e=>{e.target&&!r.current&&oa(Zi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ji(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ji(()=>r.current=!1,`onBlurCapture`)}}Ji(ia,`useFocusOutside`);function aa(){let e=new CustomEvent(Yi);document.dispatchEvent(e)}Ji(aa,`dispatchUpdate`);function oa(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?Xn(i,a):i.dispatchEvent(a)}Ji(oa,`handleAndDispatchCustomEvent`);var sa=Object.defineProperty,ca=(e,t)=>sa(e,`name`,{value:t,configurable:!0}),la=`focusScope.autoFocusOnMount`,ua=`focusScope.autoFocusOnUnmount`,da={bubbles:!1,cancelable:!0},fa=z.forwardRef(ca(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=wi(i),u=wi(a),d=z.useRef(null),p=f(t,c),m=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ya(d.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ya(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ya(s)};ca(e,`handleFocusIn`),ca(t,`handleFocusOut`),ca(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),z.useEffect(()=>{if(s){ba.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(la,da);s.addEventListener(la,l),s.dispatchEvent(t),t.defaultPrevented||(pa(Ca(ha(s)),{select:!0}),document.activeElement===e&&ya(s))}return()=>{s.removeEventListener(la,l),setTimeout(()=>{let t=new CustomEvent(ua,da);s.addEventListener(ua,u),s.dispatchEvent(t),t.defaultPrevented||ya(e??document.body,{select:!0}),s.removeEventListener(ua,u),ba.remove(m)},0)}}},[s,l,u,m]);let h=z.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]=ma(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ya(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ya(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,B.jsx)(Yn.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function pa(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ya(r,{select:t}),document.activeElement!==n)return}ca(pa,`focusFirst`);function ma(e){let t=ha(e);return[ga(t,e),ga(t.reverse(),e)]}ca(ma,`getTabbableEdges`);function ha(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ca(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}ca(ha,`getTabbableCandidates`);function ga(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):_a(r,{upTo:t})))return r}ca(ga,`findVisible`);function _a(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}ca(_a,`isHidden`);function va(e){return e instanceof HTMLInputElement&&`select`in e}ca(va,`isSelectableInput`);function ya(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&va(e)&&t&&e.select()}}ca(ya,`focus`);var ba=xa();function xa(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Sa(e,t),e.unshift(t)},remove(t){e=Sa(e,t),e[0]?.resume()}}}ca(xa,`createFocusScopesStack`);function Sa(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ca(Sa,`arrayRemove`);function Ca(e){return e.filter(e=>e.tagName!==`A`)}ca(Ca,`removeLinks`);var wa=Object.defineProperty,Ta=z.forwardRef(((e,t)=>wa(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=z.useState(!1);Mn(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Kn.createPortal((0,B.jsx)(Yn.div,{...r,ref:t}),o):null},`Portal`)),Ea=Object.defineProperty,Da=(e,t)=>Ea(e,`name`,{value:t,configurable:!0}),Oa=0,ka=null;function Aa(e){return ja(),e.children}Da(Aa,`FocusGuards`);function ja(){z.useEffect(()=>{ka||={start:Ma(),end:Ma()};let{start:e,end:t}=ka;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Oa++,()=>{Oa===1&&(ka?.start.remove(),ka?.end.remove(),ka=null),Oa=Math.max(0,Oa-1)}},[])}Da(ja,`useFocusGuards`);function Ma(){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}Da(Ma,`createFocusGuard`);var Na=function(){return Na=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},Na.apply(this,arguments)};function Pa(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 Fa(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 Ia=`right-scroll-bar-position`,La=`width-before-scroll-bar`,Ra=`with-scroll-bars-hidden`,za=`--removed-body-scroll-bar-size`;function Ba(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Va(e,t){var n=(0,z.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 Ha=typeof window<`u`?z.useLayoutEffect:z.useEffect,Ua=new WeakMap;function Wa(e,t){var n=Va(t||null,function(t){return e.forEach(function(e){return Ba(e,t)})});return Ha(function(){var t=Ua.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ba(e,null)}),i.forEach(function(e){r.has(e)||Ba(e,a)})}Ua.set(n,e)},[e]),n}function Ga(e){return e}function Ka(e,t){t===void 0&&(t=Ga);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 qa(e){e===void 0&&(e={});var t=Ka(null);return t.options=Na({async:!0,ssr:!1},e),t}var Ja=function(e){var t=e.sideCar,n=Pa(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 z.createElement(r,Na({},n))};Ja.isSideCarExport=!0;function Ya(e,t){return e.useMedium(t),Ja}var Xa=qa(),Za=function(){},Qa=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Za,onWheelCapture:Za,onTouchMoveCapture:Za}),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=Pa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Wa([n,t]),C=Na(Na({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:Xa,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),Na(Na({},C),{ref:S})):z.createElement(v,Na({},C,{className:c,ref:S}),s))});Qa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qa.classNames={fullWidth:La,zeroRight:Ia};var $a,eo=function(){if($a)return $a;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function to(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=eo();return t&&e.setAttribute(`nonce`,t),e}function no(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ro(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var io=function(){var e=0,t=null;return{add:function(n){e==0&&(t=to())&&(no(t,n),ro(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ao=function(){var e=io();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oo=function(){var e=ao();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},so={left:0,top:0,right:0,gap:0},co=function(e){return parseInt(e||``,10)||0},lo=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[co(n),co(r),co(i)]},uo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return so;var t=lo(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])}},fo=oo(),po=`data-scroll-locked`,mo=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
+ .${Ra} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
5
5
  }
6
- body[${lo}] {
6
+ body[${po}] {
7
7
  overflow: hidden ${r};
8
8
  overscroll-behavior: contain;
9
9
  ${[t&&`position: relative ${r};`,n===`margin`&&`
@@ -16,51 +16,51 @@ import{$ as e,A as t,B as n,C as r,Ct as i,D as a,E as o,Et as s,F as c,G as l,H
16
16
  `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
17
  }
18
18
 
19
- .${Na} {
19
+ .${Ia} {
20
20
  right: ${s}px ${r};
21
21
  }
22
22
 
23
- .${Pa} {
23
+ .${La} {
24
24
  margin-right: ${s}px ${r};
25
25
  }
26
26
 
27
- .${Na} .${Na} {
27
+ .${Ia} .${Ia} {
28
28
  right: 0 ${r};
29
29
  }
30
30
 
31
- .${Pa} .${Pa} {
31
+ .${La} .${La} {
32
32
  margin-right: 0 ${r};
33
33
  }
34
34
 
35
- body[${lo}] {
36
- ${Ia}: ${s}px;
35
+ body[${po}] {
36
+ ${za}: ${s}px;
37
37
  }
38
- `},fo=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},po=function(){z.useEffect(function(){return document.body.setAttribute(lo,(fo()+1).toString()),function(){var e=fo()-1;e<=0?document.body.removeAttribute(lo):document.body.setAttribute(lo,e.toString())}},[])},mo=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;po();var a=z.useMemo(function(){return so(i)},[i]);return z.createElement(co,{styles:uo(a,!t,i,n?``:`!important`)})},ho=!1;if(typeof window<`u`)try{var go=Object.defineProperty({},"passive",{get:function(){return ho=!0,!0}});window.addEventListener(`test`,go,go),window.removeEventListener(`test`,go,go)}catch{ho=!1}var _o=ho?{passive:!1}:!1,vo=function(e){return e.tagName===`TEXTAREA`},yo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!vo(e)&&n[t]===`visible`)},bo=function(e){return yo(e,`overflowY`)},xo=function(e){return yo(e,`overflowX`)},So=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),To(e,r)){var i=Eo(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Co=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},wo=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},To=function(e,t){return e===`v`?bo(t):xo(t)},Eo=function(e,t){return e===`v`?Co(t):wo(t)},Do=function(e,t){return e===`h`&&t===`rtl`?-1:1},Oo=function(e,t,n,r,i){var a=Do(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=Eo(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&To(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},ko=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ao=function(e){return[e.deltaX,e.deltaY]},jo=function(e){return e&&`current`in e?e.current:e},Mo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},No=function(e){return`
38
+ `},ho=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},go=function(){z.useEffect(function(){return document.body.setAttribute(po,(ho()+1).toString()),function(){var e=ho()-1;e<=0?document.body.removeAttribute(po):document.body.setAttribute(po,e.toString())}},[])},_o=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;go();var a=z.useMemo(function(){return uo(i)},[i]);return z.createElement(fo,{styles:mo(a,!t,i,n?``:`!important`)})},vo=!1;if(typeof window<`u`)try{var yo=Object.defineProperty({},"passive",{get:function(){return vo=!0,!0}});window.addEventListener(`test`,yo,yo),window.removeEventListener(`test`,yo,yo)}catch{vo=!1}var bo=vo?{passive:!1}:!1,xo=function(e){return e.tagName===`TEXTAREA`},So=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!xo(e)&&n[t]===`visible`)},Co=function(e){return So(e,`overflowY`)},wo=function(e){return So(e,`overflowX`)},To=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Oo(e,r)){var i=ko(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Eo=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Do=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Oo=function(e,t){return e===`v`?Co(t):wo(t)},ko=function(e,t){return e===`v`?Eo(t):Do(t)},Ao=function(e,t){return e===`h`&&t===`rtl`?-1:1},jo=function(e,t,n,r,i){var a=Ao(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=ko(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Oo(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},Mo=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},No=function(e){return[e.deltaX,e.deltaY]},Po=function(e){return e&&`current`in e?e.current:e},Fo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Io=function(e){return`
39
39
  .block-interactivity-${e} {pointer-events: none;}
40
40
  .allow-interactivity-${e} {pointer-events: all;}
41
- `},Po=0,Fo=[];function Io(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(Po++)[0],a=z.useState(ro)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ma([e.lockRef.current],(e.shards||[]).map(jo),!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=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ko(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=So(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=So(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 Oo(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!Fo.length||Fo[Fo.length-1]!==a)){var r=`deltaY`in n?Ao(n):ko(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Mo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(jo).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=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Lo(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=ko(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,Ao(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,ko(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return Fo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,_o),document.addEventListener(`touchmove`,c,_o),document.addEventListener(`touchstart`,u,_o),function(){Fo=Fo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,_o),document.removeEventListener(`touchmove`,c,_o),document.removeEventListener(`touchstart`,u,_o)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:No(i)}):null,p?z.createElement(mo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Lo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ro=Ka(qa,Io),zo=z.forwardRef(function(e,t){return z.createElement(Ya,Aa({},e,{ref:t,sideCar:Ro}))});zo.classNames=Ya.classNames;var Bo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Vo=new WeakMap,Ho=new WeakMap,Uo={},Wo=0,Go=function(e){return e&&(e.host||Go(e.parentNode))},Ko=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Go(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})},qo=function(e,t,n,r){var i=Ko(t,Array.isArray(e)?e:[e]);Uo[n]||(Uo[n]=new WeakMap);var a=Uo[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=(Vo.get(e)||0)+1,l=(a.get(e)||0)+1;Vo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ho.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(),Wo++,function(){o.forEach(function(e){var t=Vo.get(e)-1,i=a.get(e)-1;Vo.set(e,t),a.set(e,i),t||(Ho.has(e)||e.removeAttribute(r),Ho.delete(e)),i||e.removeAttribute(n)}),Wo--,Wo||(Vo=new WeakMap,Vo=new WeakMap,Ho=new WeakMap,Uo={})}},Jo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Bo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),qo(r,i,n,`aria-hidden`)):function(){return null}},Yo=Object.defineProperty,Xo=(e,t)=>Yo(e,`name`,{value:t,configurable:!0}),Zo=`Dialog`,[Qo,$o]=on(Zo),[es,ts]=Qo(Zo),ns=Xo(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=Rn({prop:r,defaultProp:i??!1,onChange:a,caller:Zo}),[d,f]=z.useState(0),[p,m]=z.useState(0);return(0,B.jsx)(es,{scope:t,triggerRef:s,contentRef:c,contentId:sr(),titleId:sr(),descriptionId:sr(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),rs=`DialogPortal`,[is,as]=Qo(rs,{forceMount:void 0}),os=Xo(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ts(rs,t);return(0,B.jsx)(is,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,B.jsx)(Zn,{present:n||a.open,children:(0,B.jsx)(Sa,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ss=`DialogOverlay`,cs=z.forwardRef(Xo(function(e,t){let n=as(ss,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ts(ss,e.__scopeDialog);return a.modal?(0,B.jsx)(Zn,{present:r||a.open,children:(0,B.jsx)(us,{...i,ref:t})}):null},`DialogOverlay`)),ls=p(`DialogOverlay.RemoveScroll`),us=z.forwardRef(Xo(function(e,t){let{__scopeDialog:n,...r}=e,i=ts(ss,n),a=f(t,Qi());return(0,B.jsx)(zo,{as:ls,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(Kn.div,{"data-state":Ss(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ds=`DialogContent`,fs=z.forwardRef(Xo(function(e,t){let n=as(ds,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ts(ds,e.__scopeDialog);return(0,B.jsx)(Zn,{present:r||a.open,children:a.modal?(0,B.jsx)(ps,{...i,ref:t}):(0,B.jsx)(ms,{...i,ref:t})})},`DialogContent`)),ps=z.forwardRef(Xo(function(e,t){let n=ts(ds,e.__scopeDialog),r=z.useRef(null),i=f(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return Jo(e)},[]),(0,B.jsx)(hs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:wn(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:wn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:wn(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ms=z.forwardRef(Xo(function(e,t){let n=ts(ds,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,B.jsx)(hs,{...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`)),hs=z.forwardRef(Xo(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ts(ds,n);return Oa(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(la,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Zi,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ss(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),gs=`DialogTitle`,_s=z.forwardRef(Xo(function(e,t){let{__scopeDialog:n,...r}=e,i=ts(gs,n),{setTitleCount:a}=i;return kn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(Kn.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),vs=`DialogDescription`,ys=z.forwardRef(Xo(function(e,t){let{__scopeDialog:n,...r}=e,i=ts(vs,n),{setDescriptionCount:a}=i;return kn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(Kn.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),bs=`DialogClose`,xs=z.forwardRef(Xo(function(e,t){let{__scopeDialog:n,...r}=e,i=ts(bs,n);return(0,B.jsx)(Kn.button,{type:`button`,...r,ref:t,onClick:wn(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ss(e){return e?`open`:`closed`}Xo(Ss,`getState`);function Cs({...e}){return(0,B.jsx)(ns,{"data-slot":`dialog`,...e})}function ws({...e}){return(0,B.jsx)(os,{"data-slot":`dialog-portal`,...e})}function Ts({...e}){return(0,B.jsx)(xs,{"data-slot":`dialog-close`,...e})}function Es({className:e,...t}){return(0,B.jsx)(cs,{"data-slot":`dialog-overlay`,className:k(`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 Ds({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(ws,{"data-slot":`dialog-portal`,children:[(0,B.jsx)(Es,{}),(0,B.jsxs)(fs,{"data-slot":`dialog-content`,className:k(`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,B.jsxs)(xs,{"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,B.jsx)(Dt,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Os({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:k(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function ks({className:e,showCloseButton:t=!1,children:n,...r}){return(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:k(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,B.jsx)(xs,{asChild:!0,children:(0,B.jsx)(Vi,{variant:`outline`,children:`Close`})})]})}function As({className:e,...t}){return(0,B.jsx)(_s,{"data-slot":`dialog-title`,className:k(`text-lg leading-none font-semibold`,e),...t})}function js({className:e,...t}){return(0,B.jsx)(ys,{"data-slot":`dialog-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function Ms({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:k(`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 Ns=Object.defineProperty,Ps=z.forwardRef(((e,t)=>Ns(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,B.jsx)(Kn.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 Fs({className:e,...t}){return(0,B.jsx)(Ps,{"data-slot":`label`,className:k(`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 Is=[`top`,`right`,`bottom`,`left`],Ls=Math.min,Rs=Math.max,zs=Math.round,Bs=Math.floor,Vs=e=>({x:e,y:e}),Hs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Us(e,t,n){return Rs(e,Ls(t,n))}function Ws(e,t){return typeof e==`function`?e(t):e}function Gs(e){return e.split(`-`)[0]}function Ks(e){return e.split(`-`)[1]}function qs(e){return e===`x`?`y`:`x`}function Js(e){return e===`y`?`height`:`width`}function Ys(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Xs(e){return qs(Ys(e))}function Zs(e,t,n){n===void 0&&(n=!1);let r=Ks(e),i=Xs(e),a=Js(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=oc(o)),[o,oc(o)]}function Qs(e){let t=oc(e);return[$s(e),t,$s(t)]}function $s(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ec=[`left`,`right`],tc=[`right`,`left`],nc=[`top`,`bottom`],rc=[`bottom`,`top`];function ic(e,t,n){switch(e){case`top`:case`bottom`:return n?t?tc:ec:t?ec:tc;case`left`:case`right`:return t?nc:rc;default:return[]}}function ac(e,t,n,r){let i=Ks(e),a=ic(Gs(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($s)))),a}function oc(e){let t=Gs(e);return Hs[t]+e.slice(t.length)}function sc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function cc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:sc(e)}function lc(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 uc(e,t,n){let{reference:r,floating:i}=e,a=Ys(t),o=Xs(t),s=Js(o),c=Gs(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=Ks(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function dc(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}=Ws(t,e),p=cc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=lc(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=lc(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 fc=50,pc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:dc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=uc(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<fc&&(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}=uc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},mc=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}=Ws(e,t)||{};if(l==null)return{};let d=cc(u),f={x:n,y:r},p=Xs(i),m=Js(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=Ls(d[_],T),D=Ls(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Us(E,k,O),j=!c.arrow&&Ks(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}}}),hc=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}=Ws(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Gs(r),_=Ys(o),v=Gs(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[oc(o)]:Qs(o)),x=p!==`none`;!d&&x&&b.push(...ac(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=Zs(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`&&_!==Ys(t))||T.every(e=>Ys(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=Ys(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 gc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _c(e){return Is.some(t=>e[t]>=0)}var vc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ws(e,t);switch(i){case`referenceHidden`:{let e=gc(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_c(e)}}}case`escaped`:{let e=gc(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:_c(e)}}}default:return{}}}}},yc=new Set([`left`,`top`]);async function bc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Gs(n),s=Ks(n),c=Ys(n)===`y`,l=yc.has(o)?-1:1,u=a&&c?-1:1,d=Ws(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 xc=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 bc(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}}}}},Sc=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}=Ws(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ys(i),p=qs(f),m=u[p],h=u[f],g=(e,t)=>Us(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}}}}}},Cc=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}=Ws(e,t),u={x:n,y:r},d=Ys(i),f=qs(d),p=u[f],m=u[d],h=Ws(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=yc.has(Gs(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}}}},wc=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}=Ws(e,t),c=await i.detectOverflow(t,s),l=Gs(n),u=Ks(n),d=Ys(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=Ls(p-c[m],g),y=Ls(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*Rs(c.left,c.right):S=p-2*Rs(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 Tc(){return typeof window<`u`}function Ec(e){return kc(e)?(e.nodeName||``).toLowerCase():`#document`}function Dc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Oc(e){return((kc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function kc(e){return Tc()?e instanceof Node||e instanceof Dc(e).Node:!1}function Ac(e){return Tc()?e instanceof Element||e instanceof Dc(e).Element:!1}function jc(e){return Tc()?e instanceof HTMLElement||e instanceof Dc(e).HTMLElement:!1}function Mc(e){return!Tc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Dc(e).ShadowRoot}function Nc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Pc(e){return/^(table|td|th)$/.test(Ec(e))}function Fc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ic=/transform|translate|scale|rotate|perspective|filter/,Lc=/paint|layout|strict|content/,Rc=e=>!!e&&e!==`none`,zc;function Bc(e){let t=Ac(e)?Wc(e):e;return Rc(t.transform)||Rc(t.translate)||Rc(t.scale)||Rc(t.rotate)||Rc(t.perspective)||!Hc()&&(Rc(t.backdropFilter)||Rc(t.filter))||Ic.test(t.willChange||``)||Lc.test(t.contain||``)}function Vc(e){let t=Kc(e);for(;jc(t)&&!Uc(t);){if(Bc(t))return t;if(Fc(t))return null;t=Kc(t)}return null}function Hc(){return zc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zc}function Uc(e){return/^(html|body|#document)$/.test(Ec(e))}function Wc(e){return Dc(e).getComputedStyle(e)}function Gc(e){return Ac(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kc(e){if(Ec(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mc(e)&&e.host||Oc(e);return Mc(t)?t.host:t}function qc(e){let t=Kc(e);return Uc(t)?(e.ownerDocument||e).body:jc(t)&&Nc(t)?t:qc(t)}function Jc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qc(e),i=r===e.ownerDocument?.body,a=Dc(r);if(i){let e=Yc(a);return t.concat(a,a.visualViewport||[],Nc(r)?r:[],e&&n?Jc(e):[])}else return t.concat(r,Jc(r,[],n))}function Yc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xc(e){let t=Wc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=jc(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 Zc(e){return Ac(e)?e:e.contextElement}function Qc(e){let t=Zc(e);if(!jc(t))return Vs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xc(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 $c=Vs(0);function el(e){let t=Dc(e);return!Hc()||!t.visualViewport?$c:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Dc(e)}function nl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Zc(e),o=Vs(1);t&&(r?Ac(r)&&(o=Qc(r)):o=Qc(e));let s=tl(a,n,r)?el(a):Vs(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=Dc(a),t=Ac(r)?Dc(r):r,n=e,i=Yc(n);for(;i&&t!==n;){let e=Qc(i),t=i.getBoundingClientRect(),r=Wc(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=Dc(i),i=Yc(n)}}return lc({width:u,height:d,x:c,y:l})}function rl(e,t){let n=Gc(e).scrollLeft;return t?t.left+n:nl(Oc(e)).left+n}function il(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-rl(e,n),y:n.top+t.scrollTop}}function al(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Oc(r),s=t?Fc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Vs(1),u=Vs(0),d=jc(r);if((d||!a)&&((Ec(r)!==`body`||Nc(o))&&(c=Gc(r)),d)){let e=nl(r);l=Qc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?il(o,c):Vs(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 ol(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sl(e){let t=Gc(e),n=e.ownerDocument.body,r=Rs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Rs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+rl(e),o=-t.scrollTop;return Wc(n).direction===`rtl`&&(a+=Rs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var cl=25;function ll(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Dc(e),a=Oc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Hc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(rl(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<=cl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ul(e,t){let n=nl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function dl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ll(e,n,t);else if(t===`document`)r=sl(Oc(e));else if(Ac(t))r=ul(t,n);else{let n=el(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lc(r)}function fl(e,t){let n=t.get(e);if(n)return n;let r=Jc(e,[],!1).filter(e=>Ac(e)&&Ec(e)!==`body`),i=null,a=Wc(e).position===`fixed`,o=a?Kc(e):e;for(;Ac(o)&&!Uc(o);){let e=Wc(o),t=Bc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Kc(o)}return t.set(e,r),r}function pl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Fc(t)?[]:fl(t,this._c):[].concat(n),r],o=dl(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=dl(t,a[e],i);s=Rs(n.top,s),c=Ls(n.right,c),l=Ls(n.bottom,l),u=Rs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ml(e){let{width:t,height:n}=Xc(e);return{width:t,height:n}}function hl(e,t,n){let r=jc(t),i=Oc(t),a=n===`fixed`,o=nl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Vs(0);if((r||!a)&&((Ec(t)!==`body`||Nc(i))&&(s=Gc(t)),r)){let e=nl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=rl(i));let l=i&&!r&&!a?il(i,s):Vs(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 gl(e){return Wc(e).position===`static`}function _l(e,t){if(!jc(e)||Wc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Oc(e)===n&&(n=n.ownerDocument.body),n}function vl(e,t){let n=Dc(e);if(Fc(e))return n;if(!jc(e)){let t=Kc(e);for(;t&&!Uc(t);){if(Ac(t)&&!gl(t))return t;t=Kc(t)}return n}let r=_l(e,t);for(;r&&Pc(r)&&gl(r);)r=_l(r,t);return r&&Uc(r)&&gl(r)&&!Bc(r)?n:r||Vc(e)||n}var yl=async function(e){let t=this.getOffsetParent||vl,n=this.getDimensions,r=await n(e.floating);return{reference:hl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bl(e){return Wc(e).direction===`rtl`}var xl={convertOffsetParentRelativeRectToViewportRelativeRect:al,getDocumentElement:Oc,getClippingRect:pl,getOffsetParent:vl,getElementRects:yl,getClientRects:ol,getDimensions:ml,getScale:Qc,isElement:Ac,isRTL:bl};function Sl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cl(e,t,n){let r=null,i,a=Oc(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=Bs(d),h=Bs(a.clientWidth-(u+f)),g=Bs(a.clientHeight-(d+p)),_=Bs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Rs(0,Ls(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Sl(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=Dc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function wl(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=Zc(e),u=i||a?[...l?Jc(l):[],...t?Jc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Cl(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?nl(e):null;c&&g();function g(){let t=nl(e);h&&!Sl(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 Tl=xc,El=Sc,Dl=hc,Ol=wc,kl=vc,Al=mc,jl=Cc,Ml=(e,t,n)=>{let r=new Map,i=n??{},a={...xl,...i.platform,_c:r};return pc(e,t,{...i,platform:a})},Nl=typeof document<`u`?z.useLayoutEffect:function(){};function Pl(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(!Pl(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)&&!Pl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Fl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Il(e,t){let n=Fl(e);return Math.round(t*n)/n}function Ll(e){let t=z.useRef(e);return Nl(()=>{t.current=e}),t}function Rl(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]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);Pl(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=Ll(c),D=Ll(i),O=Ll(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ml(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Pl(w.current,t)&&(w.current=t,Un.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Nl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);Nl(()=>(A.current=!0,()=>{A.current=!1}),[]),Nl(()=>{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=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Il(M.floating,u.x),r=Il(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Fl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.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?{}:Al({element:r.current,padding:i}).fn(n):r?Al({element:r,padding:i}).fn(n):{}}}},Bl=(e,t)=>{let n=Tl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vl=(e,t)=>{let n=El(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hl=(e,t)=>({fn:jl(e).fn,options:[e,t]}),Ul=(e,t)=>{let n=Dl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wl=(e,t)=>{let n=Ol(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gl=(e,t)=>{let n=kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kl=(e,t)=>{let n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ql=Object.defineProperty,Jl=z.forwardRef(((e,t)=>ql(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(Kn.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Yl=Object.defineProperty,Xl=(e,t)=>Yl(e,`name`,{value:t,configurable:!0});function Zl(e){let[t,n]=z.useState(void 0);return kn(()=>{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}Xl(Zl,`useSize`);var Ql=Object.defineProperty,$l=(e,t)=>Ql(e,`name`,{value:t,configurable:!0}),eu=`Popper`,[tu,nu]=on(eu),[ru,iu]=tu(eu),au=$l(e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null),[a,o]=z.useState(void 0);return(0,B.jsx)(ru,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),ou=`PopperAnchor`,su=z.forwardRef($l(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=iu(ou,n),o=z.useRef(null),s=a.onAnchorChange,c=f(t,z.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=z.useRef(null);z.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&_u(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,B.jsx)(Kn.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),cu=`PopperContent`,[lu,uu]=tu(cu),du=z.forwardRef($l(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=iu(cu,n),[v,y]=z.useState(null),b=f(t,y),[x,S]=z.useState(null),C=Zl(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(hu),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Rl({strategy:`fixed`,placement:E,whileElementsMounted:$l((...e)=>wl(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Bl({mainAxis:i+T,alignmentAxis:o}),c&&Vl({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Hl():void 0,...A}),c&&Ul({...A}),Wl({...A,apply:$l(({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&&Kl({element:x,padding:s}),gu({arrowWidth:w,arrowHeight:T}),p&&Gl({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=_.setPlacementState;kn(()=>(I(N),()=>{I(void 0)}),[N,I]);let[ee,L]=_u(N),te=xi(h);kn(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[ae,oe]=z.useState();return kn(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,B.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(lu,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,B.jsx)(Kn.div,{"data-side":ee,"data-align":L,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),fu=`PopperArrow`,pu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mu=z.forwardRef($l(function(e,t){let{__scopePopper:n,...r}=e,i=uu(fu,n),a=pu[i.placedSide];return(0,B.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,B.jsx)(Jl,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function hu(e){return e!==null}$l(hu,`isNotNull`);var gu=$l(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]=_u(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 _u(e){let[t,n=`center`]=e.split(`-`);return[t,n]}$l(_u,`getSideAndAlignFromPlacement`);var vu=au,yu=su,bu=du,xu=mu,Su=Object.defineProperty,Cu=(e,t)=>Su(e,`name`,{value:t,configurable:!0});function wu(e,[t,n]){return Math.min(n,Math.max(t,e))}Cu(wu,`clamp`);var Tu=Object.defineProperty,Eu=(e,t)=>Tu(e,`name`,{value:t,configurable:!0});function Du(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}Eu(Du,`useStateMachine`);var Ou=`ScrollArea`,[ku,Au]=on(Ou),[ju,Mu]=ku(Ou),Nu=z.forwardRef(Eu(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=z.useState(null),[l,u]=z.useState(null),[d,p]=z.useState(null),[m,h]=z.useState(null),[g,_]=z.useState(null),[v,y]=z.useState(0),[b,x]=z.useState(0),[S,C]=z.useState(!1),[w,T]=z.useState(!1),E=f(t,c),D=Or(i);return(0,B.jsx)(ju,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,B.jsx)(Kn.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),Pu=`ScrollAreaViewport`,Fu=z.forwardRef(Eu(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Mu(Pu,n),s=f(t,z.useRef(null),o.onViewportChange);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Iu,{nonce:i}),(0,B.jsx)(Kn.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,B.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),Iu=z.memo(Eu(function({nonce:e}){return(0,B.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),Lu=`ScrollAreaScrollbar`,Ru=z.forwardRef(Eu(function(e,t){let{forceMount:n,...r}=e,i=Mu(Lu,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return z.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,B.jsx)(zu,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,B.jsx)(Bu,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,B.jsx)(Vu,{...r,ref:t,forceMount:n}):i.type===`always`?(0,B.jsx)(Hu,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),zu=z.forwardRef(Eu(function(e,t){let{forceMount:n,...r}=e,i=Mu(Lu,e.__scopeScrollArea),[a,o]=z.useState(!1);return z.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=Eu(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=Eu(()=>{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,B.jsx)(Zn,{present:n||a,children:(0,B.jsx)(Vu,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),Bu=z.forwardRef(Eu(function(e,t){let{forceMount:n,...r}=e,i=Mu(Lu,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=cd(()=>c(`SCROLL_END`),100),[s,c]=Du(`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 z.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),z.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=Eu(()=>{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,B.jsx)(Zn,{present:n||s!==`hidden`,children:(0,B.jsx)(Hu,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:wn(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:wn(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),Vu=z.forwardRef(Eu(function(e,t){let n=Mu(Lu,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=z.useState(!1),s=e.orientation===`horizontal`,c=cd(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return ld(n.viewport,c),ld(n.content,c),(0,B.jsx)(Zn,{present:r||a,children:(0,B.jsx)(Hu,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),Hu=z.forwardRef(Eu(function(e,t){let{orientation:n=`vertical`,...r}=e,i=Mu(Lu,e.__scopeScrollArea),a=z.useRef(null),o=z.useRef(0),[s,c]=z.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=td(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:Eu(e=>a.current=e,`onThumbChange`),onThumbPointerUp:Eu(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:Eu(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return rd(e,o.current,s,t)}return Eu(d,`getScrollPosition`),n===`horizontal`?(0,B.jsx)(Uu,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=id(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,B.jsx)(Wu,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=id(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`)),Uu=z.forwardRef(Eu(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Mu(Lu,e.__scopeScrollArea),[o,s]=z.useState(),c=z.useRef(null),l=f(t,c,a.onScrollbarXChange);return z.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,B.jsx)(qu,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":nd(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),od(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:ed(o.paddingLeft),paddingEnd:ed(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),Wu=z.forwardRef(Eu(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Mu(Lu,e.__scopeScrollArea),[o,s]=z.useState(),c=z.useRef(null),l=f(t,c,a.onScrollbarYChange);return z.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,B.jsx)(qu,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":nd(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),od(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:ed(o.paddingTop),paddingEnd:ed(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[Gu,Ku]=ku(Lu),qu=z.forwardRef(Eu(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=e,m=Mu(Lu,n),[h,g]=z.useState(null),_=f(t,g),v=z.useRef(null),y=z.useRef(``),b=m.viewport,x=r.content-r.viewport,S=xi(u),C=xi(c),w=cd(d,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;l({x:t,y:n})}}return Eu(T,`handleDragScroll`),z.useEffect(()=>{let e=Eu(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]),z.useEffect(C,[r,C]),ld(h,w),ld(m.content,w),(0,B.jsx)(Gu,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:xi(a),onThumbPointerUp:xi(o),onThumbPositionChange:C,onThumbPointerDown:xi(s),children:(0,B.jsx)(Kn.div,{...p,ref:_,style:{position:`absolute`,...p.style},onPointerDown:wn(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:wn(e.onPointerMove,T),onPointerUp:wn(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`)),Ju=`ScrollAreaThumb`,Yu=z.forwardRef(Eu(function(e,t){let{forceMount:n,...r}=e,i=Ku(Ju,e.__scopeScrollArea);return(0,B.jsx)(Zn,{present:n||i.hasThumb,children:(0,B.jsx)(Xu,{ref:t,...r})})},`ScrollAreaThumb`)),Xu=z.forwardRef(Eu(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=Mu(Ju,n),o=Ku(Ju,n),{onThumbPositionChange:s}=o,c=f(t,o.onThumbChange),l=z.useRef(void 0),u=cd(()=>{l.current&&=(l.current(),void 0)},100);return z.useEffect(()=>{let e=a.viewport;if(e){let t=Eu(()=>{if(u(),!l.current){let t=sd(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,B.jsx)(Kn.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:wn(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:wn(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),Zu=`ScrollAreaCorner`,Qu=z.forwardRef(Eu(function(e,t){let n=Mu(Zu,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,B.jsx)($u,{...e,ref:t}):null},`ScrollAreaCorner`)),$u=z.forwardRef(Eu(function(e,t){let{__scopeScrollArea:n,...r}=e,i=Mu(Zu,n),[a,o]=z.useState(0),[s,c]=z.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return ld(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),ld(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),z.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,B.jsx)(Kn.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 ed(e){return e?parseInt(e,10):0}Eu(ed,`toInt`);function td(e,t){let n=e/t;return isNaN(n)?0:n}Eu(td,`getThumbRatio`);function nd(e){let t=td(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Eu(nd,`getThumbSize`);function rd(e,t,n,r=`ltr`){let i=nd(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 ad([c,l],d)(e)}Eu(rd,`getScrollPositionFromPointer`);function id(e,t,n=`ltr`){let r=nd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=wu(e,n===`ltr`?[0,o]:[o*-1,0]);return ad([0,o],[0,s])(c)}Eu(id,`getThumbOffsetFromScroll`);function ad(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])}}Eu(ad,`linearScale`);function od(e,t){return e>0&&e<t}Eu(od,`isScrollingWithinScrollbarBounds`);var sd=Eu((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Eu((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 cd(e,t){let n=xi(e),r=z.useRef(0);return z.useEffect(()=>()=>window.clearTimeout(r.current),[]),z.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Eu(cd,`useDebounceCallback`);function ld(e,t){let n=xi(t);kn(()=>{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])}Eu(ld,`useResizeObserver`);var ud=Nu,dd=Fu,fd=Qu;function pd({className:e,children:t,...n}){return(0,B.jsxs)(ud,{"data-slot":`scroll-area`,className:k(`relative`,e),...n,children:[(0,B.jsx)(dd,{"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,B.jsx)(md,{}),(0,B.jsx)(fd,{})]})}function md({className:e,orientation:t=`vertical`,...n}){return(0,B.jsx)(Ru,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:k(`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,B.jsx)(Yu,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var hd=Object.defineProperty,gd=(e,t)=>hd(e,`name`,{value:t,configurable:!0}),_d=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`}),vd=z.forwardRef(gd(function(e,t){return(0,B.jsx)(Kn.span,{...e,ref:t,style:{..._d,...e.style}})},`VisuallyHidden`)),yd=Object.defineProperty,bd=(e,t)=>yd(e,`name`,{value:t,configurable:!0}),xd=`horizontal`,Sd=[`horizontal`,`vertical`],Cd=z.forwardRef(bd(function(e,t){let{decorative:n,orientation:r=xd,...i}=e,a=wd(r)?r:xd,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,B.jsx)(Kn.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function wd(e){return Sd.includes(e)}bd(wd,`isValidOrientation`);var Td=Cd;function Ed({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,B.jsx)(Td,{"data-slot":`separator`,decorative:n,orientation:t,className:k(`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 Dd({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`skeleton`,className:k(`animate-pulse rounded-md bg-accent`,e),...t})}var Od=Object.defineProperty,kd=(e,t)=>Od(e,`name`,{value:t,configurable:!0}),Ad=!1;function jd(){let[e,t]=z.useState(Ad);return z.useEffect(()=>{Ad||(Ad=!0,t(!0))},[]),e}kd(jd,`useIsHydrated`);var Md=z.useSyncExternalStore;function Nd(){return()=>{}}kd(Nd,`subscribe`);function Pd(){return Md(Nd,()=>!0,()=>!1)}kd(Pd,`useIsHydratedModern`);var Fd=typeof Md==`function`?Pd:jd,Id=Object.defineProperty,Ld=(e,t)=>Id(e,`name`,{value:t,configurable:!0}),Rd=`rovingFocusGroup.onEntryFocus`,zd={bubbles:!1,cancelable:!0},Bd=`RovingFocusGroup`,[Vd,Hd,Ud]=un(Bd),[Wd,Gd]=on(Bd,[Ud]),[Kd,qd]=Wd(Bd),Jd=z.forwardRef(Ld(function(e,t){return(0,B.jsx)(Vd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(Vd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(Yd,{...e,ref:t})})})},`RovingFocusGroup`)),Yd=z.forwardRef(Ld(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=z.useRef(null),m=f(t,p),h=Or(a),[g,_]=Rn({prop:o,defaultProp:s??null,onChange:c,caller:Bd}),[v,y]=z.useState(!1),b=xi(l),x=Hd(n),S=z.useRef(!1),[C,w]=z.useState(0);return z.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Rd,b),()=>e.removeEventListener(Rd,b)},[b]),(0,B.jsx)(Kd,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:z.useCallback(e=>_(e),[_]),onItemShiftTab:z.useCallback(()=>y(!0),[]),onFocusableItemAdd:z.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:z.useCallback(()=>w(e=>e-1),[]),children:(0,B.jsx)(Kn.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:wn(e.onMouseDown,()=>{S.current=!0}),onFocus:wn(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Rd,zd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);tf([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:wn(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Xd=`RovingFocusGroupItem`,Zd=z.forwardRef(Ld(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=sr(),l=a||c,u=qd(Xd,n),d=u.currentTabStopId===l,f=Hd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Fd();return kn(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),z.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,B.jsx)(Vd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(Kn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:wn(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:wn(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:wn(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ef(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?nf(n,r+1):n.slice(r+1)}setTimeout(()=>tf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Qd={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function $d(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ld($d,`getDirectionAwareKey`);function ef(e,t,n){let r=$d(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Qd[r]}Ld(ef,`getFocusIntent`);function tf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Ld(tf,`focusFirst`);function nf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ld(nf,`wrapArray`);var rf=Jd,af=Zd,of=Object.defineProperty,sf=(e,t)=>of(e,`name`,{value:t,configurable:!0}),cf=`Tabs`,[lf,uf]=on(cf,[Gd]),df=Gd(),[ff,pf]=lf(cf),mf=z.forwardRef(sf(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Or(s),[d,f]=Rn({prop:r,onChange:i,defaultProp:a??``,caller:cf});return(0,B.jsx)(ff,{scope:n,baseId:sr(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,B.jsx)(Kn.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),hf=`TabsList`,gf=z.forwardRef(sf(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=pf(hf,n),o=df(n);return(0,B.jsx)(rf,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,B.jsx)(Kn.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),_f=`TabsTrigger`,vf=z.forwardRef(sf(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=pf(_f,n),s=df(n),c=xf(o.baseId,r),l=Sf(o.baseId,r),u=r===o.value;return(0,B.jsx)(af,{asChild:!0,...s,focusable:!i,active:u,children:(0,B.jsx)(Kn.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:wn(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:wn(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:wn(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),yf=`TabsContent`,bf=z.forwardRef(sf(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=pf(yf,n),c=xf(s.baseId,r),l=Sf(s.baseId,r),u=r===s.value,d=z.useRef(u);return z.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,B.jsx)(Zn,{present:i||u,children:({present:n})=>(0,B.jsx)(Kn.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 xf(e,t){return`${e}-trigger-${t}`}sf(xf,`makeTriggerId`);function Sf(e,t){return`${e}-content-${t}`}sf(Sf,`makeContentId`);var Cf=mf,wf=gf,Tf=vf,Ef=bf;function Df({className:e,orientation:t=`horizontal`,...n}){return(0,B.jsx)(Cf,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:k(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Of=D(`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 kf({className:e,variant:t=`default`,...n}){return(0,B.jsx)(wf,{"data-slot":`tabs-list`,"data-variant":t,className:k(Of({variant:t}),e),...n})}function Af({className:e,...t}){return(0,B.jsx)(Tf,{"data-slot":`tabs-trigger`,className:k(`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 jf({className:e,...t}){return(0,B.jsx)(Ef,{"data-slot":`tabs-content`,className:k(`flex-1 outline-none`,e),...t})}var Mf=Object.defineProperty,Nf=(e,t)=>Mf(e,`name`,{value:t,configurable:!0}),[Pf,Ff]=on(`Tooltip`,[nu]),If=nu(),Lf=`TooltipProvider`,Rf=700,zf=`tooltip.open`,[Bf,Vf]=Pf(Lf),Hf=Nf(e=>{let{__scopeTooltip:t,delayDuration:n=Rf,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=z.useRef(!0),s=z.useRef(!1),c=z.useRef(0);return z.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(Bf,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:z.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:z.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:z.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Uf=`Tooltip`,[Wf,Gf]=Pf(Uf),Kf=Nf(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Vf(Uf,e.__scopeTooltip),l=If(t),[u,d]=z.useState(null),[f,p]=z.useState(void 0),m=sr(),h=z.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=z.useRef(!1),[y,b]=Rn({prop:r,defaultProp:i??!1,onChange:Nf(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(zf))):c.onClose(),a?.(e)},`onChange`),caller:Uf}),x=z.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=z.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=z.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=z.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);z.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,B.jsx)(vu,{...l,children:(0,B.jsx)(Wf,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:z.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:z.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),qf=`TooltipTrigger`,Jf=z.forwardRef(Nf(function(e,t){let{__scopeTooltip:n,...r}=e,i=Gf(qf,n),a=Vf(qf,n),o=If(n),s=f(t,z.useRef(null),i.onTriggerChange),c=z.useRef(!1),l=z.useRef(!1),u=z.useCallback(()=>c.current=!1,[]);return z.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,B.jsx)(yu,{asChild:!0,...o,children:(0,B.jsx)(Kn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:wn(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:wn(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:wn(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:wn(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:wn(e.onBlur,i.onClose),onClick:wn(e.onClick,i.onClose)})})},`TooltipTrigger`)),Yf=`TooltipPortal`,[Xf,Zf]=Pf(Yf,{forceMount:void 0}),Qf=Nf(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Gf(Yf,t);return(0,B.jsx)(Xf,{scope:t,forceMount:n,children:(0,B.jsx)(Zn,{present:n||a.open,children:(0,B.jsx)(Sa,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),$f=`TooltipContent`,ep=z.forwardRef(Nf(function(e,t){let n=Zf($f,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Gf($f,e.__scopeTooltip);return(0,B.jsx)(Zn,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(rp,{side:i,...a,ref:t}):(0,B.jsx)(tp,{side:i,...a,ref:t})})},`TooltipContent`)),tp=z.forwardRef(Nf(function(e,t){let n=Gf($f,e.__scopeTooltip),r=Vf($f,e.__scopeTooltip),i=z.useRef(null),a=f(t,i),[o,s]=z.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,p=z.useCallback(()=>{s(null),d(!1)},[d]),m=z.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=op(r,ap(r,n.getBoundingClientRect())),a=sp(t.getBoundingClientRect()),o=lp([...i,...a]);s(o),d(!0)},[d]);return z.useEffect(()=>()=>p(),[p]),z.useEffect(()=>{if(c&&u){let e=Nf(e=>m(e,u),`handleTriggerLeave`),t=Nf(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),z.useEffect(()=>{if(o){let e=Nf(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!cp(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,B.jsx)(rp,{...e,ref:a})},`TooltipContentHoverable`)),np=Ce(`TooltipContent`),rp=z.forwardRef(Nf(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Gf($f,n),u=If(n),{onClose:d}=l;z.useEffect(()=>(document.addEventListener(zf,d),()=>document.removeEventListener(zf,d)),[d]),z.useEffect(()=>{if(l.trigger){let e=Nf(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 kn(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,B.jsx)(Zi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,B.jsxs)(bu,{"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,B.jsx)(np,{children:r}),i?(0,B.jsx)(vd,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),ip=z.forwardRef(Nf(function(e,t){let{__scopeTooltip:n,...r}=e,i=If(n);return(0,B.jsx)(xu,{...i,...r,ref:t})},`TooltipArrow`));function ap(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`)}}Nf(ap,`getExitSideFromRect`);function op(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}Nf(op,`getPaddedExitPoints`);function sp(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}]}Nf(sp,`getPointsFromRect`);function cp(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}Nf(cp,`isPointInPolygon`);function lp(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)),up(t)}Nf(lp,`getHull`);function up(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)}Nf(up,`getHullPresorted`);var dp=Hf,fp=Kf,pp=Jf,mp=Qf,hp=ep,gp=ip;function _p({delayDuration:e=0,...t}){return(0,B.jsx)(dp,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function vp({...e}){return(0,B.jsx)(fp,{"data-slot":`tooltip`,...e})}function yp({...e}){return(0,B.jsx)(pp,{"data-slot":`tooltip-trigger`,...e})}function bp({className:e,sideOffset:t=0,children:n,...r}){return(0,B.jsx)(mp,{children:(0,B.jsxs)(hp,{"data-slot":`tooltip-content`,sideOffset:t,className:k(`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,B.jsx)(gp,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var xp={completed:`Completed`,failed:`Failed`,running:`Running`,stopped:`Stopped`};function Sp({state:e}){let t=Object.hasOwn(xp,e)?e:`unknown`;return(0,B.jsxs)(T,{className:k(`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,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),xp[e]??e]})}var Cp=`tool_result`;function wp(...e){for(let t of e)if(t!=null)return t;return null}function Tp(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.call&&!n.result)return n}}function Ep({call:e,result:t}){let n=e??t,r=n?.kind??Cp;return{eventIndices:[e?.index,t?.index].filter(e=>e!==void 0),durationMs:wp(e?.durationMs,t?.durationMs),finishedAt:wp(e?.finishedAt,t?.finishedAt),id:`tool-${n?.index??0}`,input:e?.input??t?.input,kind:r,name:wp(e?.name,t?.name)??r,output:wp(t?.output,e?.output),startedAt:wp(e?.startedAt,t?.startedAt),status:wp(e?.status,t?.status),timingSource:wp(e?.timingSource,t?.timingSource),toolCallId:wp(e?.toolCallId,t?.toolCallId)}}function Dp(e){let t=[],n=new Map;for(let r of e){if(r.kind===Cp){let e=r.toolCallId?n.get(r.toolCallId):Tp(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(Ep)}var Op=[{id:`turns`,label:`Turns`},{id:`phases`,label:`Phases`},{id:`tools`,label:`Tools`}];function kp(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function Ap(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function jp(e){let t=[],n=[];for(let r of e.turns){let e=kp(r.startedAt)??kp(r.timestamp);if(e===null)continue;let i=Ap(r.durationMs),a=kp(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=Ap(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=Ap(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 Dp(r.tools)){let i=kp(n.startedAt)??e,a=Ap(n.durationMs),o=kp(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=kp(e.startedAt);return{items:t,lanes:Op.filter(e=>t.some(t=>t.laneId===e.id)),markers:n,...r===null?{}:{origin:r}}}function Mp({cursor:e,focus:t,expanded:n,onExpandedChange:r,onSelectTurn:i,selectedTurnId:a,turns:o}){let[s,c]=(0,z.useState)(!1),l=n??s,u=jp({turns:o}),d=o.find(e=>e.id===t?.turnId),f=d&&t?Dp(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,B.jsx)(tn,{...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 Np(e){let t=(0,z.useRef)(null),n=(0,z.useRef)(new Map),[r,i]=(0,z.useState)(),a=(0,z.useRef)(new Map);a.current=new Map(e.map(e=>[e.id,e.time]));let o=(0,z.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,z.useCallback)(e=>{t.current?.removeEventListener(`scroll`,o),t.current=e,e?.addEventListener(`scroll`,o,{passive:!0}),o()},[o]);return(0,z.useEffect)(()=>{o();let e=t.current;return()=>e?.removeEventListener(`scroll`,o)},[o]),{containerRef:s,cursor:r,register:(0,z.useCallback)((e,t)=>{t?n.current.set(e,t):n.current.delete(e)},[]),scrollTo:(0,z.useCallback)(e=>{n.current.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`});let t=a.current.get(e);t!==void 0&&i(t)},[])}}function Pp({className:e,from:t,...n}){return(0,B.jsx)(`div`,{className:k(t===`user`?`flex justify-end`:`grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-3.5`,e),"data-message-author":t,...n})}function Fp({className:e,...t}){return(0,B.jsx)(`div`,{className:k(`min-w-0`,e),...t})}function Ip({children:e,src:t}){return(0,B.jsxs)(Li,{"aria-hidden":`true`,className:`size-8 rounded-[9px]`,children:[t?(0,B.jsx)(zi,{alt:``,src:t}):null,(0,B.jsx)(Ri,{className:`bg-primary text-[9px] font-extrabold text-primary-foreground`,children:e})]})}var Lp=/"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g;function Rp(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 Bp(e){return zp(e,0)}function Vp(e,t){return e.startsWith(`"`)?t?`hljs-attr`:`hljs-string`:e===`true`||e===`false`||e===`null`?`hljs-literal`:`hljs-number`}function Hp(e){let t=[],n=0;for(let r of e.matchAll(Lp)){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,B.jsx)(`span`,{className:Vp(i,o),children:i},`${a}-${i.length}`))}return n<e.length&&t.push(e.slice(n)),t}function Up({className:e,label:t,value:n}){return(0,B.jsx)(`pre`,{"aria-label":t,className:k(`message-json`,e),children:(0,B.jsx)(`code`,{children:Hp(zp(n))})})}function Wp(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Gp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qp={};function Jp(e,t){return((t||qp).jsx?Kp:Gp).test(e)}var Yp=/[ \t\n\f\r]/g;function Xp(e){return typeof e==`object`?e.type===`text`&&Zp(e.value):Zp(e)}function Zp(e){return e.replace(Yp,``)===``}var Qp=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Qp.prototype.normal={},Qp.prototype.property={},Qp.prototype.space=void 0;function $p(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Qp(n,r,t)}function em(e){return e.toLowerCase()}var tm=class{constructor(e,t){this.attribute=t,this.property=e}};tm.prototype.attribute=``,tm.prototype.booleanish=!1,tm.prototype.boolean=!1,tm.prototype.commaOrSpaceSeparated=!1,tm.prototype.commaSeparated=!1,tm.prototype.defined=!1,tm.prototype.mustUseProperty=!1,tm.prototype.number=!1,tm.prototype.overloadedBoolean=!1,tm.prototype.property=``,tm.prototype.spaceSeparated=!1,tm.prototype.space=void 0;var nm=w({boolean:()=>V,booleanish:()=>im,commaOrSpaceSeparated:()=>cm,commaSeparated:()=>sm,number:()=>H,overloadedBoolean:()=>am,spaceSeparated:()=>om}),rm=0,V=lm(),im=lm(),am=lm(),H=lm(),om=lm(),sm=lm(),cm=lm();function lm(){return 2**++rm}var um=Object.keys(nm),dm=class extends tm{constructor(e,t,n,r){let i=-1;if(super(e,t),fm(this,`space`,r),typeof n==`number`)for(;++i<um.length;){let e=um[i];fm(this,um[i],(n&nm[e])===nm[e])}}};dm.prototype.defined=!0;function fm(e,t,n){n&&(e[t]=n)}function pm(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new dm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[em(r)]=r,n[em(a.attribute)]=r}return new Qp(t,n,e.space)}var mm=pm({properties:{ariaActiveDescendant:null,ariaAtomic:im,ariaAutoComplete:null,ariaBusy:im,ariaChecked:im,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:om,ariaCurrent:null,ariaDescribedBy:om,ariaDetails:null,ariaDisabled:im,ariaDropEffect:om,ariaErrorMessage:null,ariaExpanded:im,ariaFlowTo:om,ariaGrabbed:im,ariaHasPopup:null,ariaHidden:im,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:om,ariaLevel:H,ariaLive:null,ariaModal:im,ariaMultiLine:im,ariaMultiSelectable:im,ariaOrientation:null,ariaOwns:om,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:im,ariaReadOnly:im,ariaRelevant:null,ariaRequired:im,ariaRoleDescription:om,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:im,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function hm(e,t){return t in e?e[t]:t}function gm(e,t){return hm(e,t.toLowerCase())}var _m=pm({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:sm,acceptCharset:om,accessKey:om,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alpha:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:om,autoFocus:V,autoPlay:V,blocking:om,capture:null,charSet:null,checked:V,cite:null,className:om,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:im,controls:V,controlsList:om,coords:H|sm,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:am,draggable:im,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:om,height:H,hidden:am,high:H,href:null,hrefLang:null,htmlFor:om,httpEquiv:om,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:om,itemRef:om,itemScope:V,itemType:om,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,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:V,optimum:H,pattern:null,ping:om,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:om,required:V,reversed:V,rows:H,rowSpan:H,sandbox:om,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootCustomElementRegistry:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shadowRootSerializable:V,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:im,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:im,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:om,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:im,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:V,disablePictureInPicture:V,disableRemotePlayback:V,exportParts:sm,part:om,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:gm}),vm=pm({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:cm,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:om,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:sm,g2:sm,glyphName:sm,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:cm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:om,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cm,rev:cm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cm,requiredFeatures:cm,requiredFonts:cm,requiredFormats:cm,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:cm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cm,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:hm}),ym=pm({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()}}),bm=pm({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:gm}),xm=pm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Sm={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`},Cm=/[A-Z]/g,wm=/-[a-z]/g,Tm=/^data[-\w.:]+$/i;function Em(e,t){let n=em(t),r=t,i=tm;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Tm.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(wm,Om);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!wm.test(e)){let n=e.replace(Cm,Dm);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=dm}return new i(r,t)}function Dm(e){return`-`+e.toLowerCase()}function Om(e){return e.charAt(1).toUpperCase()}var km=$p([mm,_m,ym,bm,xm],`html`),Am=$p([mm,vm,ym,bm,xm],`svg`);function jm(e){return e.join(` `).trim()}var Mm=Pe(((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})),Nm=Pe((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(Mm());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}})),Pm=Pe((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))}})),Fm=Pe(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Nm()),r=Pm();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})),Im=Rm(`end`),Lm=Rm(`start`);function Rm(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=Lm(e),n=Im(e);if(t&&n)return{start:t,end:n}}function Bm(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Hm(e.position):`start`in e||`end`in e?Hm(e):`line`in e||`column`in e?Vm(e):``}function Vm(e){return Um(e&&e.line)+`:`+Um(e&&e.column)}function Hm(e){return Vm(e&&e.start)+`-`+Vm(e&&e.end)}function Um(e){return e&&typeof e==`number`?e:1}var Wm=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=Bm(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}};Wm.prototype.file=``,Wm.prototype.name=``,Wm.prototype.reason=``,Wm.prototype.message=``,Wm.prototype.stack=``,Wm.prototype.column=void 0,Wm.prototype.line=void 0,Wm.prototype.ancestors=void 0,Wm.prototype.cause=void 0,Wm.prototype.fatal=void 0,Wm.prototype.place=void 0,Wm.prototype.ruleId=void 0,Wm.prototype.source=void 0;var Gm=s(Fm(),1),Km={}.hasOwnProperty,qm=new Map,Jm=/[A-Z]/g,Ym=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Xm=new Set([`td`,`th`]);function Zm(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=ch(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=sh(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`?Am:km,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Qm(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Qm(e,t,n){if(t.type===`element`)return $m(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return eh(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return nh(e,t,n);if(t.type===`mdxjsEsm`)return th(e,t);if(t.type===`root`)return rh(e,t,n);if(t.type===`text`)return ih(e,t)}function $m(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Am,e.schema=i),e.ancestors.push(t);let a=mh(e,t.tagName,!1),o=lh(e,t),s=dh(e,t);return Ym.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Xp(e)})),ah(e,o,a,t),oh(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function eh(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)}hh(e,t.position)}function th(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hh(e,t.position)}function nh(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Am,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:mh(e,t.name,!0),o=uh(e,t),s=dh(e,t);return ah(e,o,a,t),oh(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rh(e,t,n){let r={};return oh(r,dh(e,t)),e.create(t,e.Fragment,r,n)}function ih(e,t){return t.value}function ah(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oh(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function sh(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 ch(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Lm(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 lh(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Km.call(t.properties,i)){let a=fh(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Xm.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 uh(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 hh(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 hh(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function dh(e,t){let n=[],r=-1,i=e.passKeys?new Map:qm;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=Qm(e,a,o);s!==void 0&&n.push(s)}return n}function fh(e,t,n){let r=Em(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Wp(n):jm(n)),r.property===`style`){let t=typeof n==`object`?n:ph(e,String(n));return e.stylePropertyNameCase===`css`&&(t=gh(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Sm[r.property]||r.property:r.attribute,n]}}function ph(e,t){try{return(0,Gm.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Wm("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 mh(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=Jp(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=Jp(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Km.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);hh(e)}function hh(e,t){let n=new Wm("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 gh(e){let t={},n;for(n in e)Km.call(e,n)&&(t[_h(n)]=e[n]);return t}function _h(e){let t=e.replace(Jm,vh);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function vh(e){return`-`+e.toLowerCase()}var yh={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`]},bh={};function xh(e,t){let n=t||bh;return Sh(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Sh(e,t,n){if(wh(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 Ch(e.children,t,n)}return Array.isArray(e)?Ch(e,t,n):``}function Ch(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Sh(e[i],t,n);return r.join(``)}function wh(e){return!!(e&&typeof e==`object`)}var Th=document.createElement(`i`);function Eh(e){let t=`&`+e+`;`;Th.innerHTML=t;let n=Th.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Dh(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 Oh(e,t){return e.length>0?(Dh(e,e.length,0,t),e):t}var kh={}.hasOwnProperty;function Ah(e){let t={},n=-1;for(;++n<e.length;)jh(t,e[n]);return t}function jh(e,t){let n;for(n in t){let r=(kh.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){kh.call(r,a)||(r[a]=[]);let e=i[a];Mh(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Mh(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Dh(e,0,0,r)}function Nh(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 Ph(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Fh=Kh(/[A-Za-z]/),Ih=Kh(/[\dA-Za-z]/),Lh=Kh(/[#-'*+\--9=?A-Z^-~]/);function Rh(e){return e!==null&&(e<32||e===127)}var zh=Kh(/\d/),Bh=Kh(/[\dA-Fa-f]/),Vh=Kh(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function Hh(e){return e!==null&&(e<0||e===32)}function Uh(e){return e===-2||e===-1||e===32}var Wh=Kh(/\p{P}|\p{S}/u),Gh=Kh(/\s/);function Kh(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function qh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ih(e.charCodeAt(n+1))&&Ih(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 Jh(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Uh(r)?(e.enter(n),s(r)):t(r)}function s(r){return Uh(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Yh={tokenize:Xh};function Xh(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`),Jh(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 U(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Zh={tokenize:$h},Qh={tokenize:eg};function $h(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 Dh(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(Qh,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(Qh,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 U(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++;Dh(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 eg(e,t,n){return Jh(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function tg(e){if(e===null||Hh(e)||Gh(e))return 1;if(Wh(e))return 2}function ng(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 rg={name:`attention`,resolveAll:ig,tokenize:ag};function ig(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};og(d,-c),og(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=Oh(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Oh(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Oh(l,ng(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Oh(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=Oh(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Dh(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 ag(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tg(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=tg(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 og(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sg={name:`autolink`,tokenize:cg};function cg(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 Fh(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Ih(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||Ih(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||Rh(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Lh(t)?(e.consume(t),l):n(t)}function u(e){return Ih(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||Ih(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lg={partial:!0,tokenize:ug};function ug(e,t,n){return r;function r(t){return Uh(t)?Jh(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||U(e)?t(e):n(e)}}var dg={continuation:{tokenize:pg},exit:mg,name:`blockQuote`,tokenize:fg};function fg(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 Uh(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pg(e,t,n){let r=this;return i;function i(t){return Uh(t)?Jh(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dg,t,n)(r)}}function mg(e){e.exit(`blockQuote`)}var hg={name:`characterEscape`,tokenize:gg};function gg(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 Vh(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _g={name:`characterReference`,tokenize:vg};function vg(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=Ih,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=Bh,u):(e.enter(`characterReferenceValue`),a=7,o=zh,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Ih&&!Eh(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 yg={partial:!0,tokenize:Sg},bg={concrete:!0,name:`codeFenced`,tokenize:xg};function xg(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`),Uh(t)?Jh(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||U(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yg,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Uh(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Jh(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||U(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||U(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&&Uh(t)?Jh(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||U(t)?e.check(yg,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||U(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`),Uh(t)?Jh(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`),Uh(t)?Jh(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||U(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Sg(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 Cg={name:`codeIndented`,tokenize:Tg},wg={partial:!0,tokenize:Eg};function Tg(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Jh(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):U(t)?e.attempt(wg,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||U(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Eg(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Jh(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):U(e)?i(e):n(e)}}var Dg={name:`codeText`,previous:kg,resolve:Og,tokenize:Ag};function Og(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 kg(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ag(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)):U(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||U(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 jg=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&&Mg(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),Mg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Mg(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);Mg(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Mg(this.left,t.reverse())}}};function Mg(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 Ng(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jg(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,Pg(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 Dh(e,0,1/0,u.slice(0)),!l}function Pg(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 Fg={resolve:Lg,tokenize:Rg},Ig={partial:!0,tokenize:zg};function Lg(e){return Ng(e),e}function Rg(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):U(t)?e.check(Ig,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 zg(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Jh(e,a,`linePrefix`)}function a(i){if(i===null||U(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 Bg(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||Rh(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||U(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||Hh(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||Rh(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 Vg(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):U(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||U(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Uh(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Hg(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):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Jh(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||U(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 Ug(e,t){let n;return r;function r(i){return U(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Uh(i)?Jh(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Wg={name:`definition`,tokenize:Kg},Gg={partial:!0,tokenize:qg};function Kg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Vg.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ph(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 Hh(t)?Ug(e,l)(t):l(t)}function l(t){return Bg(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Gg,d,d)(t)}function d(t){return Uh(t)?Jh(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||U(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qg(e,t,n){return r;function r(t){return Hh(t)?Ug(e,i)(t):n(t)}function i(t){return Hg(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Uh(t)?Jh(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||U(e)?t(e):n(e)}}var Jg={name:`hardBreakEscape`,tokenize:Yg};function Yg(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return U(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Xg={name:`headingAtx`,resolve:Zg,tokenize:Qg};function Zg(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`},Dh(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Qg(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||Hh(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||U(n)?(e.exit(`atxHeading`),t(n)):Uh(n)?Jh(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||Hh(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $g=`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(`.`),e_=[`pre`,`script`,`style`,`textarea`],t_={concrete:!0,name:`htmlFlow`,resolveTo:i_,tokenize:a_},n_={partial:!0,tokenize:s_},r_={partial:!0,tokenize:o_};function i_(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 a_(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):Fh(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):Fh(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 Fh(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Hh(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&e_.includes(l)?(i=1,r.interrupt?t(s):O(s)):$g.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||Ih(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 Uh(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Fh(t)?(e.consume(t),b):Uh(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Ih(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Uh(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):Uh(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||U(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||Hh(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Uh(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||U(t)?O(t):Uh(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),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):U(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(n_,L,k)(t)):t===null||U(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(r_,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||U(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 e_.includes(n)?(e.consume(t),ee):O(t)}return Fh(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),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||U(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),ee)}function L(n){return e.exit(`htmlFlow`),t(n)}}function o_(e,t,n){let r=this;return i;function i(t){return U(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 s_(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lg,t,n)}}var c_={name:`htmlText`,tokenize:l_};function l_(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):Fh(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):Fh(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):U(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):U(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):U(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):U(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Fh(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Ih(t)?(e.consume(t),S):C(t)}function C(t){return U(t)?(o=C,N(t)):Uh(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Ih(t)?(e.consume(t),w):t===47||t===62||Hh(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Fh(t)?(e.consume(t),E):U(t)?(o=T,N(t)):Uh(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Ih(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):U(t)?(o=D,N(t)):Uh(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):U(t)?(o=O,N(t)):Uh(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):U(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||Hh(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Hh(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 Uh(t)?Jh(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 u_={name:`labelEnd`,resolveAll:m_,resolveTo:h_,tokenize:g_},d_={tokenize:__},f_={tokenize:v_},p_={tokenize:y_};function m_(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&&Dh(e,0,e.length,n),e}function h_(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=Oh(s,e.slice(a+1,a+r+3)),s=Oh(s,[[`enter`,u,t]]),s=Oh(s,ng(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Oh(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Oh(s,e.slice(o+1)),s=Oh(s,[[`exit`,c,t]]),Dh(e,a,e.length,s),e}function g_(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(Ph(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(d_,u,o?u:d)(t):t===91?e.attempt(f_,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(p_,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function __(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 Hh(t)?Ug(e,a)(t):a(t)}function a(t){return t===41?u(t):Bg(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Hh(t)?Ug(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Hg(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Hh(t)?Ug(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 v_(e,t,n){let r=this;return i;function i(t){return Vg.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ph(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function y_(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 b_={name:`labelStartImage`,resolveAll:u_.resolveAll,tokenize:x_};function x_(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 S_={name:`labelStartLink`,resolveAll:u_.resolveAll,tokenize:C_};function C_(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 w_={name:`lineEnding`,tokenize:T_};function T_(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Jh(e,t,`linePrefix`)}}var E_={name:`thematicBreak`,tokenize:D_};function D_(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||U(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Uh(t)?Jh(e,s,`whitespace`)(t):s(t))}}var O_={continuation:{tokenize:M_},exit:P_,name:`list`,tokenize:j_},k_={partial:!0,tokenize:F_},A_={partial:!0,tokenize:N_};function j_(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(E_,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(lg,r.interrupt?n:u,e.attempt(k_,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Uh(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 M_(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lg,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Jh(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Uh(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(A_,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Jh(e,e.attempt(O_,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function N_(e,t,n){let r=this;return Jh(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 P_(e){e.exit(this.containerState.type)}function F_(e,t,n){let r=this;return Jh(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!Uh(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var I_={name:`setextUnderline`,resolveTo:L_,tokenize:R_};function L_(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 R_(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`),Uh(t)?Jh(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||U(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var z_={tokenize:B_};function B_(e){let t=this,n=e.attempt(lg,r,e.attempt(this.parser.constructs.flowInitial,i,Jh(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Fg,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 V_={resolveAll:G_()},H_=W_(`string`),U_=W_(`text`);function W_(e){return{resolveAll:G_(e===`text`?K_: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 G_(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 K_(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 q_=w({attentionMarkers:()=>tv,contentInitial:()=>Y_,disable:()=>nv,document:()=>J_,flow:()=>Z_,flowInitial:()=>X_,insideSpan:()=>ev,string:()=>Q_,text:()=>$_}),J_={42:O_,43:O_,45:O_,48:O_,49:O_,50:O_,51:O_,52:O_,53:O_,54:O_,55:O_,56:O_,57:O_,62:dg},Y_={91:Wg},X_={[-2]:Cg,[-1]:Cg,32:Cg},Z_={35:Xg,42:E_,45:[I_,E_],60:t_,61:I_,95:E_,96:bg,126:bg},Q_={38:_g,92:hg},$_={[-5]:w_,[-4]:w_,[-3]:w_,33:b_,38:_g,42:rg,60:[sg,c_],91:S_,92:[Jg,hg],93:u_,95:rg,96:Dg},ev={null:[rg,V_]},tv={null:[42,95]},nv={null:[]};function rv(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=Oh(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=ng(a,l.events,l),l.events):[]}function f(e,t){return av(p(e),t)}function p(e){return iv(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){U(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&&Dh(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 iv(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 av(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=`
41
+ `},Lo=0,Ro=[];function zo(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(Lo++)[0],a=z.useState(oo)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Fa([e.lockRef.current],(e.shards||[]).map(Po),!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=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Mo(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=To(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=To(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 jo(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!Ro.length||Ro[Ro.length-1]!==a)){var r=`deltaY`in n?No(n):Mo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Po).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=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Bo(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Mo(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,No(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Mo(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return Ro.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,bo),document.addEventListener(`touchmove`,c,bo),document.addEventListener(`touchstart`,u,bo),function(){Ro=Ro.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,bo),document.removeEventListener(`touchmove`,c,bo),document.removeEventListener(`touchstart`,u,bo)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:Io(i)}):null,p?z.createElement(_o,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Vo=Ya(Xa,zo),Ho=z.forwardRef(function(e,t){return z.createElement(Qa,Na({},e,{ref:t,sideCar:Vo}))});Ho.classNames=Qa.classNames;var Uo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Wo=new WeakMap,Go=new WeakMap,Ko={},qo=0,Jo=function(e){return e&&(e.host||Jo(e.parentNode))},Yo=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Jo(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})},Xo=function(e,t,n,r){var i=Yo(t,Array.isArray(e)?e:[e]);Ko[n]||(Ko[n]=new WeakMap);var a=Ko[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=(Wo.get(e)||0)+1,l=(a.get(e)||0)+1;Wo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Go.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(),qo++,function(){o.forEach(function(e){var t=Wo.get(e)-1,i=a.get(e)-1;Wo.set(e,t),a.set(e,i),t||(Go.has(e)||e.removeAttribute(r),Go.delete(e)),i||e.removeAttribute(n)}),qo--,qo||(Wo=new WeakMap,Wo=new WeakMap,Go=new WeakMap,Ko={})}},Zo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Uo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Xo(r,i,n,`aria-hidden`)):function(){return null}},Qo=Object.defineProperty,$o=(e,t)=>Qo(e,`name`,{value:t,configurable:!0}),es=`Dialog`,[ts,ns]=ln(es),[rs,is]=ts(es),as=$o(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=Vn({prop:r,defaultProp:i??!1,onChange:a,caller:es}),[d,f]=z.useState(0),[p,m]=z.useState(0);return(0,B.jsx)(rs,{scope:t,triggerRef:s,contentRef:c,contentId:ur(),titleId:ur(),descriptionId:ur(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),os=`DialogPortal`,[ss,cs]=ts(os,{forceMount:void 0}),ls=$o(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=is(os,t);return(0,B.jsx)(ss,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,B.jsx)(er,{present:n||a.open,children:(0,B.jsx)(Ta,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),us=`DialogOverlay`,ds=z.forwardRef($o(function(e,t){let n=cs(us,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=is(us,e.__scopeDialog);return a.modal?(0,B.jsx)(er,{present:r||a.open,children:(0,B.jsx)(ps,{...i,ref:t})}):null},`DialogOverlay`)),fs=p(`DialogOverlay.RemoveScroll`),ps=z.forwardRef($o(function(e,t){let{__scopeDialog:n,...r}=e,i=is(us,n),a=f(t,ta());return(0,B.jsx)(Ho,{as:fs,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(Yn.div,{"data-state":Ts(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ms=`DialogContent`,hs=z.forwardRef($o(function(e,t){let n=cs(ms,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=is(ms,e.__scopeDialog);return(0,B.jsx)(er,{present:r||a.open,children:a.modal?(0,B.jsx)(gs,{...i,ref:t}):(0,B.jsx)(_s,{...i,ref:t})})},`DialogContent`)),gs=z.forwardRef($o(function(e,t){let n=is(ms,e.__scopeDialog),r=z.useRef(null),i=f(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return Zo(e)},[]),(0,B.jsx)(vs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Dn(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Dn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Dn(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),_s=z.forwardRef($o(function(e,t){let n=is(ms,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,B.jsx)(vs,{...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`)),vs=z.forwardRef($o(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=is(ms,n);return ja(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(fa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(ea,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ts(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),ys=`DialogTitle`,bs=z.forwardRef($o(function(e,t){let{__scopeDialog:n,...r}=e,i=is(ys,n),{setTitleCount:a}=i;return Mn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(Yn.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),xs=`DialogDescription`,Ss=z.forwardRef($o(function(e,t){let{__scopeDialog:n,...r}=e,i=is(xs,n),{setDescriptionCount:a}=i;return Mn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(Yn.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Cs=`DialogClose`,ws=z.forwardRef($o(function(e,t){let{__scopeDialog:n,...r}=e,i=is(Cs,n);return(0,B.jsx)(Yn.button,{type:`button`,...r,ref:t,onClick:Dn(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ts(e){return e?`open`:`closed`}$o(Ts,`getState`);function Es({...e}){return(0,B.jsx)(as,{"data-slot":`dialog`,...e})}function Ds({...e}){return(0,B.jsx)(ls,{"data-slot":`dialog-portal`,...e})}function Os({...e}){return(0,B.jsx)(ws,{"data-slot":`dialog-close`,...e})}function ks({className:e,...t}){return(0,B.jsx)(ds,{"data-slot":`dialog-overlay`,className:k(`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 As({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(Ds,{"data-slot":`dialog-portal`,children:[(0,B.jsx)(ks,{}),(0,B.jsxs)(hs,{"data-slot":`dialog-content`,className:k(`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,B.jsxs)(ws,{"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,B.jsx)(Dt,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function js({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:k(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Ms({className:e,showCloseButton:t=!1,children:n,...r}){return(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:k(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,B.jsx)(ws,{asChild:!0,children:(0,B.jsx)(Wi,{variant:`outline`,children:`Close`})})]})}function Ns({className:e,...t}){return(0,B.jsx)(bs,{"data-slot":`dialog-title`,className:k(`text-lg leading-none font-semibold`,e),...t})}function Ps({className:e,...t}){return(0,B.jsx)(Ss,{"data-slot":`dialog-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function Fs({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:k(`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 Is=Object.defineProperty,Ls=z.forwardRef(((e,t)=>Is(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,B.jsx)(Yn.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 Rs({className:e,...t}){return(0,B.jsx)(Ls,{"data-slot":`label`,className:k(`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 zs=[`top`,`right`,`bottom`,`left`],Bs=Math.min,Vs=Math.max,Hs=Math.round,Us=Math.floor,Ws=e=>({x:e,y:e}),Gs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ks(e,t,n){return Vs(e,Bs(t,n))}function qs(e,t){return typeof e==`function`?e(t):e}function Js(e){return e.split(`-`)[0]}function Ys(e){return e.split(`-`)[1]}function Xs(e){return e===`x`?`y`:`x`}function Zs(e){return e===`y`?`height`:`width`}function Qs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $s(e){return Xs(Qs(e))}function ec(e,t,n){n===void 0&&(n=!1);let r=Ys(e),i=$s(e),a=Zs(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lc(o)),[o,lc(o)]}function tc(e){let t=lc(e);return[nc(e),t,nc(t)]}function nc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rc=[`left`,`right`],ic=[`right`,`left`],ac=[`top`,`bottom`],oc=[`bottom`,`top`];function sc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ic:rc:t?rc:ic;case`left`:case`right`:return t?ac:oc;default:return[]}}function cc(e,t,n,r){let i=Ys(e),a=sc(Js(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nc)))),a}function lc(e){let t=Js(e);return Gs[t]+e.slice(t.length)}function uc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function dc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:uc(e)}function fc(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 pc(e,t,n){let{reference:r,floating:i}=e,a=Qs(t),o=$s(t),s=Zs(o),c=Js(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=Ys(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function mc(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}=qs(t,e),p=dc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fc(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=fc(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 hc=50,gc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pc(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<hc&&(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}=pc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_c=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}=qs(e,t)||{};if(l==null)return{};let d=dc(u),f={x:n,y:r},p=$s(i),m=Zs(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=Bs(d[_],T),D=Bs(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ks(E,k,O),j=!c.arrow&&Ys(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}}}),vc=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}=qs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Js(r),_=Qs(o),v=Js(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lc(o)]:tc(o)),x=p!==`none`;!d&&x&&b.push(...cc(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=ec(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`&&_!==Qs(t))||T.every(e=>Qs(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=Qs(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 yc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bc(e){return zs.some(t=>e[t]>=0)}var xc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=qs(e,t);switch(i){case`referenceHidden`:{let e=yc(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:bc(e)}}}case`escaped`:{let e=yc(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:bc(e)}}}default:return{}}}}},Sc=new Set([`left`,`top`]);async function Cc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Js(n),s=Ys(n),c=Qs(n)===`y`,l=Sc.has(o)?-1:1,u=a&&c?-1:1,d=qs(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 wc=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 Cc(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}}}}},Tc=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}=qs(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Qs(i),p=Xs(f),m=u[p],h=u[f],g=(e,t)=>Ks(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}}}}}},Ec=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}=qs(e,t),u={x:n,y:r},d=Qs(i),f=Xs(d),p=u[f],m=u[d],h=qs(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=Sc.has(Js(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}}}},Dc=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}=qs(e,t),c=await i.detectOverflow(t,s),l=Js(n),u=Ys(n),d=Qs(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=Bs(p-c[m],g),y=Bs(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*Vs(c.left,c.right):S=p-2*Vs(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 Oc(){return typeof window<`u`}function kc(e){return Mc(e)?(e.nodeName||``).toLowerCase():`#document`}function Ac(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jc(e){return((Mc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Mc(e){return Oc()?e instanceof Node||e instanceof Ac(e).Node:!1}function Nc(e){return Oc()?e instanceof Element||e instanceof Ac(e).Element:!1}function Pc(e){return Oc()?e instanceof HTMLElement||e instanceof Ac(e).HTMLElement:!1}function Fc(e){return!Oc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ac(e).ShadowRoot}function Ic(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Lc(e){return/^(table|td|th)$/.test(kc(e))}function Rc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var zc=/transform|translate|scale|rotate|perspective|filter/,Bc=/paint|layout|strict|content/,Vc=e=>!!e&&e!==`none`,Hc;function Uc(e){let t=Nc(e)?qc(e):e;return Vc(t.transform)||Vc(t.translate)||Vc(t.scale)||Vc(t.rotate)||Vc(t.perspective)||!Gc()&&(Vc(t.backdropFilter)||Vc(t.filter))||zc.test(t.willChange||``)||Bc.test(t.contain||``)}function Wc(e){let t=Yc(e);for(;Pc(t)&&!Kc(t);){if(Uc(t))return t;if(Rc(t))return null;t=Yc(t)}return null}function Gc(){return Hc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Hc}function Kc(e){return/^(html|body|#document)$/.test(kc(e))}function qc(e){return Ac(e).getComputedStyle(e)}function Jc(e){return Nc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yc(e){if(kc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fc(e)&&e.host||jc(e);return Fc(t)?t.host:t}function Xc(e){let t=Yc(e);return Kc(t)?(e.ownerDocument||e).body:Pc(t)&&Ic(t)?t:Xc(t)}function Zc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Xc(e),i=r===e.ownerDocument?.body,a=Ac(r);if(i){let e=Qc(a);return t.concat(a,a.visualViewport||[],Ic(r)?r:[],e&&n?Zc(e):[])}else return t.concat(r,Zc(r,[],n))}function Qc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $c(e){let t=qc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Pc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Hs(n)!==a||Hs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function el(e){return Nc(e)?e:e.contextElement}function tl(e){let t=el(e);if(!Pc(t))return Ws(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$c(t),o=(a?Hs(n.width):n.width)/r,s=(a?Hs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nl=Ws(0);function rl(e){let t=Ac(e);return!Gc()||!t.visualViewport?nl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function il(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ac(e)}function al(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=el(e),o=Ws(1);t&&(r?Nc(r)&&(o=tl(r)):o=tl(e));let s=il(a,n,r)?rl(a):Ws(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=Ac(a),t=Nc(r)?Ac(r):r,n=e,i=Qc(n);for(;i&&t!==n;){let e=tl(i),t=i.getBoundingClientRect(),r=qc(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=Ac(i),i=Qc(n)}}return fc({width:u,height:d,x:c,y:l})}function ol(e,t){let n=Jc(e).scrollLeft;return t?t.left+n:al(jc(e)).left+n}function sl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ol(e,n),y:n.top+t.scrollTop}}function cl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=jc(r),s=t?Rc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ws(1),u=Ws(0),d=Pc(r);if((d||!a)&&((kc(r)!==`body`||Ic(o))&&(c=Jc(r)),d)){let e=al(r);l=tl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sl(o,c):Ws(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 ll(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ul(e){let t=Jc(e),n=e.ownerDocument.body,r=Vs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Vs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ol(e),o=-t.scrollTop;return qc(n).direction===`rtl`&&(a+=Vs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dl=25;function fl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ac(e),a=jc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Gc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ol(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<=dl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pl(e,t){let n=al(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tl(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ml(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fl(e,n,t);else if(t===`document`)r=ul(jc(e));else if(Nc(t))r=pl(t,n);else{let n=rl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fc(r)}function hl(e,t){let n=t.get(e);if(n)return n;let r=Zc(e,[],!1).filter(e=>Nc(e)&&kc(e)!==`body`),i=null,a=qc(e).position===`fixed`,o=a?Yc(e):e;for(;Nc(o)&&!Kc(o);){let e=qc(o),t=Uc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Yc(o)}return t.set(e,r),r}function gl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Rc(t)?[]:hl(t,this._c):[].concat(n),r],o=ml(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=ml(t,a[e],i);s=Vs(n.top,s),c=Bs(n.right,c),l=Bs(n.bottom,l),u=Vs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _l(e){let{width:t,height:n}=$c(e);return{width:t,height:n}}function vl(e,t,n){let r=Pc(t),i=jc(t),a=n===`fixed`,o=al(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ws(0);if((r||!a)&&((kc(t)!==`body`||Ic(i))&&(s=Jc(t)),r)){let e=al(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ol(i));let l=i&&!r&&!a?sl(i,s):Ws(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 yl(e){return qc(e).position===`static`}function bl(e,t){if(!Pc(e)||qc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return jc(e)===n&&(n=n.ownerDocument.body),n}function xl(e,t){let n=Ac(e);if(Rc(e))return n;if(!Pc(e)){let t=Yc(e);for(;t&&!Kc(t);){if(Nc(t)&&!yl(t))return t;t=Yc(t)}return n}let r=bl(e,t);for(;r&&Lc(r)&&yl(r);)r=bl(r,t);return r&&Kc(r)&&yl(r)&&!Uc(r)?n:r||Wc(e)||n}var Sl=async function(e){let t=this.getOffsetParent||xl,n=this.getDimensions,r=await n(e.floating);return{reference:vl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cl(e){return qc(e).direction===`rtl`}var wl={convertOffsetParentRelativeRectToViewportRelativeRect:cl,getDocumentElement:jc,getClippingRect:gl,getOffsetParent:xl,getElementRects:Sl,getClientRects:ll,getDimensions:_l,getScale:tl,isElement:Nc,isRTL:Cl};function Tl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function El(e,t,n){let r=null,i,a=jc(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=Us(d),h=Us(a.clientWidth-(u+f)),g=Us(a.clientHeight-(d+p)),_=Us(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Vs(0,Bs(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Tl(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=Ac(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Dl(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=el(e),u=i||a?[...l?Zc(l):[],...t?Zc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?El(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?al(e):null;c&&g();function g(){let t=al(e);h&&!Tl(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 Ol=wc,kl=Tc,Al=vc,jl=Dc,Ml=xc,Nl=_c,Pl=Ec,Fl=(e,t,n)=>{let r=new Map,i=n??{},a={...wl,...i.platform,_c:r};return gc(e,t,{...i,platform:a})},Il=typeof document<`u`?z.useLayoutEffect:function(){};function Ll(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(!Ll(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)&&!Ll(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zl(e,t){let n=Rl(e);return Math.round(t*n)/n}function Bl(e){let t=z.useRef(e);return Il(()=>{t.current=e}),t}function Vl(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]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);Ll(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=Bl(c),D=Bl(i),O=Bl(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Fl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Ll(w.current,t)&&(w.current=t,Kn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Il(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);Il(()=>(A.current=!0,()=>{A.current=!1}),[]),Il(()=>{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=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=zl(M.floating,u.x),r=zl(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Hl=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?{}:Nl({element:r.current,padding:i}).fn(n):r?Nl({element:r,padding:i}).fn(n):{}}}},Ul=(e,t)=>{let n=Ol(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wl=(e,t)=>{let n=kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gl=(e,t)=>({fn:Pl(e).fn,options:[e,t]}),Kl=(e,t)=>{let n=Al(e);return{name:n.name,fn:n.fn,options:[e,t]}},ql=(e,t)=>{let n=jl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jl=(e,t)=>{let n=Ml(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yl=(e,t)=>{let n=Hl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xl=Object.defineProperty,Zl=z.forwardRef(((e,t)=>Xl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(Yn.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Ql=Object.defineProperty,$l=(e,t)=>Ql(e,`name`,{value:t,configurable:!0});function eu(e){let[t,n]=z.useState(void 0);return Mn(()=>{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}$l(eu,`useSize`);var tu=Object.defineProperty,nu=(e,t)=>tu(e,`name`,{value:t,configurable:!0}),ru=`Popper`,[iu,au]=ln(ru),[ou,su]=iu(ru),cu=nu(e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null),[a,o]=z.useState(void 0);return(0,B.jsx)(ou,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),lu=`PopperAnchor`,uu=z.forwardRef(nu(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=su(lu,n),o=z.useRef(null),s=a.onAnchorChange,c=f(t,z.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=z.useRef(null);z.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&bu(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,B.jsx)(Yn.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),du=`PopperContent`,[fu,pu]=iu(du),mu=z.forwardRef(nu(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=su(du,n),[v,y]=z.useState(null),b=f(t,y),[x,S]=z.useState(null),C=eu(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(vu),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Vl({strategy:`fixed`,placement:E,whileElementsMounted:nu((...e)=>Dl(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Ul({mainAxis:i+T,alignmentAxis:o}),c&&Wl({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Gl():void 0,...A}),c&&Kl({...A}),ql({...A,apply:nu(({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&&Yl({element:x,padding:s}),yu({arrowWidth:w,arrowHeight:T}),p&&Jl({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=_.setPlacementState;Mn(()=>(I(N),()=>{I(void 0)}),[N,I]);let[ee,L]=bu(N),te=wi(h);Mn(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[ae,oe]=z.useState();return Mn(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,B.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(fu,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,B.jsx)(Yn.div,{"data-side":ee,"data-align":L,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),hu=`PopperArrow`,gu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},_u=z.forwardRef(nu(function(e,t){let{__scopePopper:n,...r}=e,i=pu(hu,n),a=gu[i.placedSide];return(0,B.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,B.jsx)(Zl,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function vu(e){return e!==null}nu(vu,`isNotNull`);var yu=nu(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]=bu(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 bu(e){let[t,n=`center`]=e.split(`-`);return[t,n]}nu(bu,`getSideAndAlignFromPlacement`);var xu=cu,Su=uu,Cu=mu,wu=_u,Tu=Object.defineProperty,Eu=(e,t)=>Tu(e,`name`,{value:t,configurable:!0});function Du(e,[t,n]){return Math.min(n,Math.max(t,e))}Eu(Du,`clamp`);var Ou=Object.defineProperty,ku=(e,t)=>Ou(e,`name`,{value:t,configurable:!0});function Au(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}ku(Au,`useStateMachine`);var ju=`ScrollArea`,[Mu,Nu]=ln(ju),[Pu,Fu]=Mu(ju),Iu=z.forwardRef(ku(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=z.useState(null),[l,u]=z.useState(null),[d,p]=z.useState(null),[m,h]=z.useState(null),[g,_]=z.useState(null),[v,y]=z.useState(0),[b,x]=z.useState(0),[S,C]=z.useState(!1),[w,T]=z.useState(!1),E=f(t,c),D=jr(i);return(0,B.jsx)(Pu,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,B.jsx)(Yn.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),Lu=`ScrollAreaViewport`,Ru=z.forwardRef(ku(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Fu(Lu,n),s=f(t,z.useRef(null),o.onViewportChange);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(zu,{nonce:i}),(0,B.jsx)(Yn.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,B.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),zu=z.memo(ku(function({nonce:e}){return(0,B.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),Bu=`ScrollAreaScrollbar`,Vu=z.forwardRef(ku(function(e,t){let{forceMount:n,...r}=e,i=Fu(Bu,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return z.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,B.jsx)(Hu,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,B.jsx)(Uu,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,B.jsx)(Wu,{...r,ref:t,forceMount:n}):i.type===`always`?(0,B.jsx)(Gu,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),Hu=z.forwardRef(ku(function(e,t){let{forceMount:n,...r}=e,i=Fu(Bu,e.__scopeScrollArea),[a,o]=z.useState(!1);return z.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=ku(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=ku(()=>{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,B.jsx)(er,{present:n||a,children:(0,B.jsx)(Wu,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),Uu=z.forwardRef(ku(function(e,t){let{forceMount:n,...r}=e,i=Fu(Bu,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=dd(()=>c(`SCROLL_END`),100),[s,c]=Au(`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 z.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),z.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=ku(()=>{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,B.jsx)(er,{present:n||s!==`hidden`,children:(0,B.jsx)(Gu,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Dn(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Dn(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),Wu=z.forwardRef(ku(function(e,t){let n=Fu(Bu,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=z.useState(!1),s=e.orientation===`horizontal`,c=dd(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return fd(n.viewport,c),fd(n.content,c),(0,B.jsx)(er,{present:r||a,children:(0,B.jsx)(Gu,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),Gu=z.forwardRef(ku(function(e,t){let{orientation:n=`vertical`,...r}=e,i=Fu(Bu,e.__scopeScrollArea),a=z.useRef(null),o=z.useRef(0),[s,c]=z.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=id(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:ku(e=>a.current=e,`onThumbChange`),onThumbPointerUp:ku(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:ku(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return od(e,o.current,s,t)}return ku(d,`getScrollPosition`),n===`horizontal`?(0,B.jsx)(Ku,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=sd(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,B.jsx)(qu,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=sd(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`)),Ku=z.forwardRef(ku(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Fu(Bu,e.__scopeScrollArea),[o,s]=z.useState(),c=z.useRef(null),l=f(t,c,a.onScrollbarXChange);return z.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,B.jsx)(Xu,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":ad(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),ld(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:rd(o.paddingLeft),paddingEnd:rd(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),qu=z.forwardRef(ku(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Fu(Bu,e.__scopeScrollArea),[o,s]=z.useState(),c=z.useRef(null),l=f(t,c,a.onScrollbarYChange);return z.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,B.jsx)(Xu,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":ad(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),ld(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:rd(o.paddingTop),paddingEnd:rd(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[Ju,Yu]=Mu(Bu),Xu=z.forwardRef(ku(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=e,m=Fu(Bu,n),[h,g]=z.useState(null),_=f(t,g),v=z.useRef(null),y=z.useRef(``),b=m.viewport,x=r.content-r.viewport,S=wi(u),C=wi(c),w=dd(d,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;l({x:t,y:n})}}return ku(T,`handleDragScroll`),z.useEffect(()=>{let e=ku(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]),z.useEffect(C,[r,C]),fd(h,w),fd(m.content,w),(0,B.jsx)(Ju,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:wi(a),onThumbPointerUp:wi(o),onThumbPositionChange:C,onThumbPointerDown:wi(s),children:(0,B.jsx)(Yn.div,{...p,ref:_,style:{position:`absolute`,...p.style},onPointerDown:Dn(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:Dn(e.onPointerMove,T),onPointerUp:Dn(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`)),Zu=`ScrollAreaThumb`,Qu=z.forwardRef(ku(function(e,t){let{forceMount:n,...r}=e,i=Yu(Zu,e.__scopeScrollArea);return(0,B.jsx)(er,{present:n||i.hasThumb,children:(0,B.jsx)($u,{ref:t,...r})})},`ScrollAreaThumb`)),$u=z.forwardRef(ku(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=Fu(Zu,n),o=Yu(Zu,n),{onThumbPositionChange:s}=o,c=f(t,o.onThumbChange),l=z.useRef(void 0),u=dd(()=>{l.current&&=(l.current(),void 0)},100);return z.useEffect(()=>{let e=a.viewport;if(e){let t=ku(()=>{if(u(),!l.current){let t=ud(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,B.jsx)(Yn.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Dn(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Dn(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),ed=`ScrollAreaCorner`,td=z.forwardRef(ku(function(e,t){let n=Fu(ed,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,B.jsx)(nd,{...e,ref:t}):null},`ScrollAreaCorner`)),nd=z.forwardRef(ku(function(e,t){let{__scopeScrollArea:n,...r}=e,i=Fu(ed,n),[a,o]=z.useState(0),[s,c]=z.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return fd(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),fd(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),z.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,B.jsx)(Yn.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 rd(e){return e?parseInt(e,10):0}ku(rd,`toInt`);function id(e,t){let n=e/t;return isNaN(n)?0:n}ku(id,`getThumbRatio`);function ad(e){let t=id(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}ku(ad,`getThumbSize`);function od(e,t,n,r=`ltr`){let i=ad(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 cd([c,l],d)(e)}ku(od,`getScrollPositionFromPointer`);function sd(e,t,n=`ltr`){let r=ad(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Du(e,n===`ltr`?[0,o]:[o*-1,0]);return cd([0,o],[0,s])(c)}ku(sd,`getThumbOffsetFromScroll`);function cd(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])}}ku(cd,`linearScale`);function ld(e,t){return e>0&&e<t}ku(ld,`isScrollingWithinScrollbarBounds`);var ud=ku((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return ku((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 dd(e,t){let n=wi(e),r=z.useRef(0);return z.useEffect(()=>()=>window.clearTimeout(r.current),[]),z.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}ku(dd,`useDebounceCallback`);function fd(e,t){let n=wi(t);Mn(()=>{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])}ku(fd,`useResizeObserver`);var pd=Iu,md=Ru,hd=td;function gd({className:e,children:t,...n}){return(0,B.jsxs)(pd,{"data-slot":`scroll-area`,className:k(`relative`,e),...n,children:[(0,B.jsx)(md,{"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,B.jsx)(_d,{}),(0,B.jsx)(hd,{})]})}function _d({className:e,orientation:t=`vertical`,...n}){return(0,B.jsx)(Vu,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:k(`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,B.jsx)(Qu,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var vd=Object.defineProperty,yd=(e,t)=>vd(e,`name`,{value:t,configurable:!0}),bd=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`}),xd=z.forwardRef(yd(function(e,t){return(0,B.jsx)(Yn.span,{...e,ref:t,style:{...bd,...e.style}})},`VisuallyHidden`)),Sd=Object.defineProperty,Cd=(e,t)=>Sd(e,`name`,{value:t,configurable:!0}),wd=`horizontal`,Td=[`horizontal`,`vertical`],Ed=z.forwardRef(Cd(function(e,t){let{decorative:n,orientation:r=wd,...i}=e,a=Dd(r)?r:wd,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,B.jsx)(Yn.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function Dd(e){return Td.includes(e)}Cd(Dd,`isValidOrientation`);var Od=Ed;function kd({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,B.jsx)(Od,{"data-slot":`separator`,decorative:n,orientation:t,className:k(`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 Ad({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`skeleton`,className:k(`animate-pulse rounded-md bg-accent`,e),...t})}var jd=Object.defineProperty,Md=(e,t)=>jd(e,`name`,{value:t,configurable:!0}),Nd=!1;function Pd(){let[e,t]=z.useState(Nd);return z.useEffect(()=>{Nd||(Nd=!0,t(!0))},[]),e}Md(Pd,`useIsHydrated`);var Fd=z.useSyncExternalStore;function Id(){return()=>{}}Md(Id,`subscribe`);function Ld(){return Fd(Id,()=>!0,()=>!1)}Md(Ld,`useIsHydratedModern`);var Rd=typeof Fd==`function`?Ld:Pd,zd=Object.defineProperty,Bd=(e,t)=>zd(e,`name`,{value:t,configurable:!0}),Vd=`rovingFocusGroup.onEntryFocus`,Hd={bubbles:!1,cancelable:!0},Ud=`RovingFocusGroup`,[Wd,Gd,Kd]=pn(Ud),[qd,Jd]=ln(Ud,[Kd]),[Yd,Xd]=qd(Ud),Zd=z.forwardRef(Bd(function(e,t){return(0,B.jsx)(Wd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(Wd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(Qd,{...e,ref:t})})})},`RovingFocusGroup`)),Qd=z.forwardRef(Bd(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=z.useRef(null),m=f(t,p),h=jr(a),[g,_]=Vn({prop:o,defaultProp:s??null,onChange:c,caller:Ud}),[v,y]=z.useState(!1),b=wi(l),x=Gd(n),S=z.useRef(!1),[C,w]=z.useState(0);return z.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Vd,b),()=>e.removeEventListener(Vd,b)},[b]),(0,B.jsx)(Yd,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:z.useCallback(e=>_(e),[_]),onItemShiftTab:z.useCallback(()=>y(!0),[]),onFocusableItemAdd:z.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:z.useCallback(()=>w(e=>e-1),[]),children:(0,B.jsx)(Yn.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:Dn(e.onMouseDown,()=>{S.current=!0}),onFocus:Dn(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Vd,Hd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);af([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Dn(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),$d=`RovingFocusGroupItem`,ef=z.forwardRef(Bd(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=ur(),l=a||c,u=Xd($d,n),d=u.currentTabStopId===l,f=Gd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Rd();return Mn(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),z.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,B.jsx)(Wd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(Yn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Dn(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Dn(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Dn(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=rf(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?of(n,r+1):n.slice(r+1)}setTimeout(()=>af(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),tf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function nf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Bd(nf,`getDirectionAwareKey`);function rf(e,t,n){let r=nf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return tf[r]}Bd(rf,`getFocusIntent`);function af(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Bd(af,`focusFirst`);function of(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Bd(of,`wrapArray`);var sf=Zd,cf=ef,lf=Object.defineProperty,uf=(e,t)=>lf(e,`name`,{value:t,configurable:!0}),df=`Tabs`,[ff,pf]=ln(df,[Jd]),mf=Jd(),[hf,gf]=ff(df),_f=z.forwardRef(uf(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=jr(s),[d,f]=Vn({prop:r,onChange:i,defaultProp:a??``,caller:df});return(0,B.jsx)(hf,{scope:n,baseId:ur(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,B.jsx)(Yn.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),vf=`TabsList`,yf=z.forwardRef(uf(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=gf(vf,n),o=mf(n);return(0,B.jsx)(sf,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,B.jsx)(Yn.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),bf=`TabsTrigger`,xf=z.forwardRef(uf(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=gf(bf,n),s=mf(n),c=wf(o.baseId,r),l=Tf(o.baseId,r),u=r===o.value;return(0,B.jsx)(cf,{asChild:!0,...s,focusable:!i,active:u,children:(0,B.jsx)(Yn.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:Dn(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Dn(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Dn(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Sf=`TabsContent`,Cf=z.forwardRef(uf(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=gf(Sf,n),c=wf(s.baseId,r),l=Tf(s.baseId,r),u=r===s.value,d=z.useRef(u);return z.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,B.jsx)(er,{present:i||u,children:({present:n})=>(0,B.jsx)(Yn.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 wf(e,t){return`${e}-trigger-${t}`}uf(wf,`makeTriggerId`);function Tf(e,t){return`${e}-content-${t}`}uf(Tf,`makeContentId`);var Ef=_f,Df=yf,Of=xf,kf=Cf;function Af({className:e,orientation:t=`horizontal`,...n}){return(0,B.jsx)(Ef,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:k(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var jf=D(`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 Mf({className:e,variant:t=`default`,...n}){return(0,B.jsx)(Df,{"data-slot":`tabs-list`,"data-variant":t,className:k(jf({variant:t}),e),...n})}function Nf({className:e,...t}){return(0,B.jsx)(Of,{"data-slot":`tabs-trigger`,className:k(`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 Pf({className:e,...t}){return(0,B.jsx)(kf,{"data-slot":`tabs-content`,className:k(`flex-1 outline-none`,e),...t})}var Ff=Object.defineProperty,If=(e,t)=>Ff(e,`name`,{value:t,configurable:!0}),[Lf,Rf]=ln(`Tooltip`,[au]),zf=au(),Bf=`TooltipProvider`,Vf=700,Hf=`tooltip.open`,[Uf,Wf]=Lf(Bf),Gf=If(e=>{let{__scopeTooltip:t,delayDuration:n=Vf,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=z.useRef(!0),s=z.useRef(!1),c=z.useRef(0);return z.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(Uf,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:z.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:z.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:z.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Kf=`Tooltip`,[qf,Jf]=Lf(Kf),Yf=If(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Wf(Kf,e.__scopeTooltip),l=zf(t),[u,d]=z.useState(null),[f,p]=z.useState(void 0),m=ur(),h=z.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=z.useRef(!1),[y,b]=Vn({prop:r,defaultProp:i??!1,onChange:If(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Hf))):c.onClose(),a?.(e)},`onChange`),caller:Kf}),x=z.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=z.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=z.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=z.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);z.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,B.jsx)(xu,{...l,children:(0,B.jsx)(qf,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:z.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:z.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),Xf=`TooltipTrigger`,Zf=z.forwardRef(If(function(e,t){let{__scopeTooltip:n,...r}=e,i=Jf(Xf,n),a=Wf(Xf,n),o=zf(n),s=f(t,z.useRef(null),i.onTriggerChange),c=z.useRef(!1),l=z.useRef(!1),u=z.useCallback(()=>c.current=!1,[]);return z.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,B.jsx)(Su,{asChild:!0,...o,children:(0,B.jsx)(Yn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Dn(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Dn(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Dn(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Dn(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Dn(e.onBlur,i.onClose),onClick:Dn(e.onClick,i.onClose)})})},`TooltipTrigger`)),Qf=`TooltipPortal`,[$f,ep]=Lf(Qf,{forceMount:void 0}),tp=If(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Jf(Qf,t);return(0,B.jsx)($f,{scope:t,forceMount:n,children:(0,B.jsx)(er,{present:n||a.open,children:(0,B.jsx)(Ta,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),np=`TooltipContent`,rp=z.forwardRef(If(function(e,t){let n=ep(np,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Jf(np,e.__scopeTooltip);return(0,B.jsx)(er,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(op,{side:i,...a,ref:t}):(0,B.jsx)(ip,{side:i,...a,ref:t})})},`TooltipContent`)),ip=z.forwardRef(If(function(e,t){let n=Jf(np,e.__scopeTooltip),r=Wf(np,e.__scopeTooltip),i=z.useRef(null),a=f(t,i),[o,s]=z.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,p=z.useCallback(()=>{s(null),d(!1)},[d]),m=z.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=lp(r,cp(r,n.getBoundingClientRect())),a=up(t.getBoundingClientRect()),o=fp([...i,...a]);s(o),d(!0)},[d]);return z.useEffect(()=>()=>p(),[p]),z.useEffect(()=>{if(c&&u){let e=If(e=>m(e,u),`handleTriggerLeave`),t=If(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),z.useEffect(()=>{if(o){let e=If(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!dp(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,B.jsx)(op,{...e,ref:a})},`TooltipContentHoverable`)),ap=Ce(`TooltipContent`),op=z.forwardRef(If(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Jf(np,n),u=zf(n),{onClose:d}=l;z.useEffect(()=>(document.addEventListener(Hf,d),()=>document.removeEventListener(Hf,d)),[d]),z.useEffect(()=>{if(l.trigger){let e=If(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 Mn(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,B.jsx)(ea,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,B.jsxs)(Cu,{"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,B.jsx)(ap,{children:r}),i?(0,B.jsx)(xd,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),sp=z.forwardRef(If(function(e,t){let{__scopeTooltip:n,...r}=e,i=zf(n);return(0,B.jsx)(wu,{...i,...r,ref:t})},`TooltipArrow`));function cp(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`)}}If(cp,`getExitSideFromRect`);function lp(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}If(lp,`getPaddedExitPoints`);function up(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}]}If(up,`getPointsFromRect`);function dp(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}If(dp,`isPointInPolygon`);function fp(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)),pp(t)}If(fp,`getHull`);function pp(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)}If(pp,`getHullPresorted`);var mp=Gf,hp=Yf,gp=Zf,_p=tp,vp=rp,yp=sp;function bp({delayDuration:e=0,...t}){return(0,B.jsx)(mp,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function xp({...e}){return(0,B.jsx)(hp,{"data-slot":`tooltip`,...e})}function Sp({...e}){return(0,B.jsx)(gp,{"data-slot":`tooltip-trigger`,...e})}function Cp({className:e,sideOffset:t=0,children:n,...r}){return(0,B.jsx)(_p,{children:(0,B.jsxs)(vp,{"data-slot":`tooltip-content`,sideOffset:t,className:k(`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,B.jsx)(yp,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var wp={completed:`Completed`,failed:`Failed`,running:`Running`,stopped:`Stopped`};function Tp({state:e}){let t=Object.hasOwn(wp,e)?e:`unknown`;return(0,B.jsxs)(T,{className:k(`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,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),wp[e]??e]})}var Ep=`tool_result`;function Dp(...e){for(let t of e)if(t!=null)return t;return null}function Op(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.call&&!n.result)return n}}function kp({call:e,result:t}){let n=e??t,r=n?.kind??Ep;return{eventIndices:[e?.index,t?.index].filter(e=>e!==void 0),durationMs:Dp(e?.durationMs,t?.durationMs),finishedAt:Dp(e?.finishedAt,t?.finishedAt),id:`tool-${n?.index??0}`,input:e?.input??t?.input,kind:r,name:Dp(e?.name,t?.name)??r,output:Dp(t?.output,e?.output),startedAt:Dp(e?.startedAt,t?.startedAt),status:Dp(e?.status,t?.status),timingSource:Dp(e?.timingSource,t?.timingSource),toolCallId:Dp(e?.toolCallId,t?.toolCallId)}}function Ap(e){let t=[],n=new Map;for(let r of e){if(r.kind===Ep){let e=r.toolCallId?n.get(r.toolCallId):Op(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(kp)}var jp=[{id:`turns`,label:`Turns`},{id:`phases`,label:`Phases`},{id:`tools`,label:`Tools`}];function Mp(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function Np(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function Pp(e){let t=[],n=[];for(let r of e.turns){let e=Mp(r.startedAt)??Mp(r.timestamp);if(e===null)continue;let i=Np(r.durationMs),a=Mp(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=Np(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=Np(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 Ap(r.tools)){let i=Mp(n.startedAt)??e,a=Np(n.durationMs),o=Mp(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=Mp(e.startedAt);return{items:t,lanes:jp.filter(e=>t.some(t=>t.laneId===e.id)),markers:n,...r===null?{}:{origin:r}}}function Fp({cursor:e,focus:t,expanded:n,onExpandedChange:r,onSelectTurn:i,selectedTurnId:a,turns:o}){let[s,c]=(0,z.useState)(!1),l=n??s,u=Pp({turns:o}),d=o.find(e=>e.id===t?.turnId),f=d&&t?Ap(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,B.jsx)(an,{...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 Ip(e){let t=(0,z.useRef)(null),n=(0,z.useRef)(new Map),[r,i]=(0,z.useState)(),a=(0,z.useRef)(new Map);a.current=new Map(e.map(e=>[e.id,e.time]));let o=(0,z.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,z.useCallback)(e=>{t.current?.removeEventListener(`scroll`,o),t.current=e,e?.addEventListener(`scroll`,o,{passive:!0}),o()},[o]);return(0,z.useEffect)(()=>{o();let e=t.current;return()=>e?.removeEventListener(`scroll`,o)},[o]),{containerRef:s,cursor:r,register:(0,z.useCallback)((e,t)=>{t?n.current.set(e,t):n.current.delete(e)},[]),scrollTo:(0,z.useCallback)(e=>{n.current.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`});let t=a.current.get(e);t!==void 0&&i(t)},[])}}function Lp({className:e,from:t,...n}){return(0,B.jsx)(`div`,{className:k(t===`user`?`flex justify-end`:`grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-3.5`,e),"data-message-author":t,...n})}function Rp({className:e,...t}){return(0,B.jsx)(`div`,{className:k(`min-w-0`,e),...t})}function zp({children:e,src:t}){return(0,B.jsxs)(Bi,{"aria-hidden":`true`,className:`size-8 rounded-[9px]`,children:[t?(0,B.jsx)(Hi,{alt:``,src:t}):null,(0,B.jsx)(Vi,{className:`bg-primary text-[9px] font-extrabold text-primary-foreground`,children:e})]})}var Bp=/"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g;function Vp(e){try{return JSON.parse(e)}catch{return}}function Hp(e,t=2){try{return JSON.stringify(e,null,t)??String(e)}catch{return String(e)}}function Up(e){return Hp(e,0)}function Wp(e,t){return e.startsWith(`"`)?t?`hljs-attr`:`hljs-string`:e===`true`||e===`false`||e===`null`?`hljs-literal`:`hljs-number`}function Gp(e){let t=[],n=0;for(let r of e.matchAll(Bp)){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,B.jsx)(`span`,{className:Wp(i,o),children:i},`${a}-${i.length}`))}return n<e.length&&t.push(e.slice(n)),t}function Kp({className:e,label:t,value:n}){return(0,B.jsx)(`pre`,{"aria-label":t,className:k(`message-json`,e),children:(0,B.jsx)(`code`,{children:Gp(Hp(n))})})}function qp(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Jp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xp={};function Zp(e,t){return((t||Xp).jsx?Yp:Jp).test(e)}var Qp=/[ \t\n\f\r]/g;function $p(e){return typeof e==`object`?e.type===`text`&&em(e.value):em(e)}function em(e){return e.replace(Qp,``)===``}var tm=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};tm.prototype.normal={},tm.prototype.property={},tm.prototype.space=void 0;function nm(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new tm(n,r,t)}function rm(e){return e.toLowerCase()}var im=class{constructor(e,t){this.attribute=t,this.property=e}};im.prototype.attribute=``,im.prototype.booleanish=!1,im.prototype.boolean=!1,im.prototype.commaOrSpaceSeparated=!1,im.prototype.commaSeparated=!1,im.prototype.defined=!1,im.prototype.mustUseProperty=!1,im.prototype.number=!1,im.prototype.overloadedBoolean=!1,im.prototype.property=``,im.prototype.spaceSeparated=!1,im.prototype.space=void 0;var am=w({boolean:()=>V,booleanish:()=>sm,commaOrSpaceSeparated:()=>dm,commaSeparated:()=>um,number:()=>H,overloadedBoolean:()=>cm,spaceSeparated:()=>lm}),om=0,V=fm(),sm=fm(),cm=fm(),H=fm(),lm=fm(),um=fm(),dm=fm();function fm(){return 2**++om}var pm=Object.keys(am),mm=class extends im{constructor(e,t,n,r){let i=-1;if(super(e,t),hm(this,`space`,r),typeof n==`number`)for(;++i<pm.length;){let e=pm[i];hm(this,pm[i],(n&am[e])===am[e])}}};mm.prototype.defined=!0;function hm(e,t,n){n&&(e[t]=n)}function gm(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new mm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[rm(r)]=r,n[rm(a.attribute)]=r}return new tm(t,n,e.space)}var _m=gm({properties:{ariaActiveDescendant:null,ariaAtomic:sm,ariaAutoComplete:null,ariaBusy:sm,ariaChecked:sm,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:lm,ariaCurrent:null,ariaDescribedBy:lm,ariaDetails:null,ariaDisabled:sm,ariaDropEffect:lm,ariaErrorMessage:null,ariaExpanded:sm,ariaFlowTo:lm,ariaGrabbed:sm,ariaHasPopup:null,ariaHidden:sm,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lm,ariaLevel:H,ariaLive:null,ariaModal:sm,ariaMultiLine:sm,ariaMultiSelectable:sm,ariaOrientation:null,ariaOwns:lm,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:sm,ariaReadOnly:sm,ariaRelevant:null,ariaRequired:sm,ariaRoleDescription:lm,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:sm,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function vm(e,t){return t in e?e[t]:t}function ym(e,t){return vm(e,t.toLowerCase())}var bm=gm({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:um,acceptCharset:lm,accessKey:lm,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alpha:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:lm,autoFocus:V,autoPlay:V,blocking:lm,capture:null,charSet:null,checked:V,cite:null,className:lm,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:sm,controls:V,controlsList:lm,coords:H|um,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:cm,draggable:sm,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:lm,height:H,hidden:cm,high:H,href:null,hrefLang:null,htmlFor:lm,httpEquiv:lm,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:lm,itemRef:lm,itemScope:V,itemType:lm,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,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:V,optimum:H,pattern:null,ping:lm,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:lm,required:V,reversed:V,rows:H,rowSpan:H,sandbox:lm,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootCustomElementRegistry:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shadowRootSerializable:V,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:sm,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:sm,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lm,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:sm,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:V,disablePictureInPicture:V,disableRemotePlayback:V,exportParts:um,part:lm,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:ym}),xm=gm({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:dm,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:lm,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:um,g2:um,glyphName:um,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:dm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lm,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dm,rev:dm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dm,requiredFeatures:dm,requiredFonts:dm,requiredFormats:dm,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:dm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dm,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:vm}),Sm=gm({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()}}),Cm=gm({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ym}),wm=gm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Tm={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`},Em=/[A-Z]/g,Dm=/-[a-z]/g,Om=/^data[-\w.:]+$/i;function km(e,t){let n=rm(t),r=t,i=im;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Om.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Dm,jm);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Dm.test(e)){let n=e.replace(Em,Am);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=mm}return new i(r,t)}function Am(e){return`-`+e.toLowerCase()}function jm(e){return e.charAt(1).toUpperCase()}var Mm=nm([_m,bm,Sm,Cm,wm],`html`),Nm=nm([_m,xm,Sm,Cm,wm],`svg`);function Pm(e){return e.join(` `).trim()}var Fm=Pe(((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})),Im=Pe((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(Fm());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}})),Lm=Pe((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))}})),Rm=Pe(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Im()),r=Lm();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})),zm=Vm(`end`),Bm=Vm(`start`);function Vm(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 Hm(e){let t=Bm(e),n=zm(e);if(t&&n)return{start:t,end:n}}function Um(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gm(e.position):`start`in e||`end`in e?Gm(e):`line`in e||`column`in e?Wm(e):``}function Wm(e){return Km(e&&e.line)+`:`+Km(e&&e.column)}function Gm(e){return Wm(e&&e.start)+`-`+Wm(e&&e.end)}function Km(e){return e&&typeof e==`number`?e:1}var qm=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=Um(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}};qm.prototype.file=``,qm.prototype.name=``,qm.prototype.reason=``,qm.prototype.message=``,qm.prototype.stack=``,qm.prototype.column=void 0,qm.prototype.line=void 0,qm.prototype.ancestors=void 0,qm.prototype.cause=void 0,qm.prototype.fatal=void 0,qm.prototype.place=void 0,qm.prototype.ruleId=void 0,qm.prototype.source=void 0;var Jm=s(Rm(),1),Ym={}.hasOwnProperty,Xm=new Map,Zm=/[A-Z]/g,Qm=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),$m=new Set([`td`,`th`]);function eh(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=dh(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=uh(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`?Nm:Mm,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=th(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function th(e,t,n){if(t.type===`element`)return nh(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return rh(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return ah(e,t,n);if(t.type===`mdxjsEsm`)return ih(e,t);if(t.type===`root`)return oh(e,t,n);if(t.type===`text`)return sh(e,t)}function nh(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Nm,e.schema=i),e.ancestors.push(t);let a=_h(e,t.tagName,!1),o=fh(e,t),s=mh(e,t);return Qm.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!$p(e)})),ch(e,o,a,t),lh(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rh(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)}vh(e,t.position)}function ih(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vh(e,t.position)}function ah(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Nm,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:_h(e,t.name,!0),o=ph(e,t),s=mh(e,t);return ch(e,o,a,t),lh(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function oh(e,t,n){let r={};return lh(r,mh(e,t)),e.create(t,e.Fragment,r,n)}function sh(e,t){return t.value}function ch(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function lh(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function uh(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 dh(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Bm(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 fh(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ym.call(t.properties,i)){let a=hh(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&$m.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 ph(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 vh(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 vh(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function mh(e,t){let n=[],r=-1,i=e.passKeys?new Map:Xm;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=th(e,a,o);s!==void 0&&n.push(s)}return n}function hh(e,t,n){let r=km(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qp(n):Pm(n)),r.property===`style`){let t=typeof n==`object`?n:gh(e,String(n));return e.stylePropertyNameCase===`css`&&(t=yh(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Tm[r.property]||r.property:r.attribute,n]}}function gh(e,t){try{return(0,Jm.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new qm("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 _h(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=Zp(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=Zp(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ym.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);vh(e)}function vh(e,t){let n=new qm("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 yh(e){let t={},n;for(n in e)Ym.call(e,n)&&(t[bh(n)]=e[n]);return t}function bh(e){let t=e.replace(Zm,xh);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function xh(e){return`-`+e.toLowerCase()}var Sh={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`]},Ch={};function wh(e,t){let n=t||Ch;return Th(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Th(e,t,n){if(Dh(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 Eh(e.children,t,n)}return Array.isArray(e)?Eh(e,t,n):``}function Eh(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Th(e[i],t,n);return r.join(``)}function Dh(e){return!!(e&&typeof e==`object`)}var Oh=document.createElement(`i`);function kh(e){let t=`&`+e+`;`;Oh.innerHTML=t;let n=Oh.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Ah(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 jh(e,t){return e.length>0?(Ah(e,e.length,0,t),e):t}var Mh={}.hasOwnProperty;function Nh(e){let t={},n=-1;for(;++n<e.length;)Ph(t,e[n]);return t}function Ph(e,t){let n;for(n in t){let r=(Mh.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Mh.call(r,a)||(r[a]=[]);let e=i[a];Fh(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Fh(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ah(e,0,0,r)}function Ih(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 Lh(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Rh=Yh(/[A-Za-z]/),zh=Yh(/[\dA-Za-z]/),Bh=Yh(/[#-'*+\--9=?A-Z^-~]/);function Vh(e){return e!==null&&(e<32||e===127)}var Hh=Yh(/\d/),Uh=Yh(/[\dA-Fa-f]/),Wh=Yh(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function Gh(e){return e!==null&&(e<0||e===32)}function Kh(e){return e===-2||e===-1||e===32}var qh=Yh(/\p{P}|\p{S}/u),Jh=Yh(/\s/);function Yh(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Xh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&zh(e.charCodeAt(n+1))&&zh(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 Zh(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Kh(r)?(e.enter(n),s(r)):t(r)}function s(r){return Kh(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Qh={tokenize:$h};function $h(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`),Zh(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 U(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var eg={tokenize:ng},tg={tokenize:rg};function ng(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 Ah(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(tg,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(tg,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 U(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++;Ah(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 rg(e,t,n){return Zh(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function ig(e){if(e===null||Gh(e)||Jh(e))return 1;if(qh(e))return 2}function ag(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 og={name:`attention`,resolveAll:sg,tokenize:cg};function sg(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};lg(d,-c),lg(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=jh(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=jh(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=jh(l,ag(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=jh(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=jh(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Ah(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 cg(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ig(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=ig(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 lg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ug={name:`autolink`,tokenize:dg};function dg(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 Rh(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||zh(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||zh(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||Vh(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Bh(t)?(e.consume(t),l):n(t)}function u(e){return zh(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||zh(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var fg={partial:!0,tokenize:pg};function pg(e,t,n){return r;function r(t){return Kh(t)?Zh(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||U(e)?t(e):n(e)}}var mg={continuation:{tokenize:gg},exit:_g,name:`blockQuote`,tokenize:hg};function hg(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 Kh(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function gg(e,t,n){let r=this;return i;function i(t){return Kh(t)?Zh(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(mg,t,n)(r)}}function _g(e){e.exit(`blockQuote`)}var vg={name:`characterEscape`,tokenize:yg};function yg(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 Wh(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var bg={name:`characterReference`,tokenize:xg};function xg(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=zh,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=Uh,u):(e.enter(`characterReferenceValue`),a=7,o=Hh,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===zh&&!kh(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 Sg={partial:!0,tokenize:Tg},Cg={concrete:!0,name:`codeFenced`,tokenize:wg};function wg(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`),Kh(t)?Zh(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||U(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Sg,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Kh(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Zh(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||U(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||U(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&&Kh(t)?Zh(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||U(t)?e.check(Sg,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||U(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`),Kh(t)?Zh(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`),Kh(t)?Zh(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||U(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Tg(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 Eg={name:`codeIndented`,tokenize:Og},Dg={partial:!0,tokenize:kg};function Og(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Zh(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):U(t)?e.attempt(Dg,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||U(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function kg(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Zh(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):U(e)?i(e):n(e)}}var Ag={name:`codeText`,previous:Mg,resolve:jg,tokenize:Ng};function jg(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 Mg(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ng(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)):U(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||U(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 Pg=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&&Fg(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),Fg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Fg(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);Fg(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Fg(this.left,t.reverse())}}};function Fg(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 Ig(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Pg(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,Lg(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 Ah(e,0,1/0,u.slice(0)),!l}function Lg(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 Rg={resolve:Bg,tokenize:Vg},zg={partial:!0,tokenize:Hg};function Bg(e){return Ig(e),e}function Vg(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):U(t)?e.check(zg,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 Hg(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Zh(e,a,`linePrefix`)}function a(i){if(i===null||U(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 Ug(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||Vh(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||U(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||Gh(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||Vh(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 Wg(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):U(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||U(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Kh(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Gg(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):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Zh(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||U(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 Kg(e,t){let n;return r;function r(i){return U(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Kh(i)?Zh(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var qg={name:`definition`,tokenize:Yg},Jg={partial:!0,tokenize:Xg};function Yg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Wg.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Lh(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 Gh(t)?Kg(e,l)(t):l(t)}function l(t){return Ug(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Jg,d,d)(t)}function d(t){return Kh(t)?Zh(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||U(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Xg(e,t,n){return r;function r(t){return Gh(t)?Kg(e,i)(t):n(t)}function i(t){return Gg(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Kh(t)?Zh(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||U(e)?t(e):n(e)}}var Zg={name:`hardBreakEscape`,tokenize:Qg};function Qg(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return U(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var $g={name:`headingAtx`,resolve:e_,tokenize:t_};function e_(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`},Ah(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function t_(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||Gh(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||U(n)?(e.exit(`atxHeading`),t(n)):Kh(n)?Zh(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||Gh(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var n_=`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(`.`),r_=[`pre`,`script`,`style`,`textarea`],i_={concrete:!0,name:`htmlFlow`,resolveTo:s_,tokenize:c_},a_={partial:!0,tokenize:u_},o_={partial:!0,tokenize:l_};function s_(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 c_(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):Rh(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):Rh(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 Rh(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Gh(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&r_.includes(l)?(i=1,r.interrupt?t(s):O(s)):n_.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||zh(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 Kh(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Rh(t)?(e.consume(t),b):Kh(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||zh(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Kh(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):Kh(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||U(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||Gh(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Kh(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||U(t)?O(t):Kh(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),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):U(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(a_,L,k)(t)):t===null||U(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(o_,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||U(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 r_.includes(n)?(e.consume(t),ee):O(t)}return Rh(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),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||U(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),ee)}function L(n){return e.exit(`htmlFlow`),t(n)}}function l_(e,t,n){let r=this;return i;function i(t){return U(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 u_(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(fg,t,n)}}var d_={name:`htmlText`,tokenize:f_};function f_(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):Rh(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):Rh(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):U(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):U(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):U(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):U(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Rh(t)?(e.consume(t),S):n(t)}function S(t){return t===45||zh(t)?(e.consume(t),S):C(t)}function C(t){return U(t)?(o=C,N(t)):Kh(t)?(e.consume(t),C):M(t)}function w(t){return t===45||zh(t)?(e.consume(t),w):t===47||t===62||Gh(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Rh(t)?(e.consume(t),E):U(t)?(o=T,N(t)):Kh(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||zh(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):U(t)?(o=D,N(t)):Kh(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):U(t)?(o=O,N(t)):Kh(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):U(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||Gh(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Gh(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 Kh(t)?Zh(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 p_={name:`labelEnd`,resolveAll:__,resolveTo:v_,tokenize:y_},m_={tokenize:b_},h_={tokenize:x_},g_={tokenize:S_};function __(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&&Ah(e,0,e.length,n),e}function v_(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=jh(s,e.slice(a+1,a+r+3)),s=jh(s,[[`enter`,u,t]]),s=jh(s,ag(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=jh(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=jh(s,e.slice(o+1)),s=jh(s,[[`exit`,c,t]]),Ah(e,a,e.length,s),e}function y_(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(Lh(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(m_,u,o?u:d)(t):t===91?e.attempt(h_,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(g_,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function b_(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 Gh(t)?Kg(e,a)(t):a(t)}function a(t){return t===41?u(t):Ug(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Gh(t)?Kg(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Gg(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Gh(t)?Kg(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 x_(e,t,n){let r=this;return i;function i(t){return Wg.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Lh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function S_(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 C_={name:`labelStartImage`,resolveAll:p_.resolveAll,tokenize:w_};function w_(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 T_={name:`labelStartLink`,resolveAll:p_.resolveAll,tokenize:E_};function E_(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 D_={name:`lineEnding`,tokenize:O_};function O_(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Zh(e,t,`linePrefix`)}}var k_={name:`thematicBreak`,tokenize:A_};function A_(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||U(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Kh(t)?Zh(e,s,`whitespace`)(t):s(t))}}var j_={continuation:{tokenize:F_},exit:L_,name:`list`,tokenize:P_},M_={partial:!0,tokenize:R_},N_={partial:!0,tokenize:I_};function P_(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:Hh(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(k_,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 Hh(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(fg,r.interrupt?n:u,e.attempt(M_,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Kh(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 F_(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(fg,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Zh(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Kh(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(N_,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Zh(e,e.attempt(j_,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function I_(e,t,n){let r=this;return Zh(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 L_(e){e.exit(this.containerState.type)}function R_(e,t,n){let r=this;return Zh(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!Kh(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var z_={name:`setextUnderline`,resolveTo:B_,tokenize:V_};function B_(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 V_(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`),Kh(t)?Zh(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||U(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var H_={tokenize:U_};function U_(e){let t=this,n=e.attempt(fg,r,e.attempt(this.parser.constructs.flowInitial,i,Zh(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Rg,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 W_={resolveAll:J_()},G_=q_(`string`),K_=q_(`text`);function q_(e){return{resolveAll:J_(e===`text`?Y_: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 J_(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 Y_(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 X_=w({attentionMarkers:()=>iv,contentInitial:()=>Q_,disable:()=>av,document:()=>Z_,flow:()=>ev,flowInitial:()=>$_,insideSpan:()=>rv,string:()=>tv,text:()=>nv}),Z_={42:j_,43:j_,45:j_,48:j_,49:j_,50:j_,51:j_,52:j_,53:j_,54:j_,55:j_,56:j_,57:j_,62:mg},Q_={91:qg},$_={[-2]:Eg,[-1]:Eg,32:Eg},ev={35:$g,42:k_,45:[z_,k_],60:i_,61:z_,95:k_,96:Cg,126:Cg},tv={38:bg,92:vg},nv={[-5]:D_,[-4]:D_,[-3]:D_,33:C_,38:bg,42:og,60:[ug,d_],91:T_,92:[Zg,vg],93:p_,95:og,96:Ag},rv={null:[og,W_]},iv={null:[42,95]},av={null:[]};function ov(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=jh(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=ag(a,l.events,l),l.events):[]}function f(e,t){return cv(p(e),t)}function p(e){return sv(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){U(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&&Ah(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 sv(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 cv(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
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 ov(e){let t={constructs:Ah([q_,...(e||{}).extensions||[]]),content:n(Yh),defined:[],document:n(Zh),flow:n(z_),lazy:{},string:n(H_),text:n(U_)};return t;function n(e){return n;function n(n){return rv(t,e,n)}}}function sv(e){for(;!Ng(e););return e}var cv=/[\0\t\n\r]/g;function lv(){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(cv.lastIndex=u,c=cv.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 uv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dv(e){return e.replace(uv,fv)}function fv(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Nh(n.slice(t?2:1),t?16:10)}return Eh(n)||e}var pv={}.hasOwnProperty;function mv(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),hv(n)(sv(ov(n).document().write(lv()(e,t,!0))))}function hv(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(pe),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(me),hardBreakTrailing:a(me),htmlFlow:a(he,o),htmlFlowData:T,htmlText:a(he,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(pe),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ie,characterReference:ae,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:ne,resourceDestinationString:I,resourceTitleString:ee,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};_v(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]];pv.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]||yv).call(a,void 0,e[0])}for(r.position={start:gv(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:gv(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:gv(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]||yv).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Bm({start:e.start,end:e.end})+`): it’s not open`);n.position.end=gv(e.end)}function u(){return xh(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=Ph(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=Se(),n.position={start:gv(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=gv(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=gv(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=dv(t),n.identifier=Ph(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 ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ph(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function re(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Nh(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Eh(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=gv(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function pe(){return{type:`heading`,depth:0,children:[]}}function me(){return{type:`break`}}function he(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function gv(e){return{line:e.line,column:e.column,offset:e.offset}}function _v(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?_v(e,r):vv(e,r)}}function vv(e,t){let n;for(n in t)if(pv.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 yv(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Bm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bm({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Bm({start:t.start,end:t.end})+`) is still open`)}function bv(e){let t=this;t.parser=n;function n(n){return mv(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function xv(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 Sv(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
45
- `}]}function Cv(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 wv(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tv(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ev(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=qh(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 Dv(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 Ov(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kv(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 Av(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kv(e,t);let i={src:qh(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 jv(e,t){let n={src:qh(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 Mv(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 Nv(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kv(e,t);let i={href:qh(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 Pv(e,t){let n={href:qh(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 Fv(e,t,n){let r=e.all(t),i=n?Iv(n):Lv(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:`
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 lv(e){let t={constructs:Nh([X_,...(e||{}).extensions||[]]),content:n(Qh),defined:[],document:n(eg),flow:n(H_),lazy:{},string:n(G_),text:n(K_)};return t;function n(e){return n;function n(n){return ov(t,e,n)}}}function uv(e){for(;!Ig(e););return e}var dv=/[\0\t\n\r]/g;function fv(){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(dv.lastIndex=u,c=dv.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 pv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mv(e){return e.replace(pv,hv)}function hv(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ih(n.slice(t?2:1),t?16:10)}return kh(n)||e}var gv={}.hasOwnProperty;function _v(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),vv(n)(uv(lv(n).document().write(fv()(e,t,!0))))}function vv(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(pe),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(me),hardBreakTrailing:a(me),htmlFlow:a(he,o),htmlFlowData:T,htmlText:a(he,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(pe),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ie,characterReference:ae,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:ne,resourceDestinationString:I,resourceTitleString:ee,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};bv(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]];gv.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]||Sv).call(a,void 0,e[0])}for(r.position={start:yv(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:yv(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:yv(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]||Sv).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Um({start:e.start,end:e.end})+`): it’s not open`);n.position.end=yv(e.end)}function u(){return wh(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=Lh(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=Se(),n.position={start:yv(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=yv(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=yv(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=mv(t),n.identifier=Lh(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 ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Lh(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function re(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ih(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=kh(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=yv(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function pe(){return{type:`heading`,depth:0,children:[]}}function me(){return{type:`break`}}function he(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function yv(e){return{line:e.line,column:e.column,offset:e.offset}}function bv(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?bv(e,r):xv(e,r)}}function xv(e,t){let n;for(n in t)if(gv.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 Sv(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Um({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Um({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Um({start:t.start,end:t.end})+`) is still open`)}function Cv(e){let t=this;t.parser=n;function n(n){return _v(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function wv(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 Tv(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
45
+ `}]}function Ev(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 Dv(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ov(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kv(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Xh(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 Av(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 jv(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Mv(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 Nv(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mv(e,t);let i={src:Xh(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 Pv(e,t){let n={src:Xh(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 Fv(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 Iv(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mv(e,t);let i={href:Xh(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 Lv(e,t){let n={href:Xh(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 Rv(e,t,n){let r=e.all(t),i=n?zv(n):Bv(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
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 Iv(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Lv(n[r])}return t}function Lv(e){return e.spread??e.children.length>1}function Rv(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 zv(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bv(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Vv(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hv(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=Lm(t.children[1]),o=Im(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 Uv(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 Wv(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Gv=9,Kv=32;function qv(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Jv(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Jv(t.slice(i),i>0,!1)),a.join(``)}function Jv(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Gv||t===Kv;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Gv||t===Kv;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Yv(e,t){let n={type:`text`,value:qv(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xv(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Zv={blockquote:xv,break:Sv,code:Cv,delete:wv,emphasis:Tv,footnoteReference:Ev,heading:Dv,html:Ov,imageReference:Av,image:jv,inlineCode:Mv,linkReference:Nv,link:Pv,listItem:Fv,list:Rv,paragraph:zv,root:Bv,strong:Vv,table:Hv,tableCell:Wv,tableRow:Uv,text:Yv,thematicBreak:Xv,toml:Qv,yaml:Qv,definition:Qv,footnoteDefinition:Qv};function Qv(){}var $v=typeof self==`object`?self:globalThis,ey=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new $v[e](t)},ty=(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 $v[e]==`function`?ey(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(ey(a,o),i)};return r},ny=e=>ty(new Map,e)(0),ry=``,{toString:iy}={},{keys:ay}=Object,oy=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=iy.call(e).slice(8,-1);switch(n){case`Array`:return[1,ry];case`Object`:return[2,ry];case`Date`:return[3,ry];case`RegExp`:return[4,ry];case`Map`:return[5,ry];case`Set`:return[6,ry];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},sy=([e,t])=>e===0&&(t===`function`||t===`symbol`),cy=(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]=oy(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 ay(r))(e||!sy(oy(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?ry: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||!(sy(oy(n))||sy(oy(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!sy(oy(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},ly=(e,{json:t,lossy:n}={})=>{let r=[];return cy(!(t||n),!!t,new Map,r)(e),r},uy=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ny(ly(e,t)):structuredClone(e):(e,t)=>ny(ly(e,t));function dy(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 fy(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function py(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||dy,r=e.options.footnoteBackLabel||fy,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=qh(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:{...uy(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
48
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function zv(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Bv(n[r])}return t}function Bv(e){return e.spread??e.children.length>1}function Vv(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 Hv(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uv(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Wv(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gv(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=Bm(t.children[1]),o=zm(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 Kv(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 qv(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Jv=9,Yv=32;function Xv(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Zv(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Zv(t.slice(i),i>0,!1)),a.join(``)}function Zv(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Jv||t===Yv;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Jv||t===Yv;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Qv(e,t){let n={type:`text`,value:Xv(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $v(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var ey={blockquote:wv,break:Tv,code:Ev,delete:Dv,emphasis:Ov,footnoteReference:kv,heading:Av,html:jv,imageReference:Nv,image:Pv,inlineCode:Fv,linkReference:Iv,link:Lv,listItem:Rv,list:Vv,paragraph:Hv,root:Uv,strong:Wv,table:Gv,tableCell:qv,tableRow:Kv,text:Qv,thematicBreak:$v,toml:ty,yaml:ty,definition:ty,footnoteDefinition:ty};function ty(){}var ny=typeof self==`object`?self:globalThis,ry=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ny[e](t)},iy=(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 ny[e]==`function`?ry(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(ry(a,o),i)};return r},ay=e=>iy(new Map,e)(0),oy=``,{toString:sy}={},{keys:cy}=Object,ly=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=sy.call(e).slice(8,-1);switch(n){case`Array`:return[1,oy];case`Object`:return[2,oy];case`Date`:return[3,oy];case`RegExp`:return[4,oy];case`Map`:return[5,oy];case`Set`:return[6,oy];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},uy=([e,t])=>e===0&&(t===`function`||t===`symbol`),dy=(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]=ly(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 cy(r))(e||!uy(ly(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?oy: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||!(uy(ly(n))||uy(ly(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!uy(ly(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},fy=(e,{json:t,lossy:n}={})=>{let r=[];return dy(!(t||n),!!t,new Map,r)(e),r},py=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ay(fy(e,t)):structuredClone(e):(e,t)=>ay(fy(e,t));function my(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 hy(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function gy(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||my,r=e.options.footnoteBackLabel||hy,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=Xh(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:{...py(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
49
49
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
50
- `}]}}var my=(function(e){if(e==null)return yy;if(typeof e==`function`)return vy(e);if(typeof e==`object`)return Array.isArray(e)?hy(e):gy(e);if(typeof e==`string`)return _y(e);throw Error(`Expected function, string, or object as test`)});function hy(e){let t=[],n=-1;for(;++n<e.length;)t[n]=my(e[n]);return vy(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function gy(e){let t=e;return vy(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function _y(e){return vy(t);function t(t){return t&&t.type===e}}function vy(e){return t;function t(t,n,r){return!!(by(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function yy(){return!0}function by(e){return typeof e==`object`&&!!e&&`type`in e}function xy(e){return e}var Sy=[];function Cy(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=my(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 (`+xy(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Sy,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=wy(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 wy(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Sy:[e]}function Ty(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),Cy(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 Ey={}.hasOwnProperty,Dy={};function Oy(e,t){let n=t||Dy,r=new Map,i=new Map,a={all:s,applyData:Ay,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Zv,...n.handlers},one:o,options:n,patch:ky,wrap:My};return Ty(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(Ey.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=uy(n);return r.children=a.all(e),r}return uy(e)}return(a.options.unknownHandler||jy)(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=Ny(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Ny(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function ky(e,t){e.position&&(t.position=zm(e))}function Ay(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,uy(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function jy(e,t){let n=t.data||{},r=`value`in t&&!(Ey.call(n,`hProperties`)||Ey.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 My(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
50
+ `}]}}var _y=(function(e){if(e==null)return Sy;if(typeof e==`function`)return xy(e);if(typeof e==`object`)return Array.isArray(e)?vy(e):yy(e);if(typeof e==`string`)return by(e);throw Error(`Expected function, string, or object as test`)});function vy(e){let t=[],n=-1;for(;++n<e.length;)t[n]=_y(e[n]);return xy(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function yy(e){let t=e;return xy(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function by(e){return xy(t);function t(t){return t&&t.type===e}}function xy(e){return t;function t(t,n,r){return!!(Cy(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Sy(){return!0}function Cy(e){return typeof e==`object`&&!!e&&`type`in e}function wy(e){return e}var Ty=[];function Ey(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=_y(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 (`+wy(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Ty,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Dy(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 Dy(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Ty:[e]}function Oy(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),Ey(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 ky={}.hasOwnProperty,Ay={};function jy(e,t){let n=t||Ay,r=new Map,i=new Map,a={all:s,applyData:Ny,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ey,...n.handlers},one:o,options:n,patch:My,wrap:Fy};return Oy(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(ky.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=py(n);return r.children=a.all(e),r}return py(e)}return(a.options.unknownHandler||Py)(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=Iy(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Iy(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function My(e,t){e.position&&(t.position=Hm(e))}function Ny(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,py(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Py(e,t){let n=t.data||{},r=`value`in t&&!(ky.call(n,`hProperties`)||ky.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 Fy(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
51
51
  `});++r<e.length;)r&&n.push({type:`text`,value:`
52
52
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
53
- `}),n}function Ny(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Py(e,t){let n=Oy(e,t),r=n.one(e,void 0),i=py(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 Fy(e,t){return e&&`run`in e?async function(n,r){let i=Py(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Py(n,{file:r,...e||t})}}function Iy(e){if(e)throw e}var Ly=Pe(((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 Ry(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 zy(){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?By(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 By(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 Vy={basename:Hy,dirname:Uy,extname:Wy,join:Gy,sep:`/`};function Hy(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Jy(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 Uy(e){if(Jy(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 Wy(e){Jy(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 Gy(...e){let t=-1,n;for(;++t<e.length;)Jy(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Ky(n)}function Ky(e){Jy(e);let t=e.codePointAt(0)===47,n=qy(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function qy(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 Jy(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Yy={cwd:Xy};function Xy(){return`/`}function Zy(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Qy(e){if(typeof e==`string`)e=new URL(e);else if(!Zy(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 $y(e)}function $y(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 eb=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],tb=class{constructor(e){let t;t=e?Zy(e)?{path:e}:typeof e==`string`||ab(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Yy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<eb.length;){let e=eb[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)eb.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Vy.basename(this.path):void 0}set basename(e){rb(e,`basename`),nb(e,`basename`),this.path=Vy.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Vy.dirname(this.path):void 0}set dirname(e){ib(this.basename,`dirname`),this.path=Vy.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Vy.extname(this.path):void 0}set extname(e){if(nb(e,`extname`),ib(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=Vy.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Zy(e)&&(e=Qy(e)),rb(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Vy.basename(this.path,this.extname):void 0}set stem(e){rb(e,`stem`),nb(e,`stem`),this.path=Vy.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 Wm(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 nb(e,t){if(e&&e.includes(Vy.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Vy.sep+"`")}function rb(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ib(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ab(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ob=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),sb=s(Ly(),1),cb={}.hasOwnProperty,lb=new class e extends ob{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=zy()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,sb.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(fb(`data`,this.frozen),this.namespace[e]=t,this):cb.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fb(`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=hb(e),n=this.parser||this.Parser;return ub(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ub(`process`,this.parser||this.Parser),db(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=hb(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);_b(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(),ub(`processSync`,this.parser||this.Parser),db(`processSync`,this.compiler||this.Compiler),this.process(e,r),mb(`processSync`,`process`,t),n;function r(e,r){t=!0,Iy(e),n=r}}run(e,t,n){pb(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=hb(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),mb(`runSync`,`run`,n),r;function i(e,t){Iy(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=hb(t),r=this.compiler||this.Compiler;return db(`stringify`,r),pb(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(fb(`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,sb.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];Ry(o)&&Ry(r)&&(r=(0,sb.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ub(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function db(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function fb(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 pb(e){if(!Ry(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function mb(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function hb(e){return gb(e)?e:new tb(e)}function gb(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function _b(e){return typeof e==`string`||vb(e)}function vb(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var yb=[],bb={allowDangerousHtml:!0},xb=/^(https?|ircs?|mailto|xmpp)$/i,Sb=[{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 Cb(e){let t=wb(e),n=Tb(e);return Eb(t.runSync(t.parse(n),n),e)}function wb(e){let t=e.rehypePlugins||yb,n=e.remarkPlugins||yb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bb}:bb;return lb().use(bv).use(n).use(Fy,r).use(t)}function Tb(e){let t=e.children||``,n=new tb;return typeof t==`string`?n.value=t:``+t,n}function Eb(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Db;for(let e of Sb)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Ty(e,l),Zm(e,{Fragment:B.Fragment,components:i,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.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 yh)if(Object.hasOwn(yh,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=yh[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 Db(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||xb.test(e.slice(0,t))?e:``}var Ob=(function(e,t,n){let r=my(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]}),kb=(function(e){if(e==null)return Nb;if(typeof e==`string`)return jb(e);if(typeof e==`object`)return Ab(e);if(typeof e==`function`)return Mb(e);throw Error("Expected function, string, or array as `test`")});function Ab(e){let t=[],n=-1;for(;++n<e.length;)t[n]=kb(e[n]);return Mb(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function jb(e){return Mb(t);function t(t){return t.tagName===e}}function Mb(e){return t;function t(t,n,r){return!!(Pb(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Nb(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Pb(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var Fb=/\n/g,Ib=/[\t ]+/g,Lb=kb(`br`),Rb=kb(Zb),zb=kb(`p`),Bb=kb(`tr`),Vb=kb([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Xb,Qb]),Hb=kb(`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 Ub(e,t){let n=t||{},r=`children`in e?e.children:[],i=Hb(e),a=Yb(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Kb(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...Wb(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Lb(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 Wb(e,t,n){return e.type===`element`?Gb(e,t,n):e.type===`text`?n.whitespace===`normal`?Kb(e,n):qb(e):[]}function Gb(e,t,n){let r=Yb(e,n),i=e.children||[],a=-1,o=[];if(Vb(e))return o;let s,c;for(Lb(e)||Bb(e)&&Ob(t,e,Bb)?c=`
56
- `:zb(e)?(s=2,c=2):Hb(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Wb(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Lb(i[a+1]):c}));return Rb(e)&&Ob(t,e,Rb)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Kb(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Fb.lastIndex=a;let e=Fb.exec(n),i=e&&`index`in e?e.index:n.length;r.push(Jb(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 qb(e){return[String(e.value)]}function Jb(e,t,n){let r=[],i=0,a;for(;i<e.length;){Ib.lastIndex=i;let n=Ib.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 Yb(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 Xb(e){return!!(e.properties||{}).hidden}function Zb(e){return e.tagName===`td`||e.tagName===`th`}function Qb(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function $b(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 ex(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=$b(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 tx(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 nx(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 rx(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 ix(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 ax=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_-]*/}}),ox=`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(`.`),sx=`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(`.`),cx=[...ox,...sx],lx=`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(),ux=`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(),dx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),fx=`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 px(e){let t=e.regex,n=ax(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:`:(`+ux.join(`|`)+`)`},{begin:`:(:)?(`+dx.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+fx.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:lx.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+cx.join(`|`)+`)\\b`}]}}function mx(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 hx(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 gx(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 _x(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 vx=`[0-9](_*[0-9])*`,yx=`\\.(${vx})`,bx=`[0-9a-fA-F](_*[0-9a-fA-F])*`,xx={className:`number`,variants:[{begin:`(\\b(${vx})((${yx})|\\.)?|(${yx}))[eE][+-]?(${vx})[fFdD]?\\b`},{begin:`\\b(${vx})((${yx})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${yx})[fFdD]?\\b`},{begin:`\\b(${vx})[fFdD]\\b`},{begin:`\\b0[xX]((${bx})\\.?|(${bx})?\\.(${bx}))[pP][+-]?(${vx})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${bx})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Sx(e,t,n){return n===-1?``:e.replace(t,r=>Sx(e,t,n-1))}function Cx(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Sx(`(?:<[À-ʸ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,xx,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},xx,a]}}var wx=`[A-Za-z$_][0-9A-Za-z$_]*`,Tx=`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(`.`),Ex=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Dx=`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(`.`),Ox=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],kx=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Ax=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],jx=[].concat(kx,Dx,Ox);function Mx(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=wx,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:wx,keyword:Tx,literal:Ex,built_in:jx,"variable.language":Ax},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:{_:[...Dx,...Ox]}},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([...kx,`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 Nx(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 Px=`[0-9](_*[0-9])*`,Fx=`\\.(${Px})`,Ix=`[0-9a-fA-F](_*[0-9a-fA-F])*`,Lx={className:`number`,variants:[{begin:`(\\b(${Px})((${Fx})|\\.)?|(${Fx}))[eE][+-]?(${Px})[fFdD]?\\b`},{begin:`\\b(${Px})((${Fx})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fx})[fFdD]?\\b`},{begin:`\\b(${Px})[fFdD]\\b`},{begin:`\\b0[xX]((${Ix})\\.?|(${Ix})?\\.(${Ix}))[pP][+-]?(${Px})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Ix})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Rx(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=Lx,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 zx=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_-]*/}}),Bx=`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(`.`),Vx=`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(`.`),Hx=[...Bx,...Vx],Ux=`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(),Wx=`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(),Gx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Kx=`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(),qx=Wx.concat(Gx).sort().reverse();function Jx(e){let t=zx(e),n=qx,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:Ux.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(`+Kx.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(`+Hx.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:`:(`+Wx.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+Gx.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 Yx(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 Xx(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 Zx(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 Qx(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 $x(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 eS(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 tS(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 nS(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function rS(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 iS(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function aS(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 oS(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 sS(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 cS=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_-]*/}}),lS=`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(`.`),uS=`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(`.`),dS=[...lS,...uS],fS=`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(),pS=`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(),mS=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),hS=`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 gS(e){let t=cS(e),n=mS,r=pS,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(`+dS.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(`+hS.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:fS.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 _S(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function vS(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 yS(e){return e?typeof e==`string`?e:e.source:null}function bS(e){return xS(`(?=`,e,`)`)}function xS(...e){return e.map(e=>yS(e)).join(``)}function SS(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function CS(...e){return`(`+(SS(e).capture?``:`?:`)+e.map(e=>yS(e)).join(`|`)+`)`}var wS=e=>xS(/\b/,e,/\w$/.test(e)?/\b/:/\B/),TS=[`Protocol`,`Type`].map(wS),ES=[`init`,`self`].map(wS),DS=[`Any`,`Self`],OS=[`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`],kS=[`false`,`nil`,`true`],AS=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],jS=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],MS=`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(`.`),NS=CS(/[/=\-+!*%<>&|^~?]/,/[\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]/),PS=CS(NS,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),FS=xS(NS,PS,`*`),IS=CS(/[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]/),LS=CS(IS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),RS=xS(IS,LS,`*`),zS=xS(/[A-Z]/,LS,`*`),BS=[`attached`,`autoclosure`,xS(/convention\(/,CS(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,xS(/objc\(/,RS,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],VS=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function HS(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,CS(...TS,...ES)],className:{2:`keyword`}},a={match:xS(/\./,CS(...OS)),relevance:0},o=OS.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:CS(...OS.filter(e=>typeof e!=`string`).concat(DS).map(wS),...ES)}]},c={$pattern:CS(/\b\w+/,/#\w+/),keyword:o.concat(jS),literal:kS},l=[i,a,s],u=[{match:xS(/\./,CS(...MS)),relevance:0},{className:`built_in`,match:xS(/\b/,CS(...MS),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:FS},{match:`\\.(\\.|${PS})+`}]}],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:xS(/\\/,e,/[0\\tnr"']/)},{match:xS(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:xS(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:xS(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:xS(e,/"""/),end:xS(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:xS(e,/"/),end:xS(/"/,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=xS(e,/\//),n=xS(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:xS(/`/,RS,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${LS}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:VS,contains:[...f,h,x]}]}},{scope:`keyword`,match:xS(/@/,CS(...BS),bS(CS(/\(/,/\s+/)))},{scope:`meta`,match:xS(/@/,RS)}],k={match:bS(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:xS(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,LS,`+`)},{className:`type`,match:zS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:xS(/\s+&\s+/,bS(zS)),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:xS(RS,/\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:CS(bS(xS(RS,/\s*:/)),bS(xS(RS,/\s+/,RS,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:RS}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,CS(E.match,RS,FS)],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+/,FS],className:{1:`keyword`,3:`title`}},ee={begin:[/precedencegroup/,/\s+/,zS],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...AS,...kS],end:/}/},L={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},te={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,RS,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:zS},...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,L,te,ne,I,ee,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var US=`[A-Za-z$_][0-9A-Za-z$_]*`,WS=`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(`.`),GS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],KS=`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(`.`),qS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],JS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],YS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],XS=[].concat(JS,KS,qS);function ZS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=US,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:US,keyword:WS,literal:GS,built_in:XS,"variable.language":YS},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:{_:[...KS,...qS]}},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([...JS,`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 QS(e){let t=e.regex,n=ZS(e),r=US,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:US,keyword:WS.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:GS,built_in:XS.concat(i),"variable.language":YS},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 $S(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 eC(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 tC(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 nC(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 rC={arduino:ex,bash:tx,c:nx,cpp:rx,csharp:ix,css:px,diff:mx,go:hx,graphql:gx,ini:_x,java:Cx,javascript:Mx,json:Nx,kotlin:Rx,less:Jx,lua:Yx,makefile:Xx,markdown:Zx,objectivec:Qx,perl:$x,php:eS,"php-template":tS,plaintext:nS,python:rS,"python-repl":iS,r:aS,ruby:oS,rust:sS,scss:gS,shell:_S,sql:vS,swift:HS,typescript:QS,vbnet:$S,wasm:eC,xml:tC,yaml:nC},iC=s(Pe(((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},ee=I(`//`,`$`),L=I(`/\\*`,`\\*/`),te=I(`#`,`$`),ne=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:L,C_LINE_COMMENT_MODE:ee,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:te,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 re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ae(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(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 ce(e,t){e.relevance===void 0&&(e.relevance=1)}var le=(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},ue=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],de=`keyword`;function fe(e,t,n=de){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,fe(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,pe(n[0],n[1])]})}}function pe(e,t){return t?Number(t):+!me(e)}function me(e){return ue.includes(e.toLowerCase())}var he={},ge=e=>{console.error(e)},_e=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ve=(e,t)=>{he[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),he[`${e}/${t}`]=!0)},ye=Error();function be(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 xe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ge(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ye;if(typeof e.beginScope!=`object`||e.beginScope===null)throw ge(`beginScope must be object`),ye;be(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Se(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ge(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ye;if(typeof e.endScope!=`object`||e.endScope===null)throw ge(`endScope must be object`),ye;be(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ce(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function we(e){Ce(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),xe(e),Se(e)}function R(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;[ie,se,we,le].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ae,oe,ce].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&&=fe(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 Ee(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 Te(e){return e?e.endsWithParent||Te(e.starts):!1}function Ee(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var De=`11.11.1`,Oe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ke=i,Ae=a,je=Symbol(`nomatch`),Me=7,Ne=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||(_e(s.replace(`{}`,n[1])),_e(`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):(ve(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ve(`10.7.0`,`Please use highlight(code, options) instead.
53
+ `}),n}function Iy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ly(e,t){let n=jy(e,t),r=n.one(e,void 0),i=gy(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 Ry(e,t){return e&&`run`in e?async function(n,r){let i=Ly(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ly(n,{file:r,...e||t})}}function zy(e){if(e)throw e}var By=Pe(((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 Vy(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 Hy(){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?Uy(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 Uy(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 Wy={basename:Gy,dirname:Ky,extname:qy,join:Jy,sep:`/`};function Gy(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Zy(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 Ky(e){if(Zy(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 qy(e){Zy(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 Jy(...e){let t=-1,n;for(;++t<e.length;)Zy(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Yy(n)}function Yy(e){Zy(e);let t=e.codePointAt(0)===47,n=Xy(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Xy(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 Zy(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Qy={cwd:$y};function $y(){return`/`}function eb(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function tb(e){if(typeof e==`string`)e=new URL(e);else if(!eb(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 nb(e)}function nb(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 rb=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],ib=class{constructor(e){let t;t=e?eb(e)?{path:e}:typeof e==`string`||cb(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Qy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<rb.length;){let e=rb[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)rb.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Wy.basename(this.path):void 0}set basename(e){ob(e,`basename`),ab(e,`basename`),this.path=Wy.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Wy.dirname(this.path):void 0}set dirname(e){sb(this.basename,`dirname`),this.path=Wy.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Wy.extname(this.path):void 0}set extname(e){if(ab(e,`extname`),sb(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=Wy.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){eb(e)&&(e=tb(e)),ob(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Wy.basename(this.path,this.extname):void 0}set stem(e){ob(e,`stem`),ab(e,`stem`),this.path=Wy.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 qm(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 ab(e,t){if(e&&e.includes(Wy.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Wy.sep+"`")}function ob(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function sb(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function cb(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var lb=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),ub=s(By(),1),db={}.hasOwnProperty,fb=new class e extends lb{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=Hy()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ub.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(hb(`data`,this.frozen),this.namespace[e]=t,this):db.call(this.namespace,e)&&this.namespace[e]||void 0:e?(hb(`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=vb(e),n=this.parser||this.Parser;return pb(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),pb(`process`,this.parser||this.Parser),mb(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=vb(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);bb(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(),pb(`processSync`,this.parser||this.Parser),mb(`processSync`,this.compiler||this.Compiler),this.process(e,r),_b(`processSync`,`process`,t),n;function r(e,r){t=!0,zy(e),n=r}}run(e,t,n){gb(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=vb(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),_b(`runSync`,`run`,n),r;function i(e,t){zy(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=vb(t),r=this.compiler||this.Compiler;return mb(`stringify`,r),gb(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(hb(`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,ub.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];Vy(o)&&Vy(r)&&(r=(0,ub.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function pb(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function mb(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function hb(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 gb(e){if(!Vy(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function _b(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function vb(e){return yb(e)?e:new ib(e)}function yb(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function bb(e){return typeof e==`string`||xb(e)}function xb(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Sb=[],Cb={allowDangerousHtml:!0},wb=/^(https?|ircs?|mailto|xmpp)$/i,Tb=[{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 Eb(e){let t=Db(e),n=Ob(e);return kb(t.runSync(t.parse(n),n),e)}function Db(e){let t=e.rehypePlugins||Sb,n=e.remarkPlugins||Sb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Cb}:Cb;return fb().use(Cv).use(n).use(Ry,r).use(t)}function Ob(e){let t=e.children||``,n=new ib;return typeof t==`string`?n.value=t:``+t,n}function kb(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Ab;for(let e of Tb)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Oy(e,l),eh(e,{Fragment:B.Fragment,components:i,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.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 Sh)if(Object.hasOwn(Sh,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Sh[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 Ab(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||wb.test(e.slice(0,t))?e:``}var jb=(function(e,t,n){let r=_y(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]}),Mb=(function(e){if(e==null)return Ib;if(typeof e==`string`)return Pb(e);if(typeof e==`object`)return Nb(e);if(typeof e==`function`)return Fb(e);throw Error("Expected function, string, or array as `test`")});function Nb(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Mb(e[n]);return Fb(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Pb(e){return Fb(t);function t(t){return t.tagName===e}}function Fb(e){return t;function t(t,n,r){return!!(Lb(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Ib(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Lb(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var Rb=/\n/g,zb=/[\t ]+/g,Bb=Mb(`br`),Vb=Mb(ex),Hb=Mb(`p`),Ub=Mb(`tr`),Wb=Mb([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,$b,tx]),Gb=Mb(`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 Kb(e,t){let n=t||{},r=`children`in e?e.children:[],i=Gb(e),a=Qb(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Yb(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...qb(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Bb(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 qb(e,t,n){return e.type===`element`?Jb(e,t,n):e.type===`text`?n.whitespace===`normal`?Yb(e,n):Xb(e):[]}function Jb(e,t,n){let r=Qb(e,n),i=e.children||[],a=-1,o=[];if(Wb(e))return o;let s,c;for(Bb(e)||Ub(e)&&jb(t,e,Ub)?c=`
56
+ `:Hb(e)?(s=2,c=2):Gb(e)&&(s=1,c=1);++a<i.length;)o=o.concat(qb(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Bb(i[a+1]):c}));return Vb(e)&&jb(t,e,Vb)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Yb(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Rb.lastIndex=a;let e=Rb.exec(n),i=e&&`index`in e?e.index:n.length;r.push(Zb(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 Xb(e){return[String(e.value)]}function Zb(e,t,n){let r=[],i=0,a;for(;i<e.length;){zb.lastIndex=i;let n=zb.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 Qb(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 $b(e){return!!(e.properties||{}).hidden}function ex(e){return e.tagName===`td`||e.tagName===`th`}function tx(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function nx(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 rx(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=nx(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 ix(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 ax(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 ox(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 sx(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 cx=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_-]*/}}),lx=`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(`.`),ux=`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(`.`),dx=[...lx,...ux],fx=`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(),px=`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(),mx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),hx=`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 gx(e){let t=e.regex,n=cx(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:`:(`+px.join(`|`)+`)`},{begin:`:(:)?(`+mx.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+hx.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:fx.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+dx.join(`|`)+`)\\b`}]}}function _x(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 vx(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 yx(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 bx(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 xx=`[0-9](_*[0-9])*`,Sx=`\\.(${xx})`,Cx=`[0-9a-fA-F](_*[0-9a-fA-F])*`,wx={className:`number`,variants:[{begin:`(\\b(${xx})((${Sx})|\\.)?|(${Sx}))[eE][+-]?(${xx})[fFdD]?\\b`},{begin:`\\b(${xx})((${Sx})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Sx})[fFdD]?\\b`},{begin:`\\b(${xx})[fFdD]\\b`},{begin:`\\b0[xX]((${Cx})\\.?|(${Cx})?\\.(${Cx}))[pP][+-]?(${xx})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Cx})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Tx(e,t,n){return n===-1?``:e.replace(t,r=>Tx(e,t,n-1))}function Ex(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Tx(`(?:<[À-ʸ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,wx,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},wx,a]}}var Dx=`[A-Za-z$_][0-9A-Za-z$_]*`,Ox=`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(`.`),kx=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Ax=`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(`.`),jx=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Mx=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Nx=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Px=[].concat(Mx,Ax,jx);function Fx(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Dx,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:Dx,keyword:Ox,literal:kx,built_in:Px,"variable.language":Nx},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:{_:[...Ax,...jx]}},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([...Mx,`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 Ix(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 Lx=`[0-9](_*[0-9])*`,Rx=`\\.(${Lx})`,zx=`[0-9a-fA-F](_*[0-9a-fA-F])*`,Bx={className:`number`,variants:[{begin:`(\\b(${Lx})((${Rx})|\\.)?|(${Rx}))[eE][+-]?(${Lx})[fFdD]?\\b`},{begin:`\\b(${Lx})((${Rx})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rx})[fFdD]?\\b`},{begin:`\\b(${Lx})[fFdD]\\b`},{begin:`\\b0[xX]((${zx})\\.?|(${zx})?\\.(${zx}))[pP][+-]?(${Lx})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${zx})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Vx(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=Bx,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 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_-]*/}}),Ux=`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(`.`),Wx=`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(`.`),Gx=[...Ux,...Wx],Kx=`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(),qx=`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(),Jx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Yx=`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(),Xx=qx.concat(Jx).sort().reverse();function Zx(e){let t=Hx(e),n=Xx,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:Kx.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(`+Yx.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(`+Gx.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:`:(`+qx.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+Jx.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 Qx(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 $x(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 eS(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 tS(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 nS(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 rS(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 iS(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 aS(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function oS(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 sS(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function cS(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 lS(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 uS(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 dS=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_-]*/}}),fS=`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(`.`),pS=`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(`.`),mS=[...fS,...pS],hS=`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(),gS=`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(),_S=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),vS=`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 yS(e){let t=dS(e),n=_S,r=gS,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(`+mS.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(`+vS.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:hS.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 bS(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function xS(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 SS(e){return e?typeof e==`string`?e:e.source:null}function CS(e){return wS(`(?=`,e,`)`)}function wS(...e){return e.map(e=>SS(e)).join(``)}function TS(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ES(...e){return`(`+(TS(e).capture?``:`?:`)+e.map(e=>SS(e)).join(`|`)+`)`}var DS=e=>wS(/\b/,e,/\w$/.test(e)?/\b/:/\B/),OS=[`Protocol`,`Type`].map(DS),kS=[`init`,`self`].map(DS),AS=[`Any`,`Self`],jS=[`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`],MS=[`false`,`nil`,`true`],NS=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],PS=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],FS=`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(`.`),IS=ES(/[/=\-+!*%<>&|^~?]/,/[\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]/),LS=ES(IS,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),RS=wS(IS,LS,`*`),zS=ES(/[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]/),BS=ES(zS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),VS=wS(zS,BS,`*`),HS=wS(/[A-Z]/,BS,`*`),US=[`attached`,`autoclosure`,wS(/convention\(/,ES(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,wS(/objc\(/,VS,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],WS=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function GS(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,ES(...OS,...kS)],className:{2:`keyword`}},a={match:wS(/\./,ES(...jS)),relevance:0},o=jS.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:ES(...jS.filter(e=>typeof e!=`string`).concat(AS).map(DS),...kS)}]},c={$pattern:ES(/\b\w+/,/#\w+/),keyword:o.concat(PS),literal:MS},l=[i,a,s],u=[{match:wS(/\./,ES(...FS)),relevance:0},{className:`built_in`,match:wS(/\b/,ES(...FS),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:RS},{match:`\\.(\\.|${LS})+`}]}],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:wS(/\\/,e,/[0\\tnr"']/)},{match:wS(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:wS(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:wS(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:wS(e,/"""/),end:wS(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:wS(e,/"/),end:wS(/"/,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=wS(e,/\//),n=wS(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:wS(/`/,VS,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${BS}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:WS,contains:[...f,h,x]}]}},{scope:`keyword`,match:wS(/@/,ES(...US),CS(ES(/\(/,/\s+/)))},{scope:`meta`,match:wS(/@/,VS)}],k={match:CS(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:wS(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,BS,`+`)},{className:`type`,match:HS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wS(/\s+&\s+/,CS(HS)),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:wS(VS,/\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:ES(CS(wS(VS,/\s*:/)),CS(wS(VS,/\s+/,VS,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:VS}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,ES(E.match,VS,RS)],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+/,RS],className:{1:`keyword`,3:`title`}},ee={begin:[/precedencegroup/,/\s+/,HS],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...NS,...MS],end:/}/},L={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},te={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,VS,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:HS},...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,L,te,ne,I,ee,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var KS=`[A-Za-z$_][0-9A-Za-z$_]*`,qS=`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(`.`),JS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],YS=`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(`.`),XS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ZS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],QS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],$S=[].concat(ZS,YS,XS);function eC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=KS,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:KS,keyword:qS,literal:JS,built_in:$S,"variable.language":QS},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:{_:[...YS,...XS]}},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([...ZS,`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 tC(e){let t=e.regex,n=eC(e),r=KS,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:KS,keyword:qS.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:JS,built_in:$S.concat(i),"variable.language":QS},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 nC(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 rC(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 iC(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 aC(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 oC={arduino:rx,bash:ix,c:ax,cpp:ox,csharp:sx,css:gx,diff:_x,go:vx,graphql:yx,ini:bx,java:Ex,javascript:Fx,json:Ix,kotlin:Vx,less:Zx,lua:Qx,makefile:$x,markdown:eS,objectivec:tS,perl:nS,php:rS,"php-template":iS,plaintext:aS,python:oS,"python-repl":sS,r:cS,ruby:lS,rust:uS,scss:yS,shell:bS,sql:xS,swift:GS,typescript:tC,vbnet:nC,wasm:rC,xml:iC,yaml:aC},sC=s(Pe(((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},ee=I(`//`,`$`),L=I(`/\\*`,`\\*/`),te=I(`#`,`$`),ne=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:L,C_LINE_COMMENT_MODE:ee,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:te,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 re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ae(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(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 ce(e,t){e.relevance===void 0&&(e.relevance=1)}var le=(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},ue=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],de=`keyword`;function fe(e,t,n=de){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,fe(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,pe(n[0],n[1])]})}}function pe(e,t){return t?Number(t):+!me(e)}function me(e){return ue.includes(e.toLowerCase())}var he={},ge=e=>{console.error(e)},_e=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ve=(e,t)=>{he[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),he[`${e}/${t}`]=!0)},ye=Error();function be(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 xe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ge(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ye;if(typeof e.beginScope!=`object`||e.beginScope===null)throw ge(`beginScope must be object`),ye;be(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Se(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ge(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ye;if(typeof e.endScope!=`object`||e.endScope===null)throw ge(`endScope must be object`),ye;be(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ce(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function we(e){Ce(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),xe(e),Se(e)}function R(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;[ie,se,we,le].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ae,oe,ce].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&&=fe(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 Ee(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 Te(e){return e?e.endsWithParent||Te(e.starts):!1}function Ee(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var De=`11.11.1`,Oe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ke=i,Ae=a,je=Symbol(`nomatch`),Me=7,Ne=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||(_e(s.replace(`{}`,n[1])),_e(`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):(ve(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ve(`10.7.0`,`Please use highlight(code, options) instead.
59
59
  https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};te(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,te(`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]<=Me&&(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):(L=!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 je;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!==je)return e}if(r.type===`illegal`&&a===``)return P+=`
60
- `,1;if(ee>1e5&&ee>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 ge(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=R(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,ee=0,L=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){ee++,L?L=!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:ke(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:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(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(te(`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 Oe(`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}),te(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),ve(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ve(`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(ge(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)ge(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 ee(e){I(e),a.push(e)}function L(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function te(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function re(e){return ve(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ve(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:re,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Ae,addPlugin:ee,removePlugin:L}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,aC={},oC=`hljs-`;function sC(e){let t=iC.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||aC,a=typeof i.prefix==`string`?i.prefix:oC;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:cC,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||aC).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 cC=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``}},lC={};function uC(e){let t=e||lC,n=t.aliases,r=t.detect||!1,i=t.languages||rC,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=sC(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){Ty(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=dC(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=Ub(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 dC(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 fC=`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 pC({children:e,label:t}){let n=Rp(e);return n===void 0?(0,B.jsx)(`div`,{className:`message-markdown`,children:(0,B.jsx)(Cb,{allowedElements:[...fC],rehypePlugins:[uC],skipHtml:!0,children:e})}):(0,B.jsx)(Up,{className:`whitespace-pre`,label:`${t} formatted JSON`,value:n})}var mC=200,hC=`mt-0 max-h-72 whitespace-pre-wrap rounded-none border-0 text-[11px]`,gC={completed:`text-success`,failed:`text-destructive`,interrupted:`text-warning`,timeout:`text-warning`};function _C({label:e,value:t}){return(0,B.jsx)(Up,{className:`mt-0 max-h-90 whitespace-pre-wrap rounded-none border-0 text-[11px]`,label:e,value:t})}function vC(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 yC(e){return e.input===void 0||e.input===null?e.output??``:typeof e.input==`string`?e.input:Bp(e.input)}function bC(e){return yC(e).split(`
61
- `,1)[0]?.trim().slice(0,mC)??``}function xC({status:e}){return e?(0,B.jsxs)(`span`,{className:k(`flex shrink-0 items-center gap-1 text-[9px] uppercase tracking-[.08em]`,gC[e]??`text-subtle`),children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-current`}),e]}):null}function SC({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,B.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,B.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,B.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 font-mono text-[10px] text-muted-foreground`,children:t})]},e))})}function CC({children:e,title:t}){return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{className:`m-0 px-3.5 pt-2 text-[9px] font-bold uppercase tracking-[.08em] text-subtle`,children:t}),e]})}function wC({invocation:e,current:t}){let n=vC(e.durationMs),r=bC(e),i=e.input!==void 0&&e.input!==null,a=e.output===null?void 0:Rp(e.output);return(0,B.jsxs)(fi,{"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,B.jsxs)(pi,{"aria-label":`${e.name} tool details`,className:`items-center gap-2 py-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(Ct,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,B.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] font-normal text-subtle`,children:r}),n?(0,B.jsx)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-subtle`,children:n}):null,(0,B.jsx)(xC,{status:e.status})]}),(0,B.jsxs)(mi,{className:`-mx-3 border-t p-0`,children:[(0,B.jsx)(SC,{invocation:e}),i?(0,B.jsx)(CC,{title:`Input`,children:(0,B.jsx)(Up,{className:hC,label:`${e.name} tool input`,value:e.input})}):null,e.output===null?null:(0,B.jsx)(CC,{title:`Output`,children:a===void 0?(0,B.jsx)(`pre`,{"aria-label":`${e.name} tool output`,className:k(`message-json`,hC),children:e.output}):(0,B.jsx)(Up,{className:hC,label:`${e.name} tool output`,value:a})}),!i&&e.output===null?(0,B.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 TC({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,B.jsx)(`dl`,{"aria-label":`Usage`,className:`mt-4.5 flex flex-wrap gap-2`,children:t.map(([e,t,n])=>(0,B.jsxs)(`div`,{className:`flex gap-1.5 rounded-md bg-muted px-2 py-1`,children:[(0,B.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,B.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 EC({text:e,value:t}){return(0,B.jsx)(di,{collapsible:!0,type:`single`,children:(0,B.jsxs)(fi,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:t,children:[(0,B.jsx)(pi,{className:`py-1.5 text-xs text-muted-foreground`,children:`Reasoning`}),(0,B.jsx)(mi,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:e})]})})}function DC(e,t){return[...e.map(e=>({at:e.index,event:e,type:`agent`})),...t.map(e=>({at:e.eventIndices[0]??1/0,invocation:e,type:`tool`}))].sort((e,t)=>e.at-t.at)}function OC({current:e,entries:t,onOpenToolsChange:n,openTools:r}){return(0,B.jsx)(`section`,{"aria-label":`Agent activity`,className:`my-3`,children:(0,B.jsx)(di,{className:`space-y-2`,onValueChange:n,type:`multiple`,value:r,children:t.map(t=>t.type===`tool`?(0,B.jsx)(wC,{current:e===t.invocation.id,invocation:t.invocation},t.invocation.id):t.event.kind===`reasoning`?(0,B.jsx)(EC,{text:t.event.text,value:`reasoning-${t.event.index}`},`reasoning-${t.event.index}`):(0,B.jsx)(`div`,{"aria-label":`Agent message`,className:`border-l-2 border-primary pl-3`,role:`group`,children:(0,B.jsx)(pC,{label:`Agent message`,children:t.event.text})},`message-${t.event.index}`))})})}function kC({author:e,focus:t,turn:n}){let r=(0,z.useRef)(null),[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)([]),c=t?.turnId===n.id,l=c?Dp(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,z.useEffect)(()=>{d&&(a(!1),u&&s(e=>e.includes(u)?e:[...e,u]))},[d,u]),(0,z.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,p=Dp(n.tools),m=n.agentEvents?.length?DC(n.agentEvents,p):null,h=m?.some(e=>e.type===`agent`&&e.event.kind===`reasoning`),g=n.status===`running`;return(0,B.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,B.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,B.jsxs)(`div`,{hidden:i,children:[(0,B.jsx)(Pp,{from:`user`,children:(0,B.jsxs)(Fp,{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,B.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:`You`}),g&&!n.user?(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`The prompt is recorded when this run finishes.`}):(0,B.jsx)(pC,{label:`User message`,children:n.user})]})}),(0,B.jsxs)(Pp,{from:`assistant`,children:[(0,B.jsx)(Ip,{...e?.avatar?{src:e.avatar}:{},children:e?e.label.slice(0,2).toUpperCase():`OH`}),(0,B.jsxs)(Fp,{className:`pt-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:[(0,B.jsx)(`span`,{children:e?.label??n.harness}),n.model?(0,B.jsx)(T,{variant:`secondary`,className:`font-medium normal-case tracking-normal`,children:n.model}):null]}),n.reasoning&&!h?(0,B.jsx)(di,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,B.jsxs)(fi,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:`reasoning`,children:[(0,B.jsx)(pi,{className:`text-xs text-muted-foreground`,children:`Reasoning`}),(0,B.jsx)(mi,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:n.reasoning})]})}):null,m?(0,B.jsx)(OC,{current:l?.id,entries:m,onOpenToolsChange:s,openTools:o}):p.length>0?(0,B.jsx)(`section`,{"aria-label":`Tool calls`,className:`my-3`,children:(0,B.jsx)(di,{className:`space-y-1`,type:`multiple`,value:o,onValueChange:s,children:p.map(e=>(0,B.jsx)(wC,{current:l?.id===e.id,invocation:e},e.id))})}):null,n.assistant?(0,B.jsx)(pC,{label:`Assistant message`,children:n.assistant}):g?(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,role:`status`,children:`Still running. Its final answer appears when the run finishes.`}):(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`No assistant text was captured for this run.`}),n.failureKind?(0,B.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,B.jsx)(TC,{usage:n.usage}),f?(0,B.jsx)(di,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,B.jsxs)(fi,{className:`rounded-[10px] border bg-card px-3`,value:`unknown`,children:[(0,B.jsx)(pi,{className:`text-xs text-muted-foreground`,children:`Additional upstream data`}),(0,B.jsx)(mi,{className:`-mx-3 border-t p-0`,children:(0,B.jsx)(_C,{label:`Additional upstream data detail`,value:n.unknown})})]})}):null]})]})]})]})}Object.freeze({status:`aborted`});function W(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var AC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},jC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},MC={};function NC(e){return e&&Object.assign(MC,e),MC}function PC(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function FC(e,t){return typeof t==`bigint`?t.toString():t}function IC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function LC(e){return e==null}function RC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function zC(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var BC=Symbol(`evaluating`);function VC(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==BC)return r===void 0&&(r=BC,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function HC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function UC(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function WC(e){return JSON.stringify(e)}var GC=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function KC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var qC=IC(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function JC(e){if(KC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(KC(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function YC(e){return JC(e)?{...e}:Array.isArray(e)?[...e]:e}var XC=new Set([`string`,`number`,`symbol`]);function ZC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function QC(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function $C(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ew={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function tw(e,t){let n=e._zod.def;return QC(e,UC(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return HC(this,`shape`,e),e},checks:[]}))}function nw(e,t){let n=e._zod.def;return QC(e,UC(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return HC(this,`shape`,r),r},checks:[]}))}function rw(e,t){if(!JC(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return QC(e,UC(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return HC(this,`shape`,n),n},checks:[]}))}function iw(e,t){if(!JC(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return QC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return HC(this,`shape`,n),n},checks:e._zod.def.checks})}function aw(e,t){return QC(e,UC(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return HC(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function ow(e,t,n){return QC(t,UC(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return HC(this,`shape`,i),i},checks:[]}))}function sw(e,t,n){return QC(t,UC(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return HC(this,`shape`,i),i},checks:[]}))}function cw(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function lw(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function uw(e){return typeof e==`string`?e:e?.message}function dw(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=uw(e.inst?._zod.def?.error?.(e))??uw(t?.error?.(e))??uw(n.customError?.(e))??uw(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function fw(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function pw(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var mw=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,FC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hw=W(`$ZodError`,mw),gw=W(`$ZodError`,mw,{Parent:Error});function _w(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vw(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var yw=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new AC;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>dw(e,a,NC())));throw GC(t,i?.callee),t}return o.value},bw=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>dw(e,a,NC())));throw GC(t,i?.callee),t}return o.value},xw=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new AC;return a.issues.length?{success:!1,error:new(e??hw)(a.issues.map(e=>dw(e,i,NC())))}:{success:!0,data:a.value}},Sw=xw(gw),Cw=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>dw(e,i,NC())))}:{success:!0,data:a.value}},ww=Cw(gw),Tw=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return yw(e)(t,n,i)},Ew=e=>(t,n,r)=>yw(e)(t,n,r),Dw=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return bw(e)(t,n,i)},Ow=e=>async(t,n,r)=>bw(e)(t,n,r),kw=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return xw(e)(t,n,i)},Aw=e=>(t,n,r)=>xw(e)(t,n,r),jw=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Cw(e)(t,n,i)},Mw=e=>async(t,n,r)=>Cw(e)(t,n,r),Nw=/^[cC][^\s-]{8,}$/,Pw=/^[0-9a-z]+$/,Fw=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Iw=/^[0-9a-vA-V]{20}$/,Lw=/^[A-Za-z0-9]{27}$/,Rw=/^[a-zA-Z0-9_-]{21}$/,zw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Vw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Hw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Uw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Ww(){return new RegExp(Uw,`u`)}var Gw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qw=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Jw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xw=/^[A-Za-z0-9_-]*$/,Zw=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Qw=/^\+(?:[0-9]){6,14}[0-9]$/,$w=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,eT=RegExp(`^${$w}$`);function tT(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nT(e){return RegExp(`^${tT(e)}$`)}function rT(e){let t=tT({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${$w}T(?:${r})$`)}var iT=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},aT=/^-?\d+$/,oT=/^-?\d+(?:\.\d+)?/,sT=/^(?:true|false)$/i,cT=/^null$/i,lT=/^[^A-Z]*$/,uT=/^[^a-z]*$/,dT=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fT={number:`number`,bigint:`bigint`,object:`date`},pT=W(`$ZodCheckLessThan`,(e,t)=>{dT.init(e,t);let n=fT[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mT=W(`$ZodCheckGreaterThan`,(e,t)=>{dT.init(e,t);let n=fT[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hT=W(`$ZodCheckMultipleOf`,(e,t)=>{dT.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):zC(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),gT=W(`$ZodCheckNumberFormat`,(e,t)=>{dT.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ew[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=aT)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),_T=W(`$ZodCheckMaxLength`,(e,t)=>{var n;dT.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!LC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=fw(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vT=W(`$ZodCheckMinLength`,(e,t)=>{var n;dT.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!LC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fw(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yT=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;dT.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!LC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=fw(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),bT=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;dT.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),xT=W(`$ZodCheckRegex`,(e,t)=>{bT.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ST=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lT,bT.init(e,t)}),CT=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=uT,bT.init(e,t)}),wT=W(`$ZodCheckIncludes`,(e,t)=>{dT.init(e,t);let n=ZC(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),TT=W(`$ZodCheckStartsWith`,(e,t)=>{dT.init(e,t);let n=RegExp(`^${ZC(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ET=W(`$ZodCheckEndsWith`,(e,t)=>{dT.init(e,t);let n=RegExp(`.*${ZC(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),DT=W(`$ZodCheckOverwrite`,(e,t)=>{dT.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),OT=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
60
+ `,1;if(ee>1e5&&ee>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 ge(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=R(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,ee=0,L=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){ee++,L?L=!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:ke(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:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(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(te(`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 Oe(`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}),te(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),ve(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ve(`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(ge(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)ge(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 ee(e){I(e),a.push(e)}function L(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function te(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function re(e){return ve(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ve(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:re,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Ae,addPlugin:ee,removePlugin:L}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,cC={},lC=`hljs-`;function uC(e){let t=sC.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||cC,a=typeof i.prefix==`string`?i.prefix:lC;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:dC,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||cC).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 dC=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``}},fC={};function pC(e){let t=e||fC,n=t.aliases,r=t.detect||!1,i=t.languages||oC,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=uC(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){Oy(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=mC(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=Kb(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 mC(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 hC=`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 gC({children:e,label:t}){let n=Vp(e);return n===void 0?(0,B.jsx)(`div`,{className:`message-markdown`,children:(0,B.jsx)(Eb,{allowedElements:[...hC],rehypePlugins:[pC],skipHtml:!0,children:e})}):(0,B.jsx)(Kp,{className:`whitespace-pre`,label:`${t} formatted JSON`,value:n})}var _C=200,vC=`mt-0 max-h-72 whitespace-pre-wrap rounded-none border-0 text-[11px]`,yC=`conversation-focus-highlight`,bC={completed:`text-success`,failed:`text-destructive`,interrupted:`text-warning`,timeout:`text-warning`};function xC({label:e,value:t}){return(0,B.jsx)(Kp,{className:`mt-0 max-h-90 whitespace-pre-wrap rounded-none border-0 text-[11px]`,label:e,value:t})}function SC(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 CC(e){return e.input===void 0||e.input===null?e.output??``:typeof e.input==`string`?e.input:Up(e.input)}function wC(e){return CC(e).split(`
61
+ `,1)[0]?.trim().slice(0,_C)??``}function TC({status:e}){return e?(0,B.jsxs)(`span`,{className:k(`flex shrink-0 items-center gap-1 text-[9px] uppercase tracking-[.08em]`,bC[e]??`text-subtle`),children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-current`}),e]}):null}function EC({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,B.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,B.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,B.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 font-mono text-[10px] text-muted-foreground`,children:t})]},e))})}function DC({children:e,title:t}){return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{className:`m-0 px-3.5 pt-2 text-[9px] font-bold uppercase tracking-[.08em] text-subtle`,children:t}),e]})}function OC({invocation:e,current:t}){let n=SC(e.durationMs),r=wC(e),i=e.input!==void 0&&e.input!==null,a=e.output===null?void 0:Vp(e.output);return(0,B.jsxs)(hi,{"aria-current":t?`true`:void 0,"data-tool-call-id":e.toolCallId??void 0,"data-event-index":e.id.slice(5),className:k(`rounded-[10px] border px-3`,t?yC:`bg-card`),value:e.id,children:[(0,B.jsxs)(gi,{"aria-label":`${e.name} tool details`,className:`items-center gap-2 py-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(Ct,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,B.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] font-normal text-subtle`,children:r}),n?(0,B.jsx)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-subtle`,children:n}):null,(0,B.jsx)(TC,{status:e.status})]}),(0,B.jsxs)(_i,{className:`-mx-3 border-t p-0`,children:[(0,B.jsx)(EC,{invocation:e}),i?(0,B.jsx)(DC,{title:`Input`,children:(0,B.jsx)(Kp,{className:vC,label:`${e.name} tool input`,value:e.input})}):null,e.output===null?null:(0,B.jsx)(DC,{title:`Output`,children:a===void 0?(0,B.jsx)(`pre`,{"aria-label":`${e.name} tool output`,className:k(`message-json`,vC),children:e.output}):(0,B.jsx)(Kp,{className:vC,label:`${e.name} tool output`,value:a})}),!i&&e.output===null?(0,B.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 kC({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,B.jsx)(`dl`,{"aria-label":`Usage`,className:`mt-4.5 flex flex-wrap gap-2`,children:t.map(([e,t,n])=>(0,B.jsxs)(`div`,{className:`flex gap-1.5 rounded-md bg-muted px-2 py-1`,children:[(0,B.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,B.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 AC({current:e,eventIndex:t,text:n,value:r}){return(0,B.jsx)(mi,{collapsible:!0,type:`single`,children:(0,B.jsxs)(hi,{"aria-current":e?`true`:void 0,className:k(`rounded-[10px] border border-dashed px-3`,e?yC:`bg-card`),"data-event-index":t,value:r,children:[(0,B.jsx)(gi,{className:`py-1.5 text-xs text-muted-foreground`,children:`Reasoning`}),(0,B.jsx)(_i,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:n})]})})}var jC=e=>`agent-${e}`;function MC(e,t){return[...e.map(e=>({at:e.index,event:e,type:`agent`})),...t.map(e=>({at:e.eventIndices[0]??1/0,invocation:e,type:`tool`}))].sort((e,t)=>e.at-t.at)}function NC({current:e,entries:t,onOpenToolsChange:n,openTools:r}){return(0,B.jsx)(`section`,{"aria-label":`Agent activity`,className:`my-3`,children:(0,B.jsx)(mi,{className:`space-y-2`,onValueChange:n,type:`multiple`,value:r,children:t.map(t=>t.type===`tool`?(0,B.jsx)(OC,{current:e===t.invocation.id,invocation:t.invocation},t.invocation.id):t.event.kind===`reasoning`?(0,B.jsx)(AC,{current:e===jC(t.event.index),eventIndex:t.event.index,text:t.event.text,value:`reasoning-${t.event.index}`},`reasoning-${t.event.index}`):(0,B.jsx)(`div`,{"aria-current":e===jC(t.event.index)?`true`:void 0,"aria-label":`Agent message`,className:k(`border-l-2 border-primary pl-3`,e===jC(t.event.index)&&yC),"data-event-index":t.event.index,role:`group`,children:(0,B.jsx)(gC,{label:`Agent message`,children:t.event.text})},`message-${t.event.index}`))})})}function PC({author:e,focus:t,turn:n}){let r=(0,z.useRef)(null),[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)([]),c=t?.turnId===n.id,l=c?Ap(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&&!l&&t.toolCallId===void 0&&t.eventIndex!==void 0?n.agentEvents?.find(e=>e.index===t.eventIndex):void 0,f=u??(d?jC(d.index):void 0),p=c?JSON.stringify(t):void 0;(0,z.useEffect)(()=>{p&&(a(!1),u&&s(e=>e.includes(u)?e:[...e,u]))},[p,u]),(0,z.useEffect)(()=>{if(!p||i||u&&!o.includes(u))return;let e=r.current,t=()=>{e?.scrollIntoView?.({block:`nearest`}),e?.querySelector(`[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`})};return t(),e?.addEventListener(`animationend`,t,{once:!0}),()=>e?.removeEventListener(`animationend`,t)},[p,i,o,u]);let m=Object.keys(n.unknown).length>0,h=Ap(n.tools),g=n.agentEvents?.length?MC(n.agentEvents,h):null,_=g?.some(e=>e.type===`agent`&&e.event.kind===`reasoning`),v=n.status===`running`;return(0,B.jsxs)(`article`,{ref:r,"data-turn-id":n.id,"aria-current":c&&!f?`true`:void 0,"aria-label":`Turn ${n.id} from ${n.harness}`,className:`mx-auto mb-10.5 max-w-[850px]`,children:[(0,B.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,B.jsxs)(`div`,{hidden:i,children:[(0,B.jsx)(Lp,{from:`user`,children:(0,B.jsxs)(Rp,{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,B.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:`You`}),v&&!n.user?(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`The prompt is recorded when this run finishes.`}):(0,B.jsx)(gC,{label:`User message`,children:n.user})]})}),(0,B.jsxs)(Lp,{from:`assistant`,children:[(0,B.jsx)(zp,{...e?.avatar?{src:e.avatar}:{},children:e?e.label.slice(0,2).toUpperCase():`OH`}),(0,B.jsxs)(Rp,{className:`pt-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:[(0,B.jsx)(`span`,{children:e?.label??n.harness}),n.model?(0,B.jsx)(T,{variant:`secondary`,className:`font-medium normal-case tracking-normal`,children:n.model}):null]}),n.reasoning&&!_?(0,B.jsx)(mi,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,B.jsxs)(hi,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:`reasoning`,children:[(0,B.jsx)(gi,{className:`text-xs text-muted-foreground`,children:`Reasoning`}),(0,B.jsx)(_i,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:n.reasoning})]})}):null,g?(0,B.jsx)(NC,{current:f,entries:g,onOpenToolsChange:s,openTools:o}):h.length>0?(0,B.jsx)(`section`,{"aria-label":`Tool calls`,className:`my-3`,children:(0,B.jsx)(mi,{className:`space-y-1`,type:`multiple`,value:o,onValueChange:s,children:h.map(e=>(0,B.jsx)(OC,{current:l?.id===e.id,invocation:e},e.id))})}):null,n.assistant?(0,B.jsx)(gC,{label:`Assistant message`,children:n.assistant}):v?(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,role:`status`,children:`Still running. Its final answer appears when the run finishes.`}):(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`No assistant text was captured for this run.`}),n.failureKind?(0,B.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,B.jsx)(kC,{usage:n.usage}),m?(0,B.jsx)(mi,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,B.jsxs)(hi,{className:`rounded-[10px] border bg-card px-3`,value:`unknown`,children:[(0,B.jsx)(gi,{className:`text-xs text-muted-foreground`,children:`Additional upstream data`}),(0,B.jsx)(_i,{className:`-mx-3 border-t p-0`,children:(0,B.jsx)(xC,{label:`Additional upstream data detail`,value:n.unknown})})]})}):null]})]})]})]})}Object.freeze({status:`aborted`});function W(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var FC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},IC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},LC={};function RC(e){return e&&Object.assign(LC,e),LC}function zC(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function BC(e,t){return typeof t==`bigint`?t.toString():t}function VC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function HC(e){return e==null}function UC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function WC(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var GC=Symbol(`evaluating`);function KC(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==GC)return r===void 0&&(r=GC,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function qC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function JC(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function YC(e){return JSON.stringify(e)}var XC=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ZC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var QC=VC(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function $C(e){if(ZC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(ZC(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ew(e){return $C(e)?{...e}:Array.isArray(e)?[...e]:e}var tw=new Set([`string`,`number`,`symbol`]);function nw(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function rw(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function iw(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var aw={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ow(e,t){let n=e._zod.def;return rw(e,JC(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return qC(this,`shape`,e),e},checks:[]}))}function sw(e,t){let n=e._zod.def;return rw(e,JC(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return qC(this,`shape`,r),r},checks:[]}))}function cw(e,t){if(!$C(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return rw(e,JC(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return qC(this,`shape`,n),n},checks:[]}))}function lw(e,t){if(!$C(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return rw(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return qC(this,`shape`,n),n},checks:e._zod.def.checks})}function uw(e,t){return rw(e,JC(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return qC(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function dw(e,t,n){return rw(t,JC(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return qC(this,`shape`,i),i},checks:[]}))}function fw(e,t,n){return rw(t,JC(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return qC(this,`shape`,i),i},checks:[]}))}function pw(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function mw(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function hw(e){return typeof e==`string`?e:e?.message}function gw(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=hw(e.inst?._zod.def?.error?.(e))??hw(t?.error?.(e))??hw(n.customError?.(e))??hw(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function _w(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function vw(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var yw=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,BC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bw=W(`$ZodError`,yw),xw=W(`$ZodError`,yw,{Parent:Error});function Sw(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Cw(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var ww=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new FC;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>gw(e,a,RC())));throw XC(t,i?.callee),t}return o.value},Tw=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>gw(e,a,RC())));throw XC(t,i?.callee),t}return o.value},Ew=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new FC;return a.issues.length?{success:!1,error:new(e??bw)(a.issues.map(e=>gw(e,i,RC())))}:{success:!0,data:a.value}},Dw=Ew(xw),Ow=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>gw(e,i,RC())))}:{success:!0,data:a.value}},kw=Ow(xw),Aw=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ww(e)(t,n,i)},jw=e=>(t,n,r)=>ww(e)(t,n,r),Mw=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Tw(e)(t,n,i)},Nw=e=>async(t,n,r)=>Tw(e)(t,n,r),Pw=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ew(e)(t,n,i)},Fw=e=>(t,n,r)=>Ew(e)(t,n,r),Iw=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ow(e)(t,n,i)},Lw=e=>async(t,n,r)=>Ow(e)(t,n,r),Rw=/^[cC][^\s-]{8,}$/,zw=/^[0-9a-z]+$/,Bw=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vw=/^[0-9a-vA-V]{20}$/,Hw=/^[A-Za-z0-9]{27}$/,Uw=/^[a-zA-Z0-9_-]{21}$/,Ww=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Kw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Yw(){return new RegExp(Jw,`u`)}var Xw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qw=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$w=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tT=/^[A-Za-z0-9_-]*$/,nT=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,rT=/^\+(?:[0-9]){6,14}[0-9]$/,iT=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,aT=RegExp(`^${iT}$`);function oT(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sT(e){return RegExp(`^${oT(e)}$`)}function cT(e){let t=oT({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${iT}T(?:${r})$`)}var lT=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},uT=/^-?\d+$/,dT=/^-?\d+(?:\.\d+)?/,fT=/^(?:true|false)$/i,pT=/^null$/i,mT=/^[^A-Z]*$/,hT=/^[^a-z]*$/,gT=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_T={number:`number`,bigint:`bigint`,object:`date`},vT=W(`$ZodCheckLessThan`,(e,t)=>{gT.init(e,t);let n=_T[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),yT=W(`$ZodCheckGreaterThan`,(e,t)=>{gT.init(e,t);let n=_T[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bT=W(`$ZodCheckMultipleOf`,(e,t)=>{gT.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):WC(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),xT=W(`$ZodCheckNumberFormat`,(e,t)=>{gT.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=aw[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=uT)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),ST=W(`$ZodCheckMaxLength`,(e,t)=>{var n;gT.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!HC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=_w(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),CT=W(`$ZodCheckMinLength`,(e,t)=>{var n;gT.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!HC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=_w(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wT=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;gT.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!HC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=_w(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),TT=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;gT.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ET=W(`$ZodCheckRegex`,(e,t)=>{TT.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),DT=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=mT,TT.init(e,t)}),OT=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=hT,TT.init(e,t)}),kT=W(`$ZodCheckIncludes`,(e,t)=>{gT.init(e,t);let n=nw(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),AT=W(`$ZodCheckStartsWith`,(e,t)=>{gT.init(e,t);let n=RegExp(`^${nw(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),jT=W(`$ZodCheckEndsWith`,(e,t)=>{gT.init(e,t);let n=RegExp(`.*${nw(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),MT=W(`$ZodCheckOverwrite`,(e,t)=>{gT.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),NT=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
62
62
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
63
- `))}},kT={major:4,minor:1,patch:12},AT=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kT;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=cw(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new AC;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=cw(e,t))});else{if(e.issues.length===t)continue;r||=cw(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(cw(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new AC;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new AC;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=Sw(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ww(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),jT=W(`$ZodString`,(e,t)=>{AT.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??iT(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),MT=W(`$ZodStringFormat`,(e,t)=>{bT.init(e,t),jT.init(e,t)}),NT=W(`$ZodGUID`,(e,t)=>{t.pattern??=Bw,MT.init(e,t)}),PT=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Vw(e)}else t.pattern??=Vw();MT.init(e,t)}),FT=W(`$ZodEmail`,(e,t)=>{t.pattern??=Hw,MT.init(e,t)}),IT=W(`$ZodURL`,(e,t)=>{MT.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:Zw.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),LT=W(`$ZodEmoji`,(e,t)=>{t.pattern??=Ww(),MT.init(e,t)}),RT=W(`$ZodNanoID`,(e,t)=>{t.pattern??=Rw,MT.init(e,t)}),zT=W(`$ZodCUID`,(e,t)=>{t.pattern??=Nw,MT.init(e,t)}),BT=W(`$ZodCUID2`,(e,t)=>{t.pattern??=Pw,MT.init(e,t)}),VT=W(`$ZodULID`,(e,t)=>{t.pattern??=Fw,MT.init(e,t)}),HT=W(`$ZodXID`,(e,t)=>{t.pattern??=Iw,MT.init(e,t)}),UT=W(`$ZodKSUID`,(e,t)=>{t.pattern??=Lw,MT.init(e,t)}),WT=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=rT(t),MT.init(e,t)}),GT=W(`$ZodISODate`,(e,t)=>{t.pattern??=eT,MT.init(e,t)}),KT=W(`$ZodISOTime`,(e,t)=>{t.pattern??=nT(t),MT.init(e,t)}),qT=W(`$ZodISODuration`,(e,t)=>{t.pattern??=zw,MT.init(e,t)}),JT=W(`$ZodIPv4`,(e,t)=>{t.pattern??=Gw,MT.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),YT=W(`$ZodIPv6`,(e,t)=>{t.pattern??=Kw,MT.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),XT=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=qw,MT.init(e,t)}),ZT=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Jw,MT.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function QT(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var $T=W(`$ZodBase64`,(e,t)=>{t.pattern??=Yw,MT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{QT(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function eE(e){if(!Xw.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return QT(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var tE=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=Xw,MT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{eE(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),nE=W(`$ZodE164`,(e,t)=>{t.pattern??=Qw,MT.init(e,t)});function rE(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var iE=W(`$ZodJWT`,(e,t)=>{MT.init(e,t),e._zod.check=n=>{rE(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),aE=W(`$ZodNumber`,(e,t)=>{AT.init(e,t),e._zod.pattern=e._zod.bag.pattern??oT,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),oE=W(`$ZodNumber`,(e,t)=>{gT.init(e,t),aE.init(e,t)}),sE=W(`$ZodBoolean`,(e,t)=>{AT.init(e,t),e._zod.pattern=sT,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),cE=W(`$ZodNull`,(e,t)=>{AT.init(e,t),e._zod.pattern=cT,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),lE=W(`$ZodUnknown`,(e,t)=>{AT.init(e,t),e._zod.parse=e=>e}),uE=W(`$ZodNever`,(e,t)=>{AT.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function dE(e,t,n){e.issues.length&&t.issues.push(...lw(n,e.issues)),t.value[n]=e.value}var fE=W(`$ZodArray`,(e,t)=>{AT.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>dE(t,n,e))):dE(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function pE(e,t,n,r){e.issues.length&&t.issues.push(...lw(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function mE(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=$C(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function hE(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>pE(e,n,i,t))):pE(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var gE=W(`$ZodObject`,(e,t)=>{if(AT.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=IC(()=>mE(t));VC(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=KC,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>pE(n,t,e,s))):pE(n,t,e,s)}return i?hE(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),_E=W(`$ZodObjectJIT`,(e,t)=>{gE.init(e,t);let n=e._zod.parse,r=IC(()=>mE(t)),i=e=>{let t=new OT([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=WC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=WC(e);t.write(`const ${n} = ${i(e)};`),t.write(`
63
+ `))}},PT={major:4,minor:1,patch:12},FT=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=PT;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=pw(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new FC;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=pw(e,t))});else{if(e.issues.length===t)continue;r||=pw(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(pw(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new FC;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new FC;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=Dw(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return kw(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),IT=W(`$ZodString`,(e,t)=>{FT.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??lT(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),LT=W(`$ZodStringFormat`,(e,t)=>{TT.init(e,t),IT.init(e,t)}),RT=W(`$ZodGUID`,(e,t)=>{t.pattern??=Gw,LT.init(e,t)}),zT=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Kw(e)}else t.pattern??=Kw();LT.init(e,t)}),BT=W(`$ZodEmail`,(e,t)=>{t.pattern??=qw,LT.init(e,t)}),VT=W(`$ZodURL`,(e,t)=>{LT.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:nT.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),HT=W(`$ZodEmoji`,(e,t)=>{t.pattern??=Yw(),LT.init(e,t)}),UT=W(`$ZodNanoID`,(e,t)=>{t.pattern??=Uw,LT.init(e,t)}),WT=W(`$ZodCUID`,(e,t)=>{t.pattern??=Rw,LT.init(e,t)}),GT=W(`$ZodCUID2`,(e,t)=>{t.pattern??=zw,LT.init(e,t)}),KT=W(`$ZodULID`,(e,t)=>{t.pattern??=Bw,LT.init(e,t)}),qT=W(`$ZodXID`,(e,t)=>{t.pattern??=Vw,LT.init(e,t)}),JT=W(`$ZodKSUID`,(e,t)=>{t.pattern??=Hw,LT.init(e,t)}),YT=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=cT(t),LT.init(e,t)}),XT=W(`$ZodISODate`,(e,t)=>{t.pattern??=aT,LT.init(e,t)}),ZT=W(`$ZodISOTime`,(e,t)=>{t.pattern??=sT(t),LT.init(e,t)}),QT=W(`$ZodISODuration`,(e,t)=>{t.pattern??=Ww,LT.init(e,t)}),$T=W(`$ZodIPv4`,(e,t)=>{t.pattern??=Xw,LT.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),eE=W(`$ZodIPv6`,(e,t)=>{t.pattern??=Zw,LT.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),tE=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Qw,LT.init(e,t)}),nE=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=$w,LT.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function rE(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var iE=W(`$ZodBase64`,(e,t)=>{t.pattern??=eT,LT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{rE(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function aE(e){if(!tT.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return rE(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var oE=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=tT,LT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{aE(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),sE=W(`$ZodE164`,(e,t)=>{t.pattern??=rT,LT.init(e,t)});function cE(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var lE=W(`$ZodJWT`,(e,t)=>{LT.init(e,t),e._zod.check=n=>{cE(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),uE=W(`$ZodNumber`,(e,t)=>{FT.init(e,t),e._zod.pattern=e._zod.bag.pattern??dT,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),dE=W(`$ZodNumber`,(e,t)=>{xT.init(e,t),uE.init(e,t)}),fE=W(`$ZodBoolean`,(e,t)=>{FT.init(e,t),e._zod.pattern=fT,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),pE=W(`$ZodNull`,(e,t)=>{FT.init(e,t),e._zod.pattern=pT,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),mE=W(`$ZodUnknown`,(e,t)=>{FT.init(e,t),e._zod.parse=e=>e}),hE=W(`$ZodNever`,(e,t)=>{FT.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function gE(e,t,n){e.issues.length&&t.issues.push(...mw(n,e.issues)),t.value[n]=e.value}var _E=W(`$ZodArray`,(e,t)=>{FT.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>gE(t,n,e))):gE(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function vE(e,t,n,r){e.issues.length&&t.issues.push(...mw(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function yE(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=iw(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bE(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>vE(e,n,i,t))):vE(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var xE=W(`$ZodObject`,(e,t)=>{if(FT.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=VC(()=>yE(t));KC(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ZC,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>vE(n,t,e,s))):vE(n,t,e,s)}return i?bE(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),SE=W(`$ZodObjectJIT`,(e,t)=>{xE.init(e,t);let n=e._zod.parse,r=VC(()=>yE(t)),i=e=>{let t=new NT([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=YC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=YC(e);t.write(`const ${n} = ${i(e)};`),t.write(`
64
64
  if (${n}.issues.length) {
65
65
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
66
66
  ...iss,
@@ -77,31 +77,31 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
77
77
  newResult[${r}] = ${n}.value;
78
78
  }
79
79
 
80
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=KC,s=!MC.jitless,c=s&&qC.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?hE([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function vE(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!cw(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>dw(e,r,NC())))}),t)}var yE=W(`$ZodUnion`,(e,t)=>{AT.init(e,t),VC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),VC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),VC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),VC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>RC(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>vE(t,i,e,a)):vE(s,i,e,a)}}),bE=W(`$ZodDiscriminatedUnion`,(e,t)=>{yE.init(e,t);let n=e._zod.parse;VC(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=IC(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!KC(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),xE=W(`$ZodIntersection`,(e,t)=>{AT.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>CE(e,t,n)):CE(e,i,a)}});function SE(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(JC(e)&&JC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=SE(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=SE(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function CE(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),cw(e))return e;let r=SE(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var wE=W(`$ZodRecord`,(e,t)=>{AT.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!JC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...lw(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...lw(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>dw(e,r,NC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...lw(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...lw(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),TE=W(`$ZodEnum`,(e,t)=>{AT.init(e,t);let n=PC(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>XC.has(typeof e)).map(e=>typeof e==`string`?ZC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),EE=W(`$ZodLiteral`,(e,t)=>{if(AT.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ZC(e):e?ZC(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),DE=W(`$ZodTransform`,(e,t)=>{AT.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jC(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new AC;return n.value=i,n}});function OE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var kE=W(`$ZodOptional`,(e,t)=>{AT.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,VC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),VC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${RC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>OE(t,e.value)):OE(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),AE=W(`$ZodNullable`,(e,t)=>{AT.init(e,t),VC(e._zod,`optin`,()=>t.innerType._zod.optin),VC(e._zod,`optout`,()=>t.innerType._zod.optout),VC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${RC(e.source)}|null)$`):void 0}),VC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),jE=W(`$ZodDefault`,(e,t)=>{AT.init(e,t),e._zod.optin=`optional`,VC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ME(e,t)):ME(r,t)}});function ME(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var NE=W(`$ZodPrefault`,(e,t)=>{AT.init(e,t),e._zod.optin=`optional`,VC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),PE=W(`$ZodNonOptional`,(e,t)=>{AT.init(e,t),VC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>FE(t,e)):FE(i,e)}});function FE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var IE=W(`$ZodCatch`,(e,t)=>{AT.init(e,t),VC(e._zod,`optin`,()=>t.innerType._zod.optin),VC(e._zod,`optout`,()=>t.innerType._zod.optout),VC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>dw(e,n,NC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>dw(e,n,NC()))},input:e.value}),e.issues=[]),e)}}),LE=W(`$ZodPipe`,(e,t)=>{AT.init(e,t),VC(e._zod,`values`,()=>t.in._zod.values),VC(e._zod,`optin`,()=>t.in._zod.optin),VC(e._zod,`optout`,()=>t.out._zod.optout),VC(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>RE(e,t.in,n)):RE(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>RE(e,t.out,n)):RE(r,t.out,n)}});function RE(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var zE=W(`$ZodReadonly`,(e,t)=>{AT.init(e,t),VC(e._zod,`propValues`,()=>t.innerType._zod.propValues),VC(e._zod,`values`,()=>t.innerType._zod.values),VC(e._zod,`optin`,()=>t.innerType._zod.optin),VC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(BE):BE(r)}});function BE(e){return e.value=Object.freeze(e.value),e}var VE=W(`$ZodLazy`,(e,t)=>{AT.init(e,t),VC(e._zod,`innerType`,()=>t.getter()),VC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),VC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),VC(e._zod,`optin`,()=>e._zod.innerType._zod.optin??void 0),VC(e._zod,`optout`,()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),HE=W(`$ZodCustom`,(e,t)=>{dT.init(e,t),AT.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>UE(t,n,r,e));UE(i,n,r,e)}});function UE(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(pw(e))}}var WE=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function GE(){return new WE}var KE=GE();function qE(e,t){return new e({type:`string`,...G(t)})}function JE(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...G(t)})}function YE(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...G(t)})}function XE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...G(t)})}function ZE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...G(t)})}function QE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...G(t)})}function $E(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...G(t)})}function eD(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...G(t)})}function tD(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...G(t)})}function nD(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...G(t)})}function rD(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...G(t)})}function iD(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...G(t)})}function aD(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...G(t)})}function oD(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...G(t)})}function sD(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...G(t)})}function cD(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...G(t)})}function lD(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...G(t)})}function uD(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...G(t)})}function dD(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...G(t)})}function fD(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...G(t)})}function pD(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...G(t)})}function mD(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...G(t)})}function hD(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...G(t)})}function gD(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...G(t)})}function _D(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...G(t)})}function vD(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...G(t)})}function yD(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...G(t)})}function bD(e,t){return new e({type:`number`,checks:[],...G(t)})}function xD(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...G(t)})}function SD(e,t){return new e({type:`boolean`,...G(t)})}function CD(e,t){return new e({type:`null`,...G(t)})}function wD(e){return new e({type:`unknown`})}function TD(e,t){return new e({type:`never`,...G(t)})}function ED(e,t){return new pT({check:`less_than`,...G(t),value:e,inclusive:!1})}function DD(e,t){return new pT({check:`less_than`,...G(t),value:e,inclusive:!0})}function OD(e,t){return new mT({check:`greater_than`,...G(t),value:e,inclusive:!1})}function kD(e,t){return new mT({check:`greater_than`,...G(t),value:e,inclusive:!0})}function AD(e,t){return new hT({check:`multiple_of`,...G(t),value:e})}function jD(e,t){return new _T({check:`max_length`,...G(t),maximum:e})}function MD(e,t){return new vT({check:`min_length`,...G(t),minimum:e})}function ND(e,t){return new yT({check:`length_equals`,...G(t),length:e})}function PD(e,t){return new xT({check:`string_format`,format:`regex`,...G(t),pattern:e})}function FD(e){return new ST({check:`string_format`,format:`lowercase`,...G(e)})}function ID(e){return new CT({check:`string_format`,format:`uppercase`,...G(e)})}function LD(e,t){return new wT({check:`string_format`,format:`includes`,...G(t),includes:e})}function RD(e,t){return new TT({check:`string_format`,format:`starts_with`,...G(t),prefix:e})}function zD(e,t){return new ET({check:`string_format`,format:`ends_with`,...G(t),suffix:e})}function BD(e){return new DT({check:`overwrite`,tx:e})}function VD(e){return BD(t=>t.normalize(e))}function HD(){return BD(e=>e.trim())}function UD(){return BD(e=>e.toLowerCase())}function WD(){return BD(e=>e.toUpperCase())}function GD(e,t,n){return new e({type:`array`,element:t,...G(n)})}function KD(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...G(n)})}function qD(e){let t=JD(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(pw(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(pw(r))}},e(n.value,n)));return t}function JD(e,t){let n=new dT({check:`custom`,...G(t)});return n._zod.check=e,n}var YD=W(`ZodISODateTime`,(e,t)=>{WT.init(e,t),bO.init(e,t)});function XD(e){return gD(YD,e)}var ZD=W(`ZodISODate`,(e,t)=>{GT.init(e,t),bO.init(e,t)});function QD(e){return _D(ZD,e)}var $D=W(`ZodISOTime`,(e,t)=>{KT.init(e,t),bO.init(e,t)});function eO(e){return vD($D,e)}var tO=W(`ZodISODuration`,(e,t)=>{qT.init(e,t),bO.init(e,t)});function nO(e){return yD(tO,e)}var rO=(e,t)=>{hw.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>vw(e,t)},flatten:{value:t=>_w(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,FC,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,FC,2)}},isEmpty:{get(){return e.issues.length===0}}})};W(`ZodError`,rO);var iO=W(`ZodError`,rO,{Parent:Error}),aO=yw(iO),oO=bw(iO),sO=xw(iO),cO=Cw(iO),lO=Tw(iO),uO=Ew(iO),dO=Dw(iO),fO=Ow(iO),pO=kw(iO),mO=Aw(iO),hO=jw(iO),gO=Mw(iO),_O=W(`ZodType`,(e,t)=>(AT.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(UC(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>QC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>aO(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sO(e,t,n),e.parseAsync=async(t,n)=>oO(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>cO(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>lO(e,t,n),e.decode=(t,n)=>uO(e,t,n),e.encodeAsync=async(t,n)=>dO(e,t,n),e.decodeAsync=async(t,n)=>fO(e,t,n),e.safeEncode=(t,n)=>pO(e,t,n),e.safeDecode=(t,n)=>mO(e,t,n),e.safeEncodeAsync=async(t,n)=>hO(e,t,n),e.safeDecodeAsync=async(t,n)=>gO(e,t,n),e.refine=(t,n)=>e.check(Nk(t,n)),e.superRefine=t=>e.check(Pk(t)),e.overwrite=t=>e.check(BD(t)),e.optional=()=>hk(e),e.nullable=()=>_k(e),e.nullish=()=>hk(_k(e)),e.nonoptional=t=>Ck(e,t),e.array=()=>q(e),e.or=t=>rk([e,t]),e.and=t=>sk(e,t),e.transform=t=>Dk(e,pk(t)),e.default=t=>yk(e,t),e.prefault=t=>xk(e,t),e.catch=t=>Tk(e,t),e.pipe=t=>Dk(e,t),e.readonly=()=>kk(e),e.describe=t=>{let n=e.clone();return KE.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return KE.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return KE.get(e);let n=e.clone();return KE.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),vO=W(`_ZodString`,(e,t)=>{jT.init(e,t),_O.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(PD(...t)),e.includes=(...t)=>e.check(LD(...t)),e.startsWith=(...t)=>e.check(RD(...t)),e.endsWith=(...t)=>e.check(zD(...t)),e.min=(...t)=>e.check(MD(...t)),e.max=(...t)=>e.check(jD(...t)),e.length=(...t)=>e.check(ND(...t)),e.nonempty=(...t)=>e.check(MD(1,...t)),e.lowercase=t=>e.check(FD(t)),e.uppercase=t=>e.check(ID(t)),e.trim=()=>e.check(HD()),e.normalize=(...t)=>e.check(VD(...t)),e.toLowerCase=()=>e.check(UD()),e.toUpperCase=()=>e.check(WD())}),yO=W(`ZodString`,(e,t)=>{jT.init(e,t),vO.init(e,t),e.email=t=>e.check(JE(xO,t)),e.url=t=>e.check(eD(wO,t)),e.jwt=t=>e.check(hD(BO,t)),e.emoji=t=>e.check(tD(EO,t)),e.guid=t=>e.check(YE(SO,t)),e.uuid=t=>e.check(XE(CO,t)),e.uuidv4=t=>e.check(ZE(CO,t)),e.uuidv6=t=>e.check(QE(CO,t)),e.uuidv7=t=>e.check($E(CO,t)),e.nanoid=t=>e.check(nD(DO,t)),e.guid=t=>e.check(YE(SO,t)),e.cuid=t=>e.check(rD(OO,t)),e.cuid2=t=>e.check(iD(kO,t)),e.ulid=t=>e.check(aD(AO,t)),e.base64=t=>e.check(fD(LO,t)),e.base64url=t=>e.check(pD(RO,t)),e.xid=t=>e.check(oD(jO,t)),e.ksuid=t=>e.check(sD(MO,t)),e.ipv4=t=>e.check(cD(NO,t)),e.ipv6=t=>e.check(lD(PO,t)),e.cidrv4=t=>e.check(uD(FO,t)),e.cidrv6=t=>e.check(dD(IO,t)),e.e164=t=>e.check(mD(zO,t)),e.datetime=t=>e.check(XD(t)),e.date=t=>e.check(QD(t)),e.time=t=>e.check(eO(t)),e.duration=t=>e.check(nO(t))});function K(e){return qE(yO,e)}var bO=W(`ZodStringFormat`,(e,t)=>{MT.init(e,t),vO.init(e,t)}),xO=W(`ZodEmail`,(e,t)=>{FT.init(e,t),bO.init(e,t)}),SO=W(`ZodGUID`,(e,t)=>{NT.init(e,t),bO.init(e,t)}),CO=W(`ZodUUID`,(e,t)=>{PT.init(e,t),bO.init(e,t)}),wO=W(`ZodURL`,(e,t)=>{IT.init(e,t),bO.init(e,t)});function TO(e){return eD(wO,e)}var EO=W(`ZodEmoji`,(e,t)=>{LT.init(e,t),bO.init(e,t)}),DO=W(`ZodNanoID`,(e,t)=>{RT.init(e,t),bO.init(e,t)}),OO=W(`ZodCUID`,(e,t)=>{zT.init(e,t),bO.init(e,t)}),kO=W(`ZodCUID2`,(e,t)=>{BT.init(e,t),bO.init(e,t)}),AO=W(`ZodULID`,(e,t)=>{VT.init(e,t),bO.init(e,t)}),jO=W(`ZodXID`,(e,t)=>{HT.init(e,t),bO.init(e,t)}),MO=W(`ZodKSUID`,(e,t)=>{UT.init(e,t),bO.init(e,t)}),NO=W(`ZodIPv4`,(e,t)=>{JT.init(e,t),bO.init(e,t)}),PO=W(`ZodIPv6`,(e,t)=>{YT.init(e,t),bO.init(e,t)}),FO=W(`ZodCIDRv4`,(e,t)=>{XT.init(e,t),bO.init(e,t)}),IO=W(`ZodCIDRv6`,(e,t)=>{ZT.init(e,t),bO.init(e,t)}),LO=W(`ZodBase64`,(e,t)=>{$T.init(e,t),bO.init(e,t)}),RO=W(`ZodBase64URL`,(e,t)=>{tE.init(e,t),bO.init(e,t)}),zO=W(`ZodE164`,(e,t)=>{nE.init(e,t),bO.init(e,t)}),BO=W(`ZodJWT`,(e,t)=>{iE.init(e,t),bO.init(e,t)}),VO=W(`ZodNumber`,(e,t)=>{aE.init(e,t),_O.init(e,t),e.gt=(t,n)=>e.check(OD(t,n)),e.gte=(t,n)=>e.check(kD(t,n)),e.min=(t,n)=>e.check(kD(t,n)),e.lt=(t,n)=>e.check(ED(t,n)),e.lte=(t,n)=>e.check(DD(t,n)),e.max=(t,n)=>e.check(DD(t,n)),e.int=t=>e.check(WO(t)),e.safe=t=>e.check(WO(t)),e.positive=t=>e.check(OD(0,t)),e.nonnegative=t=>e.check(kD(0,t)),e.negative=t=>e.check(ED(0,t)),e.nonpositive=t=>e.check(DD(0,t)),e.multipleOf=(t,n)=>e.check(AD(t,n)),e.step=(t,n)=>e.check(AD(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function HO(e){return bD(VO,e)}var UO=W(`ZodNumberFormat`,(e,t)=>{oE.init(e,t),VO.init(e,t)});function WO(e){return xD(UO,e)}var GO=W(`ZodBoolean`,(e,t)=>{sE.init(e,t),_O.init(e,t)});function KO(e){return SD(GO,e)}var qO=W(`ZodNull`,(e,t)=>{cE.init(e,t),_O.init(e,t)});function JO(e){return CD(qO,e)}var YO=W(`ZodUnknown`,(e,t)=>{lE.init(e,t),_O.init(e,t)});function XO(){return wD(YO)}var ZO=W(`ZodNever`,(e,t)=>{uE.init(e,t),_O.init(e,t)});function QO(e){return TD(ZO,e)}var $O=W(`ZodArray`,(e,t)=>{fE.init(e,t),_O.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(MD(t,n)),e.nonempty=t=>e.check(MD(1,t)),e.max=(t,n)=>e.check(jD(t,n)),e.length=(t,n)=>e.check(ND(t,n)),e.unwrap=()=>e.element});function q(e,t){return GD($O,e,t)}var ek=W(`ZodObject`,(e,t)=>{_E.init(e,t),_O.init(e,t),VC(e,`shape`,()=>t.shape),e.keyof=()=>Y(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:XO()}),e.loose=()=>e.clone({...e._zod.def,catchall:XO()}),e.strict=()=>e.clone({...e._zod.def,catchall:QO()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>rw(e,t),e.safeExtend=t=>iw(e,t),e.merge=t=>aw(e,t),e.pick=t=>tw(e,t),e.omit=t=>nw(e,t),e.partial=(...t)=>ow(mk,e,t[0]),e.required=(...t)=>sw(Sk,e,t[0])});function tk(e,t){return new ek({type:`object`,shape:e??{},...G(t)})}function J(e,t){return new ek({type:`object`,shape:e,catchall:QO(),...G(t)})}var nk=W(`ZodUnion`,(e,t)=>{yE.init(e,t),_O.init(e,t),e.options=t.options});function rk(e,t){return new nk({type:`union`,options:e,...G(t)})}var ik=W(`ZodDiscriminatedUnion`,(e,t)=>{nk.init(e,t),bE.init(e,t)});function ak(e,t,n){return new ik({type:`union`,options:t,discriminator:e,...G(n)})}var ok=W(`ZodIntersection`,(e,t)=>{xE.init(e,t),_O.init(e,t)});function sk(e,t){return new ok({type:`intersection`,left:e,right:t})}var ck=W(`ZodRecord`,(e,t)=>{wE.init(e,t),_O.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function lk(e,t,n){return new ck({type:`record`,keyType:e,valueType:t,...G(n)})}var uk=W(`ZodEnum`,(e,t)=>{TE.init(e,t),_O.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new uk({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new uk({...t,checks:[],...G(r),entries:i})}});function Y(e,t){return new uk({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var dk=W(`ZodLiteral`,(e,t)=>{EE.init(e,t),_O.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new dk({type:`literal`,values:Array.isArray(e)?e:[e],...G(t)})}var fk=W(`ZodTransform`,(e,t)=>{DE.init(e,t),_O.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jC(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pw(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(pw(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function pk(e){return new fk({type:`transform`,transform:e})}var mk=W(`ZodOptional`,(e,t)=>{kE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hk(e){return new mk({type:`optional`,innerType:e})}var gk=W(`ZodNullable`,(e,t)=>{AE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _k(e){return new gk({type:`nullable`,innerType:e})}var vk=W(`ZodDefault`,(e,t)=>{jE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yk(e,t){return new vk({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():YC(t)}})}var bk=W(`ZodPrefault`,(e,t)=>{NE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xk(e,t){return new bk({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():YC(t)}})}var Sk=W(`ZodNonOptional`,(e,t)=>{PE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ck(e,t){return new Sk({type:`nonoptional`,innerType:e,...G(t)})}var wk=W(`ZodCatch`,(e,t)=>{IE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tk(e,t){return new wk({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ek=W(`ZodPipe`,(e,t)=>{LE.init(e,t),_O.init(e,t),e.in=t.in,e.out=t.out});function Dk(e,t){return new Ek({type:`pipe`,in:e,out:t})}var Ok=W(`ZodReadonly`,(e,t)=>{zE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function kk(e){return new Ok({type:`readonly`,innerType:e})}var Ak=W(`ZodLazy`,(e,t)=>{VE.init(e,t),_O.init(e,t),e.unwrap=()=>e._zod.def.getter()});function jk(e){return new Ak({type:`lazy`,getter:e})}var Mk=W(`ZodCustom`,(e,t)=>{HE.init(e,t),_O.init(e,t)});function Nk(e,t={}){return KD(Mk,e,t)}function Pk(e){return qD(e)}function Fk(e){let t=jk(()=>rk([K(e),HO(),KO(),JO(),q(t),lk(K(),t)]));return t}var Ik=Re(),Lk=[`urgent`,`high`,`medium`,`low`],Rk={urgent:`Critical`,high:`High`,medium:`Medium`,low:`Low`},zk={list:`/api/human-items`,item:e=>`/api/human-items/${encodeURIComponent(e)}`,answers:`/api/human-items/answers`,answer:e=>`/api/human-items/${encodeURIComponent(e)}/answer`,complete:e=>`/api/human-items/${encodeURIComponent(e)}/complete`,dismiss:e=>`/api/human-items/${encodeURIComponent(e)}/dismiss`,reopen:e=>`/api/human-items/${encodeURIComponent(e)}/reopen`,note:e=>`/api/human-items/${encodeURIComponent(e)}/note`},Bk=K().nullable(),Vk=K().regex(/\S/u),Hk=J({session:K(),run:Bk,plan:Bk}),Uk=ak(`scope`,[J({scope:X(`nothing`)}),J({scope:X(`work`),run:K(),node:K()}),J({scope:X(`plan`),plan:K()}),J({scope:X(`host`)})]),Wk=Y([`manager`,`user`]),Gk=ak(`when`,[J({when:X(`time`),at:XD({offset:!0}).optional(),after_seconds:HO().int().min(1).optional(),reason:Vk.optional()}),J({when:X(`run`),run:Vk,on:Y([`settled`,`ended`]),reason:Vk.optional()}),J({when:X(`node`),run:Vk,node:Vk,reason:Vk.optional()}),J({when:X(`check`),command:q(K()).min(1),cwd:K().regex(/^(\/|\\|[A-Za-z]:[\\/])/u).optional(),timeout_seconds:HO().int().min(1).max(60).optional(),interval_seconds:HO().int().min(10).max(86400).optional(),reason:Vk.optional()})]).superRefine((e,t)=>{let n=e.when===`time`&&e.at===void 0==(e.after_seconds===void 0)?`a time names exactly one of at and after_seconds`:e.when===`check`&&!/\S/u.test(e.command[0]??``)?`a check's program is not blank`:void 0;n!==void 0&&t.addIssue({code:`custom`,message:n})}),Kk=J({actor:K(),on_behalf_of:Bk,text:Bk,choice:Bk.optional(),reason:Bk,provenance:Wk.optional(),condition:Gk.nullable().optional()}),qk=J({id:K().regex(/^[a-z0-9][a-z0-9-]{0,63}$/u),title:K().regex(/^[^\r\n]*\S[^\r\n]*$/u).refine(e=>[...e].length<=80),description:Vk});function Jk(e,t){let n=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));return n(e)===n(t)}function Yk(e){let t=e.expiry??[];if(t.some(e=>e.when===`time`&&e.after_seconds!==void 0||e.when===`check`&&e.cwd===void 0))return`a stored condition holds its time's at and its check's cwd`;let n=e.resolution,r=n?.condition??void 0;if(e.state!==`expired`)return r===void 0?void 0:`only an expired item's resolution names the condition that held`;if(n!==null)return n.actor===`engine`&&n.on_behalf_of===null&&n.text===null&&(n.choice??null)===null&&(n.provenance??`manager`)===`manager`&&n.reason!==null&&/\S/u.test(n.reason)&&r!==void 0&&t.some(e=>Jk(e,r))?void 0:`an expiry is the engine's, with a reason and one of the item's conditions`}function Xk(e){let t=Yk(e);if(t!==void 0)return t;let{kind:n,state:r,resolution:i}=e,a=e.choices??[];if(n===`task`&&a.length>0)return`choices are only valid on questions`;if(new Set(a.map(({id:e})=>e)).size!==a.length)return`a choice id is repeated`;let o=i?.choice??void 0;if(o!==void 0&&(r!==`answered`||!a.some(({id:e})=>e===o)))return`a resolution's choice is one this answered question offers`;if(n===`question`&&e.approval!==null)return`approval is only valid on tasks`;if(r===`open`)return i===null?void 0:`an open item has no resolution`;if(i===null)return`a resolved item carries its resolution`;if(r===`answered`)return n===`question`&&(i.text===null?o!==void 0:/\S/u.test(i.text))&&i.reason===null?void 0:`an answer is a question's, with a choice or text and no reason`;if(r===`completed`)return n===`task`&&(i.text===null||/\S/u.test(i.text))&&i.reason===null?void 0:`a completion is a task's, with no reason and any comment not blank`;if(r!==`expired`)return i.text===null?void 0:`a dismissal carries no text`}var Zk=J({schema_version:X(1),id:K().min(1),dedup_key:K(),kind:Y([`task`,`question`]),title:Vk,body:Vk,choices:q(qk).max(6).optional(),priority:Y(Lk),owner:Hk,block:Uk,approval:J({board_copy:K(),key:K()}).nullable(),state:Y([`open`,`answered`,`completed`,`dismissed`,`expired`]),resolution:Kk.nullable(),tracker:J({task:K(),url:TO()}).nullable(),expiry:q(Gk).max(8).optional(),created_at:K(),updated_at:K()}).superRefine((e,t)=>{let n=Xk(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),Qk=J({run:K(),node:K(),title:K()}),$k=J({plan:K(),count:HO().int().nonnegative(),preview:q(Qk).max(3)}),eA=J({total:HO().int().nonnegative(),plans:q($k)});function tA(e,t){return!(e.state===`open`&&e.block.scope!==`nothing`)&&(t.total!==0||t.plans.length>0)?`a non-blocking item reports nothing blocked`:new Set(t.plans.map(({plan:e})=>e)).size===t.plans.length?t.plans.some(({count:e,preview:t})=>t.length!==Math.min(e,3))?`a preview is the first three affected steps of its plan`:t.plans.reduce((e,{count:t})=>e+t,0)===t.total?void 0:`the blocked total is the plans' counts`:`a blocked plan appears twice`}var nA=J({available:KO(),reason:Bk});function rA({dedup_key:e,block:t,owner:n}){return t.scope===`work`&&e===`run:${t.run}#${t.node}`&&n.run===t.run}function iA(e,{available:t,reason:n}){return(t?n!==null:n===null||!/\S/u.test(n))?`a reopen states a reason exactly when it is unavailable`:e.state===`open`||e.state===`answered`||rA(e)||e.state!==`expired`&&e.resolution?.actor===`engine`?t?`this item's state cannot be reopened`:void 0:t||e.state===`completed`&&e.approval!==null?void 0:`nothing about this item's state refuses a reopen`}var aA=J({condition:HO().int().nonnegative(),last_run_at:Vk,outcome:Y([`holds`,`not-yet`,`failed`]),detail:Bk}).superRefine(({outcome:e,detail:t},n)=>{e===`failed`!=(t!==null)&&n.addIssue({code:`custom`,message:`a check carries a detail exactly when it failed`})});function oA(e,t){let n=e.expiry??[];return(t??[]).every(({condition:e})=>n[e]?.when===`check`)?void 0:`a check names one of the item's check conditions`}var sA=J({item:Zk,blocked:eA,reopen:nA,checks:q(aA).optional()}).superRefine(({item:e,blocked:t,reopen:n,checks:r},i)=>{let a=tA(e,t)??iA(e,n)??oA(e,r);a!==void 0&&i.addIssue({code:`custom`,message:a})});function cA(e){let{blocked:t,nodes:n}=e;if(n.length!==t.total)return`the steps are the blocked total`;if(new Set(n.map(({run:e,node:t})=>`${e}\u0000${t}`)).size!==n.length)return`a blocked step appears twice`;let r=0;for(let{count:e,preview:i}of t.plans){let t=n.slice(r,r+e);if(i.some((e,n)=>t[n]?.run!==e.run||t[n]?.node!==e.node))return`a preview is the first steps of its plan's group`;r+=e}}var lA=J({action:Y([`human-item-raised`,`human-item-answered`,`human-item-completed`,`human-item-dismissed`,`human-item-auto-resolved`,`human-item-reopened`,`human-item-noted`,`human-item-expired`]),at:XD({offset:!0}),actor:Vk,on_behalf_of:Bk,provenance:Wk}),uA=J({item:Zk,blocked:eA,nodes:q(Qk),reopen:nA,history:q(lA).optional(),checks:q(aA).optional()}).superRefine((e,t)=>{let n=tA(e.item,e.blocked)??iA(e.item,e.reopen)??oA(e.item,e.checks)??cA(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),dA=J({item:sA,event_id:K()}),fA=ak(`kind`,[J({kind:X(`unavailable`)}),J({kind:X(`conflict`),reason:K()})]),pA=J({batch:Bk.optional(),answered:q(dA),refused:q(J({id:K(),refusal:fA}))}),mA=J({items:q(sA)}),hA=J({kind:Y([`task`,`question`]).nullable().optional(),blocking:KO().nullable().optional(),priority:Y(Lk).nullable().optional(),state:Y([`open`,`answered`,`completed`,`dismissed`,`expired`]).nullable().optional(),session:K().nullable().optional(),run:K().nullable().optional(),plan:K().nullable().optional(),host:KO().nullable().optional()}),gA=J({type:X(`human-items`),items:q(sA),detail:uA.nullable()}),_A=HO().finite().nonnegative(),Z=HO().int().nonnegative(),vA=XD({offset:!0}),yA=K().min(1).nullable(),Q=e=>tk(e).catchall(XO()),bA={runs:`/api/v2/runs`,run:e=>`/api/v2/runs/${encodeURIComponent(e)}`,timeline:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline`,conversation:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/conversations/${encodeURIComponent(t)}`,artifact:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,timelineEvents:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline/events`,timelineNodeStream:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline/node-stream`,events:`/api/v2/events`,projects:`/api/v2/projects`,project:e=>`/api/v2/projects/${encodeURIComponent(e)}`,stop:e=>`/api/v2/runs/${encodeURIComponent(e)}/stop`,shutdown:`/api/v2/shutdown`,unwatched:`/api/v2/unwatched`,host:`/api/v2/host`,status:e=>`/api/v2/runs/${encodeURIComponent(e)}/status`,results:e=>`/api/v2/runs/${encodeURIComponent(e)}/results`,goals:`/api/v2/goals`,runGoals:e=>`/api/v2/runs/${encodeURIComponent(e)}/goals`,transcript:e=>`/api/v2/runs/${encodeURIComponent(e)}/transcript`,telemetry:e=>`/api/v2/runs/${encodeURIComponent(e)}/telemetry`,agents:e=>`/api/v2/runs/${encodeURIComponent(e)}/agents`,nodeAgents:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(t)}/agents`,projectAgents:e=>`/api/v2/projects/${encodeURIComponent(e)}/agents`,subscriptions:`/api/v2/subscriptions`,subscription:e=>`/api/v2/subscriptions/${encodeURIComponent(e)}`},xA={includeSettled:`include_settled`,includeConversations:`include_conversations`,runId:`run_id`,after:`after`,cursor:`cursor`,limit:`limit`,span:`span`,from:`from`,to:`to`,select:`select`,node:`node`,scope:`scope`,filter:`filter`,until:`until`,timeout:`timeout`,subscription:`subscription`,tick:`tick`},SA={run:`run`,node:`node`},CA=Y([`complete`,`partial`,`legacy`]),wA=Y([`native`,`labelled`,`inferred`]),TA=Q({agent_model_ms:KO(),judge_model_ms:KO(),llmlint_model_ms:KO(),tool_ms:KO()}),EA=_A.nullable(),DA=Z.nullable(),OA=Q({agent_seconds:EA,judge_seconds:EA,llmlint_seconds:EA,gate_seconds:EA,publication_wait_seconds:EA,lock_wait_seconds:EA,setup_seconds:EA,scheduling_seconds:EA,wall_seconds:EA,agent_model_ms:DA,judge_model_ms:DA,llmlint_model_ms:DA,tool_ms:DA,idle_orchestration_ms:DA,unattributed_ms:DA,wall_ms:DA,fractions:Q({agent_model:EA,judge_model:EA,llmlint_model:EA,tool:EA,idle_orchestration:EA,lock_wait:EA,setup:EA,scheduling:EA})}),kA=K().regex(/^[A-Za-z0-9_-]+$/,`a member name: letters, digits, hyphens and underscores`),AA=Y([`agent`,`judge`,`llmlint`]),jA=_A.nullable(),MA=Q({input_tokens:jA,output_tokens:jA,cache_read_tokens:jA,cache_write_tokens:jA,cost_usd:jA}),NA=Q({agent:MA,judge:MA,llmlint:MA,total:MA}),PA=Q({session_id:K().min(1),history_id:K().min(1).nullable().optional(),role:AA,agent_role:kA.optional(),turn_index:Z.nullable().optional(),started_at:vA.optional(),finished_at:vA.nullable().optional()}),FA=lk(K(),XO()),IA=Y([`agent`,`gate`,`checks`,`publication`,`timeout`,`provider`,`configuration`,`unknown`]),LA=Y([`agent`,`judge`,`llmlint`]),RA=Y([`quota_at_launch`,`quota_mid_conversation`,`stale_session_resume`,`rate_limit`,`harness_exit`]),zA=Q({side:LA.optional(),harness:K().optional(),variant:K().optional(),identity:K().optional(),cause:RA.optional(),raw_tail:K().optional(),reset_time:K().optional(),missing_session_id:K().optional(),wait_seconds:HO().nonnegative().optional(),failure_kind:K().optional(),structured_error:FA.optional(),judge_unrecorded:KO().optional()}).extend({class:IA,detail:K().optional()}),BA=Q({node:K().min(1),status:K().min(1),outcome:K().min(1).optional(),branch:K().min(1).optional(),comparison_remote:K().min(1).optional(),comparison_base:K().min(1).optional(),checkpoint:K().min(1).optional(),commit:K().min(1).optional(),retry_lineage:FA.optional(),gate_attestation:FA.optional(),failure:zA.optional(),timing:OA.optional(),usage:NA.optional(),sessions:q(PA),tool_commands:lk(K(),Z).optional(),turns:Z,lint:Z,timing_quality:CA,linkage_quality:wA,timing_presence:TA}),VA=Q({run_id:K().min(1),state:K().min(1),phase:K().min(1),last_event:yA,last_progress_at:_A.optional(),timing:OA,nodes:q(BA),providers:q(FA).optional(),failure:zA.optional(),check_rollup:FA.optional(),usage:NA,timing_quality:CA,linkage_quality:wA,timing_presence:TA,sources:q(K()),node_work_ms:Q({agent_model_ms:DA,judge_model_ms:DA,llmlint_model_ms:DA,tool_ms:DA,wall_ms:DA}),turns:Z,lint:Z,agent_count:Z.optional()}),HA=Q({schema_version:rk([K(),HO()]).optional(),observed_at:K().optional(),identities:q(FA)}),UA=Q({started_at:vA.optional(),launch_id:K().min(1),launcher:Y([`claude-code`,`codex`,`unknown`]),session_key:K().min(1).optional(),launcher_session_id:K().min(1).optional()}),WA=K().min(1),GA=Q({labels:lk(K(),K()).optional(),group:K().min(1).optional(),run_id:K().min(1),state:K().min(1),phase:K().min(1),last_event:yA,last_progress_at:_A.optional(),timing_quality:CA,linkage_quality:wA,timing:OA,node_counts:lk(K(),Z),launch:UA.optional(),project:K().min(1).optional(),project_name:K().min(1).optional(),liveness:WA.optional(),unread_surfaces:Z.optional()}),KA=Q({path:K().min(1),reason:K().min(1)}),qA=Q({api_version:X(2),telemetry_schema_version:X(30),observed_at:vA,runs:q(GA),next_cursor:K().min(1).optional(),unreadable:q(KA).optional(),missing:q(K().min(1)).optional(),provider_health:HA.optional()}),JA=Y([`agent`,`human`,`command`]),YA=Q({id:K().min(1),kind:JA.optional(),persona:K().min(1).optional(),task:K().min(1),deps:q(K().min(1)).optional(),max_turns:Z.positive().optional(),expects_no_diff:KO().optional()}),XA=Q({branch:K().min(1),base_branch:K().min(1),pr_base:K().min(1),checkpoint:K().min(1),completed_steps:q(K()).optional(),pr:K().nullable().optional(),mode:Y([`pause`,`retry`,`continue`]).optional(),attempts:Z.optional()}),ZA=Q({branch:K().min(1),repo:K().min(1).optional(),identity:K().min(1).optional(),base_branch:K().min(1).optional(),pr:K().min(1).optional(),pr_base:K().min(1).optional()}),QA=q(K()),$A=YA.extend({task:K().min(1).optional(),repo:K().min(1).optional(),steps:q(YA).min(1).optional(),session:K().min(1).optional(),project_dir:K().min(1).optional(),base_branch:K().min(1).optional(),branch:K().min(1).optional(),title:K().min(1).optional(),verify_cmd:K().min(1).optional(),skip_verify:KO().optional(),verify_via_ci:KO().optional(),merge_policy:Y([`auto`,`direct`,`none`]).optional(),workflow:Y([`local`,`remote`]).optional(),repo_type:Y([`single-owner`,`team`]).optional(),execution_checkout:K().min(1).optional(),stack_bases:q(ZA).optional(),resume:XA.optional(),sets:QA.optional(),command:q(K()).min(1).optional(),timeout_seconds:Z.positive().optional()}),ej=$A.superRefine((e,t)=>{e.steps===void 0&&e.task===void 0&&t.addIssue({code:`custom`,path:[`task`],message:"a plan task without `steps` must carry its own `task` prose"})}),tj=Q({gate_log:K().optional(),worker_report:K().optional(),oneharness_session:K().optional()}),nj=Q({id:K().min(1),kind:K().min(1),persona:K().nullable(),status:K().min(1),telemetry:FA.optional(),artifacts:tj.optional()}),rj=Q({ref:K().min(1),task:K(),unblocks:q(K()),unblocks_publication:KO()}),ij=Q({branch:K().min(1),base_branch:K().min(1),pr_base:K(),checkpoint:K().min(1),completed_steps:q(K()),pr:K().nullable(),mode:K().optional()}),aj=Q({identity:K().min(1),target:K().min(1),style:K().min(1).optional(),version:K().min(1)}),oj=Q({producer:K().min(1),target:K().min(1)}),sj=Q({path:K().min(1),content:K().optional(),truncated:KO().optional()}),cj=Q({kind:K().optional(),log:sj.optional(),status:K().optional(),task:K().optional(),unblocks:q(K()).optional(),blocked_by:q(K()).optional(),human_actions:q(rj).optional(),completed:KO().optional(),exit_code:HO().int().nullable().optional(),verdicts:q(XO()).optional(),usage:FA.optional(),telemetry:FA.optional(),repo:K().optional(),branch:K().optional(),commit:K().optional(),base_branch:K().optional(),pr_base:K().optional(),synthetic_stack_base:K().nullable().optional(),stack_bases:q(FA).optional(),repository_type:Y([`single-owner`,`team`]).nullable().optional(),repo_type:Y([`single-owner`,`team`]).nullable().optional(),publication_workflow:Y([`local`,`remote`]).nullable().optional(),workflow:Y([`local`,`remote`]).nullable().optional(),merge_policy:Y([`auto`,`direct`,`none`]).nullable().optional(),outcome:K().optional(),ok:KO().optional(),pr:K().nullable().optional(),release:aj.nullable().optional(),awaiting:q(oj).min(1).optional(),detail:K().optional(),follow_ups:K().nullable().optional(),steps:q(nj).optional(),waiting_steps:q(K()).optional(),resume:ij.nullable().optional(),error:K().nullable().optional(),retry_lineage:FA.optional(),deferred_cleanup:q(K()).optional(),artifacts:tj.optional()}),lj=Q({ok:KO().optional(),state:K().optional(),started_order:q(K()).optional(),results:lk(K(),cj).optional(),schema_version:Z.optional()}),uj=Y([`running`,`done`,`failed`,`waiting`,`parked`,`cancelled`,`complete-but-draft`,`complete-but-held`]),dj=Y([`pending`,`ready`,`running`,`waiting`,`blocked`,`skipped`,`done`,`not-completed`,`failed`,`parked`,`cancelled`,`complete-but-draft`,`complete-but-held`,`unknown`]),fj=Q({addressable:KO(),member:K().min(1).optional(),reason:K().min(1).optional()}).superRefine((e,t)=>{e.addressable===(e.reason!==void 0)&&t.addIssue({code:`custom`,path:[`reason`],message:`a reason is carried exactly when there is no turn to address`})}),pj=Q({id:K().min(1),kind:K(),unblocks:q(K().min(1))}),mj=Q({at:K().min(1),author:K().min(1),command:FA,reason:K(),envelope:Z.optional(),index:Z.optional(),refusal:FA.optional()}),hj=Q({run_id:K().min(1),plan:Q({tasks:q(ej),schema_version:Z.optional(),concurrency:Z.positive().optional(),name:K().min(1).optional(),goal:Q({id:K().min(1),text:K().min(1)}).optional()}),node_states:lk(K(),uj),node_status:lk(K(),dj),node_gated_by:lk(K(),q(K().min(1))),node_control:lk(K(),fj),node_results:lk(K(),cj),decisions:q(pj),attestations:q(K()),result:lj.nullable(),last_seq:Z,run_node_sets:QA.optional(),rejected_edits:q(mj).min(1).optional()}),gj=hj.superRefine(_j);function _j(e,t){let n=new Set(e.plan.tasks.map(e=>e.id)),r=new Set(Object.keys(e.node_status));(n.size!==e.plan.tasks.length||n.size!==r.size||[...n].some(e=>!r.has(e)))&&t.addIssue({code:`custom`,path:[`node_status`],message:`must contain exactly one entry for every plan task`}),Object.entries(e.node_gated_by).find(([e,t])=>!n.has(e)||t.some(e=>!n.has(e)))&&t.addIssue({code:`custom`,path:[`node_gated_by`],message:`must name only nodes in this graph's plan`}),Object.keys(e.node_control).find(t=>e.node_status[t]!==`running`)!==void 0&&t.addIssue({code:`custom`,path:[`node_control`],message:`must name only nodes the run has in flight`})}var vj=Q({cacheReadTokens:jA.optional(),cacheWriteTokens:jA.optional(),costUsd:jA.optional(),inputTokens:jA.optional(),outputTokens:jA.optional()}),yj=Q({index:Z,input:XO().optional(),kind:K(),name:K().nullable().optional(),output:K().nullable().optional(),toolCallId:K().min(1).optional(),output_truncated:X(!0).optional(),input_truncated:X(!0).optional()}),bj=Q({judge:K(),kind:K(),decision:K(),reason:K()}),xj=Q({agentEvents:q(Q({index:HO().int().nonnegative(),kind:Y([`message`,`reasoning`]),text:K()})).optional(),assistant:K().nullable(),durationMs:jA.optional(),failureKind:K().nullable(),finishedAt:vA.nullable().optional(),harness:K(),id:K(),judges:q(bj).optional(),model:K().nullable(),modelMs:jA.optional(),reasoning:K().nullable(),startedAt:vA.nullable().optional(),status:K(),timestamp:vA,toolMs:jA.optional(),tools:q(yj),unknown:FA,usage:vj,user:K()}),Sj=Q({conversation:Q({canContinue:KO(),harnesses:q(K()),id:K().min(1),name:K(),project:K(),startedAt:vA,state:K(),turns:q(xj)}),attribution:Q({runId:K().optional(),nodeId:K().optional(),stepId:K().optional(),launchId:K().optional(),launcher:Y([`claude-code`,`codex`,`unknown`]).optional(),transportRole:AA,agentRole:kA.optional(),parentConversationId:K().optional(),persona:K().optional(),finishedAt:vA.nullable().optional(),inferred:X(!0).optional(),timing:OA.optional()})}),Cj=Q({node:K().optional(),conversations:q(Sj)}),wj=rk([q(Sj),q(Cj).transform(e=>e.flatMap(e=>e.conversations))]),Tj=Q({name:K(),state:K(),status:K().optional(),conclusion:K().optional(),started_at:vA.optional(),completed_at:vA.optional(),required:KO(),requirement:K().optional(),url:K().url().nullable().optional()}),Ej=Q({ok:KO(),output_tail:K(),artifact_id:K().min(1).optional()}),Dj=Q({verification:Q({pre_push_hook:KO().optional(),required_checks:q(K()).optional(),required_checks_status:K().optional(),expected_gate:q(K()).optional(),checks:q(Tj).optional(),records:q(Ej)}),publication:Q({pr_url:K().url().optional(),branch:K().optional(),branch_url:K().url().optional(),merged:KO(),base_branch:K().optional(),commit:K().optional(),commit_url:K().url().optional()}).optional()}),Oj=q(tk({event_id:K().min(1),node:K().min(1),step:K().min(1).optional(),at:HO().finite(),kind:K(),name:K(),detail:K(),description:K(),events:HO().int().nonnegative()})),kj=Q({telemetry:Q({schema_version:Z,as_of:vA.optional()}).optional(),api_version:X(2),telemetry_schema_version:X(30),observed_at:vA,run:VA.extend({live_activity:Oj.optional()}),graph:gj.nullable(),conversations:wj,node_details:lk(K(),Dj).optional().default({}),launch:UA.optional(),provider_health:HA.optional()}),Aj=J({complete:KO(),loading:q(K()),failed:K().optional()}),jj=J({loading:X(!0)}),Mj=BA.partial({sessions:!0,turns:!0,lint:!0,timing_quality:!0,linkage_quality:!0,timing_presence:!0}),Nj=OA.partial().extend({wall_seconds:EA}),Pj=VA.partial({usage:!0,timing_quality:!0,linkage_quality:!0,timing_presence:!0,sources:!0,node_work_ms:!0,lint:!0}).extend({timing:Nj,nodes:q(Mj),turns:rk([Z,jj]),live_activity:Oj.optional()}),Fj=hj.partial({node_states:!0,decisions:!0,attestations:!0}).extend({plan:Q({tasks:q($A),schema_version:Z.optional(),concurrency:Z.positive().optional(),name:K().min(1).optional(),goal:Q({id:K().min(1),text:K().min(1)}).optional()})}).superRefine(_j),Ij=kj.extend({run:Pj,graph:Fj.nullable(),conversations:wj.optional(),progress:Aj.optional()}),Lj=Y([`conversation`,`gate_log`,`worker_report`,`oneharness_session`,`pr`]),Rj=Y([`run`,`node`,`step`,`dispatch`,`verification`,`publication`,`pr-drafting`,`conflict-resolution`,`human-wait`,`rollup`,`queued`]),zj=Y([`starting`,`dispatching`,`deciding`,`surfacing`,`waiting`,`settled`,`finished`]),Bj=Q({kind:Lj,value:K().min(1)}),Vj=Q({delivered:KO(),delivery:Y([`live`,`deferred`]).optional(),reached:Y([`queued`,`worker`,`supervisor`,`judged-with`,`carried`]).optional(),turn:Y([`interrupted`,`turn-end`]).optional(),member:K().min(1).optional(),input_bytes:Z.optional(),reason:K().min(1).optional(),node_id:K().min(1).optional()}).superRefine((e,t)=>{e.delivered&&e.reason!==void 0&&t.addIssue({code:`custom`,path:[`reason`],message:`a delivered redirection carries no reason it did not land`}),e.delivery!==void 0&&e.delivered!==(e.delivery===`live`)&&t.addIssue({code:`custom`,path:[`delivery`],message:"`delivery` is `live` exactly when the running turn took the note"})}),Hj=Q({dep:K().min(1),identity:K().min(1).optional(),target:K().min(1).optional(),style:K().min(1).optional(),action:K().min(1).optional(),since:vA.optional(),waited_seconds:Z.optional(),last_answer:K().min(1).optional()}),Uj=Q({kind:K().min(1).optional(),message:K().min(1).optional(),source:K().min(1).optional(),blocking:KO().optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a surface record carries at least one recorded fact`})}),Wj=Q({id:Z,correlation:K().min(1).optional(),node:K().min(1).optional(),kind:K().min(1).optional(),message:K().min(1).optional(),source:K().min(1).optional(),blocking:KO().optional(),queued_at:vA.optional(),read_at:vA.optional(),replied_at:vA.optional(),reply:Q({author:K().min(1).optional(),message:K().min(1).optional(),completion:KO().optional(),reason:K().min(1).optional(),provenance:K().min(1).optional()}).optional()}),Gj=Q({name:K().min(1).optional(),required:KO().optional(),requirement:K().optional(),url:K().nullable().optional(),state:K().min(1).optional(),kind:K().min(1).optional(),base:K().min(1).optional(),awaited:q(K().min(1)).optional(),grace_seconds:HO().nonnegative().optional(),warned:KO().optional(),head:K().min(1).optional(),verdict:K().min(1).optional(),skipped:q(K().min(1)).optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a review record carries at least one recorded fact`})}),Kj=Q({identity:K().min(1).optional(),target:K().min(1).optional(),style:K().min(1).optional(),version:K().min(1).optional(),landing_commit:K().min(1).optional(),actor:K().min(1).optional(),superseded:KO().optional(),form:K().min(1).optional(),outcome:K().min(1).optional(),elapsed_ms:Z.optional(),dep:K().min(1).optional(),delivery:K().min(1).optional(),awaiting:q(Hj).min(1).optional(),versions:q(Q({identity:K().min(1),target:K().min(1),version:K().min(1)})).min(1).optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a release record carries at least one recorded fact`})}),qj=Q({id:K().min(1),label:K().min(1),order:Z,started_at:vA}),Jj=Q({id:K().min(1),stream:K().min(1).optional(),seq:Z.optional(),journal_order:Z.optional(),record_id:K().min(1).optional(),persona:K().min(1).optional(),dispatch_id:K().min(1).optional(),dispatch_group:qj.optional(),fields:lk(K().min(1),Fk()).optional(),kind:K().min(1),at:vA,node_id:K().min(1).optional(),step_id:K().min(1).optional(),status:K().min(1).optional(),author:K().min(1).optional(),redirection:Vj.optional(),release:Kj.optional(),surface:Uj.optional(),surface_id:HO().int().nonnegative().optional(),correlation:K().min(1).optional(),surface_state:Wj.optional(),review:Gj.optional(),reference:Bj.optional(),description:K().optional(),tool:Q({index:Z,tool_call_id:K().min(1).optional(),turn:K().min(1).optional()}).optional()}),Yj=Q({started_at:vA,ended_at:vA}),Xj=Q({kind:K().min(1),blocking:q(K().min(1)).min(1).optional(),ahead:q(K().min(1)).min(1).optional(),limit:Z.optional(),reference:K().min(1).optional(),awaiting:q(K().min(1)).min(1).optional()}),Zj=Q({id:K().min(1),kind:Rj,label:K(),started_at:vA,ended_at:vA.nullable(),events:q(Jj),events_total:Z.optional(),parent_id:K().min(1).optional(),node_id:K().min(1).optional(),step_id:K().min(1).optional(),status:K().min(1).optional(),count:Z.optional(),total_duration_ms:Z.optional(),intervals:q(Yj).optional(),harness_scope:K().min(1).optional(),dispatch_attempt:K().min(1).optional(),agent_role:kA.optional(),transport_role:AA.optional(),dispatch_id:K().min(1).optional(),dispatch_group:qj.optional(),reference:Bj.optional(),detail:Q({ok:KO().optional(),output_tail:K().optional(),artifact_id:K().optional()}).optional(),phase:zj.optional(),reasons:q(Xj).min(1).optional()}).superRefine((e,t)=>{e.reasons!==void 0&&e.kind!==`queued`&&t.addIssue({code:`custom`,path:[`reasons`],message:`only a queued span carries the reasons a node was held`})}),Qj=Q({id:K().min(1),kind:Lj,content:K(),truncated:KO(),turns:q(xj).optional(),unavailable:K().optional()}),$j=Q({api_version:X(2),timeline_schema_version:X(16),observed_at:vA,run_id:K().min(1),spans:q(Zj),progress:Aj.optional()}),eM=Jj.extend({span_id:K().min(1)}),tM=Q({rows:q(eM),next_cursor:K().min(1).nullable(),total:Z,span:Q({id:K().min(1)}).optional(),observed_at:vA}),nM=ak(`kind`,[J({kind:X(`start`),total:Z,split:J({heads_s:HO().nonnegative(),fetch_s:HO().nonnegative(),build_s:HO().nonnegative()})}),J({kind:X(`rows`),rows:q(eM).max(1e3)}),J({kind:X(`end`)}),J({kind:X(`error`),message:K()})]),rM=Q({error:Q({code:K(),message:K()})});Q({schema_version:X(1),launch_id:K().min(1),launcher:Y([`claude-code`,`codex`]),launcher_session_id:K().min(1),started_at:vA,repository_identity:K().min(1)});var iM=Y([`snapshot`,`run.changed`,`conversation.changed`,`activity.changed`,`run.removed`]),aM=FA;function oM(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.slice(0,t),r=e.slice(t+1);return/^[a-z0-9][a-z0-9-]*$/u.test(n)&&r.length>0&&r.length<=128&&!r.startsWith(`.`)&&/^[A-Za-z0-9._-]+$/u.test(r)}var sM=Q({project:K().min(1).nullable(),name:K().min(1).nullable(),last_write_at:_A.nullable(),runs:q(GA),agent_count:Z.optional()}),cM=Q({api_version:X(2),telemetry_schema_version:X(30),observed_at:vA,projects:q(sM),unreadable:q(KA).optional()}),lM=sM.extend({api_version:X(2),telemetry_schema_version:X(30),observed_at:vA}),uM={api_version:X(2),telemetry_schema_version:X(30),observed_at:vA};Y([`manager`,`user`]);var dM=Q({...uM,run_id:K().min(1),stopped:KO(),owner:K().min(1),forced:KO(),teardown:K().min(1)}),fM=Y([`host`]);Y([`host`]);var pM=Y([`delivered`,`no-turn`,`failed`,`not-asked`]),mM=Y([`graceful`,`killed`,`still-running`]),hM=Y([`pushed`,`already-on-origin`,`no-remote`,`refused`]),gM=Q({...uM,scope:fM,root:K(),grace_seconds:Z,forced:KO(),complete:KO(),runs:q(Q({run_id:K().min(1),owner:K().min(1),forced_over_owner:KO(),dispatches:q(Q({node:K().min(1),pid:Z,interrupt:pM,detail:K(),ended:mM,waited_ms:Z})),teardown:K().min(1),branches:q(Q({identity:K(),branch:K(),result:hM,remote:K().nullable(),commit:K().nullable(),detail:K()}))})),not_pushed:q(Q({identity:K(),branch:K()})),not_pushed_unread:K().nullable(),rendered:K()}),_M=Q({...uM,session_key:K().min(1).optional(),reported:q(Q({run:K().min(1),standing:K().min(1),why_not_watched:K()})),unresolved:q(K())}),vM=Q({schema_version:X(1),host:K(),root:K(),root_error:K().nullable(),free_space:q(Q({roots:q(Q({role:K(),path:K().nullable(),measured_at:K().nullable()})),free_bytes:Z.nullable(),total_bytes:Z.nullable(),error:K().nullable()})),dispatches:q(Q({run:K(),node:K(),launcher:K(),age_ms:_A.nullable(),proof:Y([`held`,`unproven`]),unproven:K().nullable()})),gone:q(Q({run:K(),node:K(),reason:K()})),skipped:q(Q({path:K(),reason:K()}))}),yM=Q({...uM,reading:vM.optional(),rendered:K(),unreadable:q(KA).optional()});Q({...uM,run_id:K().min(1),rendered:K()});var bM=Q({...uM,run_id:K().min(1),liveness:WA,unread_surfaces:Q({count:Z,oldest_seconds:_A.nullable()}),node_status:lk(K(),K().min(1)),summary:K(),rendered:K()});Q({...uM,run_id:K().min(1),node:K().min(1).nullable().optional(),rendered:K()}),Q({...uM,run_id:K().min(1),telemetry:Q({schema_version:Z})});var xM=Q({history_id:K().min(1),harness:K().min(1),variant:K().min(1).optional(),harness_id:K().min(1),started:vA}),SM=Q({history_session:K().min(1),name:K().min(1),history_dir:K().min(1),history_project:K().min(1),history_file:K().min(1),project:K().min(1),started:vA,labels:lk(K(),K()),runs:q(xM),run_id:K().min(1).optional()}),CM={...uM,sessions:q(SM),skipped:Z},wM=Q({...CM,run_id:K().min(1),node:K().min(1).optional()}),TM=Q({...CM,project:K().min(1)}),EM=K().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u),DM=K().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(0|[1-9][0-9]*)$/u),OM=rk([J({type:X(`sidebar`)}),J({type:X(`detail`),run_id:K().min(1),filter:K().min(1).optional()}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`run`),filter:K().min(1).optional()}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`node`),node:K().min(1),filter:K().min(1).optional()}),J({type:X(`human-items`),filter:hA.optional(),item:K().min(1).optional()})]),kM=J({id:K().min(1),name:K(),group:J({project:K(),name:K()}).nullable(),kind:K().nullable(),state:K().min(1),nodes:J({total:Z,done:Z,failed:Z,running:Z}),updated_at:vA,started_at:vA.optional()});Object.keys(kM.shape);var AM=rk([J({type:X(`sidebar`)}),J({type:X(`detail`),run_id:K().min(1),detail:Ij}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`run`),detail:Ij,timeline:$j}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`node`),node:K().min(1),detail:Ij,timeline:$j}),gA]),jM=J({id:DM,sidebar:q(kM).nullable(),visible:AM}),MM=q(rk([K(),Z])),NM=rk([J({p:MM,v:XO()}),J({p:MM,a:q(XO())}),J({p:MM,d:X(!0)})]),PM={id:DM,base:DM,subscription:EM},FM=Y([`unknown-cursor`,`stale-cursor`,`server-restarted`]),IM=J({...PM,type:X(`reset`),reason:FM,snapshot:jM}),LM=rk([IM,J({...PM,type:X(`sidebar.snapshot`),rows:q(kM)}),J({...PM,type:X(`run.changed`),row:kM}),J({...PM,type:X(`run.removed`),run_id:K().min(1)}),J({...PM,type:X(`detail.patch`),run_id:K().min(1),ops:q(NM)}),J({...PM,type:X(`timeline.patch`),run_id:K().min(1),scope:X(`run`),ops:q(NM)}),J({...PM,type:X(`timeline.patch`),run_id:K().min(1),scope:X(`node`),node:K().min(1),ops:q(NM)}),J({...PM,type:X(`human-items.patch`),ops:q(NM)})]),RM=[`reset`,`sidebar.snapshot`,`run.changed`,`run.removed`,`detail.patch`,`timeline.patch`,`human-items.patch`],zM=J({subscription:EM,view:OM,initial:rk([J({type:X(`snapshot`),snapshot:jM}),IM])}),BM=`api_version,telemetry_schema_version,observed_at,progress,run.run_id,run.state,run.phase,run.last_event,run.timing.wall_seconds,run.nodes.*.node,run.nodes.*.status,run.nodes.*.outcome,run.nodes.*.failure,run.turns,graph.last_seq,graph.run_id,graph.plan.goal,graph.plan.tasks.*.id,graph.plan.tasks.*.kind,graph.plan.tasks.*.name,graph.plan.tasks.*.deps,graph.plan.tasks.*.repo,graph.plan.tasks.*.steps,graph.node_status,graph.node_gated_by,graph.node_control,graph.result,graph.node_results.*.blocked_by,graph.node_results.*.awaiting,graph.node_results.*.outcome,graph.node_results.*.error,graph.node_results.*.detail,node_details`.split(`,`);function VM(e){let t=new Map;for(let n of e){let e=t;for(let t of n.split(`.`)){let n=e.get(t);n===void 0&&(n=new Map,e.set(t,n)),e=n}}return t}VM(BM),J({code:X(`subscription-unavailable`),reason:Y([`expired`,`server-restarted`,`unknown`])});var HM=class extends Error{constructor(e){super(e),this.name=`PatchError`}};function UM(e,t){let n=e;for(let e of t)n=WM(n,e);return n}function WM(e,t){let n=t.p;if(`a`in t)return KM(e,n,e=>{if(!Array.isArray(e))throw new HM(`an append's path names an array`);return[...e,...t.a]});let r=n.at(-1);if(r===void 0)throw new HM(`the root is never replaced or deleted`);return KM(e,n.slice(0,-1),e=>{if(`v`in t){if(Array.isArray(e)&&typeof r==`number`){if(r>=e.length)throw new HM(`a set replaces an existing element`);let n=[...e];return n[r]=t.v,n}if(GM(e)&&typeof r==`string`)return{...e,[r]:t.v};throw new HM(`a set's path does not match its parent`)}if(GM(e)&&typeof r==`string`){if(!Object.hasOwn(e,r))throw new HM(`a deletion names an existing member`);let t={...e};return delete t[r],t}throw new HM(`a deletion names an object member`)})}function GM(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function KM(e,t,n){let[r,...i]=t;if(r===void 0)return n(e);if(Array.isArray(e)&&typeof r==`number`){if(r>=e.length)throw new HM(`an index on the path does not exist`);let t=[...e];return t[r]=KM(e[r],i,n),t}if(GM(e)&&typeof r==`string`){if(!Object.hasOwn(e,r))throw new HM(`a parent on the path does not exist`);return{...e,[r]:KM(e[r],i,n)}}throw new HM(`a path step does not match its parent`)}var qM=1e3;function JM(e){let t=e.lastIndexOf(`:`);return{epoch:e.slice(0,t),seq:BigInt(e.slice(t+1))}}var YM=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||aN(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?.(sN(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: ${oN(e)}`));return}this.#_(t)}#_(e){let t=iN(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(bA.events);e.searchParams.set(xA.subscription,this.#r),e.searchParams.set(xA.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 i(`Opening the live stream`))},S),t.onopen=()=>{this.#b(),n&&this.#t.onConnected?.(),n=!0};for(let e of RM)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})},qM)))}}#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=LM.parse(JSON.parse(e))}catch(e){this.#w(Error(`A frame failed contract validation: ${oN(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=JM(r.applied),o=JM(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=rN(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={...XM(r,i,this.#n),applied:i.id}}catch(e){this.#w(Error(`A patch could not be applied: ${oN(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 XM(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:QM(e.visible,t,n)}}}function ZM(e,t,n,r){let i=e.safeParse(UM(t,n));if(!i.success)throw Error(`the patched ${r} failed contract validation`);return i.data}function QM(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=ZM(gA,e,t.ops,`human items`);if(nN(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=ZM(Ij,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(ZM($j,e.timeline,t.ops,`timeline`))}}}function $M(e){return[e.type,e.run_id,e.scope,e.node].join(`\0`)}function eN(e){return Array.isArray(e)?e.map(eN):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,eN(t)])):e}function tN(e){if(e!==void 0){if(typeof e!=`string`)return JSON.stringify(eN(e));if(!e.startsWith(`{`))return e;try{return JSON.stringify(eN(JSON.parse(e)))}catch{return e}}}function nN(e,t){return t.detail===null?!1:!(`item`in e)||t.detail.item.id!==e.item}function rN(e,t){let n=t.visible;if($M(n)!==$M(e))return`the state of another view`;if(n.type===`human-items`)return nN(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].every(e=>e===n.run_id)?void 0:`a payload of another run`}function iN(e,t){if($M(t.view)!==$M(e))return`another view`;let n=e=>`filter`in e?e.filter:void 0;if(tN(n(t.view))!==tN(n(e)))return`another filter`;let r=e=>`item`in e?e.item:void 0;return r(t.view)===r(e)?rN(e,t.initial.snapshot):`another item`}function aN(e,t){return JSON.stringify(e)===JSON.stringify(t)}function oN(e){return e instanceof Error?e.message:String(e)}function sN(e){return e instanceof Error?e:Error(String(e))}var cN=class extends Error{status;code;constructor(e,t,n,r){super(e,r),this.status=t,this.code=n,this.name=`TelemetryClientError`}},lN=50,uN=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=lN){let r=this.#r(bA.runs);return r.searchParams.set(xA.includeSettled,String(e)),r.searchParams.set(xA.limit,String(n)),t!==void 0&&r.searchParams.set(xA.cursor,t),this.#a(r,qA.parse)}async selectRuns(e){if(e.length===0)throw new cN(`Invalid selection`);for(let t of e)if(pN(t,`run ID`),t.includes(`,`))throw new cN(`Invalid run ID`);let t=this.#r(bA.runs);return t.searchParams.set(xA.select,e.join(`,`)),this.#a(t,qA.parse)}async getRun(e,t={}){pN(e,`run ID`);let n=this.#r(bA.run(e));return t.includeConversations!==void 0&&n.searchParams.set(xA.includeConversations,String(t.includeConversations)),t.filter!==void 0&&n.searchParams.set(xA.filter,t.filter),this.#a(n,kj.parse)}async getTimeline(e,t,n){pN(e,`run ID`);let r=this.#r(bA.timeline(e));return n!==void 0&&r.searchParams.set(xA.filter,n),t===void 0?r.searchParams.set(xA.scope,SA.run):(r.searchParams.set(xA.scope,SA.node),r.searchParams.set(xA.node,t)),this.#a(r,$j.parse)}async getConversation(e,t){return pN(e,`run ID`),pN(t,`conversation ID`),this.#a(this.#r(bA.conversation(e,t)),Sj.parse)}async getArtifact(e,t){return pN(e,`run ID`),pN(t,`artifact ID`),this.#a(this.#r(bA.artifact(e,t)),Qj.parse)}async getTimelineEvents(e,t){pN(e,`run ID`),t.node!==void 0&&pN(t.node,`node ID`);let n=this.#r(bA.timelineEvents(e));n.searchParams.set(xA.scope,t.scope===`node`&&t.node!==void 0?SA.node:SA.run);for(let[e,r]of[[xA.node,t.node],[xA.span,t.span],[xA.cursor,t.cursor],[xA.from,t.from],[xA.to,t.to],[xA.filter,t.filter],[xA.limit,t.limit===void 0?void 0:String(t.limit)]])r!==void 0&&n.searchParams.set(e,r);return this.#a(n,tM.parse,void 0,`This page of the run's history`)}subscribe(e){e.runId!==void 0&&pN(e.runId,`run ID`),e.after!==void 0&&pN(e.after,`cursor`);let t=this.#r(bA.events);e.runId!==void 0&&t.searchParams.set(xA.runId,e.runId),e.after!==void 0&&t.searchParams.set(xA.after,e.after),e.filter!==void 0&&t.searchParams.set(xA.filter,e.filter);let n=this.#i(t);for(let t of iM.options)n.addEventListener(t,n=>{try{let r=n,i=JSON.parse(r.data),a=t===`snapshot`?qA.parse(i):aM.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 YM({subscribe:e=>this.createSubscription(e),retire:(e,t)=>this.retireSubscription(e,t),open:e=>this.#i(e),url:e=>this.#r(e),parseSubscribed:e=>zM.parse(e)},e)}async*streamNodeTimeline(e,t,n){pN(e,`run ID`),pN(t,`node ID`);let r=this.#r(bA.timelineNodeStream(e));r.searchParams.set(xA.scope,SA.node),r.searchParams.set(xA.node,t);let i;try{i=await this.#t(r,n===void 0?{}:{signal:n})}catch(e){throw new cN(`Telemetry request failed`,void 0,void 0,{cause:e})}if(!i.ok||i.body===null){let e=await i.json().catch(()=>void 0),t=rM.safeParse(e);throw new cN(t.success?t.data.error.message:`Telemetry request failed with status ${i.status}`,i.status,t.success?t.data.error.code:void 0)}let a=i.body.pipeThrough(new TextDecoderStream).getReader(),o=e=>{try{return nM.parse(JSON.parse(e))}catch(e){throw new cN(`Telemetry response failed contract validation`,i.status,void 0,{cause:e})}},s=``;try{for(;;){let e;try{e=await a.read()}catch(e){throw new cN(`The node's timeline was cut off`,i.status,void 0,{cause:e})}if(e.done)break;s+=e.value;for(let e=s.indexOf(`
80
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ZC,s=!LC.jitless,c=s&&QC.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?bE([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function CE(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!pw(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>gw(e,r,RC())))}),t)}var wE=W(`$ZodUnion`,(e,t)=>{FT.init(e,t),KC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),KC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),KC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),KC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>UC(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>CE(t,i,e,a)):CE(s,i,e,a)}}),TE=W(`$ZodDiscriminatedUnion`,(e,t)=>{wE.init(e,t);let n=e._zod.parse;KC(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=VC(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ZC(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),EE=W(`$ZodIntersection`,(e,t)=>{FT.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>OE(e,t,n)):OE(e,i,a)}});function DE(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($C(e)&&$C(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=DE(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=DE(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function OE(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),pw(e))return e;let r=DE(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var kE=W(`$ZodRecord`,(e,t)=>{FT.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!$C(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...mw(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...mw(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>gw(e,r,RC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...mw(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...mw(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),AE=W(`$ZodEnum`,(e,t)=>{FT.init(e,t);let n=zC(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>tw.has(typeof e)).map(e=>typeof e==`string`?nw(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jE=W(`$ZodLiteral`,(e,t)=>{if(FT.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?nw(e):e?nw(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),ME=W(`$ZodTransform`,(e,t)=>{FT.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new IC(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new FC;return n.value=i,n}});function NE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var PE=W(`$ZodOptional`,(e,t)=>{FT.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,KC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),KC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${UC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>NE(t,e.value)):NE(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),FE=W(`$ZodNullable`,(e,t)=>{FT.init(e,t),KC(e._zod,`optin`,()=>t.innerType._zod.optin),KC(e._zod,`optout`,()=>t.innerType._zod.optout),KC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${UC(e.source)}|null)$`):void 0}),KC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),IE=W(`$ZodDefault`,(e,t)=>{FT.init(e,t),e._zod.optin=`optional`,KC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>LE(e,t)):LE(r,t)}});function LE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var RE=W(`$ZodPrefault`,(e,t)=>{FT.init(e,t),e._zod.optin=`optional`,KC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),zE=W(`$ZodNonOptional`,(e,t)=>{FT.init(e,t),KC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>BE(t,e)):BE(i,e)}});function BE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var VE=W(`$ZodCatch`,(e,t)=>{FT.init(e,t),KC(e._zod,`optin`,()=>t.innerType._zod.optin),KC(e._zod,`optout`,()=>t.innerType._zod.optout),KC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>gw(e,n,RC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>gw(e,n,RC()))},input:e.value}),e.issues=[]),e)}}),HE=W(`$ZodPipe`,(e,t)=>{FT.init(e,t),KC(e._zod,`values`,()=>t.in._zod.values),KC(e._zod,`optin`,()=>t.in._zod.optin),KC(e._zod,`optout`,()=>t.out._zod.optout),KC(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>UE(e,t.in,n)):UE(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>UE(e,t.out,n)):UE(r,t.out,n)}});function UE(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var WE=W(`$ZodReadonly`,(e,t)=>{FT.init(e,t),KC(e._zod,`propValues`,()=>t.innerType._zod.propValues),KC(e._zod,`values`,()=>t.innerType._zod.values),KC(e._zod,`optin`,()=>t.innerType._zod.optin),KC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(GE):GE(r)}});function GE(e){return e.value=Object.freeze(e.value),e}var KE=W(`$ZodLazy`,(e,t)=>{FT.init(e,t),KC(e._zod,`innerType`,()=>t.getter()),KC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),KC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),KC(e._zod,`optin`,()=>e._zod.innerType._zod.optin??void 0),KC(e._zod,`optout`,()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),qE=W(`$ZodCustom`,(e,t)=>{gT.init(e,t),FT.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>JE(t,n,r,e));JE(i,n,r,e)}});function JE(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(vw(e))}}var YE=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function XE(){return new YE}var ZE=XE();function QE(e,t){return new e({type:`string`,...G(t)})}function $E(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...G(t)})}function eD(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...G(t)})}function tD(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...G(t)})}function nD(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...G(t)})}function rD(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...G(t)})}function iD(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...G(t)})}function aD(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...G(t)})}function oD(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...G(t)})}function sD(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...G(t)})}function cD(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...G(t)})}function lD(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...G(t)})}function uD(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...G(t)})}function dD(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...G(t)})}function fD(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...G(t)})}function pD(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...G(t)})}function mD(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...G(t)})}function hD(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...G(t)})}function gD(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...G(t)})}function _D(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...G(t)})}function vD(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...G(t)})}function yD(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...G(t)})}function bD(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...G(t)})}function xD(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...G(t)})}function SD(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...G(t)})}function CD(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...G(t)})}function wD(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...G(t)})}function TD(e,t){return new e({type:`number`,checks:[],...G(t)})}function ED(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...G(t)})}function DD(e,t){return new e({type:`boolean`,...G(t)})}function OD(e,t){return new e({type:`null`,...G(t)})}function kD(e){return new e({type:`unknown`})}function AD(e,t){return new e({type:`never`,...G(t)})}function jD(e,t){return new vT({check:`less_than`,...G(t),value:e,inclusive:!1})}function MD(e,t){return new vT({check:`less_than`,...G(t),value:e,inclusive:!0})}function ND(e,t){return new yT({check:`greater_than`,...G(t),value:e,inclusive:!1})}function PD(e,t){return new yT({check:`greater_than`,...G(t),value:e,inclusive:!0})}function FD(e,t){return new bT({check:`multiple_of`,...G(t),value:e})}function ID(e,t){return new ST({check:`max_length`,...G(t),maximum:e})}function LD(e,t){return new CT({check:`min_length`,...G(t),minimum:e})}function RD(e,t){return new wT({check:`length_equals`,...G(t),length:e})}function zD(e,t){return new ET({check:`string_format`,format:`regex`,...G(t),pattern:e})}function BD(e){return new DT({check:`string_format`,format:`lowercase`,...G(e)})}function VD(e){return new OT({check:`string_format`,format:`uppercase`,...G(e)})}function HD(e,t){return new kT({check:`string_format`,format:`includes`,...G(t),includes:e})}function UD(e,t){return new AT({check:`string_format`,format:`starts_with`,...G(t),prefix:e})}function WD(e,t){return new jT({check:`string_format`,format:`ends_with`,...G(t),suffix:e})}function GD(e){return new MT({check:`overwrite`,tx:e})}function KD(e){return GD(t=>t.normalize(e))}function qD(){return GD(e=>e.trim())}function JD(){return GD(e=>e.toLowerCase())}function YD(){return GD(e=>e.toUpperCase())}function XD(e,t,n){return new e({type:`array`,element:t,...G(n)})}function ZD(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...G(n)})}function QD(e){let t=$D(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(vw(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(vw(r))}},e(n.value,n)));return t}function $D(e,t){let n=new gT({check:`custom`,...G(t)});return n._zod.check=e,n}var eO=W(`ZodISODateTime`,(e,t)=>{YT.init(e,t),TO.init(e,t)});function tO(e){return xD(eO,e)}var nO=W(`ZodISODate`,(e,t)=>{XT.init(e,t),TO.init(e,t)});function rO(e){return SD(nO,e)}var iO=W(`ZodISOTime`,(e,t)=>{ZT.init(e,t),TO.init(e,t)});function aO(e){return CD(iO,e)}var oO=W(`ZodISODuration`,(e,t)=>{QT.init(e,t),TO.init(e,t)});function sO(e){return wD(oO,e)}var cO=(e,t)=>{bw.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Cw(e,t)},flatten:{value:t=>Sw(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,BC,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,BC,2)}},isEmpty:{get(){return e.issues.length===0}}})};W(`ZodError`,cO);var lO=W(`ZodError`,cO,{Parent:Error}),uO=ww(lO),dO=Tw(lO),fO=Ew(lO),pO=Ow(lO),mO=Aw(lO),hO=jw(lO),gO=Mw(lO),_O=Nw(lO),vO=Pw(lO),yO=Fw(lO),bO=Iw(lO),xO=Lw(lO),SO=W(`ZodType`,(e,t)=>(FT.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(JC(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>rw(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>uO(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>fO(e,t,n),e.parseAsync=async(t,n)=>dO(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>pO(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>mO(e,t,n),e.decode=(t,n)=>hO(e,t,n),e.encodeAsync=async(t,n)=>gO(e,t,n),e.decodeAsync=async(t,n)=>_O(e,t,n),e.safeEncode=(t,n)=>vO(e,t,n),e.safeDecode=(t,n)=>yO(e,t,n),e.safeEncodeAsync=async(t,n)=>bO(e,t,n),e.safeDecodeAsync=async(t,n)=>xO(e,t,n),e.refine=(t,n)=>e.check(Rk(t,n)),e.superRefine=t=>e.check(zk(t)),e.overwrite=t=>e.check(GD(t)),e.optional=()=>bk(e),e.nullable=()=>Sk(e),e.nullish=()=>bk(Sk(e)),e.nonoptional=t=>Ok(e,t),e.array=()=>q(e),e.or=t=>ck([e,t]),e.and=t=>fk(e,t),e.transform=t=>Mk(e,vk(t)),e.default=t=>wk(e,t),e.prefault=t=>Ek(e,t),e.catch=t=>Ak(e,t),e.pipe=t=>Mk(e,t),e.readonly=()=>Pk(e),e.describe=t=>{let n=e.clone();return ZE.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return ZE.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ZE.get(e);let n=e.clone();return ZE.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),CO=W(`_ZodString`,(e,t)=>{IT.init(e,t),SO.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(zD(...t)),e.includes=(...t)=>e.check(HD(...t)),e.startsWith=(...t)=>e.check(UD(...t)),e.endsWith=(...t)=>e.check(WD(...t)),e.min=(...t)=>e.check(LD(...t)),e.max=(...t)=>e.check(ID(...t)),e.length=(...t)=>e.check(RD(...t)),e.nonempty=(...t)=>e.check(LD(1,...t)),e.lowercase=t=>e.check(BD(t)),e.uppercase=t=>e.check(VD(t)),e.trim=()=>e.check(qD()),e.normalize=(...t)=>e.check(KD(...t)),e.toLowerCase=()=>e.check(JD()),e.toUpperCase=()=>e.check(YD())}),wO=W(`ZodString`,(e,t)=>{IT.init(e,t),CO.init(e,t),e.email=t=>e.check($E(EO,t)),e.url=t=>e.check(aD(kO,t)),e.jwt=t=>e.check(bD(GO,t)),e.emoji=t=>e.check(oD(jO,t)),e.guid=t=>e.check(eD(DO,t)),e.uuid=t=>e.check(tD(OO,t)),e.uuidv4=t=>e.check(nD(OO,t)),e.uuidv6=t=>e.check(rD(OO,t)),e.uuidv7=t=>e.check(iD(OO,t)),e.nanoid=t=>e.check(sD(MO,t)),e.guid=t=>e.check(eD(DO,t)),e.cuid=t=>e.check(cD(NO,t)),e.cuid2=t=>e.check(lD(PO,t)),e.ulid=t=>e.check(uD(FO,t)),e.base64=t=>e.check(_D(HO,t)),e.base64url=t=>e.check(vD(UO,t)),e.xid=t=>e.check(dD(IO,t)),e.ksuid=t=>e.check(fD(LO,t)),e.ipv4=t=>e.check(pD(RO,t)),e.ipv6=t=>e.check(mD(zO,t)),e.cidrv4=t=>e.check(hD(BO,t)),e.cidrv6=t=>e.check(gD(VO,t)),e.e164=t=>e.check(yD(WO,t)),e.datetime=t=>e.check(tO(t)),e.date=t=>e.check(rO(t)),e.time=t=>e.check(aO(t)),e.duration=t=>e.check(sO(t))});function K(e){return QE(wO,e)}var TO=W(`ZodStringFormat`,(e,t)=>{LT.init(e,t),CO.init(e,t)}),EO=W(`ZodEmail`,(e,t)=>{BT.init(e,t),TO.init(e,t)}),DO=W(`ZodGUID`,(e,t)=>{RT.init(e,t),TO.init(e,t)}),OO=W(`ZodUUID`,(e,t)=>{zT.init(e,t),TO.init(e,t)}),kO=W(`ZodURL`,(e,t)=>{VT.init(e,t),TO.init(e,t)});function AO(e){return aD(kO,e)}var jO=W(`ZodEmoji`,(e,t)=>{HT.init(e,t),TO.init(e,t)}),MO=W(`ZodNanoID`,(e,t)=>{UT.init(e,t),TO.init(e,t)}),NO=W(`ZodCUID`,(e,t)=>{WT.init(e,t),TO.init(e,t)}),PO=W(`ZodCUID2`,(e,t)=>{GT.init(e,t),TO.init(e,t)}),FO=W(`ZodULID`,(e,t)=>{KT.init(e,t),TO.init(e,t)}),IO=W(`ZodXID`,(e,t)=>{qT.init(e,t),TO.init(e,t)}),LO=W(`ZodKSUID`,(e,t)=>{JT.init(e,t),TO.init(e,t)}),RO=W(`ZodIPv4`,(e,t)=>{$T.init(e,t),TO.init(e,t)}),zO=W(`ZodIPv6`,(e,t)=>{eE.init(e,t),TO.init(e,t)}),BO=W(`ZodCIDRv4`,(e,t)=>{tE.init(e,t),TO.init(e,t)}),VO=W(`ZodCIDRv6`,(e,t)=>{nE.init(e,t),TO.init(e,t)}),HO=W(`ZodBase64`,(e,t)=>{iE.init(e,t),TO.init(e,t)}),UO=W(`ZodBase64URL`,(e,t)=>{oE.init(e,t),TO.init(e,t)}),WO=W(`ZodE164`,(e,t)=>{sE.init(e,t),TO.init(e,t)}),GO=W(`ZodJWT`,(e,t)=>{lE.init(e,t),TO.init(e,t)}),KO=W(`ZodNumber`,(e,t)=>{uE.init(e,t),SO.init(e,t),e.gt=(t,n)=>e.check(ND(t,n)),e.gte=(t,n)=>e.check(PD(t,n)),e.min=(t,n)=>e.check(PD(t,n)),e.lt=(t,n)=>e.check(jD(t,n)),e.lte=(t,n)=>e.check(MD(t,n)),e.max=(t,n)=>e.check(MD(t,n)),e.int=t=>e.check(YO(t)),e.safe=t=>e.check(YO(t)),e.positive=t=>e.check(ND(0,t)),e.nonnegative=t=>e.check(PD(0,t)),e.negative=t=>e.check(jD(0,t)),e.nonpositive=t=>e.check(MD(0,t)),e.multipleOf=(t,n)=>e.check(FD(t,n)),e.step=(t,n)=>e.check(FD(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function qO(e){return TD(KO,e)}var JO=W(`ZodNumberFormat`,(e,t)=>{dE.init(e,t),KO.init(e,t)});function YO(e){return ED(JO,e)}var XO=W(`ZodBoolean`,(e,t)=>{fE.init(e,t),SO.init(e,t)});function ZO(e){return DD(XO,e)}var QO=W(`ZodNull`,(e,t)=>{pE.init(e,t),SO.init(e,t)});function $O(e){return OD(QO,e)}var ek=W(`ZodUnknown`,(e,t)=>{mE.init(e,t),SO.init(e,t)});function tk(){return kD(ek)}var nk=W(`ZodNever`,(e,t)=>{hE.init(e,t),SO.init(e,t)});function rk(e){return AD(nk,e)}var ik=W(`ZodArray`,(e,t)=>{_E.init(e,t),SO.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(LD(t,n)),e.nonempty=t=>e.check(LD(1,t)),e.max=(t,n)=>e.check(ID(t,n)),e.length=(t,n)=>e.check(RD(t,n)),e.unwrap=()=>e.element});function q(e,t){return XD(ik,e,t)}var ak=W(`ZodObject`,(e,t)=>{SE.init(e,t),SO.init(e,t),KC(e,`shape`,()=>t.shape),e.keyof=()=>Y(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:tk()}),e.loose=()=>e.clone({...e._zod.def,catchall:tk()}),e.strict=()=>e.clone({...e._zod.def,catchall:rk()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>cw(e,t),e.safeExtend=t=>lw(e,t),e.merge=t=>uw(e,t),e.pick=t=>ow(e,t),e.omit=t=>sw(e,t),e.partial=(...t)=>dw(yk,e,t[0]),e.required=(...t)=>fw(Dk,e,t[0])});function ok(e,t){return new ak({type:`object`,shape:e??{},...G(t)})}function J(e,t){return new ak({type:`object`,shape:e,catchall:rk(),...G(t)})}var sk=W(`ZodUnion`,(e,t)=>{wE.init(e,t),SO.init(e,t),e.options=t.options});function ck(e,t){return new sk({type:`union`,options:e,...G(t)})}var lk=W(`ZodDiscriminatedUnion`,(e,t)=>{sk.init(e,t),TE.init(e,t)});function uk(e,t,n){return new lk({type:`union`,options:t,discriminator:e,...G(n)})}var dk=W(`ZodIntersection`,(e,t)=>{EE.init(e,t),SO.init(e,t)});function fk(e,t){return new dk({type:`intersection`,left:e,right:t})}var pk=W(`ZodRecord`,(e,t)=>{kE.init(e,t),SO.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function mk(e,t,n){return new pk({type:`record`,keyType:e,valueType:t,...G(n)})}var hk=W(`ZodEnum`,(e,t)=>{AE.init(e,t),SO.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new hk({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new hk({...t,checks:[],...G(r),entries:i})}});function Y(e,t){return new hk({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var gk=W(`ZodLiteral`,(e,t)=>{jE.init(e,t),SO.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new gk({type:`literal`,values:Array.isArray(e)?e:[e],...G(t)})}var _k=W(`ZodTransform`,(e,t)=>{ME.init(e,t),SO.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new IC(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(vw(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(vw(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function vk(e){return new _k({type:`transform`,transform:e})}var yk=W(`ZodOptional`,(e,t)=>{PE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bk(e){return new yk({type:`optional`,innerType:e})}var xk=W(`ZodNullable`,(e,t)=>{FE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sk(e){return new xk({type:`nullable`,innerType:e})}var Ck=W(`ZodDefault`,(e,t)=>{IE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function wk(e,t){return new Ck({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ew(t)}})}var Tk=W(`ZodPrefault`,(e,t)=>{RE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ek(e,t){return new Tk({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ew(t)}})}var Dk=W(`ZodNonOptional`,(e,t)=>{zE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ok(e,t){return new Dk({type:`nonoptional`,innerType:e,...G(t)})}var kk=W(`ZodCatch`,(e,t)=>{VE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ak(e,t){return new kk({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var jk=W(`ZodPipe`,(e,t)=>{HE.init(e,t),SO.init(e,t),e.in=t.in,e.out=t.out});function Mk(e,t){return new jk({type:`pipe`,in:e,out:t})}var Nk=W(`ZodReadonly`,(e,t)=>{WE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Pk(e){return new Nk({type:`readonly`,innerType:e})}var Fk=W(`ZodLazy`,(e,t)=>{KE.init(e,t),SO.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Ik(e){return new Fk({type:`lazy`,getter:e})}var Lk=W(`ZodCustom`,(e,t)=>{qE.init(e,t),SO.init(e,t)});function Rk(e,t={}){return ZD(Lk,e,t)}function zk(e){return QD(e)}function Bk(e){let t=Ik(()=>ck([K(e),qO(),ZO(),$O(),q(t),mk(K(),t)]));return t}var Vk=Re(),Hk=[`urgent`,`high`,`medium`,`low`],Uk={urgent:`Critical`,high:`High`,medium:`Medium`,low:`Low`},Wk={list:`/api/human-items`,item:e=>`/api/human-items/${encodeURIComponent(e)}`,answers:`/api/human-items/answers`,answer:e=>`/api/human-items/${encodeURIComponent(e)}/answer`,complete:e=>`/api/human-items/${encodeURIComponent(e)}/complete`,dismiss:e=>`/api/human-items/${encodeURIComponent(e)}/dismiss`,reopen:e=>`/api/human-items/${encodeURIComponent(e)}/reopen`,note:e=>`/api/human-items/${encodeURIComponent(e)}/note`},Gk=K().nullable(),Kk=K().regex(/\S/u),qk=J({session:K(),run:Gk,plan:Gk}),Jk=uk(`scope`,[J({scope:X(`nothing`)}),J({scope:X(`work`),run:K(),node:K()}),J({scope:X(`plan`),plan:K()}),J({scope:X(`host`)})]),Yk=Y([`manager`,`user`]),Xk=uk(`when`,[J({when:X(`time`),at:tO({offset:!0}).optional(),after_seconds:qO().int().min(1).optional(),reason:Kk.optional()}),J({when:X(`run`),run:Kk,on:Y([`settled`,`ended`]),reason:Kk.optional()}),J({when:X(`node`),run:Kk,node:Kk,reason:Kk.optional()}),J({when:X(`check`),command:q(K()).min(1),cwd:K().regex(/^(\/|\\|[A-Za-z]:[\\/])/u).optional(),timeout_seconds:qO().int().min(1).max(60).optional(),interval_seconds:qO().int().min(10).max(86400).optional(),reason:Kk.optional()})]).superRefine((e,t)=>{let n=e.when===`time`&&e.at===void 0==(e.after_seconds===void 0)?`a time names exactly one of at and after_seconds`:e.when===`check`&&!/\S/u.test(e.command[0]??``)?`a check's program is not blank`:void 0;n!==void 0&&t.addIssue({code:`custom`,message:n})}),Zk=J({actor:K(),on_behalf_of:Gk,text:Gk,choice:Gk.optional(),reason:Gk,provenance:Yk.optional(),condition:Xk.nullable().optional()}),Qk=J({id:K().regex(/^[a-z0-9][a-z0-9-]{0,63}$/u),title:K().regex(/^[^\r\n]*\S[^\r\n]*$/u).refine(e=>[...e].length<=80),description:Kk});function $k(e,t){let n=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));return n(e)===n(t)}function eA(e){let t=e.expiry??[];if(t.some(e=>e.when===`time`&&e.after_seconds!==void 0||e.when===`check`&&e.cwd===void 0))return`a stored condition holds its time's at and its check's cwd`;let n=e.resolution,r=n?.condition??void 0;if(e.state!==`expired`)return r===void 0?void 0:`only an expired item's resolution names the condition that held`;if(n!==null)return n.actor===`engine`&&n.on_behalf_of===null&&n.text===null&&(n.choice??null)===null&&(n.provenance??`manager`)===`manager`&&n.reason!==null&&/\S/u.test(n.reason)&&r!==void 0&&t.some(e=>$k(e,r))?void 0:`an expiry is the engine's, with a reason and one of the item's conditions`}function tA(e){let t=eA(e);if(t!==void 0)return t;let{kind:n,state:r,resolution:i}=e,a=e.choices??[];if(n===`task`&&a.length>0)return`choices are only valid on questions`;if(new Set(a.map(({id:e})=>e)).size!==a.length)return`a choice id is repeated`;let o=i?.choice??void 0;if(o!==void 0&&(r!==`answered`||!a.some(({id:e})=>e===o)))return`a resolution's choice is one this answered question offers`;if(n===`question`&&e.approval!==null)return`approval is only valid on tasks`;if(r===`open`)return i===null?void 0:`an open item has no resolution`;if(i===null)return`a resolved item carries its resolution`;if(r===`answered`)return n===`question`&&(i.text===null?o!==void 0:/\S/u.test(i.text))&&i.reason===null?void 0:`an answer is a question's, with a choice or text and no reason`;if(r===`completed`)return n===`task`&&(i.text===null||/\S/u.test(i.text))&&i.reason===null?void 0:`a completion is a task's, with no reason and any comment not blank`;if(r!==`expired`)return i.text===null?void 0:`a dismissal carries no text`}var nA=J({schema_version:X(1),id:K().min(1),dedup_key:K(),kind:Y([`task`,`question`]),title:Kk,body:Kk,choices:q(Qk).max(6).optional(),priority:Y(Hk),owner:qk,block:Jk,approval:J({board_copy:K(),key:K()}).nullable(),state:Y([`open`,`answered`,`completed`,`dismissed`,`expired`]),resolution:Zk.nullable(),tracker:J({task:K(),url:AO()}).nullable(),expiry:q(Xk).max(8).optional(),created_at:K(),updated_at:K()}).superRefine((e,t)=>{let n=tA(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),rA=J({run:K(),node:K(),title:K()}),iA=J({plan:K(),count:qO().int().nonnegative(),preview:q(rA).max(3)}),aA=J({total:qO().int().nonnegative(),plans:q(iA)});function oA(e,t){return!(e.state===`open`&&e.block.scope!==`nothing`)&&(t.total!==0||t.plans.length>0)?`a non-blocking item reports nothing blocked`:new Set(t.plans.map(({plan:e})=>e)).size===t.plans.length?t.plans.some(({count:e,preview:t})=>t.length!==Math.min(e,3))?`a preview is the first three affected steps of its plan`:t.plans.reduce((e,{count:t})=>e+t,0)===t.total?void 0:`the blocked total is the plans' counts`:`a blocked plan appears twice`}var sA=J({available:ZO(),reason:Gk});function cA({dedup_key:e,block:t,owner:n}){return t.scope===`work`&&e===`run:${t.run}#${t.node}`&&n.run===t.run}function lA(e,{available:t,reason:n}){return(t?n!==null:n===null||!/\S/u.test(n))?`a reopen states a reason exactly when it is unavailable`:e.state===`open`||e.state===`answered`||cA(e)||e.state!==`expired`&&e.resolution?.actor===`engine`?t?`this item's state cannot be reopened`:void 0:t||e.state===`completed`&&e.approval!==null?void 0:`nothing about this item's state refuses a reopen`}var uA=J({condition:qO().int().nonnegative(),last_run_at:Kk,outcome:Y([`holds`,`not-yet`,`failed`]),detail:Gk}).superRefine(({outcome:e,detail:t},n)=>{e===`failed`!=(t!==null)&&n.addIssue({code:`custom`,message:`a check carries a detail exactly when it failed`})});function dA(e,t){let n=e.expiry??[];return(t??[]).every(({condition:e})=>n[e]?.when===`check`)?void 0:`a check names one of the item's check conditions`}var fA=J({item:nA,blocked:aA,reopen:sA,checks:q(uA).optional()}).superRefine(({item:e,blocked:t,reopen:n,checks:r},i)=>{let a=oA(e,t)??lA(e,n)??dA(e,r);a!==void 0&&i.addIssue({code:`custom`,message:a})});function pA(e){let{blocked:t,nodes:n}=e;if(n.length!==t.total)return`the steps are the blocked total`;if(new Set(n.map(({run:e,node:t})=>`${e}\u0000${t}`)).size!==n.length)return`a blocked step appears twice`;let r=0;for(let{count:e,preview:i}of t.plans){let t=n.slice(r,r+e);if(i.some((e,n)=>t[n]?.run!==e.run||t[n]?.node!==e.node))return`a preview is the first steps of its plan's group`;r+=e}}var mA=J({action:Y([`human-item-raised`,`human-item-answered`,`human-item-completed`,`human-item-dismissed`,`human-item-auto-resolved`,`human-item-reopened`,`human-item-noted`,`human-item-expired`]),at:tO({offset:!0}),actor:Kk,on_behalf_of:Gk,provenance:Yk}),hA=J({item:nA,blocked:aA,nodes:q(rA),reopen:sA,history:q(mA).optional(),checks:q(uA).optional()}).superRefine((e,t)=>{let n=oA(e.item,e.blocked)??lA(e.item,e.reopen)??dA(e.item,e.checks)??pA(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),gA=J({item:fA,event_id:K()}),_A=uk(`kind`,[J({kind:X(`unavailable`)}),J({kind:X(`conflict`),reason:K()})]),vA=J({batch:Gk.optional(),answered:q(gA),refused:q(J({id:K(),refusal:_A}))}),yA=J({items:q(fA)}),bA=J({kind:Y([`task`,`question`]).nullable().optional(),blocking:ZO().nullable().optional(),priority:Y(Hk).nullable().optional(),state:Y([`open`,`answered`,`completed`,`dismissed`,`expired`]).nullable().optional(),session:K().nullable().optional(),run:K().nullable().optional(),plan:K().nullable().optional(),host:ZO().nullable().optional()}),xA=J({type:X(`human-items`),items:q(fA),detail:hA.nullable()}),SA=qO().finite().nonnegative(),Z=qO().int().nonnegative(),CA=tO({offset:!0}),wA=K().min(1).nullable(),Q=e=>ok(e).catchall(tk()),TA={runs:`/api/v2/runs`,run:e=>`/api/v2/runs/${encodeURIComponent(e)}`,timeline:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline`,conversation:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/conversations/${encodeURIComponent(t)}`,artifact:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,timelineEvents:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline/events`,timelineNodeStream:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline/node-stream`,events:`/api/v2/events`,projects:`/api/v2/projects`,project:e=>`/api/v2/projects/${encodeURIComponent(e)}`,stop:e=>`/api/v2/runs/${encodeURIComponent(e)}/stop`,shutdown:`/api/v2/shutdown`,unwatched:`/api/v2/unwatched`,host:`/api/v2/host`,status:e=>`/api/v2/runs/${encodeURIComponent(e)}/status`,results:e=>`/api/v2/runs/${encodeURIComponent(e)}/results`,goals:`/api/v2/goals`,runGoals:e=>`/api/v2/runs/${encodeURIComponent(e)}/goals`,transcript:e=>`/api/v2/runs/${encodeURIComponent(e)}/transcript`,telemetry:e=>`/api/v2/runs/${encodeURIComponent(e)}/telemetry`,agents:e=>`/api/v2/runs/${encodeURIComponent(e)}/agents`,nodeAgents:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(t)}/agents`,projectAgents:e=>`/api/v2/projects/${encodeURIComponent(e)}/agents`,subscriptions:`/api/v2/subscriptions`,subscription:e=>`/api/v2/subscriptions/${encodeURIComponent(e)}`},EA={includeSettled:`include_settled`,includeConversations:`include_conversations`,runId:`run_id`,after:`after`,cursor:`cursor`,limit:`limit`,span:`span`,from:`from`,to:`to`,select:`select`,node:`node`,scope:`scope`,filter:`filter`,until:`until`,timeout:`timeout`,subscription:`subscription`,tick:`tick`},DA={run:`run`,node:`node`},OA=Y([`complete`,`partial`,`legacy`]),kA=Y([`native`,`labelled`,`inferred`]),AA=Q({agent_model_ms:ZO(),judge_model_ms:ZO(),llmlint_model_ms:ZO(),tool_ms:ZO()}),jA=SA.nullable(),MA=Z.nullable(),NA=Q({agent_seconds:jA,judge_seconds:jA,llmlint_seconds:jA,gate_seconds:jA,publication_wait_seconds:jA,lock_wait_seconds:jA,setup_seconds:jA,scheduling_seconds:jA,wall_seconds:jA,agent_model_ms:MA,judge_model_ms:MA,llmlint_model_ms:MA,tool_ms:MA,idle_orchestration_ms:MA,unattributed_ms:MA,wall_ms:MA,fractions:Q({agent_model:jA,judge_model:jA,llmlint_model:jA,tool:jA,idle_orchestration:jA,lock_wait:jA,setup:jA,scheduling:jA})}),PA=K().regex(/^[A-Za-z0-9_-]+$/,`a member name: letters, digits, hyphens and underscores`),FA=Y([`agent`,`judge`,`llmlint`]),IA=SA.nullable(),LA=Q({input_tokens:IA,output_tokens:IA,cache_read_tokens:IA,cache_write_tokens:IA,cost_usd:IA}),RA=Q({agent:LA,judge:LA,llmlint:LA,total:LA}),zA=Q({session_id:K().min(1),history_id:K().min(1).nullable().optional(),role:FA,agent_role:PA.optional(),turn_index:Z.nullable().optional(),started_at:CA.optional(),finished_at:CA.nullable().optional()}),BA=mk(K(),tk()),VA=Y([`agent`,`gate`,`checks`,`publication`,`timeout`,`provider`,`configuration`,`unknown`]),HA=Y([`agent`,`judge`,`llmlint`]),UA=Y([`quota_at_launch`,`quota_mid_conversation`,`stale_session_resume`,`rate_limit`,`harness_exit`]),WA=Q({side:HA.optional(),harness:K().optional(),variant:K().optional(),identity:K().optional(),cause:UA.optional(),raw_tail:K().optional(),reset_time:K().optional(),missing_session_id:K().optional(),wait_seconds:qO().nonnegative().optional(),failure_kind:K().optional(),structured_error:BA.optional(),judge_unrecorded:ZO().optional()}).extend({class:VA,detail:K().optional()}),GA=Q({node:K().min(1),status:K().min(1),outcome:K().min(1).optional(),branch:K().min(1).optional(),comparison_remote:K().min(1).optional(),comparison_base:K().min(1).optional(),checkpoint:K().min(1).optional(),commit:K().min(1).optional(),retry_lineage:BA.optional(),gate_attestation:BA.optional(),failure:WA.optional(),timing:NA.optional(),usage:RA.optional(),sessions:q(zA),tool_commands:mk(K(),Z).optional(),turns:Z,lint:Z,timing_quality:OA,linkage_quality:kA,timing_presence:AA}),KA=Q({run_id:K().min(1),state:K().min(1),phase:K().min(1),last_event:wA,last_progress_at:SA.optional(),timing:NA,nodes:q(GA),providers:q(BA).optional(),failure:WA.optional(),check_rollup:BA.optional(),usage:RA,timing_quality:OA,linkage_quality:kA,timing_presence:AA,sources:q(K()),node_work_ms:Q({agent_model_ms:MA,judge_model_ms:MA,llmlint_model_ms:MA,tool_ms:MA,wall_ms:MA}),turns:Z,lint:Z,agent_count:Z.optional()}),qA=Q({schema_version:ck([K(),qO()]).optional(),observed_at:K().optional(),identities:q(BA)}),JA=Q({started_at:CA.optional(),launch_id:K().min(1),launcher:Y([`claude-code`,`codex`,`unknown`]),session_key:K().min(1).optional(),launcher_session_id:K().min(1).optional()}),YA=K().min(1),XA=Q({labels:mk(K(),K()).optional(),group:K().min(1).optional(),run_id:K().min(1),state:K().min(1),phase:K().min(1),last_event:wA,last_progress_at:SA.optional(),timing_quality:OA,linkage_quality:kA,timing:NA,node_counts:mk(K(),Z),launch:JA.optional(),project:K().min(1).optional(),project_name:K().min(1).optional(),liveness:YA.optional(),unread_surfaces:Z.optional()}),ZA=Q({path:K().min(1),reason:K().min(1)}),QA=Q({api_version:X(2),telemetry_schema_version:X(30),observed_at:CA,runs:q(XA),next_cursor:K().min(1).optional(),unreadable:q(ZA).optional(),missing:q(K().min(1)).optional(),provider_health:qA.optional()}),$A=Y([`agent`,`human`,`command`]),ej=Q({id:K().min(1),kind:$A.optional(),persona:K().min(1).optional(),task:K().min(1),deps:q(K().min(1)).optional(),max_turns:Z.positive().optional(),expects_no_diff:ZO().optional()}),tj=Q({branch:K().min(1),base_branch:K().min(1),pr_base:K().min(1),checkpoint:K().min(1),completed_steps:q(K()).optional(),pr:K().nullable().optional(),mode:Y([`pause`,`retry`,`continue`]).optional(),attempts:Z.optional()}),nj=Q({branch:K().min(1),repo:K().min(1).optional(),identity:K().min(1).optional(),base_branch:K().min(1).optional(),pr:K().min(1).optional(),pr_base:K().min(1).optional()}),rj=q(K()),ij=ej.extend({task:K().min(1).optional(),repo:K().min(1).optional(),steps:q(ej).min(1).optional(),session:K().min(1).optional(),project_dir:K().min(1).optional(),base_branch:K().min(1).optional(),branch:K().min(1).optional(),title:K().min(1).optional(),verify_cmd:K().min(1).optional(),skip_verify:ZO().optional(),verify_via_ci:ZO().optional(),merge_policy:Y([`auto`,`direct`,`none`]).optional(),workflow:Y([`local`,`remote`]).optional(),repo_type:Y([`single-owner`,`team`]).optional(),execution_checkout:K().min(1).optional(),stack_bases:q(nj).optional(),resume:tj.optional(),sets:rj.optional(),command:q(K()).min(1).optional(),timeout_seconds:Z.positive().optional()}),aj=ij.superRefine((e,t)=>{e.steps===void 0&&e.task===void 0&&t.addIssue({code:`custom`,path:[`task`],message:"a plan task without `steps` must carry its own `task` prose"})}),oj=Q({gate_log:K().optional(),worker_report:K().optional(),oneharness_session:K().optional()}),sj=Q({id:K().min(1),kind:K().min(1),persona:K().nullable(),status:K().min(1),telemetry:BA.optional(),artifacts:oj.optional()}),cj=Q({ref:K().min(1),task:K(),unblocks:q(K()),unblocks_publication:ZO()}),lj=Q({branch:K().min(1),base_branch:K().min(1),pr_base:K(),checkpoint:K().min(1),completed_steps:q(K()),pr:K().nullable(),mode:K().optional()}),uj=Q({identity:K().min(1),target:K().min(1),style:K().min(1).optional(),version:K().min(1)}),dj=Q({producer:K().min(1),target:K().min(1)}),fj=Q({path:K().min(1),content:K().optional(),truncated:ZO().optional()}),pj=Q({kind:K().optional(),log:fj.optional(),status:K().optional(),task:K().optional(),unblocks:q(K()).optional(),blocked_by:q(K()).optional(),human_actions:q(cj).optional(),completed:ZO().optional(),exit_code:qO().int().nullable().optional(),verdicts:q(tk()).optional(),usage:BA.optional(),telemetry:BA.optional(),repo:K().optional(),branch:K().optional(),commit:K().optional(),base_branch:K().optional(),pr_base:K().optional(),synthetic_stack_base:K().nullable().optional(),stack_bases:q(BA).optional(),repository_type:Y([`single-owner`,`team`]).nullable().optional(),repo_type:Y([`single-owner`,`team`]).nullable().optional(),publication_workflow:Y([`local`,`remote`]).nullable().optional(),workflow:Y([`local`,`remote`]).nullable().optional(),merge_policy:Y([`auto`,`direct`,`none`]).nullable().optional(),outcome:K().optional(),ok:ZO().optional(),pr:K().nullable().optional(),release:uj.nullable().optional(),awaiting:q(dj).min(1).optional(),detail:K().optional(),follow_ups:K().nullable().optional(),steps:q(sj).optional(),waiting_steps:q(K()).optional(),resume:lj.nullable().optional(),error:K().nullable().optional(),retry_lineage:BA.optional(),deferred_cleanup:q(K()).optional(),artifacts:oj.optional()}),mj=Q({ok:ZO().optional(),state:K().optional(),started_order:q(K()).optional(),results:mk(K(),pj).optional(),schema_version:Z.optional()}),hj=Y([`running`,`done`,`failed`,`waiting`,`parked`,`cancelled`,`complete-but-draft`,`complete-but-held`]),gj=Y([`pending`,`ready`,`running`,`waiting`,`blocked`,`skipped`,`done`,`not-completed`,`failed`,`parked`,`cancelled`,`complete-but-draft`,`complete-but-held`,`unknown`]),_j=Q({addressable:ZO(),member:K().min(1).optional(),reason:K().min(1).optional()}).superRefine((e,t)=>{e.addressable===(e.reason!==void 0)&&t.addIssue({code:`custom`,path:[`reason`],message:`a reason is carried exactly when there is no turn to address`})}),vj=Q({id:K().min(1),kind:K(),unblocks:q(K().min(1))}),yj=Q({at:K().min(1),author:K().min(1),command:BA,reason:K(),envelope:Z.optional(),index:Z.optional(),refusal:BA.optional()}),bj=Q({run_id:K().min(1),plan:Q({tasks:q(aj),schema_version:Z.optional(),concurrency:Z.positive().optional(),name:K().min(1).optional(),goal:Q({id:K().min(1),text:K().min(1)}).optional()}),node_states:mk(K(),hj),node_status:mk(K(),gj),node_gated_by:mk(K(),q(K().min(1))),node_control:mk(K(),_j),node_results:mk(K(),pj),decisions:q(vj),attestations:q(K()),result:mj.nullable(),last_seq:Z,run_node_sets:rj.optional(),rejected_edits:q(yj).min(1).optional()}),xj=bj.superRefine(Sj);function Sj(e,t){let n=new Set(e.plan.tasks.map(e=>e.id)),r=new Set(Object.keys(e.node_status));(n.size!==e.plan.tasks.length||n.size!==r.size||[...n].some(e=>!r.has(e)))&&t.addIssue({code:`custom`,path:[`node_status`],message:`must contain exactly one entry for every plan task`}),Object.entries(e.node_gated_by).find(([e,t])=>!n.has(e)||t.some(e=>!n.has(e)))&&t.addIssue({code:`custom`,path:[`node_gated_by`],message:`must name only nodes in this graph's plan`}),Object.keys(e.node_control).find(t=>e.node_status[t]!==`running`)!==void 0&&t.addIssue({code:`custom`,path:[`node_control`],message:`must name only nodes the run has in flight`})}var Cj=Q({cacheReadTokens:IA.optional(),cacheWriteTokens:IA.optional(),costUsd:IA.optional(),inputTokens:IA.optional(),outputTokens:IA.optional()}),wj=Q({index:Z,input:tk().optional(),kind:K(),name:K().nullable().optional(),output:K().nullable().optional(),toolCallId:K().min(1).optional(),output_truncated:X(!0).optional(),input_truncated:X(!0).optional()}),Tj=Q({judge:K(),kind:K(),decision:K(),reason:K()}),Ej=Q({agentEvents:q(Q({index:qO().int().nonnegative(),kind:Y([`message`,`reasoning`]),text:K()})).optional(),assistant:K().nullable(),durationMs:IA.optional(),failureKind:K().nullable(),finishedAt:CA.nullable().optional(),harness:K(),id:K(),judges:q(Tj).optional(),model:K().nullable(),modelMs:IA.optional(),reasoning:K().nullable(),startedAt:CA.nullable().optional(),status:K(),timestamp:CA,toolMs:IA.optional(),tools:q(wj),unknown:BA,usage:Cj,user:K()}),Dj=Q({conversation:Q({canContinue:ZO(),harnesses:q(K()),id:K().min(1),name:K(),project:K(),startedAt:CA,state:K(),turns:q(Ej)}),attribution:Q({runId:K().optional(),nodeId:K().optional(),stepId:K().optional(),launchId:K().optional(),launcher:Y([`claude-code`,`codex`,`unknown`]).optional(),transportRole:FA,agentRole:PA.optional(),parentConversationId:K().optional(),persona:K().optional(),finishedAt:CA.nullable().optional(),inferred:X(!0).optional(),timing:NA.optional()})}),Oj=Q({node:K().optional(),conversations:q(Dj)}),kj=ck([q(Dj),q(Oj).transform(e=>e.flatMap(e=>e.conversations))]),Aj=Q({name:K(),state:K(),status:K().optional(),conclusion:K().optional(),started_at:CA.optional(),completed_at:CA.optional(),required:ZO(),requirement:K().optional(),url:K().url().nullable().optional()}),jj=Q({ok:ZO(),output_tail:K(),artifact_id:K().min(1).optional()}),Mj=Q({verification:Q({pre_push_hook:ZO().optional(),required_checks:q(K()).optional(),required_checks_status:K().optional(),expected_gate:q(K()).optional(),checks:q(Aj).optional(),records:q(jj)}),publication:Q({pr_url:K().url().optional(),branch:K().optional(),branch_url:K().url().optional(),merged:ZO(),base_branch:K().optional(),commit:K().optional(),commit_url:K().url().optional()}).optional()}),Nj=q(ok({event_id:K().min(1),node:K().min(1),step:K().min(1).optional(),at:qO().finite(),kind:K(),name:K(),detail:K(),description:K(),events:qO().int().nonnegative()})),Pj=Q({telemetry:Q({schema_version:Z,as_of:CA.optional()}).optional(),api_version:X(2),telemetry_schema_version:X(30),observed_at:CA,run:KA.extend({live_activity:Nj.optional()}),graph:xj.nullable(),conversations:kj,node_details:mk(K(),Mj).optional().default({}),launch:JA.optional(),provider_health:qA.optional()}),Fj=J({complete:ZO(),loading:q(K()),failed:K().optional()}),Ij=J({loading:X(!0)}),Lj=GA.partial({sessions:!0,turns:!0,lint:!0,timing_quality:!0,linkage_quality:!0,timing_presence:!0}),Rj=NA.partial().extend({wall_seconds:jA}),zj=KA.partial({usage:!0,timing_quality:!0,linkage_quality:!0,timing_presence:!0,sources:!0,node_work_ms:!0,lint:!0}).extend({timing:Rj,nodes:q(Lj),turns:ck([Z,Ij]),live_activity:Nj.optional()}),Bj=bj.partial({node_states:!0,decisions:!0,attestations:!0}).extend({plan:Q({tasks:q(ij),schema_version:Z.optional(),concurrency:Z.positive().optional(),name:K().min(1).optional(),goal:Q({id:K().min(1),text:K().min(1)}).optional()})}).superRefine(Sj),Vj=Pj.extend({run:zj,graph:Bj.nullable(),conversations:kj.optional(),progress:Fj.optional()}),Hj=Y([`conversation`,`gate_log`,`worker_report`,`oneharness_session`,`pr`,`refusal`]),Uj=Y([`run`,`node`,`step`,`dispatch`,`verification`,`publication`,`pr-drafting`,`conflict-resolution`,`human-wait`,`rollup`,`queued`]),Wj=Y([`starting`,`dispatching`,`deciding`,`surfacing`,`waiting`,`settled`,`finished`]),Gj=Q({kind:Hj,value:K().min(1)}),Kj=Q({delivered:ZO(),delivery:Y([`live`,`deferred`]).optional(),reached:Y([`queued`,`worker`,`supervisor`,`judged-with`,`carried`]).optional(),turn:Y([`interrupted`,`turn-end`]).optional(),member:K().min(1).optional(),input_bytes:Z.optional(),reason:K().min(1).optional(),node_id:K().min(1).optional()}).superRefine((e,t)=>{e.delivered&&e.reason!==void 0&&t.addIssue({code:`custom`,path:[`reason`],message:`a delivered redirection carries no reason it did not land`}),e.delivery!==void 0&&e.delivered!==(e.delivery===`live`)&&t.addIssue({code:`custom`,path:[`delivery`],message:"`delivery` is `live` exactly when the running turn took the note"})}),qj=Q({dep:K().min(1),identity:K().min(1).optional(),target:K().min(1).optional(),style:K().min(1).optional(),action:K().min(1).optional(),since:CA.optional(),waited_seconds:Z.optional(),last_answer:K().min(1).optional()}),Jj=Q({kind:K().min(1).optional(),message:K().min(1).optional(),source:K().min(1).optional(),blocking:ZO().optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a surface record carries at least one recorded fact`})}),Yj=Q({id:Z,correlation:K().min(1).optional(),node:K().min(1).optional(),kind:K().min(1).optional(),message:K().min(1).optional(),source:K().min(1).optional(),blocking:ZO().optional(),queued_at:CA.optional(),read_at:CA.optional(),replied_at:CA.optional(),reply:Q({author:K().min(1).optional(),message:K().min(1).optional(),completion:ZO().optional(),reason:K().min(1).optional(),provenance:K().min(1).optional()}).optional()}),Xj=Q({name:K().min(1).optional(),required:ZO().optional(),requirement:K().optional(),url:K().nullable().optional(),state:K().min(1).optional(),kind:K().min(1).optional(),base:K().min(1).optional(),awaited:q(K().min(1)).optional(),grace_seconds:qO().nonnegative().optional(),warned:ZO().optional(),head:K().min(1).optional(),verdict:K().min(1).optional(),skipped:q(K().min(1)).optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a review record carries at least one recorded fact`})}),Zj=Q({identity:K().min(1).optional(),target:K().min(1).optional(),style:K().min(1).optional(),version:K().min(1).optional(),landing_commit:K().min(1).optional(),actor:K().min(1).optional(),superseded:ZO().optional(),form:K().min(1).optional(),outcome:K().min(1).optional(),elapsed_ms:Z.optional(),dep:K().min(1).optional(),delivery:K().min(1).optional(),awaiting:q(qj).min(1).optional(),versions:q(Q({identity:K().min(1),target:K().min(1),version:K().min(1)})).min(1).optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a release record carries at least one recorded fact`})}),Qj=Q({id:K().min(1),label:K().min(1),order:Z,started_at:CA}),$j=Q({id:K().min(1),stream:K().min(1).optional(),seq:Z.optional(),journal_order:Z.optional(),record_id:K().min(1).optional(),persona:K().min(1).optional(),dispatch_id:K().min(1).optional(),dispatch_group:Qj.optional(),fields:mk(K().min(1),Bk()).optional(),kind:K().min(1),at:CA,node_id:K().min(1).optional(),step_id:K().min(1).optional(),status:K().min(1).optional(),author:K().min(1).optional(),redirection:Kj.optional(),release:Zj.optional(),surface:Jj.optional(),surface_id:qO().int().nonnegative().optional(),correlation:K().min(1).optional(),surface_state:Yj.optional(),review:Xj.optional(),reference:Gj.optional(),description:K().optional(),tool:Q({index:Z,tool_call_id:K().min(1).optional(),turn:K().min(1).optional()}).optional()}),eM=Q({started_at:CA,ended_at:CA}),tM=Q({kind:K().min(1),blocking:q(K().min(1)).min(1).optional(),ahead:q(K().min(1)).min(1).optional(),limit:Z.optional(),reference:K().min(1).optional(),awaiting:q(K().min(1)).min(1).optional()}),nM=Q({id:K().min(1),kind:Uj,label:K(),started_at:CA,ended_at:CA.nullable(),events:q($j),events_total:Z.optional(),parent_id:K().min(1).optional(),node_id:K().min(1).optional(),step_id:K().min(1).optional(),status:K().min(1).optional(),count:Z.optional(),total_duration_ms:Z.optional(),intervals:q(eM).optional(),harness_scope:K().min(1).optional(),dispatch_attempt:K().min(1).optional(),agent_role:PA.optional(),transport_role:FA.optional(),dispatch_id:K().min(1).optional(),dispatch_group:Qj.optional(),reference:Gj.optional(),detail:Q({ok:ZO().optional(),output_tail:K().optional(),artifact_id:K().optional()}).optional(),phase:Wj.optional(),reasons:q(tM).min(1).optional()}).superRefine((e,t)=>{e.reasons!==void 0&&e.kind!==`queued`&&t.addIssue({code:`custom`,path:[`reasons`],message:`only a queued span carries the reasons a node was held`})}),rM=Q({id:K().min(1),kind:Hj,content:K(),truncated:ZO(),turns:q(Ej).optional(),unavailable:K().optional()}),iM=Q({api_version:X(2),timeline_schema_version:X(17),observed_at:CA,run_id:K().min(1),spans:q(nM),progress:Fj.optional()}),aM=$j.extend({span_id:K().min(1)}),oM=Q({rows:q(aM),next_cursor:K().min(1).nullable(),total:Z,span:Q({id:K().min(1)}).optional(),observed_at:CA}),sM=uk(`kind`,[J({kind:X(`start`),total:Z,split:J({heads_s:qO().nonnegative(),fetch_s:qO().nonnegative(),build_s:qO().nonnegative()})}),J({kind:X(`rows`),rows:q(aM).max(1e3)}),J({kind:X(`end`)}),J({kind:X(`error`),message:K()})]),cM=Q({error:Q({code:K(),message:K()})});Q({schema_version:X(1),launch_id:K().min(1),launcher:Y([`claude-code`,`codex`]),launcher_session_id:K().min(1),started_at:CA,repository_identity:K().min(1)});var lM=Y([`snapshot`,`run.changed`,`conversation.changed`,`activity.changed`,`run.removed`]),uM=BA;function dM(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.slice(0,t),r=e.slice(t+1);return/^[a-z0-9][a-z0-9-]*$/u.test(n)&&r.length>0&&r.length<=128&&!r.startsWith(`.`)&&/^[A-Za-z0-9._-]+$/u.test(r)}var fM=Q({project:K().min(1).nullable(),name:K().min(1).nullable(),last_write_at:SA.nullable(),runs:q(XA),agent_count:Z.optional()}),pM=Q({api_version:X(2),telemetry_schema_version:X(30),observed_at:CA,projects:q(fM),unreadable:q(ZA).optional()}),mM=fM.extend({api_version:X(2),telemetry_schema_version:X(30),observed_at:CA}),hM={api_version:X(2),telemetry_schema_version:X(30),observed_at:CA};Y([`manager`,`user`]);var gM=Q({...hM,run_id:K().min(1),stopped:ZO(),owner:K().min(1),forced:ZO(),teardown:K().min(1)}),_M=Y([`host`]);Y([`host`]);var vM=Y([`delivered`,`no-turn`,`failed`,`not-asked`]),yM=Y([`graceful`,`killed`,`still-running`]),bM=Y([`pushed`,`already-on-origin`,`no-remote`,`refused`]),xM=Q({...hM,scope:_M,root:K(),grace_seconds:Z,forced:ZO(),complete:ZO(),runs:q(Q({run_id:K().min(1),owner:K().min(1),forced_over_owner:ZO(),dispatches:q(Q({node:K().min(1),pid:Z,interrupt:vM,detail:K(),ended:yM,waited_ms:Z})),teardown:K().min(1),branches:q(Q({identity:K(),branch:K(),result:bM,remote:K().nullable(),commit:K().nullable(),detail:K()}))})),not_pushed:q(Q({identity:K(),branch:K()})),not_pushed_unread:K().nullable(),rendered:K()}),SM=Q({...hM,session_key:K().min(1).optional(),reported:q(Q({run:K().min(1),standing:K().min(1),why_not_watched:K()})),unresolved:q(K())}),CM=Q({schema_version:X(1),host:K(),root:K(),root_error:K().nullable(),free_space:q(Q({roots:q(Q({role:K(),path:K().nullable(),measured_at:K().nullable()})),free_bytes:Z.nullable(),total_bytes:Z.nullable(),error:K().nullable()})),dispatches:q(Q({run:K(),node:K(),launcher:K(),age_ms:SA.nullable(),proof:Y([`held`,`unproven`]),unproven:K().nullable()})),gone:q(Q({run:K(),node:K(),reason:K()})),skipped:q(Q({path:K(),reason:K()}))}),wM=Q({...hM,reading:CM.optional(),rendered:K(),unreadable:q(ZA).optional()});Q({...hM,run_id:K().min(1),rendered:K()});var TM=Q({...hM,run_id:K().min(1),liveness:YA,unread_surfaces:Q({count:Z,oldest_seconds:SA.nullable()}),node_status:mk(K(),K().min(1)),summary:K(),rendered:K()});Q({...hM,run_id:K().min(1),node:K().min(1).nullable().optional(),rendered:K()}),Q({...hM,run_id:K().min(1),telemetry:Q({schema_version:Z})});var EM=Q({history_id:K().min(1),harness:K().min(1),variant:K().min(1).optional(),harness_id:K().min(1),started:CA}),DM=Q({history_session:K().min(1),name:K().min(1),history_dir:K().min(1),history_project:K().min(1),history_file:K().min(1),project:K().min(1),started:CA,labels:mk(K(),K()),runs:q(EM),run_id:K().min(1).optional()}),OM={...hM,sessions:q(DM),skipped:Z},kM=Q({...OM,run_id:K().min(1),node:K().min(1).optional()}),AM=Q({...OM,project:K().min(1)}),jM=K().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u),MM=K().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(0|[1-9][0-9]*)$/u),NM=ck([J({type:X(`sidebar`)}),J({type:X(`detail`),run_id:K().min(1),filter:K().min(1).optional()}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`run`),filter:K().min(1).optional()}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`node`),node:K().min(1),filter:K().min(1).optional()}),J({type:X(`human-items`),filter:bA.optional(),item:K().min(1).optional()})]),PM=J({id:K().min(1),name:K(),group:J({project:K(),name:K()}).nullable(),kind:K().nullable(),state:K().min(1),nodes:J({total:Z,done:Z,failed:Z,running:Z}),updated_at:CA,started_at:CA.optional()});Object.keys(PM.shape);var FM=ck([J({type:X(`sidebar`)}),J({type:X(`detail`),run_id:K().min(1),detail:Vj}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`run`),detail:Vj,timeline:iM}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`node`),node:K().min(1),detail:Vj,timeline:iM}),xA]),IM=J({id:MM,sidebar:q(PM).nullable(),visible:FM}),LM=q(ck([K(),Z])),RM=ck([J({p:LM,v:tk()}),J({p:LM,a:q(tk())}),J({p:LM,d:X(!0)})]),zM={id:MM,base:MM,subscription:jM},BM=Y([`unknown-cursor`,`stale-cursor`,`server-restarted`]),VM=J({...zM,type:X(`reset`),reason:BM,snapshot:IM}),HM=ck([VM,J({...zM,type:X(`sidebar.snapshot`),rows:q(PM)}),J({...zM,type:X(`run.changed`),row:PM}),J({...zM,type:X(`run.removed`),run_id:K().min(1)}),J({...zM,type:X(`detail.patch`),run_id:K().min(1),ops:q(RM)}),J({...zM,type:X(`timeline.patch`),run_id:K().min(1),scope:X(`run`),ops:q(RM)}),J({...zM,type:X(`timeline.patch`),run_id:K().min(1),scope:X(`node`),node:K().min(1),ops:q(RM)}),J({...zM,type:X(`human-items.patch`),ops:q(RM)})]),UM=[`reset`,`sidebar.snapshot`,`run.changed`,`run.removed`,`detail.patch`,`timeline.patch`,`human-items.patch`],WM=J({subscription:jM,view:NM,initial:ck([J({type:X(`snapshot`),snapshot:IM}),VM])}),GM=`api_version,telemetry_schema_version,observed_at,progress,run.run_id,run.state,run.phase,run.last_event,run.timing.wall_seconds,run.nodes.*.node,run.nodes.*.status,run.nodes.*.outcome,run.nodes.*.failure,run.turns,graph.last_seq,graph.run_id,graph.plan.goal,graph.plan.tasks.*.id,graph.plan.tasks.*.kind,graph.plan.tasks.*.name,graph.plan.tasks.*.deps,graph.plan.tasks.*.repo,graph.plan.tasks.*.steps,graph.node_status,graph.node_gated_by,graph.node_control,graph.result,graph.node_results.*.blocked_by,graph.node_results.*.awaiting,graph.node_results.*.outcome,graph.node_results.*.error,graph.node_results.*.detail,node_details`.split(`,`);function KM(e){let t=new Map;for(let n of e){let e=t;for(let t of n.split(`.`)){let n=e.get(t);n===void 0&&(n=new Map,e.set(t,n)),e=n}}return t}KM(GM),J({code:X(`subscription-unavailable`),reason:Y([`expired`,`server-restarted`,`unknown`])});var qM=class extends Error{constructor(e){super(e),this.name=`PatchError`}};function JM(e,t){let n=e;for(let e of t)n=YM(n,e);return n}function YM(e,t){let n=t.p;if(`a`in t)return ZM(e,n,e=>{if(!Array.isArray(e))throw new qM(`an append's path names an array`);return[...e,...t.a]});let r=n.at(-1);if(r===void 0)throw new qM(`the root is never replaced or deleted`);return ZM(e,n.slice(0,-1),e=>{if(`v`in t){if(Array.isArray(e)&&typeof r==`number`){if(r>=e.length)throw new qM(`a set replaces an existing element`);let n=[...e];return n[r]=t.v,n}if(XM(e)&&typeof r==`string`)return{...e,[r]:t.v};throw new qM(`a set's path does not match its parent`)}if(XM(e)&&typeof r==`string`){if(!Object.hasOwn(e,r))throw new qM(`a deletion names an existing member`);let t={...e};return delete t[r],t}throw new qM(`a deletion names an object member`)})}function XM(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ZM(e,t,n){let[r,...i]=t;if(r===void 0)return n(e);if(Array.isArray(e)&&typeof r==`number`){if(r>=e.length)throw new qM(`an index on the path does not exist`);let t=[...e];return t[r]=ZM(e[r],i,n),t}if(XM(e)&&typeof r==`string`){if(!Object.hasOwn(e,r))throw new qM(`a parent on the path does not exist`);return{...e,[r]:ZM(e[r],i,n)}}throw new qM(`a path step does not match its parent`)}var QM=1e3;function $M(e){let t=e.lastIndexOf(`:`);return{epoch:e.slice(0,t),seq:BigInt(e.slice(t+1))}}var eN=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||uN(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?.(fN(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: ${dN(e)}`));return}this.#_(t)}#_(e){let t=lN(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(TA.events);e.searchParams.set(EA.subscription,this.#r),e.searchParams.set(EA.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 i(`Opening the live stream`))},S),t.onopen=()=>{this.#b(),n&&this.#t.onConnected?.(),n=!0};for(let e of UM)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})},QM)))}}#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=HM.parse(JSON.parse(e))}catch(e){this.#w(Error(`A frame failed contract validation: ${dN(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=$M(r.applied),o=$M(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=cN(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={...tN(r,i,this.#n),applied:i.id}}catch(e){this.#w(Error(`A patch could not be applied: ${dN(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 tN(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:rN(e.visible,t,n)}}}function nN(e,t,n,r){let i=e.safeParse(JM(t,n));if(!i.success)throw Error(`the patched ${r} failed contract validation`);return i.data}function rN(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=nN(xA,e,t.ops,`human items`);if(sN(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=nN(Vj,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(nN(iM,e.timeline,t.ops,`timeline`))}}}function iN(e){return[e.type,e.run_id,e.scope,e.node].join(`\0`)}function aN(e){return Array.isArray(e)?e.map(aN):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,aN(t)])):e}function oN(e){if(e!==void 0){if(typeof e!=`string`)return JSON.stringify(aN(e));if(!e.startsWith(`{`))return e;try{return JSON.stringify(aN(JSON.parse(e)))}catch{return e}}}function sN(e,t){return t.detail===null?!1:!(`item`in e)||t.detail.item.id!==e.item}function cN(e,t){let n=t.visible;if(iN(n)!==iN(e))return`the state of another view`;if(n.type===`human-items`)return sN(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].every(e=>e===n.run_id)?void 0:`a payload of another run`}function lN(e,t){if(iN(t.view)!==iN(e))return`another view`;let n=e=>`filter`in e?e.filter:void 0;if(oN(n(t.view))!==oN(n(e)))return`another filter`;let r=e=>`item`in e?e.item:void 0;return r(t.view)===r(e)?cN(e,t.initial.snapshot):`another item`}function uN(e,t){return JSON.stringify(e)===JSON.stringify(t)}function dN(e){return e instanceof Error?e.message:String(e)}function fN(e){return e instanceof Error?e:Error(String(e))}var pN=class extends Error{status;code;constructor(e,t,n,r){super(e,r),this.status=t,this.code=n,this.name=`TelemetryClientError`}},mN=50,hN=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=mN){let r=this.#r(TA.runs);return r.searchParams.set(EA.includeSettled,String(e)),r.searchParams.set(EA.limit,String(n)),t!==void 0&&r.searchParams.set(EA.cursor,t),this.#a(r,QA.parse)}async selectRuns(e){if(e.length===0)throw new pN(`Invalid selection`);for(let t of e)if(vN(t,`run ID`),t.includes(`,`))throw new pN(`Invalid run ID`);let t=this.#r(TA.runs);return t.searchParams.set(EA.select,e.join(`,`)),this.#a(t,QA.parse)}async getRun(e,t={}){vN(e,`run ID`);let n=this.#r(TA.run(e));return t.includeConversations!==void 0&&n.searchParams.set(EA.includeConversations,String(t.includeConversations)),t.filter!==void 0&&n.searchParams.set(EA.filter,t.filter),this.#a(n,Pj.parse)}async getTimeline(e,t,n){vN(e,`run ID`);let r=this.#r(TA.timeline(e));return n!==void 0&&r.searchParams.set(EA.filter,n),t===void 0?r.searchParams.set(EA.scope,DA.run):(r.searchParams.set(EA.scope,DA.node),r.searchParams.set(EA.node,t)),this.#a(r,iM.parse)}async getConversation(e,t){return vN(e,`run ID`),vN(t,`conversation ID`),this.#a(this.#r(TA.conversation(e,t)),Dj.parse)}async getArtifact(e,t){return vN(e,`run ID`),vN(t,`artifact ID`),this.#a(this.#r(TA.artifact(e,t)),rM.parse)}async getTimelineEvents(e,t){vN(e,`run ID`),t.node!==void 0&&vN(t.node,`node ID`);let n=this.#r(TA.timelineEvents(e));n.searchParams.set(EA.scope,t.scope===`node`&&t.node!==void 0?DA.node:DA.run);for(let[e,r]of[[EA.node,t.node],[EA.span,t.span],[EA.cursor,t.cursor],[EA.from,t.from],[EA.to,t.to],[EA.filter,t.filter],[EA.limit,t.limit===void 0?void 0:String(t.limit)]])r!==void 0&&n.searchParams.set(e,r);return this.#a(n,oM.parse,void 0,`This page of the run's history`)}subscribe(e){e.runId!==void 0&&vN(e.runId,`run ID`),e.after!==void 0&&vN(e.after,`cursor`);let t=this.#r(TA.events);e.runId!==void 0&&t.searchParams.set(EA.runId,e.runId),e.after!==void 0&&t.searchParams.set(EA.after,e.after),e.filter!==void 0&&t.searchParams.set(EA.filter,e.filter);let n=this.#i(t);for(let t of lM.options)n.addEventListener(t,n=>{try{let r=n,i=JSON.parse(r.data),a=t===`snapshot`?QA.parse(i):uM.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 eN({subscribe:e=>this.createSubscription(e),retire:(e,t)=>this.retireSubscription(e,t),open:e=>this.#i(e),url:e=>this.#r(e),parseSubscribed:e=>WM.parse(e)},e)}async*streamNodeTimeline(e,t,n){vN(e,`run ID`),vN(t,`node ID`);let r=this.#r(TA.timelineNodeStream(e));r.searchParams.set(EA.scope,DA.node),r.searchParams.set(EA.node,t);let i;try{i=await this.#t(r,n===void 0?{}:{signal:n})}catch(e){throw new pN(`Telemetry request failed`,void 0,void 0,{cause:e})}if(!i.ok||i.body===null){let e=await i.json().catch(()=>void 0),t=cM.safeParse(e);throw new pN(t.success?t.data.error.message:`Telemetry request failed with status ${i.status}`,i.status,t.success?t.data.error.code:void 0)}let a=i.body.pipeThrough(new TextDecoderStream).getReader(),o=e=>{try{return sM.parse(JSON.parse(e))}catch(e){throw new pN(`Telemetry response failed contract validation`,i.status,void 0,{cause:e})}},s=``;try{for(;;){let e;try{e=await a.read()}catch(e){throw new pN(`The node's timeline was cut off`,i.status,void 0,{cause:e})}if(e.done)break;s+=e.value;for(let e=s.indexOf(`
81
81
  `);e>=0;e=s.indexOf(`
82
- `)){let t=s.slice(0,e);if(s=s.slice(e+1),t===``)continue;let n=o(t);if(n.kind===`end`)return;if(n.kind===`error`)throw new cN(n.message,i.status,`node_stream_failed`);yield n}}}finally{await a.cancel().catch(()=>void 0)}throw new cN(`The node's timeline ended before its last line`,i.status,`node_stream_cut_off`)}async createSubscription(e){return this.#a(this.#r(bA.subscriptions),zM.parse,fN(`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){pN(e,`subscription ID`);let n;try{n=await this.#t(this.#r(bA.subscription(e)),{method:`DELETE`,...t?{keepalive:t}:{}})}catch(e){throw new cN(`Telemetry request failed`,void 0,void 0,{cause:e})}if(!n.ok&&n.status!==204)throw new cN(`Retiring a subscription failed with status ${n.status}`,n.status)}async listProjects(){return this.#a(this.#r(bA.projects),cM.parse)}async getProject(e){return pN(e,`project ID`),this.#a(this.#r(bA.project(e)),lM.parse)}async stop(e,t=!1){return pN(e,`run ID`),this.#a(this.#r(bA.stop(e)),dM.parse,fN(`POST`,{force:t}))}async listHumanItems(e={}){let t=this.#r(zk.list);for(let[n,r]of Object.entries(e))r!=null&&t.searchParams.set(n,String(r));return this.#a(t,mA.parse)}async getHumanItem(e){return pN(e,`human-item ID`),this.#a(this.#r(zk.item(e)),uA.parse)}async answerHumanItem(e,t){return pN(e,`human-item ID`),this.#a(this.#r(zk.answer(e)),dA.parse,fN(`POST`,typeof t==`string`?{text:t}:t))}async answerHumanItems(e){return this.#a(this.#r(zk.answers),pA.parse,fN(`POST`,{answers:e}))}async completeHumanItem(e){return pN(e,`human-item ID`),this.#a(this.#r(zk.complete(e)),dA.parse,fN(`POST`,{}))}async dismissHumanItem(e,t){return pN(e,`human-item ID`),this.#a(this.#r(zk.dismiss(e)),dA.parse,fN(`POST`,t?.trim()?{reason:t}:{}))}async reopenHumanItem(e){return pN(e,`human-item ID`),this.#a(this.#r(zk.reopen(e)),dA.parse,fN(`POST`,{}))}async noteHumanItem(e,t){return pN(e,`human-item ID`),this.#a(this.#r(zk.note(e)),dA.parse,fN(`POST`,{text:t}))}async shutdown(e,t={}){return this.#a(this.#r(bA.shutdown),gM.parse,fN(`POST`,{scope:e,...dN(t)}))}async unwatched(){return this.#a(this.#r(bA.unwatched),_M.parse)}async host(){return this.#a(this.#r(bA.host),yM.parse)}async getStatus(e){return pN(e,`run ID`),this.#a(this.#r(bA.status(e)),bM.parse)}async getAgents(e){return pN(e,`run ID`),this.#a(this.#r(bA.agents(e)),wM.parse)}async getNodeAgents(e,t){return pN(e,`run ID`),pN(t,`node ID`),this.#a(this.#r(bA.nodeAgents(e,t)),wM.parse)}async getProjectAgents(e){return pN(e,`project ID`),this.#a(this.#r(bA.projectAgents(e)),TM.parse)}#r(e){return new URL(e,this.#e)}#i(e){return(this.#n??(e=>{if(typeof EventSource>`u`)throw new cN(`EventSource is unavailable; provide an eventSource factory`);return new EventSource(e)}))(e.toString())}async#a(e,t,n,r){let a=r===void 0?void 0:new AbortController,o=a===void 0?void 0:setTimeout(()=>a.abort(),S);try{return await this.#o(e,t,{...n,...a===void 0?{}:{signal:a.signal}})}catch(e){throw a?.signal.aborted===!0&&r!==void 0?new cN(new i(r).message,void 0,`deadline`,{cause:e}):e}finally{o!==void 0&&clearTimeout(o)}}async#o(e,t,n){let r;try{r=await this.#t(e,n)}catch(e){throw new cN(`Telemetry request failed`,void 0,void 0,{cause:e})}let i=await r.json().catch(e=>{throw r.ok?new cN(`Telemetry server returned invalid JSON`,r.status,void 0,{cause:e}):new cN(`Telemetry request failed with status ${r.status}`,r.status,void 0,{cause:e})});if(!r.ok){let e=rM.safeParse(i);throw new cN(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 cN(`Telemetry response failed contract validation`,r.status,void 0,{cause:e})}}};function dN(e){let{grace:t,force:n=!1}=e;if(t===void 0)return{force:n};if(!Number.isSafeInteger(t)||t<0)throw new cN(`Invalid grace: whole seconds, 0 or more`);return{grace:t,force:n}}function fN(e,t){return{method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}}function pN(e,t){let n=[...e].some(e=>e.charCodeAt(0)<32);if(e.length===0||n||/[/?#]/u.test(e))throw new cN(`Invalid ${t}`)}function mN({outcome:t,label:n}){if(t===void 0)return null;if(t.kind===`refused`){let r=t.error,i=r instanceof cN?r.code:void 0,a=r instanceof cN?r.status:void 0;return(0,B.jsxs)(gi,{"aria-label":`${n} refused`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsxs)(_i,{children:[t.title,a!==void 0&&` · ${a}`,i!==void 0&&` ${i}`]}),(0,B.jsx)(vi,{children:(0,B.jsx)(`pre`,{className:`verb-text`,children:r.message})})]})}return(0,B.jsxs)(gi,{"aria-label":`${n} receipt`,children:[(0,B.jsx)(qe,{}),(0,B.jsx)(_i,{children:t.title}),(0,B.jsx)(vi,{children:(0,B.jsx)(`pre`,{className:`verb-text`,children:JSON.stringify(t.payload,null,2)})})]})}async function hN(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 gN={Complete:qe,Failed:et,Stopped:ft,Unfinished:$e,"Waiting on you":it,"Driver dead":wt,Idle:Ze,Running:st},_N=e=>e.toLowerCase().replaceAll(/[^a-z]+/gu,`-`);function vN({state:e,large:t=!1}){let n=e.known?gN[e.word]:Je,r=t?16:13;return(0,B.jsxs)(`span`,{className:`run-state-group`,"data-large":t,children:[(0,B.jsxs)(`span`,{"aria-label":`Run state`,className:`run-state`,"data-run-state":e.known?_N(e.word):`unknown`,role:`group`,title:e.word,children:[(0,B.jsx)(n,{"aria-label":e.word,role:`img`,size:r}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:e.word})]}),e.failed>0&&(0,B.jsxs)(`span`,{className:`run-failures`,title:`${e.failed} failed nodes`,children:[(0,B.jsx)(et,{"aria-hidden":`true`,size:r}),e.failed,` failed`]})]})}function yN(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)();return{run:(0,z.useCallback)(async(...r)=>{i(!0);let a=await hN(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 bN(e){return/\[[^\]]+\]/.exec(e)?.[0]}function xN({runId:e,control:t,ended:n,state:r}){let{stop:i,stopOpen:a,setStopOpen:o,forceOpen:s,setForceOpen:c,refusal:l}=SN(t),u=l===void 0?void 0:bN(l.message),d=i.outcome,f=i.pending;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`run-actions`,children:[r!==void 0&&(0,B.jsx)(`span`,{className:`run-actions-badge`,children:(0,B.jsx)(vN,{state:r})}),!n&&(0,B.jsxs)(Vi,{"aria-label":`Stop`,disabled:f,onClick:()=>o(!0),size:`sm`,title:`Stop`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(mt,{size:14}),(0,B.jsx)(`span`,{className:`run-action-label`,children:`Stop`})]})]}),(0,B.jsx)(Cs,{onOpenChange:o,open:a,children:(0,B.jsxs)(Ds,{children:[(0,B.jsxs)(Os,{children:[(0,B.jsxs)(As,{children:[`Stop `,e,`?`]}),(0,B.jsx)(js,{children:`The run is stopped as the acting session. A run another session owns is refused, naming its owner.`})]}),(0,B.jsxs)(ks,{children:[(0,B.jsx)(Ts,{asChild:!0,children:(0,B.jsx)(Vi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(Vi,{disabled:f,onClick:()=>void i.run(!1),type:`button`,variant:`destructive`,children:`Stop run`})]})]})}),(0,B.jsx)(Cs,{onOpenChange:c,open:s,children:(0,B.jsxs)(Ds,{children:[(0,B.jsxs)(Os,{children:[(0,B.jsxs)(As,{children:[`Force-stop `,e,u!==void 0&&`, overriding ${u}`,`?`]}),(0,B.jsxs)(js,{children:[l?.message,` — `,`a forced stop is journalled forced with the owner it overrode.`]})]}),(0,B.jsxs)(ks,{children:[(0,B.jsx)(Ts,{asChild:!0,children:(0,B.jsx)(Vi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsxs)(Vi,{disabled:f,onClick:()=>void i.run(!0),type:`button`,variant:`destructive`,children:[`Force stop`,u!==void 0&&`, overriding ${u}`]})]})]})}),d!==void 0&&(0,B.jsxs)(`div`,{className:`run-outcomes`,children:[(0,B.jsx)(mN,{label:`Stop`,outcome:d}),l!==void 0&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(Vi,{onClick:()=>c(!0),size:`sm`,type:`button`,variant:`destructive`,children:`Force stop…`})})]})]})}function SN(e){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=yN(e=>e?`Forced stop`:`Stop`,(0,z.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 cN&&a.outcome.error.code===`not_owner`?a.outcome.error:void 0}}function CN(e,t,n){let[r,i]=(0,z.useState)({}),a=(0,z.useRef)({key:e});(0,z.useEffect)(()=>{a.current.key=e},[e]),(0,z.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:wN(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 wN(e){return e instanceof Error?e:Error(String(e))}function TN(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useCallback)(()=>r(e=>e+1),[]);return{status:CN(t,()=>e.getStatus(t??``),n),stop:(0,z.useCallback)(async n=>{try{return await e.stop(t??``,n)}finally{i()}},[e,t,i]),reread:i}}function EN(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=EN(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var DN={value:()=>{}};function ON(){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 kN(n)}function kN(e){this._=e}function AN(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}})}kN.prototype=ON.prototype={constructor:kN,on:function(e,t){var n=this._,r=AN(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=jN(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]=MN(n[i],e.name,t);else if(t==null)for(i in n)n[i]=MN(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 kN(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 jN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function MN(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=DN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var NN={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 PN(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),NN.hasOwnProperty(t)?{space:NN[t],local:e}:e}function FN(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 IN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function LN(e){var t=PN(e);return(t.local?IN:FN)(t)}function RN(){}function zN(e){return e==null?RN:function(){return this.querySelector(e)}}function BN(e){typeof e!=`function`&&(e=zN(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 OF(r,this._parents)}function VN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function HN(){return[]}function UN(e){return e==null?HN:function(){return this.querySelectorAll(e)}}function WN(e){return function(){return VN(e.apply(this,arguments))}}function GN(e){e=typeof e==`function`?WN(e):UN(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 OF(r,i)}function KN(e){return function(){return this.matches(e)}}function qN(e){return function(t){return t.matches(e)}}var JN=Array.prototype.find;function YN(e){return function(){return JN.call(this.children,e)}}function XN(){return this.firstElementChild}function ZN(e){return this.select(e==null?XN:YN(typeof e==`function`?e:qN(e)))}var QN=Array.prototype.filter;function $N(){return Array.from(this.children)}function eP(e){return function(){return QN.call(this.children,e)}}function tP(e){return this.selectAll(e==null?$N:eP(typeof e==`function`?e:qN(e)))}function nP(e){typeof e!=`function`&&(e=KN(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 OF(r,this._parents)}function rP(e){return Array(e.length)}function iP(){return new OF(this._enter||this._groups.map(rP),this._parents)}function aP(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}aP.prototype={constructor:aP,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 oP(e){return function(){return e}}function sP(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 aP(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function cP(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 aP(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function lP(e){return e.__data__}function uP(e,t){if(!arguments.length)return Array.from(this,lP);var n=t?cP:sP,r=this._parents,i=this._groups;typeof e!=`function`&&(e=oP(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=dP(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 OF(o,r),o._enter=s,o._exit=c,o}function dP(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function fP(){return new OF(this._exit||this._groups.map(rP),this._parents)}function pP(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 mP(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 OF(s,this._parents)}function hP(){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 gP(e){e||=_P;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 OF(i,this._parents).order()}function _P(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function vP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yP(){return Array.from(this)}function bP(){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 xP(){let e=0;for(let t of this)++e;return e}function SP(){return!this.node()}function CP(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 wP(e){return function(){this.removeAttribute(e)}}function TP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function EP(e,t){return function(){this.setAttribute(e,t)}}function DP(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function OP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kP(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 AP(e,t){var n=PN(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?TP:wP:typeof t==`function`?n.local?kP:OP:n.local?DP:EP)(n,t))}function jP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function MP(e){return function(){this.style.removeProperty(e)}}function NP(e,t,n){return function(){this.style.setProperty(e,t,n)}}function PP(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function FP(e,t,n){return arguments.length>1?this.each((t==null?MP:typeof t==`function`?PP:NP)(e,t,n??``)):IP(this.node(),e)}function IP(e,t){return e.style.getPropertyValue(t)||jP(e).getComputedStyle(e,null).getPropertyValue(t)}function LP(e){return function(){delete this[e]}}function RP(e,t){return function(){this[e]=t}}function zP(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function BP(e,t){return arguments.length>1?this.each((t==null?LP:typeof t==`function`?zP:RP)(e,t)):this.node()[e]}function VP(e){return e.trim().split(/^|\s+/)}function HP(e){return e.classList||new UP(e)}function UP(e){this._node=e,this._names=VP(e.getAttribute(`class`)||``)}UP.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 WP(e,t){for(var n=HP(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function GP(e,t){for(var n=HP(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function KP(e){return function(){WP(this,e)}}function qP(e){return function(){GP(this,e)}}function JP(e,t){return function(){(t.apply(this,arguments)?WP:GP)(this,e)}}function YP(e,t){var n=VP(e+``);if(arguments.length<2){for(var r=HP(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?JP:t?KP:qP)(n,t))}function XP(){this.textContent=``}function ZP(e){return function(){this.textContent=e}}function QP(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function $P(e){return arguments.length?this.each(e==null?XP:(typeof e==`function`?QP:ZP)(e)):this.node().textContent}function eF(){this.innerHTML=``}function tF(e){return function(){this.innerHTML=e}}function nF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function rF(e){return arguments.length?this.each(e==null?eF:(typeof e==`function`?nF:tF)(e)):this.node().innerHTML}function iF(){this.nextSibling&&this.parentNode.appendChild(this)}function aF(){return this.each(iF)}function oF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function sF(){return this.each(oF)}function cF(e){var t=typeof e==`function`?e:LN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function lF(){return null}function uF(e,t){var n=typeof e==`function`?e:LN(e),r=t==null?lF:typeof t==`function`?t:zN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function dF(){var e=this.parentNode;e&&e.removeChild(this)}function fF(){return this.each(dF)}function pF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hF(e){return this.select(e?mF:pF)}function gF(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function _F(e){return function(t){e.call(this,t,this.__data__)}}function vF(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 yF(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 bF(e,t,n){return function(){var r=this.__on,i,a=_F(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 xF(e,t,n){var r=vF(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?bF:yF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function SF(e,t,n){var r=jP(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 CF(e,t){return function(){return SF(this,e,t)}}function wF(e,t){return function(){return SF(this,e,t.apply(this,arguments))}}function TF(e,t){return this.each((typeof t==`function`?wF:CF)(e,t))}function*EF(){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 DF=[null];function OF(e,t){this._groups=e,this._parents=t}function kF(){return new OF([[document.documentElement]],DF)}function AF(){return this}OF.prototype=kF.prototype={constructor:OF,select:BN,selectAll:GN,selectChild:ZN,selectChildren:tP,filter:nP,data:uP,enter:iP,exit:fP,join:pP,merge:mP,selection:AF,order:hP,sort:gP,call:vP,nodes:yP,node:bP,size:xP,empty:SP,each:CP,attr:AP,style:FP,property:BP,classed:YP,text:$P,html:rF,raise:aF,lower:sF,append:cF,insert:uF,remove:fF,clone:hF,datum:gF,on:xF,dispatch:TF,[Symbol.iterator]:EF};function jF(e){return typeof e==`string`?new OF([[document.querySelector(e)]],[document.documentElement]):new OF([[e]],DF)}function MF(e){let t;for(;t=e.sourceEvent;)e=t;return e}function NF(e,t){if(e=MF(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 PF={passive:!1},FF={capture:!0,passive:!1};function IF(e){e.stopImmediatePropagation()}function LF(e){e.preventDefault(),e.stopImmediatePropagation()}function RF(e){var t=e.document.documentElement,n=jF(e).on(`dragstart.drag`,LF,FF);`onselectstart`in t?n.on(`selectstart.drag`,LF,FF):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function zF(e,t){var n=e.document.documentElement,r=jF(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,LF,FF),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 BF=e=>()=>e;function VF(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}})}VF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function HF(e){return!e.ctrlKey&&!e.button}function UF(){return this.parentNode}function WF(e,t){return t??{x:e.x,y:e.y}}function GF(){return navigator.maxTouchPoints||`ontouchstart`in this}function KF(){var e=HF,t=UF,n=WF,r=GF,i={},a=ON(`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`,_,PF).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&&(jF(n.view).on(`mousemove.drag`,m,FF).on(`mouseup.drag`,h,FF),RF(n.view),IF(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(LF(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){jF(e.view).on(`mousemove.drag mouseup.drag`,null),zF(e.view,l),LF(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]))&&(IF(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])&&(LF(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])&&(IF(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=NF(l||r,t),p,m,h;if((h=n.call(e,new VF(`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=NF(l||a,t),_=o;break}u.call(r,e,new VF(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:BF(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:BF(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:BF(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:BF(!!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 qF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function JF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function YF(){}var XF=.7,ZF=1/XF,QF=`\\s*([+-]?\\d+)\\s*`,$F=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,eI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,tI=/^#([0-9a-f]{3,8})$/,nI=RegExp(`^rgb\\(${QF},${QF},${QF}\\)$`),rI=RegExp(`^rgb\\(${eI},${eI},${eI}\\)$`),iI=RegExp(`^rgba\\(${QF},${QF},${QF},${$F}\\)$`),aI=RegExp(`^rgba\\(${eI},${eI},${eI},${$F}\\)$`),oI=RegExp(`^hsl\\(${$F},${eI},${eI}\\)$`),sI=RegExp(`^hsla\\(${$F},${eI},${eI},${$F}\\)$`),cI={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};qF(YF,pI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lI,formatHex:lI,formatHex8:uI,formatHsl:dI,formatRgb:fI,toString:fI});function lI(){return this.rgb().formatHex()}function uI(){return this.rgb().formatHex8()}function dI(){return EI(this).formatHsl()}function fI(){return this.rgb().formatRgb()}function pI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=tI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mI(t):n===3?new vI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?hI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?hI(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=nI.exec(e))?new vI(t[1],t[2],t[3],1):(t=rI.exec(e))?new vI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=iI.exec(e))?hI(t[1],t[2],t[3],t[4]):(t=aI.exec(e))?hI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oI.exec(e))?TI(t[1],t[2]/100,t[3]/100,1):(t=sI.exec(e))?TI(t[1],t[2]/100,t[3]/100,t[4]):cI.hasOwnProperty(e)?mI(cI[e]):e===`transparent`?new vI(NaN,NaN,NaN,0):null}function mI(e){return new vI(e>>16&255,e>>8&255,e&255,1)}function hI(e,t,n,r){return r<=0&&(e=t=n=NaN),new vI(e,t,n,r)}function gI(e){return e instanceof YF||(e=pI(e)),e?(e=e.rgb(),new vI(e.r,e.g,e.b,e.opacity)):new vI}function _I(e,t,n,r){return arguments.length===1?gI(e):new vI(e,t,n,r??1)}function vI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qF(vI,_I,JF(YF,{brighter(e){return e=e==null?ZF:ZF**+e,new vI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?XF:XF**+e,new vI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vI(CI(this.r),CI(this.g),CI(this.b),SI(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:yI,formatHex:yI,formatHex8:bI,formatRgb:xI,toString:xI}));function yI(){return`#${wI(this.r)}${wI(this.g)}${wI(this.b)}`}function bI(){return`#${wI(this.r)}${wI(this.g)}${wI(this.b)}${wI((isNaN(this.opacity)?1:this.opacity)*255)}`}function xI(){let e=SI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${CI(this.r)}, ${CI(this.g)}, ${CI(this.b)}${e===1?`)`:`, ${e})`}`}function SI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function CI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wI(e){return e=CI(e),(e<16?`0`:``)+e.toString(16)}function TI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new OI(e,t,n,r)}function EI(e){if(e instanceof OI)return new OI(e.h,e.s,e.l,e.opacity);if(e instanceof YF||(e=pI(e)),!e)return new OI;if(e instanceof OI)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 OI(o,s,c,e.opacity)}function DI(e,t,n,r){return arguments.length===1?EI(e):new OI(e,t,n,r??1)}function OI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qF(OI,DI,JF(YF,{brighter(e){return e=e==null?ZF:ZF**+e,new OI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?XF:XF**+e,new OI(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 vI(jI(e>=240?e-240:e+120,i,r),jI(e,i,r),jI(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new OI(kI(this.h),AI(this.s),AI(this.l),SI(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=SI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${kI(this.h)}, ${AI(this.s)*100}%, ${AI(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function kI(e){return e=(e||0)%360,e<0?e+360:e}function AI(e){return Math.max(0,Math.min(1,e||0))}function jI(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 MI=e=>()=>e;function NI(e,t){return function(n){return e+n*t}}function PI(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function FI(e){return(e=+e)==1?II:function(t,n){return n-t?PI(t,n,e):MI(isNaN(t)?n:t)}}function II(e,t){var n=t-e;return n?NI(e,n):MI(isNaN(e)?t:e)}var LI=(function e(t){var n=FI(t);function r(e,t){var r=n((e=_I(e)).r,(t=_I(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=II(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 RI(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 zI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function BI(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]=YI(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 VI(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function HI(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function UI(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]=YI(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var WI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,GI=new RegExp(WI.source,`g`);function KI(e){return function(){return e}}function qI(e){return function(t){return e(t)+``}}function JI(e,t){var n=WI.lastIndex=GI.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=WI.exec(e))&&(i=GI.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:HI(r,i)})),n=GI.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?qI(c[0].x):KI(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 YI(e,t){var n=typeof t,r;return t==null||n===`boolean`?MI(t):(n===`number`?HI:n===`string`?(r=pI(t))?(t=r,LI):JI:t instanceof pI?LI:t instanceof Date?VI:zI(t)?RI:Array.isArray(t)?BI:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?UI:HI)(e,t)}var XI=180/Math.PI,ZI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function QI(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)*XI,skewX:Math.atan(c)*XI,scaleX:o,scaleY:s}}var $I;function eL(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?ZI:QI(t.a,t.b,t.c,t.d,t.e,t.f)}function tL(e){return e==null||($I||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),$I.setAttribute(`transform`,e),!(e=$I.transform.baseVal.consolidate()))?ZI:(e=e.matrix,QI(e.a,e.b,e.c,e.d,e.e,e.f))}function nL(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:HI(e,i)},{i:c-2,x:HI(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:HI(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:HI(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:HI(e,n)},{i:s-2,x:HI(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 rL=nL(eL,`px, `,`px)`,`deg)`),iL=nL(tL,`, `,`)`,`)`),aL=1e-12;function oL(e){return((e=Math.exp(e))+1/e)/2}function sL(e){return((e=Math.exp(e))-1/e)/2}function cL(e){return((e=Math.exp(2*e))-1)/(e+1)}var lL=(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<aL)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=oL(y),c=s/(n*g)*(i*cL(t*r+y)-sL(y));return[a+c*d,o+c*f,s*i/oL(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),uL=0,dL=0,fL=0,pL=1e3,mL,hL,gL=0,_L=0,vL=0,yL=typeof performance==`object`&&performance.now?performance:Date,bL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xL(){return _L||=(bL(SL),yL.now()+vL)}function SL(){_L=0}function CL(){this._call=this._time=this._next=null}CL.prototype=wL.prototype={constructor:CL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?xL():+n)+(t==null?0:+t),!this._next&&hL!==this&&(hL?hL._next=this:mL=this,hL=this),this._call=e,this._time=n,kL()},stop:function(){this._call&&(this._call=null,this._time=1/0,kL())}};function wL(e,t,n){var r=new CL;return r.restart(e,t,n),r}function TL(){xL(),++uL;for(var e=mL,t;e;)(t=_L-e._time)>=0&&e._call.call(void 0,t),e=e._next;--uL}function EL(){_L=(gL=yL.now())+vL,uL=dL=0;try{TL()}finally{uL=0,OL(),_L=0}}function DL(){var e=yL.now(),t=e-gL;t>pL&&(vL-=t,gL=e)}function OL(){for(var e,t=mL,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:mL=n);hL=e,kL(r)}function kL(e){uL||(dL&&=clearTimeout(dL),e-_L>24?(e<1/0&&(dL=setTimeout(EL,e-yL.now()-vL)),fL&&=clearInterval(fL)):(fL||=(gL=yL.now(),setInterval(DL,pL)),uL=1,bL(EL)))}function AL(e,t,n){var r=new CL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var jL=ON(`start`,`end`,`cancel`,`interrupt`),ML=[];function NL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;LL(e,n,{name:t,index:r,group:i,on:jL,tween:ML,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function PL(e,t){var n=IL(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function FL(e,t){var n=IL(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function IL(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function LL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=wL(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 AL(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(AL(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 RL(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 zL(e){return this.each(function(){RL(this,e)})}function BL(e,t){var n,r;return function(){var i=FL(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 VL(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=FL(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 HL(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=IL(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?BL:VL)(n,e,t))}function UL(e,t,n){var r=e._id;return e.each(function(){var e=FL(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return IL(e,r).value[t]}}function WL(e,t){var n;return(typeof t==`number`?HI:t instanceof pI?LI:(n=pI(t))?(t=n,LI):JI)(e,t)}function GL(e){return function(){this.removeAttribute(e)}}function KL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qL(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 JL(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 YL(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 XL(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 ZL(e,t){var n=PN(e),r=n===`transform`?iL:WL;return this.attrTween(e,typeof t==`function`?(n.local?XL:YL)(n,r,UL(this,`attr.`+e,t)):t==null?(n.local?KL:GL)(n):(n.local?JL:qL)(n,r,t))}function QL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function $L(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function eR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&$L(e,i)),n}return i._value=t,i}function tR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&QL(e,i)),n}return i._value=t,i}function nR(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=PN(e);return this.tween(n,(r.local?eR:tR)(r,t))}function rR(e,t){return function(){PL(this,e).delay=+t.apply(this,arguments)}}function iR(e,t){return t=+t,function(){PL(this,e).delay=t}}function aR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?rR:iR)(t,e)):IL(this.node(),t).delay}function oR(e,t){return function(){FL(this,e).duration=+t.apply(this,arguments)}}function sR(e,t){return t=+t,function(){FL(this,e).duration=t}}function cR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?oR:sR)(t,e)):IL(this.node(),t).duration}function lR(e,t){if(typeof t!=`function`)throw Error();return function(){FL(this,e).ease=t}}function uR(e){var t=this._id;return arguments.length?this.each(lR(t,e)):IL(this.node(),t).ease}function dR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();FL(this,e).ease=n}}function fR(e){if(typeof e!=`function`)throw Error();return this.each(dR(this._id,e))}function pR(e){typeof e!=`function`&&(e=KN(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 HR(r,this._parents,this._name,this._id)}function mR(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 HR(o,this._parents,this._name,this._id)}function hR(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 gR(e,t,n){var r,i,a=hR(t)?PL:FL;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function _R(e,t){var n=this._id;return arguments.length<2?IL(this.node(),n).on.on(e):this.each(gR(n,e,t))}function vR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function yR(){return this.on(`end.remove`,vR(this._id))}function bR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=zN(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,NL(l[f],t,n,f,l,IL(u,n)));return new HR(a,this._parents,t,n)}function xR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=UN(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=IL(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&NL(p,t,n,h,f,m);a.push(f),o.push(u)}return new HR(a,o,t,n)}var SR=kF.prototype.constructor;function CR(){return new SR(this._groups,this._parents)}function wR(e,t){var n,r,i;return function(){var a=IP(this,e),o=(this.style.removeProperty(e),IP(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function TR(e){return function(){this.style.removeProperty(e)}}function ER(e,t,n){var r,i=n+``,a;return function(){var o=IP(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function DR(e,t,n){var r,i,a;return function(){var o=IP(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),IP(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function OR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=FL(this,e),l=c.on,u=c.value[a]==null?s||=TR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function kR(e,t,n){var r=(e+=``)==`transform`?rL:WL;return t==null?this.styleTween(e,wR(e,r)).on(`end.style.`+e,TR(e)):typeof t==`function`?this.styleTween(e,DR(e,r,UL(this,`style.`+e,t))).each(OR(this._id,e)):this.styleTween(e,ER(e,r,t),n).on(`end.style.`+e,null)}function AR(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function jR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&AR(e,a,n)),r}return a._value=t,a}function MR(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,jR(e,t,n??``))}function NR(e){return function(){this.textContent=e}}function PR(e){return function(){var t=e(this);this.textContent=t??``}}function FR(e){return this.tween(`text`,typeof e==`function`?PR(UL(this,`text`,e)):NR(e==null?``:e+``))}function IR(e){return function(t){this.textContent=e.call(this,t)}}function LR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&IR(r)),t}return r._value=e,r}function RR(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,LR(e))}function zR(){for(var e=this._name,t=this._id,n=WR(),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=IL(c,t);NL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new HR(r,this._parents,e,n)}function BR(){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=FL(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 VR=0;function HR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function UR(e){return kF().transition(e)}function WR(){return++VR}var GR=kF.prototype;HR.prototype=UR.prototype={constructor:HR,select:bR,selectAll:xR,selectChild:GR.selectChild,selectChildren:GR.selectChildren,filter:pR,merge:mR,selection:CR,transition:zR,call:GR.call,nodes:GR.nodes,node:GR.node,size:GR.size,empty:GR.empty,each:GR.each,on:_R,attr:ZL,attrTween:nR,style:kR,styleTween:MR,text:FR,textTween:RR,remove:yR,tween:HL,delay:aR,duration:cR,ease:uR,easeVarying:fR,end:BR,[Symbol.iterator]:GR[Symbol.iterator]};function KR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qR={time:null,delay:0,duration:250,ease:KR};function JR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function YR(e){var t,n;e instanceof HR?(t=e._id,e=e._name):(t=WR(),(n=qR).time=xL(),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])&&NL(c,e,t,l,o,n||JR(c,t));return new HR(r,this._parents,e,t)}kF.prototype.interrupt=zL,kF.prototype.transition=YR;var XR=e=>()=>e;function ZR(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 QR(e,t,n){this.k=e,this.x=t,this.y=n}QR.prototype={constructor:QR,scale:function(e){return e===1?this:new QR(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new QR(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 $R=new QR(1,0,0);ez.prototype=QR.prototype;function ez(e){for(;!e.__zoom;)if(!(e=e.parentNode))return $R;return e.__zoom}function tz(e){e.stopImmediatePropagation()}function nz(e){e.preventDefault(),e.stopImmediatePropagation()}function rz(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function iz(){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 az(){return this.__zoom||$R}function oz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sz(){return navigator.maxTouchPoints||`ontouchstart`in this}function cz(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 lz(){var e=rz,t=iz,n=cz,r=oz,i=sz,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=lL,l=ON(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,az).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`,az),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($R.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 QR(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 QR(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 QR(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=jF(this.that).datum();l.call(e,this.that,new ZR(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=NF(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)],RL(this),s.start();nz(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=jF(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=NF(t,i),l=t.clientX,u=t.clientY;RF(t.view),tz(t),a.mouse=[c,this.__zoom.invert(c)],RL(this),a.start();function d(e){if(nz(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]=NF(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),zF(e.view,a.moved),nz(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=NF(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);nz(r),s>0?jF(this).transition().duration(s).call(x,d,c,r):jF(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(tz(t),s=0;s<i;++s)c=r[s],l=NF(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)),RL(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(nz(e),s=0;s<a;++s)c=i[s],l=NF(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(tz(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=NF(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=jF(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:XR(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:XR(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:XR(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:XR([[+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 uz={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.`},dz=[[-1/0,-1/0],[1/0,1/0]],fz=[`Enter`,` `,`Escape`],pz={"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`},mz;(function(e){e.Strict=`strict`,e.Loose=`loose`})(mz||={});var hz;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(hz||={});var gz;(function(e){e.Partial=`partial`,e.Full=`full`})(gz||={});var _z={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},vz;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(vz||={});var yz;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(yz||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var bz={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top};function xz(e){return e===null?null:e?`valid`:`invalid`}var Sz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Cz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),wz=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Tz=(e,t=[0,0])=>{let{width:n,height:r}=aB(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Ez=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:Vz(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):wz(n)?n:t.nodeLookup.get(n.id)),zz(e,i?Uz(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),Dz=(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=zz(n,Uz(e)),r=!0)}),r?Vz(n):{x:0,y:0,width:0,height:0}},Oz=(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=Gz(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},kz=(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 Az(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}=aB(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 jz({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=nB(Dz(Az(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 Mz({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`,uz.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&iB(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=iB(d)?Fz(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,uz.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 Nz({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=kz(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 Pz=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Fz=(e={x:0,y:0},t,n)=>({x:Pz(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Pz(e.y,t[0][1],t[1][1]-(n?.height??0))});function Iz(e,t,n){let{width:r,height:i}=aB(n),{x:a,y:o}=n.internals.positionAbsolute;return Fz(e,[[a,o],[a+r,o+i]],t)}var Lz=(e,t,n)=>e<t?Pz(Math.abs(e-t),1,t)/t:e>n?-Pz(Math.abs(e-n),1,t)/t:0,Rz=(e,t,n=15,r=40)=>[Lz(e.x,r,t.width-r)*n,Lz(e.y,r,t.height-r)*n],zz=(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)}),Bz=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Vz=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Hz=(e,t=[0,0])=>{let{x:n,y:r}=wz(e)?e.internals.positionAbsolute:Tz(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}},Uz=(e,t=[0,0])=>{let{x:n,y:r}=wz(e)?e.internals.positionAbsolute:Tz(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)}},Wz=(e,t)=>Vz(zz(Bz(e),Bz(t))),Gz=(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)},Kz=(e,t)=>Gz(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),qz=e=>Jz(e.width)&&Jz(e.height)&&Jz(e.x)&&Jz(e.y),Jz=e=>!isNaN(e)&&isFinite(e),Yz=(e,t)=>(e,t)=>{},Xz=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zz=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Xz(s,o):s},Qz=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function $z(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 eB(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=$z(e,n),i=$z(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=$z(e.top??e.y??0,n),i=$z(e.bottom??e.y??0,n),a=$z(e.left??e.x??0,t),o=$z(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 tB(e,t,n,r,i,a){let{x:o,y:s}=Qz(e,[t,n,r]),{x:c,y:l}=Qz({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 nB=(e,t,n,r,i,a)=>{let o=eB(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Pz(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=tB(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}},rB=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function iB(e){return e!=null&&e!==`parent`}function aB(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function oB(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function sB(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 cB(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function lB(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function uB(e){return{...pz,...e||{}}}function dB(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=_B(e),s=Zz({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Xz(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var fB=e=>({width:e.offsetWidth,height:e.offsetHeight}),pB=e=>e?.getRootNode?.()||window?.document,mB=[`INPUT`,`SELECT`,`TEXTAREA`];function hB(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?mB.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var gB=e=>`clientX`in e,_B=(e,t)=>{let n=gB(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)}},vB=(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,...fB(t)}})};function yB({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 bB(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function xB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-bB(t-r,a),n];case $.Right:return[t+bB(r-t,a),n];case $.Top:return[t,n-bB(n-i,a)];case $.Bottom:return[t,n+bB(i-n,a)]}}function SB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=xB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=xB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=yB({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 CB({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 wB({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 TB({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=zz(Uz(e),Uz(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Kz({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Vz(a))>0}var EB=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,DB=(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)),OB=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,uz.error006()),t;let r=n.getEdgeId||EB,i;return i=Sz(e)?{...e}:{...e,id:r(e)},DB(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function kB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=CB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var AB={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},jB=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.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},MB=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function NB({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=AB[t],c=AB[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=jB({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]=CB({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 PB(e,t,n,r){let i=Math.min(MB(e,t)/2,MB(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 FB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=NB({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+=PB(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 IB(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function LB(e){let{sourceNode:t,targetNode:n}=e;if(!IB(t)||!IB(n))return null;let r=t.internals.handleBounds||RB(t.handles),i=n.internals.handleBounds||RB(n.handles),a=BB(r?.source??[],e.sourceHandle),o=BB(e.connectionMode===mz.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,uz.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=zB(t,a,s),u=zB(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function RB(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 zB(e,t,n=$.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??aB(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function BB(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function VB(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function HB(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=VB(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 UB=1e3,WB=10,GB={nodeOrigin:[0,0],nodeExtent:dz,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},KB={...GB,checkEquality:!0};function qB(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function JB(e,t,n){let r=qB(GB,n);for(let n of e.values())if(n.parentId)$B(n,e,t,r);else{let e=Fz(Tz(n,r.nodeOrigin),iB(n.extent)?n.extent:r.nodeExtent,aB(n));n.internals.positionAbsolute=e}}function YB(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 XB(e){return e===`manual`}function ZB(e,t,n,r={}){let i=qB(KB,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!XB(i.zIndexMode)?UB: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=Fz(Tz(u,i.nodeOrigin),iB(u.extent)?u.extent:i.nodeExtent,aB(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:YB(u,e),z:eV(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&&$B(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function QB(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 $B(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=qB(GB,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}QB(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*WB),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=tV(e,u,o,s,a&&!XB(c)?UB: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 eV(e,t,n){let r=Jz(e.zIndex)?e.zIndex:0;return XB(n)?r:r+(e.selected?t:0)}function tV(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=aB(e),l=Tz(e,n),u=iB(e.extent)?Fz(l,e.extent,c):l,d=Fz({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Iz(d,c,t));let f=eV(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function nV(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=Wz(a.get(n.parentId)?.expandedRect??Hz(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=aB(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 rV(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=fB(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=iB(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Iz(h,s,n))}else m&&(h=Fz(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:vB(`source`,r.nodeElement,p,d,e.id),target:vB(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&$B(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:Hz(g,i)}))}}if(f.length>0){let e=nV(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function iV({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 aV(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 oV(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}`;aV(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),aV(`target`,s,c,e,i,o),t.set(r.id,r)}}function sV(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:sV(n,t):!1}function cV(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 lV(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!sV(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 uV({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 dV({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=Xz(a,t);return{x:o.x-a.x,y:o.y-a.y}}function fV({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=jF(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?Bz(Dz(s)):null,x=v&&l?dV({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)}:Xz(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}=Mz({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]=uV({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]=Rz(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=dB(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=lV(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=uV({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=KF().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=dB(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=_B(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=dB(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=_B(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=_B(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]=uV({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||!cV(t,`.${g}`,v))&&(!_||cV(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function pV(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())Kz(i,Hz(e))>0&&r.push(e);return r}var mV=250;function hV(e,t,n,r){let i=[],a=1/0,o=pV(e,n,t+mV);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}=zB(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 gV(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,...zB(o,c,c.position,!0)}:c}function _V(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function vV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var yV=()=>!0;function bV(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:_=yV,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=pB(e.target),E=0,D,{x:O,y:k}=_B(e),A=_V(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=gV(i,A,r,c,t);if(!N)return;let P=_B(e,j),F=!1,I=null,ee=!1,L=null;function te(){if(!u||!j)return;let[e,t]=Rz(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(te)}let ne={...N,nodeId:i,type:A,position:N.position},re=c.get(i),ie={inProgress:!0,isValid:null,from:zB(re,ne,$.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:re,to:P,toHandle:null,toPosition:bz[ne.position],toNode:null,pointer:P};function ae(){M=!0,y(ie),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ae();function oe(e){if(!M){let{x:t,y:n}=_B(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ae()}if(!x()||!ne){se(e);return}let a=b();P=_B(e,j),D=hV(Zz(P,a,!1,[1,1]),n,c,ne),F||=(te(),!0);let s=xV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});L=s.handleDomNode,I=s.connection,ee=vV(!!D,s.isValid);let u=c.get(i),f=u?zB(u,ne,$.Left,!0):ie.from,p={...ie,from:f,isValid:ee,to:s.toHandle&&ee?Qz({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:ee&&s.toHandle?s.toHandle.position:bz[ne.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),ie=p}function se(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||L)&&I&&ee&&h?.(I);let{inProgress:t,...n}=ie,r={...n,toPosition:ie.toHandle?ie.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,ee=!1,I=null,L=null,T.removeEventListener(`mousemove`,oe),T.removeEventListener(`mouseup`,se),T.removeEventListener(`touchmove`,oe),T.removeEventListener(`touchend`,se)}}T.addEventListener(`mousemove`,oe),T.addEventListener(`mouseup`,se),T.addEventListener(`touchmove`,oe),T.addEventListener(`touchend`,se)}function xV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=yV,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}=_B(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=_V(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===mz.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=gV(t,e,a,u,n,!0)}return _}var SV={onPointerDown:bV,isValid:xV};function CV({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=jF(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&&rB()?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=lz().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:NF}}var wV=e=>({x:e.x,y:e.y,zoom:e.k}),TV=({x:e,y:t,zoom:n})=>$R.translate(e,t).scale(n),EV=(e,t)=>e.target.closest(`.${t}`),DV=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),OV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kV=(e,t=0,n=OV,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},AV=e=>{let t=e.ctrlKey&&rB()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function jV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(EV(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=NF(u),t=d*2**AV(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===hz.Vertical?0:u.deltaX*f,m=i===hz.Horizontal?0:u.deltaY*f;!rB()&&u.shiftKey&&i!==hz.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=wV(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 MV({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=EV(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function NV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=wV(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 PV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&DV(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,wV(a.transform))}}function FV({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&DV(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=wV(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function IV({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`&&(EV(d,`${l}-flow__node`)||EV(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||EV(d,s)&&m||EV(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 LV({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=lz().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=jF(e).call(f);y({x:i.x,y:i.y,zoom:Pz(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(AV);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?YI:lL).transform(kV(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:!Jz(E)||E<0?0:E);let k=O?jV({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):MV({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=NV({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=PV({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=FV({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=IV({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=TV(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=TV(e);return await g(n,t),n}function x(e){if(p){let t=TV(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?ez(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`?YI:lL).scaleTo(kV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?YI:lL).scaleBy(kV(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=!Jz(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 RV;(function(e){e.Line=`line`,e.Handle=`handle`})(RV||={});function zV({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 BV(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 VV(e,t){return Math.max(0,t-e)}function HV(e,t){return Math.max(0,e-t)}function UV(e,t,n){return Math.max(0,t-e,e-n)}function WV(e,t){return e?!t:t}function GV(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=UV(E,h,g),j=UV(D,_,v);if(o){let e=0,t=0;c&&w<0?e=VV(y+w+O,o[0][0]):!c&&w>0&&(e=HV(y+E+O,o[1][0])),l&&T<0?t=VV(b+T+k,o[0][1]):!l&&T>0&&(t=HV(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=HV(y+w,s[0][0]):!c&&w<0&&(e=VV(y+E,s[1][0])),l&&T>0?t=HV(b+T,s[0][1]):!l&&T<0&&(t=VV(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=UV(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?HV(b+k+E/C,o[1][1])*C:VV(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?VV(b+E/C,s[1][1])*C:HV(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=UV(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?HV(y+D*C+O,o[1][0])/C:VV(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?VV(y+D*C,s[1][0])/C:HV(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=(WV(c,l)?-w:w)/C:w=(WV(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 KV={width:0,height:0,x:0,y:0},qV={...KV,pointerX:0,pointerY:0,aspectRatio:1};function JV(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 YV({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=jF(e),o={controlDirection:BV(`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={...KV},h={...qV};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:BV(e)};let g,_=null,v=[],y,b,x,S=!1,C=KF().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}=dB(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=iB(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=JV(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=dB(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}=GV(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=zV({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 XV=Pe((e=>{var t=Ie();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})),ZV=Pe(((e,t)=>{t.exports=XV()})),QV=Pe((e=>{var t=Ie(),n=ZV();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}})),$V=s(Pe(((e,t)=>{t.exports=QV()}))(),1),eH=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},tH=e=>e?eH(e):eH,{useDebugValue:nH}=z.default,{useSyncExternalStoreWithSelector:rH}=$V.default,iH=e=>e;function aH(e,t=iH,n){let r=rH(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return nH(r),r}var oH=(e,t)=>{let n=tH(e),r=(e,r=t)=>aH(n,e,r);return Object.assign(r,n),r},sH=(e,t)=>e?oH(e,t):oH;function cH(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 lH=(0,z.createContext)(null),uH=lH.Provider,dH=uz.error001(`react`);function fH(e,t){let n=(0,z.useContext)(lH);if(n===null)throw Error(dH);return aH(n,e,t)}function pH(){let e=(0,z.useContext)(lH);if(e===null)throw Error(dH);return(0,z.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var mH={display:`none`},hH={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},gH=`react-flow__node-desc`,_H=`react-flow__edge-desc`,vH=`react-flow__aria-live`,yH=e=>e.ariaLiveMessage,bH=e=>e.ariaLabelConfig;function xH({rfId:e}){let t=fH(yH);return(0,B.jsx)(`div`,{id:`${vH}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:hH,children:t})}function SH({rfId:e,disableKeyboardA11y:t}){let n=fH(bH);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{id:`${gH}-${e}`,style:mH,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,B.jsx)(`div`,{id:`${_H}-${e}`,style:mH,children:n[`edge.a11yDescription.default`]}),!t&&(0,B.jsx)(xH,{rfId:e})]})}var CH=(0,z.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,B.jsx)(`div`,{className:EN([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));CH.displayName=`Panel`;var wH=`https://reactflow.dev?utm_source=attribution`;function TH({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,B.jsx)(CH,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${wH}`,children:(0,B.jsx)(`a`,{href:wH,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var EH=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}},DH=e=>e.id;function OH(e,t){return cH(e.selectedNodes.map(DH),t.selectedNodes.map(DH))&&cH(e.selectedEdges.map(DH),t.selectedEdges.map(DH))}function kH({onSelectionChange:e}){let t=pH(),{selectedNodes:n,selectedEdges:r}=fH(EH,OH);return(0,z.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var AH=e=>!!e.onSelectionChangeHandlers;function jH({onSelectionChange:e}){let t=fH(AH);return e||t?(0,B.jsx)(kH,{onSelectionChange:e}):null}var MH=[0,0],NH={x:0,y:0,zoom:1},PH=[...`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`],FH=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}),IH={translateExtent:dz,nodeOrigin:MH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function LH(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=fH(FH,cH),l=pH();(0,z.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=IH,s()}),[]);let u=(0,z.useRef)(IH);return(0,z.useEffect)(()=>{for(let s of PH){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:uB(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},PH.map(t=>e[t])),null}function RH(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function zH(e){let[t,n]=(0,z.useState)(e===`system`?null:e);return(0,z.useEffect)(()=>{if(e!==`system`){n(e);return}let t=RH(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?RH()?.matches?`dark`:`light`:t}var BH=typeof document<`u`?document:null;function VH(e=null,t={target:BH,actInsideInputWithModifier:!0}){let[n,r]=(0,z.useState)(!1),i=(0,z.useRef)(!1),a=(0,z.useRef)(new Set([])),[o,s]=(0,z.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
82
+ `)){let t=s.slice(0,e);if(s=s.slice(e+1),t===``)continue;let n=o(t);if(n.kind===`end`)return;if(n.kind===`error`)throw new pN(n.message,i.status,`node_stream_failed`);yield n}}}finally{await a.cancel().catch(()=>void 0)}throw new pN(`The node's timeline ended before its last line`,i.status,`node_stream_cut_off`)}async createSubscription(e){return this.#a(this.#r(TA.subscriptions),WM.parse,_N(`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){vN(e,`subscription ID`);let n;try{n=await this.#t(this.#r(TA.subscription(e)),{method:`DELETE`,...t?{keepalive:t}:{}})}catch(e){throw new pN(`Telemetry request failed`,void 0,void 0,{cause:e})}if(!n.ok&&n.status!==204)throw new pN(`Retiring a subscription failed with status ${n.status}`,n.status)}async listProjects(){return this.#a(this.#r(TA.projects),pM.parse)}async getProject(e){return vN(e,`project ID`),this.#a(this.#r(TA.project(e)),mM.parse)}async stop(e,t=!1){return vN(e,`run ID`),this.#a(this.#r(TA.stop(e)),gM.parse,_N(`POST`,{force:t}))}async listHumanItems(e={}){let t=this.#r(Wk.list);for(let[n,r]of Object.entries(e))r!=null&&t.searchParams.set(n,String(r));return this.#a(t,yA.parse)}async getHumanItem(e){return vN(e,`human-item ID`),this.#a(this.#r(Wk.item(e)),hA.parse)}async answerHumanItem(e,t){return vN(e,`human-item ID`),this.#a(this.#r(Wk.answer(e)),gA.parse,_N(`POST`,typeof t==`string`?{text:t}:t))}async answerHumanItems(e){return this.#a(this.#r(Wk.answers),vA.parse,_N(`POST`,{answers:e}))}async completeHumanItem(e){return vN(e,`human-item ID`),this.#a(this.#r(Wk.complete(e)),gA.parse,_N(`POST`,{}))}async dismissHumanItem(e,t){return vN(e,`human-item ID`),this.#a(this.#r(Wk.dismiss(e)),gA.parse,_N(`POST`,t?.trim()?{reason:t}:{}))}async reopenHumanItem(e){return vN(e,`human-item ID`),this.#a(this.#r(Wk.reopen(e)),gA.parse,_N(`POST`,{}))}async noteHumanItem(e,t){return vN(e,`human-item ID`),this.#a(this.#r(Wk.note(e)),gA.parse,_N(`POST`,{text:t}))}async shutdown(e,t={}){return this.#a(this.#r(TA.shutdown),xM.parse,_N(`POST`,{scope:e,...gN(t)}))}async unwatched(){return this.#a(this.#r(TA.unwatched),SM.parse)}async host(){return this.#a(this.#r(TA.host),wM.parse)}async getStatus(e){return vN(e,`run ID`),this.#a(this.#r(TA.status(e)),TM.parse)}async getAgents(e){return vN(e,`run ID`),this.#a(this.#r(TA.agents(e)),kM.parse)}async getNodeAgents(e,t){return vN(e,`run ID`),vN(t,`node ID`),this.#a(this.#r(TA.nodeAgents(e,t)),kM.parse)}async getProjectAgents(e){return vN(e,`project ID`),this.#a(this.#r(TA.projectAgents(e)),AM.parse)}#r(e){return new URL(e,this.#e)}#i(e){return(this.#n??(e=>{if(typeof EventSource>`u`)throw new pN(`EventSource is unavailable; provide an eventSource factory`);return new EventSource(e)}))(e.toString())}async#a(e,t,n,r){let a=r===void 0?void 0:new AbortController,o=a===void 0?void 0:setTimeout(()=>a.abort(),S);try{return await this.#o(e,t,{...n,...a===void 0?{}:{signal:a.signal}})}catch(e){throw a?.signal.aborted===!0&&r!==void 0?new pN(new i(r).message,void 0,`deadline`,{cause:e}):e}finally{o!==void 0&&clearTimeout(o)}}async#o(e,t,n){let r;try{r=await this.#t(e,n)}catch(e){throw new pN(`Telemetry request failed`,void 0,void 0,{cause:e})}let i=await r.json().catch(e=>{throw r.ok?new pN(`Telemetry server returned invalid JSON`,r.status,void 0,{cause:e}):new pN(`Telemetry request failed with status ${r.status}`,r.status,void 0,{cause:e})});if(!r.ok){let e=cM.safeParse(i);throw new pN(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 pN(`Telemetry response failed contract validation`,r.status,void 0,{cause:e})}}};function gN(e){let{grace:t,force:n=!1}=e;if(t===void 0)return{force:n};if(!Number.isSafeInteger(t)||t<0)throw new pN(`Invalid grace: whole seconds, 0 or more`);return{grace:t,force:n}}function _N(e,t){return{method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}}function vN(e,t){let n=[...e].some(e=>e.charCodeAt(0)<32);if(e.length===0||n||/[/?#]/u.test(e))throw new pN(`Invalid ${t}`)}function yN({outcome:t,label:n}){if(t===void 0)return null;if(t.kind===`refused`){let r=t.error,i=r instanceof pN?r.code:void 0,a=r instanceof pN?r.status:void 0;return(0,B.jsxs)(yi,{"aria-label":`${n} refused`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsxs)(bi,{children:[t.title,a!==void 0&&` · ${a}`,i!==void 0&&` ${i}`]}),(0,B.jsx)(xi,{children:(0,B.jsx)(`pre`,{className:`verb-text`,children:r.message})})]})}return(0,B.jsxs)(yi,{"aria-label":`${n} receipt`,children:[(0,B.jsx)(qe,{}),(0,B.jsx)(bi,{children:t.title}),(0,B.jsx)(xi,{children:(0,B.jsx)(`pre`,{className:`verb-text`,children:JSON.stringify(t.payload,null,2)})})]})}async function bN(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 xN={Complete:qe,Failed:et,Stopped:ft,Unfinished:$e,"Waiting on you":it,"Driver dead":wt,Idle:Ze,Running:st},SN=e=>e.toLowerCase().replaceAll(/[^a-z]+/gu,`-`);function CN({state:e,large:t=!1}){let n=e.known?xN[e.word]:Je,r=t?16:13;return(0,B.jsxs)(`span`,{className:`run-state-group`,"data-large":t,children:[(0,B.jsxs)(`span`,{"aria-label":`Run state`,className:`run-state`,"data-run-state":e.known?SN(e.word):`unknown`,role:`group`,title:e.word,children:[(0,B.jsx)(n,{"aria-label":e.word,role:`img`,size:r}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:e.word})]}),e.failed>0&&(0,B.jsxs)(`span`,{className:`run-failures`,title:`${e.failed} failed nodes`,children:[(0,B.jsx)(et,{"aria-hidden":`true`,size:r}),e.failed,` failed`]})]})}function wN(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)();return{run:(0,z.useCallback)(async(...r)=>{i(!0);let a=await bN(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 TN(e){return/\[[^\]]+\]/.exec(e)?.[0]}function EN({runId:e,control:t,ended:n,state:r}){let{stop:i,stopOpen:a,setStopOpen:o,forceOpen:s,setForceOpen:c,refusal:l}=DN(t),u=l===void 0?void 0:TN(l.message),d=i.outcome,f=i.pending;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`run-actions`,children:[r!==void 0&&(0,B.jsx)(`span`,{className:`run-actions-badge`,children:(0,B.jsx)(CN,{state:r})}),!n&&(0,B.jsxs)(Wi,{"aria-label":`Stop`,disabled:f,onClick:()=>o(!0),size:`sm`,title:`Stop`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(mt,{size:14}),(0,B.jsx)(`span`,{className:`run-action-label`,children:`Stop`})]})]}),(0,B.jsx)(Es,{onOpenChange:o,open:a,children:(0,B.jsxs)(As,{children:[(0,B.jsxs)(js,{children:[(0,B.jsxs)(Ns,{children:[`Stop `,e,`?`]}),(0,B.jsx)(Ps,{children:`The run is stopped as the acting session. A run another session owns is refused, naming its owner.`})]}),(0,B.jsxs)(Ms,{children:[(0,B.jsx)(Os,{asChild:!0,children:(0,B.jsx)(Wi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(Wi,{disabled:f,onClick:()=>void i.run(!1),type:`button`,variant:`destructive`,children:`Stop run`})]})]})}),(0,B.jsx)(Es,{onOpenChange:c,open:s,children:(0,B.jsxs)(As,{children:[(0,B.jsxs)(js,{children:[(0,B.jsxs)(Ns,{children:[`Force-stop `,e,u!==void 0&&`, overriding ${u}`,`?`]}),(0,B.jsxs)(Ps,{children:[l?.message,` — `,`a forced stop is journalled forced with the owner it overrode.`]})]}),(0,B.jsxs)(Ms,{children:[(0,B.jsx)(Os,{asChild:!0,children:(0,B.jsx)(Wi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsxs)(Wi,{disabled:f,onClick:()=>void i.run(!0),type:`button`,variant:`destructive`,children:[`Force stop`,u!==void 0&&`, overriding ${u}`]})]})]})}),d!==void 0&&(0,B.jsxs)(`div`,{className:`run-outcomes`,children:[(0,B.jsx)(yN,{label:`Stop`,outcome:d}),l!==void 0&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(Wi,{onClick:()=>c(!0),size:`sm`,type:`button`,variant:`destructive`,children:`Force stop…`})})]})]})}function DN(e){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=wN(e=>e?`Forced stop`:`Stop`,(0,z.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 pN&&a.outcome.error.code===`not_owner`?a.outcome.error:void 0}}function ON(e,t,n){let[r,i]=(0,z.useState)({}),a=(0,z.useRef)({key:e});(0,z.useEffect)(()=>{a.current.key=e},[e]),(0,z.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:kN(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 kN(e){return e instanceof Error?e:Error(String(e))}function AN(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useCallback)(()=>r(e=>e+1),[]);return{status:ON(t,()=>e.getStatus(t??``),n),stop:(0,z.useCallback)(async n=>{try{return await e.stop(t??``,n)}finally{i()}},[e,t,i]),reread:i}}function jN(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=jN(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var MN={value:()=>{}};function NN(){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 PN(n)}function PN(e){this._=e}function FN(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}})}PN.prototype=NN.prototype={constructor:PN,on:function(e,t){var n=this._,r=FN(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=IN(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]=LN(n[i],e.name,t);else if(t==null)for(i in n)n[i]=LN(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 PN(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 IN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function LN(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=MN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var RN={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 zN(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),RN.hasOwnProperty(t)?{space:RN[t],local:e}:e}function BN(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 VN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function HN(e){var t=zN(e);return(t.local?VN:BN)(t)}function UN(){}function WN(e){return e==null?UN:function(){return this.querySelector(e)}}function GN(e){typeof e!=`function`&&(e=WN(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 NF(r,this._parents)}function KN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qN(){return[]}function JN(e){return e==null?qN:function(){return this.querySelectorAll(e)}}function YN(e){return function(){return KN(e.apply(this,arguments))}}function XN(e){e=typeof e==`function`?YN(e):JN(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 NF(r,i)}function ZN(e){return function(){return this.matches(e)}}function QN(e){return function(t){return t.matches(e)}}var $N=Array.prototype.find;function eP(e){return function(){return $N.call(this.children,e)}}function tP(){return this.firstElementChild}function nP(e){return this.select(e==null?tP:eP(typeof e==`function`?e:QN(e)))}var rP=Array.prototype.filter;function iP(){return Array.from(this.children)}function aP(e){return function(){return rP.call(this.children,e)}}function oP(e){return this.selectAll(e==null?iP:aP(typeof e==`function`?e:QN(e)))}function sP(e){typeof e!=`function`&&(e=ZN(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 NF(r,this._parents)}function cP(e){return Array(e.length)}function lP(){return new NF(this._enter||this._groups.map(cP),this._parents)}function uP(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}uP.prototype={constructor:uP,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 dP(e){return function(){return e}}function fP(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 uP(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function pP(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 uP(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function mP(e){return e.__data__}function hP(e,t){if(!arguments.length)return Array.from(this,mP);var n=t?pP:fP,r=this._parents,i=this._groups;typeof e!=`function`&&(e=dP(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=gP(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 NF(o,r),o._enter=s,o._exit=c,o}function gP(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _P(){return new NF(this._exit||this._groups.map(cP),this._parents)}function vP(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 yP(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 NF(s,this._parents)}function bP(){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 xP(e){e||=SP;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 NF(i,this._parents).order()}function SP(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function CP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wP(){return Array.from(this)}function TP(){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 EP(){let e=0;for(let t of this)++e;return e}function DP(){return!this.node()}function OP(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 kP(e){return function(){this.removeAttribute(e)}}function AP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jP(e,t){return function(){this.setAttribute(e,t)}}function MP(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function NP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function PP(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 FP(e,t){var n=zN(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?AP:kP:typeof t==`function`?n.local?PP:NP:n.local?MP:jP)(n,t))}function IP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function LP(e){return function(){this.style.removeProperty(e)}}function RP(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zP(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function BP(e,t,n){return arguments.length>1?this.each((t==null?LP:typeof t==`function`?zP:RP)(e,t,n??``)):VP(this.node(),e)}function VP(e,t){return e.style.getPropertyValue(t)||IP(e).getComputedStyle(e,null).getPropertyValue(t)}function HP(e){return function(){delete this[e]}}function UP(e,t){return function(){this[e]=t}}function WP(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function GP(e,t){return arguments.length>1?this.each((t==null?HP:typeof t==`function`?WP:UP)(e,t)):this.node()[e]}function KP(e){return e.trim().split(/^|\s+/)}function qP(e){return e.classList||new JP(e)}function JP(e){this._node=e,this._names=KP(e.getAttribute(`class`)||``)}JP.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 YP(e,t){for(var n=qP(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function XP(e,t){for(var n=qP(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function ZP(e){return function(){YP(this,e)}}function QP(e){return function(){XP(this,e)}}function $P(e,t){return function(){(t.apply(this,arguments)?YP:XP)(this,e)}}function eF(e,t){var n=KP(e+``);if(arguments.length<2){for(var r=qP(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?$P:t?ZP:QP)(n,t))}function tF(){this.textContent=``}function nF(e){return function(){this.textContent=e}}function rF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function iF(e){return arguments.length?this.each(e==null?tF:(typeof e==`function`?rF:nF)(e)):this.node().textContent}function aF(){this.innerHTML=``}function oF(e){return function(){this.innerHTML=e}}function sF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function cF(e){return arguments.length?this.each(e==null?aF:(typeof e==`function`?sF:oF)(e)):this.node().innerHTML}function lF(){this.nextSibling&&this.parentNode.appendChild(this)}function uF(){return this.each(lF)}function dF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fF(){return this.each(dF)}function pF(e){var t=typeof e==`function`?e:HN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mF(){return null}function hF(e,t){var n=typeof e==`function`?e:HN(e),r=t==null?mF:typeof t==`function`?t:WN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function gF(){var e=this.parentNode;e&&e.removeChild(this)}function _F(){return this.each(gF)}function vF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bF(e){return this.select(e?yF:vF)}function xF(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function SF(e){return function(t){e.call(this,t,this.__data__)}}function CF(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 wF(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 TF(e,t,n){return function(){var r=this.__on,i,a=SF(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 EF(e,t,n){var r=CF(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?TF:wF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function DF(e,t,n){var r=IP(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 OF(e,t){return function(){return DF(this,e,t)}}function kF(e,t){return function(){return DF(this,e,t.apply(this,arguments))}}function AF(e,t){return this.each((typeof t==`function`?kF:OF)(e,t))}function*jF(){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 MF=[null];function NF(e,t){this._groups=e,this._parents=t}function PF(){return new NF([[document.documentElement]],MF)}function FF(){return this}NF.prototype=PF.prototype={constructor:NF,select:GN,selectAll:XN,selectChild:nP,selectChildren:oP,filter:sP,data:hP,enter:lP,exit:_P,join:vP,merge:yP,selection:FF,order:bP,sort:xP,call:CP,nodes:wP,node:TP,size:EP,empty:DP,each:OP,attr:FP,style:BP,property:GP,classed:eF,text:iF,html:cF,raise:uF,lower:fF,append:pF,insert:hF,remove:_F,clone:bF,datum:xF,on:EF,dispatch:AF,[Symbol.iterator]:jF};function IF(e){return typeof e==`string`?new NF([[document.querySelector(e)]],[document.documentElement]):new NF([[e]],MF)}function LF(e){let t;for(;t=e.sourceEvent;)e=t;return e}function RF(e,t){if(e=LF(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 zF={passive:!1},BF={capture:!0,passive:!1};function VF(e){e.stopImmediatePropagation()}function HF(e){e.preventDefault(),e.stopImmediatePropagation()}function UF(e){var t=e.document.documentElement,n=IF(e).on(`dragstart.drag`,HF,BF);`onselectstart`in t?n.on(`selectstart.drag`,HF,BF):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function WF(e,t){var n=e.document.documentElement,r=IF(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,HF,BF),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 GF=e=>()=>e;function KF(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}})}KF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function qF(e){return!e.ctrlKey&&!e.button}function JF(){return this.parentNode}function YF(e,t){return t??{x:e.x,y:e.y}}function XF(){return navigator.maxTouchPoints||`ontouchstart`in this}function ZF(){var e=qF,t=JF,n=YF,r=XF,i={},a=NN(`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`,_,zF).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&&(IF(n.view).on(`mousemove.drag`,m,BF).on(`mouseup.drag`,h,BF),UF(n.view),VF(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(HF(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){IF(e.view).on(`mousemove.drag mouseup.drag`,null),WF(e.view,l),HF(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]))&&(VF(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])&&(HF(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])&&(VF(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=RF(l||r,t),p,m,h;if((h=n.call(e,new KF(`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=RF(l||a,t),_=o;break}u.call(r,e,new KF(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:GF(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:GF(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:GF(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:GF(!!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 QF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $F(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function eI(){}var tI=.7,nI=1/tI,rI=`\\s*([+-]?\\d+)\\s*`,iI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,aI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,oI=/^#([0-9a-f]{3,8})$/,sI=RegExp(`^rgb\\(${rI},${rI},${rI}\\)$`),cI=RegExp(`^rgb\\(${aI},${aI},${aI}\\)$`),lI=RegExp(`^rgba\\(${rI},${rI},${rI},${iI}\\)$`),uI=RegExp(`^rgba\\(${aI},${aI},${aI},${iI}\\)$`),dI=RegExp(`^hsl\\(${iI},${aI},${aI}\\)$`),fI=RegExp(`^hsla\\(${iI},${aI},${aI},${iI}\\)$`),pI={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};QF(eI,vI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mI,formatHex:mI,formatHex8:hI,formatHsl:gI,formatRgb:_I,toString:_I});function mI(){return this.rgb().formatHex()}function hI(){return this.rgb().formatHex8()}function gI(){return jI(this).formatHsl()}function _I(){return this.rgb().formatRgb()}function vI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=oI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yI(t):n===3?new CI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bI(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=sI.exec(e))?new CI(t[1],t[2],t[3],1):(t=cI.exec(e))?new CI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lI.exec(e))?bI(t[1],t[2],t[3],t[4]):(t=uI.exec(e))?bI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dI.exec(e))?AI(t[1],t[2]/100,t[3]/100,1):(t=fI.exec(e))?AI(t[1],t[2]/100,t[3]/100,t[4]):pI.hasOwnProperty(e)?yI(pI[e]):e===`transparent`?new CI(NaN,NaN,NaN,0):null}function yI(e){return new CI(e>>16&255,e>>8&255,e&255,1)}function bI(e,t,n,r){return r<=0&&(e=t=n=NaN),new CI(e,t,n,r)}function xI(e){return e instanceof eI||(e=vI(e)),e?(e=e.rgb(),new CI(e.r,e.g,e.b,e.opacity)):new CI}function SI(e,t,n,r){return arguments.length===1?xI(e):new CI(e,t,n,r??1)}function CI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}QF(CI,SI,$F(eI,{brighter(e){return e=e==null?nI:nI**+e,new CI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tI:tI**+e,new CI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new CI(OI(this.r),OI(this.g),OI(this.b),DI(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:wI,formatHex:wI,formatHex8:TI,formatRgb:EI,toString:EI}));function wI(){return`#${kI(this.r)}${kI(this.g)}${kI(this.b)}`}function TI(){return`#${kI(this.r)}${kI(this.g)}${kI(this.b)}${kI((isNaN(this.opacity)?1:this.opacity)*255)}`}function EI(){let e=DI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${OI(this.r)}, ${OI(this.g)}, ${OI(this.b)}${e===1?`)`:`, ${e})`}`}function DI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function OI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kI(e){return e=OI(e),(e<16?`0`:``)+e.toString(16)}function AI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new NI(e,t,n,r)}function jI(e){if(e instanceof NI)return new NI(e.h,e.s,e.l,e.opacity);if(e instanceof eI||(e=vI(e)),!e)return new NI;if(e instanceof NI)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 NI(o,s,c,e.opacity)}function MI(e,t,n,r){return arguments.length===1?jI(e):new NI(e,t,n,r??1)}function NI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}QF(NI,MI,$F(eI,{brighter(e){return e=e==null?nI:nI**+e,new NI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tI:tI**+e,new NI(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 CI(II(e>=240?e-240:e+120,i,r),II(e,i,r),II(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new NI(PI(this.h),FI(this.s),FI(this.l),DI(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=DI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${PI(this.h)}, ${FI(this.s)*100}%, ${FI(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function PI(e){return e=(e||0)%360,e<0?e+360:e}function FI(e){return Math.max(0,Math.min(1,e||0))}function II(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 LI=e=>()=>e;function RI(e,t){return function(n){return e+n*t}}function zI(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function BI(e){return(e=+e)==1?VI:function(t,n){return n-t?zI(t,n,e):LI(isNaN(t)?n:t)}}function VI(e,t){var n=t-e;return n?RI(e,n):LI(isNaN(e)?t:e)}var HI=(function e(t){var n=BI(t);function r(e,t){var r=n((e=SI(e)).r,(t=SI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=VI(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 UI(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 WI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function GI(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]=eL(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 KI(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qI(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function JI(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]=eL(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var YI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,XI=new RegExp(YI.source,`g`);function ZI(e){return function(){return e}}function QI(e){return function(t){return e(t)+``}}function $I(e,t){var n=YI.lastIndex=XI.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=YI.exec(e))&&(i=XI.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:qI(r,i)})),n=XI.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?QI(c[0].x):ZI(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 eL(e,t){var n=typeof t,r;return t==null||n===`boolean`?LI(t):(n===`number`?qI:n===`string`?(r=vI(t))?(t=r,HI):$I:t instanceof vI?HI:t instanceof Date?KI:WI(t)?UI:Array.isArray(t)?GI:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?JI:qI)(e,t)}var tL=180/Math.PI,nL={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rL(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)*tL,skewX:Math.atan(c)*tL,scaleX:o,scaleY:s}}var iL;function aL(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?nL:rL(t.a,t.b,t.c,t.d,t.e,t.f)}function oL(e){return e==null||(iL||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),iL.setAttribute(`transform`,e),!(e=iL.transform.baseVal.consolidate()))?nL:(e=e.matrix,rL(e.a,e.b,e.c,e.d,e.e,e.f))}function sL(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:qI(e,i)},{i:c-2,x:qI(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:qI(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:qI(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:qI(e,n)},{i:s-2,x:qI(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 cL=sL(aL,`px, `,`px)`,`deg)`),lL=sL(oL,`, `,`)`,`)`),uL=1e-12;function dL(e){return((e=Math.exp(e))+1/e)/2}function fL(e){return((e=Math.exp(e))-1/e)/2}function pL(e){return((e=Math.exp(2*e))-1)/(e+1)}var mL=(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<uL)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=dL(y),c=s/(n*g)*(i*pL(t*r+y)-fL(y));return[a+c*d,o+c*f,s*i/dL(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),hL=0,gL=0,_L=0,vL=1e3,yL,bL,xL=0,SL=0,CL=0,wL=typeof performance==`object`&&performance.now?performance:Date,TL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function EL(){return SL||=(TL(DL),wL.now()+CL)}function DL(){SL=0}function OL(){this._call=this._time=this._next=null}OL.prototype=kL.prototype={constructor:OL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?EL():+n)+(t==null?0:+t),!this._next&&bL!==this&&(bL?bL._next=this:yL=this,bL=this),this._call=e,this._time=n,PL()},stop:function(){this._call&&(this._call=null,this._time=1/0,PL())}};function kL(e,t,n){var r=new OL;return r.restart(e,t,n),r}function AL(){EL(),++hL;for(var e=yL,t;e;)(t=SL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hL}function jL(){SL=(xL=wL.now())+CL,hL=gL=0;try{AL()}finally{hL=0,NL(),SL=0}}function ML(){var e=wL.now(),t=e-xL;t>vL&&(CL-=t,xL=e)}function NL(){for(var e,t=yL,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:yL=n);bL=e,PL(r)}function PL(e){hL||(gL&&=clearTimeout(gL),e-SL>24?(e<1/0&&(gL=setTimeout(jL,e-wL.now()-CL)),_L&&=clearInterval(_L)):(_L||=(xL=wL.now(),setInterval(ML,vL)),hL=1,TL(jL)))}function FL(e,t,n){var r=new OL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var IL=NN(`start`,`end`,`cancel`,`interrupt`),LL=[];function RL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;HL(e,n,{name:t,index:r,group:i,on:IL,tween:LL,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function zL(e,t){var n=VL(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function BL(e,t){var n=VL(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function VL(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function HL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=kL(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 FL(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(FL(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 UL(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 WL(e){return this.each(function(){UL(this,e)})}function GL(e,t){var n,r;return function(){var i=BL(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 KL(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=BL(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 qL(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=VL(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?GL:KL)(n,e,t))}function JL(e,t,n){var r=e._id;return e.each(function(){var e=BL(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return VL(e,r).value[t]}}function YL(e,t){var n;return(typeof t==`number`?qI:t instanceof vI?HI:(n=vI(t))?(t=n,HI):$I)(e,t)}function XL(e){return function(){this.removeAttribute(e)}}function ZL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QL(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 $L(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 eR(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 tR(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 nR(e,t){var n=zN(e),r=n===`transform`?lL:YL;return this.attrTween(e,typeof t==`function`?(n.local?tR:eR)(n,r,JL(this,`attr.`+e,t)):t==null?(n.local?ZL:XL)(n):(n.local?$L:QL)(n,r,t))}function rR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function iR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&iR(e,i)),n}return i._value=t,i}function oR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&rR(e,i)),n}return i._value=t,i}function sR(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=zN(e);return this.tween(n,(r.local?aR:oR)(r,t))}function cR(e,t){return function(){zL(this,e).delay=+t.apply(this,arguments)}}function lR(e,t){return t=+t,function(){zL(this,e).delay=t}}function uR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?cR:lR)(t,e)):VL(this.node(),t).delay}function dR(e,t){return function(){BL(this,e).duration=+t.apply(this,arguments)}}function fR(e,t){return t=+t,function(){BL(this,e).duration=t}}function pR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?dR:fR)(t,e)):VL(this.node(),t).duration}function mR(e,t){if(typeof t!=`function`)throw Error();return function(){BL(this,e).ease=t}}function hR(e){var t=this._id;return arguments.length?this.each(mR(t,e)):VL(this.node(),t).ease}function gR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();BL(this,e).ease=n}}function _R(e){if(typeof e!=`function`)throw Error();return this.each(gR(this._id,e))}function vR(e){typeof e!=`function`&&(e=ZN(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 qR(r,this._parents,this._name,this._id)}function yR(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 qR(o,this._parents,this._name,this._id)}function bR(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 xR(e,t,n){var r,i,a=bR(t)?zL:BL;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function SR(e,t){var n=this._id;return arguments.length<2?VL(this.node(),n).on.on(e):this.each(xR(n,e,t))}function CR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function wR(){return this.on(`end.remove`,CR(this._id))}function TR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=WN(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,RL(l[f],t,n,f,l,VL(u,n)));return new qR(a,this._parents,t,n)}function ER(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=JN(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=VL(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&RL(p,t,n,h,f,m);a.push(f),o.push(u)}return new qR(a,o,t,n)}var DR=PF.prototype.constructor;function OR(){return new DR(this._groups,this._parents)}function kR(e,t){var n,r,i;return function(){var a=VP(this,e),o=(this.style.removeProperty(e),VP(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function AR(e){return function(){this.style.removeProperty(e)}}function jR(e,t,n){var r,i=n+``,a;return function(){var o=VP(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function MR(e,t,n){var r,i,a;return function(){var o=VP(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),VP(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function NR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=BL(this,e),l=c.on,u=c.value[a]==null?s||=AR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function PR(e,t,n){var r=(e+=``)==`transform`?cL:YL;return t==null?this.styleTween(e,kR(e,r)).on(`end.style.`+e,AR(e)):typeof t==`function`?this.styleTween(e,MR(e,r,JL(this,`style.`+e,t))).each(NR(this._id,e)):this.styleTween(e,jR(e,r,t),n).on(`end.style.`+e,null)}function FR(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function IR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&FR(e,a,n)),r}return a._value=t,a}function LR(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,IR(e,t,n??``))}function RR(e){return function(){this.textContent=e}}function zR(e){return function(){var t=e(this);this.textContent=t??``}}function BR(e){return this.tween(`text`,typeof e==`function`?zR(JL(this,`text`,e)):RR(e==null?``:e+``))}function VR(e){return function(t){this.textContent=e.call(this,t)}}function HR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&VR(r)),t}return r._value=e,r}function UR(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,HR(e))}function WR(){for(var e=this._name,t=this._id,n=YR(),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=VL(c,t);RL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new qR(r,this._parents,e,n)}function GR(){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=BL(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 KR=0;function qR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function JR(e){return PF().transition(e)}function YR(){return++KR}var XR=PF.prototype;qR.prototype=JR.prototype={constructor:qR,select:TR,selectAll:ER,selectChild:XR.selectChild,selectChildren:XR.selectChildren,filter:vR,merge:yR,selection:OR,transition:WR,call:XR.call,nodes:XR.nodes,node:XR.node,size:XR.size,empty:XR.empty,each:XR.each,on:SR,attr:nR,attrTween:sR,style:PR,styleTween:LR,text:BR,textTween:UR,remove:wR,tween:qL,delay:uR,duration:pR,ease:hR,easeVarying:_R,end:GR,[Symbol.iterator]:XR[Symbol.iterator]};function ZR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var QR={time:null,delay:0,duration:250,ease:ZR};function $R(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ez(e){var t,n;e instanceof qR?(t=e._id,e=e._name):(t=YR(),(n=QR).time=EL(),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])&&RL(c,e,t,l,o,n||$R(c,t));return new qR(r,this._parents,e,t)}PF.prototype.interrupt=WL,PF.prototype.transition=ez;var tz=e=>()=>e;function nz(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 rz(e,t,n){this.k=e,this.x=t,this.y=n}rz.prototype={constructor:rz,scale:function(e){return e===1?this:new rz(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new rz(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 iz=new rz(1,0,0);az.prototype=rz.prototype;function az(e){for(;!e.__zoom;)if(!(e=e.parentNode))return iz;return e.__zoom}function oz(e){e.stopImmediatePropagation()}function sz(e){e.preventDefault(),e.stopImmediatePropagation()}function cz(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function lz(){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 uz(){return this.__zoom||iz}function dz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fz(){return navigator.maxTouchPoints||`ontouchstart`in this}function pz(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 mz(){var e=cz,t=lz,n=pz,r=dz,i=fz,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=mL,l=NN(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,uz).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`,uz),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(iz.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 rz(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 rz(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 rz(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=IF(this.that).datum();l.call(e,this.that,new nz(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=RF(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)],UL(this),s.start();sz(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=IF(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=RF(t,i),l=t.clientX,u=t.clientY;UF(t.view),oz(t),a.mouse=[c,this.__zoom.invert(c)],UL(this),a.start();function d(e){if(sz(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]=RF(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),WF(e.view,a.moved),sz(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=RF(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);sz(r),s>0?IF(this).transition().duration(s).call(x,d,c,r):IF(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(oz(t),s=0;s<i;++s)c=r[s],l=RF(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)),UL(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(sz(e),s=0;s<a;++s)c=i[s],l=RF(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(oz(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=RF(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=IF(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:tz(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:tz(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:tz(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:tz([[+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 hz={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.`},gz=[[-1/0,-1/0],[1/0,1/0]],_z=[`Enter`,` `,`Escape`],vz={"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`},yz;(function(e){e.Strict=`strict`,e.Loose=`loose`})(yz||={});var bz;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(bz||={});var xz;(function(e){e.Partial=`partial`,e.Full=`full`})(xz||={});var Sz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Cz;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Cz||={});var wz;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(wz||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var Tz={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top};function Ez(e){return e===null?null:e?`valid`:`invalid`}var Dz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Oz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),kz=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Az=(e,t=[0,0])=>{let{width:n,height:r}=uB(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},jz=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:Kz(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):kz(n)?n:t.nodeLookup.get(n.id)),Wz(e,i?Jz(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),Mz=(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=Wz(n,Jz(e)),r=!0)}),r?Kz(n):{x:0,y:0,width:0,height:0}},Nz=(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=Xz(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},Pz=(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 Fz(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}=uB(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 Iz({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=sB(Mz(Fz(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 Lz({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`,hz.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&lB(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=lB(d)?Bz(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,hz.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 Rz({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=Pz(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 zz=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Bz=(e={x:0,y:0},t,n)=>({x:zz(e.x,t[0][0],t[1][0]-(n?.width??0)),y:zz(e.y,t[0][1],t[1][1]-(n?.height??0))});function Vz(e,t,n){let{width:r,height:i}=uB(n),{x:a,y:o}=n.internals.positionAbsolute;return Bz(e,[[a,o],[a+r,o+i]],t)}var Hz=(e,t,n)=>e<t?zz(Math.abs(e-t),1,t)/t:e>n?-zz(Math.abs(e-n),1,t)/t:0,Uz=(e,t,n=15,r=40)=>[Hz(e.x,r,t.width-r)*n,Hz(e.y,r,t.height-r)*n],Wz=(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)}),Gz=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Kz=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),qz=(e,t=[0,0])=>{let{x:n,y:r}=kz(e)?e.internals.positionAbsolute:Az(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}},Jz=(e,t=[0,0])=>{let{x:n,y:r}=kz(e)?e.internals.positionAbsolute:Az(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)}},Yz=(e,t)=>Kz(Wz(Gz(e),Gz(t))),Xz=(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)},Zz=(e,t)=>Xz(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Qz=e=>$z(e.width)&&$z(e.height)&&$z(e.x)&&$z(e.y),$z=e=>!isNaN(e)&&isFinite(e),eB=(e,t)=>(e,t)=>{},tB=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nB=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?tB(s,o):s},rB=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function iB(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 aB(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=iB(e,n),i=iB(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=iB(e.top??e.y??0,n),i=iB(e.bottom??e.y??0,n),a=iB(e.left??e.x??0,t),o=iB(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 oB(e,t,n,r,i,a){let{x:o,y:s}=rB(e,[t,n,r]),{x:c,y:l}=rB({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 sB=(e,t,n,r,i,a)=>{let o=aB(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=zz(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=oB(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}},cB=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function lB(e){return e!=null&&e!==`parent`}function uB(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function dB(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function fB(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 pB(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function mB(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function hB(e){return{...vz,...e||{}}}function gB(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=SB(e),s=nB({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?tB(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var _B=e=>({width:e.offsetWidth,height:e.offsetHeight}),vB=e=>e?.getRootNode?.()||window?.document,yB=[`INPUT`,`SELECT`,`TEXTAREA`];function bB(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?yB.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var xB=e=>`clientX`in e,SB=(e,t)=>{let n=xB(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)}},CB=(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,..._B(t)}})};function wB({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 TB(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function EB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-TB(t-r,a),n];case $.Right:return[t+TB(r-t,a),n];case $.Top:return[t,n-TB(n-i,a)];case $.Bottom:return[t,n+TB(i-n,a)]}}function DB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=EB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=EB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=wB({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 OB({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 kB({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 AB({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Wz(Jz(e),Jz(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Zz({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Kz(a))>0}var jB=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,MB=(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)),NB=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,hz.error006()),t;let r=n.getEdgeId||jB,i;return i=Dz(e)?{...e}:{...e,id:r(e)},MB(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function PB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=OB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var FB={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},IB=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.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},LB=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function RB({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=FB[t],c=FB[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=IB({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]=OB({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 zB(e,t,n,r){let i=Math.min(LB(e,t)/2,LB(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 BB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=RB({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+=zB(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 VB(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function HB(e){let{sourceNode:t,targetNode:n}=e;if(!VB(t)||!VB(n))return null;let r=t.internals.handleBounds||UB(t.handles),i=n.internals.handleBounds||UB(n.handles),a=GB(r?.source??[],e.sourceHandle),o=GB(e.connectionMode===yz.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,hz.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=WB(t,a,s),u=WB(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function UB(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 WB(e,t,n=$.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??uB(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function GB(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function KB(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function qB(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=KB(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 JB=1e3,YB=10,XB={nodeOrigin:[0,0],nodeExtent:gz,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},ZB={...XB,checkEquality:!0};function QB(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function $B(e,t,n){let r=QB(XB,n);for(let n of e.values())if(n.parentId)iV(n,e,t,r);else{let e=Bz(Az(n,r.nodeOrigin),lB(n.extent)?n.extent:r.nodeExtent,uB(n));n.internals.positionAbsolute=e}}function eV(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 tV(e){return e===`manual`}function nV(e,t,n,r={}){let i=QB(ZB,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!tV(i.zIndexMode)?JB: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=Bz(Az(u,i.nodeOrigin),lB(u.extent)?u.extent:i.nodeExtent,uB(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:eV(u,e),z:aV(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&&iV(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function rV(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 iV(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=QB(XB,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}rV(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*YB),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=oV(e,u,o,s,a&&!tV(c)?JB: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 aV(e,t,n){let r=$z(e.zIndex)?e.zIndex:0;return tV(n)?r:r+(e.selected?t:0)}function oV(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=uB(e),l=Az(e,n),u=lB(e.extent)?Bz(l,e.extent,c):l,d=Bz({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Vz(d,c,t));let f=aV(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function sV(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=Yz(a.get(n.parentId)?.expandedRect??qz(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=uB(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 cV(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=_B(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=lB(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Vz(h,s,n))}else m&&(h=Bz(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:CB(`source`,r.nodeElement,p,d,e.id),target:CB(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&iV(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:qz(g,i)}))}}if(f.length>0){let e=sV(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function lV({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 uV(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 dV(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}`;uV(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),uV(`target`,s,c,e,i,o),t.set(r.id,r)}}function fV(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:fV(n,t):!1}function pV(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 mV(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!fV(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 hV({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 gV({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=tB(a,t);return{x:o.x-a.x,y:o.y-a.y}}function _V({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=IF(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?Gz(Mz(s)):null,x=v&&l?gV({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)}:tB(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}=Lz({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]=hV({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]=Uz(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=gB(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=mV(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=hV({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=ZF().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=gB(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=SB(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=gB(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=SB(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=SB(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]=hV({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||!pV(t,`.${g}`,v))&&(!_||pV(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function vV(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())Zz(i,qz(e))>0&&r.push(e);return r}var yV=250;function bV(e,t,n,r){let i=[],a=1/0,o=vV(e,n,t+yV);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}=WB(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 xV(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,...WB(o,c,c.position,!0)}:c}function SV(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function CV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var wV=()=>!0;function TV(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:_=wV,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=vB(e.target),E=0,D,{x:O,y:k}=SB(e),A=SV(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=xV(i,A,r,c,t);if(!N)return;let P=SB(e,j),F=!1,I=null,ee=!1,L=null;function te(){if(!u||!j)return;let[e,t]=Uz(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(te)}let ne={...N,nodeId:i,type:A,position:N.position},re=c.get(i),ie={inProgress:!0,isValid:null,from:WB(re,ne,$.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:re,to:P,toHandle:null,toPosition:Tz[ne.position],toNode:null,pointer:P};function ae(){M=!0,y(ie),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ae();function oe(e){if(!M){let{x:t,y:n}=SB(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ae()}if(!x()||!ne){se(e);return}let a=b();P=SB(e,j),D=bV(nB(P,a,!1,[1,1]),n,c,ne),F||=(te(),!0);let s=EV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});L=s.handleDomNode,I=s.connection,ee=CV(!!D,s.isValid);let u=c.get(i),f=u?WB(u,ne,$.Left,!0):ie.from,p={...ie,from:f,isValid:ee,to:s.toHandle&&ee?rB({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:ee&&s.toHandle?s.toHandle.position:Tz[ne.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),ie=p}function se(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||L)&&I&&ee&&h?.(I);let{inProgress:t,...n}=ie,r={...n,toPosition:ie.toHandle?ie.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,ee=!1,I=null,L=null,T.removeEventListener(`mousemove`,oe),T.removeEventListener(`mouseup`,se),T.removeEventListener(`touchmove`,oe),T.removeEventListener(`touchend`,se)}}T.addEventListener(`mousemove`,oe),T.addEventListener(`mouseup`,se),T.addEventListener(`touchmove`,oe),T.addEventListener(`touchend`,se)}function EV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=wV,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}=SB(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=SV(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===yz.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=xV(t,e,a,u,n,!0)}return _}var DV={onPointerDown:TV,isValid:EV};function OV({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=IF(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&&cB()?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=mz().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:RF}}var kV=e=>({x:e.x,y:e.y,zoom:e.k}),AV=({x:e,y:t,zoom:n})=>iz.translate(e,t).scale(n),jV=(e,t)=>e.target.closest(`.${t}`),MV=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),NV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,PV=(e,t=0,n=NV,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},FV=e=>{let t=e.ctrlKey&&cB()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function IV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(jV(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=RF(u),t=d*2**FV(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===bz.Vertical?0:u.deltaX*f,m=i===bz.Horizontal?0:u.deltaY*f;!cB()&&u.shiftKey&&i!==bz.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=kV(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 LV({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=jV(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function RV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=kV(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 zV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&MV(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,kV(a.transform))}}function BV({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&MV(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=kV(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function VV({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`&&(jV(d,`${l}-flow__node`)||jV(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||jV(d,s)&&m||jV(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 HV({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=mz().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=IF(e).call(f);y({x:i.x,y:i.y,zoom:zz(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(FV);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?eL:mL).transform(PV(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:!$z(E)||E<0?0:E);let k=O?IV({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):LV({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=RV({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=zV({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=BV({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=VV({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=AV(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=AV(e);return await g(n,t),n}function x(e){if(p){let t=AV(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?az(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`?eL:mL).scaleTo(PV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?eL:mL).scaleBy(PV(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=!$z(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 UV;(function(e){e.Line=`line`,e.Handle=`handle`})(UV||={});function WV({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 GV(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 KV(e,t){return Math.max(0,t-e)}function qV(e,t){return Math.max(0,e-t)}function JV(e,t,n){return Math.max(0,t-e,e-n)}function YV(e,t){return e?!t:t}function XV(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=JV(E,h,g),j=JV(D,_,v);if(o){let e=0,t=0;c&&w<0?e=KV(y+w+O,o[0][0]):!c&&w>0&&(e=qV(y+E+O,o[1][0])),l&&T<0?t=KV(b+T+k,o[0][1]):!l&&T>0&&(t=qV(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=qV(y+w,s[0][0]):!c&&w<0&&(e=KV(y+E,s[1][0])),l&&T>0?t=qV(b+T,s[0][1]):!l&&T<0&&(t=KV(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=JV(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?qV(b+k+E/C,o[1][1])*C:KV(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?KV(b+E/C,s[1][1])*C:qV(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=JV(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?qV(y+D*C+O,o[1][0])/C:KV(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?KV(y+D*C,s[1][0])/C:qV(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=(YV(c,l)?-w:w)/C:w=(YV(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 ZV={width:0,height:0,x:0,y:0},QV={...ZV,pointerX:0,pointerY:0,aspectRatio:1};function $V(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 eH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=IF(e),o={controlDirection:GV(`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={...ZV},h={...QV};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:GV(e)};let g,_=null,v=[],y,b,x,S=!1,C=ZF().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}=gB(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=lB(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=$V(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=gB(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}=XV(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=WV({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 tH=Pe((e=>{var t=Ie();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})),nH=Pe(((e,t)=>{t.exports=tH()})),rH=Pe((e=>{var t=Ie(),n=nH();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}})),iH=s(Pe(((e,t)=>{t.exports=rH()}))(),1),aH=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},oH=e=>e?aH(e):aH,{useDebugValue:sH}=z.default,{useSyncExternalStoreWithSelector:cH}=iH.default,lH=e=>e;function uH(e,t=lH,n){let r=cH(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return sH(r),r}var dH=(e,t)=>{let n=oH(e),r=(e,r=t)=>uH(n,e,r);return Object.assign(r,n),r},fH=(e,t)=>e?dH(e,t):dH;function pH(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 mH=(0,z.createContext)(null),hH=mH.Provider,gH=hz.error001(`react`);function _H(e,t){let n=(0,z.useContext)(mH);if(n===null)throw Error(gH);return uH(n,e,t)}function vH(){let e=(0,z.useContext)(mH);if(e===null)throw Error(gH);return(0,z.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var yH={display:`none`},bH={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},xH=`react-flow__node-desc`,SH=`react-flow__edge-desc`,CH=`react-flow__aria-live`,wH=e=>e.ariaLiveMessage,TH=e=>e.ariaLabelConfig;function EH({rfId:e}){let t=_H(wH);return(0,B.jsx)(`div`,{id:`${CH}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:bH,children:t})}function DH({rfId:e,disableKeyboardA11y:t}){let n=_H(TH);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{id:`${xH}-${e}`,style:yH,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,B.jsx)(`div`,{id:`${SH}-${e}`,style:yH,children:n[`edge.a11yDescription.default`]}),!t&&(0,B.jsx)(EH,{rfId:e})]})}var OH=(0,z.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,B.jsx)(`div`,{className:jN([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));OH.displayName=`Panel`;var kH=`https://reactflow.dev?utm_source=attribution`;function AH({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,B.jsx)(OH,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kH}`,children:(0,B.jsx)(`a`,{href:kH,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var jH=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}},MH=e=>e.id;function NH(e,t){return pH(e.selectedNodes.map(MH),t.selectedNodes.map(MH))&&pH(e.selectedEdges.map(MH),t.selectedEdges.map(MH))}function PH({onSelectionChange:e}){let t=vH(),{selectedNodes:n,selectedEdges:r}=_H(jH,NH);return(0,z.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var FH=e=>!!e.onSelectionChangeHandlers;function IH({onSelectionChange:e}){let t=_H(FH);return e||t?(0,B.jsx)(PH,{onSelectionChange:e}):null}var LH=[0,0],RH={x:0,y:0,zoom:1},zH=[...`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`],BH=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}),VH={translateExtent:gz,nodeOrigin:LH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function HH(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=_H(BH,pH),l=vH();(0,z.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=VH,s()}),[]);let u=(0,z.useRef)(VH);return(0,z.useEffect)(()=>{for(let s of zH){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:hB(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},zH.map(t=>e[t])),null}function UH(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function WH(e){let[t,n]=(0,z.useState)(e===`system`?null:e);return(0,z.useEffect)(()=>{if(e!==`system`){n(e);return}let t=UH(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?UH()?.matches?`dark`:`light`:t}var GH=typeof document<`u`?document:null;function KH(e=null,t={target:GH,actInsideInputWithModifier:!0}){let[n,r]=(0,z.useState)(!1),i=(0,z.useRef)(!1),a=(0,z.useRef)(new Set([])),[o,s]=(0,z.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
83
83
  `).replace(`
84
84
 
85
85
  `,`
86
86
  +`).split(`
87
- `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,z.useEffect)(()=>{let n=t?.target??BH,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)&&hB(e))return!1;let n=UH(e.code,s);if(a.current.add(e[n]),HH(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=UH(e.code,s);HH(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 HH(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function UH(e,t){return t.includes(e)?`code`:`key`}var WH=()=>{let e=pH();return(0,z.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=nB(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 Zz(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=Qz(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function GH(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)KH(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 KH(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 qH(e,t){return GH(e,t)}function JH(e,t){return GH(e,t)}function YH(e,t){return{id:e,type:`select`,selected:t}}function XH(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(YH(a.id,e)))}return r}function ZH({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 QH(e){return{id:e.id,type:`remove`}}var $H=Yz(`React Flow`,`https://reactflow.dev/`);function eU(e,t,n={}){return OB(e,t,{...n,onError:n.onError??$H})}var tU=e=>Cz(e),nU=e=>Sz(e);function rU(e){return(0,z.forwardRef)(e)}var iU=typeof window<`u`?z.useLayoutEffect:z.useEffect;function aU(e){let[t,n]=(0,z.useState)(BigInt(0)),[r]=(0,z.useState)(()=>oU(()=>n(e=>e+BigInt(1))));return iU(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function oU(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var sU=(0,z.createContext)(null);function cU({children:e}){let t=pH(),n=aU((0,z.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=ZH({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=aU((0,z.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(ZH({items:s,lookup:o}))},[])),i=(0,z.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,B.jsx)(sU.Provider,{value:i,children:e})}function lU(){let e=(0,z.useContext)(sU);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var uU=e=>!!e.panZoom;function dU(){let e=WH(),t=pH(),n=lU(),r=fH(uU),i=(0,z.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=tU(e)?e:n.get(e.id),a=i.parentId?sB(i.position,i.measured,i.parentId,n,r):i.position;return Hz({...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&&tU(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&&nU(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 Nz({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(QH);o?.(f),c(e)}if(m){let e=d.map(QH);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=qz(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=Hz(s?r:a),l=Kz(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=qz(e)?e:a(e);if(!r)return!1;let i=Kz(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 Ez(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??lB();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,z.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var fU=e=>e.selected,pU=typeof window<`u`?window:void 0;function mU({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=pH(),{deleteElements:r}=dU(),i=VH(e,{actInsideInputWithModifier:!1}),a=VH(t,{target:pU});(0,z.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(fU),edges:e.filter(fU)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,z.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function hU(e){let t=pH();(0,z.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=fB(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,uz.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 gU={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},_U=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function vU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=hz.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=pH(),S=(0,z.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=fH(_U,cH),E=VH(f),D=(0,z.useRef)();hU(S);let O=(0,z.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,z.useEffect)(()=>{if(S.current){D.current=LV({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,z.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,B.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:gU,children:m})}var yU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function bU(){let{userSelectionActive:e,userSelectionRect:t}=fH(yU,cH);return e&&t?(0,B.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 xU=(e,t)=>n=>{n.target===t.current&&e?.(n)},SU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function CU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=gz.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,z.useRef)(0),_=pH(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=fH(SU,cH),C=y&&(e||v),w=(0,z.useRef)(null),T=(0,z.useRef)(),E=(0,z.useRef)(new Set),D=(0,z.useRef)(new Set),O=(0,z.useRef)(!1),k=(0,z.useRef)(!1),A=(0,z.useRef)({x:0,y:0}),j=(0,z.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}=_B(n.nativeEvent,T.current),l=Zz({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 ee(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}=Qz(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(Oz(a,m,i,n===gz.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)}}cB(h,E.current)||c(XH(a,E.current,!0)),cB(g,D.current)||l(XH(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function L(){if(!i||!T.current)return;let[e,t]=Rz(A.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(L);return}let{x:t,y:n}=A.current;ee(t,n),g.current=requestAnimationFrame(L)})}let te=()=>{cancelAnimationFrame(g.current),g.current=0,j.current=!1};return(0,z.useEffect)(()=>()=>te(),[]),(0,B.jsxs)(`div`,{className:EN([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:b,selection:e}]),onClick:C?void 0:xU(M,w),onContextMenu:xU(N,w),onWheel:xU(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}=_B(e.nativeEvent,T.current);A.current={x:o,y:c};let l=Qz({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||=(L(),!0),ee(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})),te())},onPointerCancel:C?e=>{e.target?.releasePointerCapture?.(e.pointerId),te()}:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?F:void 0,onPointerLeave:m,ref:w,style:gU,children:[h,(0,B.jsx)(bU,{})]})}function wU({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`,uz.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function TU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=pH(),[c,l]=(0,z.useState)(!1),u=(0,z.useRef)();return(0,z.useEffect)(()=>{if(!t)return u.current=fV({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{wU({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,z.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 EU=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function DU(){let e=pH();return(0,z.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=EU(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=Xz(t,i));let{position:a,positionAbsolute:s}=Mz({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 OU=(0,z.createContext)(null),kU=OU.Provider;OU.Consumer;var AU=()=>(0,z.useContext)(OU),jU=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),MU=(0,z.createContext)(null);function NU({children:e}){let t=fH(jU,cH);return(0,B.jsx)(MU.Provider,{value:t,children:e})}function PU(){let e=(0,z.useContext)(MU);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var FU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},IU=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return FU;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===mz.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function LU({type:e=`source`,position:t=$.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=pH(),_=AU(),{connectOnClick:v,noPanClassName:y,rfId:b}=PU(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=fH(IU(_,m,e),cH);_||g.getState().onError?.(`010`,uz.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(eU(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=gB(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();SV.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,B.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:EN([`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=pB(t.target),h=n||c,{connection:v,isValid:y}=SV.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 RU=(0,z.memo)(rU(LU));function zU({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[e?.label,(0,B.jsx)(RU,{type:`source`,position:n,isConnectable:t})]})}function BU({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(RU,{type:`target`,position:n,isConnectable:t}),e?.label,(0,B.jsx)(RU,{type:`source`,position:r,isConnectable:t})]})}function VU(){return null}function HU({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(RU,{type:`target`,position:n,isConnectable:t}),e?.label]})}var UU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},WU={input:zU,default:BU,output:HU,group:VU};function GU(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 KU=e=>{let{width:t,height:n,x:r,y:i}=Dz(e.nodeLookup,{filter:e=>!!e.selected});return{width:Jz(t)?t:null,height:Jz(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 qU({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=pH(),{width:i,height:a,transformString:o,userSelectionActive:s}=fH(KU,cH),c=DU(),l=(0,z.useRef)(null);(0,z.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(TU({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,B.jsx)(`div`,{className:EN([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,B.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(UU,e.key)&&(e.preventDefault(),c({direction:UU[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var JU=typeof window<`u`?window:void 0,YU=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function XU({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:ee,userSelectionActive:L}=fH(YU,cH),te=VH(l,{target:JU}),ne=VH(h,{target:JU}),re=ne||w,ie=ne||b,ae=u&&re!==!0,oe=te||L||ae;return mU({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,B.jsx)(vU,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ie,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!te&&re,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:ae,children:(0,B.jsxs)(CU,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:re,autoPanOnSelection:T,isSelecting:!!oe,selectionMode:d,selectionKeyPressed:te,paneClickDistance:s,selectionOnDrag:ae,children:[e,ee&&(0,B.jsx)(qU,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}XU.displayName=`FlowRenderer`;var ZU=(0,z.memo)(XU),QU=e=>t=>e?Oz(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 $U(e){return fH((0,z.useCallback)(QU(e),[e]),cH)}var eW=e=>e.updateNodeInternals;function tW(){let e=fH(eW),[t]=(0,z.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,z.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function nW({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=pH(),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(e.sourcePosition),c=(0,z.useRef)(e.targetPosition),l=(0,z.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,z.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,z.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,z.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 rW({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}=fH(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},cH),S=y.type||`default`,C=g?.[S]||WU[S];C===void 0&&(v?.(`003`,uz.error003(S)),S=`default`,C=g?.default||WU.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=pH(),k=oB(y),A=nW({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=TU({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=DU();if(y.hidden)return null;let N=aB(y),P=GU(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,ee=r?e=>r(e,{...b.userNode}):void 0,L=i?e=>i(e,{...b.userNode}):void 0,te=a?e=>a(e,{...b.userNode}):void 0,ne=o?e=>o(e,{...b.userNode}):void 0,re=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&wU({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},ie=t=>{if(!(hB(t.nativeEvent)||m)){if(fz.includes(t.key)&&T){let n=t.key===`Escape`;wU({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(UU,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:UU[t.key],factor:t.shiftKey?4:1})}}},ae=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Oz(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,B.jsx)(`div`,{className:EN([`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:ee,onMouseLeave:L,onContextMenu:te,onClick:re,onDoubleClick:ne,onKeyDown:D?ie:void 0,tabIndex:D?0:void 0,onFocus:D?ae:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${gH}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,B.jsx)(kU,{value:e,children:(0,B.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 iW=(0,z.memo)(rW),aW=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function oW(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=fH(aW,cH),a=$U(e.onlyRenderVisibleElements),o=tW();return(0,B.jsx)(`div`,{className:`react-flow__nodes`,style:gU,children:a.map(a=>(0,B.jsx)(iW,{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))})}oW.displayName=`NodeRenderer`;var sW=(0,z.memo)(oW);function cW(e){return fH((0,z.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&&TB({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),cH)}var lW=({color:e=`none`,strokeWidth:t=1})=>(0,B.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),uW=({color:e=`none`,strokeWidth:t=1})=>(0,B.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`}),dW={[yz.Arrow]:lW,[yz.ArrowClosed]:uW};function fW(e){let t=pH();return(0,z.useMemo)(()=>Object.prototype.hasOwnProperty.call(dW,e)?dW[e]:(t.getState().onError?.(`009`,uz.error009(e)),null),[e])}var pW=({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=fW(t);return c?(0,B.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,B.jsx)(c,{color:n,strokeWidth:o})}):null},mW=({defaultColor:e,rfId:t})=>{let n=fH(e=>e.edges),r=fH(e=>e.defaultEdgeOptions),i=(0,z.useMemo)(()=>HB(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,B.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,B.jsx)(`defs`,{children:i.map(e=>(0,B.jsx)(pW,{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};mW.displayName=`MarkerDefinitions`;var hW=(0,z.memo)(mW);function gW({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,z.useState)({x:1,y:0,width:0,height:0}),p=EN([`react-flow__edge-textwrapper`,l]),m=(0,z.useRef)(null);return(0,z.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,B.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,B.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,B.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}gW.displayName=`EdgeText`;var _W=(0,z.memo)(gW);function vW({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{...u,d:e,fill:`none`,className:EN([`react-flow__edge-path`,u.className])}),l?(0,B.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Jz(t)&&Jz(n)?(0,B.jsx)(_W,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function yW({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function bW({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=yW({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=yW({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=yB({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 xW(e){return(0,z.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]=bW({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,B.jsx)(vW,{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 SW=xW({isInternal:!1}),CW=xW({isInternal:!0});SW.displayName=`SimpleBezierEdge`,CW.displayName=`SimpleBezierEdgeInternal`;function wW(e){return(0,z.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=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=FB({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,B.jsx)(vW,{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 TW=wW({isInternal:!1}),EW=wW({isInternal:!0});TW.displayName=`SmoothStepEdge`,EW.displayName=`SmoothStepEdgeInternal`;function DW(e){return(0,z.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,B.jsx)(TW,{...n,id:r,pathOptions:(0,z.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var OW=DW({isInternal:!1}),kW=DW({isInternal:!0});OW.displayName=`StepEdge`,kW.displayName=`StepEdgeInternal`;function AW(e){return(0,z.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]=kB({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,B.jsx)(vW,{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 jW=AW({isInternal:!1}),MW=AW({isInternal:!0});jW.displayName=`StraightEdge`,MW.displayName=`StraightEdgeInternal`;function NW(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.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]=SB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,B.jsx)(vW,{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 PW=NW({isInternal:!1}),FW=NW({isInternal:!0});PW.displayName=`BezierEdge`,FW.displayName=`BezierEdgeInternal`;var IW={default:FW,straight:MW,step:kW,smoothstep:EW,simplebezier:CW},LW={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},RW=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,zW=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,BW=`react-flow__edgeupdater`;function VW({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,B.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:EN([BW,`${BW}-${s}`]),cx:RW(t,r,e),cy:zW(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function HW({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=pH(),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`;SV.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,B.jsxs)(B.Fragment,{children:[(e===!0||e===`source`)&&(0,B.jsx)(VW,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,B.jsx)(VW,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function UW({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=fH(t=>t.edgeLookup.get(e)),b=fH(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||IW[x];S===void 0&&(_?.(`011`,uz.error011(x)),x=`default`,S=h?.default||IW.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,z.useRef)(null),[D,O]=(0,z.useState)(!1),[k,A]=(0,z.useState)(!1),j=pH(),{zIndex:M=y.zIndex,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:ee,targetPosition:L}=fH((0,z.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return LW;let i=LB({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=wB({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||LW,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),cH),te=(0,z.useMemo)(()=>y.markerStart?`url('#${VB(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ne=(0,z.useMemo)(()=>y.markerEnd?`url('#${VB(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||F===null||I===null)return null;let re=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)},ie=a?e=>{a(e,{...y})}:void 0,ae=o?e=>{o(e,{...y})}:void 0,oe=s?e=>{s(e,{...y})}:void 0,se=c?e=>{c(e,{...y})}:void 0,ce=l?e=>{l(e,{...y})}:void 0;return(0,B.jsx)(`svg`,{style:{zIndex:M},children:(0,B.jsxs)(`g`,{className:EN([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:re,onDoubleClick:ie,onContextMenu:ae,onMouseEnter:oe,onMouseMove:se,onMouseLeave:ce,onKeyDown:C?t=>{if(!v&&fz.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?`${_H}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,B.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:ee,targetPosition:L,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:te,markerEnd:ne,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,B.jsx)(HW,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:ee,targetPosition:L,setUpdateHover:O,setReconnecting:A})]})})}var WW=(0,z.memo)(UW),GW=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function KW({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}=fH(GW,cH),b=cW(t);return(0,B.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,B.jsx)(hW,{defaultColor:e,rfId:n}),b.map(e=>(0,B.jsx)(WW,{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))]})}KW.displayName=`EdgeRenderer`;var qW=(0,z.memo)(KW),JW=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function YW({children:e}){let t=pH(),n=(0,z.useRef)(null),[r]=(0,z.useState)(()=>t.getState().transform);return iU(()=>{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=JW(r)))};return r(),t.subscribe(r)},[t]),(0,B.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:JW(r)},children:e})}function XW(e){let t=dU(),n=(0,z.useRef)(!1);(0,z.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var ZW=e=>e.panZoom?.syncViewport;function QW(e){let t=fH(ZW),n=pH();return(0,z.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function $W(e){return e.connection.inProgress?{...e.connection,to:Zz(e.connection.to,e.transform)}:{...e.connection}}function eG(e){return e?t=>e($W(t)):$W}function tG(e){return fH(eG(e),cH)}var nG=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function rG({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=fH(nG,cH);return a&&i&&c?(0,B.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,B.jsx)(`g`,{className:EN([`react-flow__connection`,xz(s)]),children:(0,B.jsx)(iG,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var iG=({style:e,type:t=vz.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}=tG();if(!i)return;if(n)return(0,B.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:xz(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 vz.Bezier:[m]=SB(h);break;case vz.SimpleBezier:[m]=bW(h);break;case vz.Step:[m]=FB({...h,borderRadius:0});break;case vz.SmoothStep:[m]=FB(h);break;default:[m]=kB(h)}return(0,B.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};iG.displayName=`ConnectionLine`;var aG={};function oG(e=aG){(0,z.useRef)(e),pH(),(0,z.useEffect)(()=>{},[e])}function sG(){pH(),(0,z.useRef)(!1),(0,z.useEffect)(()=>{},[])}function cG({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:ee,zoomOnDoubleClick:L,panOnDrag:te,autoPanOnSelection:ne,onPaneClick:re,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:oe,onPaneScroll:se,onPaneContextMenu:ce,paneClickDistance:le,nodeClickDistance:ue,onEdgeContextMenu:de,onEdgeMouseEnter:fe,onEdgeMouseMove:pe,onEdgeMouseLeave:me,reconnectRadius:he,onReconnect:ge,onReconnectStart:_e,onReconnectEnd:ve,noDragClassName:ye,noWheelClassName:be,noPanClassName:xe,disableKeyboardA11y:Se,nodeExtent:Ce,rfId:we,viewport:R,onViewportChange:Te,nodesDraggable:Ee}){return oG(e),oG(t),sG(),XW(n),QW(R),(0,B.jsx)(ZU,{onPaneClick:re,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:oe,onPaneContextMenu:ce,onPaneScroll:se,paneClickDistance:le,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:L,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:ee,panOnDrag:te,autoPanOnSelection:ne,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ye,noWheelClassName:be,noPanClassName:xe,disableKeyboardA11y:Se,onViewportChange:Te,isControlledViewport:!!R,children:(0,B.jsxs)(YW,{children:[(0,B.jsx)(qW,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ge,onReconnectStart:_e,onReconnectEnd:ve,onlyRenderVisibleElements:T,onEdgeContextMenu:de,onEdgeMouseEnter:fe,onEdgeMouseMove:pe,onEdgeMouseLeave:me,reconnectRadius:he,defaultMarkerColor:M,noPanClassName:xe,disableKeyboardA11y:Se,rfId:we}),(0,B.jsx)(rG,{style:h,type:m,component:g,containerStyle:_}),(0,B.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,B.jsx)(sW,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ue,onlyRenderVisibleElements:T,noPanClassName:xe,noDragClassName:ye,disableKeyboardA11y:Se,nodeExtent:Ce,rfId:we,nodesDraggable:Ee}),(0,B.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}cG.displayName=`GraphView`;var lG=(0,z.memo)(cG),uG=Yz(`React Flow`,`https://reactflow.dev/`),dG=({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??dz;oV(h,g,_);let{nodesInitialized:x}=ZB(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=nB(Dz(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:dz,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:mz.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:{..._z},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:uG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:pz,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},fG=({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})=>sH((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 jz({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...dG({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}=ZB(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();oV(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}=rV(e,n,r,i,a,o,l);d&&(JB(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=zB(e,o.fromHandle,$.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=nV(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(qH(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(JH(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=>YH(e,!0)));return}i(XH(r,new Set([...e]),!0)),a(XH(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>YH(e,!0)));return}a(XH(n,new Set([...e]))),i(XH(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(YH(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(YH(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,YH(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,YH(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]||(ZB(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 iV({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:{..._z}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...dG()})}},Object.is);function pG({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,z.useState)(()=>fG({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,B.jsx)(uH,{value:m,children:(0,B.jsx)(cU,{children:(0,B.jsx)(NU,{children:p})})})}function mG({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,z.useContext)(lH)?(0,B.jsx)(B.Fragment,{children:e}):(0,B.jsx)(pG,{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 hG={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function gG({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:ee,connectionLineType:L=vz.Bezier,connectionLineStyle:te,connectionLineComponent:ne,connectionLineContainerStyle:re,deleteKeyCode:ie=`Backspace`,selectionKeyCode:ae=`Shift`,selectionOnDrag:oe=!1,selectionMode:se=gz.Full,panActivationKeyCode:ce=`Space`,multiSelectionKeyCode:le=rB()?`Meta`:`Control`,zoomActivationKeyCode:ue=rB()?`Meta`:`Control`,snapToGrid:de,snapGrid:fe,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:me,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,nodeOrigin:ye=MH,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se=!0,defaultViewport:Ce=NH,minZoom:we=.5,maxZoom:R=2,translateExtent:Te=dz,preventScrolling:Ee=!0,nodeExtent:De,defaultMarkerColor:Oe=`#b1b1b7`,zoomOnScroll:ke=!0,zoomOnPinch:Ae=!0,panOnScroll:je=!1,panOnScrollSpeed:Me=.5,panOnScrollMode:Ne=hz.Free,zoomOnDoubleClick:Pe=!0,panOnDrag:Fe=!0,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He=1,nodeClickDistance:Ue=0,children:We,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e=10,onNodesChange:et,onEdgesChange:tt,noDragClassName:nt=`nodrag`,noWheelClassName:rt=`nowheel`,noPanClassName:it=`nopan`,fitView:at,fitViewOptions:ot,connectOnClick:st,attributionPosition:ct,proOptions:lt,defaultEdgeOptions:ut,elevateNodesOnSelect:dt=!0,elevateEdgesOnSelect:ft=!1,disableKeyboardA11y:pt=!1,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanOnSelection:gt=!0,autoPanSpeed:_t,connectionRadius:vt,isValidConnection:yt,onError:bt,style:xt,id:St,nodeDragThreshold:Ct,connectionDragThreshold:wt,viewport:Tt,onViewportChange:Et,width:Dt,height:Ot,colorMode:kt=`light`,debug:At,onScroll:jt,ariaLabelConfig:Mt,zIndexMode:Nt=`basic`,...Pt},Ft){let It=St||`1`,Lt=zH(kt),Rt=(0,z.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),jt?.(e)},[jt]);return(0,B.jsx)(`div`,{"data-testid":`rf__wrapper`,...Pt,onScroll:Rt,style:{...xt,...hG},ref:Ft,className:EN([`react-flow`,i,Lt]),id:St,role:`application`,children:(0,B.jsxs)(mG,{nodes:e,edges:t,width:Dt,height:Ot,fitView:at,fitViewOptions:ot,minZoom:we,maxZoom:R,nodeOrigin:ye,nodeExtent:De,zIndexMode:Nt,children:[(0,B.jsx)(LH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se,elevateNodesOnSelect:dt,elevateEdgesOnSelect:ft,minZoom:we,maxZoom:R,nodeExtent:De,onNodesChange:et,onEdgesChange:tt,snapToGrid:de,snapGrid:fe,connectionMode:ee,translateExtent:Te,connectOnClick:st,defaultEdgeOptions:ut,fitView:at,fitViewOptions:ot,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:it,nodeOrigin:ye,rfId:It,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanSpeed:_t,onError:bt,connectionRadius:vt,isValidConnection:yt,selectNodesOnDrag:me,nodeDragThreshold:Ct,connectionDragThreshold:wt,onBeforeDelete:I,debug:At,ariaLabelConfig:Mt,zIndexMode:Nt}),(0,B.jsx)(lG,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:L,connectionLineStyle:te,connectionLineComponent:ne,connectionLineContainerStyle:re,selectionKeyCode:ae,selectionOnDrag:oe,selectionMode:se,deleteKeyCode:ie,multiSelectionKeyCode:le,panActivationKeyCode:ce,zoomActivationKeyCode:ue,onlyRenderVisibleElements:pe,defaultViewport:Ce,translateExtent:Te,minZoom:we,maxZoom:R,preventScrolling:Ee,zoomOnScroll:ke,zoomOnPinch:Ae,zoomOnDoubleClick:Pe,panOnScroll:je,panOnScrollSpeed:Me,panOnScrollMode:Ne,panOnDrag:Fe,autoPanOnSelection:gt,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He,nodeClickDistance:Ue,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e,defaultMarkerColor:Oe,noDragClassName:nt,noWheelClassName:rt,noPanClassName:it,rfId:It,disableKeyboardA11y:pt,nodeExtent:De,viewport:Tt,onViewportChange:Et,nodesDraggable:he}),(0,B.jsx)(jH,{onSelectionChange:k}),We,(0,B.jsx)(TH,{proOptions:lt,position:ct}),(0,B.jsx)(SH,{rfId:It,disableKeyboardA11y:pt})]})})}var _G=rU(gG);uz.error014();function vG({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,B.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:EN([`react-flow__background-pattern`,n,r])})}function yG({radius:e,className:t}){return(0,B.jsx)(`circle`,{cx:e,cy:e,r:e,className:EN([`react-flow__background-pattern`,`dots`,t])})}var bG;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(bG||={});var xG={[bG.Dots]:1,[bG.Lines]:1,[bG.Cross]:6},SG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function CG({id:e,variant:t=bG.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,z.useRef)(null),{transform:f,patternId:p}=fH(SG,cH),m=r||xG[t],h=t===bG.Dots,g=t===bG.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,B.jsxs)(`svg`,{className:EN([`react-flow__background`,l]),style:{...c,...gU,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,B.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,B.jsx)(yG,{radius:y/2,className:u}):(0,B.jsx)(vG,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,B.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}CG.displayName=`Background`;var wG=(0,z.memo)(CG);function TG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,B.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function EG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,B.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function DG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,B.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 OG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.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 kG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.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 AG({children:e,className:t,...n}){return(0,B.jsx)(`button`,{type:`button`,className:EN([`react-flow__controls-button`,t]),...n,children:e})}var jG=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function MG({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=pH(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=fH(jG,cH),{zoomIn:y,zoomOut:b,fitView:x}=dU();return(0,B.jsxs)(CH,{className:EN([`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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(AG,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,B.jsx)(TG,{})}),(0,B.jsx)(AG,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,B.jsx)(EG,{})})]}),n&&(0,B.jsx)(AG,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,B.jsx)(DG,{})}),r&&(0,B.jsx)(AG,{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,B.jsx)(kG,{}):(0,B.jsx)(OG,{})}),u]})}MG.displayName=`Controls`;var NG=(0,z.memo)(MG);function PG({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,B.jsx)(`rect`,{className:EN([`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 FG=(0,z.memo)(PG),IG=e=>e.nodes.map(e=>e.id),LG=e=>e instanceof Function?e:()=>e;function RG({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=FG,onClick:o}){let s=fH(IG,cH),c=LG(t),l=LG(e),u=LG(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,B.jsx)(B.Fragment,{children:s.map(e=>(0,B.jsx)(BG,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function zG({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}=fH(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}=aB(r);return{node:r,x:i,y:a,width:o,height:s}},cH);return!l||l.hidden||!oB(l)?null:(0,B.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 BG=(0,z.memo)(zG),VG=(0,z.memo)(RG),HG=200,UG=150,WG=e=>!e.hidden,GG=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?Wz(Dz(e.nodeLookup,{filter:WG}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},KG=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,qG=(e,t)=>KG(e.viewBB,t.viewBB)&&KG(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,JG=`react-flow__minimap-desc`;function YG({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=pH(),S=(0,z.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=fH(GG,qG),j=e?.width??HG,M=e?.height??UG,N=C.width/j,P=C.height/M,F=Math.max(N,P),I=F*j,ee=F*M,L=b*F,te=C.x-(I-C.width)/2-L,ne=C.y-(ee-C.height)/2-L,re=I+L*2,ie=ee+L*2,ae=`${JG}-${T}`,oe=(0,z.useRef)(0),se=(0,z.useRef)();oe.current=F,(0,z.useEffect)(()=>{if(S.current&&E)return se.current=CV({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>oe.current}),()=>{se.current?.destroy()}},[E]),(0,z.useEffect)(()=>{se.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let ce=p?e=>{let[t,n]=se.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,le=m?(0,z.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,ue=_??A[`minimap.ariaLabel`];return(0,B.jsx)(CH,{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:EN([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,B.jsxs)(`svg`,{width:j,height:M,viewBox:`${te} ${ne} ${re} ${ie}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ae,ref:S,onClick:ce,children:[ue&&(0,B.jsx)(`title`,{id:ae,children:ue}),(0,B.jsx)(VG,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,B.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${te-L},${ne-L}h${re+L*2}v${ie+L*2}h${-re-L*2}z
88
- M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}YG.displayName=`MiniMap`,(0,z.memo)(YG);var XG=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,ZG={[RV.Line]:`right`,[RV.Handle]:`bottom-right`};function QG({nodeId:e,position:t,variant:n=RV.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=AU(),y=typeof e==`string`?e:v,b=pH(),x=(0,z.useRef)(null),S=n===RV.Handle,C=fH((0,z.useCallback)(XG(S&&p),[S,p]),cH),w=(0,z.useRef)(null),T=t??ZG[n];return(0,z.useEffect)(()=>{if(!(!x.current||!y))return w.current||=YV({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=nV([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...sB({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,B.jsx)(`div`,{className:EN([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,z.memo)(QG);var $G={agent:He,human:Tt,command:St,change:Oe};function eK({data:e}){let t=$G[e.kind]??bt,n=e.style===`success`?Ue:e.style===`danger`||e.style===`muted`?Dt:e.style===`active`?Je:tt;return(0,B.jsxs)(`article`,{"aria-label":`${e.label}: ${e.state}`,className:k(`dag-node`,`state-${e.state}`,`token-${e.style}`),"data-selected":e.selected,children:[(0,B.jsx)(RU,{type:`target`,position:$.Left}),(0,B.jsxs)(`div`,{className:`node-heading`,children:[(0,B.jsxs)(T,{className:`node-kind px-1.5 py-0 text-[9px] tracking-[.1em] uppercase`,variant:`outline`,children:[(0,B.jsx)(t,{"aria-label":e.kind,role:`img`,size:10}),e.kind]}),(0,B.jsx)(n,{className:k(e.style===`active`&&`spin`),size:17})]}),(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`span`,{className:`node-status`,children:e.state}),e.reason!==void 0&&(0,B.jsx)(`span`,{className:`node-reason`,title:e.reason,children:e.reason}),e.awaits!==void 0&&(0,B.jsx)(`span`,{className:`node-awaits`,title:e.awaits,children:e.awaits}),(0,B.jsx)(RU,{type:`source`,position:$.Right})]})}function tK({data:e,id:t,markerEnd:n,style:r}){return(0,B.jsx)(vW,{id:t,path:nK(e?.points??[]),markerEnd:n,style:r})}function nK(e){let[t,...n]=e;return t?`M ${t.x} ${t.y} ${n.map(e=>`L ${e.x} ${e.y}`).join(` `)}`:``}function rK({edits:e}){return e===void 0?null:(0,B.jsxs)(`section`,{"aria-labelledby":`rejected-edits-title`,className:`rejected-edits`,children:[(0,B.jsx)(`h2`,{id:`rejected-edits-title`,children:`Refused edits`}),(0,B.jsx)(`ol`,{children:e.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{className:`rejected-edit-what`,children:e.author}),(0,B.jsx)(`span`,{className:`rejected-edit-reason`,children:e.reason})]},`${e.at}:${e.envelope??``}:${e.index??``}`))})]})}var iK={dagNode:eK},aK={routed:tK};function oK({nodes:e,selectedNodeId:t,onSelectNode:n,journalSeq:r,rejectedEdits:i}){let a=(0,z.useMemo)(()=>{let t=new Map;for(let n of e)ye(n.status)&&t.set(n.id,ke(n));return t},[e]),o=(0,z.useMemo)(()=>new Map(e.map(e=>[e.id,De(e)])),[e]),{nodes:s,edges:c}=(0,z.useMemo)(()=>{let n=new Set(e.map(e=>e.id)),r=ce({nodes:e.map(e=>({id:e.id,label:e.label,kind:e.kind,state:e.status,...we(a.get(e.id),o.get(e.id))})),edges:e.flatMap(e=>(e.task?.deps??[]).filter(e=>n.has(e)).map(t=>({id:`${t}->${e.id}`,source:t,target:e.id})))});return{nodes:r.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===t,...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:$.Left,x:0,y:e.height/2,width:0,height:0},{type:`source`,position:$.Right,x:e.width,y:e.height/2,width:0,height:0}]})),edges:r.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,t]);return(0,B.jsxs)(`div`,{className:`graph-wrap`,"data-journal-seq":r,children:[(0,B.jsxs)(_G,{nodes:s,edges:c,colorMode:`dark`,nodeTypes:iK,edgeTypes:aK,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,onInit:e=>void e.fitView(),onNodeClick:(e,t)=>n(t.id),"aria-label":`DAG execution graph`,children:[(0,B.jsx)(wG,{color:`var(--border)`,gap:22}),(0,B.jsx)(NG,{showInteractive:!1})]}),(0,B.jsx)(rK,{edits:i}),(0,B.jsx)(`ol`,{className:`accessible-node-list`,"aria-label":`DAG nodes`,children:e.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(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 sK({value:e,label:t=`Record`}){return e==null?(0,B.jsx)(`span`,{children:`Not recorded`}):typeof e==`boolean`?(0,B.jsx)(`span`,{children:e?`Yes`:`No`}):typeof e==`string`||typeof e==`number`?(0,B.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:String(e)}):Array.isArray(e)?e.length===0?(0,B.jsx)(`span`,{children:`None`}):(0,B.jsx)(`ol`,{"aria-label":t,children:e.map((e,n)=>(0,B.jsx)(`li`,{"aria-label":`${t}.${n}`,children:(0,B.jsx)(sK,{label:`${t}.${n}`,value:e})},n))}):typeof e==`object`?(0,B.jsx)(`div`,{className:`structured-fields`,children:Object.entries(e).map(([e,n])=>(0,B.jsxs)(`fieldset`,{"aria-label":`${t}.${e}`,children:[(0,B.jsx)(`legend`,{children:e.replaceAll(`_`,` `)}),(0,B.jsx)(sK,{label:`${t}.${e}`,value:n})]},e))}):(0,B.jsx)(`span`,{children:`Not recorded`})}function cK(e,t){let[n,r]=(0,z.useState)(0);return{host:CN(`host`,()=>e.host(),n),unwatched:CN(`unwatched`,()=>e.unwatched(),n),refresh:(0,z.useCallback)(()=>{r(e=>e+1),t?.()},[t])}}var lK=[`Run`,`Node`,`Provider`,`Age (ms)`,`Proof`];function uK(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 dK({client:e,onRefresh:t,list:n,rows:r,listError:i,children:a}){let{host:o,unwatched:s,refresh:c}=cK(e,t),l=o.value?.reading;return(0,B.jsx)(pd,{className:`min-h-0 flex-1`,children:(0,B.jsxs)(`section`,{"aria-label":`Host`,className:`channel-view host-page`,children:[(0,B.jsxs)(`h2`,{children:[`This host`,l&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`output`,{"aria-label":`Host name`,className:`host-name`,children:l.host})]})]}),(0,B.jsx)(Vi,{onClick:c,children:`Refresh host`}),(o.error||s.error)&&(0,B.jsx)(`p`,{role:`alert`,children:o.error?.message??s.error?.message}),o.loading&&(0,B.jsx)(`p`,{role:`status`,children:`Reading host…`}),l&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:`Runs root`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Runs root path`,children:l.root})})]}),l.root_error&&(0,B.jsx)(`p`,{role:`alert`,children:l.root_error}),(0,B.jsxs)(`section`,{"aria-label":`Free space`,children:[(0,B.jsx)(`h3`,{children:`Free space`}),l.free_space.map((e,t)=>(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:`Filesystem`}),(0,B.jsx)(`dd`,{children:e.roots.map((e,t)=>(0,B.jsxs)(`span`,{children:[t>0&&` · `,e.role,`:`,` `,(0,B.jsx)(`output`,{"aria-label":`Filesystem root path`,children:e.path??`unresolved`}),e.measured_at&&(0,B.jsxs)(B.Fragment,{children:[` `,`(measured at`,` `,(0,B.jsx)(`output`,{"aria-label":`Measured root ancestor`,children:e.measured_at}),`)`]})]},e.role))}),(0,B.jsx)(`dt`,{children:`Free bytes`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Free capacity bytes`,children:e.free_bytes??`Unknown`})}),(0,B.jsx)(`dt`,{children:`Total bytes`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Total capacity bytes`,children:e.total_bytes??`Unknown`})}),e.error&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:e.error})]})]},e.roots[0]?.path??t))]}),(0,B.jsxs)(`section`,{"aria-label":`Providers and dispatches`,children:[(0,B.jsx)(`h3`,{children:`Providers and dispatches`}),l.dispatches.length===0?(0,B.jsx)(`p`,{children:`No live dispatches`}):(0,B.jsx)(`section`,{"aria-label":`Providers and dispatches table`,className:`host-table`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:lK.map(e=>(0,B.jsx)(`th`,{children:e},e))})}),(0,B.jsx)(`tbody`,{children:l.dispatches.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{"data-label":`Run`,children:e.run}),(0,B.jsx)(`td`,{"data-label":`Node`,children:e.node}),(0,B.jsx)(`td`,{"data-label":`Provider`,children:e.launcher}),(0,B.jsx)(`td`,{"data-label":`Age (ms)`,children:(0,B.jsx)(`output`,{"aria-label":`Dispatch age milliseconds`,className:`host-age`,children:e.age_ms??`Unknown`})}),(0,B.jsxs)(`td`,{"data-label":`Proof`,children:[e.proof,e.unproven&&`: ${e.unproven}`]})]},`${e.run}/${e.node}`))})]})})]}),(0,B.jsxs)(`section`,{"aria-label":`Gone dispatches`,children:[(0,B.jsx)(`h3`,{children:`Gone dispatches`}),l.gone.map(e=>(0,B.jsxs)(`p`,{children:[e.run,` · `,e.node,` · `,e.reason]},`${e.run}/${e.node}`))]}),l.skipped.map(e=>(0,B.jsxs)(`p`,{children:[e.path,`: `,e.reason]},e.path))]}),(0,B.jsxs)(`section`,{"aria-label":`Unwatched runs`,children:[(0,B.jsxs)(`h3`,{children:[`Unwatched runs: `,s.value?.reported.length??`…`]}),s.value?.reported.map(e=>(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:e.run}),(0,B.jsxs)(`dd`,{children:[e.standing,` · `,e.why_not_watched]})]},e.run)),s.value?.unresolved.map(e=>(0,B.jsx)(`p`,{children:e},e))]}),(0,B.jsxs)(`section`,{"aria-label":`Runs on the host`,children:[(0,B.jsx)(`h3`,{children:`Runs on the host`}),i&&(0,B.jsxs)(`p`,{role:`alert`,children:[`Listing unavailable: `,i.message]}),uK(n,r).map(e=>(0,B.jsx)(`p`,{children:[e.run_id,e.state,ee(e.node_counts)].filter(Boolean).join(` · `)},e.run_id))]}),(0,B.jsxs)(`details`,{"aria-label":`Provider health`,children:[(0,B.jsx)(`summary`,{children:`Provider health`}),(0,B.jsx)(sK,{value:n?.provider_health})]}),a]})})}function fK(e,t,n){let{value:r,error:i}=CN(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 pK(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 mK(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function hK(e){return e}var gK=[],_K=`skip`;function vK(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=my(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 (`+hK(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=gK;if(s&&r&&(o=yK(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=yK(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 yK(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?gK:[e]}function bK(e,t,n){let r=my((n||{}).ignore||[]),i=xK(t),a=-1;for(;++a<i.length;)vK(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 _K}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 xK(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([SK(e[0]),CK(e[1])])}return t}function SK(e){return typeof e==`string`?new RegExp(mK(e),`g`):e}function CK(e){return typeof e==`function`?e:function(){return e}}var wK=`phrasing`,TK=[`autolink`,`link`,`image`,`label`];function EK(){return{transforms:[PK],enter:{literalAutolink:OK,literalAutolinkEmail:kK,literalAutolinkHttp:kK,literalAutolinkWww:kK},exit:{literalAutolink:NK,literalAutolinkEmail:MK,literalAutolinkHttp:AK,literalAutolinkWww:jK}}}function DK(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:wK,notInConstruct:TK},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:wK,notInConstruct:TK},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:wK,notInConstruct:TK}]}}function OK(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function kK(e){this.config.enter.autolinkProtocol.call(this,e)}function AK(e){this.config.exit.autolinkProtocol.call(this,e)}function jK(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 MK(e){this.config.exit.autolinkEmail.call(this,e)}function NK(e){this.exit(e)}function PK(e){bK(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,FK],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,RK],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,LK],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,IK]],{ignore:[`link`,`linkReference`]})}function FK(e,t,n,r,i){if(!VK(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),Wh(n.charCodeAt(0))||!zK(n))return!1;let o=BK(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 IK(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 LK(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 RK(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 zK(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 BK(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=pK(e,`(`),a=pK(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 VK(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Gh(t)||Wh(t)}ZK.peek=XK;function HK(){this.buffer()}function UK(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function WK(){this.buffer()}function GK(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function KK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ph(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qK(e){this.exit(e)}function JK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ph(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YK(e){this.exit(e)}function XK(){return`[`}function ZK(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 QK(){return{enter:{gfmFootnoteCallString:HK,gfmFootnoteCall:UK,gfmFootnoteDefinitionLabelString:WK,gfmFootnoteDefinition:GK},exit:{gfmFootnoteCallString:KK,gfmFootnoteCall:qK,gfmFootnoteDefinitionLabelString:JK,gfmFootnoteDefinition:YK}}}function $K(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ZK},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?`
89
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?tq:eq))),s(),o}}function eq(e,t,n){return t===0?e:tq(e,t,n)}function tq(e,t,n){return(n?``:` `)+e}var nq=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];sq.attention=cq,sq.peek=lq;function rq(){return{canContainEols:[`delete`],enter:{strikethrough:aq},exit:{strikethrough:oq}}}function iq(){return{handlers:{delete:sq},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:nq}]}}function aq(e){this.enter({type:`delete`,children:[],position:void 0},e)}function oq(e){this.exit(e)}function sq(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 cq(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function lq(){return`~`}function uq(e){return e.length}function dq(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||uq,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=fq(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]=pq(r[d]);else{let e=pq(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(`
90
- `)}function fq(e){return e==null?``:String(e)}function pq(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 mq(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()),hq);return i(),o}function hq(e,t,n){return`>`+(n?``:` `)+e}function gq(e,t){return _q(e,t.inConstruct,!0)&&!_q(e,t.notInConstruct,!1)}function _q(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 vq(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
91
- `&&gq(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
92
- `}function yq(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 bq(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 xq(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Sq(e,t,n,r){let i=xq(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(bq(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Cq);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(yq(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:`
87
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,z.useEffect)(()=>{let n=t?.target??GH,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)&&bB(e))return!1;let n=JH(e.code,s);if(a.current.add(e[n]),qH(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=JH(e.code,s);qH(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 qH(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function JH(e,t){return t.includes(e)?`code`:`key`}var YH=()=>{let e=vH();return(0,z.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=sB(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 nB(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=rB(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function XH(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)ZH(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 ZH(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 QH(e,t){return XH(e,t)}function $H(e,t){return XH(e,t)}function eU(e,t){return{id:e,type:`select`,selected:t}}function tU(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(eU(a.id,e)))}return r}function nU({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 rU(e){return{id:e.id,type:`remove`}}var iU=eB(`React Flow`,`https://reactflow.dev/`);function aU(e,t,n={}){return NB(e,t,{...n,onError:n.onError??iU})}var oU=e=>Oz(e),sU=e=>Dz(e);function cU(e){return(0,z.forwardRef)(e)}var lU=typeof window<`u`?z.useLayoutEffect:z.useEffect;function uU(e){let[t,n]=(0,z.useState)(BigInt(0)),[r]=(0,z.useState)(()=>dU(()=>n(e=>e+BigInt(1))));return lU(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function dU(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var fU=(0,z.createContext)(null);function pU({children:e}){let t=vH(),n=uU((0,z.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=nU({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=uU((0,z.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(nU({items:s,lookup:o}))},[])),i=(0,z.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,B.jsx)(fU.Provider,{value:i,children:e})}function mU(){let e=(0,z.useContext)(fU);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var hU=e=>!!e.panZoom;function gU(){let e=YH(),t=vH(),n=mU(),r=_H(hU),i=(0,z.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=oU(e)?e:n.get(e.id),a=i.parentId?fB(i.position,i.measured,i.parentId,n,r):i.position;return qz({...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&&oU(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&&sU(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 Rz({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(rU);o?.(f),c(e)}if(m){let e=d.map(rU);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Qz(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=qz(s?r:a),l=Zz(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Qz(e)?e:a(e);if(!r)return!1;let i=Zz(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 jz(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??mB();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,z.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var _U=e=>e.selected,vU=typeof window<`u`?window:void 0;function yU({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=vH(),{deleteElements:r}=gU(),i=KH(e,{actInsideInputWithModifier:!1}),a=KH(t,{target:vU});(0,z.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(_U),edges:e.filter(_U)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,z.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function bU(e){let t=vH();(0,z.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=_B(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,hz.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 xU={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},SU=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function CU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=bz.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=vH(),S=(0,z.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=_H(SU,pH),E=KH(f),D=(0,z.useRef)();bU(S);let O=(0,z.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,z.useEffect)(()=>{if(S.current){D.current=HV({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,z.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,B.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:xU,children:m})}var wU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function TU(){let{userSelectionActive:e,userSelectionRect:t}=_H(wU,pH);return e&&t?(0,B.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 EU=(e,t)=>n=>{n.target===t.current&&e?.(n)},DU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function OU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xz.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,z.useRef)(0),_=vH(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=_H(DU,pH),C=y&&(e||v),w=(0,z.useRef)(null),T=(0,z.useRef)(),E=(0,z.useRef)(new Set),D=(0,z.useRef)(new Set),O=(0,z.useRef)(!1),k=(0,z.useRef)(!1),A=(0,z.useRef)({x:0,y:0}),j=(0,z.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}=SB(n.nativeEvent,T.current),l=nB({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 ee(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}=rB(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(Nz(a,m,i,n===xz.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)}}pB(h,E.current)||c(tU(a,E.current,!0)),pB(g,D.current)||l(tU(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function L(){if(!i||!T.current)return;let[e,t]=Uz(A.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(L);return}let{x:t,y:n}=A.current;ee(t,n),g.current=requestAnimationFrame(L)})}let te=()=>{cancelAnimationFrame(g.current),g.current=0,j.current=!1};return(0,z.useEffect)(()=>()=>te(),[]),(0,B.jsxs)(`div`,{className:jN([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:b,selection:e}]),onClick:C?void 0:EU(M,w),onContextMenu:EU(N,w),onWheel:EU(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}=SB(e.nativeEvent,T.current);A.current={x:o,y:c};let l=rB({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||=(L(),!0),ee(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})),te())},onPointerCancel:C?e=>{e.target?.releasePointerCapture?.(e.pointerId),te()}:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?F:void 0,onPointerLeave:m,ref:w,style:xU,children:[h,(0,B.jsx)(TU,{})]})}function kU({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`,hz.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function AU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=vH(),[c,l]=(0,z.useState)(!1),u=(0,z.useRef)();return(0,z.useEffect)(()=>{if(!t)return u.current=_V({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{kU({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,z.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 jU=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function MU(){let e=vH();return(0,z.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=jU(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=tB(t,i));let{position:a,positionAbsolute:s}=Lz({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 NU=(0,z.createContext)(null),PU=NU.Provider;NU.Consumer;var FU=()=>(0,z.useContext)(NU),IU=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),LU=(0,z.createContext)(null);function RU({children:e}){let t=_H(IU,pH);return(0,B.jsx)(LU.Provider,{value:t,children:e})}function zU(){let e=(0,z.useContext)(LU);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var BU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},VU=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return BU;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===yz.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function HU({type:e=`source`,position:t=$.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=vH(),_=FU(),{connectOnClick:v,noPanClassName:y,rfId:b}=zU(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=_H(VU(_,m,e),pH);_||g.getState().onError?.(`010`,hz.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(aU(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=xB(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();DV.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,B.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:jN([`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=vB(t.target),h=n||c,{connection:v,isValid:y}=DV.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 UU=(0,z.memo)(cU(HU));function WU({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[e?.label,(0,B.jsx)(UU,{type:`source`,position:n,isConnectable:t})]})}function GU({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(UU,{type:`target`,position:n,isConnectable:t}),e?.label,(0,B.jsx)(UU,{type:`source`,position:r,isConnectable:t})]})}function KU(){return null}function qU({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(UU,{type:`target`,position:n,isConnectable:t}),e?.label]})}var JU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},YU={input:WU,default:GU,output:qU,group:KU};function XU(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 ZU=e=>{let{width:t,height:n,x:r,y:i}=Mz(e.nodeLookup,{filter:e=>!!e.selected});return{width:$z(t)?t:null,height:$z(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 QU({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=vH(),{width:i,height:a,transformString:o,userSelectionActive:s}=_H(ZU,pH),c=MU(),l=(0,z.useRef)(null);(0,z.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(AU({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,B.jsx)(`div`,{className:jN([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,B.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(JU,e.key)&&(e.preventDefault(),c({direction:JU[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var $U=typeof window<`u`?window:void 0,eW=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function tW({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:ee,userSelectionActive:L}=_H(eW,pH),te=KH(l,{target:$U}),ne=KH(h,{target:$U}),re=ne||w,ie=ne||b,ae=u&&re!==!0,oe=te||L||ae;return yU({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,B.jsx)(CU,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ie,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!te&&re,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:ae,children:(0,B.jsxs)(OU,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:re,autoPanOnSelection:T,isSelecting:!!oe,selectionMode:d,selectionKeyPressed:te,paneClickDistance:s,selectionOnDrag:ae,children:[e,ee&&(0,B.jsx)(QU,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}tW.displayName=`FlowRenderer`;var nW=(0,z.memo)(tW),rW=e=>t=>e?Nz(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 iW(e){return _H((0,z.useCallback)(rW(e),[e]),pH)}var aW=e=>e.updateNodeInternals;function oW(){let e=_H(aW),[t]=(0,z.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,z.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function sW({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=vH(),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(e.sourcePosition),c=(0,z.useRef)(e.targetPosition),l=(0,z.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,z.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,z.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,z.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 cW({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}=_H(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},pH),S=y.type||`default`,C=g?.[S]||YU[S];C===void 0&&(v?.(`003`,hz.error003(S)),S=`default`,C=g?.default||YU.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=vH(),k=dB(y),A=sW({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=AU({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=MU();if(y.hidden)return null;let N=uB(y),P=XU(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,ee=r?e=>r(e,{...b.userNode}):void 0,L=i?e=>i(e,{...b.userNode}):void 0,te=a?e=>a(e,{...b.userNode}):void 0,ne=o?e=>o(e,{...b.userNode}):void 0,re=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&kU({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},ie=t=>{if(!(bB(t.nativeEvent)||m)){if(_z.includes(t.key)&&T){let n=t.key===`Escape`;kU({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(JU,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:JU[t.key],factor:t.shiftKey?4:1})}}},ae=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Nz(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,B.jsx)(`div`,{className:jN([`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:ee,onMouseLeave:L,onContextMenu:te,onClick:re,onDoubleClick:ne,onKeyDown:D?ie:void 0,tabIndex:D?0:void 0,onFocus:D?ae:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${xH}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,B.jsx)(PU,{value:e,children:(0,B.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 lW=(0,z.memo)(cW),uW=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function dW(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=_H(uW,pH),a=iW(e.onlyRenderVisibleElements),o=oW();return(0,B.jsx)(`div`,{className:`react-flow__nodes`,style:xU,children:a.map(a=>(0,B.jsx)(lW,{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))})}dW.displayName=`NodeRenderer`;var fW=(0,z.memo)(dW);function pW(e){return _H((0,z.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&&AB({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),pH)}var mW=({color:e=`none`,strokeWidth:t=1})=>(0,B.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),hW=({color:e=`none`,strokeWidth:t=1})=>(0,B.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`}),gW={[wz.Arrow]:mW,[wz.ArrowClosed]:hW};function _W(e){let t=vH();return(0,z.useMemo)(()=>Object.prototype.hasOwnProperty.call(gW,e)?gW[e]:(t.getState().onError?.(`009`,hz.error009(e)),null),[e])}var vW=({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=_W(t);return c?(0,B.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,B.jsx)(c,{color:n,strokeWidth:o})}):null},yW=({defaultColor:e,rfId:t})=>{let n=_H(e=>e.edges),r=_H(e=>e.defaultEdgeOptions),i=(0,z.useMemo)(()=>qB(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,B.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,B.jsx)(`defs`,{children:i.map(e=>(0,B.jsx)(vW,{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};yW.displayName=`MarkerDefinitions`;var bW=(0,z.memo)(yW);function xW({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,z.useState)({x:1,y:0,width:0,height:0}),p=jN([`react-flow__edge-textwrapper`,l]),m=(0,z.useRef)(null);return(0,z.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,B.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,B.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,B.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}xW.displayName=`EdgeText`;var SW=(0,z.memo)(xW);function CW({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{...u,d:e,fill:`none`,className:jN([`react-flow__edge-path`,u.className])}),l?(0,B.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&$z(t)&&$z(n)?(0,B.jsx)(SW,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function wW({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function TW({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=wW({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=wW({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=wB({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 EW(e){return(0,z.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]=TW({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,B.jsx)(CW,{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 DW=EW({isInternal:!1}),OW=EW({isInternal:!0});DW.displayName=`SimpleBezierEdge`,OW.displayName=`SimpleBezierEdgeInternal`;function kW(e){return(0,z.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=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=BB({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,B.jsx)(CW,{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 AW=kW({isInternal:!1}),jW=kW({isInternal:!0});AW.displayName=`SmoothStepEdge`,jW.displayName=`SmoothStepEdgeInternal`;function MW(e){return(0,z.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,B.jsx)(AW,{...n,id:r,pathOptions:(0,z.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var NW=MW({isInternal:!1}),PW=MW({isInternal:!0});NW.displayName=`StepEdge`,PW.displayName=`StepEdgeInternal`;function FW(e){return(0,z.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]=PB({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,B.jsx)(CW,{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 IW=FW({isInternal:!1}),LW=FW({isInternal:!0});IW.displayName=`StraightEdge`,LW.displayName=`StraightEdgeInternal`;function RW(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.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]=DB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,B.jsx)(CW,{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 zW=RW({isInternal:!1}),BW=RW({isInternal:!0});zW.displayName=`BezierEdge`,BW.displayName=`BezierEdgeInternal`;var VW={default:BW,straight:LW,step:PW,smoothstep:jW,simplebezier:OW},HW={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},UW=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,WW=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,GW=`react-flow__edgeupdater`;function KW({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,B.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:jN([GW,`${GW}-${s}`]),cx:UW(t,r,e),cy:WW(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function qW({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=vH(),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`;DV.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,B.jsxs)(B.Fragment,{children:[(e===!0||e===`source`)&&(0,B.jsx)(KW,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,B.jsx)(KW,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function JW({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=_H(t=>t.edgeLookup.get(e)),b=_H(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||VW[x];S===void 0&&(_?.(`011`,hz.error011(x)),x=`default`,S=h?.default||VW.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,z.useRef)(null),[D,O]=(0,z.useState)(!1),[k,A]=(0,z.useState)(!1),j=vH(),{zIndex:M=y.zIndex,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:ee,targetPosition:L}=_H((0,z.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return HW;let i=HB({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=kB({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||HW,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),pH),te=(0,z.useMemo)(()=>y.markerStart?`url('#${KB(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ne=(0,z.useMemo)(()=>y.markerEnd?`url('#${KB(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||F===null||I===null)return null;let re=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)},ie=a?e=>{a(e,{...y})}:void 0,ae=o?e=>{o(e,{...y})}:void 0,oe=s?e=>{s(e,{...y})}:void 0,se=c?e=>{c(e,{...y})}:void 0,ce=l?e=>{l(e,{...y})}:void 0;return(0,B.jsx)(`svg`,{style:{zIndex:M},children:(0,B.jsxs)(`g`,{className:jN([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:re,onDoubleClick:ie,onContextMenu:ae,onMouseEnter:oe,onMouseMove:se,onMouseLeave:ce,onKeyDown:C?t=>{if(!v&&_z.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?`${SH}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,B.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:ee,targetPosition:L,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:te,markerEnd:ne,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,B.jsx)(qW,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:ee,targetPosition:L,setUpdateHover:O,setReconnecting:A})]})})}var YW=(0,z.memo)(JW),XW=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZW({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}=_H(XW,pH),b=pW(t);return(0,B.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,B.jsx)(bW,{defaultColor:e,rfId:n}),b.map(e=>(0,B.jsx)(YW,{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))]})}ZW.displayName=`EdgeRenderer`;var QW=(0,z.memo)(ZW),$W=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function eG({children:e}){let t=vH(),n=(0,z.useRef)(null),[r]=(0,z.useState)(()=>t.getState().transform);return lU(()=>{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=$W(r)))};return r(),t.subscribe(r)},[t]),(0,B.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:$W(r)},children:e})}function tG(e){let t=gU(),n=(0,z.useRef)(!1);(0,z.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var nG=e=>e.panZoom?.syncViewport;function rG(e){let t=_H(nG),n=vH();return(0,z.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function iG(e){return e.connection.inProgress?{...e.connection,to:nB(e.connection.to,e.transform)}:{...e.connection}}function aG(e){return e?t=>e(iG(t)):iG}function oG(e){return _H(aG(e),pH)}var sG=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function cG({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=_H(sG,pH);return a&&i&&c?(0,B.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,B.jsx)(`g`,{className:jN([`react-flow__connection`,Ez(s)]),children:(0,B.jsx)(lG,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var lG=({style:e,type:t=Cz.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}=oG();if(!i)return;if(n)return(0,B.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:Ez(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 Cz.Bezier:[m]=DB(h);break;case Cz.SimpleBezier:[m]=TW(h);break;case Cz.Step:[m]=BB({...h,borderRadius:0});break;case Cz.SmoothStep:[m]=BB(h);break;default:[m]=PB(h)}return(0,B.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};lG.displayName=`ConnectionLine`;var uG={};function dG(e=uG){(0,z.useRef)(e),vH(),(0,z.useEffect)(()=>{},[e])}function fG(){vH(),(0,z.useRef)(!1),(0,z.useEffect)(()=>{},[])}function pG({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:ee,zoomOnDoubleClick:L,panOnDrag:te,autoPanOnSelection:ne,onPaneClick:re,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:oe,onPaneScroll:se,onPaneContextMenu:ce,paneClickDistance:le,nodeClickDistance:ue,onEdgeContextMenu:de,onEdgeMouseEnter:fe,onEdgeMouseMove:pe,onEdgeMouseLeave:me,reconnectRadius:he,onReconnect:ge,onReconnectStart:_e,onReconnectEnd:ve,noDragClassName:ye,noWheelClassName:be,noPanClassName:xe,disableKeyboardA11y:Se,nodeExtent:Ce,rfId:we,viewport:R,onViewportChange:Te,nodesDraggable:Ee}){return dG(e),dG(t),fG(),tG(n),rG(R),(0,B.jsx)(nW,{onPaneClick:re,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:oe,onPaneContextMenu:ce,onPaneScroll:se,paneClickDistance:le,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:L,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:ee,panOnDrag:te,autoPanOnSelection:ne,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ye,noWheelClassName:be,noPanClassName:xe,disableKeyboardA11y:Se,onViewportChange:Te,isControlledViewport:!!R,children:(0,B.jsxs)(eG,{children:[(0,B.jsx)(QW,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ge,onReconnectStart:_e,onReconnectEnd:ve,onlyRenderVisibleElements:T,onEdgeContextMenu:de,onEdgeMouseEnter:fe,onEdgeMouseMove:pe,onEdgeMouseLeave:me,reconnectRadius:he,defaultMarkerColor:M,noPanClassName:xe,disableKeyboardA11y:Se,rfId:we}),(0,B.jsx)(cG,{style:h,type:m,component:g,containerStyle:_}),(0,B.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,B.jsx)(fW,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ue,onlyRenderVisibleElements:T,noPanClassName:xe,noDragClassName:ye,disableKeyboardA11y:Se,nodeExtent:Ce,rfId:we,nodesDraggable:Ee}),(0,B.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}pG.displayName=`GraphView`;var mG=(0,z.memo)(pG),hG=eB(`React Flow`,`https://reactflow.dev/`),gG=({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??gz;dV(h,g,_);let{nodesInitialized:x}=nV(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=sB(Mz(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:gz,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yz.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:{...Sz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:hG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:vz,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},_G=({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})=>fH((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 Iz({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...gG({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}=nV(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();dV(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}=cV(e,n,r,i,a,o,l);d&&($B(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=WB(e,o.fromHandle,$.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=sV(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(QH(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($H(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=>eU(e,!0)));return}i(tU(r,new Set([...e]),!0)),a(tU(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>eU(e,!0)));return}a(tU(n,new Set([...e]))),i(tU(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(eU(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(eU(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,eU(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,eU(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]||(nV(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 lV({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:{...Sz}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...gG()})}},Object.is);function vG({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,z.useState)(()=>_G({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,B.jsx)(hH,{value:m,children:(0,B.jsx)(pU,{children:(0,B.jsx)(RU,{children:p})})})}function yG({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,z.useContext)(mH)?(0,B.jsx)(B.Fragment,{children:e}):(0,B.jsx)(vG,{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 bG={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function xG({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:ee,connectionLineType:L=Cz.Bezier,connectionLineStyle:te,connectionLineComponent:ne,connectionLineContainerStyle:re,deleteKeyCode:ie=`Backspace`,selectionKeyCode:ae=`Shift`,selectionOnDrag:oe=!1,selectionMode:se=xz.Full,panActivationKeyCode:ce=`Space`,multiSelectionKeyCode:le=cB()?`Meta`:`Control`,zoomActivationKeyCode:ue=cB()?`Meta`:`Control`,snapToGrid:de,snapGrid:fe,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:me,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,nodeOrigin:ye=LH,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se=!0,defaultViewport:Ce=RH,minZoom:we=.5,maxZoom:R=2,translateExtent:Te=gz,preventScrolling:Ee=!0,nodeExtent:De,defaultMarkerColor:Oe=`#b1b1b7`,zoomOnScroll:ke=!0,zoomOnPinch:Ae=!0,panOnScroll:je=!1,panOnScrollSpeed:Me=.5,panOnScrollMode:Ne=bz.Free,zoomOnDoubleClick:Pe=!0,panOnDrag:Fe=!0,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He=1,nodeClickDistance:Ue=0,children:We,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e=10,onNodesChange:et,onEdgesChange:tt,noDragClassName:nt=`nodrag`,noWheelClassName:rt=`nowheel`,noPanClassName:it=`nopan`,fitView:at,fitViewOptions:ot,connectOnClick:st,attributionPosition:ct,proOptions:lt,defaultEdgeOptions:ut,elevateNodesOnSelect:dt=!0,elevateEdgesOnSelect:ft=!1,disableKeyboardA11y:pt=!1,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanOnSelection:gt=!0,autoPanSpeed:_t,connectionRadius:vt,isValidConnection:yt,onError:bt,style:xt,id:St,nodeDragThreshold:Ct,connectionDragThreshold:wt,viewport:Tt,onViewportChange:Et,width:Dt,height:Ot,colorMode:kt=`light`,debug:At,onScroll:jt,ariaLabelConfig:Mt,zIndexMode:Nt=`basic`,...Pt},Ft){let It=St||`1`,Lt=WH(kt),Rt=(0,z.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),jt?.(e)},[jt]);return(0,B.jsx)(`div`,{"data-testid":`rf__wrapper`,...Pt,onScroll:Rt,style:{...xt,...bG},ref:Ft,className:jN([`react-flow`,i,Lt]),id:St,role:`application`,children:(0,B.jsxs)(yG,{nodes:e,edges:t,width:Dt,height:Ot,fitView:at,fitViewOptions:ot,minZoom:we,maxZoom:R,nodeOrigin:ye,nodeExtent:De,zIndexMode:Nt,children:[(0,B.jsx)(HH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se,elevateNodesOnSelect:dt,elevateEdgesOnSelect:ft,minZoom:we,maxZoom:R,nodeExtent:De,onNodesChange:et,onEdgesChange:tt,snapToGrid:de,snapGrid:fe,connectionMode:ee,translateExtent:Te,connectOnClick:st,defaultEdgeOptions:ut,fitView:at,fitViewOptions:ot,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:it,nodeOrigin:ye,rfId:It,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanSpeed:_t,onError:bt,connectionRadius:vt,isValidConnection:yt,selectNodesOnDrag:me,nodeDragThreshold:Ct,connectionDragThreshold:wt,onBeforeDelete:I,debug:At,ariaLabelConfig:Mt,zIndexMode:Nt}),(0,B.jsx)(mG,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:L,connectionLineStyle:te,connectionLineComponent:ne,connectionLineContainerStyle:re,selectionKeyCode:ae,selectionOnDrag:oe,selectionMode:se,deleteKeyCode:ie,multiSelectionKeyCode:le,panActivationKeyCode:ce,zoomActivationKeyCode:ue,onlyRenderVisibleElements:pe,defaultViewport:Ce,translateExtent:Te,minZoom:we,maxZoom:R,preventScrolling:Ee,zoomOnScroll:ke,zoomOnPinch:Ae,zoomOnDoubleClick:Pe,panOnScroll:je,panOnScrollSpeed:Me,panOnScrollMode:Ne,panOnDrag:Fe,autoPanOnSelection:gt,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He,nodeClickDistance:Ue,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e,defaultMarkerColor:Oe,noDragClassName:nt,noWheelClassName:rt,noPanClassName:it,rfId:It,disableKeyboardA11y:pt,nodeExtent:De,viewport:Tt,onViewportChange:Et,nodesDraggable:he}),(0,B.jsx)(IH,{onSelectionChange:k}),We,(0,B.jsx)(AH,{proOptions:lt,position:ct}),(0,B.jsx)(DH,{rfId:It,disableKeyboardA11y:pt})]})})}var SG=cU(xG);hz.error014();function CG({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,B.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:jN([`react-flow__background-pattern`,n,r])})}function wG({radius:e,className:t}){return(0,B.jsx)(`circle`,{cx:e,cy:e,r:e,className:jN([`react-flow__background-pattern`,`dots`,t])})}var TG;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(TG||={});var EG={[TG.Dots]:1,[TG.Lines]:1,[TG.Cross]:6},DG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function OG({id:e,variant:t=TG.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,z.useRef)(null),{transform:f,patternId:p}=_H(DG,pH),m=r||EG[t],h=t===TG.Dots,g=t===TG.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,B.jsxs)(`svg`,{className:jN([`react-flow__background`,l]),style:{...c,...xU,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,B.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,B.jsx)(wG,{radius:y/2,className:u}):(0,B.jsx)(CG,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,B.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}OG.displayName=`Background`;var kG=(0,z.memo)(OG);function AG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,B.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function jG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,B.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function MG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,B.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 NG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.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 PG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.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 FG({children:e,className:t,...n}){return(0,B.jsx)(`button`,{type:`button`,className:jN([`react-flow__controls-button`,t]),...n,children:e})}var IG=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function LG({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=vH(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=_H(IG,pH),{zoomIn:y,zoomOut:b,fitView:x}=gU();return(0,B.jsxs)(OH,{className:jN([`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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(FG,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,B.jsx)(AG,{})}),(0,B.jsx)(FG,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,B.jsx)(jG,{})})]}),n&&(0,B.jsx)(FG,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,B.jsx)(MG,{})}),r&&(0,B.jsx)(FG,{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,B.jsx)(PG,{}):(0,B.jsx)(NG,{})}),u]})}LG.displayName=`Controls`;var RG=(0,z.memo)(LG);function zG({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,B.jsx)(`rect`,{className:jN([`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 BG=(0,z.memo)(zG),VG=e=>e.nodes.map(e=>e.id),HG=e=>e instanceof Function?e:()=>e;function UG({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=BG,onClick:o}){let s=_H(VG,pH),c=HG(t),l=HG(e),u=HG(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,B.jsx)(B.Fragment,{children:s.map(e=>(0,B.jsx)(GG,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function WG({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}=_H(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}=uB(r);return{node:r,x:i,y:a,width:o,height:s}},pH);return!l||l.hidden||!dB(l)?null:(0,B.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 GG=(0,z.memo)(WG),KG=(0,z.memo)(UG),qG=200,JG=150,YG=e=>!e.hidden,XG=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?Yz(Mz(e.nodeLookup,{filter:YG}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ZG=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,QG=(e,t)=>ZG(e.viewBB,t.viewBB)&&ZG(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,$G=`react-flow__minimap-desc`;function eK({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=vH(),S=(0,z.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=_H(XG,QG),j=e?.width??qG,M=e?.height??JG,N=C.width/j,P=C.height/M,F=Math.max(N,P),I=F*j,ee=F*M,L=b*F,te=C.x-(I-C.width)/2-L,ne=C.y-(ee-C.height)/2-L,re=I+L*2,ie=ee+L*2,ae=`${$G}-${T}`,oe=(0,z.useRef)(0),se=(0,z.useRef)();oe.current=F,(0,z.useEffect)(()=>{if(S.current&&E)return se.current=OV({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>oe.current}),()=>{se.current?.destroy()}},[E]),(0,z.useEffect)(()=>{se.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let ce=p?e=>{let[t,n]=se.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,le=m?(0,z.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,ue=_??A[`minimap.ariaLabel`];return(0,B.jsx)(OH,{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:jN([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,B.jsxs)(`svg`,{width:j,height:M,viewBox:`${te} ${ne} ${re} ${ie}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ae,ref:S,onClick:ce,children:[ue&&(0,B.jsx)(`title`,{id:ae,children:ue}),(0,B.jsx)(KG,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,B.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${te-L},${ne-L}h${re+L*2}v${ie+L*2}h${-re-L*2}z
88
+ M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}eK.displayName=`MiniMap`,(0,z.memo)(eK);var tK=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,nK={[UV.Line]:`right`,[UV.Handle]:`bottom-right`};function rK({nodeId:e,position:t,variant:n=UV.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=FU(),y=typeof e==`string`?e:v,b=vH(),x=(0,z.useRef)(null),S=n===UV.Handle,C=_H((0,z.useCallback)(tK(S&&p),[S,p]),pH),w=(0,z.useRef)(null),T=t??nK[n];return(0,z.useEffect)(()=>{if(!(!x.current||!y))return w.current||=eH({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=sV([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...fB({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,B.jsx)(`div`,{className:jN([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,z.memo)(rK);var iK={agent:He,human:Tt,command:St,change:Oe};function aK({data:e}){let t=iK[e.kind]??bt,n=e.style===`success`?Ue:e.style===`danger`||e.style===`muted`?Dt:e.style===`active`?Je:tt;return(0,B.jsxs)(`article`,{"aria-label":`${e.label}: ${e.state}`,className:k(`dag-node`,`state-${e.state}`,`token-${e.style}`),"data-selected":e.selected,children:[(0,B.jsx)(UU,{type:`target`,position:$.Left}),(0,B.jsxs)(`div`,{className:`node-heading`,children:[(0,B.jsxs)(T,{className:`node-kind px-1.5 py-0 text-[9px] tracking-[.1em] uppercase`,variant:`outline`,children:[(0,B.jsx)(t,{"aria-label":e.kind,role:`img`,size:10}),e.kind]}),(0,B.jsx)(n,{className:k(e.style===`active`&&`spin`),size:17})]}),(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`span`,{className:`node-status`,children:e.state}),e.reason!==void 0&&(0,B.jsx)(`span`,{className:`node-reason`,title:e.reason,children:e.reason}),e.awaits!==void 0&&(0,B.jsx)(`span`,{className:`node-awaits`,title:e.awaits,children:e.awaits}),(0,B.jsx)(UU,{type:`source`,position:$.Right})]})}function oK({data:e,id:t,markerEnd:n,style:r}){return(0,B.jsx)(CW,{id:t,path:sK(e?.points??[]),markerEnd:n,style:r})}function sK(e){let[t,...n]=e;return t?`M ${t.x} ${t.y} ${n.map(e=>`L ${e.x} ${e.y}`).join(` `)}`:``}var cK={dagNode:aK},lK={routed:oK};function uK({nodes:e,selectedNodeId:t,onSelectNode:n,journalSeq:r}){let i=(0,z.useMemo)(()=>{let t=new Map;for(let n of e)ye(n.status)&&t.set(n.id,ke(n));return t},[e]),a=(0,z.useMemo)(()=>new Map(e.map(e=>[e.id,De(e)])),[e]),{nodes:o,edges:s}=(0,z.useMemo)(()=>{let n=new Set(e.map(e=>e.id)),r=ce({nodes:e.map(e=>({id:e.id,label:e.label,kind:e.kind,state:e.status,...we(i.get(e.id),a.get(e.id))})),edges:e.flatMap(e=>(e.task?.deps??[]).filter(e=>n.has(e)).map(t=>({id:`${t}->${e.id}`,source:t,target:e.id})))});return{nodes:r.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===t,...i.get(e.id)===void 0?{}:{reason:i.get(e.id)},...a.get(e.id)===void 0?{}:{awaits:a.get(e.id)}},width:e.width,height:e.height,measured:{width:e.width,height:e.height},handles:[{type:`target`,position:$.Left,x:0,y:e.height/2,width:0,height:0},{type:`source`,position:$.Right,x:e.width,y:e.height/2,width:0,height:0}]})),edges:r.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,i,a,t]);return(0,B.jsxs)(`div`,{className:`graph-wrap`,"data-journal-seq":r,children:[(0,B.jsxs)(SG,{nodes:o,edges:s,colorMode:`dark`,nodeTypes:cK,edgeTypes:lK,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,onInit:e=>void e.fitView(),onNodeClick:(e,t)=>n(t.id),"aria-label":`DAG execution graph`,children:[(0,B.jsx)(kG,{color:`var(--border)`,gap:22}),(0,B.jsx)(RG,{showInteractive:!1})]}),(0,B.jsx)(`ol`,{className:`accessible-node-list`,"aria-label":`DAG nodes`,children:e.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),children:[e.label,`: `,e.status,i.get(e.id)===void 0?``:` — ${i.get(e.id)}`,a.get(e.id)===void 0?``:` — ${a.get(e.id)}`]})},e.id))})]})}function dK({value:e,label:t=`Record`}){return e==null?(0,B.jsx)(`span`,{children:`Not recorded`}):typeof e==`boolean`?(0,B.jsx)(`span`,{children:e?`Yes`:`No`}):typeof e==`string`||typeof e==`number`?(0,B.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:String(e)}):Array.isArray(e)?e.length===0?(0,B.jsx)(`span`,{children:`None`}):(0,B.jsx)(`ol`,{"aria-label":t,children:e.map((e,n)=>(0,B.jsx)(`li`,{"aria-label":`${t}.${n}`,children:(0,B.jsx)(dK,{label:`${t}.${n}`,value:e})},n))}):typeof e==`object`?(0,B.jsx)(`div`,{className:`structured-fields`,children:Object.entries(e).map(([e,n])=>(0,B.jsxs)(`fieldset`,{"aria-label":`${t}.${e}`,children:[(0,B.jsx)(`legend`,{children:e.replaceAll(`_`,` `)}),(0,B.jsx)(dK,{label:`${t}.${e}`,value:n})]},e))}):(0,B.jsx)(`span`,{children:`Not recorded`})}function fK(e,t){let[n,r]=(0,z.useState)(0);return{host:ON(`host`,()=>e.host(),n),unwatched:ON(`unwatched`,()=>e.unwatched(),n),refresh:(0,z.useCallback)(()=>{r(e=>e+1),t?.()},[t])}}var pK=[`Run`,`Node`,`Provider`,`Age (ms)`,`Proof`];function mK(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 hK({client:e,onRefresh:t,list:n,rows:r,listError:i,children:a}){let{host:o,unwatched:s,refresh:c}=fK(e,t),l=o.value?.reading;return(0,B.jsx)(gd,{className:`min-h-0 flex-1`,children:(0,B.jsxs)(`section`,{"aria-label":`Host`,className:`channel-view host-page`,children:[(0,B.jsxs)(`h2`,{children:[`This host`,l&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`output`,{"aria-label":`Host name`,className:`host-name`,children:l.host})]})]}),(0,B.jsx)(Wi,{onClick:c,children:`Refresh host`}),(o.error||s.error)&&(0,B.jsx)(`p`,{role:`alert`,children:o.error?.message??s.error?.message}),o.loading&&(0,B.jsx)(`p`,{role:`status`,children:`Reading host…`}),l&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:`Runs root`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Runs root path`,children:l.root})})]}),l.root_error&&(0,B.jsx)(`p`,{role:`alert`,children:l.root_error}),(0,B.jsxs)(`section`,{"aria-label":`Free space`,children:[(0,B.jsx)(`h3`,{children:`Free space`}),l.free_space.map((e,t)=>(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:`Filesystem`}),(0,B.jsx)(`dd`,{children:e.roots.map((e,t)=>(0,B.jsxs)(`span`,{children:[t>0&&` · `,e.role,`:`,` `,(0,B.jsx)(`output`,{"aria-label":`Filesystem root path`,children:e.path??`unresolved`}),e.measured_at&&(0,B.jsxs)(B.Fragment,{children:[` `,`(measured at`,` `,(0,B.jsx)(`output`,{"aria-label":`Measured root ancestor`,children:e.measured_at}),`)`]})]},e.role))}),(0,B.jsx)(`dt`,{children:`Free bytes`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Free capacity bytes`,children:e.free_bytes??`Unknown`})}),(0,B.jsx)(`dt`,{children:`Total bytes`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Total capacity bytes`,children:e.total_bytes??`Unknown`})}),e.error&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:e.error})]})]},e.roots[0]?.path??t))]}),(0,B.jsxs)(`section`,{"aria-label":`Providers and dispatches`,children:[(0,B.jsx)(`h3`,{children:`Providers and dispatches`}),l.dispatches.length===0?(0,B.jsx)(`p`,{children:`No live dispatches`}):(0,B.jsx)(`section`,{"aria-label":`Providers and dispatches table`,className:`host-table`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:pK.map(e=>(0,B.jsx)(`th`,{children:e},e))})}),(0,B.jsx)(`tbody`,{children:l.dispatches.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{"data-label":`Run`,children:e.run}),(0,B.jsx)(`td`,{"data-label":`Node`,children:e.node}),(0,B.jsx)(`td`,{"data-label":`Provider`,children:e.launcher}),(0,B.jsx)(`td`,{"data-label":`Age (ms)`,children:(0,B.jsx)(`output`,{"aria-label":`Dispatch age milliseconds`,className:`host-age`,children:e.age_ms??`Unknown`})}),(0,B.jsxs)(`td`,{"data-label":`Proof`,children:[e.proof,e.unproven&&`: ${e.unproven}`]})]},`${e.run}/${e.node}`))})]})})]}),(0,B.jsxs)(`section`,{"aria-label":`Gone dispatches`,children:[(0,B.jsx)(`h3`,{children:`Gone dispatches`}),l.gone.map(e=>(0,B.jsxs)(`p`,{children:[e.run,` · `,e.node,` · `,e.reason]},`${e.run}/${e.node}`))]}),l.skipped.map(e=>(0,B.jsxs)(`p`,{children:[e.path,`: `,e.reason]},e.path))]}),(0,B.jsxs)(`section`,{"aria-label":`Unwatched runs`,children:[(0,B.jsxs)(`h3`,{children:[`Unwatched runs: `,s.value?.reported.length??`…`]}),s.value?.reported.map(e=>(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:e.run}),(0,B.jsxs)(`dd`,{children:[e.standing,` · `,e.why_not_watched]})]},e.run)),s.value?.unresolved.map(e=>(0,B.jsx)(`p`,{children:e},e))]}),(0,B.jsxs)(`section`,{"aria-label":`Runs on the host`,children:[(0,B.jsx)(`h3`,{children:`Runs on the host`}),i&&(0,B.jsxs)(`p`,{role:`alert`,children:[`Listing unavailable: `,i.message]}),mK(n,r).map(e=>(0,B.jsx)(`p`,{children:[e.run_id,e.state,ee(e.node_counts)].filter(Boolean).join(` · `)},e.run_id))]}),(0,B.jsxs)(`details`,{"aria-label":`Provider health`,children:[(0,B.jsx)(`summary`,{children:`Provider health`}),(0,B.jsx)(dK,{value:n?.provider_health})]}),a]})})}function gK(e,t,n){let{value:r,error:i}=ON(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 _K(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 vK(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function yK(e){return e}var bK=[],xK=`skip`;function SK(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=_y(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 (`+yK(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=bK;if(s&&r&&(o=CK(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=CK(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 CK(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?bK:[e]}function wK(e,t,n){let r=_y((n||{}).ignore||[]),i=TK(t),a=-1;for(;++a<i.length;)SK(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 xK}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 TK(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([EK(e[0]),DK(e[1])])}return t}function EK(e){return typeof e==`string`?new RegExp(vK(e),`g`):e}function DK(e){return typeof e==`function`?e:function(){return e}}var OK=`phrasing`,kK=[`autolink`,`link`,`image`,`label`];function AK(){return{transforms:[RK],enter:{literalAutolink:MK,literalAutolinkEmail:NK,literalAutolinkHttp:NK,literalAutolinkWww:NK},exit:{literalAutolink:LK,literalAutolinkEmail:IK,literalAutolinkHttp:PK,literalAutolinkWww:FK}}}function jK(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:OK,notInConstruct:kK},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:OK,notInConstruct:kK},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:OK,notInConstruct:kK}]}}function MK(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function NK(e){this.config.enter.autolinkProtocol.call(this,e)}function PK(e){this.config.exit.autolinkProtocol.call(this,e)}function FK(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 IK(e){this.config.exit.autolinkEmail.call(this,e)}function LK(e){this.exit(e)}function RK(e){wK(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,zK],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,HK],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,VK],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,BK]],{ignore:[`link`,`linkReference`]})}function zK(e,t,n,r,i){if(!GK(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),qh(n.charCodeAt(0))||!UK(n))return!1;let o=WK(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 BK(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 VK(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 HK(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 UK(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 WK(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=_K(e,`(`),a=_K(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 GK(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Jh(t)||qh(t)}tq.peek=eq;function KK(){this.buffer()}function qK(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function JK(){this.buffer()}function YK(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function XK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lh(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZK(e){this.exit(e)}function QK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lh(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $K(e){this.exit(e)}function eq(){return`[`}function tq(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 nq(){return{enter:{gfmFootnoteCallString:KK,gfmFootnoteCall:qK,gfmFootnoteDefinitionLabelString:JK,gfmFootnoteDefinition:YK},exit:{gfmFootnoteCallString:XK,gfmFootnoteCall:ZK,gfmFootnoteDefinitionLabelString:QK,gfmFootnoteDefinition:$K}}}function rq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tq},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?`
89
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?aq:iq))),s(),o}}function iq(e,t,n){return t===0?e:aq(e,t,n)}function aq(e,t,n){return(n?``:` `)+e}var oq=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];dq.attention=fq,dq.peek=pq;function sq(){return{canContainEols:[`delete`],enter:{strikethrough:lq},exit:{strikethrough:uq}}}function cq(){return{handlers:{delete:dq},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:oq}]}}function lq(e){this.enter({type:`delete`,children:[],position:void 0},e)}function uq(e){this.exit(e)}function dq(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 fq(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function pq(){return`~`}function mq(e){return e.length}function hq(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mq,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=gq(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]=_q(r[d]);else{let e=_q(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(`
90
+ `)}function gq(e){return e==null?``:String(e)}function _q(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 vq(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()),yq);return i(),o}function yq(e,t,n){return`>`+(n?``:` `)+e}function bq(e,t){return xq(e,t.inConstruct,!0)&&!xq(e,t.notInConstruct,!1)}function xq(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 Sq(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
91
+ `&&bq(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
92
+ `}function Cq(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 wq(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 Tq(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Eq(e,t,n,r){let i=Tq(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(wq(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Dq);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Cq(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:`
93
93
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
94
94
  `),a&&(u+=s.move(a+`
95
- `)),u+=s.move(c),l(),u}function Cq(e,t,n){return(n?``:` `)+e}function wq(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Tq(e,t,n,r){let i=wq(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?` `:`
96
- `,...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 Eq(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Dq(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Oq(e,t,n){let r=tg(e),i=tg(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}}kq.peek=Aq;function kq(e,t,n,r){let i=Eq(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=Oq(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Dq(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Oq(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Dq(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Aq(e,t,n){return n.options.emphasis||`*`}function jq(e,t){let n=!1;return Ty(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)&&xh(e)&&(t.options.setext||n))}function Mq(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(jq(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
95
+ `)),u+=s.move(c),l(),u}function Dq(e,t,n){return(n?``:` `)+e}function Oq(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function kq(e,t,n,r){let i=Oq(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?` `:`
96
+ `,...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 Aq(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function jq(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Mq(e,t,n){let r=ig(e),i=ig(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}}Nq.peek=Pq;function Nq(e,t,n,r){let i=Aq(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=Mq(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=jq(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Mq(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+jq(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Pq(e,t,n){return n.options.emphasis||`*`}function Fq(e,t){let n=!1;return Oy(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)&&wh(e)&&(t.options.setext||n))}function Iq(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Fq(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
97
97
  `,after:`
98
98
  `});return r(),t(),o+`
99
99
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
100
100
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
101
- `,...a.current()});return/^[\t ]/.test(l)&&(l=Dq(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Nq.peek=Pq;function Nq(e){return e.value||``}function Pq(){return`<`}Fq.peek=Iq;function Fq(e,t,n,r){let i=wq(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 Iq(){return`!`}Lq.peek=Rq;function Lq(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 Rq(){return`!`}zq.peek=Bq;function zq(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 Bq(){return"`"}function Vq(e,t){let n=xh(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))}Hq.peek=Uq;function Hq(e,t,n,r){let i=wq(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Vq(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 Uq(e,t,n){return Vq(e,n)?`<`:`[`}Wq.peek=Gq;function Wq(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 Gq(){return`[`}function Kq(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 qq(e){let t=Kq(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 Jq(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Yq(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 Xq(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Jq(n):Kq(n),s=e.ordered?o===`.`?`)`:`.`:qq(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),Yq(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 Zq(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 Qq(e,t,n,r){let i=Zq(n),a=n.bulletCurrent||Kq(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 $q(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var eJ=my([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function tJ(e,t,n,r){return(e.children.some(function(e){return eJ(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nJ(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rJ.peek=iJ;function rJ(e,t,n,r){let i=nJ(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=Oq(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Dq(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Oq(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Dq(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function iJ(e,t,n){return n.options.strong||`*`}function aJ(e,t,n,r){return n.safe(e.value,r)}function oJ(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 sJ(e,t,n){let r=(Yq(n)+(n.options.ruleSpaces?` `:``)).repeat(oJ(n));return n.options.ruleSpaces?r.slice(0,-1):r}var cJ={blockquote:mq,break:vq,code:Sq,definition:Tq,emphasis:kq,hardBreak:vq,heading:Mq,html:Nq,image:Fq,imageReference:Lq,inlineCode:zq,link:Hq,linkReference:Wq,list:Xq,listItem:Qq,paragraph:$q,root:tJ,strong:rJ,text:aJ,thematicBreak:sJ};function lJ(){return{enter:{table:uJ,tableData:mJ,tableHeader:mJ,tableRow:fJ},exit:{codeText:hJ,table:dJ,tableData:pJ,tableHeader:pJ,tableRow:pJ}}}function uJ(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 dJ(e){this.exit(e),this.data.inTable=void 0}function fJ(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function pJ(e){this.exit(e)}function mJ(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function hJ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gJ));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gJ(e,t){return t===`|`?t:e}function _J(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[vJ],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
101
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=jq(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Lq.peek=Rq;function Lq(e){return e.value||``}function Rq(){return`<`}zq.peek=Bq;function zq(e,t,n,r){let i=Oq(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 Bq(){return`!`}Vq.peek=Hq;function Vq(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 Hq(){return`!`}Uq.peek=Wq;function Uq(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 Wq(){return"`"}function Gq(e,t){let n=wh(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))}Kq.peek=qq;function Kq(e,t,n,r){let i=Oq(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Gq(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 qq(e,t,n){return Gq(e,n)?`<`:`[`}Jq.peek=Yq;function Jq(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 Yq(){return`[`}function Xq(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 Zq(e){let t=Xq(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 Qq(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function $q(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 eJ(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Qq(n):Xq(n),s=e.ordered?o===`.`?`)`:`.`:Zq(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),$q(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 tJ(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 nJ(e,t,n,r){let i=tJ(n),a=n.bulletCurrent||Xq(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 rJ(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var iJ=_y([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function aJ(e,t,n,r){return(e.children.some(function(e){return iJ(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oJ(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sJ.peek=cJ;function sJ(e,t,n,r){let i=oJ(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=Mq(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=jq(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Mq(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+jq(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function cJ(e,t,n){return n.options.strong||`*`}function lJ(e,t,n,r){return n.safe(e.value,r)}function uJ(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 dJ(e,t,n){let r=($q(n)+(n.options.ruleSpaces?` `:``)).repeat(uJ(n));return n.options.ruleSpaces?r.slice(0,-1):r}var fJ={blockquote:vq,break:Sq,code:Eq,definition:kq,emphasis:Nq,hardBreak:Sq,heading:Iq,html:Lq,image:zq,imageReference:Vq,inlineCode:Uq,link:Kq,linkReference:Jq,list:eJ,listItem:nJ,paragraph:rJ,root:aJ,strong:sJ,text:lJ,thematicBreak:dJ};function pJ(){return{enter:{table:mJ,tableData:vJ,tableHeader:vJ,tableRow:gJ},exit:{codeText:yJ,table:hJ,tableData:_J,tableHeader:_J,tableRow:_J}}}function mJ(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 hJ(e){this.exit(e),this.data.inTable=void 0}function gJ(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function _J(e){this.exit(e)}function vJ(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function yJ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,bJ));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function bJ(e,t){return t===`|`?t:e}function xJ(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[SJ],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
102
102
  `,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(`
103
- `))}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 dq(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=cJ.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 vJ(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&yJ(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function yJ(e,t){let n=!1;return Ty(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)&&xh(e)&&(t.options.setext||n))}function bJ(){return{exit:{taskListCheckValueChecked:SJ,taskListCheckValueUnchecked:SJ,paragraph:CJ}}}function xJ(){return{handlers:{paragraph:wJ},join:[TJ]}}function SJ(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function CJ(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 wJ(e,t,n,r){if(!t||t.type!==`listItem`||EJ(t)!==e)return cJ.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+cJ.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function TJ(e,t,n){if(!(e.type===`definition`&&n.type===`listItem`))return;let r=EJ(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function EJ(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function DJ(){return[EK(),QK(),rq(),lJ(),bJ()]}function OJ(e){return{extensions:[DK(),$K(e),iq(),_J(e),xJ()]}}var kJ={tokenize:UJ,partial:!0},AJ={tokenize:WJ,partial:!0},jJ={tokenize:GJ,partial:!0},MJ={tokenize:KJ,partial:!0},NJ={tokenize:qJ,partial:!0},PJ={name:`wwwAutolink`,tokenize:VJ,previous:JJ},FJ={name:`protocolAutolink`,tokenize:HJ,previous:YJ},IJ={name:`emailAutolink`,tokenize:BJ,previous:XJ},LJ={};function RJ(){return{text:LJ}}for(var zJ=48;zJ<123;)LJ[zJ]=IJ,zJ++,zJ===58?zJ=65:zJ===91&&(zJ=97);LJ[43]=IJ,LJ[45]=IJ,LJ[46]=IJ,LJ[95]=IJ,LJ[72]=[IJ,FJ],LJ[104]=[IJ,FJ],LJ[87]=[IJ,PJ],LJ[119]=[IJ,PJ];function BJ(e,t,n){let r=this,i,a;return o;function o(t){return!ZJ(t)||!XJ.call(r,r.previous)||QJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return ZJ(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(NJ,u,l)(t):t===45||t===95||Ih(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&&Fh(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function VJ(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!JJ.call(r,r.previous)||QJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(kJ,e.attempt(AJ,e.attempt(jJ,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function HJ(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&YJ.call(r,r.previous)&&!QJ(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Fh(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||Rh(t)||Hh(t)||Gh(t)||Wh(t)?n(t):e.attempt(AJ,e.attempt(jJ,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function UJ(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 WJ(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(MJ,c,s)(t):t===null||Hh(t)||Gh(t)||t!==45&&Wh(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 GJ(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(MJ,t,a)(o):o===null||Hh(o)||Gh(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function KJ(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||Hh(o)||Gh(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Hh(e)||Gh(e)?t(e):r(e)}function a(e){return Fh(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Fh(t)?(e.consume(t),o):n(t)}}function qJ(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ih(e)?n(e):t(e)}}function JJ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Hh(e)}function YJ(e){return!Fh(e)}function XJ(e){return!(e===47||ZJ(e))}function ZJ(e){return e===43||e===45||e===46||e===95||Ih(e)}function QJ(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 $J={tokenize:sY,partial:!0};function eY(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:iY,continuation:{tokenize:aY},exit:oY}},text:{91:{name:`gfmFootnoteCall`,tokenize:rY},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tY,resolveTo:nY}}}}function tY(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=Ph(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 nY(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 rY(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||Hh(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ph(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Hh(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 iY(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||Hh(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ph(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Hh(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),Jh(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function aY(e,t,n){return e.check(lg,t,e.attempt($J,t,n))}function oY(e){e.exit(`gfmFootnoteDefinition`)}function sY(e,t,n){let r=this;return Jh(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 cY(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&&Dh(o,o.length,0,ng(s,e.slice(r+1,n),t)),Dh(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Dh(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=tg(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=tg(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var lY=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){uY(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 uY(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 dY(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 fY(){return{flow:{null:{name:`table`,tokenize:pY,resolveAll:mY}}}}function pY(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):U(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Uh(t)?Jh(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||Hh(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,Uh(t)?Jh(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 Uh(t)?Jh(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||U(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 Uh(t)?Jh(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||U(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||U(n)?(e.exit(`tableRow`),t(n)):Uh(n)?Jh(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Hh(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 mY(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 lY;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(gY(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=hY(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=hY(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=hY(f,t,o,i,n,d)):(o[0]=o[1],d=hY(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&gY(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=dY(t.events,n))}return e}function hY(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},_Y(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=_Y(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=_Y(t.events,n[2]),a=_Y(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({},_Y(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function gY(e,t,n,r,i){let a=[],o=_Y(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 _Y(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var vY={name:`tasklistCheck`,tokenize:bY};function yY(){return{text:{91:vY}}}function bY(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 Hh(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 U(r)?t(r):Uh(r)?e.check({tokenize:xY},t,n)(r):n(r)}}function xY(e,t,n){return Jh(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function SY(e){return Ah([RJ(),eY(),cY(e),fY(),yY()])}var CY={};function wY(e){let t=this,n=e||CY,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(SY(n)),a.push(DJ()),o.push(OJ(n))}var TY=new Set([`http:`,`https:`,`mailto:`]);function EY(e){try{return new URL(e)}catch{return}}function DY(e){let t=e===void 0?void 0:EY(e)?.protocol;return t!==void 0&&TY.has(t)?e:void 0}var OY={target:`_blank`,rel:`noopener noreferrer`},kY=typeof window>`u`?z.useEffect:z.useLayoutEffect;function AY(e,t){let n=(0,z.useRef)(null);return kY(()=>{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 jY(e){return e.tagName===`img`?{type:`text`,value:String(e.properties?.alt||`image`)}:(e.children&&=e.children.map(jY),e)}function MY(){let e=t=>{t.tagName===`a`?jY(t):t.children?.forEach(e)};return e}function NY({href:e,children:t}){let n=DY(e);return(0,B.jsx)(`a`,{href:n,...n===void 0?{}:OY,children:t})}var PY={a:({href:e,children:t})=>(0,B.jsx)(NY,{href:e,children:t}),img:({src:e,alt:t})=>(0,B.jsx)(NY,{href:typeof e==`string`?e:void 0,children:t||`image`})},FY=[wY],IY=[MY];function LY({source:e,clamp:t}){let n=t!==void 0&&Number.isInteger(t)&&t>0?t:void 0,r=AY(n,e),i=n===void 0?void 0:{WebkitLineClamp:n,maxHeight:`calc(${n} * 1lh)`};return(0,B.jsx)(`div`,{className:n===void 0?`otg-markdown`:`otg-markdown otg-markdown--clamped`,ref:r,style:i,children:(0,B.jsx)(Cb,{components:PY,rehypePlugins:IY,remarkPlugins:FY,children:e})})}function RY({title:e,body:t,badges:n,meta:r,links:i,actions:a,clamp:o,children:s,className:c,...l}){let u=(0,z.useId)();return(0,B.jsx)(`article`,{...l,"aria-labelledby":u,className:c?`otg-card ${c}`:`otg-card`,children:(0,B.jsxs)(`div`,{className:`otg-card__surface`,children:[(0,B.jsxs)(`div`,{className:`otg-card__header`,children:[n!=null&&(0,B.jsx)(`div`,{className:`otg-card__badges`,children:n}),(0,B.jsx)(`h3`,{className:`otg-card__title`,id:u,children:e}),a!=null&&(0,B.jsx)(`div`,{className:`otg-card__actions`,children:a})]}),r!=null&&(0,B.jsx)(`div`,{className:`otg-card__meta`,children:r}),i!=null&&(0,B.jsx)(`div`,{className:`otg-card__links`,children:i}),t?(0,B.jsx)(LY,{source:t,...o===void 0?{}:{clamp:o}}):null,s]})})}var zY=new Map([[`github.com`,`GitHub`],[`linear.app`,`Linear`]]);function BY(e){return zY.get(EY(e)?.hostname??``)??`tracker`}function VY({url:e,label:t,...n}){let r=DY(e);return(0,B.jsx)(`a`,{"aria-label":`Open ${BY(e)} issue ${t}`,...n,href:r,...OY,className:[`otg-source-link`,n.className].filter(Boolean).join(` `),children:t})}function HY({label:e,item:t,busyLabel:n=`${e}…`,reopen:r,sending:i,disabled:a=!1,onPress:o,className:s,control:c={}}){let[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(!1),p=(0,z.useId)(),m=t===void 0?e:`${e}: ${t}`,h=`Why ${e} is unavailable${t===void 0?``:`: ${t}`}`;return r?.available===!1?(0,B.jsxs)(`fieldset`,{"aria-label":`${m} (unavailable)`,className:`${s} human-items-unavailable`,onPointerEnter:()=>f(!0),onPointerLeave:()=>f(!1),children:[(0,B.jsx)(`button`,{"aria-describedby":p,disabled:!0,type:`button`,children:e}),(0,B.jsx)(`sup`,{className:`human-items-why-anchor`,children:(0,B.jsx)(`button`,{...c,"aria-controls":p,"aria-expanded":l,"aria-label":h,className:`human-items-why`,onClick:e=>{e.stopPropagation(),u(e=>!e)},type:`button`,children:`?`})}),(0,B.jsx)(`span`,{className:`human-items-why-tip`,hidden:!(l||d),id:p,role:`tooltip`,children:r.reason})]}):(0,B.jsx)(`button`,{...c,"aria-busy":i,"aria-label":i?void 0:m,className:s,disabled:a,onClick:()=>{i||o()},type:`button`,children:i?n:e})}var UY=15e3;function WY(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(null),{key:m,phase:h,followUp:g}=e,_=h===`sending`||g?.phase===`failed`||g?.phase===`sending`;return(0,z.useLayoutEffect)(()=>{if(f(!1),_)return;let e=setTimeout(()=>f(!0),UY);return()=>clearTimeout(e)},[`${m}:${h}:${g?.kind??``}:${g?.phase??``}`,_]),(0,z.useEffect)(()=>{c(!1),u(``)},[m]),(0,z.useEffect)(()=>{g?.kind===`note`&&g.phase===`done`&&(c(!1),u(``))},[g]),(0,z.useEffect)(()=>{if(!d||r||s)return;let e=p.current?.contains(document.activeElement)??!1;a&&e||t()},[d,r,a,s,t]),(0,z.useEffect)(()=>{if(!r)return;let e=e=>{let t=p.current;t!==null&&e.target instanceof Node&&!t.contains(e.target)&&i(!1)};return document.addEventListener(`pointerover`,e,!0),()=>document.removeEventListener(`pointerover`,e,!0)},[r]),(0,z.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 GY={complete:`Completed`,dismiss:`Dismissed`,reopen:`Reopened`},KY={complete:`Completing`,dismiss:`Dismissing`,reopen:`Reopening`},qY={complete:`Reopened`,dismiss:`Restored`,reopen:`Reopened`};function JY(e){let{action:t,title:n,phase:r,error:i,followUp:a}=e;if(r===`failed`)return`Not ${GY[t].toLowerCase()}: ${n}. ${i??``}`.trim();let o=qY[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`?`${KY[t]}: ${n}…`:`${GY[t]}: ${n}`}function YY({toast:e,onUndo:t,onNote:n,onClose:r,onRoom:i}){let{holds:a,writing:o,setWriting:s,text:c,setText:l}=WY(e,r,i),u=(0,z.useId)(),{action:d,phase:f,followUp:p}=e,m=f===`failed`||p?.phase===`failed`,h=f!==`failed`&&d!==`reopen`,g=p?.kind===`undo`&&p.phase===`done`,_=d===`dismiss`?`Add reason`:`Add comment`,v=d===`dismiss`?`Reason`:`Comment`,y=p?.kind===`note`&&p.phase===`sending`,b=p?.kind===`undo`&&p.phase===`sending`;return(0,B.jsxs)(`section`,{"aria-label":`Action result`,className:`human-items-toast`,"data-phase":p?.phase??f,"data-tone":m?`failure`:`success`,...a,children:[(0,B.jsx)(`p`,{className:`human-items-toast-message`,role:m?`alert`:`status`,children:JY(e)}),p?.kind===`note`&&p.saved!==void 0&&(0,B.jsx)(`blockquote`,{"aria-label":`Saved ${v.toLowerCase()}`,className:`human-items-toast-saved`,children:p.saved}),h&&!g&&(0,B.jsxs)(`div`,{className:`human-items-toast-actions`,children:[(0,B.jsx)(HY,{className:`human-items-toast-action`,disabled:b,label:d===`dismiss`?`Restore`:`Reopen`,onPress:t,reopen:e.reopen,sending:b}),!o&&(0,B.jsx)(`button`,{className:`human-items-toast-action`,onClick:()=>s(!0),type:`button`,children:_})]}),h&&!g&&o&&(0,B.jsxs)(`form`,{className:`human-items-toast-note`,onSubmit:e=>{e.preventDefault(),c.trim()!==``&&n(c)},children:[(0,B.jsx)(`label`,{className:`sr-only`,htmlFor:u,children:v}),(0,B.jsx)(`input`,{autoFocus:!0,id:u,onChange:e=>l(e.target.value),placeholder:`${v}, then Enter`,readOnly:y,value:c}),(0,B.jsx)(`button`,{"aria-busy":y,className:`human-items-toast-action`,disabled:y,type:`submit`,children:y?`Sending…`:p?.kind===`note`&&p.phase===`failed`?`Send again`:`Send`})]}),(0,B.jsx)(`button`,{"aria-label":`Close`,className:`human-items-toast-close`,onClick:r,type:`button`,children:(0,B.jsx)(Dt,{"aria-hidden":`true`,size:14})})]})}var XY=Lk.map(e=>({wire:e,label:Rk[e]}));function ZY(e){return Rk[e.priority]}function QY(e){return e.kind===`task`?`Task`:`Question`}var $Y={open:`Open`,answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`,expired:`Expired`},eX=[`open`,`answered`,`completed`,`dismissed`,`expired`],tX=eX.map(e=>({state:e,label:$Y[e]}));function nX(e){return $Y[e.state]}function rX(e){return e.state===`open`&&e.block.scope!==`nothing`}function iX(e){return e===1?`1 step`:`${e} steps`}function aX(e){let{item:t,blocked:n}=e;if(!rX(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 ${iX(t)} in ${e}`);default:return[]}}function oX(e){let t=aX(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 sX(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 cX(e){let t=aX(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 lX(e){return e===`user`?`you`:`the manager`}function uX(e){return e.resolution?.provenance??`manager`}var dX={"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`,"human-item-expired":`Expired`};function fX(e){let t=e.action===`human-item-expired`&&e.actor===`engine`?`the engine`:lX(e.provenance);return`${dX[e.action]} by ${t}`}var pX=60;function mX(e,t){return e===1?`${t}`:`${e} ${t}s`}function hX(e){return e%3600==0?mX(e/3600,`hour`):e%60==0?mX(e/60,`minute`):mX(e,`second`)}function gX(e){return e.join(` `)}function _X(e){switch(e.when){case`time`:return e.at===void 0?`${hX(e.after_seconds??0)} after it was raised`:`at ${me(e.at)}`;case`run`:return e.on===`settled`?`when run ${e.run} settles`:`when run ${e.run} ends`;case`node`:return`when step ${e.node} of run ${e.run} settles`;case`check`:return`when its check ${gX(e.command)} says so, checked every ${hX(e.interval_seconds??pX)}`}}function vX(e){let t=e.expiry??[];if(!(e.state!==`open`||t.length===0))return`Expires ${t.map(_X).join(`, or `)}`}function yX(e){switch(e.when){case`time`:return e.at===void 0?`${hX(e.after_seconds??0)} after it was raised`:`at ${me(e.at)}`;case`run`:return`run ${e.run} ${e.on===`settled`?`settled`:`ended`}`;case`node`:return`step ${e.node} of run ${e.run} settled`;case`check`:return`its check ${gX(e.command)}`}}function bX(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xX(e){let{resolution:t}=e;if(e.state!==`expired`||t===null)return;let n=t.condition??void 0;return{reason:bX(t.reason??``),held:n===void 0?``:bX(yX(n))}}function SX(e){switch(e.outcome){case`holds`:return`expired`;case`not-yet`:return`not yet`;case`failed`:return`failed: ${e.detail??``}`}}function CX(e){return e.item.state===`open`?(e.checks??[]).filter(({outcome:e})=>e===`failed`):[]}function wX(e){return(e.item.expiry??[]).map((t,n)=>({key:`${n}`,words:bX(_X(t)),last:e.checks?.find(e=>e.condition===n)}))}function TX(e){let{resolution:t}=e;if(t!==null){if(e.state===`dismissed`&&t.reason!==null)return{label:`Reason`,text:t.reason};if(e.state===`completed`&&t.text!==null)return{label:`Comment`,text:t.text}}}function EX(e){let{item:t}=e,{plan:n,run:r}=t.owner,i=aX(e).join(`; `),a={answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`}[t.state],o=TX(t),s=xX(t);return[{label:`Priority`,value:ZY(t)},{label:`Kind`,value:QY(t)},{label:`State`,value:nX(t)},{label:`Source`,value:sX(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:lX(uX(t))}],...o===void 0?[]:[{label:o.label,value:o.text}],...s===void 0?[]:[{label:`Expired`,at:t.updated_at,party:`the engine`},{label:`Reason`,value:s.reason},{label:`Condition that held`,value:s.held}]]}function DX(e,t){return e.find(e=>e===t)}var OX=[``,`task`,`question`],kX=[``,`yes`,`no`],AX=[``,...Lk],jX=eX,MX=[``,`session`,`run`,`plan`,`host`],NX={kind:``,blocking:``,priority:``,state:`open`,source:``,sourceId:``};function PX(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 FX(e){return Number(e.kind!==NX.kind)+Number(e.blocking!==NX.blocking)+Number(e.priority!==NX.priority)+Number(e.state!==NX.state)+Number(e.source!==NX.source)}var IX=[`priority`,`kind`,`source`,`blocking`,`none`],LX=`priority`,RX=[{value:`priority`,label:`Priority`},{value:`kind`,label:`Kind`},{value:`source`,label:`Source`},{value:`blocking`,label:`Blocking`},{value:`none`,label:`None`}],zX=[`default`,`newest`,`oldest`],BX=`default`,VX=[{value:`default`,label:`Default`},{value:`newest`,label:`Newest first`},{value:`oldest`,label:`Oldest first`}];function HX(e,t){if(t==="default")return e;let n=t===`newest`?-1:1;return e.map(e=>({view:e,at:Date.parse(e.item.created_at)})).sort((e,t)=>n*(e.at-t.at)).map(({view:e})=>e)}function UX(e){if(typeof e!=`object`||!e)return;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:``},n=DX(jX,t(`state`));if(n!==void 0)return{kind:DX(OX,t(`kind`))??``,blocking:DX(kX,t(`blocking`))??``,priority:DX(AX,t(`priority`))??``,state:n,source:DX(MX,t(`source`))??``,sourceId:t(`sourceId`)}}function WX(e,t){let{item:n}=e;switch(t){case`priority`:return{key:n.priority,label:ZY(n),rank:Lk.indexOf(n.priority)};case`kind`:return{key:n.kind,label:QY(n),rank:n.kind===`task`?0:1};case`blocking`:return rX(n)?{key:`blocking`,label:`Blocking`,rank:0}:{key:`not-blocking`,label:`Not blocking`,rank:1};case`source`:{let e=sX(n);return{key:e,label:`Source: ${e}`,rank:0}}}}function GX(e,t,n=BX){if(t===`none`)return[{key:`all`,items:HX(e,n)}];let r=new Map;return e.forEach((e,n)=>{let{key:i,label:a,rank:o}=WX(e,t),s=r.get(i);s?s.items.push(e):r.set(i,{label:a,rank:o,first:n,items:[e]})}),[...r.entries()].sort(([,e],[,t])=>e.rank-t.rank||e.first-t.first).map(([e,{label:t,items:r}])=>({key:e,label:t,items:HX(r,n)}))}function KX({answers:e,onRoom:t}){let n=(0,z.useRef)(null),{count:r,remaining:i,sending:a,sendError:o,notices:s}=e,c=r>0||o!==void 0||s.length>0;return(0,z.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,B.jsxs)(`section`,{"aria-label":`Drafted answers`,className:`human-items-send`,ref:n,children:[r>0&&(0,B.jsxs)(`div`,{className:`human-items-send-bar`,children:[(0,B.jsx)(`button`,{"aria-busy":a,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,B.jsx)(`button`,{className:`human-items-send-action`,disabled:a,onClick:e.discard,type:`button`,children:`Discard`}),i>0&&(0,B.jsxs)(`span`,{className:`human-items-send-more`,children:[i,` more after this`]})]}),o!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent, and your drafts are kept: `,o]}),s.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Not sent`,className:`human-items-not-sent`,children:s.map(t=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`p`,{children:[(0,B.jsxs)(`strong`,{children:[`Not sent: `,t.title]}),` (`,t.reason,`)`]}),t.choiceTitle!==void 0&&(0,B.jsxs)(`p`,{children:[`Choice: `,t.choiceTitle]}),t.text!==void 0&&(0,B.jsx)(LY,{source:t.text}),(0,B.jsx)(`button`,{className:`human-items-send-action`,onClick:()=>e.clearNotice(t.key),type:`button`,children:`Clear`})]},t.key))})]}):null}var qX=`answered or dismissed elsewhere`,JX=`onepipeline-ui.human-items.draft.`,YX=/^[^\s/?#]+$/u,XX=J({title:K(),choice:K().optional(),choiceTitle:K().optional(),text:K().optional()});function ZX(){try{let e={};for(let t=0;t<window.localStorage.length;t+=1){let n=window.localStorage.key(t);if(n===null||!n.startsWith(JX))continue;let r=n.slice(33),i=QX(window.localStorage.getItem(n));i!==void 0&&YX.test(r)&&(e[r]=i)}return e}catch{return}}function QX(e){if(e!==null)try{let t=XX.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}}function $X(e,t){try{t===void 0?window.localStorage.removeItem(`${JX}${e}`):window.localStorage.setItem(`${JX}${e}`,JSON.stringify(t))}catch{}}function eZ(e){return e!==void 0&&e.trim()!==``}function tZ(e){return e.choice!==void 0||eZ(e.text)}function nZ(e,t){return{id:e,...t.choice===void 0?{}:{choice:t.choice},...eZ(t.text)?{text:t.text}:{}}}function rZ(e){return e.kind===`conflict`?e.reason:`human items are unavailable on this host`}async function iZ(e,t){try{return(await e.getHumanItem(t)).item.state!==`open`}catch(e){return e instanceof cN&&e.status===404||void 0}}function aZ(e,t){return e[t]===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function oZ(e,t,n,r,i,a){let[o,s]=(0,z.useState)(()=>ZX()??{}),[c,l]=(0,z.useState)({}),[u,d]=(0,z.useState)([]),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(),g=(0,z.useRef)(!1),_=(0,z.useRef)(0),v=(0,z.useRef)(o);v.current=o;let y=(0,z.useRef)(new Set),b=(0,z.useRef)(new Set),x=(0,z.useRef)(0),S=(0,z.useCallback)((e,t)=>{$X(e,t),s(n=>t===void 0?aZ(n,e):{...n,[e]:t}),l(t=>aZ(t,e)),h(void 0)},[]),C=(0,z.useCallback)((e,t)=>{let n=v.current[e];if(n===void 0)return;$X(e,void 0),s(t=>aZ(t,e)),l(t=>aZ(t,e)),_.current+=1;let r=_.current;d(e=>[...e,{...n,key:r,reason:t}])},[]),w=(0,z.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,tZ(a)?a:void 0)},[S]),T=(0,z.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])=>tZ(e)),D=E.slice(0,50),O=(0,z.useCallback)(async(t,n)=>{await iZ(e,t)===!0?C(t,n):l(e=>({...e,[t]:n}))},[e,C]),k=(0,z.useCallback)(async()=>{if(g.current)return;let t=ZX(),n=D.filter(([e])=>t!==void 0&&t[e]===void 0);for(let[e]of n)s(t=>aZ(t,e));let r=D.flatMap(([e,t])=>n.some(([t])=>t===e)?[]:[nZ(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)$X(e.item.id,void 0),s(t=>aZ(t,e.item.id)),l(t=>aZ(t,e.item.id));i(t.answered),await Promise.all(t.refused.map(({id:e,refusal:t})=>O(e,rZ(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,z.useCallback)(()=>{for(let e of Object.keys(v.current))$X(e,void 0);s({}),l({}),h(void 0)},[]),j=(0,z.useCallback)(e=>{d(t=>t.filter(t=>t.key!==e))},[]);return(0,z.useEffect)(()=>{y.current.clear(),x.current+=1},[n]),(0,z.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,qX);continue}y.current.has(e)||b.current.has(e)||n(e)}function n(t){let r=x.current;b.current.add(t),iZ(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,qX):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 sZ(e,t,n,r=String){let[i,a]=(0,z.useState)(()=>{try{let r=window.localStorage.getItem(e);return(r===null?void 0:t(r))??n}catch{return n}});return[i,(0,z.useCallback)(t=>{a(t);try{window.localStorage.setItem(e,r(t))}catch{}},[e,r])]}var cZ=`onepipeline-ui.human-items.filters`;function lZ(e){try{return UX(JSON.parse(e))}catch{return}}function uZ(e){let[t,n]=sZ(cZ,lZ,NX,JSON.stringify),[r,i]=(0,z.useState)(),a=(0,z.useMemo)(()=>{if(!e)return;let n=PX(t);return{type:`human-items`,...Object.keys(n).length===0?{}:{filter:n},...r===void 0?{}:{item:r}}},[e,JSON.stringify(PX(t)),r]);return(0,z.useEffect)(()=>{e||i(void 0)},[e]),{choice:t,setChoice:n,selectedId:r,setSelectedId:i,view:a}}function dZ(e,t,n,r,i=``){let[a,o]=(0,z.useState)({}),[s,c]=(0,z.useState)(),[l,u]=(0,z.useState)([]),[d,f]=(0,z.useState)({}),[p,m]=(0,z.useState)({}),[h,g]=(0,z.useState)(),_=(0,z.useRef)(new Set),v=(0,z.useRef)(new Map),y=(0,z.useRef)(0),b=(0,z.useRef)(void 0);b.current=s;let x=t.items,S=(0,z.useRef)(i);S.current=i,(0,z.useEffect)(()=>{m(e=>Object.keys(e).length===0?e:{})},[i]);let C=(0,z.useMemo)(()=>{if(x===void 0)return;let e=x.flatMap(e=>{let t=d[e.item.id];if(t!==void 0)return[t.view];let n=p[e.item.id]?.view;return n===void 0||!pZ(n,e)?[e]:n.item.state===r?[n]:[]}),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,...Object.values(d)])t(n.item.id)||e.splice(Math.min(r,e.length),0,n);return e},[x,l,p,d,r,i]);(0,z.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:pZ(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&&pZ(T,{item:w.item})?{...w,item:T.item,reopen:T.reopen}:w,D=(0,z.useRef)(x);D.current=x;let O=oZ(e,x,i,(0,z.useCallback)(e=>_.current.has(e),[]),(0,z.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,z.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,z.useCallback)((e,t)=>c(n=>n?.key===e?t(n):n),[]),j=(0,z.useCallback)((t,n,r)=>{let{id:i,title:a}=t.item;if(_.current.has(i))return;_.current.add(i);let s=++y.current,l=S.current,u=Math.max(0,D.current?.findIndex(({item:e})=>e.id===i)??0);o(e=>({...e,[i]:{pending:n.action}})),f(e=>({...e,[i]:{view:t,at:u}})),c({key:s,id:i,title:a,action:n.action,phase:`sending`});let d=n.action===`complete`?e.completeHumanItem(i):n.action===`dismiss`?e.dismissHumanItem(i,n.reason):e.reopenHumanItem(i);v.current.set(s,d),d.then(e=>{m(t=>({...t,[i]:{view:e.item,at:u,filter:l}})),o(e=>({...e,[i]:{}})),n.action!==`reopen`&&k(i,`dismissed here`),r?.(),A(s,t=>({...t,phase:`done`,reopen:e.item.reopen}))},e=>{let t=hZ(e);o(e=>({...e,[i]:{error:t}})),A(s,e=>({...e,phase:`failed`,error:t})),g({id:i})}).finally(()=>{_.current.delete(i),f(fZ(i))})},[e,A,k]),M=(0,z.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}}));let n=e===`note`?mZ(t.item.item):void 0;A(i,r=>({...r,reopen:t.item.reopen,followUp:{kind:e,phase:`done`,...n===void 0?{}:{saved:n}}}))},t=>A(i,n=>({...n,followUp:{kind:e,phase:`failed`,error:hZ(t)}})))},()=>A(i,e=>({...e,followUp:void 0})))},[A]),N=(0,z.useCallback)(()=>M(`undo`,t=>e.reopenHumanItem(t)),[e,M]),P=(0,z.useCallback)(t=>M(`note`,n=>e.noteHumanItem(n,t)),[e,M]),F=(0,z.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 fZ(e){return t=>t[e]===void 0?t:Object.fromEntries(Object.entries(t).filter(([t])=>t!==e))}function pZ(e,t){return Date.parse(e.item.updated_at)>Date.parse(t.item.updated_at)}function mZ(e){let{resolution:t}=e;if(t!==null)return(e.state===`dismissed`?t.reason:t.text)??void 0}function hZ(e){return e instanceof Error?e.message:String(e)}var gZ=`onepipeline-ui.human-items.group-by`,_Z=`onepipeline-ui.human-items.sort`,vZ=e=>DX(IX,e),yZ=e=>DX(zX,e);function bZ(){let[e,t]=sZ(gZ,vZ,LX),[n,r]=sZ(_Z,yZ,BX);return{groupBy:e,setGroupBy:t,sort:n,setSort:r}}var xZ=`data-card-action`,SZ=4;function CZ({client:e,live:t,choice:n,setChoice:r,selectedId:i,setSelectedId:a}){let o=dZ(e,t,i,n.state,JSON.stringify(n)),{groupBy:s,setGroupBy:c,sort:l,setSort:u}=bZ(),[d,f]=(0,z.useState)(0),[p,m]=(0,z.useState)(0),h=(0,z.useRef)(null),g=o.items?.find(({item:e})=>e.id===i)??o.detail,_=(0,z.useRef)(void 0);g===void 0?_.current?.item.id!==i&&(_.current=void 0):_.current=g;let v=(0,z.useRef)(i);v.current=i;let y=(e,t)=>{o.write(e,t,()=>{v.current===e.item.id&&a(void 0)})},b=o.returned;(0,z.useEffect)(()=>{b!==void 0&&h.current?.querySelector(`[data-item-id="${CSS.escape(b.id)}"]`)?.scrollIntoView({block:`nearest`})},[b]);let x=GX(o.items??[],s,l);return(0,B.jsxs)(`section`,{"aria-label":`Action items`,className:`human-items-page`,"data-detail-open":i!==void 0,style:wZ(d,p),children:[(0,B.jsx)(DZ,{choice:n,groupBy:s,onChange:r,onGroupBy:c,onSort:u,sort:l}),(0,B.jsxs)(`div`,{className:`human-items-body`,children:[(0,B.jsxs)(`section`,{"aria-label":`Action item list`,className:`human-items-list`,children:[o.listError&&(0,B.jsx)(`p`,{role:`alert`,children:o.listError}),o.items===void 0&&!o.listError&&(0,B.jsx)(`p`,{role:`status`,children:`Reading action items…`}),o.items?.length===0&&(0,B.jsx)(`p`,{role:`status`,children:`No action items match these filters.`}),(0,B.jsx)(`div`,{className:`human-items-groups`,onKeyDown:e=>EZ(e,h.current),ref:h,children:x.map(e=>(0,B.jsx)(TZ,{answering:o.answers,group:e,groupBy:s,onSelect:a,onWrite:y,selectedId:i,writes:o.writes},e.key))}),(o.items?.length??0)>0&&(0,B.jsx)(`button`,{className:`card-actions-entry`,onFocus:()=>h.current?.querySelector(`[${xZ}]`)?.focus(),type:`button`,children:`Card actions: use the arrow keys`})]}),i!==void 0&&(0,B.jsx)(KZ,{answering:o.answers,error:o.detailError,detail:o.detail,gone:o.gone,lastShown:_.current,onClose:()=>a(void 0),onWrite:y,state:o.writes[i],view:g})]}),(0,B.jsx)(KX,{answers:o.answers,onRoom:m}),o.toast&&(0,B.jsx)(YY,{onClose:o.closeToast,onNote:o.note,onRoom:f,onUndo:o.undo,toast:o.toast})]})}function wZ(e,t){return{"--toast-room":`${e}px`,"--send-room":`${t}px`}}function TZ({group:e,groupBy:t,selectedId:n,writes:r,answering:i,onSelect:a,onWrite:o}){let s=(0,z.useId)(),c=e.items.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(jZ,{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,B.jsx)(`ul`,{"aria-label":`Action items`,children:c}):(0,B.jsxs)(`section`,{"aria-labelledby":s,className:`human-items-group`,children:[(0,B.jsxs)(`h2`,{className:`human-items-group-heading`,id:s,children:[e.label,` `,(0,B.jsxs)(`span`,{className:`human-items-group-count`,children:[`(`,e.items.length,`)`]})]}),(0,B.jsx)(`ul`,{"aria-labelledby":s,children:c})]})}function EZ(e,t){let n=e.target;if(t===null||!(n instanceof HTMLElement)||!n.hasAttribute(xZ))return;let r=[...t.querySelectorAll(`[${xZ}]`)],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 DZ({choice:e,groupBy:t,sort:n,onChange:r,onGroupBy:i,onSort:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)(!1),l=(t,n)=>r({...e,[t]:n}),u=e.source!==``&&e.source!==`host`,d=FX(e)+Number(t!==LX);return(0,B.jsxs)(`div`,{className:`human-items-controls`,"data-open":s,children:[(0,B.jsxs)(`button`,{"aria-controls":`${o}-filters`,"aria-expanded":s,"aria-label":d>0?`Filters, ${d} changed`:`Filters`,className:`human-items-filters-toggle`,onClick:()=>c(e=>!e),type:`button`,children:[(0,B.jsx)(xt,{"aria-hidden":`true`,size:14}),`Filters`,d>0&&(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`human-items-filters-count`,children:d})]}),(0,B.jsx)(`select`,{"aria-label":`Sort`,className:`human-items-sort-toggle`,onChange:e=>a(OZ(e.target.value)),value:n,children:VX.map(({value:e,label:t})=>(0,B.jsxs)(`option`,{value:e,children:[`Sort: `,t]},e))}),(0,B.jsxs)(`fieldset`,{className:`human-items-filters`,id:`${o}-filters`,children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Filter action items`}),(0,B.jsx)(`label`,{htmlFor:`${o}-group`,children:`Group by`}),(0,B.jsx)(`select`,{id:`${o}-group`,onChange:e=>i(DX(IX,e.target.value)??`priority`),value:t,children:RX.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{className:`human-items-sort-label`,htmlFor:`${o}-sort`,children:`Sort`}),(0,B.jsx)(`select`,{className:`human-items-sort-select`,id:`${o}-sort`,onChange:e=>a(OZ(e.target.value)),value:n,children:VX.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${o}-kind`,children:`Kind`}),(0,B.jsxs)(`select`,{id:`${o}-kind`,onChange:e=>l(`kind`,DX(OX,e.target.value)??``),value:e.kind,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),(0,B.jsx)(`option`,{value:`task`,children:`Task`}),(0,B.jsx)(`option`,{value:`question`,children:`Question`})]}),(0,B.jsx)(`label`,{htmlFor:`${o}-blocking`,children:`Blocking`}),(0,B.jsxs)(`select`,{id:`${o}-blocking`,onChange:e=>l(`blocking`,DX(kX,e.target.value)??``),value:e.blocking,children:[(0,B.jsx)(`option`,{value:``,children:`Any`}),(0,B.jsx)(`option`,{value:`yes`,children:`Yes`}),(0,B.jsx)(`option`,{value:`no`,children:`No`})]}),(0,B.jsx)(`label`,{htmlFor:`${o}-priority`,children:`Priority`}),(0,B.jsxs)(`select`,{id:`${o}-priority`,onChange:e=>l(`priority`,DX(AX,e.target.value)??``),value:e.priority,children:[(0,B.jsx)(`option`,{value:``,children:`Any priority`}),XY.map(({wire:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))]}),(0,B.jsx)(`label`,{htmlFor:`${o}-state`,children:`State`}),(0,B.jsx)(`select`,{id:`${o}-state`,onChange:e=>l(`state`,DX(jX,e.target.value)??`open`),value:e.state,children:tX.map(({state:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${o}-source`,children:`Source`}),(0,B.jsxs)(`select`,{id:`${o}-source`,onChange:e=>l(`source`,DX(MX,e.target.value)??``),value:e.source,children:[(0,B.jsx)(`option`,{value:``,children:`Any source`}),(0,B.jsx)(`option`,{value:`session`,children:`Session`}),(0,B.jsx)(`option`,{value:`run`,children:`Run`}),(0,B.jsx)(`option`,{value:`plan`,children:`Plan`}),(0,B.jsx)(`option`,{value:`host`,children:`Host`})]}),u&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`label`,{htmlFor:`${o}-source-id`,children:`Source identifier`}),(0,B.jsx)(`input`,{id:`${o}-source-id`,onChange:e=>l(`sourceId`,e.target.value),placeholder:`${e.source} id`,type:`search`,value:e.sourceId})]})]})]})}function OZ(e){return DX(zX,e)??`default`}function kZ(e){return e.target instanceof Element&&e.target.closest(`a, button, textarea, input, select, [data-long-pressed="true"]`)===null}function AZ({view:e,groupBy:t}){let{item:n}=e;return(0,B.jsxs)(B.Fragment,{children:[n.state===`expired`&&(0,B.jsx)(`span`,{className:`human-item-expired-badge`,children:nX(n)}),t!==`priority`&&(0,B.jsx)(`span`,{className:`human-item-priority`,"data-priority":n.priority,children:ZY(n)}),t!==`kind`&&(0,B.jsx)(`span`,{className:`human-item-kind`,children:QY(n)}),t!==`blocking`&&rX(n)&&(0,B.jsx)(`span`,{className:`human-item-blocking`,children:`Blocking`})]})}function jZ({view:e,groupBy:t,selected:n,state:r,answering:i,onSelect:a,onWrite:o}){let{item:s}=e,c=s.state===`open`,l=s.state===`expired`,u=oX(e),d=[{key:`raised`,part:(0,B.jsx)(IZ,{at:s.created_at})},...c||l?[]:[{key:`state`,part:nX(s)}],...u?[{key:`blocked`,part:u}]:[],...t===`source`?[]:[{key:`source`,part:`Source: ${sX(s)}`}]],f=(s.choices?.length??0)>0,p=TX(s);return(0,B.jsxs)(RY,{actions:(0,B.jsx)(MZ,{item:e,onSelect:a,onWrite:o,state:r}),badges:(0,B.jsx)(AZ,{groupBy:t,view:e}),body:s.body,className:`human-item-card`,clamp:SZ,"data-blocking":rX(s),"data-expired":l,"data-item-id":s.id,"data-selected":n,meta:d.map(({key:e,part:t},n)=>(0,B.jsxs)(z.Fragment,{children:[n>0&&` · `,(0,B.jsx)(`span`,{children:t})]},e)),onClick:e=>{kZ(e)&&a()},title:s.title,children:[s.kind===`question`&&c&&f&&(0,B.jsxs)(`fieldset`,{className:`human-item-choices`,children:[(0,B.jsxs)(`legend`,{className:`sr-only`,children:[`Choices: `,s.title]}),s.choices?.map(t=>(0,B.jsx)(zZ,{answering:i,choice:t,view:e},t.id))]}),s.kind===`question`&&c&&(0,B.jsx)(BZ,{answering:i,label:`Answer: ${s.title}`,view:e}),(0,B.jsx)(UZ,{view:e}),p&&(0,B.jsx)(RZ,{label:p.label,text:p.text}),(0,B.jsx)(VZ,{view:e}),(0,B.jsx)(WZ,{reason:i.refusals[s.id]}),(0,B.jsx)(GZ,{state:r})]})}function MZ({item:e,state:t,onSelect:n,onWrite:r}){let{item:i}=e,a=i.state===`open`,o=t?.pending;return(0,B.jsxs)(B.Fragment,{children:[i.tracker&&(0,B.jsx)(VY,{className:`human-item-tracker`,"data-card-action":``,label:i.tracker.task,title:i.tracker.task,onClick:e=>e.stopPropagation(),tabIndex:-1,url:i.tracker.url}),(0,B.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:n,type:`button`,"aria-label":`Details: ${i.title}`,children:`Details`}),a&&i.kind===`task`&&(0,B.jsx)(FZ,{action:`complete`,control:NZ,className:`human-item-action`,name:`Complete: ${i.title}`,onPress:()=>r(e,{action:`complete`}),pending:o}),a&&(0,B.jsx)(FZ,{action:`dismiss`,control:NZ,className:`human-item-action`,name:`Dismiss: ${i.title}`,onPress:()=>r(e,{action:`dismiss`}),pending:o}),!a&&(0,B.jsx)(HY,{busyLabel:`Reopening…`,className:`human-item-action`,control:NZ,disabled:o!==void 0,label:`Reopen`,item:i.title,onPress:()=>r(e,{action:`reopen`}),reopen:e.reopen,sending:o===`reopen`})]})}var NZ={[xZ]:``,tabIndex:-1},PZ={complete:{label:`Complete`,busy:`Completing…`},dismiss:{label:`Dismiss`,busy:`Dismissing…`}};function FZ({action:e,name:t,pending:n,onPress:r,className:i,control:a={},children:o}){let s=n===e,c=PZ[e],l={...a,"aria-busy":s,"aria-label":s?void 0:t,className:i,disabled:n!==void 0,onClick:r,type:`button`,children:s?c.busy:c.label};return o?o(l):(0,B.jsx)(`button`,{...l})}function IZ({at:e}){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=(0,z.useRef)(void 0),o=(0,z.useId)(),s=Ae(e),c=()=>clearTimeout(a.current);return(0,B.jsxs)(`span`,{"aria-describedby":t?o:void 0,className:`human-item-raised`,"data-long-pressed":r,tabIndex:-1,onPointerCancel:c,onPointerEnter:e=>{e.pointerType===`mouse`&&n(!0)},onPointerDown:e=>{i(!1),e.pointerType!==`mouse`&&(c(),a.current=setTimeout(()=>{n(!0),i(!0)},LZ))},onPointerLeave:()=>{c(),n(!1)},onPointerUp:c,children:[`Raised `,(0,B.jsx)(u,{at:e,relative:!0}),t&&s!==void 0&&(0,B.jsx)(`span`,{className:`human-item-raised-tip`,id:o,role:`tooltip`,children:L(s)})]})}var LZ=500;function RZ({label:e,text:t}){return(0,B.jsxs)(`p`,{className:`human-item-note`,children:[(0,B.jsxs)(`span`,{className:`human-item-note-label`,children:[e,`:`]}),` `,t]})}function zZ({view:e,choice:t,answering:n}){return(0,B.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 BZ({view:e,label:t,answering:n}){return(0,B.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:(e.item.choices?.length??0)>0?`Or write your own answer`:`Write an answer`,readOnly:n.sending,rows:1,value:n.drafts[e.item.id]?.text??``})}function VZ({view:e}){let t=xX(e.item);if(t!==void 0)return(0,B.jsxs)(`p`,{className:`human-item-expiry-reason`,children:[t.reason,t.held!==``&&(0,B.jsxs)(`span`,{className:`human-item-expiry-held`,children:[` · `,t.held]})]});let n=vX(e.item);return(0,B.jsxs)(B.Fragment,{children:[n!==void 0&&(0,B.jsx)(`p`,{className:`human-item-expiry`,children:n}),CX(e).map(e=>(0,B.jsxs)(`p`,{className:`human-item-status human-item-check-failed`,"data-failed":`true`,title:e.detail??void 0,children:[`Check `,SX(e)]},e.condition))]})}function HZ({view:e}){if(e.item.state!==`open`)return null;let t=wX(e);return t.length===0?null:(0,B.jsxs)(`section`,{"aria-label":`Expiry`,className:`human-item-detail-expiry`,children:[(0,B.jsx)(`h3`,{children:`Expiry`}),(0,B.jsx)(`ul`,{children:t.map(({key:e,words:t,last:n})=>(0,B.jsxs)(`li`,{children:[t,n!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-check-detail`,"data-failed":n.outcome===`failed`,children:[`Last check `,SX(n),` · `,(0,B.jsx)(u,{at:n.last_run_at,relative:!0})]})]},e))})]})}function UZ({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,B.jsxs)(`section`,{"aria-label":`Answer`,className:`human-item-answered`,children:[i&&(0,B.jsx)(`p`,{className:`human-item-answered-choice`,children:i.title}),r!==null&&(0,B.jsx)(LY,{source:r})]})}function WZ({reason:e}){return e===void 0?null:(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent: `,e]})}function GZ({state:e}){return e?.error?(0,B.jsx)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:e.error}):null}function KZ({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,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[r&&(0,B.jsx)(`h2`,{children:r.item.title}),(0,B.jsx)(Vi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})})]}),(0,B.jsx)(`p`,{role:`status`,children:`Resolved: this item needs nothing more from you.`})]});let l=t??e;if(l===void 0)return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsx)(Vi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})}),i?(0,B.jsx)(`p`,{role:`alert`,children:i}):(0,B.jsx)(`p`,{role:`status`,children:`Reading…`})]});let{item:d}=l,f=d.state===`open`,p=d.choices??[],m=d.kind===`question`&&f;return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,tabIndex:0,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[(0,B.jsx)(`h2`,{children:d.title}),(0,B.jsx)(Vi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})})]}),i&&(0,B.jsx)(`p`,{role:`alert`,children:i}),(0,B.jsx)(`section`,{"aria-label":`Full body`,className:`human-item-detail-body`,children:(0,B.jsx)(LY,{source:d.body})}),m&&p.length>0&&(0,B.jsxs)(`fieldset`,{className:`human-item-choice-list`,children:[(0,B.jsx)(`legend`,{children:`Choices`}),p.map(e=>(0,B.jsxs)(`div`,{className:`human-item-choice-entry`,children:[(0,B.jsx)(zZ,{answering:o,choice:e,view:l}),(0,B.jsx)(`div`,{className:`human-item-choice-description`,children:(0,B.jsx)(LY,{source:e.description})})]},e.id))]}),m&&(0,B.jsx)(BZ,{answering:o,label:`Answer in detail: ${d.title}`,view:l}),(0,B.jsx)(UZ,{view:l}),(0,B.jsx)(HZ,{view:l}),(0,B.jsx)(WZ,{reason:o.refusals[d.id]}),(0,B.jsxs)(`div`,{className:`human-item-detail-actions`,children:[f&&d.kind===`task`&&(0,B.jsx)(FZ,{action:`complete`,onPress:()=>s(l,{action:`complete`}),pending:a?.pending,children:e=>(0,B.jsx)(Vi,{...e,size:`sm`})}),f&&(0,B.jsx)(FZ,{action:`dismiss`,onPress:()=>s(l,{action:`dismiss`}),pending:a?.pending,children:e=>(0,B.jsx)(Vi,{...e,size:`sm`,variant:`outline`})}),!f&&(0,B.jsx)(HY,{busyLabel:`Reopening…`,className:`human-item-detail-reopen`,disabled:a?.pending!==void 0,label:`Reopen`,onPress:()=>s(l,{action:`reopen`}),reopen:l.reopen,sending:a?.pending===`reopen`}),(0,B.jsx)(GZ,{state:a})]}),t?.history!==void 0&&t.history.length>0&&(0,B.jsx)(qZ,{history:t.history}),(0,B.jsxs)(`dl`,{className:`human-item-metadata`,children:[EX(l).map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:`value`in e?e.value:(0,B.jsxs)(B.Fragment,{children:[e.party!==void 0&&`By ${e.party} · `,(0,B.jsx)(u,{at:e.at,relative:!0})]})})]},e.label)),t&&t.nodes.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Blocked steps`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`section`,{"aria-label":`Blocked steps`,className:`human-item-steps`,children:cX(t).map(({phrase:e,nodes:t})=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>(0,B.jsxs)(`li`,{children:[e.run,` / `,e.node,`: `,e.title]},`${e.run}/${e.node}`))})]},e))})})]}),d.tracker&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Tracker`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(VY,{className:`human-item-tracker-full`,label:d.tracker.task,url:d.tracker.url})})]})]})]})}function qZ({history:e}){return(0,B.jsxs)(`section`,{"aria-label":`History`,className:`human-item-history`,children:[(0,B.jsx)(`h3`,{children:`History`}),(0,B.jsx)(`ol`,{children:e.map((e,t)=>(0,B.jsxs)(`li`,{children:[fX(e),` · `,(0,B.jsx)(u,{at:e.at,relative:!0})]},t))})]})}function JZ({className:e,state:t}){let n=YZ(t);return(0,B.jsxs)(T,{className:k(`gap-1.5 tracking-[.03em] uppercase`,n&&ZZ[n],e),variant:`outline`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),t]})}function YZ(e){return rQ[e]}var XZ=e=>{let t=YZ(e);return k(`size-2 shrink-0 rounded-full bg-current`,t===void 0?`text-muted-foreground`:QZ[t])},ZZ={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`},QZ={success:`text-success`,destructive:`text-destructive`,warning:`text-warning`,info:`text-info`},$Z=`success`,eQ=`destructive`,tQ=`warning`,nQ={blocked:tQ,cancelled:eQ,"complete-but-draft":tQ,"complete-but-held":tQ,done:$Z,failed:eQ,"not-completed":eQ,parked:void 0,pending:void 0,ready:void 0,running:`info`,skipped:tQ,unknown:void 0,waiting:void 0},rQ={...nQ,complete:nQ.done,settled:nQ.done,active:nQ.running},iQ=`/human-items`;function aQ(e){return e===`/human-items`||e===`/human-items/`}function oQ(e){return aQ(e)?`/`:e}function sQ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}var cQ=()=>window.location.pathname;function lQ(){let e=(0,z.useSyncExternalStore)(sQ,cQ,cQ),t=(0,z.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,``,`${iQ}${t}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{active:aQ(e),open:t}}var uQ={graph:`graph`,overall:`overall`};function dQ(e){return e!==null&&Object.hasOwn(uQ,e)}var fQ={projects:`projects`,runs:`runs`};function pQ(e){return e!==null&&Object.hasOwn(fQ,e)}var mQ={timeline:`Timeline`,task:`Task`,criteria:`Acceptance criteria`,dependencies:`Dependencies`,remote:`Remote`};function hQ(e){return e!==null&&Object.hasOwn(mQ,e)}function gQ(e,t){let n=e.get(t);return n!==null&&se(n)?n:void 0}function _Q(){let e=(0,z.useSyncExternalStore)(vQ,yQ,yQ),t=new URLSearchParams(e),n=t.get(`list`),r=pQ(n)?n:`projects`,i=t.get(`project`),a=i!==null&&(i===`none`||oM(i))?i:void 0,o=gQ(t,`run`),s=gQ(t,`node`),c=gQ(t,`event`),l=t.get(`view`),u=t.get(`tab`),d=u===`pr`||u===`checks`?`remote`:hQ(u)?u:`timeline`,f=dQ(l)?l:s===void 0?`overall`:`graph`,p=(0,z.useCallback)((e,t=!1)=>{let n=new URLSearchParams(window.location.search);e(n);let r=t?window.location.pathname:oQ(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`),hiddenEventTypes:[...new Set(t.getAll(`hide-event`))].filter(ge),selectEventTypes:e=>p(t=>{t.delete(`hide-event`);for(let n of e)t.append(`hide-event`,n)},!0),selectHost:()=>p(e=>{e.set(`page`,`host`)}),selectKinds:e=>p(t=>{t.delete(`hide-kind`);for(let n of e)t.append(`hide-kind`,n)},!0),projectKey:a,runId:o,nodeId:s,itemId:c,view:f,nodeTab:d,selectList:e=>p(t=>{e===`projects`?t.delete(`list`):t.set(`list`,e),t.delete(`project`)}),selectProject:e=>p(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=>p(t=>{t.set(`run`,e),t.delete(`page`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectNode:e=>p(t=>{e?t.set(`node`,e):t.delete(`node`),t.delete(`event`),t.delete(`tab`),t.set(`view`,`graph`)}),selectItem:e=>p(t=>{e?t.set(`event`,e):t.delete(`event`)}),showOverall:()=>p(e=>{e.set(`view`,`overall`),e.delete(`node`),e.delete(`event`),e.delete(`tab`)}),selectNodeTab:e=>p(t=>{e===`timeline`?t.delete(`tab`):t.set(`tab`,e),e!==`timeline`&&t.delete(`event`)})}}function vQ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function yQ(){return window.location.search}function bQ(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 xQ(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=bQ(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 SQ(e){let{done:t,failed:n,running:r}=e.nodes;return ee({done:t,failed:n,running:r})}function CQ(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 wQ(e,t,n,r){let[i,a]=(0,z.useState)(new Set),o=(0,z.useCallback)(e=>{a(t=>t.has(e)?t:new Set(t).add(e))},[]),s=(0,z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),c=(0,z.useMemo)(()=>xQ(e??[]),[e]),l=c.find(e=>e.rows.some(e=>e.id===n))?.key,[u,d]=(0,z.useState)();return l!==u&&(d(l),l!==void 0&&o(l)),(0,z.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 TQ=240,EQ=`data-row-key`;function DQ(e,t){let n=(0,z.useRef)(new Map);(0,z.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let r=t.getBoundingClientRect().top,i=[...t.querySelectorAll(`[${EQ}]`)],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(`
103
+ `))}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 hq(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=fJ.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 SJ(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&CJ(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function CJ(e,t){let n=!1;return Oy(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)&&wh(e)&&(t.options.setext||n))}function wJ(){return{exit:{taskListCheckValueChecked:EJ,taskListCheckValueUnchecked:EJ,paragraph:DJ}}}function TJ(){return{handlers:{paragraph:OJ},join:[kJ]}}function EJ(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function DJ(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 OJ(e,t,n,r){if(!t||t.type!==`listItem`||AJ(t)!==e)return fJ.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+fJ.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function kJ(e,t,n){if(!(e.type===`definition`&&n.type===`listItem`))return;let r=AJ(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function AJ(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function jJ(){return[AK(),nq(),sq(),pJ(),wJ()]}function MJ(e){return{extensions:[jK(),rq(e),cq(),xJ(e),TJ()]}}var NJ={tokenize:qJ,partial:!0},PJ={tokenize:JJ,partial:!0},FJ={tokenize:YJ,partial:!0},IJ={tokenize:XJ,partial:!0},LJ={tokenize:ZJ,partial:!0},RJ={name:`wwwAutolink`,tokenize:GJ,previous:QJ},zJ={name:`protocolAutolink`,tokenize:KJ,previous:$J},BJ={name:`emailAutolink`,tokenize:WJ,previous:eY},VJ={};function HJ(){return{text:VJ}}for(var UJ=48;UJ<123;)VJ[UJ]=BJ,UJ++,UJ===58?UJ=65:UJ===91&&(UJ=97);VJ[43]=BJ,VJ[45]=BJ,VJ[46]=BJ,VJ[95]=BJ,VJ[72]=[BJ,zJ],VJ[104]=[BJ,zJ],VJ[87]=[BJ,RJ],VJ[119]=[BJ,RJ];function WJ(e,t,n){let r=this,i,a;return o;function o(t){return!tY(t)||!eY.call(r,r.previous)||nY(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return tY(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(LJ,u,l)(t):t===45||t===95||zh(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&&Rh(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function GJ(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!QJ.call(r,r.previous)||nY(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(NJ,e.attempt(PJ,e.attempt(FJ,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function KJ(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&$J.call(r,r.previous)&&!nY(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Rh(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||Vh(t)||Gh(t)||Jh(t)||qh(t)?n(t):e.attempt(PJ,e.attempt(FJ,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function qJ(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 JJ(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(IJ,c,s)(t):t===null||Gh(t)||Jh(t)||t!==45&&qh(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 YJ(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(IJ,t,a)(o):o===null||Gh(o)||Jh(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function XJ(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||Gh(o)||Jh(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Gh(e)||Jh(e)?t(e):r(e)}function a(e){return Rh(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Rh(t)?(e.consume(t),o):n(t)}}function ZJ(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return zh(e)?n(e):t(e)}}function QJ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Gh(e)}function $J(e){return!Rh(e)}function eY(e){return!(e===47||tY(e))}function tY(e){return e===43||e===45||e===46||e===95||zh(e)}function nY(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 rY={tokenize:dY,partial:!0};function iY(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:cY,continuation:{tokenize:lY},exit:uY}},text:{91:{name:`gfmFootnoteCall`,tokenize:sY},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:aY,resolveTo:oY}}}}function aY(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=Lh(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 oY(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 sY(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||Gh(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Lh(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Gh(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 cY(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||Gh(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Lh(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Gh(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),Zh(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function lY(e,t,n){return e.check(fg,t,e.attempt(rY,t,n))}function uY(e){e.exit(`gfmFootnoteDefinition`)}function dY(e,t,n){let r=this;return Zh(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 fY(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&&Ah(o,o.length,0,ag(s,e.slice(r+1,n),t)),Ah(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ah(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=ig(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=ig(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var pY=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){mY(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 mY(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 hY(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 gY(){return{flow:{null:{name:`table`,tokenize:_Y,resolveAll:vY}}}}function _Y(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):U(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Kh(t)?Zh(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||Gh(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,Kh(t)?Zh(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 Kh(t)?Zh(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||U(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 Kh(t)?Zh(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||U(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||U(n)?(e.exit(`tableRow`),t(n)):Kh(n)?Zh(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Gh(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 vY(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 pY;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(bY(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=yY(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=yY(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=yY(f,t,o,i,n,d)):(o[0]=o[1],d=yY(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&bY(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=hY(t.events,n))}return e}function yY(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},xY(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=xY(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=xY(t.events,n[2]),a=xY(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({},xY(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function bY(e,t,n,r,i){let a=[],o=xY(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 xY(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var SY={name:`tasklistCheck`,tokenize:wY};function CY(){return{text:{91:SY}}}function wY(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 Gh(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 U(r)?t(r):Kh(r)?e.check({tokenize:TY},t,n)(r):n(r)}}function TY(e,t,n){return Zh(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function EY(e){return Nh([HJ(),iY(),fY(e),gY(),CY()])}var DY={};function OY(e){let t=this,n=e||DY,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(EY(n)),a.push(jJ()),o.push(MJ(n))}var kY=new Set([`http:`,`https:`,`mailto:`]);function AY(e){try{return new URL(e)}catch{return}}function jY(e){let t=e===void 0?void 0:AY(e)?.protocol;return t!==void 0&&kY.has(t)?e:void 0}var MY={target:`_blank`,rel:`noopener noreferrer`},NY=typeof window>`u`?z.useEffect:z.useLayoutEffect;function PY(e,t){let n=(0,z.useRef)(null);return NY(()=>{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 FY(e){return e.tagName===`img`?{type:`text`,value:String(e.properties?.alt||`image`)}:(e.children&&=e.children.map(FY),e)}function IY(){let e=t=>{t.tagName===`a`?FY(t):t.children?.forEach(e)};return e}function LY({href:e,children:t}){let n=jY(e);return(0,B.jsx)(`a`,{href:n,...n===void 0?{}:MY,children:t})}var RY={a:({href:e,children:t})=>(0,B.jsx)(LY,{href:e,children:t}),img:({src:e,alt:t})=>(0,B.jsx)(LY,{href:typeof e==`string`?e:void 0,children:t||`image`})},zY=[OY],BY=[IY];function VY({source:e,clamp:t}){let n=t!==void 0&&Number.isInteger(t)&&t>0?t:void 0,r=PY(n,e),i=n===void 0?void 0:{WebkitLineClamp:n,maxHeight:`calc(${n} * 1lh)`};return(0,B.jsx)(`div`,{className:n===void 0?`otg-markdown`:`otg-markdown otg-markdown--clamped`,ref:r,style:i,children:(0,B.jsx)(Eb,{components:RY,rehypePlugins:BY,remarkPlugins:zY,children:e})})}function HY({title:e,body:t,badges:n,meta:r,links:i,actions:a,clamp:o,children:s,className:c,...l}){let u=(0,z.useId)();return(0,B.jsx)(`article`,{...l,"aria-labelledby":u,className:c?`otg-card ${c}`:`otg-card`,children:(0,B.jsxs)(`div`,{className:`otg-card__surface`,children:[(0,B.jsxs)(`div`,{className:`otg-card__header`,children:[n!=null&&(0,B.jsx)(`div`,{className:`otg-card__badges`,children:n}),(0,B.jsx)(`h3`,{className:`otg-card__title`,id:u,children:e}),a!=null&&(0,B.jsx)(`div`,{className:`otg-card__actions`,children:a})]}),r!=null&&(0,B.jsx)(`div`,{className:`otg-card__meta`,children:r}),i!=null&&(0,B.jsx)(`div`,{className:`otg-card__links`,children:i}),t?(0,B.jsx)(VY,{source:t,...o===void 0?{}:{clamp:o}}):null,s]})})}var UY=new Map([[`github.com`,`GitHub`],[`linear.app`,`Linear`]]);function WY(e){return UY.get(AY(e)?.hostname??``)??`tracker`}function GY({url:e,label:t,...n}){let r=jY(e);return(0,B.jsx)(`a`,{"aria-label":`Open ${WY(e)} issue ${t}`,...n,href:r,...MY,className:[`otg-source-link`,n.className].filter(Boolean).join(` `),children:t})}function KY({label:e,item:t,busyLabel:n=`${e}…`,reopen:r,sending:i,disabled:a=!1,onPress:o,className:s,control:c={}}){let[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(!1),p=(0,z.useId)(),m=t===void 0?e:`${e}: ${t}`,h=`Why ${e} is unavailable${t===void 0?``:`: ${t}`}`;return r?.available===!1?(0,B.jsxs)(`fieldset`,{"aria-label":`${m} (unavailable)`,className:`${s} human-items-unavailable`,onPointerEnter:()=>f(!0),onPointerLeave:()=>f(!1),children:[(0,B.jsx)(`button`,{"aria-describedby":p,disabled:!0,type:`button`,children:e}),(0,B.jsx)(`sup`,{className:`human-items-why-anchor`,children:(0,B.jsx)(`button`,{...c,"aria-controls":p,"aria-expanded":l,"aria-label":h,className:`human-items-why`,onClick:e=>{e.stopPropagation(),u(e=>!e)},type:`button`,children:`?`})}),(0,B.jsx)(`span`,{className:`human-items-why-tip`,hidden:!(l||d),id:p,role:`tooltip`,children:r.reason})]}):(0,B.jsx)(`button`,{...c,"aria-busy":i,"aria-label":i?void 0:m,className:s,disabled:a,onClick:()=>{i||o()},type:`button`,children:i?n:e})}var qY=15e3;function JY(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(null),{key:m,phase:h,followUp:g}=e,_=h===`sending`||g?.phase===`failed`||g?.phase===`sending`;return(0,z.useLayoutEffect)(()=>{if(f(!1),_)return;let e=setTimeout(()=>f(!0),qY);return()=>clearTimeout(e)},[`${m}:${h}:${g?.kind??``}:${g?.phase??``}`,_]),(0,z.useEffect)(()=>{c(!1),u(``)},[m]),(0,z.useEffect)(()=>{g?.kind===`note`&&g.phase===`done`&&(c(!1),u(``))},[g]),(0,z.useEffect)(()=>{if(!d||r||s)return;let e=p.current?.contains(document.activeElement)??!1;a&&e||t()},[d,r,a,s,t]),(0,z.useEffect)(()=>{if(!r)return;let e=e=>{let t=p.current;t!==null&&e.target instanceof Node&&!t.contains(e.target)&&i(!1)};return document.addEventListener(`pointerover`,e,!0),()=>document.removeEventListener(`pointerover`,e,!0)},[r]),(0,z.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 YY={complete:`Completed`,dismiss:`Dismissed`,reopen:`Reopened`},XY={complete:`Completing`,dismiss:`Dismissing`,reopen:`Reopening`},ZY={complete:`Reopened`,dismiss:`Restored`,reopen:`Reopened`};function QY(e){let{action:t,title:n,phase:r,error:i,followUp:a}=e;if(r===`failed`)return`Not ${YY[t].toLowerCase()}: ${n}. ${i??``}`.trim();let o=ZY[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`?`${XY[t]}: ${n}…`:`${YY[t]}: ${n}`}function $Y({toast:e,onUndo:t,onNote:n,onClose:r,onRoom:i}){let{holds:a,writing:o,setWriting:s,text:c,setText:l}=JY(e,r,i),u=(0,z.useId)(),{action:d,phase:f,followUp:p}=e,m=f===`failed`||p?.phase===`failed`,h=f!==`failed`&&d!==`reopen`,g=p?.kind===`undo`&&p.phase===`done`,_=d===`dismiss`?`Add reason`:`Add comment`,v=d===`dismiss`?`Reason`:`Comment`,y=p?.kind===`note`&&p.phase===`sending`,b=p?.kind===`undo`&&p.phase===`sending`;return(0,B.jsxs)(`section`,{"aria-label":`Action result`,className:`human-items-toast`,"data-phase":p?.phase??f,"data-tone":m?`failure`:`success`,...a,children:[(0,B.jsx)(`p`,{className:`human-items-toast-message`,role:m?`alert`:`status`,children:QY(e)}),p?.kind===`note`&&p.saved!==void 0&&(0,B.jsx)(`blockquote`,{"aria-label":`Saved ${v.toLowerCase()}`,className:`human-items-toast-saved`,children:p.saved}),h&&!g&&(0,B.jsxs)(`div`,{className:`human-items-toast-actions`,children:[(0,B.jsx)(KY,{className:`human-items-toast-action`,disabled:b,label:d===`dismiss`?`Restore`:`Reopen`,onPress:t,reopen:e.reopen,sending:b}),!o&&(0,B.jsx)(`button`,{className:`human-items-toast-action`,onClick:()=>s(!0),type:`button`,children:_})]}),h&&!g&&o&&(0,B.jsxs)(`form`,{className:`human-items-toast-note`,onSubmit:e=>{e.preventDefault(),c.trim()!==``&&n(c)},children:[(0,B.jsx)(`label`,{className:`sr-only`,htmlFor:u,children:v}),(0,B.jsx)(`input`,{autoFocus:!0,id:u,onChange:e=>l(e.target.value),placeholder:`${v}, then Enter`,readOnly:y,value:c}),(0,B.jsx)(`button`,{"aria-busy":y,className:`human-items-toast-action`,disabled:y,type:`submit`,children:y?`Sending…`:p?.kind===`note`&&p.phase===`failed`?`Send again`:`Send`})]}),(0,B.jsx)(`button`,{"aria-label":`Close`,className:`human-items-toast-close`,onClick:r,type:`button`,children:(0,B.jsx)(Dt,{"aria-hidden":`true`,size:14})})]})}var eX=Hk.map(e=>({wire:e,label:Uk[e]}));function tX(e){return Uk[e.priority]}function nX(e){return e.kind===`task`?`Task`:`Question`}var rX={open:`Open`,answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`,expired:`Expired`},iX=[`open`,`answered`,`completed`,`dismissed`,`expired`],aX=iX.map(e=>({state:e,label:rX[e]}));function oX(e){return rX[e.state]}function sX(e){return e.state===`open`&&e.block.scope!==`nothing`}function cX(e){return e===1?`1 step`:`${e} steps`}function lX(e){let{item:t,blocked:n}=e;if(!sX(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 ${cX(t)} in ${e}`);default:return[]}}function uX(e){let t=lX(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 dX(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 fX(e){let t=lX(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 pX(e){return e===`user`?`you`:`the manager`}function mX(e){return e.resolution?.provenance??`manager`}var hX={"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`,"human-item-expired":`Expired`};function gX(e){let t=e.action===`human-item-expired`&&e.actor===`engine`?`the engine`:pX(e.provenance);return`${hX[e.action]} by ${t}`}var _X=60;function vX(e,t){return e===1?`${t}`:`${e} ${t}s`}function yX(e){return e%3600==0?vX(e/3600,`hour`):e%60==0?vX(e/60,`minute`):vX(e,`second`)}function bX(e){return e.join(` `)}function xX(e){switch(e.when){case`time`:return e.at===void 0?`${yX(e.after_seconds??0)} after it was raised`:`at ${me(e.at)}`;case`run`:return e.on===`settled`?`when run ${e.run} settles`:`when run ${e.run} ends`;case`node`:return`when step ${e.node} of run ${e.run} settles`;case`check`:return`when its check ${bX(e.command)} says so, checked every ${yX(e.interval_seconds??_X)}`}}function SX(e){let t=e.expiry??[];if(!(e.state!==`open`||t.length===0))return`Expires ${t.map(xX).join(`, or `)}`}function CX(e){switch(e.when){case`time`:return e.at===void 0?`${yX(e.after_seconds??0)} after it was raised`:`at ${me(e.at)}`;case`run`:return`run ${e.run} ${e.on===`settled`?`settled`:`ended`}`;case`node`:return`step ${e.node} of run ${e.run} settled`;case`check`:return`its check ${bX(e.command)}`}}function wX(e){return e.charAt(0).toUpperCase()+e.slice(1)}function TX(e){let{resolution:t}=e;if(e.state!==`expired`||t===null)return;let n=t.condition??void 0;return{reason:wX(t.reason??``),held:n===void 0?``:wX(CX(n))}}function EX(e){switch(e.outcome){case`holds`:return`expired`;case`not-yet`:return`not yet`;case`failed`:return`failed: ${e.detail??``}`}}function DX(e){return e.item.state===`open`?(e.checks??[]).filter(({outcome:e})=>e===`failed`):[]}function OX(e){return(e.item.expiry??[]).map((t,n)=>({key:`${n}`,words:wX(xX(t)),last:e.checks?.find(e=>e.condition===n)}))}function kX(e){let{resolution:t}=e;if(t!==null){if(e.state===`dismissed`&&t.reason!==null)return{label:`Reason`,text:t.reason};if(e.state===`completed`&&t.text!==null)return{label:`Comment`,text:t.text}}}function AX(e){let{item:t}=e,{plan:n,run:r}=t.owner,i=lX(e).join(`; `),a={answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`}[t.state],o=kX(t),s=TX(t);return[{label:`Priority`,value:tX(t)},{label:`Kind`,value:nX(t)},{label:`State`,value:oX(t)},{label:`Source`,value:dX(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:pX(mX(t))}],...o===void 0?[]:[{label:o.label,value:o.text}],...s===void 0?[]:[{label:`Expired`,at:t.updated_at,party:`the engine`},{label:`Reason`,value:s.reason},{label:`Condition that held`,value:s.held}]]}function jX(e,t){return e.find(e=>e===t)}var MX=[``,`task`,`question`],NX=[``,`yes`,`no`],PX=[``,...Hk],FX=iX,IX=[``,`session`,`run`,`plan`,`host`],LX={kind:``,blocking:``,priority:``,state:`open`,source:``,sourceId:``};function RX(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 zX(e){return Number(e.kind!==LX.kind)+Number(e.blocking!==LX.blocking)+Number(e.priority!==LX.priority)+Number(e.state!==LX.state)+Number(e.source!==LX.source)}var BX=[`priority`,`kind`,`source`,`blocking`,`none`],VX=`priority`,HX=[{value:`priority`,label:`Priority`},{value:`kind`,label:`Kind`},{value:`source`,label:`Source`},{value:`blocking`,label:`Blocking`},{value:`none`,label:`None`}],UX=[`default`,`newest`,`oldest`],WX=`default`,GX=[{value:`default`,label:`Default`},{value:`newest`,label:`Newest first`},{value:`oldest`,label:`Oldest first`}];function KX(e,t){if(t==="default")return e;let n=t===`newest`?-1:1;return e.map(e=>({view:e,at:Date.parse(e.item.created_at)})).sort((e,t)=>n*(e.at-t.at)).map(({view:e})=>e)}function qX(e){if(typeof e!=`object`||!e)return;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:``},n=jX(FX,t(`state`));if(n!==void 0)return{kind:jX(MX,t(`kind`))??``,blocking:jX(NX,t(`blocking`))??``,priority:jX(PX,t(`priority`))??``,state:n,source:jX(IX,t(`source`))??``,sourceId:t(`sourceId`)}}function JX(e,t){let{item:n}=e;switch(t){case`priority`:return{key:n.priority,label:tX(n),rank:Hk.indexOf(n.priority)};case`kind`:return{key:n.kind,label:nX(n),rank:n.kind===`task`?0:1};case`blocking`:return sX(n)?{key:`blocking`,label:`Blocking`,rank:0}:{key:`not-blocking`,label:`Not blocking`,rank:1};case`source`:{let e=dX(n);return{key:e,label:`Source: ${e}`,rank:0}}}}function YX(e,t,n=WX){if(t===`none`)return[{key:`all`,items:KX(e,n)}];let r=new Map;return e.forEach((e,n)=>{let{key:i,label:a,rank:o}=JX(e,t),s=r.get(i);s?s.items.push(e):r.set(i,{label:a,rank:o,first:n,items:[e]})}),[...r.entries()].sort(([,e],[,t])=>e.rank-t.rank||e.first-t.first).map(([e,{label:t,items:r}])=>({key:e,label:t,items:KX(r,n)}))}function XX({answers:e,onRoom:t}){let n=(0,z.useRef)(null),{count:r,remaining:i,sending:a,sendError:o,notices:s}=e,c=r>0||o!==void 0||s.length>0;return(0,z.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,B.jsxs)(`section`,{"aria-label":`Drafted answers`,className:`human-items-send`,ref:n,children:[r>0&&(0,B.jsxs)(`div`,{className:`human-items-send-bar`,children:[(0,B.jsx)(`button`,{"aria-busy":a,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,B.jsx)(`button`,{className:`human-items-send-action`,disabled:a,onClick:e.discard,type:`button`,children:`Discard`}),i>0&&(0,B.jsxs)(`span`,{className:`human-items-send-more`,children:[i,` more after this`]})]}),o!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent, and your drafts are kept: `,o]}),s.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Not sent`,className:`human-items-not-sent`,children:s.map(t=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`p`,{children:[(0,B.jsxs)(`strong`,{children:[`Not sent: `,t.title]}),` (`,t.reason,`)`]}),t.choiceTitle!==void 0&&(0,B.jsxs)(`p`,{children:[`Choice: `,t.choiceTitle]}),t.text!==void 0&&(0,B.jsx)(VY,{source:t.text}),(0,B.jsx)(`button`,{className:`human-items-send-action`,onClick:()=>e.clearNotice(t.key),type:`button`,children:`Clear`})]},t.key))})]}):null}var ZX=`answered or dismissed elsewhere`,QX=`onepipeline-ui.human-items.draft.`,$X=/^[^\s/?#]+$/u,eZ=J({title:K(),choice:K().optional(),choiceTitle:K().optional(),text:K().optional()});function tZ(){try{let e={};for(let t=0;t<window.localStorage.length;t+=1){let n=window.localStorage.key(t);if(n===null||!n.startsWith(QX))continue;let r=n.slice(33),i=nZ(window.localStorage.getItem(n));i!==void 0&&$X.test(r)&&(e[r]=i)}return e}catch{return}}function nZ(e){if(e!==null)try{let t=eZ.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}}function rZ(e,t){try{t===void 0?window.localStorage.removeItem(`${QX}${e}`):window.localStorage.setItem(`${QX}${e}`,JSON.stringify(t))}catch{}}function iZ(e){return e!==void 0&&e.trim()!==``}function aZ(e){return e.choice!==void 0||iZ(e.text)}function oZ(e,t){return{id:e,...t.choice===void 0?{}:{choice:t.choice},...iZ(t.text)?{text:t.text}:{}}}function sZ(e){return e.kind===`conflict`?e.reason:`human items are unavailable on this host`}async function cZ(e,t){try{return(await e.getHumanItem(t)).item.state!==`open`}catch(e){return e instanceof pN&&e.status===404||void 0}}function lZ(e,t){return e[t]===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function uZ(e,t,n,r,i,a){let[o,s]=(0,z.useState)(()=>tZ()??{}),[c,l]=(0,z.useState)({}),[u,d]=(0,z.useState)([]),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(),g=(0,z.useRef)(!1),_=(0,z.useRef)(0),v=(0,z.useRef)(o);v.current=o;let y=(0,z.useRef)(new Set),b=(0,z.useRef)(new Set),x=(0,z.useRef)(0),S=(0,z.useCallback)((e,t)=>{rZ(e,t),s(n=>t===void 0?lZ(n,e):{...n,[e]:t}),l(t=>lZ(t,e)),h(void 0)},[]),C=(0,z.useCallback)((e,t)=>{let n=v.current[e];if(n===void 0)return;rZ(e,void 0),s(t=>lZ(t,e)),l(t=>lZ(t,e)),_.current+=1;let r=_.current;d(e=>[...e,{...n,key:r,reason:t}])},[]),w=(0,z.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,aZ(a)?a:void 0)},[S]),T=(0,z.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])=>aZ(e)),D=E.slice(0,50),O=(0,z.useCallback)(async(t,n)=>{await cZ(e,t)===!0?C(t,n):l(e=>({...e,[t]:n}))},[e,C]),k=(0,z.useCallback)(async()=>{if(g.current)return;let t=tZ(),n=D.filter(([e])=>t!==void 0&&t[e]===void 0);for(let[e]of n)s(t=>lZ(t,e));let r=D.flatMap(([e,t])=>n.some(([t])=>t===e)?[]:[oZ(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)rZ(e.item.id,void 0),s(t=>lZ(t,e.item.id)),l(t=>lZ(t,e.item.id));i(t.answered),await Promise.all(t.refused.map(({id:e,refusal:t})=>O(e,sZ(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,z.useCallback)(()=>{for(let e of Object.keys(v.current))rZ(e,void 0);s({}),l({}),h(void 0)},[]),j=(0,z.useCallback)(e=>{d(t=>t.filter(t=>t.key!==e))},[]);return(0,z.useEffect)(()=>{y.current.clear(),x.current+=1},[n]),(0,z.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,ZX);continue}y.current.has(e)||b.current.has(e)||n(e)}function n(t){let r=x.current;b.current.add(t),cZ(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,ZX):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 dZ(e,t,n,r=String){let[i,a]=(0,z.useState)(()=>{try{let r=window.localStorage.getItem(e);return(r===null?void 0:t(r))??n}catch{return n}});return[i,(0,z.useCallback)(t=>{a(t);try{window.localStorage.setItem(e,r(t))}catch{}},[e,r])]}var fZ=`onepipeline-ui.human-items.filters`;function pZ(e){try{return qX(JSON.parse(e))}catch{return}}function mZ(e){let[t,n]=dZ(fZ,pZ,LX,JSON.stringify),[r,i]=(0,z.useState)(),a=(0,z.useMemo)(()=>{if(!e)return;let n=RX(t);return{type:`human-items`,...Object.keys(n).length===0?{}:{filter:n},...r===void 0?{}:{item:r}}},[e,JSON.stringify(RX(t)),r]);return(0,z.useEffect)(()=>{e||i(void 0)},[e]),{choice:t,setChoice:n,selectedId:r,setSelectedId:i,view:a}}function hZ(e,t,n,r,i=``){let[a,o]=(0,z.useState)({}),[s,c]=(0,z.useState)(),[l,u]=(0,z.useState)([]),[d,f]=(0,z.useState)({}),[p,m]=(0,z.useState)({}),[h,g]=(0,z.useState)(),_=(0,z.useRef)(new Set),v=(0,z.useRef)(new Map),y=(0,z.useRef)(0),b=(0,z.useRef)(void 0);b.current=s;let x=t.items,S=(0,z.useRef)(i);S.current=i,(0,z.useEffect)(()=>{m(e=>Object.keys(e).length===0?e:{})},[i]);let C=(0,z.useMemo)(()=>{if(x===void 0)return;let e=x.flatMap(e=>{let t=d[e.item.id];if(t!==void 0)return[t.view];let n=p[e.item.id]?.view;return n===void 0||!_Z(n,e)?[e]:n.item.state===r?[n]:[]}),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,...Object.values(d)])t(n.item.id)||e.splice(Math.min(r,e.length),0,n);return e},[x,l,p,d,r,i]);(0,z.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:_Z(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&&_Z(T,{item:w.item})?{...w,item:T.item,reopen:T.reopen}:w,D=(0,z.useRef)(x);D.current=x;let O=uZ(e,x,i,(0,z.useCallback)(e=>_.current.has(e),[]),(0,z.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,z.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,z.useCallback)((e,t)=>c(n=>n?.key===e?t(n):n),[]),j=(0,z.useCallback)((t,n,r)=>{let{id:i,title:a}=t.item;if(_.current.has(i))return;_.current.add(i);let s=++y.current,l=S.current,u=Math.max(0,D.current?.findIndex(({item:e})=>e.id===i)??0);o(e=>({...e,[i]:{pending:n.action}})),f(e=>({...e,[i]:{view:t,at:u}})),c({key:s,id:i,title:a,action:n.action,phase:`sending`});let d=n.action===`complete`?e.completeHumanItem(i):n.action===`dismiss`?e.dismissHumanItem(i,n.reason):e.reopenHumanItem(i);v.current.set(s,d),d.then(e=>{m(t=>({...t,[i]:{view:e.item,at:u,filter:l}})),o(e=>({...e,[i]:{}})),n.action!==`reopen`&&k(i,`dismissed here`),r?.(),A(s,t=>({...t,phase:`done`,reopen:e.item.reopen}))},e=>{let t=yZ(e);o(e=>({...e,[i]:{error:t}})),A(s,e=>({...e,phase:`failed`,error:t})),g({id:i})}).finally(()=>{_.current.delete(i),f(gZ(i))})},[e,A,k]),M=(0,z.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}}));let n=e===`note`?vZ(t.item.item):void 0;A(i,r=>({...r,reopen:t.item.reopen,followUp:{kind:e,phase:`done`,...n===void 0?{}:{saved:n}}}))},t=>A(i,n=>({...n,followUp:{kind:e,phase:`failed`,error:yZ(t)}})))},()=>A(i,e=>({...e,followUp:void 0})))},[A]),N=(0,z.useCallback)(()=>M(`undo`,t=>e.reopenHumanItem(t)),[e,M]),P=(0,z.useCallback)(t=>M(`note`,n=>e.noteHumanItem(n,t)),[e,M]),F=(0,z.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 gZ(e){return t=>t[e]===void 0?t:Object.fromEntries(Object.entries(t).filter(([t])=>t!==e))}function _Z(e,t){return Date.parse(e.item.updated_at)>Date.parse(t.item.updated_at)}function vZ(e){let{resolution:t}=e;if(t!==null)return(e.state===`dismissed`?t.reason:t.text)??void 0}function yZ(e){return e instanceof Error?e.message:String(e)}var bZ=`onepipeline-ui.human-items.group-by`,xZ=`onepipeline-ui.human-items.sort`,SZ=e=>jX(BX,e),CZ=e=>jX(UX,e);function wZ(){let[e,t]=dZ(bZ,SZ,VX),[n,r]=dZ(xZ,CZ,WX);return{groupBy:e,setGroupBy:t,sort:n,setSort:r}}var TZ=`data-card-action`,EZ=4;function DZ({client:e,live:t,choice:n,setChoice:r,selectedId:i,setSelectedId:a}){let o=hZ(e,t,i,n.state,JSON.stringify(n)),{groupBy:s,setGroupBy:c,sort:l,setSort:u}=wZ(),[d,f]=(0,z.useState)(0),[p,m]=(0,z.useState)(0),h=(0,z.useRef)(null),g=o.items?.find(({item:e})=>e.id===i)??o.detail,_=(0,z.useRef)(void 0);g===void 0?_.current?.item.id!==i&&(_.current=void 0):_.current=g;let v=(0,z.useRef)(i);v.current=i;let y=(e,t)=>{o.write(e,t,()=>{v.current===e.item.id&&a(void 0)})},b=o.returned;(0,z.useEffect)(()=>{b!==void 0&&h.current?.querySelector(`[data-item-id="${CSS.escape(b.id)}"]`)?.scrollIntoView({block:`nearest`})},[b]);let x=YX(o.items??[],s,l);return(0,B.jsxs)(`section`,{"aria-label":`Action items`,className:`human-items-page`,"data-detail-open":i!==void 0,style:OZ(d,p),children:[(0,B.jsx)(jZ,{choice:n,groupBy:s,onChange:r,onGroupBy:c,onSort:u,sort:l}),(0,B.jsxs)(`div`,{className:`human-items-body`,children:[(0,B.jsxs)(`section`,{"aria-label":`Action item list`,className:`human-items-list`,children:[o.listError&&(0,B.jsx)(`p`,{role:`alert`,children:o.listError}),o.items===void 0&&!o.listError&&(0,B.jsx)(`p`,{role:`status`,children:`Reading action items…`}),o.items?.length===0&&(0,B.jsx)(`p`,{role:`status`,children:`No action items match these filters.`}),(0,B.jsx)(`div`,{className:`human-items-groups`,onKeyDown:e=>AZ(e,h.current),ref:h,children:x.map(e=>(0,B.jsx)(kZ,{answering:o.answers,group:e,groupBy:s,onSelect:a,onWrite:y,selectedId:i,writes:o.writes},e.key))}),(o.items?.length??0)>0&&(0,B.jsx)(`button`,{className:`card-actions-entry`,onFocus:()=>h.current?.querySelector(`[${TZ}]`)?.focus(),type:`button`,children:`Card actions: use the arrow keys`})]}),i!==void 0&&(0,B.jsx)(XZ,{answering:o.answers,error:o.detailError,detail:o.detail,gone:o.gone,lastShown:_.current,onClose:()=>a(void 0),onWrite:y,state:o.writes[i],view:g})]}),(0,B.jsx)(XX,{answers:o.answers,onRoom:m}),o.toast&&(0,B.jsx)($Y,{onClose:o.closeToast,onNote:o.note,onRoom:f,onUndo:o.undo,toast:o.toast})]})}function OZ(e,t){return{"--toast-room":`${e}px`,"--send-room":`${t}px`}}function kZ({group:e,groupBy:t,selectedId:n,writes:r,answering:i,onSelect:a,onWrite:o}){let s=(0,z.useId)(),c=e.items.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(FZ,{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,B.jsx)(`ul`,{"aria-label":`Action items`,children:c}):(0,B.jsxs)(`section`,{"aria-labelledby":s,className:`human-items-group`,children:[(0,B.jsxs)(`h2`,{className:`human-items-group-heading`,id:s,children:[e.label,` `,(0,B.jsxs)(`span`,{className:`human-items-group-count`,children:[`(`,e.items.length,`)`]})]}),(0,B.jsx)(`ul`,{"aria-labelledby":s,children:c})]})}function AZ(e,t){let n=e.target;if(t===null||!(n instanceof HTMLElement)||!n.hasAttribute(TZ))return;let r=[...t.querySelectorAll(`[${TZ}]`)],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 jZ({choice:e,groupBy:t,sort:n,onChange:r,onGroupBy:i,onSort:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)(!1),l=(t,n)=>r({...e,[t]:n}),u=e.source!==``&&e.source!==`host`,d=zX(e)+Number(t!==VX);return(0,B.jsxs)(`div`,{className:`human-items-controls`,"data-open":s,children:[(0,B.jsxs)(`button`,{"aria-controls":`${o}-filters`,"aria-expanded":s,"aria-label":d>0?`Filters, ${d} changed`:`Filters`,className:`human-items-filters-toggle`,onClick:()=>c(e=>!e),type:`button`,children:[(0,B.jsx)(xt,{"aria-hidden":`true`,size:14}),`Filters`,d>0&&(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`human-items-filters-count`,children:d})]}),(0,B.jsx)(`select`,{"aria-label":`Sort`,className:`human-items-sort-toggle`,onChange:e=>a(MZ(e.target.value)),value:n,children:GX.map(({value:e,label:t})=>(0,B.jsxs)(`option`,{value:e,children:[`Sort: `,t]},e))}),(0,B.jsxs)(`fieldset`,{className:`human-items-filters`,id:`${o}-filters`,children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Filter action items`}),(0,B.jsx)(`label`,{htmlFor:`${o}-group`,children:`Group by`}),(0,B.jsx)(`select`,{id:`${o}-group`,onChange:e=>i(jX(BX,e.target.value)??`priority`),value:t,children:HX.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{className:`human-items-sort-label`,htmlFor:`${o}-sort`,children:`Sort`}),(0,B.jsx)(`select`,{className:`human-items-sort-select`,id:`${o}-sort`,onChange:e=>a(MZ(e.target.value)),value:n,children:GX.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${o}-kind`,children:`Kind`}),(0,B.jsxs)(`select`,{id:`${o}-kind`,onChange:e=>l(`kind`,jX(MX,e.target.value)??``),value:e.kind,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),(0,B.jsx)(`option`,{value:`task`,children:`Task`}),(0,B.jsx)(`option`,{value:`question`,children:`Question`})]}),(0,B.jsx)(`label`,{htmlFor:`${o}-blocking`,children:`Blocking`}),(0,B.jsxs)(`select`,{id:`${o}-blocking`,onChange:e=>l(`blocking`,jX(NX,e.target.value)??``),value:e.blocking,children:[(0,B.jsx)(`option`,{value:``,children:`Any`}),(0,B.jsx)(`option`,{value:`yes`,children:`Yes`}),(0,B.jsx)(`option`,{value:`no`,children:`No`})]}),(0,B.jsx)(`label`,{htmlFor:`${o}-priority`,children:`Priority`}),(0,B.jsxs)(`select`,{id:`${o}-priority`,onChange:e=>l(`priority`,jX(PX,e.target.value)??``),value:e.priority,children:[(0,B.jsx)(`option`,{value:``,children:`Any priority`}),eX.map(({wire:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))]}),(0,B.jsx)(`label`,{htmlFor:`${o}-state`,children:`State`}),(0,B.jsx)(`select`,{id:`${o}-state`,onChange:e=>l(`state`,jX(FX,e.target.value)??`open`),value:e.state,children:aX.map(({state:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${o}-source`,children:`Source`}),(0,B.jsxs)(`select`,{id:`${o}-source`,onChange:e=>l(`source`,jX(IX,e.target.value)??``),value:e.source,children:[(0,B.jsx)(`option`,{value:``,children:`Any source`}),(0,B.jsx)(`option`,{value:`session`,children:`Session`}),(0,B.jsx)(`option`,{value:`run`,children:`Run`}),(0,B.jsx)(`option`,{value:`plan`,children:`Plan`}),(0,B.jsx)(`option`,{value:`host`,children:`Host`})]}),u&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`label`,{htmlFor:`${o}-source-id`,children:`Source identifier`}),(0,B.jsx)(`input`,{id:`${o}-source-id`,onChange:e=>l(`sourceId`,e.target.value),placeholder:`${e.source} id`,type:`search`,value:e.sourceId})]})]})]})}function MZ(e){return jX(UX,e)??`default`}function NZ(e){return e.target instanceof Element&&e.target.closest(`a, button, textarea, input, select, [data-long-pressed="true"]`)===null}function PZ({view:e,groupBy:t}){let{item:n}=e;return(0,B.jsxs)(B.Fragment,{children:[n.state===`expired`&&(0,B.jsx)(`span`,{className:`human-item-expired-badge`,children:oX(n)}),t!==`priority`&&(0,B.jsx)(`span`,{className:`human-item-priority`,"data-priority":n.priority,children:tX(n)}),t!==`kind`&&(0,B.jsx)(`span`,{className:`human-item-kind`,children:nX(n)}),t!==`blocking`&&sX(n)&&(0,B.jsx)(`span`,{className:`human-item-blocking`,children:`Blocking`})]})}function FZ({view:e,groupBy:t,selected:n,state:r,answering:i,onSelect:a,onWrite:o}){let{item:s}=e,c=s.state===`open`,l=s.state===`expired`,u=uX(e),d=[{key:`raised`,part:(0,B.jsx)(BZ,{at:s.created_at})},...c||l?[]:[{key:`state`,part:oX(s)}],...u?[{key:`blocked`,part:u}]:[],...t===`source`?[]:[{key:`source`,part:`Source: ${dX(s)}`}]],f=(s.choices?.length??0)>0,p=kX(s);return(0,B.jsxs)(HY,{actions:(0,B.jsx)(IZ,{item:e,onSelect:a,onWrite:o,state:r}),badges:(0,B.jsx)(PZ,{groupBy:t,view:e}),body:s.body,className:`human-item-card`,clamp:EZ,"data-blocking":sX(s),"data-expired":l,"data-item-id":s.id,"data-selected":n,meta:d.map(({key:e,part:t},n)=>(0,B.jsxs)(z.Fragment,{children:[n>0&&` · `,(0,B.jsx)(`span`,{children:t})]},e)),onClick:e=>{NZ(e)&&a()},title:s.title,children:[s.kind===`question`&&c&&f&&(0,B.jsxs)(`fieldset`,{className:`human-item-choices`,children:[(0,B.jsxs)(`legend`,{className:`sr-only`,children:[`Choices: `,s.title]}),s.choices?.map(t=>(0,B.jsx)(UZ,{answering:i,choice:t,view:e},t.id))]}),s.kind===`question`&&c&&(0,B.jsx)(WZ,{answering:i,label:`Answer: ${s.title}`,view:e}),(0,B.jsx)(qZ,{view:e}),p&&(0,B.jsx)(HZ,{label:p.label,text:p.text}),(0,B.jsx)(GZ,{view:e}),(0,B.jsx)(JZ,{reason:i.refusals[s.id]}),(0,B.jsx)(YZ,{state:r})]})}function IZ({item:e,state:t,onSelect:n,onWrite:r}){let{item:i}=e,a=i.state===`open`,o=t?.pending;return(0,B.jsxs)(B.Fragment,{children:[i.tracker&&(0,B.jsx)(GY,{className:`human-item-tracker`,"data-card-action":``,label:i.tracker.task,title:i.tracker.task,onClick:e=>e.stopPropagation(),tabIndex:-1,url:i.tracker.url}),(0,B.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:n,type:`button`,"aria-label":`Details: ${i.title}`,children:`Details`}),a&&i.kind===`task`&&(0,B.jsx)(zZ,{action:`complete`,control:LZ,className:`human-item-action`,name:`Complete: ${i.title}`,onPress:()=>r(e,{action:`complete`}),pending:o}),a&&(0,B.jsx)(zZ,{action:`dismiss`,control:LZ,className:`human-item-action`,name:`Dismiss: ${i.title}`,onPress:()=>r(e,{action:`dismiss`}),pending:o}),!a&&(0,B.jsx)(KY,{busyLabel:`Reopening…`,className:`human-item-action`,control:LZ,disabled:o!==void 0,label:`Reopen`,item:i.title,onPress:()=>r(e,{action:`reopen`}),reopen:e.reopen,sending:o===`reopen`})]})}var LZ={[TZ]:``,tabIndex:-1},RZ={complete:{label:`Complete`,busy:`Completing…`},dismiss:{label:`Dismiss`,busy:`Dismissing…`}};function zZ({action:e,name:t,pending:n,onPress:r,className:i,control:a={},children:o}){let s=n===e,c=RZ[e],l={...a,"aria-busy":s,"aria-label":s?void 0:t,className:i,disabled:n!==void 0,onClick:r,type:`button`,children:s?c.busy:c.label};return o?o(l):(0,B.jsx)(`button`,{...l})}function BZ({at:e}){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=(0,z.useRef)(void 0),o=(0,z.useId)(),s=Ae(e),c=()=>clearTimeout(a.current);return(0,B.jsxs)(`span`,{"aria-describedby":t?o:void 0,className:`human-item-raised`,"data-long-pressed":r,tabIndex:-1,onPointerCancel:c,onPointerEnter:e=>{e.pointerType===`mouse`&&n(!0)},onPointerDown:e=>{i(!1),e.pointerType!==`mouse`&&(c(),a.current=setTimeout(()=>{n(!0),i(!0)},VZ))},onPointerLeave:()=>{c(),n(!1)},onPointerUp:c,children:[`Raised `,(0,B.jsx)(u,{at:e,relative:!0}),t&&s!==void 0&&(0,B.jsx)(`span`,{className:`human-item-raised-tip`,id:o,role:`tooltip`,children:L(s)})]})}var VZ=500;function HZ({label:e,text:t}){return(0,B.jsxs)(`p`,{className:`human-item-note`,children:[(0,B.jsxs)(`span`,{className:`human-item-note-label`,children:[e,`:`]}),` `,t]})}function UZ({view:e,choice:t,answering:n}){return(0,B.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 WZ({view:e,label:t,answering:n}){return(0,B.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:(e.item.choices?.length??0)>0?`Or write your own answer`:`Write an answer`,readOnly:n.sending,rows:1,value:n.drafts[e.item.id]?.text??``})}function GZ({view:e}){let t=TX(e.item);if(t!==void 0)return(0,B.jsxs)(`p`,{className:`human-item-expiry-reason`,children:[t.reason,t.held!==``&&(0,B.jsxs)(`span`,{className:`human-item-expiry-held`,children:[` · `,t.held]})]});let n=SX(e.item);return(0,B.jsxs)(B.Fragment,{children:[n!==void 0&&(0,B.jsx)(`p`,{className:`human-item-expiry`,children:n}),DX(e).map(e=>(0,B.jsxs)(`p`,{className:`human-item-status human-item-check-failed`,"data-failed":`true`,title:e.detail??void 0,children:[`Check `,EX(e)]},e.condition))]})}function KZ({view:e}){if(e.item.state!==`open`)return null;let t=OX(e);return t.length===0?null:(0,B.jsxs)(`section`,{"aria-label":`Expiry`,className:`human-item-detail-expiry`,children:[(0,B.jsx)(`h3`,{children:`Expiry`}),(0,B.jsx)(`ul`,{children:t.map(({key:e,words:t,last:n})=>(0,B.jsxs)(`li`,{children:[t,n!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-check-detail`,"data-failed":n.outcome===`failed`,children:[`Last check `,EX(n),` · `,(0,B.jsx)(u,{at:n.last_run_at,relative:!0})]})]},e))})]})}function qZ({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,B.jsxs)(`section`,{"aria-label":`Answer`,className:`human-item-answered`,children:[i&&(0,B.jsx)(`p`,{className:`human-item-answered-choice`,children:i.title}),r!==null&&(0,B.jsx)(VY,{source:r})]})}function JZ({reason:e}){return e===void 0?null:(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent: `,e]})}function YZ({state:e}){return e?.error?(0,B.jsx)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:e.error}):null}function XZ({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,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[r&&(0,B.jsx)(`h2`,{children:r.item.title}),(0,B.jsx)(Wi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})})]}),(0,B.jsx)(`p`,{role:`status`,children:`Resolved: this item needs nothing more from you.`})]});let l=t??e;if(l===void 0)return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsx)(Wi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})}),i?(0,B.jsx)(`p`,{role:`alert`,children:i}):(0,B.jsx)(`p`,{role:`status`,children:`Reading…`})]});let{item:d}=l,f=d.state===`open`,p=d.choices??[],m=d.kind===`question`&&f;return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,tabIndex:0,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[(0,B.jsx)(`h2`,{children:d.title}),(0,B.jsx)(Wi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})})]}),i&&(0,B.jsx)(`p`,{role:`alert`,children:i}),(0,B.jsx)(`section`,{"aria-label":`Full body`,className:`human-item-detail-body`,children:(0,B.jsx)(VY,{source:d.body})}),m&&p.length>0&&(0,B.jsxs)(`fieldset`,{className:`human-item-choice-list`,children:[(0,B.jsx)(`legend`,{children:`Choices`}),p.map(e=>(0,B.jsxs)(`div`,{className:`human-item-choice-entry`,children:[(0,B.jsx)(UZ,{answering:o,choice:e,view:l}),(0,B.jsx)(`div`,{className:`human-item-choice-description`,children:(0,B.jsx)(VY,{source:e.description})})]},e.id))]}),m&&(0,B.jsx)(WZ,{answering:o,label:`Answer in detail: ${d.title}`,view:l}),(0,B.jsx)(qZ,{view:l}),(0,B.jsx)(KZ,{view:l}),(0,B.jsx)(JZ,{reason:o.refusals[d.id]}),(0,B.jsxs)(`div`,{className:`human-item-detail-actions`,children:[f&&d.kind===`task`&&(0,B.jsx)(zZ,{action:`complete`,onPress:()=>s(l,{action:`complete`}),pending:a?.pending,children:e=>(0,B.jsx)(Wi,{...e,size:`sm`})}),f&&(0,B.jsx)(zZ,{action:`dismiss`,onPress:()=>s(l,{action:`dismiss`}),pending:a?.pending,children:e=>(0,B.jsx)(Wi,{...e,size:`sm`,variant:`outline`})}),!f&&(0,B.jsx)(KY,{busyLabel:`Reopening…`,className:`human-item-detail-reopen`,disabled:a?.pending!==void 0,label:`Reopen`,onPress:()=>s(l,{action:`reopen`}),reopen:l.reopen,sending:a?.pending===`reopen`}),(0,B.jsx)(YZ,{state:a})]}),t?.history!==void 0&&t.history.length>0&&(0,B.jsx)(ZZ,{history:t.history}),(0,B.jsxs)(`dl`,{className:`human-item-metadata`,children:[AX(l).map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:`value`in e?e.value:(0,B.jsxs)(B.Fragment,{children:[e.party!==void 0&&`By ${e.party} · `,(0,B.jsx)(u,{at:e.at,relative:!0})]})})]},e.label)),t&&t.nodes.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Blocked steps`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`section`,{"aria-label":`Blocked steps`,className:`human-item-steps`,children:fX(t).map(({phrase:e,nodes:t})=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>(0,B.jsxs)(`li`,{children:[e.run,` / `,e.node,`: `,e.title]},`${e.run}/${e.node}`))})]},e))})})]}),d.tracker&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Tracker`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(GY,{className:`human-item-tracker-full`,label:d.tracker.task,url:d.tracker.url})})]})]})]})}function ZZ({history:e}){return(0,B.jsxs)(`section`,{"aria-label":`History`,className:`human-item-history`,children:[(0,B.jsx)(`h3`,{children:`History`}),(0,B.jsx)(`ol`,{children:e.map((e,t)=>(0,B.jsxs)(`li`,{children:[gX(e),` · `,(0,B.jsx)(u,{at:e.at,relative:!0})]},t))})]})}function QZ({className:e,state:t}){let n=$Z(t);return(0,B.jsxs)(T,{className:k(`gap-1.5 tracking-[.03em] uppercase`,n&&tQ[n],e),variant:`outline`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),t]})}function $Z(e){return sQ[e]}var eQ=e=>{let t=$Z(e);return k(`size-2 shrink-0 rounded-full bg-current`,t===void 0?`text-muted-foreground`:nQ[t])},tQ={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`},nQ={success:`text-success`,destructive:`text-destructive`,warning:`text-warning`,info:`text-info`},rQ=`success`,iQ=`destructive`,aQ=`warning`,oQ={blocked:aQ,cancelled:iQ,"complete-but-draft":aQ,"complete-but-held":aQ,done:rQ,failed:iQ,"not-completed":iQ,parked:void 0,pending:void 0,ready:void 0,running:`info`,skipped:aQ,unknown:void 0,waiting:void 0},sQ={...oQ,complete:oQ.done,settled:oQ.done,active:oQ.running},cQ=`/human-items`;function lQ(e){return e===`/human-items`||e===`/human-items/`}function uQ(e){return lQ(e)?`/`:e}function dQ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}var fQ=()=>window.location.pathname;function pQ(){let e=(0,z.useSyncExternalStore)(dQ,fQ,fQ),t=(0,z.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,``,`${cQ}${t}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{active:lQ(e),open:t}}var mQ={graph:`graph`,overall:`overall`};function hQ(e){return e!==null&&Object.hasOwn(mQ,e)}var gQ={projects:`projects`,runs:`runs`};function _Q(e){return e!==null&&Object.hasOwn(gQ,e)}var vQ={timeline:`Timeline`,task:`Task`,criteria:`Acceptance criteria`,dependencies:`Dependencies`,remote:`Remote`};function yQ(e){return e!==null&&Object.hasOwn(vQ,e)}function bQ(e,t){let n=e.get(t);return n!==null&&se(n)?n:void 0}function xQ(){let e=(0,z.useSyncExternalStore)(SQ,CQ,CQ),t=new URLSearchParams(e),n=t.get(`list`),r=_Q(n)?n:`projects`,i=t.get(`project`),a=i!==null&&(i===`none`||dM(i))?i:void 0,o=bQ(t,`run`),s=bQ(t,`node`),c=bQ(t,`event`),l=t.get(`view`),u=t.get(`tab`),d=u===`pr`||u===`checks`?`remote`:yQ(u)?u:`timeline`,f=hQ(l)?l:s===void 0?`overall`:`graph`,p=(0,z.useCallback)((e,t=!1)=>{let n=new URLSearchParams(window.location.search);e(n);let r=t?window.location.pathname:uQ(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`),hiddenEventTypes:[...new Set(t.getAll(`hide-event`))].filter(ge),selectEventTypes:e=>p(t=>{t.delete(`hide-event`);for(let n of e)t.append(`hide-event`,n)},!0),selectHost:()=>p(e=>{e.set(`page`,`host`)}),selectKinds:e=>p(t=>{t.delete(`hide-kind`);for(let n of e)t.append(`hide-kind`,n)},!0),projectKey:a,runId:o,nodeId:s,itemId:c,view:f,nodeTab:d,selectList:e=>p(t=>{e===`projects`?t.delete(`list`):t.set(`list`,e),t.delete(`project`)}),selectProject:e=>p(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=>p(t=>{t.set(`run`,e),t.delete(`page`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectNode:e=>p(t=>{e?t.set(`node`,e):t.delete(`node`),t.delete(`event`),t.delete(`tab`),t.set(`view`,`graph`)}),selectItem:e=>p(t=>{e?t.set(`event`,e):t.delete(`event`)}),showOverall:()=>p(e=>{e.set(`view`,`overall`),e.delete(`node`),e.delete(`event`),e.delete(`tab`)}),selectNodeTab:e=>p(t=>{e===`timeline`?t.delete(`tab`):t.set(`tab`,e),e!==`timeline`&&t.delete(`event`)})}}function SQ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function CQ(){return window.location.search}function wQ(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 TQ(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=wQ(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 EQ(e){let{done:t,failed:n,running:r}=e.nodes;return ee({done:t,failed:n,running:r})}function DQ(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 OQ(e,t,n,r){let[i,a]=(0,z.useState)(new Set),o=(0,z.useCallback)(e=>{a(t=>t.has(e)?t:new Set(t).add(e))},[]),s=(0,z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),c=(0,z.useMemo)(()=>TQ(e??[]),[e]),l=c.find(e=>e.rows.some(e=>e.id===n))?.key,[u,d]=(0,z.useState)();return l!==u&&(d(l),l!==void 0&&o(l)),(0,z.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 kQ=240,AQ=`data-row-key`;function jQ(e,t){let n=(0,z.useRef)(new Map);(0,z.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let r=t.getBoundingClientRect().top,i=[...t.querySelectorAll(`[${AQ}]`)],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(`
104
104
  `)!==s.join(`
105
- `)&&!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:TQ,easing:`ease-out`})}n.current=a},[e,t])}function OQ({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}=wQ(e,l,n,i??r),g=(0,z.useRef)(null);return DQ(g,h),(0,B.jsx)(`nav`,{"aria-label":`Projects`,className:`run-nav`,"data-open":f,id:`run-navigation`,ref:p,children:(0,B.jsx)(pd,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`px-[18px] py-6 max-sm:px-2`,children:[(0,B.jsxs)(`div`,{className:`brand`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`brand-mark`,children:(0,B.jsx)(Be,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Local orchestration`}),(0,B.jsx)(`h1`,{children:`DAG Observatory`})]})]}),(0,B.jsx)(Ed,{className:`my-[22px]`}),(0,B.jsxs)(`div`,{className:`nav-pages`,children:[(0,B.jsx)(Vi,{"aria-current":o?`page`:void 0,onClick:a,variant:`ghost`,children:`Host`}),s&&(0,B.jsx)(Vi,{"aria-current":c?`page`:void 0,onClick:s,variant:`ghost`,children:`Action items`})]}),m.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Run kinds:`,` `,m.filter(e=>!l.includes(e)).length,` of`,` `,m.length]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Run kinds`}),m.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.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,B.jsx)(`p`,{role:`status`,children:t?`Projects did not load`:`Loading projects…`}):(0,B.jsx)(`div`,{className:`nav-rows`,ref:g,children:h.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`Project ${e.label}`,className:`project-group`,children:[(0,B.jsxs)(`div`,{className:`project-row`,[EQ]:`project:${e.key}`,children:[(0,B.jsx)(`button`,{"aria-expanded":e.expanded,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${e.label}`,className:`project-toggle`,onClick:e.toggle,type:`button`,children:(0,B.jsx)(Ge,{"aria-hidden":`true`,"data-open":e.expanded,size:12})}),(0,B.jsxs)(`button`,{className:`project-open`,onClick:e.open,type:`button`,children:[(0,B.jsx)(`span`,{className:`project-name`,children:e.label}),(0,B.jsxs)(`span`,{className:`project-count`,children:[e.runs.length,(0,B.jsx)(`span`,{className:`sr-only`,children:` shown runs`})]})]})]}),e.expanded&&e.runs.length===0&&(0,B.jsx)(`p`,{className:`run-list-status`,role:`status`,children:`No runs of the shown kinds.`}),e.expanded&&e.runs.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Runs of ${e.label}`,className:`run-list`,children:e.runs.map(e=>{let t=n===e.id,i=[e.state,SQ(e)].filter(Boolean).join(` · `);return(0,B.jsx)(`li`,{children:(0,B.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,B.jsxs)(vp,{children:[(0,B.jsx)(yp,{asChild:!0,children:(0,B.jsx)(`span`,{role:`img`,"aria-label":e.state,className:k(`run-dot`,XZ(e.state))})}),(0,B.jsx)(bp,{children:e.state})]}),(0,B.jsx)(`span`,{className:`run-link-name`,children:e.name}),e.kind&&(0,B.jsx)(`span`,{"aria-label":e.kind,className:`run-link-tag`,role:`note`,children:e.kind}),t&&(0,B.jsx)(`span`,{className:`run-link-counts`,children:i})]})},e.id)})})]},e.key))})]})})})}function kQ(){let[e,t]=(0,z.useState)(!1),n=(0,z.useRef)(null),r=(0,z.useRef)(null),i=(0,z.useRef)(!1),a=(0,z.useCallback)(()=>t(!1),[]),o=(0,z.useCallback)(()=>t(e=>!e),[]);return(0,z.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,z.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 AQ(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useRef)(void 0),a=(0,z.useRef)(t);a.current=t;let o=e===`live`,s=(0,z.useRef)(o);s.current=o;let c=(0,z.useCallback)(e=>{i.current=void 0,r(0),a.current(e)},[]),l=(0,z.useCallback)(()=>{i.current!==void 0&&c(i.current.value)},[c]),u=(0,z.useCallback)((e,t=1)=>{s.current?c(e):(i.current={value:e},r(e=>e+t))},[c]),d=(0,z.useCallback)(()=>{i.current=void 0,r(0)},[]);return(0,z.useEffect)(()=>{o&&l()},[o,l]),(0,z.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 jQ(e,t){let[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),[o,s]=(0,z.useState)({}),c=(0,z.useRef)([]),[l,u]=(0,z.useState)(),[d,f]=(0,z.useState)(),[p,m]=(0,z.useState)(),[h,g]=(0,z.useState)(),[_,v]=(0,z.useState)(),[y,b]=(0,z.useState)(),[x,S]=(0,z.useState)(0),C=t.runId,w=l===void 0||C!==void 0&&l.some(e=>e.id===C)?C:C!==void 0||t.selectFirst?bQ(l)[0]?.id:void 0,T=(0,z.useMemo)(()=>t.humanItems??Me(t.host?void 0:w,t.view,t.nodeId),[t.humanItems,t.host,w,t.view,t.nodeId]),E=(0,z.useRef)(void 0),D=(0,z.useRef)(T);D.current=T;let O=(0,z.useRef)(t.first),k=AQ(t.navigationUpdates,f),A=AQ(t.mainUpdates,(0,z.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,z.useRef)(j);M.current=j,(0,z.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=CQ(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 cN&&(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,z.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,z.useEffect)(()=>{j?E.current?.resume():E.current?.pause()},[j]);let N=(0,z.useCallback)(()=>{k.take(),A.take()},[k.take,A.take]),P=(0,z.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&&MQ(F,T)&&JSON.stringify(i)===JSON.stringify(T)?F:void 0,ee=(0,z.useRef)(void 0),L=I?.detail??(ee.current?.run.run_id===w?ee.current:void 0);ee.current=L;let te=(0,z.useMemo)(()=>NQ(L),[L]),ne=h!==void 0&&T.type===`timeline`&&L!==void 0;return{rows:l,navigationRows:d,navigationWaiting:k.waiting,hostRows:n?.sidebar,mainWaiting:A.waiting,runId:w,detail:L,timeline:I&&`timeline`in I?I.timeline:void 0,humanItems:o,timelineError:ne?h:void 0,loading:n===void 0&&h===void 0,lastUpdated:p,activity:te,error:ne?_:h??_,notice:y,refresh:P}}function MQ(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 NQ(e){let t=e?.run.live_activity;if(t===void 0)return[];let n=Oj.safeParse(t);return n.success?n.data:[]}var PQ={minutes:60,seconds:1},FQ=e=>Object.hasOwn(PQ,e),IQ=600%PQ.minutes==0?{amount:String(600/PQ.minutes),unit:`minutes`}:{amount:`600`,unit:`seconds`};function LQ(e){let t=e.amount.trim();if(!/^\d+$/u.test(t))return;let n=Number(t)*PQ[e.unit];return Number.isSafeInteger(n)?n:void 0}function RQ(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 zQ(e){return e.map(e=>({runId:e.run_id,owner:Te(e.launch)}))}function BQ(e,t){return t instanceof cN&&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 VQ={dispatchStopped:`dispatch-stopped`,hostShutdown:`host-shutdown`};function HQ(e,t,n){let r=new Set(e.runs.map(({runId:e})=>e)),i=Object.values(VQ);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===VQ.hostShutdown?VQ.hostShutdown:VQ.dispatchStopped}]})}function UQ(e){return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).format(e)}function WQ(e){return(0,z.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 GQ=`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 KQ({open:e,onOpenChange:t,runs:n,blocked:r,unreadable:i=0,onConfirm:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)(IQ),[l,u]=(0,z.useState)(!1),d=LQ(s),f=n!==void 0&&r===void 0,p=()=>{c(IQ),u(!1),t(!1)};return(0,B.jsx)(Cs,{onOpenChange:e=>e?t(!0):p(),open:e,children:(0,B.jsxs)(Ds,{className:`shutdown-dialog`,children:[(0,B.jsxs)(Os,{children:[(0,B.jsx)(As,{children:`Shut down the entire host?`}),(0,B.jsx)(js,{children:GQ})]}),(0,B.jsxs)(`div`,{className:`shutdown-dialog-body`,children:[r===void 0?n===void 0?(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:`Reading which runs this acts on…`}):(0,B.jsx)(JQ,{caption:`It acts on all ${qQ(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,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:r}),i>0&&(0,B.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,B.jsxs)(`fieldset`,{className:`shutdown-grace`,children:[(0,B.jsx)(`legend`,{children:`Grace`}),(0,B.jsxs)(`div`,{className:`shutdown-grace-row`,children:[(0,B.jsx)(Fs,{className:`sr-only`,htmlFor:`${o}-grace`,children:`Grace`}),(0,B.jsx)(Ms,{"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,B.jsx)(Fs,{className:`sr-only`,htmlFor:`${o}-unit`,children:`Grace unit`}),(0,B.jsx)(`select`,{className:`composer-select`,id:`${o}-unit`,onChange:e=>{let t=e.target.value;FQ(t)&&c({...s,unit:t})},value:s.unit,children:Object.keys(PQ).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.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: ${RQ(d)}. The engine's default is ${RQ(LQ(IQ)??0)}.`})]}),(0,B.jsxs)(`div`,{className:`composer-check shutdown-force`,children:[(0,B.jsx)(`input`,{checked:l,id:`${o}-force`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,B.jsx)(Fs,{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,B.jsxs)(ks,{children:[(0,B.jsx)(Ts,{asChild:!0,children:(0,B.jsx)(Vi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(Vi,{disabled:!f||d===void 0,onClick:()=>{d!==void 0&&(a(d,l),p())},type:`button`,variant:`destructive`,children:`Shut down the host`})]})]})})}var qQ=e=>e===1?`1 run`:`${e} runs`;function JQ({caption:e,label:t,runs:n,warning:r=!1}){let i=WQ(n);return(0,B.jsxs)(`div`,{className:`shutdown-runs`,"data-warning":r,children:[(0,B.jsx)(`p`,{className:`shutdown-scope-note`,children:e}),(0,B.jsx)(`ul`,{"aria-label":t,children:i.map(({owner:e,count:t})=>(0,B.jsxs)(`li`,{children:[e,` — `,qQ(t)]},e))})]})}function YQ(e,t,n){let[r,i]=(0,z.useState)(),a=XQ(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:zQ(a.rows),blocked:a.blocked,unreadable:e?.unreadable?.length??0}}function XQ(e,t,n,r){let i=(0,z.useRef)(new Set),a=t?.next_cursor;return(0,z.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 ZQ(e,t){let[n,r]=(0,z.useState)({phase:`idle`}),i=(0,z.useRef)(!1);return{state:n,confirm:(0,z.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(BQ(s,e))).finally(()=>{i.current=!1})},[e,t]),dismiss:(0,z.useCallback)(()=>{i.current||r({phase:`idle`})},[])}}var QQ=[`host`];function $Q(e){return{host:ZQ(`host`,(0,z.useCallback)(t=>e.shutdown(`host`,t),[e]))}}function e$({list:e,loadMore:t,loadingMore:n,shutdowns:r}){let{open:i,setOpen:a,opener:o,runs:s,blocked:c,unreadable:l}=YQ(e,t,n),u=r.host.state.phase===`sending`;return(0,B.jsxs)(`fieldset`,{"aria-label":`Shut down runs on this host`,className:`host-shutdown`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`This host`}),(0,B.jsx)(`div`,{className:`host-shutdown-actions`,children:(0,B.jsxs)(Vi,{disabled:u,onClick:o(`host`),size:`sm`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(ht,{size:14}),` Shut down the entire host`]})}),QQ.map(e=>(0,B.jsx)(KQ,{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 t$=1e3;function n$(e,t){let[n,r]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),t$);return()=>clearInterval(e)},[]);let i=HQ(e,(0,z.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===VQ.hostShutdown).length,deadline:e.sentAt+e.grace*1e3,asks:!e.force&&e.grace>0}}function r$({label:t,state:n,rows:r,onDismiss:i}){return n.phase===`idle`?null:(0,B.jsxs)(`section`,{"aria-label":t,className:`shutdown-status`,children:[n.phase===`sending`?(0,B.jsx)(a$,{rows:r,sent:n.sent}):n.phase===`lost`?(0,B.jsxs)(gi,{"aria-label":`${t} lost`,variant:`destructive`,children:[(0,B.jsx)(wt,{}),(0,B.jsx)(_i,{children:`Shutdown lost: no answer came back`}),(0,B.jsxs)(vi,{children:[(0,B.jsxs)(`p`,{children:[`The request sent at `,UQ(n.sent.sentAt),` ended without an answer (`,n.error.message,`). The engine may still be carrying out the shutdown — check the runs before sending another.`]}),(0,B.jsx)(i$,{sent:n.sent})]})]}):n.phase===`refused`?(0,B.jsxs)(gi,{"aria-label":`${t} refused`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsxs)(_i,{children:[`Shutdown refused · `,n.error.status,` `,n.error.code]}),(0,B.jsxs)(vi,{children:[(0,B.jsx)(`pre`,{className:`verb-text`,children:n.error.message}),(0,B.jsx)(`p`,{children:`Nothing was signalled and nothing was pushed.`})]})]}):(0,B.jsx)(s$,{label:t,report:n.report}),n.phase!==`sending`&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(Vi,{onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`})})]})}function i$({sent:e}){return(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Sent `,UQ(e.sentAt),` · scope `,e.scope,` · grace`,` `,RQ(e.grace),e.force?` · forced`:``,` · `,e.runs.length,` `,e.runs.length===1?`run`:`runs`,` in scope`]})}function a$({sent:e,rows:t}){let{now:n,progress:r,done:i,deadline:a,asks:o}=n$(e,t);return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`shutdown-inflight`,role:`status`,children:[(0,B.jsxs)(`p`,{className:`shutdown-inflight-head`,children:[(0,B.jsx)(st,{"aria-hidden":`true`,className:`animate-spin`,size:14}),(0,B.jsx)(`strong`,{children:`Shutdown in progress`}),` — still waiting for the engine's answer, `,be(Math.max(0,n-e.sentAt)),` after it was sent.`]}),(0,B.jsx)(i$,{sent:e}),(0,B.jsx)(`p`,{children:o?n<a?`Waiting out the ${RQ(e.grace)} grace until ${UQ(a)} (${be(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 ${UQ(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,B.jsxs)(`p`,{children:[i,` of `,e.runs.length,` `,e.runs.length===1?`run has`:`runs have`,` recorded their shutdown.`]}),r.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Recorded so far`,children:r.map(({runId:e,recorded:t})=>(0,B.jsxs)(`li`,{children:[e,`:`,` `,t===VQ.hostShutdown?`put down — host-shutdown recorded after its teardown and pushes`:`its dispatches are stopping — dispatch-stopped recorded`]},e))})]})}function o$(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 s$({label:t,report:n}){return(0,B.jsxs)(gi,{"aria-label":`${t} report`,variant:n.complete?`default`:`destructive`,children:[n.complete?(0,B.jsx)(qe,{}):(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:n.complete?`Shutdown complete`:`Shutdown incomplete`}),(0,B.jsxs)(vi,{className:`shutdown-report`,children:[!n.complete&&(0,B.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,B.jsxs)(`p`,{className:`channel-age`,children:[`Scope `,n.scope,` · grace `,RQ(n.grace_seconds),n.forced?` · forced`:``,` · runs root `,n.root]}),n.runs.length===0?(0,B.jsx)(`p`,{children:`No run was selected: nothing was signalled.`}):n.runs.map(e=>(0,B.jsxs)(`section`,{"aria-label":`Shutdown of ${e.run_id}`,className:`shutdown-report-run`,children:[(0,B.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,B.jsx)(`p`,{children:`No live dispatch to interrupt.`}):(0,B.jsx)(`ul`,{"aria-label":`Dispatches of ${e.run_id}`,children:e.dispatches.map(e=>(0,B.jsxs)(`li`,{children:[e.node,` (pid `,e.pid,`): interrupt`,` `,e.interrupt,`; ended `,e.ended,` after`,` `,be(e.waited_ms),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.node}-${e.pid}`))}),(0,B.jsxs)(`p`,{children:[`Teardown: `,e.teardown]}),e.branches.length===0?(0,B.jsx)(`p`,{children:`No branch this run's records name.`}):(0,B.jsx)(`ul`,{"aria-label":`Branches of ${e.run_id}`,children:e.branches.map(e=>(0,B.jsxs)(`li`,{children:[e.identity,`@`,e.branch,`: `,o$(e),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.identity}@${e.branch}`))})]},e.run_id)),n.not_pushed_unread===null?n.not_pushed.length===0?(0,B.jsx)(`p`,{children:`Other unpublished branches on this host: none.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host, which this shutdown did not push (`,n.not_pushed.length,`):`]}),(0,B.jsx)(`ul`,{"aria-label":`Branches not pushed`,children:n.not_pushed.map(({identity:e,branch:t})=>(0,B.jsxs)(`li`,{children:[e,`@`,t]},`${e}@${t}`))})]}):(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host: not read —`,` `,n.not_pushed_unread,`. This is not a count of zero: there may be work on this host nothing outside it carries.`]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:`The engine's own report`}),(0,B.jsx)(`pre`,{className:`verb-text`,children:n.rendered})]})]})]})}function c$(e){if(e===void 0||e===``)return;let t;try{t=new URL(e).pathname}catch{return l$}let n=/\/[^/]+\/([^/]+)\/pull\/(\d+)\/?$/u.exec(t);return n===null?l$:`${n[1]}#${n[2]}`}var l$=`Change request`,u$={crosshair:!0,ticks:{minSpacingPx:80}},d$=2e3;function f$(e){let[t,n]=e;if(n-t>=2e3)return e;let r=(t+n)/2;return[r-d$/2,r+d$/2]}var p$=1e3;function m$({completedAt:e,startedAt:t}){let n=t===void 0?void 0:Ae(t),r=e===void 0?void 0:Ae(e),i=h$(n!==void 0&&r===void 0);return n===void 0?null:r===void 0?(0,B.jsxs)(B.Fragment,{children:[be(i-n.getTime()),` · running`]}):(0,B.jsx)(B.Fragment,{children:be(r.getTime()-n.getTime())})}function h$(e){let[t,n]=(0,z.useState)(()=>Date.now());return(0,z.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),p$);return()=>clearInterval(t)},[e]),t}var g$={passed:qe,failed:et,skipped:Xe,neutral:Ye,queued:Je,running:st,"not recorded":Qe};function _$(e){if(e.conclusion===void 0){if(e.status===void 0)return`not recorded`;if(e.status===`in_progress`)return`running`;if(e.status!==`completed`)return`queued`}switch(e.conclusion){case`success`:return`passed`;case`skipped`:return`skipped`;case`neutral`:return`neutral`;default:return`failed`}}function v$({check:e}){let t=_$(e),n=g$[t];return(0,B.jsxs)(`span`,{className:`check-status`,"data-check":t.replace(` `,`-`),title:[e.status??`not recorded`,e.conclusion].filter(Boolean).join(`: `),children:[(0,B.jsx)(n,{"aria-label":t,role:`img`,size:14}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:t})]})}function y$({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?dt:ut;return(0,B.jsxs)(T,{"aria-label":`${t}: ${n}`,className:k(`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,B.jsx)(r,{"aria-hidden":`true`,size:12}),t]})}function b$({counts:e,hidden:t,onHiddenChange:n}){let r=ne.filter(n=>(e.get(n)??0)>0||t.has(n)),i=r.filter(e=>!t.has(e)).length,a=(0,z.useId)();return(0,B.jsxs)(`header`,{className:`event-list-head`,children:[(0,B.jsx)(`h3`,{children:`Events`}),r.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter event-type-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Event types:`,` `,i===r.length?`all ${r.length}`:`${i} of ${r.length}`]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Event types`}),r.map(r=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{"aria-describedby":`${a}-${r}`,"aria-label":Se(r),checked:!t.has(r),onChange:e=>n(e.target.checked?[...t].filter(e=>e!==r):[...t,r]),type:`checkbox`}),(0,B.jsx)(`span`,{children:Se(r)}),(0,B.jsx)(`span`,{className:`event-type-count`,id:`${a}-${r}`,children:e.get(r)??0})]},r)),(0,B.jsxs)(`p`,{className:`event-type-filter-foot`,children:[(0,B.jsx)(`button`,{onClick:()=>n([]),type:`button`,children:`Select all`}),(0,B.jsx)(`button`,{onClick:()=>n([...ne]),type:`button`,children:`Clear`})]})]})]})]})}function x$({onClear:e}){return(0,B.jsxs)(`div`,{className:`event-list-empty`,role:`status`,children:[(0,B.jsx)(`p`,{children:`The event-type filter hides every event in this list.`}),(0,B.jsx)(`button`,{className:`load-earlier`,onClick:e,type:`button`,children:`Show every event type`})]})}function S$({entry:e,onToggle:t,children:n}){let{group:r}=e,i=x(r);return(0,B.jsxs)(`section`,{"aria-label":`${i}: ${r.displayLabel}`,className:`transcript-cycle`,"data-cycle-count":r.count,children:[(0,B.jsxs)(`header`,{className:`transcript-cycle-head`,children:[(0,B.jsx)(_t,{"aria-hidden":`true`,size:14}),(0,B.jsxs)(`strong`,{className:`transcript-cycle-count`,children:[`×`,r.count]}),(0,B.jsxs)(`span`,{className:`transcript-cycle-span`,children:[i,` · `,(0,B.jsx)(u,{at:r.startedAt}),`–`,(0,B.jsx)(u,{at:r.endedAt??r.startedAt}),r.durationMs!==null&&` · ${be(r.durationMs)}`]}),(0,B.jsx)(`button`,{"aria-expanded":e.expanded,onClick:t,type:`button`,children:e.expanded?`Show one pass`:`Show all ${r.children.length}`})]}),n]})}function C$({failure:e,what:t=`Earlier rows`}){return(0,B.jsxs)(`p`,{className:`page-failed`,role:`alert`,children:[(0,B.jsxs)(`span`,{children:[t,` did not load: `,e.message]}),(0,B.jsx)(`button`,{onClick:e.retry,type:`button`,children:`Try again`})]})}var w$=`Partial — loading`;function T$({load:e}){let t=e.total===void 0?`${e.loaded.toLocaleString()} records loaded`:`${e.loaded.toLocaleString()} of ${e.total.toLocaleString()} records loaded`;return(0,B.jsxs)(`p`,{className:`partial-mark`,role:`status`,children:[(0,B.jsx)(`span`,{className:`partial-mark-label`,children:w$}),(0,B.jsx)(`span`,{className:`partial-mark-count`,children:t})]})}function E$(e,t){let[n,r]=(0,z.useState)(null);return(0,z.useLayoutEffect)(()=>{n!==null&&!n.isConnected&&r(null)}),(0,z.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 D$({container:e,partial:t=!1,range:n,stretches:r}){let i=E$(e,r.length>0);if(i===null)return null;let a=Math.max(n[1]-n[0],1),o=e=>(Math.min(Math.max(e,n[0]),n[1])-n[0])/a*100;return(0,Un.createPortal)(r.map(([e,n])=>(0,B.jsx)(`span`,{className:`history-hatch`,"data-from":e,"data-to":n,style:{left:`${o(e)}%`,width:`${o(n)-o(e)}%`},children:(0,B.jsx)(`span`,{className:`history-hatch-label`,children:t?w$:j})},`${e}-${n}`)),i)}function O$(e){return e===`human-step`?`human step`:e}function k$(e){return e.style===`human-step`}function A$(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 j$(e){if(e!==void 0)return e?`yes — a later acknowledgement replaced this one`:`no`}function M$(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 N$(e){return[e.identity,e.target].filter(Boolean).join(` · `)||e.dep}function P$({release:e}){let t=[[`Dependency`,e.dep],[`Identity`,e.identity],[`Release target`,e.target],[`Style`,e.style===void 0?void 0:O$(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`,j$(e.superseded)],[`Landed as`,e.landing_commit],[`Adopted`,M$(e.delivery)]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[t.length>0&&(0,B.jsx)(`dl`,{className:`facts`,children:t.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),e.awaiting!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Held on`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.awaiting.map(e=>(0,B.jsxs)(`li`,{children:[k$(e)?(0,B.jsxs)(gi,{children:[(0,B.jsx)(y,{}),(0,B.jsxs)(_i,{children:[`Waiting on a person · `,N$(e)]}),(0,B.jsx)(vi,{children:e.action??`The release is a human step and the run recorded no action for it.`})]}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Waiting on an automated release · `,N$(e)]}),(0,B.jsx)(`p`,{className:`detail-note`,children:[e.last_answer===void 0?void 0:A$(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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Versions adopted`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.versions.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`p`,{className:`detail-note`,children:[e.identity,` · `,e.target,` · `,e.version]})},`${e.identity}·${e.target}`))})]})]})}function F$({node:e}){let t=e.result?.release??void 0;if(t===void 0)return(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=t.identity!==e.task?.repo;return(0,B.jsx)(B.Fragment,{children:[t.target,t.style===void 0?void 0:O$(t.style),t.version,n?t.identity:void 0].filter(e=>e!==void 0).join(` · `)})}function I$({artifactId:t,client:n,runId:r}){let i=CN(`${r}/${t}`,()=>n.getArtifact(r,t),0),a=i.value?.turns??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Oneharness conversation`}),i.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading conversation…`}):i.value===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`The history store holds no readable copy of that conversation.`}):i.value.unavailable===void 0?(0,B.jsx)(Hi,{className:`gap-0 py-3`,children:(0,B.jsx)(Ui,{className:`px-3`,children:a.map(e=>(0,B.jsx)(kC,{turn:e},e.id))})}):(0,B.jsxs)(gi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`Transcript unavailable`}),(0,B.jsx)(vi,{children:i.value.unavailable})]})]})}function L$({artifactId:e,client:t,heading:n,missing:r,noun:i,runId:a,unreadable:o}){let s=R$(e),c=CN(s===void 0?void 0:`${a}/${s}`,()=>t.getArtifact(a,s??``),0),l=c.value?.content;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:n}),s===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:r}):c.loading?(0,B.jsxs)(`p`,{"aria-live":`polite`,className:`detail-note`,children:[`Loading `,i,`…`]}):l===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:o}):(0,B.jsxs)(B.Fragment,{children:[c.value?.truncated===!0&&(0,B.jsxs)(`p`,{className:`detail-note`,children:[`The server keeps the end of a `,i,` this long; its beginning is not shown.`]}),(0,B.jsx)(`section`,{"aria-label":n,children:(0,B.jsx)(`pre`,{children:l})})]})]})}function R$(e){if(!(e===void 0||/[/?#]/u.test(e)))return e}function z$(e,t,n,r){let[i,a]=(0,z.useState)(),o=t===void 0||n===void 0?void 0:JSON.stringify([t,n]);(0,z.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,z.useMemo)(()=>({conversation:s?.conversation,error:s?.error,loading:o!==void 0&&s===void 0}),[s,o])}function B$(e){let t=(0,z.useRef)(void 0);return(0,z.useCallback)(n=>{t.current?.disconnect(),t.current=void 0;let r=n?.parentElement;if(n===null||r==null)return;let i=()=>r.style.setProperty(e,`${n.getBoundingClientRect().height}px`);i(),t.current=new ResizeObserver(i),t.current.observe(n)},[e])}var V$=32;function H$(e){return e===null?null:e.closest(`[data-slot="scroll-area-viewport"]`)??e.parentElement}function U$(e,t){let n=(0,z.useRef)(null),r=(0,z.useRef)(!0),i=(0,z.useRef)({key:e,count:t}),a=(0,z.useCallback)(()=>{let e=n.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<=V$)},[]),o=(0,z.useCallback)(e=>{n.current?.removeEventListener(`scroll`,a),n.current=H$(e),n.current?.addEventListener(`scroll`,a,{passive:!0}),a()},[a]);return(0,z.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 W$=25;function G$({client:e,runId:t,node:r,row:i}){let a=i===void 0?void 0:p1(i),o=a?.kind===`conversation`?a.value:void 0,s=z$(e,t,o,i===void 0?void 0:s1(i));return(0,B.jsx)(`section`,{"aria-label":`Timeline item detail`,className:`timeline-detail`,children:(0,B.jsx)(pd,{className:`h-full`,children:(0,B.jsx)(`div`,{className:`p-[22px] max-sm:p-3`,ref:U$(o,c1(i,s)),children:i===void 0?(0,B.jsxs)(`div`,{className:`detail-placeholder`,children:[(0,B.jsx)(ot,{size:30}),(0,B.jsx)(`p`,{children:`Select an item in the timeline to read what it recorded.`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{row:i}),(0,B.jsx)(Ed,{className:`my-4`}),(0,B.jsx)(K$,{client:e,runId:t,node:r,reference:a,row:i,transcript:s}),i.rowKind===`event`&&!f1(a)&&(0,B.jsx)(v1,{client:e,event:i.event})]})})})})}function K$({client:e,runId:t,row:n,node:r,reference:i,transcript:a}){if(f1(i))return(0,B.jsx)(Z$,{row:n,transcript:a});let o=l1(n);if(o!==void 0)return(0,B.jsx)(n1,{redirection:o,row:n});let s=u1(n);if(s!==void 0)return(0,B.jsx)(P$,{release:s});let c=d1(n);return c===void 0?h1(n)?(0,B.jsx)(Q$,{client:e,runId:t,reference:i,row:n}):i?.kind===`worker_report`&&R$(i.value)!==void 0?(0,B.jsx)($$,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):i?.kind===`oneharness_session`&&R$(i.value)!==void 0?(0,B.jsx)(e1,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):g1(n,i)&&r!==void 0?(0,B.jsx)(t1,{node:r,reference:i}):(0,B.jsx)(a1,{reference:i,row:n}):(0,B.jsx)(i1,{row:n,surface:c})}function q$({turn:e}){return e.judges===void 0||e.judges.length===0?null:(0,B.jsx)(`ul`,{"aria-label":`Judges on turn ${e.id}`,className:`judge-decisions`,children:e.judges.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`judge-decision-who`,children:[e.judge,` (`,e.kind,`)`]}),` `,e.decision,` — `,e.reason]},e.judge))})}function J$(e){return e.tool?.turn??e.id}function Y$(e,t){if(e.rowKind!==`event`||e.event.tool===void 0)return;let n=J$(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 X$({turn:t}){let n=[t.unknown.instruction_truncated===!0?`its prompt`:void 0,t.unknown.truncated===!0?`its reply`:void 0,t.tools.some(e=>e.output_truncated===!0)?`a tool's output`:void 0,t.tools.some(e=>e.input_truncated===!0)?`a tool's input`:void 0].filter(e=>e!==void 0);return n.length===0?null:(0,B.jsxs)(gi,{className:`mb-3`,role:`note`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`Cut by the recorder`}),(0,B.jsxs)(vi,{children:[`The run's recorder cut `,n.join(`, `),` to its bound, and no whole copy exists: neither the member's report nor a history file this run names holds it.`]})]})}function Z$({row:t,transcript:n}){let[r,i]=(0,z.useState)(W$),a=n.conversation?.conversation.turns??[],o=t.rowKind===`event`?J$(t.event):void 0,s=o===void 0?a:a.filter(({id:e})=>e===o),c=Np(s.map(e=>({id:e.id,time:Date.parse(e.timestamp)}))),l=B$(`--conversation-pinned`);if(n.loading)return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-inline`,children:[(0,B.jsx)(Dd,{className:`h-2 w-40`}),(0,B.jsx)(Dd,{className:`h-2 w-24`}),`Loading transcript…`]});if(n.conversation===void 0)return(0,B.jsxs)(gi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`Transcript unavailable`}),(0,B.jsxs)(vi,{children:[(0,B.jsx)(`p`,{children:n.error?.message??`The server recorded no transcript.`}),t.rowKind===`event`&&Object.keys(t.event.fields??{}).length>0&&(0,B.jsx)(b1,{value:t.event.fields??{}})]})]});let{conversation:u,attribution:d}=n.conversation,f=_1(d.agentRole,d.transportRole),p=Y$(t,s);return(0,B.jsx)(Hi,{className:`gap-0 py-3`,children:(0,B.jsxs)(Ui,{className:`px-3`,children:[(0,B.jsxs)(`header`,{className:`transcript-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`eyebrow`,children:[t.dispatch===void 0?``:`${t.dispatch.label} · `,f,d.persona?` · ${d.persona}`:``]}),(0,B.jsx)(`h4`,{children:u.name})]}),(0,B.jsx)(Sp,{state:u.state})]}),(0,B.jsx)(Ed,{className:`my-2.5`}),(0,B.jsx)(`div`,{className:`conversation-timeline-sticky`,ref:l,children:(0,B.jsx)(Mp,{cursor:c.cursor,...p===void 0?{}:{focus:p},onSelectTurn:c.scrollTo,turns:[...s]})}),s.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This turn is no longer part of the recorded transcript.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`conversation-turns`,ref:c.containerRef,children:s.slice(0,r).map(e=>(0,B.jsxs)(`div`,{ref:t=>c.register(e.id,t),children:[(0,B.jsx)(X$,{turn:e}),(0,B.jsx)(kC,{author:{label:f},...p?.turnId===e.id?{focus:p}:{},turn:e}),(0,B.jsx)(q$,{turn:e})]},e.id))}),s.length>r&&(0,B.jsxs)(Vi,{onClick:()=>i(r+W$),size:`sm`,type:`button`,variant:`outline`,children:[`Show more of `,s.length,` turns`]})]})]})})}function Q$({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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Verification record`}),(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Result`}),(0,B.jsx)(`dd`,{children:i?.ok===void 0?e.status??`in progress`:i.ok?`passed`:`failed`})]})}),i?.output_tail&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Output`}),(0,B.jsx)(`pre`,{children:i.output_tail})]}),(0,B.jsx)(L$,{artifactId:a,client:t,heading:`Full log`,missing:`No readable log was recorded.`,noun:`log`,runId:n,unreadable:`No readable log was recorded.`}),(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Verification `,e.status??`in progress`,`.`]})]})}function $$({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(L$,{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,B.jsx)(a1,{reference:n,row:r})]})}function e1({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(I$,{artifactId:e,client:t,runId:i}),(0,B.jsx)(a1,{reference:n,row:r})]})}function t1({node:e,reference:t}){let n=e.detail?.verification.checks??[],r=e.detail?.publication;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Publication`}),r?.pr_url&&(0,B.jsx)(o1,{fallback:``,reference:{kind:`pr`,value:r.pr_url}}),r?.merged&&r.commit_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.commit_url,rel:`noreferrer`,target:`_blank`,children:[`Merged commit `,r.commit?.slice(0,8),` `,(0,B.jsx)(rt,{size:13})]})}):r?.branch_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.branch_url,rel:`noreferrer`,target:`_blank`,children:[`Branch `,r.branch,` `,(0,B.jsx)(rt,{size:13})]})}):!r?.pr_url&&(0,B.jsx)(o1,{fallback:`No publication was recorded.`,reference:t}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Observed checks`}),n.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`No checks were observed on this node.`}):(0,B.jsx)(`dl`,{className:`facts`,children:n.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.name}),(0,B.jsx)(`dd`,{children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.state}):e.state})]},e.name))})]})}function n1({redirection:e,row:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Delivery`}),(0,B.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,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Turn`}),(0,B.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,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Redirected at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),e.member!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Member`}),(0,B.jsx)(`dd`,{children:e.member})]}),e.input_bytes!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Note`}),(0,B.jsxs)(`dd`,{children:[e.input_bytes,` bytes offered`]})]}),(0,B.jsx)(r1,{row:t})]}),e.reason!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Why it was not delivered`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.reason})]})]})}function r1({row:e}){let t=e.rowKind===`event`?Ne(e.event):void 0;return t===void 0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Author`}),(0,B.jsx)(`dd`,{children:t})]})}function i1({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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),n.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))]}),e.message!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Message`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.message})]})]})}function a1({row:e,reference:t}){if(e.rowKind===`event`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]})}),t!==void 0&&(0,B.jsx)(o1,{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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]}),e.rowKind===`span`&&(e.endedAt!==null||e.status===`running`)&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Ended`}),(0,B.jsx)(`dd`,{children:e.endedAt===null?`Still running`:(0,B.jsx)(u,{at:e.endedAt,relative:!0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:e.status??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Duration`}),(0,B.jsx)(`dd`,{children:e.durationMs===null?`Not recorded`:be(e.durationMs)})]}),r!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Aggregated`}),(0,B.jsx)(`dd`,{children:r})]}),i.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Waiting on`}),(0,B.jsx)(`dd`,{children:i.map(_).join(` and `)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Step`}),(0,B.jsx)(`dd`,{children:m1(n)??`None`})]}),(0,B.jsx)(r1,{row:e})]}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reference`}),(0,B.jsx)(o1,{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 o1({reference:e,fallback:t}){return e===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:t}):e.value.startsWith(`http`)?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:e.value,rel:`noreferrer`,target:`_blank`,children:[e.kind===`pr`?c$(e.value):e.value,` `,(0,B.jsx)(rt,{size:13})]})}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[(0,B.jsx)(`span`,{className:`detail-reference-kind`,children:e.kind}),(0,B.jsx)(`code`,{children:e.value})]})}function s1(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 c1(e,t){return t.conversation===void 0?0:e?.rowKind===`event`?1:t.conversation.conversation.turns.length}function l1(e){return e.rowKind===`event`?e.event.redirection:void 0}function u1(e){return e.rowKind===`event`?e.event.release:void 0}function d1(e){return e.rowKind===`event`?e.event.surface:void 0}function f1(e){return e?.kind===`conversation`}function p1(e){if(e.rowKind===`span`)return e.span.reference;if(e.rowKind===`event`)return e.event.reference}function m1(e){if(e?.rowKind===`span`)return e.span.step_id;if(e?.rowKind===`event`)return e.event.step_id}function h1(e){return e.kind===`verification`||e.kind.startsWith(`verification-`)}function g1(e,t){return t?.kind===`pr`||e.kind===`publication`||e.kind.startsWith(`pr-`)||e.kind.startsWith(`publication-`)}function _1(e,t){return r(e,t)}function v1({client:e,event:t}){let n=t.fields??{},r=t.kind===`command-started`?ue(n.command):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Recorded fields`,className:`record-content`,children:[t.surface_state!==void 0&&(0,B.jsx)(w1,{state:t.surface_state}),t.kind===`human-attested`&&(0,B.jsx)(T1,{client:e,item:n.item}),(t.kind===`node-held`||t.kind===`node-unheld`)&&(0,B.jsx)(E1,{event:t}),(t.kind===`edit-committed`||t.kind===`command-accepted`)&&(0,B.jsx)(D1,{operations:n.operations}),r!==void 0&&(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(r)})})]})}),Object.keys(n).length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This record holds no fields.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Recorded fields`}),(0,B.jsx)(b1,{value:r===void 0?n:Object.fromEntries(Object.entries(n).filter(([e])=>e!==`command`))})]})]})}function y1(e){let t=e.replaceAll(/[_-]+/gu,` `).trim();return t.length===0?e:`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function b1({value:e}){return(0,B.jsx)(`dl`,{className:`facts record-fields`,children:Object.entries(e).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:y1(e)}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(x1,{value:t})})]},e))})}function x1({value:e}){if(e==null)return(0,B.jsx)(`span`,{className:`record-none`,children:`None`});if(typeof e==`string`)return(0,B.jsx)(`span`,{className:`record-text`,children:e});if(typeof e==`number`||typeof e==`boolean`)return(0,B.jsx)(B.Fragment,{children:String(e)});if(Array.isArray(e))return e.length===0?(0,B.jsx)(`span`,{className:`record-none`,children:`None`}):(0,B.jsx)(`ol`,{className:`record-list`,children:e.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(x1,{value:e})},t))});let t=S1(e);return t===void 0?(0,B.jsx)(B.Fragment,{children:String(e)}):(0,B.jsx)(b1,{value:t})}function S1(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function C1(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()!==``?n:void 0}function w1({state:e}){let{status:t}=d(e),n=e.reply,r=[[`Queued`,e.queued_at],[`Read`,e.read_at],[`Answered`,e.replied_at]];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h3`,{className:`detail-heading`,children:[`Surface `,e.id]}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:t})]}),r.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t===void 0?`Not yet`:(0,B.jsx)(u,{at:t})})]},e)),e.correlation!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Correlation`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:e.correlation})})]})]}),n!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reply`}),(0,B.jsx)(b1,{value:n})]})]})}function T1({client:e,item:t}){let n=S1(t),r=C1(n,`id`),i=S1(n?.resolution),a=C1(i,`choice`),o=CN(a===void 0?void 0:r,()=>e.getHumanItem(r??``),0);if(n===void 0)return(0,B.jsx)(`p`,{className:`detail-note`,children:`Attested with no human item resolved: the planner attested it itself.`});let s=o.value?.item.choices?.find(e=>e.id===a)?.title,c=[[`Item`,r],[`Action`,C1(n,`action`)],[`By`,C1(i,`actor`)],[`On behalf of`,C1(i,`on_behalf_of`)],[`Provenance`,C1(i,`provenance`)??`manager`],[`Choice`,a===void 0?void 0:s===void 0?a:`${s} (${a})`],[`Reason`,C1(i,`reason`)]],l=C1(i,`text`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Human item`}),(0,B.jsx)(`dl`,{className:`facts`,children:c.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),l!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Words`}),(0,B.jsx)(`p`,{className:`detail-note record-text`,children:l})]})]})}function E1({event:e}){let t=fe(e);return t.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:e.kind===`node-held`?`Held because`:`Released from`}),(0,B.jsx)(`ul`,{className:`hold-reasons`,children:t.map((e,t)=>(0,B.jsx)(`li`,{children:_(e)},t))})]})}function D1({operations:e}){return!Array.isArray(e)||e.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Operations`}),(0,B.jsx)(`ol`,{className:`record-operations`,children:e.map((e,t)=>{let n=S1(e);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:C1(n,`kind`)??`Operation ${t+1}`}),n===void 0?(0,B.jsx)(x1,{value:e}):(0,B.jsx)(b1,{value:n})]},t)})})]})}var O1=`span:`,k1=500,A1=ae,j1=e=>500*2**(e-1),M1=e=>e.record_id??e.id,N1=Zj.omit({events:!0});function P1(e,t){if(t===void 0)return e;let n=new Set(e.events.map(M1)),r=t.filter(e=>!n.has(M1(e)));if(r.length===0)return e;let i=[...e.events,...r].map(e=>[Date.parse(e.at),e.journal_order??0,e]);return i.sort((e,t)=>e[0]-t[0]||e[1]-t[1]),{...e,events:i.map(([,,e])=>e)}}function F1(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 I1({client:e,runId:t,scope:n,nodeId:r,timeline:i}){let a=(0,z.useRef)(new Map),o=(0,z.useRef)(new Map),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),[u,d]=(0,z.useState)(()=>new Map),f=(0,z.useCallback)(()=>l(e=>e+1),[]),p=(0,z.useCallback)(e=>{for(let t of e.rows)a.current.set(M1(t),t)},[]),m=(0,z.useCallback)(e=>{d(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),h=(0,z.useCallback)((e,t,n)=>{s.current.delete(e),d(r=>new Map(r).set(e,{message:t instanceof Error?t.message:String(t),retry:n})),f()},[f]),g=(0,z.useMemo)(()=>{if(i===void 0)return i;if(n===`node`)for(let e of i.spans)for(let t of e.events)a.current.has(M1(t))||a.current.set(M1(t),{...t,span_id:e.id});let e=new Map;for(let t of a.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&&o.current.size===0?i:{...i,spans:i.spans.map(t=>{let n=P1(t,e.get(t.id)),r=o.current.get(t.id);return r===void 0?n:{...r,...n,events:n.events}})}},[i,c,n]),_=L1({client:e,runId:t,nodeId:n===`node`?r:void 0,opened:i!==void 0,take:p,bump:f}),v=_?.state===`loading`,y=(0,z.useMemo)(()=>n!==`node`||!v?[]:F1(g?.spans??[]),[g,n,v]),b=_?.failure??[...u].find(([e])=>!e.startsWith(O1))?.[1],x=(0,z.useCallback)(e=>u.get(`${O1}${e}`),[u]),S=(0,z.useCallback)(e=>m(`${O1}${e}`),[m]),C=(0,z.useCallback)(async(r,i,a)=>{m(r);try{let r;for(;;){let a=await e.getTimelineEvents(t,{scope:n,limit:k1,...i,...r===void 0?{}:{cursor:r}});p(a);let{span:s}=a;if(i.span!==void 0&&s!==void 0&&o.current.set(i.span,N1.parse(s)),f(),a.next_cursor===null)return;r=a.next_cursor}}catch(e){h(r,e,a)}},[f,m,e,h,t,n,p]),w=(0,z.useCallback)(e=>{let t=`${O1}${e}`;s.current.has(t)||(s.current.add(t),C(t,{span:e,...r===void 0?{}:{node:r}},()=>w(e)))},[r,C]),T=(0,z.useCallback)(e=>{let t=`row:${e??``}`;s.current.has(t)||(s.current.add(t),C(t,e===void 0?{}:{node:e},()=>T(e)))},[C]),E=(0,z.useCallback)((e,t,n)=>{let r=`stretch:${n??``}:${e}:${t}`;s.current.has(r)||(s.current.add(r),C(r,{...n===void 0?{}:{node:n},from:new Date(e).toISOString(),to:new Date(t).toISOString()},()=>E(e,t,n)))},[C]);return{...g===void 0?{}:{timeline:g},unheld:y,loadSpan:w,loadRow:T,loadStretch:E,spanFailure:x,forgetSpan:S,...b===void 0?{}:{failure:b},..._===void 0?{}:{nodeLoad:R1(_)}}}function L1({client:e,runId:t,nodeId:n,opened:r,take:i,bump:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(0);if((0,z.useEffect)(()=>{if(n===void 0||!r)return;let o=new AbortController,c=new Set,u,d=()=>u!==void 0&&c.size>=u,f=!1,p,m=(e,t)=>s({node:n,state:e,loaded:c.size,...u===void 0?{}:{total:u},partial:e===`loading`&&f,...t===void 0?{}:{failure:t}}),h=setTimeout(()=>{f=!0,s(e=>e?.node===n&&e.state===`loading`?{...e,partial:!0}:e)},A1),g=async r=>{try{for await(let r of e.streamNodeTimeline(t,n,o.signal)){if(r.kind===`start`)u=r.total;else{i(r);for(let e of r.rows)c.add(M1(e));a()}d()&&clearTimeout(h),m(d()?`held`:`loading`)}clearTimeout(h),m(`held`),a()}catch(e){if(o.signal.aborted||d())return;if(r<3){p=setTimeout(()=>void g(r+1),j1(r));return}clearTimeout(h),m(`failed`,{message:e instanceof Error?e.message:String(e),retry:()=>l(e=>e+1)})}};return m(`loading`),g(1),()=>{o.abort(),clearTimeout(h),p!==void 0&&clearTimeout(p)}},[e,t,n,r,i,a,c]),!(n===void 0||o?.node!==n))return o}function R1(e){return{state:e.state,loaded:e.loaded,...e.total===void 0?{}:{total:e.total},partial:e.partial}}var z1=`This node is not on the run's graph, so the plan holds no task for it.`;function B1({client:n,runId:r,node:i,nodes:a,timeline:o,timelineError:s,hiddenTypes:c=[],onHiddenTypesChange:l=()=>{},runLoaded:u=!0,onRetry:d,selectedItemId:f,onSelectItem:p,onBack:m,selectedTab:h,onSelectTab:g}){let _=(0,z.useMemo)(()=>t(o,i.id),[o,i.id]);(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(f===void 0?m():p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,p,f]);let v=i.detail?.publication===void 0?i.result?.pr??void 0:i.detail.publication.pr_url;return(0,B.jsx)(`section`,{"aria-label":`Timeline for ${i.label}`,className:`node-view`,children:(0,B.jsxs)(Df,{className:`node-tabs`,onValueChange:e=>{hQ(e)&&g(e)},value:h,children:[(0,B.jsxs)(`section`,{"aria-label":`Node header`,className:`node-view-head`,children:[(0,B.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,B.jsxs)(`ol`,{className:`breadcrumb`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(Vi,{onClick:m,size:`sm`,type:`button`,variant:`ghost`,children:[(0,B.jsx)(Ve,{size:14}),` Graph`]})}),(0,B.jsx)(`li`,{"aria-current":`page`,children:(0,B.jsx)(`span`,{className:`breadcrumb-node`,children:i.label})})]})}),(0,B.jsxs)(`div`,{className:`node-view-facts`,children:[(0,B.jsx)(JZ,{className:`node-view-state`,state:i.status}),(0,B.jsx)(y$,{control:i.control}),(0,B.jsxs)(`span`,{className:`node-view-meta`,children:[pe(i),` node ·`,` `,u?`${i.telemetry?.turns??0} turns · ${i.telemetry?.lint??0} lint turns`:`turns ${oe}`]}),v!==void 0&&(0,B.jsxs)(`a`,{className:`node-view-pr`,href:v,rel:`noreferrer`,target:`_blank`,children:[c$(v),` `,(0,B.jsx)(rt,{size:12})]})]}),(0,B.jsx)(kf,{"aria-label":`Node details`,variant:`line`,children:Object.entries(mQ).map(([e,t])=>(0,B.jsx)(Af,{value:e,children:t},e))})]}),(0,B.jsx)(Q1,{node:i,nodes:a}),(0,B.jsx)(X1,{node:i}),(0,B.jsx)(Z1,{node:i}),(0,B.jsxs)(jf,{className:`node-tab-panel`,value:`task`,children:[i.task===void 0?(0,B.jsx)(`p`,{children:z1}):u?(0,B.jsx)(LY,{source:q1(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Settled as`}),(0,B.jsx)(`dd`,{children:$1(i.result?.outcome)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:$1(i.result?.detail)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Graph overrides`}),(0,B.jsx)(`dd`,{children:u?(i.task?.sets??[]).length===0?`None`:(0,B.jsx)(`ol`,{"aria-label":`Graph overrides`,className:`sets-served`,children:i.task?.sets?.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`code`,{children:e})},t))}):oe})]})]})]}),(0,B.jsx)(jf,{className:`node-tab-panel`,value:`criteria`,children:i.task===void 0?(0,B.jsx)(`p`,{children:z1}):u?(0,B.jsx)(LY,{source:J1(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe})}),(0,B.jsx)(jf,{className:`node-tab-panel`,value:`dependencies`,children:(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Dependencies`}),(0,B.jsx)(`dd`,{children:(i.task?.deps??[]).map(e=>{let t=a.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `)||`None`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unblocks`}),(0,B.jsx)(`dd`,{children:i.dependents.join(`, `)||`None`})]})]})}),(0,B.jsxs)(jf,{className:`node-tab-panel`,value:`remote`,children:[!u&&(0,B.jsx)(`p`,{className:`loading-value`,children:`Loading…`}),(0,B.jsxs)(`dl`,{className:`facts`,hidden:!u,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Publication`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(Y1,{node:i})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Branch`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?.branch??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Merge`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?i.detail.publication.merged?`Merged`:`Not merged`:`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Release`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(F$,{node:i})})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Verification coverage`}),(0,B.jsxs)(`dd`,{children:[`Hook:`,` `,i.detail?.verification.pre_push_hook?`present`:`not recorded`,` · `,`Required checks:`,` `,i.detail?.verification.required_checks?.join(`, `)||`none configured`]})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Observed checks`}),(0,B.jsx)(`dd`,{children:(i.detail?.verification.checks??[]).length===0?`No checks observed`:(0,B.jsxs)(`table`,{"aria-label":`Remote checks`,className:`remote-checks`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Runtime`}),(0,B.jsx)(`th`,{children:`Required`})]})}),(0,B.jsx)(`tbody`,{children:i.detail?.verification.checks?.map(e=>(0,B.jsxs)(`tr`,{className:e.status===`completed`&&![`success`,`neutral`,`skipped`].includes(e.conclusion??``)?`check-failing`:void 0,children:[(0,B.jsx)(`th`,{scope:`row`,children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.name}):e.name}),(0,B.jsx)(`td`,{children:(0,B.jsx)(v$,{check:e})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(m$,{...e.started_at===void 0?{}:{startedAt:e.started_at},...e.completed_at===void 0?{}:{completedAt:e.completed_at}})}),(0,B.jsxs)(`td`,{title:e.requirement,className:e.required?`check-required`:`check-optional`,children:[(0,B.jsx)(`svg`,{role:`img`,"aria-label":e.required?`required`:`not required`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:e.required?(0,B.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,B.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,B.jsx)(jf,{className:`node-timeline-panel`,value:`timeline`,children:s===void 0?o===void 0?(0,B.jsx)(`div`,{"aria-live":`polite`,className:`loading-state`,children:`Loading the recorded timeline…`}):_.rows.length===0?(0,B.jsxs)(Hi,{className:`m-5 items-center gap-2 p-8 text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`m-0`,children:`This node has no recorded timeline yet.`}),(0,B.jsx)(`p`,{className:`m-0 text-[11px]`,children:`Spans and events appear here as the run records them.`})]}):(0,B.jsx)(V1,{client:n,hiddenTypes:c,node:i,onHiddenTypesChange:l,onSelectItem:p,runId:r,selectedItemId:f,timeline:o}):(0,B.jsxs)(gi,{className:`m-5 w-auto`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`Timeline unavailable`}),(0,B.jsxs)(vi,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Vi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})})]})})}function V1({client:e,hiddenTypes:t,node:n,onHiddenTypesChange:r,onSelectItem:i,runId:s,selectedItemId:c,timeline:l}){let u=I1({client:e,runId:s,scope:`node`,nodeId:n.id,timeline:l}),d=u.timeline??l,f=(0,z.useMemo)(()=>de(d,n.id),[d,n.id]),p=(0,z.useMemo)(()=>new Set(t),[t]),_=(0,z.useMemo)(()=>o(f.tree,p),[f.tree,p]),v=(0,z.useMemo)(()=>ze(f.tree),[f.tree]),[y,x]=(0,z.useState)(()=>new Set),S=(0,z.useMemo)(()=>c===void 0?[]:h(_,c).filter(e=>e.rowKind===`group`).map(({id:e})=>e),[_,c]),C=(0,z.useMemo)(()=>S.length===0?y:new Set([...y,...S]),[y,S]),w=(0,z.useMemo)(()=>m(_,C),[_,C]),T=(0,z.useMemo)(()=>g(w).map(e=>({id:e.id,time:Date.parse(e.startedAt)})),[w]);U1(f,w);let E=u.nodeLoad?.state===`loading`,D=(0,z.useRef)(T);E||(D.current=T);let O=Np(E?D.current:T),[k,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(),N=(0,z.useMemo)(()=>F(f.items,f.lanes),[f.items,f.lanes]),P=(0,z.useMemo)(()=>Fe(f.markers,f.items,c),[f.items,f.markers,c]),I=(0,z.useMemo)(()=>H1([...f.items,...f.markers.map(({at:e})=>({start:e}))]),[f.items,f.markers]),ee=(0,z.useMemo)(()=>H1([...k?f.items:N,...P.map(({at:e})=>({start:e}))]),[k,f.items,N,P]),L=O.cursor===void 0?void 0:Math.min(Math.max(O.cursor,I[0]),I[1]),te=c===void 0?void 0:a(_,c)??a(f.rows,c),ne=(0,z.useRef)(0),re=e=>{ne.current=Date.now()+500,i(e),O.scrollTo(e)},ie=(0,z.useRef)(re);ie.current=re;let ae=(0,z.useCallback)(e=>ie.current(e),[]),oe=(0,z.useRef)(null),{containerRef:se}=O,ce=(0,z.useCallback)(e=>{oe.current=e,se(e)},[se]),le=(0,z.useRef)(null),{loadSpan:ue,forgetSpan:fe}=u,pe=te?.rowKind===`span`?te.span.id:void 0;(0,z.useEffect)(()=>{if(pe!==void 0)return ue(pe),()=>fe(pe)},[pe,ue,fe]);let me=pe===void 0?void 0:u.spanFailure(pe),{scrollTo:he}=O;return(0,z.useEffect)(()=>{c!==void 0&&(ne.current=Date.now()+500,he(c))},[c,he]),(0,B.jsxs)(`div`,{className:`node-execution`,"data-expanded":k,children:[(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node timeline`,className:`node-timeline-sticky`,"data-testid":`node-timeline`,ref:le,children:[(0,B.jsx)(D$,{container:le,partial:u.nodeLoad?.partial===!0,range:j??ee,stretches:u.unheld}),u.nodeLoad?.partial===!0&&(0,B.jsx)(T$,{load:u.nodeLoad}),(0,B.jsx)(tn,{...u$,axis:{origin:I[0]},cursor:L,expanded:k,getFailureExcerpt:e=>e.payload.rowKind===`span`?e.payload.span.detail?.output_tail:void 0,items:k?f.items:N,lanes:f.lanes,markers:P,onExpandedChange:A,onRangeChange:e=>M(e[0]<=ee[0]&&e[1]>=ee[1]?void 0:f$(e)),onSelect:e=>re(e.id),range:j??ee,selectedId:c})]}),(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node transcript`,className:`node-transcript`,ref:ce,children:[u.failure!==void 0&&(0,B.jsx)(C$,{failure:u.failure,what:`This node's timeline`}),(0,B.jsx)(b$,{counts:v,hidden:p,onHiddenChange:r}),_.length===0&&f.tree.length>0&&(0,B.jsx)(x$,{onClear:()=>r([])}),b(w).map(e=>{let t=(0,B.jsx)(W1,{entries:e.entries,onOpen:ae,onToggle:e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),register:O.register,selectedItemId:c},e.id);return e.dispatch===void 0?(0,B.jsx)(z.Fragment,{children:t},e.id):(0,B.jsxs)(`section`,{"aria-label":e.dispatch.label,className:`transcript-dispatch`,children:[(0,B.jsx)(`h3`,{children:e.dispatch.label}),t]},e.id)})]}),te!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Vi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>i(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(G$,{client:e,node:n,row:te,runId:s}),me!==void 0&&(0,B.jsx)(C$,{failure:me})]})]})}function H1(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]}function U1(e,t){(0,z.useLayoutEffect)(()=>{let n=window.__nodeLoadProbe;if(n===void 0)return;let r=[],i=e=>{r.push(e.id);for(let t of e.children)i(t)};for(let e of t)if(e.entryKind===`row`)r.push(e.row.id);else for(let t of e.group.children)i(t);n({chart:[...e.items.map(e=>e.id),...e.markers.map(e=>e.id)],list:r})},[e,t])}function W1({entries:e,onOpen:t,onToggle:n,register:r,selectedItemId:i}){return e.map(e=>e.entryKind===`row`?(0,B.jsx)(K1,{onOpen:t,register:r,row:e.row,selected:e.row.id===i||i!==void 0&&e.row.aliases?.includes(i)===!0},e.row.id):(0,B.jsx)(S$,{entry:e,onToggle:()=>n(e.group.id),children:(0,B.jsx)(W1,{entries:e.entries,onOpen:t,onToggle:n,register:r,...i===void 0?{}:{selectedItemId:i}})},e.group.id))}function G1(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.statusAt===r.statusAt&&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 K1=(0,z.memo)(function({row:e,selected:t,register:n,onOpen:r}){let{id:i}=e,a=(0,z.useCallback)(e=>n(i,e),[n,i]);return(0,B.jsx)(`article`,{"aria-current":t?`true`:void 0,"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,B.jsxs)(`button`,{"aria-label":`Open ${e.displayLabel}`,onClick:()=>r(e.id),type:`button`,children:[(0,B.jsxs)(`span`,{className:`eyebrow`,children:[e.rowKind===`event`&&(0,B.jsx)(O,{category:e.category}),e.displayKind]}),(0,B.jsx)(`strong`,{className:`transcript-label`,title:e.displayLabel,children:e.displayLabel}),(0,B.jsxs)(`span`,{className:`transcript-facts`,children:[(0,B.jsx)(u,{at:e.startedAt}),e.durationMs!==null&&` · ${be(e.durationMs)}`,` · ${e.status??`recorded`}`,e.statusAt!==void 0&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(u,{at:e.statusAt})]}),e.sessionName!==void 0&&` · ${e.sessionName}`]})]})})},G1);function q1(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(`
105
+ `)&&!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:kQ,easing:`ease-out`})}n.current=a},[e,t])}function MQ({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}=OQ(e,l,n,i??r),g=(0,z.useRef)(null);return jQ(g,h),(0,B.jsx)(`nav`,{"aria-label":`Projects`,className:`run-nav`,"data-open":f,id:`run-navigation`,ref:p,children:(0,B.jsx)(gd,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`px-[18px] py-6 max-sm:px-2`,children:[(0,B.jsxs)(`div`,{className:`brand`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`brand-mark`,children:(0,B.jsx)(Be,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Local orchestration`}),(0,B.jsx)(`h1`,{children:`DAG Observatory`})]})]}),(0,B.jsx)(kd,{className:`my-[22px]`}),(0,B.jsxs)(`div`,{className:`nav-pages`,children:[(0,B.jsx)(Wi,{"aria-current":o?`page`:void 0,onClick:a,variant:`ghost`,children:`Host`}),s&&(0,B.jsx)(Wi,{"aria-current":c?`page`:void 0,onClick:s,variant:`ghost`,children:`Action items`})]}),m.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Run kinds:`,` `,m.filter(e=>!l.includes(e)).length,` of`,` `,m.length]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Run kinds`}),m.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.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,B.jsx)(`p`,{role:`status`,children:t?`Projects did not load`:`Loading projects…`}):(0,B.jsx)(`div`,{className:`nav-rows`,ref:g,children:h.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`Project ${e.label}`,className:`project-group`,children:[(0,B.jsxs)(`div`,{className:`project-row`,[AQ]:`project:${e.key}`,children:[(0,B.jsx)(`button`,{"aria-expanded":e.expanded,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${e.label}`,className:`project-toggle`,onClick:e.toggle,type:`button`,children:(0,B.jsx)(Ge,{"aria-hidden":`true`,"data-open":e.expanded,size:12})}),(0,B.jsxs)(`button`,{className:`project-open`,onClick:e.open,type:`button`,children:[(0,B.jsx)(`span`,{className:`project-name`,children:e.label}),(0,B.jsxs)(`span`,{className:`project-count`,children:[e.runs.length,(0,B.jsx)(`span`,{className:`sr-only`,children:` shown runs`})]})]})]}),e.expanded&&e.runs.length===0&&(0,B.jsx)(`p`,{className:`run-list-status`,role:`status`,children:`No runs of the shown kinds.`}),e.expanded&&e.runs.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Runs of ${e.label}`,className:`run-list`,children:e.runs.map(e=>{let t=n===e.id,i=[e.state,EQ(e)].filter(Boolean).join(` · `);return(0,B.jsx)(`li`,{children:(0,B.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,B.jsxs)(xp,{children:[(0,B.jsx)(Sp,{asChild:!0,children:(0,B.jsx)(`span`,{role:`img`,"aria-label":e.state,className:k(`run-dot`,eQ(e.state))})}),(0,B.jsx)(Cp,{children:e.state})]}),(0,B.jsx)(`span`,{className:`run-link-name`,children:e.name}),e.kind&&(0,B.jsx)(`span`,{"aria-label":e.kind,className:`run-link-tag`,role:`note`,children:e.kind}),t&&(0,B.jsx)(`span`,{className:`run-link-counts`,children:i})]})},e.id)})})]},e.key))})]})})})}function NQ(){let[e,t]=(0,z.useState)(!1),n=(0,z.useRef)(null),r=(0,z.useRef)(null),i=(0,z.useRef)(!1),a=(0,z.useCallback)(()=>t(!1),[]),o=(0,z.useCallback)(()=>t(e=>!e),[]);return(0,z.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,z.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 PQ(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useRef)(void 0),a=(0,z.useRef)(t);a.current=t;let o=e===`live`,s=(0,z.useRef)(o);s.current=o;let c=(0,z.useCallback)(e=>{i.current=void 0,r(0),a.current(e)},[]),l=(0,z.useCallback)(()=>{i.current!==void 0&&c(i.current.value)},[c]),u=(0,z.useCallback)((e,t=1)=>{s.current?c(e):(i.current={value:e},r(e=>e+t))},[c]),d=(0,z.useCallback)(()=>{i.current=void 0,r(0)},[]);return(0,z.useEffect)(()=>{o&&l()},[o,l]),(0,z.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 FQ(e,t){let[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),[o,s]=(0,z.useState)({}),c=(0,z.useRef)([]),[l,u]=(0,z.useState)(),[d,f]=(0,z.useState)(),[p,m]=(0,z.useState)(),[h,g]=(0,z.useState)(),[_,v]=(0,z.useState)(),[y,b]=(0,z.useState)(),[x,S]=(0,z.useState)(0),C=t.runId,w=l===void 0||C!==void 0&&l.some(e=>e.id===C)?C:C!==void 0||t.selectFirst?wQ(l)[0]?.id:void 0,T=(0,z.useMemo)(()=>t.humanItems??Me(t.host?void 0:w,t.view,t.nodeId),[t.humanItems,t.host,w,t.view,t.nodeId]),E=(0,z.useRef)(void 0),D=(0,z.useRef)(T);D.current=T;let O=(0,z.useRef)(t.first),k=PQ(t.navigationUpdates,f),A=PQ(t.mainUpdates,(0,z.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,z.useRef)(j);M.current=j,(0,z.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=DQ(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 pN&&(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,z.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,z.useEffect)(()=>{j?E.current?.resume():E.current?.pause()},[j]);let N=(0,z.useCallback)(()=>{k.take(),A.take()},[k.take,A.take]),P=(0,z.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&&IQ(F,T)&&JSON.stringify(i)===JSON.stringify(T)?F:void 0,ee=(0,z.useRef)(void 0),L=I?.detail??(ee.current?.run.run_id===w?ee.current:void 0);ee.current=L;let te=(0,z.useMemo)(()=>LQ(L),[L]),ne=h!==void 0&&T.type===`timeline`&&L!==void 0;return{rows:l,navigationRows:d,navigationWaiting:k.waiting,hostRows:n?.sidebar,mainWaiting:A.waiting,runId:w,detail:L,timeline:I&&`timeline`in I?I.timeline:void 0,humanItems:o,timelineError:ne?h:void 0,loading:n===void 0&&h===void 0,lastUpdated:p,activity:te,error:ne?_:h??_,notice:y,refresh:P}}function IQ(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 LQ(e){let t=e?.run.live_activity;if(t===void 0)return[];let n=Nj.safeParse(t);return n.success?n.data:[]}var RQ={minutes:60,seconds:1},zQ=e=>Object.hasOwn(RQ,e),BQ=600%RQ.minutes==0?{amount:String(600/RQ.minutes),unit:`minutes`}:{amount:`600`,unit:`seconds`};function VQ(e){let t=e.amount.trim();if(!/^\d+$/u.test(t))return;let n=Number(t)*RQ[e.unit];return Number.isSafeInteger(n)?n:void 0}function HQ(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 UQ(e){return e.map(e=>({runId:e.run_id,owner:Te(e.launch)}))}function WQ(e,t){return t instanceof pN&&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 GQ={dispatchStopped:`dispatch-stopped`,hostShutdown:`host-shutdown`};function KQ(e,t,n){let r=new Set(e.runs.map(({runId:e})=>e)),i=Object.values(GQ);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===GQ.hostShutdown?GQ.hostShutdown:GQ.dispatchStopped}]})}function qQ(e){return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).format(e)}function JQ(e){return(0,z.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 YQ=`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 XQ({open:e,onOpenChange:t,runs:n,blocked:r,unreadable:i=0,onConfirm:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)(BQ),[l,u]=(0,z.useState)(!1),d=VQ(s),f=n!==void 0&&r===void 0,p=()=>{c(BQ),u(!1),t(!1)};return(0,B.jsx)(Es,{onOpenChange:e=>e?t(!0):p(),open:e,children:(0,B.jsxs)(As,{className:`shutdown-dialog`,children:[(0,B.jsxs)(js,{children:[(0,B.jsx)(Ns,{children:`Shut down the entire host?`}),(0,B.jsx)(Ps,{children:YQ})]}),(0,B.jsxs)(`div`,{className:`shutdown-dialog-body`,children:[r===void 0?n===void 0?(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:`Reading which runs this acts on…`}):(0,B.jsx)(QQ,{caption:`It acts on all ${ZQ(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,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:r}),i>0&&(0,B.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,B.jsxs)(`fieldset`,{className:`shutdown-grace`,children:[(0,B.jsx)(`legend`,{children:`Grace`}),(0,B.jsxs)(`div`,{className:`shutdown-grace-row`,children:[(0,B.jsx)(Rs,{className:`sr-only`,htmlFor:`${o}-grace`,children:`Grace`}),(0,B.jsx)(Fs,{"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,B.jsx)(Rs,{className:`sr-only`,htmlFor:`${o}-unit`,children:`Grace unit`}),(0,B.jsx)(`select`,{className:`composer-select`,id:`${o}-unit`,onChange:e=>{let t=e.target.value;zQ(t)&&c({...s,unit:t})},value:s.unit,children:Object.keys(RQ).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.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: ${HQ(d)}. The engine's default is ${HQ(VQ(BQ)??0)}.`})]}),(0,B.jsxs)(`div`,{className:`composer-check shutdown-force`,children:[(0,B.jsx)(`input`,{checked:l,id:`${o}-force`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,B.jsx)(Rs,{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,B.jsxs)(Ms,{children:[(0,B.jsx)(Os,{asChild:!0,children:(0,B.jsx)(Wi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(Wi,{disabled:!f||d===void 0,onClick:()=>{d!==void 0&&(a(d,l),p())},type:`button`,variant:`destructive`,children:`Shut down the host`})]})]})})}var ZQ=e=>e===1?`1 run`:`${e} runs`;function QQ({caption:e,label:t,runs:n,warning:r=!1}){let i=JQ(n);return(0,B.jsxs)(`div`,{className:`shutdown-runs`,"data-warning":r,children:[(0,B.jsx)(`p`,{className:`shutdown-scope-note`,children:e}),(0,B.jsx)(`ul`,{"aria-label":t,children:i.map(({owner:e,count:t})=>(0,B.jsxs)(`li`,{children:[e,` — `,ZQ(t)]},e))})]})}function $Q(e,t,n){let[r,i]=(0,z.useState)(),a=e$(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:UQ(a.rows),blocked:a.blocked,unreadable:e?.unreadable?.length??0}}function e$(e,t,n,r){let i=(0,z.useRef)(new Set),a=t?.next_cursor;return(0,z.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 t$(e,t){let[n,r]=(0,z.useState)({phase:`idle`}),i=(0,z.useRef)(!1);return{state:n,confirm:(0,z.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(WQ(s,e))).finally(()=>{i.current=!1})},[e,t]),dismiss:(0,z.useCallback)(()=>{i.current||r({phase:`idle`})},[])}}var n$=[`host`];function r$(e){return{host:t$(`host`,(0,z.useCallback)(t=>e.shutdown(`host`,t),[e]))}}function i$({list:e,loadMore:t,loadingMore:n,shutdowns:r}){let{open:i,setOpen:a,opener:o,runs:s,blocked:c,unreadable:l}=$Q(e,t,n),u=r.host.state.phase===`sending`;return(0,B.jsxs)(`fieldset`,{"aria-label":`Shut down runs on this host`,className:`host-shutdown`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`This host`}),(0,B.jsx)(`div`,{className:`host-shutdown-actions`,children:(0,B.jsxs)(Wi,{disabled:u,onClick:o(`host`),size:`sm`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(ht,{size:14}),` Shut down the entire host`]})}),n$.map(e=>(0,B.jsx)(XQ,{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 a$=1e3;function o$(e,t){let[n,r]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),a$);return()=>clearInterval(e)},[]);let i=KQ(e,(0,z.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===GQ.hostShutdown).length,deadline:e.sentAt+e.grace*1e3,asks:!e.force&&e.grace>0}}function s$({label:t,state:n,rows:r,onDismiss:i}){return n.phase===`idle`?null:(0,B.jsxs)(`section`,{"aria-label":t,className:`shutdown-status`,children:[n.phase===`sending`?(0,B.jsx)(l$,{rows:r,sent:n.sent}):n.phase===`lost`?(0,B.jsxs)(yi,{"aria-label":`${t} lost`,variant:`destructive`,children:[(0,B.jsx)(wt,{}),(0,B.jsx)(bi,{children:`Shutdown lost: no answer came back`}),(0,B.jsxs)(xi,{children:[(0,B.jsxs)(`p`,{children:[`The request sent at `,qQ(n.sent.sentAt),` ended without an answer (`,n.error.message,`). The engine may still be carrying out the shutdown — check the runs before sending another.`]}),(0,B.jsx)(c$,{sent:n.sent})]})]}):n.phase===`refused`?(0,B.jsxs)(yi,{"aria-label":`${t} refused`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsxs)(bi,{children:[`Shutdown refused · `,n.error.status,` `,n.error.code]}),(0,B.jsxs)(xi,{children:[(0,B.jsx)(`pre`,{className:`verb-text`,children:n.error.message}),(0,B.jsx)(`p`,{children:`Nothing was signalled and nothing was pushed.`})]})]}):(0,B.jsx)(d$,{label:t,report:n.report}),n.phase!==`sending`&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(Wi,{onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`})})]})}function c$({sent:e}){return(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Sent `,qQ(e.sentAt),` · scope `,e.scope,` · grace`,` `,HQ(e.grace),e.force?` · forced`:``,` · `,e.runs.length,` `,e.runs.length===1?`run`:`runs`,` in scope`]})}function l$({sent:e,rows:t}){let{now:n,progress:r,done:i,deadline:a,asks:o}=o$(e,t);return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`shutdown-inflight`,role:`status`,children:[(0,B.jsxs)(`p`,{className:`shutdown-inflight-head`,children:[(0,B.jsx)(st,{"aria-hidden":`true`,className:`animate-spin`,size:14}),(0,B.jsx)(`strong`,{children:`Shutdown in progress`}),` — still waiting for the engine's answer, `,be(Math.max(0,n-e.sentAt)),` after it was sent.`]}),(0,B.jsx)(c$,{sent:e}),(0,B.jsx)(`p`,{children:o?n<a?`Waiting out the ${HQ(e.grace)} grace until ${qQ(a)} (${be(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 ${qQ(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,B.jsxs)(`p`,{children:[i,` of `,e.runs.length,` `,e.runs.length===1?`run has`:`runs have`,` recorded their shutdown.`]}),r.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Recorded so far`,children:r.map(({runId:e,recorded:t})=>(0,B.jsxs)(`li`,{children:[e,`:`,` `,t===GQ.hostShutdown?`put down — host-shutdown recorded after its teardown and pushes`:`its dispatches are stopping — dispatch-stopped recorded`]},e))})]})}function u$(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 d$({label:t,report:n}){return(0,B.jsxs)(yi,{"aria-label":`${t} report`,variant:n.complete?`default`:`destructive`,children:[n.complete?(0,B.jsx)(qe,{}):(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:n.complete?`Shutdown complete`:`Shutdown incomplete`}),(0,B.jsxs)(xi,{className:`shutdown-report`,children:[!n.complete&&(0,B.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,B.jsxs)(`p`,{className:`channel-age`,children:[`Scope `,n.scope,` · grace `,HQ(n.grace_seconds),n.forced?` · forced`:``,` · runs root `,n.root]}),n.runs.length===0?(0,B.jsx)(`p`,{children:`No run was selected: nothing was signalled.`}):n.runs.map(e=>(0,B.jsxs)(`section`,{"aria-label":`Shutdown of ${e.run_id}`,className:`shutdown-report-run`,children:[(0,B.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,B.jsx)(`p`,{children:`No live dispatch to interrupt.`}):(0,B.jsx)(`ul`,{"aria-label":`Dispatches of ${e.run_id}`,children:e.dispatches.map(e=>(0,B.jsxs)(`li`,{children:[e.node,` (pid `,e.pid,`): interrupt`,` `,e.interrupt,`; ended `,e.ended,` after`,` `,be(e.waited_ms),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.node}-${e.pid}`))}),(0,B.jsxs)(`p`,{children:[`Teardown: `,e.teardown]}),e.branches.length===0?(0,B.jsx)(`p`,{children:`No branch this run's records name.`}):(0,B.jsx)(`ul`,{"aria-label":`Branches of ${e.run_id}`,children:e.branches.map(e=>(0,B.jsxs)(`li`,{children:[e.identity,`@`,e.branch,`: `,u$(e),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.identity}@${e.branch}`))})]},e.run_id)),n.not_pushed_unread===null?n.not_pushed.length===0?(0,B.jsx)(`p`,{children:`Other unpublished branches on this host: none.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host, which this shutdown did not push (`,n.not_pushed.length,`):`]}),(0,B.jsx)(`ul`,{"aria-label":`Branches not pushed`,children:n.not_pushed.map(({identity:e,branch:t})=>(0,B.jsxs)(`li`,{children:[e,`@`,t]},`${e}@${t}`))})]}):(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host: not read —`,` `,n.not_pushed_unread,`. This is not a count of zero: there may be work on this host nothing outside it carries.`]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:`The engine's own report`}),(0,B.jsx)(`pre`,{className:`verb-text`,children:n.rendered})]})]})]})}function f$(e){if(e===void 0||e===``)return;let t;try{t=new URL(e).pathname}catch{return p$}let n=/\/[^/]+\/([^/]+)\/pull\/(\d+)\/?$/u.exec(t);return n===null?p$:`${n[1]}#${n[2]}`}var p$=`Change request`,m$={crosshair:!0,ticks:{minSpacingPx:80}},h$=2e3;function g$(e){let[t,n]=e;if(n-t>=2e3)return e;let r=(t+n)/2;return[r-h$/2,r+h$/2]}var _$=1e3;function v$({completedAt:e,startedAt:t}){let n=t===void 0?void 0:Ae(t),r=e===void 0?void 0:Ae(e),i=y$(n!==void 0&&r===void 0);return n===void 0?null:r===void 0?(0,B.jsxs)(B.Fragment,{children:[be(i-n.getTime()),` · running`]}):(0,B.jsx)(B.Fragment,{children:be(r.getTime()-n.getTime())})}function y$(e){let[t,n]=(0,z.useState)(()=>Date.now());return(0,z.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),_$);return()=>clearInterval(t)},[e]),t}var b$={passed:qe,failed:et,skipped:Xe,neutral:Ye,queued:Je,running:st,"not recorded":Qe};function x$(e){if(e.conclusion===void 0){if(e.status===void 0)return`not recorded`;if(e.status===`in_progress`)return`running`;if(e.status!==`completed`)return`queued`}switch(e.conclusion){case`success`:return`passed`;case`skipped`:return`skipped`;case`neutral`:return`neutral`;default:return`failed`}}function S$({check:e}){let t=x$(e),n=b$[t];return(0,B.jsxs)(`span`,{className:`check-status`,"data-check":t.replace(` `,`-`),title:[e.status??`not recorded`,e.conclusion].filter(Boolean).join(`: `),children:[(0,B.jsx)(n,{"aria-label":t,role:`img`,size:14}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:t})]})}function C$({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?dt:ut;return(0,B.jsxs)(T,{"aria-label":`${t}: ${n}`,className:k(`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,B.jsx)(r,{"aria-hidden":`true`,size:12}),t]})}function w$({counts:e,hidden:t,onHiddenChange:n}){let r=ne.filter(n=>(e.get(n)??0)>0||t.has(n)),i=r.filter(e=>!t.has(e)).length,a=(0,z.useId)();return(0,B.jsxs)(`header`,{className:`event-list-head`,children:[(0,B.jsx)(`h3`,{children:`Events`}),r.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter event-type-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Event types:`,` `,i===r.length?`all ${r.length}`:`${i} of ${r.length}`]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Event types`}),r.map(r=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{"aria-describedby":`${a}-${r}`,"aria-label":Se(r),checked:!t.has(r),onChange:e=>n(e.target.checked?[...t].filter(e=>e!==r):[...t,r]),type:`checkbox`}),(0,B.jsx)(`span`,{children:Se(r)}),(0,B.jsx)(`span`,{className:`event-type-count`,id:`${a}-${r}`,children:e.get(r)??0})]},r)),(0,B.jsxs)(`p`,{className:`event-type-filter-foot`,children:[(0,B.jsx)(`button`,{onClick:()=>n([]),type:`button`,children:`Select all`}),(0,B.jsx)(`button`,{onClick:()=>n([...ne]),type:`button`,children:`Clear`})]})]})]})]})}function T$({onClear:e}){return(0,B.jsxs)(`div`,{className:`event-list-empty`,role:`status`,children:[(0,B.jsx)(`p`,{children:`The event-type filter hides every event in this list.`}),(0,B.jsx)(`button`,{className:`load-earlier`,onClick:e,type:`button`,children:`Show every event type`})]})}function E$({entry:e,onToggle:t,children:n}){let{group:r}=e,i=x(r);return(0,B.jsxs)(`section`,{"aria-label":`${i}: ${r.displayLabel}`,className:`transcript-cycle`,"data-cycle-count":r.count,children:[(0,B.jsxs)(`header`,{className:`transcript-cycle-head`,children:[(0,B.jsx)(_t,{"aria-hidden":`true`,size:14}),(0,B.jsxs)(`strong`,{className:`transcript-cycle-count`,children:[`×`,r.count]}),(0,B.jsxs)(`span`,{className:`transcript-cycle-span`,children:[i,` · `,(0,B.jsx)(u,{at:r.startedAt}),`–`,(0,B.jsx)(u,{at:r.endedAt??r.startedAt}),r.durationMs!==null&&` · ${be(r.durationMs)}`]}),(0,B.jsx)(`button`,{"aria-expanded":e.expanded,onClick:t,type:`button`,children:e.expanded?`Show one pass`:`Show all ${r.children.length}`})]}),n]})}function D$({failure:e,what:t=`Earlier rows`}){return(0,B.jsxs)(`p`,{className:`page-failed`,role:`alert`,children:[(0,B.jsxs)(`span`,{children:[t,` did not load: `,e.message]}),(0,B.jsx)(`button`,{onClick:e.retry,type:`button`,children:`Try again`})]})}var O$=`Partial — loading`;function k$({load:e}){let t=e.total===void 0?`${e.loaded.toLocaleString()} records loaded`:`${e.loaded.toLocaleString()} of ${e.total.toLocaleString()} records loaded`;return(0,B.jsxs)(`p`,{className:`partial-mark`,role:`status`,children:[(0,B.jsx)(`span`,{className:`partial-mark-label`,children:O$}),(0,B.jsx)(`span`,{className:`partial-mark-count`,children:t})]})}function A$(e,t){let[n,r]=(0,z.useState)(null);return(0,z.useLayoutEffect)(()=>{n!==null&&!n.isConnected&&r(null)}),(0,z.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 j$({container:e,partial:t=!1,range:n,stretches:r}){let i=A$(e,r.length>0);if(i===null)return null;let a=Math.max(n[1]-n[0],1),o=e=>(Math.min(Math.max(e,n[0]),n[1])-n[0])/a*100;return(0,Kn.createPortal)(r.map(([e,n])=>(0,B.jsx)(`span`,{className:`history-hatch`,"data-from":e,"data-to":n,style:{left:`${o(e)}%`,width:`${o(n)-o(e)}%`},children:(0,B.jsx)(`span`,{className:`history-hatch-label`,children:t?O$:j})},`${e}-${n}`)),i)}function M$(e){return e===`human-step`?`human step`:e}function N$(e){return e.style===`human-step`}function P$(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 F$(e){if(e!==void 0)return e?`yes — a later acknowledgement replaced this one`:`no`}function I$(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 L$(e){return[e.identity,e.target].filter(Boolean).join(` · `)||e.dep}function R$({release:e}){let t=[[`Dependency`,e.dep],[`Identity`,e.identity],[`Release target`,e.target],[`Style`,e.style===void 0?void 0:M$(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`,F$(e.superseded)],[`Landed as`,e.landing_commit],[`Adopted`,I$(e.delivery)]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[t.length>0&&(0,B.jsx)(`dl`,{className:`facts`,children:t.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),e.awaiting!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Held on`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.awaiting.map(e=>(0,B.jsxs)(`li`,{children:[N$(e)?(0,B.jsxs)(yi,{children:[(0,B.jsx)(y,{}),(0,B.jsxs)(bi,{children:[`Waiting on a person · `,L$(e)]}),(0,B.jsx)(xi,{children:e.action??`The release is a human step and the run recorded no action for it.`})]}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Waiting on an automated release · `,L$(e)]}),(0,B.jsx)(`p`,{className:`detail-note`,children:[e.last_answer===void 0?void 0:P$(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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Versions adopted`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.versions.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`p`,{className:`detail-note`,children:[e.identity,` · `,e.target,` · `,e.version]})},`${e.identity}·${e.target}`))})]})]})}function z$({node:e}){let t=e.result?.release??void 0;if(t===void 0)return(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=t.identity!==e.task?.repo;return(0,B.jsx)(B.Fragment,{children:[t.target,t.style===void 0?void 0:M$(t.style),t.version,n?t.identity:void 0].filter(e=>e!==void 0).join(` · `)})}function B$({artifactId:t,client:n,runId:r}){let i=ON(`${r}/${t}`,()=>n.getArtifact(r,t),0),a=i.value?.turns??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Oneharness conversation`}),i.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading conversation…`}):i.value===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`The history store holds no readable copy of that conversation.`}):i.value.unavailable===void 0?(0,B.jsx)(Gi,{className:`gap-0 py-3`,children:(0,B.jsx)(Ki,{className:`px-3`,children:a.map(e=>(0,B.jsx)(PC,{turn:e},e.id))})}):(0,B.jsxs)(yi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`Transcript unavailable`}),(0,B.jsx)(xi,{children:i.value.unavailable})]})]})}function V$({artifactId:e,client:t,heading:n,missing:r,noun:i,runId:a,unreadable:o}){let s=H$(e),c=ON(s===void 0?void 0:`${a}/${s}`,()=>t.getArtifact(a,s??``),0),l=c.value?.content;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:n}),s===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:r}):c.loading?(0,B.jsxs)(`p`,{"aria-live":`polite`,className:`detail-note`,children:[`Loading `,i,`…`]}):l===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:o}):(0,B.jsxs)(B.Fragment,{children:[c.value?.truncated===!0&&(0,B.jsxs)(`p`,{className:`detail-note`,children:[`The server keeps the end of a `,i,` this long; its beginning is not shown.`]}),(0,B.jsx)(`section`,{"aria-label":n,children:(0,B.jsx)(`pre`,{children:l})})]})]})}function H$(e){if(!(e===void 0||/[/?#]/u.test(e)))return e}var U$=6,W$=8,G$=`[aria-describedby^="timeline-detail-"]`,K$=`[data-timeline-entry]`,q$=e=>{if(!(e instanceof Element))return;let t=E(e);if(t!==void 0)return t;let n=e.closest(G$);if(n instanceof HTMLElement){let e=document.getElementById(n.getAttribute(`aria-describedby`)??``)?.textContent?.trim();return e?{element:n,detail:e}:void 0}let r=e.closest(K$),i=r?.getAttribute(`aria-label`)?.replace(/, marker$/u,``);return r instanceof HTMLElement&&i?{element:r,detail:i}:void 0},J$=(e,t)=>t!==void 0&&e?.element===t.element&&e.detail===t.detail?e:t,Y$=(0,z.createContext)(()=>void 0);function X$(){let e=(0,z.useContext)(Y$),t=(0,z.useRef)(!1);return(0,z.useEffect)(()=>()=>{t.current&&e(null)},[e]),(0,z.useCallback)(n=>{t.current=n!==null,e(n?.element??null)},[e])}function Z$({children:e}){let t=(0,z.useContext)(Y$);return(0,B.jsx)(`div`,{onPointerLeave:()=>t(null),onPointerOver:e=>{let n=e.target;t(n instanceof Element?q$(n)?.element??null:null)},children:e})}function Q$({children:e}){let t=(0,z.useRef)(null),[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),o=n??i,s=(0,z.useCallback)(()=>{r(void 0),a(void 0)},[]),c=(0,z.useCallback)(e=>r(t=>J$(t,e===null?void 0:q$(e))),[]);(0,z.useEffect)(()=>{let e=e=>a(t=>J$(t,q$(e.target))),t=e=>a(t=>J$(t,q$(e.relatedTarget))),n=()=>r(void 0);return document.addEventListener(`pointerleave`,n),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t),()=>{document.removeEventListener(`pointerleave`,n),document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t)}},[]);let l=(0,z.useCallback)(()=>{let e=t.current;if(e===null||o===void 0)return;if(!o.element.isConnected)return s();let n=o.element.getBoundingClientRect(),r=e.getBoundingClientRect(),i=window.innerWidth-r.width-W$,a=Math.min(Math.max(n.left,W$),Math.max(W$,i)),c=n.bottom+U$,l=n.top-r.height-U$,u=Math.max(W$,window.innerHeight-r.height-W$),d=c+r.height<=window.innerHeight-W$?c:l,f=Math.min(Math.max(d,W$),u);e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(f)}px`,e.style.visibility=`visible`},[o,s]);return(0,z.useLayoutEffect)(l,[l]),(0,z.useEffect)(()=>{if(o!==void 0)return window.addEventListener(`scroll`,l,!0),window.addEventListener(`resize`,l),()=>{window.removeEventListener(`scroll`,l,!0),window.removeEventListener(`resize`,l)}},[o,l]),(0,B.jsxs)(Y$.Provider,{value:c,children:[e,o!==void 0&&(0,Kn.createPortal)((0,B.jsx)(`div`,{"aria-hidden":`true`,className:`timeline-popover`,"data-testid":`timeline-popover`,ref:t,style:{visibility:`hidden`},children:o.detail},o.detail),document.body)]})}function $$(e,t,n,r){let[i,a]=(0,z.useState)(),o=t===void 0||n===void 0?void 0:JSON.stringify([t,n]);(0,z.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,z.useMemo)(()=>({conversation:s?.conversation,error:s?.error,loading:o!==void 0&&s===void 0}),[s,o])}function e1(e){let t=(0,z.useRef)(void 0);return(0,z.useCallback)(n=>{t.current?.disconnect(),t.current=void 0;let r=n?.parentElement;if(n===null||r==null)return;let i=()=>r.style.setProperty(e,`${n.getBoundingClientRect().height}px`);i(),t.current=new ResizeObserver(i),t.current.observe(n)},[e])}var t1=32;function n1(e){return e===null?null:e.closest(`[data-slot="scroll-area-viewport"]`)??e.parentElement}function r1(e,t){let n=(0,z.useRef)(null),r=(0,z.useRef)(!0),i=(0,z.useRef)({key:e,count:t}),a=(0,z.useCallback)(()=>{let e=n.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<=t1)},[]),o=(0,z.useCallback)(e=>{n.current?.removeEventListener(`scroll`,a),n.current=n1(e),n.current?.addEventListener(`scroll`,a,{passive:!0}),a()},[a]);return(0,z.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 i1=25;function a1({client:e,runId:t,node:r,row:i}){let a=i===void 0?void 0:A1(i),o=a?.kind===`conversation`?a.value:void 0,s=$$(e,t,o,i===void 0?void 0:w1(i));return(0,B.jsx)(`section`,{"aria-label":`Timeline item detail`,className:`timeline-detail`,children:(0,B.jsx)(gd,{className:`h-full`,children:(0,B.jsx)(`div`,{className:`p-[22px] max-sm:p-3`,ref:r1(o,T1(i,s)),children:i===void 0?(0,B.jsxs)(`div`,{className:`detail-placeholder`,children:[(0,B.jsx)(ot,{size:30}),(0,B.jsx)(`p`,{children:`Select an item in the timeline to read what it recorded.`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{row:i}),(0,B.jsx)(kd,{className:`my-4`}),(0,B.jsx)(o1,{client:e,runId:t,node:r,reference:a,row:i,transcript:s}),i.rowKind===`event`&&!k1(a)&&(0,B.jsx)(F1,{client:e,event:i.event,...i.event.kind===`edit-rejected`?{shown:y1}:{}})]})})})})}function o1({client:e,runId:t,row:n,node:r,reference:i,transcript:a}){if(k1(i))return(0,B.jsx)(d1,{row:n,transcript:a});if(n.rowKind===`event`&&n.event.kind===`edit-rejected`)return(0,B.jsx)(v1,{client:e,event:n.event,reference:i,runId:t});let o=E1(n);if(o!==void 0)return(0,B.jsx)(g1,{redirection:o,row:n});let s=D1(n);if(s!==void 0)return(0,B.jsx)(R$,{release:s});let c=O1(n);return c===void 0?M1(n)?(0,B.jsx)(f1,{client:e,runId:t,reference:i,row:n}):i?.kind===`worker_report`&&H$(i.value)!==void 0?(0,B.jsx)(p1,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):i?.kind===`oneharness_session`&&H$(i.value)!==void 0?(0,B.jsx)(m1,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):N1(n,i)&&r!==void 0?(0,B.jsx)(h1,{node:r,reference:i}):(0,B.jsx)(S1,{reference:i,row:n}):(0,B.jsx)(x1,{row:n,surface:c})}function s1({turn:e}){return e.judges===void 0||e.judges.length===0?null:(0,B.jsx)(`ul`,{"aria-label":`Judges on turn ${e.id}`,className:`judge-decisions`,children:e.judges.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`judge-decision-who`,children:[e.judge,` (`,e.kind,`)`]}),` `,e.decision,` — `,e.reason]},e.judge))})}function c1(e){return e.tool?.turn??e.id}function l1(e,t){if(e.rowKind!==`event`||e.event.tool===void 0)return;let n=c1(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 u1({turn:t}){let n=[t.unknown.instruction_truncated===!0?`its prompt`:void 0,t.unknown.truncated===!0?`its reply`:void 0,t.tools.some(e=>e.output_truncated===!0)?`a tool's output`:void 0,t.tools.some(e=>e.input_truncated===!0)?`a tool's input`:void 0].filter(e=>e!==void 0);return n.length===0?null:(0,B.jsxs)(yi,{className:`mb-3`,role:`note`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`Cut by the recorder`}),(0,B.jsxs)(xi,{children:[`The run's recorder cut `,n.join(`, `),` to its bound, and no whole copy exists: neither the member's report nor a history file this run names holds it.`]})]})}function d1({row:t,transcript:n}){let[r,i]=(0,z.useState)(i1),a=n.conversation?.conversation.turns??[],o=t.rowKind===`event`?c1(t.event):void 0,s=o===void 0?a:a.filter(({id:e})=>e===o),c=Ip(s.map(e=>({id:e.id,time:Date.parse(e.timestamp)}))),l=e1(`--conversation-pinned`);if(n.loading)return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-inline`,children:[(0,B.jsx)(Ad,{className:`h-2 w-40`}),(0,B.jsx)(Ad,{className:`h-2 w-24`}),`Loading transcript…`]});if(n.conversation===void 0)return(0,B.jsxs)(yi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`Transcript unavailable`}),(0,B.jsxs)(xi,{children:[(0,B.jsx)(`p`,{children:n.error?.message??`The server recorded no transcript.`}),t.rowKind===`event`&&Object.keys(t.event.fields??{}).length>0&&(0,B.jsx)(L1,{value:t.event.fields??{}})]})]});let{conversation:u,attribution:d}=n.conversation,f=P1(d.agentRole,d.transportRole),p=l1(t,s);return(0,B.jsx)(Gi,{className:`gap-0 py-3`,children:(0,B.jsxs)(Ki,{className:`px-3`,children:[(0,B.jsxs)(`header`,{className:`transcript-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`eyebrow`,children:[t.dispatch===void 0?``:`${t.dispatch.label} · `,f,d.persona?` · ${d.persona}`:``]}),(0,B.jsx)(`h4`,{children:u.name})]}),(0,B.jsx)(Tp,{state:u.state})]}),(0,B.jsx)(kd,{className:`my-2.5`}),(0,B.jsx)(`div`,{className:`conversation-timeline-sticky`,ref:l,children:(0,B.jsx)(Z$,{children:(0,B.jsx)(Fp,{cursor:c.cursor,...p===void 0?{}:{focus:p},onSelectTurn:c.scrollTo,turns:[...s]})})}),s.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This turn is no longer part of the recorded transcript.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`conversation-turns`,ref:c.containerRef,children:s.slice(0,r).map(e=>(0,B.jsxs)(`div`,{ref:t=>c.register(e.id,t),children:[(0,B.jsx)(u1,{turn:e}),(0,B.jsx)(PC,{author:{label:f},...p?.turnId===e.id?{focus:p}:{},turn:e}),(0,B.jsx)(s1,{turn:e})]},e.id))}),s.length>r&&(0,B.jsxs)(Wi,{onClick:()=>i(r+i1),size:`sm`,type:`button`,variant:`outline`,children:[`Show more of `,s.length,` turns`]})]})]})})}function f1({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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Verification record`}),(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Result`}),(0,B.jsx)(`dd`,{children:i?.ok===void 0?e.status??`in progress`:i.ok?`passed`:`failed`})]})}),i?.output_tail&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Output`}),(0,B.jsx)(`pre`,{children:i.output_tail})]}),(0,B.jsx)(V$,{artifactId:a,client:t,heading:`Full log`,missing:`No readable log was recorded.`,noun:`log`,runId:n,unreadable:`No readable log was recorded.`}),(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Verification `,e.status??`in progress`,`.`]})]})}function p1({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(V$,{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,B.jsx)(S1,{reference:n,row:r})]})}function m1({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(B$,{artifactId:e,client:t,runId:i}),(0,B.jsx)(S1,{reference:n,row:r})]})}function h1({node:e,reference:t}){let n=e.detail?.verification.checks??[],r=e.detail?.publication;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Publication`}),r?.pr_url&&(0,B.jsx)(C1,{fallback:``,reference:{kind:`pr`,value:r.pr_url}}),r?.merged&&r.commit_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.commit_url,rel:`noreferrer`,target:`_blank`,children:[`Merged commit `,r.commit?.slice(0,8),` `,(0,B.jsx)(rt,{size:13})]})}):r?.branch_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.branch_url,rel:`noreferrer`,target:`_blank`,children:[`Branch `,r.branch,` `,(0,B.jsx)(rt,{size:13})]})}):!r?.pr_url&&(0,B.jsx)(C1,{fallback:`No publication was recorded.`,reference:t}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Observed checks`}),n.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`No checks were observed on this node.`}):(0,B.jsx)(`dl`,{className:`facts`,children:n.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.name}),(0,B.jsx)(`dd`,{children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.state}):e.state})]},e.name))})]})}function g1({redirection:e,row:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Delivery`}),(0,B.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,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Turn`}),(0,B.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,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Redirected at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),e.member!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Member`}),(0,B.jsx)(`dd`,{children:e.member})]}),e.input_bytes!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Note`}),(0,B.jsxs)(`dd`,{children:[e.input_bytes,` bytes offered`]})]}),(0,B.jsx)(_1,{row:t})]}),e.reason!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Why it was not delivered`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.reason})]})]})}function _1({row:e}){let t=e.rowKind===`event`?Ne(e.event):void 0;return t===void 0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Author`}),(0,B.jsx)(`dd`,{children:t})]})}function v1({client:e,event:t,reference:n,runId:r}){let i=t.fields??{},a=e=>typeof i[e]==`string`?i[e]:void 0,o=Ne(t),s=a(`summary`),c=a(`node`),l=a(`reason`),d=[[`Author`,o],[`Summary`,s],[`Node`,c]],f=a(`full_reason`)!==void 0&&n?.kind===`refusal`?H$(n.value):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Refused edit`,className:`refusal`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.at,relative:!0})})]}),d.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e)),i.command!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command as sent`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(R1,{value:i.command})})]})]}),f===void 0?l===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:`The record holds no reason.`}):(0,B.jsxs)(`figure`,{className:`refusal-figure`,children:[(0,B.jsx)(`figcaption`,{className:`detail-heading`,children:`Refusal`}),(0,B.jsx)(`pre`,{className:`refusal-text`,children:l})]}):(0,B.jsx)(b1,{artifactId:f,client:e,cut:i.full_reason_truncated===!0,runId:r})]})}var y1=new Set([`author`,`summary`,`node`,`command`,`reason`,`full_reason`,`full_reason_truncated`]);function b1({artifactId:e,client:t,cut:n,runId:r}){let i=ON(`${r}/${e}`,()=>t.getArtifact(r,e),0),a=i.value?.content;return(0,B.jsxs)(B.Fragment,{children:[n&&(0,B.jsx)(`p`,{className:`detail-note`,role:`note`,children:`The hook wrote more than the engine reads, so its output was cut at the engine's read bound.`}),i.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading the complete refusal…`}):a===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`This run holds no readable copy of the complete refusal.`}):(0,B.jsxs)(`figure`,{className:`refusal-figure`,children:[(0,B.jsx)(`figcaption`,{className:`detail-heading`,children:`Complete refusal`}),(0,B.jsx)(`pre`,{className:`refusal-text`,children:a})]})]})}function x1({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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),n.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))]}),e.message!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Message`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.message})]})]})}function S1({row:e,reference:t}){if(e.rowKind===`event`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]})}),t!==void 0&&(0,B.jsx)(C1,{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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]}),e.rowKind===`span`&&(e.endedAt!==null||e.status===`running`)&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Ended`}),(0,B.jsx)(`dd`,{children:e.endedAt===null?`Still running`:(0,B.jsx)(u,{at:e.endedAt,relative:!0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:e.status??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Duration`}),(0,B.jsx)(`dd`,{children:e.durationMs===null?`Not recorded`:be(e.durationMs)})]}),r!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Aggregated`}),(0,B.jsx)(`dd`,{children:r})]}),i.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Waiting on`}),(0,B.jsx)(`dd`,{children:i.map(_).join(` and `)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Step`}),(0,B.jsx)(`dd`,{children:j1(n)??`None`})]}),(0,B.jsx)(_1,{row:e})]}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reference`}),(0,B.jsx)(C1,{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 C1({reference:e,fallback:t}){return e===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:t}):e.value.startsWith(`http`)?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:e.value,rel:`noreferrer`,target:`_blank`,children:[e.kind===`pr`?f$(e.value):e.value,` `,(0,B.jsx)(rt,{size:13})]})}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[(0,B.jsx)(`span`,{className:`detail-reference-kind`,children:e.kind}),(0,B.jsx)(`code`,{children:e.value})]})}function w1(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 T1(e,t){return t.conversation===void 0?0:e?.rowKind===`event`?1:t.conversation.conversation.turns.length}function E1(e){return e.rowKind===`event`?e.event.redirection:void 0}function D1(e){return e.rowKind===`event`?e.event.release:void 0}function O1(e){return e.rowKind===`event`?e.event.surface:void 0}function k1(e){return e?.kind===`conversation`}function A1(e){if(e.rowKind===`span`)return e.span.reference;if(e.rowKind===`event`)return e.event.reference}function j1(e){if(e?.rowKind===`span`)return e.span.step_id;if(e?.rowKind===`event`)return e.event.step_id}function M1(e){return e.kind===`verification`||e.kind.startsWith(`verification-`)}function N1(e,t){return t?.kind===`pr`||e.kind===`publication`||e.kind.startsWith(`pr-`)||e.kind.startsWith(`publication-`)}function P1(e,t){return r(e,t)}function F1({client:e,event:t,shown:n}){let r=n===void 0?t.fields??{}:Object.fromEntries(Object.entries(t.fields??{}).filter(([e])=>!n.has(e)));if(n!==void 0&&Object.keys(r).length===0)return null;let i=t.kind===`command-started`?ue(r.command):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Recorded fields`,className:`record-content`,children:[t.surface_state!==void 0&&(0,B.jsx)(V1,{state:t.surface_state}),t.kind===`human-attested`&&(0,B.jsx)(H1,{client:e,item:r.item}),(t.kind===`node-held`||t.kind===`node-unheld`)&&(0,B.jsx)(U1,{event:t}),(t.kind===`edit-committed`||t.kind===`command-accepted`)&&(0,B.jsx)(W1,{operations:r.operations}),i!==void 0&&(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(i)})})]})}),Object.keys(r).length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This record holds no fields.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Recorded fields`}),(0,B.jsx)(L1,{value:i===void 0?r:Object.fromEntries(Object.entries(r).filter(([e])=>e!==`command`))})]})]})}function I1(e){let t=e.replaceAll(/[_-]+/gu,` `).trim();return t.length===0?e:`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function L1({value:e}){return(0,B.jsx)(`dl`,{className:`facts record-fields`,children:Object.entries(e).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:I1(e)}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(R1,{value:t})})]},e))})}function R1({value:e}){if(e==null)return(0,B.jsx)(`span`,{className:`record-none`,children:`None`});if(typeof e==`string`)return(0,B.jsx)(`span`,{className:`record-text`,children:e});if(typeof e==`number`||typeof e==`boolean`)return(0,B.jsx)(B.Fragment,{children:String(e)});if(Array.isArray(e))return e.length===0?(0,B.jsx)(`span`,{className:`record-none`,children:`None`}):(0,B.jsx)(`ol`,{className:`record-list`,children:e.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(R1,{value:e})},t))});let t=z1(e);return t===void 0?(0,B.jsx)(B.Fragment,{children:String(e)}):(0,B.jsx)(L1,{value:t})}function z1(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function B1(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()!==``?n:void 0}function V1({state:e}){let{status:t}=d(e),n=e.reply,r=[[`Queued`,e.queued_at],[`Read`,e.read_at],[`Answered`,e.replied_at]];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h3`,{className:`detail-heading`,children:[`Surface `,e.id]}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:t})]}),r.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t===void 0?`Not yet`:(0,B.jsx)(u,{at:t})})]},e)),e.correlation!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Correlation`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:e.correlation})})]})]}),n!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reply`}),(0,B.jsx)(L1,{value:n})]})]})}function H1({client:e,item:t}){let n=z1(t),r=B1(n,`id`),i=z1(n?.resolution),a=B1(i,`choice`),o=ON(a===void 0?void 0:r,()=>e.getHumanItem(r??``),0);if(n===void 0)return(0,B.jsx)(`p`,{className:`detail-note`,children:`Attested with no human item resolved: the planner attested it itself.`});let s=o.value?.item.choices?.find(e=>e.id===a)?.title,c=[[`Item`,r],[`Action`,B1(n,`action`)],[`By`,B1(i,`actor`)],[`On behalf of`,B1(i,`on_behalf_of`)],[`Provenance`,B1(i,`provenance`)??`manager`],[`Choice`,a===void 0?void 0:s===void 0?a:`${s} (${a})`],[`Reason`,B1(i,`reason`)]],l=B1(i,`text`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Human item`}),(0,B.jsx)(`dl`,{className:`facts`,children:c.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),l!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Words`}),(0,B.jsx)(`p`,{className:`detail-note record-text`,children:l})]})]})}function U1({event:e}){let t=fe(e);return t.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:e.kind===`node-held`?`Held because`:`Released from`}),(0,B.jsx)(`ul`,{className:`hold-reasons`,children:t.map((e,t)=>(0,B.jsx)(`li`,{children:_(e)},t))})]})}function W1({operations:e}){return!Array.isArray(e)||e.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Operations`}),(0,B.jsx)(`ol`,{className:`record-operations`,children:e.map((e,t)=>{let n=z1(e);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:B1(n,`kind`)??`Operation ${t+1}`}),n===void 0?(0,B.jsx)(R1,{value:e}):(0,B.jsx)(L1,{value:n})]},t)})})]})}var G1=`span:`,K1=500,q1=ae,J1=e=>500*2**(e-1),Y1=e=>e.record_id??e.id,X1=nM.omit({events:!0});function Z1(e,t){if(t===void 0)return e;let n=new Set(e.events.map(Y1)),r=t.filter(e=>!n.has(Y1(e)));if(r.length===0)return e;let i=[...e.events,...r].map(e=>[Date.parse(e.at),e.journal_order??0,e]);return i.sort((e,t)=>e[0]-t[0]||e[1]-t[1]),{...e,events:i.map(([,,e])=>e)}}function Q1(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 $1({client:e,runId:t,scope:n,nodeId:r,timeline:i}){let a=(0,z.useRef)(new Map),o=(0,z.useRef)(new Map),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),[u,d]=(0,z.useState)(()=>new Map),f=(0,z.useCallback)(()=>l(e=>e+1),[]),p=(0,z.useCallback)(e=>{for(let t of e.rows)a.current.set(Y1(t),t)},[]),m=(0,z.useCallback)(e=>{d(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),h=(0,z.useCallback)((e,t,n)=>{s.current.delete(e),d(r=>new Map(r).set(e,{message:t instanceof Error?t.message:String(t),retry:n})),f()},[f]),g=(0,z.useMemo)(()=>{if(i===void 0)return i;if(n===`node`)for(let e of i.spans)for(let t of e.events)a.current.has(Y1(t))||a.current.set(Y1(t),{...t,span_id:e.id});let e=new Map;for(let t of a.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&&o.current.size===0?i:{...i,spans:i.spans.map(t=>{let n=Z1(t,e.get(t.id)),r=o.current.get(t.id);return r===void 0?n:{...r,...n,events:n.events}})}},[i,c,n]),_=e0({client:e,runId:t,nodeId:n===`node`?r:void 0,opened:i!==void 0,take:p,bump:f}),v=_?.state===`loading`,y=(0,z.useMemo)(()=>n!==`node`||!v?[]:Q1(g?.spans??[]),[g,n,v]),b=_?.failure??[...u].find(([e])=>!e.startsWith(G1))?.[1],x=(0,z.useCallback)(e=>u.get(`${G1}${e}`),[u]),S=(0,z.useCallback)(e=>m(`${G1}${e}`),[m]),C=(0,z.useCallback)(async(r,i,a)=>{m(r);try{let r;for(;;){let a=await e.getTimelineEvents(t,{scope:n,limit:K1,...i,...r===void 0?{}:{cursor:r}});p(a);let{span:s}=a;if(i.span!==void 0&&s!==void 0&&o.current.set(i.span,X1.parse(s)),f(),a.next_cursor===null)return;r=a.next_cursor}}catch(e){h(r,e,a)}},[f,m,e,h,t,n,p]),w=(0,z.useCallback)(e=>{let t=`${G1}${e}`;s.current.has(t)||(s.current.add(t),C(t,{span:e,...r===void 0?{}:{node:r}},()=>w(e)))},[r,C]),T=(0,z.useCallback)(e=>{let t=`row:${e??``}`;s.current.has(t)||(s.current.add(t),C(t,e===void 0?{}:{node:e},()=>T(e)))},[C]),E=(0,z.useCallback)((e,t,n)=>{let r=`stretch:${n??``}:${e}:${t}`;s.current.has(r)||(s.current.add(r),C(r,{...n===void 0?{}:{node:n},from:new Date(e).toISOString(),to:new Date(t).toISOString()},()=>E(e,t,n)))},[C]);return{...g===void 0?{}:{timeline:g},unheld:y,loadSpan:w,loadRow:T,loadStretch:E,spanFailure:x,forgetSpan:S,...b===void 0?{}:{failure:b},..._===void 0?{}:{nodeLoad:t0(_)}}}function e0({client:e,runId:t,nodeId:n,opened:r,take:i,bump:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(0);if((0,z.useEffect)(()=>{if(n===void 0||!r)return;let o=new AbortController,c=new Set,u,d=()=>u!==void 0&&c.size>=u,f=!1,p,m=(e,t)=>s({node:n,state:e,loaded:c.size,...u===void 0?{}:{total:u},partial:e===`loading`&&f,...t===void 0?{}:{failure:t}}),h=setTimeout(()=>{f=!0,s(e=>e?.node===n&&e.state===`loading`?{...e,partial:!0}:e)},q1),g=async r=>{try{for await(let r of e.streamNodeTimeline(t,n,o.signal)){if(r.kind===`start`)u=r.total;else{i(r);for(let e of r.rows)c.add(Y1(e));a()}d()&&clearTimeout(h),m(d()?`held`:`loading`)}clearTimeout(h),m(`held`),a()}catch(e){if(o.signal.aborted||d())return;if(r<3){p=setTimeout(()=>void g(r+1),J1(r));return}clearTimeout(h),m(`failed`,{message:e instanceof Error?e.message:String(e),retry:()=>l(e=>e+1)})}};return m(`loading`),g(1),()=>{o.abort(),clearTimeout(h),p!==void 0&&clearTimeout(p)}},[e,t,n,r,i,a,c]),!(n===void 0||o?.node!==n))return o}function t0(e){return{state:e.state,loaded:e.loaded,...e.total===void 0?{}:{total:e.total},partial:e.partial}}var n0=`This node is not on the run's graph, so the plan holds no task for it.`;function r0({client:n,runId:r,node:i,nodes:a,timeline:o,timelineError:s,hiddenTypes:c=[],onHiddenTypesChange:l=()=>{},runLoaded:u=!0,onRetry:d,selectedItemId:f,onSelectItem:p,onBack:m,selectedTab:h,onSelectTab:g}){let _=(0,z.useMemo)(()=>t(o,i.id),[o,i.id]);(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(f===void 0?m():p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,p,f]);let v=i.detail?.publication===void 0?i.result?.pr??void 0:i.detail.publication.pr_url;return(0,B.jsx)(`section`,{"aria-label":`Timeline for ${i.label}`,className:`node-view`,children:(0,B.jsxs)(Af,{className:`node-tabs`,onValueChange:e=>{yQ(e)&&g(e)},value:h,children:[(0,B.jsxs)(`section`,{"aria-label":`Node header`,className:`node-view-head`,children:[(0,B.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,B.jsxs)(`ol`,{className:`breadcrumb`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(Wi,{onClick:m,size:`sm`,type:`button`,variant:`ghost`,children:[(0,B.jsx)(Ve,{size:14}),` Graph`]})}),(0,B.jsx)(`li`,{"aria-current":`page`,children:(0,B.jsx)(`span`,{className:`breadcrumb-node`,children:i.label})})]})}),(0,B.jsxs)(`div`,{className:`node-view-facts`,children:[(0,B.jsx)(QZ,{className:`node-view-state`,state:i.status}),(0,B.jsx)(C$,{control:i.control}),(0,B.jsxs)(`span`,{className:`node-view-meta`,children:[pe(i),` node ·`,` `,u?`${i.telemetry?.turns??0} turns · ${i.telemetry?.lint??0} lint turns`:`turns ${oe}`]}),v!==void 0&&(0,B.jsxs)(`a`,{className:`node-view-pr`,href:v,rel:`noreferrer`,target:`_blank`,children:[f$(v),` `,(0,B.jsx)(rt,{size:12})]})]}),(0,B.jsx)(Mf,{"aria-label":`Node details`,variant:`line`,children:Object.entries(vQ).map(([e,t])=>(0,B.jsx)(Nf,{value:e,children:t},e))})]}),(0,B.jsx)(h0,{node:i,nodes:a}),(0,B.jsx)(p0,{node:i}),(0,B.jsx)(m0,{node:i}),(0,B.jsxs)(Pf,{className:`node-tab-panel`,value:`task`,children:[i.task===void 0?(0,B.jsx)(`p`,{children:n0}):u?(0,B.jsx)(VY,{source:u0(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Settled as`}),(0,B.jsx)(`dd`,{children:g0(i.result?.outcome)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:g0(i.result?.detail)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Graph overrides`}),(0,B.jsx)(`dd`,{children:u?(i.task?.sets??[]).length===0?`None`:(0,B.jsx)(`ol`,{"aria-label":`Graph overrides`,className:`sets-served`,children:i.task?.sets?.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`code`,{children:e})},t))}):oe})]})]})]}),(0,B.jsx)(Pf,{className:`node-tab-panel`,value:`criteria`,children:i.task===void 0?(0,B.jsx)(`p`,{children:n0}):u?(0,B.jsx)(VY,{source:d0(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe})}),(0,B.jsx)(Pf,{className:`node-tab-panel`,value:`dependencies`,children:(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Dependencies`}),(0,B.jsx)(`dd`,{children:(i.task?.deps??[]).map(e=>{let t=a.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `)||`None`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unblocks`}),(0,B.jsx)(`dd`,{children:i.dependents.join(`, `)||`None`})]})]})}),(0,B.jsxs)(Pf,{className:`node-tab-panel`,value:`remote`,children:[!u&&(0,B.jsx)(`p`,{className:`loading-value`,children:`Loading…`}),(0,B.jsxs)(`dl`,{className:`facts`,hidden:!u,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Publication`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(f0,{node:i})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Branch`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?.branch??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Merge`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?i.detail.publication.merged?`Merged`:`Not merged`:`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Release`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(z$,{node:i})})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Verification coverage`}),(0,B.jsxs)(`dd`,{children:[`Hook:`,` `,i.detail?.verification.pre_push_hook?`present`:`not recorded`,` · `,`Required checks:`,` `,i.detail?.verification.required_checks?.join(`, `)||`none configured`]})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Observed checks`}),(0,B.jsx)(`dd`,{children:(i.detail?.verification.checks??[]).length===0?`No checks observed`:(0,B.jsxs)(`table`,{"aria-label":`Remote checks`,className:`remote-checks`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Runtime`}),(0,B.jsx)(`th`,{children:`Required`})]})}),(0,B.jsx)(`tbody`,{children:i.detail?.verification.checks?.map(e=>(0,B.jsxs)(`tr`,{className:e.status===`completed`&&![`success`,`neutral`,`skipped`].includes(e.conclusion??``)?`check-failing`:void 0,children:[(0,B.jsx)(`th`,{scope:`row`,children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.name}):e.name}),(0,B.jsx)(`td`,{children:(0,B.jsx)(S$,{check:e})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(v$,{...e.started_at===void 0?{}:{startedAt:e.started_at},...e.completed_at===void 0?{}:{completedAt:e.completed_at}})}),(0,B.jsxs)(`td`,{title:e.requirement,className:e.required?`check-required`:`check-optional`,children:[(0,B.jsx)(`svg`,{role:`img`,"aria-label":e.required?`required`:`not required`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:e.required?(0,B.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,B.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,B.jsx)(Pf,{className:`node-timeline-panel`,value:`timeline`,children:s===void 0?o===void 0?(0,B.jsx)(`div`,{"aria-live":`polite`,className:`loading-state`,children:`Loading the recorded timeline…`}):_.rows.length===0?(0,B.jsxs)(Gi,{className:`m-5 items-center gap-2 p-8 text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`m-0`,children:`This node has no recorded timeline yet.`}),(0,B.jsx)(`p`,{className:`m-0 text-[11px]`,children:`Spans and events appear here as the run records them.`})]}):(0,B.jsx)(i0,{client:n,hiddenTypes:c,node:i,onHiddenTypesChange:l,onSelectItem:p,runId:r,selectedItemId:f,timeline:o}):(0,B.jsxs)(yi,{className:`m-5 w-auto`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`Timeline unavailable`}),(0,B.jsxs)(xi,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Wi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})})]})})}function i0({client:e,hiddenTypes:t,node:n,onHiddenTypesChange:r,onSelectItem:i,runId:s,selectedItemId:c,timeline:l}){let u=$1({client:e,runId:s,scope:`node`,nodeId:n.id,timeline:l}),d=u.timeline??l,f=(0,z.useMemo)(()=>de(d,n.id),[d,n.id]),p=(0,z.useMemo)(()=>new Set(t),[t]),_=(0,z.useMemo)(()=>o(f.tree,p),[f.tree,p]),v=(0,z.useMemo)(()=>ze(f.tree),[f.tree]),[y,x]=(0,z.useState)(()=>new Set),S=(0,z.useMemo)(()=>c===void 0?[]:h(_,c).filter(e=>e.rowKind===`group`).map(({id:e})=>e),[_,c]),C=(0,z.useMemo)(()=>S.length===0?y:new Set([...y,...S]),[y,S]),w=(0,z.useMemo)(()=>m(_,C),[_,C]),T=(0,z.useMemo)(()=>g(w).map(e=>({id:e.id,time:Date.parse(e.startedAt)})),[w]);o0(f,w);let E=u.nodeLoad?.state===`loading`,D=(0,z.useRef)(T);E||(D.current=T);let O=Ip(E?D.current:T),[k,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(),N=(0,z.useMemo)(()=>F(f.items,f.lanes),[f.items,f.lanes]),P=(0,z.useMemo)(()=>Fe(f.markers,f.items,c),[f.items,f.markers,c]),I=(0,z.useMemo)(()=>a0([...f.items,...f.markers.map(({at:e})=>({start:e}))]),[f.items,f.markers]),ee=(0,z.useMemo)(()=>a0([...k?f.items:N,...P.map(({at:e})=>({start:e}))]),[k,f.items,N,P]),L=O.cursor===void 0?void 0:Math.min(Math.max(O.cursor,I[0]),I[1]),te=c===void 0?void 0:a(_,c)??a(f.rows,c),ne=(0,z.useRef)(0),re=e=>{ne.current=Date.now()+500,i(e),O.scrollTo(e)},ie=(0,z.useRef)(re);ie.current=re;let ae=(0,z.useCallback)(e=>ie.current(e),[]),oe=(0,z.useRef)(null),{containerRef:se}=O,ce=(0,z.useCallback)(e=>{oe.current=e,se(e)},[se]),le=(0,z.useRef)(null),ue=X$(),{loadSpan:fe,forgetSpan:pe}=u,me=te?.rowKind===`span`?te.span.id:void 0;(0,z.useEffect)(()=>{if(me!==void 0)return fe(me),()=>pe(me)},[me,fe,pe]);let he=me===void 0?void 0:u.spanFailure(me),{scrollTo:ge}=O;return(0,z.useEffect)(()=>{c!==void 0&&(ne.current=Date.now()+500,ge(c))},[c,ge]),(0,B.jsxs)(`div`,{className:`node-execution`,"data-expanded":k,children:[(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node timeline`,className:`node-timeline-sticky`,"data-testid":`node-timeline`,ref:le,children:[(0,B.jsx)(j$,{container:le,partial:u.nodeLoad?.partial===!0,range:j??ee,stretches:u.unheld}),u.nodeLoad?.partial===!0&&(0,B.jsx)(k$,{load:u.nodeLoad}),(0,B.jsx)(an,{...m$,axis:{origin:I[0]},cursor:L,expanded:k,getFailureExcerpt:e=>e.payload.rowKind===`span`?e.payload.span.detail?.output_tail:void 0,items:k?f.items:N,lanes:f.lanes,markers:P,onExpandedChange:A,onHover:ue,onRangeChange:e=>M(e[0]<=ee[0]&&e[1]>=ee[1]?void 0:g$(e)),onSelect:e=>re(e.id),range:j??ee,selectedId:c})]}),(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node transcript`,className:`node-transcript`,ref:ce,children:[u.failure!==void 0&&(0,B.jsx)(D$,{failure:u.failure,what:`This node's timeline`}),(0,B.jsx)(w$,{counts:v,hidden:p,onHiddenChange:r}),_.length===0&&f.tree.length>0&&(0,B.jsx)(T$,{onClear:()=>r([])}),b(w).map(e=>{let t=(0,B.jsx)(s0,{entries:e.entries,onOpen:ae,onToggle:e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),register:O.register,selectedItemId:c},e.id);return e.dispatch===void 0?(0,B.jsx)(z.Fragment,{children:t},e.id):(0,B.jsxs)(`section`,{"aria-label":e.dispatch.label,className:`transcript-dispatch`,children:[(0,B.jsx)(`h3`,{children:e.dispatch.label}),t]},e.id)})]}),te!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Wi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>i(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(a1,{client:e,node:n,row:te,runId:s}),he!==void 0&&(0,B.jsx)(D$,{failure:he})]})]})}function a0(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]}function o0(e,t){(0,z.useLayoutEffect)(()=>{let n=window.__nodeLoadProbe;if(n===void 0)return;let r=[],i=e=>{r.push(e.id);for(let t of e.children)i(t)};for(let e of t)if(e.entryKind===`row`)r.push(e.row.id);else for(let t of e.group.children)i(t);n({chart:[...e.items.map(e=>e.id),...e.markers.map(e=>e.id)],list:r})},[e,t])}function s0({entries:e,onOpen:t,onToggle:n,register:r,selectedItemId:i}){return e.map(e=>e.entryKind===`row`?(0,B.jsx)(l0,{onOpen:t,register:r,row:e.row,selected:e.row.id===i||i!==void 0&&e.row.aliases?.includes(i)===!0},e.row.id):(0,B.jsx)(E$,{entry:e,onToggle:()=>n(e.group.id),children:(0,B.jsx)(s0,{entries:e.entries,onOpen:t,onToggle:n,register:r,...i===void 0?{}:{selectedItemId:i}})},e.group.id))}function c0(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.statusAt===r.statusAt&&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 l0=(0,z.memo)(function({row:e,selected:t,register:n,onOpen:r}){let{id:i}=e,a=(0,z.useCallback)(e=>n(i,e),[n,i]);return(0,B.jsx)(`article`,{"aria-current":t?`true`:void 0,"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,B.jsxs)(`button`,{"aria-label":`Open ${e.displayLabel}`,onClick:()=>r(e.id),type:`button`,children:[(0,B.jsxs)(`span`,{className:`eyebrow`,children:[e.rowKind===`event`&&(0,B.jsx)(O,{category:e.category}),e.displayKind]}),(0,B.jsx)(`strong`,{className:`transcript-label`,title:e.displayLabel,children:e.displayLabel}),(0,B.jsxs)(`span`,{className:`transcript-facts`,children:[(0,B.jsx)(u,{at:e.startedAt}),e.durationMs!==null&&` · ${be(e.durationMs)}`,` · ${e.status??`recorded`}`,e.statusAt!==void 0&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(u,{at:e.statusAt})]}),e.sessionName!==void 0&&` · ${e.sessionName}`]})]})})},c0);function u0(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(`
106
106
 
107
- `)}function J1(e){let t=q1(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 Y1({node:e}){let t=e.detail?.publication;if(t===void 0)return typeof e.result?.pr==`string`&&e.result.pr?(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e.result.pr,rel:`noreferrer`,target:`_blank`,children:[c$(e.result.pr),` `,(0,B.jsx)(rt,{size:12})]}):(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=(t.merged?[[t.pr_url,c$(t.pr_url)],[t.commit_url,`Commit ${t.commit?.slice(0,8)??``}`]]:[[t.pr_url,c$(t.pr_url)],[t.branch_url,t.branch??`Branch`]]).filter(([e])=>e);return n.length===0?(0,B.jsx)(B.Fragment,{children:`Not recorded`}):(0,B.jsx)(B.Fragment,{children:n.map(([e,t],n)=>(0,B.jsxs)(`span`,{children:[n>0&&` · `,(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e,rel:`noreferrer`,target:`_blank`,children:[t,` `,(0,B.jsx)(rt,{size:12})]})]},e))})}function X1({node:e}){let t=_e(e);if(t.length===0)return null;let n=e.result?.detail?.trim()||void 0;return(0,B.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,B.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,B.jsx)(pt,{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,B.jsxs)(`dl`,{className:`facts facts-stacked`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.length===1?`Awaits`:`Awaits ${t.length}`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`ul`,{className:`awaited-releases`,children:t.map(e=>(0,B.jsxs)(`li`,{children:[`the `,(0,B.jsx)(`strong`,{children:e.target}),` release of`,` `,(0,B.jsx)(`code`,{children:e.producer})]},`${e.producer} ${e.target}`))})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:n})]})]})]})}function Z1({node:e}){if(e.kind!==`command`)return null;let t=e.task?.command,n=e.task?.timeout_seconds,r=e.result?.outcome,i=e.result?.log;return(0,B.jsxs)(`section`,{"aria-label":`Command`,className:`node-command m-5`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[t!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(t)})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Timeout`}),(0,B.jsxs)(`dd`,{children:[n,` seconds`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:r??e.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Log`}),(0,B.jsx)(`dd`,{children:i===void 0?`The command has not started.`:i.path})]})]}),i?.content===void 0?i!==void 0&&(0,B.jsx)(`p`,{className:`node-command-log-missing`,children:`The log is not readable from this run.`}):(0,B.jsxs)(`figure`,{className:`node-command-log-figure`,children:[(0,B.jsx)(`figcaption`,{children:`Command log`}),(0,B.jsx)(`pre`,{className:`node-command-log`,children:i.truncated===!0?`…${i.content}`:i.content})]})]})}function Q1({node:t,nodes:n}){if(!ye(t.status))return null;let r=t.status===`blocked`||t.status===`skipped`,i=xe(t),a=t.result?.error||void 0,o=t.result?.exit_code;return(0,B.jsxs)(gi,{className:k(`m-5 w-auto`,r&&`border-warning bg-warning-surface text-warning`),variant:r?`default`:`destructive`,children:[r?(0,B.jsx)(pt,{}):(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:r?`This node is ${t.status}`:`This node ${t.status===`cancelled`?`was cancelled`:t.status===`not-completed`?`did not complete`:`failed`}${t.failure?`: ${t.failure.class}`:``}`}),(0,B.jsx)(vi,{children:(0,B.jsxs)(`dl`,{className:`facts`,children:[r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.status===`skipped`?`Unmet`:`Blocked by`}),(0,B.jsx)(`dd`,{children:t.blockers.length>0?t.blockers.map(e=>{let t=n.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `):`Nothing recorded; the run has not written what holds it.`})]}),t.status===`skipped`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Attempts`}),(0,B.jsx)(`dd`,{children:`Never attempted`})]}),!r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:i??`No reason was recorded for this outcome.`})]}),a!==void 0&&a!==i&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:a})]}),typeof o==`number`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Exit code`}),(0,B.jsx)(`dd`,{children:o})]})]})})]})}function $1(e){return e==null||e===``?`Not recorded`:typeof e==`string`?e:JSON.stringify(e,null,2)}function e0({client:t,detail:n,nodes:r,timeline:i,timelineError:s,hiddenTypes:l=[],onHiddenTypesChange:u=()=>{},onRetry:d,journalSeq:f,onSelectNode:p,selectedItemId:m,onSelectItem:h,state:g,status:_}){let y=n.run.run_id,b=I1({client:t,runId:y,scope:`run`,...i===void 0?{}:{timeline:i}}),x=b.timeline,S=je(n.progress),w=(0,z.useMemo)(()=>Le(x,r),[x,r]),T=(x?.spans??[]).filter(e=>e.node_id===void 0),E=(0,z.useMemo)(()=>new Set(l),[l]),D=(0,z.useMemo)(()=>v(x),[x]),O=(0,z.useMemo)(()=>o(D,E),[D,E]),k=T.find(e=>e.id===m),A=T.flatMap(e=>e.events).find(e=>(e.record_id??e.id)===m)??T.flatMap(e=>e.events).find(e=>e.id===m),j=m===void 0?void 0:a(O,m),M=k===void 0?j??(A===void 0?void 0:C(A)):c(k),{loadSpan:N,forgetSpan:P,loadRow:F}=b;(0,z.useEffect)(()=>{m!==void 0&&M===void 0&&x!==void 0&&F(void 0)},[m,M,x,F]);let I=k?.id;(0,z.useEffect)(()=>{if(I!==void 0)return N(I),()=>P(I)},[I,N,P]);let ee=I===void 0?void 0:b.spanFailure(I);return(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m!==void 0&&h()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,m]),(0,B.jsxs)(`div`,{className:`overall-view`,"data-journal-seq":f,children:[(0,B.jsx)(pd,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`p-[34px] max-sm:p-3`,children:[(0,B.jsxs)(`section`,{"aria-label":`Whole DAG`,className:`overall-hero`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Whole DAG`}),(0,B.jsx)(`h2`,{children:y}),n.graph?.plan.goal?.text&&(0,B.jsx)(`p`,{className:`run-goal`,children:n.graph.plan.goal.text}),(0,B.jsxs)(`p`,{className:`overall-state`,children:[g!==void 0&&(0,B.jsx)(vN,{large:!0,state:g}),(0,B.jsx)(`span`,{children:n.run.last_event?`last event ${n.run.last_event}`:`no events recorded yet`})]})]}),(0,B.jsxs)(`section`,{"aria-label":`Run metrics`,className:`metric-grid`,children:[(0,B.jsx)(o0,{icon:(0,B.jsx)(at,{}),label:`Nodes`,value:le(r)}),(0,B.jsx)(o0,{icon:(0,B.jsx)(tt,{}),label:`Wall time`,value:n.run.timing.wall_seconds===null?`not measured`:Ee(n.run.timing.wall_seconds)}),(0,B.jsx)(o0,{icon:(0,B.jsx)(nt,{}),label:`Turns`,value:typeof n.run.turns==`number`?String(n.run.turns):oe}),(0,B.jsx)(a0,{detail:n,runLoaded:S,status:_})]}),(0,B.jsx)(Hi,{className:`gap-0 py-[15px]`,children:(0,B.jsxs)(Ui,{className:`px-[15px]`,children:[(0,B.jsxs)(`div`,{className:`section-heading`,children:[(0,B.jsx)(Be,{size:16}),(0,B.jsx)(`h3`,{children:`Graph timeline`})]}),s===void 0?x===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`m-0 text-[11px] text-muted-foreground`,children:`Loading the run's timeline…`}):x.spans.length===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`This run has recorded no timeline yet.`}):(0,B.jsx)(t0,{graph:w,history:b,runRecordsToLoad:T.some(e=>e.harness_scope===void 0&&(e.events_total===void 0||e.events_total>e.events.length)),onOpenNode:p,onOpenItem:h,selectedItemId:m}):(0,B.jsxs)(gi,{className:`live-issue`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`Timeline unavailable`}),(0,B.jsxs)(vi,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Vi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})]})}),x!==void 0&&x.spans.length>0&&(0,B.jsx)(r0,{counts:ze(D),hidden:E,listed:O,onHiddenChange:u,onOpen:h,recorded:D.length,...m===void 0?{}:{selectedItemId:m}})]})}),M!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Vi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>h(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(G$,{client:t,row:M,runId:y}),ee!==void 0&&(0,B.jsx)(C$,{failure:ee})]})]})}function t0({graph:e,history:t,runRecordsToLoad:n,onOpenNode:r,onOpenItem:i,selectedItemId:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(!1),[u,d]=(0,z.useState)(new Set),f=o??e.range,[p,m]=(0,z.useState)(!1),{loadRow:h,loadStretch:g}=t;(0,z.useEffect)(()=>{if(o===void 0)return;let e=setTimeout(()=>g(o[0],o[1],void 0),250);return()=>clearTimeout(e)},[o,g]);let _=e=>{e.kind===`record`&&e.nodeId===void 0||e.nodeId===void 0?i(e.id):r(e.nodeId)},v=e.line.lanes.filter(({id:t})=>e.line.items.some(e=>e.laneId===t));return(0,B.jsxs)(`div`,{className:`graph-timeline`,"data-rows-open":c,children:[(0,B.jsx)(tn,{...u$,axis:{origin:e.range[0]},expanded:!1,items:e.line.items,label:`Graph timeline`,lanes:v,markers:e.line.markers,onExpandedChange:l,onRangeChange:e=>s(f$(e)),onSelect:e=>_(e.payload),range:f,selectedId:a}),t.failure!==void 0&&(0,B.jsx)(C$,{failure:t.failure}),n&&!p&&(0,B.jsx)(`button`,{className:`load-earlier`,onClick:()=>{m(!0),h(void 0)},type:`button`,children:`Load the run's own records`}),c&&(0,B.jsx)(`ol`,{className:`graph-rows`,children:e.rows.map(t=>(0,B.jsx)(i0,{onOpen:_,onOpenNode:r,onExpandedChange:e=>{e&&h(t.nodeId),d(n=>{let r=new Set(n);return e?r.add(t.id):r.delete(t.id),r})},expanded:u.has(t.id),origin:e.range[0],range:f,onRangeChange:e=>s(f$(e)),row:t,selectedItemId:a},t.id))})]})}var n0=()=>{};function r0({counts:e,hidden:t,listed:n,onHiddenChange:r,onOpen:i,recorded:a,selectedItemId:o}){let[s,c]=(0,z.useState)(new Set),l=(0,z.useMemo)(()=>{if(o===void 0)return s;let e=h(n,o).filter(e=>e.rowKind===`group`).map(({id:e})=>e);return e.length===0?s:new Set([...s,...e])},[n,s,o]),u=(0,z.useMemo)(()=>m(n,l),[n,l]),d=(0,z.useCallback)(e=>c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]);return(0,B.jsx)(Hi,{className:`mt-4 gap-0 py-[15px]`,children:(0,B.jsx)(Ui,{className:`px-[15px]`,children:(0,B.jsxs)(`section`,{"aria-label":`Run events`,className:`run-events`,children:[(0,B.jsx)(b$,{counts:e,hidden:t,onHiddenChange:r}),a===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`No record of the run's own is held yet.`}):n.length===0?(0,B.jsx)(x$,{onClear:()=>r([])}):(0,B.jsx)(W1,{entries:u,onOpen:i,onToggle:d,register:n0,...o===void 0?{}:{selectedItemId:o}})]})})})}function i0({row:e,range:t,origin:n,expanded:r,onExpandedChange:i,onRangeChange:a,onOpen:o,onOpenNode:s,selectedItemId:c}){let l=e.nodeId;return(0,B.jsxs)(`li`,{className:`graph-row`,"data-row-kind":e.kind,children:[(0,B.jsxs)(`header`,{className:`graph-row-head`,children:[l===void 0?(0,B.jsx)(`span`,{className:`graph-row-name`,children:e.label}):(0,B.jsx)(`button`,{className:`graph-row-name`,onClick:()=>s(l),type:`button`,children:e.label}),(0,B.jsxs)(`span`,{className:`graph-row-facts`,children:[be(e.workedMs),` recorded · `,be(e.idleMs),` `,`idle`]})]}),(0,B.jsx)(tn,{...u$,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 a0({detail:e,status:t,runLoaded:n}){let r=t.value?.unread_surfaces,i=e.run.last_progress_at;return(0,B.jsxs)(Hi,{"aria-label":`Run details`,className:`metric run-details gap-2 p-4`,role:`group`,children:[(0,B.jsx)(`p`,{children:`Run details`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Launching session`}),(0,B.jsx)(`dd`,{children:n?Te(e.launch):oe})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unread surfaces`}),(0,B.jsxs)(`dd`,{children:[r===void 0?t.error===void 0?oe:`Unavailable`:r.oldest_seconds===null?String(r.count):`${r.count} · oldest ${Ee(r.oldest_seconds)}`,t.error!==void 0&&(0,B.jsxs)(`span`,{className:`run-details-error`,role:`alert`,children:[` `,`Status unavailable: `,t.error.message]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Last progress`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Last progress`,children:n?i===void 0||i<=0?`—`:(0,B.jsx)(u,{at:new Date(i*1e3).toISOString(),relative:!0}):oe})})]})]})]})}function o0({icon:e,label:t,value:n}){return(0,B.jsxs)(Hi,{"aria-label":t,className:`metric flex-row items-center gap-3 p-4`,role:`group`,children:[e,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{children:t}),(0,B.jsx)(`strong`,{children:n})]})]})}var s0=6,c0=8,l0=`[aria-describedby^="timeline-detail-"]`,u0=e=>{if(!(e instanceof Element))return;let t=E(e);if(t!==void 0)return t;let n=e.closest(l0);if(!(n instanceof HTMLElement))return;let r=document.getElementById(n.getAttribute(`aria-describedby`)??``)?.textContent?.trim();return r?{element:n,detail:r}:void 0},d0=(e,t)=>t!==void 0&&e?.element===t.element&&e.detail===t.detail?e:t;function f0(){let e=(0,z.useRef)(null),[t,n]=(0,z.useState)(),[r,i]=(0,z.useState)(),a=t??r,o=(0,z.useCallback)(()=>{n(void 0),i(void 0)},[]);(0,z.useEffect)(()=>{let e=e=>n(t=>d0(t,u0(e.target))),t=e=>i(t=>d0(t,u0(e.target))),r=e=>i(t=>d0(t,u0(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,z.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-c0,s=Math.min(Math.max(n.left,c0),Math.max(c0,i)),c=n.bottom+s0,l=n.top-r.height-s0,u=Math.max(c0,window.innerHeight-r.height-c0),d=c+r.height<=window.innerHeight-c0?c:l,f=Math.min(Math.max(d,c0),u);t.style.left=`${Math.round(s)}px`,t.style.top=`${Math.round(f)}px`,t.style.visibility=`visible`},[a,o]);return(0,z.useLayoutEffect)(s,[s]),(0,z.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,Un.createPortal)((0,B.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 p0=[{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`}],m0=`live`,h0={navigation:`dag-ui.updates.navigation`,main:`dag-ui.updates.main`};function g0(e){return p0.find(({setting:t})=>String(t)===e)?.setting}function _0(e){try{return window.localStorage.getItem(e)}catch{return null}}function v0(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function y0(e,t){let[n,r]=(0,z.useState)(()=>g0(_0(e))??t);return[n,(0,z.useCallback)(t=>{r(t),v0(e,t)},[e])]}function b0(){let[e,t]=y0(h0.navigation,30),[n,r]=y0(h0.main,m0);return{navigation:e,setNavigation:t,main:n,setMain:r}}function x0({name:e,caption:t,setting:n,waiting:r,onChange:i}){return(0,B.jsxs)(`div`,{className:`update-setting`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:t}),(0,B.jsx)(`select`,{"aria-label":e,onChange:e=>{let t=g0(e.target.value);t!==void 0&&i(t)},value:String(n),children:p0.map(({setting:e,label:t})=>(0,B.jsx)(`option`,{value:String(e),children:t},e))})]}),r>0&&(0,B.jsxs)(`output`,{"aria-label":`${e} waiting`,className:`update-waiting`,children:[r,` waiting`]})]})}var S0=new uN(window.location.origin,{fetch:window.fetch.bind(window)});function C0(e){let t=(0,z.useRef)({value:e,count:0});return t.current.value!==e&&(t.current={value:e,count:t.current.count+1}),t.current.count}var w0=()=>Promise.resolve();function T0({client:t=S0,first:n,onDrawn:r}){let i=_Q(),a=lQ(),o=i.host||a.active,s=uZ(a.active),c=b0(),l=kQ(),d=jQ(t,{runId:i.runId,view:M(i.view,i.nodeId),nodeId:i.nodeId,selectFirst:!o,host:o,humanItems:s.view,navigationUpdates:c.navigation,mainUpdates:c.main,...n===void 0?{}:{first:n}}),f=d.rows,p=d.runId,m=d.activity.at(-1),h=d.detail,g=(0,z.useMemo)(()=>h?te(h):[],[h]),_=TN(t,p),v=_.status.value?.liveness,y=(0,z.useMemo)(()=>h===void 0?void 0:he({state:h.run.state,...v===void 0?{}:{liveness:v},statuses:h.graph?.node_status??{}}),[h,v]),b=$Q(t),[x,S]=(0,z.useState)(0),C=b.host.state.phase===`sending`,w=C0(f),{list:T,error:E}=fK(t,i.host||C,x+(C?w:0)),D=h===void 0?void 0:N(h),O=je(h?.progress),k=h?.progress?.failed??d.timeline?.progress?.failed,A=!o&&(h?.progress?.complete===!1||d.timeline?.progress?.complete===!1),j=!o&&h===void 0&&d.error!==void 0,P=(0,z.useRef)(!1);(0,z.useLayoutEffect)(()=>{P.current||(h!==void 0||d.error!==void 0)&&(P.current=!0,r?.())},[h,d.error,r]);let F=ie(h,g,i.nodeId);(0,z.useEffect)(()=>{if(o||!f)return;let e=xQ(f),t=e.find(e=>e.rows.some(e=>e.id===i.runId)),n=t?.rows.find(e=>e.id===i.runId),r=(t?.rows??e.flatMap(e=>e.rows)).filter(e=>!e.kind||!i.hiddenKinds.includes(e.kind));(!i.runId||n?.kind&&i.hiddenKinds.includes(n.kind))&&r[0]&&i.selectRun(r[0].id)},[f,i,o]),(0,z.useEffect)(()=>{if(p&&i.runId&&i.runId!==p){let e=new URLSearchParams(window.location.search);e.set(`run`,p),e.delete(`node`),e.delete(`event`),e.set(`view`,i.view),window.history.replaceState(null,``,`${window.location.pathname}?${e}`),window.dispatchEvent(new PopStateEvent(`popstate`))}},[i.runId,p,i.view]);let I=a.active?`Action items`:i.host?`Host`:p??`No DAG selected`,ee=e=>(0,B.jsxs)(`section`,{"aria-label":p&&!o?`Run header`:`Workspace header`,className:`topbar${p&&!o?` run-topbar`:``}`,children:[(0,B.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,B.jsx)(lt,{"aria-hidden":`true`,size:18})}),(0,B.jsx)(`div`,{className:`topbar-title`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Execution telemetry`}),(0,B.jsx)(`h2`,{title:I,children:I})]})}),(0,B.jsxs)(`div`,{className:`topbar-actions`,children:[!o&&p!==void 0&&(0,B.jsx)(xN,{control:_,runId:p,ended:h!==void 0&&(h.run.state===`settled`||h.run.state.startsWith(`ended-`)),...y===void 0?{}:{state:y}}),(0,B.jsxs)(`span`,{className:`connection`,children:[(0,B.jsx)(yt,{size:15}),d.lastUpdated===void 0?`Waiting for first update`:(0,B.jsxs)(B.Fragment,{children:[`Last updated `,(0,B.jsx)(u,{at:d.lastUpdated,relative:!0})]})]}),!o&&m!==void 0&&(0,B.jsxs)(`button`,{className:`last-activity connection`,type:`button`,title:`${m.node}: ${E0(m)}`,onClick:()=>{i.selectNode(m.node),i.selectItem(m.event_id)},children:[m.node,`: `,E0(m)]})]}),e,(0,B.jsxs)(`div`,{className:`main-updates`,children:[(0,B.jsx)(x0,{caption:`Updates`,name:`Main area updates`,onChange:c.setMain,setting:c.main,waiting:d.mainWaiting}),(0,B.jsxs)(Vi,{onClick:()=>{S(e=>e+1),d.refresh(),o||_.reread()},size:`sm`,type:`button`,variant:`outline`,children:[(0,B.jsx)(gt,{size:14}),` Refresh`]})]})]}),L=(0,B.jsxs)(B.Fragment,{children:[d.error&&!j&&(0,B.jsxs)(gi,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`Live telemetry issue`}),(0,B.jsxs)(vi,{children:[d.error.message,` `,(0,B.jsx)(Vi,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),k!==void 0&&(0,B.jsxs)(gi,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(_i,{children:`The rest of this run's history did not load`}),(0,B.jsxs)(vi,{children:[k,` `,(0,B.jsx)(Vi,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),d.notice&&(0,B.jsx)(`p`,{className:`live-notice`,role:`status`,children:d.notice}),(0,B.jsx)(r$,{label:`Shutdown of the entire host`,onDismiss:b.host.dismiss,rows:T?.runs??[],state:b.host.state})]});return(0,B.jsxs)(_p,{children:[(0,B.jsx)(f0,{}),(0,B.jsxs)(`div`,{className:`app-shell`,children:[(0,B.jsx)(OQ,{rows:d.navigationRows,failed:d.rows===void 0&&d.error!==void 0,selectedRunId:p,onSelect:e=>{i.selectRun(e),l.close()},onOpenProject:i.selectRun,onHost:()=>{i.selectHost(),l.close()},hostCurrent:i.host&&!a.active,onActionItems:()=>{a.open(),l.close()},actionItemsCurrent:a.active,hiddenKinds:i.hiddenKinds,onKindsChange:i.selectKinds,drawerOpen:l.open,drawerRef:l.drawer,updates:(0,B.jsx)(x0,{caption:`Navigation`,name:`Navigation updates`,onChange:c.setNavigation,setting:c.navigation,waiting:d.navigationWaiting})}),l.open&&(0,B.jsx)(`button`,{"aria-label":`Close navigation`,className:`nav-scrim`,onClick:l.close,type:`button`}),(0,B.jsx)(`main`,{className:`workspace`,inert:l.open,children:o?(0,B.jsxs)(B.Fragment,{children:[ee(void 0),L,a.active?(0,B.jsx)(CZ,{client:t,live:d.humanItems,choice:s.choice,setChoice:s.setChoice,selectedId:s.selectedId,setSelectedId:s.setSelectedId}):(0,B.jsx)(dK,{client:t,listError:E,onRefresh:()=>S(e=>e+1),list:T,rows:d.hostRows,children:(0,B.jsx)(e$,{list:T,loadMore:w0,loadingMore:!1,shutdowns:b})})]}):(0,B.jsxs)(Df,{className:`min-h-0 flex-1 gap-0`,onValueChange:e=>e===`overall`?i.showOverall():i.selectNode(void 0),value:i.view,children:[ee((0,B.jsx)(`div`,{className:`view-tabs`,children:(0,B.jsxs)(kf,{"aria-label":`DAG views`,variant:`line`,children:[(0,B.jsxs)(Af,{value:`graph`,children:[(0,B.jsx)(Et,{size:15}),` Graph`]}),(0,B.jsxs)(Af,{value:`overall`,children:[(0,B.jsx)(vt,{size:15}),` Overall`]})]})})),L,(0,B.jsx)(jf,{className:`min-h-0`,value:i.view,children:j&&d.error?(0,B.jsx)(`div`,{className:`loading-state`,children:(0,B.jsxs)(`div`,{className:`read-failed`,role:`alert`,children:[(0,B.jsx)(`strong`,{children:`This run's history did not load`}),(0,B.jsx)(`p`,{children:d.error.message}),(0,B.jsx)(`button`,{onClick:d.refresh,type:`button`,children:`Try again`})]})}):!h&&(d.loading||p!==void 0)?(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-state`,children:[(0,B.jsx)(Dd,{className:`h-2 w-48`}),(0,B.jsx)(Dd,{className:`h-2 w-32`}),`Loading execution history…`]}):h&&p?i.view===`overall`?(0,B.jsx)(e0,{client:t,detail:h,hiddenTypes:i.hiddenEventTypes,onHiddenTypesChange:i.selectEventTypes,journalSeq:D?.last_seq,nodes:g,onRetry:d.refresh,state:y,status:_.status,timeline:d.timeline,timelineError:d.timelineError,onSelectNode:i.selectNode,onSelectItem:i.selectItem,selectedItemId:i.itemId},p):F?(0,B.jsx)(B1,{client:t,hiddenTypes:i.hiddenEventTypes,onHiddenTypesChange:i.selectEventTypes,runLoaded:O,onRetry:d.refresh,node:F,nodes:g,onBack:()=>i.selectNode(void 0),onSelectItem:i.selectItem,runId:p,selectedItemId:i.itemId,selectedTab:i.nodeTab,onSelectTab:i.selectNodeTab,timeline:d.timeline,timelineError:d.timelineError},`${p}:${F.id}`):(0,B.jsx)(oK,{journalSeq:D?.last_seq,nodes:g,rejectedEdits:D?.rejected_edits,selectedNodeId:i.nodeId,onSelectNode:i.selectNode}):(0,B.jsxs)(`div`,{className:`empty-state`,children:[(0,B.jsx)(Et,{size:34}),(0,B.jsx)(`h2`,{children:`No DAG runs found`}),(0,B.jsx)(`p`,{children:`Start an orchestrated run to see it appear here.`})]})})]})}),A&&k===void 0&&(0,B.jsx)(`p`,{className:`history-loading`,role:`status`,children:`The rest of this run's history is still loading`})]})]})}function E0(e){return e.description||e.kind}var D0=class extends z.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,B.jsxs)(`main`,{className:`fatal-error`,role:`alert`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Rendering error`}),(0,B.jsx)(`h1`,{children:`The DAG view could not be displayed.`}),(0,B.jsx)(`p`,{children:this.state.error.message}),(0,B.jsx)(Vi,{onClick:()=>(this.props.onReload??(()=>window.location.reload()))(),type:`button`,variant:`secondary`,children:`Reload`})]}):this.props.children}};function O0(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,Ik.createRoot)(r).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(D0,{children:(0,B.jsx)(T0,{first:t,onDrawn:()=>{r!==e&&(n?.unmount(),e.replaceWith(r),r.id=`root`,r.removeAttribute(`data-app-behind-first-screen`),r.style.cssText=``)}})})}))}export{O0 as mountApp};
107
+ `)}function d0(e){let t=u0(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 f0({node:e}){let t=e.detail?.publication;if(t===void 0)return typeof e.result?.pr==`string`&&e.result.pr?(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e.result.pr,rel:`noreferrer`,target:`_blank`,children:[f$(e.result.pr),` `,(0,B.jsx)(rt,{size:12})]}):(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=(t.merged?[[t.pr_url,f$(t.pr_url)],[t.commit_url,`Commit ${t.commit?.slice(0,8)??``}`]]:[[t.pr_url,f$(t.pr_url)],[t.branch_url,t.branch??`Branch`]]).filter(([e])=>e);return n.length===0?(0,B.jsx)(B.Fragment,{children:`Not recorded`}):(0,B.jsx)(B.Fragment,{children:n.map(([e,t],n)=>(0,B.jsxs)(`span`,{children:[n>0&&` · `,(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e,rel:`noreferrer`,target:`_blank`,children:[t,` `,(0,B.jsx)(rt,{size:12})]})]},e))})}function p0({node:e}){let t=_e(e);if(t.length===0)return null;let n=e.result?.detail?.trim()||void 0;return(0,B.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,B.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,B.jsx)(pt,{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,B.jsxs)(`dl`,{className:`facts facts-stacked`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.length===1?`Awaits`:`Awaits ${t.length}`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`ul`,{className:`awaited-releases`,children:t.map(e=>(0,B.jsxs)(`li`,{children:[`the `,(0,B.jsx)(`strong`,{children:e.target}),` release of`,` `,(0,B.jsx)(`code`,{children:e.producer})]},`${e.producer} ${e.target}`))})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:n})]})]})]})}function m0({node:e}){if(e.kind!==`command`)return null;let t=e.task?.command,n=e.task?.timeout_seconds,r=e.result?.outcome,i=e.result?.log;return(0,B.jsxs)(`section`,{"aria-label":`Command`,className:`node-command m-5`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[t!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(t)})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Timeout`}),(0,B.jsxs)(`dd`,{children:[n,` seconds`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:r??e.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Log`}),(0,B.jsx)(`dd`,{children:i===void 0?`The command has not started.`:i.path})]})]}),i?.content===void 0?i!==void 0&&(0,B.jsx)(`p`,{className:`node-command-log-missing`,children:`The log is not readable from this run.`}):(0,B.jsxs)(`figure`,{className:`node-command-log-figure`,children:[(0,B.jsx)(`figcaption`,{children:`Command log`}),(0,B.jsx)(`pre`,{className:`node-command-log`,children:i.truncated===!0?`…${i.content}`:i.content})]})]})}function h0({node:t,nodes:n}){if(!ye(t.status))return null;let r=t.status===`blocked`||t.status===`skipped`,i=xe(t),a=t.result?.error||void 0,o=t.result?.exit_code;return(0,B.jsxs)(yi,{className:k(`m-5 w-auto`,r&&`border-warning bg-warning-surface text-warning`),variant:r?`default`:`destructive`,children:[r?(0,B.jsx)(pt,{}):(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:r?`This node is ${t.status}`:`This node ${t.status===`cancelled`?`was cancelled`:t.status===`not-completed`?`did not complete`:`failed`}${t.failure?`: ${t.failure.class}`:``}`}),(0,B.jsx)(xi,{children:(0,B.jsxs)(`dl`,{className:`facts`,children:[r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.status===`skipped`?`Unmet`:`Blocked by`}),(0,B.jsx)(`dd`,{children:t.blockers.length>0?t.blockers.map(e=>{let t=n.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `):`Nothing recorded; the run has not written what holds it.`})]}),t.status===`skipped`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Attempts`}),(0,B.jsx)(`dd`,{children:`Never attempted`})]}),!r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:i??`No reason was recorded for this outcome.`})]}),a!==void 0&&a!==i&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:a})]}),typeof o==`number`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Exit code`}),(0,B.jsx)(`dd`,{children:o})]})]})})]})}function g0(e){return e==null||e===``?`Not recorded`:typeof e==`string`?e:JSON.stringify(e,null,2)}function _0({client:t,detail:n,nodes:r,timeline:i,timelineError:s,hiddenTypes:l=[],onHiddenTypesChange:u=()=>{},onRetry:d,journalSeq:f,onSelectNode:p,selectedItemId:m,onSelectItem:h,state:g,status:_}){let y=n.run.run_id,b=$1({client:t,runId:y,scope:`run`,...i===void 0?{}:{timeline:i}}),x=b.timeline,S=je(n.progress),w=(0,z.useMemo)(()=>Le(x,r),[x,r]),T=(x?.spans??[]).filter(e=>e.node_id===void 0),E=(0,z.useMemo)(()=>new Set(l),[l]),D=(0,z.useMemo)(()=>v(x),[x]),O=(0,z.useMemo)(()=>o(D,E),[D,E]),k=T.find(e=>e.id===m),A=T.flatMap(e=>e.events).find(e=>(e.record_id??e.id)===m)??T.flatMap(e=>e.events).find(e=>e.id===m),j=m===void 0?void 0:a(O,m),M=k===void 0?j??(A===void 0?void 0:C(A)):c(k),{loadSpan:N,forgetSpan:P,loadRow:F}=b;(0,z.useEffect)(()=>{m!==void 0&&M===void 0&&x!==void 0&&F(void 0)},[m,M,x,F]);let I=k?.id;(0,z.useEffect)(()=>{if(I!==void 0)return N(I),()=>P(I)},[I,N,P]);let ee=I===void 0?void 0:b.spanFailure(I);return(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m!==void 0&&h()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,m]),(0,B.jsxs)(`div`,{className:`overall-view`,"data-journal-seq":f,children:[(0,B.jsx)(gd,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`p-[34px] max-sm:p-3`,children:[(0,B.jsxs)(`section`,{"aria-label":`Whole DAG`,className:`overall-hero`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Whole DAG`}),(0,B.jsx)(`h2`,{children:y}),n.graph?.plan.goal?.text&&(0,B.jsx)(`p`,{className:`run-goal`,children:n.graph.plan.goal.text}),(0,B.jsxs)(`p`,{className:`overall-state`,children:[g!==void 0&&(0,B.jsx)(CN,{large:!0,state:g}),(0,B.jsx)(`span`,{children:n.run.last_event?`last event ${n.run.last_event}`:`no events recorded yet`})]})]}),(0,B.jsxs)(`section`,{"aria-label":`Run metrics`,className:`metric-grid`,children:[(0,B.jsx)(C0,{icon:(0,B.jsx)(at,{}),label:`Nodes`,value:le(r)}),(0,B.jsx)(C0,{icon:(0,B.jsx)(tt,{}),label:`Wall time`,value:n.run.timing.wall_seconds===null?`not measured`:Ee(n.run.timing.wall_seconds)}),(0,B.jsx)(C0,{icon:(0,B.jsx)(nt,{}),label:`Turns`,value:typeof n.run.turns==`number`?String(n.run.turns):oe}),(0,B.jsx)(S0,{detail:n,runLoaded:S,status:_})]}),(0,B.jsx)(Gi,{className:`gap-0 py-[15px]`,children:(0,B.jsxs)(Ki,{className:`px-[15px]`,children:[(0,B.jsxs)(`div`,{className:`section-heading`,children:[(0,B.jsx)(Be,{size:16}),(0,B.jsx)(`h3`,{children:`Graph timeline`})]}),s===void 0?x===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`m-0 text-[11px] text-muted-foreground`,children:`Loading the run's timeline…`}):x.spans.length===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`This run has recorded no timeline yet.`}):(0,B.jsx)(v0,{graph:w,history:b,runRecordsToLoad:T.some(e=>e.harness_scope===void 0&&(e.events_total===void 0||e.events_total>e.events.length)),onOpenNode:p,onOpenItem:h,selectedItemId:m}):(0,B.jsxs)(yi,{className:`live-issue`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`Timeline unavailable`}),(0,B.jsxs)(xi,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Wi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})]})}),x!==void 0&&x.spans.length>0&&(0,B.jsx)(b0,{counts:ze(D),hidden:E,listed:O,onHiddenChange:u,onOpen:h,recorded:D.length,...m===void 0?{}:{selectedItemId:m}})]})}),M!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Wi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>h(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(a1,{client:t,row:M,runId:y}),ee!==void 0&&(0,B.jsx)(D$,{failure:ee})]})]})}function v0({graph:e,history:t,runRecordsToLoad:n,onOpenNode:r,onOpenItem:i,selectedItemId:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(!1),[u,d]=(0,z.useState)(new Set),f=o??e.range,[p,m]=(0,z.useState)(!1),{loadRow:h,loadStretch:g}=t;(0,z.useEffect)(()=>{if(o===void 0)return;let e=setTimeout(()=>g(o[0],o[1],void 0),250);return()=>clearTimeout(e)},[o,g]);let _=e=>{e.kind===`record`&&e.nodeId===void 0||e.nodeId===void 0?i(e.id):r(e.nodeId)},v=X$(),y=e.line.lanes.filter(({id:t})=>e.line.items.some(e=>e.laneId===t));return(0,B.jsxs)(`div`,{className:`graph-timeline`,"data-rows-open":c,children:[(0,B.jsx)(an,{...m$,axis:{origin:e.range[0]},expanded:!1,items:e.line.items,label:`Graph timeline`,lanes:y,markers:e.line.markers,onExpandedChange:l,onHover:v,onRangeChange:e=>s(g$(e)),onSelect:e=>_(e.payload),range:f,selectedId:a}),t.failure!==void 0&&(0,B.jsx)(D$,{failure:t.failure}),n&&!p&&(0,B.jsx)(`button`,{className:`load-earlier`,onClick:()=>{m(!0),h(void 0)},type:`button`,children:`Load the run's own records`}),c&&(0,B.jsx)(`ol`,{className:`graph-rows`,children:e.rows.map(t=>(0,B.jsx)(x0,{onOpen:_,onOpenNode:r,onExpandedChange:e=>{e&&h(t.nodeId),d(n=>{let r=new Set(n);return e?r.add(t.id):r.delete(t.id),r})},expanded:u.has(t.id),origin:e.range[0],range:f,onRangeChange:e=>s(g$(e)),row:t,selectedItemId:a},t.id))})]})}var y0=()=>{};function b0({counts:e,hidden:t,listed:n,onHiddenChange:r,onOpen:i,recorded:a,selectedItemId:o}){let[s,c]=(0,z.useState)(new Set),l=(0,z.useMemo)(()=>{if(o===void 0)return s;let e=h(n,o).filter(e=>e.rowKind===`group`).map(({id:e})=>e);return e.length===0?s:new Set([...s,...e])},[n,s,o]),u=(0,z.useMemo)(()=>m(n,l),[n,l]),d=(0,z.useCallback)(e=>c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]);return(0,B.jsx)(Gi,{className:`mt-4 gap-0 py-[15px]`,children:(0,B.jsx)(Ki,{className:`px-[15px]`,children:(0,B.jsxs)(`section`,{"aria-label":`Run events`,className:`run-events`,children:[(0,B.jsx)(w$,{counts:e,hidden:t,onHiddenChange:r}),a===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`No record of the run's own is held yet.`}):n.length===0?(0,B.jsx)(T$,{onClear:()=>r([])}):(0,B.jsx)(s0,{entries:u,onOpen:i,onToggle:d,register:y0,...o===void 0?{}:{selectedItemId:o}})]})})})}function x0({row:e,range:t,origin:n,expanded:r,onExpandedChange:i,onRangeChange:a,onOpen:o,onOpenNode:s,selectedItemId:c}){let l=e.nodeId,u=X$();return(0,B.jsxs)(`li`,{className:`graph-row`,"data-row-kind":e.kind,children:[(0,B.jsxs)(`header`,{className:`graph-row-head`,children:[l===void 0?(0,B.jsx)(`span`,{className:`graph-row-name`,children:e.label}):(0,B.jsx)(`button`,{className:`graph-row-name`,onClick:()=>s(l),type:`button`,children:e.label}),(0,B.jsxs)(`span`,{className:`graph-row-facts`,children:[be(e.workedMs),` recorded · `,be(e.idleMs),` `,`idle`]})]}),(0,B.jsx)(an,{...m$,axis:{origin:n},expanded:r,items:r?e.items:e.line,label:`${e.label} timeline`,lanes:e.lanes,markers:e.markers,onExpandedChange:i,onHover:u,onRangeChange:a,onSelect:e=>o(e.payload),range:t,selectedId:c})]})}function S0({detail:e,status:t,runLoaded:n}){let r=t.value?.unread_surfaces,i=e.run.last_progress_at;return(0,B.jsxs)(Gi,{"aria-label":`Run details`,className:`metric run-details gap-2 p-4`,role:`group`,children:[(0,B.jsx)(`p`,{children:`Run details`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Launching session`}),(0,B.jsx)(`dd`,{children:n?Te(e.launch):oe})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unread surfaces`}),(0,B.jsxs)(`dd`,{children:[r===void 0?t.error===void 0?oe:`Unavailable`:r.oldest_seconds===null?String(r.count):`${r.count} · oldest ${Ee(r.oldest_seconds)}`,t.error!==void 0&&(0,B.jsxs)(`span`,{className:`run-details-error`,role:`alert`,children:[` `,`Status unavailable: `,t.error.message]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Last progress`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Last progress`,children:n?i===void 0||i<=0?`—`:(0,B.jsx)(u,{at:new Date(i*1e3).toISOString(),relative:!0}):oe})})]})]})]})}function C0({icon:e,label:t,value:n}){return(0,B.jsxs)(Gi,{"aria-label":t,className:`metric flex-row items-center gap-3 p-4`,role:`group`,children:[e,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{children:t}),(0,B.jsx)(`strong`,{children:n})]})]})}var w0=[{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`}],T0=`live`,E0={navigation:`dag-ui.updates.navigation`,main:`dag-ui.updates.main`};function D0(e){return w0.find(({setting:t})=>String(t)===e)?.setting}function O0(e){try{return window.localStorage.getItem(e)}catch{return null}}function k0(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function A0(e,t){let[n,r]=(0,z.useState)(()=>D0(O0(e))??t);return[n,(0,z.useCallback)(t=>{r(t),k0(e,t)},[e])]}function j0(){let[e,t]=A0(E0.navigation,30),[n,r]=A0(E0.main,T0);return{navigation:e,setNavigation:t,main:n,setMain:r}}function M0({name:e,caption:t,setting:n,waiting:r,onChange:i}){return(0,B.jsxs)(`div`,{className:`update-setting`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:t}),(0,B.jsx)(`select`,{"aria-label":e,onChange:e=>{let t=D0(e.target.value);t!==void 0&&i(t)},value:String(n),children:w0.map(({setting:e,label:t})=>(0,B.jsx)(`option`,{value:String(e),children:t},e))})]}),r>0&&(0,B.jsxs)(`output`,{"aria-label":`${e} waiting`,className:`update-waiting`,children:[r,` waiting`]})]})}var N0=new hN(window.location.origin,{fetch:window.fetch.bind(window)});function P0(e){let t=(0,z.useRef)({value:e,count:0});return t.current.value!==e&&(t.current={value:e,count:t.current.count+1}),t.current.count}var F0=()=>Promise.resolve();function I0({client:t=N0,first:n,onDrawn:r}){let i=xQ(),a=pQ(),o=i.host||a.active,s=mZ(a.active),c=j0(),l=NQ(),d=FQ(t,{runId:i.runId,view:M(i.view,i.nodeId),nodeId:i.nodeId,selectFirst:!o,host:o,humanItems:s.view,navigationUpdates:c.navigation,mainUpdates:c.main,...n===void 0?{}:{first:n}}),f=d.rows,p=d.runId,m=d.activity.at(-1),h=d.detail,g=(0,z.useMemo)(()=>h?te(h):[],[h]),_=AN(t,p),v=_.status.value?.liveness,y=(0,z.useMemo)(()=>h===void 0?void 0:he({state:h.run.state,...v===void 0?{}:{liveness:v},statuses:h.graph?.node_status??{}}),[h,v]),b=r$(t),[x,S]=(0,z.useState)(0),C=b.host.state.phase===`sending`,w=P0(f),{list:T,error:E}=gK(t,i.host||C,x+(C?w:0)),D=h===void 0?void 0:N(h),O=je(h?.progress),k=h?.progress?.failed??d.timeline?.progress?.failed,A=!o&&(h?.progress?.complete===!1||d.timeline?.progress?.complete===!1),j=!o&&h===void 0&&d.error!==void 0,P=(0,z.useRef)(!1);(0,z.useLayoutEffect)(()=>{P.current||(h!==void 0||d.error!==void 0)&&(P.current=!0,r?.())},[h,d.error,r]);let F=ie(h,g,i.nodeId);(0,z.useEffect)(()=>{if(o||!f)return;let e=TQ(f),t=e.find(e=>e.rows.some(e=>e.id===i.runId)),n=t?.rows.find(e=>e.id===i.runId),r=(t?.rows??e.flatMap(e=>e.rows)).filter(e=>!e.kind||!i.hiddenKinds.includes(e.kind));(!i.runId||n?.kind&&i.hiddenKinds.includes(n.kind))&&r[0]&&i.selectRun(r[0].id)},[f,i,o]),(0,z.useEffect)(()=>{if(p&&i.runId&&i.runId!==p){let e=new URLSearchParams(window.location.search);e.set(`run`,p),e.delete(`node`),e.delete(`event`),e.set(`view`,i.view),window.history.replaceState(null,``,`${window.location.pathname}?${e}`),window.dispatchEvent(new PopStateEvent(`popstate`))}},[i.runId,p,i.view]);let I=a.active?`Action items`:i.host?`Host`:p??`No DAG selected`,ee=e=>(0,B.jsxs)(`section`,{"aria-label":p&&!o?`Run header`:`Workspace header`,className:`topbar${p&&!o?` run-topbar`:``}`,children:[(0,B.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,B.jsx)(lt,{"aria-hidden":`true`,size:18})}),(0,B.jsx)(`div`,{className:`topbar-title`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Execution telemetry`}),(0,B.jsx)(`h2`,{title:I,children:I})]})}),(0,B.jsxs)(`div`,{className:`topbar-actions`,children:[!o&&p!==void 0&&(0,B.jsx)(EN,{control:_,runId:p,ended:h!==void 0&&(h.run.state===`settled`||h.run.state.startsWith(`ended-`)),...y===void 0?{}:{state:y}}),(0,B.jsxs)(`span`,{className:`connection`,children:[(0,B.jsx)(yt,{size:15}),d.lastUpdated===void 0?`Waiting for first update`:(0,B.jsxs)(B.Fragment,{children:[`Last updated `,(0,B.jsx)(u,{at:d.lastUpdated,relative:!0})]})]}),!o&&m!==void 0&&(0,B.jsxs)(`button`,{className:`last-activity connection`,type:`button`,title:`${m.node}: ${L0(m)}`,onClick:()=>{i.selectNode(m.node),i.selectItem(m.event_id)},children:[m.node,`: `,L0(m)]})]}),e,(0,B.jsxs)(`div`,{className:`main-updates`,children:[(0,B.jsx)(M0,{caption:`Updates`,name:`Main area updates`,onChange:c.setMain,setting:c.main,waiting:d.mainWaiting}),(0,B.jsxs)(Wi,{onClick:()=>{S(e=>e+1),d.refresh(),o||_.reread()},size:`sm`,type:`button`,variant:`outline`,children:[(0,B.jsx)(gt,{size:14}),` Refresh`]})]})]}),L=(0,B.jsxs)(B.Fragment,{children:[d.error&&!j&&(0,B.jsxs)(yi,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`Live telemetry issue`}),(0,B.jsxs)(xi,{children:[d.error.message,` `,(0,B.jsx)(Wi,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),k!==void 0&&(0,B.jsxs)(yi,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(bi,{children:`The rest of this run's history did not load`}),(0,B.jsxs)(xi,{children:[k,` `,(0,B.jsx)(Wi,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),d.notice&&(0,B.jsx)(`p`,{className:`live-notice`,role:`status`,children:d.notice}),(0,B.jsx)(s$,{label:`Shutdown of the entire host`,onDismiss:b.host.dismiss,rows:T?.runs??[],state:b.host.state})]});return(0,B.jsx)(bp,{children:(0,B.jsx)(Q$,{children:(0,B.jsxs)(`div`,{className:`app-shell`,children:[(0,B.jsx)(MQ,{rows:d.navigationRows,failed:d.rows===void 0&&d.error!==void 0,selectedRunId:p,onSelect:e=>{i.selectRun(e),l.close()},onOpenProject:i.selectRun,onHost:()=>{i.selectHost(),l.close()},hostCurrent:i.host&&!a.active,onActionItems:()=>{a.open(),l.close()},actionItemsCurrent:a.active,hiddenKinds:i.hiddenKinds,onKindsChange:i.selectKinds,drawerOpen:l.open,drawerRef:l.drawer,updates:(0,B.jsx)(M0,{caption:`Navigation`,name:`Navigation updates`,onChange:c.setNavigation,setting:c.navigation,waiting:d.navigationWaiting})}),l.open&&(0,B.jsx)(`button`,{"aria-label":`Close navigation`,className:`nav-scrim`,onClick:l.close,type:`button`}),(0,B.jsx)(`main`,{className:`workspace`,inert:l.open,children:o?(0,B.jsxs)(B.Fragment,{children:[ee(void 0),L,a.active?(0,B.jsx)(DZ,{client:t,live:d.humanItems,choice:s.choice,setChoice:s.setChoice,selectedId:s.selectedId,setSelectedId:s.setSelectedId}):(0,B.jsx)(hK,{client:t,listError:E,onRefresh:()=>S(e=>e+1),list:T,rows:d.hostRows,children:(0,B.jsx)(i$,{list:T,loadMore:F0,loadingMore:!1,shutdowns:b})})]}):(0,B.jsxs)(Af,{className:`min-h-0 flex-1 gap-0`,onValueChange:e=>e===`overall`?i.showOverall():i.selectNode(void 0),value:i.view,children:[ee((0,B.jsx)(`div`,{className:`view-tabs`,children:(0,B.jsxs)(Mf,{"aria-label":`DAG views`,variant:`line`,children:[(0,B.jsxs)(Nf,{value:`graph`,children:[(0,B.jsx)(Et,{size:15}),` Graph`]}),(0,B.jsxs)(Nf,{value:`overall`,children:[(0,B.jsx)(vt,{size:15}),` Overall`]})]})})),L,(0,B.jsx)(Pf,{className:`min-h-0`,value:i.view,children:j&&d.error?(0,B.jsx)(`div`,{className:`loading-state`,children:(0,B.jsxs)(`div`,{className:`read-failed`,role:`alert`,children:[(0,B.jsx)(`strong`,{children:`This run's history did not load`}),(0,B.jsx)(`p`,{children:d.error.message}),(0,B.jsx)(`button`,{onClick:d.refresh,type:`button`,children:`Try again`})]})}):!h&&(d.loading||p!==void 0)?(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-state`,children:[(0,B.jsx)(Ad,{className:`h-2 w-48`}),(0,B.jsx)(Ad,{className:`h-2 w-32`}),`Loading execution history…`]}):h&&p?i.view===`overall`?(0,B.jsx)(_0,{client:t,detail:h,hiddenTypes:i.hiddenEventTypes,onHiddenTypesChange:i.selectEventTypes,journalSeq:D?.last_seq,nodes:g,onRetry:d.refresh,state:y,status:_.status,timeline:d.timeline,timelineError:d.timelineError,onSelectNode:i.selectNode,onSelectItem:i.selectItem,selectedItemId:i.itemId},p):F?(0,B.jsx)(r0,{client:t,hiddenTypes:i.hiddenEventTypes,onHiddenTypesChange:i.selectEventTypes,runLoaded:O,onRetry:d.refresh,node:F,nodes:g,onBack:()=>i.selectNode(void 0),onSelectItem:i.selectItem,runId:p,selectedItemId:i.itemId,selectedTab:i.nodeTab,onSelectTab:i.selectNodeTab,timeline:d.timeline,timelineError:d.timelineError},`${p}:${F.id}`):(0,B.jsx)(uK,{journalSeq:D?.last_seq,nodes:g,selectedNodeId:i.nodeId,onSelectNode:i.selectNode}):(0,B.jsxs)(`div`,{className:`empty-state`,children:[(0,B.jsx)(Et,{size:34}),(0,B.jsx)(`h2`,{children:`No DAG runs found`}),(0,B.jsx)(`p`,{children:`Start an orchestrated run to see it appear here.`})]})})]})}),A&&k===void 0&&(0,B.jsx)(`p`,{className:`history-loading`,role:`status`,children:`The rest of this run's history is still loading`})]})})})}function L0(e){return e.description||e.kind}var R0=class extends z.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,B.jsxs)(`main`,{className:`fatal-error`,role:`alert`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Rendering error`}),(0,B.jsx)(`h1`,{children:`The DAG view could not be displayed.`}),(0,B.jsx)(`p`,{children:this.state.error.message}),(0,B.jsx)(Wi,{onClick:()=>(this.props.onReload??(()=>window.location.reload()))(),type:`button`,variant:`secondary`,children:`Reload`})]}):this.props.children}};function z0(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,Vk.createRoot)(r).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(R0,{children:(0,B.jsx)(I0,{first:t,onDrawn:()=>{r!==e&&(n?.unmount(),e.replaceWith(r),r.id=`root`,r.removeAttribute(`data-app-behind-first-screen`),r.style.cssText=``)}})})}))}export{z0 as mountApp};