droidsembly 0.4.0-beta.6 → 0.5.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.it.md +19 -20
  2. package/README.md +19 -19
  3. package/bin/distribution.js +3 -1
  4. package/dist/assets/AccessibilitySettings-C_l9iRUv.js +32 -0
  5. package/dist/assets/{AppViewer-CkRhHzAg.js → AppViewer-BQO9JR1i.js} +1 -1
  6. package/dist/assets/{Balloon-CyA9jx7L.js → Balloon-DVvWn18l.js} +1 -1
  7. package/dist/assets/{Batched-BnwN-jIb.js → Batched-CQd1jTn0.js} +2 -2
  8. package/dist/assets/{Birds-T-cAlNXa.js → Birds-DJ4dABbV.js} +1 -1
  9. package/dist/assets/{Blimp-D5lM1i8g.js → Blimp-BJbSmwgF.js} +1 -1
  10. package/dist/assets/{BufferGeometryUtils-BQuR3FyE.js → BufferGeometryUtils-CT65PqMz.js} +1 -1
  11. package/dist/assets/{Duck-Df57hNLp.js → Duck-C5792fKA.js} +1 -1
  12. package/dist/assets/{Effects-BkJu9eYu.js → Effects-CaCXr9Js.js} +2 -2
  13. package/dist/assets/{Fireworks-BB1Mfdb3.js → Fireworks-iRvidmKy.js} +2 -2
  14. package/dist/assets/{Helicopter-B5NObfW4.js → Helicopter-D8ZNTU4I.js} +1 -1
  15. package/dist/assets/{Hurricane-CGsnFbNg.js → Hurricane-CAadFYBC.js} +2 -2
  16. package/dist/assets/{Kaiju-5SPvHn_6.js → Kaiju-C3EuNULz.js} +1 -1
  17. package/dist/assets/{Meteors-rA1sR1A3.js → Meteors-CGWkPuVY.js} +1 -1
  18. package/dist/assets/{MissionConsole-zJYkK_M1.js → MissionConsole-DZ6wViYJ.js} +1 -1
  19. package/dist/assets/{Office-fRdJ34l-.js → Office-Dmaf62nb.js} +44 -44
  20. package/dist/assets/{PhotoPanel-DiplEiL_.js → PhotoPanel-vRV9SyW6.js} +1 -1
  21. package/dist/assets/PhotoScene-CCfT0_dM.js +115 -0
  22. package/dist/assets/{Plane-CtJDMF4A.js → Plane-LzwrJzTl.js} +1 -1
  23. package/dist/assets/Pocket-CUs_Akxq.js +2 -0
  24. package/dist/assets/{Rainbow-Bbqcvhxa.js → Rainbow-Bh87z-Ca.js} +2 -2
  25. package/dist/assets/Roof-5bxB8sll.js +34 -0
  26. package/dist/assets/Shell-BurGbVOK.js +13 -0
  27. package/dist/assets/{Skywriting-CDweiNEJ.js → Skywriting-DUf57ebJ.js} +1 -1
  28. package/dist/assets/TerminalView-BXlSvVFj.js +17 -0
  29. package/dist/assets/ToyWorld-DtorYOnh.js +1 -0
  30. package/dist/assets/{Ufo-CQvPbWUN.js → Ufo-CFUHx9XE.js} +1 -1
  31. package/dist/assets/{Whale-Mz6Mfxvb.js → Whale-DeSPwwK9.js} +1 -1
  32. package/dist/assets/{all-AJNOOWx8.js → all-DOGLvkPi.js} +2 -2
  33. package/dist/assets/{bloomMarks-CWsszTY1.js → bloomMarks-C54fx8hS.js} +2 -2
  34. package/dist/assets/{cheerRules-Bs7u6fhI.js → cheerRules-Cirk-C1A.js} +1 -1
  35. package/dist/assets/{cityLayout-1I0cF38a.js → cityLayout-Ckx8BPp6.js} +1 -1
  36. package/dist/assets/{dogState-DSYyIK7C.js → dogState-COomoDy2.js} +1 -1
  37. package/dist/assets/{doors-BUM4Izj_.js → doors-bUEcoX0a.js} +1 -1
  38. package/dist/assets/floorRows-TXmh_fs7.js +1 -0
  39. package/dist/assets/{gallery-BntMgHVx.js → gallery-DRHdZni1.js} +1 -1
  40. package/dist/assets/gate-D2IhTYgP.js +2 -0
  41. package/dist/assets/index-BJhDZdUC.css +1 -0
  42. package/dist/assets/{index-BoDJkaEF.js → index-Bm599iDL.js} +3 -3
  43. package/dist/assets/{instantReplay-D8hjR3t4.js → instantReplay-DyovaQ30.js} +1 -1
  44. package/dist/assets/{interact-Bj1zja21.js → interact-5KlEmqSj.js} +1 -1
  45. package/dist/assets/{kit-iArIGJf-.js → kit-0ivWfN5y.js} +2 -2
  46. package/dist/assets/{mic-B-UxYaQY.js → mic-BhkfhZh_.js} +1 -1
  47. package/dist/assets/{photoMode-CRSRNKrX.js → photoMode-DaRgDVK0.js} +1 -1
  48. package/dist/assets/{pipeline-DvDJ46O5.js → pipeline-Bpizl8Xd.js} +50 -50
  49. package/dist/assets/{rapier-Dtx9m4Xq.js → rapier-BPbvA-KY.js} +1 -1
  50. package/dist/assets/rig-CrQ96zZT.js +1 -0
  51. package/dist/assets/{speechLanguage-CSuv5EYa.js → speechLanguage-DB5z7y_C.js} +1 -1
  52. package/dist/assets/store-D17hJxYS.js +5 -0
  53. package/dist/assets/{useDayTime-Cn8OOG-d.js → useDayTime-kseMHOa9.js} +1 -1
  54. package/dist/assets/{useGraphics-CnMUzm0p.js → useGraphics-CJhpDhqZ.js} +1 -1
  55. package/dist/assets/{voiceMessages-CvKdLaYv.js → voiceMessages-DxK9WeCn.js} +1 -1
  56. package/dist/assets/{weatherState-BGsd5Mzz.js → weatherState-DighRn7p.js} +1 -1
  57. package/dist/index.html +3 -3
  58. package/dist-server/index.js +539 -79
  59. package/dist-server/index.js.map +4 -4
  60. package/package.json +2 -2
  61. package/dist/assets/AccessibilitySettings-BLUQhCir.js +0 -32
  62. package/dist/assets/PhotoScene-DG1ui0Av.js +0 -115
  63. package/dist/assets/Pocket-x37KplGU.js +0 -2
  64. package/dist/assets/Roof-DP8gTSp6.js +0 -34
  65. package/dist/assets/Shell-BzhH2Tnv.js +0 -13
  66. package/dist/assets/TerminalView-CZkLeOi6.js +0 -17
  67. package/dist/assets/ToyWorld-ZLc2l8lQ.js +0 -1
  68. package/dist/assets/gate-B4Yyimy5.js +0 -2
  69. package/dist/assets/index-0ut5ekje.css +0 -1
  70. package/dist/assets/rig-Bs_tw8rH.js +0 -1
  71. package/dist/assets/store-D1ymxjG0.js +0 -5
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{l as n,s as r,t as i}from"./jsx-runtime-CZP6s5wa.js";import{c as a,o,s}from"./index-BoDJkaEF.js";import{Bt as c,Gt as l,Ht as u,Jt as d,Kt as f,Rt as p,Vt as m,Wt as h,Xt as g,Yt as _,Zt as v,c as y,p as b,qt as x,zt as S}from"./store-D1ymxjG0.js";import{P as C,R as w,h as T,m as E,p as D}from"./AccessibilitySettings-BLUQhCir.js";var O=t(n(),1),k=3e4,A=r(()=>({channels:{}}));function j(e){let t=A(t=>t.channels[e]),n=b(t=>t.repos.find(t=>t.id===e)?.pulls);return l(t,n??[])}function M(e,t){b.getState().replaying?b.getState().pushToast(`info`,`▶ Replaying: the PR theatre is live only. Press Esc to go back to the live office.`):(A.setState(n=>({channels:{...n.channels,[e]:t}})),t==null||b.getState().prPreviews[y(e,t)]||a.startPrPreview(e,t).catch(()=>void 0))}var N=(()=>{try{return crypto.randomUUID()}catch{return`viewer-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`}})();function ee(e,t){(0,O.useEffect)(()=>{let n=()=>void a.watchPreview(N,t==null?null:e,t).catch(()=>void 0);n();let r=setInterval(n,k);return()=>clearInterval(r)},[e,t]),(0,O.useEffect)(()=>()=>void a.watchPreview(N,null,null).catch(()=>void 0),[])}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmPreviews`)&&Object.defineProperty(window,"__swarmPreviews",{configurable:!0,get:()=>{let e=b.getState(),t=A.getState().channels;return{main:e.repos.map(e=>({repoId:e.id,floor:e.floor,status:e.preview.status,url:e.preview.url,ref:e.preview.ref,port:e.preview.port,channel:l(t[e.id],e.pulls)})),prs:Object.values(e.prPreviews).map(e=>({repoId:e.repoId,pr:e.pr,status:e.status,url:e.url,port:e.port,commit:e.commit,watched:e.watched,idleSec:Math.round((Date.now()-e.viewedAt)/1e3),error:e.error}))}}});var P=16e3,F=e=>Object.entries(e).reduce((e,[t,n])=>e+t.length+n.length+2,0);function I(e){let t=F(e);if(t<=16e3)return null;let n=e=>e.toLocaleString(`en-US`);return`The preview env is ${n(t)} characters (${n(Object.keys(e).length)} variables, each counted as KEY=value), over the ${n(P)} a floor's preview may take. Keep only the variables the app needs to run.`}var L=e({AppViewer:()=>oe}),R=i(),z={unconfigured:`not set up`,stopped:`stopped`,preparing:`checking out`,installing:`installing`,starting:`starting`,running:`running`,error:`error`},B=[`preparing`,`installing`,`starting`,`running`],V=[{status:`preparing`,label:`Check out the code`},{status:`installing`,label:`Install dependencies`},{status:`starting`,label:`Start the app`}],H=`desktop`,U=12e3;function W({status:e}){let t=s();return(0,R.jsx)(`span`,{className:`status status-${e}`,children:t(z[e])})}var G=e=>Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
1
+ import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{l as n,s as r,t as i}from"./jsx-runtime-CZP6s5wa.js";import{c as a,o,s}from"./index-Bm599iDL.js";import{Bt as c,Gt as l,Ht as u,Jt as d,Kt as f,Rt as p,Vt as m,Wt as h,Xt as g,Yt as _,Zt as v,c as y,p as b,qt as x,zt as S}from"./store-D17hJxYS.js";import{A as C,P as w,h as T,m as E,p as D}from"./AccessibilitySettings-C_l9iRUv.js";var O=t(n(),1),k=3e4,A=r(()=>({channels:{}}));function j(e){let t=A(t=>t.channels[e]),n=b(t=>t.repos.find(t=>t.id===e)?.pulls);return l(t,n??[])}function M(e,t){b.getState().replaying?b.getState().pushToast(`info`,`▶ Replaying: the PR theatre is live only. Press Esc to go back to the live office.`):(A.setState(n=>({channels:{...n.channels,[e]:t}})),t==null||b.getState().prPreviews[y(e,t)]||a.startPrPreview(e,t).catch(()=>void 0))}var N=(()=>{try{return crypto.randomUUID()}catch{return`viewer-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`}})();function ee(e,t){(0,O.useEffect)(()=>{let n=()=>void a.watchPreview(N,t==null?null:e,t).catch(()=>void 0);n();let r=setInterval(n,k);return()=>clearInterval(r)},[e,t]),(0,O.useEffect)(()=>()=>void a.watchPreview(N,null,null).catch(()=>void 0),[])}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmPreviews`)&&Object.defineProperty(window,"__swarmPreviews",{configurable:!0,get:()=>{let e=b.getState(),t=A.getState().channels;return{main:e.repos.map(e=>({repoId:e.id,floor:e.floor,status:e.preview.status,url:e.preview.url,ref:e.preview.ref,port:e.preview.port,channel:l(t[e.id],e.pulls)})),prs:Object.values(e.prPreviews).map(e=>({repoId:e.repoId,pr:e.pr,status:e.status,url:e.url,port:e.port,commit:e.commit,watched:e.watched,idleSec:Math.round((Date.now()-e.viewedAt)/1e3),error:e.error}))}}});var P=16e3,F=e=>Object.entries(e).reduce((e,[t,n])=>e+t.length+n.length+2,0);function I(e){let t=F(e);if(t<=16e3)return null;let n=e=>e.toLocaleString(`en-US`);return`The preview env is ${n(t)} characters (${n(Object.keys(e).length)} variables, each counted as KEY=value), over the ${n(P)} a floor's preview may take. Keep only the variables the app needs to run.`}var L=e({AppViewer:()=>oe}),R=i(),z={unconfigured:`not set up`,stopped:`stopped`,preparing:`checking out`,installing:`installing`,starting:`starting`,running:`running`,error:`error`},B=[`preparing`,`installing`,`starting`,`running`],V=[{status:`preparing`,label:`Check out the code`},{status:`installing`,label:`Install dependencies`},{status:`starting`,label:`Start the app`}],H=`desktop`,U=12e3;function W({status:e}){let t=s();return(0,R.jsx)(`span`,{className:`status status-${e}`,children:t(z[e])})}var G=e=>Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
2
2
  `);function K(e){let t={},n=e.split(/\r?\n/);for(let e=0;e<n.length;e++){let r=n[e].trim();if(!r||r.startsWith(`#`))continue;let i=r.indexOf(`=`),a=i>0?r.slice(0,i).trim():``;if(!a)return{env:t,error:`Line ${e+1}: write it as KEY=value.`};if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(a))return{env:t,error:`Line ${e+1}: “${a}” is not a valid variable name.`};t[a]=r.slice(i+1).trim()}return{env:t,error:null}}function q({repo:e,saveLabel:t=`Save`,onSaved:n}){let r=s(),i={command:e.previewConfig.command??``,env:G(e.previewConfig.env)},[c,l]=(0,O.useState)(i.command),[u,d]=(0,O.useState)(i.env),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(null);(0,O.useEffect)(()=>{l(i.command),d(i.env)},[i.command,i.env]);let g=c.trim()!==i.command||u.trim()!==i.env,_=e.preview.status===`unconfigured`,v=F(K(u).env);return(0,R.jsxs)(`form`,{className:`preview-form`,onSubmit:async t=>{t.preventDefault();let r=K(u);if(r.error)return h(r.error);let i=I(r.env);if(i)return h(i);h(null),p(!0);try{await a.updateRepo(e.id,{previewCommand:c.trim()||null,previewEnv:r.env}),n?.()}catch(e){h(e.message)}finally{p(!1)}},children:[(0,R.jsxs)(`label`,{className:`field`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Run command`})}),(0,R.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:r(_?`e.g. python -m http.server {port}`:`Auto-detected: npm run dev, else npm start, else npm run preview`),spellCheck:!1})]}),(0,R.jsxs)(`label`,{className:`field`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Environment (KEY=value, one per line)`})}),(0,R.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:`API_URL=http://localhost:{port}/api
3
3
  DATA_DIR={tmp}`,spellCheck:!1})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`Runs from the repo root in the floor’s own preview worktree.`}),` `,(0,R.jsx)(`code`,{children:`{port}`}),` `,r(`is this floor’s port ({port}) and`,{port:e.preview.port}),` `,(0,R.jsx)(`code`,{children:`PORT`}),` `,(0,R.jsx)(o,{children:`is always set;`}),` `,(0,R.jsx)(`code`,{children:`{tmp}`}),` `,(0,R.jsx)(o,{children:`is a scratch folder.`}),!_&&r(` Leave the command empty to use the auto-detected npm script.`)]}),v>12800&&(0,R.jsx)(`p`,{className:`muted small`,children:r(`Environment: {count} of {max} characters (each variable counts as KEY=value).`,{count:v.toLocaleString(),max:16e3.toLocaleString()})}),m&&(0,R.jsxs)(`div`,{className:`term-error`,children:[`⚠️ `,m]}),(0,R.jsxs)(`div`,{className:`row`,children:[(0,R.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:f||!g&&!n||_&&!c.trim(),children:r(f?`Saving…`:t)}),g&&(0,R.jsx)(`button`,{type:`button`,className:`btn btn-small btn-ghost`,onClick:()=>{l(i.command),d(i.env),h(null)},children:(0,R.jsx)(o,{children:`Undo changes`})})]})]})}var J=`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads allow-pointer-lock`;function Y({repo:e,preview:t,label:n,src:r,width:i,reloads:a,busy:c,onStart:l,frameRef:u,compact:d}){let f=s(),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(!1),y=t.status===`running`&&!!r,b=`${r}|${t.startedAt}|${a}`;if((0,O.useEffect)(()=>{if(m(!1),g(!1),!y)return;let e=setTimeout(()=>g(!0),U);return()=>clearTimeout(e)},[b,y]),y)return(0,R.jsxs)(`div`,{className:`app-stage ${i===`phone`?`app-stage-phone`:``}`,children:[(0,R.jsx)(`iframe`,{ref:u,className:`app-frame`,src:r,title:f(`{repo} app ({label})`,{repo:e.fullName.split(`/`)[1],label:n}),sandbox:J,allow:`clipboard-read; clipboard-write; fullscreen; autoplay`,onLoad:()=>m(!0),onError:()=>g(!0)},b),h&&!p&&(0,R.jsxs)(`div`,{className:`app-frame-hint`,role:`status`,children:[(0,R.jsx)(`b`,{children:(0,R.jsx)(o,{children:`The app isn’t showing up here.`})}),` `,(0,R.jsx)(o,{children:`It may refuse to be shown inside another page (X-Frame-Options or a CSP frame-ancestors rule).`}),` `,(0,R.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,children:(0,R.jsx)(o,{children:`Open it in a new tab ↗`})})]})]});if(B.includes(t.status)){let e=V.findIndex(e=>e.status===t.status);return(0,R.jsxs)(`div`,{className:`app-state ${d?`app-state-compact`:``}`,role:`status`,children:[(0,R.jsx)(`div`,{className:`app-state-icon app-spin`,children:`⚙️`}),(0,R.jsx)(`h3`,{children:f(`Starting {label}…`,{label:n})}),(0,R.jsx)(`ol`,{className:`app-steps`,children:V.map((n,r)=>(0,R.jsxs)(`li`,{className:r<e?`app-step-done`:r===e?`app-step-now`:``,children:[r<e?`✓`:r===e?`●`:`○`,` `,f(n.label),n.status===`starting`&&t.port?f(` on port {port}`,{port:t.port}):``]},n.status))}),t.logTail.length>0&&(0,R.jsx)(`pre`,{className:`term app-log`,children:t.logTail.slice(-8).join(`
