tokentracker-cli 0.21.3 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.ja.md +457 -0
  2. package/README.ko.md +457 -0
  3. package/README.md +45 -6
  4. package/README.zh-CN.md +45 -6
  5. package/dashboard/dist/assets/{Card-Cv4wn6W8.js → Card-CD18G4Ge.js} +1 -1
  6. package/dashboard/dist/assets/DashboardPage-DKY_Mi9v.js +64 -0
  7. package/dashboard/dist/assets/DevicePage-BkavlAal.js +1 -0
  8. package/dashboard/dist/assets/{FadeIn-DjQyRfLZ.js → FadeIn-CVNJ4aZy.js} +1 -1
  9. package/dashboard/dist/assets/{HeaderGithubStar-D2BjLT1b.js → HeaderGithubStar-COu1Xy3I.js} +1 -1
  10. package/dashboard/dist/assets/{IpCheckPage-D0uvbHPe.js → IpCheckPage-B2HjZ3vY.js} +1 -1
  11. package/dashboard/dist/assets/{LandingPage-DGJcVAg7.js → LandingPage-9PSLFnys.js} +1 -1
  12. package/dashboard/dist/assets/{LeaderboardPage-Dnt_YLsP.js → LeaderboardPage-CQT5dBHU.js} +1 -1
  13. package/dashboard/dist/assets/{LeaderboardProfilePage-DM7S9_kG.js → LeaderboardProfilePage-aPP-Raey.js} +1 -1
  14. package/dashboard/dist/assets/{LimitsPage-COomwRa6.js → LimitsPage-eFrAHmoA.js} +2 -2
  15. package/dashboard/dist/assets/{LoginPage-k0k50kws.js → LoginPage-CczTNZ_P.js} +1 -1
  16. package/dashboard/dist/assets/{PopoverPopup-DctOj5-q.js → PopoverPopup-CEvWSWgZ.js} +2 -2
  17. package/dashboard/dist/assets/{ProviderIcon-DGlYzr9I.js → ProviderIcon-ewev19y3.js} +1 -1
  18. package/dashboard/dist/assets/SettingsPage-taBxq6ux.js +1 -0
  19. package/dashboard/dist/assets/SkillsPage-cqHO3rMB.js +1 -0
  20. package/dashboard/dist/assets/{WidgetsPage-DsMj8Qcz.js → WidgetsPage-B53b1hwG.js} +1 -1
  21. package/dashboard/dist/assets/WrappedPage-DwAhprTa.js +1 -0
  22. package/dashboard/dist/assets/check-JnFJsHgI.js +1 -0
  23. package/dashboard/dist/assets/{chevron-down-kcaroSaH.js → chevron-down-zOKEzHdv.js} +1 -1
  24. package/dashboard/dist/assets/{download-DKMK6oF8.js → download-BZZ4vKc1.js} +1 -1
  25. package/dashboard/dist/assets/{leaderboard-columns-BZ06dD2h.js → leaderboard-columns-BNGlMUsD.js} +1 -1
  26. package/dashboard/dist/assets/main-A_x5MMU-.css +1 -0
  27. package/dashboard/dist/assets/{main-DKVBnAOd.js → main-D0Irg9xR.js} +62 -17
  28. package/dashboard/dist/assets/{use-limits-display-prefs-Bx-K-27B.js → use-limits-display-prefs-BTuSZo27.js} +1 -1
  29. package/dashboard/dist/assets/{use-native-settings-DtuifRKC.js → use-native-settings-BPXVZrWe.js} +1 -1
  30. package/dashboard/dist/assets/{use-reduced-motion-Cen-UCKO.js → use-reduced-motion-HUOV_JD1.js} +1 -1
  31. package/dashboard/dist/assets/{use-usage-limits-CAWz6ijv.js → use-usage-limits-G6-vCBcN.js} +1 -1
  32. package/dashboard/dist/index.html +2 -2
  33. package/dashboard/dist/share.html +2 -2
  34. package/package.json +3 -2
  35. package/src/cli.js +11 -0
  36. package/src/commands/device-login.js +161 -0
  37. package/src/commands/status.js +199 -1
  38. package/src/commands/sync.js +85 -2
  39. package/src/commands/wrapped.js +150 -0
  40. package/src/lib/local-api.js +37 -2
  41. package/src/lib/passive-mode.js +185 -0
  42. package/src/lib/pricing/seed-snapshot.json +1 -1
  43. package/src/lib/rollout.js +913 -0
  44. package/src/lib/wrapped-aggregator.js +225 -0
  45. package/dashboard/dist/assets/DashboardPage-DsfcNgai.js +0 -1
  46. package/dashboard/dist/assets/SettingsPage-D2sqM9g_.js +0 -1
  47. package/dashboard/dist/assets/SkillsPage-B8K--edc.js +0 -1
  48. package/dashboard/dist/assets/main-DX38hz5f.css +0 -1
