@puddle-code/cli 0.3.6 → 0.3.7

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 (58) hide show
  1. package/CHANGELOG.md +6 -3
  2. package/dist/host-control.mjs +23 -12
  3. package/dist/index.js +27 -15
  4. package/dist/public/assets/App-3pe09sB2.js +2 -0
  5. package/dist/public/assets/Dashboard-D9xlDbdg.js +1 -0
  6. package/dist/public/assets/{EditorTabClose-BV-zQyHT.js → EditorTabClose-CXw4HBAH.js} +1 -1
  7. package/dist/public/assets/LazyTerminal-Bw2e95Rk.js +2 -0
  8. package/dist/public/assets/{ModelRefcount-BasPzO4R.js → ModelRefcount-CnZh2UXX.js} +1 -1
  9. package/dist/public/assets/NewProjectDialog-C3INf-Ll.js +1 -0
  10. package/dist/public/assets/PaneEditorBody-CpAHfSEe.js +302 -0
  11. package/dist/public/assets/{PdfViewer-DAAfA9OC.js → PdfViewer-CfWAV5F2.js} +1 -1
  12. package/dist/public/assets/SettingsDialog-DYHZOJul.js +8 -0
  13. package/dist/public/assets/{Terminal-DmlEI-h7.js → Terminal-DehlgjA9.js} +4 -4
  14. package/dist/public/assets/Workspace-CfqiBKYr.js +20 -0
  15. package/dist/public/assets/auth-B4b-NPwe.js +64 -0
  16. package/dist/public/assets/{buffer-store-CYe-IdNO.js → buffer-store-DI-PLEdj.js} +1 -1
  17. package/dist/public/assets/context-menu-BEfTGRZA.js +1 -0
  18. package/dist/public/assets/{copy-CjatFFf8.js → copy-DD43yC2P.js} +1 -1
  19. package/dist/public/assets/{disclosure-7lu23NnB.js → disclosure-BQ-uiP85.js} +1 -1
  20. package/dist/public/assets/dist-Cg-J2BAP.js +1 -0
  21. package/dist/public/assets/{dist-7fft9rhQ.js → dist-Rswij5M_.js} +1 -1
  22. package/dist/public/assets/{errors-DhRwiizF.js → errors-C-GJcBJ-.js} +1 -1
  23. package/dist/public/assets/index-CjRY8Crm.css +2 -0
  24. package/dist/public/assets/{index-BRywm-gU.js → index-fldNIah5.js} +3 -3
  25. package/dist/public/assets/input-Dx89yXF4.js +1 -0
  26. package/dist/public/assets/{markdown-mermaid-CF9txXiK.js → markdown-mermaid-CxLp87MP.js} +1 -1
  27. package/dist/public/assets/media-refresh-store-WCjZVi4Y.js +1 -0
  28. package/dist/public/assets/notification-delivery-Cmpcrn_p.js +1 -0
  29. package/dist/public/assets/popover-CTPDNtFu.js +1 -0
  30. package/dist/public/assets/{project-abbrev-DX_a_ySv.js → project-abbrev-DhiE8lDE.js} +1 -1
  31. package/dist/public/assets/{protocol-support-gmAQBWF3.js → protocol-support-Q_1mBit9.js} +1 -1
  32. package/dist/public/assets/{scroll-restoration-hg7BYUz2.js → scroll-restoration-hslkZdX5.js} +1 -1
  33. package/dist/public/assets/select-iSqC2X51.js +1 -0
  34. package/dist/public/assets/{selection-actions-BZy4596m.js → selection-actions-DmuKya-K.js} +1 -1
  35. package/dist/public/assets/switch-CeNFnG6w.js +1 -0
  36. package/dist/public/assets/use-ui-state-xScqhALU.js +1 -0
  37. package/dist/public/assets/{ws-oU1ansI7.js → ws-CT7jDKHs.js} +1 -1
  38. package/dist/public/index.html +3 -3
  39. package/dist/pudl.js +24 -13
  40. package/package.json +1 -1
  41. package/dist/public/assets/App-Duewv-oi.js +0 -2
  42. package/dist/public/assets/Dashboard-7gBsrB7q.js +0 -1
  43. package/dist/public/assets/LazyTerminal-gX1-vBQf.js +0 -2
  44. package/dist/public/assets/NewProjectDialog-CDYUPliQ.js +0 -1
  45. package/dist/public/assets/PaneEditorBody-CqLkAxM1.js +0 -302
  46. package/dist/public/assets/SettingsDialog-DiwhE5dK.js +0 -8
  47. package/dist/public/assets/Workspace-cfjpv0xU.js +0 -20
  48. package/dist/public/assets/auth-BxExwqPW.js +0 -73
  49. package/dist/public/assets/context-menu-DVUv5Z6a.js +0 -1
  50. package/dist/public/assets/dist-B67qxih2.js +0 -1
  51. package/dist/public/assets/index-XBWIhnuP.css +0 -2
  52. package/dist/public/assets/media-refresh-store-DLtYZTP9.js +0 -1
  53. package/dist/public/assets/notification-delivery-CoCRZRSK.js +0 -1
  54. package/dist/public/assets/popover-C-BfSLgw.js +0 -1
  55. package/dist/public/assets/recipes-K5GH3Kht.js +0 -1
  56. package/dist/public/assets/select-YFIOZ3zx.js +0 -1
  57. package/dist/public/assets/switch-OD1b2aeq.js +0 -1
  58. package/dist/public/assets/use-ui-state-C2LCTPRw.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{z as r}from"./auth-BxExwqPW.js";import{a as i,o as a,p as o,t as s}from"./LazyTerminal-gX1-vBQf.js";import{o as c}from"./dist-7fft9rhQ.js";import{It as l,Mt as u,Nt as d,tn as f}from"./protocol-support-gmAQBWF3.js";import{n as ee}from"./x-DCpy1q13.js";import{t as p}from"./createLucideIcon-DyMAgLa3.js";import{l as te,o as ne,s as re,u as ie}from"./switch-OD1b2aeq.js";import{a as ae,n as oe,o as se,r as ce,t as le}from"./dialog-Bnex_wlx.js";function ue(e,t){return`[${o(t)}] ${e}`.slice(0,160)}var de=p(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),fe=p(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),pe=p(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),me=p(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),he=p(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),ge=p(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),_e=p(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),ve=p(`cake`,[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]),m=p(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),h=p(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),g=p(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),_=p(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),v=p(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),y=p(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),b=p(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),x=p(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),S=p(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),C=p(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),w=p(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),T=p(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),E=p(`flower-2`,[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]),D=p(`flower`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5`,key:`14wa3c`}],[`path`,{d:`M12 7.5V9`,key:`1oy5b0`}],[`path`,{d:`M7.5 12H9`,key:`eltsq1`}],[`path`,{d:`M16.5 12H15`,key:`vk5kw4`}],[`path`,{d:`M12 16.5V15`,key:`k7eayi`}],[`path`,{d:`m8 8 1.88 1.88`,key:`nxy4qf`}],[`path`,{d:`M14.12 9.88 16 8`,key:`1lst6k`}],[`path`,{d:`m8 16 1.88-1.88`,key:`h2eex1`}],[`path`,{d:`M14.12 14.12 16 16`,key:`uqkrx3`}]]),O=p(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),k=p(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),A=p(`ghost`,[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]]),j=p(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),M=p(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),N=p(`guitar`,[[`path`,{d:`m11.9 12.1 4.514-4.514`,key:`109xqo`}],[`path`,{d:`M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z`,key:`txyc8t`}],[`path`,{d:`m6 16 2 2`,key:`16qmzd`}],[`path`,{d:`M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z`,key:`1de1vg`}]]),P=p(`headphones`,[[`path`,{d:`M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3`,key:`1xhozi`}]]),F=p(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),ye=p(`ice-cream-cone`,[[`path`,{d:`m7 11 4.08 10.35a1 1 0 0 0 1.84 0L17 11`,key:`1v6356`}],[`path`,{d:`M17 7A5 5 0 0 0 7 7`,key:`151p3v`}],[`path`,{d:`M17 7a2 2 0 0 1 0 4H7a2 2 0 0 1 0-4`,key:`1sdaij`}]]),be=p(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),xe=p(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),Se=p(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),I=p(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ce=p(`mountain-snow`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}],[`path`,{d:`M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19`,key:`1pvmmp`}]]),we=p(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),Te=p(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),Ee=p(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),De=p(`pizza`,[[`path`,{d:`m12 14-1 1`,key:`11onhr`}],[`path`,{d:`m13.75 18.25-1.25 1.42`,key:`1yisr3`}],[`path`,{d:`M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12`,key:`1qtqk6`}],[`path`,{d:`M18.8 9.3a1 1 0 0 0 2.1 7.7`,key:`fbbbr2`}],[`path`,{d:`M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z`,key:`1hyfdd`}]]),Oe=p(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),ke=p(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ae=p(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),je=p(`rainbow`,[[`path`,{d:`M22 17a10 10 0 0 0-20 0`,key:`ozegv`}],[`path`,{d:`M6 17a6 6 0 0 1 12 0`,key:`5giftw`}],[`path`,{d:`M10 17a2 2 0 0 1 4 0`,key:`gnsikk`}]]),Me=p(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Ne=p(`sailboat`,[[`path`,{d:`M10 2v15`,key:`1qf71f`}],[`path`,{d:`M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z`,key:`1pxcvx`}],[`path`,{d:`M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z`,key:`5oog16`}]]),Pe=p(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),Fe=p(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),Ie=p(`snowflake`,[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]),Le=p(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Re=p(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),ze=p(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),L=p(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Be=p(`tent`,[[`path`,{d:`M3.5 21 14 3`,key:`1szst5`}],[`path`,{d:`M20.5 21 10 3`,key:`1310c3`}],[`path`,{d:`M15.5 21 12 15l-3.5 6`,key:`1ddtfw`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}]]),Ve=p(`train-front`,[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]),He=p(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),Ue=p(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),We=p(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),Ge=p(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),Ke=p(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),R=[{name:`mountain`,Icon:we},{name:`mountain-snow`,Icon:Ce},{name:`tree-pine`,Icon:He},{name:`trees`,Icon:Ue},{name:`leaf`,Icon:xe},{name:`flower`,Icon:D},{name:`flower-2`,Icon:E},{name:`sprout`,Icon:Re},{name:`sun`,Icon:L},{name:`moon`,Icon:I},{name:`star`,Icon:ze},{name:`cloud`,Icon:_},{name:`snowflake`,Icon:Ie},{name:`zap`,Icon:ne},{name:`flame`,Icon:T},{name:`droplet`,Icon:S},{name:`rainbow`,Icon:je},{name:`wind`,Icon:Ke},{name:`bird`,Icon:pe},{name:`fish`,Icon:w},{name:`cat`,Icon:g},{name:`dog`,Icon:x},{name:`rabbit`,Icon:Ae},{name:`turtle`,Icon:Ge},{name:`bug`,Icon:_e},{name:`snail`,Icon:Fe},{name:`paw-print`,Icon:Ee},{name:`feather`,Icon:C},{name:`rocket`,Icon:Me},{name:`anchor`,Icon:de},{name:`compass`,Icon:y},{name:`map`,Icon:Se},{name:`tent`,Icon:Be},{name:`camera`,Icon:m},{name:`music`,Icon:Te},{name:`headphones`,Icon:P},{name:`palette`,Icon:te},{name:`brush`,Icon:ge},{name:`pencil`,Icon:a},{name:`book`,Icon:he},{name:`book-open`,Icon:me},{name:`coffee`,Icon:v},{name:`pizza`,Icon:De},{name:`ice-cream-cone`,Icon:ye},{name:`cake`,Icon:ve},{name:`gift`,Icon:j},{name:`gamepad-2`,Icon:O},{name:`puzzle`,Icon:ke},{name:`bike`,Icon:fe},{name:`car`,Icon:h},{name:`plane`,Icon:Oe},{name:`ship`,Icon:Pe},{name:`sailboat`,Icon:Ne},{name:`train-front`,Icon:Ve},{name:`heart`,Icon:F},{name:`sparkles`,Icon:Le},{name:`crown`,Icon:b},{name:`gem`,Icon:k},{name:`trophy`,Icon:We},{name:`ghost`,Icon:A},{name:`bot`,Icon:ie},{name:`globe`,Icon:M},{name:`guitar`,Icon:N}],qe=Object.fromEntries(R.map(e=>[e.name,e.Icon])),z=n();function Je({icon:e,colour:t,className:n}){let r=ee(`size-4 shrink-0`,t?i(t):`text-fg-muted`,n);return(0,z.jsx)(e&&qe[e]||re,{className:r})}var B=e(t(),1);function Ye({stream:e,label:t,hint:n,onClose:r}){let[i,a]=(0,B.useState)(null);return(0,z.jsx)(le,{open:!0,onOpenChange:e=>!e&&r(),children:(0,z.jsxs)(oe,{className:`h-[85vh] max-w-[calc(100vw-4rem)]`,children:[(0,z.jsxs)(ae,{children:[(0,z.jsxs)(se,{children:[t,` — login`]}),(0,z.jsx)(ce,{children:i===null?`Complete the agent’s login flow below.${n===void 0?` The account shows as logged in once it finishes cleanly.`:` ${n}`}`:`The login exited with code ${i} without completing. The output above may say why; close this and try again.`})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-md bg-ground p-1`,children:(0,z.jsx)(s,{stream:e,onExit:e=>e===0?r():a(e)})})]})})}var V=e=>e&&typeof e==`object`?e:{},H=[{id:`appearance`,label:`Appearance`,fields:[{key:`theme`,store:`theme`},{key:`cursorPackage`,store:`client`},{key:`uiFontSize`,store:`client`},{key:`terminalFontSize`,store:`client`},{key:`editorFontSize`,store:`client`},{key:`density`,store:`client`},{key:`terminalScrollback`,store:`client`},{key:`projectBasedLayout`,store:`client`},{key:`showAllProjectSessions`,store:`client`}]},{id:`profile`,label:`Profile`,fields:[{key:`branch_prefix`,store:`profileColumn`},{key:`icon`,store:`profileColumn`},{key:`icon_colour`,store:`profileColumn`}]},{id:`sessions`,label:`Sessions`,fields:[{key:`onboardingTemplate`,store:`profileSettings`},{key:`concurrentTemplate`,store:`profileSettings`},{key:`restartTemplate`,store:`profileSettings`},{key:`tabTitleTemplate`,store:`profileSettings`},{key:`sessionDefaults`,store:`profileSettings`},{key:`allowSkipPermissions`,store:`profileSettings`},{key:`captureSessionEnv`,store:`profileSettings`}]},{id:`editor`,label:`Editor`,fields:[{key:`editorTabSize`,store:`client`},{key:`editorWordWrap`,store:`client`},{key:`editorLinkSshHost`,store:`client`}]},{id:`hotkeys`,label:`Hotkeys`,fields:[{key:`hotkeys`,store:`profileSettings`}]},{id:`notifications`,label:`Notifications`,fields:[{key:`notifications`,store:`profileSettings`,pick:e=>{let{desktop:t,sound:n,when_focused:r}=V(e);return{desktop:t,sound:n,...r===void 0?{}:{when_focused:r}}},mergeInto:(e,t)=>({...V(t),...V(e)})}]},{id:`scratchpad`,label:`Scratchpad (profile-wide entries)`,fields:[{key:`entries`,store:`scratchpad`}]}];function U(e){return e.filter(e=>e.scope===`profile`).map(e=>({title:e.title,body:e.body,tags:e.tags,agent_type:e.agent_type}))}function W(e){return JSON.stringify([e.title??``,e.body,e.tags,e.agent_type??``])}function Xe(e,t){if(!Array.isArray(e))return[];let n=new Set(U(t).map(W)),r=new Set,i=[];for(let t of e){let e=V(t);if(typeof e.body!=`string`||e.body.length===0)continue;let a={title:typeof e.title==`string`&&e.title!==``?e.title:null,body:e.body,tags:Array.isArray(e.tags)?e.tags.filter(e=>typeof e==`string`):[],agent_type:typeof e.agent_type==`string`?e.agent_type:null},o=W(a);n.has(o)||r.has(o)||(r.add(o),i.push(a))}return i}function Ze(e,t){switch(e.store){case`client`:return t.client[e.key];case`theme`:return t.theme;case`profileSettings`:return t.profileSettings[e.key];case`profileColumn`:return t.profile[e.key];case`scratchpad`:return U(t.scratchpad)}}function Qe(e,t){let n={};for(let r of H){if(!e.includes(r.id))continue;let i={};for(let e of r.fields){let n=Ze(e,t);n!==void 0&&(i[e.key]=e.pick?e.pick(n):n)}Object.keys(i).length>0&&(n[r.id]=i)}return n}function $e(e,t,n,r){if(!e||typeof e!=`object`)return[];let i=e,a={},o={},s={},c=[];for(let e of H){if(r&&!r.includes(e.id))continue;let l=i[e.id];if(!l||typeof l!=`object`)continue;let u=l,d=!1;for(let r of e.fields){if(!(r.key in u))continue;let e=u[r.key];if(r.store===`scratchpad`){let r=Xe(e,n.scratchpad);r.length>0&&(t.createScratchpad(r),d=!0);continue}d=!0;let i=r.mergeInto?r.mergeInto(e,r.store===`profileSettings`?n.profileSettings[r.key]:void 0):e;r.store===`client`?a[r.key]=i:r.store===`theme`?t.setTheme(i):r.store===`profileSettings`?o[r.key]=i:s[r.key]=i}d&&c.push(e.label)}return Object.keys(a).length>0&&t.setClient(a),Object.keys(o).length>0&&t.patchProfileSettings(o),Object.keys(s).length>0&&t.patchProfileColumns(s),c}var G={version:1,profiles:{}};function et(e,t){return e.profiles[t]??{enabled:!0,groups:H.map(e=>e.id),doc:{},updatedAt:new Date(0).toISOString()}}async function tt(){try{let e=await fetch(`/cockpit/local-sync`,{headers:c(),cache:`no-store`});return e.ok?{available:!0,file:await e.json()}:{available:!1,file:G}}catch{return{available:!1,file:G}}}function nt(){return d({queryKey:[`local-sync`],queryFn:tt,staleTime:5e3,refetchOnWindowFocus:!0,retry:!1})}function rt(){let e=l();return u({mutationFn:async e=>{let t=await fetch(`/cockpit/local-sync`,{method:`PUT`,headers:{...c(),"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`The local sync store did not accept the write.`);return await t.json()},onSuccess:t=>e.setQueryData([`local-sync`],{available:!0,file:t})})}function it(){return f()?.showNotification?`unverified`:typeof Notification>`u`?`unsupported`:Notification.permission}async function at(e,t){let n;try{return await Promise.race([e,new Promise((e,r)=>{n=setTimeout(()=>r(Error(t)),1e4)})])}finally{clearTimeout(n)}}var K;async function ot(){return!(`serviceWorker`in navigator)||!window.isSecureContext?null:(K||=st().catch(e=>{throw K=void 0,e}),K)}async function st(){let e=await at(navigator.serviceWorker.register(`/notification-worker.js`),`Notification support did not respond. Reload Puddle and try again.`);if(e.active)return e;let t=e.installing??e.waiting;if(!t)throw Error(`Notification support could not start. Reload and try again.`);return await new Promise((e,n)=>{let r=r=>{clearTimeout(a),t.removeEventListener(`statechange`,i),r?n(r):e()},i=()=>{t.state===`activated`?r():t.state===`redundant`&&r(Error(`Notification support could not start.`))},a=setTimeout(()=>r(Error(`Notification support timed out.`)),1e4);t.addEventListener(`statechange`,i),i()}),e}async function q(e,t){if(!e.active)throw Error(`Notification support is not active.`);await new Promise((n,r)=>{let i=new MessageChannel,a=e=>{clearTimeout(o),i.port1.close(),e?r(e):n()},o=setTimeout(()=>a(Error(`Notification delivery timed out.`)),1e4);i.port1.onmessage=e=>a(e.data?.ok?void 0:Error(`The browser could not deliver the notification. Check system permissions.`)),e.active.postMessage({t:`show-notification`,request:t},[i.port2])})}var J={state:`unverified`,message:null},Y=new Set,X=new Map,Z=!1,ct=!1;function Q(e,t){X.set(e,t),X.size>64&&X.delete(X.keys().next().value)}function $(e){J=e;for(let e of Y)e();return e}function lt(){return(0,B.useSyncExternalStore)(e=>(Y.add(e),()=>{Y.delete(e)}),()=>J)}async function ut(){let e=f();if(e?.notificationStatus)try{$(r.parse(await e.notificationStatus()))}catch{$({state:`failed`,message:`Could not read desktop notification delivery status.`})}}async function dt(e,t,n){try{let i=f();if(i?.showNotification){!Z&&i.onNotificationClick&&(i.onNotificationClick((e,t)=>{t||X.get(e)?.(),X.delete(e)}),Z=!0),Q(e.id,t);let{target:a,...o}=e;return $(r.parse(await i.showNotification({...o,...i.notificationTargets?{target:a}:{},...i.notificationSubtitles&&n?{title:`${n.host} · ${n.project.name}`.slice(0,160),subtitle:e.title}:{}})))}if(typeof Notification>`u`)return $({state:`unsupported`,message:`This browser cannot show notifications.`});if(Notification.permission!==`granted`)return $({state:`failed`,message:`Allow notifications for Puddle in browser settings.`});let a=n?{...e,title:ue(e.title,n.project)}:e,o=await ot();return o?(ct||=(navigator.serviceWorker.addEventListener(`message`,e=>{e.data?.t!==`notification-click`||typeof e.data.id!=`string`||(e.data.target||X.get(e.data.id)?.(),X.delete(e.data.id))}),!0),Q(e.id,t),await q(o,a),$({state:`shown`,message:null})):await new Promise(n=>{let r=new Notification(a.title,{body:e.body,tag:e.id,silent:!0}),i=setTimeout(()=>n($({state:`unverified`,message:`Delivery has not been confirmed. Check system notification settings.`})),5e3);r.onshow=()=>{clearTimeout(i),n($({state:`shown`,message:null}))},r.onerror=()=>{clearTimeout(i),n($({state:`failed`,message:`The browser could not deliver the notification. Check system permissions.`}))},r.onclick=()=>{window.focus(),t(),r.close()}})}catch(e){return $({state:`failed`,message:e instanceof Error?e.message:`Notification delivery failed.`})}}export{et as a,H as c,Ye as d,Je as f,be as g,I as h,it as i,$e as l,L as m,ut as n,nt as o,R as p,lt as r,rt as s,dt as t,Qe as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{a as r,c as i,g as a,h as o,i as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./es2015-CrC2hHeB.js";import{a as h,c as g,n as _}from"./x-DCpy1q13.js";import{a as v,c as y,l as b,o as x,s as S}from"./recipes-K5GH3Kht.js";var C=e(t(),1),w=n(),T=`Popover`,[E,ee]=o(T,[b]),D=b(),[O,k]=E(T),A=e=>{let{__scopePopover:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=D(t),u=C.useRef(null),[d,f]=C.useState(!1),[p,m]=r({prop:a,defaultProp:o??!1,onChange:s,caller:T});return(0,w.jsx)(y,{...l,children:(0,w.jsx)(O,{scope:t,contentId:i(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:C.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:C.useCallback(()=>f(!0),[]),onCustomAnchorRemove:C.useCallback(()=>f(!1),[]),modal:c,children:n})})};A.displayName=T;var j=`PopoverAnchor`,M=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(j,n),a=D(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return C.useEffect(()=>(o(),()=>s()),[o,s]),(0,w.jsx)(v,{...a,...r,ref:t})});M.displayName=j;var N=`PopoverTrigger`,P=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(N,n),o=D(n),s=g(t,i.triggerRef),c=(0,w.jsx)(u.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Y(i.open),...r,ref:s,onClick:a(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:(0,w.jsx)(v,{asChild:!0,...o,children:c})});P.displayName=N;var F=`PopoverPortal`,[I,L]=E(F,{forceMount:void 0}),R=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=k(F,t);return(0,w.jsx)(I,{scope:t,forceMount:n,children:(0,w.jsx)(l,{present:n||a.open,children:(0,w.jsx)(f,{asChild:!0,container:i,children:r})})})};R.displayName=F;var z=`PopoverContent`,B=C.forwardRef((e,t)=>{let n=L(z,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=k(z,e.__scopePopover);return(0,w.jsx)(l,{present:r||a.open,children:a.modal?(0,w.jsx)(H,{...i,ref:t}):(0,w.jsx)(U,{...i,ref:t})})});B.displayName=z;var V=h(`PopoverContent.RemoveScroll`),H=C.forwardRef((e,t)=>{let n=k(z,e.__scopePopover),r=C.useRef(null),i=g(t,r),o=C.useRef(!1);return C.useEffect(()=>{let e=r.current;if(e)return p(e)},[]),(0,w.jsx)(c,{as:V,allowPinchZoom:!0,children:(0,w.jsx)(W,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:a(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:a(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:a(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),U=C.forwardRef((e,t)=>{let n=k(z,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return(0,w.jsx)(W,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),W=C.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...p}=e,h=k(z,n),g=D(n);return d(),(0,w.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,w.jsx)(m,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,w.jsx)(S,{"data-state":Y(h.open),role:`dialog`,id:h.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),G=`PopoverClose`,K=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(G,n);return(0,w.jsx)(u.button,{type:`button`,...r,ref:t,onClick:a(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;var q=`PopoverArrow`,J=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(n);return(0,w.jsx)(x,{...i,...r,ref:t})});J.displayName=q;function Y(e){return e?`open`:`closed`}var X=A,Z=P,Q=R,$=B,te=X,ne=Z;function re({className:e,align:t=`end`,sideOffset:n=8,...r}){return(0,w.jsx)(Q,{children:(0,w.jsx)($,{align:t,sideOffset:n,className:_(`z-50 rounded-lg bg-elevated p-5 shadow-2xl outline-none`,e),...r})})}export{re as n,ne as r,te as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{f as i,h as a,l as o,p as s}from"./es2015-CrC2hHeB.js";import{c}from"./x-DCpy1q13.js";var l=e(t(),1),u=[`top`,`right`,`bottom`,`left`],d=Math.min,f=Math.max,p=Math.round,m=Math.floor,h=e=>({x:e,y:e}),g={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function _(e,t,n){return f(e,d(t,n))}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return e.split(`-`)[0]}function b(e){return e.split(`-`)[1]}function x(e){return e===`x`?`y`:`x`}function S(e){return e===`y`?`height`:`width`}function C(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function w(e){return x(C(e))}function T(e,t,n){n===void 0&&(n=!1);let r=b(e),i=w(e),a=S(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=P(o)),[o,P(o)]}function E(e){let t=P(e);return[D(e),t,D(t)]}function D(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var O=[`left`,`right`],k=[`right`,`left`],A=[`top`,`bottom`],j=[`bottom`,`top`];function M(e,t,n){switch(e){case`top`:case`bottom`:return n?t?k:O:t?O:k;case`left`:case`right`:return t?A:j;default:return[]}}function N(e,t,n,r){let i=b(e),a=M(y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(D)))),a}function P(e){let t=y(e);return g[t]+e.slice(t.length)}function F(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:F(e)}function I(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function L(e,t,n){let{reference:r,floating:i}=e,a=C(t),o=w(t),s=S(o),c=y(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=b(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function R(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=v(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=I(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/y.y,bottom:(b.bottom-h.bottom+p.bottom)/y.y,left:(h.left-b.left+p.left)/y.x,right:(b.right-h.right+p.right)/y.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:R},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=L(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<te&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=L(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=v(e,t)||{};if(l==null)return{};let f=ee(u),p={x:n,y:r},m=w(i),h=S(m),g=await o.getDimensions(l),y=m===`y`,x=y?`top`:`left`,C=y?`bottom`:`right`,T=y?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[T]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[T]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=d(f[x],j),N=d(f[C],j),P=k-g[h]-N,F=k/2-g[h]/2+A,I=_(M,F,P),L=!c.arrow&&b(i)!=null&&F!==I&&a.reference[h]/2-(F<M?M:N)-g[h]/2<0,R=L?F<M?F-M:F-P:0;return{[m]:p[m]+R,data:{[m]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=v(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=y(r),_=C(o),b=y(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(b||!m?[P(o)]:E(o)),w=p!==`none`;!d&&w&&S.push(...N(o,m,p,x));let D=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=T(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=D[e];if(t&&(!(u===`alignment`&&_!==C(t))||A.every(e=>C(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(w){let t=C(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return u.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=v(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=y(n),s=b(n),c=C(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=v(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=v(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=C(i),p=x(f),m=u[p],h=u[f],g=(e,t)=>_(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let y=c.fn({...t,[p]:m,[f]:h});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=v(e,t),u={x:n,y:r},d=C(i),f=x(d),p=u[f],m=u[d],h=v(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(y(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=v(e,t),c=await i.detectOverflow(t,s),l=y(n),u=b(n),p=C(n)===`y`,{width:m,height:h}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let x=h-c.top-c.bottom,S=m-c.left-c.right,w=d(h-c[g],x),T=d(m-c[_],S),E=t.middlewareData.shift,D=!E,O=w,k=T;E!=null&&E.enabled.x&&(k=S),E!=null&&E.enabled.y&&(O=x),D&&!u&&(p?k=m-2*f(c.left,c.right):O=h-2*f(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function z(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof B(e).Node:!1}function H(e){return me()?e instanceof Element||e instanceof B(e).Element:!1}function U(e){return me()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}function W(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _e(e){return/^(table|td|th)$/.test(z(e))}function G(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ve=/transform|translate|scale|rotate|perspective|filter/,ye=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,be;function xe(e){let t=H(e)?J(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!Ce()&&(K(t.backdropFilter)||K(t.filter))||ve.test(t.willChange||``)||ye.test(t.contain||``)}function Se(e){let t=Y(e);for(;U(t)&&!q(t);){if(xe(t))return t;if(G(t))return null;t=Y(t)}return null}function Ce(){return be??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),be}function q(e){return/^(html|body|#document)$/.test(z(e))}function J(e){return B(e).getComputedStyle(e)}function we(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(z(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||V(e);return ge(t)?t.host:t}function Te(e){let t=Y(e);return q(t)?(e.ownerDocument||e).body:U(t)&&W(t)?t:Te(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Te(e),i=r===e.ownerDocument?.body,a=B(r);if(i){let e=Ee(a);return t.concat(a,a.visualViewport||[],W(r)?r:[],e&&n?X(e):[])}else return t.concat(r,X(r,[],n))}function Ee(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function De(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=U(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p(n)!==a||p(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Oe(e){return H(e)?e:e.contextElement}function Z(e){let t=Oe(e);if(!U(t))return h(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=De(t),o=(a?p(n.width):n.width)/r,s=(a?p(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ke=h(0);function Ae(e){let t=B(e);return!Ce()||!t.visualViewport?ke:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function je(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===B(e)}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Oe(e),o=h(1);t&&(r?H(r)&&(o=Z(r)):o=Z(e));let s=je(a,n,r)?Ae(a):h(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=B(a),t=H(r)?B(r):r,n=e,i=Ee(n);for(;i&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=B(i),i=Ee(n)}}return I({width:u,height:d,x:c,y:l})}function Me(e,t){let n=we(e).scrollLeft;return t?t.left+n:Q(V(e)).left+n}function Ne(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Me(e,n),y:n.top+t.scrollTop}}function Pe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=V(r),s=t?G(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h(1),u=h(0),d=U(r);if((d||!a)&&((z(r)!==`body`||W(o))&&(c=we(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ne(o,c):h(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Fe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ie(e){let t=we(e),n=e.ownerDocument.body,r=f(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=f(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Me(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=f(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Le=25;function Re(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=B(e),a=V(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ce()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Me(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Le&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ze(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Z(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Be(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Re(e,n,t);else if(t===`document`)r=Ie(V(e));else if(H(t))r=ze(t,n);else{let n=Ae(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return I(r)}function Ve(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>H(e)&&z(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;H(o)&&!q(o);){let e=J(o),t=xe(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function He(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?G(t)?[]:Ve(t,this._c):[].concat(n),r],o=Be(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Be(t,a[e],i);s=f(n.top,s),c=d(n.right,c),l=d(n.bottom,l),u=f(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ue(e){let{width:t,height:n}=De(e);return{width:t,height:n}}function We(e,t,n){let r=U(t),i=V(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h(0);if((r||!a)&&((z(t)!==`body`||W(i))&&(s=we(t)),r)){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Me(i));let l=i&&!r&&!a?Ne(i,s):h(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ge(e){return J(e).position===`static`}function Ke(e,t){if(!U(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function qe(e,t){let n=B(e);if(G(e))return n;if(!U(e)){let t=Y(e);for(;t&&!q(t);){if(H(t)&&!Ge(t))return t;t=Y(t)}return n}let r=Ke(e,t);for(;r&&_e(r)&&Ge(r);)r=Ke(r,t);return r&&q(r)&&Ge(r)&&!xe(r)?n:r||Se(e)||n}var Je=async function(e){let t=this.getOffsetParent||qe,n=this.getDimensions,r=await n(e.floating);return{reference:We(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ye(e){return J(e).direction===`rtl`}var Xe={convertOffsetParentRelativeRectToViewportRelativeRect:Pe,getDocumentElement:V,getClippingRect:He,getOffsetParent:qe,getElementRects:Je,getClientRects:Fe,getDimensions:Ue,getScale:Z,isElement:H,isRTL:Ye};function Ze(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qe(e,t,n){let r=null,i,a=V(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:p,width:h,height:g}=l;if(n||t(),!h||!g)return;let _=m(p),v=m(a.clientWidth-(u+h)),y=m(a.clientHeight-(p+g)),b=m(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:f(0,d(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!Ze(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=B(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function $e(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Oe(e),u=i||a?[...l?X(l):[],...t?X(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Qe(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!Ze(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var et=ue,tt=de,nt=ie,rt=pe,it=se,at=re,ot=fe,st=(e,t,n)=>{let r=new Map,i=n??{},a={...Xe,...i.platform,_c:r};return ne(e,t,{...i,platform:a})},ct=e(n(),1),lt=typeof document<`u`?l.useLayoutEffect:function(){};function ut(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ut(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ut(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function dt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ft(e,t){let n=dt(e);return Math.round(t*n)/n}function pt(e){let t=l.useRef(e);return lt(()=>{t.current=e}),t}function mt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=l.useState(r);ut(p,r)||m(r);let[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=l.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=l.useRef(null),w=l.useRef(null),T=l.useRef(d),E=c!=null,D=pt(c),O=pt(i),k=pt(u),A=l.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),st(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ut(T.current,t)&&(T.current=t,ct.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);lt(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=l.useRef(!1);lt(()=>(j.current=!0,()=>{j.current=!1}),[]),lt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=l.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=l.useMemo(()=>({reference:x,floating:S}),[x,S]),P=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ft(N.floating,d.x),r=ft(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...dt(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var ht=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:at({element:r.current,padding:i}).fn(n):r?at({element:r,padding:i}).fn(n):{}}}},gt=(e,t)=>{let n=et(e);return{name:n.name,fn:n.fn,options:[e,t]}},_t=(e,t)=>{let n=tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},vt=(e,t)=>({fn:ot(e).fn,options:[e,t]}),yt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},bt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=ht(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),Ct=`Arrow`,wt=l.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(s.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});wt.displayName=Ct;var Tt=wt;function Et(e){let[t,n]=l.useState(void 0);return o(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Dt=`Popper`,[Ot,kt]=a(Dt),[At,jt]=Ot(Dt),Mt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null),[a,o]=l.useState(void 0);return(0,$.jsx)(At,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Mt.displayName=Dt;var Nt=`PopperAnchor`,Pt=l.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=jt(Nt,n),o=l.useRef(null),u=a.onAnchorChange,d=c(t,l.useCallback(e=>{o.current=e,e&&u(e)},[u])),f=l.useRef(null);l.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&u(f.current)});let p=a.placementState&&Wt(a.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(s.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:d})});Pt.displayName=Nt;var Ft=`PopperContent`,[It,Lt]=Ot(Ft),Rt=l.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:u=`center`,alignOffset:d=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g=`partial`,hideWhenDetached:_=!1,updatePositionStrategy:v=`optimized`,onPlaced:y,...b}=e,x=jt(Ft,n),[S,C]=l.useState(null),w=c(t,C),[T,E]=l.useState(null),D=Et(T),O=D?.width??0,k=D?.height??0,A=r+(u===`center`?``:`-`+u),j=typeof h==`number`?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],N=M.length>0,P={padding:j,boundary:M.filter(Ht),altBoundary:N},{refs:F,floatingStyles:ee,placement:I,isPositioned:L,middlewareData:R}=mt({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>$e(...e,{animationFrame:v===`always`}),elements:{reference:x.anchor},middleware:[gt({mainAxis:a+k,alignmentAxis:d}),p&&_t({mainAxis:!0,crossAxis:!1,limiter:g===`partial`?vt():void 0,...P}),p&&yt({...P}),bt({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&St({element:T,padding:f}),Ut({arrowWidth:O,arrowHeight:k}),_&&xt({strategy:`referenceHidden`,...P,boundary:N?P.boundary:void 0})]}),te=x.setPlacementState;o(()=>(te(I),()=>{te(void 0)}),[I,te]);let[ne,re]=Wt(I),ie=i(y);o(()=>{L&&ie?.()},[L,ie]);let ae=R.arrow?.x,oe=R.arrow?.y,se=R.arrow?.centerOffset!==0,[ce,le]=l.useState();return o(()=>{S&&le(window.getComputedStyle(S).zIndex)},[S]),(0,$.jsx)(`div`,{ref:F.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:L?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(It,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:E,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,$.jsx)(s.div,{"data-side":ne,"data-align":re,...b,ref:w,style:{...b.style,animation:L?void 0:`none`}})})})});Rt.displayName=Ft;var zt=`PopperArrow`,Bt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Vt=l.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Lt(zt,n),a=Bt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Tt,{...r,ref:t,style:{...r.style,display:`block`}})})});Vt.displayName=zt;function Ht(e){return e!==null}var Ut=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Wt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Wt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Gt=Mt,Kt=Pt,qt=Rt,Jt=Vt,Yt=`rounded-md bg-border/50 text-sm text-fg placeholder:text-fg-muted transition-colors hover:bg-border/80 focus:bg-border/80 disabled:cursor-not-allowed disabled:opacity-50`,Xt=`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-fg outline-none transition-colors`,Zt=`data-[highlighted]:bg-action data-[highlighted]:text-action-ink data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,Qt=`data-[selected=true]:bg-action data-[selected=true]:text-action-ink data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`;export{Kt as a,Gt as c,Xt as i,kt as l,Qt as n,Jt as o,Zt as r,qt as s,Yt as t,Et as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{a as i,c as a,f as o,g as s,h as c,i as l,l as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./es2015-CrC2hHeB.js";import{a as v,c as y,n as b}from"./x-DCpy1q13.js";import{a as x,c as S,i as C,l as w,o as T,r as E,s as D,t as O}from"./recipes-K5GH3Kht.js";import{a as k,t as A}from"./dist-BCwJL3w9.js";import{t as j}from"./createLucideIcon-DyMAgLa3.js";import{t as ee}from"./chevron-down--sjpQEHH.js";import{n as te,t as ne}from"./dist-DmyIHyF9.js";var M=j(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),N=e(t(),1),P=e(n(),1);function F(e,[t,n]){return Math.min(n,Math.max(t,e))}var I=r(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=te(z),[U,re]=c(z,[H,w]),W=w(),[ie,G]=U(z),[ae,K]=U(z),oe=`SelectProvider`;function se(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,v=W(t),[y,b]=N.useState(null),[x,C]=N.useState(null),[w,T]=N.useState(!1),E=ne(d),[D,O]=i({prop:r,defaultProp:o??!1,onChange:s,caller:z}),[k,A]=i({prop:c,defaultProp:l,onChange:u,caller:z}),j=N.useRef(null),ee=N.useRef(k);N.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=()=>A(ee.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,A]);let te=!y||!!g||!!y.closest(`form`),[M,P]=N.useState(new Set),F=a(),L=Array.from(M).map(e=>e.props.value).join(`;`),R=N.useCallback(e=>{P(t=>new Set(t).add(e))},[]),V=N.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),H={required:h,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:F,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:m,name:f,autoComplete:p,form:g,nativeOptions:M,nativeSelectKey:L,isFormControl:te};return(0,I.jsx)(S,{...v,children:(0,I.jsx)(ie,{scope:t,...H,children:(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(ae,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:V,children:tt(_)?_(H):n})})})})}se.displayName=oe;var ce=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(se,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(et,{__scopeSelect:t}):null]})})};ce.displayName=z;var le=`SelectTrigger`,ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=W(n),o=G(le,n),c=o.disabled||r,l=y(t,o.onTriggerChange),u=V(n),d=N.useRef(`touch`),[f,m,h]=nt(e=>{let t=u().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{c||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(x,{asChild:!0,...a,children:(0,I.jsx)(p.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(o.value)?``:void 0,...i,ref:l,onClick:s(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:s(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:s(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(g(),e.preventDefault())})})})});ue.displayName=le;var de=`SelectValue`,fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=G(de,n),{onValueNodeHasChildrenChange:l}=c,d=a!==void 0,f=y(t,c.onValueNodeChange);u(()=>{l(d)},[l,d]);let m=$(c.value);return(0,I.jsx)(p.span,{...s,asChild:!m&&s.asChild,ref:f,style:{pointerEvents:`none`},children:(0,I.jsx)(N.Fragment,{children:m?o:a},m?`placeholder`:`value`)})});fe.displayName=de;var pe=`SelectIcon`,me=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(p.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});me.displayName=pe;var he=`SelectPortal`,[ge,_e]=U(he,{forceMount:void 0}),ve=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(ge,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(h,{asChild:!0,...r})})};ve.displayName=he;var q=`SelectContent`,ye=N.forwardRef((e,t)=>{let n=_e(q,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=G(q,e.__scopeSelect),[o,s]=N.useState();return u(()=>{s(new DocumentFragment)},[]),(0,I.jsx)(f,{present:r||a.open,children:({present:e})=>e?(0,I.jsx)(we,{...i,ref:t}):(0,I.jsx)(be,{...i,fragment:o})})});ye.displayName=q;var be=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?P.createPortal((0,I.jsx)(xe,{scope:n,children:(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null});be.displayName=`SelectContentFragment`;var J=10,[xe,Y]=U(q),Se=`SelectContentImpl`,Ce=v(`SelectContent.RemoveScroll`),we=N.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=G(q,n),[E,D]=N.useState(null),[O,k]=N.useState(null),A=y(t,D),[j,ee]=N.useState(null),[te,ne]=N.useState(null),M=V(n),[P,F]=N.useState(!1),L=N.useRef(!1);N.useEffect(()=>{if(E)return g(E)},[E]),m();let R=N.useCallback(e=>{let[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,O]),z=N.useCallback(()=>R([j,E]),[R,j,E]);N.useEffect(()=>{P&&z()},[P,z]);let{onOpenChange:B,triggerPointerDownPosRef:H}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(H.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||B(!1),document.removeEventListener(`pointermove`,t),H.current=null};return H.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,B,H]),N.useEffect(()=>{let e=()=>B(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[B]);let[U,re]=nt(e=>{let t=M().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),W=N.useCallback((e,t,n)=>{let r=!L.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(L.current=!0))},[T.value]),ie=N.useCallback(()=>E?.focus(),[E]),ae=N.useCallback((e,t,n)=>{let r=!L.current&&!n;(T.value!==void 0&&T.value===t||r)&&ne(e)},[T.value]),K=r===`popper`?X:Ee,oe=K===X?{side:c,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,I.jsx)(xe,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:W,selectedItem:j,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:z,selectedItemText:te,position:r,isPositioned:P,searchRef:U,children:(0,I.jsx)(d,{as:Ce,allowPinchZoom:!0,children:(0,I.jsx)(l,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:s(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(K,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...oe,onPlaced:()=>F(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:s(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})});we.displayName=Se;var Te=`SelectItemAlignedPosition`,Ee=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=G(q,n),o=Y(q,n),[s,c]=N.useState(null),[l,d]=N.useState(null),f=y(t,d),m=V(n),h=N.useRef(!1),g=N.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=o,S=N.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&b){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-J,d=F(a,[J,Math.max(J,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-J,d=F(a,[J,Math.max(J,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-J*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),y=parseInt(d.paddingBottom,10),x=f+p+u+y+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-J,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${J}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,l,_,v,b,a.dir,r]);u(()=>S(),[S]);let[C,w]=N.useState();return u(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]),(0,I.jsx)(Oe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(p.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Ee.displayName=Te;var De=`SelectPopperPosition`,X=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=J,...a}=e,o=W(n);return(0,I.jsx)(D,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});X.displayName=De;var[Oe,ke]=U(q,{}),Ae=`SelectViewport`,je=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Y(Ae,n),o=ke(Ae,n),c=y(t,a.onViewportChange),l=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(p.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:s(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-J*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});je.displayName=Ae;var Me=`SelectGroup`,[Ne,Pe]=U(Me),Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=a();return(0,I.jsx)(Ne,{scope:n,id:i,children:(0,I.jsx)(p.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Fe.displayName=Me;var Ie=`SelectLabel`,Le=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Pe(Ie,n);return(0,I.jsx)(p.div,{id:i.id,...r,ref:t})});Le.displayName=Ie;var Z=`SelectItem`,[Re,ze]=U(Z),Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:c,...l}=e,u=G(Z,n),d=Y(Z,n),f=u.value===r,[m,h]=N.useState(c??``),[g,_]=N.useState(!1),v=y(t,o(e=>d.itemRefCallback?.(e,r,i))),b=a(),x=N.useRef(`touch`),S=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};return(0,I.jsx)(Re,{scope:n,value:r,disabled:i,textId:b,isSelected:f,onItemTextChange:N.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,I.jsx)(p.div,{role:`option`,"aria-labelledby":b,"data-highlighted":g?``:void 0,"aria-selected":f&&g,"data-state":f?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:s(l.onFocus,()=>_(!0)),onBlur:s(l.onBlur,()=>_(!1)),onClick:s(l.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:s(l.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:s(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:s(l.onPointerMove,e=>{x.current=e.pointerType,i?d.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:s(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:s(l.onKeyDown,e=>{i||e.target!==e.currentTarget||d.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Be.displayName=Z;var Q=`SelectItemText`,Ve=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,s=G(Q,n),c=Y(Q,n),l=ze(Q,n),d=K(Q,n),[f,m]=N.useState(null),h=o(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),g=y(t,m,l.onItemTextChange,h),_=f?.textContent,v=N.useMemo(()=>(0,I.jsx)(`option`,{value:l.value,disabled:l.disabled,children:_},l.value),[l.disabled,l.value,_]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=d;return u(()=>(b(v),()=>x(v)),[b,x,v]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(p.span,{id:l.textId,...a,ref:g}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!$(s.value)?P.createPortal(a.children,s.valueNode):null]})});Ve.displayName=Q;var He=`SelectItemIndicator`,Ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ze(He,n).isSelected?(0,I.jsx)(p.span,{"aria-hidden":!0,...r,ref:t}):null});Ue.displayName=He;var We=`SelectScrollUpButton`,Ge=N.forwardRef((e,t)=>{let n=Y(We,e.__scopeSelect),r=ke(We,e.__scopeSelect),[i,a]=N.useState(!1),o=y(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Je,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ge.displayName=We;var Ke=`SelectScrollDownButton`,qe=N.forwardRef((e,t)=>{let n=Y(Ke,e.__scopeSelect),r=ke(Ke,e.__scopeSelect),[i,a]=N.useState(!1),o=y(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Je,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});qe.displayName=Ke;var Je=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Y(`SelectScrollButton`,n),o=N.useRef(null),c=V(n),l=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>l(),[l]),u(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,I.jsx)(p.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:s(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:s(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:s(i.onPointerLeave,()=>{l()})})}),Ye=`SelectSeparator`,Xe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(p.div,{"aria-hidden":!0,...r,ref:t})});Xe.displayName=Ye;var Ze=`SelectArrow`,Qe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n);return Y(Ze,n).position===`popper`?(0,I.jsx)(T,{...i,...r,ref:t}):null});Qe.displayName=Ze;var $e=`SelectBubbleInput`,et=N.forwardRef(({__scopeSelect:e,...t},n)=>{let r=G($e,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,m=N.useRef(null),h=y(n,m),g=i??``,_=A(g),v=Array.from(d).some(e=>(e.props.value??``)===``);return N.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,I.jsxs)(p.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...k,...t.style},ref:h,defaultValue:g,children:[$(i)&&!v?(0,I.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});et.displayName=$e;function tt(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function nt(e){let t=o(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function rt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=it(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var at=ce,ot=fe;function st({className:e,children:t,...n}){return(0,I.jsxs)(ue,{className:b(`flex h-8 w-full cursor-pointer items-center justify-between gap-2 px-2.5 [&>span]:truncate`,O,e),...n,children:[t,(0,I.jsx)(me,{asChild:!0,children:(0,I.jsx)(ee,{className:`size-3.5 shrink-0 text-fg-muted`})})]})}function ct({className:e,children:t,position:n=`popper`,...r}){return(0,I.jsx)(ve,{children:(0,I.jsx)(ye,{position:n,sideOffset:4,className:b(`z-50 max-h-72 min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,e),...r,children:(0,I.jsx)(je,{children:t})})})}function lt({className:e,children:t,detail:n,...r}){return(0,I.jsxs)(Be,{className:b(C,E,`py-1.5 pl-7 pr-2`,e),...r,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(Ue,{children:(0,I.jsx)(M,{className:`size-3.5`})})}),(0,I.jsx)(Ve,{children:t}),n]})}export{ot as a,st as i,ct as n,lt as r,at as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{F as r}from"./auth-BxExwqPW.js";import{a as i,g as a,h as o,p as s}from"./es2015-CrC2hHeB.js";import{c,n as l}from"./x-DCpy1q13.js";import{u}from"./recipes-K5GH3Kht.js";import{t as d}from"./dist-BCwJL3w9.js";import{t as f}from"./createLucideIcon-DyMAgLa3.js";var p=f(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),m=f(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),h=f(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),g=f(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),_=f(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),v=e(t(),1),y=new Set;function b(e){let t=/^#settings\/([\w-]+)$/.exec(e);return t?t[1]:null}var x=b(window.location.hash);function S(){let e=x?`#settings/${x}`:``;window.location.hash!==e&&history.replaceState(null,``,window.location.pathname+window.location.search+e)}function C(e){if(e!==x){x=e;for(let e of y)e()}queueMicrotask(S)}window.addEventListener(`hashchange`,()=>C(b(window.location.hash))),window.addEventListener(`popstate`,()=>C(b(window.location.hash)));function w(){return(0,v.useSyncExternalStore)(e=>(y.add(e),()=>{y.delete(e)}),()=>x)}function T(e=`appearance`){C(e)}function E(){C(null)}function D(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}var O=` — `;function k(e){return e.replace(/\/+$/,``).split(`/`).pop()??``}function A(e){return{name:D(e),title:e.title??``,agentName:e.agent_title??``,sequence:e.osc_title??``,branch:e.branch,cwd:k(e.worktree_path),id:e.id.slice(0,8),status:e.status,agent:e.agent_type??``}}function j(e,t){let n=t&&t.length>0?t:r,i=A(e),a=[];for(let e of n.split(/(\$\{[a-zA-Z]+\})/)){if(e===``)continue;let t=/^\$\{([a-zA-Z]+)\}$/.exec(e)?.[1];t===void 0?a.push({text:e,sep:!1}):t===`separator`?a.push({text:O,sep:!0}):a.push({text:i[t]??e,sep:!1})}let o=[];a.forEach((e,t)=>{if(!e.sep){o.push(e.text);return}let n=o.join(``).trim().length>0,r=a.slice(t+1).some(e=>!e.sep&&e.text.trim().length>0);n&&r&&o.push(e.text)});let s=o.join(``).trim();return s.length>0?s:e.id.slice(0,8)}var M=n(),N=`Switch`,[P,F]=o(N),[I,L]=P(N);function R(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:a,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=i({prop:n,defaultProp:a??!1,onChange:l,caller:N}),[h,g]=v.useState(null),[_,y]=v.useState(null),b={checked:p,setChecked:m,disabled:o,control:h,setControl:g,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:v.useRef(!1),required:u,defaultChecked:a,isFormControl:!h||!!s||!!h.closest(`form`),bubbleInput:_,setBubbleInput:y};return(0,M.jsx)(I,{scope:t,...b,children:K(f)?f(b):r})}var z=`SwitchTrigger`,B=v.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:o,value:l,disabled:u,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:_}=L(z,e),y=c(r,p),b=v.useRef(d);return v.useEffect(()=>{let e=o?i?.ownerDocument.getElementById(o):i?.form;if(e instanceof HTMLFormElement){let t=()=>m(b.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,o,m]),(0,M.jsx)(s.button,{type:`button`,role:`switch`,"aria-checked":d,"aria-required":f,"data-state":q(d),"data-disabled":u?``:void 0,disabled:u,value:l,...n,ref:y,onClick:a(t,e=>{m(e=>!e),_&&g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});B.displayName=z;var V=v.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,M.jsx)(R,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(B,{...d,ref:t,__scopeSwitch:n}),e&&(0,M.jsx)(G,{__scopeSwitch:n})]})})});V.displayName=N;var H=`SwitchThumb`,U=v.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=L(H,n);return(0,M.jsx)(s.span,{"data-state":q(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});U.displayName=H;var W=`SwitchBubbleInput`,G=v.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:l,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=L(W,e),y=c(n,_),b=d(a),x=u(r);v.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(b!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[g,b,a,i]);let S=v.useRef(a);return(0,M.jsx)(s.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??S.current,required:l,disabled:f,name:p,value:m,form:h,...t,tabIndex:-1,ref:y,style:{...t.style,...x,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});G.displayName=W;function K(e){return typeof e==`function`}function q(e){return e?`checked`:`unchecked`}function J({className:e,...t}){return(0,M.jsx)(V,{className:l(`peer group/switch inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,M.jsx)(`span`,{className:`pointer-events-none inline-flex h-5 w-9 shrink-0 items-center rounded-full bg-border transition-colors group-hover/switch:bg-border/70 group-data-[state=checked]/switch:bg-action`,children:(0,M.jsx)(U,{className:`block size-4 rounded-full bg-ground shadow-sm transition-transform data-[state=checked]:translate-x-[1.125rem] data-[state=unchecked]:translate-x-0.5`})})})}export{w as a,h as c,T as i,m as l,j as n,_ as o,E as r,g as s,J as t,p as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{O as r}from"./auth-BxExwqPW.js";import{N as i,gt as a,j as o,k as s}from"./protocol-support-gmAQBWF3.js";import{a as c,c as l,g as u,h as d,o as f,p,s as ee,u as m}from"./es2015-CrC2hHeB.js";import{c as h,n as g,o as _}from"./x-DCpy1q13.js";import{a as v,c as te,l as y,o as ne,s as b}from"./recipes-K5GH3Kht.js";import{i as x}from"./dist-BCwJL3w9.js";import{t as S}from"./createLucideIcon-DyMAgLa3.js";import{n as re,s as ie}from"./switch-OD1b2aeq.js";import{a as C,n as ae,o as w}from"./preview-kind-CJ9RTgbs.js";import{t as oe}from"./debounce-B9DrqirV.js";var T=e(t(),1),E=n(),[D,se]=d(`Tooltip`,[y]),O=y(),ce=`TooltipProvider`,le=700,k=`tooltip.open`,[ue,A]=D(ce),de=e=>{let{__scopeTooltip:t,delayDuration:n=le,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=T.useRef(!0),s=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,E.jsx)(ue,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:T.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};de.displayName=ce;var j=`Tooltip`,[fe,M]=D(j),pe=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,u=A(j,e.__scopeTooltip),d=O(t),[f,p]=T.useState(null),ee=l(),m=T.useRef(0),h=o??u.disableHoverableContent,g=s??u.delayDuration,_=T.useRef(!1),[v,y]=c({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(k))):u.onClose(),a?.(e)},caller:j}),ne=T.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),b=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,y(!0)},[y]),x=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),S=T.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,y(!0),m.current=0},g)},[g,y]);return T.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,E.jsx)(te,{...d,children:(0,E.jsx)(fe,{scope:t,contentId:ee,open:v,stateAttribute:ne,trigger:f,onTriggerChange:p,onTriggerEnter:T.useCallback(()=>{u.isOpenDelayedRef.current?S():b()},[u.isOpenDelayedRef,S,b]),onTriggerLeave:T.useCallback(()=>{h?x():(window.clearTimeout(m.current),m.current=0)},[x,h]),onOpen:b,onClose:x,disableHoverableContent:h,children:n})})};pe.displayName=j;var N=`TooltipTrigger`,me=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=M(N,n),a=A(N,n),o=O(n),s=h(t,T.useRef(null),i.onTriggerChange),c=T.useRef(!1),l=T.useRef(!1),d=T.useCallback(()=>c.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,E.jsx)(v,{asChild:!0,...o,children:(0,E.jsx)(p.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:u(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:u(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:u(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:u(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:u(e.onBlur,i.onClose),onClick:u(e.onClick,i.onClose)})})});me.displayName=N;var P=`TooltipPortal`,[he,ge]=D(P,{forceMount:void 0}),_e=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(P,t);return(0,E.jsx)(he,{scope:t,forceMount:n,children:(0,E.jsx)(f,{present:n||a.open,children:(0,E.jsx)(ee,{asChild:!0,container:i,children:r})})})};_e.displayName=P;var F=`TooltipContent`,ve=T.forwardRef((e,t)=>{let n=ge(F,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(F,e.__scopeTooltip);return(0,E.jsx)(f,{present:r||o.open,children:o.disableHoverableContent?(0,E.jsx)(Ce,{side:i,...a,ref:t}):(0,E.jsx)(ye,{side:i,...a,ref:t})})}),ye=T.forwardRef((e,t)=>{let n=M(F,e.__scopeTooltip),r=A(F,e.__scopeTooltip),i=T.useRef(null),a=h(t,i),[o,s]=T.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=T.useCallback(()=>{s(null),d(!1)},[d]),p=T.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=De(r,Ee(r,n.getBoundingClientRect())),a=Oe(t.getBoundingClientRect()),o=Ae([...i,...a]);s(o),d(!0)},[d]);return T.useEffect(()=>()=>f(),[f]),T.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),T.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ke(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,E.jsx)(Ce,{...e,ref:a})}),[be,xe]=D(j,{isInside:!1}),Se=_(`TooltipContent`),Ce=T.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(F,n),l=O(n),{onClose:u}=c;return T.useEffect(()=>(document.addEventListener(k,u),()=>document.removeEventListener(k,u)),[u]),T.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,E.jsx)(m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,E.jsxs)(b,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,E.jsx)(Se,{children:r}),(0,E.jsx)(be,{scope:n,isInside:!0,children:(0,E.jsx)(x,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});ve.displayName=F;var we=`TooltipArrow`,Te=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=O(n);return xe(we,n).isInside?null:(0,E.jsx)(ne,{...i,...r,ref:t})});Te.displayName=we;function Ee(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function De(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Oe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ke(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ae(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),je(t)}function je(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Me=de,Ne=pe,Pe=me,Fe=_e,Ie=ve,Le=Me,Re=Ne,ze=Pe;function Be({className:e,sideOffset:t=4,...n}){return(0,E.jsx)(Fe,{children:(0,E.jsx)(Ie,{sideOffset:t,className:g(`z-50 overflow-hidden rounded-md bg-elevated px-2 py-1 text-xs text-fg shadow-lg`,e),...n})})}var Ve=S(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);function He({initial:e,maxLength:t,className:n,onCommit:r,onCancel:i}){let[a,o]=(0,T.useState)(e);return(0,E.jsx)(`input`,{autoFocus:!0,value:a,maxLength:t,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onBlur:()=>r(a),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(a):e.key===`Escape`&&i()},className:g(`bg-transparent outline-none`,n)})}function Ue(e){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:t=>{t.preventDefault(),e()}}}var I=null;function We(e){return I=e,()=>{I===e&&(I=null)}}function Ge(){I?.()}var L=null;function Ke(e){return L=e,()=>{L===e&&(L=null)}}async function qe(e){if(!L)throw Error(`Open a project before opening a path.`);await L(e)}function Je(){let e=a(s()??void 0).data?.tabTitleTemplate;return(0,T.useCallback)(t=>re(t,e),[e])}var Ye=(0,T.createContext)({open:()=>void 0,handler:null,setHandler:()=>void 0});function Xe({children:e}){let[t,n]=(0,T.useState)(null),r=(0,T.useCallback)(e=>n(()=>e),[]),i=(0,T.useCallback)(e=>t?.(e),[t]),a=(0,T.useMemo)(()=>({open:i,handler:t,setHandler:r}),[i,t,r]);return(0,E.jsx)(Ye.Provider,{value:a,children:e})}function Ze(){return(0,T.useContext)(Ye)}function Qe({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function $e({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6*t,"aria-hidden":!0,children:[(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function et({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`path`,{d:`M8 4H4v16h4`}),(0,E.jsx)(`path`,{d:`M16 4h4v16h-4`}),(0,E.jsx)(`rect`,{x:`10.5`,y:`10.5`,width:`3`,height:`3`,fill:`currentColor`,stroke:`none`})]})}function tt({className:e}){return(0,E.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,"aria-hidden":!0,children:(0,E.jsx)(`path`,{d:`M12 1.5c0 5.8 4.7 10.5 10.5 10.5C16.7 12 12 16.7 12 22.5 12 16.7 7.3 12 1.5 12 7.3 12 12 7.3 12 1.5Z`})})}function nt({type:e,className:t,strokeScale:n=1}){switch(e){case`claude-code`:return(0,E.jsx)(Qe,{className:t,strokeScale:n});case`codex`:return(0,E.jsx)($e,{className:t,strokeScale:n});case`opencode`:return(0,E.jsx)(et,{className:t,strokeScale:n});case`gemini-cli`:return(0,E.jsx)(tt,{className:t});default:return(0,E.jsx)(ie,{className:t,strokeWidth:2*n})}}var R=new Set,z=!1,rt=null;function it(){for(let e of R)e()}function at(e){return R.add(e),()=>R.delete(e)}function ot(e){z!==e&&(z=e,it())}function st(){ot(!z)}function ct(){return(0,T.useSyncExternalStore)(at,()=>z)}function lt(e){rt=e,it()}function ut(){return(0,T.useSyncExternalStore)(at,()=>rt)}function B(){return crypto.randomUUID()}function V(e){return e.type===`terminal`?`term:${e.session}`:`editor:${C(e.tab)}`}function H(e,t){return V(e)===V(t)}function dt(e){return e.type===`terminal`}function ft(e){return e.type===`editor`&&(e.tab.view===`linked`||e.tab.view===`locked`)}function U(e=[],t){let n=e.map(V),r=t&&n.includes(t)?t:n.length>0?n[0]:null;return{kind:`leaf`,id:B(),tabs:e,activeKey:r,previewKey:null}}function W(e,t,n){return{kind:`split`,id:B(),direction:e,children:t,sizes:n??t.map(()=>100/Math.max(1,t.length))}}function G(e,t){if(e.kind===`leaf`)return e.id===t?e:null;for(let n of e.children){let e=G(n,t);if(e)return e}return null}function K(e,t){if(e.kind===`leaf`)return e.tabs.some(e=>V(e)===t)?e:null;for(let n of e.children){let e=K(n,t);if(e)return e}return null}function q(e){return e.kind===`leaf`?[e]:e.children.flatMap(q)}function J(e){return q(e).flatMap(e=>e.tabs)}function pt(e){return e.kind===`leaf`?[e.id]:[e.id,...e.children.flatMap(pt)]}function mt(e){let t=pt(e);return new Set(t).size!==t.length}function ht(e){return e.kind===`leaf`?{...e,id:B()}:{...e,id:B(),children:e.children.map(ht)}}function gt(e){if(!mt(e))return e;let t=new Set,n=e=>{let r=t.has(e.id)?B():e.id;return t.add(r),e.kind===`leaf`?{...e,id:r}:{...e,id:r,children:e.children.map(n)}};return n(e)}function _t(e){let t=e.tabs.map(V),n=e.activeKey&&t.includes(e.activeKey)?e.activeKey:t[0]??null,r=e.previewKey&&t.includes(e.previewKey)?e.previewKey:null;return n===e.activeKey&&r===(e.previewKey??null)?e:{...e,activeKey:n,previewKey:r}}function Y(e){if(e.kind===`leaf`)return _t(e);let t=e.children.map(Y),n=[],r=[];t.forEach((t,i)=>{let a=e.sizes[i]??1;if(t.kind===`split`&&t.direction===e.direction){let e=t.sizes.reduce((e,t)=>e+t,0)||t.children.length;t.children.forEach((i,o)=>{n.push(i),r.push(a*(t.sizes[o]??1)/e)})}else n.push(t),r.push(a)});let i=[],a=[];return n.forEach((e,t)=>{e.kind===`leaf`&&e.tabs.length===0||(i.push(e),a.push(r[t]??1))}),i.length===0?U([]):i.length===1?i[0]:{...e,children:i,sizes:a}}function X(e,t,n){return e.kind===`leaf`?e.id===t?n(e):e:{...e,children:e.children.map(e=>X(e,t,n))}}function vt(e,t,n){return X(e,t,e=>{if(!e.tabs.some(e=>V(e)===n))return e;let t=e.tabs.filter(e=>V(e)!==n),r=e.activeKey===n?yt(e,n):e.activeKey;return{...e,tabs:t,activeKey:r}})}function yt(e,t){let n=e.tabs.findIndex(e=>V(e)===t);if(n===-1)return e.activeKey;let r=e.tabs.filter(e=>V(e)!==t);return r.length===0?null:V(r[Math.min(n,r.length-1)])}function bt(e,t,n){let r=e.tabs.filter(e=>!H(e,t)),i=n===void 0?r.length:Math.max(0,Math.min(n,r.length)),a=[...r.slice(0,i),t,...r.slice(i)];return{...e,tabs:a,activeKey:V(t)}}function xt(e,t,n,r){let i=n===`left`||n===`right`?`row`:`col`,a=n===`left`||n===`top`;return Y(X(e,t,e=>{let t=U([r]);return W(i,a?[t,e]:[e,t],[50,50])}))}function St(e,t){let{ref:n,toLeafId:r,edge:i}=t,a=V(n),o=t.copy===!0&&!dt(n),s=t.index;if(i===`center`&&s!==void 0){let t=G(e,r)?.tabs.findIndex(e=>V(e)===a)??-1;t!==-1&&t<s&&--s}let c=o?e:vt(e,t.fromLeafId,a);if(i===`center`){let e=X(c,r,e=>bt(e,n,s));return!G(e,r)&&!K(e,a)?Z(Y(Ct(e,n)),a):Z(Y(e),a)}return G(c,r)?Z(xt(c,r,i,n),a):Y(U([n]))}function Ct(e,t){let n=q(e)[0];return n?X(e,n.id,e=>bt(e,t)):U([t])}function wt(e,t,n){return Y(X(e,t,e=>e.tabs.some(e=>V(e)===n)?{...e,tabs:e.tabs.filter(e=>V(e)!==n),activeKey:e.activeKey===n?yt(e,n):e.activeKey}:e))}function Tt(e,t,n){let r=V(n);return Y(X(e,t,e=>{let t=e.previewKey===r?null:e.previewKey;return e.tabs.some(e=>H(e,n))?{...e,activeKey:r,previewKey:t}:{...e,tabs:[...e.tabs,n],activeKey:r,previewKey:t}}))}function Et(e,t,n){let r=V(n);return Y(X(e,t,e=>e.tabs.some(e=>V(e)===r)?{...e,tabs:e.tabs.map(e=>V(e)===r?n:e),previewKey:e.previewKey===r?null:e.previewKey}:{...e,tabs:[...e.tabs,n]}))}function Dt(e,t,n){let r=V(n);return X(e,t,e=>({...e,tabs:e.tabs.map(e=>V(e)===r?n:e)}))}function Ot(e,t,n){let r=C(t),i=e=>e.kind===`split`?{...e,children:e.children.map(i)}:{...e,tabs:e.tabs.map(e=>e.type===`editor`&&C(e.tab)===r?{...e,tab:{...e.tab,compile_mode:n}}:e)};return i(e)}function kt(e,t){return e.type!==`editor`||t.type!==`editor`||e.tab.view!==`preview`||t.tab.view!==void 0||ae(t.tab.path)===null?t:{...t,tab:{...t.tab,view:`preview`}}}function At(e,t,n){let r=V(n);return Y(X(e,t,e=>{if(e.tabs.some(e=>H(e,n)))return{...e,activeKey:r};let t=e.previewKey?e.tabs.findIndex(t=>V(t)===e.previewKey):-1,i=t>=0?e.tabs[t]:void 0,a=i!==void 0&&!dt(i)&&!ft(i),o=a?kt(i,n):n,s=a?e.tabs.map((e,n)=>n===t?o:e):[...e.tabs,o];return{...e,tabs:s,activeKey:r,previewKey:r}}))}function Z(e,t){let n=e=>e.kind===`leaf`?e.previewKey===t?{...e,previewKey:null}:e:{...e,children:e.children.map(n)};return n(e)}function jt(e,t,n,r){return X(e,t,e=>{let t=e.tabs.findIndex(e=>e.type===`editor`&&V(e)===n),i=t>=0?e.tabs[t]:void 0;if(i===void 0||i.type!==`editor`)return e;let a={...i,tab:{...i.tab,view:r}},o=V(a);if(o===n)return{...e,tabs:e.tabs.map((e,n)=>n===t?a:e)};let s=e.tabs.some((e,n)=>n!==t&&V(e)===o),c=s?e.tabs.filter((e,n)=>n!==t):e.tabs.map((e,n)=>n===t?a:e);return{...e,tabs:c,activeKey:e.activeKey===n?o:e.activeKey,previewKey:e.previewKey===n?s?null:o:e.previewKey??null}})}function Mt(e,t){let n=w(e);return n!==`commit`&&n!==`untitled`&&e.session===t.session&&e.path===t.path&&e.root===t.root}function Nt(e,t,n){if(n===t.path)return e;let r=!1,i=e=>{if(e.kind===`split`){let t=e.children.map(i);return t.some((t,n)=>t!==e.children[n])?{...e,children:t}:e}let a=new Map,o=!1,s=e.tabs.map(e=>{if(e.type!==`editor`||!Mt(e.tab,t))return e;let r={...e,tab:{...e.tab,path:n}};return a.set(V(e),V(r)),o=!0,r});if(!o)return e;r=!0;let c=e.activeKey,l=e.previewKey??null;return{...e,tabs:s,activeKey:c===null?null:a.get(c)??c,previewKey:l===null?null:a.get(l)??l}},a=i(e);return r?a:e}function Pt(e){if(e.type!==`editor`)return null;let t=e.tab,n=w(t);return n!==`file`&&n!==`external`||t.view===`linked`||t.view===`locked`||ae(t.path)===null?null:t}function Ft(e,t){let n=Pt(t);if(!n)return e;let r=!1,i=e=>{if(e.kind===`split`)return{...e,children:e.children.map(i)};let t=!1,a=e.tabs.map(e=>{if(e.type!==`editor`||!ft(e))return e;let r=e.tab;return r.session===n.session&&r.path===n.path&&(r.root??``)===(n.root??``)&&w(r)===w(n)?e:(t=!0,{type:`editor`,tab:{session:n.session,path:n.path,...n.kind===void 0?{}:{kind:n.kind},...n.root===void 0?{}:{root:n.root},view:r.view}})});return t?(r=!0,{...e,tabs:a}):e},a=i(e);return r?a:e}function It(e,t){return e.session===t.session&&e.path===t.path&&(e.root??``)===(t.root??``)&&w(e)===w(t)}function Lt(e,t,n){let r=q(e).flatMap(e=>e.tabs.flatMap(n=>n.type!==`editor`||n.tab.view===`linked`||n.tab.view===`locked`||!It(n.tab,t)?[]:[{leafId:e.id,ref:n}]));return r.find(({leafId:e})=>e===n)??r.find(({ref:e})=>(e.tab.view??`source`)===`source`)??r[0]??null}function Rt(e,t,n){return X(e,t,e=>e.tabs.some(e=>V(e)===n)?{...e,activeKey:n}:e)}function zt(e,t,n){function r(e){return e.kind===`leaf`?e:e.id===t&&n.length===e.children.length?{...e,children:e.children.map(r),sizes:[...n]}:{...e,children:e.children.map(r)}}return r(e)}function Bt(e){let t=e.type===`terminal`?e.session:e.tab.session;return t===`00000000-0000-0000-0000-000000000000`?null:t}function Vt(e){return t=>{let n=Bt(t);return n===null||e.has(n)}}function Q(e,t){let n=e=>e.kind===`leaf`?{...e,tabs:e.tabs.filter(t)}:{...e,children:e.children.map(n)};return Y(n(e))}function Ht(e){let t=new Set,n=[];for(let r of e){let e=Y(Q(r,e=>!t.has(V(e)))),i=J(e);if(i.length!==0){for(let e of i)t.add(V(e));n.push(e)}}return n.length===0?U([]):gt(n.length===1?n[0]:Y(W(`row`,n)))}function Ut(e){let t=e.editor_tabs.map(e=>({type:`editor`,tab:e})),n=e.session_tabs.map(e=>({type:`terminal`,session:e})),r=e.active_editor_tab?V({type:`editor`,tab:e.active_editor_tab}):null,i=e.active_session?`term:${e.active_session}`:null;if(t.length===0&&n.length===0)return U([]);if(t.length===0)return U(n,i);if(n.length===0)return U(t,r);let a=e.layout,o=typeof a.editor==`number`?a.editor:40,s=typeof a.session==`number`?a.session:60;return Y(W(`col`,[U(t,r),U(n,i)],[o,s]))}function Wt(e){return JSON.stringify(Gt(e))}function Gt(e){return e===null?null:e.kind===`leaf`?e.tabs.length===0?null:{t:e.tabs.map(V)}:{d:e.direction,s:e.sizes.map(e=>Math.round(e*10)/10),c:e.children.map(Gt)}}var Kt=new Set,$=!1,qt=null;function Jt(){for(let e of Kt)e()}function Yt(e){return Kt.add(e),()=>Kt.delete(e)}function Xt(e){$!==e&&($=e,Jt())}function Zt(){Xt(!$)}function Qt(){return(0,T.useSyncExternalStore)(Yt,()=>$)}function $t(e){qt=e,Jt()}function en(){return(0,T.useSyncExternalStore)(Yt,()=>qt)}var tn={layout_tree:null,active_session:null,layout_ref:null};function nn(e){return e.type===`terminal`?e.session:e.tab.session}function rn(e,t){let n=new Set;for(let[r,i]of Object.entries(e))if(!(r===t||!i.layout_tree))for(let e of J(i.layout_tree))e.type===`terminal`&&n.add(e.session);return[...n]}function an(e,t){let n=e.project_layouts[t];return{...e,layout_tree:n?.layout_tree??null,active_session:n?.active_session??null,layout_ref:n?.layout_ref??null,session_tabs:[],editor_tabs:[],active_editor_tab:null}}function on(e,t,n){return n?{loaded:e.loaded,snapshot:an(e.snapshot,t),current:()=>an(e.current(),t),update(n){let r={},i={...n};if(`layout_tree`in n&&(r.layout_tree=n.layout_tree??null,delete i.layout_tree),`active_session`in n&&(r.active_session=n.active_session??null,delete i.active_session),`layout_ref`in n&&(r.layout_ref=n.layout_ref??null,delete i.layout_ref),Object.keys(r).length>0){let n=e.current().project_layouts;i.project_layouts={...n,[t]:{...n[t]??tn,...r}}}Object.keys(i).length>0&&e.update(i)}}:e}function sn(e,t,n,r){let i=e.layout_tree??Ut(e),a={};for(let o of t)a[o]={layout_tree:ht(Q(i,e=>{let i=nn(e);return i===`00000000-0000-0000-0000-000000000000`?o===(r??t[0]):n.get(i)===o})),active_session:e.active_session!==null&&n.get(e.active_session)===o?e.active_session:null,layout_ref:null};return{layout_mode:`project`,project_layouts:a}}function cn(e,t,n={}){return{...e,...t,...n}}function ln(e,t,n){let r=t.layout_tree?Q(t.layout_tree,e=>{let t=nn(e);return t===`00000000-0000-0000-0000-000000000000`||n.alive.has(t)}):null,i=t.active_session!==null&&n.alive.has(t.active_session)?t.active_session:null;if(t.scope===`profile`)return{projectBased:!1,patch:{layout_mode:`profile`,layout_tree:r,active_session:i,layout_ref:t.id}};let a=t.project_id??n.currentProject??n.projectIds[0]??``,o={layout_tree:r,active_session:i,layout_ref:t.id};if((e.layout_mode??`profile`)===`project`)return{projectBased:!0,patch:{project_layouts:{...e.project_layouts,[a]:o}}};let s=sn(e,n.projectIds,n.sessionProject,a);return{projectBased:!0,patch:{...s,project_layouts:cn(s.project_layouts??{},e.project_layouts,{[a]:o})}}}function un(e,t){let n=e.project_layouts,r=[...t.filter(e=>e in n),...Object.keys(n).filter(e=>!t.includes(e))].map(e=>n[e]);return{layout_mode:`profile`,project_layouts:{},layout_tree:Ht(r.map(e=>e.layout_tree).filter(e=>e!==null)),active_session:r.map(e=>e.active_session).find(e=>e!==null)??null,layout_ref:null}}var dn=2e3,fn=r.parse({});function pn(e){return`puddle.ws.${e}`}function mn(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:r.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function hn(){let e=s(),[t,n]=(0,T.useState)(!1),[r,a]=(0,T.useState)(fn),c=(0,T.useRef)(r);c.current=r;let l=(0,T.useRef)(null),u=(0,T.useMemo)(()=>oe((e,t)=>{i(e,t).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},dn),[]);return(0,T.useEffect)(()=>{if(e===null){l.current=null;return}let t=pn(e);l.current=t;let r=!1;n(!1),a(fn);let i;try{i=mn(sessionStorage.getItem(t)),i.kind===`corrupt`&&sessionStorage.removeItem(t)}catch(e){console.warn(`ui-state read failed: ${e.message}`),i={kind:`absent`}}return i.kind===`present`?(a(i.snapshot),n(!0)):o(e).then(e=>{r||(e&&a(e.ui_state),n(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),r||n(!0)}),()=>{r=!0,u.flush()}},[e,u]),{loaded:t,snapshot:r,current:()=>c.current,update(t){if(e===null)return;let n={...c.current,...t};c.current=n,a(n);let r=l.current??pn(e);u(e,n);try{sessionStorage.setItem(r,JSON.stringify(n))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}export{We as $,At as A,Dt as B,St as C,K as D,Rt as E,Ft as F,ct as G,ot as H,Ot as I,Ze as J,nt as K,jt as L,Q as M,Nt as N,Pt as O,zt as P,Ge as Q,Lt as R,gt as S,J as T,st as U,lt as V,ut as W,qe as X,Je as Y,Ke as Z,Tt as _,cn as a,Le as at,Ut as b,sn as c,Xt as d,He as et,Zt as f,Et as g,Wt as h,ln as i,Be as it,Z as j,U as k,un as l,Qt as m,hn as n,Ve as nt,rn as o,ze as ot,en as p,Xe as q,pn as r,Re as rt,on as s,mn as t,Ue as tt,$t as u,q as v,G as w,wt as x,Vt as y,V as z};