4
4
  `)})]})}return t.status===`error`?(0,R.jsxs)(`div`,{className:`app-state app-state-left ${d?`app-state-compact`:``}`,children:[(0,R.jsx)(`h3`,{children:f(`⚠️ {label} didn’t run`,{label:n})}),(0,R.jsx)(`div`,{className:`term-error`,children:t.error??f(`The app stopped unexpectedly.`)}),(0,R.jsx)(`pre`,{className:`term app-log`,"aria-label":f(`Last output`),children:t.logTail.length?t.logTail.join(`
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{f as r}from"./bloomMarks-CWsszTY1.js";import{i,r as a}from"./Office-fRdJ34l-.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d,r as f}from"./kit-iArIGJf-.js";var p=e(t(),1),m=n(),h=10,g=[[`#e63946`,`#f1faee`,`#ffb703`],[`#2a9d8f`,`#e9c46a`,`#f4a261`],[`#7209b7`,`#f72585`,`#4cc9f0`]];function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=(0,p.useRef)(null),v=d(e.side),y=(0,p.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:v*(105+n()*35),y:u(t)+18+n()*8,palette:g[Math.floor(n()*g.length)],burns:{next:3+n()*3,until:0}}},[e.seed,v,t]);return r(()=>{let r=e.t,o=n.current;if(!o)return;let l=r/e.seconds,u=y.x+Math.sin(r*.13)*4,d=y.y+l*12+Math.sin(r*.4)*.8,f=s(-y.dir*160,y.dir*160,l);if(o.position.set(u,d,f),o.rotation.z=Math.sin(r*.5)*.04,o.rotation.y=r*.05,r>=y.burns.next){y.burns.until=r+1.4,y.burns.next=r+6+Math.random()*5;let n=a(u,d-t,f,90);i(`burner`,{gain:n.gain*c(r,e.seconds,4),pan:n.pan})}if(_.current){let e=r<y.burns.until;_.current.visible=e,e&&_.current.scale.set(1,.8+Math.sin(r*40)*.25,1)}}),(0,m.jsxs)(`group`,{ref:n,children:[Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:l(y.palette[t%y.palette.length]),position:[0,15,0],scale:[1,1.15,1],children:(0,m.jsx)(`sphereGeometry`,{args:[9,3,14,t*Math.PI*2/h,Math.PI*2/h]})},t)),(0,m.jsx)(`mesh`,{material:l(y.palette[0],{side:2}),position:[0,4.6,0],children:(0,m.jsx)(`cylinderGeometry`,{args:[4.4,1.4,4,16,1,!0]})}),[0,1,2,3].map(e=>{let t=e*Math.PI/2+Math.PI/4;return(0,m.jsx)(`mesh`,{material:l(`#6b4a33`),position:[Math.cos(t)*1.1,1.5,Math.sin(t)*1.1],children:(0,m.jsx)(`cylinderGeometry`,{args:[.04,.04,2.4,4]})},e)}),(0,m.jsx)(`mesh`,{material:l(`#a1683a`),position:[0,-.3,0],children:(0,m.jsx)(`boxGeometry`,{args:[2,1.3,2]})}),(0,m.jsx)(`mesh`,{ref:_,material:f(`#ffb347`,{add:!0}),position:[0,3.1,0],visible:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.5,2.2,10]})})]})}export{_ as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{f as r}from"./bloomMarks-C54fx8hS.js";import{i,r as a}from"./Office-Dmaf62nb.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d,r as f}from"./kit-0ivWfN5y.js";var p=e(t(),1),m=n(),h=10,g=[[`#e63946`,`#f1faee`,`#ffb703`],[`#2a9d8f`,`#e9c46a`,`#f4a261`],[`#7209b7`,`#f72585`,`#4cc9f0`]];function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=(0,p.useRef)(null),v=d(e.side),y=(0,p.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:v*(105+n()*35),y:u(t)+18+n()*8,palette:g[Math.floor(n()*g.length)],burns:{next:3+n()*3,until:0}}},[e.seed,v,t]);return r(()=>{let r=e.t,o=n.current;if(!o)return;let l=r/e.seconds,u=y.x+Math.sin(r*.13)*4,d=y.y+l*12+Math.sin(r*.4)*.8,f=s(-y.dir*160,y.dir*160,l);if(o.position.set(u,d,f),o.rotation.z=Math.sin(r*.5)*.04,o.rotation.y=r*.05,r>=y.burns.next){y.burns.until=r+1.4,y.burns.next=r+6+Math.random()*5;let n=a(u,d-t,f,90);i(`burner`,{gain:n.gain*c(r,e.seconds,4),pan:n.pan})}if(_.current){let e=r<y.burns.until;_.current.visible=e,e&&_.current.scale.set(1,.8+Math.sin(r*40)*.25,1)}}),(0,m.jsxs)(`group`,{ref:n,children:[Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:l(y.palette[t%y.palette.length]),position:[0,15,0],scale:[1,1.15,1],children:(0,m.jsx)(`sphereGeometry`,{args:[9,3,14,t*Math.PI*2/h,Math.PI*2/h]})},t)),(0,m.jsx)(`mesh`,{material:l(y.palette[0],{side:2}),position:[0,4.6,0],children:(0,m.jsx)(`cylinderGeometry`,{args:[4.4,1.4,4,16,1,!0]})}),[0,1,2,3].map(e=>{let t=e*Math.PI/2+Math.PI/4;return(0,m.jsx)(`mesh`,{material:l(`#6b4a33`),position:[Math.cos(t)*1.1,1.5,Math.sin(t)*1.1],children:(0,m.jsx)(`cylinderGeometry`,{args:[.04,.04,2.4,4]})},e)}),(0,m.jsx)(`mesh`,{material:l(`#a1683a`),position:[0,-.3,0],children:(0,m.jsx)(`boxGeometry`,{args:[2,1.3,2]})}),(0,m.jsx)(`mesh`,{ref:_,material:f(`#ffb347`,{add:!0}),position:[0,3.1,0],visible:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.5,2.2,10]})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Bt as r,Ft as i,G as a,O as o,P as s,Pt as c,Tt as l,U as u,bt as d,et as f,f as p,g as m,j as h,nt as g,q as _,z as v,zt as y}from"./bloomMarks-CWsszTY1.js";import{n as b}from"./BufferGeometryUtils-BQuR3FyE.js";import{B as x,I as S,L as C,R as w,U as T}from"./rig-Bs_tw8rH.js";var E=e(t(),1),D=new Map;function O(e,t={}){let n={geometry:e,shading:t.shading??`toon`,outline:t.outline??0,crease:t.crease??0,castShadow:t.castShadow??!1,receiveShadow:t.receiveShadow??!1,material:t.material},r=`${e.uuid}|${n.shading}|${n.outline}|${n.crease}|${+n.castShadow}${+n.receiveShadow}|${n.material?.uuid??``}`,i=D.get(r);return i||(i={key:r,...n},D.set(r,i)),i}function k(e){let t=e.parent;if(!t)return!1;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}var A=16,j=class{look;set;materials;mesh;outline=null;slots=[];outlineGeometry=null;morphN=-1;constructor(e,t,n){this.look=e,this.set=t,this.materials=n,this.mesh=this.make(A),e.outline&&(this.outlineGeometry=e.crease?b(e.geometry,e.crease):e.geometry,this.outline=this.makeOutline(A))}make(e){let t=new _(this.look.geometry,this.look.material??this.materials[this.look.shading],e);t.instanceMatrix.setUsage(s),t.instanceColor=new a(new Float32Array(e*3),3).setUsage(s),t.count=0,t.castShadow=this.look.castShadow&&this.set.shadows,t.receiveShadow=this.look.receiveShadow,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0;let n=this.look.geometry.morphAttributes.position?.length??0;return n&&(t.morphTexture=new h(new Float32Array((n+1)*e),n+1,e,d,v)),this.set.root.add(t),t}makeOutline(e){let t=new _(this.outlineGeometry,this.materials.outline(this.look.outline),e);return t.instanceMatrix.setUsage(s),t.count=0,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0,this.set.root.add(t),t}add(e){this.slots.push(e);let t=this.mesh.instanceMatrix.count;this.slots.length<=t||(this.mesh.removeFromParent(),this.mesh.dispose(),this.mesh=this.make(t*2),this.morphN=-1,this.outline&&=(this.outline.removeFromParent(),this.outline.dispose(),this.makeOutline(t*2)))}remove(e){let t=this.slots.indexOf(e);t<0||(this.slots[t]=this.slots[this.slots.length-1],this.slots.pop())}sync(e,t){let n=this.mesh,r=n.instanceMatrix.array,i=n.instanceColor.array,a=this.outline,o=a?a.instanceMatrix.array:null,s=n.morphTexture?n.morphTexture.image.data:null,c=s?n.morphTexture.image.width:0,l=this.look.geometry.morphTargetsRelative,u=0,d=0,f=!1;for(let n of this.slots){if(!k(n.obj))continue;let a=n.obj.matrixWorld.elements;if(r.set(a,u*16),i[u*3]=n.color.r,i[u*3+1]=n.color.g,i[u*3+2]=n.color.b,s){let e=n.obj.morphTargetInfluences,t=0;for(let n=1;n<c;n++){let r=e?.[n-1]??0;s[u*c+n]!==r&&(f=!0),s[u*c+n]=r,t+=r}s[u*c]=l?1:1-t}if(u++,o){let n=a[12]-(e?.x??a[12]),r=a[13]-(e?.y??a[13]),i=a[14]-(e?.z??a[14]);n*n+r*r+i*i<=t&&o.set(a,d++*16)}}n.count=u,n.instanceMatrix.needsUpdate=!0,n.instanceColor.needsUpdate=!0,n.morphTexture&&(f||u!==this.morphN)&&(n.morphTexture.needsUpdate=!0),this.morphN=u,a&&(a.count=d,a.instanceMatrix.needsUpdate=!0)}dispose(){this.mesh.removeFromParent(),this.mesh.dispose(),this.outline?.removeFromParent(),this.outline?.dispose(),this.outlineGeometry&&this.outlineGeometry!==this.look.geometry&&this.outlineGeometry.dispose()}},M=class{materials;root=new u;camera=null;outlineRange=1/0;shadows=!0;batches=new Map;eye=new r;constructor(e){this.materials=e,this.root.name=`batches`}add(e,t,n){let r=this.batches.get(e.key);r||(r=new j(e,this,this.materials),this.batches.set(e.key,r));let i={obj:t,color:new o(n)};r.add(i);let a=r;return{setColor:e=>void i.color.set(e),remove:()=>a.remove(i)}}sync(){let e=this.camera?this.eye.setFromMatrixPosition(this.camera.matrixWorld):null,t=this.outlineRange*this.outlineRange;for(let n of this.batches.values())n.sync(e,t)}stats(){let e=0,t=0;for(let n of this.batches.values())e+=n.mesh.count,t+=n.outline?.count??0;return{batches:this.batches.size,instances:e,outlined:t}}dispose(){for(let e of this.batches.values())e.dispose();this.batches.clear()}};function N(e,t,n,r){var a=class extends l{constructor(a){super({vertexShader:t,fragmentShader:n,...a});for(let t in e)this.uniforms[t]=new c(e[t]),Object.defineProperty(this,t,{get(){return this.uniforms[t].value},set(e){this.uniforms[t].value=e}});this.uniforms=i.clone(this.uniforms),r?.(this)}};return a.key=f.generateUUID(),a}function P(e,t,n,r){let i=new g(r?b(t.geometry,r):t.geometry,n);return e.add(i),i}function F(e,t){let n=e.children[0];n&&(t&&n.geometry.dispose(),e.remove(n))}var I=n(),L=N({screenspace:!1,color:new o(`black`),opacity:1,thickness:.05,size:new y},`#include <common>
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Ct as r,G as i,Ht as a,I as o,J as s,Lt as c,M as l,Ot as u,Rt as d,Ut as f,V as p,X as m,at as h,f as g,g as _,k as v,rt as y}from"./bloomMarks-C54fx8hS.js";import{n as b}from"./BufferGeometryUtils-CT65PqMz.js";import{B as x,I as S,L as C,R as w,U as T}from"./rig-CrQ96zZT.js";var E=e(t(),1),D=new Map;function O(e,t={}){let n={geometry:e,shading:t.shading??`toon`,outline:t.outline??0,crease:t.crease??0,castShadow:t.castShadow??!1,receiveShadow:t.receiveShadow??!1,material:t.material},r=`${e.uuid}|${n.shading}|${n.outline}|${n.crease}|${+n.castShadow}${+n.receiveShadow}|${n.material?.uuid??``}`,i=D.get(r);return i||(i={key:r,...n},D.set(r,i)),i}function k(e){let t=e.parent;if(!t)return!1;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}var A=16,j=class{look;set;materials;mesh;outline=null;slots=[];outlineGeometry=null;morphN=-1;constructor(e,t,n){this.look=e,this.set=t,this.materials=n,this.mesh=this.make(A),e.outline&&(this.outlineGeometry=e.crease?b(e.geometry,e.crease):e.geometry,this.outline=this.makeOutline(A))}make(e){let t=new m(this.look.geometry,this.look.material??this.materials[this.look.shading],e);t.instanceMatrix.setUsage(o),t.instanceColor=new s(new Float32Array(e*3),3).setUsage(o),t.count=0,t.castShadow=this.look.castShadow&&this.set.shadows,t.receiveShadow=this.look.receiveShadow,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0;let n=this.look.geometry.morphAttributes.position?.length??0;return n&&(t.morphTexture=new l(new Float32Array((n+1)*e),n+1,e,r,p)),this.set.root.add(t),t}makeOutline(e){let t=new m(this.outlineGeometry,this.materials.outline(this.look.outline),e);return t.instanceMatrix.setUsage(o),t.count=0,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0,this.set.root.add(t),t}add(e){this.slots.push(e);let t=this.mesh.instanceMatrix.count;this.slots.length<=t||(this.mesh.removeFromParent(),this.mesh.dispose(),this.mesh=this.make(t*2),this.morphN=-1,this.outline&&=(this.outline.removeFromParent(),this.outline.dispose(),this.makeOutline(t*2)))}remove(e){let t=this.slots.indexOf(e);t<0||(this.slots[t]=this.slots[this.slots.length-1],this.slots.pop())}sync(e,t){let n=this.mesh,r=n.instanceMatrix.array,i=n.instanceColor.array,a=this.outline,o=a?a.instanceMatrix.array:null,s=n.morphTexture?n.morphTexture.image.data:null,c=s?n.morphTexture.image.width:0,l=this.look.geometry.morphTargetsRelative,u=0,d=0,f=!1;for(let n of this.slots){if(!k(n.obj))continue;let a=n.obj.matrixWorld.elements;if(r.set(a,u*16),i[u*3]=n.color.r,i[u*3+1]=n.color.g,i[u*3+2]=n.color.b,s){let e=n.obj.morphTargetInfluences,t=0;for(let n=1;n<c;n++){let r=e?.[n-1]??0;s[u*c+n]!==r&&(f=!0),s[u*c+n]=r,t+=r}s[u*c]=l?1:1-t}if(u++,o){let n=a[12]-(e?.x??a[12]),r=a[13]-(e?.y??a[13]),i=a[14]-(e?.z??a[14]);n*n+r*r+i*i<=t&&o.set(a,d++*16)}}n.count=u,n.instanceMatrix.needsUpdate=!0,n.instanceColor.needsUpdate=!0,n.morphTexture&&(f||u!==this.morphN)&&(n.morphTexture.needsUpdate=!0),this.morphN=u,a&&(a.count=d,a.instanceMatrix.needsUpdate=!0)}dispose(){this.mesh.removeFromParent(),this.mesh.dispose(),this.outline?.removeFromParent(),this.outline?.dispose(),this.outlineGeometry&&this.outlineGeometry!==this.look.geometry&&this.outlineGeometry.dispose()}},M=class{materials;root=new i;camera=null;outlineRange=1/0;shadows=!0;batches=new Map;eye=new f;constructor(e){this.materials=e,this.root.name=`batches`}add(e,t,n){let r=this.batches.get(e.key);r||(r=new j(e,this,this.materials),this.batches.set(e.key,r));let i={obj:t,color:new v(n)};r.add(i);let a=r;return{setColor:e=>void i.color.set(e),remove:()=>a.remove(i)}}sync(){let e=this.camera?this.eye.setFromMatrixPosition(this.camera.matrixWorld):null,t=this.outlineRange*this.outlineRange;for(let n of this.batches.values())n.sync(e,t)}stats(){let e=0,t=0;for(let n of this.batches.values())e+=n.mesh.count,t+=n.outline?.count??0;return{batches:this.batches.size,instances:e,outlined:t}}dispose(){for(let e of this.batches.values())e.dispose();this.batches.clear()}};function N(e,t,n,r){var i=class extends u{constructor(i){super({vertexShader:t,fragmentShader:n,...i});for(let t in e)this.uniforms[t]=new c(e[t]),Object.defineProperty(this,t,{get(){return this.uniforms[t].value},set(e){this.uniforms[t].value=e}});this.uniforms=d.clone(this.uniforms),r?.(this)}};return i.key=y.generateUUID(),i}function P(e,t,n,r){let i=new h(r?b(t.geometry,r):t.geometry,n);return e.add(i),i}function F(e,t){let n=e.children[0];n&&(t&&n.geometry.dispose(),e.remove(n))}var I=n(),L=N({screenspace:!1,color:new v(`black`),opacity:1,thickness:.05,size:new a},`#include <common>
2
2
  #include <morphtarget_pars_vertex>
3
3
  #include <skinning_pars_vertex>
4
4
  #include <clipping_planes_pars_vertex>
@@ -42,4 +42,4 @@ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./j
42
42
  gl_FragColor = vec4(color, opacity);
43
43
  #include <tonemapping_fragment>
44
44
  #include <colorspace_fragment>
45
- }`),R=new Map;function z(e){let t=R.get(e);return t||(t=new L({side:1}),t.thickness=e,t.color.set(V),R.set(e,t)),t}function B(e){for(let t of R.values())e.getDrawingBufferSize(t.size)}var V=`#1f1d2b`;function H({color:e=`black`,thickness:t=.05,angle:n=Math.PI}){let r=(0,E.useRef)(null),[i]=(0,E.useState)(()=>new L({side:1,clipping:!0})),a=m(e=>e.gl),o=(0,E.useRef)(null);return(0,E.useLayoutEffect)(()=>{let e=r.current,t=e?.parent;if(!e||!t?.geometry)return;let a=o.current;a&&a.group===e&&a.geometry===t.geometry&&a.angle===n||(a&&F(a.group,a.angle),P(e,t,i,n),o.current={group:e,geometry:t.geometry,angle:n})}),(0,E.useLayoutEffect)(()=>{i.thickness=t,i.color.set(e),a.getDrawingBufferSize(i.size)}),(0,E.useLayoutEffect)(()=>()=>{let e=o.current;o.current=null,e&&F(e.group,e.angle),i.dispose()},[i]),(0,I.jsx)(`group`,{ref:r})}var U={toon:w,glow:S,glowNight:C,outline:z},W=(0,E.createContext)(null),G=()=>(0,E.useContext)(W),K=new Set;function q(){for(let e of K)e.still.sync(),e.moving.sync()}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmBatches`)&&Object.defineProperty(window,"__swarmBatches",{get:()=>[...K].map(e=>({still:e.still.stats(),moving:e.moving.stats()}))});var J=typeof location<`u`&&/[?&]batch=off\b/.test(location.search);function Y(e){return J?(0,I.jsx)(I.Fragment,{children:e.children}):(0,I.jsx)(X,{...e})}function X({children:e,shadows:t=!0,outlineRange:n=24}){let r=m(e=>e.gl),i=m(e=>e.scene),a=(0,E.useMemo)(()=>{let e=new M(U);return e.root.userData.moving=!0,{still:new M(U),moving:e}},[]);return a.still.outlineRange=a.moving.outlineRange=n,a.still.shadows=a.moving.shadows=t,(0,E.useLayoutEffect)(()=>(K.add(a),i.onBeforeRender=q,()=>{K.delete(a),a.still.dispose(),a.moving.dispose()}),[a,i]),p(({camera:e})=>{a.still.camera=a.moving.camera=e,B(r)}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`primitive`,{object:a.still.root}),(0,I.jsx)(`primitive`,{object:a.moving.root}),(0,I.jsx)(W.Provider,{value:a,children:e})]})}function Z(e){let t=G();return t?(0,I.jsx)(te,{sets:t,...e}):(0,I.jsx)(Q,{...e})}function Q({look:e,color:t,position:n,rotation:r,scale:i,ref:a}){let o=e.material??(e.shading===`toon`?T(t):x(t,e.shading===`glowNight`?`night`:`always`));return(0,I.jsx)(`mesh`,{ref:a,geometry:e.geometry,material:o,position:n,rotation:r,scale:i,castShadow:e.castShadow,receiveShadow:e.receiveShadow,children:e.outline>0&&(0,I.jsx)(H,{thickness:e.outline,color:`#1f1d2b`,angle:e.crease})})}var $={standIn:!0};function ee(e){for(let t=e;t;t=t.parent)if(t.userData.person||t.userData.moving)return!0;return!1}function te({sets:e,look:t,color:n,position:r,rotation:i,scale:a,ref:o}){let s=(0,E.useRef)(null),c=(0,E.useRef)(null);(0,E.useLayoutEffect)(()=>{if(!s.current)return;let r=(ee(s.current)?e.moving:e.still).add(t,s.current,n);return c.current=r,()=>{r.remove(),c.current=null}},[e,t]),(0,E.useLayoutEffect)(()=>c.current?.setColor(n),[n]);let l=(0,E.useCallback)(e=>{s.current=e,typeof o==`function`?o(e):o&&(o.current=e)},[o]);return(0,I.jsx)(`mesh`,{ref:l,geometry:t.geometry,position:r,rotation:i,scale:a,visible:!1,userData:$})}function ne({geometry:e,color:t,outline:n=0,castShadow:r=!1,...i}){return(0,I.jsx)(Z,{look:O(e,{outline:n,castShadow:r}),color:t,...i})}export{H as a,G as i,Z as n,O as o,ne as r,Y as t};
45
+ }`),R=new Map;function z(e){let t=R.get(e);return t||(t=new L({side:1}),t.thickness=e,t.color.set(V),R.set(e,t)),t}function B(e){for(let t of R.values())e.getDrawingBufferSize(t.size)}var V=`#1f1d2b`;function H({color:e=`black`,thickness:t=.05,angle:n=Math.PI}){let r=(0,E.useRef)(null),[i]=(0,E.useState)(()=>new L({side:1,clipping:!0})),a=_(e=>e.gl),o=(0,E.useRef)(null);return(0,E.useLayoutEffect)(()=>{let e=r.current,t=e?.parent;if(!e||!t?.geometry)return;let a=o.current;a&&a.group===e&&a.geometry===t.geometry&&a.angle===n||(a&&F(a.group,a.angle),P(e,t,i,n),o.current={group:e,geometry:t.geometry,angle:n})}),(0,E.useLayoutEffect)(()=>{i.thickness=t,i.color.set(e),a.getDrawingBufferSize(i.size)}),(0,E.useLayoutEffect)(()=>()=>{let e=o.current;o.current=null,e&&F(e.group,e.angle),i.dispose()},[i]),(0,I.jsx)(`group`,{ref:r})}var U={toon:w,glow:S,glowNight:C,outline:z},W=(0,E.createContext)(null),G=()=>(0,E.useContext)(W),K=new Set;function q(){for(let e of K)e.still.sync(),e.moving.sync()}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmBatches`)&&Object.defineProperty(window,"__swarmBatches",{get:()=>[...K].map(e=>({still:e.still.stats(),moving:e.moving.stats()}))});var J=typeof location<`u`&&/[?&]batch=off\b/.test(location.search);function Y(e){return J?(0,I.jsx)(I.Fragment,{children:e.children}):(0,I.jsx)(X,{...e})}function X({children:e,shadows:t=!0,outlineRange:n=24}){let r=_(e=>e.gl),i=_(e=>e.scene),a=(0,E.useMemo)(()=>{let e=new M(U);return e.root.userData.moving=!0,{still:new M(U),moving:e}},[]);return a.still.outlineRange=a.moving.outlineRange=n,a.still.shadows=a.moving.shadows=t,(0,E.useLayoutEffect)(()=>(K.add(a),i.onBeforeRender=q,()=>{K.delete(a),a.still.dispose(),a.moving.dispose()}),[a,i]),g(({camera:e})=>{a.still.camera=a.moving.camera=e,B(r)}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`primitive`,{object:a.still.root}),(0,I.jsx)(`primitive`,{object:a.moving.root}),(0,I.jsx)(W.Provider,{value:a,children:e})]})}function Z(e){let t=G();return t?(0,I.jsx)(te,{sets:t,...e}):(0,I.jsx)(Q,{...e})}function Q({look:e,color:t,position:n,rotation:r,scale:i,ref:a}){let o=e.material??(e.shading===`toon`?T(t):x(t,e.shading===`glowNight`?`night`:`always`));return(0,I.jsx)(`mesh`,{ref:a,geometry:e.geometry,material:o,position:n,rotation:r,scale:i,castShadow:e.castShadow,receiveShadow:e.receiveShadow,children:e.outline>0&&(0,I.jsx)(H,{thickness:e.outline,color:`#1f1d2b`,angle:e.crease})})}var $={standIn:!0};function ee(e){for(let t=e;t;t=t.parent)if(t.userData.person||t.userData.moving)return!0;return!1}function te({sets:e,look:t,color:n,position:r,rotation:i,scale:a,ref:o}){let s=(0,E.useRef)(null),c=(0,E.useRef)(null);(0,E.useLayoutEffect)(()=>{if(!s.current)return;let r=(ee(s.current)?e.moving:e.still).add(t,s.current,n);return c.current=r,()=>{r.remove(),c.current=null}},[e,t]),(0,E.useLayoutEffect)(()=>c.current?.setColor(n),[n]);let l=(0,E.useCallback)(e=>{s.current=e,typeof o==`function`?o(e):o&&(o.current=e)},[o]);return(0,I.jsx)(`mesh`,{ref:l,geometry:t.geometry,position:r,rotation:i,scale:a,visible:!1,userData:$})}function ne({geometry:e,color:t,outline:n=0,castShadow:r=!1,...i}){return(0,I.jsx)(Z,{look:O(e,{outline:n,castShadow:r}),color:t,...i})}export{H as a,G as i,Z as n,O as o,ne as r,Y as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Bt as r,F as i,f as a,gt as o,tt as s}from"./bloomMarks-CWsszTY1.js";import{i as c,n as l,r as u}from"./Office-fRdJ34l-.js";import{ba as d}from"./store-D1ymxjG0.js";import{a as f}from"./director-CrzFgnoP.js";import{a as p,i as m,l as h,n as g,o as _}from"./kit-iArIGJf-.js";var v=e(t(),1),y=n(),b=26,x=new r(1,1,1),S=22;function C({run:e,elevation:t}){let n=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=_(e.side),E=(0,v.useMemo)(()=>{let n=f(e.seed),r=n()<.5?1:-1,i=Array.from({length:b},()=>({dx:(n()-.5)*5,dy:(n()-.5)*3.5,dz:(n()-.5)*11,phase:n()*6.28,rate:10+n()*4,wob:n()*6.28}));return{dir:r,x:T*(d+7+n()*5),y:g(t)+1+n()*2.5,birds:i}},[e.seed,T,t]),D=(0,v.useMemo)(()=>({body:new s,wing:new s,tmp:new s,q:new o,e:new i,p:new r,shape:new r(1,.85,1.8),chirpAt:1}),[]),O=(0,v.useMemo)(()=>({flap:null}),[]);(0,v.useEffect)(()=>(O.flap=l(`flap`),()=>O.flap?.stop(.6)),[O]),a(()=>{let r=e.t,i=n.current,a=C.current,o=w.current;if(!i||!a||!o)return;let s=Math.min(1,r/S),l=p(-E.dir*95,E.dir*95,s),d=E.y+Math.sin(s*Math.PI*2)*2.5,f=E.x-T*Math.sin(s*Math.PI)*3,h=E.dir>0?0:Math.PI;for(let e=0;e<b;e++){let t=E.birds[e],n=Math.sin(r*1.7+t.wob);D.p.set(f+t.dx+n*.6,d+t.dy+Math.sin(r*2.3+t.wob)*.5,l+t.dz),D.e.set(.08*n,h+.15*n,.2*n),D.q.setFromEuler(D.e),D.body.compose(D.p,D.q,D.shape),i.setMatrixAt(e,D.body),D.body.compose(D.p,D.q,x);let s=.15+Math.sin(r*t.rate+t.phase)*.55;D.wing.makeRotationZ(-s).premultiply(D.body),a.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(-.26,0,0))),D.wing.makeRotationZ(s).premultiply(D.body),o.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(.26,0,0)))}i.instanceMatrix.needsUpdate=!0,a.instanceMatrix.needsUpdate=!0,o.instanceMatrix.needsUpdate=!0;let g=u(f,d-t,l,25),_=m(r,24,2);O.flap?.set(g.gain*_,g.pan),r>=D.chirpAt&&r<S&&(D.chirpAt=r+.7+Math.random()*1.6,c(`chirps`,{gain:g.gain*_,pan:g.pan+(Math.random()-.5)*.4}))});let k=h(`#3d405b`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`instancedMesh`,{ref:n,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`sphereGeometry`,{args:[.1,8,6]})}),(0,y.jsx)(`instancedMesh`,{ref:C,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})}),(0,y.jsx)(`instancedMesh`,{ref:w,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})})]})}export{C as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{L as r,Ut as i,f as a,it as o,yt as s}from"./bloomMarks-C54fx8hS.js";import{i as c,n as l,r as u}from"./Office-Dmaf62nb.js";import{ba as d}from"./store-D17hJxYS.js";import{a as f}from"./director-CrzFgnoP.js";import{a as p,i as m,l as h,n as g,o as _}from"./kit-0ivWfN5y.js";var v=e(t(),1),y=n(),b=26,x=new i(1,1,1),S=22;function C({run:e,elevation:t}){let n=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=_(e.side),E=(0,v.useMemo)(()=>{let n=f(e.seed),r=n()<.5?1:-1,i=Array.from({length:b},()=>({dx:(n()-.5)*5,dy:(n()-.5)*3.5,dz:(n()-.5)*11,phase:n()*6.28,rate:10+n()*4,wob:n()*6.28}));return{dir:r,x:T*(d+7+n()*5),y:g(t)+1+n()*2.5,birds:i}},[e.seed,T,t]),D=(0,v.useMemo)(()=>({body:new o,wing:new o,tmp:new o,q:new s,e:new r,p:new i,shape:new i(1,.85,1.8),chirpAt:1}),[]),O=(0,v.useMemo)(()=>({flap:null}),[]);(0,v.useEffect)(()=>(O.flap=l(`flap`),()=>O.flap?.stop(.6)),[O]),a(()=>{let r=e.t,i=n.current,a=C.current,o=w.current;if(!i||!a||!o)return;let s=Math.min(1,r/S),l=p(-E.dir*95,E.dir*95,s),d=E.y+Math.sin(s*Math.PI*2)*2.5,f=E.x-T*Math.sin(s*Math.PI)*3,h=E.dir>0?0:Math.PI;for(let e=0;e<b;e++){let t=E.birds[e],n=Math.sin(r*1.7+t.wob);D.p.set(f+t.dx+n*.6,d+t.dy+Math.sin(r*2.3+t.wob)*.5,l+t.dz),D.e.set(.08*n,h+.15*n,.2*n),D.q.setFromEuler(D.e),D.body.compose(D.p,D.q,D.shape),i.setMatrixAt(e,D.body),D.body.compose(D.p,D.q,x);let s=.15+Math.sin(r*t.rate+t.phase)*.55;D.wing.makeRotationZ(-s).premultiply(D.body),a.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(-.26,0,0))),D.wing.makeRotationZ(s).premultiply(D.body),o.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(.26,0,0)))}i.instanceMatrix.needsUpdate=!0,a.instanceMatrix.needsUpdate=!0,o.instanceMatrix.needsUpdate=!0;let g=u(f,d-t,l,25),_=m(r,24,2);O.flap?.set(g.gain*_,g.pan),r>=D.chirpAt&&r<S&&(D.chirpAt=r+.7+Math.random()*1.6,c(`chirps`,{gain:g.gain*_,pan:g.pan+(Math.random()-.5)*.4}))});let k=h(`#3d405b`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`instancedMesh`,{ref:n,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`sphereGeometry`,{args:[.1,8,6]})}),(0,y.jsx)(`instancedMesh`,{ref:C,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})}),(0,y.jsx)(`instancedMesh`,{ref:w,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})})]})}export{C as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Ct as r,f as i,pt as a,st as o,w as s}from"./bloomMarks-CWsszTY1.js";import{p as c}from"./store-D1ymxjG0.js";import{n as l,r as u}from"./Office-fRdJ34l-.js";import{a as d}from"./director-CrzFgnoP.js";import{a as f,i as p,l as m,n as h,o as g}from"./kit-iArIGJf-.js";import{t as _}from"./news-CrPol-gz.js";var v=e(t(),1),y=n(),b={w:46,h:6,segments:40};function x(e){let t=document.createElement(`canvas`);t.width=2048,t.height=256;let n=t.getContext(`2d`);n.fillStyle=`#fffaf0`,n.fillRect(0,0,t.width,t.height),n.strokeStyle=`#e63946`,n.lineWidth=18,n.strokeRect(9,9,t.width-18,t.height-18),n.fillStyle=`#1f1d2b`,n.textAlign=`center`,n.textBaseline=`middle`;let i=170;do n.font=`bold ${i}px "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", sans-serif`;while(n.measureText(e).width>t.width-120&&(i-=8)>60);n.fillText(e,t.width/2,t.height/2+8);let a=new s(t);return a.colorSpace=r,a.anisotropy=8,a}function S({run:e,elevation:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),s=g(e.side),S=(0,v.useMemo)(()=>{let n=d(e.seed),r=c.getState(),i=_(r.repos,Date.now(),r.settings.companyName,n()),a=n()<.5?1:-1,o=-s*a*Math.PI/2;return{dir:a,x:s*(95+n()*20),y:h(t)+11+n()*5,text:i,turn:o,along:-Math.sin(o)}},[e.seed,s,t]),C=(0,v.useMemo)(()=>{let e=new a(b.w,b.h,b.segments,1),t=Float32Array.from(e.attributes.position.array),n=x(S.text);return{geo:e,base:t,map:n,mat:new o({map:n,side:2,fog:!1})}},[S.text]);(0,v.useEffect)(()=>()=>{C.geo.dispose(),C.map.dispose(),C.mat.dispose()},[C]);let w=(0,v.useMemo)(()=>({engine:null}),[]);(0,v.useEffect)(()=>(w.engine=l(`engine`),()=>w.engine?.stop(1.2)),[w]),i(()=>{let i=e.t,a=n.current;if(!a)return;let o=f(-S.dir*200,S.dir*200,i/e.seconds),s=S.y+Math.sin(i*.35)*.7;a.position.set(S.x,s,o),a.rotation.y=S.dir>0?0:Math.PI,a.rotation.x=Math.sin(i*.3)*.02;let c=r.current?.children;if(c)for(let e=0;e<c.length;e++)c[e].rotation.z=i*14;let l=C.geo.attributes.position,d=l.array;for(let e=0;e<l.count;e++){let t=.5-C.base[e*3]*S.along/b.w;d[e*3+2]=Math.sin(i*3.2-t*7)*t*1.1}l.needsUpdate=!0;let m=u(S.x,s-t,o,110);w.engine?.set(m.gain*p(i,e.seconds,4),m.pan)});let T=m(`#dfe3ea`),E=m(`#e63946`);return(0,y.jsxs)(`group`,{ref:n,children:[(0,y.jsx)(`mesh`,{material:T,scale:[6,6,21],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,16]})}),(0,y.jsx)(`mesh`,{material:E,scale:[6.05,1.1,18],position:[0,.2,0],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,8]})}),[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:E,position:[0,0,-18],"rotation-z":e*Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[.4,9,4]})},e)),(0,y.jsx)(`mesh`,{material:m(`#495057`),position:[0,-6.4,2],children:(0,y.jsx)(`boxGeometry`,{args:[2.2,1.6,5]})}),(0,y.jsx)(`group`,{ref:r,children:[-1.6,1.6].map(e=>(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[e,-6.4,-.8],children:(0,y.jsx)(`boxGeometry`,{args:[.2,2.6,.12]})},e))}),(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[0,-3,-26],"rotation-x":Math.PI/2-.25,children:(0,y.jsx)(`cylinderGeometry`,{args:[.05,.05,12,4]})}),(0,y.jsx)(`mesh`,{geometry:C.geo,material:C.mat,position:[0,-5,-32-b.w/2],"rotation-y":S.turn})]})}export{S as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Et as r,T as i,f as a,gt as o,ut as s}from"./bloomMarks-C54fx8hS.js";import{p as c}from"./store-D17hJxYS.js";import{n as l,r as u}from"./Office-Dmaf62nb.js";import{a as d}from"./director-CrzFgnoP.js";import{a as f,i as p,l as m,n as h,o as g}from"./kit-0ivWfN5y.js";import{t as _}from"./news-CrPol-gz.js";var v=e(t(),1),y=n(),b={w:46,h:6,segments:40};function x(e){let t=document.createElement(`canvas`);t.width=2048,t.height=256;let n=t.getContext(`2d`);n.fillStyle=`#fffaf0`,n.fillRect(0,0,t.width,t.height),n.strokeStyle=`#e63946`,n.lineWidth=18,n.strokeRect(9,9,t.width-18,t.height-18),n.fillStyle=`#1f1d2b`,n.textAlign=`center`,n.textBaseline=`middle`;let a=170;do n.font=`bold ${a}px "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", sans-serif`;while(n.measureText(e).width>t.width-120&&(a-=8)>60);n.fillText(e,t.width/2,t.height/2+8);let o=new i(t);return o.colorSpace=r,o.anisotropy=8,o}function S({run:e,elevation:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),i=g(e.side),S=(0,v.useMemo)(()=>{let n=d(e.seed),r=c.getState(),a=_(r.repos,Date.now(),r.settings.companyName,n()),o=n()<.5?1:-1,s=-i*o*Math.PI/2;return{dir:o,x:i*(95+n()*20),y:h(t)+11+n()*5,text:a,turn:s,along:-Math.sin(s)}},[e.seed,i,t]),C=(0,v.useMemo)(()=>{let e=new o(b.w,b.h,b.segments,1),t=Float32Array.from(e.attributes.position.array),n=x(S.text);return{geo:e,base:t,map:n,mat:new s({map:n,side:2,fog:!1})}},[S.text]);(0,v.useEffect)(()=>()=>{C.geo.dispose(),C.map.dispose(),C.mat.dispose()},[C]);let w=(0,v.useMemo)(()=>({engine:null}),[]);(0,v.useEffect)(()=>(w.engine=l(`engine`),()=>w.engine?.stop(1.2)),[w]),a(()=>{let i=e.t,a=n.current;if(!a)return;let o=f(-S.dir*200,S.dir*200,i/e.seconds),s=S.y+Math.sin(i*.35)*.7;a.position.set(S.x,s,o),a.rotation.y=S.dir>0?0:Math.PI,a.rotation.x=Math.sin(i*.3)*.02;let c=r.current?.children;if(c)for(let e=0;e<c.length;e++)c[e].rotation.z=i*14;let l=C.geo.attributes.position,d=l.array;for(let e=0;e<l.count;e++){let t=.5-C.base[e*3]*S.along/b.w;d[e*3+2]=Math.sin(i*3.2-t*7)*t*1.1}l.needsUpdate=!0;let m=u(S.x,s-t,o,110);w.engine?.set(m.gain*p(i,e.seconds,4),m.pan)});let T=m(`#dfe3ea`),E=m(`#e63946`);return(0,y.jsxs)(`group`,{ref:n,children:[(0,y.jsx)(`mesh`,{material:T,scale:[6,6,21],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,16]})}),(0,y.jsx)(`mesh`,{material:E,scale:[6.05,1.1,18],position:[0,.2,0],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,8]})}),[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:E,position:[0,0,-18],"rotation-z":e*Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[.4,9,4]})},e)),(0,y.jsx)(`mesh`,{material:m(`#495057`),position:[0,-6.4,2],children:(0,y.jsx)(`boxGeometry`,{args:[2.2,1.6,5]})}),(0,y.jsx)(`group`,{ref:r,children:[-1.6,1.6].map(e=>(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[e,-6.4,-.8],children:(0,y.jsx)(`boxGeometry`,{args:[.2,2.6,.12]})},e))}),(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[0,-3,-26],"rotation-x":Math.PI/2-.25,children:(0,y.jsx)(`cylinderGeometry`,{args:[.05,.05,12,4]})}),(0,y.jsx)(`mesh`,{geometry:C.geo,material:C.mat,position:[0,-5,-32-b.w/2],"rotation-y":S.turn})]})}export{S as default};
@@ -1 +1 @@
1
- import{C as e,S as t}from"./bloomMarks-CWsszTY1.js";function n(t,n=!1){let i=t[0].index!==null,a=new Set(Object.keys(t[0].attributes)),o=new Set(Object.keys(t[0].morphAttributes)),s={},c={},l=t[0].morphTargetsRelative,u=new e,d=0;for(let e=0;e<t.length;++e){let r=t[e],f=0;if(i!==(r.index!==null))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.`),null;for(let t in r.attributes){if(!a.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure "`+t+`" attribute exists among all geometries, or in none of them.`),null;s[t]===void 0&&(s[t]=[]),s[t].push(r.attributes[t]),f++}if(f!==a.size)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. Make sure all geometries have the same number of attributes.`),null;if(l!==r.morphTargetsRelative)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphTargetsRelative must be consistent throughout all geometries.`),null;for(let t in r.morphAttributes){if(!o.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphAttributes must be consistent throughout all geometries.`),null;c[t]===void 0&&(c[t]=[]),c[t].push(r.morphAttributes[t])}if(n){let t;if(i)t=r.index.count;else if(r.attributes.position!==void 0)t=r.attributes.position.count;else return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. The geometry must have either an index or a position attribute`),null;u.addGroup(d,t,e),d+=t}}if(i){let e=0,n=[];for(let r=0;r<t.length;++r){let i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}u.setIndex(n)}for(let e in s){let t=r(s[e]);if(!t)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` attribute.`),null;u.setAttribute(e,t)}for(let e in c){let t=c[e][0].length;if(t!==0){u.morphAttributes=u.morphAttributes||{},u.morphAttributes[e]=[];for(let n=0;n<t;++n){let t=[];for(let r=0;r<c[e].length;++r)t.push(c[e][r][n]);let i=r(t);if(!i)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` morphAttribute.`),null;u.morphAttributes[e].push(i)}}}return u}function r(e){let n,r,i,a=-1,o=0;for(let t=0;t<e.length;++t){let s=e[t];if(n===void 0&&(n=s.array.constructor),n!==s.array.constructor)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.`),null;if(r===void 0&&(r=s.itemSize),r!==s.itemSize)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.`),null;if(i===void 0&&(i=s.normalized),i!==s.normalized)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.`),null;if(a===-1&&(a=s.gpuType),a!==s.gpuType)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.`),null;o+=s.count*r}let s=new n(o),c=new t(s,r,i),l=0;for(let t=0;t<e.length;++t){let n=e[t];if(n.isInterleavedBufferAttribute){let e=l/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){let r=n.getComponent(t,i);c.setComponent(t+e,i,r)}}else s.set(n.array,l);l+=n.count*r}return a!==void 0&&(c.gpuType=a),c}function i(e,n=Math.PI/3){let r=e.index?e.toNonIndexed():e,i=r.attributes.position,a=i.count,o;if(i.isBufferAttribute===!0&&i.itemSize===3&&i.normalized===!1)o=i.array;else{o=new Float64Array(a*3);for(let e=0;e<a;e++)o[3*e+0]=i.getX(e),o[3*e+1]=i.getY(e),o[3*e+2]=i.getZ(e)}let s=Math.cos(n),c=(1+1e-10)*100,l=a/3,u=new Float64Array(l*3);for(let e=0;e<l;e++){let t=9*e,n=o[t+0],r=o[t+1],i=o[t+2],a=o[t+3],s=o[t+4],c=o[t+5],l=o[t+6],d=o[t+7],f=o[t+8],p=l-a,m=d-s,h=f-c,g=n-a,_=r-s,v=i-c,y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=1/(Math.sqrt(y*y+b*b+x*x)||1);u[3*e+0]=y*S,u[3*e+1]=b*S,u[3*e+2]=x*S}let d=new Int32Array(a),f=new Float64Array(a*3),p=1;for(;p<a*2;)p<<=1;let m=p-1,h=new Int32Array(p),g=0;for(let e=0;e<a;e++){let t=3*e,n=Math.trunc(o[t+0]*c),r=Math.trunc(o[t+1]*c),i=Math.trunc(o[t+2]*c),a=(Math.imul(n,73856093)^Math.imul(r,19349663)^Math.imul(i,83492791))&m;for(;;){let t=h[a];if(t===0){let t=3*g;f[t+0]=n,f[t+1]=r,f[t+2]=i,h[a]=g+1,d[e]=g++;break}let o=3*(t-1);if(f[o+0]===n&&f[o+1]===r&&f[o+2]===i){d[e]=t-1;break}a=a+1&m}}let _=new Int32Array(g+1);for(let e=0;e<a;e++)_[d[e]+1]++;for(let e=0;e<g;e++)_[e+1]+=_[e];let v=new Int32Array(a),y=_.slice(0,g);for(let e=0;e<l;e++){let t=3*e;v[y[d[t+0]]++]=e,v[y[d[t+1]]++]=e,v[y[d[t+2]]++]=e}let b=new Float32Array(a*3);for(let e=0;e<l;e++){let t=3*e,n=u[t+0],r=u[t+1],i=u[t+2];for(let e=0;e<3;e++){let a=t+e,o=d[a],c=0,l=0,f=0;for(let e=_[o],t=_[o+1];e<t;e++){let t=3*v[e],a=u[t+0],o=u[t+1],d=u[t+2];n*a+r*o+i*d>s&&(c+=a,l+=o,f+=d)}let p=1/(Math.sqrt(c*c+l*l+f*f)||1);b[3*a+0]=c*p,b[3*a+1]=l*p,b[3*a+2]=f*p}}return r.setAttribute(`normal`,new t(b,3,!1)),r}export{i as n,n as t};
1
+ import{C as e,w as t}from"./bloomMarks-C54fx8hS.js";function n(e,n=!1){let i=e[0].index!==null,a=new Set(Object.keys(e[0].attributes)),o=new Set(Object.keys(e[0].morphAttributes)),s={},c={},l=e[0].morphTargetsRelative,u=new t,d=0;for(let t=0;t<e.length;++t){let r=e[t],f=0;if(i!==(r.index!==null))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+t+`. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.`),null;for(let e in r.attributes){if(!a.has(e))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+t+`. All geometries must have compatible attributes; make sure "`+e+`" attribute exists among all geometries, or in none of them.`),null;s[e]===void 0&&(s[e]=[]),s[e].push(r.attributes[e]),f++}if(f!==a.size)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+t+`. Make sure all geometries have the same number of attributes.`),null;if(l!==r.morphTargetsRelative)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+t+`. .morphTargetsRelative must be consistent throughout all geometries.`),null;for(let e in r.morphAttributes){if(!o.has(e))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+t+`. .morphAttributes must be consistent throughout all geometries.`),null;c[e]===void 0&&(c[e]=[]),c[e].push(r.morphAttributes[e])}if(n){let e;if(i)e=r.index.count;else if(r.attributes.position!==void 0)e=r.attributes.position.count;else return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+t+`. The geometry must have either an index or a position attribute`),null;u.addGroup(d,e,t),d+=e}}if(i){let t=0,n=[];for(let r=0;r<e.length;++r){let i=e[r].index;for(let e=0;e<i.count;++e)n.push(i.getX(e)+t);t+=e[r].attributes.position.count}u.setIndex(n)}for(let e in s){let t=r(s[e]);if(!t)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` attribute.`),null;u.setAttribute(e,t)}for(let e in c){let t=c[e][0].length;if(t!==0){u.morphAttributes=u.morphAttributes||{},u.morphAttributes[e]=[];for(let n=0;n<t;++n){let t=[];for(let r=0;r<c[e].length;++r)t.push(c[e][r][n]);let i=r(t);if(!i)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` morphAttribute.`),null;u.morphAttributes[e].push(i)}}}return u}function r(t){let n,r,i,a=-1,o=0;for(let e=0;e<t.length;++e){let s=t[e];if(n===void 0&&(n=s.array.constructor),n!==s.array.constructor)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.`),null;if(r===void 0&&(r=s.itemSize),r!==s.itemSize)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.`),null;if(i===void 0&&(i=s.normalized),i!==s.normalized)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.`),null;if(a===-1&&(a=s.gpuType),a!==s.gpuType)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.`),null;o+=s.count*r}let s=new n(o),c=new e(s,r,i),l=0;for(let e=0;e<t.length;++e){let n=t[e];if(n.isInterleavedBufferAttribute){let e=l/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){let r=n.getComponent(t,i);c.setComponent(t+e,i,r)}}else s.set(n.array,l);l+=n.count*r}return a!==void 0&&(c.gpuType=a),c}function i(t,n=Math.PI/3){let r=t.index?t.toNonIndexed():t,i=r.attributes.position,a=i.count,o;if(i.isBufferAttribute===!0&&i.itemSize===3&&i.normalized===!1)o=i.array;else{o=new Float64Array(a*3);for(let e=0;e<a;e++)o[3*e+0]=i.getX(e),o[3*e+1]=i.getY(e),o[3*e+2]=i.getZ(e)}let s=Math.cos(n),c=(1+1e-10)*100,l=a/3,u=new Float64Array(l*3);for(let e=0;e<l;e++){let t=9*e,n=o[t+0],r=o[t+1],i=o[t+2],a=o[t+3],s=o[t+4],c=o[t+5],l=o[t+6],d=o[t+7],f=o[t+8],p=l-a,m=d-s,h=f-c,g=n-a,_=r-s,v=i-c,y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=1/(Math.sqrt(y*y+b*b+x*x)||1);u[3*e+0]=y*S,u[3*e+1]=b*S,u[3*e+2]=x*S}let d=new Int32Array(a),f=new Float64Array(a*3),p=1;for(;p<a*2;)p<<=1;let m=p-1,h=new Int32Array(p),g=0;for(let e=0;e<a;e++){let t=3*e,n=Math.trunc(o[t+0]*c),r=Math.trunc(o[t+1]*c),i=Math.trunc(o[t+2]*c),a=(Math.imul(n,73856093)^Math.imul(r,19349663)^Math.imul(i,83492791))&m;for(;;){let t=h[a];if(t===0){let t=3*g;f[t+0]=n,f[t+1]=r,f[t+2]=i,h[a]=g+1,d[e]=g++;break}let o=3*(t-1);if(f[o+0]===n&&f[o+1]===r&&f[o+2]===i){d[e]=t-1;break}a=a+1&m}}let _=new Int32Array(g+1);for(let e=0;e<a;e++)_[d[e]+1]++;for(let e=0;e<g;e++)_[e+1]+=_[e];let v=new Int32Array(a),y=_.slice(0,g);for(let e=0;e<l;e++){let t=3*e;v[y[d[t+0]]++]=e,v[y[d[t+1]]++]=e,v[y[d[t+2]]++]=e}let b=new Float32Array(a*3);for(let e=0;e<l;e++){let t=3*e,n=u[t+0],r=u[t+1],i=u[t+2];for(let e=0;e<3;e++){let a=t+e,o=d[a],c=0,l=0,f=0;for(let e=_[o],t=_[o+1];e<t;e++){let t=3*v[e],a=u[t+0],o=u[t+1],d=u[t+2];n*a+r*o+i*d>s&&(c+=a,l+=o,f+=d)}let p=1/(Math.sqrt(c*c+l*l+f*f)||1);b[3*a+0]=c*p,b[3*a+1]=l*p,b[3*a+2]=f*p}}return r.setAttribute(`normal`,new e(b,3,!1)),r}export{i as n,n as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{f as r}from"./bloomMarks-CWsszTY1.js";import{i,r as a}from"./Office-fRdJ34l-.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d}from"./kit-iArIGJf-.js";var f=e(t(),1),p=n(),m=22;function h({run:e,elevation:t}){let n=(0,f.useRef)(null),h=d(e.side),g=(0,f.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:h*(115+n()*30),y:u(t)+6+n()*6,next:4+n()*4}},[e.seed,h,t]);r(()=>{let r=e.t,o=n.current;if(!o)return;let l=s(-g.dir*175,g.dir*175,r/e.seconds),u=g.y+Math.sin(r*.8)*1.6;if(o.position.set(g.x+Math.sin(r*.21)*6,u,l),o.rotation.set(Math.sin(r*.9)*.05,(g.dir>0?0:Math.PI)+Math.sin(r*.33)*.5,Math.sin(r*.7)*.06),r>=g.next){g.next=r+7+Math.random()*6;let n=a(o.position.x,u-t,l,110);i(`squeak`,{gain:n.gain*c(r,e.seconds,3),pan:n.pan,pitch:.8+Math.random()*.3})}});let _=l(`#ffd23f`),v=l(`#ff8c1a`),y=l(`#1f1d2b`);return(0,p.jsx)(`group`,{ref:n,children:(0,p.jsxs)(`group`,{scale:m,children:[(0,p.jsx)(`mesh`,{material:_,scale:[1,.78,1.25],children:(0,p.jsx)(`sphereGeometry`,{args:[.5,22,16]})}),(0,p.jsx)(`mesh`,{material:_,position:[0,.18,-.6],"rotation-x":-.9,children:(0,p.jsx)(`coneGeometry`,{args:[.2,.4,14]})}),[-1,1].map(e=>(0,p.jsx)(`mesh`,{material:_,position:[e*.44,.08,-.05],scale:[.35,.6,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.3,14,10]})},e)),(0,p.jsx)(`mesh`,{material:_,position:[0,.58,.36],children:(0,p.jsx)(`sphereGeometry`,{args:[.32,20,14]})}),(0,p.jsx)(`mesh`,{material:v,position:[0,.5,.68],scale:[1.1,.42,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.16,14,10]})}),[-1,1].map(e=>(0,p.jsxs)(`group`,{children:[(0,p.jsx)(`mesh`,{material:y,position:[e*.14,.68,.6],children:(0,p.jsx)(`sphereGeometry`,{args:[.05,10,8]})}),(0,p.jsx)(`mesh`,{material:l(`#ffffff`),position:[e*.13,.7,.645],children:(0,p.jsx)(`sphereGeometry`,{args:[.015,6,4]})})]},e))]})})}export{h as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{f as r}from"./bloomMarks-C54fx8hS.js";import{i,r as a}from"./Office-Dmaf62nb.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d}from"./kit-0ivWfN5y.js";var f=e(t(),1),p=n(),m=22;function h({run:e,elevation:t}){let n=(0,f.useRef)(null),h=d(e.side),g=(0,f.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:h*(115+n()*30),y:u(t)+6+n()*6,next:4+n()*4}},[e.seed,h,t]);r(()=>{let r=e.t,o=n.current;if(!o)return;let l=s(-g.dir*175,g.dir*175,r/e.seconds),u=g.y+Math.sin(r*.8)*1.6;if(o.position.set(g.x+Math.sin(r*.21)*6,u,l),o.rotation.set(Math.sin(r*.9)*.05,(g.dir>0?0:Math.PI)+Math.sin(r*.33)*.5,Math.sin(r*.7)*.06),r>=g.next){g.next=r+7+Math.random()*6;let n=a(o.position.x,u-t,l,110);i(`squeak`,{gain:n.gain*c(r,e.seconds,3),pan:n.pan,pitch:.8+Math.random()*.3})}});let _=l(`#ffd23f`),v=l(`#ff8c1a`),y=l(`#1f1d2b`);return(0,p.jsx)(`group`,{ref:n,children:(0,p.jsxs)(`group`,{scale:m,children:[(0,p.jsx)(`mesh`,{material:_,scale:[1,.78,1.25],children:(0,p.jsx)(`sphereGeometry`,{args:[.5,22,16]})}),(0,p.jsx)(`mesh`,{material:_,position:[0,.18,-.6],"rotation-x":-.9,children:(0,p.jsx)(`coneGeometry`,{args:[.2,.4,14]})}),[-1,1].map(e=>(0,p.jsx)(`mesh`,{material:_,position:[e*.44,.08,-.05],scale:[.35,.6,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.3,14,10]})},e)),(0,p.jsx)(`mesh`,{material:_,position:[0,.58,.36],children:(0,p.jsx)(`sphereGeometry`,{args:[.32,20,14]})}),(0,p.jsx)(`mesh`,{material:v,position:[0,.5,.68],scale:[1.1,.42,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.16,14,10]})}),[-1,1].map(e=>(0,p.jsxs)(`group`,{children:[(0,p.jsx)(`mesh`,{material:y,position:[e*.14,.68,.6],children:(0,p.jsx)(`sphereGeometry`,{args:[.05,10,8]})}),(0,p.jsx)(`mesh`,{material:l(`#ffffff`),position:[e*.13,.7,.645],children:(0,p.jsx)(`sphereGeometry`,{args:[.015,6,4]})})]},e))]})})}export{h as default};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Ht as r,O as i,Tt as a,f as o,g as s,it as c,pt as l,rt as u,tt as d,ut as f,w as p}from"./bloomMarks-CWsszTY1.js";import{createPipeline as m,t as h}from"./pipeline-DvDJ46O5.js";import{Jr as g,dn as _}from"./store-D1ymxjG0.js";import{a as v}from"./gate-B4Yyimy5.js";import{a as y,c as b,n as x}from"./useGraphics-CnMUzm0p.js";var S=e(t(),1),C={name:`HorizontalBlurShader`,uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Gt as r,Ot as i,T as a,f as o,g as s,gt as c,it as l,k as u,ot as d,pt as f,st as p}from"./bloomMarks-C54fx8hS.js";import{createPipeline as m,t as h}from"./pipeline-Bpizl8Xd.js";import{Jr as g,dn as _}from"./store-D17hJxYS.js";import{a as v}from"./gate-D2IhTYgP.js";import{a as y,c as b,n as x}from"./useGraphics-CJhpDhqZ.js";var S=e(t(),1),C={name:`HorizontalBlurShader`,uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
2
2
 
3
3
  varying vec2 vUv;
4
4
 
@@ -62,4 +62,4 @@ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./j
62
62
 
63
63
  gl_FragColor = sum;
64
64
 
65
- }`},T=n(),E=1.1,D=[1024,768],O=8e3,k=.45,A=48,j=()=>null;function M(){let e=new c;return e.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace(`vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * 0.85 );`)},e}function N(e){if(e.userData.person||e.userData.moving||e.userData.contactShadow)return!0;let t=e.material;return e.isPoints||e.isSprite?!0:!!t&&!Array.isArray(t)&&t.transparent&&!t.depthWrite}function P(){let e=s(e=>e.gl),t=s(e=>e.scene),n=(0,S.useMemo)(()=>{let e=new r(D[0],D[1]),t=new r(D[0],D[1],{depthBuffer:!1});e.texture.generateMipmaps=t.texture.generateMipmaps=!1;let n=new f(-16,16,12,-12,0,E);n.position.set(0,-.005,0),n.up.set(0,0,1),n.lookAt(0,1,0),n.updateMatrixWorld(),e.texture.repeat.set(1,-1),e.texture.offset.set(0,1);let i=new a(C),o=new a(w);i.depthTest=o.depthTest=!1;let s=new h(i);return{target:e,blurTarget:t,camera:n,depth:M(),quad:s,h:i,v:o,hidden:[]}},[]);(0,S.useEffect)(()=>()=>{for(let e of[n.target,n.blurTarget,n.depth,n.quad,n.h,n.v])e.dispose()},[n]);let c=t=>{let{quad:r,h:i,v:a,target:o,blurTarget:s}=n;r.material=i,i.uniforms.tDiffuse.value=o.texture,i.uniforms.h.value=t/D[0],e.setRenderTarget(s),r.render(e),r.material=a,a.uniforms.tDiffuse.value=s.texture,a.uniforms.v.value=t/D[1],e.setRenderTarget(o),r.render(e)},l=(0,S.useRef)(-1/0);return o(()=>{let r=performance.now();if(r-l.current<O)return;l.current=r;let{hidden:a,target:o,camera:s,depth:u}=n;t.traverse(e=>{e.visible&&N(e)&&(e.visible=!1,a.push(e))});let d=t.background,f=t.overrideMaterial,p=e.shadowMap.autoUpdate,m=e.getRenderTarget(),h=e.autoClear,g=e.getClearAlpha(),_=e.getClearColor(new i);t.background=null,t.overrideMaterial=u,e.shadowMap.autoUpdate=!1;try{e.setRenderTarget(o),e.setClearColor(0,0),e.clear(!0,!0,!1),e.autoClear=!1,e.render(t,s),c(3),c(1.2)}finally{for(let e of a)e.visible=!0;a.length=0,t.background=d,t.overrideMaterial=f,e.shadowMap.autoUpdate=p,e.autoClear=h,e.setClearColor(_,g),e.setRenderTarget(m)}}),(0,T.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,.008,0],raycast:j,userData:{contactShadow:!0},renderOrder:-1,children:[(0,T.jsx)(`planeGeometry`,{args:[32,24]}),(0,T.jsx)(`meshBasicMaterial`,{map:n.target.texture,transparent:!0,opacity:k,depthWrite:!1,toneMapped:!1,fog:!1})]})}function F(){let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`),n=t.createRadialGradient(32,32,0,32,32,32);return n.addColorStop(0,`rgba(0,0,0,0.38)`),n.addColorStop(.55,`rgba(0,0,0,0.2)`),n.addColorStop(1,`rgba(0,0,0,0)`),t.fillStyle=n,t.fillRect(0,0,64,64),new p(e)}function I(){let e=(0,S.useRef)(null),t=(0,S.useMemo)(()=>({geometry:new l(1,1).rotateX(-Math.PI/2),material:new u({map:F(),transparent:!0,depthWrite:!1,toneMapped:!1,fog:!1}),m:new d}),[]);return(0,S.useEffect)(()=>()=>{t.geometry.dispose(),t.material.map?.dispose(),t.material.dispose()},[t]),o(()=>{let n=e.current;if(!n)return;let r=0;for(let e of _().values()){if(r>=A)break;let i=.62+.2*e.sit;t.m.makeScale(i,1,i).setPosition(e.x,.009,e.z),n.setMatrixAt(r++,t.m)}n.count=r,n.instanceMatrix.needsUpdate=!0}),(0,T.jsx)(`instancedMesh`,{ref:e,args:[t.geometry,t.material,A],frustumCulled:!1,raycast:j,userData:{contactShadow:!0}})}function L(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(P,{}),(0,T.jsx)(I,{})]})}var R=new Map,z=null,B,V=4e3,H=6e4;function U(e,t,n,r){clearTimeout(B),z??={autoClear:e.autoClear,autoReset:e.info.autoReset};let i=R.get(r);if(i&&i.scene===t&&i.camera===n)return i.pipe;i?.pipe.drop();let a=m(e,t,n,r);return R.set(r,{scene:t,camera:n,pipe:a}),a}function W(e){z&&=(e.autoClear=z.autoClear,e.info.autoReset=z.autoReset,null),e.setRenderTarget(null),clearTimeout(B),B=setTimeout(()=>{for(let e of R.values())e.pipe.drop();R.clear()},H)}function G({tier:e}){let t=s(e=>e.gl),n=s(e=>e.scene),r=s(e=>e.camera),i=s(e=>e.size),a=s(e=>e.viewport.dpr),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(!1),d=(0,S.useRef)({at:0,done:!1});return(0,S.useLayoutEffect)(()=>{let i=U(t,n,r,e);return u.current=!1,l(i),()=>{b(null),y(`low`)}},[t,n,r,e]),(0,S.useEffect)(()=>()=>W(t),[t]),(0,S.useLayoutEffect)(()=>c?.setSize(i.width,i.height),[c,i,a]),(0,S.useEffect)(()=>{if(!c)return;let e=setInterval(()=>b(c.stats()),1e3);return()=>clearInterval(e)},[c]),o((a,o)=>{if(!v()){if(!c)t.render(n,r);else{try{let a=d.current;if(!a.done&&a.at&&performance.now()>=a.at){a.done=!0;let s=e===`high`?`medium`:`high`;if(!R.has(s)){let e=performance.now(),a=U(t,n,r,s);a.setSize(i.width,i.height),a.render(o),g(`warmup`,`${s} effects built in ${Math.round(performance.now()-e)} ms`)}}c.render(o)}catch(e){x(`they stopped with an error`,e),t.render(n,r);return}u.current||(u.current=!0,d.current.at||(d.current.at=performance.now()+V),b(c.stats()),y(e))}}},1),e===`high`?(0,T.jsx)(L,{}):null}export{G as default};
65
+ }`},T=n(),E=1.1,D=[1024,768],O=8e3,k=.45,A=48,j=()=>null;function M(){let e=new p;return e.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace(`vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * 0.85 );`)},e}function N(e){if(e.userData.person||e.userData.moving||e.userData.contactShadow)return!0;let t=e.material;return e.isPoints||e.isSprite?!0:!!t&&!Array.isArray(t)&&t.transparent&&!t.depthWrite}function P(){let e=s(e=>e.gl),t=s(e=>e.scene),n=(0,S.useMemo)(()=>{let e=new r(D[0],D[1]),t=new r(D[0],D[1],{depthBuffer:!1});e.texture.generateMipmaps=t.texture.generateMipmaps=!1;let n=new f(-16,16,12,-12,0,E);n.position.set(0,-.005,0),n.up.set(0,0,1),n.lookAt(0,1,0),n.updateMatrixWorld(),e.texture.repeat.set(1,-1),e.texture.offset.set(0,1);let a=new i(C),o=new i(w);a.depthTest=o.depthTest=!1;let s=new h(a);return{target:e,blurTarget:t,camera:n,depth:M(),quad:s,h:a,v:o,hidden:[]}},[]);(0,S.useEffect)(()=>()=>{for(let e of[n.target,n.blurTarget,n.depth,n.quad,n.h,n.v])e.dispose()},[n]);let a=t=>{let{quad:r,h:i,v:a,target:o,blurTarget:s}=n;r.material=i,i.uniforms.tDiffuse.value=o.texture,i.uniforms.h.value=t/D[0],e.setRenderTarget(s),r.render(e),r.material=a,a.uniforms.tDiffuse.value=s.texture,a.uniforms.v.value=t/D[1],e.setRenderTarget(o),r.render(e)},c=(0,S.useRef)(-1/0);return o(()=>{let r=performance.now();if(r-c.current<O)return;c.current=r;let{hidden:i,target:o,camera:s,depth:l}=n;t.traverse(e=>{e.visible&&N(e)&&(e.visible=!1,i.push(e))});let d=t.background,f=t.overrideMaterial,p=e.shadowMap.autoUpdate,m=e.getRenderTarget(),h=e.autoClear,g=e.getClearAlpha(),_=e.getClearColor(new u);t.background=null,t.overrideMaterial=l,e.shadowMap.autoUpdate=!1;try{e.setRenderTarget(o),e.setClearColor(0,0),e.clear(!0,!0,!1),e.autoClear=!1,e.render(t,s),a(3),a(1.2)}finally{for(let e of i)e.visible=!0;i.length=0,t.background=d,t.overrideMaterial=f,e.shadowMap.autoUpdate=p,e.autoClear=h,e.setClearColor(_,g),e.setRenderTarget(m)}}),(0,T.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,.008,0],raycast:j,userData:{contactShadow:!0},renderOrder:-1,children:[(0,T.jsx)(`planeGeometry`,{args:[32,24]}),(0,T.jsx)(`meshBasicMaterial`,{map:n.target.texture,transparent:!0,opacity:k,depthWrite:!1,toneMapped:!1,fog:!1})]})}function F(){let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`),n=t.createRadialGradient(32,32,0,32,32,32);return n.addColorStop(0,`rgba(0,0,0,0.38)`),n.addColorStop(.55,`rgba(0,0,0,0.2)`),n.addColorStop(1,`rgba(0,0,0,0)`),t.fillStyle=n,t.fillRect(0,0,64,64),new a(e)}function I(){let e=(0,S.useRef)(null),t=(0,S.useMemo)(()=>({geometry:new c(1,1).rotateX(-Math.PI/2),material:new d({map:F(),transparent:!0,depthWrite:!1,toneMapped:!1,fog:!1}),m:new l}),[]);return(0,S.useEffect)(()=>()=>{t.geometry.dispose(),t.material.map?.dispose(),t.material.dispose()},[t]),o(()=>{let n=e.current;if(!n)return;let r=0;for(let e of _().values()){if(r>=A)break;let i=.62+.2*e.sit;t.m.makeScale(i,1,i).setPosition(e.x,.009,e.z),n.setMatrixAt(r++,t.m)}n.count=r,n.instanceMatrix.needsUpdate=!0}),(0,T.jsx)(`instancedMesh`,{ref:e,args:[t.geometry,t.material,A],frustumCulled:!1,raycast:j,userData:{contactShadow:!0}})}function L(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(P,{}),(0,T.jsx)(I,{})]})}var R=new Map,z=null,B,V=4e3,H=6e4;function U(e,t,n,r){clearTimeout(B),z??={autoClear:e.autoClear,autoReset:e.info.autoReset};let i=R.get(r);if(i&&i.scene===t&&i.camera===n)return i.pipe;i?.pipe.drop();let a=m(e,t,n,r);return R.set(r,{scene:t,camera:n,pipe:a}),a}function W(e){z&&=(e.autoClear=z.autoClear,e.info.autoReset=z.autoReset,null),e.setRenderTarget(null),clearTimeout(B),B=setTimeout(()=>{for(let e of R.values())e.pipe.drop();R.clear()},H)}function G({tier:e}){let t=s(e=>e.gl),n=s(e=>e.scene),r=s(e=>e.camera),i=s(e=>e.size),a=s(e=>e.viewport.dpr),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(!1),d=(0,S.useRef)({at:0,done:!1});return(0,S.useLayoutEffect)(()=>{let i=U(t,n,r,e);return u.current=!1,l(i),()=>{b(null),y(`low`)}},[t,n,r,e]),(0,S.useEffect)(()=>()=>W(t),[t]),(0,S.useLayoutEffect)(()=>c?.setSize(i.width,i.height),[c,i,a]),(0,S.useEffect)(()=>{if(!c)return;let e=setInterval(()=>b(c.stats()),1e3);return()=>clearInterval(e)},[c]),o((a,o)=>{if(!v()){if(!c)t.render(n,r);else{try{let a=d.current;if(!a.done&&a.at&&performance.now()>=a.at){a.done=!0;let s=e===`high`?`medium`:`high`;if(!R.has(s)){let e=performance.now(),a=U(t,n,r,s);a.setSize(i.width,i.height),a.render(o),g(`warmup`,`${s} effects built in ${Math.round(performance.now()-e)} ms`)}}c.render(o)}catch(e){x(`they stopped with an error`,e),t.render(n,r);return}u.current||(u.current=!0,d.current.at||(d.current.at=performance.now()+V),b(c.stats()),y(e))}}},1),e===`high`?(0,T.jsx)(L,{}):null}export{G as default};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{C as r,O as i,P as a,S as o,Tt as s,et as c,f as l,g as u,i as d,mt as f}from"./bloomMarks-CWsszTY1.js";import{i as p,r as m}from"./Office-fRdJ34l-.js";import{a as h}from"./director-CrzFgnoP.js";import{n as g,o as _}from"./kit-iArIGJf-.js";var v=e(t(),1),y=n(),b=2400,x=-6,S=[`position`,`aVel`,`aColor`,`aTime`,`aSize`],C=[`#ff595e`,`#ffca3a`,`#8ac926`,`#1982c4`,`#ff70a6`,`#ffffff`,`#c77dff`,`#4cc9f0`],w=`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{C as r,I as i,Ot as a,_t as o,f as s,g as c,i as l,k as u,rt as d,w as f}from"./bloomMarks-C54fx8hS.js";import{i as p,r as m}from"./Office-Dmaf62nb.js";import{a as h}from"./director-CrzFgnoP.js";import{n as g,o as _}from"./kit-0ivWfN5y.js";var v=e(t(),1),y=n(),b=2400,x=-6,S=[`position`,`aVel`,`aColor`,`aTime`,`aSize`],C=[`#ff595e`,`#ffca3a`,`#8ac926`,`#1982c4`,`#ff70a6`,`#ffffff`,`#c77dff`,`#4cc9f0`],w=`
2
2
  attribute vec3 aVel;
