orbital-command 1.1.0 → 1.1.3

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.
Files changed (51) hide show
  1. package/bin/commands/launch.js +0 -1
  2. package/bin/commands/update.js +18 -2
  3. package/bin/lib/helpers.js +1 -31
  4. package/bin/orbital.js +32 -30
  5. package/dist/assets/{Landing-B6q9U0Vd.js → Landing-D41fKTK0.js} +1 -1
  6. package/dist/assets/{PrimitivesConfig-TlFvypvg.js → PrimitivesConfig-BDKrqwMI.js} +1 -1
  7. package/dist/assets/{QualityGates-D8uvclW4.js → QualityGates-CcrwWI45.js} +1 -1
  8. package/dist/assets/{SessionTimeline-QUaJw6Aa.js → SessionTimeline-D2IN9T3a.js} +1 -1
  9. package/dist/assets/{Settings-CAEnAZAk.js → Settings-gAsObGj2.js} +1 -1
  10. package/dist/assets/{SourceControl-DPeSBaMV.js → SourceControl-CmrDWqSs.js} +1 -1
  11. package/dist/assets/{WorkflowVisualizer-DHrIjx6W.js → WorkflowVisualizer-SxM8rp11.js} +1 -1
  12. package/dist/assets/{arrow-down-DnfKgF33.js → arrow-down-CPRn0RJb.js} +1 -1
  13. package/dist/assets/{bot-DUPnHZfM.js → bot-D2wELs5q.js} +1 -1
  14. package/dist/assets/{circle-x-B4nA79je.js → circle-x-CXIlaZex.js} +1 -1
  15. package/dist/assets/{file-text-PnzRO4pO.js → file-text-b1U7rP0E.js} +1 -1
  16. package/dist/assets/{globe-CIX_GBr0.js → globe-Dxpor8Dk.js} +1 -1
  17. package/dist/assets/{index-DQVAzHMu.js → index-xFU6WWfl.js} +36 -36
  18. package/dist/assets/{key-DpAZM-3d.js → key-CBLFsYFp.js} +1 -1
  19. package/dist/assets/{minus-CJlpKNUB.js → minus-pmCQmtIS.js} +1 -1
  20. package/dist/assets/{radio-DhynLcSx.js → radio-Cf5n4Vr7.js} +1 -1
  21. package/dist/assets/{rocket-DnuQh3sF.js → rocket-grx18Wv8.js} +1 -1
  22. package/dist/assets/{shield-DLMQmvFQ.js → shield-Cgjh9h5t.js} +1 -1
  23. package/dist/assets/{useSocketListener-DPrExNDV.js → useSocketListener-BW3fKan5.js} +1 -1
  24. package/dist/assets/{useWorkflowEditor-BxN7phfr.js → useWorkflowEditor-BRepFz22.js} +1 -1
  25. package/dist/assets/{workflow-constants-ZcCN11vm.js → workflow-constants-YePmoWgU.js} +1 -1
  26. package/dist/assets/{zap-eJ3z8HRI.js → zap-rWDVJHlW.js} +1 -1
  27. package/dist/index.html +1 -1
  28. package/dist/server/server/index.js +1 -9
  29. package/dist/server/server/launch.js +0 -3
  30. package/dist/server/server/routes/sync-routes.js +2 -2
  31. package/dist/server/server/services/telemetry-service.js +143 -0
  32. package/dist/server/server/wizard/detect.js +0 -79
  33. package/dist/server/server/wizard/index.js +27 -91
  34. package/dist/server/server/wizard/types.js +2 -3
  35. package/package.json +1 -1
  36. package/server/index.ts +0 -13
  37. package/server/launch.ts +0 -3
  38. package/server/routes/sync-routes.ts +2 -2
  39. package/server/wizard/detect.ts +1 -81
  40. package/server/wizard/index.ts +29 -116
  41. package/server/wizard/types.ts +2 -17
  42. package/templates/hooks/block-push.sh +16 -2
  43. package/templates/hooks/git-commit-guard.sh +3 -2
  44. package/dist/server/server/wizard/phases/confirm.js +0 -39
  45. package/dist/server/server/wizard/phases/project-setup.js +0 -90
  46. package/dist/server/server/wizard/phases/welcome.js +0 -32
  47. package/dist/server/server/wizard/phases/workflow-setup.js +0 -22
  48. package/server/wizard/phases/confirm.ts +0 -45
  49. package/server/wizard/phases/project-setup.ts +0 -106
  50. package/server/wizard/phases/welcome.ts +0 -39
  51. package/server/wizard/phases/workflow-setup.ts +0 -28
@@ -1,13 +1,13 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrimitivesConfig-TlFvypvg.js","assets/ui-QhrRH5wk.js","assets/vendor-Bqt8AJn2.js","assets/workflow-constants-ZcCN11vm.js","assets/bot-DUPnHZfM.js","assets/useWorkflowEditor-BxN7phfr.js","assets/zap-eJ3z8HRI.js","assets/file-text-PnzRO4pO.js","assets/arrow-down-DnfKgF33.js","assets/globe-CIX_GBr0.js","assets/charts-LGLb8hyU.js","assets/QualityGates-D8uvclW4.js","assets/useSocketListener-DPrExNDV.js","assets/shield-DLMQmvFQ.js","assets/circle-x-B4nA79je.js","assets/SourceControl-DPeSBaMV.js","assets/key-DpAZM-3d.js","assets/rocket-DnuQh3sF.js","assets/SessionTimeline-QUaJw6Aa.js","assets/Settings-CAEnAZAk.js","assets/minus-CJlpKNUB.js","assets/WorkflowVisualizer-DHrIjx6W.js","assets/radio-DhynLcSx.js","assets/WorkflowVisualizer-BZV40eAE.css","assets/Landing-B6q9U0Vd.js"])))=>i.map(i=>d[i]);
2
- var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yt=(e,t,n)=>tx(e,typeof t!="symbol"?t+"":t,n);import{j as d,C as mf,R as nx,T as rx,P as ix,O as gf,a as sx,b as xf,c as yf,d as ox,e as ax,D as lx,f as cx,g as bf,h as vf,i as ux,u as wf,k as dx,l as fx,m as Kr,n as hx,o as kf,p as px,F as mx,q as gx,r as xx,s as yx,t as bx,v as vx,w as Sf,A as Cf,x as wx,y as jf,V as kx,z as Sx,S as Ef,B as Cx}from"./ui-QhrRH5wk.js";import{f as jx,g as Ia,a as m,u as Nf,h as Tf,i as Ex,b as ir,N as uc,O as Nx,d as Ie,R as Tx,B as Px,j as Ax,k as Ot,l as dc}from"./vendor-Bqt8AJn2.js";import{c as Pf}from"./charts-LGLb8hyU.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Pi={},fc;function _x(){if(fc)return Pi;fc=1;var e=jx();return Pi.createRoot=e.createRoot,Pi.hydrateRoot=e.hydrateRoot,Pi}var Rx=_x();const Mx=Ia(Rx),Dx="modulepreload",Ox=function(e){return"/"+e},hc={},qn=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(c=>{if(c=Ox(c),c in hc)return;hc[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":Dx,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},La="-",Ix=e=>{const t=Fx(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(La);return a[0]===""&&a.length!==1&&a.shift(),Af(a,t)||Lx(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Af=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Af(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(La);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},pc=/^\[(.+)\]$/,Lx=e=>{if(pc.test(e)){const t=pc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Fx=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zx(Object.entries(e.classGroups),n).forEach(([s,o])=>{qo(o,r,s,t)}),r},qo=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:mc(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(Bx(i)){qo(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{qo(o,mc(t,s),n,r)})})},mc=(e,t)=>{let n=e;return t.split(La).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Bx=e=>e.isThemeGetter,zx=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,Vx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},_f="!",$x=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let c=0,u=0,f;for(let y=0;y<a.length;y++){let x=a[y];if(c===0){if(x===i&&(r||a.slice(y,y+s)===t)){l.push(a.slice(u,y)),u=y+s;continue}if(x==="/"){f=y;continue}}x==="["?c++:x==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(_f),g=p?h.substring(1):h,b=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:o}):o},Ux=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Wx=e=>({cache:Vx(e.cacheSize),parseClassName:$x(e),...Ix(e)}),Hx=/\s+/,qx=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(Hx);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let g=!!p,b=r(g?h.substring(0,p):h);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=r(h),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const y=Ux(u).join(":"),x=f?y+_f:y,w=x+b;if(s.includes(w))continue;s.push(w);const C=i(b,g);for(let E=0;E<C.length;++E){const k=C[E];s.push(x+k)}a=c+(a.length>0?" "+a:a)}return a};function Kx(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Rf(t))&&(r&&(r+=" "),r+=n);return r}const Rf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Rf(e[r]))&&(n&&(n+=" "),n+=t);return n};function Gx(e,...t){let n,r,i,s=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=Wx(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=qx(l,n);return i(l,u),u}return function(){return s(Kx.apply(null,arguments))}}const Ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Mf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yx=/^\d+\/\d+$/,Xx=new Set(["px","full","screen"]),Jx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ey=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ty=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>dr(e)||Xx.has(e)||Yx.test(e),gn=e=>Sr(e,"length",cy),dr=e=>!!e&&!Number.isNaN(Number(e)),Qs=e=>Sr(e,"number",dr),Mr=e=>!!e&&Number.isInteger(Number(e)),ny=e=>e.endsWith("%")&&dr(e.slice(0,-1)),ie=e=>Mf.test(e),xn=e=>Jx.test(e),ry=new Set(["length","size","percentage"]),iy=e=>Sr(e,ry,Df),sy=e=>Sr(e,"position",Df),oy=new Set(["image","url"]),ay=e=>Sr(e,oy,dy),ly=e=>Sr(e,"",uy),Dr=()=>!0,Sr=(e,t,n)=>{const r=Mf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},cy=e=>Qx.test(e)&&!Zx.test(e),Df=()=>!1,uy=e=>ey.test(e),dy=e=>ty.test(e),fy=()=>{const e=Ae("colors"),t=Ae("spacing"),n=Ae("blur"),r=Ae("brightness"),i=Ae("borderColor"),s=Ae("borderRadius"),o=Ae("borderSpacing"),a=Ae("borderWidth"),l=Ae("contrast"),c=Ae("grayscale"),u=Ae("hueRotate"),f=Ae("invert"),h=Ae("gap"),p=Ae("gradientColorStops"),g=Ae("gradientColorStopPositions"),b=Ae("inset"),y=Ae("margin"),x=Ae("opacity"),w=Ae("padding"),C=Ae("saturate"),E=Ae("scale"),k=Ae("sepia"),S=Ae("skew"),A=Ae("space"),T=Ae("translate"),R=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ie,t],P=()=>[ie,t],_=()=>["",Zt,gn],L=()=>["auto",dr,ie],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",ie],v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[dr,ie];return{cacheSize:500,separator:":",theme:{colors:[Dr],spacing:[Zt,gn],blur:["none","",xn,ie],brightness:U(),borderColor:[e],borderRadius:["none","","full",xn,ie],borderSpacing:P(),borderWidth:_(),contrast:U(),grayscale:z(),hueRotate:U(),invert:z(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[ny,gn],inset:D(),margin:D(),opacity:U(),padding:P(),saturate:U(),scale:U(),sepia:z(),skew:U(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[xn]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),ie]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mr,ie]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Mr,ie]}],"grid-cols":[{"grid-cols":[Dr]}],"col-start-end":[{col:["auto",{span:["full",Mr,ie]},ie]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Dr]}],"row-start-end":[{row:["auto",{span:[Mr,ie]},ie]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie,t]}],"min-w":[{"min-w":[ie,t,"min","max","fit"]}],"max-w":[{"max-w":[ie,t,"none","full","min","max","fit","prose",{screen:[xn]},xn]}],h:[{h:[ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xn,gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qs]}],"font-family":[{font:[Dr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie]}],"line-clamp":[{"line-clamp":["none",dr,Qs]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zt,ie]}],"list-image":[{"list-image":["none",ie]}],"list-style-type":[{list:["none","disc","decimal",ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zt,gn]}],"underline-offset":[{"underline-offset":["auto",Zt,ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),sy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",iy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ay]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:H()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Zt,ie]}],"outline-w":[{outline:[Zt,gn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Zt,gn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xn,ly]}],"shadow-color":[{shadow:[Dr]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",xn,ie]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Mr,ie]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zt,gn,Qs]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},hy=Gx(fy);function F(...e){return hy(Pf(e))}function _t(e){if(e<=0)return"";if(e<1e3)return`#${String(e).padStart(3,"0")}`;const t=e%1e3,n=Math.floor(e/1e3),r=n===9?"X":String.fromCharCode(96+n);return`#${String(t).padStart(3,"0")}${r}`}const gc=ix,Of=nx,If=rx,Fa=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(mf,{ref:r,sideOffset:t,className:F("card-glass z-50 overflow-hidden rounded border bg-popover px-2 py-1 text-xxs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Fa.displayName=mf.displayName;const Gt=Object.create(null);Gt.open="0";Gt.close="1";Gt.ping="2";Gt.pong="3";Gt.message="4";Gt.upgrade="5";Gt.noop="6";const Ki=Object.create(null);Object.keys(Gt).forEach(e=>{Ki[Gt[e]]=e});const Ko={type:"error",data:"parser error"},Lf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ff=typeof ArrayBuffer=="function",Bf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ba=({type:e,data:t},n,r)=>Lf&&t instanceof Blob?n?r(t):xc(t,r):Ff&&(t instanceof ArrayBuffer||Bf(t))?n?r(t):xc(new Blob([t]),r):r(Gt[e]+(t||"")),xc=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function yc(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Zs;function py(e,t){if(Lf&&e.data instanceof Blob)return e.data.arrayBuffer().then(yc).then(t);if(Ff&&(e.data instanceof ArrayBuffer||Bf(e.data)))return t(yc(e.data));Ba(e,!1,n=>{Zs||(Zs=new TextEncoder),t(Zs.encode(n))})}const bc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ur=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<bc.length;e++)Ur[bc.charCodeAt(e)]=e;const my=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=Ur[e.charCodeAt(r)],o=Ur[e.charCodeAt(r+1)],a=Ur[e.charCodeAt(r+2)],l=Ur[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},gy=typeof ArrayBuffer=="function",za=(e,t)=>{if(typeof e!="string")return{type:"message",data:zf(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xy(e.substring(1),t)}:Ki[n]?e.length>1?{type:Ki[n],data:e.substring(1)}:{type:Ki[n]}:Ko},xy=(e,t)=>{if(gy){const n=my(e);return zf(n,t)}else return{base64:!0,data:e}},zf=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Vf="",yy=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Ba(s,!1,a=>{r[o]=a,++i===n&&t(r.join(Vf))})})},by=(e,t)=>{const n=e.split(Vf),r=[];for(let i=0;i<n.length;i++){const s=za(n[i],t);if(r.push(s),s.type==="error")break}return r};function vy(){return new TransformStream({transform(e,t){py(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let eo;function Ai(e){return e.reduce((t,n)=>t+n.length,0)}function _i(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function wy(e,t){eo||(eo=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Ai(n)<1)break;const l=_i(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Ai(n)<2)break;const l=_i(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Ai(n)<8)break;const l=_i(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Ko);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Ai(n)<i)break;const l=_i(n,i);a.enqueue(za(s?l:eo.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Ko);break}}}})}const $f=4;function Ge(e){if(e)return ky(e)}function ky(e){for(var t in Ge.prototype)e[t]=Ge.prototype[t];return e}Ge.prototype.on=Ge.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ge.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ge.prototype.off=Ge.prototype.removeListener=Ge.prototype.removeAllListeners=Ge.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ge.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ge.prototype.emitReserved=Ge.prototype.emit;Ge.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ge.prototype.hasListeners=function(e){return!!this.listeners(e).length};const js=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Pt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Sy="arraybuffer";function Uf(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Cy=Pt.setTimeout,jy=Pt.clearTimeout;function Es(e,t){t.useNativeTimers?(e.setTimeoutFn=Cy.bind(Pt),e.clearTimeoutFn=jy.bind(Pt)):(e.setTimeoutFn=Pt.setTimeout.bind(Pt),e.clearTimeoutFn=Pt.clearTimeout.bind(Pt))}const Ey=1.33;function Ny(e){return typeof e=="string"?Ty(e):Math.ceil((e.byteLength||e.size)*Ey)}function Ty(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Wf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Py(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Ay(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class _y extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Va extends Ge{constructor(t){super(),this.writable=!1,Es(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new _y(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=za(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Py(t);return n.length?"?"+n:""}}class Ry extends Va{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};by(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,yy(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Wf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Hf=!1;try{Hf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const My=Hf;function Dy(){}class Oy extends Ry{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ht extends Ge{constructor(t,n,r){super(),this.createRequest=t,Es(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Uf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ht.requestsCount++,Ht.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Dy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ht.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ht.requestsCount=0;Ht.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vc);else if(typeof addEventListener=="function"){const e="onpagehide"in Pt?"pagehide":"unload";addEventListener(e,vc,!1)}}function vc(){for(let e in Ht.requests)Ht.requests.hasOwnProperty(e)&&Ht.requests[e].abort()}const Iy=(function(){const e=qf({xdomain:!1});return e&&e.responseType!==null})();class Ly extends Oy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Iy&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ht(qf,this.uri(),t)}}function qf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||My))return new XMLHttpRequest}catch{}if(!t)try{return new Pt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Kf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Fy extends Va{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Kf?{}:Uf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ba(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&js(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Wf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const to=Pt.WebSocket||Pt.MozWebSocket;class By extends Fy{createSocket(t,n,r){return Kf?new to(t,n,r):n?new to(t,n):new to(t)}doWrite(t,n){this.ws.send(n)}}class zy extends Va{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=wy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=vy();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&js(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Vy={websocket:By,webtransport:zy,polling:Ly},$y=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Uy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Go(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=$y.exec(e||""),s={},o=14;for(;o--;)s[Uy[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Wy(s,s.path),s.queryKey=Hy(s,s.query),s}function Wy(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Hy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Yo=typeof addEventListener=="function"&&typeof removeEventListener=="function",Gi=[];Yo&&addEventListener("offline",()=>{Gi.forEach(e=>e())},!1);class Sn extends Ge{constructor(t,n){if(super(),this.binaryType=Sy,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Go(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Go(n.host).host);Es(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ay(this.opts.query)),Yo&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Gi.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=$f,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Sn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Sn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Ny(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,js(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Sn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Yo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Gi.indexOf(this._offlineEventListener);r!==-1&&Gi.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sn.protocol=$f;class qy extends Sn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Sn.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Sn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(f){n&&f.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Ky=class extends qy{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Vy[i]).filter(i=>!!i)),super(t,r)}};function Gy(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Go(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Yy=typeof ArrayBuffer=="function",Xy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Gf=Object.prototype.toString,Jy=typeof Blob=="function"||typeof Blob<"u"&&Gf.call(Blob)==="[object BlobConstructor]",Qy=typeof File=="function"||typeof File<"u"&&Gf.call(File)==="[object FileConstructor]";function $a(e){return Yy&&(e instanceof ArrayBuffer||Xy(e))||Jy&&e instanceof Blob||Qy&&e instanceof File}function Yi(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Yi(e[n]))return!0;return!1}if($a(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Yi(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Yi(e[n]))return!0;return!1}function Zy(e){const t=[],n=e.data,r=e;return r.data=Xo(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Xo(e,t){if(!e)return e;if($a(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Xo(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xo(e[r],t));return n}return e}function eb(e,t){return e.data=Jo(e.data,t),delete e.attachments,e}function Jo(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Jo(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Jo(e[n],t));return e}const tb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var le;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(le||(le={}));class nb{constructor(t){this.replacer=t}encode(t){return(t.type===le.EVENT||t.type===le.ACK)&&Yi(t)?this.encodeAsBinary({type:t.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===le.BINARY_EVENT||t.type===le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Zy(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Ua extends Ge{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===le.BINARY_EVENT;r||n.type===le.BINARY_ACK?(n.type=r?le.EVENT:le.ACK,this.reconstructor=new rb(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($a(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===le.BINARY_EVENT||r.type===le.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(o);if(!ib(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Ua.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case le.CONNECT:return wc(n);case le.DISCONNECT:return n===void 0;case le.CONNECT_ERROR:return typeof n=="string"||wc(n);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tb.indexOf(n[0])===-1);case le.ACK:case le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rb{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=eb(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ib=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function wc(e){return Object.prototype.toString.call(e)==="[object Object]"}const sb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ua,Encoder:nb,get PacketType(){return le}},Symbol.toStringTag,{value:"Module"}));function Lt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ob=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Yf extends Ge{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Lt(t,"open",this.onopen.bind(this)),Lt(t,"packet",this.onpacket.bind(this)),Lt(t,"error",this.onerror.bind(this)),Lt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(ob.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:le.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case le.EVENT:case le.BINARY_EVENT:this.onevent(t);break;case le.ACK:case le.BINARY_ACK:this.onack(t);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:le.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Cr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Cr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Cr.prototype.reset=function(){this.attempts=0};Cr.prototype.setMin=function(e){this.ms=e};Cr.prototype.setMax=function(e){this.max=e};Cr.prototype.setJitter=function(e){this.jitter=e};class Qo extends Ge{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Es(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Cr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||sb;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ky(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Lt(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Lt(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Lt(t,"ping",this.onping.bind(this)),Lt(t,"data",this.ondata.bind(this)),Lt(t,"error",this.onerror.bind(this)),Lt(t,"close",this.onclose.bind(this)),Lt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){js(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Yf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Or={};function Xi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Gy(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Or[i]&&s in Or[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Qo(r,t):(Or[i]||(Or[i]=new Qo(r,t)),l=Or[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Xi,{Manager:Qo,Socket:Yf,io:Xi,connect:Xi});const Q=Xi({autoConnect:!0,reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:1/0,reconnectionDelayMax:1e4});function ab(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.version===1&&typeof t.name=="string"&&Array.isArray(t.lists)&&Array.isArray(t.edges)&&t.lists.every(lb)&&t.edges.every(db)&&(t.branchingMode===void 0||t.branchingMode==="trunk"||t.branchingMode==="worktree")}function lb(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.label=="string"&&typeof t.order=="number"&&typeof t.color=="string"&&typeof t.hex=="string"&&typeof t.hasDirectory=="boolean"}const cb={guard:"blocker",gate:"advisor",lifecycle:"operator",observer:"silent"};function ub(e){return cb[e.category]}function db(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.from=="string"&&typeof t.to=="string"&&typeof t.direction=="string"&&typeof t.label=="string"&&typeof t.description=="string"}class fb{constructor(t){yt(this,"config");yt(this,"listMap");yt(this,"edgeMap");yt(this,"edgesByFrom");yt(this,"statusOrder");yt(this,"hookMap");yt(this,"terminalStatuses");yt(this,"allowedPrefixes");this.init(t)}reload(t){this.init(t)}init(t){if(this.config=t,!t.lists.length)throw new Error("WorkflowConfig must have at least 1 list");if(!t.edges.length)throw new Error("WorkflowConfig must have at least 1 edge");const n=t.lists.filter(r=>r.isEntryPoint);if(n.length!==1)throw new Error(`WorkflowConfig must have exactly 1 entry point, found ${n.length}`);this.listMap=new Map(t.lists.map(r=>[r.id,r])),this.edgeMap=new Map(t.edges.map(r=>[`${r.from}:${r.to}`,r])),this.edgesByFrom=new Map;for(const r of t.edges){const i=this.edgesByFrom.get(r.from);i?i.push(r):this.edgesByFrom.set(r.from,[r])}this.statusOrder=new Map(t.lists.map(r=>[r.id,r.order])),this.hookMap=new Map((t.hooks??[]).map(r=>[r.id,r])),this.terminalStatuses=new Set(t.terminalStatuses??[]),this.allowedPrefixes=t.allowedCommandPrefixes??[]}getConfig(){return this.config}getBranchingMode(){return this.config.branchingMode??"trunk"}getLists(){return[...this.config.lists].sort((t,n)=>t.order-n.order)}getList(t){return this.listMap.get(t)}getEntryPoint(){return this.config.lists.find(t=>t.isEntryPoint)}getBatchLists(){return this.config.lists.filter(t=>t.supportsBatch)}getSprintLists(){return this.config.lists.filter(t=>t.supportsSprint)}getBoardColumns(){return this.getLists().map(t=>({id:t.id,label:t.label,color:t.color}))}findEdge(t,n){return this.edgeMap.get(`${t}:${n}`)}isValidTransition(t,n){return this.edgeMap.has(`${t}:${n}`)}getValidTargets(t){return(this.edgesByFrom.get(t)??[]).map(n=>n.to)}getAllEdges(){return this.config.edges}getEdgesByDirection(t){return this.config.edges.filter(n=>n.direction===t)}validateTransition(t,n,r){if(!this.listMap.has(n))return{ok:!1,error:`Invalid status: '${n}'`,code:"INVALID_STATUS"};if(r==="bulk-sync"||r==="rollback")return{ok:!0};if(t===n)return{ok:!0};const i=this.findEdge(t,n);return i?r==="patch"&&i.dispatchOnly?{ok:!1,error:`Transition '${t}' -> '${n}' requires dispatch (use a skill command)`,code:"DISPATCH_REQUIRED"}:{ok:!0}:{ok:!1,error:`Transition '${t}' -> '${n}' is not allowed`,code:"INVALID_TRANSITION"}}isValidStatus(t){return this.listMap.has(t)}isTerminalStatus(t){return this.terminalStatuses.has(t)}buildCommand(t,n){return t.command?t.command.replace("{id}",String(n)):null}isAllowedCommand(t){return this.allowedPrefixes.some(n=>t.startsWith(n))}getBatchTargetStatus(t){const r=(this.edgesByFrom.get(t)??[]).find(i=>(i.direction==="forward"||i.direction==="shortcut")&&i.dispatchOnly);return r==null?void 0:r.to}getBatchCommand(t){const r=(this.edgesByFrom.get(t)??[]).find(i=>(i.direction==="forward"||i.direction==="shortcut")&&i.dispatchOnly);if(r!=null&&r.command)return r.command.replace(" {id}","").replace("{id}","")}inferStatus(t,n,r){var c;const i=(this.config.eventInference??[]).filter(u=>u.eventType===t);if(!i.length)return null;const s=i.filter(u=>u.conditions&&Object.keys(u.conditions).length>0),o=i.filter(u=>!u.conditions||Object.keys(u.conditions).length===0),a=s.find(u=>this.matchesConditions(u.conditions,r))??o[0]??null;if(!a)return null;if(((c=a.conditions)==null?void 0:c.dispatchResolution)===!0)return{dispatchResolution:!0,resolution:r.outcome==="failure"?"failed":"completed"};let l;if(a.targetStatus===""&&a.dataField){const u=String(r[a.dataField]??"");a.dataMap?l=a.dataMap[u]??a.dataMap._default??"":l=u}else l=a.targetStatus;if(!l)return null;if(a.forwardOnly){const u=this.statusOrder.get(n)??-1;if((this.statusOrder.get(l)??-1)<=u)return null}return l}matchesConditions(t,n){for(const[r,i]of Object.entries(t)){if(r==="dispatchResolution")continue;const s=n[r];if(Array.isArray(i)){if(!i.includes(s))return!1}else if(s!==i)return!1}return!0}getListByGitBranch(t){return this.config.lists.find(n=>n.gitBranch===t)}getGitBranch(t){var n;return(n=this.listMap.get(t))==null?void 0:n.gitBranch}getSessionKey(t){var n;return(n=this.listMap.get(t))==null?void 0:n.sessionKey}getActiveHooksForList(t){var n;return((n=this.listMap.get(t))==null?void 0:n.activeHooks)??[]}getAgentsForEdge(t,n){var r;return((r=this.findEdge(t,n))==null?void 0:r.agents)??[]}getStatusOrder(t){return this.statusOrder.get(t)??-1}isForwardMovement(t,n){return this.getStatusOrder(n)>this.getStatusOrder(t)}getHooksForEdge(t,n){var i;const r=this.findEdge(t,n);return(i=r==null?void 0:r.hooks)!=null&&i.length?r.hooks.map(s=>this.hookMap.get(s)).filter(s=>s!==void 0):[]}getAllHooks(){return this.config.hooks??[]}getHookEnforcement(t){return ub(t)}getHooksByCategory(t){return(this.config.hooks??[]).filter(n=>n.category===t)}generateCSSVariables(){return this.getLists().map(t=>`--status-${t.id}: ${t.color};`).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrimitivesConfig-BDKrqwMI.js","assets/ui-QhrRH5wk.js","assets/vendor-Bqt8AJn2.js","assets/workflow-constants-YePmoWgU.js","assets/bot-D2wELs5q.js","assets/useWorkflowEditor-BRepFz22.js","assets/zap-rWDVJHlW.js","assets/file-text-b1U7rP0E.js","assets/arrow-down-CPRn0RJb.js","assets/globe-Dxpor8Dk.js","assets/charts-LGLb8hyU.js","assets/QualityGates-CcrwWI45.js","assets/useSocketListener-BW3fKan5.js","assets/shield-Cgjh9h5t.js","assets/circle-x-CXIlaZex.js","assets/SourceControl-CmrDWqSs.js","assets/key-CBLFsYFp.js","assets/rocket-grx18Wv8.js","assets/SessionTimeline-D2IN9T3a.js","assets/Settings-gAsObGj2.js","assets/minus-pmCQmtIS.js","assets/WorkflowVisualizer-SxM8rp11.js","assets/radio-Cf5n4Vr7.js","assets/WorkflowVisualizer-BZV40eAE.css","assets/Landing-D41fKTK0.js"])))=>i.map(i=>d[i]);
2
+ var Zg=Object.defineProperty;var ex=(e,t,n)=>t in e?Zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yt=(e,t,n)=>ex(e,typeof t!="symbol"?t+"":t,n);import{j as d,C as pf,R as tx,T as nx,P as rx,O as mf,a as ix,b as gf,c as xf,d as sx,e as ox,D as ax,f as lx,g as yf,h as bf,i as cx,u as vf,k as ux,l as dx,m as Kr,n as fx,o as wf,p as hx,F as px,q as mx,r as gx,s as xx,t as yx,v as bx,w as kf,A as Sf,x as vx,y as Cf,V as wx,z as kx,S as jf,B as Sx}from"./ui-QhrRH5wk.js";import{f as Cx,g as Ia,a as m,u as Ef,h as Nf,i as jx,b as ir,N as uc,O as Ex,d as Ie,R as Nx,B as Tx,j as Px,k as Ot,l as dc}from"./vendor-Bqt8AJn2.js";import{c as Tf}from"./charts-LGLb8hyU.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Pi={},fc;function Ax(){if(fc)return Pi;fc=1;var e=Cx();return Pi.createRoot=e.createRoot,Pi.hydrateRoot=e.hydrateRoot,Pi}var _x=Ax();const Rx=Ia(_x),Mx="modulepreload",Dx=function(e){return"/"+e},hc={},qn=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(c=>{if(c=Dx(c),c in hc)return;hc[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":Mx,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},La="-",Ox=e=>{const t=Lx(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(La);return a[0]===""&&a.length!==1&&a.shift(),Pf(a,t)||Ix(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Pf=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Pf(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(La);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},pc=/^\[(.+)\]$/,Ix=e=>{if(pc.test(e)){const t=pc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lx=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Bx(Object.entries(e.classGroups),n).forEach(([s,o])=>{qo(o,r,s,t)}),r},qo=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:mc(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(Fx(i)){qo(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{qo(o,mc(t,s),n,r)})})},mc=(e,t)=>{let n=e;return t.split(La).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fx=e=>e.isThemeGetter,Bx=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,zx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},Af="!",Vx=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let c=0,u=0,f;for(let y=0;y<a.length;y++){let x=a[y];if(c===0){if(x===i&&(r||a.slice(y,y+s)===t)){l.push(a.slice(u,y)),u=y+s;continue}if(x==="/"){f=y;continue}}x==="["?c++:x==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(Af),g=p?h.substring(1):h,b=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:o}):o},$x=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Ux=e=>({cache:zx(e.cacheSize),parseClassName:Vx(e),...Ox(e)}),Wx=/\s+/,Hx=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(Wx);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let g=!!p,b=r(g?h.substring(0,p):h);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=r(h),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const y=$x(u).join(":"),x=f?y+Af:y,w=x+b;if(s.includes(w))continue;s.push(w);const C=i(b,g);for(let E=0;E<C.length;++E){const k=C[E];s.push(x+k)}a=c+(a.length>0?" "+a:a)}return a};function qx(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=_f(t))&&(r&&(r+=" "),r+=n);return r}const _f=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_f(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kx(e,...t){let n,r,i,s=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=Ux(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Hx(l,n);return i(l,u),u}return function(){return s(qx.apply(null,arguments))}}const Ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Gx=/^\d+\/\d+$/,Yx=new Set(["px","full","screen"]),Xx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ey=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>dr(e)||Yx.has(e)||Gx.test(e),gn=e=>Sr(e,"length",ly),dr=e=>!!e&&!Number.isNaN(Number(e)),Qs=e=>Sr(e,"number",dr),Mr=e=>!!e&&Number.isInteger(Number(e)),ty=e=>e.endsWith("%")&&dr(e.slice(0,-1)),ie=e=>Rf.test(e),xn=e=>Xx.test(e),ny=new Set(["length","size","percentage"]),ry=e=>Sr(e,ny,Mf),iy=e=>Sr(e,"position",Mf),sy=new Set(["image","url"]),oy=e=>Sr(e,sy,uy),ay=e=>Sr(e,"",cy),Dr=()=>!0,Sr=(e,t,n)=>{const r=Rf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ly=e=>Jx.test(e)&&!Qx.test(e),Mf=()=>!1,cy=e=>Zx.test(e),uy=e=>ey.test(e),dy=()=>{const e=Ae("colors"),t=Ae("spacing"),n=Ae("blur"),r=Ae("brightness"),i=Ae("borderColor"),s=Ae("borderRadius"),o=Ae("borderSpacing"),a=Ae("borderWidth"),l=Ae("contrast"),c=Ae("grayscale"),u=Ae("hueRotate"),f=Ae("invert"),h=Ae("gap"),p=Ae("gradientColorStops"),g=Ae("gradientColorStopPositions"),b=Ae("inset"),y=Ae("margin"),x=Ae("opacity"),w=Ae("padding"),C=Ae("saturate"),E=Ae("scale"),k=Ae("sepia"),S=Ae("skew"),A=Ae("space"),T=Ae("translate"),R=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ie,t],P=()=>[ie,t],_=()=>["",Zt,gn],L=()=>["auto",dr,ie],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",ie],v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[dr,ie];return{cacheSize:500,separator:":",theme:{colors:[Dr],spacing:[Zt,gn],blur:["none","",xn,ie],brightness:U(),borderColor:[e],borderRadius:["none","","full",xn,ie],borderSpacing:P(),borderWidth:_(),contrast:U(),grayscale:z(),hueRotate:U(),invert:z(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[ty,gn],inset:D(),margin:D(),opacity:U(),padding:P(),saturate:U(),scale:U(),sepia:z(),skew:U(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[xn]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),ie]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mr,ie]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Mr,ie]}],"grid-cols":[{"grid-cols":[Dr]}],"col-start-end":[{col:["auto",{span:["full",Mr,ie]},ie]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Dr]}],"row-start-end":[{row:["auto",{span:[Mr,ie]},ie]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie,t]}],"min-w":[{"min-w":[ie,t,"min","max","fit"]}],"max-w":[{"max-w":[ie,t,"none","full","min","max","fit","prose",{screen:[xn]},xn]}],h:[{h:[ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xn,gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qs]}],"font-family":[{font:[Dr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie]}],"line-clamp":[{"line-clamp":["none",dr,Qs]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zt,ie]}],"list-image":[{"list-image":["none",ie]}],"list-style-type":[{list:["none","disc","decimal",ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zt,gn]}],"underline-offset":[{"underline-offset":["auto",Zt,ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),iy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ry]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:H()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Zt,ie]}],"outline-w":[{outline:[Zt,gn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Zt,gn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xn,ay]}],"shadow-color":[{shadow:[Dr]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",xn,ie]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Mr,ie]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zt,gn,Qs]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},fy=Kx(dy);function F(...e){return fy(Tf(e))}function _t(e){if(e<=0)return"";if(e<1e3)return`#${String(e).padStart(3,"0")}`;const t=e%1e3,n=Math.floor(e/1e3),r=n===9?"X":String.fromCharCode(96+n);return`#${String(t).padStart(3,"0")}${r}`}const hy=rx,Df=tx,Of=nx,Fa=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(pf,{ref:r,sideOffset:t,className:F("card-glass z-50 overflow-hidden rounded border bg-popover px-2 py-1 text-xxs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Fa.displayName=pf.displayName;const Gt=Object.create(null);Gt.open="0";Gt.close="1";Gt.ping="2";Gt.pong="3";Gt.message="4";Gt.upgrade="5";Gt.noop="6";const Ki=Object.create(null);Object.keys(Gt).forEach(e=>{Ki[Gt[e]]=e});const Ko={type:"error",data:"parser error"},If=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Lf=typeof ArrayBuffer=="function",Ff=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ba=({type:e,data:t},n,r)=>If&&t instanceof Blob?n?r(t):gc(t,r):Lf&&(t instanceof ArrayBuffer||Ff(t))?n?r(t):gc(new Blob([t]),r):r(Gt[e]+(t||"")),gc=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function xc(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Zs;function py(e,t){if(If&&e.data instanceof Blob)return e.data.arrayBuffer().then(xc).then(t);if(Lf&&(e.data instanceof ArrayBuffer||Ff(e.data)))return t(xc(e.data));Ba(e,!1,n=>{Zs||(Zs=new TextEncoder),t(Zs.encode(n))})}const yc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ur=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<yc.length;e++)Ur[yc.charCodeAt(e)]=e;const my=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=Ur[e.charCodeAt(r)],o=Ur[e.charCodeAt(r+1)],a=Ur[e.charCodeAt(r+2)],l=Ur[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},gy=typeof ArrayBuffer=="function",za=(e,t)=>{if(typeof e!="string")return{type:"message",data:Bf(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xy(e.substring(1),t)}:Ki[n]?e.length>1?{type:Ki[n],data:e.substring(1)}:{type:Ki[n]}:Ko},xy=(e,t)=>{if(gy){const n=my(e);return Bf(n,t)}else return{base64:!0,data:e}},Bf=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},zf="",yy=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Ba(s,!1,a=>{r[o]=a,++i===n&&t(r.join(zf))})})},by=(e,t)=>{const n=e.split(zf),r=[];for(let i=0;i<n.length;i++){const s=za(n[i],t);if(r.push(s),s.type==="error")break}return r};function vy(){return new TransformStream({transform(e,t){py(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let eo;function Ai(e){return e.reduce((t,n)=>t+n.length,0)}function _i(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function wy(e,t){eo||(eo=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Ai(n)<1)break;const l=_i(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Ai(n)<2)break;const l=_i(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Ai(n)<8)break;const l=_i(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Ko);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Ai(n)<i)break;const l=_i(n,i);a.enqueue(za(s?l:eo.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Ko);break}}}})}const Vf=4;function Ge(e){if(e)return ky(e)}function ky(e){for(var t in Ge.prototype)e[t]=Ge.prototype[t];return e}Ge.prototype.on=Ge.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ge.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ge.prototype.off=Ge.prototype.removeListener=Ge.prototype.removeAllListeners=Ge.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ge.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ge.prototype.emitReserved=Ge.prototype.emit;Ge.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ge.prototype.hasListeners=function(e){return!!this.listeners(e).length};const js=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Pt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Sy="arraybuffer";function $f(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Cy=Pt.setTimeout,jy=Pt.clearTimeout;function Es(e,t){t.useNativeTimers?(e.setTimeoutFn=Cy.bind(Pt),e.clearTimeoutFn=jy.bind(Pt)):(e.setTimeoutFn=Pt.setTimeout.bind(Pt),e.clearTimeoutFn=Pt.clearTimeout.bind(Pt))}const Ey=1.33;function Ny(e){return typeof e=="string"?Ty(e):Math.ceil((e.byteLength||e.size)*Ey)}function Ty(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Uf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Py(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Ay(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class _y extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Va extends Ge{constructor(t){super(),this.writable=!1,Es(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new _y(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=za(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Py(t);return n.length?"?"+n:""}}class Ry extends Va{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};by(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,yy(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Uf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Wf=!1;try{Wf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const My=Wf;function Dy(){}class Oy extends Ry{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ht extends Ge{constructor(t,n,r){super(),this.createRequest=t,Es(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=$f(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ht.requestsCount++,Ht.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Dy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ht.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ht.requestsCount=0;Ht.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bc);else if(typeof addEventListener=="function"){const e="onpagehide"in Pt?"pagehide":"unload";addEventListener(e,bc,!1)}}function bc(){for(let e in Ht.requests)Ht.requests.hasOwnProperty(e)&&Ht.requests[e].abort()}const Iy=(function(){const e=Hf({xdomain:!1});return e&&e.responseType!==null})();class Ly extends Oy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Iy&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ht(Hf,this.uri(),t)}}function Hf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||My))return new XMLHttpRequest}catch{}if(!t)try{return new Pt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const qf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Fy extends Va{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=qf?{}:$f(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ba(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&js(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Uf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const to=Pt.WebSocket||Pt.MozWebSocket;class By extends Fy{createSocket(t,n,r){return qf?new to(t,n,r):n?new to(t,n):new to(t)}doWrite(t,n){this.ws.send(n)}}class zy extends Va{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=wy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=vy();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&js(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Vy={websocket:By,webtransport:zy,polling:Ly},$y=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Uy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Go(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=$y.exec(e||""),s={},o=14;for(;o--;)s[Uy[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Wy(s,s.path),s.queryKey=Hy(s,s.query),s}function Wy(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Hy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Yo=typeof addEventListener=="function"&&typeof removeEventListener=="function",Gi=[];Yo&&addEventListener("offline",()=>{Gi.forEach(e=>e())},!1);class Sn extends Ge{constructor(t,n){if(super(),this.binaryType=Sy,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Go(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Go(n.host).host);Es(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ay(this.opts.query)),Yo&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Gi.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Vf,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Sn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Sn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Ny(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,js(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Sn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Yo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Gi.indexOf(this._offlineEventListener);r!==-1&&Gi.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sn.protocol=Vf;class qy extends Sn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Sn.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Sn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(f){n&&f.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Ky=class extends qy{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Vy[i]).filter(i=>!!i)),super(t,r)}};function Gy(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Go(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Yy=typeof ArrayBuffer=="function",Xy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Kf=Object.prototype.toString,Jy=typeof Blob=="function"||typeof Blob<"u"&&Kf.call(Blob)==="[object BlobConstructor]",Qy=typeof File=="function"||typeof File<"u"&&Kf.call(File)==="[object FileConstructor]";function $a(e){return Yy&&(e instanceof ArrayBuffer||Xy(e))||Jy&&e instanceof Blob||Qy&&e instanceof File}function Yi(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Yi(e[n]))return!0;return!1}if($a(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Yi(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Yi(e[n]))return!0;return!1}function Zy(e){const t=[],n=e.data,r=e;return r.data=Xo(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Xo(e,t){if(!e)return e;if($a(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Xo(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xo(e[r],t));return n}return e}function eb(e,t){return e.data=Jo(e.data,t),delete e.attachments,e}function Jo(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Jo(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Jo(e[n],t));return e}const tb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var le;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(le||(le={}));class nb{constructor(t){this.replacer=t}encode(t){return(t.type===le.EVENT||t.type===le.ACK)&&Yi(t)?this.encodeAsBinary({type:t.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===le.BINARY_EVENT||t.type===le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Zy(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Ua extends Ge{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===le.BINARY_EVENT;r||n.type===le.BINARY_ACK?(n.type=r?le.EVENT:le.ACK,this.reconstructor=new rb(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($a(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===le.BINARY_EVENT||r.type===le.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(o);if(!ib(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Ua.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case le.CONNECT:return vc(n);case le.DISCONNECT:return n===void 0;case le.CONNECT_ERROR:return typeof n=="string"||vc(n);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tb.indexOf(n[0])===-1);case le.ACK:case le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rb{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=eb(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ib=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function vc(e){return Object.prototype.toString.call(e)==="[object Object]"}const sb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ua,Encoder:nb,get PacketType(){return le}},Symbol.toStringTag,{value:"Module"}));function Lt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ob=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Gf extends Ge{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Lt(t,"open",this.onopen.bind(this)),Lt(t,"packet",this.onpacket.bind(this)),Lt(t,"error",this.onerror.bind(this)),Lt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(ob.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:le.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case le.EVENT:case le.BINARY_EVENT:this.onevent(t);break;case le.ACK:case le.BINARY_ACK:this.onack(t);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:le.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Cr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Cr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Cr.prototype.reset=function(){this.attempts=0};Cr.prototype.setMin=function(e){this.ms=e};Cr.prototype.setMax=function(e){this.max=e};Cr.prototype.setJitter=function(e){this.jitter=e};class Qo extends Ge{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Es(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Cr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||sb;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ky(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Lt(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Lt(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Lt(t,"ping",this.onping.bind(this)),Lt(t,"data",this.ondata.bind(this)),Lt(t,"error",this.onerror.bind(this)),Lt(t,"close",this.onclose.bind(this)),Lt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){js(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Gf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Or={};function Xi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Gy(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Or[i]&&s in Or[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Qo(r,t):(Or[i]||(Or[i]=new Qo(r,t)),l=Or[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Xi,{Manager:Qo,Socket:Gf,io:Xi,connect:Xi});const Q=Xi({autoConnect:!0,reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:1/0,reconnectionDelayMax:1e4});function ab(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.version===1&&typeof t.name=="string"&&Array.isArray(t.lists)&&Array.isArray(t.edges)&&t.lists.every(lb)&&t.edges.every(db)&&(t.branchingMode===void 0||t.branchingMode==="trunk"||t.branchingMode==="worktree")}function lb(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.label=="string"&&typeof t.order=="number"&&typeof t.color=="string"&&typeof t.hex=="string"&&typeof t.hasDirectory=="boolean"}const cb={guard:"blocker",gate:"advisor",lifecycle:"operator",observer:"silent"};function ub(e){return cb[e.category]}function db(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.from=="string"&&typeof t.to=="string"&&typeof t.direction=="string"&&typeof t.label=="string"&&typeof t.description=="string"}class fb{constructor(t){yt(this,"config");yt(this,"listMap");yt(this,"edgeMap");yt(this,"edgesByFrom");yt(this,"statusOrder");yt(this,"hookMap");yt(this,"terminalStatuses");yt(this,"allowedPrefixes");this.init(t)}reload(t){this.init(t)}init(t){if(this.config=t,!t.lists.length)throw new Error("WorkflowConfig must have at least 1 list");if(!t.edges.length)throw new Error("WorkflowConfig must have at least 1 edge");const n=t.lists.filter(r=>r.isEntryPoint);if(n.length!==1)throw new Error(`WorkflowConfig must have exactly 1 entry point, found ${n.length}`);this.listMap=new Map(t.lists.map(r=>[r.id,r])),this.edgeMap=new Map(t.edges.map(r=>[`${r.from}:${r.to}`,r])),this.edgesByFrom=new Map;for(const r of t.edges){const i=this.edgesByFrom.get(r.from);i?i.push(r):this.edgesByFrom.set(r.from,[r])}this.statusOrder=new Map(t.lists.map(r=>[r.id,r.order])),this.hookMap=new Map((t.hooks??[]).map(r=>[r.id,r])),this.terminalStatuses=new Set(t.terminalStatuses??[]),this.allowedPrefixes=t.allowedCommandPrefixes??[]}getConfig(){return this.config}getBranchingMode(){return this.config.branchingMode??"trunk"}getLists(){return[...this.config.lists].sort((t,n)=>t.order-n.order)}getList(t){return this.listMap.get(t)}getEntryPoint(){return this.config.lists.find(t=>t.isEntryPoint)}getBatchLists(){return this.config.lists.filter(t=>t.supportsBatch)}getSprintLists(){return this.config.lists.filter(t=>t.supportsSprint)}getBoardColumns(){return this.getLists().map(t=>({id:t.id,label:t.label,color:t.color}))}findEdge(t,n){return this.edgeMap.get(`${t}:${n}`)}isValidTransition(t,n){return this.edgeMap.has(`${t}:${n}`)}getValidTargets(t){return(this.edgesByFrom.get(t)??[]).map(n=>n.to)}getAllEdges(){return this.config.edges}getEdgesByDirection(t){return this.config.edges.filter(n=>n.direction===t)}validateTransition(t,n,r){if(!this.listMap.has(n))return{ok:!1,error:`Invalid status: '${n}'`,code:"INVALID_STATUS"};if(r==="bulk-sync"||r==="rollback")return{ok:!0};if(t===n)return{ok:!0};const i=this.findEdge(t,n);return i?r==="patch"&&i.dispatchOnly?{ok:!1,error:`Transition '${t}' -> '${n}' requires dispatch (use a skill command)`,code:"DISPATCH_REQUIRED"}:{ok:!0}:{ok:!1,error:`Transition '${t}' -> '${n}' is not allowed`,code:"INVALID_TRANSITION"}}isValidStatus(t){return this.listMap.has(t)}isTerminalStatus(t){return this.terminalStatuses.has(t)}buildCommand(t,n){return t.command?t.command.replace("{id}",String(n)):null}isAllowedCommand(t){return this.allowedPrefixes.some(n=>t.startsWith(n))}getBatchTargetStatus(t){const r=(this.edgesByFrom.get(t)??[]).find(i=>(i.direction==="forward"||i.direction==="shortcut")&&i.dispatchOnly);return r==null?void 0:r.to}getBatchCommand(t){const r=(this.edgesByFrom.get(t)??[]).find(i=>(i.direction==="forward"||i.direction==="shortcut")&&i.dispatchOnly);if(r!=null&&r.command)return r.command.replace(" {id}","").replace("{id}","")}inferStatus(t,n,r){var c;const i=(this.config.eventInference??[]).filter(u=>u.eventType===t);if(!i.length)return null;const s=i.filter(u=>u.conditions&&Object.keys(u.conditions).length>0),o=i.filter(u=>!u.conditions||Object.keys(u.conditions).length===0),a=s.find(u=>this.matchesConditions(u.conditions,r))??o[0]??null;if(!a)return null;if(((c=a.conditions)==null?void 0:c.dispatchResolution)===!0)return{dispatchResolution:!0,resolution:r.outcome==="failure"?"failed":"completed"};let l;if(a.targetStatus===""&&a.dataField){const u=String(r[a.dataField]??"");a.dataMap?l=a.dataMap[u]??a.dataMap._default??"":l=u}else l=a.targetStatus;if(!l)return null;if(a.forwardOnly){const u=this.statusOrder.get(n)??-1;if((this.statusOrder.get(l)??-1)<=u)return null}return l}matchesConditions(t,n){for(const[r,i]of Object.entries(t)){if(r==="dispatchResolution")continue;const s=n[r];if(Array.isArray(i)){if(!i.includes(s))return!1}else if(s!==i)return!1}return!0}getListByGitBranch(t){return this.config.lists.find(n=>n.gitBranch===t)}getGitBranch(t){var n;return(n=this.listMap.get(t))==null?void 0:n.gitBranch}getSessionKey(t){var n;return(n=this.listMap.get(t))==null?void 0:n.sessionKey}getActiveHooksForList(t){var n;return((n=this.listMap.get(t))==null?void 0:n.activeHooks)??[]}getAgentsForEdge(t,n){var r;return((r=this.findEdge(t,n))==null?void 0:r.agents)??[]}getStatusOrder(t){return this.statusOrder.get(t)??-1}isForwardMovement(t,n){return this.getStatusOrder(n)>this.getStatusOrder(t)}getHooksForEdge(t,n){var i;const r=this.findEdge(t,n);return(i=r==null?void 0:r.hooks)!=null&&i.length?r.hooks.map(s=>this.hookMap.get(s)).filter(s=>s!==void 0):[]}getAllHooks(){return this.config.hooks??[]}getHookEnforcement(t){return ub(t)}getHooksByCategory(t){return(this.config.hooks??[]).filter(n=>n.category===t)}generateCSSVariables(){return this.getLists().map(t=>`--status-${t.id}: ${t.color};`).join(`
3
3
  `)}generateShellManifest(){const t=[],n=this.getLists();t.push("#!/bin/bash"),t.push("# Auto-generated by WorkflowEngine — DO NOT EDIT"),t.push(`# Generated: ${new Date().toISOString()}`),t.push(`# Workflow: "${this.config.name}" (version ${this.config.version})`),t.push(""),t.push("# ─── Branching mode (trunk or worktree) ───"),t.push(`WORKFLOW_BRANCHING_MODE="${this.getBranchingMode()}"`),t.push(""),t.push("# ─── Valid statuses (space-separated) ───"),t.push(`WORKFLOW_STATUSES="${n.map(i=>i.id).join(" ")}"`),t.push(""),t.push("# ─── Statuses that have a scopes/ subdirectory ───");const r=n.filter(i=>i.hasDirectory).map(i=>i.id);t.push(`WORKFLOW_DIR_STATUSES="${r.join(" ")}"`),t.push(""),t.push("# ─── Terminal statuses ───"),t.push(`WORKFLOW_TERMINAL_STATUSES="${[...this.terminalStatuses].join(" ")}"`),t.push(""),t.push("# ─── Entry point status ───"),t.push(`WORKFLOW_ENTRY_STATUS="${this.getEntryPoint().id}"`),t.push(""),t.push("# ─── Transition edges (from:to:sessionKey) ───"),t.push("WORKFLOW_EDGES=(");for(const i of this.config.edges){const s=this.listMap.get(i.to),o=(s==null?void 0:s.sessionKey)??"";t.push(` "${i.from}:${i.to}:${o}"`)}t.push(")"),t.push(""),t.push("# ─── Branch-to-transition mapping (gitBranch:from:to:sessionKey) ───"),t.push("WORKFLOW_BRANCH_MAP=(");for(const i of this.config.edges){const s=this.listMap.get(i.to);if(s!=null&&s.gitBranch){const o=s.sessionKey??"";t.push(` "${s.gitBranch}:${i.from}:${i.to}:${o}"`)}}t.push(")"),t.push(""),t.push("# ─── Commit session branch patterns (regex) ───"),t.push(`WORKFLOW_COMMIT_BRANCHES="${this.config.commitBranchPatterns??""}"`),t.push(""),t.push("# ─── Backward-compat direction aliases (alias:from:to:sessionKey) ───"),t.push("WORKFLOW_DIRECTION_ALIASES=(");for(const i of this.config.edges){if(i.direction!=="forward"||!i.dispatchOnly)continue;const s=this.listMap.get(i.to);if(!s)continue;const o=s.group;if(o!=null&&o.startsWith("deploy")){const a=s.sessionKey??"";t.push(` "to-${i.to}:${i.from}:${i.to}:${a}"`)}}return t.push(")"),t.push(""),t.push("# ─── Helper functions ──────────────────────────────"),t.push(""),t.push("status_to_dir() {"),t.push(' local scope_status="$1"'),t.push(" for s in $WORKFLOW_DIR_STATUSES; do"),t.push(' [ "$s" = "$scope_status" ] && echo "$scope_status" && return 0'),t.push(" done"),t.push(' echo "$WORKFLOW_ENTRY_STATUS"'),t.push("}"),t.push(""),t.push("status_to_branch() {"),t.push(' local status="$1"'),t.push(' for entry in "${WORKFLOW_BRANCH_MAP[@]}"; do'),t.push(` IFS=':' read -r branch from to skey <<< "$entry"`),t.push(' [ "$to" = "$status" ] && echo "$branch" && return 0'),t.push(" done"),t.push(' echo ""'),t.push("}"),t.push(""),t.push("is_valid_status() {"),t.push(' local status="$1"'),t.push(" for s in $WORKFLOW_STATUSES; do"),t.push(' [ "$s" = "$status" ] && return 0'),t.push(" done"),t.push(" return 1"),t.push("}"),t.join(`
4
4
  `)+`
5
- `}}function Ns(e){m.useEffect(()=>(Q.on("connect",e),()=>{Q.off("connect",e)}),[e]),m.useEffect(()=>{function t(){document.visibilityState==="visible"&&e()}return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[e])}function Xf(e,t=100){const n=m.useRef(e);n.current=e;const r=m.useRef(null);return m.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),m.useCallback(()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,n.current()},t)},[t])}const Jf=m.createContext(null);function hb({children:e}){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=Nf(),a=s.get("project"),l=a==="__all__"?null:a??null,c=m.useCallback(E=>{o(k=>{const S=new URLSearchParams(k);return E===null?S.set("project","__all__"):S.set("project",E),S},{replace:!0})},[o]),u=m.useCallback(async()=>{try{const E=await fetch("/api/orbital/projects?include=workflow");if(!E.ok){n([]),i(!1);return}const k=await E.json();n(k);const S=new Map;for(const A of k)A.workflow&&ab(A.workflow)&&S.set(A.id,new fb(A.workflow));S.size>0&&w(S)}catch{n([])}finally{i(!1)}},[]);m.useEffect(()=>{u()},[u]);const f=m.useRef(!1);m.useEffect(()=>{f.current||a||t.length===0||(f.current=!0,t.length===1&&o(E=>{const k=new URLSearchParams(E);return k.set("project",t[0].id),k},{replace:!0}))},[t,a,o]),m.useEffect(()=>{if(r||!l||t.length===0)return;const E=t.find(k=>k.id===l);(!E||!E.enabled)&&c(null)},[t,l,r,c]);const h=Xf(u);m.useEffect(()=>(Q.on("project:registered",h),Q.on("project:unregistered",h),Q.on("project:status:changed",h),Q.on("project:updated",h),()=>{Q.off("project:registered",h),Q.off("project:unregistered",h),Q.off("project:status:changed",h),Q.off("project:updated",h)}),[h]),m.useEffect(()=>{function E(){l?Q.emit("subscribe",{projectId:l}):Q.emit("subscribe",{scope:"all"})}return E(),Q.on("connect",E),()=>{Q.off("connect",E),l?Q.emit("unsubscribe",{projectId:l}):Q.emit("unsubscribe",{scope:"all"})}},[l]);const p=m.useCallback(E=>{var k;return((k=t.find(S=>S.id===E))==null?void 0:k.color)??"210 80% 55%"},[t]),g=m.useCallback(E=>{var k;return((k=t.find(S=>S.id===E))==null?void 0:k.name)??E},[t]),b=m.useCallback(E=>{const k=E!==void 0?E:l;return k?`/api/orbital/projects/${k}`:"/api/orbital/aggregate"},[l]),y=t.length>1,[x,w]=m.useState(new Map);m.useEffect(()=>(Q.on("workflow:changed",h),()=>{Q.off("workflow:changed",h)}),[h]),Ns(u);const C=m.useMemo(()=>({projects:t,activeProjectId:l,setActiveProjectId:c,getProjectColor:p,getProjectName:g,loading:r,hasMultipleProjects:y,getApiBase:b,projectEngines:x}),[t,l,c,p,g,r,y,b,x]);return d.jsx(Jf.Provider,{value:C,children:e})}function Rt(){const e=m.useContext(Jf);if(!e)throw new Error("useProjects must be used within a ProjectProvider");return e}/**
5
+ `}}function Ns(e){m.useEffect(()=>(Q.on("connect",e),()=>{Q.off("connect",e)}),[e]),m.useEffect(()=>{function t(){document.visibilityState==="visible"&&e()}return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[e])}function Yf(e,t=100){const n=m.useRef(e);n.current=e;const r=m.useRef(null);return m.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),m.useCallback(()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,n.current()},t)},[t])}const Xf=m.createContext(null);function hb({children:e}){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=Ef(),a=s.get("project"),l=a==="__all__"?null:a??null,c=m.useCallback(E=>{o(k=>{const S=new URLSearchParams(k);return E===null?S.set("project","__all__"):S.set("project",E),S},{replace:!0})},[o]),u=m.useCallback(async()=>{try{const E=await fetch("/api/orbital/projects?include=workflow");if(!E.ok){n([]),i(!1);return}const k=await E.json();n(k);const S=new Map;for(const A of k)A.workflow&&ab(A.workflow)&&S.set(A.id,new fb(A.workflow));S.size>0&&w(S)}catch{n([])}finally{i(!1)}},[]);m.useEffect(()=>{u()},[u]);const f=m.useRef(!1);m.useEffect(()=>{f.current||a||t.length===0||(f.current=!0,t.length===1&&o(E=>{const k=new URLSearchParams(E);return k.set("project",t[0].id),k},{replace:!0}))},[t,a,o]),m.useEffect(()=>{if(r||!l||t.length===0)return;const E=t.find(k=>k.id===l);(!E||!E.enabled)&&c(null)},[t,l,r,c]);const h=Yf(u);m.useEffect(()=>(Q.on("project:registered",h),Q.on("project:unregistered",h),Q.on("project:status:changed",h),Q.on("project:updated",h),()=>{Q.off("project:registered",h),Q.off("project:unregistered",h),Q.off("project:status:changed",h),Q.off("project:updated",h)}),[h]),m.useEffect(()=>{function E(){l?Q.emit("subscribe",{projectId:l}):Q.emit("subscribe",{scope:"all"})}return E(),Q.on("connect",E),()=>{Q.off("connect",E),l?Q.emit("unsubscribe",{projectId:l}):Q.emit("unsubscribe",{scope:"all"})}},[l]);const p=m.useCallback(E=>{var k;return((k=t.find(S=>S.id===E))==null?void 0:k.color)??"210 80% 55%"},[t]),g=m.useCallback(E=>{var k;return((k=t.find(S=>S.id===E))==null?void 0:k.name)??E},[t]),b=m.useCallback(E=>{const k=E!==void 0?E:l;return k?`/api/orbital/projects/${k}`:"/api/orbital/aggregate"},[l]),y=t.length>1,[x,w]=m.useState(new Map);m.useEffect(()=>(Q.on("workflow:changed",h),()=>{Q.off("workflow:changed",h)}),[h]),Ns(u);const C=m.useMemo(()=>({projects:t,activeProjectId:l,setActiveProjectId:c,getProjectColor:p,getProjectName:g,loading:r,hasMultipleProjects:y,getApiBase:b,projectEngines:x}),[t,l,c,p,g,r,y,b,x]);return d.jsx(Xf.Provider,{value:C,children:e})}function Rt(){const e=m.useContext(Xf);if(!e)throw new Error("useProjects must be used within a ProjectProvider");return e}/**
6
6
  * @license lucide-react v0.577.0 - ISC
7
7
  *
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
- */const Qf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
10
+ */const Jf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
11
11
  * @license lucide-react v0.577.0 - ISC
12
12
  *
13
13
  * This source code is licensed under the ISC license.
@@ -22,7 +22,7 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the ISC license.
24
24
  * See the LICENSE file in the root directory of this source tree.
25
- */const kc=e=>{const t=mb(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
25
+ */const wc=e=>{const t=mb(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
26
26
  * @license lucide-react v0.577.0 - ISC
27
27
  *
28
28
  * This source code is licensed under the ISC license.
@@ -37,12 +37,12 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
- */const yb=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...gb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Qf("lucide",i),...!s&&!xb(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>m.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
40
+ */const yb=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...gb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Jf("lucide",i),...!s&&!xb(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>m.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
41
41
  * @license lucide-react v0.577.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
- */const te=(e,t)=>{const n=m.forwardRef(({className:r,...i},s)=>m.createElement(yb,{ref:s,iconNode:t,className:Qf(`lucide-${pb(kc(e))}`,`lucide-${e}`,r),...i}));return n.displayName=kc(e),n};/**
45
+ */const te=(e,t)=>{const n=m.forwardRef(({className:r,...i},s)=>m.createElement(yb,{ref:s,iconNode:t,className:Jf(`lucide-${pb(wc(e))}`,`lucide-${e}`,r),...i}));return n.displayName=wc(e),n};/**
46
46
  * @license lucide-react v0.577.0 - ISC
47
47
  *
48
48
  * This source code is licensed under the ISC license.
@@ -62,7 +62,7 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
62
62
  *
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
- */const Sb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zf=te("chevron-down",Sb);/**
65
+ */const Sb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qf=te("chevron-down",Sb);/**
66
66
  * @license lucide-react v0.577.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
@@ -102,7 +102,7 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
102
102
  *
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
- */const Ib=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],eh=te("columns-3",Ib);/**
105
+ */const Ib=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Zf=te("columns-3",Ib);/**
106
106
  * @license lucide-react v0.577.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
@@ -117,17 +117,17 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
117
117
  *
118
118
  * This source code is licensed under the ISC license.
119
119
  * See the LICENSE file in the root directory of this source tree.
120
- */const Vb=[["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"}]],th=te("external-link",Vb);/**
120
+ */const Vb=[["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"}]],eh=te("external-link",Vb);/**
121
121
  * @license lucide-react v0.577.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
- */const $b=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],nh=te("eye-off",$b);/**
125
+ */const $b=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],th=te("eye-off",$b);/**
126
126
  * @license lucide-react v0.577.0 - ISC
127
127
  *
128
128
  * This source code is licensed under the ISC license.
129
129
  * See the LICENSE file in the root directory of this source tree.
130
- */const Ub=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rh=te("eye",Ub);/**
130
+ */const Ub=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],nh=te("eye",Ub);/**
131
131
  * @license lucide-react v0.577.0 - ISC
132
132
  *
133
133
  * This source code is licensed under the ISC license.
@@ -172,7 +172,7 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
172
172
  *
173
173
  * This source code is licensed under the ISC license.
174
174
  * See the LICENSE file in the root directory of this source tree.
175
- */const s0=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],ih=te("layout-dashboard",s0);/**
175
+ */const s0=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],rh=te("layout-dashboard",s0);/**
176
176
  * @license lucide-react v0.577.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
@@ -187,7 +187,7 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
- */const c0=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],sh=te("package",c0);/**
190
+ */const c0=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ih=te("package",c0);/**
191
191
  * @license lucide-react v0.577.0 - ISC
192
192
  *
193
193
  * This source code is licensed under the ISC license.
@@ -212,7 +212,7 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
- */const x0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],oh=te("rows-3",x0);/**
215
+ */const x0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],sh=te("rows-3",x0);/**
216
216
  * @license lucide-react v0.577.0 - ISC
217
217
  *
218
218
  * This source code is licensed under the ISC license.
@@ -287,19 +287,19 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
287
287
  *
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
- */const U0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wt=te("x",U0),an=ox,QD=cx,W0=sx,ZD=yf,ah=m.forwardRef(({className:e,...t},n)=>d.jsx(gf,{ref:n,className:F("fixed inset-0 z-50 bg-black/70 dialog-overlay-glass data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ah.displayName=gf.displayName;const Yt=m.forwardRef(({className:e,children:t,hideCloseButton:n,...r},i)=>d.jsxs(W0,{children:[d.jsx(ah,{}),d.jsxs(xf,{ref:i,className:F("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-full border bg-background shadow-lg duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","card-glass card-glass-heavy rounded border-border",e),...r,children:[t,!n&&d.jsxs(yf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(wt,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Yt.displayName=xf.displayName;function Tn({className:e,...t}){return d.jsx("div",{className:F("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function ln({className:e,...t}){return d.jsx(ax,{className:F("text-sm font-normal leading-none tracking-tight",e),...t})}function cn({className:e,...t}){return d.jsx(lx,{className:F("text-sm text-muted-foreground",e),...t})}function H0(e){const t=q0(e),n=m.forwardRef((r,i)=>{const{children:s,...o}=r,a=m.Children.toArray(s),l=a.find(G0);if(l){const c=l.props.children,u=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:m.isValidElement(c)?m.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function q0(e){const t=m.forwardRef((n,r)=>{const{children:i,...s}=n;if(m.isValidElement(i)){const o=X0(i),a=Y0(s,i.props);return i.type!==m.Fragment&&(a.ref=r?bf(r,o):o),m.cloneElement(i,a)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var K0=Symbol("radix.slottable");function G0(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K0}function Y0(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function X0(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var As="Popover",[lh]=hx(As,[kf]),gi=kf(),[J0,Pn]=lh(As),ch=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=gi(t),l=m.useRef(null),[c,u]=m.useState(!1),[f,h]=yx({prop:r,defaultProp:i??!1,onChange:s,caller:As});return d.jsx(bx,{...a,children:d.jsx(J0,{scope:t,contentId:vx(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})};ch.displayName=As;var uh="PopoverAnchor",Q0=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Pn(uh,n),s=gi(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return m.useEffect(()=>(o(),()=>a()),[o,a]),d.jsx(Cf,{...s,...r,ref:t})});Q0.displayName=uh;var dh="PopoverTrigger",fh=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Pn(dh,n),s=gi(n),o=wf(t,i.triggerRef),a=d.jsx(Sf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xh(i.open),...r,ref:o,onClick:Kr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:d.jsx(Cf,{asChild:!0,...s,children:a})});fh.displayName=dh;var Ha="PopoverPortal",[Z0,ev]=lh(Ha,{forceMount:void 0}),hh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Pn(Ha,t);return d.jsx(Z0,{scope:t,forceMount:n,children:d.jsx(vf,{present:n||s.open,children:d.jsx(ux,{asChild:!0,container:i,children:r})})})};hh.displayName=Ha;var mr="PopoverContent",ph=m.forwardRef((e,t)=>{const n=ev(mr,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Pn(mr,e.__scopePopover);return d.jsx(vf,{present:r||s.open,children:s.modal?d.jsx(nv,{...i,ref:t}):d.jsx(rv,{...i,ref:t})})});ph.displayName=mr;var tv=H0("PopoverContent.RemoveScroll"),nv=m.forwardRef((e,t)=>{const n=Pn(mr,e.__scopePopover),r=m.useRef(null),i=wf(t,r),s=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return dx(o)},[]),d.jsx(fx,{as:tv,allowPinchZoom:!0,children:d.jsx(mh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Kr(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Kr(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Kr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),rv=m.forwardRef((e,t)=>{const n=Pn(mr,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return d.jsx(mh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),mh=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,h=Pn(mr,n),p=gi(n);return px(),d.jsx(mx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(gx,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:d.jsx(xx,{"data-state":xh(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),gh="PopoverClose",iv=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Pn(gh,n);return d.jsx(Sf.button,{type:"button",...r,ref:t,onClick:Kr(e.onClick,()=>i.onOpenChange(!1))})});iv.displayName=gh;var sv="PopoverArrow",ov=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=gi(n);return d.jsx(wx,{...i,...r,ref:t})});ov.displayName=sv;function xh(e){return e?"open":"closed"}var av=ch,lv=fh,cv=hh,yh=ph;const An=av,_n=lv,un=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},i)=>d.jsx(cv,{children:d.jsx(yh,{ref:i,align:t,sideOffset:n,className:F("card-glass z-50 min-w-[180px] rounded border border-border bg-popover p-2 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=top]:slide-in-from-bottom-2",e),...r})}));un.displayName=yh.displayName;const ea=["0 90% 62%","20 95% 60%","40 95% 56%","58 90% 52%","76 85% 50%","100 80% 48%","130 80% 48%","158 85% 46%","178 90% 46%","194 95% 52%","212 90% 60%","232 88% 64%","254 85% 66%","272 85% 64%","292 82% 62%","312 85% 58%","330 88% 58%","348 92% 60%","150 82% 52%","56 95% 62%"];function bh({value:e,onChange:t,disabled:n}){return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsx("button",{disabled:n,className:"h-5 w-5 rounded-full border border-white/20 shrink-0 transition-shadow hover:shadow-[0_0_8px_currentColor] disabled:opacity-50",style:{backgroundColor:`hsl(${e})`},title:"Change color"})}),d.jsx(un,{side:"bottom",align:"start",className:"w-auto p-2",children:d.jsx("div",{className:"grid grid-cols-5 gap-2",children:ea.map(r=>d.jsx("button",{onClick:()=>t(r),className:F("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",r===e?"border-white shadow-[0_0_8px_hsl(var(--primary))]":"border-transparent hover:border-white/40"),style:{backgroundColor:`hsl(${r})`}},r))})})]})}const Sc=[{value:"default",label:"Default",hint:"7 lists, trunk-based — Icebox → Planning → Backlog → Implementing → Review → Completed → Main"},{value:"minimal",label:"Minimal",hint:"3 lists — To Do → In Progress → Done"},{value:"development",label:"Development",hint:"5 lists, dev branch — Backlog → Implementing → Review → Completed → Dev"},{value:"gitflow",label:"Gitflow",hint:"9 lists, multi-branch — Full pipeline with Dev, Staging, and Production"}];function vh({open:e,onClose:t,blocking:n}){var z;const{projects:r}=Rt(),[i,s]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(""),[u,f]=m.useState("default"),[h,p]=m.useState(!1),[g,b]=m.useState("idle"),[y,x]=m.useState(null),[w,C]=m.useState("idle"),[E,k]=m.useState(!1),[S,A]=m.useState(!1),[T,R]=m.useState(!1),[N,D]=m.useState(null),P=m.useRef(null),_=m.useRef(null);m.useEffect(()=>{if(!e)return;const v=r.map(ne=>ne.color),U=ea.filter(ne=>!v.includes(ne));a(U[0]??ea[0]),s(""),c(""),f("default"),p(!1),b("idle"),x(null),C("idle"),k(!1),D(null),A(!1),R(!1)},[e,r]);const L=m.useCallback(v=>{if(P.current&&clearTimeout(P.current),_.current&&_.current.abort(),!v.trim()){b("idle"),x(null),C("idle"),k(!1);return}b("checking"),x(null),C("checking"),P.current=setTimeout(async()=>{const U=new AbortController;_.current=U;try{const j=await(await fetch("/api/orbital/projects/check-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:v}),signal:U.signal})).json();if(U.signal.aborted)return;j.valid?(b("valid"),x(null),C(j.hasGit?"found":"missing"),k(j.alreadyRegistered??!1),!i.trim()&&j.suggestedName&&s(j.suggestedName)):(b("invalid"),x(j.error??"Invalid path"),C("idle"),k(!1))}catch(ne){if(ne.name==="AbortError")return;b("invalid"),x("Failed to validate path"),C("idle")}},400)},[i]);function I(v){c(v),L(v)}async function H(){A(!0);try{const U=await(await fetch("/api/orbital/projects/browse",{method:"POST"})).json();U.path&&(c(U.path),L(U.path))}catch{}finally{A(!1)}}async function M(){R(!0),D(null);try{const v=await fetch("/api/orbital/projects/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:l.trim(),name:i.trim(),color:o,preset:u,initGit:w==="missing"&&h})});if(!v.ok){const U=await v.json().catch(()=>({}));throw new Error(U.error??`Failed to create project (HTTP ${v.status})`)}t()}catch(v){D(v instanceof Error?v.message:"Failed to create project")}finally{R(!1)}}const $=i.trim()!==""&&g==="valid"&&!E&&!T;return d.jsx(an,{open:e,onOpenChange:v=>{!v&&!n&&t()},children:d.jsxs(Yt,{className:"max-w-[480px] max-h-[90vh] p-0 gap-0 flex flex-col",onPointerDownOutside:v=>{n&&v.preventDefault()},onEscapeKeyDown:v=>{n&&v.preventDefault()},hideCloseButton:n,children:[d.jsxs(Tn,{className:"border-b border-white/[0.08] px-5 py-4",children:[d.jsx(ln,{children:"Add Project"}),d.jsx(cn,{className:"text-xs text-muted-foreground",children:"Set up a new project for Orbital Command"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Project Name"}),d.jsx("input",{value:i,onChange:v=>s(v.target.value),placeholder:"My Project",className:"w-full rounded border border-white/[0.12] bg-white/[0.04] px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/40 focus:border-primary/50 transition-colors"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Color"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(bh,{value:o,onChange:a}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Click to change"})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Project Location"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{value:l,onChange:v=>I(v.target.value),placeholder:"/Users/you/Code/my-project",className:F("flex-1 rounded border bg-white/[0.04] px-3 py-2 text-sm font-mono outline-none placeholder:text-muted-foreground/40 transition-colors",g==="valid"&&!E?"border-green-500/30":g==="invalid"?"border-destructive/30":"border-white/[0.12] focus:border-primary/50")}),d.jsxs("button",{onClick:H,disabled:S,className:F("flex items-center gap-1.5 rounded border border-white/[0.12] px-3 py-2 text-xs font-medium","transition-colors hover:bg-white/[0.06] hover:border-primary/30","disabled:opacity-50 disabled:pointer-events-none"),children:[S?d.jsx(fr,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(Hb,{className:"h-3.5 w-3.5"}),S?"Opening...":"Browse"]})]}),y&&d.jsx("p",{className:"text-[11px] text-destructive",children:y}),E&&d.jsx("p",{className:"text-[11px] text-amber-400",children:"This project is already registered"})]}),w!=="idle"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Git Repository"}),w==="checking"&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx(fr,{className:"h-3.5 w-3.5 animate-spin"}),"Checking..."]}),w==="found"&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-400",children:[d.jsx(Kn,{className:"h-3.5 w-3.5"}),"Git repository detected"]}),w==="missing"&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-400",children:[d.jsx(rn,{className:"h-3.5 w-3.5"}),"No git repository found"]}),d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:v=>p(v.target.checked),className:"rounded border-white/20"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Initialize a git repository"})]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Workflow"}),d.jsx("select",{value:u,onChange:v=>f(v.target.value),className:"w-full rounded border border-white/[0.12] bg-white/[0.04] px-3 py-2 text-sm outline-none focus:border-primary/50 transition-colors [&>option]:bg-background",children:Sc.map(v=>d.jsx("option",{value:v.value,children:v.label},v.value))}),d.jsx("p",{className:"text-[10px] text-muted-foreground/60",children:(z=Sc.find(v=>v.value===u))==null?void 0:z.hint})]}),d.jsx("div",{className:"pt-1",children:d.jsxs(Of,{children:[d.jsx(If,{asChild:!0,children:d.jsxs("button",{disabled:!0,className:"flex items-center gap-2 rounded border border-white/[0.08] px-3 py-2 text-xs text-muted-foreground/40 cursor-not-allowed w-full",children:[d.jsx(t0,{className:"h-3.5 w-3.5"}),"Connect GitHub",d.jsx("span",{className:"ml-auto text-[10px] bg-white/[0.06] px-1.5 py-0.5 rounded",children:"Coming soon"})]})}),d.jsx(Fa,{children:"Clone a repository from GitHub — coming in a future update"})]})})]}),d.jsxs("div",{className:"border-t border-white/[0.08] px-5 py-4 space-y-2",children:[N&&d.jsx("p",{className:"text-[11px] text-destructive",children:N}),d.jsx("button",{onClick:M,disabled:!$,className:F("w-full rounded px-4 py-2.5 text-sm font-medium transition-all",$?"bg-primary text-primary-foreground hover:bg-primary/90 shadow-[0_0_12px_hsl(var(--primary)/0.3)]":"bg-white/[0.06] text-muted-foreground/40 cursor-not-allowed"),children:T?d.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d.jsx(fr,{className:"h-4 w-4 animate-spin"}),"Creating project..."]}):"Create Project"})]})]})})}const wh=m.createContext(null);function uv({children:e}){var l;const{activeProjectId:t,projects:n,projectEngines:r,loading:i}=Rt(),s=t??((l=n[0])==null?void 0:l.id)??null;let o=s?r.get(s)??null:null;!o&&r.size>0&&(o=r.values().next().value??null),m.useEffect(()=>{if(!o)return;const c=o.generateCSSVariables();for(const u of c.split(`
291
- `)){const f=u.match(/^(--[\w-]+):\s*(.+);$/);f&&document.documentElement.style.setProperty(f[1],f[2])}},[o]);const a=m.useMemo(()=>o?{engine:o}:null,[o]);return a?d.jsx(wh.Provider,{value:a,children:e}):i?null:n.length===0?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:d.jsx(vh,{open:!0,onClose:()=>{},blocking:!0})}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading workflow..."})]})})}function dn(){const e=m.useContext(wh);if(!e)throw new Error("useWorkflow must be used within a WorkflowProvider");return e}function ce(e){return e.project_id?`${e.project_id}::${e.id}`:String(e.id)}function dv(e){const t=e.indexOf("::");return t>=0?{scopeId:Number(e.slice(t+2)),projectId:e.slice(0,t)}:{scopeId:Number(e)}}const fv={activeScopes:new Set,abandonedScopes:new Map,recoverScope:async()=>{},dismissAbandoned:async()=>{}},kh=m.createContext(fv);function hv(){const{engine:e}=dn(),{getApiBase:t,activeProjectId:n}=Rt(),r=m.useMemo(()=>new Set(e.getConfig().terminalStatuses??[]),[e]),[i,s]=m.useState(new Set),[o,a]=m.useState(new Map),l=m.useRef(!0),c=m.useRef(n);c.current=n;const u=m.useMemo(()=>n?`${t(n)}/dispatch/active-scopes`:"/api/orbital/aggregate/dispatch/active-scopes",[n,t]),f=m.useCallback((y,x)=>ce({id:y,project_id:x??n??void 0}),[n]),h=m.useCallback(y=>{a(x=>{if(!x.has(y))return x;const w=new Map(x);return w.delete(y),w})},[]),p=m.useCallback(async y=>{try{const x=await fetch(u,{signal:y});if(!x.ok){console.warn("[Orbital] Failed to fetch active scopes:",x.status,x.statusText),s(new Set),a(new Map);return}const w=await x.json();if(!l.current)return;const C=new Set;for(const E of w.scope_ids)typeof E=="number"?C.add(f(E)):C.add(ce({id:E.scope_id,project_id:E.project_id}));if(s(C),w.abandoned_scopes){const E=new Map;for(const k of w.abandoned_scopes){const S=k.project_id?ce({id:k.scope_id,project_id:k.project_id}):f(k.scope_id);E.set(S,{from_status:k.from_status,abandoned_at:k.abandoned_at,project_id:k.project_id})}a(E)}}catch(x){if(x instanceof DOMException&&x.name==="AbortError")return;s(new Set),a(new Map)}},[u,f]),g=m.useCallback(async(y,x,w)=>{try{const C=w??n,E=t(C),k=await fetch(`${E}/dispatch/recover/${y}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from_status:x})});if(!k.ok){const A=await k.json().catch(()=>({error:k.statusText}));console.error("[Orbital] Failed to recover scope:",A.error);return}const S=ce({id:y,project_id:C??void 0});h(S)}catch(C){console.error("[Orbital] Failed to recover scope:",C)}},[h,n,t]),b=m.useCallback(async(y,x)=>{try{const w=x??n,C=t(w),E=await fetch(`${C}/dispatch/dismiss-abandoned/${y}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!E.ok){const S=await E.json().catch(()=>({error:E.statusText}));console.error("[Orbital] Failed to dismiss abandoned scope:",S.error);return}const k=ce({id:y,project_id:w??void 0});h(k)}catch(w){console.error("[Orbital] Failed to dismiss abandoned scope:",w)}},[h,n,t]);return m.useEffect(()=>{l.current=!0;const y=new AbortController;return p(y.signal),()=>{l.current=!1,y.abort()}},[p]),m.useEffect(()=>{function y(k){return k.project_id}function x(k){if(k.type!=="DISPATCH"||k.data.resolved!=null)return;const S=y(k),A=[];if(k.scope_id!=null&&A.push(k.scope_id),Array.isArray(k.data.scope_ids))for(const T of k.data.scope_ids)A.includes(T)||A.push(T);if(A.length!==0){s(T=>{const N=A.map(P=>ce({id:P,project_id:S??c.current??void 0})).filter(P=>!T.has(P));if(N.length===0)return T;const D=new Set(T);for(const P of N)D.add(P);return D});for(const T of A)h(ce({id:T,project_id:S??c.current??void 0}))}}function w(k){const S=y(k),A=[];if(k.scope_id!=null&&A.push(k.scope_id),Array.isArray(k.scope_ids)&&A.push(...k.scope_ids),A.length===0)return;const T=A.map(R=>ce({id:R,project_id:S??c.current??void 0}));if(s(R=>{const N=T.filter(P=>R.has(P));if(N.length===0)return R;const D=new Set(R);for(const P of N)D.delete(P);return D}),k.outcome==="abandoned")p();else for(const R of T)h(R)}function C(k){if(r.has(k.status)){const S=y(k),A=ce({id:k.id,project_id:S??k.project_id??c.current??void 0});s(T=>{if(!T.has(A))return T;const R=new Set(T);return R.delete(A),R}),h(A)}}function E(){p()}return Q.on("event:new",x),Q.on("dispatch:resolved",w),Q.on("scope:updated",C),Q.on("connect",E),()=>{Q.off("event:new",x),Q.off("dispatch:resolved",w),Q.off("scope:updated",C),Q.off("connect",E)}},[p,h,r]),{activeScopes:i,abandonedScopes:o,recoverScope:g,dismissAbandoned:b}}function Sh(){return m.useContext(kh)}function $n(e,t,n){const r=(n==null?void 0:n.serialize)??JSON.stringify,i=(n==null?void 0:n.deserialize)??JSON.parse,s=m.useRef(r),o=m.useRef(i);s.current=r,o.current=i;const[a,l]=m.useState(()=>{try{const u=localStorage.getItem(e);if(u!==null){const f=i(u);return f!==void 0?f:t}}catch{}return t}),c=m.useCallback(u=>{l(f=>{const h=typeof u=="function"?u(f):u;try{localStorage.setItem(e,s.current(h))}catch{}return h})},[e]);return m.useEffect(()=>{function u(f){if(f.key===e)try{if(f.newValue!==null){const h=o.current(f.newValue);h!==void 0&&l(h)}else l(t)}catch{}}return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[e,t]),[a,c]}const Ch={serialize:e=>JSON.stringify([...e]),deserialize:e=>{const t=JSON.parse(e);return Array.isArray(t)?new Set(t):void 0}},Jn=[{id:"welcome",target:"nav-kanban",title:"Welcome to Orbital Command",description:"This is your project management dashboard for Claude Code projects. Let's take a quick tour of what everything does.",page:"/"},{id:"kanban-board",target:"kanban-board",title:"Kanban Board",description:"Your scopes are organized into columns that represent workflow stages. Each column maps to a status in your workflow configuration.",page:"/",placement:"right",maxSpotlightWidth:800},{id:"kanban-column",target:"kanban-column",title:"Workflow Columns",description:"Columns are driven by your workflow DAG — transitions between statuses are defined as edges. Drag scopes between columns to update their status.",page:"/",optional:!0,placement:"bottom"},{id:"scope-card",target:"scope-card",title:"Scope Cards",description:"Each card represents a scope — a unit of work with phases, success criteria, and a definition of done. Click a card to see its full details.",page:"/",optional:!0,placement:"bottom"},{id:"nav-primitives",target:"nav-primitives",title:"Primitives",description:"View and manage the building blocks of your project — hooks, skills, agents, and workflow presets that power your Claude Code setup.",page:"/primitives"},{id:"nav-guards",target:"nav-guards",title:"Guards",description:"Quality gates and enforcement rules that run before transitions. Configure type checks, tests, linting, and custom validation commands.",page:"/guards"},{id:"nav-repo",target:"nav-repo",title:"Repo",description:"Source control integration — view branches, recent commits, and GitHub connection status for your project.",page:"/repo"},{id:"nav-sessions",target:"nav-sessions",title:"Sessions",description:"Track Claude Code agent sessions — see what's running, review session history, and monitor dispatch progress in real time.",page:"/sessions"},{id:"nav-workflow",target:"nav-workflow",title:"Workflow",description:"The visual DAG editor for your workflow configuration. Define statuses, transitions, hooks, and event inference rules that drive the Kanban board.",page:"/workflow"},{id:"nav-settings",target:"nav-settings",title:"Settings",description:"Customize appearance, font, zoom level, and other preferences. You can restart this tour anytime from here."}],jh=m.createContext(null),pv={isActive:!1,currentStepIndex:-1,currentStep:null,totalSteps:0,targetElement:null,next:()=>{},back:()=>{},skip:()=>{},restart:()=>{},start:()=>{}};function mv(){return m.useContext(jh)??pv}const gv="cc-onboarding-tour",Cc=5e3;function xv({children:e}){const[t,n]=$n(gv,"pending"),[r,i]=m.useState(-1),[s,o]=m.useState(null),a=Tf(),l=Ex(),c=m.useRef(l);c.current=l;const u=m.useRef(null),f=m.useRef(null),h=m.useRef(!1),p=r>=0&&r<Jn.length,g=m.useCallback(()=>{u.current&&(u.current.disconnect(),u.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),b=m.useCallback(P=>document.querySelector(`[data-tour="${P}"]`),[]),y=m.useCallback((P,_,L)=>{g();const I=b(P.target);if(I){_(I);return}u.current=new MutationObserver(()=>{const H=b(P.target);H&&(g(),_(H))}),u.current.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tour"]}),f.current=setTimeout(()=>{g(),L()},Cc)},[g,b]),x=m.useCallback(P=>{if(h.current)return;if(P<0||P>=Jn.length){i(-1),o(null),g();return}h.current=!0;const _=Jn[P],L=c.current.pathname;_.page&&_.page!==L&&a(_.page+c.current.search),y(_,I=>{h.current=!1,i(P),o(I)},()=>{h.current=!1,_.optional?x(P+1):(console.warn(`[Onboarding] Target "${_.target}" not found after ${Cc}ms on step "${_.id}"`),i(P),o(null))})},[a,y,g]),w=m.useCallback(()=>{const P=r+1;P>=Jn.length?(n("completed"),i(-1),o(null),g(),c.current.pathname!=="/"&&a("/"+c.current.search)):x(P)},[r,n,x,g]),C=m.useCallback(()=>{r>0&&x(r-1)},[r,x]),E=m.useCallback(()=>{n("dismissed"),i(-1),o(null),g()},[n,g]),k=m.useCallback(()=>{n("pending"),x(0)},[n,x]),S=m.useCallback(()=>{p||x(0)},[p,x]);m.useEffect(()=>{if(!p||!s)return;const P=new MutationObserver(()=>{document.body.contains(s)||(o(null),w())});return P.observe(document.body,{childList:!0,subtree:!0}),()=>P.disconnect()},[p,s,w]),m.useEffect(()=>{t!=="pending"&&p&&(i(-1),o(null),g())},[t,p,g]);const{projects:A,loading:T}=Rt(),R=m.useRef(!1);m.useEffect(()=>{if(!R.current&&!T&&A.length!==0&&t==="pending"&&!p){const P=setTimeout(()=>{R.current||(R.current=!0,x(0))},500);return()=>clearTimeout(P)}},[t,p,x,A.length,T]),m.useEffect(()=>()=>g(),[g]);const N=p?Jn[r]:null,D={isActive:p,currentStepIndex:r,currentStep:N,totalSteps:Jn.length,targetElement:s,next:w,back:C,skip:E,restart:k,start:S};return d.jsx(jh.Provider,{value:D,children:e})}class Eh extends m.Component{constructor(){super(...arguments);yt(this,"state",{hasError:!1,error:null});yt(this,"handleReload",()=>{this.setState({hasError:!1,error:null})})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack)}render(){var n;return this.state.hasError?d.jsx("div",{className:"flex h-full items-center justify-center p-8",children:d.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:d.jsx(rn,{className:"h-6 w-6 text-destructive"})}),d.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:((n=this.state.error)==null?void 0:n.message)??"An unexpected error occurred."}),d.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-1.5 rounded bg-surface-light px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-border",children:[d.jsx(g0,{className:"h-3.5 w-3.5"}),"Retry"]})]})}):this.props.children}}function jr(){return m.useEffect(()=>{document.documentElement.setAttribute("data-theme","neon-glass")},[]),{neonGlass:!0}}const jc={fontFamily:"Space Grotesk",fontScale:1.1,reduceMotion:!1,showBackgroundEffects:!0,showStatusBar:!0,compactMode:!1},qa="cc-settings",Nh=[{family:"JetBrains Mono",category:"monospace",label:"JetBrains Mono"},{family:"Space Mono",category:"monospace",label:"Space Mono"},{family:"Fira Code",category:"monospace",label:"Fira Code"},{family:"IBM Plex Mono",category:"monospace",label:"IBM Plex Mono"},{family:"Source Code Pro",category:"monospace",label:"Source Code Pro"},{family:"Space Grotesk",category:"sans-serif",label:"Space Grotesk"},{family:"Inter",category:"sans-serif",label:"Inter"},{family:"Outfit",category:"sans-serif",label:"Outfit"},{family:"Sora",category:"sans-serif",label:"Sora"},{family:"Orbitron",category:"display",label:"Orbitron"},{family:"Exo 2",category:"display",label:"Exo 2"}],no="cc-dynamic-font",Ec="cc-font-previews";function yv(e){if(e==="JetBrains Mono"){const i=document.getElementById(no);i&&i.remove();return}const n=`https://fonts.googleapis.com/css2?family=${e.replace(/ /g,"+")}:wght@300;400;500;600;700&display=swap`;let r=document.getElementById(no);if(r){if(r.href===n)return;r.href=n}else r=document.createElement("link"),r.id=no,r.rel="stylesheet",r.href=n,document.head.appendChild(r)}function e5(){if(document.getElementById(Ec))return;const t=`https://fonts.googleapis.com/css2?${Nh.filter(r=>r.family!=="JetBrains Mono").map(r=>`family=${r.family.replace(/ /g,"+")}:wght@400`).join("&")}&display=swap`,n=document.createElement("link");n.id=Ec,n.rel="stylesheet",n.href=t,document.head.appendChild(n)}function Nc(){try{const e=localStorage.getItem(qa);if(e)return{...jc,...JSON.parse(e)}}catch{}return{...jc}}function bv(e){try{localStorage.setItem(qa,JSON.stringify(e))}catch{}}function ro(e){var r;const t=document.documentElement,n=((r=Nh.find(i=>i.family===e.fontFamily))==null?void 0:r.category)==="monospace"?"monospace":"sans-serif";t.style.setProperty("--font-family",`'${e.fontFamily}', ${n}`),yv(e.fontFamily),t.style.setProperty("--font-scale",e.fontScale.toString()),e.reduceMotion?t.setAttribute("data-reduce-motion","true"):t.removeAttribute("data-reduce-motion"),e.compactMode?t.setAttribute("data-compact","true"):t.removeAttribute("data-compact")}const Th=m.createContext(null);function vv({children:e}){const[t,n]=m.useState(Nc),r=m.useCallback((i,s)=>{n(o=>{const a={...o,[i]:s};return bv(a),ro(a),a})},[]);return m.useEffect(()=>{ro(t)},[]),m.useEffect(()=>{const i=s=>{if(s.key===qa){const o=Nc();n(o),ro(o)}};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),d.jsx(Th.Provider,{value:{settings:t,updateSetting:r},children:e})}function Ka(){const e=m.useContext(Th);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}const gr=m.forwardRef(({className:e,children:t,orientation:n="vertical",...r},i)=>d.jsxs(jf,{ref:i,className:F("relative overflow-hidden",e),...r,children:[d.jsx(kx,{className:"h-full w-full rounded-[inherit]",children:t}),(n==="vertical"||n==="both")&&d.jsx(ta,{orientation:"vertical"}),(n==="horizontal"||n==="both")&&d.jsx(ta,{orientation:"horizontal"}),d.jsx(Sx,{})]}));gr.displayName=jf.displayName;const ta=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>d.jsx(Ef,{ref:r,orientation:t,className:F("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:d.jsx(Cx,{className:"relative flex-1 rounded-full bg-border"})}));ta.displayName=Ef.displayName;function Xt(){const{getApiBase:e,activeProjectId:t}=Rt();return m.useCallback(n=>`${e(t)}${n}`,[e,t])}function wv(e){const[t,n]=m.useState(!0),[r,i]=m.useState(null),s=m.useRef(!0);m.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]),m.useEffect(()=>{const a=new AbortController;return n(!0),i(null),e(a.signal).catch(l=>{l instanceof DOMException&&l.name==="AbortError"||s.current&&i(l instanceof Error?l.message:"Fetch failed")}).finally(()=>{!a.signal.aborted&&s.current&&n(!1)}),()=>a.abort()},[e]);const o=m.useRef(()=>{e(new AbortController().signal).catch(()=>{})});return o.current=()=>{e(new AbortController().signal).catch(()=>{})},Ns(()=>o.current()),{loading:t,error:r,refetch:o.current}}function Ph(){const e=Xt(),{activeProjectId:t}=Rt(),[n,r]=m.useState([]),i=m.useCallback(async()=>{const l=await fetch(e("/scopes"));if(!l.ok)throw new Error(`HTTP ${l.status}`);const c=await l.json();if(t)for(const u of c)u.project_id||(u.project_id=t);r(c)},[e,t]),{loading:s,error:o}=wv(i),a=Xf(i);return m.useEffect(()=>{function l(g){return t?!g.project_id||g.project_id===t:!0}function c(g){l(g)&&(!g.project_id&&t&&(g.project_id=t),r(b=>{const y=b.findIndex(x=>x.id===g.id&&(!g.project_id||x.project_id===g.project_id));if(y>=0){const x=[...b];return x[y]=g,x}return[...b,g].sort((x,w)=>x.id-w.id)}))}function u(g){l(g)&&(!g.project_id&&t&&(g.project_id=t),r(b=>[...b,g].sort((y,x)=>y.id-x.id)))}function f(g){if(!t){a();return}g.project_id&&g.project_id!==t||r(b=>b.filter(y=>y.id!==g.id))}function h(g){if(g.enabled!==void 0&&!(t&&g.id!==t)){if(g.enabled===!1&&g.id===t){r([]);return}a()}}function p(g){t&&g.id!==t||g.status==="active"&&a()}return Q.on("scope:updated",c),Q.on("scope:created",u),Q.on("scope:deleted",f),Q.on("workflow:changed",a),Q.on("project:updated",h),Q.on("project:status:changed",p),()=>{Q.off("scope:updated",c),Q.off("scope:created",u),Q.off("scope:deleted",f),Q.off("workflow:changed",a),Q.off("project:updated",h),Q.off("project:status:changed",p)}},[a,t]),{scopes:n,loading:s,error:o,refetch:i}}const Tc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Pc=Pf,Ah=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Pc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],f=s==null?void 0:s[c];if(u===null)return null;const h=Tc(u)||Tc(f);return i[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(g=>{let[b,y]=g;return Array.isArray(y)?y.includes({...s,...a}[b]):{...s,...a}[b]===y})?[...c,f,h]:c},[]);return Pc(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},kv=Ah("inline-flex items-center rounded border px-1.5 py-0.5 text-xxs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-[#00c85322] text-[#00c853] glow-green",warning:"border-transparent bg-[#ffab0022] text-[#ffab00] glow-amber",error:"border-transparent bg-[#ff174422] text-[#ff1744] glow-red"}},defaultVariants:{variant:"default"}});function Ve({className:e,variant:t,...n}){return d.jsx("div",{className:F(kv({variant:t}),e),...n})}function Sv(){const[e,t]=m.useState(null),[n,r]=m.useState(!1),[i,s]=m.useState(0),[o,a]=m.useState("idle"),[l,c]=m.useState(null),[u,f]=m.useState(!0),h=m.useCallback(async()=>{try{const y=await fetch("/api/orbital/version");if(!y.ok)throw new Error(`HTTP ${y.status}`);const x=await y.json();t(x)}catch{}finally{f(!1)}},[]),p=m.useCallback(async()=>{const y=await fetch("/api/orbital/version/check");if(!y.ok)throw new Error(`HTTP ${y.status}`);const x=await y.json();r(x.updateAvailable),s(x.behindCount)},[]);m.useEffect(()=>{h()},[h]),Ns(h),m.useEffect(()=>{const y=setInterval(async()=>{try{await p()}catch{}},3e5);return()=>clearInterval(y)},[p]),m.useEffect(()=>{function y(w){a(w.stage)}function x(w){w.success?(a("done"),r(!1),s(0),h()):(a("error"),c(w.error??"Unknown error"))}return Q.on("version:updating",y),Q.on("version:updated",x),()=>{Q.off("version:updating",y),Q.off("version:updated",x)}},[]);const g=m.useCallback(async()=>{a("checking"),c(null);try{await p(),a("checked"),setTimeout(()=>a("idle"),4e3)}catch(y){a("error"),c(y.message)}},[p]),b=m.useCallback(async()=>{a("pulling"),c(null);try{const y=await fetch("/api/orbital/version/update",{method:"POST",headers:{"X-Orbital-Action":"update"}});if(!y.ok){const w=await y.json().catch(()=>({error:`HTTP ${y.status}`}));a("error"),c(w.error??"Update failed");return}const x=await y.json().catch(()=>null);x!=null&&x.success&&(a("done"),r(!1),s(0),h())}catch(y){a("error"),c(y.message)}},[h]);return{version:e,updateAvailable:n,behindCount:i,updateStage:o,updateError:l,loading:u,checkForUpdate:g,performUpdate:b}}function Cv(){const{version:e,updateAvailable:t,behindCount:n,updateStage:r,updateError:i,loading:s,checkForUpdate:o,performUpdate:a}=Sv();if(s)return null;if(!e)return d.jsx("button",{className:"version-badge flex items-center gap-1.5 rounded-lg px-2 py-1 text-[10px] font-mono text-muted-foreground/50",children:d.jsx("span",{children:"v?"})});const l=r==="checking"||r==="pulling"||r==="installing";return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsxs("button",{className:"relative cursor-pointer",children:[d.jsxs(Ve,{variant:t?"warning":"success",className:"version-badge font-mono text-[10px] transition-colors",children:["v",e.version]}),t&&d.jsx("span",{className:"version-pulse-dot absolute -top-1 -right-1 h-2 w-2 rounded-full bg-emerald-400"})]})}),d.jsx(un,{side:"top",align:"end",sideOffset:8,className:"w-64 filter-popover-glass",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:"Orbital Command"}),d.jsxs(Ve,{variant:"outline",className:"font-mono text-[10px]",children:["v",e.version]})]}),d.jsxs("div",{className:"space-y-1.5 text-[11px] text-muted-foreground",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Jb,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono",children:e.commitSha})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Yb,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono",children:e.branch})]})]}),t&&r!=="done"&&d.jsxs("div",{className:"rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2 py-1.5 text-[11px] text-emerald-400",children:[n," commit",n!==1?"s":""," behind remote"]}),r==="done"&&d.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2 py-1.5 text-[11px] text-emerald-400",children:[d.jsx(Kn,{className:"h-3 w-3"}),"Updated. Restart server to apply."]}),r==="error"&&d.jsxs("div",{className:"flex items-start gap-1.5 rounded-md border border-destructive/20 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive",children:[d.jsx(Tb,{className:"h-3 w-3 mt-0.5 shrink-0"}),d.jsx("span",{children:i??"An unknown error occurred"})]}),l&&d.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[d.jsx(fr,{className:"h-3 w-3 animate-spin"}),d.jsxs("span",{children:[r==="checking"&&"Checking for updates...",r==="pulling"&&"Pulling latest changes...",r==="installing"&&"Installing dependencies..."]})]}),d.jsxs("div",{className:"flex gap-2 pt-1",children:[d.jsxs("button",{onClick:o,disabled:l,className:F("flex flex-1 items-center justify-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px]","text-muted-foreground hover:text-foreground hover:bg-surface-light transition-colors","disabled:opacity-40 disabled:cursor-not-allowed"),children:[d.jsx(p0,{className:F("h-3 w-3",r==="checking"&&"animate-spin")}),"Check"]}),t&&r!=="done"&&d.jsxs("button",{onClick:a,disabled:l,className:F("flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-[11px]","bg-emerald-500/10 border border-emerald-500/20 text-emerald-400","hover:bg-emerald-500/20 transition-colors","disabled:opacity-40 disabled:cursor-not-allowed"),children:[d.jsx(Fb,{className:"h-3 w-3"}),"Update"]})]})]})})]})}function jv(){const{scopes:e}=Ph(),{engine:t}=dn(),{activeScopes:n}=Sh();jr();const r=Tf(),i=m.useMemo(()=>t.getBoardColumns(),[t]),s=m.useMemo(()=>{const f=new Map;return i.forEach((h,p)=>f.set(h.id,p)),f},[i]),o=m.useMemo(()=>{const f=new Map;for(const h of i)f.set(h.id,h.color);return f},[i]),{inProgress:a,needsAttention:l}=m.useMemo(()=>{const f=[],h=[];for(const p of e)n.has(ce(p))&&(p.blocked_by.length>0?h.push(p):f.push(p));return{inProgress:_c(f,s),needsAttention:_c(h,s)}},[e,n,s]),c=(f,h)=>{f.stopPropagation(),r(`/?highlight=${encodeURIComponent(h)}`)},u=a.size>0||l.size>0;return d.jsx("div",{className:F("fixed bottom-0 left-24 right-0 z-40 border-t border-border bg-surface/95 backdrop-blur-sm","ticker-glass"),children:d.jsxs("div",{className:"flex items-center px-4 py-2",children:[u&&d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4 overflow-x-auto",children:[a.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex-shrink-0 text-xxs uppercase tracking-wider font-normal text-muted-foreground",children:"In Progress"}),d.jsx(Ac,{groups:a,colorMap:o,onClick:c})]}),a.size>0&&l.size>0&&d.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-border"}),l.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex-shrink-0 text-xxs uppercase tracking-wider font-normal text-warning-amber",children:"Needs Attention"}),d.jsx(Ac,{groups:l,colorMap:o,onClick:c})]})]}),!u&&d.jsx("div",{className:"flex-1"}),d.jsx("div",{className:"flex-shrink-0 ml-4",children:d.jsx(Cv,{})})]})})}function Ac({groups:e,colorMap:t,onClick:n}){return d.jsx(d.Fragment,{children:Array.from(e.entries()).map(([r,i])=>{const s=t.get(r)??"220 70% 50%",o=Ev(s);return i.map(a=>d.jsxs("button",{onClick:l=>n(l,ce(a)),className:"flex flex-shrink-0 items-center gap-1.5 rounded-md border px-2 py-0.5 text-xxs transition-colors hover:brightness-125 cursor-pointer",style:{backgroundColor:`${o}15`,borderColor:`${o}40`},children:[d.jsx("span",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{backgroundColor:`hsl(${s})`}}),d.jsxs("span",{className:"max-w-[120px] truncate",children:[_t(a.id)," ",a.title]})]},ce(a)))})})}function _c(e,t){const n=new Map;for(const r of e){const i=n.get(r.status);i?i.push(r):n.set(r.status,[r])}return new Map(Array.from(n.entries()).sort(([r],[i])=>(t.get(r)??999)-(t.get(i)??999)))}function Ev(e){const t=e.match(/[\d.]+/g);if(!t||t.length<3)return"#888888";const n=parseFloat(t[0]),r=parseFloat(t[1])/100,i=parseFloat(t[2])/100,s=r*Math.min(i,1-i),o=a=>{const l=(a+n/30)%12,c=i-s*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*c).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}const en=28,Dn=1,Ln=.12,Nv=.6,Rc=`rgba(255, 255, 255, ${Ln})`,Ri=300,Tv=14,na=en*1.8,Pv=na*na,Mi=80,Mc=1e4,io=800,Av=500,_v=50,Rv=22,Mv=4e3,so={x:-9999,y:-9999};function Dv(){const e=m.useRef(null),t=m.useRef(so),n=m.useRef(!1),r=m.useRef(0),i=m.useRef(so),s=m.useRef(0),o=m.useRef(null),a=m.useRef([]),l=m.useRef(null),c=m.useRef(null);return m.useEffect(()=>{const u=e.current;if(!u)return;const f=u.getContext("2d");if(!f)return;function h(){if(n.current=!1,!f||!u)return;if(f.clearRect(0,0,u.width,u.height),document.documentElement.hasAttribute("data-reduce-motion")){const me=Math.ceil(u.width/en)+1,je=Math.ceil(u.height/en)+1;for(let be=0;be<je;be++)for(let de=0;de<me;de++)f.beginPath(),f.arc(de*en,be*en,Dn,0,Math.PI*2),f.fillStyle=Rc,f.fill();return}const k=t.current.x,S=t.current.y,A=Ri*Ri,T=performance.now();let R=0;{const me=i.current.x,je=i.current.y;if(me>-9e3){const be=k-me,de=S-je,fe=Math.sqrt(be*be+de*de),Ne=Math.min(1,fe/60);s.current=s.current*.7+Ne*.3}i.current={x:k,y:S},R=s.current}const N=1+R*2,D=1+R*.6;let P=-1,_=0;if(k>-9e3){P=T%2e3/1e3*400;const je=Ri*2;_=P<je?1-P/je:0}const L=Math.sqrt(u.width*u.width+u.height*u.height),I=o.current;let H=0,M=!1;if(I)if(I.releaseTime===0)H=Math.min(1,(T-I.startTime)/Mc),M=!0;else{const me=T-I.releaseTime;me<io?(H=I.holdStrength*(1-me/io),M=!0):o.current=null}const $=Mi+H*(L-Mi),z=(I==null?void 0:I.releaseTime)!==0;let v=!1;const U=a.current.filter(me=>T-me.time<Mv);a.current=U;const ne=Math.ceil(u.width/en)+1,j=Math.ceil(u.height/en)+1,K=u.width*.1+450,X=100,W=u.width-350,Le=u.height-100,Ce=600,Re=[];let ge=k>-9e3||M||v||U.length>0;for(let me=0;me<j;me++)for(let je=0;je<ne;je++){const be=je*en,de=me*en,fe=be-k,Ne=de-S,nt=fe*fe+Ne*Ne;let Je=be,Y=de,$e=Rc,ut=Dn;if(_>0&&nt>.01){const Te=Math.sqrt(nt),De=Math.abs(Te-P);if(De<60){const Fe=(1-De/60)*_;Je+=fe/Te*Fe*8,Y+=Ne/Te*Fe*8,$e=`rgba(255, 255, 255, ${Ln+Fe*.2})`,ut=Dn+Fe*.5}}if(M&&I){const Te=be-I.x,De=de-I.y,Fe=Te*Te+De*De,O=z?I.holdRadius:$,B=O*O;if(Fe<B&&Fe>.01){const J=1-Math.sqrt(Fe)/O,re=J*J*J,he=150,Ue=Math.min(be,u.width-be)/he,We=Math.min(de,u.height-de)/he,it=Math.min(1,Math.min(Ue,We));if(z){const xe=(T-I.releaseTime)/io,He=Math.exp(-xe*4),ve=Math.sin(xe*Math.PI*3)*He,Mt=I.holdStrength*re*it*ve;Je+=Te*Mt*.8,Y+=De*Mt*.8;const Vt=re*Math.abs(ve)*.5;$e=`rgba(255, 255, 255, ${Math.min(1,Ln+Vt)})`,ut=Dn+re*Math.abs(ve)*1.2}else{const Be=H*re*it*.95;Je-=Te*Be,Y-=De*Be;const xe=re*H*.3;$e=`rgba(255, 255, 255, ${Ln+xe})`,ut=Dn+re*H*.8}}}for(const Te of U){const De=be-Te.x,Fe=de-Te.y,O=De*De+Fe*Fe;if(O<.01)continue;const B=Math.sqrt(O),J=(T-Te.time)/1e3*Av,re=Math.max(0,1-J/L),he=De/B,Ue=Fe/B,We=-Ue,it=he,Be=_v,xe=B-J;if(Math.abs(xe)<Be*2){const He=xe/(Be*2),ve=Math.max(0,1-Math.abs(He))*re,Mt=Math.cos(He*Math.PI*.5)*ve*Rv;Je+=he*Mt,Y+=Ue*Mt;const Vt=Math.sin(He*Math.PI)*ve*14;Je+=We*Vt,Y+=it*Vt,$e=`rgba(255, 255, 255, ${Math.min(1,Ln+ve*.5)})`,ut=Dn+ve*1}}let Qe=0;if(nt<A){const Te=Math.sqrt(nt),De=1-Te/Ri;Qe=De*De;const Fe=Qe*Tv*N;Te>.1&&(Je+=fe/Te*Fe,Y+=Ne/Te*Fe);const O=Math.min(1,Ln+Qe*(Nv-Ln)*D);ut=Dn+Qe*.6;{const B=be-K,G=de-X,J=Math.sqrt(B*B+G*G),re=Math.max(0,1-J/Ce),he=be-W,Ue=de-Le,We=Math.sqrt(he*he+Ue*Ue),it=Math.max(0,1-We/Ce),Be=Qe*Qe,xe=1+Qe*2,He=Math.min(1,Be*it*xe),ve=Math.min(1,Be*re*xe),Mt=Math.round(255-He*255+ve*-22),Vt=Math.round(255-He*67-ve*225),Rr=Math.round(255-He*43-ve*156);$e=`rgba(${Math.max(0,Math.min(255,Mt))}, ${Math.max(0,Math.min(255,Vt))}, ${Math.max(0,Math.min(255,Rr))}, ${O})`}}Qe>.05&&Re.push({x:Je,y:Y,ease:Qe}),f.beginPath(),f.arc(Je,Y,ut,0,Math.PI*2),f.fillStyle=$e,f.fill()}if(Re.length>1)for(let me=0;me<Re.length;me++)for(let je=me+1;je<Re.length;je++){const be=Re[me],de=Re[je],fe=be.x-de.x,Ne=be.y-de.y,nt=fe*fe+Ne*Ne;if(nt<Pv){const Je=1-Math.sqrt(nt)/na,Y=Math.min(be.ease,de.ease)*Je;f.beginPath(),f.moveTo(be.x,be.y),f.lineTo(de.x,de.y),f.strokeStyle=`rgba(255, 255, 255, ${Y*.25})`,f.lineWidth=.5,f.stroke()}}ge&&(n.current=!0,r.current=requestAnimationFrame(h))}function p(){n.current||(n.current=!0,r.current=requestAnimationFrame(h))}function g(){u&&(u.width=window.innerWidth,u.height=window.innerHeight,p())}function b(E){t.current={x:E.clientX,y:E.clientY};const k=o.current;k&&k.releaseTime===0&&(k.x=E.clientX,k.y=E.clientY),p()}function y(){t.current=so,p()}const x=200;function w(E){const k=E.target,S=k.closest('button, a, input, select, textarea, [role="button"], [role="option"], [role="tab"], [role="menuitem"], [role="checkbox"], [role="radio"], [role="switch"], [role="link"], [role="search"], [data-clickable], [onclick], label'),A=window.getComputedStyle(k).cursor==="pointer";if(S||A)return;const T=performance.now();c.current={x:E.clientX,y:E.clientY,time:T},l.current=setTimeout(()=>{c.current=null,o.current={x:E.clientX,y:E.clientY,startTime:T,releaseTime:0,holdStrength:0,holdRadius:Mi},p()},x)}function C(){l.current&&(clearTimeout(l.current),l.current=null);const E=c.current;E&&(c.current=null,a.current.push({x:E.x,y:E.y,time:performance.now()}));const k=o.current;if(k&&k.releaseTime===0){const S=performance.now(),A=Math.sqrt(window.innerWidth**2+window.innerHeight**2),T=Mc,R=Mi,N=Math.min(1,(S-k.startTime)/T);k.holdStrength=N,k.holdRadius=R+N*(A-R),k.releaseTime=S,a.current.push({x:k.x,y:k.y,time:S})}p()}return g(),p(),window.addEventListener("resize",g),window.addEventListener("mousemove",b),document.addEventListener("mouseleave",y),window.addEventListener("mousedown",w),window.addEventListener("mouseup",C),()=>{cancelAnimationFrame(r.current),l.current&&clearTimeout(l.current),n.current=!1,window.removeEventListener("resize",g),window.removeEventListener("mousemove",b),document.removeEventListener("mouseleave",y),window.removeEventListener("mousedown",w),window.removeEventListener("mouseup",C)}},[]),d.jsx("canvas",{ref:e,className:"neon-grid-canvas",style:{pointerEvents:"none"}})}const et=8,yn=12;function Ov(e,t){const n=e.getBoundingClientRect(),i=!!e.closest("main")?Math.max(t,.1):1;return{top:n.top/i,left:n.left/i,width:n.width/i,height:n.height/i}}function Iv(e,t){return e===t?"w-4 bg-primary":e<t?"w-1.5 bg-primary/40":"w-1.5 bg-muted-foreground/20"}function Lv(){const{isActive:e,currentStep:t,currentStepIndex:n,totalSteps:r,targetElement:i,next:s,back:o,skip:a}=mv(),{settings:l}=Ka(),[c,u]=m.useState(null),f=m.useRef(null),h=m.useRef(null),p=l.reduceMotion,g=l.fontScale,b=m.useCallback(()=>{if(!i){u(null);return}u(Ov(i,g))},[i,g]);m.useEffect(()=>{if(!i){u(null);return}b();const S=new ResizeObserver(()=>{requestAnimationFrame(b)});return S.observe(i),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{S.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[i,b]),m.useEffect(()=>{e&&(h.current=document.activeElement)},[e]),m.useEffect(()=>{e&&f.current&&f.current.focus()},[e,n]);const y=m.useRef(!1);if(m.useEffect(()=>{e?y.current=!0:y.current&&(y.current=!1,h.current&&document.body.contains(h.current)&&h.current.focus(),h.current=null)},[e]),m.useEffect(()=>{if(!e)return;function S(A){if(A.key==="Escape")A.preventDefault(),a();else if(A.key==="ArrowRight")A.preventDefault(),s();else if(A.key==="ArrowLeft")A.preventDefault(),o();else if(A.key==="Tab"){if(!f.current)return;const T=f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(T.length===0)return;const R=T[0],N=T[T.length-1];A.shiftKey?document.activeElement===R&&(A.preventDefault(),N.focus()):document.activeElement===N&&(A.preventDefault(),R.focus())}}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,s,o,a]),!e||!t)return null;const x=t.placement??"right",w=c&&t.maxSpotlightWidth&&c.width>t.maxSpotlightWidth?{...c,width:t.maxSpotlightWidth}:c,C=Fv(w,x),E=w?`polygon(
290
+ */const U0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wt=te("x",U0),an=sx,QD=lx,W0=ix,ZD=xf,oh=m.forwardRef(({className:e,...t},n)=>d.jsx(mf,{ref:n,className:F("fixed inset-0 z-50 bg-black/70 dialog-overlay-glass data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));oh.displayName=mf.displayName;const Yt=m.forwardRef(({className:e,children:t,hideCloseButton:n,...r},i)=>d.jsxs(W0,{children:[d.jsx(oh,{}),d.jsxs(gf,{ref:i,className:F("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-full border bg-background shadow-lg duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","card-glass card-glass-heavy rounded border-border",e),...r,children:[t,!n&&d.jsxs(xf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(wt,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Yt.displayName=gf.displayName;function Tn({className:e,...t}){return d.jsx("div",{className:F("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function ln({className:e,...t}){return d.jsx(ox,{className:F("text-sm font-normal leading-none tracking-tight",e),...t})}function cn({className:e,...t}){return d.jsx(ax,{className:F("text-sm text-muted-foreground",e),...t})}function H0(e){const t=q0(e),n=m.forwardRef((r,i)=>{const{children:s,...o}=r,a=m.Children.toArray(s),l=a.find(G0);if(l){const c=l.props.children,u=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:m.isValidElement(c)?m.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function q0(e){const t=m.forwardRef((n,r)=>{const{children:i,...s}=n;if(m.isValidElement(i)){const o=X0(i),a=Y0(s,i.props);return i.type!==m.Fragment&&(a.ref=r?yf(r,o):o),m.cloneElement(i,a)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var K0=Symbol("radix.slottable");function G0(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K0}function Y0(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function X0(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var As="Popover",[ah]=fx(As,[wf]),gi=wf(),[J0,Pn]=ah(As),lh=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=gi(t),l=m.useRef(null),[c,u]=m.useState(!1),[f,h]=xx({prop:r,defaultProp:i??!1,onChange:s,caller:As});return d.jsx(yx,{...a,children:d.jsx(J0,{scope:t,contentId:bx(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})};lh.displayName=As;var ch="PopoverAnchor",Q0=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Pn(ch,n),s=gi(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return m.useEffect(()=>(o(),()=>a()),[o,a]),d.jsx(Sf,{...s,...r,ref:t})});Q0.displayName=ch;var uh="PopoverTrigger",dh=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Pn(uh,n),s=gi(n),o=vf(t,i.triggerRef),a=d.jsx(kf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":gh(i.open),...r,ref:o,onClick:Kr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:d.jsx(Sf,{asChild:!0,...s,children:a})});dh.displayName=uh;var Ha="PopoverPortal",[Z0,ev]=ah(Ha,{forceMount:void 0}),fh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Pn(Ha,t);return d.jsx(Z0,{scope:t,forceMount:n,children:d.jsx(bf,{present:n||s.open,children:d.jsx(cx,{asChild:!0,container:i,children:r})})})};fh.displayName=Ha;var mr="PopoverContent",hh=m.forwardRef((e,t)=>{const n=ev(mr,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Pn(mr,e.__scopePopover);return d.jsx(bf,{present:r||s.open,children:s.modal?d.jsx(nv,{...i,ref:t}):d.jsx(rv,{...i,ref:t})})});hh.displayName=mr;var tv=H0("PopoverContent.RemoveScroll"),nv=m.forwardRef((e,t)=>{const n=Pn(mr,e.__scopePopover),r=m.useRef(null),i=vf(t,r),s=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return ux(o)},[]),d.jsx(dx,{as:tv,allowPinchZoom:!0,children:d.jsx(ph,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Kr(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Kr(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Kr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),rv=m.forwardRef((e,t)=>{const n=Pn(mr,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return d.jsx(ph,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),ph=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,h=Pn(mr,n),p=gi(n);return hx(),d.jsx(px,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(mx,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:d.jsx(gx,{"data-state":gh(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),mh="PopoverClose",iv=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Pn(mh,n);return d.jsx(kf.button,{type:"button",...r,ref:t,onClick:Kr(e.onClick,()=>i.onOpenChange(!1))})});iv.displayName=mh;var sv="PopoverArrow",ov=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=gi(n);return d.jsx(vx,{...i,...r,ref:t})});ov.displayName=sv;function gh(e){return e?"open":"closed"}var av=lh,lv=dh,cv=fh,xh=hh;const An=av,_n=lv,un=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},i)=>d.jsx(cv,{children:d.jsx(xh,{ref:i,align:t,sideOffset:n,className:F("card-glass z-50 min-w-[180px] rounded border border-border bg-popover p-2 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=top]:slide-in-from-bottom-2",e),...r})}));un.displayName=xh.displayName;const ea=["0 90% 62%","20 95% 60%","40 95% 56%","58 90% 52%","76 85% 50%","100 80% 48%","130 80% 48%","158 85% 46%","178 90% 46%","194 95% 52%","212 90% 60%","232 88% 64%","254 85% 66%","272 85% 64%","292 82% 62%","312 85% 58%","330 88% 58%","348 92% 60%","150 82% 52%","56 95% 62%"];function yh({value:e,onChange:t,disabled:n}){return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsx("button",{disabled:n,className:"h-5 w-5 rounded-full border border-white/20 shrink-0 transition-shadow hover:shadow-[0_0_8px_currentColor] disabled:opacity-50",style:{backgroundColor:`hsl(${e})`},title:"Change color"})}),d.jsx(un,{side:"bottom",align:"start",className:"w-auto p-2",children:d.jsx("div",{className:"grid grid-cols-5 gap-2",children:ea.map(r=>d.jsx("button",{onClick:()=>t(r),className:F("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",r===e?"border-white shadow-[0_0_8px_hsl(var(--primary))]":"border-transparent hover:border-white/40"),style:{backgroundColor:`hsl(${r})`}},r))})})]})}const kc=[{value:"default",label:"Default",hint:"7 lists, trunk-based — Icebox → Planning → Backlog → Implementing → Review → Completed → Main"},{value:"minimal",label:"Minimal",hint:"3 lists — To Do → In Progress → Done"},{value:"development",label:"Development",hint:"5 lists, dev branch — Backlog → Implementing → Review → Completed → Dev"},{value:"gitflow",label:"Gitflow",hint:"9 lists, multi-branch — Full pipeline with Dev, Staging, and Production"}];function bh({open:e,onClose:t,blocking:n}){var z;const{projects:r}=Rt(),[i,s]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(""),[u,f]=m.useState("default"),[h,p]=m.useState(!1),[g,b]=m.useState("idle"),[y,x]=m.useState(null),[w,C]=m.useState("idle"),[E,k]=m.useState(!1),[S,A]=m.useState(!1),[T,R]=m.useState(!1),[N,D]=m.useState(null),P=m.useRef(null),_=m.useRef(null);m.useEffect(()=>{if(!e)return;const v=r.map(ne=>ne.color),U=ea.filter(ne=>!v.includes(ne));a(U[0]??ea[0]),s(""),c(""),f("default"),p(!1),b("idle"),x(null),C("idle"),k(!1),D(null),A(!1),R(!1)},[e,r]);const L=m.useCallback(v=>{if(P.current&&clearTimeout(P.current),_.current&&_.current.abort(),!v.trim()){b("idle"),x(null),C("idle"),k(!1);return}b("checking"),x(null),C("checking"),P.current=setTimeout(async()=>{const U=new AbortController;_.current=U;try{const j=await(await fetch("/api/orbital/projects/check-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:v}),signal:U.signal})).json();if(U.signal.aborted)return;j.valid?(b("valid"),x(null),C(j.hasGit?"found":"missing"),k(j.alreadyRegistered??!1),!i.trim()&&j.suggestedName&&s(j.suggestedName)):(b("invalid"),x(j.error??"Invalid path"),C("idle"),k(!1))}catch(ne){if(ne.name==="AbortError")return;b("invalid"),x("Failed to validate path"),C("idle")}},400)},[i]);function I(v){c(v),L(v)}async function H(){A(!0);try{const U=await(await fetch("/api/orbital/projects/browse",{method:"POST"})).json();U.path&&(c(U.path),L(U.path))}catch{}finally{A(!1)}}async function M(){R(!0),D(null);try{const v=await fetch("/api/orbital/projects/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:l.trim(),name:i.trim(),color:o,preset:u,initGit:w==="missing"&&h})});if(!v.ok){const U=await v.json().catch(()=>({}));throw new Error(U.error??`Failed to create project (HTTP ${v.status})`)}t()}catch(v){D(v instanceof Error?v.message:"Failed to create project")}finally{R(!1)}}const $=i.trim()!==""&&g==="valid"&&!E&&!T;return d.jsx(an,{open:e,onOpenChange:v=>{!v&&!n&&t()},children:d.jsxs(Yt,{className:"max-w-[480px] max-h-[90vh] p-0 gap-0 flex flex-col",onPointerDownOutside:v=>{n&&v.preventDefault()},onEscapeKeyDown:v=>{n&&v.preventDefault()},hideCloseButton:n,children:[d.jsxs(Tn,{className:"border-b border-white/[0.08] px-5 py-4",children:[d.jsx(ln,{children:"Add Project"}),d.jsx(cn,{className:"text-xs text-muted-foreground",children:"Set up a new project for Orbital Command"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Project Name"}),d.jsx("input",{value:i,onChange:v=>s(v.target.value),placeholder:"My Project",className:"w-full rounded border border-white/[0.12] bg-white/[0.04] px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/40 focus:border-primary/50 transition-colors"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Color"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(yh,{value:o,onChange:a}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Click to change"})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Project Location"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{value:l,onChange:v=>I(v.target.value),placeholder:"/Users/you/Code/my-project",className:F("flex-1 rounded border bg-white/[0.04] px-3 py-2 text-sm font-mono outline-none placeholder:text-muted-foreground/40 transition-colors",g==="valid"&&!E?"border-green-500/30":g==="invalid"?"border-destructive/30":"border-white/[0.12] focus:border-primary/50")}),d.jsxs("button",{onClick:H,disabled:S,className:F("flex items-center gap-1.5 rounded border border-white/[0.12] px-3 py-2 text-xs font-medium","transition-colors hover:bg-white/[0.06] hover:border-primary/30","disabled:opacity-50 disabled:pointer-events-none"),children:[S?d.jsx(fr,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(Hb,{className:"h-3.5 w-3.5"}),S?"Opening...":"Browse"]})]}),y&&d.jsx("p",{className:"text-[11px] text-destructive",children:y}),E&&d.jsx("p",{className:"text-[11px] text-amber-400",children:"This project is already registered"})]}),w!=="idle"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Git Repository"}),w==="checking"&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx(fr,{className:"h-3.5 w-3.5 animate-spin"}),"Checking..."]}),w==="found"&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-400",children:[d.jsx(Kn,{className:"h-3.5 w-3.5"}),"Git repository detected"]}),w==="missing"&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-400",children:[d.jsx(rn,{className:"h-3.5 w-3.5"}),"No git repository found"]}),d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:v=>p(v.target.checked),className:"rounded border-white/20"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Initialize a git repository"})]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Workflow"}),d.jsx("select",{value:u,onChange:v=>f(v.target.value),className:"w-full rounded border border-white/[0.12] bg-white/[0.04] px-3 py-2 text-sm outline-none focus:border-primary/50 transition-colors [&>option]:bg-background",children:kc.map(v=>d.jsx("option",{value:v.value,children:v.label},v.value))}),d.jsx("p",{className:"text-[10px] text-muted-foreground/60",children:(z=kc.find(v=>v.value===u))==null?void 0:z.hint})]}),d.jsx("div",{className:"pt-1",children:d.jsxs(Df,{children:[d.jsx(Of,{asChild:!0,children:d.jsxs("button",{disabled:!0,className:"flex items-center gap-2 rounded border border-white/[0.08] px-3 py-2 text-xs text-muted-foreground/40 cursor-not-allowed w-full",children:[d.jsx(t0,{className:"h-3.5 w-3.5"}),"Connect GitHub",d.jsx("span",{className:"ml-auto text-[10px] bg-white/[0.06] px-1.5 py-0.5 rounded",children:"Coming soon"})]})}),d.jsx(Fa,{children:"Clone a repository from GitHub — coming in a future update"})]})})]}),d.jsxs("div",{className:"border-t border-white/[0.08] px-5 py-4 space-y-2",children:[N&&d.jsx("p",{className:"text-[11px] text-destructive",children:N}),d.jsx("button",{onClick:M,disabled:!$,className:F("w-full rounded px-4 py-2.5 text-sm font-medium transition-all",$?"bg-primary text-primary-foreground hover:bg-primary/90 shadow-[0_0_12px_hsl(var(--primary)/0.3)]":"bg-white/[0.06] text-muted-foreground/40 cursor-not-allowed"),children:T?d.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d.jsx(fr,{className:"h-4 w-4 animate-spin"}),"Creating project..."]}):"Create Project"})]})]})})}const vh=m.createContext(null);function uv({children:e}){var l;const{activeProjectId:t,projects:n,projectEngines:r,loading:i}=Rt(),s=t??((l=n[0])==null?void 0:l.id)??null;let o=s?r.get(s)??null:null;!o&&r.size>0&&(o=r.values().next().value??null),m.useEffect(()=>{if(!o)return;const c=o.generateCSSVariables();for(const u of c.split(`
291
+ `)){const f=u.match(/^(--[\w-]+):\s*(.+);$/);f&&document.documentElement.style.setProperty(f[1],f[2])}},[o]);const a=m.useMemo(()=>o?{engine:o}:null,[o]);return a?d.jsx(vh.Provider,{value:a,children:e}):i?null:n.length===0?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:d.jsx(bh,{open:!0,onClose:()=>{},blocking:!0})}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading workflow..."})]})})}function dn(){const e=m.useContext(vh);if(!e)throw new Error("useWorkflow must be used within a WorkflowProvider");return e}function ce(e){return e.project_id?`${e.project_id}::${e.id}`:String(e.id)}function dv(e){const t=e.indexOf("::");return t>=0?{scopeId:Number(e.slice(t+2)),projectId:e.slice(0,t)}:{scopeId:Number(e)}}const fv={activeScopes:new Set,abandonedScopes:new Map,recoverScope:async()=>{},dismissAbandoned:async()=>{}},wh=m.createContext(fv);function hv(){const{engine:e}=dn(),{getApiBase:t,activeProjectId:n}=Rt(),r=m.useMemo(()=>new Set(e.getConfig().terminalStatuses??[]),[e]),[i,s]=m.useState(new Set),[o,a]=m.useState(new Map),l=m.useRef(!0),c=m.useRef(n);c.current=n;const u=m.useMemo(()=>n?`${t(n)}/dispatch/active-scopes`:"/api/orbital/aggregate/dispatch/active-scopes",[n,t]),f=m.useCallback((y,x)=>ce({id:y,project_id:x??n??void 0}),[n]),h=m.useCallback(y=>{a(x=>{if(!x.has(y))return x;const w=new Map(x);return w.delete(y),w})},[]),p=m.useCallback(async y=>{try{const x=await fetch(u,{signal:y});if(!x.ok){console.warn("[Orbital] Failed to fetch active scopes:",x.status,x.statusText),s(new Set),a(new Map);return}const w=await x.json();if(!l.current)return;const C=new Set;for(const E of w.scope_ids)typeof E=="number"?C.add(f(E)):C.add(ce({id:E.scope_id,project_id:E.project_id}));if(s(C),w.abandoned_scopes){const E=new Map;for(const k of w.abandoned_scopes){const S=k.project_id?ce({id:k.scope_id,project_id:k.project_id}):f(k.scope_id);E.set(S,{from_status:k.from_status,abandoned_at:k.abandoned_at,project_id:k.project_id})}a(E)}}catch(x){if(x instanceof DOMException&&x.name==="AbortError")return;s(new Set),a(new Map)}},[u,f]),g=m.useCallback(async(y,x,w)=>{try{const C=w??n,E=t(C),k=await fetch(`${E}/dispatch/recover/${y}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from_status:x})});if(!k.ok){const A=await k.json().catch(()=>({error:k.statusText}));console.error("[Orbital] Failed to recover scope:",A.error);return}const S=ce({id:y,project_id:C??void 0});h(S)}catch(C){console.error("[Orbital] Failed to recover scope:",C)}},[h,n,t]),b=m.useCallback(async(y,x)=>{try{const w=x??n,C=t(w),E=await fetch(`${C}/dispatch/dismiss-abandoned/${y}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!E.ok){const S=await E.json().catch(()=>({error:E.statusText}));console.error("[Orbital] Failed to dismiss abandoned scope:",S.error);return}const k=ce({id:y,project_id:w??void 0});h(k)}catch(w){console.error("[Orbital] Failed to dismiss abandoned scope:",w)}},[h,n,t]);return m.useEffect(()=>{l.current=!0;const y=new AbortController;return p(y.signal),()=>{l.current=!1,y.abort()}},[p]),m.useEffect(()=>{function y(k){return k.project_id}function x(k){if(k.type!=="DISPATCH"||k.data.resolved!=null)return;const S=y(k),A=[];if(k.scope_id!=null&&A.push(k.scope_id),Array.isArray(k.data.scope_ids))for(const T of k.data.scope_ids)A.includes(T)||A.push(T);if(A.length!==0){s(T=>{const N=A.map(P=>ce({id:P,project_id:S??c.current??void 0})).filter(P=>!T.has(P));if(N.length===0)return T;const D=new Set(T);for(const P of N)D.add(P);return D});for(const T of A)h(ce({id:T,project_id:S??c.current??void 0}))}}function w(k){const S=y(k),A=[];if(k.scope_id!=null&&A.push(k.scope_id),Array.isArray(k.scope_ids)&&A.push(...k.scope_ids),A.length===0)return;const T=A.map(R=>ce({id:R,project_id:S??c.current??void 0}));if(s(R=>{const N=T.filter(P=>R.has(P));if(N.length===0)return R;const D=new Set(R);for(const P of N)D.delete(P);return D}),k.outcome==="abandoned")p();else for(const R of T)h(R)}function C(k){if(r.has(k.status)){const S=y(k),A=ce({id:k.id,project_id:S??k.project_id??c.current??void 0});s(T=>{if(!T.has(A))return T;const R=new Set(T);return R.delete(A),R}),h(A)}}function E(){p()}return Q.on("event:new",x),Q.on("dispatch:resolved",w),Q.on("scope:updated",C),Q.on("connect",E),()=>{Q.off("event:new",x),Q.off("dispatch:resolved",w),Q.off("scope:updated",C),Q.off("connect",E)}},[p,h,r]),{activeScopes:i,abandonedScopes:o,recoverScope:g,dismissAbandoned:b}}function kh(){return m.useContext(wh)}function $n(e,t,n){const r=(n==null?void 0:n.serialize)??JSON.stringify,i=(n==null?void 0:n.deserialize)??JSON.parse,s=m.useRef(r),o=m.useRef(i);s.current=r,o.current=i;const[a,l]=m.useState(()=>{try{const u=localStorage.getItem(e);if(u!==null){const f=i(u);return f!==void 0?f:t}}catch{}return t}),c=m.useCallback(u=>{l(f=>{const h=typeof u=="function"?u(f):u;try{localStorage.setItem(e,s.current(h))}catch{}return h})},[e]);return m.useEffect(()=>{function u(f){if(f.key===e)try{if(f.newValue!==null){const h=o.current(f.newValue);h!==void 0&&l(h)}else l(t)}catch{}}return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[e,t]),[a,c]}const Sh={serialize:e=>JSON.stringify([...e]),deserialize:e=>{const t=JSON.parse(e);return Array.isArray(t)?new Set(t):void 0}},Jn=[{id:"welcome",target:"nav-kanban",title:"Welcome to Orbital Command",description:"This is your project management dashboard for Claude Code projects. Let's take a quick tour of what everything does.",page:"/"},{id:"kanban-board",target:"kanban-board",title:"Kanban Board",description:"Your scopes are organized into columns that represent workflow stages. Each column maps to a status in your workflow configuration.",page:"/",placement:"right",maxSpotlightWidth:800},{id:"kanban-column",target:"kanban-column",title:"Workflow Columns",description:"Columns are driven by your workflow DAG — transitions between statuses are defined as edges. Drag scopes between columns to update their status.",page:"/",optional:!0,placement:"bottom"},{id:"scope-card",target:"scope-card",title:"Scope Cards",description:"Each card represents a scope — a unit of work with phases, success criteria, and a definition of done. Click a card to see its full details.",page:"/",optional:!0,placement:"bottom"},{id:"nav-primitives",target:"nav-primitives",title:"Primitives",description:"View and manage the building blocks of your project — hooks, skills, agents, and workflow presets that power your Claude Code setup.",page:"/primitives"},{id:"nav-guards",target:"nav-guards",title:"Guards",description:"Quality gates and enforcement rules that run before transitions. Configure type checks, tests, linting, and custom validation commands.",page:"/guards"},{id:"nav-repo",target:"nav-repo",title:"Repo",description:"Source control integration — view branches, recent commits, and GitHub connection status for your project.",page:"/repo"},{id:"nav-sessions",target:"nav-sessions",title:"Sessions",description:"Track Claude Code agent sessions — see what's running, review session history, and monitor dispatch progress in real time.",page:"/sessions"},{id:"nav-workflow",target:"nav-workflow",title:"Workflow",description:"The visual DAG editor for your workflow configuration. Define statuses, transitions, hooks, and event inference rules that drive the Kanban board.",page:"/workflow"},{id:"nav-settings",target:"nav-settings",title:"Settings",description:"Customize appearance, font, zoom level, and other preferences. You can restart this tour anytime from here."}],Ch=m.createContext(null),pv={isActive:!1,currentStepIndex:-1,currentStep:null,totalSteps:0,targetElement:null,next:()=>{},back:()=>{},skip:()=>{},restart:()=>{},start:()=>{}};function mv(){return m.useContext(Ch)??pv}const gv="cc-onboarding-tour",Sc=5e3;function xv({children:e}){const[t,n]=$n(gv,"pending"),[r,i]=m.useState(-1),[s,o]=m.useState(null),a=Nf(),l=jx(),c=m.useRef(l);c.current=l;const u=m.useRef(null),f=m.useRef(null),h=m.useRef(!1),p=r>=0&&r<Jn.length,g=m.useCallback(()=>{u.current&&(u.current.disconnect(),u.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),b=m.useCallback(P=>document.querySelector(`[data-tour="${P}"]`),[]),y=m.useCallback((P,_,L)=>{g();const I=b(P.target);if(I){_(I);return}u.current=new MutationObserver(()=>{const H=b(P.target);H&&(g(),_(H))}),u.current.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tour"]}),f.current=setTimeout(()=>{g(),L()},Sc)},[g,b]),x=m.useCallback(P=>{if(h.current)return;if(P<0||P>=Jn.length){i(-1),o(null),g();return}h.current=!0;const _=Jn[P],L=c.current.pathname;_.page&&_.page!==L&&a(_.page+c.current.search),y(_,I=>{h.current=!1,i(P),o(I)},()=>{h.current=!1,_.optional?x(P+1):(console.warn(`[Onboarding] Target "${_.target}" not found after ${Sc}ms on step "${_.id}"`),i(P),o(null))})},[a,y,g]),w=m.useCallback(()=>{const P=r+1;P>=Jn.length?(n("completed"),i(-1),o(null),g(),c.current.pathname!=="/"&&a("/"+c.current.search)):x(P)},[r,n,x,g]),C=m.useCallback(()=>{r>0&&x(r-1)},[r,x]),E=m.useCallback(()=>{n("dismissed"),i(-1),o(null),g()},[n,g]),k=m.useCallback(()=>{n("pending"),x(0)},[n,x]),S=m.useCallback(()=>{p||x(0)},[p,x]);m.useEffect(()=>{if(!p||!s)return;const P=new MutationObserver(()=>{document.body.contains(s)||(o(null),w())});return P.observe(document.body,{childList:!0,subtree:!0}),()=>P.disconnect()},[p,s,w]),m.useEffect(()=>{t!=="pending"&&p&&(i(-1),o(null),g())},[t,p,g]);const{projects:A,loading:T}=Rt(),R=m.useRef(!1);m.useEffect(()=>{if(!R.current&&!T&&A.length!==0&&t==="pending"&&!p){const P=setTimeout(()=>{R.current||(R.current=!0,x(0))},500);return()=>clearTimeout(P)}},[t,p,x,A.length,T]),m.useEffect(()=>()=>g(),[g]);const N=p?Jn[r]:null,D={isActive:p,currentStepIndex:r,currentStep:N,totalSteps:Jn.length,targetElement:s,next:w,back:C,skip:E,restart:k,start:S};return d.jsx(Ch.Provider,{value:D,children:e})}class jh extends m.Component{constructor(){super(...arguments);yt(this,"state",{hasError:!1,error:null});yt(this,"handleReload",()=>{this.setState({hasError:!1,error:null})})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack)}render(){var n;return this.state.hasError?d.jsx("div",{className:"flex h-full items-center justify-center p-8",children:d.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:d.jsx(rn,{className:"h-6 w-6 text-destructive"})}),d.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:((n=this.state.error)==null?void 0:n.message)??"An unexpected error occurred."}),d.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-1.5 rounded bg-surface-light px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-border",children:[d.jsx(g0,{className:"h-3.5 w-3.5"}),"Retry"]})]})}):this.props.children}}function jr(){return m.useEffect(()=>{document.documentElement.setAttribute("data-theme","neon-glass")},[]),{neonGlass:!0}}const Cc={fontFamily:"Space Grotesk",fontScale:1.1,reduceMotion:!1,showBackgroundEffects:!0,showStatusBar:!0,compactMode:!1},qa="cc-settings",Eh=[{family:"JetBrains Mono",category:"monospace",label:"JetBrains Mono"},{family:"Space Mono",category:"monospace",label:"Space Mono"},{family:"Fira Code",category:"monospace",label:"Fira Code"},{family:"IBM Plex Mono",category:"monospace",label:"IBM Plex Mono"},{family:"Source Code Pro",category:"monospace",label:"Source Code Pro"},{family:"Space Grotesk",category:"sans-serif",label:"Space Grotesk"},{family:"Inter",category:"sans-serif",label:"Inter"},{family:"Outfit",category:"sans-serif",label:"Outfit"},{family:"Sora",category:"sans-serif",label:"Sora"},{family:"Orbitron",category:"display",label:"Orbitron"},{family:"Exo 2",category:"display",label:"Exo 2"}],no="cc-dynamic-font",jc="cc-font-previews";function yv(e){if(e==="JetBrains Mono"){const i=document.getElementById(no);i&&i.remove();return}const n=`https://fonts.googleapis.com/css2?family=${e.replace(/ /g,"+")}:wght@300;400;500;600;700&display=swap`;let r=document.getElementById(no);if(r){if(r.href===n)return;r.href=n}else r=document.createElement("link"),r.id=no,r.rel="stylesheet",r.href=n,document.head.appendChild(r)}function e5(){if(document.getElementById(jc))return;const t=`https://fonts.googleapis.com/css2?${Eh.filter(r=>r.family!=="JetBrains Mono").map(r=>`family=${r.family.replace(/ /g,"+")}:wght@400`).join("&")}&display=swap`,n=document.createElement("link");n.id=jc,n.rel="stylesheet",n.href=t,document.head.appendChild(n)}function Ec(){try{const e=localStorage.getItem(qa);if(e)return{...Cc,...JSON.parse(e)}}catch{}return{...Cc}}function bv(e){try{localStorage.setItem(qa,JSON.stringify(e))}catch{}}function ro(e){var r;const t=document.documentElement,n=((r=Eh.find(i=>i.family===e.fontFamily))==null?void 0:r.category)==="monospace"?"monospace":"sans-serif";t.style.setProperty("--font-family",`'${e.fontFamily}', ${n}`),yv(e.fontFamily),t.style.setProperty("--font-scale",e.fontScale.toString()),e.reduceMotion?t.setAttribute("data-reduce-motion","true"):t.removeAttribute("data-reduce-motion"),e.compactMode?t.setAttribute("data-compact","true"):t.removeAttribute("data-compact")}const Nh=m.createContext(null);function vv({children:e}){const[t,n]=m.useState(Ec),r=m.useCallback((i,s)=>{n(o=>{const a={...o,[i]:s};return bv(a),ro(a),a})},[]);return m.useEffect(()=>{ro(t)},[]),m.useEffect(()=>{const i=s=>{if(s.key===qa){const o=Ec();n(o),ro(o)}};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),d.jsx(Nh.Provider,{value:{settings:t,updateSetting:r},children:e})}function Ka(){const e=m.useContext(Nh);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}const gr=m.forwardRef(({className:e,children:t,orientation:n="vertical",...r},i)=>d.jsxs(Cf,{ref:i,className:F("relative overflow-hidden",e),...r,children:[d.jsx(wx,{className:"h-full w-full rounded-[inherit]",children:t}),(n==="vertical"||n==="both")&&d.jsx(ta,{orientation:"vertical"}),(n==="horizontal"||n==="both")&&d.jsx(ta,{orientation:"horizontal"}),d.jsx(kx,{})]}));gr.displayName=Cf.displayName;const ta=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>d.jsx(jf,{ref:r,orientation:t,className:F("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:d.jsx(Sx,{className:"relative flex-1 rounded-full bg-border"})}));ta.displayName=jf.displayName;function Xt(){const{getApiBase:e,activeProjectId:t}=Rt();return m.useCallback(n=>`${e(t)}${n}`,[e,t])}function wv(e){const[t,n]=m.useState(!0),[r,i]=m.useState(null),s=m.useRef(!0);m.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]),m.useEffect(()=>{const a=new AbortController;return n(!0),i(null),e(a.signal).catch(l=>{l instanceof DOMException&&l.name==="AbortError"||s.current&&i(l instanceof Error?l.message:"Fetch failed")}).finally(()=>{!a.signal.aborted&&s.current&&n(!1)}),()=>a.abort()},[e]);const o=m.useRef(()=>{e(new AbortController().signal).catch(()=>{})});return o.current=()=>{e(new AbortController().signal).catch(()=>{})},Ns(()=>o.current()),{loading:t,error:r,refetch:o.current}}function Th(){const e=Xt(),{activeProjectId:t}=Rt(),[n,r]=m.useState([]),i=m.useCallback(async()=>{const l=await fetch(e("/scopes"));if(!l.ok)throw new Error(`HTTP ${l.status}`);const c=await l.json();if(t)for(const u of c)u.project_id||(u.project_id=t);r(c)},[e,t]),{loading:s,error:o}=wv(i),a=Yf(i);return m.useEffect(()=>{function l(g){return t?!g.project_id||g.project_id===t:!0}function c(g){l(g)&&(!g.project_id&&t&&(g.project_id=t),r(b=>{const y=b.findIndex(x=>x.id===g.id&&(!g.project_id||x.project_id===g.project_id));if(y>=0){const x=[...b];return x[y]=g,x}return[...b,g].sort((x,w)=>x.id-w.id)}))}function u(g){l(g)&&(!g.project_id&&t&&(g.project_id=t),r(b=>[...b,g].sort((y,x)=>y.id-x.id)))}function f(g){if(!t){a();return}g.project_id&&g.project_id!==t||r(b=>b.filter(y=>y.id!==g.id))}function h(g){if(g.enabled!==void 0&&!(t&&g.id!==t)){if(g.enabled===!1&&g.id===t){r([]);return}a()}}function p(g){t&&g.id!==t||g.status==="active"&&a()}return Q.on("scope:updated",c),Q.on("scope:created",u),Q.on("scope:deleted",f),Q.on("workflow:changed",a),Q.on("project:updated",h),Q.on("project:status:changed",p),()=>{Q.off("scope:updated",c),Q.off("scope:created",u),Q.off("scope:deleted",f),Q.off("workflow:changed",a),Q.off("project:updated",h),Q.off("project:status:changed",p)}},[a,t]),{scopes:n,loading:s,error:o,refetch:i}}const Nc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Tc=Tf,Ph=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Tc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],f=s==null?void 0:s[c];if(u===null)return null;const h=Nc(u)||Nc(f);return i[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(g=>{let[b,y]=g;return Array.isArray(y)?y.includes({...s,...a}[b]):{...s,...a}[b]===y})?[...c,f,h]:c},[]);return Tc(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},kv=Ph("inline-flex items-center rounded border px-1.5 py-0.5 text-xxs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-[#00c85322] text-[#00c853] glow-green",warning:"border-transparent bg-[#ffab0022] text-[#ffab00] glow-amber",error:"border-transparent bg-[#ff174422] text-[#ff1744] glow-red"}},defaultVariants:{variant:"default"}});function Ve({className:e,variant:t,...n}){return d.jsx("div",{className:F(kv({variant:t}),e),...n})}function Sv(){const[e,t]=m.useState(null),[n,r]=m.useState(!1),[i,s]=m.useState(0),[o,a]=m.useState("idle"),[l,c]=m.useState(null),[u,f]=m.useState(!0),h=m.useCallback(async()=>{try{const y=await fetch("/api/orbital/version");if(!y.ok)throw new Error(`HTTP ${y.status}`);const x=await y.json();t(x)}catch{}finally{f(!1)}},[]),p=m.useCallback(async()=>{const y=await fetch("/api/orbital/version/check");if(!y.ok)throw new Error(`HTTP ${y.status}`);const x=await y.json();r(x.updateAvailable),s(x.behindCount)},[]);m.useEffect(()=>{h()},[h]),Ns(h),m.useEffect(()=>{const y=setInterval(async()=>{try{await p()}catch{}},3e5);return()=>clearInterval(y)},[p]),m.useEffect(()=>{function y(w){a(w.stage)}function x(w){w.success?(a("done"),r(!1),s(0),h()):(a("error"),c(w.error??"Unknown error"))}return Q.on("version:updating",y),Q.on("version:updated",x),()=>{Q.off("version:updating",y),Q.off("version:updated",x)}},[]);const g=m.useCallback(async()=>{a("checking"),c(null);try{await p(),a("checked"),setTimeout(()=>a("idle"),4e3)}catch(y){a("error"),c(y.message)}},[p]),b=m.useCallback(async()=>{a("pulling"),c(null);try{const y=await fetch("/api/orbital/version/update",{method:"POST",headers:{"X-Orbital-Action":"update"}});if(!y.ok){const w=await y.json().catch(()=>({error:`HTTP ${y.status}`}));a("error"),c(w.error??"Update failed");return}const x=await y.json().catch(()=>null);x!=null&&x.success&&(a("done"),r(!1),s(0),h())}catch(y){a("error"),c(y.message)}},[h]);return{version:e,updateAvailable:n,behindCount:i,updateStage:o,updateError:l,loading:u,checkForUpdate:g,performUpdate:b}}function Cv(){const{version:e,updateAvailable:t,behindCount:n,updateStage:r,updateError:i,loading:s,checkForUpdate:o,performUpdate:a}=Sv();if(s)return null;if(!e)return d.jsx("button",{className:"version-badge flex items-center gap-1.5 rounded-lg px-2 py-1 text-[10px] font-mono text-muted-foreground/50",children:d.jsx("span",{children:"v?"})});const l=r==="checking"||r==="pulling"||r==="installing";return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsxs("button",{className:"relative cursor-pointer",children:[d.jsxs(Ve,{variant:t?"warning":"success",className:"version-badge font-mono text-[10px] transition-colors",children:["v",e.version]}),t&&d.jsx("span",{className:"version-pulse-dot absolute -top-1 -right-1 h-2 w-2 rounded-full bg-emerald-400"})]})}),d.jsx(un,{side:"top",align:"end",sideOffset:8,className:"w-64 filter-popover-glass",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:"Orbital Command"}),d.jsxs(Ve,{variant:"outline",className:"font-mono text-[10px]",children:["v",e.version]})]}),d.jsxs("div",{className:"space-y-1.5 text-[11px] text-muted-foreground",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Jb,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono",children:e.commitSha})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Yb,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono",children:e.branch})]})]}),t&&r!=="done"&&d.jsxs("div",{className:"rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2 py-1.5 text-[11px] text-emerald-400",children:[n," commit",n!==1?"s":""," behind remote"]}),r==="done"&&d.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2 py-1.5 text-[11px] text-emerald-400",children:[d.jsx(Kn,{className:"h-3 w-3"}),"Updated. Restart server to apply."]}),r==="error"&&d.jsxs("div",{className:"flex items-start gap-1.5 rounded-md border border-destructive/20 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive",children:[d.jsx(Tb,{className:"h-3 w-3 mt-0.5 shrink-0"}),d.jsx("span",{children:i??"An unknown error occurred"})]}),l&&d.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[d.jsx(fr,{className:"h-3 w-3 animate-spin"}),d.jsxs("span",{children:[r==="checking"&&"Checking for updates...",r==="pulling"&&"Pulling latest changes...",r==="installing"&&"Installing dependencies..."]})]}),d.jsxs("div",{className:"flex gap-2 pt-1",children:[d.jsxs("button",{onClick:o,disabled:l,className:F("flex flex-1 items-center justify-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px]","text-muted-foreground hover:text-foreground hover:bg-surface-light transition-colors","disabled:opacity-40 disabled:cursor-not-allowed"),children:[d.jsx(p0,{className:F("h-3 w-3",r==="checking"&&"animate-spin")}),"Check"]}),t&&r!=="done"&&d.jsxs("button",{onClick:a,disabled:l,className:F("flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-[11px]","bg-emerald-500/10 border border-emerald-500/20 text-emerald-400","hover:bg-emerald-500/20 transition-colors","disabled:opacity-40 disabled:cursor-not-allowed"),children:[d.jsx(Fb,{className:"h-3 w-3"}),"Update"]})]})]})})]})}function jv(){const{scopes:e}=Th(),{engine:t}=dn(),{activeScopes:n}=kh();jr();const r=Nf(),i=m.useMemo(()=>t.getBoardColumns(),[t]),s=m.useMemo(()=>{const f=new Map;return i.forEach((h,p)=>f.set(h.id,p)),f},[i]),o=m.useMemo(()=>{const f=new Map;for(const h of i)f.set(h.id,h.color);return f},[i]),{inProgress:a,needsAttention:l}=m.useMemo(()=>{const f=[],h=[];for(const p of e)n.has(ce(p))&&(p.blocked_by.length>0?h.push(p):f.push(p));return{inProgress:Ac(f,s),needsAttention:Ac(h,s)}},[e,n,s]),c=(f,h)=>{f.stopPropagation(),r(`/?highlight=${encodeURIComponent(h)}`)},u=a.size>0||l.size>0;return d.jsx("div",{className:F("fixed bottom-0 left-24 right-0 z-40 border-t border-border bg-surface/95 backdrop-blur-sm","ticker-glass"),children:d.jsxs("div",{className:"flex items-center px-4 py-2",children:[u&&d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4 overflow-x-auto",children:[a.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex-shrink-0 text-xxs uppercase tracking-wider font-normal text-muted-foreground",children:"In Progress"}),d.jsx(Pc,{groups:a,colorMap:o,onClick:c})]}),a.size>0&&l.size>0&&d.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-border"}),l.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex-shrink-0 text-xxs uppercase tracking-wider font-normal text-warning-amber",children:"Needs Attention"}),d.jsx(Pc,{groups:l,colorMap:o,onClick:c})]})]}),!u&&d.jsx("div",{className:"flex-1"}),d.jsx("div",{className:"flex-shrink-0 ml-4",children:d.jsx(Cv,{})})]})})}function Pc({groups:e,colorMap:t,onClick:n}){return d.jsx(d.Fragment,{children:Array.from(e.entries()).map(([r,i])=>{const s=t.get(r)??"220 70% 50%",o=Ev(s);return i.map(a=>d.jsxs("button",{onClick:l=>n(l,ce(a)),className:"flex flex-shrink-0 items-center gap-1.5 rounded-md border px-2 py-0.5 text-xxs transition-colors hover:brightness-125 cursor-pointer",style:{backgroundColor:`${o}15`,borderColor:`${o}40`},children:[d.jsx("span",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{backgroundColor:`hsl(${s})`}}),d.jsxs("span",{className:"max-w-[120px] truncate",children:[_t(a.id)," ",a.title]})]},ce(a)))})})}function Ac(e,t){const n=new Map;for(const r of e){const i=n.get(r.status);i?i.push(r):n.set(r.status,[r])}return new Map(Array.from(n.entries()).sort(([r],[i])=>(t.get(r)??999)-(t.get(i)??999)))}function Ev(e){const t=e.match(/[\d.]+/g);if(!t||t.length<3)return"#888888";const n=parseFloat(t[0]),r=parseFloat(t[1])/100,i=parseFloat(t[2])/100,s=r*Math.min(i,1-i),o=a=>{const l=(a+n/30)%12,c=i-s*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*c).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}const en=28,Dn=1,Ln=.12,Nv=.6,_c=`rgba(255, 255, 255, ${Ln})`,Ri=300,Tv=14,na=en*1.8,Pv=na*na,Mi=80,Rc=1e4,io=800,Av=500,_v=50,Rv=22,Mv=4e3,so={x:-9999,y:-9999};function Dv(){const e=m.useRef(null),t=m.useRef(so),n=m.useRef(!1),r=m.useRef(0),i=m.useRef(so),s=m.useRef(0),o=m.useRef(null),a=m.useRef([]),l=m.useRef(null),c=m.useRef(null);return m.useEffect(()=>{const u=e.current;if(!u)return;const f=u.getContext("2d");if(!f)return;function h(){if(n.current=!1,!f||!u)return;if(f.clearRect(0,0,u.width,u.height),document.documentElement.hasAttribute("data-reduce-motion")){const me=Math.ceil(u.width/en)+1,je=Math.ceil(u.height/en)+1;for(let be=0;be<je;be++)for(let de=0;de<me;de++)f.beginPath(),f.arc(de*en,be*en,Dn,0,Math.PI*2),f.fillStyle=_c,f.fill();return}const k=t.current.x,S=t.current.y,A=Ri*Ri,T=performance.now();let R=0;{const me=i.current.x,je=i.current.y;if(me>-9e3){const be=k-me,de=S-je,fe=Math.sqrt(be*be+de*de),Ne=Math.min(1,fe/60);s.current=s.current*.7+Ne*.3}i.current={x:k,y:S},R=s.current}const N=1+R*2,D=1+R*.6;let P=-1,_=0;if(k>-9e3){P=T%2e3/1e3*400;const je=Ri*2;_=P<je?1-P/je:0}const L=Math.sqrt(u.width*u.width+u.height*u.height),I=o.current;let H=0,M=!1;if(I)if(I.releaseTime===0)H=Math.min(1,(T-I.startTime)/Rc),M=!0;else{const me=T-I.releaseTime;me<io?(H=I.holdStrength*(1-me/io),M=!0):o.current=null}const $=Mi+H*(L-Mi),z=(I==null?void 0:I.releaseTime)!==0;let v=!1;const U=a.current.filter(me=>T-me.time<Mv);a.current=U;const ne=Math.ceil(u.width/en)+1,j=Math.ceil(u.height/en)+1,K=u.width*.1+450,X=100,W=u.width-350,Le=u.height-100,Ce=600,Re=[];let ge=k>-9e3||M||v||U.length>0;for(let me=0;me<j;me++)for(let je=0;je<ne;je++){const be=je*en,de=me*en,fe=be-k,Ne=de-S,nt=fe*fe+Ne*Ne;let Je=be,Y=de,$e=_c,ut=Dn;if(_>0&&nt>.01){const Te=Math.sqrt(nt),De=Math.abs(Te-P);if(De<60){const Fe=(1-De/60)*_;Je+=fe/Te*Fe*8,Y+=Ne/Te*Fe*8,$e=`rgba(255, 255, 255, ${Ln+Fe*.2})`,ut=Dn+Fe*.5}}if(M&&I){const Te=be-I.x,De=de-I.y,Fe=Te*Te+De*De,O=z?I.holdRadius:$,B=O*O;if(Fe<B&&Fe>.01){const J=1-Math.sqrt(Fe)/O,re=J*J*J,he=150,Ue=Math.min(be,u.width-be)/he,We=Math.min(de,u.height-de)/he,it=Math.min(1,Math.min(Ue,We));if(z){const xe=(T-I.releaseTime)/io,He=Math.exp(-xe*4),ve=Math.sin(xe*Math.PI*3)*He,Mt=I.holdStrength*re*it*ve;Je+=Te*Mt*.8,Y+=De*Mt*.8;const Vt=re*Math.abs(ve)*.5;$e=`rgba(255, 255, 255, ${Math.min(1,Ln+Vt)})`,ut=Dn+re*Math.abs(ve)*1.2}else{const Be=H*re*it*.95;Je-=Te*Be,Y-=De*Be;const xe=re*H*.3;$e=`rgba(255, 255, 255, ${Ln+xe})`,ut=Dn+re*H*.8}}}for(const Te of U){const De=be-Te.x,Fe=de-Te.y,O=De*De+Fe*Fe;if(O<.01)continue;const B=Math.sqrt(O),J=(T-Te.time)/1e3*Av,re=Math.max(0,1-J/L),he=De/B,Ue=Fe/B,We=-Ue,it=he,Be=_v,xe=B-J;if(Math.abs(xe)<Be*2){const He=xe/(Be*2),ve=Math.max(0,1-Math.abs(He))*re,Mt=Math.cos(He*Math.PI*.5)*ve*Rv;Je+=he*Mt,Y+=Ue*Mt;const Vt=Math.sin(He*Math.PI)*ve*14;Je+=We*Vt,Y+=it*Vt,$e=`rgba(255, 255, 255, ${Math.min(1,Ln+ve*.5)})`,ut=Dn+ve*1}}let Qe=0;if(nt<A){const Te=Math.sqrt(nt),De=1-Te/Ri;Qe=De*De;const Fe=Qe*Tv*N;Te>.1&&(Je+=fe/Te*Fe,Y+=Ne/Te*Fe);const O=Math.min(1,Ln+Qe*(Nv-Ln)*D);ut=Dn+Qe*.6;{const B=be-K,G=de-X,J=Math.sqrt(B*B+G*G),re=Math.max(0,1-J/Ce),he=be-W,Ue=de-Le,We=Math.sqrt(he*he+Ue*Ue),it=Math.max(0,1-We/Ce),Be=Qe*Qe,xe=1+Qe*2,He=Math.min(1,Be*it*xe),ve=Math.min(1,Be*re*xe),Mt=Math.round(255-He*255+ve*-22),Vt=Math.round(255-He*67-ve*225),Rr=Math.round(255-He*43-ve*156);$e=`rgba(${Math.max(0,Math.min(255,Mt))}, ${Math.max(0,Math.min(255,Vt))}, ${Math.max(0,Math.min(255,Rr))}, ${O})`}}Qe>.05&&Re.push({x:Je,y:Y,ease:Qe}),f.beginPath(),f.arc(Je,Y,ut,0,Math.PI*2),f.fillStyle=$e,f.fill()}if(Re.length>1)for(let me=0;me<Re.length;me++)for(let je=me+1;je<Re.length;je++){const be=Re[me],de=Re[je],fe=be.x-de.x,Ne=be.y-de.y,nt=fe*fe+Ne*Ne;if(nt<Pv){const Je=1-Math.sqrt(nt)/na,Y=Math.min(be.ease,de.ease)*Je;f.beginPath(),f.moveTo(be.x,be.y),f.lineTo(de.x,de.y),f.strokeStyle=`rgba(255, 255, 255, ${Y*.25})`,f.lineWidth=.5,f.stroke()}}ge&&(n.current=!0,r.current=requestAnimationFrame(h))}function p(){n.current||(n.current=!0,r.current=requestAnimationFrame(h))}function g(){u&&(u.width=window.innerWidth,u.height=window.innerHeight,p())}function b(E){t.current={x:E.clientX,y:E.clientY};const k=o.current;k&&k.releaseTime===0&&(k.x=E.clientX,k.y=E.clientY),p()}function y(){t.current=so,p()}const x=200;function w(E){const k=E.target,S=k.closest('button, a, input, select, textarea, [role="button"], [role="option"], [role="tab"], [role="menuitem"], [role="checkbox"], [role="radio"], [role="switch"], [role="link"], [role="search"], [data-clickable], [onclick], label'),A=window.getComputedStyle(k).cursor==="pointer";if(S||A)return;const T=performance.now();c.current={x:E.clientX,y:E.clientY,time:T},l.current=setTimeout(()=>{c.current=null,o.current={x:E.clientX,y:E.clientY,startTime:T,releaseTime:0,holdStrength:0,holdRadius:Mi},p()},x)}function C(){l.current&&(clearTimeout(l.current),l.current=null);const E=c.current;E&&(c.current=null,a.current.push({x:E.x,y:E.y,time:performance.now()}));const k=o.current;if(k&&k.releaseTime===0){const S=performance.now(),A=Math.sqrt(window.innerWidth**2+window.innerHeight**2),T=Rc,R=Mi,N=Math.min(1,(S-k.startTime)/T);k.holdStrength=N,k.holdRadius=R+N*(A-R),k.releaseTime=S,a.current.push({x:k.x,y:k.y,time:S})}p()}return g(),p(),window.addEventListener("resize",g),window.addEventListener("mousemove",b),document.addEventListener("mouseleave",y),window.addEventListener("mousedown",w),window.addEventListener("mouseup",C),()=>{cancelAnimationFrame(r.current),l.current&&clearTimeout(l.current),n.current=!1,window.removeEventListener("resize",g),window.removeEventListener("mousemove",b),document.removeEventListener("mouseleave",y),window.removeEventListener("mousedown",w),window.removeEventListener("mouseup",C)}},[]),d.jsx("canvas",{ref:e,className:"neon-grid-canvas",style:{pointerEvents:"none"}})}const et=8,yn=12;function Ov(e,t){const n=e.getBoundingClientRect(),i=!!e.closest("main")?Math.max(t,.1):1;return{top:n.top/i,left:n.left/i,width:n.width/i,height:n.height/i}}function Iv(e,t){return e===t?"w-4 bg-primary":e<t?"w-1.5 bg-primary/40":"w-1.5 bg-muted-foreground/20"}function Lv(){const{isActive:e,currentStep:t,currentStepIndex:n,totalSteps:r,targetElement:i,next:s,back:o,skip:a}=mv(),{settings:l}=Ka(),[c,u]=m.useState(null),f=m.useRef(null),h=m.useRef(null),p=l.reduceMotion,g=l.fontScale,b=m.useCallback(()=>{if(!i){u(null);return}u(Ov(i,g))},[i,g]);m.useEffect(()=>{if(!i){u(null);return}b();const S=new ResizeObserver(()=>{requestAnimationFrame(b)});return S.observe(i),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{S.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[i,b]),m.useEffect(()=>{e&&(h.current=document.activeElement)},[e]),m.useEffect(()=>{e&&f.current&&f.current.focus()},[e,n]);const y=m.useRef(!1);if(m.useEffect(()=>{e?y.current=!0:y.current&&(y.current=!1,h.current&&document.body.contains(h.current)&&h.current.focus(),h.current=null)},[e]),m.useEffect(()=>{if(!e)return;function S(A){if(A.key==="Escape")A.preventDefault(),a();else if(A.key==="ArrowRight")A.preventDefault(),s();else if(A.key==="ArrowLeft")A.preventDefault(),o();else if(A.key==="Tab"){if(!f.current)return;const T=f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(T.length===0)return;const R=T[0],N=T[T.length-1];A.shiftKey?document.activeElement===R&&(A.preventDefault(),N.focus()):document.activeElement===N&&(A.preventDefault(),R.focus())}}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,s,o,a]),!e||!t)return null;const x=t.placement??"right",w=c&&t.maxSpotlightWidth&&c.width>t.maxSpotlightWidth?{...c,width:t.maxSpotlightWidth}:c,C=Fv(w,x),E=w?`polygon(
292
292
  0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
293
293
  ${w.left-et}px ${w.top-et}px,
294
294
  ${w.left+w.width+et}px ${w.top-et}px,
295
295
  ${w.left+w.width+et}px ${w.top+w.height+et}px,
296
296
  ${w.left-et}px ${w.top+w.height+et}px,
297
297
  ${w.left-et}px ${w.top-et}px
298
- )`:void 0,k=p?"none":"clip-path 0.3s ease-out";return ir.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[70]",role:"dialog","aria-modal":"true","aria-labelledby":"tour-step-title","aria-describedby":"tour-step-desc",children:[d.jsx("div",{className:"absolute inset-0 dialog-overlay-glass",style:{clipPath:E,transition:k},onClick:a}),d.jsxs("div",{ref:f,tabIndex:-1,className:"card-glass absolute rounded-xl p-5 shadow-lg outline-none",style:{...C,maxWidth:360,minWidth:280,transition:p?"none":"top 0.3s ease-out, left 0.3s ease-out"},children:[d.jsx("h3",{id:"tour-step-title",className:"text-sm font-medium text-foreground mb-1.5",children:t.title}),d.jsx("p",{id:"tour-step-desc",className:"text-xs text-muted-foreground/80 leading-relaxed mb-4",children:t.description}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex gap-1",children:Array.from({length:r},(S,A)=>d.jsx("div",{className:`h-1.5 rounded-full transition-all ${Iv(A,n)}`},A))}),d.jsxs("div",{className:"flex gap-2",children:[n>0&&d.jsx("button",{onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1",children:"Back"}),d.jsx("button",{onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1",children:"Skip"}),d.jsx("button",{onClick:s,className:"text-xs font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-md px-3 py-1 transition-colors",children:n===r-1?"Done":"Next"})]})]}),d.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/50 text-right",children:[n+1," / ",r]})]})]}),document.body)}const Qn=200,Di=16;function Fv(e,t){if(!e)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const n=320,r=u=>{const f=n/2;return Math.max(Di+f,Math.min(window.innerWidth-Di-f,u))},i=u=>Math.max(Di+Qn/2,Math.min(window.innerHeight-Di-Qn/2,u)),s=window.innerHeight-(e.top+e.height+et+yn),o=e.top-et-yn,a=window.innerWidth-(e.left+e.width+et+yn),l=e.left-et-yn;let c=t;switch(c==="bottom"&&s<Qn?o>=Qn?c="top":a>=n?c="right":l>=n&&(c="left"):c==="top"&&o<Qn&&(s>=Qn?c="bottom":a>=n?c="right":l>=n&&(c="left")),c){case"top":return{bottom:window.innerHeight-e.top+et+yn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"bottom":return{top:e.top+e.height+et+yn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"left":return{top:i(e.top+e.height/2),right:window.innerWidth-e.left+et+yn,transform:"translateY(-50%)"};case"right":return{top:i(e.top+e.height/2),left:e.left+e.width+et+yn,transform:"translateY(-50%)"}}}const Bv=[{to:"/",icon:ih,label:"KANBAN",tourId:"nav-kanban"},{to:"/primitives",icon:f0,label:"PRIMITIVES",tourId:"nav-primitives"},{to:"/guards",icon:j0,label:"GUARDS",tourId:"nav-guards"},{to:"/repo",icon:Zb,label:"REPO",tourId:"nav-repo"},{to:"/sessions",icon:Zo,label:"SESSIONS",tourId:"nav-sessions"},{to:"/workflow",icon:$0,label:"WORKFLOW",tourId:"nav-workflow"}],zv=d.jsx("div",{className:"flex flex-1 min-h-0 items-center justify-center",children:d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})});function Vv(){const{settings:e}=Ka(),t=new URLSearchParams(window.location.search).toString(),n=t?`?${t}`:"";return jr(),d.jsxs("div",{className:"flex h-screen bg-background",children:[e.showBackgroundEffects&&d.jsx("div",{className:"neon-bg",children:d.jsx(Dv,{})}),d.jsxs("aside",{className:"flex w-24 flex-col items-center border-r border-border bg-surface sidebar-glass",children:[d.jsx("div",{className:"flex h-20 items-center justify-center",children:d.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-xl text-white overflow-hidden",style:{background:"linear-gradient(135deg, #6FC985 0%, #5ABF87 6.25%, #45B588 12.5%, #2FAA89 18.75%, #15A089 25%, #009588 31.25%, #008A87 37.5%, #007F84 43.75%, #007480 50%, #00697A 56.25%, #005E74 62.5%, #00546C 68.75%, #004964 75%, #023F5B 81.25%, #0A3551 87.5%, #0E2B46 93.75%, #10223B 100%)"},children:d.jsx("img",{src:"/scanner-sweep.png",alt:"Orbital Command",className:"h-12 w-12 object-contain"})})}),d.jsx(gr,{className:"flex-1",children:d.jsx("nav",{className:"flex flex-col items-center gap-3 px-4 py-2",children:Bv.map(({to:r,icon:i,label:s,tourId:o})=>d.jsxs(uc,{to:`${r}${n}`,end:r==="/","data-tour":o,className:({isActive:a})=>F("nav-item-square group relative flex h-16 w-16 flex-col items-center justify-center rounded-xl ",a?"bg-surface-light text-foreground nav-icon-active-glow":"text-muted-foreground hover:bg-surface-light hover:text-foreground"),children:[d.jsx(i,{className:"h-6 w-6"}),d.jsx("span",{className:"nav-item-label whitespace-nowrap text-[9px] font-light max-h-0 opacity-0 group-hover:max-h-3 group-hover:mt-1 group-hover:opacity-100 transition-all duration-200 overflow-hidden tracking-wider",children:s})]},r))})}),d.jsx("div",{className:"px-4 py-3 border-t border-border/40",children:d.jsxs(uc,{to:`/settings${n}`,"data-tour":"nav-settings",className:({isActive:r})=>F("nav-item-square group relative flex h-16 w-16 flex-col items-center justify-center rounded-xl ",r?"bg-surface-light text-foreground nav-icon-active-glow":"text-muted-foreground hover:bg-surface-light hover:text-foreground"),children:[d.jsx(S0,{className:"h-6 w-6"}),d.jsx("span",{className:"nav-item-label whitespace-nowrap text-[9px] font-light max-h-0 opacity-0 group-hover:max-h-3 group-hover:mt-1 group-hover:opacity-100 transition-all duration-200 overflow-hidden tracking-wider",children:"SETTINGS"})]})})]}),d.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden relative z-[1]",style:e.fontScale!==1?{zoom:e.fontScale}:void 0,children:d.jsx("div",{className:"flex flex-1 flex-col overflow-hidden p-4 pt-12 pb-0",children:d.jsx(Eh,{children:d.jsx(m.Suspense,{fallback:zv,children:d.jsx(Nx,{})})})})}),e.showStatusBar&&d.jsx(jv,{}),d.jsx(Lv,{})]})}function t5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const _s=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Er(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ga(e){return"nodeType"in e}function ht(e){var t,n;return e?Er(e)?e:Ga(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ya(e){const{Document:t}=ht(e);return e instanceof t}function xi(e){return Er(e)?!1:e instanceof ht(e).HTMLElement}function _h(e){return e instanceof ht(e).SVGElement}function Nr(e){return e?Er(e)?e.document:Ga(e)?Ya(e)?e:xi(e)||_h(e)?e.ownerDocument:document:document:document}const sn=_s?m.useLayoutEffect:m.useEffect;function Rs(e){const t=m.useRef(e);return sn(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function $v(){const e=m.useRef(null),t=m.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function oi(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return sn(()=>{n.current!==e&&(n.current=e)},t),n}function yi(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function rs(e){const t=Rs(e),n=m.useRef(null),r=m.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function is(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let oo={};function Ms(e,t){return m.useMemo(()=>{if(t)return t;const n=oo[e]==null?0:oo[e]+1;return oo[e]=n,e+"-"+n},[e,t])}function Rh(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,o)=>{const a=Object.entries(o);for(const[l,c]of a){const u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const hr=Rh(1),ss=Rh(-1);function Uv(e){return"clientX"in e&&"clientY"in e}function Xa(e){if(!e)return!1;const{KeyboardEvent:t}=ht(e.target);return t&&e instanceof t}function Wv(e){if(!e)return!1;const{TouchEvent:t}=ht(e.target);return t&&e instanceof t}function os(e){if(Wv(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Uv(e)?{x:e.clientX,y:e.clientY}:null}const xr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[xr.Translate.toString(e),xr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Dc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Hv(e){return e.matches(Dc)?e:e.querySelector(Dc)}const qv={display:"none"};function Kv(e){let{id:t,value:n}=e;return Ie.createElement("div",{id:t,style:qv},n)}function Gv(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ie.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function Yv(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Mh=m.createContext(null);function Xv(e){const t=m.useContext(Mh);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Jv(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:i,event:s}=r;e.forEach(o=>{var a;return(a=o[i])==null?void 0:a.call(o,s)})},[e]),t]}const Qv={draggable:`
298
+ )`:void 0,k=p?"none":"clip-path 0.3s ease-out";return ir.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[70]",role:"dialog","aria-modal":"true","aria-labelledby":"tour-step-title","aria-describedby":"tour-step-desc",children:[d.jsx("div",{className:"absolute inset-0 dialog-overlay-glass",style:{clipPath:E,transition:k},onClick:a}),d.jsxs("div",{ref:f,tabIndex:-1,className:"card-glass absolute rounded-xl p-5 shadow-lg outline-none",style:{...C,maxWidth:360,minWidth:280,transition:p?"none":"top 0.3s ease-out, left 0.3s ease-out"},children:[d.jsx("h3",{id:"tour-step-title",className:"text-sm font-medium text-foreground mb-1.5",children:t.title}),d.jsx("p",{id:"tour-step-desc",className:"text-xs text-muted-foreground/80 leading-relaxed mb-4",children:t.description}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex gap-1",children:Array.from({length:r},(S,A)=>d.jsx("div",{className:`h-1.5 rounded-full transition-all ${Iv(A,n)}`},A))}),d.jsxs("div",{className:"flex gap-2",children:[n>0&&d.jsx("button",{onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1",children:"Back"}),d.jsx("button",{onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1",children:"Skip"}),d.jsx("button",{onClick:s,className:"text-xs font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-md px-3 py-1 transition-colors",children:n===r-1?"Done":"Next"})]})]}),d.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/50 text-right",children:[n+1," / ",r]})]})]}),document.body)}const Qn=200,Di=16;function Fv(e,t){if(!e)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const n=320,r=u=>{const f=n/2;return Math.max(Di+f,Math.min(window.innerWidth-Di-f,u))},i=u=>Math.max(Di+Qn/2,Math.min(window.innerHeight-Di-Qn/2,u)),s=window.innerHeight-(e.top+e.height+et+yn),o=e.top-et-yn,a=window.innerWidth-(e.left+e.width+et+yn),l=e.left-et-yn;let c=t;switch(c==="bottom"&&s<Qn?o>=Qn?c="top":a>=n?c="right":l>=n&&(c="left"):c==="top"&&o<Qn&&(s>=Qn?c="bottom":a>=n?c="right":l>=n&&(c="left")),c){case"top":return{bottom:window.innerHeight-e.top+et+yn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"bottom":return{top:e.top+e.height+et+yn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"left":return{top:i(e.top+e.height/2),right:window.innerWidth-e.left+et+yn,transform:"translateY(-50%)"};case"right":return{top:i(e.top+e.height/2),left:e.left+e.width+et+yn,transform:"translateY(-50%)"}}}const Bv=[{to:"/",icon:rh,label:"KANBAN",tourId:"nav-kanban"},{to:"/primitives",icon:f0,label:"PRIMITIVES",tourId:"nav-primitives"},{to:"/guards",icon:j0,label:"GUARDS",tourId:"nav-guards"},{to:"/repo",icon:Zb,label:"REPO",tourId:"nav-repo"},{to:"/sessions",icon:Zo,label:"SESSIONS",tourId:"nav-sessions"},{to:"/workflow",icon:$0,label:"WORKFLOW",tourId:"nav-workflow"}],zv=d.jsx("div",{className:"flex flex-1 min-h-0 items-center justify-center",children:d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})});function Vv(){const{settings:e}=Ka(),t=new URLSearchParams(window.location.search).toString(),n=t?`?${t}`:"";return jr(),d.jsxs("div",{className:"flex h-screen bg-background",children:[e.showBackgroundEffects&&d.jsx("div",{className:"neon-bg",children:d.jsx(Dv,{})}),d.jsxs("aside",{className:"flex w-24 flex-col items-center border-r border-border bg-surface sidebar-glass",children:[d.jsx("div",{className:"flex h-20 items-center justify-center",children:d.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-xl text-white overflow-hidden",style:{background:"linear-gradient(135deg, #6FC985 0%, #5ABF87 6.25%, #45B588 12.5%, #2FAA89 18.75%, #15A089 25%, #009588 31.25%, #008A87 37.5%, #007F84 43.75%, #007480 50%, #00697A 56.25%, #005E74 62.5%, #00546C 68.75%, #004964 75%, #023F5B 81.25%, #0A3551 87.5%, #0E2B46 93.75%, #10223B 100%)"},children:d.jsx("img",{src:"/scanner-sweep.png",alt:"Orbital Command",className:"h-12 w-12 object-contain"})})}),d.jsx(gr,{className:"flex-1",children:d.jsx("nav",{className:"flex flex-col items-center gap-3 px-4 py-2",children:Bv.map(({to:r,icon:i,label:s,tourId:o})=>d.jsxs(uc,{to:`${r}${n}`,end:r==="/","data-tour":o,className:({isActive:a})=>F("nav-item-square group relative flex h-16 w-16 flex-col items-center justify-center rounded-xl ",a?"bg-surface-light text-foreground nav-icon-active-glow":"text-muted-foreground hover:bg-surface-light hover:text-foreground"),children:[d.jsx(i,{className:"h-6 w-6"}),d.jsx("span",{className:"nav-item-label whitespace-nowrap text-[9px] font-light max-h-0 opacity-0 group-hover:max-h-3 group-hover:mt-1 group-hover:opacity-100 transition-all duration-200 overflow-hidden tracking-wider",children:s})]},r))})}),d.jsx("div",{className:"px-4 py-3 border-t border-border/40",children:d.jsxs(uc,{to:`/settings${n}`,"data-tour":"nav-settings",className:({isActive:r})=>F("nav-item-square group relative flex h-16 w-16 flex-col items-center justify-center rounded-xl ",r?"bg-surface-light text-foreground nav-icon-active-glow":"text-muted-foreground hover:bg-surface-light hover:text-foreground"),children:[d.jsx(S0,{className:"h-6 w-6"}),d.jsx("span",{className:"nav-item-label whitespace-nowrap text-[9px] font-light max-h-0 opacity-0 group-hover:max-h-3 group-hover:mt-1 group-hover:opacity-100 transition-all duration-200 overflow-hidden tracking-wider",children:"SETTINGS"})]})})]}),d.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden relative z-[1]",style:e.fontScale!==1?{zoom:e.fontScale}:void 0,children:d.jsx("div",{className:"flex flex-1 flex-col overflow-hidden p-4 pt-12 pb-0",children:d.jsx(jh,{children:d.jsx(m.Suspense,{fallback:zv,children:d.jsx(Ex,{})})})})}),e.showStatusBar&&d.jsx(jv,{}),d.jsx(Lv,{})]})}function t5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const _s=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Er(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ga(e){return"nodeType"in e}function ht(e){var t,n;return e?Er(e)?e:Ga(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ya(e){const{Document:t}=ht(e);return e instanceof t}function xi(e){return Er(e)?!1:e instanceof ht(e).HTMLElement}function Ah(e){return e instanceof ht(e).SVGElement}function Nr(e){return e?Er(e)?e.document:Ga(e)?Ya(e)?e:xi(e)||Ah(e)?e.ownerDocument:document:document:document}const sn=_s?m.useLayoutEffect:m.useEffect;function Rs(e){const t=m.useRef(e);return sn(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function $v(){const e=m.useRef(null),t=m.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function oi(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return sn(()=>{n.current!==e&&(n.current=e)},t),n}function yi(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function rs(e){const t=Rs(e),n=m.useRef(null),r=m.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function is(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let oo={};function Ms(e,t){return m.useMemo(()=>{if(t)return t;const n=oo[e]==null?0:oo[e]+1;return oo[e]=n,e+"-"+n},[e,t])}function _h(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,o)=>{const a=Object.entries(o);for(const[l,c]of a){const u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const hr=_h(1),ss=_h(-1);function Uv(e){return"clientX"in e&&"clientY"in e}function Xa(e){if(!e)return!1;const{KeyboardEvent:t}=ht(e.target);return t&&e instanceof t}function Wv(e){if(!e)return!1;const{TouchEvent:t}=ht(e.target);return t&&e instanceof t}function os(e){if(Wv(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Uv(e)?{x:e.clientX,y:e.clientY}:null}const xr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[xr.Translate.toString(e),xr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Mc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Hv(e){return e.matches(Mc)?e:e.querySelector(Mc)}const qv={display:"none"};function Kv(e){let{id:t,value:n}=e;return Ie.createElement("div",{id:t,style:qv},n)}function Gv(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ie.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function Yv(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Rh=m.createContext(null);function Xv(e){const t=m.useContext(Rh);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Jv(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:i,event:s}=r;e.forEach(o=>{var a;return(a=o[i])==null?void 0:a.call(o,s)})},[e]),t]}const Qv={draggable:`
299
299
  To pick up a draggable item, press the space bar.
300
300
  While dragging, use the arrow keys to move the item.
301
301
  Press space again to drop the item in its new position, or press escape to cancel.
302
- `},Zv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ew(e){let{announcements:t=Zv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Qv}=e;const{announce:s,announcement:o}=Yv(),a=Ms("DndLiveRegion"),[l,c]=m.useState(!1);if(m.useEffect(()=>{c(!0)},[]),Xv(m.useMemo(()=>({onDragStart(f){let{active:h}=f;s(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&s(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;s(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;s(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;s(t.onDragCancel({active:h,over:p}))}}),[s,t])),!l)return null;const u=Ie.createElement(Ie.Fragment,null,Ie.createElement(Kv,{id:r,value:i.draggable}),Ie.createElement(Gv,{id:a,announcement:o}));return n?ir.createPortal(u,n):u}var Xe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Xe||(Xe={}));function as(){}function Oc(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function tw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Bt=Object.freeze({x:0,y:0});function Ja(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nw(e,t){const n=os(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Qa(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function rw(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ra(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function iw(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Ic(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const n5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Ic(t,t.left,t.top),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=Ja(Ic(l),i);s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(Qa)},r5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=ra(t),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=ra(l),u=i.reduce((h,p,g)=>h+Ja(c[g],p),0),f=Number((u/4).toFixed(4));s.push({id:a,data:{droppableContainer:o,value:f}})}}return s.sort(Qa)};function sw(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),o=i-r,a=s-n;if(r<i&&n<s){const l=t.width*t.height,c=e.width*e.height,u=o*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const Dh=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:o}=s,a=n.get(o);if(a){const l=sw(a,t);l>0&&i.push({id:o,data:{droppableContainer:s,value:l}})}}return i.sort(rw)};function ow(e,t){const{top:n,left:r,bottom:i,right:s}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}const aw=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const s of t){const{id:o}=s,a=n.get(o);if(a&&ow(r,a)){const c=ra(a).reduce((f,h)=>f+Ja(r,h),0),u=Number((c/4).toFixed(4));i.push({id:o,data:{droppableContainer:s,value:u}})}}return i.sort(Qa)};function lw(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Oh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Bt}function cw(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const uw=cw(1);function Ih(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function dw(e,t,n){const r=Ih(t);if(!r)return e;const{scaleX:i,scaleY:s,x:o,y:a}=r,l=e.left-o-(1-i)*parseFloat(n),c=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=s?e.height/s:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const fw={ignoreTransform:!1};function bi(e,t){t===void 0&&(t=fw);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=ht(e).getComputedStyle(e);c&&(n=dw(n,c,u))}const{top:r,left:i,width:s,height:o,bottom:a,right:l}=n;return{top:r,left:i,width:s,height:o,bottom:a,right:l}}function Lc(e){return bi(e,{ignoreTransform:!0})}function hw(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function pw(e,t){return t===void 0&&(t=ht(e).getComputedStyle(e)),t.position==="fixed"}function mw(e,t){t===void 0&&(t=ht(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function Za(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ya(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!xi(i)||_h(i)||n.includes(i))return n;const s=ht(e).getComputedStyle(i);return i!==e&&mw(i,s)&&n.push(i),pw(i,s)?n:r(i.parentNode)}return e?r(e):n}function Lh(e){const[t]=Za(e,1);return t??null}function ao(e){return!_s||!e?null:Er(e)?e:Ga(e)?Ya(e)||e===Nr(e).scrollingElement?window:xi(e)?e:null:null}function Fh(e){return Er(e)?e.scrollX:e.scrollLeft}function Bh(e){return Er(e)?e.scrollY:e.scrollTop}function ia(e){return{x:Fh(e),y:Bh(e)}}var tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tt||(tt={}));function zh(e){return!_s||!e?!1:e===document.scrollingElement}function Vh(e){const t={x:0,y:0},n=zh(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const gw={x:.2,y:.2};function xw(e,t,n,r,i){let{top:s,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=gw);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=Vh(e),p={x:0,y:0},g={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+b.height?(p.y=tt.Backward,g.y=r*Math.abs((t.top+b.height-s)/b.height)):!u&&l>=t.bottom-b.height&&(p.y=tt.Forward,g.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!h&&a>=t.right-b.width?(p.x=tt.Forward,g.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&o<=t.left+b.width&&(p.x=tt.Backward,g.x=r*Math.abs((t.left+b.width-o)/b.width)),{direction:p,speed:g}}function yw(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:o}=window;return{top:0,left:0,right:s,bottom:o,width:s,height:o}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function $h(e){return e.reduce((t,n)=>hr(t,ia(n)),Bt)}function bw(e){return e.reduce((t,n)=>t+Fh(n),0)}function vw(e){return e.reduce((t,n)=>t+Bh(n),0)}function Uh(e,t){if(t===void 0&&(t=bi),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);Lh(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ww=[["x",["left","right"],bw],["y",["top","bottom"],vw]];class el{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Za(n),i=$h(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,o,a]of ww)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Gr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function kw(e){const{EventTarget:t}=ht(e);return e instanceof t?e:Nr(e)}function lo(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Tt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Tt||(Tt={}));function Fc(e){e.preventDefault()}function Sw(e){e.stopPropagation()}var we;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(we||(we={}));const Wh={start:[we.Space,we.Enter],cancel:[we.Esc],end:[we.Space,we.Enter,we.Tab]},Cw=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case we.Right:return{...n,x:n.x+25};case we.Left:return{...n,x:n.x-25};case we.Down:return{...n,y:n.y+25};case we.Up:return{...n,y:n.y-25}}};class tl{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Gr(Nr(n)),this.windowListeners=new Gr(ht(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tt.Resize,this.handleCancel),this.windowListeners.add(Tt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Uh(r),n(Bt)}handleKeyDown(t){if(Xa(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=Wh,coordinateGetter:o=Cw,scrollBehavior:a="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:Bt;this.referenceCoordinates||(this.referenceCoordinates=u);const f=o(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=ss(f,u),p={x:0,y:0},{scrollableAncestors:g}=r.current;for(const b of g){const y=t.code,{isTop:x,isRight:w,isLeft:C,isBottom:E,maxScroll:k,minScroll:S}=Vh(b),A=yw(b),T={x:Math.min(y===we.Right?A.right-A.width/2:A.right,Math.max(y===we.Right?A.left:A.left+A.width/2,f.x)),y:Math.min(y===we.Down?A.bottom-A.height/2:A.bottom,Math.max(y===we.Down?A.top:A.top+A.height/2,f.y))},R=y===we.Right&&!w||y===we.Left&&!C,N=y===we.Down&&!E||y===we.Up&&!x;if(R&&T.x!==f.x){const D=b.scrollLeft+h.x,P=y===we.Right&&D<=k.x||y===we.Left&&D>=S.x;if(P&&!h.y){b.scrollTo({left:D,behavior:a});return}P?p.x=b.scrollLeft-D:p.x=y===we.Right?b.scrollLeft-k.x:b.scrollLeft-S.x,p.x&&b.scrollBy({left:-p.x,behavior:a});break}else if(N&&T.y!==f.y){const D=b.scrollTop+h.y,P=y===we.Down&&D<=k.y||y===we.Up&&D>=S.y;if(P&&!h.x){b.scrollTo({top:D,behavior:a});return}P?p.y=b.scrollTop-D:p.y=y===we.Down?b.scrollTop-k.y:b.scrollTop-S.y,p.y&&b.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,hr(ss(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tl.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Wh,onActivation:i}=t,{active:s}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Bc(e){return!!(e&&"distance"in e)}function zc(e){return!!(e&&"delay"in e)}class nl{constructor(t,n,r){var i;r===void 0&&(r=kw(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:o}=s;this.props=t,this.events=n,this.document=Nr(o),this.documentListeners=new Gr(this.document),this.listeners=new Gr(r),this.windowListeners=new Gr(ht(o)),this.initialCoordinates=(i=os(s))!=null?i:Bt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Tt.Resize,this.handleCancel),this.windowListeners.add(Tt.DragStart,Fc),this.windowListeners.add(Tt.VisibilityChange,this.handleCancel),this.windowListeners.add(Tt.ContextMenu,Fc),this.documentListeners.add(Tt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bc(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Tt.Click,Sw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:o,options:{activationConstraint:a}}=s;if(!i)return;const l=(n=os(t))!=null?n:Bt,c=ss(i,l);if(!r&&a){if(Bc(a)){if(a.tolerance!=null&&lo(c,a.tolerance))return this.handleCancel();if(lo(c,a.distance))return this.handleStart()}if(zc(a)&&lo(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===we.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const jw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rl extends nl{constructor(t){const{event:n}=t,r=Nr(n.target);super(t,jw,r)}}rl.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Ew={move:{name:"mousemove"},end:{name:"mouseup"}};var sa;(function(e){e[e.RightClick=2]="RightClick"})(sa||(sa={}));class Nw extends nl{constructor(t){super(t,Ew,Nr(t.event.target))}}Nw.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===sa.RightClick?!1:(r==null||r({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Tw extends nl{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}Tw.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Yr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Yr||(Yr={}));var ls;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ls||(ls={}));function Pw(e){let{acceleration:t,activator:n=Yr.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:o=5,order:a=ls.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=_w({delta:f,disabled:!s}),[g,b]=$v(),y=m.useRef({x:0,y:0}),x=m.useRef({x:0,y:0}),w=m.useMemo(()=>{switch(n){case Yr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Yr.DraggableRect:return i}},[n,i,l]),C=m.useRef(null),E=m.useCallback(()=>{const S=C.current;if(!S)return;const A=y.current.x*x.current.x,T=y.current.y*x.current.y;S.scrollBy(A,T)},[]),k=m.useMemo(()=>a===ls.TreeOrder?[...c].reverse():c,[a,c]);m.useEffect(()=>{if(!s||!c.length||!w){b();return}for(const S of k){if((r==null?void 0:r(S))===!1)continue;const A=c.indexOf(S),T=u[A];if(!T)continue;const{direction:R,speed:N}=xw(S,T,w,t,h);for(const D of["x","y"])p[D][R[D]]||(N[D]=0,R[D]=0);if(N.x>0||N.y>0){b(),C.current=S,g(E,o),y.current=N,x.current=R;return}}y.current={x:0,y:0},x.current={x:0,y:0},b()},[t,E,r,b,s,o,JSON.stringify(w),JSON.stringify(p),g,c,k,u,JSON.stringify(h)])}const Aw={x:{[tt.Backward]:!1,[tt.Forward]:!1},y:{[tt.Backward]:!1,[tt.Forward]:!1}};function _w(e){let{delta:t,disabled:n}=e;const r=is(t);return yi(i=>{if(n||!r||!i)return Aw;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[tt.Backward]:i.x[tt.Backward]||s.x===-1,[tt.Forward]:i.x[tt.Forward]||s.x===1},y:{[tt.Backward]:i.y[tt.Backward]||s.y===-1,[tt.Forward]:i.y[tt.Forward]||s.y===1}}},[n,t,r])}function Rw(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return yi(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function Mw(e,t){return m.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...s]},[]),[e,t])}var ai;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ai||(ai={}));var oa;(function(e){e.Optimized="optimized"})(oa||(oa={}));const Vc=new Map;function Dw(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,o]=m.useState(null),{frequency:a,measure:l,strategy:c}=i,u=m.useRef(e),f=y(),h=oi(f),p=m.useCallback(function(x){x===void 0&&(x=[]),!h.current&&o(w=>w===null?x:w.concat(x.filter(C=>!w.includes(C))))},[h]),g=m.useRef(null),b=yi(x=>{if(f&&!n)return Vc;if(!x||x===Vc||u.current!==e||s!=null){const w=new Map;for(let C of e){if(!C)continue;if(s&&s.length>0&&!s.includes(C.id)&&C.rect.current){w.set(C.id,C.rect.current);continue}const E=C.node.current,k=E?new el(l(E),E):null;C.rect.current=k,k&&w.set(C.id,k)}return w}return x},[e,s,n,f,l]);return m.useEffect(()=>{u.current=e},[e]),m.useEffect(()=>{f||p()},[n,f]),m.useEffect(()=>{s&&s.length>0&&o(null)},[JSON.stringify(s)]),m.useEffect(()=>{f||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{p(),g.current=null},a))},[a,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:s!=null};function y(){switch(c){case ai.Always:return!1;case ai.BeforeDragging:return n;default:return!n}}}function il(e,t){return yi(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ow(e,t){return il(e,t)}function Iw(e){let{callback:t,disabled:n}=e;const r=Rs(t),i=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return m.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ds(e){let{callback:t,disabled:n}=e;const r=Rs(t),i=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return m.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Lw(e){return new el(bi(e),e)}function $c(e,t,n){t===void 0&&(t=Lw);const[r,i]=m.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const o=Iw({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),a=Ds({callback:s});return sn(()=>{s(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function Fw(e){const t=il(e);return Oh(e,t)}const Uc=[];function Bw(e){const t=m.useRef(e),n=yi(r=>e?r&&r!==Uc&&e&&t.current&&e.parentNode===t.current.parentNode?r:Za(e):Uc,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function zw(e){const[t,n]=m.useState(null),r=m.useRef(e),i=m.useCallback(s=>{const o=ao(s.target);o&&n(a=>a?(a.set(o,ia(o)),new Map(a)):null)},[]);return m.useEffect(()=>{const s=r.current;if(e!==s){o(s);const a=e.map(l=>{const c=ao(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,ia(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(s)};function o(a){a.forEach(l=>{const c=ao(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,o)=>hr(s,o),Bt):$h(e):Bt,[e,t])}function Wc(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==Bt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ss(e,n.current):Bt}function Vw(e){m.useEffect(()=>{if(!_s)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function $w(e,t){return m.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=o=>{s(o,t)},n},{}),[e,t])}function Hh(e){return m.useMemo(()=>e?hw(e):null,[e])}const Hc=[];function Uw(e,t){t===void 0&&(t=bi);const[n]=e,r=Hh(n?ht(n):null),[i,s]=m.useState(Hc);function o(){s(()=>e.length?e.map(l=>zh(l)?r:new el(t(l),l)):Hc)}const a=Ds({callback:o});return sn(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),i}function qh(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return xi(t)?t:e}function Ww(e){let{measure:t}=e;const[n,r]=m.useState(null),i=m.useCallback(c=>{for(const{target:u}of c)if(xi(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),s=Ds({callback:i}),o=m.useCallback(c=>{const u=qh(c);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=rs(o);return m.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Hw=[{sensor:rl,options:{}},{sensor:tl,options:{}}],qw={current:{}},Ji={draggable:{measure:Lc},droppable:{measure:Lc,strategy:ai.WhileDragging,frequency:oa.Optimized},dragOverlay:{measure:bi}};class Xr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Kw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:as},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ji,measureDroppableContainers:as,windowRect:null,measuringScheduled:!1},Kh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:as,draggableNodes:new Map,over:null,measureDroppableContainers:as},vi=m.createContext(Kh),Gh=m.createContext(Kw);function Gw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xr}}}function Yw(e,t){switch(t.type){case Xe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Xe.DragEnd:case Xe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xe.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Xr(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Xe.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new Xr(e.droppable.containers);return o.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Xe.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Xr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Xw(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=m.useContext(vi),s=is(r),o=is(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&s&&o!=null){if(!Xa(s)||document.activeElement===s.target)return;const a=i.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=Hv(u);if(f){f.focus();break}}})}},[r,t,i,o,s]),null}function Yh(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Jw(e){return m.useMemo(()=>({draggable:{...Ji.draggable,...e==null?void 0:e.draggable},droppable:{...Ji.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ji.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Qw(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=m.useRef(!1),{x:o,y:a}=typeof i=="boolean"?{x:i,y:i}:i;sn(()=>{if(!o&&!a||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=Oh(u,r);if(o||(f.x=0),a||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Lh(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,o,a,r,n])}const Os=m.createContext({...Bt,scaleX:1,scaleY:1});var kn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(kn||(kn={}));const Zw=m.memo(function(t){var n,r,i,s;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:u=Hw,collisionDetection:f=Dh,measuring:h,modifiers:p,...g}=t;const b=m.useReducer(Yw,void 0,Gw),[y,x]=b,[w,C]=Jv(),[E,k]=m.useState(kn.Uninitialized),S=E===kn.Initialized,{draggable:{active:A,nodes:T,translate:R},droppable:{containers:N}}=y,D=A!=null?T.get(A):null,P=m.useRef({initial:null,translated:null}),_=m.useMemo(()=>{var Ze;return A!=null?{id:A,data:(Ze=D==null?void 0:D.data)!=null?Ze:qw,rect:P}:null},[A,D]),L=m.useRef(null),[I,H]=m.useState(null),[M,$]=m.useState(null),z=oi(g,Object.values(g)),v=Ms("DndDescribedBy",o),U=m.useMemo(()=>N.getEnabled(),[N]),ne=Jw(h),{droppableRects:j,measureDroppableContainers:K,measuringScheduled:X}=Dw(U,{dragging:S,dependencies:[R.x,R.y],config:ne.droppable}),W=Rw(T,A),Le=m.useMemo(()=>M?os(M):null,[M]),Ce=Rr(),Re=Ow(W,ne.draggable.measure);Qw({activeNode:A!=null?T.get(A):null,config:Ce.layoutShiftCompensation,initialRect:Re,measure:ne.draggable.measure});const ge=$c(W,ne.draggable.measure,Re),me=$c(W?W.parentElement:null),je=m.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),be=N.getNodeFor((n=je.current.over)==null?void 0:n.id),de=Ww({measure:ne.dragOverlay.measure}),fe=(r=de.nodeRef.current)!=null?r:W,Ne=S?(i=de.rect)!=null?i:ge:null,nt=!!(de.nodeRef.current&&de.rect),Je=Fw(nt?null:ge),Y=Hh(fe?ht(fe):null),$e=Bw(S?be??W:null),ut=Uw($e),Qe=Yh(p,{transform:{x:R.x-Je.x,y:R.y-Je.y,scaleX:1,scaleY:1},activatorEvent:M,active:_,activeNodeRect:ge,containerNodeRect:me,draggingNodeRect:Ne,over:je.current.over,overlayNodeRect:de.rect,scrollableAncestors:$e,scrollableAncestorRects:ut,windowRect:Y}),Te=Le?hr(Le,R):null,De=zw($e),Fe=Wc(De),O=Wc(De,[ge]),B=hr(Qe,Fe),G=Ne?uw(Ne,Qe):null,J=_&&G?f({active:_,collisionRect:G,droppableRects:j,droppableContainers:U,pointerCoordinates:Te}):null,re=iw(J,"id"),[he,Ue]=m.useState(null),We=nt?Qe:hr(Qe,O),it=lw(We,(s=he==null?void 0:he.rect)!=null?s:null,ge),Be=m.useRef(null),xe=m.useCallback((Ze,st)=>{let{sensor:qe,options:$t}=st;if(L.current==null)return;const pt=T.get(L.current);if(!pt)return;const dt=Ze.nativeEvent,St=new qe({active:L.current,activeNode:pt,event:dt,options:$t,context:je,onAbort(Ye){if(!T.get(Ye))return;const{onDragAbort:Ct}=z.current,jt={id:Ye};Ct==null||Ct(jt),w({type:"onDragAbort",event:jt})},onPending(Ye,Ut,Ct,jt){if(!T.get(Ye))return;const{onDragPending:pn}=z.current,Dt={id:Ye,constraint:Ut,initialCoordinates:Ct,offset:jt};pn==null||pn(Dt),w({type:"onDragPending",event:Dt})},onStart(Ye){const Ut=L.current;if(Ut==null)return;const Ct=T.get(Ut);if(!Ct)return;const{onDragStart:jt}=z.current,hn={activatorEvent:dt,active:{id:Ut,data:Ct.data,rect:P}};ir.unstable_batchedUpdates(()=>{jt==null||jt(hn),k(kn.Initializing),x({type:Xe.DragStart,initialCoordinates:Ye,active:Ut}),w({type:"onDragStart",event:hn}),H(Be.current),$(dt)})},onMove(Ye){x({type:Xe.DragMove,coordinates:Ye})},onEnd:Qt(Xe.DragEnd),onCancel:Qt(Xe.DragCancel)});Be.current=St;function Qt(Ye){return async function(){const{active:Ct,collisions:jt,over:hn,scrollAdjustedTranslate:pn}=je.current;let Dt=null;if(Ct&&pn){const{cancelDrop:mn}=z.current;Dt={activatorEvent:dt,active:Ct,collisions:jt,delta:pn,over:hn},Ye===Xe.DragEnd&&typeof mn=="function"&&await Promise.resolve(mn(Dt))&&(Ye=Xe.DragCancel)}L.current=null,ir.unstable_batchedUpdates(()=>{x({type:Ye}),k(kn.Uninitialized),Ue(null),H(null),$(null),Be.current=null;const mn=Ye===Xe.DragEnd?"onDragEnd":"onDragCancel";if(Dt){const Xn=z.current[mn];Xn==null||Xn(Dt),w({type:mn,event:Dt})}})}}},[T]),He=m.useCallback((Ze,st)=>(qe,$t)=>{const pt=qe.nativeEvent,dt=T.get($t);if(L.current!==null||!dt||pt.dndKit||pt.defaultPrevented)return;const St={active:dt};Ze(qe,st.options,St)===!0&&(pt.dndKit={capturedBy:st.sensor},L.current=$t,xe(qe,st))},[T,xe]),ve=Mw(u,He);Vw(u),sn(()=>{ge&&E===kn.Initializing&&k(kn.Initialized)},[ge,E]),m.useEffect(()=>{const{onDragMove:Ze}=z.current,{active:st,activatorEvent:qe,collisions:$t,over:pt}=je.current;if(!st||!qe)return;const dt={active:st,activatorEvent:qe,collisions:$t,delta:{x:B.x,y:B.y},over:pt};ir.unstable_batchedUpdates(()=>{Ze==null||Ze(dt),w({type:"onDragMove",event:dt})})},[B.x,B.y]),m.useEffect(()=>{const{active:Ze,activatorEvent:st,collisions:qe,droppableContainers:$t,scrollAdjustedTranslate:pt}=je.current;if(!Ze||L.current==null||!st||!pt)return;const{onDragOver:dt}=z.current,St=$t.get(re),Qt=St&&St.rect.current?{id:St.id,rect:St.rect.current,data:St.data,disabled:St.disabled}:null,Ye={active:Ze,activatorEvent:st,collisions:qe,delta:{x:pt.x,y:pt.y},over:Qt};ir.unstable_batchedUpdates(()=>{Ue(Qt),dt==null||dt(Ye),w({type:"onDragOver",event:Ye})})},[re]),sn(()=>{je.current={activatorEvent:M,active:_,activeNode:W,collisionRect:G,collisions:J,droppableRects:j,draggableNodes:T,draggingNode:fe,draggingNodeRect:Ne,droppableContainers:N,over:he,scrollableAncestors:$e,scrollAdjustedTranslate:B},P.current={initial:Ne,translated:G}},[_,W,J,G,T,fe,Ne,j,N,he,$e,B]),Pw({...Ce,delta:R,draggingRect:G,pointerCoordinates:Te,scrollableAncestors:$e,scrollableAncestorRects:ut});const Mt=m.useMemo(()=>({active:_,activeNode:W,activeNodeRect:ge,activatorEvent:M,collisions:J,containerNodeRect:me,dragOverlay:de,draggableNodes:T,droppableContainers:N,droppableRects:j,over:he,measureDroppableContainers:K,scrollableAncestors:$e,scrollableAncestorRects:ut,measuringConfiguration:ne,measuringScheduled:X,windowRect:Y}),[_,W,ge,M,J,me,de,T,N,j,he,K,$e,ut,ne,X,Y]),Vt=m.useMemo(()=>({activatorEvent:M,activators:ve,active:_,activeNodeRect:ge,ariaDescribedById:{draggable:v},dispatch:x,draggableNodes:T,over:he,measureDroppableContainers:K}),[M,ve,_,ge,x,v,T,he,K]);return Ie.createElement(Mh.Provider,{value:C},Ie.createElement(vi.Provider,{value:Vt},Ie.createElement(Gh.Provider,{value:Mt},Ie.createElement(Os.Provider,{value:it},c)),Ie.createElement(Xw,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Ie.createElement(ew,{...a,hiddenTextDescribedById:v}));function Rr(){const Ze=(I==null?void 0:I.autoScrollEnabled)===!1,st=typeof l=="object"?l.enabled===!1:l===!1,qe=S&&!Ze&&!st;return typeof l=="object"?{...l,enabled:qe}:{enabled:qe}}}),e1=m.createContext(null),qc="button",t1="Draggable";function Xh(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Ms(t1),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=m.useContext(vi),{role:p=qc,roleDescription:g="draggable",tabIndex:b=0}=i??{},y=(l==null?void 0:l.id)===t,x=m.useContext(y?Os:e1),[w,C]=rs(),[E,k]=rs(),S=$w(o,t),A=oi(n);sn(()=>(f.set(t,{id:t,key:s,node:w,activatorNode:E,data:A}),()=>{const R=f.get(t);R&&R.key===s&&f.delete(t)}),[f,t]);const T=m.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":y&&p===qc?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,p,b,y,g,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:y,listeners:r?void 0:S,node:w,over:h,setNodeRef:C,setActivatorNodeRef:k,transform:x}}function Jh(){return m.useContext(Gh)}const n1="Droppable",r1={timeout:25};function sl(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Ms(n1),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=m.useContext(vi),u=m.useRef({disabled:n}),f=m.useRef(!1),h=m.useRef(null),p=m.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:y}={...r1,...i},x=oi(b??r),w=m.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(x.current)?x.current:[x.current]),p.current=null},y)},[y]),C=Ds({callback:w,disabled:g||!o}),E=m.useCallback((T,R)=>{C&&(R&&(C.unobserve(R),f.current=!1),T&&C.observe(T))},[C]),[k,S]=rs(E),A=oi(t);return m.useEffect(()=>{!C||!k.current||(C.disconnect(),f.current=!1,C.observe(k.current))},[k,C]),m.useEffect(()=>(a({type:Xe.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:h,data:A}}),()=>a({type:Xe.UnregisterDroppable,key:s,id:r})),[r]),m.useEffect(()=>{n!==u.current.disabled&&(a({type:Xe.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:o,rect:h,isOver:(l==null?void 0:l.id)===r,node:k,over:l,setNodeRef:S}}function i1(e){let{animation:t,children:n}=e;const[r,i]=m.useState(null),[s,o]=m.useState(null),a=is(n);return!n&&!r&&a&&i(a),sn(()=>{if(!s)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){i(null);return}Promise.resolve(t(c,s)).then(()=>{i(null)})},[t,r,s]),Ie.createElement(Ie.Fragment,null,n,r?m.cloneElement(r,{ref:o}):null)}const s1={x:0,y:0,scaleX:1,scaleY:1};function o1(e){let{children:t}=e;return Ie.createElement(vi.Provider,{value:Kh},Ie.createElement(Os.Provider,{value:s1},t))}const a1={position:"fixed",touchAction:"none"},l1=e=>Xa(e)?"transform 250ms ease":void 0,c1=m.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:o,rect:a,style:l,transform:c,transition:u=l1}=e;if(!a)return null;const f=i?c:{...c,scaleX:1,scaleY:1},h={...a1,width:a.width,height:a.height,top:a.top,left:a.left,transform:xr.Transform.toString(f),transformOrigin:i&&r?nw(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return Ie.createElement(n,{className:o,style:h,ref:t},s)}),u1=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:s,className:o}=e;if(s!=null&&s.active)for(const[a,l]of Object.entries(s.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(s!=null&&s.dragOverlay)for(const[a,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(i))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},d1=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:xr.Transform.toString(t)},{transform:xr.Transform.toString(n)}]},f1={duration:250,easing:"ease",keyframes:d1,sideEffects:u1({styles:{active:{opacity:"0"}}})};function h1(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Rs((s,o)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const c=qh(o);if(!c)return;const{transform:u}=ht(o).getComputedStyle(o),f=Ih(u);if(!f)return;const h=typeof t=="function"?t:p1(t);return Uh(l,i.draggable.measure),h({active:{id:s,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function p1(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...f1,...e};return s=>{let{active:o,dragOverlay:a,transform:l,...c}=s;if(!t)return;const u={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-u.x,y:l.y-u.y,...f},p=i({...c,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[g]=p,b=p[p.length-1];if(JSON.stringify(g)===JSON.stringify(b))return;const y=r==null?void 0:r({active:o,dragOverlay:a,...c}),x=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(w=>{x.onfinish=()=>{y==null||y(),w()}})}}let Kc=0;function m1(e){return m.useMemo(()=>{if(e!=null)return Kc++,Kc},[e])}const g1=Ie.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:s,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:g,droppableContainers:b,dragOverlay:y,over:x,measuringConfiguration:w,scrollableAncestors:C,scrollableAncestorRects:E,windowRect:k}=Jh(),S=m.useContext(Os),A=m1(f==null?void 0:f.id),T=Yh(o,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:y.rect,over:x,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:E,transform:S,windowRect:k}),R=il(h),N=h1({config:r,draggableNodes:g,droppableContainers:b,measuringConfiguration:w}),D=R?y.setRef:void 0;return Ie.createElement(o1,null,Ie.createElement(i1,{animation:N},f&&A?Ie.createElement(c1,{key:A,id:f.id,ref:D,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:R,style:{zIndex:c,...i},transform:T},n):null))}),x1="cc-card-display",y1={effort:!0,category:!0,priority:!0,tags:!0,project:!0};function b1(){const[e,t]=$n(x1,y1),n=m.useCallback(s=>{t(o=>({...o,[s]:!o[s]}))},[t]),r=e.effort&&e.category&&e.priority&&e.tags,i=[e.effort,e.category,e.priority,e.tags,e.project].filter(s=>!s).length;return{display:e,toggle:n,isAllVisible:r,hiddenCount:i}}const ol=["critical","high","medium","low"],al=["feature","bugfix","refactor","infrastructure","docs"],Is=["<1H","1-4H","4H+","TBD"],Qh=["has-blockers","blocks-others","no-deps"],Zh=[{id:"frontend-designer",label:"Frontend Designer",emoji:"🎨",color:"#EC4899"},{id:"architect",label:"Architect",emoji:"🏗️",color:"#536dfe"},{id:"rules-enforcer",label:"Rules Enforcer",emoji:"📋",color:"#6B7280"}];function v1(e){return Object.fromEntries(Zh.map(n=>[n.id,n.emoji]))}function w1(e){return Object.fromEntries(Zh.map(n=>[n.id,n.color]))}const i5=v1(),s5=w1();function k1(e){if(!e)return"TBD";const t=e.toLowerCase().trim(),n=t.match(/(\d+(?:\.\d+)?)\s*(?:-\s*\d+(?:\.\d+)?)?\s*hour/);if(n){const s=parseFloat(n[1]);return s<1?"<1H":s<=4?"1-4H":"4H+"}if(t.match(/(\d+)\s*(?:-\s*\d+)?\s*min/))return"<1H";const i=t.match(/\((\d+(?:\.\d+)?)\s*(?:-\s*\d+(?:\.\d+)?)?\s*(hour|min)/);if(i){const s=parseFloat(i[1]);return i[2].startsWith("min")||s<1?"<1H":s<=4?"1-4H":"4H+"}return t.includes("large")||t.includes("multi")?"4H+":t.includes("medium")||t.includes("half")?"1-4H":t.includes("small")?"<1H":"TBD"}function S1(e){const t=[];return e.blocked_by.length>0&&t.push("has-blockers"),e.blocks.length>0&&t.push("blocks-others"),e.blocked_by.length===0&&e.blocks.length===0&&t.push("no-deps"),t}function ll(e,t){switch(t){case"priority":return e.priority?[e.priority]:[];case"category":return e.category?[e.category]:[];case"tags":return e.tags;case"effort":return[k1(e.effort_estimate)];case"dependencies":return S1(e);case"project":return e.project_id?[e.project_id]:[]}}function C1(e,t,n){return n.size===0?!0:ll(e,t).some(i=>n.has(i))}function Gc(){return{priority:new Set,category:new Set,tags:new Set,effort:new Set,dependencies:new Set}}function j1(e){const[t,n]=m.useState(Gc),r=m.useCallback((c,u)=>{n(f=>{const h={...f,[c]:new Set(f[c])};return h[c].has(u)?h[c].delete(u):h[c].add(u),h})},[]),i=m.useCallback(c=>{n(u=>({...u,[c]:new Set}))},[]),s=m.useCallback(()=>{n(Gc())},[]),o=m.useMemo(()=>Object.values(t).some(c=>c.size>0),[t]),a=m.useMemo(()=>o?e.filter(c=>Object.keys(t).every(u=>C1(c,u,t[u]))):e,[e,t,o]),l=m.useMemo(()=>{const c=new Set;for(const x of e)for(const w of x.tags)c.add(w);const u=[...c].sort();function f(x,w){return e.filter(C=>ll(C,x).includes(w)).length}const h=ol.map(x=>({value:x,label:x,count:f("priority",x)})),p=al.map(x=>({value:x,label:x,count:f("category",x)})),g=u.map(x=>({value:x,label:x,count:f("tags",x)})),b=Is.map(x=>({value:x,label:x,count:f("effort",x)})),y=Qh.map(x=>({value:x,label:x==="has-blockers"?"Has blockers":x==="blocks-others"?"Blocks others":"No dependencies",count:f("dependencies",x)}));return{priority:h,category:p,tags:g,effort:b,dependencies:y}},[e]);return{filters:t,toggleFilter:r,clearField:i,clearAll:s,hasActiveFilters:o,filteredScopes:a,optionsWithCounts:l}}const E1="cc-board-sort",N1="cc-board-collapsed",ep={id:"asc",priority:"asc",effort:"asc",updated_at:"desc",created_at:"desc",title:"asc"},Yc={critical:0,high:1,medium:2,low:3};function Xc(e){if(!e)return 1/0;const t=Is.indexOf(e);return t>=0?t:1/0}const T1={field:"id",direction:"asc"},P1={deserialize:e=>{const t=JSON.parse(e);if(t.field in ep)return{field:t.field,direction:t.direction==="desc"?"desc":"asc"}}};function aa(e,t,n){return[...e].sort((i,s)=>{const o=A1(i,s,t);return n==="desc"?-o:o})}function A1(e,t,n){switch(n){case"id":return e.id-t.id;case"priority":{const r=e.priority?Yc[e.priority]??1/0:1/0,i=t.priority?Yc[t.priority]??1/0:1/0;return r-i}case"effort":return Xc(e.effort_estimate)-Xc(t.effort_estimate);case"updated_at":{const r=e.updated_at?new Date(e.updated_at).getTime():0,i=t.updated_at?new Date(t.updated_at).getTime():0;return r-i}case"created_at":{const r=e.created_at?new Date(e.created_at).getTime():0,i=t.created_at?new Date(t.created_at).getTime():0;return r-i}case"title":return e.title.localeCompare(t.title);default:return 0}}function _1(){const[e,t]=$n(E1,T1,P1),[n,r]=$n(N1,new Set,Ch),i=m.useCallback(o=>{t(a=>{const l=a.field===o?a.direction==="asc"?"desc":"asc":ep[o];return{field:o,direction:l}})},[t]),s=m.useCallback(o=>{r(a=>{const l=new Set(a);return l.has(o)?l.delete(o):l.add(o),l})},[r]);return{sortField:e.field,sortDirection:e.direction,setSort:i,collapsed:n,toggleCollapse:s}}const R1="cc-view-mode",M1="cc-swim-group",D1="cc-swim-collapsed",O1={serialize:e=>e,deserialize:e=>e==="kanban"||e==="swimlane"?e:void 0},I1={serialize:e=>e,deserialize:e=>e==="priority"||e==="category"||e==="tags"||e==="effort"||e==="dependencies"||e==="project"?e:void 0};function L1(){const[e,t]=$n(R1,"kanban",O1),[n,r]=$n(M1,"priority",I1),[i,s]=$n(D1,new Set,Ch),o=m.useCallback(l=>{r(l),s(new Set)},[r,s]),a=m.useCallback(l=>{s(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u})},[s]);return{viewMode:e,setViewMode:t,groupField:n,setGroupField:o,collapsedLanes:i,toggleLaneCollapse:a}}function F1(){const{settings:e}=Ka();return m.useMemo(()=>e.fontScale===1?[]:[({transform:n})=>({...n,x:n.x/e.fontScale,y:n.y/e.fontScale})],[e.fontScale])}function B1(e,t){var n;if(e.phase)return e.phase;if(t.includes(e.id)||e.gitBranch)return"shipped";if(e.isEntryPoint||e.group==="planning")return"queued";if(e.sessionKey){if(e.sessionKey.toLowerCase().includes("implement"))return"active";if(e.sessionKey.toLowerCase().includes("review")||e.sessionKey.toLowerCase().includes("gate")||e.sessionKey.toLowerCase().includes("commit")||e.sessionKey.toLowerCase().includes("verify"))return"review";if(e.sessionKey.toLowerCase().includes("push")||e.sessionKey.toLowerCase().includes("deploy"))return"shipped";if(e.sessionKey.toLowerCase().includes("create")||e.sessionKey.toLowerCase().includes("scope"))return"queued"}return e.group==="development"?e.order<=3?"active":"review":e.group==="active"?"active":(n=e.group)!=null&&n.startsWith("deploy")||e.group==="main"?"shipped":"queued"}const z1=[{phase:"queued",label:"Queued",order:0},{phase:"active",label:"Active",order:1},{phase:"review",label:"Review",order:2},{phase:"shipped",label:"Shipped",order:3}];class yr{constructor(t){yt(this,"phaseMap");this.engine=t,this.phaseMap=new Map;const n=t.getLists(),r=t.getConfig().terminalStatuses??[];for(const i of n)this.phaseMap.set(i.id,B1(i,r))}getPhase(t){return this.phaseMap.get(t)??"queued"}getListsForPhase(t){return this.engine.getLists().filter(n=>this.getPhase(n.id)===t)}getPhaseMap(){return this.phaseMap}resolveNormalizedTransition(t,n){return this.engine.getConfig().edges.filter(i=>i.from===t&&this.getPhase(i.to)===n)}}function V1(e){if(e.length<=1)return!0;const t=e[0].getLists().map(n=>n.id).join(",");return e.every(n=>n.getLists().map(r=>r.id).join(",")===t)}async function $1(e,t){try{const n=await fetch(e(`/dispatch/active?scope_id=${t}`));if(!n.ok)return!1;const{active:r}=await n.json();return r!=null}catch{return!1}}function uo(e){const t=String(e);if(t.startsWith("sprint-drop-"))return{type:"sprint-drop",sprintId:parseInt(t.slice(12))};if(t.startsWith("sprint-"))return{type:"sprint",sprintId:parseInt(t.slice(7))};if(typeof e=="number"||/^-?\d+$/.test(t))return{type:"scope",scopeId:Number(e)};if(t.startsWith("swim::")){const r=t.lastIndexOf("::");return{type:"column",status:t.slice(r+2)}}const n=t.match(/^(.+?)::(-?\d+)$/);return n?{type:"scope",scopeId:Number(n[2]),projectId:n[1]}:{type:"column",status:t}}const U1={activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,pending:null,showModal:!1,showPopover:!1,showIdeaForm:!1,dispatching:!1,error:null,pendingSprintDispatch:null,pendingUnmetDeps:null,pendingDepSprintId:null,pendingDisambiguation:null};function W1({scopes:e,sprints:t,onAddToSprint:n,onRemoveFromSprint:r,isPhaseView:i,projectEngines:s,defaultProjectId:o}){const{engine:a}=dn(),l=Xt(),{getApiBase:c,hasMultipleProjects:u}=Rt(),f=m.useCallback((M,$)=>u&&M.project_id?`${c(M.project_id)}${$}`:l($),[l,c,u]),h=m.useCallback(async(M,$)=>{const z=ne=>f(M,ne),v=$.command!=null&&M.id>0?await $1(z,M.id):!1,U=$.confirmLevel==="full";g(ne=>({...ne,pending:{scope:M,transition:$,hasActiveSession:v},showModal:U,showPopover:!U,error:null}))},[f]),[p,g]=m.useState(U1),b=m.useRef(null),y=m.useRef(null);m.useEffect(()=>{b.current=p.activeScope,y.current=p.activeSprint},[p.activeScope,p.activeSprint]);const x=m.useCallback(M=>{const $=uo(M.active.id);if($){if($.type==="scope"){const z=e.find(v=>v.id===$.scopeId&&(!$.projectId||v.project_id===$.projectId));z&&g(v=>({...v,activeScope:z,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,error:null}))}else if($.type==="sprint"){const z=t.find(v=>v.id===$.sprintId);z&&g(v=>({...v,activeScope:null,activeSprint:z,overId:null,overIsValid:!1,overSprintId:null,error:null}))}}},[e,t]),w=m.useCallback(M=>{var ne;const $=(ne=M.over)==null?void 0:ne.id;if(!$){g(j=>({...j,overId:null,overIsValid:!1,overSprintId:null}));return}const z=uo($);if(!z)return;const v=y.current,U=b.current;if(v){if(z.type==="column"){const j=v.status!=="assembling"?a.getBatchTargetStatus(v.target_column)??v.target_column:v.target_column,K=a.isValidTransition(j,z.status);g(X=>({...X,overId:K?z.status:null,overIsValid:K,overSprintId:null}))}else g(j=>({...j,overId:null,overIsValid:!1,overSprintId:null}));return}if(U)if(t.some(K=>K.status==="assembling"&&K.scope_ids.includes(U.id))){const K=z.type==="column"&&z.status===U.status;g(X=>({...X,overId:K?z.status:null,overIsValid:K,overSprintId:null}))}else if(z.type==="sprint-drop"){const K=t.find(W=>W.id===z.sprintId),X=(K==null?void 0:K.status)==="assembling"&&U.status===K.target_column&&(!U.project_id||!K.project_id||U.project_id===K.project_id);g(W=>({...W,overId:null,overIsValid:!!X,overSprintId:z.sprintId}))}else if(z.type==="column"){let K;if(i&&U.project_id&&s){const X=s.get(U.project_id);X?K=new yr(X).resolveNormalizedTransition(U.status,z.status).length>0:K=!1}else K=a.isValidTransition(U.status,z.status);g(X=>({...X,overId:z.status,overIsValid:K,overSprintId:null}))}else g(K=>({...K,overId:null,overIsValid:!1,overSprintId:null}))},[t,a,i,s]),C=m.useCallback(async M=>{var ne;const $=(ne=M.over)==null?void 0:ne.id,z=b.current,v=y.current;if(g(j=>({...j,activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null})),!$)return;const U=uo($);if(U){if(v&&U.type==="column"){const j=v.status!=="assembling"?a.getBatchTargetStatus(v.target_column)??v.target_column:v.target_column;if(a.isValidTransition(j,U.status)){g(K=>({...K,pendingSprintDispatch:v}));return}}if(z&&U.type==="sprint-drop"){const j=t.find(X=>X.id===U.sprintId);if(j&&(z.status!==j.target_column||z.project_id&&j.project_id&&z.project_id!==j.project_id)){g(X=>({...X,error:z.project_id!==(j==null?void 0:j.project_id)?`Cannot add scope from a different project to this ${j.group_type}`:`Cannot add ${z.status} scope to ${j.target_column} ${j.group_type} — scope status must match ${j.group_type} column`}));return}const K=await n(U.sprintId,[z.id]);K&&K.unmet_dependencies.length>0&&g(X=>({...X,pendingUnmetDeps:K.unmet_dependencies,pendingDepSprintId:U.sprintId}));return}if(z&&U.type==="column"){if(z.status===U.status){const K=t.find(X=>X.status==="assembling"&&X.scope_ids.includes(z.id));K&&await r(K.id,[z.id]);return}let j;if(i&&z.project_id&&s){const K=s.get(z.project_id);if(K){const W=new yr(K).resolveNormalizedTransition(z.status,U.status);if(W.length>1){g(Le=>({...Le,pendingDisambiguation:{scope:z,edges:W}}));return}j=W[0]}}else j=a.findEdge(z.status,U.status);if(!j)return;await h(z,j)}}},[n,r,a,t,h,i,s]),E=m.useCallback(async()=>{const{pending:M}=p;if(!M)return;g(j=>({...j,dispatching:!0,error:null}));const{scope:$,transition:z}=M,v=i&&$.project_id&&(s==null?void 0:s.get($.project_id))||a,U=v.buildCommand(z,$.id),ne=j=>f($,j);try{const j=v.getEntryPoint().id;if($.status===j&&z.direction==="forward"&&$.slug){const X=await fetch(ne(`/ideas/${$.slug}/promote`),{method:"POST"});if(!X.ok){const W=await X.json().catch(()=>({error:"Request failed"}));throw new Error(W.error??`HTTP ${X.status}`)}}else if(U){const X=await fetch(ne("/dispatch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_id:$.id,command:U,transition:z.skipServerTransition?void 0:{from:z.from,to:z.to}})});if(!X.ok){const W=await X.json().catch(()=>({error:"Request failed"}));throw new Error(W.error??`HTTP ${X.status}`)}}else{const X=await fetch(ne(`/scopes/${$.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:z.to})});if(!X.ok){const W=await X.json().catch(()=>({error:"Request failed"}));throw new Error(W.error??`Failed to update scope status: HTTP ${X.status}`)}}g(X=>({...X,pending:null,showModal:!1,showPopover:!1,dispatching:!1}))}catch(j){g(K=>({...K,dispatching:!1,error:j instanceof Error?j.message:"Dispatch failed"}))}},[p,a,f,i,s]),k=m.useCallback(async M=>{const $=p.pendingDisambiguation;$&&(g(z=>({...z,pendingDisambiguation:null})),await h($.scope,M))},[p.pendingDisambiguation,h]),S=m.useCallback(()=>{g(M=>({...M,pendingDisambiguation:null}))},[]),A=m.useCallback(()=>{g(M=>({...M,pending:null,showModal:!1,showPopover:!1,dispatching:!1,error:null}))},[]),T=m.useCallback(()=>{g(M=>({...M,error:null}))},[]),R=m.useCallback(()=>{g(M=>({...M,showPopover:!1,showModal:!0}))},[]),N=m.useCallback(()=>{g(M=>({...M,showIdeaForm:!0}))},[]),D=m.useCallback(()=>{g(M=>({...M,showIdeaForm:!1}))},[]),P=m.useCallback(async(M,$)=>{g(z=>({...z,dispatching:!0,error:null}));try{const z=o?`${c(o)}/ideas`:l("/ideas"),v=await fetch(z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:M,description:$})});if(!v.ok){const U=await v.json().catch(()=>({error:"Request failed"}));throw new Error(U.error??`HTTP ${v.status}`)}g(U=>({...U,dispatching:!1,showIdeaForm:!1}))}catch(z){g(v=>({...v,dispatching:!1,error:z instanceof Error?z.message:"Failed to create idea"}))}},[l,o,c]),_=m.useCallback(()=>{g(M=>({...M,pendingSprintDispatch:null}))},[]),L=m.useCallback(()=>{g(M=>({...M,pendingUnmetDeps:null,pendingDepSprintId:null}))},[]),I=m.useCallback(async M=>{p.pendingDepSprintId!=null&&await n(p.pendingDepSprintId,M),g($=>({...$,pendingUnmetDeps:null,pendingDepSprintId:null}))},[p.pendingDepSprintId,n]),H=m.useCallback((M,$)=>{g(z=>({...z,pendingUnmetDeps:$,pendingDepSprintId:M}))},[]);return{state:p,onDragStart:x,onDragOver:w,onDragEnd:C,confirmTransition:E,cancelTransition:A,dismissError:T,openModalFromPopover:R,openIdeaForm:N,closeIdeaForm:D,submitIdea:P,dismissSprintDispatch:_,dismissUnmetDeps:L,resolveUnmetDeps:I,showUnmetDeps:H,selectDisambiguation:k,dismissDisambiguation:S}}function sr(e){return e.project_id?`${e.project_id}::${e.id}`:String(e.id)}function Oi(e,t,n){return e.id!==t?!1:n?!e.project_id||e.project_id===n:!0}function H1(){const e=Xt(),{activeProjectId:t,getApiBase:n,hasMultipleProjects:r}=Rt(),[i,s]=m.useState([]),[o,a]=m.useState(!0),l=m.useRef(!1),c=m.useCallback(async E=>{try{const k=await fetch(e("/sprints"),{signal:E});if(!k.ok)return;const S=await k.json();if(t)for(const A of S)A.project_id||(A.project_id=t);s(S)}catch(k){if(k instanceof DOMException&&k.name==="AbortError")return;console.warn("[Orbital] Failed to fetch sprints:",k)}finally{E!=null&&E.aborted||a(!1)}},[e,t]);m.useEffect(()=>{const E=new AbortController;return c(E.signal),()=>E.abort()},[c]),Ns(c),m.useEffect(()=>{function E(T){l.current||s(R=>{const N=sr(T);return R.some(D=>sr(D)===N)?R:[T,...R]})}function k(T){l.current||s(R=>{const N=R.findIndex(D=>Oi(D,T.id,T.project_id));if(N>=0){const D=[...R];return D[N]=T,D}return[T,...R]})}function S({id:T,project_id:R}){l.current||s(N=>N.filter(D=>!Oi(D,T,R)))}function A(T){l.current||s(R=>{const N=R.findIndex(D=>Oi(D,T.id,T.project_id));if(N>=0){const D=[...R];return D[N]=T,D}return R})}return Q.on("sprint:created",E),Q.on("sprint:updated",k),Q.on("sprint:deleted",S),Q.on("sprint:completed",A),()=>{Q.off("sprint:created",E),Q.off("sprint:updated",k),Q.off("sprint:deleted",S),Q.off("sprint:completed",A)}},[]);const u=m.useCallback(async(E,k)=>{const{projectId:S,...A}=k??{},T=S?`${n(S)}/sprints`:e("/sprints"),R=await fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E,...A})});if(!R.ok)return null;const N=await R.json();return S&&!N.project_id&&(N.project_id=S),N},[e,n]),f=m.useCallback((E,k)=>{if(r){const S=i.find(A=>A.id===E);if(S!=null&&S.project_id)return`${n(S.project_id)}${k}`}return e(k)},[e,n,r,i]),h=m.useCallback(async(E,k)=>(await fetch(f(E,`/sprints/${E}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})})).ok,[f]),p=m.useCallback(async E=>(await fetch(f(E,`/sprints/${E}`),{method:"DELETE"})).ok,[f]),g=m.useCallback(async(E,k)=>{const S=await fetch(f(E,`/sprints/${E}/scopes`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:k})});return S.ok?S.json():null},[f]),b=m.useCallback(async(E,k)=>(await fetch(f(E,`/sprints/${E}/scopes`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:k})})).ok,[f]),y=m.useCallback(async E=>(await fetch(f(E,`/sprints/${E}/dispatch`),{method:"POST"})).json(),[f]),x=m.useCallback(async E=>(await fetch(f(E,`/sprints/${E}/cancel`),{method:"POST"})).ok,[f]),w=m.useCallback(async E=>{const k=await fetch(f(E,`/sprints/${E}/graph`));return k.ok?k.json():null},[f]),C=m.useCallback(async(E,k,S)=>{const A=i.find(D=>D.id===E&&D.project_id===k);if(!A||A.scope_ids.length>0||A.status!=="assembling")return null;if(l.current=!0,s(D=>D.map(P=>Oi(P,E,k)?{...P,project_id:S}:P)),!(await fetch(`${n(k)}/sprints/${E}`,{method:"DELETE"})).ok)return l.current=!1,s(D=>D.map(P=>P.id===E&&P.project_id===S?{...P,project_id:k}:P)),null;const R=await fetch(`${n(S)}/sprints`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A.name,target_column:A.target_column,group_type:A.group_type})});if(!R.ok)return l.current=!1,s(D=>D.filter(P=>!(P.id===E&&P.project_id===S))),null;const N=await R.json();return N.project_id=S,s(D=>{const P=sr(N);let _=!1;return D.reduce((I,H)=>!_&&H.id===E&&H.project_id===S?(_=!0,I.push(N),I):(sr(H)===P||I.push(H),I),[])}),setTimeout(()=>{l.current=!1},500),N},[i,n]);return{sprints:i,loading:o,refetch:c,createSprint:u,renameSprint:h,deleteSprint:p,addScopes:g,removeScopes:b,dispatchSprint:y,cancelSprint:x,getGraph:w,moveSprintToProject:C}}function q1(e,t,n,r){const[i,s]=m.useState(null),[o,a]=m.useState(!1);m.useEffect(()=>{if(!e)return;let u=!1;return a(!0),t(e.id).then(f=>{u||(s(f),a(!1))}),()=>{u=!0}},[e,t]);const l=m.useCallback(async()=>{e&&(await n(e.id),r(),s(null))},[e,n,r]),c=m.useCallback(()=>{r(),s(null)},[r]);return{graph:i,loading:o,showPreflight:e!=null,pendingSprint:e,onConfirm:l,onCancel:c}}function K1(e,t){const n=Xt(),[r,i]=m.useState(!1),s=m.useCallback(async()=>{i(!0);try{const l=await fetch(n("/ideas/surprise"),{method:"POST"});if(!l.ok){const c=await l.json().catch(()=>({error:"Request failed"}));throw new Error(c.error??`HTTP ${l.status}`)}e()}catch(l){console.error("[Orbital] Surprise Me failed:",l)}finally{i(!1)}},[e,n]),o=m.useCallback(async l=>{try{const c=await fetch(n(`/ideas/${l}/approve`),{method:"POST"});if(!c.ok)throw new Error(`HTTP ${c.status}`);t(null)}catch(c){console.error("[Orbital] Failed to approve idea:",c)}},[t,n]),a=m.useCallback(l=>{t(null),fetch(n(`/ideas/${l}`),{method:"DELETE"}).catch(()=>{})},[t,n]);return{surpriseLoading:r,handleSurprise:s,handleApproveGhost:o,handleRejectGhost:a}}function G1(e){return(e.split("/").pop()??"").replace(/\.md$/,"").toLowerCase()}function Jc(e,t){var r,i,s;const n=t.toLowerCase().trim();return!!(!n||e.title.toLowerCase().includes(n)||String(e.id).startsWith(n)||G1(e.file_path).includes(n)||(r=e.category)!=null&&r.toLowerCase().includes(n)||(i=e.priority)!=null&&i.toLowerCase().includes(n)||(s=e.effort_estimate)!=null&&s.toLowerCase().includes(n)||e.status.toLowerCase().includes(n)||e.tags.some(o=>o.toLowerCase().includes(n)))}function Y1(e){const[t,n]=m.useState(""),[r,i]=m.useState("filter"),s=m.useDeferredValue(t),o=s.trim().length>0,a=t!==s,{displayScopes:l,dimmedIds:c,matchCount:u}=m.useMemo(()=>{if(!o)return{displayScopes:e,dimmedIds:new Set,matchCount:e.length};if(r==="filter"){const p=e.filter(g=>Jc(g,s));return{displayScopes:p,dimmedIds:new Set,matchCount:p.length}}const f=new Set;let h=0;for(const p of e)Jc(p,s)?h++:f.add(ce(p));return{displayScopes:e,dimmedIds:f,matchCount:h}},[e,s,o,r]);return{query:t,setQuery:n,mode:r,setMode:i,hasSearch:o,isStale:a,displayScopes:l,dimmedIds:c,matchCount:u}}function X1(){const[e,t]=Nf(),n=e.get("highlight")??null,r=m.useCallback(()=>{t(i=>(i.delete("highlight"),i),{replace:!0})},[t]);return{highlightedScopeKey:n,clearHighlight:r}}const cl=m.createContext({});function ul(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ls=m.createContext(null),dl=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class J1 extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Q1({children:e,isPresent:t}){const n=m.useId(),r=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=m.useContext(dl);return m.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:c}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return s&&(u.nonce=s),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
302
+ `},Zv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ew(e){let{announcements:t=Zv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Qv}=e;const{announce:s,announcement:o}=Yv(),a=Ms("DndLiveRegion"),[l,c]=m.useState(!1);if(m.useEffect(()=>{c(!0)},[]),Xv(m.useMemo(()=>({onDragStart(f){let{active:h}=f;s(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&s(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;s(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;s(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;s(t.onDragCancel({active:h,over:p}))}}),[s,t])),!l)return null;const u=Ie.createElement(Ie.Fragment,null,Ie.createElement(Kv,{id:r,value:i.draggable}),Ie.createElement(Gv,{id:a,announcement:o}));return n?ir.createPortal(u,n):u}var Xe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Xe||(Xe={}));function as(){}function Dc(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function tw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Bt=Object.freeze({x:0,y:0});function Ja(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nw(e,t){const n=os(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Qa(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function rw(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ra(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function iw(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Oc(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const n5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Oc(t,t.left,t.top),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=Ja(Oc(l),i);s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(Qa)},r5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=ra(t),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=ra(l),u=i.reduce((h,p,g)=>h+Ja(c[g],p),0),f=Number((u/4).toFixed(4));s.push({id:a,data:{droppableContainer:o,value:f}})}}return s.sort(Qa)};function sw(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),o=i-r,a=s-n;if(r<i&&n<s){const l=t.width*t.height,c=e.width*e.height,u=o*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const Mh=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:o}=s,a=n.get(o);if(a){const l=sw(a,t);l>0&&i.push({id:o,data:{droppableContainer:s,value:l}})}}return i.sort(rw)};function ow(e,t){const{top:n,left:r,bottom:i,right:s}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}const aw=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const s of t){const{id:o}=s,a=n.get(o);if(a&&ow(r,a)){const c=ra(a).reduce((f,h)=>f+Ja(r,h),0),u=Number((c/4).toFixed(4));i.push({id:o,data:{droppableContainer:s,value:u}})}}return i.sort(Qa)};function lw(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Dh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Bt}function cw(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const uw=cw(1);function Oh(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function dw(e,t,n){const r=Oh(t);if(!r)return e;const{scaleX:i,scaleY:s,x:o,y:a}=r,l=e.left-o-(1-i)*parseFloat(n),c=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=s?e.height/s:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const fw={ignoreTransform:!1};function bi(e,t){t===void 0&&(t=fw);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=ht(e).getComputedStyle(e);c&&(n=dw(n,c,u))}const{top:r,left:i,width:s,height:o,bottom:a,right:l}=n;return{top:r,left:i,width:s,height:o,bottom:a,right:l}}function Ic(e){return bi(e,{ignoreTransform:!0})}function hw(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function pw(e,t){return t===void 0&&(t=ht(e).getComputedStyle(e)),t.position==="fixed"}function mw(e,t){t===void 0&&(t=ht(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function Za(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ya(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!xi(i)||Ah(i)||n.includes(i))return n;const s=ht(e).getComputedStyle(i);return i!==e&&mw(i,s)&&n.push(i),pw(i,s)?n:r(i.parentNode)}return e?r(e):n}function Ih(e){const[t]=Za(e,1);return t??null}function ao(e){return!_s||!e?null:Er(e)?e:Ga(e)?Ya(e)||e===Nr(e).scrollingElement?window:xi(e)?e:null:null}function Lh(e){return Er(e)?e.scrollX:e.scrollLeft}function Fh(e){return Er(e)?e.scrollY:e.scrollTop}function ia(e){return{x:Lh(e),y:Fh(e)}}var tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tt||(tt={}));function Bh(e){return!_s||!e?!1:e===document.scrollingElement}function zh(e){const t={x:0,y:0},n=Bh(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const gw={x:.2,y:.2};function xw(e,t,n,r,i){let{top:s,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=gw);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=zh(e),p={x:0,y:0},g={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+b.height?(p.y=tt.Backward,g.y=r*Math.abs((t.top+b.height-s)/b.height)):!u&&l>=t.bottom-b.height&&(p.y=tt.Forward,g.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!h&&a>=t.right-b.width?(p.x=tt.Forward,g.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&o<=t.left+b.width&&(p.x=tt.Backward,g.x=r*Math.abs((t.left+b.width-o)/b.width)),{direction:p,speed:g}}function yw(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:o}=window;return{top:0,left:0,right:s,bottom:o,width:s,height:o}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Vh(e){return e.reduce((t,n)=>hr(t,ia(n)),Bt)}function bw(e){return e.reduce((t,n)=>t+Lh(n),0)}function vw(e){return e.reduce((t,n)=>t+Fh(n),0)}function $h(e,t){if(t===void 0&&(t=bi),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);Ih(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ww=[["x",["left","right"],bw],["y",["top","bottom"],vw]];class el{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Za(n),i=Vh(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,o,a]of ww)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Gr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function kw(e){const{EventTarget:t}=ht(e);return e instanceof t?e:Nr(e)}function lo(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Tt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Tt||(Tt={}));function Lc(e){e.preventDefault()}function Sw(e){e.stopPropagation()}var we;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(we||(we={}));const Uh={start:[we.Space,we.Enter],cancel:[we.Esc],end:[we.Space,we.Enter,we.Tab]},Cw=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case we.Right:return{...n,x:n.x+25};case we.Left:return{...n,x:n.x-25};case we.Down:return{...n,y:n.y+25};case we.Up:return{...n,y:n.y-25}}};class tl{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Gr(Nr(n)),this.windowListeners=new Gr(ht(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tt.Resize,this.handleCancel),this.windowListeners.add(Tt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&$h(r),n(Bt)}handleKeyDown(t){if(Xa(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=Uh,coordinateGetter:o=Cw,scrollBehavior:a="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:Bt;this.referenceCoordinates||(this.referenceCoordinates=u);const f=o(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=ss(f,u),p={x:0,y:0},{scrollableAncestors:g}=r.current;for(const b of g){const y=t.code,{isTop:x,isRight:w,isLeft:C,isBottom:E,maxScroll:k,minScroll:S}=zh(b),A=yw(b),T={x:Math.min(y===we.Right?A.right-A.width/2:A.right,Math.max(y===we.Right?A.left:A.left+A.width/2,f.x)),y:Math.min(y===we.Down?A.bottom-A.height/2:A.bottom,Math.max(y===we.Down?A.top:A.top+A.height/2,f.y))},R=y===we.Right&&!w||y===we.Left&&!C,N=y===we.Down&&!E||y===we.Up&&!x;if(R&&T.x!==f.x){const D=b.scrollLeft+h.x,P=y===we.Right&&D<=k.x||y===we.Left&&D>=S.x;if(P&&!h.y){b.scrollTo({left:D,behavior:a});return}P?p.x=b.scrollLeft-D:p.x=y===we.Right?b.scrollLeft-k.x:b.scrollLeft-S.x,p.x&&b.scrollBy({left:-p.x,behavior:a});break}else if(N&&T.y!==f.y){const D=b.scrollTop+h.y,P=y===we.Down&&D<=k.y||y===we.Up&&D>=S.y;if(P&&!h.x){b.scrollTo({top:D,behavior:a});return}P?p.y=b.scrollTop-D:p.y=y===we.Down?b.scrollTop-k.y:b.scrollTop-S.y,p.y&&b.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,hr(ss(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tl.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Uh,onActivation:i}=t,{active:s}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Fc(e){return!!(e&&"distance"in e)}function Bc(e){return!!(e&&"delay"in e)}class nl{constructor(t,n,r){var i;r===void 0&&(r=kw(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:o}=s;this.props=t,this.events=n,this.document=Nr(o),this.documentListeners=new Gr(this.document),this.listeners=new Gr(r),this.windowListeners=new Gr(ht(o)),this.initialCoordinates=(i=os(s))!=null?i:Bt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Tt.Resize,this.handleCancel),this.windowListeners.add(Tt.DragStart,Lc),this.windowListeners.add(Tt.VisibilityChange,this.handleCancel),this.windowListeners.add(Tt.ContextMenu,Lc),this.documentListeners.add(Tt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Bc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Fc(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Tt.Click,Sw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:o,options:{activationConstraint:a}}=s;if(!i)return;const l=(n=os(t))!=null?n:Bt,c=ss(i,l);if(!r&&a){if(Fc(a)){if(a.tolerance!=null&&lo(c,a.tolerance))return this.handleCancel();if(lo(c,a.distance))return this.handleStart()}if(Bc(a)&&lo(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===we.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const jw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rl extends nl{constructor(t){const{event:n}=t,r=Nr(n.target);super(t,jw,r)}}rl.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Ew={move:{name:"mousemove"},end:{name:"mouseup"}};var sa;(function(e){e[e.RightClick=2]="RightClick"})(sa||(sa={}));class Nw extends nl{constructor(t){super(t,Ew,Nr(t.event.target))}}Nw.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===sa.RightClick?!1:(r==null||r({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Tw extends nl{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}Tw.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Yr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Yr||(Yr={}));var ls;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ls||(ls={}));function Pw(e){let{acceleration:t,activator:n=Yr.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:o=5,order:a=ls.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=_w({delta:f,disabled:!s}),[g,b]=$v(),y=m.useRef({x:0,y:0}),x=m.useRef({x:0,y:0}),w=m.useMemo(()=>{switch(n){case Yr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Yr.DraggableRect:return i}},[n,i,l]),C=m.useRef(null),E=m.useCallback(()=>{const S=C.current;if(!S)return;const A=y.current.x*x.current.x,T=y.current.y*x.current.y;S.scrollBy(A,T)},[]),k=m.useMemo(()=>a===ls.TreeOrder?[...c].reverse():c,[a,c]);m.useEffect(()=>{if(!s||!c.length||!w){b();return}for(const S of k){if((r==null?void 0:r(S))===!1)continue;const A=c.indexOf(S),T=u[A];if(!T)continue;const{direction:R,speed:N}=xw(S,T,w,t,h);for(const D of["x","y"])p[D][R[D]]||(N[D]=0,R[D]=0);if(N.x>0||N.y>0){b(),C.current=S,g(E,o),y.current=N,x.current=R;return}}y.current={x:0,y:0},x.current={x:0,y:0},b()},[t,E,r,b,s,o,JSON.stringify(w),JSON.stringify(p),g,c,k,u,JSON.stringify(h)])}const Aw={x:{[tt.Backward]:!1,[tt.Forward]:!1},y:{[tt.Backward]:!1,[tt.Forward]:!1}};function _w(e){let{delta:t,disabled:n}=e;const r=is(t);return yi(i=>{if(n||!r||!i)return Aw;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[tt.Backward]:i.x[tt.Backward]||s.x===-1,[tt.Forward]:i.x[tt.Forward]||s.x===1},y:{[tt.Backward]:i.y[tt.Backward]||s.y===-1,[tt.Forward]:i.y[tt.Forward]||s.y===1}}},[n,t,r])}function Rw(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return yi(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function Mw(e,t){return m.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...s]},[]),[e,t])}var ai;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ai||(ai={}));var oa;(function(e){e.Optimized="optimized"})(oa||(oa={}));const zc=new Map;function Dw(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,o]=m.useState(null),{frequency:a,measure:l,strategy:c}=i,u=m.useRef(e),f=y(),h=oi(f),p=m.useCallback(function(x){x===void 0&&(x=[]),!h.current&&o(w=>w===null?x:w.concat(x.filter(C=>!w.includes(C))))},[h]),g=m.useRef(null),b=yi(x=>{if(f&&!n)return zc;if(!x||x===zc||u.current!==e||s!=null){const w=new Map;for(let C of e){if(!C)continue;if(s&&s.length>0&&!s.includes(C.id)&&C.rect.current){w.set(C.id,C.rect.current);continue}const E=C.node.current,k=E?new el(l(E),E):null;C.rect.current=k,k&&w.set(C.id,k)}return w}return x},[e,s,n,f,l]);return m.useEffect(()=>{u.current=e},[e]),m.useEffect(()=>{f||p()},[n,f]),m.useEffect(()=>{s&&s.length>0&&o(null)},[JSON.stringify(s)]),m.useEffect(()=>{f||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{p(),g.current=null},a))},[a,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:s!=null};function y(){switch(c){case ai.Always:return!1;case ai.BeforeDragging:return n;default:return!n}}}function il(e,t){return yi(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ow(e,t){return il(e,t)}function Iw(e){let{callback:t,disabled:n}=e;const r=Rs(t),i=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return m.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ds(e){let{callback:t,disabled:n}=e;const r=Rs(t),i=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return m.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Lw(e){return new el(bi(e),e)}function Vc(e,t,n){t===void 0&&(t=Lw);const[r,i]=m.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const o=Iw({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),a=Ds({callback:s});return sn(()=>{s(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function Fw(e){const t=il(e);return Dh(e,t)}const $c=[];function Bw(e){const t=m.useRef(e),n=yi(r=>e?r&&r!==$c&&e&&t.current&&e.parentNode===t.current.parentNode?r:Za(e):$c,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function zw(e){const[t,n]=m.useState(null),r=m.useRef(e),i=m.useCallback(s=>{const o=ao(s.target);o&&n(a=>a?(a.set(o,ia(o)),new Map(a)):null)},[]);return m.useEffect(()=>{const s=r.current;if(e!==s){o(s);const a=e.map(l=>{const c=ao(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,ia(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(s)};function o(a){a.forEach(l=>{const c=ao(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,o)=>hr(s,o),Bt):Vh(e):Bt,[e,t])}function Uc(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==Bt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ss(e,n.current):Bt}function Vw(e){m.useEffect(()=>{if(!_s)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function $w(e,t){return m.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=o=>{s(o,t)},n},{}),[e,t])}function Wh(e){return m.useMemo(()=>e?hw(e):null,[e])}const Wc=[];function Uw(e,t){t===void 0&&(t=bi);const[n]=e,r=Wh(n?ht(n):null),[i,s]=m.useState(Wc);function o(){s(()=>e.length?e.map(l=>Bh(l)?r:new el(t(l),l)):Wc)}const a=Ds({callback:o});return sn(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),i}function Hh(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return xi(t)?t:e}function Ww(e){let{measure:t}=e;const[n,r]=m.useState(null),i=m.useCallback(c=>{for(const{target:u}of c)if(xi(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),s=Ds({callback:i}),o=m.useCallback(c=>{const u=Hh(c);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=rs(o);return m.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Hw=[{sensor:rl,options:{}},{sensor:tl,options:{}}],qw={current:{}},Ji={draggable:{measure:Ic},droppable:{measure:Ic,strategy:ai.WhileDragging,frequency:oa.Optimized},dragOverlay:{measure:bi}};class Xr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Kw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:as},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ji,measureDroppableContainers:as,windowRect:null,measuringScheduled:!1},qh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:as,draggableNodes:new Map,over:null,measureDroppableContainers:as},vi=m.createContext(qh),Kh=m.createContext(Kw);function Gw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xr}}}function Yw(e,t){switch(t.type){case Xe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Xe.DragEnd:case Xe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xe.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Xr(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Xe.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new Xr(e.droppable.containers);return o.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Xe.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Xr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Xw(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=m.useContext(vi),s=is(r),o=is(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&s&&o!=null){if(!Xa(s)||document.activeElement===s.target)return;const a=i.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=Hv(u);if(f){f.focus();break}}})}},[r,t,i,o,s]),null}function Gh(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Jw(e){return m.useMemo(()=>({draggable:{...Ji.draggable,...e==null?void 0:e.draggable},droppable:{...Ji.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ji.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Qw(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=m.useRef(!1),{x:o,y:a}=typeof i=="boolean"?{x:i,y:i}:i;sn(()=>{if(!o&&!a||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=Dh(u,r);if(o||(f.x=0),a||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Ih(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,o,a,r,n])}const Os=m.createContext({...Bt,scaleX:1,scaleY:1});var kn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(kn||(kn={}));const Zw=m.memo(function(t){var n,r,i,s;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:u=Hw,collisionDetection:f=Mh,measuring:h,modifiers:p,...g}=t;const b=m.useReducer(Yw,void 0,Gw),[y,x]=b,[w,C]=Jv(),[E,k]=m.useState(kn.Uninitialized),S=E===kn.Initialized,{draggable:{active:A,nodes:T,translate:R},droppable:{containers:N}}=y,D=A!=null?T.get(A):null,P=m.useRef({initial:null,translated:null}),_=m.useMemo(()=>{var Ze;return A!=null?{id:A,data:(Ze=D==null?void 0:D.data)!=null?Ze:qw,rect:P}:null},[A,D]),L=m.useRef(null),[I,H]=m.useState(null),[M,$]=m.useState(null),z=oi(g,Object.values(g)),v=Ms("DndDescribedBy",o),U=m.useMemo(()=>N.getEnabled(),[N]),ne=Jw(h),{droppableRects:j,measureDroppableContainers:K,measuringScheduled:X}=Dw(U,{dragging:S,dependencies:[R.x,R.y],config:ne.droppable}),W=Rw(T,A),Le=m.useMemo(()=>M?os(M):null,[M]),Ce=Rr(),Re=Ow(W,ne.draggable.measure);Qw({activeNode:A!=null?T.get(A):null,config:Ce.layoutShiftCompensation,initialRect:Re,measure:ne.draggable.measure});const ge=Vc(W,ne.draggable.measure,Re),me=Vc(W?W.parentElement:null),je=m.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),be=N.getNodeFor((n=je.current.over)==null?void 0:n.id),de=Ww({measure:ne.dragOverlay.measure}),fe=(r=de.nodeRef.current)!=null?r:W,Ne=S?(i=de.rect)!=null?i:ge:null,nt=!!(de.nodeRef.current&&de.rect),Je=Fw(nt?null:ge),Y=Wh(fe?ht(fe):null),$e=Bw(S?be??W:null),ut=Uw($e),Qe=Gh(p,{transform:{x:R.x-Je.x,y:R.y-Je.y,scaleX:1,scaleY:1},activatorEvent:M,active:_,activeNodeRect:ge,containerNodeRect:me,draggingNodeRect:Ne,over:je.current.over,overlayNodeRect:de.rect,scrollableAncestors:$e,scrollableAncestorRects:ut,windowRect:Y}),Te=Le?hr(Le,R):null,De=zw($e),Fe=Uc(De),O=Uc(De,[ge]),B=hr(Qe,Fe),G=Ne?uw(Ne,Qe):null,J=_&&G?f({active:_,collisionRect:G,droppableRects:j,droppableContainers:U,pointerCoordinates:Te}):null,re=iw(J,"id"),[he,Ue]=m.useState(null),We=nt?Qe:hr(Qe,O),it=lw(We,(s=he==null?void 0:he.rect)!=null?s:null,ge),Be=m.useRef(null),xe=m.useCallback((Ze,st)=>{let{sensor:qe,options:$t}=st;if(L.current==null)return;const pt=T.get(L.current);if(!pt)return;const dt=Ze.nativeEvent,St=new qe({active:L.current,activeNode:pt,event:dt,options:$t,context:je,onAbort(Ye){if(!T.get(Ye))return;const{onDragAbort:Ct}=z.current,jt={id:Ye};Ct==null||Ct(jt),w({type:"onDragAbort",event:jt})},onPending(Ye,Ut,Ct,jt){if(!T.get(Ye))return;const{onDragPending:pn}=z.current,Dt={id:Ye,constraint:Ut,initialCoordinates:Ct,offset:jt};pn==null||pn(Dt),w({type:"onDragPending",event:Dt})},onStart(Ye){const Ut=L.current;if(Ut==null)return;const Ct=T.get(Ut);if(!Ct)return;const{onDragStart:jt}=z.current,hn={activatorEvent:dt,active:{id:Ut,data:Ct.data,rect:P}};ir.unstable_batchedUpdates(()=>{jt==null||jt(hn),k(kn.Initializing),x({type:Xe.DragStart,initialCoordinates:Ye,active:Ut}),w({type:"onDragStart",event:hn}),H(Be.current),$(dt)})},onMove(Ye){x({type:Xe.DragMove,coordinates:Ye})},onEnd:Qt(Xe.DragEnd),onCancel:Qt(Xe.DragCancel)});Be.current=St;function Qt(Ye){return async function(){const{active:Ct,collisions:jt,over:hn,scrollAdjustedTranslate:pn}=je.current;let Dt=null;if(Ct&&pn){const{cancelDrop:mn}=z.current;Dt={activatorEvent:dt,active:Ct,collisions:jt,delta:pn,over:hn},Ye===Xe.DragEnd&&typeof mn=="function"&&await Promise.resolve(mn(Dt))&&(Ye=Xe.DragCancel)}L.current=null,ir.unstable_batchedUpdates(()=>{x({type:Ye}),k(kn.Uninitialized),Ue(null),H(null),$(null),Be.current=null;const mn=Ye===Xe.DragEnd?"onDragEnd":"onDragCancel";if(Dt){const Xn=z.current[mn];Xn==null||Xn(Dt),w({type:mn,event:Dt})}})}}},[T]),He=m.useCallback((Ze,st)=>(qe,$t)=>{const pt=qe.nativeEvent,dt=T.get($t);if(L.current!==null||!dt||pt.dndKit||pt.defaultPrevented)return;const St={active:dt};Ze(qe,st.options,St)===!0&&(pt.dndKit={capturedBy:st.sensor},L.current=$t,xe(qe,st))},[T,xe]),ve=Mw(u,He);Vw(u),sn(()=>{ge&&E===kn.Initializing&&k(kn.Initialized)},[ge,E]),m.useEffect(()=>{const{onDragMove:Ze}=z.current,{active:st,activatorEvent:qe,collisions:$t,over:pt}=je.current;if(!st||!qe)return;const dt={active:st,activatorEvent:qe,collisions:$t,delta:{x:B.x,y:B.y},over:pt};ir.unstable_batchedUpdates(()=>{Ze==null||Ze(dt),w({type:"onDragMove",event:dt})})},[B.x,B.y]),m.useEffect(()=>{const{active:Ze,activatorEvent:st,collisions:qe,droppableContainers:$t,scrollAdjustedTranslate:pt}=je.current;if(!Ze||L.current==null||!st||!pt)return;const{onDragOver:dt}=z.current,St=$t.get(re),Qt=St&&St.rect.current?{id:St.id,rect:St.rect.current,data:St.data,disabled:St.disabled}:null,Ye={active:Ze,activatorEvent:st,collisions:qe,delta:{x:pt.x,y:pt.y},over:Qt};ir.unstable_batchedUpdates(()=>{Ue(Qt),dt==null||dt(Ye),w({type:"onDragOver",event:Ye})})},[re]),sn(()=>{je.current={activatorEvent:M,active:_,activeNode:W,collisionRect:G,collisions:J,droppableRects:j,draggableNodes:T,draggingNode:fe,draggingNodeRect:Ne,droppableContainers:N,over:he,scrollableAncestors:$e,scrollAdjustedTranslate:B},P.current={initial:Ne,translated:G}},[_,W,J,G,T,fe,Ne,j,N,he,$e,B]),Pw({...Ce,delta:R,draggingRect:G,pointerCoordinates:Te,scrollableAncestors:$e,scrollableAncestorRects:ut});const Mt=m.useMemo(()=>({active:_,activeNode:W,activeNodeRect:ge,activatorEvent:M,collisions:J,containerNodeRect:me,dragOverlay:de,draggableNodes:T,droppableContainers:N,droppableRects:j,over:he,measureDroppableContainers:K,scrollableAncestors:$e,scrollableAncestorRects:ut,measuringConfiguration:ne,measuringScheduled:X,windowRect:Y}),[_,W,ge,M,J,me,de,T,N,j,he,K,$e,ut,ne,X,Y]),Vt=m.useMemo(()=>({activatorEvent:M,activators:ve,active:_,activeNodeRect:ge,ariaDescribedById:{draggable:v},dispatch:x,draggableNodes:T,over:he,measureDroppableContainers:K}),[M,ve,_,ge,x,v,T,he,K]);return Ie.createElement(Rh.Provider,{value:C},Ie.createElement(vi.Provider,{value:Vt},Ie.createElement(Kh.Provider,{value:Mt},Ie.createElement(Os.Provider,{value:it},c)),Ie.createElement(Xw,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Ie.createElement(ew,{...a,hiddenTextDescribedById:v}));function Rr(){const Ze=(I==null?void 0:I.autoScrollEnabled)===!1,st=typeof l=="object"?l.enabled===!1:l===!1,qe=S&&!Ze&&!st;return typeof l=="object"?{...l,enabled:qe}:{enabled:qe}}}),e1=m.createContext(null),Hc="button",t1="Draggable";function Yh(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Ms(t1),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=m.useContext(vi),{role:p=Hc,roleDescription:g="draggable",tabIndex:b=0}=i??{},y=(l==null?void 0:l.id)===t,x=m.useContext(y?Os:e1),[w,C]=rs(),[E,k]=rs(),S=$w(o,t),A=oi(n);sn(()=>(f.set(t,{id:t,key:s,node:w,activatorNode:E,data:A}),()=>{const R=f.get(t);R&&R.key===s&&f.delete(t)}),[f,t]);const T=m.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":y&&p===Hc?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,p,b,y,g,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:y,listeners:r?void 0:S,node:w,over:h,setNodeRef:C,setActivatorNodeRef:k,transform:x}}function Xh(){return m.useContext(Kh)}const n1="Droppable",r1={timeout:25};function sl(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Ms(n1),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=m.useContext(vi),u=m.useRef({disabled:n}),f=m.useRef(!1),h=m.useRef(null),p=m.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:y}={...r1,...i},x=oi(b??r),w=m.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(x.current)?x.current:[x.current]),p.current=null},y)},[y]),C=Ds({callback:w,disabled:g||!o}),E=m.useCallback((T,R)=>{C&&(R&&(C.unobserve(R),f.current=!1),T&&C.observe(T))},[C]),[k,S]=rs(E),A=oi(t);return m.useEffect(()=>{!C||!k.current||(C.disconnect(),f.current=!1,C.observe(k.current))},[k,C]),m.useEffect(()=>(a({type:Xe.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:h,data:A}}),()=>a({type:Xe.UnregisterDroppable,key:s,id:r})),[r]),m.useEffect(()=>{n!==u.current.disabled&&(a({type:Xe.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:o,rect:h,isOver:(l==null?void 0:l.id)===r,node:k,over:l,setNodeRef:S}}function i1(e){let{animation:t,children:n}=e;const[r,i]=m.useState(null),[s,o]=m.useState(null),a=is(n);return!n&&!r&&a&&i(a),sn(()=>{if(!s)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){i(null);return}Promise.resolve(t(c,s)).then(()=>{i(null)})},[t,r,s]),Ie.createElement(Ie.Fragment,null,n,r?m.cloneElement(r,{ref:o}):null)}const s1={x:0,y:0,scaleX:1,scaleY:1};function o1(e){let{children:t}=e;return Ie.createElement(vi.Provider,{value:qh},Ie.createElement(Os.Provider,{value:s1},t))}const a1={position:"fixed",touchAction:"none"},l1=e=>Xa(e)?"transform 250ms ease":void 0,c1=m.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:o,rect:a,style:l,transform:c,transition:u=l1}=e;if(!a)return null;const f=i?c:{...c,scaleX:1,scaleY:1},h={...a1,width:a.width,height:a.height,top:a.top,left:a.left,transform:xr.Transform.toString(f),transformOrigin:i&&r?nw(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return Ie.createElement(n,{className:o,style:h,ref:t},s)}),u1=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:s,className:o}=e;if(s!=null&&s.active)for(const[a,l]of Object.entries(s.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(s!=null&&s.dragOverlay)for(const[a,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(i))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},d1=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:xr.Transform.toString(t)},{transform:xr.Transform.toString(n)}]},f1={duration:250,easing:"ease",keyframes:d1,sideEffects:u1({styles:{active:{opacity:"0"}}})};function h1(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Rs((s,o)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const c=Hh(o);if(!c)return;const{transform:u}=ht(o).getComputedStyle(o),f=Oh(u);if(!f)return;const h=typeof t=="function"?t:p1(t);return $h(l,i.draggable.measure),h({active:{id:s,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function p1(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...f1,...e};return s=>{let{active:o,dragOverlay:a,transform:l,...c}=s;if(!t)return;const u={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-u.x,y:l.y-u.y,...f},p=i({...c,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[g]=p,b=p[p.length-1];if(JSON.stringify(g)===JSON.stringify(b))return;const y=r==null?void 0:r({active:o,dragOverlay:a,...c}),x=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(w=>{x.onfinish=()=>{y==null||y(),w()}})}}let qc=0;function m1(e){return m.useMemo(()=>{if(e!=null)return qc++,qc},[e])}const g1=Ie.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:s,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:g,droppableContainers:b,dragOverlay:y,over:x,measuringConfiguration:w,scrollableAncestors:C,scrollableAncestorRects:E,windowRect:k}=Xh(),S=m.useContext(Os),A=m1(f==null?void 0:f.id),T=Gh(o,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:y.rect,over:x,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:E,transform:S,windowRect:k}),R=il(h),N=h1({config:r,draggableNodes:g,droppableContainers:b,measuringConfiguration:w}),D=R?y.setRef:void 0;return Ie.createElement(o1,null,Ie.createElement(i1,{animation:N},f&&A?Ie.createElement(c1,{key:A,id:f.id,ref:D,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:R,style:{zIndex:c,...i},transform:T},n):null))}),x1="cc-card-display",y1={effort:!0,category:!0,priority:!0,tags:!0,project:!0};function b1(){const[e,t]=$n(x1,y1),n=m.useCallback(s=>{t(o=>({...o,[s]:!o[s]}))},[t]),r=e.effort&&e.category&&e.priority&&e.tags,i=[e.effort,e.category,e.priority,e.tags,e.project].filter(s=>!s).length;return{display:e,toggle:n,isAllVisible:r,hiddenCount:i}}const ol=["critical","high","medium","low"],al=["feature","bugfix","refactor","infrastructure","docs"],Is=["<1H","1-4H","4H+","TBD"],Jh=["has-blockers","blocks-others","no-deps"],Qh=[{id:"frontend-designer",label:"Frontend Designer",emoji:"🎨",color:"#EC4899"},{id:"architect",label:"Architect",emoji:"🏗️",color:"#536dfe"},{id:"rules-enforcer",label:"Rules Enforcer",emoji:"📋",color:"#6B7280"}];function v1(e){return Object.fromEntries(Qh.map(n=>[n.id,n.emoji]))}function w1(e){return Object.fromEntries(Qh.map(n=>[n.id,n.color]))}const i5=v1(),s5=w1();function k1(e){if(!e)return"TBD";const t=e.toLowerCase().trim(),n=t.match(/(\d+(?:\.\d+)?)\s*(?:-\s*\d+(?:\.\d+)?)?\s*hour/);if(n){const s=parseFloat(n[1]);return s<1?"<1H":s<=4?"1-4H":"4H+"}if(t.match(/(\d+)\s*(?:-\s*\d+)?\s*min/))return"<1H";const i=t.match(/\((\d+(?:\.\d+)?)\s*(?:-\s*\d+(?:\.\d+)?)?\s*(hour|min)/);if(i){const s=parseFloat(i[1]);return i[2].startsWith("min")||s<1?"<1H":s<=4?"1-4H":"4H+"}return t.includes("large")||t.includes("multi")?"4H+":t.includes("medium")||t.includes("half")?"1-4H":t.includes("small")?"<1H":"TBD"}function S1(e){const t=[];return e.blocked_by.length>0&&t.push("has-blockers"),e.blocks.length>0&&t.push("blocks-others"),e.blocked_by.length===0&&e.blocks.length===0&&t.push("no-deps"),t}function ll(e,t){switch(t){case"priority":return e.priority?[e.priority]:[];case"category":return e.category?[e.category]:[];case"tags":return e.tags;case"effort":return[k1(e.effort_estimate)];case"dependencies":return S1(e);case"project":return e.project_id?[e.project_id]:[]}}function C1(e,t,n){return n.size===0?!0:ll(e,t).some(i=>n.has(i))}function Kc(){return{priority:new Set,category:new Set,tags:new Set,effort:new Set,dependencies:new Set}}function j1(e){const[t,n]=m.useState(Kc),r=m.useCallback((c,u)=>{n(f=>{const h={...f,[c]:new Set(f[c])};return h[c].has(u)?h[c].delete(u):h[c].add(u),h})},[]),i=m.useCallback(c=>{n(u=>({...u,[c]:new Set}))},[]),s=m.useCallback(()=>{n(Kc())},[]),o=m.useMemo(()=>Object.values(t).some(c=>c.size>0),[t]),a=m.useMemo(()=>o?e.filter(c=>Object.keys(t).every(u=>C1(c,u,t[u]))):e,[e,t,o]),l=m.useMemo(()=>{const c=new Set;for(const x of e)for(const w of x.tags)c.add(w);const u=[...c].sort();function f(x,w){return e.filter(C=>ll(C,x).includes(w)).length}const h=ol.map(x=>({value:x,label:x,count:f("priority",x)})),p=al.map(x=>({value:x,label:x,count:f("category",x)})),g=u.map(x=>({value:x,label:x,count:f("tags",x)})),b=Is.map(x=>({value:x,label:x,count:f("effort",x)})),y=Jh.map(x=>({value:x,label:x==="has-blockers"?"Has blockers":x==="blocks-others"?"Blocks others":"No dependencies",count:f("dependencies",x)}));return{priority:h,category:p,tags:g,effort:b,dependencies:y}},[e]);return{filters:t,toggleFilter:r,clearField:i,clearAll:s,hasActiveFilters:o,filteredScopes:a,optionsWithCounts:l}}const E1="cc-board-sort",N1="cc-board-collapsed",Zh={id:"asc",priority:"asc",effort:"asc",updated_at:"desc",created_at:"desc",title:"asc"},Gc={critical:0,high:1,medium:2,low:3};function Yc(e){if(!e)return 1/0;const t=Is.indexOf(e);return t>=0?t:1/0}const T1={field:"id",direction:"asc"},P1={deserialize:e=>{const t=JSON.parse(e);if(t.field in Zh)return{field:t.field,direction:t.direction==="desc"?"desc":"asc"}}};function aa(e,t,n){return[...e].sort((i,s)=>{const o=A1(i,s,t);return n==="desc"?-o:o})}function A1(e,t,n){switch(n){case"id":return e.id-t.id;case"priority":{const r=e.priority?Gc[e.priority]??1/0:1/0,i=t.priority?Gc[t.priority]??1/0:1/0;return r-i}case"effort":return Yc(e.effort_estimate)-Yc(t.effort_estimate);case"updated_at":{const r=e.updated_at?new Date(e.updated_at).getTime():0,i=t.updated_at?new Date(t.updated_at).getTime():0;return r-i}case"created_at":{const r=e.created_at?new Date(e.created_at).getTime():0,i=t.created_at?new Date(t.created_at).getTime():0;return r-i}case"title":return e.title.localeCompare(t.title);default:return 0}}function _1(){const[e,t]=$n(E1,T1,P1),[n,r]=$n(N1,new Set,Sh),i=m.useCallback(o=>{t(a=>{const l=a.field===o?a.direction==="asc"?"desc":"asc":Zh[o];return{field:o,direction:l}})},[t]),s=m.useCallback(o=>{r(a=>{const l=new Set(a);return l.has(o)?l.delete(o):l.add(o),l})},[r]);return{sortField:e.field,sortDirection:e.direction,setSort:i,collapsed:n,toggleCollapse:s}}const R1="cc-view-mode",M1="cc-swim-group",D1="cc-swim-collapsed",O1={serialize:e=>e,deserialize:e=>e==="kanban"||e==="swimlane"?e:void 0},I1={serialize:e=>e,deserialize:e=>e==="priority"||e==="category"||e==="tags"||e==="effort"||e==="dependencies"||e==="project"?e:void 0};function L1(){const[e,t]=$n(R1,"kanban",O1),[n,r]=$n(M1,"priority",I1),[i,s]=$n(D1,new Set,Sh),o=m.useCallback(l=>{r(l),s(new Set)},[r,s]),a=m.useCallback(l=>{s(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u})},[s]);return{viewMode:e,setViewMode:t,groupField:n,setGroupField:o,collapsedLanes:i,toggleLaneCollapse:a}}function F1(){const{settings:e}=Ka();return m.useMemo(()=>e.fontScale===1?[]:[({transform:n})=>({...n,x:n.x/e.fontScale,y:n.y/e.fontScale})],[e.fontScale])}function B1(e,t){var n;if(e.phase)return e.phase;if(t.includes(e.id)||e.gitBranch)return"shipped";if(e.isEntryPoint||e.group==="planning")return"queued";if(e.sessionKey){if(e.sessionKey.toLowerCase().includes("implement"))return"active";if(e.sessionKey.toLowerCase().includes("review")||e.sessionKey.toLowerCase().includes("gate")||e.sessionKey.toLowerCase().includes("commit")||e.sessionKey.toLowerCase().includes("verify"))return"review";if(e.sessionKey.toLowerCase().includes("push")||e.sessionKey.toLowerCase().includes("deploy"))return"shipped";if(e.sessionKey.toLowerCase().includes("create")||e.sessionKey.toLowerCase().includes("scope"))return"queued"}return e.group==="development"?e.order<=3?"active":"review":e.group==="active"?"active":(n=e.group)!=null&&n.startsWith("deploy")||e.group==="main"?"shipped":"queued"}const z1=[{phase:"queued",label:"Queued",order:0},{phase:"active",label:"Active",order:1},{phase:"review",label:"Review",order:2},{phase:"shipped",label:"Shipped",order:3}];class yr{constructor(t){yt(this,"phaseMap");this.engine=t,this.phaseMap=new Map;const n=t.getLists(),r=t.getConfig().terminalStatuses??[];for(const i of n)this.phaseMap.set(i.id,B1(i,r))}getPhase(t){return this.phaseMap.get(t)??"queued"}getListsForPhase(t){return this.engine.getLists().filter(n=>this.getPhase(n.id)===t)}getPhaseMap(){return this.phaseMap}resolveNormalizedTransition(t,n){return this.engine.getConfig().edges.filter(i=>i.from===t&&this.getPhase(i.to)===n)}}function V1(e){if(e.length<=1)return!0;const t=e[0].getLists().map(n=>n.id).join(",");return e.every(n=>n.getLists().map(r=>r.id).join(",")===t)}async function $1(e,t){try{const n=await fetch(e(`/dispatch/active?scope_id=${t}`));if(!n.ok)return!1;const{active:r}=await n.json();return r!=null}catch{return!1}}function uo(e){const t=String(e);if(t.startsWith("sprint-drop-"))return{type:"sprint-drop",sprintId:parseInt(t.slice(12))};if(t.startsWith("sprint-"))return{type:"sprint",sprintId:parseInt(t.slice(7))};if(typeof e=="number"||/^-?\d+$/.test(t))return{type:"scope",scopeId:Number(e)};if(t.startsWith("swim::")){const r=t.lastIndexOf("::");return{type:"column",status:t.slice(r+2)}}const n=t.match(/^(.+?)::(-?\d+)$/);return n?{type:"scope",scopeId:Number(n[2]),projectId:n[1]}:{type:"column",status:t}}const U1={activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,pending:null,showModal:!1,showPopover:!1,showIdeaForm:!1,dispatching:!1,error:null,pendingSprintDispatch:null,pendingUnmetDeps:null,pendingDepSprintId:null,pendingDisambiguation:null};function W1({scopes:e,sprints:t,onAddToSprint:n,onRemoveFromSprint:r,isPhaseView:i,projectEngines:s,defaultProjectId:o}){const{engine:a}=dn(),l=Xt(),{getApiBase:c,hasMultipleProjects:u}=Rt(),f=m.useCallback((M,$)=>u&&M.project_id?`${c(M.project_id)}${$}`:l($),[l,c,u]),h=m.useCallback(async(M,$)=>{const z=ne=>f(M,ne),v=$.command!=null&&M.id>0?await $1(z,M.id):!1,U=$.confirmLevel==="full";g(ne=>({...ne,pending:{scope:M,transition:$,hasActiveSession:v},showModal:U,showPopover:!U,error:null}))},[f]),[p,g]=m.useState(U1),b=m.useRef(null),y=m.useRef(null);m.useEffect(()=>{b.current=p.activeScope,y.current=p.activeSprint},[p.activeScope,p.activeSprint]);const x=m.useCallback(M=>{const $=uo(M.active.id);if($){if($.type==="scope"){const z=e.find(v=>v.id===$.scopeId&&(!$.projectId||v.project_id===$.projectId));z&&g(v=>({...v,activeScope:z,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,error:null}))}else if($.type==="sprint"){const z=t.find(v=>v.id===$.sprintId);z&&g(v=>({...v,activeScope:null,activeSprint:z,overId:null,overIsValid:!1,overSprintId:null,error:null}))}}},[e,t]),w=m.useCallback(M=>{var ne;const $=(ne=M.over)==null?void 0:ne.id;if(!$){g(j=>({...j,overId:null,overIsValid:!1,overSprintId:null}));return}const z=uo($);if(!z)return;const v=y.current,U=b.current;if(v){if(z.type==="column"){const j=v.status!=="assembling"?a.getBatchTargetStatus(v.target_column)??v.target_column:v.target_column,K=a.isValidTransition(j,z.status);g(X=>({...X,overId:K?z.status:null,overIsValid:K,overSprintId:null}))}else g(j=>({...j,overId:null,overIsValid:!1,overSprintId:null}));return}if(U)if(t.some(K=>K.status==="assembling"&&K.scope_ids.includes(U.id))){const K=z.type==="column"&&z.status===U.status;g(X=>({...X,overId:K?z.status:null,overIsValid:K,overSprintId:null}))}else if(z.type==="sprint-drop"){const K=t.find(W=>W.id===z.sprintId),X=(K==null?void 0:K.status)==="assembling"&&U.status===K.target_column&&(!U.project_id||!K.project_id||U.project_id===K.project_id);g(W=>({...W,overId:null,overIsValid:!!X,overSprintId:z.sprintId}))}else if(z.type==="column"){let K;if(i&&U.project_id&&s){const X=s.get(U.project_id);X?K=new yr(X).resolveNormalizedTransition(U.status,z.status).length>0:K=!1}else K=a.isValidTransition(U.status,z.status);g(X=>({...X,overId:z.status,overIsValid:K,overSprintId:null}))}else g(K=>({...K,overId:null,overIsValid:!1,overSprintId:null}))},[t,a,i,s]),C=m.useCallback(async M=>{var ne;const $=(ne=M.over)==null?void 0:ne.id,z=b.current,v=y.current;if(g(j=>({...j,activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null})),!$)return;const U=uo($);if(U){if(v&&U.type==="column"){const j=v.status!=="assembling"?a.getBatchTargetStatus(v.target_column)??v.target_column:v.target_column;if(a.isValidTransition(j,U.status)){g(K=>({...K,pendingSprintDispatch:v}));return}}if(z&&U.type==="sprint-drop"){const j=t.find(X=>X.id===U.sprintId);if(j&&(z.status!==j.target_column||z.project_id&&j.project_id&&z.project_id!==j.project_id)){g(X=>({...X,error:z.project_id!==(j==null?void 0:j.project_id)?`Cannot add scope from a different project to this ${j.group_type}`:`Cannot add ${z.status} scope to ${j.target_column} ${j.group_type} — scope status must match ${j.group_type} column`}));return}const K=await n(U.sprintId,[z.id]);K&&K.unmet_dependencies.length>0&&g(X=>({...X,pendingUnmetDeps:K.unmet_dependencies,pendingDepSprintId:U.sprintId}));return}if(z&&U.type==="column"){if(z.status===U.status){const K=t.find(X=>X.status==="assembling"&&X.scope_ids.includes(z.id));K&&await r(K.id,[z.id]);return}let j;if(i&&z.project_id&&s){const K=s.get(z.project_id);if(K){const W=new yr(K).resolveNormalizedTransition(z.status,U.status);if(W.length>1){g(Le=>({...Le,pendingDisambiguation:{scope:z,edges:W}}));return}j=W[0]}}else j=a.findEdge(z.status,U.status);if(!j)return;await h(z,j)}}},[n,r,a,t,h,i,s]),E=m.useCallback(async()=>{const{pending:M}=p;if(!M)return;g(j=>({...j,dispatching:!0,error:null}));const{scope:$,transition:z}=M,v=i&&$.project_id&&(s==null?void 0:s.get($.project_id))||a,U=v.buildCommand(z,$.id),ne=j=>f($,j);try{const j=v.getEntryPoint().id;if($.status===j&&z.direction==="forward"&&$.slug){const X=await fetch(ne(`/ideas/${$.slug}/promote`),{method:"POST"});if(!X.ok){const W=await X.json().catch(()=>({error:"Request failed"}));throw new Error(W.error??`HTTP ${X.status}`)}}else if(U){const X=await fetch(ne("/dispatch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_id:$.id,command:U,transition:z.skipServerTransition?void 0:{from:z.from,to:z.to}})});if(!X.ok){const W=await X.json().catch(()=>({error:"Request failed"}));throw new Error(W.error??`HTTP ${X.status}`)}}else{const X=await fetch(ne(`/scopes/${$.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:z.to})});if(!X.ok){const W=await X.json().catch(()=>({error:"Request failed"}));throw new Error(W.error??`Failed to update scope status: HTTP ${X.status}`)}}g(X=>({...X,pending:null,showModal:!1,showPopover:!1,dispatching:!1}))}catch(j){g(K=>({...K,dispatching:!1,error:j instanceof Error?j.message:"Dispatch failed"}))}},[p,a,f,i,s]),k=m.useCallback(async M=>{const $=p.pendingDisambiguation;$&&(g(z=>({...z,pendingDisambiguation:null})),await h($.scope,M))},[p.pendingDisambiguation,h]),S=m.useCallback(()=>{g(M=>({...M,pendingDisambiguation:null}))},[]),A=m.useCallback(()=>{g(M=>({...M,pending:null,showModal:!1,showPopover:!1,dispatching:!1,error:null}))},[]),T=m.useCallback(()=>{g(M=>({...M,error:null}))},[]),R=m.useCallback(()=>{g(M=>({...M,showPopover:!1,showModal:!0}))},[]),N=m.useCallback(()=>{g(M=>({...M,showIdeaForm:!0}))},[]),D=m.useCallback(()=>{g(M=>({...M,showIdeaForm:!1}))},[]),P=m.useCallback(async(M,$)=>{g(z=>({...z,dispatching:!0,error:null}));try{const z=o?`${c(o)}/ideas`:l("/ideas"),v=await fetch(z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:M,description:$})});if(!v.ok){const U=await v.json().catch(()=>({error:"Request failed"}));throw new Error(U.error??`HTTP ${v.status}`)}g(U=>({...U,dispatching:!1,showIdeaForm:!1}))}catch(z){g(v=>({...v,dispatching:!1,error:z instanceof Error?z.message:"Failed to create idea"}))}},[l,o,c]),_=m.useCallback(()=>{g(M=>({...M,pendingSprintDispatch:null}))},[]),L=m.useCallback(()=>{g(M=>({...M,pendingUnmetDeps:null,pendingDepSprintId:null}))},[]),I=m.useCallback(async M=>{p.pendingDepSprintId!=null&&await n(p.pendingDepSprintId,M),g($=>({...$,pendingUnmetDeps:null,pendingDepSprintId:null}))},[p.pendingDepSprintId,n]),H=m.useCallback((M,$)=>{g(z=>({...z,pendingUnmetDeps:$,pendingDepSprintId:M}))},[]);return{state:p,onDragStart:x,onDragOver:w,onDragEnd:C,confirmTransition:E,cancelTransition:A,dismissError:T,openModalFromPopover:R,openIdeaForm:N,closeIdeaForm:D,submitIdea:P,dismissSprintDispatch:_,dismissUnmetDeps:L,resolveUnmetDeps:I,showUnmetDeps:H,selectDisambiguation:k,dismissDisambiguation:S}}function sr(e){return e.project_id?`${e.project_id}::${e.id}`:String(e.id)}function Oi(e,t,n){return e.id!==t?!1:n?!e.project_id||e.project_id===n:!0}function H1(){const e=Xt(),{activeProjectId:t,getApiBase:n,hasMultipleProjects:r}=Rt(),[i,s]=m.useState([]),[o,a]=m.useState(!0),l=m.useRef(!1),c=m.useCallback(async E=>{try{const k=await fetch(e("/sprints"),{signal:E});if(!k.ok)return;const S=await k.json();if(t)for(const A of S)A.project_id||(A.project_id=t);s(S)}catch(k){if(k instanceof DOMException&&k.name==="AbortError")return;console.warn("[Orbital] Failed to fetch sprints:",k)}finally{E!=null&&E.aborted||a(!1)}},[e,t]);m.useEffect(()=>{const E=new AbortController;return c(E.signal),()=>E.abort()},[c]),Ns(c),m.useEffect(()=>{function E(T){l.current||s(R=>{const N=sr(T);return R.some(D=>sr(D)===N)?R:[T,...R]})}function k(T){l.current||s(R=>{const N=R.findIndex(D=>Oi(D,T.id,T.project_id));if(N>=0){const D=[...R];return D[N]=T,D}return[T,...R]})}function S({id:T,project_id:R}){l.current||s(N=>N.filter(D=>!Oi(D,T,R)))}function A(T){l.current||s(R=>{const N=R.findIndex(D=>Oi(D,T.id,T.project_id));if(N>=0){const D=[...R];return D[N]=T,D}return R})}return Q.on("sprint:created",E),Q.on("sprint:updated",k),Q.on("sprint:deleted",S),Q.on("sprint:completed",A),()=>{Q.off("sprint:created",E),Q.off("sprint:updated",k),Q.off("sprint:deleted",S),Q.off("sprint:completed",A)}},[]);const u=m.useCallback(async(E,k)=>{const{projectId:S,...A}=k??{},T=S?`${n(S)}/sprints`:e("/sprints"),R=await fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E,...A})});if(!R.ok)return null;const N=await R.json();return S&&!N.project_id&&(N.project_id=S),N},[e,n]),f=m.useCallback((E,k)=>{if(r){const S=i.find(A=>A.id===E);if(S!=null&&S.project_id)return`${n(S.project_id)}${k}`}return e(k)},[e,n,r,i]),h=m.useCallback(async(E,k)=>(await fetch(f(E,`/sprints/${E}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})})).ok,[f]),p=m.useCallback(async E=>(await fetch(f(E,`/sprints/${E}`),{method:"DELETE"})).ok,[f]),g=m.useCallback(async(E,k)=>{const S=await fetch(f(E,`/sprints/${E}/scopes`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:k})});return S.ok?S.json():null},[f]),b=m.useCallback(async(E,k)=>(await fetch(f(E,`/sprints/${E}/scopes`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:k})})).ok,[f]),y=m.useCallback(async E=>(await fetch(f(E,`/sprints/${E}/dispatch`),{method:"POST"})).json(),[f]),x=m.useCallback(async E=>(await fetch(f(E,`/sprints/${E}/cancel`),{method:"POST"})).ok,[f]),w=m.useCallback(async E=>{const k=await fetch(f(E,`/sprints/${E}/graph`));return k.ok?k.json():null},[f]),C=m.useCallback(async(E,k,S)=>{const A=i.find(D=>D.id===E&&D.project_id===k);if(!A||A.scope_ids.length>0||A.status!=="assembling")return null;if(l.current=!0,s(D=>D.map(P=>Oi(P,E,k)?{...P,project_id:S}:P)),!(await fetch(`${n(k)}/sprints/${E}`,{method:"DELETE"})).ok)return l.current=!1,s(D=>D.map(P=>P.id===E&&P.project_id===S?{...P,project_id:k}:P)),null;const R=await fetch(`${n(S)}/sprints`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A.name,target_column:A.target_column,group_type:A.group_type})});if(!R.ok)return l.current=!1,s(D=>D.filter(P=>!(P.id===E&&P.project_id===S))),null;const N=await R.json();return N.project_id=S,s(D=>{const P=sr(N);let _=!1;return D.reduce((I,H)=>!_&&H.id===E&&H.project_id===S?(_=!0,I.push(N),I):(sr(H)===P||I.push(H),I),[])}),setTimeout(()=>{l.current=!1},500),N},[i,n]);return{sprints:i,loading:o,refetch:c,createSprint:u,renameSprint:h,deleteSprint:p,addScopes:g,removeScopes:b,dispatchSprint:y,cancelSprint:x,getGraph:w,moveSprintToProject:C}}function q1(e,t,n,r){const[i,s]=m.useState(null),[o,a]=m.useState(!1);m.useEffect(()=>{if(!e)return;let u=!1;return a(!0),t(e.id).then(f=>{u||(s(f),a(!1))}),()=>{u=!0}},[e,t]);const l=m.useCallback(async()=>{e&&(await n(e.id),r(),s(null))},[e,n,r]),c=m.useCallback(()=>{r(),s(null)},[r]);return{graph:i,loading:o,showPreflight:e!=null,pendingSprint:e,onConfirm:l,onCancel:c}}function K1(e,t){const n=Xt(),[r,i]=m.useState(!1),s=m.useCallback(async()=>{i(!0);try{const l=await fetch(n("/ideas/surprise"),{method:"POST"});if(!l.ok){const c=await l.json().catch(()=>({error:"Request failed"}));throw new Error(c.error??`HTTP ${l.status}`)}e()}catch(l){console.error("[Orbital] Surprise Me failed:",l)}finally{i(!1)}},[e,n]),o=m.useCallback(async l=>{try{const c=await fetch(n(`/ideas/${l}/approve`),{method:"POST"});if(!c.ok)throw new Error(`HTTP ${c.status}`);t(null)}catch(c){console.error("[Orbital] Failed to approve idea:",c)}},[t,n]),a=m.useCallback(l=>{t(null),fetch(n(`/ideas/${l}`),{method:"DELETE"}).catch(()=>{})},[t,n]);return{surpriseLoading:r,handleSurprise:s,handleApproveGhost:o,handleRejectGhost:a}}function G1(e){return(e.split("/").pop()??"").replace(/\.md$/,"").toLowerCase()}function Xc(e,t){var r,i,s;const n=t.toLowerCase().trim();return!!(!n||e.title.toLowerCase().includes(n)||String(e.id).startsWith(n)||G1(e.file_path).includes(n)||(r=e.category)!=null&&r.toLowerCase().includes(n)||(i=e.priority)!=null&&i.toLowerCase().includes(n)||(s=e.effort_estimate)!=null&&s.toLowerCase().includes(n)||e.status.toLowerCase().includes(n)||e.tags.some(o=>o.toLowerCase().includes(n)))}function Y1(e){const[t,n]=m.useState(""),[r,i]=m.useState("filter"),s=m.useDeferredValue(t),o=s.trim().length>0,a=t!==s,{displayScopes:l,dimmedIds:c,matchCount:u}=m.useMemo(()=>{if(!o)return{displayScopes:e,dimmedIds:new Set,matchCount:e.length};if(r==="filter"){const p=e.filter(g=>Xc(g,s));return{displayScopes:p,dimmedIds:new Set,matchCount:p.length}}const f=new Set;let h=0;for(const p of e)Xc(p,s)?h++:f.add(ce(p));return{displayScopes:e,dimmedIds:f,matchCount:h}},[e,s,o,r]);return{query:t,setQuery:n,mode:r,setMode:i,hasSearch:o,isStale:a,displayScopes:l,dimmedIds:c,matchCount:u}}function X1(){const[e,t]=Ef(),n=e.get("highlight")??null,r=m.useCallback(()=>{t(i=>(i.delete("highlight"),i),{replace:!0})},[t]);return{highlightedScopeKey:n,clearHighlight:r}}const cl=m.createContext({});function ul(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ls=m.createContext(null),dl=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class J1 extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Q1({children:e,isPresent:t}){const n=m.useId(),r=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=m.useContext(dl);return m.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:c}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return s&&(u.nonce=s),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
303
303
  [data-motion-pop-id="${n}"] {
304
304
  position: absolute !important;
305
305
  width: ${o}px !important;
@@ -307,35 +307,35 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
307
307
  top: ${l}px !important;
308
308
  left: ${c}px !important;
309
309
  }
310
- `),()=>{document.head.removeChild(u)}},[t]),d.jsx(J1,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const Z1=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=ul(ek),l=m.useId(),c=m.useCallback(f=>{a.set(f,!0);for(const h of a.values())if(!h)return;r&&r()},[a,r]),u=m.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c,register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random(),c]:[n,c]);return m.useMemo(()=>{a.forEach((f,h)=>a.set(h,!1))},[n]),m.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=d.jsx(Q1,{isPresent:n,children:e})),d.jsx(Ls.Provider,{value:u,children:e})};function ek(){return new Map}function tp(e=!0){const t=m.useContext(Ls);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=m.useId();m.useEffect(()=>{e&&i(s)},[e]);const o=m.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ii=e=>e.key||"";function Qc(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const fl=typeof window<"u",np=fl?m.useLayoutEffect:m.useEffect,cs=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1})=>{const[a,l]=tp(o),c=m.useMemo(()=>Qc(e),[e]),u=o&&!a?[]:c.map(Ii),f=m.useRef(!0),h=m.useRef(c),p=ul(()=>new Map),[g,b]=m.useState(c),[y,x]=m.useState(c);np(()=>{f.current=!1,h.current=c;for(let E=0;E<y.length;E++){const k=Ii(y[E]);u.includes(k)?p.delete(k):p.get(k)!==!0&&p.set(k,!1)}},[y,u.length,u.join("-")]);const w=[];if(c!==g){let E=[...c];for(let k=0;k<y.length;k++){const S=y[k],A=Ii(S);u.includes(A)||(E.splice(k,0,S),w.push(S))}s==="wait"&&w.length&&(E=w),x(Qc(E)),b(c);return}const{forceRender:C}=m.useContext(cl);return d.jsx(d.Fragment,{children:y.map(E=>{const k=Ii(E),S=o&&!a?!1:c===y||u.includes(k),A=()=>{if(p.has(k))p.set(k,!0);else return;let T=!0;p.forEach(R=>{R||(T=!1)}),T&&(C==null||C(),x(h.current),o&&(l==null||l()),r&&r())};return d.jsx(Z1,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:A,children:E},k)})})},gt=e=>e;let o5=gt,rp=gt;function hl(e){let t;return()=>(t===void 0&&(t=e()),t)}const br=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},tn=e=>e*1e3,nn=e=>e/1e3,tk={useManualTiming:!1};function nk(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),e()),c(o)}const l={schedule:(c,u=!1,f=!1)=>{const p=f&&r?t:n;return u&&s.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(o=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Li=["read","resolveKeyframes","update","preRender","render","postRender"],rk=40;function ip(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Li.reduce((x,w)=>(x[w]=nk(s),x),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,p=()=>{const x=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,rk),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Li.reduce((x,w)=>{const C=o[w];return x[w]=(E,k=!1,S=!1)=>(n||g(),C.schedule(E,k,S)),x},{}),cancel:x=>{for(let w=0;w<Li.length;w++)o[Li[w]].cancel(x)},state:i,steps:o}}const{schedule:_e,cancel:jn,state:rt,steps:fo}=ip(typeof requestAnimationFrame<"u"?requestAnimationFrame:gt,!0),sp=m.createContext({strict:!1}),Zc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},vr={};for(const e in Zc)vr[e]={isEnabled:t=>Zc[e].some(n=>!!t[n])};function ik(e){for(const t in e)vr[t]={...vr[t],...e[t]}}const sk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function us(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||sk.has(e)}let op=e=>!us(e);function ok(e){e&&(op=t=>t.startsWith("on")?!us(t):e(t))}try{ok(require("@emotion/is-prop-valid").default)}catch{}function ak(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(op(i)||n===!0&&us(i)||!t&&!us(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function lk(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Fs=m.createContext({});function li(e){return typeof e=="string"||Array.isArray(e)}function Bs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const pl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ml=["initial",...pl];function zs(e){return Bs(e.animate)||ml.some(t=>li(e[t]))}function ap(e){return!!(zs(e)||e.variants)}function ck(e,t){if(zs(e)){const{initial:n,animate:r}=e;return{initial:n===!1||li(n)?n:void 0,animate:li(r)?r:void 0}}return e.inherit!==!1?t:{}}function uk(e){const{initial:t,animate:n}=ck(e,m.useContext(Fs));return m.useMemo(()=>({initial:t,animate:n}),[eu(t),eu(n)])}function eu(e){return Array.isArray(e)?e.join(" "):e}const dk=Symbol.for("motionComponentSymbol");function or(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fk(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):or(n)&&(n.current=r))},[t])}const gl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),hk="framerAppearId",lp="data-"+gl(hk),{schedule:xl}=ip(queueMicrotask,!1),cp=m.createContext({});function pk(e,t,n,r,i){var s,o;const{visualElement:a}=m.useContext(Fs),l=m.useContext(sp),c=m.useContext(Ls),u=m.useContext(dl).reducedMotion,f=m.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,p=m.useContext(cp);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&mk(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,c)});const b=n[lp],y=m.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return np(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),xl.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,b)}),y.current=!1))}),h}function mk(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:up(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&or(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function up(e){if(e)return e.options.allowProjection!==!1?e.projection:up(e.parent)}function gk({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&ik(e);function a(c,u){let f;const h={...m.useContext(dl),...c,layoutId:xk(c)},{isStatic:p}=h,g=uk(c),b=r(c,p);if(!p&&fl){yk();const y=bk(h);f=y.MeasureLayout,g.visualElement=pk(i,b,h,t,y.ProjectionNode)}return d.jsxs(Fs.Provider,{value:g,children:[f&&g.visualElement?d.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,c,fk(b,g.visualElement,u),b,p,g.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=m.forwardRef(a);return l[dk]=i,l}function xk({layoutId:e}){const t=m.useContext(cl).id;return t&&e!==void 0?t+"-"+e:e}function yk(e,t){m.useContext(sp).strict}function bk(e){const{drag:t,layout:n}=vr;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const vk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function yl(e){return typeof e!="string"||e.includes("-")?!1:!!(vk.indexOf(e)>-1||/[A-Z]/u.test(e))}function tu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function bl(e,t,n,r){if(typeof t=="function"){const[i,s]=tu(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=tu(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const la=e=>Array.isArray(e),wk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),kk=e=>la(e)?e[e.length-1]||0:e,at=e=>!!(e&&e.getVelocity);function Qi(e){const t=at(e)?e.get():e;return wk(t)?t.toValue():t}function Sk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Ck(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const dp=e=>(t,n)=>{const r=m.useContext(Fs),i=m.useContext(Ls),s=()=>Sk(e,t,r,i);return n?s():ul(s)};function Ck(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Qi(s[h]);let{initial:o,animate:a}=e;const l=zs(e),c=ap(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Bs(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=bl(e,h[p]);if(g){const{transitionEnd:b,transition:y,...x}=g;for(const w in x){let C=x[w];if(Array.isArray(C)){const E=u?C.length-1:0;C=C[E]}C!==null&&(i[w]=C)}for(const w in b)i[w]=b[w]}}}return i}const Tr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gn=new Set(Tr),fp=e=>t=>typeof t=="string"&&t.startsWith(e),hp=fp("--"),jk=fp("var(--"),vl=e=>jk(e)?Ek.test(e.split("/*")[0].trim()):!1,Ek=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,pp=(e,t)=>t&&typeof e=="number"?t.transform(e):e,on=(e,t,n)=>n>t?t:n<e?e:n,Pr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ci={...Pr,transform:e=>on(0,1,e)},Fi={...Pr,default:1},wi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wn=wi("deg"),qt=wi("%"),ee=wi("px"),Nk=wi("vh"),Tk=wi("vw"),nu={...qt,parse:e=>qt.parse(e)/100,transform:e=>qt.transform(e*100)},Pk={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee},Ak={rotate:wn,rotateX:wn,rotateY:wn,rotateZ:wn,scale:Fi,scaleX:Fi,scaleY:Fi,scaleZ:Fi,skew:wn,skewX:wn,skewY:wn,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:ci,originX:nu,originY:nu,originZ:ee},ru={...Pr,transform:Math.round},wl={...Pk,...Ak,zIndex:ru,size:ee,fillOpacity:ci,strokeOpacity:ci,numOctaves:ru},_k={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rk=Tr.length;function Mk(e,t,n){let r="",i=!0;for(let s=0;s<Rk;s++){const o=Tr[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=pp(a,wl[o]);if(!l){i=!1;const u=_k[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function kl(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Gn.has(l)){o=!0;continue}else if(hp(l)){i[l]=c;continue}else{const u=pp(c,wl[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Mk(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Dk={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ok={offset:"strokeDashoffset",array:"strokeDasharray"};function Ik(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Dk:Ok;e[s.offset]=ee.transform(-r);const o=ee.transform(t),a=ee.transform(n);e[s.array]=`${o} ${a}`}function iu(e,t,n){return typeof e=="string"?e:ee.transform(t+n*e)}function Lk(e,t,n){const r=iu(t,e.x,e.width),i=iu(n,e.y,e.height);return`${r} ${i}`}function Sl(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(kl(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Lk(g,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ik(h,o,a,l,!1)}const Cl=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),mp=()=>({...Cl(),attrs:{}}),jl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gp(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const xp=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yp(e,t,n,r){gp(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(xp.has(i)?i:gl(i),t.attrs[i])}const ds={};function Fk(e){Object.assign(ds,e)}function bp(e,{layout:t,layoutId:n}){return Gn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ds[e]||e==="opacity")}function El(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(at(i[o])||t.style&&at(t.style[o])||bp(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function vp(e,t,n){const r=El(e,t,n);for(const i in e)if(at(e[i])||at(t[i])){const s=Tr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function Bk(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const su=["x","y","width","height","cx","cy","r"],zk={useVisualState:dp({scrapeMotionValuesFromProps:vp,createRenderState:mp,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(Gn.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<su.length;a++){const l=su[a];e[l]!==t[l]&&(o=!0)}o&&_e.read(()=>{Bk(n,r),_e.render(()=>{Sl(r,i,jl(n.tagName),e.transformTemplate),yp(n,r)})})}})},Vk={useVisualState:dp({scrapeMotionValuesFromProps:El,createRenderState:Cl})};function wp(e,t,n){for(const r in t)!at(t[r])&&!bp(r,n)&&(e[r]=t[r])}function $k({transformTemplate:e},t){return m.useMemo(()=>{const n=Cl();return kl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Uk(e,t){const n=e.style||{},r={};return wp(r,n,e),Object.assign(r,$k(e,t)),r}function Wk(e,t){const n={},r=Uk(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Hk(e,t,n,r){const i=m.useMemo(()=>{const s=mp();return Sl(s,t,jl(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};wp(s,e.style,e),i.style={...s,...i.style}}return i}function qk(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(yl(n)?Hk:Wk)(r,s,o,n),c=ak(r,typeof n=="string",e),u=n!==m.Fragment?{...c,...l,ref:i}:{},{children:f}=r,h=m.useMemo(()=>at(f)?f.get():f,[f]);return m.createElement(n,{...u,children:h})}}function Kk(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...yl(r)?zk:Vk,preloadedFeatures:e,useRender:qk(i),createVisualElement:t,Component:r};return gk(o)}}function kp(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Vs(e,t,n){const r=e.getProps();return bl(r,t,n!==void 0?n:r.custom,e)}const Gk=hl(()=>window.ScrollTimeline!==void 0);class Yk{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Gk()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Xk extends Yk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Nl(e,t){return e?e[t]||e.default||e:void 0}const ca=2e4;function Sp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ca;)t+=n,r=e.next(t);return t>=ca?1/0:t}function Tl(e){return typeof e=="function"}function ou(e,t){e.timeline=t,e.onfinish=null}const Pl=e=>Array.isArray(e)&&typeof e[0]=="number",Jk={linearEasing:void 0};function Qk(e,t){const n=hl(e);return()=>{var r;return(r=Jk[t])!==null&&r!==void 0?r:n()}}const fs=Qk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cp=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(br(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function jp(e){return!!(typeof e=="function"&&fs()||!e||typeof e=="string"&&(e in ua||fs())||Pl(e)||Array.isArray(e)&&e.every(jp))}const Wr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ua={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function Ep(e,t){if(e)return typeof e=="function"&&fs()?Cp(e,t):Pl(e)?Wr(e):Array.isArray(e)?e.map(n=>Ep(n,t)||ua.easeOut):ua[e]}const It={x:!1,y:!1};function Np(){return It.x||It.y}function Zk(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function Tp(e,t){const n=Zk(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function au(e){return t=>{t.pointerType==="touch"||Np()||e(t)}}function eS(e,t,n={}){const[r,i,s]=Tp(e,n),o=au(a=>{const{target:l}=a,c=t(a);if(typeof c!="function"||!l)return;const u=au(f=>{c(f),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Pp=(e,t)=>t?e===t?!0:Pp(e,t.parentElement):!1,Al=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,tS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nS(e){return tS.has(e.tagName)||e.tabIndex!==-1}const Hr=new WeakSet;function lu(e){return t=>{t.key==="Enter"&&e(t)}}function ho(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const rS=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=lu(()=>{if(Hr.has(n))return;ho(n,"down");const i=lu(()=>{ho(n,"up")}),s=()=>ho(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function cu(e){return Al(e)&&!Np()}function iS(e,t,n={}){const[r,i,s]=Tp(e,n),o=a=>{const l=a.currentTarget;if(!cu(a)||Hr.has(l))return;Hr.add(l);const c=t(a),u=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!cu(p)||!Hr.has(l))&&(Hr.delete(l),typeof c=="function"&&c(p,{success:g}))},f=p=>{u(p,n.useGlobalTarget||Pp(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!nS(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>rS(c,i),i)}),s}function sS(e){return e==="x"||e==="y"?It[e]?null:(It[e]=!0,()=>{It[e]=!1}):It.x||It.y?null:(It.x=It.y=!0,()=>{It.x=It.y=!1})}const Ap=new Set(["width","height","top","left","right","bottom",...Tr]);let Zi;function oS(){Zi=void 0}const Kt={now:()=>(Zi===void 0&&Kt.set(rt.isProcessing||tk.useManualTiming?rt.timestamp:performance.now()),Zi),set:e=>{Zi=e,queueMicrotask(oS)}};function _l(e,t){e.indexOf(t)===-1&&e.push(t)}function Rl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ml{constructor(){this.subscriptions=[]}add(t){return _l(this.subscriptions,t),()=>Rl(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function _p(e,t){return t?e*(1e3/t):0}const uu=30,aS=e=>!isNaN(parseFloat(e)),du={current:void 0};class lS{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Kt.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Kt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=aS(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ml);const r=this.events[t].add(n);return t==="change"?()=>{r(),_e.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return du.current&&du.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Kt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uu);return _p(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ui(e,t){return new lS(e,t)}function cS(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ui(n))}function uS(e,t){const n=Vs(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=kk(s[o]);cS(e,o,a)}}function dS(e){return!!(at(e)&&e.add)}function da(e,t){const n=e.getValue("willChange");if(dS(n))return n.add(t)}function Rp(e){return e.props[lp]}const Mp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,fS=1e-7,hS=12;function pS(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Mp(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>fS&&++a<hS);return o}function ki(e,t,n,r){if(e===t&&n===r)return gt;const i=s=>pS(s,0,1,e,n);return s=>s===0||s===1?s:Mp(i(s),t,r)}const Dp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Op=e=>t=>1-e(1-t),Ip=ki(.33,1.53,.69,.99),Dl=Op(Ip),Lp=Dp(Dl),Fp=e=>(e*=2)<1?.5*Dl(e):.5*(2-Math.pow(2,-10*(e-1))),Ol=e=>1-Math.sin(Math.acos(e)),Bp=Op(Ol),zp=Dp(Ol),Vp=e=>/^0[^.\s]+$/u.test(e);function mS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Vp(e):!0}const Jr=e=>Math.round(e*1e5)/1e5,Il=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gS(e){return e==null}const xS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ll=(e,t)=>n=>!!(typeof n=="string"&&xS.test(n)&&n.startsWith(e)||t&&!gS(n)&&Object.prototype.hasOwnProperty.call(n,t)),$p=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Il);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},yS=e=>on(0,255,e),po={...Pr,transform:e=>Math.round(yS(e))},Vn={test:Ll("rgb","red"),parse:$p("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+po.transform(e)+", "+po.transform(t)+", "+po.transform(n)+", "+Jr(ci.transform(r))+")"};function bS(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const fa={test:Ll("#"),parse:bS,transform:Vn.transform},ar={test:Ll("hsl","hue"),parse:$p("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qt.transform(Jr(t))+", "+qt.transform(Jr(n))+", "+Jr(ci.transform(r))+")"},ot={test:e=>Vn.test(e)||fa.test(e)||ar.test(e),parse:e=>Vn.test(e)?Vn.parse(e):ar.test(e)?ar.parse(e):fa.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Vn.transform(e):ar.transform(e)},vS=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function wS(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Il))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(vS))===null||n===void 0?void 0:n.length)||0)>0}const Up="number",Wp="color",kS="var",SS="var(",fu="${}",CS=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function di(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(CS,l=>(ot.test(l)?(r.color.push(s),i.push(Wp),n.push(ot.parse(l))):l.startsWith(SS)?(r.var.push(s),i.push(kS),n.push(l)):(r.number.push(s),i.push(Up),n.push(parseFloat(l))),++s,fu)).split(fu);return{values:n,split:a,indexes:r,types:i}}function Hp(e){return di(e).values}function qp(e){const{split:t,types:n}=di(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===Up?s+=Jr(i[o]):a===Wp?s+=ot.transform(i[o]):s+=i[o]}return s}}const jS=e=>typeof e=="number"?0:e;function ES(e){const t=Hp(e);return qp(e)(t.map(jS))}const En={test:wS,parse:Hp,createTransformer:qp,getAnimatableNone:ES},NS=new Set(["brightness","contrast","saturate","opacity"]);function TS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Il)||[];if(!r)return e;const i=n.replace(r,"");let s=NS.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const PS=/\b([a-z-]*)\(.*?\)/gu,ha={...En,getAnimatableNone:e=>{const t=e.match(PS);return t?t.map(TS).join(" "):e}},AS={...wl,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:ha,WebkitFilter:ha},Fl=e=>AS[e];function Kp(e,t){let n=Fl(e);return n!==ha&&(n=En),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _S=new Set(["auto","none","0"]);function RS(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!_S.has(s)&&di(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Kp(n,i)}const hu=e=>e===Pr||e===ee,pu=(e,t)=>parseFloat(e.split(", ")[t]),mu=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return pu(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?pu(s[1],e):0}},MS=new Set(["x","y","z"]),DS=Tr.filter(e=>!MS.has(e));function OS(e){const t=[];return DS.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const wr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:mu(4,13),y:mu(5,14)};wr.translateX=wr.x;wr.translateY=wr.y;const Un=new Set;let pa=!1,ma=!1;function Gp(){if(ma){const e=Array.from(Un).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=OS(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ma=!1,pa=!1,Un.forEach(e=>e.complete()),Un.clear()}function Yp(){Un.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ma=!0)})}function IS(){Yp(),Gp()}class Bl{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Un.add(this),pa||(pa=!0,_e.read(Yp),_e.resolveKeyframes(Gp))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Un.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Un.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Xp=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),LS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FS(e){const t=LS.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Jp(e,t,n=1){const[r,i]=FS(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Xp(o)?parseFloat(o):o}return vl(i)?Jp(i,t,n+1):i}const Qp=e=>t=>t.test(e),BS={test:e=>e==="auto",parse:e=>e},Zp=[Pr,ee,qt,wn,Tk,Nk,BS],gu=e=>Zp.find(Qp(e));class em extends Bl{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),vl(c))){const u=Jp(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ap.has(r)||t.length!==2)return;const[i,s]=t,o=gu(i),a=gu(s);if(o!==a)if(hu(o)&&hu(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)mS(t[i])&&r.push(i);r.length&&RS(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=wr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=wr[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const xu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(En.test(e)||e==="0")&&!e.startsWith("url("));function zS(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function VS(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=xu(i,t),a=xu(s,t);return!o||!a?!1:zS(e)||(n==="spring"||Tl(n))&&r}const $S=e=>e!==null;function $s(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter($S),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const US=40;class tm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Kt.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>US?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&IS(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Kt.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!VS(t,r,i,s))if(o)this.options.duration=0;else{l&&l($s(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Me=(e,t,n)=>e+(t-e)*n;function mo(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function WS({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=mo(l,a,e+1/3),s=mo(l,a,e),o=mo(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function hs(e,t){return n=>n>0?t:e}const go=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},HS=[fa,Vn,ar],qS=e=>HS.find(t=>t.test(e));function yu(e){const t=qS(e);if(!t)return!1;let n=t.parse(e);return t===ar&&(n=WS(n)),n}const bu=(e,t)=>{const n=yu(e),r=yu(t);if(!n||!r)return hs(e,t);const i={...n};return s=>(i.red=go(n.red,r.red,s),i.green=go(n.green,r.green,s),i.blue=go(n.blue,r.blue,s),i.alpha=Me(n.alpha,r.alpha,s),Vn.transform(i))},KS=(e,t)=>n=>t(e(n)),Si=(...e)=>e.reduce(KS),ga=new Set(["none","hidden"]);function GS(e,t){return ga.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function YS(e,t){return n=>Me(e,t,n)}function zl(e){return typeof e=="number"?YS:typeof e=="string"?vl(e)?hs:ot.test(e)?bu:QS:Array.isArray(e)?nm:typeof e=="object"?ot.test(e)?bu:XS:hs}function nm(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>zl(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function XS(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=zl(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function JS(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],a=e.indexes[o][i[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const QS=(e,t)=>{const n=En.createTransformer(t),r=di(e),i=di(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ga.has(e)&&!i.values.length||ga.has(t)&&!r.values.length?GS(e,t):Si(nm(JS(r,i),i.values),n):hs(e,t)};function rm(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Me(e,t,n):zl(e)(e,t)}const ZS=5;function im(e,t,n){const r=Math.max(t-ZS,0);return _p(n-e(r),t-r)}const Oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},xo=.001;function eC({duration:e=Oe.duration,bounce:t=Oe.bounce,velocity:n=Oe.velocity,mass:r=Oe.mass}){let i,s,o=1-t;o=on(Oe.minDamping,Oe.maxDamping,o),e=on(Oe.minDuration,Oe.maxDuration,nn(e)),o<1?(i=c=>{const u=c*o,f=u*e,h=u-n,p=xa(c,o),g=Math.exp(-f);return xo-h/p*g},s=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-f),b=xa(Math.pow(c,2),o);return(-i(c)+xo>0?-1:1)*((h-p)*g)/b}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-xo+u*f},s=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=nC(i,s,a);if(e=tn(e),isNaN(l))return{stiffness:Oe.stiffness,damping:Oe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const tC=12;function nC(e,t,n){let r=n;for(let i=1;i<tC;i++)r=r-e(r)/t(r);return r}function xa(e,t){return e*Math.sqrt(1-t*t)}const rC=["duration","bounce"],iC=["stiffness","damping","mass"];function vu(e,t){return t.some(n=>e[n]!==void 0)}function sC(e){let t={velocity:Oe.velocity,stiffness:Oe.stiffness,damping:Oe.damping,mass:Oe.mass,isResolvedFromDuration:!1,...e};if(!vu(e,iC)&&vu(e,rC))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*on(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Oe.mass,stiffness:i,damping:s}}else{const n=eC(e);t={...t,...n,mass:Oe.mass},t.isResolvedFromDuration=!0}return t}function sm(e=Oe.visualDuration,t=Oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=sC({...n,velocity:-nn(n.velocity||0)}),g=h||0,b=c/(2*Math.sqrt(l*u)),y=o-s,x=nn(Math.sqrt(l/u)),w=Math.abs(y)<5;r||(r=w?Oe.restSpeed.granular:Oe.restSpeed.default),i||(i=w?Oe.restDelta.granular:Oe.restDelta.default);let C;if(b<1){const k=xa(x,b);C=S=>{const A=Math.exp(-b*x*S);return o-A*((g+b*x*y)/k*Math.sin(k*S)+y*Math.cos(k*S))}}else if(b===1)C=k=>o-Math.exp(-x*k)*(y+(g+x*y)*k);else{const k=x*Math.sqrt(b*b-1);C=S=>{const A=Math.exp(-b*x*S),T=Math.min(k*S,300);return o-A*((g+b*x*y)*Math.sinh(T)+k*y*Math.cosh(T))/k}}const E={calculatedDuration:p&&f||null,next:k=>{const S=C(k);if(p)a.done=k>=f;else{let A=0;b<1&&(A=k===0?tn(g):im(C,k,S));const T=Math.abs(A)<=r,R=Math.abs(o-S)<=i;a.done=T&&R}return a.value=a.done?o:S,a},toString:()=>{const k=Math.min(Sp(E),ca),S=Cp(A=>E.next(k*A).value,k,30);return k+"ms "+S}};return E}function wu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=T=>a!==void 0&&T<a||l!==void 0&&T>l,g=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let b=n*t;const y=f+b,x=o===void 0?y:o(y);x!==y&&(b=x-f);const w=T=>-b*Math.exp(-T/r),C=T=>x+w(T),E=T=>{const R=w(T),N=C(T);h.done=Math.abs(R)<=c,h.value=h.done?x:N};let k,S;const A=T=>{p(h.value)&&(k=T,S=sm({keyframes:[h.value,g(h.value)],velocity:im(C,T,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return A(0),{calculatedDuration:null,next:T=>{let R=!1;return!S&&k===void 0&&(R=!0,E(T),A(T)),k!==void 0&&T>=k?S.next(T-k):(!R&&E(T),h)}}}const oC=ki(.42,0,1,1),aC=ki(0,0,.58,1),om=ki(.42,0,.58,1),lC=e=>Array.isArray(e)&&typeof e[0]!="number",cC={linear:gt,easeIn:oC,easeInOut:om,easeOut:aC,circIn:Ol,circInOut:zp,circOut:Bp,backIn:Dl,backInOut:Lp,backOut:Ip,anticipate:Fp},ku=e=>{if(Pl(e)){rp(e.length===4);const[t,n,r,i]=e;return ki(t,n,r,i)}else if(typeof e=="string")return cC[e];return e};function uC(e,t,n){const r=[],i=n||rm,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||gt:t;a=Si(l,a)}r.push(a)}return r}function dC(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(rp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=uC(t,r,i),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=br(e[f],e[f+1],u);return a[f](h)};return n?u=>c(on(e[0],e[s-1],u)):c}function fC(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=br(0,t,r);e.push(Me(n,1,i))}}function hC(e){const t=[0];return fC(t,e.length-1),t}function pC(e,t){return e.map(n=>n*t)}function mC(e,t){return e.map(()=>t||om).splice(0,e.length-1)}function ps({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=lC(r)?r.map(ku):ku(r),s={done:!1,value:t[0]},o=pC(n&&n.length===t.length?n:hC(t),e),a=dC(o,t,{ease:Array.isArray(i)?i:mC(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const gC=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_e.update(t,!0),stop:()=>jn(t),now:()=>rt.isProcessing?rt.timestamp:Kt.now()}},xC={decay:wu,inertia:wu,tween:ps,keyframes:ps,spring:sm},yC=e=>e/100;class Us extends tm{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Bl,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Tl(n)?n:xC[n]||ps;let l,c;a!==ps&&typeof t[0]!="number"&&(l=Si(yC,rm(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Sp(u));const{calculatedDuration:f}=u,h=f+i,p=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:T}=this.options;return{done:!0,value:T[T.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:b,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?x<0:x>u;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,E=s;if(p){const T=Math.min(this.currentTime,u)/f;let R=Math.floor(T),N=T%1;!N&&T>=1&&(N=1),N===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(g==="reverse"?(N=1-N,b&&(N-=b/f)):g==="mirror"&&(E=o)),C=on(0,1,N)*f}const k=w?{done:!1,value:l[0]}:E.next(C);a&&(k.value=a(k.value));let{done:S}=k;!w&&c!==null&&(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return A&&i!==void 0&&(k.value=$s(l,this.options,i)),y&&y(k.value),A&&this.finish(),k}get duration(){const{resolved:t}=this;return t?nn(t.calculatedDuration):0}get time(){return nn(this.currentTime)}set time(t){t=tn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=gC,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}function a5(e){return new Us(e)}const bC=new Set(["opacity","clipPath","filter","transform"]);function vC(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Ep(a,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const wC=hl(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ms=10,kC=2e4;function SC(e){return Tl(e.type)||e.type==="spring"||!jp(e.ease)}function CC(e,t){const n=new Us({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<kC;)r=n.sample(s),i.push(r.value),s+=ms;return{times:void 0,keyframes:i,duration:s-ms,ease:"linear"}}const am={anticipate:Fp,backInOut:Lp,circInOut:zp};function jC(e){return e in am}class Su extends tm{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new em(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&fs()&&jC(s)&&(s=am[s]),SC(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...b}=this.options,y=CC(t,b);t=y.keyframes,t.length===1&&(t[1]=t[0]),r=y.duration,i=y.times,s=y.ease,o="keyframes"}const u=vC(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(ou(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set($s(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return nn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return nn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=tn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return gt;const{animation:r}=n;ou(r,t)}return gt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...p}=this.options,g=new Us({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=tn(this.time);c.setWithVelocity(g.sample(b-ms).value,g.sample(b).value,ms)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return wC()&&r&&bC.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const EC={type:"spring",stiffness:500,damping:25,restSpeed:10},NC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),TC={type:"keyframes",duration:.8},PC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},AC=(e,{keyframes:t})=>t.length>2?TC:Gn.has(e)?e.startsWith("scale")?NC(t[1]):EC:PC;function _C({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Vl=(e,t,n,r={},i,s)=>o=>{const a=Nl(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-tn(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};_C(a)||(u={...u,...AC(e,u)}),u.duration&&(u.duration=tn(u.duration)),u.repeatDelay&&(u.repeatDelay=tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=$s(u.keyframes,a);if(h!==void 0)return _e.update(()=>{u.onUpdate(h),u.onComplete()}),new Xk([])}return!s&&Su.supports(u)?new Su(u):new Us(u)};function RC({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function lm(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=l[f];if(p===void 0||u&&RC(u,f))continue;const g={delay:n,...Nl(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const x=Rp(e);if(x){const w=window.MotionHandoffAnimation(x,f,_e);w!==null&&(g.startTime=w,b=!0)}}da(e,f),h.start(Vl(f,h,p,e.shouldReduceMotion&&Ap.has(f)?{type:!1}:g,e,b));const y=h.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{_e.update(()=>{a&&uS(e,a)})}),c}function ya(e,t,n={}){var r;const i=Vs(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(lm(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return MC(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function MC(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(DC).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ya(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function DC(e,t){return e.sortNodePosition(t)}function OC(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>ya(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=ya(e,t,n);else{const i=typeof t=="function"?Vs(e,t,n.custom):t;r=Promise.all(lm(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const IC=ml.length;function cm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?cm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<IC;n++){const r=ml[n],i=e.props[r];(li(i)||i===!1)&&(t[r]=i)}return t}const LC=[...pl].reverse(),FC=pl.length;function BC(e){return t=>Promise.all(t.map(({animation:n,options:r})=>OC(e,n,r)))}function zC(e){let t=BC(e),n=Cu(),r=!0;const i=l=>(c,u)=>{var f;const h=Vs(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...b}=h;c={...c,...b,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=cm(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let y=0;y<FC;y++){const x=LC[y],w=n[x],C=c[x]!==void 0?c[x]:u[x],E=li(C),k=x===l?w.isActive:null;k===!1&&(g=y);let S=C===u[x]&&C!==c[x]&&E;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),w.protectedKeys={...p},!w.isActive&&k===null||!C&&!w.prevProp||Bs(C)||typeof C=="boolean")continue;const A=VC(w.prevProp,C);let T=A||x===l&&w.isActive&&!S&&E||y>g&&E,R=!1;const N=Array.isArray(C)?C:[C];let D=N.reduce(i(x),{});k===!1&&(D={});const{prevResolvedValues:P={}}=w,_={...P,...D},L=M=>{T=!0,h.has(M)&&(R=!0,h.delete(M)),w.needsAnimating[M]=!0;const $=e.getValue(M);$&&($.liveStyle=!1)};for(const M in _){const $=D[M],z=P[M];if(p.hasOwnProperty(M))continue;let v=!1;la($)&&la(z)?v=!kp($,z):v=$!==z,v?$!=null?L(M):h.add(M):$!==void 0&&h.has(M)?L(M):w.protectedKeys[M]=!0}w.prevProp=C,w.prevResolvedValues=D,w.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(S&&A)||R)&&f.push(...N.map(M=>({animation:M,options:{type:x}})))}if(h.size){const y={};h.forEach(x=>{const w=e.getBaseTarget(x),C=e.getValue(x);C&&(C.liveStyle=!0),y[x]=w??null}),f.push({animation:y})}let b=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Cu(),r=!0}}}function VC(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!kp(t,e):!1}function On(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cu(){return{animate:On(!0),whileInView:On(),whileHover:On(),whileTap:On(),whileDrag:On(),whileFocus:On(),exit:On()}}class Rn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class $C extends Rn{constructor(t){super(t),t.animationState||(t.animationState=zC(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let UC=0;class WC extends Rn{constructor(){super(...arguments),this.id=UC++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const HC={animation:{Feature:$C},exit:{Feature:WC}};function fi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ci(e){return{point:{x:e.pageX,y:e.pageY}}}const qC=e=>t=>Al(t)&&e(t,Ci(t));function Qr(e,t,n,r){return fi(e,t,qC(n),r)}const ju=(e,t)=>Math.abs(e-t);function KC(e,t){const n=ju(e.x,t.x),r=ju(e.y,t.y);return Math.sqrt(n**2+r**2)}class um{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=bo(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=KC(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:b}=rt;this.history.push({...g,timestamp:b});const{onStart:y,onMove:x}=this.handlers;h||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yo(h,this.transformPagePoint),_e.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=bo(f.type==="pointercancel"?this.lastMoveEventInfo:yo(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,y),g&&g(f,y)},!Al(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ci(t),a=yo(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=rt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,bo(a,this.history)),this.removeListeners=Si(Qr(this.contextWindow,"pointermove",this.handlePointerMove),Qr(this.contextWindow,"pointerup",this.handlePointerUp),Qr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jn(this.updatePoint)}}function yo(e,t){return t?{point:t(e.point)}:e}function Eu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bo({point:e},t){return{point:e,delta:Eu(e,dm(t)),offset:Eu(e,GC(t)),velocity:YC(t,.1)}}function GC(e){return e[0]}function dm(e){return e[e.length-1]}function YC(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=dm(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>tn(t)));)n--;if(!r)return{x:0,y:0};const s=nn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const fm=1e-4,XC=1-fm,JC=1+fm,hm=.01,QC=0-hm,ZC=0+hm;function kt(e){return e.max-e.min}function ej(e,t,n){return Math.abs(e-t)<=n}function Nu(e,t,n,r=.5){e.origin=r,e.originPoint=Me(t.min,t.max,e.origin),e.scale=kt(n)/kt(t),e.translate=Me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=XC&&e.scale<=JC||isNaN(e.scale))&&(e.scale=1),(e.translate>=QC&&e.translate<=ZC||isNaN(e.translate))&&(e.translate=0)}function Zr(e,t,n,r){Nu(e.x,t.x,n.x,r?r.originX:void 0),Nu(e.y,t.y,n.y,r?r.originY:void 0)}function Tu(e,t,n){e.min=n.min+t.min,e.max=e.min+kt(t)}function tj(e,t,n){Tu(e.x,t.x,n.x),Tu(e.y,t.y,n.y)}function Pu(e,t,n){e.min=t.min-n.min,e.max=e.min+kt(t)}function ei(e,t,n){Pu(e.x,t.x,n.x),Pu(e.y,t.y,n.y)}function nj(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Me(n,e,r.max):Math.min(e,n)),e}function Au(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function rj(e,{top:t,left:n,bottom:r,right:i}){return{x:Au(e.x,n,i),y:Au(e.y,t,r)}}function _u(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ij(e,t){return{x:_u(e.x,t.x),y:_u(e.y,t.y)}}function sj(e,t){let n=.5;const r=kt(e),i=kt(t);return i>r?n=br(t.min,t.max-r,e.min):r>i&&(n=br(e.min,e.max-i,t.min)),on(0,1,n)}function oj(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ba=.35;function aj(e=ba){return e===!1?e=0:e===!0&&(e=ba),{x:Ru(e,"left","right"),y:Ru(e,"top","bottom")}}function Ru(e,t,n){return{min:Mu(e,t),max:Mu(e,n)}}function Mu(e,t){return typeof e=="number"?e:e[t]||0}const Du=()=>({translate:0,scale:1,origin:0,originPoint:0}),lr=()=>({x:Du(),y:Du()}),Ou=()=>({min:0,max:0}),ze=()=>({x:Ou(),y:Ou()});function Nt(e){return[e("x"),e("y")]}function pm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function lj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function vo(e){return e===void 0||e===1}function va({scale:e,scaleX:t,scaleY:n}){return!vo(e)||!vo(t)||!vo(n)}function Fn(e){return va(e)||mm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mm(e){return Iu(e.x)||Iu(e.y)}function Iu(e){return e&&e!=="0%"}function gs(e,t,n){const r=e-n,i=t*r;return n+i}function Lu(e,t,n,r,i){return i!==void 0&&(e=gs(e,i,r)),gs(e,n,r)+t}function wa(e,t=0,n=1,r,i){e.min=Lu(e.min,t,n,r,i),e.max=Lu(e.max,t,n,r,i)}function gm(e,{x:t,y:n}){wa(e.x,t.translate,t.scale,t.originPoint),wa(e.y,n.translate,n.scale,n.originPoint)}const Fu=.999999999999,Bu=1.0000000000001;function uj(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ur(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,gm(e,o)),r&&Fn(s.latestValues)&&ur(e,s.latestValues))}t.x<Bu&&t.x>Fu&&(t.x=1),t.y<Bu&&t.y>Fu&&(t.y=1)}function cr(e,t){e.min=e.min+t,e.max=e.max+t}function zu(e,t,n,r,i=.5){const s=Me(e.min,e.max,i);wa(e,t,n,s,r)}function ur(e,t){zu(e.x,t.x,t.scaleX,t.scale,t.originX),zu(e.y,t.y,t.scaleY,t.scale,t.originY)}function xm(e,t){return pm(cj(e.getBoundingClientRect(),t))}function dj(e,t,n){const r=xm(e,n),{scroll:i}=t;return i&&(cr(r.x,i.offset.x),cr(r.y,i.offset.y)),r}const ym=({current:e})=>e?e.ownerDocument.defaultView:null,fj=new WeakMap;class hj{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ze(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ci(u).point)},s=(u,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sS(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nt(y=>{let x=this.getAxisMotionValue(y).get()||0;if(qt.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[y];C&&(x=kt(C)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&_e.postRender(()=>g(u,f)),da(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=pj(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),b&&b(u,f)},a=(u,f)=>this.stop(u,f),l=()=>Nt(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new um(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:ym(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&_e.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Bi(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=nj(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&or(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=rj(i.layoutBox,n):this.constraints=!1,this.elastic=aj(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=oj(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!or(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=dj(r,i.root,this.visualElement.getTransformPagePoint());let o=ij(i.layout.layoutBox,s);if(n){const a=n(lj(o));this.hasMutatedConstraints=!!a,a&&(o=pm(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Nt(u=>{if(!Bi(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return da(this.visualElement,t),r.start(Vl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Nt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Nt(n=>{const{drag:r}=this.getProps();if(!Bi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Me(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!or(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=sj({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Nt(o=>{if(!Bi(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Me(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;fj.set(this.visualElement,this);const t=this.visualElement.current,n=Qr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();or(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_e.read(r);const o=fi(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Nt(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ba,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Bi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mj extends Rn{constructor(t){super(t),this.removeGroupControls=gt,this.removeListeners=gt,this.controls=new hj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Vu=e=>(t,n)=>{e&&_e.postRender(()=>e(t,n))};class gj extends Rn{constructor(){super(...arguments),this.removePointerDownListener=gt}onPointerDown(t){this.session=new um(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ym(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Vu(t),onStart:Vu(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&_e.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Qr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const es={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $u(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ir={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ee.test(e))e=parseFloat(e);else return e;const n=$u(e,t.target.x),r=$u(e,t.target.y);return`${n}% ${r}%`}},xj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=En.parse(e);if(i.length>5)return r;const s=En.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Me(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class yj extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Fk(bj),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),es.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||_e.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),xl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bm(e){const[t,n]=tp(),r=m.useContext(cl);return d.jsx(yj,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(cp),isPresent:t,safeToRemove:n})}const bj={borderRadius:{...Ir,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ir,borderTopRightRadius:Ir,borderBottomLeftRadius:Ir,borderBottomRightRadius:Ir,boxShadow:xj};function vj(e,t,n){const r=at(e)?e:ui(e);return r.start(Vl("",r,t,n)),r.animation}function wj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const kj=(e,t)=>e.depth-t.depth;class Sj{constructor(){this.children=[],this.isDirty=!1}add(t){_l(this.children,t),this.isDirty=!0}remove(t){Rl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kj),this.isDirty=!1,this.children.forEach(t)}}function Cj(e,t){const n=Kt.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(jn(r),e(s-t))};return _e.read(r,!0),()=>jn(r)}const vm=["TopLeft","TopRight","BottomLeft","BottomRight"],jj=vm.length,Uu=e=>typeof e=="string"?parseFloat(e):e,Wu=e=>typeof e=="number"||ee.test(e);function Ej(e,t,n,r,i,s){i?(e.opacity=Me(0,n.opacity!==void 0?n.opacity:1,Nj(r)),e.opacityExit=Me(t.opacity!==void 0?t.opacity:1,0,Tj(r))):s&&(e.opacity=Me(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<jj;o++){const a=`border${vm[o]}Radius`;let l=Hu(t,a),c=Hu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Wu(l)===Wu(c)?(e[a]=Math.max(Me(Uu(l),Uu(c),r),0),(qt.test(c)||qt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Me(t.rotate||0,n.rotate||0,r))}function Hu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nj=wm(0,.5,Bp),Tj=wm(.5,.95,gt);function wm(e,t,n){return r=>r<e?0:r>t?1:n(br(e,t,r))}function qu(e,t){e.min=t.min,e.max=t.max}function Et(e,t){qu(e.x,t.x),qu(e.y,t.y)}function Ku(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Gu(e,t,n,r,i){return e-=t,e=gs(e,1/n,r),i!==void 0&&(e=gs(e,1/i,r)),e}function Pj(e,t=0,n=1,r=.5,i,s=e,o=e){if(qt.test(t)&&(t=parseFloat(t),t=Me(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Me(s.min,s.max,r);e===s&&(a-=t),e.min=Gu(e.min,t,n,a,i),e.max=Gu(e.max,t,n,a,i)}function Yu(e,t,[n,r,i],s,o){Pj(e,t[n],t[r],t[i],t.scale,s,o)}const Aj=["x","scaleX","originX"],_j=["y","scaleY","originY"];function Xu(e,t,n,r){Yu(e.x,t,Aj,n?n.x:void 0,r?r.x:void 0),Yu(e.y,t,_j,n?n.y:void 0,r?r.y:void 0)}function Ju(e){return e.translate===0&&e.scale===1}function km(e){return Ju(e.x)&&Ju(e.y)}function Qu(e,t){return e.min===t.min&&e.max===t.max}function Rj(e,t){return Qu(e.x,t.x)&&Qu(e.y,t.y)}function Zu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Sm(e,t){return Zu(e.x,t.x)&&Zu(e.y,t.y)}function ed(e){return kt(e.x)/kt(e.y)}function td(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Mj{constructor(){this.members=[]}add(t){_l(this.members,t),t.scheduleRender()}remove(t){if(Rl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Dj(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Bn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qr=typeof window<"u"&&window.MotionDebug!==void 0,wo=["","X","Y","Z"],Oj={visibility:"hidden"},nd=1e3;let Ij=0;function ko(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Cm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rp(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_e,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Cm(r)}function jm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Ij++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qr&&(Bn.totalNodes=Bn.resolvedTargetDeltas=Bn.recalculatedProjection=0),this.nodes.forEach(Bj),this.nodes.forEach(Wj),this.nodes.forEach(Hj),this.nodes.forEach(zj),qr&&window.MotionDebug.record(Bn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sj)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ml),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wj(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Cj(h,250),es.hasAnimatedSinceResize&&(es.hasAnimatedSinceResize=!1,this.nodes.forEach(id))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||Xj,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),w=!this.targetLayout||!Sm(this.targetLayout,g)||p,C=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const E={...Nl(b,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else h||id(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,jn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qj),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Cm(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(rd);return}this.isUpdating||this.nodes.forEach($j),this.isUpdating=!1,this.nodes.forEach(Uj),this.nodes.forEach(Lj),this.nodes.forEach(Fj),this.clearAllSnapshots();const a=Kt.now();rt.delta=on(0,1e3/60,a-rt.timestamp),rt.timestamp=a,rt.isProcessing=!0,fo.update.process(rt),fo.preRender.process(rt),fo.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Vj),this.sharedNodes.forEach(Kj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_e.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_e.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ze(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!km(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Fn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Jj(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ze();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Qj))){const{scroll:u}=this.root;u&&(cr(l.x,u.offset.x),cr(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=ze();if(Et(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Et(l,o),cr(l.x,f.offset.x),cr(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ze();Et(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ur(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Fn(u.latestValues)&&ur(l,u.latestValues)}return Fn(this.latestValues)&&ur(l,this.latestValues),l}removeTransform(o){const a=ze();Et(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Fn(c.latestValues))continue;va(c.latestValues)&&c.updateSnapshot();const u=ze(),f=c.measurePageBox();Et(u,f),Xu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Fn(this.latestValues)&&Xu(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=rt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ze(),this.relativeTargetOrigin=ze(),ei(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ze(),this.targetWithTransforms=ze()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Et(this.target,this.layout.layoutBox),gm(this.target,this.targetDelta)):Et(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ze(),this.relativeTargetOrigin=ze(),ei(this.relativeTargetOrigin,this.target,p.target),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}qr&&Bn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||va(this.parent.latestValues)||mm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Et(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;uj(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ze());const{target:g}=a;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ku(this.prevProjectionDelta.x,this.projectionDelta.x),Ku(this.prevProjectionDelta.y,this.projectionDelta.y)),Zr(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!td(this.projectionDelta.x,this.prevProjectionDelta.x)||!td(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),qr&&Bn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=lr(),this.projectionDelta=lr(),this.projectionDeltaWithTransform=lr()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=lr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ze(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,b=p!==g,y=this.getStack(),x=!y||y.members.length<=1,w=!!(b&&!x&&this.options.crossfade===!0&&!this.path.some(Yj));this.animationProgress=0;let C;this.mixTargetDelta=E=>{const k=E/1e3;sd(f.x,o.x,k),sd(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ei(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Gj(this.relativeTarget,this.relativeTargetOrigin,h,k),C&&Rj(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ze()),Et(C,this.relativeTarget)),b&&(this.animationValues=u,Ej(u,c,this.latestValues,k,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_e.update(()=>{es.hasAnimatedSinceResize=!0,this.currentAnimation=vj(0,nd,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nd),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Em(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ze();const f=kt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=kt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Et(a,l),ur(a,u),Zr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Mj),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ko("z",o,c,this.animationValues);for(let u=0;u<wo.length;u++)ko(`rotate${wo[u]}`,o,c,this.animationValues),ko(`skew${wo[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Oj;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Qi(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=Qi(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Fn(this.latestValues)&&(b.transform=u?u({},""):"none",this.hasProjected=!1),b}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Dj(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:p,y:g}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in ds){if(h[b]===void 0)continue;const{correct:y,applyTo:x}=ds[b],w=c.transform==="none"?h[b]:y(h[b],f);if(x){const C=x.length;for(let E=0;E<C;E++)c[x[E]]=w}else c[b]=w}return this.options.layoutId&&(c.pointerEvents=f===this?Qi(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(rd),this.root.sharedNodes.clear()}}}function Lj(e){e.updateLayout()}function Fj(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Nt(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=kt(h);h.min=r[f].min,h.max=h.min+p}):Em(s,n.layoutBox,r)&&Nt(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=kt(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=lr();Zr(a,r,n.layoutBox);const l=lr();o?Zr(l,e.applyTransform(i,!0),n.measuredBox):Zr(l,r,n.layoutBox);const c=!km(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=ze();ei(g,n.layoutBox,h.layoutBox);const b=ze();ei(b,r,p.layoutBox),Sm(g,b)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Bj(e){qr&&Bn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function zj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Vj(e){e.clearSnapshot()}function rd(e){e.clearMeasurements()}function $j(e){e.isLayoutDirty=!1}function Uj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function id(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wj(e){e.resolveTargetDelta()}function Hj(e){e.calcProjection()}function qj(e){e.resetSkewAndRotation()}function Kj(e){e.removeLeadSnapshot()}function sd(e,t,n){e.translate=Me(t.translate,0,n),e.scale=Me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function od(e,t,n,r){e.min=Me(t.min,n.min,r),e.max=Me(t.max,n.max,r)}function Gj(e,t,n,r){od(e.x,t.x,n.x,r),od(e.y,t.y,n.y,r)}function Yj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xj={duration:.45,ease:[.4,0,.1,1]},ad=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ld=ad("applewebkit/")&&!ad("chrome/")?Math.round:gt;function cd(e){e.min=ld(e.min),e.max=ld(e.max)}function Jj(e){cd(e.x),cd(e.y)}function Em(e,t,n){return e==="position"||e==="preserve-aspect"&&!ej(ed(t),ed(n),.2)}function Qj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Zj=jm({attachResizeListener:(e,t)=>fi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),So={current:void 0},Nm=jm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!So.current){const e=new Zj({});e.mount(window),e.setOptions({layoutScroll:!0}),So.current=e}return So.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),eE={pan:{Feature:gj},drag:{Feature:mj,ProjectionNode:Nm,MeasureLayout:bm}};function ud(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&_e.postRender(()=>s(t,Ci(t)))}class tE extends Rn{mount(){const{current:t}=this.node;t&&(this.unmount=eS(t,n=>(ud(this.node,n,"Start"),r=>ud(this.node,r,"End"))))}unmount(){}}class nE extends Rn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Si(fi(this.node.current,"focus",()=>this.onFocus()),fi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function dd(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&_e.postRender(()=>s(t,Ci(t)))}class rE extends Rn{mount(){const{current:t}=this.node;t&&(this.unmount=iS(t,n=>(dd(this.node,n,"Start"),(r,{success:i})=>dd(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ka=new WeakMap,Co=new WeakMap,iE=e=>{const t=ka.get(e.target);t&&t(e)},sE=e=>{e.forEach(iE)};function oE({root:e,...t}){const n=e||document;Co.has(n)||Co.set(n,{});const r=Co.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(sE,{root:e,...t})),r[i]}function aE(e,t,n){const r=oE(t);return ka.set(e,n),r.observe(e),()=>{ka.delete(e),r.unobserve(e)}}const lE={some:0,all:1};class cE extends Rn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:lE[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(l)};return aE(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(uE(t,n))&&this.startObserver()}unmount(){}}function uE({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dE={inView:{Feature:cE},tap:{Feature:rE},focus:{Feature:nE},hover:{Feature:tE}},fE={layout:{ProjectionNode:Nm,MeasureLayout:bm}},Sa={current:null},Tm={current:!1};function hE(){if(Tm.current=!0,!!fl)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Sa.current=e.matches;e.addListener(t),t()}else Sa.current=!1}const pE=[...Zp,ot,En],mE=e=>pE.find(Qp(e)),fd=new WeakMap;function gE(e,t,n){for(const r in t){const i=t[r],s=n[r];if(at(i))e.addValue(r,i);else if(at(s))e.addValue(r,ui(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,ui(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const hd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class xE{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Kt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,_e.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=zs(n),this.isVariantNode=ap(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];l[p]!==void 0&&at(g)&&g.set(l[p],!1)}}mount(t){this.current=t,fd.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Tm.current||hE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sa.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fd.delete(this.current),this.projection&&this.projection.unmount(),jn(this.notifyUpdate),jn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Gn.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&_e.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in vr){const n=vr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ze()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<hd.length;r++){const i=hd[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=gE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ui(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Xp(i)||Vp(i))?i=parseFloat(i):!mE(i)&&En.test(n)&&(i=Kp(t,n)),this.setBaseTarget(t,at(i)?i.get():i)),at(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=bl(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!at(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ml),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Pm extends xE{constructor(){super(...arguments),this.KeyframeResolver=em}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;at(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function yE(e){return window.getComputedStyle(e)}class bE extends Pm{constructor(){super(...arguments),this.type="html",this.renderInstance=gp}readValueFromInstance(t,n){if(Gn.has(n)){const r=Fl(n);return r&&r.default||0}else{const r=yE(t),i=(hp(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return xm(t,n)}build(t,n,r){kl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return El(t,n,r)}}class vE extends Pm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ze}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gn.has(n)){const r=Fl(n);return r&&r.default||0}return n=xp.has(n)?n:gl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return vp(t,n,r)}build(t,n,r){Sl(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){yp(t,n,r,i)}mount(t){this.isSVGTag=jl(t.tagName),super.mount(t)}}const wE=(e,t)=>yl(e)?new vE(t):new bE(t,{allowProjection:e!==m.Fragment}),kE=Kk({...HC,...dE,...eE,...fE},wE),xs=lk(kE),$l=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("card-glass rounded border bg-card text-card-foreground shadow-none",e),...t}));$l.displayName="Card";const SE=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("flex flex-col space-y-0.5 px-3 py-2",e),...t}));SE.displayName="CardHeader";const CE=m.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:F("text-sm font-light uppercase tracking-wider text-muted-foreground",e),...t}));CE.displayName="CardTitle";const jE=m.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:F("text-xs text-muted-foreground",e),...t}));jE.displayName="CardDescription";const Ul=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("p-3 pt-0",e),...t}));Ul.displayName="CardContent";const EE=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("flex items-center p-3 pt-0",e),...t}));EE.displayName="CardFooter";const NE={critical:"border-ask-red text-ask-red",high:"border-warning-amber text-warning-amber",medium:"border-accent-blue text-accent-blue",low:"border-muted-foreground/30 text-muted-foreground"},TE={feature:"border-category-feature text-category-feature",bugfix:"border-category-bugfix text-category-bugfix",refactor:"border-category-refactor text-category-refactor",infrastructure:"border-category-infrastructure text-category-infrastructure",docs:"border-category-docs text-category-docs"},jo="inline-block rounded border px-1.5 py-0 text-[10px] uppercase bg-transparent";function PE({scopeId:e,projectId:t,info:n,onRecover:r,onDismiss:i}){return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,onClick:s=>s.stopPropagation(),children:d.jsx("button",{type:"button",className:"flex items-center gap-0.5 text-amber-500 hover:text-amber-400 transition-colors",children:d.jsx(rn,{className:"h-3 w-3"})})}),d.jsxs(un,{className:"w-56 p-3",side:"top",align:"end",onClick:s=>s.stopPropagation(),children:[d.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Session ended without completing work."}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.from_status&&d.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 transition-colors",onClick:()=>r(e,n.from_status,t),children:[d.jsx(z0,{className:"h-3 w-3"}),"Revert to ",n.from_status]}),d.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded bg-muted text-muted-foreground hover:bg-muted/80 transition-colors",onClick:()=>i(e,t),children:[d.jsx(wt,{className:"h-3 w-3"}),"Keep here"]})]})]})]})}function AE(e){const t=e.toLowerCase().trim(),n=t.match(/^~?(\d+)(?:\s*-\s*\d+)?\s*min/);if(n)return`${n[1]}M`;const r=t.match(/^~?(\d+(?:\.\d+)?)(?:\s*-\s*\d+(?:\.\d+)?)?\s*hour/);if(r)return`${r[1]}H`;const i=t.match(/\((\d+(?:\.\d+)?)(?:\s*-\s*\d+(?:\.\d+)?)?\s*(hour|min)/);return i?`${i[1]}${i[2].startsWith("h")?"H":"M"}`:t.includes("large")||t.includes("multi")?"LG":t.includes("medium")||t.includes("half")?"MD":t.includes("small")?"SM":"TBD"}function Wn({scope:e,onClick:t,isDragOverlay:n,cardDisplay:r,dimmed:i,project:s}){const{attributes:o,listeners:a,setNodeRef:l,transform:c,isDragging:u}=Xh({id:ce(e),disabled:n||i}),f=c?{transform:xr.Translate.toString(c)}:void 0,{engine:h}=dn(),{activeScopes:p,abandonedScopes:g,recoverScope:b,dismissAbandoned:y}=Sh(),x=Xt(),w=h.getEntryPoint().id,C=e.status===w,E=C&&!!e.is_ghost,k=ce(e),S=!C&&p.has(k),A=C?void 0:g.get(k),T=!!A&&!S,R=m.useRef(null),[N,D]=m.useState(()=>document.documentElement.getAttribute("data-theme")==="neon-glass");return m.useEffect(()=>{const P=new MutationObserver(()=>{D(document.documentElement.getAttribute("data-theme")==="neon-glass")});return P.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>P.disconnect()},[]),m.useEffect(()=>{if(!S||!R.current)return;let P=0,_;const L=R.current,I=N?M=>`conic-gradient(from ${M}deg, transparent 0%, rgba(var(--neon-pink), 0.9) 8%, rgba(var(--neon-pink), 0.5) 16%, rgba(var(--neon-cyan), 0.15) 24%, transparent 32%)`:M=>`conic-gradient(from ${M}deg, transparent 0%, rgba(233,30,99,0.7) 10%, rgba(233,30,99,0.3) 20%, transparent 30%)`,H=()=>{P=(P+1.5)%360,L.style.background=I(P),_=requestAnimationFrame(H)};return _=requestAnimationFrame(H),()=>cancelAnimationFrame(_)},[S,N]),d.jsxs($l,{ref:l,"data-tour":"scope-card",style:{...f,...!E&&!C&&s&&(r==null?void 0:r.project)!==!1?{"--project-color":`hsl(${s.color})`}:{}},className:F("scope-card group/scope-card cursor-grab transition-[colors,opacity] duration-200 hover:bg-surface-light active:cursor-grabbing",E?"scope-card-ghost ghost-shimmer opacity-70":C?"border-l-2 border-dashed border-l-warning-amber/60":"",S&&"scope-card-dispatched",T&&"scope-card-abandoned",u&&"opacity-0 pointer-events-none",i&&!u&&"opacity-30 cursor-default"),onClick:()=>{u||t==null||t(e)},...o,...a,children:[S&&d.jsx("div",{ref:R,className:"dispatch-border-overlay"}),d.jsxs(Ul,{className:"px-2.5 py-1.5",children:[d.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[E?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-purple-400",children:[d.jsx(Wa,{className:"h-3 w-3"}),"ai suggestion"]}):C?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-warning-amber",children:[d.jsx(a0,{className:"h-3 w-3"}),"idea"]}):d.jsxs("span",{className:"font-mono text-xxs text-muted-foreground flex items-center gap-1",children:[S&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-pink-500 dispatch-pulse"}),T&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),_t(e.id),d.jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),fetch(x(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favourite:!e.favourite})})},className:F("inline-flex items-center justify-center h-3.5 w-3.5 transition-all duration-150",e.favourite?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover/scope-card:opacity-100 hover:text-primary/70"),"aria-label":e.favourite?"Remove from favourites":"Add to favourites",children:d.jsx(D0,{className:F("h-3 w-3",e.favourite&&"fill-current")})})]}),!C&&d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[T&&d.jsx(PE,{scopeId:e.id,projectId:e.project_id,info:A,onRecover:b,onDismiss:y}),e.effort_estimate&&(r==null?void 0:r.effort)!==!1&&d.jsx("span",{className:F(jo,"effort-ghost border-muted-foreground/30 text-muted-foreground"),children:AE(e.effort_estimate)}),e.category&&(r==null?void 0:r.category)!==!1&&d.jsx("span",{className:F(jo,TE[e.category]??"border-muted-foreground/30 text-muted-foreground"),children:e.category}),e.priority&&(r==null?void 0:r.priority)!==!1&&d.jsx("span",{className:F(jo,NE[e.priority]??"border-muted-foreground/30 text-muted-foreground"),children:e.priority})]})]}),d.jsx("h3",{className:"text-xs font-light leading-snug line-clamp-2",children:e.title}),!C&&e.tags.length>0&&(r==null?void 0:r.tags)!==!1&&d.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(P=>d.jsx("span",{className:"glass-pill inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:P},P)),e.tags.length>3&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",e.tags.length-3]})]})]})]})}function _E({projectId:e,disabled:t,onProjectChange:n,className:r}){const{projects:i,hasMultipleProjects:s,getProjectColor:o,getProjectName:a}=Rt(),[l,c]=m.useState(!1);if(!s||!e)return null;const u=o(e),f=a(e),h=i.filter(p=>p.enabled);return d.jsxs(An,{open:l&&!t,onOpenChange:c,children:[d.jsx(_n,{asChild:!0,children:d.jsxs("button",{disabled:t,className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0 text-[10px] leading-[16px] transition-all duration-200",t?"opacity-50 cursor-default":"cursor-pointer hover:bg-accent/50",r),style:{borderColor:`hsl(${u} / 0.4)`,color:`hsl(${u})`,borderWidth:"1px",borderStyle:"solid"},onClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 transition-all duration-200",style:{backgroundColor:`hsl(${u})`}}),d.jsx("span",{className:"truncate max-w-[60px]",children:f}),!t&&d.jsx(Zf,{className:"h-2.5 w-2.5 shrink-0 opacity-60"})]})}),d.jsx(un,{className:"w-44 p-1",align:"start",side:"top",sideOffset:6,onClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:d.jsx("div",{className:"max-h-48 overflow-y-auto",children:h.map(p=>{const g=p.id===e;return d.jsxs("button",{className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors",g?"bg-accent":"hover:bg-accent/50"),onClick:()=>{!g&&n&&n(p.id),c(!1)},children:[d.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:`hsl(${p.color})`}}),d.jsx("span",{className:"truncate flex-1 text-left",children:p.name}),g&&d.jsx(Kn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]},p.id)})})})]})}const Am={assembling:"border-dashed border-cyan-500/40",dispatched:"border-solid border-amber-500/50 batch-group-dispatched",in_progress:"border-solid border-amber-500/40 batch-group-dispatched",completed:"border-solid border-green-500/40",failed:"border-solid border-red-500/40",cancelled:"border-solid border-muted-foreground/30 opacity-50"},_m={assembling:{icon:Ts,label:"Assembling",bg:"bg-cyan-500/15",text:"text-cyan-400"},dispatched:{icon:Zo,label:"In Progress",bg:"bg-amber-500/15",text:"text-amber-400"},in_progress:{icon:Zo,label:"In Progress",bg:"bg-amber-500/15",text:"text-amber-400"},completed:{icon:Kn,label:"Completed",bg:"bg-green-500/15",text:"text-green-400"},failed:{icon:wt,label:"Failed",bg:"bg-red-500/15",text:"text-red-400"},cancelled:{icon:wt,label:"Cancelled",bg:"bg-muted",text:"text-muted-foreground"}};function RE({sprint:e,scopeLookup:t,onDelete:n,onRename:r,onScopeClick:i,cardDisplay:s,dimmedIds:o,looseCount:a,onAddAll:l,projectLookup:c,editingName:u,onEditingDone:f,onProjectChange:h}){var X;const{engine:p}=dn(),g=e.status==="assembling",[b,y]=m.useState(u??!1),[x,w]=m.useState(e.name),C=m.useRef(null);m.useEffect(()=>{u&&(y(!0),w(""))},[u]),m.useEffect(()=>{var W;b&&((W=C.current)==null||W.focus())},[b]);const E=()=>{const W=x.trim();W&&W!==e.name&&r&&r(e.id,W),y(!1),w(W||e.name),f==null||f()},k=e.group_type==="batch",S=e.status==="dispatched"||e.status==="in_progress",{attributes:A,listeners:T,setNodeRef:R,isDragging:N}=Xh({id:`sprint-${e.id}`,disabled:S||e.scope_ids.length===0}),{setNodeRef:D,isOver:P}=sl({id:`sprint-drop-${e.id}`,disabled:!g}),{active:_}=Jh(),L=_?String(_.id):null,I=L&&!L.startsWith("sprint-")?dv(L).projectId:void 0,H=g&&L!=null&&!L.startsWith("sprint-")&&(!e.project_id||!I||e.project_id===I),M=e.scope_ids.length,{progress:$}=e,z=k?sh:Ts,v=e.project_id&&(c==null?void 0:c.get(e.project_id)),U=v?`hsl(${v.color})`:void 0,ne=v?`hsl(${v.color} / 0.1)`:void 0,j=U?"":"text-muted-foreground",K=k&&g?"border-muted-foreground/30":Am[e.status]??"border-muted-foreground/30";return d.jsxs("div",{ref:R,style:{...U?{borderColor:U}:k&&g?{borderColor:(((X=p.getList(e.target_column))==null?void 0:X.hex)??"")+"80"}:void 0},className:F("rounded-lg border bg-card/30 transition-all duration-200",!U&&K,N&&"opacity-0",!S&&e.scope_ids.length>0&&"cursor-grab active:cursor-grabbing"),...A,...T,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit rounded-t-lg transition-colors duration-200",style:ne?{backgroundColor:ne}:void 0,children:[d.jsx(z,{className:F("h-3 w-3 shrink-0 transition-colors duration-200",j),style:U?{color:U}:void 0}),b?d.jsx("input",{ref:C,className:"min-w-0 flex-1 h-5 rounded bg-muted/50 px-1.5 text-xs font-medium text-foreground border border-cyan-500/30 focus:outline-none focus:ring-1 focus:ring-cyan-500/50",placeholder:k?"Batch name...":"Sprint name...",value:x,onChange:W=>w(W.target.value),onKeyDown:W=>{W.key==="Enter"&&E(),W.key==="Escape"&&(y(!1),w(e.name),f==null||f())},onBlur:E,onClick:W=>W.stopPropagation()}):d.jsx("span",{className:F("text-xs font-medium text-foreground truncate",g&&"cursor-text"),onDoubleClick:()=>{g&&(y(!0),w(e.name))},children:e.name}),d.jsx("div",{className:"flex-1"}),g&&(a??0)>0&&l&&d.jsxs("button",{onClick:W=>{W.stopPropagation(),l(e.id)},className:"shrink-0 flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",title:`Add all ${a} remaining scopes`,children:["+ All (",a,")"]}),n&&d.jsx("button",{onClick:W=>{W.stopPropagation(),n(e.id)},disabled:e.status==="dispatched"||e.status==="in_progress",className:F("shrink-0 transition-colors",e.status==="dispatched"||e.status==="in_progress"?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-[#FFFFFF]"),children:d.jsx(wt,{className:"h-3 w-3"})})]}),d.jsxs("div",{ref:D,className:F("p-1.5 space-y-1 min-h-[40px] transition-colors duration-150",P&&g&&"bg-cyan-500/5 ring-1 ring-inset ring-cyan-500/30 rounded-b-lg"),children:[e.scope_ids.map(W=>{const Le=e.project_id?`${e.project_id}::${W}`:String(W),Ce=t.get(Le);if(!Ce){const Re=e.scopes.find(ge=>ge.scope_id===W);return d.jsxs("div",{className:"rounded border border-muted-foreground/20 bg-card/50 px-2 py-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-mono",children:_t(W)}),Re&&d.jsx("span",{className:"ml-2",children:Re.title})]},W)}return L&&ce(Ce)===L?null:d.jsx(Wn,{scope:Ce,onClick:i,cardDisplay:s,dimmed:o==null?void 0:o.has(ce(Ce)),project:Ce.project_id&&c?c.get(Ce.project_id):void 0},ce(Ce))}),H&&d.jsx("div",{className:F("flex h-8 items-center justify-center rounded border border-dashed text-[10px] transition-colors",P?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop to add"})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsxs("div",{className:"inline-flex items-stretch rounded-full border border-muted-foreground/30 bg-muted/40 pl-0 pr-2 text-[10px] leading-[16px] text-muted-foreground",children:[d.jsx(_E,{projectId:e.project_id,disabled:M>0||!g,onProjectChange:h?W=>h(e.id,W):void 0,className:"-ml-px -my-px"}),d.jsxs("span",{className:"ml-1.5 flex items-center",children:[M," scope",M!==1?"s":""]})]}),(()=>{const W=_m[e.status];if(!W)return null;const Le=W.icon,Ce=!g&&M>0&&($.completed>0||$.failed>0||$.in_progress>0),Re=d.jsxs("span",{className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] leading-[16px]",W.bg,W.text),children:[d.jsx(Le,{className:"h-2.5 w-2.5"}),W.label]});if(!Ce)return Re;const ge=[];return $.completed>0&&ge.push(`${$.completed} done`),$.in_progress>0&&ge.push(`${$.in_progress} active`),$.failed>0&&ge.push(`${$.failed} failed`),d.jsxs(Of,{children:[d.jsx(If,{asChild:!0,children:Re}),d.jsx(Fa,{side:"top",children:ge.join(" · ")})]})})()]}),k&&e.dispatch_result&&(e.dispatch_result.commit_sha||e.dispatch_result.pr_url)&&d.jsxs("div",{className:"border-t border-inherit px-2.5 py-1 text-[10px] text-muted-foreground space-y-0.5",children:[e.dispatch_result.commit_sha&&d.jsx("span",{className:"font-mono",children:e.dispatch_result.commit_sha.slice(0,7)}),e.dispatch_result.pr_url&&d.jsxs("a",{href:e.dispatch_result.pr_url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:underline ml-1",children:["PR #",e.dispatch_result.pr_number??""]})]})]})}function ME({sprint:e,scopeLookup:t,projectLookup:n}){const i=e.group_type==="batch"?sh:Ts,s=e.project_id&&(n==null?void 0:n.get(e.project_id)),o=s?`hsl(${s.color})`:void 0,a=s?`hsl(${s.color} / 0.1)`:void 0,l=o?"":"text-muted-foreground",c=Am[e.status]??"border-muted-foreground/30",u=_m[e.status],f=e.scope_ids.length;return d.jsxs("div",{className:F("w-72 rotate-1 opacity-90 shadow-xl shadow-black/40 rounded-lg border bg-card/80 overflow-hidden",!o&&c),style:o?{borderColor:o}:void 0,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit rounded-t-lg",style:a?{backgroundColor:a}:void 0,children:[d.jsx(i,{className:F("h-3 w-3 shrink-0",l),style:o?{color:o}:void 0}),d.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:e.name})]}),d.jsx("div",{className:"p-1.5 space-y-1",children:e.scope_ids.map(h=>{const p=e.project_id?`${e.project_id}::${h}`:String(h),g=t==null?void 0:t.get(p);if(g)return d.jsx(Wn,{scope:g,project:g.project_id&&n?n.get(g.project_id):void 0},ce(g));const b=e.scopes.find(y=>y.scope_id===h);return d.jsxs("div",{className:"rounded border border-muted-foreground/20 bg-card/50 px-2 py-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-mono",children:_t(h)}),b&&d.jsx("span",{className:"ml-2",children:b.title})]},h)})}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[f," scope",f!==1?"s":""]}),u&&(()=>{const h=u.icon;return d.jsxs("span",{className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]",u.bg,u.text),children:[d.jsx(h,{className:"h-2.5 w-2.5"}),u.label]})})()]})]})}const DE=[{field:"id",label:"Scope ID"},{field:"priority",label:"Priority"},{field:"effort",label:"Effort"},{field:"updated_at",label:"Last Updated"},{field:"created_at",label:"Created"},{field:"title",label:"Alphabetical"}];function pd({sortField:e,sortDirection:t,onSetSort:n,collapsed:r,onToggleCollapse:i}){const s=t==="asc"?Eb:Zf;return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsx("button",{className:"ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-white/[0.06] hover:text-foreground","aria-label":"Column options",children:d.jsx(zb,{className:"h-3 w-3"})})}),d.jsxs(un,{className:"filter-popover-glass !bg-transparent w-44",align:"end",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Sort by"}),DE.map(o=>{const a=e===o.field;return d.jsxs("button",{onClick:()=>n(o.field),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",a&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3 w-3 shrink-0 items-center justify-center rounded-full border",a?"border-primary bg-primary":"border-white/15"),children:a&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-white"})}),d.jsx("span",{className:F("flex-1 text-left",a&&"text-foreground"),children:o.label}),a&&d.jsx(s,{className:"h-3 w-3 text-muted-foreground"})]},o.field)})]}),d.jsx("div",{className:"my-1.5 border-t border-white/10"}),d.jsxs("button",{onClick:i,className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors hover:bg-white/[0.06]",children:[r?d.jsx(rh,{className:"h-3 w-3 text-muted-foreground"}):d.jsx(nh,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{children:r?"Expand column":"Collapse column"})]})]})]})}function OE({id:e,label:t,color:n,scopes:r,sprints:i=[],scopeLookup:s=new Map,globalSprintScopeIds:o,onScopeClick:a,onDeleteSprint:l,onRenameSprint:c,editingSprintId:u,onSprintEditingDone:f,isValidDrop:h,isDragActive:p,headerExtra:g,collapsed:b,onToggleCollapse:y,sortField:x,sortDirection:w,onSetSort:C,cardDisplay:E,dimmedIds:k,onAddAllToSprint:S,projectLookup:A,onProjectChange:T}){jr();const{setNodeRef:R,isOver:N}=sl({id:e}),D=m.useRef(null);m.useEffect(()=>{p&&h&&D.current&&D.current.scrollTo({top:0,behavior:"smooth"})},[p,h]);const P=o??new Set(i.flatMap(M=>M.scope_ids.map($=>M.project_id?`${M.project_id}::${$}`:String($)))),_=r.filter(M=>!P.has(ce(M))),L=_.filter(M=>!M.is_ghost).map(M=>M.id),I=r.length,H=b;return d.jsx("div",{ref:R,"data-tour":"kanban-column",className:F("flex h-full flex-shrink-0 flex-col rounded border bg-card/50 overflow-hidden transition-[width] duration-300 ease-in-out",H?"w-10 cursor-pointer items-center":"w-72","card-glass neon-border-blue",p&&N&&h&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",p&&N&&!h&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",p&&!N&&h&&"border-green-500/20"),onClick:H?y:void 0,children:H?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex items-center justify-center py-1.5",onClick:M=>M.stopPropagation(),children:x&&w&&C&&y&&d.jsx(pd,{sortField:x,sortDirection:w,onSetSort:C,collapsed:!0,onToggleCollapse:y})}),d.jsx("div",{className:"flex items-start justify-center overflow-hidden pt-2",children:d.jsxs("div",{className:"flex items-center gap-2 [writing-mode:vertical-lr]",children:[d.jsx("div",{className:F("h-2.5 w-2.5 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${n})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground whitespace-nowrap",children:t})]})}),d.jsx("span",{className:"mt-2 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-normal text-muted-foreground",children:I})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"column-header flex items-center gap-2 border-b px-2.5 py-1.5 cursor-pointer",onClick:y,children:[d.jsx("div",{className:F("h-2.5 w-2.5 rounded-full","animate-glow-pulse"),style:{backgroundColor:`hsl(${n})`}}),d.jsx("h2",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground",children:t}),d.jsx("span",{className:"ml-auto rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:I}),g&&d.jsx("span",{className:"flex items-center",onClick:M=>M.stopPropagation(),children:g}),x&&w&&C&&y&&d.jsx("span",{onClick:M=>M.stopPropagation(),children:d.jsx(pd,{sortField:x,sortDirection:w,onSetSort:C,collapsed:!1,onToggleCollapse:y})})]}),d.jsx("div",{ref:D,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-2",children:d.jsxs("div",{className:"space-y-1.5",children:[i.map(M=>d.jsx(RE,{sprint:M,scopeLookup:s,onDelete:l,onRename:c,onScopeClick:a,cardDisplay:E,dimmedIds:k,projectLookup:A,editingName:sr(M)===u,onEditingDone:f,onProjectChange:T,looseCount:M.status==="assembling"?L.length:0,onAddAll:M.status==="assembling"&&S?$=>S($,L):void 0},`sprint-${M.id}`)),p&&h&&d.jsx("div",{className:F("flex h-10 items-center justify-center rounded border-2 border-dashed text-xs transition-colors",N?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),d.jsx(cs,{initial:!1,children:_.filter(M=>!M.is_ghost).map(M=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:M,onClick:a,cardDisplay:E,dimmed:k==null?void 0:k.has(ce(M)),project:M.project_id&&A?A.get(M.project_id):void 0})},ce(M)))}),_.some(M=>M.is_ghost)&&_.some(M=>!M.is_ghost)&&d.jsx("div",{className:"my-2 border-t border-dashed border-purple-500/20"}),d.jsx(cs,{initial:!1,children:_.filter(M=>M.is_ghost).map(M=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:M,onClick:a,cardDisplay:E,dimmed:k==null?void 0:k.has(ce(M)),project:M.project_id&&A?A.get(M.project_id):void 0})},ce(M)))})]})})]})})}var IE=Symbol.for("react.lazy"),ys=Tx[" use ".trim().toString()];function LE(e){return typeof e=="object"&&e!==null&&"then"in e}function Rm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===IE&&"_payload"in e&&LE(e._payload)}function Mm(e){const t=BE(e),n=m.forwardRef((r,i)=>{let{children:s,...o}=r;Rm(s)&&typeof ys=="function"&&(s=ys(s._payload));const a=m.Children.toArray(s),l=a.find(VE);if(l){const c=l.props.children,u=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:m.isValidElement(c)?m.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var FE=Mm("Slot");function BE(e){const t=m.forwardRef((n,r)=>{let{children:i,...s}=n;if(Rm(i)&&typeof ys=="function"&&(i=ys(i._payload)),m.isValidElement(i)){const o=UE(i),a=$E(s,i.props);return i.type!==m.Fragment&&(a.ref=r?bf(r,o):o),m.cloneElement(i,a)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zE=Symbol("radix.slottable");function VE(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zE}function $E(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function UE(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const WE=Ah("inline-flex items-center justify-center whitespace-nowrap rounded text-xs font-normal ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 glow-blue",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-background hover:bg-surface-light hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-surface-light hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1.5",sm:"h-7 rounded px-2.5",lg:"h-9 rounded px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),ke=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?FE:"button";return d.jsx(o,{className:F(WE({variant:t,size:n,className:e})),ref:s,...i})});ke.displayName="Button";const HE=[{key:"effort",label:"Effort"},{key:"category",label:"Category"},{key:"priority",label:"Priority"},{key:"tags",label:"Tags"},{key:"project",label:"Project colors"}];function qE({display:e,onToggle:t,hiddenCount:n}){return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:"gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10","aria-label":"Toggle card display",children:[d.jsx(N0,{className:"h-3 w-3"}),"Cards",n>0&&d.jsx("span",{className:"ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]",children:n})]})}),d.jsx(un,{align:"end",className:"filter-popover-glass !bg-transparent w-40",children:d.jsx("div",{className:"space-y-0.5",children:HE.map(({key:r,label:i})=>{const s=e[r];return d.jsxs("button",{onClick:()=>t(r),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",s?"border-primary bg-primary text-primary-foreground":"border-white/15"),children:s&&d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:F("capitalize",s&&"text-foreground"),children:i})]},r)})})})]})}const KE=[{value:"kanban",label:"Kanban",Icon:eh},{value:"swimlane",label:"Swimlane",Icon:oh}],GE=[{value:"priority",label:"Priority"},{value:"category",label:"Category"},{value:"tags",label:"Tags"},{value:"effort",label:"Effort"},{value:"dependencies",label:"Dependencies"},{value:"project",label:"Project"}];function YE({viewMode:e,groupField:t,onViewModeChange:n,onGroupFieldChange:r}){const i=e==="swimlane"?oh:eh;return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:"gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10","aria-label":"Toggle view mode",children:[d.jsx(i,{className:"h-3 w-3"}),"Board"]})}),d.jsxs(un,{align:"end",className:"filter-popover-glass !bg-transparent w-44",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"View"}),KE.map(({value:s,label:o,Icon:a})=>d.jsxs("button",{onClick:()=>n(s),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",e===s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",e===s?"border-primary bg-primary":"border-white/15"),children:e===s&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary-foreground"})}),d.jsx(a,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{className:F(e===s&&"text-foreground"),children:o})]},s))]}),e==="swimlane"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 border-t border-white/[0.06]"}),d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Group by"}),GE.map(({value:s,label:o})=>d.jsxs("button",{onClick:()=>r(s),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",t===s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",t===s?"border-primary bg-primary":"border-white/15"),children:t===s&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary-foreground"})}),d.jsx("span",{className:F(t===s&&"text-foreground"),children:o})]},s))]})]})]})]})}function XE({laneValue:e,status:t,scopes:n=[],onScopeClick:r,cardDisplay:i,dimmedIds:s,isDragActive:o,isValidDrop:a,isCollapsed:l,projectLookup:c}){const u=`swim::${e}::${t}`,{setNodeRef:f,isOver:h}=sl({id:u});return l?null:d.jsx("div",{ref:f,className:F("swim-cell min-h-[48px] overflow-hidden rounded border border-white/[0.04] p-1 transition-colors",o&&h&&a&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",o&&h&&!a&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",o&&!h&&a&&"border-green-500/20",n.length===0&&"border-dashed border-white/[0.06]"),children:d.jsxs("div",{className:"space-y-1.5",children:[o&&a&&d.jsx("div",{className:F("flex h-8 items-center justify-center rounded border-2 border-dashed text-[10px] transition-colors",h?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),d.jsx(cs,{initial:!1,children:n.filter(p=>!p.is_ghost).map(p=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:p,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(p)),project:p.project_id&&c?c.get(p.project_id):void 0})},ce(p)))}),d.jsx(cs,{initial:!1,children:n.filter(p=>p.is_ghost).map(p=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:p,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(p)),project:p.project_id&&c?c.get(p.project_id):void 0})},ce(p)))})]})})}function JE({lane:e,columns:t,collapsedColumns:n,isLaneCollapsed:r,onToggleLane:i,onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,validTargets:c,projectLookup:u}){return r?d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:i,className:"swim-lane-header flex items-center gap-2 rounded-l px-3 py-1.5 text-left hover:bg-white/[0.04] transition-colors cursor-pointer sticky left-0 z-10 bg-background/60 backdrop-blur-sm",children:[d.jsx("div",{className:F("h-full w-0.5 rounded-full shrink-0 self-stretch",!e.colorHsl&&e.color),style:e.colorHsl?{backgroundColor:`hsl(${e.colorHsl})`}:void 0}),d.jsx(ii,{className:"h-3 w-3 text-muted-foreground shrink-0"}),d.jsx("span",{className:"text-xxs font-medium text-muted-foreground truncate capitalize",children:e.label}),d.jsx("span",{className:"ml-auto rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground shrink-0",children:e.count})]}),t.map(f=>d.jsx("div",{className:F(n.has(f.id)&&"hidden")},f.id))]}):d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:i,className:"swim-lane-header flex items-start gap-2 rounded-l px-3 py-2 text-left hover:bg-white/[0.04] transition-colors cursor-pointer sticky left-0 z-10 bg-background/60 backdrop-blur-sm",children:[d.jsx("div",{className:F("w-0.5 rounded-full shrink-0 min-h-[32px] self-stretch",!e.colorHsl&&e.color),style:e.colorHsl?{backgroundColor:`hsl(${e.colorHsl})`}:void 0}),d.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ii,{className:"h-3 w-3 text-muted-foreground shrink-0 rotate-90 transition-transform"}),d.jsx("span",{className:"swim-lane-label text-xxs font-medium text-foreground/80 truncate capitalize",children:e.label})]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[e.count," scope",e.count!==1?"s":""]})]})]}),t.map(f=>d.jsx(XE,{laneValue:e.value,status:f.id,scopes:e.cells[f.id],onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,isValidDrop:c.has(f.id),isCollapsed:n.has(f.id),projectLookup:u},f.id))]})}function QE({lanes:e,columns:t,collapsedColumns:n,collapsedLanes:r,onToggleLane:i,onToggleCollapse:s,onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,sprints:f,projectLookup:h}){jr();const p=t.filter(y=>!n.has(y.id)),g=`140px ${p.map(()=>"288px").join(" ")}`,b=f.some(y=>y.group_type==="sprint"||y.group_type==="batch"&&y.status!=="completed");return d.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[b&&d.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded border border-primary/20 bg-primary/5 px-3 py-1.5 text-xs text-muted-foreground",children:[d.jsx(r0,{className:"h-3.5 w-3.5 text-primary shrink-0"}),"Sprint groups are hidden in swimlane view"]}),d.jsxs("div",{className:"grid gap-px pb-4",style:{gridTemplateColumns:g,width:"max-content"},children:[d.jsx("div",{className:"sticky top-0 z-20 bg-background"}),p.map(y=>d.jsxs("button",{onClick:()=>s(y.id),className:F("sticky top-0 z-20 flex items-center gap-1.5 rounded-t border-b border-white/[0.06] bg-background px-2 py-1.5 text-left cursor-pointer hover:bg-white/[0.03] transition-colors","border-b-white/[0.08]"),children:[d.jsx("div",{className:F("h-2 w-2 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${y.color})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground truncate",children:y.label})]},y.id)),e.map(y=>d.jsx(JE,{lane:y,columns:p,collapsedColumns:n,isLaneCollapsed:r.has(y.value),onToggleLane:()=>i(y.value),onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,projectLookup:h},y.value)),e.length===0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{}),d.jsx("div",{className:F("col-span-full py-12 text-center text-xs text-muted-foreground"),children:"No scopes to display"})]})]})]})}function ZE({activeScope:e,activeSprint:t,cardDisplay:n,projectLookup:r,scopeLookup:i}){return d.jsxs(g1,{dropAnimation:null,children:[e&&d.jsx("div",{className:"w-72 rotate-2 shadow-xl shadow-black/40",children:d.jsx(Wn,{scope:e,cardDisplay:n,project:e.project_id&&r?r.get(e.project_id):void 0})}),t&&d.jsx(ME,{sprint:t,scopeLookup:i,projectLookup:r})]})}function eN({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a,onViewDetails:l}){var y;const c=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const x=setTimeout(()=>{var w;return(w=c.current)==null?void 0:w.focus()},100);return()=>clearTimeout(x)},[e]),!t||!n)return null;const u=((y=n.command)==null?void 0:y.replace("{id}",String(t.id)))??null,f=n.direction==="forward"&&!n.command&&n.from!==n.to,h=t.status===n.from&&f,p=h?"/scope-create":u,g=h||u?"Launch":"Move";function b(){o()}return d.jsx(an,{open:e,onOpenChange:x=>{x||a()},children:d.jsxs(Yt,{className:"max-w-xs p-3 gap-0",children:[d.jsx(ln,{className:"sr-only",children:h?"Promote idea":"Confirm transition"}),d.jsx(cn,{className:"sr-only",children:h?`Create a scope from idea "${t.title}"`:`Move ${_t(t.id)} from ${n.from} to ${n.to}`}),d.jsxs("div",{className:"mb-2.5 flex items-center gap-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(ns,{className:"h-3 w-3 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:h?d.jsx("span",{className:"font-light",children:t.title}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-mono",children:_t(t.id)})," ",d.jsx("span",{className:"font-light",children:t.title})]})}),p&&d.jsxs("div",{className:"mb-3 flex items-center gap-1.5 rounded bg-surface/30 px-2 py-1.5",children:[d.jsx(Ps,{className:"h-3 w-3 shrink-0 text-primary"}),d.jsx("code",{className:"text-xxs font-mono text-primary",children:p})]}),h&&d.jsx("p",{className:"mb-3 text-xxs text-muted-foreground",children:"Creates a scope document from this idea"}),r&&d.jsxs("div",{className:F("mb-3 flex items-start gap-1.5 rounded border px-2 py-1.5 text-xxs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(rn,{className:"mt-0.5 h-3 w-3 shrink-0"}),d.jsx("span",{children:"A CLI session is already running for this scope."})]}),s&&d.jsxs("div",{className:"mb-3 flex items-start gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-xxs text-red-400",children:[d.jsx(rn,{className:"mt-0.5 h-3 w-3 shrink-0"}),d.jsx("span",{children:s})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ke,{ref:c,size:"sm",onClick:b,disabled:i,className:"flex-1",children:i?"Launching...":g}),d.jsx(ke,{size:"sm",variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]}),(u||h)&&d.jsxs("button",{onClick:l,className:"mt-2 flex items-center gap-1 text-xxs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(th,{className:"h-2.5 w-2.5"}),"View Details"]})]})})}function tN({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a}){var b;const[l,c]=m.useState(new Set),u=(n==null?void 0:n.checklist)??[],f=u.length===0||l.size===u.length;if(m.useEffect(()=>{e&&c(new Set)},[e]),!t||!n)return null;const h=((b=n.command)==null?void 0:b.replace("{id}",String(t.id)))??null;function p(y){c(x=>{const w=new Set(x);return w.has(y)?w.delete(y):w.add(y),w})}function g(){o()}return d.jsx(an,{open:e,onOpenChange:y=>{y||a()},children:d.jsxs(Yt,{className:"max-w-md p-0 gap-0",children:[d.jsxs(Tn,{className:"px-5 pt-4 pb-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(ns,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx(ln,{className:"text-sm font-normal",children:n.label}),d.jsx(cn,{className:"text-xs text-muted-foreground mt-1",children:n.description})]}),d.jsxs("div",{className:"px-5 pb-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(t.id)}),d.jsx("span",{className:"font-light truncate",children:t.title}),t.category&&d.jsx(Ve,{variant:"secondary",className:"ml-auto text-xxs",children:t.category})]}),h&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-surface/30 px-3 py-2",children:[d.jsx(Ps,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("code",{className:"text-xs font-mono text-primary",children:h})]}),u.length>0&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("p",{className:"text-xxs font-medium text-muted-foreground uppercase tracking-wider",children:"Pre-launch checklist"}),u.map((y,x)=>d.jsxs("button",{onClick:()=>p(x),className:F("flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-xs text-left transition-colors",l.has(x)?"bg-primary/10 text-foreground":"bg-muted/30 text-muted-foreground hover:bg-muted/50"),children:[d.jsx("div",{className:F("flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border transition-colors",l.has(x)?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/30"),children:l.has(x)&&d.jsx(Kn,{className:"h-2.5 w-2.5"})}),d.jsx("span",{className:"font-light",children:y})]},y))]}),r&&d.jsxs("div",{className:F("flex items-start gap-2 rounded border px-3 py-2 text-xs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(rn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:"A CLI session is already running for this scope. Launching will start a new one."})]}),s&&d.jsxs("div",{className:"flex items-start gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[d.jsx(rn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:s})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{onClick:g,disabled:!f||i,className:"flex-1",children:i?"Launching...":h?"Launch in iTerm":"Confirm Move"}),d.jsx(ke,{variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]})]})]})})}var nN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rN=nN.reduce((e,t)=>{const n=Mm(`Primitive.${t}`),r=m.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),iN="Separator",md="horizontal",sN=["horizontal","vertical"],Dm=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=md,...i}=e,s=oN(r)?r:md,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(rN.div,{"data-orientation":s,...a,...i,ref:t})});Dm.displayName=iN;function oN(e){return sN.includes(e)}var Om=Dm;const bs=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>d.jsx(Om,{ref:i,decorative:n,orientation:t,className:F("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));bs.displayName=Om.displayName;function aN(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uN={};function gd(e,t){return(uN.jsx?cN:lN).test(e)}const dN=/[ \t\n\f\r]/g;function fN(e){return typeof e=="object"?e.type==="text"?xd(e.value):!1:xd(e)}function xd(e){return e.replace(dN,"")===""}class ji{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ji.prototype.normal={};ji.prototype.property={};ji.prototype.space=void 0;function Im(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ji(n,r,t)}function Ca(e){return e.toLowerCase()}class xt{constructor(t,n){this.attribute=n,this.property=t}}xt.prototype.attribute="";xt.prototype.booleanish=!1;xt.prototype.boolean=!1;xt.prototype.commaOrSpaceSeparated=!1;xt.prototype.commaSeparated=!1;xt.prototype.defined=!1;xt.prototype.mustUseProperty=!1;xt.prototype.number=!1;xt.prototype.overloadedBoolean=!1;xt.prototype.property="";xt.prototype.spaceSeparated=!1;xt.prototype.space=void 0;let hN=0;const se=Yn(),Ke=Yn(),ja=Yn(),V=Yn(),Ee=Yn(),pr=Yn(),bt=Yn();function Yn(){return 2**++hN}const Ea=Object.freeze(Object.defineProperty({__proto__:null,boolean:se,booleanish:Ke,commaOrSpaceSeparated:bt,commaSeparated:pr,number:V,overloadedBoolean:ja,spaceSeparated:Ee},Symbol.toStringTag,{value:"Module"})),Eo=Object.keys(Ea);class Wl extends xt{constructor(t,n,r,i){let s=-1;if(super(t,n),yd(this,"space",i),typeof r=="number")for(;++s<Eo.length;){const o=Eo[s];yd(this,Eo[s],(r&Ea[o])===Ea[o])}}}Wl.prototype.defined=!0;function yd(e,t,n){n&&(e[t]=n)}function Ar(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Wl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ca(r)]=r,n[Ca(s.attribute)]=r}return new ji(t,n,e.space)}const Lm=Ar({properties:{ariaActiveDescendant:null,ariaAtomic:Ke,ariaAutoComplete:null,ariaBusy:Ke,ariaChecked:Ke,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:Ee,ariaCurrent:null,ariaDescribedBy:Ee,ariaDetails:null,ariaDisabled:Ke,ariaDropEffect:Ee,ariaErrorMessage:null,ariaExpanded:Ke,ariaFlowTo:Ee,ariaGrabbed:Ke,ariaHasPopup:null,ariaHidden:Ke,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ee,ariaLevel:V,ariaLive:null,ariaModal:Ke,ariaMultiLine:Ke,ariaMultiSelectable:Ke,ariaOrientation:null,ariaOwns:Ee,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Ke,ariaReadOnly:Ke,ariaRelevant:null,ariaRequired:Ke,ariaRoleDescription:Ee,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Ke,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Fm(e,t){return t in e?e[t]:t}function Bm(e,t){return Fm(e,t.toLowerCase())}const pN=Ar({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pr,acceptCharset:Ee,accessKey:Ee,action:null,allow:null,allowFullScreen:se,allowPaymentRequest:se,allowUserMedia:se,alt:null,as:null,async:se,autoCapitalize:null,autoComplete:Ee,autoFocus:se,autoPlay:se,blocking:Ee,capture:null,charSet:null,checked:se,cite:null,className:Ee,cols:V,colSpan:null,content:null,contentEditable:Ke,controls:se,controlsList:Ee,coords:V|pr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:se,defer:se,dir:null,dirName:null,disabled:se,download:ja,draggable:Ke,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:se,formTarget:null,headers:Ee,height:V,hidden:ja,high:V,href:null,hrefLang:null,htmlFor:Ee,httpEquiv:Ee,id:null,imageSizes:null,imageSrcSet:null,inert:se,inputMode:null,integrity:null,is:null,isMap:se,itemId:null,itemProp:Ee,itemRef:Ee,itemScope:se,itemType:Ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:se,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:se,muted:se,name:null,nonce:null,noModule:se,noValidate:se,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:se,optimum:V,pattern:null,ping:Ee,placeholder:null,playsInline:se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:se,referrerPolicy:null,rel:Ee,required:se,reversed:se,rows:V,rowSpan:V,sandbox:Ee,scope:null,scoped:se,seamless:se,selected:se,shadowRootClonable:se,shadowRootDelegatesFocus:se,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Ke,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:se,useMap:null,value:Ke,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ee,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:se,declare:se,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:se,noHref:se,noShade:se,noWrap:se,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Ke,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:se,disableRemotePlayback:se,prefix:null,property:null,results:V,security:null,unselectable:null},space:"html",transform:Bm}),mN=Ar({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",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:bt,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:Ee,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:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:se,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,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:pr,g2:pr,glyphName:pr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:bt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,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:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bt,rev:bt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bt,requiredFeatures:bt,requiredFonts:bt,requiredFormats:bt,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:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:bt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bt,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Fm}),zm=Ar({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()}}),Vm=Ar({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Bm}),$m=Ar({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),gN={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"},xN=/[A-Z]/g,bd=/-[a-z]/g,yN=/^data[-\w.:]+$/i;function bN(e,t){const n=Ca(t);let r=t,i=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yN.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(bd,wN);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!bd.test(s)){let o=s.replace(xN,vN);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Wl}return new i(r,t)}function vN(e){return"-"+e.toLowerCase()}function wN(e){return e.charAt(1).toUpperCase()}const kN=Im([Lm,pN,zm,Vm,$m],"html"),Hl=Im([Lm,mN,zm,Vm,$m],"svg");function SN(e){return e.join(" ").trim()}var Zn={},No,vd;function CN(){if(vd)return No;vd=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
311
- `,c="/",u="*",f="",h="comment",p="declaration";function g(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var w=1,C=1;function E(L){var I=L.match(t);I&&(w+=I.length);var H=L.lastIndexOf(l);C=~H?L.length-H:C+L.length}function k(){var L={line:w,column:C};return function(I){return I.position=new S(L),R(),I}}function S(L){this.start=L,this.end={line:w,column:C},this.source=x.source}S.prototype.content=y;function A(L){var I=new Error(x.source+":"+w+":"+C+": "+L);if(I.reason=L,I.filename=x.source,I.line=w,I.column=C,I.source=y,!x.silent)throw I}function T(L){var I=L.exec(y);if(I){var H=I[0];return E(H),y=y.slice(H.length),I}}function R(){T(n)}function N(L){var I;for(L=L||[];I=D();)I!==!1&&L.push(I);return L}function D(){var L=k();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var I=2;f!=y.charAt(I)&&(u!=y.charAt(I)||c!=y.charAt(I+1));)++I;if(I+=2,f===y.charAt(I-1))return A("End of comment missing");var H=y.slice(2,I-2);return C+=2,E(H),y=y.slice(I),C+=2,L({type:h,comment:H})}}function P(){var L=k(),I=T(r);if(I){if(D(),!T(i))return A("property missing ':'");var H=T(s),M=L({type:p,property:b(I[0].replace(e,f)),value:H?b(H[0].replace(e,f)):f});return T(o),M}}function _(){var L=[];N(L);for(var I;I=P();)I!==!1&&(L.push(I),N(L));return L}return R(),_()}function b(y){return y?y.replace(a,f):f}return No=g,No}var wd;function jN(){if(wd)return Zn;wd=1;var e=Zn&&Zn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.default=n;const t=e(CN());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),a=typeof i=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?i(c,u,l):u&&(s=s||{},s[c]=u)}),s}return Zn}var Lr={},kd;function EN(){if(kd)return Lr;kd=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,o))};return Lr.camelCase=l,Lr}var Fr,Sd;function NN(){if(Sd)return Fr;Sd=1;var e=Fr&&Fr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(jN()),n=EN();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,Fr=r,Fr}var TN=NN();const PN=Ia(TN),Um=Wm("end"),ql=Wm("start");function Wm(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function AN(e){const t=ql(e),n=Um(e);if(t&&n)return{start:t,end:n}}function ti(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cd(e.position):"start"in e||"end"in e?Cd(e):"line"in e||"column"in e?Na(e):""}function Na(e){return jd(e&&e.line)+":"+jd(e&&e.column)}function Cd(e){return Na(e&&e.start)+"-"+Na(e&&e.end)}function jd(e){return e&&typeof e=="number"?e:1}class ct extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ti(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ct.prototype.file="";ct.prototype.name="";ct.prototype.reason="";ct.prototype.message="";ct.prototype.stack="";ct.prototype.column=void 0;ct.prototype.line=void 0;ct.prototype.ancestors=void 0;ct.prototype.cause=void 0;ct.prototype.fatal=void 0;ct.prototype.place=void 0;ct.prototype.ruleId=void 0;ct.prototype.source=void 0;const Kl={}.hasOwnProperty,_N=new Map,RN=/[A-Z]/g,MN=new Set(["table","tbody","thead","tfoot","tr"]),DN=new Set(["td","th"]),Hm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ON(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=UN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$N(n,t.jsx,t.jsxs)}const 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"?Hl:kN,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=qm(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function qm(e,t,n){if(t.type==="element")return IN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BN(e,t,n);if(t.type==="mdxjsEsm")return FN(e,t);if(t.type==="root")return zN(e,t,n);if(t.type==="text")return VN(e,t)}function IN(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=Gm(e,t.tagName,!1),o=WN(e,t);let a=Yl(e,t);return MN.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!fN(l):!0})),Km(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function LN(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hi(e,t.position)}function FN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hi(e,t.position)}function BN(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Gm(e,t.name,!0),o=HN(e,t),a=Yl(e,t);return Km(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function zN(e,t,n){const r={};return Gl(r,Yl(e,t)),e.create(t,e.Fragment,r,n)}function VN(e,t){return t.value}function Km(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $N(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function UN(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=ql(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function WN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Kl.call(t.properties,i)){const s=qN(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&DN.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function HN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else hi(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else hi(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Yl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:_N;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=qm(e,s,o);a!==void 0&&n.push(a)}return n}function qN(e,t,n){const r=bN(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?aN(n):SN(n)),r.property==="style"){let i=typeof n=="object"?n:KN(e,String(n));return e.stylePropertyNameCase==="css"&&(i=GN(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?gN[r.property]||r.property:r.attribute,n]}}function KN(e,t){try{return PN(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ct("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Hm+"#cannot-parse-style-attribute",i}}function Gm(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=gd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=gd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Kl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);hi(e)}function hi(e,t){const n=new ct("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=Hm+"#cannot-handle-mdx-estrees-without-createevaluater",n}function GN(e){const t={};let n;for(n in e)Kl.call(e,n)&&(t[YN(n)]=e[n]);return t}function YN(e){let t=e.replace(RN,XN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XN(e){return"-"+e.toLowerCase()}const To={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"]},JN={};function Xl(e,t){const n=JN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ym(e,r,i)}function Ym(e,t,n){if(QN(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 Ed(e.children,t,n)}return Array.isArray(e)?Ed(e,t,n):""}function Ed(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ym(e[i],t,n);return r.join("")}function QN(e){return!!(e&&typeof e=="object")}const Nd=document.createElement("i");function Jl(e){const t="&"+e+";";Nd.innerHTML=t;const n=Nd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function vt(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t: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);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function At(e,t){return e.length>0?(vt(e,e.length,0,t),e):t}const Td={}.hasOwnProperty;function Xm(e){const t={};let n=-1;for(;++n<e.length;)ZN(t,e[n]);return t}function ZN(e,t){let n;for(n in t){const i=(Td.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Td.call(i,o)||(i[o]=[]);const a=s[o];eT(i[o],Array.isArray(a)?a:a?[a]:[])}}}function eT(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);vt(e,0,0,r)}function Jm(e,t){const 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 Ft(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ft=Mn(/[A-Za-z]/),lt=Mn(/[\dA-Za-z]/),tT=Mn(/[#-'*+\--9=?A-Z^-~]/);function vs(e){return e!==null&&(e<32||e===127)}const Ta=Mn(/\d/),nT=Mn(/[\dA-Fa-f]/),rT=Mn(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const Ws=Mn(new RegExp("\\p{P}|\\p{S}","u")),Hn=Mn(/\s/);function Mn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _r(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&lt(e.charCodeAt(n+1))&&lt(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ue(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const iT={tokenize:sT};function sT(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ue(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Z(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const oT={tokenize:aT},Pd={tokenize:lT};function aT(e){const t=this,n=[];let r=0,i,s,o;return a;function a(C){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const E=t.events.length;let k=E,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}x(r);let A=E;for(;A<t.events.length;)t.events[A][1].end={...S},A++;return vt(t.events,k+1,0,t.events.slice(E)),t.events.length=A,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return h(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pd,u,f)(C)}function u(C){return i&&w(),x(r),h(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(C)}function h(C){return t.containerState={},e.attempt(Pd,p,g)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),h(C)}function g(C){if(C===null){i&&w(),x(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b(C)}function b(C){if(C===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return Z(C)?(e.consume(C),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),b)}function y(C,E){const k=t.sliceStream(C);if(E&&k.push(null),C.previous=s,s&&(s.next=C),s=C,i.defineSkip(C.start),i.write(k),t.parser.lazy[C.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<o&&(!i.events[S][1].end||i.events[S][1].end.offset>o))return;const A=t.events.length;let T=A,R,N;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(R){N=t.events[T][1].end;break}R=!0}for(x(r),S=A;S<t.events.length;)t.events[S][1].end={...N},S++;vt(t.events,T+1,0,t.events.slice(A)),t.events.length=S}}function x(C){let E=n.length;for(;E-- >C;){const k=n[E];t.containerState=k[1],k[0].exit.call(t,e)}n.length=C}function w(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lT(e,t,n){return ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kr(e){if(e===null||Se(e)||Hn(e))return 1;if(Ws(e))return 2}function Hs(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Pa={name:"attention",resolveAll:cT,tokenize:uT};function cT(e,t){let n=-1,r,i,s,o,a,l,c,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;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Ad(f,-l),Ad(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=At(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=At(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=At(c,Hs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=At(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=At(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,vt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uT(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=kr(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=kr(l),f=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?f:f&&(i||!h)),c._close=!!(s===42?h:h&&(u||!f)),t(l)}}function Ad(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dT={name:"autolink",tokenize:fT};function fT(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return ft(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||lt(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||lt(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||vs(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):tT(p)?(e.consume(p),c):n(p)}function u(p){return lt(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||lt(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Ei={partial:!0,tokenize:hT};function hT(e,t,n){return r;function r(s){return ae(s)?ue(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Z(s)?t(s):n(s)}}const Qm={continuation:{tokenize:mT},exit:gT,name:"blockQuote",tokenize:pT};function pT(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function mT(e,t,n){const r=this;return i;function i(o){return ae(o)?ue(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Qm,t,n)(o)}}function gT(e){e.exit("blockQuote")}const Zm={name:"characterEscape",tokenize:xT};function xT(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return rT(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const eg={name:"characterReference",tokenize:yT};function yT(e,t,n){const r=this;let i=0,s,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=lt,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=nT,u):(e.enter("characterReferenceValue"),s=7,o=Ta,u(f))}function u(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===lt&&!Jl(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<s?(e.consume(f),u):n(f)}}const _d={partial:!0,tokenize:vT},Rd={concrete:!0,name:"codeFenced",tokenize:bT};function bT(e,t,n){const r=this,i={partial:!0,tokenize:k};let s=0,o=0,a;return l;function l(S){return c(S)}function c(S){const A=r.events[r.events.length-1];return s=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===a?(o++,e.consume(S),u):o<3?n(S):(e.exit("codeFencedFenceSequence"),ae(S)?ue(e,f,"whitespace")(S):f(S))}function f(S){return S===null||Z(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(_d,b,E)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||Z(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):ae(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ue(e,p,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function p(S){return S===null||Z(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||Z(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),g)}function b(S){return e.attempt(i,E,y)(S)}function y(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),x}function x(S){return s>0&&ae(S)?ue(e,w,"linePrefix",s+1)(S):w(S)}function w(S){return S===null||Z(S)?e.check(_d,b,E)(S):(e.enter("codeFlowValue"),C(S))}function C(S){return S===null||Z(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),C)}function E(S){return e.exit("codeFenced"),t(S)}function k(S,A,T){let R=0;return N;function N(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),D}function D(I){return S.enter("codeFencedFence"),ae(I)?ue(S,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):P(I)}function P(I){return I===a?(S.enter("codeFencedFenceSequence"),_(I)):T(I)}function _(I){return I===a?(R++,S.consume(I),_):R>=o?(S.exit("codeFencedFenceSequence"),ae(I)?ue(S,L,"whitespace")(I):L(I)):T(I)}function L(I){return I===null||Z(I)?(S.exit("codeFencedFence"),A(I)):T(I)}}}function vT(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Po={name:"codeIndented",tokenize:kT},wT={partial:!0,tokenize:ST};function kT(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ue(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(wT,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function ST(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ue(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Z(o)?i(o):n(o)}}const CT={name:"codeText",previous:ET,resolve:jT,tokenize:NT};function jT(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 ET(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function NT(e,t,n){let r=0,i,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,u(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",c(f))}}class TT{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Br(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Br(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Br(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Br(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Br(this.left,n.reverse())}}}function Br(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 tg(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new TT(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"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,PT(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return vt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function PT(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,h=-1,p=n,g=0,b=0;const y=[b];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,y.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const x=a.slice(y[h],y[h+1]),w=s.pop();l.push([w,w+x.length-1]),e.splice(w,2,x)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const AT={resolve:RT,tokenize:MT},_T={partial:!0,tokenize:DT};function RT(e){return tg(e),e}function MT(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):Z(a)?e.check(_T,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function DT(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ue(e,s,"linePrefix")}function s(o){if(o===null||Z(o))return n(o);const 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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function ng(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),h):x===null||x===32||x===41||vs(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||Z(x)?n(x):(e.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function b(x){return!u&&(x===null||x===41||Se(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||vs(x)?n(x):(e.consume(x),x===92?y:b)}function y(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function rg(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Z(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ae(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function ig(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ue(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Z(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function ni(e,t){let n;return r;function r(i){return Z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ae(i)?ue(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const OT={name:"definition",tokenize:LT},IT={partial:!0,tokenize:FT};function LT(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return rg.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Se(p)?ni(e,c)(p):c(p)}function c(p){return ng(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(IT,f,f)(p)}function f(p){return ae(p)?ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Z(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function FT(e,t,n){return r;function r(a){return Se(a)?ni(e,i)(a):n(a)}function i(a){return ig(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ae(a)?ue(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const BT={name:"hardBreakEscape",tokenize:zT};function zT(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Z(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const VT={name:"headingAtx",resolve:$T,tokenize:UT};function $T(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},vt(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function UT(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Se(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):ae(u)?ue(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Se(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const WT=["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"],Md=["pre","script","style","textarea"],HT={concrete:!0,name:"htmlFlow",resolveTo:GT,tokenize:YT},qT={partial:!0,tokenize:JT},KT={partial:!0,tokenize:XT};function GT(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 YT(e,t,n){const r=this;let i,s,o,a,l;return c;function c(j){return u(j)}function u(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),f}function f(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),s=!0,b):j===63?(e.consume(j),i=3,r.interrupt?t:v):ft(j)?(e.consume(j),o=String.fromCharCode(j),y):n(j)}function h(j){return j===45?(e.consume(j),i=2,p):j===91?(e.consume(j),i=5,a=0,g):ft(j)?(e.consume(j),i=4,r.interrupt?t:v):n(j)}function p(j){return j===45?(e.consume(j),r.interrupt?t:v):n(j)}function g(j){const K="CDATA[";return j===K.charCodeAt(a++)?(e.consume(j),a===K.length?r.interrupt?t:P:g):n(j)}function b(j){return ft(j)?(e.consume(j),o=String.fromCharCode(j),y):n(j)}function y(j){if(j===null||j===47||j===62||Se(j)){const K=j===47,X=o.toLowerCase();return!K&&!s&&Md.includes(X)?(i=1,r.interrupt?t(j):P(j)):WT.includes(o.toLowerCase())?(i=6,K?(e.consume(j),x):r.interrupt?t(j):P(j)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):s?w(j):C(j))}return j===45||lt(j)?(e.consume(j),o+=String.fromCharCode(j),y):n(j)}function x(j){return j===62?(e.consume(j),r.interrupt?t:P):n(j)}function w(j){return ae(j)?(e.consume(j),w):N(j)}function C(j){return j===47?(e.consume(j),N):j===58||j===95||ft(j)?(e.consume(j),E):ae(j)?(e.consume(j),C):N(j)}function E(j){return j===45||j===46||j===58||j===95||lt(j)?(e.consume(j),E):k(j)}function k(j){return j===61?(e.consume(j),S):ae(j)?(e.consume(j),k):C(j)}function S(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),l=j,A):ae(j)?(e.consume(j),S):T(j)}function A(j){return j===l?(e.consume(j),l=null,R):j===null||Z(j)?n(j):(e.consume(j),A)}function T(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||Se(j)?k(j):(e.consume(j),T)}function R(j){return j===47||j===62||ae(j)?C(j):n(j)}function N(j){return j===62?(e.consume(j),D):n(j)}function D(j){return j===null||Z(j)?P(j):ae(j)?(e.consume(j),D):n(j)}function P(j){return j===45&&i===2?(e.consume(j),H):j===60&&i===1?(e.consume(j),M):j===62&&i===4?(e.consume(j),U):j===63&&i===3?(e.consume(j),v):j===93&&i===5?(e.consume(j),z):Z(j)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qT,ne,_)(j)):j===null||Z(j)?(e.exit("htmlFlowData"),_(j)):(e.consume(j),P)}function _(j){return e.check(KT,L,ne)(j)}function L(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),I}function I(j){return j===null||Z(j)?_(j):(e.enter("htmlFlowData"),P(j))}function H(j){return j===45?(e.consume(j),v):P(j)}function M(j){return j===47?(e.consume(j),o="",$):P(j)}function $(j){if(j===62){const K=o.toLowerCase();return Md.includes(K)?(e.consume(j),U):P(j)}return ft(j)&&o.length<8?(e.consume(j),o+=String.fromCharCode(j),$):P(j)}function z(j){return j===93?(e.consume(j),v):P(j)}function v(j){return j===62?(e.consume(j),U):j===45&&i===2?(e.consume(j),v):P(j)}function U(j){return j===null||Z(j)?(e.exit("htmlFlowData"),ne(j)):(e.consume(j),U)}function ne(j){return e.exit("htmlFlow"),t(j)}}function XT(e,t,n){const r=this;return i;function i(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function JT(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ei,t,n)}}const QT={name:"htmlText",tokenize:ZT};function ZT(e,t,n){const r=this;let i,s,o;return a;function a(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),l}function l(v){return v===33?(e.consume(v),c):v===47?(e.consume(v),k):v===63?(e.consume(v),C):ft(v)?(e.consume(v),T):n(v)}function c(v){return v===45?(e.consume(v),u):v===91?(e.consume(v),s=0,g):ft(v)?(e.consume(v),w):n(v)}function u(v){return v===45?(e.consume(v),p):n(v)}function f(v){return v===null?n(v):v===45?(e.consume(v),h):Z(v)?(o=f,M(v)):(e.consume(v),f)}function h(v){return v===45?(e.consume(v),p):f(v)}function p(v){return v===62?H(v):v===45?h(v):f(v)}function g(v){const U="CDATA[";return v===U.charCodeAt(s++)?(e.consume(v),s===U.length?b:g):n(v)}function b(v){return v===null?n(v):v===93?(e.consume(v),y):Z(v)?(o=b,M(v)):(e.consume(v),b)}function y(v){return v===93?(e.consume(v),x):b(v)}function x(v){return v===62?H(v):v===93?(e.consume(v),x):b(v)}function w(v){return v===null||v===62?H(v):Z(v)?(o=w,M(v)):(e.consume(v),w)}function C(v){return v===null?n(v):v===63?(e.consume(v),E):Z(v)?(o=C,M(v)):(e.consume(v),C)}function E(v){return v===62?H(v):C(v)}function k(v){return ft(v)?(e.consume(v),S):n(v)}function S(v){return v===45||lt(v)?(e.consume(v),S):A(v)}function A(v){return Z(v)?(o=A,M(v)):ae(v)?(e.consume(v),A):H(v)}function T(v){return v===45||lt(v)?(e.consume(v),T):v===47||v===62||Se(v)?R(v):n(v)}function R(v){return v===47?(e.consume(v),H):v===58||v===95||ft(v)?(e.consume(v),N):Z(v)?(o=R,M(v)):ae(v)?(e.consume(v),R):H(v)}function N(v){return v===45||v===46||v===58||v===95||lt(v)?(e.consume(v),N):D(v)}function D(v){return v===61?(e.consume(v),P):Z(v)?(o=D,M(v)):ae(v)?(e.consume(v),D):R(v)}function P(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),i=v,_):Z(v)?(o=P,M(v)):ae(v)?(e.consume(v),P):(e.consume(v),L)}function _(v){return v===i?(e.consume(v),i=void 0,I):v===null?n(v):Z(v)?(o=_,M(v)):(e.consume(v),_)}function L(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Se(v)?R(v):(e.consume(v),L)}function I(v){return v===47||v===62||Se(v)?R(v):n(v)}function H(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function M(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),$}function $(v){return ae(v)?ue(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):z(v)}function z(v){return e.enter("htmlTextData"),o(v)}}const Ql={name:"labelEnd",resolveAll:rP,resolveTo:iP,tokenize:sP},eP={tokenize:oP},tP={tokenize:aP},nP={tokenize:lP};function rP(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&vt(e,0,e.length,n),e}function iP(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=At(a,e.slice(s+1,s+r+3)),a=At(a,[["enter",u,t]]),a=At(a,Hs(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=At(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=At(a,e.slice(o+1)),a=At(a,[["exit",l,t]]),vt(e,s,e.length,a),e}function sP(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Ft(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(eP,u,o?u:f)(h):h===91?e.attempt(tP,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(nP,u,f)(h)}function u(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function oP(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Se(f)?ni(e,s)(f):s(f)}function s(f){return f===41?u(f):ng(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Se(f)?ni(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?ig(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Se(f)?ni(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function aP(e,t,n){const r=this;return i;function i(a){return rg.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function lP(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const cP={name:"labelStartImage",resolveAll:Ql.resolveAll,tokenize:uP};function uP(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const dP={name:"labelStartLink",resolveAll:Ql.resolveAll,tokenize:fP};function fP(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ao={name:"lineEnding",tokenize:hP};function hP(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ue(e,t,"linePrefix")}}const ts={name:"thematicBreak",tokenize:pP};function pP(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ae(c)?ue(e,a,"whitespace")(c):a(c))}}const mt={continuation:{tokenize:yP},exit:vP,name:"list",tokenize:xP},mP={partial:!0,tokenize:wP},gP={partial:!0,tokenize:bP};function xP(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ta(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ts,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ta(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ei,r.interrupt?n:u,e.attempt(mP,h,f))}function u(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ae(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function yP(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ei,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ue(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(gP,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ue(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function bP(e,t,n){const r=this;return ue(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function vP(e){e.exit(this.containerState.type)}function wP(e,t,n){const r=this;return ue(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ae(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Dd={name:"setextUnderline",resolveTo:kP,tokenize:SP};function kP(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function SP(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ae(c)?ue(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const CP={tokenize:jP};function jP(e){const t=this,n=e.attempt(Ei,r,e.attempt(this.parser.constructs.flowInitial,i,ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(AT,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const EP={resolveAll:og()},NP=sg("string"),TP=sg("text");function sg(e){return{resolveAll:og(e==="text"?PP:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function og(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function PP(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const AP={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Qm},_P={91:OT},RP={[-2]:Po,[-1]:Po,32:Po},MP={35:VT,42:ts,45:[Dd,ts],60:HT,61:Dd,95:ts,96:Rd,126:Rd},DP={38:eg,92:Zm},OP={[-5]:Ao,[-4]:Ao,[-3]:Ao,33:cP,38:eg,42:Pa,60:[dT,QT],91:dP,92:[BT,Zm],93:Ql,95:Pa,96:CT},IP={null:[Pa,EP]},LP={null:[42,95]},FP={null:[]},BP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LP,contentInitial:_P,disable:FP,document:AP,flow:MP,flowInitial:RP,insideSpan:IP,string:DP,text:OP},Symbol.toStringTag,{value:"Module"}));function zP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:A(k),check:A(S),consume:w,enter:C,exit:E,interrupt:A(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function f(D){return o=At(o,D),y(),o[o.length-1]!==null?[]:(T(t,0),c.events=Hs(s,c.events,c),c.events)}function h(D,P){return $P(p(D),P)}function p(D){return VP(o,D)}function g(){const{_bufferIndex:D,_index:P,line:_,column:L,offset:I}=r;return{_bufferIndex:D,_index:P,line:_,column:L,offset:I}}function b(D){i[D.line]=D.column,N()}function y(){let D;for(;r._index<o.length;){const P=o[r._index];if(typeof P=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<P.length;)x(P.charCodeAt(r._bufferIndex));else x(P)}}function x(D){u=u(D)}function w(D){Z(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,N()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function C(D,P){const _=P||{};return _.type=D,_.start=g(),c.events.push(["enter",_,c]),a.push(_),_}function E(D){const P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function k(D,P){T(D,P.from)}function S(D,P){P.restore()}function A(D,P){return _;function _(L,I,H){let M,$,z,v;return Array.isArray(L)?ne(L):"tokenize"in L?ne([L]):U(L);function U(W){return Le;function Le(Ce){const Re=Ce!==null&&W[Ce],ge=Ce!==null&&W.null,me=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return ne(me)(Ce)}}function ne(W){return M=W,$=0,W.length===0?H:j(W[$])}function j(W){return Le;function Le(Ce){return v=R(),z=W,W.partial||(c.currentConstruct=W),W.name&&c.parser.constructs.disable.null.includes(W.name)?X():W.tokenize.call(P?Object.assign(Object.create(c),P):c,l,K,X)(Ce)}}function K(W){return D(z,v),I}function X(W){return v.restore(),++$<M.length?j(M[$]):H}}}function T(D,P){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&vt(c.events,P,c.events.length-P,D.resolve(c.events.slice(P),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function R(){const D=g(),P=c.previous,_=c.currentConstruct,L=c.events.length,I=Array.from(a);return{from:L,restore:H};function H(){r=D,c.previous=P,c.currentConstruct=_,c.events.length=L,a=I,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function VP(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function $P(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
310
+ `),()=>{document.head.removeChild(u)}},[t]),d.jsx(J1,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const Z1=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=ul(ek),l=m.useId(),c=m.useCallback(f=>{a.set(f,!0);for(const h of a.values())if(!h)return;r&&r()},[a,r]),u=m.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c,register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random(),c]:[n,c]);return m.useMemo(()=>{a.forEach((f,h)=>a.set(h,!1))},[n]),m.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=d.jsx(Q1,{isPresent:n,children:e})),d.jsx(Ls.Provider,{value:u,children:e})};function ek(){return new Map}function ep(e=!0){const t=m.useContext(Ls);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=m.useId();m.useEffect(()=>{e&&i(s)},[e]);const o=m.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ii=e=>e.key||"";function Jc(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const fl=typeof window<"u",tp=fl?m.useLayoutEffect:m.useEffect,cs=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1})=>{const[a,l]=ep(o),c=m.useMemo(()=>Jc(e),[e]),u=o&&!a?[]:c.map(Ii),f=m.useRef(!0),h=m.useRef(c),p=ul(()=>new Map),[g,b]=m.useState(c),[y,x]=m.useState(c);tp(()=>{f.current=!1,h.current=c;for(let E=0;E<y.length;E++){const k=Ii(y[E]);u.includes(k)?p.delete(k):p.get(k)!==!0&&p.set(k,!1)}},[y,u.length,u.join("-")]);const w=[];if(c!==g){let E=[...c];for(let k=0;k<y.length;k++){const S=y[k],A=Ii(S);u.includes(A)||(E.splice(k,0,S),w.push(S))}s==="wait"&&w.length&&(E=w),x(Jc(E)),b(c);return}const{forceRender:C}=m.useContext(cl);return d.jsx(d.Fragment,{children:y.map(E=>{const k=Ii(E),S=o&&!a?!1:c===y||u.includes(k),A=()=>{if(p.has(k))p.set(k,!0);else return;let T=!0;p.forEach(R=>{R||(T=!1)}),T&&(C==null||C(),x(h.current),o&&(l==null||l()),r&&r())};return d.jsx(Z1,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:A,children:E},k)})})},gt=e=>e;let o5=gt,np=gt;function hl(e){let t;return()=>(t===void 0&&(t=e()),t)}const br=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},tn=e=>e*1e3,nn=e=>e/1e3,tk={useManualTiming:!1};function nk(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),e()),c(o)}const l={schedule:(c,u=!1,f=!1)=>{const p=f&&r?t:n;return u&&s.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(o=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Li=["read","resolveKeyframes","update","preRender","render","postRender"],rk=40;function rp(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Li.reduce((x,w)=>(x[w]=nk(s),x),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,p=()=>{const x=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,rk),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Li.reduce((x,w)=>{const C=o[w];return x[w]=(E,k=!1,S=!1)=>(n||g(),C.schedule(E,k,S)),x},{}),cancel:x=>{for(let w=0;w<Li.length;w++)o[Li[w]].cancel(x)},state:i,steps:o}}const{schedule:_e,cancel:jn,state:rt,steps:fo}=rp(typeof requestAnimationFrame<"u"?requestAnimationFrame:gt,!0),ip=m.createContext({strict:!1}),Qc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},vr={};for(const e in Qc)vr[e]={isEnabled:t=>Qc[e].some(n=>!!t[n])};function ik(e){for(const t in e)vr[t]={...vr[t],...e[t]}}const sk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function us(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||sk.has(e)}let sp=e=>!us(e);function ok(e){e&&(sp=t=>t.startsWith("on")?!us(t):e(t))}try{ok(require("@emotion/is-prop-valid").default)}catch{}function ak(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(sp(i)||n===!0&&us(i)||!t&&!us(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function lk(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Fs=m.createContext({});function li(e){return typeof e=="string"||Array.isArray(e)}function Bs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const pl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ml=["initial",...pl];function zs(e){return Bs(e.animate)||ml.some(t=>li(e[t]))}function op(e){return!!(zs(e)||e.variants)}function ck(e,t){if(zs(e)){const{initial:n,animate:r}=e;return{initial:n===!1||li(n)?n:void 0,animate:li(r)?r:void 0}}return e.inherit!==!1?t:{}}function uk(e){const{initial:t,animate:n}=ck(e,m.useContext(Fs));return m.useMemo(()=>({initial:t,animate:n}),[Zc(t),Zc(n)])}function Zc(e){return Array.isArray(e)?e.join(" "):e}const dk=Symbol.for("motionComponentSymbol");function or(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fk(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):or(n)&&(n.current=r))},[t])}const gl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),hk="framerAppearId",ap="data-"+gl(hk),{schedule:xl}=rp(queueMicrotask,!1),lp=m.createContext({});function pk(e,t,n,r,i){var s,o;const{visualElement:a}=m.useContext(Fs),l=m.useContext(ip),c=m.useContext(Ls),u=m.useContext(dl).reducedMotion,f=m.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,p=m.useContext(lp);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&mk(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,c)});const b=n[ap],y=m.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return tp(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),xl.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,b)}),y.current=!1))}),h}function mk(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:cp(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&or(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function cp(e){if(e)return e.options.allowProjection!==!1?e.projection:cp(e.parent)}function gk({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&ik(e);function a(c,u){let f;const h={...m.useContext(dl),...c,layoutId:xk(c)},{isStatic:p}=h,g=uk(c),b=r(c,p);if(!p&&fl){yk();const y=bk(h);f=y.MeasureLayout,g.visualElement=pk(i,b,h,t,y.ProjectionNode)}return d.jsxs(Fs.Provider,{value:g,children:[f&&g.visualElement?d.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,c,fk(b,g.visualElement,u),b,p,g.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=m.forwardRef(a);return l[dk]=i,l}function xk({layoutId:e}){const t=m.useContext(cl).id;return t&&e!==void 0?t+"-"+e:e}function yk(e,t){m.useContext(ip).strict}function bk(e){const{drag:t,layout:n}=vr;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const vk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function yl(e){return typeof e!="string"||e.includes("-")?!1:!!(vk.indexOf(e)>-1||/[A-Z]/u.test(e))}function eu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function bl(e,t,n,r){if(typeof t=="function"){const[i,s]=eu(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=eu(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const la=e=>Array.isArray(e),wk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),kk=e=>la(e)?e[e.length-1]||0:e,at=e=>!!(e&&e.getVelocity);function Qi(e){const t=at(e)?e.get():e;return wk(t)?t.toValue():t}function Sk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Ck(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const up=e=>(t,n)=>{const r=m.useContext(Fs),i=m.useContext(Ls),s=()=>Sk(e,t,r,i);return n?s():ul(s)};function Ck(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Qi(s[h]);let{initial:o,animate:a}=e;const l=zs(e),c=op(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Bs(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=bl(e,h[p]);if(g){const{transitionEnd:b,transition:y,...x}=g;for(const w in x){let C=x[w];if(Array.isArray(C)){const E=u?C.length-1:0;C=C[E]}C!==null&&(i[w]=C)}for(const w in b)i[w]=b[w]}}}return i}const Tr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gn=new Set(Tr),dp=e=>t=>typeof t=="string"&&t.startsWith(e),fp=dp("--"),jk=dp("var(--"),vl=e=>jk(e)?Ek.test(e.split("/*")[0].trim()):!1,Ek=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,hp=(e,t)=>t&&typeof e=="number"?t.transform(e):e,on=(e,t,n)=>n>t?t:n<e?e:n,Pr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ci={...Pr,transform:e=>on(0,1,e)},Fi={...Pr,default:1},wi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wn=wi("deg"),qt=wi("%"),ee=wi("px"),Nk=wi("vh"),Tk=wi("vw"),tu={...qt,parse:e=>qt.parse(e)/100,transform:e=>qt.transform(e*100)},Pk={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee},Ak={rotate:wn,rotateX:wn,rotateY:wn,rotateZ:wn,scale:Fi,scaleX:Fi,scaleY:Fi,scaleZ:Fi,skew:wn,skewX:wn,skewY:wn,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:ci,originX:tu,originY:tu,originZ:ee},nu={...Pr,transform:Math.round},wl={...Pk,...Ak,zIndex:nu,size:ee,fillOpacity:ci,strokeOpacity:ci,numOctaves:nu},_k={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rk=Tr.length;function Mk(e,t,n){let r="",i=!0;for(let s=0;s<Rk;s++){const o=Tr[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=hp(a,wl[o]);if(!l){i=!1;const u=_k[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function kl(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Gn.has(l)){o=!0;continue}else if(fp(l)){i[l]=c;continue}else{const u=hp(c,wl[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Mk(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Dk={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ok={offset:"strokeDashoffset",array:"strokeDasharray"};function Ik(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Dk:Ok;e[s.offset]=ee.transform(-r);const o=ee.transform(t),a=ee.transform(n);e[s.array]=`${o} ${a}`}function ru(e,t,n){return typeof e=="string"?e:ee.transform(t+n*e)}function Lk(e,t,n){const r=ru(t,e.x,e.width),i=ru(n,e.y,e.height);return`${r} ${i}`}function Sl(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(kl(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Lk(g,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ik(h,o,a,l,!1)}const Cl=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),pp=()=>({...Cl(),attrs:{}}),jl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function mp(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const gp=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xp(e,t,n,r){mp(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(gp.has(i)?i:gl(i),t.attrs[i])}const ds={};function Fk(e){Object.assign(ds,e)}function yp(e,{layout:t,layoutId:n}){return Gn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ds[e]||e==="opacity")}function El(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(at(i[o])||t.style&&at(t.style[o])||yp(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function bp(e,t,n){const r=El(e,t,n);for(const i in e)if(at(e[i])||at(t[i])){const s=Tr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function Bk(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const iu=["x","y","width","height","cx","cy","r"],zk={useVisualState:up({scrapeMotionValuesFromProps:bp,createRenderState:pp,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(Gn.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<iu.length;a++){const l=iu[a];e[l]!==t[l]&&(o=!0)}o&&_e.read(()=>{Bk(n,r),_e.render(()=>{Sl(r,i,jl(n.tagName),e.transformTemplate),xp(n,r)})})}})},Vk={useVisualState:up({scrapeMotionValuesFromProps:El,createRenderState:Cl})};function vp(e,t,n){for(const r in t)!at(t[r])&&!yp(r,n)&&(e[r]=t[r])}function $k({transformTemplate:e},t){return m.useMemo(()=>{const n=Cl();return kl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Uk(e,t){const n=e.style||{},r={};return vp(r,n,e),Object.assign(r,$k(e,t)),r}function Wk(e,t){const n={},r=Uk(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Hk(e,t,n,r){const i=m.useMemo(()=>{const s=pp();return Sl(s,t,jl(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};vp(s,e.style,e),i.style={...s,...i.style}}return i}function qk(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(yl(n)?Hk:Wk)(r,s,o,n),c=ak(r,typeof n=="string",e),u=n!==m.Fragment?{...c,...l,ref:i}:{},{children:f}=r,h=m.useMemo(()=>at(f)?f.get():f,[f]);return m.createElement(n,{...u,children:h})}}function Kk(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...yl(r)?zk:Vk,preloadedFeatures:e,useRender:qk(i),createVisualElement:t,Component:r};return gk(o)}}function wp(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Vs(e,t,n){const r=e.getProps();return bl(r,t,n!==void 0?n:r.custom,e)}const Gk=hl(()=>window.ScrollTimeline!==void 0);class Yk{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Gk()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Xk extends Yk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Nl(e,t){return e?e[t]||e.default||e:void 0}const ca=2e4;function kp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ca;)t+=n,r=e.next(t);return t>=ca?1/0:t}function Tl(e){return typeof e=="function"}function su(e,t){e.timeline=t,e.onfinish=null}const Pl=e=>Array.isArray(e)&&typeof e[0]=="number",Jk={linearEasing:void 0};function Qk(e,t){const n=hl(e);return()=>{var r;return(r=Jk[t])!==null&&r!==void 0?r:n()}}const fs=Qk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sp=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(br(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Cp(e){return!!(typeof e=="function"&&fs()||!e||typeof e=="string"&&(e in ua||fs())||Pl(e)||Array.isArray(e)&&e.every(Cp))}const Wr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ua={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function jp(e,t){if(e)return typeof e=="function"&&fs()?Sp(e,t):Pl(e)?Wr(e):Array.isArray(e)?e.map(n=>jp(n,t)||ua.easeOut):ua[e]}const It={x:!1,y:!1};function Ep(){return It.x||It.y}function Zk(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function Np(e,t){const n=Zk(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function ou(e){return t=>{t.pointerType==="touch"||Ep()||e(t)}}function eS(e,t,n={}){const[r,i,s]=Np(e,n),o=ou(a=>{const{target:l}=a,c=t(a);if(typeof c!="function"||!l)return;const u=ou(f=>{c(f),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Tp=(e,t)=>t?e===t?!0:Tp(e,t.parentElement):!1,Al=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,tS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nS(e){return tS.has(e.tagName)||e.tabIndex!==-1}const Hr=new WeakSet;function au(e){return t=>{t.key==="Enter"&&e(t)}}function ho(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const rS=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=au(()=>{if(Hr.has(n))return;ho(n,"down");const i=au(()=>{ho(n,"up")}),s=()=>ho(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function lu(e){return Al(e)&&!Ep()}function iS(e,t,n={}){const[r,i,s]=Np(e,n),o=a=>{const l=a.currentTarget;if(!lu(a)||Hr.has(l))return;Hr.add(l);const c=t(a),u=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!lu(p)||!Hr.has(l))&&(Hr.delete(l),typeof c=="function"&&c(p,{success:g}))},f=p=>{u(p,n.useGlobalTarget||Tp(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!nS(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>rS(c,i),i)}),s}function sS(e){return e==="x"||e==="y"?It[e]?null:(It[e]=!0,()=>{It[e]=!1}):It.x||It.y?null:(It.x=It.y=!0,()=>{It.x=It.y=!1})}const Pp=new Set(["width","height","top","left","right","bottom",...Tr]);let Zi;function oS(){Zi=void 0}const Kt={now:()=>(Zi===void 0&&Kt.set(rt.isProcessing||tk.useManualTiming?rt.timestamp:performance.now()),Zi),set:e=>{Zi=e,queueMicrotask(oS)}};function _l(e,t){e.indexOf(t)===-1&&e.push(t)}function Rl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ml{constructor(){this.subscriptions=[]}add(t){return _l(this.subscriptions,t),()=>Rl(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ap(e,t){return t?e*(1e3/t):0}const cu=30,aS=e=>!isNaN(parseFloat(e)),uu={current:void 0};class lS{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Kt.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Kt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=aS(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ml);const r=this.events[t].add(n);return t==="change"?()=>{r(),_e.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return uu.current&&uu.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Kt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>cu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cu);return Ap(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ui(e,t){return new lS(e,t)}function cS(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ui(n))}function uS(e,t){const n=Vs(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=kk(s[o]);cS(e,o,a)}}function dS(e){return!!(at(e)&&e.add)}function da(e,t){const n=e.getValue("willChange");if(dS(n))return n.add(t)}function _p(e){return e.props[ap]}const Rp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,fS=1e-7,hS=12;function pS(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Rp(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>fS&&++a<hS);return o}function ki(e,t,n,r){if(e===t&&n===r)return gt;const i=s=>pS(s,0,1,e,n);return s=>s===0||s===1?s:Rp(i(s),t,r)}const Mp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Dp=e=>t=>1-e(1-t),Op=ki(.33,1.53,.69,.99),Dl=Dp(Op),Ip=Mp(Dl),Lp=e=>(e*=2)<1?.5*Dl(e):.5*(2-Math.pow(2,-10*(e-1))),Ol=e=>1-Math.sin(Math.acos(e)),Fp=Dp(Ol),Bp=Mp(Ol),zp=e=>/^0[^.\s]+$/u.test(e);function mS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zp(e):!0}const Jr=e=>Math.round(e*1e5)/1e5,Il=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gS(e){return e==null}const xS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ll=(e,t)=>n=>!!(typeof n=="string"&&xS.test(n)&&n.startsWith(e)||t&&!gS(n)&&Object.prototype.hasOwnProperty.call(n,t)),Vp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Il);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},yS=e=>on(0,255,e),po={...Pr,transform:e=>Math.round(yS(e))},Vn={test:Ll("rgb","red"),parse:Vp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+po.transform(e)+", "+po.transform(t)+", "+po.transform(n)+", "+Jr(ci.transform(r))+")"};function bS(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const fa={test:Ll("#"),parse:bS,transform:Vn.transform},ar={test:Ll("hsl","hue"),parse:Vp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qt.transform(Jr(t))+", "+qt.transform(Jr(n))+", "+Jr(ci.transform(r))+")"},ot={test:e=>Vn.test(e)||fa.test(e)||ar.test(e),parse:e=>Vn.test(e)?Vn.parse(e):ar.test(e)?ar.parse(e):fa.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Vn.transform(e):ar.transform(e)},vS=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function wS(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Il))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(vS))===null||n===void 0?void 0:n.length)||0)>0}const $p="number",Up="color",kS="var",SS="var(",du="${}",CS=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function di(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(CS,l=>(ot.test(l)?(r.color.push(s),i.push(Up),n.push(ot.parse(l))):l.startsWith(SS)?(r.var.push(s),i.push(kS),n.push(l)):(r.number.push(s),i.push($p),n.push(parseFloat(l))),++s,du)).split(du);return{values:n,split:a,indexes:r,types:i}}function Wp(e){return di(e).values}function Hp(e){const{split:t,types:n}=di(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===$p?s+=Jr(i[o]):a===Up?s+=ot.transform(i[o]):s+=i[o]}return s}}const jS=e=>typeof e=="number"?0:e;function ES(e){const t=Wp(e);return Hp(e)(t.map(jS))}const En={test:wS,parse:Wp,createTransformer:Hp,getAnimatableNone:ES},NS=new Set(["brightness","contrast","saturate","opacity"]);function TS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Il)||[];if(!r)return e;const i=n.replace(r,"");let s=NS.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const PS=/\b([a-z-]*)\(.*?\)/gu,ha={...En,getAnimatableNone:e=>{const t=e.match(PS);return t?t.map(TS).join(" "):e}},AS={...wl,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:ha,WebkitFilter:ha},Fl=e=>AS[e];function qp(e,t){let n=Fl(e);return n!==ha&&(n=En),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _S=new Set(["auto","none","0"]);function RS(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!_S.has(s)&&di(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=qp(n,i)}const fu=e=>e===Pr||e===ee,hu=(e,t)=>parseFloat(e.split(", ")[t]),pu=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return hu(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?hu(s[1],e):0}},MS=new Set(["x","y","z"]),DS=Tr.filter(e=>!MS.has(e));function OS(e){const t=[];return DS.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const wr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:pu(4,13),y:pu(5,14)};wr.translateX=wr.x;wr.translateY=wr.y;const Un=new Set;let pa=!1,ma=!1;function Kp(){if(ma){const e=Array.from(Un).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=OS(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ma=!1,pa=!1,Un.forEach(e=>e.complete()),Un.clear()}function Gp(){Un.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ma=!0)})}function IS(){Gp(),Kp()}class Bl{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Un.add(this),pa||(pa=!0,_e.read(Gp),_e.resolveKeyframes(Kp))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Un.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Un.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Yp=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),LS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FS(e){const t=LS.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Xp(e,t,n=1){const[r,i]=FS(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Yp(o)?parseFloat(o):o}return vl(i)?Xp(i,t,n+1):i}const Jp=e=>t=>t.test(e),BS={test:e=>e==="auto",parse:e=>e},Qp=[Pr,ee,qt,wn,Tk,Nk,BS],mu=e=>Qp.find(Jp(e));class Zp extends Bl{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),vl(c))){const u=Xp(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Pp.has(r)||t.length!==2)return;const[i,s]=t,o=mu(i),a=mu(s);if(o!==a)if(fu(o)&&fu(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)mS(t[i])&&r.push(i);r.length&&RS(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=wr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=wr[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const gu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(En.test(e)||e==="0")&&!e.startsWith("url("));function zS(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function VS(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=gu(i,t),a=gu(s,t);return!o||!a?!1:zS(e)||(n==="spring"||Tl(n))&&r}const $S=e=>e!==null;function $s(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter($S),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const US=40;class em{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Kt.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>US?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&IS(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Kt.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!VS(t,r,i,s))if(o)this.options.duration=0;else{l&&l($s(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Me=(e,t,n)=>e+(t-e)*n;function mo(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function WS({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=mo(l,a,e+1/3),s=mo(l,a,e),o=mo(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function hs(e,t){return n=>n>0?t:e}const go=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},HS=[fa,Vn,ar],qS=e=>HS.find(t=>t.test(e));function xu(e){const t=qS(e);if(!t)return!1;let n=t.parse(e);return t===ar&&(n=WS(n)),n}const yu=(e,t)=>{const n=xu(e),r=xu(t);if(!n||!r)return hs(e,t);const i={...n};return s=>(i.red=go(n.red,r.red,s),i.green=go(n.green,r.green,s),i.blue=go(n.blue,r.blue,s),i.alpha=Me(n.alpha,r.alpha,s),Vn.transform(i))},KS=(e,t)=>n=>t(e(n)),Si=(...e)=>e.reduce(KS),ga=new Set(["none","hidden"]);function GS(e,t){return ga.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function YS(e,t){return n=>Me(e,t,n)}function zl(e){return typeof e=="number"?YS:typeof e=="string"?vl(e)?hs:ot.test(e)?yu:QS:Array.isArray(e)?tm:typeof e=="object"?ot.test(e)?yu:XS:hs}function tm(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>zl(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function XS(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=zl(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function JS(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],a=e.indexes[o][i[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const QS=(e,t)=>{const n=En.createTransformer(t),r=di(e),i=di(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ga.has(e)&&!i.values.length||ga.has(t)&&!r.values.length?GS(e,t):Si(tm(JS(r,i),i.values),n):hs(e,t)};function nm(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Me(e,t,n):zl(e)(e,t)}const ZS=5;function rm(e,t,n){const r=Math.max(t-ZS,0);return Ap(n-e(r),t-r)}const Oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},xo=.001;function eC({duration:e=Oe.duration,bounce:t=Oe.bounce,velocity:n=Oe.velocity,mass:r=Oe.mass}){let i,s,o=1-t;o=on(Oe.minDamping,Oe.maxDamping,o),e=on(Oe.minDuration,Oe.maxDuration,nn(e)),o<1?(i=c=>{const u=c*o,f=u*e,h=u-n,p=xa(c,o),g=Math.exp(-f);return xo-h/p*g},s=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-f),b=xa(Math.pow(c,2),o);return(-i(c)+xo>0?-1:1)*((h-p)*g)/b}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-xo+u*f},s=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=nC(i,s,a);if(e=tn(e),isNaN(l))return{stiffness:Oe.stiffness,damping:Oe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const tC=12;function nC(e,t,n){let r=n;for(let i=1;i<tC;i++)r=r-e(r)/t(r);return r}function xa(e,t){return e*Math.sqrt(1-t*t)}const rC=["duration","bounce"],iC=["stiffness","damping","mass"];function bu(e,t){return t.some(n=>e[n]!==void 0)}function sC(e){let t={velocity:Oe.velocity,stiffness:Oe.stiffness,damping:Oe.damping,mass:Oe.mass,isResolvedFromDuration:!1,...e};if(!bu(e,iC)&&bu(e,rC))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*on(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Oe.mass,stiffness:i,damping:s}}else{const n=eC(e);t={...t,...n,mass:Oe.mass},t.isResolvedFromDuration=!0}return t}function im(e=Oe.visualDuration,t=Oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=sC({...n,velocity:-nn(n.velocity||0)}),g=h||0,b=c/(2*Math.sqrt(l*u)),y=o-s,x=nn(Math.sqrt(l/u)),w=Math.abs(y)<5;r||(r=w?Oe.restSpeed.granular:Oe.restSpeed.default),i||(i=w?Oe.restDelta.granular:Oe.restDelta.default);let C;if(b<1){const k=xa(x,b);C=S=>{const A=Math.exp(-b*x*S);return o-A*((g+b*x*y)/k*Math.sin(k*S)+y*Math.cos(k*S))}}else if(b===1)C=k=>o-Math.exp(-x*k)*(y+(g+x*y)*k);else{const k=x*Math.sqrt(b*b-1);C=S=>{const A=Math.exp(-b*x*S),T=Math.min(k*S,300);return o-A*((g+b*x*y)*Math.sinh(T)+k*y*Math.cosh(T))/k}}const E={calculatedDuration:p&&f||null,next:k=>{const S=C(k);if(p)a.done=k>=f;else{let A=0;b<1&&(A=k===0?tn(g):rm(C,k,S));const T=Math.abs(A)<=r,R=Math.abs(o-S)<=i;a.done=T&&R}return a.value=a.done?o:S,a},toString:()=>{const k=Math.min(kp(E),ca),S=Sp(A=>E.next(k*A).value,k,30);return k+"ms "+S}};return E}function vu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=T=>a!==void 0&&T<a||l!==void 0&&T>l,g=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let b=n*t;const y=f+b,x=o===void 0?y:o(y);x!==y&&(b=x-f);const w=T=>-b*Math.exp(-T/r),C=T=>x+w(T),E=T=>{const R=w(T),N=C(T);h.done=Math.abs(R)<=c,h.value=h.done?x:N};let k,S;const A=T=>{p(h.value)&&(k=T,S=im({keyframes:[h.value,g(h.value)],velocity:rm(C,T,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return A(0),{calculatedDuration:null,next:T=>{let R=!1;return!S&&k===void 0&&(R=!0,E(T),A(T)),k!==void 0&&T>=k?S.next(T-k):(!R&&E(T),h)}}}const oC=ki(.42,0,1,1),aC=ki(0,0,.58,1),sm=ki(.42,0,.58,1),lC=e=>Array.isArray(e)&&typeof e[0]!="number",cC={linear:gt,easeIn:oC,easeInOut:sm,easeOut:aC,circIn:Ol,circInOut:Bp,circOut:Fp,backIn:Dl,backInOut:Ip,backOut:Op,anticipate:Lp},wu=e=>{if(Pl(e)){np(e.length===4);const[t,n,r,i]=e;return ki(t,n,r,i)}else if(typeof e=="string")return cC[e];return e};function uC(e,t,n){const r=[],i=n||nm,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||gt:t;a=Si(l,a)}r.push(a)}return r}function dC(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(np(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=uC(t,r,i),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=br(e[f],e[f+1],u);return a[f](h)};return n?u=>c(on(e[0],e[s-1],u)):c}function fC(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=br(0,t,r);e.push(Me(n,1,i))}}function hC(e){const t=[0];return fC(t,e.length-1),t}function pC(e,t){return e.map(n=>n*t)}function mC(e,t){return e.map(()=>t||sm).splice(0,e.length-1)}function ps({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=lC(r)?r.map(wu):wu(r),s={done:!1,value:t[0]},o=pC(n&&n.length===t.length?n:hC(t),e),a=dC(o,t,{ease:Array.isArray(i)?i:mC(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const gC=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_e.update(t,!0),stop:()=>jn(t),now:()=>rt.isProcessing?rt.timestamp:Kt.now()}},xC={decay:vu,inertia:vu,tween:ps,keyframes:ps,spring:im},yC=e=>e/100;class Us extends em{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Bl,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Tl(n)?n:xC[n]||ps;let l,c;a!==ps&&typeof t[0]!="number"&&(l=Si(yC,nm(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=kp(u));const{calculatedDuration:f}=u,h=f+i,p=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:T}=this.options;return{done:!0,value:T[T.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:b,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?x<0:x>u;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,E=s;if(p){const T=Math.min(this.currentTime,u)/f;let R=Math.floor(T),N=T%1;!N&&T>=1&&(N=1),N===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(g==="reverse"?(N=1-N,b&&(N-=b/f)):g==="mirror"&&(E=o)),C=on(0,1,N)*f}const k=w?{done:!1,value:l[0]}:E.next(C);a&&(k.value=a(k.value));let{done:S}=k;!w&&c!==null&&(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return A&&i!==void 0&&(k.value=$s(l,this.options,i)),y&&y(k.value),A&&this.finish(),k}get duration(){const{resolved:t}=this;return t?nn(t.calculatedDuration):0}get time(){return nn(this.currentTime)}set time(t){t=tn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=gC,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}function a5(e){return new Us(e)}const bC=new Set(["opacity","clipPath","filter","transform"]);function vC(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=jp(a,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const wC=hl(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ms=10,kC=2e4;function SC(e){return Tl(e.type)||e.type==="spring"||!Cp(e.ease)}function CC(e,t){const n=new Us({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<kC;)r=n.sample(s),i.push(r.value),s+=ms;return{times:void 0,keyframes:i,duration:s-ms,ease:"linear"}}const om={anticipate:Lp,backInOut:Ip,circInOut:Bp};function jC(e){return e in om}class ku extends em{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Zp(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&fs()&&jC(s)&&(s=om[s]),SC(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...b}=this.options,y=CC(t,b);t=y.keyframes,t.length===1&&(t[1]=t[0]),r=y.duration,i=y.times,s=y.ease,o="keyframes"}const u=vC(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(su(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set($s(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return nn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return nn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=tn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return gt;const{animation:r}=n;su(r,t)}return gt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...p}=this.options,g=new Us({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=tn(this.time);c.setWithVelocity(g.sample(b-ms).value,g.sample(b).value,ms)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return wC()&&r&&bC.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const EC={type:"spring",stiffness:500,damping:25,restSpeed:10},NC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),TC={type:"keyframes",duration:.8},PC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},AC=(e,{keyframes:t})=>t.length>2?TC:Gn.has(e)?e.startsWith("scale")?NC(t[1]):EC:PC;function _C({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Vl=(e,t,n,r={},i,s)=>o=>{const a=Nl(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-tn(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};_C(a)||(u={...u,...AC(e,u)}),u.duration&&(u.duration=tn(u.duration)),u.repeatDelay&&(u.repeatDelay=tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=$s(u.keyframes,a);if(h!==void 0)return _e.update(()=>{u.onUpdate(h),u.onComplete()}),new Xk([])}return!s&&ku.supports(u)?new ku(u):new Us(u)};function RC({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function am(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=l[f];if(p===void 0||u&&RC(u,f))continue;const g={delay:n,...Nl(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const x=_p(e);if(x){const w=window.MotionHandoffAnimation(x,f,_e);w!==null&&(g.startTime=w,b=!0)}}da(e,f),h.start(Vl(f,h,p,e.shouldReduceMotion&&Pp.has(f)?{type:!1}:g,e,b));const y=h.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{_e.update(()=>{a&&uS(e,a)})}),c}function ya(e,t,n={}){var r;const i=Vs(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(am(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return MC(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function MC(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(DC).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ya(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function DC(e,t){return e.sortNodePosition(t)}function OC(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>ya(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=ya(e,t,n);else{const i=typeof t=="function"?Vs(e,t,n.custom):t;r=Promise.all(am(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const IC=ml.length;function lm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?lm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<IC;n++){const r=ml[n],i=e.props[r];(li(i)||i===!1)&&(t[r]=i)}return t}const LC=[...pl].reverse(),FC=pl.length;function BC(e){return t=>Promise.all(t.map(({animation:n,options:r})=>OC(e,n,r)))}function zC(e){let t=BC(e),n=Su(),r=!0;const i=l=>(c,u)=>{var f;const h=Vs(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...b}=h;c={...c,...b,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=lm(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let y=0;y<FC;y++){const x=LC[y],w=n[x],C=c[x]!==void 0?c[x]:u[x],E=li(C),k=x===l?w.isActive:null;k===!1&&(g=y);let S=C===u[x]&&C!==c[x]&&E;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),w.protectedKeys={...p},!w.isActive&&k===null||!C&&!w.prevProp||Bs(C)||typeof C=="boolean")continue;const A=VC(w.prevProp,C);let T=A||x===l&&w.isActive&&!S&&E||y>g&&E,R=!1;const N=Array.isArray(C)?C:[C];let D=N.reduce(i(x),{});k===!1&&(D={});const{prevResolvedValues:P={}}=w,_={...P,...D},L=M=>{T=!0,h.has(M)&&(R=!0,h.delete(M)),w.needsAnimating[M]=!0;const $=e.getValue(M);$&&($.liveStyle=!1)};for(const M in _){const $=D[M],z=P[M];if(p.hasOwnProperty(M))continue;let v=!1;la($)&&la(z)?v=!wp($,z):v=$!==z,v?$!=null?L(M):h.add(M):$!==void 0&&h.has(M)?L(M):w.protectedKeys[M]=!0}w.prevProp=C,w.prevResolvedValues=D,w.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(S&&A)||R)&&f.push(...N.map(M=>({animation:M,options:{type:x}})))}if(h.size){const y={};h.forEach(x=>{const w=e.getBaseTarget(x),C=e.getValue(x);C&&(C.liveStyle=!0),y[x]=w??null}),f.push({animation:y})}let b=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Su(),r=!0}}}function VC(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!wp(t,e):!1}function On(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Su(){return{animate:On(!0),whileInView:On(),whileHover:On(),whileTap:On(),whileDrag:On(),whileFocus:On(),exit:On()}}class Rn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class $C extends Rn{constructor(t){super(t),t.animationState||(t.animationState=zC(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let UC=0;class WC extends Rn{constructor(){super(...arguments),this.id=UC++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const HC={animation:{Feature:$C},exit:{Feature:WC}};function fi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ci(e){return{point:{x:e.pageX,y:e.pageY}}}const qC=e=>t=>Al(t)&&e(t,Ci(t));function Qr(e,t,n,r){return fi(e,t,qC(n),r)}const Cu=(e,t)=>Math.abs(e-t);function KC(e,t){const n=Cu(e.x,t.x),r=Cu(e.y,t.y);return Math.sqrt(n**2+r**2)}class cm{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=bo(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=KC(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:b}=rt;this.history.push({...g,timestamp:b});const{onStart:y,onMove:x}=this.handlers;h||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yo(h,this.transformPagePoint),_e.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=bo(f.type==="pointercancel"?this.lastMoveEventInfo:yo(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,y),g&&g(f,y)},!Al(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ci(t),a=yo(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=rt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,bo(a,this.history)),this.removeListeners=Si(Qr(this.contextWindow,"pointermove",this.handlePointerMove),Qr(this.contextWindow,"pointerup",this.handlePointerUp),Qr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jn(this.updatePoint)}}function yo(e,t){return t?{point:t(e.point)}:e}function ju(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bo({point:e},t){return{point:e,delta:ju(e,um(t)),offset:ju(e,GC(t)),velocity:YC(t,.1)}}function GC(e){return e[0]}function um(e){return e[e.length-1]}function YC(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=um(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>tn(t)));)n--;if(!r)return{x:0,y:0};const s=nn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const dm=1e-4,XC=1-dm,JC=1+dm,fm=.01,QC=0-fm,ZC=0+fm;function kt(e){return e.max-e.min}function ej(e,t,n){return Math.abs(e-t)<=n}function Eu(e,t,n,r=.5){e.origin=r,e.originPoint=Me(t.min,t.max,e.origin),e.scale=kt(n)/kt(t),e.translate=Me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=XC&&e.scale<=JC||isNaN(e.scale))&&(e.scale=1),(e.translate>=QC&&e.translate<=ZC||isNaN(e.translate))&&(e.translate=0)}function Zr(e,t,n,r){Eu(e.x,t.x,n.x,r?r.originX:void 0),Eu(e.y,t.y,n.y,r?r.originY:void 0)}function Nu(e,t,n){e.min=n.min+t.min,e.max=e.min+kt(t)}function tj(e,t,n){Nu(e.x,t.x,n.x),Nu(e.y,t.y,n.y)}function Tu(e,t,n){e.min=t.min-n.min,e.max=e.min+kt(t)}function ei(e,t,n){Tu(e.x,t.x,n.x),Tu(e.y,t.y,n.y)}function nj(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Me(n,e,r.max):Math.min(e,n)),e}function Pu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function rj(e,{top:t,left:n,bottom:r,right:i}){return{x:Pu(e.x,n,i),y:Pu(e.y,t,r)}}function Au(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ij(e,t){return{x:Au(e.x,t.x),y:Au(e.y,t.y)}}function sj(e,t){let n=.5;const r=kt(e),i=kt(t);return i>r?n=br(t.min,t.max-r,e.min):r>i&&(n=br(e.min,e.max-i,t.min)),on(0,1,n)}function oj(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ba=.35;function aj(e=ba){return e===!1?e=0:e===!0&&(e=ba),{x:_u(e,"left","right"),y:_u(e,"top","bottom")}}function _u(e,t,n){return{min:Ru(e,t),max:Ru(e,n)}}function Ru(e,t){return typeof e=="number"?e:e[t]||0}const Mu=()=>({translate:0,scale:1,origin:0,originPoint:0}),lr=()=>({x:Mu(),y:Mu()}),Du=()=>({min:0,max:0}),ze=()=>({x:Du(),y:Du()});function Nt(e){return[e("x"),e("y")]}function hm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function lj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function vo(e){return e===void 0||e===1}function va({scale:e,scaleX:t,scaleY:n}){return!vo(e)||!vo(t)||!vo(n)}function Fn(e){return va(e)||pm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function pm(e){return Ou(e.x)||Ou(e.y)}function Ou(e){return e&&e!=="0%"}function gs(e,t,n){const r=e-n,i=t*r;return n+i}function Iu(e,t,n,r,i){return i!==void 0&&(e=gs(e,i,r)),gs(e,n,r)+t}function wa(e,t=0,n=1,r,i){e.min=Iu(e.min,t,n,r,i),e.max=Iu(e.max,t,n,r,i)}function mm(e,{x:t,y:n}){wa(e.x,t.translate,t.scale,t.originPoint),wa(e.y,n.translate,n.scale,n.originPoint)}const Lu=.999999999999,Fu=1.0000000000001;function uj(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ur(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,mm(e,o)),r&&Fn(s.latestValues)&&ur(e,s.latestValues))}t.x<Fu&&t.x>Lu&&(t.x=1),t.y<Fu&&t.y>Lu&&(t.y=1)}function cr(e,t){e.min=e.min+t,e.max=e.max+t}function Bu(e,t,n,r,i=.5){const s=Me(e.min,e.max,i);wa(e,t,n,s,r)}function ur(e,t){Bu(e.x,t.x,t.scaleX,t.scale,t.originX),Bu(e.y,t.y,t.scaleY,t.scale,t.originY)}function gm(e,t){return hm(cj(e.getBoundingClientRect(),t))}function dj(e,t,n){const r=gm(e,n),{scroll:i}=t;return i&&(cr(r.x,i.offset.x),cr(r.y,i.offset.y)),r}const xm=({current:e})=>e?e.ownerDocument.defaultView:null,fj=new WeakMap;class hj{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ze(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ci(u).point)},s=(u,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sS(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nt(y=>{let x=this.getAxisMotionValue(y).get()||0;if(qt.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[y];C&&(x=kt(C)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&_e.postRender(()=>g(u,f)),da(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=pj(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),b&&b(u,f)},a=(u,f)=>this.stop(u,f),l=()=>Nt(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new cm(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:xm(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&_e.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Bi(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=nj(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&or(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=rj(i.layoutBox,n):this.constraints=!1,this.elastic=aj(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=oj(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!or(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=dj(r,i.root,this.visualElement.getTransformPagePoint());let o=ij(i.layout.layoutBox,s);if(n){const a=n(lj(o));this.hasMutatedConstraints=!!a,a&&(o=hm(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Nt(u=>{if(!Bi(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return da(this.visualElement,t),r.start(Vl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Nt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Nt(n=>{const{drag:r}=this.getProps();if(!Bi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Me(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!or(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=sj({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Nt(o=>{if(!Bi(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Me(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;fj.set(this.visualElement,this);const t=this.visualElement.current,n=Qr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();or(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_e.read(r);const o=fi(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Nt(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ba,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Bi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mj extends Rn{constructor(t){super(t),this.removeGroupControls=gt,this.removeListeners=gt,this.controls=new hj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const zu=e=>(t,n)=>{e&&_e.postRender(()=>e(t,n))};class gj extends Rn{constructor(){super(...arguments),this.removePointerDownListener=gt}onPointerDown(t){this.session=new cm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:zu(t),onStart:zu(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&_e.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Qr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const es={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Vu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ir={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ee.test(e))e=parseFloat(e);else return e;const n=Vu(e,t.target.x),r=Vu(e,t.target.y);return`${n}% ${r}%`}},xj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=En.parse(e);if(i.length>5)return r;const s=En.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Me(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class yj extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Fk(bj),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),es.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||_e.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),xl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ym(e){const[t,n]=ep(),r=m.useContext(cl);return d.jsx(yj,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(lp),isPresent:t,safeToRemove:n})}const bj={borderRadius:{...Ir,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ir,borderTopRightRadius:Ir,borderBottomLeftRadius:Ir,borderBottomRightRadius:Ir,boxShadow:xj};function vj(e,t,n){const r=at(e)?e:ui(e);return r.start(Vl("",r,t,n)),r.animation}function wj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const kj=(e,t)=>e.depth-t.depth;class Sj{constructor(){this.children=[],this.isDirty=!1}add(t){_l(this.children,t),this.isDirty=!0}remove(t){Rl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kj),this.isDirty=!1,this.children.forEach(t)}}function Cj(e,t){const n=Kt.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(jn(r),e(s-t))};return _e.read(r,!0),()=>jn(r)}const bm=["TopLeft","TopRight","BottomLeft","BottomRight"],jj=bm.length,$u=e=>typeof e=="string"?parseFloat(e):e,Uu=e=>typeof e=="number"||ee.test(e);function Ej(e,t,n,r,i,s){i?(e.opacity=Me(0,n.opacity!==void 0?n.opacity:1,Nj(r)),e.opacityExit=Me(t.opacity!==void 0?t.opacity:1,0,Tj(r))):s&&(e.opacity=Me(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<jj;o++){const a=`border${bm[o]}Radius`;let l=Wu(t,a),c=Wu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Uu(l)===Uu(c)?(e[a]=Math.max(Me($u(l),$u(c),r),0),(qt.test(c)||qt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Me(t.rotate||0,n.rotate||0,r))}function Wu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nj=vm(0,.5,Fp),Tj=vm(.5,.95,gt);function vm(e,t,n){return r=>r<e?0:r>t?1:n(br(e,t,r))}function Hu(e,t){e.min=t.min,e.max=t.max}function Et(e,t){Hu(e.x,t.x),Hu(e.y,t.y)}function qu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ku(e,t,n,r,i){return e-=t,e=gs(e,1/n,r),i!==void 0&&(e=gs(e,1/i,r)),e}function Pj(e,t=0,n=1,r=.5,i,s=e,o=e){if(qt.test(t)&&(t=parseFloat(t),t=Me(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Me(s.min,s.max,r);e===s&&(a-=t),e.min=Ku(e.min,t,n,a,i),e.max=Ku(e.max,t,n,a,i)}function Gu(e,t,[n,r,i],s,o){Pj(e,t[n],t[r],t[i],t.scale,s,o)}const Aj=["x","scaleX","originX"],_j=["y","scaleY","originY"];function Yu(e,t,n,r){Gu(e.x,t,Aj,n?n.x:void 0,r?r.x:void 0),Gu(e.y,t,_j,n?n.y:void 0,r?r.y:void 0)}function Xu(e){return e.translate===0&&e.scale===1}function wm(e){return Xu(e.x)&&Xu(e.y)}function Ju(e,t){return e.min===t.min&&e.max===t.max}function Rj(e,t){return Ju(e.x,t.x)&&Ju(e.y,t.y)}function Qu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function km(e,t){return Qu(e.x,t.x)&&Qu(e.y,t.y)}function Zu(e){return kt(e.x)/kt(e.y)}function ed(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Mj{constructor(){this.members=[]}add(t){_l(this.members,t),t.scheduleRender()}remove(t){if(Rl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Dj(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Bn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qr=typeof window<"u"&&window.MotionDebug!==void 0,wo=["","X","Y","Z"],Oj={visibility:"hidden"},td=1e3;let Ij=0;function ko(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_p(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_e,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sm(r)}function Cm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Ij++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qr&&(Bn.totalNodes=Bn.resolvedTargetDeltas=Bn.recalculatedProjection=0),this.nodes.forEach(Bj),this.nodes.forEach(Wj),this.nodes.forEach(Hj),this.nodes.forEach(zj),qr&&window.MotionDebug.record(Bn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sj)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ml),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wj(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Cj(h,250),es.hasAnimatedSinceResize&&(es.hasAnimatedSinceResize=!1,this.nodes.forEach(rd))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||Xj,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),w=!this.targetLayout||!km(this.targetLayout,g)||p,C=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const E={...Nl(b,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else h||rd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,jn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qj),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sm(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nd);return}this.isUpdating||this.nodes.forEach($j),this.isUpdating=!1,this.nodes.forEach(Uj),this.nodes.forEach(Lj),this.nodes.forEach(Fj),this.clearAllSnapshots();const a=Kt.now();rt.delta=on(0,1e3/60,a-rt.timestamp),rt.timestamp=a,rt.isProcessing=!0,fo.update.process(rt),fo.preRender.process(rt),fo.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Vj),this.sharedNodes.forEach(Kj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_e.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_e.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ze(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!wm(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Fn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Jj(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ze();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Qj))){const{scroll:u}=this.root;u&&(cr(l.x,u.offset.x),cr(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=ze();if(Et(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Et(l,o),cr(l.x,f.offset.x),cr(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ze();Et(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ur(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Fn(u.latestValues)&&ur(l,u.latestValues)}return Fn(this.latestValues)&&ur(l,this.latestValues),l}removeTransform(o){const a=ze();Et(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Fn(c.latestValues))continue;va(c.latestValues)&&c.updateSnapshot();const u=ze(),f=c.measurePageBox();Et(u,f),Yu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Fn(this.latestValues)&&Yu(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=rt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ze(),this.relativeTargetOrigin=ze(),ei(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ze(),this.targetWithTransforms=ze()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Et(this.target,this.layout.layoutBox),mm(this.target,this.targetDelta)):Et(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ze(),this.relativeTargetOrigin=ze(),ei(this.relativeTargetOrigin,this.target,p.target),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}qr&&Bn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||va(this.parent.latestValues)||pm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Et(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;uj(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ze());const{target:g}=a;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qu(this.prevProjectionDelta.x,this.projectionDelta.x),qu(this.prevProjectionDelta.y,this.projectionDelta.y)),Zr(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!ed(this.projectionDelta.x,this.prevProjectionDelta.x)||!ed(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),qr&&Bn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=lr(),this.projectionDelta=lr(),this.projectionDeltaWithTransform=lr()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=lr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ze(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,b=p!==g,y=this.getStack(),x=!y||y.members.length<=1,w=!!(b&&!x&&this.options.crossfade===!0&&!this.path.some(Yj));this.animationProgress=0;let C;this.mixTargetDelta=E=>{const k=E/1e3;id(f.x,o.x,k),id(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ei(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Gj(this.relativeTarget,this.relativeTargetOrigin,h,k),C&&Rj(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ze()),Et(C,this.relativeTarget)),b&&(this.animationValues=u,Ej(u,c,this.latestValues,k,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_e.update(()=>{es.hasAnimatedSinceResize=!0,this.currentAnimation=vj(0,td,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(td),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&jm(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ze();const f=kt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=kt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Et(a,l),ur(a,u),Zr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Mj),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ko("z",o,c,this.animationValues);for(let u=0;u<wo.length;u++)ko(`rotate${wo[u]}`,o,c,this.animationValues),ko(`skew${wo[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Oj;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Qi(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=Qi(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Fn(this.latestValues)&&(b.transform=u?u({},""):"none",this.hasProjected=!1),b}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Dj(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:p,y:g}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in ds){if(h[b]===void 0)continue;const{correct:y,applyTo:x}=ds[b],w=c.transform==="none"?h[b]:y(h[b],f);if(x){const C=x.length;for(let E=0;E<C;E++)c[x[E]]=w}else c[b]=w}return this.options.layoutId&&(c.pointerEvents=f===this?Qi(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(nd),this.root.sharedNodes.clear()}}}function Lj(e){e.updateLayout()}function Fj(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Nt(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=kt(h);h.min=r[f].min,h.max=h.min+p}):jm(s,n.layoutBox,r)&&Nt(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=kt(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=lr();Zr(a,r,n.layoutBox);const l=lr();o?Zr(l,e.applyTransform(i,!0),n.measuredBox):Zr(l,r,n.layoutBox);const c=!wm(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=ze();ei(g,n.layoutBox,h.layoutBox);const b=ze();ei(b,r,p.layoutBox),km(g,b)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Bj(e){qr&&Bn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function zj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Vj(e){e.clearSnapshot()}function nd(e){e.clearMeasurements()}function $j(e){e.isLayoutDirty=!1}function Uj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wj(e){e.resolveTargetDelta()}function Hj(e){e.calcProjection()}function qj(e){e.resetSkewAndRotation()}function Kj(e){e.removeLeadSnapshot()}function id(e,t,n){e.translate=Me(t.translate,0,n),e.scale=Me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function sd(e,t,n,r){e.min=Me(t.min,n.min,r),e.max=Me(t.max,n.max,r)}function Gj(e,t,n,r){sd(e.x,t.x,n.x,r),sd(e.y,t.y,n.y,r)}function Yj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xj={duration:.45,ease:[.4,0,.1,1]},od=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ad=od("applewebkit/")&&!od("chrome/")?Math.round:gt;function ld(e){e.min=ad(e.min),e.max=ad(e.max)}function Jj(e){ld(e.x),ld(e.y)}function jm(e,t,n){return e==="position"||e==="preserve-aspect"&&!ej(Zu(t),Zu(n),.2)}function Qj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Zj=Cm({attachResizeListener:(e,t)=>fi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),So={current:void 0},Em=Cm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!So.current){const e=new Zj({});e.mount(window),e.setOptions({layoutScroll:!0}),So.current=e}return So.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),eE={pan:{Feature:gj},drag:{Feature:mj,ProjectionNode:Em,MeasureLayout:ym}};function cd(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&_e.postRender(()=>s(t,Ci(t)))}class tE extends Rn{mount(){const{current:t}=this.node;t&&(this.unmount=eS(t,n=>(cd(this.node,n,"Start"),r=>cd(this.node,r,"End"))))}unmount(){}}class nE extends Rn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Si(fi(this.node.current,"focus",()=>this.onFocus()),fi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ud(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&_e.postRender(()=>s(t,Ci(t)))}class rE extends Rn{mount(){const{current:t}=this.node;t&&(this.unmount=iS(t,n=>(ud(this.node,n,"Start"),(r,{success:i})=>ud(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ka=new WeakMap,Co=new WeakMap,iE=e=>{const t=ka.get(e.target);t&&t(e)},sE=e=>{e.forEach(iE)};function oE({root:e,...t}){const n=e||document;Co.has(n)||Co.set(n,{});const r=Co.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(sE,{root:e,...t})),r[i]}function aE(e,t,n){const r=oE(t);return ka.set(e,n),r.observe(e),()=>{ka.delete(e),r.unobserve(e)}}const lE={some:0,all:1};class cE extends Rn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:lE[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(l)};return aE(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(uE(t,n))&&this.startObserver()}unmount(){}}function uE({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dE={inView:{Feature:cE},tap:{Feature:rE},focus:{Feature:nE},hover:{Feature:tE}},fE={layout:{ProjectionNode:Em,MeasureLayout:ym}},Sa={current:null},Nm={current:!1};function hE(){if(Nm.current=!0,!!fl)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Sa.current=e.matches;e.addListener(t),t()}else Sa.current=!1}const pE=[...Qp,ot,En],mE=e=>pE.find(Jp(e)),dd=new WeakMap;function gE(e,t,n){for(const r in t){const i=t[r],s=n[r];if(at(i))e.addValue(r,i);else if(at(s))e.addValue(r,ui(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,ui(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const fd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class xE{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Kt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,_e.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=zs(n),this.isVariantNode=op(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];l[p]!==void 0&&at(g)&&g.set(l[p],!1)}}mount(t){this.current=t,dd.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Nm.current||hE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sa.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){dd.delete(this.current),this.projection&&this.projection.unmount(),jn(this.notifyUpdate),jn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Gn.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&_e.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in vr){const n=vr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ze()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<fd.length;r++){const i=fd[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=gE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ui(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Yp(i)||zp(i))?i=parseFloat(i):!mE(i)&&En.test(n)&&(i=qp(t,n)),this.setBaseTarget(t,at(i)?i.get():i)),at(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=bl(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!at(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ml),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Tm extends xE{constructor(){super(...arguments),this.KeyframeResolver=Zp}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;at(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function yE(e){return window.getComputedStyle(e)}class bE extends Tm{constructor(){super(...arguments),this.type="html",this.renderInstance=mp}readValueFromInstance(t,n){if(Gn.has(n)){const r=Fl(n);return r&&r.default||0}else{const r=yE(t),i=(fp(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return gm(t,n)}build(t,n,r){kl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return El(t,n,r)}}class vE extends Tm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ze}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gn.has(n)){const r=Fl(n);return r&&r.default||0}return n=gp.has(n)?n:gl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return bp(t,n,r)}build(t,n,r){Sl(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){xp(t,n,r,i)}mount(t){this.isSVGTag=jl(t.tagName),super.mount(t)}}const wE=(e,t)=>yl(e)?new vE(t):new bE(t,{allowProjection:e!==m.Fragment}),kE=Kk({...HC,...dE,...eE,...fE},wE),xs=lk(kE),$l=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("card-glass rounded border bg-card text-card-foreground shadow-none",e),...t}));$l.displayName="Card";const SE=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("flex flex-col space-y-0.5 px-3 py-2",e),...t}));SE.displayName="CardHeader";const CE=m.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:F("text-sm font-light uppercase tracking-wider text-muted-foreground",e),...t}));CE.displayName="CardTitle";const jE=m.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:F("text-xs text-muted-foreground",e),...t}));jE.displayName="CardDescription";const Ul=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("p-3 pt-0",e),...t}));Ul.displayName="CardContent";const EE=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("flex items-center p-3 pt-0",e),...t}));EE.displayName="CardFooter";const NE={critical:"border-ask-red text-ask-red",high:"border-warning-amber text-warning-amber",medium:"border-accent-blue text-accent-blue",low:"border-muted-foreground/30 text-muted-foreground"},TE={feature:"border-category-feature text-category-feature",bugfix:"border-category-bugfix text-category-bugfix",refactor:"border-category-refactor text-category-refactor",infrastructure:"border-category-infrastructure text-category-infrastructure",docs:"border-category-docs text-category-docs"},jo="inline-block rounded border px-1.5 py-0 text-[10px] uppercase bg-transparent";function PE({scopeId:e,projectId:t,info:n,onRecover:r,onDismiss:i}){return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,onClick:s=>s.stopPropagation(),children:d.jsx("button",{type:"button",className:"flex items-center gap-0.5 text-amber-500 hover:text-amber-400 transition-colors",children:d.jsx(rn,{className:"h-3 w-3"})})}),d.jsxs(un,{className:"w-56 p-3",side:"top",align:"end",onClick:s=>s.stopPropagation(),children:[d.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Session ended without completing work."}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.from_status&&d.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 transition-colors",onClick:()=>r(e,n.from_status,t),children:[d.jsx(z0,{className:"h-3 w-3"}),"Revert to ",n.from_status]}),d.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded bg-muted text-muted-foreground hover:bg-muted/80 transition-colors",onClick:()=>i(e,t),children:[d.jsx(wt,{className:"h-3 w-3"}),"Keep here"]})]})]})]})}function AE(e){const t=e.toLowerCase().trim(),n=t.match(/^~?(\d+)(?:\s*-\s*\d+)?\s*min/);if(n)return`${n[1]}M`;const r=t.match(/^~?(\d+(?:\.\d+)?)(?:\s*-\s*\d+(?:\.\d+)?)?\s*hour/);if(r)return`${r[1]}H`;const i=t.match(/\((\d+(?:\.\d+)?)(?:\s*-\s*\d+(?:\.\d+)?)?\s*(hour|min)/);return i?`${i[1]}${i[2].startsWith("h")?"H":"M"}`:t.includes("large")||t.includes("multi")?"LG":t.includes("medium")||t.includes("half")?"MD":t.includes("small")?"SM":"TBD"}function Wn({scope:e,onClick:t,isDragOverlay:n,cardDisplay:r,dimmed:i,project:s}){const{attributes:o,listeners:a,setNodeRef:l,transform:c,isDragging:u}=Yh({id:ce(e),disabled:n||i}),f=c?{transform:xr.Translate.toString(c)}:void 0,{engine:h}=dn(),{activeScopes:p,abandonedScopes:g,recoverScope:b,dismissAbandoned:y}=kh(),x=Xt(),w=h.getEntryPoint().id,C=e.status===w,E=C&&!!e.is_ghost,k=ce(e),S=!C&&p.has(k),A=C?void 0:g.get(k),T=!!A&&!S,R=m.useRef(null),[N,D]=m.useState(()=>document.documentElement.getAttribute("data-theme")==="neon-glass");return m.useEffect(()=>{const P=new MutationObserver(()=>{D(document.documentElement.getAttribute("data-theme")==="neon-glass")});return P.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>P.disconnect()},[]),m.useEffect(()=>{if(!S||!R.current)return;let P=0,_;const L=R.current,I=N?M=>`conic-gradient(from ${M}deg, transparent 0%, rgba(var(--neon-pink), 0.9) 8%, rgba(var(--neon-pink), 0.5) 16%, rgba(var(--neon-cyan), 0.15) 24%, transparent 32%)`:M=>`conic-gradient(from ${M}deg, transparent 0%, rgba(233,30,99,0.7) 10%, rgba(233,30,99,0.3) 20%, transparent 30%)`,H=()=>{P=(P+1.5)%360,L.style.background=I(P),_=requestAnimationFrame(H)};return _=requestAnimationFrame(H),()=>cancelAnimationFrame(_)},[S,N]),d.jsxs($l,{ref:l,"data-tour":"scope-card",style:{...f,...!E&&!C&&s&&(r==null?void 0:r.project)!==!1?{"--project-color":`hsl(${s.color})`}:{}},className:F("scope-card group/scope-card cursor-grab transition-[colors,opacity] duration-200 hover:bg-surface-light active:cursor-grabbing",E?"scope-card-ghost ghost-shimmer opacity-70":C?"border-l-2 border-dashed border-l-warning-amber/60":"",S&&"scope-card-dispatched",T&&"scope-card-abandoned",u&&"opacity-0 pointer-events-none",i&&!u&&"opacity-30 cursor-default"),onClick:()=>{u||t==null||t(e)},...o,...a,children:[S&&d.jsx("div",{ref:R,className:"dispatch-border-overlay"}),d.jsxs(Ul,{className:"px-2.5 py-1.5",children:[d.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[E?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-purple-400",children:[d.jsx(Wa,{className:"h-3 w-3"}),"ai suggestion"]}):C?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-warning-amber",children:[d.jsx(a0,{className:"h-3 w-3"}),"idea"]}):d.jsxs("span",{className:"font-mono text-xxs text-muted-foreground flex items-center gap-1",children:[S&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-pink-500 dispatch-pulse"}),T&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),_t(e.id),d.jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),fetch(x(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favourite:!e.favourite})})},className:F("inline-flex items-center justify-center h-3.5 w-3.5 transition-all duration-150",e.favourite?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover/scope-card:opacity-100 hover:text-primary/70"),"aria-label":e.favourite?"Remove from favourites":"Add to favourites",children:d.jsx(D0,{className:F("h-3 w-3",e.favourite&&"fill-current")})})]}),!C&&d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[T&&d.jsx(PE,{scopeId:e.id,projectId:e.project_id,info:A,onRecover:b,onDismiss:y}),e.effort_estimate&&(r==null?void 0:r.effort)!==!1&&d.jsx("span",{className:F(jo,"effort-ghost border-muted-foreground/30 text-muted-foreground"),children:AE(e.effort_estimate)}),e.category&&(r==null?void 0:r.category)!==!1&&d.jsx("span",{className:F(jo,TE[e.category]??"border-muted-foreground/30 text-muted-foreground"),children:e.category}),e.priority&&(r==null?void 0:r.priority)!==!1&&d.jsx("span",{className:F(jo,NE[e.priority]??"border-muted-foreground/30 text-muted-foreground"),children:e.priority})]})]}),d.jsx("h3",{className:"text-xs font-light leading-snug line-clamp-2",children:e.title}),!C&&e.tags.length>0&&(r==null?void 0:r.tags)!==!1&&d.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(P=>d.jsx("span",{className:"glass-pill inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:P},P)),e.tags.length>3&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",e.tags.length-3]})]})]})]})}function _E({projectId:e,disabled:t,onProjectChange:n,className:r}){const{projects:i,hasMultipleProjects:s,getProjectColor:o,getProjectName:a}=Rt(),[l,c]=m.useState(!1);if(!s||!e)return null;const u=o(e),f=a(e),h=i.filter(p=>p.enabled);return d.jsxs(An,{open:l&&!t,onOpenChange:c,children:[d.jsx(_n,{asChild:!0,children:d.jsxs("button",{disabled:t,className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0 text-[10px] leading-[16px] transition-all duration-200",t?"opacity-50 cursor-default":"cursor-pointer hover:bg-accent/50",r),style:{borderColor:`hsl(${u} / 0.4)`,color:`hsl(${u})`,borderWidth:"1px",borderStyle:"solid"},onClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 transition-all duration-200",style:{backgroundColor:`hsl(${u})`}}),d.jsx("span",{className:"truncate max-w-[60px]",children:f}),!t&&d.jsx(Qf,{className:"h-2.5 w-2.5 shrink-0 opacity-60"})]})}),d.jsx(un,{className:"w-44 p-1",align:"start",side:"top",sideOffset:6,onClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:d.jsx("div",{className:"max-h-48 overflow-y-auto",children:h.map(p=>{const g=p.id===e;return d.jsxs("button",{className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors",g?"bg-accent":"hover:bg-accent/50"),onClick:()=>{!g&&n&&n(p.id),c(!1)},children:[d.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:`hsl(${p.color})`}}),d.jsx("span",{className:"truncate flex-1 text-left",children:p.name}),g&&d.jsx(Kn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]},p.id)})})})]})}const Pm={assembling:"border-dashed border-cyan-500/40",dispatched:"border-solid border-amber-500/50 batch-group-dispatched",in_progress:"border-solid border-amber-500/40 batch-group-dispatched",completed:"border-solid border-green-500/40",failed:"border-solid border-red-500/40",cancelled:"border-solid border-muted-foreground/30 opacity-50"},Am={assembling:{icon:Ts,label:"Assembling",bg:"bg-cyan-500/15",text:"text-cyan-400"},dispatched:{icon:Zo,label:"In Progress",bg:"bg-amber-500/15",text:"text-amber-400"},in_progress:{icon:Zo,label:"In Progress",bg:"bg-amber-500/15",text:"text-amber-400"},completed:{icon:Kn,label:"Completed",bg:"bg-green-500/15",text:"text-green-400"},failed:{icon:wt,label:"Failed",bg:"bg-red-500/15",text:"text-red-400"},cancelled:{icon:wt,label:"Cancelled",bg:"bg-muted",text:"text-muted-foreground"}};function RE({sprint:e,scopeLookup:t,onDelete:n,onRename:r,onScopeClick:i,cardDisplay:s,dimmedIds:o,looseCount:a,onAddAll:l,projectLookup:c,editingName:u,onEditingDone:f,onProjectChange:h}){var X;const{engine:p}=dn(),g=e.status==="assembling",[b,y]=m.useState(u??!1),[x,w]=m.useState(e.name),C=m.useRef(null);m.useEffect(()=>{u&&(y(!0),w(""))},[u]),m.useEffect(()=>{var W;b&&((W=C.current)==null||W.focus())},[b]);const E=()=>{const W=x.trim();W&&W!==e.name&&r&&r(e.id,W),y(!1),w(W||e.name),f==null||f()},k=e.group_type==="batch",S=e.status==="dispatched"||e.status==="in_progress",{attributes:A,listeners:T,setNodeRef:R,isDragging:N}=Yh({id:`sprint-${e.id}`,disabled:S||e.scope_ids.length===0}),{setNodeRef:D,isOver:P}=sl({id:`sprint-drop-${e.id}`,disabled:!g}),{active:_}=Xh(),L=_?String(_.id):null,I=L&&!L.startsWith("sprint-")?dv(L).projectId:void 0,H=g&&L!=null&&!L.startsWith("sprint-")&&(!e.project_id||!I||e.project_id===I),M=e.scope_ids.length,{progress:$}=e,z=k?ih:Ts,v=e.project_id&&(c==null?void 0:c.get(e.project_id)),U=v?`hsl(${v.color})`:void 0,ne=v?`hsl(${v.color} / 0.1)`:void 0,j=U?"":"text-muted-foreground",K=k&&g?"border-muted-foreground/30":Pm[e.status]??"border-muted-foreground/30";return d.jsxs("div",{ref:R,style:{...U?{borderColor:U}:k&&g?{borderColor:(((X=p.getList(e.target_column))==null?void 0:X.hex)??"")+"80"}:void 0},className:F("rounded-lg border bg-card/30 transition-all duration-200",!U&&K,N&&"opacity-0",!S&&e.scope_ids.length>0&&"cursor-grab active:cursor-grabbing"),...A,...T,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit rounded-t-lg transition-colors duration-200",style:ne?{backgroundColor:ne}:void 0,children:[d.jsx(z,{className:F("h-3 w-3 shrink-0 transition-colors duration-200",j),style:U?{color:U}:void 0}),b?d.jsx("input",{ref:C,className:"min-w-0 flex-1 h-5 rounded bg-muted/50 px-1.5 text-xs font-medium text-foreground border border-cyan-500/30 focus:outline-none focus:ring-1 focus:ring-cyan-500/50",placeholder:k?"Batch name...":"Sprint name...",value:x,onChange:W=>w(W.target.value),onKeyDown:W=>{W.key==="Enter"&&E(),W.key==="Escape"&&(y(!1),w(e.name),f==null||f())},onBlur:E,onClick:W=>W.stopPropagation()}):d.jsx("span",{className:F("text-xs font-medium text-foreground truncate",g&&"cursor-text"),onDoubleClick:()=>{g&&(y(!0),w(e.name))},children:e.name}),d.jsx("div",{className:"flex-1"}),g&&(a??0)>0&&l&&d.jsxs("button",{onClick:W=>{W.stopPropagation(),l(e.id)},className:"shrink-0 flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",title:`Add all ${a} remaining scopes`,children:["+ All (",a,")"]}),n&&d.jsx("button",{onClick:W=>{W.stopPropagation(),n(e.id)},disabled:e.status==="dispatched"||e.status==="in_progress",className:F("shrink-0 transition-colors",e.status==="dispatched"||e.status==="in_progress"?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-[#FFFFFF]"),children:d.jsx(wt,{className:"h-3 w-3"})})]}),d.jsxs("div",{ref:D,className:F("p-1.5 space-y-1 min-h-[40px] transition-colors duration-150",P&&g&&"bg-cyan-500/5 ring-1 ring-inset ring-cyan-500/30 rounded-b-lg"),children:[e.scope_ids.map(W=>{const Le=e.project_id?`${e.project_id}::${W}`:String(W),Ce=t.get(Le);if(!Ce){const Re=e.scopes.find(ge=>ge.scope_id===W);return d.jsxs("div",{className:"rounded border border-muted-foreground/20 bg-card/50 px-2 py-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-mono",children:_t(W)}),Re&&d.jsx("span",{className:"ml-2",children:Re.title})]},W)}return L&&ce(Ce)===L?null:d.jsx(Wn,{scope:Ce,onClick:i,cardDisplay:s,dimmed:o==null?void 0:o.has(ce(Ce)),project:Ce.project_id&&c?c.get(Ce.project_id):void 0},ce(Ce))}),H&&d.jsx("div",{className:F("flex h-8 items-center justify-center rounded border border-dashed text-[10px] transition-colors",P?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop to add"})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsxs("div",{className:"inline-flex items-stretch rounded-full border border-muted-foreground/30 bg-muted/40 pl-0 pr-2 text-[10px] leading-[16px] text-muted-foreground",children:[d.jsx(_E,{projectId:e.project_id,disabled:M>0||!g,onProjectChange:h?W=>h(e.id,W):void 0,className:"-ml-px -my-px"}),d.jsxs("span",{className:"ml-1.5 flex items-center",children:[M," scope",M!==1?"s":""]})]}),(()=>{const W=Am[e.status];if(!W)return null;const Le=W.icon,Ce=!g&&M>0&&($.completed>0||$.failed>0||$.in_progress>0),Re=d.jsxs("span",{className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] leading-[16px]",W.bg,W.text),children:[d.jsx(Le,{className:"h-2.5 w-2.5"}),W.label]});if(!Ce)return Re;const ge=[];return $.completed>0&&ge.push(`${$.completed} done`),$.in_progress>0&&ge.push(`${$.in_progress} active`),$.failed>0&&ge.push(`${$.failed} failed`),d.jsxs(Df,{children:[d.jsx(Of,{asChild:!0,children:Re}),d.jsx(Fa,{side:"top",children:ge.join(" · ")})]})})()]}),k&&e.dispatch_result&&(e.dispatch_result.commit_sha||e.dispatch_result.pr_url)&&d.jsxs("div",{className:"border-t border-inherit px-2.5 py-1 text-[10px] text-muted-foreground space-y-0.5",children:[e.dispatch_result.commit_sha&&d.jsx("span",{className:"font-mono",children:e.dispatch_result.commit_sha.slice(0,7)}),e.dispatch_result.pr_url&&d.jsxs("a",{href:e.dispatch_result.pr_url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:underline ml-1",children:["PR #",e.dispatch_result.pr_number??""]})]})]})}function ME({sprint:e,scopeLookup:t,projectLookup:n}){const i=e.group_type==="batch"?ih:Ts,s=e.project_id&&(n==null?void 0:n.get(e.project_id)),o=s?`hsl(${s.color})`:void 0,a=s?`hsl(${s.color} / 0.1)`:void 0,l=o?"":"text-muted-foreground",c=Pm[e.status]??"border-muted-foreground/30",u=Am[e.status],f=e.scope_ids.length;return d.jsxs("div",{className:F("w-72 rotate-1 opacity-90 shadow-xl shadow-black/40 rounded-lg border bg-card/80 overflow-hidden",!o&&c),style:o?{borderColor:o}:void 0,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit rounded-t-lg",style:a?{backgroundColor:a}:void 0,children:[d.jsx(i,{className:F("h-3 w-3 shrink-0",l),style:o?{color:o}:void 0}),d.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:e.name})]}),d.jsx("div",{className:"p-1.5 space-y-1",children:e.scope_ids.map(h=>{const p=e.project_id?`${e.project_id}::${h}`:String(h),g=t==null?void 0:t.get(p);if(g)return d.jsx(Wn,{scope:g,project:g.project_id&&n?n.get(g.project_id):void 0},ce(g));const b=e.scopes.find(y=>y.scope_id===h);return d.jsxs("div",{className:"rounded border border-muted-foreground/20 bg-card/50 px-2 py-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-mono",children:_t(h)}),b&&d.jsx("span",{className:"ml-2",children:b.title})]},h)})}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[f," scope",f!==1?"s":""]}),u&&(()=>{const h=u.icon;return d.jsxs("span",{className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]",u.bg,u.text),children:[d.jsx(h,{className:"h-2.5 w-2.5"}),u.label]})})()]})]})}const DE=[{field:"id",label:"Scope ID"},{field:"priority",label:"Priority"},{field:"effort",label:"Effort"},{field:"updated_at",label:"Last Updated"},{field:"created_at",label:"Created"},{field:"title",label:"Alphabetical"}];function hd({sortField:e,sortDirection:t,onSetSort:n,collapsed:r,onToggleCollapse:i}){const s=t==="asc"?Eb:Qf;return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsx("button",{className:"ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-white/[0.06] hover:text-foreground","aria-label":"Column options",children:d.jsx(zb,{className:"h-3 w-3"})})}),d.jsxs(un,{className:"filter-popover-glass !bg-transparent w-44",align:"end",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Sort by"}),DE.map(o=>{const a=e===o.field;return d.jsxs("button",{onClick:()=>n(o.field),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",a&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3 w-3 shrink-0 items-center justify-center rounded-full border",a?"border-primary bg-primary":"border-white/15"),children:a&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-white"})}),d.jsx("span",{className:F("flex-1 text-left",a&&"text-foreground"),children:o.label}),a&&d.jsx(s,{className:"h-3 w-3 text-muted-foreground"})]},o.field)})]}),d.jsx("div",{className:"my-1.5 border-t border-white/10"}),d.jsxs("button",{onClick:i,className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors hover:bg-white/[0.06]",children:[r?d.jsx(nh,{className:"h-3 w-3 text-muted-foreground"}):d.jsx(th,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{children:r?"Expand column":"Collapse column"})]})]})]})}function OE({id:e,label:t,color:n,scopes:r,sprints:i=[],scopeLookup:s=new Map,globalSprintScopeIds:o,onScopeClick:a,onDeleteSprint:l,onRenameSprint:c,editingSprintId:u,onSprintEditingDone:f,isValidDrop:h,isDragActive:p,headerExtra:g,collapsed:b,onToggleCollapse:y,sortField:x,sortDirection:w,onSetSort:C,cardDisplay:E,dimmedIds:k,onAddAllToSprint:S,projectLookup:A,onProjectChange:T}){jr();const{setNodeRef:R,isOver:N}=sl({id:e}),D=m.useRef(null);m.useEffect(()=>{p&&h&&D.current&&D.current.scrollTo({top:0,behavior:"smooth"})},[p,h]);const P=o??new Set(i.flatMap(M=>M.scope_ids.map($=>M.project_id?`${M.project_id}::${$}`:String($)))),_=r.filter(M=>!P.has(ce(M))),L=_.filter(M=>!M.is_ghost).map(M=>M.id),I=r.length,H=b;return d.jsx("div",{ref:R,"data-tour":"kanban-column",className:F("flex h-full flex-shrink-0 flex-col rounded border bg-card/50 overflow-hidden transition-[width] duration-300 ease-in-out",H?"w-10 cursor-pointer items-center":"w-72","card-glass neon-border-blue",p&&N&&h&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",p&&N&&!h&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",p&&!N&&h&&"border-green-500/20"),onClick:H?y:void 0,children:H?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex items-center justify-center py-1.5",onClick:M=>M.stopPropagation(),children:x&&w&&C&&y&&d.jsx(hd,{sortField:x,sortDirection:w,onSetSort:C,collapsed:!0,onToggleCollapse:y})}),d.jsx("div",{className:"flex items-start justify-center overflow-hidden pt-2",children:d.jsxs("div",{className:"flex items-center gap-2 [writing-mode:vertical-lr]",children:[d.jsx("div",{className:F("h-2.5 w-2.5 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${n})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground whitespace-nowrap",children:t})]})}),d.jsx("span",{className:"mt-2 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-normal text-muted-foreground",children:I})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"column-header flex items-center gap-2 border-b px-2.5 py-1.5 cursor-pointer",onClick:y,children:[d.jsx("div",{className:F("h-2.5 w-2.5 rounded-full","animate-glow-pulse"),style:{backgroundColor:`hsl(${n})`}}),d.jsx("h2",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground",children:t}),d.jsx("span",{className:"ml-auto rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:I}),g&&d.jsx("span",{className:"flex items-center",onClick:M=>M.stopPropagation(),children:g}),x&&w&&C&&y&&d.jsx("span",{onClick:M=>M.stopPropagation(),children:d.jsx(hd,{sortField:x,sortDirection:w,onSetSort:C,collapsed:!1,onToggleCollapse:y})})]}),d.jsx("div",{ref:D,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-2",children:d.jsxs("div",{className:"space-y-1.5",children:[i.map(M=>d.jsx(RE,{sprint:M,scopeLookup:s,onDelete:l,onRename:c,onScopeClick:a,cardDisplay:E,dimmedIds:k,projectLookup:A,editingName:sr(M)===u,onEditingDone:f,onProjectChange:T,looseCount:M.status==="assembling"?L.length:0,onAddAll:M.status==="assembling"&&S?$=>S($,L):void 0},`sprint-${M.id}`)),p&&h&&d.jsx("div",{className:F("flex h-10 items-center justify-center rounded border-2 border-dashed text-xs transition-colors",N?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),d.jsx(cs,{initial:!1,children:_.filter(M=>!M.is_ghost).map(M=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:M,onClick:a,cardDisplay:E,dimmed:k==null?void 0:k.has(ce(M)),project:M.project_id&&A?A.get(M.project_id):void 0})},ce(M)))}),_.some(M=>M.is_ghost)&&_.some(M=>!M.is_ghost)&&d.jsx("div",{className:"my-2 border-t border-dashed border-purple-500/20"}),d.jsx(cs,{initial:!1,children:_.filter(M=>M.is_ghost).map(M=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:M,onClick:a,cardDisplay:E,dimmed:k==null?void 0:k.has(ce(M)),project:M.project_id&&A?A.get(M.project_id):void 0})},ce(M)))})]})})]})})}var IE=Symbol.for("react.lazy"),ys=Nx[" use ".trim().toString()];function LE(e){return typeof e=="object"&&e!==null&&"then"in e}function _m(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===IE&&"_payload"in e&&LE(e._payload)}function Rm(e){const t=BE(e),n=m.forwardRef((r,i)=>{let{children:s,...o}=r;_m(s)&&typeof ys=="function"&&(s=ys(s._payload));const a=m.Children.toArray(s),l=a.find(VE);if(l){const c=l.props.children,u=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:m.isValidElement(c)?m.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var FE=Rm("Slot");function BE(e){const t=m.forwardRef((n,r)=>{let{children:i,...s}=n;if(_m(i)&&typeof ys=="function"&&(i=ys(i._payload)),m.isValidElement(i)){const o=UE(i),a=$E(s,i.props);return i.type!==m.Fragment&&(a.ref=r?yf(r,o):o),m.cloneElement(i,a)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zE=Symbol("radix.slottable");function VE(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zE}function $E(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function UE(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const WE=Ph("inline-flex items-center justify-center whitespace-nowrap rounded text-xs font-normal ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 glow-blue",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-background hover:bg-surface-light hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-surface-light hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1.5",sm:"h-7 rounded px-2.5",lg:"h-9 rounded px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),ke=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?FE:"button";return d.jsx(o,{className:F(WE({variant:t,size:n,className:e})),ref:s,...i})});ke.displayName="Button";const HE=[{key:"effort",label:"Effort"},{key:"category",label:"Category"},{key:"priority",label:"Priority"},{key:"tags",label:"Tags"},{key:"project",label:"Project colors"}];function qE({display:e,onToggle:t,hiddenCount:n}){return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:"gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10","aria-label":"Toggle card display",children:[d.jsx(N0,{className:"h-3 w-3"}),"Cards",n>0&&d.jsx("span",{className:"ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]",children:n})]})}),d.jsx(un,{align:"end",className:"filter-popover-glass !bg-transparent w-40",children:d.jsx("div",{className:"space-y-0.5",children:HE.map(({key:r,label:i})=>{const s=e[r];return d.jsxs("button",{onClick:()=>t(r),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",s?"border-primary bg-primary text-primary-foreground":"border-white/15"),children:s&&d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:F("capitalize",s&&"text-foreground"),children:i})]},r)})})})]})}const KE=[{value:"kanban",label:"Kanban",Icon:Zf},{value:"swimlane",label:"Swimlane",Icon:sh}],GE=[{value:"priority",label:"Priority"},{value:"category",label:"Category"},{value:"tags",label:"Tags"},{value:"effort",label:"Effort"},{value:"dependencies",label:"Dependencies"},{value:"project",label:"Project"}];function YE({viewMode:e,groupField:t,onViewModeChange:n,onGroupFieldChange:r}){const i=e==="swimlane"?sh:Zf;return d.jsxs(An,{children:[d.jsx(_n,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:"gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10","aria-label":"Toggle view mode",children:[d.jsx(i,{className:"h-3 w-3"}),"Board"]})}),d.jsxs(un,{align:"end",className:"filter-popover-glass !bg-transparent w-44",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"View"}),KE.map(({value:s,label:o,Icon:a})=>d.jsxs("button",{onClick:()=>n(s),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",e===s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",e===s?"border-primary bg-primary":"border-white/15"),children:e===s&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary-foreground"})}),d.jsx(a,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{className:F(e===s&&"text-foreground"),children:o})]},s))]}),e==="swimlane"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 border-t border-white/[0.06]"}),d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Group by"}),GE.map(({value:s,label:o})=>d.jsxs("button",{onClick:()=>r(s),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",t===s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",t===s?"border-primary bg-primary":"border-white/15"),children:t===s&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary-foreground"})}),d.jsx("span",{className:F(t===s&&"text-foreground"),children:o})]},s))]})]})]})]})}function XE({laneValue:e,status:t,scopes:n=[],onScopeClick:r,cardDisplay:i,dimmedIds:s,isDragActive:o,isValidDrop:a,isCollapsed:l,projectLookup:c}){const u=`swim::${e}::${t}`,{setNodeRef:f,isOver:h}=sl({id:u});return l?null:d.jsx("div",{ref:f,className:F("swim-cell min-h-[48px] overflow-hidden rounded border border-white/[0.04] p-1 transition-colors",o&&h&&a&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",o&&h&&!a&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",o&&!h&&a&&"border-green-500/20",n.length===0&&"border-dashed border-white/[0.06]"),children:d.jsxs("div",{className:"space-y-1.5",children:[o&&a&&d.jsx("div",{className:F("flex h-8 items-center justify-center rounded border-2 border-dashed text-[10px] transition-colors",h?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),d.jsx(cs,{initial:!1,children:n.filter(p=>!p.is_ghost).map(p=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:p,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(p)),project:p.project_id&&c?c.get(p.project_id):void 0})},ce(p)))}),d.jsx(cs,{initial:!1,children:n.filter(p=>p.is_ghost).map(p=>d.jsx(xs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Wn,{scope:p,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(p)),project:p.project_id&&c?c.get(p.project_id):void 0})},ce(p)))})]})})}function JE({lane:e,columns:t,collapsedColumns:n,isLaneCollapsed:r,onToggleLane:i,onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,validTargets:c,projectLookup:u}){return r?d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:i,className:"swim-lane-header flex items-center gap-2 rounded-l px-3 py-1.5 text-left hover:bg-white/[0.04] transition-colors cursor-pointer sticky left-0 z-10 bg-background/60 backdrop-blur-sm",children:[d.jsx("div",{className:F("h-full w-0.5 rounded-full shrink-0 self-stretch",!e.colorHsl&&e.color),style:e.colorHsl?{backgroundColor:`hsl(${e.colorHsl})`}:void 0}),d.jsx(ii,{className:"h-3 w-3 text-muted-foreground shrink-0"}),d.jsx("span",{className:"text-xxs font-medium text-muted-foreground truncate capitalize",children:e.label}),d.jsx("span",{className:"ml-auto rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground shrink-0",children:e.count})]}),t.map(f=>d.jsx("div",{className:F(n.has(f.id)&&"hidden")},f.id))]}):d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:i,className:"swim-lane-header flex items-start gap-2 rounded-l px-3 py-2 text-left hover:bg-white/[0.04] transition-colors cursor-pointer sticky left-0 z-10 bg-background/60 backdrop-blur-sm",children:[d.jsx("div",{className:F("w-0.5 rounded-full shrink-0 min-h-[32px] self-stretch",!e.colorHsl&&e.color),style:e.colorHsl?{backgroundColor:`hsl(${e.colorHsl})`}:void 0}),d.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ii,{className:"h-3 w-3 text-muted-foreground shrink-0 rotate-90 transition-transform"}),d.jsx("span",{className:"swim-lane-label text-xxs font-medium text-foreground/80 truncate capitalize",children:e.label})]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[e.count," scope",e.count!==1?"s":""]})]})]}),t.map(f=>d.jsx(XE,{laneValue:e.value,status:f.id,scopes:e.cells[f.id],onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,isValidDrop:c.has(f.id),isCollapsed:n.has(f.id),projectLookup:u},f.id))]})}function QE({lanes:e,columns:t,collapsedColumns:n,collapsedLanes:r,onToggleLane:i,onToggleCollapse:s,onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,sprints:f,projectLookup:h}){jr();const p=t.filter(y=>!n.has(y.id)),g=`140px ${p.map(()=>"288px").join(" ")}`,b=f.some(y=>y.group_type==="sprint"||y.group_type==="batch"&&y.status!=="completed");return d.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[b&&d.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded border border-primary/20 bg-primary/5 px-3 py-1.5 text-xs text-muted-foreground",children:[d.jsx(r0,{className:"h-3.5 w-3.5 text-primary shrink-0"}),"Sprint groups are hidden in swimlane view"]}),d.jsxs("div",{className:"grid gap-px pb-4",style:{gridTemplateColumns:g,width:"max-content"},children:[d.jsx("div",{className:"sticky top-0 z-20 bg-background"}),p.map(y=>d.jsxs("button",{onClick:()=>s(y.id),className:F("sticky top-0 z-20 flex items-center gap-1.5 rounded-t border-b border-white/[0.06] bg-background px-2 py-1.5 text-left cursor-pointer hover:bg-white/[0.03] transition-colors","border-b-white/[0.08]"),children:[d.jsx("div",{className:F("h-2 w-2 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${y.color})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground truncate",children:y.label})]},y.id)),e.map(y=>d.jsx(JE,{lane:y,columns:p,collapsedColumns:n,isLaneCollapsed:r.has(y.value),onToggleLane:()=>i(y.value),onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,projectLookup:h},y.value)),e.length===0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{}),d.jsx("div",{className:F("col-span-full py-12 text-center text-xs text-muted-foreground"),children:"No scopes to display"})]})]})]})}function ZE({activeScope:e,activeSprint:t,cardDisplay:n,projectLookup:r,scopeLookup:i}){return d.jsxs(g1,{dropAnimation:null,children:[e&&d.jsx("div",{className:"w-72 rotate-2 shadow-xl shadow-black/40",children:d.jsx(Wn,{scope:e,cardDisplay:n,project:e.project_id&&r?r.get(e.project_id):void 0})}),t&&d.jsx(ME,{sprint:t,scopeLookup:i,projectLookup:r})]})}function eN({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a,onViewDetails:l}){var y;const c=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const x=setTimeout(()=>{var w;return(w=c.current)==null?void 0:w.focus()},100);return()=>clearTimeout(x)},[e]),!t||!n)return null;const u=((y=n.command)==null?void 0:y.replace("{id}",String(t.id)))??null,f=n.direction==="forward"&&!n.command&&n.from!==n.to,h=t.status===n.from&&f,p=h?"/scope-create":u,g=h||u?"Launch":"Move";function b(){o()}return d.jsx(an,{open:e,onOpenChange:x=>{x||a()},children:d.jsxs(Yt,{className:"max-w-xs p-3 gap-0",children:[d.jsx(ln,{className:"sr-only",children:h?"Promote idea":"Confirm transition"}),d.jsx(cn,{className:"sr-only",children:h?`Create a scope from idea "${t.title}"`:`Move ${_t(t.id)} from ${n.from} to ${n.to}`}),d.jsxs("div",{className:"mb-2.5 flex items-center gap-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(ns,{className:"h-3 w-3 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:h?d.jsx("span",{className:"font-light",children:t.title}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-mono",children:_t(t.id)})," ",d.jsx("span",{className:"font-light",children:t.title})]})}),p&&d.jsxs("div",{className:"mb-3 flex items-center gap-1.5 rounded bg-surface/30 px-2 py-1.5",children:[d.jsx(Ps,{className:"h-3 w-3 shrink-0 text-primary"}),d.jsx("code",{className:"text-xxs font-mono text-primary",children:p})]}),h&&d.jsx("p",{className:"mb-3 text-xxs text-muted-foreground",children:"Creates a scope document from this idea"}),r&&d.jsxs("div",{className:F("mb-3 flex items-start gap-1.5 rounded border px-2 py-1.5 text-xxs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(rn,{className:"mt-0.5 h-3 w-3 shrink-0"}),d.jsx("span",{children:"A CLI session is already running for this scope."})]}),s&&d.jsxs("div",{className:"mb-3 flex items-start gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-xxs text-red-400",children:[d.jsx(rn,{className:"mt-0.5 h-3 w-3 shrink-0"}),d.jsx("span",{children:s})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ke,{ref:c,size:"sm",onClick:b,disabled:i,className:"flex-1",children:i?"Launching...":g}),d.jsx(ke,{size:"sm",variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]}),(u||h)&&d.jsxs("button",{onClick:l,className:"mt-2 flex items-center gap-1 text-xxs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(eh,{className:"h-2.5 w-2.5"}),"View Details"]})]})})}function tN({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a}){var b;const[l,c]=m.useState(new Set),u=(n==null?void 0:n.checklist)??[],f=u.length===0||l.size===u.length;if(m.useEffect(()=>{e&&c(new Set)},[e]),!t||!n)return null;const h=((b=n.command)==null?void 0:b.replace("{id}",String(t.id)))??null;function p(y){c(x=>{const w=new Set(x);return w.has(y)?w.delete(y):w.add(y),w})}function g(){o()}return d.jsx(an,{open:e,onOpenChange:y=>{y||a()},children:d.jsxs(Yt,{className:"max-w-md p-0 gap-0",children:[d.jsxs(Tn,{className:"px-5 pt-4 pb-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(ns,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx(ln,{className:"text-sm font-normal",children:n.label}),d.jsx(cn,{className:"text-xs text-muted-foreground mt-1",children:n.description})]}),d.jsxs("div",{className:"px-5 pb-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(t.id)}),d.jsx("span",{className:"font-light truncate",children:t.title}),t.category&&d.jsx(Ve,{variant:"secondary",className:"ml-auto text-xxs",children:t.category})]}),h&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-surface/30 px-3 py-2",children:[d.jsx(Ps,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("code",{className:"text-xs font-mono text-primary",children:h})]}),u.length>0&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("p",{className:"text-xxs font-medium text-muted-foreground uppercase tracking-wider",children:"Pre-launch checklist"}),u.map((y,x)=>d.jsxs("button",{onClick:()=>p(x),className:F("flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-xs text-left transition-colors",l.has(x)?"bg-primary/10 text-foreground":"bg-muted/30 text-muted-foreground hover:bg-muted/50"),children:[d.jsx("div",{className:F("flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border transition-colors",l.has(x)?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/30"),children:l.has(x)&&d.jsx(Kn,{className:"h-2.5 w-2.5"})}),d.jsx("span",{className:"font-light",children:y})]},y))]}),r&&d.jsxs("div",{className:F("flex items-start gap-2 rounded border px-3 py-2 text-xs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(rn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:"A CLI session is already running for this scope. Launching will start a new one."})]}),s&&d.jsxs("div",{className:"flex items-start gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[d.jsx(rn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:s})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{onClick:g,disabled:!f||i,className:"flex-1",children:i?"Launching...":h?"Launch in iTerm":"Confirm Move"}),d.jsx(ke,{variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]})]})]})})}var nN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rN=nN.reduce((e,t)=>{const n=Rm(`Primitive.${t}`),r=m.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),iN="Separator",pd="horizontal",sN=["horizontal","vertical"],Mm=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=pd,...i}=e,s=oN(r)?r:pd,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(rN.div,{"data-orientation":s,...a,...i,ref:t})});Mm.displayName=iN;function oN(e){return sN.includes(e)}var Dm=Mm;const bs=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>d.jsx(Dm,{ref:i,decorative:n,orientation:t,className:F("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));bs.displayName=Dm.displayName;function aN(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uN={};function md(e,t){return(uN.jsx?cN:lN).test(e)}const dN=/[ \t\n\f\r]/g;function fN(e){return typeof e=="object"?e.type==="text"?gd(e.value):!1:gd(e)}function gd(e){return e.replace(dN,"")===""}class ji{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ji.prototype.normal={};ji.prototype.property={};ji.prototype.space=void 0;function Om(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ji(n,r,t)}function Ca(e){return e.toLowerCase()}class xt{constructor(t,n){this.attribute=n,this.property=t}}xt.prototype.attribute="";xt.prototype.booleanish=!1;xt.prototype.boolean=!1;xt.prototype.commaOrSpaceSeparated=!1;xt.prototype.commaSeparated=!1;xt.prototype.defined=!1;xt.prototype.mustUseProperty=!1;xt.prototype.number=!1;xt.prototype.overloadedBoolean=!1;xt.prototype.property="";xt.prototype.spaceSeparated=!1;xt.prototype.space=void 0;let hN=0;const se=Yn(),Ke=Yn(),ja=Yn(),V=Yn(),Ee=Yn(),pr=Yn(),bt=Yn();function Yn(){return 2**++hN}const Ea=Object.freeze(Object.defineProperty({__proto__:null,boolean:se,booleanish:Ke,commaOrSpaceSeparated:bt,commaSeparated:pr,number:V,overloadedBoolean:ja,spaceSeparated:Ee},Symbol.toStringTag,{value:"Module"})),Eo=Object.keys(Ea);class Wl extends xt{constructor(t,n,r,i){let s=-1;if(super(t,n),xd(this,"space",i),typeof r=="number")for(;++s<Eo.length;){const o=Eo[s];xd(this,Eo[s],(r&Ea[o])===Ea[o])}}}Wl.prototype.defined=!0;function xd(e,t,n){n&&(e[t]=n)}function Ar(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Wl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ca(r)]=r,n[Ca(s.attribute)]=r}return new ji(t,n,e.space)}const Im=Ar({properties:{ariaActiveDescendant:null,ariaAtomic:Ke,ariaAutoComplete:null,ariaBusy:Ke,ariaChecked:Ke,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:Ee,ariaCurrent:null,ariaDescribedBy:Ee,ariaDetails:null,ariaDisabled:Ke,ariaDropEffect:Ee,ariaErrorMessage:null,ariaExpanded:Ke,ariaFlowTo:Ee,ariaGrabbed:Ke,ariaHasPopup:null,ariaHidden:Ke,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ee,ariaLevel:V,ariaLive:null,ariaModal:Ke,ariaMultiLine:Ke,ariaMultiSelectable:Ke,ariaOrientation:null,ariaOwns:Ee,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Ke,ariaReadOnly:Ke,ariaRelevant:null,ariaRequired:Ke,ariaRoleDescription:Ee,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Ke,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Lm(e,t){return t in e?e[t]:t}function Fm(e,t){return Lm(e,t.toLowerCase())}const pN=Ar({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pr,acceptCharset:Ee,accessKey:Ee,action:null,allow:null,allowFullScreen:se,allowPaymentRequest:se,allowUserMedia:se,alt:null,as:null,async:se,autoCapitalize:null,autoComplete:Ee,autoFocus:se,autoPlay:se,blocking:Ee,capture:null,charSet:null,checked:se,cite:null,className:Ee,cols:V,colSpan:null,content:null,contentEditable:Ke,controls:se,controlsList:Ee,coords:V|pr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:se,defer:se,dir:null,dirName:null,disabled:se,download:ja,draggable:Ke,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:se,formTarget:null,headers:Ee,height:V,hidden:ja,high:V,href:null,hrefLang:null,htmlFor:Ee,httpEquiv:Ee,id:null,imageSizes:null,imageSrcSet:null,inert:se,inputMode:null,integrity:null,is:null,isMap:se,itemId:null,itemProp:Ee,itemRef:Ee,itemScope:se,itemType:Ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:se,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:se,muted:se,name:null,nonce:null,noModule:se,noValidate:se,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:se,optimum:V,pattern:null,ping:Ee,placeholder:null,playsInline:se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:se,referrerPolicy:null,rel:Ee,required:se,reversed:se,rows:V,rowSpan:V,sandbox:Ee,scope:null,scoped:se,seamless:se,selected:se,shadowRootClonable:se,shadowRootDelegatesFocus:se,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Ke,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:se,useMap:null,value:Ke,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ee,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:se,declare:se,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:se,noHref:se,noShade:se,noWrap:se,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Ke,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:se,disableRemotePlayback:se,prefix:null,property:null,results:V,security:null,unselectable:null},space:"html",transform:Fm}),mN=Ar({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",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:bt,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:Ee,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:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:se,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,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:pr,g2:pr,glyphName:pr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:bt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,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:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bt,rev:bt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bt,requiredFeatures:bt,requiredFonts:bt,requiredFormats:bt,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:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:bt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bt,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Lm}),Bm=Ar({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()}}),zm=Ar({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fm}),Vm=Ar({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),gN={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"},xN=/[A-Z]/g,yd=/-[a-z]/g,yN=/^data[-\w.:]+$/i;function bN(e,t){const n=Ca(t);let r=t,i=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yN.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yd,wN);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yd.test(s)){let o=s.replace(xN,vN);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Wl}return new i(r,t)}function vN(e){return"-"+e.toLowerCase()}function wN(e){return e.charAt(1).toUpperCase()}const kN=Om([Im,pN,Bm,zm,Vm],"html"),Hl=Om([Im,mN,Bm,zm,Vm],"svg");function SN(e){return e.join(" ").trim()}var Zn={},No,bd;function CN(){if(bd)return No;bd=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
311
+ `,c="/",u="*",f="",h="comment",p="declaration";function g(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var w=1,C=1;function E(L){var I=L.match(t);I&&(w+=I.length);var H=L.lastIndexOf(l);C=~H?L.length-H:C+L.length}function k(){var L={line:w,column:C};return function(I){return I.position=new S(L),R(),I}}function S(L){this.start=L,this.end={line:w,column:C},this.source=x.source}S.prototype.content=y;function A(L){var I=new Error(x.source+":"+w+":"+C+": "+L);if(I.reason=L,I.filename=x.source,I.line=w,I.column=C,I.source=y,!x.silent)throw I}function T(L){var I=L.exec(y);if(I){var H=I[0];return E(H),y=y.slice(H.length),I}}function R(){T(n)}function N(L){var I;for(L=L||[];I=D();)I!==!1&&L.push(I);return L}function D(){var L=k();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var I=2;f!=y.charAt(I)&&(u!=y.charAt(I)||c!=y.charAt(I+1));)++I;if(I+=2,f===y.charAt(I-1))return A("End of comment missing");var H=y.slice(2,I-2);return C+=2,E(H),y=y.slice(I),C+=2,L({type:h,comment:H})}}function P(){var L=k(),I=T(r);if(I){if(D(),!T(i))return A("property missing ':'");var H=T(s),M=L({type:p,property:b(I[0].replace(e,f)),value:H?b(H[0].replace(e,f)):f});return T(o),M}}function _(){var L=[];N(L);for(var I;I=P();)I!==!1&&(L.push(I),N(L));return L}return R(),_()}function b(y){return y?y.replace(a,f):f}return No=g,No}var vd;function jN(){if(vd)return Zn;vd=1;var e=Zn&&Zn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.default=n;const t=e(CN());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),a=typeof i=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?i(c,u,l):u&&(s=s||{},s[c]=u)}),s}return Zn}var Lr={},wd;function EN(){if(wd)return Lr;wd=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,o))};return Lr.camelCase=l,Lr}var Fr,kd;function NN(){if(kd)return Fr;kd=1;var e=Fr&&Fr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(jN()),n=EN();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,Fr=r,Fr}var TN=NN();const PN=Ia(TN),$m=Um("end"),ql=Um("start");function Um(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function AN(e){const t=ql(e),n=$m(e);if(t&&n)return{start:t,end:n}}function ti(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sd(e.position):"start"in e||"end"in e?Sd(e):"line"in e||"column"in e?Na(e):""}function Na(e){return Cd(e&&e.line)+":"+Cd(e&&e.column)}function Sd(e){return Na(e&&e.start)+"-"+Na(e&&e.end)}function Cd(e){return e&&typeof e=="number"?e:1}class ct extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ti(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ct.prototype.file="";ct.prototype.name="";ct.prototype.reason="";ct.prototype.message="";ct.prototype.stack="";ct.prototype.column=void 0;ct.prototype.line=void 0;ct.prototype.ancestors=void 0;ct.prototype.cause=void 0;ct.prototype.fatal=void 0;ct.prototype.place=void 0;ct.prototype.ruleId=void 0;ct.prototype.source=void 0;const Kl={}.hasOwnProperty,_N=new Map,RN=/[A-Z]/g,MN=new Set(["table","tbody","thead","tfoot","tr"]),DN=new Set(["td","th"]),Wm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ON(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=UN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$N(n,t.jsx,t.jsxs)}const 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"?Hl:kN,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Hm(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Hm(e,t,n){if(t.type==="element")return IN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BN(e,t,n);if(t.type==="mdxjsEsm")return FN(e,t);if(t.type==="root")return zN(e,t,n);if(t.type==="text")return VN(e,t)}function IN(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=Km(e,t.tagName,!1),o=WN(e,t);let a=Yl(e,t);return MN.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!fN(l):!0})),qm(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function LN(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hi(e,t.position)}function FN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hi(e,t.position)}function BN(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Km(e,t.name,!0),o=HN(e,t),a=Yl(e,t);return qm(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function zN(e,t,n){const r={};return Gl(r,Yl(e,t)),e.create(t,e.Fragment,r,n)}function VN(e,t){return t.value}function qm(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $N(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function UN(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=ql(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function WN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Kl.call(t.properties,i)){const s=qN(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&DN.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function HN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else hi(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else hi(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Yl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:_N;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=Hm(e,s,o);a!==void 0&&n.push(a)}return n}function qN(e,t,n){const r=bN(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?aN(n):SN(n)),r.property==="style"){let i=typeof n=="object"?n:KN(e,String(n));return e.stylePropertyNameCase==="css"&&(i=GN(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?gN[r.property]||r.property:r.attribute,n]}}function KN(e,t){try{return PN(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ct("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Wm+"#cannot-parse-style-attribute",i}}function Km(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=md(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=md(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Kl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);hi(e)}function hi(e,t){const n=new ct("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=Wm+"#cannot-handle-mdx-estrees-without-createevaluater",n}function GN(e){const t={};let n;for(n in e)Kl.call(e,n)&&(t[YN(n)]=e[n]);return t}function YN(e){let t=e.replace(RN,XN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XN(e){return"-"+e.toLowerCase()}const To={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"]},JN={};function Xl(e,t){const n=JN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Gm(e,r,i)}function Gm(e,t,n){if(QN(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 jd(e.children,t,n)}return Array.isArray(e)?jd(e,t,n):""}function jd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Gm(e[i],t,n);return r.join("")}function QN(e){return!!(e&&typeof e=="object")}const Ed=document.createElement("i");function Jl(e){const t="&"+e+";";Ed.innerHTML=t;const n=Ed.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function vt(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t: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);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function At(e,t){return e.length>0?(vt(e,e.length,0,t),e):t}const Nd={}.hasOwnProperty;function Ym(e){const t={};let n=-1;for(;++n<e.length;)ZN(t,e[n]);return t}function ZN(e,t){let n;for(n in t){const i=(Nd.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Nd.call(i,o)||(i[o]=[]);const a=s[o];eT(i[o],Array.isArray(a)?a:a?[a]:[])}}}function eT(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);vt(e,0,0,r)}function Xm(e,t){const 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 Ft(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ft=Mn(/[A-Za-z]/),lt=Mn(/[\dA-Za-z]/),tT=Mn(/[#-'*+\--9=?A-Z^-~]/);function vs(e){return e!==null&&(e<32||e===127)}const Ta=Mn(/\d/),nT=Mn(/[\dA-Fa-f]/),rT=Mn(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const Ws=Mn(new RegExp("\\p{P}|\\p{S}","u")),Hn=Mn(/\s/);function Mn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _r(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&lt(e.charCodeAt(n+1))&&lt(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ue(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const iT={tokenize:sT};function sT(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ue(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Z(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const oT={tokenize:aT},Td={tokenize:lT};function aT(e){const t=this,n=[];let r=0,i,s,o;return a;function a(C){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const E=t.events.length;let k=E,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}x(r);let A=E;for(;A<t.events.length;)t.events[A][1].end={...S},A++;return vt(t.events,k+1,0,t.events.slice(E)),t.events.length=A,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return h(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Td,u,f)(C)}function u(C){return i&&w(),x(r),h(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(C)}function h(C){return t.containerState={},e.attempt(Td,p,g)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),h(C)}function g(C){if(C===null){i&&w(),x(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b(C)}function b(C){if(C===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return Z(C)?(e.consume(C),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),b)}function y(C,E){const k=t.sliceStream(C);if(E&&k.push(null),C.previous=s,s&&(s.next=C),s=C,i.defineSkip(C.start),i.write(k),t.parser.lazy[C.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<o&&(!i.events[S][1].end||i.events[S][1].end.offset>o))return;const A=t.events.length;let T=A,R,N;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(R){N=t.events[T][1].end;break}R=!0}for(x(r),S=A;S<t.events.length;)t.events[S][1].end={...N},S++;vt(t.events,T+1,0,t.events.slice(A)),t.events.length=S}}function x(C){let E=n.length;for(;E-- >C;){const k=n[E];t.containerState=k[1],k[0].exit.call(t,e)}n.length=C}function w(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lT(e,t,n){return ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kr(e){if(e===null||Se(e)||Hn(e))return 1;if(Ws(e))return 2}function Hs(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Pa={name:"attention",resolveAll:cT,tokenize:uT};function cT(e,t){let n=-1,r,i,s,o,a,l,c,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;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Pd(f,-l),Pd(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=At(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=At(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=At(c,Hs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=At(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=At(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,vt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uT(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=kr(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=kr(l),f=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?f:f&&(i||!h)),c._close=!!(s===42?h:h&&(u||!f)),t(l)}}function Pd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dT={name:"autolink",tokenize:fT};function fT(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return ft(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||lt(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||lt(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||vs(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):tT(p)?(e.consume(p),c):n(p)}function u(p){return lt(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||lt(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Ei={partial:!0,tokenize:hT};function hT(e,t,n){return r;function r(s){return ae(s)?ue(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Z(s)?t(s):n(s)}}const Jm={continuation:{tokenize:mT},exit:gT,name:"blockQuote",tokenize:pT};function pT(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function mT(e,t,n){const r=this;return i;function i(o){return ae(o)?ue(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Jm,t,n)(o)}}function gT(e){e.exit("blockQuote")}const Qm={name:"characterEscape",tokenize:xT};function xT(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return rT(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Zm={name:"characterReference",tokenize:yT};function yT(e,t,n){const r=this;let i=0,s,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=lt,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=nT,u):(e.enter("characterReferenceValue"),s=7,o=Ta,u(f))}function u(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===lt&&!Jl(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<s?(e.consume(f),u):n(f)}}const Ad={partial:!0,tokenize:vT},_d={concrete:!0,name:"codeFenced",tokenize:bT};function bT(e,t,n){const r=this,i={partial:!0,tokenize:k};let s=0,o=0,a;return l;function l(S){return c(S)}function c(S){const A=r.events[r.events.length-1];return s=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===a?(o++,e.consume(S),u):o<3?n(S):(e.exit("codeFencedFenceSequence"),ae(S)?ue(e,f,"whitespace")(S):f(S))}function f(S){return S===null||Z(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(Ad,b,E)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||Z(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):ae(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ue(e,p,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function p(S){return S===null||Z(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||Z(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),g)}function b(S){return e.attempt(i,E,y)(S)}function y(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),x}function x(S){return s>0&&ae(S)?ue(e,w,"linePrefix",s+1)(S):w(S)}function w(S){return S===null||Z(S)?e.check(Ad,b,E)(S):(e.enter("codeFlowValue"),C(S))}function C(S){return S===null||Z(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),C)}function E(S){return e.exit("codeFenced"),t(S)}function k(S,A,T){let R=0;return N;function N(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),D}function D(I){return S.enter("codeFencedFence"),ae(I)?ue(S,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):P(I)}function P(I){return I===a?(S.enter("codeFencedFenceSequence"),_(I)):T(I)}function _(I){return I===a?(R++,S.consume(I),_):R>=o?(S.exit("codeFencedFenceSequence"),ae(I)?ue(S,L,"whitespace")(I):L(I)):T(I)}function L(I){return I===null||Z(I)?(S.exit("codeFencedFence"),A(I)):T(I)}}}function vT(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Po={name:"codeIndented",tokenize:kT},wT={partial:!0,tokenize:ST};function kT(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ue(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(wT,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function ST(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ue(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Z(o)?i(o):n(o)}}const CT={name:"codeText",previous:ET,resolve:jT,tokenize:NT};function jT(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 ET(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function NT(e,t,n){let r=0,i,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,u(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",c(f))}}class TT{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Br(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Br(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Br(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Br(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Br(this.left,n.reverse())}}}function Br(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 eg(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new TT(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"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,PT(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return vt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function PT(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,h=-1,p=n,g=0,b=0;const y=[b];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,y.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const x=a.slice(y[h],y[h+1]),w=s.pop();l.push([w,w+x.length-1]),e.splice(w,2,x)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const AT={resolve:RT,tokenize:MT},_T={partial:!0,tokenize:DT};function RT(e){return eg(e),e}function MT(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):Z(a)?e.check(_T,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function DT(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ue(e,s,"linePrefix")}function s(o){if(o===null||Z(o))return n(o);const 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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function tg(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),h):x===null||x===32||x===41||vs(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||Z(x)?n(x):(e.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function b(x){return!u&&(x===null||x===41||Se(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||vs(x)?n(x):(e.consume(x),x===92?y:b)}function y(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function ng(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Z(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ae(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function rg(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ue(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Z(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function ni(e,t){let n;return r;function r(i){return Z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ae(i)?ue(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const OT={name:"definition",tokenize:LT},IT={partial:!0,tokenize:FT};function LT(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return ng.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Se(p)?ni(e,c)(p):c(p)}function c(p){return tg(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(IT,f,f)(p)}function f(p){return ae(p)?ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Z(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function FT(e,t,n){return r;function r(a){return Se(a)?ni(e,i)(a):n(a)}function i(a){return rg(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ae(a)?ue(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const BT={name:"hardBreakEscape",tokenize:zT};function zT(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Z(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const VT={name:"headingAtx",resolve:$T,tokenize:UT};function $T(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},vt(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function UT(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Se(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):ae(u)?ue(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Se(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const WT=["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"],Rd=["pre","script","style","textarea"],HT={concrete:!0,name:"htmlFlow",resolveTo:GT,tokenize:YT},qT={partial:!0,tokenize:JT},KT={partial:!0,tokenize:XT};function GT(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 YT(e,t,n){const r=this;let i,s,o,a,l;return c;function c(j){return u(j)}function u(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),f}function f(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),s=!0,b):j===63?(e.consume(j),i=3,r.interrupt?t:v):ft(j)?(e.consume(j),o=String.fromCharCode(j),y):n(j)}function h(j){return j===45?(e.consume(j),i=2,p):j===91?(e.consume(j),i=5,a=0,g):ft(j)?(e.consume(j),i=4,r.interrupt?t:v):n(j)}function p(j){return j===45?(e.consume(j),r.interrupt?t:v):n(j)}function g(j){const K="CDATA[";return j===K.charCodeAt(a++)?(e.consume(j),a===K.length?r.interrupt?t:P:g):n(j)}function b(j){return ft(j)?(e.consume(j),o=String.fromCharCode(j),y):n(j)}function y(j){if(j===null||j===47||j===62||Se(j)){const K=j===47,X=o.toLowerCase();return!K&&!s&&Rd.includes(X)?(i=1,r.interrupt?t(j):P(j)):WT.includes(o.toLowerCase())?(i=6,K?(e.consume(j),x):r.interrupt?t(j):P(j)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):s?w(j):C(j))}return j===45||lt(j)?(e.consume(j),o+=String.fromCharCode(j),y):n(j)}function x(j){return j===62?(e.consume(j),r.interrupt?t:P):n(j)}function w(j){return ae(j)?(e.consume(j),w):N(j)}function C(j){return j===47?(e.consume(j),N):j===58||j===95||ft(j)?(e.consume(j),E):ae(j)?(e.consume(j),C):N(j)}function E(j){return j===45||j===46||j===58||j===95||lt(j)?(e.consume(j),E):k(j)}function k(j){return j===61?(e.consume(j),S):ae(j)?(e.consume(j),k):C(j)}function S(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),l=j,A):ae(j)?(e.consume(j),S):T(j)}function A(j){return j===l?(e.consume(j),l=null,R):j===null||Z(j)?n(j):(e.consume(j),A)}function T(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||Se(j)?k(j):(e.consume(j),T)}function R(j){return j===47||j===62||ae(j)?C(j):n(j)}function N(j){return j===62?(e.consume(j),D):n(j)}function D(j){return j===null||Z(j)?P(j):ae(j)?(e.consume(j),D):n(j)}function P(j){return j===45&&i===2?(e.consume(j),H):j===60&&i===1?(e.consume(j),M):j===62&&i===4?(e.consume(j),U):j===63&&i===3?(e.consume(j),v):j===93&&i===5?(e.consume(j),z):Z(j)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qT,ne,_)(j)):j===null||Z(j)?(e.exit("htmlFlowData"),_(j)):(e.consume(j),P)}function _(j){return e.check(KT,L,ne)(j)}function L(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),I}function I(j){return j===null||Z(j)?_(j):(e.enter("htmlFlowData"),P(j))}function H(j){return j===45?(e.consume(j),v):P(j)}function M(j){return j===47?(e.consume(j),o="",$):P(j)}function $(j){if(j===62){const K=o.toLowerCase();return Rd.includes(K)?(e.consume(j),U):P(j)}return ft(j)&&o.length<8?(e.consume(j),o+=String.fromCharCode(j),$):P(j)}function z(j){return j===93?(e.consume(j),v):P(j)}function v(j){return j===62?(e.consume(j),U):j===45&&i===2?(e.consume(j),v):P(j)}function U(j){return j===null||Z(j)?(e.exit("htmlFlowData"),ne(j)):(e.consume(j),U)}function ne(j){return e.exit("htmlFlow"),t(j)}}function XT(e,t,n){const r=this;return i;function i(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function JT(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ei,t,n)}}const QT={name:"htmlText",tokenize:ZT};function ZT(e,t,n){const r=this;let i,s,o;return a;function a(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),l}function l(v){return v===33?(e.consume(v),c):v===47?(e.consume(v),k):v===63?(e.consume(v),C):ft(v)?(e.consume(v),T):n(v)}function c(v){return v===45?(e.consume(v),u):v===91?(e.consume(v),s=0,g):ft(v)?(e.consume(v),w):n(v)}function u(v){return v===45?(e.consume(v),p):n(v)}function f(v){return v===null?n(v):v===45?(e.consume(v),h):Z(v)?(o=f,M(v)):(e.consume(v),f)}function h(v){return v===45?(e.consume(v),p):f(v)}function p(v){return v===62?H(v):v===45?h(v):f(v)}function g(v){const U="CDATA[";return v===U.charCodeAt(s++)?(e.consume(v),s===U.length?b:g):n(v)}function b(v){return v===null?n(v):v===93?(e.consume(v),y):Z(v)?(o=b,M(v)):(e.consume(v),b)}function y(v){return v===93?(e.consume(v),x):b(v)}function x(v){return v===62?H(v):v===93?(e.consume(v),x):b(v)}function w(v){return v===null||v===62?H(v):Z(v)?(o=w,M(v)):(e.consume(v),w)}function C(v){return v===null?n(v):v===63?(e.consume(v),E):Z(v)?(o=C,M(v)):(e.consume(v),C)}function E(v){return v===62?H(v):C(v)}function k(v){return ft(v)?(e.consume(v),S):n(v)}function S(v){return v===45||lt(v)?(e.consume(v),S):A(v)}function A(v){return Z(v)?(o=A,M(v)):ae(v)?(e.consume(v),A):H(v)}function T(v){return v===45||lt(v)?(e.consume(v),T):v===47||v===62||Se(v)?R(v):n(v)}function R(v){return v===47?(e.consume(v),H):v===58||v===95||ft(v)?(e.consume(v),N):Z(v)?(o=R,M(v)):ae(v)?(e.consume(v),R):H(v)}function N(v){return v===45||v===46||v===58||v===95||lt(v)?(e.consume(v),N):D(v)}function D(v){return v===61?(e.consume(v),P):Z(v)?(o=D,M(v)):ae(v)?(e.consume(v),D):R(v)}function P(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),i=v,_):Z(v)?(o=P,M(v)):ae(v)?(e.consume(v),P):(e.consume(v),L)}function _(v){return v===i?(e.consume(v),i=void 0,I):v===null?n(v):Z(v)?(o=_,M(v)):(e.consume(v),_)}function L(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Se(v)?R(v):(e.consume(v),L)}function I(v){return v===47||v===62||Se(v)?R(v):n(v)}function H(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function M(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),$}function $(v){return ae(v)?ue(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):z(v)}function z(v){return e.enter("htmlTextData"),o(v)}}const Ql={name:"labelEnd",resolveAll:rP,resolveTo:iP,tokenize:sP},eP={tokenize:oP},tP={tokenize:aP},nP={tokenize:lP};function rP(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&vt(e,0,e.length,n),e}function iP(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=At(a,e.slice(s+1,s+r+3)),a=At(a,[["enter",u,t]]),a=At(a,Hs(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=At(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=At(a,e.slice(o+1)),a=At(a,[["exit",l,t]]),vt(e,s,e.length,a),e}function sP(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Ft(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(eP,u,o?u:f)(h):h===91?e.attempt(tP,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(nP,u,f)(h)}function u(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function oP(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Se(f)?ni(e,s)(f):s(f)}function s(f){return f===41?u(f):tg(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Se(f)?ni(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?rg(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Se(f)?ni(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function aP(e,t,n){const r=this;return i;function i(a){return ng.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function lP(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const cP={name:"labelStartImage",resolveAll:Ql.resolveAll,tokenize:uP};function uP(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const dP={name:"labelStartLink",resolveAll:Ql.resolveAll,tokenize:fP};function fP(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ao={name:"lineEnding",tokenize:hP};function hP(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ue(e,t,"linePrefix")}}const ts={name:"thematicBreak",tokenize:pP};function pP(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ae(c)?ue(e,a,"whitespace")(c):a(c))}}const mt={continuation:{tokenize:yP},exit:vP,name:"list",tokenize:xP},mP={partial:!0,tokenize:wP},gP={partial:!0,tokenize:bP};function xP(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ta(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ts,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ta(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ei,r.interrupt?n:u,e.attempt(mP,h,f))}function u(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ae(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function yP(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ei,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ue(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(gP,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ue(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function bP(e,t,n){const r=this;return ue(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function vP(e){e.exit(this.containerState.type)}function wP(e,t,n){const r=this;return ue(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ae(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Md={name:"setextUnderline",resolveTo:kP,tokenize:SP};function kP(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function SP(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ae(c)?ue(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const CP={tokenize:jP};function jP(e){const t=this,n=e.attempt(Ei,r,e.attempt(this.parser.constructs.flowInitial,i,ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(AT,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const EP={resolveAll:sg()},NP=ig("string"),TP=ig("text");function ig(e){return{resolveAll:sg(e==="text"?PP:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function sg(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function PP(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const AP={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Jm},_P={91:OT},RP={[-2]:Po,[-1]:Po,32:Po},MP={35:VT,42:ts,45:[Md,ts],60:HT,61:Md,95:ts,96:_d,126:_d},DP={38:Zm,92:Qm},OP={[-5]:Ao,[-4]:Ao,[-3]:Ao,33:cP,38:Zm,42:Pa,60:[dT,QT],91:dP,92:[BT,Qm],93:Ql,95:Pa,96:CT},IP={null:[Pa,EP]},LP={null:[42,95]},FP={null:[]},BP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LP,contentInitial:_P,disable:FP,document:AP,flow:MP,flowInitial:RP,insideSpan:IP,string:DP,text:OP},Symbol.toStringTag,{value:"Module"}));function zP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:A(k),check:A(S),consume:w,enter:C,exit:E,interrupt:A(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function f(D){return o=At(o,D),y(),o[o.length-1]!==null?[]:(T(t,0),c.events=Hs(s,c.events,c),c.events)}function h(D,P){return $P(p(D),P)}function p(D){return VP(o,D)}function g(){const{_bufferIndex:D,_index:P,line:_,column:L,offset:I}=r;return{_bufferIndex:D,_index:P,line:_,column:L,offset:I}}function b(D){i[D.line]=D.column,N()}function y(){let D;for(;r._index<o.length;){const P=o[r._index];if(typeof P=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<P.length;)x(P.charCodeAt(r._bufferIndex));else x(P)}}function x(D){u=u(D)}function w(D){Z(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,N()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function C(D,P){const _=P||{};return _.type=D,_.start=g(),c.events.push(["enter",_,c]),a.push(_),_}function E(D){const P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function k(D,P){T(D,P.from)}function S(D,P){P.restore()}function A(D,P){return _;function _(L,I,H){let M,$,z,v;return Array.isArray(L)?ne(L):"tokenize"in L?ne([L]):U(L);function U(W){return Le;function Le(Ce){const Re=Ce!==null&&W[Ce],ge=Ce!==null&&W.null,me=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return ne(me)(Ce)}}function ne(W){return M=W,$=0,W.length===0?H:j(W[$])}function j(W){return Le;function Le(Ce){return v=R(),z=W,W.partial||(c.currentConstruct=W),W.name&&c.parser.constructs.disable.null.includes(W.name)?X():W.tokenize.call(P?Object.assign(Object.create(c),P):c,l,K,X)(Ce)}}function K(W){return D(z,v),I}function X(W){return v.restore(),++$<M.length?j(M[$]):H}}}function T(D,P){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&vt(c.events,P,c.events.length-P,D.resolve(c.events.slice(P),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function R(){const D=g(),P=c.previous,_=c.currentConstruct,L=c.events.length,I=Array.from(a);return{from:L,restore:H};function H(){r=D,c.previous=P,c.currentConstruct=_,c.events.length=L,a=I,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function VP(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function $P(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
312
312
  `;break}case-3:{o=`\r
313
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function UP(e){const r={constructs:Xm([BP,...(e||{}).extensions||[]]),content:i(iT),defined:[],document:i(oT),flow:i(CP),lazy:{},string:i(NP),text:i(TP)};return r;function i(s){return o;function o(a){return zP(r,s,a)}}}function WP(e){for(;!tg(e););return e}const Od=/[\0\t\n\r]/g;function HP(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(Od.lastIndex=f,c=Od.exec(s),h=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(h),!c){t=s.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const qP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KP(e){return e.replace(qP,GP)}function GP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Jm(n.slice(s?2:1),s?16:10)}return Jl(n)||e}const ag={}.hasOwnProperty;function YP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),XP(n)(WP(UP(n).document().write(HP()(e,t,!0))))}function XP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Y),autolinkProtocol:R,autolinkEmail:R,atxHeading:s(fe),blockQuote:s(ge),characterEscape:R,characterReference:R,codeFenced:s(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(me,o),codeText:s(je,o),codeTextData:R,data:R,codeFlowValue:R,definition:s(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(de),hardBreakEscape:s(Ne),hardBreakTrailing:s(Ne),htmlFlow:s(nt,o),htmlFlowData:R,htmlText:s(nt,o),htmlTextData:R,image:s(Je),label:o,link:s(Y),listItem:s(ut),listItemValue:h,listOrdered:s($e,f),listUnordered:s($e),paragraph:s(Qe),reference:j,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(fe),strong:s(Te),thematicBreak:s(Fe)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:Re,autolinkProtocol:Ce,blockQuote:l(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:W,characterReference:Le,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:l(x),codeText:l(I),codeTextData:N,data:N,definition:l(),definitionDestinationString:E,definitionLabelString:w,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(P),hardBreakTrailing:l(P),htmlFlow:l(_),htmlFlowData:N,htmlText:l(L),htmlTextData:N,image:l(M),label:z,labelText:$,lineEnding:D,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:K,resourceDestinationString:v,resourceTitleString:U,resource:ne,setextHeading:l(T),setextHeadingLineSequence:A,setextHeadingText:S,strong:l(),thematicBreak:l()}};lg(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let B={type:"root",children:[]};const G={stack:[B],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},J=[];let re=-1;for(;++re<O.length;)if(O[re][1].type==="listOrdered"||O[re][1].type==="listUnordered")if(O[re][0]==="enter")J.push(re);else{const he=J.pop();re=i(O,he,re)}for(re=-1;++re<O.length;){const he=t[O[re][0]];ag.call(he,O[re][1].type)&&he[O[re][1].type].call(Object.assign({sliceSerialize:O[re][2].sliceSerialize},G),O[re][1])}if(G.tokenStack.length>0){const he=G.tokenStack[G.tokenStack.length-1];(he[1]||Id).call(G,void 0,he[0])}for(B.position={start:bn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:bn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re<t.transforms.length;)B=t.transforms[re](B)||B;return B}function i(O,B,G){let J=B-1,re=-1,he=!1,Ue,We,it,Be;for(;++J<=G;){const xe=O[J];switch(xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xe[0]==="enter"?re++:re--,Be=void 0;break}case"lineEndingBlank":{xe[0]==="enter"&&(Ue&&!Be&&!re&&!it&&(it=J),Be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Be=void 0}if(!re&&xe[0]==="enter"&&xe[1].type==="listItemPrefix"||re===-1&&xe[0]==="exit"&&(xe[1].type==="listUnordered"||xe[1].type==="listOrdered")){if(Ue){let He=J;for(We=void 0;He--;){const ve=O[He];if(ve[1].type==="lineEnding"||ve[1].type==="lineEndingBlank"){if(ve[0]==="exit")continue;We&&(O[We][1].type="lineEndingBlank",he=!0),ve[1].type="lineEnding",We=He}else if(!(ve[1].type==="linePrefix"||ve[1].type==="blockQuotePrefix"||ve[1].type==="blockQuotePrefixWhitespace"||ve[1].type==="blockQuoteMarker"||ve[1].type==="listItemIndent"))break}it&&(!We||it<We)&&(Ue._spread=!0),Ue.end=Object.assign({},We?O[We][1].start:xe[1].end),O.splice(We||J,0,["exit",Ue,xe[2]]),J++,G++}if(xe[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},xe[1].start),end:void 0};Ue=He,O.splice(J,0,["enter",He,xe[2]]),J++,G++,it=void 0,Be=!0}}}return O[B][1]._spread=he,G}function s(O,B){return G;function G(J){a.call(this,O(J),J),B&&B.call(this,J)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(O,B,G){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,G||void 0]),O.position={start:bn(B.start),end:void 0}}function l(O){return B;function B(G){O&&O.call(this,G),c.call(this,G)}}function c(O,B){const G=this.stack.pop(),J=this.tokenStack.pop();if(J)J[0].type!==O.type&&(B?B.call(this,O,J[0]):(J[1]||Id).call(this,O,J[0]));else throw new Error("Cannot close `"+O.type+"` ("+ti({start:O.start,end:O.end})+"): it’s not open");G.position.end=bn(O.end)}function u(){return Xl(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(O){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function g(){const O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function w(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Ft(this.sliceSerialize(O)).toLowerCase()}function C(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function E(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function k(O){const B=this.stack[this.stack.length-1];if(!B.depth){const G=this.sliceSerialize(O).length;B.depth=G}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(O){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function R(O){const G=this.stack[this.stack.length-1].children;let J=G[G.length-1];(!J||J.type!=="text")&&(J=De(),J.position={start:bn(O.start),end:void 0},G.push(J)),this.stack.push(J)}function N(O){const B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=bn(O.end)}function D(O){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=B.children[B.children.length-1];G.position.end=bn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(R.call(this,O),N.call(this,O))}function P(){this.data.atHardBreak=!0}function _(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function L(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function I(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function H(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function M(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function $(O){const B=this.sliceSerialize(O),G=this.stack[this.stack.length-2];G.label=KP(B),G.identifier=Ft(B).toLowerCase()}function z(){const O=this.stack[this.stack.length-1],B=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const J=O.children;G.children=J}else G.alt=B}function v(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function U(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function ne(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function K(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Ft(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function X(O){this.data.characterReferenceType=O.type}function W(O){const B=this.sliceSerialize(O),G=this.data.characterReferenceType;let J;G?(J=Jm(B,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):J=Jl(B);const re=this.stack[this.stack.length-1];re.value+=J}function Le(O){const B=this.stack.pop();B.position.end=bn(O.end)}function Ce(O){N.call(this,O);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function Re(O){N.call(this,O);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function ge(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function fe(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function nt(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function Y(){return{type:"link",title:null,url:"",children:[]}}function $e(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function ut(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function Te(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function Fe(){return{type:"thematicBreak"}}}function bn(e){return{line:e.line,column:e.column,offset:e.offset}}function lg(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?lg(e,r):JP(e,r)}}function JP(e,t){let n;for(n in t)if(ag.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Id(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ti({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ti({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ti({start:t.start,end:t.end})+") is still open")}function QP(e){const t=this;t.parser=n;function n(r){return YP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
313
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function UP(e){const r={constructs:Ym([BP,...(e||{}).extensions||[]]),content:i(iT),defined:[],document:i(oT),flow:i(CP),lazy:{},string:i(NP),text:i(TP)};return r;function i(s){return o;function o(a){return zP(r,s,a)}}}function WP(e){for(;!eg(e););return e}const Dd=/[\0\t\n\r]/g;function HP(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(Dd.lastIndex=f,c=Dd.exec(s),h=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(h),!c){t=s.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const qP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KP(e){return e.replace(qP,GP)}function GP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Xm(n.slice(s?2:1),s?16:10)}return Jl(n)||e}const og={}.hasOwnProperty;function YP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),XP(n)(WP(UP(n).document().write(HP()(e,t,!0))))}function XP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Y),autolinkProtocol:R,autolinkEmail:R,atxHeading:s(fe),blockQuote:s(ge),characterEscape:R,characterReference:R,codeFenced:s(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(me,o),codeText:s(je,o),codeTextData:R,data:R,codeFlowValue:R,definition:s(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(de),hardBreakEscape:s(Ne),hardBreakTrailing:s(Ne),htmlFlow:s(nt,o),htmlFlowData:R,htmlText:s(nt,o),htmlTextData:R,image:s(Je),label:o,link:s(Y),listItem:s(ut),listItemValue:h,listOrdered:s($e,f),listUnordered:s($e),paragraph:s(Qe),reference:j,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(fe),strong:s(Te),thematicBreak:s(Fe)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:Re,autolinkProtocol:Ce,blockQuote:l(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:W,characterReference:Le,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:l(x),codeText:l(I),codeTextData:N,data:N,definition:l(),definitionDestinationString:E,definitionLabelString:w,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(P),hardBreakTrailing:l(P),htmlFlow:l(_),htmlFlowData:N,htmlText:l(L),htmlTextData:N,image:l(M),label:z,labelText:$,lineEnding:D,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:K,resourceDestinationString:v,resourceTitleString:U,resource:ne,setextHeading:l(T),setextHeadingLineSequence:A,setextHeadingText:S,strong:l(),thematicBreak:l()}};ag(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let B={type:"root",children:[]};const G={stack:[B],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},J=[];let re=-1;for(;++re<O.length;)if(O[re][1].type==="listOrdered"||O[re][1].type==="listUnordered")if(O[re][0]==="enter")J.push(re);else{const he=J.pop();re=i(O,he,re)}for(re=-1;++re<O.length;){const he=t[O[re][0]];og.call(he,O[re][1].type)&&he[O[re][1].type].call(Object.assign({sliceSerialize:O[re][2].sliceSerialize},G),O[re][1])}if(G.tokenStack.length>0){const he=G.tokenStack[G.tokenStack.length-1];(he[1]||Od).call(G,void 0,he[0])}for(B.position={start:bn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:bn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re<t.transforms.length;)B=t.transforms[re](B)||B;return B}function i(O,B,G){let J=B-1,re=-1,he=!1,Ue,We,it,Be;for(;++J<=G;){const xe=O[J];switch(xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xe[0]==="enter"?re++:re--,Be=void 0;break}case"lineEndingBlank":{xe[0]==="enter"&&(Ue&&!Be&&!re&&!it&&(it=J),Be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Be=void 0}if(!re&&xe[0]==="enter"&&xe[1].type==="listItemPrefix"||re===-1&&xe[0]==="exit"&&(xe[1].type==="listUnordered"||xe[1].type==="listOrdered")){if(Ue){let He=J;for(We=void 0;He--;){const ve=O[He];if(ve[1].type==="lineEnding"||ve[1].type==="lineEndingBlank"){if(ve[0]==="exit")continue;We&&(O[We][1].type="lineEndingBlank",he=!0),ve[1].type="lineEnding",We=He}else if(!(ve[1].type==="linePrefix"||ve[1].type==="blockQuotePrefix"||ve[1].type==="blockQuotePrefixWhitespace"||ve[1].type==="blockQuoteMarker"||ve[1].type==="listItemIndent"))break}it&&(!We||it<We)&&(Ue._spread=!0),Ue.end=Object.assign({},We?O[We][1].start:xe[1].end),O.splice(We||J,0,["exit",Ue,xe[2]]),J++,G++}if(xe[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},xe[1].start),end:void 0};Ue=He,O.splice(J,0,["enter",He,xe[2]]),J++,G++,it=void 0,Be=!0}}}return O[B][1]._spread=he,G}function s(O,B){return G;function G(J){a.call(this,O(J),J),B&&B.call(this,J)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(O,B,G){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,G||void 0]),O.position={start:bn(B.start),end:void 0}}function l(O){return B;function B(G){O&&O.call(this,G),c.call(this,G)}}function c(O,B){const G=this.stack.pop(),J=this.tokenStack.pop();if(J)J[0].type!==O.type&&(B?B.call(this,O,J[0]):(J[1]||Od).call(this,O,J[0]));else throw new Error("Cannot close `"+O.type+"` ("+ti({start:O.start,end:O.end})+"): it’s not open");G.position.end=bn(O.end)}function u(){return Xl(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(O){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function g(){const O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function w(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Ft(this.sliceSerialize(O)).toLowerCase()}function C(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function E(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function k(O){const B=this.stack[this.stack.length-1];if(!B.depth){const G=this.sliceSerialize(O).length;B.depth=G}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(O){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function R(O){const G=this.stack[this.stack.length-1].children;let J=G[G.length-1];(!J||J.type!=="text")&&(J=De(),J.position={start:bn(O.start),end:void 0},G.push(J)),this.stack.push(J)}function N(O){const B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=bn(O.end)}function D(O){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=B.children[B.children.length-1];G.position.end=bn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(R.call(this,O),N.call(this,O))}function P(){this.data.atHardBreak=!0}function _(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function L(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function I(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function H(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function M(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function $(O){const B=this.sliceSerialize(O),G=this.stack[this.stack.length-2];G.label=KP(B),G.identifier=Ft(B).toLowerCase()}function z(){const O=this.stack[this.stack.length-1],B=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const J=O.children;G.children=J}else G.alt=B}function v(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function U(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function ne(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function K(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Ft(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function X(O){this.data.characterReferenceType=O.type}function W(O){const B=this.sliceSerialize(O),G=this.data.characterReferenceType;let J;G?(J=Xm(B,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):J=Jl(B);const re=this.stack[this.stack.length-1];re.value+=J}function Le(O){const B=this.stack.pop();B.position.end=bn(O.end)}function Ce(O){N.call(this,O);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function Re(O){N.call(this,O);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function ge(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function fe(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function nt(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function Y(){return{type:"link",title:null,url:"",children:[]}}function $e(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function ut(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function Te(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function Fe(){return{type:"thematicBreak"}}}function bn(e){return{line:e.line,column:e.column,offset:e.offset}}function ag(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ag(e,r):JP(e,r)}}function JP(e,t){let n;for(n in t)if(og.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Od(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ti({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ti({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ti({start:t.start,end:t.end})+") is still open")}function QP(e){const t=this;t.parser=n;function n(r){return YP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
314
314
  `}]}function tA(e,t){const n=t.value?t.value+`
315
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function nA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=_r(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function sA(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function cg(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function aA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return cg(e,t);const i={src:_r(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function lA(e,t){const n={src:_r(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function uA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return cg(e,t);const i={href:_r(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function dA(e,t){const n={href:_r(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fA(e,t,n){const r=e.all(t),i=n?hA(n):ug(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
315
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function nA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=_r(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function sA(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lg(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function aA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lg(e,t);const i={src:_r(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function lA(e,t){const n={src:_r(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function uA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lg(e,t);const i={href:_r(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function dA(e,t){const n={href:_r(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fA(e,t,n){const r=e.all(t),i=n?hA(n):cg(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
316
316
  `}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
317
- `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function hA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ug(n[r])}return t}function ug(e){const t=e.spread;return t??e.children.length>1}function pA(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function mA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yA(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=ql(t.children[1]),l=Um(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function bA(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function vA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ld=9,Fd=32;function wA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Bd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Bd(t.slice(i),i>0,!1)),s.join("")}function Bd(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Ld||s===Fd;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Ld||s===Fd;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function kA(e,t){const n={type:"text",value:wA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function SA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const CA={blockquote:ZP,break:eA,code:tA,delete:nA,emphasis:rA,footnoteReference:iA,heading:sA,html:oA,imageReference:aA,image:lA,inlineCode:cA,linkReference:uA,link:dA,listItem:fA,list:pA,paragraph:mA,root:gA,strong:xA,table:yA,tableCell:vA,tableRow:bA,text:kA,thematicBreak:SA,toml:zi,yaml:zi,definition:zi,footnoteDefinition:zi};function zi(){}const dg=-1,qs=0,ri=1,ws=2,Zl=3,ec=4,tc=5,nc=6,fg=7,hg=8,zd=typeof self=="object"?self:globalThis,jA=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case qs:case dg:return n(o,i);case ri:{const a=n([],i);for(const l of o)a.push(r(l));return a}case ws:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Zl:return n(new Date(o),i);case ec:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case tc:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case nc:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case fg:{const{name:a,message:l}=o;return n(new zd[a](l),i)}case hg:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new zd[s](o),i)};return r},Vd=e=>jA(new Map,e)(0),er="",{toString:EA}={},{keys:NA}=Object,zr=e=>{const t=typeof e;if(t!=="object"||!e)return[qs,t];const n=EA.call(e).slice(8,-1);switch(n){case"Array":return[ri,er];case"Object":return[ws,er];case"Date":return[Zl,er];case"RegExp":return[ec,er];case"Map":return[tc,er];case"Set":return[nc,er];case"DataView":return[ri,n]}return n.includes("Array")?[ri,n]:n.includes("Error")?[fg,n]:[ws,n]},Vi=([e,t])=>e===qs&&(t==="function"||t==="symbol"),TA=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=zr(o);switch(a){case qs:{let u=o;switch(l){case"bigint":a=hg,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([dg],o)}return i([a,u],o)}case ri:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),i([l,[...h]],o)}const u=[],f=i([a,u],o);for(const h of o)u.push(s(h));return f}case ws:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],f=i([a,u],o);for(const h of NA(o))(e||!Vi(zr(o[h])))&&u.push([s(h),s(o[h])]);return f}case Zl:return i([a,o.toISOString()],o);case ec:{const{source:u,flags:f}=o;return i([a,{source:u,flags:f}],o)}case tc:{const u=[],f=i([a,u],o);for(const[h,p]of o)(e||!(Vi(zr(h))||Vi(zr(p))))&&u.push([s(h),s(p)]);return f}case nc:{const u=[],f=i([a,u],o);for(const h of o)(e||!Vi(zr(h)))&&u.push(s(h));return f}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},$d=(e,{json:t,lossy:n}={})=>{const r=[];return TA(!(t||n),!!t,new Map,r)(e),r},ks=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Vd($d(e,t)):structuredClone(e):(e,t)=>Vd($d(e,t));function PA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function AA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function _A(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||PA,r=e.options.footnoteBackLabel||AA,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=_r(f.toLowerCase());let p=0;const g=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++p<=b;){g.length>0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,p);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ks(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
317
+ `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function hA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=cg(n[r])}return t}function cg(e){const t=e.spread;return t??e.children.length>1}function pA(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function mA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yA(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=ql(t.children[1]),l=$m(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function bA(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function vA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Id=9,Ld=32;function wA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Fd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Fd(t.slice(i),i>0,!1)),s.join("")}function Fd(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Id||s===Ld;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Id||s===Ld;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function kA(e,t){const n={type:"text",value:wA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function SA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const CA={blockquote:ZP,break:eA,code:tA,delete:nA,emphasis:rA,footnoteReference:iA,heading:sA,html:oA,imageReference:aA,image:lA,inlineCode:cA,linkReference:uA,link:dA,listItem:fA,list:pA,paragraph:mA,root:gA,strong:xA,table:yA,tableCell:vA,tableRow:bA,text:kA,thematicBreak:SA,toml:zi,yaml:zi,definition:zi,footnoteDefinition:zi};function zi(){}const ug=-1,qs=0,ri=1,ws=2,Zl=3,ec=4,tc=5,nc=6,dg=7,fg=8,Bd=typeof self=="object"?self:globalThis,jA=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case qs:case ug:return n(o,i);case ri:{const a=n([],i);for(const l of o)a.push(r(l));return a}case ws:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Zl:return n(new Date(o),i);case ec:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case tc:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case nc:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case dg:{const{name:a,message:l}=o;return n(new Bd[a](l),i)}case fg:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new Bd[s](o),i)};return r},zd=e=>jA(new Map,e)(0),er="",{toString:EA}={},{keys:NA}=Object,zr=e=>{const t=typeof e;if(t!=="object"||!e)return[qs,t];const n=EA.call(e).slice(8,-1);switch(n){case"Array":return[ri,er];case"Object":return[ws,er];case"Date":return[Zl,er];case"RegExp":return[ec,er];case"Map":return[tc,er];case"Set":return[nc,er];case"DataView":return[ri,n]}return n.includes("Array")?[ri,n]:n.includes("Error")?[dg,n]:[ws,n]},Vi=([e,t])=>e===qs&&(t==="function"||t==="symbol"),TA=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=zr(o);switch(a){case qs:{let u=o;switch(l){case"bigint":a=fg,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([ug],o)}return i([a,u],o)}case ri:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),i([l,[...h]],o)}const u=[],f=i([a,u],o);for(const h of o)u.push(s(h));return f}case ws:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],f=i([a,u],o);for(const h of NA(o))(e||!Vi(zr(o[h])))&&u.push([s(h),s(o[h])]);return f}case Zl:return i([a,o.toISOString()],o);case ec:{const{source:u,flags:f}=o;return i([a,{source:u,flags:f}],o)}case tc:{const u=[],f=i([a,u],o);for(const[h,p]of o)(e||!(Vi(zr(h))||Vi(zr(p))))&&u.push([s(h),s(p)]);return f}case nc:{const u=[],f=i([a,u],o);for(const h of o)(e||!Vi(zr(h)))&&u.push(s(h));return f}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},Vd=(e,{json:t,lossy:n}={})=>{const r=[];return TA(!(t||n),!!t,new Map,r)(e),r},ks=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?zd(Vd(e,t)):structuredClone(e):(e,t)=>zd(Vd(e,t));function PA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function AA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function _A(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||PA,r=e.options.footnoteBackLabel||AA,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=_r(f.toLowerCase());let p=0;const g=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++p<=b;){g.length>0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,p);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ks(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
318
318
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
319
- `}]}}const Ks=(function(e){if(e==null)return OA;if(typeof e=="function")return Gs(e);if(typeof e=="object")return Array.isArray(e)?RA(e):MA(e);if(typeof e=="string")return DA(e);throw new Error("Expected function, string, or object as test")});function RA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ks(e[n]);return Gs(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function MA(e){const t=e;return Gs(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function DA(e){return Gs(t);function t(n){return n&&n.type===e}}function Gs(e){return t;function t(n,r,i){return!!(IA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function OA(){return!0}function IA(e){return e!==null&&typeof e=="object"&&"type"in e}const pg=[],LA=!0,Aa=!1,FA="skip";function mg(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Ks(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=pg,g,b,y;if((!t||s(l,c,u[u.length-1]||void 0))&&(p=BA(n(l,u)),p[0]===Aa))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==FA)for(b=(r?x.children.length:-1)+o,y=u.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(g=a(w,b,y)(),g[0]===Aa)return g;b=typeof g[1]=="number"?g[1]:b+o}}return p}}}function BA(e){return Array.isArray(e)?e:typeof e=="number"?[LA,e]:e==null?pg:[e]}function rc(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),mg(e,s,a,i);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const _a={}.hasOwnProperty,zA={};function VA(e,t){const n=t||zA,r=new Map,i=new Map,s=new Map,o={...CA,...n.handlers},a={all:c,applyData:UA,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:$A,wrap:HA};return rc(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(_a.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:b,...y}=u,x=ks(y);return x.children=a.all(u),x}return ks(u)}return(a.options.unknownHandler||WA)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const g=a.one(h[p],u);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Ud(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=Ud(b.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function $A(e,t){e.position&&(t.position=AN(e))}function UA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,ks(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function WA(e,t){const n=t.data||{},r="value"in t&&!(_a.call(n,"hProperties")||_a.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 HA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
319
+ `}]}}const Ks=(function(e){if(e==null)return OA;if(typeof e=="function")return Gs(e);if(typeof e=="object")return Array.isArray(e)?RA(e):MA(e);if(typeof e=="string")return DA(e);throw new Error("Expected function, string, or object as test")});function RA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ks(e[n]);return Gs(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function MA(e){const t=e;return Gs(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function DA(e){return Gs(t);function t(n){return n&&n.type===e}}function Gs(e){return t;function t(n,r,i){return!!(IA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function OA(){return!0}function IA(e){return e!==null&&typeof e=="object"&&"type"in e}const hg=[],LA=!0,Aa=!1,FA="skip";function pg(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Ks(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=hg,g,b,y;if((!t||s(l,c,u[u.length-1]||void 0))&&(p=BA(n(l,u)),p[0]===Aa))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==FA)for(b=(r?x.children.length:-1)+o,y=u.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(g=a(w,b,y)(),g[0]===Aa)return g;b=typeof g[1]=="number"?g[1]:b+o}}return p}}}function BA(e){return Array.isArray(e)?e:typeof e=="number"?[LA,e]:e==null?hg:[e]}function rc(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),pg(e,s,a,i);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const _a={}.hasOwnProperty,zA={};function VA(e,t){const n=t||zA,r=new Map,i=new Map,s=new Map,o={...CA,...n.handlers},a={all:c,applyData:UA,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:$A,wrap:HA};return rc(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(_a.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:b,...y}=u,x=ks(y);return x.children=a.all(u),x}return ks(u)}return(a.options.unknownHandler||WA)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const g=a.one(h[p],u);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=$d(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=$d(b.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function $A(e,t){e.position&&(t.position=AN(e))}function UA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,ks(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function WA(e,t){const n=t.data||{},r="value"in t&&!(_a.call(n,"hProperties")||_a.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 HA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
320
320
  `});++r<e.length;)r&&n.push({type:"text",value:`
321
321
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
322
- `}),n}function Ud(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wd(e,t){const n=VA(e,t),r=n.one(e,void 0),i=_A(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
323
- `},i),s}function qA(e,t){return e&&"run"in e?async function(n,r){const i=Wd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wd(n,{file:r,...e||t})}}function Hd(e){if(e)throw e}var _o,qd;function KA(){if(qd)return _o;qd=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return _o=function l(){var c,u,f,h,p,g,b=arguments[0],y=1,x=arguments.length,w=!1;for(typeof b=="boolean"&&(w=b,b=arguments[1]||{},y=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});y<x;++y)if(c=arguments[y],c!=null)for(u in c)f=a(b,u),h=a(c,u),b!==h&&(w&&h&&(s(h)||(p=i(h)))?(p?(p=!1,g=f&&i(f)?f:[]):g=f&&s(f)?f:{},o(b,{name:u,newValue:l(w,g,h)})):typeof h<"u"&&o(b,{name:u,newValue:h}));return b},_o}var GA=KA();const Ro=Ia(GA);function Ra(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YA(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,u?XA(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function XA(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Wt={basename:JA,dirname:QA,extname:ZA,join:e2,sep:"/"};function JA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ni(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function QA(e){if(Ni(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||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ZA(e){Ni(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function e2(...e){let t=-1,n;for(;++t<e.length;)Ni(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":t2(n)}function t2(e){Ni(e);const t=e.codePointAt(0)===47;let n=n2(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function n2(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=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,s=0}else a===46&&s>-1?s++:s=-1}return n}function Ni(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const r2={cwd:i2};function i2(){return"/"}function Ma(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function s2(e){if(typeof e=="string")e=new URL(e);else if(!Ma(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return o2(e)}function o2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Mo=["history","path","basename","stem","extname","dirname"];class gg{constructor(t){let n;t?Ma(t)?n={path:t}:typeof t=="string"||a2(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":r2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mo.length;){const s=Mo[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Mo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Wt.basename(this.path):void 0}set basename(t){Oo(t,"basename"),Do(t,"basename"),this.path=Wt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wt.dirname(this.path):void 0}set dirname(t){Kd(this.basename,"dirname"),this.path=Wt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wt.extname(this.path):void 0}set extname(t){if(Do(t,"extname"),Kd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ma(t)&&(t=s2(t)),Oo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wt.basename(this.path,this.extname):void 0}set stem(t){Oo(t,"stem"),Do(t,"stem"),this.path=Wt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ct(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Do(e,t){if(e&&e.includes(Wt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wt.sep+"`")}function Oo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Kd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function a2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l2=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),c2={}.hasOwnProperty;class ic extends l2{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=YA()}copy(){const t=new ic;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ro(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fo("data",this.frozen),this.namespace[t]=n,this):c2.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=$i(t),r=this.parser||this.Parser;return Io("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Io("process",this.parser||this.Parser),Lo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=$i(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,g=r.stringify(p,h);f2(g)?h.value=g:h.result=g,c(u,h)});function c(u,f){u||!f?o(u):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Io("processSync",this.parser||this.Parser),Lo("processSync",this.compiler||this.Compiler),this.process(t,i),Yd("processSync","process",n),r;function i(s,o){n=!0,Hd(s),r=o}}run(t,n,r){Gd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=$i(n);i.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Yd("runSync","run",r),i;function s(o,a){Hd(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=$i(n),i=this.compiler||this.Compiler;return Lo("stringify",i),Gd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Fo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new 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");a(c.plugins),c.settings&&(i.settings=Ro(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];s(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const b=r[h][1];Ra(b)&&Ra(p)&&(p=Ro(!0,b,p)),r[h]=[c,p,...g]}}}}const u2=new ic().freeze();function Io(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gd(e){if(!Ra(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Yd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $i(e){return d2(e)?e:new gg(e)}function d2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function f2(e){return typeof e=="string"||h2(e)}function h2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const p2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xd=[],Jd={allowDangerousHtml:!0},m2=/^(https?|ircs?|mailto|xmpp)$/i,g2=[{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 x2(e){const t=y2(e),n=b2(e);return v2(t.runSync(t.parse(n),n),e)}function y2(e){const t=e.rehypePlugins||Xd,n=e.remarkPlugins||Xd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jd}:Jd;return u2().use(QP).use(n).use(qA,r).use(t)}function b2(e){const t=e.children||"",n=new gg;return typeof t=="string"&&(n.value=t),n}function v2(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||w2;for(const u of g2)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+p2+u.id,void 0);return rc(e,c),ON(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in To)if(Object.hasOwn(To,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],b=To[p];(b===null||b.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function w2(e){const 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||m2.test(e.slice(0,t))?e:""}function Qd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function k2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function S2(e,t,n){const i=Ks((n||{}).ignore||[]),s=C2(t);let o=-1;for(;++o<s.length;)mg(e,"text",a);function a(c,u){let f=-1,h;for(;++f<u.length;){const p=u[f],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return l(c,u)}function l(c,u){const f=u[u.length-1],h=s[o][0],p=s[o][1];let g=0;const y=f.children.indexOf(c);let x=!1,w=[];h.lastIndex=0;let C=h.exec(c.value);for(;C;){const E=C.index,k={index:C.index,input:C.input,stack:[...u,c]};let S=p(...C,k);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=E+1:(g!==E&&w.push({type:"text",value:c.value.slice(g,E)}),Array.isArray(S)?w.push(...S):S&&w.push(S),g=E+C[0].length,x=!0),!h.global)break;C=h.exec(c.value)}return x?(g<c.value.length&&w.push({type:"text",value:c.value.slice(g)}),f.children.splice(y,1,...w)):w=[c],y+w.length}}function C2(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([j2(i[0]),E2(i[1])])}return t}function j2(e){return typeof e=="string"?new RegExp(k2(e),"g"):e}function E2(e){return typeof e=="function"?e:function(){return e}}const Bo="phrasing",zo=["autolink","link","image","label"];function N2(){return{transforms:[D2],enter:{literalAutolink:P2,literalAutolinkEmail:Vo,literalAutolinkHttp:Vo,literalAutolinkWww:Vo},exit:{literalAutolink:M2,literalAutolinkEmail:R2,literalAutolinkHttp:A2,literalAutolinkWww:_2}}}function T2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bo,notInConstruct:zo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bo,notInConstruct:zo},{character:":",before:"[ps]",after:"\\/",inConstruct:Bo,notInConstruct:zo}]}}function P2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vo(e){this.config.enter.autolinkProtocol.call(this,e)}function A2(e){this.config.exit.autolinkProtocol.call(this,e)}function _2(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function R2(e){this.config.exit.autolinkEmail.call(this,e)}function M2(e){this.exit(e)}function D2(e){S2(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,O2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),I2]],{ignore:["link","linkReference"]})}function O2(e,t,n,r,i){let s="";if(!xg(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!L2(n)))return!1;const o=F2(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function I2(e,t,n,r){return!xg(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function L2(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function F2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Qd(e,"(");let s=Qd(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function xg(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Hn(n)||Ws(n))&&(!t||n!==47)}yg.peek=K2;function B2(){this.buffer()}function z2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V2(){this.buffer()}function $2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function U2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ft(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W2(e){this.exit(e)}function H2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ft(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q2(e){this.exit(e)}function K2(){return"["}function yg(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function G2(){return{enter:{gfmFootnoteCallString:B2,gfmFootnoteCall:z2,gfmFootnoteDefinitionLabelString:V2,gfmFootnoteDefinition:$2},exit:{gfmFootnoteCallString:U2,gfmFootnoteCall:W2,gfmFootnoteDefinitionLabelString:H2,gfmFootnoteDefinition:q2}}}function Y2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
324
- `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?bg:X2))),c(),l}}function X2(e,t,n){return t===0?e:bg(e,t,n)}function bg(e,t,n){return(n?"":" ")+e}const J2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vg.peek=n_;function Q2(){return{canContainEols:["delete"],enter:{strikethrough:e_},exit:{strikethrough:t_}}}function Z2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:J2}],handlers:{delete:vg}}}function e_(e){this.enter({type:"delete",children:[]},e)}function t_(e){this.exit(e)}function vg(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function n_(){return"~"}function r_(e){return e.length}function i_(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||r_,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const b=[],y=[];let x=-1;for(e[u].length>c&&(c=e[u].length);++x<e[u].length;){const w=s_(e[u][x]);if(n.alignDelimiters!==!1){const C=i(w);y[x]=C,(l[x]===void 0||C>l[x])&&(l[x]=C)}b.push(w)}o[u]=b,a[u]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)s[f]=Zd(r[f]);else{const b=Zd(r);for(;++f<c;)s[f]=b}f=-1;const h=[],p=[];for(;++f<c;){const b=s[f];let y="",x="";b===99?(y=":",x=":"):b===108?y=":":b===114&&(x=":");let w=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-x.length);const C=y+"-".repeat(w)+x;n.alignDelimiters!==!1&&(w=y.length+w+x.length,w>l[f]&&(l[f]=w),p[f]=w),h[f]=C}o.splice(1,0,h),a.splice(1,0,p),u=-1;const g=[];for(;++u<o.length;){const b=o[u],y=a[u];f=-1;const x=[];for(;++f<c;){const w=b[f]||"";let C="",E="";if(n.alignDelimiters!==!1){const k=l[f]-(y[f]||0),S=s[f];S===114?C=" ".repeat(k):S===99?k%2?(C=" ".repeat(k/2+.5),E=" ".repeat(k/2-.5)):(C=" ".repeat(k/2),E=C):E=" ".repeat(k)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(C),x.push(w),n.alignDelimiters!==!1&&x.push(E),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
325
- `)}function s_(e){return e==null?"":String(e)}function Zd(e){const 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 o_(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),a_);return i(),o}function a_(e,t,n){return">"+(n?"":" ")+e}function l_(e,t){return ef(e,t.inConstruct,!0)&&!ef(e,t.notInConstruct,!1)}function ef(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 tf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
322
+ `}),n}function $d(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ud(e,t){const n=VA(e,t),r=n.one(e,void 0),i=_A(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
323
+ `},i),s}function qA(e,t){return e&&"run"in e?async function(n,r){const i=Ud(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ud(n,{file:r,...e||t})}}function Wd(e){if(e)throw e}var _o,Hd;function KA(){if(Hd)return _o;Hd=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return _o=function l(){var c,u,f,h,p,g,b=arguments[0],y=1,x=arguments.length,w=!1;for(typeof b=="boolean"&&(w=b,b=arguments[1]||{},y=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});y<x;++y)if(c=arguments[y],c!=null)for(u in c)f=a(b,u),h=a(c,u),b!==h&&(w&&h&&(s(h)||(p=i(h)))?(p?(p=!1,g=f&&i(f)?f:[]):g=f&&s(f)?f:{},o(b,{name:u,newValue:l(w,g,h)})):typeof h<"u"&&o(b,{name:u,newValue:h}));return b},_o}var GA=KA();const Ro=Ia(GA);function Ra(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YA(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,u?XA(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function XA(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Wt={basename:JA,dirname:QA,extname:ZA,join:e2,sep:"/"};function JA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ni(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function QA(e){if(Ni(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||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ZA(e){Ni(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function e2(...e){let t=-1,n;for(;++t<e.length;)Ni(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":t2(n)}function t2(e){Ni(e);const t=e.codePointAt(0)===47;let n=n2(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function n2(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=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,s=0}else a===46&&s>-1?s++:s=-1}return n}function Ni(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const r2={cwd:i2};function i2(){return"/"}function Ma(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function s2(e){if(typeof e=="string")e=new URL(e);else if(!Ma(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return o2(e)}function o2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Mo=["history","path","basename","stem","extname","dirname"];class mg{constructor(t){let n;t?Ma(t)?n={path:t}:typeof t=="string"||a2(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":r2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mo.length;){const s=Mo[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Mo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Wt.basename(this.path):void 0}set basename(t){Oo(t,"basename"),Do(t,"basename"),this.path=Wt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wt.dirname(this.path):void 0}set dirname(t){qd(this.basename,"dirname"),this.path=Wt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wt.extname(this.path):void 0}set extname(t){if(Do(t,"extname"),qd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ma(t)&&(t=s2(t)),Oo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wt.basename(this.path,this.extname):void 0}set stem(t){Oo(t,"stem"),Do(t,"stem"),this.path=Wt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ct(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Do(e,t){if(e&&e.includes(Wt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wt.sep+"`")}function Oo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function a2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l2=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),c2={}.hasOwnProperty;class ic extends l2{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=YA()}copy(){const t=new ic;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ro(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fo("data",this.frozen),this.namespace[t]=n,this):c2.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=$i(t),r=this.parser||this.Parser;return Io("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Io("process",this.parser||this.Parser),Lo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=$i(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,g=r.stringify(p,h);f2(g)?h.value=g:h.result=g,c(u,h)});function c(u,f){u||!f?o(u):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Io("processSync",this.parser||this.Parser),Lo("processSync",this.compiler||this.Compiler),this.process(t,i),Gd("processSync","process",n),r;function i(s,o){n=!0,Wd(s),r=o}}run(t,n,r){Kd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=$i(n);i.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Gd("runSync","run",r),i;function s(o,a){Wd(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=$i(n),i=this.compiler||this.Compiler;return Lo("stringify",i),Kd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Fo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new 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");a(c.plugins),c.settings&&(i.settings=Ro(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];s(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const b=r[h][1];Ra(b)&&Ra(p)&&(p=Ro(!0,b,p)),r[h]=[c,p,...g]}}}}const u2=new ic().freeze();function Io(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Kd(e){if(!Ra(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $i(e){return d2(e)?e:new mg(e)}function d2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function f2(e){return typeof e=="string"||h2(e)}function h2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const p2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yd=[],Xd={allowDangerousHtml:!0},m2=/^(https?|ircs?|mailto|xmpp)$/i,g2=[{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 x2(e){const t=y2(e),n=b2(e);return v2(t.runSync(t.parse(n),n),e)}function y2(e){const t=e.rehypePlugins||Yd,n=e.remarkPlugins||Yd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Xd}:Xd;return u2().use(QP).use(n).use(qA,r).use(t)}function b2(e){const t=e.children||"",n=new mg;return typeof t=="string"&&(n.value=t),n}function v2(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||w2;for(const u of g2)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+p2+u.id,void 0);return rc(e,c),ON(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in To)if(Object.hasOwn(To,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],b=To[p];(b===null||b.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function w2(e){const 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||m2.test(e.slice(0,t))?e:""}function Jd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function k2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function S2(e,t,n){const i=Ks((n||{}).ignore||[]),s=C2(t);let o=-1;for(;++o<s.length;)pg(e,"text",a);function a(c,u){let f=-1,h;for(;++f<u.length;){const p=u[f],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return l(c,u)}function l(c,u){const f=u[u.length-1],h=s[o][0],p=s[o][1];let g=0;const y=f.children.indexOf(c);let x=!1,w=[];h.lastIndex=0;let C=h.exec(c.value);for(;C;){const E=C.index,k={index:C.index,input:C.input,stack:[...u,c]};let S=p(...C,k);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=E+1:(g!==E&&w.push({type:"text",value:c.value.slice(g,E)}),Array.isArray(S)?w.push(...S):S&&w.push(S),g=E+C[0].length,x=!0),!h.global)break;C=h.exec(c.value)}return x?(g<c.value.length&&w.push({type:"text",value:c.value.slice(g)}),f.children.splice(y,1,...w)):w=[c],y+w.length}}function C2(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([j2(i[0]),E2(i[1])])}return t}function j2(e){return typeof e=="string"?new RegExp(k2(e),"g"):e}function E2(e){return typeof e=="function"?e:function(){return e}}const Bo="phrasing",zo=["autolink","link","image","label"];function N2(){return{transforms:[D2],enter:{literalAutolink:P2,literalAutolinkEmail:Vo,literalAutolinkHttp:Vo,literalAutolinkWww:Vo},exit:{literalAutolink:M2,literalAutolinkEmail:R2,literalAutolinkHttp:A2,literalAutolinkWww:_2}}}function T2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bo,notInConstruct:zo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bo,notInConstruct:zo},{character:":",before:"[ps]",after:"\\/",inConstruct:Bo,notInConstruct:zo}]}}function P2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vo(e){this.config.enter.autolinkProtocol.call(this,e)}function A2(e){this.config.exit.autolinkProtocol.call(this,e)}function _2(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function R2(e){this.config.exit.autolinkEmail.call(this,e)}function M2(e){this.exit(e)}function D2(e){S2(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,O2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),I2]],{ignore:["link","linkReference"]})}function O2(e,t,n,r,i){let s="";if(!gg(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!L2(n)))return!1;const o=F2(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function I2(e,t,n,r){return!gg(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function L2(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function F2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Jd(e,"(");let s=Jd(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function gg(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Hn(n)||Ws(n))&&(!t||n!==47)}xg.peek=K2;function B2(){this.buffer()}function z2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V2(){this.buffer()}function $2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function U2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ft(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W2(e){this.exit(e)}function H2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ft(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q2(e){this.exit(e)}function K2(){return"["}function xg(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function G2(){return{enter:{gfmFootnoteCallString:B2,gfmFootnoteCall:z2,gfmFootnoteDefinitionLabelString:V2,gfmFootnoteDefinition:$2},exit:{gfmFootnoteCallString:U2,gfmFootnoteCall:W2,gfmFootnoteDefinitionLabelString:H2,gfmFootnoteDefinition:q2}}}function Y2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
324
+ `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?yg:X2))),c(),l}}function X2(e,t,n){return t===0?e:yg(e,t,n)}function yg(e,t,n){return(n?"":" ")+e}const J2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bg.peek=n_;function Q2(){return{canContainEols:["delete"],enter:{strikethrough:e_},exit:{strikethrough:t_}}}function Z2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:J2}],handlers:{delete:bg}}}function e_(e){this.enter({type:"delete",children:[]},e)}function t_(e){this.exit(e)}function bg(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function n_(){return"~"}function r_(e){return e.length}function i_(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||r_,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const b=[],y=[];let x=-1;for(e[u].length>c&&(c=e[u].length);++x<e[u].length;){const w=s_(e[u][x]);if(n.alignDelimiters!==!1){const C=i(w);y[x]=C,(l[x]===void 0||C>l[x])&&(l[x]=C)}b.push(w)}o[u]=b,a[u]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)s[f]=Qd(r[f]);else{const b=Qd(r);for(;++f<c;)s[f]=b}f=-1;const h=[],p=[];for(;++f<c;){const b=s[f];let y="",x="";b===99?(y=":",x=":"):b===108?y=":":b===114&&(x=":");let w=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-x.length);const C=y+"-".repeat(w)+x;n.alignDelimiters!==!1&&(w=y.length+w+x.length,w>l[f]&&(l[f]=w),p[f]=w),h[f]=C}o.splice(1,0,h),a.splice(1,0,p),u=-1;const g=[];for(;++u<o.length;){const b=o[u],y=a[u];f=-1;const x=[];for(;++f<c;){const w=b[f]||"";let C="",E="";if(n.alignDelimiters!==!1){const k=l[f]-(y[f]||0),S=s[f];S===114?C=" ".repeat(k):S===99?k%2?(C=" ".repeat(k/2+.5),E=" ".repeat(k/2-.5)):(C=" ".repeat(k/2),E=C):E=" ".repeat(k)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(C),x.push(w),n.alignDelimiters!==!1&&x.push(E),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
325
+ `)}function s_(e){return e==null?"":String(e)}function Qd(e){const 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 o_(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),a_);return i(),o}function a_(e,t,n){return">"+(n?"":" ")+e}function l_(e,t){return Zd(e,t.inConstruct,!0)&&!Zd(e,t.notInConstruct,!1)}function Zd(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 ef(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
326
326
  `&&l_(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
327
327
  `}function c_(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function u_(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 d_(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function f_(e,t,n,r){const i=d_(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(u_(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,h_);return f(),h}const a=n.createTracker(r),l=i.repeat(Math.max(c_(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
328
328
  `,encode:["`"],...a.current()})),f()}return u+=a.move(`
329
329
  `),s&&(u+=a.move(s+`
330
330
  `)),u+=a.move(l),c(),u}function h_(e,t,n){return(n?"":" ")+e}function sc(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function p_(e,t,n,r){const i=sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
331
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function m_(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function pi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ss(e,t,n){const r=kr(e),i=kr(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}}wg.peek=g_;function wg(e,t,n,r){const i=m_(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ss(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=pi(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Ss(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+pi(f));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function g_(e,t,n){return n.options.emphasis||"*"}function x_(e,t){let n=!1;return rc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Aa}),!!((!e.depth||e.depth<3)&&Xl(e)&&(t.options.setext||n))}function y_(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(x_(e,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
331
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function m_(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function pi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ss(e,t,n){const r=kr(e),i=kr(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}}vg.peek=g_;function vg(e,t,n,r){const i=m_(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ss(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=pi(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Ss(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+pi(f));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function g_(e,t,n){return n.options.emphasis||"*"}function x_(e,t){let n=!1;return rc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Aa}),!!((!e.depth||e.depth<3)&&Xl(e)&&(t.options.setext||n))}function y_(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(x_(e,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
332
332
  `,after:`
333
333
  `});return f(),u(),h+`
334
334
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
335
335
  `))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
336
- `,...s.current()});return/^[\t ]/.test(c)&&(c=pi(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}kg.peek=b_;function kg(e){return e.value||""}function b_(){return"<"}Sg.peek=v_;function Sg(e,t,n,r){const i=sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function v_(){return"!"}Cg.peek=w_;function Cg(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function w_(){return"!"}jg.peek=k_;function jg(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function k_(){return"`"}function Eg(e,t){const n=Xl(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))}Ng.peek=S_;function Ng(e,t,n,r){const i=sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Eg(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=u,f}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function S_(e,t,n){return Eg(e,n)?"<":"["}Tg.peek=C_;function Tg(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function C_(){return"["}function oc(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function j_(e){const t=oc(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function E_(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Pg(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function N_(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?E_(n):oc(n);const a=e.ordered?o==="."?")":".":j_(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Pg(n)===o&&u){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function T_(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function P_(e,t,n,r){const i=T_(n);let s=n.bulletCurrent||oc(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,h,p){return h?(p?"":" ".repeat(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function A_(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const __=Ks(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function R_(e,t,n,r){return(e.children.some(function(o){return __(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function M_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ag.peek=D_;function Ag(e,t,n,r){const i=M_(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ss(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=pi(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Ss(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+pi(f));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function D_(e,t,n){return n.options.strong||"*"}function O_(e,t,n,r){return n.safe(e.value,r)}function I_(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function L_(e,t,n){const r=(Pg(n)+(n.options.ruleSpaces?" ":"")).repeat(I_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const _g={blockquote:o_,break:tf,code:f_,definition:p_,emphasis:wg,hardBreak:tf,heading:y_,html:kg,image:Sg,imageReference:Cg,inlineCode:jg,link:Ng,linkReference:Tg,list:N_,listItem:P_,paragraph:A_,root:R_,strong:Ag,text:O_,thematicBreak:L_};function F_(){return{enter:{table:B_,tableData:nf,tableHeader:nf,tableRow:V_},exit:{codeText:$_,table:z_,tableData:$o,tableHeader:$o,tableRow:$o}}}function B_(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function z_(e){this.exit(e),this.data.inTable=void 0}function V_(e){this.enter({type:"tableRow",children:[]},e)}function $o(e){this.exit(e)}function nf(e){this.enter({type:"tableCell",children:[]},e)}function $_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U_));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U_(e,t){return t==="|"?t:e}function W_(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
336
+ `,...s.current()});return/^[\t ]/.test(c)&&(c=pi(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}wg.peek=b_;function wg(e){return e.value||""}function b_(){return"<"}kg.peek=v_;function kg(e,t,n,r){const i=sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function v_(){return"!"}Sg.peek=w_;function Sg(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function w_(){return"!"}Cg.peek=k_;function Cg(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function k_(){return"`"}function jg(e,t){const n=Xl(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))}Eg.peek=S_;function Eg(e,t,n,r){const i=sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(jg(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=u,f}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function S_(e,t,n){return jg(e,n)?"<":"["}Ng.peek=C_;function Ng(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function C_(){return"["}function oc(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function j_(e){const t=oc(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function E_(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Tg(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function N_(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?E_(n):oc(n);const a=e.ordered?o==="."?")":".":j_(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Tg(n)===o&&u){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function T_(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function P_(e,t,n,r){const i=T_(n);let s=n.bulletCurrent||oc(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,h,p){return h?(p?"":" ".repeat(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function A_(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const __=Ks(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function R_(e,t,n,r){return(e.children.some(function(o){return __(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function M_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Pg.peek=D_;function Pg(e,t,n,r){const i=M_(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ss(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=pi(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Ss(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+pi(f));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function D_(e,t,n){return n.options.strong||"*"}function O_(e,t,n,r){return n.safe(e.value,r)}function I_(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function L_(e,t,n){const r=(Tg(n)+(n.options.ruleSpaces?" ":"")).repeat(I_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ag={blockquote:o_,break:ef,code:f_,definition:p_,emphasis:vg,hardBreak:ef,heading:y_,html:wg,image:kg,imageReference:Sg,inlineCode:Cg,link:Eg,linkReference:Ng,list:N_,listItem:P_,paragraph:A_,root:R_,strong:Pg,text:O_,thematicBreak:L_};function F_(){return{enter:{table:B_,tableData:tf,tableHeader:tf,tableRow:V_},exit:{codeText:$_,table:z_,tableData:$o,tableHeader:$o,tableRow:$o}}}function B_(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function z_(e){this.exit(e),this.data.inTable=void 0}function V_(e){this.enter({type:"tableRow",children:[]},e)}function $o(e){this.exit(e)}function tf(e){this.enter({type:"tableCell",children:[]},e)}function $_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U_));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U_(e,t){return t==="|"?t:e}function W_(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
337
337
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(p,g,b,y){return c(u(p,b,y),p.align)}function a(p,g,b,y){const x=f(p,b,y),w=c([x]);return w.slice(0,w.indexOf(`
338
- `))}function l(p,g,b,y){const x=b.enter("tableCell"),w=b.enter("phrasing"),C=b.containerPhrasing(p,{...y,before:s,after:s});return w(),x(),C}function c(p,g){return i_(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,b){const y=p.children;let x=-1;const w=[],C=g.enter("table");for(;++x<y.length;)w[x]=f(y[x],g,b);return C(),w}function f(p,g,b){const y=p.children;let x=-1;const w=[],C=g.enter("tableRow");for(;++x<y.length;)w[x]=l(y[x],p,g,b);return C(),w}function h(p,g,b){let y=_g.inlineCode(p,g,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function H_(){return{exit:{taskListCheckValueChecked:rf,taskListCheckValueUnchecked:rf,paragraph:K_}}}function q_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:G_}}}function rf(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function K_(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function G_(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=_g.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function Y_(){return[N2(),G2(),Q2(),F_(),H_()]}function X_(e){return{extensions:[T2(),Y2(e),Z2(),W_(e),q_()]}}const J_={tokenize:rR,partial:!0},Rg={tokenize:iR,partial:!0},Mg={tokenize:sR,partial:!0},Dg={tokenize:oR,partial:!0},Q_={tokenize:aR,partial:!0},Og={name:"wwwAutolink",tokenize:tR,previous:Lg},Ig={name:"protocolAutolink",tokenize:nR,previous:Fg},fn={name:"emailAutolink",tokenize:eR,previous:Bg},Jt={};function Z_(){return{text:Jt}}let In=48;for(;In<123;)Jt[In]=fn,In++,In===58?In=65:In===91&&(In=97);Jt[43]=fn;Jt[45]=fn;Jt[46]=fn;Jt[95]=fn;Jt[72]=[fn,Ig];Jt[104]=[fn,Ig];Jt[87]=[fn,Og];Jt[119]=[fn,Og];function eR(e,t,n){const r=this;let i,s;return o;function o(f){return!Da(f)||!Bg.call(r,r.previous)||ac(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Da(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(Q_,u,c)(f):f===45||f===95||lt(f)?(s=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return s&&i&&ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function tR(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Lg.call(r,r.previous)||ac(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(J_,e.attempt(Rg,e.attempt(Mg,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function nR(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&Fg.call(r,r.previous)&&!ac(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(ft(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?c:(s=!0,l)):n(f)}function c(f){return f===null||vs(f)||Se(f)||Hn(f)||Ws(f)?n(f):e.attempt(Rg,e.attempt(Mg,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function rR(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function iR(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Dg,l,a)(c):c===null||Se(c)||Hn(c)||c!==45&&Ws(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function sR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(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(Dg,t,s)(o):o===null||Se(o)||Hn(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function oR(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Se(a)||Hn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Se(a)||Hn(a)?t(a):r(a)}function s(a){return ft(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):ft(a)?(e.consume(a),o):n(a)}}function aR(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return lt(s)?n(s):t(s)}}function Lg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function Fg(e){return!ft(e)}function Bg(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||lt(e)}function ac(e){let t=e.length,n=!1;for(;t--;){const 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}const lR={tokenize:gR,partial:!0};function cR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hR,continuation:{tokenize:pR},exit:mR}},text:{91:{name:"gfmFootnoteCall",tokenize:fR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uR,resolveTo:dR}}}}function uR(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Ft(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function dR(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";const 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++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function fR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!o||f===null||f===91||Se(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ft(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Se(f)||(o=!0),s++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function hR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(o>999||g===93&&!a||g===null||g===91||Se(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Ft(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Se(g)||(a=!0),o++,e.consume(g),g===92?f:u}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),ue(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function pR(e,t,n){return e.check(Ei,t,e.attempt(lR,t,n))}function mR(e){e.exit("gfmFootnoteDefinition")}function gR(e,t,n){const r=this;return ue(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function xR(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&vt(h,h.length,0,Hs(p,o.slice(c+1,l),a)),vt(h,h.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),vt(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let f=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const b=kr(c);if(g===126)return f>1?l(g):(o.consume(g),f++,p);if(f<2&&!n)return l(g);const y=o.exit("strikethroughSequenceTemporary"),x=kr(g);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,a(g)}}}class yR{constructor(){this.map=[]}add(t,n,r){bR(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function bR(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function vR(e,t){let n=!1;const r=[];for(;t<e.length;){const 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"){const s=r.length-1;r[s]=r[s]==="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 wR(){return{flow:{null:{name:"table",tokenize:kR,resolveAll:SR}}}}function kR(e,t,n){const r=this;let i=0,s=0,o;return a;function a(N){let D=r.events.length-1;for(;D>-1;){const L=r.events[D][1].type;if(L==="lineEnding"||L==="linePrefix")D--;else break}const P=D>-1?r.events[D][1].type:null,_=P==="tableHead"||P==="tableRow"?S:l;return _===S&&r.parser.lazy[r.now().line]?n(N):_(N)}function l(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(o=!0,s+=1),u(N)}function u(N){return N===null?n(N):Z(N)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):ae(N)?ue(e,u,"whitespace")(N):(s+=1,o&&(o=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Se(N)?(e.exit("data"),u(N)):(e.consume(N),N===92?h:f)}function h(N){return N===92||N===124?(e.consume(N),f):f(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),o=!1,ae(N)?ue(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?y(N):N===124?(o=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),b):k(N)}function b(N){return ae(N)?ue(e,y,"whitespace")(N):y(N)}function y(N){return N===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),x):N===45?(s+=1,x(N)):N===null||Z(N)?E(N):k(N)}function x(N){return N===45?(e.enter("tableDelimiterFiller"),w(N)):k(N)}function w(N){return N===45?(e.consume(N),w):N===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(N))}function C(N){return ae(N)?ue(e,E,"whitespace")(N):E(N)}function E(N){return N===124?g(N):N===null||Z(N)?!o||i!==s?k(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):k(N)}function k(N){return n(N)}function S(N){return e.enter("tableRow"),A(N)}function A(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),A):N===null||Z(N)?(e.exit("tableRow"),t(N)):ae(N)?ue(e,A,"whitespace")(N):(e.enter("data"),T(N))}function T(N){return N===null||N===124||Se(N)?(e.exit("data"),A(N)):(e.consume(N),N===92?R:T)}function R(N){return N===92||N===124?(e.consume(N),T):T(N)}}function SR(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,f;const h=new yR;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(sf(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Ui(h,t,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Ui(h,t,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=Ui(h,t,s,i,n,f)):o[1]!==0&&(f=Ui(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&sf(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=vR(t.events,n))}return e}function Ui(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},nr(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=nr(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=nr(t.events,n[2]),u=nr(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},nr(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function sf(e,t,n,r,i){const s=[],o=nr(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function nr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const CR={name:"tasklistCheck",tokenize:ER};function jR(){return{text:{91:CR}}}function ER(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Se(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Z(l)?t(l):ae(l)?e.check({tokenize:NR},t,n)(l):n(l)}}function NR(e,t,n){return ue(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function TR(e){return Xm([Z_(),cR(),xR(e),wR(),jR()])}const PR={};function AR(e){const t=this,n=e||PR,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(TR(n)),s.push(Y_()),o.push(X_(n))}function zg({content:e,className:t}){return d.jsx("div",{className:F("space-y-4 text-[13px] leading-[1.7]",t),children:d.jsx(x2,{remarkPlugins:[AR],components:{h1:({children:n})=>d.jsx("h1",{className:"text-base font-semibold text-foreground border-b border-border pb-2 mb-3",children:n}),h2:({children:n})=>d.jsx("h2",{className:"text-sm font-semibold text-foreground mt-6 mb-2 border-b border-border/50 pb-1.5",children:n}),h3:({children:n})=>d.jsx("h3",{className:"text-[13px] font-semibold text-foreground mt-5 mb-1.5",children:n}),h4:({children:n})=>d.jsx("h4",{className:"text-[13px] font-medium text-foreground/90 mt-4 mb-1",children:n}),p:({children:n})=>d.jsx("p",{className:"text-foreground/70 mb-2",children:n}),a:({href:n,children:r})=>d.jsx("a",{href:n,className:"text-accent-blue hover:text-accent-blue/80 underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:r}),ul:({children:n})=>d.jsx("ul",{className:"ml-5 space-y-1.5 list-disc text-foreground/70 marker:text-muted-foreground",children:n}),ol:({children:n})=>d.jsx("ol",{className:"ml-5 space-y-1.5 list-decimal text-foreground/70 marker:text-muted-foreground",children:n}),li:({children:n,...r})=>{var s,o;const i=(o=(s=r.node)==null?void 0:s.properties)==null?void 0:o.className;return i&&String(i).includes("task-list-item")?d.jsx("li",{className:"list-none ml-[-1.25rem] flex items-start gap-2",children:n}):d.jsx("li",{className:"pl-1",children:n})},input:({checked:n})=>d.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"mt-1 h-3.5 w-3.5 rounded border-border accent-primary"}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?d.jsx("code",{className:F("block rounded p-3 font-mono text-xxs overflow-x-auto","bg-[#0d0d14] border border-border/50",r),children:n}):d.jsx("code",{className:"bg-[#0d0d14] border border-border/30 rounded px-1.5 py-0.5 font-mono text-xxs text-accent-blue/90",children:n}),pre:({children:n})=>d.jsx("pre",{className:"overflow-x-auto my-3",children:n}),blockquote:({children:n})=>d.jsx("blockquote",{className:"border-l-2 border-accent-blue/40 pl-4 py-1 text-foreground/60 italic bg-surface/50 rounded-r",children:n}),table:({children:n})=>d.jsx("div",{className:"overflow-x-auto my-3 rounded border border-border",children:d.jsx("table",{className:"w-full text-xs",children:n})}),thead:({children:n})=>d.jsx("thead",{className:"bg-[#0d0d14] text-muted-foreground",children:n}),tr:({children:n})=>d.jsx("tr",{className:"border-b border-border/50 even:bg-surface/30",children:n}),th:({children:n})=>d.jsx("th",{className:"px-3 py-2 text-left text-xxs font-medium uppercase tracking-wider",children:n}),td:({children:n})=>d.jsx("td",{className:"px-3 py-2 text-foreground/70",children:n}),hr:()=>d.jsx("hr",{className:"border-border/50 my-4"}),strong:({children:n})=>d.jsx("strong",{className:"font-semibold text-foreground",children:n})},children:e})})}const Vg=6048e5,_R=864e5,c5=43200,u5=1440,of=Symbol.for("constructDateFrom");function Nn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&of in e?e[of](t):e instanceof Date?new e.constructor(t):new Date(t)}function zt(e,t){return Nn(t||e,e)}let RR={};function Ys(){return RR}function mi(e,t){var a,l,c,u;const n=Ys(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=zt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Cs(e,t){return mi(e,{...t,weekStartsOn:1})}function $g(e,t){const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Nn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Cs(i),o=Nn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Cs(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function af(e){const t=zt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function MR(e,...t){const n=Nn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function lf(e,t){const n=zt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function DR(e,t,n){const[r,i]=MR(n==null?void 0:n.in,e,t),s=lf(r),o=lf(i),a=+s-af(s),l=+o-af(o);return Math.round((a-l)/_R)}function OR(e,t){const n=$g(e,t),r=Nn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Cs(r)}function IR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function LR(e){return!(!IR(e)&&typeof e!="number"||isNaN(+zt(e)))}function FR(e,t){const n=zt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const BR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},zR=(e,t,n)=>{let r;const i=BR[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Uo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const VR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$R={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},UR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WR={date:Uo({formats:VR,defaultWidth:"full"}),time:Uo({formats:$R,defaultWidth:"full"}),dateTime:Uo({formats:UR,defaultWidth:"full"})},HR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qR=(e,t,n,r)=>HR[e];function Vr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const KR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},GR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YR={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},JR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},QR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZR=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},eM={ordinalNumber:ZR,era:Vr({values:KR,defaultWidth:"wide"}),quarter:Vr({values:GR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vr({values:YR,defaultWidth:"wide"}),day:Vr({values:XR,defaultWidth:"wide"}),dayPeriod:Vr({values:JR,defaultWidth:"wide",formattingValues:QR,defaultFormattingWidth:"wide"})};function $r(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?nM(a,f=>f.test(o)):tM(a,f=>f.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function tM(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function nM(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function rM(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const iM=/^(\d+)(th|st|nd|rd)?/i,sM=/\d+/i,oM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},aM={any:[/^b/i,/^(a|c)/i]},lM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cM={any:[/1/i,/2/i,/3/i,/4/i]},uM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gM={ordinalNumber:rM({matchPattern:iM,parsePattern:sM,valueCallback:e=>parseInt(e,10)}),era:$r({matchPatterns:oM,defaultMatchWidth:"wide",parsePatterns:aM,defaultParseWidth:"any"}),quarter:$r({matchPatterns:lM,defaultMatchWidth:"wide",parsePatterns:cM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$r({matchPatterns:uM,defaultMatchWidth:"wide",parsePatterns:dM,defaultParseWidth:"any"}),day:$r({matchPatterns:fM,defaultMatchWidth:"wide",parsePatterns:hM,defaultParseWidth:"any"}),dayPeriod:$r({matchPatterns:pM,defaultMatchWidth:"any",parsePatterns:mM,defaultParseWidth:"any"})},xM={code:"en-US",formatDistance:zR,formatLong:WR,formatRelative:qR,localize:eM,match:gM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yM(e,t){const n=zt(e,t==null?void 0:t.in);return DR(n,FR(n))+1}function bM(e,t){const n=zt(e,t==null?void 0:t.in),r=+Cs(n)-+OR(n);return Math.round(r/Vg)+1}function Ug(e,t){var u,f,h,p;const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Ys(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(h=i.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=Nn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=mi(o,t),l=Nn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=mi(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function vM(e,t){var a,l,c,u;const n=Ys(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=Ug(e,t),s=Nn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),mi(s,t)}function wM(e,t){const n=zt(e,t==null?void 0:t.in),r=+mi(n,t)-+vM(n,t);return Math.round(r/Vg)+1}function ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const vn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ye(n+1,2)},d(e,t){return ye(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ye(e.getHours()%12||12,t.length)},H(e,t){return ye(e.getHours(),t.length)},m(e,t){return ye(e.getMinutes(),t.length)},s(e,t){return ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ye(i,t.length)}},tr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cf={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return vn.y(e,t)},Y:function(e,t,n,r){const i=Ug(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return ye(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ye(s,t.length)},R:function(e,t){const n=$g(e);return ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return ye(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ye(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ye(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return vn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ye(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=wM(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ye(i,t.length)},I:function(e,t,n){const r=bM(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vn.d(e,t)},D:function(e,t,n){const r=yM(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ye(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ye(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ye(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return ye(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=tr.noon:r===0?i=tr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=tr.evening:r>=12?i=tr.afternoon:r>=4?i=tr.morning:i=tr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return vn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vn.s(e,t)},S:function(e,t){return vn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return df(r);case"XXXX":case"XX":return zn(r);case"XXXXX":case"XXX":default:return zn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return df(r);case"xxxx":case"xx":return zn(r);case"xxxxx":case"xxx":default:return zn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uf(r,":");case"OOOO":default:return"GMT"+zn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uf(r,":");case"zzzz":default:return"GMT"+zn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ye(r,t.length)},T:function(e,t,n){return ye(+e,t.length)}};function uf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+ye(s,2)}function df(e,t){return e%60===0?(e>0?"-":"+")+ye(Math.abs(e)/60,2):zn(e,t)}function zn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ye(Math.trunc(r/60),2),s=ye(r%60,2);return n+i+t+s}const ff=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Wg=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},kM=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return ff(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ff(r,t)).replace("{{time}}",Wg(i,t))},SM={p:Wg,P:kM},CM=/^D+$/,jM=/^Y+$/,EM=["D","DD","YY","YYYY"];function NM(e){return CM.test(e)}function TM(e){return jM.test(e)}function PM(e,t,n){const r=AM(e,t,n);if(console.warn(r),EM.includes(e))throw new RangeError(r)}function AM(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MM=/^'([^]*?)'?$/,DM=/''/g,OM=/[a-zA-Z]/;function Wi(e,t,n){var u,f,h,p;const r=Ys(),i=r.locale??xM,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,o=r.weekStartsOn??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,a=zt(e,n==null?void 0:n.in);if(!LR(a))throw new RangeError("Invalid time value");let l=t.match(RM).map(g=>{const b=g[0];if(b==="p"||b==="P"){const y=SM[b];return y(g,i.formatLong)}return g}).join("").match(_M).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:IM(g)};if(cf[b])return{isToken:!0,value:g};if(b.match(OM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(g=>{if(!g.isToken)return g.value;const b=g.value;(TM(b)||NM(b))&&PM(b,t,String(e));const y=cf[b[0]];return y(a,b,i.localize,c)}).join("")}function IM(e){const t=e.match(MM);return t?t[1].replace(DM,"'"):e}const LM={createScope:"Created",reviewScope:"Reviewed",implementScope:"Implemented",verifyScope:"Verified",commit:"Committed",pushToMain:"Pushed to Main",pushToDev:"Pushed to Dev",pushToStaging:"PR to Staging",pushToProduction:"PR to Production"};function Hi(e){return e?LM[e]??e:null}function FM({sessions:e,loading:t}){const n=Xt(),[r,i]=m.useState(null),[s,o]=m.useState(null),[a,l]=m.useState(!1),[c,u]=m.useState(!1),f=m.useRef();m.useEffect(()=>()=>{clearTimeout(f.current)},[]);const h=m.useCallback(async g=>{i(g),l(!0);try{const b=await fetch(n(`/sessions/${g.id}/content`));b.ok&&o(await b.json())}catch{}finally{l(!1)}},[n]),p=m.useCallback(async()=>{const g=r==null?void 0:r.claude_session_id;if(g){u(!0);try{await fetch(n(`/sessions/${r.id}/resume`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({claude_session_id:g})})}catch{}finally{f.current=setTimeout(()=>u(!1),2e3)}}},[r,n]);if(t)return d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})});if(r){const g=Array.isArray(r.discoveries)?r.discoveries:[],b=Array.isArray(r.next_steps)?r.next_steps:[],y=!!r.claude_session_id,x=(s==null?void 0:s.meta)??null,w=(x==null?void 0:x.summary)??r.summary??null,C=w?hf(w,100):null;return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-3",children:[d.jsx(ke,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{i(null),o(null)},children:d.jsx(vb,{className:"h-4 w-4"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-xxs text-muted-foreground",children:r.started_at&&Wi(new Date(r.started_at),"MMM d, yyyy")}),d.jsx("p",{className:"truncate text-sm font-light",children:C||"Untitled Session"})]})]}),d.jsx(bs,{className:"mb-3"}),d.jsx(gr,{className:"flex-1 -mr-2 pr-2",children:a?d.jsx("div",{className:"flex h-20 items-center justify-center",children:d.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):d.jsx("table",{className:"w-full text-xs",children:d.jsxs("tbody",{className:"[&_td]:border-b [&_td]:border-border/30 [&_td]:py-2 [&_td]:align-top [&_td:first-child]:pr-3 [&_td:first-child]:text-muted-foreground [&_td:first-child]:whitespace-nowrap",children:[d.jsxs("tr",{children:[d.jsx("td",{children:"Scope"}),d.jsx("td",{children:r.scope_id})]}),Hi(r.action)&&d.jsxs("tr",{children:[d.jsx("td",{children:"Action"}),d.jsx("td",{children:Hi(r.action)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Summary"}),d.jsx("td",{children:r.summary?hf(r.summary,200):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Started"}),d.jsx("td",{children:r.started_at?Wi(new Date(r.started_at),"MMM d, h:mm a"):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Ended"}),d.jsx("td",{children:r.ended_at?Wi(new Date(r.ended_at),"MMM d, h:mm a"):"—"})]}),x&&d.jsxs(d.Fragment,{children:[x.branch&&x.branch!=="unknown"&&d.jsxs("tr",{children:[d.jsx("td",{children:"Branch"}),d.jsx("td",{className:"font-mono text-xxs",children:x.branch})]}),x.fileSize>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"File size"}),d.jsx("td",{children:BM(x.fileSize)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Plan"}),d.jsx("td",{className:"text-muted-foreground",children:x.slug})]})]}),r.handoff_file&&d.jsxs("tr",{children:[d.jsx("td",{children:"Handoff"}),d.jsx("td",{className:"font-mono text-xxs",children:r.handoff_file})]}),g.length>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"Completed"}),d.jsx("td",{children:d.jsx("ul",{className:"space-y-0.5",children:g.map(E=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-bid-green mr-1",children:"•"}),E]},E))})})]}),b.length>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"Next steps"}),d.jsx("td",{children:d.jsx("ul",{className:"space-y-0.5",children:b.map(E=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-accent-blue mr-1",children:"•"}),E]},E))})})]}),r.claude_session_id&&d.jsxs("tr",{children:[d.jsx("td",{children:"Session ID"}),d.jsx("td",{className:"font-mono text-xxs text-muted-foreground",children:r.claude_session_id})]})]})})}),d.jsxs("div",{className:"pt-3",children:[d.jsxs(ke,{className:"w-full",disabled:!y||c,onClick:p,title:y?"Open in iTerm":"No Claude Code session found",children:[d.jsx(Ps,{className:"mr-2 h-4 w-4"}),c?"Opening iTerm...":"Resume Session"]}),!y&&d.jsx("p",{className:"mt-1.5 text-center text-xs text-muted-foreground",children:"No matching Claude Code session found"})]})]})}return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-3",children:[d.jsx("h3",{className:"text-xs font-normal",children:"Sessions"}),d.jsx(Ve,{variant:"secondary",className:"text-xxs",children:e.length})]}),e.length===0?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:"No sessions recorded yet"})}):d.jsx(gr,{className:"flex-1 -mr-2 pr-2",children:d.jsx("div",{className:"space-y-2",children:e.map(g=>{const b=Array.isArray(g.discoveries)?g.discoveries:[],y=Array.isArray(g.next_steps)?g.next_steps:[];return d.jsx($l,{className:F("cursor-pointer transition-colors hover:border-primary/30",g.claude_session_id&&"border-l-2 border-l-primary/50","glow-blue-sm"),onClick:()=>h(g),children:d.jsxs(Ul,{className:"p-2.5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xxs text-muted-foreground",children:g.started_at&&Wi(new Date(g.started_at),"MMM d")}),Hi(g.action)&&d.jsx(Ve,{variant:"outline",className:"text-xxs px-1 py-0 font-light",children:Hi(g.action)})]}),d.jsx(ii,{className:"h-3.5 w-3.5 text-muted-foreground/50"})]}),d.jsx("p",{className:"mt-1 truncate text-xs font-normal",children:g.summary||"Untitled Session"}),d.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xxs text-muted-foreground",children:[b.length>0&&d.jsxs("span",{className:"text-bid-green",children:[b.length," completed"]}),y.length>0&&d.jsxs("span",{className:"text-accent-blue",children:[y.length," next"]}),g.claude_session_id&&d.jsx("span",{className:"text-primary/70",children:"resumable"})]})]})},g.id)})})})]})}function hf(e,t){return e.length>t?e.slice(0,t)+"...":e}function BM(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function zM({title:e,defaultOpen:t=!0,badge:n,children:r,className:i}){const[s,o]=m.useState(t);return d.jsxs("div",{className:F("border-b border-border/50 last:border-b-0",i),children:[d.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-4 py-2 text-left text-xs font-medium text-foreground/80 hover:text-foreground transition-colors",onClick:()=>o(a=>!a),"aria-expanded":s,children:[d.jsx(ii,{className:F("h-3.5 w-3.5 shrink-0 transition-transform duration-200",s&&"rotate-90")}),d.jsx("span",{className:"flex-1 truncate",children:e}),n&&d.jsx("span",{className:"shrink-0",children:n})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:s?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsx("div",{className:"px-4 pb-3",children:r})})})]})}function Cn({content:e}){return d.jsx(zg,{content:e,className:"section-markdown"})}function VM({meta:e,content:t}){const n=e.total>0?e.done/e.total*100:0;return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-1.5 flex-1 rounded-full bg-muted",children:d.jsx("div",{className:F("h-full rounded-full transition-all duration-500",n===100?"bg-bid-green":"bg-accent-blue"),style:{width:`${n}%`}})}),d.jsxs("span",{className:"text-xxs text-muted-foreground",children:[e.done,"/",e.total]})]}),d.jsx("div",{className:"space-y-1",children:e.phases.map((r,i)=>{const s=/⏳|in.?progress|pending/i.test(r.status)&&!r.done;return d.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xxs",children:[r.done?d.jsx(Ab,{className:"h-3 w-3 shrink-0 text-bid-green"}):s?d.jsx(fr,{className:"h-3 w-3 shrink-0 text-accent-blue animate-spin"}):d.jsx(Db,{className:"h-3 w-3 shrink-0 text-muted-foreground/40"}),d.jsx("span",{className:"font-mono text-muted-foreground/50 w-4",children:r.name}),d.jsx("span",{className:F("flex-1",r.done?"text-muted-foreground":"text-foreground/80"),children:r.description})]},i)})}),t.split(`
338
+ `))}function l(p,g,b,y){const x=b.enter("tableCell"),w=b.enter("phrasing"),C=b.containerPhrasing(p,{...y,before:s,after:s});return w(),x(),C}function c(p,g){return i_(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,b){const y=p.children;let x=-1;const w=[],C=g.enter("table");for(;++x<y.length;)w[x]=f(y[x],g,b);return C(),w}function f(p,g,b){const y=p.children;let x=-1;const w=[],C=g.enter("tableRow");for(;++x<y.length;)w[x]=l(y[x],p,g,b);return C(),w}function h(p,g,b){let y=Ag.inlineCode(p,g,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function H_(){return{exit:{taskListCheckValueChecked:nf,taskListCheckValueUnchecked:nf,paragraph:K_}}}function q_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:G_}}}function nf(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function K_(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function G_(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Ag.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function Y_(){return[N2(),G2(),Q2(),F_(),H_()]}function X_(e){return{extensions:[T2(),Y2(e),Z2(),W_(e),q_()]}}const J_={tokenize:rR,partial:!0},_g={tokenize:iR,partial:!0},Rg={tokenize:sR,partial:!0},Mg={tokenize:oR,partial:!0},Q_={tokenize:aR,partial:!0},Dg={name:"wwwAutolink",tokenize:tR,previous:Ig},Og={name:"protocolAutolink",tokenize:nR,previous:Lg},fn={name:"emailAutolink",tokenize:eR,previous:Fg},Jt={};function Z_(){return{text:Jt}}let In=48;for(;In<123;)Jt[In]=fn,In++,In===58?In=65:In===91&&(In=97);Jt[43]=fn;Jt[45]=fn;Jt[46]=fn;Jt[95]=fn;Jt[72]=[fn,Og];Jt[104]=[fn,Og];Jt[87]=[fn,Dg];Jt[119]=[fn,Dg];function eR(e,t,n){const r=this;let i,s;return o;function o(f){return!Da(f)||!Fg.call(r,r.previous)||ac(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Da(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(Q_,u,c)(f):f===45||f===95||lt(f)?(s=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return s&&i&&ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function tR(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Ig.call(r,r.previous)||ac(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(J_,e.attempt(_g,e.attempt(Rg,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function nR(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&Lg.call(r,r.previous)&&!ac(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(ft(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?c:(s=!0,l)):n(f)}function c(f){return f===null||vs(f)||Se(f)||Hn(f)||Ws(f)?n(f):e.attempt(_g,e.attempt(Rg,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function rR(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function iR(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Mg,l,a)(c):c===null||Se(c)||Hn(c)||c!==45&&Ws(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function sR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(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(Mg,t,s)(o):o===null||Se(o)||Hn(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function oR(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Se(a)||Hn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Se(a)||Hn(a)?t(a):r(a)}function s(a){return ft(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):ft(a)?(e.consume(a),o):n(a)}}function aR(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return lt(s)?n(s):t(s)}}function Ig(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function Lg(e){return!ft(e)}function Fg(e){return!(e===47||Da(e))}function Da(e){return e===43||e===45||e===46||e===95||lt(e)}function ac(e){let t=e.length,n=!1;for(;t--;){const 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}const lR={tokenize:gR,partial:!0};function cR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hR,continuation:{tokenize:pR},exit:mR}},text:{91:{name:"gfmFootnoteCall",tokenize:fR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uR,resolveTo:dR}}}}function uR(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Ft(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function dR(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";const 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++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function fR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!o||f===null||f===91||Se(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ft(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Se(f)||(o=!0),s++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function hR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(o>999||g===93&&!a||g===null||g===91||Se(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Ft(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Se(g)||(a=!0),o++,e.consume(g),g===92?f:u}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),ue(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function pR(e,t,n){return e.check(Ei,t,e.attempt(lR,t,n))}function mR(e){e.exit("gfmFootnoteDefinition")}function gR(e,t,n){const r=this;return ue(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function xR(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&vt(h,h.length,0,Hs(p,o.slice(c+1,l),a)),vt(h,h.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),vt(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let f=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const b=kr(c);if(g===126)return f>1?l(g):(o.consume(g),f++,p);if(f<2&&!n)return l(g);const y=o.exit("strikethroughSequenceTemporary"),x=kr(g);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,a(g)}}}class yR{constructor(){this.map=[]}add(t,n,r){bR(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function bR(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function vR(e,t){let n=!1;const r=[];for(;t<e.length;){const 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"){const s=r.length-1;r[s]=r[s]==="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 wR(){return{flow:{null:{name:"table",tokenize:kR,resolveAll:SR}}}}function kR(e,t,n){const r=this;let i=0,s=0,o;return a;function a(N){let D=r.events.length-1;for(;D>-1;){const L=r.events[D][1].type;if(L==="lineEnding"||L==="linePrefix")D--;else break}const P=D>-1?r.events[D][1].type:null,_=P==="tableHead"||P==="tableRow"?S:l;return _===S&&r.parser.lazy[r.now().line]?n(N):_(N)}function l(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(o=!0,s+=1),u(N)}function u(N){return N===null?n(N):Z(N)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):ae(N)?ue(e,u,"whitespace")(N):(s+=1,o&&(o=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Se(N)?(e.exit("data"),u(N)):(e.consume(N),N===92?h:f)}function h(N){return N===92||N===124?(e.consume(N),f):f(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),o=!1,ae(N)?ue(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?y(N):N===124?(o=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),b):k(N)}function b(N){return ae(N)?ue(e,y,"whitespace")(N):y(N)}function y(N){return N===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),x):N===45?(s+=1,x(N)):N===null||Z(N)?E(N):k(N)}function x(N){return N===45?(e.enter("tableDelimiterFiller"),w(N)):k(N)}function w(N){return N===45?(e.consume(N),w):N===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(N))}function C(N){return ae(N)?ue(e,E,"whitespace")(N):E(N)}function E(N){return N===124?g(N):N===null||Z(N)?!o||i!==s?k(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):k(N)}function k(N){return n(N)}function S(N){return e.enter("tableRow"),A(N)}function A(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),A):N===null||Z(N)?(e.exit("tableRow"),t(N)):ae(N)?ue(e,A,"whitespace")(N):(e.enter("data"),T(N))}function T(N){return N===null||N===124||Se(N)?(e.exit("data"),A(N)):(e.consume(N),N===92?R:T)}function R(N){return N===92||N===124?(e.consume(N),T):T(N)}}function SR(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,f;const h=new yR;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(rf(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Ui(h,t,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Ui(h,t,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=Ui(h,t,s,i,n,f)):o[1]!==0&&(f=Ui(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&rf(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=vR(t.events,n))}return e}function Ui(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},nr(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=nr(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=nr(t.events,n[2]),u=nr(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},nr(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function rf(e,t,n,r,i){const s=[],o=nr(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function nr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const CR={name:"tasklistCheck",tokenize:ER};function jR(){return{text:{91:CR}}}function ER(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Se(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Z(l)?t(l):ae(l)?e.check({tokenize:NR},t,n)(l):n(l)}}function NR(e,t,n){return ue(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function TR(e){return Ym([Z_(),cR(),xR(e),wR(),jR()])}const PR={};function AR(e){const t=this,n=e||PR,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(TR(n)),s.push(Y_()),o.push(X_(n))}function Bg({content:e,className:t}){return d.jsx("div",{className:F("space-y-4 text-[13px] leading-[1.7]",t),children:d.jsx(x2,{remarkPlugins:[AR],components:{h1:({children:n})=>d.jsx("h1",{className:"text-base font-semibold text-foreground border-b border-border pb-2 mb-3",children:n}),h2:({children:n})=>d.jsx("h2",{className:"text-sm font-semibold text-foreground mt-6 mb-2 border-b border-border/50 pb-1.5",children:n}),h3:({children:n})=>d.jsx("h3",{className:"text-[13px] font-semibold text-foreground mt-5 mb-1.5",children:n}),h4:({children:n})=>d.jsx("h4",{className:"text-[13px] font-medium text-foreground/90 mt-4 mb-1",children:n}),p:({children:n})=>d.jsx("p",{className:"text-foreground/70 mb-2",children:n}),a:({href:n,children:r})=>d.jsx("a",{href:n,className:"text-accent-blue hover:text-accent-blue/80 underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:r}),ul:({children:n})=>d.jsx("ul",{className:"ml-5 space-y-1.5 list-disc text-foreground/70 marker:text-muted-foreground",children:n}),ol:({children:n})=>d.jsx("ol",{className:"ml-5 space-y-1.5 list-decimal text-foreground/70 marker:text-muted-foreground",children:n}),li:({children:n,...r})=>{var s,o;const i=(o=(s=r.node)==null?void 0:s.properties)==null?void 0:o.className;return i&&String(i).includes("task-list-item")?d.jsx("li",{className:"list-none ml-[-1.25rem] flex items-start gap-2",children:n}):d.jsx("li",{className:"pl-1",children:n})},input:({checked:n})=>d.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"mt-1 h-3.5 w-3.5 rounded border-border accent-primary"}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?d.jsx("code",{className:F("block rounded p-3 font-mono text-xxs overflow-x-auto","bg-[#0d0d14] border border-border/50",r),children:n}):d.jsx("code",{className:"bg-[#0d0d14] border border-border/30 rounded px-1.5 py-0.5 font-mono text-xxs text-accent-blue/90",children:n}),pre:({children:n})=>d.jsx("pre",{className:"overflow-x-auto my-3",children:n}),blockquote:({children:n})=>d.jsx("blockquote",{className:"border-l-2 border-accent-blue/40 pl-4 py-1 text-foreground/60 italic bg-surface/50 rounded-r",children:n}),table:({children:n})=>d.jsx("div",{className:"overflow-x-auto my-3 rounded border border-border",children:d.jsx("table",{className:"w-full text-xs",children:n})}),thead:({children:n})=>d.jsx("thead",{className:"bg-[#0d0d14] text-muted-foreground",children:n}),tr:({children:n})=>d.jsx("tr",{className:"border-b border-border/50 even:bg-surface/30",children:n}),th:({children:n})=>d.jsx("th",{className:"px-3 py-2 text-left text-xxs font-medium uppercase tracking-wider",children:n}),td:({children:n})=>d.jsx("td",{className:"px-3 py-2 text-foreground/70",children:n}),hr:()=>d.jsx("hr",{className:"border-border/50 my-4"}),strong:({children:n})=>d.jsx("strong",{className:"font-semibold text-foreground",children:n})},children:e})})}const zg=6048e5,_R=864e5,c5=43200,u5=1440,sf=Symbol.for("constructDateFrom");function Nn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sf in e?e[sf](t):e instanceof Date?new e.constructor(t):new Date(t)}function zt(e,t){return Nn(t||e,e)}let RR={};function Ys(){return RR}function mi(e,t){var a,l,c,u;const n=Ys(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=zt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Cs(e,t){return mi(e,{...t,weekStartsOn:1})}function Vg(e,t){const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Nn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Cs(i),o=Nn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Cs(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function of(e){const t=zt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function MR(e,...t){const n=Nn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function af(e,t){const n=zt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function DR(e,t,n){const[r,i]=MR(n==null?void 0:n.in,e,t),s=af(r),o=af(i),a=+s-of(s),l=+o-of(o);return Math.round((a-l)/_R)}function OR(e,t){const n=Vg(e,t),r=Nn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Cs(r)}function IR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function LR(e){return!(!IR(e)&&typeof e!="number"||isNaN(+zt(e)))}function FR(e,t){const n=zt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const BR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},zR=(e,t,n)=>{let r;const i=BR[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Uo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const VR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$R={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},UR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WR={date:Uo({formats:VR,defaultWidth:"full"}),time:Uo({formats:$R,defaultWidth:"full"}),dateTime:Uo({formats:UR,defaultWidth:"full"})},HR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qR=(e,t,n,r)=>HR[e];function Vr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const KR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},GR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YR={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},JR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},QR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZR=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},eM={ordinalNumber:ZR,era:Vr({values:KR,defaultWidth:"wide"}),quarter:Vr({values:GR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vr({values:YR,defaultWidth:"wide"}),day:Vr({values:XR,defaultWidth:"wide"}),dayPeriod:Vr({values:JR,defaultWidth:"wide",formattingValues:QR,defaultFormattingWidth:"wide"})};function $r(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?nM(a,f=>f.test(o)):tM(a,f=>f.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function tM(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function nM(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function rM(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const iM=/^(\d+)(th|st|nd|rd)?/i,sM=/\d+/i,oM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},aM={any:[/^b/i,/^(a|c)/i]},lM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cM={any:[/1/i,/2/i,/3/i,/4/i]},uM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gM={ordinalNumber:rM({matchPattern:iM,parsePattern:sM,valueCallback:e=>parseInt(e,10)}),era:$r({matchPatterns:oM,defaultMatchWidth:"wide",parsePatterns:aM,defaultParseWidth:"any"}),quarter:$r({matchPatterns:lM,defaultMatchWidth:"wide",parsePatterns:cM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$r({matchPatterns:uM,defaultMatchWidth:"wide",parsePatterns:dM,defaultParseWidth:"any"}),day:$r({matchPatterns:fM,defaultMatchWidth:"wide",parsePatterns:hM,defaultParseWidth:"any"}),dayPeriod:$r({matchPatterns:pM,defaultMatchWidth:"any",parsePatterns:mM,defaultParseWidth:"any"})},xM={code:"en-US",formatDistance:zR,formatLong:WR,formatRelative:qR,localize:eM,match:gM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yM(e,t){const n=zt(e,t==null?void 0:t.in);return DR(n,FR(n))+1}function bM(e,t){const n=zt(e,t==null?void 0:t.in),r=+Cs(n)-+OR(n);return Math.round(r/zg)+1}function $g(e,t){var u,f,h,p;const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Ys(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(h=i.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=Nn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=mi(o,t),l=Nn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=mi(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function vM(e,t){var a,l,c,u;const n=Ys(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=$g(e,t),s=Nn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),mi(s,t)}function wM(e,t){const n=zt(e,t==null?void 0:t.in),r=+mi(n,t)-+vM(n,t);return Math.round(r/zg)+1}function ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const vn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ye(n+1,2)},d(e,t){return ye(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ye(e.getHours()%12||12,t.length)},H(e,t){return ye(e.getHours(),t.length)},m(e,t){return ye(e.getMinutes(),t.length)},s(e,t){return ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ye(i,t.length)}},tr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lf={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return vn.y(e,t)},Y:function(e,t,n,r){const i=$g(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return ye(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ye(s,t.length)},R:function(e,t){const n=Vg(e);return ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return ye(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ye(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ye(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return vn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ye(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=wM(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ye(i,t.length)},I:function(e,t,n){const r=bM(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vn.d(e,t)},D:function(e,t,n){const r=yM(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ye(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ye(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ye(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return ye(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=tr.noon:r===0?i=tr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=tr.evening:r>=12?i=tr.afternoon:r>=4?i=tr.morning:i=tr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return vn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vn.s(e,t)},S:function(e,t){return vn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return uf(r);case"XXXX":case"XX":return zn(r);case"XXXXX":case"XXX":default:return zn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return uf(r);case"xxxx":case"xx":return zn(r);case"xxxxx":case"xxx":default:return zn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cf(r,":");case"OOOO":default:return"GMT"+zn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cf(r,":");case"zzzz":default:return"GMT"+zn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ye(r,t.length)},T:function(e,t,n){return ye(+e,t.length)}};function cf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+ye(s,2)}function uf(e,t){return e%60===0?(e>0?"-":"+")+ye(Math.abs(e)/60,2):zn(e,t)}function zn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ye(Math.trunc(r/60),2),s=ye(r%60,2);return n+i+t+s}const df=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ug=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},kM=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return df(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",df(r,t)).replace("{{time}}",Ug(i,t))},SM={p:Ug,P:kM},CM=/^D+$/,jM=/^Y+$/,EM=["D","DD","YY","YYYY"];function NM(e){return CM.test(e)}function TM(e){return jM.test(e)}function PM(e,t,n){const r=AM(e,t,n);if(console.warn(r),EM.includes(e))throw new RangeError(r)}function AM(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MM=/^'([^]*?)'?$/,DM=/''/g,OM=/[a-zA-Z]/;function Wi(e,t,n){var u,f,h,p;const r=Ys(),i=r.locale??xM,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,o=r.weekStartsOn??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,a=zt(e,n==null?void 0:n.in);if(!LR(a))throw new RangeError("Invalid time value");let l=t.match(RM).map(g=>{const b=g[0];if(b==="p"||b==="P"){const y=SM[b];return y(g,i.formatLong)}return g}).join("").match(_M).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:IM(g)};if(lf[b])return{isToken:!0,value:g};if(b.match(OM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(g=>{if(!g.isToken)return g.value;const b=g.value;(TM(b)||NM(b))&&PM(b,t,String(e));const y=lf[b[0]];return y(a,b,i.localize,c)}).join("")}function IM(e){const t=e.match(MM);return t?t[1].replace(DM,"'"):e}const LM={createScope:"Created",reviewScope:"Reviewed",implementScope:"Implemented",verifyScope:"Verified",commit:"Committed",pushToMain:"Pushed to Main",pushToDev:"Pushed to Dev",pushToStaging:"PR to Staging",pushToProduction:"PR to Production"};function Hi(e){return e?LM[e]??e:null}function FM({sessions:e,loading:t}){const n=Xt(),[r,i]=m.useState(null),[s,o]=m.useState(null),[a,l]=m.useState(!1),[c,u]=m.useState(!1),f=m.useRef();m.useEffect(()=>()=>{clearTimeout(f.current)},[]);const h=m.useCallback(async g=>{i(g),l(!0);try{const b=await fetch(n(`/sessions/${g.id}/content`));b.ok&&o(await b.json())}catch{}finally{l(!1)}},[n]),p=m.useCallback(async()=>{const g=r==null?void 0:r.claude_session_id;if(g){u(!0);try{await fetch(n(`/sessions/${r.id}/resume`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({claude_session_id:g})})}catch{}finally{f.current=setTimeout(()=>u(!1),2e3)}}},[r,n]);if(t)return d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})});if(r){const g=Array.isArray(r.discoveries)?r.discoveries:[],b=Array.isArray(r.next_steps)?r.next_steps:[],y=!!r.claude_session_id,x=(s==null?void 0:s.meta)??null,w=(x==null?void 0:x.summary)??r.summary??null,C=w?ff(w,100):null;return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-3",children:[d.jsx(ke,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{i(null),o(null)},children:d.jsx(vb,{className:"h-4 w-4"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-xxs text-muted-foreground",children:r.started_at&&Wi(new Date(r.started_at),"MMM d, yyyy")}),d.jsx("p",{className:"truncate text-sm font-light",children:C||"Untitled Session"})]})]}),d.jsx(bs,{className:"mb-3"}),d.jsx(gr,{className:"flex-1 -mr-2 pr-2",children:a?d.jsx("div",{className:"flex h-20 items-center justify-center",children:d.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):d.jsx("table",{className:"w-full text-xs",children:d.jsxs("tbody",{className:"[&_td]:border-b [&_td]:border-border/30 [&_td]:py-2 [&_td]:align-top [&_td:first-child]:pr-3 [&_td:first-child]:text-muted-foreground [&_td:first-child]:whitespace-nowrap",children:[d.jsxs("tr",{children:[d.jsx("td",{children:"Scope"}),d.jsx("td",{children:r.scope_id})]}),Hi(r.action)&&d.jsxs("tr",{children:[d.jsx("td",{children:"Action"}),d.jsx("td",{children:Hi(r.action)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Summary"}),d.jsx("td",{children:r.summary?ff(r.summary,200):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Started"}),d.jsx("td",{children:r.started_at?Wi(new Date(r.started_at),"MMM d, h:mm a"):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Ended"}),d.jsx("td",{children:r.ended_at?Wi(new Date(r.ended_at),"MMM d, h:mm a"):"—"})]}),x&&d.jsxs(d.Fragment,{children:[x.branch&&x.branch!=="unknown"&&d.jsxs("tr",{children:[d.jsx("td",{children:"Branch"}),d.jsx("td",{className:"font-mono text-xxs",children:x.branch})]}),x.fileSize>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"File size"}),d.jsx("td",{children:BM(x.fileSize)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Plan"}),d.jsx("td",{className:"text-muted-foreground",children:x.slug})]})]}),r.handoff_file&&d.jsxs("tr",{children:[d.jsx("td",{children:"Handoff"}),d.jsx("td",{className:"font-mono text-xxs",children:r.handoff_file})]}),g.length>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"Completed"}),d.jsx("td",{children:d.jsx("ul",{className:"space-y-0.5",children:g.map(E=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-bid-green mr-1",children:"•"}),E]},E))})})]}),b.length>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"Next steps"}),d.jsx("td",{children:d.jsx("ul",{className:"space-y-0.5",children:b.map(E=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-accent-blue mr-1",children:"•"}),E]},E))})})]}),r.claude_session_id&&d.jsxs("tr",{children:[d.jsx("td",{children:"Session ID"}),d.jsx("td",{className:"font-mono text-xxs text-muted-foreground",children:r.claude_session_id})]})]})})}),d.jsxs("div",{className:"pt-3",children:[d.jsxs(ke,{className:"w-full",disabled:!y||c,onClick:p,title:y?"Open in iTerm":"No Claude Code session found",children:[d.jsx(Ps,{className:"mr-2 h-4 w-4"}),c?"Opening iTerm...":"Resume Session"]}),!y&&d.jsx("p",{className:"mt-1.5 text-center text-xs text-muted-foreground",children:"No matching Claude Code session found"})]})]})}return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-3",children:[d.jsx("h3",{className:"text-xs font-normal",children:"Sessions"}),d.jsx(Ve,{variant:"secondary",className:"text-xxs",children:e.length})]}),e.length===0?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:"No sessions recorded yet"})}):d.jsx(gr,{className:"flex-1 -mr-2 pr-2",children:d.jsx("div",{className:"space-y-2",children:e.map(g=>{const b=Array.isArray(g.discoveries)?g.discoveries:[],y=Array.isArray(g.next_steps)?g.next_steps:[];return d.jsx($l,{className:F("cursor-pointer transition-colors hover:border-primary/30",g.claude_session_id&&"border-l-2 border-l-primary/50","glow-blue-sm"),onClick:()=>h(g),children:d.jsxs(Ul,{className:"p-2.5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xxs text-muted-foreground",children:g.started_at&&Wi(new Date(g.started_at),"MMM d")}),Hi(g.action)&&d.jsx(Ve,{variant:"outline",className:"text-xxs px-1 py-0 font-light",children:Hi(g.action)})]}),d.jsx(ii,{className:"h-3.5 w-3.5 text-muted-foreground/50"})]}),d.jsx("p",{className:"mt-1 truncate text-xs font-normal",children:g.summary||"Untitled Session"}),d.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xxs text-muted-foreground",children:[b.length>0&&d.jsxs("span",{className:"text-bid-green",children:[b.length," completed"]}),y.length>0&&d.jsxs("span",{className:"text-accent-blue",children:[y.length," next"]}),g.claude_session_id&&d.jsx("span",{className:"text-primary/70",children:"resumable"})]})]})},g.id)})})})]})}function ff(e,t){return e.length>t?e.slice(0,t)+"...":e}function BM(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function zM({title:e,defaultOpen:t=!0,badge:n,children:r,className:i}){const[s,o]=m.useState(t);return d.jsxs("div",{className:F("border-b border-border/50 last:border-b-0",i),children:[d.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-4 py-2 text-left text-xs font-medium text-foreground/80 hover:text-foreground transition-colors",onClick:()=>o(a=>!a),"aria-expanded":s,children:[d.jsx(ii,{className:F("h-3.5 w-3.5 shrink-0 transition-transform duration-200",s&&"rotate-90")}),d.jsx("span",{className:"flex-1 truncate",children:e}),n&&d.jsx("span",{className:"shrink-0",children:n})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:s?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsx("div",{className:"px-4 pb-3",children:r})})})]})}function Cn({content:e}){return d.jsx(Bg,{content:e,className:"section-markdown"})}function VM({meta:e,content:t}){const n=e.total>0?e.done/e.total*100:0;return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-1.5 flex-1 rounded-full bg-muted",children:d.jsx("div",{className:F("h-full rounded-full transition-all duration-500",n===100?"bg-bid-green":"bg-accent-blue"),style:{width:`${n}%`}})}),d.jsxs("span",{className:"text-xxs text-muted-foreground",children:[e.done,"/",e.total]})]}),d.jsx("div",{className:"space-y-1",children:e.phases.map((r,i)=>{const s=/⏳|in.?progress|pending/i.test(r.status)&&!r.done;return d.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xxs",children:[r.done?d.jsx(Ab,{className:"h-3 w-3 shrink-0 text-bid-green"}):s?d.jsx(fr,{className:"h-3 w-3 shrink-0 text-accent-blue animate-spin"}):d.jsx(Db,{className:"h-3 w-3 shrink-0 text-muted-foreground/40"}),d.jsx("span",{className:"font-mono text-muted-foreground/50 w-4",children:r.name}),d.jsx("span",{className:F("flex-1",r.done?"text-muted-foreground":"text-foreground/80"),children:r.description})]},i)})}),t.split(`
339
339
  `).some(r=>r.trim()&&!/^\|/.test(r.trim()))&&d.jsx("div",{className:"pt-1",children:d.jsx(Cn,{content:t.split(`
340
340
  `).filter(r=>!r.trim().startsWith("|")).join(`
341
341
  `).trim()})})]})}function $M({meta:e,content:t}){const n=[];let r=null,i=0;for(const s of t.split(`
@@ -344,11 +344,11 @@ var ex=Object.defineProperty;var tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,config
344
344
  `).filter(o=>!o.trim().startsWith("|")).join(`
345
345
  `).trim();return d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-xxs",children:[d.jsx("thead",{children:d.jsx("tr",{className:"border-b border-border/50",children:r.map((o,a)=>d.jsx("th",{className:"px-2 py-1.5 text-left text-xxs font-medium uppercase tracking-wide text-muted-foreground/70",children:o},a))})}),d.jsx("tbody",{children:i.map((o,a)=>d.jsx("tr",{className:"border-b border-border/20",children:r.map((l,c)=>{var u,f;return d.jsx("td",{className:"px-2 py-1.5 text-foreground/70",children:c===0&&((u=o[c])!=null&&u.startsWith("`"))?d.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xxs font-mono",children:((f=o[c])==null?void 0:f.replace(/`/g,""))??""}):o[c]??""},c)})},a))})]})}),s&&d.jsx(Cn,{content:s})]})}function qM({section:e}){if(!e.meta)return null;if(e.meta.kind==="progress"){const{done:t,total:n}=e.meta,r=t===n?"text-bid-green":"text-muted-foreground";return d.jsxs("span",{className:`text-xxs ${r}`,children:[t,"/",n]})}if(e.meta.kind==="checklist"){const{done:t,total:n}=e.meta,r=n>0?t/n:0,i=r===1?"text-bid-green":r>=.5?"text-warning-amber":"text-muted-foreground";return d.jsxs("span",{className:`text-xxs ${i}`,children:[t,"/",n]})}if(e.meta.kind==="review"){const{blockers:t,warnings:n,suggestions:r,verdict:i}=e.meta;return d.jsxs("span",{className:"flex items-center gap-1.5",children:[i&&d.jsx(Ve,{variant:"outline",className:`h-4 px-1 text-xxs ${i.toUpperCase()==="PASS"?"border-bid-green/40 text-bid-green":"border-ask-red/40 text-ask-red"}`,children:i}),t>0&&d.jsxs("span",{className:"text-xxs text-ask-red",children:[t,"B"]}),n>0&&d.jsxs("span",{className:"text-xxs text-warning-amber",children:[n,"W"]}),r>0&&d.jsxs("span",{className:"text-xxs text-accent-blue",children:[r,"S"]})]})}return null}function KM({section:e}){var t,n,r;switch(e.type){case"quick-status":return d.jsx(UM,{content:e.content});case"progress":return((t=e.meta)==null?void 0:t.kind)==="progress"?d.jsx(VM,{meta:e.meta,content:e.content}):d.jsx(Cn,{content:e.content});case"requirements":case"success-criteria":case"definition-of-done":case"next-actions":return((n=e.meta)==null?void 0:n.kind)==="checklist"?d.jsx($M,{meta:e.meta,content:e.content}):d.jsx(Cn,{content:e.content});case"files-summary":case"risks":return d.jsx(HM,{content:e.content});case"agent-review":return d.jsx(WM,{meta:((r=e.meta)==null?void 0:r.kind)==="review"?e.meta:void 0,content:e.content});default:return d.jsx(Cn,{content:e.content})}}function GM({sections:e}){const t=m.useMemo(()=>{const n=[];let r="";for(const i of e)i.part!==r?(r=i.part,n.push({part:r,sections:[i]})):n[n.length-1].sections.push(i);return n},[e]);return d.jsx("div",{className:"divide-y-0",children:t.map((n,r)=>d.jsxs("div",{children:[r>0&&d.jsx("div",{className:"px-4 pt-4 pb-1",children:d.jsx("span",{className:"text-xxs font-medium uppercase tracking-widest text-muted-foreground/50",children:n.part})}),n.sections.map(i=>d.jsx(zM,{title:i.title,defaultOpen:!i.defaultCollapsed,badge:d.jsx(qM,{section:i}),children:d.jsx(KM,{section:i})},i.id))]},n.part))})}const YM={"quick status":"quick-status",progress:"progress","recent activity":"activity","next actions":"next-actions",overview:"overview",requirements:"requirements","technical approach":"approach","implementation phases":"phases","files summary":"files-summary","success criteria":"success-criteria","risk assessment":"risks","definition of done":"definition-of-done","review status":"agent-review",synthesis:"agent-review"},XM={"exploration log":"exploration","decisions & reasoning":"decisions",decisions:"decisions","implementation log":"implementation-log","deviations from spec":"deviations",deviations:"deviations"},JM=new Set(["Process","Agent Review"]),QM=/^[═=]{10,}\s*$/,ZM=/^##\s+(?:PART\s+\d+:\s*)?(.+)/i;function eD(e){return e.replace(/<!--[\s\S]*?-->/g,"").trim()}function tD(e){const t=e.split(`
346
346
  `),n=t.findIndex(i=>/\|\s*Phase\s*\|.*Description\s*\|.*Status\s*\|/i.test(i));if(n===-1)return;const r=[];for(let i=n+2;i<t.length;i++){const s=t[i].trim();if(!s.startsWith("|"))break;const o=s.split("|").map(a=>a.trim()).filter(Boolean);if(o.length>=3){const a=o[2];r.push({name:o[0],description:o[1],status:a,done:/✅|done|complete/i.test(a)})}}if(r.length!==0)return{kind:"progress",phases:r,done:r.filter(i=>i.done).length,total:r.length}}function nD(e){const t=[];for(const n of e.split(`
347
- `)){const r=n.match(/^[\s]*-\s+\[([ xX])\]\s+(.*)/);r&&t.push({text:r[2].trim(),checked:r[1]!==" "})}if(t.length!==0)return{kind:"checklist",items:t,done:t.filter(n=>n.checked).length,total:t.length}}function Hg(e){let t=0,n=0,r=0,i=null,s;for(const o of e.split(`
348
- `)){const a=o.trim();if(/\*\*BLOCKERS?\*\*/i.test(a)){i="blockers";continue}if(/\*\*WARNINGS?\*\*/i.test(a)){i="warnings";continue}if(/\*\*SUGGESTIONS?\*\*/i.test(a)){i="suggestions";continue}if(/\*\*VERIFIED/i.test(a)||/^###/i.test(a)){i=null;continue}i&&a.startsWith("- ")&&!/^-\s+none/i.test(a)&&(i==="blockers"?t++:i==="warnings"?n++:r++);const l=a.match(/\*\*Verdict\*\*:\s*(\w+)/i);l&&(s=l[1])}if(!(t===0&&n===0&&r===0&&!s))return{kind:"review",blockers:t,warnings:n,suggestions:r,verdict:s}}function qg(e,t){switch(e){case"progress":return tD(t);case"requirements":case"success-criteria":case"definition-of-done":case"next-actions":return nD(t);case"agent-review":return Hg(t);default:return}}function rD(e){const t=e.toLowerCase().trim();for(const[n,r]of Object.entries(YM))if(t.includes(n))return r;return"unknown"}function iD(e,t){const n=[],r=/<details>\s*\n\s*<summary>(.*?)<\/summary>([\s\S]*?)<\/details>/gi;let i;for(;(i=r.exec(e))!==null;){const s=i[1].replace(/[📝🤔📜⚠️]/gu,"").trim(),o=i[2].trim(),a=s.toLowerCase().trim();let l="unknown";for(const[c,u]of Object.entries(XM))if(a.includes(c)){l=u;break}n.push({id:l!=="unknown"?l:`process-${n.length}`,type:l,title:s,part:t,content:o,defaultCollapsed:!0,meta:qg(l,o)})}return n}function Wo(e,t){const n=[],r=e.split(`
347
+ `)){const r=n.match(/^[\s]*-\s+\[([ xX])\]\s+(.*)/);r&&t.push({text:r[2].trim(),checked:r[1]!==" "})}if(t.length!==0)return{kind:"checklist",items:t,done:t.filter(n=>n.checked).length,total:t.length}}function Wg(e){let t=0,n=0,r=0,i=null,s;for(const o of e.split(`
348
+ `)){const a=o.trim();if(/\*\*BLOCKERS?\*\*/i.test(a)){i="blockers";continue}if(/\*\*WARNINGS?\*\*/i.test(a)){i="warnings";continue}if(/\*\*SUGGESTIONS?\*\*/i.test(a)){i="suggestions";continue}if(/\*\*VERIFIED/i.test(a)||/^###/i.test(a)){i=null;continue}i&&a.startsWith("- ")&&!/^-\s+none/i.test(a)&&(i==="blockers"?t++:i==="warnings"?n++:r++);const l=a.match(/\*\*Verdict\*\*:\s*(\w+)/i);l&&(s=l[1])}if(!(t===0&&n===0&&r===0&&!s))return{kind:"review",blockers:t,warnings:n,suggestions:r,verdict:s}}function Hg(e,t){switch(e){case"progress":return tD(t);case"requirements":case"success-criteria":case"definition-of-done":case"next-actions":return nD(t);case"agent-review":return Wg(t);default:return}}function rD(e){const t=e.toLowerCase().trim();for(const[n,r]of Object.entries(YM))if(t.includes(n))return r;return"unknown"}function iD(e,t){const n=[],r=/<details>\s*\n\s*<summary>(.*?)<\/summary>([\s\S]*?)<\/details>/gi;let i;for(;(i=r.exec(e))!==null;){const s=i[1].replace(/[📝🤔📜⚠️]/gu,"").trim(),o=i[2].trim(),a=s.toLowerCase().trim();let l="unknown";for(const[c,u]of Object.entries(XM))if(a.includes(c)){l=u;break}n.push({id:l!=="unknown"?l:`process-${n.length}`,type:l,title:s,part:t,content:o,defaultCollapsed:!0,meta:Hg(l,o)})}return n}function Wo(e,t){const n=[],r=e.split(`
349
349
  `);let i=null,s=[];const o=JM.has(t);function a(){if(i===null)return;const l=s.join(`
350
- `).trim();if(!l)return;const c=eD(l);if(!c)return;const u=rD(i);n.push({id:u!=="unknown"?u:`${t.toLowerCase().replace(/\s+/g,"-")}-${n.length}`,type:u,title:i,part:t,content:c,defaultCollapsed:o,meta:qg(u,c)})}for(const l of r){const c=l.match(/^###\s+(.+)/);c?(a(),i=c[1].trim(),s=[]):s.push(l)}return a(),n}function sD(e){if(!e)return null;const t=e.split(`
350
+ `).trim();if(!l)return;const c=eD(l);if(!c)return;const u=rD(i);n.push({id:u!=="unknown"?u:`${t.toLowerCase().replace(/\s+/g,"-")}-${n.length}`,type:u,title:i,part:t,content:c,defaultCollapsed:o,meta:Hg(u,c)})}for(const l of r){const c=l.match(/^###\s+(.+)/);c?(a(),i=c[1].trim(),s=[]):s.push(l)}return a(),n}function sD(e){if(!e)return null;const t=e.split(`
351
351
  `),n=[];for(let s=0;s<t.length;s++)QM.test(t[s])&&n.push(s);if(n.length<2)return null;const r=[];for(let s=0;s<n.length-1;s+=2){const o=n[s],a=n[s+1];for(let l=o+1;l<a;l++){const c=ZM.exec(t[l]);if(c){const u=a+1,f=s+2<n.length?n[s+2]:t.length;let h=c[1].trim();/dashboard/i.test(h)?h="Dashboard":/specification/i.test(h)?h="Specification":/process/i.test(h)?h="Process":/agent\s*review/i.test(h)&&(h="Agent Review"),r.push({name:h,startLine:u,endLine:f});break}}}if(r.length===0)return null;const i=[];for(const s of r){const o=t.slice(s.startLine,s.endLine).join(`
352
352
  `);if(s.name==="Process"){const a=iD(o,s.name);a.length>0?i.push(...a):i.push(...Wo(o,s.name))}else if(s.name==="Agent Review"){const a=Wo(o,s.name);if(a.length>0){const l=a.map(u=>u.content).join(`
353
353
 
354
- `),c=Hg(l);i.push({id:"agent-review",type:"agent-review",title:"Agent Review",part:s.name,content:l,defaultCollapsed:!0,meta:c})}}else i.push(...Wo(o,s.name))}return i.length>0?i:null}function oD(e){const[t,n]=m.useState([]),[r,i]=m.useState(!1),s=Xt(),o=m.useCallback(async()=>{if(e==null){n([]);return}i(!0);try{const a=await fetch(s(`/scopes/${e}/sessions`));a.ok&&n(await a.json())}catch{}finally{i(!1)}},[e,s]);return m.useEffect(()=>{o()},[o]),m.useEffect(()=>{function a(){o()}return Q.on("session:updated",a),()=>{Q.off("session:updated",a)}},[o]),{sessions:t,loading:r}}const qi="h-7 w-full rounded border border-border bg-transparent px-2 text-xxs text-foreground/80 focus:outline-none focus:ring-1 focus:ring-primary/50",rr="text-xxs font-medium uppercase tracking-wide text-muted-foreground/70 mb-1";function aD(e){return{title:e.title,status:e.status,priority:e.priority??"",effort_estimate:e.effort_estimate??"",category:e.category??"",tags:[...e.tags],blocked_by:[...e.blocked_by],blocks:[...e.blocks]}}function lD(e,t){return e.title===t.title&&e.status===t.status&&e.priority===t.priority&&e.effort_estimate===t.effort_estimate&&e.category===t.category&&JSON.stringify(e.tags)===JSON.stringify(t.tags)&&JSON.stringify(e.blocked_by)===JSON.stringify(t.blocked_by)&&JSON.stringify(e.blocks)===JSON.stringify(t.blocks)}function pf({label:e,ids:t,onRemove:n,onAdd:r}){const[i,s]=m.useState(!1),[o,a]=m.useState("");return d.jsxs("div",{children:[d.jsx("p",{className:rr,children:e}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[t.map(l=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 rounded border border-border px-1.5 py-0.5 text-xxs text-foreground/70",children:[_t(l),d.jsx("button",{onClick:()=>n(l),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(wt,{className:"h-2.5 w-2.5"})})]},l)),i?d.jsx("input",{autoFocus:!0,className:"h-5 w-12 rounded bg-transparent px-1 text-xxs border border-primary/30 focus:outline-none",placeholder:"ID",value:o,onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(r(o),s(!1),a("")),l.key==="Escape"&&s(!1)},onBlur:()=>s(!1)}):d.jsx("button",{onClick:()=>s(!0),className:"hover:text-foreground transition-colors text-muted-foreground",children:d.jsx(si,{className:"h-3 w-3"})}),t.length===0&&!i&&d.jsx("span",{className:"text-xxs text-muted-foreground/50",children:"None"})]})]})}function cD({scope:e,open:t,onClose:n}){const{engine:r}=dn(),i=Xt(),{getApiBase:s,hasMultipleProjects:o}=Rt(),a=m.useCallback(_=>o&&(e!=null&&e.project_id)?`${s(e.project_id)}${_}`:i(_),[i,s,o,e==null?void 0:e.project_id]),{sessions:l,loading:c}=oD((e==null?void 0:e.id)??null),[u,f]=m.useState(null),[h,p]=m.useState(null),[g,b]=m.useState(!1),[y,x]=m.useState(null),[w,C]=m.useState(""),E=u&&h?!lD(u,h):!1,k=m.useMemo(()=>sD(e==null?void 0:e.raw_content),[e==null?void 0:e.raw_content]);m.useEffect(()=>{if(e&&t){const _=aD(e);f(_),p(_),x(null),C("")}},[e==null?void 0:e.id,e==null?void 0:e.updated_at,t]);const S=m.useCallback(async()=>{if(!(!e||!u||!E||g)){b(!0),x(null);try{const _={};h&&(u.title!==h.title&&(_.title=u.title),u.status!==h.status&&(_.status=u.status),u.priority!==h.priority&&(_.priority=u.priority||null),u.effort_estimate!==h.effort_estimate&&(_.effort_estimate=u.effort_estimate||null),u.category!==h.category&&(_.category=u.category||null),JSON.stringify(u.tags)!==JSON.stringify(h.tags)&&(_.tags=u.tags),JSON.stringify(u.blocked_by)!==JSON.stringify(h.blocked_by)&&(_.blocked_by=u.blocked_by),JSON.stringify(u.blocks)!==JSON.stringify(h.blocks)&&(_.blocks=u.blocks));const L=await fetch(a(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(!L.ok){const I=await L.json().catch(()=>({error:"Save failed"}));x(I.error??`HTTP ${L.status}`);return}p({...u})}catch{x("Network error — could not save")}finally{b(!1)}}},[e,u,h,E,g,a]);function A(){if(E&&window.confirm("Save changes before closing?")){S().then(n);return}n()}function T(_){f(L=>L&&{...L,..._}),x(null)}function R(_){const L=_.trim().toLowerCase();!L||!u||(u.tags.includes(L)||T({tags:[...u.tags,L]}),C(""))}function N(_,L){const I=parseInt(L,10);isNaN(I)||I<=0||!u||u[_].includes(I)||T({[_]:[...u[_],I]})}if(!e||!u)return null;const D=r.getValidTargets(e.status),P=[e.status,...D.filter(_=>_!==e.status)];return d.jsx(an,{open:t,onOpenChange:_=>{_||A()},children:d.jsxs(Yt,{className:"max-w-[min(72rem,calc(100vw_-_2rem))] h-[85vh] flex flex-col p-0 gap-0 overflow-hidden",children:[d.jsx(Tn,{className:"px-4 pt-3 pb-2",children:d.jsxs("div",{className:"flex items-start gap-3 pr-8",children:[d.jsx("span",{className:"font-mono text-xxs text-muted-foreground mt-1.5",children:_t(e.id)}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx(ln,{asChild:!0,children:d.jsx("input",{className:"w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground leading-tight",value:u.title,onChange:_=>T({title:_.target.value}),placeholder:"Scope title..."})}),d.jsx(cn,{asChild:!0,children:d.jsxs("span",{className:"mt-1 flex items-center gap-1 text-xxs text-muted-foreground",children:[d.jsx(th,{className:"h-3 w-3"}),d.jsx("span",{className:"truncate max-w-[400px]",children:e.file_path})]})})]})]})}),d.jsx(bs,{}),y&&d.jsxs("div",{className:"mx-4 mt-2 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-1.5 text-xs text-red-400",children:[d.jsx("span",{className:"flex-1",children:y}),d.jsx("button",{onClick:()=>x(null),className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(wt,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"flex flex-1 min-h-0",children:[d.jsx("div",{className:"flex-[65] min-w-0 border-r",children:d.jsx(gr,{className:"h-full",children:k?d.jsx("div",{className:"py-2",children:d.jsx(GM,{sections:k})}):d.jsx("div",{className:"px-6 py-5",children:e.raw_content?d.jsx(zg,{content:e.raw_content}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No content available"})})})}),d.jsx("div",{className:"flex-[35] min-w-0 flex flex-col",children:d.jsxs(gr,{className:"h-full",children:[d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Status"}),d.jsx("select",{className:qi,value:u.status,onChange:_=>T({status:_.target.value}),children:P.map(_=>d.jsx("option",{value:_,children:_},_))})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Priority"}),d.jsxs("select",{className:qi,value:u.priority,onChange:_=>T({priority:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),ol.map(_=>d.jsx("option",{value:_,children:_},_))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Effort"}),d.jsxs("select",{className:qi,value:u.effort_estimate,onChange:_=>T({effort_estimate:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),Is.map(_=>d.jsx("option",{value:_,children:_},_))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Category"}),d.jsxs("select",{className:qi,value:u.category,onChange:_=>T({category:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),al.map(_=>d.jsx("option",{value:_,children:_},_))]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Tags"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u.tags.map(_=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 glass-pill rounded border border-border px-1.5 py-0.5 text-xxs text-muted-foreground",children:[_,d.jsx("button",{onClick:()=>T({tags:u.tags.filter(L=>L!==_)}),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(wt,{className:"h-2.5 w-2.5"})})]},_)),d.jsx("input",{className:"h-5 w-16 rounded bg-transparent text-xxs text-muted-foreground placeholder:text-muted-foreground/50 border-none focus:outline-none",placeholder:"+tag",value:w,onChange:_=>C(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),R(w))},onBlur:()=>{w.trim()&&R(w)}})]})]}),d.jsx(pf,{label:"Blocked by",ids:u.blocked_by,onRemove:_=>T({blocked_by:u.blocked_by.filter(L=>L!==_)}),onAdd:_=>N("blocked_by",_)}),d.jsx(pf,{label:"Blocks",ids:u.blocks,onRemove:_=>T({blocks:u.blocks.filter(L=>L!==_)}),onAdd:_=>N("blocks",_)})]}),d.jsx(bs,{}),d.jsx("div",{className:"p-4 flex-1",children:d.jsx(FM,{sessions:l,loading:c})})]})})]}),E&&d.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded border border-border px-3 py-2",children:[d.jsx(Ve,{variant:"outline",children:"Unsaved changes"}),d.jsx("div",{className:"flex-1"}),d.jsx(ke,{variant:"ghost",size:"sm",onClick:()=>{f(h),x(null)},children:"Discard"}),d.jsx(ke,{size:"sm",onClick:()=>S(),disabled:g,children:g?"Saving...":"Save"}),y&&d.jsx("span",{className:"text-xs text-destructive ml-2",children:y})]})]})})}function uD({open:e,loading:t,onSubmit:n,onCancel:r,onSurprise:i,surpriseLoading:s}){const[o,a]=m.useState(""),[l,c]=m.useState(""),u=m.useRef(null);m.useEffect(()=>{e&&(a(""),c(""),setTimeout(()=>{var p;return(p=u.current)==null?void 0:p.focus()},100))},[e]);function f(){o.trim()&&n(o.trim(),l.trim())}function h(p){(p.metaKey||p.ctrlKey)&&p.key==="Enter"&&(p.preventDefault(),f())}return d.jsx(an,{open:e,onOpenChange:p=>{p||r()},children:d.jsxs(Yt,{className:"max-w-lg p-5 gap-0",onKeyDown:h,children:[d.jsxs(Tn,{className:"mb-4",children:[d.jsx(ln,{className:"text-sm font-normal",children:"New Idea"}),d.jsx(cn,{className:"text-xxs text-muted-foreground",children:"Capture a feature idea for the icebox"})]}),d.jsx("input",{ref:u,className:"mb-3 w-full rounded bg-muted/50 px-3 py-2 text-sm text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 placeholder:text-muted-foreground",placeholder:"Feature name...",value:o,onChange:p=>a(p.target.value)}),d.jsx("textarea",{className:"mb-4 w-full rounded bg-muted/50 px-3 py-2.5 text-xs text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 resize-y placeholder:text-muted-foreground",placeholder:"Describe the idea... What problem does it solve? Any notes on approach?",rows:6,value:l,onChange:p=>c(p.target.value)}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ke,{size:"sm",onClick:f,disabled:t||!o.trim(),className:"flex-1",children:t?"Creating...":"Create"}),d.jsx(ke,{size:"sm",variant:"ghost",onClick:r,disabled:t,children:"Cancel"}),d.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/50",children:["⌘","+Enter"]})]}),d.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[d.jsx(ke,{size:"sm",variant:"outline",className:"w-full text-purple-400 border-purple-500/30 hover:bg-purple-500/10 hover:border-purple-500/50",onClick:i,disabled:s,children:s?d.jsxs(d.Fragment,{children:[d.jsx(fr,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Generating ideas..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Wa,{className:"h-3.5 w-3.5 mr-2"}),"Surprise Me"]})}),d.jsx("p",{className:"mt-1.5 text-center text-[10px] text-muted-foreground",children:"AI analyzes the codebase and suggests feature ideas"})]})]})})}function dD({scope:e,open:t,onClose:n,onDelete:r,onApprove:i,onReject:s}){const o=Xt(),[a,l]=m.useState(""),[c,u]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(""),[b,y]=m.useState(!1),[x,w]=m.useState(!1),C=m.useRef(null),E=!!(e!=null&&e.is_ghost),k=a!==f||c!==p;m.useEffect(()=>{if(e&&t){const R=e.title??"",N=e.raw_content??"";l(R),u(N),h(R),g(N),w(!1);const D=E?void 0:setTimeout(()=>{var P;return(P=C.current)==null?void 0:P.focus()},100);return()=>{clearTimeout(D)}}},[e==null?void 0:e.id,t]);const S=m.useCallback(async()=>{if(!(!(e!=null&&e.slug)||!k||b||E)){y(!0);try{const R=await fetch(o(`/ideas/${e.slug}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,description:c})});R.ok?(h(a),g(c)):console.error("[Orbital] Failed to save idea:",R.status,R.statusText)}finally{y(!1)}}},[e,a,c,k,b,E,o]);m.useEffect(()=>{if(!k||!t||E)return;const R=setInterval(()=>{S()},1e4);return()=>clearInterval(R)},[k,t,S,E]);function A(){if(k&&!E&&window.confirm("Save changes before closing?")){S().then(n);return}n()}function T(){if(!x){w(!0);return}e!=null&&e.slug&&r(e.slug)}return e?d.jsx(an,{open:t,onOpenChange:R=>{R||A()},children:d.jsxs(Yt,{className:"max-w-md p-0 gap-0 flex flex-col max-h-[70vh]",children:[d.jsx(ln,{className:"sr-only",children:E?"AI suggested idea":"Edit idea"}),d.jsx(cn,{className:"sr-only",children:E?"Review and approve or reject this AI-suggested idea":"Edit idea title and description, or delete the idea"}),d.jsx(Tn,{className:"px-4 pt-3 pb-2",children:d.jsxs("div",{className:"flex items-center gap-2 pr-8",children:[d.jsx("div",{className:"flex-1 min-w-0",children:E?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Wa,{className:"h-3.5 w-3.5 text-purple-400 shrink-0"}),d.jsx("span",{className:"text-sm font-normal text-foreground truncate",children:a})]}):d.jsx("input",{ref:C,className:"w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground",placeholder:"Idea title...",value:a,onChange:R=>l(R.target.value)})}),E?d.jsx("span",{className:"shrink-0 rounded border border-purple-500/30 bg-purple-500/10 px-1.5 py-0.5 text-[10px] text-purple-400 uppercase",children:"ai suggestion"}):x?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ke,{size:"sm",variant:"destructive",className:"h-6 text-xxs",onClick:T,children:"Confirm"}),d.jsx(ke,{size:"sm",variant:"ghost",className:"h-6 text-xxs",onClick:()=>w(!1),children:"No"})]}):d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-destructive",onClick:T,title:"Delete idea",children:d.jsx(L0,{className:"h-3.5 w-3.5"})})]})}),d.jsx("div",{className:"flex-1 min-h-0 px-4 pb-4",children:E?d.jsx("div",{className:"w-full min-h-[200px] rounded bg-transparent px-3 py-2.5 text-xs text-foreground/80 border border-border/50 whitespace-pre-wrap",children:c||d.jsx("span",{className:"text-muted-foreground italic",children:"No description"})}):d.jsx("textarea",{className:"w-full h-full min-h-[200px] rounded bg-transparent px-3 py-2.5 text-xs text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 resize-none placeholder:text-muted-foreground",placeholder:"Describe the idea... What problem does it solve? Any notes on approach?",value:c,onChange:R=>u(R.target.value)})}),E?d.jsxs("div",{className:"px-4 pb-3 flex items-center gap-2",children:[d.jsxs(ke,{size:"sm",className:"flex-1 bg-green-600/20 border border-green-500/30 text-green-400 hover:bg-green-600/30 hover:text-green-300",onClick:()=>e.slug&&i(e.slug),disabled:!e.slug,children:[d.jsx(Kn,{className:"h-3.5 w-3.5 mr-1.5"}),"Approve"]}),d.jsxs(ke,{size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>e.slug&&s(e.slug),disabled:!e.slug,children:[d.jsx(wt,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}):d.jsxs("div",{className:"px-4 pb-3 flex items-center justify-between text-xxs text-muted-foreground",children:[d.jsx("span",{children:b?"Saving...":k?"Unsaved changes":"Saved"}),d.jsx(ke,{size:"sm",variant:"ghost",className:"h-6",onClick:()=>S(),disabled:!k||b,children:"Save"})]})]})}):null}const Ho=[{field:"priority",label:"Priority"},{field:"category",label:"Category"},{field:"tags",label:"Tags"},{field:"effort",label:"Effort"},{field:"dependencies",label:"Dependencies"}],fD={priority:"Priority",category:"Category",tags:"Tag",effort:"Effort",dependencies:"Dep"},hD={feature:"#536dfe",bugfix:"#ff1744",refactor:"#8B5CF6",infrastructure:"#40c4ff",docs:"#6B7280"},pD={priority:"text-warning-amber",category:"text-accent-blue",tags:"text-info-cyan",effort:"text-muted-foreground",dependencies:"text-ask-red"};function mD({filters:e,optionsWithCounts:t,onToggle:n,onClearField:r,onClearAll:i,hasActiveFilters:s}){jr();const[o,a]=m.useState(null),l=Ho.reduce((u,{field:f})=>u+e[f].size,0),c=[];for(const{field:u}of Ho){if(e[u].size===0)continue;const f=[];for(const h of e[u]){const p=t[u].find(g=>g.value===h);f.push({value:h,label:(p==null?void 0:p.label)??h})}c.push({field:u,values:f})}return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(An,{onOpenChange:()=>a(null),children:[d.jsx(_n,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:F("card-glass gap-1.5 bg-white/[0.03] border-white/10",s&&"border-white/20 text-foreground"),"aria-label":"Filter scopes",children:[d.jsx(Kb,{className:"h-3 w-3"}),"Filters",l>0&&d.jsx("span",{className:"ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]",children:l})]})}),d.jsxs(un,{align:"start",className:"filter-popover-glass !bg-transparent w-52",children:[d.jsx("div",{className:"space-y-0.5",children:Ho.map(({field:u,label:f})=>{const h=t[u];if(h.length===0)return null;const p=o===u,g=e[u].size;return d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>a(p?null:u),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",p&&"bg-white/[0.06]"),children:[d.jsx(ii,{className:F("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150",p&&"rotate-90")}),d.jsx("span",{className:F(g>0&&"text-foreground"),children:f}),g>0&&d.jsx("span",{className:"ml-auto rounded-full bg-white/10 px-1.5 text-[10px]",children:g})]}),p&&d.jsxs("div",{className:"ml-2 border-l border-white/[0.06] pl-2 mt-0.5 mb-1 space-y-0.5",children:[h.map(b=>{const y=e[u].has(b.value);return d.jsxs("button",{type:"button",onClick:()=>n(u,b.value),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",y&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",y?F("border-primary bg-primary text-primary-foreground",pD[u]):"border-white/15"),children:y&&d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:F("capitalize",y&&"text-foreground"),children:b.label}),d.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:b.count})]},b.value)}),g>0&&d.jsxs("button",{type:"button",onClick:()=>r(u),className:"w-full rounded px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors text-left",children:["Clear ",f.toLowerCase()]})]})]},u)})}),s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 border-t border-white/[0.06]"}),d.jsx("button",{type:"button",onClick:i,className:"w-full rounded px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors text-center",children:"Clear all filters"})]})]})]}),c.map(({field:u,values:f})=>d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground capitalize",children:[fD[u],":"]}),f.map(({value:h,label:p})=>{const g=u==="category";return d.jsxs(Ve,{variant:g?"outline":"secondary",className:F("gap-0.5 capitalize cursor-pointer hover:bg-secondary/60 py-0 px-1 text-[10px] font-light",!g&&"glass-pill",g&&"bg-[rgba(var(--neon-blue),0.08)]"),style:g?{borderColor:hD[h]}:void 0,onClick:()=>n(u,h),children:[p,d.jsx(wt,{className:"h-2 w-2 opacity-60"})]},h)})]},u))]})}function gD({query:e,mode:t,isStale:n,onQueryChange:r,onModeChange:i}){jr();const s=m.useRef(null),o=m.useRef(null),[a,l]=m.useState(!!e),c=m.useCallback(()=>{requestAnimationFrame(()=>{var f;!((f=o.current)!=null&&f.contains(document.activeElement))&&!e&&l(!1)})},[e]);m.useEffect(()=>{function f(h){h.key==="/"&&!(h.target instanceof HTMLInputElement)&&!(h.target instanceof HTMLTextAreaElement)&&(h.preventDefault(),l(!0))}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),m.useEffect(()=>{if(a){const f=setTimeout(()=>{var h;return(h=s.current)==null?void 0:h.focus()},50);return()=>clearTimeout(f)}},[a]);const u=m.useCallback(f=>{var h;f.key==="Escape"&&(e?r(""):(h=s.current)==null||h.blur())},[e,r]);return d.jsxs("div",{ref:o,className:F("flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs","backdrop-blur-sm bg-white/[0.03] border-white/10","transition-all duration-200 ease-out",a?"focus-within:border-white/20":"cursor-pointer hover:bg-white/[0.06]",a&&"focus-within:glow-blue"),role:"search","aria-label":"Search scopes",onClick:a?void 0:()=>l(!0),onBlur:a?c:void 0,children:[d.jsx(b0,{className:F("h-3 w-3 shrink-0 text-muted-foreground",n&&"animate-pulse")}),d.jsx("span",{className:F("text-xs font-medium whitespace-nowrap overflow-hidden transition-all duration-200 ease-out",a?"w-0 opacity-0":"w-10 opacity-100"),children:"Search"}),d.jsx("input",{ref:s,type:"text",value:e,onChange:f=>r(f.target.value.slice(0,100)),onKeyDown:u,placeholder:"Search scopes...",className:F("min-w-0 overflow-hidden bg-transparent text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none","transition-all duration-200 ease-out",a?"w-48 opacity-100":"w-0 opacity-0"),tabIndex:a?0:-1,"aria-label":"Search scopes"}),a&&e&&d.jsx("button",{onClick:()=>{var f;r(""),(f=s.current)==null||f.focus()},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors animate-in fade-in zoom-in-75 duration-150","aria-label":"Clear search",children:d.jsx(wt,{className:"h-3 w-3"})}),d.jsxs("div",{className:F("flex shrink-0 overflow-hidden -my-1 -mr-2 rounded-r-md","transition-all duration-200 ease-out",a?"max-w-[150px] opacity-100 border-l border-white/10":"max-w-0 opacity-0 border-l border-transparent"),children:[d.jsx("button",{onClick:()=>i("filter"),className:F("px-2 py-1 text-[10px] whitespace-nowrap transition-colors",t==="filter"?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-white/[0.04]"),tabIndex:a?0:-1,"aria-pressed":t==="filter",children:"Filter"}),d.jsx("button",{onClick:()=>i("highlight"),className:F("px-2 py-1 text-[10px] whitespace-nowrap transition-colors",t==="highlight"?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-white/[0.04]"),tabIndex:a?0:-1,"aria-pressed":t==="highlight",children:"Highlight"})]})]})}function xD({open:e,sprint:t,graph:n,loading:r,onConfirm:i,onCancel:s}){const{engine:o}=dn(),[a,l]=m.useState(!1);if(m.useEffect(()=>{e&&l(!1)},[e]),!t)return null;const c=new Map(t.scopes.map(y=>[y.scope_id,y])),u=(n==null?void 0:n.layers)??[],f=t.scope_ids.length,h=o.getBatchTargetStatus(t.target_column),p=h?o.findEdge(t.target_column,h):void 0,g=o.getBatchCommand(t.target_column)??null,b=async()=>{l(!0),i()};return d.jsx(an,{open:e,onOpenChange:y=>!y&&s(),children:d.jsxs(Yt,{className:"sm:max-w-lg p-0 gap-0",children:[d.jsxs(Tn,{className:"px-5 pt-4 pb-3",children:[h&&d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:t.target_column}),d.jsx(ns,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:h})]}),d.jsx(ln,{className:"text-sm font-normal",children:(p==null?void 0:p.label)??"Dispatch Sprint"}),d.jsxs(cn,{className:"text-xs text-muted-foreground mt-1",children:[f," scope",f!==1?"s":""," in"," ",u.length," layer",u.length!==1?"s":"",", max"," ",t.concurrency_cap," concurrent"]})]}),d.jsxs("div",{className:"px-5 pb-4 space-y-3",children:[g&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-surface/30 px-3 py-2",children:[d.jsx(Ps,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("code",{className:"text-xs font-mono text-primary",children:g})]}),d.jsx("div",{className:"max-h-64 overflow-y-auto space-y-3 rounded border border-border bg-surface/30 px-3 py-2",children:u.map((y,x)=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs(Ve,{variant:"outline",className:"text-xxs",children:["Layer ",x]}),x===0&&d.jsx("span",{className:"text-xxs text-primary",children:"Launches first"}),x>0&&d.jsxs("span",{className:"text-xxs text-muted-foreground",children:["Waits for Layer ",x-1]})]}),d.jsx("div",{className:"ml-4 space-y-1",children:y.map(w=>{const C=c.get(w);return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground w-8 shrink-0",children:_t(w)}),d.jsx("span",{className:"truncate flex-1 font-light",children:(C==null?void 0:C.title)??"Unknown"}),(C==null?void 0:C.effort_estimate)&&d.jsx("span",{className:"text-xxs text-muted-foreground shrink-0",children:C.effort_estimate})]},w)})}),x<u.length-1&&d.jsx("div",{className:"flex justify-center my-1",children:d.jsx(ns,{className:"h-3 w-3 text-muted-foreground rotate-90"})})]},y.join("-")))}),u.length===0&&!r&&d.jsxs("div",{className:F("flex items-start gap-2 rounded border px-3 py-2 text-xs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(rn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:"Could not compute execution layers. Sprint may have issues."})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{onClick:b,disabled:a||r||u.length===0,className:"flex-1",children:a?"Dispatching...":g?"Launch in iTerm":"Dispatch Sprint"}),d.jsx(ke,{variant:"ghost",onClick:s,disabled:a,children:"Cancel"})]})]})]})})}function yD({open:e,unmetDeps:t,onAddAll:n,onCancel:r}){const i=new Map;for(const s of t)for(const o of s.missing)i.has(o.scope_id)||i.set(o.scope_id,{title:o.title,status:o.status});return d.jsx(an,{open:e,onOpenChange:s=>!s&&r(),children:d.jsxs(Yt,{className:"sm:max-w-md",children:[d.jsxs(Tn,{children:[d.jsxs(ln,{className:"flex items-center gap-2 text-sm",children:[d.jsx(rn,{className:"h-4 w-4 text-warning-amber"}),"Unmet Dependencies"]}),d.jsx(cn,{className:"text-xs",children:"Some scopes you added depend on scopes not yet in this sprint."})]}),d.jsx("div",{className:"space-y-3 my-2",children:t.map(s=>d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(s.scope_id)}),d.jsx("span",{className:"ml-1",children:"depends on:"}),d.jsx("div",{className:"ml-4 mt-1 space-y-1",children:s.missing.map(o=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(o.scope_id)}),d.jsx("span",{className:"truncate",children:o.title}),d.jsx(Ve,{variant:"outline",className:"text-[10px] ml-auto shrink-0",children:o.status})]},o.scope_id))})]},s.scope_id))}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t",children:[d.jsxs(ke,{variant:"ghost",size:"sm",onClick:r,children:[d.jsx(wt,{className:"h-3 w-3 mr-1"})," Cancel"]}),d.jsxs(ke,{size:"sm",onClick:()=>n([...i.keys()]),children:[d.jsx(si,{className:"h-3 w-3 mr-1"})," Add All Dependencies"]})]})]})})}function bD({columnId:e,dispatching:t,onOpenIdeaForm:n,onCreateGroup:r}){const{engine:i}=dn(),s=i.getEntryPoint().id,o=i.getList(e),a=(o==null?void 0:o.supportsBatch)??!1,l=(o==null?void 0:o.supportsSprint)??!1;if(e===s&&n)return d.jsx(ke,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:n,disabled:t,title:"Add idea",children:d.jsx(si,{className:"h-3 w-3"})});if((l||a)&&r){const u=a?"batch":"sprint",f=a?"Batch":"Sprint";return d.jsx(ke,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:()=>r(`New ${f}`,{target_column:e,group_type:u}),title:`Create ${f.toLowerCase()}`,children:d.jsx(si,{className:"h-3 w-3"})})}return null}const vD=e=>{const t=aw(e),n=t.find(r=>String(r.id).startsWith("sprint-drop-"));return n?[n]:t.length>0?t:Dh(e)};function Oa(e){if(!e.some(r=>r.favourite))return e;const t=[],n=[];for(const r of e)(r.favourite?t:n).push(r);return[...t,...n]}const wD={critical:"bg-ask-red",high:"bg-warning-amber",medium:"bg-accent-blue",low:"bg-muted-foreground/30"},kD={feature:"bg-category-feature",bugfix:"bg-category-bugfix",refactor:"bg-category-refactor",infrastructure:"bg-category-infrastructure",docs:"bg-category-docs"},SD={"has-blockers":"Has blockers","blocks-others":"Blocks others","no-deps":"No dependencies"},CD={priority:ol,category:al,effort:Is,dependencies:Qh,tags:[],project:[]};function jD(e,t){return e==="priority"?wD[t]??"bg-muted-foreground/30":e==="category"?kD[t]??"bg-primary/40":"bg-primary/40"}function ED(e,t){return e==="dependencies"?SD[t]??t:t}function ND(){return new Proxy({},{get(e,t){return t in e||(e[t]=[]),e[t]}})}function TD(e,t,n,r,i,s){const o=new Map,a=new Map;for(const h of e){const p=ll(h,t),g=p.length>0?p:["Unset"];for(const b of g){o.has(b)||(o.set(b,ND()),a.set(b,0));const y=o.get(b),x=i?i(h):h.status;y[x]?y[x].push(h):y.planning.push(h),a.set(b,(a.get(b)??0)+1)}}for(const h of o.values())for(const p of Object.keys(h))h[p]=Oa(aa(h[p],n,r));const l=CD[t],c=[...o.keys()],u=[];for(const h of l)o.has(h)&&u.push(h);const f=c.filter(h=>h!=="Unset"&&!l.includes(h)).sort();return u.push(...f),o.has("Unset")&&u.push("Unset"),u.map(h=>{const p=t==="project"&&h!=="Unset"?s==null?void 0:s.get(h):void 0;return{value:h,label:h==="Unset"?"Unset":p?p.name:ED(t,h),color:h==="Unset"?"bg-muted-foreground/20":p?"":jD(t,h),colorHsl:p==null?void 0:p.color,count:a.get(h)??0,cells:o.get(h)}})}const PD={queued:"210 50% 50%",active:"0 70% 55%",review:"45 80% 50%",shipped:"153 70% 45%"};function AD(e,t){var a,l,c,u;const n=[...t.values()];if(n.length===0)return{isUnified:!0,columns:[],scopesByColumn:{}};if(V1(n)){const f=n[0],p=f.getBoardColumns().map(y=>({id:y.id,label:y.label,color:y.color,phase:new yr(f).getPhase(y.id)})),g={};for(const y of p)g[y.id]=[];const b=f.getEntryPoint().id;for(const y of e){const x=g[y.status]?y.status:b;(a=g[x])==null||a.push(y)}return{isUnified:!0,columns:p,scopesByColumn:g}}const i=new Map;for(const[f,h]of t)i.set(f,new yr(h));const s=z1.map(f=>({id:f.phase,label:f.label,color:PD[f.phase],phase:f.phase})),o={};for(const f of s)o[f.id]=[];for(const f of e){const h=f.project_id;if(!h){(l=o.queued)==null||l.push(f);continue}const p=i.get(h);if(p){const g=p.getPhase(f.status);(c=o[g])==null||c.push(f)}else(u=o.queued)==null||u.push(f)}return{isUnified:!1,columns:s,scopesByColumn:o}}function _D({open:e,onClose:t,projects:n}){const[r,i]=m.useState(null),[s,o]=m.useState(null);async function a(l,c){i(l),o(null);try{const u=await fetch(`/api/orbital/projects/${l}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!u.ok){const f=await u.json().catch(()=>({}));o(f.error??`Failed to update project (HTTP ${u.status})`)}}catch{o("Failed to update project")}finally{i(null)}}return d.jsx(an,{open:e,onOpenChange:l=>{l||t()},children:d.jsxs(Yt,{className:"max-w-[440px] max-h-[80vh] p-0 gap-0 flex flex-col",children:[d.jsxs(Tn,{className:"border-b border-white/[0.08] px-4 py-3",children:[d.jsx(ln,{children:"Project Settings"}),d.jsx(cn,{className:"sr-only",children:"Manage registered projects, colors, names, and visibility"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:[n.map(l=>d.jsx(RD,{project:l,updating:r===l.id,onUpdate:c=>a(l.id,c)},l.id)),s&&d.jsx("p",{className:"px-3 text-[11px] text-destructive",children:s})]})]})})}function RD({project:e,updating:t,onUpdate:n}){const[r,i]=m.useState(!1),[s,o]=m.useState(e.name),a=m.useRef(null);m.useEffect(()=>{var u;r&&((u=a.current)==null||u.focus())},[r]),m.useEffect(()=>{r||o(e.name)},[e.name,r]);const l=s.trim()!==""&&s.trim()!==e.name,c=m.useCallback(()=>{i(!1);const u=s.trim();u&&u!==e.name?n({name:u}):o(e.name)},[s,e.name,n]);return d.jsxs("div",{className:F("flex items-center gap-3 rounded border border-white/[0.08] px-3 py-2","transition-colors hover:border-[rgba(var(--neon-cyan),0.2)]",!e.enabled&&"opacity-50"),children:[d.jsx(bh,{value:e.color,onChange:u=>n({color:u}),disabled:t}),d.jsxs("div",{className:"flex-1 min-w-0",children:[r?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{ref:a,value:s,onChange:u=>o(u.target.value),onBlur:()=>{o(e.name),i(!1)},onKeyDown:u=>{u.key==="Enter"&&c(),u.key==="Escape"&&(o(e.name),i(!1))},className:"flex-1 min-w-0 bg-transparent text-xs font-medium outline-none border-b border-primary/50 pb-0.5"}),l&&d.jsx("button",{onMouseDown:u=>{u.preventDefault(),c()},className:"shrink-0 text-primary hover:text-primary/80 transition-colors",title:"Save name",children:d.jsx(Kn,{className:"h-3.5 w-3.5"})})]}):d.jsx("div",{className:"text-xs font-medium truncate cursor-text hover:text-primary transition-colors",onClick:()=>i(!0),title:"Click to rename",children:e.name}),d.jsx("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:e.path})]}),d.jsx("button",{onClick:()=>n({enabled:!e.enabled}),disabled:t,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",title:e.enabled?"Hide project":"Show project",children:e.enabled?d.jsx(rh,{className:"h-3.5 w-3.5"}):d.jsx(nh,{className:"h-3.5 w-3.5"})})]})}function MD({countOverrides:e}={}){const{projects:t,activeProjectId:n,setActiveProjectId:r,hasMultipleProjects:i}=Rt(),[s,o]=m.useState(!1),[a,l]=m.useState(!1),c=n===null;return d.jsxs("div",{className:"project-tab-bar -mt-8 mb-3 flex items-center gap-0.5 overflow-x-auto rounded border border-white/[0.08] px-1 py-1",children:[i&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",onClick:()=>r(null),className:F("flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium whitespace-nowrap","transition-all duration-300 ease-in-out border-b-2",c?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:c?{background:"rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(255, 255, 255, 0.12)",borderBottomColor:"rgba(255, 255, 255, 0.50)"}:void 0,children:[d.jsx(Ts,{className:"h-3 w-3"}),"All Projects",d.jsx("span",{className:F("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",c?"glass-pill":"bg-muted border-transparent"),children:e?t.filter(u=>u.enabled).reduce((u,f)=>u+(e[f.id]??0),0):t.filter(u=>u.enabled).reduce((u,f)=>u+f.scopeCount,0)})]}),d.jsx("div",{className:"mx-0.5 h-4 w-px bg-white/[0.08]"}),t.filter(u=>u.enabled).map(u=>{const f=n===u.id;return d.jsxs("button",{type:"button",onClick:()=>r(u.id),className:F("flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium whitespace-nowrap","transition-all duration-300 ease-in-out border-b-2",f?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:f?{background:`hsl(${u.color} / 0.10)`,boxShadow:`0 2px 12px hsl(${u.color} / 0.25)`,borderBottomColor:`hsl(${u.color} / 0.50)`}:void 0,children:[d.jsx("span",{className:F("h-2 w-2 rounded-full shrink-0 transition-shadow duration-300",f&&"shadow-[0_0_6px_currentColor]"),style:{backgroundColor:`hsl(${u.color})`}}),u.name,d.jsx("span",{className:F("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",f?"glass-pill":"bg-muted border-transparent"),children:e?e[u.id]??0:u.scopeCount}),u.status==="offline"&&d.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"(offline)"})]},u.id)})]}),d.jsxs("div",{className:"ml-auto shrink-0 pl-1 flex items-center gap-0.5",children:[d.jsx("button",{type:"button",onClick:()=>l(!0),className:"flex items-center justify-center rounded p-1.5 text-muted-foreground/60 hover:text-foreground hover:bg-white/[0.06] transition-colors",title:"Add project",children:d.jsx(si,{className:"h-3.5 w-3.5"})}),i&&d.jsx("button",{type:"button",onClick:()=>o(!0),className:"flex items-center justify-center rounded p-1.5 text-muted-foreground/60 hover:text-foreground hover:bg-white/[0.06] transition-colors",title:"Project settings",children:d.jsx(w0,{className:"h-3.5 w-3.5"})})]}),d.jsx(vh,{open:a,onClose:()=>l(!1)}),d.jsx(_D,{open:s,onClose:()=>o(!1),projects:t})]})}function DD({open:e,edges:t,onSelect:n,onCancel:r}){return!e||t.length===0?null:d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:d.jsxs("div",{className:"card-glass w-80 rounded-lg border border-border bg-card p-4 shadow-xl space-y-3",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Choose Transition"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Multiple transitions are available for this move. Select one:"}),d.jsx("div",{className:"space-y-1.5",children:t.map(i=>d.jsxs("button",{onClick:()=>n(i),className:"flex w-full items-center gap-2 rounded border border-border px-3 py-2 text-left text-xs hover:bg-muted/50 transition-colors",children:[d.jsx("span",{className:"font-medium",children:i.label??`${i.from} → ${i.to}`}),i.description&&d.jsx("span",{className:"text-muted-foreground/70 truncate",children:i.description})]},`${i.from}-${i.to}`))}),d.jsx("div",{className:"flex justify-end pt-1",children:d.jsx("button",{onClick:r,className:"rounded px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})})]})})}function OD(){var jt,hn,pn,Dt,mn,Xn,lc,cc;const e=Xt(),{scopes:t,loading:n}=Ph(),{engine:r}=dn(),{activeProjectId:i,projects:s,projectEngines:o,hasMultipleProjects:a}=Rt(),{sortField:l,sortDirection:c,setSort:u,collapsed:f,toggleCollapse:h}=_1(),{viewMode:p,setViewMode:g,groupField:b,setGroupField:y,collapsedLanes:x,toggleLaneCollapse:w}=L1(),{display:C,toggle:E,hiddenCount:k}=b1(),[S,A]=m.useState(null),T=m.useMemo(()=>t.find(q=>ce(q)===S)??null,[t,S]),[R,N]=m.useState(null),D=m.useMemo(()=>r.getBoardColumns(),[r]),P=a&&i===null,_=m.useMemo(()=>!P||o.size===0?null:AD(t,o),[P,t,o]),L=(_==null?void 0:_.columns)??D,I=m.useMemo(()=>{const q=new Map;for(const oe of s)q.set(oe.id,oe);return q.size>0?q:void 0},[s]),{sprints:H,createSprint:M,renameSprint:$,deleteSprint:z,addScopes:v,removeScopes:U,dispatchSprint:ne,getGraph:j,moveSprintToProject:K}=H1(),[X,W]=m.useState(null),Le=P?(jt=s.find(q=>q.enabled))==null?void 0:jt.id:void 0,{filters:Ce,toggleFilter:Re,clearField:ge,clearAll:me,hasActiveFilters:je,filteredScopes:be,optionsWithCounts:de}=j1(t),fe=Y1(be),{highlightedScopeKey:Ne,clearHighlight:nt}=X1(),Je=m.useMemo(()=>{if(Ne==null)return fe.dimmedIds;const q=new Set;for(const oe of fe.displayScopes)ce(oe)!==Ne&&q.add(ce(oe));return q},[Ne,fe.dimmedIds,fe.displayScopes]);m.useEffect(()=>{if(Ne==null)return;const q=setTimeout(()=>{document.addEventListener("click",nt,{once:!0})},100);return()=>{clearTimeout(q),document.removeEventListener("click",nt)}},[Ne,nt]);const{state:Y,onDragStart:$e,onDragOver:ut,onDragEnd:Qe,confirmTransition:Te,cancelTransition:De,dismissError:Fe,openModalFromPopover:O,openIdeaForm:B,closeIdeaForm:G,submitIdea:J,dismissSprintDispatch:re,dismissUnmetDeps:he,resolveUnmetDeps:Ue,showUnmetDeps:We,selectDisambiguation:it,dismissDisambiguation:Be}=W1({scopes:fe.displayScopes,sprints:H,onAddToSprint:v,onRemoveFromSprint:U,isPhaseView:P&&_!=null&&!_.isUnified,projectEngines:P?o:void 0,defaultProjectId:Le}),xe=tw(Oc(rl,{activationConstraint:{distance:8}}),Oc(tl)),He=F1(),ve=m.useMemo(()=>{const q=new Map;for(const oe of t)q.set(ce(oe),oe);return q},[t]),Mt=m.useMemo(()=>{var pe;if(_){const Pe={};for(const Ti of _.columns)Pe[Ti.id]=[];for(const[Ti,Xs]of Object.entries(_.scopesByColumn)){const Zg=new Set(fe.displayScopes.map(Js=>ce(Js)));Pe[Ti]=Oa(aa(Xs.filter(Js=>Zg.has(ce(Js))),l,c))}return Pe}const q={};for(const Pe of D)q[Pe.id]=[];const oe=r.getEntryPoint().id;for(const Pe of fe.displayScopes)q[Pe.status]?q[Pe.status].push(Pe):(pe=q[oe])==null||pe.push(Pe);for(const Pe of Object.keys(q))q[Pe]=Oa(aa(q[Pe],l,c));return q},[fe.displayScopes,l,c,D,r,_]),Vt=m.useMemo(()=>{const q={};for(const oe of H){const pe=oe.status!=="assembling"?r.getBatchTargetStatus(oe.target_column)??oe.target_column:oe.target_column;(q[pe]??(q[pe]=[])).push(oe)}return q},[H,r]),Rr=m.useMemo(()=>{const q=new Set;for(const oe of H){const pe=oe.project_id??"";for(const Pe of oe.scope_ids)q.add(pe?`${pe}::${Pe}`:String(Pe))}return q},[H]),Ze=m.useMemo(()=>{if(p!=="swimlane")return[];let q;if(P&&_&&!_.isUnified){const oe=new Map;for(const[pe,Pe]of o)oe.set(pe,new yr(Pe));q=pe=>{const Pe=oe.get(pe.project_id??"");return Pe?Pe.getPhase(pe.status):"queued"}}return TD(fe.displayScopes,b,l,c,q,I)},[p,fe.displayScopes,b,l,c,P,_,o,I]),st=m.useMemo(()=>{if(Y.activeScope){if(H.some(oe=>oe.status==="assembling"&&oe.scope_ids.includes(Y.activeScope.id)))return new Set([Y.activeScope.status]);if(P&&_&&!_.isUnified&&Y.activeScope.project_id){const oe=o.get(Y.activeScope.project_id);if(oe){const pe=oe.getValidTargets(Y.activeScope.status),Pe=new yr(oe);return new Set(pe.map(Xs=>Pe.getPhase(Xs)))}}return new Set(r.getValidTargets(Y.activeScope.status))}if(Y.activeSprint){const q=Y.activeSprint,oe=q.status!=="assembling"?r.getBatchTargetStatus(q.target_column)??q.target_column:q.target_column;return new Set(r.getValidTargets(oe))}return new Set},[Y.activeScope,Y.activeSprint,r,H,P,_,o]),qe=q1(Y.pendingSprintDispatch,j,ne,re),{surpriseLoading:$t,handleSurprise:pt,handleApproveGhost:dt,handleRejectGhost:St}=K1(G,N),Qt=m.useCallback(q=>{q.status===r.getEntryPoint().id?N(q):A(ce(q))},[r]),Ye=m.useCallback(async(q,oe)=>{const pe=await v(q,oe);pe&&pe.unmet_dependencies.length>0&&We(q,pe.unmet_dependencies)},[v,We]),Ut=m.useCallback(async(q,oe)=>{const pe=await M(q,{...oe,projectId:Le});return pe&&W(sr(pe)),pe},[M,Le]),Ct=m.useCallback(async(q,oe)=>{const pe=H.find(Pe=>Pe.id===q);pe!=null&&pe.project_id&&await K(q,pe.project_id,oe)},[H,K]);return n&&t.length===0?d.jsx("div",{className:"flex h-64 items-center justify-center",children:d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):d.jsx(Zw,{sensors:xe,modifiers:He,collisionDetection:vD,onDragStart:$e,onDragOver:ut,onDragEnd:Qe,children:d.jsxs("div",{className:"flex flex-1 min-h-0 flex-col",children:[d.jsx(MD,{}),d.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[d.jsx(ih,{className:"h-4 w-4 text-primary shrink-0"}),d.jsx("h1",{className:"text-xl font-light shrink-0",children:"Kanban"}),d.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[d.jsx(gD,{query:fe.query,mode:fe.mode,isStale:fe.isStale,onQueryChange:fe.setQuery,onModeChange:fe.setMode}),d.jsx(mD,{filters:Ce,optionsWithCounts:de,onToggle:Re,onClearField:ge,onClearAll:me,hasActiveFilters:je}),d.jsx(YE,{viewMode:p,groupField:b,onViewModeChange:g,onGroupFieldChange:y}),d.jsx(qE,{display:C,onToggle:E,hiddenCount:k})]})]}),Y.error&&d.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[d.jsx("span",{className:"flex-1",children:Y.error}),d.jsx("button",{onClick:Fe,className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(wt,{className:"h-3.5 w-3.5"})})]}),p==="swimlane"?d.jsx(QE,{lanes:Ze,columns:L,collapsedColumns:f,collapsedLanes:x,onToggleLane:w,onToggleCollapse:h,onScopeClick:Qt,cardDisplay:C,dimmedIds:Je,isDragActive:!!(Y.activeScope||Y.activeSprint),validTargets:st,sprints:H,projectLookup:I}):d.jsx("div",{className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden","data-tour":"kanban-board",children:d.jsx("div",{className:"flex h-full w-max gap-2 pb-4",children:L.map(q=>d.jsx(OE,{id:q.id,label:q.label,color:q.color,scopes:Mt[q.id]??[],sprints:Vt[q.id],scopeLookup:ve,globalSprintScopeIds:Rr,onScopeClick:Qt,onDeleteSprint:z,onRenameSprint:(oe,pe)=>$(oe,pe),editingSprintId:X,onSprintEditingDone:()=>W(null),onAddAllToSprint:Ye,isDragActive:!!(Y.activeScope||Y.activeSprint),isValidDrop:st.has(q.id),sortField:l,sortDirection:c,onSetSort:u,collapsed:f.has(q.id),onToggleCollapse:()=>h(q.id),cardDisplay:C,dimmedIds:Je,projectLookup:I,onProjectChange:Ct,headerExtra:P&&_&&!_.isUnified?void 0:d.jsx(bD,{columnId:q.id,dispatching:Y.dispatching,onOpenIdeaForm:B,onCreateGroup:Ut})},q.id))})}),d.jsx(ZE,{activeScope:Y.activeScope,activeSprint:Y.activeSprint,cardDisplay:C,projectLookup:I,scopeLookup:ve}),d.jsx(eN,{open:Y.showPopover,scope:((hn=Y.pending)==null?void 0:hn.scope)??null,transition:((pn=Y.pending)==null?void 0:pn.transition)??null,hasActiveSession:((Dt=Y.pending)==null?void 0:Dt.hasActiveSession)??!1,dispatching:Y.dispatching,error:Y.error,onConfirm:Te,onCancel:De,onViewDetails:O}),d.jsx(tN,{open:Y.showModal,scope:((mn=Y.pending)==null?void 0:mn.scope)??null,transition:((Xn=Y.pending)==null?void 0:Xn.transition)??null,hasActiveSession:((lc=Y.pending)==null?void 0:lc.hasActiveSession)??!1,dispatching:Y.dispatching,error:Y.error,onConfirm:Te,onCancel:De}),d.jsx(cD,{scope:T,open:!!T,onClose:()=>A(null)}),d.jsx(uD,{open:Y.showIdeaForm,loading:Y.dispatching,onSubmit:J,onCancel:G,onSurprise:pt,surpriseLoading:$t}),d.jsx(dD,{scope:R,open:!!R,onClose:()=>N(null),onDelete:q=>{N(null),fetch(e(`/ideas/${q}`),{method:"DELETE"}).catch(()=>{})},onApprove:dt,onReject:St}),d.jsx(xD,{open:qe.showPreflight,sprint:qe.pendingSprint,graph:qe.graph,loading:qe.loading,onConfirm:qe.onConfirm,onCancel:qe.onCancel}),d.jsx(yD,{open:Y.pendingUnmetDeps!=null,unmetDeps:Y.pendingUnmetDeps??[],onAddAll:Ue,onCancel:he}),d.jsx(DD,{open:Y.pendingDisambiguation!=null,edges:((cc=Y.pendingDisambiguation)==null?void 0:cc.edges)??[],onSelect:it,onCancel:Be})]})})}const Kg=()=>qn(()=>import("./PrimitivesConfig-TlFvypvg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.PrimitivesConfig})),Gg=()=>qn(()=>import("./QualityGates-D8uvclW4.js"),__vite__mapDeps([11,1,2,12,3,13,6,7,14,10])).then(e=>({default:e.QualityGates})),Yg=()=>qn(()=>import("./SourceControl-DPeSBaMV.js"),__vite__mapDeps([15,1,2,12,10,8,9,16,17,14])).then(e=>({default:e.SourceControl})),Xg=()=>qn(()=>import("./SessionTimeline-QUaJw6Aa.js"),__vite__mapDeps([18,1,2,7,10])).then(e=>({default:e.SessionTimeline})),Jg=()=>qn(()=>import("./Settings-CAEnAZAk.js"),__vite__mapDeps([19,1,2,20,10])).then(e=>({default:e.Settings})),Qg=()=>qn(()=>import("./WorkflowVisualizer-DHrIjx6W.js"),__vite__mapDeps([21,1,2,10,6,3,16,9,22,5,20,13,4,14,23])),ID=()=>qn(()=>import("./Landing-B6q9U0Vd.js"),__vite__mapDeps([24,1,2,6,4,17,22,10])).then(e=>({default:e.Landing})),LD=m.lazy(Kg),FD=m.lazy(Gg),BD=m.lazy(Yg),zD=m.lazy(Xg),VD=m.lazy(Jg),$D=m.lazy(Qg),UD=m.lazy(ID);requestIdleCallback(()=>{Kg(),Gg(),Yg(),Xg(),Jg(),Qg()});class WD extends m.Component{constructor(){super(...arguments);yt(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){console.error("Onboarding error:",n)}render(){return this.state.hasError?d.jsx(gc,{children:this.props.children}):d.jsx(xv,{children:d.jsx(gc,{children:this.props.children})})}}function HD(){const e=hv();return d.jsx(kh.Provider,{value:e,children:d.jsx(WD,{children:d.jsxs(Ax,{children:[d.jsx(Ot,{path:"landing",element:d.jsx(m.Suspense,{fallback:null,children:d.jsx(UD,{})})}),d.jsxs(Ot,{element:d.jsx(Vv,{}),children:[d.jsx(Ot,{index:!0,element:d.jsx(OD,{})}),d.jsx(Ot,{path:"primitives",element:d.jsx(LD,{})}),d.jsx(Ot,{path:"guards",element:d.jsx(FD,{})}),d.jsx(Ot,{path:"gates",element:d.jsx(dc,{to:"/guards",replace:!0})}),d.jsx(Ot,{path:"enforcement",element:d.jsx(dc,{to:"/guards",replace:!0})}),d.jsx(Ot,{path:"repo",element:d.jsx(BD,{})}),d.jsx(Ot,{path:"sessions",element:d.jsx(zD,{})}),d.jsx(Ot,{path:"workflow",element:d.jsx($D,{})}),d.jsx(Ot,{path:"settings",element:d.jsx(VD,{})})]})]})})})}function qD(){return d.jsx(Px,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:d.jsx(hb,{children:d.jsx(uv,{children:d.jsx(HD,{})})})})}try{CSS.registerProperty({name:"--dispatch-angle",syntax:"<angle>",initialValue:"0deg",inherits:!1})}catch{}Mx.createRoot(document.getElementById("root")).render(d.jsx(Ie.StrictMode,{children:d.jsx(Eh,{children:d.jsx(vv,{children:d.jsx(qD,{})})})}));export{Db as $,s5 as A,Ve as B,Zf as C,Zw as D,rh as E,Hb as F,Yb as G,Ab as H,R0 as I,Jb as J,ns as K,Ts as L,Ph as M,SE as N,CE as O,si as P,Ul as Q,Rb as R,j0 as S,rn as T,fr as U,Zo as V,fb as W,wt as X,Ns as Y,Of as Z,If as _,F as a,hC as a$,Fa as a0,Zb as a1,t0 as a2,an as a3,QD as a4,Yt as a5,Tn as a6,ln as a7,cn as a8,th as a9,vb as aA,we as aB,r5 as aC,iw as aD,Za as aE,ss as aF,Jh as aG,Ms as aH,sn as aI,t5 as aJ,Xa as aK,xr as aL,bi as aM,tl as aN,n5 as aO,A0 as aP,r0 as aQ,z0 as aR,V1 as aS,$0 as aT,ab as aU,_e as aV,jn as aW,Zk as aX,br as aY,_p as aZ,dC as a_,Kn as aa,Wi as ab,zt as ac,Nn as ad,MR as ae,xM as af,af as ag,u5 as ah,c5 as ai,Ys as aj,jr as ak,_t as al,bs as am,sh as an,g0 as ao,ZD as ap,Sv as aq,p0 as ar,Fb as as,bh as at,nh as au,Ka as av,Nh as aw,mv as ax,e5 as ay,S0 as az,ii as b,on as b0,rt as b1,gt as b2,Gk as b3,ul as b4,np as b5,o5 as b6,ui as b7,dl as b8,at as b9,a5 as ba,du as bb,xs as bc,Wa as bd,ih as be,te as c,L0 as d,Xt as e,Ps as f,gr as g,ke as h,Tb as i,wv as j,dn as k,ub as l,i5 as m,sl as n,$l as o,D0 as p,Rt as q,tw as r,Q as s,Oc as t,Xh as u,F1 as v,MD as w,f0 as x,g1 as y,rl as z};
354
+ `),c=Wg(l);i.push({id:"agent-review",type:"agent-review",title:"Agent Review",part:s.name,content:l,defaultCollapsed:!0,meta:c})}}else i.push(...Wo(o,s.name))}return i.length>0?i:null}function oD(e){const[t,n]=m.useState([]),[r,i]=m.useState(!1),s=Xt(),o=m.useCallback(async()=>{if(e==null){n([]);return}i(!0);try{const a=await fetch(s(`/scopes/${e}/sessions`));a.ok&&n(await a.json())}catch{}finally{i(!1)}},[e,s]);return m.useEffect(()=>{o()},[o]),m.useEffect(()=>{function a(){o()}return Q.on("session:updated",a),()=>{Q.off("session:updated",a)}},[o]),{sessions:t,loading:r}}const qi="h-7 w-full rounded border border-border bg-transparent px-2 text-xxs text-foreground/80 focus:outline-none focus:ring-1 focus:ring-primary/50",rr="text-xxs font-medium uppercase tracking-wide text-muted-foreground/70 mb-1";function aD(e){return{title:e.title,status:e.status,priority:e.priority??"",effort_estimate:e.effort_estimate??"",category:e.category??"",tags:[...e.tags],blocked_by:[...e.blocked_by],blocks:[...e.blocks]}}function lD(e,t){return e.title===t.title&&e.status===t.status&&e.priority===t.priority&&e.effort_estimate===t.effort_estimate&&e.category===t.category&&JSON.stringify(e.tags)===JSON.stringify(t.tags)&&JSON.stringify(e.blocked_by)===JSON.stringify(t.blocked_by)&&JSON.stringify(e.blocks)===JSON.stringify(t.blocks)}function hf({label:e,ids:t,onRemove:n,onAdd:r}){const[i,s]=m.useState(!1),[o,a]=m.useState("");return d.jsxs("div",{children:[d.jsx("p",{className:rr,children:e}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[t.map(l=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 rounded border border-border px-1.5 py-0.5 text-xxs text-foreground/70",children:[_t(l),d.jsx("button",{onClick:()=>n(l),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(wt,{className:"h-2.5 w-2.5"})})]},l)),i?d.jsx("input",{autoFocus:!0,className:"h-5 w-12 rounded bg-transparent px-1 text-xxs border border-primary/30 focus:outline-none",placeholder:"ID",value:o,onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(r(o),s(!1),a("")),l.key==="Escape"&&s(!1)},onBlur:()=>s(!1)}):d.jsx("button",{onClick:()=>s(!0),className:"hover:text-foreground transition-colors text-muted-foreground",children:d.jsx(si,{className:"h-3 w-3"})}),t.length===0&&!i&&d.jsx("span",{className:"text-xxs text-muted-foreground/50",children:"None"})]})]})}function cD({scope:e,open:t,onClose:n}){const{engine:r}=dn(),i=Xt(),{getApiBase:s,hasMultipleProjects:o}=Rt(),a=m.useCallback(_=>o&&(e!=null&&e.project_id)?`${s(e.project_id)}${_}`:i(_),[i,s,o,e==null?void 0:e.project_id]),{sessions:l,loading:c}=oD((e==null?void 0:e.id)??null),[u,f]=m.useState(null),[h,p]=m.useState(null),[g,b]=m.useState(!1),[y,x]=m.useState(null),[w,C]=m.useState(""),E=u&&h?!lD(u,h):!1,k=m.useMemo(()=>sD(e==null?void 0:e.raw_content),[e==null?void 0:e.raw_content]);m.useEffect(()=>{if(e&&t){const _=aD(e);f(_),p(_),x(null),C("")}},[e==null?void 0:e.id,e==null?void 0:e.updated_at,t]);const S=m.useCallback(async()=>{if(!(!e||!u||!E||g)){b(!0),x(null);try{const _={};h&&(u.title!==h.title&&(_.title=u.title),u.status!==h.status&&(_.status=u.status),u.priority!==h.priority&&(_.priority=u.priority||null),u.effort_estimate!==h.effort_estimate&&(_.effort_estimate=u.effort_estimate||null),u.category!==h.category&&(_.category=u.category||null),JSON.stringify(u.tags)!==JSON.stringify(h.tags)&&(_.tags=u.tags),JSON.stringify(u.blocked_by)!==JSON.stringify(h.blocked_by)&&(_.blocked_by=u.blocked_by),JSON.stringify(u.blocks)!==JSON.stringify(h.blocks)&&(_.blocks=u.blocks));const L=await fetch(a(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(!L.ok){const I=await L.json().catch(()=>({error:"Save failed"}));x(I.error??`HTTP ${L.status}`);return}p({...u})}catch{x("Network error — could not save")}finally{b(!1)}}},[e,u,h,E,g,a]);function A(){if(E&&window.confirm("Save changes before closing?")){S().then(n);return}n()}function T(_){f(L=>L&&{...L,..._}),x(null)}function R(_){const L=_.trim().toLowerCase();!L||!u||(u.tags.includes(L)||T({tags:[...u.tags,L]}),C(""))}function N(_,L){const I=parseInt(L,10);isNaN(I)||I<=0||!u||u[_].includes(I)||T({[_]:[...u[_],I]})}if(!e||!u)return null;const D=r.getValidTargets(e.status),P=[e.status,...D.filter(_=>_!==e.status)];return d.jsx(an,{open:t,onOpenChange:_=>{_||A()},children:d.jsxs(Yt,{className:"max-w-[min(72rem,calc(100vw_-_2rem))] h-[85vh] flex flex-col p-0 gap-0 overflow-hidden",children:[d.jsx(Tn,{className:"px-4 pt-3 pb-2",children:d.jsxs("div",{className:"flex items-start gap-3 pr-8",children:[d.jsx("span",{className:"font-mono text-xxs text-muted-foreground mt-1.5",children:_t(e.id)}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx(ln,{asChild:!0,children:d.jsx("input",{className:"w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground leading-tight",value:u.title,onChange:_=>T({title:_.target.value}),placeholder:"Scope title..."})}),d.jsx(cn,{asChild:!0,children:d.jsxs("span",{className:"mt-1 flex items-center gap-1 text-xxs text-muted-foreground",children:[d.jsx(eh,{className:"h-3 w-3"}),d.jsx("span",{className:"truncate max-w-[400px]",children:e.file_path})]})})]})]})}),d.jsx(bs,{}),y&&d.jsxs("div",{className:"mx-4 mt-2 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-1.5 text-xs text-red-400",children:[d.jsx("span",{className:"flex-1",children:y}),d.jsx("button",{onClick:()=>x(null),className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(wt,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"flex flex-1 min-h-0",children:[d.jsx("div",{className:"flex-[65] min-w-0 border-r",children:d.jsx(gr,{className:"h-full",children:k?d.jsx("div",{className:"py-2",children:d.jsx(GM,{sections:k})}):d.jsx("div",{className:"px-6 py-5",children:e.raw_content?d.jsx(Bg,{content:e.raw_content}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No content available"})})})}),d.jsx("div",{className:"flex-[35] min-w-0 flex flex-col",children:d.jsxs(gr,{className:"h-full",children:[d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Status"}),d.jsx("select",{className:qi,value:u.status,onChange:_=>T({status:_.target.value}),children:P.map(_=>d.jsx("option",{value:_,children:_},_))})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Priority"}),d.jsxs("select",{className:qi,value:u.priority,onChange:_=>T({priority:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),ol.map(_=>d.jsx("option",{value:_,children:_},_))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Effort"}),d.jsxs("select",{className:qi,value:u.effort_estimate,onChange:_=>T({effort_estimate:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),Is.map(_=>d.jsx("option",{value:_,children:_},_))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Category"}),d.jsxs("select",{className:qi,value:u.category,onChange:_=>T({category:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),al.map(_=>d.jsx("option",{value:_,children:_},_))]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:rr,children:"Tags"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u.tags.map(_=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 glass-pill rounded border border-border px-1.5 py-0.5 text-xxs text-muted-foreground",children:[_,d.jsx("button",{onClick:()=>T({tags:u.tags.filter(L=>L!==_)}),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(wt,{className:"h-2.5 w-2.5"})})]},_)),d.jsx("input",{className:"h-5 w-16 rounded bg-transparent text-xxs text-muted-foreground placeholder:text-muted-foreground/50 border-none focus:outline-none",placeholder:"+tag",value:w,onChange:_=>C(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),R(w))},onBlur:()=>{w.trim()&&R(w)}})]})]}),d.jsx(hf,{label:"Blocked by",ids:u.blocked_by,onRemove:_=>T({blocked_by:u.blocked_by.filter(L=>L!==_)}),onAdd:_=>N("blocked_by",_)}),d.jsx(hf,{label:"Blocks",ids:u.blocks,onRemove:_=>T({blocks:u.blocks.filter(L=>L!==_)}),onAdd:_=>N("blocks",_)})]}),d.jsx(bs,{}),d.jsx("div",{className:"p-4 flex-1",children:d.jsx(FM,{sessions:l,loading:c})})]})})]}),E&&d.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded border border-border px-3 py-2",children:[d.jsx(Ve,{variant:"outline",children:"Unsaved changes"}),d.jsx("div",{className:"flex-1"}),d.jsx(ke,{variant:"ghost",size:"sm",onClick:()=>{f(h),x(null)},children:"Discard"}),d.jsx(ke,{size:"sm",onClick:()=>S(),disabled:g,children:g?"Saving...":"Save"}),y&&d.jsx("span",{className:"text-xs text-destructive ml-2",children:y})]})]})})}function uD({open:e,loading:t,onSubmit:n,onCancel:r,onSurprise:i,surpriseLoading:s}){const[o,a]=m.useState(""),[l,c]=m.useState(""),u=m.useRef(null);m.useEffect(()=>{e&&(a(""),c(""),setTimeout(()=>{var p;return(p=u.current)==null?void 0:p.focus()},100))},[e]);function f(){o.trim()&&n(o.trim(),l.trim())}function h(p){(p.metaKey||p.ctrlKey)&&p.key==="Enter"&&(p.preventDefault(),f())}return d.jsx(an,{open:e,onOpenChange:p=>{p||r()},children:d.jsxs(Yt,{className:"max-w-lg p-5 gap-0",onKeyDown:h,children:[d.jsxs(Tn,{className:"mb-4",children:[d.jsx(ln,{className:"text-sm font-normal",children:"New Idea"}),d.jsx(cn,{className:"text-xxs text-muted-foreground",children:"Capture a feature idea for the icebox"})]}),d.jsx("input",{ref:u,className:"mb-3 w-full rounded bg-muted/50 px-3 py-2 text-sm text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 placeholder:text-muted-foreground",placeholder:"Feature name...",value:o,onChange:p=>a(p.target.value)}),d.jsx("textarea",{className:"mb-4 w-full rounded bg-muted/50 px-3 py-2.5 text-xs text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 resize-y placeholder:text-muted-foreground",placeholder:"Describe the idea... What problem does it solve? Any notes on approach?",rows:6,value:l,onChange:p=>c(p.target.value)}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ke,{size:"sm",onClick:f,disabled:t||!o.trim(),className:"flex-1",children:t?"Creating...":"Create"}),d.jsx(ke,{size:"sm",variant:"ghost",onClick:r,disabled:t,children:"Cancel"}),d.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/50",children:["⌘","+Enter"]})]}),d.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[d.jsx(ke,{size:"sm",variant:"outline",className:"w-full text-purple-400 border-purple-500/30 hover:bg-purple-500/10 hover:border-purple-500/50",onClick:i,disabled:s,children:s?d.jsxs(d.Fragment,{children:[d.jsx(fr,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Generating ideas..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Wa,{className:"h-3.5 w-3.5 mr-2"}),"Surprise Me"]})}),d.jsx("p",{className:"mt-1.5 text-center text-[10px] text-muted-foreground",children:"AI analyzes the codebase and suggests feature ideas"})]})]})})}function dD({scope:e,open:t,onClose:n,onDelete:r,onApprove:i,onReject:s}){const o=Xt(),[a,l]=m.useState(""),[c,u]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(""),[b,y]=m.useState(!1),[x,w]=m.useState(!1),C=m.useRef(null),E=!!(e!=null&&e.is_ghost),k=a!==f||c!==p;m.useEffect(()=>{if(e&&t){const R=e.title??"",N=e.raw_content??"";l(R),u(N),h(R),g(N),w(!1);const D=E?void 0:setTimeout(()=>{var P;return(P=C.current)==null?void 0:P.focus()},100);return()=>{clearTimeout(D)}}},[e==null?void 0:e.id,t]);const S=m.useCallback(async()=>{if(!(!(e!=null&&e.slug)||!k||b||E)){y(!0);try{const R=await fetch(o(`/ideas/${e.slug}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,description:c})});R.ok?(h(a),g(c)):console.error("[Orbital] Failed to save idea:",R.status,R.statusText)}finally{y(!1)}}},[e,a,c,k,b,E,o]);m.useEffect(()=>{if(!k||!t||E)return;const R=setInterval(()=>{S()},1e4);return()=>clearInterval(R)},[k,t,S,E]);function A(){if(k&&!E&&window.confirm("Save changes before closing?")){S().then(n);return}n()}function T(){if(!x){w(!0);return}e!=null&&e.slug&&r(e.slug)}return e?d.jsx(an,{open:t,onOpenChange:R=>{R||A()},children:d.jsxs(Yt,{className:"max-w-md p-0 gap-0 flex flex-col max-h-[70vh]",children:[d.jsx(ln,{className:"sr-only",children:E?"AI suggested idea":"Edit idea"}),d.jsx(cn,{className:"sr-only",children:E?"Review and approve or reject this AI-suggested idea":"Edit idea title and description, or delete the idea"}),d.jsx(Tn,{className:"px-4 pt-3 pb-2",children:d.jsxs("div",{className:"flex items-center gap-2 pr-8",children:[d.jsx("div",{className:"flex-1 min-w-0",children:E?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Wa,{className:"h-3.5 w-3.5 text-purple-400 shrink-0"}),d.jsx("span",{className:"text-sm font-normal text-foreground truncate",children:a})]}):d.jsx("input",{ref:C,className:"w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground",placeholder:"Idea title...",value:a,onChange:R=>l(R.target.value)})}),E?d.jsx("span",{className:"shrink-0 rounded border border-purple-500/30 bg-purple-500/10 px-1.5 py-0.5 text-[10px] text-purple-400 uppercase",children:"ai suggestion"}):x?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ke,{size:"sm",variant:"destructive",className:"h-6 text-xxs",onClick:T,children:"Confirm"}),d.jsx(ke,{size:"sm",variant:"ghost",className:"h-6 text-xxs",onClick:()=>w(!1),children:"No"})]}):d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-destructive",onClick:T,title:"Delete idea",children:d.jsx(L0,{className:"h-3.5 w-3.5"})})]})}),d.jsx("div",{className:"flex-1 min-h-0 px-4 pb-4",children:E?d.jsx("div",{className:"w-full min-h-[200px] rounded bg-transparent px-3 py-2.5 text-xs text-foreground/80 border border-border/50 whitespace-pre-wrap",children:c||d.jsx("span",{className:"text-muted-foreground italic",children:"No description"})}):d.jsx("textarea",{className:"w-full h-full min-h-[200px] rounded bg-transparent px-3 py-2.5 text-xs text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 resize-none placeholder:text-muted-foreground",placeholder:"Describe the idea... What problem does it solve? Any notes on approach?",value:c,onChange:R=>u(R.target.value)})}),E?d.jsxs("div",{className:"px-4 pb-3 flex items-center gap-2",children:[d.jsxs(ke,{size:"sm",className:"flex-1 bg-green-600/20 border border-green-500/30 text-green-400 hover:bg-green-600/30 hover:text-green-300",onClick:()=>e.slug&&i(e.slug),disabled:!e.slug,children:[d.jsx(Kn,{className:"h-3.5 w-3.5 mr-1.5"}),"Approve"]}),d.jsxs(ke,{size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>e.slug&&s(e.slug),disabled:!e.slug,children:[d.jsx(wt,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}):d.jsxs("div",{className:"px-4 pb-3 flex items-center justify-between text-xxs text-muted-foreground",children:[d.jsx("span",{children:b?"Saving...":k?"Unsaved changes":"Saved"}),d.jsx(ke,{size:"sm",variant:"ghost",className:"h-6",onClick:()=>S(),disabled:!k||b,children:"Save"})]})]})}):null}const Ho=[{field:"priority",label:"Priority"},{field:"category",label:"Category"},{field:"tags",label:"Tags"},{field:"effort",label:"Effort"},{field:"dependencies",label:"Dependencies"}],fD={priority:"Priority",category:"Category",tags:"Tag",effort:"Effort",dependencies:"Dep"},hD={feature:"#536dfe",bugfix:"#ff1744",refactor:"#8B5CF6",infrastructure:"#40c4ff",docs:"#6B7280"},pD={priority:"text-warning-amber",category:"text-accent-blue",tags:"text-info-cyan",effort:"text-muted-foreground",dependencies:"text-ask-red"};function mD({filters:e,optionsWithCounts:t,onToggle:n,onClearField:r,onClearAll:i,hasActiveFilters:s}){jr();const[o,a]=m.useState(null),l=Ho.reduce((u,{field:f})=>u+e[f].size,0),c=[];for(const{field:u}of Ho){if(e[u].size===0)continue;const f=[];for(const h of e[u]){const p=t[u].find(g=>g.value===h);f.push({value:h,label:(p==null?void 0:p.label)??h})}c.push({field:u,values:f})}return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(An,{onOpenChange:()=>a(null),children:[d.jsx(_n,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:F("card-glass gap-1.5 bg-white/[0.03] border-white/10",s&&"border-white/20 text-foreground"),"aria-label":"Filter scopes",children:[d.jsx(Kb,{className:"h-3 w-3"}),"Filters",l>0&&d.jsx("span",{className:"ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]",children:l})]})}),d.jsxs(un,{align:"start",className:"filter-popover-glass !bg-transparent w-52",children:[d.jsx("div",{className:"space-y-0.5",children:Ho.map(({field:u,label:f})=>{const h=t[u];if(h.length===0)return null;const p=o===u,g=e[u].size;return d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>a(p?null:u),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",p&&"bg-white/[0.06]"),children:[d.jsx(ii,{className:F("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150",p&&"rotate-90")}),d.jsx("span",{className:F(g>0&&"text-foreground"),children:f}),g>0&&d.jsx("span",{className:"ml-auto rounded-full bg-white/10 px-1.5 text-[10px]",children:g})]}),p&&d.jsxs("div",{className:"ml-2 border-l border-white/[0.06] pl-2 mt-0.5 mb-1 space-y-0.5",children:[h.map(b=>{const y=e[u].has(b.value);return d.jsxs("button",{type:"button",onClick:()=>n(u,b.value),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",y&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",y?F("border-primary bg-primary text-primary-foreground",pD[u]):"border-white/15"),children:y&&d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:F("capitalize",y&&"text-foreground"),children:b.label}),d.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:b.count})]},b.value)}),g>0&&d.jsxs("button",{type:"button",onClick:()=>r(u),className:"w-full rounded px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors text-left",children:["Clear ",f.toLowerCase()]})]})]},u)})}),s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 border-t border-white/[0.06]"}),d.jsx("button",{type:"button",onClick:i,className:"w-full rounded px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors text-center",children:"Clear all filters"})]})]})]}),c.map(({field:u,values:f})=>d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground capitalize",children:[fD[u],":"]}),f.map(({value:h,label:p})=>{const g=u==="category";return d.jsxs(Ve,{variant:g?"outline":"secondary",className:F("gap-0.5 capitalize cursor-pointer hover:bg-secondary/60 py-0 px-1 text-[10px] font-light",!g&&"glass-pill",g&&"bg-[rgba(var(--neon-blue),0.08)]"),style:g?{borderColor:hD[h]}:void 0,onClick:()=>n(u,h),children:[p,d.jsx(wt,{className:"h-2 w-2 opacity-60"})]},h)})]},u))]})}function gD({query:e,mode:t,isStale:n,onQueryChange:r,onModeChange:i}){jr();const s=m.useRef(null),o=m.useRef(null),[a,l]=m.useState(!!e),c=m.useCallback(()=>{requestAnimationFrame(()=>{var f;!((f=o.current)!=null&&f.contains(document.activeElement))&&!e&&l(!1)})},[e]);m.useEffect(()=>{function f(h){h.key==="/"&&!(h.target instanceof HTMLInputElement)&&!(h.target instanceof HTMLTextAreaElement)&&(h.preventDefault(),l(!0))}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),m.useEffect(()=>{if(a){const f=setTimeout(()=>{var h;return(h=s.current)==null?void 0:h.focus()},50);return()=>clearTimeout(f)}},[a]);const u=m.useCallback(f=>{var h;f.key==="Escape"&&(e?r(""):(h=s.current)==null||h.blur())},[e,r]);return d.jsxs("div",{ref:o,className:F("flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs","backdrop-blur-sm bg-white/[0.03] border-white/10","transition-all duration-200 ease-out",a?"focus-within:border-white/20":"cursor-pointer hover:bg-white/[0.06]",a&&"focus-within:glow-blue"),role:"search","aria-label":"Search scopes",onClick:a?void 0:()=>l(!0),onBlur:a?c:void 0,children:[d.jsx(b0,{className:F("h-3 w-3 shrink-0 text-muted-foreground",n&&"animate-pulse")}),d.jsx("span",{className:F("text-xs font-medium whitespace-nowrap overflow-hidden transition-all duration-200 ease-out",a?"w-0 opacity-0":"w-10 opacity-100"),children:"Search"}),d.jsx("input",{ref:s,type:"text",value:e,onChange:f=>r(f.target.value.slice(0,100)),onKeyDown:u,placeholder:"Search scopes...",className:F("min-w-0 overflow-hidden bg-transparent text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none","transition-all duration-200 ease-out",a?"w-48 opacity-100":"w-0 opacity-0"),tabIndex:a?0:-1,"aria-label":"Search scopes"}),a&&e&&d.jsx("button",{onClick:()=>{var f;r(""),(f=s.current)==null||f.focus()},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors animate-in fade-in zoom-in-75 duration-150","aria-label":"Clear search",children:d.jsx(wt,{className:"h-3 w-3"})}),d.jsxs("div",{className:F("flex shrink-0 overflow-hidden -my-1 -mr-2 rounded-r-md","transition-all duration-200 ease-out",a?"max-w-[150px] opacity-100 border-l border-white/10":"max-w-0 opacity-0 border-l border-transparent"),children:[d.jsx("button",{onClick:()=>i("filter"),className:F("px-2 py-1 text-[10px] whitespace-nowrap transition-colors",t==="filter"?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-white/[0.04]"),tabIndex:a?0:-1,"aria-pressed":t==="filter",children:"Filter"}),d.jsx("button",{onClick:()=>i("highlight"),className:F("px-2 py-1 text-[10px] whitespace-nowrap transition-colors",t==="highlight"?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-white/[0.04]"),tabIndex:a?0:-1,"aria-pressed":t==="highlight",children:"Highlight"})]})]})}function xD({open:e,sprint:t,graph:n,loading:r,onConfirm:i,onCancel:s}){const{engine:o}=dn(),[a,l]=m.useState(!1);if(m.useEffect(()=>{e&&l(!1)},[e]),!t)return null;const c=new Map(t.scopes.map(y=>[y.scope_id,y])),u=(n==null?void 0:n.layers)??[],f=t.scope_ids.length,h=o.getBatchTargetStatus(t.target_column),p=h?o.findEdge(t.target_column,h):void 0,g=o.getBatchCommand(t.target_column)??null,b=async()=>{l(!0),i()};return d.jsx(an,{open:e,onOpenChange:y=>!y&&s(),children:d.jsxs(Yt,{className:"sm:max-w-lg p-0 gap-0",children:[d.jsxs(Tn,{className:"px-5 pt-4 pb-3",children:[h&&d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:t.target_column}),d.jsx(ns,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:h})]}),d.jsx(ln,{className:"text-sm font-normal",children:(p==null?void 0:p.label)??"Dispatch Sprint"}),d.jsxs(cn,{className:"text-xs text-muted-foreground mt-1",children:[f," scope",f!==1?"s":""," in"," ",u.length," layer",u.length!==1?"s":"",", max"," ",t.concurrency_cap," concurrent"]})]}),d.jsxs("div",{className:"px-5 pb-4 space-y-3",children:[g&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-surface/30 px-3 py-2",children:[d.jsx(Ps,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("code",{className:"text-xs font-mono text-primary",children:g})]}),d.jsx("div",{className:"max-h-64 overflow-y-auto space-y-3 rounded border border-border bg-surface/30 px-3 py-2",children:u.map((y,x)=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs(Ve,{variant:"outline",className:"text-xxs",children:["Layer ",x]}),x===0&&d.jsx("span",{className:"text-xxs text-primary",children:"Launches first"}),x>0&&d.jsxs("span",{className:"text-xxs text-muted-foreground",children:["Waits for Layer ",x-1]})]}),d.jsx("div",{className:"ml-4 space-y-1",children:y.map(w=>{const C=c.get(w);return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground w-8 shrink-0",children:_t(w)}),d.jsx("span",{className:"truncate flex-1 font-light",children:(C==null?void 0:C.title)??"Unknown"}),(C==null?void 0:C.effort_estimate)&&d.jsx("span",{className:"text-xxs text-muted-foreground shrink-0",children:C.effort_estimate})]},w)})}),x<u.length-1&&d.jsx("div",{className:"flex justify-center my-1",children:d.jsx(ns,{className:"h-3 w-3 text-muted-foreground rotate-90"})})]},y.join("-")))}),u.length===0&&!r&&d.jsxs("div",{className:F("flex items-start gap-2 rounded border px-3 py-2 text-xs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(rn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:"Could not compute execution layers. Sprint may have issues."})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{onClick:b,disabled:a||r||u.length===0,className:"flex-1",children:a?"Dispatching...":g?"Launch in iTerm":"Dispatch Sprint"}),d.jsx(ke,{variant:"ghost",onClick:s,disabled:a,children:"Cancel"})]})]})]})})}function yD({open:e,unmetDeps:t,onAddAll:n,onCancel:r}){const i=new Map;for(const s of t)for(const o of s.missing)i.has(o.scope_id)||i.set(o.scope_id,{title:o.title,status:o.status});return d.jsx(an,{open:e,onOpenChange:s=>!s&&r(),children:d.jsxs(Yt,{className:"sm:max-w-md",children:[d.jsxs(Tn,{children:[d.jsxs(ln,{className:"flex items-center gap-2 text-sm",children:[d.jsx(rn,{className:"h-4 w-4 text-warning-amber"}),"Unmet Dependencies"]}),d.jsx(cn,{className:"text-xs",children:"Some scopes you added depend on scopes not yet in this sprint."})]}),d.jsx("div",{className:"space-y-3 my-2",children:t.map(s=>d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(s.scope_id)}),d.jsx("span",{className:"ml-1",children:"depends on:"}),d.jsx("div",{className:"ml-4 mt-1 space-y-1",children:s.missing.map(o=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(o.scope_id)}),d.jsx("span",{className:"truncate",children:o.title}),d.jsx(Ve,{variant:"outline",className:"text-[10px] ml-auto shrink-0",children:o.status})]},o.scope_id))})]},s.scope_id))}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t",children:[d.jsxs(ke,{variant:"ghost",size:"sm",onClick:r,children:[d.jsx(wt,{className:"h-3 w-3 mr-1"})," Cancel"]}),d.jsxs(ke,{size:"sm",onClick:()=>n([...i.keys()]),children:[d.jsx(si,{className:"h-3 w-3 mr-1"})," Add All Dependencies"]})]})]})})}function bD({columnId:e,dispatching:t,onOpenIdeaForm:n,onCreateGroup:r}){const{engine:i}=dn(),s=i.getEntryPoint().id,o=i.getList(e),a=(o==null?void 0:o.supportsBatch)??!1,l=(o==null?void 0:o.supportsSprint)??!1;if(e===s&&n)return d.jsx(ke,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:n,disabled:t,title:"Add idea",children:d.jsx(si,{className:"h-3 w-3"})});if((l||a)&&r){const u=a?"batch":"sprint",f=a?"Batch":"Sprint";return d.jsx(ke,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:()=>r(`New ${f}`,{target_column:e,group_type:u}),title:`Create ${f.toLowerCase()}`,children:d.jsx(si,{className:"h-3 w-3"})})}return null}const vD=e=>{const t=aw(e),n=t.find(r=>String(r.id).startsWith("sprint-drop-"));return n?[n]:t.length>0?t:Mh(e)};function Oa(e){if(!e.some(r=>r.favourite))return e;const t=[],n=[];for(const r of e)(r.favourite?t:n).push(r);return[...t,...n]}const wD={critical:"bg-ask-red",high:"bg-warning-amber",medium:"bg-accent-blue",low:"bg-muted-foreground/30"},kD={feature:"bg-category-feature",bugfix:"bg-category-bugfix",refactor:"bg-category-refactor",infrastructure:"bg-category-infrastructure",docs:"bg-category-docs"},SD={"has-blockers":"Has blockers","blocks-others":"Blocks others","no-deps":"No dependencies"},CD={priority:ol,category:al,effort:Is,dependencies:Jh,tags:[],project:[]};function jD(e,t){return e==="priority"?wD[t]??"bg-muted-foreground/30":e==="category"?kD[t]??"bg-primary/40":"bg-primary/40"}function ED(e,t){return e==="dependencies"?SD[t]??t:t}function ND(){return new Proxy({},{get(e,t){return t in e||(e[t]=[]),e[t]}})}function TD(e,t,n,r,i,s){const o=new Map,a=new Map;for(const h of e){const p=ll(h,t),g=p.length>0?p:["Unset"];for(const b of g){o.has(b)||(o.set(b,ND()),a.set(b,0));const y=o.get(b),x=i?i(h):h.status;y[x]?y[x].push(h):y.planning.push(h),a.set(b,(a.get(b)??0)+1)}}for(const h of o.values())for(const p of Object.keys(h))h[p]=Oa(aa(h[p],n,r));const l=CD[t],c=[...o.keys()],u=[];for(const h of l)o.has(h)&&u.push(h);const f=c.filter(h=>h!=="Unset"&&!l.includes(h)).sort();return u.push(...f),o.has("Unset")&&u.push("Unset"),u.map(h=>{const p=t==="project"&&h!=="Unset"?s==null?void 0:s.get(h):void 0;return{value:h,label:h==="Unset"?"Unset":p?p.name:ED(t,h),color:h==="Unset"?"bg-muted-foreground/20":p?"":jD(t,h),colorHsl:p==null?void 0:p.color,count:a.get(h)??0,cells:o.get(h)}})}const PD={queued:"210 50% 50%",active:"0 70% 55%",review:"45 80% 50%",shipped:"153 70% 45%"};function AD(e,t){var a,l,c,u;const n=[...t.values()];if(n.length===0)return{isUnified:!0,columns:[],scopesByColumn:{}};if(V1(n)){const f=n[0],p=f.getBoardColumns().map(y=>({id:y.id,label:y.label,color:y.color,phase:new yr(f).getPhase(y.id)})),g={};for(const y of p)g[y.id]=[];const b=f.getEntryPoint().id;for(const y of e){const x=g[y.status]?y.status:b;(a=g[x])==null||a.push(y)}return{isUnified:!0,columns:p,scopesByColumn:g}}const i=new Map;for(const[f,h]of t)i.set(f,new yr(h));const s=z1.map(f=>({id:f.phase,label:f.label,color:PD[f.phase],phase:f.phase})),o={};for(const f of s)o[f.id]=[];for(const f of e){const h=f.project_id;if(!h){(l=o.queued)==null||l.push(f);continue}const p=i.get(h);if(p){const g=p.getPhase(f.status);(c=o[g])==null||c.push(f)}else(u=o.queued)==null||u.push(f)}return{isUnified:!1,columns:s,scopesByColumn:o}}function _D({open:e,onClose:t,projects:n}){const[r,i]=m.useState(null),[s,o]=m.useState(null);async function a(l,c){i(l),o(null);try{const u=await fetch(`/api/orbital/projects/${l}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!u.ok){const f=await u.json().catch(()=>({}));o(f.error??`Failed to update project (HTTP ${u.status})`)}}catch{o("Failed to update project")}finally{i(null)}}return d.jsx(an,{open:e,onOpenChange:l=>{l||t()},children:d.jsxs(Yt,{className:"max-w-[440px] max-h-[80vh] p-0 gap-0 flex flex-col",children:[d.jsxs(Tn,{className:"border-b border-white/[0.08] px-4 py-3",children:[d.jsx(ln,{children:"Project Settings"}),d.jsx(cn,{className:"sr-only",children:"Manage registered projects, colors, names, and visibility"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:[n.map(l=>d.jsx(RD,{project:l,updating:r===l.id,onUpdate:c=>a(l.id,c)},l.id)),s&&d.jsx("p",{className:"px-3 text-[11px] text-destructive",children:s})]})]})})}function RD({project:e,updating:t,onUpdate:n}){const[r,i]=m.useState(!1),[s,o]=m.useState(e.name),a=m.useRef(null);m.useEffect(()=>{var u;r&&((u=a.current)==null||u.focus())},[r]),m.useEffect(()=>{r||o(e.name)},[e.name,r]);const l=s.trim()!==""&&s.trim()!==e.name,c=m.useCallback(()=>{i(!1);const u=s.trim();u&&u!==e.name?n({name:u}):o(e.name)},[s,e.name,n]);return d.jsxs("div",{className:F("flex items-center gap-3 rounded border border-white/[0.08] px-3 py-2","transition-colors hover:border-[rgba(var(--neon-cyan),0.2)]",!e.enabled&&"opacity-50"),children:[d.jsx(yh,{value:e.color,onChange:u=>n({color:u}),disabled:t}),d.jsxs("div",{className:"flex-1 min-w-0",children:[r?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{ref:a,value:s,onChange:u=>o(u.target.value),onBlur:()=>{o(e.name),i(!1)},onKeyDown:u=>{u.key==="Enter"&&c(),u.key==="Escape"&&(o(e.name),i(!1))},className:"flex-1 min-w-0 bg-transparent text-xs font-medium outline-none border-b border-primary/50 pb-0.5"}),l&&d.jsx("button",{onMouseDown:u=>{u.preventDefault(),c()},className:"shrink-0 text-primary hover:text-primary/80 transition-colors",title:"Save name",children:d.jsx(Kn,{className:"h-3.5 w-3.5"})})]}):d.jsx("div",{className:"text-xs font-medium truncate cursor-text hover:text-primary transition-colors",onClick:()=>i(!0),title:"Click to rename",children:e.name}),d.jsx("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:e.path})]}),d.jsx("button",{onClick:()=>n({enabled:!e.enabled}),disabled:t,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",title:e.enabled?"Hide project":"Show project",children:e.enabled?d.jsx(nh,{className:"h-3.5 w-3.5"}):d.jsx(th,{className:"h-3.5 w-3.5"})})]})}function MD({countOverrides:e}={}){const{projects:t,activeProjectId:n,setActiveProjectId:r,hasMultipleProjects:i}=Rt(),[s,o]=m.useState(!1),[a,l]=m.useState(!1),c=n===null;return d.jsxs("div",{className:"project-tab-bar -mt-8 mb-3 flex items-center gap-0.5 overflow-x-auto rounded border border-white/[0.08] px-1 py-1",children:[i&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",onClick:()=>r(null),className:F("flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium whitespace-nowrap","transition-all duration-300 ease-in-out border-b-2",c?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:c?{background:"rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(255, 255, 255, 0.12)",borderBottomColor:"rgba(255, 255, 255, 0.50)"}:void 0,children:[d.jsx(Ts,{className:"h-3 w-3"}),"All Projects",d.jsx("span",{className:F("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",c?"glass-pill":"bg-muted border-transparent"),children:e?t.filter(u=>u.enabled).reduce((u,f)=>u+(e[f.id]??0),0):t.filter(u=>u.enabled).reduce((u,f)=>u+f.scopeCount,0)})]}),d.jsx("div",{className:"mx-0.5 h-4 w-px bg-white/[0.08]"}),t.filter(u=>u.enabled).map(u=>{const f=n===u.id;return d.jsxs("button",{type:"button",onClick:()=>r(u.id),className:F("flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium whitespace-nowrap","transition-all duration-300 ease-in-out border-b-2",f?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:f?{background:`hsl(${u.color} / 0.10)`,boxShadow:`0 2px 12px hsl(${u.color} / 0.25)`,borderBottomColor:`hsl(${u.color} / 0.50)`}:void 0,children:[d.jsx("span",{className:F("h-2 w-2 rounded-full shrink-0 transition-shadow duration-300",f&&"shadow-[0_0_6px_currentColor]"),style:{backgroundColor:`hsl(${u.color})`}}),u.name,d.jsx("span",{className:F("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",f?"glass-pill":"bg-muted border-transparent"),children:e?e[u.id]??0:u.scopeCount}),u.status==="offline"&&d.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"(offline)"})]},u.id)})]}),d.jsxs("div",{className:"ml-auto shrink-0 pl-1 flex items-center gap-0.5",children:[d.jsx("button",{type:"button",onClick:()=>l(!0),className:"flex items-center justify-center rounded p-1.5 text-muted-foreground/60 hover:text-foreground hover:bg-white/[0.06] transition-colors",title:"Add project",children:d.jsx(si,{className:"h-3.5 w-3.5"})}),i&&d.jsx("button",{type:"button",onClick:()=>o(!0),className:"flex items-center justify-center rounded p-1.5 text-muted-foreground/60 hover:text-foreground hover:bg-white/[0.06] transition-colors",title:"Project settings",children:d.jsx(w0,{className:"h-3.5 w-3.5"})})]}),d.jsx(bh,{open:a,onClose:()=>l(!1)}),d.jsx(_D,{open:s,onClose:()=>o(!1),projects:t})]})}function DD({open:e,edges:t,onSelect:n,onCancel:r}){return!e||t.length===0?null:d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:d.jsxs("div",{className:"card-glass w-80 rounded-lg border border-border bg-card p-4 shadow-xl space-y-3",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Choose Transition"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Multiple transitions are available for this move. Select one:"}),d.jsx("div",{className:"space-y-1.5",children:t.map(i=>d.jsxs("button",{onClick:()=>n(i),className:"flex w-full items-center gap-2 rounded border border-border px-3 py-2 text-left text-xs hover:bg-muted/50 transition-colors",children:[d.jsx("span",{className:"font-medium",children:i.label??`${i.from} → ${i.to}`}),i.description&&d.jsx("span",{className:"text-muted-foreground/70 truncate",children:i.description})]},`${i.from}-${i.to}`))}),d.jsx("div",{className:"flex justify-end pt-1",children:d.jsx("button",{onClick:r,className:"rounded px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})})]})})}function OD(){var jt,hn,pn,Dt,mn,Xn,lc,cc;const e=Xt(),{scopes:t,loading:n}=Th(),{engine:r}=dn(),{activeProjectId:i,projects:s,projectEngines:o,hasMultipleProjects:a}=Rt(),{sortField:l,sortDirection:c,setSort:u,collapsed:f,toggleCollapse:h}=_1(),{viewMode:p,setViewMode:g,groupField:b,setGroupField:y,collapsedLanes:x,toggleLaneCollapse:w}=L1(),{display:C,toggle:E,hiddenCount:k}=b1(),[S,A]=m.useState(null),T=m.useMemo(()=>t.find(q=>ce(q)===S)??null,[t,S]),[R,N]=m.useState(null),D=m.useMemo(()=>r.getBoardColumns(),[r]),P=a&&i===null,_=m.useMemo(()=>!P||o.size===0?null:AD(t,o),[P,t,o]),L=(_==null?void 0:_.columns)??D,I=m.useMemo(()=>{const q=new Map;for(const oe of s)q.set(oe.id,oe);return q.size>0?q:void 0},[s]),{sprints:H,createSprint:M,renameSprint:$,deleteSprint:z,addScopes:v,removeScopes:U,dispatchSprint:ne,getGraph:j,moveSprintToProject:K}=H1(),[X,W]=m.useState(null),Le=P?(jt=s.find(q=>q.enabled))==null?void 0:jt.id:void 0,{filters:Ce,toggleFilter:Re,clearField:ge,clearAll:me,hasActiveFilters:je,filteredScopes:be,optionsWithCounts:de}=j1(t),fe=Y1(be),{highlightedScopeKey:Ne,clearHighlight:nt}=X1(),Je=m.useMemo(()=>{if(Ne==null)return fe.dimmedIds;const q=new Set;for(const oe of fe.displayScopes)ce(oe)!==Ne&&q.add(ce(oe));return q},[Ne,fe.dimmedIds,fe.displayScopes]);m.useEffect(()=>{if(Ne==null)return;const q=setTimeout(()=>{document.addEventListener("click",nt,{once:!0})},100);return()=>{clearTimeout(q),document.removeEventListener("click",nt)}},[Ne,nt]);const{state:Y,onDragStart:$e,onDragOver:ut,onDragEnd:Qe,confirmTransition:Te,cancelTransition:De,dismissError:Fe,openModalFromPopover:O,openIdeaForm:B,closeIdeaForm:G,submitIdea:J,dismissSprintDispatch:re,dismissUnmetDeps:he,resolveUnmetDeps:Ue,showUnmetDeps:We,selectDisambiguation:it,dismissDisambiguation:Be}=W1({scopes:fe.displayScopes,sprints:H,onAddToSprint:v,onRemoveFromSprint:U,isPhaseView:P&&_!=null&&!_.isUnified,projectEngines:P?o:void 0,defaultProjectId:Le}),xe=tw(Dc(rl,{activationConstraint:{distance:8}}),Dc(tl)),He=F1(),ve=m.useMemo(()=>{const q=new Map;for(const oe of t)q.set(ce(oe),oe);return q},[t]),Mt=m.useMemo(()=>{var pe;if(_){const Pe={};for(const Ti of _.columns)Pe[Ti.id]=[];for(const[Ti,Xs]of Object.entries(_.scopesByColumn)){const Qg=new Set(fe.displayScopes.map(Js=>ce(Js)));Pe[Ti]=Oa(aa(Xs.filter(Js=>Qg.has(ce(Js))),l,c))}return Pe}const q={};for(const Pe of D)q[Pe.id]=[];const oe=r.getEntryPoint().id;for(const Pe of fe.displayScopes)q[Pe.status]?q[Pe.status].push(Pe):(pe=q[oe])==null||pe.push(Pe);for(const Pe of Object.keys(q))q[Pe]=Oa(aa(q[Pe],l,c));return q},[fe.displayScopes,l,c,D,r,_]),Vt=m.useMemo(()=>{const q={};for(const oe of H){const pe=oe.status!=="assembling"?r.getBatchTargetStatus(oe.target_column)??oe.target_column:oe.target_column;(q[pe]??(q[pe]=[])).push(oe)}return q},[H,r]),Rr=m.useMemo(()=>{const q=new Set;for(const oe of H){const pe=oe.project_id??"";for(const Pe of oe.scope_ids)q.add(pe?`${pe}::${Pe}`:String(Pe))}return q},[H]),Ze=m.useMemo(()=>{if(p!=="swimlane")return[];let q;if(P&&_&&!_.isUnified){const oe=new Map;for(const[pe,Pe]of o)oe.set(pe,new yr(Pe));q=pe=>{const Pe=oe.get(pe.project_id??"");return Pe?Pe.getPhase(pe.status):"queued"}}return TD(fe.displayScopes,b,l,c,q,I)},[p,fe.displayScopes,b,l,c,P,_,o,I]),st=m.useMemo(()=>{if(Y.activeScope){if(H.some(oe=>oe.status==="assembling"&&oe.scope_ids.includes(Y.activeScope.id)))return new Set([Y.activeScope.status]);if(P&&_&&!_.isUnified&&Y.activeScope.project_id){const oe=o.get(Y.activeScope.project_id);if(oe){const pe=oe.getValidTargets(Y.activeScope.status),Pe=new yr(oe);return new Set(pe.map(Xs=>Pe.getPhase(Xs)))}}return new Set(r.getValidTargets(Y.activeScope.status))}if(Y.activeSprint){const q=Y.activeSprint,oe=q.status!=="assembling"?r.getBatchTargetStatus(q.target_column)??q.target_column:q.target_column;return new Set(r.getValidTargets(oe))}return new Set},[Y.activeScope,Y.activeSprint,r,H,P,_,o]),qe=q1(Y.pendingSprintDispatch,j,ne,re),{surpriseLoading:$t,handleSurprise:pt,handleApproveGhost:dt,handleRejectGhost:St}=K1(G,N),Qt=m.useCallback(q=>{q.status===r.getEntryPoint().id?N(q):A(ce(q))},[r]),Ye=m.useCallback(async(q,oe)=>{const pe=await v(q,oe);pe&&pe.unmet_dependencies.length>0&&We(q,pe.unmet_dependencies)},[v,We]),Ut=m.useCallback(async(q,oe)=>{const pe=await M(q,{...oe,projectId:Le});return pe&&W(sr(pe)),pe},[M,Le]),Ct=m.useCallback(async(q,oe)=>{const pe=H.find(Pe=>Pe.id===q);pe!=null&&pe.project_id&&await K(q,pe.project_id,oe)},[H,K]);return n&&t.length===0?d.jsx("div",{className:"flex h-64 items-center justify-center",children:d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):d.jsx(Zw,{sensors:xe,modifiers:He,collisionDetection:vD,onDragStart:$e,onDragOver:ut,onDragEnd:Qe,children:d.jsxs("div",{className:"flex flex-1 min-h-0 flex-col",children:[d.jsx(MD,{}),d.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[d.jsx(rh,{className:"h-4 w-4 text-primary shrink-0"}),d.jsx("h1",{className:"text-xl font-light shrink-0",children:"Kanban"}),d.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[d.jsx(gD,{query:fe.query,mode:fe.mode,isStale:fe.isStale,onQueryChange:fe.setQuery,onModeChange:fe.setMode}),d.jsx(mD,{filters:Ce,optionsWithCounts:de,onToggle:Re,onClearField:ge,onClearAll:me,hasActiveFilters:je}),d.jsx(YE,{viewMode:p,groupField:b,onViewModeChange:g,onGroupFieldChange:y}),d.jsx(qE,{display:C,onToggle:E,hiddenCount:k})]})]}),Y.error&&d.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[d.jsx("span",{className:"flex-1",children:Y.error}),d.jsx("button",{onClick:Fe,className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(wt,{className:"h-3.5 w-3.5"})})]}),p==="swimlane"?d.jsx(QE,{lanes:Ze,columns:L,collapsedColumns:f,collapsedLanes:x,onToggleLane:w,onToggleCollapse:h,onScopeClick:Qt,cardDisplay:C,dimmedIds:Je,isDragActive:!!(Y.activeScope||Y.activeSprint),validTargets:st,sprints:H,projectLookup:I}):d.jsx("div",{className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden","data-tour":"kanban-board",children:d.jsx("div",{className:"flex h-full w-max gap-2 pb-4",children:L.map(q=>d.jsx(OE,{id:q.id,label:q.label,color:q.color,scopes:Mt[q.id]??[],sprints:Vt[q.id],scopeLookup:ve,globalSprintScopeIds:Rr,onScopeClick:Qt,onDeleteSprint:z,onRenameSprint:(oe,pe)=>$(oe,pe),editingSprintId:X,onSprintEditingDone:()=>W(null),onAddAllToSprint:Ye,isDragActive:!!(Y.activeScope||Y.activeSprint),isValidDrop:st.has(q.id),sortField:l,sortDirection:c,onSetSort:u,collapsed:f.has(q.id),onToggleCollapse:()=>h(q.id),cardDisplay:C,dimmedIds:Je,projectLookup:I,onProjectChange:Ct,headerExtra:P&&_&&!_.isUnified?void 0:d.jsx(bD,{columnId:q.id,dispatching:Y.dispatching,onOpenIdeaForm:B,onCreateGroup:Ut})},q.id))})}),d.jsx(ZE,{activeScope:Y.activeScope,activeSprint:Y.activeSprint,cardDisplay:C,projectLookup:I,scopeLookup:ve}),d.jsx(eN,{open:Y.showPopover,scope:((hn=Y.pending)==null?void 0:hn.scope)??null,transition:((pn=Y.pending)==null?void 0:pn.transition)??null,hasActiveSession:((Dt=Y.pending)==null?void 0:Dt.hasActiveSession)??!1,dispatching:Y.dispatching,error:Y.error,onConfirm:Te,onCancel:De,onViewDetails:O}),d.jsx(tN,{open:Y.showModal,scope:((mn=Y.pending)==null?void 0:mn.scope)??null,transition:((Xn=Y.pending)==null?void 0:Xn.transition)??null,hasActiveSession:((lc=Y.pending)==null?void 0:lc.hasActiveSession)??!1,dispatching:Y.dispatching,error:Y.error,onConfirm:Te,onCancel:De}),d.jsx(cD,{scope:T,open:!!T,onClose:()=>A(null)}),d.jsx(uD,{open:Y.showIdeaForm,loading:Y.dispatching,onSubmit:J,onCancel:G,onSurprise:pt,surpriseLoading:$t}),d.jsx(dD,{scope:R,open:!!R,onClose:()=>N(null),onDelete:q=>{N(null),fetch(e(`/ideas/${q}`),{method:"DELETE"}).catch(()=>{})},onApprove:dt,onReject:St}),d.jsx(xD,{open:qe.showPreflight,sprint:qe.pendingSprint,graph:qe.graph,loading:qe.loading,onConfirm:qe.onConfirm,onCancel:qe.onCancel}),d.jsx(yD,{open:Y.pendingUnmetDeps!=null,unmetDeps:Y.pendingUnmetDeps??[],onAddAll:Ue,onCancel:he}),d.jsx(DD,{open:Y.pendingDisambiguation!=null,edges:((cc=Y.pendingDisambiguation)==null?void 0:cc.edges)??[],onSelect:it,onCancel:Be})]})})}const qg=()=>qn(()=>import("./PrimitivesConfig-BDKrqwMI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.PrimitivesConfig})),Kg=()=>qn(()=>import("./QualityGates-CcrwWI45.js"),__vite__mapDeps([11,1,2,12,3,13,6,7,14,10])).then(e=>({default:e.QualityGates})),Gg=()=>qn(()=>import("./SourceControl-CmrDWqSs.js"),__vite__mapDeps([15,1,2,12,10,8,9,16,17,14])).then(e=>({default:e.SourceControl})),Yg=()=>qn(()=>import("./SessionTimeline-D2IN9T3a.js"),__vite__mapDeps([18,1,2,7,10])).then(e=>({default:e.SessionTimeline})),Xg=()=>qn(()=>import("./Settings-gAsObGj2.js"),__vite__mapDeps([19,1,2,20,10])).then(e=>({default:e.Settings})),Jg=()=>qn(()=>import("./WorkflowVisualizer-SxM8rp11.js"),__vite__mapDeps([21,1,2,10,6,3,16,9,22,5,20,13,4,14,23])),ID=()=>qn(()=>import("./Landing-D41fKTK0.js"),__vite__mapDeps([24,1,2,6,4,17,22,10])).then(e=>({default:e.Landing})),LD=m.lazy(qg),FD=m.lazy(Kg),BD=m.lazy(Gg),zD=m.lazy(Yg),VD=m.lazy(Xg),$D=m.lazy(Jg),UD=m.lazy(ID);requestIdleCallback(()=>{qg(),Kg(),Gg(),Yg(),Xg(),Jg()});class WD extends m.Component{constructor(){super(...arguments);yt(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){console.error("Onboarding error:",n)}render(){return this.state.hasError?this.props.children:d.jsx(xv,{children:this.props.children})}}function HD(){const e=hv();return d.jsx(wh.Provider,{value:e,children:d.jsx(WD,{children:d.jsxs(Px,{children:[d.jsx(Ot,{path:"landing",element:d.jsx(m.Suspense,{fallback:null,children:d.jsx(UD,{})})}),d.jsxs(Ot,{element:d.jsx(Vv,{}),children:[d.jsx(Ot,{index:!0,element:d.jsx(OD,{})}),d.jsx(Ot,{path:"primitives",element:d.jsx(LD,{})}),d.jsx(Ot,{path:"guards",element:d.jsx(FD,{})}),d.jsx(Ot,{path:"gates",element:d.jsx(dc,{to:"/guards",replace:!0})}),d.jsx(Ot,{path:"enforcement",element:d.jsx(dc,{to:"/guards",replace:!0})}),d.jsx(Ot,{path:"repo",element:d.jsx(BD,{})}),d.jsx(Ot,{path:"sessions",element:d.jsx(zD,{})}),d.jsx(Ot,{path:"workflow",element:d.jsx($D,{})}),d.jsx(Ot,{path:"settings",element:d.jsx(VD,{})})]})]})})})}function qD(){return d.jsx(Tx,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:d.jsx(hy,{children:d.jsx(hb,{children:d.jsx(uv,{children:d.jsx(HD,{})})})})})}try{CSS.registerProperty({name:"--dispatch-angle",syntax:"<angle>",initialValue:"0deg",inherits:!1})}catch{}Rx.createRoot(document.getElementById("root")).render(d.jsx(Ie.StrictMode,{children:d.jsx(jh,{children:d.jsx(vv,{children:d.jsx(qD,{})})})}));export{Db as $,s5 as A,Ve as B,Qf as C,Zw as D,nh as E,Hb as F,Yb as G,Ab as H,R0 as I,Jb as J,ns as K,Ts as L,Th as M,SE as N,CE as O,si as P,Ul as Q,Rb as R,j0 as S,rn as T,fr as U,Zo as V,fb as W,wt as X,Ns as Y,Df as Z,Of as _,F as a,hC as a$,Fa as a0,Zb as a1,t0 as a2,an as a3,QD as a4,Yt as a5,Tn as a6,ln as a7,cn as a8,eh as a9,vb as aA,we as aB,r5 as aC,iw as aD,Za as aE,ss as aF,Xh as aG,Ms as aH,sn as aI,t5 as aJ,Xa as aK,xr as aL,bi as aM,tl as aN,n5 as aO,A0 as aP,r0 as aQ,z0 as aR,V1 as aS,$0 as aT,ab as aU,_e as aV,jn as aW,Zk as aX,br as aY,Ap as aZ,dC as a_,Kn as aa,Wi as ab,zt as ac,Nn as ad,MR as ae,xM as af,of as ag,u5 as ah,c5 as ai,Ys as aj,jr as ak,_t as al,bs as am,ih as an,g0 as ao,ZD as ap,Sv as aq,p0 as ar,Fb as as,yh as at,th as au,Ka as av,Eh as aw,mv as ax,e5 as ay,S0 as az,ii as b,on as b0,rt as b1,gt as b2,Gk as b3,ul as b4,tp as b5,o5 as b6,ui as b7,dl as b8,at as b9,a5 as ba,uu as bb,xs as bc,Wa as bd,rh as be,te as c,L0 as d,Xt as e,Ps as f,gr as g,ke as h,Tb as i,wv as j,dn as k,ub as l,i5 as m,sl as n,$l as o,D0 as p,Rt as q,tw as r,Q as s,Dc as t,Yh as u,F1 as v,MD as w,f0 as x,g1 as y,rl as z};