orbital-command 0.3.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -42
- package/bin/commands/config.js +19 -0
- package/bin/commands/events.js +40 -0
- package/bin/commands/launch.js +126 -0
- package/bin/commands/manifest.js +283 -0
- package/bin/commands/registry.js +104 -0
- package/bin/commands/update.js +24 -0
- package/bin/lib/helpers.js +229 -0
- package/bin/orbital.js +90 -873
- package/dist/assets/Landing-CfQdHR0N.js +11 -0
- package/dist/assets/PrimitivesConfig-DThSipFy.js +32 -0
- package/dist/assets/QualityGates-B4kxM5UU.js +26 -0
- package/dist/assets/SessionTimeline-Bz1iZnmg.js +1 -0
- package/dist/assets/Settings-DLcZwbCT.js +12 -0
- package/dist/assets/SourceControl-BMNIz7Lt.js +36 -0
- package/dist/assets/WorkflowVisualizer-CxuSBOYu.js +69 -0
- package/dist/assets/{arrow-down-CPy85_J6.js → arrow-down-DVPp6_qp.js} +1 -1
- package/dist/assets/bot-NFaJBDn_.js +6 -0
- package/dist/assets/{charts-DbDg0Psc.js → charts-LGLb8hyU.js} +1 -1
- package/dist/assets/{circle-x-Cwz6ZQDV.js → circle-x-IsFCkBZu.js} +1 -1
- package/dist/assets/{file-text-C46Xr65c.js → file-text-J1cebZXF.js} +1 -1
- package/dist/assets/{globe-Cn2yNZUD.js → globe-WzeyHsUc.js} +1 -1
- package/dist/assets/index-BdJ57EhC.css +1 -0
- package/dist/assets/index-o4ScMAuR.js +349 -0
- package/dist/assets/{key-OPaNTWJ5.js → key-CKR8JJSj.js} +1 -1
- package/dist/assets/{minus-GMsbpKym.js → minus-CHBsJyjp.js} +1 -1
- package/dist/assets/radio-xqZaR-Uk.js +6 -0
- package/dist/assets/rocket-D_xvvNG6.js +6 -0
- package/dist/assets/{shield-DwAFkDYI.js → shield-TdB1yv_a.js} +1 -1
- package/dist/assets/useSocketListener-0L5yiN5i.js +1 -0
- package/dist/assets/useWorkflowEditor-CqeRWVQX.js +11 -0
- package/dist/assets/workflow-constants-Rw-GmgHZ.js +6 -0
- package/dist/assets/zap-C9wqYMpl.js +6 -0
- package/dist/index.html +3 -3
- package/dist/server/server/__tests__/data-routes.test.js +2 -0
- package/dist/server/server/__tests__/scope-routes.test.js +1 -0
- package/dist/server/server/config-migrator.js +0 -3
- package/dist/server/server/config.js +35 -6
- package/dist/server/server/database.js +0 -22
- package/dist/server/server/index.js +28 -816
- package/dist/server/server/init.js +32 -399
- package/dist/server/server/launch.js +1 -1
- package/dist/server/server/parsers/event-parser.js +4 -1
- package/dist/server/server/project-context.js +19 -9
- package/dist/server/server/project-manager.js +6 -6
- package/dist/server/server/routes/aggregate-routes.js +871 -0
- package/dist/server/server/routes/config-routes.js +41 -88
- package/dist/server/server/routes/data-routes.js +5 -15
- package/dist/server/server/routes/dispatch-routes.js +24 -8
- package/dist/server/server/routes/manifest-routes.js +1 -1
- package/dist/server/server/routes/scope-routes.js +10 -7
- package/dist/server/server/schema.js +1 -0
- package/dist/server/server/services/batch-orchestrator.js +17 -3
- package/dist/server/server/services/config-service.js +10 -1
- package/dist/server/server/services/scope-service.js +7 -7
- package/dist/server/server/services/sprint-orchestrator.js +24 -11
- package/dist/server/server/services/sprint-service.js +2 -2
- package/dist/server/server/uninstall.js +195 -0
- package/dist/server/server/update.js +212 -0
- package/dist/server/server/utils/dispatch-utils.js +8 -6
- package/dist/server/server/utils/flag-builder.js +54 -0
- package/dist/server/server/utils/json-fields.js +14 -0
- package/dist/server/server/utils/json-fields.test.js +73 -0
- package/dist/server/server/utils/route-helpers.js +37 -0
- package/dist/server/server/utils/route-helpers.test.js +115 -0
- package/dist/server/server/watchers/event-watcher.js +28 -13
- package/dist/server/server/wizard/config-editor.js +4 -4
- package/dist/server/server/wizard/doctor.js +2 -2
- package/dist/server/server/wizard/index.js +224 -39
- package/dist/server/server/wizard/phases/welcome.js +1 -4
- package/dist/server/server/wizard/ui.js +6 -7
- package/dist/server/shared/api-types.js +80 -1
- package/dist/server/shared/workflow-engine.js +1 -1
- package/package.json +20 -20
- package/schemas/orbital.config.schema.json +1 -19
- package/scripts/postinstall.js +6 -42
- package/scripts/release.sh +53 -0
- package/server/__tests__/data-routes.test.ts +2 -0
- package/server/__tests__/scope-routes.test.ts +1 -0
- package/server/config-migrator.ts +0 -3
- package/server/config.ts +39 -11
- package/server/database.ts +0 -26
- package/server/global-config.ts +4 -0
- package/server/index.ts +31 -896
- package/server/init.ts +32 -443
- package/server/launch.ts +1 -1
- package/server/parsers/event-parser.ts +4 -1
- package/server/project-context.ts +26 -10
- package/server/project-manager.ts +5 -6
- package/server/routes/aggregate-routes.ts +968 -0
- package/server/routes/config-routes.ts +41 -81
- package/server/routes/data-routes.ts +7 -16
- package/server/routes/dispatch-routes.ts +29 -8
- package/server/routes/manifest-routes.ts +1 -1
- package/server/routes/scope-routes.ts +12 -7
- package/server/schema.ts +1 -0
- package/server/services/batch-orchestrator.ts +18 -2
- package/server/services/config-service.ts +10 -1
- package/server/services/scope-service.ts +6 -6
- package/server/services/sprint-orchestrator.ts +24 -9
- package/server/services/sprint-service.ts +2 -2
- package/server/uninstall.ts +214 -0
- package/server/update.ts +263 -0
- package/server/utils/dispatch-utils.ts +8 -6
- package/server/utils/flag-builder.ts +56 -0
- package/server/utils/json-fields.test.ts +83 -0
- package/server/utils/json-fields.ts +14 -0
- package/server/utils/route-helpers.test.ts +144 -0
- package/server/utils/route-helpers.ts +38 -0
- package/server/watchers/event-watcher.ts +24 -12
- package/server/wizard/config-editor.ts +4 -4
- package/server/wizard/doctor.ts +2 -2
- package/server/wizard/index.ts +291 -40
- package/server/wizard/phases/welcome.ts +1 -5
- package/server/wizard/ui.ts +6 -7
- package/shared/api-types.ts +106 -0
- package/shared/workflow-engine.ts +1 -1
- package/templates/agents/QUICK-REFERENCE.md +1 -0
- package/templates/agents/README.md +1 -0
- package/templates/agents/SKILL-TRIGGERS.md +11 -0
- package/templates/agents/green-team/deep-dive.md +361 -0
- package/templates/hooks/end-session.sh +1 -0
- package/templates/hooks/init-session.sh +1 -0
- package/templates/hooks/scope-commit-logger.sh +2 -2
- package/templates/hooks/scope-create-gate.sh +2 -4
- package/templates/hooks/scope-gate.sh +4 -6
- package/templates/hooks/scope-helpers.sh +10 -1
- package/templates/hooks/scope-lifecycle-gate.sh +14 -5
- package/templates/hooks/scope-prepare.sh +1 -1
- package/templates/hooks/scope-transition.sh +14 -6
- package/templates/hooks/time-tracker.sh +2 -5
- package/templates/orbital.config.json +1 -4
- package/templates/presets/development.json +4 -4
- package/templates/presets/gitflow.json +7 -0
- package/templates/prompts/README.md +23 -0
- package/templates/prompts/deep-dive-audit.md +94 -0
- package/templates/quick/rules.md +56 -5
- package/templates/skills/git-commit/SKILL.md +21 -6
- package/templates/skills/git-dev/SKILL.md +8 -4
- package/templates/skills/git-main/SKILL.md +8 -4
- package/templates/skills/git-production/SKILL.md +6 -3
- package/templates/skills/git-staging/SKILL.md +6 -3
- package/templates/skills/scope-fix-review/SKILL.md +8 -4
- package/templates/skills/scope-implement/SKILL.md +13 -5
- package/templates/skills/scope-post-review/SKILL.md +16 -4
- package/templates/skills/scope-pre-review/SKILL.md +6 -2
- package/dist/assets/PrimitivesConfig-CrmQXYh4.js +0 -32
- package/dist/assets/QualityGates-BbasOsF3.js +0 -21
- package/dist/assets/SessionTimeline-CGeJsVvy.js +0 -1
- package/dist/assets/Settings-oiM496mc.js +0 -12
- package/dist/assets/SourceControl-B1fP2nJL.js +0 -41
- package/dist/assets/WorkflowVisualizer-CWLYf-f0.js +0 -74
- package/dist/assets/formatDistanceToNow-BMqsSP44.js +0 -1
- package/dist/assets/index-Aj4sV8Al.css +0 -1
- package/dist/assets/index-Bc9dK3MW.js +0 -354
- package/dist/assets/useWorkflowEditor-BJkTX_NR.js +0 -16
- package/dist/assets/zap-DfbUoOty.js +0 -11
- package/dist/server/server/services/telemetry-service.js +0 -143
- package/server/services/telemetry-service.ts +0 -195
- /package/{shared/default-workflow.json → templates/presets/default.json} +0 -0
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrimitivesConfig-CrmQXYh4.js","assets/ui-BmsSg9jU.js","assets/vendor-Bqt8AJn2.js","assets/zap-DfbUoOty.js","assets/useWorkflowEditor-BJkTX_NR.js","assets/file-text-C46Xr65c.js","assets/arrow-down-CPy85_J6.js","assets/globe-Cn2yNZUD.js","assets/charts-DbDg0Psc.js","assets/QualityGates-BbasOsF3.js","assets/circle-x-Cwz6ZQDV.js","assets/shield-DwAFkDYI.js","assets/formatDistanceToNow-BMqsSP44.js","assets/SourceControl-B1fP2nJL.js","assets/key-OPaNTWJ5.js","assets/SessionTimeline-CGeJsVvy.js","assets/Settings-oiM496mc.js","assets/minus-GMsbpKym.js","assets/WorkflowVisualizer-CWLYf-f0.js","assets/WorkflowVisualizer-BZV40eAE.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var _g=Object.defineProperty;var Rg=(e,t,n)=>t in e?_g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var tt=(e,t,n)=>Rg(e,typeof t!="symbol"?t+"":t,n);import{j as d,C as Zd,R as Dg,T as Mg,P as Og,a as ef,V as Ig,b as Lg,S as tf,c as Fg,d as nf,e as rf,f as Bg,u as sf,h as zg,g as Vg,i as Br,k as $g,l as of,m as Ug,F as Wg,D as Hg,n as qg,o as Kg,p as Gg,q as Yg,r as af,A as lf,s as Xg,O as cf,t as Jg,v as uf,w as df,x as Qg,y as Zg,z as ex,B as tx}from"./ui-BmsSg9jU.js";import{f as nx,g as wa,a as m,u as ff,h as hf,i as rx,b as Yn,N as Jl,O as ix,d as ke,R as sx,B as ox,j as ax,k as _t,l as Ql}from"./vendor-Bqt8AJn2.js";import{c as pf}from"./charts-DbDg0Psc.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 bi={},Zl;function lx(){if(Zl)return bi;Zl=1;var e=nx();return bi.createRoot=e.createRoot,bi.hydrateRoot=e.hydrateRoot,bi}var cx=lx();const ux=wa(cx),dx="modulepreload",fx=function(e){return"/"+e},ec={},fr=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=fx(c),c in ec)return;ec[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)})},ka="-",hx=e=>{const t=mx(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(ka);return a[0]===""&&a.length!==1&&a.shift(),mf(a,t)||px(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},mf=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?mf(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(ka);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},tc=/^\[(.+)\]$/,px=e=>{if(tc.test(e)){const t=tc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},mx=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return xx(Object.entries(e.classGroups),n).forEach(([s,o])=>{Mo(o,r,s,t)}),r},Mo=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:nc(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(gx(i)){Mo(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Mo(o,nc(t,s),n,r)})})},nc=(e,t)=>{let n=e;return t.split(ka).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},gx=e=>e.isThemeGetter,xx=(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,yx=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)}}},gf="!",bx=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 b=0;b<a.length;b++){let y=a[b];if(c===0){if(y===i&&(r||a.slice(b,b+s)===t)){l.push(a.slice(u,b)),u=b+s;continue}if(y==="/"){f=b;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(gf),g=p?h.substring(1):h,x=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:x}};return n?a=>n({className:a,parseClassName:o}):o},vx=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:yx(e.cacheSize),parseClassName:bx(e),...hx(e)}),kx=/\s+/,Sx=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(kx);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,x=r(g?h.substring(0,p):h);if(!x){if(!g){a=c+(a.length>0?" "+a:a);continue}if(x=r(h),!x){a=c+(a.length>0?" "+a:a);continue}g=!1}const b=vx(u).join(":"),y=f?b+gf:b,v=y+x;if(s.includes(v))continue;s.push(v);const w=i(x,g);for(let N=0;N<w.length;++N){const j=w[N];s.push(y+j)}a=c+(a.length>0?" "+a:a)}return a};function Cx(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=xf(t))&&(r&&(r+=" "),r+=n);return r}const xf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=xf(e[r]))&&(n&&(n+=" "),n+=t);return n};function jx(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=Sx(l,n);return i(l,u),u}return function(){return s(Cx.apply(null,arguments))}}const ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},yf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ex=/^\d+\/\d+$/,Nx=new Set(["px","full","screen"]),Tx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Px=/\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$/,Ax=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_x=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ut=e=>tr(e)||Nx.has(e)||Ex.test(e),nn=e=>hr(e,"length",zx),tr=e=>!!e&&!Number.isNaN(Number(e)),Vs=e=>hr(e,"number",tr),jr=e=>!!e&&Number.isInteger(Number(e)),Dx=e=>e.endsWith("%")&&tr(e.slice(0,-1)),ee=e=>yf.test(e),rn=e=>Tx.test(e),Mx=new Set(["length","size","percentage"]),Ox=e=>hr(e,Mx,bf),Ix=e=>hr(e,"position",bf),Lx=new Set(["image","url"]),Fx=e=>hr(e,Lx,$x),Bx=e=>hr(e,"",Vx),Er=()=>!0,hr=(e,t,n)=>{const r=yf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},zx=e=>Px.test(e)&&!Ax.test(e),bf=()=>!1,Vx=e=>_x.test(e),$x=e=>Rx.test(e),Ux=()=>{const e=ge("colors"),t=ge("spacing"),n=ge("blur"),r=ge("brightness"),i=ge("borderColor"),s=ge("borderRadius"),o=ge("borderSpacing"),a=ge("borderWidth"),l=ge("contrast"),c=ge("grayscale"),u=ge("hueRotate"),f=ge("invert"),h=ge("gap"),p=ge("gradientColorStops"),g=ge("gradientColorStopPositions"),x=ge("inset"),b=ge("margin"),y=ge("opacity"),v=ge("padding"),w=ge("saturate"),N=ge("scale"),j=ge("sepia"),S=ge("skew"),A=ge("space"),T=ge("translate"),O=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",ee,t],D=()=>[ee,t],R=()=>["",Ut,nn],L=()=>["auto",tr,ee],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",ee],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[tr,ee];return{cacheSize:500,separator:":",theme:{colors:[Er],spacing:[Ut,nn],blur:["none","",rn,ee],brightness:B(),borderColor:[e],borderRadius:["none","","full",rn,ee],borderSpacing:D(),borderWidth:R(),contrast:B(),grayscale:U(),hueRotate:B(),invert:U(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Dx,nn],inset:M(),margin:M(),opacity:B(),padding:D(),saturate:B(),scale:B(),sepia:U(),skew:B(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[rn]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...P(),ee]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",jr,ee]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",jr,ee]}],"grid-cols":[{"grid-cols":[Er]}],"col-start-end":[{col:["auto",{span:["full",jr,ee]},ee]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Er]}],"row-start-end":[{row:["auto",{span:[jr,ee]},ee]}],"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",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"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",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[rn]},rn]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",rn,nn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vs]}],"font-family":[{font:[Er]}],"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",ee]}],"line-clamp":[{"line-clamp":["none",tr,Vs]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ut,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ut,nn]}],"underline-offset":[{"underline-offset":["auto",Ut,ee]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],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",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),Ix]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ox]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Fx]}],"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":[y]}],"border-style":[{border:[...F(),"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":[y]}],"divide-style":[{divide:F()}],"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:["",...F()]}],"outline-offset":[{"outline-offset":[Ut,ee]}],"outline-w":[{outline:[Ut,nn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ut,nn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",rn,Bx]}],"shadow-color":[{shadow:[Er]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",rn,ee]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"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":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",ee]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[jr,ee]}],"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",ee]}],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",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ut,nn,Vs]}],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"]}}},Wx=jx(Ux);function z(...e){return Wx(pf(e))}function pt(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 rc=Og,TM=Dg,PM=Mg,Hx=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(Zd,{ref:r,sideOffset:t,className:z("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}));Hx.displayName=Zd.displayName;const It=Object.create(null);It.open="0";It.close="1";It.ping="2";It.pong="3";It.message="4";It.upgrade="5";It.noop="6";const Oi=Object.create(null);Object.keys(It).forEach(e=>{Oi[It[e]]=e});const Oo={type:"error",data:"parser error"},vf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wf=typeof ArrayBuffer=="function",kf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Sa=({type:e,data:t},n,r)=>vf&&t instanceof Blob?n?r(t):ic(t,r):wf&&(t instanceof ArrayBuffer||kf(t))?n?r(t):ic(new Blob([t]),r):r(It[e]+(t||"")),ic=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function sc(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let $s;function qx(e,t){if(vf&&e.data instanceof Blob)return e.data.arrayBuffer().then(sc).then(t);if(wf&&(e.data instanceof ArrayBuffer||kf(e.data)))return t(sc(e.data));Sa(e,!1,n=>{$s||($s=new TextEncoder),t($s.encode(n))})}const oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Or=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oc.length;e++)Or[oc.charCodeAt(e)]=e;const Kx=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=Or[e.charCodeAt(r)],o=Or[e.charCodeAt(r+1)],a=Or[e.charCodeAt(r+2)],l=Or[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},Gx=typeof ArrayBuffer=="function",Ca=(e,t)=>{if(typeof e!="string")return{type:"message",data:Sf(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Yx(e.substring(1),t)}:Oi[n]?e.length>1?{type:Oi[n],data:e.substring(1)}:{type:Oi[n]}:Oo},Yx=(e,t)=>{if(Gx){const n=Kx(e);return Sf(n,t)}else return{base64:!0,data:e}},Sf=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Cf="",Xx=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Sa(s,!1,a=>{r[o]=a,++i===n&&t(r.join(Cf))})})},Jx=(e,t)=>{const n=e.split(Cf),r=[];for(let i=0;i<n.length;i++){const s=Ca(n[i],t);if(r.push(s),s.type==="error")break}return r};function Qx(){return new TransformStream({transform(e,t){qx(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 Us;function vi(e){return e.reduce((t,n)=>t+n.length,0)}function wi(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 Zx(e,t){Us||(Us=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(vi(n)<1)break;const l=wi(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(vi(n)<2)break;const l=wi(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(vi(n)<8)break;const l=wi(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Oo);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(vi(n)<i)break;const l=wi(n,i);a.enqueue(Ca(s?l:Us.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Oo);break}}}})}const jf=4;function Ne(e){if(e)return ey(e)}function ey(e){for(var t in Ne.prototype)e[t]=Ne.prototype[t];return e}Ne.prototype.on=Ne.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ne.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ne.prototype.off=Ne.prototype.removeListener=Ne.prototype.removeAllListeners=Ne.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};Ne.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};Ne.prototype.emitReserved=Ne.prototype.emit;Ne.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ne.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ps=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ft=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ty="arraybuffer";function Ef(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const ny=ft.setTimeout,ry=ft.clearTimeout;function ms(e,t){t.useNativeTimers?(e.setTimeoutFn=ny.bind(ft),e.clearTimeoutFn=ry.bind(ft)):(e.setTimeoutFn=ft.setTimeout.bind(ft),e.clearTimeoutFn=ft.clearTimeout.bind(ft))}const iy=1.33;function sy(e){return typeof e=="string"?oy(e):Math.ceil((e.byteLength||e.size)*iy)}function oy(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 Nf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ay(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function ly(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 cy extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class ja extends Ne{constructor(t){super(),this.writable=!1,ms(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 cy(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=Ca(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=ay(t);return n.length?"?"+n:""}}class uy extends ja{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)};Jx(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,Xx(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]=Nf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Tf=!1;try{Tf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const dy=Tf;function fy(){}class hy extends uy{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 Dt extends Ne{constructor(t,n,r){super(),this.createRequest=t,ms(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=Ef(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=Dt.requestsCount++,Dt.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=fy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Dt.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()}}Dt.requestsCount=0;Dt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ac);else if(typeof addEventListener=="function"){const e="onpagehide"in ft?"pagehide":"unload";addEventListener(e,ac,!1)}}function ac(){for(let e in Dt.requests)Dt.requests.hasOwnProperty(e)&&Dt.requests[e].abort()}const py=(function(){const e=Pf({xdomain:!1});return e&&e.responseType!==null})();class my extends hy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=py&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Dt(Pf,this.uri(),t)}}function Pf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||dy))return new XMLHttpRequest}catch{}if(!t)try{return new ft[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Af=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class gy extends ja{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Af?{}:Ef(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;Sa(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&ps(()=>{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]=Nf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ws=ft.WebSocket||ft.MozWebSocket;class xy extends gy{createSocket(t,n,r){return Af?new Ws(t,n,r):n?new Ws(t,n):new Ws(t)}doWrite(t,n){this.ws.send(n)}}class yy extends ja{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=Zx(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Qx();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&&ps(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const by={websocket:xy,webtransport:yy,polling:my},vy=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Io(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=vy.exec(e||""),s={},o=14;for(;o--;)s[wy[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=ky(s,s.path),s.queryKey=Sy(s,s.query),s}function ky(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 Sy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Lo=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ii=[];Lo&&addEventListener("offline",()=>{Ii.forEach(e=>e())},!1);class un extends Ne{constructor(t,n){if(super(),this.binaryType=ty,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=Io(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=Io(n.host).host);ms(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=ly(this.opts.query)),Lo&&(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"})},Ii.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=jf,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&&un.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",un.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+=sy(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,ps(()=>{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(un.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(),Lo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ii.indexOf(this._offlineEventListener);r!==-1&&Ii.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}un.protocol=jf;class Cy extends un{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;un.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;un.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 jy=class extends Cy{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=>by[i]).filter(i=>!!i)),super(t,r)}};function Ey(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=Io(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 Ny=typeof ArrayBuffer=="function",Ty=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_f=Object.prototype.toString,Py=typeof Blob=="function"||typeof Blob<"u"&&_f.call(Blob)==="[object BlobConstructor]",Ay=typeof File=="function"||typeof File<"u"&&_f.call(File)==="[object FileConstructor]";function Ea(e){return Ny&&(e instanceof ArrayBuffer||Ty(e))||Py&&e instanceof Blob||Ay&&e instanceof File}function Li(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Li(e[n]))return!0;return!1}if(Ea(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Li(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Li(e[n]))return!0;return!1}function _y(e){const t=[],n=e.data,r=e;return r.data=Fo(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Fo(e,t){if(!e)return e;if(Ea(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]=Fo(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]=Fo(e[r],t));return n}return e}function Ry(e,t){return e.data=Bo(e.data,t),delete e.attachments,e}function Bo(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]=Bo(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Bo(e[n],t));return e}const Dy=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ie;(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"})(ie||(ie={}));class My{constructor(t){this.replacer=t}encode(t){return(t.type===ie.EVENT||t.type===ie.ACK)&&Li(t)?this.encodeAsBinary({type:t.type===ie.EVENT?ie.BINARY_EVENT:ie.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ie.BINARY_EVENT||t.type===ie.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=_y(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Na extends Ne{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===ie.BINARY_EVENT;r||n.type===ie.BINARY_ACK?(n.type=r?ie.EVENT:ie.ACK,this.reconstructor=new Oy(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ea(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(ie[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ie.BINARY_EVENT||r.type===ie.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(!Iy(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(Na.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 ie.CONNECT:return lc(n);case ie.DISCONNECT:return n===void 0;case ie.CONNECT_ERROR:return typeof n=="string"||lc(n);case ie.EVENT:case ie.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Dy.indexOf(n[0])===-1);case ie.ACK:case ie.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Oy{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=Ry(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Iy=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function lc(e){return Object.prototype.toString.call(e)==="[object Object]"}const Ly=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Na,Encoder:My,get PacketType(){return ie}},Symbol.toStringTag,{value:"Module"}));function kt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Fy=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Rf extends Ne{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=[kt(t,"open",this.onopen.bind(this)),kt(t,"packet",this.onpacket.bind(this)),kt(t,"error",this.onerror.bind(this)),kt(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(Fy.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:ie.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:ie.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 ie.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 ie.EVENT:case ie.BINARY_EVENT:this.onevent(t);break;case ie.ACK:case ie.BINARY_ACK:this.onack(t);break;case ie.DISCONNECT:this.ondisconnect();break;case ie.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:ie.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:ie.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 pr(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}pr.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};pr.prototype.reset=function(){this.attempts=0};pr.prototype.setMin=function(e){this.ms=e};pr.prototype.setMax=function(e){this.max=e};pr.prototype.setJitter=function(e){this.jitter=e};class zo extends Ne{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,ms(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 pr({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||Ly;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 jy(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=kt(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=kt(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(kt(t,"ping",this.onping.bind(this)),kt(t,"data",this.ondata.bind(this)),kt(t,"error",this.onerror.bind(this)),kt(t,"close",this.onclose.bind(this)),kt(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){ps(()=>{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 Rf(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 Nr={};function Fi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Ey(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Nr[i]&&s in Nr[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new zo(r,t):(Nr[i]||(Nr[i]=new zo(r,t)),l=Nr[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Fi,{Manager:zo,Socket:Rf,io:Fi,connect:Fi});const K=Fi({autoConnect:!0,reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:1/0,reconnectionDelayMax:1e4});function By(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(zy)&&t.edges.every(Uy)&&(t.branchingMode===void 0||t.branchingMode==="trunk"||t.branchingMode==="worktree")}function zy(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 Vy={guard:"blocker",gate:"advisor",lifecycle:"operator",observer:"silent"};function $y(e){return Vy[e.category]}function Uy(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 Wy{constructor(t){tt(this,"config");tt(this,"listMap");tt(this,"edgeMap");tt(this,"edgesByFrom");tt(this,"statusOrder");tt(this,"hookMap");tt(this,"terminalStatuses");tt(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 $y(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
|
-
`)}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;if(s.group==="deployment"){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
|
-
`)+`
|
|
5
|
-
`}}function gs(e){m.useEffect(()=>(K.on("connect",e),()=>{K.off("connect",e)}),[e]),m.useEffect(()=>{function t(){document.visibilityState==="visible"&&e()}return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[e])}const Df=m.createContext(null);function Hy({children:e}){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=ff(),a=s.get("project"),l=a==="__all__"?null:a??null,c=m.useCallback(w=>{o(N=>{const j=new URLSearchParams(N);return w===null?j.set("project","__all__"):j.set("project",w),j},{replace:!0})},[o]),u=m.useCallback(async()=>{try{const w=await fetch("/api/orbital/projects?include=workflow");if(!w.ok){n([]),i(!1);return}const N=await w.json();n(N);const j=new Map;for(const S of N)S.workflow&&By(S.workflow)&&j.set(S.id,new Wy(S.workflow));j.size>0&&y(j)}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(w=>{const N=new URLSearchParams(w);return N.set("project",t[0].id),N},{replace:!0}))},[t,a,o]),m.useEffect(()=>{const w=()=>u(),N=()=>u(),j=()=>u(),S=()=>u();return K.on("project:registered",w),K.on("project:unregistered",N),K.on("project:status:changed",j),K.on("project:updated",S),()=>{K.off("project:registered",w),K.off("project:unregistered",N),K.off("project:status:changed",j),K.off("project:updated",S)}},[u]),m.useEffect(()=>{function w(){l?K.emit("subscribe",{projectId:l}):K.emit("subscribe",{scope:"all"})}return w(),K.on("connect",w),()=>{K.off("connect",w),l?K.emit("unsubscribe",{projectId:l}):K.emit("unsubscribe",{scope:"all"})}},[l]);const h=m.useCallback(w=>{var N;return((N=t.find(j=>j.id===w))==null?void 0:N.color)??"210 80% 55%"},[t]),p=m.useCallback(w=>{var N;return((N=t.find(j=>j.id===w))==null?void 0:N.name)??w},[t]),g=m.useCallback(w=>{const N=w!==void 0?w:l;return N?`/api/orbital/projects/${N}`:"/api/orbital/aggregate"},[l]),x=t.length>1,[b,y]=m.useState(new Map);m.useEffect(()=>{const w=()=>{u()};return K.on("workflow:changed",w),()=>{K.off("workflow:changed",w)}},[u]),gs(u);const v=m.useMemo(()=>({projects:t,activeProjectId:l,setActiveProjectId:c,getProjectColor:h,getProjectName:p,loading:r,hasMultipleProjects:x,getApiBase:g,projectEngines:b}),[t,l,c,h,p,r,x,g,b]);return d.jsx(Df.Provider,{value:v,children:e})}function gn(){const e=m.useContext(Df);if(!e)throw new Error("useProjects must be used within a ProjectProvider");return e}const Mf=m.createContext(null);function qy({children:e}){var l;const{activeProjectId:t,projects:n,projectEngines:r,loading:i}=gn(),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(`
|
|
6
|
-
`)){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(Mf.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.jsxs("div",{className:"flex flex-col items-center gap-3 max-w-sm text-center",children:[d.jsx("span",{className:"text-sm text-destructive",children:"No Projects"}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["No projects registered. Run ",d.jsx("code",{children:"orbital register"})," to add a project."]})]})}):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 Gt(){const e=m.useContext(Mf);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)}const Ky={activeScopes:new Set,abandonedScopes:new Map,recoverScope:async()=>{},dismissAbandoned:async()=>{}},Of=m.createContext(Ky);function Gy(){const{engine:e}=Gt(),{getApiBase:t,activeProjectId:n}=gn(),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((b,y)=>ce({id:b,project_id:y??n??void 0}),[n]),h=m.useCallback(b=>{a(y=>{if(!y.has(b))return y;const v=new Map(y);return v.delete(b),v})},[]),p=m.useCallback(async b=>{try{const y=await fetch(u,{signal:b});if(!y.ok){console.warn("[Orbital] Failed to fetch active scopes:",y.status,y.statusText),s(new Set),a(new Map);return}const v=await y.json();if(!l.current)return;const w=new Set;for(const N of v.scope_ids)typeof N=="number"?w.add(f(N)):w.add(ce({id:N.scope_id,project_id:N.project_id}));if(s(w),v.abandoned_scopes){const N=new Map;for(const j of v.abandoned_scopes){const S=j.project_id?ce({id:j.scope_id,project_id:j.project_id}):f(j.scope_id);N.set(S,{from_status:j.from_status,abandoned_at:j.abandoned_at,project_id:j.project_id})}a(N)}}catch(y){if(y instanceof DOMException&&y.name==="AbortError")return;s(new Set),a(new Map)}},[u,f]),g=m.useCallback(async(b,y,v)=>{try{const w=v??n,N=t(w),j=await fetch(`${N}/dispatch/recover/${b}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from_status:y})});if(!j.ok){const A=await j.json().catch(()=>({error:j.statusText}));console.error("[Orbital] Failed to recover scope:",A.error);return}const S=ce({id:b,project_id:w??void 0});h(S)}catch(w){console.error("[Orbital] Failed to recover scope:",w)}},[h,n,t]),x=m.useCallback(async(b,y)=>{try{const v=y??n,w=t(v),N=await fetch(`${w}/dispatch/dismiss-abandoned/${b}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!N.ok){const S=await N.json().catch(()=>({error:N.statusText}));console.error("[Orbital] Failed to dismiss abandoned scope:",S.error);return}const j=ce({id:b,project_id:v??void 0});h(j)}catch(v){console.error("[Orbital] Failed to dismiss abandoned scope:",v)}},[h,n,t]);return m.useEffect(()=>{l.current=!0;const b=new AbortController;return p(b.signal),()=>{l.current=!1,b.abort()}},[p]),m.useEffect(()=>{function b(j){return j.project_id}function y(j){if(j.type!=="DISPATCH"||j.data.resolved!=null)return;const S=b(j),A=[];if(j.scope_id!=null&&A.push(j.scope_id),Array.isArray(j.data.scope_ids))for(const T of j.data.scope_ids)A.includes(T)||A.push(T);if(A.length!==0){s(T=>{const E=A.map(D=>ce({id:D,project_id:S??c.current??void 0})).filter(D=>!T.has(D));if(E.length===0)return T;const M=new Set(T);for(const D of E)M.add(D);return M});for(const T of A)h(ce({id:T,project_id:S??c.current??void 0}))}}function v(j){const S=b(j),A=[];if(j.scope_id!=null&&A.push(j.scope_id),Array.isArray(j.scope_ids)&&A.push(...j.scope_ids),A.length===0)return;const T=A.map(O=>ce({id:O,project_id:S??c.current??void 0}));if(s(O=>{const E=T.filter(D=>O.has(D));if(E.length===0)return O;const M=new Set(O);for(const D of E)M.delete(D);return M}),j.outcome==="abandoned")p();else for(const O of T)h(O)}function w(j){if(r.has(j.status)){const S=b(j),A=ce({id:j.id,project_id:S??j.project_id??c.current??void 0});s(T=>{if(!T.has(A))return T;const O=new Set(T);return O.delete(A),O}),h(A)}}function N(){p()}return K.on("event:new",y),K.on("dispatch:resolved",v),K.on("scope:updated",w),K.on("connect",N),()=>{K.off("event:new",y),K.off("dispatch:resolved",v),K.off("scope:updated",w),K.off("connect",N)}},[p,h,r]),{activeScopes:i,abandonedScopes:o,recoverScope:g,dismissAbandoned:x}}function If(){return m.useContext(Of)}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 Lf={serialize:e=>JSON.stringify([...e]),deserialize:e=>{const t=JSON.parse(e);return Array.isArray(t)?new Set(t):void 0}},$n=[{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."}],Ff=m.createContext(null),Yy={isActive:!1,currentStepIndex:-1,currentStep:null,totalSteps:0,targetElement:null,next:()=>{},back:()=>{},skip:()=>{},restart:()=>{},start:()=>{}};function Xy(){return m.useContext(Ff)??Yy}const Jy="cc-onboarding-tour",cc=5e3;function Qy({children:e}){const[t,n]=_n(Jy,"pending"),[r,i]=m.useState(-1),[s,o]=m.useState(null),a=hf(),l=rx(),c=m.useRef(l);c.current=l;const u=m.useRef(null),f=m.useRef(null),h=m.useRef(!1),p=r>=0&&r<$n.length,g=m.useCallback(()=>{u.current&&(u.current.disconnect(),u.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),x=m.useCallback(E=>document.querySelector(`[data-tour="${E}"]`),[]),b=m.useCallback((E,M,D)=>{g();const R=x(E.target);if(R){M(R);return}u.current=new MutationObserver(()=>{const L=x(E.target);L&&(g(),M(L))}),u.current.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tour"]}),f.current=setTimeout(()=>{g(),D()},cc)},[g,x]),y=m.useCallback(E=>{if(h.current)return;if(E<0||E>=$n.length){i(-1),o(null),g();return}h.current=!0;const M=$n[E],D=c.current.pathname;M.page&&M.page!==D&&a(M.page+c.current.search),b(M,R=>{h.current=!1,i(E),o(R)},()=>{h.current=!1,M.optional?y(E+1):(console.warn(`[Onboarding] Target "${M.target}" not found after ${cc}ms on step "${M.id}"`),i(E),o(null))})},[a,b,g]),v=m.useCallback(()=>{const E=r+1;E>=$n.length?(n("completed"),i(-1),o(null),g(),c.current.pathname!=="/"&&a("/"+c.current.search)):y(E)},[r,n,y,g]),w=m.useCallback(()=>{r>0&&y(r-1)},[r,y]),N=m.useCallback(()=>{n("dismissed"),i(-1),o(null),g()},[n,g]),j=m.useCallback(()=>{n("pending"),y(0)},[n,y]),S=m.useCallback(()=>{p||y(0)},[p,y]);m.useEffect(()=>{if(!p||!s)return;const E=new MutationObserver(()=>{document.body.contains(s)||(o(null),v())});return E.observe(document.body,{childList:!0,subtree:!0}),()=>E.disconnect()},[p,s,v]),m.useEffect(()=>{t!=="pending"&&p&&(i(-1),o(null),g())},[t,p,g]);const A=m.useRef(!1);m.useEffect(()=>{if(!A.current&&t==="pending"&&!p){const E=setTimeout(()=>{A.current||(A.current=!0,y(0))},500);return()=>clearTimeout(E)}},[t,p,y]),m.useEffect(()=>()=>g(),[g]);const T=p?$n[r]:null,O={isActive:p,currentStepIndex:r,currentStep:T,totalSteps:$n.length,targetElement:s,next:v,back:w,skip:N,restart:j,start:S};return d.jsx(Ff.Provider,{value:O,children:e})}/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Bf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
12
|
-
* @license lucide-react v0.577.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Zy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
17
|
-
* @license lucide-react v0.577.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const eb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
22
|
-
* @license lucide-react v0.577.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const uc=e=>{const t=eb(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
27
|
-
* @license lucide-react v0.577.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/var tb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
32
|
-
* @license lucide-react v0.577.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const nb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
37
|
-
* @license lucide-react v0.577.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const rb=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,...tb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Bf("lucide",i),...!s&&!nb(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>m.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
|
|
42
|
-
* @license lucide-react v0.577.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const X=(e,t)=>{const n=m.forwardRef(({className:r,...i},s)=>m.createElement(rb,{ref:s,iconNode:t,className:Bf(`lucide-${Zy(uc(e))}`,`lucide-${e}`,r),...i}));return n.displayName=uc(e),n};/**
|
|
47
|
-
* @license lucide-react v0.577.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const ib=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sb=X("arrow-left",ib);/**
|
|
52
|
-
* @license lucide-react v0.577.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const ob=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ta=X("arrow-right",ob);/**
|
|
57
|
-
* @license lucide-react v0.577.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const ab=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xs=X("check",ab);/**
|
|
62
|
-
* @license lucide-react v0.577.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const lb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cb=X("chevron-down",lb);/**
|
|
67
|
-
* @license lucide-react v0.577.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const ub=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xr=X("chevron-right",ub);/**
|
|
72
|
-
* @license lucide-react v0.577.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const db=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fb=X("chevron-up",db);/**
|
|
77
|
-
* @license lucide-react v0.577.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const hb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],pb=X("circle-alert",hb);/**
|
|
82
|
-
* @license lucide-react v0.577.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const mb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],gb=X("circle-check",mb);/**
|
|
87
|
-
* @license lucide-react v0.577.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],yb=X("circle-minus",xb);/**
|
|
92
|
-
* @license lucide-react v0.577.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const bb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],vb=X("circle",bb);/**
|
|
97
|
-
* @license lucide-react v0.577.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const wb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],kb=X("clock",wb);/**
|
|
102
|
-
* @license lucide-react v0.577.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const Sb=[["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=X("columns-3",Sb);/**
|
|
107
|
-
* @license lucide-react v0.577.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const Cb=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],jb=X("download",Cb);/**
|
|
112
|
-
* @license lucide-react v0.577.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const Eb=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Nb=X("ellipsis-vertical",Eb);/**
|
|
117
|
-
* @license lucide-react v0.577.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const Tb=[["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"}]],Vf=X("external-link",Tb);/**
|
|
122
|
-
* @license lucide-react v0.577.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const Pb=[["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"}]],$f=X("eye-off",Pb);/**
|
|
127
|
-
* @license lucide-react v0.577.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const Ab=[["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"}]],Uf=X("eye",Ab);/**
|
|
132
|
-
* @license lucide-react v0.577.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const _b=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Rb=X("folder-plus",_b);/**
|
|
137
|
-
* @license lucide-react v0.577.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const Db=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Mb=X("funnel",Db);/**
|
|
142
|
-
* @license lucide-react v0.577.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const Ob=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Ib=X("git-branch",Ob);/**
|
|
147
|
-
* @license lucide-react v0.577.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const Lb=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Fb=X("git-commit-horizontal",Lb);/**
|
|
152
|
-
* @license lucide-react v0.577.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const Bb=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],zb=X("git-fork",Bb);/**
|
|
157
|
-
* @license lucide-react v0.577.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const Vb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$b=X("info",Vb);/**
|
|
162
|
-
* @license lucide-react v0.577.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const Ub=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Pa=X("layers",Ub);/**
|
|
167
|
-
* @license lucide-react v0.577.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const Wb=[["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"}]],Wf=X("layout-dashboard",Wb);/**
|
|
172
|
-
* @license lucide-react v0.577.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const Hb=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],qb=X("lightbulb",Hb);/**
|
|
177
|
-
* @license lucide-react v0.577.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const Kb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Aa=X("loader-circle",Kb);/**
|
|
182
|
-
* @license lucide-react v0.577.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const Gb=[["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"}]],Hf=X("package",Gb);/**
|
|
187
|
-
* @license lucide-react v0.577.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const Yb=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Wi=X("play",Yb);/**
|
|
192
|
-
* @license lucide-react v0.577.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const Xb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Hi=X("plus",Xb);/**
|
|
197
|
-
* @license lucide-react v0.577.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const Jb=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Qb=X("puzzle",Jb);/**
|
|
202
|
-
* @license lucide-react v0.577.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const Zb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],e0=X("refresh-cw",Zb);/**
|
|
207
|
-
* @license lucide-react v0.577.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const t0=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],n0=X("rotate-ccw",t0);/**
|
|
212
|
-
* @license lucide-react v0.577.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const r0=[["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"}]],qf=X("rows-3",r0);/**
|
|
217
|
-
* @license lucide-react v0.577.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const i0=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],s0=X("search",i0);/**
|
|
222
|
-
* @license lucide-react v0.577.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const o0=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],a0=X("settings-2",o0);/**
|
|
227
|
-
* @license lucide-react v0.577.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const l0=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],c0=X("settings",l0);/**
|
|
232
|
-
* @license lucide-react v0.577.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const u0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],d0=X("shield-check",u0);/**
|
|
237
|
-
* @license lucide-react v0.577.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const f0=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],h0=X("sliders-horizontal",f0);/**
|
|
242
|
-
* @license lucide-react v0.577.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const p0=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],_a=X("sparkles",p0);/**
|
|
247
|
-
* @license lucide-react v0.577.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const m0=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],g0=X("square-check-big",m0);/**
|
|
252
|
-
* @license lucide-react v0.577.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const x0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],y0=X("square",x0);/**
|
|
257
|
-
* @license lucide-react v0.577.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const b0=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],v0=X("star",b0);/**
|
|
262
|
-
* @license lucide-react v0.577.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const w0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ra=X("terminal",w0);/**
|
|
267
|
-
* @license lucide-react v0.577.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const k0=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],S0=X("trash-2",k0);/**
|
|
272
|
-
* @license lucide-react v0.577.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const C0=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],fn=X("triangle-alert",C0);/**
|
|
277
|
-
* @license lucide-react v0.577.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const j0=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],E0=X("undo-2",j0);/**
|
|
282
|
-
* @license lucide-react v0.577.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const N0=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],T0=X("workflow",N0);/**
|
|
287
|
-
* @license lucide-react v0.577.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const P0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ct=X("x",P0);class Kf extends m.Component{constructor(){super(...arguments);tt(this,"state",{hasError:!1,error:null});tt(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(fn,{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(n0,{className:"h-3.5 w-3.5"}),"Retry"]})]})}):this.props.children}}function mr(){return m.useEffect(()=>{document.documentElement.setAttribute("data-theme","neon-glass")},[]),{neonGlass:!0}}const dc={fontFamily:"Space Grotesk",fontScale:1.1,reduceMotion:!1,showBackgroundEffects:!0,showStatusBar:!0,compactMode:!1},Da="cc-settings",Gf=[{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"}],Hs="cc-dynamic-font",fc="cc-font-previews";function A0(e){if(e==="JetBrains Mono"){const i=document.getElementById(Hs);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(Hs);if(r){if(r.href===n)return;r.href=n}else r=document.createElement("link"),r.id=Hs,r.rel="stylesheet",r.href=n,document.head.appendChild(r)}function _M(){if(document.getElementById(fc))return;const t=`https://fonts.googleapis.com/css2?${Gf.filter(r=>r.family!=="JetBrains Mono").map(r=>`family=${r.family.replace(/ /g,"+")}:wght@400`).join("&")}&display=swap`,n=document.createElement("link");n.id=fc,n.rel="stylesheet",n.href=t,document.head.appendChild(n)}function hc(){try{const e=localStorage.getItem(Da);if(e)return{...dc,...JSON.parse(e)}}catch{}return{...dc}}function _0(e){try{localStorage.setItem(Da,JSON.stringify(e))}catch{}}function qs(e){var r;const t=document.documentElement,n=((r=Gf.find(i=>i.family===e.fontFamily))==null?void 0:r.category)==="monospace"?"monospace":"sans-serif";t.style.setProperty("--font-family",`'${e.fontFamily}', ${n}`),A0(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 Yf=m.createContext(null);function R0({children:e}){const[t,n]=m.useState(hc),r=m.useCallback((i,s)=>{n(o=>{const a={...o,[i]:s};return _0(a),qs(a),a})},[]);return m.useEffect(()=>{qs(t)},[]),m.useEffect(()=>{const i=s=>{if(s.key===Da){const o=hc();n(o),qs(o)}};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),d.jsx(Yf.Provider,{value:{settings:t,updateSetting:r},children:e})}function Ma(){const e=m.useContext(Yf);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}const ir=m.forwardRef(({className:e,children:t,orientation:n="vertical",...r},i)=>d.jsxs(ef,{ref:i,className:z("relative overflow-hidden",e),...r,children:[d.jsx(Ig,{className:"h-full w-full rounded-[inherit]",children:t}),(n==="vertical"||n==="both")&&d.jsx(Vo,{orientation:"vertical"}),(n==="horizontal"||n==="both")&&d.jsx(Vo,{orientation:"horizontal"}),d.jsx(Lg,{})]}));ir.displayName=ef.displayName;const Vo=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>d.jsx(tf,{ref:r,orientation:t,className:z("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(Fg,{className:"relative flex-1 rounded-full bg-border"})}));Vo.displayName=tf.displayName;function Lt(){const{getApiBase:e,activeProjectId:t}=gn();return m.useCallback(n=>`${e(t)}${n}`,[e,t])}function Xf(){const e=Lt(),{activeProjectId:t}=gn(),[n,r]=m.useState([]),[i,s]=m.useState(!0),[o,a]=m.useState(null),l=m.useCallback(async c=>{try{const u=await fetch(e("/scopes"),{signal:c});if(!u.ok)throw new Error(`HTTP ${u.status}`);const f=await u.json();if(t)for(const h of f)h.project_id||(h.project_id=t);r(f),a(null)}catch(u){if(u instanceof DOMException&&u.name==="AbortError")return;a(u instanceof Error?u.message:"Failed to fetch scopes")}finally{c!=null&&c.aborted||s(!1)}},[e,t]);return m.useEffect(()=>{const c=new AbortController;return l(c.signal),()=>c.abort()},[l]),gs(l),m.useEffect(()=>{function c(x){return t?!x.project_id||x.project_id===t:!0}function u(x){c(x)&&(!x.project_id&&t&&(x.project_id=t),r(b=>{const y=b.findIndex(v=>v.id===x.id&&(!x.project_id||v.project_id===x.project_id));if(y>=0){const v=[...b];return v[y]=x,v}return[...b,x].sort((v,w)=>v.id-w.id)}))}function f(x){c(x)&&(!x.project_id&&t&&(x.project_id=t),r(b=>[...b,x].sort((y,v)=>y.id-v.id)))}function h(x){if(!t){l();return}r(b=>b.filter(y=>y.id!==x))}function p(x){x.enabled!==void 0&&(t&&x.id!==t||l())}function g(x){t&&x.id!==t||x.status==="active"&&l()}return K.on("scope:updated",u),K.on("scope:created",f),K.on("scope:deleted",h),K.on("workflow:changed",l),K.on("project:updated",p),K.on("project:status:changed",g),()=>{K.off("scope:updated",u),K.off("scope:created",f),K.off("scope:deleted",h),K.off("workflow:changed",l),K.off("project:updated",p),K.off("project:status:changed",g)}},[l,t]),{scopes:n,loading:i,error:o,refetch:l}}const pc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mc=pf,Jf=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mc(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=pc(u)||pc(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[x,b]=g;return Array.isArray(b)?b.includes({...s,...a}[x]):{...s,...a}[x]===b})?[...c,f,h]:c},[]);return mc(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},D0=Jf("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 _e({className:e,variant:t,...n}){return d.jsx("div",{className:z(D0({variant:t}),e),...n})}function M0(e){const t=O0(e),n=m.forwardRef((r,i)=>{const{children:s,...o}=r,a=m.Children.toArray(s),l=a.find(L0);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 O0(e){const t=m.forwardRef((n,r)=>{const{children:i,...s}=n;if(m.isValidElement(i)){const o=B0(i),a=F0(s,i.props);return i.type!==m.Fragment&&(a.ref=r?nf(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 I0=Symbol("radix.slottable");function L0(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===I0}function F0(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 B0(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 ys="Popover",[Qf]=$g(ys,[of]),ai=of(),[z0,xn]=Qf(ys),Zf=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=ai(t),l=m.useRef(null),[c,u]=m.useState(!1),[f,h]=Kg({prop:r,defaultProp:i??!1,onChange:s,caller:ys});return d.jsx(Gg,{...a,children:d.jsx(z0,{scope:t,contentId:Yg(),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})})};Zf.displayName=ys;var eh="PopoverAnchor",V0=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xn(eh,n),s=ai(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return m.useEffect(()=>(o(),()=>a()),[o,a]),d.jsx(lf,{...s,...r,ref:t})});V0.displayName=eh;var th="PopoverTrigger",nh=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xn(th,n),s=ai(n),o=sf(t,i.triggerRef),a=d.jsx(af.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ah(i.open),...r,ref:o,onClick:Br(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:d.jsx(lf,{asChild:!0,...s,children:a})});nh.displayName=th;var Oa="PopoverPortal",[$0,U0]=Qf(Oa,{forceMount:void 0}),rh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=xn(Oa,t);return d.jsx($0,{scope:t,forceMount:n,children:d.jsx(rf,{present:n||s.open,children:d.jsx(Bg,{asChild:!0,container:i,children:r})})})};rh.displayName=Oa;var sr="PopoverContent",ih=m.forwardRef((e,t)=>{const n=U0(sr,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=xn(sr,e.__scopePopover);return d.jsx(rf,{present:r||s.open,children:s.modal?d.jsx(H0,{...i,ref:t}):d.jsx(q0,{...i,ref:t})})});ih.displayName=sr;var W0=M0("PopoverContent.RemoveScroll"),H0=m.forwardRef((e,t)=>{const n=xn(sr,e.__scopePopover),r=m.useRef(null),i=sf(t,r),s=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return zg(o)},[]),d.jsx(Vg,{as:W0,allowPinchZoom:!0,children:d.jsx(sh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Br(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Br(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:Br(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),q0=m.forwardRef((e,t)=>{const n=xn(sr,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return d.jsx(sh,{...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()}})}),sh=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=xn(sr,n),p=ai(n);return Ug(),d.jsx(Wg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(Hg,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:d.jsx(qg,{"data-state":ah(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)"}})})})}),oh="PopoverClose",K0=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xn(oh,n);return d.jsx(af.button,{type:"button",...r,ref:t,onClick:Br(e.onClick,()=>i.onOpenChange(!1))})});K0.displayName=oh;var G0="PopoverArrow",Y0=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ai(n);return d.jsx(Xg,{...i,...r,ref:t})});Y0.displayName=G0;function ah(e){return e?"open":"closed"}var X0=Zf,J0=nh,Q0=rh,lh=ih;const On=X0,In=J0,yn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},i)=>d.jsx(Q0,{children:d.jsx(lh,{ref:i,align:t,sideOffset:n,className:z("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})}));yn.displayName=lh.displayName;function Z0(){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 b=await fetch("/api/orbital/version");if(!b.ok)throw new Error(`HTTP ${b.status}`);const y=await b.json();t(y)}catch{}finally{f(!1)}},[]),p=m.useCallback(async()=>{const b=await fetch("/api/orbital/version/check");if(!b.ok)throw new Error(`HTTP ${b.status}`);const y=await b.json();r(y.updateAvailable),s(y.behindCount)},[]);m.useEffect(()=>{h()},[h]),gs(h),m.useEffect(()=>{const b=setInterval(async()=>{try{await p()}catch{}},3e5);return()=>clearInterval(b)},[p]),m.useEffect(()=>{function b(v){a(v.stage)}function y(v){v.success?(a("done"),r(!1),s(0),h()):(a("error"),c(v.error??"Unknown error"))}return K.on("version:updating",b),K.on("version:updated",y),()=>{K.off("version:updating",b),K.off("version:updated",y)}},[]);const g=m.useCallback(async()=>{a("checking"),c(null);try{await p(),a("checked"),setTimeout(()=>a("idle"),4e3)}catch(b){a("error"),c(b.message)}},[p]),x=m.useCallback(async()=>{a("pulling"),c(null);try{const b=await fetch("/api/orbital/version/update",{method:"POST",headers:{"X-Orbital-Action":"update"}});if(!b.ok){const v=await b.json().catch(()=>({error:`HTTP ${b.status}`}));a("error"),c(v.error??"Update failed");return}const y=await b.json().catch(()=>null);y!=null&&y.success&&(a("done"),r(!1),s(0),h())}catch(b){a("error"),c(b.message)}},[h]);return{version:e,updateAvailable:n,behindCount:i,updateStage:o,updateError:l,loading:u,checkForUpdate:g,performUpdate:x}}function ev(){const{version:e,updateAvailable:t,behindCount:n,updateStage:r,updateError:i,loading:s,checkForUpdate:o,performUpdate:a}=Z0();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(On,{children:[d.jsx(In,{asChild:!0,children:d.jsxs("button",{className:"relative cursor-pointer",children:[d.jsxs(_e,{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(yn,{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(_e,{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(Fb,{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(Ib,{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(xs,{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(pb,{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(Aa,{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:z("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(e0,{className:z("h-3 w-3",r==="checking"&&"animate-spin")}),"Check"]}),t&&r!=="done"&&d.jsxs("button",{onClick:a,disabled:l,className:z("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(jb,{className:"h-3 w-3"}),"Update"]})]})]})})]})}function tv(){const{scopes:e}=Xf(),{engine:t}=Gt(),{activeScopes:n}=If();mr();const r=hf(),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:xc(f,s),needsAttention:xc(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:z("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(gc,{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(gc,{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(ev,{})})]})})}function gc({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=nv(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:[pt(a.id)," ",a.title]})]},ce(a)))})})}function xc(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 nv(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 ki=28,yc=1,rv="rgba(255, 255, 255, 0.12)",iv="rgba(255, 255, 255, 0.35)",Ks=180,sv=14,bc={x:-9999,y:-9999};function ov(){const e=m.useRef(null),t=m.useRef(bc),n=m.useRef(!1),r=m.useRef(0);return m.useEffect(()=>{const i=e.current;if(!i)return;const s=i.getContext("2d");if(!s)return;function o(){if(n.current=!1,!s||!i)return;s.clearRect(0,0,i.width,i.height);const f=t.current.x,h=t.current.y,p=Ks*Ks,g=Math.ceil(i.width/ki)+1,x=Math.ceil(i.height/ki)+1;for(let b=0;b<x;b++)for(let y=0;y<g;y++){const v=y*ki,w=b*ki,N=v-f,j=w-h,S=N*N+j*j;let A=v,T=w,O=rv,E=yc;if(S<p){const M=Math.sqrt(S),D=1-M/Ks,R=D*D,L=R*sv;M>.1&&(A+=N/M*L,T+=j/M*L),O=iv,E=yc+R*.6}s.beginPath(),s.arc(A,T,E,0,Math.PI*2),s.fillStyle=O,s.fill()}}function a(){n.current||(n.current=!0,r.current=requestAnimationFrame(o))}function l(){i&&(i.width=window.innerWidth,i.height=window.innerHeight,a())}function c(f){t.current={x:f.clientX,y:f.clientY},a()}function u(){t.current=bc,a()}return l(),a(),window.addEventListener("resize",l),window.addEventListener("mousemove",c),document.addEventListener("mouseleave",u),()=>{cancelAnimationFrame(r.current),window.removeEventListener("resize",l),window.removeEventListener("mousemove",c),document.removeEventListener("mouseleave",u)}},[]),d.jsx("canvas",{ref:e,className:"neon-grid-canvas",style:{pointerEvents:"none"}})}const Me=8,sn=12;function av(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 lv(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 cv(){const{isActive:e,currentStep:t,currentStepIndex:n,totalSteps:r,targetElement:i,next:s,back:o,skip:a}=Xy(),{settings:l}=Ma(),[c,u]=m.useState(null),f=m.useRef(null),h=m.useRef(null),p=l.reduceMotion,g=l.fontScale,x=m.useCallback(()=>{if(!i){u(null);return}u(av(i,g))},[i,g]);m.useEffect(()=>{if(!i){u(null);return}x();const S=new ResizeObserver(()=>{requestAnimationFrame(x)});return S.observe(i),window.addEventListener("resize",x),window.addEventListener("scroll",x,!0),()=>{S.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("scroll",x,!0)}},[i,x]),m.useEffect(()=>{e&&(h.current=document.activeElement)},[e]),m.useEffect(()=>{e&&f.current&&f.current.focus()},[e,n]);const b=m.useRef(!1);if(m.useEffect(()=>{e?b.current=!0:b.current&&(b.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 O=T[0],E=T[T.length-1];A.shiftKey?document.activeElement===O&&(A.preventDefault(),E.focus()):document.activeElement===E&&(A.preventDefault(),O.focus())}}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,s,o,a]),!e||!t)return null;const y=t.placement??"right",v=c&&t.maxSpotlightWidth&&c.width>t.maxSpotlightWidth?{...c,width:t.maxSpotlightWidth}:c,w=uv(v,y),N=v?`polygon(
|
|
292
|
-
0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
|
|
293
|
-
${v.left-Me}px ${v.top-Me}px,
|
|
294
|
-
${v.left+v.width+Me}px ${v.top-Me}px,
|
|
295
|
-
${v.left+v.width+Me}px ${v.top+v.height+Me}px,
|
|
296
|
-
${v.left-Me}px ${v.top+v.height+Me}px,
|
|
297
|
-
${v.left-Me}px ${v.top-Me}px
|
|
298
|
-
)`:void 0,j=p?"none":"clip-path 0.3s ease-out";return Yn.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:N,transition:j},onClick:a}),d.jsxs("div",{ref:f,tabIndex:-1,className:"card-glass absolute rounded-xl p-5 shadow-lg outline-none",style:{...w,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 ${lv(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 Un=200,Si=16;function uv(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(Si+f,Math.min(window.innerWidth-Si-f,u))},i=u=>Math.max(Si+Un/2,Math.min(window.innerHeight-Si-Un/2,u)),s=window.innerHeight-(e.top+e.height+Me+sn),o=e.top-Me-sn,a=window.innerWidth-(e.left+e.width+Me+sn),l=e.left-Me-sn;let c=t;switch(c==="bottom"&&s<Un?o>=Un?c="top":a>=n?c="right":l>=n&&(c="left"):c==="top"&&o<Un&&(s>=Un?c="bottom":a>=n?c="right":l>=n&&(c="left")),c){case"top":return{bottom:window.innerHeight-e.top+Me+sn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"bottom":return{top:e.top+e.height+Me+sn,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+Me+sn,transform:"translateY(-50%)"};case"right":return{top:i(e.top+e.height/2),left:e.left+e.width+Me+sn,transform:"translateY(-50%)"}}}const dv=[{to:"/",icon:Wf,label:"KANBAN",tourId:"nav-kanban"},{to:"/primitives",icon:Qb,label:"PRIMITIVES",tourId:"nav-primitives"},{to:"/guards",icon:d0,label:"GUARDS",tourId:"nav-guards"},{to:"/repo",icon:zb,label:"REPO",tourId:"nav-repo"},{to:"/sessions",icon:kb,label:"SESSIONS",tourId:"nav-sessions"},{to:"/workflow",icon:T0,label:"WORKFLOW",tourId:"nav-workflow"}],fv=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 hv(){const{settings:e}=Ma(),t=new URLSearchParams(window.location.search).toString(),n=t?`?${t}`:"";return mr(),d.jsxs("div",{className:"flex h-screen bg-background",children:[e.showBackgroundEffects&&d.jsx("div",{className:"neon-bg",children:d.jsx(ov,{})}),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(ir,{className:"flex-1",children:d.jsx("nav",{className:"flex flex-col items-center gap-3 px-4 py-2",children:dv.map(({to:r,icon:i,label:s,tourId:o})=>d.jsxs(Jl,{to:`${r}${n}`,end:r==="/","data-tour":o,className:({isActive:a})=>z("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",children:d.jsxs(Jl,{to:`/settings${t}`,"data-tour":"nav-settings",className:({isActive:r})=>z("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(c0,{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-12",children:d.jsx(Kf,{children:d.jsx(m.Suspense,{fallback:fv,children:d.jsx(ix,{})})})})}),e.showStatusBar&&d.jsx(tv,{}),d.jsx(cv,{})]})}function RM(){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 bs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ia(e){return"nodeType"in e}function He(e){var t,n;return e?gr(e)?e:Ia(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function La(e){const{Document:t}=He(e);return e instanceof t}function li(e){return gr(e)?!1:e instanceof He(e).HTMLElement}function ch(e){return e instanceof He(e).SVGElement}function xr(e){return e?gr(e)?e.document:Ia(e)?La(e)?e:li(e)||ch(e)?e.ownerDocument:document:document:document}const qt=bs?m.useLayoutEffect:m.useEffect;function vs(e){const t=m.useRef(e);return qt(()=>{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 pv(){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 Jr(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return qt(()=>{n.current!==e&&(n.current=e)},t),n}function ci(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function qi(e){const t=vs(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 Ki(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let Gs={};function ws(e,t){return m.useMemo(()=>{if(t)return t;const n=Gs[e]==null?0:Gs[e]+1;return Gs[e]=n,e+"-"+n},[e,t])}function uh(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 nr=uh(1),Gi=uh(-1);function mv(e){return"clientX"in e&&"clientY"in e}function Fa(e){if(!e)return!1;const{KeyboardEvent:t}=He(e.target);return t&&e instanceof t}function gv(e){if(!e)return!1;const{TouchEvent:t}=He(e.target);return t&&e instanceof t}function Yi(e){if(gv(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 mv(e)?{x:e.clientX,y:e.clientY}:null}const Dn=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[Dn.Translate.toString(e),Dn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),vc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xv(e){return e.matches(vc)?e:e.querySelector(vc)}const yv={display:"none"};function bv(e){let{id:t,value:n}=e;return ke.createElement("div",{id:t,style:yv},n)}function vv(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 ke.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function wv(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const dh=m.createContext(null);function kv(e){const t=m.useContext(dh);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Sv(){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 Cv={draggable:`
|
|
299
|
-
To pick up a draggable item, press the space bar.
|
|
300
|
-
While dragging, use the arrow keys to move the item.
|
|
301
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
302
|
-
`},jv={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 Ev(e){let{announcements:t=jv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Cv}=e;const{announce:s,announcement:o}=wv(),a=ws("DndLiveRegion"),[l,c]=m.useState(!1);if(m.useEffect(()=>{c(!0)},[]),kv(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=ke.createElement(ke.Fragment,null,ke.createElement(bv,{id:r,value:i.draggable}),ke.createElement(vv,{id:a,announcement:o}));return n?Yn.createPortal(u,n):u}var Ae;(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"})(Ae||(Ae={}));function Xi(){}function wc(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Nv(){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 jt=Object.freeze({x:0,y:0});function Ba(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Tv(e,t){const n=Yi(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 za(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Pv(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $o(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 Av(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function kc(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 DM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=kc(t,t.left,t.top),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=Ba(kc(l),i);s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(za)},MM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=$o(t),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=$o(l),u=i.reduce((h,p,g)=>h+Ba(c[g],p),0),f=Number((u/4).toFixed(4));s.push({id:a,data:{droppableContainer:o,value:f}})}}return s.sort(za)};function _v(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 fh=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=_v(a,t);l>0&&i.push({id:o,data:{droppableContainer:s,value:l}})}}return i.sort(Pv)};function Rv(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 Dv=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&&Rv(r,a)){const c=$o(a).reduce((f,h)=>f+Ba(r,h),0),u=Number((c/4).toFixed(4));i.push({id:o,data:{droppableContainer:s,value:u}})}}return i.sort(za)};function Mv(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function hh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:jt}function Ov(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 Iv=Ov(1);function ph(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 Lv(e,t,n){const r=ph(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 Fv={ignoreTransform:!1};function ui(e,t){t===void 0&&(t=Fv);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=He(e).getComputedStyle(e);c&&(n=Lv(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 Sc(e){return ui(e,{ignoreTransform:!0})}function Bv(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function zv(e,t){return t===void 0&&(t=He(e).getComputedStyle(e)),t.position==="fixed"}function Vv(e,t){t===void 0&&(t=He(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 Va(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(La(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!li(i)||ch(i)||n.includes(i))return n;const s=He(e).getComputedStyle(i);return i!==e&&Vv(i,s)&&n.push(i),zv(i,s)?n:r(i.parentNode)}return e?r(e):n}function mh(e){const[t]=Va(e,1);return t??null}function Ys(e){return!bs||!e?null:gr(e)?e:Ia(e)?La(e)||e===xr(e).scrollingElement?window:li(e)?e:null:null}function gh(e){return gr(e)?e.scrollX:e.scrollLeft}function xh(e){return gr(e)?e.scrollY:e.scrollTop}function Uo(e){return{x:gh(e),y:xh(e)}}var Oe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oe||(Oe={}));function yh(e){return!bs||!e?!1:e===document.scrollingElement}function bh(e){const t={x:0,y:0},n=yh(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 $v={x:.2,y:.2};function Uv(e,t,n,r,i){let{top:s,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=$v);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=bh(e),p={x:0,y:0},g={x:0,y:0},x={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+x.height?(p.y=Oe.Backward,g.y=r*Math.abs((t.top+x.height-s)/x.height)):!u&&l>=t.bottom-x.height&&(p.y=Oe.Forward,g.y=r*Math.abs((t.bottom-x.height-l)/x.height)),!h&&a>=t.right-x.width?(p.x=Oe.Forward,g.x=r*Math.abs((t.right-x.width-a)/x.width)):!f&&o<=t.left+x.width&&(p.x=Oe.Backward,g.x=r*Math.abs((t.left+x.width-o)/x.width)),{direction:p,speed:g}}function Wv(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)=>nr(t,Uo(n)),jt)}function Hv(e){return e.reduce((t,n)=>t+gh(n),0)}function qv(e){return e.reduce((t,n)=>t+xh(n),0)}function wh(e,t){if(t===void 0&&(t=ui),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);mh(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Kv=[["x",["left","right"],Hv],["y",["top","bottom"],qv]];class $a{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=Va(n),i=vh(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,o,a]of Kv)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 zr{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 Gv(e){const{EventTarget:t}=He(e);return e instanceof t?e:xr(e)}function Xs(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 dt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(dt||(dt={}));function Cc(e){e.preventDefault()}function Yv(e){e.stopPropagation()}var fe;(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"})(fe||(fe={}));const kh={start:[fe.Space,fe.Enter],cancel:[fe.Esc],end:[fe.Space,fe.Enter,fe.Tab]},Xv=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case fe.Right:return{...n,x:n.x+25};case fe.Left:return{...n,x:n.x-25};case fe.Down:return{...n,y:n.y+25};case fe.Up:return{...n,y:n.y-25}}};class Ua{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 zr(xr(n)),this.windowListeners=new zr(He(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(dt.Resize,this.handleCancel),this.windowListeners.add(dt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(dt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&wh(r),n(jt)}handleKeyDown(t){if(Fa(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=kh,coordinateGetter:o=Xv,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}:jt;this.referenceCoordinates||(this.referenceCoordinates=u);const f=o(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=Gi(f,u),p={x:0,y:0},{scrollableAncestors:g}=r.current;for(const x of g){const b=t.code,{isTop:y,isRight:v,isLeft:w,isBottom:N,maxScroll:j,minScroll:S}=bh(x),A=Wv(x),T={x:Math.min(b===fe.Right?A.right-A.width/2:A.right,Math.max(b===fe.Right?A.left:A.left+A.width/2,f.x)),y:Math.min(b===fe.Down?A.bottom-A.height/2:A.bottom,Math.max(b===fe.Down?A.top:A.top+A.height/2,f.y))},O=b===fe.Right&&!v||b===fe.Left&&!w,E=b===fe.Down&&!N||b===fe.Up&&!y;if(O&&T.x!==f.x){const M=x.scrollLeft+h.x,D=b===fe.Right&&M<=j.x||b===fe.Left&&M>=S.x;if(D&&!h.y){x.scrollTo({left:M,behavior:a});return}D?p.x=x.scrollLeft-M:p.x=b===fe.Right?x.scrollLeft-j.x:x.scrollLeft-S.x,p.x&&x.scrollBy({left:-p.x,behavior:a});break}else if(E&&T.y!==f.y){const M=x.scrollTop+h.y,D=b===fe.Down&&M<=j.y||b===fe.Up&&M>=S.y;if(D&&!h.x){x.scrollTo({top:M,behavior:a});return}D?p.y=x.scrollTop-M:p.y=b===fe.Down?x.scrollTop-j.y:x.scrollTop-S.y,p.y&&x.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,nr(Gi(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()}}Ua.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=kh,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 jc(e){return!!(e&&"distance"in e)}function Ec(e){return!!(e&&"delay"in e)}class Wa{constructor(t,n,r){var i;r===void 0&&(r=Gv(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=xr(o),this.documentListeners=new zr(this.document),this.listeners=new zr(r),this.windowListeners=new zr(He(o)),this.initialCoordinates=(i=Yi(s))!=null?i:jt,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(dt.Resize,this.handleCancel),this.windowListeners.add(dt.DragStart,Cc),this.windowListeners.add(dt.VisibilityChange,this.handleCancel),this.windowListeners.add(dt.ContextMenu,Cc),this.documentListeners.add(dt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ec(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(jc(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(dt.Click,Yv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(dt.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=Yi(t))!=null?n:jt,c=Gi(i,l);if(!r&&a){if(jc(a)){if(a.tolerance!=null&&Xs(c,a.tolerance))return this.handleCancel();if(Xs(c,a.distance))return this.handleStart()}if(Ec(a)&&Xs(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===fe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Jv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ha extends Wa{constructor(t){const{event:n}=t,r=xr(n.target);super(t,Jv,r)}}Ha.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 Qv={move:{name:"mousemove"},end:{name:"mouseup"}};var Wo;(function(e){e[e.RightClick=2]="RightClick"})(Wo||(Wo={}));class Zv extends Wa{constructor(t){super(t,Qv,xr(t.event.target))}}Zv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Wo.RightClick?!1:(r==null||r({event:n}),!0)}}];const Js={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ew extends Wa{constructor(t){super(t,Js)}static setup(){return window.addEventListener(Js.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Js.move.name,t)};function t(){}}}ew.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 Vr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Vr||(Vr={}));var Ji;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ji||(Ji={}));function tw(e){let{acceleration:t,activator:n=Vr.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:o=5,order:a=Ji.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=rw({delta:f,disabled:!s}),[g,x]=pv(),b=m.useRef({x:0,y:0}),y=m.useRef({x:0,y:0}),v=m.useMemo(()=>{switch(n){case Vr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Vr.DraggableRect:return i}},[n,i,l]),w=m.useRef(null),N=m.useCallback(()=>{const S=w.current;if(!S)return;const A=b.current.x*y.current.x,T=b.current.y*y.current.y;S.scrollBy(A,T)},[]),j=m.useMemo(()=>a===Ji.TreeOrder?[...c].reverse():c,[a,c]);m.useEffect(()=>{if(!s||!c.length||!v){x();return}for(const S of j){if((r==null?void 0:r(S))===!1)continue;const A=c.indexOf(S),T=u[A];if(!T)continue;const{direction:O,speed:E}=Uv(S,T,v,t,h);for(const M of["x","y"])p[M][O[M]]||(E[M]=0,O[M]=0);if(E.x>0||E.y>0){x(),w.current=S,g(N,o),b.current=E,y.current=O;return}}b.current={x:0,y:0},y.current={x:0,y:0},x()},[t,N,r,x,s,o,JSON.stringify(v),JSON.stringify(p),g,c,j,u,JSON.stringify(h)])}const nw={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};function rw(e){let{delta:t,disabled:n}=e;const r=Ki(t);return ci(i=>{if(n||!r||!i)return nw;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Oe.Backward]:i.x[Oe.Backward]||s.x===-1,[Oe.Forward]:i.x[Oe.Forward]||s.x===1},y:{[Oe.Backward]:i.y[Oe.Backward]||s.y===-1,[Oe.Forward]:i.y[Oe.Forward]||s.y===1}}},[n,t,r])}function iw(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ci(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function sw(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 Qr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Qr||(Qr={}));var Ho;(function(e){e.Optimized="optimized"})(Ho||(Ho={}));const Nc=new Map;function ow(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=b(),h=Jr(f),p=m.useCallback(function(y){y===void 0&&(y=[]),!h.current&&o(v=>v===null?y:v.concat(y.filter(w=>!v.includes(w))))},[h]),g=m.useRef(null),x=ci(y=>{if(f&&!n)return Nc;if(!y||y===Nc||u.current!==e||s!=null){const v=new Map;for(let w of e){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){v.set(w.id,w.rect.current);continue}const N=w.node.current,j=N?new $a(l(N),N):null;w.rect.current=j,j&&v.set(w.id,j)}return v}return y},[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:x,measureDroppableContainers:p,measuringScheduled:s!=null};function b(){switch(c){case Qr.Always:return!1;case Qr.BeforeDragging:return n;default:return!n}}}function qa(e,t){return ci(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function aw(e,t){return qa(e,t)}function lw(e){let{callback:t,disabled:n}=e;const r=vs(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 ks(e){let{callback:t,disabled:n}=e;const r=vs(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 cw(e){return new $a(ui(e),e)}function Tc(e,t,n){t===void 0&&(t=cw);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=lw({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=ks({callback:s});return qt(()=>{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 uw(e){const t=qa(e);return hh(e,t)}const Pc=[];function dw(e){const t=m.useRef(e),n=ci(r=>e?r&&r!==Pc&&e&&t.current&&e.parentNode===t.current.parentNode?r:Va(e):Pc,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function fw(e){const[t,n]=m.useState(null),r=m.useRef(e),i=m.useCallback(s=>{const o=Ys(s.target);o&&n(a=>a?(a.set(o,Uo(o)),new Map(a)):null)},[]);return m.useEffect(()=>{const s=r.current;if(e!==s){o(s);const a=e.map(l=>{const c=Ys(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,Uo(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=Ys(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,o)=>nr(s,o),jt):vh(e):jt,[e,t])}function Ac(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==jt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Gi(e,n.current):jt}function hw(e){m.useEffect(()=>{if(!bs)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 pw(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 Sh(e){return m.useMemo(()=>e?Bv(e):null,[e])}const _c=[];function mw(e,t){t===void 0&&(t=ui);const[n]=e,r=Sh(n?He(n):null),[i,s]=m.useState(_c);function o(){s(()=>e.length?e.map(l=>yh(l)?r:new $a(t(l),l)):_c)}const a=ks({callback:o});return qt(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),i}function Ch(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return li(t)?t:e}function gw(e){let{measure:t}=e;const[n,r]=m.useState(null),i=m.useCallback(c=>{for(const{target:u}of c)if(li(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),s=ks({callback:i}),o=m.useCallback(c=>{const u=Ch(c);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=qi(o);return m.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const xw=[{sensor:Ha,options:{}},{sensor:Ua,options:{}}],yw={current:{}},Bi={draggable:{measure:Sc},droppable:{measure:Sc,strategy:Qr.WhileDragging,frequency:Ho.Optimized},dragOverlay:{measure:ui}};class $r 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 bw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $r,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xi},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bi,measureDroppableContainers:Xi,windowRect:null,measuringScheduled:!1},jh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Xi,draggableNodes:new Map,over:null,measureDroppableContainers:Xi},di=m.createContext(jh),Eh=m.createContext(bw);function vw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $r}}}function ww(e,t){switch(t.type){case Ae.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ae.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 Ae.DragEnd:case Ae.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ae.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new $r(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Ae.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 $r(e.droppable.containers);return o.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Ae.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new $r(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function kw(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=m.useContext(di),s=Ki(r),o=Ki(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&s&&o!=null){if(!Fa(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=xv(u);if(f){f.focus();break}}})}},[r,t,i,o,s]),null}function Nh(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Sw(e){return m.useMemo(()=>({draggable:{...Bi.draggable,...e==null?void 0:e.draggable},droppable:{...Bi.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Bi.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 Cw(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;qt(()=>{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=hh(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=mh(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,o,a,r,n])}const Ss=m.createContext({...jt,scaleX:1,scaleY:1});var cn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(cn||(cn={}));const jw=m.memo(function(t){var n,r,i,s;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:u=xw,collisionDetection:f=fh,measuring:h,modifiers:p,...g}=t;const x=m.useReducer(ww,void 0,vw),[b,y]=x,[v,w]=Sv(),[N,j]=m.useState(cn.Uninitialized),S=N===cn.Initialized,{draggable:{active:A,nodes:T,translate:O},droppable:{containers:E}}=b,M=A!=null?T.get(A):null,D=m.useRef({initial:null,translated:null}),R=m.useMemo(()=>{var De;return A!=null?{id:A,data:(De=M==null?void 0:M.data)!=null?De:yw,rect:D}:null},[A,M]),L=m.useRef(null),[P,F]=m.useState(null),[_,H]=m.useState(null),U=Jr(g,Object.values(g)),C=ws("DndDescribedBy",o),B=m.useMemo(()=>E.getEnabled(),[E]),J=Sw(h),{droppableRects:k,measureDroppableContainers:oe,measuringScheduled:qe}=ow(B,{dragging:S,dependencies:[O.x,O.y],config:J.droppable}),le=iw(T,A),mt=m.useMemo(()=>_?Yi(_):null,[_]),Qe=Bs(),gt=aw(le,J.draggable.measure);Cw({activeNode:A!=null?T.get(A):null,config:Qe.layoutShiftCompensation,initialRect:gt,measure:J.draggable.measure});const Ce=Tc(le,J.draggable.measure,gt),Nt=Tc(le?le.parentElement:null),xt=m.useRef({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:k,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),zn=E.getNodeFor((n=xt.current.over)==null?void 0:n.id),yt=gw({measure:J.dragOverlay.measure}),ye=(r=yt.nodeRef.current)!=null?r:le,$e=S?(i=yt.rect)!=null?i:Ce:null,zt=!!(yt.nodeRef.current&&yt.rect),kn=uw(zt?null:Ce),Q=Sh(ye?He(ye):null),Ze=dw(S?zn??le:null),Jt=mw(Ze),Qt=Nh(p,{transform:{x:O.x-kn.x,y:O.y-kn.y,scaleX:1,scaleY:1},activatorEvent:_,active:R,activeNodeRect:Ce,containerNodeRect:Nt,draggingNodeRect:$e,over:xt.current.over,overlayNodeRect:yt.rect,scrollableAncestors:Ze,scrollableAncestorRects:Jt,windowRect:Q}),Sn=mt?nr(mt,O):null,Cn=fw(Ze),Sr=Ac(Cn),I=Ac(Cn,[Ce]),$=nr(Qt,Sr),q=$e?Iv($e,Qt):null,Z=R&&q?f({active:R,collisionRect:q,droppableRects:k,droppableContainers:B,pointerCoordinates:Sn}):null,ae=Av(Z,"id"),[ve,ot]=m.useState(null),Ke=zt?Qt:nr(Qt,I),Vt=Mv(Ke,(s=ve==null?void 0:ve.rect)!=null?s:null,Ce),bt=m.useRef(null),Re=m.useCallback((De,Le)=>{let{sensor:je,options:Pt}=Le;if(L.current==null)return;const Ye=T.get(L.current);if(!Ye)return;const Ue=De.nativeEvent,at=new je({active:L.current,activeNode:Ye,event:Ue,options:Pt,context:xt,onAbort(Te){if(!T.get(Te))return;const{onDragAbort:et}=U.current,lt={id:Te};et==null||et(lt),v({type:"onDragAbort",event:lt})},onPending(Te,At,et,lt){if(!T.get(Te))return;const{onDragPending:en}=U.current,vt={id:Te,constraint:At,initialCoordinates:et,offset:lt};en==null||en(vt),v({type:"onDragPending",event:vt})},onStart(Te){const At=L.current;if(At==null)return;const et=T.get(At);if(!et)return;const{onDragStart:lt}=U.current,Zt={activatorEvent:Ue,active:{id:At,data:et.data,rect:D}};Yn.unstable_batchedUpdates(()=>{lt==null||lt(Zt),j(cn.Initializing),y({type:Ae.DragStart,initialCoordinates:Te,active:At}),v({type:"onDragStart",event:Zt}),F(bt.current),H(Ue)})},onMove(Te){y({type:Ae.DragMove,coordinates:Te})},onEnd:$t(Ae.DragEnd),onCancel:$t(Ae.DragCancel)});bt.current=at;function $t(Te){return async function(){const{active:et,collisions:lt,over:Zt,scrollAdjustedTranslate:en}=xt.current;let vt=null;if(et&&en){const{cancelDrop:tn}=U.current;vt={activatorEvent:Ue,active:et,collisions:lt,delta:en,over:Zt},Te===Ae.DragEnd&&typeof tn=="function"&&await Promise.resolve(tn(vt))&&(Te=Ae.DragCancel)}L.current=null,Yn.unstable_batchedUpdates(()=>{y({type:Te}),j(cn.Uninitialized),ot(null),F(null),H(null),bt.current=null;const tn=Te===Ae.DragEnd?"onDragEnd":"onDragCancel";if(vt){const Vn=U.current[tn];Vn==null||Vn(vt),v({type:tn,event:vt})}})}}},[T]),Tt=m.useCallback((De,Le)=>(je,Pt)=>{const Ye=je.nativeEvent,Ue=T.get(Pt);if(L.current!==null||!Ue||Ye.dndKit||Ye.defaultPrevented)return;const at={active:Ue};De(je,Le.options,at)===!0&&(Ye.dndKit={capturedBy:Le.sensor},L.current=Pt,Re(je,Le))},[T,Re]),Ge=sw(u,Tt);hw(u),qt(()=>{Ce&&N===cn.Initializing&&j(cn.Initialized)},[Ce,N]),m.useEffect(()=>{const{onDragMove:De}=U.current,{active:Le,activatorEvent:je,collisions:Pt,over:Ye}=xt.current;if(!Le||!je)return;const Ue={active:Le,activatorEvent:je,collisions:Pt,delta:{x:$.x,y:$.y},over:Ye};Yn.unstable_batchedUpdates(()=>{De==null||De(Ue),v({type:"onDragMove",event:Ue})})},[$.x,$.y]),m.useEffect(()=>{const{active:De,activatorEvent:Le,collisions:je,droppableContainers:Pt,scrollAdjustedTranslate:Ye}=xt.current;if(!De||L.current==null||!Le||!Ye)return;const{onDragOver:Ue}=U.current,at=Pt.get(ae),$t=at&&at.rect.current?{id:at.id,rect:at.rect.current,data:at.data,disabled:at.disabled}:null,Te={active:De,activatorEvent:Le,collisions:je,delta:{x:Ye.x,y:Ye.y},over:$t};Yn.unstable_batchedUpdates(()=>{ot($t),Ue==null||Ue(Te),v({type:"onDragOver",event:Te})})},[ae]),qt(()=>{xt.current={activatorEvent:_,active:R,activeNode:le,collisionRect:q,collisions:Z,droppableRects:k,draggableNodes:T,draggingNode:ye,draggingNodeRect:$e,droppableContainers:E,over:ve,scrollableAncestors:Ze,scrollAdjustedTranslate:$},D.current={initial:$e,translated:q}},[R,le,Z,q,T,ye,$e,k,E,ve,Ze,$]),tw({...Qe,delta:O,draggingRect:q,pointerCoordinates:Sn,scrollableAncestors:Ze,scrollableAncestorRects:Jt});const Ls=m.useMemo(()=>({active:R,activeNode:le,activeNodeRect:Ce,activatorEvent:_,collisions:Z,containerNodeRect:Nt,dragOverlay:yt,draggableNodes:T,droppableContainers:E,droppableRects:k,over:ve,measureDroppableContainers:oe,scrollableAncestors:Ze,scrollableAncestorRects:Jt,measuringConfiguration:J,measuringScheduled:qe,windowRect:Q}),[R,le,Ce,_,Z,Nt,yt,T,E,k,ve,oe,Ze,Jt,J,qe,Q]),Fs=m.useMemo(()=>({activatorEvent:_,activators:Ge,active:R,activeNodeRect:Ce,ariaDescribedById:{draggable:C},dispatch:y,draggableNodes:T,over:ve,measureDroppableContainers:oe}),[_,Ge,R,Ce,y,C,T,ve,oe]);return ke.createElement(dh.Provider,{value:w},ke.createElement(di.Provider,{value:Fs},ke.createElement(Eh.Provider,{value:Ls},ke.createElement(Ss.Provider,{value:Vt},c)),ke.createElement(kw,{disabled:(a==null?void 0:a.restoreFocus)===!1})),ke.createElement(Ev,{...a,hiddenTextDescribedById:C}));function Bs(){const De=(P==null?void 0:P.autoScrollEnabled)===!1,Le=typeof l=="object"?l.enabled===!1:l===!1,je=S&&!De&&!Le;return typeof l=="object"?{...l,enabled:je}:{enabled:je}}}),Ew=m.createContext(null),Rc="button",Nw="Draggable";function Th(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=ws(Nw),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=m.useContext(di),{role:p=Rc,roleDescription:g="draggable",tabIndex:x=0}=i??{},b=(l==null?void 0:l.id)===t,y=m.useContext(b?Ss:Ew),[v,w]=qi(),[N,j]=qi(),S=pw(o,t),A=Jr(n);qt(()=>(f.set(t,{id:t,key:s,node:v,activatorNode:N,data:A}),()=>{const O=f.get(t);O&&O.key===s&&f.delete(t)}),[f,t]);const T=m.useMemo(()=>({role:p,tabIndex:x,"aria-disabled":r,"aria-pressed":b&&p===Rc?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,p,x,b,g,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:b,listeners:r?void 0:S,node:v,over:h,setNodeRef:w,setActivatorNodeRef:j,transform:y}}function Tw(){return m.useContext(Eh)}const Pw="Droppable",Aw={timeout:25};function Ka(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=ws(Pw),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=m.useContext(di),u=m.useRef({disabled:n}),f=m.useRef(!1),h=m.useRef(null),p=m.useRef(null),{disabled:g,updateMeasurementsFor:x,timeout:b}={...Aw,...i},y=Jr(x??r),v=m.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),p.current=null},b)},[b]),w=ks({callback:v,disabled:g||!o}),N=m.useCallback((T,O)=>{w&&(O&&(w.unobserve(O),f.current=!1),T&&w.observe(T))},[w]),[j,S]=qi(N),A=Jr(t);return m.useEffect(()=>{!w||!j.current||(w.disconnect(),f.current=!1,w.observe(j.current))},[j,w]),m.useEffect(()=>(a({type:Ae.RegisterDroppable,element:{id:r,key:s,disabled:n,node:j,rect:h,data:A}}),()=>a({type:Ae.UnregisterDroppable,key:s,id:r})),[r]),m.useEffect(()=>{n!==u.current.disabled&&(a({type:Ae.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:j,over:l,setNodeRef:S}}function _w(e){let{animation:t,children:n}=e;const[r,i]=m.useState(null),[s,o]=m.useState(null),a=Ki(n);return!n&&!r&&a&&i(a),qt(()=>{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]),ke.createElement(ke.Fragment,null,n,r?m.cloneElement(r,{ref:o}):null)}const Rw={x:0,y:0,scaleX:1,scaleY:1};function Dw(e){let{children:t}=e;return ke.createElement(di.Provider,{value:jh},ke.createElement(Ss.Provider,{value:Rw},t))}const Mw={position:"fixed",touchAction:"none"},Ow=e=>Fa(e)?"transform 250ms ease":void 0,Iw=m.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:o,rect:a,style:l,transform:c,transition:u=Ow}=e;if(!a)return null;const f=i?c:{...c,scaleX:1,scaleY:1},h={...Mw,width:a.width,height:a.height,top:a.top,left:a.left,transform:Dn.Transform.toString(f),transformOrigin:i&&r?Tv(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return ke.createElement(n,{className:o,style:h,ref:t},s)}),Lw=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)}},Fw=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Dn.Transform.toString(t)},{transform:Dn.Transform.toString(n)}]},Bw={duration:250,easing:"ease",keyframes:Fw,sideEffects:Lw({styles:{active:{opacity:"0"}}})};function zw(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return vs((s,o)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const c=Ch(o);if(!c)return;const{transform:u}=He(o).getComputedStyle(o),f=ph(u);if(!f)return;const h=typeof t=="function"?t:Vw(t);return wh(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 Vw(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...Bw,...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,x=p[p.length-1];if(JSON.stringify(g)===JSON.stringify(x))return;const b=r==null?void 0:r({active:o,dragOverlay:a,...c}),y=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(v=>{y.onfinish=()=>{b==null||b(),v()}})}}let Dc=0;function $w(e){return m.useMemo(()=>{if(e!=null)return Dc++,Dc},[e])}const Uw=ke.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:x,dragOverlay:b,over:y,measuringConfiguration:v,scrollableAncestors:w,scrollableAncestorRects:N,windowRect:j}=Tw(),S=m.useContext(Ss),A=$w(f==null?void 0:f.id),T=Nh(o,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:N,transform:S,windowRect:j}),O=qa(h),E=zw({config:r,draggableNodes:g,droppableContainers:x,measuringConfiguration:v}),M=O?b.setRef:void 0;return ke.createElement(Dw,null,ke.createElement(_w,{animation:E},f&&A?ke.createElement(Iw,{key:A,id:f.id,ref:M,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:O,style:{zIndex:c,...i},transform:T},n):null))}),Ww="cc-card-display",Hw={effort:!0,category:!0,priority:!0,tags:!0,project:!0};function qw(){const[e,t]=_n(Ww,Hw),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 Ga=["critical","high","medium","low"],Ya=["feature","bugfix","refactor","infrastructure","docs"],Cs=["<1H","1-4H","4H+","TBD"],Ph=["has-blockers","blocks-others","no-deps"],Ah=[{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 Kw(e){return Object.fromEntries(Ah.map(n=>[n.id,n.emoji]))}function Gw(e){return Object.fromEntries(Ah.map(n=>[n.id,n.color]))}const OM=Kw(),IM=Gw();function Yw(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 Xw(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 Xa(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[Yw(e.effort_estimate)];case"dependencies":return Xw(e);case"project":return e.project_id?[e.project_id]:[]}}function Jw(e,t,n){return n.size===0?!0:Xa(e,t).some(i=>n.has(i))}function Mc(){return{priority:new Set,category:new Set,tags:new Set,effort:new Set,dependencies:new Set}}function Qw(e){const[t,n]=m.useState(Mc),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(Mc())},[]),o=m.useMemo(()=>Object.values(t).some(c=>c.size>0),[t]),a=m.useMemo(()=>o?e.filter(c=>Object.keys(t).every(u=>Jw(c,u,t[u]))):e,[e,t,o]),l=m.useMemo(()=>{const c=new Set;for(const y of e)for(const v of y.tags)c.add(v);const u=[...c].sort();function f(y,v){return e.filter(w=>Xa(w,y).includes(v)).length}const h=Ga.map(y=>({value:y,label:y,count:f("priority",y)})),p=Ya.map(y=>({value:y,label:y,count:f("category",y)})),g=u.map(y=>({value:y,label:y,count:f("tags",y)})),x=Cs.map(y=>({value:y,label:y,count:f("effort",y)})),b=Ph.map(y=>({value:y,label:y==="has-blockers"?"Has blockers":y==="blocks-others"?"Blocks others":"No dependencies",count:f("dependencies",y)}));return{priority:h,category:p,tags:g,effort:x,dependencies:b}},[e]);return{filters:t,toggleFilter:r,clearField:i,clearAll:s,hasActiveFilters:o,filteredScopes:a,optionsWithCounts:l}}const Zw="cc-board-sort",e1="cc-board-collapsed",_h={id:"asc",priority:"asc",effort:"asc",updated_at:"desc",created_at:"desc",title:"asc"},Oc={critical:0,high:1,medium:2,low:3};function Ic(e){if(!e)return 1/0;const t=Cs.indexOf(e);return t>=0?t:1/0}const t1={field:"id",direction:"asc"},n1={deserialize:e=>{const t=JSON.parse(e);if(t.field in _h)return{field:t.field,direction:t.direction==="desc"?"desc":"asc"}}};function qo(e,t,n){return[...e].sort((i,s)=>{const o=r1(i,s,t);return n==="desc"?-o:o})}function r1(e,t,n){switch(n){case"id":return e.id-t.id;case"priority":{const r=e.priority?Oc[e.priority]??1/0:1/0,i=t.priority?Oc[t.priority]??1/0:1/0;return r-i}case"effort":return Ic(e.effort_estimate)-Ic(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 i1(){const[e,t]=_n(Zw,t1,n1),[n,r]=_n(e1,new Set,Lf),i=m.useCallback(o=>{t(a=>{const l=a.field===o?a.direction==="asc"?"desc":"asc":_h[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 s1="cc-view-mode",o1="cc-swim-group",a1="cc-swim-collapsed",l1={serialize:e=>e,deserialize:e=>e==="kanban"||e==="swimlane"?e:void 0},c1={serialize:e=>e,deserialize:e=>e==="priority"||e==="category"||e==="tags"||e==="effort"||e==="dependencies"?e:void 0};function u1(){const[e,t]=_n(s1,"kanban",l1),[n,r]=_n(o1,"priority",c1),[i,s]=_n(a1,new Set,Lf),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 d1(){const{settings:e}=Ma();return m.useMemo(()=>e.fontScale===1?[]:[({transform:n})=>({...n,x:n.x/e.fontScale,y:n.y/e.fontScale})],[e.fontScale])}function f1(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 h1=[{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 or{constructor(t){tt(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,f1(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 p1(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 m1(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 Qs(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}}function g1({scopes:e,sprints:t,onAddToSprint:n,isPhaseView:r,projectEngines:i}){const{engine:s}=Gt(),o=Lt(),{getApiBase:a,hasMultipleProjects:l}=gn(),c=m.useCallback((P,F)=>l&&P.project_id?`${a(P.project_id)}${F}`:o(F),[o,a,l]),u=m.useCallback(async(P,F)=>{const _=C=>c(P,C),H=F.command!=null?await m1(_,P.id):!1,U=F.confirmLevel==="full";h(C=>({...C,pending:{scope:P,transition:F,hasActiveSession:H},showModal:U,showPopover:!U,error:null}))},[c]),[f,h]=m.useState({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}),p=m.useRef(null),g=m.useRef(null);m.useEffect(()=>{p.current=f.activeScope,g.current=f.activeSprint},[f.activeScope,f.activeSprint]);const x=m.useCallback(P=>{const F=Qs(P.active.id);if(F){if(F.type==="scope"){const _=e.find(H=>H.id===F.scopeId&&(!F.projectId||H.project_id===F.projectId));_&&h(H=>({...H,activeScope:_,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,error:null}))}else if(F.type==="sprint"){const _=t.find(H=>H.id===F.sprintId);_&&h(H=>({...H,activeScope:null,activeSprint:_,overId:null,overIsValid:!1,overSprintId:null,error:null}))}}},[e,t]),b=m.useCallback(P=>{var C;const F=(C=P.over)==null?void 0:C.id;if(!F){h(B=>({...B,overId:null,overIsValid:!1,overSprintId:null}));return}const _=Qs(F);if(!_)return;const H=g.current,U=p.current;if(H){_.type==="column"&&_.status==="implementing"?h(B=>({...B,overId:"implementing",overIsValid:!0,overSprintId:null})):h(B=>({...B,overId:null,overIsValid:!1,overSprintId:null}));return}if(U)if(_.type==="sprint-drop"){const B=t.find(k=>k.id===_.sprintId),J=(B==null?void 0:B.status)==="assembling"&&U.status===B.target_column;h(k=>({...k,overId:null,overIsValid:!!J,overSprintId:_.sprintId}))}else if(_.type==="column"){let B;if(r&&U.project_id&&i){const J=i.get(U.project_id);J?B=new or(J).resolveNormalizedTransition(U.status,_.status).length>0:B=!1}else B=s.isValidTransition(U.status,_.status);h(J=>({...J,overId:_.status,overIsValid:B,overSprintId:null}))}else h(B=>({...B,overId:null,overIsValid:!1,overSprintId:null}))},[t,s,r,i]),y=m.useCallback(async P=>{var C;const F=(C=P.over)==null?void 0:C.id,_=p.current,H=g.current;if(h(B=>({...B,activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null})),!F)return;const U=Qs(F);if(U){if(H&&U.type==="column"&&U.status==="implementing"){h(B=>({...B,pendingSprintDispatch:H}));return}if(_&&U.type==="sprint-drop"){const B=t.find(k=>k.id===U.sprintId);if(B&&_.status!==B.target_column){h(k=>({...k,error:`Cannot add ${_.status} scope to ${B.target_column} ${B.group_type} — scope status must match ${B.group_type} column`}));return}const J=await n(U.sprintId,[_.id]);J&&J.unmet_dependencies.length>0&&h(k=>({...k,pendingUnmetDeps:J.unmet_dependencies,pendingDepSprintId:U.sprintId}));return}if(_&&U.type==="column"){if(_.status===U.status)return;let B;if(r&&_.project_id&&i){const J=i.get(_.project_id);if(J){const oe=new or(J).resolveNormalizedTransition(_.status,U.status);if(oe.length>1){h(qe=>({...qe,pendingDisambiguation:{scope:_,edges:oe}}));return}B=oe[0]}}else B=s.findEdge(_.status,U.status);if(!B)return;await u(_,B)}}},[n,s,t,u,r,i]),v=m.useCallback(async()=>{const{pending:P}=f;if(!P)return;h(B=>({...B,dispatching:!0,error:null}));const{scope:F,transition:_}=P,H=r&&F.project_id&&(i==null?void 0:i.get(F.project_id))||s,U=H.buildCommand(_,F.id),C=B=>c(F,B);try{const B=H.getEntryPoint().id;if(F.status===B&&_.direction==="forward"&&F.slug){const k=await fetch(C(`/ideas/${F.slug}/promote`),{method:"POST"});if(!k.ok){const oe=await k.json().catch(()=>({error:"Request failed"}));throw new Error(oe.error??`HTTP ${k.status}`)}}else if(U){const k=await fetch(C("/dispatch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_id:F.id,command:U,transition:_.skipServerTransition?void 0:{from:_.from,to:_.to}})});if(!k.ok){const oe=await k.json().catch(()=>({error:"Request failed"}));throw new Error(oe.error??`HTTP ${k.status}`)}}else{const k=await fetch(C(`/scopes/${F.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:_.to})});if(!k.ok){const oe=await k.json().catch(()=>({error:"Request failed"}));throw new Error(oe.error??`Failed to update scope status: HTTP ${k.status}`)}}h(k=>({...k,pending:null,showModal:!1,showPopover:!1,dispatching:!1}))}catch(B){h(J=>({...J,dispatching:!1,error:B instanceof Error?B.message:"Dispatch failed"}))}},[f,s,c,r,i]),w=m.useCallback(async P=>{const F=f.pendingDisambiguation;F&&(h(_=>({..._,pendingDisambiguation:null})),await u(F.scope,P))},[f.pendingDisambiguation,u]),N=m.useCallback(()=>{h(P=>({...P,pendingDisambiguation:null}))},[]),j=m.useCallback(()=>{h(P=>({...P,pending:null,showModal:!1,showPopover:!1,dispatching:!1,error:null}))},[]),S=m.useCallback(()=>{h(P=>({...P,error:null}))},[]),A=m.useCallback(()=>{h(P=>({...P,showPopover:!1,showModal:!0}))},[]),T=m.useCallback(()=>{h(P=>({...P,showIdeaForm:!0}))},[]),O=m.useCallback(()=>{h(P=>({...P,showIdeaForm:!1}))},[]),E=m.useCallback(async(P,F)=>{h(_=>({..._,dispatching:!0,error:null}));try{const _=await fetch(o("/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:P,description:F})});if(!_.ok){const H=await _.json().catch(()=>({error:"Request failed"}));throw new Error(H.error??`HTTP ${_.status}`)}h(H=>({...H,dispatching:!1,showIdeaForm:!1}))}catch(_){h(H=>({...H,dispatching:!1,error:_ instanceof Error?_.message:"Failed to create idea"}))}},[o]),M=m.useCallback(()=>{h(P=>({...P,pendingSprintDispatch:null}))},[]),D=m.useCallback(()=>{h(P=>({...P,pendingUnmetDeps:null,pendingDepSprintId:null}))},[]),R=m.useCallback(async P=>{f.pendingDepSprintId!=null&&await n(f.pendingDepSprintId,P),h(F=>({...F,pendingUnmetDeps:null,pendingDepSprintId:null}))},[f.pendingDepSprintId,n]),L=m.useCallback((P,F)=>{h(_=>({..._,pendingUnmetDeps:F,pendingDepSprintId:P}))},[]);return{state:f,onDragStart:x,onDragOver:b,onDragEnd:y,confirmTransition:v,cancelTransition:j,dismissError:S,openModalFromPopover:A,openIdeaForm:T,closeIdeaForm:O,submitIdea:E,dismissSprintDispatch:M,dismissUnmetDeps:D,resolveUnmetDeps:R,showUnmetDeps:L,selectDisambiguation:w,dismissDisambiguation:N}}function x1(){const e=Lt(),[t,n]=m.useState([]),[r,i]=m.useState(!0),s=m.useCallback(async g=>{try{const x=await fetch(e("/sprints"),{signal:g});if(!x.ok)return;n(await x.json())}catch(x){if(x instanceof DOMException&&x.name==="AbortError")return;console.warn("[Orbital] Failed to fetch sprints:",x)}finally{g!=null&&g.aborted||i(!1)}},[e]);m.useEffect(()=>{const g=new AbortController;return s(g.signal),()=>g.abort()},[s]),gs(s),m.useEffect(()=>{function g(v){n(w=>[v,...w])}function x(v){n(w=>{const N=w.findIndex(j=>j.id===v.id);if(N>=0){const j=[...w];return j[N]=v,j}return[v,...w]})}function b({id:v}){n(w=>w.filter(N=>N.id!==v))}function y(v){n(w=>{const N=w.findIndex(j=>j.id===v.id);if(N>=0){const j=[...w];return j[N]=v,j}return w})}return K.on("sprint:created",g),K.on("sprint:updated",x),K.on("sprint:deleted",b),K.on("sprint:completed",y),()=>{K.off("sprint:created",g),K.off("sprint:updated",x),K.off("sprint:deleted",b),K.off("sprint:completed",y)}},[]);const o=m.useCallback(async(g,x)=>{const b=await fetch(e("/sprints"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:g,...x})});return b.ok?b.json():null},[e]),a=m.useCallback(async(g,x)=>(await fetch(e(`/sprints/${g}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x})})).ok,[e]),l=m.useCallback(async g=>(await fetch(e(`/sprints/${g}`),{method:"DELETE"})).ok,[e]),c=m.useCallback(async(g,x)=>{const b=await fetch(e(`/sprints/${g}/scopes`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:x})});return b.ok?b.json():null},[e]),u=m.useCallback(async(g,x)=>(await fetch(e(`/sprints/${g}/scopes`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:x})})).ok,[e]),f=m.useCallback(async g=>(await fetch(e(`/sprints/${g}/dispatch`),{method:"POST"})).json(),[e]),h=m.useCallback(async g=>(await fetch(e(`/sprints/${g}/cancel`),{method:"POST"})).ok,[e]),p=m.useCallback(async g=>{const x=await fetch(e(`/sprints/${g}/graph`));return x.ok?x.json():null},[e]);return{sprints:t,loading:r,refetch:s,createSprint:o,renameSprint:a,deleteSprint:l,addScopes:c,removeScopes:u,dispatchSprint:f,cancelSprint:h,getGraph:p}}function y1(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 b1(e,t){const n=Lt(),[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(async l=>{try{const c=await fetch(n(`/ideas/${l}`),{method:"DELETE"});if(!c.ok)throw new Error(`HTTP ${c.status}`);t(null)}catch(c){console.error("[Orbital] Failed to reject idea:",c)}},[t,n]);return{surpriseLoading:r,handleSurprise:s,handleApproveGhost:o,handleRejectGhost:a}}function v1(e){return(e.split("/").pop()??"").replace(/\.md$/,"").toLowerCase()}function Lc(e,t){var r,i,s;const n=t.toLowerCase().trim();return!!(!n||e.title.toLowerCase().includes(n)||String(e.id).startsWith(n)||v1(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 w1(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=>Lc(g,s));return{displayScopes:p,dimmedIds:new Set,matchCount:p.length}}const f=new Set;let h=0;for(const p of e)Lc(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 k1(){const[e,t]=ff(),n=e.get("highlight")??null,r=m.useCallback(()=>{t(i=>(i.delete("highlight"),i),{replace:!0})},[t]);return{highlightedScopeKey:n,clearHighlight:r}}const Ja=m.createContext({});function Qa(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const js=m.createContext(null),Za=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class S1 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 C1({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(Za);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
|
-
[data-motion-pop-id="${n}"] {
|
|
304
|
-
position: absolute !important;
|
|
305
|
-
width: ${o}px !important;
|
|
306
|
-
height: ${a}px !important;
|
|
307
|
-
top: ${l}px !important;
|
|
308
|
-
left: ${c}px !important;
|
|
309
|
-
}
|
|
310
|
-
`),()=>{document.head.removeChild(u)}},[t]),d.jsx(S1,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const j1=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=Qa(E1),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(C1,{isPresent:n,children:e})),d.jsx(js.Provider,{value:u,children:e})};function E1(){return new Map}function Rh(e=!0){const t=m.useContext(js);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 Ci=e=>e.key||"";function Fc(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const el=typeof window<"u",Dh=el?m.useLayoutEffect:m.useEffect,Qi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1})=>{const[a,l]=Rh(o),c=m.useMemo(()=>Fc(e),[e]),u=o&&!a?[]:c.map(Ci),f=m.useRef(!0),h=m.useRef(c),p=Qa(()=>new Map),[g,x]=m.useState(c),[b,y]=m.useState(c);Dh(()=>{f.current=!1,h.current=c;for(let N=0;N<b.length;N++){const j=Ci(b[N]);u.includes(j)?p.delete(j):p.get(j)!==!0&&p.set(j,!1)}},[b,u.length,u.join("-")]);const v=[];if(c!==g){let N=[...c];for(let j=0;j<b.length;j++){const S=b[j],A=Ci(S);u.includes(A)||(N.splice(j,0,S),v.push(S))}s==="wait"&&v.length&&(N=v),y(Fc(N)),x(c);return}const{forceRender:w}=m.useContext(Ja);return d.jsx(d.Fragment,{children:b.map(N=>{const j=Ci(N),S=o&&!a?!1:c===b||u.includes(j),A=()=>{if(p.has(j))p.set(j,!0);else return;let T=!0;p.forEach(O=>{O||(T=!1)}),T&&(w==null||w(),y(h.current),o&&(l==null||l()),r&&r())};return d.jsx(j1,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:A,children:N},j)})})},rt=e=>e;let Mh=rt;function tl(e){let t;return()=>(t===void 0&&(t=e()),t)}const ar=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Wt=e=>e*1e3,Ht=e=>e/1e3,N1={useManualTiming:!1};function T1(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 ji=["read","resolveKeyframes","update","preRender","render","postRender"],P1=40;function Oh(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=ji.reduce((y,v)=>(y[v]=T1(s),y),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,p=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,P1),1),i.timestamp=y,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:ji.reduce((y,v)=>{const w=o[v];return y[v]=(N,j=!1,S=!1)=>(n||g(),w.schedule(N,j,S)),y},{}),cancel:y=>{for(let v=0;v<ji.length;v++)o[ji[v]].cancel(y)},state:i,steps:o}}const{schedule:xe,cancel:hn,state:Ie,steps:Zs}=Oh(typeof requestAnimationFrame<"u"?requestAnimationFrame:rt,!0),Ih=m.createContext({strict:!1}),Bc={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"]},lr={};for(const e in Bc)lr[e]={isEnabled:t=>Bc[e].some(n=>!!t[n])};function A1(e){for(const t in e)lr[t]={...lr[t],...e[t]}}const _1=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 Zi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||_1.has(e)}let Lh=e=>!Zi(e);function R1(e){e&&(Lh=t=>t.startsWith("on")?!Zi(t):e(t))}try{R1(require("@emotion/is-prop-valid").default)}catch{}function D1(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Lh(i)||n===!0&&Zi(i)||!t&&!Zi(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function M1(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 Es=m.createContext({});function Zr(e){return typeof e=="string"||Array.isArray(e)}function Ns(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const nl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rl=["initial",...nl];function Ts(e){return Ns(e.animate)||rl.some(t=>Zr(e[t]))}function Fh(e){return!!(Ts(e)||e.variants)}function O1(e,t){if(Ts(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Zr(n)?n:void 0,animate:Zr(r)?r:void 0}}return e.inherit!==!1?t:{}}function I1(e){const{initial:t,animate:n}=O1(e,m.useContext(Es));return m.useMemo(()=>({initial:t,animate:n}),[zc(t),zc(n)])}function zc(e){return Array.isArray(e)?e.join(" "):e}const L1=Symbol.for("motionComponentSymbol");function Xn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function F1(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):Xn(n)&&(n.current=r))},[t])}const il=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),B1="framerAppearId",Bh="data-"+il(B1),{schedule:sl}=Oh(queueMicrotask,!1),zh=m.createContext({});function z1(e,t,n,r,i){var s,o;const{visualElement:a}=m.useContext(Es),l=m.useContext(Ih),c=m.useContext(js),u=m.useContext(Za).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(zh);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&V1(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,c)});const x=n[Bh],b=m.useRef(!!x&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,x))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,x)));return Dh(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),sl.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,x)}),b.current=!1))}),h}function V1(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:Vh(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Xn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Vh(e){if(e)return e.options.allowProjection!==!1?e.projection:Vh(e.parent)}function $1({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&A1(e);function a(c,u){let f;const h={...m.useContext(Za),...c,layoutId:U1(c)},{isStatic:p}=h,g=I1(c),x=r(c,p);if(!p&&el){W1();const b=H1(h);f=b.MeasureLayout,g.visualElement=z1(i,x,h,t,b.ProjectionNode)}return d.jsxs(Es.Provider,{value:g,children:[f&&g.visualElement?d.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,c,F1(x,g.visualElement,u),x,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[L1]=i,l}function U1({layoutId:e}){const t=m.useContext(Ja).id;return t&&e!==void 0?t+"-"+e:e}function W1(e,t){m.useContext(Ih).strict}function H1(e){const{drag:t,layout:n}=lr;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 q1=["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 ol(e){return typeof e!="string"||e.includes("-")?!1:!!(q1.indexOf(e)>-1||/[A-Z]/u.test(e))}function Vc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function al(e,t,n,r){if(typeof t=="function"){const[i,s]=Vc(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]=Vc(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const Ko=e=>Array.isArray(e),K1=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),G1=e=>Ko(e)?e[e.length-1]||0:e,Be=e=>!!(e&&e.getVelocity);function zi(e){const t=Be(e)?e.get():e;return K1(t)?t.toValue():t}function Y1({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:X1(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const $h=e=>(t,n)=>{const r=m.useContext(Es),i=m.useContext(js),s=()=>Y1(e,t,r,i);return n?s():Qa(s)};function X1(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=zi(s[h]);let{initial:o,animate:a}=e;const l=Ts(e),c=Fh(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"&&!Ns(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=al(e,h[p]);if(g){const{transitionEnd:x,transition:b,...y}=g;for(const v in y){let w=y[v];if(Array.isArray(w)){const N=u?w.length-1:0;w=w[N]}w!==null&&(i[v]=w)}for(const v in x)i[v]=x[v]}}}return i}const yr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ln=new Set(yr),Uh=e=>t=>typeof t=="string"&&t.startsWith(e),Wh=Uh("--"),J1=Uh("var(--"),ll=e=>J1(e)?Q1.test(e.split("/*")[0].trim()):!1,Q1=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Hh=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Kt=(e,t,n)=>n>t?t:n<e?e:n,br={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ei={...br,transform:e=>Kt(0,1,e)},Ei={...br,default:1},fi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ln=fi("deg"),Mt=fi("%"),Y=fi("px"),Z1=fi("vh"),ek=fi("vw"),$c={...Mt,parse:e=>Mt.parse(e)/100,transform:e=>Mt.transform(e*100)},tk={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,radius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,backgroundPositionX:Y,backgroundPositionY:Y},nk={rotate:ln,rotateX:ln,rotateY:ln,rotateZ:ln,scale:Ei,scaleX:Ei,scaleY:Ei,scaleZ:Ei,skew:ln,skewX:ln,skewY:ln,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:ei,originX:$c,originY:$c,originZ:Y},Uc={...br,transform:Math.round},cl={...tk,...nk,zIndex:Uc,size:Y,fillOpacity:ei,strokeOpacity:ei,numOctaves:Uc},rk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ik=yr.length;function sk(e,t,n){let r="",i=!0;for(let s=0;s<ik;s++){const o=yr[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=Hh(a,cl[o]);if(!l){i=!1;const u=rk[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function ul(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(Ln.has(l)){o=!0;continue}else if(Wh(l)){i[l]=c;continue}else{const u=Hh(c,cl[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=sk(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 ok={offset:"stroke-dashoffset",array:"stroke-dasharray"},ak={offset:"strokeDashoffset",array:"strokeDasharray"};function lk(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?ok:ak;e[s.offset]=Y.transform(-r);const o=Y.transform(t),a=Y.transform(n);e[s.array]=`${o} ${a}`}function Wc(e,t,n){return typeof e=="string"?e:Y.transform(t+n*e)}function ck(e,t,n){const r=Wc(t,e.x,e.width),i=Wc(n,e.y,e.height);return`${r} ${i}`}function dl(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(ul(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=ck(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&&lk(h,o,a,l,!1)}const fl=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),qh=()=>({...fl(),attrs:{}}),hl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Kh(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 Gh=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 Yh(e,t,n,r){Kh(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Gh.has(i)?i:il(i),t.attrs[i])}const es={};function uk(e){Object.assign(es,e)}function Xh(e,{layout:t,layoutId:n}){return Ln.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!es[e]||e==="opacity")}function pl(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(Be(i[o])||t.style&&Be(t.style[o])||Xh(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 Jh(e,t,n){const r=pl(e,t,n);for(const i in e)if(Be(e[i])||Be(t[i])){const s=yr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function dk(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 Hc=["x","y","width","height","cx","cy","r"],fk={useVisualState:$h({scrapeMotionValuesFromProps:Jh,createRenderState:qh,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(Ln.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<Hc.length;a++){const l=Hc[a];e[l]!==t[l]&&(o=!0)}o&&xe.read(()=>{dk(n,r),xe.render(()=>{dl(r,i,hl(n.tagName),e.transformTemplate),Yh(n,r)})})}})},hk={useVisualState:$h({scrapeMotionValuesFromProps:pl,createRenderState:fl})};function Qh(e,t,n){for(const r in t)!Be(t[r])&&!Xh(r,n)&&(e[r]=t[r])}function pk({transformTemplate:e},t){return m.useMemo(()=>{const n=fl();return ul(n,t,e),Object.assign({},n.vars,n.style)},[t])}function mk(e,t){const n=e.style||{},r={};return Qh(r,n,e),Object.assign(r,pk(e,t)),r}function gk(e,t){const n={},r=mk(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 xk(e,t,n,r){const i=m.useMemo(()=>{const s=qh();return dl(s,t,hl(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Qh(s,e.style,e),i.style={...s,...i.style}}return i}function yk(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(ol(n)?xk:gk)(r,s,o,n),c=D1(r,typeof n=="string",e),u=n!==m.Fragment?{...c,...l,ref:i}:{},{children:f}=r,h=m.useMemo(()=>Be(f)?f.get():f,[f]);return m.createElement(n,{...u,children:h})}}function bk(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...ol(r)?fk:hk,preloadedFeatures:e,useRender:yk(i),createVisualElement:t,Component:r};return $1(o)}}function Zh(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 Ps(e,t,n){const r=e.getProps();return al(r,t,n!==void 0?n:r.custom,e)}const vk=tl(()=>window.ScrollTimeline!==void 0);class wk{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(vk()&&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 kk extends wk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function ml(e,t){return e?e[t]||e.default||e:void 0}const Go=2e4;function ep(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Go;)t+=n,r=e.next(t);return t>=Go?1/0:t}function gl(e){return typeof e=="function"}function qc(e,t){e.timeline=t,e.onfinish=null}const xl=e=>Array.isArray(e)&&typeof e[0]=="number",Sk={linearEasing:void 0};function Ck(e,t){const n=tl(e);return()=>{var r;return(r=Sk[t])!==null&&r!==void 0?r:n()}}const ts=Ck(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),tp=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(ar(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function np(e){return!!(typeof e=="function"&&ts()||!e||typeof e=="string"&&(e in Yo||ts())||xl(e)||Array.isArray(e)&&e.every(np))}const Ir=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ir([0,.65,.55,1]),circOut:Ir([.55,0,1,.45]),backIn:Ir([.31,.01,.66,-.59]),backOut:Ir([.33,1.53,.69,.99])};function rp(e,t){if(e)return typeof e=="function"&&ts()?tp(e,t):xl(e)?Ir(e):Array.isArray(e)?e.map(n=>rp(n,t)||Yo.easeOut):Yo[e]}const wt={x:!1,y:!1};function ip(){return wt.x||wt.y}function jk(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 sp(e,t){const n=jk(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Kc(e){return t=>{t.pointerType==="touch"||ip()||e(t)}}function Ek(e,t,n={}){const[r,i,s]=sp(e,n),o=Kc(a=>{const{target:l}=a,c=t(a);if(typeof c!="function"||!l)return;const u=Kc(f=>{c(f),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const op=(e,t)=>t?e===t?!0:op(e,t.parentElement):!1,yl=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Nk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Tk(e){return Nk.has(e.tagName)||e.tabIndex!==-1}const Lr=new WeakSet;function Gc(e){return t=>{t.key==="Enter"&&e(t)}}function eo(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Pk=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Gc(()=>{if(Lr.has(n))return;eo(n,"down");const i=Gc(()=>{eo(n,"up")}),s=()=>eo(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 Yc(e){return yl(e)&&!ip()}function Ak(e,t,n={}){const[r,i,s]=sp(e,n),o=a=>{const l=a.currentTarget;if(!Yc(a)||Lr.has(l))return;Lr.add(l);const c=t(a),u=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!Yc(p)||!Lr.has(l))&&(Lr.delete(l),typeof c=="function"&&c(p,{success:g}))},f=p=>{u(p,n.useGlobalTarget||op(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!Tk(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>Pk(c,i),i)}),s}function _k(e){return e==="x"||e==="y"?wt[e]?null:(wt[e]=!0,()=>{wt[e]=!1}):wt.x||wt.y?null:(wt.x=wt.y=!0,()=>{wt.x=wt.y=!1})}const ap=new Set(["width","height","top","left","right","bottom",...yr]);let Vi;function Rk(){Vi=void 0}const Ot={now:()=>(Vi===void 0&&Ot.set(Ie.isProcessing||N1.useManualTiming?Ie.timestamp:performance.now()),Vi),set:e=>{Vi=e,queueMicrotask(Rk)}};function bl(e,t){e.indexOf(t)===-1&&e.push(t)}function vl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class wl{constructor(){this.subscriptions=[]}add(t){return bl(this.subscriptions,t),()=>vl(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 lp(e,t){return t?e*(1e3/t):0}const Xc=30,Dk=e=>!isNaN(parseFloat(e));class Mk{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ot.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=Ot.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Dk(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 wl);const r=this.events[t].add(n);return t==="change"?()=>{r(),xe.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 this.current}getPrevious(){return this.prev}getVelocity(){const t=Ot.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xc)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xc);return lp(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 ti(e,t){return new Mk(e,t)}function Ok(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ti(n))}function Ik(e,t){const n=Ps(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=G1(s[o]);Ok(e,o,a)}}function Lk(e){return!!(Be(e)&&e.add)}function Xo(e,t){const n=e.getValue("willChange");if(Lk(n))return n.add(t)}function cp(e){return e.props[Bh]}const up=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Fk=1e-7,Bk=12;function zk(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=up(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>Fk&&++a<Bk);return o}function hi(e,t,n,r){if(e===t&&n===r)return rt;const i=s=>zk(s,0,1,e,n);return s=>s===0||s===1?s:up(i(s),t,r)}const dp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fp=e=>t=>1-e(1-t),hp=hi(.33,1.53,.69,.99),kl=fp(hp),pp=dp(kl),mp=e=>(e*=2)<1?.5*kl(e):.5*(2-Math.pow(2,-10*(e-1))),Sl=e=>1-Math.sin(Math.acos(e)),gp=fp(Sl),xp=dp(Sl),yp=e=>/^0[^.\s]+$/u.test(e);function Vk(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||yp(e):!0}const Ur=e=>Math.round(e*1e5)/1e5,Cl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $k(e){return e==null}const Uk=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jl=(e,t)=>n=>!!(typeof n=="string"&&Uk.test(n)&&n.startsWith(e)||t&&!$k(n)&&Object.prototype.hasOwnProperty.call(n,t)),bp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Cl);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Wk=e=>Kt(0,255,e),to={...br,transform:e=>Math.round(Wk(e))},An={test:jl("rgb","red"),parse:bp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+to.transform(e)+", "+to.transform(t)+", "+to.transform(n)+", "+Ur(ei.transform(r))+")"};function Hk(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 Jo={test:jl("#"),parse:Hk,transform:An.transform},Jn={test:jl("hsl","hue"),parse:bp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Mt.transform(Ur(t))+", "+Mt.transform(Ur(n))+", "+Ur(ei.transform(r))+")"},Fe={test:e=>An.test(e)||Jo.test(e)||Jn.test(e),parse:e=>An.test(e)?An.parse(e):Jn.test(e)?Jn.parse(e):Jo.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?An.transform(e):Jn.transform(e)},qk=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Kk(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Cl))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qk))===null||n===void 0?void 0:n.length)||0)>0}const vp="number",wp="color",Gk="var",Yk="var(",Jc="${}",Xk=/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 ni(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(Xk,l=>(Fe.test(l)?(r.color.push(s),i.push(wp),n.push(Fe.parse(l))):l.startsWith(Yk)?(r.var.push(s),i.push(Gk),n.push(l)):(r.number.push(s),i.push(vp),n.push(parseFloat(l))),++s,Jc)).split(Jc);return{values:n,split:a,indexes:r,types:i}}function kp(e){return ni(e).values}function Sp(e){const{split:t,types:n}=ni(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===vp?s+=Ur(i[o]):a===wp?s+=Fe.transform(i[o]):s+=i[o]}return s}}const Jk=e=>typeof e=="number"?0:e;function Qk(e){const t=kp(e);return Sp(e)(t.map(Jk))}const pn={test:Kk,parse:kp,createTransformer:Sp,getAnimatableNone:Qk},Zk=new Set(["brightness","contrast","saturate","opacity"]);function eS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Cl)||[];if(!r)return e;const i=n.replace(r,"");let s=Zk.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const tS=/\b([a-z-]*)\(.*?\)/gu,Qo={...pn,getAnimatableNone:e=>{const t=e.match(tS);return t?t.map(eS).join(" "):e}},nS={...cl,color:Fe,backgroundColor:Fe,outlineColor:Fe,fill:Fe,stroke:Fe,borderColor:Fe,borderTopColor:Fe,borderRightColor:Fe,borderBottomColor:Fe,borderLeftColor:Fe,filter:Qo,WebkitFilter:Qo},El=e=>nS[e];function Cp(e,t){let n=El(e);return n!==Qo&&(n=pn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const rS=new Set(["auto","none","0"]);function iS(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!rS.has(s)&&ni(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Cp(n,i)}const Qc=e=>e===br||e===Y,Zc=(e,t)=>parseFloat(e.split(", ")[t]),eu=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Zc(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?Zc(s[1],e):0}},sS=new Set(["x","y","z"]),oS=yr.filter(e=>!sS.has(e));function aS(e){const t=[];return oS.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const cr={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:eu(4,13),y:eu(5,14)};cr.translateX=cr.x;cr.translateY=cr.y;const Rn=new Set;let Zo=!1,ea=!1;function jp(){if(ea){const e=Array.from(Rn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=aS(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)})}ea=!1,Zo=!1,Rn.forEach(e=>e.complete()),Rn.clear()}function Ep(){Rn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ea=!0)})}function lS(){Ep(),jp()}class Nl{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?(Rn.add(this),Zo||(Zo=!0,xe.read(Ep),xe.resolveKeyframes(jp))):(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),Rn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Rn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Np=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),cS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uS(e){const t=cS.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Tp(e,t,n=1){const[r,i]=uS(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Np(o)?parseFloat(o):o}return ll(i)?Tp(i,t,n+1):i}const Pp=e=>t=>t.test(e),dS={test:e=>e==="auto",parse:e=>e},Ap=[br,Y,Mt,ln,ek,Z1,dS],tu=e=>Ap.find(Pp(e));class _p extends Nl{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(),ll(c))){const u=Tp(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=tu(i),a=tu(s);if(o!==a)if(Qc(o)&&Qc(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++)Vk(t[i])&&r.push(i);r.length&&iS(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=cr[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]=cr[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 nu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(pn.test(e)||e==="0")&&!e.startsWith("url("));function fS(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 hS(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=nu(i,t),a=nu(s,t);return!o||!a?!1:fS(e)||(n==="spring"||gl(n))&&r}const pS=e=>e!==null;function As(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(pS),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const mS=40;class Rp{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=Ot.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>mS?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lS(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ot.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!hS(t,r,i,s))if(o)this.options.duration=0;else{l&&l(As(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 be=(e,t,n)=>e+(t-e)*n;function no(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 gS({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=no(l,a,e+1/3),s=no(l,a,e),o=no(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function ns(e,t){return n=>n>0?t:e}const ro=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},xS=[Jo,An,Jn],yS=e=>xS.find(t=>t.test(e));function ru(e){const t=yS(e);if(!t)return!1;let n=t.parse(e);return t===Jn&&(n=gS(n)),n}const iu=(e,t)=>{const n=ru(e),r=ru(t);if(!n||!r)return ns(e,t);const i={...n};return s=>(i.red=ro(n.red,r.red,s),i.green=ro(n.green,r.green,s),i.blue=ro(n.blue,r.blue,s),i.alpha=be(n.alpha,r.alpha,s),An.transform(i))},bS=(e,t)=>n=>t(e(n)),pi=(...e)=>e.reduce(bS),ta=new Set(["none","hidden"]);function vS(e,t){return ta.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wS(e,t){return n=>be(e,t,n)}function Tl(e){return typeof e=="number"?wS:typeof e=="string"?ll(e)?ns:Fe.test(e)?iu:CS:Array.isArray(e)?Dp:typeof e=="object"?Fe.test(e)?iu:kS:ns}function Dp(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Tl(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function kS(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Tl(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function SS(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 CS=(e,t)=>{const n=pn.createTransformer(t),r=ni(e),i=ni(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?ta.has(e)&&!i.values.length||ta.has(t)&&!r.values.length?vS(e,t):pi(Dp(SS(r,i),i.values),n):ns(e,t)};function Mp(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?be(e,t,n):Tl(e)(e,t)}const jS=5;function Op(e,t,n){const r=Math.max(t-jS,0);return lp(n-e(r),t-r)}const we={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},io=.001;function ES({duration:e=we.duration,bounce:t=we.bounce,velocity:n=we.velocity,mass:r=we.mass}){let i,s,o=1-t;o=Kt(we.minDamping,we.maxDamping,o),e=Kt(we.minDuration,we.maxDuration,Ht(e)),o<1?(i=c=>{const u=c*o,f=u*e,h=u-n,p=na(c,o),g=Math.exp(-f);return io-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),x=na(Math.pow(c,2),o);return(-i(c)+io>0?-1:1)*((h-p)*g)/x}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-io+u*f},s=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=TS(i,s,a);if(e=Wt(e),isNaN(l))return{stiffness:we.stiffness,damping:we.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const NS=12;function TS(e,t,n){let r=n;for(let i=1;i<NS;i++)r=r-e(r)/t(r);return r}function na(e,t){return e*Math.sqrt(1-t*t)}const PS=["duration","bounce"],AS=["stiffness","damping","mass"];function su(e,t){return t.some(n=>e[n]!==void 0)}function _S(e){let t={velocity:we.velocity,stiffness:we.stiffness,damping:we.damping,mass:we.mass,isResolvedFromDuration:!1,...e};if(!su(e,AS)&&su(e,PS))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Kt(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:we.mass,stiffness:i,damping:s}}else{const n=ES(e);t={...t,...n,mass:we.mass},t.isResolvedFromDuration=!0}return t}function Ip(e=we.visualDuration,t=we.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}=_S({...n,velocity:-Ht(n.velocity||0)}),g=h||0,x=c/(2*Math.sqrt(l*u)),b=o-s,y=Ht(Math.sqrt(l/u)),v=Math.abs(b)<5;r||(r=v?we.restSpeed.granular:we.restSpeed.default),i||(i=v?we.restDelta.granular:we.restDelta.default);let w;if(x<1){const j=na(y,x);w=S=>{const A=Math.exp(-x*y*S);return o-A*((g+x*y*b)/j*Math.sin(j*S)+b*Math.cos(j*S))}}else if(x===1)w=j=>o-Math.exp(-y*j)*(b+(g+y*b)*j);else{const j=y*Math.sqrt(x*x-1);w=S=>{const A=Math.exp(-x*y*S),T=Math.min(j*S,300);return o-A*((g+x*y*b)*Math.sinh(T)+j*b*Math.cosh(T))/j}}const N={calculatedDuration:p&&f||null,next:j=>{const S=w(j);if(p)a.done=j>=f;else{let A=0;x<1&&(A=j===0?Wt(g):Op(w,j,S));const T=Math.abs(A)<=r,O=Math.abs(o-S)<=i;a.done=T&&O}return a.value=a.done?o:S,a},toString:()=>{const j=Math.min(ep(N),Go),S=tp(A=>N.next(j*A).value,j,30);return j+"ms "+S}};return N}function ou({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 x=n*t;const b=f+x,y=o===void 0?b:o(b);y!==b&&(x=y-f);const v=T=>-x*Math.exp(-T/r),w=T=>y+v(T),N=T=>{const O=v(T),E=w(T);h.done=Math.abs(O)<=c,h.value=h.done?y:E};let j,S;const A=T=>{p(h.value)&&(j=T,S=Ip({keyframes:[h.value,g(h.value)],velocity:Op(w,T,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return A(0),{calculatedDuration:null,next:T=>{let O=!1;return!S&&j===void 0&&(O=!0,N(T),A(T)),j!==void 0&&T>=j?S.next(T-j):(!O&&N(T),h)}}}const RS=hi(.42,0,1,1),DS=hi(0,0,.58,1),Lp=hi(.42,0,.58,1),MS=e=>Array.isArray(e)&&typeof e[0]!="number",OS={linear:rt,easeIn:RS,easeInOut:Lp,easeOut:DS,circIn:Sl,circInOut:xp,circOut:gp,backIn:kl,backInOut:pp,backOut:hp,anticipate:mp},au=e=>{if(xl(e)){Mh(e.length===4);const[t,n,r,i]=e;return hi(t,n,r,i)}else if(typeof e=="string")return OS[e];return e};function IS(e,t,n){const r=[],i=n||Mp,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]||rt:t;a=pi(l,a)}r.push(a)}return r}function LS(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Mh(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=IS(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=ar(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Kt(e[0],e[s-1],u)):c}function FS(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ar(0,t,r);e.push(be(n,1,i))}}function BS(e){const t=[0];return FS(t,e.length-1),t}function zS(e,t){return e.map(n=>n*t)}function VS(e,t){return e.map(()=>t||Lp).splice(0,e.length-1)}function rs({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=MS(r)?r.map(au):au(r),s={done:!1,value:t[0]},o=zS(n&&n.length===t.length?n:BS(t),e),a=LS(o,t,{ease:Array.isArray(i)?i:VS(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const $S=e=>{const t=({timestamp:n})=>e(n);return{start:()=>xe.update(t,!0),stop:()=>hn(t),now:()=>Ie.isProcessing?Ie.timestamp:Ot.now()}},US={decay:ou,inertia:ou,tween:rs,keyframes:rs,spring:Ip},WS=e=>e/100;class Pl extends Rp{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)||Nl,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=gl(n)?n:US[n]||rs;let l,c;a!==rs&&typeof t[0]!="number"&&(l=pi(WS,Mp(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=ep(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:x,onUpdate:b}=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 y=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,N=s;if(p){const T=Math.min(this.currentTime,u)/f;let O=Math.floor(T),E=T%1;!E&&T>=1&&(E=1),E===1&&O--,O=Math.min(O,p+1),!!(O%2)&&(g==="reverse"?(E=1-E,x&&(E-=x/f)):g==="mirror"&&(N=o)),w=Kt(0,1,E)*f}const j=v?{done:!1,value:l[0]}:N.next(w);a&&(j.value=a(j.value));let{done:S}=j;!v&&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&&(j.value=As(l,this.options,i)),b&&b(j.value),A&&this.finish(),j}get duration(){const{resolved:t}=this;return t?Ht(t.calculatedDuration):0}get time(){return Ht(this.currentTime)}set time(t){t=Wt(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=Ht(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=$S,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)}}const HS=new Set(["opacity","clipPath","filter","transform"]);function qS(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=rp(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 KS=tl(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),is=10,GS=2e4;function YS(e){return gl(e.type)||e.type==="spring"||!np(e.ease)}function XS(e,t){const n=new Pl({...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<GS;)r=n.sample(s),i.push(r.value),s+=is;return{times:void 0,keyframes:i,duration:s-is,ease:"linear"}}const Fp={anticipate:mp,backInOut:pp,circInOut:xp};function JS(e){return e in Fp}class lu extends Rp{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new _p(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"&&ts()&&JS(s)&&(s=Fp[s]),YS(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...x}=this.options,b=XS(t,x);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const u=qS(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(qc(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(As(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 Ht(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Ht(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Wt(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 rt;const{animation:r}=n;qc(r,t)}return rt}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 Pl({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),x=Wt(this.time);c.setWithVelocity(g.sample(x-is).value,g.sample(x).value,is)}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 KS()&&r&&HS.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const QS={type:"spring",stiffness:500,damping:25,restSpeed:10},ZS=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eC={type:"keyframes",duration:.8},tC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nC=(e,{keyframes:t})=>t.length>2?eC:Ln.has(e)?e.startsWith("scale")?ZS(t[1]):QS:tC;function rC({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 Al=(e,t,n,r={},i,s)=>o=>{const a=ml(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Wt(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};rC(a)||(u={...u,...nC(e,u)}),u.duration&&(u.duration=Wt(u.duration)),u.repeatDelay&&(u.repeatDelay=Wt(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=As(u.keyframes,a);if(h!==void 0)return xe.update(()=>{u.onUpdate(h),u.onComplete()}),new kk([])}return!s&&lu.supports(u)?new lu(u):new Pl(u)};function iC({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Bp(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&&iC(u,f))continue;const g={delay:n,...ml(o||{},f)};let x=!1;if(window.MotionHandoffAnimation){const y=cp(e);if(y){const v=window.MotionHandoffAnimation(y,f,xe);v!==null&&(g.startTime=v,x=!0)}}Xo(e,f),h.start(Al(f,h,p,e.shouldReduceMotion&&ap.has(f)?{type:!1}:g,e,x));const b=h.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{xe.update(()=>{a&&Ik(e,a)})}),c}function ra(e,t,n={}){var r;const i=Ps(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(Bp(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return sC(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 sC(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(oC).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ra(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function oC(e,t){return e.sortNodePosition(t)}function aC(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>ra(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=ra(e,t,n);else{const i=typeof t=="function"?Ps(e,t,n.custom):t;r=Promise.all(Bp(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const lC=rl.length;function zp(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zp(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lC;n++){const r=rl[n],i=e.props[r];(Zr(i)||i===!1)&&(t[r]=i)}return t}const cC=[...nl].reverse(),uC=nl.length;function dC(e){return t=>Promise.all(t.map(({animation:n,options:r})=>aC(e,n,r)))}function fC(e){let t=dC(e),n=cu(),r=!0;const i=l=>(c,u)=>{var f;const h=Ps(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...x}=h;c={...c,...x,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=zp(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let b=0;b<uC;b++){const y=cC[b],v=n[y],w=c[y]!==void 0?c[y]:u[y],N=Zr(w),j=y===l?v.isActive:null;j===!1&&(g=b);let S=w===u[y]&&w!==c[y]&&N;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),v.protectedKeys={...p},!v.isActive&&j===null||!w&&!v.prevProp||Ns(w)||typeof w=="boolean")continue;const A=hC(v.prevProp,w);let T=A||y===l&&v.isActive&&!S&&N||b>g&&N,O=!1;const E=Array.isArray(w)?w:[w];let M=E.reduce(i(y),{});j===!1&&(M={});const{prevResolvedValues:D={}}=v,R={...D,...M},L=_=>{T=!0,h.has(_)&&(O=!0,h.delete(_)),v.needsAnimating[_]=!0;const H=e.getValue(_);H&&(H.liveStyle=!1)};for(const _ in R){const H=M[_],U=D[_];if(p.hasOwnProperty(_))continue;let C=!1;Ko(H)&&Ko(U)?C=!Zh(H,U):C=H!==U,C?H!=null?L(_):h.add(_):H!==void 0&&h.has(_)?L(_):v.protectedKeys[_]=!0}v.prevProp=w,v.prevResolvedValues=M,v.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(S&&A)||O)&&f.push(...E.map(_=>({animation:_,options:{type:y}})))}if(h.size){const b={};h.forEach(y=>{const v=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),b[y]=v??null}),f.push({animation:b})}let x=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?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 hC(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Zh(t,e):!1}function jn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cu(){return{animate:jn(!0),whileInView:jn(),whileHover:jn(),whileTap:jn(),whileDrag:jn(),whileFocus:jn(),exit:jn()}}class bn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class pC extends bn{constructor(t){super(t),t.animationState||(t.animationState=fC(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ns(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 mC=0;class gC extends bn{constructor(){super(...arguments),this.id=mC++}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 xC={animation:{Feature:pC},exit:{Feature:gC}};function ri(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function mi(e){return{point:{x:e.pageX,y:e.pageY}}}const yC=e=>t=>yl(t)&&e(t,mi(t));function Wr(e,t,n,r){return ri(e,t,yC(n),r)}const uu=(e,t)=>Math.abs(e-t);function bC(e,t){const n=uu(e.x,t.x),r=uu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Vp{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=oo(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=bC(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:x}=Ie;this.history.push({...g,timestamp:x});const{onStart:b,onMove:y}=this.handlers;h||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=so(h,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=oo(f.type==="pointercancel"?this.lastMoveEventInfo:so(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,b),g&&g(f,b)},!yl(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=mi(t),a=so(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=Ie;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,oo(a,this.history)),this.removeListeners=pi(Wr(this.contextWindow,"pointermove",this.handlePointerMove),Wr(this.contextWindow,"pointerup",this.handlePointerUp),Wr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),hn(this.updatePoint)}}function so(e,t){return t?{point:t(e.point)}:e}function du(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oo({point:e},t){return{point:e,delta:du(e,$p(t)),offset:du(e,vC(t)),velocity:wC(t,.1)}}function vC(e){return e[0]}function $p(e){return e[e.length-1]}function wC(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=$p(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Wt(t)));)n--;if(!r)return{x:0,y:0};const s=Ht(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 Up=1e-4,kC=1-Up,SC=1+Up,Wp=.01,CC=0-Wp,jC=0+Wp;function st(e){return e.max-e.min}function EC(e,t,n){return Math.abs(e-t)<=n}function fu(e,t,n,r=.5){e.origin=r,e.originPoint=be(t.min,t.max,e.origin),e.scale=st(n)/st(t),e.translate=be(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kC&&e.scale<=SC||isNaN(e.scale))&&(e.scale=1),(e.translate>=CC&&e.translate<=jC||isNaN(e.translate))&&(e.translate=0)}function Hr(e,t,n,r){fu(e.x,t.x,n.x,r?r.originX:void 0),fu(e.y,t.y,n.y,r?r.originY:void 0)}function hu(e,t,n){e.min=n.min+t.min,e.max=e.min+st(t)}function NC(e,t,n){hu(e.x,t.x,n.x),hu(e.y,t.y,n.y)}function pu(e,t,n){e.min=t.min-n.min,e.max=e.min+st(t)}function qr(e,t,n){pu(e.x,t.x,n.x),pu(e.y,t.y,n.y)}function TC(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?be(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?be(n,e,r.max):Math.min(e,n)),e}function mu(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 PC(e,{top:t,left:n,bottom:r,right:i}){return{x:mu(e.x,n,i),y:mu(e.y,t,r)}}function gu(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 AC(e,t){return{x:gu(e.x,t.x),y:gu(e.y,t.y)}}function _C(e,t){let n=.5;const r=st(e),i=st(t);return i>r?n=ar(t.min,t.max-r,e.min):r>i&&(n=ar(e.min,e.max-i,t.min)),Kt(0,1,n)}function RC(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 ia=.35;function DC(e=ia){return e===!1?e=0:e===!0&&(e=ia),{x:xu(e,"left","right"),y:xu(e,"top","bottom")}}function xu(e,t,n){return{min:yu(e,t),max:yu(e,n)}}function yu(e,t){return typeof e=="number"?e:e[t]||0}const bu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qn=()=>({x:bu(),y:bu()}),vu=()=>({min:0,max:0}),Se=()=>({x:vu(),y:vu()});function ut(e){return[e("x"),e("y")]}function Hp({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function MC({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function OC(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 ao(e){return e===void 0||e===1}function sa({scale:e,scaleX:t,scaleY:n}){return!ao(e)||!ao(t)||!ao(n)}function Nn(e){return sa(e)||qp(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qp(e){return wu(e.x)||wu(e.y)}function wu(e){return e&&e!=="0%"}function ss(e,t,n){const r=e-n,i=t*r;return n+i}function ku(e,t,n,r,i){return i!==void 0&&(e=ss(e,i,r)),ss(e,n,r)+t}function oa(e,t=0,n=1,r,i){e.min=ku(e.min,t,n,r,i),e.max=ku(e.max,t,n,r,i)}function Kp(e,{x:t,y:n}){oa(e.x,t.translate,t.scale,t.originPoint),oa(e.y,n.translate,n.scale,n.originPoint)}const Su=.999999999999,Cu=1.0000000000001;function IC(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&&er(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Kp(e,o)),r&&Nn(s.latestValues)&&er(e,s.latestValues))}t.x<Cu&&t.x>Su&&(t.x=1),t.y<Cu&&t.y>Su&&(t.y=1)}function Zn(e,t){e.min=e.min+t,e.max=e.max+t}function ju(e,t,n,r,i=.5){const s=be(e.min,e.max,i);oa(e,t,n,s,r)}function er(e,t){ju(e.x,t.x,t.scaleX,t.scale,t.originX),ju(e.y,t.y,t.scaleY,t.scale,t.originY)}function Gp(e,t){return Hp(OC(e.getBoundingClientRect(),t))}function LC(e,t,n){const r=Gp(e,n),{scroll:i}=t;return i&&(Zn(r.x,i.offset.x),Zn(r.y,i.offset.y)),r}const Yp=({current:e})=>e?e.ownerDocument.defaultView:null,FC=new WeakMap;class BC{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=Se(),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(mi(u).point)},s=(u,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_k(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),ut(b=>{let y=this.getAxisMotionValue(b).get()||0;if(Mt.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[b];w&&(y=st(w)*(parseFloat(y)/100))}}this.originPoint[b]=y}),g&&xe.postRender(()=>g(u,f)),Xo(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=f;if(p&&this.currentDirection===null){this.currentDirection=zC(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),x&&x(u,f)},a=(u,f)=>this.stop(u,f),l=()=>ut(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 Vp(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Yp(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&&xe.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||!Ni(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=TC(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&&Xn(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=PC(i.layoutBox,n):this.constraints=!1,this.elastic=DC(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&ut(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=RC(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xn(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=LC(r,i.root,this.visualElement.getTransformPagePoint());let o=AC(i.layout.layoutBox,s);if(n){const a=n(MC(o));this.hasMutatedConstraints=!!a,a&&(o=Hp(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=ut(u=>{if(!Ni(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 Xo(this.visualElement,t),r.start(Al(t,r,0,n,this.visualElement,!1))}stopAnimation(){ut(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ut(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){ut(n=>{const{drag:r}=this.getProps();if(!Ni(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]-be(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Xn(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ut(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=_C({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(),ut(o=>{if(!Ni(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(be(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;FC.set(this.visualElement,this);const t=this.visualElement.current,n=Wr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Xn(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()),xe.read(r);const o=ri(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(ut(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=ia,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Ni(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zC(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class VC extends bn{constructor(t){super(t),this.removeGroupControls=rt,this.removeListeners=rt,this.controls=new BC(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Eu=e=>(t,n)=>{e&&xe.postRender(()=>e(t,n))};class $C extends bn{constructor(){super(...arguments),this.removePointerDownListener=rt}onPointerDown(t){this.session=new Vp(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yp(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Eu(t),onStart:Eu(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&xe.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Wr(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 $i={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Nu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Tr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Y.test(e))e=parseFloat(e);else return e;const n=Nu(e,t.target.x),r=Nu(e,t.target.y);return`${n}% ${r}%`}},UC={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=pn.parse(e);if(i.length>5)return r;const s=pn.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=be(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 WC extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;uk(HC),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()})),$i.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()||xe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),sl.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 Xp(e){const[t,n]=Rh(),r=m.useContext(Ja);return d.jsx(WC,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(zh),isPresent:t,safeToRemove:n})}const HC={borderRadius:{...Tr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Tr,borderTopRightRadius:Tr,borderBottomLeftRadius:Tr,borderBottomRightRadius:Tr,boxShadow:UC};function qC(e,t,n){const r=Be(e)?e:ti(e);return r.start(Al("",r,t,n)),r.animation}function KC(e){return e instanceof SVGElement&&e.tagName!=="svg"}const GC=(e,t)=>e.depth-t.depth;class YC{constructor(){this.children=[],this.isDirty=!1}add(t){bl(this.children,t),this.isDirty=!0}remove(t){vl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(GC),this.isDirty=!1,this.children.forEach(t)}}function XC(e,t){const n=Ot.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(hn(r),e(s-t))};return xe.read(r,!0),()=>hn(r)}const Jp=["TopLeft","TopRight","BottomLeft","BottomRight"],JC=Jp.length,Tu=e=>typeof e=="string"?parseFloat(e):e,Pu=e=>typeof e=="number"||Y.test(e);function QC(e,t,n,r,i,s){i?(e.opacity=be(0,n.opacity!==void 0?n.opacity:1,ZC(r)),e.opacityExit=be(t.opacity!==void 0?t.opacity:1,0,ej(r))):s&&(e.opacity=be(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<JC;o++){const a=`border${Jp[o]}Radius`;let l=Au(t,a),c=Au(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Pu(l)===Pu(c)?(e[a]=Math.max(be(Tu(l),Tu(c),r),0),(Mt.test(c)||Mt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=be(t.rotate||0,n.rotate||0,r))}function Au(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ZC=Qp(0,.5,gp),ej=Qp(.5,.95,rt);function Qp(e,t,n){return r=>r<e?0:r>t?1:n(ar(e,t,r))}function _u(e,t){e.min=t.min,e.max=t.max}function ct(e,t){_u(e.x,t.x),_u(e.y,t.y)}function Ru(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Du(e,t,n,r,i){return e-=t,e=ss(e,1/n,r),i!==void 0&&(e=ss(e,1/i,r)),e}function tj(e,t=0,n=1,r=.5,i,s=e,o=e){if(Mt.test(t)&&(t=parseFloat(t),t=be(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=be(s.min,s.max,r);e===s&&(a-=t),e.min=Du(e.min,t,n,a,i),e.max=Du(e.max,t,n,a,i)}function Mu(e,t,[n,r,i],s,o){tj(e,t[n],t[r],t[i],t.scale,s,o)}const nj=["x","scaleX","originX"],rj=["y","scaleY","originY"];function Ou(e,t,n,r){Mu(e.x,t,nj,n?n.x:void 0,r?r.x:void 0),Mu(e.y,t,rj,n?n.y:void 0,r?r.y:void 0)}function Iu(e){return e.translate===0&&e.scale===1}function Zp(e){return Iu(e.x)&&Iu(e.y)}function Lu(e,t){return e.min===t.min&&e.max===t.max}function ij(e,t){return Lu(e.x,t.x)&&Lu(e.y,t.y)}function Fu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function em(e,t){return Fu(e.x,t.x)&&Fu(e.y,t.y)}function Bu(e){return st(e.x)/st(e.y)}function zu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class sj{constructor(){this.members=[]}add(t){bl(this.members,t),t.scheduleRender()}remove(t){if(vl(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 oj(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 Tn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Fr=typeof window<"u"&&window.MotionDebug!==void 0,lo=["","X","Y","Z"],aj={visibility:"hidden"},Vu=1e3;let lj=0;function co(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function tm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=cp(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",xe,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&tm(r)}function nm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=lj++,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,Fr&&(Tn.totalNodes=Tn.resolvedTargetDeltas=Tn.recalculatedProjection=0),this.nodes.forEach(dj),this.nodes.forEach(gj),this.nodes.forEach(xj),this.nodes.forEach(fj),Fr&&window.MotionDebug.record(Tn)},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 YC)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new wl),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=KC(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=XC(h,250),$i.hasAnimatedSinceResize&&($i.hasAnimatedSinceResize=!1,this.nodes.forEach(Uu))})}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 x=this.options.transition||u.getDefaultTransition()||kj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=u.getProps(),v=!this.targetLayout||!em(this.targetLayout,g)||p,w=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const N={...ml(x,"layout"),onPlay:b,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N)}else h||Uu(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,hn(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(yj),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&&tm(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($u);return}this.isUpdating||this.nodes.forEach(pj),this.isUpdating=!1,this.nodes.forEach(mj),this.nodes.forEach(cj),this.nodes.forEach(uj),this.clearAllSnapshots();const a=Ot.now();Ie.delta=Kt(0,1e3/60,a-Ie.timestamp),Ie.timestamp=a,Ie.isProcessing=!0,Zs.update.process(Ie),Zs.preRender.process(Ie),Zs.render.process(Ie),Ie.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hj),this.sharedNodes.forEach(bj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xe.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=Se(),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&&!Zp(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Nn(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)),Sj(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return Se();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Cj))){const{scroll:u}=this.root;u&&(Zn(l.x,u.offset.x),Zn(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=Se();if(ct(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&&ct(l,o),Zn(l.x,f.offset.x),Zn(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=Se();ct(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&&er(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Nn(u.latestValues)&&er(l,u.latestValues)}return Nn(this.latestValues)&&er(l,this.latestValues),l}removeTransform(o){const a=Se();ct(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Nn(c.latestValues))continue;sa(c.latestValues)&&c.updateSnapshot();const u=Se(),f=c.measurePageBox();ct(u,f),Ou(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Nn(this.latestValues)&&Ou(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!==Ie.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=Ie.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),qr(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),ct(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),NC(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ct(this.target,this.layout.layoutBox),Kp(this.target,this.targetDelta)):ct(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=Se(),this.relativeTargetOrigin=Se(),qr(this.relativeTargetOrigin,this.target,p.target),ct(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Fr&&Tn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sa(this.parent.latestValues)||qp(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===Ie.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;ct(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;IC(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=Se());const{target:g}=a;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ru(this.prevProjectionDelta.x,this.projectionDelta.x),Ru(this.prevProjectionDelta.y,this.projectionDelta.y)),Hr(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!zu(this.projectionDelta.x,this.prevProjectionDelta.x)||!zu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),Fr&&Tn.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=Qn(),this.projectionDelta=Qn(),this.projectionDeltaWithTransform=Qn()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=Qn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Se(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,x=p!==g,b=this.getStack(),y=!b||b.members.length<=1,v=!!(x&&!y&&this.options.crossfade===!0&&!this.path.some(wj));this.animationProgress=0;let w;this.mixTargetDelta=N=>{const j=N/1e3;Wu(f.x,o.x,j),Wu(f.y,o.y,j),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),vj(this.relativeTarget,this.relativeTargetOrigin,h,j),w&&ij(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Se()),ct(w,this.relativeTarget)),x&&(this.animationValues=u,QC(u,c,this.latestValues,j,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},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&&(hn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{$i.hasAnimatedSinceResize=!0,this.currentAnimation=qC(0,Vu,{...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(Vu),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&&rm(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Se();const f=st(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=st(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}ct(a,l),er(a,u),Hr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new sj),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&&co("z",o,c,this.animationValues);for(let u=0;u<lo.length;u++)co(`rotate${lo[u]}`,o,c,this.animationValues),co(`skew${lo[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 aj;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=zi(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 x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=zi(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Nn(this.latestValues)&&(x.transform=u?u({},""):"none",this.hasProjected=!1),x}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=oj(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 x in es){if(h[x]===void 0)continue;const{correct:b,applyTo:y}=es[x],v=c.transform==="none"?h[x]:b(h[x],f);if(y){const w=y.length;for(let N=0;N<w;N++)c[y[N]]=v}else c[x]=v}return this.options.layoutId&&(c.pointerEvents=f===this?zi(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($u),this.root.sharedNodes.clear()}}}function cj(e){e.updateLayout()}function uj(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"?ut(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=st(h);h.min=r[f].min,h.max=h.min+p}):rm(s,n.layoutBox,r)&&ut(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=st(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=Qn();Hr(a,r,n.layoutBox);const l=Qn();o?Hr(l,e.applyTransform(i,!0),n.measuredBox):Hr(l,r,n.layoutBox);const c=!Zp(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=Se();qr(g,n.layoutBox,h.layoutBox);const x=Se();qr(x,r,p.layoutBox),em(g,x)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=x,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 dj(e){Fr&&Tn.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 fj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hj(e){e.clearSnapshot()}function $u(e){e.clearMeasurements()}function pj(e){e.isLayoutDirty=!1}function mj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Uu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function gj(e){e.resolveTargetDelta()}function xj(e){e.calcProjection()}function yj(e){e.resetSkewAndRotation()}function bj(e){e.removeLeadSnapshot()}function Wu(e,t,n){e.translate=be(t.translate,0,n),e.scale=be(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hu(e,t,n,r){e.min=be(t.min,n.min,r),e.max=be(t.max,n.max,r)}function vj(e,t,n,r){Hu(e.x,t.x,n.x,r),Hu(e.y,t.y,n.y,r)}function wj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const kj={duration:.45,ease:[.4,0,.1,1]},qu=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ku=qu("applewebkit/")&&!qu("chrome/")?Math.round:rt;function Gu(e){e.min=Ku(e.min),e.max=Ku(e.max)}function Sj(e){Gu(e.x),Gu(e.y)}function rm(e,t,n){return e==="position"||e==="preserve-aspect"&&!EC(Bu(t),Bu(n),.2)}function Cj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const jj=nm({attachResizeListener:(e,t)=>ri(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uo={current:void 0},im=nm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!uo.current){const e=new jj({});e.mount(window),e.setOptions({layoutScroll:!0}),uo.current=e}return uo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ej={pan:{Feature:$C},drag:{Feature:VC,ProjectionNode:im,MeasureLayout:Xp}};function Yu(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&&xe.postRender(()=>s(t,mi(t)))}class Nj extends bn{mount(){const{current:t}=this.node;t&&(this.unmount=Ek(t,n=>(Yu(this.node,n,"Start"),r=>Yu(this.node,r,"End"))))}unmount(){}}class Tj extends bn{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=pi(ri(this.node.current,"focus",()=>this.onFocus()),ri(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xu(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&&xe.postRender(()=>s(t,mi(t)))}class Pj extends bn{mount(){const{current:t}=this.node;t&&(this.unmount=Ak(t,n=>(Xu(this.node,n,"Start"),(r,{success:i})=>Xu(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const aa=new WeakMap,fo=new WeakMap,Aj=e=>{const t=aa.get(e.target);t&&t(e)},_j=e=>{e.forEach(Aj)};function Rj({root:e,...t}){const n=e||document;fo.has(n)||fo.set(n,{});const r=fo.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(_j,{root:e,...t})),r[i]}function Dj(e,t,n){const r=Rj(t);return aa.set(e,n),r.observe(e),()=>{aa.delete(e),r.unobserve(e)}}const Mj={some:0,all:1};class Oj extends bn{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:Mj[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 Dj(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(Ij(t,n))&&this.startObserver()}unmount(){}}function Ij({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Lj={inView:{Feature:Oj},tap:{Feature:Pj},focus:{Feature:Tj},hover:{Feature:Nj}},Fj={layout:{ProjectionNode:im,MeasureLayout:Xp}},la={current:null},sm={current:!1};function Bj(){if(sm.current=!0,!!el)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>la.current=e.matches;e.addListener(t),t()}else la.current=!1}const zj=[...Ap,Fe,pn],Vj=e=>zj.find(Pp(e)),Ju=new WeakMap;function $j(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Be(i))e.addValue(r,i);else if(Be(s))e.addValue(r,ti(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,ti(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Qu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Uj{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=Nl,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=Ot.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,xe.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=Ts(n),this.isVariantNode=Fh(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&&Be(g)&&g.set(l[p],!1)}}mount(t){this.current=t,Ju.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)),sm.current||Bj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:la.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ju.delete(this.current),this.projection&&this.projection.unmount(),hn(this.notifyUpdate),hn(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=Ln.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&xe.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 lr){const n=lr[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):Se()}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<Qu.length;r++){const i=Qu[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=$j(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=ti(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"&&(Np(i)||yp(i))?i=parseFloat(i):!Vj(i)&&pn.test(n)&&(i=Cp(t,n)),this.setBaseTarget(t,Be(i)?i.get():i)),Be(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=al(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&&!Be(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 wl),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class om extends Uj{constructor(){super(...arguments),this.KeyframeResolver=_p}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;Be(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Wj(e){return window.getComputedStyle(e)}class Hj extends om{constructor(){super(...arguments),this.type="html",this.renderInstance=Kh}readValueFromInstance(t,n){if(Ln.has(n)){const r=El(n);return r&&r.default||0}else{const r=Wj(t),i=(Wh(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Gp(t,n)}build(t,n,r){ul(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return pl(t,n,r)}}class qj extends om{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ln.has(n)){const r=El(n);return r&&r.default||0}return n=Gh.has(n)?n:il(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Jh(t,n,r)}build(t,n,r){dl(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Yh(t,n,r,i)}mount(t){this.isSVGTag=hl(t.tagName),super.mount(t)}}const Kj=(e,t)=>ol(e)?new qj(t):new Hj(t,{allowProjection:e!==m.Fragment}),Gj=bk({...xC,...Lj,...Ej,...Fj},Kj),os=M1(Gj),_l=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:z("card-glass rounded border bg-card text-card-foreground shadow-none",e),...t}));_l.displayName="Card";const Yj=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:z("flex flex-col space-y-0.5 px-3 py-2",e),...t}));Yj.displayName="CardHeader";const Xj=m.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:z("text-sm font-light uppercase tracking-wider text-muted-foreground",e),...t}));Xj.displayName="CardTitle";const Jj=m.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:z("text-xs text-muted-foreground",e),...t}));Jj.displayName="CardDescription";const Rl=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:z("p-3 pt-0",e),...t}));Rl.displayName="CardContent";const Qj=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:z("flex items-center p-3 pt-0",e),...t}));Qj.displayName="CardFooter";const Zj={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"},eE={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"},tE={feature:"border-l-2 border-l-category-feature scope-cat-feature",bugfix:"border-l-2 border-l-category-bugfix scope-cat-bugfix",refactor:"border-l-2 border-l-category-refactor scope-cat-refactor",infrastructure:"border-l-2 border-l-category-infrastructure scope-cat-infrastructure",docs:"border-l-2 border-l-category-docs scope-cat-docs"},ho="inline-block rounded border px-1.5 py-0 text-[10px] uppercase bg-transparent";function nE({scopeId:e,projectId:t,info:n,onRecover:r,onDismiss:i}){return d.jsxs(On,{children:[d.jsx(In,{asChild:!0,onClick:s=>s.stopPropagation(),children:d.jsx("button",{className:"flex items-center gap-0.5 text-amber-500 hover:text-amber-400 transition-colors",children:d.jsx(fn,{className:"h-3 w-3"})})}),d.jsxs(yn,{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",{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(E0,{className:"h-3 w-3"}),"Revert to ",n.from_status]}),d.jsxs("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(Ct,{className:"h-3 w-3"}),"Keep here"]})]})]})]})}function rE(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 ur({scope:e,onClick:t,isDragOverlay:n,cardDisplay:r,dimmed:i,project:s}){const{attributes:o,listeners:a,setNodeRef:l,transform:c,isDragging:u}=Th({id:ce(e),disabled:n||i}),f=c?{transform:Dn.Translate.toString(c)}:void 0,{engine:h}=Gt(),{activeScopes:p,abandonedScopes:g,recoverScope:x,dismissAbandoned:b}=If(),y=Lt(),v=h.getEntryPoint().id,w=e.status===v,N=w&&!!e.is_ghost,j=ce(e),S=!w&&p.has(j),A=w?void 0:g.get(j),T=!!A&&!S,O=m.useRef(null),[E,M]=m.useState(()=>document.documentElement.getAttribute("data-theme")==="neon-glass");return m.useEffect(()=>{const D=new MutationObserver(()=>{M(document.documentElement.getAttribute("data-theme")==="neon-glass")});return D.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>D.disconnect()},[]),m.useEffect(()=>{if(!S||!O.current)return;let D=0,R;const L=O.current,P=E?_=>`conic-gradient(from ${_}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%)`:_=>`conic-gradient(from ${_}deg, transparent 0%, rgba(233,30,99,0.7) 10%, rgba(233,30,99,0.3) 20%, transparent 30%)`,F=()=>{D=(D+1.5)%360,L.style.background=P(D),R=requestAnimationFrame(F)};return R=requestAnimationFrame(F),()=>cancelAnimationFrame(R)},[S,E]),d.jsxs(_l,{ref:l,"data-tour":"scope-card",style:{...f,...!N&&!w&&s&&(r==null?void 0:r.project)!==!1?{"--project-color":`hsl(${s.color})`}:{}},className:z("scope-card group/scope-card cursor-grab transition-[colors,opacity] duration-200 hover:bg-surface-light active:cursor-grabbing",N?"scope-card-ghost ghost-shimmer opacity-70":w?"border-l-2 border-dashed border-l-warning-amber/60":!s&&e.category?tE[e.category]:"",S&&"scope-card-dispatched",T&&"scope-card-abandoned",u&&"opacity-30",i&&!u&&"opacity-30 cursor-default"),onClick:()=>{u||t==null||t(e)},...o,...a,children:[S&&d.jsx("div",{ref:O,className:"dispatch-border-overlay"}),d.jsxs(Rl,{className:"px-2.5 py-1.5",children:[d.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[N?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-purple-400",children:[d.jsx(_a,{className:"h-3 w-3"}),"ai suggestion"]}):w?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-warning-amber",children:[d.jsx(qb,{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"}),pt(e.id),d.jsx("button",{onClick:D=>{D.stopPropagation(),fetch(y(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favourite:!e.favourite})})},className:z("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(v0,{className:z("h-3 w-3",e.favourite&&"fill-current")})})]}),!w&&d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[T&&d.jsx(nE,{scopeId:e.id,projectId:e.project_id,info:A,onRecover:x,onDismiss:b}),e.effort_estimate&&(r==null?void 0:r.effort)!==!1&&d.jsx("span",{className:z(ho,"effort-ghost border-muted-foreground/30 text-muted-foreground"),children:rE(e.effort_estimate)}),e.category&&(r==null?void 0:r.category)!==!1&&d.jsx("span",{className:z(ho,eE[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:z(ho,Zj[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}),!w&&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(D=>d.jsx("span",{className:"glass-pill inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:D},D)),e.tags.length>3&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",e.tags.length-3]})]})]})]})}const iE={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 opacity-60",failed:"border-solid border-red-500/40",cancelled:"border-solid border-muted-foreground/30 opacity-50"},sE={assembling:"Assembling",dispatched:"Dispatched",in_progress:"Running",completed:"Complete",failed:"Failed",cancelled:"Cancelled"};function oE(e){let t=0;for(const n of e.scopes){if(!n.effort_estimate)continue;const r=n.effort_estimate.toLowerCase().match(/(\d+(?:\.\d+)?)\s*hour/);r&&(t+=parseFloat(r[1]));const i=n.effort_estimate.toLowerCase().match(/(\d+)\s*min/);i&&(t+=parseInt(i[1])/60)}return t===0?"TBD":t<1?`${Math.round(t*60)}M`:`~${t.toFixed(0)}H`}function aE({sprint:e,scopeLookup:t,onDelete:n,onDispatch:r,onRename:i,onScopeClick:s,cardDisplay:o,dimmedIds:a,looseCount:l,onAddAll:c,editingName:u,onEditingDone:f}){var C;const{engine:h}=Gt(),p=e.status==="assembling",[g,x]=m.useState(u??!1),[b,y]=m.useState(e.name),v=m.useRef(null);m.useEffect(()=>{u&&(x(!0),y(""))},[u]),m.useEffect(()=>{var B;g&&((B=v.current)==null||B.focus())},[g]);const w=()=>{const B=b.trim();B&&B!==e.name&&i&&i(e.id,B),x(!1),y(B||e.name),f==null||f()},N=e.group_type==="batch",j=N?(()=>{var J;const B=h.getBatchTargetStatus(e.target_column);return B?((J=h.findEdge(e.target_column,B))==null?void 0:J.label)??"Dispatch":"Dispatch"})():void 0,{attributes:S,listeners:A,setNodeRef:T,transform:O,isDragging:E}=Th({id:`sprint-${e.id}`,disabled:N||!p||e.scope_ids.length===0}),{setNodeRef:M,isOver:D}=Ka({id:`sprint-drop-${e.id}`,disabled:!p}),R=O?{transform:Dn.Translate.toString(O)}:void 0,L=e.scope_ids.length,{progress:P}=e,F=N&&p&&L>0&&r,_=N?Hf:Pa,H=N?"text-amber-400":"text-cyan-400",U=N&&p?"border-muted-foreground/30":iE[e.status]??"border-muted-foreground/30";return d.jsxs("div",{ref:T,style:{...R,...N&&p?{borderColor:(((C=h.getList(e.target_column))==null?void 0:C.hex)??"")+"80"}:void 0},className:z("rounded-lg border bg-card/30 transition-all duration-200",U,E&&"opacity-30",!N&&p&&"cursor-grab active:cursor-grabbing"),...N?{}:S,...N?{}:A,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit",children:[d.jsx(_,{className:z("h-3 w-3 shrink-0",H)}),g?d.jsx("input",{ref:v,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:N?"Batch name...":"Sprint name...",value:b,onChange:B=>y(B.target.value),onKeyDown:B=>{B.key==="Enter"&&w(),B.key==="Escape"&&(x(!1),y(e.name),f==null||f())},onBlur:w,onClick:B=>B.stopPropagation()}):d.jsx("span",{className:z("text-xs font-medium text-foreground truncate flex-1",p&&"cursor-text"),onDoubleClick:()=>{p&&(x(!0),y(e.name))},children:e.name}),d.jsx("span",{className:z("rounded px-1 py-0.5 text-[10px] uppercase",e.status==="dispatched"||e.status==="in_progress"?"bg-amber-500/20 text-amber-400":e.status==="completed"?"bg-green-500/20 text-green-400":e.status==="failed"?"bg-red-500/20 text-red-400":"text-muted-foreground"),children:sE[e.status]}),p&&(l??0)>0&&c&&d.jsxs("button",{onClick:B=>{B.stopPropagation(),c(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 ${l} remaining scopes`,children:["+ All (",l,")"]}),F&&d.jsxs("button",{onClick:B=>{B.stopPropagation(),r(e.id)},className:"shrink-0 flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] bg-cyan-600/80 text-black hover:bg-cyan-500/80 transition-colors",title:j??"Dispatch",children:[d.jsx(Wi,{className:"h-2.5 w-2.5"}),j??"Dispatch"]}),p&&n&&d.jsx("button",{onClick:B=>{B.stopPropagation(),n(e.id)},className:"shrink-0 text-muted-foreground hover:text-red-400 transition-colors",children:d.jsx(Ct,{className:"h-3 w-3"})})]}),d.jsxs("div",{ref:M,className:z("p-1.5 space-y-1 min-h-[40px] transition-colors duration-150",D&&p&&"bg-cyan-500/5 ring-1 ring-inset ring-cyan-500/30 rounded-b-lg"),children:[e.scope_ids.map(B=>{const J=t.get(B);if(!J){const k=e.scopes.find(oe=>oe.scope_id===B);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:pt(B)}),k&&d.jsx("span",{className:"ml-2",children:k.title})]},B)}return d.jsx(ur,{scope:J,onClick:s,cardDisplay:o,dimmed:a==null?void 0:a.has(ce(J))},ce(J))}),L===0&&p&&D&&d.jsx("p",{className:"py-3 text-center text-[10px] text-muted-foreground/50",children:"Drop to add"})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsx("span",{className:"text-[10px] text-muted-foreground",children:N?j??"Batch":`Effort: ${oE(e)}`}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[L," scope",L!==1?"s":""]}),e.status!=="assembling"&&L>0&&d.jsxs("div",{className:"flex items-center gap-1",children:[P.completed>0&&d.jsxs("span",{className:"text-[10px] text-green-400",children:[P.completed," done"]}),P.failed>0&&d.jsxs("span",{className:"text-[10px] text-red-400",children:[P.failed," fail"]}),P.in_progress>0&&d.jsxs("span",{className:"text-[10px] text-amber-400",children:[P.in_progress," active"]})]})]}),N&&e.dispatch_result&&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 lE({sprint:e}){return d.jsxs("div",{className:"w-72 rotate-1 opacity-90 shadow-xl shadow-black/40 rounded-lg border border-cyan-500/40 bg-card/80 p-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Pa,{className:"h-3 w-3 text-cyan-400"}),d.jsx("span",{className:"text-xs font-medium",children:e.name})]}),d.jsxs("div",{className:"space-y-0.5",children:[e.scopes.slice(0,3).map(t=>d.jsxs("div",{className:"rounded bg-muted/30 px-1.5 py-0.5 text-[10px] text-muted-foreground truncate",children:[pt(t.scope_id)," ",t.title]},t.scope_id)),e.scopes.length>3&&d.jsxs("p",{className:"text-[10px] text-muted-foreground text-center",children:["+",e.scopes.length-3," more"]})]})]})}const cE=[{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 Zu({sortField:e,sortDirection:t,onSetSort:n,collapsed:r,onToggleCollapse:i}){const s=t==="asc"?fb:cb;return d.jsxs(On,{children:[d.jsx(In,{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(Nb,{className:"h-3 w-3"})})}),d.jsxs(yn,{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"}),cE.map(o=>{const a=e===o.field;return d.jsxs("button",{onClick:()=>n(o.field),className:z("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:z("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:z("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(Uf,{className:"h-3 w-3 text-muted-foreground"}):d.jsx($f,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{children:r?"Expand column":"Collapse column"})]})]})]})}function uE({id:e,label:t,color:n,scopes:r,sprints:i=[],scopeLookup:s=new Map,globalSprintScopeIds:o,onScopeClick:a,onDeleteSprint:l,onDispatchSprint:c,onRenameSprint:u,editingSprintId:f,onSprintEditingDone:h,isValidDrop:p,isDragActive:g,headerExtra:x,collapsed:b,onToggleCollapse:y,sortField:v,sortDirection:w,onSetSort:N,cardDisplay:j,dimmedIds:S,onAddAllToSprint:A,projectLookup:T}){mr();const{setNodeRef:O,isOver:E}=Ka({id:e}),M=m.useRef(null);m.useEffect(()=>{g&&p&&M.current&&M.current.scrollTo({top:0,behavior:"smooth"})},[g,p]);const D=o??new Set(i.flatMap(_=>_.scope_ids)),R=r.filter(_=>!D.has(_.id)),L=R.filter(_=>!_.is_ghost).map(_=>_.id),P=r.length,F=b;return d.jsx("div",{ref:O,"data-tour":"kanban-column",className:z("flex h-full flex-shrink-0 flex-col rounded border bg-card/50 overflow-hidden transition-[width] duration-300 ease-in-out",F?"w-10 cursor-pointer items-center":"w-72","card-glass neon-border-blue",g&&E&&p&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",g&&E&&!p&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",g&&!E&&p&&"border-green-500/20"),onClick:F?y:void 0,children:F?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex items-center justify-center py-1.5",onClick:_=>_.stopPropagation(),children:v&&w&&N&&y&&d.jsx(Zu,{sortField:v,sortDirection:w,onSetSort:N,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:z("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:P})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5 cursor-pointer",onClick:y,children:[d.jsx("div",{className:z("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:P}),x&&d.jsx("span",{className:"flex items-center",onClick:_=>_.stopPropagation(),children:x}),v&&w&&N&&y&&d.jsx("span",{onClick:_=>_.stopPropagation(),children:d.jsx(Zu,{sortField:v,sortDirection:w,onSetSort:N,collapsed:!1,onToggleCollapse:y})})]}),d.jsx("div",{ref:M,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-2",children:d.jsxs("div",{className:"space-y-1.5",children:[g&&p&&d.jsx("div",{className:z("flex h-10 items-center justify-center rounded border-2 border-dashed text-xs transition-colors",E?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),i.map(_=>d.jsx(aE,{sprint:_,scopeLookup:s,onDelete:l,onDispatch:c,onRename:u,onScopeClick:a,cardDisplay:j,dimmedIds:S,editingName:_.id===f,onEditingDone:h,looseCount:_.status==="assembling"?L.length:0,onAddAll:_.status==="assembling"&&A?H=>A(H,L):void 0},`sprint-${_.id}`)),d.jsx(Qi,{initial:!1,children:R.filter(_=>!_.is_ghost).map(_=>d.jsx(os.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(ur,{scope:_,onClick:a,cardDisplay:j,dimmed:S==null?void 0:S.has(ce(_)),project:_.project_id&&T?T.get(_.project_id):void 0})},ce(_)))}),R.some(_=>_.is_ghost)&&R.some(_=>!_.is_ghost)&&d.jsx("div",{className:"my-2 border-t border-dashed border-purple-500/20"}),d.jsx(Qi,{initial:!1,children:R.filter(_=>_.is_ghost).map(_=>d.jsx(os.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(ur,{scope:_,onClick:a,cardDisplay:j,dimmed:S==null?void 0:S.has(ce(_)),project:_.project_id&&T?T.get(_.project_id):void 0})},ce(_)))})]})})]})})}var dE=Symbol.for("react.lazy"),as=sx[" use ".trim().toString()];function fE(e){return typeof e=="object"&&e!==null&&"then"in e}function am(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===dE&&"_payload"in e&&fE(e._payload)}function lm(e){const t=pE(e),n=m.forwardRef((r,i)=>{let{children:s,...o}=r;am(s)&&typeof as=="function"&&(s=as(s._payload));const a=m.Children.toArray(s),l=a.find(gE);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 hE=lm("Slot");function pE(e){const t=m.forwardRef((n,r)=>{let{children:i,...s}=n;if(am(i)&&typeof as=="function"&&(i=as(i._payload)),m.isValidElement(i)){const o=yE(i),a=xE(s,i.props);return i.type!==m.Fragment&&(a.ref=r?nf(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 mE=Symbol("radix.slottable");function gE(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mE}function xE(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 yE(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 bE=Jf("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"}}),de=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?hE:"button";return d.jsx(o,{className:z(bE({variant:t,size:n,className:e})),ref:s,...i})});de.displayName="Button";const vE=[{key:"effort",label:"Effort"},{key:"category",label:"Category"},{key:"priority",label:"Priority"},{key:"tags",label:"Tags"},{key:"project",label:"Project colors"}];function wE({display:e,onToggle:t,hiddenCount:n}){return d.jsxs(On,{children:[d.jsx(In,{asChild:!0,children:d.jsxs(de,{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(h0,{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(yn,{align:"end",className:"filter-popover-glass !bg-transparent w-40",children:d.jsx("div",{className:"space-y-0.5",children:vE.map(({key:r,label:i})=>{const s=e[r];return d.jsxs("button",{onClick:()=>t(r),className:z("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:z("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:z("capitalize",s&&"text-foreground"),children:i})]},r)})})})]})}const kE=[{value:"kanban",label:"Kanban",Icon:zf},{value:"swimlane",label:"Swimlane",Icon:qf}],SE=[{value:"priority",label:"Priority"},{value:"category",label:"Category"},{value:"tags",label:"Tags"},{value:"effort",label:"Effort"},{value:"dependencies",label:"Dependencies"}];function CE({viewMode:e,groupField:t,onViewModeChange:n,onGroupFieldChange:r}){const i=e==="swimlane"?qf:zf;return d.jsxs(On,{children:[d.jsx(In,{asChild:!0,children:d.jsxs(de,{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(yn,{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:z("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:z("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:z(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"}),SE.map(({value:s,label:o})=>d.jsxs("button",{onClick:()=>r(s),className:z("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:z("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:z(t===s&&"text-foreground"),children:o})]},s))]})]})]})]})}function jE({laneValue:e,status:t,scopes:n=[],onScopeClick:r,cardDisplay:i,dimmedIds:s,isDragActive:o,isValidDrop:a,isCollapsed:l}){const c=`swim::${e}::${t}`,{setNodeRef:u,isOver:f}=Ka({id:c});return l?null:d.jsx("div",{ref:u,className:z("swim-cell min-h-[48px] overflow-hidden rounded border border-white/[0.04] p-1 transition-colors",o&&f&&a&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",o&&f&&!a&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",o&&!f&&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:z("flex h-8 items-center justify-center rounded border-2 border-dashed text-[10px] transition-colors",f?"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(Qi,{initial:!1,children:n.filter(h=>!h.is_ghost).map(h=>d.jsx(os.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(ur,{scope:h,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(h))})},ce(h)))}),d.jsx(Qi,{initial:!1,children:n.filter(h=>h.is_ghost).map(h=>d.jsx(os.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(ur,{scope:h,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(h))})},ce(h)))})]})})}function EE({lane:e,columns:t,collapsedColumns:n,isLaneCollapsed:r,onToggleLane:i,onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,validTargets:c}){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",children:[d.jsx("div",{className:z("h-full w-0.5 rounded-full shrink-0 self-stretch",e.color)}),d.jsx(Xr,{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(u=>d.jsx("div",{className:z(n.has(u.id)&&"hidden")},u.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",children:[d.jsx("div",{className:z("w-0.5 rounded-full shrink-0 min-h-[32px] self-stretch",e.color)}),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(Xr,{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(u=>d.jsx(jE,{laneValue:e.value,status:u.id,scopes:e.cells[u.id],onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,isValidDrop:c.has(u.id),isCollapsed:n.has(u.id)},u.id))]})}function NE({lanes:e,columns:t,collapsedColumns:n,collapsedLanes:r,onToggleLane:i,onToggleCollapse:s,onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,sprints:f}){mr();const h=t.filter(x=>!n.has(x.id)),p=`140px ${h.map(()=>"200px").join(" ")}`,g=f.some(x=>x.group_type==="sprint"||x.group_type==="batch"&&x.status!=="completed");return d.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[g&&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($b,{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:p,width:"max-content"},children:[d.jsx("div",{className:"sticky top-0 z-20 bg-background"}),h.map(x=>d.jsxs("button",{onClick:()=>s(x.id),className:z("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:z("h-2 w-2 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${x.color})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground truncate",children:x.label})]},x.id)),e.map(x=>d.jsx(EE,{lane:x,columns:h,collapsedColumns:n,isLaneCollapsed:r.has(x.value),onToggleLane:()=>i(x.value),onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u},x.value)),e.length===0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{}),d.jsx("div",{className:z("col-span-full py-12 text-center text-xs text-muted-foreground"),children:"No scopes to display"})]})]})]})}function TE({activeScope:e,activeSprint:t,cardDisplay:n}){return d.jsxs(Uw,{dropAnimation:null,children:[e&&d.jsx("div",{className:"w-72 rotate-2 opacity-90 shadow-xl shadow-black/40",children:d.jsx(ur,{scope:e,cardDisplay:n})}),t&&d.jsx(lE,{sprint:t})]})}const Yt=Qg,FM=tx,PE=Jg,BM=df,cm=m.forwardRef(({className:e,...t},n)=>d.jsx(cf,{ref:n,className:z("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}));cm.displayName=cf.displayName;const Ft=m.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(PE,{children:[d.jsx(cm,{}),d.jsxs(uf,{ref:r,className:z("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 rounded border-border bg-[#12121a]",e),...n,children:[t,d.jsxs(df,{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(Ct,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ft.displayName=uf.displayName;function vn({className:e,...t}){return d.jsx("div",{className:z("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Fn({className:e,...t}){return d.jsx(Zg,{className:z("text-sm font-normal leading-none tracking-tight",e),...t})}function vr({className:e,...t}){return d.jsx(ex,{className:z("text-sm text-muted-foreground",e),...t})}function AE({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a,onViewDetails:l}){var b;const c=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const y=setTimeout(()=>{var v;return(v=c.current)==null?void 0:v.focus()},100);return()=>clearTimeout(y)},[e]),!t||!n)return null;const u=((b=n.command)==null?void 0:b.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 x(){o()}return d.jsx(Yt,{open:e,onOpenChange:y=>{y||a()},children:d.jsxs(Ft,{className:"max-w-xs p-3 gap-0",children:[d.jsxs("div",{className:"mb-2.5 flex items-center gap-2",children:[d.jsx(_e,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(Ta,{className:"h-3 w-3 text-muted-foreground"}),d.jsx(_e,{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:pt(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-black/40 px-2 py-1.5",children:[d.jsx(Ra,{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:z("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(fn,{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(fn,{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(de,{ref:c,size:"sm",onClick:x,disabled:i,className:"flex-1",children:i?"Launching...":g}),d.jsx(de,{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(Vf,{className:"h-2.5 w-2.5"}),"View Details"]})]})})}function _E({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a}){var x;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=((x=n.command)==null?void 0:x.replace("{id}",String(t.id)))??null;function p(b){c(y=>{const v=new Set(y);return v.has(b)?v.delete(b):v.add(b),v})}function g(){o()}return d.jsx(Yt,{open:e,onOpenChange:b=>{b||a()},children:d.jsxs(Ft,{className:"max-w-md p-0 gap-0",children:[d.jsxs(vn,{className:"px-5 pt-4 pb-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(_e,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(Ta,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(_e,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx(Fn,{className:"text-sm font-normal",children:n.label}),d.jsx(vr,{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:pt(t.id)}),d.jsx("span",{className:"font-light truncate",children:t.title}),t.category&&d.jsx(_e,{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-black/40 px-3 py-2",children:[d.jsx(Ra,{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((b,y)=>d.jsxs("button",{onClick:()=>p(y),className:z("flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-xs text-left transition-colors",l.has(y)?"bg-primary/10 text-foreground":"bg-muted/30 text-muted-foreground hover:bg-muted/50"),children:[d.jsx("div",{className:z("flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border transition-colors",l.has(y)?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/30"),children:l.has(y)&&d.jsx(xs,{className:"h-2.5 w-2.5"})}),d.jsx("span",{className:"font-light",children:b})]},b))]}),r&&d.jsxs("div",{className:z("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(fn,{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(fn,{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(de,{onClick:g,disabled:!f||i,className:"flex-1",children:i?"Launching...":h?"Launch in iTerm":"Confirm Move"}),d.jsx(de,{variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]})]})]})})}var RE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],DE=RE.reduce((e,t)=>{const n=lm(`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}},{}),ME="Separator",ed="horizontal",OE=["horizontal","vertical"],um=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=ed,...i}=e,s=IE(r)?r:ed,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(DE.div,{"data-orientation":s,...a,...i,ref:t})});um.displayName=ME;function IE(e){return OE.includes(e)}var dm=um;const ls=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>d.jsx(dm,{ref:i,decorative:n,orientation:t,className:z("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ls.displayName=dm.displayName;function LE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const FE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zE={};function td(e,t){return(zE.jsx?BE:FE).test(e)}const VE=/[ \t\n\f\r]/g;function $E(e){return typeof e=="object"?e.type==="text"?nd(e.value):!1:nd(e)}function nd(e){return e.replace(VE,"")===""}class gi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}gi.prototype.normal={};gi.prototype.property={};gi.prototype.space=void 0;function fm(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new gi(n,r,t)}function ca(e){return e.toLowerCase()}class Je{constructor(t,n){this.attribute=n,this.property=t}}Je.prototype.attribute="";Je.prototype.booleanish=!1;Je.prototype.boolean=!1;Je.prototype.commaOrSpaceSeparated=!1;Je.prototype.commaSeparated=!1;Je.prototype.defined=!1;Je.prototype.mustUseProperty=!1;Je.prototype.number=!1;Je.prototype.overloadedBoolean=!1;Je.prototype.property="";Je.prototype.spaceSeparated=!1;Je.prototype.space=void 0;let UE=0;const te=Bn(),Ee=Bn(),ua=Bn(),V=Bn(),pe=Bn(),rr=Bn(),nt=Bn();function Bn(){return 2**++UE}const da=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Ee,commaOrSpaceSeparated:nt,commaSeparated:rr,number:V,overloadedBoolean:ua,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),po=Object.keys(da);class Dl extends Je{constructor(t,n,r,i){let s=-1;if(super(t,n),rd(this,"space",i),typeof r=="number")for(;++s<po.length;){const o=po[s];rd(this,po[s],(r&da[o])===da[o])}}}Dl.prototype.defined=!0;function rd(e,t,n){n&&(e[t]=n)}function wr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Dl(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 gi(t,n,e.space)}const hm=wr({properties:{ariaActiveDescendant:null,ariaAtomic:Ee,ariaAutoComplete:null,ariaBusy:Ee,ariaChecked:Ee,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:pe,ariaCurrent:null,ariaDescribedBy:pe,ariaDetails:null,ariaDisabled:Ee,ariaDropEffect:pe,ariaErrorMessage:null,ariaExpanded:Ee,ariaFlowTo:pe,ariaGrabbed:Ee,ariaHasPopup:null,ariaHidden:Ee,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pe,ariaLevel:V,ariaLive:null,ariaModal:Ee,ariaMultiLine:Ee,ariaMultiSelectable:Ee,ariaOrientation:null,ariaOwns:pe,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Ee,ariaReadOnly:Ee,ariaRelevant:null,ariaRequired:Ee,ariaRoleDescription:pe,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Ee,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 pm(e,t){return t in e?e[t]:t}function mm(e,t){return pm(e,t.toLowerCase())}const WE=wr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rr,acceptCharset:pe,accessKey:pe,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:pe,autoFocus:te,autoPlay:te,blocking:pe,capture:null,charSet:null,checked:te,cite:null,className:pe,cols:V,colSpan:null,content:null,contentEditable:Ee,controls:te,controlsList:pe,coords:V|rr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:ua,draggable:Ee,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:pe,height:V,hidden:ua,high:V,href:null,hrefLang:null,htmlFor:pe,httpEquiv:pe,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:pe,itemRef:pe,itemScope:te,itemType:pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:V,pattern:null,ping:pe,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:pe,required:te,reversed:te,rows:V,rowSpan:V,sandbox:pe,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Ee,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:te,useMap:null,value:Ee,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pe,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:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Ee,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:te,disableRemotePlayback:te,prefix:null,property:null,results:V,security:null,unselectable:null},space:"html",transform:mm}),HE=wr({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:nt,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:pe,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:te,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:rr,g2:rr,glyphName:rr,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:nt,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:pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nt,rev:nt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nt,requiredFeatures:nt,requiredFonts:nt,requiredFormats:nt,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:nt,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:nt,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:nt,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:pm}),gm=wr({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()}}),xm=wr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mm}),ym=wr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),qE={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"},KE=/[A-Z]/g,id=/-[a-z]/g,GE=/^data[-\w.:]+$/i;function YE(e,t){const n=ca(t);let r=t,i=Je;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&GE.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(id,JE);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!id.test(s)){let o=s.replace(KE,XE);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Dl}return new i(r,t)}function XE(e){return"-"+e.toLowerCase()}function JE(e){return e.charAt(1).toUpperCase()}const QE=fm([hm,WE,gm,xm,ym],"html"),Ml=fm([hm,HE,gm,xm,ym],"svg");function ZE(e){return e.join(" ").trim()}var Wn={},mo,sd;function eN(){if(sd)return mo;sd=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(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var v=1,w=1;function N(L){var P=L.match(t);P&&(v+=P.length);var F=L.lastIndexOf(l);w=~F?L.length-F:w+L.length}function j(){var L={line:v,column:w};return function(P){return P.position=new S(L),O(),P}}function S(L){this.start=L,this.end={line:v,column:w},this.source=y.source}S.prototype.content=b;function A(L){var P=new Error(y.source+":"+v+":"+w+": "+L);if(P.reason=L,P.filename=y.source,P.line=v,P.column=w,P.source=b,!y.silent)throw P}function T(L){var P=L.exec(b);if(P){var F=P[0];return N(F),b=b.slice(F.length),P}}function O(){T(n)}function E(L){var P;for(L=L||[];P=M();)P!==!1&&L.push(P);return L}function M(){var L=j();if(!(c!=b.charAt(0)||u!=b.charAt(1))){for(var P=2;f!=b.charAt(P)&&(u!=b.charAt(P)||c!=b.charAt(P+1));)++P;if(P+=2,f===b.charAt(P-1))return A("End of comment missing");var F=b.slice(2,P-2);return w+=2,N(F),b=b.slice(P),w+=2,L({type:h,comment:F})}}function D(){var L=j(),P=T(r);if(P){if(M(),!T(i))return A("property missing ':'");var F=T(s),_=L({type:p,property:x(P[0].replace(e,f)),value:F?x(F[0].replace(e,f)):f});return T(o),_}}function R(){var L=[];E(L);for(var P;P=D();)P!==!1&&(L.push(P),E(L));return L}return O(),R()}function x(b){return b?b.replace(a,f):f}return mo=g,mo}var od;function tN(){if(od)return Wn;od=1;var e=Wn&&Wn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.default=n;const t=e(eN());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 Wn}var Pr={},ad;function nN(){if(ad)return Pr;ad=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.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 Pr.camelCase=l,Pr}var Ar,ld;function rN(){if(ld)return Ar;ld=1;var e=Ar&&Ar.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(tN()),n=nN();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,Ar=r,Ar}var iN=rN();const sN=wa(iN),bm=vm("end"),Ol=vm("start");function vm(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 oN(e){const t=Ol(e),n=bm(e);if(t&&n)return{start:t,end:n}}function Kr(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?fa(e):""}function fa(e){return ud(e&&e.line)+":"+ud(e&&e.column)}function cd(e){return fa(e&&e.start)+"-"+fa(e&&e.end)}function ud(e){return e&&typeof e=="number"?e:1}class Ve 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=Kr(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}}Ve.prototype.file="";Ve.prototype.name="";Ve.prototype.reason="";Ve.prototype.message="";Ve.prototype.stack="";Ve.prototype.column=void 0;Ve.prototype.line=void 0;Ve.prototype.ancestors=void 0;Ve.prototype.cause=void 0;Ve.prototype.fatal=void 0;Ve.prototype.place=void 0;Ve.prototype.ruleId=void 0;Ve.prototype.source=void 0;const Il={}.hasOwnProperty,aN=new Map,lN=/[A-Z]/g,cN=new Set(["table","tbody","thead","tfoot","tr"]),uN=new Set(["td","th"]),wm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dN(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=bN(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=yN(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"?Ml:QE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=km(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function km(e,t,n){if(t.type==="element")return fN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mN(e,t,n);if(t.type==="mdxjsEsm")return pN(e,t);if(t.type==="root")return gN(e,t,n);if(t.type==="text")return xN(e,t)}function fN(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ml,e.schema=i),e.ancestors.push(t);const s=Cm(e,t.tagName,!1),o=vN(e,t);let a=Fl(e,t);return cN.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!$E(l):!0})),Sm(e,o,s,t),Ll(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function hN(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)}ii(e,t.position)}function pN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ii(e,t.position)}function mN(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ml,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Cm(e,t.name,!0),o=wN(e,t),a=Fl(e,t);return Sm(e,o,s,t),Ll(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function gN(e,t,n){const r={};return Ll(r,Fl(e,t)),e.create(t,e.Fragment,r,n)}function xN(e,t){return t.value}function Sm(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ll(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yN(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 bN(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=Ol(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 vN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Il.call(t.properties,i)){const s=kN(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&uN.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 wN(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 ii(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 ii(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Fl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:aN;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=km(e,s,o);a!==void 0&&n.push(a)}return n}function kN(e,t,n){const r=YE(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?LE(n):ZE(n)),r.property==="style"){let i=typeof n=="object"?n:SN(e,String(n));return e.stylePropertyNameCase==="css"&&(i=CN(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?qE[r.property]||r.property:r.attribute,n]}}function SN(e,t){try{return sN(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ve("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 Cm(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=td(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=td(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Il.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ii(e)}function ii(e,t){const n=new Ve("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 CN(e){const t={};let n;for(n in e)Il.call(e,n)&&(t[jN(n)]=e[n]);return t}function jN(e){let t=e.replace(lN,EN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function EN(e){return"-"+e.toLowerCase()}const go={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"]},NN={};function Bl(e,t){const n=NN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jm(e,r,i)}function jm(e,t,n){if(TN(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 dd(e.children,t,n)}return Array.isArray(e)?dd(e,t,n):""}function dd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=jm(e[i],t,n);return r.join("")}function TN(e){return!!(e&&typeof e=="object")}const fd=document.createElement("i");function zl(e){const t="&"+e+";";fd.innerHTML=t;const n=fd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function it(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 ht(e,t){return e.length>0?(it(e,e.length,0,t),e):t}const hd={}.hasOwnProperty;function Em(e){const t={};let n=-1;for(;++n<e.length;)PN(t,e[n]);return t}function PN(e,t){let n;for(n in t){const i=(hd.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){hd.call(i,o)||(i[o]=[]);const a=s[o];AN(i[o],Array.isArray(a)?a:a?[a]:[])}}}function AN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);it(e,0,0,r)}function Nm(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 St(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const We=wn(/[A-Za-z]/),ze=wn(/[\dA-Za-z]/),_N=wn(/[#-'*+\--9=?A-Z^-~]/);function cs(e){return e!==null&&(e<32||e===127)}const ha=wn(/\d/),RN=wn(/[\dA-Fa-f]/),DN=wn(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function he(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const _s=wn(new RegExp("\\p{P}|\\p{S}","u")),Mn=wn(/\s/);function wn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function kr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&ze(e.charCodeAt(n+1))&&ze(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 se(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return re(l)?(e.enter(n),a(l)):t(l)}function a(l){return re(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const MN={tokenize:ON};function ON(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"),se(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 G(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const IN={tokenize:LN},pd={tokenize:FN};function LN(e){const t=this,n=[];let r=0,i,s,o;return a;function a(w){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const N=t.events.length;let j=N,S;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){S=t.events[j][1].end;break}y(r);let A=N;for(;A<t.events.length;)t.events[A][1].end={...S},A++;return it(t.events,j+1,0,t.events.slice(N)),t.events.length=A,c(w)}return a(w)}function c(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pd,u,f)(w)}function u(w){return i&&v(),y(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(pd,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(w)}function x(w){if(w===null){b(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return G(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),x)}function b(w,N){const j=t.sliceStream(w);if(N&&j.push(null),w.previous=s,s&&(s.next=w),s=w,i.defineSkip(w.start),i.write(j),t.parser.lazy[w.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,O,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(O){E=t.events[T][1].end;break}O=!0}for(y(r),S=A;S<t.events.length;)t.events[S][1].end={...E},S++;it(t.events,T+1,0,t.events.slice(A)),t.events.length=S}}function y(w){let N=n.length;for(;N-- >w;){const j=n[N];t.containerState=j[1],j[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function FN(e,t,n){return se(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function dr(e){if(e===null||he(e)||Mn(e))return 1;if(_s(e))return 2}function Rs(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:BN,tokenize:zN};function BN(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};md(f,-l),md(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=ht(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ht(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=ht(c,Rs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ht(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=ht(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,it(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 zN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=dr(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=dr(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 md(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const VN={name:"autolink",tokenize:$N};function $N(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 We(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||ze(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||ze(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||cs(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):_N(p)?(e.consume(p),c):n(p)}function u(p){return ze(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||ze(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const xi={partial:!0,tokenize:UN};function UN(e,t,n){return r;function r(s){return re(s)?se(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||G(s)?t(s):n(s)}}const Tm={continuation:{tokenize:HN},exit:qN,name:"blockQuote",tokenize:WN};function WN(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 re(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function HN(e,t,n){const r=this;return i;function i(o){return re(o)?se(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Tm,t,n)(o)}}function qN(e){e.exit("blockQuote")}const Pm={name:"characterEscape",tokenize:KN};function KN(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 DN(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Am={name:"characterReference",tokenize:GN};function GN(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=ze,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=RN,u):(e.enter("characterReferenceValue"),s=7,o=ha,u(f))}function u(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===ze&&!zl(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 gd={partial:!0,tokenize:XN},xd={concrete:!0,name:"codeFenced",tokenize:YN};function YN(e,t,n){const r=this,i={partial:!0,tokenize:j};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"),re(S)?se(e,f,"whitespace")(S):f(S))}function f(S){return S===null||G(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(gd,x,N)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||G(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):re(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),se(e,p,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function p(S){return S===null||G(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||G(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),g)}function x(S){return e.attempt(i,N,b)(S)}function b(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return s>0&&re(S)?se(e,v,"linePrefix",s+1)(S):v(S)}function v(S){return S===null||G(S)?e.check(gd,x,N)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||G(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),w)}function N(S){return e.exit("codeFenced"),t(S)}function j(S,A,T){let O=0;return E;function E(P){return S.enter("lineEnding"),S.consume(P),S.exit("lineEnding"),M}function M(P){return S.enter("codeFencedFence"),re(P)?se(S,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):D(P)}function D(P){return P===a?(S.enter("codeFencedFenceSequence"),R(P)):T(P)}function R(P){return P===a?(O++,S.consume(P),R):O>=o?(S.exit("codeFencedFenceSequence"),re(P)?se(S,L,"whitespace")(P):L(P)):T(P)}function L(P){return P===null||G(P)?(S.exit("codeFencedFence"),A(P)):T(P)}}}function XN(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 xo={name:"codeIndented",tokenize:QN},JN={partial:!0,tokenize:ZN};function QN(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),se(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):G(c)?e.attempt(JN,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||G(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function ZN(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):se(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):G(o)?i(o):n(o)}}const eT={name:"codeText",previous:nT,resolve:tT,tokenize:rT};function tT(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 nT(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rT(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)):G(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||G(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 iT{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&&_r(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),_r(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_r(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);_r(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_r(this.left,n.reverse())}}}function _r(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 _m(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new iT(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,sT(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 it(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function sT(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,x=0;const b=[x];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&&(x=h+1,b.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),h=b.length;h--;){const y=a.slice(b[h],b[h+1]),v=s.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}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 oT={resolve:lT,tokenize:cT},aT={partial:!0,tokenize:uT};function lT(e){return _m(e),e}function cT(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):G(a)?e.check(aT,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 uT(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),se(e,s,"linePrefix")}function s(o){if(o===null||G(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 Rm(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||cs(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||G(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function x(y){return!u&&(y===null||y===41||he(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,x):y===41?(e.consume(y),u--,x):y===null||y===32||y===40||cs(y)?n(y):(e.consume(y),y===92?b:x)}function b(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function Dm(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):G(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||G(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!re(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Mm(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):G(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),se(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||G(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 Gr(e,t){let n;return r;function r(i){return G(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):re(i)?se(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const dT={name:"definition",tokenize:hT},fT={partial:!0,tokenize:pT};function hT(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return Dm.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=St(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 he(p)?Gr(e,c)(p):c(p)}function c(p){return Rm(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(fT,f,f)(p)}function f(p){return re(p)?se(e,h,"whitespace")(p):h(p)}function h(p){return p===null||G(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function pT(e,t,n){return r;function r(a){return he(a)?Gr(e,i)(a):n(a)}function i(a){return Mm(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return re(a)?se(e,o,"whitespace")(a):o(a)}function o(a){return a===null||G(a)?t(a):n(a)}}const mT={name:"hardBreakEscape",tokenize:gT};function gT(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return G(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const xT={name:"headingAtx",resolve:yT,tokenize:bT};function yT(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"},it(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function bT(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||he(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||G(u)?(e.exit("atxHeading"),t(u)):re(u)?se(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||he(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const vT=["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"],yd=["pre","script","style","textarea"],wT={concrete:!0,name:"htmlFlow",resolveTo:CT,tokenize:jT},kT={partial:!0,tokenize:NT},ST={partial:!0,tokenize:ET};function CT(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 jT(e,t,n){const r=this;let i,s,o,a,l;return c;function c(k){return u(k)}function u(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),f}function f(k){return k===33?(e.consume(k),h):k===47?(e.consume(k),s=!0,x):k===63?(e.consume(k),i=3,r.interrupt?t:C):We(k)?(e.consume(k),o=String.fromCharCode(k),b):n(k)}function h(k){return k===45?(e.consume(k),i=2,p):k===91?(e.consume(k),i=5,a=0,g):We(k)?(e.consume(k),i=4,r.interrupt?t:C):n(k)}function p(k){return k===45?(e.consume(k),r.interrupt?t:C):n(k)}function g(k){const oe="CDATA[";return k===oe.charCodeAt(a++)?(e.consume(k),a===oe.length?r.interrupt?t:D:g):n(k)}function x(k){return We(k)?(e.consume(k),o=String.fromCharCode(k),b):n(k)}function b(k){if(k===null||k===47||k===62||he(k)){const oe=k===47,qe=o.toLowerCase();return!oe&&!s&&yd.includes(qe)?(i=1,r.interrupt?t(k):D(k)):vT.includes(o.toLowerCase())?(i=6,oe?(e.consume(k),y):r.interrupt?t(k):D(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):s?v(k):w(k))}return k===45||ze(k)?(e.consume(k),o+=String.fromCharCode(k),b):n(k)}function y(k){return k===62?(e.consume(k),r.interrupt?t:D):n(k)}function v(k){return re(k)?(e.consume(k),v):E(k)}function w(k){return k===47?(e.consume(k),E):k===58||k===95||We(k)?(e.consume(k),N):re(k)?(e.consume(k),w):E(k)}function N(k){return k===45||k===46||k===58||k===95||ze(k)?(e.consume(k),N):j(k)}function j(k){return k===61?(e.consume(k),S):re(k)?(e.consume(k),j):w(k)}function S(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),l=k,A):re(k)?(e.consume(k),S):T(k)}function A(k){return k===l?(e.consume(k),l=null,O):k===null||G(k)?n(k):(e.consume(k),A)}function T(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||he(k)?j(k):(e.consume(k),T)}function O(k){return k===47||k===62||re(k)?w(k):n(k)}function E(k){return k===62?(e.consume(k),M):n(k)}function M(k){return k===null||G(k)?D(k):re(k)?(e.consume(k),M):n(k)}function D(k){return k===45&&i===2?(e.consume(k),F):k===60&&i===1?(e.consume(k),_):k===62&&i===4?(e.consume(k),B):k===63&&i===3?(e.consume(k),C):k===93&&i===5?(e.consume(k),U):G(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(kT,J,R)(k)):k===null||G(k)?(e.exit("htmlFlowData"),R(k)):(e.consume(k),D)}function R(k){return e.check(ST,L,J)(k)}function L(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),P}function P(k){return k===null||G(k)?R(k):(e.enter("htmlFlowData"),D(k))}function F(k){return k===45?(e.consume(k),C):D(k)}function _(k){return k===47?(e.consume(k),o="",H):D(k)}function H(k){if(k===62){const oe=o.toLowerCase();return yd.includes(oe)?(e.consume(k),B):D(k)}return We(k)&&o.length<8?(e.consume(k),o+=String.fromCharCode(k),H):D(k)}function U(k){return k===93?(e.consume(k),C):D(k)}function C(k){return k===62?(e.consume(k),B):k===45&&i===2?(e.consume(k),C):D(k)}function B(k){return k===null||G(k)?(e.exit("htmlFlowData"),J(k)):(e.consume(k),B)}function J(k){return e.exit("htmlFlow"),t(k)}}function ET(e,t,n){const r=this;return i;function i(o){return G(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 NT(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(xi,t,n)}}const TT={name:"htmlText",tokenize:PT};function PT(e,t,n){const r=this;let i,s,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),j):C===63?(e.consume(C),w):We(C)?(e.consume(C),T):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),s=0,g):We(C)?(e.consume(C),v):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),h):G(C)?(o=f,_(C)):(e.consume(C),f)}function h(C){return C===45?(e.consume(C),p):f(C)}function p(C){return C===62?F(C):C===45?h(C):f(C)}function g(C){const B="CDATA[";return C===B.charCodeAt(s++)?(e.consume(C),s===B.length?x:g):n(C)}function x(C){return C===null?n(C):C===93?(e.consume(C),b):G(C)?(o=x,_(C)):(e.consume(C),x)}function b(C){return C===93?(e.consume(C),y):x(C)}function y(C){return C===62?F(C):C===93?(e.consume(C),y):x(C)}function v(C){return C===null||C===62?F(C):G(C)?(o=v,_(C)):(e.consume(C),v)}function w(C){return C===null?n(C):C===63?(e.consume(C),N):G(C)?(o=w,_(C)):(e.consume(C),w)}function N(C){return C===62?F(C):w(C)}function j(C){return We(C)?(e.consume(C),S):n(C)}function S(C){return C===45||ze(C)?(e.consume(C),S):A(C)}function A(C){return G(C)?(o=A,_(C)):re(C)?(e.consume(C),A):F(C)}function T(C){return C===45||ze(C)?(e.consume(C),T):C===47||C===62||he(C)?O(C):n(C)}function O(C){return C===47?(e.consume(C),F):C===58||C===95||We(C)?(e.consume(C),E):G(C)?(o=O,_(C)):re(C)?(e.consume(C),O):F(C)}function E(C){return C===45||C===46||C===58||C===95||ze(C)?(e.consume(C),E):M(C)}function M(C){return C===61?(e.consume(C),D):G(C)?(o=M,_(C)):re(C)?(e.consume(C),M):O(C)}function D(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),i=C,R):G(C)?(o=D,_(C)):re(C)?(e.consume(C),D):(e.consume(C),L)}function R(C){return C===i?(e.consume(C),i=void 0,P):C===null?n(C):G(C)?(o=R,_(C)):(e.consume(C),R)}function L(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||he(C)?O(C):(e.consume(C),L)}function P(C){return C===47||C===62||he(C)?O(C):n(C)}function F(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function _(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),H}function H(C){return re(C)?se(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):U(C)}function U(C){return e.enter("htmlTextData"),o(C)}}const Vl={name:"labelEnd",resolveAll:DT,resolveTo:MT,tokenize:OT},AT={tokenize:IT},_T={tokenize:LT},RT={tokenize:FT};function DT(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&&it(e,0,e.length,n),e}function MT(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=ht(a,e.slice(s+1,s+r+3)),a=ht(a,[["enter",u,t]]),a=ht(a,Rs(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=ht(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=ht(a,e.slice(o+1)),a=ht(a,[["exit",l,t]]),it(e,s,e.length,a),e}function OT(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(St(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(AT,u,o?u:f)(h):h===91?e.attempt(_T,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(RT,u,f)(h)}function u(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function IT(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 he(f)?Gr(e,s)(f):s(f)}function s(f){return f===41?u(f):Rm(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return he(f)?Gr(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?Mm(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return he(f)?Gr(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 LT(e,t,n){const r=this;return i;function i(a){return Dm.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(St(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function FT(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 BT={name:"labelStartImage",resolveAll:Vl.resolveAll,tokenize:zT};function zT(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 VT={name:"labelStartLink",resolveAll:Vl.resolveAll,tokenize:$T};function $T(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 yo={name:"lineEnding",tokenize:UT};function UT(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),se(e,t,"linePrefix")}}const Ui={name:"thematicBreak",tokenize:WT};function WT(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||G(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),re(c)?se(e,a,"whitespace")(c):a(c))}}const Xe={continuation:{tokenize:GT},exit:XT,name:"list",tokenize:KT},HT={partial:!0,tokenize:JT},qT={partial:!0,tokenize:YT};function KT(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:ha(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(Ui,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 ha(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(xi,r.interrupt?n:u,e.attempt(HT,h,f))}function u(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return re(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 GT(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xi,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,se(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!re(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(qT,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,se(e,e.attempt(Xe,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function YT(e,t,n){const r=this;return se(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 XT(e){e.exit(this.containerState.type)}function JT(e,t,n){const r=this;return se(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!re(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const bd={name:"setextUnderline",resolveTo:QT,tokenize:ZT};function QT(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 ZT(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"),re(c)?se(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||G(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const eP={tokenize:tP};function tP(e){const t=this,n=e.attempt(xi,r,e.attempt(this.parser.constructs.flowInitial,i,se(e,e.attempt(this.parser.constructs.flow,i,e.attempt(oT,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 nP={resolveAll:Im()},rP=Om("string"),iP=Om("text");function Om(e){return{resolveAll:Im(e==="text"?sP: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 Im(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 sP(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 oP={42:Xe,43:Xe,45:Xe,48:Xe,49:Xe,50:Xe,51:Xe,52:Xe,53:Xe,54:Xe,55:Xe,56:Xe,57:Xe,62:Tm},aP={91:dT},lP={[-2]:xo,[-1]:xo,32:xo},cP={35:xT,42:Ui,45:[bd,Ui],60:wT,61:bd,95:Ui,96:xd,126:xd},uP={38:Am,92:Pm},dP={[-5]:yo,[-4]:yo,[-3]:yo,33:BT,38:Am,42:pa,60:[VN,TT],91:VT,92:[mT,Pm],93:Vl,95:pa,96:eT},fP={null:[pa,nP]},hP={null:[42,95]},pP={null:[]},mP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hP,contentInitial:aP,disable:pP,document:oP,flow:cP,flowInitial:lP,insideSpan:fP,string:uP,text:dP},Symbol.toStringTag,{value:"Module"}));function gP(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(j),check:A(S),consume:v,enter:w,exit:N,interrupt:A(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:x,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(M){return o=ht(o,M),b(),o[o.length-1]!==null?[]:(T(t,0),c.events=Rs(s,c.events,c),c.events)}function h(M,D){return yP(p(M),D)}function p(M){return xP(o,M)}function g(){const{_bufferIndex:M,_index:D,line:R,column:L,offset:P}=r;return{_bufferIndex:M,_index:D,line:R,column:L,offset:P}}function x(M){i[M.line]=M.column,E()}function b(){let M;for(;r._index<o.length;){const D=o[r._index];if(typeof D=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<D.length;)y(D.charCodeAt(r._bufferIndex));else y(D)}}function y(M){u=u(M)}function v(M){G(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,E()):M!==-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=M}function w(M,D){const R=D||{};return R.type=M,R.start=g(),c.events.push(["enter",R,c]),a.push(R),R}function N(M){const D=a.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function j(M,D){T(M,D.from)}function S(M,D){D.restore()}function A(M,D){return R;function R(L,P,F){let _,H,U,C;return Array.isArray(L)?J(L):"tokenize"in L?J([L]):B(L);function B(le){return mt;function mt(Qe){const gt=Qe!==null&&le[Qe],Ce=Qe!==null&&le.null,Nt=[...Array.isArray(gt)?gt:gt?[gt]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return J(Nt)(Qe)}}function J(le){return _=le,H=0,le.length===0?F:k(le[H])}function k(le){return mt;function mt(Qe){return C=O(),U=le,le.partial||(c.currentConstruct=le),le.name&&c.parser.constructs.disable.null.includes(le.name)?qe():le.tokenize.call(D?Object.assign(Object.create(c),D):c,l,oe,qe)(Qe)}}function oe(le){return M(U,C),P}function qe(le){return C.restore(),++H<_.length?k(_[H]):F}}}function T(M,D){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&it(c.events,D,c.events.length-D,M.resolve(c.events.slice(D),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function O(){const M=g(),D=c.previous,R=c.currentConstruct,L=c.events.length,P=Array.from(a);return{from:L,restore:F};function F(){r=M,c.previous=D,c.currentConstruct=R,c.events.length=L,a=P,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function xP(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 yP(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
|
-
`;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 bP(e){const r={constructs:Em([mP,...(e||{}).extensions||[]]),content:i(MN),defined:[],document:i(IN),flow:i(eP),lazy:{},string:i(rP),text:i(iP)};return r;function i(s){return o;function o(a){return gP(r,s,a)}}}function vP(e){for(;!_m(e););return e}const vd=/[\0\t\n\r]/g;function wP(){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(vd.lastIndex=f,c=vd.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 kP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function SP(e){return e.replace(kP,CP)}function CP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Nm(n.slice(s?2:1),s?16:10)}return zl(n)||e}const Lm={}.hasOwnProperty;function jP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),EP(n)(vP(bP(n).document().write(wP()(e,t,!0))))}function EP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Q),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(ye),blockQuote:s(Ce),characterEscape:O,characterReference:O,codeFenced:s(Nt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Nt,o),codeText:s(xt,o),codeTextData:O,data:O,codeFlowValue:O,definition:s(zn),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(yt),hardBreakEscape:s($e),hardBreakTrailing:s($e),htmlFlow:s(zt,o),htmlFlowData:O,htmlText:s(zt,o),htmlTextData:O,image:s(kn),label:o,link:s(Q),listItem:s(Jt),listItemValue:h,listOrdered:s(Ze,f),listUnordered:s(Ze),paragraph:s(Qt),reference:k,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(ye),strong:s(Sn),thematicBreak:s(Sr)},exit:{atxHeading:l(),atxHeadingSequence:j,autolink:l(),autolinkEmail:gt,autolinkProtocol:Qe,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:qe,characterReferenceMarkerNumeric:qe,characterReferenceValue:le,characterReference:mt,codeFenced:l(b),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:E,codeIndented:l(y),codeText:l(P),codeTextData:E,data:E,definition:l(),definitionDestinationString:N,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(R),htmlFlowData:E,htmlText:l(L),htmlTextData:E,image:l(_),label:U,labelText:H,lineEnding:M,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:C,resourceTitleString:B,resource:J,setextHeading:l(T),setextHeadingLineSequence:A,setextHeadingText:S,strong:l(),thematicBreak:l()}};Fm(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(I){let $={type:"root",children:[]};const q={stack:[$],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},Z=[];let ae=-1;for(;++ae<I.length;)if(I[ae][1].type==="listOrdered"||I[ae][1].type==="listUnordered")if(I[ae][0]==="enter")Z.push(ae);else{const ve=Z.pop();ae=i(I,ve,ae)}for(ae=-1;++ae<I.length;){const ve=t[I[ae][0]];Lm.call(ve,I[ae][1].type)&&ve[I[ae][1].type].call(Object.assign({sliceSerialize:I[ae][2].sliceSerialize},q),I[ae][1])}if(q.tokenStack.length>0){const ve=q.tokenStack[q.tokenStack.length-1];(ve[1]||wd).call(q,void 0,ve[0])}for($.position={start:on(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:on(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ae=-1;++ae<t.transforms.length;)$=t.transforms[ae]($)||$;return $}function i(I,$,q){let Z=$-1,ae=-1,ve=!1,ot,Ke,Vt,bt;for(;++Z<=q;){const Re=I[Z];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?ae++:ae--,bt=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(ot&&!bt&&!ae&&!Vt&&(Vt=Z),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!ae&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||ae===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(ot){let Tt=Z;for(Ke=void 0;Tt--;){const Ge=I[Tt];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;Ke&&(I[Ke][1].type="lineEndingBlank",ve=!0),Ge[1].type="lineEnding",Ke=Tt}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}Vt&&(!Ke||Vt<Ke)&&(ot._spread=!0),ot.end=Object.assign({},Ke?I[Ke][1].start:Re[1].end),I.splice(Ke||Z,0,["exit",ot,Re[2]]),Z++,q++}if(Re[1].type==="listItemPrefix"){const Tt={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};ot=Tt,I.splice(Z,0,["enter",Tt,Re[2]]),Z++,q++,Vt=void 0,bt=!0}}}return I[$][1]._spread=ve,q}function s(I,$){return q;function q(Z){a.call(this,I(Z),Z),$&&$.call(this,Z)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(I,$,q){this.stack[this.stack.length-1].children.push(I),this.stack.push(I),this.tokenStack.push([$,q||void 0]),I.position={start:on($.start),end:void 0}}function l(I){return $;function $(q){I&&I.call(this,q),c.call(this,q)}}function c(I,$){const q=this.stack.pop(),Z=this.tokenStack.pop();if(Z)Z[0].type!==I.type&&($?$.call(this,I,Z[0]):(Z[1]||wd).call(this,I,Z[0]));else throw new Error("Cannot close `"+I.type+"` ("+Kr({start:I.start,end:I.end})+"): it’s not open");q.position.end=on(I.end)}function u(){return Bl(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(I){if(this.data.expectingFirstListItemValue){const $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(I),10),this.data.expectingFirstListItemValue=void 0}}function p(){const I=this.resume(),$=this.stack[this.stack.length-1];$.lang=I}function g(){const I=this.resume(),$=this.stack[this.stack.length-1];$.meta=I}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I.replace(/(\r?\n|\r)$/g,"")}function v(I){const $=this.resume(),q=this.stack[this.stack.length-1];q.label=$,q.identifier=St(this.sliceSerialize(I)).toLowerCase()}function w(){const I=this.resume(),$=this.stack[this.stack.length-1];$.title=I}function N(){const I=this.resume(),$=this.stack[this.stack.length-1];$.url=I}function j(I){const $=this.stack[this.stack.length-1];if(!$.depth){const q=this.sliceSerialize(I).length;$.depth=q}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(I){const $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(I).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function O(I){const q=this.stack[this.stack.length-1].children;let Z=q[q.length-1];(!Z||Z.type!=="text")&&(Z=Cn(),Z.position={start:on(I.start),end:void 0},q.push(Z)),this.stack.push(Z)}function E(I){const $=this.stack.pop();$.value+=this.sliceSerialize(I),$.position.end=on(I.end)}function M(I){const $=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=$.children[$.children.length-1];q.position.end=on(I.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes($.type)&&(O.call(this,I),E.call(this,I))}function D(){this.data.atHardBreak=!0}function R(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I}function L(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I}function P(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I}function F(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=$,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function _(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=$,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function H(I){const $=this.sliceSerialize(I),q=this.stack[this.stack.length-2];q.label=SP($),q.identifier=St($).toLowerCase()}function U(){const I=this.stack[this.stack.length-1],$=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const Z=I.children;q.children=Z}else q.alt=$}function C(){const I=this.resume(),$=this.stack[this.stack.length-1];$.url=I}function B(){const I=this.resume(),$=this.stack[this.stack.length-1];$.title=I}function J(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function oe(I){const $=this.resume(),q=this.stack[this.stack.length-1];q.label=$,q.identifier=St(this.sliceSerialize(I)).toLowerCase(),this.data.referenceType="full"}function qe(I){this.data.characterReferenceType=I.type}function le(I){const $=this.sliceSerialize(I),q=this.data.characterReferenceType;let Z;q?(Z=Nm($,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Z=zl($);const ae=this.stack[this.stack.length-1];ae.value+=Z}function mt(I){const $=this.stack.pop();$.position.end=on(I.end)}function Qe(I){E.call(this,I);const $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(I)}function gt(I){E.call(this,I);const $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(I)}function Ce(){return{type:"blockquote",children:[]}}function Nt(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function zn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yt(){return{type:"emphasis",children:[]}}function ye(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function zt(){return{type:"html",value:""}}function kn(){return{type:"image",title:null,url:"",alt:null}}function Q(){return{type:"link",title:null,url:"",children:[]}}function Ze(I){return{type:"list",ordered:I.type==="listOrdered",start:null,spread:I._spread,children:[]}}function Jt(I){return{type:"listItem",spread:I._spread,checked:null,children:[]}}function Qt(){return{type:"paragraph",children:[]}}function Sn(){return{type:"strong",children:[]}}function Cn(){return{type:"text",value:""}}function Sr(){return{type:"thematicBreak"}}}function on(e){return{line:e.line,column:e.column,offset:e.offset}}function Fm(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Fm(e,r):NP(e,r)}}function NP(e,t){let n;for(n in t)if(Lm.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 wd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Kr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Kr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Kr({start:t.start,end:t.end})+") is still open")}function TP(e){const t=this;t.parser=n;function n(r){return jP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function PP(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 AP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
314
|
-
`}]}function _P(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 RP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=kr(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 OP(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 IP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Bm(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 LP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Bm(e,t);const i={src:kr(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 FP(e,t){const n={src:kr(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 BP(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 zP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Bm(e,t);const i={href:kr(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 VP(e,t){const n={href:kr(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 $P(e,t,n){const r=e.all(t),i=n?UP(n):zm(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
|
-
`}),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 UP(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=zm(n[r])}return t}function zm(e){const t=e.spread;return t??e.children.length>1}function WP(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 HP(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qP(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function KP(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GP(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=Ol(t.children[1]),l=bm(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 YP(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 XP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const kd=9,Sd=32;function JP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Cd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Cd(t.slice(i),i>0,!1)),s.join("")}function Cd(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===kd||s===Sd;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===kd||s===Sd;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function QP(e,t){const n={type:"text",value:JP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ZP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const eA={blockquote:PP,break:AP,code:_P,delete:RP,emphasis:DP,footnoteReference:MP,heading:OP,html:IP,imageReference:LP,image:FP,inlineCode:BP,linkReference:zP,link:VP,listItem:$P,list:WP,paragraph:HP,root:qP,strong:KP,table:GP,tableCell:XP,tableRow:YP,text:QP,thematicBreak:ZP,toml:Ti,yaml:Ti,definition:Ti,footnoteDefinition:Ti};function Ti(){}const Vm=-1,Ds=0,Yr=1,us=2,$l=3,Ul=4,Wl=5,Hl=6,$m=7,Um=8,jd=typeof self=="object"?self:globalThis,tA=(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 Ds:case Vm:return n(o,i);case Yr:{const a=n([],i);for(const l of o)a.push(r(l));return a}case us:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case $l:return n(new Date(o),i);case Ul:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Wl:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case Hl:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case $m:{const{name:a,message:l}=o;return n(new jd[a](l),i)}case Um: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 jd[s](o),i)};return r},Ed=e=>tA(new Map,e)(0),Hn="",{toString:nA}={},{keys:rA}=Object,Rr=e=>{const t=typeof e;if(t!=="object"||!e)return[Ds,t];const n=nA.call(e).slice(8,-1);switch(n){case"Array":return[Yr,Hn];case"Object":return[us,Hn];case"Date":return[$l,Hn];case"RegExp":return[Ul,Hn];case"Map":return[Wl,Hn];case"Set":return[Hl,Hn];case"DataView":return[Yr,n]}return n.includes("Array")?[Yr,n]:n.includes("Error")?[$m,n]:[us,n]},Pi=([e,t])=>e===Ds&&(t==="function"||t==="symbol"),iA=(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]=Rr(o);switch(a){case Ds:{let u=o;switch(l){case"bigint":a=Um,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Vm],o)}return i([a,u],o)}case Yr:{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 us:{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 rA(o))(e||!Pi(Rr(o[h])))&&u.push([s(h),s(o[h])]);return f}case $l:return i([a,o.toISOString()],o);case Ul:{const{source:u,flags:f}=o;return i([a,{source:u,flags:f}],o)}case Wl:{const u=[],f=i([a,u],o);for(const[h,p]of o)(e||!(Pi(Rr(h))||Pi(Rr(p))))&&u.push([s(h),s(p)]);return f}case Hl:{const u=[],f=i([a,u],o);for(const h of o)(e||!Pi(Rr(h)))&&u.push(s(h));return f}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},Nd=(e,{json:t,lossy:n}={})=>{const r=[];return iA(!(t||n),!!t,new Map,r)(e),r},ds=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ed(Nd(e,t)):structuredClone(e):(e,t)=>Ed(Nd(e,t));function sA(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 oA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||sA,r=e.options.footnoteBackLabel||oA,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=kr(f.toLowerCase());let p=0;const g=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++p<=x;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,p);typeof v=="string"&&(v={type:"text",value:v}),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(v)?v:[v]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const v=b.children[b.children.length-1];v&&v.type==="text"?v.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else u.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ds(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
318
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
319
|
-
`}]}}const Ms=(function(e){if(e==null)return dA;if(typeof e=="function")return Os(e);if(typeof e=="object")return Array.isArray(e)?lA(e):cA(e);if(typeof e=="string")return uA(e);throw new Error("Expected function, string, or object as test")});function lA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ms(e[n]);return Os(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function cA(e){const t=e;return Os(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function uA(e){return Os(t);function t(n){return n&&n.type===e}}function Os(e){return t;function t(n,r,i){return!!(fA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function dA(){return!0}function fA(e){return e!==null&&typeof e=="object"&&"type"in e}const Wm=[],hA=!0,ma=!1,pA="skip";function Hm(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Ms(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=Wm,g,x,b;if((!t||s(l,c,u[u.length-1]||void 0))&&(p=mA(n(l,u)),p[0]===ma))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==pA)for(x=(r?y.children.length:-1)+o,b=u.concat(y);x>-1&&x<y.children.length;){const v=y.children[x];if(g=a(v,x,b)(),g[0]===ma)return g;x=typeof g[1]=="number"?g[1]:x+o}}return p}}}function mA(e){return Array.isArray(e)?e:typeof e=="number"?[hA,e]:e==null?Wm:[e]}function ql(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),Hm(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 ga={}.hasOwnProperty,gA={};function xA(e,t){const n=t||gA,r=new Map,i=new Map,s=new Map,o={...eA,...n.handlers},a={all:c,applyData:bA,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:yA,wrap:wA};return ql(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(ga.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:x,...b}=u,y=ds(b);return y.children=a.all(u),y}return ds(u)}return(a.options.unknownHandler||vA)(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=Td(g.value)),!Array.isArray(g)&&g.type==="element")){const x=g.children[0];x&&x.type==="text"&&(x.value=Td(x.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function yA(e,t){e.position&&(t.position=oN(e))}function bA(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,ds(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function vA(e,t){const n=t.data||{},r="value"in t&&!(ga.call(n,"hProperties")||ga.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 wA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
320
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
321
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
322
|
-
`}),n}function Td(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Pd(e,t){const n=xA(e,t),r=n.one(e,void 0),i=aA(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 kA(e,t){return e&&"run"in e?async function(n,r){const i=Pd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Pd(n,{file:r,...e||t})}}function Ad(e){if(e)throw e}var bo,_d;function SA(){if(_d)return bo;_d=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 bo=function l(){var c,u,f,h,p,g,x=arguments[0],b=1,y=arguments.length,v=!1;for(typeof x=="boolean"&&(v=x,x=arguments[1]||{},b=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});b<y;++b)if(c=arguments[b],c!=null)for(u in c)f=a(x,u),h=a(c,u),x!==h&&(v&&h&&(s(h)||(p=i(h)))?(p?(p=!1,g=f&&i(f)?f:[]):g=f&&s(f)?f:{},o(x,{name:u,newValue:l(v,g,h)})):typeof h<"u"&&o(x,{name:u,newValue:h}));return x},bo}var CA=SA();const vo=wa(CA);function xa(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 jA(){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?EA(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 EA(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 Rt={basename:NA,dirname:TA,extname:PA,join:AA,sep:"/"};function NA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yi(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 TA(e){if(yi(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 PA(e){yi(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 AA(...e){let t=-1,n;for(;++t<e.length;)yi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_A(n)}function _A(e){yi(e);const t=e.codePointAt(0)===47;let n=RA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function RA(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 yi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const DA={cwd:MA};function MA(){return"/"}function ya(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OA(e){if(typeof e=="string")e=new URL(e);else if(!ya(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 IA(e)}function IA(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 wo=["history","path","basename","stem","extname","dirname"];class qm{constructor(t){let n;t?ya(t)?n={path:t}:typeof t=="string"||LA(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":DA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wo.length;){const s=wo[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)wo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Rt.basename(this.path):void 0}set basename(t){So(t,"basename"),ko(t,"basename"),this.path=Rt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Rt.dirname(this.path):void 0}set dirname(t){Rd(this.basename,"dirname"),this.path=Rt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Rt.extname(this.path):void 0}set extname(t){if(ko(t,"extname"),Rd(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=Rt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ya(t)&&(t=OA(t)),So(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Rt.basename(this.path,this.extname):void 0}set stem(t){So(t,"stem"),ko(t,"stem"),this.path=Rt.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 Ve(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 ko(e,t){if(e&&e.includes(Rt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Rt.sep+"`")}function So(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Rd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function LA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FA=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),BA={}.hasOwnProperty;class Kl extends FA{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=jA()}copy(){const t=new Kl;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(vo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Eo("data",this.frozen),this.namespace[t]=n,this):BA.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Eo("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=Ai(t),r=this.parser||this.Parser;return Co("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Co("process",this.parser||this.Parser),jo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Ai(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);$A(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(),Co("processSync",this.parser||this.Parser),jo("processSync",this.compiler||this.Compiler),this.process(t,i),Md("processSync","process",n),r;function i(s,o){n=!0,Ad(s),r=o}}run(t,n,r){Dd(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=Ai(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),Md("runSync","run",r),i;function s(o,a){Ad(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ai(n),i=this.compiler||this.Compiler;return jo("stringify",i),Dd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Eo("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=vo(!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 x=r[h][1];xa(x)&&xa(p)&&(p=vo(!0,x,p)),r[h]=[c,p,...g]}}}}const zA=new Kl().freeze();function Co(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function jo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Eo(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 Dd(e){if(!xa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Md(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ai(e){return VA(e)?e:new qm(e)}function VA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $A(e){return typeof e=="string"||UA(e)}function UA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Od=[],Id={allowDangerousHtml:!0},HA=/^(https?|ircs?|mailto|xmpp)$/i,qA=[{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 KA(e){const t=GA(e),n=YA(e);return XA(t.runSync(t.parse(n),n),e)}function GA(e){const t=e.rehypePlugins||Od,n=e.remarkPlugins||Od,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Id}:Id;return zA().use(TP).use(n).use(kA,r).use(t)}function YA(e){const t=e.children||"",n=new qm;return typeof t=="string"&&(n.value=t),n}function XA(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||JA;for(const u of qA)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+WA+u.id,void 0);return ql(e,c),dN(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 go)if(Object.hasOwn(go,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],x=go[p];(x===null||x.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 JA(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||HA.test(e.slice(0,t))?e:""}function Ld(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 QA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ZA(e,t,n){const i=Ms((n||{}).ignore||[]),s=e2(t);let o=-1;for(;++o<s.length;)Hm(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 b=f.children.indexOf(c);let y=!1,v=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const N=w.index,j={index:w.index,input:w.input,stack:[...u,c]};let S=p(...w,j);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=N+1:(g!==N&&v.push({type:"text",value:c.value.slice(g,N)}),Array.isArray(S)?v.push(...S):S&&v.push(S),g=N+w[0].length,y=!0),!h.global)break;w=h.exec(c.value)}return y?(g<c.value.length&&v.push({type:"text",value:c.value.slice(g)}),f.children.splice(b,1,...v)):v=[c],b+v.length}}function e2(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([t2(i[0]),n2(i[1])])}return t}function t2(e){return typeof e=="string"?new RegExp(QA(e),"g"):e}function n2(e){return typeof e=="function"?e:function(){return e}}const No="phrasing",To=["autolink","link","image","label"];function r2(){return{transforms:[u2],enter:{literalAutolink:s2,literalAutolinkEmail:Po,literalAutolinkHttp:Po,literalAutolinkWww:Po},exit:{literalAutolink:c2,literalAutolinkEmail:l2,literalAutolinkHttp:o2,literalAutolinkWww:a2}}}function i2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:No,notInConstruct:To},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:No,notInConstruct:To},{character:":",before:"[ps]",after:"\\/",inConstruct:No,notInConstruct:To}]}}function s2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Po(e){this.config.enter.autolinkProtocol.call(this,e)}function o2(e){this.config.exit.autolinkProtocol.call(this,e)}function a2(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 l2(e){this.config.exit.autolinkEmail.call(this,e)}function c2(e){this.exit(e)}function u2(e){ZA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,d2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),f2]],{ignore:["link","linkReference"]})}function d2(e,t,n,r,i){let s="";if(!Km(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!h2(n)))return!1;const o=p2(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 f2(e,t,n,r){return!Km(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function h2(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 p2(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=Ld(e,"(");let s=Ld(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 Km(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Mn(n)||_s(n))&&(!t||n!==47)}Gm.peek=S2;function m2(){this.buffer()}function g2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function x2(){this.buffer()}function y2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function b2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=St(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v2(e){this.exit(e)}function w2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=St(this.sliceSerialize(e)).toLowerCase(),n.label=t}function k2(e){this.exit(e)}function S2(){return"["}function Gm(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 C2(){return{enter:{gfmFootnoteCallString:m2,gfmFootnoteCall:g2,gfmFootnoteDefinitionLabelString:x2,gfmFootnoteDefinition:y2},exit:{gfmFootnoteCallString:b2,gfmFootnoteCall:v2,gfmFootnoteDefinitionLabelString:w2,gfmFootnoteDefinition:k2}}}function j2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gm},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?Ym:E2))),c(),l}}function E2(e,t,n){return t===0?e:Ym(e,t,n)}function Ym(e,t,n){return(n?"":" ")+e}const N2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xm.peek=R2;function T2(){return{canContainEols:["delete"],enter:{strikethrough:A2},exit:{strikethrough:_2}}}function P2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:N2}],handlers:{delete:Xm}}}function A2(e){this.enter({type:"delete",children:[]},e)}function _2(e){this.exit(e)}function Xm(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 R2(){return"~"}function D2(e){return e.length}function M2(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||D2,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const x=[],b=[];let y=-1;for(e[u].length>c&&(c=e[u].length);++y<e[u].length;){const v=O2(e[u][y]);if(n.alignDelimiters!==!1){const w=i(v);b[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}x.push(v)}o[u]=x,a[u]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)s[f]=Fd(r[f]);else{const x=Fd(r);for(;++f<c;)s[f]=x}f=-1;const h=[],p=[];for(;++f<c;){const x=s[f];let b="",y="";x===99?(b=":",y=":"):x===108?b=":":x===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[f]-b.length-y.length);const w=b+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=b.length+v+y.length,v>l[f]&&(l[f]=v),p[f]=v),h[f]=w}o.splice(1,0,h),a.splice(1,0,p),u=-1;const g=[];for(;++u<o.length;){const x=o[u],b=a[u];f=-1;const y=[];for(;++f<c;){const v=x[f]||"";let w="",N="";if(n.alignDelimiters!==!1){const j=l[f]-(b[f]||0),S=s[f];S===114?w=" ".repeat(j):S===99?j%2?(w=" ".repeat(j/2+.5),N=" ".repeat(j/2-.5)):(w=" ".repeat(j/2),N=w):N=" ".repeat(j)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(v),n.alignDelimiters!==!1&&y.push(N),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
|
|
325
|
-
`)}function O2(e){return e==null?"":String(e)}function Fd(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 I2(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()),L2);return i(),o}function L2(e,t,n){return">"+(n?"":" ")+e}function F2(e,t){return Bd(e,t.inConstruct,!0)&&!Bd(e,t.notInConstruct,!1)}function Bd(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 zd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
326
|
-
`&&F2(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
327
|
-
`}function B2(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 z2(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 V2(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 $2(e,t,n,r){const i=V2(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(z2(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,U2);return f(),h}const a=n.createTracker(r),l=i.repeat(Math.max(B2(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
|
-
`,encode:["`"],...a.current()})),f()}return u+=a.move(`
|
|
329
|
-
`),s&&(u+=a.move(s+`
|
|
330
|
-
`)),u+=a.move(l),c(),u}function U2(e,t,n){return(n?"":" ")+e}function Gl(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 W2(e,t,n,r){const i=Gl(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 H2(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 si(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fs(e,t,n){const r=dr(e),i=dr(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}}Jm.peek=q2;function Jm(e,t,n,r){const i=H2(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=fs(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=si(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=fs(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+si(f));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function q2(e,t,n){return n.options.emphasis||"*"}function K2(e,t){let n=!1;return ql(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ma}),!!((!e.depth||e.depth<3)&&Bl(e)&&(t.options.setext||n))}function G2(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(K2(e,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
332
|
-
`,after:`
|
|
333
|
-
`});return f(),u(),h+`
|
|
334
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
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=si(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}Qm.peek=Y2;function Qm(e){return e.value||""}function Y2(){return"<"}Zm.peek=X2;function Zm(e,t,n,r){const i=Gl(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 X2(){return"!"}eg.peek=J2;function eg(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 J2(){return"!"}tg.peek=Q2;function tg(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 Q2(){return"`"}function ng(e,t){const n=Bl(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))}rg.peek=Z2;function rg(e,t,n,r){const i=Gl(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(ng(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 Z2(e,t,n){return ng(e,n)?"<":"["}ig.peek=e_;function ig(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 e_(){return"["}function Yl(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 t_(e){const t=Yl(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 n_(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 sg(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 r_(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?n_(n):Yl(n);const a=e.ordered?o==="."?")":".":t_(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),sg(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 i_(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 s_(e,t,n,r){const i=i_(n);let s=n.bulletCurrent||Yl(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 o_(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const a_=Ms(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function l_(e,t,n,r){return(e.children.some(function(o){return a_(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function c_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}og.peek=u_;function og(e,t,n,r){const i=c_(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=fs(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=si(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=fs(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+si(f));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function u_(e,t,n){return n.options.strong||"*"}function d_(e,t,n,r){return n.safe(e.value,r)}function f_(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 h_(e,t,n){const r=(sg(n)+(n.options.ruleSpaces?" ":"")).repeat(f_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ag={blockquote:I2,break:zd,code:$2,definition:W2,emphasis:Jm,hardBreak:zd,heading:G2,html:Qm,image:Zm,imageReference:eg,inlineCode:tg,link:rg,linkReference:ig,list:r_,listItem:s_,paragraph:o_,root:l_,strong:og,text:d_,thematicBreak:h_};function p_(){return{enter:{table:m_,tableData:Vd,tableHeader:Vd,tableRow:x_},exit:{codeText:y_,table:g_,tableData:Ao,tableHeader:Ao,tableRow:Ao}}}function m_(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 g_(e){this.exit(e),this.data.inTable=void 0}function x_(e){this.enter({type:"tableRow",children:[]},e)}function Ao(e){this.exit(e)}function Vd(e){this.enter({type:"tableCell",children:[]},e)}function y_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,b_));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function b_(e,t){return t==="|"?t:e}function v_(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
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,x,b){return c(u(p,x,b),p.align)}function a(p,g,x,b){const y=f(p,x,b),v=c([y]);return v.slice(0,v.indexOf(`
|
|
338
|
-
`))}function l(p,g,x,b){const y=x.enter("tableCell"),v=x.enter("phrasing"),w=x.containerPhrasing(p,{...b,before:s,after:s});return v(),y(),w}function c(p,g){return M2(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,x){const b=p.children;let y=-1;const v=[],w=g.enter("table");for(;++y<b.length;)v[y]=f(b[y],g,x);return w(),v}function f(p,g,x){const b=p.children;let y=-1;const v=[],w=g.enter("tableRow");for(;++y<b.length;)v[y]=l(b[y],p,g,x);return w(),v}function h(p,g,x){let b=ag.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function w_(){return{exit:{taskListCheckValueChecked:$d,taskListCheckValueUnchecked:$d,paragraph:S_}}}function k_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:C_}}}function $d(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function S_(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 C_(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 j_(){return[r2(),C2(),T2(),p_(),w_()]}function E_(e){return{extensions:[i2(),j2(e),P2(),v_(e),k_()]}}const N_={tokenize:D_,partial:!0},lg={tokenize:M_,partial:!0},cg={tokenize:O_,partial:!0},ug={tokenize:I_,partial:!0},T_={tokenize:L_,partial:!0},dg={name:"wwwAutolink",tokenize:__,previous:hg},fg={name:"protocolAutolink",tokenize:R_,previous:pg},Xt={name:"emailAutolink",tokenize:A_,previous:mg},Bt={};function P_(){return{text:Bt}}let En=48;for(;En<123;)Bt[En]=Xt,En++,En===58?En=65:En===91&&(En=97);Bt[43]=Xt;Bt[45]=Xt;Bt[46]=Xt;Bt[95]=Xt;Bt[72]=[Xt,fg];Bt[104]=[Xt,fg];Bt[87]=[Xt,dg];Bt[119]=[Xt,dg];function A_(e,t,n){const r=this;let i,s;return o;function o(f){return!ba(f)||!mg.call(r,r.previous)||Xl(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return ba(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(T_,u,c)(f):f===45||f===95||ze(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&&We(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function __(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!hg.call(r,r.previous)||Xl(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(N_,e.attempt(lg,e.attempt(cg,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function R_(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&pg.call(r,r.previous)&&!Xl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(We(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||cs(f)||he(f)||Mn(f)||_s(f)?n(f):e.attempt(lg,e.attempt(cg,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function D_(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 M_(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(ug,l,a)(c):c===null||he(c)||Mn(c)||c!==45&&_s(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 O_(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(ug,t,s)(o):o===null||he(o)||Mn(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function I_(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||he(a)||Mn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||he(a)||Mn(a)?t(a):r(a)}function s(a){return We(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):We(a)?(e.consume(a),o):n(a)}}function L_(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return ze(s)?n(s):t(s)}}function hg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||he(e)}function pg(e){return!We(e)}function mg(e){return!(e===47||ba(e))}function ba(e){return e===43||e===45||e===46||e===95||ze(e)}function Xl(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 F_={tokenize:q_,partial:!0};function B_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:U_,continuation:{tokenize:W_},exit:H_}},text:{91:{name:"gfmFootnoteCall",tokenize:$_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:z_,resolveTo:V_}}}}function z_(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=St(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 V_(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 $_(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||he(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(St(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return he(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 U_(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||he(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return s=St(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return he(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),se(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function W_(e,t,n){return e.check(xi,t,e.attempt(F_,t,n))}function H_(e){e.exit("gfmFootnoteDefinition")}function q_(e,t,n){const r=this;return se(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 K_(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&&it(h,h.length,0,Rs(p,o.slice(c+1,l),a)),it(h,h.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),it(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 x=dr(c);if(g===126)return f>1?l(g):(o.consume(g),f++,p);if(f<2&&!n)return l(g);const b=o.exit("strikethroughSequenceTemporary"),y=dr(g);return b._open=!y||y===2&&!!x,b._close=!x||x===2&&!!y,a(g)}}}class G_{constructor(){this.map=[]}add(t,n,r){Y_(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 Y_(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 X_(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 J_(){return{flow:{null:{name:"table",tokenize:Q_,resolveAll:Z_}}}}function Q_(e,t,n){const r=this;let i=0,s=0,o;return a;function a(E){let M=r.events.length-1;for(;M>-1;){const L=r.events[M][1].type;if(L==="lineEnding"||L==="linePrefix")M--;else break}const D=M>-1?r.events[M][1].type:null,R=D==="tableHead"||D==="tableRow"?S:l;return R===S&&r.parser.lazy[r.now().line]?n(E):R(E)}function l(E){return e.enter("tableHead"),e.enter("tableRow"),c(E)}function c(E){return E===124||(o=!0,s+=1),u(E)}function u(E){return E===null?n(E):G(E)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):n(E):re(E)?se(e,u,"whitespace")(E):(s+=1,o&&(o=!1,i+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),f(E)))}function f(E){return E===null||E===124||he(E)?(e.exit("data"),u(E)):(e.consume(E),E===92?h:f)}function h(E){return E===92||E===124?(e.consume(E),f):f(E)}function p(E){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(E):(e.enter("tableDelimiterRow"),o=!1,re(E)?se(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?b(E):E===124?(o=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),x):j(E)}function x(E){return re(E)?se(e,b,"whitespace")(E):b(E)}function b(E){return E===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),y):E===45?(s+=1,y(E)):E===null||G(E)?N(E):j(E)}function y(E){return E===45?(e.enter("tableDelimiterFiller"),v(E)):j(E)}function v(E){return E===45?(e.consume(E),v):E===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(E))}function w(E){return re(E)?se(e,N,"whitespace")(E):N(E)}function N(E){return E===124?g(E):E===null||G(E)?!o||i!==s?j(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):j(E)}function j(E){return n(E)}function S(E){return e.enter("tableRow"),A(E)}function A(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),A):E===null||G(E)?(e.exit("tableRow"),t(E)):re(E)?se(e,A,"whitespace")(E):(e.enter("data"),T(E))}function T(E){return E===null||E===124||he(E)?(e.exit("data"),A(E)):(e.consume(E),E===92?O:T)}function O(E){return E===92||E===124?(e.consume(E),T):T(E)}}function Z_(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 G_;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(Ud(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=_i(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=_i(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=_i(h,t,s,i,n,f)):o[1]!==0&&(f=_i(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Ud(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=X_(t.events,n))}return e}function _i(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Kn(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Kn(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=Kn(t.events,n[2]),u=Kn(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,x=n[3]-n[2]-1;e.add(g,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},Kn(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Ud(e,t,n,r,i){const s=[],o=Kn(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 Kn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const eR={name:"tasklistCheck",tokenize:nR};function tR(){return{text:{91:eR}}}function nR(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 he(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 G(l)?t(l):re(l)?e.check({tokenize:rR},t,n)(l):n(l)}}function rR(e,t,n){return se(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function iR(e){return Em([P_(),B_(),K_(e),J_(),tR()])}const sR={};function oR(e){const t=this,n=e||sR,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(iR(n)),s.push(j_()),o.push(E_(n))}function gg({content:e,className:t}){return d.jsx("div",{className:z("space-y-4 text-[13px] leading-[1.7]",t),children:d.jsx(KA,{remarkPlugins:[oR],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:z("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 xg=6048e5,aR=864e5,zM=43200,VM=1440,Wd=Symbol.for("constructDateFrom");function mn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Wd in e?e[Wd](t):e instanceof Date?new e.constructor(t):new Date(t)}function Et(e,t){return mn(t||e,e)}let lR={};function Is(){return lR}function oi(e,t){var a,l,c,u;const n=Is(),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=Et(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 hs(e,t){return oi(e,{...t,weekStartsOn:1})}function yg(e,t){const n=Et(e,t==null?void 0:t.in),r=n.getFullYear(),i=mn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=hs(i),o=mn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=hs(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Hd(e){const t=Et(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 cR(e,...t){const n=mn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function qd(e,t){const n=Et(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function uR(e,t,n){const[r,i]=cR(n==null?void 0:n.in,e,t),s=qd(r),o=qd(i),a=+s-Hd(s),l=+o-Hd(o);return Math.round((a-l)/aR)}function dR(e,t){const n=yg(e,t),r=mn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),hs(r)}function fR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hR(e){return!(!fR(e)&&typeof e!="number"||isNaN(+Et(e)))}function pR(e,t){const n=Et(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const mR={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"}},gR=(e,t,n)=>{let r;const i=mR[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 _o(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const xR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vR={date:_o({formats:xR,defaultWidth:"full"}),time:_o({formats:yR,defaultWidth:"full"}),dateTime:_o({formats:bR,defaultWidth:"full"})},wR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kR=(e,t,n,r)=>wR[e];function Dr(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 SR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jR={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"]},ER={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"]},NR={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"}},TR={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"}},PR=(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"},AR={ordinalNumber:PR,era:Dr({values:SR,defaultWidth:"wide"}),quarter:Dr({values:CR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Dr({values:jR,defaultWidth:"wide"}),day:Dr({values:ER,defaultWidth:"wide"}),dayPeriod:Dr({values:NR,defaultWidth:"wide",formattingValues:TR,defaultFormattingWidth:"wide"})};function Mr(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)?RR(a,f=>f.test(o)):_R(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 _R(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function RR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function DR(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 MR=/^(\d+)(th|st|nd|rd)?/i,OR=/\d+/i,IR={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},LR={any:[/^b/i,/^(a|c)/i]},FR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BR={any:[/1/i,/2/i,/3/i,/4/i]},zR={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},VR={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]},$R={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},UR={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]},WR={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},HR={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}},qR={ordinalNumber:DR({matchPattern:MR,parsePattern:OR,valueCallback:e=>parseInt(e,10)}),era:Mr({matchPatterns:IR,defaultMatchWidth:"wide",parsePatterns:LR,defaultParseWidth:"any"}),quarter:Mr({matchPatterns:FR,defaultMatchWidth:"wide",parsePatterns:BR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mr({matchPatterns:zR,defaultMatchWidth:"wide",parsePatterns:VR,defaultParseWidth:"any"}),day:Mr({matchPatterns:$R,defaultMatchWidth:"wide",parsePatterns:UR,defaultParseWidth:"any"}),dayPeriod:Mr({matchPatterns:WR,defaultMatchWidth:"any",parsePatterns:HR,defaultParseWidth:"any"})},KR={code:"en-US",formatDistance:gR,formatLong:vR,formatRelative:kR,localize:AR,match:qR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function GR(e,t){const n=Et(e,t==null?void 0:t.in);return uR(n,pR(n))+1}function YR(e,t){const n=Et(e,t==null?void 0:t.in),r=+hs(n)-+dR(n);return Math.round(r/xg)+1}function bg(e,t){var u,f,h,p;const n=Et(e,t==null?void 0:t.in),r=n.getFullYear(),i=Is(),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=mn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=oi(o,t),l=mn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=oi(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function XR(e,t){var a,l,c,u;const n=Is(),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=bg(e,t),s=mn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),oi(s,t)}function JR(e,t){const n=Et(e,t==null?void 0:t.in),r=+oi(n,t)-+XR(n,t);return Math.round(r/xg)+1}function ue(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const an={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ue(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ue(n+1,2)},d(e,t){return ue(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 ue(e.getHours()%12||12,t.length)},H(e,t){return ue(e.getHours(),t.length)},m(e,t){return ue(e.getMinutes(),t.length)},s(e,t){return ue(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ue(i,t.length)}},qn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kd={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 an.y(e,t)},Y:function(e,t,n,r){const i=bg(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return ue(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ue(s,t.length)},R:function(e,t){const n=yg(e);return ue(n,t.length)},u:function(e,t){const n=e.getFullYear();return ue(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 ue(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 ue(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 an.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 ue(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=JR(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ue(i,t.length)},I:function(e,t,n){const r=YR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ue(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):an.d(e,t)},D:function(e,t,n){const r=GR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ue(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 ue(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 ue(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 ue(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=qn.noon:r===0?i=qn.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=qn.evening:r>=12?i=qn.afternoon:r>=4?i=qn.morning:i=qn.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 an.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):an.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ue(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ue(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):an.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):an.s(e,t)},S:function(e,t){return an.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Yd(r);case"XXXX":case"XX":return Pn(r);case"XXXXX":case"XXX":default:return Pn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Yd(r);case"xxxx":case"xx":return Pn(r);case"xxxxx":case"xxx":default:return Pn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Gd(r,":");case"OOOO":default:return"GMT"+Pn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Gd(r,":");case"zzzz":default:return"GMT"+Pn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ue(r,t.length)},T:function(e,t,n){return ue(+e,t.length)}};function Gd(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+ue(s,2)}function Yd(e,t){return e%60===0?(e>0?"-":"+")+ue(Math.abs(e)/60,2):Pn(e,t)}function Pn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ue(Math.trunc(r/60),2),s=ue(r%60,2);return n+i+t+s}const Xd=(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"})}},vg=(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"})}},QR=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Xd(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}}",Xd(r,t)).replace("{{time}}",vg(i,t))},ZR={p:vg,P:QR},eD=/^D+$/,tD=/^Y+$/,nD=["D","DD","YY","YYYY"];function rD(e){return eD.test(e)}function iD(e){return tD.test(e)}function sD(e,t,n){const r=oD(e,t,n);if(console.warn(r),nD.includes(e))throw new RangeError(r)}function oD(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 aD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cD=/^'([^]*?)'?$/,uD=/''/g,dD=/[a-zA-Z]/;function Ri(e,t,n){var u,f,h,p;const r=Is(),i=r.locale??KR,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=Et(e,n==null?void 0:n.in);if(!hR(a))throw new RangeError("Invalid time value");let l=t.match(lD).map(g=>{const x=g[0];if(x==="p"||x==="P"){const b=ZR[x];return b(g,i.formatLong)}return g}).join("").match(aD).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const x=g[0];if(x==="'")return{isToken:!1,value:fD(g)};if(Kd[x])return{isToken:!0,value:g};if(x.match(dD))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");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 x=g.value;(iD(x)||rD(x))&&sD(x,t,String(e));const b=Kd[x[0]];return b(a,x,i.localize,c)}).join("")}function fD(e){const t=e.match(cD);return t?t[1].replace(uD,"'"):e}const hD={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 Di(e){return e?hD[e]??e:null}function pD({sessions:e,loading:t}){const n=Lt(),[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 x=await fetch(n(`/sessions/${g.id}/content`));x.ok&&o(await x.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:[],x=Array.isArray(r.next_steps)?r.next_steps:[],b=!!r.claude_session_id,y=(s==null?void 0:s.meta)??null,v=(y==null?void 0:y.summary)??r.summary??null,w=v?Jd(v,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(de,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{i(null),o(null)},children:d.jsx(sb,{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&&Ri(new Date(r.started_at),"MMM d, yyyy")}),d.jsx("p",{className:"truncate text-sm font-light",children:w||"Untitled Session"})]})]}),d.jsx(ls,{className:"mb-3"}),d.jsx(ir,{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})]}),Di(r.action)&&d.jsxs("tr",{children:[d.jsx("td",{children:"Action"}),d.jsx("td",{children:Di(r.action)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Summary"}),d.jsx("td",{children:r.summary?Jd(r.summary,200):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Started"}),d.jsx("td",{children:r.started_at?Ri(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?Ri(new Date(r.ended_at),"MMM d, h:mm a"):"—"})]}),y&&d.jsxs(d.Fragment,{children:[y.branch&&y.branch!=="unknown"&&d.jsxs("tr",{children:[d.jsx("td",{children:"Branch"}),d.jsx("td",{className:"font-mono text-xxs",children:y.branch})]}),y.fileSize>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"File size"}),d.jsx("td",{children:mD(y.fileSize)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Plan"}),d.jsx("td",{className:"text-muted-foreground",children:y.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(N=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-bid-green mr-1",children:"•"}),N]},N))})})]}),x.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:x.map(N=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-accent-blue mr-1",children:"•"}),N]},N))})})]}),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(de,{className:"w-full",disabled:!b||c,onClick:p,title:b?"Open in iTerm":"No Claude Code session found",children:[d.jsx(Ra,{className:"mr-2 h-4 w-4"}),c?"Opening iTerm...":"Resume Session"]}),!b&&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(_e,{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(ir,{className:"flex-1 -mr-2 pr-2",children:d.jsx("div",{className:"space-y-2",children:e.map(g=>{const x=Array.isArray(g.discoveries)?g.discoveries:[],b=Array.isArray(g.next_steps)?g.next_steps:[];return d.jsx(_l,{className:z("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(Rl,{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&&Ri(new Date(g.started_at),"MMM d")}),Di(g.action)&&d.jsx(_e,{variant:"outline",className:"text-xxs px-1 py-0 font-light",children:Di(g.action)})]}),d.jsx(Xr,{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:[x.length>0&&d.jsxs("span",{className:"text-bid-green",children:[x.length," completed"]}),b.length>0&&d.jsxs("span",{className:"text-accent-blue",children:[b.length," next"]}),g.claude_session_id&&d.jsx("span",{className:"text-primary/70",children:"resumable"})]})]})},g.id)})})})]})}function Jd(e,t){return e.length>t?e.slice(0,t)+"...":e}function mD(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function gD({title:e,defaultOpen:t=!0,badge:n,children:r,className:i}){const[s,o]=m.useState(t);return d.jsxs("div",{className:z("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(Xr,{className:z("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 dn({content:e}){return d.jsx(gg,{content:e,className:"section-markdown"})}function xD({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:z("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(gb,{className:"h-3 w-3 shrink-0 text-bid-green"}):s?d.jsx(Aa,{className:"h-3 w-3 shrink-0 text-accent-blue animate-spin"}):d.jsx(vb,{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:z("flex-1",r.done?"text-muted-foreground":"text-foreground/80"),children:r.description})]},i)})}),t.split(`
|
|
339
|
-
`).some(r=>r.trim()&&!/^\|/.test(r.trim()))&&d.jsx("div",{className:"pt-1",children:d.jsx(dn,{content:t.split(`
|
|
340
|
-
`).filter(r=>!r.trim().startsWith("|")).join(`
|
|
341
|
-
`).trim()})})]})}function yD({meta:e,content:t}){const n=[];let r=null,i=0;for(const s of t.split(`
|
|
342
|
-
`)){const o=s.match(/^####\s+(.+)/);if(o){r=o[1].trim();continue}if(s.match(/^[\s]*-\s+\[([ xX])\]\s+(.*)/)){const c=e.items[i];if(c){const u=n[n.length-1];!u||u.heading!==r?n.push({heading:r,items:[{text:c.text,checked:c.checked}]}):u.items.push({text:c.text,checked:c.checked}),i++}continue}const l=s.match(/^[\s]*-\s+(.+)/);if(l){const c=n[n.length-1],u={text:l[1].trim(),checked:null};!c||c.heading!==r?n.push({heading:r,items:[u]}):c.items.push(u)}}return n.length===0&&e.items.length>0&&n.push({heading:null,items:e.items.map(s=>({text:s.text,checked:s.checked}))}),d.jsx("div",{className:"space-y-3",children:n.map((s,o)=>d.jsxs("div",{children:[s.heading&&d.jsx("p",{className:"mb-1.5 text-xxs font-medium uppercase tracking-wide text-muted-foreground/70",children:s.heading}),d.jsx("div",{className:"space-y-0.5",children:s.items.map((a,l)=>d.jsxs("div",{className:z("flex items-start gap-2 rounded px-1 py-0.5 text-xxs",a.checked===!0&&"opacity-50"),children:[a.checked===!0?d.jsx(g0,{className:"mt-0.5 h-3 w-3 shrink-0 text-bid-green"}):a.checked===!1?d.jsx(y0,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/40"}):d.jsx(yb,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/30"}),d.jsx("span",{className:z("text-foreground/80",a.checked===!0&&"line-through text-muted-foreground",a.checked===null&&"text-muted-foreground"),children:a.text})]},l))})]},o))})}function bD({content:e}){const t=e.replace(/^>\s*/gm,"").replace(/\n/g," ").trim(),n=t.split("|").map(i=>i.trim()).filter(Boolean),r=[];for(const i of n){const s=i.match(/\*\*(.+?)\*\*[:\s]*(.+)/);s&&r.push({label:s[1].trim(),value:s[2].trim()})}return r.length===0?d.jsx("p",{className:"text-xxs text-muted-foreground",children:t}):d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r.map(({label:i,value:s})=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xxs text-muted-foreground",children:i}),d.jsx(_e,{variant:"outline",className:"h-5 px-1.5 text-xxs",children:s})]},i))})}function vD({meta:e,content:t}){return d.jsxs("div",{className:"space-y-3",children:[e&&d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.verdict&&d.jsx(_e,{variant:"outline",className:e.verdict.toUpperCase()==="PASS"?"border-bid-green/40 bg-bid-green/10 text-bid-green":"border-ask-red/40 bg-ask-red/10 text-ask-red",children:e.verdict}),e.blockers>0&&d.jsxs(_e,{variant:"outline",className:"border-ask-red/40 bg-ask-red/10 text-ask-red",children:[e.blockers," blocker",e.blockers!==1?"s":""]}),e.warnings>0&&d.jsxs(_e,{variant:"outline",className:"border-warning-amber/40 bg-warning-amber/10 text-warning-amber",children:[e.warnings," warning",e.warnings!==1?"s":""]}),e.suggestions>0&&d.jsxs(_e,{variant:"outline",className:"border-accent-blue/40 bg-accent-blue/10 text-accent-blue",children:[e.suggestions," suggestion",e.suggestions!==1?"s":""]})]}),d.jsx(dn,{content:t})]})}function wD({content:e}){const t=e.split(`
|
|
343
|
-
`).filter(o=>o.trim().startsWith("|"));if(t.length<2)return d.jsx(dn,{content:e});const n=o=>o.split("|").map(a=>a.trim()).filter(Boolean),r=n(t[0]),i=t.slice(2).map(n);if(r.length===0)return d.jsx(dn,{content:e});const s=e.split(`
|
|
344
|
-
`).filter(o=>!o.trim().startsWith("|")).join(`
|
|
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(dn,{content:s})]})}function kD({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(_e,{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 SD({section:e}){var t,n,r;switch(e.type){case"quick-status":return d.jsx(bD,{content:e.content});case"progress":return((t=e.meta)==null?void 0:t.kind)==="progress"?d.jsx(xD,{meta:e.meta,content:e.content}):d.jsx(dn,{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(yD,{meta:e.meta,content:e.content}):d.jsx(dn,{content:e.content});case"files-summary":case"risks":return d.jsx(wD,{content:e.content});case"agent-review":return d.jsx(vD,{meta:((r=e.meta)==null?void 0:r.kind)==="review"?e.meta:void 0,content:e.content});default:return d.jsx(dn,{content:e.content})}}function CD({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(gD,{title:i.title,defaultOpen:!i.defaultCollapsed,badge:d.jsx(kD,{section:i}),children:d.jsx(SD,{section:i})},i.id))]},n.part))})}const jD={"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"},ED={"exploration log":"exploration","decisions & reasoning":"decisions",decisions:"decisions","implementation log":"implementation-log","deviations from spec":"deviations",deviations:"deviations"},ND=new Set(["Process","Agent Review"]),TD=/^[═=]{10,}\s*$/,PD=/^##\s+(?:PART\s+\d+:\s*)?(.+)/i;function AD(e){return e.replace(/<!--[\s\S]*?-->/g,"").trim()}function _D(e){const t=e.split(`
|
|
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 RD(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 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 kg(e,t){switch(e){case"progress":return _D(t);case"requirements":case"success-criteria":case"definition-of-done":case"next-actions":return RD(t);case"agent-review":return wg(t);default:return}}function DD(e){const t=e.toLowerCase().trim();for(const[n,r]of Object.entries(jD))if(t.includes(n))return r;return"unknown"}function MD(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(ED))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:kg(l,o)})}return n}function Ro(e,t){const n=[],r=e.split(`
|
|
349
|
-
`);let i=null,s=[];const o=ND.has(t);function a(){if(i===null)return;const l=s.join(`
|
|
350
|
-
`).trim();if(!l)return;const c=AD(l);if(!c)return;const u=DD(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:kg(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 OD(e){if(!e)return null;const t=e.split(`
|
|
351
|
-
`),n=[];for(let s=0;s<t.length;s++)TD.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=PD.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
|
-
`);if(s.name==="Process"){const a=MD(o,s.name);a.length>0?i.push(...a):i.push(...Ro(o,s.name))}else if(s.name==="Agent Review"){const a=Ro(o,s.name);if(a.length>0){const l=a.map(u=>u.content).join(`
|
|
353
|
-
|
|
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(...Ro(o,s.name))}return i.length>0?i:null}function ID(e){const[t,n]=m.useState([]),[r,i]=m.useState(!1),s=Lt(),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 K.on("session:updated",a),()=>{K.off("session:updated",a)}},[o]),{sessions:t,loading:r}}const Mi="h-7 w-full rounded border border-border bg-muted/30 px-2 text-xxs text-foreground/80 focus:outline-none focus:ring-1 focus:ring-primary/50",Gn="text-xxs font-medium uppercase tracking-wide text-muted-foreground/70 mb-1";function LD(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 FD(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 Qd({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:Gn,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 bg-muted px-1.5 py-0.5 text-xxs text-foreground/70",children:[pt(l),d.jsx("button",{onClick:()=>n(l),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(Ct,{className:"h-2.5 w-2.5"})})]},l)),i?d.jsx("input",{autoFocus:!0,className:"h-5 w-12 rounded bg-muted/50 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(Hi,{className:"h-3 w-3"})}),t.length===0&&!i&&d.jsx("span",{className:"text-xxs text-muted-foreground/50",children:"None"})]})]})}function BD({scope:e,open:t,onClose:n}){const{engine:r}=Gt(),i=Lt(),{getApiBase:s,hasMultipleProjects:o}=gn(),a=m.useCallback(R=>o&&(e!=null&&e.project_id)?`${s(e.project_id)}${R}`:i(R),[i,s,o,e==null?void 0:e.project_id]),{sessions:l,loading:c}=ID((e==null?void 0:e.id)??null),[u,f]=m.useState(null),[h,p]=m.useState(null),[g,x]=m.useState(!1),[b,y]=m.useState(null),[v,w]=m.useState(""),N=u&&h?!FD(u,h):!1,j=m.useMemo(()=>OD(e==null?void 0:e.raw_content),[e==null?void 0:e.raw_content]);m.useEffect(()=>{if(e&&t){const R=LD(e);f(R),p(R),y(null),w("")}},[e==null?void 0:e.id,e==null?void 0:e.updated_at,t]);const S=m.useCallback(async()=>{if(!(!e||!u||!N||g)){x(!0),y(null);try{const R={};h&&(u.title!==h.title&&(R.title=u.title),u.status!==h.status&&(R.status=u.status),u.priority!==h.priority&&(R.priority=u.priority||null),u.effort_estimate!==h.effort_estimate&&(R.effort_estimate=u.effort_estimate||null),u.category!==h.category&&(R.category=u.category||null),JSON.stringify(u.tags)!==JSON.stringify(h.tags)&&(R.tags=u.tags),JSON.stringify(u.blocked_by)!==JSON.stringify(h.blocked_by)&&(R.blocked_by=u.blocked_by),JSON.stringify(u.blocks)!==JSON.stringify(h.blocks)&&(R.blocks=u.blocks));const L=await fetch(a(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)});if(!L.ok){const P=await L.json().catch(()=>({error:"Save failed"}));y(P.error??`HTTP ${L.status}`);return}p({...u})}catch{y("Network error — could not save")}finally{x(!1)}}},[e,u,h,N,g,a]);function A(){if(N&&window.confirm("Save changes before closing?")){S().then(n);return}n()}function T(R){f(L=>L&&{...L,...R}),y(null)}function O(R){const L=R.trim().toLowerCase();!L||!u||(u.tags.includes(L)||T({tags:[...u.tags,L]}),w(""))}function E(R,L){const P=parseInt(L,10);isNaN(P)||P<=0||!u||u[R].includes(P)||T({[R]:[...u[R],P]})}if(!e||!u)return null;const M=r.getValidTargets(e.status),D=[e.status,...M.filter(R=>R!==e.status)];return d.jsx(Yt,{open:t,onOpenChange:R=>{R||A()},children:d.jsxs(Ft,{className:"max-w-[min(72rem,calc(100vw_-_2rem))] h-[85vh] flex flex-col p-0 gap-0 overflow-hidden",children:[d.jsx(vn,{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:pt(e.id)}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx(Fn,{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:R=>T({title:R.target.value}),placeholder:"Scope title..."})}),d.jsx(vr,{asChild:!0,children:d.jsxs("span",{className:"mt-1 flex items-center gap-1 text-xxs text-muted-foreground",children:[d.jsx(Vf,{className:"h-3 w-3"}),d.jsx("span",{className:"truncate max-w-[400px]",children:e.file_path})]})})]})]})}),d.jsx(ls,{}),b&&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:b}),d.jsx("button",{onClick:()=>y(null),className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(Ct,{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(ir,{className:"h-full",children:j?d.jsx("div",{className:"py-2",children:d.jsx(CD,{sections:j})}):d.jsx("div",{className:"px-6 py-5",children:e.raw_content?d.jsx(gg,{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(ir,{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:Gn,children:"Status"}),d.jsx("select",{className:Mi,value:u.status,onChange:R=>T({status:R.target.value}),children:D.map(R=>d.jsx("option",{value:R,children:R},R))})]}),d.jsxs("div",{children:[d.jsx("p",{className:Gn,children:"Priority"}),d.jsxs("select",{className:Mi,value:u.priority,onChange:R=>T({priority:R.target.value}),children:[d.jsx("option",{value:"",children:"—"}),Ga.map(R=>d.jsx("option",{value:R,children:R},R))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:Gn,children:"Effort"}),d.jsxs("select",{className:Mi,value:u.effort_estimate,onChange:R=>T({effort_estimate:R.target.value}),children:[d.jsx("option",{value:"",children:"—"}),Cs.map(R=>d.jsx("option",{value:R,children:R},R))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:Gn,children:"Category"}),d.jsxs("select",{className:Mi,value:u.category,onChange:R=>T({category:R.target.value}),children:[d.jsx("option",{value:"",children:"—"}),Ya.map(R=>d.jsx("option",{value:R,children:R},R))]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:Gn,children:"Tags"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u.tags.map(R=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 glass-pill rounded bg-muted px-1.5 py-0.5 text-xxs text-muted-foreground",children:[R,d.jsx("button",{onClick:()=>T({tags:u.tags.filter(L=>L!==R)}),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(Ct,{className:"h-2.5 w-2.5"})})]},R)),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:v,onChange:R=>w(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),O(v))},onBlur:()=>{v.trim()&&O(v)}})]})]}),d.jsx(Qd,{label:"Blocked by",ids:u.blocked_by,onRemove:R=>T({blocked_by:u.blocked_by.filter(L=>L!==R)}),onAdd:R=>E("blocked_by",R)}),d.jsx(Qd,{label:"Blocks",ids:u.blocks,onRemove:R=>T({blocks:u.blocks.filter(L=>L!==R)}),onAdd:R=>E("blocks",R)})]}),d.jsx(ls,{}),d.jsx("div",{className:"p-4 flex-1",children:d.jsx(pD,{sessions:l,loading:c})})]})})]}),N&&d.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded border border-border bg-card px-3 py-2",children:[d.jsx(_e,{variant:"outline",children:"Unsaved changes"}),d.jsx("div",{className:"flex-1"}),d.jsx(de,{variant:"ghost",size:"sm",onClick:()=>{f(h),y(null)},children:"Discard"}),d.jsx(de,{size:"sm",onClick:()=>S(),disabled:g,children:g?"Saving...":"Save"}),b&&d.jsx("span",{className:"text-xs text-destructive ml-2",children:b})]})]})})}function zD({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(Yt,{open:e,onOpenChange:p=>{p||r()},children:d.jsxs(Ft,{className:"max-w-lg p-5 gap-0",onKeyDown:h,children:[d.jsxs(vn,{className:"mb-4",children:[d.jsx(Fn,{className:"text-sm font-normal",children:"New Idea"}),d.jsx(vr,{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(de,{size:"sm",onClick:f,disabled:t||!o.trim(),className:"flex-1",children:t?"Creating...":"Create"}),d.jsx(de,{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(de,{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(Aa,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Generating ideas..."]}):d.jsxs(d.Fragment,{children:[d.jsx(_a,{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 VD({scope:e,open:t,onClose:n,onDelete:r,onApprove:i,onReject:s}){const o=Lt(),[a,l]=m.useState(""),[c,u]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(""),[x,b]=m.useState(!1),[y,v]=m.useState(!1),w=m.useRef(null),N=!!(e!=null&&e.is_ghost),j=a!==f||c!==p;m.useEffect(()=>{if(e&&t){const O=e.title??"",E=e.raw_content??"";l(O),u(E),h(O),g(E),v(!1);const M=N?void 0:setTimeout(()=>{var D;return(D=w.current)==null?void 0:D.focus()},100);return()=>{clearTimeout(M)}}},[e==null?void 0:e.id,t]);const S=m.useCallback(async()=>{if(!(!(e!=null&&e.slug)||!j||x||N)){b(!0);try{const O=await fetch(o(`/ideas/${e.slug}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,description:c})});O.ok?(h(a),g(c)):console.error("[Orbital] Failed to save idea:",O.status,O.statusText)}finally{b(!1)}}},[e,a,c,j,x,N,o]);m.useEffect(()=>{if(!j||!t||N)return;const O=setInterval(()=>{S()},1e4);return()=>clearInterval(O)},[j,t,S,N]);function A(){if(j&&!N&&window.confirm("Save changes before closing?")){S().then(n);return}n()}function T(){if(!y){v(!0);return}e!=null&&e.slug&&r(e.slug)}return e?d.jsx(Yt,{open:t,onOpenChange:O=>{O||A()},children:d.jsxs(Ft,{className:"max-w-md p-0 gap-0 flex flex-col max-h-[70vh]",children:[d.jsx(vn,{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:N?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(_a,{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:w,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:O=>l(O.target.value)})}),N?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"}):y?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(de,{size:"sm",variant:"destructive",className:"h-6 text-xxs",onClick:T,children:"Confirm"}),d.jsx(de,{size:"sm",variant:"ghost",className:"h-6 text-xxs",onClick:()=>v(!1),children:"No"})]}):d.jsx(de,{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(S0,{className:"h-3.5 w-3.5"})})]})}),d.jsx("div",{className:"flex-1 min-h-0 px-4 pb-4",children:N?d.jsx("div",{className:"w-full min-h-[200px] rounded bg-muted/20 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-muted/30 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:O=>u(O.target.value)})}),N?d.jsxs("div",{className:"px-4 pb-3 flex items-center gap-2",children:[d.jsxs(de,{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(xs,{className:"h-3.5 w-3.5 mr-1.5"}),"Approve"]}),d.jsxs(de,{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(Ct,{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:x?"Saving...":j?"Unsaved changes":"Saved"}),d.jsx(de,{size:"sm",variant:"ghost",className:"h-6",onClick:()=>S(),disabled:!j||x,children:"Save"})]})]})}):null}const Do=[{field:"priority",label:"Priority"},{field:"category",label:"Category"},{field:"tags",label:"Tags"},{field:"effort",label:"Effort"},{field:"dependencies",label:"Dependencies"}],$D={priority:"Priority",category:"Category",tags:"Tag",effort:"Effort",dependencies:"Dep"},UD={feature:"#536dfe",bugfix:"#ff1744",refactor:"#8B5CF6",infrastructure:"#40c4ff",docs:"#6B7280"},WD={priority:"text-warning-amber",category:"text-accent-blue",tags:"text-info-cyan",effort:"text-muted-foreground",dependencies:"text-ask-red"};function HD({filters:e,optionsWithCounts:t,onToggle:n,onClearField:r,onClearAll:i,hasActiveFilters:s}){mr();const[o,a]=m.useState(null),l=Do.reduce((u,{field:f})=>u+e[f].size,0),c=[];for(const{field:u}of Do){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(On,{onOpenChange:()=>a(null),children:[d.jsx(In,{asChild:!0,children:d.jsxs(de,{variant:"outline",size:"sm",className:z("gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10",s&&"border-white/20 text-foreground"),"aria-label":"Filter scopes",children:[d.jsx(Mb,{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(yn,{align:"start",className:"filter-popover-glass !bg-transparent w-52",children:[d.jsx("div",{className:"space-y-0.5",children:Do.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",{onClick:()=>a(p?null:u),className:z("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(Xr,{className:z("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150",p&&"rotate-90")}),d.jsx("span",{className:z(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(x=>{const b=e[u].has(x.value);return d.jsxs("button",{onClick:()=>n(u,x.value),className:z("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",b&&"bg-white/[0.06]"),children:[d.jsx("span",{className:z("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",b?z("border-primary bg-primary text-primary-foreground",WD[u]):"border-white/15"),children:b&&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:z("capitalize",b&&"text-foreground"),children:x.label}),d.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:x.count})]},x.value)}),g>0&&d.jsxs("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",{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:[$D[u],":"]}),f.map(({value:h,label:p})=>{const g=u==="category";return d.jsxs(_e,{variant:g?"outline":"secondary",className:z("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:UD[h]}:void 0,onClick:()=>n(u,h),children:[p,d.jsx(Ct,{className:"h-2 w-2 opacity-60"})]},h)})]},u))]})}function qD({query:e,mode:t,isStale:n,onQueryChange:r,onModeChange:i}){mr();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:z("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(s0,{className:z("h-3 w-3 shrink-0 text-muted-foreground",n&&"animate-pulse")}),d.jsx("span",{className:z("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:z("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(Ct,{className:"h-3 w-3"})}),d.jsxs("div",{className:z("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:z("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:z("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 KD({open:e,sprint:t,graph:n,loading:r,onConfirm:i,onCancel:s}){const[o,a]=m.useState(!1);if(m.useEffect(()=>{e&&a(!1)},[e]),!t)return null;const l=new Map(t.scopes.map(h=>[h.scope_id,h])),c=(n==null?void 0:n.layers)??[],u=t.scope_ids.length,f=async()=>{a(!0),i()};return d.jsx(Yt,{open:e,onOpenChange:h=>!h&&s(),children:d.jsxs(Ft,{className:"sm:max-w-lg",children:[d.jsxs(vn,{children:[d.jsxs(Fn,{className:"flex items-center gap-2 text-sm",children:[d.jsx(Wi,{className:"h-4 w-4 text-cyan-400"}),"Dispatch Sprint: ",t.name]}),d.jsxs(vr,{className:"text-xs",children:[u," scope",u!==1?"s":""," will be dispatched in"," ",c.length," layer",c.length!==1?"s":""," with max"," ",t.concurrency_cap," concurrent agents."]})]}),d.jsx("div",{className:"my-3 space-y-3 max-h-64 overflow-y-auto",children:c.map((h,p)=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs(_e,{variant:"outline",className:"text-[10px]",children:["Layer ",p]}),p===0&&d.jsx("span",{className:"text-[10px] text-cyan-400",children:"Launches first"}),p>0&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["Waits for Layer ",p-1]})]}),d.jsx("div",{className:"ml-4 space-y-1",children:h.map(g=>{const x=l.get(g);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:pt(g)}),d.jsx("span",{className:"truncate flex-1",children:(x==null?void 0:x.title)??"Unknown"}),(x==null?void 0:x.effort_estimate)&&d.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:x.effort_estimate})]},g)})}),p<c.length-1&&d.jsx("div",{className:"flex justify-center my-1",children:d.jsx(Ta,{className:"h-3 w-3 text-muted-foreground rotate-90"})})]},h.join("-")))}),c.length===0&&!r&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:[d.jsx(fn,{className:"h-3.5 w-3.5 shrink-0"}),"Could not compute execution layers. Sprint may have issues."]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t",children:[d.jsx(de,{variant:"ghost",size:"sm",onClick:s,disabled:o,children:"Cancel"}),d.jsx(de,{size:"sm",onClick:f,disabled:o||r||c.length===0,className:"bg-cyan-600 hover:bg-cyan-700",children:o?d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border border-white border-t-transparent"}),"Dispatching..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Wi,{className:"h-3 w-3 mr-1"})," Dispatch Sprint"]})})]})]})})}function GD({open:e,batch:t,onConfirm:n,onCancel:r}){const{engine:i}=Gt(),[s,o]=m.useState(!1),[a,l]=m.useState("push");if(m.useEffect(()=>{e&&o(!1)},[e]),!t)return null;const c=t.scope_ids.length,u=i.getBatchTargetStatus(t.target_column),f=u?i.findEdge(t.target_column,u):void 0,h=(f==null?void 0:f.description)??"Will dispatch this batch",p=()=>{o(!0),n(a)};return d.jsx(Yt,{open:e,onOpenChange:g=>!g&&r(),children:d.jsxs(Ft,{className:"sm:max-w-md p-0 gap-0 overflow-hidden",children:[d.jsxs(vn,{className:"px-4 pt-3 pb-2",children:[d.jsxs(Fn,{className:"flex items-center gap-2 text-sm",children:[d.jsx(Hf,{className:"h-4 w-4 text-amber-400"}),"Dispatch Batch: ",t.name]}),d.jsxs(vr,{className:"text-xs",children:[h," (",c," scope",c!==1?"s":"",")"]})]}),d.jsx("div",{className:"max-h-48 overflow-y-auto space-y-1 bg-[#0a0a12] px-4 py-3",children:t.scopes.map(g=>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:pt(g.scope_id)}),d.jsx("span",{className:"truncate flex-1",children:g.title})]},g.scope_id))}),d.jsxs("div",{className:"px-4 py-2 border-t border-border/50 space-y-1.5",children:[d.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Merge Mode"}),d.jsx("div",{className:"flex gap-2",children:["push","pr","direct"].map(g=>d.jsx("button",{onClick:()=>l(g),className:`rounded px-2 py-1 text-xs transition-colors ${a===g?"bg-cyan-600/80 text-black":"bg-muted text-muted-foreground hover:bg-accent"}`,children:g==="push"?"Push":g==="pr"?"PR":"Direct Merge"},g))})]}),d.jsxs("div",{className:"flex justify-end gap-2 px-4 py-2 border-t border-border/50",children:[d.jsx(de,{variant:"ghost",size:"sm",onClick:r,disabled:s,children:"Cancel"}),d.jsx(de,{size:"sm",onClick:p,disabled:s||c===0,className:"bg-cyan-600/80 hover:bg-cyan-500/80 transition-colors",children:s?d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border border-white border-t-transparent"}),"Dispatching..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Wi,{className:"h-3 w-3 mr-1"})," Dispatch"]})})]})]})})}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(Yt,{open:e,onOpenChange:s=>!s&&r(),children:d.jsxs(Ft,{className:"sm:max-w-md",children:[d.jsxs(vn,{children:[d.jsxs(Fn,{className:"flex items-center gap-2 text-sm",children:[d.jsx(fn,{className:"h-4 w-4 text-warning-amber"}),"Unmet Dependencies"]}),d.jsx(vr,{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:pt(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:pt(o.scope_id)}),d.jsx("span",{className:"truncate",children:o.title}),d.jsx(_e,{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(de,{variant:"ghost",size:"sm",onClick:r,children:[d.jsx(Ct,{className:"h-3 w-3 mr-1"})," Cancel"]}),d.jsxs(de,{size:"sm",onClick:()=>n([...i.keys()]),children:[d.jsx(Hi,{className:"h-3 w-3 mr-1"})," Add All Dependencies"]})]})]})})}function XD({columnId:e,dispatching:t,onOpenIdeaForm:n,onCreateGroup:r}){const{engine:i}=Gt(),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(de,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:n,disabled:t,title:"Add idea",children:d.jsx(Hi,{className:"h-3 w-3"})});if((l||a)&&r){const u=a?"batch":"sprint",f=a?"Batch":"Sprint";return d.jsx(de,{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(Hi,{className:"h-3 w-3"})})}return null}const JD=e=>{const t=Dv(e),n=t.find(r=>String(r.id).startsWith("sprint-drop-"));return n?[n]:t.length>0?t:fh(e)};function va(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 QD={critical:"bg-ask-red",high:"bg-warning-amber",medium:"bg-accent-blue",low:"bg-muted-foreground/30"},ZD={feature:"bg-category-feature",bugfix:"bg-category-bugfix",refactor:"bg-category-refactor",infrastructure:"bg-category-infrastructure",docs:"bg-category-docs"},eM={"has-blockers":"Has blockers","blocks-others":"Blocks others","no-deps":"No dependencies"},tM={priority:Ga,category:Ya,effort:Cs,dependencies:Ph,tags:[],project:[]};function nM(e,t){return e==="priority"?QD[t]??"bg-muted-foreground/30":e==="category"?ZD[t]??"bg-primary/40":"bg-primary/40"}function rM(e,t){return e==="dependencies"?eM[t]??t:t}function iM(){return new Proxy({},{get(e,t){return t in e||(e[t]=[]),e[t]}})}function sM(e,t,n,r,i){const s=new Map,o=new Map;for(const f of e){const h=Xa(f,t),p=h.length>0?h:["Unset"];for(const g of p){s.has(g)||(s.set(g,iM()),o.set(g,0));const x=s.get(g),b=i?i(f):f.status;x[b]?x[b].push(f):x.planning.push(f),o.set(g,(o.get(g)??0)+1)}}for(const f of s.values())for(const h of Object.keys(f))f[h]=va(qo(f[h],n,r));const a=tM[t],l=[...s.keys()],c=[];for(const f of a)s.has(f)&&c.push(f);const u=l.filter(f=>f!=="Unset"&&!a.includes(f)).sort();return c.push(...u),s.has("Unset")&&c.push("Unset"),c.map(f=>({value:f,label:f==="Unset"?"Unset":rM(t,f),color:f==="Unset"?"bg-muted-foreground/20":nM(t,f),count:o.get(f)??0,cells:s.get(f)}))}const oM={queued:"210 50% 50%",active:"0 70% 55%",review:"45 80% 50%",shipped:"153 70% 45%"};function aM(e,t){var a,l,c,u;const n=[...t.values()];if(n.length===0)return{isUnified:!0,columns:[],scopesByColumn:{}};if(p1(n)){const f=n[0],p=f.getBoardColumns().map(b=>({id:b.id,label:b.label,color:b.color,phase:new or(f).getPhase(b.id)})),g={};for(const b of p)g[b.id]=[];const x=f.getEntryPoint().id;for(const b of e){const y=g[b.status]?b.status:x;(a=g[y])==null||a.push(b)}return{isUnified:!0,columns:p,scopesByColumn:g}}const i=new Map;for(const[f,h]of t)i.set(f,new or(h));const s=h1.map(f=>({id:f.phase,label:f.label,color:oM[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}}const lM=["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 cM({open:e,onClose:t,projects:n}){const[r,i]=m.useState(!1),[s,o]=m.useState(null),[a,l]=m.useState(null),c=m.useRef(null),[u,f]=m.useState(null);async function h(g,x){l(g),f(null);try{const b=await fetch(`/api/orbital/projects/${g}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!b.ok){const y=await b.json().catch(()=>({}));f(y.error??`Failed to update project (HTTP ${b.status})`)}}catch{f("Failed to update project")}finally{l(null)}}async function p(g){if(!g||g.length===0)return;const b=g[0].webkitRelativePath.split("/")[0];o(null),i(!0);try{const y=await fetch("/api/orbital/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b})});if(!y.ok){const v=await y.json().catch(()=>({}));throw new Error(v.error??`HTTP ${y.status}`)}}catch(y){o(y instanceof Error?y.message:"Failed to add project")}finally{i(!1)}}return d.jsx(Yt,{open:e,onOpenChange:g=>{g||t()},children:d.jsxs(Ft,{className:"max-w-[440px] max-h-[80vh] p-0 gap-0 flex flex-col",children:[d.jsx(vn,{className:"border-b border-white/[0.08] px-4 py-3",children:d.jsx(Fn,{children:"Project Settings"})}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:[n.map(g=>d.jsx(uM,{project:g,updating:a===g.id,onUpdate:x=>h(g.id,x)},g.id)),d.jsxs("div",{onClick:()=>{var g;return!r&&((g=c.current)==null?void 0:g.click())},className:z("flex items-center gap-3 rounded border border-dashed border-white/[0.08] px-3 py-2","text-muted-foreground hover:text-foreground hover:border-primary/30 hover:bg-white/[0.03]","transition-colors cursor-pointer",r&&"opacity-50 pointer-events-none"),children:[d.jsx(Rb,{className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"text-xs",children:"Add Project"})]}),d.jsx("input",{ref:c,type:"file",webkitdirectory:"",className:"hidden",onChange:g=>p(g.target.files)}),(s||u)&&d.jsx("p",{className:"px-3 text-[11px] text-destructive",children:s||u})]})]})})}function uM({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:z("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(dM,{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(xs,{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(Uf,{className:"h-3.5 w-3.5"}):d.jsx($f,{className:"h-3.5 w-3.5"})})]})}function dM({value:e,onChange:t,disabled:n}){return d.jsxs(On,{children:[d.jsx(In,{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(yn,{side:"bottom",align:"start",className:"w-auto p-2",children:d.jsx("div",{className:"grid grid-cols-5 gap-2",children:lM.map(r=>d.jsx("button",{onClick:()=>t(r),className:z("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))})})]})}function fM({countOverrides:e}={}){const{projects:t,activeProjectId:n,setActiveProjectId:r,hasMultipleProjects:i}=gn(),[s,o]=m.useState(!1);if(!i)return null;const a=n===null;return d.jsxs("div",{className:"card-glass -mt-8 mb-3 flex items-center gap-0.5 overflow-x-auto rounded border border-white/[0.08] px-1 py-1",children:[d.jsxs("button",{onClick:()=>r(null),className:z("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",a?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:a?{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(Pa,{className:"h-3 w-3"}),"All Projects",d.jsx("span",{className:z("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",a?"glass-pill":"bg-muted border-transparent"),children:e?t.filter(l=>l.enabled).reduce((l,c)=>l+(e[c.id]??0),0):t.filter(l=>l.enabled).reduce((l,c)=>l+c.scopeCount,0)})]}),d.jsx("div",{className:"mx-0.5 h-4 w-px bg-white/[0.08]"}),t.filter(l=>l.enabled).map(l=>{const c=n===l.id;return d.jsxs("button",{onClick:()=>r(l.id),className:z("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:`hsl(${l.color} / 0.10)`,boxShadow:`0 2px 12px hsl(${l.color} / 0.25)`,borderBottomColor:`hsl(${l.color} / 0.50)`}:void 0,children:[d.jsx("span",{className:z("h-2 w-2 rounded-full shrink-0 transition-shadow duration-300",c&&"shadow-[0_0_6px_currentColor]"),style:{backgroundColor:`hsl(${l.color})`}}),l.name,d.jsx("span",{className:z("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",c?"glass-pill":"bg-muted border-transparent"),children:e?e[l.id]??0:l.scopeCount}),l.status==="offline"&&d.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"(offline)"})]},l.id)}),d.jsx("div",{className:"ml-auto shrink-0 pl-1",children:d.jsx("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(a0,{className:"h-3.5 w-3.5"})})}),d.jsx(cM,{open:s,onClose:()=>o(!1),projects:t})]})}function hM({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:"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 pM(){var et,lt,Zt,en,vt,tn,Vn;const e=Lt(),{scopes:t,loading:n,refetch:r}=Xf(),{engine:i}=Gt(),{activeProjectId:s,projects:o,projectEngines:a,hasMultipleProjects:l}=gn(),{sortField:c,sortDirection:u,setSort:f,collapsed:h,toggleCollapse:p}=i1(),{viewMode:g,setViewMode:x,groupField:b,setGroupField:y,collapsedLanes:v,toggleLaneCollapse:w}=u1(),{display:N,toggle:j,hiddenCount:S}=qw(),[A,T]=m.useState(null),O=m.useMemo(()=>t.find(W=>ce(W)===A)??null,[t,A]),[E,M]=m.useState(null),[D,R]=m.useState(null),L=m.useMemo(()=>i.getBoardColumns(),[i]),P=l&&s===null,F=m.useMemo(()=>!P||a.size===0?null:aM(t,a),[P,t,a]),_=(F==null?void 0:F.columns)??L,H=m.useMemo(()=>{if(!l)return;const W=new Map;for(const ne of o)W.set(ne.id,ne);return W},[l,o]),{sprints:U,createSprint:C,renameSprint:B,deleteSprint:J,addScopes:k,dispatchSprint:oe,getGraph:qe}=x1(),[le,mt]=m.useState(null),{filters:Qe,toggleFilter:gt,clearField:Ce,clearAll:Nt,hasActiveFilters:xt,filteredScopes:zn,optionsWithCounts:yt}=Qw(t),ye=w1(zn),{highlightedScopeKey:$e,clearHighlight:zt}=k1(),kn=m.useMemo(()=>{if($e==null)return ye.dimmedIds;const W=new Set;for(const ne of ye.displayScopes)ce(ne)!==$e&&W.add(ce(ne));return W},[$e,ye.dimmedIds,ye.displayScopes]);m.useEffect(()=>{if($e==null)return;const W=setTimeout(()=>{document.addEventListener("click",zt,{once:!0})},100);return()=>{clearTimeout(W),document.removeEventListener("click",zt)}},[$e,zt]);const{state:Q,onDragStart:Ze,onDragOver:Jt,onDragEnd:Qt,confirmTransition:Sn,cancelTransition:Cn,dismissError:Sr,openModalFromPopover:I,openIdeaForm:$,closeIdeaForm:q,submitIdea:Z,dismissSprintDispatch:ae,dismissUnmetDeps:ve,resolveUnmetDeps:ot,showUnmetDeps:Ke,selectDisambiguation:Vt,dismissDisambiguation:bt}=g1({scopes:ye.displayScopes,sprints:U,onAddToSprint:k,isPhaseView:P&&F!=null&&!F.isUnified,projectEngines:P?a:void 0}),Re=Nv(wc(Ha,{activationConstraint:{distance:8}}),wc(Ua)),Tt=d1(),Ge=m.useMemo(()=>{const W=new Map;for(const ne of t)W.set(ne.id,ne);return W},[t]),Ls=m.useMemo(()=>{var me;if(F){const Pe={};for(const Cr of F.columns)Pe[Cr.id]=[];for(const[Cr,Pg]of Object.entries(F.scopesByColumn)){const Ag=new Set(ye.displayScopes.map(zs=>ce(zs)));Pe[Cr]=va(qo(Pg.filter(zs=>Ag.has(ce(zs))),c,u))}return Pe}const W={};for(const Pe of L)W[Pe.id]=[];const ne=i.getEntryPoint().id;for(const Pe of ye.displayScopes)W[Pe.status]?W[Pe.status].push(Pe):(me=W[ne])==null||me.push(Pe);for(const Pe of Object.keys(W))W[Pe]=va(qo(W[Pe],c,u));return W},[ye.displayScopes,c,u,L,i,F]),Fs=m.useMemo(()=>{const W={};for(const ne of U){if(ne.group_type==="batch"&&ne.status==="completed")continue;const me=ne.group_type==="sprint"&&ne.status!=="assembling"?"implementing":ne.target_column;(W[me]??(W[me]=[])).push(ne)}return W},[U]),Bs=m.useMemo(()=>{const W=new Set;for(const ne of U)if(!(ne.group_type==="batch"&&ne.status==="completed"))for(const me of ne.scope_ids)W.add(me);return W},[U]),De=m.useMemo(()=>{if(g!=="swimlane")return[];let W;if(P&&F&&!F.isUnified){const ne=new Map;for(const[me,Pe]of a)ne.set(me,new or(Pe));W=me=>{const Pe=ne.get(me.project_id??"");return Pe?Pe.getPhase(me.status):"queued"}}return sM(ye.displayScopes,b,c,u,W)},[g,ye.displayScopes,b,c,u,P,F,a]),Le=m.useMemo(()=>{if(Q.activeScope){if(P&&F&&!F.isUnified&&Q.activeScope.project_id){const W=a.get(Q.activeScope.project_id);if(W){const ne=W.getValidTargets(Q.activeScope.status),me=new or(W);return new Set(ne.map(Cr=>me.getPhase(Cr)))}}return new Set(i.getValidTargets(Q.activeScope.status))}return Q.activeSprint?new Set(["implementing"]):new Set},[Q.activeScope,Q.activeSprint,i,P,F,a]),je=y1(Q.pendingSprintDispatch,qe,oe,ae),{surpriseLoading:Pt,handleSurprise:Ye,handleApproveGhost:Ue,handleRejectGhost:at}=b1(q,M),$t=m.useCallback(W=>{W.status===i.getEntryPoint().id?M(W):T(ce(W))},[i]),Te=m.useCallback(async(W,ne)=>{const me=await k(W,ne);me&&me.unmet_dependencies.length>0&&Ke(W,me.unmet_dependencies)},[k,Ke]),At=m.useCallback(async(W,ne)=>{const me=await C(W,ne);return me&&mt(me.id),me},[C]);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(jw,{sensors:Re,modifiers:Tt,collisionDetection:JD,onDragStart:Ze,onDragOver:Jt,onDragEnd:Qt,children:d.jsxs("div",{className:"flex flex-1 min-h-0 flex-col",children:[d.jsx(fM,{}),d.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[d.jsx(Wf,{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(qD,{query:ye.query,mode:ye.mode,isStale:ye.isStale,onQueryChange:ye.setQuery,onModeChange:ye.setMode}),d.jsx(HD,{filters:Qe,optionsWithCounts:yt,onToggle:gt,onClearField:Ce,onClearAll:Nt,hasActiveFilters:xt}),d.jsx(CE,{viewMode:g,groupField:b,onViewModeChange:x,onGroupFieldChange:y}),d.jsx(wE,{display:N,onToggle:j,hiddenCount:S})]})]}),Q.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:Q.error}),d.jsx("button",{onClick:Sr,className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(Ct,{className:"h-3.5 w-3.5"})})]}),g==="swimlane"?d.jsx(NE,{lanes:De,columns:_,collapsedColumns:h,collapsedLanes:v,onToggleLane:w,onToggleCollapse:p,onScopeClick:$t,cardDisplay:N,dimmedIds:kn,isDragActive:!!(Q.activeScope||Q.activeSprint),validTargets:Le,sprints:U}):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:_.map(W=>d.jsx(uE,{id:W.id,label:W.label,color:W.color,scopes:Ls[W.id]??[],sprints:P?void 0:Fs[W.id],scopeLookup:Ge,globalSprintScopeIds:P?void 0:Bs,onScopeClick:$t,onDeleteSprint:P?void 0:J,onDispatchSprint:P?void 0:ne=>R(ne),onRenameSprint:P?void 0:(ne,me)=>B(ne,me),editingSprintId:P?void 0:le,onSprintEditingDone:P?void 0:()=>mt(null),onAddAllToSprint:P?void 0:Te,isDragActive:!!(Q.activeScope||Q.activeSprint),isValidDrop:Le.has(W.id),sortField:c,sortDirection:u,onSetSort:f,collapsed:h.has(W.id),onToggleCollapse:()=>p(W.id),cardDisplay:N,dimmedIds:kn,projectLookup:H,headerExtra:P?void 0:d.jsx(XD,{columnId:W.id,dispatching:Q.dispatching,onOpenIdeaForm:$,onCreateGroup:At})},W.id))})}),d.jsx(TE,{activeScope:Q.activeScope,activeSprint:Q.activeSprint,cardDisplay:N}),d.jsx(AE,{open:Q.showPopover,scope:((et=Q.pending)==null?void 0:et.scope)??null,transition:((lt=Q.pending)==null?void 0:lt.transition)??null,hasActiveSession:((Zt=Q.pending)==null?void 0:Zt.hasActiveSession)??!1,dispatching:Q.dispatching,error:Q.error,onConfirm:Sn,onCancel:Cn,onViewDetails:I}),d.jsx(_E,{open:Q.showModal,scope:((en=Q.pending)==null?void 0:en.scope)??null,transition:((vt=Q.pending)==null?void 0:vt.transition)??null,hasActiveSession:((tn=Q.pending)==null?void 0:tn.hasActiveSession)??!1,dispatching:Q.dispatching,error:Q.error,onConfirm:Sn,onCancel:Cn}),d.jsx(BD,{scope:O,open:!!O,onClose:()=>T(null)}),d.jsx(zD,{open:Q.showIdeaForm,loading:Q.dispatching,onSubmit:Z,onCancel:q,onSurprise:Ye,surpriseLoading:Pt}),d.jsx(VD,{scope:E,open:!!E,onClose:()=>M(null),onDelete:async W=>{try{const ne=await fetch(e(`/ideas/${W}`),{method:"DELETE"});if(!ne.ok)throw new Error(`HTTP ${ne.status}`)}catch{}M(null),r()},onApprove:Ue,onReject:at}),d.jsx(KD,{open:je.showPreflight,sprint:je.pendingSprint,graph:je.graph,loading:je.loading,onConfirm:je.onConfirm,onCancel:je.onCancel}),d.jsx(GD,{open:D!=null,batch:U.find(W=>W.id===D)??null,onConfirm:()=>{D!=null&&oe(D),R(null)},onCancel:()=>R(null)}),d.jsx(YD,{open:Q.pendingUnmetDeps!=null,unmetDeps:Q.pendingUnmetDeps??[],onAddAll:ot,onCancel:ve}),d.jsx(hM,{open:Q.pendingDisambiguation!=null,edges:((Vn=Q.pendingDisambiguation)==null?void 0:Vn.edges)??[],onSelect:Vt,onCancel:bt})]})})}const Sg=()=>fr(()=>import("./PrimitivesConfig-CrmQXYh4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.PrimitivesConfig})),Cg=()=>fr(()=>import("./QualityGates-BbasOsF3.js"),__vite__mapDeps([9,1,2,10,11,12,8,3,5])).then(e=>({default:e.QualityGates})),jg=()=>fr(()=>import("./SourceControl-B1fP2nJL.js"),__vite__mapDeps([13,1,2,8,12,6,7,14,10])).then(e=>({default:e.SourceControl})),Eg=()=>fr(()=>import("./SessionTimeline-CGeJsVvy.js"),__vite__mapDeps([15,1,2,5,8])).then(e=>({default:e.SessionTimeline})),Ng=()=>fr(()=>import("./Settings-oiM496mc.js"),__vite__mapDeps([16,1,2,17,8])).then(e=>({default:e.Settings})),Tg=()=>fr(()=>import("./WorkflowVisualizer-CWLYf-f0.js"),__vite__mapDeps([18,1,2,8,3,14,7,4,17,11,10,19])),mM=m.lazy(Sg),gM=m.lazy(Cg),xM=m.lazy(jg),yM=m.lazy(Eg),bM=m.lazy(Ng),vM=m.lazy(Tg);requestIdleCallback(()=>{Sg(),Cg(),jg(),Eg(),Ng(),Tg()});class wM extends m.Component{constructor(){super(...arguments);tt(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){console.error("Onboarding error:",n)}render(){return this.state.hasError?d.jsx(rc,{children:this.props.children}):d.jsx(Qy,{children:d.jsx(rc,{children:this.props.children})})}}function kM(){const e=Gy();return d.jsx(Of.Provider,{value:e,children:d.jsx(wM,{children:d.jsx(ax,{children:d.jsxs(_t,{element:d.jsx(hv,{}),children:[d.jsx(_t,{index:!0,element:d.jsx(pM,{})}),d.jsx(_t,{path:"primitives",element:d.jsx(mM,{})}),d.jsx(_t,{path:"guards",element:d.jsx(gM,{})}),d.jsx(_t,{path:"gates",element:d.jsx(Ql,{to:"/guards",replace:!0})}),d.jsx(_t,{path:"enforcement",element:d.jsx(Ql,{to:"/guards",replace:!0})}),d.jsx(_t,{path:"repo",element:d.jsx(xM,{})}),d.jsx(_t,{path:"sessions",element:d.jsx(yM,{})}),d.jsx(_t,{path:"workflow",element:d.jsx(vM,{})}),d.jsx(_t,{path:"settings",element:d.jsx(bM,{})})]})})})})}function SM(){return d.jsx(ox,{children:d.jsx(Hy,{children:d.jsx(qy,{children:d.jsx(kM,{})})})})}try{CSS.registerProperty({name:"--dispatch-angle",syntax:"<angle>",initialValue:"0deg",inherits:!1})}catch{}ux.createRoot(document.getElementById("root")).render(d.jsx(ke.StrictMode,{children:d.jsx(Kf,{children:d.jsx(R0,{children:d.jsx(SM,{})})})}));export{Hx as $,IM as A,_e as B,cb as C,jw as D,Uf as E,yb as F,Ib as G,Aa as H,gb as I,Xf as J,Yj as K,Pa as L,Xj as M,Rl as N,kb as O,Hi as P,Ta as Q,y0 as R,d0 as S,fn as T,Wi as U,Fb as V,Wy as W,Ct as X,TM as Y,PM as Z,vb as _,z as a,zb as a0,Yt as a1,FM as a2,Ft as a3,vn as a4,Fn as a5,vr as a6,Vf as a7,xs as a8,Ri as a9,Va as aA,Gi as aB,Tw as aC,ws as aD,qt as aE,RM as aF,Fa as aG,Dn as aH,ui as aI,Ua as aJ,DM as aK,g0 as aL,$b as aM,E0 as aN,p1 as aO,T0 as aP,By as aQ,Et as aa,mn as ab,cR as ac,KR as ad,Hd as ae,VM as af,zM as ag,Is as ah,mr as ai,pt as aj,ls as ak,Hf as al,Z0 as am,e0 as an,jb as ao,n0 as ap,BM as aq,Ma as ar,Xy as as,_M as at,c0 as au,Gf as av,sb as aw,fe as ax,MM as ay,Av as az,Ra as b,X as c,ir as d,S0 as e,Th as f,Xr as g,de as h,pb as i,gs as j,Gt as k,$y as l,OM as m,Ka as n,_l as o,v0 as p,gn as q,Nv as r,K as s,wc as t,Lt as u,d1 as v,fM as w,Qb as x,Uw as y,Ha as z};
|