3
3
  attribute vec3 aColor;
4
4
  attribute vec2 aTime; // start, life
@@ -30,4 +30,4 @@ void main() {
30
30
  float r = length(gl_PointCoord - 0.5);
31
31
  float a = (1.0 - smoothstep(0.1, 0.5, r)) * vFade;
32
32
  gl_FragColor = vec4(vColor * (1.0 + (1.0 - smoothstep(0.0, 0.2, r))), a);
33
- }`;function E({run:e,elevation:t}){let n=u(e=>e.gl),E=_(e.side),D=(0,v.useMemo)(()=>{let n=h(e.seed),c=[],l=(e,r=!1)=>{let a=n()<.2?`willow`:n()<.35?`ring`:`sphere`,o=C[Math.floor(n()*C.length)];c.push({at:e,x:E*(140+n()*90),y:g(t)+22+n()*30,z:(n()-.5)*260,shape:a,color:new i(a===`willow`?`#ffcf6b`:o),color2:new i(n()<.4?C[Math.floor(n()*C.length)]:o),sparks:r?140:70+Math.floor(n()*50),done:!1})};for(let t=2;t<e.seconds-12;t+=.9+n()*1.3)l(t);for(let t=0;t<9;t++)l(e.seconds-11+t*.35+n()*.2,!0);c.sort((e,t)=>e.at-t.at);let u=new r,p=e=>new o(new Float32Array(b*e),e).setUsage(a);u.setAttribute(`position`,p(3)),u.setAttribute(`aVel`,p(3)),u.setAttribute(`aColor`,p(3)),u.setAttribute(`aTime`,p(2)),u.setAttribute(`aSize`,p(1)),u.attributes.aTime.array.fill(-1e3);let m=d(new s({vertexShader:w,fragmentShader:T,transparent:!0,depthWrite:!1,blending:2,uniforms:{uTime:{value:0},uScale:{value:400}}})),_=new f(u,m);return _.frustumCulled=!1,_.renderOrder=5,{launches:c,geo:u,mat:m,points:_,next:0,slot:0,rnd:h(e.seed+1)}},[e.seed,e.seconds,E,t]);(0,v.useEffect)(()=>()=>{D.geo.dispose(),D.mat.dispose()},[D]);let O=(e,t,n,r,i,a,o,s,c,l)=>{let u=D.slot;D.slot=(D.slot+1)%b;let d=D.geo.attributes,f=d.position.array,p=d.aVel.array,m=d.aColor.array,h=d.aTime.array;f[u*3]=e,f[u*3+1]=t,f[u*3+2]=n,p[u*3]=r,p[u*3+1]=i,p[u*3+2]=a,m[u*3]=o.r,m[u*3+1]=o.g,m[u*3+2]=o.b,h[u*2]=s,h[u*2+1]=c,d.aSize.array[u]=l};return l(({camera:r})=>{let i=e.t,a=r;D.mat.uniforms.uTime.value=i,D.mat.uniforms.uScale.value=n.domElement.height*.5/Math.tan(c.degToRad(a.fov/2));let o=!1;for(;D.next<D.launches.length&&D.launches[D.next].at<=i;){let e=D.launches[D.next++],n=1.5+D.rnd()*.4,i=e.at+n,a=(e.y-.5*x*n*n)/((1-Math.exp(-1.6*n))/1.6);for(let t=0;t<6;t++)O(e.x,0,e.z,0,a,0,e.color,e.at+t*.04,n-t*.04,t?.9:1.6);let s=D.rnd;for(let t=0;t<e.sparks;t++){let n,r,a;if(e.shape===`ring`){let i=t/e.sparks*Math.PI*2;n=Math.cos(i)*.25,r=Math.cos(i)*.9,a=Math.sin(i)}else{let e=s()*2-1,t=s()*Math.PI*2,i=Math.sqrt(1-e*e);n=Math.cos(t)*i,r=e,a=Math.sin(t)*i}let o=e.shape===`willow`?14:25+s()*6;O(e.x,e.y,e.z,n*o,r*o+(e.shape===`willow`?3:0),a*o,t%2?e.color2:e.color,i,e.shape===`willow`?3.6:2+s()*.6,e.shape===`willow`?2.4:3.2)}o=!0;let c=m(e.x,e.y-t,e.z,220);p(`launch`,{gain:c.gain,pan:c.pan,pitch:.85+D.rnd()*.3});let l=Math.hypot(e.x-r.position.x,e.y-t-r.position.y,e.z-r.position.z)/343;p(`boom`,{gain:c.gain,pan:c.pan,delay:n+l}),e.shape!==`ring`&&p(`crackle`,{gain:c.gain*.8,pan:c.pan,delay:n+l+.5})}if(o)for(let e of S)D.geo.attributes[e].needsUpdate=!0}),(0,y.jsx)(`primitive`,{object:D.points})}export{E as default};
33
+ }`;function E({run:e,elevation:t}){let n=c(e=>e.gl),E=_(e.side),D=(0,v.useMemo)(()=>{let n=h(e.seed),s=[],c=(e,r=!1)=>{let i=n()<.2?`willow`:n()<.35?`ring`:`sphere`,a=C[Math.floor(n()*C.length)];s.push({at:e,x:E*(140+n()*90),y:g(t)+22+n()*30,z:(n()-.5)*260,shape:i,color:new u(i===`willow`?`#ffcf6b`:a),color2:new u(n()<.4?C[Math.floor(n()*C.length)]:a),sparks:r?140:70+Math.floor(n()*50),done:!1})};for(let t=2;t<e.seconds-12;t+=.9+n()*1.3)c(t);for(let t=0;t<9;t++)c(e.seconds-11+t*.35+n()*.2,!0);s.sort((e,t)=>e.at-t.at);let d=new f,p=e=>new r(new Float32Array(b*e),e).setUsage(i);d.setAttribute(`position`,p(3)),d.setAttribute(`aVel`,p(3)),d.setAttribute(`aColor`,p(3)),d.setAttribute(`aTime`,p(2)),d.setAttribute(`aSize`,p(1)),d.attributes.aTime.array.fill(-1e3);let m=l(new a({vertexShader:w,fragmentShader:T,transparent:!0,depthWrite:!1,blending:2,uniforms:{uTime:{value:0},uScale:{value:400}}})),_=new o(d,m);return _.frustumCulled=!1,_.renderOrder=5,{launches:s,geo:d,mat:m,points:_,next:0,slot:0,rnd:h(e.seed+1)}},[e.seed,e.seconds,E,t]);(0,v.useEffect)(()=>()=>{D.geo.dispose(),D.mat.dispose()},[D]);let O=(e,t,n,r,i,a,o,s,c,l)=>{let u=D.slot;D.slot=(D.slot+1)%b;let d=D.geo.attributes,f=d.position.array,p=d.aVel.array,m=d.aColor.array,h=d.aTime.array;f[u*3]=e,f[u*3+1]=t,f[u*3+2]=n,p[u*3]=r,p[u*3+1]=i,p[u*3+2]=a,m[u*3]=o.r,m[u*3+1]=o.g,m[u*3+2]=o.b,h[u*2]=s,h[u*2+1]=c,d.aSize.array[u]=l};return s(({camera:r})=>{let i=e.t,a=r;D.mat.uniforms.uTime.value=i,D.mat.uniforms.uScale.value=n.domElement.height*.5/Math.tan(d.degToRad(a.fov/2));let o=!1;for(;D.next<D.launches.length&&D.launches[D.next].at<=i;){let e=D.launches[D.next++],n=1.5+D.rnd()*.4,i=e.at+n,a=(e.y-.5*x*n*n)/((1-Math.exp(-1.6*n))/1.6);for(let t=0;t<6;t++)O(e.x,0,e.z,0,a,0,e.color,e.at+t*.04,n-t*.04,t?.9:1.6);let s=D.rnd;for(let t=0;t<e.sparks;t++){let n,r,a;if(e.shape===`ring`){let i=t/e.sparks*Math.PI*2;n=Math.cos(i)*.25,r=Math.cos(i)*.9,a=Math.sin(i)}else{let e=s()*2-1,t=s()*Math.PI*2,i=Math.sqrt(1-e*e);n=Math.cos(t)*i,r=e,a=Math.sin(t)*i}let o=e.shape===`willow`?14:25+s()*6;O(e.x,e.y,e.z,n*o,r*o+(e.shape===`willow`?3:0),a*o,t%2?e.color2:e.color,i,e.shape===`willow`?3.6:2+s()*.6,e.shape===`willow`?2.4:3.2)}o=!0;let c=m(e.x,e.y-t,e.z,220);p(`launch`,{gain:c.gain,pan:c.pan,pitch:.85+D.rnd()*.3});let l=Math.hypot(e.x-r.position.x,e.y-t-r.position.y,e.z-r.position.z)/343;p(`boom`,{gain:c.gain,pan:c.pan,delay:n+l}),e.shape!==`ring`&&p(`crackle`,{gain:c.gain*.8,pan:c.pan,delay:n+l+.5})}if(o)for(let e of S)D.geo.attributes[e].needsUpdate=!0}),(0,y.jsx)(`primitive`,{object:D.points})}export{E as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Bt as r,f as i}from"./bloomMarks-CWsszTY1.js";import{Va as a,Vo as o,p as s}from"./store-D1ymxjG0.js";import{n as c,r as l}from"./Office-fRdJ34l-.js";import{a as u}from"./director-CrzFgnoP.js";import{a as d,c as f,i as p,l as m,n as h,o as g,s as _}from"./kit-iArIGJf-.js";var v=e(t(),1),y=n(),b=8,x=19,S={approach:20,over:27,down:31,lift:42,up:46},C=1.62*1.6;function w({run:e,elevation:t}){let n=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(null),E=g(e.side),D=(0,v.useMemo)(()=>{let n=u(e.seed),i=s.getState(),c=i.repos.reduce((e,t)=>Math.max(e,t.floor),0),l=i.floor===-1||n()<.5,d={x:a.x,y:o(c)+C,z:a.z};return{cx:E*(85+n()*20),cz:(n()-.5)*40,radius:42+n()*10,y:h(t)+9+n()*8,dir:n()<.5?1:-1,phase:n()*Math.PI*2,far:{x:E*420,z:(n()-.5)*500},land:l,pad:d,from:new r,fromSet:!1,heading:0}},[e.seed,E,t]),O=(0,v.useMemo)(()=>({rotor:null,prev:new r,first:!0,spin:0}),[]);(0,v.useEffect)(()=>(O.rotor=c(`rotor`),()=>O.rotor?.stop(1)),[O]),i((r,i)=>{let a=e.t,o=n.current;if(!o)return;let s=D.phase+D.dir*(a*Math.PI*2)/x,c=D.cx+Math.cos(s)*D.radius,u=D.cz+Math.sin(s)*D.radius,m=D.y,h=_(a/b),g=_((a-(e.seconds-b))/b);c=d(D.far.x,c,h),u=d(-D.far.z,u,h),m+=(1-h)*40;let v=0;if(D.land&&a>=S.approach&&a<e.seconds-b){D.fromSet||D.from.set(c,m,u),D.fromSet=!0;let e=D.pad.y+14,t=f(a,S.approach,S.over);c=d(D.from.x,D.pad.x,t),u=d(D.from.z,D.pad.z,t),m=d(D.from.y,e,t),m=d(m,D.pad.y,f(a,S.over,S.down)-f(a,S.lift,S.up)),v=f(a,S.down-.5,S.down)*(1-f(a,S.lift,S.lift+1))}D.land&&a>=e.seconds-b&&(c=D.pad.x,u=D.pad.z,m=D.pad.y+14),c=d(c,D.far.x,g),u=d(u,D.far.z,g),m+=g*40,O.first&&O.prev.set(c,m,u),O.first=!1;let y=c-O.prev.x,C=u-O.prev.z;y*y+C*C>1e-5&&(D.heading=Math.atan2(y,C)),o.rotation.y=D.heading;let E=D.land?1-f(a,S.approach,S.approach+3)+f(a,e.seconds-b,e.seconds-b+2):1;o.rotation.z=-D.dir*.22*h*(1-g)*Math.min(1,E),o.rotation.x=.12*(1-v),o.position.set(c,m,u),O.prev.set(c,m,u),O.spin+=Math.min(i,.1)*(31-22*v),w.current&&(w.current.rotation.y=O.spin),T.current&&(T.current.rotation.x=O.spin*1.3);let k=l(c,m-t,u,60);O.rotor?.set(k.gain*p(a,e.seconds,2)*(1-.6*v),k.pan,1-.35*v)});let k=m(`#d62828`),A=m(`#2b2d42`);return(0,y.jsxs)(`group`,{ref:n,scale:1.6,children:[(0,y.jsx)(`mesh`,{material:k,scale:[1,.95,1.5],children:(0,y.jsx)(`sphereGeometry`,{args:[1.6,14,10]})}),(0,y.jsx)(`mesh`,{material:m(`#8ecae6`),position:[0,.35,1.25],scale:[1,.7,.8],children:(0,y.jsx)(`sphereGeometry`,{args:[1.05,12,8]})}),(0,y.jsx)(`mesh`,{material:k,position:[0,.3,-3.2],"rotation-x":Math.PI/2,children:(0,y.jsx)(`cylinderGeometry`,{args:[.28,.45,4.2,8]})}),(0,y.jsx)(`mesh`,{material:m(`#f1faee`),position:[0,1,-5.1],children:(0,y.jsx)(`boxGeometry`,{args:[.15,1.4,.9]})}),(0,y.jsx)(`mesh`,{ref:T,material:A,position:[.2,.9,-5.2],children:(0,y.jsx)(`boxGeometry`,{args:[.05,1.6,.18]})}),[-.9,.9].map(e=>(0,y.jsx)(`mesh`,{material:A,position:[e,-1.55,0],children:(0,y.jsx)(`boxGeometry`,{args:[.12,.12,3.4]})},e)),(0,y.jsx)(`mesh`,{material:A,position:[0,1.55,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.18,.18,.5,8]})}),(0,y.jsxs)(`group`,{ref:w,position:[0,1.85,0],children:[(0,y.jsx)(`mesh`,{material:A,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})}),(0,y.jsx)(`mesh`,{material:A,"rotation-y":Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})})]})]})}export{w as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Ut as r,f as i}from"./bloomMarks-C54fx8hS.js";import{Va as a,Vo as o,p as s}from"./store-D17hJxYS.js";import{n as c,r as l}from"./Office-Dmaf62nb.js";import{a as u}from"./director-CrzFgnoP.js";import{a as d,c as f,i as p,l as m,n as h,o as g,s as _}from"./kit-0ivWfN5y.js";var v=e(t(),1),y=n(),b=8,x=19,S={approach:20,over:27,down:31,lift:42,up:46},C=1.62*1.6;function w({run:e,elevation:t}){let n=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(null),E=g(e.side),D=(0,v.useMemo)(()=>{let n=u(e.seed),i=s.getState(),c=i.repos.reduce((e,t)=>Math.max(e,t.floor),0),l=i.floor===-1||n()<.5,d={x:a.x,y:o(c)+C,z:a.z};return{cx:E*(85+n()*20),cz:(n()-.5)*40,radius:42+n()*10,y:h(t)+9+n()*8,dir:n()<.5?1:-1,phase:n()*Math.PI*2,far:{x:E*420,z:(n()-.5)*500},land:l,pad:d,from:new r,fromSet:!1,heading:0}},[e.seed,E,t]),O=(0,v.useMemo)(()=>({rotor:null,prev:new r,first:!0,spin:0}),[]);(0,v.useEffect)(()=>(O.rotor=c(`rotor`),()=>O.rotor?.stop(1)),[O]),i((r,i)=>{let a=e.t,o=n.current;if(!o)return;let s=D.phase+D.dir*(a*Math.PI*2)/x,c=D.cx+Math.cos(s)*D.radius,u=D.cz+Math.sin(s)*D.radius,m=D.y,h=_(a/b),g=_((a-(e.seconds-b))/b);c=d(D.far.x,c,h),u=d(-D.far.z,u,h),m+=(1-h)*40;let v=0;if(D.land&&a>=S.approach&&a<e.seconds-b){D.fromSet||D.from.set(c,m,u),D.fromSet=!0;let e=D.pad.y+14,t=f(a,S.approach,S.over);c=d(D.from.x,D.pad.x,t),u=d(D.from.z,D.pad.z,t),m=d(D.from.y,e,t),m=d(m,D.pad.y,f(a,S.over,S.down)-f(a,S.lift,S.up)),v=f(a,S.down-.5,S.down)*(1-f(a,S.lift,S.lift+1))}D.land&&a>=e.seconds-b&&(c=D.pad.x,u=D.pad.z,m=D.pad.y+14),c=d(c,D.far.x,g),u=d(u,D.far.z,g),m+=g*40,O.first&&O.prev.set(c,m,u),O.first=!1;let y=c-O.prev.x,C=u-O.prev.z;y*y+C*C>1e-5&&(D.heading=Math.atan2(y,C)),o.rotation.y=D.heading;let E=D.land?1-f(a,S.approach,S.approach+3)+f(a,e.seconds-b,e.seconds-b+2):1;o.rotation.z=-D.dir*.22*h*(1-g)*Math.min(1,E),o.rotation.x=.12*(1-v),o.position.set(c,m,u),O.prev.set(c,m,u),O.spin+=Math.min(i,.1)*(31-22*v),w.current&&(w.current.rotation.y=O.spin),T.current&&(T.current.rotation.x=O.spin*1.3);let k=l(c,m-t,u,60);O.rotor?.set(k.gain*p(a,e.seconds,2)*(1-.6*v),k.pan,1-.35*v)});let k=m(`#d62828`),A=m(`#2b2d42`);return(0,y.jsxs)(`group`,{ref:n,scale:1.6,children:[(0,y.jsx)(`mesh`,{material:k,scale:[1,.95,1.5],children:(0,y.jsx)(`sphereGeometry`,{args:[1.6,14,10]})}),(0,y.jsx)(`mesh`,{material:m(`#8ecae6`),position:[0,.35,1.25],scale:[1,.7,.8],children:(0,y.jsx)(`sphereGeometry`,{args:[1.05,12,8]})}),(0,y.jsx)(`mesh`,{material:k,position:[0,.3,-3.2],"rotation-x":Math.PI/2,children:(0,y.jsx)(`cylinderGeometry`,{args:[.28,.45,4.2,8]})}),(0,y.jsx)(`mesh`,{material:m(`#f1faee`),position:[0,1,-5.1],children:(0,y.jsx)(`boxGeometry`,{args:[.15,1.4,.9]})}),(0,y.jsx)(`mesh`,{ref:T,material:A,position:[.2,.9,-5.2],children:(0,y.jsx)(`boxGeometry`,{args:[.05,1.6,.18]})}),[-.9,.9].map(e=>(0,y.jsx)(`mesh`,{material:A,position:[e,-1.55,0],children:(0,y.jsx)(`boxGeometry`,{args:[.12,.12,3.4]})},e)),(0,y.jsx)(`mesh`,{material:A,position:[0,1.55,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.18,.18,.5,8]})}),(0,y.jsxs)(`group`,{ref:w,position:[0,1.85,0],children:[(0,y.jsx)(`mesh`,{material:A,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})}),(0,y.jsx)(`mesh`,{material:A,"rotation-y":Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})})]})]})}export{w as default};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Bt as r,D as i,O as a,Tt as o,f as s,nt as c}from"./bloomMarks-CWsszTY1.js";import{n as l,r as u}from"./Office-fRdJ34l-.js";import{n as d}from"./weatherState-BGsd5Mzz.js";import{a as f}from"./director-CrzFgnoP.js";import{i as p,o as m}from"./kit-iArIGJf-.js";var h=e(t(),1),g=n(),_=`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{O as r,Ot as i,Ut as a,at as o,f as s,k as c}from"./bloomMarks-C54fx8hS.js";import{n as l,r as u}from"./Office-Dmaf62nb.js";import{n as d}from"./weatherState-DighRn7p.js";import{a as f}from"./director-CrzFgnoP.js";import{i as p,o as m}from"./kit-0ivWfN5y.js";var h=e(t(),1),g=n(),_=`
2
2
  varying vec2 vP;
