geneseed 3.9.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/QUICKSTART.md +1 -1
  3. package/README.md +27 -28
  4. package/SETUP.md +7 -42
  5. package/SHIPPED.md +2 -2
  6. package/adapters/bob/README.md +17 -1
  7. package/adapters/openclaude/README.md +1 -1
  8. package/adapters/opencode/plugins/geneseed-context.js +78 -8
  9. package/bin/geneseed-hook.mjs +1 -1
  10. package/docs/candidate-hosts.md +12 -5
  11. package/docs/token-footprint.md +26 -21
  12. package/docs/web/claude-hooks.md +1 -1
  13. package/docs/web/collaboration.md +1 -1
  14. package/docs/web/exclusions.md +0 -1
  15. package/docs/web/footprint.md +1 -1
  16. package/docs/web/harnesses.md +13 -13
  17. package/docs/web/install-quick.md +1 -1
  18. package/docs/web-ui.md +1 -1
  19. package/harness.config.json +1 -1
  20. package/js/README.md +4 -4
  21. package/js/build/driver.mjs +26 -95
  22. package/js/build/emit-claude.mjs +76 -81
  23. package/js/build/generate.mjs +0 -1
  24. package/js/build/render.mjs +4 -0
  25. package/js/build/stubs.mjs +18 -2
  26. package/js/cli-table.json +5 -5
  27. package/js/hosts/hooks.mjs +86 -54
  28. package/js/hosts/hosts.mjs +5 -21
  29. package/js/hosts/installs.mjs +4 -6
  30. package/js/hosts/mcp.mjs +3 -13
  31. package/js/hosts/native.mjs +27 -50
  32. package/js/hosts/opencode.mjs +1 -1
  33. package/js/hosts/settings.mjs +4 -78
  34. package/js/inspect/checks-authoring.mjs +4 -1
  35. package/js/inspect/checks-repo.mjs +45 -1
  36. package/js/inspect/diff.mjs +11 -3
  37. package/js/inspect/doctor.mjs +3 -3
  38. package/js/inspect/excludes.mjs +0 -4
  39. package/js/inspect/status.mjs +4 -4
  40. package/js/maintain/migrate.mjs +5 -5
  41. package/js/maintain/setup.mjs +3 -5
  42. package/js/maintain/uninstall.mjs +8 -42
  43. package/js/web/actions.mjs +4 -5
  44. package/js/web/api.mjs +4 -4
  45. package/package.json +1 -2
  46. package/src/AGENT.md.tmpl +69 -52
  47. package/src/laws/universal.md +3 -0
  48. package/src/ontology/universal.md +1 -1
  49. package/src/skills/daydream/SKILL.md +10 -3
  50. package/src/skills/daydream/VENDOR.md +10 -2
  51. package/src/skills/daydream/instructions.md +2 -2
  52. package/src/skills/explain-changes/SKILL.md +1 -1
  53. package/src/skills/explain-changes/VENDOR.md +1 -1
  54. package/src/skills/geneseed.md +1 -1
  55. package/src/skills/react-view-transitions/SKILL.md +1 -1
  56. package/src/skills/react-view-transitions/VENDOR.md +7 -2
  57. package/src/skills/token-report/SKILL.md +2 -3
  58. package/src/skills/token-report/VENDOR.md +2 -3
  59. package/src/skills/token-report/scripts/token_report.mjs +7 -121
  60. package/src/skills/workflow.md +1 -1
  61. package/web/dist/assets/{Activity-DAzV-qQj.js → Activity-BjVp522q.js} +1 -1
  62. package/web/dist/assets/{ActivityDetail-CwEwMtKl.js → ActivityDetail-8ep1bspW.js} +1 -1
  63. package/web/dist/assets/{Dashboard-C2ELBW-X.js → Dashboard-OkC_PCH6.js} +2 -2
  64. package/web/dist/assets/{Docs-iZrvQP8J.js → Docs-CKPWz00o.js} +1 -1
  65. package/web/dist/assets/{GreenhouseView-Bq1QmaGO.js → GreenhouseView-D0cbCJ5m.js} +1 -1
  66. package/web/dist/assets/{Installs-BiqR8xdO.js → Installs-BtGGdoTt.js} +1 -1
  67. package/web/dist/assets/{JournalView-6wilG5Zd.js → JournalView-Ckl4dmzR.js} +1 -1
  68. package/web/dist/assets/{Laws-D8YXD_XE.js → Laws-CLpdRRk8.js} +1 -1
  69. package/web/dist/assets/{Library-DwuTZ2-L.js → Library-wPPuKQrI.js} +1 -1
  70. package/web/dist/assets/{OperatorHudView-B-HVBqfY.js → OperatorHudView-CiAkAkQL.js} +1 -1
  71. package/web/dist/assets/{Personal-BbUTmZQR.js → Personal-D8CnDo9v.js} +1 -1
  72. package/web/dist/assets/{Tabs-_pjUFIEI.js → Tabs-B4HNrrCs.js} +1 -1
  73. package/web/dist/assets/{drawable-CoIulEH2.js → drawable-BiwaOo6x.js} +1 -1
  74. package/web/dist/assets/{index-BMwSp8BP.js → index-C1yil5j1.js} +2 -2
  75. package/web/dist/index.html +1 -1
  76. package/adapters/copilot/README.md +0 -105
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-C2ELBW-X.js","assets/sections-GalMS0Zv.js","assets/react-B9Z_tXRV.js","assets/Activity-DAzV-qQj.js","assets/usePoll-O0sJEw1Y.js","assets/ActivityDetail-CwEwMtKl.js","assets/Library-DwuTZ2-L.js","assets/Markdown-CkFyfgNf.js","assets/FilterInput-CVyqmYWM.js","assets/Laws-D8YXD_XE.js","assets/Personal-BbUTmZQR.js","assets/Tabs-_pjUFIEI.js","assets/Installs-BiqR8xdO.js","assets/Docs-iZrvQP8J.js"])))=>i.map(i=>d[i]);
2
- import{i as e,n as t,r as n,s as r}from"./sections-GalMS0Zv.js";import{i,n as a,r as o,t as s}from"./react-B9Z_tXRV.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=r(i(),1),l=o(),u=a(),d=typeof window<`u`?window.__GENESEED_TOKEN__:``;async function f(e){let t=await e.json().catch(()=>({})),n=e.status===403&&(t.error||``).startsWith(`forbidden`)?`the web server restarted since this page loaded — reload the page, then re-apply your edit`:t.error||t.message||e.statusText,r=Error(n);return r.status=e.status,r.body=t,r}async function p(e){let t=await fetch(e);if(!t.ok)throw await f(t);return t.json()}async function m(e,t={}){let n=await fetch(e,{method:`POST`,headers:{"X-Geneseed-Token":d||``,"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw await f(n);return n.json()}var h=()=>p(`/api/overview`),g=()=>p(`/api/recent`),_=()=>p(`/api/activity`),v=e=>p(`/api/activity/`+encodeURIComponent(e)),y=e=>m(`/api/activity`,{enabled:e}),b=()=>p(`/api/setup`),x=()=>p(`/api/doctor`),S=()=>p(`/api/themes`),C=e=>p(`/api/catalog/${e}`),w=(e,t)=>p(`/api/item/${e}/${encodeURIComponent(t)}`),T=e=>m(`/api/memory/delete`,{name:e}),E=()=>p(`/api/diff`),D=e=>m(`/api/actions/restore`,{files:e}),O=409,k=e=>p(`/api/jobs/${e}`),A=()=>p(`/api/jobs`),j=e=>m(`/api/jobs/${e}/cancel`);async function M(e,t){try{return await m(`/api/actions/${e}`,t||{})}catch(e){throw e.status===O?Error(`An action is already running.`,{cause:e}):e}}var ee=()=>p(`/api/mcp`),te=(e,t,n)=>m(`/api/mcp`,{path:e,name:t,enabled:n}),ne=e=>m(`/api/reveal`,{path:e}),re=()=>p(`/api/installs`),ie=(e,t,n)=>m(`/api/install`,{host:e,path:t,action:n}),N=(e,t,n)=>m(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),ae=(e,t)=>m(`/api/view`,{host:e,path:t}),oe=()=>m(`/api/pick-folder`,{}),se=()=>p(`/api/ping`),ce=()=>m(`/api/shutdown`),le=()=>m(`/api/restart`),ue=e=>e?`?harness=${encodeURIComponent(e)}`:``,P={overview:h,recent:g,activity:_,activityDetail:v,activityToggle:y,setup:b,doctor:x,themes:S,catalog:C,item:w,memoryDelete:T,diff:E,restore:D,job:k,jobs:A,cancelJob:j,action:M,mcp:ee,mcpToggle:te,mcpReveal:ne,installs:re,installToggle:ie,installRemove:N,selectView:ae,pickFolder:oe,ping:se,shutdown:ce,restart:le,docs:e=>p(`/api/docs${ue(e)}`),docsPage:(e,t)=>p(`/api/docs/page/${encodeURIComponent(e)}${ue(t)}`),rules:()=>p(`/api/rules`),rulesMutate:e=>m(`/api/rules`,e),rulesPromote:e=>m(`/api/rules/promote`,e),profile:()=>p(`/api/profile`),profileSave:e=>m(`/api/profile`,e),excludes:()=>p(`/api/excludes`),excludeMutate:(e,t)=>m(`/api/excludes`,{action:e,path:t})},F=typeof window<`u`,de=F?window:null,fe=F?document:null,I={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},L={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},R={NONE:0,AUTO:1,FORCE:2},z={replace:0,none:1,blend:2},pe=Symbol(),B=Symbol(),me=Symbol(),he=Symbol(),ge=Symbol(),V=1e-11,_e=0xe8d4a51000,ve=1e3,ye=[],be=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),xe=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],Se=xe.reduce((e,t)=>({...e,[t]:t+`(`}),{}),H=()=>{},Ce=e=>e,we=/\)\s*[-.\d]/,Te=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Ee=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,De=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Oe=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,ke=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Ae=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,je=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Me=/([a-z])([A-Z])/g,Ne=/(\*=|\+=|-=)/,Pe=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Fe={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ve,delay:0,loopDelay:0,ease:`out(2)`,composition:z.replace,modifier:Ce,onBegin:H,onBeforeUpdate:H,onUpdate:H,onLoop:H,onPause:H,onComplete:H,onRender:H},Ie={current:null,root:fe},U={defaults:Fe,precision:4,timeScale:1,tickThreshold:200,editor:null},Le={version:`4.5.0`,engine:null};F&&(de.AnimeJS||=[],de.AnimeJS.push(Le));var Re=e=>e.replace(Me,`$1-$2`).toLowerCase(),ze=(e,t)=>e.indexOf(t)===0,Be=Date.now,Ve=Array.isArray,He=e=>e&&e.constructor===Object,Ue=e=>typeof e==`number`&&!isNaN(e),We=e=>typeof e==`string`,Ge=e=>typeof e==`function`,W=e=>e===void 0,Ke=e=>W(e)||e===null,qe=e=>F&&e instanceof SVGElement,Je=e=>Te.test(e),Ye=e=>ze(e,`rgb`),Xe=e=>ze(e,`hsl`),Ze=e=>Je(e)||(Ye(e)||Xe(e))&&(e[e.length-1]===`)`||!we.test(e)),Qe=e=>!U.defaults.hasOwnProperty(e),$e=[`opacity`,`rotate`,`overflow`,`color`],et=(e,t)=>{if($e.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},tt=e=>We(e)?parseFloat(e):e,nt=Math.pow,rt=Math.sqrt,it=Math.sin,at=Math.cos,ot=Math.abs,st=Math.floor,ct=Math.asin,lt=Math.PI,ut=Math.round,dt=(e,t,n)=>e<t?t:e>n?n:e,G=(e,t)=>{if(t<0)return e;if(!t)return ut(e);let n=10**t;return ut(e*n)/n},ft=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,pt=e=>e===1/0?_e:e===-1/0?-_e:e,mt=e=>e<=1e-11?V:pt(G(e,11)),K=e=>Ve(e)?[...e]:e,ht=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=W(i)?t[r]:i}return n},q=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},gt=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},_t=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},vt=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[he],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!W(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:ze(t,`scale`)?`1`:ze(t,`rotate`)||ze(t,`skew`)?`0deg`:`0px`},yt=e=>{let t=``;for(let n=0,r=xe.length;n<r;n++){let r=xe[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${Se[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},bt=[];function xt(e,t){if(!e)return null;let n=bt.length;outer:for(let r=0;r<n;r++){let n=bt[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=bt[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var St=e=>{let t=Ee.exec(e)||De.exec(e),n=W(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},Ct=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},wt=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Tt=e=>{let t=Oe.exec(e)||ke.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=W(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=G(wt(t,e,n+1/3)*255,0),s=G(wt(t,e,n)*255,0),c=G(wt(t,e,n-1/3)*255,0)}return[o,s,c,a]},Et=e=>Ye(e)?St(e):Je(e)?Ct(e):Xe(e)?Tt(e):[0,0,0,1],J=(e,t)=>W(e)?t:e,Dt=(e,t)=>{let n=e.match(Pe),r=t[B]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Ot=(e,t,n,r,i,a)=>{if(Ge(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(We(e)&&ze(e,`var(`)){if(!i)return Dt(e,t);let n=()=>Dt(e,t);return i.func=n,n()}return e},kt=(e,t)=>e[B]?e[me]&&et(e,t)?I.ATTRIBUTE:xe.includes(t)||be.get(t)?I.TRANSFORM:ze(t,`--`)?I.CSS_VAR:t in e.style?I.CSS:t in e?I.OBJECT:I.ATTRIBUTE:I.OBJECT,At=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[ge]||e).getPropertyValue(t);return i===`auto`?`0`:i},jt=(e,t,n,r)=>{let i=W(n)?kt(e,t):n,a=xt(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===I.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===I.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===I.TRANSFORM?vt(e,t,r):i===I.CSS_VAR?At(e,t,r).trimStart():At(e,t,r)},Mt=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,Nt=()=>({t:L.NUMBER,n:0,u:null,o:null,d:null,s:null}),Pt=(e,t)=>{if(t.t=L.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&je.exec(r);if(i)return t.t=L.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Ze(r))return t.t=L.COLOR,t.d=Et(r),t;{let e=r.match(Ae);return t.t=L.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(Ae)||[],t}},Ft=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=K(e._toNumbers),t.s=K(e._strings),t),It=Nt(),Lt=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(G(ft(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},Rt=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=dt(g,-h,o),b=dt(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=V,T=i===R.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=dt(n,0,l),C&&e._currentIteration--,E=e._currentIteration%2,D=b-n*t||0}let k=f^(p&&E),A=e._ease,j=C?k?0:o:k?c-D:D;A&&(j=c*A(j/c)||0);let M=(a?a.backwards:v<g)?!k:!!k;if(e._currentTime=v,e._iterationTime=j,e.backwards=M,S&&!e.began?(e.began=!0,!n&&(!a||!M&&a.began)&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===R.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||j>=_&&y!==o||j<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(M?x*-1:x)>=U.tickThreshold,i=G(e._offset+(a?a._offset:0)+h+j,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==z.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&j<p._startTime))&&(!m||_||j>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=dt(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===I.OBJECT,g=f===L.NUMBER,_=g&&m||n===0||n===1?-1:U.precision,v,y;if(g)v=y=i(G(ft(o._fromNumber,o._toNumber,n),_));else if(f===L.UNIT)y=i(G(ft(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===L.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(ft(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${G(e[0],0)},${G(e[1],0)},${G(e[2],0)},${e[3]})`)}else f===L.COMPLEX&&(v=Lt(o,n,_));if(h&&(o._number=y),!r&&e!==z.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===I.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===I.TRANSFORM?(s!==l&&(l=s,u=s[he]),u[e]=v,d=1):p===I.CSS?c[e]=v:p===I.CSS_VAR&&c.setProperty(e,v)),S&&(O=1)}else o._value=v}else n&&m&&!_&&j<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=yt(u),d=0),o=o._next}!n&&O&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!M&&v>0&&!s||M&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!M):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&(!a||!M&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,O},zt=(e,t,n,r,i)=>{let a=e._currentIteration;if(Rt(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=Be(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;q(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&Rt(t,e,n,1,R.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}q(o,e=>{let t=G((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=Rt(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},Bt={},Vt=(e,t,n)=>{if(n===I.TRANSFORM)return be.get(e)||e;if(n===I.CSS||n===I.ATTRIBUTE&&qe(t)&&e in t.style){let t=Bt[e];if(t)return t;{let t=e&&Re(e);return Bt[e]=t,t}}return e},Ht=(e,t=!1)=>{if(e._hasChildren)q(e,e=>Ht(e,t),!0);else{let n=e;n.pause(),q(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=Ke(o)||o===``;if(e._setter){if(!t&&!s){if(Pt(o,It),It.d){let t=It.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=It.n;e._setter(e.target,e._number,e)}}else if(a===I.OBJECT)!t&&!s&&(i[r]=o);else if(i[B]){if(a===I.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===I.TRANSFORM){let n=i[he];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=yt(n):t.removeProperty(`transform`))}else s?t.removeProperty(Re(r)):t[r]=o}}i[B]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Ut=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ve/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?V:t,r=ve/n;n>Fe.frameRate&&(Fe.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?V:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?R.NONE:(this._lastTickTime=n>=t?e-n%t:e,R.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Wt={animation:null,update:H},Gt=e=>{let t=Wt.animation;return t||(t={duration:V,computeDeltaTime:H,_offset:0,_delay:0,_head:null,_tail:null},Wt.animation=t,Wt.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===L.COMPLEX||e===L.COLOR?K(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),Rt(t,1,1,0,R.FORCE)}),t},Kt=F?requestAnimationFrame:setImmediate,qt=F?cancelAnimationFrame:clearImmediate,Jt=class extends Ut{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Fe,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Be();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(gt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):zt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):R.AUTO),r=i}Wt.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Be()),this.reqId=Kt(Yt)),this}pause(){if(this.reqId)return this.paused=!0,Xt()}resume(){if(this.paused)return this.paused=!1,q(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(U.timeScale===1?1:ve)}set speed(e){let t=e*U.timeScale;this._speed!==t&&(this._speed=t,q(this,e=>e.speed=e._speed))}get timeUnit(){return U.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(U.timeScale!==r){U.timeScale=r,U.tickThreshold=200*r;let e=n?t:ve;this.defaults.duration*=e,this._speed*=e}}get precision(){return U.precision}set precision(e){U.precision=e}},Y=(()=>{let e=new Jt(Be());return F&&(Le.engine=e,fe.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(fe.hidden?e.pause():e.resume())})),e})(),Yt=()=>{Y._head?(Y.reqId=Kt(Yt),Y.update()):Y.reqId=0},Xt=()=>(qt(Y.reqId),Y.reqId=0,Y),Zt={_rep:new WeakMap,_add:new Map},Qt=(e,t,n=`_rep`)=>{let r=Zt[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},$t=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,en=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=V,e._currentTime=V},tn=(e,t)=>{let n=e._composition;if(n===z.replace){let n=e._absoluteStartTime;_t(t,e,$t,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){en(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)en(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=G(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&en(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(q(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;q(e,e=>{e!==t&&q(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===z.blend){let t=Qt(e.target,e.property,`_add`),n=Gt(Zt._add),r=t._head;r||(r={...e},r._composition=z.replace,r._updateDuration=V,r._startTime=0,r._numbers=K(e._fromNumbers),r._number=0,r._next=null,r._prev=null,_t(t,r),_t(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=K(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=K(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}_t(t,e,null,`_prevAdd`,`_nextAdd`)}return e},nn=e=>{let t=e._composition;if(t!==z.none){let n=e.target,r=e.property,i=Zt._rep.get(n)[r];if(gt(i,e,`_prevRep`,`_nextRep`),t===z.blend){let t=Zt._add,i=t.get(n);if(!i)return;let a=i[r],o=Wt.animation;gt(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){gt(a,s,`_prevAdd`,`_nextAdd`),gt(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},rn=(e,t,n)=>{let r=!1;return q(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=Vt(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===I.TRANSFORM&&i._prev&&i._prev._tweenType===I.TRANSFORM&&(i._prev._renderTransforms=1),gt(t,i),nn(i),r=!0)}},!0),r},an=(e,t,n)=>{let r=t||Y,i;if(r._hasChildren){let t=0;q(r,a=>{if(!a._hasChildren){if(i=rn(e,a,n),i&&!a._head)a.cancel(),gt(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?an(e,a,n):a._hasChildren=!1},!0),W(r.iterationDuration)||(r.iterationDuration=t)}else i=rn(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},on=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),sn=e=>e._cancelled?(e._hasChildren?q(e,sn):q(e,e=>{e._composition!==z.none&&tn(e,Qt(e.target,e.property))}),e._cancelled=0,e):e,cn=0,ln=(e,t)=>e._priority>t._priority,un=class extends Ut{constructor(e={},t=null,n=0){super(0),++cn;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Ie.current&&Ie.current.register(this);let b=t?0:Y._lastTickTime,x=t?t.defaults:U.defaults,S=Ge(i)||W(i)?x.delay:+i,C=Ge(a)||W(a)?1/0:+a,w=J(c,x.loop),T=J(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(Y.reqId||Y.requestTick(Be()),D=(Y._lastTickTime-Y._startTime)*U.timeScale),this.id=W(r)?cn:r,this.parent=t,this.duration=pt((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&J(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=H,this._running=!1,this._reversed=+J(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=J(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=J(d,x.frameRate),this._speed=J(f,x.playbackRate),this._priority=+J(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return dt(G(this._currentTime,U.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return dt(G(this._iterationTime,U.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return dt(G(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return dt(G(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*dt(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return sn(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,zt(this,0,1,~~e,R.FORCE),on(this),this._hasChildren&&q(this,on),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&zt(this,this.duration,1,~~e,R.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!W(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*Y._speed);return this._startTime=Be()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?zt(this,V,0,0,R.FORCE):(this._running||=(_t(Y,this,ln),Y._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,Y.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){sn(this),this.completed=!1;let r=this.paused;return this.paused=!0,zt(this,e+this._delay,~~t,~~n,R.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?st(_e/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?q(this,e=>e.cancel(),!0):q(this,nn),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=mt(e);if(t===n)return this;let r=e/t,i=e<=V;return this.duration=i?V:n,this.iterationDuration=i?V:mt(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){zt(this,0,1,0,R.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=H){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=H};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function dn(e){let t=We(e)?Ie.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function fn(e){if(Ke(e))return[];if(!F)return Ve(e)&&e.flat(1/0)||[e];if(Ve(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!Ke(r)){let e=dn(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!Ke(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=dn(e);return t?Array.from(t):[e]}function pn(e){let t=fn(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[pe]){n[pe]=!0;let e=qe(n);(n.nodeType||e)&&(n[B]=!0,n[me]=e,n[he]={})}}return t}var mn={deg:1,rad:180/lt,turn:360},hn={},gn=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===L.UNIT&&i===n)return t;let o=a+i+n,s=hn[o];if(!W(s)&&!r)t.n=s;else{let r;if(i in mn)r=a*mn[i]/mn[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==fe?o:fe.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,hn[o]=r}return t.t,L.UNIT,t.u=n,t},_n=e=>e,vn=(e=1.68)=>t=>nt(t,+e),yn={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},bn=lt/2,xn=lt*2,Sn={"":vn,Quad:vn(2),Cubic:vn(3),Quart:vn(4),Quint:vn(5),Sine:e=>1-at(e*bn),Circ:e=>1-rt(1-e*e),Expo:e=>e?nt(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=nt(2,--n))-1)/11;);return 1/nt(4,3-n)-7.5625*nt((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=dt(+e,1,10),r=dt(+t,V,2),i=r/xn*ct(1/n),a=xn/r;return e=>e===0||e===1?e:-n*nt(2,-10*(1-e))*it((1-e-i)*a)}},Cn=(()=>{let e={linear:_n,none:_n};for(let t in yn)for(let n in Sn){let r=Sn[n],i=yn[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),wn={linear:_n,none:_n},Tn=e=>{if(wn[e])return wn[e];if(e.indexOf(`(`)<=-1){let t=yn[e]||e.includes(`Back`)||e.includes(`Elastic`)?Cn[e]():Cn[e];return t?wn[e]=t:_n}{let t=e.slice(0,-1).split(`(`),n=Cn[t[0]];return n?wn[e]=n(...t[1].split(`,`)):_n}},En=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],Dn=e=>{if(We(e)){for(let t=0,n=En.length;t<n;t++)if(ze(e,En[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),_n}return Ge(e)?e:We(e)?Tn(e):_n},X=Nt(),Z=Nt(),On={},kn={func:null},An={func:null},jn=[null],Mn=[null,null],Nn={to:null},Pn=0,Fn=0,In,Ln,Rn=(e,t)=>{let n={};if(Ve(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(Qe);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];Qe(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=J(t.duration,U.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(Qe(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},zn=class extends un{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Fn;let s=pn(e),c=s.length,l=t.keyframes,u=l?ht(Rn(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:U.defaults,b=J(m,y.ease),x=J(h,y.playbackEase),S=x?Dn(x):null,C=!W(b.ease),w=C?b.ease:J(m,S?`linear`:y.ease),T=C?b.settlingDuration:J(p,y.duration),E=J(f,y.delay),D=g||y.modifier,O=W(_)&&c>=1e3?z.none:W(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,ee=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(Qe(e)){let a=kt(t,e),o=xt(t,e),s=Vt(e,t,a),f=u[e],p=Ve(f);if(i&&!p&&(Mn[0]=f,Mn[1]=f,f=Mn),p){let e=f.length,t=!He(f[0]);e===2&&t?(Nn.to=f,jn[0]=Nn,In=jn):e>2&&t?(In=[],f.forEach((e,t)=>{t?t===1?(Mn[1]=e,In.push(Mn)):In.push(e):Mn[0]=e})):In=f}else jn[0]=f,In=jn;let m=null,h=null,g=NaN,_=0,v=0;for(let e=In.length;v<e;v++){let i=In[v];He(i)?Ln=i:(Nn.to=i,Ln=Nn),kn.func=null,An.func=null;let l=Ot(J(Ln.composition,O),t,r,c,null,null),u=Ue(l)?l:z[l];!m&&u!==z.none&&(m=Qt(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Ot(Ln.to,t,r,c,kn,f),y;He(p)&&!W(p.to)?(Ln=p,y=p.to):y=p;let b=Ot(Ln.from,t,r,c,An,f),x=Ln.ease||w,S=Ot(x,t,r,c,null,f),C=Ge(S)||We(S)?S:x,A=!W(C)&&!W(C.ease),j=A?C.ease:C,te=A?C.settlingDuration:Ot(J(Ln.duration,e>1?Ot(T,t,r,c,null,f)/e:T),t,r,c,null,f),ne=Ot(J(Ln.delay,v?0:E),t,r,c,null,f),re=Ln.modifier||D,ie=!W(b),N=!W(y),ae=Ve(y),oe=ae||ie&&N,se=h?_:0,ce=h?_+ne:ne,le=G(k+ce,12),ue=G(k+se,12);!ee&&(ie||ae)&&(ee=1);let P=h;if(u!==z.none){let e=m._head;for(;e&&e._absoluteStartTime<=le;)if(e._isOverridden||(P=e),e=e._nextRep,e&&e._absoluteStartTime>=le)for(;e;)en(e),e=e._nextRep}if(oe){Pt(ae?Ot(y[0],t,r,c,An,f):b,X),Pt(ae?Ot(y[1],t,r,c,kn,f):y,Z);let e=jt(t,s,a,On);X.t===L.NUMBER&&(P?P._valueType===L.UNIT&&(X.t=L.UNIT,X.u=P._unit):(Pt(e,It),It.t===L.UNIT&&(X.t=L.UNIT,X.u=It.u)))}else N?Pt(y,Z):h?Ft(h,Z):Pt(n&&P&&P.parent.parent===n?P._value:jt(t,s,a,On),Z),ie?Pt(b,X):h?Ft(h,X):Pt(n&&P&&P.parent.parent===n?P._value:jt(t,s,a,On),X);if(X.o&&(X.n=Mt(P?P._toNumber:Pt(jt(t,s,a,On),It).n,X.n,X.o)),Z.o&&(Z.n=Mt(X.n,Z.n,Z.o)),X.t!==Z.t){if(X.t===L.COMPLEX||Z.t===L.COMPLEX){let e=X.t===L.COMPLEX?X:Z,t=X.t===L.COMPLEX?Z:X;t.t=L.COMPLEX,t.s=K(e.s),t.d=e.d.map(()=>t.n)}else if(X.t===L.UNIT||Z.t===L.UNIT){let e=X.t===L.UNIT?X:Z,t=X.t===L.UNIT?Z:X;t.t=L.UNIT,t.u=e.u}else if(X.t===L.COLOR||Z.t===L.COLOR){let e=X.t===L.COLOR?X:Z,t=X.t===L.COLOR?Z:X;t.t=L.COLOR,t.d=e.d.map(()=>0)}}if(X.u!==Z.u){let e=Z.u?X:Z;e=gn(t,e,Z.u?Z.u:X.u,!1)}if(Z.d&&X.d&&Z.d.length!==X.d.length){let e=X.d.length>Z.d.length?X:Z,t=e===X?Z:X;t.d=e.d.map((e,n)=>W(t.d[n])?0:t.d[n]),t.s=K(e.s)}let F=G(+te||1e-11,12),de=On[s];Ke(de)||(On[s]=null);let fe=o?o.set:null;_=G(ce+F,12);let I=X.d,R=Z.d,pe=Z.s,B={parent:this,id:Pn++,property:s,target:t,_value:null,_toFunc:kn.func,_fromFunc:An.func,_ease:Dn(j),_fromNumbers:I?K(I):ye,_toNumbers:R?K(R):ye,_strings:pe?K(pe):ye,_fromNumber:X.n,_toNumber:Z.n,_numbers:I?K(I):ye,_number:X.n,_unit:Z.u,_modifier:re,_currentTime:0,_startTime:ce,_delay:+ne,_updateDuration:F,_changeDuration:F,_absoluteStartTime:le,_absoluteUpdateStartTime:ue,_absoluteEndTime:G(k+_,12),_hasFromValue:ie||ae?1:0,_tweenType:a,_setter:fe,_valueType:Z.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:de,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==z.none&&tn(B,m);let me=B._valueType;if(me===L.COMPLEX)B._value=Lt(B,1,-1);else if(me===L.UNIT)B._value=`${re(B._toNumber)}${B._unit}`;else if(me===L.COLOR){let e=Z.d;B._value=`rgba(${G(e[0],0)},${G(e[1],0)},${G(e[2],0)},${e[3]})`}else B._value=re(B._toNumber);isNaN(g)&&(g=B._startTime),h=B,M++,_t(this,B)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===I.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;q(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===z.blend&&q(Wt.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),j?(q(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=V,this.iterationCount=0),this.targets=s,this.id=W(d)?Fn:d,this.duration=A===1e-11?V:pt((A+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=j,this.iterationDuration=A,!this._autoplay&&ee&&this.onRender(this)}stretch(e){let t=this.duration;if(t===mt(e))return this;let n=e/t;return q(this,e=>{e._updateDuration=mt(e._updateDuration*n),e._changeDuration=mt(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return q(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Pt(n(),X),X.u!==e._unit&&e.target[B]&&gn(e.target,X,e._unit,!0),e._fromNumbers=K(X.d),e._fromNumber=X.n):t&&(Pt(jt(e.target,e.property,e._tweenType),It),e._fromNumbers=K(It.d),e._fromNumber=It.n),t&&(Pt(t(),Z),e._toNumbers=K(Z.d),e._strings=K(Z.s),e._toNumber=Z.o?Mt(e._fromNumber,Z.n,Z.o):Z.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Ht(this)}then(e){return super.then(e)}},Bn=(e,t)=>U.editor?U.editor.addAnimation(e,t):new zn(e,t,null,0,!1).init(),Vn=(e,t)=>{if(ze(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},Hn=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),W(t))return n;if(Ue(+t))return+t;let r=t,i=e?e.labels:null,a=!Ke(i),o=Vn(e,r),s=!W(o),c=Ne.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return Mt(s?o:a?l:n,+t[1],e[0])}return s?o:a?W(i[r])?n:i[r]:n},Un=(e,t)=>{if(!W(t))return U.editor&&U.editor.addSet?U.editor.addSet(e,t):(t.duration=V,t.composition=J(t.composition,z.none),new zn(e,t,null,0,!0).resume())},Wn=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Gn=0,Kn=(e,t=0,n=1,r=0)=>{let i=e===void 0?Gn++:e;return(e=t,a=n,o=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let s=10**o;return Math.floor((((i^i>>>14)>>>0)/4294967296*(a-e+1/s)+e)*s)/s}},qn=(e,t=Wn)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},Jn=(e,t={})=>{let n=[],r=0,i,a=null,o=t.from,s=t.reversed,c=t.ease,l=!W(c),u=l&&!W(c.ease)?c.ease:l?Dn(c):null,d=t.grid,f=d===!0,p=t.axis,m=t.total,h=W(o)||o===0||o===`first`,g=o===`center`,_=o===`last`,v=o===`random`,y=Ve(o),b=Ve(e),x=t.use,S=tt(b?e[0]:e),C=b?tt(e[1]):0,w=je.exec((b?e[1]:e)+``),T=t.start||0+(b?S:0),E=t.seed,D=!W(E)&&E!==!1?Kn(E===!0?0:E):Wn,O=t.jitter,k=!W(O),A=Ve(O),j=A?O[0]:O||0,M=A?O[1]:O||0,ee=h?0:Ue(o)?o:0;return(e,c,l,h,E)=>{let[O]=pn(e),A=W(m)?l.length:m,te=W(x)?!1:Ge(x)?x(O,c,A):jt(O,x),ne=Ue(te)||We(te)&&Ue(+te)?+te:c,re=ne>=0&&ne<A?ne:c;if(g&&(ee=(A-1)/2),_&&(ee=A-1),!n.length){if(f){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,c=-1/0,u=-1/0,d=[],f=[],m=[];for(let n=0;n<A;n++){let o=l[n],p=0,h=0,g=0,_=!1;if(o&&Ge(o.getBoundingClientRect)){let e=o.getBoundingClientRect();p=e.left+e.width/2,h=e.top+e.height/2,_=!0}else{let e=o;e&&Ue(e.x)&&Ue(e.y)&&(p=e.x,h=e.y,Ue(e.z)&&(g=e.z,t=!0),_=!0)}if(!_){e=!1;break}d.push(p),f.push(h),m.push(g),p<r&&(r=p),h<i&&(i=h),g<a&&(a=g),p>s&&(s=p),h>c&&(c=h),g>u&&(u=g)}if(e){let e=d[0],l=f[0],h=m[0];y?(e=r+o[0]*(s-r),l=i+o[1]*(c-i),h=t?a+(o.length>=3?o[2]:.5)*(u-a):0):g?(e=(r+s)/2,l=(i+c)/2,h=(a+u)/2):_?(e=d[A-1],l=f[A-1],h=m[A-1]):Ue(o)&&(e=d[o],l=f[o],h=m[o]);for(let r=0;r<A;r++){let i=e-d[r],a=l-f[r],o=h-m[r],s=rt(i*i+a*a+(t?o*o:0));p===`x`&&(s=-i),p===`y`&&(s=-a),p===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<A;e++){let t=ot(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<A;e++)n[e]=n[e]/v}else for(let e=0;e<A;e++)n.push(ot(ee-e))}else for(let e=0;e<A;e++)if(!d)n.push(ot(ee-e));else{let t=d.length,r=d[0]*d[1],i,a,s;y?(i=o[0]*(d[0]-1),a=o[1]*(d[1]-1),s=t===3?(o.length>=3?o[2]:.5)*(d[2]-1):0):g?(i=(d[0]-1)/2,a=(d[1]-1)/2,s=t===3?(d[2]-1)/2:0):(i=ee%d[0],a=st(ee/d[0])%d[1],s=t===3?st(ee/r):0);let c=e%d[0],l=st(e/d[0])%d[1],u=t===3?st(e/r):0,f=i-c,m=a-l,h=s-u,_=rt(f*f+m*m+(t===3?h*h:0));p===`x`&&(_=-f),p===`y`&&(_=-m),p===`z`&&(_=-h),n.push(_)}r=n[0];for(let e=1;e<A;e++)n[e]>r&&(r=n[e]);if(u||s)for(let e=0;e<A;e++){let t=n[e];u&&(t=u(t/r)*r),s&&(t=p?-t:ot(r-t)),n[e]=t}if(k){a=Array(A);for(let e=0;e<A;e++)a[e]=D(-1,1,4)}v&&(n=qn(n,D))}let ie=b?(C-S)/r:S;W(i)&&(i=E?Hn(E,W(t.start)?E.iterationDuration:T):T);let N=i+(ie*G(n[re],2)||0);if(k){let e=r?n[re]/r:0,t=j+(M-j)*e;N+=a[re]*t}return t.modifier&&(N=t.modifier(N)),w&&(N=`${N}${w[2]}`),N}};function Yn(){return typeof window>`u`||!window.matchMedia?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Xn(e,t){let n=setTimeout(()=>e.complete(),t+400);return()=>{clearTimeout(n),e.complete()}}function Zn(e,t=700){let n=typeof e==`number`&&Number.isFinite(e)?e:null,r=n!==null&&Yn(),[i,a]=(0,c.useState)(0),o=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!r)return;let e={n:o.current},i=Bn(e,{n,duration:t,ease:`outExpo`,onUpdate:()=>{o.current=e.n,a(e.n)},onComplete:()=>{o.current=n,a(n)}}),s=setTimeout(()=>i.complete(),t+400);return()=>{clearTimeout(s),i.pause()}},[n,t,r]),r?i:n}function Qn({value:e,duration:t}){let n=Zn(e,t);return n===null?e??null:Math.round(n)}function $n(e){let t=(0,c.useRef)(null),n=(0,c.useRef)(null),r=(0,c.useRef)(()=>{}),i=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let a=t.current,o=a?.querySelector(`:scope > .glide`);o&&(r.current=t=>{let r=a.querySelector(e);if(!r){o.style.opacity=`0`,n.current=null;return}let s=a.getBoundingClientRect(),c=r.getBoundingClientRect(),l={translateX:c.left-s.left+a.scrollLeft-a.clientLeft,translateY:c.top-s.top+a.scrollTop-a.clientTop,width:c.width,height:c.height},u=n.current;if(n.current={el:r,...l},!(u&&u.el===r&&[`translateX`,`translateY`,`width`,`height`].every(e=>Math.abs(u[e]-l[e])<.5))){if(o.style.opacity=`1`,i.current&&=(clearTimeout(i.current.t),i.current.anim.pause(),null),t&&u&&u.el!==r&&Yn()){let e=Bn(o,{...l,duration:280,ease:`outExpo`});i.current={anim:e,t:setTimeout(()=>e.complete(),680)}}else Un(o,l)}},r.current(!0))}),(0,c.useEffect)(()=>{let e=()=>r.current(!1);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function er(){let e=(0,c.useRef)(null),t=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let n=e.current;if(!n){t.current=null;return}let r=[...n.querySelectorAll(`:scope > [data-flip]`)],i=new Map(r.map(e=>[e.dataset.flip,e.offsetTop])),a=t.current;if(t.current=i,a&&Yn())for(let e of r){let t=a.get(e.dataset.flip);t===void 0?Xn(Bn(e,{opacity:[0,1],translateY:[-12,0],duration:340,ease:`outExpo`}),340):Math.abs(t-i.get(e.dataset.flip))>1&&Xn(Bn(e,{translateY:[t-i.get(e.dataset.flip),0],duration:340,ease:`outExpo`}),340)}}),e}var tr={overview:`Overview`,laws:`Constitution`,library:`Library`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},nr={personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`edits`,`doctor`,`server`]},rr={rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},ir={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},ar=(e,t)=>t!==void 0&&Object.hasOwn(e,t),or=(e,t)=>nr[e].includes(t)?t:nr[e][0];function sr(t){let n=(t||`#/`).slice(2).split(`/`).filter(Boolean),[r,i,a]=n,o=e=>decodeURIComponent(e||``);if(r===`section`||r===`item`){let t=r===`item`&&ar(e,i)?e[i]:i,n=r===`item`?o(a):void 0;return{page:t===`laws`?`laws`:`library`,section:t,item:n}}if(r===`docs`)return{page:`docs`,item:o(n.slice(1).join(`/`))};if(r===`activity`&&i)return{page:`activity`,item:o(i)};if(r===`skills`||r===`agents`)return{page:`library`,section:r};if(r===`personal`||r===`installs`){let e=or(r,i);return a&&e===i?{page:r,tab:e,item:o(a)}:{page:r,tab:e}}if(ar(ir,r)){let[e,t]=ir[r];return t?{page:e,tab:t}:{page:e}}return{page:ar(tr,r)?r:`overview`}}function cr(){let e=()=>sr(typeof window<`u`?window.location.hash:``),[t,n]=(0,c.useState)(e);return(0,c.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}var lr=e=>{window.location.hash=e},ur={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},dr={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},fr=e=>ur[e]||ur.cyan,pr={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`},mr=e=>e===`yellow`||e===`white`||e===`cyan`||e===`green`?`#06100D`:`#FFFFFF`;function hr(e,t,n){if(!e)return;let r=n===`light`,i=r?dr[t]||dr.cyan:fr(t),a=r?`#FFFFFF`:mr(t);r&&t===`white`&&(i=`#566B62`,a=`#FFFFFF`),e.style.setProperty(`--accent`,i),e.style.setProperty(`--accent-2`,dr[t]||dr.cyan),e.style.setProperty(`--accent-ink`,a),e.style.setProperty(`--accent-text`,r?pr[t]||pr.cyan:i)}var gr={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`,inkLight:`#FFFFFF`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`,inkLight:`#FFFFFF`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`,inkLight:`#FFFFFF`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`,inkLight:`#FFFFFF`}};function _r(e,t,n){let r=gr[t];if(!e||!r)return!1;let i=n===`light`;return e.style.setProperty(`--accent`,i?r.light:r.dark),e.style.setProperty(`--accent-2`,r.light),e.style.setProperty(`--accent-ink`,i?r.inkLight:r.ink),e.style.setProperty(`--accent-text`,i?r.light:r.dark),!0}var vr=`#101317`,yr=`#F4F6F8`,br=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},xr=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),Sr=e=>{let[t,n,r]=br(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},Cr=(e,t)=>{let[n,r]=[Sr(e),Sr(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},wr=(e,t,n)=>{let r=br(e),i=br(t);return xr(r.map((e,t)=>e+(i[t]-e)*n))},Tr=(e,t,n,r)=>{let i=e;for(let a=.05;Cr(i,t)<n&&a<=1.0001;a+=.05)i=wr(e,r,a);return i},Er=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function Dr(e,t){let n=t===`light`,r=n?yr:vr,i=n?`#000000`:`#FFFFFF`,a=Tr(e,r,3,i),o=Tr(a,r,4.5,i),s=Cr(a,`#06100D`)>=Cr(a,`#FFFFFF`)?`#06100D`:`#FFFFFF`;return{accent:a,accent2:Tr(a,r,4.5,i),ink:s,text:o}}function Or(e,t,n){if(!e||!Er(t))return!1;let r=Dr(t,n);return e.style.setProperty(`--accent`,r.accent),e.style.setProperty(`--accent-2`,r.accent2),e.style.setProperty(`--accent-ink`,r.ink),e.style.setProperty(`--accent-text`,r.text),!0}function kr(e,t){let[n,r]=(0,c.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return(0,c.useEffect)(()=>{try{localStorage.setItem(e,n)}catch{}},[e,n]),[n,r]}var Ar=`geneseed-mode`;function jr(){let[e,t]=kr(Ar,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var Mr=`geneseed-flavour`,Nr=[{id:`cultivar`,short:`Cultivar`,name:`Cultivar Evolved`,tagline:`The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`matrix`,short:`Matrix`,name:`Matrix`,tagline:`Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],Pr=new Set(Nr.map(e=>e.id)),Fr={a:`cultivar`,b:`atlas`,c:`operator`,d:`cultivar`,e:`matrix`,f:`cultivar`,g:`cultivar`,z:`cultivar`,cb:`matrix`,cm:`cultivar`,greenhouse:`atlas`,heirloom:`cultivar`,aurora:`cultivar`,perspective:`cultivar`,sequencer:`cultivar`,cobalt:`matrix`,cosmic:`cultivar`,neon:`matrix`};function Ir(){return kr(Mr,Lr)}function Lr(e){return Pr.has(e)?e:Fr[e]||`cultivar`}var Rr=`geneseed-accent`,zr=[{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],Br=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:fr(e),tagline:`Always ${t.toLowerCase()}, whatever the voice or skin.`})),Vr=[...zr,...Br],Hr=new Set(Vr.map(e=>e.id)),Ur=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return Er(t)?t.toUpperCase():null},Wr=e=>e&&(Hr.has(e)||Ur(e))?e:`curated`,Gr=e=>Br.find(t=>t.id===e)?.name??null,Kr=e=>{let t=Ur(e);return t?`Your own colour, ${t}.`:Vr.find(t=>t.id===e)?.tagline??``};function qr(){return kr(Rr,Wr)}var Jr=`geneseed-layout`,Yr=[{id:`overview`,short:`Overview`,tagline:`Health, three charts, what needs you.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],Xr=new Set(Yr.map(e=>e.id));function Zr(e){return e&&Xr.has(e)?e:`overview`}function Qr(){return kr(Jr,Zr)}function $r(e){let[t,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)([]),s=()=>P.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,c.useEffect)(()=>{s()},[]),(0,c.useEffect)(()=>{P.themes().then(e=>o(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:a,reload:s}}var ei=1e3;async function ti(e=0){await new Promise(t=>setTimeout(t,e));for(let e=0;e<30;e++)try{await P.ping();break}catch{await new Promise(e=>setTimeout(e,ei))}window.location.reload()}var ni=600;function ri({onFinish:e,onError:t}={}){let[n,r]=(0,c.useState)([]),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{P.jobs().then(({jobs:e})=>{if(!e.length)return;r(e.map(e=>({id:e.id,action:e.action,status:e.status,output:e.output||``,duration:e.duration,started:e.started})));let t=e.find(e=>e.status===`running`);t&&(a(t.id),s(!0))}).catch(()=>{})},[]),(0,c.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i)?.action===`update`,o=setInterval(async()=>{if(!document.hidden)try{let n=await P.job(i);if(r(e=>{let t=e.findIndex(e=>e.id===i);if(t===-1)return e;let r=e[t],a=n.output||``;if(r.output===a&&r.status===n.status&&r.duration===n.duration)return e;let o=e.slice();return o[t]={...r,output:a,status:n.status,duration:n.duration},o}),n.status!==`running`){if(clearInterval(o),a(null),t){ti(2e3);return}e?.(n.status)}}catch{clearInterval(o),t&&ti(0)}},ni);return()=>clearInterval(o)},[i]),{runs:n,activeId:i,consoleOpen:o,setConsoleOpen:s,runAction:async(e,n)=>{try{let{job_id:t}=await P.action(e,n),i=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:i,status:`running`,output:``,started:Date.now()/1e3}]),a(t),s(!0),t}catch(e){t?.(e)}},cancelJob:e=>P.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var ii=new Map;function ai(e,t=[],n=null){let r=n===null?null:`${n}|${t.join(``)}`,[i,a]=(0,c.useState)(()=>r!==null&&ii.has(r)?ii.get(r):null),[o,s]=(0,c.useState)(``),[l,u]=(0,c.useState)(()=>!(r!==null&&ii.has(r))),d=(0,c.useRef)(e),f=(0,c.useRef)(r);(0,c.useLayoutEffect)(()=>{d.current=e,f.current=r});let p=(0,c.useCallback)(()=>(u(!0),s(``),Promise.resolve(d.current()).then(e=>{f.current!==null&&ii.set(f.current,e),a(e)}).catch(e=>s(e.message)).finally(()=>u(!1))),t);return(0,c.useEffect)(()=>{if(f.current!==null&&ii.has(f.current)){a(ii.get(f.current)),s(``),u(!1);return}p()},[p]),{data:i,error:o,loading:l,reload:p,setData:a}}var oi=60,si=3600,ci=86400,li={seconds:90,minutes:5400,hours:36*si};function ui(e){let t=Math.max(0,Date.now()/1e3-e);return t<li.seconds?`${Math.round(t)}s`:t<li.minutes?`${Math.round(t/oi)}m`:t<li.hours?`${Math.round(t/si)}h`:`${Math.round(t/ci)}d`}function di(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var fi={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function pi(e,t){if(!e)return 0;let n=e.doctor?.problems?.length??99,r=e.doctor?.ok?fi.doctorClean:n<=fi.doctorMinorMax?fi.doctorMinor:fi.doctorFail,i=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(e.deployed?fi.deployed:0)+r+(i?fi.versionSynced:0)+(e.diff&&e.diff.missing===0?fi.diskClean:0)}var mi=e=>Math.max(...n.map(t=>e?.[t]??0),1),hi=e=>(e?.edited??0)+(e?.added??0),gi=e=>(e?.laws??0)+(e?.doctrines?.rules??0),Q=s(),_i={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function vi({name:e,className:t=`glyph`,style:n}){return(0,Q.jsx)(`svg`,{className:t,style:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,Q.jsx)(`path`,{d:_i[e]||``})})}function yi({className:e=`sprout`}){return(0,Q.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,Q.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Q.jsx)(`path`,{d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,Q.jsx)(`path`,{d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,Q.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var bi=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],xi=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function Si({n:e,lit:t,count:n,onNavigate:r}){return(0,Q.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,Q.jsx)(vi,{name:e.icon}),(0,Q.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,Q.jsx)(`span`,{className:`sb-count`,children:n})]})}function Ci({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=hi(e.diff)+(e.diff?.missing??0);return(0,Q.jsxs)(`div`,{className:`sb-vitals`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{children:`doctor`}),(0,Q.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{children:`drift`}),(0,Q.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{children:`built`}),(0,Q.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${ui(e.build_epoch)} ago`:`never`})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,children:[(0,Q.jsx)(`span`,{children:`voice`}),(0,Q.jsxs)(`b`,{children:[e.theme||`none`,(0,Q.jsx)(vi,{name:`chevron`})]})]})]})}function wi({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,Q.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{lr(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,Q.jsx)(`span`,{className:`sb-mark`,children:(0,Q.jsx)(yi,{})}),(0,Q.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,Q.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,Q.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),bi.map(r=>(0,Q.jsx)(Si,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page)),(0,Q.jsx)(`div`,{className:`sb-spacer`}),xi.map(t=>(0,Q.jsx)(Si,{n:t,lit:e.page===t.page,onNavigate:i},t.page)),(0,Q.jsx)(Ci,{overview:t,onOpenVoice:r})]})}function Ti({route:e}){return(0,Q.jsx)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:bi.map(t=>(0,Q.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,Q.jsx)(vi,{name:t.icon}),t.label]},t.page))})}var Ei=[{id:`opencode`,label:`OpenCode`,docs:`opencode`,deployAdds:`.opencode/ + AGENT.md`,removeProject:`.opencode/ + AGENT.md + the bundle`,removeGlobal:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`},{id:`claude`,label:`Claude Code`,docs:`claude`,deployAdds:`.claude/ + CLAUDE.md`,removeProject:`.claude/ + the CLAUDE.md block`,removeGlobal:`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`},{id:`bob`,label:`BOB (IBM)`,docs:`claude`,deployAdds:`.bob/ + AGENTS.md`,removeProject:`.bob/ + the AGENTS.md block`,removeGlobal:`~/.bob's agents/skills + the AGENTS.md block + settings hooks`},{id:`copilot`,label:`GitHub Copilot`,docs:`claude`,deployAdds:`.github/ + AGENTS.md`,removeProject:`.github's Geneseed agents/skills + the AGENTS.md block`,removeGlobal:`~/.copilot's agents/skills + the copilot-instructions.md block`},{id:`openclaude`,label:`OpenClaude`,docs:`claude`,deployAdds:`.openclaude/ + its CLAUDE.md`,removeProject:`.openclaude/ + its CLAUDE.md block`,removeGlobal:`~/.openclaude's agents/skills + the CLAUDE.md block + settings hooks`}],Di=e=>Ei.find(t=>t.id===e)||Ei[0],Oi=(e,t)=>t===`project`?Di(e).removeProject:Di(e).removeGlobal,ki=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,Ai=e=>e.scope===`global`?Di(e.host).label:ki(e.path),ji=`geneseed-harness`,Mi=Ei.filter(e=>e.docs===e.id).map(({id:e,label:t})=>({id:e,label:t}));function Ni(e=`opencode`){return kr(ji,t=>Mi.some(e=>e.id===t)?t:e)}function Pi(e){let t=String(e||``);return Ei.find(e=>t.startsWith(e.id))?.docs||`opencode`}function Fi(e=0){let[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(``),s=(0,c.useRef)(null),[l]=Ni(),u=`${e}|${l}`,[d,f]=(0,c.useState)(u);return d!==u&&(f(u),i(null)),(0,c.useEffect)(()=>{s.current=null},[u]),{index:r,error:a,prime:(0,c.useCallback)(()=>{if(r||s.current)return s.current;let e=(async()=>{let e=Object.entries(tr).flatMap(([e,t])=>(nr[e]||[``]).map(n=>{let r=n?t+` / `+rr[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}})),r=[`laws`,`skills`,...n],a=await Promise.all(r.map(async e=>{try{return{sec:e,items:(await P.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of a){let a=t[n];for(let t of i){let i=t.title||t.name;e.push({kind:a.label,sortKey:r.indexOf(n),title:i,desc:t.desc||``,hay:`${i} ${t.desc||``} ${t.name||``}`.toLowerCase(),route:`#/item/${a.type}/${encodeURIComponent(t.name)}`})}}try{let t=await P.mcp(),n=new Set;for(let r of t?.targets||[])for(let t of r.servers||[]){if(n.has(t.name))continue;n.add(t.name);let r=t.label||t.name;e.push({kind:`MCP servers`,sortKey:100,title:r,desc:t.desc||``,hay:`${r} ${t.desc||``} ${t.name||``} mcp`.toLowerCase(),route:`#/installs/hosts`})}}catch{}try{let t=await P.docs(l);for(let n of t?.groups||[])for(let t of n.pages||[])e.push({kind:`Docs`,sortKey:110,title:t.title,desc:n.label,hay:`${t.title||``} ${t.id||``} ${n.label||``}`.toLowerCase(),route:`#/docs/${encodeURIComponent(t.id)}`})}catch{}return i(e),s.current=null,e})().catch(e=>(s.current=null,o(e.message||String(e)),[]));return s.current=e,e},[r,l])}}var Ii=24;function Li(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function Ri(e,t){let n=t.toLowerCase().trim();if(!n||!e)return[];let r=[];for(let t of e){let e=Li(t,n);e>=0&&r.push({e:t,s:e})}return r.sort((e,t)=>e.s-t.s||e.e.sortKey-t.e.sortKey||e.e.title.localeCompare(t.e.title)),r.slice(0,Ii).map(e=>e.e)}function zi(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,Q.jsxs)(Q.Fragment,{children:[e.slice(0,r),(0,Q.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function Bi({query:e,index:t,loading:n,error:r,active:i,onActive:a,onClose:o}){let s=(0,c.useMemo)(()=>Ri(t,e),[t,e]),l=(0,c.useRef)(null),u=s.length>0;(0,c.useLayoutEffect)(()=>{let e=l.current?.querySelectorAll(`[data-spot-row]`);return!u||!e?.length||!Yn()?void 0:Xn(Bn(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:Jn(18),ease:`outQuart`}),220+18*e.length)},[u]),(0,c.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,c.useEffect)(()=>{(l.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let d=e=>{e&&(lr(e.route),o())},f=[],p=null;return s.forEach((e,t)=>{(!p||p.kind!==e.kind)&&(p={kind:e.kind,rows:[]},f.push(p)),p.rows.push({entry:e,index:t})}),e.trim()?(0,Q.jsxs)(`div`,{className:`spotlight`,ref:l,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[r&&!t&&(0,Q.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),n&&!t&&!r&&(0,Q.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),!n&&s.length===0&&t&&(0,Q.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]}),f.map(t=>(0,Q.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,Q.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,Q.jsxs)(`div`,{id:`spot-opt-${n}`,"data-spot-row":n,role:`option`,"aria-selected":n===i,className:`spot-row ${n===i?`on`:``}`,onMouseDown:e=>{e.preventDefault(),d(t)},onMouseEnter:()=>a(n),children:[(0,Q.jsx)(`div`,{className:`spot-title`,children:zi(t.title,e)}),t.desc?(0,Q.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route}-${n}`))]},t.kind))]}):null}function Vi({value:e,onChange:t,dataRev:n}){let r=(0,c.useRef)(null),i=(0,c.useRef)(null),[a,o]=(0,c.useState)(!1),[s,l]=(0,c.useState)(0),{index:u,error:d,prime:f}=Fi(n);(0,c.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),r.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,c.useEffect)(()=>{if(!a)return;let e=e=>{i.current?.contains(e.target)||o(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]);let p=a&&!!e.trim(),m=p&&u?Ri(u,e):[],h=s<m.length?`spot-opt-${s}`:void 0;return(0,Q.jsxs)(`div`,{className:`tb-search`,ref:i,children:[(0,Q.jsx)(vi,{name:`search`,className:`mag glyph`}),(0,Q.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search the harness`,"aria-autocomplete":`list`,"aria-expanded":p,"aria-controls":p?`spotlight-list`:void 0,"aria-activedescendant":h,value:e,onChange:e=>{t(e.target.value),l(0)},onFocus:()=>{o(!0),f()},onKeyDown:n=>{if(p){if(n.key===`ArrowDown`)n.preventDefault(),l(e=>Math.min(e+1,Math.max(m.length-1,0)));else if(n.key===`ArrowUp`)n.preventDefault(),l(e=>Math.max(e-1,0));else if(n.key===`Enter`){let e=m[s];e&&(n.preventDefault(),lr(e.route),o(!1),r.current?.blur())}else n.key===`Escape`&&(n.preventDefault(),e?t(``):(o(!1),r.current?.blur()))}},placeholder:`Search the harness…`,title:`Press / to jump here, or Ctrl-K / ⌘K from inside any field`}),(0,Q.jsx)(`span`,{className:`kbd`,children:`Ctrl K`}),(0,Q.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:p?m.length?`${m.length} results`:`no matches`:``}),p&&(0,Q.jsx)(Bi,{query:e,index:u,loading:!u,error:d,active:s,onActive:l,onClose:()=>{o(!1),r.current?.blur()}})]})}function Hi({installs:e,onSwitch:t}){let n=(e||[]).filter(e=>e.state===`active`);if(n.length<2)return null;let r=n.find(e=>e.selected)||n[0];return(0,Q.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:r.id,onChange:async e=>{let r=n.find(t=>t.id===e.target.value);if(r)try{await P.selectView(r.host,r.path),t?.()}catch{}},children:n.map(e=>(0,Q.jsxs)(`option`,{value:e.id,children:[e.host,` · `,e.scope]},e.id))})}function Ui({children:e,...t}){let n=$n(`button.on`);return(0,Q.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,Q.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function Wi({value:e,onChange:t,labelledBy:n}){let r=Ur(e);return(0,Q.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[zr.map(n=>(0,Q.jsx)(`button`,{type:`button`,className:`accent-src${e===n.id?` on`:``}`,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id)),(0,Q.jsxs)(`div`,{className:`accent-swatches`,children:[Br.map(n=>(0,Q.jsx)(`button`,{type:`button`,className:`accent-swatch${e===n.id?` on`:``}`,style:{"--sw":n.hex},"aria-pressed":e===n.id,"aria-label":`${n.short} accent`,title:n.short,onClick:()=>t(n.id)},n.id)),(0,Q.jsx)(`label`,{className:`accent-swatch accent-custom${r?` on picked`:``}`,style:r?{"--sw":r}:void 0,title:r?`Your colour, ${r}`:`Pick any colour`,children:(0,Q.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function Gi({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o}){let s=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&!e.target.closest?.(`.tb-pop-anchor`)&&o()},t=e=>{e.key===`Escape`&&o()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[o]);let l=(e,t,n,r,i)=>(0,Q.jsxs)(`div`,{className:`ap-group`,children:[(0,Q.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,Q.jsx)(Ui,{"aria-labelledby":e,children:n.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,Q.jsxs)(`div`,{className:`appearance-pop`,ref:s,role:`dialog`,"aria-label":`Appearance`,children:[l(`ap-skin`,`Skin`,Nr,e,t),(0,Q.jsxs)(`div`,{className:`ap-group`,children:[(0,Q.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,Q.jsx)(Wi,{value:n,onChange:r,labelledBy:`ap-accent`})]}),l(`ap-view`,`Overview view`,Yr,i,a)]})}function Ki({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,query:a,onQuery:o,mode:s,onToggleMode:l,appearance:u,dataRev:d,onSwitch:f}){let[p,m]=(0,c.useState)(!1),h=r?.install,g=h?`${h.host}:${h.scope}`:di(r?.target),_=e.tab&&rr[e.tab];return(0,Q.jsxs)(`header`,{className:`topbar`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`tb-menu iconbtn`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,Q.jsx)(vi,{name:t?`x`:`menu`})}),(0,Q.jsxs)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:[(0,Q.jsx)(`span`,{className:`crumb-root mono`,title:r?.target||void 0,children:g}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,Q.jsx)(`span`,{className:_?``:`crumb-here`,"aria-current":_?void 0:`page`,children:tr[e.page]}),_?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,Q.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:_})]}):null]}),(0,Q.jsx)(`div`,{className:`topbar-spacer`}),(0,Q.jsx)(Hi,{installs:i,onSwitch:f}),(0,Q.jsx)(Vi,{value:a,onChange:o,dataRev:d}),(0,Q.jsxs)(`div`,{className:`tb-pop-anchor`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`iconbtn`,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":p,onClick:()=>m(e=>!e),children:(0,Q.jsx)(vi,{name:`themes`})}),p?(0,Q.jsx)(Gi,{...u,onClose:()=>m(!1)}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`iconbtn`,title:s===`light`?`Switch to dark`:`Switch to light`,"aria-label":s===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:l,children:(0,Q.jsx)(vi,{name:s===`light`?`moon`:`sun`})})]})}function qi({themes:e,current:t,onPick:n,onClose:r}){let i=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,c.useEffect)(()=>{i.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,Q.jsxs)(`div`,{className:`pop`,ref:i,role:`menu`,"aria-label":`Switch voice`,children:[(0,Q.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,Q.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:()=>n(e.name),children:[(0,Q.jsx)(`span`,{className:`po`,style:{background:fr(e.accent),boxShadow:`0 0 8px ${fr(e.accent)}`}}),(0,Q.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var Ji=3500;function Yi({toast:e,onClose:t}){return(0,c.useEffect)(()=>{let e=setTimeout(t,Ji);return()=>clearTimeout(e)},[e]),(0,Q.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:`status`,"aria-live":e.kind===`err`?void 0:`polite`,children:[(0,Q.jsx)(`div`,{children:e.msg}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:(0,Q.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})}function Xi({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,c.useRef)(null),l=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=l.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let u=e.length?e[e.length-1].output.length:0;return(0,c.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,u,t]),(0,Q.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,Q.jsxs)(`div`,{className:`console-head`,ref:l,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[a&&(0,Q.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`ttl`,children:[(0,Q.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,Q.jsx)(`span`,{className:`count`,children:e.length}),(0,Q.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,Q.jsx)(vi,{name:`clear`})}),(0,Q.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,Q.jsx)(vi,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,Q.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,Q.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,Q.jsxs)(`div`,{className:`run`,children:[(0,Q.jsxs)(`div`,{className:`run-head`,children:[(0,Q.jsx)(`span`,{className:`pr`,children:`$`}),(0,Q.jsx)(`span`,{className:`act`,children:e.action}),(0,Q.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,Q.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,Q.jsx)(vi,{name:`x`})})]}),e.output&&(0,Q.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Zi=550,Qi=`gs-splash-seen`;function $i(){try{if(window.localStorage.getItem(Qi))return 0;window.localStorage.setItem(Qi,`1`)}catch{}return Zi}function ea({ready:e,onDone:t}){let[n,r]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=setTimeout(()=>r(!0),$i());return()=>clearTimeout(e)},[]),e&&n&&!i&&a(!0),(0,c.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,Q.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,Q.jsxs)(`div`,{className:`boot-dial`,children:[(0,Q.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,Q.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,Q.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,Q.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,Q.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,Q.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Q.jsx)(`path`,{className:`bs-leaf bs-leaf-main`,d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,Q.jsx)(`path`,{className:`bs-leaf bs-leaf-back`,d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,Q.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,Q.jsxs)(`div`,{className:`boot-status`,children:[(0,Q.jsx)(`span`,{children:`germinating harness`}),(0,Q.jsx)(`span`,{className:`boot-caret`})]})]})}function ta({label:e=`Loading…`}){return(0,Q.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,Q.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,Q.jsx)(`div`,{className:`skel-bar`}),(0,Q.jsx)(`div`,{className:`skel-bar`}),(0,Q.jsx)(`div`,{className:`skel-bar`})]})]})}function na({open:e,title:t,children:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let t=o.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]),(0,Q.jsxs)(`dialog`,{ref:o,className:`confirm`,onCancel:a,onClose:a,children:[(0,Q.jsx)(`h3`,{className:`confirm-title`,children:t}),(0,Q.jsx)(`div`,{className:`confirm-body`,children:n}),(0,Q.jsxs)(`div`,{className:`confirm-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:a,children:`Cancel`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:i,autoFocus:!0,children:r||`Confirm`})]})]})}var ra=(0,c.createContext)(null),ia=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function aa(){return(0,c.useContext)(ra)||ia}function oa({children:e}){let[t,n]=(0,c.useState)(null),r=(0,c.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,c.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,Q.jsxs)(ra.Provider,{value:a,children:[e,(0,Q.jsx)(na,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}var $={security:`oklch(0.74 0.085 45)`,verify:`oklch(0.78 0.075 200)`,process:`oklch(0.76 0.075 150)`,craft:`oklch(0.78 0.085 95)`,context:`oklch(0.74 0.08 280)`,comms:`oklch(0.76 0.085 345)`},sa={security:{label:`Security`,c:$.security},verify:{label:`Verification`,c:$.verify},process:{label:`Process`,c:$.process},craft:{label:`Craft`,c:$.craft},context:{label:`Context`,c:$.context},comms:{label:`Communication`,c:$.comms}},ca={craft:$.craft,rigor:$.verify,ops:$.process,process:$.security,comms:$.comms},la=e=>ca[e]||`var(--text-3)`,ua={design:{label:`Design`,c:$.context},build:{label:`Build`,c:$.craft},review:{label:`Review`,c:$.security},ship:{label:`Ship`,c:$.process},understand:{label:`Understand`,c:$.verify},learn:{label:`Learn`,c:$.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Personal`,c:`oklch(0.72 0.025 250)`}},da=Object.keys(ua);function fa(e){let t=String(e||``),n=/\(retired\)\s*$/i.test(t);t=t.replace(/\s*\(retired\)\s*$/i,``),t=t.replace(/^(?:Rule\s+[IVXLCDM\d]+|Doctrine\s+[a-z]+\s+\d+)\s*[—-]\s*/i,``);let r=t.indexOf(` · `);return r===-1?{latin:``,name:t.trim(),retired:n}:{latin:t.slice(0,r).trim(),name:t.slice(r+3).trim(),retired:n}}var pa=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],ma=e=>{let t=``;for(let[n,r]of pa)for(;e>=n;)t+=r,e-=n;return t};function ha(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?ma(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var ga=new Set([`I`,`IV`,`process.1`,`process.5`]),_a=e=>ga.has(e)?`Hook gate`:`Instruction`;function va(e,t,n){let r=(t?.items||[]).filter(e=>(e.tier??`invariant`)===`invariant`&&fa(e.title).retired).length,i=(e?.laws??0)-r,a=e?.doctrines||{};return[{key:`ethos`,label:`Ethos`,n:e?.ontology??0},{key:`invariants`,label:`Invariants`,n:i,note:t&&r?`+${r} retired`:``},{key:`doctrines`,label:`Doctrines`,n:a.rules??0,note:a.total==null?``:`${a.active} of ${a.total} packs`},{key:`yours`,label:`Your rules`,n:n?.rules??0}]}function ya(e){let t={};for(let n of e||[]){let e=ua[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:ua[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=da.filter(e=>t[e]).map(e=>({...t[e],n:t[e].ok+t[e].exp}));return{rows:n,total:n.reduce((e,t)=>e+t.n,0),experimental:n.reduce((e,t)=>e+t.exp,0),max:Math.max(1,...n.map(e=>e.n))}}function ba(e){return e===`update`?`update`:e===`build-all`?`rebuild`:`other`}function xa(e,t=20){let n=(e||[]).filter(e=>e.status!==`running`).slice(-t),r=Math.max(0,...n.map(e=>e.duration||0));return{bars:n.map(e=>({id:e.id,kind:ba(e.action),ok:e.status===`done`,h:r?Math.max(.06,(e.duration||0)/r):.06,tip:`${e.action} · ${e.status} · ${(e.duration??0).toFixed(1)} s`})),ok:n.filter(e=>e.status===`done`).length,longest:r}}var Sa=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function Ca({overview:e,setup:t,rules:n,activity:r,profile:i,skills:a,laws:o}){let s=[],c=e?.doctor;c&&!c.ok&&s.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${Sa(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=l?hi(l)+(l.missing??0):0;u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${Sa(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=ha(e),i=(o?.items||[]).find(e=>e.name===r),a=i?fa(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${Sa(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=ya(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${Sa(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`library/memory`,verb:`Open`,href:`#/section/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}function wa(e,t){if(e?.doctor&&!e.doctor.ok)return`bad`;let n=e?.diff,r=n?hi(n)+(n.missing??0):0,i=t&&t.installed_fp&&t.installed_fp!==t.source_fp;return r||i?`warn`:`good`}function Ta({error:e,style:t}){return e?(0,Q.jsx)(`p`,{className:`badge bad`,style:t,children:e}):null}function Ea({onAction:e}){let{data:t,error:n}=ai(()=>P.themes(),[]),[r,i]=(0,c.useState)(``),[a,o]=(0,c.useState)(``);if(n)return(0,Q.jsx)(Ta,{error:n});if(!t)return(0,Q.jsx)(ta,{});let s=r||t.current?.theme||`neutral`,l=t.emits?.some(e=>e.name===`opencode-global`),u=a||(l?`opencode-global`:t.current?.emit||t.emits?.[0]?.name||``),d=i,f=o;return(0,Q.jsxs)(`div`,{className:`narrow-lg`,children:[(0,Q.jsx)(`div`,{className:`head-row mb-18`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,Q.jsx)(`p`,{className:`sub`,children:`Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands.`})]})}),(0,Q.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Q.jsx)(`div`,{className:`card-head`,children:(0,Q.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,Q.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,Q.jsxs)(`button`,{className:`btn ${e.name===s?`soft`:`ghost`}`,onClick:()=>d(e.name),title:e.blurb||e.tagline||e.name,children:[(0,Q.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:fr(e.accent),boxShadow:`0 0 8px ${fr(e.accent)}`}}),(0,Q.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,Q.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Q.jsx)(`div`,{className:`card-head`,children:(0,Q.jsx)(`h3`,{children:`2 · Install mode`})}),(0,Q.jsxs)(`p`,{className:`sub mb-16`,children:[(0,Q.jsx)(`code`,{children:`opencode-global`}),` deploys once to your global config so every repo on this machine inherits the harness (recommended). Other modes render into a chosen directory.`]}),(0,Q.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,Q.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,Q.jsx)(`select`,{className:`sel`,value:u,onChange:e=>f(e.target.value),children:t.emits.map(e=>(0,Q.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]})]}),(0,Q.jsxs)(`button`,{className:`btn btn-grid`,disabled:!s||!u,onClick:()=>e(`build`,{theme:s,emit:u}),children:[(0,Q.jsx)(vi,{name:`build`}),`Deploy harness`]})]})}var Da=`modulepreload`,Oa=function(e){return`/`+e},ka={},Aa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Oa(t,n),t=s(t),t in ka)return;ka[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Da,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ja=(0,c.lazy)(()=>Aa(()=>import(`./Dashboard-C2ELBW-X.js`).then(e=>e.t),__vite__mapDeps([0,1,2]))),Ma=(e,t)=>`${t?e/t*100:0}%`,Na=e=>e?new Date(e*1e3).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`}):``;function Pa({overview:e,setup:t}){let n=wa(e,t),r=e.doctor,i=e.diff,a=i?i.edited+i.added+i.missing:null,o=[r?r.ok?`doctor clean${r.checked_at?` at ${r.checked_at.slice(-5)}`:``}`:`doctor found ${r.problems.length} problem${r.problems.length===1?``:`s`}`:`doctor not run yet`,a===null?null:a?`${a} file${a===1?``:`s`} drifted`:`no drift`,t?.installed_fp?t.installed_fp===t.source_fp?`install matches source`:`install is behind its source`:null].filter(Boolean),s={good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[n];return(0,Q.jsxs)(`div`,{className:`health ${n}`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`health-dot`,"aria-hidden":`true`}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`b`,{children:s}),` `,(0,Q.jsx)(`span`,{className:`muted`,children:o.join(` · `)}),` `,t?.installed_fp?(0,Q.jsx)(`span`,{className:`mono dim`,children:t.installed_fp}):null]}),(0,Q.jsx)(`span`,{className:`mono dim health-built`,title:e.build_time||void 0,children:e.build_epoch?`built ${ui(e.build_epoch)} ago`:`never built`})]})}function Fa({counts:e,laws:t,rules:n}){let r=va(e,t,n?.stats),i=r.reduce((e,t)=>e+t.n,0),a=r[1].n+r[2].n+r[3].n;return(0,Q.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ov-const`,children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsx)(`h2`,{id:`ov-const`,children:`Constitution`}),(0,Q.jsxs)(`a`,{className:`mono dim`,href:`#/laws`,children:[a,` in force`]})]}),(0,Q.jsx)(`div`,{className:`stackbar`,"aria-hidden":`true`,children:r.map(e=>e.n?(0,Q.jsx)(`span`,{className:`sb-${e.key}`,style:{width:Ma(e.n,i)}},e.key):null)}),(0,Q.jsx)(`ul`,{className:`legend`,children:r.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{className:`swatch sb-${e.key}`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`legend-label`,children:[e.label,` `,e.note?(0,Q.jsxs)(`span`,{className:`dim`,children:[`(`,e.note,`)`]}):null]}),(0,Q.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function Ia({skills:e}){if(!e)return(0,Q.jsx)(`section`,{className:`panel chart-card`,"aria-busy":`true`});let{rows:t,total:n,experimental:r,max:i}=ya(e.items);return(0,Q.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ov-skills`,children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsx)(`h2`,{id:`ov-skills`,children:`Skills by stage`}),(0,Q.jsxs)(`span`,{className:`mono dim`,children:[n,` · `,r,` experimental`]})]}),(0,Q.jsx)(`ul`,{className:`hbars`,children:t.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{className:`hb-label`,children:e.label}),(0,Q.jsxs)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:[(0,Q.jsx)(`span`,{className:`hb-ok`,style:{width:Ma(e.ok,i)}}),(0,Q.jsx)(`span`,{className:`hb-exp`,style:{width:Ma(e.exp,i)}})]}),(0,Q.jsx)(`span`,{className:`mono hb-n`,"aria-label":`${e.n}, ${e.exp} experimental`,children:e.n})]},e.key))}),(0,Q.jsxs)(`div`,{className:`chart-key`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`key-ok`}),` approved`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`key-exp`}),` experimental`]})]})]})}function La({runs:e}){let{bars:t,ok:n,longest:r}=xa(e),i=(e||[]).filter(e=>e.status!==`running`).slice(-20);return(0,Q.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ov-runs`,children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsxs)(`h2`,{id:`ov-runs`,children:[`Runs · last `,t.length||20]}),(0,Q.jsx)(`span`,{className:`mono ${n===t.length?`t-good`:`t-warn`}`,children:t.length?`${n}/${t.length} ok`:`none yet`})]}),(0,Q.jsx)(`div`,{className:`vbars`,role:`img`,"aria-label":`${t.length} runs, ${n} succeeded`,children:t.map(e=>(0,Q.jsx)(`span`,{title:e.tip,className:`vb-${e.ok?e.kind:`failed`}`,style:{height:`${Math.round(e.h*100)}%`}},e.id))}),(0,Q.jsxs)(`div`,{className:`chart-axis mono dim`,children:[(0,Q.jsx)(`span`,{children:Na(i[0]?.started)}),t.length?(0,Q.jsxs)(`span`,{children:[`longest `,r.toFixed(1),` s`]}):null,(0,Q.jsx)(`span`,{children:Na(i[i.length-1]?.started)})]}),(0,Q.jsxs)(`div`,{className:`chart-key`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`vb-update`}),` update`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`vb-rebuild`}),` rebuild`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`vb-other`}),` install / build`]})]})]})}function Ra({rows:e}){return(0,Q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ov-needs`,children:[(0,Q.jsx)(`div`,{className:`panel-head panel-head-rule`,children:(0,Q.jsxs)(`h2`,{id:`ov-needs`,children:[`Needs attention `,(0,Q.jsx)(`span`,{className:`mono dim`,children:e.length})]})}),e.length?(0,Q.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,Q.jsxs)(`span`,{className:`needs-what`,children:[(0,Q.jsx)(`b`,{children:e.title}),e.detail?(0,Q.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,Q.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),(0,Q.jsx)(`a`,{className:`needs-verb`,href:e.href,children:e.verb})]},e.id))}):(0,Q.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function za({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s=`overview`,dataRev:l}){let u=s===`overview`&&!!e?.deployed,d=e=>e.catch(()=>null),f=Promise.resolve(null),{data:p}=ai(()=>u?d(P.rules()):f,[u,l]),{data:m}=ai(()=>u?d(P.activity()):f,[u,l]),{data:h}=ai(()=>u?d(P.profile()):f,[u,l]),{data:g}=ai(()=>u?d(P.catalog(`skills`)):f,[u,l],`catalog:skills`),{data:_}=ai(()=>u?d(P.catalog(`laws`)):f,[u,l],`catalog:laws`);if(!e)return t?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Ta,{error:`Could not load the harness overview: ${t}`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:n,children:`Retry`})]}):(0,Q.jsx)(ta,{});if(!e.deployed)return(0,Q.jsx)(Ea,{onAction:o});let v=Ca({overview:e,setup:i,rules:p,activity:m,profile:h,skills:g,laws:_});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`page-head`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`h`,children:`Overview`}),(0,Q.jsx)(`p`,{className:`sub`,children:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(`div`,{className:`page-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`doctor`),children:`Run doctor`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`build-all`),children:`Rebuild`})]})]}),u?(0,Q.jsxs)(`div`,{className:`ov-stack`,children:[(0,Q.jsx)(Pa,{overview:e,setup:i}),(0,Q.jsxs)(`div`,{className:`ov-charts`,children:[(0,Q.jsx)(Fa,{counts:e.counts,laws:_,rules:p}),(0,Q.jsx)(Ia,{skills:g}),(0,Q.jsx)(La,{runs:a})]}),(0,Q.jsx)(Ra,{rows:v})]}):(0,Q.jsx)(c.Suspense,{fallback:(0,Q.jsx)(ta,{}),children:(0,Q.jsx)(ja,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s,dataRev:l})})]})}var Ba=(0,c.lazy)(()=>Aa(()=>import(`./Activity-DAzV-qQj.js`),__vite__mapDeps([3,1,2,4]))),Va=(0,c.lazy)(()=>Aa(()=>import(`./ActivityDetail-CwEwMtKl.js`),__vite__mapDeps([5,1,2,4]))),Ha=(0,c.lazy)(()=>Aa(()=>import(`./Library-DwuTZ2-L.js`),__vite__mapDeps([6,1,2,7,8]))),Ua=(0,c.lazy)(()=>Aa(()=>import(`./Laws-D8YXD_XE.js`),__vite__mapDeps([9,1,2,8]))),Wa=(0,c.lazy)(()=>Aa(()=>import(`./Personal-BbUTmZQR.js`),__vite__mapDeps([10,1,2,7,11,6,8]))),Ga=(0,c.lazy)(()=>Aa(()=>import(`./Installs-BiqR8xdO.js`),__vite__mapDeps([12,1,2,11]))),Ka=(0,c.lazy)(()=>Aa(()=>import(`./Docs-iZrvQP8J.js`),__vite__mapDeps([13,1,2,7])));function qa(){let e=cr(),[t,n]=(0,c.useState)(``),[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(!1),[s,u]=jr(),[d,f]=Ir(),p=e=>{if(!document.startViewTransition||!Yn())return f(e);document.startViewTransition(()=>(0,l.flushSync)(()=>f(e)))},[m,h]=qr(),[g,_]=Qr(),[v,y]=(0,c.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[b,x]=(0,c.useState)(!1),S=(0,c.useRef)(null),C=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!b)return;let e=e=>{e.key===`Escape`&&x(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]),(0,c.useEffect)(()=>{if(!b)return;let e=C.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[b]);let w=e=>i({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:T,error:E,themes:D,reload:O}=$r(w),[k,A]=(0,c.useState)(0),j=()=>{O(),A(e=>e+1)},[M,ee]=(0,c.useState)(null),{runs:te,activeId:ne,consoleOpen:re,setConsoleOpen:ie,runAction:N,cancelJob:ae,clearRuns:oe}=ri({onFinish:e=>{j(),ee({status:e,at:Date.now()})},onError:w}),{data:se}=ai(()=>P.setup().catch(()=>null),[k],`setup`),{data:ce}=ai(()=>P.installs().catch(()=>null),[k],`installs`),le=ce?.installs||null,ue=te[te.length-1],F=ue?ue.status===`running`?`${ue.action} running`:`${ue.action} ${ue.status}`:``;(0,c.useEffect)(()=>{let e=S.current;if(!e||Or(e,Ur(m),s))return;let t=Gr(m);if(t)return hr(e,t,s);_r(e,d,s)||T?.accent&&hr(e,T.accent,s)},[T,s,m,d]);let de={flavour:d,onFlavour:p,accentMode:m,onAccentMode:h,layout:g,onLayout:_};return(0,Q.jsx)(`div`,{className:`app fl-${d} ${s===`light`?`light`:``}${b?` nav-open`:``}`,ref:S,children:(0,Q.jsxs)(oa,{children:[(0,Q.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,Q.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,Q.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:F}),b&&(0,Q.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>x(!1)}),(0,Q.jsx)(wi,{route:e,overview:T,installs:le,onOpenVoice:()=>o(e=>!e),onNavigate:()=>x(!1)}),a&&(0,Q.jsx)(qi,{themes:D,current:T?.theme,onPick:e=>{o(!1),N(`build`,{theme:e,emit:T?.emit})},onClose:()=>o(!1)}),(0,Q.jsxs)(`div`,{className:`col`,ref:C,children:[(0,Q.jsx)(Ki,{route:e,navOpen:b,onToggleNav:()=>x(e=>!e),overview:T,installs:le,query:t,onQuery:n,mode:s,onToggleMode:u,appearance:de,dataRev:k,onSwitch:j}),(0,Q.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,Q.jsx)(`div`,{className:e.page===`library`?`pad pad-wide`:`pad`,children:(0,Q.jsx)(c.Suspense,{fallback:(0,Q.jsx)(ta,{}),children:{overview:()=>(0,Q.jsx)(za,{overview:T,overviewError:E,onRetry:O,themes:D,setup:se,runs:te,onAction:N,layout:g,dataRev:k}),laws:()=>(0,Q.jsx)(Ua,{selected:e.item,overview:T,setup:se,onAction:N,dataRev:k}),library:()=>(0,Q.jsx)(Ha,{overview:T,section:e.section,selected:e.item,dataRev:k}),personal:()=>(0,Q.jsx)(Wa,{tab:e.tab,item:e.item,setup:se,dataRev:k}),installs:()=>(0,Q.jsx)(Ga,{tab:e.tab,overview:T,setup:se,themes:D,onAction:N,onMutated:j,dataRev:k,appearance:de}),activity:()=>e.item?(0,Q.jsx)(Va,{sid:e.item},e.item):(0,Q.jsx)(Ba,{}),docs:()=>(0,Q.jsx)(Ka,{page:e.item,query:t,onAction:N,overview:T})}[e.page]?.()})})}),(0,Q.jsx)(Ti,{route:e}),(0,Q.jsx)(Xi,{runs:te,open:re,busy:!!ne,finish:M,onToggle:()=>ie(e=>!e),onClear:oe,onCancel:ae})]}),r&&(0,Q.jsx)(Yi,{toast:r,onClose:()=>i(null)}),v&&(0,Q.jsx)(ea,{ready:!!T||!!E,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}y(!1)}})]})})}(0,u.createRoot)(document.getElementById(`root`)).render((0,Q.jsx)(qa,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{zt as $,ei as A,Xn as B,vi as C,ui as D,pi as E,nr as F,Hn as G,er as H,rr as I,Dn as J,zn as K,lr as L,Yr as M,Kr as N,gi as O,Nr as P,Ht as Q,Qn as R,Oi as S,mi as T,Jn as U,Zn as V,Un as W,un as X,fn as Y,an as Z,Pi as _,R as _t,ha as a,Ue as at,Di as b,ca as c,W as ct,la as d,rt as dt,J as et,aa as f,U as ft,Mi as g,ge as gt,Ui as h,V as ht,_a as i,Ge as it,ti as j,ai as k,ua as l,ht as lt,Wi as m,z as mt,Ea as n,pt as nt,fa as o,He as ot,ta as p,ve as pt,Bn as q,Ta as r,q as rt,sa as s,We as st,Aa as t,_t as tt,da as u,mt as ut,Ni as v,P as vt,hi as w,Ai as x,Ei as y,Yn as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-OkC_PCH6.js","assets/sections-GalMS0Zv.js","assets/react-B9Z_tXRV.js","assets/Activity-BjVp522q.js","assets/usePoll-O0sJEw1Y.js","assets/ActivityDetail-8ep1bspW.js","assets/Library-wPPuKQrI.js","assets/Markdown-CkFyfgNf.js","assets/FilterInput-CVyqmYWM.js","assets/Laws-CLpdRRk8.js","assets/Personal-D8CnDo9v.js","assets/Tabs-B4HNrrCs.js","assets/Installs-BtGGdoTt.js","assets/Docs-CKPWz00o.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t,r as n,s as r}from"./sections-GalMS0Zv.js";import{i,n as a,r as o,t as s}from"./react-B9Z_tXRV.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=r(i(),1),l=o(),u=a(),d=typeof window<`u`?window.__GENESEED_TOKEN__:``;async function f(e){let t=await e.json().catch(()=>({})),n=e.status===403&&(t.error||``).startsWith(`forbidden`)?`the web server restarted since this page loaded — reload the page, then re-apply your edit`:t.error||t.message||e.statusText,r=Error(n);return r.status=e.status,r.body=t,r}async function p(e){let t=await fetch(e);if(!t.ok)throw await f(t);return t.json()}async function m(e,t={}){let n=await fetch(e,{method:`POST`,headers:{"X-Geneseed-Token":d||``,"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw await f(n);return n.json()}var h=()=>p(`/api/overview`),g=()=>p(`/api/recent`),_=()=>p(`/api/activity`),v=e=>p(`/api/activity/`+encodeURIComponent(e)),y=e=>m(`/api/activity`,{enabled:e}),b=()=>p(`/api/setup`),x=()=>p(`/api/doctor`),S=()=>p(`/api/themes`),C=e=>p(`/api/catalog/${e}`),w=(e,t)=>p(`/api/item/${e}/${encodeURIComponent(t)}`),T=e=>m(`/api/memory/delete`,{name:e}),E=()=>p(`/api/diff`),D=e=>m(`/api/actions/restore`,{files:e}),O=409,k=e=>p(`/api/jobs/${e}`),A=()=>p(`/api/jobs`),j=e=>m(`/api/jobs/${e}/cancel`);async function M(e,t){try{return await m(`/api/actions/${e}`,t||{})}catch(e){throw e.status===O?Error(`An action is already running.`,{cause:e}):e}}var ee=()=>p(`/api/mcp`),te=(e,t,n)=>m(`/api/mcp`,{path:e,name:t,enabled:n}),ne=e=>m(`/api/reveal`,{path:e}),re=()=>p(`/api/installs`),ie=(e,t,n)=>m(`/api/install`,{host:e,path:t,action:n}),N=(e,t,n)=>m(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),ae=(e,t)=>m(`/api/view`,{host:e,path:t}),oe=()=>m(`/api/pick-folder`,{}),se=()=>p(`/api/ping`),ce=()=>m(`/api/shutdown`),le=()=>m(`/api/restart`),ue=e=>e?`?harness=${encodeURIComponent(e)}`:``,P={overview:h,recent:g,activity:_,activityDetail:v,activityToggle:y,setup:b,doctor:x,themes:S,catalog:C,item:w,memoryDelete:T,diff:E,restore:D,job:k,jobs:A,cancelJob:j,action:M,mcp:ee,mcpToggle:te,mcpReveal:ne,installs:re,installToggle:ie,installRemove:N,selectView:ae,pickFolder:oe,ping:se,shutdown:ce,restart:le,docs:e=>p(`/api/docs${ue(e)}`),docsPage:(e,t)=>p(`/api/docs/page/${encodeURIComponent(e)}${ue(t)}`),rules:()=>p(`/api/rules`),rulesMutate:e=>m(`/api/rules`,e),rulesPromote:e=>m(`/api/rules/promote`,e),profile:()=>p(`/api/profile`),profileSave:e=>m(`/api/profile`,e),excludes:()=>p(`/api/excludes`),excludeMutate:(e,t)=>m(`/api/excludes`,{action:e,path:t})},F=typeof window<`u`,de=F?window:null,fe=F?document:null,I={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},L={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},R={NONE:0,AUTO:1,FORCE:2},z={replace:0,none:1,blend:2},pe=Symbol(),B=Symbol(),me=Symbol(),he=Symbol(),ge=Symbol(),V=1e-11,_e=0xe8d4a51000,ve=1e3,ye=[],be=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),xe=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],Se=xe.reduce((e,t)=>({...e,[t]:t+`(`}),{}),H=()=>{},Ce=e=>e,we=/\)\s*[-.\d]/,Te=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Ee=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,De=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Oe=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,ke=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Ae=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,je=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Me=/([a-z])([A-Z])/g,Ne=/(\*=|\+=|-=)/,Pe=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Fe={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ve,delay:0,loopDelay:0,ease:`out(2)`,composition:z.replace,modifier:Ce,onBegin:H,onBeforeUpdate:H,onUpdate:H,onLoop:H,onPause:H,onComplete:H,onRender:H},Ie={current:null,root:fe},U={defaults:Fe,precision:4,timeScale:1,tickThreshold:200,editor:null},Le={version:`4.5.0`,engine:null};F&&(de.AnimeJS||=[],de.AnimeJS.push(Le));var Re=e=>e.replace(Me,`$1-$2`).toLowerCase(),ze=(e,t)=>e.indexOf(t)===0,Be=Date.now,Ve=Array.isArray,He=e=>e&&e.constructor===Object,Ue=e=>typeof e==`number`&&!isNaN(e),We=e=>typeof e==`string`,Ge=e=>typeof e==`function`,W=e=>e===void 0,Ke=e=>W(e)||e===null,qe=e=>F&&e instanceof SVGElement,Je=e=>Te.test(e),Ye=e=>ze(e,`rgb`),Xe=e=>ze(e,`hsl`),Ze=e=>Je(e)||(Ye(e)||Xe(e))&&(e[e.length-1]===`)`||!we.test(e)),Qe=e=>!U.defaults.hasOwnProperty(e),$e=[`opacity`,`rotate`,`overflow`,`color`],et=(e,t)=>{if($e.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},tt=e=>We(e)?parseFloat(e):e,nt=Math.pow,rt=Math.sqrt,it=Math.sin,at=Math.cos,ot=Math.abs,st=Math.floor,ct=Math.asin,lt=Math.PI,ut=Math.round,dt=(e,t,n)=>e<t?t:e>n?n:e,G=(e,t)=>{if(t<0)return e;if(!t)return ut(e);let n=10**t;return ut(e*n)/n},ft=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,pt=e=>e===1/0?_e:e===-1/0?-_e:e,mt=e=>e<=1e-11?V:pt(G(e,11)),K=e=>Ve(e)?[...e]:e,ht=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=W(i)?t[r]:i}return n},q=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},gt=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},_t=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},vt=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[he],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!W(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:ze(t,`scale`)?`1`:ze(t,`rotate`)||ze(t,`skew`)?`0deg`:`0px`},yt=e=>{let t=``;for(let n=0,r=xe.length;n<r;n++){let r=xe[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${Se[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},bt=[];function xt(e,t){if(!e)return null;let n=bt.length;outer:for(let r=0;r<n;r++){let n=bt[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=bt[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var St=e=>{let t=Ee.exec(e)||De.exec(e),n=W(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},Ct=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},wt=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Tt=e=>{let t=Oe.exec(e)||ke.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=W(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=G(wt(t,e,n+1/3)*255,0),s=G(wt(t,e,n)*255,0),c=G(wt(t,e,n-1/3)*255,0)}return[o,s,c,a]},Et=e=>Ye(e)?St(e):Je(e)?Ct(e):Xe(e)?Tt(e):[0,0,0,1],J=(e,t)=>W(e)?t:e,Dt=(e,t)=>{let n=e.match(Pe),r=t[B]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Ot=(e,t,n,r,i,a)=>{if(Ge(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(We(e)&&ze(e,`var(`)){if(!i)return Dt(e,t);let n=()=>Dt(e,t);return i.func=n,n()}return e},kt=(e,t)=>e[B]?e[me]&&et(e,t)?I.ATTRIBUTE:xe.includes(t)||be.get(t)?I.TRANSFORM:ze(t,`--`)?I.CSS_VAR:t in e.style?I.CSS:t in e?I.OBJECT:I.ATTRIBUTE:I.OBJECT,At=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[ge]||e).getPropertyValue(t);return i===`auto`?`0`:i},jt=(e,t,n,r)=>{let i=W(n)?kt(e,t):n,a=xt(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===I.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===I.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===I.TRANSFORM?vt(e,t,r):i===I.CSS_VAR?At(e,t,r).trimStart():At(e,t,r)},Mt=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,Nt=()=>({t:L.NUMBER,n:0,u:null,o:null,d:null,s:null}),Pt=(e,t)=>{if(t.t=L.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&je.exec(r);if(i)return t.t=L.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Ze(r))return t.t=L.COLOR,t.d=Et(r),t;{let e=r.match(Ae);return t.t=L.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(Ae)||[],t}},Ft=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=K(e._toNumbers),t.s=K(e._strings),t),It=Nt(),Lt=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(G(ft(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},Rt=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=dt(g,-h,o),b=dt(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=V,T=i===R.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=dt(n,0,l),C&&e._currentIteration--,E=e._currentIteration%2,D=b-n*t||0}let k=f^(p&&E),A=e._ease,j=C?k?0:o:k?c-D:D;A&&(j=c*A(j/c)||0);let M=(a?a.backwards:v<g)?!k:!!k;if(e._currentTime=v,e._iterationTime=j,e.backwards=M,S&&!e.began?(e.began=!0,!n&&(!a||!M&&a.began)&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===R.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||j>=_&&y!==o||j<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(M?x*-1:x)>=U.tickThreshold,i=G(e._offset+(a?a._offset:0)+h+j,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==z.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&j<p._startTime))&&(!m||_||j>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=dt(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===I.OBJECT,g=f===L.NUMBER,_=g&&m||n===0||n===1?-1:U.precision,v,y;if(g)v=y=i(G(ft(o._fromNumber,o._toNumber,n),_));else if(f===L.UNIT)y=i(G(ft(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===L.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(ft(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${G(e[0],0)},${G(e[1],0)},${G(e[2],0)},${e[3]})`)}else f===L.COMPLEX&&(v=Lt(o,n,_));if(h&&(o._number=y),!r&&e!==z.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===I.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===I.TRANSFORM?(s!==l&&(l=s,u=s[he]),u[e]=v,d=1):p===I.CSS?c[e]=v:p===I.CSS_VAR&&c.setProperty(e,v)),S&&(O=1)}else o._value=v}else n&&m&&!_&&j<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=yt(u),d=0),o=o._next}!n&&O&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!M&&v>0&&!s||M&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!M):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&(!a||!M&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,O},zt=(e,t,n,r,i)=>{let a=e._currentIteration;if(Rt(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=Be(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;q(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&Rt(t,e,n,1,R.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}q(o,e=>{let t=G((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=Rt(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},Bt={},Vt=(e,t,n)=>{if(n===I.TRANSFORM)return be.get(e)||e;if(n===I.CSS||n===I.ATTRIBUTE&&qe(t)&&e in t.style){let t=Bt[e];if(t)return t;{let t=e&&Re(e);return Bt[e]=t,t}}return e},Ht=(e,t=!1)=>{if(e._hasChildren)q(e,e=>Ht(e,t),!0);else{let n=e;n.pause(),q(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=Ke(o)||o===``;if(e._setter){if(!t&&!s){if(Pt(o,It),It.d){let t=It.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=It.n;e._setter(e.target,e._number,e)}}else if(a===I.OBJECT)!t&&!s&&(i[r]=o);else if(i[B]){if(a===I.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===I.TRANSFORM){let n=i[he];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=yt(n):t.removeProperty(`transform`))}else s?t.removeProperty(Re(r)):t[r]=o}}i[B]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Ut=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ve/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?V:t,r=ve/n;n>Fe.frameRate&&(Fe.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?V:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?R.NONE:(this._lastTickTime=n>=t?e-n%t:e,R.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Wt={animation:null,update:H},Gt=e=>{let t=Wt.animation;return t||(t={duration:V,computeDeltaTime:H,_offset:0,_delay:0,_head:null,_tail:null},Wt.animation=t,Wt.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===L.COMPLEX||e===L.COLOR?K(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),Rt(t,1,1,0,R.FORCE)}),t},Kt=F?requestAnimationFrame:setImmediate,qt=F?cancelAnimationFrame:clearImmediate,Jt=class extends Ut{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Fe,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Be();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(gt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):zt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):R.AUTO),r=i}Wt.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Be()),this.reqId=Kt(Yt)),this}pause(){if(this.reqId)return this.paused=!0,Xt()}resume(){if(this.paused)return this.paused=!1,q(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(U.timeScale===1?1:ve)}set speed(e){let t=e*U.timeScale;this._speed!==t&&(this._speed=t,q(this,e=>e.speed=e._speed))}get timeUnit(){return U.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(U.timeScale!==r){U.timeScale=r,U.tickThreshold=200*r;let e=n?t:ve;this.defaults.duration*=e,this._speed*=e}}get precision(){return U.precision}set precision(e){U.precision=e}},Y=(()=>{let e=new Jt(Be());return F&&(Le.engine=e,fe.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(fe.hidden?e.pause():e.resume())})),e})(),Yt=()=>{Y._head?(Y.reqId=Kt(Yt),Y.update()):Y.reqId=0},Xt=()=>(qt(Y.reqId),Y.reqId=0,Y),Zt={_rep:new WeakMap,_add:new Map},Qt=(e,t,n=`_rep`)=>{let r=Zt[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},$t=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,en=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=V,e._currentTime=V},tn=(e,t)=>{let n=e._composition;if(n===z.replace){let n=e._absoluteStartTime;_t(t,e,$t,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){en(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)en(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=G(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&en(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(q(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;q(e,e=>{e!==t&&q(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===z.blend){let t=Qt(e.target,e.property,`_add`),n=Gt(Zt._add),r=t._head;r||(r={...e},r._composition=z.replace,r._updateDuration=V,r._startTime=0,r._numbers=K(e._fromNumbers),r._number=0,r._next=null,r._prev=null,_t(t,r),_t(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=K(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=K(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}_t(t,e,null,`_prevAdd`,`_nextAdd`)}return e},nn=e=>{let t=e._composition;if(t!==z.none){let n=e.target,r=e.property,i=Zt._rep.get(n)[r];if(gt(i,e,`_prevRep`,`_nextRep`),t===z.blend){let t=Zt._add,i=t.get(n);if(!i)return;let a=i[r],o=Wt.animation;gt(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){gt(a,s,`_prevAdd`,`_nextAdd`),gt(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},rn=(e,t,n)=>{let r=!1;return q(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=Vt(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===I.TRANSFORM&&i._prev&&i._prev._tweenType===I.TRANSFORM&&(i._prev._renderTransforms=1),gt(t,i),nn(i),r=!0)}},!0),r},an=(e,t,n)=>{let r=t||Y,i;if(r._hasChildren){let t=0;q(r,a=>{if(!a._hasChildren){if(i=rn(e,a,n),i&&!a._head)a.cancel(),gt(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?an(e,a,n):a._hasChildren=!1},!0),W(r.iterationDuration)||(r.iterationDuration=t)}else i=rn(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},on=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),sn=e=>e._cancelled?(e._hasChildren?q(e,sn):q(e,e=>{e._composition!==z.none&&tn(e,Qt(e.target,e.property))}),e._cancelled=0,e):e,cn=0,ln=(e,t)=>e._priority>t._priority,un=class extends Ut{constructor(e={},t=null,n=0){super(0),++cn;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Ie.current&&Ie.current.register(this);let b=t?0:Y._lastTickTime,x=t?t.defaults:U.defaults,S=Ge(i)||W(i)?x.delay:+i,C=Ge(a)||W(a)?1/0:+a,w=J(c,x.loop),T=J(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(Y.reqId||Y.requestTick(Be()),D=(Y._lastTickTime-Y._startTime)*U.timeScale),this.id=W(r)?cn:r,this.parent=t,this.duration=pt((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&J(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=H,this._running=!1,this._reversed=+J(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=J(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=J(d,x.frameRate),this._speed=J(f,x.playbackRate),this._priority=+J(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return dt(G(this._currentTime,U.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return dt(G(this._iterationTime,U.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return dt(G(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return dt(G(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*dt(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return sn(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,zt(this,0,1,~~e,R.FORCE),on(this),this._hasChildren&&q(this,on),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&zt(this,this.duration,1,~~e,R.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!W(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*Y._speed);return this._startTime=Be()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?zt(this,V,0,0,R.FORCE):(this._running||=(_t(Y,this,ln),Y._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,Y.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){sn(this),this.completed=!1;let r=this.paused;return this.paused=!0,zt(this,e+this._delay,~~t,~~n,R.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?st(_e/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?q(this,e=>e.cancel(),!0):q(this,nn),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=mt(e);if(t===n)return this;let r=e/t,i=e<=V;return this.duration=i?V:n,this.iterationDuration=i?V:mt(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){zt(this,0,1,0,R.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=H){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=H};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function dn(e){let t=We(e)?Ie.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function fn(e){if(Ke(e))return[];if(!F)return Ve(e)&&e.flat(1/0)||[e];if(Ve(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!Ke(r)){let e=dn(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!Ke(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=dn(e);return t?Array.from(t):[e]}function pn(e){let t=fn(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[pe]){n[pe]=!0;let e=qe(n);(n.nodeType||e)&&(n[B]=!0,n[me]=e,n[he]={})}}return t}var mn={deg:1,rad:180/lt,turn:360},hn={},gn=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===L.UNIT&&i===n)return t;let o=a+i+n,s=hn[o];if(!W(s)&&!r)t.n=s;else{let r;if(i in mn)r=a*mn[i]/mn[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==fe?o:fe.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,hn[o]=r}return t.t,L.UNIT,t.u=n,t},_n=e=>e,vn=(e=1.68)=>t=>nt(t,+e),yn={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},bn=lt/2,xn=lt*2,Sn={"":vn,Quad:vn(2),Cubic:vn(3),Quart:vn(4),Quint:vn(5),Sine:e=>1-at(e*bn),Circ:e=>1-rt(1-e*e),Expo:e=>e?nt(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=nt(2,--n))-1)/11;);return 1/nt(4,3-n)-7.5625*nt((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=dt(+e,1,10),r=dt(+t,V,2),i=r/xn*ct(1/n),a=xn/r;return e=>e===0||e===1?e:-n*nt(2,-10*(1-e))*it((1-e-i)*a)}},Cn=(()=>{let e={linear:_n,none:_n};for(let t in yn)for(let n in Sn){let r=Sn[n],i=yn[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),wn={linear:_n,none:_n},Tn=e=>{if(wn[e])return wn[e];if(e.indexOf(`(`)<=-1){let t=yn[e]||e.includes(`Back`)||e.includes(`Elastic`)?Cn[e]():Cn[e];return t?wn[e]=t:_n}{let t=e.slice(0,-1).split(`(`),n=Cn[t[0]];return n?wn[e]=n(...t[1].split(`,`)):_n}},En=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],Dn=e=>{if(We(e)){for(let t=0,n=En.length;t<n;t++)if(ze(e,En[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),_n}return Ge(e)?e:We(e)?Tn(e):_n},X=Nt(),Z=Nt(),On={},kn={func:null},An={func:null},jn=[null],Mn=[null,null],Nn={to:null},Pn=0,Fn=0,In,Ln,Rn=(e,t)=>{let n={};if(Ve(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(Qe);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];Qe(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=J(t.duration,U.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(Qe(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},zn=class extends un{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Fn;let s=pn(e),c=s.length,l=t.keyframes,u=l?ht(Rn(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:U.defaults,b=J(m,y.ease),x=J(h,y.playbackEase),S=x?Dn(x):null,C=!W(b.ease),w=C?b.ease:J(m,S?`linear`:y.ease),T=C?b.settlingDuration:J(p,y.duration),E=J(f,y.delay),D=g||y.modifier,O=W(_)&&c>=1e3?z.none:W(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,ee=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(Qe(e)){let a=kt(t,e),o=xt(t,e),s=Vt(e,t,a),f=u[e],p=Ve(f);if(i&&!p&&(Mn[0]=f,Mn[1]=f,f=Mn),p){let e=f.length,t=!He(f[0]);e===2&&t?(Nn.to=f,jn[0]=Nn,In=jn):e>2&&t?(In=[],f.forEach((e,t)=>{t?t===1?(Mn[1]=e,In.push(Mn)):In.push(e):Mn[0]=e})):In=f}else jn[0]=f,In=jn;let m=null,h=null,g=NaN,_=0,v=0;for(let e=In.length;v<e;v++){let i=In[v];He(i)?Ln=i:(Nn.to=i,Ln=Nn),kn.func=null,An.func=null;let l=Ot(J(Ln.composition,O),t,r,c,null,null),u=Ue(l)?l:z[l];!m&&u!==z.none&&(m=Qt(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Ot(Ln.to,t,r,c,kn,f),y;He(p)&&!W(p.to)?(Ln=p,y=p.to):y=p;let b=Ot(Ln.from,t,r,c,An,f),x=Ln.ease||w,S=Ot(x,t,r,c,null,f),C=Ge(S)||We(S)?S:x,A=!W(C)&&!W(C.ease),j=A?C.ease:C,te=A?C.settlingDuration:Ot(J(Ln.duration,e>1?Ot(T,t,r,c,null,f)/e:T),t,r,c,null,f),ne=Ot(J(Ln.delay,v?0:E),t,r,c,null,f),re=Ln.modifier||D,ie=!W(b),N=!W(y),ae=Ve(y),oe=ae||ie&&N,se=h?_:0,ce=h?_+ne:ne,le=G(k+ce,12),ue=G(k+se,12);!ee&&(ie||ae)&&(ee=1);let P=h;if(u!==z.none){let e=m._head;for(;e&&e._absoluteStartTime<=le;)if(e._isOverridden||(P=e),e=e._nextRep,e&&e._absoluteStartTime>=le)for(;e;)en(e),e=e._nextRep}if(oe){Pt(ae?Ot(y[0],t,r,c,An,f):b,X),Pt(ae?Ot(y[1],t,r,c,kn,f):y,Z);let e=jt(t,s,a,On);X.t===L.NUMBER&&(P?P._valueType===L.UNIT&&(X.t=L.UNIT,X.u=P._unit):(Pt(e,It),It.t===L.UNIT&&(X.t=L.UNIT,X.u=It.u)))}else N?Pt(y,Z):h?Ft(h,Z):Pt(n&&P&&P.parent.parent===n?P._value:jt(t,s,a,On),Z),ie?Pt(b,X):h?Ft(h,X):Pt(n&&P&&P.parent.parent===n?P._value:jt(t,s,a,On),X);if(X.o&&(X.n=Mt(P?P._toNumber:Pt(jt(t,s,a,On),It).n,X.n,X.o)),Z.o&&(Z.n=Mt(X.n,Z.n,Z.o)),X.t!==Z.t){if(X.t===L.COMPLEX||Z.t===L.COMPLEX){let e=X.t===L.COMPLEX?X:Z,t=X.t===L.COMPLEX?Z:X;t.t=L.COMPLEX,t.s=K(e.s),t.d=e.d.map(()=>t.n)}else if(X.t===L.UNIT||Z.t===L.UNIT){let e=X.t===L.UNIT?X:Z,t=X.t===L.UNIT?Z:X;t.t=L.UNIT,t.u=e.u}else if(X.t===L.COLOR||Z.t===L.COLOR){let e=X.t===L.COLOR?X:Z,t=X.t===L.COLOR?Z:X;t.t=L.COLOR,t.d=e.d.map(()=>0)}}if(X.u!==Z.u){let e=Z.u?X:Z;e=gn(t,e,Z.u?Z.u:X.u,!1)}if(Z.d&&X.d&&Z.d.length!==X.d.length){let e=X.d.length>Z.d.length?X:Z,t=e===X?Z:X;t.d=e.d.map((e,n)=>W(t.d[n])?0:t.d[n]),t.s=K(e.s)}let F=G(+te||1e-11,12),de=On[s];Ke(de)||(On[s]=null);let fe=o?o.set:null;_=G(ce+F,12);let I=X.d,R=Z.d,pe=Z.s,B={parent:this,id:Pn++,property:s,target:t,_value:null,_toFunc:kn.func,_fromFunc:An.func,_ease:Dn(j),_fromNumbers:I?K(I):ye,_toNumbers:R?K(R):ye,_strings:pe?K(pe):ye,_fromNumber:X.n,_toNumber:Z.n,_numbers:I?K(I):ye,_number:X.n,_unit:Z.u,_modifier:re,_currentTime:0,_startTime:ce,_delay:+ne,_updateDuration:F,_changeDuration:F,_absoluteStartTime:le,_absoluteUpdateStartTime:ue,_absoluteEndTime:G(k+_,12),_hasFromValue:ie||ae?1:0,_tweenType:a,_setter:fe,_valueType:Z.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:de,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==z.none&&tn(B,m);let me=B._valueType;if(me===L.COMPLEX)B._value=Lt(B,1,-1);else if(me===L.UNIT)B._value=`${re(B._toNumber)}${B._unit}`;else if(me===L.COLOR){let e=Z.d;B._value=`rgba(${G(e[0],0)},${G(e[1],0)},${G(e[2],0)},${e[3]})`}else B._value=re(B._toNumber);isNaN(g)&&(g=B._startTime),h=B,M++,_t(this,B)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===I.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;q(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===z.blend&&q(Wt.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),j?(q(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=V,this.iterationCount=0),this.targets=s,this.id=W(d)?Fn:d,this.duration=A===1e-11?V:pt((A+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=j,this.iterationDuration=A,!this._autoplay&&ee&&this.onRender(this)}stretch(e){let t=this.duration;if(t===mt(e))return this;let n=e/t;return q(this,e=>{e._updateDuration=mt(e._updateDuration*n),e._changeDuration=mt(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return q(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Pt(n(),X),X.u!==e._unit&&e.target[B]&&gn(e.target,X,e._unit,!0),e._fromNumbers=K(X.d),e._fromNumber=X.n):t&&(Pt(jt(e.target,e.property,e._tweenType),It),e._fromNumbers=K(It.d),e._fromNumber=It.n),t&&(Pt(t(),Z),e._toNumbers=K(Z.d),e._strings=K(Z.s),e._toNumber=Z.o?Mt(e._fromNumber,Z.n,Z.o):Z.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Ht(this)}then(e){return super.then(e)}},Bn=(e,t)=>U.editor?U.editor.addAnimation(e,t):new zn(e,t,null,0,!1).init(),Vn=(e,t)=>{if(ze(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},Hn=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),W(t))return n;if(Ue(+t))return+t;let r=t,i=e?e.labels:null,a=!Ke(i),o=Vn(e,r),s=!W(o),c=Ne.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return Mt(s?o:a?l:n,+t[1],e[0])}return s?o:a?W(i[r])?n:i[r]:n},Un=(e,t)=>{if(!W(t))return U.editor&&U.editor.addSet?U.editor.addSet(e,t):(t.duration=V,t.composition=J(t.composition,z.none),new zn(e,t,null,0,!0).resume())},Wn=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Gn=0,Kn=(e,t=0,n=1,r=0)=>{let i=e===void 0?Gn++:e;return(e=t,a=n,o=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let s=10**o;return Math.floor((((i^i>>>14)>>>0)/4294967296*(a-e+1/s)+e)*s)/s}},qn=(e,t=Wn)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},Jn=(e,t={})=>{let n=[],r=0,i,a=null,o=t.from,s=t.reversed,c=t.ease,l=!W(c),u=l&&!W(c.ease)?c.ease:l?Dn(c):null,d=t.grid,f=d===!0,p=t.axis,m=t.total,h=W(o)||o===0||o===`first`,g=o===`center`,_=o===`last`,v=o===`random`,y=Ve(o),b=Ve(e),x=t.use,S=tt(b?e[0]:e),C=b?tt(e[1]):0,w=je.exec((b?e[1]:e)+``),T=t.start||0+(b?S:0),E=t.seed,D=!W(E)&&E!==!1?Kn(E===!0?0:E):Wn,O=t.jitter,k=!W(O),A=Ve(O),j=A?O[0]:O||0,M=A?O[1]:O||0,ee=h?0:Ue(o)?o:0;return(e,c,l,h,E)=>{let[O]=pn(e),A=W(m)?l.length:m,te=W(x)?!1:Ge(x)?x(O,c,A):jt(O,x),ne=Ue(te)||We(te)&&Ue(+te)?+te:c,re=ne>=0&&ne<A?ne:c;if(g&&(ee=(A-1)/2),_&&(ee=A-1),!n.length){if(f){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,c=-1/0,u=-1/0,d=[],f=[],m=[];for(let n=0;n<A;n++){let o=l[n],p=0,h=0,g=0,_=!1;if(o&&Ge(o.getBoundingClientRect)){let e=o.getBoundingClientRect();p=e.left+e.width/2,h=e.top+e.height/2,_=!0}else{let e=o;e&&Ue(e.x)&&Ue(e.y)&&(p=e.x,h=e.y,Ue(e.z)&&(g=e.z,t=!0),_=!0)}if(!_){e=!1;break}d.push(p),f.push(h),m.push(g),p<r&&(r=p),h<i&&(i=h),g<a&&(a=g),p>s&&(s=p),h>c&&(c=h),g>u&&(u=g)}if(e){let e=d[0],l=f[0],h=m[0];y?(e=r+o[0]*(s-r),l=i+o[1]*(c-i),h=t?a+(o.length>=3?o[2]:.5)*(u-a):0):g?(e=(r+s)/2,l=(i+c)/2,h=(a+u)/2):_?(e=d[A-1],l=f[A-1],h=m[A-1]):Ue(o)&&(e=d[o],l=f[o],h=m[o]);for(let r=0;r<A;r++){let i=e-d[r],a=l-f[r],o=h-m[r],s=rt(i*i+a*a+(t?o*o:0));p===`x`&&(s=-i),p===`y`&&(s=-a),p===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<A;e++){let t=ot(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<A;e++)n[e]=n[e]/v}else for(let e=0;e<A;e++)n.push(ot(ee-e))}else for(let e=0;e<A;e++)if(!d)n.push(ot(ee-e));else{let t=d.length,r=d[0]*d[1],i,a,s;y?(i=o[0]*(d[0]-1),a=o[1]*(d[1]-1),s=t===3?(o.length>=3?o[2]:.5)*(d[2]-1):0):g?(i=(d[0]-1)/2,a=(d[1]-1)/2,s=t===3?(d[2]-1)/2:0):(i=ee%d[0],a=st(ee/d[0])%d[1],s=t===3?st(ee/r):0);let c=e%d[0],l=st(e/d[0])%d[1],u=t===3?st(e/r):0,f=i-c,m=a-l,h=s-u,_=rt(f*f+m*m+(t===3?h*h:0));p===`x`&&(_=-f),p===`y`&&(_=-m),p===`z`&&(_=-h),n.push(_)}r=n[0];for(let e=1;e<A;e++)n[e]>r&&(r=n[e]);if(u||s)for(let e=0;e<A;e++){let t=n[e];u&&(t=u(t/r)*r),s&&(t=p?-t:ot(r-t)),n[e]=t}if(k){a=Array(A);for(let e=0;e<A;e++)a[e]=D(-1,1,4)}v&&(n=qn(n,D))}let ie=b?(C-S)/r:S;W(i)&&(i=E?Hn(E,W(t.start)?E.iterationDuration:T):T);let N=i+(ie*G(n[re],2)||0);if(k){let e=r?n[re]/r:0,t=j+(M-j)*e;N+=a[re]*t}return t.modifier&&(N=t.modifier(N)),w&&(N=`${N}${w[2]}`),N}};function Yn(){return typeof window>`u`||!window.matchMedia?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Xn(e,t){let n=setTimeout(()=>e.complete(),t+400);return()=>{clearTimeout(n),e.complete()}}function Zn(e,t=700){let n=typeof e==`number`&&Number.isFinite(e)?e:null,r=n!==null&&Yn(),[i,a]=(0,c.useState)(0),o=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!r)return;let e={n:o.current},i=Bn(e,{n,duration:t,ease:`outExpo`,onUpdate:()=>{o.current=e.n,a(e.n)},onComplete:()=>{o.current=n,a(n)}}),s=setTimeout(()=>i.complete(),t+400);return()=>{clearTimeout(s),i.pause()}},[n,t,r]),r?i:n}function Qn({value:e,duration:t}){let n=Zn(e,t);return n===null?e??null:Math.round(n)}function $n(e){let t=(0,c.useRef)(null),n=(0,c.useRef)(null),r=(0,c.useRef)(()=>{}),i=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let a=t.current,o=a?.querySelector(`:scope > .glide`);o&&(r.current=t=>{let r=a.querySelector(e);if(!r){o.style.opacity=`0`,n.current=null;return}let s=a.getBoundingClientRect(),c=r.getBoundingClientRect(),l={translateX:c.left-s.left+a.scrollLeft-a.clientLeft,translateY:c.top-s.top+a.scrollTop-a.clientTop,width:c.width,height:c.height},u=n.current;if(n.current={el:r,...l},!(u&&u.el===r&&[`translateX`,`translateY`,`width`,`height`].every(e=>Math.abs(u[e]-l[e])<.5))){if(o.style.opacity=`1`,i.current&&=(clearTimeout(i.current.t),i.current.anim.pause(),null),t&&u&&u.el!==r&&Yn()){let e=Bn(o,{...l,duration:280,ease:`outExpo`});i.current={anim:e,t:setTimeout(()=>e.complete(),680)}}else Un(o,l)}},r.current(!0))}),(0,c.useEffect)(()=>{let e=()=>r.current(!1);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function er(){let e=(0,c.useRef)(null),t=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let n=e.current;if(!n){t.current=null;return}let r=[...n.querySelectorAll(`:scope > [data-flip]`)],i=new Map(r.map(e=>[e.dataset.flip,e.offsetTop])),a=t.current;if(t.current=i,a&&Yn())for(let e of r){let t=a.get(e.dataset.flip);t===void 0?Xn(Bn(e,{opacity:[0,1],translateY:[-12,0],duration:340,ease:`outExpo`}),340):Math.abs(t-i.get(e.dataset.flip))>1&&Xn(Bn(e,{translateY:[t-i.get(e.dataset.flip),0],duration:340,ease:`outExpo`}),340)}}),e}var tr={overview:`Overview`,laws:`Constitution`,library:`Library`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},nr={personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`edits`,`doctor`,`server`]},rr={rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},ir={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},ar=(e,t)=>t!==void 0&&Object.hasOwn(e,t),or=(e,t)=>nr[e].includes(t)?t:nr[e][0];function sr(t){let n=(t||`#/`).slice(2).split(`/`).filter(Boolean),[r,i,a]=n,o=e=>decodeURIComponent(e||``);if(r===`section`||r===`item`){let t=r===`item`&&ar(e,i)?e[i]:i,n=r===`item`?o(a):void 0;return{page:t===`laws`?`laws`:`library`,section:t,item:n}}if(r===`docs`)return{page:`docs`,item:o(n.slice(1).join(`/`))};if(r===`activity`&&i)return{page:`activity`,item:o(i)};if(r===`skills`||r===`agents`)return{page:`library`,section:r};if(r===`personal`||r===`installs`){let e=or(r,i);return a&&e===i?{page:r,tab:e,item:o(a)}:{page:r,tab:e}}if(ar(ir,r)){let[e,t]=ir[r];return t?{page:e,tab:t}:{page:e}}return{page:ar(tr,r)?r:`overview`}}function cr(){let e=()=>sr(typeof window<`u`?window.location.hash:``),[t,n]=(0,c.useState)(e);return(0,c.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}var lr=e=>{window.location.hash=e},ur={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},dr={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},fr=e=>ur[e]||ur.cyan,pr={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`},mr=e=>e===`yellow`||e===`white`||e===`cyan`||e===`green`?`#06100D`:`#FFFFFF`;function hr(e,t,n){if(!e)return;let r=n===`light`,i=r?dr[t]||dr.cyan:fr(t),a=r?`#FFFFFF`:mr(t);r&&t===`white`&&(i=`#566B62`,a=`#FFFFFF`),e.style.setProperty(`--accent`,i),e.style.setProperty(`--accent-2`,dr[t]||dr.cyan),e.style.setProperty(`--accent-ink`,a),e.style.setProperty(`--accent-text`,r?pr[t]||pr.cyan:i)}var gr={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`,inkLight:`#FFFFFF`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`,inkLight:`#FFFFFF`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`,inkLight:`#FFFFFF`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`,inkLight:`#FFFFFF`}};function _r(e,t,n){let r=gr[t];if(!e||!r)return!1;let i=n===`light`;return e.style.setProperty(`--accent`,i?r.light:r.dark),e.style.setProperty(`--accent-2`,r.light),e.style.setProperty(`--accent-ink`,i?r.inkLight:r.ink),e.style.setProperty(`--accent-text`,i?r.light:r.dark),!0}var vr=`#101317`,yr=`#F4F6F8`,br=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},xr=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),Sr=e=>{let[t,n,r]=br(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},Cr=(e,t)=>{let[n,r]=[Sr(e),Sr(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},wr=(e,t,n)=>{let r=br(e),i=br(t);return xr(r.map((e,t)=>e+(i[t]-e)*n))},Tr=(e,t,n,r)=>{let i=e;for(let a=.05;Cr(i,t)<n&&a<=1.0001;a+=.05)i=wr(e,r,a);return i},Er=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function Dr(e,t){let n=t===`light`,r=n?yr:vr,i=n?`#000000`:`#FFFFFF`,a=Tr(e,r,3,i),o=Tr(a,r,4.5,i),s=Cr(a,`#06100D`)>=Cr(a,`#FFFFFF`)?`#06100D`:`#FFFFFF`;return{accent:a,accent2:Tr(a,r,4.5,i),ink:s,text:o}}function Or(e,t,n){if(!e||!Er(t))return!1;let r=Dr(t,n);return e.style.setProperty(`--accent`,r.accent),e.style.setProperty(`--accent-2`,r.accent2),e.style.setProperty(`--accent-ink`,r.ink),e.style.setProperty(`--accent-text`,r.text),!0}function kr(e,t){let[n,r]=(0,c.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return(0,c.useEffect)(()=>{try{localStorage.setItem(e,n)}catch{}},[e,n]),[n,r]}var Ar=`geneseed-mode`;function jr(){let[e,t]=kr(Ar,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var Mr=`geneseed-flavour`,Nr=[{id:`cultivar`,short:`Cultivar`,name:`Cultivar Evolved`,tagline:`The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`matrix`,short:`Matrix`,name:`Matrix`,tagline:`Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],Pr=new Set(Nr.map(e=>e.id)),Fr={a:`cultivar`,b:`atlas`,c:`operator`,d:`cultivar`,e:`matrix`,f:`cultivar`,g:`cultivar`,z:`cultivar`,cb:`matrix`,cm:`cultivar`,greenhouse:`atlas`,heirloom:`cultivar`,aurora:`cultivar`,perspective:`cultivar`,sequencer:`cultivar`,cobalt:`matrix`,cosmic:`cultivar`,neon:`matrix`};function Ir(){return kr(Mr,Lr)}function Lr(e){return Pr.has(e)?e:Fr[e]||`cultivar`}var Rr=`geneseed-accent`,zr=[{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],Br=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:fr(e),tagline:`Always ${t.toLowerCase()}, whatever the voice or skin.`})),Vr=[...zr,...Br],Hr=new Set(Vr.map(e=>e.id)),Ur=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return Er(t)?t.toUpperCase():null},Wr=e=>e&&(Hr.has(e)||Ur(e))?e:`curated`,Gr=e=>Br.find(t=>t.id===e)?.name??null,Kr=e=>{let t=Ur(e);return t?`Your own colour, ${t}.`:Vr.find(t=>t.id===e)?.tagline??``};function qr(){return kr(Rr,Wr)}var Jr=`geneseed-layout`,Yr=[{id:`overview`,short:`Overview`,tagline:`Health, three charts, what needs you.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],Xr=new Set(Yr.map(e=>e.id));function Zr(e){return e&&Xr.has(e)?e:`overview`}function Qr(){return kr(Jr,Zr)}function $r(e){let[t,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)([]),s=()=>P.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,c.useEffect)(()=>{s()},[]),(0,c.useEffect)(()=>{P.themes().then(e=>o(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:a,reload:s}}var ei=1e3;async function ti(e=0){await new Promise(t=>setTimeout(t,e));for(let e=0;e<30;e++)try{await P.ping();break}catch{await new Promise(e=>setTimeout(e,ei))}window.location.reload()}var ni=600;function ri({onFinish:e,onError:t}={}){let[n,r]=(0,c.useState)([]),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{P.jobs().then(({jobs:e})=>{if(!e.length)return;r(e.map(e=>({id:e.id,action:e.action,status:e.status,output:e.output||``,duration:e.duration,started:e.started})));let t=e.find(e=>e.status===`running`);t&&(a(t.id),s(!0))}).catch(()=>{})},[]),(0,c.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i)?.action===`update`,o=setInterval(async()=>{if(!document.hidden)try{let n=await P.job(i);if(r(e=>{let t=e.findIndex(e=>e.id===i);if(t===-1)return e;let r=e[t],a=n.output||``;if(r.output===a&&r.status===n.status&&r.duration===n.duration)return e;let o=e.slice();return o[t]={...r,output:a,status:n.status,duration:n.duration},o}),n.status!==`running`){if(clearInterval(o),a(null),t){ti(2e3);return}e?.(n.status)}}catch{clearInterval(o),t&&ti(0)}},ni);return()=>clearInterval(o)},[i]),{runs:n,activeId:i,consoleOpen:o,setConsoleOpen:s,runAction:async(e,n)=>{try{let{job_id:t}=await P.action(e,n),i=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:i,status:`running`,output:``,started:Date.now()/1e3}]),a(t),s(!0),t}catch(e){t?.(e)}},cancelJob:e=>P.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var ii=new Map;function ai(e,t=[],n=null){let r=n===null?null:`${n}|${t.join(``)}`,[i,a]=(0,c.useState)(()=>r!==null&&ii.has(r)?ii.get(r):null),[o,s]=(0,c.useState)(``),[l,u]=(0,c.useState)(()=>!(r!==null&&ii.has(r))),d=(0,c.useRef)(e),f=(0,c.useRef)(r);(0,c.useLayoutEffect)(()=>{d.current=e,f.current=r});let p=(0,c.useCallback)(()=>(u(!0),s(``),Promise.resolve(d.current()).then(e=>{f.current!==null&&ii.set(f.current,e),a(e)}).catch(e=>s(e.message)).finally(()=>u(!1))),t);return(0,c.useEffect)(()=>{if(f.current!==null&&ii.has(f.current)){a(ii.get(f.current)),s(``),u(!1);return}p()},[p]),{data:i,error:o,loading:l,reload:p,setData:a}}var oi=60,si=3600,ci=86400,li={seconds:90,minutes:5400,hours:36*si};function ui(e){let t=Math.max(0,Date.now()/1e3-e);return t<li.seconds?`${Math.round(t)}s`:t<li.minutes?`${Math.round(t/oi)}m`:t<li.hours?`${Math.round(t/si)}h`:`${Math.round(t/ci)}d`}function di(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var fi={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function pi(e,t){if(!e)return 0;let n=e.doctor?.problems?.length??99,r=e.doctor?.ok?fi.doctorClean:n<=fi.doctorMinorMax?fi.doctorMinor:fi.doctorFail,i=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(e.deployed?fi.deployed:0)+r+(i?fi.versionSynced:0)+(e.diff&&e.diff.missing===0?fi.diskClean:0)}var mi=e=>Math.max(...n.map(t=>e?.[t]??0),1),hi=e=>(e?.edited??0)+(e?.added??0),gi=e=>(e?.laws??0)+(e?.doctrines?.rules??0),Q=s(),_i={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function vi({name:e,className:t=`glyph`,style:n}){return(0,Q.jsx)(`svg`,{className:t,style:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,Q.jsx)(`path`,{d:_i[e]||``})})}function yi({className:e=`sprout`}){return(0,Q.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,Q.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Q.jsx)(`path`,{d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,Q.jsx)(`path`,{d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,Q.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var bi=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],xi=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function Si({n:e,lit:t,count:n,onNavigate:r}){return(0,Q.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,Q.jsx)(vi,{name:e.icon}),(0,Q.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,Q.jsx)(`span`,{className:`sb-count`,children:n})]})}function Ci({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=hi(e.diff)+(e.diff?.missing??0);return(0,Q.jsxs)(`div`,{className:`sb-vitals`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{children:`doctor`}),(0,Q.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{children:`drift`}),(0,Q.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{children:`built`}),(0,Q.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${ui(e.build_epoch)} ago`:`never`})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,children:[(0,Q.jsx)(`span`,{children:`voice`}),(0,Q.jsxs)(`b`,{children:[e.theme||`none`,(0,Q.jsx)(vi,{name:`chevron`})]})]})]})}function wi({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,Q.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{lr(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,Q.jsx)(`span`,{className:`sb-mark`,children:(0,Q.jsx)(yi,{})}),(0,Q.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,Q.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,Q.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),bi.map(r=>(0,Q.jsx)(Si,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page)),(0,Q.jsx)(`div`,{className:`sb-spacer`}),xi.map(t=>(0,Q.jsx)(Si,{n:t,lit:e.page===t.page,onNavigate:i},t.page)),(0,Q.jsx)(Ci,{overview:t,onOpenVoice:r})]})}function Ti({route:e}){return(0,Q.jsx)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:bi.map(t=>(0,Q.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,Q.jsx)(vi,{name:t.icon}),t.label]},t.page))})}var Ei=[{id:`opencode`,label:`OpenCode`,docs:`opencode`,deployAdds:`.opencode/ + AGENT.md`,removeProject:`.opencode/ + AGENT.md + the bundle`,removeGlobal:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`},{id:`claude`,label:`Claude Code`,docs:`claude`,deployAdds:`.claude/ + CLAUDE.md`,removeProject:`.claude/ + the CLAUDE.md block`,removeGlobal:`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`},{id:`bob`,label:`BOB (IBM)`,docs:`claude`,deployAdds:`.bob/ + AGENTS.md`,removeProject:`.bob/ + the AGENTS.md block`,removeGlobal:`~/.bob's agents/skills + the AGENTS.md block + settings hooks`},{id:`openclaude`,label:`OpenClaude`,docs:`claude`,deployAdds:`.openclaude/ + its CLAUDE.md`,removeProject:`.openclaude/ + its CLAUDE.md block`,removeGlobal:`~/.openclaude's agents/skills + the CLAUDE.md block + settings hooks`}],Di=e=>Ei.find(t=>t.id===e)||Ei[0],Oi=(e,t)=>t===`project`?Di(e).removeProject:Di(e).removeGlobal,ki=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,Ai=e=>e.scope===`global`?Di(e.host).label:ki(e.path),ji=`geneseed-harness`,Mi=Ei.filter(e=>e.docs===e.id).map(({id:e,label:t})=>({id:e,label:t}));function Ni(e=`opencode`){return kr(ji,t=>Mi.some(e=>e.id===t)?t:e)}function Pi(e){let t=String(e||``);return Ei.find(e=>t.startsWith(e.id))?.docs||`opencode`}function Fi(e=0){let[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(``),s=(0,c.useRef)(null),[l]=Ni(),u=`${e}|${l}`,[d,f]=(0,c.useState)(u);return d!==u&&(f(u),i(null)),(0,c.useEffect)(()=>{s.current=null},[u]),{index:r,error:a,prime:(0,c.useCallback)(()=>{if(r||s.current)return s.current;let e=(async()=>{let e=Object.entries(tr).flatMap(([e,t])=>(nr[e]||[``]).map(n=>{let r=n?t+` / `+rr[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}})),r=[`laws`,`skills`,...n],a=await Promise.all(r.map(async e=>{try{return{sec:e,items:(await P.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of a){let a=t[n];for(let t of i){let i=t.title||t.name;e.push({kind:a.label,sortKey:r.indexOf(n),title:i,desc:t.desc||``,hay:`${i} ${t.desc||``} ${t.name||``}`.toLowerCase(),route:`#/item/${a.type}/${encodeURIComponent(t.name)}`})}}try{let t=await P.mcp(),n=new Set;for(let r of t?.targets||[])for(let t of r.servers||[]){if(n.has(t.name))continue;n.add(t.name);let r=t.label||t.name;e.push({kind:`MCP servers`,sortKey:100,title:r,desc:t.desc||``,hay:`${r} ${t.desc||``} ${t.name||``} mcp`.toLowerCase(),route:`#/installs/hosts`})}}catch{}try{let t=await P.docs(l);for(let n of t?.groups||[])for(let t of n.pages||[])e.push({kind:`Docs`,sortKey:110,title:t.title,desc:n.label,hay:`${t.title||``} ${t.id||``} ${n.label||``}`.toLowerCase(),route:`#/docs/${encodeURIComponent(t.id)}`})}catch{}return i(e),s.current=null,e})().catch(e=>(s.current=null,o(e.message||String(e)),[]));return s.current=e,e},[r,l])}}var Ii=24;function Li(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function Ri(e,t){let n=t.toLowerCase().trim();if(!n||!e)return[];let r=[];for(let t of e){let e=Li(t,n);e>=0&&r.push({e:t,s:e})}return r.sort((e,t)=>e.s-t.s||e.e.sortKey-t.e.sortKey||e.e.title.localeCompare(t.e.title)),r.slice(0,Ii).map(e=>e.e)}function zi(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,Q.jsxs)(Q.Fragment,{children:[e.slice(0,r),(0,Q.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function Bi({query:e,index:t,loading:n,error:r,active:i,onActive:a,onClose:o}){let s=(0,c.useMemo)(()=>Ri(t,e),[t,e]),l=(0,c.useRef)(null),u=s.length>0;(0,c.useLayoutEffect)(()=>{let e=l.current?.querySelectorAll(`[data-spot-row]`);return!u||!e?.length||!Yn()?void 0:Xn(Bn(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:Jn(18),ease:`outQuart`}),220+18*e.length)},[u]),(0,c.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,c.useEffect)(()=>{(l.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let d=e=>{e&&(lr(e.route),o())},f=[],p=null;return s.forEach((e,t)=>{(!p||p.kind!==e.kind)&&(p={kind:e.kind,rows:[]},f.push(p)),p.rows.push({entry:e,index:t})}),e.trim()?(0,Q.jsxs)(`div`,{className:`spotlight`,ref:l,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[r&&!t&&(0,Q.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),n&&!t&&!r&&(0,Q.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),!n&&s.length===0&&t&&(0,Q.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]}),f.map(t=>(0,Q.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,Q.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,Q.jsxs)(`div`,{id:`spot-opt-${n}`,"data-spot-row":n,role:`option`,"aria-selected":n===i,className:`spot-row ${n===i?`on`:``}`,onMouseDown:e=>{e.preventDefault(),d(t)},onMouseEnter:()=>a(n),children:[(0,Q.jsx)(`div`,{className:`spot-title`,children:zi(t.title,e)}),t.desc?(0,Q.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route}-${n}`))]},t.kind))]}):null}function Vi({value:e,onChange:t,dataRev:n}){let r=(0,c.useRef)(null),i=(0,c.useRef)(null),[a,o]=(0,c.useState)(!1),[s,l]=(0,c.useState)(0),{index:u,error:d,prime:f}=Fi(n);(0,c.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),r.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,c.useEffect)(()=>{if(!a)return;let e=e=>{i.current?.contains(e.target)||o(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]);let p=a&&!!e.trim(),m=p&&u?Ri(u,e):[],h=s<m.length?`spot-opt-${s}`:void 0;return(0,Q.jsxs)(`div`,{className:`tb-search`,ref:i,children:[(0,Q.jsx)(vi,{name:`search`,className:`mag glyph`}),(0,Q.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search the harness`,"aria-autocomplete":`list`,"aria-expanded":p,"aria-controls":p?`spotlight-list`:void 0,"aria-activedescendant":h,value:e,onChange:e=>{t(e.target.value),l(0)},onFocus:()=>{o(!0),f()},onKeyDown:n=>{if(p){if(n.key===`ArrowDown`)n.preventDefault(),l(e=>Math.min(e+1,Math.max(m.length-1,0)));else if(n.key===`ArrowUp`)n.preventDefault(),l(e=>Math.max(e-1,0));else if(n.key===`Enter`){let e=m[s];e&&(n.preventDefault(),lr(e.route),o(!1),r.current?.blur())}else n.key===`Escape`&&(n.preventDefault(),e?t(``):(o(!1),r.current?.blur()))}},placeholder:`Search the harness…`,title:`Press / to jump here, or Ctrl-K / ⌘K from inside any field`}),(0,Q.jsx)(`span`,{className:`kbd`,children:`Ctrl K`}),(0,Q.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:p?m.length?`${m.length} results`:`no matches`:``}),p&&(0,Q.jsx)(Bi,{query:e,index:u,loading:!u,error:d,active:s,onActive:l,onClose:()=>{o(!1),r.current?.blur()}})]})}function Hi({installs:e,onSwitch:t}){let n=(e||[]).filter(e=>e.state===`active`);if(n.length<2)return null;let r=n.find(e=>e.selected)||n[0];return(0,Q.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:r.id,onChange:async e=>{let r=n.find(t=>t.id===e.target.value);if(r)try{await P.selectView(r.host,r.path),t?.()}catch{}},children:n.map(e=>(0,Q.jsxs)(`option`,{value:e.id,children:[e.host,` · `,e.scope]},e.id))})}function Ui({children:e,...t}){let n=$n(`button.on`);return(0,Q.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,Q.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function Wi({value:e,onChange:t,labelledBy:n}){let r=Ur(e);return(0,Q.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[zr.map(n=>(0,Q.jsx)(`button`,{type:`button`,className:`accent-src${e===n.id?` on`:``}`,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id)),(0,Q.jsxs)(`div`,{className:`accent-swatches`,children:[Br.map(n=>(0,Q.jsx)(`button`,{type:`button`,className:`accent-swatch${e===n.id?` on`:``}`,style:{"--sw":n.hex},"aria-pressed":e===n.id,"aria-label":`${n.short} accent`,title:n.short,onClick:()=>t(n.id)},n.id)),(0,Q.jsx)(`label`,{className:`accent-swatch accent-custom${r?` on picked`:``}`,style:r?{"--sw":r}:void 0,title:r?`Your colour, ${r}`:`Pick any colour`,children:(0,Q.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function Gi({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o}){let s=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&!e.target.closest?.(`.tb-pop-anchor`)&&o()},t=e=>{e.key===`Escape`&&o()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[o]);let l=(e,t,n,r,i)=>(0,Q.jsxs)(`div`,{className:`ap-group`,children:[(0,Q.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,Q.jsx)(Ui,{"aria-labelledby":e,children:n.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,Q.jsxs)(`div`,{className:`appearance-pop`,ref:s,role:`dialog`,"aria-label":`Appearance`,children:[l(`ap-skin`,`Skin`,Nr,e,t),(0,Q.jsxs)(`div`,{className:`ap-group`,children:[(0,Q.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,Q.jsx)(Wi,{value:n,onChange:r,labelledBy:`ap-accent`})]}),l(`ap-view`,`Overview view`,Yr,i,a)]})}function Ki({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,query:a,onQuery:o,mode:s,onToggleMode:l,appearance:u,dataRev:d,onSwitch:f}){let[p,m]=(0,c.useState)(!1),h=r?.install,g=h?`${h.host}:${h.scope}`:di(r?.target),_=e.tab&&rr[e.tab];return(0,Q.jsxs)(`header`,{className:`topbar`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`tb-menu iconbtn`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,Q.jsx)(vi,{name:t?`x`:`menu`})}),(0,Q.jsxs)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:[(0,Q.jsx)(`span`,{className:`crumb-root mono`,title:r?.target||void 0,children:g}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,Q.jsx)(`span`,{className:_?``:`crumb-here`,"aria-current":_?void 0:`page`,children:tr[e.page]}),_?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,Q.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:_})]}):null]}),(0,Q.jsx)(`div`,{className:`topbar-spacer`}),(0,Q.jsx)(Hi,{installs:i,onSwitch:f}),(0,Q.jsx)(Vi,{value:a,onChange:o,dataRev:d}),(0,Q.jsxs)(`div`,{className:`tb-pop-anchor`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`iconbtn`,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":p,onClick:()=>m(e=>!e),children:(0,Q.jsx)(vi,{name:`themes`})}),p?(0,Q.jsx)(Gi,{...u,onClose:()=>m(!1)}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`iconbtn`,title:s===`light`?`Switch to dark`:`Switch to light`,"aria-label":s===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:l,children:(0,Q.jsx)(vi,{name:s===`light`?`moon`:`sun`})})]})}function qi({themes:e,current:t,onPick:n,onClose:r}){let i=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,c.useEffect)(()=>{i.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,Q.jsxs)(`div`,{className:`pop`,ref:i,role:`menu`,"aria-label":`Switch voice`,children:[(0,Q.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,Q.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:()=>n(e.name),children:[(0,Q.jsx)(`span`,{className:`po`,style:{background:fr(e.accent),boxShadow:`0 0 8px ${fr(e.accent)}`}}),(0,Q.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var Ji=3500;function Yi({toast:e,onClose:t}){return(0,c.useEffect)(()=>{let e=setTimeout(t,Ji);return()=>clearTimeout(e)},[e]),(0,Q.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:`status`,"aria-live":e.kind===`err`?void 0:`polite`,children:[(0,Q.jsx)(`div`,{children:e.msg}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:(0,Q.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})}function Xi({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,c.useRef)(null),l=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=l.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let u=e.length?e[e.length-1].output.length:0;return(0,c.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,u,t]),(0,Q.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,Q.jsxs)(`div`,{className:`console-head`,ref:l,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[a&&(0,Q.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`ttl`,children:[(0,Q.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,Q.jsx)(`span`,{className:`count`,children:e.length}),(0,Q.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,Q.jsx)(vi,{name:`clear`})}),(0,Q.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,Q.jsx)(vi,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,Q.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,Q.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,Q.jsxs)(`div`,{className:`run`,children:[(0,Q.jsxs)(`div`,{className:`run-head`,children:[(0,Q.jsx)(`span`,{className:`pr`,children:`$`}),(0,Q.jsx)(`span`,{className:`act`,children:e.action}),(0,Q.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,Q.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,Q.jsx)(vi,{name:`x`})})]}),e.output&&(0,Q.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Zi=550,Qi=`gs-splash-seen`;function $i(){try{if(window.localStorage.getItem(Qi))return 0;window.localStorage.setItem(Qi,`1`)}catch{}return Zi}function ea({ready:e,onDone:t}){let[n,r]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=setTimeout(()=>r(!0),$i());return()=>clearTimeout(e)},[]),e&&n&&!i&&a(!0),(0,c.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,Q.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,Q.jsxs)(`div`,{className:`boot-dial`,children:[(0,Q.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,Q.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,Q.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,Q.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,Q.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,Q.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Q.jsx)(`path`,{className:`bs-leaf bs-leaf-main`,d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,Q.jsx)(`path`,{className:`bs-leaf bs-leaf-back`,d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,Q.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,Q.jsxs)(`div`,{className:`boot-status`,children:[(0,Q.jsx)(`span`,{children:`germinating harness`}),(0,Q.jsx)(`span`,{className:`boot-caret`})]})]})}function ta({label:e=`Loading…`}){return(0,Q.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,Q.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,Q.jsx)(`div`,{className:`skel-bar`}),(0,Q.jsx)(`div`,{className:`skel-bar`}),(0,Q.jsx)(`div`,{className:`skel-bar`})]})]})}function na({open:e,title:t,children:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let t=o.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]),(0,Q.jsxs)(`dialog`,{ref:o,className:`confirm`,onCancel:a,onClose:a,children:[(0,Q.jsx)(`h3`,{className:`confirm-title`,children:t}),(0,Q.jsx)(`div`,{className:`confirm-body`,children:n}),(0,Q.jsxs)(`div`,{className:`confirm-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:a,children:`Cancel`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:i,autoFocus:!0,children:r||`Confirm`})]})]})}var ra=(0,c.createContext)(null),ia=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function aa(){return(0,c.useContext)(ra)||ia}function oa({children:e}){let[t,n]=(0,c.useState)(null),r=(0,c.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,c.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,Q.jsxs)(ra.Provider,{value:a,children:[e,(0,Q.jsx)(na,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}var $={security:`oklch(0.74 0.085 45)`,verify:`oklch(0.78 0.075 200)`,process:`oklch(0.76 0.075 150)`,craft:`oklch(0.78 0.085 95)`,context:`oklch(0.74 0.08 280)`,comms:`oklch(0.76 0.085 345)`},sa={security:{label:`Security`,c:$.security},verify:{label:`Verification`,c:$.verify},process:{label:`Process`,c:$.process},craft:{label:`Craft`,c:$.craft},context:{label:`Context`,c:$.context},comms:{label:`Communication`,c:$.comms}},ca={craft:$.craft,rigor:$.verify,ops:$.process,process:$.security,comms:$.comms},la=e=>ca[e]||`var(--text-3)`,ua={design:{label:`Design`,c:$.context},build:{label:`Build`,c:$.craft},review:{label:`Review`,c:$.security},ship:{label:`Ship`,c:$.process},understand:{label:`Understand`,c:$.verify},learn:{label:`Learn`,c:$.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Personal`,c:`oklch(0.72 0.025 250)`}},da=Object.keys(ua);function fa(e){let t=String(e||``),n=/\(retired\)\s*$/i.test(t);t=t.replace(/\s*\(retired\)\s*$/i,``),t=t.replace(/^(?:Rule\s+[IVXLCDM\d]+|Doctrine\s+[a-z]+\s+\d+)\s*[—-]\s*/i,``);let r=t.indexOf(` · `);return r===-1?{latin:``,name:t.trim(),retired:n}:{latin:t.slice(0,r).trim(),name:t.slice(r+3).trim(),retired:n}}var pa=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],ma=e=>{let t=``;for(let[n,r]of pa)for(;e>=n;)t+=r,e-=n;return t};function ha(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?ma(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var ga=new Set([`I`,`IV`,`process.1`,`process.5`]),_a=e=>ga.has(e)?`Hook gate`:`Instruction`;function va(e,t,n){let r=(t?.items||[]).filter(e=>(e.tier??`invariant`)===`invariant`&&fa(e.title).retired).length,i=(e?.laws??0)-r,a=e?.doctrines||{};return[{key:`ethos`,label:`Ethos`,n:e?.ontology??0},{key:`invariants`,label:`Invariants`,n:i,note:t&&r?`+${r} retired`:``},{key:`doctrines`,label:`Doctrines`,n:a.rules??0,note:a.total==null?``:`${a.active} of ${a.total} packs`},{key:`yours`,label:`Your rules`,n:n?.rules??0}]}function ya(e){let t={};for(let n of e||[]){let e=ua[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:ua[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=da.filter(e=>t[e]).map(e=>({...t[e],n:t[e].ok+t[e].exp}));return{rows:n,total:n.reduce((e,t)=>e+t.n,0),experimental:n.reduce((e,t)=>e+t.exp,0),max:Math.max(1,...n.map(e=>e.n))}}function ba(e){return e===`update`?`update`:e===`build-all`?`rebuild`:`other`}function xa(e,t=20){let n=(e||[]).filter(e=>e.status!==`running`).slice(-t),r=Math.max(0,...n.map(e=>e.duration||0));return{bars:n.map(e=>({id:e.id,kind:ba(e.action),ok:e.status===`done`,h:r?Math.max(.06,(e.duration||0)/r):.06,tip:`${e.action} · ${e.status} · ${(e.duration??0).toFixed(1)} s`})),ok:n.filter(e=>e.status===`done`).length,longest:r}}var Sa=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function Ca({overview:e,setup:t,rules:n,activity:r,profile:i,skills:a,laws:o}){let s=[],c=e?.doctor;c&&!c.ok&&s.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${Sa(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=l?hi(l)+(l.missing??0):0;u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${Sa(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=ha(e),i=(o?.items||[]).find(e=>e.name===r),a=i?fa(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${Sa(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=ya(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${Sa(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`library/memory`,verb:`Open`,href:`#/section/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}function wa(e,t){if(e?.doctor&&!e.doctor.ok)return`bad`;let n=e?.diff,r=n?hi(n)+(n.missing??0):0,i=t&&t.installed_fp&&t.installed_fp!==t.source_fp;return r||i?`warn`:`good`}function Ta({error:e,style:t}){return e?(0,Q.jsx)(`p`,{className:`badge bad`,style:t,children:e}):null}function Ea({onAction:e}){let{data:t,error:n}=ai(()=>P.themes(),[]),[r,i]=(0,c.useState)(``),[a,o]=(0,c.useState)(``);if(n)return(0,Q.jsx)(Ta,{error:n});if(!t)return(0,Q.jsx)(ta,{});let s=r||t.current?.theme||`neutral`,l=t.emits?.some(e=>e.name===`opencode-global`),u=a||(l?`opencode-global`:t.current?.emit||t.emits?.[0]?.name||``),d=i,f=o;return(0,Q.jsxs)(`div`,{className:`narrow-lg`,children:[(0,Q.jsx)(`div`,{className:`head-row mb-18`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,Q.jsx)(`p`,{className:`sub`,children:`Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands.`})]})}),(0,Q.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Q.jsx)(`div`,{className:`card-head`,children:(0,Q.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,Q.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,Q.jsxs)(`button`,{className:`btn ${e.name===s?`soft`:`ghost`}`,onClick:()=>d(e.name),title:e.blurb||e.tagline||e.name,children:[(0,Q.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:fr(e.accent),boxShadow:`0 0 8px ${fr(e.accent)}`}}),(0,Q.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,Q.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Q.jsx)(`div`,{className:`card-head`,children:(0,Q.jsx)(`h3`,{children:`2 · Install mode`})}),(0,Q.jsxs)(`p`,{className:`sub mb-16`,children:[(0,Q.jsx)(`code`,{children:`opencode-global`}),` deploys once to your global config so every repo on this machine inherits the harness (recommended). Other modes render into a chosen directory.`]}),(0,Q.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,Q.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,Q.jsx)(`select`,{className:`sel`,value:u,onChange:e=>f(e.target.value),children:t.emits.map(e=>(0,Q.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]})]}),(0,Q.jsxs)(`button`,{className:`btn btn-grid`,disabled:!s||!u,onClick:()=>e(`build`,{theme:s,emit:u}),children:[(0,Q.jsx)(vi,{name:`build`}),`Deploy harness`]})]})}var Da=`modulepreload`,Oa=function(e){return`/`+e},ka={},Aa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Oa(t,n),t=s(t),t in ka)return;ka[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Da,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ja=(0,c.lazy)(()=>Aa(()=>import(`./Dashboard-OkC_PCH6.js`).then(e=>e.t),__vite__mapDeps([0,1,2]))),Ma=(e,t)=>`${t?e/t*100:0}%`,Na=e=>e?new Date(e*1e3).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`}):``;function Pa({overview:e,setup:t}){let n=wa(e,t),r=e.doctor,i=e.diff,a=i?i.edited+i.added+i.missing:null,o=[r?r.ok?`doctor clean${r.checked_at?` at ${r.checked_at.slice(-5)}`:``}`:`doctor found ${r.problems.length} problem${r.problems.length===1?``:`s`}`:`doctor not run yet`,a===null?null:a?`${a} file${a===1?``:`s`} drifted`:`no drift`,t?.installed_fp?t.installed_fp===t.source_fp?`install matches source`:`install is behind its source`:null].filter(Boolean),s={good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[n];return(0,Q.jsxs)(`div`,{className:`health ${n}`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`health-dot`,"aria-hidden":`true`}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`b`,{children:s}),` `,(0,Q.jsx)(`span`,{className:`muted`,children:o.join(` · `)}),` `,t?.installed_fp?(0,Q.jsx)(`span`,{className:`mono dim`,children:t.installed_fp}):null]}),(0,Q.jsx)(`span`,{className:`mono dim health-built`,title:e.build_time||void 0,children:e.build_epoch?`built ${ui(e.build_epoch)} ago`:`never built`})]})}function Fa({counts:e,laws:t,rules:n}){let r=va(e,t,n?.stats),i=r.reduce((e,t)=>e+t.n,0),a=r[1].n+r[2].n+r[3].n;return(0,Q.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ov-const`,children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsx)(`h2`,{id:`ov-const`,children:`Constitution`}),(0,Q.jsxs)(`a`,{className:`mono dim`,href:`#/laws`,children:[a,` in force`]})]}),(0,Q.jsx)(`div`,{className:`stackbar`,"aria-hidden":`true`,children:r.map(e=>e.n?(0,Q.jsx)(`span`,{className:`sb-${e.key}`,style:{width:Ma(e.n,i)}},e.key):null)}),(0,Q.jsx)(`ul`,{className:`legend`,children:r.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{className:`swatch sb-${e.key}`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`legend-label`,children:[e.label,` `,e.note?(0,Q.jsxs)(`span`,{className:`dim`,children:[`(`,e.note,`)`]}):null]}),(0,Q.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function Ia({skills:e}){if(!e)return(0,Q.jsx)(`section`,{className:`panel chart-card`,"aria-busy":`true`});let{rows:t,total:n,experimental:r,max:i}=ya(e.items);return(0,Q.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ov-skills`,children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsx)(`h2`,{id:`ov-skills`,children:`Skills by stage`}),(0,Q.jsxs)(`span`,{className:`mono dim`,children:[n,` · `,r,` experimental`]})]}),(0,Q.jsx)(`ul`,{className:`hbars`,children:t.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{className:`hb-label`,children:e.label}),(0,Q.jsxs)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:[(0,Q.jsx)(`span`,{className:`hb-ok`,style:{width:Ma(e.ok,i)}}),(0,Q.jsx)(`span`,{className:`hb-exp`,style:{width:Ma(e.exp,i)}})]}),(0,Q.jsx)(`span`,{className:`mono hb-n`,"aria-label":`${e.n}, ${e.exp} experimental`,children:e.n})]},e.key))}),(0,Q.jsxs)(`div`,{className:`chart-key`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`key-ok`}),` approved`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`key-exp`}),` experimental`]})]})]})}function La({runs:e}){let{bars:t,ok:n,longest:r}=xa(e),i=(e||[]).filter(e=>e.status!==`running`).slice(-20);return(0,Q.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ov-runs`,children:[(0,Q.jsxs)(`div`,{className:`panel-head`,children:[(0,Q.jsxs)(`h2`,{id:`ov-runs`,children:[`Runs · last `,t.length||20]}),(0,Q.jsx)(`span`,{className:`mono ${n===t.length?`t-good`:`t-warn`}`,children:t.length?`${n}/${t.length} ok`:`none yet`})]}),(0,Q.jsx)(`div`,{className:`vbars`,role:`img`,"aria-label":`${t.length} runs, ${n} succeeded`,children:t.map(e=>(0,Q.jsx)(`span`,{title:e.tip,className:`vb-${e.ok?e.kind:`failed`}`,style:{height:`${Math.round(e.h*100)}%`}},e.id))}),(0,Q.jsxs)(`div`,{className:`chart-axis mono dim`,children:[(0,Q.jsx)(`span`,{children:Na(i[0]?.started)}),t.length?(0,Q.jsxs)(`span`,{children:[`longest `,r.toFixed(1),` s`]}):null,(0,Q.jsx)(`span`,{children:Na(i[i.length-1]?.started)})]}),(0,Q.jsxs)(`div`,{className:`chart-key`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`vb-update`}),` update`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`vb-rebuild`}),` rebuild`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`i`,{className:`vb-other`}),` install / build`]})]})]})}function Ra({rows:e}){return(0,Q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ov-needs`,children:[(0,Q.jsx)(`div`,{className:`panel-head panel-head-rule`,children:(0,Q.jsxs)(`h2`,{id:`ov-needs`,children:[`Needs attention `,(0,Q.jsx)(`span`,{className:`mono dim`,children:e.length})]})}),e.length?(0,Q.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,Q.jsxs)(`span`,{className:`needs-what`,children:[(0,Q.jsx)(`b`,{children:e.title}),e.detail?(0,Q.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,Q.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),(0,Q.jsx)(`a`,{className:`needs-verb`,href:e.href,children:e.verb})]},e.id))}):(0,Q.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function za({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s=`overview`,dataRev:l}){let u=s===`overview`&&!!e?.deployed,d=e=>e.catch(()=>null),f=Promise.resolve(null),{data:p}=ai(()=>u?d(P.rules()):f,[u,l]),{data:m}=ai(()=>u?d(P.activity()):f,[u,l]),{data:h}=ai(()=>u?d(P.profile()):f,[u,l]),{data:g}=ai(()=>u?d(P.catalog(`skills`)):f,[u,l],`catalog:skills`),{data:_}=ai(()=>u?d(P.catalog(`laws`)):f,[u,l],`catalog:laws`);if(!e)return t?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Ta,{error:`Could not load the harness overview: ${t}`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:n,children:`Retry`})]}):(0,Q.jsx)(ta,{});if(!e.deployed)return(0,Q.jsx)(Ea,{onAction:o});let v=Ca({overview:e,setup:i,rules:p,activity:m,profile:h,skills:g,laws:_});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`page-head`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`h`,children:`Overview`}),(0,Q.jsx)(`p`,{className:`sub`,children:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(`div`,{className:`page-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`doctor`),children:`Run doctor`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`build-all`),children:`Rebuild`})]})]}),u?(0,Q.jsxs)(`div`,{className:`ov-stack`,children:[(0,Q.jsx)(Pa,{overview:e,setup:i}),(0,Q.jsxs)(`div`,{className:`ov-charts`,children:[(0,Q.jsx)(Fa,{counts:e.counts,laws:_,rules:p}),(0,Q.jsx)(Ia,{skills:g}),(0,Q.jsx)(La,{runs:a})]}),(0,Q.jsx)(Ra,{rows:v})]}):(0,Q.jsx)(c.Suspense,{fallback:(0,Q.jsx)(ta,{}),children:(0,Q.jsx)(ja,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s,dataRev:l})})]})}var Ba=(0,c.lazy)(()=>Aa(()=>import(`./Activity-BjVp522q.js`),__vite__mapDeps([3,1,2,4]))),Va=(0,c.lazy)(()=>Aa(()=>import(`./ActivityDetail-8ep1bspW.js`),__vite__mapDeps([5,1,2,4]))),Ha=(0,c.lazy)(()=>Aa(()=>import(`./Library-wPPuKQrI.js`),__vite__mapDeps([6,1,2,7,8]))),Ua=(0,c.lazy)(()=>Aa(()=>import(`./Laws-CLpdRRk8.js`),__vite__mapDeps([9,1,2,8]))),Wa=(0,c.lazy)(()=>Aa(()=>import(`./Personal-D8CnDo9v.js`),__vite__mapDeps([10,1,2,7,11,6,8]))),Ga=(0,c.lazy)(()=>Aa(()=>import(`./Installs-BtGGdoTt.js`),__vite__mapDeps([12,1,2,11]))),Ka=(0,c.lazy)(()=>Aa(()=>import(`./Docs-CKPWz00o.js`),__vite__mapDeps([13,1,2,7])));function qa(){let e=cr(),[t,n]=(0,c.useState)(``),[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(!1),[s,u]=jr(),[d,f]=Ir(),p=e=>{if(!document.startViewTransition||!Yn())return f(e);document.startViewTransition(()=>(0,l.flushSync)(()=>f(e)))},[m,h]=qr(),[g,_]=Qr(),[v,y]=(0,c.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[b,x]=(0,c.useState)(!1),S=(0,c.useRef)(null),C=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!b)return;let e=e=>{e.key===`Escape`&&x(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]),(0,c.useEffect)(()=>{if(!b)return;let e=C.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[b]);let w=e=>i({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:T,error:E,themes:D,reload:O}=$r(w),[k,A]=(0,c.useState)(0),j=()=>{O(),A(e=>e+1)},[M,ee]=(0,c.useState)(null),{runs:te,activeId:ne,consoleOpen:re,setConsoleOpen:ie,runAction:N,cancelJob:ae,clearRuns:oe}=ri({onFinish:e=>{j(),ee({status:e,at:Date.now()})},onError:w}),{data:se}=ai(()=>P.setup().catch(()=>null),[k],`setup`),{data:ce}=ai(()=>P.installs().catch(()=>null),[k],`installs`),le=ce?.installs||null,ue=te[te.length-1],F=ue?ue.status===`running`?`${ue.action} running`:`${ue.action} ${ue.status}`:``;(0,c.useEffect)(()=>{let e=S.current;if(!e||Or(e,Ur(m),s))return;let t=Gr(m);if(t)return hr(e,t,s);_r(e,d,s)||T?.accent&&hr(e,T.accent,s)},[T,s,m,d]);let de={flavour:d,onFlavour:p,accentMode:m,onAccentMode:h,layout:g,onLayout:_};return(0,Q.jsx)(`div`,{className:`app fl-${d} ${s===`light`?`light`:``}${b?` nav-open`:``}`,ref:S,children:(0,Q.jsxs)(oa,{children:[(0,Q.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,Q.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,Q.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:F}),b&&(0,Q.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>x(!1)}),(0,Q.jsx)(wi,{route:e,overview:T,installs:le,onOpenVoice:()=>o(e=>!e),onNavigate:()=>x(!1)}),a&&(0,Q.jsx)(qi,{themes:D,current:T?.theme,onPick:e=>{o(!1),N(`build`,{theme:e,emit:T?.emit})},onClose:()=>o(!1)}),(0,Q.jsxs)(`div`,{className:`col`,ref:C,children:[(0,Q.jsx)(Ki,{route:e,navOpen:b,onToggleNav:()=>x(e=>!e),overview:T,installs:le,query:t,onQuery:n,mode:s,onToggleMode:u,appearance:de,dataRev:k,onSwitch:j}),(0,Q.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,Q.jsx)(`div`,{className:e.page===`library`?`pad pad-wide`:`pad`,children:(0,Q.jsx)(c.Suspense,{fallback:(0,Q.jsx)(ta,{}),children:{overview:()=>(0,Q.jsx)(za,{overview:T,overviewError:E,onRetry:O,themes:D,setup:se,runs:te,onAction:N,layout:g,dataRev:k}),laws:()=>(0,Q.jsx)(Ua,{selected:e.item,overview:T,setup:se,onAction:N,dataRev:k}),library:()=>(0,Q.jsx)(Ha,{overview:T,section:e.section,selected:e.item,dataRev:k}),personal:()=>(0,Q.jsx)(Wa,{tab:e.tab,item:e.item,setup:se,dataRev:k}),installs:()=>(0,Q.jsx)(Ga,{tab:e.tab,overview:T,setup:se,themes:D,onAction:N,onMutated:j,dataRev:k,appearance:de}),activity:()=>e.item?(0,Q.jsx)(Va,{sid:e.item},e.item):(0,Q.jsx)(Ba,{}),docs:()=>(0,Q.jsx)(Ka,{page:e.item,query:t,onAction:N,overview:T})}[e.page]?.()})})}),(0,Q.jsx)(Ti,{route:e}),(0,Q.jsx)(Xi,{runs:te,open:re,busy:!!ne,finish:M,onToggle:()=>ie(e=>!e),onClear:oe,onCancel:ae})]}),r&&(0,Q.jsx)(Yi,{toast:r,onClose:()=>i(null)}),v&&(0,Q.jsx)(ea,{ready:!!T||!!E,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}y(!1)}})]})})}(0,u.createRoot)(document.getElementById(`root`)).render((0,Q.jsx)(qa,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{zt as $,ei as A,Xn as B,vi as C,ui as D,pi as E,nr as F,Hn as G,er as H,rr as I,Dn as J,zn as K,lr as L,Yr as M,Kr as N,gi as O,Nr as P,Ht as Q,Qn as R,Oi as S,mi as T,Jn as U,Zn as V,Un as W,un as X,fn as Y,an as Z,Pi as _,R as _t,ha as a,Ue as at,Di as b,ca as c,W as ct,la as d,rt as dt,J as et,aa as f,U as ft,Mi as g,ge as gt,Ui as h,V as ht,_a as i,Ge as it,ti as j,ai as k,ua as l,ht as lt,Wi as m,z as mt,Ea as n,pt as nt,fa as o,He as ot,ta as p,ve as pt,Bn as q,Ta as r,q as rt,sa as s,We as st,Aa as t,_t as tt,da as u,mt as ut,Ni as v,P as vt,hi as w,Ai as x,Ei as y,Yn as z};
@@ -11,7 +11,7 @@
11
11
  <!-- The brand sprout as an inline SVG favicon (no extra asset to serve). -->
12
12
  <link rel="icon" type="image/svg+xml"
13
13
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5v-9' stroke='%233AD4C4' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z' fill='%233AD4C4'/%3E%3Cpath d='M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z' fill='%233AD4C4' opacity='.42'/%3E%3C/svg%3E" />
14
- <script type="module" crossorigin src="/assets/index-BMwSp8BP.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-C1yil5j1.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/sections-GalMS0Zv.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/react-B9Z_tXRV.js">
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-CDPDk2vj.css">
@@ -1,105 +0,0 @@
1
- # 🐙 GitHub Copilot adapter
2
-
3
- > [← Back to README](../../README.md) · [Setup guide](../../SETUP.md) · [Claude Code adapter](../claude-code/README.md) · [OpenCode adapter](../opencode/README.md)
4
-
5
- [GitHub Copilot](https://docs.github.com/copilot) is the **second Claude-shaped
6
- host**, and a closer fit than Bob: skills are the same `SKILL.md` dirs (Copilot
7
- Agent Skills), custom agents are markdown-with-frontmatter, and the repo-root
8
- `AGENTS.md` is auto-loaded. So the Copilot emit **reuses the Claude engine** with
9
- a `host="copilot"` flag. Nothing to install by hand: `geneseed setup` (or
10
- `geneseed build --emit copilot` / `--emit copilot-global`) writes everything.
11
-
12
- Copilot is a **reduced host** at project scope (no hooks there) and close to Claude
13
- Code at global scope: its lifecycle hooks have an "ask the user" tier, so the gates
14
- prompt as they do on Claude. This page is mostly about what those hooks *can* and
15
- *cannot* automate and why the harness still holds where they cannot.
16
-
17
- ## What the emit writes
18
-
19
- ### Per-repo (`--emit copilot`)
20
-
21
- - **`AGENTS.md`** at the repo root — auto-loaded by the Copilot CLI, the coding
22
- agent, and VS Code agent mode. Carries the preamble as a managed block.
23
- - **`.github/`** layer (Copilot's *shared* repo config surface):
24
- - `agents/<name>.agent.md` — Copilot's **custom-agent dialect** (`.agent.md`
25
- extension; a `tools:` **allowlist**, not Claude's denylist — a read-only
26
- agent lists the tool ids it keeps: `read, search, todo, agent`, plus
27
- `execute` only when the spec opts in with `<!-- bash: allow -->`, `fetch` only
28
- with `<!-- webfetch: allow -->`). Sibling
29
- agent links are rewritten to the `.agent.md` filename.
30
- - `skills/<name>/SKILL.md` — **byte-identical** to every other host.
31
-
32
- Writing into the shared `.github/` dir is safe because the engine's manifest +
33
- claim-on-create machinery never touches a file it doesn't own — your own
34
- workflows, agents, and skills there are never clobbered, and uninstall removes
35
- only manifest-owned files.
36
-
37
- ### Personal / global (`--emit copilot-global` → `~/.copilot`, or `$COPILOT_CONFIG_DIR`)
38
-
39
- - **`copilot-instructions.md`** — the Copilot CLI auto-loads this in every repo;
40
- the preamble rides it as a managed block. (Unlike Bob, Copilot *has* a real
41
- personal instructions carrier, so no rules-folder workaround is needed.)
42
- - `agents/<name>.agent.md` + `skills/` under `~/.copilot`.
43
- - **`settings.json` hooks** — four entries under `hooks`, see below.
44
-
45
- ## Hooks — ask, as on Claude Code
46
-
47
- The Copilot CLI reads lifecycle hooks from **`~/.copilot/settings.json`** as a map of
48
- event → **array** of `{type: "command", command}` entries
49
- ([reference](https://docs.github.com/en/copilot/reference/hooks-configuration)). The
50
- global emit adds one entry to each of four events, each calling the machine-wide
51
- `geneseed-hook` shim:
52
-
53
- | event | verb | what it does |
54
- | --- | --- | --- |
55
- | `sessionStart` | `context` | eager project-context injection, as on Claude Code, returned as `{"additionalContext": …}` |
56
- | `preToolUse` | `tool-gate --host copilot` | the git gate and the rule gate **fused** — entries carry no matcher — dispatched on the payload: a `command` gets the git checks, a path gets the rule checks |
57
- | `agentStop` | `learn` | distils the session transcript (`transcriptPath`) into memory, as Claude's `Stop` |
58
- | `preCompact` | `learn` | the same, once more before compaction summarises the window away |
59
-
60
- `preToolUse` has an ask tier, so every rule **asks** exactly where it asks on Claude
61
- Code — Laws I and IV, process 1 and process 5 — answered top-level as
62
- `{"permissionDecision": "ask", "permissionDecisionReason": …}`. A gate error asks
63
- too (fail closed). `toolArgs` is read whether Copilot sends it as an object or as a
64
- JSON string.
65
-
66
- **Your own hooks on those events stay**: Geneseed's entry goes beside them in the
67
- array, and uninstall removes exactly the entries it claimed. Comments in the file
68
- mean it is never rewritten.
69
-
70
- **Migration.** Before this, the emit wired a single-object `toolCall` hook — an event
71
- Copilot no longer fires, so the gates never ran. A re-emit removes those recorded
72
- entries (your own keys stay) and writes the array shape.
73
-
74
- **Unverified live.** No Copilot CLI on the authoring machine; this is the documented
75
- contract.
76
-
77
- **What is not wired, and why:**
78
-
79
- - **no hooks at project scope** — the CLI documents hooks in the personal settings
80
- file only, and a machine-absolute command committed into a shared `.github/`
81
- would fail on every teammate's machine;
82
- - **sovereign-repo excludes** — Copilot documents no exclude/shadow mechanism
83
- (nothing like Claude's `claudeMdExcludes` or Bob's same-named workspace rule),
84
- so a global install's `copilot-instructions.md` and a repo's own `AGENTS.md`
85
- simply **stack**. A global emit warns, non-blocking, when project Copilot
86
- installs already exist.
87
-
88
- None of this is a build gap — it is Copilot's ceiling. The harness still applies
89
- in full: the Ontology, every Rule, every doctrine rule the install built in, and
90
- every agent and skill are present; where the host offers no prompt, a Rule's
91
- *automation* degrades to a block, a warning, or instruction-only. This is
92
- behaviour-contract parity, the same principle every non-OpenCode host follows.
93
-
94
- ## MCP
95
-
96
- MCP servers are wired at runtime by `geneseed mcp` into `~/.copilot/mcp-config.json`
97
- (with a `tools` allowlist) — see `js/hosts/mcp.mjs`.
98
-
99
- ## What Copilot does not get
100
-
101
- As a Claude-shaped host Copilot has none of the OpenCode-only extras (colour
102
- themes, JS plugins, workflow runner, primary-agent, LSP, `/`-commands), and of the
103
- hook-driven automation it gets context injection and the boundary gates but not
104
- the learn distiller or a consent *prompt*. See the
105
- [host matrix](../../README.md#-supported-harnesses) for the full comparison.