@@ -1 +1 @@
1
- import{D as l}from"./main-DKVBnAOd.js";function i({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function d({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:l.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function a({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function x({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function s({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function C({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function u({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function v({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:[l.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),l.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function g({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function f({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 64 60",fill:"none",className:t,"aria-hidden":"true",children:[l.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),l.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:l.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),l.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:l.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function w({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:l.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function j({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 16 16",fill:"currentColor",className:t,children:l.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function L({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:l.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:l.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function I({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[l.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),l.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),l.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),l.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),l.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),l.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function M({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[l.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),l.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),l.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}const p={CLAUDE:i,CODEBUDDY:f,CODEX:d,COPILOT:g,CRAFT:L,CURSOR:a,GEMINI:x,GITHUB:j,GROK:s,HERMES:w,KIMI:v,KIRO:C,OPENCODE:u,OMP:I,PI:M},m={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function O({provider:r,size:t=16,color:h,className:e=""}){const o=r?.toUpperCase?.()||"",c=m[o];if(c)return l.jsx("img",{src:c,alt:"",width:t,height:t,className:e,style:{width:t,height:t,objectFit:"contain"},"aria-hidden":!0});const n=p[o];return n?l.jsx(n,{size:t,className:e}):l.jsx("div",{className:"rounded-full shrink-0",style:{width:t*.5,height:t*.5,backgroundColor:h}})}export{O as P};
1
+ import{C as l}from"./main-D0Irg9xR.js";function i({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function d({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:l.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function a({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function x({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function s({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function C({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function u({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function v({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:[l.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),l.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function g({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:l.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function f({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 64 60",fill:"none",className:t,"aria-hidden":"true",children:[l.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),l.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:l.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),l.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:l.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function w({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:l.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function j({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 16 16",fill:"currentColor",className:t,children:l.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function L({size:r=16,className:t=""}){return l.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:l.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:l.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function I({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[l.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),l.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),l.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),l.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),l.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),l.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function M({size:r=16,className:t=""}){return l.jsxs("svg",{width:r,height:r,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[l.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),l.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),l.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}const p={CLAUDE:i,CODEBUDDY:f,CODEX:d,COPILOT:g,CRAFT:L,CURSOR:a,GEMINI:x,GITHUB:j,GROK:s,HERMES:w,KIMI:v,KIRO:C,OPENCODE:u,OMP:I,PI:M},m={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function O({provider:r,size:t=16,color:h,className:e=""}){const o=r?.toUpperCase?.()||"",c=m[o];if(c)return l.jsx("img",{src:c,alt:"",width:t,height:t,className:e,style:{width:t,height:t,objectFit:"contain"},"aria-hidden":!0});const n=p[o];return n?l.jsx(n,{size:t,className:e}):l.jsx("div",{className:"rounded-full shrink-0",style:{width:t*.5,height:t*.5,backgroundColor:h}})}export{O as P};
@@ -0,0 +1 @@
1
+ import{c as v,r as l,b as Y,f as J,am as G,C as n,F as P,a5 as x,B as s,Q as X,ab as ee,an as te,ac as ne,ad as ae,ae as A,ao as ie,ap as se,P as oe,R as re,O as le,D as ce,U as ue,aq as de,ar as ge,as as D,at as he,au as me,av as be,aw as pe}from"./main-D0Irg9xR.js";import{L as fe,a as L,u as ye}from"./use-limits-display-prefs-BTuSZo27.js";import{S as k,T as j,a as f,b as I,u as T}from"./use-native-settings-BPXVZrWe.js";import{C as xe}from"./check-JnFJsHgI.js";import{D as ve}from"./download-BZZ4vKc1.js";import"./Card-CD18G4Ge.js";const ke=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],je=v("copy",ke);const Ne=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Se=v("grip-vertical",Ne);const we=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],E=v("languages",we);const Ce=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ge=v("log-out",Ce);const Le=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ie=v("pencil",Le),Ee=e=>!e.isLayoutDirty&&e.willUpdate(!1);function O(){const e=new Set,t=new WeakMap,a=()=>e.forEach(Ee);return{add:i=>{e.add(i),t.set(i,i.addEventListener("willUpdate",a))},remove:i=>{e.delete(i);const o=t.get(i);o&&(o(),t.delete(i)),a()},dirty:a}}const Oe=l.createContext(null);function Pe(){const e=l.useRef(!1);return Y(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ae(){const e=Pe(),[t,a]=l.useState(0),i=l.useCallback(()=>{e.current&&a(t+1)},[t]);return[l.useCallback(()=>J.postRender(i),[i]),t]}const _=e=>e===!0,De=e=>_(e===!0)||e==="id",Te=({children:e,id:t,inherit:a=!0})=>{const i=l.useContext(G),o=l.useContext(Oe),[r,c]=Ae(),d=l.useRef(null),g=i.id||o;d.current===null&&(De(a)&&g&&(t=t?g+"-"+t:g),d.current={id:t,group:_(a)&&i.group||O()});const h=l.useMemo(()=>({...d.current,forceRender:r}),[c]);return n.jsx(G.Provider,{value:h,children:e})},_e=new Set(["cursor","kiro","copilot","kimi"]);function Me({checked:e,onChange:t,ariaLabel:a}){return n.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,onClick:t,className:x("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:n.jsx("span",{className:x("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}function Ue({prefs:e}){const{order:t,visibility:a,toggle:i,moveToward:o}=e,[r,c]=l.useState(null),[d,g]=l.useState(null),h=u=>m=>{c(u),m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",u)},b=u=>m=>{m.preventDefault(),m.dataTransfer.dropEffect="move",r&&r!==u&&d!==u&&(g(u),o(r,u))},p=()=>{c(null),g(null)},y=u=>{u.preventDefault(),c(null),g(null)};return n.jsx(Te,{children:n.jsx("div",{className:"flex flex-col",children:t.map(u=>{const m=a[u]!==!1,N=r===u;return n.jsxs(P.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:h(u),onDragOver:b(u),onDragEnd:p,onDrop:y,className:x("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",N&&"opacity-40"),style:{cursor:N?"grabbing":"grab"},children:[n.jsx(Se,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),n.jsx("img",{src:fe[u],alt:"",width:18,height:18,className:x("h-[18px] w-[18px] shrink-0 pointer-events-none",_e.has(u)&&"dark:invert"),draggable:!1}),n.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:L[u]}),n.jsx("div",{onMouseDown:S=>S.stopPropagation(),draggable:!1,children:n.jsx(Me,{checked:m,onChange:()=>i(u),ariaLabel:`${s("limits.settings.toggle_visible")}: ${L[u]}`})})]},u)})})})}function Re(e){if(!e||typeof e!="object")return"";const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},a=e.profile&&typeof e.profile=="object"?e.profile:{},i=t.full_name||t.name||a.name||t.user_name||t.preferred_username;return typeof i=="string"&&i.trim()?i.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function Be(e){return!e||typeof e!="object"?"":typeof e.email=="string"?e.email.trim():""}function Fe(e){const t=typeof e=="string"?e.trim():"";if(!t)return null;const a=t.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),i=t.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),o=a?.[1]||i?.[1];return o?`https://github.com/${o}`:null}function w(e,t){console.warn(`[tokentracker] settings ${e}:`,t)}function He(e,t,a){const[i,o]=l.useState(()=>ee()),r=t&&a&&te(),c=l.useCallback(async()=>{const d=!i;if(ne(d),o(d),!!d)try{await ae(()=>e())}catch(g){w("cloud sync",g)}},[i,e]);return{cloudSyncOn:i,handleCloudSyncToggle:c,showLocalCloudSync:r}}function ze(e){const[t,a]=l.useState(!1),[i,o]=l.useState(!1),[r,c]=l.useState(!1),[d,g]=l.useState(!1),[h,b]=l.useState(null),[p,y]=l.useState(!1),[u,m]=l.useState(""),[N,S]=l.useState(!1),[B,C]=l.useState(""),[F,H]=l.useState(""),[z,$]=l.useState(!1),[V,Z]=l.useState(null),W=l.useMemo(()=>Re(e),[e]),K=l.useMemo(()=>Be(e),[e]),q=l.useMemo(()=>typeof e?.id=="string"?e.id.trim():"",[e]),Q=l.useMemo(()=>({setAnonymousOn:o,setCustomDisplayName:b,setGithubUrl:C,setProfileLoading:c,setPublicProfileOn:a,setShowGithubOn:S}),[]);return{anonymousOn:i,customDisplayName:h,displayName:W,editingGithub:z,editingName:p,email:K,githubError:V,githubInput:F,githubUrl:B,loadSetters:Q,nameInput:u,profileLoading:r,profileSaving:d,publicProfileOn:t,setAnonymousOn:o,setCustomDisplayName:b,setEditingGithub:$,setEditingName:y,setGithubError:Z,setGithubInput:H,setGithubUrl:C,setNameInput:m,setProfileLoading:c,setProfileSaving:g,setPublicProfileOn:a,setShowGithubOn:S,showGithubOn:N,userId:q}}function $e(e,t,a){l.useEffect(()=>{if(!t)return;let i=!0;return a.setProfileLoading(!0),(async()=>{try{const o=await A({getAccessToken:e});if(!i||!o)return;const r=await ie({accessToken:o});if(!i)return;a.setPublicProfileOn(!!r?.enabled),a.setAnonymousOn(!!r?.anonymous),r?.display_name&&a.setCustomDisplayName(r.display_name),a.setShowGithubOn(!!r?.show_github_url),a.setGithubUrl(r?.github_url||"")}catch(o){w("load public profile",o)}finally{i&&a.setProfileLoading(!1)}})(),()=>{i=!1}},[e,t,a])}function Ve(e,t){return l.useCallback(async(a,{label:i,onError:o,onSuccess:r}={})=>{if(t.profileSaving)return!1;t.setProfileSaving(!0);try{const c=await A({getAccessToken:e});if(!c)return!1;const d=await se({accessToken:c,...a});return r?.(d),!0}catch(c){return o?o(c):w(i||"mutate profile",c),!1}finally{t.setProfileSaving(!1)}},[e,t])}function Ze(e,t){return{anonymousOn:e.anonymousOn,customDisplayName:e.customDisplayName,displayName:e.displayName,editingName:e.editingName,handleAnonymousToggle:t.handleAnonymousToggle,handleSaveName:t.handleSaveName,nameInput:e.nameInput,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingName:e.setEditingName,setNameInput:e.setNameInput,startEditingName:t.startEditingName}}function We(e,t){return{editingGithub:e.editingGithub,githubError:e.githubError,githubInput:e.githubInput,githubUrl:e.githubUrl,handleSaveGithub:t.handleSaveGithub,handleShowGithubToggle:t.handleShowGithubToggle,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingGithub:e.setEditingGithub,setGithubError:e.setGithubError,setGithubInput:e.setGithubInput,showGithubOn:e.showGithubOn,startEditingGithub:t.startEditingGithub}}function Ke(e,t){const a=l.useCallback(async()=>{const o=!e.publicProfileOn;await t({enabled:o},{label:"toggle public profile",onSuccess:()=>e.setPublicProfileOn(o)})},[t,e]);return{handleAnonymousToggle:l.useCallback(async()=>{const o=!e.anonymousOn;await t({anonymous:o},{label:"toggle anonymous",onSuccess:()=>e.setAnonymousOn(o)})},[t,e]),handlePublicProfileToggle:a}}function qe(e,t){const a=l.useCallback(async()=>{const o=e.nameInput.trim().slice(0,50);o&&await t({display_name:o},{label:"save display name",onSuccess:()=>{e.setCustomDisplayName(o),e.setEditingName(!1)}})},[t,e]),i=l.useCallback(()=>{e.setNameInput(e.customDisplayName||e.displayName),e.setEditingName(!0)},[e]);return{handleSaveName:a,startEditingName:i}}function Qe(e,t){const a=l.useCallback(async()=>{if(!e.showGithubOn&&!e.githubUrl){e.setEditingGithub(!0),e.setGithubInput(""),e.setGithubError(null);return}const r=!e.showGithubOn;await t({show_github_url:r},{label:"toggle GitHub profile",onSuccess:()=>e.setShowGithubOn(r)})},[t,e]),i=l.useCallback(async()=>{const r=Fe(e.githubInput);if(e.githubInput.trim()&&!r){e.setGithubError(s("settings.account.githubUrlInvalid"));return}e.setGithubError(null),await t({github_url:r,show_github_url:!!r},{label:"save GitHub profile",onError:c=>e.setGithubError(c?.message||s("settings.account.githubUrlInvalid")),onSuccess:c=>{e.setGithubUrl(c?.github_url||r||""),e.setShowGithubOn(!!r),e.setEditingGithub(!1)}})},[t,e]),o=l.useCallback(()=>{e.setGithubInput(e.githubUrl),e.setGithubError(null),e.setEditingGithub(!0)},[e]);return{handleSaveGithub:i,handleShowGithubToggle:a,startEditingGithub:o}}function Ye(){const e=X(),t=ze(e.user),a=He(e.getAccessToken,e.enabled,e.signedIn);$e(e.getAccessToken,e.signedIn,t.loadSetters);const i=Ve(e.getAccessToken,t),o=Ke(t,i),r=qe(t,i),c=Qe(t,i);return{...e,...a,email:t.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:t.userId,name:Ze(t,{...o,...r}),github:We(t,c),profileLoading:t.profileLoading,profileSaving:t.profileSaving,publicProfileOn:t.publicProfileOn}}function M({disabled:e,onCancel:t,onSave:a,saveLabel:i=s("settings.account.save")}){return n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:a,disabled:e,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:i}),n.jsx("button",{type:"button",onClick:t,className:"rounded-md px-2 py-1.5 text-xs text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:s("settings.account.cancel")})]})}function Je({nameInput:e,setEditingName:t,setNameInput:a,profileSaving:i,handleSaveName:o}){return n.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[n.jsx("input",{type:"text",value:e,onChange:r=>a(r.target.value),onKeyDown:r=>{r.key==="Enter"&&o(),r.key==="Escape"&&t(!1)},maxLength:50,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.displayName")}),n.jsx(M,{disabled:i||!e.trim(),onCancel:()=>t(!1),onSave:o,saveLabel:i?s("settings.account.saving"):void 0})]})}function Xe({githubError:e,githubInput:t,handleSaveGithub:a,profileSaving:i,setEditingGithub:o,setGithubError:r,setGithubInput:c}){return n.jsxs("div",{className:"mt-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"text",value:t,onChange:d=>{c(d.target.value),e&&r(null)},onKeyDown:d=>{d.key==="Enter"&&a(),d.key==="Escape"&&(o(!1),r(null))},maxLength:100,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.githubUrlPlaceholder")}),n.jsx(M,{disabled:i,onCancel:()=>{o(!1),r(null)},onSave:a,saveLabel:i?s("settings.account.saving"):void 0})]}),e?n.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:e}):null]})}function U({disabled:e=!1,label:t,onClick:a,title:i}){return n.jsxs("button",{type:"button",onClick:a,disabled:e,title:i,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(Ie,{className:"h-3.5 w-3.5","aria-hidden":!0}),t]})}function R({actions:e,editing:t,editor:a,hint:i,label:o}){return n.jsx("div",{className:"py-3",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:o}),t?a:n.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i})]}),t?null:e]})})}function et({name:e}){const t=e.anonymousOn?s("settings.account.displayNameDisabledWhileAnon"):void 0;return n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(U,{disabled:e.anonymousOn,label:s("settings.account.edit"),onClick:e.startEditingName,title:t}),n.jsx(j,{checked:!e.anonymousOn,onChange:e.handleAnonymousToggle,disabled:e.profileLoading||e.profileSaving,ariaLabel:s("settings.account.displayName")})]})}function tt({name:e}){const{anonymousOn:t,customDisplayName:a,displayName:i,editingName:o,handleAnonymousToggle:r,handleSaveName:c,nameInput:d,profileLoading:g,profileSaving:h,setEditingName:b,setNameInput:p,startEditingName:y}=e,u=t?s("settings.account.displayNameAnonymousHint"):a||i;return n.jsx(R,{label:s("settings.account.displayName"),editing:o,hint:u,editor:n.jsx(Je,{nameInput:d,setEditingName:b,setNameInput:p,profileSaving:h,handleSaveName:c}),actions:n.jsx(et,{name:e})})}function nt({github:e}){const{editingGithub:t,githubError:a,githubInput:i,githubUrl:o,handleSaveGithub:r,handleShowGithubToggle:c,profileLoading:d,profileSaving:g,setEditingGithub:h,setGithubError:b,setGithubInput:p,showGithubOn:y,startEditingGithub:u}=e;return n.jsx(R,{label:s("settings.account.githubUrl"),editing:t,hint:o||s("settings.account.githubUrlHint"),editor:n.jsx(Xe,{githubError:a,githubInput:i,handleSaveGithub:r,profileSaving:g,setEditingGithub:h,setGithubError:b,setGithubInput:p}),actions:n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(U,{label:s("settings.account.edit"),onClick:u}),n.jsx(j,{checked:y,onChange:c,disabled:d||g,ariaLabel:s("settings.account.githubUrl")})]})})}function at(){const{openLoginModal:e}=oe();return n.jsx(k,{title:s("settings.section.account"),children:n.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[n.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.account.signedOutHint")}),n.jsx("button",{type:"button",onClick:e,className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-oai-gray-900 px-4 text-xs font-medium text-white transition-colors hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100",children:s("settings.account.signIn")})]})})}function it({name:e,github:t}){return n.jsxs(n.Fragment,{children:[n.jsx(tt,{name:e}),n.jsx(nt,{github:t})]})}function st(){const e=Ye();return e.enabled?e.signedIn?n.jsxs(k,{title:s("settings.section.account"),subtitle:e.email||e.name.customDisplayName||e.name.displayName,action:n.jsx(rt,{onSignOut:e.signOut}),children:[n.jsx(ot,{userId:e.userId}),n.jsx(lt,{settings:e}),n.jsx(ct,{checked:e.publicProfileOn,disabled:e.profileLoading||e.profileSaving,onChange:e.handlePublicProfileToggle}),n.jsx(ut,{visible:e.publicProfileOn,name:e.name,github:e.github})]}):n.jsx(at,{}):null}function ot({userId:e}){const[t,a]=re.useState(!1);if(!e)return null;const i=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(e),a(!0),globalThis.setTimeout(()=>a(!1),1200)}catch{a(!1)}};return n.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:s("settings.account.userId")}),n.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e})]}),n.jsxs("button",{type:"button",onClick:i,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800","aria-label":s("settings.account.copyUserId"),children:[t?n.jsx(xe,{className:"h-3.5 w-3.5","aria-hidden":!0}):n.jsx(je,{className:"h-3.5 w-3.5","aria-hidden":!0}),t?s("settings.account.copied"):s("settings.account.copy")]})]})}function rt({onSignOut:e}){return n.jsxs("button",{type:"button",onClick:()=>e(),className:"inline-flex h-7 items-center gap-1.5 text-xs font-medium text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:[n.jsx(Ge,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.account.signOut")]})}function lt({settings:e}){return e.showLocalCloudSync?n.jsx(f,{label:s("settings.account.cloudSync"),hint:s("settings.account.cloudSyncHint"),control:n.jsx(j,{checked:e.cloudSyncOn,onChange:e.handleCloudSyncToggle,ariaLabel:s("settings.account.cloudSync")})}):null}function ct({checked:e,disabled:t,onChange:a}){return n.jsx(f,{label:s("settings.account.publicProfile"),hint:s("settings.account.publicProfileHint"),control:n.jsx(j,{checked:e,onChange:a,disabled:t,ariaLabel:s("settings.account.publicProfile")})})}function ut({visible:e,name:t,github:a}){return n.jsx(le,{initial:!1,children:e?n.jsx(P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:n.jsx(it,{name:t,github:a})},"public-profile-fields"):null})}function dt(){return[{value:"light",label:s("settings.appearance.theme.light"),Icon:de},{value:"dark",label:s("settings.appearance.theme.dark"),Icon:ge},{value:"system",label:s("settings.appearance.theme.system"),Icon:D}]}function gt(){return[{value:he,label:s("settings.appearance.language.system"),Icon:D},{value:me,label:s("settings.appearance.language.english"),Icon:E},{value:be,label:s("settings.appearance.language.chinese"),Icon:E}]}function ht(){const{theme:e,setTheme:t}=ce(),{locale:a,setLocale:i}=ue();return n.jsxs(k,{title:s("settings.section.appearance"),children:[n.jsx(f,{label:s("settings.appearance.theme.label"),hint:s("settings.appearance.theme.hint"),control:n.jsx(I,{options:dt(),value:e,onChange:t})}),n.jsx(f,{label:s("settings.appearance.language.label"),hint:s("settings.appearance.language.hint"),control:n.jsx(I,{options:gt(),value:a,onChange:i})})]})}function mt(){const{available:e,settings:t,setSetting:a,runAction:i}=T();if(!e)return null;const o=!!t?.launchAtLogin,r=t?.launchAtLoginSupported!==!1,c=t?.updateStatus||null,d=!!t?.updateBusy,g=!!t?.isSyncing;return n.jsxs(k,{title:s("settings.section.menubar"),children:[r?n.jsx(f,{label:s("settings.menubar.launchAtLogin"),hint:s("settings.menubar.launchAtLoginHint"),control:n.jsx(j,{checked:o,onChange:()=>a("launchAtLogin",!o),ariaLabel:s("settings.menubar.launchAtLogin")})}):null,n.jsx(f,{label:s("settings.menubar.syncNow"),hint:s("settings.menubar.syncNowHint"),control:n.jsxs("button",{type:"button",onClick:()=>i("syncNow"),disabled:g,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(pe,{className:x("h-3.5 w-3.5",g&&"animate-spin"),"aria-hidden":!0}),g?s("settings.menubar.syncing"):s("settings.menubar.syncNow")]})}),n.jsx(f,{label:s("settings.menubar.updates"),hint:c||void 0,control:n.jsxs("button",{type:"button",onClick:()=>i("checkForUpdates"),disabled:d,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(ve,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.menubar.checkUpdates")]})})]})}function bt(){const{available:e,settings:t,runAction:a}=T();return!e||!t?.version?null:n.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 text-[11px] text-oai-gray-500 dark:text-oai-gray-500",children:[n.jsxs("span",{children:["TokenTrackerBar v",t.version]}),n.jsx("span",{"aria-hidden":!0,children:"·"}),n.jsx("button",{type:"button",onClick:()=>a("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"})]})}function jt(){const e=ye();return n.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:n.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:n.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:s("settings.page.title")}),n.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.page.subtitle")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(ht,{}),n.jsx(mt,{}),n.jsx(st,{}),n.jsx(k,{title:s("settings.section.limits"),children:n.jsx(Ue,{prefs:e})})]}),n.jsx(bt,{})]})})})}export{jt as SettingsPage};
@@ -0,0 +1 @@
1
+ import{c as St,r as n,C as r,a7 as yr,H as Le,a5 as Ue,X as Nt,B as S,O as Qr,F as rr,ax as Zr,aw as en,R as tn}from"./main-D0Irg9xR.js";import{C as rn}from"./Card-CD18G4Ge.js";import{A as Wt,s as Me,n as lt,o as Be,p as ze,q as nr,r as br,t as $e,v as nn,w as an,x as ee,y as sn,z as Ne,B as on,E as ar,F as ln,G as st,c as Ee,H as At,J as sr,K as cn,M as wr,N as dn,O as un,Q as Ge,R as Ft,S as Xe,T as Ve,U as yt,V as bt,W as fn,X as fe,Y as qt,Z as gn,_ as $t,$ as B,a0 as Rt,a1 as mn,a2 as hn,a3 as pn,a4 as xn,a5 as Gt,a6 as Yt,a7 as kr,a8 as vr,a9 as Ct,aa as yn,ab as bn,a as Xt,b as De,ac as wn,ad as Ht,ae as kn,af as vn,ag as jn,ah as Sn,ai as Nn,aj as Rn,ak as Cn,al as In,am as jr,an as Mn,ao as En,ap as or,aq as Tn,ar as Pn,as as On,at as Jt,au as An,av as _n,aw as _t,u as Vn,D as Ln,e as Dn,f as Fn,g as $n,h as Hn,i as Un,I as Bn,L as Ke,P as zn,j as Kn,k as Wn,l as qn,m as Gn,C as Yn}from"./PopoverPopup-CEvWSWgZ.js";import{P as tt}from"./ProviderIcon-ewev19y3.js";import{C as Ye}from"./check-JnFJsHgI.js";import{u as Xn}from"./use-reduced-motion-HUOV_JD1.js";import{C as Sr}from"./chevron-down-zOKEzHdv.js";import{D as Jn}from"./download-BZZ4vKc1.js";const Qn=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ut=St("external-link",Qn);const Zn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Nr=St("plus",Zn);const ea=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ir=St("search",ea);const ta=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Rr=St("trash-2",ta);function ra(e){const t=n.useRef(!0);t.current&&(t.current=!1,e())}function Bt({controlled:e,default:t,name:a,state:s="value"}){const{current:u}=n.useRef(e!==void 0),[o,c]=n.useState(t),l=u?e:o,p=n.useCallback(y=>{u||c(y)},[]);return[l,p]}function gt(e,t,a){return Math.floor(e/t)!==a}function ot(e,t){return t<0||t>=e.current.length}function Vt(e,t){return Ie(e,{disabledIndices:t})}function lr(e,t){return Ie(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ie(e,{startingIndex:t=-1,decrement:a=!1,disabledIndices:s,amount:u=1}={}){let o=t;do o+=a?-u:u;while(o>=0&&o<=e.current.length-1&&it(e,o,s));return o}function na(e,{event:t,orientation:a,loopFocus:s,rtl:u,cols:o,disabledIndices:c,minIndex:l,maxIndex:p,prevIndex:y,stopEvent:f=!1}){let m=y;const h=[],T={};let x=!1;{let d=null,E=-1;e.current.forEach((b,j)=>{if(b==null)return;const A=b.closest('[role="row"]');A&&(x=!0),(A!==d||E===-1)&&(d=A,E+=1,h[E]=[]),h[E].push(j),T[j]=E})}const k=x&&h.length>0&&h.some(d=>d.length!==o);function M(d){if(!k||y===-1)return;const E=T[y];if(E==null)return;const b=h[E].indexOf(y);let j=d==="up"?E-1:E+1;s&&(j<0?j=h.length-1:j>=h.length&&(j=0));const A=new Set;for(;j>=0&&j<h.length&&!A.has(j);){A.add(j);const V=h[j];if(V.length===0){j=d==="up"?j-1:j+1;continue}const Q=Math.min(b,V.length-1);for(let _=Q;_>=0;_-=1){const te=V[_];if(!it(e,te,c))return te}j=d==="up"?j-1:j+1,s&&(j<0?j=h.length-1:j>=h.length&&(j=0))}}if(t.key===Wt){const d=M("up");if(d!==void 0)f&&Me(t),m=d;else{if(f&&Me(t),y===-1)m=p;else if(m=Ie(e,{startingIndex:m,amount:o,decrement:!0,disabledIndices:c}),s&&(y-o<l||m<0)){const E=y%o,b=p%o,j=p-(b-E);b===E?m=p:m=b>E?j:j-o}ot(e,m)&&(m=y)}}if(t.key===lt){const d=M("down");d!==void 0?(f&&Me(t),m=d):(f&&Me(t),y===-1?m=l:(m=Ie(e,{startingIndex:y,amount:o,disabledIndices:c}),s&&y+o>p&&(m=Ie(e,{startingIndex:y%o-o,amount:o,disabledIndices:c}))),ot(e,m)&&(m=y))}if(a==="both"){const d=nr(y/o);t.key===(u?Be:ze)&&(f&&Me(t),y%o!==o-1?(m=Ie(e,{startingIndex:y,disabledIndices:c}),s&&gt(m,o,d)&&(m=Ie(e,{startingIndex:y-y%o-1,disabledIndices:c}))):s&&(m=Ie(e,{startingIndex:y-y%o-1,disabledIndices:c})),gt(m,o,d)&&(m=y)),t.key===(u?ze:Be)&&(f&&Me(t),y%o!==0?(m=Ie(e,{startingIndex:y,decrement:!0,disabledIndices:c}),s&&gt(m,o,d)&&(m=Ie(e,{startingIndex:y+(o-y%o),decrement:!0,disabledIndices:c}))):s&&(m=Ie(e,{startingIndex:y+(o-y%o),decrement:!0,disabledIndices:c})),gt(m,o,d)&&(m=y));const E=nr(p/o)===d;ot(e,m)&&(s&&E?m=t.key===(u?ze:Be)?p:Ie(e,{startingIndex:y-y%o-1,disabledIndices:c}):m=y)}return m}function aa(e,t,a){const s=[];let u=0;return e.forEach(({width:o,height:c},l)=>{let p=!1;for(a&&(u=0);!p;){const y=[];for(let f=0;f<o;f+=1)for(let m=0;m<c;m+=1)y.push(u+f+m*t);u%t+o<=t&&y.every(f=>s[f]==null)?(y.forEach(f=>{s[f]=l}),p=!0):u+=1}}),[...s]}function sa(e,t,a,s,u){if(e===-1)return-1;const o=a.indexOf(e),c=t[e];switch(u){case"tl":return o;case"tr":return c?o+c.width-1:o;case"bl":return c?o+(c.height-1)*s:o;case"br":return a.lastIndexOf(e);default:return-1}}function oa(e,t){return t.flatMap((a,s)=>e.includes(a)?[s]:[])}function it(e,t,a){if(typeof a=="function")return a(t);if(a)return a.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}const ia="Escape";function It(e,t,a){switch(e){case"vertical":return t;case"horizontal":return a;default:return t||a}}function mt(e,t){return It(t,e===Wt||e===lt,e===Be||e===ze)}function Lt(e,t,a){return It(t,e===lt,a?e===Be:e===ze)||e==="Enter"||e===" "||e===""}function la(e,t,a){return It(t,a?e===Be:e===ze,e===lt)}function ca(e,t,a,s){const u=a?e===ze:e===Be,o=e===Wt;return t==="both"||t==="horizontal"&&s&&s>1?e===ia:It(t,u,o)}function da(e,t){const a="rootStore"in e?e.rootStore:e,s=a.useState("open"),u=a.useState("floatingElement"),o=a.useState("domReferenceElement"),c=a.context.dataRef,{listRef:l,activeIndex:p,onNavigate:y=()=>{},enabled:f=!0,selectedIndex:m=null,allowEscape:h=!1,loopFocus:T=!1,nested:x=!1,rtl:k=!1,virtual:M=!1,focusItemOnOpen:d="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:b=!0,disabledIndices:j=void 0,orientation:A="vertical",parentOrientation:V,cols:Q=1,scrollItemIntoView:_=!0,itemSizes:te,dense:ye=!1,id:X,resetOnPointerLeave:Z=!0,externalTree:K}=t,ge=br(u),W=$e(ge),D=nn(),ae=an(K);ee(()=>{c.current.orientation=A},[c,A]);const R=sn(o),H=n.useRef(d),C=n.useRef(m??-1),v=n.useRef(null),de=n.useRef(!0),P=Ne(g=>{y(C.current===-1?null:C.current,g)}),oe=n.useRef(P),J=n.useRef(!!u),I=n.useRef(s),U=n.useRef(!1),be=n.useRef(!1),ke=$e(j),F=$e(s),xe=$e(_),re=$e(m),we=$e(Z),me=Ne(()=>{function g(i){M?ae?.events.emit("virtualfocus",i):on(i,{sync:U.current,preventScroll:!0})}const L=l.current[C.current],N=be.current;L&&g(L),(U.current?i=>i():requestAnimationFrame)(()=>{const i=l.current[C.current]||L;if(!i)return;L||g(i);const w=xe.current;w&&q&&(N||!de.current)&&i.scrollIntoView?.(typeof w=="boolean"?{block:"nearest",inline:"nearest"}:w)})});ee(()=>{f&&(s&&u?(C.current=m??-1,H.current&&m!=null&&(be.current=!0,P())):J.current&&(C.current=-1,oe.current()))},[f,s,u,m,P]),ee(()=>{if(f){if(!s){U.current=!1;return}if(u)if(p==null){if(U.current=!1,re.current!=null)return;if(J.current&&(C.current=-1,me()),(!I.current||!J.current)&&H.current&&(v.current!=null||H.current===!0&&v.current==null)){let g=0;const L=()=>{l.current[0]==null?(g<2&&(g?requestAnimationFrame:queueMicrotask)(L),g+=1):(C.current=v.current==null||Lt(v.current,A,k)||x?Vt(l):lr(l),v.current=null,P())};L()}}else ot(l,p)||(C.current=p,me(),be.current=!1)}},[f,s,u,p,re,x,l,A,k,P,me,ke]),ee(()=>{if(!f||u||!ae||M||!J.current)return;const g=ae.nodesRef.current,L=g.find(i=>i.id===D)?.context?.elements.floating,N=ar(ln(u)),G=g.some(i=>i.context&&st(i.context.elements.floating,N));L&&!G&&de.current&&L.focus({preventScroll:!0})},[f,u,ae,D,M]),ee(()=>{oe.current=P,I.current=s,J.current=!!u}),ee(()=>{s||(v.current=null,H.current=d)},[s,d]);const ue=p!=null,q=n.useMemo(()=>{function g(N){if(!F.current)return;const G=l.current.indexOf(N.currentTarget);G!==-1&&C.current!==G&&(C.current=G,P(N))}return{onFocus(N){U.current=!0,g(N)},onClick:({currentTarget:N})=>N.focus({preventScroll:!0}),onMouseMove(N){U.current=!0,be.current=!1,E&&g(N)},onPointerLeave(N){if(!F.current||!de.current||N.pointerType==="touch")return;U.current=!0;const G=N.relatedTarget;!E||l.current.includes(G)||we.current&&(C.current=-1,P(N),M||W.current?.focus({preventScroll:!0}))}}},[F,W,E,l,P,we,M]),ne=n.useCallback(()=>V??ae?.nodesRef.current.find(g=>g.id===D)?.context?.dataRef?.current.orientation,[D,ae,V]),ve=Ne(g=>{if(de.current=!1,U.current=!0,g.which===229||!F.current&&g.currentTarget===W.current)return;if(x&&ca(g.key,A,k,Q)){mt(g.key,ne())||Me(g),a.setOpen(!1,Ee(At,g.nativeEvent)),sr(o)&&(M?ae?.events.emit("virtualfocus",o):o.focus());return}const L=C.current,N=Vt(l,j),G=lr(l,j);if(R||(g.key==="Home"&&(Me(g),C.current=N,P(g)),g.key==="End"&&(Me(g),C.current=G,P(g))),Q>1){const i=te||Array.from({length:l.current.length},()=>({width:1,height:1})),w=aa(i,Q,ye),O=w.findIndex(ce=>ce!=null&&!it(l,ce,j)),Y=w.reduce((ce,pe,Re)=>pe!=null&&!it(l,pe,j)?Re:ce,-1),le=w[na({current:w.map(ce=>ce!=null?l.current[ce]:null)},{event:g,orientation:A,loopFocus:T,rtl:k,cols:Q,disabledIndices:oa([...(typeof j!="function"?j:null)||l.current.map((ce,pe)=>it(l,pe,j)?pe:void 0),void 0],w),minIndex:O,maxIndex:Y,prevIndex:sa(C.current>G?N:C.current,i,w,Q,g.key===lt?"bl":g.key===(k?Be:ze)?"tr":"tl"),stopEvent:!0})];if(le!=null&&(C.current=le,P(g)),A==="both")return}if(mt(g.key,A)){if(Me(g),s&&!M&&ar(g.currentTarget.ownerDocument)===g.currentTarget){C.current=Lt(g.key,A,k)?N:G,P(g);return}Lt(g.key,A,k)?T?L>=G?h&&L!==l.current.length?C.current=-1:(U.current=!1,C.current=N):C.current=Ie(l,{startingIndex:L,disabledIndices:j}):C.current=Math.min(G,Ie(l,{startingIndex:L,disabledIndices:j})):T?L<=N?h&&L!==-1?C.current=l.current.length:(U.current=!1,C.current=G):C.current=Ie(l,{startingIndex:L,decrement:!0,disabledIndices:j}):C.current=Math.max(N,Ie(l,{startingIndex:L,decrement:!0,disabledIndices:j})),ot(l,C.current)&&(C.current=-1),P(g)}}),se=n.useMemo(()=>M&&s&&ue&&{"aria-activedescendant":`${X}-${p}`},[M,s,ue,X,p]),ie=n.useMemo(()=>({"aria-orientation":A==="both"?void 0:A,...R?{}:se,onKeyDown(g){if(g.key==="Tab"&&g.shiftKey&&s&&!M){const L=cn(g.nativeEvent);if(L&&!st(W.current,L))return;Me(g),a.setOpen(!1,Ee(wr,g.nativeEvent)),sr(o)&&o.focus();return}ve(g)},onPointerMove(){de.current=!0}}),[se,ve,W,A,R,a,s,M,o]),Ce=n.useMemo(()=>{function g(N){d==="auto"&&dn(N.nativeEvent)&&(H.current=!M)}function L(N){H.current=d,d==="auto"&&un(N.nativeEvent)&&(H.current=!0)}return{onKeyDown(N){const G=a.select("open");de.current=!1;const i=N.key.startsWith("Arrow"),w=la(N.key,ne(),k),O=mt(N.key,A),Y=(x?w:O)||N.key==="Enter"||N.key.trim()==="";if(M&&G)return ve(N);if(!(!G&&!b&&i)){if(Y){const le=mt(N.key,ne());v.current=x&&le?null:N.key}if(x){w&&(Me(N),G?(C.current=Vt(l,ke.current),P(N)):a.setOpen(!0,Ee(At,N.nativeEvent,N.currentTarget)));return}O&&(re.current!=null&&(C.current=re.current),Me(N),!G&&b?a.setOpen(!0,Ee(At,N.nativeEvent,N.currentTarget)):ve(N),G&&P(N))}},onFocus(N){a.select("open")&&!M&&(C.current=-1,P(N))},onPointerDown:L,onPointerEnter:L,onMouseDown:g,onClick:g}},[ve,ke,d,l,x,P,a,b,A,ne,k,re,M]),he=n.useMemo(()=>({...se,...Ce}),[se,Ce]);return n.useMemo(()=>f?{reference:he,floating:ie,item:q,trigger:Ce}:{},[f,he,ie,Ce,q])}function ua(e,t){const a="rootStore"in e?e.rootStore:e,s=a.useState("open"),u=a.context.dataRef,{listRef:o,activeIndex:c,onMatch:l,onTypingChange:p,enabled:y=!0,findMatch:f=null,resetMs:m=750,ignoreKeys:h=Ft,selectedIndex:T=null}=t,x=Ge(),k=n.useRef(""),M=n.useRef(T??c??-1),d=n.useRef(null);ee(()=>{s&&(x.clear(),d.current=null,k.current="")},[s,x]),ee(()=>{s&&k.current===""&&(M.current=T??c??-1)},[s,T,c]);const E=Ne(V=>{V?u.current.typing||(u.current.typing=V,p?.(V)):u.current.typing&&(u.current.typing=V,p?.(V))}),b=Ne(V=>{function Q(Z,K,ge){const W=f?f(K,ge):K.find(D=>D?.toLocaleLowerCase().indexOf(ge.toLocaleLowerCase())===0);return W?Z.indexOf(W):-1}const _=o.current;if(k.current.length>0&&k.current[0]!==" "&&(Q(_,_,k.current)===-1?E(!1):V.key===" "&&Me(V)),_==null||h.includes(V.key)||V.key.length!==1||V.ctrlKey||V.metaKey||V.altKey)return;s&&V.key!==" "&&(Me(V),E(!0)),_.every(Z=>Z?Z[0]?.toLocaleLowerCase()!==Z[1]?.toLocaleLowerCase():!0)&&k.current===V.key&&(k.current="",M.current=d.current),k.current+=V.key,x.start(m,()=>{k.current="",M.current=d.current,E(!1)});const ye=M.current,X=Q(_,[..._.slice((ye||0)+1),..._.slice(0,(ye||0)+1)],k.current);X!==-1?(l?.(X),d.current=X):V.key!==" "&&(k.current="",E(!1))}),j=n.useMemo(()=>({onKeyDown:b}),[b]),A=n.useMemo(()=>({onKeyDown:b,onKeyUp(V){V.key===" "&&E(!1)}}),[b,E]);return n.useMemo(()=>y?{reference:j,floating:A}:{},[y,j,A])}const Cr=n.createContext(null),Ir=n.createContext(null);function We(){const e=n.useContext(Cr);if(e===null)throw new Error(Xe(60));return e}function Mr(){const e=n.useContext(Ir);if(e===null)throw new Error(Xe(61));return e}let cr=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const fa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Qt={valid(e){return e===null?null:e?{[cr.valid]:""}:{[cr.invalid]:""}}},ga=n.createContext({invalid:void 0,name:void 0,validityData:{state:fa,errors:[],error:"",value:"",initialValue:null},setValidityData:Ve,disabled:void 0,touched:!1,setTouched:Ve,dirty:!1,setDirty:Ve,filled:!1,setFilled:Ve,focused:!1,setFocused:Ve,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=yt)=>e,getInputValidationProps:(e=yt)=>e,inputRef:{current:null},commit:async()=>{}}});function Mt(e=!0){const t=n.useContext(ga);if(t.setValidityData===Ve&&!e)throw new Error(Xe(28));return t}const ma=n.createContext({controlId:void 0,setControlId:Ve,labelId:void 0,setLabelId:Ve,messageIds:[],setMessageIds:Ve,getDescriptionProps:e=>e});function Zt(){return n.useContext(ma)}function Er(e={}){const{id:t,implicit:a=!1,controlRef:s}=e,{controlId:u,setControlId:o}=Zt(),c=bt(t);return ee(()=>{if(!(!a&&!t||o===Ve)){if(a){const l=s?.current;fn(l)&&l.closest("label")!=null?o(t??null):o(u??c)}else t&&o(t);return()=>{t&&o(void 0)}}},[t,s,u,o,a,c]),u??c}const ha=(e,t)=>Object.is(e,t);function rt(e,t,a){return e==null||t==null?Object.is(e,t):a(e,t)}function Dt(e,t,a){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:rt(s,t,a))}function zt(e,t,a){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:rt(s,t,a))}function pa(e,t,a){return e.filter(s=>!rt(s,t,a))}function Kt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Tr(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function xa(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Tr(e)){for(const t of e)for(const a of t.items)if(a&&a.value==null&&a.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function ya(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Kt(e)}function et(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Kt(e.value):Kt(e)}function Pr(e,t,a){function s(){return ya(e,a)}if(a&&e!=null)return a(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??s();if(Array.isArray(t)){const u=Tr(t)?t.flatMap(o=>o.items):t;if(e==null||typeof e!="object"){const o=u.find(c=>c.value===e);return o&&o.label!=null?o.label:s()}if("value"in e){const o=u.find(c=>c&&c.value===e.value);if(o&&o.label!=null)return o.label}}return s()}function ba(e,t,a){return e.reduce((s,u,o)=>(o>0&&s.push(", "),s.push(r.jsx(n.Fragment,{children:Pr(u,t,a)},o)),s),[])}const $={id:fe(e=>e.id),modal:fe(e=>e.modal),multiple:fe(e=>e.multiple),items:fe(e=>e.items),itemToStringLabel:fe(e=>e.itemToStringLabel),itemToStringValue:fe(e=>e.itemToStringValue),isItemEqualToValue:fe(e=>e.isItemEqualToValue),value:fe(e=>e.value),hasSelectedValue:fe(e=>{const{value:t,multiple:a,itemToStringValue:s}=e;return t==null?!1:a&&Array.isArray(t)?t.length>0:et(t,s)!==""}),hasNullItemLabel:fe((e,t)=>t?xa(e.items):!1),open:fe(e=>e.open),mounted:fe(e=>e.mounted),forceMount:fe(e=>e.forceMount),transitionStatus:fe(e=>e.transitionStatus),openMethod:fe(e=>e.openMethod),activeIndex:fe(e=>e.activeIndex),selectedIndex:fe(e=>e.selectedIndex),isActive:fe((e,t)=>e.activeIndex===t),isSelected:fe((e,t,a)=>{const s=e.isItemEqualToValue,u=e.value;return e.multiple?Array.isArray(u)&&u.some(o=>rt(o,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:rt(u,a,s)}),isSelectedByFocus:fe((e,t)=>e.selectedIndex===t),popupProps:fe(e=>e.popupProps),triggerProps:fe(e=>e.triggerProps),triggerElement:fe(e=>e.triggerElement),positionerElement:fe(e=>e.positionerElement),listElement:fe(e=>e.listElement),scrollUpArrowVisible:fe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:fe(e=>e.scrollDownArrowVisible),hasScrollArrows:fe(e=>e.hasScrollArrows)},wa=n.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ve,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function er(){return n.useContext(wa)}function ka(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Or(e){const{enabled:t=!0,value:a,id:s,name:u,controlRef:o,commit:c}=e,{formRef:l}=er(),{invalid:p,markedDirtyRef:y,validityData:f,setValidityData:m}=Mt(),h=Ne(e.getValue);ee(()=>{if(!t)return;let T=a;T===void 0&&(T=h()),f.initialValue===null&&T!==null&&m(x=>({...x,initialValue:T}))},[t,m,a,f.initialValue,h]),ee(()=>{!t||!s||l.current.fields.set(s,{getValue:h,name:u,controlRef:o,validityData:ka(f,p),validate(T=!0){let x=a;x===void 0&&(x=h()),y.current=!0,T?yr.flushSync(()=>c(x)):c(x)}})},[c,o,t,l,h,s,p,y,u,f,a]),ee(()=>{const T=l.current.fields;return()=>{s&&T.delete(s)}},[l,s])}function Ar(e,t){const a=n.useRef(e),s=Ne(t);ee(()=>{a.current!==e&&s(a.current)},[e,s]),ee(()=>{a.current=e},[e])}function _r(e){const{id:t,value:a,defaultValue:s=null,onValueChange:u,open:o,defaultOpen:c=!1,onOpenChange:l,name:p,disabled:y=!1,readOnly:f=!1,required:m=!1,modal:h=!0,actionsRef:T,inputRef:x,onOpenChangeComplete:k,items:M,multiple:d=!1,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:j=ha,highlightItemOnHover:A=!0,children:V}=e,{clearErrors:Q}=er(),{setDirty:_,setTouched:te,setFocused:ye,shouldValidateOnChange:X,validityData:Z,setFilled:K,name:ge,disabled:W,validation:D,validationMode:ae}=Mt(),R=Er({id:t}),H=W||y,C=ge??p,[v,de]=Bt({controlled:a,default:d?s??Ft:s,name:"Select",state:"value"}),[P,oe]=Bt({controlled:o,default:c,name:"Select",state:"open"}),J=n.useRef([]),I=n.useRef([]),U=n.useRef(null),be=n.useRef(null),ke=n.useRef(0),F=n.useRef(null),xe=n.useRef([]),re=n.useRef(!1),we=n.useRef(!1),me=n.useRef(null),ue=n.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),q=n.useRef(!1),{mounted:ne,setMounted:ve,transitionStatus:se}=qt(P),{openMethod:ie,triggerProps:Ce,reset:he}=gn(P),g=$t(()=>new yn({id:R,modal:h,multiple:d,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:j,value:v,open:P,mounted:ne,transitionStatus:se,items:M,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,L=B(g,$.activeIndex),N=B(g,$.selectedIndex),G=B(g,$.triggerElement),i=B(g,$.positionerElement),w=n.useMemo(()=>d&&Array.isArray(v)&&v.length===0?"":et(v,b),[d,v,b]),O=n.useMemo(()=>d&&Array.isArray(v)?v.map(z=>et(z,b)):et(v,b),[d,v,b]),Y=$e(g.state.triggerElement);Or({id:R,commit:D.commit,value:v,controlRef:Y,name:C,getValue:()=>O});const le=n.useRef(v);ee(()=>{v!==le.current&&g.set("forceMount",!0)},[g,v]),ee(()=>{K(d?Array.isArray(v)&&v.length>0:v!=null)},[d,v,K]),ee(function(){if(P)return;const je=xe.current;if(d){const _e=Array.isArray(v)?v:[];if(_e.length===0){g.set("selectedIndex",null);return}const Te=_e[_e.length-1],ft=zt(je,Te,j);g.set("selectedIndex",ft===-1?null:ft);return}const Ae=zt(je,v,j);g.set("selectedIndex",Ae===-1?null:Ae)},[d,P,v,xe,j,g]),Ar(v,()=>{Q(C),_(v!==Z.initialValue),X()?D.commit(v):D.commit(v,!0)});const ce=Ne((z,je)=>{if(l?.(z,je),!je.isCanceled&&(oe(z),!z&&(je.reason===wr||je.reason===bn)&&(te(!0),ye(!1),ae==="onBlur"&&D.commit(v)),!z&&g.state.activeIndex!==null)){const Ae=J.current[g.state.activeIndex];queueMicrotask(()=>{Ae?.setAttribute("tabindex","-1")})}}),pe=Ne(()=>{ve(!1),g.set("activeIndex",null),he(),k?.(!1)});Rt({enabled:!T,open:P,ref:U,onComplete(){P||pe()}}),n.useImperativeHandle(T,()=>({unmount:pe}),[pe]);const Re=Ne((z,je)=>{u?.(z,je),!je.isCanceled&&de(z)}),Se=Ne(()=>{const z=g.state.listElement||U.current;if(!z)return;const je=z.scrollTop,Ae=z.scrollTop+z.clientHeight,_e=je>1,Te=Ae<z.scrollHeight-1;g.state.scrollUpArrowVisible!==_e&&g.set("scrollUpArrowVisible",_e),g.state.scrollDownArrowVisible!==Te&&g.set("scrollDownArrowVisible",Te)}),Oe=mn({open:P,onOpenChange:ce,elements:{reference:G,floating:i}}),Je=hn(Oe,{enabled:!f&&!H,event:"mousedown"}),nt=pn(Oe,{bubbles:!1}),Fe=da(Oe,{enabled:!f&&!H,listRef:J,activeIndex:L,selectedIndex:N,disabledIndices:Ft,onNavigate(z){z===null&&!P||g.set("activeIndex",z)},focusItemOnHover:!1}),Tt=ua(Oe,{enabled:!f&&!H&&(P||!d),listRef:I,activeIndex:L,selectedIndex:N,onMatch(z){P?g.set("activeIndex",z):Re(xe.current[z],Ee("none"))},onTypingChange(z){re.current=z}}),{getReferenceProps:Qe,getFloatingProps:Ze,getItemProps:ct}=xn([Je,nt,Fe,Tt]),at=n.useMemo(()=>Gt(Qe(),Ce,R?{id:R}:yt),[Qe,Ce,R]);ra(()=>{g.update({popupProps:Ze(),triggerProps:at})}),ee(()=>{g.update({id:R,modal:h,multiple:d,value:v,open:P,mounted:ne,transitionStatus:se,popupProps:Ze(),triggerProps:at,items:M,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:j,openMethod:ie})},[g,R,h,d,v,P,ne,se,Ze,at,M,E,b,j,ie]);const dt=n.useMemo(()=>({store:g,name:C,required:m,disabled:H,readOnly:f,multiple:d,itemToStringLabel:E,itemToStringValue:b,highlightItemOnHover:A,setValue:Re,setOpen:ce,listRef:J,popupRef:U,scrollHandlerRef:be,handleScrollArrowVisibility:Se,scrollArrowsMountedCountRef:ke,getItemProps:ct,events:Oe.context.events,valueRef:F,valuesRef:xe,labelsRef:I,typingRef:re,selectionRef:ue,selectedItemTextRef:me,validation:D,onOpenChangeComplete:k,keyboardActiveRef:we,alignItemWithTriggerActiveRef:q,initialValueRef:le}),[g,C,m,H,f,d,E,b,A,Re,ce,ct,Oe.context.events,D,k,Se]),ut=Yt(x,D.inputRef),Pt=d&&Array.isArray(v)&&v.length>0,Ot=n.useMemo(()=>!d||!Array.isArray(v)||!C?null:v.map(z=>{const je=et(z,b);return r.jsx("input",{type:"hidden",name:C,value:je},je)}),[d,v,C,b]);return r.jsx(Cr.Provider,{value:dt,children:r.jsxs(Ir.Provider,{value:Oe,children:[V,r.jsx("input",{...D.getInputValidationProps({onFocus(){g.state.triggerElement?.focus({focusVisible:!0})},onChange(z){if(z.nativeEvent.defaultPrevented)return;const je=z.target.value,Ae=Ee(Ct,z.nativeEvent);function _e(){if(d)return;const Te=xe.current.find(ft=>et(ft,b).toLowerCase()===je.toLowerCase());Te!=null&&(_(Te!==Z.initialValue),Re(Te,Ae),X()&&D.commit(Te))}g.set("forceMount",!0),queueMicrotask(_e)}}),name:d?void 0:C,value:w,disabled:H,required:m&&!Pt,readOnly:f,ref:ut,style:C?kr:vr,tabIndex:-1,"aria-hidden":!0}),Ot]})})}function va(e){const t=e.getBoundingClientRect(),a=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(a.content!=="none"||s.content!=="none"))return t;const o=parseFloat(a.width)||0,c=parseFloat(a.height)||0,l=parseFloat(s.width)||0,p=parseFloat(s.height)||0,y=Math.max(t.width,o,l),f=Math.max(t.height,c,p),m=y-t.width,h=f-t.height;return{left:t.left-m/2,right:t.right+m/2,top:t.top-h/2,bottom:t.bottom+h/2}}const ht=2,ja=400,dr=200,Sa={...wn,...Qt,value:()=>null},Vr=n.forwardRef(function(t,a){const{render:s,className:u,id:o,disabled:c=!1,nativeButton:l=!0,...p}=t,{setTouched:y,setFocused:f,validationMode:m,state:h,disabled:T}=Mt(),{labelId:x}=Zt(),{store:k,setOpen:M,selectionRef:d,validation:E,readOnly:b,required:j,alignItemWithTriggerActiveRef:A,disabled:V,keyboardActiveRef:Q}=We(),_=T||V||c,te=B(k,$.open),ye=B(k,$.value),X=B(k,$.triggerProps),Z=B(k,$.positionerElement),K=B(k,$.listElement),ge=B(k,$.id),W=B(k,$.hasSelectedValue),D=!W&&te,ae=B(k,$.hasNullItemLabel,D),R=o??ge;Er({id:R});const H=$e(Z),C=n.useRef(null),{getButtonProps:v,buttonRef:de}=Xt({disabled:_,native:l}),P=Ne(re=>{k.set("triggerElement",re)}),oe=Yt(a,C,de,P),J=Ge(),I=Ge(),U=Ge(),be=Ge();n.useEffect(()=>{if(te)return!(W||ae)?U.start(ja,()=>{d.current.allowUnselectedMouseUp=!0,d.current.allowSelectedMouseUp=!0}):be.start(dr,()=>{d.current.allowUnselectedMouseUp=!0,U.start(dr,()=>{d.current.allowSelectedMouseUp=!0})}),()=>{U.clear(),be.clear()};d.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},I.clear()},[te,W,ae,d,I,U,be]);const ke=n.useMemo(()=>K?.id??br(Z)?.id,[K,Z]),F=Gt(X,{id:R,role:"combobox","aria-expanded":te?"true":"false","aria-haspopup":"listbox","aria-controls":te?ke:void 0,"aria-labelledby":x,"aria-readonly":b||void 0,"aria-required":j||void 0,tabIndex:_?-1:0,ref:oe,onFocus(re){f(!0),te&&A.current&&M(!1,Ee(Ct,re.nativeEvent)),J.start(0,()=>{k.set("forceMount",!0)})},onBlur(re){st(Z,re.relatedTarget)||(y(!0),f(!1),m==="onBlur"&&E.commit(ye))},onPointerMove(){Q.current=!1},onKeyDown(){Q.current=!0},onMouseDown(re){if(te)return;const we=Ht(re.currentTarget);function me(ue){if(!C.current)return;const q=ue.target;if(st(C.current,q)||st(H.current,q)||q===C.current)return;const ne=va(C.current);ue.clientX>=ne.left-ht&&ue.clientX<=ne.right+ht&&ue.clientY>=ne.top-ht&&ue.clientY<=ne.bottom+ht||M(!1,Ee(kn,ue))}I.start(0,()=>{we.addEventListener("mouseup",me,{once:!0})})}},E.getValidationProps,p,v);F.role="combobox";const xe=n.useMemo(()=>({...h,open:te,disabled:_,value:ye,readOnly:b,placeholder:!W}),[h,te,_,ye,b,W]);return De("button",t,{ref:[a,C],state:xe,stateAttributesMapping:Sa,props:F})}),Na={value:()=>null},Lr=n.forwardRef(function(t,a){const{className:s,render:u,children:o,placeholder:c,...l}=t,{store:p,valueRef:y}=We(),f=B(p,$.value),m=B(p,$.items),h=B(p,$.itemToStringLabel),T=B(p,$.hasSelectedValue),x=!T&&c!=null&&o==null,k=B(p,$.hasNullItemLabel,x),M=n.useMemo(()=>({value:f,placeholder:!T}),[f,T]);let d=null;return typeof o=="function"?d=o(f):o!=null?d=o:!T&&c!=null&&!k?d=c:Array.isArray(f)?d=ba(f,m,h):d=Pr(f,m,h),De("span",t,{state:M,ref:[a,y],props:[{children:d},l],stateAttributesMapping:Na})}),Dr=n.forwardRef(function(t,a){const{className:s,render:u,...o}=t,{store:c}=We(),l=B(c,$.open),p=n.useMemo(()=>({open:l}),[l]);return De("span",t,{state:p,ref:a,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:vn})}),Ra=n.createContext(void 0),Fr=n.forwardRef(function(t,a){const{store:s}=We(),u=B(s,$.mounted),o=B(s,$.forceMount);return u||o?r.jsx(Ra.Provider,{value:!0,children:r.jsx(jn,{ref:a,...t})}):null}),$r=n.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Ca(){return n.useContext($r)}function Ia(e){const{children:t,elementsRef:a,labelsRef:s,onMapChange:u}=e,o=Ne(u),c=n.useRef(0),l=$t(Ea).current,p=$t(Ma).current,[y,f]=n.useState(0),m=n.useRef(y),h=Ne((d,E)=>{p.set(d,E??null),m.current+=1,f(m.current)}),T=Ne(d=>{p.delete(d),m.current+=1,f(m.current)}),x=n.useMemo(()=>{const d=new Map;return Array.from(p.keys()).filter(b=>b.isConnected).sort(Ta).forEach((b,j)=>{const A=p.get(b)??{};d.set(b,{...A,index:j})}),d},[p,y]);ee(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const d=new MutationObserver(E=>{const b=new Set,j=A=>b.has(A)?b.delete(A):b.add(A);E.forEach(A=>{A.removedNodes.forEach(j),A.addedNodes.forEach(j)}),b.size===0&&(m.current+=1,f(m.current))});return x.forEach((E,b)=>{b.parentElement&&d.observe(b.parentElement,{childList:!0})}),()=>{d.disconnect()}},[x]),ee(()=>{m.current===y&&(a.current.length!==x.size&&(a.current.length=x.size),s&&s.current.length!==x.size&&(s.current.length=x.size),c.current=x.size),o(x)},[o,x,a,s,y]),ee(()=>()=>{a.current=[]},[a]),ee(()=>()=>{s&&(s.current=[])},[s]);const k=Ne(d=>(l.add(d),()=>{l.delete(d)}));ee(()=>{l.forEach(d=>d(x))},[l,x]);const M=n.useMemo(()=>({register:h,unregister:T,subscribeMapChange:k,elementsRef:a,labelsRef:s,nextIndexRef:c}),[h,T,k,a,s,c]);return r.jsx($r.Provider,{value:M,children:t})}function Ma(){return new Map}function Ea(){return new Set}function Ta(e,t){const a=e.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_FOLLOWING||a&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:a&Node.DOCUMENT_POSITION_PRECEDING||a&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Hr=n.createContext(void 0);function Pa(){const e=n.useContext(Hr);if(!e)throw new Error(Xe(59));return e}function wt(e,t){e&&Object.assign(e.style,t)}const Oa={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Aa={position:"fixed"},Ur=n.forwardRef(function(t,a){const{anchor:s,positionMethod:u="absolute",className:o,render:c,side:l="bottom",align:p="center",sideOffset:y=0,alignOffset:f=0,collisionBoundary:m="clipping-ancestors",collisionPadding:h,arrowPadding:T=5,sticky:x=!1,disableAnchorTracking:k,alignItemWithTrigger:M=!0,collisionAvoidance:d=Sn,...E}=t,{store:b,listRef:j,labelsRef:A,alignItemWithTriggerActiveRef:V,selectedItemTextRef:Q,valuesRef:_,initialValueRef:te,popupRef:ye,setValue:X}=We(),Z=Mr(),K=B(b,$.open),ge=B(b,$.mounted),W=B(b,$.modal),D=B(b,$.value),ae=B(b,$.openMethod),R=B(b,$.positionerElement),H=B(b,$.triggerElement),C=B(b,$.isItemEqualToValue),v=n.useRef(null),de=n.useRef(null),[P,oe]=n.useState(M),J=ge&&P&&ae!=="touch";!ge&&P!==M&&oe(M),ee(()=>{ge||($.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),$.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,ge]),n.useImperativeHandle(V,()=>J),Nn((J||W)&&K&&ae!=="touch",H);const I=Rn({anchor:s,floatingRootContext:Z,positionMethod:u,mounted:ge,side:l,sideOffset:y,align:p,alignOffset:f,arrowPadding:T,collisionBoundary:m,collisionPadding:h,sticky:x,disableAnchorTracking:k??J,collisionAvoidance:d,keepMounted:!0}),U=J?"none":I.side,be=J?Aa:I.positionerStyles,ke=n.useMemo(()=>{const q={};return K||(q.pointerEvents="none"),{role:"presentation",hidden:!ge,style:{...be,...q}}},[K,ge,be]),F=n.useMemo(()=>({open:K,side:U,align:I.align,anchorHidden:I.anchorHidden}),[K,U,I.align,I.anchorHidden]),xe=Ne(q=>{b.set("positionerElement",q)}),re=De("div",t,{ref:[a,xe],state:F,stateAttributesMapping:jr,props:[ke,E]}),we=n.useRef(0),me=Ne(q=>{if(q.size===0&&we.current===0||_.current.length===0)return;const ne=we.current;if(we.current=q.size,q.size===ne)return;const ve=Ee(Ct);if(ne!==0&&!b.state.multiple&&D!==null&&zt(_.current,D,C)===-1){const ie=te.current,he=ie!=null&&Dt(_.current,ie,C)?ie:null;X(he,ve),he===null&&(b.set("selectedIndex",null),Q.current=null)}if(ne!==0&&b.state.multiple&&Array.isArray(D)){const se=D.filter(ie=>Dt(_.current,ie,C));(se.length!==D.length||se.some(ie=>!Dt(D,ie,C)))&&(X(se,ve),se.length===0&&(b.set("selectedIndex",null),Q.current=null))}if(K&&J){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const se={height:""};wt(R,se),wt(ye.current,se)}}),ue=n.useMemo(()=>({...I,side:U,alignItemWithTriggerActive:J,setControlledAlignItemWithTrigger:oe,scrollUpArrowRef:v,scrollDownArrowRef:de}),[I,U,J,oe]);return r.jsx(Ia,{elementsRef:j,labelsRef:A,onMapChange:me,children:r.jsxs(Hr.Provider,{value:ue,children:[ge&&W&&r.jsx(Cn,{inert:In(!K),cutout:H}),re]})})});function Br(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const pt="base-ui-disable-scrollbar",ur={className:pt,getElement(e){return r.jsx("style",{nonce:e,href:pt,precedence:"base-ui:low",children:`.${pt}{scrollbar-width:none}.${pt}::-webkit-scrollbar{display:none}`})}};function _a(e,t=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,a))}const Va=n.createContext(void 0),La={disableStyleElements:!1};function Da(){return n.useContext(Va)??La}const Fa={...jr,...Jt},zr=n.forwardRef(function(t,a){const{render:s,className:u,...o}=t,{store:c,popupRef:l,onOpenChangeComplete:p,setOpen:y,valueRef:f,selectedItemTextRef:m,keyboardActiveRef:h,multiple:T,handleScrollArrowVisibility:x,scrollHandlerRef:k,highlightItemOnHover:M}=We(),{side:d,align:E,alignItemWithTriggerActive:b,setControlledAlignItemWithTrigger:j,scrollDownArrowRef:A,scrollUpArrowRef:V}=Pa(),Q=Mn()!=null,_=Mr(),{nonce:te,disableStyleElements:ye}=Da(),X=Ge(),Z=B(c,$.id),K=B(c,$.open),ge=B(c,$.mounted),W=B(c,$.popupProps),D=B(c,$.transitionStatus),ae=B(c,$.triggerElement),R=B(c,$.positionerElement),H=B(c,$.listElement),C=n.useRef(0),v=n.useRef(!1),de=n.useRef(0),P=n.useRef(!1),oe=n.useRef({}),J=En(),I=Ne(F=>{if(!R||!l.current||!P.current)return;if(v.current||!b){x();return}const xe=R.style.top==="0px",re=R.style.bottom==="0px",we=R.getBoundingClientRect().height,me=Ht(R),ue=getComputedStyle(R),q=parseFloat(ue.marginTop),ne=parseFloat(ue.marginBottom),ve=fr(getComputedStyle(l.current)),se=me.documentElement.clientHeight-q-ne,ie=F.scrollTop,Ce=F.scrollHeight,he=F.clientHeight,g=Ce-he;let L=0,N=null,G=!1;if(xe){const i=g-ie,w=we+i,O=Math.min(w,se);L=O,O!==se?N=g:G=!0}else if(re){const i=ie-0,w=we+i,O=Math.min(w,se),Y=w-se;L=O,O!==se?N=0:(G=!0,ie<g&&(N=ie-(i-Y)))}L!==0&&(R.style.height=`${L}px`),N!=null&&(F.scrollTop=N),(G||L>=ve)&&(v.current=!0),x()});n.useImperativeHandle(k,()=>I,[I]),Rt({open:K,ref:l,onComplete(){K&&p?.(!0)}});const U=n.useMemo(()=>({open:K,transitionStatus:D,side:d,align:E}),[K,D,d,E]);ee(()=>{!R||!l.current||Object.keys(oe.current).length||(oe.current={top:R.style.top||"0",left:R.style.left||"0",right:R.style.right,height:R.style.height,bottom:R.style.bottom,minHeight:R.style.minHeight,maxHeight:R.style.maxHeight,marginTop:R.style.marginTop,marginBottom:R.style.marginBottom})},[l,R]),ee(()=>{K||b||(P.current=!1,v.current=!1,C.current=0,de.current=0,wt(R,oe.current))},[K,b,R,l]),ee(()=>{const F=l.current;if(!(!K||!ae||!R||!F||c.state.transitionStatus==="ending")){if(!b){P.current=!0,J.request(x),F.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const xe=Ha(F);F.style.removeProperty("--transform-origin");try{const re=getComputedStyle(R),we=getComputedStyle(F),me=Ht(ae),ue=or(R),q=ae.getBoundingClientRect(),ne=R.getBoundingClientRect(),ve=q.left,se=q.height,ie=H||F,Ce=ie.scrollHeight,he=parseFloat(we.borderBottomWidth),g=parseFloat(re.marginTop)||10,L=parseFloat(re.marginBottom)||10,N=parseFloat(re.minHeight)||100,G=fr(we),i=5,w=5,O=20,Y=me.documentElement.clientHeight-g-L,le=me.documentElement.clientWidth,ce=Y-q.bottom+se,pe=m.current,Re=f.current;let Se,Oe=0,Je=0;if(pe&&Re){const z=Re.getBoundingClientRect();Se=pe.getBoundingClientRect();const je=z.left-ve,Ae=Se.left-ne.left,_e=z.top-q.top+z.height/2,Te=Se.top-ne.top+Se.height/2;Oe=je-Ae,Je=Te-_e}const nt=ce+Je+L+he;let Fe=Math.min(Y,nt);const Tt=Y-g-L,Qe=nt-Fe,Ze=Math.max(i,ve+Oe),ct=le-w,at=Math.max(0,Ze+ne.width-ct);R.style.left=`${Ze-at}px`,R.style.height=`${Fe}px`,R.style.maxHeight="auto",R.style.marginTop=`${g}px`,R.style.marginBottom=`${L}px`,F.style.height="100%";const dt=ie.scrollHeight-ie.clientHeight,ut=Qe>=dt;ut&&(Fe=Math.min(Y,ne.height)-(Qe-dt));const Pt=q.top<O||q.bottom>Y-O||Fe<Math.min(Ce,N),Ot=(ue.visualViewport?.scale??1)!==1&&Tn;if(Pt||Ot){P.current=!0,wt(R,oe.current),yr.flushSync(()=>j(!1));return}if(ut){const z=Math.max(0,Y-nt);R.style.top=ne.height>=Tt?"0":`${z}px`,R.style.height=`${Fe}px`,ie.scrollTop=ie.scrollHeight-ie.clientHeight,C.current=Math.max(N,Fe)}else R.style.bottom="0",C.current=Math.max(N,Fe),ie.scrollTop=Qe;if(Se){const z=ne.top,je=ne.height,Ae=Se.top+Se.height/2,_e=je>0?(Ae-z)/je*100:50,Te=_a(_e,0,100);F.style.setProperty("--transform-origin",`50% ${Te}%`)}(C.current===Y||Fe>=G)&&(v.current=!0),x(),setTimeout(()=>{P.current=!0})}finally{xe()}})}},[c,K,R,ae,f,m,l,x,b,j,J,A,V,H]),n.useEffect(()=>{if(!b||!R||!K)return;const F=or(R);function xe(re){y(!1,Ee(On,re))}return F.addEventListener("resize",xe),()=>{F.removeEventListener("resize",xe)}},[y,b,R,K]);const be={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":T||void 0,id:`${Z}-list`},onKeyDown(F){h.current=!0,Q&&_n.has(F.key)&&F.stopPropagation()},onMouseMove(){h.current=!1},onPointerLeave(F){if(!M||Br(F)||F.pointerType==="touch")return;const xe=F.currentTarget;X.start(0,()=>{c.set("activeIndex",null),xe.focus({preventScroll:!0})})},onScroll(F){H||k.current?.(F.currentTarget)},...b&&{style:H?{height:"100%"}:Oa}},ke=De("div",t,{ref:[a,l],state:U,stateAttributesMapping:Fa,props:[W,be,An(D),{className:!H&&b?ur.className:void 0},o]});return r.jsxs(n.Fragment,{children:[!ye&&ur.getElement(te),r.jsx(Pn,{context:_,modal:!1,disabled:!ge,restoreFocus:!0,children:ke})]})});function fr(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}const gr={transform:"none",scale:"1",translate:"0 0"};function $a(e,t,a){a?e.setProperty(t,a):e.removeProperty(t)}function Ha(e){const{style:t}=e,a={},s=Object.keys(gr);for(const u of s)a[u]=t.getPropertyValue(u),t.setProperty(u,gr[u]);return()=>{for(const u of s)$a(t,u,a[u])}}let Kr=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Ua(e={}){const{label:t,metadata:a,textRef:s,indexGuessBehavior:u,index:o}=e,{register:c,unregister:l,subscribeMapChange:p,elementsRef:y,labelsRef:f,nextIndexRef:m}=Ca(),h=n.useRef(-1),[T,x]=n.useState(o??(u===Kr.GuessFromOrder?()=>{if(h.current===-1){const d=m.current;m.current+=1,h.current=d}return h.current}:-1)),k=n.useRef(null),M=n.useCallback(d=>{if(k.current=d,T!==-1&&d!==null&&(y.current[T]=d,f)){const E=t!==void 0;f.current[T]=E?t:s?.current?.textContent??d.textContent}},[T,y,f,t,s]);return ee(()=>{if(o!=null)return;const d=k.current;if(d)return c(d,a),()=>{l(d)}},[o,c,l,a]),ee(()=>{if(o==null)return p(d=>{const E=k.current?d.get(k.current)?.index:null;E!=null&&x(E)})},[o,p,x]),n.useMemo(()=>({ref:M,index:T}),[T,M])}const Wr=n.createContext(void 0);function tr(){const e=n.useContext(Wr);if(!e)throw new Error(Xe(57));return e}const kt=n.memo(n.forwardRef(function(t,a){const{render:s,className:u,value:o=null,label:c,disabled:l=!1,nativeButton:p=!1,...y}=t,f=n.useRef(null),m=Ua({label:c,textRef:f,indexGuessBehavior:Kr.GuessFromOrder}),{store:h,getItemProps:T,setOpen:x,setValue:k,selectionRef:M,typingRef:d,valuesRef:E,keyboardActiveRef:b,multiple:j,highlightItemOnHover:A}=We(),V=Ge(),Q=B(h,$.isActive,m.index),_=B(h,$.isSelected,m.index,o),te=B(h,$.isSelectedByFocus,m.index),ye=B(h,$.isItemEqualToValue),X=m.index,Z=X!==-1,K=n.useRef(null),ge=$e(X);ee(()=>{if(!Z)return;const I=E.current;return I[X]=o,()=>{delete I[X]}},[Z,X,o,E]),ee(()=>{if(!Z)return;const I=h.state.value;let U=I;j&&Array.isArray(I)&&I.length>0&&(U=I[I.length-1]),U!==void 0&&rt(U,o,ye)&&h.set("selectedIndex",X)},[Z,X,j,ye,h,o]);const W=n.useMemo(()=>({disabled:l,selected:_,highlighted:Q}),[l,_,Q]),D=T({active:Q,selected:_});D.onFocus=void 0,D.id=void 0;const ae=n.useRef(null),R=n.useRef("mouse"),H=n.useRef(!1),{getButtonProps:C,buttonRef:v}=Xt({disabled:l,focusableWhenDisabled:!0,native:p});function de(I){const U=h.state.value;if(j){const be=Array.isArray(U)?U:[],ke=_?pa(be,o,ye):[...be,o];k(ke,Ee(_t,I))}else k(o,Ee(_t,I)),x(!1,Ee(_t,I))}const P={role:"option","aria-selected":_,tabIndex:Q?0:-1,onFocus(){h.set("activeIndex",X)},onMouseEnter(){!b.current&&h.state.selectedIndex===null&&h.set("activeIndex",X)},onMouseMove(){A&&h.set("activeIndex",X)},onMouseLeave(I){!A||b.current||Br(I)||V.start(0,()=>{h.state.activeIndex===X&&h.set("activeIndex",null)})},onTouchStart(){M.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(I){ae.current=I.key,h.set("activeIndex",X)},onClick(I){H.current=!1,!(I.type==="keydown"&&ae.current===null)&&(l||ae.current===" "&&d.current||R.current!=="touch"&&!Q||(ae.current=null,de(I.nativeEvent)))},onPointerEnter(I){R.current=I.pointerType},onPointerDown(I){R.current=I.pointerType,H.current=!0},onMouseUp(I){if(l)return;if(H.current){H.current=!1;return}const U=!M.current.allowSelectedMouseUp&&_,be=!M.current.allowUnselectedMouseUp&&!_;U||be||R.current!=="touch"&&!Q||de(I.nativeEvent)}},oe=De("div",t,{ref:[v,a,m.ref,K],state:W,props:[D,P,y,C]}),J=n.useMemo(()=>({selected:_,indexRef:ge,textRef:f,selectedByFocus:te,hasRegistered:Z}),[_,ge,f,te,Z]);return r.jsx(Wr.Provider,{value:J,children:oe})})),vt=n.forwardRef(function(t,a){const s=t.keepMounted??!1,{selected:u}=tr();return s||u?r.jsx(Ba,{...t,ref:a}):null}),Ba=n.memo(n.forwardRef((e,t)=>{const{render:a,className:s,keepMounted:u,...o}=e,{selected:c}=tr(),l=n.useRef(null),{transitionStatus:p,setMounted:y}=qt(c),f=n.useMemo(()=>({selected:c,transitionStatus:p}),[c,p]),m=De("span",e,{ref:[t,l],state:f,props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:Jt});return Rt({open:c,ref:l,onComplete(){c||y(!1)}}),m})),jt=n.memo(n.forwardRef(function(t,a){const{indexRef:s,textRef:u,selectedByFocus:o,hasRegistered:c}=tr(),{selectedItemTextRef:l}=We(),{className:p,render:y,...f}=t,m=n.useCallback(T=>{if(!T||!c)return;const x=l.current===null||!l.current.isConnected;(o||x&&s.current===0)&&(l.current=T)},[l,s,o,c]);return De("div",t,{ref:[m,a,u],props:f})})),za=n.forwardRef(function(t,a){const{render:s,className:u,id:o,...c}=t,{store:l}=Vn(),p=bt(o);return l.useSyncedValueWithCleanup("descriptionElementId",p),De("p",t,{ref:a,props:[{id:p},c]})});function Ka({open:e,title:t,description:a,confirmLabel:s,cancelLabel:u,destructive:o=!1,busy:c=!1,onConfirm:l,onCancel:p}){return r.jsx(Ln,{open:e,onOpenChange:y=>{!y&&!c&&p?.()},children:r.jsxs(Dn,{children:[r.jsx(Fn,{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-[2px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),r.jsx($n,{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:r.jsxs(Hn,{className:"relative w-full max-w-md rounded-2xl bg-white p-6 shadow-[0_20px_60px_-20px_rgba(0,0,0,0.25)] ring-1 ring-oai-gray-200 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-2 data-[ending-style]:scale-[0.96] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-2 data-[starting-style]:scale-[0.96] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:shadow-[0_20px_60px_-10px_rgba(0,0,0,0.65)] dark:ring-oai-gray-800",children:[r.jsx(Un,{className:"text-base font-semibold text-oai-black dark:text-white",children:t}),a?r.jsx(za,{className:"mt-2 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:a}):null,r.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[r.jsx(Le,{type:"button",variant:"secondary",size:"sm",disabled:c,onClick:()=>p?.(),children:u}),r.jsx(Le,{type:"button",size:"sm",disabled:c,onClick:()=>l?.(),className:Ue(o&&"!bg-red-600 hover:!bg-red-700 focus-visible:!outline-red-600 dark:!bg-red-600 dark:hover:!bg-red-500"),children:s})]})]})})]})})}function qr({id:e,value:t,onChange:a,placeholder:s,disabled:u=!1,type:o="text",label:c,error:l,className:p="",...y}){const f=n.useId(),m=e||f,h=l?`${m}-error`:void 0,M=`w-full bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md text-oai-black dark:text-oai-white placeholder-oai-gray-400 dark:placeholder-oai-gray-500 transition-all duration-200 focus:outline-none focus:border-oai-brand dark:focus:border-oai-brand focus:ring-1 focus:ring-oai-brand/30 ${u?"bg-oai-gray-50 dark:bg-oai-gray-800 text-oai-gray-400 dark:text-oai-gray-400 cursor-not-allowed":""} ${l?"border-oai-error focus:border-oai-error focus:ring-oai-error/30":""} h-10 px-3 text-sm ${p}`;return r.jsxs("div",{className:"w-full",children:[c&&r.jsx("label",{htmlFor:m,className:"block text-sm font-medium text-oai-gray-700 dark:text-oai-gray-300 mb-1.5 transition-colors duration-200",children:c}),r.jsx("input",{id:m,type:o,value:t,onChange:a,placeholder:s,disabled:u,"aria-invalid":l?!0:void 0,"aria-describedby":h,className:M,...y}),l&&r.jsx("p",{id:h,className:"mt-1.5 text-sm text-oai-error",children:l})]})}const Wa="tt:hint:dismissed:";function Gr(e){return Wa+e}function qa(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Gr(e))==="1"}catch{return!1}}function Ga({id:e,children:t,className:a,ariaLabel:s}){const[u,o]=n.useState(()=>qa(e)),c=n.useCallback(()=>{if(typeof window<"u")try{window.localStorage.setItem(Gr(e),"1")}catch{}o(!0)},[e]);return u?null:r.jsxs("div",{role:"note","aria-label":s||S("hint.dismissible_aria"),className:Ue("relative rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 py-3 text-sm text-oai-gray-700","dark:border-oai-gray-800 dark:bg-oai-gray-900/40 dark:text-oai-gray-300",a),children:[r.jsx("button",{type:"button",onClick:c,"aria-label":S("hint.dismiss"),className:"absolute top-2 right-2 inline-flex h-7 w-7 items-center justify-center rounded-md text-oai-gray-500 transition-colors hover:bg-oai-gray-200/70 hover:text-oai-gray-700 focus:outline-none focus:ring-2 focus:ring-oai-blue/30 dark:text-oai-gray-400 dark:hover:bg-oai-gray-800/70 dark:hover:text-oai-gray-200",children:r.jsx(Nt,{className:"h-4 w-4","aria-hidden":"true"})}),r.jsxs("div",{className:"flex items-start gap-2 pr-8",children:[r.jsx(Bn,{className:"mt-0.5 h-4 w-4 shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":"true"}),r.jsx("div",{className:"min-w-0 flex-1",children:t})]})]})}let mr=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function Yr(e){return n.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[mr.checked]:""}:{[mr.unchecked]:""}},...Qt}),[e.indeterminate])}const Ya=n.createContext({disabled:!1});function Xa(){return n.useContext(Ya)}const Ja=n.createContext(void 0);function Qa(e=!0){const t=n.useContext(Ja);if(t===void 0&&!e)throw new Error(Xe(3));return t}const Xr=n.createContext(void 0);function Za(){const e=n.useContext(Xr);if(e===void 0)throw new Error(Xe(14));return e}const es="data-parent",ts=n.forwardRef(function(t,a){const{checked:s,className:u,defaultChecked:o=!1,disabled:c=!1,id:l,indeterminate:p=!1,inputRef:y,name:f,onCheckedChange:m,parent:h=!1,readOnly:T=!1,render:x,required:k=!1,uncheckedValue:M,value:d,nativeButton:E=!1,...b}=t,{clearErrors:j}=er(),{disabled:A,name:V,setDirty:Q,setFilled:_,setFocused:te,setTouched:ye,state:X,validationMode:Z,validityData:K,shouldValidateOnChange:ge,validation:W}=Mt(),D=Xa(),{labelId:ae,controlId:R,setControlId:H,getDescriptionProps:C}=Zt(),v=Qa(),de=v?.parent,P=de&&v.allValues,oe=A||D.disabled||v?.disabled||c,J=V??f,I=d??J,U=bt(),be=bt();let ke=R;P?ke=h?be:`${de.id}-${I}`:l&&(ke=l);let F={};P&&(h?F=v.parent.getParentProps():I&&(F=v.parent.getChildProps(I)));const xe=Ne(m),{checked:re=s,indeterminate:we=p,onCheckedChange:me,...ue}=F,q=v?.value,ne=v?.setValue,ve=v?.defaultValue,se=n.useRef(null),{getButtonProps:ie,buttonRef:Ce}=Xt({disabled:oe,native:E}),he=v?.validation??W,[g,L]=Bt({controlled:I&&q&&!h?q.includes(I):re,default:I&&ve&&!h?ve.includes(I):o,name:"Checkbox",state:"checked"});ee(()=>{if(H!==Ve)return H(ke),()=>{H(void 0)}},[ke,v,H,h]),Or({enabled:!v,id:U,commit:he.commit,value:g,controlRef:se,name:J,getValue:()=>g});const N=n.useRef(null),G=Yt(y,N,he.inputRef);ee(()=>{N.current&&(N.current.indeterminate=we,g&&_(!0))},[g,we,_]),Ar(g,()=>{v&&!h||(j(J),_(g),Q(g!==K.initialValue),ge()?he.commit(g):he.commit(g,!0))});const i=Gt({checked:g,disabled:oe,name:h?void 0:J,id:E?void 0:ke??void 0,required:k,ref:G,style:J?kr:vr,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(pe){if(pe.nativeEvent.defaultPrevented)return;const Re=pe.target.checked,Se=Ee(Ct,pe.nativeEvent);if(me?.(Re,Se),xe(Re,Se),!Se.isCanceled&&(L(Re),I&&q&&ne&&!h)){const Oe=Re?[...q,I]:q.filter(Je=>Je!==I);ne(Oe,Se)}},onFocus(){se.current?.focus()}},d!==void 0?{value:(v?g&&d:d)||""}:yt,C,v?he.getValidationProps:he.getInputValidationProps),w=P?!!re:g,O=P&&we||p;n.useEffect(()=>{de&&I&&de.disabledStatesRef.current.set(I,oe)},[de,oe,I]);const Y=n.useMemo(()=>({...X,checked:w,disabled:oe,readOnly:T,required:k,indeterminate:O}),[X,w,oe,T,k,O]),le=Yr(Y),ce=De("span",t,{state:Y,ref:[Ce,se,a,v?.registerControlRef],props:[{id:E?ke??void 0:U,role:"checkbox","aria-checked":we?"mixed":g,"aria-readonly":T||void 0,"aria-required":k||void 0,"aria-labelledby":ae,[es]:h?"":void 0,onFocus(){te(!0)},onBlur(){const pe=N.current;pe&&(ye(!0),te(!1),Z==="onBlur"&&he.commit(v?q:pe.checked))},onClick(pe){T||oe||(pe.preventDefault(),N.current?.click())}},C,he.getValidationProps,b,ue,ie],stateAttributesMapping:le});return r.jsxs(Xr.Provider,{value:Y,children:[ce,!g&&!v&&J&&!h&&M!==void 0&&r.jsx("input",{type:"hidden",name:J,value:M}),r.jsx("input",{...i})]})}),rs=n.forwardRef(function(t,a){const{render:s,className:u,keepMounted:o=!1,...c}=t,l=Za(),p=l.checked||l.indeterminate,{transitionStatus:y,setMounted:f}=qt(p),m=n.useRef(null),h=n.useMemo(()=>({...l,transitionStatus:y}),[l,y]);Rt({open:p,ref:m,onComplete(){p||f(!1)}});const T=Yr(l),x=n.useMemo(()=>({...T,...Jt,...Qt}),[T]),k=o||p,M=De("span",t,{enabled:k,ref:[a,m],state:h,stateAttributesMapping:x,props:c});return k?M:null});function ns(e,t){return`target:${e}:${t}`}function as(e){return`remove:${e.id||e.directory}`}function ss({skill:e,targets:t,busyKey:a,onClose:s,onToggleTarget:u,onRemove:o}){return r.jsx(Qr,{children:e?r.jsx(os,{skill:e,targets:t,busyKey:a,onClose:s,onToggleTarget:u,onRemove:o},e.id||e.directory):null})}function os({skill:e,targets:t,busyKey:a,onClose:s,onToggleTarget:u,onRemove:o}){const c=Xn(),l=n.useRef(null);n.useEffect(()=>{const x=M=>{M.key==="Escape"&&(M.stopPropagation(),s?.())},k=M=>{const d=M.target;d instanceof Element&&(l.current?.contains(d)||d.closest('[data-skill-row="1"]')||s?.())};return document.addEventListener("keydown",x),document.addEventListener("mousedown",k),()=>{document.removeEventListener("keydown",x),document.removeEventListener("mousedown",k)}},[s]);const p=e.name||e.directory,y=!!(e.repoOwner&&e.repoName),f=y?`https://github.com/${e.repoOwner}/${e.repoName}`:null,m=new Set(e.targets||[]),h=a===as(e),T=c?{duration:0}:{type:"spring",stiffness:320,damping:30,mass:.7};return r.jsxs(r.Fragment,{children:[r.jsx(rr.div,{className:"fixed inset-0 z-20 bg-oai-black/30 backdrop-blur-[2px] lg:hidden",initial:c?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:c?0:.15},onClick:s,"aria-hidden":!0}),r.jsxs(rr.aside,{ref:l,role:"complementary","aria-label":p,initial:c?!1:{opacity:0,x:24,scale:.98},animate:{opacity:1,x:0,scale:1},exit:c?{opacity:0}:{opacity:0,x:24,scale:.98},transition:T,className:"fixed inset-x-3 bottom-3 top-20 z-30 flex flex-col overflow-hidden rounded-2xl border border-white/40 bg-white/75 shadow-[0_24px_60px_-20px_rgba(15,23,42,0.25)] backdrop-blur-xl backdrop-saturate-150 supports-[backdrop-filter]:bg-white/65 dark:border-white/10 dark:bg-oai-gray-950/70 dark:shadow-[0_24px_60px_-20px_rgba(0,0,0,0.7)] dark:supports-[backdrop-filter]:bg-oai-gray-950/55 lg:inset-auto lg:right-6 lg:top-24 lg:bottom-6 lg:w-[22rem] lg:max-h-[calc(100vh-7.5rem)]",children:[r.jsxs("header",{className:"flex items-start gap-3 border-b border-white/40 bg-gradient-to-b from-white/30 to-transparent px-5 pb-4 pt-5 dark:border-white/10 dark:from-white/[0.04]",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("h2",{className:"truncate text-base font-semibold text-oai-black dark:text-white",title:p,children:p}),y?r.jsxs("a",{href:f,target:"_blank",rel:"noreferrer noopener",className:"mt-1 inline-flex max-w-full items-center gap-1 truncate text-xs text-oai-gray-500 transition-colors hover:text-oai-black hover:underline dark:text-oai-gray-400 dark:hover:text-white",title:f,children:[r.jsxs("span",{className:"truncate",children:[e.repoOwner,"/",e.repoName]}),r.jsx(Ut,{className:"h-3 w-3 shrink-0","aria-hidden":!0})]}):r.jsx("div",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",title:e.directory,children:e.directory})]}),r.jsx("button",{type:"button",onClick:s,"aria-label":S("skills.detail.close"),className:"-mr-1 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-oai-gray-500 transition hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-400 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:r.jsx(Nt,{className:"h-4 w-4","aria-hidden":!0})})]}),r.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-5",children:[e.description?r.jsx("p",{className:"text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:e.description}):null,r.jsxs("section",{className:e.description?"mt-6":"",children:[r.jsx("h3",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.detail.sync_section_title")}),r.jsx("div",{className:"overflow-hidden rounded-xl bg-white/40 ring-1 ring-white/50 dark:bg-white/[0.02] dark:ring-white/10",children:(t||[]).map((x,k)=>{const M=m.has(x.id),d=a===ns(e.id,x.id),E=k===(t||[]).length-1,b=`skill-detail-sync-${e.id||e.directory}-${x.id}`;return r.jsxs("label",{htmlFor:b,className:"flex cursor-pointer items-center gap-3 px-3 py-2.5 text-sm text-oai-black transition-colors hover:bg-white/40 dark:text-white dark:hover:bg-white/[0.04]"+(E?"":" border-b border-white/40 dark:border-white/[0.06]"),children:[r.jsx(ts,{id:b,checked:M,disabled:d,onCheckedChange:j=>u?.(e,x.id,!!j),className:"peer flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-oai-gray-300/80 bg-white/80 shadow-sm transition-colors hover:border-oai-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-gray-400/40 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:border-oai-black data-[checked]:bg-oai-black dark:border-oai-gray-500/60 dark:bg-oai-gray-900/60 dark:hover:border-oai-gray-400 dark:data-[checked]:border-white dark:data-[checked]:bg-white",children:r.jsx(rs,{className:"flex items-center justify-center text-white dark:text-oai-black",children:r.jsx(Ye,{className:"h-3 w-3",strokeWidth:3.5,"aria-hidden":!0})})}),r.jsx(tt,{provider:x.id,size:16}),r.jsx("span",{className:"flex-1",children:x.label}),d?r.jsx(Ke,{className:"h-3.5 w-3.5 animate-spin text-oai-gray-400","aria-hidden":!0}):null]},x.id)})})]})]}),r.jsxs("footer",{className:"border-t border-white/40 bg-white/30 px-5 py-4 dark:border-white/10 dark:bg-white/[0.02]",children:[r.jsxs("button",{type:"button",onClick:()=>o?.(e),disabled:h,className:"inline-flex w-full items-center justify-center gap-2 rounded-lg border border-red-200/70 bg-white px-3 py-2 text-sm font-medium text-red-600 transition hover:border-red-300 hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-400/30 disabled:cursor-not-allowed disabled:opacity-60 dark:border-red-900/60 dark:bg-oai-gray-950 dark:text-red-300 dark:hover:border-red-800 dark:hover:bg-red-950/30",children:[h?r.jsx(Ke,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):r.jsx(Rr,{className:"h-3.5 w-3.5","aria-hidden":!0}),S("skills.detail.remove_button")]}),r.jsx("p",{className:"mt-2 text-center text-[11px] text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.detail.remove_confirm_hint")})]})]})]})}const Jr="tokentracker-skills";async function Et(e){const t=new URL(`/functions/${Jr}`,window.location.origin);if(e)for(const[u,o]of Object.entries(e))o!=null&&o!==""&&t.searchParams.set(u,String(o));const a=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),s=await a.json().catch(()=>null);if(!a.ok)throw new Error(s?.error||`Request failed with HTTP ${a.status}`);return s}async function qe(e){const t=await Zr(),a=await fetch(`/functions/${Jr}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),s=await a.json().catch(()=>null);if(!a.ok||s?.ok===!1)throw new Error(s?.error||`Request failed with HTTP ${a.status}`);return s}function is(){return Et({mode:"installed"})}function ls(e={}){return Et({mode:"discover",...e.force?{force:1}:{}})}function cs(e,t=0,a=20){return Et({mode:"search",q:e,offset:t,limit:a})}function ds(){return Et({mode:"repos"})}function us(e,t){return qe({action:"install",skill:e,targets:t})}function fs(e){return qe({action:"uninstall",id:e})}function gs(e){return qe({action:"restore",id:e})}function ms(e,t){return qe({action:"set_targets",id:e,targets:t})}function hs(e,t){return qe({action:"import_local",directory:e,targets:t})}function ps(e,t){return qe({action:"delete_local",directory:e,targets:t||[]})}function xs(e){return qe({action:"add_repo",repo:e})}function ys(e,t){return qe({action:"remove_repo",owner:e,name:t})}const hr=["claude","codex"],bs={claude:"text-orange-500 dark:text-orange-300",codex:"text-emerald-600 dark:text-emerald-300",gemini:"text-sky-600 dark:text-sky-300",opencode:"text-amber-600 dark:text-amber-300",hermes:"text-indigo-500 dark:text-indigo-300"},He="all",Pe="skillssh";function xt(e){return`${e.repoOwner||"local"}/${e.repoName||"local"}:${e.directory}`}function pr(e){return`install:${xt(e)}`}function xr(e){return`remove:${e.id||e.directory}`}function ws(e,t){return`target:${e}:${t}`}function ks({target:e}){return r.jsxs("span",{className:"inline-flex h-6 items-center gap-1.5 rounded-full bg-oai-gray-100 px-2 text-[11px] font-medium text-oai-gray-700 ring-1 ring-oai-gray-200/70 dark:bg-oai-gray-800/70 dark:text-oai-gray-200 dark:ring-oai-gray-700/70",children:[r.jsx("span",{className:Ue("flex h-3.5 w-3.5 items-center justify-center",bs[e.id]),"aria-hidden":!0,children:r.jsx(tt,{provider:e.id,size:14})}),e.label]})}function vs({skill:e,targets:t}){const a=new Set(e.targets||[]),s=t.filter(o=>a.has(o.id));if(!s.length)return r.jsx("span",{className:"text-xs italic text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.target.synced_none")});const u=s.map(o=>o.label).join(", ");return r.jsx("div",{className:"flex flex-wrap gap-1","aria-label":S("skills.target.synced_summary",{targets:u}),children:s.map(o=>r.jsx(ks,{target:o},o.id))})}function js({skill:e,targets:t,selected:a,onSelect:s}){const u=e.repoOwner&&e.repoName?`${e.repoOwner}/${e.repoName}`:null,o=u?`${e.directory} · ${u}`:e.directory,c=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s?.(e))};return r.jsxs("div",{"data-skill-row":"1",role:"button",tabIndex:0,"aria-pressed":a,"aria-label":S("skills.row.open_details",{name:e.name||e.directory}),onClick:()=>s?.(e),onKeyDown:c,className:Ue("flex cursor-pointer flex-col gap-3 rounded-md px-3 py-3 transition focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 lg:flex-row lg:items-center lg:gap-4",a?"bg-oai-gray-100 ring-1 ring-oai-gray-200 dark:bg-oai-gray-800/60 dark:ring-oai-gray-800":"hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/40"),children:[r.jsxs("div",{className:"min-w-0 flex-1",title:o,children:[r.jsx("h2",{className:"truncate text-sm font-semibold text-oai-black dark:text-white",children:e.name||e.directory}),e.description?r.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e.description}):null]}),r.jsx("div",{className:"flex items-center gap-2 lg:gap-3",children:r.jsx(vs,{skill:e,targets:t})}),r.jsx(Yn,{className:Ue("hidden h-4 w-4 shrink-0 text-oai-gray-300 transition-colors dark:text-oai-gray-600 lg:block",a&&"text-oai-gray-500 dark:text-oai-gray-300"),"aria-hidden":!0})]})}function Ss({agentFilter:e,agentOptions:t,onAgentFilter:a,filteredCount:s,totalCount:u,anyFilter:o,onClearFilters:c}){return r.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 px-1 pt-1 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsxs(_r,{value:e,onValueChange:a,children:[r.jsxs(Vr,{"aria-label":S("skills.filter.agent_label"),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 bg-oai-white px-2.5 text-xs font-medium text-oai-gray-700 transition hover:border-oai-gray-300 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 data-[popup-open]:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-200 dark:hover:border-oai-gray-700",children:[r.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:[S("skills.filter.agent_label"),":"]}),r.jsx(Lr,{children:l=>l==="all"?S("skills.filter.agent_all"):t.find(p=>p.id===l)?.label||l}),r.jsx(Dr,{className:"text-oai-gray-400",children:r.jsx(Sr,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),r.jsx(Fr,{children:r.jsx(Ur,{sideOffset:4,alignItemWithTrigger:!1,className:"z-[60]",children:r.jsxs(zr,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-oai-gray-200 bg-white p-1 shadow-[0_12px_32px_-12px_rgba(0,0,0,0.18)] outline-none dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:shadow-[0_12px_32px_-12px_rgba(0,0,0,0.6)]",children:[r.jsxs(kt,{value:"all",className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[r.jsx(jt,{children:S("skills.filter.agent_all")}),r.jsx(vt,{children:r.jsx(Ye,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),t.map(l=>r.jsxs(kt,{value:l.id,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(tt,{provider:l.id,size:14}),r.jsx(jt,{children:l.label})]}),r.jsx(vt,{children:r.jsx(Ye,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},l.id))]})})})]}),r.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.filter.result_count",{filtered:s,total:u})}),o?r.jsxs("button",{type:"button",onClick:c,className:"ml-auto inline-flex h-7 items-center gap-1 rounded-full bg-oai-gray-100 px-2.5 text-[11px] font-medium text-oai-gray-700 transition hover:bg-oai-gray-200 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:bg-oai-gray-800/70 dark:text-oai-gray-200 dark:hover:bg-oai-gray-700",children:[r.jsx(Nt,{className:"h-3 w-3","aria-hidden":!0}),S("skills.filter.clear")]}):null]})}function Ns({items:e,totalCount:t,targets:a,agentOptions:s,agentFilter:u,onAgentFilter:o,anyFilter:c,onClearFilters:l,selectedId:p,onSelect:y}){return r.jsxs("div",{children:[r.jsx(Ss,{agentFilter:u,agentOptions:s,onAgentFilter:o,filteredCount:e.length,totalCount:t,anyFilter:c,onClearFilters:l}),e.length===0?r.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:[r.jsx("p",{children:S("skills.empty.no_match")}),r.jsx(Le,{type:"button",variant:"secondary",size:"sm",onClick:l,children:S("skills.filter.clear")})]}):r.jsx("div",{className:"divide-y divide-oai-gray-200/70 dark:divide-oai-gray-800/70",children:e.map(f=>r.jsx(js,{skill:f,targets:a,selected:p===(f.id||f.directory),onSelect:y},f.id||f.key))})]})}const Rs={contentVisibility:"auto",containIntrinsicSize:"0 240px"},Cs=tn.memo(function({skill:t,installed:a,installing:s,allTargets:u,defaultTargets:o,onInstall:c}){const[l,p]=n.useState(()=>(o||[]).filter(x=>u.some(k=>k.id===x))),y=x=>{p(k=>k.includes(x)?k.filter(M=>M!==x):[...k,x])},f=t.repoOwner&&t.repoName?`${t.repoOwner}/${t.repoName}`:null,m=f?`https://github.com/${t.repoOwner}/${t.repoName}`:null,h=t.installs!=null?S("skills.card.installs",{count:Number(t.installs||0).toLocaleString()}):null,T=l.length?l.map(x=>u.find(k=>k.id===x)?.label||x).join(", "):S("skills.action.choose_targets");return r.jsxs(rn,{className:"h-full rounded-lg",bodyClassName:"flex h-full flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[t.readmeUrl?r.jsxs("a",{href:t.readmeUrl,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex max-w-full items-center gap-1 truncate text-base font-semibold text-oai-black hover:underline dark:text-white",title:t.readmeUrl,children:[r.jsx("span",{className:"truncate",children:t.name||t.directory}),r.jsx(Ut,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400 opacity-0 transition-opacity group-hover:opacity-100","aria-hidden":!0})]}):r.jsx("h2",{className:"truncate text-base font-semibold text-oai-black dark:text-white",children:t.name||t.directory}),f||h?r.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-1.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[m?r.jsxs("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:x=>x.stopPropagation(),className:"inline-flex items-center gap-1 truncate rounded text-oai-gray-500 hover:text-oai-black hover:underline focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-400 dark:hover:text-white",title:m,children:[r.jsx("span",{className:"truncate",children:f}),r.jsx(Ut,{className:"h-2.5 w-2.5 shrink-0","aria-hidden":!0})]}):null,f&&h?r.jsx("span",{"aria-hidden":!0,children:"·"}):null,h?r.jsx("span",{className:"truncate",children:h}):null]}):null]}),a?r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-md bg-oai-black/[0.06] px-2 py-1 text-xs font-medium text-oai-gray-700 ring-1 ring-oai-black/10 dark:bg-white/[0.08] dark:text-oai-gray-200 dark:ring-white/10",children:[r.jsx(Ye,{className:"h-3 w-3","aria-hidden":!0}),S("skills.card.installed")]}):null]}),t.description?r.jsx("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:t.description}):null,r.jsx("div",{className:"mt-auto pt-5",children:a?r.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-center gap-1.5 rounded-md bg-oai-black/[0.04] text-sm font-medium text-oai-gray-700 ring-1 ring-inset ring-oai-black/[0.08] dark:bg-white/[0.05] dark:text-oai-gray-200 dark:ring-white/[0.08]",children:[r.jsx(Ye,{className:"h-3.5 w-3.5","aria-hidden":!0}),S("skills.card.installed")]}):r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.card.targets_prefix")}),r.jsx("span",{className:"min-w-0 truncate font-medium text-oai-black dark:text-white",children:l.length?T:S("skills.target.none")}),r.jsxs(zn,{children:[r.jsx(Kn,{disabled:s,"aria-label":S("skills.action.choose_targets"),className:"rounded text-xs font-medium text-oai-gray-500 underline decoration-oai-gray-300 decoration-dotted underline-offset-2 transition hover:text-oai-black hover:decoration-oai-gray-500 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 disabled:cursor-not-allowed disabled:opacity-60 dark:text-oai-gray-400 dark:decoration-oai-gray-600 dark:hover:text-white dark:hover:decoration-oai-gray-400",children:S("skills.card.targets_change")}),r.jsx(Wn,{children:r.jsx(qn,{sideOffset:6,side:"bottom",align:"end",className:"!z-[80]",children:r.jsxs(Gn,{className:"min-w-[220px] rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-oai-gray-200 dark:bg-oai-gray-950 dark:ring-oai-gray-800",children:[r.jsx("div",{className:"px-2 pb-1 pt-0.5 text-[11px] font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.target.menu_label")}),u.map(x=>{const k=l.includes(x.id);return r.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm text-oai-black hover:bg-oai-gray-100 dark:text-white dark:hover:bg-oai-gray-800",children:[r.jsx("input",{type:"checkbox",className:"h-4 w-4 shrink-0 rounded border-oai-gray-300 text-oai-black focus:ring-oai-gray-400 dark:border-oai-gray-600 dark:bg-oai-gray-900 dark:text-white",checked:k,onChange:()=>y(x.id)}),r.jsx(tt,{provider:x.id,size:16}),r.jsx("span",{className:"flex-1 text-left",children:x.label})]},x.id)})]})})})]})]}),r.jsxs(Le,{type:"button",size:"sm",onClick:()=>c(t,l),disabled:s||l.length===0,className:"w-full",children:[s?r.jsx(Ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):r.jsx(Jn,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),S("skills.action.install")]})]})})]})});function Is({repos:e,repoInput:t,onRepoInput:a,busyKey:s,onAdd:u,onRemove:o}){return r.jsxs("div",{className:"rounded-lg border border-oai-gray-200 bg-white p-4 dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[r.jsx(qr,{value:t,onChange:c=>a(c.target.value),placeholder:S("skills.repo.placeholder"),className:"min-w-0 flex-1"}),r.jsxs(Le,{type:"button",variant:"secondary",size:"md",onClick:u,disabled:s==="repo:add",className:"shrink-0 whitespace-nowrap",children:[s==="repo:add"?r.jsx(Ke,{className:"mr-1.5 h-4 w-4 animate-spin","aria-hidden":!0}):r.jsx(Nr,{className:"mr-1.5 h-4 w-4","aria-hidden":!0}),S("skills.repo.add")]})]}),e.length?r.jsx("div",{className:"mt-3 divide-y divide-oai-gray-200/70 dark:divide-oai-gray-800/70",children:e.map(c=>{const l=s===`repo:${c.owner}/${c.name}`;return r.jsxs("div",{className:"flex items-center justify-between gap-3 py-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"truncate text-sm font-medium text-oai-black dark:text-white",children:[c.owner,"/",c.name]}),r.jsx("div",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:c.branch})]}),r.jsxs(Le,{type:"button",variant:"ghost",size:"sm",disabled:l,onClick:()=>o(c),className:"shrink-0",children:[l?r.jsx(Ke,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):r.jsx(Rr,{className:"h-3.5 w-3.5","aria-hidden":!0}),r.jsx("span",{className:"sr-only",children:S("skills.repo.remove")})]})]},`${c.owner}/${c.name}`)})}):null]})}function Ms(){return typeof window>"u"?"my":new URLSearchParams(window.location.search).get("tab")==="browse"?"browse":"my"}function Fs(){const[e,t]=n.useState(Ms),[a,s]=n.useState({skills:[],targets:[]}),[u,o]=n.useState([]),[c,l]=n.useState([]),[p,y]=n.useState([]),[f,m]=n.useState(He),[h,T]=n.useState(""),[x,k]=n.useState(""),[M,d]=n.useState(""),[E,b]=n.useState(!1),[j,A]=n.useState("all"),[V,Q]=n.useState(null),[_,te]=n.useState(""),[ye,X]=n.useState(!0),[Z,K]=n.useState(!1),[ge,W]=n.useState(""),[D,ae]=n.useState(null),[R,H]=n.useState(null),C=n.useMemo(()=>{const i=new Set;for(const w of a.skills||[]){i.add(xt(w).toLowerCase()),w.repoOwner&&w.repoName&&i.add(`${w.repoOwner}/${w.repoName}:${w.sourceDirectory||w.directory}`.toLowerCase());const O=String(w.directory||"").split(/[\\/]/).pop().toLowerCase();O&&i.add(`dir:${O}`)}return i},[a.skills]),v=n.useCallback(async()=>{const i=await is();s({skills:i.skills||[],targets:i.targets||[]})},[]),de=n.useCallback(async()=>{const i=await ds();y(i.repos||[])},[]),P=n.useCallback(async({force:i=!1}={})=>{K(!0);try{const w=await ls({force:i});o(w.skills||[])}finally{K(!1)}},[]),oe=n.useCallback(async()=>{X(!0),W("");try{await Promise.all([v(),de()])}catch(i){W(i?.message||S("skills.error.generic"))}finally{X(!1)}},[v,de]),J=n.useCallback(async()=>{await oe(),e==="browse"&&f!==Pe&&P({force:!0}).catch(i=>W(i?.message||S("skills.error.generic")))},[P,oe,f,e]);n.useEffect(()=>{oe()},[oe]),n.useEffect(()=>{e==="browse"&&f!==Pe&&u.length===0&&P().catch(i=>W(i?.message||S("skills.error.generic")))},[u.length,P,f,e]),n.useEffect(()=>{if(!R)return;const i=setTimeout(()=>H(w=>w?.key===R.key?null:w),R.ttlMs||5e3);return()=>clearTimeout(i)},[R]),n.useEffect(()=>{const i=setTimeout(()=>k(h),200);return()=>clearTimeout(i)},[h]),n.useEffect(()=>{if(typeof window>"u")return;const i=new URLSearchParams(window.location.search),w=i.get("tab");if(e==="my"){if(!w)return;i.delete("tab")}else{if(w===e)return;i.set("tab",e)}const O=i.toString(),Y=`${window.location.pathname}${O?`?${O}`:""}${window.location.hash}`;window.history.replaceState({},"",Y)},[e]);const I=async(i,w)=>{te(i),W("");try{await w(),await v()}catch(O){W(O?.message||S("skills.error.generic"))}finally{te("")}},U=(i,w)=>{const O=(w&&w.length?w:hr).filter(Y=>(a.targets||[]).some(le=>le.id===Y));I(pr(i),async()=>{await us(i,O);const Y=O.map(le=>(a.targets||[]).find(ce=>ce.id===le)?.label||le).join(", ");H({key:`${Date.now()}:install:${xt(i)}`,message:S("skills.toast.installed",{name:i.name||i.directory,targets:Y||S("skills.target.none")}),ttlMs:4e3})})},be=i=>{ae(i)},ke=()=>{const i=D;i&&(ae(null),I(xr(i),async()=>{let w=null;i.managed?w=await fs(i.id):await ps(i.directory,i.targets||[]);const O=!!(w?.trashed&&i.managed&&i.id);H({key:`${Date.now()}:${i.id||i.directory}`,message:S("skills.toast.removed",{name:i.name||i.directory}),undo:O?async()=>{try{await gs(i.id),await v(),H(null)}catch(Y){W(Y?.message||S("skills.error.generic"))}}:null,ttlMs:5e3})}))},F=(i,w,O)=>I(ws(i.id,w),async()=>{const Y=new Set(i.targets||[]);O?Y.add(w):Y.delete(w),i.managed?await ms(i.id,Array.from(Y)):await hs(i.directory,Array.from(Y))}),xe=async()=>{const i=h.trim();if(!(i.length<2)){te("search"),W("");try{const w=await cs(i);l(w.skills||[])}catch(w){W(w?.message||S("skills.error.generic"))}finally{te("")}}},re=async()=>{const i=M.trim().replace(/^https:\/\/github\.com\//,"").replace(/\.git$/,""),[w,O]=i.split("/");if(!w||!O){W(S("skills.repo.invalid"));return}await I("repo:add",async()=>{await xs({owner:w,name:O,branch:"main",enabled:!0}),d(""),await de(),await P()})},we=async i=>{await I(`repo:${i.owner}/${i.name}`,async()=>{await ys(i.owner,i.name),await de(),await P()})},me=a.targets||[],ue=a.skills||[],q=n.useMemo(()=>j==="all"?ue:ue.filter(i=>(i.targets||[]).includes(j)),[ue,j]),ne=j!=="all",ve=n.useMemo(()=>V&&ue.find(i=>(i.id||i.directory)===V)||null,[ue,V]),se=n.useCallback(()=>{A("all")},[]),ie=n.useCallback(i=>{Q(w=>{const O=i?.id||i?.directory||null;return w===O?null:O})},[]),Ce=n.useCallback(()=>Q(null),[]);n.useEffect(()=>{e!=="my"&&V&&Q(null)},[e,V]),n.useEffect(()=>{V&&!ve&&Q(null)},[ve,V]);const he=n.useMemo(()=>{const i=f===Pe?c:u,w=f===Pe||f===He?i:i.filter(le=>`${le.repoOwner}/${le.repoName}`===f),O=x.trim().toLowerCase();return(f===Pe||!O?w:w.filter(le=>(le.name||"").toLowerCase().includes(O)||(le.directory||"").toLowerCase().includes(O)||(le.description||"").toLowerCase().includes(O))).map(le=>{const ce=xt(le).toLowerCase(),pe=String(le.directory||"").split(/[\\/]/).pop().toLowerCase(),Re=pe?`dir:${pe}`:"";return{...le,installed:C.has(ce)||Re&&C.has(Re)}})},[x,u,C,c,f]),g=r.jsx("div",{className:"flex h-64 items-center justify-center",children:r.jsx(Ke,{className:"h-8 w-8 animate-spin text-oai-gray-400","aria-hidden":!0})}),L=r.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-3 px-6 text-center",children:[r.jsx(Ke,{className:"h-8 w-8 animate-spin text-oai-gray-400","aria-hidden":!0}),r.jsx("p",{className:"max-w-md text-xs text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.browse.loading_hint")})]}),N=(i,w=null)=>r.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:[r.jsx("p",{children:S(i)}),w]});let G;if(ye)G=g;else if(e==="my")G=ue.length?r.jsx(Ns,{items:q,totalCount:ue.length,targets:me,agentOptions:me,agentFilter:j,onAgentFilter:A,anyFilter:ne,onClearFilters:se,selectedId:V,onSelect:ie}):r.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center dark:border-oai-gray-800",children:[me.length>0?r.jsxs("div",{className:"relative h-11 w-80 overflow-hidden","aria-hidden":!0,children:[r.jsx("div",{className:"pointer-events-none absolute inset-0",style:{maskImage:"linear-gradient(to right, transparent 8%, black 20%, black 32%, transparent 44%, transparent 56%, black 68%, black 80%, transparent 92%)",WebkitMaskImage:"linear-gradient(to right, transparent 8%, black 20%, black 32%, transparent 44%, transparent 56%, black 68%, black 80%, transparent 92%)"},children:r.jsx("div",{className:"absolute inset-y-0 left-0 flex w-max items-center animate-marquee-x",style:{filter:"blur(2.5px)"},children:[...me,...me].map((i,w)=>r.jsx("span",{className:"shrink-0 px-3",children:r.jsx(tt,{provider:i.id,size:30})},`b-${w}`))})}),r.jsx("div",{className:"pointer-events-none absolute inset-0",style:{maskImage:"linear-gradient(to right, transparent 28%, black 42%, black 58%, transparent 72%)",WebkitMaskImage:"linear-gradient(to right, transparent 28%, black 42%, black 58%, transparent 72%)"},children:r.jsx("div",{className:"absolute inset-y-0 left-0 flex w-max items-center animate-marquee-x",children:[...me,...me].map((i,w)=>r.jsx("span",{className:"shrink-0 px-3",children:r.jsx(tt,{provider:i.id,size:30})},`c-${w}`))})}),r.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-20 bg-gradient-to-r from-oai-white to-transparent dark:from-oai-gray-900"}),r.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-20 bg-gradient-to-l from-oai-white to-transparent dark:from-oai-gray-900"})]}):null,r.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:S("skills.empty.my")}),r.jsx(Le,{type:"button",size:"sm",onClick:()=>t("browse"),children:S("skills.empty.my_cta")})]});else{const i=f===Pe,w=p.length===0&&!i,O=!i&&(x.trim()!==""||f!==He),Y=()=>{T(""),m(He)},le=!w&&!Z&&(he.length>0||O)?r.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 px-1 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[r.jsx("span",{children:S("skills.filter.result_count_browse",{count:he.length})}),O?r.jsxs("button",{type:"button",onClick:Y,className:"ml-auto inline-flex h-7 items-center gap-1 rounded-full bg-oai-gray-100 px-2.5 text-[11px] font-medium text-oai-gray-700 transition hover:bg-oai-gray-200 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:bg-oai-gray-800/70 dark:text-oai-gray-200 dark:hover:bg-oai-gray-700",children:[r.jsx(Nt,{className:"h-3 w-3","aria-hidden":!0}),S("skills.filter.clear")]}):null]}):null;let ce;w?ce=r.jsx("div",{className:"rounded-lg border border-dashed border-oai-gray-200 p-6 text-center dark:border-oai-gray-800",children:r.jsx("p",{className:"text-sm text-oai-gray-600 dark:text-oai-gray-300",children:S("skills.browse.empty_sources")})}):Z&&!i?ce=L:i&&h.trim().length<2?ce=r.jsx("div",{className:"rounded-lg border border-dashed border-oai-gray-200 px-4 py-6 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:S("skills.browse.hint_skillssh")}):he.length?ce=r.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:he.map(Se=>r.jsx("div",{style:Rs,children:r.jsx(Cs,{skill:Se,installed:!!Se.installed,installing:_===pr(Se),allTargets:me,defaultTargets:hr,onInstall:U})},Se.id||Se.key))}):O?ce=N("skills.empty.no_match",r.jsx(Le,{type:"button",variant:"secondary",size:"sm",onClick:Y,children:S("skills.filter.clear")})):i?ce=N("skills.empty.search"):ce=N("skills.empty.browse");const pe=w||E?r.jsx("div",{className:"mb-5",children:r.jsx(Is,{repos:p,repoInput:M,onRepoInput:d,busyKey:_,onAdd:re,onRemove:we})}):null,Re=!E&&!i&&p.length<=1&&he.length>0?r.jsx(Ga,{id:"skills-browse-intro",className:"mt-6",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[r.jsx("span",{children:S("skills.browse.add_repo_hint")}),r.jsx("button",{type:"button",onClick:()=>b(!0),className:"rounded font-medium text-oai-gray-700 underline decoration-dotted underline-offset-2 transition hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-200 dark:hover:text-white",children:S("skills.browse.manage_sources")})]})}):null;G=r.jsxs(r.Fragment,{children:[pe,le,ce,Re]})}return r.jsxs("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:[r.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"mb-6 flex items-end justify-between gap-4",children:[r.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:S("skills.page.title")}),r.jsxs(Le,{type:"button",variant:"secondary",size:"sm",onClick:J,disabled:ye||Z,children:[r.jsx(en,{className:Ue("mr-1.5 h-3.5 w-3.5",(ye||Z)&&"animate-spin"),"aria-hidden":!0}),S("skills.action.refresh")]})]}),r.jsx("div",{className:"mb-5 flex gap-6 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[["my",S("skills.tab.my")],["browse",S("skills.tab.browse")]].map(([i,w])=>r.jsx("button",{type:"button","aria-pressed":e===i,onClick:()=>t(i),className:Ue("-mb-px border-b-2 pb-2 text-sm font-medium transition-colors",e===i?"border-oai-black text-oai-black dark:border-white dark:text-white":"border-transparent text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:w},i))}),ge?r.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",children:ge}):null,e==="browse"?r.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center",children:[r.jsx("div",{role:"tablist","aria-label":S("skills.source.label"),className:"inline-flex h-10 shrink-0 items-center rounded-md border border-oai-gray-200 bg-oai-white p-1 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:[["repo",S("skills.mode.repo")],["skillssh",S("skills.mode.skillssh")]].map(([i,w])=>{const O=i==="skillssh"==(f===Pe);return r.jsx("button",{type:"button",role:"tab","aria-selected":O,onClick:()=>{i==="skillssh"?m(Pe):f===Pe&&m(He)},className:Ue("rounded px-3 py-1 text-sm font-medium transition-colors",O?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-700 dark:text-white":"text-oai-gray-500 hover:text-oai-gray-800 dark:text-oai-gray-400 dark:hover:text-oai-gray-200"),children:w},i)})}),f!==Pe?r.jsxs(_r,{value:f,onValueChange:m,children:[r.jsxs(Vr,{"aria-label":S("skills.source.label"),className:"inline-flex h-10 w-44 shrink-0 items-center justify-between gap-2 rounded-md border border-oai-gray-200 bg-oai-white px-3 text-sm text-oai-black focus:outline-none data-[popup-open]:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:data-[popup-open]:border-oai-gray-700",children:[r.jsx(Lr,{children:i=>i===He?S("skills.source.all"):i}),r.jsx(Dr,{className:"text-oai-gray-400",children:r.jsx(Sr,{className:"h-4 w-4","aria-hidden":!0})})]}),r.jsx(Fr,{children:r.jsx(Ur,{sideOffset:4,alignItemWithTrigger:!1,className:"z-[60]",children:r.jsxs(zr,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-oai-gray-200 bg-white p-1 shadow-[0_12px_32px_-12px_rgba(0,0,0,0.18)] outline-none transition-[opacity,transform] duration-150 ease-out data-[ending-style]:scale-[0.97] data-[ending-style]:opacity-0 data-[starting-style]:scale-[0.97] data-[starting-style]:opacity-0 dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:shadow-[0_12px_32px_-12px_rgba(0,0,0,0.6)]",children:[r.jsxs(kt,{value:He,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[r.jsx(jt,{children:S("skills.source.all")}),r.jsx(vt,{children:r.jsx(Ye,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),p.map(i=>{const w=`${i.owner}/${i.name}`;return r.jsxs(kt,{value:w,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[r.jsx(jt,{children:w}),r.jsx(vt,{children:r.jsx(Ye,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},w)})]})})})]}):null,r.jsxs("div",{className:"relative flex-1",children:[r.jsx(ir,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":!0}),r.jsx(qr,{type:"search",value:h,onChange:i=>T(i.target.value),onKeyDown:i=>{i.key==="Enter"&&f===Pe&&xe()},"aria-label":S("skills.action.search_aria"),placeholder:f===Pe?S("skills.browse.placeholder_skillssh"):f===He?S("skills.browse.placeholder_all"):S("skills.browse.placeholder_repo",{repo:f}),className:"pl-9 !border-oai-gray-200 dark:!border-oai-gray-800 focus:!border-oai-gray-400 focus:!ring-oai-gray-400/20 dark:focus:!border-oai-gray-500 dark:focus:!ring-oai-gray-500/20"})]}),f===Pe?r.jsxs(Le,{type:"button",onClick:xe,disabled:h.trim().length<2||_==="search",className:"focus:!ring-oai-gray-400/30",children:[_==="search"?r.jsx(Ke,{className:"mr-1.5 h-4 w-4 animate-spin","aria-hidden":!0}):r.jsx(ir,{className:"mr-1.5 h-4 w-4","aria-hidden":!0}),S("skills.action.search")]}):r.jsxs(Le,{type:"button",variant:"secondary",size:"sm",onClick:()=>b(i=>!i),"aria-expanded":E,className:"!h-10 shrink-0 whitespace-nowrap !border-oai-gray-200 dark:!border-oai-gray-800 hover:!border-oai-gray-300 dark:hover:!border-oai-gray-700 hover:!text-oai-black dark:hover:!text-white focus:!ring-oai-gray-400/30",children:[r.jsx(Nr,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),S("skills.browse.manage_sources"),r.jsx("span",{className:"ml-1.5 rounded bg-oai-gray-100 px-1.5 py-0.5 text-xs font-medium text-oai-gray-600 dark:bg-oai-gray-800 dark:text-oai-gray-300",children:p.length})]})]}):null,G,r.jsx(ss,{skill:ve,targets:me,busyKey:_,onClose:Ce,onToggleTarget:F,onRemove:be})]})}),r.jsx(Ka,{open:!!D,title:S("skills.confirm.remove_title",{name:D?.name||D?.directory||""}),description:D?D.managed?S("skills.confirm.remove_managed"):S("skills.confirm.remove_local"):"",confirmLabel:S("skills.action.remove"),cancelLabel:S("shared.action.cancel"),destructive:!0,busy:_===xr(D||{}),onCancel:()=>ae(null),onConfirm:ke}),r.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"pointer-events-none fixed inset-x-0 bottom-6 z-[90] flex justify-center px-4",children:R?r.jsxs("div",{className:"pointer-events-auto flex max-w-md items-center gap-3 rounded-full bg-oai-black px-4 py-2 text-sm text-white shadow-lg dark:bg-white dark:text-oai-black",children:[r.jsx("span",{children:R.message}),R.undo?r.jsx("button",{type:"button",onClick:R.undo,className:"rounded-full px-2 py-0.5 text-xs font-semibold uppercase tracking-wide hover:bg-white/10 dark:hover:bg-oai-black/10",children:S("shared.action.undo")}):null]}):null})]})}export{Fs as SkillsPage};
@@ -1 +1 @@
1
- import{c as T,D as e,B as o,az as P,ar as I,r as u,aA as B,R as D,a5 as p}from"./main-DKVBnAOd.js";import{u as E,T as K}from"./use-native-settings-DtuifRKC.js";import{F as v,S as z,a as $}from"./FadeIn-DjQyRfLZ.js";import{D as G}from"./download-DKMK6oF8.js";import{C as R}from"./chevron-down-kcaroSaH.js";import"./Card-Cv4wn6W8.js";import"./use-reduced-motion-Cen-UCKO.js";const H=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],O=T("arrow-up-right",H),U=["todayTokens","todayCost"],F=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaude",label:"Antigravity Claude Limit",shortLabel:"Ag Cl",category:"limits"},{id:"antigravityGPro",label:"Antigravity Gemini Pro Limit",shortLabel:"Ag GPro",category:"limits"},{id:"antigravityFlash",label:"Antigravity Flash Limit",shortLabel:"Ag Fl",category:"limits"}];function N(t,i=F,s=2){const a=new Set(i.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!a.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(r.length>0?r:U).slice(0,Math.max(1,Number(s)||2))}const X=264,Y=124,h="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],V={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Z(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const s=t==="lg",a=s?560:264,l=s?32:22;return e.jsx("div",{className:p("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",s?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:a,aspectRatio:`${X} / ${Y}`,borderRadius:l},children:i})})}function q({size:t="sm"}){const i="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",s=`${i} L264,124 L0,124 Z`,a=`sparkArea-${t}`;return e.jsx(y,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${a})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const s=[];for(let a=0;a<26;a++)for(let l=0;l<7;l++){const r=Math.sin((a+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:a,d:l,v:c})}return s})();function S(t,i){return t<18?i?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function J(){return e.jsx(y,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:C.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:C.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(r.v,!1)},`l-${r.w}-${r.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:h,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function Q(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],i=22,s=28,a=14,l=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:h,children:r.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:g})]},r.name)})})})}function ee(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],i=22,s=28,a=14,l=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=V[r.source],b=Z(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:b})]},r.label)})})})}function te(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ae(t,i){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");default:return i}}function ie(t,i){const s=new Set(i.map(l=>l.id)),a=t.filter(l=>s.has(l));for(const l of i){if(a.length>=2)break;a.includes(l.id)||a.push(l.id)}return a.slice(0,2)}function re({slotConfigs:t,showStats:i}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),i?t.map(({slot:s,item:a},l)=>e.jsxs(D.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:p("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:a?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:a?.shortLabel||"Metric"})]})]},s)):null]})})}function se({slot:t,value:i,options:s,disabled:a,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:r}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,disabled:a,"aria-label":r,onChange:c=>l(t,c.target.value),className:p("w-full appearance-none rounded-lg border border-oai-gray-200 bg-white px-3 py-2 pr-9 text-sm font-medium text-oai-black transition-colors hover:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700",a&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800"),children:s.map(c=>e.jsx("option",{value:c.id,children:c.displayLabel},c.id))}),e.jsx(R,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":"true"})]})]})}function A({label:t,hint:i,checked:s,disabled:a,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(K,{checked:s,disabled:a,onChange:l,ariaLabel:t})]})}function le(){const{available:t,settings:i,setSetting:s}=E(),a=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:F).map(m=>({...m,displayLabel:ae(m.id,m.label),previewValue:te(m)})),[i?.menuBarAvailableItems]),l=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>N(i?.menuBarItems,a,l),[a,l,i?.menuBarItems]),c=u.useMemo(()=>ie(r,a),[a,r]),n=i?.showStats!==!1,g=d=>{s("menuBarItems",N(d,a,l))},b=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,g(x))},k=[0,1].map(d=>{const m=c[d]||a[d]?.id||"",j=c[d===0?1:0],_=a.filter(f=>f.id===m||f.id!==j),W=a.find(f=>f.id===m);return{slot:d,currentValue:m,options:_,item:W}}),w=i?.animatedIcon!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(re,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:x})=>e.jsx(se,{slot:d,value:m,options:x,disabled:!t||!n,onChange:b},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(A,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>s("showStats",!n)}),e.jsx(A,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:w,disabled:!t,onChange:()=>s("animatedIcon",!w)})]})]})}function oe(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(B()){i("native");return}const s=(navigator.userAgent||"").toLowerCase(),a=/mac/.test(s)&&!/iphone|ipad/.test(s);i(a?"mac-web":"other")},[]),t}function ne(){const t=oe();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>P("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx(O,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(G,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(I,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const ce=[{id:"summary",Preview:q,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:J,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:Q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:ee,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function de({Preview:t,nameKey:i,descKey:s}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function M({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function be(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(v,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(ne,{})})]})}),e.jsx(v,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(le,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(z,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:ce.map(({id:t,Preview:i,nameKey:s,descKey:a})=>e.jsx($,{children:e.jsx(de,{Preview:i,nameKey:s,descKey:a})},t))})})]})]})})})}export{be as WidgetsPage};
1
+ import{c as T,C as e,B as o,aA as P,as as I,r as u,aB as B,R as D,a5 as p}from"./main-D0Irg9xR.js";import{u as E,T as K}from"./use-native-settings-BPXVZrWe.js";import{F as v,S as $,a as z}from"./FadeIn-CVNJ4aZy.js";import{D as G}from"./download-BZZ4vKc1.js";import{C as R}from"./chevron-down-zOKEzHdv.js";import"./Card-CD18G4Ge.js";import"./use-reduced-motion-HUOV_JD1.js";const H=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],O=T("arrow-up-right",H),U=["todayTokens","todayCost"],F=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaude",label:"Antigravity Claude Limit",shortLabel:"Ag Cl",category:"limits"},{id:"antigravityGPro",label:"Antigravity Gemini Pro Limit",shortLabel:"Ag GPro",category:"limits"},{id:"antigravityFlash",label:"Antigravity Flash Limit",shortLabel:"Ag Fl",category:"limits"}];function N(t,i=F,s=2){const a=new Set(i.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!a.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(r.length>0?r:U).slice(0,Math.max(1,Number(s)||2))}const X=264,Y=124,h="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],V={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Z(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const s=t==="lg",a=s?560:264,l=s?32:22;return e.jsx("div",{className:p("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",s?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:a,aspectRatio:`${X} / ${Y}`,borderRadius:l},children:i})})}function q({size:t="sm"}){const i="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",s=`${i} L264,124 L0,124 Z`,a=`sparkArea-${t}`;return e.jsx(y,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${a})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const s=[];for(let a=0;a<26;a++)for(let l=0;l<7;l++){const r=Math.sin((a+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:a,d:l,v:c})}return s})();function S(t,i){return t<18?i?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function J(){return e.jsx(y,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:C.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:C.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(r.v,!1)},`l-${r.w}-${r.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:h,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function Q(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],i=22,s=28,a=14,l=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:h,children:r.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:g})]},r.name)})})})}function ee(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],i=22,s=28,a=14,l=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=V[r.source],b=Z(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:b})]},r.label)})})})}function te(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ae(t,i){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");default:return i}}function ie(t,i){const s=new Set(i.map(l=>l.id)),a=t.filter(l=>s.has(l));for(const l of i){if(a.length>=2)break;a.includes(l.id)||a.push(l.id)}return a.slice(0,2)}function re({slotConfigs:t,showStats:i}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),i?t.map(({slot:s,item:a},l)=>e.jsxs(D.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:p("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:a?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:a?.shortLabel||"Metric"})]})]},s)):null]})})}function se({slot:t,value:i,options:s,disabled:a,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:r}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,disabled:a,"aria-label":r,onChange:c=>l(t,c.target.value),className:p("w-full appearance-none rounded-lg border border-oai-gray-200 bg-white px-3 py-2 pr-9 text-sm font-medium text-oai-black transition-colors hover:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700",a&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800"),children:s.map(c=>e.jsx("option",{value:c.id,children:c.displayLabel},c.id))}),e.jsx(R,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":"true"})]})]})}function A({label:t,hint:i,checked:s,disabled:a,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(K,{checked:s,disabled:a,onChange:l,ariaLabel:t})]})}function le(){const{available:t,settings:i,setSetting:s}=E(),a=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:F).map(m=>({...m,displayLabel:ae(m.id,m.label),previewValue:te(m)})),[i?.menuBarAvailableItems]),l=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>N(i?.menuBarItems,a,l),[a,l,i?.menuBarItems]),c=u.useMemo(()=>ie(r,a),[a,r]),n=i?.showStats!==!1,g=d=>{s("menuBarItems",N(d,a,l))},b=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,g(x))},k=[0,1].map(d=>{const m=c[d]||a[d]?.id||"",j=c[d===0?1:0],_=a.filter(f=>f.id===m||f.id!==j),W=a.find(f=>f.id===m);return{slot:d,currentValue:m,options:_,item:W}}),w=i?.animatedIcon!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(re,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:x})=>e.jsx(se,{slot:d,value:m,options:x,disabled:!t||!n,onChange:b},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(A,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>s("showStats",!n)}),e.jsx(A,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:w,disabled:!t,onChange:()=>s("animatedIcon",!w)})]})]})}function oe(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(B()){i("native");return}const s=(navigator.userAgent||"").toLowerCase(),a=/mac/.test(s)&&!/iphone|ipad/.test(s);i(a?"mac-web":"other")},[]),t}function ne(){const t=oe();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>P("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx(O,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(G,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(I,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const ce=[{id:"summary",Preview:q,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:J,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:Q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:ee,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function de({Preview:t,nameKey:i,descKey:s}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function M({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function be(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(v,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(ne,{})})]})}),e.jsx(v,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(le,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx($,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:ce.map(({id:t,Preview:i,nameKey:s,descKey:a})=>e.jsx(z,{children:e.jsx(de,{Preview:i,nameKey:s,descKey:a})},t))})})]})]})})})}export{be as WidgetsPage};
@@ -0,0 +1 @@
1
+ import{r as l,C as e,E as y}from"./main-D0Irg9xR.js";function o(a){return Number.isFinite(a)?Math.abs(a)>=1e12?(a/1e12).toFixed(2).replace(/\.?0+$/,"")+"T":y(a,{decimals:2}):"0"}function r({children:a,accent:n=!1,className:i=""}){const c="rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 p-6 bg-white dark:bg-oai-gray-900",d=n?"bg-gradient-to-br from-emerald-50 to-cyan-50 dark:from-emerald-900/30 dark:to-cyan-900/30 border-transparent":"";return e.jsx("div",{className:`${c} ${d} ${i}`,children:a})}function u(){const[a,n]=l.useState(null),[i,c]=l.useState("loading"),[d,g]=l.useState("");if(l.useEffect(()=>{let t=!1;const h=new URLSearchParams(window.location.search).get("year"),p=h?`/functions/tokentracker-wrapped?year=${encodeURIComponent(h)}`:"/functions/tokentracker-wrapped";return fetch(p).then(async s=>{if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.json()}).then(s=>{t||(n(s),c(s.totals&&s.totals.tokens>0?"ready":"empty"))}).catch(s=>{t||(g(String(s?.message||s)),c("error"))}),()=>{t=!0}},[]),i==="loading")return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center",children:e.jsx("p",{className:"text-oai-gray-500",children:"Loading…"})});if(i==="error")return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center px-6",children:e.jsx(r,{children:e.jsxs("p",{className:"text-red-600 dark:text-red-300",children:["Couldn't load Wrapped: ",d]})})});if(i==="empty"||!a)return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center px-6",children:e.jsx(r,{children:e.jsxs("p",{className:"text-oai-gray-500",children:["No data for that year yet. Run ",e.jsx("code",{children:"tracker sync"})," first."]})})});const x=t=>`${(t*100).toFixed(0)}%`;return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-white to-oai-gray-50 dark:from-oai-gray-950 dark:to-oai-gray-900 px-6 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[e.jsxs("header",{className:"text-center pb-6",children:[e.jsx("p",{className:"text-sm uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:"TokenTracker Wrapped"}),e.jsx("h1",{className:"text-6xl font-bold text-oai-gray-900 dark:text-white mt-2",children:a.year})]}),e.jsxs(r,{accent:!0,className:"text-center",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300",children:"Total tokens"}),e.jsx("p",{className:"text-7xl font-bold text-emerald-700 dark:text-emerald-300 mt-2",children:o(a.totals.tokens)}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-4",children:["across ",e.jsx("strong",{children:a.totals.conversations.toLocaleString("en-US")})," conversations,"," ",e.jsx("strong",{children:a.totals.active_days})," active days, and"," ",e.jsx("strong",{children:a.totals.sources})," tools"]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(r,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:"Top tools"}),e.jsx("ul",{className:"space-y-3",children:a.top.sources.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white",children:t.source}),e.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm",children:[o(t.tokens)," · ",x(t.share)]})]},t.source))})]}),e.jsxs(r,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:"Top models"}),e.jsx("ul",{className:"space-y-3",children:a.top.models.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white truncate pr-3",children:t.model}),e.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm whitespace-nowrap",children:[o(t.tokens)," · ",x(t.share)]})]},t.model))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.peak_hour&&e.jsxs(r,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:"Peak hour"}),e.jsxs("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:[String(a.peak_hour.hour).padStart(2,"0"),":00 UTC"]}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:[o(a.peak_hour.tokens)," tokens"]})]}),a.longest_streak&&a.longest_streak.days>0&&e.jsxs(r,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:"Longest streak"}),e.jsxs("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:[a.longest_streak.days," days"]}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:[a.longest_streak.from," → ",a.longest_streak.to]})]})]}),a.top.days.length>0&&e.jsxs(r,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:"Top days"}),e.jsx("ul",{className:"space-y-2",children:a.top.days.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white font-mono text-sm",children:t.day}),e.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm",children:o(t.tokens)})]},t.day))})]}),a.highlights.length>0&&e.jsxs(r,{accent:!0,children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300 mb-3",children:"Highlights"}),e.jsx("ul",{className:"space-y-2 text-oai-gray-800 dark:text-oai-gray-200",children:a.highlights.map((t,m)=>e.jsxs("li",{className:"text-base",children:["· ",t]},m))})]}),e.jsxs("footer",{className:"text-center text-xs text-oai-gray-400 dark:text-oai-gray-500 pt-6",children:["Generated from local queue.jsonl · share with"," ",e.jsx("code",{className:"font-mono",children:"tracker wrapped --json"})]})]})})}export{u as default};
@@ -0,0 +1 @@
1
+ import{c}from"./main-D0Irg9xR.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
@@ -1 +1 @@
1
- import{c as o}from"./main-DKVBnAOd.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
1
+ import{c as o}from"./main-D0Irg9xR.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
@@ -1 +1 @@
1
- import{c as o}from"./main-DKVBnAOd.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
1
+ import{c as o}from"./main-D0Irg9xR.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
@@ -1 +1 @@
1
- import{R as c,D as n,a5 as i}from"./main-DKVBnAOd.js";function y(e){let r=0;const o=String(e??"");for(let a=0;a<o.length;a+=1)r=Math.imul(31,r)+o.charCodeAt(a)|0;return Math.abs(r)%360}function m(e){const r=String(e??"").trim();if(!r)return"?";const o=r.split(/\s+/).filter(Boolean);if(o.length>=2){const a=o[0][0]||"",t=o[1][0]||"";return`${a}${t}`.toUpperCase()}return r.slice(0,2).toUpperCase()}const g={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base"};function h({avatarUrl:e,displayName:r,seed:o,size:a="md",className:t}){const d=g[a]||g.md,p=y(o??r??""),s=typeof e=="string"?e.trim():"",[b,l]=c.useState(!1);return c.useEffect(()=>{l(!1)},[s]),s&&!b?n.jsx("img",{src:s,alt:"",referrerPolicy:"no-referrer",onError:()=>l(!0),className:i("rounded-full object-cover ring-1 ring-white/10",d,t)}):n.jsx("div",{className:i("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",d,t),style:{backgroundColor:`hsl(${p} 42% 34%)`},"aria-hidden":!0,children:m(r)})}const u=new Set(["/brand-logos/cursor.svg","/brand-logos/kiro.svg","/brand-logos/copilot.svg"]);function w({iconSrc:e,label:r}){return n.jsxs("span",{className:"inline-flex items-center gap-3",children:[e?n.jsx("img",{src:e,alt:"",width:16,height:16,className:`h-4 w-4 shrink-0 object-contain opacity-90 ${u.has(e)?"dark:invert":""}`}):null,n.jsx("span",{className:"whitespace-nowrap",children:r})]})}const x=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"kiro_tokens",copyKey:"leaderboard.column.kiro",icon:"/brand-logos/kiro.svg"},{key:"copilot_tokens",copyKey:"leaderboard.column.copilot",icon:"/brand-logos/copilot.svg"},{key:"kimi_tokens",copyKey:"leaderboard.column.kimi",icon:"/brand-logos/kimi.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"hermes_tokens",copyKey:"leaderboard.column.hermes",icon:null},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:null}],f="sticky left-0 z-40 w-[72px] min-w-[72px] max-w-[72px] bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",_="sticky left-[71px] z-40 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",v="sticky left-[71px] z-40 min-w-[6rem] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4";function K(e){return i("sticky left-0 z-30 w-[72px] min-w-[72px] max-w-[72px] px-4 py-4 whitespace-nowrap",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function T(e){return i("sticky left-[71px] z-30 hover:z-50 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 min-w-0",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function S(e){return i("sticky left-[71px] z-30 min-w-[6rem] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap","bg-white dark:bg-oai-gray-950")}export{f as L,_ as a,x as b,T as c,h as d,w as e,S as f,v as g,K as l};
1
+ import{R as c,C as n,a5 as i}from"./main-D0Irg9xR.js";function y(e){let r=0;const o=String(e??"");for(let a=0;a<o.length;a+=1)r=Math.imul(31,r)+o.charCodeAt(a)|0;return Math.abs(r)%360}function m(e){const r=String(e??"").trim();if(!r)return"?";const o=r.split(/\s+/).filter(Boolean);if(o.length>=2){const a=o[0][0]||"",t=o[1][0]||"";return`${a}${t}`.toUpperCase()}return r.slice(0,2).toUpperCase()}const g={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base"};function h({avatarUrl:e,displayName:r,seed:o,size:a="md",className:t}){const d=g[a]||g.md,p=y(o??r??""),s=typeof e=="string"?e.trim():"",[b,l]=c.useState(!1);return c.useEffect(()=>{l(!1)},[s]),s&&!b?n.jsx("img",{src:s,alt:"",referrerPolicy:"no-referrer",onError:()=>l(!0),className:i("rounded-full object-cover ring-1 ring-white/10",d,t)}):n.jsx("div",{className:i("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",d,t),style:{backgroundColor:`hsl(${p} 42% 34%)`},"aria-hidden":!0,children:m(r)})}const u=new Set(["/brand-logos/cursor.svg","/brand-logos/kiro.svg","/brand-logos/copilot.svg"]);function w({iconSrc:e,label:r}){return n.jsxs("span",{className:"inline-flex items-center gap-3",children:[e?n.jsx("img",{src:e,alt:"",width:16,height:16,className:`h-4 w-4 shrink-0 object-contain opacity-90 ${u.has(e)?"dark:invert":""}`}):null,n.jsx("span",{className:"whitespace-nowrap",children:r})]})}const x=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"kiro_tokens",copyKey:"leaderboard.column.kiro",icon:"/brand-logos/kiro.svg"},{key:"copilot_tokens",copyKey:"leaderboard.column.copilot",icon:"/brand-logos/copilot.svg"},{key:"kimi_tokens",copyKey:"leaderboard.column.kimi",icon:"/brand-logos/kimi.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"hermes_tokens",copyKey:"leaderboard.column.hermes",icon:null},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:null}],f="sticky left-0 z-40 w-[72px] min-w-[72px] max-w-[72px] bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",_="sticky left-[71px] z-40 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",v="sticky left-[71px] z-40 min-w-[6rem] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4";function K(e){return i("sticky left-0 z-30 w-[72px] min-w-[72px] max-w-[72px] px-4 py-4 whitespace-nowrap",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function T(e){return i("sticky left-[71px] z-30 hover:z-50 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 min-w-0",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function S(e){return i("sticky left-[71px] z-30 min-w-[6rem] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap","bg-white dark:bg-oai-gray-950")}export{f as L,_ as a,x as b,T as c,h as d,w as e,S as f,v as g,K as l};