3
3
  void main() {
4
4
  vP = position.xy;
@@ -30,4 +30,4 @@ void main() {
30
30
  vec3 col = mix(uShade, uLit, cloud * 0.7 + 0.3 * smoothstep(0.2, 0.9, r));
31
31
  gl_FragColor = vec4(col, alpha);
32
32
  #include <colorspace_fragment>
33
- }`,y=new a(`#eef1f6`),b=new a(`#7d8794`),x=22,S={kind:`heavy-rain`,wind:1};function C({run:e}){let t=m(e.side),n=(0,h.useMemo)(()=>{let n=f(e.seed),a=new i(230,96),s=new o({vertexShader:_,fragmentShader:v,transparent:!0,depthWrite:!1,side:2,uniforms:{uTime:{value:0},uFade:{value:0},uRadius:{value:230},uLit:{value:y.clone()},uShade:{value:b.clone()}}}),l=new c(a,s);return l.position.set(t*(320+n()*30),140,(n()-.5)*120),l.rotation.set(-Math.PI/2,0,0),l.rotateOnWorldAxis(new r(0,0,1),t*.95),l.renderOrder=1,l.frustumCulled=!1,{geo:a,mat:s,mesh:l}},[e.seed,t]),a=(0,h.useMemo)(()=>({gale:null}),[]);return(0,h.useEffect)(()=>(a.gale=l(`gale`),()=>{d(null),a.gale?.stop(2),n.geo.dispose(),n.mat.dispose()}),[n,a]),s(()=>{let t=e.t;n.mat.uniforms.uTime.value=t,n.mat.uniforms.uFade.value=p(t,e.seconds,15),d(t<e.seconds-x?S:null);let r=u(n.mesh.position.x,0,n.mesh.position.z,300);a.gale?.set(Math.max(.4,r.gain)*p(t,e.seconds,10),r.pan*.5)}),(0,g.jsx)(`primitive`,{object:n.mesh})}export{C as default};
33
+ }`,y=new c(`#eef1f6`),b=new c(`#7d8794`),x=22,S={kind:`heavy-rain`,wind:1};function C({run:e}){let t=m(e.side),n=(0,h.useMemo)(()=>{let n=f(e.seed),s=new r(230,96),c=new i({vertexShader:_,fragmentShader:v,transparent:!0,depthWrite:!1,side:2,uniforms:{uTime:{value:0},uFade:{value:0},uRadius:{value:230},uLit:{value:y.clone()},uShade:{value:b.clone()}}}),l=new o(s,c);return l.position.set(t*(320+n()*30),140,(n()-.5)*120),l.rotation.set(-Math.PI/2,0,0),l.rotateOnWorldAxis(new a(0,0,1),t*.95),l.renderOrder=1,l.frustumCulled=!1,{geo:s,mat:c,mesh:l}},[e.seed,t]),c=(0,h.useMemo)(()=>({gale:null}),[]);return(0,h.useEffect)(()=>(c.gale=l(`gale`),()=>{d(null),c.gale?.stop(2),n.geo.dispose(),n.mat.dispose()}),[n,c]),s(()=>{let t=e.t;n.mat.uniforms.uTime.value=t,n.mat.uniforms.uFade.value=p(t,e.seconds,15),d(t<e.seconds-x?S:null);let r=u(n.mesh.position.x,0,n.mesh.position.z,300);c.gale?.set(Math.max(.4,r.gain)*p(t,e.seconds,10),r.pan*.5)}),(0,g.jsx)(`primitive`,{object:n.mesh})}export{C as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{f as r}from"./bloomMarks-CWsszTY1.js";import{v as i,y as a}from"./index-BoDJkaEF.js";import{dn as o,i as s,r as c,un as l}from"./Office-fRdJ34l-.js";import{Lo as u}from"./store-D1ymxjG0.js";import{o as d}from"./cityLayout-1I0cF38a.js";import{n as f}from"./billboardLayout-DSKGXPIM.js";import{a as p}from"./director-CrzFgnoP.js";import{c as m,l as h,o as g,t as _}from"./kit-iArIGJf-.js";var v=e(t(),1),y=n(),b=70,x=1.15,S=4.6,C=[9,33,62],w=2.6,T=9e4;function E({run:e,elevation:t}){let n=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(null),O=(0,v.useRef)([]),k=(0,v.useRef)([]),A=(0,v.useRef)(null),j=(0,v.useRef)(null),M=g(e.side),N=(0,v.useMemo)(()=>{let t=p(e.seed),n=t()<.5?1:-1,r=l().map((e,t)=>({...e,i:t})).filter(e=>M*e.x>f.max+10&&M*e.x<260&&Math.abs(e.z)<160),i=e=>Math.abs(M*e.x-175)+Math.abs(e.z)*.8;r.sort((e,t)=>i(e)-i(t));let a=r[0]??null,o=a?d():null,s=a&&o?o.cylinders[a.cylinder]:null;return{dir:n,x:a?a.x+M*19:M*190,z0:(a?a.z:(t()-.5)*60)-n*S*40,tower:a,tankR:s?s.w/2:1.5}},[e.seed,M]),P=(0,v.useMemo)(()=>({shake:0,lastStep:-1,roared:-1,knocked:-1,crashed:!1}),[]);(0,v.useEffect)(()=>{let e=N.tower;return()=>{e&&P.knocked>=0?setTimeout(()=>o(e.i,!1),T):e&&o(e.i,!1)}},[N,P]),r(({camera:r},l)=>{let d=e.t,f=n.current;if(!f)return;let p=N.z0+N.dir*S*d,h=d/x*Math.PI,g=0,v=-1;for(let e=0;e<C.length;e++)g=Math.max(g,m(d,C[e],C[e]+.4)*(1-m(d,C[e]+w-.5,C[e]+w))),d>=C[e]&&d<C[e]+.5&&(v=e);let y=1-g*.8;f.position.set(N.x,Math.abs(Math.sin(h))*.7*y,p),f.rotation.set(0,(N.dir>0?0:Math.PI)-M*N.dir*.35,Math.sin(h)*.04*y);for(let e=0;e<2;e++){let t=O.current[e];t&&(t.rotation.x=Math.sin(h+e*Math.PI)*.45*y);let n=k.current[e];n&&(n.rotation.x=-.6-g*1.2+Math.sin(h*2+e)*.15)}A.current&&(A.current.rotation.y=Math.sin(h*.5)*.35);let T=E.current;if(T){let e=N.tower&&P.knocked>=0?m(d,P.knocked+.6,P.knocked+1.4)*(1-m(d,P.knocked+4,P.knocked+5)):0;T.rotation.set(-g*.55+e*.15,-M*N.dir*.3+Math.sin(d*.4)*.25+e*-M*N.dir*.6,e*.25)}D.current&&(D.current.scale.y=.25+g*1.6);let F=Math.floor(d/x);if(F!==P.lastStep&&y>.5){P.lastStep=F;let e=c(N.x,-t,p,200);s(`stomp`,{gain:e.gain,pan:e.pan,pitch:.9+Math.random()*.2}),P.shake=1}if(v>=0&&P.roared!==v){P.roared=v;let e=c(N.x,b*.9-t,p,200);s(`roar`,{gain:e.gain,pan:e.pan})}P.shake*=Math.exp(-6*Math.min(.1,l)),P.shake>.01&&i().cameraShake&&!a()&&u(r.position.x)&&(r.rotation.x+=P.shake*.0035*Math.sin(d*41),r.rotation.z+=P.shake*.0025*Math.sin(d*33));let I=N.tower,L=j.current;if(I&&L&&(P.knocked<0&&N.dir*(p-I.z)>-7&&(P.knocked=d,o(I.i,!0)),L.visible=P.knocked>=0,P.knocked>=0)){let e=_((d-P.knocked)/1.3);if(L.rotation.z=M*Math.PI*.5*e*e-(e>=1?M*.06*Math.sin((d-P.knocked-1.3)*12)*Math.exp(-(d-P.knocked-1.3)*4):0),e>=1&&!P.crashed){P.crashed=!0;let e=c(I.x,I.y-t,I.z,180);s(`crash`,{gain:e.gain,pan:e.pan})}}});let F=h(`#6abf69`),I=h(`#f6e7a1`),L=h(`#ff9f1c`),R=h(`#1f1d2b`),z=h(`#ffffff`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`group`,{ref:n,children:(0,y.jsxs)(`group`,{scale:b,children:[(0,y.jsx)(`mesh`,{material:F,position:[0,.5,0],scale:[1,1.25,1.1],children:(0,y.jsx)(`sphereGeometry`,{args:[.28,20,14]})}),(0,y.jsx)(`mesh`,{material:I,position:[0,.47,.13],scale:[.85,1.15,.7],children:(0,y.jsx)(`sphereGeometry`,{args:[.22,16,12]})}),[0,1].map(e=>(0,y.jsxs)(`group`,{ref:t=>void(O.current[e]=t),position:[e?.13:-.13,.3,0],children:[(0,y.jsx)(`mesh`,{material:F,position:[0,-.14,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.085,.1,.3,10]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.29,.04],scale:[1,.5,1.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.1,10,8]})})]},e)),[0,1].map(e=>(0,y.jsx)(`group`,{ref:t=>void(k.current[e]=t),position:[e?.22:-.22,.64,.1],children:(0,y.jsx)(`mesh`,{material:F,position:[0,-.05,.06],"rotation-x":.6,children:(0,y.jsx)(`capsuleGeometry`,{args:[.035,.1,4,8]})})},e)),(0,y.jsx)(`group`,{ref:A,position:[0,.36,-.24],children:[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:F,position:[0,-e*.05,-.1-e*.12],scale:1-e*.2,children:(0,y.jsx)(`sphereGeometry`,{args:[.12,12,8]})},e))}),[0,1,2,3,4].map(e=>(0,y.jsx)(`mesh`,{material:L,position:[0,.84-e*.12,-.1-e*.06],"rotation-x":-.5-e*.12,scale:1-e*.12,children:(0,y.jsx)(`coneGeometry`,{args:[.05,.12,6]})},e)),(0,y.jsxs)(`group`,{ref:E,position:[0,.86,.1],children:[(0,y.jsx)(`mesh`,{material:F,children:(0,y.jsx)(`sphereGeometry`,{args:[.17,18,14]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.04,.15],scale:[1,.72,1.15],children:(0,y.jsx)(`sphereGeometry`,{args:[.11,14,10]})}),[-1,1].map(e=>(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`mesh`,{material:z,position:[e*.075,.06,.12],children:(0,y.jsx)(`sphereGeometry`,{args:[.055,12,10]})}),(0,y.jsx)(`mesh`,{material:R,position:[e*.075,.065,.168],children:(0,y.jsx)(`sphereGeometry`,{args:[.027,10,8]})}),(0,y.jsx)(`mesh`,{material:h(`#ff8fab`),position:[e*.11,-.03,.12],scale:[1,.6,.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.03,8,6]})})]},e)),(0,y.jsx)(`mesh`,{ref:D,material:h(`#7a1f3d`),position:[0,-.08,.255],scale:[1,.25,.5],children:(0,y.jsx)(`sphereGeometry`,{args:[.06,12,8]})})]})]})}),N.tower&&(0,y.jsx)(`group`,{ref:j,position:[N.tower.x-M*N.tankR,N.tower.y,N.tower.z],visible:!1,children:(0,y.jsxs)(`group`,{position:[M*N.tankR,0,0],children:[(0,y.jsx)(`mesh`,{material:h(`#5e4a3c`),position:[0,.8,0],children:(0,y.jsx)(`boxGeometry`,{args:[2.6,1.6,2.6]})}),(0,y.jsx)(`mesh`,{material:h(`#a0704a`),position:[0,3.1,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[1.5,1.5,3,12]})}),(0,y.jsx)(`mesh`,{material:h(`#6b4a33`),position:[0,5.3,0],children:(0,y.jsx)(`coneGeometry`,{args:[1.8,1.4,12]})})]})})]})}export{E as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{f as r}from"./bloomMarks-C54fx8hS.js";import{v as i,y as a}from"./index-Bm599iDL.js";import{dn as o,i as s,r as c,un as l}from"./Office-Dmaf62nb.js";import{Lo as u}from"./store-D17hJxYS.js";import{o as d}from"./cityLayout-Ckx8BPp6.js";import{n as f}from"./billboardLayout-DSKGXPIM.js";import{a as p}from"./director-CrzFgnoP.js";import{c as m,l as h,o as g,t as _}from"./kit-0ivWfN5y.js";var v=e(t(),1),y=n(),b=70,x=1.15,S=4.6,C=[9,33,62],w=2.6,T=9e4;function E({run:e,elevation:t}){let n=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(null),O=(0,v.useRef)([]),k=(0,v.useRef)([]),A=(0,v.useRef)(null),j=(0,v.useRef)(null),M=g(e.side),N=(0,v.useMemo)(()=>{let t=p(e.seed),n=t()<.5?1:-1,r=l().map((e,t)=>({...e,i:t})).filter(e=>M*e.x>f.max+10&&M*e.x<260&&Math.abs(e.z)<160),i=e=>Math.abs(M*e.x-175)+Math.abs(e.z)*.8;r.sort((e,t)=>i(e)-i(t));let a=r[0]??null,o=a?d():null,s=a&&o?o.cylinders[a.cylinder]:null;return{dir:n,x:a?a.x+M*19:M*190,z0:(a?a.z:(t()-.5)*60)-n*S*40,tower:a,tankR:s?s.w/2:1.5}},[e.seed,M]),P=(0,v.useMemo)(()=>({shake:0,lastStep:-1,roared:-1,knocked:-1,crashed:!1}),[]);(0,v.useEffect)(()=>{let e=N.tower;return()=>{e&&P.knocked>=0?setTimeout(()=>o(e.i,!1),T):e&&o(e.i,!1)}},[N,P]),r(({camera:r},l)=>{let d=e.t,f=n.current;if(!f)return;let p=N.z0+N.dir*S*d,h=d/x*Math.PI,g=0,v=-1;for(let e=0;e<C.length;e++)g=Math.max(g,m(d,C[e],C[e]+.4)*(1-m(d,C[e]+w-.5,C[e]+w))),d>=C[e]&&d<C[e]+.5&&(v=e);let y=1-g*.8;f.position.set(N.x,Math.abs(Math.sin(h))*.7*y,p),f.rotation.set(0,(N.dir>0?0:Math.PI)-M*N.dir*.35,Math.sin(h)*.04*y);for(let e=0;e<2;e++){let t=O.current[e];t&&(t.rotation.x=Math.sin(h+e*Math.PI)*.45*y);let n=k.current[e];n&&(n.rotation.x=-.6-g*1.2+Math.sin(h*2+e)*.15)}A.current&&(A.current.rotation.y=Math.sin(h*.5)*.35);let T=E.current;if(T){let e=N.tower&&P.knocked>=0?m(d,P.knocked+.6,P.knocked+1.4)*(1-m(d,P.knocked+4,P.knocked+5)):0;T.rotation.set(-g*.55+e*.15,-M*N.dir*.3+Math.sin(d*.4)*.25+e*-M*N.dir*.6,e*.25)}D.current&&(D.current.scale.y=.25+g*1.6);let F=Math.floor(d/x);if(F!==P.lastStep&&y>.5){P.lastStep=F;let e=c(N.x,-t,p,200);s(`stomp`,{gain:e.gain,pan:e.pan,pitch:.9+Math.random()*.2}),P.shake=1}if(v>=0&&P.roared!==v){P.roared=v;let e=c(N.x,b*.9-t,p,200);s(`roar`,{gain:e.gain,pan:e.pan})}P.shake*=Math.exp(-6*Math.min(.1,l)),P.shake>.01&&i().cameraShake&&!a()&&u(r.position.x)&&(r.rotation.x+=P.shake*.0035*Math.sin(d*41),r.rotation.z+=P.shake*.0025*Math.sin(d*33));let I=N.tower,L=j.current;if(I&&L&&(P.knocked<0&&N.dir*(p-I.z)>-7&&(P.knocked=d,o(I.i,!0)),L.visible=P.knocked>=0,P.knocked>=0)){let e=_((d-P.knocked)/1.3);if(L.rotation.z=M*Math.PI*.5*e*e-(e>=1?M*.06*Math.sin((d-P.knocked-1.3)*12)*Math.exp(-(d-P.knocked-1.3)*4):0),e>=1&&!P.crashed){P.crashed=!0;let e=c(I.x,I.y-t,I.z,180);s(`crash`,{gain:e.gain,pan:e.pan})}}});let F=h(`#6abf69`),I=h(`#f6e7a1`),L=h(`#ff9f1c`),R=h(`#1f1d2b`),z=h(`#ffffff`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`group`,{ref:n,children:(0,y.jsxs)(`group`,{scale:b,children:[(0,y.jsx)(`mesh`,{material:F,position:[0,.5,0],scale:[1,1.25,1.1],children:(0,y.jsx)(`sphereGeometry`,{args:[.28,20,14]})}),(0,y.jsx)(`mesh`,{material:I,position:[0,.47,.13],scale:[.85,1.15,.7],children:(0,y.jsx)(`sphereGeometry`,{args:[.22,16,12]})}),[0,1].map(e=>(0,y.jsxs)(`group`,{ref:t=>void(O.current[e]=t),position:[e?.13:-.13,.3,0],children:[(0,y.jsx)(`mesh`,{material:F,position:[0,-.14,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.085,.1,.3,10]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.29,.04],scale:[1,.5,1.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.1,10,8]})})]},e)),[0,1].map(e=>(0,y.jsx)(`group`,{ref:t=>void(k.current[e]=t),position:[e?.22:-.22,.64,.1],children:(0,y.jsx)(`mesh`,{material:F,position:[0,-.05,.06],"rotation-x":.6,children:(0,y.jsx)(`capsuleGeometry`,{args:[.035,.1,4,8]})})},e)),(0,y.jsx)(`group`,{ref:A,position:[0,.36,-.24],children:[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:F,position:[0,-e*.05,-.1-e*.12],scale:1-e*.2,children:(0,y.jsx)(`sphereGeometry`,{args:[.12,12,8]})},e))}),[0,1,2,3,4].map(e=>(0,y.jsx)(`mesh`,{material:L,position:[0,.84-e*.12,-.1-e*.06],"rotation-x":-.5-e*.12,scale:1-e*.12,children:(0,y.jsx)(`coneGeometry`,{args:[.05,.12,6]})},e)),(0,y.jsxs)(`group`,{ref:E,position:[0,.86,.1],children:[(0,y.jsx)(`mesh`,{material:F,children:(0,y.jsx)(`sphereGeometry`,{args:[.17,18,14]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.04,.15],scale:[1,.72,1.15],children:(0,y.jsx)(`sphereGeometry`,{args:[.11,14,10]})}),[-1,1].map(e=>(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`mesh`,{material:z,position:[e*.075,.06,.12],children:(0,y.jsx)(`sphereGeometry`,{args:[.055,12,10]})}),(0,y.jsx)(`mesh`,{material:R,position:[e*.075,.065,.168],children:(0,y.jsx)(`sphereGeometry`,{args:[.027,10,8]})}),(0,y.jsx)(`mesh`,{material:h(`#ff8fab`),position:[e*.11,-.03,.12],scale:[1,.6,.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.03,8,6]})})]},e)),(0,y.jsx)(`mesh`,{ref:D,material:h(`#7a1f3d`),position:[0,-.08,.255],scale:[1,.25,.5],children:(0,y.jsx)(`sphereGeometry`,{args:[.06,12,8]})})]})]})}),N.tower&&(0,y.jsx)(`group`,{ref:j,position:[N.tower.x-M*N.tankR,N.tower.y,N.tower.z],visible:!1,children:(0,y.jsxs)(`group`,{position:[M*N.tankR,0,0],children:[(0,y.jsx)(`mesh`,{material:h(`#5e4a3c`),position:[0,.8,0],children:(0,y.jsx)(`boxGeometry`,{args:[2.6,1.6,2.6]})}),(0,y.jsx)(`mesh`,{material:h(`#a0704a`),position:[0,3.1,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[1.5,1.5,3,12]})}),(0,y.jsx)(`mesh`,{material:h(`#6b4a33`),position:[0,5.3,0],children:(0,y.jsx)(`coneGeometry`,{args:[1.8,1.4,12]})})]})})]})}export{E as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Bt as r,f as i,gt as a}from"./bloomMarks-CWsszTY1.js";import{i as o,r as s}from"./Office-fRdJ34l-.js";import{a as c}from"./director-CrzFgnoP.js";import{i as l,n as u,o as d,r as f}from"./kit-iArIGJf-.js";var p=e(t(),1),m=n(),h=14,g=new r(0,1,0);function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=d(e.side),v=(0,p.useMemo)(()=>({meteors:Array.from({length:h},()=>({born:-10,life:0,x:0,y:0,z:0,dir:new r,speed:0,size:1})),next:1,rnd:c(e.seed),q:new a,back:new r}),[e.seed]);return i(()=>{let r=e.t,i=v.rnd;for(;r>=v.next&&r<e.seconds-3;){let n=v.meteors.find(e=>r-e.born>e.life),a=.9+2.2*Math.exp(-(((r/e.seconds-.55)/.12)**2));if(v.next+=-Math.log(1-i()*.98)/a*1.4,n&&(n.born=r,n.life=.7+i()*.8,n.x=_*(180+i()*140),n.y=u(t)+50+i()*120,n.z=(i()-.5)*420,n.dir.set(-_*i()*.3,-.35-i()*.35,i()<.5?1:-1).normalize(),n.speed=110+i()*80,n.size=.6+i()*.8,i()<.3)){let i=s(n.x,n.y-t,n.z,200);o(`whoosh`,{gain:i.gain*l(r,e.seconds,4),pan:i.pan})}}let a=n.current?.children;if(a)for(let e=0;e<h;e++){let t=v.meteors[e],n=a[e],i=r-t.born;if(n.visible=i>=0&&i<t.life,!n.visible)continue;let o=i/t.life,s=Math.min(i*t.speed,30+t.size*10)*(1-o*.5),c=t.x+t.dir.x*t.speed*i,l=t.y+t.dir.y*t.speed*i,u=t.z+t.dir.z*t.speed*i;n.position.set(c-t.dir.x*s/2,l-t.dir.y*s/2,u-t.dir.z*s/2),n.quaternion.copy(v.q.setFromUnitVectors(g,v.back.copy(t.dir).negate()));let d=t.size*(1-o*o);n.scale.set(d,Math.max(.01,s),d)}}),(0,m.jsx)(`group`,{ref:n,children:Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:f(`#dfe9ff`,{opacity:.85,add:!0}),visible:!1,frustumCulled:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.9,1,6,1,!0]})},t))})}export{_ as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{l as t,t as n}from"./jsx-runtime-CZP6s5wa.js";import{Ut as r,f as i,yt as a}from"./bloomMarks-C54fx8hS.js";import{i as o,r as s}from"./Office-Dmaf62nb.js";import{a as c}from"./director-CrzFgnoP.js";import{i as l,n as u,o as d,r as f}from"./kit-0ivWfN5y.js";var p=e(t(),1),m=n(),h=14,g=new r(0,1,0);function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=d(e.side),v=(0,p.useMemo)(()=>({meteors:Array.from({length:h},()=>({born:-10,life:0,x:0,y:0,z:0,dir:new r,speed:0,size:1})),next:1,rnd:c(e.seed),q:new a,back:new r}),[e.seed]);return i(()=>{let r=e.t,i=v.rnd;for(;r>=v.next&&r<e.seconds-3;){let n=v.meteors.find(e=>r-e.born>e.life),a=.9+2.2*Math.exp(-(((r/e.seconds-.55)/.12)**2));if(v.next+=-Math.log(1-i()*.98)/a*1.4,n&&(n.born=r,n.life=.7+i()*.8,n.x=_*(180+i()*140),n.y=u(t)+50+i()*120,n.z=(i()-.5)*420,n.dir.set(-_*i()*.3,-.35-i()*.35,i()<.5?1:-1).normalize(),n.speed=110+i()*80,n.size=.6+i()*.8,i()<.3)){let i=s(n.x,n.y-t,n.z,200);o(`whoosh`,{gain:i.gain*l(r,e.seconds,4),pan:i.pan})}}let a=n.current?.children;if(a)for(let e=0;e<h;e++){let t=v.meteors[e],n=a[e],i=r-t.born;if(n.visible=i>=0&&i<t.life,!n.visible)continue;let o=i/t.life,s=Math.min(i*t.speed,30+t.size*10)*(1-o*.5),c=t.x+t.dir.x*t.speed*i,l=t.y+t.dir.y*t.speed*i,u=t.z+t.dir.z*t.speed*i;n.position.set(c-t.dir.x*s/2,l-t.dir.y*s/2,u-t.dir.z*s/2),n.quaternion.copy(v.q.setFromUnitVectors(g,v.back.copy(t.dir).negate()));let d=t.size*(1-o*o);n.scale.set(d,Math.max(.01,s),d)}}),(0,m.jsx)(`group`,{ref:n,children:Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:f(`#dfe9ff`,{opacity:.85,add:!0}),visible:!1,frustumCulled:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.9,1,6,1,!0]})},t))})}export{_ as default};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{l as n,t as r}from"./jsx-runtime-CZP6s5wa.js";import{Xo as i,Yo as a,Zo as o,es as s,p as c,ys as l}from"./store-D1ymxjG0.js";import{c as u,l as d,o as f,s as p}from"./index-BoDJkaEF.js";var m=t(n(),1),h=r();function g(){let e=c(e=>e.usage.observations),t=c(e=>e.agents),n=c(e=>e.settings.language),r=p(),i=e=>e===null?r(`Not available`):e.toLocaleString(n,{maximumFractionDigits:6});return(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Observed AI usage`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Latest 200 observations. Status rows are cumulative session counters, not additional consumption. Reported costs are not subscription charges or remaining quota.`})}),e?.length?[...e].reverse().map(e=>(0,h.jsxs)(`div`,{className:`card`,style:{overflowWrap:`anywhere`},children:[(0,h.jsxs)(`b`,{children:[e.agentId?t[e.agentId]?.name??e.agentId:`—`,` · `,e.tool]}),(0,h.jsxs)(`div`,{children:[e.provider??r(`Not available`),` / `,e.model??r(`Not available`)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Input tokens`}),`: `,i(e.input),` · `,(0,h.jsx)(f,{children:`Output tokens`}),`: `,i(e.output)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reasoning tokens`}),`: `,i(e.reasoning),` · `,(0,h.jsx)(f,{children:`Cache read / write`}),`: `,i(e.cacheRead),` / `,i(e.cacheWrite)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reported cost (USD)`}),`: `,i(e.costUsd),` · `,(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[new Date(e.at).toLocaleString(n),` · `,e.source]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Last observation`}),`: `,e.observedAt?new Date(e.observedAt).toLocaleString(n):r(`Not available`)]})]},JSON.stringify([e.tool,e.sessionId,e.id]))):(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`No usage observations received yet.`})})]})}function _({resume:e}){let t=c(e=>e.usage.resources);return(0,h.jsx)(`div`,{children:t?.map(t=>(0,h.jsx)(v,{resource:t,resume:e},t.key))})}function v({resource:e,resume:t}){let n=p(),r=c(e=>e.agents),i=c(e=>e.settings.language),o=c(e=>e.demo),[s,l]=(0,m.useState)(e.group??``),[g,_]=(0,m.useState)(!1),v={idle:`Idle`,preparing:`Setting up`,working:`Working`,done:`Finished`,error:`Needs help`,stopped:`Stopped`},y=e=>e===null?n(`Not available`):new Date(e).toLocaleString(i),b=async()=>{if(await d({icon:`🔗`,tone:`warn`,title:n(`Confirm shared quota`),body:(0,h.jsx)(`p`,{children:(0,h.jsx)(f,{children:`Use the same label only when these connections share a quota. This does not change provider, model or billing mode.`})}),confirm:n(`Confirm shared quota`)})){_(!0);try{await u.setUsageGroup(e.key,s)}catch{}finally{_(!1)}}};return(0,h.jsxs)(`section`,{className:`card`,style:{overflowWrap:`anywhere`,minWidth:0},"aria-label":`${e.tool} ${e.provider??``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsxs)(`b`,{children:[e.tool,` · `,e.provider??n(`Provider not reported`)]}),(0,h.jsx)(`span`,{className:`pill`,children:n(e.state===`paused`?`Paused`:e.state===`pacing`?`Pacing`:`No active limit signal`)})]}),(0,h.jsxs)(`div`,{children:[e.model??n(`Model not reported`),` · `,n(e.access===`api`?`API`:e.access===`subscription`?`Subscription`:`Access mode not reported`)]}),e.group&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Shared quota`}),`: `,e.group]}),(0,h.jsx)(`div`,{className:`muted small`,children:(0,h.jsx)(f,{children:e.observedAt===null?`Configured selection; awaiting session telemetry`:`Observed connection`})}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Running sessions`}),`: `,e.running,` · `,(0,h.jsx)(f,{children:`Last observation`}),`: `,y(e.observedAt)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Last quota signal`}),`: `,y(e.warning?.at??null),` · `,(0,h.jsx)(f,{children:`Reported reset`}),`: `,y(e.warning?.resetsAt??null)]}),e.until!==null&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Next scheduling check`}),`: `,y(e.until)]}),e.warning?.pct==null?(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}):(0,h.jsxs)(`div`,{children:[(0,h.jsx)(f,{children:`Reported usage`}),`: `,e.warning.pct,`% `,(0,h.jsx)(`meter`,{min:0,max:100,value:e.warning.pct,"aria-label":n(`Reported usage`)})]}),(0,h.jsx)(`ul`,{children:e.agentIds.map(e=>{let t=r[e];return(0,h.jsxs)(`li`,{children:[t?.name??e,` · `,t?.role===`ceo`?`CEO`:t?.repoId||`—`,` · `,t?n(v[t.status]??t.status):`—`,t?.startedAt?` · ${a((t.endedAt??Date.now())-t.startedAt)}`:``]},e)})}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:e.state!==`pacing`,onClick:()=>t(e.key),children:(0,h.jsx)(f,{children:`Resume this quota`})}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`warning`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate a usage warning`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`limit`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate reaching the limit`})})]})]}),(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Quota association`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Without an identified account or confirmed association, limits stay isolated. OAuth alone does not identify a subscription.`})}),(0,h.jsxs)(`label`,{children:[(0,h.jsx)(f,{children:`Confirmed shared quota label`}),(0,h.jsx)(`input`,{value:s,onChange:e=>l(e.target.value),maxLength:64,style:{width:`100%`,boxSizing:`border-box`}})]}),(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:g||s===(e.group??``),onClick:()=>void b(),children:(0,h.jsx)(f,{children:`Save quota association`})})]})]})}function y(e,t,n){if(n!==`it`)return e.text;let r=e.kind===`pr`&&e.prNumber!==null?`PR #${e.prNumber} needs you`:e.kind===`agent`&&t?`${t} is stuck on an error`:null;return!r||!(e.text===r||e.text.startsWith(r+`: `))?e.text:(e.kind===`pr`?l(n,`PR #{number} needs you`,{number:e.prNumber}):l(n,`{name} is stuck on an error`,{name:t}))+e.text.slice(r.length)}function b(e,t,n,r){if(!e.startsWith(t)||!e.endsWith(n))return null;let i=/^(\d+) (minute|minutes|hours)$/.exec(e.slice(t.length,-n.length));return i?l(r,`{count} ${i[2]}`,{count:i[1]}):null}function x(e,t,n){if(n!==`it`)return e.text;let r=t??`Someone`,i={name:t??l(n,`Someone`),task:e.prNumber===null?`#${e.issueNumber}`:`PR #${e.prNumber}`,issue:e.issueNumber??`?`,pr:e.prNumber??`?`},a=(e,t={})=>l(n,e,{...i,...t});if(e.kind===`quiet`){let t=b(e.text,`${r} has been quiet for `,` on ${i.task}, even after a nudge. Stop them, or put the work back in line?`,n);if(t)return a(`{name} has been quiet for {duration} on {task}, even after a nudge. Stop them, or put the work back in line?`,{duration:t})}else if(e.kind===`preparing`){let t=b(e.text,`${r} has been setting up a desk for ${i.task} for `,`. Put the work back in line?`,n);if(t)return a(`{name} has been setting up a desk for {task} for {duration}. Put the work back in line?`,{duration:t})}else if(e.kind===`stale`){if(e.text===`${r}'s last task ${i.task} is already merged. Clear the desk?`)return a(`{name}’s last task {task} is already merged. Clear the desk?`);if(e.text===`${r}'s last task ${i.task} is already closed. Clear the desk?`)return a(`{name}’s last task {task} is already closed. Clear the desk?`)}else if(e.kind===`qa-orphan`){if(e.text===`PR #${e.prNumber} is marked as in QA, but nobody is testing it. Test it again?`)return a(`PR #{pr} is marked as in QA, but nobody is testing it. Test it again?`)}else if(e.kind===`fix-orphan`){if(e.text===`PR #${e.prNumber} is waiting for a fix, but ${e.agentId?`${r} is on something else`:`nobody is on it`}. Hand it to a free agent?`)return a(e.agentId?`PR #{pr} is waiting for a fix, but {name} is on something else. Hand it to a free agent?`:`PR #{pr} is waiting for a fix, but nobody is on it. Hand it to a free agent?`)}else if(e.kind===`unclosed`){let t=b(e.text,`Issue #${e.issueNumber} is still open, but PR #${e.prNumber}, which closes it, was merged `,` ago. Close it?`,n);if(t)return a(`Issue #{issue} is still open, but PR #{pr}, which closes it, was merged {duration} ago. Close it?`,{duration:t})}return e.text}var S=e({UsageCard:()=>T});async function C(e){try{return await e()}catch{return}}async function w(e){let{usage:t,settings:n}=c.getState(),r=(e,t)=>l(n.language,e,t),i=t.resources?.filter(e=>e.state===`pacing`)??[],a=e?i.find(t=>t.key===e):i.length===1?i[0]:void 0;a?(document.pointerLockElement&&document.exitPointerLock(),await d({icon:`⏩`,tone:`warn`,title:r(`Resume full speed?`),body:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`p`,{children:[a.tool,` · `,a.provider??r(`Provider not reported`),` · `,a.group??a.model]}),(0,h.jsx)(`p`,{children:r(`Resume only this quota. Hard limits cannot be cleared early; other quotas are unchanged.`)})]}),confirm:r(`Resume full speed`)})&&await C(()=>u.resumeFullSpeed(a.key))):c.getState().openOverlay({kind:`manager`,tab:`ops`,card:`usage`})}function T({hot:e}){let t=c(e=>e.settings.language),n=c(e=>e.usage),r=s(n,Date.now(),t);return(0,h.jsxs)(`div`,{id:`ops-card-usage`,className:`card usage-card usage-${r.tone} ${e?`ops-card-hot`:``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`b`,{children:(0,h.jsx)(f,{children:`🤖 AI usage`})}),(0,h.jsx)(`span`,{className:`pill usage-pill-${r.tone}`,children:r.state})]}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Limits apply only to the affected quota. Warnings pace new issues; hard limits also hold QA, fixes and CEO jobs. Running sessions continue. Missing data does not mean unlimited usage.`})}),(0,h.jsx)(_,{resume:e=>void w(e)}),(0,h.jsx)(g,{})]})}function E({alarm:e,repo:t,hot:n}){let r=p(),i=c(e=>e.settings.language),a=c(t=>e.agentId?t.agents[e.agentId]?.name:void 0),o=c(e=>e.openOverlay),s=c(e=>e.goToFloor),l=e.prNumber===null?void 0:t?.pulls.find(t=>t.number===e.prNumber);return(0,h.jsxs)(`div`,{id:`ops-card-${e.id}`,className:`card floor-card alarm-card ${n?`ops-card-hot`:``}`,style:{"--accent":t?.color??`#ef476f`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🚨 `,y(e,a,i)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,l?` · ${l.title}`:``,` · `,r(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.kind===`pr`&&e.prNumber!==null?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`kanban`,repoId:e.repoId}),children:(0,h.jsx)(f,{children:`📋 Open the Kanban`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>void C(()=>u.sendToQa(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Retry QA`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,title:r(`Hand it to its author, or any free agent, with QA’s findings`),onClick:()=>void C(()=>u.sendBack(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Send back for a fix`})}),l&&(0,h.jsx)(`a`,{className:`small`,href:l.url,target:`_blank`,rel:`noreferrer`,children:(0,h.jsx)(f,{children:`PR on GitHub ↗`})})]}):e.agentId&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,title:r(`Clear their desk so they take new work`),onClick:()=>void C(()=>u.reset(e.agentId)),children:(0,h.jsx)(f,{children:`Clear desk`})})]}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>s(e.floor),children:r(`Visit floor {floor}`,{floor:e.floor})})]})]})}var D={clear:[`↺ Clear desk`,`Clear their desk so they take new work`],stop:[`■ Stop`,`Stop their session`],requeue:[`↩ Requeue`,`Stop them and put the work back in line, without a strike`],"retry-qa":[`Retry QA`,`Queue the PR for a fresh QA run`],"send-back":[`Send back for a fix`,`Hand the PR to its author, or any free agent`],"close-issue":[`Close issue`,`Close the issue on GitHub as completed`]};async function O(e,t){let n=(e,t)=>l(c.getState().settings.language,e,t);t===`close-issue`&&(document.pointerLockElement&&document.exitPointerLock(),!await d({icon:`🩺`,tone:`warn`,title:n(`Close issue #{number}?`,{number:e.issueNumber??`?`}),body:(0,h.jsx)(`p`,{children:n(`It’s closed on GitHub as completed, with a comment saying PR #{number} resolved it.`,{number:e.prNumber??`?`})}),confirm:n(`Close issue`)}))||await C(()=>u.doctorFix(e.id,t))}function k({finding:e,repo:t}){let n=p(),r=c(e=>e.settings.language),i=c(t=>e.agentId?t.agents[e.agentId]?.name:void 0),a=c(e=>e.openOverlay);return(0,h.jsxs)(`div`,{id:`ops-card-doctor-${e.id}`,className:`card floor-card alarm-card doctor-card`,style:{"--accent":t?.color??`#7c6cf0`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:t?.floor??`?`}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🩺 `,x(e,i,r)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,` · `,n(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.fixes.map((t,r)=>(0,h.jsx)(`button`,{className:`btn btn-small ${r===0?`btn-good`:``}`,title:n(D[t][1]),onClick:()=>void O(e,t),children:n(D[t][0])},t)),e.agentId&&(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>a({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:n(`Hide it until it goes away`),onClick:()=>void C(()=>u.doctorIgnore(e.id)),children:(0,h.jsx)(f,{children:`Ignore`})})]})]})}async function A(e){let t=await C(()=>u.demoDoctor(e));t&&c.getState().pushToast(`info`,t.text)}function j({hot:e}){let t=p(),n=c(e=>e.doctor),r=c(e=>e.repos),i=c(e=>e.demo);return(0,h.jsxs)(`div`,{id:`ops-card-doctor`,className:e?`ops-card-hot`:``,children:[(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🩺 Office doctor`}),` `,n.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:n.length})]}),n.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Nothing stuck. Every minute the watchdog nudges quiet sessions, frees stuck desks and puts orphaned work back in line by itself; what it can’t safely fix shows up here.`})}),n.map(e=>(0,h.jsx)(k,{finding:e,repo:r.find(t=>t.id===e.repoId)},e.id)),i&&(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`span`,{className:`muted small`,children:`Demo:`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Restart with desks gone and work finished on GitHub meanwhile`),onClick:()=>void A(`restart`),children:(0,h.jsx)(f,{children:`Simulate a restart`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Someone’s session goes quiet for 20 minutes`),onClick:()=>void A(`stuck`),children:(0,h.jsx)(f,{children:`Make a session stuck`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Ten more minutes pass for the stuck sessions`),onClick:()=>void A(`later`),children:(0,h.jsx)(f,{children:`10 minutes later`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`A merged PR whose issue was never closed`),onClick:()=>void A(`unclosed`),children:(0,h.jsx)(f,{children:`Leave an issue open`})})]})]})}var M=[[`Ready to start`,e=>String(e.ready),`Backlog issues that can start now`],[`Building`,e=>String(e.building)],[`In QA`,e=>String(e.inQa)],[`Fixing`,e=>String(e.fixing),`Back with an agent: QA findings, checks or a conflict`],[`To merge`,e=>String(e.toMerge)],[`Needs you`,e=>`${e.needsYou}${e.triage?` (+${e.triage} 🧭)`:``}`,`🧭: the CEO is looking first`],[`Merged today`,(e,t)=>t(`{count} ({hour} last hour)`,{count:e.mergedToday,hour:e.mergedHour})],[`Lead time`,e=>a(e.leadMs),`Median issue → merge over the last 24 hours`],[`QA wait`,e=>a(e.qaWaitMs),`Median wait for a free agent over the last 24 hours`],[`CI`,e=>e.ciRuns?`${i(e.ciPass)} · ${a(e.ciMs)}`:`—`,`GitHub’s checks over 7 days: pass rate · median time`],[`Team`,(e,t)=>t(`{busy} busy · {idle} idle`,{busy:e.busy,idle:e.idle})+(e.errors?t(` · errors: {count}`,{count:e.errors}):``)],[`Cost today`,e=>`~${o(e.costToday)}`,`An estimate from finished sessions’ reported cost`]];function N(){let e=p(),t=c(e=>e.ops),n=c(e=>e.repos),r=[...t.floors.map(e=>{let t=n.find(t=>t.id===e.repoId);return[`${e.floor} · ${t?.fullName.split(`/`)[1]??e.repoId}`,t?.color??`#ccc`,e]}),[e(`All floors`),`#1f1d2b`,t.total]];return(0,h.jsxs)(`div`,{className:`ops-table-wrap`,children:[(0,h.jsxs)(`table`,{className:`ops-table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{}),r.map(([e,t])=>(0,h.jsx)(`th`,{style:{"--accent":t},className:`ops-col`,children:e},e))]})}),(0,h.jsx)(`tbody`,{children:M.map(([t,n,i])=>(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{title:i?e(i):void 0,children:e(t)}),r.map(([t,,r])=>(0,h.jsx)(`td`,{children:n(r,e)},t))]},t))})]}),t.ceoCostToday>0&&(0,h.jsx)(`div`,{className:`muted small`,children:e(`The CEO’s sessions today: ~{cost} (in All floors’ cost).`,{cost:o(t.ceoCostToday)})})]})}function P({card:e}){let t=c(e=>e.ops.alarms),n=c(e=>e.repos);return(0,m.useEffect)(()=>{e&&document.getElementById(`ops-card-${e}`)?.scrollIntoView({block:`center`})},[e]),(0,h.jsxs)(`div`,{className:`tab-grid`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(T,{hot:e===`usage`}),(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🚨 Needs you`}),` `,t.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:t.length})]}),t.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`All clear. The beacon on the lobby’s mission control wall spins when a PR needs you or an agent has been stuck on an error for 10 minutes.`})}),t.map(t=>(0,h.jsx)(E,{alarm:t,repo:n.find(e=>e.id===t.repoId),hot:t.id===e},t.id)),(0,h.jsx)(j,{hot:e===`doctor`})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`section`,children:(0,h.jsx)(f,{children:`🛰️ The numbers`})}),(0,h.jsx)(N,{})]})]})}export{P as n,w as r,S as t};
1
+ import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{l as n,t as r}from"./jsx-runtime-CZP6s5wa.js";import{Xo as i,Yo as a,Zo as o,es as s,p as c,ys as l}from"./store-D17hJxYS.js";import{c as u,l as d,o as f,s as p}from"./index-Bm599iDL.js";var m=t(n(),1),h=r();function g(){let e=c(e=>e.usage.observations),t=c(e=>e.agents),n=c(e=>e.settings.language),r=p(),i=e=>e===null?r(`Not available`):e.toLocaleString(n,{maximumFractionDigits:6});return(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Observed AI usage`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Latest 200 observations. Status rows are cumulative session counters, not additional consumption. Reported costs are not subscription charges or remaining quota.`})}),e?.length?[...e].reverse().map(e=>(0,h.jsxs)(`div`,{className:`card`,style:{overflowWrap:`anywhere`},children:[(0,h.jsxs)(`b`,{children:[e.agentId?t[e.agentId]?.name??e.agentId:`—`,` · `,e.tool]}),(0,h.jsxs)(`div`,{children:[e.provider??r(`Not available`),` / `,e.model??r(`Not available`)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Input tokens`}),`: `,i(e.input),` · `,(0,h.jsx)(f,{children:`Output tokens`}),`: `,i(e.output)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reasoning tokens`}),`: `,i(e.reasoning),` · `,(0,h.jsx)(f,{children:`Cache read / write`}),`: `,i(e.cacheRead),` / `,i(e.cacheWrite)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reported cost (USD)`}),`: `,i(e.costUsd),` · `,(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[new Date(e.at).toLocaleString(n),` · `,e.source]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Last observation`}),`: `,e.observedAt?new Date(e.observedAt).toLocaleString(n):r(`Not available`)]})]},JSON.stringify([e.tool,e.sessionId,e.id]))):(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`No usage observations received yet.`})})]})}function _({resume:e}){let t=c(e=>e.usage.resources);return(0,h.jsx)(`div`,{children:t?.map(t=>(0,h.jsx)(v,{resource:t,resume:e},t.key))})}function v({resource:e,resume:t}){let n=p(),r=c(e=>e.agents),i=c(e=>e.settings.language),o=c(e=>e.demo),[s,l]=(0,m.useState)(e.group??``),[g,_]=(0,m.useState)(!1),v={idle:`Idle`,preparing:`Setting up`,working:`Working`,done:`Finished`,error:`Needs help`,stopped:`Stopped`},y=e=>e===null?n(`Not available`):new Date(e).toLocaleString(i),b=async()=>{if(await d({icon:`🔗`,tone:`warn`,title:n(`Confirm shared quota`),body:(0,h.jsx)(`p`,{children:(0,h.jsx)(f,{children:`Use the same label only when these connections share a quota. This does not change provider, model or billing mode.`})}),confirm:n(`Confirm shared quota`)})){_(!0);try{await u.setUsageGroup(e.key,s)}catch{}finally{_(!1)}}};return(0,h.jsxs)(`section`,{className:`card`,style:{overflowWrap:`anywhere`,minWidth:0},"aria-label":`${e.tool} ${e.provider??``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsxs)(`b`,{children:[e.tool,` · `,e.provider??n(`Provider not reported`)]}),(0,h.jsx)(`span`,{className:`pill`,children:n(e.state===`paused`?`Paused`:e.state===`pacing`?`Pacing`:`No active limit signal`)})]}),(0,h.jsxs)(`div`,{children:[e.model??n(`Model not reported`),` · `,n(e.access===`api`?`API`:e.access===`subscription`?`Subscription`:`Access mode not reported`)]}),e.group&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Shared quota`}),`: `,e.group]}),(0,h.jsx)(`div`,{className:`muted small`,children:(0,h.jsx)(f,{children:e.observedAt===null?`Configured selection; awaiting session telemetry`:`Observed connection`})}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Running sessions`}),`: `,e.running,` · `,(0,h.jsx)(f,{children:`Last observation`}),`: `,y(e.observedAt)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Last quota signal`}),`: `,y(e.warning?.at??null),` · `,(0,h.jsx)(f,{children:`Reported reset`}),`: `,y(e.warning?.resetsAt??null)]}),e.until!==null&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Next scheduling check`}),`: `,y(e.until)]}),e.warning?.pct==null?(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}):(0,h.jsxs)(`div`,{children:[(0,h.jsx)(f,{children:`Reported usage`}),`: `,e.warning.pct,`% `,(0,h.jsx)(`meter`,{min:0,max:100,value:e.warning.pct,"aria-label":n(`Reported usage`)})]}),(0,h.jsx)(`ul`,{children:e.agentIds.map(e=>{let t=r[e];return(0,h.jsxs)(`li`,{children:[t?.name??e,` · `,t?.role===`ceo`?`CEO`:t?.repoId||`—`,` · `,t?n(v[t.status]??t.status):`—`,t?.startedAt?` · ${a((t.endedAt??Date.now())-t.startedAt)}`:``]},e)})}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:e.state!==`pacing`,onClick:()=>t(e.key),children:(0,h.jsx)(f,{children:`Resume this quota`})}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`warning`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate a usage warning`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`limit`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate reaching the limit`})})]})]}),(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Quota association`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Without an identified account or confirmed association, limits stay isolated. OAuth alone does not identify a subscription.`})}),(0,h.jsxs)(`label`,{children:[(0,h.jsx)(f,{children:`Confirmed shared quota label`}),(0,h.jsx)(`input`,{value:s,onChange:e=>l(e.target.value),maxLength:64,style:{width:`100%`,boxSizing:`border-box`}})]}),(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:g||s===(e.group??``),onClick:()=>void b(),children:(0,h.jsx)(f,{children:`Save quota association`})})]})]})}function y(e,t,n){if(n!==`it`)return e.text;let r=e.kind===`pr`&&e.prNumber!==null?`PR #${e.prNumber} needs you`:e.kind===`agent`&&t?`${t} is stuck on an error`:null;return!r||!(e.text===r||e.text.startsWith(r+`: `))?e.text:(e.kind===`pr`?l(n,`PR #{number} needs you`,{number:e.prNumber}):l(n,`{name} is stuck on an error`,{name:t}))+e.text.slice(r.length)}function b(e,t,n,r){if(!e.startsWith(t)||!e.endsWith(n))return null;let i=/^(\d+) (minute|minutes|hours)$/.exec(e.slice(t.length,-n.length));return i?l(r,`{count} ${i[2]}`,{count:i[1]}):null}function x(e,t,n){if(n!==`it`)return e.text;let r=t??`Someone`,i={name:t??l(n,`Someone`),task:e.prNumber===null?`#${e.issueNumber}`:`PR #${e.prNumber}`,issue:e.issueNumber??`?`,pr:e.prNumber??`?`},a=(e,t={})=>l(n,e,{...i,...t});if(e.kind===`quiet`){let t=b(e.text,`${r} has been quiet for `,` on ${i.task}, even after a nudge. Stop them, or put the work back in line?`,n);if(t)return a(`{name} has been quiet for {duration} on {task}, even after a nudge. Stop them, or put the work back in line?`,{duration:t})}else if(e.kind===`preparing`){let t=b(e.text,`${r} has been setting up a desk for ${i.task} for `,`. Put the work back in line?`,n);if(t)return a(`{name} has been setting up a desk for {task} for {duration}. Put the work back in line?`,{duration:t})}else if(e.kind===`stale`){if(e.text===`${r}'s last task ${i.task} is already merged. Clear the desk?`)return a(`{name}’s last task {task} is already merged. Clear the desk?`);if(e.text===`${r}'s last task ${i.task} is already closed. Clear the desk?`)return a(`{name}’s last task {task} is already closed. Clear the desk?`)}else if(e.kind===`qa-orphan`){if(e.text===`PR #${e.prNumber} is marked as in QA, but nobody is testing it. Test it again?`)return a(`PR #{pr} is marked as in QA, but nobody is testing it. Test it again?`)}else if(e.kind===`fix-orphan`){if(e.text===`PR #${e.prNumber} is waiting for a fix, but ${e.agentId?`${r} is on something else`:`nobody is on it`}. Hand it to a free agent?`)return a(e.agentId?`PR #{pr} is waiting for a fix, but {name} is on something else. Hand it to a free agent?`:`PR #{pr} is waiting for a fix, but nobody is on it. Hand it to a free agent?`)}else if(e.kind===`unclosed`){let t=b(e.text,`Issue #${e.issueNumber} is still open, but PR #${e.prNumber}, which closes it, was merged `,` ago. Close it?`,n);if(t)return a(`Issue #{issue} is still open, but PR #{pr}, which closes it, was merged {duration} ago. Close it?`,{duration:t})}return e.text}var S=e({UsageCard:()=>T});async function C(e){try{return await e()}catch{return}}async function w(e){let{usage:t,settings:n}=c.getState(),r=(e,t)=>l(n.language,e,t),i=t.resources?.filter(e=>e.state===`pacing`)??[],a=e?i.find(t=>t.key===e):i.length===1?i[0]:void 0;a?(document.pointerLockElement&&document.exitPointerLock(),await d({icon:`⏩`,tone:`warn`,title:r(`Resume full speed?`),body:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`p`,{children:[a.tool,` · `,a.provider??r(`Provider not reported`),` · `,a.group??a.model]}),(0,h.jsx)(`p`,{children:r(`Resume only this quota. Hard limits cannot be cleared early; other quotas are unchanged.`)})]}),confirm:r(`Resume full speed`)})&&await C(()=>u.resumeFullSpeed(a.key))):c.getState().openOverlay({kind:`manager`,tab:`ops`,card:`usage`})}function T({hot:e}){let t=c(e=>e.settings.language),n=c(e=>e.usage),r=s(n,Date.now(),t);return(0,h.jsxs)(`div`,{id:`ops-card-usage`,className:`card usage-card usage-${r.tone} ${e?`ops-card-hot`:``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`b`,{children:(0,h.jsx)(f,{children:`🤖 AI usage`})}),(0,h.jsx)(`span`,{className:`pill usage-pill-${r.tone}`,children:r.state})]}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Limits apply only to the affected quota. Warnings pace new issues; hard limits also hold QA, fixes and CEO jobs. Running sessions continue. Missing data does not mean unlimited usage.`})}),(0,h.jsx)(_,{resume:e=>void w(e)}),(0,h.jsx)(g,{})]})}function E({alarm:e,repo:t,hot:n}){let r=p(),i=c(e=>e.settings.language),a=c(t=>e.agentId?t.agents[e.agentId]?.name:void 0),o=c(e=>e.openOverlay),s=c(e=>e.goToFloor),l=e.prNumber===null?void 0:t?.pulls.find(t=>t.number===e.prNumber);return(0,h.jsxs)(`div`,{id:`ops-card-${e.id}`,className:`card floor-card alarm-card ${n?`ops-card-hot`:``}`,style:{"--accent":t?.color??`#ef476f`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🚨 `,y(e,a,i)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,l?` · ${l.title}`:``,` · `,r(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.kind===`pr`&&e.prNumber!==null?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`kanban`,repoId:e.repoId}),children:(0,h.jsx)(f,{children:`📋 Open the Kanban`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>void C(()=>u.sendToQa(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Retry QA`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,title:r(`Hand it to its author, or any free agent, with QA’s findings`),onClick:()=>void C(()=>u.sendBack(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Send back for a fix`})}),l&&(0,h.jsx)(`a`,{className:`small`,href:l.url,target:`_blank`,rel:`noreferrer`,children:(0,h.jsx)(f,{children:`PR on GitHub ↗`})})]}):e.agentId&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,title:r(`Clear their desk so they take new work`),onClick:()=>void C(()=>u.reset(e.agentId)),children:(0,h.jsx)(f,{children:`Clear desk`})})]}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>s(e.floor),children:r(`Visit floor {floor}`,{floor:e.floor})})]})]})}var D={clear:[`↺ Clear desk`,`Clear their desk so they take new work`],stop:[`■ Stop`,`Stop their session`],requeue:[`↩ Requeue`,`Stop them and put the work back in line, without a strike`],"retry-qa":[`Retry QA`,`Queue the PR for a fresh QA run`],"send-back":[`Send back for a fix`,`Hand the PR to its author, or any free agent`],"close-issue":[`Close issue`,`Close the issue on GitHub as completed`]};async function O(e,t){let n=(e,t)=>l(c.getState().settings.language,e,t);t===`close-issue`&&(document.pointerLockElement&&document.exitPointerLock(),!await d({icon:`🩺`,tone:`warn`,title:n(`Close issue #{number}?`,{number:e.issueNumber??`?`}),body:(0,h.jsx)(`p`,{children:n(`It’s closed on GitHub as completed, with a comment saying PR #{number} resolved it.`,{number:e.prNumber??`?`})}),confirm:n(`Close issue`)}))||await C(()=>u.doctorFix(e.id,t))}function k({finding:e,repo:t}){let n=p(),r=c(e=>e.settings.language),i=c(t=>e.agentId?t.agents[e.agentId]?.name:void 0),a=c(e=>e.openOverlay);return(0,h.jsxs)(`div`,{id:`ops-card-doctor-${e.id}`,className:`card floor-card alarm-card doctor-card`,style:{"--accent":t?.color??`#7c6cf0`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:t?.floor??`?`}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🩺 `,x(e,i,r)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,` · `,n(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.fixes.map((t,r)=>(0,h.jsx)(`button`,{className:`btn btn-small ${r===0?`btn-good`:``}`,title:n(D[t][1]),onClick:()=>void O(e,t),children:n(D[t][0])},t)),e.agentId&&(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>a({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:n(`Hide it until it goes away`),onClick:()=>void C(()=>u.doctorIgnore(e.id)),children:(0,h.jsx)(f,{children:`Ignore`})})]})]})}async function A(e){let t=await C(()=>u.demoDoctor(e));t&&c.getState().pushToast(`info`,t.text)}function j({hot:e}){let t=p(),n=c(e=>e.doctor),r=c(e=>e.repos),i=c(e=>e.demo);return(0,h.jsxs)(`div`,{id:`ops-card-doctor`,className:e?`ops-card-hot`:``,children:[(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🩺 Office doctor`}),` `,n.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:n.length})]}),n.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Nothing stuck. Every minute the watchdog nudges quiet sessions, frees stuck desks and puts orphaned work back in line by itself; what it can’t safely fix shows up here.`})}),n.map(e=>(0,h.jsx)(k,{finding:e,repo:r.find(t=>t.id===e.repoId)},e.id)),i&&(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`span`,{className:`muted small`,children:`Demo:`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Restart with desks gone and work finished on GitHub meanwhile`),onClick:()=>void A(`restart`),children:(0,h.jsx)(f,{children:`Simulate a restart`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Someone’s session goes quiet for 20 minutes`),onClick:()=>void A(`stuck`),children:(0,h.jsx)(f,{children:`Make a session stuck`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Ten more minutes pass for the stuck sessions`),onClick:()=>void A(`later`),children:(0,h.jsx)(f,{children:`10 minutes later`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`A merged PR whose issue was never closed`),onClick:()=>void A(`unclosed`),children:(0,h.jsx)(f,{children:`Leave an issue open`})})]})]})}var M=[[`Ready to start`,e=>String(e.ready),`Backlog issues that can start now`],[`Building`,e=>String(e.building)],[`In QA`,e=>String(e.inQa)],[`Fixing`,e=>String(e.fixing),`Back with an agent: QA findings, checks or a conflict`],[`To merge`,e=>String(e.toMerge)],[`Needs you`,e=>`${e.needsYou}${e.triage?` (+${e.triage} 🧭)`:``}`,`🧭: the CEO is looking first`],[`Merged today`,(e,t)=>t(`{count} ({hour} last hour)`,{count:e.mergedToday,hour:e.mergedHour})],[`Lead time`,e=>a(e.leadMs),`Median issue → merge over the last 24 hours`],[`QA wait`,e=>a(e.qaWaitMs),`Median wait for a free agent over the last 24 hours`],[`CI`,e=>e.ciRuns?`${i(e.ciPass)} · ${a(e.ciMs)}`:`—`,`GitHub’s checks over 7 days: pass rate · median time`],[`Team`,(e,t)=>t(`{busy} busy · {idle} idle`,{busy:e.busy,idle:e.idle})+(e.errors?t(` · errors: {count}`,{count:e.errors}):``)],[`Cost today`,e=>`~${o(e.costToday)}`,`An estimate from finished sessions’ reported cost`]];function N(){let e=p(),t=c(e=>e.ops),n=c(e=>e.repos),r=[...t.floors.map(e=>{let t=n.find(t=>t.id===e.repoId);return[`${e.floor} · ${t?.fullName.split(`/`)[1]??e.repoId}`,t?.color??`#ccc`,e]}),[e(`All floors`),`#1f1d2b`,t.total]];return(0,h.jsxs)(`div`,{className:`ops-table-wrap`,children:[(0,h.jsxs)(`table`,{className:`ops-table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{}),r.map(([e,t])=>(0,h.jsx)(`th`,{style:{"--accent":t},className:`ops-col`,children:e},e))]})}),(0,h.jsx)(`tbody`,{children:M.map(([t,n,i])=>(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{title:i?e(i):void 0,children:e(t)}),r.map(([t,,r])=>(0,h.jsx)(`td`,{children:n(r,e)},t))]},t))})]}),t.ceoCostToday>0&&(0,h.jsx)(`div`,{className:`muted small`,children:e(`The CEO’s sessions today: ~{cost} (in All floors’ cost).`,{cost:o(t.ceoCostToday)})})]})}function P({card:e}){let t=c(e=>e.ops.alarms),n=c(e=>e.repos);return(0,m.useEffect)(()=>{e&&document.getElementById(`ops-card-${e}`)?.scrollIntoView({block:`center`})},[e]),(0,h.jsxs)(`div`,{className:`tab-grid`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(T,{hot:e===`usage`}),(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🚨 Needs you`}),` `,t.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:t.length})]}),t.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`All clear. The beacon on the lobby’s mission control wall spins when a PR needs you or an agent has been stuck on an error for 10 minutes.`})}),t.map(t=>(0,h.jsx)(E,{alarm:t,repo:n.find(e=>e.id===t.repoId),hot:t.id===e},t.id)),(0,h.jsx)(j,{hot:e===`doctor`})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`section`,children:(0,h.jsx)(f,{children:`🛰️ The numbers`})}),(0,h.jsx)(N,{})]})]})}export{P as n,w as r,S as t};