@nervekit/desktop 0.41.1 → 0.43.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 (678) hide show
  1. package/README.md +1 -1
  2. package/THIRD-PARTY-LICENSES.txt +338 -16
  3. package/dist/builtin/configure-nerve/SKILL.md +103 -0
  4. package/dist/builtin/configure-nerve/reference/agent-preferences.md +9 -0
  5. package/dist/builtin/configure-nerve/reference/agent-profiles.md +106 -0
  6. package/dist/builtin/configure-nerve/reference/agents-md.md +26 -0
  7. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/artifacts.d.ts +10 -0
  8. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/authorization.d.ts +45 -0
  9. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/credentials.d.ts +246 -0
  10. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/define.d.ts +23 -0
  11. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/definition.d.ts +345 -0
  12. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/errors.d.ts +31 -0
  13. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/index.d.ts +11 -0
  14. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/settings.d.ts +348 -0
  15. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/testing.d.ts +180 -0
  16. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/text.d.ts +4 -0
  17. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/types.d.ts +415 -0
  18. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/components.d.ts +47 -0
  19. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/floating-toolbar-menu.svelte.d.ts +19 -0
  20. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/item-menu.svelte.d.ts +4 -0
  21. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/select-field.svelte.d.ts +26 -0
  22. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/collections/command-filter.d.ts +20 -0
  23. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/collections/lru-cache.d.ts +19 -0
  24. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/collections/match-terms.d.ts +8 -0
  25. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/callout/callout.svelte.d.ts +22 -0
  26. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/callout/index.d.ts +1 -0
  27. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-focus.d.ts +15 -0
  28. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-list-item.svelte.d.ts +16 -0
  29. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-list-items.svelte.d.ts +7 -0
  30. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-list-label.svelte.d.ts +10 -0
  31. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-list-separator.svelte.d.ts +6 -0
  32. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-list-sub.svelte.d.ts +11 -0
  33. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/context-menu-list.svelte.d.ts +84 -0
  34. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/context-menu-list/index.d.ts +6 -0
  35. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-layer.svelte.d.ts +17 -0
  36. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-motion.d.ts +40 -0
  37. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-notice.svelte.d.ts +14 -0
  38. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-panel.svelte.d.ts +17 -0
  39. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-toolbar-button.svelte.d.ts +32 -0
  40. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-toolbar-group.svelte.d.ts +15 -0
  41. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-toolbar-text.svelte.d.ts +15 -0
  42. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/floating-toolbar.svelte.d.ts +15 -0
  43. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/floating-toolbar/index.d.ts +8 -0
  44. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/group-label/group-label.svelte.d.ts +14 -0
  45. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/group-label/index.d.ts +1 -0
  46. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/icon-action/icon-action.svelte.d.ts +32 -0
  47. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/icon-action/index.d.ts +2 -0
  48. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/item-menu/index.d.ts +4 -0
  49. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/item-menu/item-menu-renderer.d.ts +28 -0
  50. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/item-menu/item-menu.svelte.d.ts +16 -0
  51. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/item-surface/index.d.ts +1 -0
  52. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/item-surface/item-surface.svelte.d.ts +32 -0
  53. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/field-row.svelte.d.ts +30 -0
  54. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/index.d.ts +10 -0
  55. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-empty-state.svelte.d.ts +21 -0
  56. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-header.svelte.d.ts +23 -0
  57. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-item.svelte.d.ts +63 -0
  58. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-list.svelte.d.ts +12 -0
  59. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-section.svelte.d.ts +40 -0
  60. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-stat-grid.svelte.d.ts +20 -0
  61. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/page-view.svelte.d.ts +12 -0
  62. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/page/toggle-row.svelte.d.ts +20 -0
  63. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/index.d.ts +17 -0
  64. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-card.svelte.d.ts +33 -0
  65. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-empty.svelte.d.ts +15 -0
  66. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-header.svelte.d.ts +14 -0
  67. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-list.svelte.d.ts +13 -0
  68. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-reorder.d.ts +63 -0
  69. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-row-card.svelte.d.ts +20 -0
  70. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-row-fit.svelte.d.ts +19 -0
  71. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-row.svelte.d.ts +141 -0
  72. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-section-header.svelte.d.ts +17 -0
  73. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-selection.d.ts +44 -0
  74. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-selection.svelte.d.ts +23 -0
  75. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-toolbar-button.svelte.d.ts +39 -0
  76. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-tree.d.ts +80 -0
  77. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-tree.svelte.d.ts +140 -0
  78. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel/panel-view.svelte.d.ts +14 -0
  79. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-filter-bar/index.d.ts +2 -0
  80. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-filter-bar/panel-filter-bar.svelte.d.ts +35 -0
  81. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-section/index.d.ts +1 -0
  82. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-section/panel-section.svelte.d.ts +35 -0
  83. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-split/index.d.ts +3 -0
  84. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-split/panel-split-sizing.d.ts +71 -0
  85. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/panel-split/panel-split.svelte.d.ts +46 -0
  86. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/animate-trigger-width.d.ts +14 -0
  87. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/index.d.ts +16 -0
  88. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/list-navigation.svelte.d.ts +26 -0
  89. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-body.svelte.d.ts +16 -0
  90. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-command-list.svelte.d.ts +74 -0
  91. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-footer.svelte.d.ts +8 -0
  92. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-header.svelte.d.ts +14 -0
  93. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-meter.svelte.d.ts +15 -0
  94. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-panel.svelte.d.ts +50 -0
  95. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-properties.svelte.d.ts +8 -0
  96. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-property.svelte.d.ts +12 -0
  97. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-search.svelte.d.ts +8 -0
  98. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-section.svelte.d.ts +13 -0
  99. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/popover-views.svelte.d.ts +11 -0
  100. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/popover-panel/presentation.d.ts +8 -0
  101. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/progress-ring/index.d.ts +2 -0
  102. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/progress-ring/progress-ring.svelte.d.ts +12 -0
  103. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/radio-group-field/index.d.ts +2 -0
  104. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/radio-group-field/radio-group-field.svelte.d.ts +30 -0
  105. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/scroll-region/index.d.ts +3 -0
  106. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/scroll-region/scroll-edges.d.ts +16 -0
  107. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/scroll-region/scroll-region.svelte.d.ts +26 -0
  108. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/search-input/index.d.ts +2 -0
  109. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/search-input/search-input.svelte.d.ts +40 -0
  110. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/select-field/index.d.ts +2 -0
  111. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/select-field/select-field.svelte.d.ts +28 -0
  112. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/select-row/index.d.ts +2 -0
  113. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/select-row/select-row.svelte.d.ts +107 -0
  114. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/status-dot/index.d.ts +3 -0
  115. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/status-dot/status-dot.svelte.d.ts +76 -0
  116. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/switch-field/index.d.ts +1 -0
  117. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/switch-field/switch-field.svelte.d.ts +17 -0
  118. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/index.d.ts +2 -0
  119. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/row-height-cache.d.ts +14 -0
  120. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/scroll-metrics.d.ts +16 -0
  121. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/virtual-measurement.d.ts +3 -0
  122. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/virtual-scroll-jump.d.ts +11 -0
  123. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/virtual-scroller-identity.d.ts +39 -0
  124. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/virtual-scroller-types.d.ts +100 -0
  125. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/virtual-list/virtual-scroller.svelte.d.ts +26 -0
  126. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/badge/badge.svelte.d.ts +50 -0
  127. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/badge/index.d.ts +1 -0
  128. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/button/button.svelte.d.ts +68 -0
  129. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/button/index.d.ts +2 -0
  130. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/checkbox/checkbox.svelte.d.ts +5 -0
  131. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/checkbox/index.d.ts +2 -0
  132. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/collapsible/collapsible-content.svelte.d.ts +5 -0
  133. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/collapsible/collapsible-trigger.svelte.d.ts +5 -0
  134. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/collapsible/collapsible.svelte.d.ts +5 -0
  135. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/collapsible/index.d.ts +4 -0
  136. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-checkbox-item.svelte.d.ts +10 -0
  137. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-content.svelte.d.ts +10 -0
  138. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-group-heading.svelte.d.ts +7 -0
  139. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-group.svelte.d.ts +4 -0
  140. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-item.svelte.d.ts +8 -0
  141. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-portal.svelte.d.ts +3 -0
  142. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-radio-group.svelte.d.ts +4 -0
  143. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-radio-item.svelte.d.ts +8 -0
  144. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-separator.svelte.d.ts +4 -0
  145. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-shortcut.svelte.d.ts +5 -0
  146. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-sub-content.svelte.d.ts +4 -0
  147. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +8 -0
  148. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-sub.svelte.d.ts +3 -0
  149. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu-trigger.svelte.d.ts +4 -0
  150. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/context-menu.svelte.d.ts +3 -0
  151. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/context-menu/index.d.ts +16 -0
  152. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/empty-content.svelte.d.ts +6 -0
  153. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/empty-description.svelte.d.ts +6 -0
  154. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/empty-header.svelte.d.ts +6 -0
  155. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/empty-media.svelte.d.ts +28 -0
  156. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/empty-title.svelte.d.ts +6 -0
  157. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/empty.svelte.d.ts +6 -0
  158. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/empty/index.d.ts +7 -0
  159. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/input/index.d.ts +2 -0
  160. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/input/input.svelte.d.ts +20 -0
  161. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/kbd/index.d.ts +2 -0
  162. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/kbd/kbd.svelte.d.ts +6 -0
  163. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/label/index.d.ts +2 -0
  164. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/label/label.svelte.d.ts +5 -0
  165. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/progress/index.d.ts +2 -0
  166. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/progress/progress.svelte.d.ts +5 -0
  167. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/radio-group/index.d.ts +3 -0
  168. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/radio-group/radio-group-item.svelte.d.ts +5 -0
  169. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/radio-group/radio-group.svelte.d.ts +5 -0
  170. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/resizable/index.d.ts +4 -0
  171. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/resizable/resizable-handle.svelte.d.ts +10 -0
  172. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/resizable/resizable-pane-group.svelte.d.ts +9 -0
  173. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/scroll-area/index.d.ts +2 -0
  174. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/scroll-area/scroll-area.svelte.d.ts +16 -0
  175. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/select/index.d.ts +6 -0
  176. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/select/select-content.svelte.d.ts +11 -0
  177. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/select/select-item.svelte.d.ts +4 -0
  178. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/select/select-portal.svelte.d.ts +3 -0
  179. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/select/select-trigger.svelte.d.ts +4 -0
  180. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/select/select.svelte.d.ts +3 -0
  181. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/separator/index.d.ts +2 -0
  182. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/separator/separator.svelte.d.ts +5 -0
  183. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/sheet/sheet-content.svelte.d.ts +14 -0
  184. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/sheet/sheet-overlay.svelte.d.ts +4 -0
  185. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/sheet/sheet-portal.svelte.d.ts +3 -0
  186. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/sheet/sheet-swipe.d.ts +18 -0
  187. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/skeleton/index.d.ts +2 -0
  188. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/skeleton/skeleton.svelte.d.ts +6 -0
  189. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/spinner/index.d.ts +1 -0
  190. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/spinner/spinner.svelte.d.ts +9 -0
  191. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/switch/index.d.ts +2 -0
  192. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/switch/switch.svelte.d.ts +10 -0
  193. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tabs/index.d.ts +5 -0
  194. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tabs/tabs-content.svelte.d.ts +5 -0
  195. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tabs/tabs-list.svelte.d.ts +5 -0
  196. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tabs/tabs-trigger.svelte.d.ts +5 -0
  197. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tabs/tabs.svelte.d.ts +5 -0
  198. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/textarea/index.d.ts +2 -0
  199. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/textarea/textarea.svelte.d.ts +6 -0
  200. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/toggle-group/index.d.ts +3 -0
  201. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/toggle-group/toggle-group-item.svelte.d.ts +7 -0
  202. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/toggle-group/toggle-group.svelte.d.ts +46 -0
  203. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tooltip/index.d.ts +6 -0
  204. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tooltip/tooltip-content.svelte.d.ts +14 -0
  205. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tooltip/tooltip-portal.svelte.d.ts +5 -0
  206. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tooltip/tooltip-provider.svelte.d.ts +5 -0
  207. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tooltip/tooltip-trigger.svelte.d.ts +26 -0
  208. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/ui/tooltip/tooltip.svelte.d.ts +26 -0
  209. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/display/status.d.ts +12 -0
  210. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/index.d.ts +1 -0
  211. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/utils.d.ts +16 -0
  212. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/frame/bridge-types.d.ts +414 -0
  213. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/frame/client.d.ts +84 -0
  214. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/frame/host.d.ts +237 -0
  215. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/frame/testing.d.ts +164 -0
  216. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/index.d.ts +1 -0
  217. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/testing.d.ts +4 -0
  218. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/ui.d.ts +6 -0
  219. package/dist/builtin/configure-nerve/reference/extensions/api.md +41 -0
  220. package/dist/builtin/configure-nerve/reference/extensions/backend.md +147 -0
  221. package/dist/builtin/configure-nerve/reference/extensions/build.md +101 -0
  222. package/dist/builtin/configure-nerve/reference/extensions/components.md +105 -0
  223. package/dist/builtin/configure-nerve/reference/extensions/manifest.md +38 -0
  224. package/dist/builtin/configure-nerve/reference/extensions/overview.md +75 -0
  225. package/dist/builtin/configure-nerve/reference/extensions/scripts/create-extension.mjs +142 -0
  226. package/dist/builtin/configure-nerve/reference/extensions/scripts/install-extension.mjs +47 -0
  227. package/dist/builtin/configure-nerve/reference/extensions/scripts/lib.mjs +241 -0
  228. package/dist/builtin/configure-nerve/reference/extensions/scripts/nerve-version.json +1 -0
  229. package/dist/builtin/configure-nerve/reference/extensions/scripts/upgrade-extension.mjs +65 -0
  230. package/dist/builtin/configure-nerve/reference/extensions/security.md +27 -0
  231. package/dist/builtin/configure-nerve/reference/extensions/sharing.md +27 -0
  232. package/dist/builtin/configure-nerve/reference/extensions/themes.md +34 -0
  233. package/dist/builtin/configure-nerve/reference/extensions/ui-patterns.md +218 -0
  234. package/dist/builtin/configure-nerve/reference/extensions/ui.md +207 -0
  235. package/dist/builtin/configure-nerve/reference/launches.md +93 -0
  236. package/dist/builtin/configure-nerve/reference/mcp.md +81 -0
  237. package/dist/builtin/configure-nerve/reference/permission-matchers.md +55 -0
  238. package/dist/builtin/configure-nerve/reference/permissions.md +233 -0
  239. package/dist/builtin/configure-nerve/reference/prompt-suggestions.md +57 -0
  240. package/dist/builtin/configure-nerve/reference/schemas/agent-preferences.schema.json +1 -0
  241. package/dist/builtin/configure-nerve/reference/schemas/agent-profile.schema.json +1 -0
  242. package/dist/builtin/configure-nerve/reference/schemas/launch-definitions.schema.json +1 -0
  243. package/dist/builtin/configure-nerve/reference/schemas/permission-overlays.schema.json +1 -0
  244. package/dist/builtin/configure-nerve/reference/schemas/permission-rule-set.schema.json +1 -0
  245. package/dist/builtin/configure-nerve/reference/skills.md +76 -0
  246. package/dist/builtin/configure-nerve/writing-for-agents.md +44 -0
  247. package/dist/builtin/engineering-docs/SKILL.md +33 -35
  248. package/dist/builtin/engineering-docs/reference/agent-files.md +51 -0
  249. package/dist/builtin/engineering-docs/reference/architecture.md +2 -2
  250. package/dist/builtin/engineering-docs/reference/proposals.md +37 -29
  251. package/dist/builtin/engineering-docs/scripts/doccheck.mjs +51 -44
  252. package/dist/{chunk-QFK2SWD2.js → chunk-34SYO66C.js} +11 -11
  253. package/dist/{chunk-6ZS7TA6E.js → chunk-35O66NLU.js} +2 -2
  254. package/dist/chunk-54GJIXAU.js +41 -0
  255. package/dist/{chunk-7FSH3ABG.js → chunk-57A5HFXL.js} +4 -4
  256. package/dist/{chunk-EF7ZZKA3.js → chunk-5K7U6UXA.js} +3 -3
  257. package/dist/{chunk-WIQEPAUG.js → chunk-5S5O3V5G.js} +11 -10
  258. package/dist/{chunk-APY4TUR3.js → chunk-5VLAJMQQ.js} +250 -109
  259. package/dist/{chunk-MI6L5CEA.js → chunk-5WMHGTVL.js} +2 -2
  260. package/dist/{chunk-NVVW3MWJ.js → chunk-6IJORN3N.js} +9 -9
  261. package/dist/{chunk-OMCM3MHS.js → chunk-7GSR2AW5.js} +10 -9
  262. package/dist/{chunk-WG62RHZ2.js → chunk-7MJT6LHU.js} +14 -4
  263. package/dist/{chunk-DDBE2VLT.js → chunk-A3OFIREH.js} +2 -2
  264. package/dist/{chunk-ZGWXLG5X.js → chunk-BNBEFI2M.js} +66 -76
  265. package/dist/{chunk-7RPHIJT3.js → chunk-C7L4BBGD.js} +4 -4
  266. package/dist/{chunk-2ICPO4UM.js → chunk-CZXRZEV4.js} +16 -14
  267. package/dist/{chunk-OO2KD2L2.js → chunk-EBDLSTDH.js} +100371 -77619
  268. package/dist/{chunk-PVPJAGWR.js → chunk-EOZLBW5E.js} +2 -2
  269. package/dist/{chunk-U5KGV63C.js → chunk-EZJH7ED5.js} +1 -1
  270. package/dist/{chunk-RL52LSTV.js → chunk-F3X2KHP4.js} +1 -1
  271. package/dist/{chunk-Q3C7TQ2M.js → chunk-FNWUCFVO.js} +3 -3
  272. package/dist/chunk-FQVIQOV5.js +163 -0
  273. package/dist/{chunk-LP4APBBQ.js → chunk-FZ7U3GZI.js} +1 -1
  274. package/dist/{chunk-LGIIT2NF.js → chunk-G5SVCJCT.js} +39 -51
  275. package/dist/{chunk-62DQXVPO.js → chunk-HDTS5AS5.js} +26 -7
  276. package/dist/{chunk-BN5YDZUZ.js → chunk-HKBJTS2Z.js} +418 -95
  277. package/dist/{chunk-WC5HHPPM.js → chunk-HRJJKZGM.js} +1 -1
  278. package/dist/chunk-I7OMW4RJ.js +87 -0
  279. package/dist/{chunk-TQURLRHD.js → chunk-IL67WXRA.js} +1 -1
  280. package/dist/{chunk-RLN3MFAK.js → chunk-JYWXPSUY.js} +3 -36
  281. package/dist/{chunk-RTB6CF7F.js → chunk-KBBBQCYV.js} +189 -440
  282. package/dist/{chunk-KUFIFCB4.js → chunk-KDGUQYYY.js} +1 -1
  283. package/dist/chunk-KKPRPUSK.js +427 -0
  284. package/dist/{chunk-IRRR3PWN.js → chunk-KQD4DYEP.js} +68 -35
  285. package/dist/{chunk-JBEWFFOK.js → chunk-LIIGX2XX.js} +1 -1
  286. package/dist/{chunk-IVBMHEPK.js → chunk-LX33FMTS.js} +23 -36
  287. package/dist/{chunk-HPINJGBO.js → chunk-METH7J6V.js} +13 -12
  288. package/dist/{chunk-N6BUYKF3.js → chunk-MLE6MKPY.js} +7 -7
  289. package/dist/{chunk-3CZXUKLG.js → chunk-MRDORR5Z.js} +8 -1
  290. package/dist/{chunk-6IHXVT5H.js → chunk-NSISYP6D.js} +1 -1
  291. package/dist/{chunk-P72Y5ZBH.js → chunk-O2IYZBX6.js} +15 -26
  292. package/dist/{chunk-TSAUBRRU.js → chunk-P7GPT4XL.js} +1 -1
  293. package/dist/{chunk-4OCDR4DU.js → chunk-PA37GH3T.js} +34 -58
  294. package/dist/{chunk-BACYVEE6.js → chunk-QC6DSC4D.js} +2 -2
  295. package/dist/{chunk-ZVH6EB7S.js → chunk-QKRWXA5W.js} +1 -1
  296. package/dist/{chunk-KEXKZKN4.js → chunk-QQPLW3ZX.js} +17377 -13413
  297. package/dist/chunk-QQPLW3ZX.js.LEGAL.txt +59 -0
  298. package/dist/{chunk-N4OXAS3A.js → chunk-R22FWLXU.js} +1 -1
  299. package/dist/{chunk-7HGFEQSD.js → chunk-R7UJIPJA.js} +5 -5
  300. package/dist/{chunk-NW3DH7IK.js → chunk-RAHBWFWV.js} +8457 -2726
  301. package/dist/chunk-RGDXDX7B.js +777 -0
  302. package/dist/chunk-RGDXDX7B.js.LEGAL.txt +4 -0
  303. package/dist/{chunk-O5JHHRFN.js → chunk-RMV6IZ2C.js} +32 -116
  304. package/dist/{chunk-Z6AY5VOZ.js → chunk-RQIN5JYO.js} +9 -6
  305. package/dist/{chunk-Q5E4ZL2R.js → chunk-S2UG5HD6.js} +1 -1
  306. package/dist/{chunk-U3TEC52G.js → chunk-S637DPAG.js} +1 -1
  307. package/dist/chunk-S6KM4DOB.js +37 -0
  308. package/dist/{chunk-VOATSLRG.js → chunk-SVX46YXY.js} +1 -3
  309. package/dist/{chunk-XTUSLUQ7.js → chunk-TLDULBKV.js} +70 -24
  310. package/dist/{chunk-L5WGVYXM.js → chunk-UFE7IMKQ.js} +2 -2
  311. package/dist/{chunk-ZUWBEV2O.js → chunk-UQHUYEFW.js} +1 -1
  312. package/dist/{chunk-XM27UVWN.js → chunk-V7WOX4O7.js} +3 -3
  313. package/dist/{chunk-W7LEYYFH.js → chunk-WJAHXDL4.js} +41 -32
  314. package/dist/{chunk-6GUJQURI.js → chunk-WLTE6OJM.js} +2 -2
  315. package/dist/{chunk-BG2KGLIA.js → chunk-WMZAJ7XA.js} +2 -2
  316. package/dist/chunk-WOLKTL4F.js +32 -0
  317. package/dist/{chunk-FZ557YWE.js → chunk-XIVWNWL7.js} +5838 -3283
  318. package/dist/{chunk-EUT45AKW.js → chunk-YODV42KQ.js} +25 -32
  319. package/dist/{chunk-FCAIYPDJ.js → chunk-ZFFWWZIA.js} +2 -2
  320. package/dist/{chunk-O6FDXE54.js → chunk-ZVUAJ7UV.js} +25 -36
  321. package/dist/daemon.js +43 -3438
  322. package/dist/ext-frame/assets/iosevka-latin-400-normal-7stTb90X.woff2 +0 -0
  323. package/dist/ext-frame/assets/iosevka-latin-500-normal-CQO8XnuS.woff2 +0 -0
  324. package/dist/ext-frame/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
  325. package/dist/ext-frame/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
  326. package/dist/ext-frame/assets/outfit-latin-500-normal-ClnHRwRh.woff +0 -0
  327. package/dist/ext-frame/assets/outfit-latin-500-normal-DKnIMDSk.woff2 +0 -0
  328. package/dist/ext-frame/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
  329. package/dist/ext-frame/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
  330. package/dist/ext-frame/assets/outfit-latin-ext-400-normal-5tcqmc2S.woff2 +0 -0
  331. package/dist/ext-frame/assets/outfit-latin-ext-400-normal-DHm7mdGe.woff +0 -0
  332. package/dist/ext-frame/assets/outfit-latin-ext-500-normal-DrCvqoFD.woff +0 -0
  333. package/dist/ext-frame/assets/outfit-latin-ext-500-normal-zeox_O30.woff2 +0 -0
  334. package/dist/ext-frame/assets/outfit-latin-ext-600-normal-B85nYjL1.woff2 +0 -0
  335. package/dist/ext-frame/assets/outfit-latin-ext-600-normal-CWJcPgd7.woff +0 -0
  336. package/dist/ext-frame/base.css +3 -0
  337. package/dist/extension-assets/atlassian/docs/confluence-writing.md +5 -5
  338. package/dist/extension-assets/atlassian/docs/project-knowledge.md +2 -2
  339. package/dist/extension-assets/diagram/bundle.js +286 -0
  340. package/dist/extension-assets/imagegen/docs/imagegen.md +3 -3
  341. package/dist/git-isolated-reader-helper.js +3 -2
  342. package/dist/main.js +179 -148
  343. package/dist/quick-script-docs/runtime/artifacts.md +11 -0
  344. package/dist/quick-script-docs/runtime/documents.md +21 -12
  345. package/dist/quick-script-docs/runtime/editing.md +44 -0
  346. package/dist/quick-script-docs/runtime/images.md +1 -1
  347. package/dist/quick-script-docs/runtime/mcp.md +26 -0
  348. package/dist/sandbox-libraries/credential-runtime.js +377 -0
  349. package/dist/sandbox-libraries/extension-runtime.js +491 -0
  350. package/dist/web/assets/AsyncBashCenterHost-Dcx6zVCo.js +2 -0
  351. package/dist/web/assets/ConversationListItem-DALhochc.js +3 -0
  352. package/dist/web/assets/ConversationsWorkbenchPanel-ChtoTW2H.js +1 -0
  353. package/dist/web/assets/DiscoverCenterHost-Bju7ypB-.js +1 -0
  354. package/dist/web/assets/ExtensionPageCenterHost-BO-5q4j_.js +1 -0
  355. package/dist/web/assets/FileCenterComposedHost-BxLlLMBI.js +1 -0
  356. package/dist/web/assets/FilesWorkbenchPanel-jyqwIQAe.js +12 -0
  357. package/dist/web/assets/GitDiffCenterHost-D8i3Jq9A.js +1 -0
  358. package/dist/web/assets/GitWorkbenchPanel-CtZPJKqJ.js +1 -0
  359. package/dist/web/assets/LaunchCenterHost-CSy1io6s.js +1 -0
  360. package/dist/web/assets/LaunchConfigurationNotice-DugBa05c.js +1 -0
  361. package/dist/web/assets/LaunchesWorkbenchPanel-CNqGG_AP.js +1 -0
  362. package/dist/web/assets/LogStream-DfJ4LiCv.js +1 -0
  363. package/dist/web/assets/LogsCenterHost-xynA0TWK.js +6 -0
  364. package/dist/web/assets/MermaidCenterHost-kAV1ocvE.js +1 -0
  365. package/dist/web/assets/MobileFilesBody-CiwIT8Vf.js +1 -0
  366. package/dist/web/assets/MobileFilesHost-DvQOpQFH.js +1 -0
  367. package/dist/web/assets/MobileLaunchOutputHost-pFJgIV1_.js +1 -0
  368. package/dist/web/assets/MobileLaunchesHost-0VtdW0x8.js +2 -0
  369. package/dist/web/assets/MobileNoteEditorHost-DSuZ0mU5.js +1 -0
  370. package/dist/web/assets/MobileNotesHost-Lg699XCv.js +2 -0
  371. package/dist/web/assets/MobileSettingsHost-Bv1P74ck.js +2 -0
  372. package/dist/web/assets/MobileSettingsPageHost-DudFqhZC.js +1 -0
  373. package/dist/web/assets/NotesWorkbenchPanel-C8sctQWR.js +1 -0
  374. package/dist/web/assets/PullRequestCenterHost-BWJ-exw1.js +1 -0
  375. package/dist/web/assets/PullRequestsWorkbenchPanel-8Fb0-hW3.js +1 -0
  376. package/dist/web/assets/SearchWorkbenchPanel-B35YmwtL.js +1 -0
  377. package/dist/web/assets/SettingsCenterHost-BuiirrId.js +1 -0
  378. package/dist/web/assets/SystemPromptCenterHost-BqKV92Ew.js +2 -0
  379. package/dist/web/assets/ThemePreviewPicker-C6J0H91i.js +1 -0
  380. package/dist/web/assets/adapters-C5HB2cBr.js +1 -0
  381. package/dist/web/assets/agent-profiles.svelte-DjdXLJnE.js +1 -0
  382. package/dist/web/assets/appearance.svelte-fB4gKc-X.js +1 -0
  383. package/dist/web/assets/arrow-left-Dr6b15mc.js +1 -0
  384. package/dist/web/assets/arrow-up-DuSuHV58.js +1 -0
  385. package/dist/web/assets/bell-ULJuKc4d.js +1 -0
  386. package/dist/web/assets/center-tabs.svelte-8YpJhA1o.js +2 -0
  387. package/dist/web/assets/channel-3Wv484LF.js +57 -0
  388. package/dist/web/assets/check-Bkcg3ucz.js +1 -0
  389. package/dist/web/assets/chevron-down-ad-AbuKe.js +1 -0
  390. package/dist/web/assets/chevron-left-DB7KT5Lp.js +1 -0
  391. package/dist/web/assets/circle-Dzs4dpDK.js +1 -0
  392. package/dist/web/assets/circle-alert-PUkPMbhr.js +1 -0
  393. package/dist/web/assets/circle-check-yOuev_sz.js +1 -0
  394. package/dist/web/assets/circle-dot-ChSwVw2A.js +1 -0
  395. package/dist/web/assets/circle-minus-9PIealgF.js +1 -0
  396. package/dist/web/assets/circle-slash-CD9-qDu5.js +1 -0
  397. package/dist/web/assets/circle-x-B5FqGvs0.js +1 -0
  398. package/dist/web/assets/client-CjIsgPXA.js +1 -0
  399. package/dist/web/assets/clock-DpgnHSye.js +1 -0
  400. package/dist/web/assets/code-BDTZAlQg.js +7 -0
  401. package/dist/web/assets/code-Djc_ma8q.js +1 -0
  402. package/dist/web/assets/collapsible-DUpt3EWl.js +1 -0
  403. package/dist/web/assets/composer-reference-drag-DTAtBwpc.js +1 -0
  404. package/dist/web/assets/confirm-dialog-BAfSrZc9.js +1 -0
  405. package/dist/web/assets/context-menu-BzrRMRBm.js +1 -0
  406. package/dist/web/assets/context-menu-list-BRYW8k5A.js +1 -0
  407. package/dist/web/assets/conversation-activity-CZJfUGoL.js +1 -0
  408. package/dist/web/assets/conversation-connection-Dm9Zr6Yb.js +1 -0
  409. package/dist/web/assets/copy-BY6NrwZk.js +1 -0
  410. package/dist/web/assets/{critical-errors.svelte-BrnxJLVZ.js → critical-errors.svelte-Rix7JR_h.js} +1 -1
  411. package/dist/web/assets/dialog-Dv43iO_I.js +1 -0
  412. package/dist/web/assets/dialog-description-B8-YO9TN.js +1 -0
  413. package/dist/web/assets/discover-Cwv6pB0p.js +4 -0
  414. package/dist/web/assets/dist-BB4fpXjy.js +1 -0
  415. package/dist/web/assets/dist-BBlCv_-z.js +1 -0
  416. package/dist/web/assets/dist-BENZZeCy.js +1 -0
  417. package/dist/web/assets/dist-BqcaQXZ-.js +1 -0
  418. package/dist/web/assets/dist-CIK1TmOX.js +1 -0
  419. package/dist/web/assets/dist-DUPZ8ZaX.js +1 -0
  420. package/dist/web/assets/dist-DoKRJEPu.js +1 -0
  421. package/dist/web/assets/dropdown-menu-1BBEOmsW.js +1 -0
  422. package/dist/web/assets/easing-B6dSt4eu.js +1 -0
  423. package/dist/web/assets/ellipsis-RdvZNJw3.js +1 -0
  424. package/dist/web/assets/empty-CtUlV5QU.js +1 -0
  425. package/dist/web/assets/eraser-B8qFMviR.js +1 -0
  426. package/dist/web/assets/extension-themes.svelte-D2TAUtUA.js +2 -0
  427. package/dist/web/assets/external-link-kybxPZTF.js +1 -0
  428. package/dist/web/assets/eye-off-TTeJc8j1.js +1 -0
  429. package/dist/web/assets/file-display-DQJzpV9d.js +1 -0
  430. package/dist/web/assets/file-state.svelte-CKMVxEdw.js +1 -0
  431. package/dist/web/assets/file-tabs.svelte-DxL_vZZv.js +2 -0
  432. package/dist/web/assets/file-text-Cy36dBD3.js +1 -0
  433. package/dist/web/assets/{file-display-dFQS0tcX.css → files-N9JiAfxr.css} +1 -1
  434. package/dist/web/assets/files-vq7_WbHL.js +156 -0
  435. package/dist/web/assets/filesystem-DiVFVMn3.js +1 -0
  436. package/dist/web/assets/floating-layer-anchor-NDfgLvge.js +1 -0
  437. package/dist/web/assets/floating-toolbar-Cqtfs8M7.js +1 -0
  438. package/dist/web/assets/folder-FlFuYpqp.js +1 -0
  439. package/dist/web/assets/folder-plus-BMveRs1c.js +1 -0
  440. package/dist/web/assets/git-branch-BWZJDpCW.js +1 -0
  441. package/dist/web/assets/git-pull-request-D4m3cMGB.js +1 -0
  442. package/dist/web/assets/git-store.svelte-D9S4P9gI.js +1 -0
  443. package/dist/web/assets/globe-CZcdjV8t.js +1 -0
  444. package/dist/web/assets/group-label-CVoeKeMy.js +1 -0
  445. package/dist/web/assets/hash-DGLDrXlR.js +1 -0
  446. package/dist/web/assets/history-DLpZrgTG.js +1 -0
  447. package/dist/web/assets/icon-action-C9h3TdBz.js +1 -0
  448. package/dist/web/assets/image-DK8kwfuZ.js +1 -0
  449. package/dist/web/assets/index-B8XniJoh.js +165 -0
  450. package/dist/web/assets/index-DC_ohlBG.css +1 -0
  451. package/dist/web/assets/index-client-CuxgedVJ.js +2 -0
  452. package/dist/web/assets/info-BD-7K0vU.js +1 -0
  453. package/dist/web/assets/item-surface-CEVisA-a.js +1 -0
  454. package/dist/web/assets/kbd-c3EMbTTW.js +1 -0
  455. package/dist/web/assets/launches-CmB4KShL.js +5 -0
  456. package/dist/web/assets/launches.api-C4z0obJK.js +1 -0
  457. package/dist/web/assets/launches.svelte-D2bNAphM.js +2 -0
  458. package/dist/web/assets/list-checks-CrZiIWTw.js +1 -0
  459. package/dist/web/assets/{logs.api-DMmVlkSz.js → logs.api-BtGxtYFi.js} +1 -1
  460. package/dist/web/assets/lru-cache-RFDR4GSx.js +1 -0
  461. package/dist/web/assets/{maintenance-state.svelte-l9v7Hg3i.js → maintenance-state.svelte-BusQWeCR.js} +2 -2
  462. package/dist/web/assets/menu-icons-DLuZ586C.js +1 -0
  463. package/dist/web/assets/mermaid-DL5xfcqL.js +2 -0
  464. package/dist/web/assets/message-square-BBHTk_6s.js +1 -0
  465. package/dist/web/assets/messages-square-7WwvQ9x4.js +1 -0
  466. package/dist/web/assets/minus-Du7824mF.js +1 -0
  467. package/dist/web/assets/mobile-launch-rows-DR6V5AUH.js +1 -0
  468. package/dist/web/assets/mobile-settings-CUrL_sAi.js +1 -0
  469. package/dist/web/assets/{notifications-Cd_33rmd.js → notifications-C7hKTj-G.js} +1 -1
  470. package/dist/web/assets/notify.svelte-C5jq6bji.js +1 -0
  471. package/dist/web/assets/package-vr-R1vSi.js +1 -0
  472. package/dist/web/assets/page-tabs.svelte-Cc5F8hMx.js +4 -0
  473. package/dist/web/assets/panel-BW0llJiU.js +1 -0
  474. package/dist/web/assets/pencil-DR0ISMq4.js +1 -0
  475. package/dist/web/assets/pin-ucMlI540.js +1 -0
  476. package/dist/web/assets/play-DDD8-oFG.js +1 -0
  477. package/dist/web/assets/plus-vlVpBK6z.js +1 -0
  478. package/dist/web/assets/popover-panel-SA7quIc1.js +4 -0
  479. package/dist/web/assets/popper-layer-force-mount-GBgxKlXg.js +5 -0
  480. package/dist/web/assets/pr-store-model-Bgvo6h8W.js +1 -0
  481. package/dist/web/assets/pr-view-loader.svelte-eOmDNaGf.js +1 -0
  482. package/dist/web/assets/progress-BZbo8ynI.js +1 -0
  483. package/dist/web/assets/puzzle-Nmiwbtd4.js +1 -0
  484. package/dist/web/assets/refresh-cw-COqO4XSQ.js +1 -0
  485. package/dist/web/assets/resizable-CoXoT4cd.js +4 -0
  486. package/dist/web/assets/rotate-ccw-Bhelbvdd.js +1 -0
  487. package/dist/web/assets/rotate-cw-C7rr0503.js +1 -0
  488. package/dist/web/assets/rows-2-B5MV_oHT.js +1 -0
  489. package/dist/web/assets/save-DhEX7SPs.js +1 -0
  490. package/dist/web/assets/scratch-notes-state.svelte-B4NySamQ.js +1 -0
  491. package/dist/web/assets/scratch-notes.api-BMBs2yoU.js +1 -0
  492. package/dist/web/assets/scroll-area-Coa-Q5U_.js +1 -0
  493. package/dist/web/assets/search-CsYJ7mlT.js +1 -0
  494. package/dist/web/assets/search-input-DE2EmolX.js +1 -0
  495. package/dist/web/assets/search-input-xhE38HHH.js +1 -0
  496. package/dist/web/assets/select-row-Bu3TCvoq.js +1 -0
  497. package/dist/web/assets/settings-COnzKlUA.js +1 -0
  498. package/dist/web/assets/settings-Cu_0wNkX.js +1 -0
  499. package/dist/web/assets/settings-DTw27q0i.js +1 -0
  500. package/dist/web/assets/settings-scope-Bz4U5ImL.js +35 -0
  501. package/dist/web/assets/shell-BiZy0tcZ.js +1 -0
  502. package/dist/web/assets/shell-layout.svelte-Dyx_fbRn.js +2 -0
  503. package/dist/web/assets/sliders-horizontal-8DEQcPIr.js +1 -0
  504. package/dist/web/assets/sparkles-DKFeDKgC.js +1 -0
  505. package/dist/web/assets/spinner-C_3SS4fW.js +1 -0
  506. package/dist/web/assets/square-BZ2jl-M0.js +1 -0
  507. package/dist/web/assets/switch-CcOOJGkR.js +1 -0
  508. package/dist/web/assets/tag-Bp1l7psd.js +1 -0
  509. package/dist/web/assets/terminal-D_HUVO95.js +1 -0
  510. package/dist/web/assets/time-egBWJGDu.js +1 -0
  511. package/dist/web/assets/toast-state.svelte-M9WijMIr.js +1 -0
  512. package/dist/web/assets/toggle-group-B4TJK4kY.js +1 -0
  513. package/dist/web/assets/trash-2-oeIJ99Qt.js +1 -0
  514. package/dist/web/assets/triangle-alert-SBC6bvx2.js +1 -0
  515. package/dist/web/assets/upload-C5uzZr5O.js +1 -0
  516. package/dist/web/assets/users-CdKRwcm4.js +1 -0
  517. package/dist/web/assets/views-DIrSFdZB.js +2 -0
  518. package/dist/web/assets/virtual-list-8tm-MeRU.js +1 -0
  519. package/dist/web/assets/workbench-connection-BpvUZMVX.js +1 -0
  520. package/dist/web/assets/workbench-startup-state.svelte-DiVhozSn.js +1 -0
  521. package/dist/web/assets/workspace-actions.svelte-DE0mQsY6.js +1 -0
  522. package/dist/web/assets/workspace-selectors-CV-KWLNP.css +1 -0
  523. package/dist/web/assets/workspace-selectors.svelte-B90FdGfV.js +2 -0
  524. package/dist/web/assets/workspace-state.svelte-y_9D2lEr.js +1 -0
  525. package/dist/web/assets/workspace-uXAUsF3x.js +1 -0
  526. package/dist/web/assets/write-text-CbtC55an.js +1 -0
  527. package/dist/web/assets/x-B_E8Qayx.js +1 -0
  528. package/dist/web/assets/zap-7foqkmFd.js +1 -0
  529. package/dist/web/assets/zoom-out-e8MDY1Ol.js +1 -0
  530. package/dist/web/index.html +174 -103
  531. package/dist/web/sw.js +1 -1
  532. package/dist/worker.js +15 -14
  533. package/package.json +7 -7
  534. package/dist/builtin/skill-creator/SKILL.md +0 -43
  535. package/dist/chunk-KEXKZKN4.js.LEGAL.txt +0 -28
  536. package/dist/chunk-RJR7DJJK.js +0 -32
  537. package/dist/chunk-UVRULOOP.js +0 -35
  538. package/dist/quick-script-docs/runtime/files.md +0 -11
  539. package/dist/web/assets/AsyncBashCenterHost-D2Sy43Ub.js +0 -2
  540. package/dist/web/assets/ConversationListItem-DvxCcAYm.js +0 -3
  541. package/dist/web/assets/ConversationsWorkbenchPanel-YeNq9LRn.js +0 -1
  542. package/dist/web/assets/DiscoverCenterHost-B6K-QnBF.js +0 -1
  543. package/dist/web/assets/FileCenterHost-Dlk53K5G.js +0 -1
  544. package/dist/web/assets/FilesWorkbenchPanel-PeCu12oU.js +0 -12
  545. package/dist/web/assets/GitDiffCenterHost-3_Ea0RyG.js +0 -1
  546. package/dist/web/assets/GitWorkbenchPanel-CYvCkOAW.js +0 -1
  547. package/dist/web/assets/Icon-dUzqN8rt.js +0 -1
  548. package/dist/web/assets/LaunchCenterHost-CP773N_3.js +0 -1
  549. package/dist/web/assets/LaunchConfigurationNotice-CtmZ1uIQ.js +0 -1
  550. package/dist/web/assets/LaunchesWorkbenchPanel-DP3yVfkO.js +0 -1
  551. package/dist/web/assets/LogStream-B3wORZ1G.js +0 -1
  552. package/dist/web/assets/LogsCenterHost-BFP0doQf.js +0 -1
  553. package/dist/web/assets/MermaidCenterHost-Bjl6Dvrq.js +0 -1
  554. package/dist/web/assets/MermaidDiagram-aNQZkyPm.js +0 -2
  555. package/dist/web/assets/MobileFilesBody-CDp21MGZ.js +0 -1
  556. package/dist/web/assets/MobileFilesHost-DlJI_yau.js +0 -1
  557. package/dist/web/assets/MobileLaunchOutputHost-y3TehLWF.js +0 -1
  558. package/dist/web/assets/MobileLaunchesHost-CBNtDTrs.js +0 -2
  559. package/dist/web/assets/MobileLogsHost-BSb2lydK.js +0 -1
  560. package/dist/web/assets/MobileNoteEditorHost-7yW7hIC2.js +0 -1
  561. package/dist/web/assets/MobileNotesHost-CvDHzpAh.js +0 -2
  562. package/dist/web/assets/MobileProjectSettingsHost-CjtPfyKT.js +0 -1
  563. package/dist/web/assets/MobileProjectSettingsPageHost-j_7N-B9L.js +0 -1
  564. package/dist/web/assets/MobileSettingsHost-DXIKNF01.js +0 -1
  565. package/dist/web/assets/MobileSettingsPageHost-CEzo7J9p.js +0 -1
  566. package/dist/web/assets/MobileSettingsPageScreen-99wMLRsn.js +0 -1
  567. package/dist/web/assets/NotesWorkbenchPanel-DqTwXBBv.js +0 -1
  568. package/dist/web/assets/ProjectSettingsCenterHost-D96cL0uH.js +0 -1
  569. package/dist/web/assets/PullRequestCenterHost-DY0yPDK2.js +0 -1
  570. package/dist/web/assets/PullRequestsWorkbenchPanel-D07LE8vJ.js +0 -1
  571. package/dist/web/assets/SearchWorkbenchPanel-D2_3iXo8.js +0 -1
  572. package/dist/web/assets/SettingsCenter-BQWc24di.js +0 -1
  573. package/dist/web/assets/SettingsCenterHost-BvgNfeZN.js +0 -1
  574. package/dist/web/assets/SystemPromptCenterHost-BLHkB7lp.js +0 -1
  575. package/dist/web/assets/adapters-DNU88KT0.js +0 -1
  576. package/dist/web/assets/agent-profiles.svelte-DgI8wSS2.js +0 -1
  577. package/dist/web/assets/ansi-DgEE8yrv.js +0 -1
  578. package/dist/web/assets/api-CHNbLvvY.js +0 -1
  579. package/dist/web/assets/center-tabs.svelte-CyhCD_6b.js +0 -1
  580. package/dist/web/assets/channel-6wGoOwGx.js +0 -57
  581. package/dist/web/assets/check-B4-kvHtM.js +0 -1
  582. package/dist/web/assets/chevron-down-BRD6PX7T.js +0 -1
  583. package/dist/web/assets/circle-1Q54Vzo6.js +0 -1
  584. package/dist/web/assets/circle-check-BF53l_ev.js +0 -1
  585. package/dist/web/assets/circle-minus-6ZgLkF9b.js +0 -1
  586. package/dist/web/assets/circle-question-mark-C7NgqbLL.js +0 -1
  587. package/dist/web/assets/circle-slash-D5Eett6s.js +0 -1
  588. package/dist/web/assets/client-nxDuQL9v.js +0 -1
  589. package/dist/web/assets/code-DJR0pnqV.js +0 -7
  590. package/dist/web/assets/confirm-dialog-BDjzMiC4.js +0 -1
  591. package/dist/web/assets/context-menu-DmQ505wM.js +0 -1
  592. package/dist/web/assets/context-menu-list-DaW5ufK4.js +0 -1
  593. package/dist/web/assets/conversation-connection-mLNyfV2d.js +0 -1
  594. package/dist/web/assets/copy-CzU4vGIr.js +0 -1
  595. package/dist/web/assets/dialog-CkRcLEJT.js +0 -1
  596. package/dist/web/assets/discover-Dh4m7djO.js +0 -4
  597. package/dist/web/assets/dist-B2u6DT1T.js +0 -1
  598. package/dist/web/assets/dist-BP4AHwoF.js +0 -1
  599. package/dist/web/assets/dist-C9tCTwVa.js +0 -1
  600. package/dist/web/assets/dist-CaItd2HS.js +0 -1
  601. package/dist/web/assets/dist-CieBrKwB.js +0 -1
  602. package/dist/web/assets/dist-CyO_yddl.js +0 -1
  603. package/dist/web/assets/dist-DSApqEag.js +0 -1
  604. package/dist/web/assets/dist-_18afvhb.js +0 -6
  605. package/dist/web/assets/dist-bce3Apm3.js +0 -1
  606. package/dist/web/assets/dist-f2khipO_.js +0 -23
  607. package/dist/web/assets/dist-q41eeZ5f.js +0 -1
  608. package/dist/web/assets/dist-tAo2dJ-6.js +0 -1
  609. package/dist/web/assets/ellipsis-DwxJ9QwL.js +0 -1
  610. package/dist/web/assets/empty-rid4edzp.js +0 -1
  611. package/dist/web/assets/external-link-CrXkg5Wk.js +0 -1
  612. package/dist/web/assets/file-display-COCOpvRv.js +0 -43
  613. package/dist/web/assets/file-state.svelte-CbCwgkVc.js +0 -1
  614. package/dist/web/assets/file-tabs.svelte-cX3MMyG6.js +0 -2
  615. package/dist/web/assets/filesystem-BbIXrkGB.js +0 -1
  616. package/dist/web/assets/floating-toolbar-Bi6W7nuo.js +0 -1
  617. package/dist/web/assets/folder-plus-kWqBEDSp.js +0 -1
  618. package/dist/web/assets/git-store.svelte-D3uwRVnj.js +0 -1
  619. package/dist/web/assets/git.api-CTu-tG8A.js +0 -1
  620. package/dist/web/assets/index-BrxjAwg0.js +0 -46
  621. package/dist/web/assets/index-client-D3jEdWh6.js +0 -1
  622. package/dist/web/assets/index-yEOHI1Z7.css +0 -1
  623. package/dist/web/assets/launches-CC4gLnSa.js +0 -5
  624. package/dist/web/assets/launches.api-CaotSs6l.js +0 -1
  625. package/dist/web/assets/launches.svelte-DDA5J-RZ.js +0 -2
  626. package/dist/web/assets/list-checks-zV9Dp7Cu.js +0 -1
  627. package/dist/web/assets/logs-pane-controller-y9t0KMCf.js +0 -6
  628. package/dist/web/assets/lru-cache-2GKQjz_Q.js +0 -1
  629. package/dist/web/assets/messages-square-BaRp8lPH.js +0 -1
  630. package/dist/web/assets/mobile-launch-rows-AMIOdPFZ.js +0 -1
  631. package/dist/web/assets/mobile-settings-DZIdfkcb.js +0 -1
  632. package/dist/web/assets/notify.svelte-BTEXJZ8P.js +0 -1
  633. package/dist/web/assets/plus-BDs_Vrbp.js +0 -1
  634. package/dist/web/assets/popover-panel-C-weKOk3.js +0 -5
  635. package/dist/web/assets/pr-store-model-DxsbPrU3.js +0 -1
  636. package/dist/web/assets/pr-view-loader.svelte-C0NClMS6.js +0 -1
  637. package/dist/web/assets/progress-CKEsTSOk.js +0 -1
  638. package/dist/web/assets/refresh-cw-BKxrMWGF.js +0 -1
  639. package/dist/web/assets/rotate-ccw-DU16aIZa.js +0 -1
  640. package/dist/web/assets/save-BYjytMfL.js +0 -1
  641. package/dist/web/assets/scratch-notes-state.svelte-B_rY_-9q.js +0 -1
  642. package/dist/web/assets/scratch-notes.api-B2gOOK6Z.js +0 -1
  643. package/dist/web/assets/scroll-area-6W2ec9gB.js +0 -1
  644. package/dist/web/assets/scroll-region-DURy1kqr.js +0 -1
  645. package/dist/web/assets/search-CNVoTDXD.js +0 -1
  646. package/dist/web/assets/search-input-CEr0SmAB.js +0 -1
  647. package/dist/web/assets/search-input-CIymF0F7.js +0 -1
  648. package/dist/web/assets/settings-2-CWd8Y06n.js +0 -1
  649. package/dist/web/assets/settings-CRmC19nG.js +0 -1
  650. package/dist/web/assets/settings-CXoAzSmm.js +0 -1
  651. package/dist/web/assets/settings-actions.svelte-BB6u_lQ0.js +0 -1
  652. package/dist/web/assets/settings-page-controllers.svelte-al78EDTL.js +0 -29
  653. package/dist/web/assets/settings-scope-SmBcqKnH.js +0 -1
  654. package/dist/web/assets/sheet-content-DauQ7hPL.js +0 -1
  655. package/dist/web/assets/shell-CYbWnH52.js +0 -4
  656. package/dist/web/assets/shell-layout.svelte-CmEWk428.js +0 -2
  657. package/dist/web/assets/square-BVt10foY.js +0 -1
  658. package/dist/web/assets/terminal-DR0kKWy0.js +0 -1
  659. package/dist/web/assets/textarea-BEZ65po_.js +0 -1
  660. package/dist/web/assets/time-DqcZ_PFK.js +0 -1
  661. package/dist/web/assets/toast-state.svelte-C3jh5vEx.js +0 -2
  662. package/dist/web/assets/toggle-group-DjVp0RDl.js +0 -1
  663. package/dist/web/assets/trash-2-Bso_xa70.js +0 -1
  664. package/dist/web/assets/triangle-alert-D9K5XB_S.js +0 -1
  665. package/dist/web/assets/views-BumCSQ3W.js +0 -2
  666. package/dist/web/assets/virtual-list-D0QI-mKB.js +0 -1
  667. package/dist/web/assets/workbench-connection-CGHdORw3.js +0 -1
  668. package/dist/web/assets/workbench-startup-state.svelte-CVFaDyK2.js +0 -1
  669. package/dist/web/assets/workspace-CW738NJG.js +0 -1
  670. package/dist/web/assets/workspace-actions.svelte-DL9xv7lJ.js +0 -1
  671. package/dist/web/assets/workspace-selectors-Biz3rbHu.css +0 -1
  672. package/dist/web/assets/workspace-selectors.svelte-BRJvPEBh.js +0 -105
  673. package/dist/web/assets/workspace-state.svelte-DhP5cESH.js +0 -1
  674. package/dist/web/assets/x-BRgH6yME.js +0 -5
  675. package/dist/web/workbox-2fbc6a65.js +0 -1
  676. /package/dist/{chunk-OO2KD2L2.js.LEGAL.txt → chunk-EBDLSTDH.js.LEGAL.txt} +0 -0
  677. /package/dist/web/assets/{MermaidDiagram-Dl7kTPdl.css → mermaid-Dl7kTPdl.css} +0 -0
  678. /package/dist/web/assets/{scroll-region-DLkbH2wy.css → select-row-DLkbH2wy.css} +0 -0
@@ -0,0 +1,165 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-actions.svelte-DE0mQsY6.js","assets/rolldown-runtime-XKyaHtl9.js","assets/index-client-CuxgedVJ.js","assets/client-CjIsgPXA.js","assets/workbench-connection-BpvUZMVX.js","assets/adapters-C5HB2cBr.js","assets/channel-3Wv484LF.js","assets/toast-state.svelte-M9WijMIr.js","assets/logs.api-BtGxtYFi.js","assets/center-tabs.svelte-8YpJhA1o.js","assets/workspace-state.svelte-y_9D2lEr.js","assets/notify.svelte-C5jq6bji.js","assets/activity-notices-C9aphS1s.js","assets/view-keys-CJ6dmIxc.js","assets/conversation-connection-Dm9Zr6Yb.js","assets/filesystem-DiVFVMn3.js","assets/scratch-notes.api-BMBs2yoU.js","assets/launches.api-C4z0obJK.js","assets/MobileFilesHost-DvQOpQFH.js","assets/x-B_E8Qayx.js","assets/refresh-cw-COqO4XSQ.js","assets/workspace-selectors.svelte-B90FdGfV.js","assets/item-surface-CEVisA-a.js","assets/popper-layer-force-mount-GBgxKlXg.js","assets/context-menu-list-BRYW8k5A.js","assets/context-menu-BzrRMRBm.js","assets/floating-layer-anchor-NDfgLvge.js","assets/circle-check-yOuev_sz.js","assets/file-display-DQJzpV9d.js","assets/dialog-Dv43iO_I.js","assets/dialog-description-B8-YO9TN.js","assets/chevron-left-DB7KT5Lp.js","assets/spinner-C_3SS4fW.js","assets/kbd-c3EMbTTW.js","assets/popover-panel-SA7quIc1.js","assets/easing-B6dSt4eu.js","assets/select-row-Bu3TCvoq.js","assets/select-row-DLkbH2wy.css","assets/check-Bkcg3ucz.js","assets/search-input-xhE38HHH.js","assets/search-CsYJ7mlT.js","assets/trash-2-oeIJ99Qt.js","assets/circle-Dzs4dpDK.js","assets/chevron-down-ad-AbuKe.js","assets/conversation-activity-CZJfUGoL.js","assets/empty-CtUlV5QU.js","assets/triangle-alert-SBC6bvx2.js","assets/bell-ULJuKc4d.js","assets/pin-ucMlI540.js","assets/file-text-Cy36dBD3.js","assets/folder-FlFuYpqp.js","assets/git-branch-BWZJDpCW.js","assets/package-vr-R1vSi.js","assets/terminal-D_HUVO95.js","assets/external-link-kybxPZTF.js","assets/copy-BY6NrwZk.js","assets/settings-COnzKlUA.js","assets/rotate-ccw-Bhelbvdd.js","assets/write-text-CbtC55an.js","assets/workspace-selectors-CV-KWLNP.css","assets/shell-BiZy0tcZ.js","assets/plus-vlVpBK6z.js","assets/dropdown-menu-1BBEOmsW.js","assets/minus-Du7824mF.js","assets/time-egBWJGDu.js","assets/resizable-CoXoT4cd.js","assets/eye-off-TTeJc8j1.js","assets/shell-BwGiYeGQ.css","assets/workspace-uXAUsF3x.js","assets/maintenance-state.svelte-BusQWeCR.js","assets/controller-lifecycle-DoMGTFCZ.js","assets/MobileFilesBody-CiwIT8Vf.js","assets/file-tabs.svelte-DxL_vZZv.js","assets/file-state.svelte-CKMVxEdw.js","assets/preload-helper-BLdHbfdN.js","assets/MobileNotesHost-Lg699XCv.js","assets/scratch-notes-state.svelte-B4NySamQ.js","assets/MobileNoteEditorHost-DSuZ0mU5.js","assets/pencil-DR0ISMq4.js","assets/confirm-dialog-BAfSrZc9.js","assets/MobileSettingsHost-Bv1P74ck.js","assets/globe-CZcdjV8t.js","assets/ThemePreviewPicker-C6J0H91i.js","assets/appearance.svelte-fB4gKc-X.js","assets/extension-themes.svelte-D2TAUtUA.js","assets/puzzle-Nmiwbtd4.js","assets/sparkles-DKFeDKgC.js","assets/settings-DTw27q0i.js","assets/sliders-horizontal-8DEQcPIr.js","assets/users-CdKRwcm4.js","assets/info-BD-7K0vU.js","assets/discover-Cwv6pB0p.js","assets/shell-layout.svelte-Dyx_fbRn.js","assets/git-pull-request-D4m3cMGB.js","assets/messages-square-7WwvQ9x4.js","assets/workbench-startup-state.svelte-DiVhozSn.js","assets/progress-BZbo8ynI.js","assets/ellipsis-RdvZNJw3.js","assets/scroll-area-Coa-Q5U_.js","assets/discover-DABJ5Mc0.css","assets/mobile-settings-CUrL_sAi.js","assets/MobileSettingsPageHost-DudFqhZC.js","assets/settings-scope-Bz4U5ImL.js","assets/panel-BW0llJiU.js","assets/virtual-list-8tm-MeRU.js","assets/lru-cache-RFDR4GSx.js","assets/virtual-list-D2op8Pgu.css","assets/collapsible-DUpt3EWl.js","assets/switch-CcOOJGkR.js","assets/toggle-group-B4TJK4kY.js","assets/floating-toolbar-Cqtfs8M7.js","assets/icon-action-C9h3TdBz.js","assets/group-label-CVoeKeMy.js","assets/page-tabs.svelte-Cc5F8hMx.js","assets/zap-7foqkmFd.js","assets/clock-DpgnHSye.js","assets/code-Djc_ma8q.js","assets/image-DK8kwfuZ.js","assets/list-checks-CrZiIWTw.js","assets/message-square-BBHTk_6s.js","assets/notifications-C7hKTj-G.js","assets/search-input-DE2EmolX.js","assets/circle-alert-PUkPMbhr.js","assets/code-BDTZAlQg.js","assets/rows-2-B5MV_oHT.js","assets/save-DhEX7SPs.js","assets/dist-DoT3ROR1.js","assets/dist-m1CG5r2F.js","assets/tag-Bp1l7psd.js","assets/circle-dot-ChSwVw2A.js","assets/circle-minus-9PIealgF.js","assets/circle-x-B5FqGvs0.js","assets/eraser-B8qFMviR.js","assets/play-DDD8-oFG.js","assets/agent-profiles.svelte-DjdXLJnE.js","assets/settings-Cu_0wNkX.js","assets/MobileLaunchesHost-0VtdW0x8.js","assets/square-BZ2jl-M0.js","assets/launches-CmB4KShL.js","assets/launches.svelte-D2bNAphM.js","assets/circle-slash-CD9-qDu5.js","assets/rotate-cw-C7rr0503.js","assets/LogStream-DfJ4LiCv.js","assets/LogStream-C70iQmUI.css","assets/folder-plus-BMveRs1c.js","assets/history-DLpZrgTG.js","assets/composer-reference-drag-DTAtBwpc.js","assets/arrow-up-DuSuHV58.js","assets/LaunchConfigurationNotice-DugBa05c.js","assets/critical-errors.svelte-Rix7JR_h.js","assets/mobile-launch-rows-DR6V5AUH.js","assets/MobileLaunchOutputHost-pFJgIV1_.js","assets/AsyncBashCenterHost-Dcx6zVCo.js","assets/SystemPromptCenterHost-BqKV92Ew.js","assets/LaunchCenterHost-CSy1io6s.js","assets/FileCenterComposedHost-BxLlLMBI.js","assets/files-vq7_WbHL.js","assets/mermaid-DL5xfcqL.js","assets/zoom-out-e8MDY1Ol.js","assets/mermaid-Dl7kTPdl.css","assets/lib-BZ8F1B-I.js","assets/files-N9JiAfxr.css","assets/ExtensionPageCenterHost-BO-5q4j_.js","assets/MermaidCenterHost-kAV1ocvE.js","assets/PullRequestCenterHost-BWJ-exw1.js","assets/views-DIrSFdZB.js","assets/github-pr-checks-CINXCvUy.js","assets/ConversationListItem-DALhochc.js","assets/hash-DGLDrXlR.js","assets/pr-view-loader.svelte-eOmDNaGf.js","assets/pr-store-model-Bgvo6h8W.js","assets/git-store.svelte-D9S4P9gI.js","assets/GitDiffCenterHost-D8i3Jq9A.js","assets/SettingsCenterHost-BuiirrId.js","assets/LogsCenterHost-xynA0TWK.js","assets/DiscoverCenterHost-Bju7ypB-.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,A as n,At as r,B as i,Ct as a,Dt as o,E as s,Et as c,F as l,Ft as u,G as d,H as f,I as p,It as m,J as h,K as g,L as _,M as v,Mt as y,N as b,Nt as x,O as S,P as C,R as w,S as T,T as E,Tt as D,U as O,V as k,W as A,X as j,Y as M,Z as N,a as P,at as F,b as I,bt as L,ct as ee,d as te,dt as R,et as ne,f as re,ft as z,g as ie,gt as B,h as ae,i as V,it as oe,j as se,k as H,lt as ce,mt as U,n as le,ot as W,pt as G,q as ue,r as K,rt as de,st as fe,t as pe,tt as me,u as he,ut as q,v as J,vt as Y,w as ge,wt as _e,x as X,yt as ve}from"./index-client-CuxgedVJ.js";import{n as Z,t as ye}from"./x-B_E8Qayx.js";import{r as be,t as xe}from"./item-surface-CEVisA-a.js";import{B as Se,E as Ce,F as we,I as Te,L as Ee,N as De,O as Oe,P as ke,V as Ae,c as je,d as Me,f as Ne,i as Pe,l as Fe,m as Ie,n as Le,r as Re,s as ze,t as Be,u as Ve}from"./client-CjIsgPXA.js";import{a as He,h as Ue,i as We,l as Ge,m as Ke,n as qe,o as Je,r as Ye,t as Xe,u as Ze}from"./appearance.svelte-fB4gKc-X.js";import{c as Qe,g as $e,h as et,i as tt,l as nt,m as rt,o as it,p as at,r as ot,s as st,u as ct}from"./logs.api-BtGxtYFi.js";import{At as Q,B as lt,Ct as ut,K as dt,Mt as ft,Ot as pt,Tt as mt,U as ht,V as gt,ct as _t,dt as vt,ft as yt,gt as bt,jt as xt,lt as St,ut as Ct,wt}from"./popper-layer-force-mount-GBgxKlXg.js";import{A as Tt,D as Et,E as Dt,M as Ot,N as eee,O as kt,S as At,T as jt,a as Mt,b as Nt,i as Pt,j as Ft,k as It,l as Lt,m as Rt,o as zt,p as tee,r as Bt,s as Vt,t as Ht,u as Ut,w as Wt,x as Gt,y as Kt}from"./settings-DTw27q0i.js";import{S as qt,_ as Jt,b as Yt,g as Xt,h as Zt,l as Qt,m as $t,t as en,u as tn,w as nn,y as rn}from"./panel-BW0llJiU.js";import{n as an}from"./floating-layer-anchor-NDfgLvge.js";import{a as on,c as sn,i as cn,o as ln,s as un}from"./file-display-DQJzpV9d.js";import{t as dn}from"./spinner-C_3SS4fW.js";import{t as fn}from"./scroll-area-Coa-Q5U_.js";import{f as pn,h as mn,i as hn,l as gn,m as _n,s as vn}from"./context-menu-BzrRMRBm.js";import{t as yn}from"./switch-CcOOJGkR.js";import{t as bn}from"./triangle-alert-SBC6bvx2.js";import{c as xn,d as Sn,f as Cn,p as wn,s as Tn,u as En}from"./floating-toolbar-Cqtfs8M7.js";import{t as Dn}from"./pencil-DR0ISMq4.js";import{t as On}from"./plus-vlVpBK6z.js";import{t as kn}from"./trash-2-oeIJ99Qt.js";import{a as nee,c as ree,i as iee,n as aee,o as oee,r as see,s as An,t as jn}from"./confirm-dialog-BAfSrZc9.js";import{t as Mn}from"./icon-action-C9h3TdBz.js";import{a as Nn,i as Pn,n as Fn,o as In,r as Ln}from"./workspace-uXAUsF3x.js";import{t as Rn}from"./group-label-CVoeKeMy.js";import{t as zn}from"./rotate-ccw-Bhelbvdd.js";import{a as Bn,n as Vn,s as Hn}from"./conversation-activity-CZJfUGoL.js";import{t as Un}from"./info-BD-7K0vU.js";import{t as Wn}from"./circle-check-yOuev_sz.js";import{t as Gn}from"./globe-CZcdjV8t.js";import{t as Kn}from"./package-vr-R1vSi.js";import{t as qn}from"./chevron-down-ad-AbuKe.js";import{i as Jn,n as Yn,o as Xn,r as Zn,t as Qn}from"./dropdown-menu-1BBEOmsW.js";import{c as $n,i as er,l as tr,n as cee,o as nr,r as rr,s as ir,t as ar}from"./workbench-connection-BpvUZMVX.js";import{t as or}from"./controller-lifecycle-DoMGTFCZ.js";import{t as sr}from"./copy-BY6NrwZk.js";import{t as cr}from"./refresh-cw-COqO4XSQ.js";import{$ as lr,B as ur,F as dr,G as fr,H as pr,I as mr,J as hr,K as gr,L as _r,M as vr,N as yr,O as br,P as xr,Q as Sr,R as Cr,U as wr,V as Tr,W as Er,X as Dr,Y as Or,Z as kr,_ as Ar,a as jr,b as Mr,d as Nr,et as Pr,f as Fr,g as Ir,h as Lr,i as Rr,k as zr,l as Br,m as Vr,n as Hr,nt as Ur,o as Wr,p as Gr,q as Kr,r as qr,rt as Jr,s as Yr,t as Xr,tt as Zr,v as Qr,y as $r,z as ei}from"./workspace-selectors.svelte-B90FdGfV.js";import{n as ti,t as ni}from"./toggle-group-B4TJK4kY.js";import{t as ri}from"./write-text-CbtC55an.js";import{E as ii,T as lee,_ as uee,a as ai,b as dee,c as oi,d as fee,h as si,i as pee,l as ci,m as li,n as mee,o as ui,p as hee,r as gee,s as _ee,t as vee,v as yee,w as di,x as fi,y as pi}from"./notify.svelte-C5jq6bji.js";import{C as mi,I as hi,P as gi,V as _i,a as vi,f as yi,g as bi,h as xi,s as Si}from"./adapters-C5HB2cBr.js";import{$t as Ci,C as wi,Cn as Ti,D as Ei,E as Di,G as Oi,H as ki,In as Ai,K as ji,Mn as Mi,Nn as Ni,O as Pi,Pt as Fi,Q as Ii,Qt as Li,Rn as Ri,S as zi,T as Bi,U as Vi,Un as Hi,W as Ui,Wt as Wi,Yt as Gi,Z as Ki,Zt as qi,_ as Ji,_n as Yi,a as Xi,b as Zi,c as Qi,d as $i,en as ea,et as ta,g as na,h as ra,kn as ia,nn as aa,nt as oa,p as sa,rn as ca,rt as la,s as ua,tn as da,v as fa,w as pa,x as ma,y as ha,zn as ga}from"./channel-3Wv484LF.js";import{C as _a,D as va,E as ya,S as ba,T as xa,_ as Sa,a as Ca,b as wa,d as Ta,f as Ea,g as Da,h as Oa,i as ka,m as Aa,n as ja,o as Ma,p as Na,r as Pa,s as Fa,u as Ia,v as La,w as Ra,x as za,y as Ba}from"./pr-view-loader.svelte-eOmDNaGf.js";import{A as Va,C as Ha,D as Ua,E as Wa,M as Ga,N as Ka,O as qa,P as Ja,S as Ya,T as Xa,_ as Za,a as Qa,b as $a,g as eo,h as to,i as no,j as ro,k as io,n as ao,o as oo,r as so,t as co,v as lo,w as uo,x as fo,y as po}from"./shell-BiZy0tcZ.js";import{c as mo,i as ho,n as go,o as _o,r as vo,s as yo,t as bo}from"./toast-state.svelte-M9WijMIr.js";import{_ as xo,a as So,c as Co,f as wo,g as To,h as Eo,i as Do,l as Oo,m as ko,n as Ao,o as jo,p as Mo,r as No,s as Po,t as Fo,u as Io}from"./page-tabs.svelte-Cc5F8hMx.js";import{s as Lo}from"./pr-store-model-Bgvo6h8W.js";import{A as Ro,B as zo,E as Bo,F as Vo,G as bee,I as xee,L as Ho,R as See,S as Cee,V as Uo,W as Wo,c as Go,d as wee,g as Ko,h as qo,i as Jo,j as Tee,l as Eee,n as Yo,p as Dee,q as Xo,u as Zo,w as Oee,z as Qo}from"./center-tabs.svelte-8YpJhA1o.js";import{i as kee,n as $o,r as es,t as Aee}from"./critical-errors.svelte-Rix7JR_h.js";import{a as ts,c as ns,i as rs,n as is,o as as,r as os,s as jee}from"./empty-CtUlV5QU.js";import{a as ss,i as cs,n as ls,o as us,r as ds,t as fs}from"./view-keys-CJ6dmIxc.js";import{a as ps,c as ms,d as hs,f as gs,h as _s,i as vs,l as ys,n as bs,o as xs,p as Ss,r as Cs,s as ws,t as Ts,u as Es}from"./git-store.svelte-D9S4P9gI.js";import{t as Ds}from"./workspace-state.svelte-y_9D2lEr.js";import{t as Os}from"./preload-helper-BLdHbfdN.js";import{t as ks}from"./search-input-xhE38HHH.js";import{n as As,r as js,t as Ms}from"./time-egBWJGDu.js";import{_ as Ns,a as Ps,h as Fs,i as Is,l as Ls,m as Rs,p as zs,s as Bs,u as Vs,y as Hs}from"./github-pr-checks-CINXCvUy.js";import{a as Us,i as Ws,n as Gs,o as Ks,r as qs,t as Js}from"./workbench-startup-state.svelte-DiVhozSn.js";import"./search-input-DE2EmolX.js";import{n as Ys,t as Xs}from"./square-BZ2jl-M0.js";import{t as Zs}from"./arrow-up-DuSuHV58.js";import{t as Qs}from"./circle-alert-PUkPMbhr.js";import{t as $s}from"./external-link-kybxPZTF.js";import{t as ec}from"./folder-plus-BMveRs1c.js";import{n as tc,t as nc}from"./git-branch-BWZJDpCW.js";import{t as rc}from"./ellipsis-RdvZNJw3.js";import{t as ic}from"./check-Bkcg3ucz.js";import{t as ac}from"./git-pull-request-D4m3cMGB.js";import{_ as oc,a as sc,c as cc,d as lc,f as uc,g as dc,h as fc,i as pc,l as mc,m as hc,n as gc,o as _c,p as vc,r as yc,s as bc,t as xc,u as Sc}from"./popover-panel-SA7quIc1.js";import{_ as Cc,a as wc,b as Tc,c as Ec,d as Dc,f as Oc,g as kc,h as Ac,l as jc,m as Mc,o as Nc,p as Pc,s as Fc,t as Ic,u as Lc,v as Rc,y as zc}from"./files-vq7_WbHL.js";import{t as Bc}from"./circle-slash-CD9-qDu5.js";import{t as Vc}from"./list-checks-CrZiIWTw.js";import{t as Hc}from"./message-square-BBHTk_6s.js";import{i as Uc,n as Wc,r as Gc,t as Kc}from"./select-row-Bu3TCvoq.js";import"./launches-CmB4KShL.js";import{t as qc}from"./terminal-D_HUVO95.js";import{n as Jc,t as Yc}from"./settings-Cu_0wNkX.js";import{t as Xc}from"./settings-COnzKlUA.js";import{C as Zc,D as Qc,E as $c,O as el,S as tl,T as nl,_ as rl,b as il,c as al,d as ol,g as sl,i as cl,l as ll,m as ul,n as dl,p as fl,s as pl,u as ml,v as hl,w as gl,x as _l,y as vl}from"./discover-Cwv6pB0p.js";import{a as yl,c as bl,i as xl,l as Sl,n as Cl,o as wl,r as Tl,s as El,t as Dl}from"./conversation-connection-Dm9Zr6Yb.js";import{t as Ol}from"./arrow-left-Dr6b15mc.js";import{_ as kl,a as Al,b as jl,c as Ml,d as Nl,f as Pl,g as Fl,h as Il,i as Ll,l as Rl,m as zl,o as Bl,p as Vl,r as Hl,s as Ul,u as Wl,v as Gl,y as Kl}from"./code-BDTZAlQg.js";import{$ as ql,At as Jl,B as Yl,Dt as Xl,Et as Zl,F as Ql,Ft as $l,G as eu,H as tu,J as nu,K as ru,L as iu,Lt as au,N as ou,O as su,Pt as cu,Q as lu,S as uu,Tt as du,U as $,Vt as fu,X as pu,Y as mu,Z as hu,a as gu,f as _u,h as vu,ht as yu,i as bu,it as xu,j as Su,m as Cu,o as wu,p as Tu,pt as Eu,q as Du,r as Ou,rt as ku,s as Au,tt as ju,u as Mu,x as Nu,y as Pu}from"./dist-DoT3ROR1.js";import{a as Fu,i as Iu,o as Lu,t as Ru}from"./dist-m1CG5r2F.js";import{i as zu,n as Bu,r as Vu,t as Hu}from"./dist-BAZ3syGY.js";import{t as Uu}from"./context-menu-list-BRYW8k5A.js";import{n as Wu,o as Gu,r as Ku,t as qu}from"./composer-reference-drag-DTAtBwpc.js";import{t as Ju}from"./kbd-c3EMbTTW.js";import{t as Yu}from"./circle-dot-ChSwVw2A.js";import{t as Xu}from"./code-Djc_ma8q.js";import{t as Zu}from"./folder-FlFuYpqp.js";import{t as Qu}from"./play-DDD8-oFG.js";import{t as $u}from"./sparkles-DKFeDKgC.js";import{n as ed,r as td,t as nd}from"./easing-B6dSt4eu.js";import{t as rd}from"./history-DLpZrgTG.js";import{t as id}from"./virtual-list-8tm-MeRU.js";import{t as ad}from"./image-DK8kwfuZ.js";import{t as od}from"./minus-Du7824mF.js";import{a as sd,c as cd,i as ld,n as ud,o as dd,r as fd,s as pd,t as md}from"./progress-BZbo8ynI.js";import{t as hd}from"./file-text-Cy36dBD3.js";import{t as gd}from"./circle-Dzs4dpDK.js";import{t as _d}from"./users-CdKRwcm4.js";import{t as vd}from"./sliders-horizontal-8DEQcPIr.js";import{i as Mee,n as Nee,r as yd,t as bd}from"./collapsible-DUpt3EWl.js";import{a as Pee,r as Fee}from"./extension-themes.svelte-D2TAUtUA.js";import{t as Iee}from"./lru-cache-RFDR4GSx.js";import{t as xd}from"./circle-x-B5FqGvs0.js";import{n as Sd}from"./LogStream-DfJ4LiCv.js";import{i as Lee,n as Cd,t as Ree}from"./notifications-C7hKTj-G.js";import{t as wd}from"./bell-ULJuKc4d.js";import{t as zee}from"./rotate-cw-C7rr0503.js";import{I as Td,J as Ed,K as Dd,M as Bee,O as Vee,R as Od,S as Hee,U as Uee,W as Wee,_ as Gee,_t as Kee,a as kd,b as qee,c as Ad,d as jd,f as Md,gt as Jee,ht as Nd,i as Pd,k as Fd,mt as Id,n as Yee,o as Xee,p as Zee,pt as Qee,r as Ld,s as Rd,t as $ee,v as ete,vt as zd,y as tte,z as Bd}from"./workspace-actions.svelte-DE0mQsY6.js";import{_ as nte,c as rte,i as ite,l as ate,o as ote,r as Vd,s as ste,t as cte}from"./file-tabs.svelte-DxL_vZZv.js";import{_ as Hd,a as lte,b as Ud,c as ute,f as dte,g as fte,h as Wd,i as pte,m as Gd,o as Kd,p as qd,r as Jd,s as Yd,t as Xd,u as Zd,v as Qd,y as $d}from"./shell-layout.svelte-Dyx_fbRn.js";import{t as ef}from"./file-state.svelte-CKMVxEdw.js";import{a as tf,i as nf,n as rf,o as af,r as of,s as sf}from"./dialog-Dv43iO_I.js";import{t as cf}from"./eye-off-TTeJc8j1.js";import{t as lf}from"./search-CsYJ7mlT.js";import{t as uf}from"./messages-square-7WwvQ9x4.js";import{a as df,n as ff,t as pf}from"./zoom-out-e8MDY1Ol.js";import{t as mf}from"./clock-DpgnHSye.js";import{a as hf,i as gf,n as _f,r as vf,t as yf}from"./maintenance-state.svelte-BusQWeCR.js";import{r as bf,t as xf}from"./pin-ucMlI540.js";import{d as Sf}from"./agent-profiles.svelte-DjdXLJnE.js";import{n as Cf,t as wf}from"./chevron-left-DB7KT5Lp.js";import{r as Tf}from"./rows-2-B5MV_oHT.js";import{E as Ef,S as Df,a as Of,b as kf,c as Af,d as jf,f as Mf,g as Nf,l as Pf,t as Ff,x as If}from"./launches.svelte-D2bNAphM.js";import{s as Lf}from"./launches.api-C4z0obJK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Rf=Symbol(`QueryClient`),zf=e=>{o(Rf,e)};function Bf(e,t){c(t,!0);let r=K(t,`client`,19,()=>new Ae);le(()=>{r().mount()}),zf(r()),pe(()=>{r().unmount()});var i=f(),a=R(i);n(a,()=>t.children),k(e,i),D()}function Vf(){return it(`/api/access/session`)}function Hf(e){return nt(`/api/access/pair`,{...e,delivery:`cookie`})}async function Uf(){return(await nt(`/api/access/login/options`,{})).options}function Wf(e){return nt(`/api/access/login/verify`,{...e,delivery:`cookie`})}async function Gf(e){return(await nt(`/api/access/passkeys/register/options`,e?{setupCode:e}:{})).options}function Kf(e){return nt(`/api/access/passkeys/register/verify`,{...e,delivery:`cookie`})}function qf(e,t){return nt(`/api/access/pairing-codes`,{purpose:e,...t?{ttlSeconds:t}:{}})}function Jf(){return it(`/api/access/devices`)}async function Yf(e,t){return(await st(`/api/access/devices/${Qe(e)}`,{name:t})).device}async function Xf(){await nt(`/api/access/logout`,{})}async function Zf(e){await tt(`/api/access/devices/${Qe(e)}`)}async function Qf(e=!0){return(await nt(`/api/access/devices/revoke-all`,{keepCurrent:e})).revoked}async function $f(){return(await it(`/api/access/passkeys`)).passkeys}async function ep(e){await tt(`/api/access/passkeys/${Qe(e)}`)}async function tp(e=50){return(await it(`/api/access/audit?limit=${e}`)).events}function np(){return it(`/api/access/push`)}async function rp(e){await ct(`/api/access/push/subscription`,e)}async function ip(){await tt(`/api/access/push/subscription`)}async function ap(){await nt(`/api/access/push/test`,{})}function op(e,t={}){return e.authenticated?`app`:e.passkey.enrollmentOpen?`passkey-enroll`:t.pendingPairCode&&e.pairingAvailable?`pair`:e.passkey.loginAvailable?`passkey-login`:e.pairingAvailable?`pair`:`blocked`}function sp(e){return e.pairingAvailable}var cp=/^[0-9A-Za-z]{4}-?[0-9A-Za-z]{4}$/;function lp(e){let t=e.trim().replace(/[\s-]+/g,``);if(cp.test(t))return`${t.slice(0,4)}-${t.slice(4)}`.toUpperCase()}function up(e){let t=new URLSearchParams(e.startsWith(`#`)?e.slice(1):e).get(`pair`);return t?lp(t):void 0}function dp(e){let t=new URLSearchParams(e.startsWith(`#`)?e.slice(1):e);if(!t.has(`pair`))return e;t.delete(`pair`);let n=t.toString();return n?`#${n}`:``}function fp(e,t){let n=up(e.hash);if(n)return t.replaceState(t.state,``,`${e.pathname}${e.search}${dp(e.hash)}`),n}var pp=1e3,mp=U({phase:`checking`,session:void 0,screen:`app`,pendingPairCode:void 0}),hp=!1,gp,_p=2e3;function vp(e){let t=op(e,{pendingPairCode:mp.pendingPairCode});if(t!==`app`&&hp){if(gp??=Date.now(),Date.now()-gp<_p){setTimeout(()=>void bp(),_p);return}location.reload()}else gp=void 0,mp.session=e,mp.screen=t,mp.phase=`settled`,t===`app`&&(hp=!0)}async function yp(){for(;;)try{return await Vf()}catch{await new Promise(e=>setTimeout(e,pp))}}async function bp(){vp(await yp())}function xp(){mp.pendingPairCode=void 0}function Sp(){mp.pendingPairCode=fp(window.location,window.history);let e=!1,t=$e(()=>{e||(e=!0,bp().finally(()=>{e=!1}))});return bp(),t}function Cp(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function wp(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function Tp(){return Ep.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var Ep={stubThis:e=>e};function Dp(e){let{id:t}=e;return{...e,id:wp(t),transports:e.transports,type:e.type}}function Op(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var kp=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function Ap({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new kp({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new kp({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new kp({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new kp({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new kp({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new kp({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new kp({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new kp({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Op(t))return new kp({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new kp({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new kp({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new kp({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var jp=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Mp=[`cross-platform`,`platform`];function Np(e){if(e&&!(Mp.indexOf(e)<0))return e}async function Pp(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!Tp())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:wp(t.challenge),user:{...t.user,id:wp(t.user.id)},excludeCredentials:t.excludeCredentials?.map(Dp)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=jp.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw Ap({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){Fp(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=Cp(e))}catch(e){Fp(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=Cp(c.getAuthenticatorData())}catch(e){Fp(`getAuthenticatorData()`,e)}return{id:o,rawId:Cp(s),response:{attestationObject:Cp(c.attestationObject),clientDataJSON:Cp(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:Np(a.authenticatorAttachment)}}function Fp(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function Ip(){if(!Tp())return Lp.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Lp.stubThis(new Promise(e=>e(!1))):Lp.stubThis(e.isConditionalMediationAvailable())}var Lp={stubThis:e=>e};function Rp({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new kp({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new kp({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Op(t))return new kp({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new kp({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new kp({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function zp(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!Tp())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(Dp));let a={...t,challenge:wp(t.challenge),allowCredentials:i},o={};if(n){if(!await Ip())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=jp.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Rp({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=Cp(u.userHandle)),{id:c,rawId:Cp(l),response:{authenticatorData:Cp(u.authenticatorData),clientDataJSON:Cp(u.clientDataJSON),signature:Cp(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:Np(s.authenticatorAttachment)}}async function Bp(e){await Hf(e)}async function Vp(){await Xf(),location.reload()}async function Hp(e){await Wf({response:await zp({optionsJSON:await Uf()}),...e})}async function Up(e){await Kf({response:await Pp({optionsJSON:await Gf(e.setupCode)}),...e})}async function Wp(e){await Kf({response:await Pp({optionsJSON:await Gf()}),passkeyName:e})}var Gp=/android|iphone|ipad|ipod|mobile/i;function Kp(e){return/edg(e|a|ios)?\//i.test(e)?`Edge`:/opr\/|opera/i.test(e)?`Opera`:/firefox|fxios/i.test(e)?`Firefox`:/chrome|crios|chromium/i.test(e)?`Chrome`:/safari/i.test(e)?`Safari`:`Browser`}function qp(e){return/iphone/i.test(e)?`iPhone`:/ipad/i.test(e)?`iPad`:/android/i.test(e)?`Android`:/windows/i.test(e)?`Windows`:/mac os x|macintosh/i.test(e)?`macOS`:/cros/i.test(e)?`ChromeOS`:/linux|x11/i.test(e)?`Linux`:``}function Jp(e){return{browser:Kp(e),platform:qp(e)}}function Yp(e){let{browser:t,platform:n}=Jp(e);return n?`${t} on ${n}`:t}function Xp(e){return Gp.test(e)?`mobile`:`browser`}function Zp(){return typeof navigator>`u`?``:navigator.userAgent}var Qp=O(`<p class="text-ui text-muted-foreground"> </p>`),$p=O(`<div class="grid gap-2 border-t border-border-subtle pt-4"><!></div>`),em=O(`<main class="flex min-h-full items-center justify-center bg-background p-4 text-foreground"><div class="grid w-full max-w-sm gap-5 rounded-lg border bg-card p-6 shadow-sm"><div class="grid gap-2"><!> <h1 class="text-title font-medium"> </h1> <!></div> <!> <!></div></main>`);function tm(e,t){var r=em(),i=q(r),a=q(i),o=q(a);eee(o,{class:`size-5 text-primary`,"aria-hidden":`true`});var s=G(o,2),c=z(s,!0),u=G(s,2),d=e=>{var n=Qp(),r=z(n,!0);F(()=>w(r,t.description)),k(e,n)};l(u,e=>{t.description&&e(d)}),x(a);var f=G(a,2);n(f,()=>t.children);var p=G(f,2),m=e=>{var r=$p(),i=q(r);n(i,()=>t.footer),x(r),k(e,r)};l(p,e=>{t.footer&&e(m)}),x(i),x(r),F(()=>w(c,t.title)),k(e,r)}function nm(e,n){c(n,!0);let r=L(()=>n.session.pairingBlockedReason===`plaintext_transport`?`This connection is not encrypted, so devices can't be paired or signed in over it. Open Nerve through its HTTPS address.`:`This device can't sign in from here. Open Nerve on the computer that runs it, or use its secure address.`);tm(e,{title:`Can't sign in over this connection`,get description(){return t(r)},children:(e,t)=>{Q(e,{variant:`outline`,get onclick(){return n.onRetry},children:(e,t)=>{y();var n=g(`Check again`);k(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),D()}var rm=vt({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),im=new wt(`Checkbox.Group`),am=new wt(`Checkbox.Root`),om=class e{static create(t,n=null){return am.set(new e(t,n))}opts;group;#e=L(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return t(this.#e)}set trueName(e){B(this.#e,e)}#t=L(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return t(this.#t)}set trueRequired(e){B(this.#t,e)}#n=L(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return t(this.#n)}set trueDisabled(e){B(this.#n,e)}#r=L(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return t(this.#r)}set trueReadonly(e){B(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=bt(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),ut.pre([()=>r(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{e&&t&&(this.opts.checked.current=e.includes(t))}),ut.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){this.trueDisabled||this.trueReadonly||(e.key===`Enter`?(e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit()):e.key===` `&&(e.preventDefault(),this.#i()))}#i(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){this.trueDisabled||this.trueReadonly||(this.opts.type.current===`submit`||e.preventDefault(),this.#i())}#a=L(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return t(this.#a)}set snippetProps(e){B(this.#a,e)}#o=L(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":yt(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":St(this.trueRequired),"aria-readonly":St(this.trueReadonly),"data-disabled":_t(this.trueDisabled),"data-readonly":_t(this.trueReadonly),"data-state":cm(this.opts.checked.current,this.opts.indeterminate.current),[rm.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return t(this.#o)}set props(e){B(this.#o,e)}},sm=class e{static create(){return new e(am.get())}root;#e=L(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return t(this.#e)}set trueChecked(e){B(this.#e,e)}#t=L(()=>!!this.root.trueName);get shouldRender(){return t(this.#t)}set shouldRender(e){B(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){dt(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=L(()=>({type:`checkbox`,checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return t(this.#n)}set props(e){B(this.#n,e)}};function cm(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}function lm(e,t){c(t,!1);let n=sm.create();he();var r=f(),i=R(r),a=e=>{sn(e,P(()=>n.props))};l(i,e=>{n.shouldRender&&e(a)}),k(e,r),D()}var um=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),dm=O(`<button><!></button>`),fm=O(`<!> <!>`,1);function pm(e,r){let i=d();c(r,!0);let a=K(r,`checked`,15,!1),o=K(r,`ref`,15,null),s=K(r,`disabled`,3,!1),u=K(r,`required`,3,!1),p=K(r,`name`,3,void 0),h=K(r,`value`,3,`on`),g=K(r,`id`,19,()=>lt(i)),_=K(r,`indeterminate`,15,!1),v=K(r,`type`,3,`button`),y=V(r,um),b=im.getOr(null);b&&h()&&(b.opts.value.current.includes(h())?a(!0):a(!1)),ut.pre(()=>h(),()=>{b&&h()&&(b.opts.value.current.includes(h())?a(!0):a(!1))});let S=om.create({checked:pt(()=>a(),e=>{a(e),r.onCheckedChange?.(e)}),disabled:pt(()=>s()??!1),required:pt(()=>u()),name:pt(()=>p()),value:pt(()=>h()),id:pt(()=>g()),ref:pt(()=>o(),e=>o(e)),indeterminate:pt(()=>_(),e=>{_(e),r.onIndeterminateChange?.(e)}),type:pt(()=>v()),readonly:pt(()=>!!r.readonly)},b),C=L(()=>mt({...y},S.props));var w=fm(),T=R(w),E=e=>{var i=f(),a=R(i);{let e=L(()=>({props:t(C),...S.snippetProps}));n(a,()=>r.child,()=>t(e))}k(e,i)},O=e=>{var i=dm();ie(i,()=>({...t(C)}));var a=q(i);n(a,()=>r.children??m,()=>S.snippetProps),x(i),k(e,i)};l(T,e=>{r.child?e(E):e(O,-1)}),lm(G(T,2),{}),k(e,w),D()}var mm=vt({component:`tabs`,parts:[`root`,`list`,`trigger`,`content`]}),hm=new wt(`Tabs.Root`),gm=class e{static create(t){return hm.set(new e(t))}opts;attachment;rovingFocusGroup;#e=Y(U([]));get triggerIds(){return t(this.#e)}set triggerIds(e){B(this.#e,e,!0)}valueToTriggerId=new yo;valueToContentId=new yo;constructor(e){this.opts=e,this.attachment=bt(e.ref),this.rovingFocusGroup=new ht({candidateAttr:mm.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,t){return this.triggerIds.push(e),this.valueToTriggerId.set(t,e),()=>{this.triggerIds=this.triggerIds.filter(t=>t!==e),this.valueToTriggerId.delete(t)}}registerContent(e,t){return this.valueToContentId.set(t,e),()=>{this.valueToContentId.delete(t)}}setValue(e){this.opts.value.current=e}#t=L(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[mm.root]:``,...this.attachment}));get props(){return t(this.#t)}set props(e){B(this.#t,e)}},_m=class e{static create(t){return new e(t,hm.get())}opts;root;attachment;#e=L(()=>this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=bt(e.ref)}#t=L(()=>({id:this.opts.id.current,role:`tablist`,"aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[mm.list]:``,"data-disabled":_t(t(this.#e)),...this.attachment}));get props(){return t(this.#t)}set props(e){B(this.#t,e)}},vm=class e{static create(t){return new e(t,hm.get())}opts;root;attachment;#e=Y(0);#t=L(()=>this.root.opts.value.current===this.opts.value.current);#n=L(()=>this.opts.disabled.current||this.root.opts.disabled.current);#r=L(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,n){this.opts=e,this.root=n,this.attachment=bt(e.ref),ut([()=>this.opts.id.current,()=>this.opts.value.current],([e,t])=>this.root.registerTrigger(e,t)),W(()=>{this.root.triggerIds.length,t(this.#t)||!this.root.opts.value.current?B(this.#e,0):B(this.#e,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!==`automatic`||t(this.#n)||this.#i()}onclick(e){t(this.#n)||this.#i()}onkeydown(e){t(this.#n)||(e.key===` `||e.key===`Enter`?(e.preventDefault(),this.#i()):this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e))}#a=L(()=>({id:this.opts.id.current,role:`tab`,"data-state":bm(t(this.#t)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":_t(t(this.#n)),"aria-selected":St(t(this.#t)),"aria-controls":t(this.#r),[mm.trigger]:``,disabled:Ct(t(this.#n)),tabindex:t(this.#e),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return t(this.#a)}set props(e){B(this.#a,e)}},ym=class e{static create(t){return new e(t,hm.get())}opts;root;attachment;#e=L(()=>this.root.opts.value.current===this.opts.value.current);#t=L(()=>this.root.valueToTriggerId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=bt(e.ref),ut([()=>this.opts.id.current,()=>this.opts.value.current],([e,t])=>this.root.registerContent(e,t))}#n=L(()=>({id:this.opts.id.current,role:`tabpanel`,hidden:Ct(!t(this.#e)),tabindex:0,"data-value":this.opts.value.current,"data-state":bm(t(this.#e)),"aria-labelledby":t(this.#t),"data-orientation":this.root.opts.orientation.current,[mm.content]:``,...this.attachment}));get props(){return t(this.#n)}set props(e){B(this.#n,e)}};function bm(e){return e?`active`:`inactive`}var xm=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`orientation`,`loop`,`activationMode`,`disabled`,`children`,`child`]),Sm=O(`<div><!></div>`);function Cm(e,r){let i=d();c(r,!0);let a=K(r,`id`,19,()=>lt(i)),o=K(r,`ref`,15,null),s=K(r,`value`,15,``),u=K(r,`onValueChange`,3,gt),p=K(r,`orientation`,3,`horizontal`),h=K(r,`loop`,3,!0),g=K(r,`activationMode`,3,`automatic`),_=K(r,`disabled`,3,!1),v=V(r,xm),y=gm.create({id:pt(()=>a()),value:pt(()=>s(),e=>{s(e),u()(e)}),orientation:pt(()=>p()),loop:pt(()=>h()),activationMode:pt(()=>g()),disabled:pt(()=>_()),ref:pt(()=>o(),e=>o(e))}),b=L(()=>mt(v,y.props));var S=f(),C=R(S),w=e=>{var i=f(),a=R(i);n(a,()=>r.child,()=>({props:t(b)})),k(e,i)},T=e=>{var i=Sm();ie(i,()=>({...t(b)}));var a=q(i);n(a,()=>r.children??m),x(i),k(e,i)};l(C,e=>{r.child?e(w):e(T,-1)}),k(e,S),D()}var wm=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`value`]),Tm=O(`<div><!></div>`);function Em(e,r){let i=d();c(r,!0);let a=K(r,`id`,19,()=>lt(i)),o=K(r,`ref`,15,null),s=V(r,wm),u=ym.create({value:pt(()=>r.value),id:pt(()=>a()),ref:pt(()=>o(),e=>o(e))}),p=L(()=>mt(s,u.props));var h=f(),g=R(h),_=e=>{var i=f(),a=R(i);n(a,()=>r.child,()=>({props:t(p)})),k(e,i)},v=e=>{var i=Tm();ie(i,()=>({...t(p)}));var a=q(i);n(a,()=>r.children??m),x(i),k(e,i)};l(g,e=>{r.child?e(_):e(v,-1)}),k(e,h),D()}var Dm=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`id`,`ref`]),Om=O(`<div><!></div>`);function km(e,r){let i=d();c(r,!0);let a=K(r,`id`,19,()=>lt(i)),o=K(r,`ref`,15,null),s=V(r,Dm),u=_m.create({id:pt(()=>a()),ref:pt(()=>o(),e=>o(e))}),p=L(()=>mt(s,u.props));var h=f(),g=R(h),_=e=>{var i=f(),a=R(i);n(a,()=>r.child,()=>({props:t(p)})),k(e,i)},v=e=>{var i=Om();ie(i,()=>({...t(p)}));var a=q(i);n(a,()=>r.children??m),x(i),k(e,i)};l(g,e=>{r.child?e(_):e(v,-1)}),k(e,h),D()}var Am=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`disabled`,`id`,`type`,`value`,`ref`]),jm=O(`<button><!></button>`);function Mm(e,r){let i=d();c(r,!0);let a=K(r,`disabled`,3,!1),o=K(r,`id`,19,()=>lt(i)),s=K(r,`type`,3,`button`),u=K(r,`ref`,15,null),p=V(r,Am),h=vm.create({id:pt(()=>o()),disabled:pt(()=>a()??!1),value:pt(()=>r.value),ref:pt(()=>u(),e=>u(e))}),g=L(()=>mt(p,h.props,{type:s()}));var _=f(),v=R(_),y=e=>{var i=f(),a=R(i);n(a,()=>r.child,()=>({props:t(g)})),k(e,i)},b=e=>{var i=jm();ie(i,()=>({...t(g)}));var a=q(i);n(a,()=>r.children??m),x(i),k(e,i)};l(v,e=>{r.child?e(y):e(b,-1)}),k(e,_),D()}var Nm=vt({component:`toolbar`,parts:[`root`,`item`,`group`,`group-item`,`link`,`button`]}),Pm=new wt(`Toolbar.Root`);new wt(`Toolbar.Group`);var Fm=class e{static create(t){return Pm.set(new e(t))}opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=bt(this.opts.ref),this.rovingFocusGroup=new ht({orientation:this.opts.orientation,loop:this.opts.loop,rootNode:this.opts.ref,candidateAttr:Nm.item})}#e=L(()=>({id:this.opts.id.current,role:`toolbar`,"data-orientation":this.opts.orientation.current,[Nm.root]:``,...this.attachment}));get props(){return t(this.#e)}set props(e){B(this.#e,e)}},Im=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`,`loop`,`child`,`children`]),Lm=O(`<div><!></div>`);function Rm(e,r){let i=d();c(r,!0);let a=K(r,`ref`,15,null),o=K(r,`id`,19,()=>lt(i)),s=K(r,`orientation`,3,`horizontal`),u=K(r,`loop`,3,!0),p=V(r,Im),h=Fm.create({id:pt(()=>o()),orientation:pt(()=>s()),loop:pt(()=>u()),ref:pt(()=>a(),e=>a(e))}),g=L(()=>mt(p,h.props));var _=f(),v=R(_),y=e=>{var i=f(),a=R(i);n(a,()=>r.child,()=>({props:t(g)})),k(e,i)},b=e=>{var i=Lm();ie(i,()=>({...t(g)}));var a=q(i);n(a,()=>r.children??m),x(i),k(e,i)};l(v,e=>{r.child?e(y):e(b,-1)}),k(e,_),D()}var zm={TLS_REQUIRED:`This connection is not encrypted, so devices can't be paired over it. Open Nerve through its HTTPS address.`,PAIRING_CODE_INVALID:`That code isn't valid. It may have expired or already been used. Generate a new one in Nerve on your computer.`,PASSKEY_ENROLLMENT_REQUIRED:"Set up a passkey first. Use the setup code printed by the Nerve daemon or run `nerve pair --enroll`.",PASSKEY_NOT_ENROLLED:`No passkey is set up for this Nerve yet.`,PASSKEY_VERIFICATION_FAILED:`The passkey could not be verified. Try again or use a different passkey.`,PASSKEY_LAST_REMAINING:`This is your only passkey. Add another one before removing it.`,PUBLIC_URL_REQUIRED:`Passkeys need a public HTTPS address. Set Nerve's public URL and open it from there.`,LOCAL_ONLY:`This action is only available on the computer running Nerve.`,DEVICE_NOT_FOUND:`That device is no longer registered.`,UNAUTHORIZED:`You're signed out. Reload to pair this device again.`,FORBIDDEN:`This device isn't allowed to do that.`,MISDIRECTED_REQUEST:`Nerve doesn't serve this address. Use the address shown on your computer.`};function Bm(e){if(e<90)return`${Math.max(1,Math.ceil(e))} seconds`;let t=Math.ceil(e/60);return t===1?`1 minute`:`${t} minutes`}function Vm(e){return e instanceof ot?e.code===`RATE_LIMITED`?e.retryAfterSeconds===void 0?`Too many attempts. Wait a little and try again.`:`Too many attempts. Try again in ${Bm(e.retryAfterSeconds)}.`:e.code&&zm[e.code]?zm[e.code]:e.message?e.message:`The request failed.`:Hm(e)?`The passkey prompt was cancelled or timed out.`:e instanceof TypeError?`Couldn't reach Nerve. Check your connection and try again.`:e instanceof Error&&e.message?e.message:`Something went wrong.`}function Hm(e){return e instanceof Error?e.name===`NotAllowedError`||e.name===`AbortError`:!1}function Um(){let e=Y(!1),n=Y(void 0);return{get busy(){return t(e)},get error(){return t(n)},clearError(){B(n,void 0)},async run(r){if(t(e))return!1;B(e,!0),B(n,void 0);try{return await r(),!0}catch(e){return B(n,Vm(e),!0),!1}finally{B(e,!1)}}}}var Wm=O(`<!> Pair device`,1),Gm=O(`<form class="grid gap-4"><div class="grid gap-1.5"><!> <!></div> <div class="grid gap-1.5"><!> <!></div> <!> <!></form>`);function Km(e,n){c(n,!0);let r=Y(U(n.initialCode??``)),i=Y(U(n.initialDeviceName)),a=Um(),o=L(()=>lp(t(r))),s=L(()=>!!t(o)&&t(i).trim().length>0);function u(e){e.preventDefault(),t(o)&&t(s)&&a.run(()=>n.onPair({code:t(o),deviceName:t(i).trim()}))}tm(e,{title:`Pair this device`,description:`Enter the code shown in Nerve on your computer (Settings → Devices → Pair a device).`,footer:e=>{var t=f(),r=R(t),i=e=>{Q(e,{variant:`ghost`,get onclick(){return n.onUsePasskey},children:(e,t)=>{y();var n=g(`Sign in with a passkey`);k(e,n)},$$slots:{default:!0}})};l(r,e=>{n.onUsePasskey&&e(i)}),k(e,t)},children:(e,n)=>{var o=Gm(),c=q(o),d=q(c);un(d,{for:`pair-code`,children:(e,t)=>{y();var n=g(`Pairing code`);k(e,n)},$$slots:{default:!0}});var f=G(d,2);an(f,{id:`pair-code`,get value(){return t(r)},oninput:e=>B(r,e.currentTarget.value,!0),placeholder:`XXXX-XXXX`,autocomplete:`off`,autocapitalize:`characters`,spellcheck:!1,class:`uppercase`}),x(c);var p=G(c,2),m=q(p);un(m,{for:`pair-device-name`,children:(e,t)=>{y();var n=g(`Device name`);k(e,n)},$$slots:{default:!0}});var h=G(m,2);an(h,{id:`pair-device-name`,get value(){return t(i)},oninput:e=>B(i,e.currentTarget.value,!0),maxlength:80,autocomplete:`off`}),x(p);var _=G(p,2),v=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return a.error}})};l(_,e=>{a.error&&e(v)});var b=G(_,2);{let e=L(()=>!t(s)||a.busy);Q(b,{type:`submit`,get disabled(){return t(e)},children:(e,t)=>{var n=Wm(),r=R(n),i=e=>{dn(e,{})};l(r,e=>{a.busy&&e(i)}),y(),k(e,n)},$$slots:{default:!0}})}x(o),M(`submit`,o,u),k(e,o)},$$slots:{footer:!0,default:!0}}),D()}var qm=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jm(e,t){let n=V(t,qm),r=[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`}],[`path`,{d:`M2 16h.01`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`}]];Z(e,P({name:`fingerprint-pattern`},()=>n,{get iconNode(){return r}}))}var Ym=O(`<!> Create passkey`,1),Xm=O(`<form class="grid gap-4"><div class="grid gap-1.5"><!> <!></div> <div class="grid gap-1.5"><!> <!></div> <div class="grid gap-1.5"><!> <!></div> <!> <!></form>`);function Zm(e,n){c(n,!0);let r=Y(U(n.initialCode??``)),i=Y(U(n.initialDeviceName)),a=Y(U(n.initialDeviceName)),o=Um(),s=L(()=>lp(t(r))),u=L(()=>!!t(s)&&t(i).trim()!==``&&t(a).trim()!==``);function d(e){e.preventDefault(),t(s)&&t(u)&&o.run(()=>n.onEnroll({setupCode:t(s),passkeyName:t(a).trim(),deviceName:t(i).trim()}))}tm(e,{title:`Set up a passkey`,description:"This Nerve is reachable from the internet and needs a passkey before anything else can sign in. Enter the setup code printed by the daemon, or run `nerve pair --enroll` on the host.",children:(e,n)=>{var s=Xm(),c=q(s),f=q(c);un(f,{for:`setup-code`,children:(e,t)=>{y();var n=g(`Setup code`);k(e,n)},$$slots:{default:!0}});var p=G(f,2);an(p,{id:`setup-code`,get value(){return t(r)},oninput:e=>B(r,e.currentTarget.value,!0),placeholder:`XXXX-XXXX`,autocomplete:`off`,autocapitalize:`characters`,spellcheck:!1,class:`uppercase`}),x(c);var m=G(c,2),h=q(m);un(h,{for:`setup-passkey-name`,children:(e,t)=>{y();var n=g(`Passkey name`);k(e,n)},$$slots:{default:!0}});var _=G(h,2);an(_,{id:`setup-passkey-name`,get value(){return t(a)},oninput:e=>B(a,e.currentTarget.value,!0),maxlength:80,autocomplete:`off`}),x(m);var v=G(m,2),b=q(v);un(b,{for:`setup-device-name`,children:(e,t)=>{y();var n=g(`Device name`);k(e,n)},$$slots:{default:!0}});var S=G(b,2);an(S,{id:`setup-device-name`,get value(){return t(i)},oninput:e=>B(i,e.currentTarget.value,!0),maxlength:80,autocomplete:`off`}),x(v);var C=G(v,2),w=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return o.error}})};l(C,e=>{o.error&&e(w)});var T=G(C,2);{let e=L(()=>!t(u)||o.busy);Q(T,{type:`submit`,get disabled(){return t(e)},children:(e,t)=>{var n=Ym(),r=R(n),i=e=>{dn(e,{})},a=e=>{Jm(e,{})};l(r,e=>{o.busy?e(i):e(a,-1)}),y(),k(e,n)},$$slots:{default:!0}})}x(s),M(`submit`,s,d),k(e,s)},$$slots:{default:!0}}),D()}var Qm=O(`<!> Sign in with passkey`,1),$m=O(`<form class="grid gap-4"><div class="grid gap-1.5"><!> <!></div> <!> <!></form>`);function eh(e,n){c(n,!0);let r=Y(U(n.initialDeviceName)),i=Um();function a(e){e.preventDefault();let a=t(r).trim();a&&i.run(()=>n.onLogin({deviceName:a}))}tm(e,{title:`Sign in to Nerve`,description:`Use your passkey to sign this device in.`,footer:e=>{var t=f(),r=R(t),i=e=>{Q(e,{variant:`ghost`,get onclick(){return n.onUsePairing},children:(e,t)=>{y();var n=g(`Use a pairing code`);k(e,n)},$$slots:{default:!0}})};l(r,e=>{n.onUsePairing&&e(i)}),k(e,t)},children:(e,n)=>{var o=$m(),s=q(o),c=q(s);un(c,{for:`login-device-name`,children:(e,t)=>{y();var n=g(`Device name`);k(e,n)},$$slots:{default:!0}});var u=G(c,2);an(u,{id:`login-device-name`,get value(){return t(r)},oninput:e=>B(r,e.currentTarget.value,!0),maxlength:80,autocomplete:`off`}),x(s);var d=G(s,2),f=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return i.error}})};l(d,e=>{i.error&&e(f)});var p=G(d,2);{let e=L(()=>!t(r).trim()||i.busy);Q(p,{type:`submit`,get disabled(){return t(e)},children:(e,t)=>{var n=Qm(),r=R(n),a=e=>{dn(e,{})},o=e=>{Jm(e,{})};l(r,e=>{i.busy?e(a):e(o,-1)}),y(),k(e,n)},$$slots:{default:!0}})}x(o),M(`submit`,o,a),k(e,o)},$$slots:{footer:!0,default:!0}}),D()}var th=O(`<div class="h-dvh overflow-auto bg-background"><!></div>`);function nh(e,r){c(r,!0);let i=Zp(),a=Xp(i),o=Yp(i),s=Y(!1);le(Sp);let u=L(()=>mp.session);W(()=>{mp.phase===`settled`&&r.onGateVisibleChange?.(mp.screen!==`app`)});let d=L(()=>mp.screen===`pair`||mp.screen===`passkey-login`&&t(s));function p(){B(s,!1),xp(),bp()}async function m(e){await Bp({...e,kind:a}),xp(),await bp()}async function h(e){await Hp({...e,kind:a}),await bp()}async function g(e){await Up({...e,kind:a}),xp(),await bp()}var _=f(),v=R(_),y=e=>{var i=f(),a=R(i),c=e=>{var t=f(),i=R(t);n(i,()=>r.children),k(e,t)},_=e=>{var n=th(),r=q(n),i=e=>{{let n=L(()=>t(u).passkey.loginAvailable?p:void 0);Km(e,{get initialCode(){return mp.pendingPairCode},get initialDeviceName(){return o},onPair:m,get onUsePasskey(){return t(n)}})}},a=e=>{{let n=L(()=>sp(t(u))?()=>B(s,!0):void 0);eh(e,{get initialDeviceName(){return o},onLogin:h,get onUsePairing(){return t(n)}})}},c=e=>{Zm(e,{get initialCode(){return mp.pendingPairCode},get initialDeviceName(){return o},onEnroll:g})},f=e=>{nm(e,{get session(){return t(u)},onRetry:()=>void bp()})};l(r,e=>{t(d)?e(i):mp.screen===`passkey-login`?e(a,1):mp.screen===`passkey-enroll`?e(c,2):e(f,-1)}),x(n),k(e,n)};l(a,e=>{mp.screen===`app`?e(c):e(_,-1)}),k(e,i)};l(v,e=>{mp.phase===`settled`&&t(u)&&e(y)}),k(e,_),D()}var rh=O(`<button type="button" class="flex-none rounded-sm font-medium text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-focus"> </button> <!> <!> <span class="min-w-0 truncate" aria-current="page"> </span>`,1),ih=O(`<p class="text-ui text-muted-foreground"> </p>`),ah=O(`<div class="flex flex-none flex-wrap items-center justify-end gap-2"><!></div>`),oh=O(`<header><div class="flex min-w-0 items-start justify-between gap-4"><div class="grid min-w-0 gap-0.5"><h2 tabindex="-1" class="flex min-w-0 items-center gap-1.5 text-title font-medium text-foreground outline-none"><!></h2> <!></div> <!></div> <!></header>`);function sh(e,r){c(r,!0);let i=Y(void 0),a=L(()=>!!r.parent);W(()=>{t(a)&&t(i)?.focus({preventScroll:!0})});var o=oh(),s=q(o),u=q(s),d=q(u),p=q(d),m=e=>{var t=rh(),i=R(t),a=z(i,!0),o=G(i,2);mn(o,{class:`size-4 flex-none text-muted-foreground`,"aria-hidden":`true`});var s=G(o,2),c=e=>{var t=f(),i=R(t);n(i,()=>r.leading),k(e,t)};l(s,e=>{r.leading&&e(c)});var u=G(s,2),d=z(u,!0);F(()=>{J(i,`title`,`Back to ${r.parent.label}`),w(a,r.parent.label),w(d,r.title)}),h(`click`,i,function(...e){r.parent.onBack?.apply(this,e)}),k(e,t)},_=e=>{var t=g();F(()=>w(t,r.title)),k(e,t)};l(p,e=>{r.parent?e(m):e(_,-1)}),x(d),te(d,e=>B(i,e),()=>t(i));var v=G(d,2),y=e=>{var t=ih(),n=z(t,!0);F(()=>w(n,r.description)),k(e,t)};l(v,e=>{r.description&&e(y)}),x(u);var b=G(u,2),S=e=>{var t=ah(),i=q(t);n(i,()=>r.actions),x(t),k(e,t)};l(b,e=>{r.actions&&e(S)}),x(s);var C=G(s,2),E=e=>{var t=f(),i=R(t);n(i,()=>r.below),k(e,t)};l(C,e=>{r.below&&e(E)}),x(o),F(e=>X(o,1,e),[()=>T(ft(`grid min-w-0 gap-1 pb-2`,r.class))]),k(e,o),D()}ue([`click`]);var ch=O(`<div class="flex min-w-0 items-center gap-1.5"><h3 tabindex="-1" class="truncate text-ui font-medium text-foreground outline-none"> </h3> <!></div>`),lh=O(`<p class="text-caption text-muted-foreground"> </p>`),uh=O(`<div class="flex flex-none items-center gap-1.5"><!></div>`),dh=O(`<div class="flex-none pr-[calc(--spacing(3)+1px)]"><!></div>`),fh=O(`<div class="flex justify-end pr-[calc(--spacing(3)+1px)]"><!></div>`),ph=O(`<div class="flex min-h-6 min-w-0 items-end justify-between gap-3"><div class="grid min-w-0 gap-0.5"><!> <!></div> <!></div> <!>`,1),mh=O(`<div class="min-w-0 px-0.5 text-caption text-muted-foreground"><!></div>`),hh=O(`<section><!> <!> <div><!></div> <!></section>`);function gh(e,t){c(t,!0);let r=K(t,`divided`,3,!1),i=K(t,`surface`,3,!0);var a=hh(),o=q(a),s=e=>{var r=ph(),i=R(r),a=q(i),o=q(a),s=e=>{var r=ch(),i=q(r),a=z(i,!0),o=G(i,2),s=e=>{var r=f(),i=R(r);n(i,()=>t.titleHint),k(e,r)};l(o,e=>{t.titleHint&&e(s)}),x(r),F(()=>{J(i,`id`,t.id?`${t.id}-title`:void 0),w(a,t.title)}),k(e,r)};l(o,e=>{t.title&&e(s)});var c=G(o,2),u=e=>{var n=lh(),r=z(n,!0);F(()=>w(r,t.description)),k(e,n)};l(c,e=>{t.description&&e(u)}),x(a);var d=G(a,2),p=e=>{var r=uh(),i=q(r);n(i,()=>t.actions),x(r),k(e,r)},m=e=>{var r=dh(),i=q(r);n(i,()=>t.labels),x(r),k(e,r)};l(d,e=>{t.actions?e(p):t.labels&&e(m,1)}),x(i);var h=G(i,2),g=e=>{var r=fh(),i=q(r);n(i,()=>t.labels),x(r),k(e,r)};l(h,e=>{t.actions&&t.labels&&e(g)}),k(e,r)};l(o,e=>{(t.title||t.description||t.actions||t.labels)&&e(s)});var u=G(o,2),d=e=>{var r=f(),i=R(r);n(i,()=>t.beforeBody),k(e,r)};l(u,e=>{t.beforeBody&&e(d)});var p=G(u,2),m=q(p);n(m,()=>t.children),x(p);var h=G(p,2),g=e=>{var r=mh(),i=q(r);n(i,()=>t.footer),x(r),k(e,r)};l(h,e=>{t.footer&&e(g)}),x(a),F((e,n)=>{J(a,`id`,t.id),J(a,`aria-labelledby`,t.id&&t.title?`${t.id}-title`:void 0),X(a,1,e),J(p,`data-page-surface`,i()?``:void 0),J(p,`data-page-divided`,i()&&r()?``:void 0),X(p,1,n)},[()=>T(ft(`-mx-2 grid min-w-0 scroll-mt-3 gap-2 px-2`,t.class)),()=>T(ft(`group/surface grid min-w-0`,i()?r()?`divide-y divide-border rounded-lg border bg-card`:`gap-1 rounded-lg border bg-card px-3 py-1.5`:`gap-2`,t.bodyClass))]),k(e,a),D()}var _h=O(`<p class="flex flex-wrap items-center gap-x-1.5 text-caption text-muted-foreground"> <!></p>`),vh=O(`<div class="grid min-w-0 gap-0.5"><div class="flex min-w-0 items-center gap-2"><!> <!></div> <!></div>`),yh=O(`<div><!></div>`),bh=O(`<div><!> <!> <!></div>`);function xh(e,r){c(r,!0);let i=K(r,`layout`,3,`inline`),a=K(r,`mono`,3,!1);var o=bh(),s=q(o),u=e=>{var i=vh(),o=q(i),s=q(o),c=e=>{{let n=L(()=>ft(`text-ui text-foreground`,a()&&`font-mono`)),i=L(()=>r.htmlFor?void 0:`true`);un(e,{get for(){return r.htmlFor},get class(){return t(n)},get"aria-hidden"(){return t(i)},children:(e,t)=>{y();var n=g();F(()=>w(n,r.label)),k(e,n)},$$slots:{default:!0}})}};l(s,e=>{r.label&&e(c)});var u=G(s,2),d=e=>{var t=f(),i=R(t);n(i,()=>r.badges),k(e,t)};l(u,e=>{r.badges&&e(d)}),x(o);var p=G(o,2),m=e=>{var t=_h(),i=q(t),a=G(i),o=e=>{var t=f(),i=R(t);n(i,()=>r.hint),k(e,t)};l(a,e=>{r.hint&&e(o)}),x(t),F(()=>w(i,`${r.description??``} `)),k(e,t)};l(p,e=>{(r.description||r.hint)&&e(m)}),x(i),k(e,i)};l(s,e=>{(r.label||r.description||r.badges||r.hint)&&e(u)});var d=G(s,2),p=e=>{var t=yh(),a=q(t);n(a,()=>r.control),x(t),F(e=>X(t,1,e),[()=>T(ft(`min-w-0`,i()===`inline`&&`flex items-center justify-end`,`group-data-page-divided/surface:flex group-data-page-divided/surface:items-center group-data-page-divided/surface:justify-end group-data-page-divided/surface:gap-2`,i()===`responsive`&&`sm:flex sm:items-center sm:justify-end`))]),k(e,t)};l(d,e=>{r.control&&e(p)});var m=G(d,2),h=e=>{var t=f(),i=R(t);n(i,()=>r.children),k(e,t)};l(m,e=>{r.children&&e(h)}),x(o),F(e=>X(o,1,e),[()=>T(ft(`gap-3 py-1.5`,`group-data-page-divided/surface:min-h-12 group-data-page-divided/surface:gap-x-4 group-data-page-divided/surface:px-3 group-data-page-divided/surface:py-2`,i()===`inline`?`grid grid-cols-[minmax(0,1fr)_auto] items-center group-data-page-divided/surface:grid-cols-1 group-data-page-divided/surface:@md/page:grid-cols-[minmax(0,1fr)_14rem]`:i()===`responsive`?`grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:gap-3 group-data-page-divided/surface:sm:grid-cols-[minmax(0,1fr)_14rem]`:`grid gap-2`,r.class))]),k(e,o),D()}function Sh(e,t){c(t,!0);let n=K(t,`checked`,15,!1),r=K(t,`disabled`,3,!1);function i(e){n(e),t.onCheckedChange?.(e)}xh(e,{get label(){return t.label},get description(){return t.description},get badges(){return t.badges},get class(){return t.class},control:e=>{yn(e,{get disabled(){return r()},get"aria-label"(){return t.label},onCheckedChange:i,get checked(){return n()},set checked(e){n(e)}})},$$slots:{control:!0}}),D()}var Ch=O(`<div><!></div>`);function wh(e,t){c(t,!0);var r=Ch(),i=q(r);n(i,()=>t.children),x(r),F(e=>{J(r,`role`,t.ariaLabel?`list`:void 0),J(r,`aria-label`,t.ariaLabel),X(r,1,e)},[()=>T(ft(`divide-y divide-border overflow-hidden rounded-md border bg-card`,`group-not-data-page-divided/surface:group-data-page-surface/surface:-mx-3 group-not-data-page-divided/surface:group-data-page-surface/surface:-my-1.5 group-data-page-surface/surface:rounded-[inherit] group-data-page-surface/surface:border-x-0 group-data-page-surface/surface:border-y-0 group-data-page-surface/surface:bg-transparent`,t.class))]),k(e,r),D()}var Th=new Set([`$$slots`,`$$events`,`$$legacy`]);function Eh(e,t){let n=V(t,Th),r=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]];Z(e,P({name:`lock`},()=>n,{get iconNode(){return r}}))}var Dh=O(`<button type="button" class="absolute inset-0 cursor-pointer focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus"></button>`),Oh=O(`<span class="pointer-events-none flex size-8 flex-none items-center justify-center"><span class="pointer-events-auto relative flex"><!></span></span>`),kh=O(`<span class="pointer-events-none flex size-8 flex-none items-center justify-center"><!></span>`),Ah=O(`<span><!></span>`),jh=O(`<!> <!>`,1),Mh=O(`<span class="pointer-events-auto relative flex flex-none items-center gap-1"><!></span>`),Nh=O(`<span class="flex-none text-muted-foreground" aria-hidden="true">·</span> <button type="button" class="pointer-events-auto relative flex-none rounded-sm font-medium hover:text-foreground focus-visible:outline-2 focus-visible:outline-focus"> </button>`,1),Ph=O(`<span class="flex min-w-0 items-center gap-1 text-caption text-warning"><!> <span class="truncate"> </span> <!></span>`),Fh=O(`<span> </span>`),Ih=O(`<div class="pointer-events-auto relative min-w-0"><!></div>`),Lh=O(`<span class="inline-flex"><!></span>`),Rh=O(`<span class="text-caption text-muted-foreground">Always on</span>`),zh=O(`<div role="listitem"><!> <!> <div class="pointer-events-none grid min-w-0 flex-1 gap-0.5"><div class="flex min-w-0 items-center gap-1.5"><span> </span> <!></div> <!> <!></div> <div class="relative flex flex-none items-center gap-2"><!> <!> <!> <!> <!></div></div>`);function Bh(e,r){c(r,!0);let i=K(r,`muted`,3,!1),a=K(r,`compact`,3,!1),o=K(r,`mono`,3,!1),s=K(r,`checked`,15),u=K(r,`always`,3,!1),d=K(r,`disabled`,3,!1),p=L(()=>i()||s()===!1),m=L(()=>s()!==void 0&&!u());var _=zh(),v=q(_),b=e=>{var t=Dh();F(()=>J(t,`aria-label`,r.openLabel??`Open ${r.title}`)),h(`click`,t,function(...e){r.onOpen?.apply(this,e)}),k(e,t)};l(v,e=>{r.onOpen&&e(b)});var S=G(v,2),C=e=>{var t=Oh(),i=q(t),a=q(i);n(a,()=>r.select),x(i),x(t),k(e,t)},E=e=>{var t=kh(),i=q(t);n(i,()=>r.leading),x(t),k(e,t)},O=e=>{let n=L(()=>ft(`flex size-8 flex-none items-center justify-center rounded-md border bg-card`,t(p)?`text-muted-foreground`:`text-foreground`));var i=f(),a=R(i),o=e=>{var i=f(),a=R(i);H(a,()=>En,(e,i)=>{i(e,{delayDuration:300,children:(e,i)=>{var a=f(),o=R(a);H(o,()=>wn,(e,i)=>{i(e,{children:(e,i)=>{var a=jh(),o=R(a);{let e=(e,i)=>{let a=()=>(i?.()).props;var o=Ah();ie(o,e=>({...a(),class:e,role:`presentation`,onclick:r.onOpen}),[()=>ft(t(n),`relative`)]);var s=q(o);H(s,()=>r.icon,(e,t)=>{t(e,{class:`size-4`,"aria-hidden":`true`})}),x(o),k(e,o)};H(o,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var s=G(o,2);H(s,()=>Sn,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(()=>w(n,r.iconLabel)),k(e,n)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,i)},s=e=>{var i=Ah(),a=q(i);H(a,()=>r.icon,(e,t)=>{t(e,{class:`size-4`,"aria-hidden":`true`})}),x(i),F(e=>X(i,1,e),[()=>T(ft(t(n),`pointer-events-none`))]),k(e,i)};l(a,e=>{r.iconLabel?e(o):e(s,-1)}),k(e,i)};l(S,e=>{r.select?e(C):r.leading?e(E,1):r.icon&&e(O,2)});var A=G(S,2),j=q(A),M=q(j),N=z(M,!0),P=G(M,2),I=e=>{var t=Mh(),i=q(t);n(i,()=>r.badges),x(t),k(e,t)};l(P,e=>{r.badges&&e(I)}),x(j);var ee=G(j,2),te=e=>{},ne=e=>{var t=Ph(),n=q(t);bn(n,{class:`size-3 flex-none`,"aria-hidden":`true`});var i=G(n,2),a=z(i,!0),o=G(i,2),s=e=>{var t=Nh(),n=G(R(t),2),i=z(n,!0);F(()=>w(i,r.problemAction.label)),h(`click`,n,function(...e){r.problemAction.onclick?.apply(this,e)}),k(e,t)};l(o,e=>{r.problemAction&&e(s)}),x(t),F(()=>{J(i,`title`,r.problem),w(a,r.problem)}),k(e,t)},re=e=>{var t=Fh(),n=z(t,!0);F(e=>{X(t,1,e),J(t,`title`,r.summary),w(n,r.summary)},[()=>T(ft(`truncate text-caption text-muted-foreground`,o()&&`font-mono`))]),k(e,t)};l(ee,e=>{a()?e(te):r.problem&&!t(p)?e(ne,1):r.summary&&e(re,2)});var B=G(ee,2),ae=e=>{var t=Ih(),i=q(t);n(i,()=>r.children),x(t),k(e,t)};l(B,e=>{r.children&&e(ae)}),x(A);var V=G(A,2),oe=q(V),se=e=>{var t=f(),i=R(t);n(i,()=>r.meta),k(e,t)};l(oe,e=>{r.meta&&e(se)});var ce=G(oe,2),U=e=>{var t=f(),i=R(t);n(i,()=>r.actions),k(e,t)};l(ce,e=>{r.actions&&e(U)});var le=G(ce,2),W=e=>{var n=Lh(),i=q(n);{let e=L(()=>`Locked by ${r.lockedBy}`);Eh(i,{class:`size-3.5 text-muted-foreground`,get"aria-label"(){return t(e)}})}x(n),F(()=>J(n,`title`,`Locked by ${r.lockedBy}`)),k(e,n)};l(le,e=>{r.lockedBy&&e(W)});var ue=G(le,2),de=e=>{var t=Rh();k(e,t)},fe=e=>{{let n=L(()=>d()||!!r.lockedBy),i=L(()=>r.switchLabel??`Enable ${r.title}`);yn(e,{get disabled(){return t(n)},get"aria-label"(){return t(i)},get onCheckedChange(){return r.onCheckedChange},get checked(){return s()},set checked(e){s(e)}})}};l(ue,e=>{u()?e(de):t(m)&&e(fe,1)});var pe=G(ue,2),me=e=>{{let n=L(()=>ft(`size-4 text-muted-foreground transition-transform group-hover/item:translate-x-0.5`,!r.onOpen&&`invisible`));mn(e,{get class(){return t(n)},"aria-hidden":`true`})}};l(pe,e=>{(r.onOpen||!r.actions)&&e(me)}),x(V),x(_),F((e,t)=>{J(_,`data-tour-id`,r.tourId),X(_,1,e),X(M,1,t),w(N,r.title)},[()=>T(ft(`group/item relative flex items-center gap-3 px-3 transition-colors`,a()?`min-h-10 py-1`:`min-h-14 py-2`,r.onOpen&&`hover:bg-hover`,r.class)),()=>T(ft(`truncate text-ui`,t(p)?`text-muted-foreground`:`text-foreground`))]),k(e,_),D()}ue([`click`]);var Vh=O(`<span class="text-ui text-muted-foreground"> </span>`),Hh=O(`<div class="flex flex-none items-center gap-1.5"><!></div>`),Uh=O(`<div><!> <div class="grid min-w-0 flex-1 gap-0.5"><span class="text-ui text-foreground"> </span> <!></div> <!></div>`);function Wh(e,t){c(t,!0);let r=K(t,`variant`,3,`plain`);var i=Uh(),a=q(i),o=e=>{var n=f(),r=R(n);H(r,()=>t.icon,(e,t)=>{t(e,{class:`size-4 flex-none text-muted-foreground`,"aria-hidden":`true`})}),k(e,n)};l(a,e=>{t.icon&&e(o)});var s=G(a,2),u=q(s),d=z(u,!0),p=G(u,2),m=e=>{var n=Vh(),r=z(n,!0);F(()=>w(r,t.description)),k(e,n)};l(p,e=>{t.description&&e(m)}),x(s);var h=G(s,2),g=e=>{var r=Hh(),i=q(r);n(i,()=>t.actions),x(r),k(e,r)};l(h,e=>{t.actions&&e(g)}),x(i),F(e=>{X(i,1,e),w(d,t.title)},[()=>T(ft(`flex flex-wrap items-center gap-x-3 gap-y-1.5 py-2 text-ui`,`group-data-page-divided/surface:min-h-14 group-data-page-divided/surface:px-3`,r()===`card`&&`rounded-md border border-dashed bg-card px-3 py-2 group-data-page-surface/surface:border-0 group-data-page-surface/surface:bg-transparent group-not-data-page-divided/surface:group-data-page-surface/surface:px-0`,t.class))]),k(e,i),D()}var Gh=O(`<div><span class="truncate text-caption text-muted-foreground"> </span> <span> </span></div>`),Kh=O(`<div></div>`);function qh(e,n){c(n,!0);var r=Kh();v(r,21,()=>n.items,e=>e.label,(e,n)=>{var r=Gh(),i=q(r),a=z(i,!0),o=G(i,2),s=z(o,!0);x(r),F((e,i)=>{X(r,1,e),w(a,t(n).label),X(o,1,i),J(o,`title`,t(n).value),w(s,t(n).value)},[()=>T(ft(`grid min-w-0 gap-0.5 rounded-md bg-muted px-2.5 py-2`,t(n).wide&&`md:col-span-2`)),()=>T(ft(`truncate text-ui text-foreground`,t(n).mono&&`font-mono text-ui`))]),k(e,r)}),x(r),F(e=>X(r,1,e),[()=>T(ft(`grid grid-cols-1 gap-2 md:grid-cols-2`,n.class))]),k(e,r),D()}var Jh=new Set([`$$slots`,`$$events`,`$$legacy`]);function Yh(e,t){let n=V(t,Jh),r=[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`}],[`path`,{d:`M21 21v.01`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`}],[`path`,{d:`M3 12h.01`}],[`path`,{d:`M12 3h.01`}],[`path`,{d:`M12 16v.01`}],[`path`,{d:`M16 12h1`}],[`path`,{d:`M21 12v.01`}],[`path`,{d:`M12 21v-1`}]];Z(e,P({name:`qr-code`},()=>n,{get iconNode(){return r}}))}var Xh=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zh(e,t){let n=V(t,Xh),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`M12 8v4`}],[`path`,{d:`M12 16h.01`}]];Z(e,P({name:`shield-alert`},()=>n,{get iconNode(){return r}}))}var Qh=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]),$h=O(`<div></div>`);function eg(e,t){c(t,!0);let n=K(t,`ref`,15,null),r=V(t,Qh);var i=$h();ie(i,e=>({"data-slot":`skeleton`,class:e,...r}),[()=>ft(`bg-foreground/10 rounded-md animate-pulse`,t.class)]),te(i,e=>n(e),()=>n()),k(e,i),D()}var tg=Array(12).fill(0),ng=O(`<div class="sonner-loading-bar"></div>`),rg=O(`<div><div class="sonner-spinner"></div></div>`);function ig(e,t){c(t,!0);var n=rg(),r=q(n);v(r,23,()=>tg,(e,t)=>`spinner-bar-${t}`,(e,t)=>{var n=ng();k(e,n)}),x(r),x(n),F(e=>{X(n,1,e),J(n,`data-visible`,t.visible)},[()=>T([`sonner-loading-wrapper`,t.class].filter(Boolean).join(` `))]),k(e,n),D()}var ag=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function og(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=ag,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=i(e=>{let n=j(t,`focusin`,e),r=j(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?og(this.#e):null}};var sg=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return _e(this.#t)}get(){let e=a(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=a(this.#t);return t===void 0?e:t}set(e){return o(this.#t,e)}};new sg(`richColorsContext`);var cg=new sg(`<Toaster/>`);function lg(e){return e.label!==void 0}function ug(){let e=Y(U(typeof document<`u`&&document.hidden));return W(()=>j(document,`visibilitychange`,()=>{B(e,document.hidden,!0)})),{get current(){return t(e)}}}var dg=4e3,fg=14,pg=45,mg=200,hg=.05,gg={toast:``,title:``,description:``,loader:``,closeButton:``,cancelButton:``,actionButton:``,action:``,warning:``,error:``,success:``,default:``,info:``,loading:``};function _g(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function vg(e){return 1/(1.5+Math.abs(e)/20)}var yg=new Set(`$$slots.$$events.$$legacy.toast.index.expanded.invert.position.visibleToasts.expandByDefault.closeButton.interacting.cancelButtonStyle.actionButtonStyle.duration.descriptionClass.classes.unstyled.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.defaultRichColors.swipeDirections.closeButtonAriaLabel.pauseWhenPageIsHidden`.split(`.`)),bg=O(`<div><!></div>`),xg=O(`<button data-close-button=""><!></button>`),Sg=O(`<div data-icon=""><!> <!></div>`),Cg=O(`<div data-description=""><!></div>`),wg=O(`<button data-button="" data-cancel=""> </button>`),Tg=O(`<button data-button=""> </button>`),Eg=O(`<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>`,1),Dg=O(`<li aria-atomic="true" data-sonner-toast=""><!> <!></li>`);function Og(e,r){c(r,!0);let i=e=>{var i=f(),a=R(i),o=e=>{var i=bg(),a=q(i);n(a,()=>r.loadingIcon),x(i),F(e=>{X(i,1,e),J(i,`data-visible`,t(re)===`loading`)},[()=>T(ho(t(_e)?.loader,r.toast?.classes?.loader,`sonner-loader`))]),k(e,i)},s=e=>{{let n=L(()=>ho(t(_e)?.loader,r.toast.classes?.loader)),i=L(()=>t(re)===`loading`);ig(e,{get class(){return t(n)},get visible(){return t(i)}})}};l(a,e=>{r.loadingIcon?e(o):e(s,-1)}),k(e,i)},a=K(r,`cancelButtonStyle`,3,``),o=K(r,`actionButtonStyle`,3,``),s=K(r,`descriptionClass`,3,``),u=K(r,`unstyled`,3,!1),d=K(r,`defaultRichColors`,3,!1);V(r,yg);let p={...gg},_=Y(!1),v=Y(!1),y=Y(!1),b=Y(!1),S=Y(!1),C=Y(0),E=Y(0),O=r.toast.duration||r.duration||dg,A=Y(void 0),j=Y(null),N=Y(null),ee=L(()=>r.index===0),ne=L(()=>r.index+1<=r.visibleToasts),re=L(()=>r.toast.type),ie=L(()=>r.toast.dismissible===void 0?r.toast.dismissable!==!1:r.toast.dismissible!==!1),ae=L(()=>r.toast.class||``),oe=L(()=>r.toast.descriptionClass||``),se=L(()=>vo.heights.findIndex(e=>e.toastId===r.toast.id)||0),ce=L(()=>r.toast.closeButton??r.closeButton),U=L(()=>r.toast.duration??r.duration??dg),ue=null,de=L(()=>r.position.split(`-`)),fe=L(()=>vo.heights.reduce((e,n,r)=>r>=t(se)?e:e+n.height,0)),pe=ug(),he=L(()=>r.toast.invert||r.invert),ge=L(()=>t(re)===`loading`),_e=L(()=>({...p,...r.classes})),ve=L(()=>r.toast.title),Z=L(()=>r.toast.description),ye=Y(0),be=Y(0),xe=L(()=>Math.round(t(se)*fg+t(fe)));W(()=>{t(ve),t(Z);let e;e=r.expanded||r.expandByDefault?1:1-r.index*hg;let n=me(()=>t(A));if(n===void 0)return;n.style.setProperty(`height`,`auto`);let i=n.offsetHeight,a=n.getBoundingClientRect().height,o=Math.round(a/e+2**-52&100)/100;n.style.removeProperty(`height`);let s;s=Math.abs(o-i)<1?o:i,B(E,s,!0),vo.setHeight({toastId:r.toast.id,height:s})});function Se(){B(v,!0),B(C,t(xe),!0),vo.removeHeight(r.toast.id),setTimeout(()=>{vo.remove(r.toast.id)},mg)}let Ce,we=L(()=>r.toast.promise&&t(re)===`loading`||r.toast.duration===1/0);function Te(){B(ye,new Date().getTime(),!0),Ce=setTimeout(()=>{r.toast.onAutoClose?.(r.toast),Se()},O)}function Ee(){if(t(be)<t(ye)){let e=new Date().getTime()-t(ye);O-=e}B(be,new Date().getTime(),!0)}W(()=>{r.toast.updated&&(clearTimeout(Ce),O=t(U),t(we)||Te())}),W(()=>(t(we)||(r.expanded||r.interacting||r.pauseWhenPageIsHidden&&pe.current?Ee():Te()),()=>clearTimeout(Ce))),le(()=>{B(_,!0);let e=t(A)?.getBoundingClientRect().height;return B(E,e,!0),vo.setHeight({toastId:r.toast.id,height:e}),()=>{vo.removeHeight(r.toast.id)}}),W(()=>{r.toast.delete&&me(()=>{Se(),r.toast.onDismiss?.(r.toast)})});let De=e=>{if(t(ge))return;B(C,t(xe),!0);let n=e.target;n.setPointerCapture(e.pointerId),n.tagName!==`BUTTON`&&(B(y,!0),ue={x:e.clientX,y:e.clientY})},Oe=()=>{if(t(b)||!t(ie))return;ue=null;let e=Number(t(A)?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),n=Number(t(A)?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),i=new Date().getTime()-0,a=t(j)===`x`?e:n,o=Math.abs(a)/i;Math.abs(a)>=pg||o>.11?(B(C,t(xe),!0),r.toast.onDismiss?.(r.toast),t(j)===`x`?B(N,e>0?`right`:`left`,!0):B(N,n>0?`down`:`up`,!0),Se(),B(b,!0)):(t(A)?.style.setProperty(`--swipe-amount-x`,`0px`),t(A)?.style.setProperty(`--swipe-amount-y`,`0px`),B(S,!1),B(y,!1),B(j,null))},ke=e=>{if(!ue||!t(ie)||(window.getSelection()?.toString().length??-1)>0)return;let n=e.clientY-ue.y,i=e.clientX-ue.x,a=r.swipeDirections??_g(r.position);!t(j)&&(Math.abs(i)>1||Math.abs(n)>1)&&B(j,Math.abs(i)>Math.abs(n)?`x`:`y`,!0);let o={x:0,y:0};if(t(j)===`y`){if(a.includes(`top`)||a.includes(`bottom`)){if(a.includes(`top`)&&n<0||a.includes(`bottom`)&&n>0)o.y=n;else{let e=n*vg(n);o.y=Math.abs(e)<Math.abs(n)?e:n}}}else if(t(j)===`x`&&(a.includes(`left`)||a.includes(`right`))){if(a.includes(`left`)&&i<0||a.includes(`right`)&&i>0)o.x=i;else{let e=i*vg(i);o.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(o.x)>0||Math.abs(o.y)>0)&&B(S,!0),t(A)?.style.setProperty(`--swipe-amount-x`,`${o.x}px`),t(A)?.style.setProperty(`--swipe-amount-y`,`${o.y}px`)},Ae=()=>{B(y,!1),B(j,null),ue=null},je=L(()=>r.toast.icon?r.toast.icon:t(re)===`success`?r.successIcon:t(re)===`error`?r.errorIcon:t(re)===`warning`?r.warningIcon:t(re)===`info`?r.infoIcon:t(re)===`loading`?r.loadingIcon:null);var Me=Dg();J(Me,`tabindex`,0);let Ne;var Pe=q(Me),Fe=e=>{var i=xg(),a=q(i);n(a,()=>r.closeIcon??m),x(i),F(e=>{J(i,`aria-label`,r.closeButtonAriaLabel),J(i,`data-disabled`,t(ge)),X(i,1,e)},[()=>T(ho(t(_e)?.closeButton,r.toast?.classes?.closeButton))]),h(`click`,i,()=>{!t(ge)&&t(ie)&&(Se(),r.toast.onDismiss?.(r.toast))}),k(e,i)};l(Pe,e=>{t(ce)&&!r.toast.component&&t(re)!==`loading`&&r.closeIcon!==null&&e(Fe)});var Ie=G(Pe,2),Le=e=>{let n=L(()=>r.toast.component);var i=f(),a=R(i);H(a,()=>t(n),(e,t)=>{t(e,P(()=>r.toast.componentProps,{closeToast:Se}))}),k(e,i)},Re=e=>{var c=Eg(),u=R(c),d=e=>{var a=Sg(),o=q(a),s=e=>{var t=f(),n=R(t),a=e=>{var t=f(),n=R(t);H(n,()=>r.toast.icon,(e,t)=>{t(e,{})}),k(e,t)},o=e=>{i(e)};l(n,e=>{r.toast.icon?e(a):e(o,-1)}),k(e,t)};l(o,e=>{(r.toast.promise||t(re)===`loading`)&&e(s)});var c=G(o,2),u=e=>{var i=f(),a=R(i),o=e=>{var t=f(),n=R(t);H(n,()=>r.toast.icon,(e,t)=>{t(e,{})}),k(e,t)},s=e=>{var t=f(),i=R(t);n(i,()=>r.successIcon??m),k(e,t)},c=e=>{var t=f(),i=R(t);n(i,()=>r.errorIcon??m),k(e,t)},u=e=>{var t=f(),i=R(t);n(i,()=>r.warningIcon??m),k(e,t)},d=e=>{var t=f(),i=R(t);n(i,()=>r.infoIcon??m),k(e,t)};l(a,e=>{r.toast.icon?e(o):t(re)===`success`?e(s,1):t(re)===`error`?e(c,2):t(re)===`warning`?e(u,3):t(re)===`info`&&e(d,4)}),k(e,i)};l(c,e=>{r.toast.type!==`loading`&&e(u)}),x(a),F(e=>X(a,1,e),[()=>T(ho(t(_e)?.icon,r.toast?.classes?.icon))]),k(e,a)};l(u,e=>{(t(re)||r.toast.icon||r.toast.promise)&&r.toast.icon!==null&&(t(je)!==null||r.toast.icon)&&e(d)});var p=G(u,2),_=q(p),v=q(_),y=e=>{var n=f(),i=R(n),a=e=>{let n=L(()=>r.toast.title);var i=f(),a=R(i);H(a,()=>t(n),(e,t)=>{t(e,P(()=>r.toast.componentProps))}),k(e,i)},o=e=>{var t=g();F(()=>w(t,r.toast.title)),k(e,t)};l(i,e=>{typeof r.toast.title==`string`?e(o,-1):e(a)}),k(e,n)};l(v,e=>{r.toast.title&&e(y)}),x(_);var b=G(_,2),S=e=>{var n=Cg(),i=q(n),a=e=>{let n=L(()=>r.toast.description);var i=f(),a=R(i);H(a,()=>t(n),(e,t)=>{t(e,P(()=>r.toast.componentProps))}),k(e,i)},o=e=>{var t=g();F(()=>w(t,r.toast.description)),k(e,t)};l(i,e=>{typeof r.toast.description==`string`?e(o,-1):e(a)}),x(n),F(e=>X(n,1,e),[()=>T(ho(s(),t(oe),t(_e)?.description,r.toast.classes?.description))]),k(e,n)};l(b,e=>{r.toast.description&&e(S)}),x(p);var C=G(p,2),E=e=>{var n=f(),i=R(n),o=e=>{var t=f(),n=R(t);H(n,()=>r.toast.cancel,(e,t)=>{t(e,{})}),k(e,t)},s=e=>{var n=wg(),i=z(n,!0);F(e=>{I(n,r.toast.cancelButtonStyle??a()),X(n,1,e),w(i,r.toast.cancel.label)},[()=>T(ho(t(_e)?.cancelButton,r.toast?.classes?.cancelButton))]),h(`click`,n,e=>{lg(r.toast.cancel)&&t(ie)&&(r.toast.cancel?.onClick?.(e),Se())}),k(e,n)},c=L(()=>lg(r.toast.cancel));l(i,e=>{typeof r.toast.cancel==`function`?e(o):t(c)&&e(s,1)}),k(e,n)};l(C,e=>{r.toast.cancel&&e(E)});var D=G(C,2),O=e=>{var n=f(),i=R(n),a=e=>{var t=f(),n=R(t);H(n,()=>r.toast.action,(e,t)=>{t(e,{})}),k(e,t)},s=e=>{var n=Tg(),i=z(n,!0);F(e=>{I(n,r.toast.actionButtonStyle??o()),X(n,1,e),w(i,r.toast.action.label)},[()=>T(ho(t(_e)?.actionButton,r.toast?.classes?.actionButton))]),h(`click`,n,e=>{lg(r.toast.action)&&(r.toast.action?.onClick(e),e.defaultPrevented||Se())}),k(e,n)},c=L(()=>lg(r.toast.action));l(i,e=>{typeof r.toast.action==`function`?e(a):t(c)&&e(s,1)}),k(e,n)};l(D,e=>{r.toast.action&&e(O)}),F((e,t)=>{X(p,1,e),X(_,1,t)},[()=>T(ho(t(_e)?.content,r.toast?.classes?.content)),()=>T(ho(t(_e)?.title,r.toast?.classes?.title))]),k(e,c)};l(Ie,e=>{r.toast.component?e(Le):e(Re,-1)}),x(Me),te(Me,e=>B(A,e),()=>t(A)),F((e,n,i)=>{X(Me,1,e),J(Me,`aria-live`,r.toast.important?`assertive`:`polite`),J(Me,`data-rich-colors`,r.toast.richColors??d()),J(Me,`data-styled`,!(r.toast.component||r.toast.unstyled||u())),J(Me,`data-mounted`,t(_)),J(Me,`data-promise`,n),J(Me,`data-swiped`,t(S)),J(Me,`data-removed`,t(v)),J(Me,`data-visible`,t(ne)),J(Me,`data-y-position`,t(de)[0]),J(Me,`data-x-position`,t(de)[1]),J(Me,`data-index`,r.index),J(Me,`data-front`,t(ee)),J(Me,`data-swiping`,t(y)),J(Me,`data-dismissible`,t(ie)),J(Me,`data-type`,t(re)),J(Me,`data-invert`,t(he)),J(Me,`data-swipe-out`,t(b)),J(Me,`data-swipe-direction`,t(N)),J(Me,`data-expanded`,i),Ne=I(Me,`${r.style} ${r.toast.style}`,Ne,{"--index":r.index,"--toasts-before":r.index,"--z-index":vo.toasts.length-r.index,"--offset":`${t(v)?t(C):t(xe)}px`,"--initial-height":r.expandByDefault?`auto`:`${t(E)}px`})},[()=>T(ho(r.class,t(ae),t(_e)?.toast,r.toast?.classes?.toast,t(_e)?.[t(re)],r.toast?.classes?.[t(re)])),()=>!!r.toast.promise,()=>!!(r.expanded||r.expandByDefault&&t(_))]),h(`pointermove`,Me,ke),h(`pointerup`,Me,Oe),h(`pointerdown`,Me,De),M(`dragend`,Me,Ae),k(e,Me),D()}ue([`pointermove`,`pointerup`,`pointerdown`,`click`]);var kg=A(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>`);function Ag(e){var t=kg();k(e,t)}var jg=A(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`);function Mg(e){var t=jg();k(e,t)}var Ng=A(`<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>`);function Pg(e){var t=Ng();k(e,t)}var Fg=A(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>`);function Ig(e){var t=Fg();k(e,t)}var Lg=A(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`);function Rg(e){var t=Lg();k(e,t)}var zg=3,Bg=`24px`,Vg=`16px`,Hg=4e3,Ug=356,Wg=14,Gg=`dark`,Kg=`light`;function qg(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Vg:Bg;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{let r=e[t];r===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof r==`number`?`${r}px`:r}):o(a)}),n}var Jg=new Set(`$$slots.$$events.$$legacy.invert.position.hotkey.expand.closeButton.offset.mobileOffset.theme.richColors.duration.visibleToasts.toastOptions.dir.gap.pauseWhenPageIsHidden.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.containerAriaLabel.class.closeButtonAriaLabel.onblur.onfocus.onmouseenter.onmousemove.onmouseleave.ondragend.onpointerdown.onpointerup`.split(`.`)),Yg=O(`<ol></ol>`),Xg=O(`<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-1jub1tm"><!></section>`);function Zg(e,r){c(r,!0);function i(e){return e===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?Gg:Kg:e}let a=K(r,`invert`,3,!1),o=K(r,`position`,3,`bottom-right`),s=K(r,`hotkey`,19,()=>[`altKey`,`KeyT`]),u=K(r,`expand`,3,!1),d=K(r,`closeButton`,3,!1),p=K(r,`offset`,3,Bg),h=K(r,`mobileOffset`,3,Vg),g=K(r,`theme`,3,`light`),_=K(r,`richColors`,3,!1),y=K(r,`duration`,3,Hg),b=K(r,`visibleToasts`,3,zg),S=K(r,`toastOptions`,19,()=>({})),C=K(r,`dir`,7,`auto`),w=K(r,`gap`,3,Wg),T=K(r,`pauseWhenPageIsHidden`,3,!1),E=K(r,`containerAriaLabel`,3,`Notifications`),O=K(r,`closeButtonAriaLabel`,3,`Close toast`),A=V(r,Jg);function M(){if(C()!==`auto`)return C();if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?(me(()=>C(window.getComputedStyle(document.documentElement).direction??`ltr`)),C()):(me(()=>C(e)),e)}let N=L(()=>Array.from(new Set([o(),...vo.toasts.filter(e=>e.position).map(e=>e.position)].filter(Boolean)))),P=Y(!1),I=Y(!1),ee=Y(U(i(g()))),ne=Y(void 0),re=Y(null),z=Y(!1),oe=L(()=>s().join(`+`).replace(/Key/g,``).replace(/Digit/g,``));W(()=>{vo.toasts.length<=1&&B(P,!1)}),W(()=>{let e=vo.toasts.filter(e=>e.dismiss&&!e.delete);if(e.length>0){let t=vo.toasts.map(t=>e.find(e=>e.id===t.id)?{...t,delete:!0}:t);vo.toasts=t}}),W(()=>()=>{t(ne)&&t(re)&&(t(re).focus({preventScroll:!0}),B(re,null),B(z,!1))}),le(()=>(vo.reset(),j(document,`keydown`,e=>{s().every(t=>e[t]||e.code===t)&&(B(P,!0),t(ne)?.focus()),e.code===`Escape`&&(document.activeElement===t(ne)||t(ne)?.contains(document.activeElement))&&B(P,!1)}))),W(()=>{if(g()!==`system`&&B(ee,g()),typeof window<`u`){g()===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?B(ee,Gg):B(ee,Kg));let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=({matches:e})=>{g()===`system`&&B(ee,e?Gg:Kg,!0)};`addEventListener`in e?e.addEventListener(`change`,t):e.addListener(t)}});let se=e=>{r.onblur?.(e),t(z)&&!e.currentTarget.contains(e.relatedTarget)&&(B(z,!1),t(re)&&(t(re).focus({preventScroll:!0}),B(re,null)))},H=e=>{r.onfocus?.(e),e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||t(z)||(B(z,!0),B(re,e.relatedTarget,!0))},ce=e=>{r.onpointerdown?.(e),e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||B(I,!0)},G=e=>{r.onmouseenter?.(e),B(P,!0)},ue=e=>{r.onmouseleave?.(e),t(I)||B(P,!1)},de=e=>{r.onmousemove?.(e),B(P,!0)},fe=e=>{r.ondragend?.(e),B(P,!1)},pe=e=>{r.onpointerup?.(e),B(I,!1)};cg.set(new bo);var he=Xg();J(he,`tabindex`,-1);var ge=q(he),_e=e=>{var i=f(),o=R(i);v(o,18,()=>t(N),e=>e,(e,i,o,s)=>{let c=L(()=>{let[e,t]=i.split(`-`);return{y:e,x:t}}),g=L(()=>qg(p(),h()));var C=Yg();ie(C,e=>({tabindex:-1,dir:e,class:r.class,"data-sonner-toaster":!0,"data-sonner-theme":t(ee),"data-y-position":t(c).y,"data-x-position":t(c).x,style:r.style,onblur:se,onfocus:H,onmouseenter:G,onmousemove:de,onmouseleave:ue,ondragend:fe,onpointerdown:ce,onpointerup:pe,...A,[ae]:{"--front-toast-height":`${vo.heights[0]?.height}px`,"--width":`${Ug}px`,"--gap":`${w()}px`,"--offset-top":t(g)[`--offset-top`],"--offset-right":t(g)[`--offset-right`],"--offset-bottom":t(g)[`--offset-bottom`],"--offset-left":t(g)[`--offset-left`],"--mobile-offset-top":t(g)[`--mobile-offset-top`],"--mobile-offset-right":t(g)[`--mobile-offset-right`],"--mobile-offset-bottom":t(g)[`--mobile-offset-bottom`],"--mobile-offset-left":t(g)[`--mobile-offset-left`]}}),[()=>M()],void 0,void 0,`svelte-1jub1tm`),v(C,23,()=>vo.toasts.filter(e=>!e.position&&t(o)===0||e.position===i),e=>e.id,(e,o,s,c)=>{{let c=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.successIcon??m),k(e,t)},o=e=>{Ag(e,{})};l(i,e=>{r.successIcon?e(a):r.successIcon!==null&&e(o,1)}),k(e,t)},p=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.errorIcon??m),k(e,t)},o=e=>{Mg(e,{})};l(i,e=>{r.errorIcon?e(a):r.errorIcon!==null&&e(o,1)}),k(e,t)},h=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.warningIcon??m),k(e,t)},o=e=>{Pg(e,{})};l(i,e=>{r.warningIcon?e(a):r.warningIcon!==null&&e(o,1)}),k(e,t)},g=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.infoIcon??m),k(e,t)},o=e=>{Ig(e,{})};l(i,e=>{r.infoIcon?e(a):r.infoIcon!==null&&e(o,1)}),k(e,t)},v=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.closeIcon??m),k(e,t)},o=e=>{Rg(e,{})};l(i,e=>{r.closeIcon?e(a):r.closeIcon!==null&&e(o,1)}),k(e,t)},x=L(()=>S()?.duration??y()),C=L(()=>S()?.class??``),w=L(()=>S()?.descriptionClass||``),E=L(()=>S()?.style??``),D=L(()=>S().classes||{}),A=L(()=>S().unstyled??!1),j=L(()=>S()?.cancelButtonStyle??``),M=L(()=>S()?.actionButtonStyle??``),N=L(()=>S()?.closeButtonAriaLabel??O());Og(e,{get index(){return t(s)},get toast(){return t(o)},get defaultRichColors(){return _()},get duration(){return t(x)},get class(){return t(C)},get descriptionClass(){return t(w)},get invert(){return a()},get visibleToasts(){return b()},get closeButton(){return d()},get interacting(){return t(I)},get position(){return i},get style(){return t(E)},get classes(){return t(D)},get unstyled(){return t(A)},get cancelButtonStyle(){return t(j)},get actionButtonStyle(){return t(M)},get closeButtonAriaLabel(){return t(N)},get expandByDefault(){return u()},get expanded(){return t(P)},get pauseWhenPageIsHidden(){return T()},get loadingIcon(){return r.loadingIcon},successIcon:c,errorIcon:p,warningIcon:h,infoIcon:g,closeIcon:v,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),x(C),te(C,e=>B(ne,e),()=>t(ne)),F(()=>C.dir=C.dir),k(e,C)}),k(e,i)};l(ge,e=>{vo.toasts.length>0&&e(_e)}),x(he),F(()=>J(he,`aria-label`,`${E()??``} ${t(oe)??``}`)),k(e,he),D()}var Qg=e=>e.status===`running`||e.status===`waiting`||e.pendingWork;function $g(e,t){let n=[];return t.pendingInput&&e.pendingInput?.toolCallId!==t.pendingInput.toolCallId&&n.push({kind:`input`,inputKind:t.pendingInput.kind}),Qg(e)&&t.status===`idle`&&!t.pendingWork&&!t.pendingInput&&n.push({kind:`finished`}),t.status===`failed`&&e.status!==`failed`&&n.push({kind:`failed`}),t.status===`interrupted`&&e.status!==`interrupted`&&n.push({kind:`interrupted`}),n}function e_(e){return e===`input`?2:e===`finished`?0:1}function t_(e){let t;for(let n of e)(!t||e_(n.kind)>e_(t.kind))&&(t=n);return t}var n_=class{suppressed;#e=new Map;constructor(e=()=>!1){this.suppressed=e}seed(e){this.reset();for(let t of e)t.parentConversationId===null&&this.#e.set(t.id,t)}reset(){this.#e.clear()}forget(e){this.#e.delete(e)}observe(e){if(e.parentConversationId!==null)return;let t=this.#e.get(e.id);if(this.#e.set(e.id,e),!t)return;let n=t_($g(t,e));if(n&&(n.kind!==`finished`&&n.kind!==`interrupted`||!this.suppressed(e.id,n)))return n}},r_=[`completed`,`denied`,`failed`,`cancelled`];function i_(e){return r_.includes(e)}function a_(e){switch(e.split(`;`)[0]?.trim().toLowerCase()){case`audio/wav`:case`audio/wave`:case`audio/x-wav`:return`wav`;case`audio/mp4`:case`audio/m4a`:case`audio/x-m4a`:return`mp4`;case`audio/mpeg`:case`audio/mp3`:case`audio/x-mpeg`:return`mp3`;case`audio/mpga`:return`mpga`;case`audio/flac`:case`audio/x-flac`:return`flac`;case`audio/ogg`:case`audio/oga`:return`ogg`;default:return`webm`}}async function o_(e){if(!e.ok){let t=await e.text().catch(()=>``),n=at(t);throw new ot(e.status,n.code,n.message||t||e.statusText||`Transcription failed.`)}let t=e.headers.get(`content-type`)??``;if(!t.includes(`application/json`)){let n=await e.text();throw new ot(e.status,void 0,`Expected JSON response from transcription API, received ${t||`unknown content type`}. ${n.slice(0,80)}`)}return await e.json()}async function s_(e,t,n={}){let r=new FormData;return r.append(`file`,e,`composer-recording.${a_(e.type)}`),r.append(`durationMs`,String(Math.max(1,Math.round(t)))),(await o_(await fetch(`/api/transcription/audio`,{method:`POST`,credentials:`same-origin`,body:r,signal:n.signal}))).text}async function c_(){return it(`/api/client-config`)}var l_=1500;function u_(e,t=l_,n={set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)}){let r=0,i=!1,a;function o(){a!==void 0&&n.clear(a),a=n.set(s,t)}function s(){a!==void 0&&n.clear(a),a=void 0,r=0,i&&(i=!1,e(!1))}return{enter(){r+=1,o(),i||(i=!0,e(!0))},leave(){i&&(r=Math.max(0,r-1),r===0&&s())},over(){i&&o()},reset:s,get active(){return i},dispose:s}}var d_=/^[A-Za-z]:[\\/]?$/,f_=/^\\\\[^\\]+\\[^\\]+\\?$/;function p_(e,t){return t.caseInsensitive||t.platform===`win32`?e.toLowerCase():e}function m_(e,t){return t.platform===`win32`?d_.test(e)||f_.test(e):e===`/`}function h_(e,t,n){return e.endsWith(n)?`${e}${t}`:`${e}${n}${t}`}function g_(e,t){return e.length<=1||m_(e,t)?e:e.replace(/[\\/]+$/,``)||e}function __(e,t){if(e===``)return;if(m_(e,t))return t.platform===`win32`?``:void 0;let n=g_(e,t),r=n.lastIndexOf(t.separator);if(r<0)return;let i=n.slice(0,r);return t.platform===`win32`&&/^[A-Za-z]:$/.test(i)?`${i}\\`:i||t.separator}function v_(e,t){let n=g_(t.home,t);if(!n)return;let r=p_(e,t),i=p_(n,t);if(r===i)return``;if(r.startsWith(i+t.separator))return e.slice(n.length)}function y_(e,t){if(e===``)return`This PC`;let n=v_(e,t);return n===void 0?e:`~${n}`}function b_(e,t){let n=e.trim().replace(/^["']|["']$/g,``);if(!n)return``;if((n===`~`||n.startsWith(`~/`)||n.startsWith(`~\\`))&&(n=g_(t.home,t)+n.slice(1)),t.platform===`win32`){let e=n.startsWith(`\\\\`)||n.startsWith(`//`);n=n.replace(/\//g,`\\`),e&&(n=`\\\\${n.replace(/^\\+/,``)}`),/^[A-Za-z]:$/.test(n)&&(n=`${n}\\`)}return n}function x_(e,t){let n=b_(e,t);return n?g_(n,t):``}function S_(e,t){let n=b_(e===`~`?`~${t.separator}`:e,t),r=Math.max(t.platform===`win32`?n.lastIndexOf(`\\`):-1,n.lastIndexOf(`/`));if(r<0)return;let i=n.slice(r+1),a=g_(n.slice(0,r+1),t);if(a)return{dir:a,prefix:i}}function C_(e,t,n=`/`){let r=[],i,a,o=v_(e,t);if(e===``)return[{label:`This PC`,path:``}];if(o!==void 0)i=g_(t.home,t),r.push({label:`~`,path:i}),a=o;else if(t.platform===`win32`){let t=e.match(/^(\\\\[^\\]+\\[^\\]+)/);if(t?.[1])i=t[1],r.push({label:i,path:i}),a=e.slice(i.length);else{r.push({label:`This PC`,path:``});let t=e.slice(0,2);i=`${t}\\`,r.push({label:t,path:i}),a=e.slice(3)}}else i=`/`,r.push({label:n,path:`/`}),a=e;for(let e of a.split(t.separator).filter(Boolean))i=h_(i,e,t.separator),r.push({label:e,path:i});return r}function w_(e,t,n=6){let r=new Map;for(let n of e){let e=__(n,t);if(!e)continue;let i=p_(e,t),a=r.get(i);a?a.count+=1:r.set(i,{path:e,count:1})}return[...r.values()].sort((e,t)=>t.count-e.count||e.path.localeCompare(t.path)).slice(0,n).map(e=>e.path)}function T_(e,t,n){let r=e,i=t,a=!1;if(n)for(let e of Object.keys(r))e in i||(delete r[e],a=!0);for(let[e,t]of Object.entries(i))E_(r[e],t)||(r[e]=t,a=!0);return a}function E_(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,a=t;return n.every(e=>e in a&&E_(i[e],a[e]))}var D_=new Map;function O_(e){let t=new Map,n=e.filter(e=>e.parentConversationId===null).map(e=>{let n=D_.get(e.id),r=n&&E_(n.source,e)?n:{source:{...e},row:{...e,pinned:e.pinnedAt!==null,activeAgentId:e.id,permissionRuleSetId:e.permissionRuleSetId}};return t.set(e.id,r),r.row});D_.clear();for(let[e,n]of t)D_.set(e,n);return n}function k_(e){return`settings-section-${e}`}var A_=O(`<div class="grid gap-0.5 @max-[46rem]/settings-page:flex @max-[46rem]/settings-page:flex-none"><!> <!></div>`),j_=O(`<nav class="-ml-1 grid min-h-0 flex-1 content-start gap-3 overflow-y-auto pt-0 pr-3 pb-1 pl-1 @max-[46rem]/settings-page:mr-0 @max-[46rem]/settings-page:flex @max-[46rem]/settings-page:gap-1 @max-[46rem]/settings-page:overflow-x-auto @max-[46rem]/settings-page:pr-0 @max-[46rem]/settings-page:pt-0"></nav>`);function M_(e,n){c(n,!0);let r=K(n,`ariaLabel`,3,`Settings pages`);var i=j_();v(i,21,()=>n.groups,e=>e.id,(e,r)=>{var i=A_(),a=q(i),o=e=>{Rn(e,{class:`px-2 pb-0.5 @max-[46rem]/settings-page:hidden`,get label(){return t(r).title}})};l(a,e=>{t(r).title&&e(o)});var s=G(a,2);v(s,17,()=>t(r).items,e=>e.id,(e,r)=>{let i=e=>{var n=f(),r=R(n);H(r,()=>t(o),(e,t)=>{t(e,{class:`size-4 flex-none`,"aria-hidden":`true`})}),k(e,n)},a=e=>{var n=f(),i=R(n),a=e=>{be(e,{get variant(){return t(r).badge.tone},class:`h-4 min-w-4 justify-center rounded-full bg-warning px-1 text-caption leading-none font-semibold text-warning-foreground`,children:(e,n)=>{y();var i=g();F(()=>w(i,t(r).badge.text)),k(e,i)},$$slots:{default:!0}})};l(i,e=>{t(r).badge&&e(a)}),k(e,n)},o=L(()=>t(r).icon),s=L(()=>n.activeId===t(r).id);{let o=L(()=>t(r).badge?a:void 0),c=L(()=>t(s)?`page`:!1);Kc(e,{get label(){return t(r).label},get icon(){return i},get trailing(){return t(o)},get selected(){return t(s)},get current(){return t(c)},get disabled(){return t(r).disabled},class:`px-2 @max-[46rem]/settings-page:w-auto @max-[46rem]/settings-page:flex-none`,onclick:()=>n.onSelect(t(r).id)})}}),x(i),k(e,i)}),x(i),F(()=>J(i,`aria-label`,r())),k(e,i),D()}function N_(e){let t=e?.sections??[];return(t.find(e=>!e.disabled)??t[0])?.id??``}function P_(e,t,n){let r=0,i,a=[];return r=requestAnimationFrame(()=>{i=new IntersectionObserver(e=>{for(let t of e){let e=t.target.getAttribute(`data-settings-section`);e&&(t.isIntersecting?a.includes(e)||(a=[...a,e]):a=a.filter(t=>t!==e))}let r=t.find(e=>a.includes(e.id));r&&n(r.id)},{root:e,rootMargin:`0px 0px -60% 0px`,threshold:0});for(let n of t){let t=e.querySelector(`#${CSS.escape(k_(n.id))}`);t&&(t.setAttribute(`data-settings-section`,n.id),i.observe(t))}}),()=>{cancelAnimationFrame(r),i?.disconnect()}}var F_=O(`<div class="flex-none pr-3 @max-[46rem]/settings-page:pr-0"><!></div>`),I_=O(`<!> <div class="grid min-w-0 gap-5"><!></div>`,1),L_=O(`<div><!></div>`),R_=O(`<section><div class="settings-page svelte-1vzwxx9"><aside class="settings-sidebar flex flex-col gap-3 overflow-hidden svelte-1vzwxx9"><!> <!></aside> <!></div></section>`);function z_(e,r){c(r,!0);let i=K(r,`activePageId`,31,()=>U(r.pages[0]?.id??``)),a=K(r,`activeSectionId`,31,()=>U(N_(r.pages[0]))),o=K(r,`activeItemId`,15,``),s=K(r,`ariaLabel`,3,`Settings pages`),u=K(r,`showHeader`,3,!0),d=Y(null),p=L(()=>r.pages.find(e=>e.id===i())??r.pages[0]),m=L(()=>t(p)?.sections??[]),g=L(()=>t(p)?.detail?.items),_=L(()=>o()&&t(p)?.detail?t(g)?.find(e=>e.id===o()):void 0),v=L(()=>!!o()&&!!t(p)?.detail&&(!t(g)||!!t(_)));W(()=>{if(!o()||!t(p)||t(v)||t(p).detail&&!t(g))return;let e=o();o(``),t(p).detail&&r.onUnknownItem?.(e,t(p))});let y=0;W(()=>{let e=t(d);if(!e||t(v))return;let n=()=>{y=e.scrollTop};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)});let b=!1;W(()=>{let e=t(v);if(e===b)return;b=e;let n=t(d);if(!n)return;let r=e?0:y,i=e?a():``;ne().then(()=>{let e=i?n.querySelector(`#${CSS.escape(k_(i))}`):null;e?e.scrollIntoView({block:`start`,behavior:`instant`}):n.scrollTo({top:r,behavior:`instant`})})});function S(){o(``)}function C(e){e.key===`Escape`&&!e.defaultPrevented&&t(v)&&(e.preventDefault(),S())}let w=Y(null);function E(e){if(e.key!==`Escape`||e.defaultPrevented||!t(v))return;let n=e.target;n!==document.body&&n!==document.documentElement||!t(w)||t(w).getClientRects().length===0||document.querySelector(`[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [data-popover-content], [data-select-content]`)||(e.preventDefault(),S())}W(()=>{r.pages.length===0||r.pages.some(e=>e.id===i())||(i(r.pages[0].id),o(``),a(N_(r.pages[0])))}),W(()=>{t(v)||t(m).length===0||t(m).some(e=>e.id===a())||a(N_(t(p)))}),W(()=>{let e=t(d),n=t(m);if(!(t(v)||!e||n.length<2))return P_(e,n,e=>{e!==a()&&a(e)})});function O(e){let n=r.pages.find(t=>t.id===e);n&&(n.id===i()?o()&&S():(i(n.id),o(``),a(N_(n)),r.onPageChange?.(n.id),ne().then(()=>t(d)?.scrollTo({top:0}))))}var A=R_();M(`keydown`,ce,E);var j=q(A),N=q(j),P=q(N);M_(P,{get groups(){return r.groups},get ariaLabel(){return s()},get activeId(){return i()},onSelect:O});var I=G(P,2),ee=e=>{var t=F_(),i=q(t);n(i,()=>r.sidebarFooter),x(t),k(e,t)};l(I,e=>{r.sidebarFooter&&e(ee)}),x(N);var re=G(N,2);fn(re,{class:`settings-scroll`,viewportClass:`settings-viewport`,get viewportRef(){return t(d)},set viewportRef(e){B(d,e,!0)},children:(e,i)=>{var a=L_(),s=q(a),c=e=>{var i=I_(),a=R(i),s=e=>{sh(e,{get title(){return t(p).label},get description(){return t(p).description},actions:e=>{var i=f(),a=R(i),o=e=>{var i=f(),a=R(i);n(a,()=>r.pageActions,()=>t(p)),k(e,i)};l(a,e=>{r.pageActions&&e(o)}),k(e,i)},$$slots:{actions:!0}})};l(a,e=>{u()&&!t(v)&&e(s)});var c=G(a,2),d=q(c);n(d,()=>r.children,()=>t(p),()=>t(v)?o():``),x(c),k(e,i)};l(s,e=>{t(p)&&e(c)}),x(a),F(e=>{X(a,1,e,`svelte-1vzwxx9`),J(a,`data-tour-id`,t(p)?.id===`skills`?`settings-skills`:void 0)},[()=>T(ft(`settings-main`,r.mainClass))]),k(e,a)},$$slots:{default:!0}}),x(j),x(A),te(A,e=>B(w,e),()=>t(w)),F(e=>{X(A,1,e,`svelte-1vzwxx9`),J(N,`aria-label`,s())},[()=>T(ft(`settings-page-container`,r.class))]),h(`keydown`,A,C),k(e,A),D()}ue([`keydown`]);function B_(e,n){let r=L(()=>`${n.scope===`project`?`Reset to user setting`:`Reset to default`} (${n.from})`);Mn(e,{get icon(){return zn},get label(){return t(r)},class:`-my-1 size-5`,get onclick(){return n.onReset}})}var V_=O(`<div class="col-start-2 col-end-4 pt-0.5"><!></div>`),H_=O(`<div class="grid grid-cols-[6.5rem_minmax(0,1fr)_auto] items-center gap-x-3 px-3 py-1.5"><span class="text-ui text-muted-foreground"> </span> <span class="flex min-w-0 items-center gap-1.5 text-ui text-foreground"><span class="truncate"> </span> <!></span> <span class="flex justify-end gap-0.5"><!> <!></span> <!></div>`);function U_(e,t){let r=K(t,`editLabel`,3,`Edit`),i=K(t,`removeLabel`,3,`Remove`);var a=H_(),o=q(a),s=z(o,!0),c=G(o,2),u=q(c),d=z(u,!0),p=G(u,2),m=e=>{var r=f(),i=R(r);n(i,()=>t.trailing),k(e,r)};l(p,e=>{t.trailing&&e(m)}),x(c);var h=G(c,2),g=q(h),_=e=>{Mn(e,{get icon(){return Dn},get label(){return r()},get onclick(){return t.onEdit}})};l(g,e=>{t.onEdit&&e(_)});var v=G(g,2),y=e=>{Mn(e,{get icon(){return ye},get label(){return i()},get onclick(){return t.onRemove}})};l(v,e=>{t.onRemove&&e(y)}),x(h);var b=G(h,2),S=e=>{var r=V_(),i=q(r);n(i,()=>t.detail),x(r),k(e,r)};l(b,e=>{t.detail&&e(S)}),x(a),F(()=>{w(s,t.label),w(d,t.value)}),k(e,a)}var W_=O(`<div class="settings-sidebar-status grid grid-cols-[auto_minmax(0,1fr)] items-start gap-2 border-t border-t-border-subtle px-1.5 pt-3 pb-0"><!> <p class="text-caption text-muted-foreground"> </p></div>`);function G_(e,n){let r=K(n,`status`,3,`idle`),i={idle:`neutral`,dirty:`info`,saving:`info`,saved:`success`,error:`destructive`},a=L(()=>i[r()??`idle`]??`neutral`);var o=W_(),s=q(o);Bn(s,{get tone(){return t(a)},class:`mt-1`});var c=G(s,2),l=z(c,!0);x(o),F(()=>w(l,n.text)),k(e,o)}var K_=O(`<button><!></button>`),q_=O(`<!> <!>`,1);function J_(e,t){let n=K(t,`label`,3,`More information`);var r=f(),i=R(r);H(i,()=>En,(e,r)=>{r(e,{delayDuration:200,children:(e,r)=>{var i=f(),a=R(i);H(a,()=>wn,(e,r)=>{r(e,{children:(e,r)=>{var i=q_(),a=R(i);{let e=(e,t)=>{let r=()=>(t?.()).props;var i=K_();ie(i,()=>({...r(),type:`button`,"aria-label":n(),class:`inline-flex flex-none cursor-help items-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-focus`}));var a=q(i);Un(a,{class:`size-3.5`,"aria-hidden":`true`}),x(i),k(e,i)};H(a,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Sn,(e,n)=>{n(e,{side:`top`,class:`max-w-xs`,children:(e,n)=>{y();var r=g();F(()=>w(r,t.text)),k(e,r)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,r)}var Y_=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`info`,`layerLabels`,`splitLabels`]);function X_(e,n){c(n,!0);let r=V(n,Y_);{let i=e=>{var r=f(),i=R(r),a=e=>{{let r=L(()=>`About ${n.title}`);J_(e,{get text(){return n.info},get label(){return t(r)}})}};l(i,e=>{n.info&&n.title&&e(a)}),k(e,r)},a=L(()=>n.id?k_(n.id):void 0);gh(e,P(()=>r,{get id(){return t(a)},get labels(){return n.layerLabels},get beforeBody(){return n.splitLabels},titleHint:i,$$slots:{titleHint:!0}}))}D()}var Z_=O(`<div class="w-48 min-w-0 group-data-page-divided/surface:w-full"><!></div>`);function Q_(e,t){let r=K(t,`disabled`,3,!1);xh(e,{get label(){return t.label},get description(){return t.description},get htmlFor(){return t.htmlFor},get class(){return t.class},control:e=>{var i=Z_(),a=q(i);n(a,()=>t.control,r),x(i),k(e,i)},$$slots:{control:!0}})}var $_=O(`<span class="flex-none text-ui text-muted-foreground"> </span>`),ev=O(`<p class="text-caption text-muted-foreground"> </p>`),tv=O(`<div><!> <div class="flex items-center gap-2"><!> <!></div> <!></div>`);function nv(e,t){c(t,!0);let n=K(t,`value`,15,``),r=K(t,`type`,3,`text`),i=K(t,`disabled`,3,!1);var a=tv(),o=q(a);un(o,{get for(){return t.id},class:`text-ui text-muted-foreground`,children:(e,n)=>{y();var r=g();F(()=>w(r,t.label)),k(e,r)},$$slots:{default:!0}});var s=G(o,2),u=q(s);an(u,{get id(){return t.id},get type(){return r()},get placeholder(){return t.placeholder},get min(){return t.min},get max(){return t.max},get step(){return t.step},get disabled(){return i()},oninput:e=>t.onValueChange?.(e.currentTarget.value),get value(){return n()},set value(e){n(e)}});var d=G(u,2),f=e=>{var n=$_(),r=z(n,!0);F(()=>w(r,t.suffix)),k(e,n)};l(d,e=>{t.suffix&&e(f)}),x(s);var p=G(s,2),m=e=>{var n=ev(),r=z(n,!0);F(()=>w(r,t.hint)),k(e,n)};l(p,e=>{t.hint&&e(m)}),x(a),F(e=>X(a,1,e),[()=>T(ft(`grid gap-1`,t.class))]),k(e,a),D()}var rv=O(`<div class="flex items-center gap-2"><!> <!></div>`);function iv(e,n){c(n,!0);let r=K(n,`canRestart`,3,!1),i=K(n,`restarting`,3,!1),a=L(()=>[n.daemon?`Changes saved. Restart the daemon to apply them.`:``,n.desktop?`Restart Nerve to apply desktop changes.`:``].filter(Boolean).join(` `));var o=f(),s=R(o),u=e=>{var o=rv(),s=q(o);nn(s,{layout:`block`,class:`min-w-0 flex-1`,tone:`warning`,get text(){return t(a)}});var c=G(s,2),u=e=>{Q(e,{size:`sm`,get disabled(){return i()},get onclick(){return n.onRestart},children:(e,t)=>{y();var n=g();F(()=>w(n,i()?`Restarting…`:`Restart daemon`)),k(e,n)},$$slots:{default:!0}})};l(c,e=>{n.daemon&&r()&&e(u)}),x(o),k(e,o)};l(s,e=>{(n.daemon||n.desktop)&&e(u)}),k(e,o),D()}function av(e,t){let n=e.application,r=(t??Object.keys(n)).flatMap(e=>Object.values(n[e])),i=e=>r.some(t=>t.pendingRestart&&t.restartTarget===e);return{daemon:i(`daemon`),desktop:i(`desktop`)}}var ov=O(`<span class="w-1.5 flex-none rounded-sm bg-panel"></span> <span class="grid min-w-0 flex-1 content-start gap-1"><span class="h-1 w-full rounded-full bg-foreground/30"></span> <span class="h-1 w-2/3 rounded-full bg-foreground/30"></span></span>`,1),sv=O(`<span class="size-3.5 flex-none rounded-full border border-border-subtle"></span>`),cv=O(`<button type="button" role="radio"><span class="flex h-12 overflow-hidden rounded-sm border border-border-subtle" aria-hidden="true"><span><!></span></span> <span class="flex min-w-0 items-center gap-1.5"><!> <!> <span class="truncate text-ui"> </span></span></button>`),lv=O(`<div role="radiogroup"></div>`);function uv(e,r){c(r,!0);let i=K(r,`value`,15,``),a=U([]),o=L(()=>r.options.findIndex(e=>e.value===i()));function s(e){i(e),r.onValueChange?.(e)}function u(e,t){let n=r.options.length-1,i=e.key===`ArrowRight`||e.key===`ArrowDown`?t===n?0:t+1:e.key===`ArrowLeft`||e.key===`ArrowUp`?t===0?n:t-1:e.key===`Home`?0:e.key===`End`?n:void 0;i!==void 0&&(e.preventDefault(),s(r.options[i].value),a[i]?.focus())}var d=lv();v(d,23,()=>r.options,e=>e.value,(e,c,d)=>{let p=L(()=>i()===t(c).value),m=L(()=>t(c).icon);var g=cv(),_=q(g),v=q(_);ie(v,e=>({...e,class:`flex min-w-0 flex-1 gap-1 bg-background p-1`}),[()=>r.previewAttrs?.(t(c))??{}]);var b=q(v),S=e=>{var t=f(),i=R(t);n(i,()=>r.previewBody),k(e,t)},C=e=>{var t=ov();y(2),k(e,t)};l(b,e=>{r.previewBody?e(S):e(C,-1)}),x(v),x(_);var E=G(_,2),D=q(E),O=e=>{Wn(e,{class:`size-3.5 flex-none text-foreground`,"aria-hidden":`true`})},A=e=>{var t=sv();k(e,t)};l(D,e=>{t(p)?e(O):e(A,-1)});var j=G(D,2);H(j,()=>t(m),(e,t)=>{t(e,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`})});var M=G(j,2),N=z(M,!0);x(E),x(g),te(g,(e,t)=>a[t]=e,e=>a?.[e],()=>[t(d)]),F(e=>{J(g,`aria-checked`,t(p)),J(g,`aria-label`,t(c).label),J(g,`tabindex`,t(p)||t(o)<0&&t(d)===0?0:-1),J(g,`title`,t(c).description),X(g,1,e),w(N,t(c).label)},[()=>T(ft(`group/opt grid w-38 cursor-pointer gap-1.5 rounded-md border bg-card p-1.5 text-left transition-colors hover:bg-hover focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-focus`,t(p)?`border-primary bg-selected hover:bg-selected`:`border-transparent`))]),h(`click`,g,()=>s(t(c).value)),h(`keydown`,g,e=>u(e,t(d))),k(e,g)}),x(d),F(e=>{X(d,1,e),J(d,`aria-label`,r.ariaLabel)},[()=>T(ft(`flex flex-wrap gap-2`,r.class))]),k(e,d),D()}ue([`click`,`keydown`]);var dv=O(`<div class="flex flex-none flex-wrap items-center gap-2"><!></div>`),fv=O(`<div><div class="flex min-w-0 flex-1 items-center gap-2"><!></div> <!></div>`);function pv(e,t){c(t,!0);var r=fv(),i=q(r),a=q(i),o=e=>{var r=f(),i=R(r);n(i,()=>t.start),k(e,r)};l(a,e=>{t.start&&e(o)}),x(i);var s=G(i,2),u=e=>{var r=dv(),i=q(r);n(i,()=>t.end),x(r),k(e,r)};l(s,e=>{t.end&&e(u)}),x(r),F(e=>X(r,1,e),[()=>T(ft(`flex flex-wrap items-center justify-between gap-2`,t.class))]),k(e,r),D()}var mv=new Set([`$$slots`,`$$events`,`$$legacy`]);function hv(e,t){let n=V(t,mv),r=[[`path`,{d:`M12 12h.01`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`}]];Z(e,P({name:`briefcase-business`},()=>n,{get iconNode(){return r}}))}var gv=new Set([`$$slots`,`$$events`,`$$legacy`]);function _v(e,t){let n=V(t,gv),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`circle`,{cx:`12`,cy:`10`,r:`3`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`}]];Z(e,P({name:`circle-user`},()=>n,{get iconNode(){return r}}))}var vv=O(`<span><!></span>`),yv=O(`<!> <!>`,1);function bv(e,t){c(t,!0);let r=K(t,`delay`,3,300);var i=f(),a=R(i);H(a,()=>En,(e,i)=>{i(e,{get delayDuration(){return r()},children:(e,r)=>{var i=f(),a=R(i);H(a,()=>wn,(e,r)=>{r(e,{children:(e,r)=>{var i=yv(),a=R(i);{let e=(e,r)=>{let i=()=>(r?.()).props;var a=vv();ie(a,e=>({...i(),class:e}),[()=>ft(`inline-flex min-w-0 cursor-help`,t.class)]);var o=q(a);n(o,()=>t.children),x(a),k(e,a)};H(a,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Sn,(e,n)=>{n(e,{get side(){return t.side},class:`max-w-xs`,children:(e,n)=>{y();var r=g();F(()=>w(r,t.tip)),k(e,r)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,i),D()}var xv=O(`<div><!></div>`),Sv=O(`<div class="flex flex-none items-center"><div><!></div> <!></div>`);function Cv(e,t){let r=`relative flex h-full w-24 flex-none items-center justify-center`;var i=Sv(),a=q(i);X(a,1,T(r));var o=q(a),s=e=>{var r=f(),i=R(r);n(i,()=>t.user),k(e,r)};l(o,e=>{t.user&&e(s)}),x(a);var c=G(a,2),u=e=>{var i=xv();X(i,1,T(r));var a=q(i),o=e=>{var r=f(),i=R(r);n(i,()=>t.project),k(e,r)};l(a,e=>{t.project&&e(o)}),x(i),k(e,i)};l(c,e=>{t.projectName&&e(u)}),x(i),k(e,i)}var wv=`Your setting. Applies in every project unless the project sets its own.`;function Tv(e){return`Project: settings for ${e} only. Follows User until set.`}function Ev(e){return`Not applied until you review ${e}'s settings file`}function Dv(e){switch(e.kind){case`project`:return`Project`;case`user`:return`User`;case`builtin`:return`Built-in`;case`agent-browser`:return`Agent Browser`;case`extension`:return e.name}}function Ov(e,t){switch(e.kind){case`project`:{let e=t??`the project`;return`Defined in ${e}'s .nerve folder and shared with everyone who opens the repository. Only exists in ${e}.`}case`user`:return`Defined in your Nerve home. Available in every project.`;case`builtin`:return`Comes with Nerve.`;case`agent-browser`:return`Provided by Agent Browser.`;case`extension`:return`Provided by ${e.name}.`}}var kv=O(`<span class="flex items-center gap-1 truncate"><!><span class="truncate">Project</span></span>`),Av=O(`<span class="ml-2 w-4 flex-none"></span>`),jv=O(`<div class="flex flex-none items-center text-caption text-muted-foreground"><!> <!></div>`);function Mv(e,n){c(n,!0);let r=e=>{var t=f(),n=R(t),r=e=>{bv(e,{get tip(){return wv},class:`max-w-full truncate`,children:(e,t)=>{y();var n=g(`User`);k(e,n)},$$slots:{default:!0}})};l(n,e=>{o()||e(r)}),k(e,t)},i=e=>{{let r=L(()=>s()?Ev(n.projectName):Tv(n.projectName));bv(e,{get tip(){return t(r)},class:`max-w-full`,children:(e,t)=>{var n=kv(),r=q(n),i=e=>{Eh(e,{class:`size-3 flex-none`,"aria-hidden":`true`})};l(r,e=>{s()&&e(i)}),y(),x(n),k(e,n)},$$slots:{default:!0}})}},a=K(n,`chevron`,3,!1),o=K(n,`projectOnly`,3,!1),s=K(n,`locked`,3,!1);var u=jv(),d=q(u);Cv(d,{get projectName(){return n.projectName},get user(){return r},get project(){return i}});var p=G(d,2),m=e=>{var t=Av();k(e,t)};l(p,e=>{a()&&e(m)}),x(u),k(e,u),D()}var Nv=O(`<div class="grid gap-3"><!></div>`),Pv=O(`<section class="grid gap-1.5"><div class="flex min-h-6 items-end gap-2 pr-[calc(--spacing(3)+1px)] pl-1"><div class="flex min-w-0 flex-1 items-center gap-1"><!> <!></div> <!></div> <!></section>`);function Fv(e,r){c(r,!0);let i=K(r,`layers`,3,!0),a=K(r,`locked`,3,!1),o=K(r,`chevron`,3,!0),s=K(r,`list`,3,!0),u=L(()=>Dv(r.origin)),d=L(()=>r.note??Ov(r.origin,r.projectName)),p=L(()=>i()&&r.origin.kind!==`project`&&r.count!==0),m=L(()=>r.origin.kind===`project`?hv:r.origin.kind===`user`?_v:r.origin.kind===`builtin`?Kn:r.origin.kind===`agent-browser`?Gn:Ke);var h=f(),g=R(h),_=e=>{var i=Pv(),c=q(i),h=q(c),g=q(h);bv(g,{get tip(){return t(d)},children:(e,n)=>{Rn(e,{get label(){return t(u)},get count(){return r.count},get icon(){return t(m)}})},$$slots:{default:!0}});var _=G(g,2),v=e=>{var t=f(),i=R(t);n(i,()=>r.actions),k(e,t)};l(_,e=>{r.actions&&e(v)}),x(h);var y=G(h,2),b=e=>{Mv(e,{get projectName(){return r.projectName},get chevron(){return o()},get locked(){return a()}})};l(y,e=>{t(p)&&r.projectName&&e(b)}),x(c);var S=G(c,2),C=e=>{Wh(e,{variant:`card`,get title(){return r.emptyText},get description(){return r.emptyDescription},get actions(){return r.emptyAction}})},w=e=>{wh(e,{get ariaLabel(){return t(u)},children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.children),k(e,i)},$$slots:{default:!0}})},T=e=>{var t=Nv(),i=q(t);n(i,()=>r.children),x(t),k(e,t)};l(S,e=>{r.count===0&&r.emptyText?e(C):s()?e(w,1):e(T,-1)}),x(i),k(e,i)};l(g,e=>{(r.count!==0||r.emptyText)&&e(_)}),k(e,h),D()}var Iv=O(`<span class="flex items-center gap-1"><!>Project</span>`),Lv=O(`<div class="grid grid-cols-2 gap-3 px-[calc(--spacing(3)+1px)] text-caption text-muted-foreground"><span class="flex min-w-0"><!></span> <span class="flex min-w-0"><!></span></div>`);function Rv(e,n){c(n,!0);let r=K(n,`projectOnly`,3,!1),i=K(n,`locked`,3,!1);var a=Lv(),o=q(a),s=q(o),u=e=>{bv(e,{get tip(){return wv},children:(e,t)=>{y();var n=g(`User`);k(e,n)},$$slots:{default:!0}})};l(s,e=>{r()||e(u)}),x(o);var d=G(o,2),f=q(d);{let e=L(()=>i()?Ev(n.projectName):Tv(n.projectName));bv(f,{get tip(){return t(e)},children:(e,t)=>{var n=Iv(),r=q(n),a=e=>{Eh(e,{class:`size-3 flex-none`,"aria-hidden":`true`})};l(r,e=>{i()&&e(a)}),y(),x(n),k(e,n)},$$slots:{default:!0}})}x(d),x(a),k(e,a),D()}function zv(e,n){c(n,!0);let r=e=>{var r=f(),i=R(r),a=e=>{{let r=L(()=>`User: ${p(n.user)} in every project${n.projectName?` that doesn't set its own`:``}`);bv(e,{delay:400,get tip(){return t(r)},children:(e,r)=>{{let r=L(()=>`${n.name} at User level`);yn(e,{get checked(){return n.user},get"aria-label"(){return t(r)},onCheckedChange:e=>n.onChange(`user`,e)})}},$$slots:{default:!0}})}};l(i,e=>{!s()&&!o()&&e(a)}),k(e,r)},i=e=>{var r=f(),i=R(r),a=e=>{},o=e=>{{let r=L(()=>Ev(n.projectName??`the project`));bv(e,{delay:400,get tip(){return t(r)},children:(e,r)=>{{let r=L(()=>`${n.name} in this project`);yn(e,{get checked(){return n.user},disabled:!0,get"aria-label"(){return t(r)}})}},$$slots:{default:!0}})}},c=e=>{bv(e,{delay:400,get tip(){return t(h)},children:(e,r)=>{{let r=L(()=>`${n.name} in this project`);yn(e,{get checked(){return t(m)},get"aria-label"(){return t(r)},onCheckedChange:e=>n.onChange(`project`,e)})}},$$slots:{default:!0}})};l(i,e=>{s()||u()?e(a):d()?e(o,1):e(c,-1)}),k(e,r)},a=K(n,`projectSet`,3,!1),o=K(n,`projectOnly`,3,!1),s=K(n,`pending`,3,!1),u=K(n,`inapplicable`,3,!1),d=K(n,`locked`,3,!1),p=e=>e?`on`:`off`,m=L(()=>n.project??n.user),h=L(()=>a()?`Project: set here. Switch to ${p(n.user)} to follow User again.`:`Project: follows User (${p(n.user)})`);Cv(e,{get projectName(){return n.projectName},get user(){return r},get project(){return i}}),D()}var Bv=O(`<label><!> <span class="truncate">Project overrides</span> <!></label>`),Vv=O(`<!> <!>`,1);function Hv(e,n){let r=L(()=>`Show this project's values next to yours. ${n.count===0?`The project uses all of yours.`:`The project changes ${n.count} ${n.count===1?`setting`:`settings`}.`}`);var i=f(),a=R(i);H(a,()=>En,(e,i)=>{i(e,{delayDuration:300,children:(e,i)=>{var a=f(),o=R(a);H(o,()=>wn,(e,i)=>{i(e,{children:(e,i)=>{var a=Vv(),o=R(a);{let e=(e,t)=>{let r=()=>(t?.()).props;var i=Bv();ie(i,()=>({...r(),for:n.id,class:`flex h-8 cursor-pointer items-center gap-2 text-ui text-muted-foreground hover:text-foreground`}));var a=q(i);yn(a,{get id(){return n.id},get checked(){return n.checked},get onCheckedChange(){return n.onCheckedChange}});var o=G(a,4),s=e=>{be(e,{variant:`brand`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.count)),k(e,r)},$$slots:{default:!0}})};l(o,e=>{n.count>0&&e(s)}),x(i),k(e,i)};H(o,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var s=G(o,2);H(s,()=>Sn,(e,n)=>{n(e,{side:`bottom`,children:(e,n)=>{y();var i=g();F(()=>w(i,t(r))),k(e,i)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,i)}function Uv(e,n){{let r=L(()=>`Overridden in this project (${n.projectName})`);bv(e,{get tip(){return t(r)},children:(e,t)=>{hv(e,{class:`size-3 text-primary`,"aria-label":`Overridden in this project`})},$$slots:{default:!0}})}}function Wv(e,t){let n=K(t,`title`,3,`Enabled`),r=K(t,`projectSet`,3,!1),i=K(t,`projectOnly`,3,!1),a=K(t,`locked`,3,!1),o=K(t,`pending`,3,!1),s=K(t,`inapplicable`,3,!1);X_(e,{surface:!1,layerLabels:e=>{var n=f(),r=R(n),o=e=>{Mv(e,{get projectName(){return t.projectName},get projectOnly(){return i()},get locked(){return a()},chevron:!0})};l(r,e=>{t.projectName&&e(o)}),k(e,n)},children:(e,c)=>{wh(e,{get ariaLabel(){return n()},children:(e,c)=>{Bh(e,{get title(){return n()},get summary(){return t.description},meta:e=>{zv(e,{get name(){return t.name},get user(){return t.user},get project(){return t.project},get projectSet(){return r()},get projectName(){return t.projectName},get projectOnly(){return i()},get locked(){return a()},get pending(){return o()},get inapplicable(){return s()},get onChange(){return t.onChange}})},$$slots:{meta:!0}})},$$slots:{default:!0}})},$$slots:{layerLabels:!0,default:!0}})}var Gv=(e,t=m)=>{var n=Kv(),r=q(n),i=e=>{Mn(e,{get icon(){return zn},get label(){return t().label},get onclick(){return t().onReset}})};l(r,e=>{t()&&e(i)}),x(n),k(e,n)},Kv=O(`<span class="flex w-7 flex-none items-center justify-center"><!></span>`),qv=O(`<span class="text-caption text-muted-foreground"> <!></span>`),Jv=O(`<div class="grid min-w-0 flex-1 gap-0.5"><span class="flex min-w-0 items-center gap-1.5 text-ui"> <!></span> <!></div>`),Yv=O(`<div class="flex min-h-12 items-center gap-3 px-3 py-2"><!> <div class="flex w-56 flex-none items-center justify-end gap-1"><!> <div class="flex min-w-0 flex-1 justify-end"><!></div></div></div>`),Xv=O(`<div class="flex min-w-0 flex-1"><!></div>`),Zv=O(`<div class="flex min-w-0 flex-1"></div>`),Qv=O(`<span class="min-w-0 flex-1 text-caption text-muted-foreground"> </span> <!>`,1),$v=O(`<div class="flex min-w-0 flex-1"><!></div> <!>`,1),ey=O(`<div class="grid gap-2 px-3 py-2.5"><!> <div class="grid grid-cols-2 gap-3"><div class="flex min-w-0 items-center gap-1"><!> <!></div> <div class="flex min-w-0 items-center gap-1"><!></div></div></div>`);function ty(e,t){c(t,!0);let r=e=>{var r=Jv(),i=q(r),a=q(i),o=G(a),s=e=>{Uv(e,{get projectName(){return t.overriddenIn}})};l(o,e=>{t.overriddenIn&&!t.projectName&&e(s)}),x(i);var c=G(i,2),u=e=>{var r=qv(),i=q(r),a=G(i),o=e=>{var r=f(),i=R(r);n(i,()=>t.hint),k(e,r)};l(a,e=>{t.hint&&e(o)}),x(r),F(()=>w(i,`${t.description??``} `)),k(e,r)};l(c,e=>{(t.description||t.hint)&&e(u)}),x(r),F(()=>w(a,`${t.label??``} `)),k(e,r)},i=K(t,`userAbsent`,3,!1);var a=f(),o=R(a),s=e=>{var i=Yv(),a=q(i);r(a);var o=G(a,2),s=q(o),c=e=>{Mn(e,{get icon(){return zn},get label(){return t.userReset.label},get onclick(){return t.userReset.onReset}})};l(s,e=>{t.userReset&&e(c)});var u=G(s,2),d=q(u);n(d,()=>t.user),x(u),x(o),x(i),k(e,i)},u=e=>{var a=ey(),o=q(a);r(o);var s=G(o,2),c=q(s),u=q(c),d=e=>{var r=Xv(),i=q(r);n(i,()=>t.user),x(r),k(e,r)},f=e=>{var t=Zv();k(e,t)};l(u,e=>{i()?e(f,-1):e(d)}),Gv(G(u,2),()=>i()?void 0:t.userReset),x(c);var p=G(c,2),m=q(p),h=e=>{var n=Qv(),r=R(n),i=z(r,!0);Gv(G(r,2),()=>void 0),F(()=>w(i,t.projectNote)),k(e,n)},g=e=>{var r=$v(),i=R(r),a=q(i);n(a,()=>t.project),x(i),Gv(G(i,2),()=>t.projectReset),k(e,r)};l(m,e=>{t.projectNote||!t.project?e(h):e(g,-1)}),x(p),x(s),x(a),k(e,a)};l(o,e=>{t.projectName?e(u,-1):e(s)}),k(e,a),D()}var ny=O(`<!> `,1),ry=O(`<!> <!>`,1);function iy(e,n){c(n,!0);let r=K(n,`variant`,3,`outline`),i=K(n,`projectOnly`,3,!1);var a=f(),o=R(a),s=e=>{Q(e,{size:`sm`,get variant(){return r()},onclick:()=>n.onSelect(i()&&n.projectName?`project`:`user`),children:(e,t)=>{var r=ny(),i=R(r),a=e=>{var t=f(),r=R(t);H(r,()=>n.icon,(e,t)=>{t(e,{class:`size-3.5`})}),k(e,t)};l(i,e=>{n.icon&&e(a)});var o=G(i,1,!0);F(()=>w(o,n.label)),k(e,r)},$$slots:{default:!0}})},u=e=>{var i=f(),a=R(i);H(a,()=>Xn,(e,i)=>{i(e,{children:(e,i)=>{var a=ry(),o=R(a);{let e=L(()=>xt({variant:r(),size:`sm`}));H(o,()=>Qn,(r,i)=>{i(r,{get class(){return t(e)},children:(e,t)=>{var r=ry(),i=R(r),a=e=>{var t=f(),r=R(t);H(r,()=>n.icon,(e,t)=>{t(e,{class:`size-3.5`})}),k(e,t)};l(i,e=>{n.icon&&e(a)});var o=G(i,1,!0),s=G(o);qn(s,{class:`size-3.5 text-muted-foreground`}),F(()=>w(o,n.label)),k(e,r)},$$slots:{default:!0}})})}var s=G(o,2);H(s,()=>Jn,(e,t)=>{t(e,{align:`end`,class:`w-48`,children:(e,t)=>{var r=ry(),i=R(r);H(i,()=>Zn,(e,t)=>{t(e,{onSelect:()=>n.onSelect(`user`),children:(e,t)=>{y();var n=g(`User`);k(e,n)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>Zn,(e,t)=>{t(e,{onSelect:()=>n.onSelect(`project`),children:(e,t)=>{y();var n=g(`Project`);k(e,n)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,i)};l(o,e=>{!n.projectName||i()?e(s):e(u,-1)}),k(e,a),D()}function ay(e,t){let n=K(t,`variant`,3,`neutral`);bv(e,{get tip(){return t.tip},children:(e,r)=>{be(e,{get variant(){return n()},children:(e,n)=>{y();var r=g();F(()=>w(r,t.text)),k(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})}var oy={needs_review:`Needs review`,trusted:`Trusted`,declined:`Declined`},sy={needs_review:`warning`,trusted:`success`,declined:`neutral`};function cy(e,t=!1){switch(e){case`needs_review`:return t?`Changed since you trusted it. Not used until you review it again.`:`Not used until you review and trust it.`;case`trusted`:return`You trusted this exact content. Edits made in Nerve keep it trusted; any other change asks again.`;case`declined`:return t?`You declined it, and it changed since. It stays off until you review and trust it.`:`You declined it. It stays off until you review and trust it.`}}function ly(e,n){c(n,!0);let r=K(n,`changedSinceDecision`,3,!1);{let i=L(()=>n.tip??cy(n.state,r()));ay(e,{get text(){return oy[n.state]},get tip(){return t(i)},get variant(){return sy[n.state]}})}D()}var uy=O(`<!> <!>`,1);function dy(e,n){let r=K(n,`busy`,3,!1),i=K(n,`variant`,3,`page`),a=L(()=>i()===`dialog`?`default`:`sm`);var o=uy(),s=R(o),c=e=>{Q(e,{variant:`ghost`,get size(){return t(a)},autofocus:!0,get disabled(){return r()},get onclick(){return n.onSkip},children:(e,t)=>{y();var n=g(`Not now`);k(e,n)},$$slots:{default:!0}})};l(s,e=>{i()===`dialog`&&n.onSkip&&n.state!==`trusted`&&e(c)});var u=G(s,2),d=e=>{var i=f(),o=R(i),s=e=>{Q(e,{variant:`outline`,get size(){return t(a)},get disabled(){return r()},get onclick(){return n.onRevoke},children:(e,t)=>{y();var n=g(`Revoke`);k(e,n)},$$slots:{default:!0}})};l(o,e=>{n.onRevoke&&e(s)}),k(e,i)},p=e=>{var i=uy(),o=R(i),s=e=>{Q(e,{variant:`outline`,get size(){return t(a)},get disabled(){return r()},get onclick(){return n.onDecline},children:(e,t)=>{y();var n=g(`Decline`);k(e,n)},$$slots:{default:!0}})};l(o,e=>{n.state===`needs_review`&&n.onDecline&&e(s)});var c=G(o,2),u=e=>{Q(e,{get size(){return t(a)},get disabled(){return r()},get onclick(){return n.onTrust},children:(e,t)=>{y();var n=g(`Trust`);k(e,n)},$$slots:{default:!0}})};l(c,e=>{n.onTrust&&e(u)}),k(e,i)};l(u,e=>{n.state===`trusted`?e(d):e(p,-1)}),k(e,o)}var fy=class{#e=Y(U([]));get devices(){return t(this.#e)}set devices(e){B(this.#e,e,!0)}#t=Y(U([]));get passkeys(){return t(this.#t)}set passkeys(e){B(this.#t,e,!0)}#n=Y(U([]));get audit(){return t(this.#n)}set audit(e){B(this.#n,e,!0)}#r=Y();get session(){return t(this.#r)}set session(e){B(this.#r,e,!0)}#i=Y(!1);get legacyBearerSeen(){return t(this.#i)}set legacyBearerSeen(e){B(this.#i,e,!0)}#a=Y(!0);get loading(){return t(this.#a)}set loading(e){B(this.#a,e,!0)}#o=Y();get errorMessage(){return t(this.#o)}set errorMessage(e){B(this.#o,e,!0)}#s=Y();get pairing(){return t(this.#s)}set pairing(e){B(this.#s,e,!0)}#c=new or;start(){this.#c.restart(e=>{this.load();let t=()=>void this.load();e.onDispose($n(`access.device_paired`,t)),e.onDispose($n(`access.device_revoked`,t)),e.onDispose($n(`access.passkeys_changed`,t))})}dispose(){this.#c.dispose()}async load(){let e=this.#c.capture();try{let[t,n,r,i]=await Promise.all([Jf(),$f(),tp(30),Vf()]);if(!e())return;this.devices=t.devices,this.legacyBearerSeen=t.legacyBearerSeen,this.passkeys=n,this.audit=r,this.session=i,this.errorMessage=void 0}catch(t){e()&&(this.errorMessage=Vm(t))}finally{e()&&(this.loading=!1)}}async#l(e){try{return await e(),this.errorMessage=void 0,await this.load(),!0}catch(e){return this.errorMessage=Vm(e),!1}}rename(e,t){return this.#l(()=>Yf(e,t))}revoke(e){return this.#l(()=>Zf(e))}revokeOthers(){return this.#l(()=>Qf(!0))}removePasskey(e){return this.#l(()=>ep(e))}addPasskey(e){return this.#l(()=>Wp(e))}async createPairing(){return this.pairing=await qf(`mobile`),this.pairing}},py=6e4,my=60*py,hy=24*my;function gy(e,t=Date.now()){let n=t-e;return n<py?`just now`:n<my?`${Math.floor(n/py)} min ago`:n<hy?`${Math.floor(n/my)} h ago`:n<60*hy?`${Math.floor(n/hy)} d ago`:new Date(e).toLocaleDateString()}var _y={pairing:`Pairing code`,passkey:`Passkey`,"legacy-token":`Legacy link`};function vy(e){return _y[e]}var yy={browser:`Browser`,mobile:`Phone`,desktop:`Desktop`,cli:`CLI`};function by(e){return yy[e]}var xy={pair:`Device paired`,login:`Passkey sign-in`,failed:`Failed attempt`,revoked:`Device revoked`,rotated:`Credential rotated`,passkey_registered:`Passkey added`,passkey_removed:`Passkey removed`,reset:`Access reset`,local_token_rotated:`Local token rotated`,legacy_bearer:`Legacy token used remotely`};function Sy(e){let t=xy[e.type];return e.deviceName?`${t}: ${e.deviceName}`:t}function Cy(e){return e.type===`failed`||e.type===`legacy_bearer`?`warning`:`neutral`}function wy(e){return`Device paired: ${e}`}function Ty(e,t){return e.links.length>0?e.links:[{kind:`other`,label:`This address`,url:`${t}/#pair=${e.code}`}]}function Ey(e,t){return e.find(e=>e.label===t.remembered)??e.find(e=>e.kind===`tunnel`)??e.find(e=>new URL(e.url).origin===t.origin)??e[0]}var Dy=function(e,t){let n=e,r=ky[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=jy.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=jy.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=jy.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=jy.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=jy.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=jy.getErrorCorrectPolynomial(l),d=Ny(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=Py.getRSBlocks(e,t),i=Fy();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),jy.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=Iy(e);break;case`Alphanumeric`:n=Ly(e);break;case`Byte`:n=Ry(e);break;case`Kanji`:n=zy(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=Py.getRSBlocks(e,r),n=Fy();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),jy.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return Wy(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`&lt;`;break;case`>`:t+=`&gt;`;break;case`&`:t+=`&amp;`;break;case`"`:t+=`&quot;`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
3
+ `}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
4
+ `}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};Dy.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},Dy.createStringToBytes=function(e,t){let n=function(){let n=Hy(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var Oy={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ky={L:1,M:0,Q:3,H:2},Ay={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},jy=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case Ay.PATTERN000:return function(e,t){return(e+t)%2==0};case Ay.PATTERN001:return function(e,t){return e%2==0};case Ay.PATTERN010:return function(e,t){return t%3==0};case Ay.PATTERN011:return function(e,t){return(e+t)%3==0};case Ay.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case Ay.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case Ay.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case Ay.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=Ny([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Ny([1,My.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case Oy.MODE_NUMBER:return 10;case Oy.MODE_ALPHA_NUM:return 9;case Oy.MODE_8BIT_BYTE:return 8;case Oy.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case Oy.MODE_NUMBER:return 12;case Oy.MODE_ALPHA_NUM:return 11;case Oy.MODE_8BIT_BYTE:return 16;case Oy.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case Oy.MODE_NUMBER:return 14;case Oy.MODE_ALPHA_NUM:return 13;case Oy.MODE_8BIT_BYTE:return 16;case Oy.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),My=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),Ny=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=My.gexp(My.glog(r.getAt(n))+My.glog(e.getAt(i)));return Ny(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=My.glog(r.getAt(0))-My.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=My.gexp(My.glog(e.getAt(r))+t);return Ny(n,0).mod(e)},r},Py=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case ky.L:return e[(t-1)*4+0];case ky.M:return e[(t-1)*4+1];case ky.Q:return e[(t-1)*4+2];case ky.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),Fy=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},Iy=function(e){let t=Oy.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},Ly=function(e){let t=Oy.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},Ry=function(e){let t=Oy.MODE_8BIT_BYTE,n=Dy.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},zy=function(e){let t=Oy.MODE_KANJI,n=Dy.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},By=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},Vy=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},Hy=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},Uy=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=By(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},Wy=function(e,t,n){let r=Uy(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=By();r.write(i);let a=Vy(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};Dy.stringToBytes;function Gy(e){let t=Dy(0,`M`);t.addData(e),t.make();let n=t.getModuleCount(),r=``;for(let e=0;e<n;e+=1){let i=0;for(;i<n;){if(!t.isDark(e,i)){i+=1;continue}let a=i;for(;i<n&&t.isDark(e,i);)i+=1;r+=`M${a} ${e}h${i-a}v1h-${i-a}z`}}return{size:n,path:r}}var Ky=A(`<svg role="img" shape-rendering="crispEdges" class="size-48 rounded-md"><rect fill="white"></rect><path fill="black"></path></svg>`);function qy(e,n){c(n,!0);let r=L(()=>Gy(n.value)),i=L(()=>t(r).size+8);var a=Ky(),o=q(a),s=G(o);x(a),F(()=>{J(a,`viewBox`,`0 0 ${t(i)??``} ${t(i)??``}`),J(a,`aria-label`,n.label),J(o,`width`,t(i)),J(o,`height`,t(i)),J(s,`d`,t(r).path),J(s,`transform`,`translate(4 4)`)}),k(e,a),D()}var Jy=O(`<!> New code`,1),Yy=O(`<!> <!>`,1),Xy=O(`<span> </span>`),Zy=O(`<span class="text-center text-ui text-muted-foreground">Installs Nerve's local certificate so the phone trusts this address,
5
+ then pairs. Only needed once per device.</span>`),Qy=O(`<!> <!> <div><!></div> <!> <span class="font-mono text-title font-medium tracking-wider"> </span> <span class="text-ui text-muted-foreground"> </span> <div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate font-mono text-caption text-muted-foreground"> </span> <!></div> <!>`,1),$y=O(`<div class="grid justify-items-center gap-4"><!></div>`);function eb(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=Y(void 0),a=Y(void 0),o=Y(!1),s=Y(U(Date.now())),u=`nerve:pairing-network:v1`,d=L(()=>t(i)?Ty(t(i),window.location.origin):[]),p=Y(U(b())),m=L(()=>Ey(t(d),{remembered:t(p),origin:window.location.origin})),h=Y(`ready`),_=L(()=>t(h)===`setup`&&t(m)?.setupUrl?t(m).setupUrl:t(m)?.url);function b(){try{return localStorage.getItem(u)??void 0}catch{return}}function S(e){B(p,e,!0);try{localStorage.setItem(u,e)}catch{}}let C=L(()=>t(i)?Math.max(0,Math.ceil((t(i).expiresAt-t(s))/1e3)):0),E=L(()=>!!t(i)&&t(C)===0);async function O(){B(o,!0),B(a,void 0);try{B(i,await n.createCode(),!0)}catch(e){B(i,void 0),B(a,Vm(e),!0)}finally{B(o,!1)}}W(()=>{if(!r()){B(i,void 0),B(a,void 0);return}O(),B(s,Date.now(),!0);let e=setInterval(()=>B(s,Date.now(),!0),1e3);return()=>clearInterval(e)}),ln(e,{size:`sm`,title:`Pair a device`,description:`Scan the QR code with the device's camera, or open the address and enter the code. It works once.`,get open(){return r()},set open(e){r(e)},footer:e=>{var n=Yy(),i=R(n);Q(i,{variant:`ghost`,onclick:()=>r(!1),children:(e,t)=>{y();var n=g(`Close`);k(e,n)},$$slots:{default:!0}});var a=G(i,2);Q(a,{variant:`outline`,get disabled(){return t(o)},onclick:()=>void O(),children:(e,t)=>{var n=Jy(),r=R(n);cr(r,{}),y(),k(e,n)},$$slots:{default:!0}}),k(e,n)},children:(e,r)=>{var s=$y(),c=q(s),u=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return t(a)}})},p=e=>{dn(e,{})},b=e=>{var r=Qy(),a=R(r),o=e=>{var n=f(),r=R(n);H(r,()=>Jr,(e,n)=>{n(e,{type:`single`,get value(){return t(m).label},onValueChange:S,children:(e,n)=>{var r=Yy(),i=R(r);H(i,()=>Pr,(e,n)=>{n(e,{class:`w-full`,"aria-label":`Network`,children:(e,n)=>{var r=Xy(),i=z(r,!0);F(()=>w(i,t(m).label)),k(e,r)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>Zr,(e,n)=>{n(e,{children:(e,n)=>{var r=f(),i=R(r);v(i,17,()=>t(d),e=>e.url,(e,n)=>{var r=f(),i=R(r);H(i,()=>Ur,(e,r)=>{r(e,{get value(){return t(n).label},get label(){return t(n).label}})}),k(e,r)}),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,n)};l(a,e=>{t(d).length>1&&e(o)});var s=G(a,2),c=e=>{var n=f(),r=R(n);H(r,()=>ti,(e,n)=>{n(e,{type:`single`,"aria-label":`Device setup`,get value(){return t(h)},onValueChange:e=>e&&B(h,e,!0),children:(e,t)=>{var n=Yy(),r=R(n);H(r,()=>ni,(e,t)=>{t(e,{value:`ready`,children:(e,t)=>{y();var n=g(`Ready`);k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>ni,(e,t)=>{t(e,{value:`setup`,children:(e,t)=>{y();var n=g(`First time on this device`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)};l(s,e=>{t(m).setupUrl&&e(c)});var u=G(s,2),p=q(u);{let e=L(()=>t(h)===`setup`&&t(m).setupUrl?`QR code for installing the certificate and pairing`:`QR code for pairing a device`);qy(p,{get value(){return t(_)},get label(){return t(e)}})}x(u);var b=G(u,2),D=e=>{var t=Zy();k(e,t)};l(b,e=>{t(h)===`setup`&&t(m).setupUrl&&e(D)});var O=G(b,2),A=z(O,!0),j=G(O,2),M=z(j,!0),N=G(j,2),P=q(N),I=z(P,!0),ee=G(P,2);Q(ee,{variant:`ghost`,size:`icon-sm`,"aria-label":`Copy pairing link`,onclick:()=>void ri(t(_)),children:(e,t)=>{sr(e,{})},$$slots:{default:!0}}),x(N);var te=G(N,2),ne=e=>{nn(e,{layout:`block`,tone:`warning`,text:`This address isn't HTTPS, so other devices can't pair through it. Open Nerve through its HTTPS address, or set a public URL.`})};l(te,e=>{t(i).links.length===0&&!n.secureTransport&&e(ne)}),F(()=>{X(u,1,T(t(E)?`opacity-40`:void 0)),w(A,t(i).code),w(M,t(E)?`Code expired.`:`Expires in ${t(C)}s`),J(P,`title`,t(_)),w(I,t(_))}),k(e,r)};l(c,e=>{t(a)?e(u):t(o)&&!t(i)?e(p,1):t(i)&&t(m)&&t(_)&&e(b,2)}),x(s),k(e,s)},$$slots:{footer:!0,default:!0}}),D()}var tb=O(`<div class="grid gap-1.5"><!> <!></div>`);function nb(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=K(n,`submitLabel`,3,`Save`),a=Y(``),o=Y(!1);W(()=>{r()&&B(a,n.initialName,!0)});async function s(){B(o,!0);try{await n.onSubmit(t(a).trim())&&r(!1)}finally{B(o,!1)}}{let c=L(()=>!t(a).trim());on(e,{get title(){return n.title},get submitLabel(){return i()},get busy(){return t(o)},get submitDisabled(){return t(c)},onSubmit:s,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=tb(),o=q(i);un(o,{for:`access-name-field`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.label)),k(e,r)},$$slots:{default:!0}});var s=G(o,2);an(s,{id:`access-name-field`,get value(){return t(a)},oninput:e=>B(a,e.currentTarget.value,!0),maxlength:80,autocomplete:`off`}),x(i),k(e,i)},$$slots:{default:!0}})}D()}var rb=O(`<!> Pair a device`,1),ib=O(`<!> <!>`,1),ab=O(`<!> Add passkey`,1),ob=O(`<p class="text-ui text-muted-foreground">Nothing recorded yet.</p>`),sb=O(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function cb(e,n){c(n,!0);let r=L(()=>Xr.status?.tunnel),i=new fy,a=Y(!1),o=Y(void 0),s=Y(!1),u=Y(void 0),d=Y(!1),p=Y(!1),m=Y(void 0),h=Y(!1),_=Y(!1);le(()=>(i.start(),()=>i.dispose()));let b=L(()=>i.devices.filter(e=>!e.current)),x=L(()=>!!(i.session?.passkey.required||i.passkeys.length)),S=Date.now();var C=sb(),w=R(C),T=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return i.errorMessage}})};l(w,e=>{i.errorMessage&&e(T)});var E=G(w,2),O=e=>{nn(e,{layout:`block`,tone:`warning`,get icon(){return Zh},title:`A remote client used the daemon token`,text:`Using the daemon token from another machine is deprecated and will stop working. Pair that client as a device instead, then rotate the local token.`})};l(E,e=>{i.legacyBearerSeen&&e(O)});var A=G(E,2);{let e=e=>{var n=ib(),r=R(n);{let e=L(()=>t(b).length===0);Q(r,{variant:`outline`,size:`sm`,get disabled(){return t(e)},onclick:()=>B(p,!0),children:(e,t)=>{y();var n=g(`Revoke all others`);k(e,n)},$$slots:{default:!0}})}var i=G(r,2);Q(i,{size:`sm`,onclick:()=>B(a,!0),children:(e,t)=>{var n=rb();Yh(R(n),{}),y(),k(e,n)},$$slots:{default:!0}}),k(e,n)},n=L(()=>`Browsers and apps that can open this Nerve. Each has its own revocable credential.${t(r)?.state===`ready`?` Phones on your tailnet can pair at ${t(r).url}.`:``}`);X_(A,{id:`devices`,title:`Devices`,get description(){return t(n)},surface:!1,actions:e,children:(e,n)=>{var r=f(),a=R(r),c=e=>{eg(e,{class:`h-9 w-full`})},p=e=>{Wh(e,{variant:`card`,get icon(){return Yh},title:`No paired devices`,description:`Pair a phone or another browser to open Nerve from it.`})},m=e=>{wh(e,{ariaLabel:`Devices`,children:(e,n)=>{var r=f(),a=R(r);v(a,17,()=>i.devices,e=>e.id,(e,n)=>{{let r=e=>{var r=ib(),i=R(r),a=e=>{be(e,{variant:`brand`,children:(e,t)=>{y();var n=g(`This device`);k(e,n)},$$slots:{default:!0}})};l(i,e=>{t(n).current&&e(a)});var o=G(i,2),s=e=>{be(e,{variant:`warning`,children:(e,t)=>{y();var n=g(`Expired`);k(e,n)},$$slots:{default:!0}})};l(o,e=>{t(n).status===`expired`&&e(s)}),k(e,r)},a=e=>{var r=ib(),a=R(r);Mn(a,{get icon(){return Dn},label:`Rename device`,onclick:()=>{B(o,t(n),!0),B(s,!0)}});var c=G(a,2),f=e=>{{let r=L(()=>t(n).status===`expired`?`Dismiss`:`Revoke device`);Mn(e,{get icon(){return kn},tone:`destructive`,get label(){return t(r)},onclick:()=>{t(n).status===`expired`?i.revoke(t(n).id):(B(u,t(n),!0),B(d,!0))}})}};l(c,e=>{t(n).current||e(f)}),k(e,r)},c=L(()=>`${by(t(n).kind)} · ${vy(t(n).method)} · ${t(n).current?`active now`:`seen ${gy(t(n).lastSeenAt,S)}`}`);Bh(e,{get title(){return t(n).name},get summary(){return t(c)},badges:r,actions:a,$$slots:{badges:!0,actions:!0}})}}),k(e,r)},$$slots:{default:!0}})};l(a,e=>{i.loading?e(c):i.devices.length===0?e(p,1):e(m,-1)}),k(e,r)},$$slots:{actions:!0,default:!0}})}var j=G(A,2);{let e=e=>{Q(e,{variant:`outline`,size:`sm`,onclick:()=>B(_,!0),children:(e,t)=>{var n=ab(),r=R(n);On(r,{}),y(),k(e,n)},$$slots:{default:!0}})},n=L(()=>t(x)?`Passkeys sign devices in when Nerve is reachable at its public URL.`:`Passkeys are used when Nerve has a public URL. You can enroll them ahead of time.`);X_(j,{id:`passkeys`,title:`Passkeys`,get description(){return t(n)},surface:!1,actions:e,children:(e,n)=>{var r=f(),a=R(r),o=e=>{Wh(e,{variant:`card`,get icon(){return Jm},title:`No passkeys`,description:`Add a passkey to sign in without a pairing code.`})},s=e=>{wh(e,{ariaLabel:`Passkeys`,children:(e,n)=>{var r=f(),a=R(r);v(a,17,()=>i.passkeys,e=>e.id,(e,n)=>{{let r=e=>{Mn(e,{get icon(){return kn},tone:`destructive`,label:`Remove passkey`,onclick:()=>{B(m,t(n),!0),B(h,!0)}})},i=L(()=>t(n).lastUsedAt?`Last used ${gy(t(n).lastUsedAt,S)}`:`Added ${new Date(t(n).createdAt).toLocaleDateString()}`);Bh(e,{get title(){return t(n).name},get summary(){return t(i)},actions:r,$$slots:{actions:!0}})}}),k(e,r)},$$slots:{default:!0}})};l(a,e=>{i.passkeys.length===0?e(o):e(s,-1)}),k(e,r)},$$slots:{actions:!0,default:!0}})}var M=G(j,2);X_(M,{id:`activity`,title:`Recent activity`,description:`Pairing, sign-ins, failed attempts and revocations.`,surface:!1,children:(e,n)=>{var r=f(),a=R(r),o=e=>{var t=ob();k(e,t)},s=e=>{wh(e,{ariaLabel:`Recent access activity`,children:(e,n)=>{var r=f(),a=R(r);v(a,17,()=>i.audit,e=>`${e.at}-${e.type}-${e.deviceId??``}`,(e,n)=>{{let r=e=>{var r=f(),i=R(r),a=e=>{be(e,{variant:`warning`,children:(e,t)=>{y();var n=g(`Attention`);k(e,n)},$$slots:{default:!0}})},o=L(()=>Cy(t(n))===`warning`);l(i,e=>{t(o)&&e(a)}),k(e,r)},i=L(()=>Sy(t(n))),a=L(()=>[new Date(t(n).at).toLocaleString(),t(n).ip,t(n).detail].filter(Boolean).join(` · `));Bh(e,{get title(){return t(i)},get summary(){return t(a)},badges:r,$$slots:{badges:!0}})}}),k(e,r)},$$slots:{default:!0}})};l(a,e=>{i.audit.length===0?e(o):e(s,-1)}),k(e,r)},$$slots:{default:!0}});var N=G(M,2);{let e=L(()=>i.session?.secureTransport??!1);eb(N,{get secureTransport(){return t(e)},createCode:()=>i.createPairing(),get open(){return t(a)},set open(e){B(a,e,!0)}})}var P=G(N,2);{let e=L(()=>t(o)?.name??``);nb(P,{title:`Rename device`,label:`Device name`,get initialName(){return t(e)},onSubmit:e=>t(o)?i.rename(t(o).id,e):Promise.resolve(!1),get open(){return t(s)},set open(e){B(s,e,!0)}})}var F=G(P,2);nb(F,{title:`Add a passkey`,label:`Passkey name`,submitLabel:`Continue`,initialName:`Passkey`,onSubmit:e=>i.addPasskey(e),get open(){return t(_)},set open(e){B(_,e,!0)}});var I=G(F,2);{let e=L(()=>`Revoke ${t(u)?.name??`device`}?`);jn(I,{destructive:!0,get title(){return t(e)},description:`It is signed out immediately and has to be paired again.`,confirmLabel:`Revoke`,onConfirm:()=>t(u)&&void i.revoke(t(u).id),get open(){return t(d)},set open(e){B(d,e,!0)}})}var ee=G(I,2);jn(ee,{destructive:!0,title:`Revoke all other devices?`,description:`Every device except this one is signed out immediately.`,confirmLabel:`Revoke all others`,onConfirm:()=>void i.revokeOthers(),get open(){return t(p)},set open(e){B(p,e,!0)}});var te=G(ee,2);{let e=L(()=>`Remove ${t(m)?.name??`passkey`}?`);jn(te,{destructive:!0,get title(){return t(e)},description:`You can no longer sign in with it. The last passkey can't be removed while a public URL is set.`,confirmLabel:`Remove`,onConfirm:()=>t(m)&&void i.removePasskey(t(m).id),get open(){return t(h)},set open(e){B(h,e,!0)}})}k(e,C),D()}var lb=`https://tailscale.com/download`,ub=`https://login.tailscale.com/admin/dns`,db=e=>({tone:`warning`,retry:!1,...e});function fb(e){switch(e.code){case`not_installed`:return db({summary:`Tailscale is not installed.`,link:{label:`Download Tailscale`,href:lb},retry:!0});case`not_running`:return db({summary:`Start Tailscale and sign in.`,retry:!0});case`no_magic_dns`:return db({summary:`MagicDNS is off for your tailnet.`,detail:`Turn on MagicDNS in the Tailscale admin console.`,link:{label:`Open admin console`,href:ub},retry:!0});case`serve_not_enabled`:return db({summary:`Tailscale Serve is not enabled for your tailnet.`,link:{label:`Enable Serve`,href:e.approvalUrl??`https://login.tailscale.com/admin/dns`},retry:!0});case`permission_denied`:return db({summary:`Tailscale needs a one-time permission.`,detail:`Run this command in a terminal, then try again.`,command:`sudo tailscale set --operator=$USER`,retry:!0});case`port_in_use`:return db({summary:`Another service uses port ${e.httpsPort} on Tailscale. Choose another port.`});case`funnel_enabled`:return db({summary:`Tailscale Funnel exposes this port to the public internet.`,detail:`Private access has to stay private. Turn Funnel off, then try again.`,command:`tailscale funnel --https=${e.httpsPort} off`,retry:!0});case`entry_changed`:return db({summary:`The Tailscale Serve setup changed.`,retry:!0});case`command_failed`:return db({summary:`Tailscale returned an error.`,detail:e.detail,retry:!0})}}function pb(e){switch(e?.state){case void 0:case`off`:return{tone:`neutral`,summary:`Off`,retry:!1};case`starting`:return{tone:`neutral`,summary:`Starting…`,retry:!1};case`certificate`:return{tone:`neutral`,summary:`Getting a certificate…`,detail:`This can take up to a minute the first time.`,url:e.url,retry:!1};case`ready`:return{tone:`success`,summary:`Ready`,url:e.url,retry:!1};case`problem`:return fb(e.problem)}}function mb(e){switch(e?.state){case void 0:case`off`:return`Off. Turn on in Nerve on a computer.`;case`starting`:return`Starting…`;case`certificate`:return`Getting a certificate…`;case`ready`:return`Private access on · ${new URL(e.url).host}`;case`problem`:return`Problem: ${fb(e.problem).summary}`}}var hb=O(`<div><!></div>`),gb=O(`<div class="grid size-48 place-items-center"><!></div>`),_b=O(`<!> New code`,1),vb=O(`<span class="text-caption text-muted-foreground"> </span>`),yb=O(`<div class="flex flex-wrap items-center gap-6 py-2"><div class="grid justify-items-center gap-2"><!> <!></div> <div class="grid min-w-0 flex-1 basis-64 gap-3 text-ui"><p class="font-medium text-foreground">Connect your phone</p> <ol class="grid list-decimal gap-1.5 pl-5 text-muted-foreground"><li>Install Tailscale on your phone and sign in with the same account.</li> <li>Scan this code with the phone's camera.</li> <li>Add Nerve to the home screen to get notifications.</li></ol> <!> <div class="flex min-w-0 items-center gap-2"><span class="min-w-0 truncate font-mono text-caption"> </span> <!></div></div></div>`);function bb(e,n){c(n,!0);let r=Y(void 0),i=Y(void 0),a=Y(U(Date.now())),o=L(()=>t(r)?new URL(`/#pair=${t(r).code}`,n.url).href:void 0),s=L(()=>new URL(n.url).origin),u=L(()=>t(r)?Math.max(0,Math.ceil((t(r).expiresAt-t(a))/1e3)):0),d=L(()=>!!t(r)&&t(u)===0);async function f(){B(i,void 0);try{B(r,await qf(`mobile`,300),!0),B(a,Date.now(),!0)}catch(e){B(r,void 0),B(i,Vm(e),!0)}}W(()=>{n.url,f();let e=setInterval(()=>B(a,Date.now(),!0),1e3);return()=>clearInterval(e)});function p(e){let t=Math.floor(e/60);return t>0?`${t}:${String(e%60).padStart(2,`0`)}`:`${e}s`}var m=yb(),h=q(m),g=q(h),_=e=>{var n=hb();qy(q(n),{get value(){return t(o)},label:`QR code that connects your phone`}),x(n),F(()=>X(n,1,T(t(d)?`opacity-40`:void 0))),k(e,n)},v=e=>{var n=gb(),r=q(n),a=e=>{dn(e,{})};l(r,e=>{t(i)||e(a)}),x(n),k(e,n)};l(g,e=>{t(o)?e(_):e(v,-1)});var b=G(g,2),S=e=>{Q(e,{variant:`outline`,size:`sm`,onclick:()=>void f(),children:(e,t)=>{var n=_b(),r=R(n);cr(r,{}),y(),k(e,n)},$$slots:{default:!0}})},C=e=>{var n=vb(),r=z(n);F(e=>w(r,`Works once · ${e??``} left`),[()=>p(t(u))]),k(e,n)};l(b,e=>{t(d)||t(i)?e(S):t(r)&&e(C,1)}),x(h);var E=G(h,2),O=G(q(E),4),A=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return t(i)}})};l(O,e=>{t(i)&&e(A)});var j=G(O,2),M=q(j),N=z(M,!0),P=G(M,2);Mn(P,{get icon(){return sr},label:`Copy address`,onclick:()=>void ri(t(s))}),x(j),x(E),x(m),F(()=>{J(M,`title`,t(s)),w(N,t(s))}),k(e,m),D()}var xb=O(`<p class="text-muted-foreground"> </p>`),Sb=O(`<div class="flex min-w-0 items-center gap-2"><span class="min-w-0 truncate font-mono text-caption"> </span> <!></div>`),Cb=O(`<div class="flex gap-2"><!> <!></div>`),wb=O(`<div class="grid gap-2 text-ui" aria-live="polite"><p> </p> <!> <!> <!></div>`),Tb=O(`<!> <!>`,1),Eb=O(`<!> Pair a device`,1),Db=O(`<div class="flex items-center justify-between gap-3 text-ui"><span class="text-muted-foreground">See and revoke the phones and browsers you paired.</span> <!></div>`),Ob=O(`<!> <!> <!> <!> <!>`,1);function kb(e,n){c(n,!0);let r=K(n,`canRestartDaemon`,3,!1),i=K(n,`daemonRestarting`,3,!1),a=e=>e.editable?e.savedValue:e.activeValue;function o(e){return e.editable?void 0:`Set by ${e.source.name??e.source.kind}.`}let s=[{value:`443`,label:`443 (no port in the address)`},{value:`8443`,label:`8443`},{value:`10000`,label:`10000`}],u=L(()=>n.configuration?.application.network),d=L(()=>t(u)?!!a(t(u).tunnelEnabled):!1),p=L(()=>t(u)?a(t(u).tunnelHttpsPort):443),h=L(()=>pb(n.tunnel)),_=L(()=>t(u)?!!a(t(u).allowRemote):!1),v=L(()=>t(u)?!!a(t(u).mobileHttps):!1),b=Y(!1);function S(e){n.onConfigurationChange?.({application:{network:e}})}function C(e){S({tunnel:{enabled:t(d),httpsPort:t(p),...e}})}var E=f(),O=R(E),A=e=>{var c=Ob(),E=R(c);{let e=L(()=>av(n.configuration,[`network`]));iv(E,P(()=>t(e),{get canRestart(){return r()},get restarting(){return i()},get onRestart(){return n.onRestartDaemon}}))}var D=G(E,2);X_(D,{id:`tailscale`,title:`Anywhere, with Tailscale`,description:`Recommended. Only devices signed in to your Tailscale account can reach Nerve, and nothing is exposed to the internet.`,children:(e,r)=>{var i=Tb(),a=R(i);{let e=L(()=>o(t(u).tunnelEnabled)??`Needs Tailscale on this computer and on your phone.`),n=L(()=>!t(u).tunnelEnabled.editable);Sh(a,{label:`Private access`,get description(){return t(e)},get checked(){return t(d)},get disabled(){return t(n)},onCheckedChange:e=>C({enabled:e})})}var c=G(a,2),f=e=>{var r=Tb(),i=R(r),a=e=>{bb(e,{get url(){return n.tunnel.url}})},o=e=>{var n=wb(),r=q(n),i=z(r,!0),a=G(r,2),o=e=>{var n=xb(),r=z(n,!0);F(()=>w(r,t(h).detail)),k(e,n)};l(a,e=>{t(h).detail&&e(o)});var s=G(a,2),c=e=>{let n=L(()=>t(h).command);var r=Sb(),i=q(r),a=z(i,!0),o=G(i,2);Mn(o,{get icon(){return sr},label:`Copy command`,onclick:()=>void ri(t(n))}),x(r),F(()=>{J(i,`title`,t(n)),w(a,t(n))}),k(e,r)};l(s,e=>{t(h).command&&e(c)});var u=G(s,2),d=e=>{var n=Cb(),r=q(n),i=e=>{let n=L(()=>t(h).link);Q(e,{variant:`outline`,size:`sm`,onclick:()=>window.open(t(n).href,`_blank`,`noopener`),children:(e,r)=>{y();var i=g();F(()=>w(i,t(n).label)),k(e,i)},$$slots:{default:!0}})};l(r,e=>{t(h).link&&e(i)});var a=G(r,2),o=e=>{Q(e,{variant:`outline`,size:`sm`,onclick:()=>C({}),children:(e,t)=>{y();var n=g(`Try again`);k(e,n)},$$slots:{default:!0}})};l(a,e=>{t(h).retry&&e(o)}),x(n),k(e,n)};l(u,e=>{(t(h).link||t(h).retry)&&e(d)}),x(n),F(()=>{X(r,1,T(t(h).tone===`warning`?`text-warning`:``)),w(i,t(h).summary)}),k(e,n)};l(i,e=>{n.tunnel?.state===`ready`?e(a):e(o,-1)});var c=G(i,2);{let e=(e,n=m)=>{{let r=L(()=>String(t(p)));lr(e,{get items(){return s},get value(){return t(r)},ariaLabel:`Tailscale port`,get disabled(){return n()},onValueChange:e=>C({httpsPort:Number(e)})})}},n=L(()=>!t(u).tunnelHttpsPort.editable);Q_(c,{label:`Port`,description:`Change it only if another service already uses this port on Tailscale.`,get disabled(){return t(n)},control:e,$$slots:{control:!0}})}k(e,r)};l(c,e=>{t(d)&&e(f)}),k(e,i)},$$slots:{default:!0}});var O=G(D,2);X_(O,{id:`local-network`,title:`On the same network`,description:`For phones and computers on your Wi-Fi or home network.`,actions:e=>{var n=f(),r=R(n),i=e=>{Q(e,{size:`sm`,variant:`outline`,onclick:()=>B(b,!0),children:(e,t)=>{var n=Eb();Yh(R(n),{}),y(),k(e,n)},$$slots:{default:!0}})};l(r,e=>{t(_)&&e(i)}),k(e,n)},children:(e,n)=>{var r=Tb(),i=R(r);{let e=L(()=>o(t(u).allowRemote)??`Each device pairs once with a code from this computer.`),n=L(()=>!t(u).allowRemote.editable);Sh(i,{label:`Allow devices on this network`,get description(){return t(e)},get checked(){return t(_)},get disabled(){return t(n)},onCheckedChange:e=>S({allowRemote:e})})}var s=G(i,2),c=e=>{var n=Tb(),r=R(n);{let e=L(()=>o(t(u).mobileHttps)??`Lets a phone install Nerve as an app. The phone trusts Nerve's certificate once while pairing.`),n=L(()=>!t(u).mobileHttps.editable);Sh(r,{label:`HTTPS for phones`,get description(){return t(e)},get checked(){return t(v)},get disabled(){return t(n)},onCheckedChange:e=>S({mobileHttps:e})})}var i=G(r,2),s=e=>{{let n=L(()=>String(a(t(u).httpsPort))),r=L(()=>!t(u).httpsPort.editable),i=L(()=>o(t(u).httpsPort));nv(e,{id:`settings-https-port`,label:`HTTPS port`,type:`number`,min:1,max:65535,get value(){return t(n)},get disabled(){return t(r)},get hint(){return t(i)},onValueChange:e=>{let t=Number(e);Number.isInteger(t)&&t>=1&&S({httpsPort:t})}})}};l(i,e=>{t(v)&&e(s)}),k(e,n)};l(s,e=>{t(_)&&e(c)}),k(e,r)},$$slots:{actions:!0,default:!0}});var A=G(O,2),j=e=>{var t=Db(),r=G(q(t),2);Q(r,{variant:`outline`,size:`sm`,get onclick(){return n.onOpenDevices},children:(e,t)=>{y();var n=g(`Manage devices`);k(e,n)},$$slots:{default:!0}}),x(t),k(e,t)};l(A,e=>{n.onOpenDevices&&e(j)}),eb(G(A,2),{secureTransport:window.location.protocol===`https:`,createCode:()=>qf(`mobile`),get open(){return t(b)},set open(e){B(b,e,!0)}}),k(e,c)};l(O,e=>{n.configuration&&t(u)&&e(A)}),k(e,E),D()}function Ab(){let e=$n(`access.device_paired`,e=>{let t=e.data.device;t?.name&&oi(wy(t.name),{kind:`success`})}),t=$n(`access.tunnel_changed`,e=>{let t=e.data.status;t&&Md(t)});return()=>{e(),t()}}function jb(e){return e.ios&&!e.standalone?`needs-install`:e.apis?e.permission===`denied`?`blocked`:e.subscribed&&e.permission===`granted`?`on`:`off`:`unsupported`}var Mb={unsupported:`Not supported on this browser`,"needs-install":`Add Nerve to your Home Screen first`,blocked:`Blocked in browser settings`,off:`Off`,on:`On`},Nb=U({status:`off`,loading:!0,busy:!1,error:void 0}),Pb,Fb=!1;function Ib(){return/iPhone|iPad|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function Lb(){return window.matchMedia(`(display-mode: standalone)`).matches||navigator.standalone===!0}function Rb(){return{apis:`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window,ios:Ib(),standalone:Lb(),permission:`Notification`in window?Notification.permission:void 0,subscribed:Fb}}function zb(){Nb.status=jb(Rb())}async function Bb(){Nb.loading=!0;try{let e=await np();Pb=e.publicKey,Fb=e.subscribed,Nb.error=void 0}catch{Nb.error=`Could not reach Nerve.`}finally{Nb.loading=!1,zb()}}async function Vb(){return(await navigator.serviceWorker.ready).pushManager.getSubscription()}async function Hb(){if(!Nb.busy){Nb.busy=!0,Nb.error=void 0;try{if(await Notification.requestPermission()!==`granted`)return;if(!Pb)throw Error(`Missing push key`);let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription()??await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Pb});await rp(yi.parse(t.toJSON())),Fb=!0}catch{Nb.error=`Could not turn on notifications. Try again.`}finally{Nb.busy=!1,zb()}}}async function Ub(){if(!Nb.busy){Nb.busy=!0,Nb.error=void 0;try{await ip(),Fb=!1,await(await Vb())?.unsubscribe()}catch{Nb.error=`Could not turn off notifications. Try again.`}finally{Nb.busy=!1,zb()}}}async function Wb(){Nb.error=void 0;try{await ap()}catch{Nb.error=`Could not send the test notification.`}}var Gb=600;function Kb(){let e=document.getElementById(`startup-splash`);e&&!e.classList.contains(`is-dismissed`)&&(e.classList.add(`is-complete`),window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?e.remove():requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.classList.add(`is-dismissed`),window.setTimeout(()=>e.remove(),Gb)})}))}function qb(){document.getElementById(`startup-splash`)?.classList.add(`is-hidden`)}function Jb(){let e=document.getElementById(`startup-splash`);return!e||e.classList.contains(`is-dismissed`)?!1:(e.classList.remove(`is-hidden`),!0)}function Yb(e){let t=document.getElementById(`startup-splash-status`);if(!t)return!1;t.textContent!==e.status&&(t.classList.remove(`is-swapping`),t.offsetWidth,t.textContent=e.status,t.classList.add(`is-swapping`));let n=document.getElementById(`startup-splash-detail`);n&&(n.textContent=e.detail??``,n.hidden=!e.detail);let r=document.getElementById(`startup-splash-meter`),i=document.getElementById(`startup-splash-fill`);return r&&i&&(e.meter?(r.setAttribute(`aria-valuemin`,`0`),r.setAttribute(`aria-valuemax`,String(e.meter.total)),r.setAttribute(`aria-valuenow`,String(e.meter.done)),i.style.animation=`none`,i.style.transform=`scaleX(${e.meter.fraction})`):(r.removeAttribute(`aria-valuenow`),i.style.animation=``,i.style.transform=``)),!0}var Xb=`inline-flex h-6 shrink-0 items-center gap-1.5 rounded-sm px-1.5 text-ui text-muted-foreground tabular-nums max-sm:h-9 max-sm:px-2.5`,Zb=`${Xb} cursor-pointer transition-colors hover:bg-muted hover:text-foreground`,Qb=new Set([`$$slots`,`$$events`,`$$legacy`]);function $b(e,t){let n=V(t,Qb),r=[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`}]];Z(e,P({name:`activity`},()=>n,{get iconNode(){return r}}))}var ex=new Set([`$$slots`,`$$events`,`$$legacy`]);function tx(e,t){let n=V(t,ex),r=[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`}],[`path`,{d:`M8 10v4`}],[`path`,{d:`M12 10v2`}],[`path`,{d:`M16 10v6`}]];Z(e,P({name:`folder-kanban`},()=>n,{get iconNode(){return r}}))}var nx=`.worktrees`,rx=100,ix=e=>e===`-`||e===`.`;function ax(e){let t=0,n=e.length;for(;t<n&&ix(e[t]);)t++;for(;n>t&&ix(e[n-1]);)n--;return e.slice(t,n)}function ox(e){return ax(ax(e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`)).slice(0,rx))}function sx(e,t={}){let n=ox(e);if(!n)return``;let r=t.multiRepo&&t.repoName?ox(t.repoName):``;return r?ox(`${r}-${n}`):n}function cx(e){return e.length>0&&e.length<=rx&&/^[a-z0-9][a-z0-9._-]*$/.test(e)&&!e.endsWith(`.`)}function lx(e,t){let n=e;for(let r=2;t.has(n);r++)n=`${e}-${r}`;return n}function ux(e,t,n){e.observeStarted({id:n,kind:`git.${t.kind}`,title:bi(t),scope:{projectId:t.projectId,repositoryPath:t.repo}})}function dx(e,t,n){e.observeStarted({id:n.operationId,kind:`git.${t.kind}.all`,title:xi(t.kind),scope:{projectId:t.projectId}});let r=[...new Set(t.repos)];n.childOperationIds.forEach((i,a)=>{e.observeStarted({id:i,parentId:n.operationId,kind:`git.${t.kind}`,title:bi({kind:t.kind,repo:r[a]??`repository`}),scope:{projectId:t.projectId,repositoryPath:r[a]}})})}function fx(e,t,n){return e.filter(e=>e.kind.startsWith(`git.`)&&e.scope?.projectId===t&&(n===void 0||e.scope.repositoryPath===n||e.kind.endsWith(`.all`))&&(e.status===`queued`||e.status===`running`))}function px(e,t,n){let r=fx(e,t,n).filter(e=>e.scope?.repositoryPath===n),i=e=>r.some(t=>t.kind===`git.${e}`);return{operationIds:r.map(e=>e.id),fetching:i(`fetch`),pulling:i(`pull`),pushing:i(`push`),syncing:i(`sync`),switchingBaseAndPulling:i(`switchBaseAndPull`)}}var mx=[{minCount:9,maxLength:12},{minCount:5,maxLength:16},{minCount:0,maxLength:22}];function hx(e){return e.relativePath===`.`?`project root`:e.relativePath}function gx(e,t={}){let n=mx.find(t=>e.length>=t.minCount);return new Map([...cn(e.map(e=>({id:e.relativePath,name:e.name,path:e.absDir})),{maxLength:t.maxLength??n?.maxLength??22})].map(([e,{label:t}])=>[e,t]))}function _x(e){return e.index===`D`||e.worktree===`D`?`destructive`:e.untracked||e.index===`A`?`success`:e.index===`R`||e.worktree===`R`?`info`:`warning`}function vx(e){return ns[_x(e)]}function yx(e,t){if(e.untracked)return`?`;let n=t===`staged`?e.index:e.worktree;return n===` `?e.index===` `?`M`:e.index:n}function bx(e,t){let n=t===`staged`?e.index:e.worktree;if(e.untracked)return`untracked`;switch(n){case`A`:return`added`;case`D`:return`deleted`;case`R`:return`renamed`;case`M`:return`modified`;case`U`:return`conflict`;default:return t}}var xx=e=>e.worktreeGroup,Sx=e=>e.primaryWorktree,Cx=e=>e.stashCount;function wx(e){return e.absDir.split(/[\\/]/).filter(Boolean).at(-1)??e.name}var Tx={failed:5,running:4,behind:3,diverged:3,unpublished:2,ahead:1,none:0};function Ex(e){return!(!e.hasRemote||e.detached||!e.currentBranch||e.hasUpstream)}function Dx(e,t){let n=e.behind??0,r=e.ahead??0,i=e.unpublishedCount??0,a=e=>({kind:e,behind:n,ahead:r,unpublished:i});return t.failed(e)?a(`failed`):t.running(e)?a(`running`):n>0?a(r>0?`diverged`:`behind`):Ex(e)?a(`unpublished`):a(r>0?`ahead`:`none`)}var Ox=e=>Tx[e.kind],kx={failing:3,pending:2,passing:1,none:0},Ax=e=>!!(e&&e.state.toUpperCase()===`OPEN`),jx=e=>e?.state.toUpperCase()===`MERGED`;function Mx(e,t){if(t.failed(e))return!0;let n=t.pullRequest(e);if(Ax(n)&&n.checks.status===`failing`||jx(n)||e.mergedToBase&&!e.onBaseBranch)return!0;let r=e.behind??0,i=e.ahead??0;return r>0&&(i>0||e.dirty||e.changeCount>0)}function Nx(e,t){let n={kind:`none`,behind:0,ahead:0,unpublished:0},r,i,a=0;for(let o of e){a+=o.changeCount;let e=Dx(o,t);Ox(e)>Ox(n)&&(n=e,r=o);let s=t.pullRequest(o);Ax(s)&&(!i||kx[s.checks.status]>kx[i.checks.status])&&(i=s)}return{sync:n,...r?{syncRepo:r}:{},...i?{pullRequest:i}:{},changes:a}}function Px(e){let t=Array.from(e);return t.length<=22?{head:e,tail:``}:{head:t.slice(0,-10).join(``),tail:t.slice(-10).join(``)}}var Fx=(e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`})||(e<t?-1:+(e>t));function Ix(e){let t=new Map;for(let n of e){let e=xx(n),r=t.get(e);r?r.push(n):t.set(e,[n])}let n=[...t].map(([e,t])=>{let n=[...t].sort((e,t)=>Number(Sx(t))-Number(Sx(e))||Fx(wx(e),wx(t)));return{key:e,repos:n,primary:n[0]}}),r=gx(n.map(e=>e.primary),{maxLength:40});return n.map(({key:e,repos:t,primary:n})=>({key:e,name:r.get(n.relativePath)??n.name,primary:n,repos:t})).sort((e,t)=>Fx(e.name,t.name))}function Lx(e){return Ix(e)[0]?.repos[0]?.relativePath}function Rx(e,t){let n=new Map;for(let r of e?.repos??[])r.relativePath!==t?.relativePath&&r.currentBranch&&n.set(r.currentBranch,wx(r));return n}function zx(e,t,n){if(n.length===0)return!0;let r=[e.name,t.name,wx(t),t.currentBranch??`detached`].join(` `).toLowerCase();return n.every(e=>r.includes(e))}function Bx(e,t){let n=t.search.toLowerCase().split(/\s+/).filter(Boolean),r=[];for(let i of e){let e=i.repos.filter(e=>zx(i,e,n)?t.filter===`changed`?e.changeCount>0:t.filter!==`attention`||Mx(e,t.context):!1);e.length>0&&r.push({group:i,repos:e})}return r}function Vx(e,t){return{all:e.length,changed:e.filter(e=>e.changeCount>0).length,attention:e.filter(e=>Mx(e,t)).length}}function Hx(e,t,n){if(!n)return;let r=e.find(e=>e.relativePath===t);if(!r)return;let i=xx(r),a=e.find(e=>xx(e)===i&&!e.detached&&e.currentBranch===n);if(a)return Sx(a)?{kind:`primary`,repo:a}:{kind:`linked`,repo:a}}var Ux=`nerve:git-panel:v1:`,Wx=`nerve:git-panel-layout:v3`,Gx=.05,Kx=.9,qx=()=>({filter:`all`,expanded:null,selected:null}),Jx=()=>({listSize:null,branch:{collapsed:!1,size:null},changes:{collapsed:!0}});function Yx(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}var Xx=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function Zx(e,t){try{let n=JSON.parse(e.getItem(t)??`null`);return Xx(n)?n:void 0}catch{return}}function Qx(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`))]:null}function $x(e,t=Yx()){let n=qx(),r=t&&Zx(t,Ux+e);if(!r)return n;let i=r.filter;return{filter:i===`changed`||i===`attention`||i===`all`?i:n.filter,expanded:Qx(r.expanded),selected:typeof r.selected==`string`?r.selected:null}}function mte(e,t){let n=Zx(e,t)?.usedAt;return typeof n==`number`?n:0}function eS(e,t=50){let n=[];for(let t=0;t<e.length;t++){let r=e.key(t);r?.startsWith(Ux)&&n.push(r)}n.length<=t||n.map(t=>({key:t,at:mte(e,t)})).sort((e,t)=>e.at-t.at).slice(0,n.length-t).forEach(({key:t})=>e.removeItem(t))}function tS(e,t,n=Yx(),r=Date.now()){if(n)try{n.setItem(Ux+e,JSON.stringify({...t,usedAt:r})),eS(n)}catch{}}function nS(e,t){return{...e,expanded:e.expanded?e.expanded.filter(e=>t.groups.has(e)):null,selected:e.selected&&t.worktrees.has(e.selected)?e.selected:null}}var rS=(e,t)=>Xx(e)&&typeof e.collapsed==`boolean`?e.collapsed:t;function iS(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(Kx,Math.max(Gx,e)):null}function aS(e=Yx()){let t=Jx(),n=e&&Zx(e,Wx);if(!n)return t;let r=n.branch;return{listSize:iS(n.listSize),branch:{collapsed:rS(r,t.branch.collapsed),size:iS(Xx(r)?r.size:void 0)},changes:{collapsed:rS(n.changes,t.changes.collapsed)}}}function oS(e,t=Yx()){if(t)try{t.setItem(Wx,JSON.stringify(e))}catch{}}var sS=class{#e=Y(`all`);get filter(){return t(this.#e)}set filter(e){B(this.#e,e,!0)}#t=Y(``);get search(){return t(this.#t)}set search(e){B(this.#t,e,!0)}#n=Y(null);get selected(){return t(this.#n)}set selected(e){B(this.#n,e,!0)}expanded=new mo;expansionKnown=!1;projectId;constructor(e){this.projectId=e;let t=$x(e);this.filter=t.filter,this.selected=t.selected,t.expanded&&(this.expansionKnown=!0,t.expanded.forEach(e=>this.expanded.add(e)))}save(){tS(this.projectId,{filter:this.filter,expanded:this.expansionKnown?[...this.expanded]:null,selected:this.selected})}setFilter(e){this.filter=e,this.save()}select(e){this.selected!==e&&(this.selected=e,this.save())}setExpanded(e,t){this.expansionKnown=!0,t?this.expanded.add(e):this.expanded.delete(e),this.save()}reconcile(e,t){let n=new mo(e.map(xx)),r=new mo(e.map(e=>e.relativePath)),i=nS({filter:this.filter,expanded:this.expansionKnown?[...this.expanded]:null,selected:this.selected},{groups:n,worktrees:r});if(i.expanded)for(let e of[...this.expanded])i.expanded.includes(e)||this.expanded.delete(e);if(this.selected=i.selected,!this.expansionKnown&&e.length>0){let n=e.find(e=>e.relativePath===t),r=n?xx(n):Ix(e)[0]?.key;r&&this.expanded.add(r),this.expansionKnown=!0}this.save()}},cS=new Map;function lS(e){let t=cS.get(e);return t||(t=new sS(e),cS.set(e,t)),t}var uS=class{#e=Y(null);get listSize(){return t(this.#e)}set listSize(e){B(this.#e,e,!0)}#t=Y(U(Jx().branch));get branch(){return t(this.#t)}set branch(e){B(this.#t,e,!0)}#n=Y(U(Jx().changes));get changes(){return t(this.#n)}set changes(e){B(this.#n,e,!0)}timer;constructor(){let e=aS();this.listSize=e.listSize,this.branch=e.branch,this.changes=e.changes}snapshot(){return{listSize:this.listSize,branch:{...this.branch},changes:{...this.changes}}}save(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=void 0,oS(this.snapshot())},300)}},dS;function fS(){return dS??=new uS,dS}function pS(e){return JSON.stringify({projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos.map(e=>({relativePath:e.relativePath,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,unpublishedCount:e.unpublishedCount,stashCount:e.stashCount,worktreeGroup:e.worktreeGroup,primaryWorktree:e.primaryWorktree,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})),github:e.github?{available:e.github.available,authenticated:e.github.authenticated}:void 0})}var mS=`nerve.git.changeTreeCollapsed.v1`,hS=2e3;function gS(){if(typeof localStorage<`u`)return localStorage}function _S(e,t){return`${mS}:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function vS(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&e.trim().length>0))].slice(0,hS):[]}function yS(e,t,n=gS()){if(!n)return[];try{let r=n.getItem(_S(e,t));return r?vS(JSON.parse(r)):[]}catch{return[]}}function bS(e,t,n,r=gS()){if(!r)return;let i=vS([...n]),a=_S(e,t);try{i.length===0?r.removeItem(a):r.setItem(a,JSON.stringify(i))}catch{}}function xS(e){return JSON.stringify(e.map(e=>({name:e.name,current:e.current,remote:e.remote,upstream:e.upstream,updatedAt:e.updatedAt})))}function SS(e){if(e)return JSON.stringify({available:e.available,authenticated:e.authenticated,login:e.login,reason:e.reason})}var CS=U({projects:{}}),wS=8;function TS(e,t){let n=()=>px(va.activities,e??``,t??`.`);return{get fetching(){return n().fetching},get pulling(){return n().pulling},get pushing(){return n().pushing},get syncing(){return n().syncing},get switchingBaseAndPulling(){return n().switchingBaseAndPulling},switchingBranch:void 0,deletingBranch:void 0,creatingBranch:!1,fileMutation:void 0,bulkMutation:void 0,stashMutation:void 0}}function ES(e,t){return{branches:[],collapsedChangeTreeFolders:new mo(e&&t?yS(e,t):[]),operations:TS(e,t),loadingBranches:!1}}function DS(e){return{projectId:e,repoStates:{},touchedAt:Date.now()}}function OS(){let e=Object.values(CS.projects).sort((e,t)=>t.touchedAt-e.touchedAt);for(let t of e.slice(wS))delete CS.projects[ds(t.projectId)]}function kS(e,t){let n=ds(e),r=!CS.projects[n],i=CS.projects[n]??=DS(e);return i.touchedAt=Date.now(),r&&OS(),i.repoStates[cs(t)]??=ES(e,t)}function AS(e,t,n,r){let i=kS(e,t);r?i.collapsedChangeTreeFolders.delete(n):i.collapsedChangeTreeFolders.add(n),bS(e,t,i.collapsedChangeTreeFolders)}function jS(e){if(e instanceof Error){try{let t=JSON.parse(e.message);if(t?.error?.message)return String(t.error.message)}catch{}return e.message}return String(e)}function MS(e,t){let n=xS(t);return e.lastBranchesFingerprint!==n&&(e.branches=t,e.lastBranchesFingerprint=n,!0)}function NS(e,t){let n=SS(t);return e.lastGithubFingerprint!==n&&(e.github=t,e.lastGithubFingerprint=n,!0)}function PS(e,t){let n=ps(e)?.summaries.find(e=>e.relativePath===t);return!!(n?.hasRemote&&n.hasGithubRemote)}function FS(e,t){(t.github!==void 0||t.lastGithubFingerprint!==void 0)&&(t.github=void 0,t.lastGithubFingerprint=void 0,zS(e))}function IS(e){let t=ps(e)?.summaries??[],n=lS(e).selected;return n&&t.some(e=>e.relativePath===n)?n:Lx(t)??t[0]?.relativePath??`.`}function LS(e,t){t!==IS(e)&&(lS(e).select(t),zS(e))}function RS(e){let t=ps(e);if(!t?.loaded)return;let n=CS.projects[ds(e)]?.repoStates[cs(IS(e))]?.github;return{projectId:e,projectIsRepo:t.projectIsRepo,repos:t.summaries,github:n?{available:n.available,authenticated:n.authenticated}:void 0,loadedAt:Date.now()}}function zS(e){let t=RS(e);if(!t)return;let n=Lo.gitContext;n&&n.projectId===t.projectId&&pS(n)===pS(t)||(Lo.gitContext=t)}async function BS(e,t,n,r=!1){let i=kS(e,t);i.loadingBranches=!0;try{let n=Le.git.branches(e,t);r&&await Be.invalidateQueries({queryKey:n}),MS(i,(await Be.fetchQuery({queryKey:n,queryFn:()=>Oe(e,t),staleTime:ya})).branches)}catch(e){let t=jS(e);n?es(n,t):ui.error(`Could not list branches: ${t}`)}finally{i.loadingBranches=!1}}async function VS(e,t,n=!1,r){let i=kS(e,t);if(!PS(e,t))FS(e,i);else try{let r=Le.git.githubStatus(e,t);n&&await Be.invalidateQueries({queryKey:r}),NS(i,await Be.fetchQuery({queryKey:r,queryFn:()=>Ce(e,t),staleTime:i.github?.authenticated?xa:ya})),zS(e)}catch(t){NS(i,{available:!1,authenticated:!1,login:null,reason:jS(t)}),zS(e),r&&es(r,jS(t))}}var HS,US;function WS(e){HS!==e&&(US?.(),US=void 0,HS=e,e&&(US=ms({projectId:e,visible:!0})))}function GS(){let e=ys(e=>{e===HS&&zS(e)});return()=>{e(),WS(void 0)}}async function KS(e){let t=e??Wo.projectId;if(t){WS(t);try{if(await hs(t),!ps(t)?.loaded)return;await VS(t,IS(t)),zS(t)}catch{Lo.gitContext?.projectId===t&&(Lo.gitContext=void 0)}}}function qS(){WS(void 0),Lo.gitContext=void 0}function JS(e){let t=e??Wo.projectId;t&&hs(t)}var YS={activeCenterTab:void 0,activeProjectId:void 0},XS=YS;function ZS(e){return XS=e,()=>{XS===e&&(XS=YS)}}var QS={githubRepository(e){let t=wa(e,`.`);if(!t)return;let n=new _o(t);return`${n.host}${n.pathname}`.toLowerCase()},get activeCenterPrView(){let e=XS.activeCenterTab;if(e?.kind===`pr`)return Lo.prViews[us(e.id)]},get gitStatus(){let e=XS.activeProjectId,t=e?ps(e)?.summaries:void 0;if(!e||!t||t.length===0)return;let n=IS(e),r=t.find(e=>e.relativePath===n)??t[0];return{branch:r.currentBranch??`detached`,dirty:r.dirty,changeCount:r.changeCount,ahead:r.ahead,behind:r.behind,detached:r.detached,hasUpstream:r.hasUpstream,relativePath:r.relativePath,repoName:r.name,repoCount:t.length}}};function $S(e){return`${e.projectId}:${encodeURIComponent(e.repo)}:${e.area}:${encodeURIComponent(e.path)}`}function eC(e){Yo({kind:`diff`,id:e})}async function tC(e,t=!1){e.data?e.refreshing=!0:e.loading=!0,e.error=void 0,e.detailRevision=Cs(e.projectId,e.repo)?.revision;try{e.data=await Ie(e.projectId,e.repo,e.path,e.area),e.path=e.data.path,e.renamedFrom=e.data.renamedFrom}catch(n){let r=n instanceof Error?n.message:String(n);e.error=r,t&&es(`Could not load diff`,r)}finally{e.loading=!1,e.refreshing=!1}}async function nC(e){if(e.projectId!==Ds.selectedProjectId){let{selectProject:t}=await Os(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-DE0mQsY6.js`).then(e=>e.m);return{selectProject:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));await t(e.projectId)}let t=$S(e),n=fs(t);Lo.diffViews[n]??={id:t,...e,wrapLines:Bo.wrapLongLines,loading:!1,refreshing:!1},eC(t),Ko({kind:`diff`,id:t}),await tC(Lo.diffViews[n],!0)}async function rC(e){let t=Lo.diffViews[fs(e)];t&&(eC(e),Ko({kind:`diff`,id:e}),!t.data&&!t.loading&&await tC(t))}async function iC(e){let t=Lo.diffViews[fs(e)];t&&!t.loading&&!t.refreshing&&await tC(t,!0)}function aC(e){let t=Lo.diffViews[fs(e)];if(!t)return;let n=!t.wrapLines;t.wrapLines=n,Ro(n)}function oC(e){let t={kind:`diff`,id:e},n=Ds.activeCenterTab?.kind===`diff`&&Ds.activeCenterTab.id===e,r=Go(t);Zo(t),delete Lo.diffViews[fs(e)],n&&qo(r)}function sC(){return W(()=>{let e=Ds.activeCenterTab,t=e?.kind===`diff`?Lo.diffViews[fs(e.id)]:void 0;if(!t)return;let{projectId:n,repo:r}=t,i=_s(()=>({projectId:n,visible:!1,detail:[r]})),a=Cs(n,r)?.revision;return a!==void 0&&a>=0&&(t.detailRevision===void 0?t.detailRevision=a:t.detailRevision!==a&&!t.loading&&!t.refreshing&&tC(t)),i}),()=>void 0}function cC(e,t,n){return`${e}:${encodeURIComponent(t)}:${n}`}function lC(){return{loading:!1,refreshing:!1}}function uC(e){return{...e,core:lC(),conversation:lC(),overview:lC(),commits:lC(),checks:lC(),files:lC(),fileDiffs:{},activeTab:`conversation`,refreshing:!1,merging:!1}}function dC(e){Yo({kind:`pr`,id:e})}async function fC(e){e.activeTab===`conversation`&&(!e.core.data||!e.conversation.data||!e.overview.data)?await Ca(e,{silent:!!(e.core.data||e.conversation.data||e.overview.data)})&&ja(e):(await Pa(e,{silent:!!e.core.data}),ja(e))}async function pC(e){if(e.projectId!==Ds.selectedProjectId){let{selectProject:t}=await Os(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-DE0mQsY6.js`).then(e=>e.m);return{selectProject:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));await t(e.projectId)}let t=cC(e.projectId,e.repo,e.number),n=us(t);dC(t);let r=Oa(e.projectId,e.repo,e.number);Lo.prViews[n]??=uC({id:t,...e,summary:r});let i=Lo.prViews[n];r&&(i.summary=r),r&&!i.checks.data&&(i.checks.data={checks:r.checks}),Ko({kind:`pr`,id:t}),await fC(i)}async function mC(e){let t=Lo.prViews[us(e)];t&&(dC(e),Ko({kind:`pr`,id:e}),await fC(t))}async function hC(e){let t=Lo.prViews[us(e)];t&&await Fa(t)}function gC(e,t){let n=Lo.prViews[us(e)];n&&(n.activeTab=t,Ma(n,t),ja(n))}function _C(e,t){let n=Lo.prViews[us(e)];n&&(n.selectedFilePath=t,ka(n,t,{silent:!0}))}function vC(e){let t=Lo.prViews[us(e)];t?.selectedFilePath&&ka(t,t.selectedFilePath,{force:!0})}function yC(e,t){let n=Lo.prViews[us(e)];n&&(n.selectedMergeMethod=t)}function bC(e){let t={kind:`pr`,id:e},n=Ds.activeCenterTab?.kind===`pr`&&Ds.activeCenterTab.id===e,r=Go(t);Zo(t),delete Lo.prViews[us(e)],n&&qo(r)}function xC(){let e=La(),t=Ss(),n=GS();return()=>{n(),t(),e()}}function SC(e){let t,n=!1;return{update(r,i){r&&(n&&i===t||(n=!0,t=i,e(i)))}}}function CC(e){return!!(e.progressiveActive&&e.enabled&&e.projectId&&e.projectId!==e.lastProjectId)}var wC=e=>`git.${e===`switch-base-and-pull`?`switchBaseAndPull`:e}`;function TC(e,t,n){let r=wC(n),i=e=>e.kind===r&&e.scope?.repositoryPath===t;return e.find(e=>i(e)&&e.status===`running`)??e.find(e=>i(e)&&e.status===`queued`)}var EC=[`fetch`,`pull`,`push`,`sync`,`switch-base-and-pull`];function DC(e,t){for(let n of EC){let r=TC(e,t,n);if(r)return r}}function OC(e,t){return!!DC(e,t)}var kC=e=>`${e} ${e===1?`commit`:`commits`}`;function AC(e){if(!e.detached&&e.currentBranch&&!e.hasUpstream){let t=e.unpublishedCount??0;return{operation:`push`,parts:t>0?[`${t}`]:[],label:`Publish branch`,help:`Publish ${e.currentBranch} to origin${t>0?` (${kC(t)})`:``}`}}let t=e.behind??0,n=e.ahead??0;return t>0&&n===0?{operation:`pull`,parts:[`${t}`],label:`Pull`,help:`Pull ${kC(t)}`}:n>0&&t===0?{operation:`push`,parts:[`${n}`],label:`Push`,help:`Push ${kC(n)}`}:n>0&&t>0?{operation:`sync`,parts:[`↓${t}`,`↑${n}`],label:`Sync`,help:`Sync: pull ${kC(t)}, push ${kC(n)}`}:{operation:`sync`,parts:[],label:`Sync`,help:`Up to date · Sync fetches remote changes`}}function jC(e){return EC.find(t=>wC(t)===e.kind)}function MC(e,t){let n=e.filter(e=>e.scope?.repositoryPath===t&&jC(e));if(n.some(e=>_i(e)))return;let r=e=>Date.parse(e.finishedAt??e.updatedAt),i=n.reduce((e,t)=>!e||r(t)>=r(e)?t:e,void 0);return i?.status===`failed`?i:void 0}function NC(e){return{staged:e.filter(e=>e.staged),unstaged:e.filter(e=>e.untracked||e.worktree!==` `)}}function PC(e,t,n){let r=NC(e)[t];return n?r.filter(e=>e.path===n||e.path.startsWith(`${n}/`)):r}function FC(e){return[...new Set(e.flatMap(e=>e.renamedFrom?[e.path,e.renamedFrom]:[e.path]))]}function IC(e,t){return`${e}:group:${JSON.stringify(t)}`}function LC(e,t,n){return new Set([...qt(e)].filter(e=>!n.has(`${t}:${e}`)))}function RC(e){if(!e.remote)return e.name;let t=e.name.indexOf(`/`);return t===-1?e.name:e.name.slice(t+1)}function zC(e){if(!e.updatedAt)return-1/0;let t=Date.parse(e.updatedAt);return Number.isNaN(t)?-1/0:t}function BC(e){let t=e.trim();return t.length>0&&!/\s/.test(t)&&!t.startsWith(`-`)&&!t.startsWith(`/`)&&!t.endsWith(`/`)&&!t.includes(`..`)&&!/[\u0000-\u001f~^:?*[\\]/.test(t)}function VC(e,t){return!e.remote&&!e.current&&e.name!==t}function hte(e,t=Date.now()){let n=js(e??void 0,{style:`long`,now:t});return n?`Updated ${n}`:`Update time unavailable`}function HC(e,t,n,r,i=Date.now()){let a=new Map;if(r){let e=r.repository.toLocaleLowerCase();for(let t of r.prs)t.headRepository?.toLocaleLowerCase()===e&&(a.has(t.headRefName)||a.set(t.headRefName,t))}let o=t.trim().toLocaleLowerCase(),s=e.map(e=>{let t=a.get(RC(e));return{branch:e,...t?{pullRequest:t}:{},updatedLabel:hte(e.updatedAt,i)}}).filter(({branch:e,pullRequest:t})=>!o||[e.name,e.upstream??``,t?`#${t.number}`:``].some(e=>e.toLocaleLowerCase().includes(o))),c=(e,t)=>{if(e.branch.current!==t.branch.current)return e.branch.current?-1:1;let r=!e.branch.remote&&n!==void 0&&e.branch.name===n;return r===(!t.branch.remote&&n!==void 0&&t.branch.name===n)?zC(t.branch)-zC(e.branch)||e.branch.name.localeCompare(t.branch.name):r?-1:1};return{all:[...s].sort(c),local:s.filter(({branch:e})=>!e.remote).sort(c),remote:s.filter(({branch:e})=>e.remote).sort(c)}}function gte(e,t,n){return!e.has(t)||n===0}function _te(e,t){let n=()=>e().availability.available,r=t=>n()&&e().capabilities.remote[t].enabled;return{runBulkRemoteOperation:e=>{if(r(e))return t.runBulkRemoteOperation?.(e)},cancelOperation:r=>{if(n()&&e().activeOperations?.some(e=>e.id===r&&e.actions.cancel))return t.cancelOperation?.(r)},refreshAll:()=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshAll()},refreshRepository:r=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshRepository(r)},loadStashes:r=>n()&&e().capabilities.stashes.enabled?t.loadStashes(r):Promise.resolve(void 0),refreshBranches:r=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshBranches(r)},expectPullRequest:(e,n,r)=>t.expectPullRequest?.(e,n,r),loadPullRequestBadges:r=>{if(n()&&e().capabilities.refresh.enabled)return t.loadPullRequestBadges(r)},refreshPullRequests:r=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshPullRequests(r)},configurePullRequests:e=>{if(n())return t.configurePullRequests(e)},resetPullRequestConfig:()=>{if(n())return t.resetPullRequestConfig()},setPullRequestQuickFilter:e=>{if(n())return t.setPullRequestQuickFilter(e)},selectRepository:r=>{if(n()&&e().capabilities.selectRepository.enabled)return t.selectRepository(r)},createBranch:(r,i)=>n()&&e().capabilities.branches.enabled?t.createBranch(r,i):!1,switchBranch:(r,i)=>n()&&e().capabilities.branches.enabled?t.switchBranch(r,i):!1,deleteBranch:(r,i)=>n()&&e().capabilities.branches.enabled?t.deleteBranch(r,i):!1,createWorktree:(r,i,a)=>n()&&e().capabilities.worktrees.enabled?t.createWorktree(r,i,a):!1,removeWorktree:(r,i)=>n()&&e().capabilities.worktrees.enabled?t.removeWorktree(r,i):!1,openDiff:(e,r,i)=>{if(n())return t.openDiff(e,r,i)},mutateFile:(r,i,a)=>{if(n()&&e().capabilities.mutateFiles.enabled)return t.mutateFile(r,i,a)},mutateFileScope:(r,i,a,o)=>{if(n()&&e().capabilities.bulkMutateFiles.enabled)return t.mutateFileScope(r,i,a,o)},createStash:(r,i,a)=>{if(n()&&e().capabilities.stashes.enabled)return t.createStash(r,i,a)},setChangeTreeFolderExpanded:(e,r,i)=>{if(n())return t.setChangeTreeFolderExpanded(e,r,i)},applyStash:(r,i)=>{if(n()&&e().capabilities.stashes.enabled)return t.applyStash(r,i)},dropStash:(r,i)=>{if(n()&&e().capabilities.stashes.enabled)return t.dropStash(r,i)},runRemoteOperation:(e,n)=>{if(r(n))return t.runRemoteOperation(e,n)},selectPullRequest:e=>{if(n())return t.selectPullRequest(e)},openPullRequest:(r,i)=>{if(n()&&e().capabilities.openPullRequest.enabled)return t.openPullRequest(r,i)}}}var UC={enabled:!0};function WC(e){return{enabled:!1,reason:e}}function GC(e,t){let n=t.filter(e=>e.hasGithubRemote),r=Object.fromEntries(n.map(e=>[e.relativePath,e.name]));return Ns(n.map(t=>({relativePath:t.relativePath,currentBranch:t.currentBranch,repositoryUrl:wa(e,t.relativePath)})),e=>r[e]??e)}function vte(e,t){return e===`rate_limited`?`Pull request updates are paused by GitHub’s rate limit.`:e===`unavailable`?`Pull request updates are unavailable.`:t||(e===`error`?`Pull request updates are temporarily unavailable.`:void 0)}function yte(e,t){let n=GC(e,t),r=[],i=!1,a=!1,o=!1,s=!1,c=!1,l,u=null;for(let t of n){let n=za(e,t.repository),d=ba(e,t.repository);s||=d.loading,c||=d.refreshing,n?(i=!0,u??=n.viewer,n.status===`unavailable`?a=!0:n.status===`unauthenticated`?o=!0:l??=vte(n.status,d.error),r.push({key:t.key,name:t.name,repository:t.repository,prs:n.prs,viewer:n.viewer,checkedOutBranches:t.checkedOutBranches,truncated:n.truncated})):l??=d.error}return{repositoryCount:n.length,sources:r,status:a?`unavailable`:o?`unauthenticated`:i?`ready`:`loading`,viewer:u,loading:s,refreshing:c,notice:l}}var KC={quick:`all`,filters:Rs};function qC(e){return`nerve:git-pr-panel:v1:${e}`}function JC(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function YC(e,t,n){return t.includes(e)?e:n}function XC(e){if(!e||typeof e!=`object`||Array.isArray(e))return KC;let t=e,n=t.filters&&typeof t.filters==`object`?t.filters:{};return{quick:YC(t.quick,[`all`,`mine`,`review`],`all`),filters:Hs({drafts:YC(n.drafts,[`include`,`exclude`,`only`],Rs.drafts),labels:Array.isArray(n.labels)?n.labels.filter(e=>typeof e==`string`):[],sort:YC(n.sort,[`updated-desc`,`updated-asc`],Rs.sort)})}}function bte(e,t=JC()){if(!t)return KC;try{return XC(JSON.parse(t.getItem(qC(e))??`null`))}catch{return KC}}function xte(e,t,n=JC()){if(n)try{n.setItem(qC(e),JSON.stringify(XC(t)))}catch{}}var ZC=U({}),Ste={};function QC(e){return ZC[e]||(Ste[e]??=bte(e))}function $C(e,t){let n={...QC(e),...t};ZC[e]=n,xte(e,n)}function Cte(e,t){$C(e,{quick:t})}function ew(e,t){$C(e,{filters:t})}var wte=U({query:``});function tw(e,t){es(e,kee(t))}async function nw(e){try{let{operationId:t}=await Te(e);ux(va,e,t)}catch(e){tw(`Could not start Git operation`,e)}}function Tte(e,t){return nw({projectId:e,repo:t,kind:`fetch`})}function Ete(e,t){return nw({projectId:e,repo:t,kind:`pull`})}function Dte(e,t){return nw({projectId:e,repo:t,kind:`push`})}function Ote(e,t){return nw({projectId:e,repo:t,kind:`sync`})}function kte(e,t){return nw({projectId:e,repo:t,kind:`switchBaseAndPull`})}async function Ate(e,t,n){if(n.current)return!1;let r=kS(e,t);r.operations.switchingBranch=n.name;try{let i=await Ee(e,t,n.name);return await Ts(e,i.workspaceRevision,t),MS(r,[]),ui.success(`Switched to ${i.repo.currentBranch??n.name}`,{activity:!0}),!0}catch(e){return tw(`Switch branch failed`,e),!1}finally{r.operations.switchingBranch=void 0}}async function jte(e,t,n){if(n.current||n.remote)return!1;let r=kS(e,t);r.operations.deletingBranch=n.name;try{let i=await Ve(e,t,n.name);return MS(r,[]),ui.success(`Deleted branch ${n.name}`,{activity:!0}),await Promise.all([BS(e,t,void 0,!0),Ts(e,i.workspaceRevision,t)]),!0}catch(e){return tw(`Delete branch failed`,e),!1}finally{r.operations.deletingBranch=void 0}}async function Mte(e,t,n){if(n.trim().length===0)return!1;let r=kS(e,t);r.operations.creatingBranch=!0;try{let i=await ze(e,t,n.trim());return await Ts(e,i.workspaceRevision,t),MS(r,[]),ui.success(`Created branch ${n.trim()}`,{activity:!0}),!0}catch(e){return tw(`Create branch failed`,e),!1}finally{r.operations.creatingBranch=!1}}async function Nte(e,t,n,r){if(n.trim().length===0)return!1;let i=kS(e,t);i.operations.creatingWorktree=!0;try{let i=await Fe(e,t,n.trim(),r?.trim()||void 0);return await Ts(e,i.workspaceRevision,t),LS(e,i.repo.relativePath),ui.success(`Created worktree ${wx(i.repo)}`,{activity:!0}),!0}catch(e){return tw(`Create worktree failed`,e),!1}finally{i.operations.creatingWorktree=!1}}async function rw(e,t,n){let r=kS(e,t),i=ps(e)?.summaries.find(e=>e.relativePath===t);r.operations.removingWorktree=!0;try{let r=await De(e,t,n);return IS(e)===t&&LS(e,r.repo.relativePath),await Ts(e,r.workspaceRevision,t),ui.success(`Removed worktree ${i?wx(i):t}`,{activity:!0}),!0}catch(e){return tw(`Remove worktree failed`,e),!1}finally{r.operations.removingWorktree=!1}}async function Pte(e,t,n,r){let i=kS(e,t);i.operations.fileMutation={path:n.path,action:r};let a;try{a=(await(r===`stage`?ke:r===`unstage`?Se:Me)(e,t,n.path)).workspaceRevision}catch(e){tw(`${r[0].toUpperCase()}${r.slice(1)} failed`,e)}finally{await Ts(e,a,t),i.operations.fileMutation=void 0}}async function Fte(e,t,n,r,i){let a=kS(e,t),o=PC(Cs(e,t)?.files??[],n,i);if(o.length===0)return;let s=r===`stage`?ke:r===`unstage`?Se:Me;a.operations.bulkMutation={action:r,area:n,...i?{path:i}:{}};let c;try{for(let n of o)c=(await s(e,t,n.path)).workspaceRevision}catch(e){tw(`${r[0]?.toUpperCase()}${r.slice(1)} changes failed`,e)}finally{await Ts(e,c,t),a.operations.bulkMutation=void 0}}async function Ite(e,t,n,r){let i=kS(e,t),a=r?PC(Cs(e,t)?.files??[],n,r):void 0;if(r&&a?.length===0)return;i.operations.stashMutation={action:`create`,area:n,...r?{path:r}:{}};let o;try{o=(await je(e,t,n,a?FC(a):void 0)).workspaceRevision,ui.success(`Changes stashed`,{activity:!0})}catch(e){tw(`Stash failed`,e)}finally{await Ts(e,o,t),i.operations.stashMutation=void 0}}async function Lte(e,t,n){let r=kS(e,t);r.operations.stashMutation={action:`apply`,hash:n.hash};let i;try{i=(await Re(e,t,n.index,n.hash)).workspaceRevision,ui.success(`Stash applied`,{activity:!0})}catch(e){tw(`Apply stash failed`,e)}finally{await Ts(e,i,t),r.operations.stashMutation=void 0}}async function Rte(e,t,n){let r=kS(e,t);r.operations.stashMutation={action:`drop`,hash:n.hash};let i;try{i=(await Ne(e,t,n.index,n.hash)).workspaceRevision,ui.success(`Stash dropped`,{activity:!0})}catch(e){tw(`Drop stash failed`,e)}finally{await Ts(e,i,t),r.operations.stashMutation=void 0}}var iw=WC(`Select a project to use Git operations.`),zte=new Set,aw=[],Bte={repositoryCount:0,sources:[],status:`loading`,viewer:null,loading:!1,refreshing:!1};function ow(e,t=()=>!0,n=t){let r={get model(){let t=e(),n=t?CS.projects[ds(t.id)]:void 0,r=t?ps(t.id):void 0,i=t?xs(t.id):void 0,a=r?.summaries??aw,o=t?IS(t.id):`.`,s=n?.repoStates[cs(o)],c=t?Cs(t.id,o):void 0,l=a.find(e=>e.relativePath===o),u=t?QC(t.id):{quick:`all`,filters:Rs},d=t?{refresh:UC,selectRepository:UC,branches:UC,worktrees:UC,mutateFiles:UC,bulkMutateFiles:UC,stashes:UC,remote:{fetch:UC,pull:UC,push:UC,sync:UC,"switch-base-and-pull":UC},openPullRequest:UC}:{refresh:iw,selectRepository:iw,branches:iw,worktrees:iw,mutateFiles:iw,bulkMutateFiles:iw,stashes:iw,remote:{fetch:iw,pull:iw,push:iw,sync:iw,"switch-base-and-pull":iw},openPullRequest:iw};return{projectId:t?.id,availability:t?{available:!0}:{available:!1,message:`Select a project to inspect its Git repositories.`},emptyMessage:`No Git repositories found in this directory (searched up to 2 levels deep).`,repositories:a,selectedRepository:o,repositorySummary:l,changes:c,branches:s?.branches??[],collapsedChangeTreeFolders:s?.collapsedChangeTreeFolders??zte,stashes:c?.stashes??[],github:s?.github,pullRequests:t?_a(t.id,o,u.filters):[],prHeads:t?Ba(t.id,o):void 0,currentBranchPr:t?Ea(t.id,o,l?.currentBranch):void 0,awaitingPullRequest:t?Ta(t.id,o,l?.currentBranch):!1,expectedPullRequestUrl:t?Aa(t.id,o):void 0,pullRequestFilters:u.filters,pullRequestQuickFilter:u.quick,pullRequestsOverview:t?yte(t.id,a):Bte,initialLoading:!!t&&!r?.loaded&&!i?.error,cachedError:r?.loaded?void 0:i?.error,readErrors:r?.errors,stale:!!(r?.staleRepos.includes(o)||c?.stale),refreshing:!!i?.refreshing||!!(t&&ba(t.id,o).refreshing),loadingOverview:t?vs(t.id,o):!1,loadingBranches:s?.loadingBranches??!1,loadingPullRequests:t?ba(t.id,o).loading||ba(t.id,o).refreshing:!1,loadingPrHeads:t?ba(t.id,o).loading:!1,pullRequestError:t?Vte(t.id,o):void 0,activeOperations:t?fx(va.activities,t.id):[],operations:{...s?.operations??{creatingBranch:!1},...px(va.activities,t?.id??``,o)},capabilities:d,branchPullRequest:e=>t?Ea(t.id,e,a.find(t=>t.relativePath===e)?.currentBranch):void 0,lastRemoteFailure:e=>MC(va.activities.filter(e=>e.scope?.projectId===t?.id),e),repoBranchState:e=>{let r=n?.repoStates[cs(e)];return{repoSummary:a.find(t=>t.relativePath===e),branches:r?.branches??[],repositoryUrl:t?wa(t.id,e):void 0,prHeads:t?Ba(t.id,e):void 0,loadingBranches:r?.loadingBranches??!1,loadingPrHeads:t?ba(t.id,e).loading:!1,switchingBranch:r?.operations?.switchingBranch}}}},actions:void 0};r.actions=_te(()=>r.model,{runBulkRemoteOperation:async t=>{let n=e();if(!n)return;let i=r.model.repositories.filter(e=>e.hasRemote&&(t===`pull`||Sx(e))).map(e=>e.relativePath);if(i.length)try{let e={projectId:n.id,repos:i,kind:t===`switch-base-and-pull`?`switchBaseAndPull`:t},r=await we(e);dx(va,e,r)}catch{ui.error(`Could not start bulk Git operation`)}},retryOperation:e=>va.action(`retry`,e),dismissOperation:e=>va.action(`dismiss`,e),cancelOperation:async e=>{try{let t=await Pe(e);t.accepted||ui.error(t.reason??`Operation is no longer cancellable`)}catch{ui.error(`Could not cancel Git operation`)}},refreshAll:async()=>{let t=e();if(t)try{await gs(t.id)}catch(e){es(`Could not refresh Git repositories`,jS(e))}},refreshRepository:async t=>{let n=e();n&&await Promise.all([gs(n.id,t).catch(e=>es(`Could not refresh repository`,jS(e))),VS(n.id,t,!0,`Could not refresh repository`)])},loadStashes:async t=>{let n=e();if(!n||(await Es(n.id,t),e()?.id!==n.id))return;let r=Cs(n.id,t);return r||ui.error(`Could not load stashes`),r?.stashes},refreshBranches:t=>{let n=e();if(n)return BS(n.id,t,`Could not refresh branches`,!0)},expectPullRequest:(t,n,r)=>{let i=e();i&&Na(i.id,t,n,r).catch(()=>void 0)},loadPullRequestBadges:t=>{let n=e();if(n)return Da(n.id,t)},refreshPullRequests:async t=>{let n=e();n&&await Sa(n.id,t)},configurePullRequests:t=>{let n=e();n&&ew(n.id,t)},resetPullRequestConfig:()=>{let t=e();t&&ew(t.id,Rs)},setPullRequestQuickFilter:t=>{let n=e();n&&Cte(n.id,t)},selectRepository:t=>{let n=e();n&&LS(n.id,t)},hintRepository:t=>{let n=e();n&&ws(n.id,t)},createBranch:(t,n)=>{let r=e();return r?Mte(r.id,t,n):!1},switchBranch:(t,n)=>{let r=e();return r?Ate(r.id,t,n):!1},deleteBranch:(t,n)=>{let r=e();return r?jte(r.id,t,n):!1},createWorktree:(t,n,r)=>{let i=e();return i?Nte(i.id,t,n,r):!1},removeWorktree:(t,n)=>{let r=e();return r?rw(r.id,t,n):!1},openDiff:(t,n,r)=>{let i=e();if(i)return nC({projectId:i.id,repo:t,path:n.path,renamedFrom:n.renamedFrom,area:r})},mutateFile:(t,n,r)=>{let i=e();if(i)return Pte(i.id,t,n,r)},mutateFileScope:(t,n,r,i)=>{let a=e();if(a)return Fte(a.id,t,n,r,i)},createStash:(t,n,r)=>{let i=e();if(i)return Ite(i.id,t,n,r)},setChangeTreeFolderExpanded:(t,n,r)=>{let i=e();i&&AS(i.id,t,n,r)},applyStash:(t,n)=>{let r=e();if(r)return Lte(r.id,t,n)},dropStash:(t,n)=>{let r=e();if(r)return Rte(r.id,t,n)},runRemoteOperation:(t,n)=>{let r=e();if(r)return{fetch:()=>Tte(r.id,t),pull:()=>Ete(r.id,t),push:()=>Dte(r.id,t),sync:()=>Ote(r.id,t),"switch-base-and-pull":()=>kte(r.id,t)}[n]()},selectPullRequest:()=>void 0,openPullRequest:(t,n)=>{let r=e();if(r)return pC({projectId:r.id,repo:t,number:n})}}),W(()=>{let r=e(),i=Us.progressiveActive&&t(),a=n(),o=r?ps(r.id)?.summaries??aw:aw,s=r?IS(r.id):void 0,c=r&&a?GC(r.id,o).map(e=>e.repository):[],l=r?lS(r.id).expanded:void 0,u=o.filter(e=>e.hasGithubRemote).map(e=>Ra(()=>r&&i?{projectId:r.id,repo:e.relativePath,visible:e.relativePath===s||c.includes(e.relativePath)||!!l?.has(xx(e)),list:a&&c.includes(e.relativePath),branch:e.currentBranch??void 0,prs:[]}:void 0));return()=>u.forEach(e=>e())}),W(()=>{let n=e(),r=Us.progressiveActive&&t();if(!n||!r)return;let i=n.id;return _s(()=>{let e=IS(i),t=bs(i);return{projectId:i,visible:!0,detail:[e],...t?{hint:t}:{}}})}),W(()=>{let n=e();if(!n||!(Us.progressiveActive&&t()))return;let r=ps(n.id);if(!r?.loaded)return;let i=IS(n.id);me(()=>{lS(n.id).reconcile(r.summaries,i),VS(n.id,i)})});let i;return W(()=>{let n=e();CC({progressiveActive:Us.progressiveActive,enabled:t(),projectId:n?.id,lastProjectId:i})&&(i=n?.id,n&&hs(n.id))}),r}function Vte(e,t){let n=ba(e,t);return n.status===`rate_limited`?`Pull request updates are paused by GitHub’s rate limit.`:n.status===`unauthenticated`?`Sign in to GitHub to receive pull request updates.`:n.status===`unavailable`?`Pull request updates are unavailable.`:n.error||(n.status===`error`?`Pull request updates are temporarily unavailable.`:void 0)}var Hte=O(`<div><!> <!> <!></div>`);function sw(e,r){c(r,!0);let i=K(r,`query`,15,``),a=K(r,`scope`,15),o=K(r,`scopeLabel`,3,`Filter scope`),s=L(()=>r.placeholder!==void 0);var u=Hte(),d=q(u),p=e=>{ks(e,{get placeholder(){return r.placeholder},get ariaLabel(){return r.ariaLabel},get value(){return i()},set value(e){i(e)}})};l(d,e=>{t(s)&&e(p)});var h=G(d,2),_=e=>{var n=f(),i=R(n);H(i,()=>ti,(e,n)=>{n(e,{type:`single`,variant:`chip`,size:`sm`,get value(){return a()},get"aria-label"(){return o()},onValueChange:e=>{e&&(a(e),r.onScopeChange?.(e))},children:(e,n)=>{var i=f(),a=R(i);v(a,17,()=>r.scopes,e=>e.value,(e,n)=>{var r=f(),i=R(r);H(i,()=>ni,(e,r)=>{r(e,{get value(){return t(n).value},get title(){return t(n).title},children:(e,r)=>{y();var i=g();F(()=>w(i,t(n).count===void 0?t(n).label:`${t(n).label} ${t(n).count}`)),k(e,i)},$$slots:{default:!0}})}),k(e,r)}),k(e,i)},$$slots:{default:!0}})}),k(e,n)};l(h,e=>{r.scopes&&r.scopes.length>0&&e(_)});var b=G(h,2);n(b,()=>r.extra??m),x(u),F(e=>X(u,1,e),[()=>T(ft(`flex shrink-0 flex-col gap-1.5 pt-1 pb-1.5`,r.class))]),k(e,u),D()}var Ute=O(`<span class="shrink-0 text-muted-foreground tabular-nums"> </span>`),Wte=O(`<!> <span class="truncate font-medium"> </span> <!>`,1),Gte=O(`<span class="ml-auto shrink-0 pr-1 text-caption text-muted-foreground"><!></span>`),Kte=O(`<div><!></div>`),qte=O(`<div><div><button type="button" class="group/section flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 self-stretch rounded-sm text-left outline-none focus-visible:ring-3 focus-visible:ring-focus"><!> <!> <!></button> <!></div> <!></div>`);function cw(e,t){c(t,!0);let r=K(t,`open`,15,!0),i=K(t,`keepMounted`,3,!1);function a(){r(!r()),t.onOpenChange?.(r())}var o=qte(),s=q(o),u=q(s),d=q(u),p=e=>{qn(e,{class:`size-3.5 shrink-0 text-muted-foreground transition-colors group-hover/section:text-foreground`})},g=e=>{mn(e,{class:`size-3.5 shrink-0 text-muted-foreground transition-colors group-hover/section:text-foreground`})};l(d,e=>{r()?e(p):e(g,-1)});var _=G(d,2),v=e=>{var r=f(),i=R(r);n(i,()=>t.label),k(e,r)},y=e=>{var n=Wte(),r=R(n),i=e=>{var n=f(),r=R(n);H(r,()=>t.icon,(e,t)=>{t(e,{class:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),k(e,n)};l(r,e=>{t.icon&&e(i)});var a=G(r,2),o=z(a,!0),s=G(a,2),c=e=>{var n=Ute(),r=z(n,!0);F(()=>w(r,t.count)),k(e,n)};l(s,e=>{t.count!==void 0&&e(c)}),F(()=>w(o,t.title)),k(e,n)};l(_,e=>{t.label?e(v):e(y,-1)});var b=G(_,2),S=e=>{var r=Gte(),i=q(r);n(i,()=>t.meta),x(r),k(e,r)};l(b,e=>{t.meta&&e(S)}),x(u);var C=G(u,2);n(C,()=>t.actions??m),x(s);var E=G(s,2),O=e=>{var i=Kte(),a=q(i);n(a,()=>t.children),x(i),F(()=>{X(i,1,T(t.bodyClass)),i.inert=!r()}),k(e,i)};l(E,e=>{t.children&&(r()||i())&&e(O)}),x(o),F((e,t)=>{X(o,1,e),X(s,1,t),J(u,`aria-expanded`,r())},[()=>T(ft(`flex flex-col text-ui`,t.class)),()=>T(ft(`flex h-8 shrink-0 items-center gap-1`,t.headerClass))]),h(`click`,u,a),k(e,o),D()}ue([`click`]);var Jte=A(`<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path transform="translate(-84 -7399)" d="M94,7399 C99.523,7399 104,7403.59 104,7409.253 C104,7413.782 101.138,7417.624 97.167,7418.981 C96.66,7419.082 96.48,7418.762 96.48,7418.489 C96.48,7418.151 96.492,7417.047 96.492,7415.675 C96.492,7414.719 96.172,7414.095 95.813,7413.777 C98.04,7413.523 100.38,7412.656 100.38,7408.718 C100.38,7407.598 99.992,7406.684 99.35,7405.966 C99.454,7405.707 99.797,7404.664 99.252,7403.252 C99.252,7403.252 98.414,7402.977 96.505,7404.303 C95.706,7404.076 94.85,7403.962 94,7403.958 C93.15,7403.962 92.295,7404.076 91.497,7404.303 C89.586,7402.977 88.746,7403.252 88.746,7403.252 C88.203,7404.664 88.546,7405.707 88.649,7405.966 C88.01,7406.684 87.619,7407.598 87.619,7408.718 C87.619,7412.646 89.954,7413.526 92.175,7413.785 C91.889,7414.041 91.63,7414.493 91.54,7415.156 C90.97,7415.418 89.522,7415.871 88.63,7414.304 C88.63,7414.304 88.101,7413.319 87.097,7413.247 C87.097,7413.247 86.122,7413.234 87.029,7413.87 C87.029,7413.87 87.684,7414.185 88.139,7415.37 C88.139,7415.37 88.726,7417.2 91.508,7416.58 C91.513,7417.437 91.522,7418.245 91.522,7418.489 C91.522,7418.76 91.338,7419.077 90.839,7418.982 C86.865,7417.627 84,7413.783 84,7409.253 C84,7403.59 88.478,7399 94,7399"></path></svg>`);function lw(e,t){let n=K(t,`class`,3,``);var r=Jte();F(()=>X(r,0,T(n()))),k(e,r)}var Yte=new Set([`$$slots`,`$$events`,`$$legacy`]);function uw(e,t){let n=V(t,Yte),r=[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}],[`path`,{d:`M10 12h4`}]];Z(e,P({name:`archive`},()=>n,{get iconNode(){return r}}))}var Xte=new Set([`$$slots`,`$$events`,`$$legacy`]);function dw(e,t){let n=V(t,Xte),r=[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`}],[`path`,{d:`m9 15 3-3 3 3`}],[`path`,{d:`M12 12v9`}]];Z(e,P({name:`archive-restore`},()=>n,{get iconNode(){return r}}))}var Zte=new Set([`$$slots`,`$$events`,`$$legacy`]);function fw(e,t){let n=V(t,Zte),r=[[`path`,{d:`m3 16 4 4 4-4`}],[`path`,{d:`M7 20V4`}],[`path`,{d:`m21 8-4-4-4 4`}],[`path`,{d:`M17 4v16`}]];Z(e,P({name:`arrow-down-up`},()=>n,{get iconNode(){return r}}))}var Qte=new Set([`$$slots`,`$$events`,`$$legacy`]);function pw(e,t){let n=V(t,Qte),r=[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`}]];Z(e,P({name:`cloud`},()=>n,{get iconNode(){return r}}))}var $te=new Set([`$$slots`,`$$events`,`$$legacy`]);function mw(e,t){let n=V(t,$te),r=[[`path`,{d:`M12 13v8l-4-4`}],[`path`,{d:`m12 21 4-4`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`}]];Z(e,P({name:`cloud-download`},()=>n,{get iconNode(){return r}}))}var ene=new Set([`$$slots`,`$$events`,`$$legacy`]);function hw(e,t){let n=V(t,ene),r=[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`}],[`path`,{d:`m2 2 20 20`}]];Z(e,P({name:`cloud-off`},()=>n,{get iconNode(){return r}}))}var tne=new Set([`$$slots`,`$$events`,`$$legacy`]);function gw(e,t){let n=V(t,tne),r=[[`path`,{d:`M12 13v8`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`}],[`path`,{d:`m8 17 4-4 4 4`}]];Z(e,P({name:`cloud-upload`},()=>n,{get iconNode(){return r}}))}var nne=new Set([`$$slots`,`$$events`,`$$legacy`]);function rne(e,t){let n=V(t,nne),r=[[`path`,{d:`M9 13h6`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];Z(e,P({name:`folder-minus`},()=>n,{get iconNode(){return r}}))}var ine=new Set([`$$slots`,`$$events`,`$$legacy`]);function _w(e,t){let n=V(t,ine),r=[[`circle`,{cx:`5`,cy:`6`,r:`3`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`}],[`path`,{d:`m15 9-3-3 3-3`}],[`circle`,{cx:`19`,cy:`18`,r:`3`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`}],[`path`,{d:`m9 15 3 3-3 3`}]];Z(e,P({name:`git-compare-arrows`},()=>n,{get iconNode(){return r}}))}var ane=new Set([`$$slots`,`$$events`,`$$legacy`]);function vw(e,t){let n=V(t,ane),r=[[`circle`,{cx:`18`,cy:`18`,r:`3`}],[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`}]];Z(e,P({name:`git-merge`},()=>n,{get iconNode(){return r}}))}var one=new Set([`$$slots`,`$$events`,`$$legacy`]);function sne(e,t){let n=V(t,one),r=[[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M6 9v12`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v3`}],[`path`,{d:`M18 15v6`}],[`path`,{d:`M21 18h-6`}]];Z(e,P({name:`git-pull-request-create`},()=>n,{get iconNode(){return r}}))}var cne=new Set([`$$slots`,`$$events`,`$$legacy`]);function yw(e,t){let n=V(t,cne),r=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}]];Z(e,P({name:`link`},()=>n,{get iconNode(){return r}}))}var lne=O(`<!> `,1),une=O(`<span class="flex size-control-sm items-center justify-center" title="Deleting branch"><!></span>`),dne=O(`<!> <!>`,1),fne=O(`<span class="text-ui text-muted-foreground"> </span> <!>`,1),pne=O(`<div role="listitem"><button type="button" class="flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-focus disabled:cursor-default"><!> <span class="min-w-0 truncate text-ui text-foreground"> </span> <!></button> <!> <div class="flex shrink-0 items-center justify-end gap-1"><!></div></div>`);function mne(e,n){c(n,!0);let r=L(()=>n.row.branch),i=L(()=>!t(r).remote&&t(r).name===n.baseBranch),a=L(()=>t(r).remote?void 0:n.checkedOutIn),o=L(()=>n.enabled&&!t(a)&&VC(t(r),n.baseBranch)),s=L(()=>n.switching||n.deleting),u=L(()=>!t(r).current&&!t(s)&&!t(a));var d=pne(),f=q(d),p=q(f),m=e=>{dn(e,{class:`size-3.5 shrink-0 text-muted-foreground`})},_=e=>{ic(e,{class:`size-3.5 shrink-0 text-primary`,"aria-hidden":`true`})},v=e=>{nc(e,{class:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`})};l(p,e=>{n.switching?e(m):t(r).current?e(_,1):e(v,-1)});var b=G(p,2),S=z(b,!0),C=G(b,2),E=e=>{be(e,{variant:`info`,children:(e,t)=>{y();var n=g(`base`);k(e,n)},$$slots:{default:!0}})};l(C,e=>{t(i)&&e(E)}),x(f);var O=G(f,2),A=e=>{{let r=L(()=>`Open pull request #${n.row.pullRequest.number}${n.row.pullRequest.isDraft?` (draft)`:``}`),i=L(()=>`Open pull request #${n.row.pullRequest.number}`);be(e,{variant:`brand`,get title(){return t(r)},get"aria-label"(){return t(i)},onclick:()=>n.onOpenPullRequest(n.row.pullRequest.number),children:(e,t)=>{var r=lne(),i=R(r);ac(i,{"aria-hidden":`true`});var a=G(i);F(()=>w(a,`#${n.row.pullRequest.number??``}${n.row.pullRequest.isDraft?` draft`:``}`)),k(e,r)},$$slots:{default:!0}})}};l(O,e=>{n.row.pullRequest&&e(A)});var j=G(O,2),M=q(j),N=e=>{var t=une(),n=q(t);dn(n,{class:`size-3.5 text-muted-foreground`}),x(t),k(e,t)},P=e=>{var i=fne(),s=R(i),c=z(s,!0),d=G(s,2),f=e=>{var i=dne(),a=R(i);{let e=L(()=>!n.enabled),i=L(()=>`Switch to ${t(r).name}`);Q(a,{variant:`outline`,size:`sm`,get disabled(){return t(e)},get ariaLabel(){return t(i)},onclick:()=>n.onSwitch(t(r)),children:(e,t)=>{y();var n=g(`Switch`);k(e,n)},$$slots:{default:!0}})}var s=G(a,2),c=e=>{Mn(e,{get icon(){return kn},tone:`destructive`,label:`Delete branch`,onclick:()=>n.onDelete(t(r))})};l(s,e=>{t(o)&&e(c)}),k(e,i)};l(d,e=>{t(u)&&e(f)}),F(()=>{J(s,`title`,t(a)?`Checked out in ${t(a)}`:t(r).updatedAt??void 0),w(c,t(a)?`in ${t(a)}`:n.row.updatedLabel)}),k(e,i)};l(M,e=>{n.deleting?e(N):e(P,-1)}),x(j),x(d),F((e,n)=>{X(d,1,e),f.disabled=n,J(f,`aria-label`,t(r).current?`${t(r).name}, current branch`:t(a)?`${t(r).name}, checked out in ${t(a)}`:`Switch to ${t(r).name}`),w(S,t(r).name)},[()=>T(Wc({selected:t(r).current}).base({class:`relative flex h-8 min-w-0 items-center gap-2 px-1.5 focus-within:bg-hover`})),()=>!n.enabled||t(r).current||t(s)||!!t(a)]),h(`click`,f,()=>n.onSwitch(t(r))),k(e,d),D()}ue([`click`]);var hne=O(`<!>New branch`,1),gne=O(`<span class="mr-auto text-ui text-muted-foreground tabular-nums"> </span> <!>`,1),_ne=O(`<!> Create and switch`,1),bw=O(`<!> <!>`,1),vne=O(`<span title="Loading pull request links"><!></span>`),yne=O(`Local <span data-slot="toggle-count"> </span>`,1),bne=O(`Remote <span data-slot="toggle-count"> </span>`,1),xne=O(`All <span data-slot="toggle-count"> </span>`,1),Sne=O(`<!> <!> <!>`,1),Cne=O(`<div class="flex items-center justify-center gap-2 px-3 py-10 text-ui text-muted-foreground"><!> Loading branches…</div>`),wne=O(`<div class="grid gap-2 p-3"><div class="flex min-w-0 items-center gap-2"><!> <!> <!></div> <div class="max-h-[min(60vh,28rem)] min-h-48 overflow-y-auto rounded-md bg-well p-1.5" role="list" aria-label="Branches"><!></div></div>`),Tne=O(`<p class="m-0 text-ui text-destructive">Enter a valid branch name (no spaces or special characters).</p>`),Ene=O(`<p class="m-0 flex items-center gap-1.5 text-ui text-muted-foreground"><!> <span>Starts from <span class="text-foreground"> </span> and switches to it.</span></p>`),Dne=O(`<form class="grid gap-3 p-3"><label class="grid gap-1.5"><span class="text-ui">Branch name</span> <!></label> <!></form>`);function One(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=K(n,`branchFilter`,15,``),a=K(n,`newBranchName`,15,``),o=K(n,`view`,15,`switch`),s=Y(`local`),u=Y(void 0),d=Y(null),p=L(()=>n.repoSummary.currentBranch??`detached`),m=L(()=>t(s)===`all`?n.branchGroups.all:n.branchGroups[t(s)]),h=L(()=>[{label:`Current`,rows:t(m).filter(({branch:e})=>e.current)},{label:`Local`,rows:t(m).filter(({branch:e})=>!e.current&&!e.remote)},{label:`Remote`,rows:t(m).filter(({branch:e})=>e.remote)}].filter(e=>e.rows.length>0)),_=L(()=>t(m).length),b=L(()=>a().trim()),S=L(()=>BC(a())),C=L(()=>t(b).length>0&&!t(S)),T=L(()=>o()===`switch`?`Branches`:`New branch`),E=L(()=>`${n.repoSummary.name} · on ${t(p)}`);W(()=>{r()&&o()===`switch`&&queueMicrotask(()=>t(d)?.focus())});async function O(){let e=t(u);B(u,void 0),e&&await n.onDeleteBranch(n.selectedRepo,e)}function A(e){r(!1),n.onOpenPullRequest(n.selectedRepo,e)}var j=bw(),N=R(j);ln(N,{get title(){return t(T)},get description(){return t(E)},size:`md`,flush:!0,onOpenChange:e=>{e||(o(`switch`),B(u,void 0))},get open(){return r()},set open(e){r(e)},headerActions:e=>{var t=f(),r=R(t),i=e=>{Mn(e,{get icon(){return cr},label:`Refresh branches`,get busy(){return n.loadingBranches},get onclick(){return n.onRefreshBranches}})};l(r,e=>{o()===`switch`&&e(i)}),k(e,t)},footer:e=>{var r=f(),i=R(r),a=e=>{var r=gne(),i=R(r),a=z(i),s=G(i,2);{let e=L(()=>!n.branchesEnabled);Q(s,{variant:`outline`,get disabled(){return t(e)},onclick:()=>o(`create`),children:(e,t)=>{var n=hne(),r=R(n);On(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})}F(()=>w(a,`${t(_)??``} of ${n.branchGroups.all.length??``}
6
+ ${n.branchGroups.all.length===1?`branch`:`branches`}`)),k(e,r)},s=e=>{var r=bw(),i=R(r);Q(i,{variant:`ghost`,onclick:()=>o(`switch`),children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var a=G(i,2);{let e=L(()=>!n.branchesEnabled||n.creatingBranch||!t(S));Q(a,{get disabled(){return t(e)},onclick:()=>n.onCreateBranch(n.selectedRepo),children:(e,t)=>{var r=_ne(),i=R(r),a=e=>{dn(e,{})};l(i,e=>{n.creatingBranch&&e(a)}),y(),k(e,r)},$$slots:{default:!0}})}k(e,r)};l(i,e=>{o()===`switch`?e(a):e(s,-1)}),k(e,r)},children:(e,r)=>{var c=f(),m=R(c),b=e=>{var r=wne(),a=q(r),o=q(a);ks(o,{placeholder:`Search branches or PRs`,ariaLabel:`Search branches or pull requests`,class:`min-w-0 flex-1`,get ref(){return t(d)},set ref(e){B(d,e,!0)},get value(){return i()},set value(e){i(e)}});var c=G(o,2),p=e=>{var t=vne(),n=q(t);dn(n,{class:`size-3.5 text-muted-foreground`}),x(t),k(e,t)};l(c,e=>{n.loadingPrHeads&&!n.loadingBranches&&e(p)});var m=G(c,2);H(m,()=>ti,(e,r)=>{r(e,{type:`single`,get value(){return t(s)},"aria-label":`Branch scope`,onValueChange:e=>e&&B(s,e,!0),children:(e,t)=>{var r=Sne(),i=R(r);H(i,()=>ni,(e,t)=>{t(e,{value:`local`,children:(e,t)=>{y();var r=yne(),i=G(R(r)),a=z(i,!0);F(()=>w(a,n.branchGroups.local.length)),k(e,r)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>ni,(e,t)=>{t(e,{value:`remote`,children:(e,t)=>{y();var r=bne(),i=G(R(r)),a=z(i,!0);F(()=>w(a,n.branchGroups.remote.length)),k(e,r)},$$slots:{default:!0}})});var o=G(a,2);H(o,()=>ni,(e,t)=>{t(e,{value:`all`,children:(e,t)=>{y();var r=xne(),i=G(R(r)),a=z(i,!0);F(()=>w(a,n.branchGroups.all.length)),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),x(a);var b=G(a,2),S=q(b),C=e=>{var t=Cne(),n=q(t);dn(n,{class:`size-4`}),y(),x(t),k(e,t)},T=e=>{var t=f(),n=R(t);H(n,()=>as,(e,t)=>{t(e,{class:`py-8`,children:(e,t)=>{var n=f(),r=R(n);H(r,()=>ts,(e,t)=>{t(e,{children:(e,t)=>{var n=f(),r=R(n);H(r,()=>os,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(e=>w(n,e),[()=>i().trim()?`No branches match “${i().trim()}”`:`No branches found`]),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,t)},E=e=>{var r=f(),i=R(r);v(i,17,()=>t(h),e=>e.label,(e,r)=>{var i=bw(),a=R(i);{let e=L(()=>t(r).label===`Current`?void 0:t(r).rows.length);Rn(a,{get label(){return t(r).label},get count(){return t(e)},class:`px-1.5 pt-2 pb-1`})}var o=G(a,2);v(o,17,()=>t(r).rows,e=>e.branch.name,(e,r)=>{{let i=L(()=>n.switchingBranch===t(r).branch.name),a=L(()=>n.deletingBranch===t(r).branch.name),o=L(()=>n.checkedOutIn?.get(t(r).branch.name));mne(e,{get row(){return t(r)},get baseBranch(){return n.repoSummary.baseBranch},get enabled(){return n.branchesEnabled},get switching(){return t(i)},get deleting(){return t(a)},get checkedOutIn(){return t(o)},onSwitch:e=>n.onSwitchBranch(n.selectedRepo,e),onDelete:e=>B(u,e,!0),onOpenPullRequest:A})}}),k(e,i)}),k(e,r)};l(S,e=>{n.loadingBranches&&t(_)===0?e(C):t(_)===0?e(T,1):e(E,-1)}),x(b),x(r),k(e,r)},T=e=>{var r=Dne(),i=q(r),o=G(q(i),2);an(o,{placeholder:`feat/my-change`,autofocus:!0,get"aria-invalid"(){return t(C)},get value(){return a()},set value(e){a(e)}}),x(i);var s=G(i,2),c=e=>{var t=Tne();k(e,t)},u=e=>{var n=Ene(),r=q(n);nc(r,{class:`size-3.5 shrink-0`,"aria-hidden":`true`});var i=G(r,2),a=G(q(i)),o=z(a,!0);y(),x(i),x(n),F(()=>w(o,t(p))),k(e,n)};l(s,e=>{t(C)?e(c):e(u,-1)}),x(r),M(`submit`,r,e=>{e.preventDefault(),t(S)&&!n.creatingBranch&&n.onCreateBranch(n.selectedRepo)}),k(e,r)};l(m,e=>{o()===`switch`?e(b):e(T,-1)}),k(e,c)},$$slots:{headerActions:!0,footer:!0,default:!0}});var P=G(N,2);{let e=L(()=>t(u)!==void 0),n=L(()=>t(u)?`Delete “${t(u).name}”? Git will only delete it if it is fully merged.`:void 0);jn(P,{get open(){return t(e)},title:`Delete local branch?`,get description(){return t(n)},confirmLabel:`Delete branch`,destructive:!0,onOpenChange:e=>{e||B(u,void 0)},onConfirm:()=>void O()})}k(e,j),D()}var kne=new Set([`$$slots`,`$$events`,`$$legacy`]);function xw(e,t){let n=V(t,kne),r=[[`path`,{d:`M14 17H5`}],[`path`,{d:`M19 7h-9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}],[`circle`,{cx:`7`,cy:`7`,r:`3`}]];Z(e,P({name:`settings-2`},()=>n,{get iconNode(){return r}}))}var Ane=O(`<span class="max-w-[40%] shrink-0 truncate text-ui text-muted-foreground"> </span>`),jne=O(`<span class="shrink-0 text-ui text-muted-foreground"> </span>`),Mne=O(`<span class="flex min-w-0 items-center gap-2"><!> <span class="min-w-0 flex-1 truncate"> </span> <!> <!></span>`),Nne=O(`<!> New branch`,1),Pne=O(`<!> All branches`,1),Fne=O(`<!> <!>`,1),Ine=O(`<!> <!> <!>`,1);function Lne(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=Y(``),a=L(()=>n.rows.map(e=>({...e,key:e.branch.name,label:e.branch.name,group:e.branch.remote?`Remote`:`Local`,keywords:[e.branch.upstream??``,e.pullRequest?`#${e.pullRequest.number}`:``,e.branch.current?`current`:``,!e.branch.remote&&e.branch.name===n.repo.baseBranch?`base`:``]})));function o(e){return!e.remote&&!!n.checkedOutIn?.has(e.name)}function s(e){B(i,``),e&&n.onOpen()}function u(e){e.current||(n.onSwitch(e),r(!1))}{let c=L(()=>`Switch branch in ${hx(n.repo)}`);dc(e,{size:`md`,align:`start`,get triggerClass(){return n.triggerClass},get triggerTitle(){return n.triggerTitle},get trigger(){return n.triggerContent},get ariaLabel(){return t(c)},onOpenChange:s,get open(){return r()},set open(e){r(e)},children:(e,s)=>{var c=Ine(),d=R(c);{let e=L(()=>`${n.rows.length}`);fc(d,{title:`Branches`,get meta(){return t(e)}})}var f=G(d,2);{let e=(e,r=m)=>{let i=L(()=>r().branch),a=L(()=>n.switchingBranch===t(i).name);var s=Mne(),c=q(s),u=e=>{dn(e,{class:`size-3.5 shrink-0 text-muted-foreground`})},d=e=>{nc(e,{class:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`})};l(c,e=>{t(a)?e(u):e(d,-1)});var f=G(c,2),p=z(f,!0),h=G(f,2),_=e=>{be(e,{variant:`info`,class:`shrink-0`,children:(e,t)=>{y();var n=g(`base`);k(e,n)},$$slots:{default:!0}})};l(h,e=>{!t(i).remote&&t(i).name===n.repo.baseBranch&&!t(i).current&&e(_)});var v=G(h,2),b=e=>{var r=Ane(),a=z(r);F((e,t)=>{J(r,`title`,e),w(a,`in ${t??``}`)},[()=>`Checked out in ${n.checkedOutIn?.get(t(i).name)}`,()=>n.checkedOutIn?.get(t(i).name)]),k(e,r)},S=L(()=>o(t(i))),C=e=>{var t=jne(),n=z(t,!0);F(e=>w(n,e),[()=>r().updatedLabel.replace(/^Updated /,``)]),k(e,t)};l(v,e=>{t(S)?e(b):e(C,-1)}),x(s),F(()=>w(p,t(i).name)),k(e,s)},r=L(()=>`Branches in ${hx(n.repo)}`),s=L(()=>n.loading?`Loading branches…`:t(i).trim()?`No branches match your search.`:`No branches yet.`);sc(f,{get items(){return t(a)},placeholder:`Search branches`,get ariaLabel(){return t(r)},isSelected:e=>e.branch.current,isDisabled:e=>!n.enabled||e.branch.current||!!n.switchingBranch||o(e.branch),onChoose:e=>u(e.branch),get empty(){return t(s)},get query(){return t(i)},set query(e){B(i,e,!0)},row:e,$$slots:{row:!0}})}var p=G(f,2);uc(p,{children:(e,i)=>{var a=Fne(),o=R(a);{let e=L(()=>!n.enabled);Q(o,{variant:`ghost`,size:`sm`,class:`justify-start text-muted-foreground`,get disabled(){return t(e)},onclick:()=>{r(!1),n.onCreate()},children:(e,t)=>{var n=Nne(),r=R(n);On(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})}var s=G(o,2);{let e=L(()=>!n.enabled);Q(s,{variant:`ghost`,size:`sm`,class:`justify-start text-muted-foreground`,get disabled(){return t(e)},onclick:()=>{r(!1),n.onManage()},children:(e,t)=>{var n=Pne();xw(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})}k(e,a)},$$slots:{default:!0}}),k(e,c)},$$slots:{default:!0}})}D()}var Rne=O(`<span class="flex min-w-0 flex-1"><span class="min-w-[4ch] truncate"> </span><span class="shrink-0"> </span></span>`),zne=O(`<span class="min-w-0 flex-1 truncate text-warning">detached</span>`),Bne=O(`<!> <!> <!>`,1),Vne=O(`<!> <!>`,1);function Hne(e,n){c(n,!0);let r=L(()=>n.repo.relativePath),i=Y(!1),a=Y(!1),o=Y(`switch`),s=Y(``),u=Y(``),d=new mo,f=L(()=>n.model.repoBranchState(t(r))),p=L(()=>HC(t(f).branches,``,n.repo.baseBranch,t(f).prHeads).all),m=L(()=>HC(n.model.branches,t(s),n.repo.baseBranch,n.model.prHeads)),h=L(()=>n.repo.currentBranch?Px(n.repo.currentBranch):void 0);function g(){Promise.all([n.actions.refreshBranches(t(r)),n.actions.loadPullRequestBadges(t(r))])}function _(){gte(d,t(r),t(f).branches.length)&&(d.add(t(r)),g())}function v(e){B(o,e,!0),B(s,``),B(u,``),B(a,!0),g()}function y(){n.model.capabilities.branches.enabled&&(B(i,!0),_())}function b(){v(`switch`)}async function S(e,t){await n.actions.switchBranch(e,t)!==!1&&(B(a,!1),B(s,``),B(u,``))}async function C(e){let r=t(u).trim();r&&await n.actions.createBranch(e,r)!==!1&&(B(a,!1),B(s,``),B(u,``))}var T={openBranchPicker:y,openBranchDialog:b},E=Vne(),O=R(E);{let e=e=>{var n=Bne(),r=R(n);nc(r,{class:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`});var i=G(r,2),a=e=>{var n=Rne(),r=q(n),i=z(r,!0),a=G(r),o=z(a,!0);x(n),F(()=>{w(i,t(h).head),w(o,t(h).tail)}),k(e,n)},o=e=>{var t=zne();k(e,t)};l(i,e=>{t(h)?e(a):e(o,-1)});var s=G(i,2);qn(s,{class:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),k(e,n)},a=L(()=>`${n.repo.currentBranch??`detached`}: switch branch in ${hx(n.repo)}`);Lne(O,{get repo(){return n.repo},get rows(){return t(p)},get checkedOutIn(){return n.checkedOutIn},get loading(){return t(f).loadingBranches},get enabled(){return n.model.capabilities.branches.enabled},get switchingBranch(){return t(f).switchingBranch},triggerClass:`flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-sm px-0.5 text-ui hover:bg-hover focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50`,get triggerTitle(){return t(a)},onOpen:_,onSwitch:e=>void S(t(r),e),onManage:()=>v(`switch`),onCreate:()=>v(`create`),get open(){return t(i)},set open(e){B(i,e,!0)},triggerContent:e,$$slots:{triggerContent:!0}})}return One(G(O,2),{get repoSummary(){return n.repo},get selectedRepo(){return t(r)},get branchGroups(){return t(m)},get loadingBranches(){return n.model.loadingBranches},get loadingPrHeads(){return n.model.loadingPrHeads},get switchingBranch(){return n.model.operations.switchingBranch},get deletingBranch(){return n.model.operations.deletingBranch},get creatingBranch(){return n.model.operations.creatingBranch},get branchesEnabled(){return n.model.capabilities.branches.enabled},get checkedOutIn(){return n.checkedOutIn},onSwitchBranch:(e,t)=>void S(e,t),onDeleteBranch:async(e,t)=>await n.actions.deleteBranch(e,t)!==!1,onOpenPullRequest:(e,t)=>void n.actions.openPullRequest(e,t),onRefreshBranches:g,onCreateBranch:e=>void C(e),get open(){return t(a)},set open(e){B(a,e,!0)},get branchFilter(){return t(s)},set branchFilter(e){B(s,e,!0)},get newBranchName(){return t(u)},set newBranchName(e){B(u,e,!0)},get view(){return t(o)},set view(e){B(o,e,!0)}}),k(e,E),D(T)}var Une=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sw(e,t){let n=V(t,Une),r=[[`path`,{d:`M12 17V3`}],[`path`,{d:`m6 11 6 6 6-6`}],[`path`,{d:`M19 21H5`}]];Z(e,P({name:`arrow-down-to-line`},()=>n,{get iconNode(){return r}}))}var Wne=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cw(e,t){let n=V(t,Wne),r=[[`path`,{d:`m18 9-6-6-6 6`}],[`path`,{d:`M12 3v14`}],[`path`,{d:`M5 21h14`}]];Z(e,P({name:`arrow-up-from-line`},()=>n,{get iconNode(){return r}}))}var Gne=new Set([`$$slots`,`$$events`,`$$legacy`]);function ww(e,t){let n=V(t,Gne),r=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];Z(e,P({name:`eye`},()=>n,{get iconNode(){return r}}))}var Kne=new Set([`$$slots`,`$$events`,`$$legacy`]);function qne(e,t){let n=V(t,Kne),r=[[`path`,{d:`M5 3h14`}],[`path`,{d:`m18 13-6-6-6 6`}],[`path`,{d:`M12 7v14`}]];Z(e,P({name:`arrow-up-to-line`},()=>n,{get iconNode(){return r}}))}var Jne=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tw(e,t){let n=V(t,Jne),r=[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`}]];Z(e,P({name:`at-sign`},()=>n,{get iconNode(){return r}}))}var Yne=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ew(e,t){let n=V(t,Yne),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M4.929 4.929 19.07 19.071`}]];Z(e,P({name:`ban`},()=>n,{get iconNode(){return r}}))}var Xne=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dw(e,t){let n=V(t,Xne),r=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M11.68 2.009A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673c-.824-.85-1.678-1.731-2.21-3.348`}],[`circle`,{cx:`18`,cy:`5`,r:`3`}]];Z(e,P({name:`bell-dot`},()=>n,{get iconNode(){return r}}))}var Zne=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qne(e,t){let n=V(t,Zne),r=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`}]];Z(e,P({name:`bell-off`},()=>n,{get iconNode(){return r}}))}var $ne=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ow(e,t){let n=V(t,$ne),r=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`}]];Z(e,P({name:`bell-ring`},()=>n,{get iconNode(){return r}}))}var ere=new Set([`$$slots`,`$$events`,`$$legacy`]);function tre(e,t){let n=V(t,ere),r=[[`path`,{d:`M12 7v14`}],[`path`,{d:`M16 12h2`}],[`path`,{d:`M16 8h2`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`}],[`path`,{d:`M6 12h2`}],[`path`,{d:`M6 8h2`}]];Z(e,P({name:`book-open-text`},()=>n,{get iconNode(){return r}}))}var nre=new Set([`$$slots`,`$$events`,`$$legacy`]);function rre(e,t){let n=V(t,nre),r=[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}],[`path`,{d:`m7 16.5-4.74-2.85`}],[`path`,{d:`m7 16.5 5-3`}],[`path`,{d:`M7 16.5v5.17`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}],[`path`,{d:`m17 16.5-5-3`}],[`path`,{d:`m17 16.5 4.74-2.85`}],[`path`,{d:`M17 16.5v5.17`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}],[`path`,{d:`M12 8 7.26 5.15`}],[`path`,{d:`m12 8 4.74-2.85`}],[`path`,{d:`M12 13.5V8`}]];Z(e,P({name:`boxes`},()=>n,{get iconNode(){return r}}))}var ire=new Set([`$$slots`,`$$events`,`$$legacy`]);function are(e,t){let n=V(t,ire),r=[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`}]];Z(e,P({name:`braces`},()=>n,{get iconNode(){return r}}))}var ore=new Set([`$$slots`,`$$events`,`$$legacy`]);function kw(e,t){let n=V(t,ore),r=[[`path`,{d:`M12 18V5`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`}]];Z(e,P({name:`brain`},()=>n,{get iconNode(){return r}}))}var sre=new Set([`$$slots`,`$$events`,`$$legacy`]);function cre(e,t){let n=V(t,sre),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16 12-4-4-4 4`}],[`path`,{d:`M12 16V8`}]];Z(e,P({name:`circle-arrow-up`},()=>n,{get iconNode(){return r}}))}var lre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Aw(e,t){let n=V(t,lre),r=[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`}]];Z(e,P({name:`circle-dashed`},()=>n,{get iconNode(){return r}}))}var ure=new Set([`$$slots`,`$$events`,`$$legacy`]);function jw(e,t){let n=V(t,ure),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Z(e,P({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var dre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mw(e,t){let n=V(t,dre),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`m9 14 2 2 4-4`}]];Z(e,P({name:`clipboard-check`},()=>n,{get iconNode(){return r}}))}var fre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Nw(e,t){let n=V(t,fre),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`M12 11h4`}],[`path`,{d:`M12 16h4`}],[`path`,{d:`M8 11h.01`}],[`path`,{d:`M8 16h.01`}]];Z(e,P({name:`clipboard-list`},()=>n,{get iconNode(){return r}}))}var pre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pw(e,t){let n=V(t,pre),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}]];Z(e,P({name:`clipboard`},()=>n,{get iconNode(){return r}}))}var mre=new Set([`$$slots`,`$$events`,`$$legacy`]);function hre(e,t){let n=V(t,mre),r=[[`path`,{d:`M12 2a10 10 0 0 1 7.38 16.75`}],[`path`,{d:`M12 6v6l4 2`}],[`path`,{d:`M2.5 8.875a10 10 0 0 0-.5 3`}],[`path`,{d:`M2.83 16a10 10 0 0 0 2.43 3.4`}],[`path`,{d:`M4.636 5.235a10 10 0 0 1 .891-.857`}],[`path`,{d:`M8.644 21.42a10 10 0 0 0 7.631-.38`}]];Z(e,P({name:`clock-fading`},()=>n,{get iconNode(){return r}}))}var gre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fw(e,t){let n=V(t,gre),r=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]];Z(e,P({name:`code-xml`},()=>n,{get iconNode(){return r}}))}var _re=new Set([`$$slots`,`$$events`,`$$legacy`]);function Iw(e,t){let n=V(t,_re),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`}]];Z(e,P({name:`compass`},()=>n,{get iconNode(){return r}}))}var vre=new Set([`$$slots`,`$$events`,`$$legacy`]);function yre(e,t){let n=V(t,vre),r=[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`}]];Z(e,P({name:`diamond`},()=>n,{get iconNode(){return r}}))}var bre=new Set([`$$slots`,`$$events`,`$$legacy`]);function xre(e,t){let n=V(t,bre),r=[[`path`,{d:`M12 3v14`}],[`path`,{d:`M5 10h14`}],[`path`,{d:`M5 21h14`}]];Z(e,P({name:`diff`},()=>n,{get iconNode(){return r}}))}var Sre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Lw(e,t){let n=V(t,Sre),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 12.5 8 15l2 2.5`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`}]];Z(e,P({name:`file-code`},()=>n,{get iconNode(){return r}}))}var Cre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Rw(e,t){let n=V(t,Cre),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M9 10h6`}],[`path`,{d:`M12 13V7`}],[`path`,{d:`M9 17h6`}]];Z(e,P({name:`file-diff`},()=>n,{get iconNode(){return r}}))}var wre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tre(e,t){let n=V(t,wre),r=[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`}]];Z(e,P({name:`file-pen`},()=>n,{get iconNode(){return r}}))}var Ere=new Set([`$$slots`,`$$events`,`$$legacy`]);function zw(e,t){let n=V(t,Ere),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}],[`path`,{d:`M12 18v-6`}]];Z(e,P({name:`file-plus`},()=>n,{get iconNode(){return r}}))}var Dre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ore(e,t){let n=V(t,Dre),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`}],[`path`,{d:`M13.3 16.3 15 18`}]];Z(e,P({name:`file-search`},()=>n,{get iconNode(){return r}}))}var kre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Bw(e,t){let n=V(t,kre),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];Z(e,P({name:`file`},()=>n,{get iconNode(){return r}}))}var Are=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vw(e,t){let n=V(t,Are),r=[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`}],[`circle`,{cx:`13`,cy:`12`,r:`2`}],[`circle`,{cx:`20`,cy:`19`,r:`2`}]];Z(e,P({name:`folder-git-2`},()=>n,{get iconNode(){return r}}))}var jre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mre(e,t){let n=V(t,jre),r=[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`}],[`path`,{d:`m21 21-1.9-1.9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}]];Z(e,P({name:`folder-search`},()=>n,{get iconNode(){return r}}))}var Nre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pre(e,t){let n=V(t,Nre),r=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}],[`path`,{d:`m9.5 10.5 5 5`}],[`path`,{d:`m14.5 10.5-5 5`}]];Z(e,P({name:`folder-x`},()=>n,{get iconNode(){return r}}))}var Fre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Hw(e,t){let n=V(t,Fre),r=[[`path`,{d:`m12 14 4-4`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`}]];Z(e,P({name:`gauge`},()=>n,{get iconNode(){return r}}))}var Ire=new Set([`$$slots`,`$$events`,`$$legacy`]);function Uw(e,t){let n=V(t,Ire),r=[[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`}]];Z(e,P({name:`git-commit-horizontal`},()=>n,{get iconNode(){return r}}))}var Lre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Rre(e,t){let n=V(t,Lre),r=[[`path`,{d:`M6 3v12`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`}],[`path`,{d:`M18 15v6`}],[`path`,{d:`M21 18h-6`}]];Z(e,P({name:`git-branch-plus`},()=>n,{get iconNode(){return r}}))}var zre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ww(e,t){let n=V(t,zre),r=[[`circle`,{cx:`12`,cy:`18`,r:`3`}],[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`}],[`path`,{d:`M12 12v3`}]];Z(e,P({name:`git-fork`},()=>n,{get iconNode(){return r}}))}var Bre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vre(e,t){let n=V(t,Bre),r=[[`circle`,{cx:`5`,cy:`6`,r:`3`}],[`path`,{d:`M5 9v12`}],[`circle`,{cx:`19`,cy:`18`,r:`3`}],[`path`,{d:`m15 9-3-3 3-3`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`}]];Z(e,P({name:`git-pull-request-arrow`},()=>n,{get iconNode(){return r}}))}var Hre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Gw(e,t){let n=V(t,Hre),r=[[`circle`,{cx:`18`,cy:`18`,r:`3`}],[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M18 6V5`}],[`path`,{d:`M18 11v-1`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`}]];Z(e,P({name:`git-pull-request-draft`},()=>n,{get iconNode(){return r}}))}var Ure=new Set([`$$slots`,`$$events`,`$$legacy`]);function Wre(e,t){let n=V(t,Ure),r=[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`}],[`path`,{d:`m18 15 4-4`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`}]];Z(e,P({name:`hammer`},()=>n,{get iconNode(){return r}}))}var Gre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kre(e,t){let n=V(t,Gre),r=[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`}]];Z(e,P({name:`hand`},()=>n,{get iconNode(){return r}}))}var qre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kw(e,t){let n=V(t,qre),r=[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}]];Z(e,P({name:`house`},()=>n,{get iconNode(){return r}}))}var Jre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Yre(e,t){let n=V(t,Jre),r=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M16 12H3`}],[`path`,{d:`M9 19H3`}],[`path`,{d:`m16 16-3 3 3 3`}],[`path`,{d:`M21 5v12a2 2 0 0 1-2 2h-6`}]];Z(e,P({name:`list-end`},()=>n,{get iconNode(){return r}}))}var Xre=new Set([`$$slots`,`$$events`,`$$legacy`]);function qw(e,t){let n=V(t,Xre),r=[[`path`,{d:`M2 5h20`}],[`path`,{d:`M6 12h12`}],[`path`,{d:`M9 19h6`}]];Z(e,P({name:`list-filter`},()=>n,{get iconNode(){return r}}))}var Zre=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qre(e,t){let n=V(t,Zre),r=[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}],[`circle`,{cx:`12`,cy:`12`,r:`7`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];Z(e,P({name:`locate-fixed`},()=>n,{get iconNode(){return r}}))}var $re=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jw(e,t){let n=V(t,$re),r=[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}],[`circle`,{cx:`12`,cy:`12`,r:`7`}]];Z(e,P({name:`locate`},()=>n,{get iconNode(){return r}}))}var eie=new Set([`$$slots`,`$$events`,`$$legacy`]);function Yw(e,t){let n=V(t,eie),r=[[`path`,{d:`M3 5h1`}],[`path`,{d:`M3 12h1`}],[`path`,{d:`M3 19h1`}],[`path`,{d:`M8 5h1`}],[`path`,{d:`M8 12h1`}],[`path`,{d:`M8 19h1`}],[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}]];Z(e,P({name:`logs`},()=>n,{get iconNode(){return r}}))}var tie=new Set([`$$slots`,`$$events`,`$$legacy`]);function Xw(e,t){let n=V(t,tie),r=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Z(e,P({name:`message-circle-question-mark`},()=>n,{get iconNode(){return r}}))}var nie=new Set([`$$slots`,`$$events`,`$$legacy`]);function rie(e,t){let n=V(t,nie),r=[[`path`,{d:`M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v11.344`}]];Z(e,P({name:`message-square-off`},()=>n,{get iconNode(){return r}}))}var iie=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zw(e,t){let n=V(t,iie),r=[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`}],[`path`,{d:`M12 12V8`}]];Z(e,P({name:`network`},()=>n,{get iconNode(){return r}}))}var aie=new Set([`$$slots`,`$$events`,`$$legacy`]);function oie(e,t){let n=V(t,aie),r=[[`path`,{d:`m15 9-6 6`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`}],[`path`,{d:`m9 9 6 6`}]];Z(e,P({name:`octagon-x`},()=>n,{get iconNode(){return r}}))}var sie=new Set([`$$slots`,`$$events`,`$$legacy`]);function cie(e,t){let n=V(t,sie),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}],[`path`,{d:`m10 15-3-3 3-3`}]];Z(e,P({name:`panel-right-open`},()=>n,{get iconNode(){return r}}))}var lie=new Set([`$$slots`,`$$events`,`$$legacy`]);function uie(e,t){let n=V(t,lie),r=[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`}]];Z(e,P({name:`paperclip`},()=>n,{get iconNode(){return r}}))}var die=new Set([`$$slots`,`$$events`,`$$legacy`]);function fie(e,t){let n=V(t,die),r=[[`path`,{d:`M13 21h8`}],[`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`}]];Z(e,P({name:`pen-line`},()=>n,{get iconNode(){return r}}))}var pie=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qw(e,t){let n=V(t,pie),r=[[`path`,{d:`m15 14 5-5-5-5`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`}]];Z(e,P({name:`redo-2`},()=>n,{get iconNode(){return r}}))}var mie=new Set([`$$slots`,`$$events`,`$$legacy`]);function hie(e,t){let n=V(t,mie),r=[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`}]];Z(e,P({name:`rocket`},()=>n,{get iconNode(){return r}}))}var gie=new Set([`$$slots`,`$$events`,`$$legacy`]);function _ie(e,t){let n=V(t,gie),r=[[`circle`,{cx:`6`,cy:`19`,r:`3`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`}],[`circle`,{cx:`18`,cy:`5`,r:`3`}]];Z(e,P({name:`route`},()=>n,{get iconNode(){return r}}))}var vie=new Set([`$$slots`,`$$events`,`$$legacy`]);function yie(e,t){let n=V(t,vie),r=[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`path`,{d:`m16 16-1.9-1.9`}]];Z(e,P({name:`scan-search`},()=>n,{get iconNode(){return r}}))}var bie=new Set([`$$slots`,`$$events`,`$$legacy`]);function $w(e,t){let n=V(t,bie),r=[[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M8.12 8.12 12 12`}],[`path`,{d:`M20 4 8.12 15.88`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}],[`path`,{d:`M14.8 14.8 20 20`}]];Z(e,P({name:`scissors`},()=>n,{get iconNode(){return r}}))}var xie=new Set([`$$slots`,`$$events`,`$$legacy`]);function eT(e,t){let n=V(t,xie),r=[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`}],[`path`,{d:`m21.854 2.147-10.94 10.939`}]];Z(e,P({name:`send`},()=>n,{get iconNode(){return r}}))}var Sie=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cie(e,t){let n=V(t,Sie),r=[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`}]];Z(e,P({name:`server`},()=>n,{get iconNode(){return r}}))}var tT=new Set([`$$slots`,`$$events`,`$$legacy`]);function nT(e,t){let n=V(t,tT),r=[[`path`,{d:`m10.929 14.467-.383.924`}],[`path`,{d:`M10.929 8.923 10.546 8`}],[`path`,{d:`M13.225 8.923 13.608 8`}],[`path`,{d:`m13.607 15.391-.382-.924`}],[`path`,{d:`m14.849 10.547.923-.383`}],[`path`,{d:`m14.849 12.843.923.383`}],[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`m9.305 10.547-.923-.383`}],[`path`,{d:`m9.305 12.843-.923.383`}],[`circle`,{cx:`12.077`,cy:`11.695`,r:`3`}]];Z(e,P({name:`shield-cog`},()=>n,{get iconNode(){return r}}))}var rT=new Set([`$$slots`,`$$events`,`$$legacy`]);function iT(e,t){let n=V(t,rT),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`M8 12h.01`}],[`path`,{d:`M12 12h.01`}],[`path`,{d:`M16 12h.01`}]];Z(e,P({name:`shield-ellipsis`},()=>n,{get iconNode(){return r}}))}var aT=new Set([`$$slots`,`$$events`,`$$legacy`]);function oT(e,t){let n=V(t,aT),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`M9 12h6`}]];Z(e,P({name:`shield-minus`},()=>n,{get iconNode(){return r}}))}var sT=new Set([`$$slots`,`$$events`,`$$legacy`]);function cT(e,t){let n=V(t,sT),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Z(e,P({name:`shield-question-mark`},()=>n,{get iconNode(){return r}}))}var lT=new Set([`$$slots`,`$$events`,`$$legacy`]);function uT(e,t){let n=V(t,lT),r=[[`path`,{d:`M22 2 2 22`}]];Z(e,P({name:`slash`},()=>n,{get iconNode(){return r}}))}var dT=new Set([`$$slots`,`$$events`,`$$legacy`]);function fT(e,t){let n=V(t,dT),r=[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]];Z(e,P({name:`square-terminal`},()=>n,{get iconNode(){return r}}))}var pT=new Set([`$$slots`,`$$events`,`$$legacy`]);function mT(e,t){let n=V(t,pT),r=[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`}]];Z(e,P({name:`star`},()=>n,{get iconNode(){return r}}))}var hT=new Set([`$$slots`,`$$events`,`$$legacy`]);function gT(e,t){let n=V(t,hT),r=[[`path`,{d:`M21 5H3`}],[`path`,{d:`M15 12H3`}],[`path`,{d:`M17 19H3`}]];Z(e,P({name:`text-align-start`},()=>n,{get iconNode(){return r}}))}var _T=new Set([`$$slots`,`$$events`,`$$legacy`]);function vT(e,t){let n=V(t,_T),r=[[`path`,{d:`M17 5H3`}],[`path`,{d:`M21 12H8`}],[`path`,{d:`M21 19H8`}],[`path`,{d:`M3 12v7`}]];Z(e,P({name:`text-quote`},()=>n,{get iconNode(){return r}}))}var yT=new Set([`$$slots`,`$$events`,`$$legacy`]);function bT(e,t){let n=V(t,yT),r=[[`path`,{d:`M9 14 4 9l5-5`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`}]];Z(e,P({name:`undo-2`},()=>n,{get iconNode(){return r}}))}var xT=new Set([`$$slots`,`$$events`,`$$legacy`]);function ST(e,t){let n=V(t,xT),r=[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`12`,cy:`7`,r:`4`}]];Z(e,P({name:`user`},()=>n,{get iconNode(){return r}}))}var CT=O(`<!> <!> <!>`,1),wT=O(`<span> </span>`),TT=O(`<!> <!>`,1),ET=O(`<p class="py-1 text-ui text-muted-foreground">Loading…</p>`),DT=O(`<p class="py-1 text-ui text-muted-foreground">Working tree clean.</p>`),OT=O(`<div class="flex min-h-0 flex-1 flex-col"><!></div>`);function kT(e,n){c(n,!0);let r=(e,r=m)=>{let i=L(()=>r()===`staged`?`unstage`:`stage`);var a=CT(),o=R(a);{let e=L(()=>r()===`staged`?Sw:Cw),a=L(()=>`${r()===`staged`?`Unstage`:`Stage`} all`),s=L(()=>`${r()===`staged`?`Unstage`:`Stage`} all`),c=L(()=>v(n.bulkMutation,t(i),r())),l=L(()=>!n.capabilities.bulkMutateFiles.enabled||t(d));tn(o,{get icon(){return t(e)},get label(){return t(a)},get title(){return t(s)},dense:!0,get loading(){return t(c)},get disabled(){return t(l)},onclick:e=>{e.stopPropagation(),n.onMutateScope(n.selectedRepo,r(),t(i))}})}var s=G(o,2);{let e=L(()=>`Stash all ${r()} changes`),i=L(()=>y(r())),a=L(()=>!n.capabilities.stashes.enabled||t(d));tn(s,{get icon(){return uw},get label(){return t(e)},title:`Stash all`,dense:!0,get loading(){return t(i)},get disabled(){return t(a)},onclick:e=>{e.stopPropagation(),n.onCreateStash(n.selectedRepo,r())}})}var c=G(s,2);{let e=L(()=>`Discard all ${r()} changes`),i=L(()=>v(n.bulkMutation,`discard`,r())),a=L(()=>!n.capabilities.bulkMutateFiles.enabled||t(d));tn(c,{get icon(){return ye},get label(){return t(e)},title:`Discard all`,dense:!0,get loading(){return t(i)},get disabled(){return t(a)},onclick:e=>{e.stopPropagation(),n.onRequestDiscardScope(r())}})}k(e,a)},i=(e,r=m,i=m)=>{let a=L(()=>r()===`staged`?`unstage`:`stage`);var o=CT(),s=R(o);{let e=L(()=>r()===`staged`?Sw:Cw),o=L(()=>`${r()===`staged`?`Unstage`:`Stage`} ${i()}`),c=L(()=>r()===`staged`?`Unstage`:`Stage`),l=L(()=>v(n.bulkMutation,t(a),r(),i())),u=L(()=>!n.capabilities.bulkMutateFiles.enabled||t(d));tn(s,{get icon(){return t(e)},get label(){return t(o)},get title(){return t(c)},dense:!0,get loading(){return t(l)},get disabled(){return t(u)},onclick:e=>{e.stopPropagation(),n.onMutateScope(n.selectedRepo,r(),t(a),i())}})}var c=G(s,2);{let e=L(()=>`Stash ${i()}`),a=L(()=>y(r(),i())),o=L(()=>!n.capabilities.stashes.enabled||t(d));tn(c,{get icon(){return uw},get label(){return t(e)},title:`Stash`,dense:!0,get loading(){return t(a)},get disabled(){return t(o)},onclick:e=>{e.stopPropagation(),n.onCreateStash(n.selectedRepo,r(),i())}})}var l=G(c,2);{let e=L(()=>`Discard changes in ${i()}`),a=L(()=>v(n.bulkMutation,`discard`,r(),i())),o=L(()=>!n.capabilities.bulkMutateFiles.enabled||t(d));tn(l,{get icon(){return ye},get label(){return t(e)},title:`Discard`,dense:!0,get loading(){return t(a)},get disabled(){return t(o)},onclick:e=>{e.stopPropagation(),n.onRequestDiscardScope(r(),i())}})}k(e,o)},a=(e,r=m,i=m)=>{let a=L(()=>r()===`staged`?`unstage`:`stage`),o=L(()=>n.fileMutation?.path===i().path);var s=CT(),c=R(s);{let e=L(()=>r()===`staged`?Sw:Cw),s=L(()=>`${r()===`staged`?`Unstage`:`Stage`} ${i().path}`),l=L(()=>r()===`staged`?`Unstage`:`Stage`),u=L(()=>t(o)&&n.fileMutation?.action===t(a)),f=L(()=>!n.capabilities.mutateFiles.enabled||t(d));tn(c,{get icon(){return t(e)},get label(){return t(s)},get title(){return t(l)},dense:!0,get loading(){return t(u)},get disabled(){return t(f)},onclick:e=>{e.stopPropagation(),n.onMutateFile(n.selectedRepo,i(),t(a))}})}var l=G(c,2);{let e=L(()=>`Stash ${i().path}`),a=L(()=>y(r(),i().path)),o=L(()=>!n.capabilities.stashes.enabled||t(d));tn(l,{get icon(){return uw},get label(){return t(e)},title:`Stash`,dense:!0,get loading(){return t(a)},get disabled(){return t(o)},onclick:e=>{e.stopPropagation(),n.onCreateStash(n.selectedRepo,r(),i().path)}})}var u=G(l,2);{let e=L(()=>`Discard ${i().path}`),r=L(()=>t(o)&&n.fileMutation?.action===`discard`),a=L(()=>!n.capabilities.mutateFiles.enabled||t(d));tn(u,{get icon(){return ye},get label(){return t(e)},title:`Discard`,dense:!0,get loading(){return t(r)},get disabled(){return t(a)},onclick:e=>{e.stopPropagation(),n.onRequestDiscard(i())}})}k(e,s)},o=(e,o=m,s=m,c=m,u=m,d=m)=>{var v=TT(),y=R(v);{let e=e=>{var t=f(),n=R(t),r=e=>{qn(e,{class:`-mr-1 size-3`,"aria-hidden":`true`})},i=e=>{mn(e,{class:`-mr-1 size-3`,"aria-hidden":`true`})};l(n,e=>{u()?e(r):e(i,-1)}),k(e,t)},n=e=>{r(e,c)},i=L(()=>`${o()} (${s().length})`),a=L(()=>`${u()?`Collapse`:`Expand`} ${o().toLowerCase()} changes`),p=L(()=>b(c()));$t(y,{get label(){return t(i)},get title(){return t(a)},get menuItems(){return t(p)},dense:!0,flush:!0,hoverable:!1,alwaysShowActions:!0,get ariaExpanded(){return u()},role:`none`,get onclick(){return d()},leading:e,actions:n,$$slots:{leading:!0,actions:!0}})}var x=G(y,2),C=e=>{let r=L(()=>c()===`staged`?t(p):t(h)),s=L(()=>c()===`staged`?t(g):t(_));{let l=(e,n=m)=>{{let r=L(()=>n().join(`/`));i(e,c,()=>t(r))}},u=(e,n=m,r=m)=>{{let i=L(()=>n().at(-1)??``);Ic(e,{get name(){return t(i)},kind:`directory`,get open(){return r()}})}},d=(e,n=m)=>{{let r=L(()=>n().path.slice(n().path.lastIndexOf(`/`)+1));Ic(e,{get name(){return t(r)},kind:`file`})}},f=(e,t=m)=>{var n=wT(),r=z(n,!0);F((e,t,i,a)=>{X(n,1,e),J(n,`title`,t),J(n,`aria-label`,i),w(r,a)},[()=>T(ft(`w-3 text-center text-ui`,vx(t()))),()=>bx(t(),c()),()=>bx(t(),c()),()=>yx(t(),c())]),k(e,n)},p=(e,t=m)=>{a(e,c,t)},h=L(()=>`${o()} file tree`);Qt(e,{get nodes(){return t(r)},get ariaLabel(){return t(h)},baseIndent:0,showGroupDisclosure:!1,overlayActions:!0,get expandedIds(){return t(s)},getGroupMenuItems:e=>b(c(),e.join(`/`)),getItemMenuItems:e=>S(c(),e),get getItemTone(){return _x},getItemTitle:e=>`${bx(e,c())} · ${e.renamedFrom?`${e.renamedFrom} → `:``}${e.path}`,onItemActivate:e=>n.onOpenDiff(n.selectedRepo,e,c()),onGroupExpansionChange:(e,t)=>n.onFolderExpansionChange(n.selectedRepo,IC(c(),e),t),groupActions:l,groupIcon:u,itemLeading:d,itemBadges:f,itemActions:p,$$slots:{groupActions:!0,groupIcon:!0,itemLeading:!0,itemBadges:!0,itemActions:!0}})}};l(x,e=>{u()&&e(C)}),k(e,v)},s=Y(!0),u=Y(!0),d=L(()=>!!(n.fileMutation||n.bulkMutation||n.stashMutation)),p=L(()=>Yt(n.stagedFiles,{getPath:e=>e.path.split(`/`),getKey:e=>`staged:${e.path}`})),h=L(()=>Yt(n.unstagedFiles,{getPath:e=>e.path.split(`/`),getKey:e=>`unstaged:${e.path}`})),g=L(()=>LC(t(p),`staged`,n.collapsedFolders)),_=L(()=>LC(t(h),`unstaged`,n.collapsedFolders));function v(e,t,n,r){return e?.action===t&&e.area===n&&e.path===r}function y(e,t){return n.stashMutation?.action===`create`&&n.stashMutation.area===e&&n.stashMutation.path===t}function b(e,r){let i=e===`staged`?`unstage`:`stage`;return[{label:e===`staged`?`Unstage`:`Stage`,icon:e===`staged`?Sw:Cw,disabled:!n.capabilities.bulkMutateFiles.enabled||t(d),onSelect:()=>n.onMutateScope(n.selectedRepo,e,i,r)},{label:`Stash`,icon:uw,disabled:!n.capabilities.stashes.enabled||t(d),onSelect:()=>n.onCreateStash(n.selectedRepo,e,r)},{type:`separator`},{label:`Discard`,icon:kn,destructive:!0,disabled:!n.capabilities.bulkMutateFiles.enabled||t(d),onSelect:()=>n.onRequestDiscardScope(e,r)}]}function S(e,r){let i=e===`staged`?`unstage`:`stage`;return[{label:`View`,icon:ww,onSelect:()=>n.onOpenDiff(n.selectedRepo,r,e)},{label:e===`staged`?`Unstage`:`Stage`,icon:e===`staged`?Sw:Cw,disabled:!n.capabilities.mutateFiles.enabled||t(d),onSelect:()=>n.onMutateFile(n.selectedRepo,r,i)},{label:`Stash`,icon:uw,disabled:!n.capabilities.stashes.enabled||t(d),onSelect:()=>n.onCreateStash(n.selectedRepo,e,r.path)},{type:`separator`},{label:`Discard`,icon:kn,destructive:!0,disabled:!n.capabilities.mutateFiles.enabled||t(d),onSelect:()=>n.onRequestDiscard(r)}]}var C=OT(),E=q(C),O=e=>{var t=ET();k(e,t)},A=e=>{var t=DT();k(e,t)},j=e=>{fn(e,{class:`min-h-0 flex-1`,viewportClass:`min-w-0`,children:(e,r)=>{Zt(e,{role:`none`,class:`py-0.5`,children:(e,r)=>{var i=TT(),a=R(i),c=e=>{o(e,()=>`Staged`,()=>n.stagedFiles,()=>`staged`,()=>t(s),()=>()=>B(s,!t(s)))};l(a,e=>{n.stagedFiles.length>0&&e(c)});var d=G(a,2),f=e=>{o(e,()=>`Unstaged`,()=>n.unstagedFiles,()=>`unstaged`,()=>t(u),()=>()=>B(u,!t(u)))};l(d,e=>{n.unstagedFiles.length>0&&e(f)}),k(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}})};l(E,e=>{n.changes?n.changes.files.length===0?e(A,1):e(j,-1):e(O)}),x(C),k(e,C),D()}var AT=new Set([`Update the branch with the latest base changes`,`Branch protection requirements are not satisfied`,`Checks are still running`,`Required checks are failing`,`Changes were requested`,`An approving review is required`]);function jT(e){switch(e.status){case`passing`:return`success`;case`failing`:return`destructive`;case`pending`:return`warning`;default:return`neutral`}}function MT(e){return!e||e.isDraft?`neutral`:e.state===`MERGED`?`info`:e.state===`CLOSED`?`destructive`:`success`}function NT(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`})}function PT(e){return[`merge`,`squash`,`rebase`].find(t=>e.includes(t))}function FT(e){return e===`merge`?`Create a merge commit`:e===`squash`?`Squash and merge`:`Rebase and merge`}function IT(e){if(e.state!==`OPEN`)return{status:`blocked`,reasons:[`Pull request is not open`],bypassable:!1};if(e.isDraft)return{status:`blocked`,reasons:[`Pull request is still a draft`],bypassable:!1};if(!e.headRefOid||e.mergeable===null||e.mergeable===`UNKNOWN`)return{status:`unknown`,reasons:[`GitHub is calculating mergeability`],bypassable:!1};let t=[];return e.mergeable===`CONFLICTING`&&t.push(`Resolve merge conflicts`),e.mergeStateStatus===`BEHIND`&&t.push(`Update the branch with the latest base changes`),e.mergeStateStatus===`BLOCKED`&&t.push(`Branch protection requirements are not satisfied`),e.mergeStateStatus===`DIRTY`&&t.push(`Resolve merge conflicts`),e.checks.status===`pending`&&t.push(`Checks are still running`),e.checks.status===`failing`&&t.push(`Required checks are failing`),e.reviewDecision===`CHANGES_REQUESTED`&&t.push(`Changes were requested`),e.reviewDecision===`REVIEW_REQUIRED`&&t.push(`An approving review is required`),e.mergeSettings.allowedMethods.length===0&&t.push(`No merge method is enabled`),t.length===0?{status:`ready`,reasons:[],bypassable:!1}:{status:`blocked`,reasons:[...new Set(t)],bypassable:e.viewerCanMergeAsAdmin&&t.every(e=>AT.has(e))}}function LT(e){return[...e.comments.map(e=>({kind:`comment`,at:e.createdAt,value:e})),...e.reviews.map(e=>({kind:`review`,at:e.submittedAt,value:e}))].sort((e,t)=>e.at.localeCompare(t.at))}function RT(e){return e===`added`?`A`:e===`removed`?`D`:e===`renamed`?`R`:e===`copied`?`C`:`M`}function zT(e){return e===`added`?`text-success`:e===`removed`?`text-destructive`:e===`renamed`||e===`copied`?`text-info`:`text-warning`}function BT(e,t=Date.now()){let n=js(e,{now:t});return n?n.endsWith(`mo`)||n.endsWith(`y`)?new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`}):js(e,{style:`long`,now:t}):``}function VT(e,t=Date.now()){let n=e?Date.parse(e):NaN;if(Number.isNaN(n))return`Unknown date`;let r=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()},i=Math.round((r(t)-r(n))/864e5);return i===0?`Today`:i===1?`Yesterday`:new Date(n).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function HT(e,t=Date.now()){let n=[];for(let r of e){let e=VT(r.authoredDate,t),i=n.at(-1);i?.day===e?i.commits.push(r):n.push({day:e,commits:[r]})}return n}var UT=new Set([`Checks are still running`,`GitHub is calculating mergeability`]);function WT(e){if(e.status===`ready`)return{kind:`ready`};let t=e.reasons.join(` · `);return{kind:e.reasons.every(e=>UT.has(e))?`waiting`:`blocked`,reason:t,bypassable:e.bypassable}}var GT={APPROVED:`approved`,CHANGES_REQUESTED:`changes`,COMMENTED:`commented`};function KT(e,t,n){let r=new Map,i=[...e?.reviews??[]].sort((e,t)=>e.submittedAt.localeCompare(t.submittedAt));for(let e of i){let t=GT[e.state];e.author&&t&&e.author!==n&&(t===`commented`&&r.has(e.author)||r.set(e.author,t))}let a=(t?.reviewRequests??[]).filter(e=>!r.has(e.login));return[...[...r].map(([e,t])=>({login:e,state:t})),...a.map(e=>({login:e.login,state:`requested`}))]}var qT=O(`<span class="inline-flex shrink-0 text-foreground" role="img" aria-label="Checked out locally" title="Checked out locally"><!></span>`),JT=O(`<!> `,1),YT=O(`<span class="flex shrink-0 items-center gap-1 text-muted-foreground"><!> </span>`),XT=O(`<div class="flex min-w-0 items-center gap-1.5 pl-1 text-ui"><span class="min-w-0 flex-1 truncate text-muted-foreground"> </span> <span class="flex size-4 shrink-0 items-center justify-center"><!> <span class="sr-only"> </span></span></div>`),ZT=O(`<div class="mt-0.5 flex flex-col gap-0.5"></div>`),QT=O(`<div class="flex min-w-0 items-center gap-1.5"><!> <span class="shrink-0 font-mono text-foreground"> </span> <span class="min-w-0 shrink truncate text-muted-foreground"> </span> <!> <span class="min-w-0 flex-1"></span> <span class="flex shrink-0 items-center"><!> <!></span></div> <button type="button" class="cursor-pointer rounded-sm text-left focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"><span class="line-clamp-2 break-words text-foreground"> </span></button> <div class="flex min-w-0 items-center gap-2"><button type="button" class="shrink-0 rounded-sm focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none disabled:pointer-events-none"><!></button> <!> <span class="min-w-0 flex-1"></span> <span class="shrink-0 font-mono text-caption tabular-nums"><span class="text-success"> </span> <span class="text-destructive"> </span></span></div> <!>`,1);function $T(e,n){c(n,!0);let r=K(n,`checkedOut`,3,!1),i=L(()=>n.pr.checks.runs.length>0),a=L(()=>Ps(n.pr.checks)),o=L(()=>n.pr.isDraft?Gw:n.pr.state===`MERGED`?vw:n.pr.state===`CLOSED`?Bc:ac),s=L(()=>ns[MT(n.pr)]),u=L(()=>js(n.pr.updatedAt));async function d(e){try{await ri(e)}catch{ui.error(`Could not copy to clipboard`)}}let f=()=>d(n.pr.url),p=L(()=>[{label:`Open pull request`,icon:cie,disabled:n.disabled,onSelect:n.onOpen},{label:`Open on GitHub`,icon:$s,onSelect:()=>window.open(n.pr.url,`_blank`,`noreferrer`)},{type:`separator`},{label:`Copy link`,icon:yw,onSelect:()=>void f()},{label:`Copy branch name`,icon:nc,onSelect:()=>void d(n.pr.headRefName)},{label:`Copy title`,icon:sr,onSelect:()=>void d(n.pr.title)},...t(i)?[{type:`separator`},{label:n.expanded?`Hide check details`:`Show check details`,icon:Vc,onSelect:n.onToggleChecks}]:[]]);{let c=L(()=>n.disabled?void 0:n.onOpen);xe(e,{role:`listitem`,hover:`default`,get menuItems(){return t(p)},class:`group flex-col gap-1 px-2.5 py-2 text-ui leading-tight`,get onclick(){return t(c)},children:(e,c)=>{var d=QT(),p=R(d),m=q(p);{let e=L(()=>`size-3.5 shrink-0 ${t(s)}`),r=L(()=>n.pr.isDraft?`Draft pull request`:n.pr.state.toLowerCase());H(m,()=>t(o),(n,i)=>{i(n,{get class(){return t(e)},get"aria-label"(){return t(r)}})})}var g=G(m,2),_=z(g),y=G(g,2),b=z(y),S=G(y,2),C=e=>{var t=qT(),n=q(t);Wn(n,{class:`size-3.5`,"aria-hidden":`true`}),x(t),k(e,t)};l(S,e=>{r()&&e(C)});var T=G(S,4),E=q(T);{let e=L(()=>`Copy link to PR #${n.pr.number}`);Q(E,{size:`icon-sm`,variant:`ghost`,title:`Copy pull request link`,get"aria-label"(){return t(e)},onclick:e=>{e.stopPropagation(),f()},children:(e,t)=>{yw(e,{"aria-hidden":`true`})},$$slots:{default:!0}})}var D=G(E,2);{let e=L(()=>`Open PR #${n.pr.number} on GitHub`);Q(D,{size:`icon-sm`,variant:`ghost`,get href(){return n.pr.url},target:`_blank`,rel:`noreferrer`,title:`Open on GitHub`,get"aria-label"(){return t(e)},onclick:e=>e.stopPropagation(),children:(e,t)=>{$s(e,{"aria-hidden":`true`})},$$slots:{default:!0}})}x(T),x(p);var O=G(p,2),A=q(O),j=z(A,!0);x(O);var M=G(O,2),N=q(M),P=q(N);{let e=L(()=>jT(n.pr.checks));be(P,{get variant(){return t(e)},children:(e,r)=>{var i=JT(),o=R(i),s=e=>{dn(e,{class:`size-3`})},c=e=>{ic(e,{class:`size-3`,"aria-hidden":`true`})},u=e=>{ye(e,{class:`size-3`,"aria-hidden":`true`})};l(o,e=>{t(a)?e(s):n.pr.checks.status===`passing`?e(c,1):n.pr.checks.status===`failing`&&e(u,2)});var d=G(o);F(()=>w(d,` ${n.pr.checks.status===`none`?`no checks`:`${n.pr.checks.passed}/${n.pr.checks.total}`}`)),k(e,i)},$$slots:{default:!0}})}x(N);var I=G(N,2),ee=e=>{var t=YT(),r=q(t);Hc(r,{class:`size-3`,"aria-hidden":`true`});var i=G(r);x(t),F(()=>{J(t,`title`,`${n.pr.commentCount} comments`),w(i,` ${n.pr.commentCount??``}`)}),k(e,t)};l(I,e=>{n.pr.commentCount>0&&e(ee)});var te=G(I,4),ne=q(te),re=z(ne),ie=G(ne,2),B=z(ie);x(te),x(M);var ae=G(M,2),V=e=>{var r=ZT();v(r,23,()=>n.pr.checks.runs,(e,t)=>`${e.name}:${t}`,(e,n)=>{let r=L(()=>Bs(t(n).status));var i=XT(),a=q(i),o=z(a,!0),s=G(a,2),c=q(s),u=e=>{ic(e,{class:`size-3 text-success`,"aria-hidden":`true`})},d=e=>{ye(e,{class:`size-3 text-destructive`,"aria-hidden":`true`})},f=e=>{dn(e,{class:`size-3 text-warning`})};l(c,e=>{t(r)===`passed`?e(u):t(r)===`failed`?e(d,1):e(f,-1)});var p=G(c,2),m=z(p,!0);x(s),x(i),F(()=>{w(o,t(n).name),J(s,`title`,t(n).status),w(m,t(n).status)}),k(e,i)}),x(r),k(e,r)};l(ae,e=>{n.expanded&&t(i)&&e(V)}),F(e=>{w(_,`#${n.pr.number??``}`),w(b,`${n.pr.author??`unknown`??``}${t(u)?` · ${t(u)}`:``}`),O.disabled=n.disabled,J(O,`title`,n.disabled?n.disabledReason:`${n.pr.title} · ${n.pr.baseRefName} ← ${n.pr.headRefName}`),w(j,n.pr.title),N.disabled=!t(i),J(N,`aria-expanded`,t(i)?n.expanded:void 0),J(N,`title`,e),J(te,`title`,`${n.pr.additions} additions, ${n.pr.deletions} deletions`),w(re,`+${n.pr.additions??``}`),w(B,`−${n.pr.deletions??``}`)},[()=>t(i)?`${Is(n.pr.checks)} · ${n.expanded?`Collapse`:`Expand`} check details`:`No check details`]),h(`click`,O,e=>{e.stopPropagation(),n.onOpen()}),h(`click`,N,e=>{e.stopPropagation(),n.onToggleChecks()}),k(e,d)},$$slots:{default:!0}})}D()}ue([`click`]);var eE=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function tE(e,t={}){switch(e.kind){case`running`:return{spinner:!0,tone:`text-muted-foreground`,label:`${t.operation??`Operation`} running. Click to stop.`};case`failed`:return{icon:Qs,tone:`text-destructive`,label:`${t.operation??`Operation`} failed${t.failure?`: ${t.failure}`:``}. Click to retry.`};case`diverged`:return{icon:fw,tone:`text-warning`,label:`${eE(e.behind,`commit`)} to pull, ${eE(e.ahead,`commit`)} to push. Click to sync.`};case`behind`:return{icon:Ys,tone:`text-warning`,label:`${eE(e.behind,`commit`)} to pull. Click to pull.`};case`unpublished`:return{icon:gw,tone:`text-muted-foreground`,label:`Not published${e.unpublished?`: ${eE(e.unpublished,`commit`)}`:``}. Click to publish.`};case`ahead`:return{icon:Zs,tone:`text-muted-foreground`,label:`${eE(e.ahead,`commit`)} to push. Click to push.`};default:return}}function nE(e){return e===`sync`?{icon:fw,tone:`text-muted-foreground/70 hover:text-foreground`,label:`Up to date. Click to sync.`}:{icon:mw,tone:`text-muted-foreground/70 hover:text-foreground`,label:`Up to date. Click to fetch.`}}var rE=e=>e.hasRemote&&e.hasUpstream&&!e.detached;function iE(e){if(!e)return;if(jx(e))return{icon:vw,tone:`text-info`,label:`#${e.number} merged`};let{checks:t}=e,n=t.status===`failing`?`text-destructive`:t.status===`pending`?`text-warning`:t.status===`passing`?`text-success`:`text-muted-foreground`,r=t.status===`none`?`no checks`:`checks ${t.status}, ${t.passed}/${t.total}`;return{icon:e.isDraft?Gw:ac,tone:n,label:`#${e.number}${e.isDraft?` draft`:``}: ${r}`}}function aE(e,t,n){if(e.length===0)return;let r=e.findIndex(e=>e.id===t),i=r===-1?void 0:e[r];switch(n){case`ArrowDown`:return{type:`focus`,id:e[Math.min(r+1,e.length-1)].id};case`ArrowUp`:return{type:`focus`,id:e[Math.max(r-1,0)].id};case`Home`:return{type:`focus`,id:e[0].id};case`End`:return{type:`focus`,id:e[e.length-1].id};case`ArrowRight`:{if(i?.kind!==`repository`)return;if(!i.expanded)return{type:`expand`,id:i.id};let t=e[r+1];return t?.parent===i.id?{type:`focus`,id:t.id}:void 0}case`ArrowLeft`:return i?i.kind===`repository`?i.expanded?{type:`collapse`,id:i.id}:void 0:i.parent?{type:`focus`,id:i.parent}:void 0:void 0;case`Enter`:case` `:return i?i.kind===`branch`?{type:`select`,id:i.id}:{type:`toggle`,id:i.id}:void 0;default:return}}var oE=(e,n=m,r=m)=>{let i=L(()=>ft(`size-3.5 shrink-0`,r()?`text-primary`:`text-muted-foreground`));var a=f(),o=R(a),s=e=>{hw(e,{get class(){return t(i)},"aria-label":`No remote`})},c=e=>{lw(e,{get class(){return t(i)}})},u=e=>{pw(e,{get class(){return t(i)},"aria-label":`Remote (not GitHub)`})};l(o,e=>{n().hasRemote?n().hasGithubRemote?e(c,1):e(u,-1):e(s)}),k(e,a)},sE=(e,t=m,n=m,r=m)=>{var i=lE(),a=q(i);oE(a,t,r);var o=G(a,2),s=q(o),c=e=>{qn(e,{class:`size-2.5`,strokeWidth:3})},u=e=>{mn(e,{class:`size-2.5`,strokeWidth:3})};l(s,e=>{n()?e(c):e(u,-1)}),x(o),x(i),k(e,i)},cE=(e,n=m,r=m)=>{var i=f(),a=R(i),o=e=>{var t=pE();F(()=>J(t,`title`,n().absDir)),k(e,t)},s=e=>{let i=L(()=>Px(n().currentBranch));var a=mE(),o=q(a),s=z(o,!0),c=G(o),l=z(c,!0);x(a),F((e,r)=>{X(a,1,e),J(a,`title`,`${n().currentBranch}\n${n().absDir}`),X(o,1,r),w(s,t(i).head),w(l,t(i).tail)},[()=>T(ft(`flex min-w-0 overflow-hidden`,r()&&`text-foreground`)),()=>T(ft(`truncate`,t(i).tail&&`min-w-[6ch]`))]),k(e,a)};l(a,e=>{n().detached||!n().currentBranch?e(o):e(s,-1)}),k(e,i)},lE=O(`<span class="relative flex size-4 shrink-0 items-center justify-center"><!> <span class="absolute -right-1 -bottom-1 flex size-2.5 items-center justify-center rounded-full bg-panel text-muted-foreground" aria-hidden="true"><!></span></span>`),uE=O(`<button><!></button>`),dE=O(`<!> <!>`,1),fE=O(`<button> </button>`),pE=O(`<span class="min-w-0 truncate text-warning">detached</span>`),mE=O(`<span><span> </span><span class="shrink-0"> </span></span>`),hE=O(`<button type="button" tabindex="-1" class="-mx-1 shrink-0 cursor-pointer rounded-sm px-1 text-muted-foreground hover:bg-hover hover:text-foreground"> </button>`),gE=O(`<span class="shrink-0 text-muted-foreground"> </span>`),_E=O(`<span class="flex h-[1lh] min-w-0 flex-1 flex-wrap items-baseline gap-x-1.5 overflow-hidden"><span class="max-w-full min-w-0 truncate text-foreground"> </span> <!></span>`),vE=O(`<span class="min-w-0 truncate text-foreground"> </span>`),yE=O(`<span class="ml-auto flex shrink-0 items-center gap-1.5"><!> <!> <!></span>`),bE=O(`<div role="treeitem"><!> <!> <!></div>`),xE=O(`<span><!></span>`),SE=O(`<div role="treeitem"><!> <!> <span class="ml-auto flex shrink-0 items-center gap-1.5"><!> <!> <!></span></div>`),CE=O(`<div role="group" class="flex flex-col"></div>`),wE=O(`<div class="flex flex-col"><!> <!></div>`),TE=O(`<p class="px-2 py-3 text-ui text-muted-foreground">No repository matches.</p>`),EE=O(`<div role="tree" aria-label="Repositories" class="flex flex-col gap-1"></div>`);function DE(e,r){c(r,!0);let i=(e,n=m,r=m,i=m)=>{var a=f(),o=R(a);H(o,()=>wn,(e,a)=>{a(e,{children:(e,a)=>{var o=dE(),s=R(o);{let e=(e,a)=>{let o=()=>(a?.()).props;var s=uE(),c=e=>{e.stopPropagation(),i()()};ie(s,e=>({...o(),type:`button`,tabindex:t(E)===r()?0:-1,class:e,"aria-label":n().label,onclick:c}),[()=>ft(`flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm hover:bg-hover focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none`,n().tone)]);var u=q(s),d=e=>{dn(e,{class:`size-3`})},p=e=>{let r=L(()=>n().icon);var i=f(),a=R(i);H(a,()=>t(r),(e,t)=>{t(e,{class:`size-3`})}),k(e,i)};l(u,e=>{n().spinner?e(d):n().icon&&e(p,1)}),x(s),k(e,s)};H(s,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(s,2);H(c,()=>Sn,(e,t)=>{t(e,{children:(e,t)=>{y();var r=g();F(()=>w(r,n().label)),k(e,r)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})}),k(e,a)},a=(e,n=m,r=m,i=m)=>{var a=f(),o=R(a),s=e=>{let a=L(()=>`${n()} changed ${n()===1?`file`:`files`}`);var o=f(),s=R(o);H(s,()=>wn,(e,o)=>{o(e,{children:(e,o)=>{var s=dE(),c=R(s);{let e=(e,o)=>{let s=()=>(o?.()).props;var c=fE(),l=e=>{e.stopPropagation(),i()()};ie(c,()=>({...s(),type:`button`,tabindex:t(E)===r()?0:-1,class:`flex h-5 min-w-5 shrink-0 cursor-pointer items-center justify-center rounded-sm px-0.5 text-caption text-foreground tabular-nums hover:bg-hover focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none`,"aria-label":t(a),onclick:l}));var u=z(c,!0);F(()=>w(u,n())),k(e,c)};H(c,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var l=G(c,2);H(l,()=>Sn,(e,n)=>{n(e,{children:(e,n)=>{y();var r=g();F(()=>w(r,t(a))),k(e,r)},$$slots:{default:!0}})}),k(e,s)},$$slots:{default:!0}})}),k(e,o)};l(o,e=>{n()>0&&e(s)}),k(e,a)},o=(e,o)=>{let s=()=>(o?.()).group,c=()=>(o?.()).repos,p=L(()=>u(s().key)),m=L(()=>c().some(e=>e.relativePath===r.selected)),g=L(()=>Nx(s().repos,r.context)),_=L(()=>tE(t(g).sync,r.failureDetail(t(g).syncRepo??s().primary))),v=L(()=>iE(t(g).pullRequest)),y=L(()=>s().repos.length===1?s().repos[0]:void 0);var b=f(),S=R(b);H(S,()=>_n,(e,o)=>{o(e,{children:(e,o)=>{var c=dE(),u=R(c);H(u,()=>pn,(e,n)=>{n(e,{class:`block min-w-0`,children:(e,n)=>{var o=bE();J(o,`aria-level`,1);var c=q(o);sE(c,()=>s().primary,()=>t(p),()=>t(m));var u=G(c,2),f=e=>{var n=_E(),i=q(n),a=z(i,!0),o=G(i,2),c=e=>{var n=hE(),i=z(n,!0);F(()=>{J(n,`title`,`Select ${t(y).currentBranch}\n${t(y).absDir}`),w(i,t(y).currentBranch)}),M(`pointerenter`,n,()=>I(t(y).relativePath,N)),M(`pointerleave`,n,()=>clearTimeout(P)),h(`click`,n,e=>{e.stopPropagation(),r.onSelect(t(y).relativePath)}),h(`dblclick`,n,e=>{e.stopPropagation(),r.onOpenBranchPicker(t(y).relativePath)}),k(e,n)},u=e=>{var n=gE(),r=z(n,!0);F(()=>{J(n,`title`,t(y).currentBranch),w(r,t(y).currentBranch)}),k(e,n)};l(o,e=>{r.selectable?e(c):e(u,-1)}),x(n),F(()=>{J(i,`title`,s().primary.absDir),w(a,s().name)}),k(e,n)},b=e=>{var t=vE(),n=z(t,!0);F(()=>{J(t,`title`,s().primary.absDir),w(n,s().name)}),k(e,t)};l(u,e=>{!t(p)&&t(y)?.currentBranch&&!t(y).detached?e(f):e(b,-1)});var S=G(u,2),D=e=>{var n=yE(),o=q(n),c=e=>{{let n=L(()=>d(s().key));i(e,()=>t(_),()=>t(n),()=>()=>r.onToggleGroup(s().key,!0))}},u=e=>{{let n=L(()=>nE(`sync`)),a=L(()=>d(s().key));i(e,()=>t(n),()=>t(a),()=>()=>r.onSyncAction(t(y),t(g).sync))}},f=L(()=>t(y)&&rE(t(y))),p=e=>{{let n=L(()=>nE(`fetch`)),a=L(()=>d(s().key));i(e,()=>t(n),()=>t(a),()=>()=>r.onFetch(s().primary))}};l(o,e=>{t(_)?e(c):t(f)?e(u,1):!t(y)&&s().primary.hasRemote&&e(p,2)});var m=G(o,2),h=e=>{{let n=L(()=>d(s().key));i(e,()=>t(v),()=>t(n),()=>()=>r.onToggleGroup(s().key,!0))}};l(m,e=>{t(v)&&e(h)});var b=G(m,2);{let e=L(()=>d(s().key));a(b,()=>t(g).changes,()=>t(e),()=>()=>r.onToggleGroup(s().key,!0))}x(n),k(e,n)};l(S,e=>{t(p)||e(D)}),x(o),F((e,n,r)=>{J(o,`aria-selected`,!t(p)&&t(m)),J(o,`aria-expanded`,t(p)),J(o,`aria-label`,`${s().name}, ${s().repos.length} ${s().repos.length===1?`branch`:`branches`}`),J(o,`data-row-id`,e),J(o,`tabindex`,n),X(o,1,r)},[()=>d(s().key),()=>t(E)===d(s().key)?0:-1,()=>T(ft(`flex h-control-sm w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-md pr-1 pl-2 text-ui transition-colors hover:bg-hover focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none`,!t(p)&&t(m)&&`bg-selected hover:bg-selected`))]),M(`focus`,o,()=>B(C,d(s().key),!0)),h(`click`,o,()=>r.onToggleGroup(s().key,!t(p))),h(`keydown`,o,e=>j(e,d(s().key))),k(e,o)},$$slots:{default:!0}})});var b=G(u,2);H(b,()=>vn,(e,t)=>{t(e,{children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.repositoryMenu,s),k(e,i)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})}),k(e,b)},s=(e,o=m,s=m)=>{let c=L(()=>s().relativePath===r.selected),u=L(()=>Wc({selected:t(c)})),d=L(()=>Dx(s(),r.context)),_=L(()=>tE(t(d),r.failureDetail(s()))),v=L(()=>r.context.pullRequest(s())),b=L(()=>iE(t(v)));var S=f(),D=R(S);H(D,()=>_n,(e,m)=>{m(e,{children:(e,m)=>{var S=dE(),D=R(S);H(D,()=>pn,(e,n)=>{n(e,{class:`block min-w-0`,children:(e,n)=>{var m=SE();J(m,`aria-level`,2);var S=q(m);cE(S,s,()=>t(c));var D=G(S,2),O=e=>{var n=f(),r=R(n);H(r,()=>wn,(e,n)=>{n(e,{children:(e,n)=>{var r=dE(),i=R(r);{let e=(e,n)=>{let r=()=>(n?.()).props;var i=xE();ie(i,()=>({...r(),class:`flex shrink-0 text-muted-foreground`}));var a=q(i);{let e=L(()=>`Primary worktree, ${o().primary.absDir}`);Kw(a,{class:`size-3`,get"aria-label"(){return t(e)}})}x(i),k(e,i)};H(i,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var a=G(i,2);H(a,()=>Sn,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(()=>w(n,`Primary worktree · ${o().primary.absDir??``}`)),k(e,n)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,n)},A=L(()=>Sx(s())&&o().repos.length>1);l(D,e=>{t(A)&&e(O)});var ee=G(D,2),te=q(ee),ne=e=>{{let n=L(()=>p(s().relativePath));i(e,()=>t(_),()=>t(n),()=>()=>r.onSyncAction(s(),t(d)))}},re=e=>{{let n=L(()=>nE(`sync`)),a=L(()=>p(s().relativePath));i(e,()=>t(n),()=>t(a),()=>()=>r.onSyncAction(s(),t(d)))}},z=L(()=>rE(s()));l(te,e=>{t(_)?e(ne):t(z)&&e(re,1)});var ae=G(te,2),V=e=>{{let n=L(()=>p(s().relativePath));i(e,()=>t(b),()=>t(n),()=>()=>r.onOpenPullRequest(s(),t(v)))}};l(ae,e=>{t(b)&&t(v)&&e(V)});var oe=G(ae,2);{let e=L(()=>p(s().relativePath));a(oe,()=>s().changeCount,()=>t(e),()=>()=>r.onOpenChanges(s().relativePath))}x(ee),x(m),F((e,n,r,i)=>{J(m,`aria-selected`,t(c)),J(m,`aria-label`,e),J(m,`data-row-id`,n),J(m,`tabindex`,r),X(m,1,i)},[()=>`${s().currentBranch??`detached`} in ${o().name}${o().primary===s()?``:`, worktree ${wx(s())}`}`,()=>p(s().relativePath),()=>t(E)===p(s().relativePath)?0:-1,()=>T(t(u).base({class:ft(`flex h-control-sm min-w-0 items-center gap-1.5 pr-1 pl-6 text-ui select-none`,!t(c)&&`text-muted-foreground hover:text-foreground`,r.selectable?`cursor-pointer`:`hover:bg-transparent`)}))]),M(`focus`,m,()=>{B(C,p(s().relativePath),!0),I(s().relativePath,0)}),M(`pointerenter`,m,()=>I(s().relativePath,N)),M(`pointerleave`,m,()=>clearTimeout(P)),h(`click`,m,()=>{r.selectable&&r.onSelect(s().relativePath)}),h(`dblclick`,m,e=>{e.target.closest(`button`)||r.selectable&&r.onOpenBranchPicker(s().relativePath)}),h(`keydown`,m,e=>j(e,p(s().relativePath))),k(e,m)},$$slots:{default:!0}})});var O=G(D,2);H(O,()=>vn,(e,t)=>{t(e,{children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.branchMenu,s),k(e,i)},$$slots:{default:!0}})}),k(e,S)},$$slots:{default:!0}})}),k(e,S)},u=e=>r.forceExpanded||r.expanded.has(e),d=e=>`g:${e}`,p=e=>`b:${e}`,_=e=>e.slice(2),b=L(()=>r.groups.flatMap(({group:e,repos:t})=>{let n=u(e.key);return[{id:d(e.key),kind:`repository`,expanded:n},...n?t.map(t=>({id:p(t.relativePath),kind:`branch`,parent:d(e.key)})):[]]})),S=Y(void 0),C=Y(void 0),E=L(()=>t(b).find(e=>e.id===t(C))?.id??t(b).find(e=>e.id===p(r.selected))?.id??t(b)[0]?.id);function O(e){B(C,e,!0),t(S)?.querySelector(`[data-row-id="${CSS.escape(e)}"]`)?.focus()}function A(e){if(u(e))return;let t=r.groups.find(t=>t.group.key===e)?.group.repos;return t?.length===1?t[0]:void 0}function j(e,n){if(e.target!==e.currentTarget||e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`)return;let i=aE(t(b),n,e.key),a=i?.type===`toggle`&&r.selectable?A(_(i.id)):void 0;if(a)e.preventDefault(),r.onSelect(a.relativePath);else if(i)switch(e.preventDefault(),i.type){case`focus`:O(i.id);break;case`expand`:r.onToggleGroup(_(i.id),!0);break;case`collapse`:r.onToggleGroup(_(i.id),!1);break;case`toggle`:r.onToggleGroup(_(i.id),!u(_(i.id)));break;case`select`:r.selectable&&r.onSelect(_(i.id))}}let N=120,P;function I(e,t){clearTimeout(P),r.onHint&&e!==r.selected&&(P=setTimeout(()=>r.onHint(e),t))}W(()=>()=>clearTimeout(P));var ee=f(),ne=R(ee);H(ne,()=>En,(e,n)=>{n(e,{delayDuration:600,skipDelayDuration:0,children:(e,n)=>{var i=EE();v(i,21,()=>r.groups,e=>e.group.key,(e,n)=>{var r=wE(),i=q(r);o(i,()=>t(n));var a=G(i,2),c=e=>{var r=CE();v(r,21,()=>t(n).repos,e=>e.relativePath,(e,r)=>{s(e,()=>t(n).group,()=>t(r))}),x(r),k(e,r)},d=L(()=>u(t(n).group.key));l(a,e=>{t(d)&&e(c)}),x(r),k(e,r)},e=>{var t=TE();k(e,t)}),x(i),te(i,e=>B(S,e),()=>t(S)),k(e,i)},$$slots:{default:!0}})}),k(e,ee),D()}ue([`click`,`keydown`,`dblclick`]);function OE(e,t){return e.collapsible===!1||!(t.collapsed[e.id]??e.defaultCollapsed??!1)}function kE(e,t){let n=-1,r=-1/0;return e.forEach((e,i)=>{if(!OE(e,t))return;let a=e.fill??i;a>=r&&(n=i,r=a)}),n}var AE=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));function jE(e){let{areas:t,layout:n}=e,r=Math.max(0,e.totalPx),i=kE(t,n),a=t.map(t=>{if(!OE(t,n))return t.headerPx??0;let i=n.sizes[t.id];if(i!==void 0)return Math.max(t.minPx,i*r);let a=e.contentPx[t.id]||0,o=t.fitContent?Math.min(t.minPx,a||t.minPx):t.minPx;return AE(a||t.minPx,o,(t.autoMaxShare??1)*r)});if(i<0)return NE(a,r);let o=a.map((e,t)=>t).filter(e=>e!==i),s=()=>o.reduce((e,t)=>e+a[t],0),c=t[i].minPx-(r-s());for(let e of o){if(c<=0)break;let r=Math.min(c,a[e]-ME(t[e],a[e],n));r>0&&(a[e]-=r,c-=r)}return a[i]=Math.max(0,r-s()),NE(a,r)}function ME(e,t,n){return OE(e,n)?Math.min(e.minPx,t):t}function NE(e,t){let n=[...e],r=n.reduce((e,t)=>e+t,0)-t;for(let e=n.length-1;e>=0&&r>0;e--){let t=Math.min(r,n[e]);n[e]-=t,r-=t}return n}function PE(e,t,n){let r=e[n];if(!r||!OE(r,t))return!1;let i=kE(e,t);return i>=0&&i!==n}function FE(e,t){return t<=0?null:AE(e/t,.05,.9)}function IE(e,t,n){return{...e,collapsed:{...e.collapsed,[t]:n}}}function LE(e,t,n){let r=Object.fromEntries(Object.entries(e.sizes).filter(([e])=>e!==t));return{...e,sizes:n===null?r:{...r,[t]:n}}}var RE=O(`<div role="separator" aria-orientation="horizontal"></div>`),zE=O(`<div><!></div> <!>`,1),BE=O(`<div></div>`);function VE(e,r){c(r,!0);let i=(e,n=m,r=m)=>{let i=L(()=>A(n())),a=L(()=>t(g)?Math.round(t(_)[n()]/t(g)*100):0);var o=RE();J(o,`aria-valuemin`,0),J(o,`aria-valuemax`,100),F(e=>{J(o,`aria-label`,r()),J(o,`aria-valuenow`,t(a)),J(o,`aria-disabled`,!t(i)),J(o,`tabindex`,t(i)?0:-1),J(o,`title`,t(i)?`Drag to resize, double-click for automatic size`:void 0),X(o,1,e)},[()=>T(ft(`relative z-10 h-px w-full shrink-0 bg-border transition-colors outline-none`,t(i)&&`cursor-row-resize after:absolute after:inset-x-0 after:-top-1 after:h-2 hover:bg-ring focus-visible:bg-ring`,t(b)?.index===n()&&`bg-ring`))]),h(`pointerdown`,o,e=>P(e,n())),h(`pointermove`,o,ee),h(`pointerup`,o,te),M(`lostpointercapture`,o,te),h(`dblclick`,o,()=>{t(i)&&N(n())}),h(`keydown`,o,e=>ne(e,n())),k(e,o)},a=K(r,`layout`,31,()=>U({collapsed:{},sizes:{}})),o=K(r,`keyStepPx`,3,16),s=Y(0),u=U({}),d={};function f(e){return d[e]??=t=>{let n=()=>u[e]=t.offsetHeight,r=new ResizeObserver(n);return r.observe(t),n(),()=>r.disconnect()}}let p=e=>u[e.id]?(e.headerPx??0)+u[e.id]:0,g=L(()=>Math.max(0,t(s)-Math.max(0,r.areas.length-1)*1)),_=L(()=>jE({areas:r.areas,layout:a(),totalPx:t(g),contentPx:Object.fromEntries(r.areas.map(e=>[e.id,p(e)]))}));function y(e){a(e),r.onChange?.(e)}let b=Y(void 0),S=Y(!1),C=0;W(()=>(t(s),r.areas.map(e=>e.id).join(),B(S,!1),cancelAnimationFrame(C),C=requestAnimationFrame(()=>B(S,!0)),()=>cancelAnimationFrame(C)));let w=L(()=>t(S)&&!t(b)?`transition-[height] duration-200 ease-out motion-reduce:transition-none`:``);function E(e){let t=r.areas.find(t=>t.id===e);t&&t.collapsible!==!1&&y(IE(a(),e,OE(t,a())))}function O(e){let t=r.areas.find(t=>t.id===e);t&&!OE(t,a())&&E(e)}let A=e=>PE(r.areas,a(),e);function j(e,n){y(LE(a(),r.areas[e].id,FE(n,t(g))))}function N(e){y(LE(a(),r.areas[e].id,null))}function P(e,n){e.button===0&&A(n)&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),B(b,{index:n,startY:e.clientY,startPx:t(_)[n]},!0))}function ee(e){t(b)&&j(t(b).index,t(b).startPx+e.clientY-t(b).startY)}function te(){B(b,void 0)}function ne(e,n){if(!A(n))return;let r=e.key===`ArrowUp`?-o():e.key===`ArrowDown`?o():0;if(r)j(n,t(_)[n]+r);else if(e.key===`Enter`)N(n);else return;e.preventDefault()}var z={toggle:E,open:O},ie=BE();return v(ie,23,()=>r.areas,e=>e.id,(e,o,s)=>{var c=zE(),u=R(c);let d;var m=q(u);{let e=L(()=>({area:t(o),open:OE(t(o),a()),toggle:()=>E(t(o).id),measure:f(t(o).id),overflows:p(t(o))>(t(_)[t(s)]??0)+.5}));n(m,()=>r.area,()=>t(e))}x(u);var h=G(u,2),g=e=>{i(e,()=>t(s),()=>t(o).resizeLabel)};l(h,e=>{t(s)<r.areas.length-1&&e(g)}),F(e=>{X(u,1,e),d=I(u,``,d,{height:`${t(_)[t(s)]??0??``}px`})},[()=>T(ft(`min-h-0 shrink-0 overflow-hidden`,r.areaClass,t(w)))]),k(e,c)}),x(ie),F(e=>X(ie,1,e),[()=>T(ft(`flex min-h-0 flex-1 flex-col overflow-hidden`,t(b)&&`cursor-row-resize select-none`,r.class))]),re(ie,`clientHeight`,e=>B(s,e)),k(e,ie),D(z)}ue([`pointerdown`,`pointermove`,`pointerup`,`dblclick`,`keydown`]);function HE(e,r){c(r,!0);let i={id:`list`,collapsible:!1,minPx:56,fitContent:!0,autoMaxShare:.5,resizeLabel:`Resize repository list`},a={id:`branch`,minPx:64,headerPx:32,autoMaxShare:.45,resizeLabel:`Resize selected branch`},o={id:`changes`,defaultCollapsed:!0,minPx:96,headerPx:32},s=fS(),u=L(()=>r.list?[i,a,o]:[a,o]),d=L(()=>({collapsed:{branch:s.branch.collapsed,changes:s.changes.collapsed},sizes:{...s.listSize===null?{}:{list:s.listSize},...s.branch.size===null?{}:{branch:s.branch.size}}}));function p(e){s.branch.collapsed=e.collapsed.branch??!1,s.changes.collapsed=e.collapsed.changes??!0,s.listSize=e.sizes.list??null,s.branch.size=e.sizes.branch??null,s.save()}let h=Y(void 0);function g(e){t(h)?.open(e)}var _={openSection:g};return te(VE(e,{get areas(){return t(u)},get layout(){return t(d)},onChange:p,class:`-mx-2`,areaClass:`px-2`,area:(e,t)=>{let i=()=>(t?.()).area,a=()=>(t?.()).open,o=()=>(t?.()).toggle,s=()=>(t?.()).measure,c=()=>(t?.()).overflows;var u=f(),d=R(u),p=e=>{var t=f(),i=R(t);n(i,()=>r.list??m,()=>({measure:s(),overflows:c()})),k(e,t)},h=e=>{var t=f(),i=R(t);n(i,()=>r.branch,()=>({open:a(),toggle:o(),measure:s(),overflows:c()})),k(e,t)},g=e=>{var t=f(),i=R(t);n(i,()=>r.changes,()=>({open:a(),toggle:o()})),k(e,t)};l(d,e=>{i().id===`list`?e(p):i().id===`branch`?e(h,1):e(g,-1)}),k(e,u)},$$slots:{area:!0}}),e=>B(h,e,!0),()=>t(h)),D(_)}var UE=/^WIP on ([^:]+): [0-9a-f]{4,40}(?: (.*))?$/s,WE=/^On ([^:]+): (.*)$/s;function GE(e){let t=e.trim(),n=UE.exec(t);if(n)return{title:n[2]?.trim()||t,branch:n[1],wip:!0};let r=WE.exec(t);return r?{title:r[2]?.trim()||t,branch:r[1],wip:!1}:{title:t,wip:!1}}var KE=O(`<div role="listitem" class="flex items-center gap-2 rounded-md bg-destructive-subtle px-2 py-2"><!> <span class="min-w-0 flex-1 text-ui">Drop <span class="font-mono"> </span>? This can’t be undone.</span> <!> <!></div>`),qE=O(`<!> <span class="truncate"> </span> <span aria-hidden="true">·</span>`,1),JE=O(`<!> Apply`,1),YE=O(`<div role="listitem" class="flex items-center gap-2.5 rounded-md px-2 py-1.5 hover:bg-hover focus-within:bg-hover"><!> <div class="grid min-w-0 flex-1 gap-0.5"><div class="flex min-w-0 items-center gap-2"><span class="truncate text-ui"> </span> <!></div> <div class="flex min-w-0 items-center gap-1.5 text-caption text-muted-foreground"><!> <span class="font-mono"> </span> <span aria-hidden="true">·</span> <span class="shrink-0"> </span></div></div> <div class="flex shrink-0 items-center gap-1"><!> <!></div></div>`);function XE(e,n){c(n,!0);let r=K(n,`confirmingDrop`,3,!1),i=L(()=>GE(n.stash.message)),a=L(()=>n.mutation?.action===`apply`&&n.mutation.hash===n.stash.hash),o=L(()=>n.mutation?.action===`drop`&&n.mutation.hash===n.stash.hash);var s=f(),u=R(s),d=e=>{var t=KE(),r=q(t);kn(r,{class:`size-3.5 shrink-0 text-destructive`,"aria-hidden":`true`});var i=G(r,2),a=G(q(i)),o=z(a,!0);y(),x(i);var s=G(i,2);Q(s,{variant:`ghost`,size:`sm`,get disabled(){return n.busy},get onclick(){return n.onCancelDrop},children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var c=G(s,2);Q(c,{variant:`destructive`,size:`sm`,get disabled(){return n.busy},onclick:()=>n.onConfirmDrop(n.stash),children:(e,t)=>{y();var n=g(`Drop`);k(e,n)},$$slots:{default:!0}}),x(t),F(()=>w(o,n.stash.ref)),k(e,t)},p=e=>{var r=YE(),s=q(r);uw(s,{class:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`});var c=G(s,2),u=q(c),d=q(u),f=z(d,!0),p=G(d,2),m=e=>{be(e,{children:(e,t)=>{y();var n=g(`WIP`);k(e,n)},$$slots:{default:!0}})};l(p,e=>{t(i).wip&&e(m)}),x(u);var h=G(u,2),_=q(h),v=e=>{var n=qE(),r=R(n);nc(r,{class:`size-3 shrink-0`,"aria-hidden":`true`});var a=G(r,2),o=z(a,!0);y(2),F(()=>w(o,t(i).branch)),k(e,n)};l(_,e=>{t(i).branch&&e(v)});var b=G(_,2),S=z(b,!0),C=G(b,4),T=z(C,!0);x(h),x(c);var E=G(c,2),D=q(E);Q(D,{variant:`outline`,size:`sm`,get disabled(){return n.busy},onclick:()=>n.onApply(n.stash),children:(e,n)=>{var r=JE(),i=R(r),o=e=>{dn(e,{class:`size-3`})},s=e=>{dw(e,{})};l(i,e=>{t(a)?e(o):e(s,-1)}),y(),k(e,r)},$$slots:{default:!0}});var O=G(D,2);{let e=L(()=>`Drop ${n.stash.ref}`);Mn(O,{get icon(){return kn},get label(){return t(e)},tone:`destructive`,get disabled(){return n.busy},get busy(){return t(o)},onclick:()=>n.onRequestDrop(n.stash)})}x(E),x(r),F(()=>{J(d,`title`,n.stash.message),w(f,t(i).title),w(S,n.stash.ref),w(T,n.stash.relativeDate)}),k(e,r)};l(u,e=>{r()?e(d):e(p,-1)}),k(e,s),D()}var ZE=O(`<!> <!> <!>`,1),QE=O(`<p class="px-3 pb-2 text-ui text-muted-foreground"> </p>`),$E=O(`<div class="flex max-h-96 min-h-0 flex-col p-1.5"><!></div> <!>`,1);function eD(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=Y(void 0),a=L(()=>!!n.mutation),o=L(()=>n.stashes.length);function s(e){B(i,void 0),n.onDrop(e)}function u(e){e.key===`Escape`&&t(i)&&(e.preventDefault(),e.stopPropagation(),B(i,void 0))}M(`keydown`,ce,u,!0);{let c=L(()=>`${n.repositoryName} · ${t(o)} ${t(o)===1?`stash`:`stashes`}`);ln(e,{flush:!0,title:`Stashes`,get description(){return t(c)},size:`md`,onOpenChange:e=>{e||B(i,void 0)},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var o=f(),c=R(o),u=e=>{var t=f(),n=R(t);H(n,()=>as,(e,t)=>{t(e,{class:`py-10`,children:(e,t)=>{var n=f(),r=R(n);H(r,()=>ts,(e,t)=>{t(e,{children:(e,t)=>{var n=ZE(),r=R(n);H(r,()=>rs,(e,t)=>{t(e,{variant:`icon`,children:(e,t)=>{uw(e,{})},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>os,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g(`No stashes`);k(e,n)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>is,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g(`Stash changes from the Git panel to set them aside without
7
+ committing.`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,t)},d=e=>{var r=$E(),o=R(r),c=q(o);Gc(c,{ariaLabel:`Stashes`,contentClass:`flex min-w-0 shrink-0 flex-col gap-0.5`,children:(e,r)=>{var o=f(),c=R(o);v(c,17,()=>n.stashes.slice(0,100),e=>e.hash,(e,r)=>{{let o=L(()=>t(i)?.hash===t(r).hash);XE(e,{get stash(){return t(r)},get busy(){return t(a)},get mutation(){return n.mutation},get confirmingDrop(){return t(o)},get onApply(){return n.onApply},onRequestDrop:e=>B(i,e,!0),onCancelDrop:()=>B(i,void 0),onConfirmDrop:s})}}),k(e,o)},$$slots:{default:!0}}),x(o);var u=G(o,2),d=e=>{var t=QE(),r=z(t);F(()=>w(r,`Showing the first 100 of ${n.stashes.length??``} stashes.`)),k(e,t)};l(u,e=>{n.stashes.length>100&&e(d)}),k(e,r)};l(c,e=>{n.stashes.length===0?e(u):e(d,-1)}),k(e,o)},$$slots:{default:!0}})}D()}var tD=O(`<p class="text-caption text-destructive"> </p>`),nD=O(`<div class="grid gap-1.5"><!> <!> <p class="text-caption text-muted-foreground"> </p> <!></div> <div class="grid gap-1.5"><!> <!> <!> <p class="truncate font-mono text-caption text-muted-foreground"> </p></div>`,1);function rD(e,n){let r=d();c(n,!0);let i=K(n,`open`,15,!1),a=K(n,`initialBranch`,3,``),o=K(n,`busy`,3,!1),s=Y(``),u=Y(``),f=Y(!1),p=!1;W(()=>{i()&&!p&&(B(s,a()),B(u,``)),p=i()});let m=L(()=>n.group?.primary),h=L(()=>t(m)?t(m).relativePath===`.`?t(m).absDir:t(m).absDir.slice(0,-t(m).relativePath.length-1):``),_=L(()=>new Set((n.group?.repos??[]).map(e=>wx(e)))),v=L(()=>t(s).trim()),b=L(()=>t(m)&&t(v)?lx(sx(t(v),{repoName:t(m).name,multiRepo:n.multiRepo}),t(_)):``),S=L(()=>t(u).trim()),C=L(()=>t(S)||t(b)),T=L(()=>Rx(n.group).get(t(v))),E=L(()=>{if(t(v)){if(t(T))return`${t(v)} is already checked out in ${t(T)}.`;if(t(S)&&!cx(t(S)))return`Worktree ID may use lowercase letters, digits, dots, dashes and underscores.`;if(t(S)&&t(_).has(t(S)))return`A worktree folder named ${t(S)} already exists.`;if(!cx(t(C)))return`Enter a worktree ID: the branch name has no usable characters.`}}),O=L(()=>`${t(h)}/${nx}/${t(C)||`…`}`);async function A(){B(f,!0);try{await n.onSubmit(t(v),t(S)||void 0)&&i(!1)}finally{B(f,!1)}}{let n=L(()=>t(m)?`A separate checkout of ${t(m).name}.`:void 0),a=L(()=>!t(v)||!!t(E)),c=L(()=>o()||t(f));on(e,{title:`New worktree`,get description(){return t(n)},submitLabel:`Create worktree`,get submitDisabled(){return t(a)},get busy(){return t(c)},bodyClass:`gap-3`,onSubmit:A,get open(){return i()},set open(e){i(e)},children:(e,n)=>{var i=nD(),a=R(i),o=q(a);{let e=L(()=>`${r}-branch`);un(o,{get for(){return t(e)},children:(e,t)=>{y();var n=g(`Branch`);k(e,n)},$$slots:{default:!0}})}var c=G(o,2);{let e=L(()=>`${r}-branch`);an(c,{get id(){return t(e)},placeholder:`Existing or new branch name`,autocomplete:`off`,get value(){return t(s)},set value(e){B(s,e,!0)}})}var d=G(c,2),f=z(d),p=G(d,2),h=e=>{var n=tD(),r=z(n,!0);F(()=>w(r,t(E))),k(e,n)};l(p,e=>{t(T)&&e(h)}),x(a);var _=G(a,2),v=q(_);{let e=L(()=>`${r}-id`);un(v,{get for(){return t(e)},children:(e,t)=>{y();var n=g(`Worktree ID`);k(e,n)},$$slots:{default:!0}})}var S=G(v,2);{let e=L(()=>`${r}-id`),n=L(()=>t(b)||`From the branch name`);an(S,{get id(){return t(e)},get placeholder(){return t(n)},autocomplete:`off`,get value(){return t(u)},set value(e){B(u,e,!0)}})}var C=G(S,2),D=e=>{var n=tD(),r=z(n,!0);F(()=>w(r,t(E))),k(e,n)};l(C,e=>{t(E)&&!t(T)&&e(D)});var A=G(C,2),j=z(A,!0);x(_),F(()=>{w(f,`A new branch starts from ${t(m)?.baseBranch??`the base branch`??``}.`),J(A,`title`,t(O)),w(j,t(O))}),k(e,i)},$$slots:{default:!0}})}D()}var iD=O(`<span> </span>`),aD=O(`<small class="text-ui text-muted-foreground"> </small>`),oD=O(`<label><span class="grid min-w-0 gap-0.5"><!> <!></span> <!></label>`);function sD(e,t){c(t,!0);let n=K(t,`checked`,15,!1),r=K(t,`disabled`,3,!1),i=K(t,`class`,3,``);function a(e){n(e),t.onCheckedChange?.(e)}var o=oD(),s=q(o),u=q(s),d=e=>{var n=iD(),r=z(n,!0);F(()=>w(r,t.label)),k(e,n)};l(u,e=>{t.label&&e(d)});var f=G(u,2),p=e=>{var n=aD(),r=z(n,!0);F(()=>w(r,t.description)),k(e,n)};l(f,e=>{t.description&&e(p)}),x(s);var m=G(s,2);yn(m,{get disabled(){return r()},onCheckedChange:a,get"aria-label"(){return t.label},get checked(){return n()},set checked(e){n(e)}}),x(o),F(e=>X(o,1,e),[()=>T(ft(`flex items-center justify-between gap-3 text-ui text-foreground`,i()))]),k(e,o),D()}var cD=O(`<!> <!>`,1);function lD(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=K(n,`busy`,3,!1),a=Y(!1),o=Y(!1),s=!1;W(()=>{r()&&!s&&B(a,!1),s=r()});let u=L(()=>(n.target?.changeCount??0)>0),d=L(()=>n.target?.currentBranch&&n.target.currentBranch!==n.target.baseBranch?n.target.currentBranch:void 0);async function f(){B(o,!0);try{await n.onSubmit({force:t(u),deleteBranch:!!t(d)&&t(a)})&&r(!1)}finally{B(o,!1)}}{let s=L(()=>n.target?`Removes the folder ${n.target.absDir} and its checkout of ${n.target.currentBranch??`a detached HEAD`}. Commits on the branch are kept.`:void 0),c=L(()=>t(u)?`Discard changes and remove`:`Remove worktree`),p=L(()=>i()||t(o));on(e,{title:`Remove worktree?`,get description(){return t(s)},get submitLabel(){return t(c)},submitVariant:`destructive`,get busy(){return t(p)},bodyClass:`gap-3`,onSubmit:f,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=cD(),o=R(i),s=e=>{{let r=L(()=>`${n.target.changeCount} uncommitted ${n.target.changeCount===1?`change`:`changes`} will be lost.`);nn(e,{tone:`destructive`,get icon(){return Qs},get text(){return t(r)}})}};l(o,e=>{n.target&&t(u)&&e(s)});var c=G(o,2),f=e=>{{let r=L(()=>`Also delete branch ${t(d)}`),i=L(()=>n.target.mergedToBase?`Merged into ${n.target.baseBranch}.`:`Not merged into ${n.target.baseBranch}; its commits will be lost.`);sD(e,{get label(){return t(r)},get description(){return t(i)},get checked(){return t(a)},set checked(e){B(a,e,!0)}})}};l(c,e=>{n.target&&t(d)&&e(f)}),k(e,i)},$$slots:{default:!0}})}D()}var uD=(e,t=m)=>{var n=f(),r=R(n),i=e=>{hw(e,{class:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`No remote`})},a=e=>{lw(e,{class:`size-3.5 shrink-0 text-primary`})},o=e=>{pw(e,{class:`size-3.5 shrink-0 text-primary`,"aria-label":`Remote (not GitHub)`})};l(r,e=>{t().hasRemote?t().hasGithubRemote?e(a,1):e(o,-1):e(i)}),k(e,n)},dD=(e,n=m,r=m,i=m)=>{var a=f(),o=R(a);H(o,()=>wn,(e,a)=>{a(e,{children:(e,a)=>{var o=CD(),s=R(o);{let e=(e,a)=>{let o=()=>(a?.()).props;{let a=L(()=>ft(i().disabled?`cursor-default opacity-40`:`hover:text-foreground`,i().tone??`text-muted-foreground`));Q(e,P(o,{variant:`ghost`,size:`icon-sm`,get"aria-label"(){return r()},get"aria-disabled"(){return i().disabled},get class(){return t(a)},onclick:()=>{i().disabled||i().onclick()},children:(e,t)=>{var r=f(),i=R(r);H(i,n,(e,t)=>{t(e,{})}),k(e,r)},$$slots:{default:!0}}))}};H(s,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(s,2);H(c,()=>Sn,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(()=>w(n,r())),k(e,n)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})}),k(e,a)},fD=O(`<!><span> </span>`,1),pD=O(`<!><span>Switch branch</span>`,1),mD=O(`<!><span>Stashes</span>`,1),hD=O(`<!><span>New worktree</span>`,1),gD=O(`<!><span>Remove worktree</span>`,1),_D=O(`<!><span>Open on GitHub</span>`,1),vD=O(`<!><span>Create pull request</span>`,1),yD=O(`<!><span>Copy repository URL</span>`,1),bD=O(`<!> <!> <!> <!>`,1),xD=O(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),SD=O(`<!><span>Fetch</span>`,1),CD=O(`<!> <!>`,1),wD=O(`<!><span>Collapse</span>`,1),TD=O(`<!><span>Expand</span>`,1),ED=O(`<!> <!> <!> <!> <!> <!>`,1),DD=O(`<span class="min-w-0 shrink truncate text-muted-foreground"> </span>`),OD=O(`<!> <span class="max-w-1/2 shrink-0 truncate font-medium"> </span> <!>`,1),kD=O(`<span class="font-medium">Selected branch</span>`),AD=O(`<span class="flex shrink-0 items-center gap-0.5"><!></span> <!>`,1),jD=O(`<p class="text-caption break-words text-destructive"> </p>`),MD=O(`<a class="hover:text-foreground" target="_blank" rel="noreferrer">Waiting for pull request…</a>`),ND=O(`<p class="text-ui text-muted-foreground"><!></p>`),PD=O(`<!> <!> <!>`,1),FD=O(`<div class="flex flex-col gap-1.5 pb-2"><!></div>`),ID=O(`<!> `,1),LD=O(`<p class="py-1 text-ui text-muted-foreground">Working tree clean.</p>`),RD=O(`<div><div class="py-1.5"><!></div></div>`),zD=O(`<!>Fetch all`,1),BD=O(`<!>Pull all`,1),VD=O(`<!>Back to base`,1),HD=O(`<div class="px-2 py-1 text-ui text-muted-foreground">All repositories</div> <!> <!> <!>`,1);function UD(e,n){c(n,!0);let r=(e,r=m,i=m)=>{let a=(e,n=m)=>{let i=L(()=>Me(r(),n())),a=L(()=>t(i).canStop?Xs:Ae[n()]);var s=f(),c=R(s);{let e=L(()=>t(i).reason||void 0);H(c,()=>t(o),(o,s)=>{s(o,{get disabled(){return t(i).disabled},get title(){return t(e)},onclick:()=>Ne(r(),n()),children:(e,n)=>{var r=fD(),o=R(r);H(o,()=>t(a),(e,t)=>{t(e,{"aria-hidden":`true`})});var s=G(o),c=z(s,!0);F(()=>w(c,t(i).label)),k(e,r)},$$slots:{default:!0}})})}k(e,s)},o=L(()=>i()?gn:Zn),s=L(()=>i()?hn:Yn),c=L(()=>Ie(r()));var u=xD(),d=R(u);a(d,()=>`sync`);var p=G(d,2);a(p,()=>`fetch`);var h=G(p,2);a(h,()=>`pull`);var g=G(h,2);a(g,()=>`push`);var v=G(g,2);H(v,()=>t(s),(e,t)=>{t(e,{})});var b=G(v,2),x=e=>{a(e,()=>`switch-base-and-pull`)},S=L(()=>Sx(r()));l(b,e=>{t(S)&&e(x)});var C=G(b,2);{let e=L(()=>!n.model.capabilities.branches.enabled);H(C,()=>t(o),(i,a)=>{a(i,{get disabled(){return t(e)},onclick:()=>{r().relativePath===n.model.selectedRepository?t(_)?.openBranchDialog():Promise.resolve(n.actions.selectRepository(r().relativePath)).then(()=>t(_)?.openBranchDialog())},children:(e,t)=>{var n=pD(),r=R(n);nc(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var T=G(C,2);{let e=L(()=>Be(r()));H(T,()=>t(o),(n,i)=>{i(n,{get disabled(){return t(e)},onclick:()=>void j(r()),children:(e,t)=>{var n=mD();dw(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var E=G(T,2);H(E,()=>t(s),(e,t)=>{t(e,{})});var D=G(E,2);{let e=L(()=>!n.model.capabilities.worktrees.enabled);H(D,()=>t(o),(n,i)=>{i(n,{get disabled(){return t(e)},onclick:()=>ae(r()),children:(e,t)=>{var n=hD(),r=R(n);ec(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var O=G(D,2),A=e=>{var i=f(),a=R(i);{let e=L(()=>!n.model.capabilities.worktrees.enabled);H(a,()=>t(o),(n,i)=>{i(n,{variant:`destructive`,get disabled(){return t(e)},onclick:()=>V(r()),children:(e,t)=>{var n=gD();rne(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}k(e,i)},M=L(()=>!Sx(r()));l(O,e=>{t(M)&&e(A)});var N=G(O,2),P=e=>{var n=bD(),i=R(n);H(i,()=>t(s),(e,t)=>{t(e,{})});var a=G(i,2);{let e=L(()=>!t(c));H(a,()=>t(o),(n,r)=>{r(n,{get disabled(){return t(e)},onclick:()=>t(c)&&Le(t(c)),children:(e,t)=>{var n=_D(),r=R(n);$s(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var l=G(a,2);{let e=L(()=>!ze(r())||r().onBaseBranch||!!Z.pullRequest(r()));H(l,()=>t(o),(n,i)=>{i(n,{get disabled(){return t(e)},onclick:()=>{let e=ze(r());e&&Le(e)},children:(e,t)=>{var n=vD();sne(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var u=G(l,2);{let e=L(()=>!t(c));H(u,()=>t(o),(n,r)=>{r(n,{get disabled(){return t(e)},onclick:()=>t(c)&&void Re(t(c)),children:(e,t)=>{var n=yD();yw(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}k(e,n)};l(N,e=>{r().hasGithubRemote&&e(P)}),k(e,u)},i=(e,t=m)=>{r(e,t,()=>!0)},a=(e,r=m)=>{let i=L(()=>Ie(r().primary)),a=L(()=>Me(r().primary,`fetch`));var o=ED(),s=R(o);{let e=L(()=>!n.model.capabilities.worktrees.enabled);H(s,()=>gn,(n,i)=>{i(n,{get disabled(){return t(e)},onclick:()=>ae(r().primary),children:(e,t)=>{var n=hD(),r=R(n);ec(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var c=G(s,2);H(c,()=>hn,(e,t)=>{t(e,{})});var u=G(c,2);H(u,()=>gn,(e,n)=>{n(e,{get disabled(){return t(a).disabled},onclick:()=>Ne(r().primary,`fetch`),children:(e,t)=>{var n=SD();mw(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})});var d=G(u,2),h=e=>{var n=CD(),r=R(n);{let e=L(()=>!t(i));H(r,()=>gn,(n,r)=>{r(n,{get disabled(){return t(e)},onclick:()=>t(i)&&Le(t(i)),children:(e,t)=>{var n=_D(),r=R(n);$s(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var a=G(r,2);{let e=L(()=>!t(i));H(a,()=>gn,(n,r)=>{r(n,{get disabled(){return t(e)},onclick:()=>t(i)&&void Re(t(i)),children:(e,t)=>{var n=yD();yw(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}k(e,n)};l(d,e=>{r().primary.hasGithubRemote&&e(h)});var g=G(d,2);H(g,()=>hn,(e,t)=>{t(e,{})});var _=G(g,2);H(_,()=>gn,(e,n)=>{n(e,{onclick:()=>t(p).setExpanded(r().key,!t(p).expanded.has(r().key)),children:(e,n)=>{var i=f(),a=R(i),o=e=>{var t=wD(),n=R(t);mn(n,{"aria-hidden":`true`}),y(),k(e,t)},s=L(()=>t(p).expanded.has(r().key)),c=e=>{var t=TD(),n=R(t);qn(n,{"aria-hidden":`true`}),y(),k(e,t)};l(a,e=>{t(s)?e(o):e(c,-1)}),k(e,i)},$$slots:{default:!0}})}),k(e,o)},o=(e,r=m)=>{let i=L(()=>DC(n.model.activeOperations??[],r().relativePath)),a=L(()=>n.model.lastRemoteFailure?.(r().relativePath)),o=L(()=>AC(r())),s=L(()=>t(o).operation),c=L(()=>Me(r(),t(s)));var u=f(),d=R(u),p=e=>{var u=CD(),d=R(u),f=e=>{let r=L(()=>se.has(t(i).id)),a=L(()=>!!(t(i).actions.cancel&&n.actions.cancelOperation&&!t(r)));{let n=L(()=>t(r)?`Stopping. Waiting for the process to close.`:t(a)?`Stop ${ke(jC(t(i))??`sync`).toLowerCase()}`:`Another operation is running in this repository.`);dD(e,()=>Xs,()=>t(n),()=>({disabled:!t(a),onclick:()=>void ce(t(i).id).catch(()=>{})}))}},p=e=>{{let n=L(()=>`${ke(jC(t(a))??`sync`)} failed: ${t(a).error?.message??t(a).message??`Unknown error`}. Retry`);dD(e,()=>Qs,()=>t(n),()=>({tone:`text-destructive`,onclick:()=>Pe(r(),t(a))}))}},m=e=>{dD(e,()=>t(o).label===`Publish branch`?gw:Ae[t(s)===`sync`?`sync`:t(s)],()=>`${t(o).help}${t(c).reason?`. ${t(c).reason}`:``}`,()=>({tone:t(s)===`pull`||t(s)===`sync`&&t(o).parts.length?`text-warning`:void 0,disabled:t(c).disabled,onclick:()=>Ne(r(),t(s))}))};l(d,e=>{t(i)?e(f):t(a)?e(p,1):e(m,-1)});var h=G(d,2),g=e=>{dD(e,()=>vw,()=>`Merged into ${r().baseBranch}. Remove this worktree`,()=>({tone:`text-info`,disabled:!n.model.capabilities.worktrees.enabled,onclick:()=>V(r())}))},_=L(()=>r().mergedToBase&&!r().onBaseBranch&&!Sx(r())),v=e=>{let n=L(()=>Me(r(),`switch-base-and-pull`));dD(e,()=>vw,()=>`Merged into ${r().baseBranch}. Switch to ${r().baseBranch} and pull${t(n).reason?`. ${t(n).reason}`:``}`,()=>({tone:`text-info`,disabled:t(n).disabled,onclick:()=>Ne(r(),`switch-base-and-pull`)}))};l(h,e=>{t(_)?e(g):r().mergedToBase&&!r().onBaseBranch&&e(v,1)}),k(e,u)};l(d,e=>{r().hasRemote&&e(p)}),k(e,u)},s=(e,i=m,a=m,s=m,c=m)=>{let u=e=>{var n=f(),r=R(n),a=e=>{var n=OD(),r=R(n);uD(r,()=>t(p));var a=G(r,2),o=z(a,!0),s=G(a,2),c=e=>{var n=DD(),r=z(n,!0);F(()=>{J(n,`title`,t(p).currentBranch??`detached`),w(r,t(p).currentBranch??`detached`)}),k(e,n)};l(s,e=>{i()||e(c)}),F(()=>{J(a,`title`,t(p).absDir),w(o,t(p).name)}),k(e,n)},o=e=>{var t=kD();k(e,t)};l(r,e=>{t(p)?e(a):e(o,-1)}),k(e,n)},d=e=>{var n=f(),i=R(n),a=e=>{var n=AD(),i=R(n),a=q(i);o(a,()=>t(p)),x(i);var s=G(i,2);H(s,()=>Xn,(e,n)=>{n(e,{children:(e,n)=>{var i=CD(),a=R(i);{let e=(e,t)=>{Q(e,P(()=>(t?.()).props,{variant:`ghost`,size:`icon-sm`,"aria-label":`Branch actions`,children:(e,t)=>{rc(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))};H(a,()=>Qn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Jn,(e,n)=>{n(e,{align:`end`,children:(e,n)=>{r(e,()=>t(p),()=>!1)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,n)};l(i,e=>{t(p)&&e(a)}),k(e,n)},p=L(()=>t(Se));{let r=L(()=>ft(`min-h-0 flex-1`,c()?`overflow-y-auto`:`overflow-hidden`));cw(e,{get open(){return i()},get onOpenChange(){return a()},keepMounted:!0,class:`h-full min-h-0`,get bodyClass(){return t(r)},get label(){return u},get actions(){return d},children:(e,r)=>{var i=FD(),a=q(i),o=e=>{let r=L(()=>n.model.lastRemoteFailure?.(t(p).relativePath));var i=PD(),a=R(i);te(Hne(a,{get model(){return n.model},get actions(){return n.actions},get repo(){return t(p)},get checkedOutIn(){return t(we)}}),e=>B(_,e,!0),()=>t(_));var o=G(a,2),s=e=>{var n=jD(),i=z(n,!0);F(()=>w(i,t(r).error?.message??t(r).message??`Operation failed.`)),k(e,n)};l(o,e=>{t(r)&&e(s)});var c=G(o,2),u=e=>{let r=L(()=>n.model.currentBranchPr);{let i=L(()=>t(he)===t(r).number),a=L(()=>!n.model.capabilities.openPullRequest.enabled),o=L(()=>n.model.capabilities.openPullRequest.enabled?void 0:n.model.capabilities.openPullRequest.reason);$T(e,{get pr(){return t(r)},get expanded(){return t(i)},checkedOut:!0,get disabled(){return t(a)},get disabledReason(){return t(o)},onOpen:()=>void n.actions.openPullRequest(n.model.selectedRepository,t(r).number),onToggleChecks:()=>B(he,t(he)===t(r).number?void 0:t(r).number,!0)})}},d=e=>{var t=ND(),r=q(t),i=e=>{var t=MD();F(()=>J(t,`href`,n.model.expectedPullRequestUrl)),k(e,t)},a=e=>{var t=g(`Waiting for pull request…`);k(e,t)};l(r,e=>{n.model.expectedPullRequestUrl?e(i):e(a,-1)}),x(t),k(e,t)};l(c,e=>{n.model.currentBranchPr?e(u):n.model.awaitingPullRequest&&e(d,1)}),k(e,i)};l(a,e=>{t(p)&&e(o)}),x(i),ge(i,s),k(e,i)},$$slots:{default:!0}})}},u=(e,r=m,i=m)=>{let a=e=>{y();var n=g();F(()=>w(n,`${t(c)??``} staged`)),k(e,n)},o=e=>{var n=f(),r=R(n),i=e=>{let n=L(()=>t(Se)),r=L(()=>Cx(t(n))),i=L(()=>t(r)===1?`stash`:`stashes`);var a=f(),o=R(a);H(o,()=>wn,(e,a)=>{a(e,{children:(e,a)=>{var o=CD(),s=R(o);{let e=(e,a)=>{let o=()=>(a?.()).props;{let a=L(()=>Be(t(n))),s=L(()=>`${t(r)} ${t(i)} in ${t(n).name} (shared by all worktrees). Open stashes`);Q(e,P(o,{variant:`ghost`,size:`sm`,class:`gap-1 px-1.5 text-muted-foreground tabular-nums hover:text-foreground`,get disabled(){return t(a)},get"aria-label"(){return t(s)},onclick:()=>void j(t(n)),children:(e,n)=>{var i=ID(),a=R(i);uw(a,{"aria-hidden":`true`});var o=G(a,1,!0);F(()=>w(o,t(r))),k(e,i)},$$slots:{default:!0}}))}};H(s,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(s,2);H(c,()=>Sn,(e,a)=>{a(e,{children:(e,a)=>{y();var o=g();F(()=>w(o,`${t(r)??``}
8
+ ${t(i)??``} in ${t(n).name??``} (shared by all worktrees). Open stashes`)),k(e,o)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})}),k(e,a)},a=L(()=>t(Se)&&Cx(t(Se))>0);l(r,e=>{t(a)&&e(i)}),k(e,n)},s=L(()=>n.model.changes?.files.length??t(Se)?.changeCount??0),c=L(()=>n.model.changes?.stagedCount??0);{let u=L(()=>t(s)||`none`),d=L(()=>t(c)>0?a:void 0);cw(e,{get open(){return r()},get onOpenChange(){return i()},keepMounted:!0,title:`Changes`,get count(){return t(u)},get meta(){return t(d)},class:`h-full min-h-0`,headerClass:`gap-1.5`,bodyClass:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-2`,get actions(){return o},children:(e,r)=>{var i=f(),a=R(i),o=e=>{kT(e,{get changes(){return n.model.changes},get stagedFiles(){return t(pe).staged},get unstagedFiles(){return t(pe).unstaged},get fileMutation(){return n.model.operations.fileMutation},get bulkMutation(){return n.model.operations.bulkMutation},get stashMutation(){return n.model.operations.stashMutation},get collapsedFolders(){return n.model.collapsedChangeTreeFolders},get selectedRepo(){return n.model.selectedRepository},get capabilities(){return n.model.capabilities},onOpenDiff:(e,t,r)=>void n.actions.openDiff(e,t,r),onMutateFile:(e,t,r)=>void n.actions.mutateFile(e,t,r),onMutateScope:(e,t,r,i)=>void n.actions.mutateFileScope(e,t,r,i),onCreateStash:(e,t,r)=>void n.actions.createStash(e,t,r),onFolderExpansionChange:(e,t,r)=>void n.actions.setChangeTreeFolderExpanded(e,t,r),onRequestDiscard:e=>fe({kind:`file`,repository:n.model.selectedRepository,file:e}),onRequestDiscardScope:(e,t)=>fe({kind:`scope`,repository:n.model.selectedRepository,area:e,...t?{path:t}:{},count:PC(n.model.changes?.files??[],e,t).length})})},c=e=>{var t=LD();k(e,t)};l(a,e=>{t(s)>0||(n.model.changes?.files.length??0)>0?e(o):e(c,-1)}),k(e,i)},$$slots:{default:!0}})}},d=(e,r)=>{let o=()=>(r?.()).measure,s=()=>(r?.()).overflows;var c=RD(),l=q(c),u=q(l);{let e=L(()=>t(p).search.trim()!==``||t(p).filter!==`all`);DE(u,{get groups(){return t(be)},get forceExpanded(){return t(e)},get expanded(){return t(p).expanded},get selected(){return n.model.selectedRepository},get selectable(){return n.model.capabilities.selectRepository.enabled},get context(){return Z},failureDetail:Oe,get repositoryMenu(){return a},get branchMenu(){return i},onToggleGroup:(e,n)=>t(p).setExpanded(e,n),onSelect:Te,onOpenChanges:De,onOpenBranchPicker:e=>void Ee(e),onSyncAction:Fe,onFetch:e=>Ne(e,`fetch`),onOpenPullRequest:(e,t)=>void n.actions.openPullRequest(e.relativePath,t.number),get onHint(){return n.actions.hintRepository}})}x(l),ge(l,o),x(c),F(e=>X(c,1,e),[()=>T(ft(`-mx-2 h-full min-h-0 px-2`,s()?`overflow-y-auto`:`overflow-hidden`))]),k(e,c)},p=L(()=>lS(n.model.projectId??`default`)),h=Y(void 0),_=Y(void 0),v=Y(!1),b=Y(void 0),S=Y(U([])),E=Y(void 0),O=0;function A(e){return n.model.repositories.some(t=>t.relativePath===e.relativePath&&t.absDir===e.absDir)}W(()=>{t(b)&&!A(t(b))&&(O++,B(b,void 0),B(S,[],!0),B(E,void 0),B(v,!1))});async function j(e){let t=++O,r={relativePath:e.relativePath,absDir:e.absDir,name:e.name};B(b,r,!0),B(S,[],!0),B(E,void 0),B(v,!1);let i=await n.actions.loadStashes(r.relativePath);t===O&&A(r)&&i&&(B(S,i,!0),B(v,!0))}async function M(e,r){let i=t(b);if(!i||!A(i)||t(E))return;let a=O;B(E,{action:e,hash:r.hash},!0);try{if(e===`apply`?await n.actions.applyStash(i.relativePath,r):await n.actions.dropStash(i.relativePath,r),a!==O||!A(i))return;let t=await n.actions.loadStashes(i.relativePath);a===O&&A(i)&&t&&B(S,t,!0)}finally{a===O&&B(E,void 0)}}let N=Y(!1),I=Y(void 0),ee=Y(``),re=Y(!1),ie=Y(void 0);function ae(e,t=``){B(I,ve(e),!0),B(ee,t,!0),B(N,!0)}function V(e){Sx(e)||(B(ie,e,!0),B(re,!0))}let oe=Y(!1),se=new mo;async function ce(e){if(!se.has(e)&&n.actions.cancelOperation){se.add(e);try{await n.actions.cancelOperation(e)}finally{se.delete(e)}}}let le=L(()=>n.model.repositories.filter(e=>e.hasRemote)),ue=L(()=>t(le).filter(Sx)),K=Y(!1),de=Y(void 0);function fe(e){B(de,e,!0),B(K,!0)}let pe=L(()=>NC(n.model.changes?.files??[])),me=L(()=>n.model.repositories.reduce((e,t)=>e+t.changeCount,0)),he=Y(void 0),_e=L(()=>Ix(n.model.repositories)),ve=e=>t(_e).find(t=>t.key===xx(e)),Z={failed:e=>!!n.model.lastRemoteFailure?.(e.relativePath),running:e=>!!DC(n.model.activeOperations??[],e.relativePath),pullRequest:e=>n.model.branchPullRequest?.(e.relativePath)??(e.relativePath===n.model.selectedRepository?n.model.currentBranchPr:void 0)},ye=L(()=>Vx(n.model.repositories,Z)),be=L(()=>Bx(t(_e),{filter:t(p).filter,search:t(p).search,context:Z})),xe=L(()=>n.model.repositories.length>1),Se=L(()=>n.model.repositories.find(e=>e.relativePath===n.model.selectedRepository)),Ce=L(()=>t(Se)&&ve(t(Se))),we=L(()=>t(Se)?Rx(t(Ce),t(Se)):new Map);function Te(e){e!==n.model.selectedRepository&&n.actions.selectRepository(e)}async function Ee(e){n.model.capabilities.branches.enabled&&(e!==n.model.selectedRepository&&await n.actions.selectRepository(e),t(h)?.openSection(`branch`),await ne(),t(_)?.openBranchPicker())}function De(e){Te(e),t(h)?.openSection(`changes`)}function Oe(e){let t=n.model.lastRemoteFailure?.(e.relativePath);return t?{operation:ke(jC(t)??`sync`),failure:t.error?.message??t.message}:{}}function ke(e){return e===`switch-base-and-pull`?`Switch to base and pull`:e===`fetch`?`Fetch`:e===`pull`?`Pull`:e===`push`?`Push`:`Sync`}let Ae={fetch:mw,pull:Ys,push:Zs,sync:fw,"switch-base-and-pull":_w};function je(e,t){if(t===`switch-base-and-pull`)return`Back to ${e.baseBranch}`;if(t===`pull`)return`Pull${e.behind?` (${e.behind})`:``}`;if(t===`push`){let t=e.hasUpstream?e.ahead:e.unpublishedCount;return`${e.hasUpstream?`Push`:`Publish branch`}${t?` (${t})`:``}`}return t===`fetch`?`Fetch`:`Sync`}function Me(e,t){let r=TC(n.model.activeOperations??[],e.relativePath,t),i=!!(r&&se.has(r.id)),a=!!(r?.actions.cancel&&n.actions.cancelOperation&&!i),o=n.model.capabilities.remote[t],s=o.enabled?``:o.reason;if(!s&&OC(n.model.activeOperations??[],e.relativePath)&&(s=`Another operation is running in this repository.`),!s&&!e.hasRemote&&(s=`Add a remote first.`),!s&&t!==`fetch`&&e.detached&&(s=`Check out a branch first.`),!s&&t===`pull`&&!e.hasUpstream&&(s=`Configure an upstream first.`),!s&&t===`pull`&&!(e.behind&&e.behind>0)&&(s=`No incoming commits.`),!s&&t===`push`&&e.hasUpstream&&!(e.ahead&&e.ahead>0)&&(s=`No outgoing commits.`),!s&&t===`switch-base-and-pull`&&e.onBaseBranch&&(s=`Already on ${e.baseBranch}.`),!s&&t===`switch-base-and-pull`){let t=Rx(ve(e),e).get(e.baseBranch);t&&(s=`${e.baseBranch} is checked out in ${t}; Git allows a branch in one worktree only.`)}let c={fetch:`Fetch remote updates without changing local files.`,pull:`Pull incoming commits (fast-forward only).`,push:e.hasUpstream?`Push outgoing commits.`:`Publish this branch to origin under the same name.`,sync:`Fetch, then pull and push when needed.`,"switch-base-and-pull":`Switch to ${e.baseBranch}, then pull (fast-forward only).`};return{activity:r,canStop:a,pending:i,reason:s,disabled:r?!a:!!s,label:a?`Stop ${je(e,t).toLowerCase()}`:je(e,t),help:i?`Stopping. Waiting for the process to close.`:r?`Stop this operation. Completed steps are not undone; remote updates may already have completed.`:`${c[t]}${s?` ${s}`:``}`}}function Ne(e,t){let r=Me(e,t);r.disabled||(r.activity?ce(r.activity.id).catch(()=>{}):n.actions.runRemoteOperation(e.relativePath,t))}function Pe(e,t){t.actions.retry&&n.actions.retryOperation?n.actions.retryOperation(t.id):n.actions.runRemoteOperation(e.relativePath,jC(t)??`sync`)}function Fe(e,t){let r=DC(n.model.activeOperations??[],e.relativePath);if(t.kind===`running`&&r){ce(r.id).catch(()=>{});return}let i=n.model.lastRemoteFailure?.(e.relativePath);if(t.kind===`failed`&&i)return Pe(e,i);let a=t.kind===`behind`?`pull`:t.kind===`diverged`||t.kind===`none`?`sync`:t.kind===`ahead`||t.kind===`unpublished`?`push`:void 0;a&&Ne(e,a)}let Ie=e=>n.model.repoBranchState(e.relativePath).repositoryUrl;function Le(e){window.open(e,`_blank`,`noopener,noreferrer`)}async function Re(e){try{await ri(e)}catch{ui.error(`Could not copy to clipboard`)}}function ze(e){let t=Ie(e);return t&&e.currentBranch?`${t}/compare/${encodeURIComponent(e.baseBranch)}...${e.currentBranch.split(`/`).map(encodeURIComponent).join(`/`)}?expand=1`:void 0}let Be=e=>!n.model.capabilities.stashes.enabled||OC(n.model.activeOperations??[],e.relativePath);var Ve=ED(),He=R(Ve);H(He,()=>En,(e,r)=>{r(e,{delayDuration:600,skipDelayDuration:0,children:(e,r)=>{en(e,{banner:e=>{var r=CD(),i=R(r);Xt(i,{title:`Git changes`,get count(){return t(me)},trailing:e=>{var r=CD(),i=R(r),a=e=>{var r=f(),i=R(r);H(i,()=>Xn,(e,r)=>{r(e,{children:(e,r)=>{var i=CD(),a=R(i);{let e=(e,t)=>{Q(e,P(()=>(t?.()).props,{variant:`ghost`,size:`icon-sm`,"aria-label":`All repositories`,title:`All repositories`,children:(e,t)=>{rc(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))};H(a,()=>Qn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Jn,(e,r)=>{r(e,{align:`end`,children:(e,r)=>{var i=HD(),a=G(R(i),2);{let e=L(()=>!n.model.capabilities.remote.fetch.enabled||t(le).length===0);H(a,()=>Zn,(r,i)=>{i(r,{get disabled(){return t(e)},onclick:()=>void n.actions.runBulkRemoteOperation?.(`fetch`),children:(e,t)=>{var n=zD();mw(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var o=G(a,2);{let e=L(()=>!n.model.capabilities.remote.pull.enabled||t(le).length===0);H(o,()=>Zn,(r,i)=>{i(r,{get disabled(){return t(e)},onclick:()=>void n.actions.runBulkRemoteOperation?.(`pull`),children:(e,t)=>{var n=BD(),r=R(n);Ys(r,{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}var s=G(o,2);{let e=L(()=>!n.model.capabilities.remote[`switch-base-and-pull`].enabled||t(ue).length===0);H(s,()=>Zn,(n,r)=>{r(n,{get disabled(){return t(e)},onclick:()=>B(oe,!0),title:`Switch each repository's primary checkout to its base branch and pull`,children:(e,t)=>{var n=VD();_w(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})})}k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,r)};l(i,e=>{n.model.repositories.length>1&&n.actions.runBulkRemoteOperation&&e(a)});var o=G(i,2);{let e=L(()=>!n.model.capabilities.refresh.enabled||n.model.refreshing);tn(o,{get icon(){return cr},label:`Refresh Git changes`,get loading(){return n.model.refreshing},get disabled(){return t(e)},onclick:()=>void n.actions.refreshRepository(n.model.selectedRepository)})}k(e,r)},$$slots:{trailing:!0}});var a=G(i,2),o=e=>{{let n=L(()=>[{value:`all`,label:`All`,count:t(ye).all},{value:`changed`,label:`Changed`,count:t(ye).changed,title:`Branches with uncommitted changes`},{value:`attention`,label:`Attention`,count:t(ye).attention,title:`Failed operations, failing checks, merged branches, or behind with local work`}]);sw(e,{placeholder:`Filter repos or branches`,ariaLabel:`Filter repositories and branches`,scopeLabel:`Show`,get scope(){return t(p).filter},onScopeChange:e=>t(p).setFilter(e),get scopes(){return t(n)},get query(){return t(p).search},set query(e){t(p).search=e}})}};l(a,e=>{n.model.availability.available&&n.model.repositories.length>0&&t(xe)&&e(o)}),k(e,r)},children:(e,r)=>{var i=f(),a=R(i),o=e=>{{let n=(e,t)=>{s(e,()=>(t?.()).open,()=>(t?.()).toggle,()=>(t?.()).measure,()=>(t?.()).overflows)},r=(e,t)=>{u(e,()=>(t?.()).open,()=>(t?.()).toggle)},i=L(()=>t(xe)?d:void 0);te(HE(e,{get list(){return t(i)},branch:n,changes:r,$$slots:{branch:!0,changes:!0}}),e=>B(h,e,!0),()=>t(h))}},c=e=>{{let r=L(()=>n.model.availability.available?n.model.initialLoading?`Loading Git repositories…`:`No Git data available`:`Git unavailable`),i=L(()=>n.model.availability.available?n.model.emptyMessage:n.model.availability.message);Jt(e,{get title(){return t(r)},get description(){return t(i)}})}};l(a,e=>{n.model.availability.available&&n.model.repositories.length>0?e(o):e(c,-1)}),k(e,i)},$$slots:{banner:!0,default:!0}})},$$slots:{default:!0}})});var Ue=G(He,2);C(Ue,()=>t(b),e=>{{let n=L(()=>t(b)?.name??``);eD(e,{get repositoryName(){return t(n)},get stashes(){return t(S)},get mutation(){return t(E)},onApply:e=>void M(`apply`,e),onDrop:e=>void M(`drop`,e),get open(){return t(v)},set open(e){B(v,e,!0)}})}});var We=G(Ue,2);{let e=L(()=>t(de)?t(de).kind===`file`?`This will permanently discard all uncommitted changes for ${t(de).file.path}.`:t(de).path?`This will permanently discard ${t(de).count} changed ${t(de).count===1?`file`:`files`} in ${t(de).path}.`:`This will permanently discard all ${t(de).count} ${t(de).area} ${t(de).count===1?`change`:`changes`}.`:`This will permanently discard this uncommitted change.`);jn(We,{title:`Discard change?`,get description(){return t(e)},confirmLabel:`Discard`,destructive:!0,onConfirm:()=>{let e=t(de);B(de,void 0),e&&(e.kind===`file`?n.actions.mutateFile(e.repository,e.file,`discard`):n.actions.mutateFileScope(e.repository,e.area,`discard`,e.path))},get open(){return t(K)},set open(e){B(K,e,!0)}})}var Ge=G(We,2);{let e=L(()=>`Switch each repository's primary checkout to its base branch and pull with fast-forward only: ${t(ue).map(e=>`${e.name} (${e.baseBranch})`).join(`, `)}. Local changes are kept; Git stops if files would be overwritten. Each repository reports its result independently in Activity.`);jn(Ge,{title:`Switch base branches and pull all?`,get description(){return t(e)},confirmLabel:`Switch and pull all`,onConfirm:()=>void n.actions.runBulkRemoteOperation?.(`switch-base-and-pull`),get open(){return t(oe)},set open(e){B(oe,e,!0)}})}var Ke=G(Ge,2);{let e=L(()=>t(_e).length>1);rD(Ke,{get group(){return t(I)},get multiRepo(){return t(e)},get initialBranch(){return t(ee)},get busy(){return n.model.operations.creatingWorktree},onSubmit:(e,r)=>n.actions.createWorktree(t(I)?.primary.relativePath??n.model.selectedRepository,e,r),get open(){return t(N)},set open(e){B(N,e,!0)}})}lD(G(Ke,2),{get target(){return t(ie)},get busy(){return n.model.operations.removingWorktree},onSubmit:e=>t(ie)?n.actions.removeWorktree(t(ie).relativePath,e):!1,get open(){return t(re)},set open(e){B(re,e,!0)}}),k(e,Ve),D()}function WD(e,t,n){let r=e.get(t);if(r)return r;let i;try{i=n()}catch(e){return Promise.reject(e)}e.set(t,i);let a=()=>{e.get(t)===i&&e.delete(t)};return i.then(a,a),i}var GD=new Set([`starting`,`running`,`ready`,`stopping`]),KD=864e5,qD={"needs-user":0,error:1,running:2,"awaiting-async":3};function JD(e){return e.displayName??e.name??e.command}function YD(e,t){return t.find(t=>t.id===e.projectId)}function XD(e,t,n){return e.filter(e=>YD(e,t)?.id===n)}function ZD(e){let t=e.now??Date.now(),n=new Map(e.projects.map(e=>[e.id,e.name])),r=[];for(let i of e.conversations){let a=e.activityById[i.id];if(!a)continue;let o=qD[a.indicator];o!==void 0&&(a.indicator===`error`&&t-Date.parse(i.updatedAt)>KD||r.push({rank:o,row:{conversationId:i.id,title:i.title,projectLabel:n.get(i.projectId),detail:a.label??QD(a.indicator),tone:a.tone,pulse:a.busy,at:i.updatedAt}}))}r.sort((e,t)=>e.rank-t.rank||t.row.at.localeCompare(e.row.at));let i=e.launches.filter(e=>GD.has(e.status)).map(t=>({launchId:t.id,title:JD(t),projectLabel:YD(t,e.projects)?.name,detail:$D(t),tone:t.status===`stopping`?`warning`:`info`,pulse:t.status!==`ready`,at:t.startedAt})).sort((e,t)=>t.at.localeCompare(e.at));return{conversations:r.map(({row:e})=>e),launches:i}}function QD(e){switch(e){case`needs-user`:return`Waiting for you`;case`awaiting-async`:return`Waiting for background work`;case`error`:return`Needs attention`;default:return`Agent running`}}function $D(e){switch(e.status){case`starting`:return`Starting`;case`ready`:return`Ready`;case`stopping`:return`Stopping`;default:return`Running`}}function eO(e){return[e.projectLabel,e.detail].filter(Boolean).join(` · `)}var tO=[`inbox`,`projects`,`activity`];function nO(){return{tab:`inbox`,stacks:{inbox:[],projects:[],activity:[]}}}function rO(e){return tO.includes(e)}function iO(e){switch(e.kind){case`project`:case`conversations`:case`launches`:case`notes`:case`git`:case`pull-requests`:case`branches`:return`${e.kind}:${e.projectId}`;case`files`:return`files:${e.projectId}:${e.path}`;case`note`:return`note:${e.projectId}:${e.noteId}`;case`launch`:return`launch:${e.launchId}`;case`center`:return`center:${e.identity.kind}:${e.identity.id}`;case`settings-page`:return`settings-page:${e.pageId}`;case`desktop-only`:return`desktop-only:${e.title}`;case`settings`:return e.kind}}function aO(e,t){return!e||!t?e===t:iO(e)===iO(t)}function oO(e,t=e.tab){return e.stacks[t].at(-1)}function sO(e,t){return t===e.tab?e.stacks[t].length===0?e:fO(e,t):{...e,tab:t}}function cO(e,t,n=e.tab){let r=e.stacks[n],i=iO(t),a=r.findIndex(e=>iO(e)===i),o;return a>=0?o=r.slice(0,a+1):(o=[...r,t],o.length>12&&(o=o.slice(o.length-12))),{tab:n,stacks:{...e.stacks,[n]:o}}}function lO(e,t){let n=e.stacks[e.tab];return n.length===0?cO(e,t):cO({...e,stacks:{...e.stacks,[e.tab]:n.slice(0,-1)}},t)}function uO(e){let t=e.stacks[e.tab];return t.length===0?e:{...e,stacks:{...e.stacks,[e.tab]:t.slice(0,-1)}}}function dO(e,t){let n=e.stacks[e.tab];return t>=n.length-1?e:{...e,stacks:{...e.stacks,[e.tab]:n.slice(0,t+1)}}}function fO(e,t=e.tab){return{...e,stacks:{...e.stacks,[t]:[]}}}function pO(e){return`projectId`in e?e.projectId:void 0}function mO(e){return e.stacks[e.tab].length}function hO(e,t){return e.kind===`settings`?t?{kind:`settings-page`,pageId:t}:{kind:`settings`}:e.kind===`logs`?{kind:`desktop-only`,title:`Logs`}:{kind:`center`,identity:{kind:e.kind,id:e.id}}}var gO=new Set([`project`,`conversations`,`launches`,`notes`,`git`,`pull-requests`,`branches`]);function _O(e){return typeof e==`string`&&e.length>0}function vO(e){if(!e||typeof e!=`object`)return;let t=e,n=t.kind;if(typeof n==`string`){if(gO.has(n))return _O(t.projectId)?{kind:n,projectId:t.projectId}:void 0;switch(n){case`files`:return _O(t.projectId)&&typeof t.path==`string`?{kind:n,projectId:t.projectId,path:t.path}:void 0;case`note`:return _O(t.projectId)&&_O(t.noteId)?{kind:n,projectId:t.projectId,noteId:t.noteId}:void 0;case`launch`:return _O(t.launchId)?_O(t.projectId)?{kind:n,launchId:t.launchId,projectId:t.projectId}:{kind:n,launchId:t.launchId}:void 0;case`center`:{let e=t.identity;return e?.kind===`conversation`&&_O(e.id)?{kind:n,identity:{kind:`conversation`,id:e.id}}:void 0}case`settings-page`:return _O(t.pageId)?{kind:n,pageId:t.pageId}:void 0;case`settings`:return{kind:n};default:return}}}function yO(e){return JSON.stringify(e)}function bO(e){let t=nO();if(!e)return t;let n;try{n=JSON.parse(e)}catch{return t}if(!n||typeof n!=`object`)return t;let{tab:r,stacks:i}=n;if(typeof r!=`string`||!rO(r)||!i||typeof i!=`object`)return t;let a=t;a.tab=r;for(let e of tO){let t=i[e];if(!Array.isArray(t))continue;let n=t.flatMap(e=>vO(e)??[]),r=nO();for(let e of n)r=cO(r,e,`inbox`);a.stacks[e]=r.stacks.inbox}return a}function xO(e){if(e.kind===`center`&&e.identity.kind===`conversation`)return e.identity.id}function SO(e,t){let n=!1,r={...e.stacks};for(let i of tO){let a=e.stacks[i],o=a.findIndex(e=>{let n=pO(e);if(n&&!t.projectIds.has(n))return!0;let r=xO(e);return r!==void 0&&!t.conversationIds.has(r)});o<0||(r[i]=a.slice(0,o),n=!0)}return n?{...e,stacks:r}:e}function CO(e){let{depth:t,reached:n,tab:r,forward:i}=e;if(n===t)return{kind:`ignore`};if(n<t)return{kind:`back`,count:t-n};let a=n-t;return i?.tab===r&&i.routes.length>=a?{kind:`forward`,routes:i.routes.slice(0,a),remaining:i.routes.slice(a)}:{kind:`rewind`,count:a}}var wO=`nerve.mobileNav.v1`;function TO(){if(typeof window>`u`)return nO();try{return bO(window.sessionStorage.getItem(wO))}catch{return nO()}}var EO=Y(U(TO()));typeof window<`u`&&oe(()=>{W(()=>{let e=yO(t(EO));try{window.sessionStorage.setItem(wO,e)}catch{}})});var DO={get state(){return t(EO)},get tab(){return t(EO).tab},get stack(){return t(EO).stacks[t(EO).tab]},get top(){return oO(t(EO))}};function OO(e){B(EO,sO(t(EO),e),!0)}function kO(e,n){B(EO,cO(t(EO),e,n),!0)}function AO(e){B(EO,lO(t(EO),e),!0)}function jO(){B(EO,uO(t(EO)),!0)}function MO(e){B(EO,dO(t(EO),e),!0)}function NO(e){B(EO,SO(t(EO),e),!0)}var PO=0;function FO(){return PO>0}async function IO(e){PO+=1;try{return await e()}finally{await ne(),--PO}}function LO(e,t){return e?.kind===t.kind&&e.id===t.id}function RO(e){if(e.kind===`center`)return e.identity}async function zO(e){await IO(async()=>{let t=pO(e);if(t&&Ds.selectedProjectId!==t&&await jd(t),e.kind===`launch`){await BO(e.launchId);return}let n=RO(e);if(!n||LO(Ds.activeCenterTab,n))return;let r=Ds.openCenterTabs.find(e=>LO(e,n));r?await qo(r):n.kind===`conversation`&&await Rd(n.id)})}async function BO(e){(kf.activeCenterLaunch?.id!==e||kf.selectedLaunch?.id!==e)&&kf.launches.some(t=>t.id===e)&&await jf(e)}function VO(e){let t=YD(e,Xr.projects)?.id;return{kind:`launch`,launchId:e.id,...t?{projectId:t}:{}}}function HO(e){let t=kf.launches.find(t=>t.id===e);kO(t?VO(t):{kind:`launch`,launchId:e})}async function UO(e,t){await IO(t);let n=Ds.activeCenterTab;n?.kind===e&&kO(hO(n))}async function WO(e){kO({kind:`center`,identity:{kind:`conversation`,id:e}}),await IO(()=>Rd(e))}async function GO(e){await IO(()=>jd(e.id)),kd(e.directory)}function KO(){let e,t,n=!1;W(()=>{let r=Ds.activeCenterTab,i=r?`${r.kind}:${r.id}`:void 0;if(!n){n=!0,t=i,e=r?.kind;return}if(i===t)return;let a=e;t=i,e=r?.kind,r&&!FO()&&me(()=>{let e=r.kind===`launch`?kf.activeCenterLaunch:void 0,t=e?VO(e):hO(r,r.kind===`settings`?Sf.activePageId:void 0),n=DO.top;aO(n,t)||(a===`pending-conversation`&&r.kind===`conversation`?n?.kind===`center`&&n.identity.kind===`pending-conversation`&&AO(t):kO(t))})})}var qO=O(`<!> <!>`,1);function JO(e,r){c(r,!0);let i=Y(!1),a=L(()=>r.project??Xr.activeProject),o=L(()=>[...Xr.projectSwitcherItems.slice(0,8).map(e=>({label:e.project.name,onSelect:()=>void GO(e.project)})),{type:`separator`},{label:`Open folder`,icon:tc,onSelect:()=>{Ds.projectPickerPath=void 0,Ds.projectPickerOpen=!0}}]);function s(){t(a)?GO(t(a)):B(i,!0)}var l=qO(),u=R(l);{let e=L(()=>t(a)?.name?`New chat in ${t(a).name}`:`New chat`);lo(u,{label:`New chat`,get ariaLabel(){return t(e)},onclick:s,children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.children),k(e,i)},$$slots:{default:!0}})}var d=G(u,2);Wa(d,{get open(){return t(i)},title:`New chat in project`,get items(){return t(o)},onOpenChange:e=>B(i,e,!0)}),k(e,l),D()}var YO=O(`<span class="absolute -right-2 -top-1.5 inline-flex min-w-4 items-center justify-center rounded-full bg-warning px-1 text-ui text-warning-foreground" aria-hidden="true"> </span>`),XO=O(`<span class="absolute -right-1 -top-0.5 size-2 rounded-full bg-info" aria-hidden="true"></span>`),ZO=O(`<span class="relative inline-flex"><!> <!></span>`);function QO(e,n){c(n,!0);let r=L(cl);{let n=L(()=>t(r).kind===`count`?`Settings, ${t(r).value} new`:`Settings`);Q(e,{variant:`ghost`,size:`icon`,get ariaLabel(){return t(n)},onclick:()=>kO({kind:`settings`}),children:(e,n)=>{var i=ZO(),a=q(i);Xc(a,{size:18,strokeWidth:1.9});var o=G(a,2),s=e=>{var n=YO(),i=z(n,!0);F(()=>w(i,t(r).value>99?`99+`:t(r).value)),k(e,n)},c=e=>{var t=XO();k(e,t)};l(o,e=>{t(r).kind===`count`?e(s):t(r).kind===`dot`&&e(c,1)}),x(i),k(e,i)},$$slots:{default:!0}})}D()}var $O=class{#e=Y(!1);get connected(){return t(this.#e)}set connected(e){B(this.#e,e,!0)}observe(){let e=xl(),t=rr(),n=()=>{this.connected=e&&t},r=wl(t=>{e=t,n()}),i=er(e=>{t=e,n()});return n(),()=>{r(),i()}}},ek=[`anthropic`,`openai-codex`,`github-copilot`];function tk(e,t){return ek.map(n=>({provider:n,usage:e[n],active:n===t})).filter(e=>e.usage||e.active)}var nk;function rk(e){return nk=e,()=>{nk===e&&(nk=void 0)}}var ik={get subscriptionUsages(){return tk(Kt.subscriptionUsage,nk?.selectedProvider)}};function ak(e){return e<1e3?e.toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:e<1e7?`${(e/1e6).toFixed(1)}M`:e<1e9?`${Math.round(e/1e6)}M`:e<1e10?`${(e/1e9).toFixed(1)}B`:e<0xe8d4a51000?`${Math.round(e/1e9)}B`:e<0x9184e72a000?`${(e/0xe8d4a51000).toFixed(1)}T`:`${Math.round(e/0xe8d4a51000)}T`}function ok(e){return e==null?`neutral`:e>90?`error`:e>70?`warning`:`neutral`}var sk=[{minutes:300,label:`Session`,abbreviation:`S`},{minutes:1440,label:`Daily`,abbreviation:`D`},{minutes:10080,label:`Weekly`,abbreviation:`W`},{minutes:43200,label:`Monthly`,abbreviation:`M`},{minutes:525600,label:`Annual`,abbreviation:`A`}];function ck(e,t){if(e==null||!Number.isFinite(e))return t;for(let t of sk)if(lk(e,t.minutes))return{label:t.label,abbreviation:t.abbreviation};return t}function lk(e,t){return e>=t*.95&&e<=t*1.05}function uk(e){if(e==null||!Number.isFinite(e)||e<0)return null;let t=Math.floor(e);if(t===0)return`0m`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60,a=[];return n>0&&a.push(`${n}d`),r>0&&a.push(`${r}h`),i>0&&a.push(`${i}m`),a.join(` `)}function dk(e){if(!e)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:pk(t-Date.now())}function fk(e){return e==null||e<=0?null:pk(e*1e3)}function pk(e){return e<=0?null:uk(Math.floor(e/6e4))}function mk(e){return e===`openai-codex`?`Codex`:e===`anthropic`?`Anthropic`:e===`github-copilot`?`Copilot`:e}function hk(e){return e.limit!=null}function gk(e){return e?e.quotas.filter(e=>!e.unlimited).map(e=>hk(e)?{quota:e,label:e.label,abbreviation:null}:{quota:e,...ck(e.windowMinutes,{label:e.label,abbreviation:e.label.charAt(0).toUpperCase()})}):[]}function _k(e){return(e?.quotas??[]).filter(e=>e.unlimited&&(e.used!=null||e.exhausted))}function vk(e){let t=(e?.quotas??[]).filter(e=>e.unlimited&&e.used==null&&!e.exhausted).map(e=>e.label);return t.length===0?null:`${t.length===1?t[0]:`${t.slice(0,-1).join(`, `)} and ${t.at(-1)}`} unlimited`}var yk=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function bk(e){return yk.format(e)}function xk(e){return e==null?`—`:`${Math.round(e)}%`}function Sk(e){return dk(e.resetsAt)??fk(e.resetAfterSeconds)}function Ck(e){let t=Sk(e);return!t||!hk(e)?t:t.match(/^\d+d/)?.[0]??t}function wk(e){if(!e.resetsAt)return null;let t=new Date(e.resetsAt);return Number.isNaN(t.getTime())?null:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,timeZone:`UTC`})}function Tk(e){return e.overage?.used??0}function Ek(e){return e.exhausted===!0||e.usedPercent!=null&&e.usedPercent>=100||Tk(e)>0}function Dk(e){if(Ek(e))return e.overage?.permitted?`warning`:`destructive`;let t=ok(e.usedPercent);return t===`error`?`destructive`:t===`warning`?`warning`:`success`}function Ok(e){return e.limit!=null&&e.used!=null?`${bk(e.used)} / ${bk(e.limit)}`:xk(e.usedPercent)}function kk(e){let t=wk(e),n=Sk(e);if(!hk(e)&&!e.unlimited)return n?`resets in ${n}`:void 0;let r=t?`resets ${t}`:null,i=e.unit,a=null;return e.unlimited?a=e.exhausted?`Organization limit reached`:`Included with your organization's plan`:Tk(e)>0?a=[`+${bk(Tk(e))}`,i,`billed as additional usage`].filter(Boolean).join(` `):Ek(e)?a=e.overage?.permitted?`Allowance used · additional usage is billed`:`Limit reached`:e.limit!=null&&e.used!=null&&(a=`${bk(Math.max(0,e.limit-e.used))} left`),[a,r].filter(Boolean).join(` · `)||void 0}function Ak(e){return e.used==null?`—`:`${bk(e.used)}${e.unit?` ${e.unit}`:``} used`}function jk(e){if(e.exhausted)return`limit reached`;if(e.used==null)return`included`;let t=e.unit===`credits`?` cr`:``;return`${bk(e.used)}${t}`}function Mk(e){return e.channelsConnected?`connected`:e.connection===`connected`?`reconnecting`:e.connection===`error`||e.connection===`closed`?`offline`:`connecting`}function Nk(e){switch(e){case`connected`:return`connected`;case`reconnecting`:return`reconnecting`;case`connecting`:return`connecting`;default:return`offline`}}function Pk(e){let t;for(let n of e)for(let e of n.usage?.quotas??[]){let r=e.usedPercent;r!=null&&ok(r)===`error`&&(!t||r>t.percent)&&(t={provider:n.provider,percent:r})}return t}function Fk(e){if(e.state===`offline`)return{tone:`destructive`,message:`Disconnected from the daemon`};if(e.state===`reconnecting`)return{tone:`warning`,message:`Reconnecting to the daemon…`};let t=Pk(e.usages);if(t)return{tone:`warning`,message:`${mk(t.provider)} usage at ${Math.round(t.percent)}%`}}var Ik=U({open:!1}),Lk=new $O;function Rk(){return Lk.observe()}function zk(){return Mk({channelsConnected:Lk.connected,connection:Xr.connection})}function Bk(){return Nk(zk())}function Vk(){return Fk({state:zk(),usages:ik.subscriptionUsages})}var Hk=O(`<button type="button"><!> <span class="min-w-0 flex-1 truncate"> </span> <span class="flex-none text-caption text-muted-foreground">Details</span></button>`);function Uk(e,n){c(n,!0);let r=L(Vk);var i=f(),a=R(i),o=e=>{var n=Hk(),i=q(n);bn(i,{size:16,strokeWidth:2,class:`flex-none`});var a=G(i,2),o=z(a,!0);y(2),x(n),F(()=>{X(n,1,T([`flex min-h-11 w-full items-center gap-2 px-3 text-left text-ui`,t(r).tone===`destructive`?`bg-destructive-subtle text-destructive`:`bg-warning-subtle text-warning`])),w(o,t(r).message)}),h(`click`,n,()=>Ik.open=!0),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i),D()}ue([`click`]);var Wk=U({}),Gk=U({});function Kk(e){let t=Xr.projects.find(t=>t.id===e.projectId);if(!t)return[];let n={homeDir:Xr.status?.storage.userHome,conversationCount:e=>Ar(O_(Xr.conversations),e),maintenanceActive:yf.active,conversationActivity:e=>Xr.conversationActivityById[e],onOpenConversation:e=>void Rd(e),onNewConversationInProject:kd,onUpdateConversationState:(e,t)=>void Wr(e,t),requestPrune:()=>{},requestDelete:e=>{Wk.target=e},requestRename:e=>{Gk.target=e}};return Fr(jr([t])[0],O_([e])[0],n)}function qk(e,t){return e.find(e=>e.type!==`separator`&&e.type!==`label`&&e.type!==`submenu`&&t.includes(e.label))}function Jk(e,t){return{label:e.label,icon:e.icon,tone:t,onSelect:()=>e.onSelect?.()}}function Yk(e){let t=Kk(e),n=qk(t,[`Mark done`,`Reopen`]),r=qk(t,[`Pin`,`Unpin`]),i=qk(t,[`Delete`]),a=[r&&Jk(r,`info`),i&&!i.disabled?Jk(i,`destructive`):void 0].filter(e=>!!e);return{menuItems:t,swipeLeading:n?Jk(n,`success`):void 0,swipeTrailing:a.length?a:void 0}}var Xk=O(`<!> <!> <!>`,1),Zk=O(`<!> <!> <!> <!>`,1);function Qk(e,n){c(n,!0);let r=L(()=>ZD({conversations:Xr.conversations,activityById:Xr.conversationActivityById,launches:kf.launches,projects:Xr.projects})),i=L(()=>{let e=[];return t(r).conversations.length&&e.push(`${t(r).conversations.length} ${t(r).conversations.length===1?`chat`:`chats`}`),t(r).launches.length&&e.push(`${t(r).launches.length} ${t(r).launches.length===1?`launch`:`launches`}`),e.length||e.push(`Nothing running`),e.push(Bk()),e.join(` · `)});function a(e){let t=Xr.conversations.find(t=>t.id===e);return t?Yk(t):void 0}function o(e){return[{label:`Show output`,icon:qc,onSelect:()=>HO(e)},{label:`Restart`,icon:zn,onSelect:()=>void Of(e)},{label:`Stop`,icon:Xs,destructive:!0,onSelect:()=>void Ff(e)}]}JO(e,{children:(e,n)=>{$a(e,{title:`Activity`,get subtitle(){return t(i)},onSubtitleSelect:()=>Ik.open=!0,subtitleLabel:`Daemon status and usage`,actions:e=>{QO(e,{})},children:(e,n)=>{var i=Zk(),s=R(i);Uk(s,{});var c=G(s,2),u=e=>{{let n=L(()=>`${t(r).conversations.length}`);Ha(e,{title:`Conversations`,get meta(){return t(n)},children:(e,n)=>{var i=f(),o=R(i);v(o,17,()=>t(r).conversations,e=>e.conversationId,(e,n,r,i)=>{let o=L(()=>a(t(n).conversationId));{let r=L(()=>eO(t(n))),i=L(()=>js(t(n).at)),a=L(()=>t(o)?.menuItems),s=L(()=>t(o)?.swipeLeading),c=L(()=>t(o)?.swipeTrailing);Xa(e,{get title(){return t(n).title},get detail(){return t(r)},get meta(){return t(i)},get tone(){return t(n).tone},get pulse(){return t(n).pulse},chevron:!1,get menuItems(){return t(a)},get swipeLeading(){return t(s)},get swipeTrailing(){return t(c)},onclick:()=>void WO(t(n).conversationId)})}}),k(e,i)},$$slots:{default:!0}})}};l(c,e=>{t(r).conversations.length&&e(u)});var d=G(c,2),p=e=>{{let n=L(()=>`${t(r).launches.length}`);Ha(e,{title:`Launches`,get meta(){return t(n)},children:(e,n)=>{var i=f(),a=R(i);v(a,17,()=>t(r).launches,e=>e.launchId,(e,n)=>{{let r=L(()=>eO(t(n))),i=L(()=>js(t(n).at)),a=L(()=>o(t(n).launchId));Xa(e,{get title(){return t(n).title},get detail(){return t(r)},get meta(){return t(i)},get tone(){return t(n).tone},get pulse(){return t(n).pulse},get menuItems(){return t(a)},onclick:()=>HO(t(n).launchId)})}}),k(e,i)},$$slots:{default:!0}})}};l(d,e=>{t(r).launches.length&&e(p)});var m=G(d,2),h=e=>{var t=f(),n=R(t);H(n,()=>as,(e,t)=>{t(e,{class:`px-6 py-10`,children:(e,t)=>{var n=f(),r=R(n);H(r,()=>ts,(e,t)=>{t(e,{children:(e,t)=>{var n=Xk(),r=R(n);H(r,()=>rs,(e,t)=>{t(e,{class:`text-muted-foreground`,children:(e,t)=>{$b(e,{size:28,strokeWidth:1.6})},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>os,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var n=g(`Nothing running`);k(e,n)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>is,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var n=g(`Running agents and background launches from every project show up
9
+ here.`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,t)};l(m,e=>{!t(r).conversations.length&&!t(r).launches.length&&e(h)}),k(e,i)},$$slots:{actions:!0,default:!0}})},$$slots:{default:!0}}),D()}var $k=O(`<!> <!>`,1);function eA(e,n){c(n,!0);let r=L(()=>Wk.target),i=L(()=>Gk.target);var a=$k(),o=R(a);{let e=L(()=>!!t(r)),n=L(()=>t(r)?`“${t(r).label}” and its history are removed from Nerve. Files on disk are not deleted.`:``);jn(o,{get open(){return t(e)},title:`Delete conversation?`,get description(){return t(n)},confirmLabel:`Delete`,destructive:!0,onConfirm:()=>{t(r)&&!yf.active&&$ee(t(r).id)},onOpenChange:e=>{e||(Wk.target=void 0)}})}var s=G(o,2),u=e=>{let n=L(()=>t(i));var r=f(),a=R(r);C(a,()=>t(n),e=>{kr(e,{open:!0,get title(){return t(n).title},onRename:e=>void Wr(t(n).id,{title:e}),onOpenChange:e=>{!e&&Gk.target===t(n)&&(Gk.target=void 0)}})}),k(e,r)};l(s,e=>{t(i)&&e(u)}),k(e,a),D()}function tA(){return Va({conversations:Xr.conversations,activityById:Xr.conversationActivityById,projectNameById:Object.fromEntries(Xr.projects.map(e=>[e.id,e.name]))})}function nA(e,n){c(n,!0);let r=L(tA),i=L(()=>{let e=[];return t(r).needsYou.length&&e.push(`${t(r).needsYou.length} waiting`),t(r).running.length&&e.push(`${t(r).running.length} running`),t(r).awaitingAsync.length&&e.push(`${t(r).awaitingAsync.length} in background`),e.length||e.push(`All caught up`),e.push(Bk()),e.join(` · `)});function a(e){WO(e.conversationId)}function o(e){let t=Xr.conversations.find(t=>t.id===e.conversationId);return t?Yk(t):{menuItems:[]}}JO(e,{children:(e,n)=>{$a(e,{title:`Inbox`,get subtitle(){return t(i)},onSubtitleSelect:()=>Ik.open=!0,subtitleLabel:`Daemon status and usage`,actions:e=>{QO(e,{})},children:(e,n)=>{Ya(e,{get model(){return t(r)},onOpen:a,rowActions:o,summary:e=>{Uk(e,{})},$$slots:{summary:!0}})},$$slots:{actions:!0,default:!0}})},$$slots:{default:!0}}),D()}var rA=A(`<path d="M150 162L232 235L258 208L284 288L362 350"></path>`),iA=A(`<path d="M150 162L222 226L246 194L272 300L296 262L362 350"></path>`),aA=A(`<svg viewBox="120 120 272 272" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M150 350V162"></path><path d="M362 350V162"></path><!></g></svg>`);function oA(e,t){let n=K(t,`compact`,3,!1);var r=aA(),i=q(r),a=G(q(i),2),o=e=>{var t=rA();k(e,t)},s=e=>{var t=iA();k(e,t)};l(a,e=>{n()?e(o):e(s,-1)}),x(i),x(r),F(()=>{X(r,0,T(t.class)),J(r,`role`,t.label?`img`:void 0),J(r,`aria-label`,t.label),J(r,`aria-hidden`,t.label?void 0:`true`),J(i,`stroke-width`,n()?32:28)}),k(e,r)}var sA=/\.(?:png|jpe?g|gif|webp|bmp|svg|heic|heif|avif|tiff?)$/i;function cA(e,t){let n=e.trim();n.length>=2&&n.startsWith(`"`)&&n.endsWith(`"`)&&(n=n.slice(1,-1).replaceAll(`\\"`,`"`)),n.startsWith(`@`)&&(n=n.slice(1));let r=n.length>1&&/[\\/]$/.test(n),i=n.replace(/[\\/]+$/,``).split(/[\\/]/).pop()||n,a=`@${n}`;return{insert:/[\s"]/.test(a)?`"${a.replaceAll(`"`,`\\"`)}"`:a,label:r?`${i}/`:i,kind:t??(r?`directory`:sA.test(n)?`image`:`file`),title:n}}var lA=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[ru.contextHash,r]]}addChild(e,t){e.prop(ru.contextHash)!=this.hash&&(e=new hu(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new hu(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new hu(nu.none,e,t,n,this.hashProp)})}},uA;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(uA||={});var dA=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},fA=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return gA(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function pA(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==uA.OrderedList?CA:SA)(n,t,!1);return r>0&&(e.type!=uA.BulletList||bA(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var mA={[uA.Blockquote](e,t,n){return n.next==62&&(n.markers.push(ZA(uA.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(hA(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[uA.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[uA.OrderedList]:pA,[uA.BulletList]:pA,[uA.Document](){return!0}};function hA(e){return e==32||e==9||e==10||e==13}function gA(e,t=0){for(;t<e.length&&hA(e.charCodeAt(t));)t++;return t}function _A(e,t,n){for(;t>n&&hA(e.charCodeAt(t-1));)t--;return t}function vA(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function yA(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function bA(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!hA(n))return-1}return n&&e.next==45&&TA(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(LA.SetextHeading)>-1||r<3?-1:1}function xA(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function SA(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||hA(e.text.charCodeAt(e.pos+1)))&&(!n||xA(t,uA.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function CA(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!hA(e.text.charCodeAt(r+1))||n&&!xA(t,uA.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function wA(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function TA(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&hA(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var EA=/^[ \t]*$/,DA=/-->/,OA=/\?>/,kA=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,DA],[/^\s*<\?/,OA],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,EA],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,EA]];function AA(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=kA.length-+!!n;e<t;e++)if(kA[e][0].test(r))return e;return-1}function jA(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function MA(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==uA.CodeText?e[r].to=n:e.push(ZA(uA.CodeText,t,n))}var NA={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(MA(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){MA(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==uA.CodeText?MA(o,e.from,e.to):o.push(e);s=[]}MA(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&MA(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=uA.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(uA.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=vA(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=_A(t.text,t.text.length,o),c=[ZA(uA.CodeMark,r,r+a)];o<s&&c.push(ZA(uA.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&MA(c,e.lineStart-1,e.lineStart),c.push(ZA(uA.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(MA(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(MA(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(uA.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=yA(t);return n<0?!1:(e.startContext(uA.Blockquote,t.pos),e.addNode(uA.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(bA(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(uA.HorizontalRule,n),!0},BulletList(e,t){let n=SA(t,e,!1);if(n<0)return!1;e.block.type!=uA.BulletList&&e.startContext(uA.BulletList,t.basePos,t.next);let r=jA(t,t.pos+1);return e.startContext(uA.ListItem,t.basePos,r-t.baseIndent),e.addNode(uA.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=CA(t,e,!1);if(n<0)return!1;e.block.type!=uA.OrderedList&&e.startContext(uA.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=jA(t,t.pos+n);return e.startContext(uA.ListItem,t.basePos,r-t.baseIndent),e.addNode(uA.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=wA(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=_A(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;o!=a&&o!=r&&hA(t.text.charCodeAt(o-1))||(o=t.text.length);let s=e.buffer.write(uA.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(uA.HeaderMark,o-r,a-r);let c=s.finish(uA.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=AA(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=kA[n][1],a=[],o=i!=EA;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==DA?uA.CommentBlock:i==OA?uA.ProcessingInstructionBlock:uA.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},PA=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
10
+ `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&gA(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,ZA(uA.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(lj(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(ZA(uA.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(sj(e,gA(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=gA(e,this.pos),n=0;if(t>this.pos){let r=cj(e,t,this.start);if(r){let t=FA(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=FA(e,this.pos),n>0&&n<e.length?n:-1}else return FA(e,this.pos)}};function FA(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!hA(n))return-1}return t}var IA=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:TA(t),i=t.next;if(r<0)return!1;let a=ZA(uA.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,ZA(i==61?uA.SetextHeading1:uA.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},LA={LinkReference(e,t){return t.content.charCodeAt(0)==91?new PA(t):null},SetextHeading(){return new IA}},RA=[(e,t)=>wA(t)>=0,(e,t)=>vA(t)>=0,(e,t)=>yA(t)>=0,(e,t)=>SA(t,e,!0)>=0,(e,t)=>CA(t,e,!0)>=0,(e,t)=>bA(t,e,!0)>=0,(e,t)=>AA(t,e,!0)>=0],zA={text:``,end:0},BA=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new fA,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=lA.create(uA.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new pj(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new dA(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
11
+ `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=mj(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=zA;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+uA[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
12
+ `?``:t;else{let e=t.indexOf(`
13
+ `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=lA.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new hu(this.parser.nodeSet.types[e],qA,qA,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(dj(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?VA(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=dj(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(uA.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?ZA(this.parser.getNodeType(e),t,n,r):new XA(e,t)}get buffer(){return new JA(this.parser.nodeSet)}};function VA(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=VA(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new hu(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var HA=class e extends pu{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new BA(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=WA(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(UA(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=uA.ATXHeading1&&c<=uA.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(nu.define({id:c,name:n,props:l&&[[ru.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof Yl?t[n]=s:Object.assign(t,s))}r=new Du(e),t&&(r=r.extend(tu(t)))}if(UA(n.props)&&(r=r.extend(...n.props)),UA(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(UA(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?GA(s,e.before):e.after?GA(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(UA(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?GA(l,e.before):e.after?GA(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new uj(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function UA(e){return e!=null&&e.length>0}function WA(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=WA(e[0]);if(e.length==1)return t;let n=WA(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||qA).concat(t||qA),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function GA(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var KA=[nu.none];for(let e=1,t;t=uA[e];e++)KA[e]=nu.define({id:e,name:t,props:e>=uA.Escape?[]:[[ru.group,e in mA?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var qA=[],JA=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return hu.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},YA=class{constructor(e,t,n,r=qA){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new JA(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},XA=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return qA}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function ZA(e,t,n,r){return new YA(e,t,n,r)}var QA={resolve:`Emphasis`,mark:`EmphasisMark`},$A={resolve:`Emphasis`,mark:`EmphasisMark`},ej={},tj={},nj=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},rj=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,ij=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{ij=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var aj={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(rj.charCodeAt(t)==r)return e.append(ZA(uA.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(ZA(uA.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(ZA(uA.InlineCode,n,r+1,[ZA(uA.CodeMark,n,n+i),ZA(uA.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(ZA(uA.Autolink,n,n+1+i[0].length,[ZA(uA.LinkMark,n,n+1),ZA(uA.URL,n+1,n+i[0].length),ZA(uA.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(ZA(uA.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(ZA(uA.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(ZA(uA.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=ij.test(i),s=ij.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new nj(t==95?QA:$A,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(ZA(uA.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(ZA(uA.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new nj(ej,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new nj(tj,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof nj&&(r.type==ej||r.type==tj)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=oj(e,i,r.type==ej?uA.Link:uA.Image,r.from,n+1);if(r.type==ej)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof nj&&t.type==ej&&(t.side=0)}return a.to}}return-1}};function oj(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(ZA(uA.LinkMark,r,r+(n==uA.Image?2:1))),t.push(ZA(uA.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=sj(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=cj(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(ZA(uA.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(ZA(uA.LinkMark,n,s)))}else if(o==91){let n=lj(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return ZA(n,r,s,t)}function sj(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return ZA(uA.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(hA(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?ZA(uA.URL,t+n,i+n):i==e.length&&null}}function cj(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return ZA(uA.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function lj(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&ZA(uA.LinkLabel,t+n,a+1+n);else{if(r&&!hA(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var uj=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new nj(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof nj&&(t.type==ej||t.type==tj))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof nj&&n.type.resolve&&n.side&2))continue;let r=n.type==QA||n.type==$A,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof nj&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof YA&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new nj(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new nj(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof YA&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof nj&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof nj?t:null}skipSpace(e){return gA(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?ZA(this.parser.getNodeType(e),t,n,r):new XA(e,t)}};uj.linkStart=ej,uj.imageStart=tj;function dj(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof YA&&(n[r]=new YA(t.type,t.from,t.to,dj(t.children,[e])))}else n.splice(r++,0,e)}return n}var fj=[uA.CodeBlock,uA.ListItem,uA.OrderedList,uA.BulletList],pj=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
14
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ru.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=mj(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new hu(e.parser.nodeSet.types[uA.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(fj.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function mj(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var hj=tu({"Blockquote/...":$.quote,HorizontalRule:$.contentSeparator,"ATXHeading1/... SetextHeading1/...":$.heading1,"ATXHeading2/... SetextHeading2/...":$.heading2,"ATXHeading3/...":$.heading3,"ATXHeading4/...":$.heading4,"ATXHeading5/...":$.heading5,"ATXHeading6/...":$.heading6,"Comment CommentBlock":$.comment,Escape:$.escape,Entity:$.character,"Emphasis/...":$.emphasis,"StrongEmphasis/...":$.strong,"Link/... Image/...":$.link,"OrderedList/... BulletList/...":$.list,"BlockQuote/...":$.quote,"InlineCode CodeText":$.monospace,"URL Autolink":$.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":$.processingInstruction,"CodeInfo LinkLabel":$.labelName,LinkTitle:$.string,Paragraph:$.content}),gj=new HA(new Du(KA).extend(hj),Object.keys(NA).map(e=>NA[e]),Object.keys(NA).map(e=>LA[e]),Object.keys(NA),RA,mA,Object.keys(aj).map(e=>aj[e]),Object.keys(aj),[]);function _j(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function vj(e){let{codeParser:t,htmlParser:n}=e;return{wrap:lu((e,r)=>{let i=e.type.id;if(t&&(i==uA.CodeBlock||i==uA.FencedCode)){let n=``;if(i==uA.FencedCode){let t=e.node.getChild(uA.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==uA.CodeText,bracketed:i==uA.FencedCode}}else if(n&&(i==uA.HTMLBlock||i==uA.HTMLTag||i==uA.CommentBlock))return{parser:n,overlay:_j(e.node,e.from,e.to)};return null})}}var yj={resolve:`Strikethrough`,mark:`StrikethroughMark`},bj={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":$.strikethrough}},{name:`StrikethroughMark`,style:$.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=ij.test(r),c=ij.test(i);return e.addDelimiter(yj,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function xj(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Sj(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var Cj=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,wj=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Cj.test(r=t.text.slice(t.pos))){let i=[];xj(e,n.content,0,i,n.start)==xj(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];xj(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},Tj={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":$.heading}},`TableRow`,{name:`TableCell`,style:$.content},{name:`TableDelimiter`,style:$.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Sj(t.content,0)?new wj:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof wj)||!Sj(t.text,t.basePos))return!1;let r=e.peekLine();return Cj.test(r)&&xj(e,t.text,t.basePos)==xj(e,r,t.basePos)},before:`SetextHeading`}]},Ej=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},Dj={defineNodes:[{name:`Task`,block:!0,style:$.list},{name:`TaskMarker`,style:$.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new Ej:null},after:`SetextHeading`}]},Oj=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,kj=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,Aj=/[\w-]+\.[\w-]+($|[/:])/,jj=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Mj=/\/[a-zA-Z\d@.]+/gy;function Nj(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function Pj(e,t){kj.lastIndex=t;let n=kj.exec(e);if(!n||Aj.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&Nj(e,t,r,`)`)>Nj(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function Fj(e,t){jj.lastIndex=t;let n=jj.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var Ij=[Tj,Dj,bj,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Oj.lastIndex=r;let i=Oj.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=Pj(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=Fj(e.text,r):(a=Fj(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(Mj.lastIndex=a,i=Mj.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function Lj(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),hA(s))break}return-1}}var Rj={defineNodes:[{name:`Superscript`,style:$.special($.content)},{name:`SuperscriptMark`,style:$.processingInstruction}],parseInline:[{name:`Superscript`,parse:Lj(94,`Superscript`,`SuperscriptMark`)}]},zj={defineNodes:[{name:`Subscript`,style:$.special($.content)},{name:`SubscriptMark`,style:$.processingInstruction}],parseInline:[{name:`Subscript`,parse:Lj(126,`Subscript`,`SubscriptMark`)}]},Bj={defineNodes:[{name:`Emoji`,style:$.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},Vj=55,Hj=1,Uj=56,Wj=2,Gj=57,Kj=3,qj=4,Jj=5,Yj=6,Xj=7,Zj=8,Qj=9,$j=10,eM=11,tM=12,nM=13,rM=58,iM=14,aM=15,oM=59,sM=21,cM=23,lM=24,uM=25,dM=27,fM=28,pM=29,mM=32,hM=35,gM=37,_M=38,vM=0,yM=1,bM={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},xM={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},SM={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function CM(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var wM=null,TM=null,EM=0;function DM(e,t){let n=e.pos+t;if(EM==n&&TM==e)return wM;let r=e.peek(t),i=``;for(;CM(r);)i+=String.fromCharCode(r),r=e.peek(++t);return TM=e,EM=n,wM=i?i.toLowerCase():r==jM||r==MM?void 0:null}var OM=60,kM=62,AM=47,jM=63,MM=33,NM=45;function PM(e,t){this.name=e,this.parent=t}var FM=[Yj,$j,Xj,Zj,Qj],IM=new Hu({start:null,shift(e,t,n,r){return FM.indexOf(t)>-1?new PM(DM(r,1)||``,e):e},reduce(e,t){return t==sM&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==Yj||i==gM?new PM(DM(r,1)||``,e):e},strict:!1}),LM=new Bu((e,t)=>{if(e.next!=OM){e.next<0&&t.context&&e.acceptToken(rM);return}e.advance();let n=e.next==AM;n&&e.advance();let r=DM(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?aM:iM);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(eM);if(i&&xM[i])return e.acceptToken(rM,-2);if(t.dialectEnabled(vM))return e.acceptToken(tM);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(nM)}else{if(r==`script`)return e.acceptToken(Xj);if(r==`style`)return e.acceptToken(Zj);if(r==`textarea`)return e.acceptToken(Qj);if(bM.hasOwnProperty(r))return e.acceptToken($j);i&&SM[i]&&SM[i][r]?e.acceptToken(rM,-1):e.acceptToken(Yj)}},{contextual:!0}),RM=new Bu(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(oM);break}if(e.next==NM)t++;else if(e.next==kM&&t>=2){n>=3&&e.acceptToken(oM,-2);break}else t=0;e.advance()}});function zM(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var BM=new Bu((e,t)=>{if(e.next==AM&&e.peek(1)==kM){let n=t.dialectEnabled(yM)||zM(t.context);e.acceptToken(n?Jj:qj,2)}else e.next==kM&&e.acceptToken(qj,1)});function VM(e,t,n){let r=2+e.length;return new Bu(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==OM||a==1&&i.next==AM||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==kM){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var HM=VM(`script`,Vj,Hj),UM=VM(`style`,Uj,Wj),WM=VM(`textarea`,Gj,Kj),GM=tu({"Text RawText IncompleteTag IncompleteCloseTag":$.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":$.angleBracket,TagName:$.tagName,"MismatchedCloseTag/TagName":[$.tagName,$.invalid],AttributeName:$.attributeName,"AttributeValue UnquotedAttributeValue":$.attributeValue,Is:$.definitionOperator,"EntityReference CharacterReference":$.character,Comment:$.blockComment,ProcessingInst:$.processingInstruction,DoctypeDecl:$.documentMeta}),KM=Vu.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:IM,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[GM],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[HM,UM,WM,BM,LM,RM,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function qM(e,t){let n=Object.create(null);for(let r of e.getChildren(lM)){let e=r.getChild(uM),i=r.getChild(dM)||r.getChild(fM);e&&(n[t.read(e.from,e.to)]=i?i.type.id==dM?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function JM(e,t){let n=e.getChild(cM);return n?t.read(n.from,n.to):` `}function YM(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=qM(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function XM(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return lu((e,t)=>{let s=e.type.id;if(s==pM)return YM(e,t,n);if(s==mM)return YM(e,t,r);if(s==hM)return YM(e,t,i);if(s==sM&&a.length){let n=e.node,r=n.firstChild,i=r&&JM(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=qM(r,t)))){let t=n.lastChild,i=t.type.id==_M?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==lM){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=JM(n.parent,t))continue;let e=n.lastChild;if(e.type.id==dM){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==fM)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var ZM=135,QM=1,$M=136,eN=137,tN=2,nN=138,rN=3,iN=4,aN=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],oN=58,sN=40,cN=95,lN=91,uN=45,dN=46,fN=35,pN=37,mN=38,hN=92,gN=10,_N=42;function vN(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function yN(e){return e>=48&&e<=57}function bN(e){return yN(e)||e>=97&&e<=102||e>=65&&e<=70}var xN=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(vN(c)||c==uN||c==cN||a&&yN(c))!a&&(c!=uN||s>0)&&(a=!0),o===s&&c==uN&&o++,r.advance();else if(c==hN&&r.peek(1)!=gN){if(r.advance(),bN(r.next)){do r.advance();while(bN(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(tN)?t:c==sN?n:e);break}}},SN=new Bu(xN($M,tN,eN),{contextual:!0}),CN=new Bu(xN(nN,rN,iN),{contextual:!0}),wN=new Bu(e=>{if(aN.includes(e.peek(-1))){let{next:t}=e;(vN(t)||t==cN||t==fN||t==dN||t==_N||t==lN||t==oN&&vN(e.peek(1))||t==uN||t==mN)&&e.acceptToken(ZM)}}),TN=new Bu(e=>{if(!aN.includes(e.peek(-1))){let{next:t}=e;if(t==pN&&(e.advance(),e.acceptToken(QM)),vN(t)){do e.advance();while(vN(e.next)||yN(e.next));e.acceptToken(QM)}}}),EN=tu({"AtKeyword import charset namespace keyframes media supports font-feature-values":$.definitionKeyword,"from to selector scope MatchFlag":$.keyword,NamespaceName:$.namespace,KeyframeName:$.labelName,KeyframeRangeName:$.operatorKeyword,TagName:$.tagName,ClassName:$.className,PseudoClassName:$.constant($.className),IdName:$.labelName,"FeatureName PropertyName":$.propertyName,AttributeName:$.attributeName,NumberLiteral:$.number,KeywordQuery:$.keyword,UnaryQueryOp:$.operatorKeyword,"CallTag ValueName FontName":$.atom,VariableName:$.variableName,Callee:$.operatorKeyword,Unit:$.unit,"UniversalSelector NestingSelector":$.definitionOperator,"MatchOp CompareOp":$.compareOperator,"ChildOp SiblingOp, LogicOp":$.logicOperator,BinOp:$.arithmeticOperator,Important:$.modifier,Comment:$.blockComment,ColorLiteral:$.color,"ParenthesizedContent StringLiteral":$.string,":":$.punctuation,"PseudoOp #":$.derefOperator,"; , |":$.separator,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace}),DN={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},ON={__proto__:null,or:104,and:104,not:112,only:112,layer:186},kN={__proto__:null,selector:118,layer:182},AN={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},jN={__proto__:null,to:223},MN=Vu.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[EN],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[wN,TN,SN,CN,1,2,3,4,new zu(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>DN[e]||-1},{term:138,get:e=>ON[e]||-1},{term:4,get:e=>kN[e]||-1},{term:28,get:e=>AN[e]||-1},{term:136,get:e=>jN[e]||-1}],tokenPrec:2256}),NN=e({css:()=>XN}),PN=null;function FN(){if(!PN&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));PN=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return PN||[]}var IN=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),LN=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),RN=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),zN=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),BN=/^(\w[\w-]*|-\w[\w-]*|)$/,VN=/^-(-[\w-]*)?$/;function HN(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`&&t.sliceString(n.from,n.to)==`var`}var UN=new mu,WN=[`Declaration`];function GN(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function KN(e,t,n){if(t.to-t.from>4096){let r=UN.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(eu.IncludeAnonymous);if(o.firstChild())do for(let t of KN(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return UN.set(t,i),i}{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(WN)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var qN=e=>t=>{let{state:n,pos:r}=t,i=iu(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:FN(),validFor:BN};if(i.name==`ValueName`)return{from:i.from,options:LN,validFor:BN};if(i.name==`PseudoClassName`)return{from:i.from,options:IN,validFor:BN};if(e(i)||(t.explicit||a)&&HN(i,n.doc))return{from:e(i)||a?i.from:r,options:KN(n.doc,GN(i),e),validFor:VN};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:FN(),validFor:BN};return{from:i.from,options:RN,validFor:BN}}if(i.name==`AtKeyword`)return{from:i.from,options:zN,validFor:BN};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:IN,validFor:BN}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:LN,validFor:BN}:o.name==`Block`||o.name==`Styles`?{from:r,options:FN(),validFor:BN}:null},JN=qN(e=>e.name==`VariableName`),YN=Ou.define({name:`css`,parser:MN.configure({props:[su.add({Declaration:_u()}),Nu.add({"Block KeyframeList":Pu})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function XN(){return new wu(YN,YN.data.of({autocomplete:JN}))}var ZN=316,QN=317,$N=1,eP=2,tP=3,nP=4,rP=318,iP=320,aP=321,oP=5,sP=6,cP=0,lP=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],uP=125,dP=59,fP=47,pP=42,mP=43,hP=45,gP=60,_P=44,vP=63,yP=46,bP=91,xP=new Hu({start:!1,shift(e,t){return t==oP||t==sP||t==iP?e:t==aP},strict:!1}),SP=new Bu((e,t)=>{let{next:n}=e;(n==uP||n==-1||t.context)&&e.acceptToken(rP)},{contextual:!0,fallback:!0}),CP=new Bu((e,t)=>{let{next:n}=e,r;lP.indexOf(n)>-1||(n!=fP||(r=e.peek(1))!=fP&&r!=pP)&&n!=uP&&n!=dP&&n!=-1&&!t.context&&e.acceptToken(ZN)},{contextual:!0}),wP=new Bu((e,t)=>{e.next==bP&&!t.context&&e.acceptToken(QN)},{contextual:!0}),TP=new Bu((e,t)=>{let{next:n}=e;if(n==mP||n==hP){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift($N);e.acceptToken(n?$N:eP)}}else n==vP&&e.peek(1)==yP&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(tP))},{contextual:!0});function EP(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var DP=new Bu((e,t)=>{if(e.next!=gP||!t.dialectEnabled(cP)||(e.advance(),e.next==fP))return;let n=0;for(;lP.indexOf(e.next)>-1;)e.advance(),n++;if(EP(e.next,!0)){for(e.advance(),n++;EP(e.next,!1);)e.advance(),n++;for(;lP.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==_P)return;for(let t=0;;t++){if(t==7){if(!EP(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(nP,-n)}),OP=tu({"get set async static":$.modifier,"for while do if else switch try catch finally return throw break continue default case defer":$.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":$.operatorKeyword,"let var const using function class extends":$.definitionKeyword,"import export from":$.moduleKeyword,"with debugger new":$.keyword,TemplateString:$.special($.string),super:$.atom,BooleanLiteral:$.bool,this:$.self,null:$.null,Star:$.modifier,VariableName:$.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":$.function($.variableName),VariableDefinition:$.definition($.variableName),Label:$.labelName,PropertyName:$.propertyName,PrivatePropertyName:$.special($.propertyName),"CallExpression/MemberExpression/PropertyName":$.function($.propertyName),"FunctionDeclaration/VariableDefinition":$.function($.definition($.variableName)),"ClassDeclaration/VariableDefinition":$.definition($.className),"NewExpression/VariableName":$.className,PropertyDefinition:$.definition($.propertyName),PrivatePropertyDefinition:$.definition($.special($.propertyName)),UpdateOp:$.updateOperator,"LineComment Hashbang":$.lineComment,BlockComment:$.blockComment,Number:$.number,String:$.string,Escape:$.escape,ArithOp:$.arithmeticOperator,LogicOp:$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,RegExp:$.regexp,Equals:$.definitionOperator,Arrow:$.function($.punctuation),": Spread":$.punctuation,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace,"InterpolationStart InterpolationEnd":$.special($.brace),".":$.derefOperator,", ;":$.separator,"@":$.meta,TypeName:$.typeName,TypeDefinition:$.definition($.typeName),"type enum interface implements namespace module declare":$.definitionKeyword,"abstract global Privacy readonly override":$.modifier,"is keyof unique infer asserts":$.operatorKeyword,JSXAttributeValue:$.attributeValue,JSXText:$.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":$.angleBracket,"JSXIdentifier JSXNameSpacedName":$.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":$.attributeName,"JSXBuiltin/JSXIdentifier":$.standard($.tagName)}),kP={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},AP={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},jP={__proto__:null,"<":193},MP=Vu.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:xP,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[OP],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[CP,wP,TP,DP,2,3,4,5,6,7,8,9,10,11,12,13,14,SP,new zu("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new zu(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>kP[e]||-1},{term:343,get:e=>AP[e]||-1},{term:95,get:e=>jP[e]||-1}],tokenPrec:15201}),NP=e({javascript:()=>$P}),PP=[Lu("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),Lu("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),Lu("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),Lu(`do {
15
+ \${}
16
+ } while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),Lu(`while (\${}) {
17
+ \${}
18
+ }`,{label:`while`,detail:`loop`,type:`keyword`}),Lu(`try {
19
+ \${}
20
+ } catch (\${error}) {
21
+ \${}
22
+ }`,{label:`try`,detail:`/ catch block`,type:`keyword`}),Lu(`if (\${}) {
23
+ \${}
24
+ }`,{label:`if`,detail:`block`,type:`keyword`}),Lu(`if (\${}) {
25
+ \${}
26
+ } else {
27
+ \${}
28
+ }`,{label:`if`,detail:`/ else block`,type:`keyword`}),Lu(`class \${name} {
29
+ constructor(\${params}) {
30
+ \${}
31
+ }
32
+ }`,{label:`class`,detail:`definition`,type:`keyword`}),Lu('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),Lu('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],FP=PP.concat([Lu(`interface \${name} {
33
+ \${}
34
+ }`,{label:`interface`,detail:`definition`,type:`keyword`}),Lu("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),Lu(`enum \${name} {
35
+ \${}
36
+ }`,{label:`enum`,detail:`definition`,type:`keyword`})]),IP=new mu,LP=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function RP(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var zP=[`FunctionDeclaration`],BP={FunctionDeclaration:RP(`function`),ClassDeclaration:RP(`class`),ClassExpression:()=>!0,EnumDeclaration:RP(`constant`),TypeAliasDeclaration:RP(`type`),NamespaceDeclaration:RP(`namespace`),VariableDefinition(e,t){e.matchContext(zP)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function VP(e,t){let n=IP.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(eu.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=BP[t.name];if(e&&e(t,a)||LP.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of VP(e,t.node))r.push(n);return!1}}),IP.set(t,r),r}var HP=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,UP=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function WP(e){let t=iu(e.state).resolveInner(e.pos,-1);if(UP.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&HP.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)LP.has(n.name)&&(r=r.concat(VP(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:HP}}var GP=Ou.define({name:`javascript`,parser:MP.configure({props:[su.add({IfStatement:_u({except:/^\s*({|else\b)/}),TryStatement:_u({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:vu,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Cu({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":_u({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Nu.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Pu,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),KP={test:e=>/^JSX/.test(e.name),facet:Tu({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},qP=GP.configure({dialect:`ts`},`typescript`),JP=GP.configure({dialect:`jsx`,props:[Ql.add(e=>e.isTop?[KP]:void 0)]}),YP=GP.configure({dialect:`jsx ts`,props:[Ql.add(e=>e.isTop?[KP]:void 0)]},`typescript`),XP=e=>({label:e,type:`keyword`}),ZP=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(XP),QP=ZP.concat([`declare`,`implements`,`private`,`protected`,`public`].map(XP));function $P(e={}){let t=e.jsx?e.typescript?YP:JP:e.typescript?qP:GP,n=e.typescript?FP.concat(QP):PP.concat(ZP);return new wu(t,[GP.data.of({autocomplete:Fu(UP,Iu(n))}),GP.data.of({autocomplete:WP}),e.jsx?rF:[]])}function eF(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function tF(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var nF=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),rF=ju.inputHandler.of((e,t,n,r,i)=>{if((nF?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!GP.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=iu(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=tF(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:Zl.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=eF(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=tF(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return!s.changes.empty&&(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),iF=e({html:()=>NF}),aF=[`_blank`,`_self`,`_top`,`_parent`],oF=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],sF=[`get`,`post`,`put`,`delete`],cF=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],lF=[`true`,`false`],uF={},dF={a:{attrs:{href:null,ping:null,type:null,media:null,target:aF,hreflang:null}},abbr:uF,address:uF,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:uF,aside:uF,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:uF,base:{attrs:{href:null,target:aF}},bdi:uF,bdo:uF,blockquote:{attrs:{cite:null}},body:uF,br:uF,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:cF,formmethod:sF,formnovalidate:[`novalidate`],formtarget:aF,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:uF,center:uF,cite:uF,code:uF,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:uF,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:uF,div:uF,dl:uF,dt:uF,em:uF,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:uF,figure:uF,footer:uF,form:{attrs:{action:null,name:null,"accept-charset":oF,autocomplete:[`on`,`off`],enctype:cF,method:sF,novalidate:[`novalidate`],target:aF}},h1:uF,h2:uF,h3:uF,h4:uF,h5:uF,h6:uF,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:uF,hgroup:uF,hr:uF,html:{attrs:{manifest:null}},i:uF,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:cF,formmethod:sF,formnovalidate:[`novalidate`],formtarget:aF,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:uF,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:uF,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:uF,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:oF,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:uF,noscript:uF,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:uF,param:{attrs:{name:null,value:null}},pre:uF,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:uF,rt:uF,ruby:uF,samp:uF,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:oF}},section:uF,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:uF,source:{attrs:{src:null,type:null,media:null}},span:uF,strong:uF,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:uF,summary:uF,sup:uF,table:uF,tbody:uF,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:uF,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:uF,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:uF,time:{attrs:{datetime:null}},title:uF,tr:uF,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:uF,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:uF},fF={accesskey:null,class:null,contenteditable:lF,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:lF,autocorrect:lF,autocapitalize:lF,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":lF,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":lF,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":lF,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":lF,"aria-hidden":lF,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":lF,"aria-multiselectable":lF,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":lF,"aria-relevant":null,"aria-required":lF,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},pF=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of pF)fF[e]=null;var mF=class{constructor(e,t){this.tags={...dF,...e},this.globalAttrs={...fF,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};mF.default=new mF;function hF(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function gF(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`){if(t)t=!1;else return e}return null}function _F(e,t,n){return n.tags[hF(e,gF(t))]?.children||n.allTags}function vF(e,t){let n=[];for(let r=gF(t);r&&!r.type.isTop;r=gF(r.parent)){let i=hF(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var yF=/^[:\-\.\w\u00b7-\uffff]*$/;function bF(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=gF(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:_F(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(vF(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function xF(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:vF(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:yF}}function SF(e,t,n,r){let i=[],a=0;for(let r of _F(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of vF(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function CF(e,t,n,r,i){let a=gF(n),o=a?t.tags[hF(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:yF}}function wF(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=gF(n),i=r?t.tags[hF(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function TF(e,t){let{state:n,pos:r}=t,i=iu(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?xF(n,i,i.from,r):bF(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?bF(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?xF(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?CF(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?wF(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?SF(n,e,i,r):null}function EF(e){return TF(mF.default,e)}function DF(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new mF(t,n):mF.default;return e=>TF(r,e)}var OF=GP.parser.configure({top:`SingleExpression`}),kF=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:qP.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:JP.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:YP.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:OF},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:GP.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:YN.parser}],AF=[{name:`style`,parser:YN.parser.configure({top:`Styles`})}].concat(pF.map(e=>({name:e,parser:GP.parser}))),jF=Ou.define({name:`html`,parser:KM.configure({props:[su.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),Nu.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Mu.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),MF=jF.configure({wrap:XM(kF,AF)});function NF(e={}){let t=``,n;e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=XM((e.nestedLanguages||[]).concat(kF),(e.nestedAttributes||[]).concat(AF)));let r=n?jF.configure({wrap:n,dialect:t}):t?MF.configure({dialect:t}):MF;return new wu(r,[MF.data.of({autocomplete:DF(e)}),e.autoCloseTags===!1?[]:FF,$P().support,XN().support])}var PF=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),FF=ju.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!MF.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=iu(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=hF(o.doc,t.parent,n))&&!PF.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=hF(o.doc,e,n))&&!PF.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:Zl.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return!s.changes.empty&&(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),IF=e({markdown:()=>oI}),LF=Tu({commentTokens:{block:{open:`<!--`,close:`-->`}}}),RF=new ru,zF=gj.configure({props:[Nu.add(e=>!e.is(`Block`)||e.is(`Document`)||BF(e)!=null||VF(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),RF.add(BF),su.add({Document:()=>null}),ou.add({Document:LF})]});function BF(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function VF(e){return e.name==`OrderedList`||e.name==`BulletList`}function HF(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=BF(e.type))!=null&&r<=t)break;n=e}return n.to}var UF=uu.of((e,t,n)=>{for(let r=iu(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(RF);if(e==null)continue;let t=HF(r,e);if(t>n)return{from:n,to:t}}return null});function WF(e){return new bu(LF,e,[],`markdown`)}var GF=WF(zF),KF=WF(zF.configure([Ij,zj,Rj,Bj,{props:[Nu.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function qF(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):gu.matchLanguageName(e,n,!0),t instanceof gu)return t.support?t.support.language.parser:Au.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var JF=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+XF(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function YF(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new JF(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new JF(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new JF(i.parent,s,s+t,a[1],e,n,i))}}return r}function XF(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function ZF(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=XF(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function QF(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Su)!=` `)return e;let r=fu(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var $F=((e={})=>({state:t,dispatch:n})=>{let r=iu(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!KF.isActiveAt(t,n.from,-1)&&!KF.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=YF(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&ZF(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&ZF(e.item,i,r),{range:Zl.cursor(t+n.length),changes:r}}{let e=nI(c,t,s);return{range:Zl.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&ZF(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?fu(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=QF(p,t),tI(l.node,t.doc)&&(p=nI(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:Zl.cursor(m+p.length+1),changes:d}});return!a&&(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function eI(e){return e.name==`QuoteMark`||e.name==`ListMark`}function tI(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function nI(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?fu(n.text,4,e[t+1].from)-r.length:null,t<i);return QF(r,t)}function rI(e,t){let n=e.resolveInner(t,-1),r=t;eI(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(eI(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var iI=[{key:`Enter`,run:$F},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=iu(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&KF.isActiveAt(e,t.from)){let t=a.lineAt(i),r=YF(rI(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:Zl.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(fu(t.text,4,n.to)-fu(t.text,4,n.from));return r==t.from&&(i=QF(i,e)),{range:Zl.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:Zl.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],aI=NF({matchClosingTags:!1});function oI(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=GF,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=aI}=e;if(!(i instanceof HA))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,UF],u;o&&l.push(dI),n instanceof wu?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?qF(t,u):void 0;c.push(vj({codeParser:d,htmlParser:s.language.parser})),r&&l.push(Jl.high(Eu.of(iI)));let f=WF(i.configure(c));return a&&l.push(f.data.of({autocomplete:sI})),new wu(f,l)}function sI(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=iu(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:lI(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var cI=null;function lI(){if(cI)return cI;let e=EF(new Ru(Xl.create({extensions:aI}),0,!0));return cI=e?e.options:[]}var uI=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,dI=ju.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!KF.isActiveAt(t.state,n.from,1)))return!1;let i=iu(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||uI.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),!a&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function fI(e,t,n){return{insert:`@launch:${e}`,label:t,kind:`launch_definition`,title:n??`@launch:${e}`}}function pI(e){return e.map(e=>e.type===`launch`?fI(e.id,e.label,e.title):cA(Gu(e)))}var mI={slash:uT,file:Bw,directory:Zu,launch:Qu,launch_definition:Qu,pull_request:ac,issue:Yu,skill:$u,tool:At,agent_profile:Ot,subagent:Ot},hI={plan:Vc,code:Xu,compact:Gl,abort:Xs,new:Mr};function gI(e){return e.command?hI[e.command]??uT:mI[e.kind]??Bw}function _I(e){return e.kind===`directory`?`text-info`:e.kind===`file`?`text-success`:`text-muted-foreground`}var vI=O(`<span class="inline-flex h-5 shrink-0 items-center gap-1 rounded-md bg-muted pr-0.5 pl-1.5 text-foreground"><!> <button type="button" tabindex="-1" class="inline-flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground" aria-label="Search all categories"><!></button></span>`),yI=O(`<button type="button" tabindex="-1" class="shrink-0 text-foreground hover:text-primary"> </button>`),bI=O(`<span><!> <span class="truncate"> </span> <!></span>`),xI=O(`<span class="min-w-0 truncate">Narrow: <span class="font-mono text-foreground">pr: skill: file:</span> …</span>`),SI=O(`<span class="truncate"><!> all categories</span>`),CI=O(`<span class="inline-flex items-center gap-1"><!></span>`),wI=O(`<div><!> <!> <span class="ml-auto flex shrink-0 items-center gap-2"><span class="inline-flex items-center gap-1"><!> </span> <!></span></div>`),TI=O(`<div class="flex-1" aria-hidden="true"></div>`),EI=O(`<span class="text-muted-foreground">Keep typing — a space ends the mention.</span>`),DI=O(`<div class="flex flex-col gap-0.5 px-2 py-3 text-ui"><span class="text-foreground"> </span> <!></div>`),OI=O(`<span class="inline-flex items-center gap-1"><!> Updating</span>`),kI=O(`<button type="button" tabindex="-1" class="rounded-sm px-1 hover:text-foreground"> </button>`),AI=O(`<span class="min-w-0 truncate text-left font-mono text-muted-foreground [direction:rtl]"><bdi dir="ltr"> </bdi></span>`),jI=O(`<span class="shrink-0 font-mono"> </span> <!>`,1),MI=O(`<span class="min-w-0 truncate text-muted-foreground"> </span>`),NI=O(`<span class="max-w-[60%] shrink-0 truncate"> </span> <!>`,1),PI=O(`<!><span class="text-muted-foreground">Current</span>`,1),FI=O(`<button type="button" tabindex="-1" class="inline-flex h-5 items-center rounded-sm px-1 text-muted-foreground hover:bg-hover hover:text-foreground"> <!></button>`),II=O(`<div role="option" tabindex="-1"><!> <!> <span class="ml-auto flex shrink-0 items-center gap-1 pl-2"><!> <!></span></div>`),LI=O(`<div class="flex flex-col"><div class="sticky top-0 z-10 flex h-6 shrink-0 items-center justify-between bg-popover px-2 text-ui text-muted-foreground"><span> </span> <!></div> <!></div>`),RI=O(`<div class="pointer-events-auto fixed z-50 flex flex-col overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-overlay" data-composer-suggestions=""><!> <div role="listbox" aria-label="Suggestions" class="flex max-h-[18rem] scroll-pt-7 scroll-pb-1 flex-col overflow-y-auto px-1 pb-1"><!> <!> <!></div> <!></div>`);function zI(e,n){c(n,!0);let r=e=>{var r=wI(),a=q(r),o=e=>{var t=vI(),r=q(t);Tw(r,{class:`size-3 text-muted-foreground`});var i=G(r),a=G(i),o=q(a);ye(o,{class:`size-3`}),x(a),x(t),F(()=>w(i,`${n.model.scope.label??``} `)),h(`mousedown`,a,e=>{e.preventDefault(),n.onclearscope()}),k(e,t)};l(a,e=>{n.model.scope&&e(o)});var s=G(a,2),c=e=>{let r=L(()=>n.model.footer),i=L(()=>t(r).icon&&t(r).icon!==`spinner`?d[t(r).icon]:void 0);var a=bI(),o=q(a),s=e=>{dn(e,{class:`size-3 shrink-0`})},c=e=>{var n=f(),r=R(n);H(r,()=>t(i),(e,t)=>{t(e,{class:`size-3.5 shrink-0`})}),k(e,n)};l(o,e=>{t(r).icon===`spinner`?e(s):t(i)&&e(c,1)});var u=G(o,2),m=z(u,!0),g=G(u,2),_=e=>{var i=yI(),a=z(i,!0);F(()=>w(a,t(r).action.label)),h(`mousedown`,i,e=>{e.preventDefault(),n.onfooteraction()}),k(e,i)};l(g,e=>{t(r).action&&e(_)}),x(a),F(()=>{X(a,1,`flex min-w-0 items-center gap-1.5 ${p[t(r).tone]??``}`),w(m,t(r).text)}),k(e,a)},u=e=>{var t=xI();k(e,t)},m=e=>{var t=SI(),n=q(t);Ju(n,{children:(e,t)=>{y();var n=g(`⌫`);k(e,n)},$$slots:{default:!0}}),y(),x(t),k(e,t)};l(s,e=>{n.model.footer?e(c):n.model.showScopeHint?e(u,1):n.model.scope&&!n.model.query&&e(m,2)});var _=G(s,2),v=q(_),b=q(v);Ju(b,{children:(e,t)=>{y();var n=g(`↵`);k(e,n)},$$slots:{default:!0}});var S=G(b,1,!0);x(v);var C=G(v,2),T=e=>{var t=CI(),n=q(t);Ju(n,{children:(e,t)=>{y();var n=g(`esc`);k(e,n)},$$slots:{default:!0}}),x(t),k(e,t)};l(C,e=>{n.model.footer||e(T)}),x(_),x(r),F(()=>{X(r,1,`flex h-7 shrink-0 items-center gap-2 bg-panel px-2 text-ui text-muted-foreground ${t(i)?`border-b`:`border-t`} border-border`),w(S,n.model.primary)}),k(e,r)},i=L(()=>n.model.placement===`above`),a=L(()=>t(i)?[...n.model.groups].reverse().map(e=>({...e,rows:[...e.rows].reverse()})):n.model.groups),o=Y(U({left:0,edge:0,width:448}));function s(){if(!n.anchor)return;let e=n.anchor.closest(`[data-composer-popup-anchor], [data-tour-id='composer']`)??n.anchor,r=e.getBoundingClientRect(),a=getComputedStyle(e),s=r.left+(parseFloat(a.paddingLeft)||0),c=r.right-(parseFloat(a.paddingRight)||0),l=Math.max(0,Math.min(448,c-s,window.innerWidth-16));B(o,{left:Math.max(8,Math.min(s,window.innerWidth-l-8)),edge:t(i)?window.innerHeight-r.top+6:r.bottom+6,width:l},!0)}W(()=>(n.model.placement,s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}));let u=Y(void 0);W(()=>{n.model.selectedId,t(u)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})}),W(()=>{t(i)&&t(u)&&(t(u).scrollTop=t(u).scrollHeight)});let d={info:Un,warning:bn,offline:hw,error:Qs},p={muted:`text-muted-foreground`,info:`text-info`,warning:`text-warning`,destructive:`text-destructive`},m=L(()=>n.model.selectedId);var _=RI();let b;var S=q(_),C=e=>{r(e)};l(S,e=>{t(i)&&e(C)});var E=G(S,2);J(E,`id`,`composer-suggestions`);var O=q(E),A=e=>{var t=TI();k(e,t)};l(O,e=>{t(i)&&e(A)});var j=G(O,2),M=e=>{var t=DI(),r=q(t),i=z(r,!0),a=G(r,2),o=e=>{var t=EI();k(e,t)};l(a,e=>{n.model.mode===`mention`&&e(o)}),x(t),F(()=>w(i,n.model.empty)),k(e,t)};l(j,e=>{n.model.empty&&e(M)});var N=G(j,2);v(N,17,()=>t(a),e=>e.id,(e,r)=>{var i=LI(),a=q(i),o=q(a),s=z(o,!0),c=G(o,2),u=e=>{var t=OI(),n=q(t);dn(n,{class:`size-3`}),y(),x(t),k(e,t)},d=e=>{var i=kI(),a=z(i);F(()=>w(a,`+${t(r).more??``} more`)),h(`mousedown`,i,e=>{e.preventDefault(),n.onscope(t(r).scope)}),k(e,i)};l(c,e=>{t(r).loading?e(u):t(r).more&&t(r).scope&&!n.model.scope&&e(d,1)}),x(a);var f=G(a,2);v(f,17,()=>t(r).rows,e=>e.id,(e,r)=>{let i=L(()=>gI(t(r))),a=L(()=>t(r).id===t(m));var o=II(),s=q(o);{let e=L(()=>_I(t(r)));H(s,()=>t(i),(n,r)=>{r(n,{get class(){return`size-3.5 shrink-0 ${t(e)??``}`}})})}var c=G(s,2),u=e=>{var n=jI(),i=R(n),a=z(i,!0),o=G(i,2),s=e=>{var n=AI(),i=q(n),a=z(i,!0);x(n),F(()=>{w(a,t(r).dir),i.dir=i.dir}),k(e,n)};l(o,e=>{t(r).dir&&e(s)}),F(()=>w(a,t(r).name)),k(e,n)},d=e=>{var n=NI(),i=R(n),a=z(i,!0),o=G(i,2),s=e=>{var n=MI(),i=z(n,!0);F(()=>w(i,t(r).meta)),k(e,n)};l(o,e=>{t(r).meta&&e(s)}),F(()=>w(a,t(r).name)),k(e,n)};l(c,e=>{t(r).mono?e(u):e(d,-1)});var f=G(c,2),p=q(f),_=e=>{dn(e,{class:`size-3.5`})},v=e=>{var t=PI(),n=R(t);ic(n,{class:`size-3.5 text-muted-foreground`}),y(),k(e,t)},b=e=>{be(e,{get variant(){return t(r).badge.variant},children:(e,n)=>{y();var i=g();F(()=>w(i,t(r).badge.text)),k(e,i)},$$slots:{default:!0}})};l(p,e=>{n.model.pendingId===t(r).id?e(_):t(r).current?e(v,1):t(r).badge&&e(b,2)});var S=G(p,2),C=e=>{var i=FI(),a=q(i,!0),o=G(a);Ju(o,{class:`ml-1`,children:(e,t)=>{y();var n=g(`⌥↵`);k(e,n)},$$slots:{default:!0}}),x(i),F(()=>w(a,n.model.toggleLabel)),h(`mousedown`,i,e=>{e.preventDefault(),e.stopPropagation(),n.ontoggle(t(r).id)}),k(e,i)};l(S,e=>{t(a)&&n.model.toggleLabel&&n.model.pendingId!==t(r).id&&e(C)}),x(f),x(o),F(e=>{J(o,`aria-selected`,t(a)),J(o,`aria-disabled`,t(r).state===`unavailable`),J(o,`title`,t(r).title),X(o,1,e)},[()=>T(Wc({selected:t(a)}).base({class:[`flex h-control w-full min-w-0 shrink-0 cursor-default items-center gap-2 px-2 text-left`,t(a)&&`text-foreground`,t(r).state===`unavailable`&&`opacity-60`]}))]),h(`mousemove`,o,()=>n.onhover(t(r).id)),h(`mousedown`,o,e=>{e.preventDefault(),n.onpick(t(r).id)}),k(e,o)}),x(i),F(()=>w(s,t(r).label)),k(e,i)}),x(E),te(E,e=>B(u,e),()=>t(u));var P=G(E,2),ee=e=>{r(e)};l(P,e=>{t(i)||e(ee)}),x(_),F(()=>b=I(_,``,b,{left:`${t(o).left??``}px`,width:`${t(o).width??``}px`,bottom:t(i)?`${t(o).edge}px`:void 0,top:t(i)?void 0:`${t(o).edge}px`})),k(e,_),D()}ue([`mousedown`,`mousemove`]);function BI(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;let i=0;for(;i<n-r&&e[e.length-1-i]===t[t.length-1-i];)i+=1;let a=t.slice(r,t.length-i);return{from:r,to:e.length-i,insert:a,caret:r+a.length}}var VI=/^ {0,3}(`{3,}|~{3,})/,HI=/^( {0,3}>[ \t]?)+/;function UI(e){let t=[],n;return e.split(`
37
+ `).forEach((e,r)=>{let i=e.match(VI)?.[1];if(i){n?i[0]===n[0]&&i.length>=n.length&&(n=void 0):n=i;return}if(n)return;let a=e.match(HI)?.[0];a&&t.push({line:r+1,markerLength:a.length})}),t}var WI=ql.line({class:`cm-quote-block-line`}),GI=ql.replace({});function KI(e){let t=[],n=[];for(let r of UI(e.doc.toString())){let i=e.doc.line(r.line);t.push(WI.range(i.from)),n.push(GI.range(i.from,i.from+r.markerLength))}return{lines:ql.set(t),markers:ql.set(n)}}var qI=ku.fromClass(class{decorations;constructor(e){this.decorations=KI(e.state)}update(e){e.docChanged&&(this.decorations=KI(e.state))}},{provide:e=>[ju.decorations.of(t=>t.plugin(e)?.decorations.lines??ql.none),ju.decorations.of(t=>t.plugin(e)?.decorations.markers??ql.none),ju.atomicRanges.of(t=>t.plugin(e)?.decorations.markers??ql.none)]}),JI=[`plan`,`profile`,`compact`,`abort`,`new`];function YI(e,t){return e.flatMap(e=>e.label===`/profile <name>`?t.map(e=>({kind:`slash`,label:`/profile ${e.name}`,detail:`Switch to ${e.label}`,info:e.description})):[e])}function XI(e){let t=/^\/([a-z]+)(?:\s+(\S+))?$/.exec(e.trim()),n=t?.[1];if(n===`profile`){let e=aa.safeParse(t?.[2]);return e.success?{name:n,profile:e.data}:void 0}if(!t?.[2]&&JI.some(e=>e===n))return{name:n}}var ZI=[{id:`file`,prefix:`file:`,label:`Files`},{id:`pr`,prefix:`pr:`,label:`Pull requests`},{id:`issue`,prefix:`issue:`,label:`Issues`},{id:`skill`,prefix:`skill:`,label:`Skills`},{id:`tool`,prefix:`tool:`,label:`Tools`},{id:`agent`,prefix:`agent:`,label:`Agents`},{id:`launch`,prefix:`launch:`,label:`Launches`}],QI=`recent`,$I=new Map(ZI.map(e=>[e.id,e])),eL=e=>e?$I.get(e):void 0,tL={profile:`agent`};function nL(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t).toLowerCase(),r=tL[n]??($I.has(n)?n:void 0);if(r)return{scope:r,query:e.slice(t+1)}}return{query:e}}function rL(e){switch(e){case`file`:case`directory`:return`file`;case`pull_request`:return`pr`;case`issue`:return`issue`;case`skill`:return`skill`;case`tool`:return`tool`;case`subagent`:case`agent_profile`:return`agent`;case`launch`:case`launch_definition`:return`launch`;default:return}}var iL={files:`file`,pull_requests:`pr`,issues:`issue`,skills:`skill`,tools:`tool`,agents:`agent`,launches:`launch`},aL={open_pull_requests:`Open pull requests`,open_settings:`Settings`},oL={plan:`Profile`,compact:`Conversation`,new:`Conversation`,abort:`Run`},sL=[`Profile`,`Conversation`,`Run`,`Commands`];function cL(e){return e.replace(/^@/,``).replace(/^[a-z]+:/i,``)}var lL=new Set([`skill`,`tool`,`agent_profile`]),uL={open:`success`,merged:`info`,draft:`neutral`,closed:`neutral`,running:`success`,exited:`neutral`,failed:`destructive`,queued:`neutral`,waiting:`neutral`,stopping:`warning`};function dL(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function fL(e){return e.available===!1?`unavailable`:e.enabled===!1?`off`:`ready`}function pL(e){return!e.documentId||!e.version||!lL.has(e.kind)||e.available===!1?!1:e.enabled===!1||e.canDisable===!0}function mL(e){let t=fL(e),n=e.apply??e.label,r=e.kind===`file`||e.kind===`directory`,i,a;if(r){let t=(e.info??cL(e.label)).replace(/^@/,``),n=e.kind===`directory`,r=n?t.replace(/\/+$/,``):t,o=r.lastIndexOf(`/`)+1;i=r.slice(o)+(n?`/`:``),a=r.slice(0,o)||void 0}else i=e.displayLabel??cL(e.label);let o;t===`unavailable`?o={text:`Unavailable`,variant:`neutral`}:t===`off`?o={text:`Off`,variant:`neutral`}:e.status&&(o={text:dL(e.status),variant:uL[e.status.toLowerCase()]??`neutral`});let s=rL(e.kind);return{id:e.documentId??`${e.kind}:${e.label}`,item:e,kind:e.kind,groupId:s??`other`,name:i,dir:a,meta:r?void 0:e.detail,state:t,badge:o,toggleable:pL(e),reason:e.unavailableReason,title:e.info,insert:n,chipLabel:i,mono:r}}function hL(e){return[...e.filter(e=>e.state!==`unavailable`),...e.filter(e=>e.state===`unavailable`)]}function gL(e){let t=e.items.map(mL);if(e.scope){let n=eL(e.scope),r=hL(t.filter(t=>t.groupId===e.scope||t.groupId===`other`)).slice(0,12),i=e.loadingGroups?.has(n.id);return r.length===0&&!i?[]:[{id:n.id,label:n.label,rows:r,loading:!!i}]}if(e.recent)return t.length===0?[]:[{id:QI,label:`Recent`,rows:hL(t).slice(0,8),loading:!!e.loadingGroups?.size}];let n=[],r=new Map;for(let e of t)r.has(e.groupId)||(r.set(e.groupId,[]),n.push(e.groupId)),r.get(e.groupId).push(e);return n.map(t=>{let n=hL(r.get(t)),i=eL(t),a=n.slice(0,3),o=e.totals?.find(e=>iL[e.group]===t),s=n.length-a.length+(o?.more??0);return{id:t,label:i?.label??`More`,rows:a,more:s>0&&i?s:void 0,scope:i?.id,loading:!!e.loadingGroups?.has(t)}})}var _L=`Waiting for your review. Trust it before you switch to it.`;function vL(e,t,n){let r=t.replace(/^\//,``).toLowerCase(),i=new Map,a=new Set((n?.pendingProfiles??[]).map(e=>`profile ${e.name}`));for(let t of YI(e,[...n?.profiles??[],...n?.pendingProfiles??[]])){let e=t.label.replace(/^\//,``);if(e===`abort`&&!n?.running||r&&!e.toLowerCase().includes(r))continue;let o=e.startsWith(`profile `)?`Profile`:oL[e]??`Commands`,s=e.startsWith(`profile `)?e===`profile ${n?.profile}`:e===`plan`&&n?.profile===`planning`,c={id:`slash:${e}`,item:t,kind:`slash`,groupId:o,name:e,meta:t.detail,title:t.info,state:a.has(e)?`unavailable`:`ready`,...a.has(e)?{badge:{text:`Needs review`,variant:`warning`},reason:_L,reviewProfile:e.slice(8)}:{},toggleable:!1,insert:t.label,chipLabel:e,command:e,current:s,mono:!1};i.set(o,[...i.get(o)??[],c])}for(let e of i.values())e.sort((e,t)=>Number(!e.command.startsWith(r))-Number(!t.command.startsWith(r)));return sL.filter(e=>i.has(e)).map(e=>({id:e,label:e,rows:i.get(e)}))}var yL=e=>e.flatMap(e=>e.rows);function bL(e){let t=yL(e);return t.find(e=>e.state!==`unavailable`)??t[0]}function xL(e){return(e.groups??[]).map(e=>iL[e])}function SL(e){if(e.label)return e.label;let t=e.source.replace(/[-_.:]+/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function CL(e){let t=new Set;for(let n of e)if(n.status===`loading`||n.refreshing)for(let e of xL(n))t.add(e);return t}function wL(e){let t=e.find(e=>e.status===`unavailable`);if(!t)return;let n=t.action?{label:aL[t.action],id:t.action}:void 0;return{source:t,footer:{tone:`warning`,icon:`offline`,text:t.reason??`${SL(t)} isn’t available.`,action:n}}}var TL=cu.define({map(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return r>n?{...e,from:n,to:r}:void 0}}),EL=/\.(png|jpe?g|gif|webp|svg|bmp|avif|heic)$/i,DL=/\.[A-Za-z][A-Za-z0-9]{0,7}$/,OL=/^https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/(pull|issues)\/(\d+)\/?$/,kL=/^(skill|tool|agent|launch):([\w][\w.:/-]*)$/,AL=/^(pr|issue):(\d+)$/,jL=/^[\w.~+/-]+$/;function ML(e){let t=kL.exec(e);if(t)return{kind:{skill:`skill`,tool:`tool`,agent:`agent_profile`,launch:`launch_definition`}[t[1]],label:t[2]};let n=AL.exec(e);if(n)return{kind:n[1]===`pr`?`pull_request`:`issue`,label:`#${n[2]}`};let r=OL.exec(e);if(r)return{kind:r[1]===`pull`?`pull_request`:`issue`,label:`#${r[2]}`};if(!jL.test(e)||e.includes(`//`))return;let i=e.endsWith(`/`),a=e.split(`/`).filter(Boolean).at(-1);if(a&&a!==`.`&&a!==`..`){if(i)return{kind:`directory`,label:a};if((e.includes(`/`)||DL.test(a))&&/[A-Za-z0-9]/.test(a))return{kind:EL.test(a)?`image`:`file`,label:a}}}function NL(e){let t=[],n=/(?<![^\s])@(\S+)/g;for(let r=n.exec(e);r;r=n.exec(e)){let e=r[1].replace(/[.,;:!?)\]}'"]+$/,``);if(!e)continue;let n=ML(e);if(!n)continue;let i=r.index;t.push({from:i,to:i+1+e.length,...n,title:e})}return t}var PL=`http://www.w3.org/2000/svg`,FL={file:[`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,`M14 2v5a1 1 0 0 0 1 1h5`],folder:[`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`],image:[`M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,`M9 7a2 2 0 1 0 0 4 2 2 0 0 0 0-4`,`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`],launch:[`M4 17l6-6-6-6`,`M12 19h8`],skill:[`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`],tool:[`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`],agent:[`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,`M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8`,`M16 3.128a4 4 0 0 1 0 7.744`,`M22 21v-2a4 4 0 0 0-3-3.87`],issue:[`M12 8v4`,`M12 16h.01`,`M22 12a10 10 0 1 0-20 0 10 10 0 0 0 20 0`],pullRequest:[`M18 15v-3a4 4 0 0 0-4-4h-4`,`M14 5l-3 3 3 3`,`M6 3v12`,`M3 18a3 3 0 1 0 6 0 3 3 0 0 0-6 0`],command:[`m4 17 6-6-6-6`,`m12 19 8 0`]};function IL(e){switch(e){case`file`:return`file`;case`directory`:return`folder`;case`image`:return`image`;case`pull_request`:return`pullRequest`;case`issue`:return`issue`;case`skill`:return`skill`;case`tool`:return`tool`;case`subagent`:case`agent_profile`:return`agent`;case`launch`:case`launch_definition`:return`launch`;default:return`command`}}function LL(e){return e===`file`?`cm-mention-chip-file`:e===`directory`||e===`image`?`cm-mention-chip-info`:``}function RL(e){let t=document.createElementNS(PL,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,`currentColor`),t.setAttribute(`stroke-width`,`2`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`stroke-linejoin`,`round`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`class`,`cm-mention-chip-icon`);for(let n of FL[e]){let e=document.createElementNS(PL,`path`);e.setAttribute(`d`,n),t.appendChild(e)}return t}var zL=class extends xu{kind;label;title;constructor(e,t,n){super(),this.kind=e,this.label=t,this.title=n}eq(e){return e.kind===this.kind&&e.label===this.label&&e.title===this.title}toDOM(){let e=document.createElement(`span`);e.className=`cm-mention-chip ${LL(this.kind)}`.trim(),e.dataset.kind=this.kind,this.title&&(e.title=this.title);let t=document.createElement(`span`);return t.className=`cm-mention-chip-label`,t.textContent=this.label,e.append(RL(IL(this.kind)),t),e}};function BL(e){let t=e.map(e=>ql.replace({widget:new zL(e.kind,e.label,e.title)}).range(e.from,e.to));return ql.set(t,!0)}function VL(e){return{chips:e,decorations:BL(e)}}function HL(e){let t=[];return e.changes.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),t}function UL(e,t,n){return!t.some(({fromA:t,toA:r,fromB:i,toB:a})=>{if(t<e.to&&r>e.from||t===r&&t>e.from&&t<e.to)return!0;let o=n.newDoc.sliceString(i,a);return o?t===e.to&&!/^\s/.test(o)||r===e.from&&!/\s$/.test(o):!1})}var WL=e=>/\s/.test(e);function GL(e,t){if(!(e.isUserEvent(`input.paste`)||e.isUserEvent(`input.drop`)||e.annotation(au.userEvent)===void 0))return[];let n=e.newDoc,r=[];for(let e of t){if(e.toB<=e.fromB)continue;let t=e.fromB;for(;t>0&&!WL(n.sliceString(t-1,t));)t--;let i=e.toB;for(;i<n.length&&!WL(n.sliceString(i,i+1));)i++;for(let e of NL(n.sliceString(t,i)))r.push({...e,from:e.from+t,to:e.to+t})}return r}function KL(e,t){return[...e.filter(e=>e.to<=t.from||e.from>=t.to),t].sort((e,t)=>e.from-t.from)}var qL=$l.define({create:e=>VL(NL(e.doc.toString())),update(e,t){let n=e.chips,r=!1;if(t.docChanged){let e=HL(t);if(n.length>0&&(n=n.filter(n=>UL(n,e,t)).map(e=>({...e,from:t.changes.mapPos(e.from,1),to:t.changes.mapPos(e.to,-1)})),r=!0),!t.effects.some(e=>e.is(TL)))for(let i of GL(t,e))n=KL(n,i),r=!0}for(let e of t.effects){if(!e.is(TL))continue;let i=e.value;i.from>=i.to||i.to>t.newDoc.length||i.from<0||(n=KL(n,i),r=!0)}return r?VL(n):e},provide:e=>[Ul.of(t=>{if(!t.docChanged)return[];let n=t.startState.field(e,!1)?.chips??[];if(n.length===0)return[];let r=HL(t);return n.filter(e=>!UL(e,r,t)).map(e=>TL.of(e))}),ju.decorations.from(e,e=>e.decorations),ju.atomicRanges.of(t=>t.state.field(e).decorations)]});function JL(e){return e.field(qL,!1)?.chips??[]}function YL(){return qL}var XL=e=>e===``||/\s/.test(e);function ZL(e,t,n){let r=n?.from??e.selection.main.from,i=n?.to??e.selection.main.to,a=t.filter(e=>e.insert.length>0);if(a.length===0)return{};let o=r>0?e.sliceDoc(r-1,r):``,s=i<e.doc.length?e.sliceDoc(i,i+1):``,c=XL(o)?``:` `,l=[];for(let[e,t]of a.entries()){let n=r+c.length;c+=t.insert,l.push({from:n,to:n+t.insert.length,kind:t.kind,label:t.label,title:t.title}),e<a.length-1&&(c+=` `)}let u=s===` `||s===` `;u||(c+=` `);let d=r+c.length+ +!!u;return{changes:{from:r,to:i,insert:c},selection:{anchor:d},effects:l.map(e=>TL.of(e)),userEvent:`input.complete`,scrollIntoView:!0}}function QL(e){if(e.query!==``)return`No matches for “${e.query}”`;let t=eL(e.scope);return t?`No ${t.label.toLowerCase()} to show`:`Nothing to suggest yet`}var $L=60,eR=180,tR=240,nR=new WeakMap,rR=e=>nR.get(e)??0;function iR(e){nR.set(e,rR(e)+1)}function aR(e,t){let n=e.selection.main;if(!n.empty)return;let r=n.head,i=e.doc.lineAt(r),a=i.text.slice(0,r-i.from);if(t&&i.number===1&&/^\/[\w-]*$/.test(a))return{kind:`slash`,from:0,to:r,raw:a,scopeLength:0,query:a.slice(1)};let o=/(?:^|\s)(@[^\s@]*)$/.exec(a);if(!o)return;let s=o[1],c=r-s.length;if(JL(e).some(e=>e.from===c))return;let l=nL(s.slice(1));return{kind:`mention`,from:c,to:r,raw:s,scope:l.scope,scopeLength:l.scope?s.length-1-l.query.length:0,query:l.query}}var oR=[`input`,`delete`,`undo`,`redo`],sR=e=>e.transactions.some(e=>oR.some(t=>e.isUserEvent(t)));function cR(e){let t=e;return t?.code===`CONFLICT`||t?.data?.code===`CONFLICT`}var lR=class{view;options;token;tokenKey=``;results;loading=!1;visible=!1;selectedId;dismissedFrom;placement=`above`;notice;noticeItem;pending;seq=0;searchTimer;showTimer;groups=[];destroyed=!1;constructor(e,t){this.view=e,this.options=t}get isOpen(){return!!this.token&&this.visible}get active(){return!!this.token}get rows(){return yL(this.groups)}get selected(){return this.rows.find(e=>e.id===this.selectedId)}slashEnabled(){return!!this.options.slashCommand?.()}onUpdate(e){if(this.destroyed)return;e.docChanged&&this.dismissedFrom!==void 0&&(this.dismissedFrom=e.changes.mapPos(this.dismissedFrom,-1));let t=e.docChanged&&sR(e);(this.active||t)&&(e.docChanged||e.selectionSet)&&this.sync(e.state)}sync(e){let t=aR(e,this.slashEnabled());if(!t){this.dismissedFrom=void 0,this.close();return}if(this.dismissedFrom!==void 0){if(t.from===this.dismissedFrom)return;this.dismissedFrom=void 0}let n=!this.token;this.token=t,n&&(this.placement=this.choosePlacement(),this.selectedId=void 0,this.results=void 0,this.visible=!1);let r=`${t.kind}:${t.from}:${t.raw}`;r===this.tokenKey&&!n?this.publish():(this.tokenKey=r,this.notice=void 0,this.noticeItem=void 0,t.kind===`slash`?(this.seq++,this.loading=!1,this.visible=!0,this.selectedId=void 0,this.recompute()):(this.selectedId=void 0,this.scheduleSearch(t,!1),this.recompute()))}choosePlacement(){let e=this.view.dom;if(!e||typeof window>`u`)return`above`;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom;return t.top>=tR||t.top>=n?`above`:`below`}scheduleSearch(e,t){clearTimeout(this.searchTimer),this.loading=!0;let n=this.options.searchDelayMs??$L;!this.visible&&!this.showTimer&&(this.showTimer=setTimeout(()=>{this.showTimer=void 0,this.token&&!this.destroyed&&(this.visible=!0,this.recompute())},eR));let r=()=>void this.search(e,t);n<=0?r():this.searchTimer=setTimeout(r,n)}async fetchMention(e,t){let n=e.scope?12:e.query===``?8:21;return t?await t.search(e.raw.slice(1),{limit:n}):{items:[],sources:[]}}async search(e,t){let n=++this.seq,r=rR(this.options),i=this.options.referenceSource?.();this.loading=!0;try{let a=await this.fetchMention(e,i);if(this.stale(n,r,i))return;this.results=a,this.loading=!1,this.visible=!0,clearTimeout(this.showTimer),this.showTimer=void 0,t||(this.selectedId=void 0),this.recompute()}catch(e){if(this.stale(n,r,i))return;this.loading=!1,this.visible=!0,this.notice={tone:`destructive`,icon:`error`,text:e instanceof Error?e.message:`Search failed.`},this.recompute()}}stale(e,t,n){return this.destroyed||!this.token||e!==this.seq||t!==rR(this.options)||n!==this.options.referenceSource?.()}refresh(){this.token&&!this.pending&&(this.token.kind===`slash`?this.recompute():this.search(this.token,!0))}recompute(){let e=this.token;if(!e)return;let t=CL(this.results?.sources??[]);if(e.kind===`slash`)this.groups=vL(this.options.slashCompletions(),e.raw,this.options.slashContext?.());else{let n=this.options.referenceSource?.();if(this.groups=gL({items:this.results?.items??[],scope:e.scope,recent:!e.scope&&e.query===``&&!!n,totals:this.results?.groups,loadingGroups:t}),this.groups.length===0&&e.scope&&this.loading){let t=eL(e.scope);this.groups=[{id:t.id,label:t.label,rows:[],loading:!0}]}}this.rows.some(e=>e.id===this.selectedId)||(this.selectedId=bL(this.groups)?.id),this.publish()}footer(e){let t=this.token,n=this.options.action?.();if(this.notice)return this.notice;if(e?.state===`unavailable`)return{tone:`warning`,icon:`warning`,text:e.reason??`${e.name} isn’t available right now.`,action:n?e.reviewProfile?{label:`Review`,id:`review`}:{label:`Settings`,id:`item`}:void 0};if(e?.state===`off`)return{tone:`info`,icon:`info`,text:`Also turns it on for this project`};let r=wL(this.results?.sources??[]);if(r)return{...r.footer,action:n?r.footer.action:void 0};if(t.kind===`slash`)return{tone:`muted`,text:`Runs now — nothing is sent to the agent`};if(this.rows.length===0&&this.loading)return{tone:`muted`,icon:`spinner`,text:`Searching`}}emptyText(){let e=this.token;if(!(this.rows.length>0||this.groups.some(e=>e.loading))){if(e.kind===`slash`)return`No commands match “${e.raw}”`;if(!this.loading||this.results)return QL(e)}}publish(){let e=this.token;if(!e||!this.visible){this.options.onModel?.(null);return}let t=this.selected,n=e.scope?eL(e.scope):void 0,r={mode:e.kind,placement:this.placement,groups:this.groups,selectedId:this.selectedId,scope:n?{id:n.id,label:n.label}:void 0,query:e.kind===`slash`?e.raw:e.query,showScopeHint:e.kind===`mention`&&!e.scope&&e.query===``,footer:this.footer(t),primary:e.kind===`slash`?`Run`:t?.state===`off`?`Enable & insert`:t?.state===`unavailable`?`Details`:`Insert`,pendingId:this.pending?.id,empty:this.emptyText(),toggleLabel:t?.toggleable?t.state===`off`?`Turn on`:`Turn off`:void 0};this.options.onModel?.(r)}select(e){this.selectedId!==e&&this.rows.some(t=>t.id===e)&&(this.selectedId=e,this.notice=void 0,this.publish())}move(e){let t=this.rows;if(!this.isOpen||t.length===0)return!1;let n=(Math.max(0,t.findIndex(e=>e.id===this.selectedId))+((this.placement===`above`?e===`up`:e===`down`)?1:-1)+t.length)%t.length;return this.select(t[n].id),!0}accept(e){if(!this.isOpen)return!1;e&&this.select(e);let t=this.selected;if(!t)return!1;if(this.pending)return!0;if(this.token.kind===`slash`)return t.reviewProfile?(this.notice=void 0,this.notice=this.footer(t),this.publish(),!0):this.runSlash(t);if(t.state===`unavailable`){let e=this.options.action?.();return this.notice={tone:`warning`,icon:`warning`,text:t.reason??`${t.name} isn’t available right now.`,action:e?{label:`Settings`,id:`item`}:void 0},this.noticeItem=t.item,this.publish(),!0}let n=this.options.referenceSource?.();return n&&t.item.documentId&&t.item.version?this.runSelectAction(t,n,`select`,`insert`):this.insert(t,this.token,this.view.state.doc),!0}toggle(e){if(!this.isOpen)return!1;e&&this.select(e);let t=this.selected,n=this.options.referenceSource?.();return!t?.toggleable||!n?!!t:(this.pending||this.runSelectAction(t,n,t.state===`off`?`select`:`disable`,`stay`),!0)}async runSelectAction(e,t,n,r){let i=this.token,a=this.view.state.doc,o=rR(this.options);this.pending={id:e.id,source:t,doc:a},this.notice=void 0,this.publish();let s=()=>!this.destroyed&&o===rR(this.options)&&this.pending?.doc===a&&this.view.state.doc===a&&t===this.options.referenceSource?.();try{let o=await t.select(e.item,n);if(!s())return;if(this.pending=void 0,r===`stay`){this.selectedId=e.id,this.search(i,!0);return}this.insert({...e,insert:o.apply??o.label,item:o},i,a)}catch(t){if(!s()){this.pending?.doc===a&&(this.pending=void 0);return}this.pending=void 0;let n=t instanceof Error?t.message:``;cR(t)?(this.notice={tone:`warning`,icon:`warning`,text:`“${e.name}” changed while you were choosing. Refreshed — press Enter to retry.`},this.selectedId=e.id,this.search(i,!0)):(this.notice={tone:`destructive`,icon:`error`,text:n},this.publish())}}insert(e,t,n){if(this.view.state.doc!==n)return;let r=e.insert;this.dismissedFrom=void 0,this.close(),this.view.dispatch(ZL(this.view.state,[{insert:r,label:e.chipLabel,kind:e.kind,title:e.item.info??r}],{from:t.from,to:t.to}))}runSlash(e){let t=this.options.slashCommand?.();return!t||!e.command?!1:(this.close(),this.view.dispatch({changes:{from:0,to:this.view.state.doc.length},userEvent:`delete`}),t(e.command),!0)}runFooterAction(){let e=this.options.action?.();if(!e)return;let t=this.selected?.reviewProfile;if(t){this.close(),e({type:`review-profile`,name:t});return}if(this.noticeItem||this.selected?.state===`unavailable`){e({type:`item`,item:this.noticeItem??this.selected.item});return}let n=wL(this.results?.sources??[]);n?.footer.action&&e({type:`source`,source:n.source,actionId:n.footer.action.id})}setScope(e){let t=this.token,n=eL(e);t&&t.kind===`mention`&&!t.scope&&n&&this.view.dispatch({changes:{from:t.from+1,insert:n.prefix},userEvent:`input.type`})}clearScope(){let e=this.token;return!e||e.kind!==`mention`||!e.scope?!1:(this.view.dispatch({changes:{from:e.from+1,to:e.from+1+e.scopeLength},userEvent:`delete.backward`}),!0)}backspace(){let e=this.token;return!this.isOpen||!e?.scope||e.query!==``||this.view.state.selection.main.head!==e.to?!1:this.clearScope()}dismiss(){return this.token?(this.dismissedFrom=this.token.from,this.close(),!0):!1}close(){clearTimeout(this.searchTimer),clearTimeout(this.showTimer),this.showTimer=void 0,this.seq++,this.token=void 0,this.tokenKey=``,this.results=void 0,this.groups=[],this.selectedId=void 0,this.notice=void 0,this.noticeItem=void 0,this.loading=!1,this.visible=!1,this.pending=void 0,this.options.onModel?.(null)}destroy(){this.close(),this.destroyed=!0}},uR=new WeakMap,dR=e=>uR.get(e);function fR(e){uR.get(e)?.close()}function pR(e){uR.get(e)?.refresh()}function mR(e){if(e.slashCompletions().length===0&&!e.referenceSource?.())return[];let t=e=>t=>{let n=uR.get(t);return n?e(n):!1};return[ku.define(t=>{let n=new lR(t,e);return uR.set(t,n),{update:e=>n.onUpdate(e),destroy:()=>{n.destroy(),uR.get(t)===n&&uR.delete(t)}}}),Jl.highest(Eu.of([{key:`ArrowUp`,run:t(e=>e.move(`up`))},{key:`ArrowDown`,run:t(e=>e.move(`down`))},{key:`Enter`,run:t(e=>e.accept())},{key:`Tab`,run:t(e=>e.accept())},{key:`Alt-Enter`,run:t(e=>e.toggle())},{key:`Escape`,run:t(e=>e.dismiss())},{key:`Backspace`,run:t(e=>e.backspace())}]))]}var hR=cu.define(),gR=cu.define(),_R=cu.define(),vR=cu.define(),yR={recording:`Listening`,transcribing:`Transcribing`,failed:`Failed`},bR={recording:`Recording — click the mic to finish, Esc to cancel`,transcribing:`Transcribing — Esc to cancel`,failed:`Transcription failed — click the mic to retry, Esc to discard`},xR=class extends xu{state;time;constructor(e,t){super(),this.state=e,this.time=t}eq(e){return e.state===this.state&&e.time===this.time}toDOM(){let e=document.createElement(`span`);e.className=`cm-mention-chip cm-dictation-chip`,e.setAttribute(`role`,`status`);let t=document.createElement(`span`);t.className=`cm-dictation-icon`;let n=document.createElement(`span`);n.className=`cm-dictation-label`;let r=document.createElement(`span`);return r.className=`cm-dictation-time`,e.append(t,n,r),this.paint(e),e}updateDOM(e){return this.paint(e),!0}paint(e){e.dataset.dictation=this.state,e.title=bR[this.state];let t=e.querySelector(`.cm-dictation-label`),n=e.querySelector(`.cm-dictation-time`);t&&(t.textContent=yR[this.state]),n&&(n.textContent=this.time)}ignoreEvent(){return!0}},SR=$l.define({create:()=>null,update(e,t){let n=e;if(n&&t.docChanged){let e=!1;t.changes.iterChangedRanges((r,i)=>{r<n.pos&&i>n.pos&&(e=!0);let a=t.startState.doc.length;a>0&&r===0&&i===a&&(e=!0)}),n=e?null:{...n,pos:t.changes.mapPos(n.pos,-1)}}for(let e of t.effects)e.is(hR)?n=e.value:e.is(gR)&&n?n={...n,...e.value}:(e.is(_R)||e.is(vR))&&(n=null);return n},provide:e=>ju.decorations.from(e,e=>e?ql.set([ql.widget({widget:new xR(e.state,As(e.elapsedMs)),side:-1}).range(e.pos)]):ql.none)}),CR=$l.define({create:()=>!1,update:(e,t)=>e||t.isUserEvent(`select`)||t.isUserEvent(`input`)||t.isUserEvent(`delete`)||t.isUserEvent(`move`)||t.isUserEvent(`undo`)||t.isUserEvent(`redo`)}),wR=new WeakMap,TR=ju.updateListener.of(e=>{let t=e.startState.field(SR,!1),n=e.state.field(SR,!1);if(!t||n)return;let r=wR.get(e.view);if(wR.delete(e.view),!r)return;let i=e.transactions.some(e=>e.effects.some(e=>e.is(_R))),a=[...r.listeners];if(r.listeners.clear(),!i)for(let e of a)e()}),ER=ku.define(e=>({destroy(){let t=wR.get(e);wR.delete(e),t?.listeners.clear()}})),DR=Jl.high(Eu.of([{key:`Backspace`,run(e){let t=e.state.field(SR,!1),n=e.state.selection.main;return!t||!n.empty||n.head!==t.pos?!1:(e.dispatch({effects:vR.of(null)}),!0)}}])),OR=`cm-nerve-dictating`,kR=ju.editorAttributes.from(SR,e=>e?{class:OR}:{});function AR(){return[SR,CR,TR,DR,ER,kR]}function jR(e){let t=new Set,n={listeners:t,get active(){return wR.get(e)===n&&!!e.state.field(SR,!1)},update(t,r){n.active&&e.dispatch({effects:gR.of({state:t,elapsedMs:r})})},resolve(t){let r=e.state.field(SR,!1);if(!n.active||!r)return;let i=t.trim();if(!i){e.dispatch({effects:_R.of(null)});return}let{doc:a}=e.state,o=r.pos,s=o>0?a.sliceString(o-1,o):``,c=o<a.length?a.sliceString(o,o+1):``,l=s&&!/\s/.test(s)?` `:``,u=c&&!/\s/.test(c)?` `:``,d=`${l}${i}${u}`,f=e.state.selection.main,p=f.empty&&f.head===o;e.dispatch({changes:{from:o,insert:d},selection:p?{anchor:o+l.length+i.length+u.length}:void 0,effects:_R.of(null),userEvent:`input.dictation`,scrollIntoView:!0})},cancel(){n.active&&e.dispatch({effects:_R.of(null)})},onRemoved(e){return t.add(e),()=>{t.delete(e)}}};return n}function MR(e){let t=wR.get(e);if(t?.active)return t;if(e.state.field(SR,!1)===void 0)throw Error(`composerDictationPlaceholder() extension is not installed`);let{doc:n,selection:r}=e.state,i=r.main,a=e.state.field(CR,!1)??!0,o=i.empty&&!a?n.length:i.from,s=i.empty&&!a?n.length:i.to,c=jR(e);return wR.set(e,c),e.dispatch({changes:o===s?void 0:{from:o,to:s},selection:{anchor:o},effects:hR.of({pos:o,state:`recording`,elapsedMs:0}),userEvent:o===s?`select`:`delete.selection`,scrollIntoView:!0}),c}var NR=ju.theme({"&":{background:`transparent`,color:`var(--foreground)`,maxHeight:`min(40vh, 320px)`},".cm-content":{caretColor:`var(--primary)`,fontFamily:`var(--font-sans)`,fontSize:`var(--text-body)`,lineHeight:`1.5`,padding:`10px 12px 6px`},".cm-line":{padding:`0 2px`},".cm-cursor":{borderLeftColor:`var(--primary)`},".cm-placeholder":{color:`var(--muted-foreground)`},".cm-quote-block-line":{backgroundColor:`var(--hover)`,boxShadow:`inset 2px 0 0 var(--primary)`,color:`var(--muted-foreground)`},".cm-scroller":{minHeight:`var(--composer-editor-min-height, 92px)`,maxHeight:`min(40vh, 320px)`,overflow:`auto`},"&.cm-focused":{outline:`none`},"&.cm-focused .cm-cursor":{borderLeftColor:`var(--primary)`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:`var(--text-selection)`},".cm-mention-chip":{display:`inline-flex`,alignItems:`center`,gap:`0.25rem`,height:`1.25rem`,margin:`0 1px`,padding:`0 0.375rem`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md)`,background:`var(--muted)`,color:`var(--foreground)`,fontFamily:`var(--font-sans)`,fontSize:`var(--text-ui)`,fontWeight:`400`,lineHeight:`1`,verticalAlign:`middle`,userSelect:`none`,whiteSpace:`nowrap`,maxWidth:`100%`},".cm-mention-chip-icon":{width:`0.75rem`,height:`0.75rem`,flexShrink:`0`,color:`var(--muted-foreground)`},".cm-mention-chip-file .cm-mention-chip-icon":{color:`var(--success)`},".cm-mention-chip-info .cm-mention-chip-icon":{color:`var(--info)`},".cm-mention-chip-label":{minWidth:`0`,overflow:`hidden`,textOverflow:`ellipsis`},".cm-dictation-chip":{width:`8.75rem`,justifyContent:`flex-start`,fontVariantNumeric:`tabular-nums`},"&.cm-nerve-dictating .cm-placeholder":{display:`none`},".cm-dictation-label":{flex:`1`},".cm-dictation-time":{color:`var(--muted-foreground)`},".cm-dictation-icon":{width:`0.625rem`,height:`0.625rem`,flex:`none`,borderRadius:`9999px`},".cm-dictation-chip[data-dictation='recording']":{borderColor:`var(--destructive-strong)`},".cm-dictation-chip[data-dictation='recording'] .cm-dictation-icon":{background:`var(--destructive)`,animation:`dictation-pulse 1.2s ease-in-out infinite`},".cm-dictation-chip[data-dictation='transcribing'] .cm-dictation-icon":{border:`1.5px solid var(--muted-foreground)`,borderTopColor:`transparent`,animation:`spin 0.8s linear infinite`},".cm-dictation-chip[data-dictation='failed']":{borderColor:`var(--destructive-strong)`,color:`var(--destructive)`},".cm-dictation-chip[data-dictation='failed'] .cm-dictation-icon":{background:`var(--destructive)`,borderRadius:`2px`}}),PR=O(`<div role="presentation"></div>`),FR=O(`<div class="pointer-events-none absolute inset-0 z-10 flex items-center justify-center gap-2 rounded-md border border-primary bg-background px-4 text-ui text-foreground shadow-sm" aria-hidden="true"><!> <span>Drop files or folders to add their paths</span></div>`),IR=O(`<div data-prompt-composer-editor="" role="group"><!> <!> <!></div>`);function LR(e,n){c(n,!0);let r=K(n,`placeholder`,3,`Ask the Nerve agent`),i=K(n,`ariaLabel`,3,`Prompt editor drop area`),a=K(n,`disabled`,3,!1),o=K(n,`focusToken`,3,0),s=K(n,`enterSends`,3,!0),u=K(n,`slashCompletions`,19,()=>[]),d,f,p=``,m=0,g=0,_=Y(!1),v=Y(0),b=Y(null),S=Y(void 0),C=!1,w,T=new du,E=new du,O=new du,A=L(u),j=L(()=>n.completionSource),N={referenceSource:()=>t(j),onModel:e=>{B(b,e)},slashContext:()=>n.slashContext,slashCommand:()=>n.onSlashCommand,action:()=>n.onCompletionAction,slashCompletions:()=>t(A)};function P(e){return[Xl.readOnly.of(e),ju.editable.of(!e)]}function I(){return!a()&&(n.onSubmit?.(),!0)}function ee(){return s()&&I()}function R(){if(!w?.inner.active)return!1;let{inner:e,listeners:t}=w;e.cancel();for(let e of[...t])e();return t.clear(),!0}function ne(){if(!f)throw Error(`Prompt editor is not ready`);let e=MR(f);if(w?.inner===e)return w.handle;let t=new Set,n={update:(t,n)=>e.update(t,n),resolve:t=>e.resolve(t),cancel:()=>e.cancel(),get active(){return e.active},onRemoved(n){t.add(n);let r=e.onRemoved(n);return()=>{t.delete(n),r()}}};return w={inner:e,handle:n,listeners:t},n}let re={insertReferences(e){if(!f||a()||e.length===0)return;let t=f.state.doc.length;f.dispatch({...ZL(f.state,e,C?void 0:{from:t,to:t}),scrollIntoView:!0}),f.focus()},startDictation:ne};function z(e){f&&(dR(f)?.accept(e),f.focus())}function ie(e,t,n){if(!f||!e)return;let r=f.state.selection.main,i=f.state.doc.length,a=Math.min(t??r.from,i),o=Math.min(n??r.to,i);f.dispatch({changes:{from:a,to:o,insert:e},selection:{anchor:a+e.length},scrollIntoView:!0}),f.focus()}function ae(e,t,n){if(!f||e.length===0)return;let r=f.state.doc.length,i=t&&{from:Math.min(t.from,r),to:Math.min(t.to,r)};f.dispatch(ZL(f.state,e.map(e=>cA(e,n)),i)),f.focus()}function V(e){return e?Array.from(e.items).some(e=>e.kind===`file`)||Array.from(e.types).includes(`Files`):!1}function oe(e){return!!(e&&Wu(Array.from(e.types)))}function se(e){return a()?!1:oe(e.dataTransfer)||!!(n.onDropFiles&&V(e.dataTransfer))}function H(e){se(e)&&(e.preventDefault(),e.stopPropagation(),g+=1,B(_,!0))}function ce(e){se(e)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))}function U(e){t(_)&&(e.preventDefault(),e.stopPropagation(),g=Math.max(0,g-1),g===0&&B(_,!1))}function ue(e){if(!se(e)||!f)return;e.preventDefault(),e.stopPropagation(),g=0,B(_,!1);let{from:t,to:r}=f.state.selection.main,i=e.dataTransfer?.getData(qu);if(i){let e=Ku(i);e&&(f.dispatch(ZL(f.state,pI(e),{from:t,to:r})),f.focus());return}if(!n.onDropFiles)return;let a=Array.from(e.dataTransfer?.files??[]);a.length!==0&&n.onDropFiles(a).then(e=>ae(e,{from:t,to:r})).catch(e=>{console.error(`Failed to resolve dropped file paths`,e)})}function de(e){if(a()||!n.onPasteImage)return!1;let t=Array.from(e.clipboardData?.files??[]).filter(e=>e.type.startsWith(`image/`));return t.length?(e.preventDefault(),Promise.all(t.map(e=>n.onPasteImage(e))).then(e=>ae(e,void 0,`image`)).catch(e=>{console.error(`Failed to paste clipboard image`,e)}),!0):!1}function fe(e){if(!f)return;let n=f.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return;let r=Vl(f.state,n);r&&f.dispatch({selection:r}),B(v,t(v)+1)}function me(e){f&&(e(f),f.focus(),B(v,t(v)+1))}async function he(e){if(!f||!n.onWriteClipboardText)return;let r=f.state.selection.main;if(r.empty)return;let i=f.state.doc.toString(),o=f.state.sliceDoc(r.from,r.to);try{await n.onWriteClipboardText(o),e&&!a()&&f.state.doc.toString()===i&&f.dispatch({changes:{from:r.from,to:r.to}})}catch{n.onClipboardError?.(e?`cut`:`copy`)}finally{f.focus(),B(v,t(v)+1)}}async function ge(){if(f&&!a()&&n.onReadClipboardText)try{ie(await n.onReadClipboardText())}catch{n.onClipboardError?.(`paste`),f.focus()}finally{B(v,t(v)+1)}}function _e(){f&&(f.dispatch({selection:{anchor:0,head:f.state.doc.length}}),f.focus(),B(v,t(v)+1))}let ve=L(()=>{if(t(v),!f)return[];let e=!f.state.selection.main.empty;return[{label:`Undo`,icon:bT,shortcut:Pl(`z`),disabled:a()||Nl(f.state)===0,onSelect:()=>me(Wl)},{label:`Redo`,icon:Qw,shortcut:Pl(`z`,{shift:!0}),disabled:a()||Rl(f.state)===0,onSelect:()=>me(Ml)},{type:`separator`},{label:`Cut`,icon:$w,shortcut:Pl(`x`),disabled:a()||!e||!n.onWriteClipboardText,onSelect:()=>void he(!0)},{label:`Copy`,icon:sr,shortcut:Pl(`c`),disabled:!e||!n.onWriteClipboardText,onSelect:()=>void he(!1)},{label:`Paste`,icon:Pw,shortcut:Pl(`v`),disabled:a()||!n.onReadClipboardText,onSelect:()=>void ge()},{type:`separator`},{label:`Select all`,icon:Fl,shortcut:Pl(`a`),onSelect:_e}]});le(()=>{p=n.value,f=new ju({parent:d,state:Xl.create({doc:n.value,extensions:[Ll(),oI(),O.of(yu(r())),T.of(P(a())),E.of(mR(N)),YL(),AR(),qI,Jl.highest(Eu.of([{key:`Enter`,run:ee},{key:`Escape`,run:R},{key:`Mod-Enter`,run:I},{key:`Ctrl-Enter`,run:I},Bl])),Eu.of([...Hl,...Al]),ju.lineWrapping,ju.domEventHandlers({paste:de}),ju.updateListener.of(e=>{(e.docChanged||e.selectionSet)&&B(v,t(v)+1),(e.selectionSet||e.focusChanged&&e.view.hasFocus)&&(C=!0),e.docChanged&&(p=e.state.doc.toString(),n.onChange?.(p))}),NR]})}),n.onReady?.(re)}),W(()=>{f&&(f.dispatch({effects:T.reconfigure(P(a()))}),a()&&(g=0,B(_,!1)))}),W(()=>{f&&(t(A),t(j),iR(N),fR(f),f.dispatch({effects:E.reconfigure(mR(N))}))}),W(()=>{f&&f.dispatch({effects:O.reconfigure(yu(r()))})}),W(()=>{f&&!a()&&o()!==m&&(m=o(),f.focus())}),W(()=>{if(!f||n.value===p)return;let e=BI(f.state.doc.toString(),n.value);f.dispatch({changes:{from:e.from,to:e.to,insert:e.insert},selection:{anchor:e.caret},scrollIntoView:!0}),p=n.value}),W(()=>{n.slashContext?.profile,n.slashContext?.running,f&&pR(f)}),W(()=>{let e=t(j);if(!e)return;let n=!1,r=!1,i=e.subscribe(()=>{r||n||(r=!0,queueMicrotask(()=>{r=!1,!n&&f&&!a()&&t(b)&&pR(f)}))});return()=>{n=!0,i()}}),pe(()=>{iR(N),f?.destroy()});var Z=IR();let ye;var be=q(Z);Uu(be,{get items(){return t(ve)},triggerClass:`block min-w-0`,nativeTouch:!0,children:(e,t)=>{var n=PR();te(n,e=>d=e,()=>d),h(`contextmenu`,n,fe),k(e,n)},$$slots:{default:!0}});var xe=G(be,2),Se=e=>{zI(e,{get model(){return t(b)},get anchor(){return t(S)},onpick:z,onhover:e=>f&&dR(f)?.select(e),ontoggle:e=>{f&&(dR(f)?.toggle(e),f.focus())},onscope:e=>{f&&(dR(f)?.setScope(e),f.focus())},onclearscope:()=>{f&&(dR(f)?.clearScope(),f.focus())},onfooteraction:()=>f&&dR(f)?.runFooterAction()})};l(xe,e=>{t(b)&&!a()&&e(Se)});var Ce=G(xe,2),we=e=>{var t=FR();Bw(q(t),{class:`size-4 text-primary`}),y(2),x(t),k(e,t)};l(Ce,e=>{t(_)&&e(we)}),x(Z),te(Z,e=>B(S,e),()=>t(S)),F(()=>{ye=X(Z,1,`composer-editor relative svelte-t51yrs`,null,ye,{disabled:a()}),J(Z,`aria-label`,i())}),M(`dragenter`,Z,H,!0),M(`dragover`,Z,ce,!0),M(`dragleave`,Z,U,!0),M(`drop`,Z,ue,!0),k(e,Z),D()}ue([`contextmenu`]);var RR=O(`<div class="flex items-center gap-2 px-3 pt-2 text-ui text-info" role="status"><!> <span class="min-w-0 truncate">The agent is waiting for your answer</span> <!></div>`),zR=O(`<span class="inline-flex flex-none"><!></span>`),BR=O(`<form class="composer svelte-gggs93" data-tour-id="composer" data-composer-popup-anchor=""><!> <div class="composer-surface svelte-gggs93"><!> <div class="editor-shell svelte-gggs93"><!></div> <div class="@container/composer-toolbar flex items-center gap-0.5 px-1.5 pb-1.5" data-tour-id="composer-controls"><!> <span class="mx-0.5 h-4 w-px flex-none bg-border" aria-hidden="true"></span> <div class="flex flex-none items-center gap-0.5" data-tour-id="composer-send-actions"><!> <!> <!></div></div></div></form>`);function VR(e,r){c(r,!0);let i=K(r,`pendingApproval`,3,!1),a=K(r,`pendingQuestion`,3,!1),o=K(r,`pendingPlan`,3,!1),s=K(r,`showStop`,3,!1),u=K(r,`stopping`,3,!1),d=K(r,`stopDisabled`,3,!1),p=K(r,`stopAriaLabel`,3,`Stop generation`),m=K(r,`stopTitle`,3,`Stop generation`);function h(e){let t=matchMedia(`(prefers-reduced-motion: reduce)`).matches,n=e.offsetWidth;return{duration:t?0:180,easing:td,css:e=>`width:${e*n}px;opacity:${e};transform:scale(${.6+.4*e});overflow:hidden;`}}var _=BR(),v=q(_),b=e=>{var t=f(),i=R(t);n(i,()=>r.header),k(e,t)};l(v,e=>{r.header&&e(b)});var C=G(v,2),w=q(C),T=e=>{var t=RR(),n=q(t);Xw(n,{class:`size-3.5 flex-none`,"aria-hidden":`true`});var i=G(n,4),a=e=>{Q(e,{variant:`outline`,size:`sm`,type:`button`,class:`ml-auto`,get onclick(){return r.onGoToQuestion},children:(e,t)=>{y();var n=g(`Go to question`);k(e,n)},$$slots:{default:!0}})};l(i,e=>{r.onGoToQuestion&&e(a)}),x(t),k(e,t)};l(w,e=>{a()&&e(T)});var E=G(w,2),O=q(E);n(O,()=>r.editor),x(E);var A=G(E,2),j=q(A);n(j,()=>r.toolbar);var N=G(j,4),P=q(N),I=e=>{var t=f(),i=R(t);n(i,()=>r.sendLeading),k(e,t)};l(P,e=>{r.sendLeading&&e(I)});var ee=G(P,2),te=e=>{var n=zR(),i=q(n);{let e=L(()=>d()||u()),n=L(()=>u()?`Stopping generation`:p()),a=L(()=>u()?`Stopping generation`:m());Q(i,{variant:`destructive`,size:`icon`,type:`button`,get disabled(){return t(e)},get onclick(){return r.onAbort},get"aria-label"(){return t(n)},get"aria-keyshortcuts"(){return r.stopShortcutAria},get title(){return t(a)},children:(e,t)=>{var n=f(),r=R(n),i=e=>{dn(e,{})},a=e=>{Xs(e,{})};l(r,e=>{u()?e(i):e(a,-1)}),k(e,n)},$$slots:{default:!0}})}x(n),S(3,n,()=>h),k(e,n)};l(ee,e=>{s()&&e(te)});var ne=G(ee,2);Q(ne,{size:`icon`,type:`submit`,get disabled(){return r.submitDisabled},get"aria-label"(){return r.sendAriaLabel},get title(){return r.sendTitle},children:(e,t)=>{Zs(e,{})},$$slots:{default:!0}}),x(N),x(A),x(C),x(_),F(()=>{J(_,`data-pending-approval`,i()?`true`:void 0),J(_,`data-pending-question`,a()?`true`:void 0),J(_,`data-pending-plan`,o()?`true`:void 0),J(C,`data-profile`,r.agentProfile)}),M(`submit`,_,e=>{e.preventDefault(),r.onSubmit()}),k(e,_),D()}var HR=O(`<div class="min-w-0 px-(--conversation-content-inset,1rem)"><!></div>`),UR=O(`<div class="flex items-center gap-2 px-3 pt-2 text-ui text-info" role="status"><!> <span class="min-w-0 truncate">The agent is waiting for your answer</span> <!></div>`),WR=O(`<input type="file" multiple="" class="hidden" tabindex="-1" aria-hidden="true"/> <!>`,1),GR=O(`<form class="grid min-w-0 gap-2" data-tour-id="composer" data-composer-popup-anchor=""><!> <div class="mobile-composer-dock grid min-w-0 border-t bg-panel svelte-m4cy29"><!> <div class="editor-shell min-w-0 px-1 svelte-m4cy29"><!></div> <div class="flex min-w-0 items-center gap-1 px-1.5"><!> <div class="@container/composer-toolbar flex min-w-0 flex-1 items-center gap-0.5" data-tour-id="composer-controls"><!></div> <div class="flex flex-none items-center gap-1" data-tour-id="composer-send-actions"><!> <!> <!></div></div></div></form>`);function KR(e,r){c(r,!0);let i=K(r,`pendingApproval`,3,!1),a=K(r,`pendingQuestion`,3,!1),o=K(r,`pendingPlan`,3,!1),s=K(r,`showStop`,3,!1),u=K(r,`stopping`,3,!1),d=K(r,`stopDisabled`,3,!1),p=K(r,`stopAriaLabel`,3,`Stop generation`),m=K(r,`stopTitle`,3,`Stop generation`),_=K(r,`attachDisabled`,3,!1),v=L(()=>i()||o()?`warning`:a()||r.agentProfile===`planning`?`info`:void 0),b=Y(null);function S(e){e.preventDefault()}var C=GR(),w=q(C),T=e=>{var t=HR(),i=q(t);n(i,()=>r.header),x(t),k(e,t)};l(w,e=>{r.header&&e(T)});var E=G(w,2),O=q(E),A=e=>{var t=UR(),n=q(t);Xw(n,{class:`size-4 flex-none`,"aria-hidden":`true`});var i=G(n,4),a=e=>{Q(e,{variant:`outline`,size:`sm`,type:`button`,class:`ml-auto`,get onclick(){return r.onGoToQuestion},children:(e,t)=>{y();var n=g(`Go to question`);k(e,n)},$$slots:{default:!0}})};l(i,e=>{r.onGoToQuestion&&e(a)}),x(t),k(e,t)};l(O,e=>{a()&&e(A)});var j=G(O,2),N=q(j);n(N,()=>r.editor),x(j);var P=G(j,2),I=q(P),ee=e=>{var n=WR(),i=R(n);te(i,e=>B(b,e),()=>t(b));var a=G(i,2);Q(a,{variant:`ghost`,size:`icon`,type:`button`,get disabled(){return _()},ariaLabel:`Attach photos or files`,"data-tour-id":`composer-attach`,onclick:()=>t(b)?.click(),children:(e,t)=>{On(e,{})},$$slots:{default:!0}}),h(`change`,i,e=>{let t=[...e.currentTarget.files??[]];t.length&&r.onAttachFiles(t),e.currentTarget.value=``}),k(e,n)};l(I,e=>{r.onAttachFiles&&e(ee)});var ne=G(I,2),re=q(ne);n(re,()=>r.toolbar),x(ne);var z=G(ne,2),ie=q(z),ae=e=>{var t=f(),i=R(t);n(i,()=>r.sendLeading),k(e,t)};l(ie,e=>{r.sendLeading&&e(ae)});var V=G(ie,2),oe=e=>{{let n=L(()=>d()||u()),i=L(()=>u()?`Stopping generation`:p()),a=L(()=>u()?`Stopping generation`:m());Q(e,{variant:`destructive`,size:`icon`,type:`button`,get disabled(){return t(n)},onmousedown:S,get onclick(){return r.onAbort},get"aria-label"(){return t(i)},get"aria-keyshortcuts"(){return r.stopShortcutAria},get title(){return t(a)},children:(e,t)=>{var n=f(),r=R(n),i=e=>{dn(e,{})},a=e=>{Xs(e,{})};l(r,e=>{u()?e(i):e(a,-1)}),k(e,n)},$$slots:{default:!0}})}};l(V,e=>{s()&&e(oe)});var se=G(V,2);Q(se,{size:`icon`,type:`submit`,get disabled(){return r.submitDisabled},onmousedown:S,get"aria-label"(){return r.sendAriaLabel},get title(){return r.sendTitle},children:(e,t)=>{Zs(e,{})},$$slots:{default:!0}}),x(z),x(P),x(E),x(C),F(()=>{J(C,`data-pending-approval`,i()?`true`:void 0),J(C,`data-pending-question`,a()?`true`:void 0),J(C,`data-pending-plan`,o()?`true`:void 0),J(E,`data-tone`,t(v))}),M(`submit`,C,e=>{e.preventDefault(),r.onSubmit()}),k(e,C),D()}ue([`change`]);var qR=[...Ti];function JR(e){return e?.supportedThinkingLevels?.length?e.supportedThinkingLevels:[`off`]}function YR(e,t){let n=JR(t);if(n.includes(e))return e;let r=qR.indexOf(e);if(r===-1)return n[0]??`off`;for(let e=r;e<qR.length;e++){let t=qR[e];if(n.includes(t))return t}for(let e=r-1;e>=0;e--){let t=qR[e];if(n.includes(t))return t}return n[0]??`off`}var XR={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Extra-high reasoning`,max:`Maximum reasoning`};function ZR(e){switch(e){case`minimal`:return`Mi`;case`low`:return`L`;case`medium`:return`M`;case`high`:return`H`;case`xhigh`:return`XH`;case`max`:return`Max`;default:return`Off`}}function QR(e){return`${e.provider}:${e.modelId}`}function $R(e){let[t,...n]=e.split(`:`),r=n.join(`:`);return t&&r?{provider:t,modelId:r}:void 0}var ez={"nerve-faux":`Nerve Faux`,anthropic:`Anthropic`,"amazon-bedrock":`Amazon Bedrock`,deepseek:`DeepSeek`,"github-copilot":`GitHub Copilot`,google:`Google`,"google-vertex":`Google Vertex`,openai:`OpenAI`,"openai-codex":`OpenAI Codex`,openrouter:`OpenRouter`,xai:`xAI`};function tz(e){let t={ai:`AI`,api:`API`,aws:`AWS`,cn:`CN`,gpt:`GPT`,oauth:`OAuth`,ui:`UI`},n=e.toLowerCase();return t[n]??n[0].toUpperCase()+n.slice(1)}function nz(e){return ez[e]??e.split(/[-_\s/]+/).filter(Boolean).map(tz).join(` `)}function rz(e){return e.name||e.label||e.modelId}function iz(e){let t=Math.round(e*10)/10;return Number.isInteger(t)?`${t}`:t.toFixed(1)}function az(e){return!Number.isFinite(e)||e<=0?`—`:e>=1e6?`${iz(e/1e6)}M`:e>=1e3?`${iz(e/1e3)}K`:`${e}`}function oz(e){return e.input?.includes(`image`)??!1}function sz(e){let t=new Map;for(let n of e){let e=rz(n);t.set(e,(t.get(e)??0)+1)}return t}function cz(e,t){return(sz(t).get(rz(e))??0)>1}function lz(e,t){let n=rz(e);return cz(e,t)?`${nz(e.provider)} / ${n}`:n}function uz(e,t){let n=new Set(t.filter(e=>e.configured).map(e=>e.provider));return e.filter(e=>e.faux||n.has(e.provider))}function dz(e,t,n){let r=uz(e,t);if(!n?.length)return r;let i=new Set(n.map(QR));return r.filter(e=>e.faux||i.has(QR(e)))}function fz(e,t){return uz(e,t).filter(e=>!e.faux)}var pz=4e5,mz={vision:`Vision`,reasoning:`Reasoning`,"long-context":`Long context`};function hz(e){return(e.supportedThinkingLevels??[]).some(e=>e!==`off`)}function gz(e,t){switch(t){case`vision`:return oz(e);case`reasoning`:return hz(e);case`long-context`:return e.contextWindow>=pz}}function _z(e){let t=sz(e);return e.map(e=>{let n=rz(e),r=nz(e.provider);return{key:QR(e),model:e,displayName:n,contextualLabel:(t.get(n)??0)>1?`${r} / ${n}`:n,providerLabel:r,searchText:`${n} ${e.modelId} ${r} ${e.provider}`.toLowerCase()}}).sort((e,t)=>{let n=e.providerLabel.localeCompare(t.providerLabel),r=e.displayName.localeCompare(t.displayName);return n||r||e.key.localeCompare(t.key)})}function vz(e,t,n=`all`,r=new Set){return!t.trim()&&n===`all`&&r.size===0?e:e.filter(e=>(n===`all`||e.model.provider===n)&&Uo(t,e.searchText)&&[...r].every(t=>gz(e.model,t)))}var yz=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`checked`,`indeterminate`,`class`]),bz=O(`<div data-slot="checkbox-indicator" class="grid place-content-center text-current transition-none [&amp;>svg]:size-3"><!></div>`);function xz(e,n){c(n,!0);let r=K(n,`ref`,15,null),i=K(n,`checked`,15,!1),a=K(n,`indeterminate`,15,!1),o=V(n,yz);var s=f(),u=R(s);{let e=(e,t)=>{let n=()=>(t?.()).checked,r=()=>(t?.()).indeterminate;var i=bz(),a=q(i),o=e=>{ic(e,{})},s=e=>{od(e,{})};l(a,e=>{n()?e(o):r()&&e(s,1)}),x(i),k(e,i)},s=L(()=>ft(`border-input data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-focus aria-invalid:ring-destructive-strong flex items-center justify-center rounded-sm size-3.5 border transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,n.class));H(u,()=>pm,(n,c)=>{c(n,P({"data-slot":`checkbox`,get class(){return t(s)}},()=>o,{get ref(){return r()},set ref(e){r(e)},get checked(){return i()},set checked(e){i(e)},get indeterminate(){return a()},set indeterminate(e){a(e)},children:e,$$slots:{default:!0}}))})}k(e,s),D()}var Sz={anthropic:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`,"fill-rule":`evenodd`},body:`<path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path>`},openai:{viewBox:`0 0 256 260`,attrs:{fill:`currentColor`},body:`<path fill="currentColor" d="M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z"/>`},"github-copilot":{viewBox:`0 0 256 208`,attrs:{fill:`currentColor`},body:`<path fill="currentColor" d="M205.3 31.4c14 14.8 20 35.2 22.5 63.6 6.6 0 12.8 1.5 17 7.2l7.8 10.6c2.2 3 3.4 6.6 3.4 10.4v28.7a12 12 0 0 1-4.8 9.5C215.9 187.2 172.3 208 128 208c-49 0-98.2-28.3-123.2-46.6a12 12 0 0 1-4.8-9.5v-28.7c0-3.8 1.2-7.4 3.4-10.5l7.8-10.5c4.2-5.7 10.4-7.2 17-7.2 2.5-28.4 8.4-48.8 22.5-63.6C77.3 3.2 112.6 0 127.6 0h.4c14.7 0 50.4 2.9 77.3 31.4ZM128 78.7c-3 0-6.5.2-10.3.6a27.1 27.1 0 0 1-6 12.1 45 45 0 0 1-32 13c-6.8 0-13.9-1.5-19.7-5.2-5.5 1.9-10.8 4.5-11.2 11-.5 12.2-.6 24.5-.6 36.8 0 6.1 0 12.3-.2 18.5 0 3.6 2.2 6.9 5.5 8.4C79.9 185.9 105 192 128 192s48-6 74.5-18.1a9.4 9.4 0 0 0 5.5-8.4c.3-18.4 0-37-.8-55.3-.4-6.6-5.7-9.1-11.2-11-5.8 3.7-13 5.1-19.7 5.1a45 45 0 0 1-32-12.9 27.1 27.1 0 0 1-6-12.1c-3.4-.4-6.9-.5-10.3-.6Zm-27 44c5.8 0 10.5 4.6 10.5 10.4v19.2a10.4 10.4 0 0 1-20.8 0V133c0-5.8 4.6-10.4 10.4-10.4Zm53.4 0c5.8 0 10.4 4.6 10.4 10.4v19.2a10.4 10.4 0 0 1-20.8 0V133c0-5.8 4.7-10.4 10.4-10.4Zm-73-94.4c-11.2 1.1-20.6 4.8-25.4 10-10.4 11.3-8.2 40.1-2.2 46.2A31.2 31.2 0 0 0 75 91.7c6.8 0 19.6-1.5 30.1-12.2 4.7-4.5 7.5-15.7 7.2-27-.3-9.1-2.9-16.7-6.7-19.9-4.2-3.6-13.6-5.2-24.2-4.3Zm69 4.3c-3.8 3.2-6.4 10.8-6.7 19.9-.3 11.3 2.5 22.5 7.2 27a41.7 41.7 0 0 0 30 12.2c8.9 0 17-2.9 21.3-7.2 6-6.1 8.2-34.9-2.2-46.3-4.8-5-14.2-8.8-25.4-9.9-10.6-1-20 .7-24.2 4.3ZM128 56c-2.6 0-5.6.2-9 .5.4 1.7.5 3.7.7 5.7 0 1.5 0 3-.2 4.5 3.2-.3 6-.3 8.5-.3 2.6 0 5.3 0 8.5.3-.2-1.6-.2-3-.2-4.5.2-2 .3-4 .7-5.7-3.4-.3-6.4-.5-9-.5Z"/>`},deepseek:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`},body:`<path fill="#4D6BFE" d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 0 1-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 0 0-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 0 1-.465.137 9.597 9.597 0 0 0-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 0 0 1.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 0 1 1.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 0 1 .415-.287.302.302 0 0 1 .2.288.306.306 0 0 1-.31.307.303.303 0 0 1-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 0 1-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 0 1 .016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 0 1-.254-.078.253.253 0 0 1-.114-.358c.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"/>`},gemini:{viewBox:`0 0 296 298`,attrs:{fill:`none`},body:`<mask id="a" width="296" height="298" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#3186FF" d="M141.201 4.886c2.282-6.17 11.042-6.071 13.184.148l5.985 17.37a184.004 184.004 0 0 0 111.257 113.049l19.304 6.997c6.143 2.227 6.156 10.91.02 13.155l-19.35 7.082a184.001 184.001 0 0 0-109.495 109.385l-7.573 20.629c-2.241 6.105-10.869 6.121-13.133.025l-7.908-21.296a184 184 0 0 0-109.02-108.658l-19.698-7.239c-6.102-2.243-6.118-10.867-.025-13.132l20.083-7.467A183.998 183.998 0 0 0 133.291 26.28l7.91-21.394Z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="163" cy="149" fill="#3689FF" rx="196" ry="159"/></g><g filter="url(#c)"><ellipse cx="33.5" cy="142.5" fill="#F6C013" rx="68.5" ry="72.5"/></g><g filter="url(#d)"><ellipse cx="19.5" cy="148.5" fill="#F6C013" rx="68.5" ry="72.5"/></g><g filter="url(#e)"><path fill="#FA4340" d="M194 10.5C172 82.5 65.5 134.333 22.5 135L144-66l50 76.5Z"/></g><g filter="url(#f)"><path fill="#FA4340" d="M190.5-12.5C168.5 59.5 62 111.333 19 112L140.5-89l50 76.5Z"/></g><g filter="url(#g)"><path fill="#14BB69" d="M194.5 279.5C172.5 207.5 66 155.667 23 155l121.5 201 50-76.5Z"/></g><g filter="url(#h)"><path fill="#14BB69" d="M196.5 320.5C174.5 248.5 68 196.667 25 196l121.5 201 50-76.5Z"/></g></g><defs><filter id="b" width="464" height="390" x="-69" y="-46" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="18"/></filter><filter id="c" width="265" height="273" x="-99" y="6" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="32"/></filter><filter id="d" width="265" height="273" x="-113" y="12" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="32"/></filter><filter id="e" width="299.5" height="329" x="-41.5" y="-130" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="32"/></filter><filter id="f" width="299.5" height="329" x="-45" y="-153" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="32"/></filter><filter id="g" width="299.5" height="329" x="-41" y="91" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="32"/></filter><filter id="h" width="299.5" height="329" x="-39" y="132" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_69_17998" stdDeviation="32"/></filter></defs>`},kimi:{viewBox:`0 0 512 512`,attrs:{"fill-rule":`evenodd`,"clip-rule":`evenodd`,fill:`currentColor`},body:`<path d="M342.065 189.759c1.886-2.42 3.541-4.63 5.289-6.77.81-1.007.74-1.771-.046-2.824-7.58-9.965-8.298-21.028-3.935-32.254 3.275-8.448 10.52-12.406 19.373-13.25 5.52-.521 10.936.046 15.959 2.73 6.596 3.53 10.438 8.912 11.688 16.341.995 5.926.81 11.712-.868 17.452-2.974 10.161-10.277 15.427-20.287 16.758-8.31 1.11-16.734 1.25-25.113 1.817-.648.046-1.308 0-2.06 0z" fill="#027aff"/><path d="M321.512 144.254h-50.064l-39.637 90.384h-56.036v-89.99H131v232.868h44.787v-98.103h78.973c13.598 0 26.015-7.927 31.744-20.252v118.355h44.787v-98.103c0-23.342-18.239-42.97-41.523-44.671v-.116h-24.593a45.577 45.577 0 0026.884-24.534l29.453-65.838z" fill="currentColor"/>`},openrouter:{viewBox:`0 0 512 512`,attrs:{fill:`currentColor`,stroke:`currentColor`},body:`<g><path d="M3 248.945C18 248.945 76 236 106 219C136 202 136 202 198 158C276.497 102.293 332 120.945 423 120.945" stroke-width="90" /><path d="M511 121.5L357.25 210.268L357.25 32.7324L511 121.5Z" /><path d="M0 249C15 249 73 261.945 103 278.945C133 295.945 133 295.945 195 339.945C273.497 395.652 329 377 420 377" stroke-width="90" /><path d="M508 376.445L354.25 287.678L354.25 465.213L508 376.445Z" /></g>`},grok:{viewBox:`0 0 1024 1024`,attrs:{fill:`none`},body:`<path d="M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916" fill="currentColor"/><path d="M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339" fill="currentColor"/>`},meta:{viewBox:`0 0 256 171`,attrs:{fill:`currentColor`},body:`<defs><linearGradient id="a" x1="13.878%" x2="89.144%" y1="55.934%" y2="58.694%"><stop offset="0%" stop-color="#0064E1"/><stop offset="40%" stop-color="#0064E1"/><stop offset="83%" stop-color="#0073EE"/><stop offset="100%" stop-color="#0082FB"/></linearGradient><linearGradient id="b" x1="54.315%" x2="54.315%" y1="82.782%" y2="39.307%"><stop offset="0%" stop-color="#0082FB"/><stop offset="100%" stop-color="#0064E0"/></linearGradient></defs><path fill="#0081FB" d="M27.651 112.136c0 9.775 2.146 17.28 4.95 21.82 3.677 5.947 9.16 8.466 14.751 8.466 7.211 0 13.808-1.79 26.52-19.372 10.185-14.092 22.186-33.874 30.26-46.275l13.675-21.01c9.499-14.591 20.493-30.811 33.1-41.806C161.196 4.985 172.298 0 183.47 0c18.758 0 36.625 10.87 50.3 31.257C248.735 53.584 256 81.707 256 110.729c0 17.253-3.4 29.93-9.187 39.946-5.591 9.686-16.488 19.363-34.818 19.363v-27.616c15.695 0 19.612-14.422 19.612-30.927 0-23.52-5.484-49.623-17.564-68.273-8.574-13.23-19.684-21.313-31.907-21.313-13.22 0-23.859 9.97-35.815 27.75-6.356 9.445-12.882 20.956-20.208 33.944l-8.066 14.289c-16.203 28.728-20.307 35.271-28.408 46.07-14.2 18.91-26.324 26.076-42.287 26.076-18.935 0-30.91-8.2-38.325-20.556C2.973 139.413 0 126.202 0 111.148l27.651.988Z"/><path fill="url(#a)" d="M21.802 33.206C34.48 13.666 52.774 0 73.757 0 85.91 0 97.99 3.597 110.605 13.897c13.798 11.261 28.505 29.805 46.853 60.368l6.58 10.967c15.881 26.459 24.917 40.07 30.205 46.49 6.802 8.243 11.565 10.7 17.752 10.7 15.695 0 19.612-14.422 19.612-30.927l24.393-.766c0 17.253-3.4 29.93-9.187 39.946-5.591 9.686-16.488 19.363-34.818 19.363-11.395 0-21.49-2.475-32.654-13.007-8.582-8.083-18.615-22.443-26.334-35.352l-22.96-38.352C118.528 64.08 107.96 49.73 101.845 43.23c-6.578-6.988-15.036-15.428-28.532-15.428-10.923 0-20.2 7.666-27.963 19.39L21.802 33.206Z"/><path fill="url(#b)" d="M73.312 27.802c-10.923 0-20.2 7.666-27.963 19.39-10.976 16.568-17.698 41.245-17.698 64.944 0 9.775 2.146 17.28 4.95 21.82L9.027 149.482C2.973 139.413 0 126.202 0 111.148 0 83.772 7.514 55.24 21.802 33.206 34.48 13.666 52.774 0 73.757 0l-.445 27.802Z"/>`},azure:{viewBox:`0 0 256 199`,attrs:{fill:`currentColor`},body:`<path d="M118.432 187.698c32.89-5.81 60.055-10.618 60.367-10.684l.568-.12l-31.052-36.935c-17.078-20.314-31.051-37.014-31.051-37.11c0-.182 32.063-88.477 32.243-88.792c.06-.105 21.88 37.567 52.893 91.32c29.035 50.323 52.973 91.815 53.195 92.203l.405.707l-98.684-.012l-98.684-.013l59.8-10.564zM0 176.435c0-.052 14.631-25.451 32.514-56.442l32.514-56.347l37.891-31.799C123.76 14.358 140.867.027 140.935.001c.069-.026-.205.664-.609 1.534s-18.919 40.582-41.145 88.25l-40.41 86.67l-29.386.037c-16.162.02-29.385-.005-29.385-.057z" fill="#0089D6" fill-rule="nonzero"/>`},"google-cloud":{viewBox:`0 -25 256 256`,attrs:{fill:`currentColor`},body:`<path fill="#EA4335" d="m170.252 56.819 22.253-22.253 1.483-9.37C153.437-11.677 88.976-7.496 52.42 33.92 42.267 45.423 34.734 59.764 30.717 74.573l7.97-1.123 44.505-7.34 3.436-3.513c19.797-21.742 53.27-24.667 76.128-6.168l7.496.39Z"/><path fill="#4285F4" d="M224.205 73.918a100.249 100.249 0 0 0-30.217-48.722l-31.232 31.232a55.515 55.515 0 0 1 20.379 44.037v5.544c15.35 0 27.797 12.445 27.797 27.796 0 15.352-12.446 27.485-27.797 27.485h-55.671l-5.466 5.934v33.34l5.466 5.231h55.67c39.93.311 72.553-31.494 72.864-71.424a72.303 72.303 0 0 0-31.793-60.453"/><path fill="#34A853" d="M71.87 205.796h55.593V161.29H71.87a27.275 27.275 0 0 1-11.399-2.498l-7.887 2.42-22.409 22.253-1.952 7.574c12.567 9.489 27.9 14.825 43.647 14.757"/><path fill="#FBBC05" d="M71.87 61.425C31.94 61.664-.237 94.228.001 134.159a72.301 72.301 0 0 0 28.222 56.88l32.248-32.246c-13.99-6.322-20.208-22.786-13.887-36.776 6.32-13.99 22.786-20.208 36.775-13.888a27.796 27.796 0 0 1 13.887 13.888l32.248-32.248A72.224 72.224 0 0 0 71.87 61.425"/>`},aws:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`,"fill-rule":`evenodd`},body:`<path d="M6.763 11.212c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 01-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 01-.287-.375 6.18 6.18 0 01-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.39-.384-.59-.894-.59-1.533 0-.678.24-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.4 2.4 0 01-.28.104.488.488 0 01-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 01.224-.167 4.577 4.577 0 011.005-.36 4.84 4.84 0 011.246-.151c.95 0 1.644.216 2.091.647.44.43.662 1.085.662 1.963v2.586h.016zm-3.24 1.214c.263 0 .534-.048.822-.144a1.78 1.78 0 00.758-.51 1.27 1.27 0 00.272-.512c.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 00-.735-.136 6.02 6.02 0 00-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 6.726a1.398 1.398 0 01-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 01.32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 01.311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 01-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 01-.303.08h-.687c-.15 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32L12.32 7.747l-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08l-.686.001zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 01-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.32.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 00.415-.758.777.777 0 00-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 01-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .36.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 01.24.2.43.43 0 01.071.263v.375c0 .168-.064.256-.184.256a.83.83 0 01-.303-.096 3.652 3.652 0 00-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.16.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926a2.157 2.157 0 01-.583.703c-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z" /><path d="M.378 15.475c3.384 1.963 7.56 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.44-.2.814.287.383.607-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351zm23.531-.2c.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151l.175-.439c.343-.88.802-2.198.52-2.555-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399z" fill="#F90" />`},mistral:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`},body:`<path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold" /><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00" /><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205" /><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F" /><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500" />`},xai:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`,"fill-rule":`evenodd`},body:`<path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z" />`},qwen:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`,"fill-rule":`evenodd`},body:`<path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"></path>`},ollama:{viewBox:`0 0 646 854`,attrs:{fill:`none`},body:`<path fill="currentColor" d="M140.629.24c-7.969 1.287-17.532 5.456-24.275 10.605-20.413 15.51-36.229 48.428-42.91 89.438-2.514 15.509-4.23 37.026-4.23 53.455 0 19.371 2.268 44.136 5.517 61.239.736 3.801 1.103 7.173.797 7.418-.245.245-3.25 2.697-6.62 5.394-11.525 9.195-24.705 23.356-33.778 36.291-17.41 24.704-28.688 52.78-33.409 83.185-1.839 12.015-2.33 36.29-.858 48.305 3.25 27.708 11.586 51.125 25.87 72.581l4.658 6.927-1.349 2.268c-9.563 16.061-17.716 39.294-21.516 61.607-3.004 17.655-3.372 22.375-3.372 46.037 0 23.847.307 28.567 3.127 45.057 3.371 19.739 10.237 40.642 17.9 54.558 2.513 4.536 8.643 13.976 9.378 14.467.246.122-.49 2.39-1.655 5.026-8.827 19.31-16.367 44.995-19.493 66.635-2.207 14.834-2.514 19.616-2.514 35.248 0 19.922 1.104 29.608 5.272 45.485l.613 2.329h52.535l-1.716-3.249c-10.605-19.616-11.586-56.029-2.452-92.38 4.168-16.797 8.888-29.118 17.716-46.099l5.272-10.298v-6.314c0-5.885-.123-6.559-2.023-10.421-1.472-2.943-3.433-5.456-6.927-8.889-5.947-5.762-10.238-11.831-13.67-19.31-15.08-32.735-18.023-81.346-7.418-122.786 4.414-17.287 11.709-32.673 19.371-41.071 5.21-5.763 7.908-12.199 7.908-18.881 0-6.927-2.452-12.628-7.97-18.574-15.815-16.919-25.562-37.517-29.056-61.485-4.965-34.145 4.046-71.355 24.52-100.84 20.046-28.935 48.183-47.509 79.631-52.474 7.049-1.165 20.229-.981 27.585.368 8.031 1.41 13.057.98 18.207-1.472 6.375-3.003 9.563-6.743 13.302-15.325 3.31-7.662 5.885-11.831 12.812-20.474 8.337-10.36 16.367-17.41 29.24-25.931 14.713-9.624 31.448-16.612 48.122-19.984 6.068-1.226 8.888-1.41 20.229-1.41s14.161.184 20.229 1.41c24.459 4.966 48.735 17.594 68.106 35.493 4.168 3.862 14.16 16.245 17.348 21.395 1.226 2.022 3.372 6.314 4.72 9.501 3.739 8.582 6.927 12.322 13.302 15.325 4.966 2.391 10.176 2.882 17.9 1.594 12.199-2.084 21.578-1.9 33.532.552 40.704 8.214 76.136 41.746 91.829 86.68 13.67 39.416 9.808 80.672-10.544 112.18-3.433 5.334-6.866 9.625-11.831 14.897-10.728 11.463-10.728 25.685-.061 37.455 17.532 19.187 28.505 66.389 25.194 108.012-2.206 27.463-9.256 52.045-18.942 65.96-1.716 2.452-5.271 6.62-7.969 9.195-3.494 3.433-5.455 5.946-6.927 8.889-1.9 3.862-2.023 4.536-2.023 10.421v6.314l5.272 10.298c8.828 16.981 13.548 29.302 17.716 46.099 9.012 35.861 8.215 71.538-2.084 91.829-.858 1.716-1.594 3.31-1.594 3.494s11.709.306 26.053.306h25.992l.674-2.636c.368-1.409.981-3.555 1.287-4.781.675-2.697 2.023-10.666 3.127-18.329 1.042-7.724 1.042-36.168 0-44.75-3.923-31.141-10.483-55.845-21.21-79.201-1.165-2.636-1.901-4.904-1.656-5.026.307-.184 2.023-2.636 3.862-5.395 13.364-20.229 21.578-45.669 25.747-79.262 1.103-9.257 1.103-49.041 0-57.93-2.943-22.926-6.498-38.497-12.383-54.251-2.452-6.559-8.95-20.413-11.708-24.888l-1.349-2.268 4.659-6.927c14.283-21.456 22.62-44.873 25.869-72.581 1.471-12.015.981-36.29-.858-48.305-4.782-30.467-16-58.42-33.409-83.185-9.073-12.935-22.253-27.096-33.777-36.291-3.372-2.697-6.376-5.149-6.621-5.394-.306-.245.062-3.617.797-7.418 7.418-38.681 7.172-86.924-.613-124.625-6.743-32.857-19.003-58.971-34.819-74.051C523.209 4.286 510.336-.864 494.888.117c-35.432 2.085-63.998 42.85-75.278 107.093-1.839 10.36-3.432 22.498-3.432 25.808 0 1.287-.246 2.329-.552 2.329s-2.697-1.226-5.272-2.758c-27.34-16.184-57.746-24.827-87.354-24.827s-60.014 8.643-87.354 24.827c-2.575 1.532-4.965 2.758-5.272 2.758-.306 0-.552-1.042-.552-2.329 0-3.433-1.655-15.938-3.432-25.808-10.238-57.684-33.716-95.875-64.918-105.499C157.181.424 144.982-.434 140.629.24m10.422 49.899c8.827 6.988 18.635 26.972 24.275 49.347 1.042 4.046 2.145 8.705 2.452 10.421.245 1.656.919 5.395 1.471 8.276 2.391 12.996 3.494 27.034 3.617 44.137l.061 16.858-4.23 6.252-4.229 6.314h-9.87c-11.524 0-22.988 1.472-33.961 4.414-3.923.981-7.724 1.962-8.459 2.146-1.165.245-1.349-.123-2.023-5.15-3.617-27.279-3.433-57.5.552-82.634 4.413-28.014 14.712-53.393 24.765-60.871 2.391-1.778 2.82-1.717 5.579.49m349.538-.43c6.069 4.476 12.751 16.368 17.716 31.57 9.992 30.406 12.812 72.152 7.54 111.875-.674 5.027-.858 5.395-2.023 5.15-.735-.184-4.536-1.165-8.459-2.146-10.973-2.942-22.437-4.414-33.961-4.414h-9.87l-4.229-6.314-4.23-6.252.061-16.858c.123-23.785 2.33-42.359 7.601-63.018 5.579-22.19 15.448-42.175 24.214-49.163 2.759-2.207 3.188-2.268 5.64-.43"/><path fill="currentColor" d="M313.498 358.237c-13.303 1.288-16.919 1.778-23.295 3.066-10.36 2.145-24.214 6.927-33.838 11.647-33.47 16.367-56.519 43.646-63.569 75.216-1.41 6.253-1.594 8.337-1.594 18.881 0 10.421.184 12.689 1.533 18.635 9.379 41.256 47.385 71.723 96.549 77.301 10.666 1.165 56.765 1.165 67.431 0 39.478-4.475 73.439-25.869 88.703-55.907 4.045-8.03 6.007-13.241 7.846-21.394 1.349-5.946 1.533-8.214 1.533-18.635 0-10.544-.184-12.628-1.594-18.881-10.238-45.853-54.742-81.959-109.3-88.825-7.111-.858-25.746-1.594-30.405-1.104m22.926 33.348c18.207 1.962 36.536 8.46 51.248 18.268 7.908 5.272 19.065 16.306 23.846 23.54 5.885 8.949 9.256 18.083 10.789 29.179.674 5.088.307 8.95-1.533 17.164-2.881 12.26-11.831 25.072-23.907 34.022-5.64 4.107-17.348 10.054-24.52 12.383-13.609 4.352-22.498 5.149-54.252 4.904-20.719-.184-24.398-.368-30.344-1.471-20.29-3.801-36.351-11.893-47.998-24.214-9.441-9.931-13.732-19.003-16.061-33.654-1.042-6.805.919-18.084 4.904-27.586 4.843-11.586 17.348-25.991 29.731-34.267 14.344-9.563 33.225-16.367 50.573-18.206 6.682-.736 20.842-.736 27.524-.062"/><path fill="currentColor" d="M299.584 436.336c-4.659 2.513-7.908 8.888-6.927 13.608 1.103 5.088 5.578 10.238 12.566 14.468 3.74 2.268 3.985 2.574 4.169 4.842.122 1.349-.368 5.211-1.042 8.644-.736 3.371-1.288 6.927-1.288 7.908.062 2.636 2.514 6.927 5.088 9.011 2.269 1.839 2.698 1.9 9.073 2.084 5.824.184 7.05.061 9.379-1.042 6.008-2.943 7.54-8.337 5.333-18.697-1.839-8.643-1.471-9.992 3.127-12.628 4.842-2.82 9.992-7.785 11.524-11.157 2.943-6.436.245-13.731-6.253-17.103-1.593-.797-3.555-1.164-6.436-1.164-4.475 0-7.356 1.042-12.628 4.413l-3.004 1.901-1.9-1.165c-7.785-4.598-9.195-5.149-13.916-5.088-3.371 0-5.21.306-6.865 1.165m-148.84-71.171c-10.85 3.433-18.942 11.402-23.11 22.743-2.023 5.395-3.004 13.916-2.146 18.513 2.023 10.973 11.034 20.965 21.272 23.724 12.873 3.371 22.497 1.164 31.018-7.295 4.965-4.843 7.663-9.073 10.36-15.939 1.961-4.842 2.084-5.7 2.084-12.566l.061-7.356-2.574-5.272c-4.108-8.337-11.525-14.529-20.107-16.797-4.843-1.226-12.628-1.164-16.858.245m327.409-.183c-8.398 2.268-15.877 8.52-19.862 16.735l-2.574 5.272.061 7.356c0 6.866.123 7.724 2.084 12.566 2.698 6.866 5.395 11.096 10.36 15.939 8.521 8.459 18.145 10.666 31.019 7.295 7.417-1.962 14.834-8.215 18.39-15.51 3.065-6.191 3.8-10.666 2.82-17.716-2.268-16.122-11.709-27.83-25.747-31.937-4.107-1.226-12.076-1.226-16.551 0"/>`},cerebras:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`},body:`<path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd" /><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z" />`},perplexity:{viewBox:`0 0 24 24`,attrs:{fill:`#1FB8CD`},body:`<path d="M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z"/>`},huggingface:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`},body:`<path d="M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z" fill="#FF9D0B" /><path d="M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z" fill="#FFD21E" /><path d="M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z" fill="#FF323D" /><path d="M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z" fill="#3A3B45" /><path d="M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z" fill="#FF9D0B" /><path d="M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z" fill="#FFD21E" />`},vercel:{viewBox:`0 0 256 222`,attrs:{fill:`currentColor`},body:`<path fill="currentColor" d="m128 0 128 221.705H0z"/>`},fireworks:{viewBox:`0 0 24 24`,attrs:{fill:`currentColor`},body:`<path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z" fill="currentColor" fill-rule="evenodd" />`},cohere:{viewBox:`0 0 75 75`,attrs:{fill:`currentColor`},body:`<path d="M24.3 44.7c2 0 6-.1 11.6-2.4 6.5-2.7 19.3-7.5 28.6-12.5 6.5-3.5 9.3-8.1 9.3-14.3C73.8 7 66.9 0 58.3 0h-36C10 0 0 10 0 22.3s9.4 22.4 24.3 22.4z" style="fill-rule:evenodd;clip-rule:evenodd;fill:currentColor"/><path d="M30.4 60c0-6 3.6-11.5 9.2-13.8l11.3-4.7C62.4 36.8 75 45.2 75 57.6 75 67.2 67.2 75 57.6 75H45.3c-8.2 0-14.9-6.7-14.9-15z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#d18ee2"/><path d="M12.9 47.6C5.8 47.6 0 53.4 0 60.5v1.7C0 69.2 5.8 75 12.9 75c7.1 0 12.9-5.8 12.9-12.9v-1.7c-.1-7-5.8-12.8-12.9-12.8z" style="fill:#ff7759"/>`},minimax:{viewBox:`0 0 24 24`,attrs:{fill:`#E73562`},body:`<path d="M11.43 3.92a.86.86 0 1 0-1.718 0v14.236a1.999 1.999 0 0 1-3.997 0V9.022a.86.86 0 1 0-1.718 0v3.87a1.999 1.999 0 0 1-3.997 0V11.49a.57.57 0 0 1 1.139 0v1.404a.86.86 0 0 0 1.719 0V9.022a1.999 1.999 0 0 1 3.997 0v9.134a.86.86 0 0 0 1.719 0V3.92a1.998 1.998 0 1 1 3.996 0v11.788a.57.57 0 1 1-1.139 0zm10.572 3.105a2 2 0 0 0-1.999 1.997v7.63a.86.86 0 0 1-1.718 0V3.923a1.999 1.999 0 0 0-3.997 0v16.16a.86.86 0 0 1-1.719 0V18.08a.57.57 0 1 0-1.138 0v2a1.998 1.998 0 0 0 3.996 0V3.92a.86.86 0 0 1 1.719 0v12.73a1.999 1.999 0 0 0 3.996 0V9.023a.86.86 0 1 1 1.72 0v6.686a.57.57 0 0 0 1.138 0V9.022a2 2 0 0 0-1.998-1.997"/>`}},Cz=[[`azure`,`azure`],[`openai`,`openai`],[`anthropic`,`anthropic`],[`github-copilot`,`github-copilot`],[`copilot`,`github-copilot`],[`google-vertex`,`google-cloud`],[`vertex`,`google-cloud`],[`google`,`gemini`],[`gemini`,`gemini`],[`amazon`,`aws`],[`aws`,`aws`],[`bedrock`,`aws`],[`kimi`,`kimi`],[`moonshot`,`kimi`],[`xai`,`xai`],[`grok`,`grok`],[`meta`,`meta`],[`llama`,`meta`],[`qwen`,`qwen`],[`alibaba`,`qwen`],[`dashscope`,`qwen`],[`vercel`,`vercel`],[`minimax`,`minimax`],[`mistral`,`mistral`],[`deepseek`,`deepseek`],[`openrouter`,`openrouter`],[`ollama`,`ollama`],[`cerebras`,`cerebras`],[`perplexity`,`perplexity`],[`huggingface`,`huggingface`],[`fireworks`,`fireworks`],[`cohere`,`cohere`]];function wz(e){let t=e.toLowerCase();return t in Sz?t:Cz.find(([e])=>t.startsWith(e))?.[1]}var Tz=A(`<svg></svg>`);function Ez(e,n){let r=d();c(n,!0);let i=L(()=>{let e=wz(n.provider);return e?Sz[e]:void 0}),a=L(()=>t(i)?.body.replaceAll(/id="([^"]+)"/g,`id="${r}-$1"`).replaceAll(/url\(#([^)]+)\)/g,`url(#${r}-$1)`));var o=f(),s=R(o),u=e=>{var r=Tz();ie(r,e=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:t(i).viewBox,...t(i).attrs,class:e,"aria-hidden":`true`,focusable:`false`}),[()=>ft(`size-3.5 flex-none`,n.class)]),se(r,()=>t(a),!0),x(r),k(e,r)},p=e=>{{let r=L(()=>ft(`size-3.5 flex-none text-muted-foreground`,n.class));rre(e,{get class(){return t(r)},"aria-hidden":`true`})}};l(s,e=>{t(i)?e(u):e(p,-1)}),k(e,o),D()}var Dz=O(`<span class="min-w-0 truncate text-ui text-muted-foreground"> </span>`),Oz=O(`<span class="flex flex-none self-center"><!></span>`),kz=O(`<span class="flex min-w-0 flex-1 items-baseline gap-1.5"><span> </span> <!> <!></span>`),Az=O(`<span> </span>`),jz=O(`<!> <!>`,1),Mz=O(`<span class="flex flex-none items-center gap-2 text-muted-foreground"><!> <span title="Accepts image input"><!></span> <span><!></span></span>`),Nz=O(`<div role="option" tabindex="-1"><div class="flex min-h-7 min-w-0 items-center gap-2 py-1 pr-1.5 pl-1"><!> <!> <!> <!> <!></div></div>`),Pz=O(`<!> <!> <!> <!>`,1),Fz=O(`<span class="flex min-w-7 flex-none items-center justify-end gap-1"><!></span>`),Iz=O(`<div role="option"><!> <!> <!></div>`);function Lz(e,r){c(r,!0);let i=e=>{var i=kz(),a=q(i),o=z(a,!0),s=G(a,2),c=e=>{var t=Dz(),n=z(t,!0);F(()=>w(n,r.detail)),k(e,t)};l(s,e=>{r.detail&&e(c)});var u=G(s,2),d=e=>{var t=Oz(),i=q(t);n(i,()=>r.badge),x(t),k(e,t)};l(u,e=>{r.badge&&e(d)}),x(i),F(e=>{X(a,1,e),w(o,r.label)},[()=>T(t(S).label({class:`max-w-full shrink-0 truncate text-ui text-foreground`}))]),k(e,i)},a=e=>{var n=f(),i=R(n),a=e=>{var n=Mz(),i=q(n);H(i,()=>wn,(e,n)=>{n(e,{children:(e,n)=>{var i=jz(),a=R(i);{let e=(e,n)=>{let i=()=>(n?.()).props;var a=Az();ie(a,()=>({...i(),class:`w-12 text-right text-ui tabular-nums`,"aria-label":t(p)}));var o=z(a,!0);F(e=>w(o,e),[()=>az(r.model.contextWindow)]),k(e,a)};H(a,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Sn,(e,n)=>{n(e,{side:`top`,children:(e,n)=>{y();var r=g();F(()=>w(r,t(p))),k(e,r)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})});var a=G(i,2),o=q(a);ad(o,{class:`size-3.5`,"aria-hidden":`true`}),x(a);var s=G(a,2);kw(q(s),{class:`size-3.5`,"aria-hidden":`true`}),x(s),x(n),F((e,n,r)=>{X(a,1,e),J(a,`aria-label`,t(_)?`Accepts image input`:void 0),X(s,1,n),J(s,`title`,r),J(s,`aria-label`,t(v)?`Supports reasoning`:void 0)},[()=>T(ft(`inline-flex text-info`,!t(_)&&`invisible`)),()=>T(ft(`inline-flex text-primary`,!t(v)&&`invisible`)),()=>`Reasoning: ${r.model.supportedThinkingLevels.join(`, `)}`]),k(e,n)};l(i,e=>{r.model&&e(a)}),k(e,n)},o=K(r,`mode`,3,`option`),s=K(r,`selected`,3,!1),u=K(r,`active`,3,!1),d=K(r,`disabled`,3,!1),p=L(()=>r.model&&r.model.contextWindow>0?`Context window: ${r.model.contextWindow.toLocaleString()} tokens${r.model.maxOutputTokens>0?` · max output ${r.model.maxOutputTokens.toLocaleString()}`:``}`:`Context window unknown`),_=L(()=>r.model?oz(r.model):!1),v=L(()=>r.model?hz(r.model):!1),b=L(()=>o()===`option`&&s()),S=L(()=>Wc({selected:t(b),highlighted:u(),disabled:d()})),C=L(()=>d()&&ft(`pointer-events-auto cursor-default`,!t(b)&&`hover:bg-transparent`));var E=f(),O=R(E),A=e=>{var o=Nz(),c=q(o),u=q(c),f=e=>{Ez(e,{get provider(){return r.model.provider}})};l(u,e=>{r.model&&e(f)});var p=G(u,2);n(p,()=>r.leading??m);var g=G(p,2);i(g);var _=G(g,2);a(_);var v=G(_,2);n(v,()=>r.trailing??m),x(c),x(o),F(e=>{J(o,`id`,r.id),J(o,`title`,r.title),J(o,`aria-selected`,s()),J(o,`aria-disabled`,d()||void 0),X(o,1,e)},[()=>T(t(S).base({class:ft(`cursor-pointer`,t(C),r.class)}))]),h(`click`,o,()=>{d()||r.onclick?.()}),h(`keydown`,o,e=>{d()||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r.onclick?.())}),k(e,o)},j=e=>{var o=Iz(),c=q(o);un(c,{class:`flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2.5`,children:(e,a)=>{var o=Pz(),c=R(o);{let e=L(()=>`Include ${r.label}`);xz(c,{get checked(){return s()},get disabled(){return d()},tabindex:-1,get"aria-label"(){return t(e)},onCheckedChange:e=>{e!==s()&&r.onclick?.()}})}var u=G(c,2),f=e=>{Ez(e,{get provider(){return r.model.provider}})};l(u,e=>{r.model&&e(f)});var p=G(u,2);n(p,()=>r.leading??m);var h=G(p,2);i(h),k(e,o)},$$slots:{default:!0}});var u=G(c,2);a(u);var f=G(u,2),p=e=>{var t=Fz(),i=q(t);n(i,()=>r.trailing),x(t),k(e,t)};l(f,e=>{r.trailing&&e(p)}),x(o),F(e=>{J(o,`id`,r.id),J(o,`title`,r.title),J(o,`aria-selected`,s()),X(o,1,e)},[()=>T(t(S).base({class:ft(`flex h-8 min-w-0 items-center gap-2 pr-2 pl-2`,t(C),r.class)}))]),k(e,o)};l(O,e=>{o()===`option`?e(A):e(j,-1)}),k(e,E),D()}ue([`click`,`keydown`]);var Rz=`inherit`;function zz(e){return{key:e.key,label:e.displayName,group:e.providerLabel,keywords:[e.model.modelId,e.model.label,e.model.provider,...gz(e.model,`vision`)?[`vision`,`image`]:[],...gz(e.model,`reasoning`)?[`reasoning`,`thinking`]:[],...gz(e.model,`long-context`)?[`long context`,`long-context`]:[]],entry:e}}function Bz(e,t){if(!t)return{kind:`none`};let n=QR(t),r=e.find(e=>e.key===n);return r?{kind:`available`,entry:r}:{kind:`unavailable`,selection:t}}function Vz(e){let t=[];e.offerInherit&&!e.query.trim()&&t.push({kind:`inherit`,key:Rz}),e.resolved.kind===`unavailable`&&t.push({kind:`unavailable`,key:QR(e.resolved.selection),selection:e.resolved.selection});let n=e.entries.map(zz);for(let{group:r,items:i}of _c(n,e.query)){t.push({kind:`header`,key:`header:${r}`,label:r});for(let{entry:e}of i)t.push({kind:`model`,key:e.key,entry:e})}return t}function Hz(e){return e.filter(e=>e.kind!==`header`)}var Uz=`Unavailable`;function Wz(e){let t=new Set(e.scoped.map(QR)),n=new Set(e.entries.map(e=>e.key)),r=e.view===`scoped`?e.scoped.filter(e=>!n.has(QR(e))).map(e=>({key:QR(e),label:e.modelId,group:Uz,keywords:[e.provider,nz(e.provider)],row:{kind:`model`,key:QR(e),selection:e,checked:!0,stale:!0}})):[],i=e.entries.filter(n=>e.view===`all`||t.has(n.key)).map(e=>({...zz(e),row:{kind:`model`,key:e.key,selection:{provider:e.model.provider,modelId:e.model.modelId},entry:e,checked:t.has(e.key),stale:!1}})),a=[];for(let{group:t,items:n}of _c([...r,...i],e.query)){let e=n.map(e=>e.row);a.push({kind:`header`,key:`header:${t}`,label:t,provider:t===Uz?void 0:e[0]?.selection.provider,selections:e.map(e=>e.selection),checked:e.filter(e=>e.checked).length}),a.push(...e)}return a}function Gz(e,t,n){let r=QR(t),i=e.some(e=>QR(e)===r);return n?i?e:[...e,{provider:t.provider,modelId:t.modelId}]:i?e.filter(e=>QR(e)!==r):e}var Kz=O(`<p class="pt-1 text-ui text-muted-foreground"> </p>`),qz=O(`<!> <!>`,1),Jz=O(`<p class="px-1.5 text-muted-foreground"> </p>`),Yz=O(`<div role="presentation" class="px-1.5 pt-2 pb-1 text-ui text-muted-foreground"> </div>`),Xz=O(`<p class="px-1.5 pt-1 text-muted-foreground"> </p>`),Zz=O(`<div role="listbox"><!></div> <!>`,1),Qz=O(`<p class="px-1.5 text-ui text-warning"> </p>`),$z=O(`<p class="px-1.5 text-ui text-muted-foreground">Available levels depend on the model selected in settings.</p>`),eB=O(`<section class="grid flex-none gap-1 border-t border-border px-2 pt-1.5 pb-2" aria-label="Reasoning level"><span class="flex items-center gap-1 px-1.5 text-ui text-muted-foreground"> <!></span> <!> <!> <!></section>`),tB=O(`<!> <!> <!>`,1);function nB(e,n){let r=d();c(n,!0);let i=K(n,`label`,3,`Model`),a=K(n,`requiredCapabilities`,19,()=>[]),o=K(n,`showReasoning`,3,!0),s=K(n,`emptyMessage`,3,`Authenticate a provider before choosing a model.`),u=K(n,`modelDisabled`,3,!1),p=K(n,`thinkingDisabled`,3,!1),m=K(n,`inherit`,3,!1),h=K(n,`unsetReasoningLabel`,3,`Use settings`),_=K(n,`isModelCompatible`,3,()=>!0),b=`${r}-models`,S=Y(``),C=Y(void 0),T=L(()=>vz(_z(n.models),``,`all`,new Set(a()))),E=L(()=>!!n.inheritOption&&m()),O=L(()=>Bz(t(T),t(E)?void 0:n.value)),A=L(()=>Vz({entries:t(T),query:t(S),resolved:t(O),offerInherit:!!n.inheritOption})),j=L(()=>t(E)?Rz:t(O).kind===`available`?t(O).entry.key:t(O).kind===`unavailable`?t(A).find(e=>e.kind===`unavailable`)?.key:void 0),M=L(()=>t(O).kind===`available`?t(O).entry.model:void 0),N=L(()=>o()&&t(M)&&hz(t(M))?t(M):void 0),P=L(()=>t(N)?JR(t(N)):[]),I=L(()=>t(O).kind===`available`?t(O).entry.contextualLabel:``),ee=L(()=>o()&&!t(E)&&t(M)!==void 0&&n.thinkingLevel!==void 0&&!JR(t(M)).includes(n.thinkingLevel)),te=L(()=>n.lockReason??(u()&&p()?`Locked`:u()?`Model is locked`:`Reasoning level is locked`)),ne=L(()=>Hz(t(A))),re=bc({items:()=>t(ne),getId:V,onChoose:e=>oe(e,!0)});W(()=>{let e=t(ne)[re.index],n=e?t(A).findIndex(t=>t.key===e.key):-1;n>=0&&t(C)?.scrollToIndex(n,{align:`auto`})}),W(()=>{if(!t(C))return;let e=t(C),n=me(()=>t(A).findIndex(e=>e.key===t(j)));n>0&&requestAnimationFrame(()=>e.scrollToIndex(n,{align:`center`}))});let ie=Y(null),ae=oc();le(()=>{ae()!==`sheet`&&t(ie)?.focus()}),W(()=>{t(S),re.reset()});function V(e){return`${r}-row-${encodeURIComponent(e.key)}`}function oe(e,r=!1){u()||(e.kind===`inherit`?(t(E)||n.onInherit?.(),(!n.onThinkingChange||r)&&n.onChoose?.()):(e.kind!==`model`||_()(e.entry.model)&&(!p()||n.thinkingLevel===void 0||JR(e.entry.model).includes(n.thinkingLevel)))&&(e.kind===`model`&&e.key!==t(j)&&n.onChange({model:{provider:e.entry.model.provider,modelId:e.entry.model.modelId},thinkingLevel:p()?n.thinkingLevel??`off`:YR(n.thinkingLevel??`off`,e.entry.model)}),r&&n.onChoose?.()))}function se(e,t){p()||t!==n.thinkingLevel&&n.onChange({model:{provider:e.provider,modelId:e.modelId},thinkingLevel:t})}function ce(e){e.key===`Enter`?(e.preventDefault(),re.chooseActive()):re.handleKeydown(e)}var U=tB(),ue=R(U);hc(ue,{children:(e,n)=>{var r=qz(),i=R(r);ks(i,{placeholder:`Search models`,ariaLabel:`Search models`,onkeydown:ce,get controls(){return b},get activeDescendant(){return re.activeDescendant},get value(){return t(S)},set value(e){B(S,e,!0)},get ref(){return t(ie)},set ref(e){B(ie,e,!0)}});var o=G(i,2),s=e=>{var t=Kz(),n=z(t);F(e=>w(n,`${e??``} models only — required by this tool`),[()=>a().map(e=>mz[e]).join(` + `)]),k(e,t)};l(o,e=>{a().length>0&&e(s)}),k(e,r)},$$slots:{default:!0}});var de=G(ue,2);vc(de,{children:(e,r)=>{var a=f(),o=R(a);H(o,()=>En,(e,r)=>{r(e,{delayDuration:300,disableHoverableContent:!0,children:(e,r)=>{var a=f(),o=R(a),c=e=>{var n=Jz(),r=z(n,!0);F(()=>w(r,t(T).length===0?s():`No models match.`)),k(e,n)},d=e=>{var r=Zz(),a=R(r),o=q(a);id(o,{get items(){return t(A)},getKey:e=>e.key,estimateSize:()=>30,gap:1,viewportClass:`max-h-[min(50vh,20rem)]`,get controller(){return t(C)},set controller(e){B(C,e,!0)},row:(e,r)=>{let i=()=>(r?.()).item;var a=f(),o=R(a),s=e=>{var t=Yz(),n=z(t,!0);F(()=>w(n,i().label)),k(e,t)},c=e=>{{let r=L(()=>V(i())),a=L(()=>n.inheritOption?.label??``),o=L(()=>n.inheritOption?.description),s=L(()=>re.activeDescendant===V(i()));Lz(e,{get id(){return t(r)},get label(){return t(a)},get title(){return t(o)},get selected(){return t(E)},get disabled(){return u()},get active(){return t(s)},onclick:()=>oe(i())})}},d=e=>{{let n=e=>{be(e,{variant:`warning`,children:(e,t)=>{y();var n=g(`Unavailable`);k(e,n)},$$slots:{default:!0}})},r=L(()=>V(i())),a=L(()=>`${i().selection.provider}/${i().selection.modelId}`),o=L(()=>re.activeDescendant===V(i()));Lz(e,{get id(){return t(r)},get label(){return t(a)},selected:!0,disabled:!0,get active(){return t(o)},trailing:n,$$slots:{trailing:!0}})}},m=e=>{let r=L(()=>i().entry),a=L(()=>i().key===t(j));{let o=L(()=>V(i())),s=L(()=>`${t(r).model.provider}/${t(r).model.modelId}`),c=L(()=>u()||!_()(t(r).model)||p()&&n.thinkingLevel!==void 0&&!JR(t(r).model).includes(n.thinkingLevel)),l=L(()=>re.activeDescendant===V(i()));Lz(e,{get id(){return t(o)},get label(){return t(r).displayName},get title(){return t(s)},get model(){return t(r).model},get selected(){return t(a)},get disabled(){return t(c)},get active(){return t(l)},onclick:()=>oe(i())})}};l(o,e=>{i().kind===`header`?e(s):i().kind===`inherit`?e(c,1):i().kind===`unavailable`?e(d,2):e(m,-1)}),k(e,a)},$$slots:{row:!0}}),x(a);var c=G(a,2),d=e=>{var t=Xz(),n=z(t,!0);F(()=>w(n,s())),k(e,t)};l(c,e=>{t(T).length===0&&e(d)}),F(()=>{J(a,`id`,b),J(a,`aria-label`,i())}),k(e,r)};l(o,e=>{t(A).length===0?e(c):e(d,-1)}),k(e,a)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}});var fe=G(de,2),pe=e=>{var r=eB(),a=q(r),o=q(a),s=G(o),c=e=>{Eh(e,{class:`size-3`,get"aria-label"(){return t(te)}})};l(s,e=>{p()&&e(c)}),x(a);var u=G(a,2);{let e=L(()=>n.thinkingLevel??`inherit`),r=L(()=>`${i()} reasoning level`);H(u,()=>ti,(i,a)=>{a(i,{type:`single`,size:`sm`,spacing:1,variant:`chip`,get value(){return t(e)},get disabled(){return p()},get"aria-label"(){return t(r)},class:`flex-wrap justify-start`,onValueChange:e=>{e&&(e===`inherit`?n.onThinkingChange?.(void 0):t(N)&&se(t(N),e))},children:(e,r)=>{var i=qz(),a=R(i),o=e=>{var t=f(),n=R(t);H(n,()=>ni,(e,t)=>{t(e,{value:`inherit`,class:`flex-none`,children:(e,t)=>{y();var n=g();F(()=>w(n,h())),k(e,n)},$$slots:{default:!0}})}),k(e,t)};l(a,e=>{n.onThinkingChange&&e(o)});var s=G(a,2);v(s,16,()=>t(P),e=>e,(e,t)=>{var n=f(),r=R(n);H(r,()=>ni,(e,n)=>{n(e,{get value(){return t},get title(){return XR[t]},class:`flex-none capitalize`,children:(e,n)=>{y();var r=g();F(()=>w(r,t)),k(e,r)},$$slots:{default:!0}})}),k(e,n)}),k(e,i)},$$slots:{default:!0}})})}var d=G(u,2),m=e=>{var r=Qz(),i=z(r);F(()=>w(i,`Saved ${n.thinkingLevel??``} reasoning is not supported by this model.${p()?` ${t(te)}.`:` Choose a supported level or use settings.`}`)),k(e,r)};l(d,e=>{t(ee)&&e(m)});var _=G(d,2),b=e=>{var t=$z();k(e,t)};l(_,e=>{t(E)&&n.onThinkingChange&&e(b)}),x(r),F(()=>w(o,`Reasoning${t(I)||t(E)?` · ${t(I)||n.inheritOption?.label}`:``} `)),k(e,r)};l(fe,e=>{o()&&(t(P).length>0||n.onThinkingChange||t(ee))&&e(pe)}),k(e,U),D()}var rB=O(`<span class="flex-none text-muted-foreground @max-[300px]/composer-toolbar:hidden @min-[481px]/composer-toolbar:@max-[560px]/composer-toolbar:hidden"> </span>`),iB=O(`<span data-tour-id="composer-model"><!> <span class="min-w-0 truncate"> </span> <!></span>`),aB=O(`<!> <!>`,1);function oB(e,n){c(n,!0);let r=K(n,`models`,19,()=>[]),i=K(n,`selectedModelKey`,3,``),a=K(n,`thinkingLevel`,3,`off`),o=K(n,`disabled`,3,!1),s=K(n,`modelLocked`,3,!1),u=K(n,`thinkingLocked`,3,!1),d=K(n,`emptyMessage`,3,`No models available. Configure a provider or adjust Scoped Models in Settings.`),f=Y(!1),p=L(()=>r().find(e=>QR(e)===i())),m=L(()=>JR(t(p))),h=L(()=>t(m).length>1);function g(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}let _=L(()=>t(p)?lz(t(p),r()):$R(i())?`${i()} (unavailable)`:`Select model`),v=L(()=>t(p)?rz(t(p)):t(_)),y=L(()=>t(h)&&a()!==`off`),b=L(()=>`${t(y)?`${t(_)} (${g(a())})`:t(_)}${n.lockReason?` · ${n.lockReason}`:``}`);W(()=>{o()&&B(f,!1)});{let c=e=>{var n=iB();let r;var i=q(n),s=e=>{Ez(e,{get provider(){return t(p).provider}})};l(i,e=>{t(p)&&e(s)});var c=G(i,2),u=z(c,!0),d=G(c,2),f=e=>{var t=rB(),n=z(t);F(e=>w(n,`(${e??``})`),[()=>ZR(a())]),k(e,t)};l(d,e=>{t(y)&&e(f)}),x(n),F(()=>{r=X(n,1,`inline-flex min-w-0 max-w-full items-center gap-1.5 text-inherit`,null,r,{"opacity-60":o()}),J(n,`aria-disabled`,o()),w(u,t(v))}),k(e,n)},m=L(()=>t(p)?`${i()}:${t(y)?ZR(a()):``}`:null);dc(e,{get triggerWidthKey(){return t(m)},size:`md`,triggerClass:`composer-tab flex-initial overflow-hidden`,ariaLabel:`Model and thinking level`,get triggerTitle(){return t(b)},side:`top`,presentation:`adaptive`,align:`start`,get open(){return t(f)},set open(e){B(f,e,!0)},trigger:c,children:(e,c)=>{var l=aB(),p=R(l);{let e=L(()=>`${r().length}`);fc(p,{title:`Model`,get meta(){return t(e)}})}var m=G(p,2);{let e=L(()=>$R(i())??void 0),c=L(()=>o()||s()),l=L(()=>o()||u());nB(m,{label:`Conversation model`,get models(){return r()},get value(){return t(e)},get thinkingLevel(){return a()},get modelDisabled(){return t(c)},get thinkingDisabled(){return t(l)},get lockReason(){return n.lockReason},get emptyMessage(){return d()},onChange:e=>{e.model&&n.onChange?.({model:e.model,thinkingLevel:e.thinkingLevel})},onChoose:()=>{B(f,!1)}})}k(e,l)},$$slots:{trigger:!0,default:!0}})}D()}var sB=new Set([`$$slots`,`$$events`,`$$legacy`]);function cB(e,t){let n=V(t,sB),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`m13 7-5 6h4l-1 5 5-7h-4z`}]];Z(e,P({name:`shield-zap`},()=>n,{get iconNode(){return r}}))}function lB(e){switch(e){case`planning`:return Nw;case`coding`:return Fw;case`lead`:return Zw;default:return Ot}}function uB(e){switch(e){case`read_only`:return oT;case`autonomous`:return cB;case`supervised`:return cd;case`planning`:return iT;default:return nT}}function dB(e){return e.map(e=>({...e,key:e.name,group:e.source===`builtin`?`Built-in`:e.source===`user`?`Personal`:e.source===`project`?`Project`:`Profiles`,detail:e.whenToUse}))}var fB=O(`<span class="min-w-0 truncate px-1.5 text-muted-foreground"> </span> <!>`,1),pB=O(`<!> <!> <!>`,1);function mB(e,n){c(n,!0);let r=K(n,`pendingProfiles`,19,()=>[]),i=K(n,`disabled`,3,!1),a=L(()=>new Set(r().map(e=>e.name))),o=L(()=>dB([...n.agentProfiles,...r().map(e=>({...e,whenToUse:`Waiting for your review`}))])),s=L(()=>r()[0]);var u=pB(),d=R(u);fc(d,{title:`Agent profile`,get onBack(){return n.onBack}});var p=G(d,2);sc(p,{get items(){return t(o)},ariaLabel:`Agent profiles`,placeholder:`Search profiles`,isSelected:e=>e.name===n.agentProfile,isDisabled:e=>i()||t(a).has(e.name),onChoose:e=>n.onSelect(e.name),icon:(e,n=m)=>{let r=L(()=>lB(n().name));var i=f(),a=R(i);H(a,()=>t(r),(e,t)=>{t(e,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`})}),k(e,i)},$$slots:{icon:!0}});var h=G(p,2),_=e=>{uc(e,{class:`justify-between [&>button]:flex-none`,children:(e,i)=>{var a=fB(),o=R(a),c=z(o,!0),l=G(o,2);Q(l,{size:`sm`,variant:`outline`,onclick:()=>n.onReview(t(s).name),children:(e,t)=>{y();var n=g(`Review`);k(e,n)},$$slots:{default:!0}}),F(()=>w(c,r().length===1?`${t(s).label} waits for your review`:`${r().length} profiles wait for your review`)),k(e,a)},$$slots:{default:!0}})};l(h,e=>{t(s)&&n.onReview&&e(_)}),k(e,u),D()}var hB=O(`<span data-tour-id="composer-profile"><!> <span class="@max-[500px]/composer-toolbar:hidden"> </span></span>`);function gB(e,n){c(n,!0);let r=K(n,`pendingProfiles`,19,()=>[]),i=K(n,`disabled`,3,!1),a=K(n,`controlsDisabled`,3,!1),o=L(()=>lB(n.agentProfile)),s=L(()=>n.agentProfiles.find(e=>e.name===n.agentProfile)??{name:n.agentProfile,label:n.agentProfile}),u=Y(!1);function d(e){e!==n.agentProfile&&n.onChange?.(e),B(u,!1)}var p=f(),m=R(p),h=e=>{{let c=e=>{var n=hB(),r=q(n);H(r,()=>t(o),(e,t)=>{t(e,{"aria-hidden":`true`})});var a=G(r,2),c=z(a,!0);x(n),F(()=>{X(n,1,`inline-flex items-center gap-1 ${i()?`opacity-60`:``}`),w(c,t(s).label)}),k(e,n)},l=L(()=>n.agentProfiles.some(e=>e.name===n.agentProfile)?`${n.agentProfile}:${t(s).label}`:null),f=L(()=>n.shortcut&&!i()?`Agent profile: ${t(s).label} (${n.shortcut})`:`Agent profile: ${t(s).label}`);dc(e,{get triggerWidthKey(){return t(l)},size:`lg`,triggerClass:`composer-tab`,ariaLabel:`Agent profile`,get triggerTitle(){return t(f)},get triggerAriaKeyShortcuts(){return n.shortcutAria},side:`top`,align:`start`,presentation:`adaptive`,get open(){return t(u)},set open(e){B(u,e,!0)},trigger:c,children:(e,o)=>{{let o=L(()=>a()||i()),s=L(()=>n.onReview?e=>{B(u,!1),n.onReview(e)}:void 0);mB(e,{get agentProfiles(){return n.agentProfiles},get agentProfile(){return n.agentProfile},get pendingProfiles(){return r()},get disabled(){return t(o)},onSelect:d,get onReview(){return t(s)}})}},$$slots:{trigger:!0,default:!0}})}};l(m,e=>{n.agentProfiles.length>0&&e(h)}),k(e,p),D()}var _B=O(`<span aria-hidden="true"><span class="progress-ring-core size-2 rounded-full svelte-7dktki"></span></span>`);function vB(e,n){c(n,!0);let r=K(n,`percent`,3,0),i=K(n,`tone`,3,`neutral`),a=L(()=>Math.min(100,Math.max(0,r()??0)));var o=_B();F(e=>{X(o,1,e,`svelte-7dktki`),J(o,`data-tone`,i()),I(o,`--progress-ring-fill: ${t(a)}%;`)},[()=>T(ft(`progress-ring inline-grid size-3 flex-none place-items-center rounded-full`,n.class))]),k(e,o),D()}function yB(e){return e.map(e=>`${e.label}: ${e.value??`—`}`).join(`
38
+ `)}var bB=[{afterResponses:50,minPercent:85},{afterResponses:30,minPercent:80},{afterResponses:20,minPercent:70},{afterResponses:10,minPercent:50}];function xB(){return{responseCount:0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:0}}function SB(e){let t=xB();for(let n of e)n.usage&&(t.responseCount+=1,t.input+=n.usage.input,t.output+=n.usage.output,t.cacheRead+=n.usage.cacheRead,t.cacheWrite+=n.usage.cacheWrite,t.totalTokens+=n.usage.totalTokens,t.cost+=n.usage.cost);return t}function CB(e){let t=e.input+e.cacheRead+e.cacheWrite;return{...e,hasUsage:e.responseCount>0,promptTokens:t,cachedTokens:e.cacheRead,uncachedTokens:e.input+e.cacheWrite,cacheRate:t>0?e.cacheRead/t*100:null}}function wB(e){return bB.find(t=>e>t.afterResponses)?.minPercent??null}function TB(e){let t=wB(e.responseCount);return t!=null&&e.cacheRate!=null&&e.cacheRate<t}var EB=(e,n=m)=>{let r=L(()=>n().cacheRate==null?`Unavailable`:`${Math.round(n().cacheRate)}%`);mc(e,{children:(e,i)=>{var a=DB(),o=R(a);{let e=L(()=>`${ak(n().promptTokens)} tokens`),r=L(()=>`${n().promptTokens.toLocaleString()} tokens`);cc(o,{label:`Input`,get value(){return t(e)},get title(){return t(r)}})}var s=G(o,2);{let e=L(()=>`${ak(n().cachedTokens)} tokens · ${t(r)}`),i=L(()=>`${n().cachedTokens.toLocaleString()} tokens · ${t(r)} of all input tokens`);cc(s,{label:`Cached input`,get value(){return t(e)},get title(){return t(i)}})}var c=G(s,2);{let e=L(()=>`${ak(n().output)} tokens`),r=L(()=>`${n().output.toLocaleString()} tokens`);cc(c,{label:`Output`,get value(){return t(e)},get title(){return t(r)}})}k(e,a)},$$slots:{default:!0}})},DB=O(`<!> <!> <!>`,1),OB=O(`<div class="flex items-center gap-2 px-1.5 pb-1" role="status"><p class="text-warning">Refresh failed; showing earlier totals.</p> <!></div>`),kB=O(`<span class="ctx-percent @max-[380px]/composer-toolbar:hidden svelte-3n3i14"> </span>`),AB=O(`<span class="context-usage-tab-inner inline-flex items-center gap-1 svelte-3n3i14" data-tour-id="composer-context"><!> <!></span>`),jB=O(`<span><!></span>`),MB=O(`<dt class="text-muted-foreground"> </dt> <dd> </dd>`,1),NB=O(`<dl class="grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1"></dl> <p class="pt-1 text-muted-foreground">Click to copy all session details</p>`,1),PB=O(`<!> <!>`,1),FB=O(`<div class="flex items-start gap-2 px-1.5 pt-2" role="status"><!> <p class="text-warning"> </p></div>`),IB=O(`<p class="px-1.5 text-muted-foreground">Available after the first response.</p>`),LB=O(`<p class="px-1.5 text-muted-foreground">No responses yet.</p>`),RB=O(`<div class="flex items-center gap-2 px-1.5"><p class="text-destructive">Token usage unavailable.</p> <!></div>`),zB=O(`<p class="px-1.5 text-muted-foreground" role="status"> </p>`),BB=O(`<!> `,1);function VB(e,r){c(r,!0);let i=e=>{var t=OB(),n=G(q(t),2),i=e=>{Q(e,{size:`sm`,variant:`ghost`,get onclick(){return r.onUsageRetry},children:(e,t)=>{y();var n=g(`Retry`);k(e,n)},$$slots:{default:!0}})};l(n,e=>{r.onUsageRetry&&e(i)}),x(t),k(e,t)},a=K(r,`contextWindow`,3,0),o=K(r,`compacting`,3,!1),s=K(r,`compactDisabled`,3,!1),u=K(r,`agentUsageLoading`,3,!1),d=Y(!1),p=Y(!1),h=Y(void 0),_=Y(!1),b;W(()=>()=>clearTimeout(b));function S(){r.session&&(r.session.onCopy?.(yB(r.session.fields),`session details`),B(_,!0),clearTimeout(b),b=setTimeout(()=>B(_,!1),1200))}let C=L(()=>a()||r.contextUsage?.contextWindow||0),E=L(()=>r.contextUsage?.tokens??null),O=L(()=>CB(r.conversationUsage??xB())),A=!1;W(()=>{let e=t(d);e!==A&&(A=e,me(()=>r.onUsageOpenChange?.(e)))}),W(()=>()=>{A&&(A=!1,me(()=>r.onUsageOpenChange?.(!1)))});let j=L(()=>CB(r.agentUsage?.own??xB())),M=L(()=>CB(r.agentUsage?.subagents??xB())),N=L(()=>r.agentUsage?.subagentCount??0),P=L(()=>t(E)!=null&&t(C)>0?t(E)/t(C)*100:r.contextUsage?.percent??null),I=L(()=>t(P)==null?0:Math.max(0,Math.min(100,t(P)))),ee=L(()=>t(E)!=null&&t(C)>0?Math.max(0,t(C)-t(E)):null),te=L(()=>ok(t(P))),ne=L(()=>t(te)===`error`?`destructive`:t(te)===`warning`?`warning`:`neutral`),re=L(()=>t(P)==null?`?%`:`${Math.round(t(P))}%`),ae=L(()=>t(P)!=null),V=L(()=>!!r.agentUsage&&TB(t(j))),oe=L(()=>t(V)&&t(j).cacheRate!=null?`Low prompt cache: ${Math.round(t(j).cacheRate)}% of input was cached across ${t(j).responseCount} requests (expected at least ${wB(t(j).responseCount)}% by now). Uncached input costs more.`:void 0),se=L(()=>t(E)!=null&&t(C)>0?`Context: ${t(E).toLocaleString()} / ${t(C).toLocaleString()} tokens`:t(C)>0?`Context usage unknown / ${t(C).toLocaleString()} tokens`:`Context window unknown`),ce=L(()=>t(oe)?`${t(oe)}\n${t(se)}`:t(se)),U=L(()=>t(C)>0?ak(t(C)):`—`),le=L(()=>o()||s()||!r.onCompact),ue=L(()=>t(te)===`error`?`destructive`:t(te)===`warning`?`warning`:`brand`);async function de(e){if(r.onOpenRequestPreview&&!t(h)){B(h,e,!0);try{await r.onOpenRequestPreview(e)}finally{B(h,void 0)}}}let fe=[{section:`system-prompt`,label:`Open system prompt`,tooltip:`Open the system prompt for the next request using current settings. Changes before sending may change it.`,icon:hd},{section:`tools`,label:`Open tool definitions`,tooltip:`Open the tool descriptions and parameter schemas for the next request using current settings. Changes before sending may change them.`,icon:At}];function pe(){t(le)||(B(d,!1),B(p,!0))}var he=PB(),ge=R(he),_e=e=>{dc(e,{size:`md`,triggerClass:`composer-tab context-usage-tab`,ariaLabel:`Context usage`,get triggerTitle(){return t(ce)},side:`top`,presentation:`adaptive`,align:`end`,get open(){return t(d)},set open(e){B(d,e,!0)},trigger:e=>{var n=AB(),r=q(n),i=e=>{bn(e,{class:`size-3 flex-none text-warning`,"aria-label":`Low prompt cache rate`})},a=e=>{vB(e,{get percent(){return t(I)},get tone(){return t(ne)}})};l(r,e=>{t(V)?e(i):e(a,-1)});var o=G(r,2),s=e=>{var n=kB(),r=z(n,!0);F(()=>w(r,t(re))),k(e,n)};l(o,e=>{t(ae)&&e(s)}),x(n),F(()=>J(n,`data-tone`,t(te))),k(e,n)},children:(e,a)=>{var s=DB(),c=R(s);fc(c,{title:`Context`,actions:e=>{var i=DB(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>En,(e,n)=>{n(e,{delayDuration:200,children:(e,n)=>{var i=f(),a=R(i);H(a,()=>wn,(e,n)=>{n(e,{ignoreNonKeyboardFocus:!0,children:(e,n)=>{var i=PB(),a=R(i);{let e=(e,n)=>{let r=()=>(n?.()).props;var i=jB();ie(i,()=>({...r(),class:`inline-flex`}),void 0,void 0,void 0,`svelte-3n3i14`);var a=q(i);Q(a,{size:`icon-sm`,variant:`ghost`,class:`text-muted-foreground hover:text-foreground`,ariaLabel:`Copy session details`,onclick:S,children:(e,n)=>{var r=f(),i=R(r),a=e=>{Mw(e,{class:`size-3.5 text-success`,"aria-hidden":`true`})},o=e=>{Pw(e,{class:`size-3.5`,"aria-hidden":`true`})};l(i,e=>{t(_)?e(a):e(o,-1)}),k(e,r)},$$slots:{default:!0}}),x(i),k(e,i)};H(a,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Sn,(e,n)=>{n(e,{side:`top`,class:`max-w-md flex-col items-stretch gap-1 py-2`,children:(e,n)=>{var i=NB(),a=R(i);v(a,21,()=>r.session.fields,e=>e.label,(e,n)=>{var r=MB(),i=R(r),a=z(i,!0),o=G(i,2),s=z(o,!0);F(()=>{w(a,t(n).label),X(o,1,T([`text-right break-all`,t(n).mono&&`font-mono`])),w(s,t(n).value??`—`)}),k(e,r)}),x(a),y(2),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,n)};l(a,e=>{r.session&&e(o)});var s=G(a,2),c=e=>{var n=f(),r=R(n);v(r,17,()=>fe,e=>e.section,(e,n)=>{var r=f(),i=R(r);H(i,()=>En,(e,r)=>{r(e,{delayDuration:200,children:(e,r)=>{var i=f(),a=R(i);H(a,()=>wn,(e,r)=>{r(e,{ignoreNonKeyboardFocus:!0,children:(e,r)=>{var i=PB(),a=R(i);{let e=(e,r)=>{let i=()=>(r?.()).props;var a=jB();ie(a,()=>({...i(),class:`inline-flex`}),void 0,void 0,void 0,`svelte-3n3i14`);var o=q(a);{let e=L(()=>t(h)!==void 0);Q(o,{size:`icon-sm`,variant:`ghost`,class:`text-muted-foreground hover:text-foreground`,get ariaLabel(){return t(n).label},get disabled(){return t(e)},onclick:()=>void de(t(n).section),children:(e,r)=>{var i=f(),a=R(i),o=e=>{dn(e,{class:`size-3.5`})},s=e=>{var r=f(),i=R(r);H(i,()=>t(n).icon,(e,t)=>{t(e,{class:`size-3.5`,"aria-hidden":`true`})}),k(e,r)};l(a,e=>{t(h)===t(n).section?e(o):e(s,-1)}),k(e,i)},$$slots:{default:!0}})}x(a),k(e,a)};H(a,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var o=G(a,2);H(o,()=>Sn,(e,r)=>{r(e,{side:`top`,class:`max-w-xs`,children:(e,r)=>{y();var i=g();F(()=>w(i,t(n).tooltip)),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,r)}),k(e,n)};l(s,e=>{r.onOpenRequestPreview&&e(c)});var u=G(s,2);n(u,()=>r.contextActions??m,()=>()=>B(d,!1)),k(e,i)},$$slots:{actions:!0}});var p=G(c,2);vc(p,{children:(e,n)=>{var a=DB(),o=R(a);{let e=L(()=>t(E)==null?`—`:`${ak(t(E))} / ${ak(t(C))}`),n=L(()=>t(P)??void 0),r=L(()=>t(P)==null?`Available after the next response · ${t(U)} window`:`${t(re)} used · ${t(ee)==null?`remaining unknown`:`${ak(t(ee))} remaining`}`);Sc(o,{label:`Used`,get value(){return t(e)},get percent(){return t(n)},get tone(){return t(ue)},get caption(){return t(r)}})}var s=G(o,2),c=e=>{var n=FB(),r=q(n);bn(r,{class:`mt-0.5 size-3.5 shrink-0 text-warning`,"aria-hidden":`true`});var i=G(r,2),a=z(i,!0);x(n),F(()=>w(a,t(oe))),k(e,n)};l(s,e=>{t(oe)&&e(c)});var d=G(s,2),p=e=>{var n=PB(),a=R(n);lc(a,{label:`This agent`,separated:!0,children:(e,n)=>{var a=PB(),o=R(a),s=e=>{i(e)};l(o,e=>{r.agentUsageError&&e(s)});var c=G(o,2),u=e=>{EB(e,()=>t(j))},d=e=>{var t=IB();k(e,t)};l(c,e=>{t(j).hasUsage?e(u):e(d,-1)}),k(e,a)},$$slots:{default:!0}});var o=G(a,2);{let e=L(()=>`Sub-agents (${t(N)})`);lc(o,{get label(){return t(e)},separated:!0,children:(e,n)=>{var r=f(),i=R(r),a=e=>{EB(e,()=>t(M))},o=e=>{var t=LB();k(e,t)};l(i,e=>{t(M).hasUsage?e(a):e(o,-1)}),k(e,r)},$$slots:{default:!0}})}k(e,n)},m=e=>{lc(e,{label:`Token usage`,separated:!0,children:(e,n)=>{var a=f(),o=R(a),s=e=>{var n=PB(),a=R(n),o=e=>{i(e)};l(a,e=>{r.agentUsageError&&e(o)});var s=G(a,2),c=e=>{EB(e,()=>t(j))},u=e=>{var t=IB();k(e,t)};l(s,e=>{t(j).hasUsage?e(c):e(u,-1)}),k(e,n)},c=e=>{var t=f(),n=R(t),i=e=>{var t=RB(),n=G(q(t),2),i=e=>{Q(e,{size:`sm`,variant:`ghost`,get onclick(){return r.onUsageRetry},children:(e,t)=>{y();var n=g(`Retry`);k(e,n)},$$slots:{default:!0}})};l(n,e=>{r.onUsageRetry&&e(i)}),x(t),k(e,t)},a=e=>{var t=zB(),n=z(t,!0);F(()=>w(n,u()?`Loading…`:`Available when opened.`)),k(e,t)};l(n,e=>{r.agentUsageError?e(i):e(a,-1)}),k(e,t)},d=e=>{EB(e,()=>t(O))},p=e=>{var t=IB();k(e,t)};l(o,e=>{r.agentUsage?e(s):r.onUsageOpenChange?e(c,1):t(O).hasUsage?e(d,2):e(p,-1)}),k(e,a)},$$slots:{default:!0}})};l(d,e=>{r.agentUsage&&t(N)>0?e(p):e(m,-1)}),k(e,a)},$$slots:{default:!0}});var b=G(p,2);uc(b,{children:(e,n)=>{{let n=L(()=>o()?`Conversation compaction is in progress`:`Summarize earlier messages to reduce context usage`);Q(e,{size:`sm`,variant:`ghost`,get disabled(){return t(le)},get title(){return t(n)},onclick:pe,children:(e,t)=>{var n=BB(),r=R(n);Gl(r,{});var i=G(r);F(()=>w(i,` ${o()?`Compacting…`:`Compact context`}`)),k(e,n)},$$slots:{default:!0}})}},$$slots:{default:!0}}),k(e,s)},$$slots:{trigger:!0,default:!0}})};l(ge,e=>{(r.onOpenRequestPreview||t(C)>0||t(P)!=null)&&e(_e)});var ve=G(ge,2);jn(ve,{title:`Compact conversation`,description:`This summarizes earlier messages to reduce context size. The full history stays available in the branch tree.`,confirmLabel:`Compact context`,onConfirm:()=>r.onCompact?.(),get open(){return t(p)},set open(e){B(p,e,!0)}}),k(e,he),D()}var HB=O(`<span class="inline-flex flex-none text-warning" role="img"><!></span>`),UB=O(`<span class="inline-flex flex-none text-muted-foreground" role="img"><!></span>`),WB=O(`<div class="flex min-h-control min-w-0 flex-1 items-center gap-2 rounded-md px-1.5 py-0.5 hover:bg-hover"><!> <!> <span> </span> <!> <!> <!> <!> <!></div>`),GB=O(`<!> <!>`,1),KB=O(`<p class="px-1.5 text-warning" role="alert"> </p>`),qB=O(`<div class="grid gap-1" aria-hidden="true"><!><!></div>`),JB=O(`<p class="px-1.5 text-warning">Delegation is unavailable here.</p>`),YB=O(`<p class="px-1.5 text-muted-foreground">Sub-agents can't delegate. Configure profiles in the lead
39
+ conversation.</p>`);function XB(e,n){c(n,!0);let r=(e,r=m,i)=>{let a=ve(()=>u(i?.(),!1)),c=L(()=>r().icon);var d=WB(),p=q(d),h=e=>{var i=f(),a=R(i),o=e=>{{let i=L(()=>`size-3.5 flex-none ${n.capabilities.rowDisabled(r())?`text-muted-foreground`:`text-primary`}`);Wn(e,{get class(){return t(i)},"aria-hidden":`true`})}},s=e=>{gd(e,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`})};l(a,e=>{r().enabled?e(o):e(s,-1)}),k(e,i)};l(p,e=>{t(a)||e(h)});var g=G(p,2),_=e=>{var n=f(),r=R(n);H(r,()=>t(c),(e,t)=>{t(e,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`})}),k(e,n)};l(g,e=>{t(c)&&e(_)});var v=G(g,2),y=z(v,!0),b=G(v,2),S=e=>{var t=HB(),n=q(t);bn(n,{class:`size-3.5`,"aria-hidden":`true`}),x(t),F(()=>{J(t,`aria-label`,r().warning),J(t,`title`,r().warning)}),k(e,t)};l(b,e=>{r().warning&&e(S)});var C=G(b,2),T=e=>{var t=UB();Eh(q(t),{class:`size-3.5`,"aria-hidden":`true`}),x(t),F(()=>{J(t,`aria-label`,`${r().label} locked by ${r().lockedBy}`),J(t,`title`,`Locked by ${r().lockedBy}`)}),k(e,t)};l(C,e=>{r().lockedBy&&e(T)});var E=G(C,2),D=e=>{{let n=L(()=>r().resetLabel??`Reset ${r().label} to the inherited setting`),i=L(()=>t(o)||t(s));Mn(e,{get icon(){return zn},get label(){return t(n)},get disabled(){return t(i)},onclick:e=>{e.stopPropagation(),r().reset()}})}};l(E,e=>{r().overridden&&e(D)});var O=G(E,2),A=e=>{{let n=L(()=>`Configure ${r().label}`);Mn(e,{get icon(){return xw},get label(){return t(n)},onclick:e=>{e.stopPropagation(),r().configure?.()}})}};l(O,e=>{r().configure&&e(A)});var j=G(O,2),M=e=>{{let i=L(()=>n.capabilities.rowDisabled(r())),a=L(()=>`Enable ${r().label} for this conversation`);yn(e,{get checked(){return r().enabled},get disabled(){return t(i)},get busy(){return t(s)},get"aria-label"(){return t(a)},get onCheckedChange(){return r().toggle}})}};l(j,e=>{t(a)&&e(M)}),x(d),F(()=>{X(v,1,`min-w-0 flex-1 truncate ${r().muted?`text-muted-foreground`:``}`),J(v,`title`,r().warning??r().detail),w(y,r().label)}),k(e,d)},i=Y(``),a=L(()=>n.capabilities.props),o=L(()=>t(a).disabled??!1),s=L(()=>t(a).loading??!1),d=L(()=>n.capabilities.sections.find(e=>e.kind===n.kind)),p=L(()=>n.capabilities.rows(n.kind)),h=L(()=>t(d).title.toLowerCase());le(()=>n.capabilities.props.onRefresh?.());var g=GB(),_=R(g);fc(_,{get title(){return t(d).title},get onBack(){return n.onBack},actions:e=>{var r=GB(),i=R(r),c=e=>{{let r=L(()=>`Reset all ${n.capabilities.overrideCount} conversation capability override${n.capabilities.overrideCount===1?``:`s`}`),i=L(()=>t(o)||t(s));Q(e,{size:`icon-sm`,variant:`ghost`,ariaLabel:`Reset all conversation capability overrides`,get title(){return t(r)},get disabled(){return t(i)},onclick:()=>t(a).onReset?.(),children:(e,t)=>{zn(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}};l(i,e=>{n.capabilities.overrideCount>0&&e(c)});var u=G(i,2);{let e=L(()=>`Open ${n.kind===`subagents`?`sub-agent`:n.kind} settings`),r=L(()=>`Open ${n.kind===`subagents`?`sub-agent`:n.kind} settings`);Q(u,{size:`icon-sm`,variant:`ghost`,get ariaLabel(){return t(e)},get title(){return t(r)},onclick:()=>n.capabilities.openSettings(n.kind),children:(e,t)=>{Xc(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}k(e,r)},$$slots:{actions:!0}});var v=G(_,2),y=e=>{vc(e,{children:(e,n)=>{var r=KB(),i=z(r,!0);F(()=>w(i,t(a).error)),k(e,r)},$$slots:{default:!0}})},b=e=>{vc(e,{children:(e,t)=>{var n=qB(),r=q(n);eg(r,{class:`h-7 w-full`}),eg(G(r),{class:`h-7 w-full`}),x(n),k(e,n)},$$slots:{default:!0}})},S=e=>{var o=GB(),s=R(o),c=e=>{vc(e,{children:(e,i)=>{var o=f(),s=R(o),c=e=>{var t=f(),i=R(t),a=e=>{r(e,()=>n.capabilities.delegationRow,()=>!0)},o=e=>{var t=JB();k(e,t)};l(i,e=>{n.capabilities.delegationRow?e(a):e(o,-1)}),k(e,t)},u=e=>{var t=YB();k(e,t)};l(s,e=>{t(a).subagentControlsEnabled?e(c):e(u,-1)}),k(e,o)},$$slots:{default:!0}})};l(s,e=>{n.kind===`subagents`&&e(c)});var u=G(s,2);{let e=(e,t=m)=>{r(e,t)},a=L(()=>`Search ${t(h)}`),o=L(()=>t(p).length===0?n.kind===`skills`?`No skills are available for this project.`:`No sub-agent profiles are available.`:`No ${t(h)} match.`);sc(u,{rowMode:`container`,get items(){return t(p)},get ariaLabel(){return t(d).title},get placeholder(){return t(a)},isSelected:e=>e.enabled,isDisabled:e=>n.capabilities.rowDisabled(e),onChoose:e=>n.capabilities.toggleRow(e),get empty(){return t(o)},get query(){return t(i)},set query(e){B(i,e,!0)},row:e,$$slots:{row:!0}})}k(e,o)};l(v,e=>{t(a).error?e(y):t(s)&&!t(a).configuration?e(b,1):e(S,-1)}),k(e,g),D()}function ZB(e,t){return t?.[e.name]?.enabled??e.defaultEnabled??!0}function QB(e,t){return{available:e.filter(e=>!e.error&&ZB(e,t)).length,total:e.length}}function $B(e,t){if(Object.is(e,t))return!0;if(!e||!t||typeof e!=`object`||typeof t!=`object`)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>$B(e,t[n]));let n=Object.entries(e);return n.length===Object.keys(t).length&&n.every(([e,n])=>Object.hasOwn(t,e)&&$B(n,t[e]))}function eV(e,t,n){let r=t.slice(1).split(`/`).map(e=>e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`)),i=e;for(let e of r.slice(0,-1))Object.hasOwn(i,e)||Object.defineProperty(i,e,{value:{},enumerable:!0,configurable:!0,writable:!0}),i=i[e];Object.defineProperty(i,r.at(-1),{value:n,enumerable:!0,configurable:!0,writable:!0})}function tV(e,t){let n=la.parse(e),r=la.parse(t),i=new Map(ta(r)),a={};for(let[e,t]of ta(n))e.startsWith(`/skills/`)||e.startsWith(`/mcpServers/`)||$B(t,i.get(e))||eV(a,e,t);for(let e of[`file`,`nerve`,`agentBrowser`]){let t=n.skills?.[e]??{},i=r.skills?.[e]??{},o=r.skills?.defaults?.[e],s=n.skills?.defaults?.[e],c=s!==void 0&&(s!==o||Object.entries(i).some(([e,n])=>!Object.hasOwn(t,e)&&n!==s));c&&eV(a,`/skills/defaults/${e}`,s);for(let[n,r]of Object.entries(t))r!==(c?s:Object.hasOwn(i,n)?i[n]:o)&&eV(a,`/skills/${e}/${n.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`,r)}let o=n.mcpServers?.servers??{},s=r.mcpServers?.servers??{},c=r.mcpServers?.defaults,l=n.mcpServers?.defaults,u=l!==void 0&&(l!==c||Object.entries(s).some(([e,t])=>!Object.hasOwn(o,e)&&t!==l));u&&eV(a,`/mcpServers/defaults`,l);for(let[e,t]of Object.entries(o)){let n=u?l:Object.hasOwn(s,e)?s[e]:c;(n===void 0||t!==n)&&eV(a,`/mcpServers/servers/${e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`,t)}return la.parse(a)}function nV(e,t){let n=oa.shape.overrides,r=n.parse(e),i=n.parse(t),a=(e,t)=>t!==void 0&&e.every(e=>t.some(t=>$B(e,t)))&&t.every(t=>e.some(e=>$B(t,e)));return{...r.defaultAgentProfile!==void 0&&r.defaultAgentProfile!==i.defaultAgentProfile?{defaultAgentProfile:r.defaultAgentProfile}:{},...r.scopedModels!==void 0&&!a(r.scopedModels,i.scopedModels)?{scopedModels:r.scopedModels}:{}}}function rV(e={}){return Object.entries(e).filter(([,e])=>e.source===`requirement`).map(([e])=>e)}function iV(e,t){return t.some(t=>e===t||e.startsWith(`${t}/`))}function aV(e,t={},n={}){let r=rV(n);return ta(t).filter(([t])=>e.some(e=>t.startsWith(`/tools/${e}/`))).filter(([e])=>!iV(e,r)).map(([e])=>`/overrides${e}`)}function oV(e,t={}){for(let n of e){let e=t[`/tools/${n}/enabled`];if(e?.source===`requirement`)return{enabledBy:e.profile??`the active profile`}}return{enabledBy:void 0}}var sV={user:ST,project:Zu,nerve:$u,agentBrowser:Gn},cV=e=>e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`);function lV(e){return e===`subagents`?`sub-agents`:e}var uV=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get props(){return this.#e()}#n=L(()=>{let e=this.props.configuration?.overrides;return{tools:Object.keys(e?.tools??{}).filter(e=>e!==`subagents`).length,skills:Object.values(e?.skills??{}).reduce((e,t)=>e+Object.keys(t).length,0),mcp:Object.keys(e?.mcpServers?.servers??{}).length,subagents:Object.keys(e?.subagents??{}).length+Number(e?.tools?.subagents!==void 0)}});get overrideCounts(){return t(this.#n)}set overrideCounts(e){B(this.#n,e)}#r=L(()=>this.overrideCounts.tools+this.overrideCounts.skills+this.overrideCounts.mcp+this.overrideCounts.subagents);get overrideCount(){return t(this.#r)}set overrideCount(e){B(this.#r,e)}#i=L(()=>{let{configuration:e,skills:t=[]}=this.props,n=e?.resolution.settings.skills;return`${t.filter(e=>{let t=ua(e.source);return(n?.[t]?.[e.name]??n?.defaults?.[t]??!1)===!0}).length}/${t.length}`});#a=L(()=>{let{configuration:e,onPatch:t}=this.props,n=e?.resolution.settings.tools;if(!n||!(`subagents`in n))return;let r=[`subagents`],i=n.subagents,a=aV(r,e.overrides,e.resolution.provenance);return{key:`subagents`,label:`Delegation`,group:`Built-in`,enabled:!!i&&`enabled`in i&&i.enabled===!0,overridden:a.length>0,lockedBy:oV(r,e.resolution.provenance).enabledBy,toggle:e=>t?.({tools:{subagents:{enabled:e}}}),reset:()=>t?.({},a)}});get delegationRow(){return t(this.#a)}set delegationRow(e){B(this.#a,e)}#o=L(()=>{let{configuration:e,skills:t=[],onPatch:n}=this.props;return Qi(t).map(t=>{let r=ua(t.source),i=`/skills/${r}/${cV(t.name)}`,a=e?.resolution.provenance[i]??e?.resolution.provenance[`/skills/defaults/${r}`];return{key:`${r}:${t.name}`,label:t.name,group:{user:`User`,project:`Project`,nerve:`Nerve`,agentBrowser:`Agent Browser`}[t.source],keywords:[t.source],enabled:e?.resolution.settings.skills?.[r]?.[t.name]??e?.resolution.settings.skills?.defaults?.[r]??!1,overridden:e?.overrides.skills?.[r]?.[t.name]!==void 0&&a?.source!==`requirement`,icon:sV[t.source],lockedBy:a?.source===`requirement`?a.profile:void 0,toggle:e=>n?.({skills:{[r]:{[t.name]:e}}}),reset:()=>n?.({},[`/overrides${i}`])}})});get skillRows(){return t(this.#o)}set skillRows(e){B(this.#o,e)}#s=L(()=>{let{configuration:e,subagentProfiles:t=[],subagentControlsEnabled:n=!1,onPatch:r}=this.props;return t.map(t=>{let i=e?.resolution.provenance[`/subagents/${cV(t.name)}/enabled`];return{key:t.name,label:t.label,group:`Sub-agents`,detail:t.whenToUse,keywords:t.whenToUse?[t.whenToUse]:void 0,enabled:ZB(t,e?.resolution.settings.subagents),overridden:!!e?.overrides.subagents?.[t.name],warning:t.error,unavailable:!!t.error||!n,muted:!!t.error||this.delegationRow?.enabled===!1,lockedBy:i?.source===`requirement`?i.profile:void 0,resetLabel:`Reset ${t.label} launch choices; requirements remain effective`,configure:()=>this.openSettings(`subagents`),toggle:e=>r?.({subagents:{[t.name]:{enabled:e}}}),reset:()=>r?.({},[`/overrides/subagents/${cV(t.name)}`])}})});get subagentRows(){return t(this.#s)}set subagentRows(e){B(this.#s,e)}#c=L(()=>{let{configuration:e,subagentProfiles:n}=this.props,r=n?QB(n,e?.resolution.settings.subagents):void 0;return[{kind:`skills`,title:`Skills`,icon:To,count:t(this.#i)},{kind:`subagents`,title:`Sub-agents`,icon:_d,count:r?`${r.available}/${r.total}`:void 0}]});get sections(){return t(this.#c)}set sections(e){B(this.#c,e)}rows(e){return e===`skills`?this.skillRows:this.subagentRows}rowDisabled(e){let{disabled:t=!1,loading:n=!1}=this.props;return t||n||!!e.lockedBy||!!e.unavailable}toggleRow(e){this.rowDisabled(e)||e.toggle(!e.enabled)}openSettings(e){this.#t(),this.props.onOpenSettings?.(lV(e))}},dV=new Set([`$$slots`,`$$events`,`$$legacy`]),fV=O(`<span class="composer-badge-dot absolute -top-1 -right-1.5" aria-hidden="true"></span>`),pV=O(`<span><!> <!></span>`);function mV(e,n){c(n,!0);let r=V(n,dV),i=Y(!1),a=Y(`skills`),o=new uV(()=>r,()=>B(i,!1));W(()=>{n.disabled&&B(i,!1)});var s=f(),u=R(s);v(u,17,()=>o.sections,e=>e.kind,(e,r)=>{{let s=e=>{var i=pV(),a=q(i);H(a,()=>t(r).icon,(e,t)=>{t(e,{"aria-hidden":`true`})});var s=G(a,2),c=e=>{var t=fV();k(e,t)};l(s,e=>{o.overrideCounts[t(r).kind]>0&&e(c)}),x(i),F(()=>{X(i,1,`relative inline-flex items-center ${n.disabled?`opacity-60`:``}`),J(i,`data-tour-id`,`composer-${t(r).kind}`)}),k(e,i)},c=L(()=>t(i)&&t(a)===t(r).kind),u=L(()=>n.error?`${t(r).title} unavailable: ${n.error}`:`${t(r).title}${t(r).count?` (${t(r).count})`:``}`);dc(e,{get open(){return t(c)},onOpenChange:e=>{e?(B(a,t(r).kind,!0),B(i,!n.disabled)):t(a)===t(r).kind&&B(i,!1)},size:`md`,triggerClass:`composer-tab w-control p-0`,get ariaLabel(){return t(r).title},get triggerTitle(){return t(u)},side:`top`,align:`start`,presentation:`adaptive`,trigger:s,children:(e,n)=>{XB(e,{get capabilities(){return o},get kind(){return t(r).kind}})},$$slots:{trigger:!0,default:!0}})}}),k(e,s),D()}var hV=O(`<!> <!>`,1),gV=O(`<p class="px-1.5 text-muted-foreground"> </p>`),_V=O(`<p class="px-1.5 text-warning"> </p>`),vV=O(`<span class="flex-none text-muted-foreground">Unavailable</span>`),yV=O(`<!> <!> <!>`,1);function bV(e,n){c(n,!0);let r=K(n,`loading`,3,!1),i=K(n,`disabled`,3,!1);le(()=>n.onRefresh?.());let a=L(()=>n.permissionRuleSets.map(e=>({...e,key:e.id,label:e.name,detail:e.description,group:e.source===`builtin`?`Built-in`:`Custom`})));var o=yV(),s=R(o);fc(s,{title:`Permissions`,get onBack(){return n.onBack},actions:e=>{var i=hV(),a=R(i);Q(a,{size:`icon`,variant:`ghost`,get disabled(){return r()},ariaLabel:`Refresh permission rule sets`,title:`Refresh permission rule sets`,onclick:()=>n.onRefresh?.(),children:(e,n)=>{{let n=L(()=>`size-3.5 ${r()?`animate-spin`:``}`);cr(e,{get class(){return t(n)},"aria-hidden":`true`})}},$$slots:{default:!0}});var o=G(a,2);Q(o,{size:`icon`,variant:`ghost`,ariaLabel:`Open permission settings`,title:`Open permission settings`,onclick:()=>n.onOpenSettings?.(),children:(e,t)=>{Xc(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}}),k(e,i)},$$slots:{actions:!0}});var u=G(s,2),d=e=>{vc(e,{children:(e,t)=>{var r=yV(),i=R(r),a=e=>{var t=gV(),r=z(t);F(()=>w(r,`Locked by ${n.lockedBy??``}.`)),k(e,t)};l(i,e=>{n.lockedBy&&e(a)});var o=G(i,2),s=e=>{var t=_V(),r=z(t,!0);F(()=>w(r,n.error)),k(e,t)};l(o,e=>{n.error&&e(s)});var c=G(o,2),u=e=>{Kc(e,{get label(){return n.activePermission.name},get title(){return n.activePermission.description},selected:!0,disabled:!0,trailing:e=>{var t=vV();k(e,t)},$$slots:{trailing:!0}})};l(c,e=>{n.activePermission.available||e(u)}),k(e,r)},$$slots:{default:!0}})};l(u,e=>{(n.lockedBy||n.error||!n.activePermission.available)&&e(d)});var p=G(u,2);sc(p,{get items(){return t(a)},ariaLabel:`Permission rule sets`,placeholder:`Search permissions`,isSelected:e=>e.id===n.activePermission.id,isDisabled:()=>i()||!!n.lockedBy,onChoose:e=>n.onSelect(e.id),icon:(e,n=m)=>{let r=L(()=>uB(n().id));var i=f(),a=R(i);H(a,()=>t(r),(e,t)=>{t(e,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`})}),k(e,i)},$$slots:{icon:!0}}),k(e,o),D()}var xV=O(`<span> </span>`),SV=O(`<span data-tour-id="composer-permission"><!> <!></span>`);function CV(e,n){c(n,!0);let r=K(n,`loading`,3,!1),i=K(n,`controlsDisabled`,3,!1),a=Y(!1),o=L(()=>uB(n.activePermission.id)),s=L(()=>n.activePermission.id!=="default");function u(e){e!==n.activePermission.id&&n.onChange?.(e),B(a,!1)}{let c=e=>{var r=SV(),a=q(r);H(a,()=>t(o),(e,t)=>{t(e,{"aria-hidden":`true`})});var c=G(a,2),u=e=>{var t=xV(),r=z(t,!0);F(()=>w(r,n.activePermission.name)),k(e,t)};l(c,e=>{t(s)&&e(u)}),x(r),F(()=>X(r,1,`inline-flex items-center justify-center gap-1 ${i()?`opacity-60`:``}`)),k(e,r)},d=L(()=>`${n.activePermission.id}:${t(s)?n.activePermission.name:``}`),f=L(()=>`composer-tab ${t(s)?``:`w-control p-0`}`),p=L(()=>`Permission rule set: ${n.activePermission.name}${n.shortcut?` (${n.shortcut})`:``}${n.lockedBy?` · Locked by ${n.lockedBy}`:``}`);dc(e,{get triggerWidthKey(){return t(d)},size:`lg`,get triggerClass(){return t(f)},ariaLabel:`Permission rule set`,get triggerTitle(){return t(p)},get triggerAriaKeyShortcuts(){return n.shortcutAria},side:`top`,align:`start`,presentation:`adaptive`,get open(){return t(a)},set open(e){B(a,e,!0)},trigger:c,children:(e,t)=>{bV(e,{get activePermission(){return n.activePermission},get permissionRuleSets(){return n.permissionRuleSets},get loading(){return r()},get error(){return n.error},get lockedBy(){return n.lockedBy},get disabled(){return i()},onSelect:u,get onRefresh(){return n.onRefresh},onOpenSettings:()=>{B(a,!1),n.onOpenSettings?.()}})},$$slots:{trigger:!0,default:!0}})}D()}var wV=new Set([`$$slots`,`$$events`,`$$legacy`]),TV=O(`<span class="composer-badge-dot" role="img" aria-label="Changed for this conversation"></span>`),EV=O(`<span> </span>`),DV=O(`<span class="flex items-center gap-1.5"><!> <!> <!></span>`),OV=O(`<span class="composer-badge-dot absolute -top-1 -right-1.5" aria-hidden="true"></span>`),kV=O(`<span data-tour-id="composer-settings"><!> <!></span>`),AV=O(`<!> <!> <!>`,1),jV=O(`<!> <!>`,1);function MV(e,n){c(n,!0);let r=(e,n=m,r=m,i=m,o=m,s)=>{let c=ve(()=>u(s?.(),()=>({}),!0));Kc(e,{get label(){return n()},get disabled(){return t(c).disabled},onclick:()=>B(a,o(),!0),icon:e=>{var n=f(),i=R(n);{let e=L(()=>`size-3.5 flex-none ${t(c).warn?`text-warning`:`text-muted-foreground`}`);H(i,r,(n,r)=>{r(n,{get class(){return t(e)},"aria-hidden":`true`})})}k(e,n)},trailing:e=>{var n=DV(),r=q(n),a=e=>{var t=TV();k(e,t)};l(r,e=>{t(c).dot&&e(a)});var o=G(r,2),s=e=>{var n=EV(),r=z(n,!0);F(()=>{X(n,1,`max-w-[12rem] truncate ${t(c).warn?`text-warning`:`text-muted-foreground`}`),w(r,i())}),k(e,n)};l(o,e=>{i()&&e(s)});var u=G(o,2);mn(u,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`}),x(n),k(e,n)},$$slots:{icon:!0,trailing:!0}})};V(n,wV);let i=Y(!1),a=Y(`root`),o=new uV(()=>n.capability,()=>B(i,!1)),s=L(()=>n.agentProfiles.find(e=>e.name===n.agentProfile)??{name:n.agentProfile,label:n.agentProfile}),d=L(()=>n.activePermission.id!=="default"),p=L(()=>o.overrideCount>0||t(d)),h=L(()=>lB(n.agentProfile)),g=L(()=>uB(n.activePermission.id));function _(){B(a,`root`)}dc(e,{onOpenChange:e=>{e&&B(a,`root`)},size:`lg`,triggerClass:`composer-tab w-control p-0`,ariaLabel:`Conversation settings`,triggerTitle:`Conversation settings`,side:`top`,align:`start`,presentation:`adaptive`,get open(){return t(i)},set open(e){B(i,e,!0)},trigger:e=>{var r=kV(),i=q(r);vd(i,{"aria-hidden":`true`});var a=G(i,2),o=e=>{var t=OV();k(e,t)};l(a,e=>{t(p)&&e(o)}),x(r),F(()=>X(r,1,`relative inline-flex items-center ${n.controlsDisabled?`opacity-60`:``}`)),k(e,r)},children:(e,c)=>{{let c=L(()=>t(a)===`root`?`back`:`forward`);xc(e,{get key(){return t(a)},get direction(){return t(c)},children:(e,c)=>{var u=f(),p=R(u),m=e=>{var i=jV(),a=R(i);fc(a,{title:`Conversation settings`,actions:e=>{var r=f(),i=R(r),a=e=>{{let r=L(()=>`Reset all ${o.overrideCount} conversation capability override${o.overrideCount===1?``:`s`}`),i=L(()=>n.capability.disabled||n.capability.loading);Q(e,{size:`icon-sm`,variant:`ghost`,ariaLabel:`Reset all conversation capability overrides`,get title(){return t(r)},get disabled(){return t(i)},onclick:()=>n.capability.onReset?.(),children:(e,t)=>{zn(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}};l(i,e=>{o.overrideCount>0&&e(a)}),k(e,r)},$$slots:{actions:!0}});var c=G(a,2);vc(c,{class:`gap-0.5`,children:(e,i)=>{var a=AV(),c=R(a),u=e=>{r(e,()=>`Agent profile`,()=>t(h),()=>t(s).label,()=>`profile`)};l(c,e=>{n.agentProfiles.length>0&&e(u)});var f=G(c,2);r(f,()=>`Permissions`,()=>t(g),()=>n.activePermission.name,()=>`permission`,()=>({warn:t(d)}));var p=G(f,2);v(p,17,()=>o.sections,e=>e.kind,(e,i)=>{r(e,()=>t(i).title,()=>t(i).icon,()=>n.capability.error?`Unavailable`:t(i).count,()=>t(i).kind,()=>({dot:o.overrideCounts[t(i).kind]>0}))}),k(e,a)},$$slots:{default:!0}}),k(e,i)},y=e=>{{let r=L(()=>n.controlsDisabled||n.profileDisabled),a=L(()=>n.onReviewAgentProfile?e=>{B(i,!1),n.onReviewAgentProfile?.(e)}:void 0);mB(e,{get agentProfiles(){return n.agentProfiles},get agentProfile(){return n.agentProfile},get pendingProfiles(){return n.pendingAgentProfiles},get disabled(){return t(r)},onBack:_,get onReview(){return t(a)},onSelect:e=>{e!==n.agentProfile&&n.onAgentProfileChange?.(e),_()}})}},b=e=>{bV(e,{get activePermission(){return n.activePermission},get permissionRuleSets(){return n.permissionRuleSets},get loading(){return n.permissionLoading},get error(){return n.permissionError},get lockedBy(){return n.permissionLockedBy},get disabled(){return n.controlsDisabled},onBack:_,onSelect:e=>{e!==n.activePermission.id&&n.onPermissionChange?.(e),_()},get onRefresh(){return n.onRefreshPermissions},onOpenSettings:()=>{B(i,!1),n.onOpenPermissionSettings?.()}})},x=e=>{XB(e,{get capabilities(){return o},get kind(){return t(a)},onBack:_})};l(p,e=>{t(a)===`root`?e(m):t(a)===`profile`?e(y,1):t(a)===`permission`?e(b,2):e(x,-1)}),k(e,u)},$$slots:{default:!0}})}},$$slots:{trigger:!0,default:!0}}),D()}var NV=O(`<span class="contents @max-[480px]/composer-toolbar:hidden"><input type="file" multiple="" class="hidden" tabindex="-1" aria-hidden="true"/> <!> <span class="mx-0.5 h-4 w-px flex-none bg-border" aria-hidden="true"></span></span>`),PV=O(`<!> <span class="contents @max-[480px]/composer-toolbar:hidden"><!></span> <!> <!> <span class="contents @max-[480px]/composer-toolbar:hidden"><!></span> <span class="contents @max-[480px]/composer-toolbar:hidden"><!></span> <span class="hidden @max-[480px]/composer-toolbar:contents"><!></span> <span class="ml-auto"></span> <!> <!>`,1);function FV(e,n){c(n,!0);let r=K(n,`pendingAgentProfiles`,19,()=>[]),i=K(n,`lockedFields`,19,()=>({})),a=K(n,`permissionRuleSetsLoading`,3,!1),o=K(n,`compacting`,3,!1),s=K(n,`compactDisabled`,3,!1),u=K(n,`capabilitySkills`,19,()=>[]),d=K(n,`capabilityLoading`,3,!1),f=K(n,`subagentControlsEnabled`,3,!1),p=K(n,`capabilityDisabled`,19,()=>n.controlsDisabled),m=K(n,`attachDisabled`,3,!1),_=K(n,`historyOpen`,3,!1),v=L(()=>`${_()?`Back to conversation`:`History`}${n.historyShortcut?` (${n.historyShortcut})`:``}`),b=L(()=>n.permissionRuleSets.find(e=>e.id===n.permissionRuleSetId)??{id:n.permissionRuleSetId,name:n.permissionRuleSetId,description:`This rule set is unavailable.`,source:`user`,enabled:!1,available:!1}),S=L(()=>i().permission?i().by??`the applied profile`:void 0),T=L(()=>i().model||i().thinking?`Locked by ${n.agentProfiles.find(e=>e.name===i().by)?.label??i().by}`:void 0),E=L(()=>({configuration:n.capabilityConfiguration,subagentControlsEnabled:f(),subagentProfiles:n.capabilitySubagentProfiles,skills:u(),loading:d(),error:n.capabilityError,disabled:p(),onPatch:n.onCapabilityPatch,onReset:n.onResetCapabilities,onRefresh:n.onRefreshCapabilities,onOpenSettings:n.onOpenCapabilitySettings})),O=Y(null);var A=PV(),j=R(A),M=e=>{var r=NV(),i=q(r);te(i,e=>B(O,e),()=>t(O));var a=G(i,2);{let e=L(()=>n.attachShortcut?`Attach images or files (${n.attachShortcut}) — or paste / drop them`:`Attach images or files — or paste / drop them`);Q(a,{variant:`ghost`,size:`icon`,type:`button`,get disabled(){return m()},ariaLabel:`Attach images or files`,get title(){return t(e)},"data-tour-id":`composer-attach`,onclick:()=>t(O)?.click(),children:(e,t)=>{uie(e,{})},$$slots:{default:!0}})}y(2),x(r),h(`change`,i,e=>{let t=[...e.currentTarget.files??[]];t.length&&n.onAttachFiles(t),e.currentTarget.value=``}),k(e,r)};l(j,e=>{n.onAttachFiles&&e(M)});var N=G(j,2),I=q(N);C(I,()=>n.capabilityScopeKey,e=>{gB(e,{get agentProfiles(){return n.agentProfiles},get agentProfile(){return n.agentProfile},get pendingProfiles(){return r()},get onReview(){return n.onReviewAgentProfile},get disabled(){return n.profileDisabled},get controlsDisabled(){return n.controlsDisabled},get shortcut(){return n.profileShortcut},get shortcutAria(){return n.profileShortcutAria},get onChange(){return n.onAgentProfileChange}})}),x(N);var ee=G(N,2);C(ee,()=>n.capabilityScopeKey,e=>{oB(e,{get models(){return n.models},get selectedModelKey(){return n.selectedModelKey},get thinkingLevel(){return n.thinkingLevel},get emptyMessage(){return n.modelEmptyMessage},get disabled(){return n.modelDisabled},get modelLocked(){return i().model},get thinkingLocked(){return i().thinking},get lockReason(){return t(T)},get onChange(){return n.onModelSelectionChange}})});var ne=G(ee,2),re=e=>{be(e,{variant:`destructive`,title:`The model does not support the configured reasoning level. Review the controlling profile or choose a compatible pair.`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.capabilityConfiguration.resolution.provenance[`/reasoningLevel`]?.source===`requirement`?`Requirement conflict`:`Reasoning conflict`)),k(e,r)},$$slots:{default:!0}})},z=L(()=>n.capabilityConfiguration?.resolution.diagnostics.some(e=>e.code===`unsupported-reasoning`));l(ne,e=>{t(z)&&e(re)});var ie=G(ne,2),ae=q(ie);C(ae,()=>n.capabilityScopeKey,e=>{CV(e,{get activePermission(){return t(b)},get permissionRuleSets(){return n.permissionRuleSets},get loading(){return a()},get error(){return n.permissionRuleSetsError},get lockedBy(){return t(S)},get controlsDisabled(){return n.controlsDisabled},get shortcut(){return n.permissionShortcut},get shortcutAria(){return n.permissionShortcutAria},get onChange(){return n.onPermissionRuleSetChange},get onRefresh(){return n.onRefreshPermissionRuleSets},get onOpenSettings(){return n.onOpenPermissionSettings}})}),x(ie);var V=G(ie,2),oe=q(V);C(oe,()=>n.capabilityScopeKey,e=>{mV(e,P(()=>t(E),{get lockedFields(){return i()}}))}),x(V);var se=G(V,2),H=q(se);C(H,()=>n.capabilityScopeKey,e=>{MV(e,{get agentProfiles(){return n.agentProfiles},get agentProfile(){return n.agentProfile},get pendingAgentProfiles(){return r()},get onReviewAgentProfile(){return n.onReviewAgentProfile},get profileDisabled(){return n.profileDisabled},get controlsDisabled(){return n.controlsDisabled},get onAgentProfileChange(){return n.onAgentProfileChange},get activePermission(){return t(b)},get permissionRuleSets(){return n.permissionRuleSets},get permissionLoading(){return a()},get permissionError(){return n.permissionRuleSetsError},get permissionLockedBy(){return t(S)},get onPermissionChange(){return n.onPermissionRuleSetChange},get onRefreshPermissions(){return n.onRefreshPermissionRuleSets},get onOpenPermissionSettings(){return n.onOpenPermissionSettings},get capability(){return t(E)}})}),x(se);var ce=G(se,4),U=e=>{{let r=L(()=>_()?``:void 0);Q(e,{variant:`ghost`,size:`icon`,type:`button`,get"aria-pressed"(){return _()},get"data-active"(){return t(r)},ariaLabel:`History`,get title(){return t(v)},get onclick(){return n.onToggleHistory},children:(e,t)=>{rd(e,{})},$$slots:{default:!0}})}};l(ce,e=>{n.onToggleHistory&&e(U)}),VB(G(ce,2),{get session(){return n.session},get contextActions(){return n.contextActions},get contextUsage(){return n.contextUsage},get conversationUsage(){return n.conversationUsage},get agentUsage(){return n.agentUsage},get agentUsageLoading(){return n.agentUsageLoading},get agentUsageError(){return n.agentUsageError},get onUsageOpenChange(){return n.onUsageOpenChange},get onUsageRetry(){return n.onUsageRetry},get contextWindow(){return n.contextWindow},get compacting(){return o()},get compactDisabled(){return s()},get onCompact(){return n.onCompact},get onOpenRequestPreview(){return n.onOpenRequestPreview}}),k(e,A),D()}ue([`change`]);var IV=O(`<p class="flex items-center gap-1 text-ui text-muted-foreground"> </p>`),LV=O(`<!> `,1),RV=O(`<div class="pointer-events-none absolute inset-0 flex items-center justify-center" data-testid="composer-editor-overlay"><!></div>`),zV=O(`<div class="relative"><!> <!></div>`);function BV(e,r){c(r,!0);let i=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.header),k(e,t)},o=e=>{var t=IV(),n=z(t,!0);F(()=>w(n,r.model.hint)),k(e,t)};l(i,e=>{r.header?e(a):r.model.hint&&e(o,1)}),k(e,t)},a=e=>{{let n=L(()=>r.model.profileDisabled??t(d)),i=L(()=>r.model.modelDisabled??(t(d)||r.model.models.length===0)),a=L(()=>r.model.contextWindow??0),o=L(()=>t(d)||!r.actions.onCompact),s=L(()=>r.model.modelEmptyMessage??`No models available. Configure a provider in this host.`),c=L(()=>r.model.capabilityDisabled??t(h)),l=L(()=>u?void 0:t(S));FV(e,{get controlsDisabled(){return t(h)},get profileDisabled(){return t(n)},get agentProfile(){return r.model.agentProfile},get agentProfiles(){return r.model.agentProfiles},get pendingAgentProfiles(){return r.model.pendingAgentProfiles},get onReviewAgentProfile(){return r.actions.onReviewAgentProfile},get lockedFields(){return r.model.lockedFields},get modelDisabled(){return t(i)},get session(){return r.model.session},get contextActions(){return r.model.contextActions},get onAgentProfileChange(){return r.actions.onAgentProfileChange},get permissionRuleSetId(){return r.model.permissionRuleSetId},get permissionRuleSets(){return r.model.permissionRuleSets},get permissionRuleSetsLoading(){return r.model.permissionRuleSetsLoading},get permissionRuleSetsError(){return r.model.permissionRuleSetsError},get permissionShortcut(){return r.model.permissionShortcut},get permissionShortcutAria(){return r.model.permissionShortcutAria},get profileShortcut(){return r.model.profileShortcut},get profileShortcutAria(){return r.model.profileShortcutAria},get contextUsage(){return r.model.contextUsage},get conversationUsage(){return r.model.conversationUsage},get agentUsage(){return r.model.agentUsage},get agentUsageLoading(){return r.model.agentUsageLoading},get agentUsageError(){return r.model.agentUsageError},get onUsageOpenChange(){return r.actions.onUsageOpenChange},get onUsageRetry(){return r.actions.onUsageRetry},get contextWindow(){return t(a)},get compacting(){return r.model.compacting},get compactDisabled(){return t(o)},get onCompact(){return r.actions.onCompact},get onOpenRequestPreview(){return r.actions.onOpenRequestPreview},get models(){return r.model.models},get selectedModelKey(){return r.model.selectedModelKey},get thinkingLevel(){return r.model.thinkingLevel},get modelEmptyMessage(){return t(s)},get onModelSelectionChange(){return r.actions.onModelSelectionChange},get onPermissionRuleSetChange(){return r.actions.onPermissionRuleSetChange},get onRefreshPermissionRuleSets(){return r.actions.onRefreshPermissionRuleSets},get onOpenPermissionSettings(){return r.actions.onOpenPermissionSettings},get onOpenCapabilitySettings(){return r.actions.onOpenCapabilitySettings},get capabilityConfiguration(){return r.model.capabilityConfiguration},get capabilitySkills(){return r.model.capabilitySkills},get capabilityLoading(){return r.model.capabilityLoading},get capabilityDisabled(){return t(c)},get capabilityError(){return r.model.capabilityError},get capabilityScopeKey(){return r.model.capabilityScopeKey},get subagentControlsEnabled(){return r.model.subagentControlsEnabled},get capabilitySubagentProfiles(){return r.model.capabilitySubagentProfiles},get onCapabilityPatch(){return r.actions.onCapabilityPatch},get onResetCapabilities(){return r.actions.onResetCapabilities},get onRefreshCapabilities(){return r.actions.onRefreshCapabilities},get onAttachFiles(){return t(l)},get attachDisabled(){return t(p)},get onToggleHistory(){return r.actions.onToggleHistory},get historyOpen(){return r.model.historyOpen},get historyShortcut(){return r.model.historyShortcut}})}},o=e=>{var n=zV(),i=q(n);{let e=L(()=>r.model.focusToken??0),n=L(()=>!u),a=L(()=>({profile:r.model.agentProfile,profiles:r.model.agentProfiles,pendingProfiles:r.model.pendingAgentProfiles,running:!!(r.model.showStop??r.model.sending)}));LR(i,{get value(){return r.model.text},get disabled(){return t(p)},get placeholder(){return t(g)},get slashCompletions(){return r.model.slashCompletions},get completionSource(){return r.model.completionSource},get focusToken(){return t(e)},get enterSends(){return t(n)},get onChange(){return r.actions.onComposerChange},onSubmit:C,onReady:y,get slashContext(){return t(a)},get onSlashCommand(){return r.actions.onSlashCommand},get onCompletionAction(){return r.actions.onCompletionAction},get onPasteImage(){return r.actions.onPasteImage},get onDropFiles(){return r.actions.onDropFiles},get onReadClipboardText(){return r.actions.onReadClipboardText},get onWriteClipboardText(){return r.actions.onWriteClipboardText},get onClipboardError(){return r.actions.onClipboardError}})}var a=G(i,2),o=e=>{let n=L(()=>r.model.editorOverlay);var i=RV(),a=q(i);Q(a,{type:`button`,class:`pointer-events-auto`,get title(){return t(n).message},get onclick(){return t(n).onAction},children:(e,r)=>{var i=LV(),a=R(i);Ol(a,{});var o=G(a);F(()=>w(o,` ${t(n).actionLabel??``}`)),k(e,i)},$$slots:{default:!0}}),x(i),k(e,i)};l(a,e=>{r.model.editorOverlay&&e(o)}),x(n),k(e,n)},s=e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.sendLeading),k(e,t)};l(i,e=>{r.sendLeading&&e(a)}),k(e,t)},u=io(),d=L(()=>!!(r.model.disabled||r.model.compacting)),p=L(()=>!!r.model.editorOverlay||(r.model.editorDisabled??t(d))),m=L(()=>!!r.model.editorOverlay||(r.model.submitDisabled??!!t(d))),h=L(()=>r.model.controlsDisabled??(t(d)||!!r.model.sending)),g=L(()=>r.model.placeholder??(t(d)?`Composer is unavailable right now`:r.model.sending?`Queue a prompt for the next agent turn`:`Ask the agent`)),_=L(()=>r.model.sendTitle??(r.model.sending?`Queue prompt for the next agent turn`:`Send prompt`)),v=Y(void 0);function y(e){B(v,e,!0),r.actions.onEditorReady?.(e)}async function b(e){let n=r.actions.onAttachFile;if(!n||!t(v))return;let i=(await Promise.allSettled(e.map(e=>n(e)))).flatMap((t,n)=>t.status===`fulfilled`?[cA(t.value,e[n].type.startsWith(`image/`)?`image`:void 0)]:[]);i.length>0&&t(v).insertReferences(i)}let S=L(()=>r.actions.onAttachFile&&t(v)?e=>void b(e):void 0);function C(){t(m)||r.actions.onSubmit?.()}var T=f(),E=R(T),O=e=>{{let n=L(()=>r.model.showStop??r.model.sending),c=L(()=>!r.actions.onAbort||r.model.stopping),l=L(()=>r.model.sendAriaLabel??`Send prompt`);KR(e,{get agentProfile(){return r.model.agentProfile},get pendingApproval(){return r.model.pendingApproval},get pendingQuestion(){return r.model.pendingQuestion},get pendingPlan(){return r.model.pendingPlan},get showStop(){return t(n)},get stopping(){return r.model.stopping},get stopDisabled(){return t(c)},get stopAriaLabel(){return r.model.stopAriaLabel},get stopShortcutAria(){return r.model.stopShortcutAria},get stopTitle(){return r.model.stopTitle},get submitDisabled(){return t(m)},get sendAriaLabel(){return t(l)},get sendTitle(){return t(_)},get onAbort(){return r.actions.onAbort},onSubmit:C,get onGoToQuestion(){return r.actions.onGoToQuestion},get header(){return i},get toolbar(){return a},get editor(){return o},get sendLeading(){return s},get onAttachFiles(){return t(S)},get attachDisabled(){return t(p)}})}},A=e=>{{let n=L(()=>r.model.showStop??r.model.sending),c=L(()=>!r.actions.onAbort||r.model.stopping),l=L(()=>r.model.sendAriaLabel??`Send prompt`);VR(e,{get agentProfile(){return r.model.agentProfile},get pendingApproval(){return r.model.pendingApproval},get pendingQuestion(){return r.model.pendingQuestion},get pendingPlan(){return r.model.pendingPlan},get showStop(){return t(n)},get stopping(){return r.model.stopping},get stopDisabled(){return t(c)},get stopAriaLabel(){return r.model.stopAriaLabel},get stopShortcutAria(){return r.model.stopShortcutAria},get stopTitle(){return r.model.stopTitle},get submitDisabled(){return t(m)},get sendAriaLabel(){return t(l)},get sendTitle(){return t(_)},get onAbort(){return r.actions.onAbort},onSubmit:C,get onGoToQuestion(){return r.actions.onGoToQuestion},get header(){return i},get toolbar(){return a},get editor(){return o},get sendLeading(){return s}})}};l(E,e=>{u?e(O):e(A,-1)}),k(e,T),D()}var VV=O(`<div class="grid min-h-0 min-w-0"><!></div> <!> <div class="min-w-0"><!></div>`,1),HV=O(`<section class="relative grid h-full min-h-0 grid-rows-[minmax(0,1fr)_auto] bg-background"><!></section>`);function UV(e,r){c(r,!0);let i=K(r,`composerWrapRef`,15),a=Y(void 0),o=Y(0),s=Y(0);W(()=>{let e=t(a);if(!e)return;let n=()=>{B(o,e.clientHeight,!0);let t=e.querySelector(`.virtual-scroller-viewport`);B(s,t?t.offsetWidth-t.clientWidth:0,!0)},r=new ResizeObserver(n),i=requestAnimationFrame(n);return n(),r.observe(e),()=>{cancelAnimationFrame(i),r.disconnect()}});var u=HV();let d;var p=q(u),m=e=>{var o=VV(),s=R(o),c=q(s);n(c,()=>r.transcript),x(s),te(s,e=>B(a,e),()=>t(a));var u=G(s,2),d=e=>{var t=f(),i=R(t);n(i,()=>r.announcer),k(e,t)};l(u,e=>{r.announcer&&e(d)});var p=G(u,2),m=q(p);n(m,()=>r.composer),x(p),te(p,e=>i(e),()=>i()),k(e,o)},h=e=>{var t=f(),i=R(t);n(i,()=>r.empty),k(e,t)};l(p,e=>{r.open?e(m):e(h,-1)}),x(u),F(()=>d=I(u,``,d,{"--conversation-activity-height":`${t(o)}px`,"--conversation-content-inset":`1.5rem`,"--conversation-scrollbar-lane":`${t(s)}px`})),k(e,u),D()}var WV=O(`<div class="grid min-h-0 min-w-0"><!></div> <!> <div class="min-w-0"><!></div>`,1),GV=O(`<section class="relative grid h-full min-h-0 grid-rows-[minmax(0,1fr)_auto] bg-background"><!></section>`);function KV(e,r){c(r,!0);let i=K(r,`composerWrapRef`,15),a=Y(0);var o=GV();let s;var u=q(o),d=e=>{var t=WV(),o=R(t),s=q(o);n(s,()=>r.transcript),x(o);var c=G(o,2),u=e=>{var t=f(),i=R(t);n(i,()=>r.announcer),k(e,t)};l(c,e=>{r.announcer&&e(u)});var d=G(c,2),p=q(d);n(p,()=>r.composer),x(d),te(d,e=>i(e),()=>i()),re(o,`clientHeight`,e=>B(a,e)),k(e,t)},p=e=>{var t=f(),i=R(t);n(i,()=>r.empty),k(e,t)};l(u,e=>{r.open?e(d):e(p,-1)}),x(o),F(()=>s=I(o,``,s,{"--conversation-activity-height":`${t(a)}px`,"--conversation-content-inset":`1rem`})),k(e,o),D()}function qV(e){return[...e??[]].sort().join(`\0`)}function JV(e,t){if(!e||!e.active||!t.active)return;let n=t.pendingApprovalCount??0;if(n>0&&(n!==(e.pendingApprovalCount??0)||t.pendingApprovalId!==e.pendingApprovalId))return n===1?`1 approval required.`:`${n} approvals required.`;let r=t.pendingQuestionIds?.length??0;if(r>0&&qV(t.pendingQuestionIds)!==qV(e.pendingQuestionIds))return r===1?`Nerve is waiting for your answer.`:`${r} answers required.`;let i=t.pendingPlanReviewIds?.length??0;if(i>0&&qV(t.pendingPlanReviewIds)!==qV(e.pendingPlanReviewIds))return i===1?`A plan is ready for review.`:`${i} plans are ready for review.`;if(t.sending&&!e.sending)return`Nerve is responding.`;if(!t.sending&&e.sending)return`Response complete.`}var YV=O(`<span> </span>`),XV=O(`<div class="sr-only" role="status" aria-live="polite" aria-atomic="true"><!></div>`);function ZV(e,n){c(n,!0);let r=Y(``),i=Y(0),a;W(()=>{let e={active:n.active,sending:n.sending,pendingApprovalId:n.pendingApprovalId,pendingApprovalCount:n.pendingApprovalCount,pendingQuestionIds:n.pendingQuestionIds,pendingPlanReviewIds:n.pendingPlanReviewIds},o=JV(a,e);a=e,o&&(B(r,o,!0),B(i,t(i)+1))});var o=XV(),s=q(o);C(s,()=>t(i),e=>{var n=YV(),i=z(n,!0);F(()=>w(i,t(r))),k(e,n)}),x(o),k(e,o),D()}var QV=O(`<span><!></span>`);function $V(e,t){c(t,!0);var n=QV();oA(q(n),{compact:!0,get label(){return t.label}}),x(n),F(e=>X(n,1,e,`svelte-o4k2yn`),[()=>T(ft(`nerve-badge inline-flex items-center justify-center rounded-lg bg-foreground text-background`,t.class))]),k(e,n),D()}var eH=O(`<span><!></span>`),tH=O(`<div class="relative" aria-hidden="true"><!> <!></div> <h2 class="mt-4 max-w-full truncate text-title font-semibold text-foreground"><span class="sr-only">Current project</span> </h2> <p class="mt-5 text-body text-foreground"> </p> <p class="mt-1 max-w-sm text-ui leading-relaxed text-muted-foreground"> </p>`,1),nH=O(`<div><div aria-hidden="true"></div> <div aria-hidden="true"></div> <!></div> <h2 class="mt-4 text-title text-foreground"> </h2> <p class="mt-2 max-w-sm text-ui leading-relaxed text-muted-foreground"> </p>`,1),rH=O(`<span class="sr-only">(default)</span>`),iH=O(`<button type="button" class="flex h-9 cursor-pointer items-center gap-2 rounded-lg border bg-card pr-3 pl-1.5 text-ui font-medium text-foreground shadow-sm transition-colors outline-none hover:border-primary-strong hover:bg-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-focus disabled:pointer-events-none disabled:opacity-50"><span class="grid size-6 place-items-center rounded-md bg-well" aria-hidden="true"><!></span> <!> <!></button>`),aH=O(`<span> </span>`),oH=O(`<div class="mt-5 grid grid-cols-2 gap-2 @min-[32rem]:grid-cols-4" role="group" aria-label="Start a conversation"></div> <div class="sr-only"></div> <p class="mt-3 text-caption text-muted-foreground" aria-hidden="true"> </p>`,1),sH=O(`<div class="absolute inset-x-0 top-full flex justify-center pt-6 pb-6 animate-in fade-in-0 duration-300 motion-reduce:animate-none"><button type="button" class="group flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-warning-strong bg-warning-subtle pr-2 pl-2.5 text-caption text-foreground transition-colors outline-none hover:bg-hover focus-visible:ring-3 focus-visible:ring-focus"><!> <span class="ml-1 flex items-center text-primary">Review <!></span></button></div>`),cH=O(`<div class="@container relative flex h-full min-h-full flex-col items-center overflow-x-hidden overflow-y-auto p-6 text-center"><div class="signal-field absolute inset-0 svelte-m1xxxa" aria-hidden="true"></div> <div class="relative my-auto flex w-full max-w-2xl flex-col items-center"><!> <!> <!></div></div>`);function lH(e,n){let r=d();c(n,!0);let i=K(n,`variant`,3,`conversation`),a=K(n,`starters`,19,()=>[]),o=K(n,`startersDisabled`,3,!1),s=L(()=>i()===`launchpad`),u=Y(void 0),f=L(()=>(t(u)??a().find(e=>e.profile===n.defaultStarter))?.tagline);var p=cH(),m=G(q(p),2),g=q(m),_=e=>{var r=tH(),i=R(r),a=q(i),o=e=>{{let r=L(()=>`rounded-xl shadow-sm ${t(s)?`size-16`:`size-14`}`);pr(e,{get projectId(){return n.projectId},get name(){return n.projectLabel},get class(){return t(r)}})}},c=e=>{var n=eH(),r=q(n);Zu(r,{class:`size-1/2`}),x(n),F(()=>X(n,1,`grid place-items-center rounded-xl border border-border-subtle bg-muted text-muted-foreground shadow-sm ${t(s)?`size-16`:`size-14`}`,`svelte-m1xxxa`)),k(e,n)};l(a,e=>{n.projectId?e(o):e(c,-1)}),$V(G(a,2),{class:`absolute -right-1.5 -bottom-1.5 size-6 rounded-md ring-2 ring-background`}),x(i);var u=G(i,2),d=G(q(u));x(u);var f=G(u,2),p=z(f,!0),m=G(f,2),h=z(m,!0);F(()=>{J(u,`title`,n.projectPath),w(d,` ${n.projectLabel??``}`),w(p,n.title),w(h,n.message)}),k(e,r)},y=e=>{var r=nH(),i=R(r),a=q(i),o=G(a,2),c=G(o,2);{let e=L(()=>t(s)?`relative z-10 size-12`:`relative z-10 size-9`);$V(c,{get class(){return t(e)}})}x(i);var l=G(i,2),u=z(l,!0),d=G(l,2),f=z(d,!0);F(()=>{X(i,1,`relative flex items-center justify-center ${t(s)?`size-20`:`size-14`}`,`svelte-m1xxxa`),X(a,1,`absolute rotate-6 rounded-lg border bg-muted ${t(s)?`size-16`:`size-12`}`,`svelte-m1xxxa`),X(o,1,`absolute -rotate-6 rounded-lg border border-border-subtle bg-background ${t(s)?`size-14`:`size-10`}`,`svelte-m1xxxa`),w(u,n.title),w(f,n.message)}),k(e,r)};l(g,e=>{n.projectLabel?e(_):e(y,-1)});var b=G(g,2),S=e=>{var i=oH(),s=R(i);v(s,21,a,e=>e.profile,(e,i)=>{let a=L(()=>t(i).icon);var s=iH(),c=q(s),d=q(c);H(d,()=>t(a),(e,t)=>{t(e,{class:`size-3.5 text-primary`})}),x(c);var f=G(c),p=G(f);{let e=L(()=>`size-3 fill-current text-primary ${t(i).profile===n.defaultStarter?``:`invisible`}`);mT(p,{get class(){return t(e)},"aria-hidden":`true`})}var m=G(p,2),g=e=>{var t=rH();k(e,t)};l(m,e=>{t(i).profile===n.defaultStarter&&e(g)}),x(s),F(()=>{s.disabled=o(),J(s,`aria-describedby`,`${r}-${t(i).profile}`),w(f,` ${t(i).label??``} `)}),h(`click`,s,()=>n.onSelectStarter?.(t(i))),M(`pointerenter`,s,()=>B(u,t(i),!0)),M(`pointerleave`,s,()=>B(u,void 0)),M(`focus`,s,()=>B(u,t(i),!0)),M(`blur`,s,()=>B(u,void 0)),k(e,s)}),x(s);var c=G(s,2);v(c,21,a,e=>e.profile,(e,n)=>{var i=aH(),a=z(i,!0);F(()=>{J(i,`id`,`${r}-${t(n).profile}`),w(a,t(n).tagline)}),k(e,i)}),x(c);var d=G(c,2),p=z(d,!0);F(()=>w(p,t(f)??`\xA0`)),k(e,i)};l(b,e=>{a().length>0&&e(S)});var C=G(b,2),T=e=>{var t=sH(),r=q(t),i=q(r);cd(i,{class:`size-3.5 text-warning`,"aria-hidden":`true`});var a=G(i),o=G(a),s=G(q(o));mn(s,{class:`size-3.5 transition-transform group-hover:translate-x-0.5 motion-reduce:transition-none`,"aria-hidden":`true`}),x(o),x(r),x(t),F(()=>w(a,` ${n.review.text??``} `)),h(`click`,r,function(...e){n.review.onOpen?.apply(this,e)}),k(e,t)};l(C,e=>{n.review&&e(T)}),x(m),x(p),k(e,p),D()}ue([`click`]);function uH(e){let n=Y(U(Date.now()));return W(()=>{let t=e();if(!(!t||t<=0))return B(n,Date.now(),!0),Mee(t,e=>B(n,e,!0))}),{get now(){return t(n)}}}var dH=O(`<span class="text-ui text-destructive" role="alert"> </span>`),fH=O(`<!>Review`,1),pH=O(`<!>Retry`,1),mH=O(`<!>Cancel`,1),hH=O(`<!> <!> <!> <!>`,1);function gH(e,n){c(n,!0);let r=Y(!1),i=Y(void 0);async function a(e){if(!t(r)&&n.onResolve){B(r,!0),B(i,void 0);try{await n.onResolve(e)}catch(e){B(i,e instanceof Error?e.message:String(e),!0)}finally{B(r,!1)}}}var o=hH(),s=R(o),u=e=>{var n=dH(),r=z(n,!0);F(()=>w(r,t(i))),k(e,n)};l(s,e=>{t(i)&&e(u)});var d=G(s,2),f=e=>{Q(e,{size:`sm`,get disabled(){return t(r)},get onclick(){return n.onReview},children:(e,t)=>{var n=fH(),r=R(n);cd(r,{class:`size-3.5`}),y(),k(e,n)},$$slots:{default:!0}})};l(d,e=>{n.onReview&&e(f)});var p=G(d,2);{let e=L(()=>n.onReview?`outline`:`default`),i=L(()=>t(r)||!n.onResolve);Q(p,{size:`sm`,get variant(){return t(e)},get disabled(){return t(i)},onclick:()=>a(`retry`),children:(e,n)=>{var i=pH(),a=R(i),o=e=>{dn(e,{class:`size-3.5`})},s=e=>{zn(e,{class:`size-3.5`})};l(a,e=>{t(r)?e(o):e(s,-1)}),y(),k(e,i)},$$slots:{default:!0}})}var m=G(p,2);{let e=L(()=>t(r)||!n.onResolve);Q(m,{size:`sm`,variant:`outline`,get disabled(){return t(e)},onclick:()=>a(`cancel`),children:(e,t)=>{var n=mH(),r=R(n);ye(r,{class:`size-3.5`}),y(),k(e,n)},$$slots:{default:!0}})}k(e,o),D()}var _H=`See Details`,vH=ga({agentId:Hi().optional(),name:Hi(),state:Li,outcome:qi.optional(),runId:Hi().optional()}).strict();ga({teammate:vH}).strict(),ga({teammate:vH,response:ga({text:Hi(),complete:Ni(),runId:Hi()}).strict().optional()}).strict(),ga({teammate:vH,runId:Hi()}).strict();var yH=260;function bH(e){return e.length===0?[]:(e.endsWith(`
40
+ `)?e.slice(0,-1):e).split(`
41
+ `)}function xH(e){return e===void 0?0:bH(e).length}function SH(e,t){if(e.length===0||t<=0)return t<=0?``:e;let n=e.endsWith(`
42
+ `)?e.length-1:e.length,r=t;for(let t=n-1;t>=0;--t)if(e.charCodeAt(t)===10&&(--r,r===0))return e.slice(t+1,n);return e}function CH(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e;if(typeof e==`string`&&e.trim().startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return{}}function wH(e){return typeof e==`string`?e:void 0}var TH=[`path`,`entries`,`matches`,`stdout`,`stderr`,`exitCode`];function EH(e){let t=CH(e).content;if(!Array.isArray(t))return;let n=t.flatMap(e=>{let t=CH(e);return t.type===`text`&&typeof t.text==`string`?[t.text]:[]});return n.length>0?n.join(`
43
+ `):void 0}function DH(e){let t=EH(e);if(t===void 0)return;let n={content:t},r=e.content;Array.isArray(r)&&(n.contentBlocks=r);let i=CH(e.details);for(let e of TH)i[e]!==void 0&&(n[e]=i[e]);return e.details!==void 0&&(n.details=e.details),n}var OH=sa.or(pa);function kH(e){let t=OH.safeParse(e);if(t.success)return t.data;let n=CH(e);if(Object.keys(n).length===0)return;let r=DH(n);if(r){let e=OH.safeParse(r);if(e.success)return e.data}let i=OH.safeParse(n);return i.success?i.data:void 0}function AH(e){let t=CH(e).contentBlocks;if(!Array.isArray(t))return;let n=t.flatMap(e=>{let t=CH(e);return t.type===`text`&&typeof t.text==`string`?[t.text]:[]});return n.length>0?n.join(`
44
+ `):void 0}function jH(e){let t=CH(e),n=wH(t.stdout),r=wH(t.stderr);if(n!==void 0||r!==void 0)return n?r?n.endsWith(`
45
+ `)?`${n}${r}`:`${n}\n${r}`:n.length>0?n:void 0:r&&r.length>0?r:void 0}function MH(e,t,n){return e?.content??AH(e)??AH(t)??jH(e)??jH(t)??n?.text??``}function NH(e){let t=CH(e).contentBlocks;if(Array.isArray(t))return t.find(e=>e&&typeof e==`object`&&e.type===`text`&&typeof e.text==`string`)?.text}function PH(e,t){if(e)return e===t?`.`:jc(e,t)}function FH(e,t){return`data:${e};base64,${t}`}function IH(e){return{...e,text:Cc(e.text,{headLines:2,tailLines:1,maxChars:yH}).text}}function LH(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.path);e||(e=[],n.set(r.path,e),t.push({path:r.path,openPath:r.openPath,matches:e})),e.push(r)}return t}function RH(e,t){if(e)return Lc(e,t)}function zH(e){let t=CH(e),n=Bi.safeParse(t.outputLimits);if(n.success)return n.data}function BH(e){return(zH(e)?.artifacts??[]).filter(e=>`kind`in e)}function VH(e){let t=CH(e),n=Di.safeParse(e);if(n.success&&n.data.truncated)return!0;let r=Di.safeParse(t.truncation);return!!(r.success&&r.data.truncated)}function HH(e){if(!e)return{additions:0,deletions:0};let t=0,n=0;for(let r of e.split(`
46
+ `))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,deletions:n}}function UH(e){return e&&typeof e==`object`?e:{}}function WH(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var GH=/(?:api[_-]?key|access[_-]?token|authorization|auth[_-]?token|bearer|cookie|credential|password|private[_-]?key|secret|session|token)/i,KH=/^(?:bearer\s+\S+|(?:gh[opusr]|sk|pk)_[A-Za-z0-9_-]{16,}|[A-Za-z0-9+/=_-]{40,})$/i,qH=24e3,JH=12,YH=240,XH=256,ZH=new Map;function QH(e){if(typeof e!=`string`)return WH(e);let t=ZH.get(e);if(t)return ZH.delete(e),ZH.set(e,t),t;let n;try{n=WH(JSON.parse(e))}catch{n={}}return ZH.size>=XH&&ZH.delete(ZH.keys().next().value),ZH.set(e,n),n}function $H(e){let t=``,n=0,r=0;for(let i=0;i<e.length;){let a=e[i++];if(a===`\\`){let t=e[i++];if(t===void 0)break;if(t===`u`){let t=e.slice(i,i+4);if(!/^[0-9a-f]{4}$/i.test(t))break;a=String.fromCharCode(parseInt(t,16)),i+=4}else{let e={n:`
47
+ `,r:`\r`,t:` `,b:`\b`,f:`\f`,'"':`"`,"\\":`\\`,"/":`/`};if(!(t in e))break;a=e[t]}}let o=a.charCodeAt(0);if(o>=55296&&o<=56319){let t;if(e.slice(i,i+2)===`\\u`){let n=e.slice(i+2,i+6);if(!/^[0-9a-f]{4}$/i.test(n)||(t=String.fromCharCode(parseInt(n,16)),t.charCodeAt(0)<56320||t.charCodeAt(0)>57343))break;i+=6}else{if(t=e[i]??``,!t||t.charCodeAt(0)<56320||t.charCodeAt(0)>57343)break;i+=1}a+=t}else if(o>=56320&&o<=57343)continue;n=Math.max(n,1)+ +(a===`
48
+ `),r+=o<128?1:o<2048?2:a.length===2?4:3,t+=a,t.length>qH*2&&(t=t.slice(-24e3),/^[\udc00-\udfff]/.test(t)&&(t=t.slice(1)))}return t=t.slice(-24e3),/^[\udc00-\udfff]/.test(t)&&(t=t.slice(1)),{value:t,lines:n,bytes:r}}function eU(e){return $H(e).value}function tU(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function nU(e,t){let n=[],r=RegExp(`"${tU(t)}"\\s*:\\s*"`,`g`),i=r.exec(e);for(;i;){let t=i.index+i[0].length,a=!1,o=i.index+i[0].length;for(;o<e.length;){let t=e[o];if(!a&&t===`"`)break;a?a=!1:t===`\\`&&(a=!0),o+=1}n.push($H(e.slice(t,o))),r.lastIndex=o+1,i=r.exec(e)}return n}function rU(e,t,n){let r=-1,i=!1,a=!1,o=-1;for(let n=0;n<e.length;n+=1){let s=e[n];if(i){if(a)a=!1;else if(s===`\\`)a=!0;else if(s===`"`){if(i=!1,eU(e.slice(o,n))!==t)continue;let a=n+1;for(;/\s/.test(e[a]??``);)a+=1;if(e[a]!==`:`)continue;for(a+=1;/\s/.test(e[a]??``);)a+=1;if(e[a]===`[`){r=a;break}}}else s===`"`&&(i=!0,o=n+1)}if(r<0)return[];let s=[],c=1,l=0,u=-1;i=!1,a=!1;for(let t=r+1;t<e.length;t+=1){let r=e[t];if(i)a?a=!1:r===`\\`?a=!0:r===`"`&&(i=!1);else if(r===`"`)i=!0;else if(r===`[`)c+=1;else if(r===`]`){if(--c,c===0)break}else if(r===`{`)l===0&&c===1&&(u=t),u>=0&&(l+=1);else if(r===`}`&&u>=0&&(--l,l===0&&(s.push(e.slice(u,t+1)),u=-1,s.length>=n)))break}return u>=0&&s.length<n&&s.push(e.slice(u,e.length)),s}function iU(e,t,n){if(n!==void 0)return n;let r=e.match(RegExp(`"${tU(t)}"\\s*:\\s*(true|false|-?(?:\\d+\\.?\\d*|\\.\\d+))`));if(!r)return;if(r[1]===`true`)return!0;if(r[1]===`false`)return!1;let i=Number(r[1]);return Number.isFinite(i)?i:void 0}function aU(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isFinite(e))return String(e);if(typeof e==`boolean`)return e?`true`:`false`;if(e===null)return`null`;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);return t.length===e.length?t.join(`, `):`${e.length} ${e.length===1?`item`:`items`}`}if(e&&typeof e==`object`){let t=Object.keys(e);return t.length>0?`fields: ${t.join(`, `)}`:`empty object`}}function oU(e){return GH.test(e)}function sU(e){return KH.test(e.trim())}function cU(e,t){if(oU(e))return`[redacted]`;let n=aU(t)??`[unavailable]`;return sU(n)?`[redacted]`:n}var lU=class e{argsText;records;partialStringsCache=new Map;constructor(e={}){this.argsText=e.argsText??``;let t=WH(e.args),n=QH(this.argsText),r=QH(e.argsPreview);this.records=[t,n,r].filter(e=>Object.keys(e).length>0)}get complete(){return this.records.length>0}partialStrings(e){let t=this.partialStringsCache.get(e);return t===void 0&&(t=nU(this.argsText,e),this.partialStringsCache.set(e,t)),t}value(e){for(let t of this.records)if(Object.hasOwn(t,e))return t[e];return iU(this.argsText,e,this.partialStrings(e)[0]?.value)}string(e){let t=this.value(e);return typeof t==`string`?t:void 0}stringMetrics(e){for(let t of this.records){if(!Object.hasOwn(t,e))continue;let n=t[e];return typeof n==`string`?{lines:n.length===0?0:n.split(`
49
+ `).length,bytes:new TextEncoder().encode(n).length}:void 0}let t=this.partialStrings(e)[0];return t&&{lines:t.lines,bytes:t.bytes}}strings(e){let t=this.value(e);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);return e.length>0?e:t.length===0?[]:void 0}let n=RegExp(`"${tU(e)}"\\s*:\\s*\\[`).exec(this.argsText);if(!n){let t=this.partialStrings(e).map(e=>e.value);return t.length?t:void 0}let r=[],i=n.index+n[0].length;for(;i<this.argsText.length;){for(;/[\s,]/.test(this.argsText[i]??``);)i+=1;if(this.argsText[i]!==`"`)break;let e=++i,t=!1;for(;i<this.argsText.length;){let e=this.argsText[i];if(!t&&e===`"`)break;t?t=!1:e===`\\`&&(t=!0),i+=1}r.push($H(this.argsText.slice(e,i)).value),i+=1}return r.length?r:void 0}number(e){let t=this.value(e);return typeof t==`number`&&Number.isFinite(t)?t:void 0}boolean(e){let t=this.value(e);return typeof t==`boolean`?t:void 0}array(e){let t=this.value(e);return Array.isArray(t)?t:void 0}recordsArray(e){let t=this.array(e);if(t)return t.map(WH).filter(e=>Object.keys(e).length>0)}objectArraySources(t,n=JH){for(let r of this.records){if(!Object.hasOwn(r,t))continue;let i=r[t];return Array.isArray(i)?i.slice(0,n).map(t=>new e({args:WH(t)})):[]}return rU(this.argsText,t,n).map(t=>new e({argsText:t}))}record(e){let t=this.value(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}objectKeys(e){return Object.keys(this.record(e)??{})}count(e){return this.array(e)?.length}selectorCount(...e){return e.reduce((e,t)=>{let n=this.value(t);return Array.isArray(n)?e+n.length:n==null||n===``?e:e+1},0)}nestedStrings(e){let t=[],n=r=>{if(Array.isArray(r)){for(let e of r)n(e);return}if(!r||typeof r!=`object`)return;let i=r;typeof i[e]==`string`&&t.push(i[e]);for(let e of Object.values(i))e&&typeof e==`object`&&n(e)};for(let e of this.records)n(e);return t.length>0?t:this.partialStrings(e).map(e=>e.value)}structuredEntries(e=JH){let t=this.records[0]??this.records[1]??this.records[2];if(t)return Object.entries(t).slice(0,e).map(([e,t])=>{let n=cU(e,t);return{key:e,value:n.length>YH?`${n.slice(0,239)}…`:n,redacted:n===`[redacted]`}});let n=Array.from(this.argsText.matchAll(/"([^"\\]{1,80})"\s*:/g),e=>e[1]);return[...new Set(n)].slice(0,e).map(e=>{let t=cU(e,iU(this.argsText,e,this.partialStrings(e)[0]?.value));return{key:e,value:t,redacted:t===`[redacted]`}})}};function uU(e={}){return new lU(e)}function dU(){let e=new yo;return{get:t=>e.get(t)??{},update(t,n,r){let i=e.get(t)??{};e.set(t,{...i,[n]:{...i[n],...r}})},clear:t=>{e.delete(t)}}}function fU(e,t){if(e?.toolName!==`ask_user`||e.status!==`waiting`)return;let n=e.interaction;if(n?.kind===`user_input`&&n.status===`pending`)return t?.toolCallId===e.id&&t.status===`pending`?t:{toolCallId:e.id,agentId:e.agentId,conversationId:e.conversationId,projectId:e.projectId,questions:n.request.questions,status:`pending`,requestedAt:n.requestedAt,updatedAt:n.updatedAt}}function pU(e){return typeof e==`string`&&e.length>0?e:void 0}function mU(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function hU(e){let t=mU(e);return(Array.isArray(t.questions)?t.questions:pU(t.question)?[{...t,id:`answer`}]:[]).map((e,t)=>{let n=mU(e),r=Array.isArray(n.options)?n.options.flatMap(e=>{let t=mU(e),n=pU(t.label);return n?[{label:n,description:pU(t.description),recommended:t.recommended===!0||void 0}]:[]}):[];return{id:pU(n.id)??`q${t+1}`,question:pU(n.question),context:pU(n.context),recommendation:pU(n.recommendation),options:r}})}function gU(e){try{return ki(e).questions.map(e=>({id:e.id,question:e.question,context:e.context,recommendation:e.recommendation,options:e.options??[]}))}catch{return hU(e)}}function _U(e){let t=ra.safeParse(e);if(t.success)return{questions:t.data.questions,dismissed:!!t.data.dismissed};let n=mU(e);if(!pU(n.question)&&!pU(n.response)&&!n.dismissed)return;let r=pU(n.response);return{questions:[{id:`answer`,question:pU(n.question),answer:r?{text:r}:void 0}],dismissed:!!n.dismissed}}function vU(e,t){let n=gU(e),r=_U(t);if(!r)return{questions:n,dismissed:!1};let i=n.map(e=>{let t=r.questions.find(t=>t.id===e.id);return t?{...e,answer:t.answer,skipped:t.skipped}:e});for(let e of r.questions)n.some(t=>t.id===e.id)||i.push({id:e.id,question:e.question,options:[],answer:e.answer,skipped:e.skipped});return{questions:i,dismissed:r.dismissed}}function yU(e){let t=e.objectArraySources(`questions`,5);if(t.length===0){let t=e.string(`question`);return t===void 0?[]:[{id:`answer`,question:t,context:e.string(`context`),recommendation:e.string(`recommendation`),options:[]}]}return t.map((e,t)=>({id:e.string(`id`)??`q${t+1}`,question:e.string(`question`),context:e.string(`context`),recommendation:e.string(`recommendation`),options:e.objectArraySources(`options`,6).map(e=>({label:e.string(`label`),description:e.string(`description`),recommended:e.boolean(`recommended`)}))}))}function bU(e,t){let n={};for(let{id:r}of e){let e=t[r],i=e?.option,a=e?.text?.trim();(i||a)&&(n[r]={...i?{option:i}:{},...a?{text:a}:{}})}return n}function xU(e){return e.pending?`waiting`:e.settled?e.answer?.option||e.answer?.text?`answered`:e.dismissed?`dismissed`:`skipped`:`idle`}var SU=e=>/^ok, no output(?: \([^\n]*\))?$/.test(e);function CU(e){return e.outcome===`running`?void 0:e.edit}function wU(e){return{files:`${e.files} file${e.files===1?``:`s`}`,added:`+${e.added}`,removed:`−${e.removed}`,dryRun:e.dryRun===!0}}function TU(e){let t=wU(e);return[`${t.files} changed`,`${e.added} added`,`${e.removed} removed`,...t.dryRun?[`dry run`]:[]].join(`, `)}var EU=/^\[diff truncated(?:; full diff: \S+)?\]$/,DU=/^@@ -\d+(?:,(\d+))? \+\d+(?:,(\d+))? @@/;function OU(e){let t=e.split(`
50
+ `),n=EU.test(t.at(-1)??``);n&&t.pop();let r=[],i=0,a=0;for(let e=0;e<t.length;e+=1){let n=t[e],o=i>0||a>0,s=t[e+1];if(!o&&n.startsWith(`--- `)&&s?.startsWith(`+++ `)){r.push({path:s.slice(4),lines:[]}),e+=1;continue}let c=o?null:DU.exec(n);c?(i=c[1]===void 0?1:Number(c[1]),a=c[2]===void 0?1:Number(c[2])):o&&!n.startsWith(`\\`)&&(n.startsWith(`+`)?--a:n.startsWith(`-`)?--i:(--i,--a)),r.length===0&&r.push({path:``,lines:[]}),r.at(-1).lines.push(n)}return{files:r.map(e=>({path:e.path,diff:e.lines.join(`
51
+ `)})).filter(e=>e.path||e.diff),cut:n}}function kU(e){let t=(e?.chunks??[]).filter(e=>e.stream===Vi).map(e=>e.text).join(``),n=new Map;for(let e of t.split(`
52
+ `)){if(!e)continue;let t;try{t=JSON.parse(e)}catch{continue}let r=Oi.safeParse(t);if(!r.success)continue;let{phase:i,seq:a,...o}=r.data;i===`started`?n.has(a)||n.set(a,{...o,outcome:`running`}):n.set(a,o)}return[...n].sort(([e],[t])=>e-t).map(([,e])=>e)}var AU=` · `;function jU(e){return(e??``).split(`
53
+ `).map(e=>e.trim()).filter(Boolean)}function MU(e,t){let n=ma.safeParse(t);if(n.success&&n.data.assignments)return n.data.assignments;let r=[];for(let t of jU(e)){let e=/^(.+?) \(([^()]+)\): (.+)$/.exec(t);if(!e)continue;let[,n,i,a]=e;a===`created`?r.push({name:n,profile:i,disposition:`created`}):a.startsWith(`follow-up`)&&r.push({name:n,profile:i,disposition:`follow_up`,queuedState:/\(([^()]+)\)\s*$/.exec(a)?.[1]})}return r}function NU(e){return typeof e==`string`&&e?e:void 0}function PU(e,t,n){let r=MU(t,n),i=new Map(r.map(e=>[e.name.toLowerCase(),e])),a=Array.isArray(e.assignments)?e.assignments:[],o=new Set(a.flatMap(e=>{let t=NU(e?.name);return t?[t.toLowerCase()]:[]})),s=[];for(let e=0;e<Math.max(a.length,r.length);e+=1){let t=a[e],n=t&&typeof t==`object`?t:{},c=r[e],l=NU(n.name)?i.get(NU(n.name).toLowerCase()):c&&!o.has(c.name.toLowerCase())?c:void 0;s.push({name:NU(n.name)??l?.name??``,profile:NU(n.profile)??l?.profile,prompt:typeof n.prompt==`string`?n.prompt:``,disposition:l?.disposition,...l?.reason===void 0?{}:{reason:l.reason},...l?.agentId===void 0?{}:{agentId:l.agentId},queuedState:l?.queuedState})}return s}function FU(e,t){let n=zi.safeParse(t);if(n.success&&n.data.agents)return n.data.agents.map(e=>({...e,context:e.contextPercent===void 0?void 0:`${e.contextPercent}%`}));let r=[];for(let t of jU(e)){let e=t.split(AU).map(e=>e.trim());if(e.length<3)continue;let[n,i,a,...o]=e,s=o.find(e=>/^ctx\b/.test(e)),c=o.filter(e=>e!==s).join(` · `);r.push({name:n,profile:i,state:a,context:s?.replace(/^ctx\s*/,``),activity:c||void 0})}return r}function IU(e){let t=(e??``).trim();if(!t)return{};let n=t.indexOf(`
54
+ `);return n<0?{header:t}:{header:t.slice(0,n).trim(),body:t.slice(n+1).trim()||void 0}}function LU(e,t){let n=wi.safeParse(t);if(n.success&&n.data.results)return n.data.results;let r=[];for(let t of jU(e)){let e=/^(.+?): (.+)$/.exec(t);if(e){let t=e[2],n=/^stopped\b/.test(t)?`stopped`:/^already[_ ]idle\b/.test(t)||t===`was not running`||t.startsWith(`nothing to stop`)?`already_idle`:/not[_ ]found/.test(t)?`not_found`:`failed`;r.push({name:e[1],outcome:n,...n===`failed`?{reason:t}:{}})}}return r}var RU=/\n?\[(?:truncated; full response: |Showing the first [^\]\n]*? omitted\. Full response: )([^\]\n]+)\]\s*$/;function zU(e){let t=(e??``).trim(),n=/^Sub-agent "(.+?)"(?: \(([^()]+)\))? (.*)$/m.exec(t);if(!n||n.index!==0)return;let[r,i,a,o]=n,s,c,l=t.slice(r.length).replace(/^\n/,``);if(o===`completed.`)s=`completed`;else if(o===`interrupted.`)s=`interrupted`;else if(o===`was stopped by the user.`)s=`stopped`;else if(o.startsWith(`failed:`))s=`failed`,c=o.slice(7).trim()||void 0;else if(o.startsWith(`is waiting on `)){s=`waiting`;let e=[],t=l.split(`
55
+ `);for(;t.length&&/^"[^\n]*" \S/.test(t[0]);)e.push(t.shift());c=e.join(`
56
+ `)||void 0,l=t.join(`
57
+ `)}else return;let u=RU.exec(l),d=(u?l.slice(0,u.index):l).replace(/^Last message:\n/,``).trim();return{name:i,profile:a,outcome:s,detail:c,response:d,reportPath:u?.[1].trim()}}var BU={sections:[{id:`result`,type:`text`}]},VU=new yo;function HU(e){let t=new Map([...e].map(e=>[e.name,e.view??BU]));for(let e of[...VU.keys()])t.has(e)||VU.delete(e);for(let[e,n]of t)JSON.stringify(VU.get(e))!==JSON.stringify(n)&&VU.set(e,n)}function UU(e){return e.filter(e=>e.extension)}function WU(e){return VU.has(e)}function GU(e){return VU.get(e)}function KU(e){return Array.isArray(e)?e:[]}function qU(e){return KU(e.edits).length}function JU(e){return typeof e==`number`&&Number.isInteger(e)&&e>=0?e:void 0}function YU(e,t,n){let r=`previewOverflow`in e?e.previewOverflow:void 0;return!r||r.noun!==t||n&&r.direction!==n?0:r.hidden}function XU(e,t,n,r){return e+YU(t,n,r)}function ZU(e){return e?.model?.displayedLines}function QU(e,t,n,r,i){return ZU(i)??XU(xH(e),t,n,r)}var $U=new Iee(300),eW=new WeakMap,tW=1;function nW(e){if(e===void 0)return``;if(typeof e==`string`)return`s:${e.length}`;if(typeof e==`object`&&e){let t=eW.get(e);return t===void 0&&(t=tW++,eW.set(e,t)),`o:${t}`}return`p:${String(e)}`}function rW(e,t){let n=e,r=`result`in e||`args`in e?`full`:`preview`,i=`previewOverflow`in e?e.previewOverflow:void 0;return[e.id,e.status,e.updatedAt,r,nW(n.argsPreview??n.args),nW(n.resultPreview??n.result),i?`${i.hidden}:${i.noun}:${i.direction}`:``,t?.updatedAt??``,t?.text.length??0,t?.chunks.length??0,GU(e.toolName)?`extension`:``].join(`\0`)}function iW(e,t){let n=rW(e,t),r=$U.get(n);if(r!==void 0)return r;let i=aW(e,t);return $U.set(n,i),i}function aW(e,t){let n=e,r=n.argsPreview??n.args,i=n.resultPreview??n.result,a=CH(r),o=e.cwd,s=kH(i),c=zH(s?.details),l=BH(s?.details);switch(e.toolName){case`read`:{let t=RH(s?.path??wH(a.path),o),n=PH(t,o),r=s?.contentBlocks?.find(e=>e.type===`image`);if(r&&r.type===`image`)return{kind:`read`,path:t,relPath:n,image:{dataUrl:`assetId`in r?`/api/assets/${encodeURIComponent(r.assetId)}`:FH(r.mimeType,r.data),mimeType:r.mimeType},truncated:!1,outputLimits:c,outputArtifacts:l};let i=s?.content,u=typeof a.offset==`number`||typeof a.limit==`number`,d,f=i===void 0?void 0:QU(i,e,`lines`,`head`,c);if(f!==void 0){if(u&&typeof a.offset==`number`&&f>0){let e=a.offset;d=`lines ${e}–${e+f-1}`}else d=`${f} line${f===1?``:`s`}`}return{kind:`read`,path:t,relPath:n,lineLabel:d,lineCount:f,content:i,truncated:VH(s?.details),outputLimits:c,outputArtifacts:l}}case`quick_script`:{let n=ji.safeParse(s?.details),r=s?[]:kU(t);return{kind:`quick_script`,code:wH(a.code),output:MH(s,i),status:n.success?n.data.status:void 0,error:n.success?n.data.error:void 0,durationMs:n.success?n.data.durationMs:void 0,outputTruncated:n.success?n.data.outputTruncated:void 0,hostCalls:n.success?n.data.hostCalls:r,liveCalls:!n.success&&r.length>0,plannedOperations:(`supervision`in e?e.supervision?.operations:void 0)??[],artifacts:n.success?n.data.artifacts??[]:[],created:n.success?n.data.created??[]:[]}}case`async_bash`:case`bash`:{let n=wH(a.command),r=na.safeParse(s?.details),o=MH(s,i,t),u=QU(o,e,`lines`,`tail`,c);return{kind:`bash`,command:n,exitCode:s?.exitCode??(r.success&&typeof r.data.exitCode==`number`?r.data.exitCode:void 0),signal:r.success?r.data.signal??void 0:void 0,backgroundTask:r.success&&r.data.execution?.disposition===`backgrounded`?{taskId:r.data.execution.taskId,status:r.data.execution.status,elapsedMs:r.data.execution.elapsedMs,terminalUpdate:r.data.execution.terminalUpdate}:void 0,output:o,outputLineCount:u,savedTo:r.success?r.data.fullOutputPath:void 0,truncated:VH(s?.details),live:!s&&!!t?.text,outputLimits:t?.outputLimits?{...c,live:{...t.outputLimits}}:c,outputArtifacts:l}}case`python`:case`python_exec`:{let n=wH(a.code),r=wH(a.path),u=Zi.safeParse(s?.details),d=RH((u.success?u.data.scriptPath:void 0)??r,o),f=MH(s,i,t),p=n?XU(xH(n),e,`lines`,`head`):0,m=QU(f,e,`lines`,`tail`,c);return{kind:`python`,inputMode:u.success?u.data.inputMode??(d?`file`:`inline`):r?`file`:`inline`,code:n,codeLineCount:p,scriptPath:d,relScriptPath:PH(d,o),exitCode:s?.exitCode,signal:u.success?u.data.signal??void 0:void 0,output:f,outputLineCount:m,savedTo:u.success?u.data.fullOutputPath:void 0,truncated:VH(s?.details),live:!s&&!!t?.text,allowNetwork:u.success?u.data.allowNetwork:void 0,allowFileWrite:u.success?u.data.allowFileWrite:void 0,durationMs:u.success?u.data.durationMs:void 0,timedOut:u.success?u.data.timedOut:void 0,timeoutKilled:u.success?u.data.timeoutKilled:void 0,envKeys:u.success?u.data.envKeys:void 0,artifactDir:u.success?u.data.artifactDir:void 0,artifacts:u.success?u.data.artifacts:void 0,streams:u.success?u.data.streams:void 0,outputLimits:t?.outputLimits?{...c,live:{...t.outputLimits}}:c,outputArtifacts:l}}case`edit`:{let t=RH(s?.path??wH(a.path),o),n=PH(t,o),r=CH(s?.details),i=Ji.safeParse(r),c=i.success?i.data.operationCount:JU(r.operationCount)??qU(a),l=i.success?i.data.diff:wH(r.diff),u=XU(xH(l),e,`lines`,`tail`),{additions:d,deletions:f}=HH(l);return{kind:`edit`,path:t,relPath:n,operationCount:c,operations:Array.isArray(r.operations)?r.operations.flatMap((e,t)=>{let n=CH(e),r=n.status;return r===`applied`||r===`failed`||r===`not_applied`?[{index:JU(n.sourceIndex)??JU(n.index)??t,status:r,error:wH(n.error)}]:[]}):void 0,appliedCount:i.success?i.data.appliedCount:JU(r.appliedCount),additions:d,deletions:f,diff:l,diffLineCount:u,dryRun:i.success?i.data.dryRun:typeof r.dryRun==`boolean`?r.dryRun:void 0}}case`write`:{let t=RH(s?.path??wH(a.path),o),n=PH(t,o),r=wH(a.content),i=s?.content?.match(/Wrote (\d+) bytes/),c=Pi.safeParse(s?.details),l=(c.success?c.data.bytes:void 0)??(i?Number(i[1]):void 0),u=r===void 0?void 0:XU(xH(r),e,`lines`,`tail`),d=r?.length;return{kind:`write`,outcome:c.success?c.data.outcome:void 0,path:t,relPath:n,bytes:l,lineCount:u,charCount:d,content:r}}case`grep`:{let t=wH(a.pattern),n=RH(s?.path,o)??RH(wH(a.path)??`.`,o)??o,r=(s?.matches??[]).map(e=>IH({...e,openPath:RH(e.path,n)??e.path})),i=LH(r),c=ha.safeParse(s?.details),l=c.success?c.data:{};return{kind:`grep`,pattern:t,totalMatches:l.totalMatches,totalFiles:l.totalFiles,matchCount:l.totalMatches??XU(r.length,e,`matches`,`head`),fileCount:l.totalFiles??i.length,allMatches:i}}case`find`:{let t=wH(a.pattern),n=s?.entries??[],r=RH(s?.path,o)??RH(wH(a.path)??`.`,o)??o,i=n.map(e=>e.path);return{kind:`find`,pattern:t,paths:i,openPaths:n.map(e=>RH(e.path,r)??e.path),totalEntries:fa.safeParse(s?.details).data?.totalEntries,count:fa.safeParse(s?.details).data?.totalEntries??XU(i.length,e,`files`,`head`)}}case`ls`:{let t=RH(s?.path??wH(a.path),o),n=PH(t,o)??`.`,r=(s?.entries??[]).map(e=>({...e,openPath:RH(e.path,t??o)??e.path}));return{kind:`ls`,path:t,relPath:n,entries:r,totalEntries:fa.safeParse(s?.details).data?.totalEntries,total:fa.safeParse(s?.details).data?.totalEntries??XU(r.length,e,`entries`,`head`)}}case`ask_user`:return{kind:`ask_user`,...vU(a,i)};case`subagent_prompt`:return{kind:`subagent`,action:`prompt`,context:wH(a.context)?.trim()||void 0,assignments:PU(a,MH(s,i),s?.details)};case`subagent_status`:{let e=wH(a.name),t=MH(s,i);return{kind:`subagent`,action:`status`,name:e,rows:FU(t,s?.details),...e?IU(t):{}}}case`subagent_stop`:return{kind:`subagent`,action:`stop`,names:KU(a.names).filter(e=>typeof e==`string`),lines:LU(MH(s,i),s?.details)};case`plan_present`:{let t=CH(i),n=CH(t.review??CH(t.details).review),r=e.interaction?.kind===`plan_review`?e.interaction.request.summary:void 0,o=wH(n.planPath)??wH(a.file_path),s=wH(t.outcome)??wH(n.status);return{kind:`plan_present`,action:`present`,summary:wH(t.feedback)??NH(i),planPreview:wH(n.content)??wH(n.summary)??r,planPath:o,outcome:s}}case`web_fetch`:{let e=Ei.safeParse(s?.details),t=e.success?e.data:void 0;return{kind:`web_fetch`,url:t?.url??wH(a.url),status:t?.status,contentType:t?.contentType,size:t?.size,savedTo:t?.savedTo,converted:t?.converted??!1,content:s?.content,outputLimits:c,outputArtifacts:l}}default:{let n=GU(e.toolName),a=Xi.safeParse(s?.details);if(a.success||n&&!s){let r=a.success?a.data:void 0,o=!r&&e.status===`running`,c=r?r.sections.map(e=>({id:e.id,type:e.type,...e.label?{label:e.label}:{},value:e.value})):o&&n&&t?n.sections.flatMap(e=>{if(!e.live)return[];let n=t.chunks.filter(t=>t.stream===e.id).map(e=>e.text).join(``);return n?[{id:e.id,type:e.type,...e.label?{label:e.label}:{},value:n,live:!0}]:[]}):[],l=Ui.array().safeParse(r?.artifacts);return{kind:`extension`,toolName:e.toolName,extension:r?.extension??``,sections:c,live:c.some(e=>e.live),artifacts:l.success?l.data:[],resultText:r?MH(s,i,t):void 0}}let o=MH(s,i,t),c=o?cU(`result`,o).slice(0,6e3):void 0;return{kind:`generic`,toolName:e.toolName,args:uU({args:r}).structuredEntries(),result:uU({args:i}).structuredEntries(),resultText:c}}}}function oW(e){return e.flatMap(({operation:e,targets:t,targetsKnown:n,count:r})=>{let i=r>1?` ×${r}`:``,a=t.map(t=>`${e} · ${t}`);return a.length===0?[`${e}${i}`]:(n||a.push(`${e} · other targets`),r>1&&a.length===1?[`${a[0]}${i}`]:a)})}function sW(e){return e.split(/[\\/]/).pop()||e}function cW(e){if(e<1024)return`${e} B`;let t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}function lW(e){return e===void 0?void 0:cW(e)}function uW(e){if(e!==void 0)return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function dW(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function fW(e){return xH(e)}function pW(e,t,n=`head`,r=6){let i=e-r;if(!(i<=0))return mW(i,t,n)}function mW(e,t,n=`head`){if(!(!e||e<=0))return{hidden:e,label:_H}}function hW(e,t){return e.status===`completed`&&t.kind===`quick_script`&&t.status!==void 0&&t.status!==`completed`?t.status.replaceAll(`_`,` `):e.status}function gW(e,t){switch(e.status){case`failed`:case`denied`:return{tone:`destructive`,pulse:!1};case`cancelled`:return{tone:`warning`,pulse:!1};case`running`:return{tone:`info`,pulse:!0};case`committed`:return{tone:`info`,pulse:!1};case`waiting`:return{tone:`warning`,pulse:!0}}return(t.kind===`bash`||t.kind===`python`)&&t.exitCode!==void 0&&t.exitCode!==0||t.kind===`quick_script`&&t.status!==void 0&&t.status!==`completed`?{tone:`destructive`,pulse:!1}:{tone:`success`,pulse:!1}}function _W(e,t){if(!(e===void 0||e<=0))return`${e.toLocaleString()} ${t}${e===1?``:`s`}`}function vW(e,t){return!!(t&&`outputArtifacts`in e&&e.outputArtifacts?.some(e=>e.path===t))}function yW(e,t={}){let n=`outputLimits`in e?e.outputLimits:void 0,r=`outputArtifacts`in e?e.outputArtifacts:void 0,i=[];if(n?.model?.truncated){let e=_W(n.model.omittedLines,`line`),t=_W(n.model.omittedChars,`char`);i.push({text:[`LLM trimmed`,e??t].filter(Boolean).join(` · `),tone:`warning`})}if(t.includeLiveLimit!==!1&&n?.live?.capped){let e=_W(n.live.omittedChars,`char`);i.push({text:[`live tail`,e?`${e} omitted`:void 0].filter(Boolean).join(` · `),tone:`info`})}for(let e of r??[]){let t=e.kind===`raw_result`?`raw result`:e.kind===`fetched_content`?`fetched content`:`full output`;i.push({text:t,mono:!0,openPath:e.path})}return i}var bW=()=>({kind:`none`});function xW(e={}){return{primaryArg:e.primaryArg,secondary:(e.secondary??[]).map(e=>({...e,key:e.key??`arg:${e.text.replace(/\d+(?:\.\d+)?/g,`#`)}`})),body:e.body??bW(),safetyNotes:e.safetyNotes??[]}}var SW=6,CW=6e3,wW=24e3;function TW(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function EW(e,t=!1){if(!e)return;let n=e.replace(/\r\n?/g,`
58
+ `).slice(-(t?wW:CW)).split(`
59
+ `),r=SW+(t?4:0),i=n.slice(-r).join(`
60
+ `);return/^[\udc00-\udfff]/.test(i)?i.slice(1):i}function DW(e){if(e)return e.replace(/\r\n?/g,`
61
+ `).split(`
62
+ `).slice(0,SW).join(`
63
+ `).slice(0,CW)}function OW(e,t,n=`path`,r){let i=e.string(n)??r;if(i)return{text:t&&jc(i,t)||i,openPath:i===`.`?void 0:t?Lc(i,t):i}}function kW(e,t){let n=e||t;if(n)return{text:n.length>500?`${n.slice(0,499)}…`:n}}function AW(e){if(e)return{text:e.length>500?`${e.slice(0,499)}…`:e,href:e}}function jW(e,t,n={}){let r=n.head?DW(e):EW(e,n.draft);return!r||!n.force&&!r.includes(`
64
+ `)?{kind:`none`}:{kind:`code`,text:r,language:t,label:n.label,tail:!n.head}}function MW(e){let t=e.flatMap(([e,t,n])=>t===void 0||t===``?[]:[{label:e,value:String(t),mono:n}]);return t.length>0?{kind:`key-values`,items:t}:{kind:`none`}}function NW(e,t,n=!1){let r,i=(e,n)=>{if(!e)return;let i=EW(e,t).split(`
65
+ `).map(e=>`${n}${e}`).join(`
66
+ `);r=EW(r?`${r}\n${i}`:i,t)};for(let t of n?[e]:e.objectArraySources(`edits`,1/0))i(t.string(`oldText`),`-`),i(t.string(`newText`),`+`);return r}function PW(e){let t=e.objectArraySources(`edits`,1/0),n=t.length,r=0,i=0;for(let e of t)r+=e.stringMetrics(`newText`)?.lines??0,i+=e.stringMetrics(`oldText`)?.lines??0;return{operations:n,additions:r,deletions:i}}function FW(e){return e}function IW(e,t,n){let r=e.number(`offset`),i=e.number(`limit`),a=e.number(`byteOffset`),o=e.number(`byteLimit`),s=[];return a!==void 0||o!==void 0?s.push({text:`bytes ${a??0}${o===void 0?``:` +${o}`}`}):(r!==void 0||i!==void 0)&&s.push({key:`read-range`,text:`lines ${r??1}${i===void 0?``:`–${(r??1)+i-1}`}`}),xW({primaryArg:OW(e,n),secondary:s,body:t===`approval`?MW([[`Path`,e.string(`path`),!0],[`Line start`,r],[`Line limit`,i],[`Byte offset`,a],[`Byte limit`,o]]):void 0})}function LW(e,t){let n=e.string(`command`),r=e.stringMetrics(`command`)?.lines??0,i=e.string(`cwd`),a=e.number(`timeout`);return xW({primaryArg:kW(r<=1?n:void 0,n?`inline command`:`Command`),secondary:[...i?[{key:`cwd`,text:`cwd ${i}`,mono:!0}]:[],...a===void 0?[]:[{key:`timeout`,text:`timeout ${a}s`}]],body:jW(n,`bash`,{force:(n?.length??0)>500||r>1,draft:t===`drafting`,label:`Command`}),safetyNotes:[`Runs a Bash-compatible command in the selected working directory.`]})}function RW(e,t,n){let r=e.string(`path`),i=e.string(`code`),a=e.stringMetrics(`code`)?.lines??0,o=e.objectKeys(`env`),s=[],c=e.string(`cwd`);c&&s.push({key:`cwd`,text:`cwd ${c}`,mono:!0});let l=e.number(`timeout`);l!==void 0&&s.push({key:`timeout`,text:`timeout ${l}s`}),o.length>0&&s.push({text:TW(o.length,`env key`)});let u=e.boolean(`allowFileWrite`)??e.boolean(`allow_file_write`);u===!1&&s.push({text:`writes off`,tone:`warning`});let d=jW(i,`python`,{force:(i?.length??0)>500||a>1,draft:t===`drafting`,label:`Script`});return xW({primaryArg:r?OW(e,n):kW(a<=1?i:void 0,i?`inline Python`:`Python`),secondary:s,body:d,safetyNotes:[u===!1?`File writes are disabled.`:`Python may write files unless the execution policy disables it.`,...o.length>0?[`Environment values are hidden; keys: ${o.join(`, `)}.`]:[]]})}function zW(e,t,n){let r=e.string(`content`),i=e.stringMetrics(`content`)?.lines;return xW({primaryArg:OW(e,n),secondary:[...i===void 0?[]:[{key:`write-lines`,text:TW(i,`line`)}]],body:r?{kind:`code`,text:EW(r,t===`drafting`),language:`text`,tail:!0}:void 0,safetyNotes:[`Creates the file or overwrites it if it already exists.`]})}function BW(e,t,n){let r=PW(e),i=e.objectArraySources(`edits`,1/0),a=[];return r.operations>0&&(a.push({key:`add`,text:`+${r.additions}`,tone:`success`}),a.push({key:`del`,text:`−${r.deletions}`,tone:`destructive`})),e.boolean(`dryRun`)===!0&&a.push({text:`dry run`,tone:`info`}),xW({primaryArg:OW(e,n),secondary:a,body:i.length?{kind:`diff-sections`,tail:!0,sections:i.map((e,n)=>({key:String(n),caption:i.length>1?`Edit ${n+1}`:void 0,text:NW(e,t===`drafting`,!0)}))}:void 0,safetyNotes:[e.boolean(`dryRun`)===!0?`Previews the edit without changing the file.`:`Applies the proposed changes to the existing file.`]})}function VW(e,t){let n=e.string(`code`),r=e.stringMetrics(`code`)?.lines??0,i=e.number(`timeout`);return xW({primaryArg:kW(r<=1?n:void 0,n?`inline script`:`Quick script`),secondary:i===void 0?[]:[{key:`timeout`,text:`timeout ${i}s`}],body:jW(n,`typescript`,{force:(n?.length??0)>500||r>1,draft:t===`drafting`,label:`Script`}),safetyNotes:[`Runs a sandboxed script that calls the enabled extensions' SDKs; each SDK call is checked against the permission policy.`]})}var HW={read:FW({name:`read`,argumentRegion:`none`,completedView:`read`,present:IW}),bash:FW({name:`bash`,argumentRegion:`persistent`,completedView:`bash`,resultPlaceholder:{variant:`text`,rows:2},emptyResult:`No output`,present:LW}),python_exec:FW({name:`python_exec`,argumentRegion:`persistent`,completedView:`python`,resultPlaceholder:{variant:`text`,rows:2},emptyResult:`No output`,present:RW}),edit:FW({name:`edit`,argumentRegion:`persistent`,completedView:`edit`,present:BW}),write:FW({name:`write`,argumentRegion:`persistent`,completedView:`write`,present:zW}),grep:FW({name:`grep`,argumentRegion:`none`,completedView:`grep`,emptyResult:`No matches`,present:(e,t)=>{let n=e.strings(`paths`),r=n?.length?n.join(`, `):e.string(`path`),i=[];return e.string(`glob`)&&i.push({key:`glob`,text:`glob ${e.string(`glob`)}`}),e.boolean(`ignoreCase`)&&i.push({text:`ignore case`}),(e.number(`context`)??0)>0&&i.push({text:`context ${e.number(`context`)}`}),e.number(`limit`)!==void 0&&e.number(`limit`)!==100&&i.push({text:`max ${e.number(`limit`)}`}),xW({primaryArg:kW(e.string(`pattern`),`Pattern`),secondary:i,body:t===`approval`?MW([[`Scope`,r??`project root`,!0],[`Pattern mode`,e.boolean(`literal`)?`literal`:`regular expression`]]):void 0})}}),find:FW({name:`find`,argumentRegion:`none`,completedView:`find`,emptyResult:`No files found`,present:(e,t,n)=>xW({primaryArg:kW(e.string(`pattern`),`Glob pattern`),secondary:[...e.string(`path`)?[{text:n&&jc(e.string(`path`),n)||e.string(`path`),mono:!0}]:[],...e.number(`limit`)!==void 0&&e.number(`limit`)!==1e3?[{text:`max ${e.number(`limit`)}`}]:[]],body:t===`approval`?MW([[`Search root`,e.string(`path`)??`project root`,!0]]):void 0})}),ls:FW({name:`ls`,argumentRegion:`none`,completedView:`ls`,emptyResult:`Empty directory`,present:(e,t,n)=>xW({primaryArg:OW(e,n,`path`,`.`),secondary:e.number(`limit`)!==void 0&&e.number(`limit`)!==500?[{text:`max ${e.number(`limit`)}`}]:[],body:t===`approval`?MW([[`Directory`,e.string(`path`)??`project root`,!0]]):void 0})}),ask_user:FW({name:`ask_user`,argumentRegion:`none`,completedView:`ask_user`,present:e=>{let t=yU(e).length;return xW({primaryArg:t>0?kW(TW(t,`question`)):void 0})}}),quick_script:FW({name:`quick_script`,argumentRegion:`persistent`,completedView:`quick_script`,resultPlaceholder:{variant:`text`,rows:2},emptyResult:`No output`,present:VW}),web_fetch:FW({name:`web_fetch`,argumentRegion:`none`,completedView:`web_fetch`,resultPlaceholder:{variant:`text`,rows:3},present:(e,t)=>xW({primaryArg:AW(e.string(`url`))??kW(`URL`),secondary:[{text:e.boolean(`raw`)?`raw download`:`converted`}],body:t===`approval`?MW([[`Destination`,e.string(`url`)],[`Mode`,e.boolean(`raw`)?`save raw response`:`convert to readable text`]]):void 0,safetyNotes:[`Fetches content from an external URL.`]})})};function UW(e){return e}var WW={subagent_prompt:UW({name:`subagent_prompt`,argumentRegion:`persistent`,completedView:`subagent`,present:e=>{let t=e.objectArraySources(`assignments`,1/0);return xW({primaryArg:kW(t.length>0?TW(t.length,`sub-agent`):void 0),body:t.length>0?{kind:`entities`,items:t.map((e,t)=>({key:String(t),title:e.string(`name`),detail:e.string(`profile`),body:e.string(`prompt`),agentName:e.string(`name`),status:e.complete?{tone:`neutral`,label:`Pending`}:void 0})),context:e.string(`context`)===void 0?void 0:{label:`Shared context`,text:e.string(`context`)}}:void 0})}}),subagent_status:UW({name:`subagent_status`,argumentRegion:`none`,completedView:`subagent`,present:e=>xW({primaryArg:kW(e.string(`name`))})}),subagent_stop:UW({name:`subagent_stop`,argumentRegion:`persistent`,completedView:`subagent`,present:e=>{let t=e.strings(`names`)??[];return xW({primaryArg:kW(t.length>0?TW(t.length,`sub-agent`):void 0),body:t.length?{kind:`entities`,items:t.map((e,t)=>({key:String(t),title:e,agentName:e}))}:void 0})}}),async_bash:UW({name:`async_bash`,argumentRegion:`none`,completedView:`bash`,present:e=>xW({primaryArg:kW([e.string(`action`),e.string(`id`)].filter(Boolean).join(` `))})}),plan_present:UW({name:`plan_present`,argumentRegion:`until-result`,completedView:`plan_present`,present:e=>{let t=e.string(`file_path`);return xW({primaryArg:t?{text:t.split(/[\\/]/).pop()||t,openPath:t}:kW(`Plan review`),secondary:t?[{text:t,mono:!0,openPath:t}]:[]})}})},GW=3;function KW(e,t,n){let r=e.string(t.argument);if(r)return t.format===`path`?{text:n&&jc(r,n)||r,openPath:n?Lc(r,n):r}:{text:r}}function qW(e){return{name:`extension`,argumentRegion:`none`,completedView:`extension`,resultPlaceholder:{variant:`text`,rows:3},emptyResult:`No output`,present:(t,n,r)=>{let i=t.structuredEntries().filter(e=>!e.redacted&&e.value!==`[unavailable]`),a=e=>i.find(t=>t.key===e),[o,...s]=i;return xW({primaryArg:e?.header?KW(t,e.header,r):o?{text:o.value}:void 0,secondary:(e?.header||e?.meta?(e.meta??[]).flatMap(e=>a(e)??[]):s.slice(0,GW)).map(e=>({text:`${e.key} ${e.value}`})),body:n===`approval`&&i.length>0?{kind:`key-values`,items:i.map(e=>({label:e.key,value:e.value}))}:void 0,safetyNotes:[`Runs an extension tool; its arguments are sent to the service the extension uses.`]})}}}var JW=qW(void 0),YW=new WeakMap;function XW(e){if(!e)return JW;let t=YW.get(e);return t||(t=qW(e),YW.set(e,t)),t}var ZW={...HW,...WW},QW={name:`unknown`,argumentRegion:`until-result`,completedView:`generic`,emptyResult:`No output`,present:e=>{let t=e.structuredEntries(),n=t.find(e=>!e.redacted&&e.value!==`[unavailable]`);return xW({primaryArg:n?{text:n.value}:void 0,secondary:[{text:`recorded tool`,tone:`warning`}],body:t.length>0?{kind:`key-values`,items:t.map(e=>({label:e.key,value:e.value,mono:!0,tone:e.redacted?`warning`:void 0}))}:void 0,safetyNotes:[`This tool is not in the active catalog. Review Details before approving it.`]})}};function $W(e){return Ci.safeParse(e).success}function eG(e){return $W(e)||WU(e)}function tG(e){return $W(e)?ZW[e]:WU(e)?XW(GU(e)):QW}function nG(e,t,n,r){return tG(e).present(uU(t),n,r)}var rG=8,iG=200;function aG(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function oG(e){return typeof e==`string`&&e.trim()?e:void 0}function sG(e){return(Array.isArray(e)?e:e===void 0?[]:[e]).flatMap(e=>{let t=aG(e),n=oG(t?.url)??oG(t?.href);if(!t||!n)return[];let r=oG(t.snippet)??oG(t.content)??oG(t.description)??oG(t.summary);return[{title:oG(t.title)??oG(t.name)??oG(t.label)??n,url:n,...r?{snippet:r}:{}}]})}function cG(e){let t=e==null?``:typeof e==`string`?e:JSON.stringify(e);return t.length>iG?`${t.slice(0,199)}…`:t}function lG(e){let t=aG(e);if(t&&Array.isArray(t.columns)&&Array.isArray(t.rows)){let e=t.columns.slice(0,rG).map(cG);return{columns:e,rows:t.rows.map(t=>e.map((e,n)=>cG(Array.isArray(t)?t[n]:``)))}}if(!Array.isArray(e))return;let n=e.flatMap(e=>{let t=aG(e);return t?[t]:[]});if(n.length===0)return;let r=[...new Set(n.flatMap(e=>Object.keys(e)))].slice(0,rG);return{columns:r,rows:n.map(e=>r.map(t=>cG(e[t])))}}function uG(e){return(Array.isArray(e)?e:[e]).flatMap(e=>{let t=oG(e)??oG(aG(e)?.handle);return t?[t]:[]})}function dG(e){for(let t of e){if(t.type===`links`)return{count:sG(t.value).length,noun:`result`};if(t.type===`table`)return{count:lG(t.value)?.rows.length??0,noun:`row`}}}function fG(e,t){let n=[],r=t.primaryArg;switch(e.action){case`prompt`:{let t=e.assignments.filter(e=>e.disposition===`created`).length,i=e.assignments.filter(e=>e.disposition===`follow_up`).length;r??=e.assignments.length>0?{text:dW(e.assignments.length,`sub-agent`)}:void 0,t>0&&n.push({text:`${t} created`}),i>0&&n.push({text:`${i} follow-up`});break}case`status`:r??={text:e.name??`all sub-agents`},e.name?FU(e.header).length>0&&n.push(...(e.header??``).split(` · `).slice(1).map(e=>({text:e.trim()})).filter(e=>e.text)):e.rows.length>0&&n.push({text:dW(e.rows.length,`sub-agent`)});break;case`stop`:r??=e.names.length>0?{text:dW(e.names.length,`sub-agent`)}:void 0}return{...t,primaryArg:r,meta:n}}var pG=new WeakMap;function mG(e,t){let n=pG.get(e);if(n)return n;let r=_G(e,t);return pG.set(e,r),r}function hG(e){return!(!e||e.replace(/\r\n/g,`
67
+ `).replace(/\r/g,`
68
+ `).includes(`
69
+ `))}function gG(e,t){let n=`previewOverflow`in t?t.previewOverflow:void 0,r=n?mW(n.hidden,n.noun,n.direction):void 0,{tone:i,pulse:a}=gW(t,e),o=t,s=nG(t.toolName,{args:o.args,argsPreview:o.argsPreview},`completed`,t.cwd),c={badge:t.toolName,primaryArg:s.primaryArg,meta:[],dotTone:i,dotPulse:a};switch(e.kind){case`read`:{let t=e.relPath?{text:e.relPath,openPath:e.path}:void 0;if(e.image)return{...c,primaryArg:t,meta:[{text:`image`}]};let n=[];return e.lineLabel&&!s.secondary.some(e=>e.key===`read-range`)&&n.push({key:`read-range`,text:e.lineLabel}),e.truncated&&n.push({text:`truncated`,tone:`warning`}),n.push(...yW(e)),{...c,primaryArg:t,meta:n,detailsAction:r??pW(e.lineCount??0,`lines`)}}case`bash`:{let t=[],n=e.outputLineCount;e.exitCode!==void 0&&t.push({key:`exit`,text:`exit ${e.exitCode}`,...e.exitCode===0?{}:{tone:`destructive`}}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),e.backgroundTask&&(t.push({text:`background ${e.backgroundTask.taskId}`,tone:`warning`,mono:!0}),t.push({text:e.backgroundTask.status})),n>0&&t.push({text:dW(n,`line`)}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),t.push(...yW(e,{includeLiveLimit:!1})),e.savedTo&&!vW(e,e.savedTo)&&t.push({text:`saved ${sW(e.savedTo)}`,mono:!0,openPath:e.savedTo});let i=fW(e.command),a=Math.max(0,i-6),o=a+Math.max(0,n-6);return{...c,...e.backgroundTask?{dotTone:`warning`,dotPulse:!1,glyph:`pending`}:{},backgroundTaskId:e.backgroundTask?.taskId,primaryArg:e.command?hG(e.command)?{text:e.command}:{text:`inline`}:c.primaryArg,meta:t,detailsAction:r??(a>0?mW(o,`lines`,`mixed`):pW(n,`lines`,`tail`))}}case`python`:{let t=[],n=e.outputLineCount;e.exitCode!==void 0&&e.exitCode!==0&&t.push({key:`exit`,text:`exit ${e.exitCode}`,tone:`destructive`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),e.timedOut&&t.push({text:`timed out`,tone:`destructive`});let i=uW(e.durationMs);i&&t.push({text:i}),n>0&&t.push({text:dW(n,`line`)}),e.artifacts&&e.artifacts.length>0&&t.push({text:dW(e.artifacts.length,`artifact`),tone:`info`}),e.streams?.stdout?.truncated&&t.push({text:`stdout truncated`,tone:`warning`}),e.streams?.stderr?.truncated&&t.push({text:`stderr truncated`,tone:`warning`}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),t.push(...yW(e)),e.savedTo&&!vW(e,e.savedTo)&&t.push({text:`saved ${sW(e.savedTo)}`,mono:!0,openPath:e.savedTo});let a=Math.max(0,e.codeLineCount-6)+Math.max(0,n-6),o=r??mW(a,`lines`,`mixed`),s=e.inputMode===`file`&&e.relScriptPath?{text:e.relScriptPath,openPath:e.scriptPath}:e.code&&hG(e.code)?{text:e.code}:{text:`inline`};return{...c,primaryArg:s,meta:t,detailsAction:o}}case`edit`:{let t=[];return s.secondary.some(e=>e.key===`add`)||(t.push({key:`add`,text:`+${e.additions}`,tone:`success`}),t.push({key:`del`,text:`−${e.deletions}`,tone:`destructive`})),{...c,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,detailsAction:r??pW(e.diffLineCount,`lines`)}}case`write`:{let t=[];return e.outcome&&t.push({key:`write-outcome`,text:e.outcome,tone:`success`}),e.lineCount!==void 0&&!s.secondary.some(e=>e.key===`write-lines`)&&t.push({key:`write-lines`,text:dW(e.lineCount,`line`)}),{...c,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,detailsAction:r??pW(e.lineCount??0,`lines`)}}case`grep`:return{...c,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{key:`matches`,text:dW(e.totalMatches??e.matchCount,`match`,`es`)},{key:`files`,text:dW(e.totalFiles??e.fileCount,`file`)}],detailsAction:r??pW(e.matchCount,`matches`)};case`find`:return{...c,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:dW(e.count,`file`)}],detailsAction:r??pW(e.count,`files`)};case`ls`:return{...c,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:[{text:`${e.total} ${e.total===1?`entry`:`entries`}`}],detailsAction:r??pW(e.total,`entries`)};case`web_fetch`:{let t=[];e.status!==void 0&&t.push({text:`${e.status}`,tone:e.status>=400?`destructive`:`success`}),e.contentType&&t.push({text:e.contentType});let n=lW(e.size);return n&&t.push({text:n}),e.converted&&t.push({text:`markdown`,tone:`info`}),e.savedTo&&!vW(e,e.savedTo)&&t.push({text:`saved ${sW(e.savedTo)}`,mono:!0,openPath:e.savedTo}),t.push(...yW(e)),{...c,primaryArg:e.url?{text:e.url,href:e.url}:void 0,meta:t,detailsAction:r??pW(fW(e.content),`lines`)}}case`quick_script`:{let t=[];e.status&&e.status!==`completed`&&t.push({text:e.status.replaceAll(`_`,` `),tone:`destructive`}),e.hostCalls.length>0&&t.push({text:dW(e.hostCalls.length,`SDK call`)}),e.artifacts.length>0&&t.push({text:dW(e.artifacts.length,`artifact`)});let n=e.hostCalls.filter(e=>e.outcome===`denied`);return n.length>0&&t.push({text:`${n.length} denied`,tone:`warning`}),e.outputTruncated&&t.push({text:`truncated`,tone:`warning`}),{...c,meta:t}}case`extension`:{let t=dG(e.sections);return{...c,meta:e.live?[{text:`generating`,tone:`info`}]:t?[{text:dW(t.count,t.noun)}]:[],detailsAction:t?r??pW(t.count,`${t.noun}s`):r}}case`subagent`:return fG(e,c);case`ask_user`:return{...c,primaryArg:e.questions.length?{text:`${e.questions.length} question${e.questions.length===1?``:`s`}`}:void 0,meta:e.questions.length>1&&t.status===`completed`?[{key:`answered`,text:`${e.questions.filter(e=>e.answer!==void 0&&!e.skipped).length}/${e.questions.length} answered`,tone:e.questions.every(e=>e.answer!==void 0&&!e.skipped)?`success`:`warning`}]:[]};case`plan_present`:return{...c,badge:`plan_${e.action}`,primaryArg:c.primaryArg??(e.planPath?{text:e.planPath,openPath:e.planPath}:void 0),meta:[],detailsAction:r};default:return c}}function _G(e,t){let n=gG(e,t),r=t,i=nG(t.toolName,{args:r.args,argsPreview:r.argsPreview},`completed`,t.cwd),a=new Map;for(let e of[...i.secondary,...n.meta]){let t=e.key??`result:${e.text.replace(/\d+(?:\.\d+)?/g,`#`)}`;a.set(t,{...e,key:t})}return{...n,primaryArg:n.primaryArg,meta:[...a.values()]}}var vG=O(`<span class="stream-fresh"> </span>`);function yG(e,n){c(n,!0);let r=K(n,`fade`,3,!0),i=new Dc({initialText:me(()=>n.text)}),a=L(()=>{let e=performance.now();return i.update(n.text,e),!r()||Tc.current?(i.settle(),[{start:0,end:n.text.length,fresh:!1,ageMs:0}]):i.segments(0,n.text.length,e)});var o=f(),s=R(o);v(s,17,()=>t(a),e=>e.start,(e,r)=>{var i=f(),a=R(i),o=e=>{var i=vG(),a=z(i,!0);E(i,(e,t)=>Nc?.(e,t),()=>t(r).ageMs),F(e=>w(a,e),[()=>n.text.slice(t(r).start,t(r).end)]),k(e,i)},s=e=>{var i=g();F(e=>w(i,e),[()=>n.text.slice(t(r).start,t(r).end)]),k(e,i)};l(a,e=>{t(r).fresh?e(o):e(s,-1)}),k(e,i)}),k(e,o),D()}function bG(e,t=0){if(!e)return t;let n=e.trim();if(!n.endsWith(`px`))return t;let r=Number.parseFloat(n.slice(0,-2));return Number.isFinite(r)?r:t}function xG(e,t,n=16){let r=bG(e);if(r>0)return r;let i=bG(t,n);return i>0?i*1.4:n*1.4}function SG(e){let t=e.borderBoxWidth-e.paddingLeft-e.paddingRight-e.borderLeftWidth-e.borderRightWidth;return Math.max(0,t)}function CG(e,t){return!Number.isFinite(t)||t<=0?!1:e===void 0||Math.abs(e-t)>.5}function wG(e,t){return e<=0||t<=0?0:Math.max(1,Math.round(e/t))}function TG(e){let t=Math.max(1,Math.floor(e.fixedRows)),n=Math.max(1,Math.ceil(e.fallbackRows)),r=e.measuredRows!==void 0&&e.measuredRows>0?Math.ceil(e.measuredRows):n,i=Math.min(Math.max(1,r),t);return Math.max(e.previousRows,i)}var EG={request:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)},DG=new class{#e=new Map;#t;#n;constructor(e){this.#n=e}queue(e,t){if(this.#e.set(e,t),this.#t!==void 0)return;let n=this.#n??(typeof requestAnimationFrame>`u`?void 0:EG);n?this.#t=n.request(()=>{this.#t=void 0,this.flush()}):this.flush()}cancel(e){this.#e.delete(e),this.#e.size===0&&this.#t!==void 0&&((this.#n??EG).cancel(this.#t),this.#t=void 0)}flush(){let e=[...this.#e.values()];this.#e.clear();let t=e.map(e=>({task:e,value:e.read()}));for(let{task:e,value:n}of t)n!==void 0&&e.apply(n)}},OG=Symbol(`card-sheet`);function kG(){o(OG,!0)}function AG(){return a(OG)===!0}var jG=(e,t=m)=>{var n=f(),r=R(n);se(r,t),k(e,n)},MG=O(`<span class="stream-fresh"> </span>`),NG=O(`<div data-terminal="true"><div class="code-block__viewport svelte-hhy3gv"><div></div></div></div>`),PG=O(`<span class="code-caret svelte-hhy3gv" aria-hidden="true"></span>`),FG=O(`<span class="diff-line svelte-hhy3gv"><!><!></span>`),IG=O(`<div data-language="diff"><div class="code-block__viewport svelte-hhy3gv"><pre></pre></div></div>`),LG=O(`<span class="code-line svelte-hhy3gv" data-highlight-enter=""><!></span>`),RG=O(`<!><!>`,1),zG=O(`<pre><!><!></pre>`),BG=O(`<div><div class="code-block__viewport svelte-hhy3gv"><div><!></div></div></div>`);function VG(e,n){c(n,!0);let r=(e,n=m,r=m,i=m)=>{var a=f(),o=R(a);v(o,17,()=>Te(r(),i()),e=>e.start,(e,r)=>{var i=f(),a=R(i),o=e=>{var i=MG(),a=z(i,!0);E(i,(e,t)=>Nc?.(e,t),()=>t(r).ageMs),F(e=>w(a,e),[()=>n().slice(t(r).start,t(r).end)]),k(e,i)},s=e=>{var i=g();F(e=>w(i,e),[()=>n().slice(t(r).start,t(r).end)]),k(e,i)};l(a,e=>{t(r).fresh?e(o):e(s,-1)}),k(e,i)}),k(e,a)},i=K(n,`maxHeight`,3,`18rem`),a=K(n,`trim`,3,!0),o=K(n,`highlight`,3,!0),s=K(n,`wrap`,3,!0),u=K(n,`overflow`,3,`auto`),d=K(n,`terminal`,3,!1),p=K(n,`tail`,3,!1),_=K(n,`live`,3,!1),y=K(n,`caret`,3,!1),b=K(n,`streamMotion`,3,!1),S=K(n,`progressiveHighlight`,3,!1),C=K(n,`enter`,3,!1),T=AG(),O=L(()=>n.bare??T),A=Y(void 0),j=Y(void 0),M=Y(void 0),N=Y(void 0),P=Y(void 0),ee=Y(void 0),ne={lineHeight:void 0},re=L(()=>a()?Cc(n.code):{text:n.code}),ie=L(()=>`${n.language??``}\0${t(re).text}`),ae=L(()=>n.fixedRows!==void 0&&n.fixedRows>0),V=L(()=>Sd(t(re).text)),oe=L(()=>!d()&&(n.language??``).toLowerCase().trim()===`diff`),H=L(()=>t(oe)?pe(t(re).text):[]),ce=L(()=>{if(!t(ae))return 1;let e=t(re).text,r=e.length===0?1:e.split(`
70
+ `).length;return Math.min(Math.max(r,1),n.fixedRows)}),U=Y(0),le=0,ue=L(()=>p()&&(!_()||!t(ae)||t(U)>=n.fixedRows));function de(e){return e.startsWith(`@@`)?`hunk`:e.startsWith(`+++`)||e.startsWith(`---`)||e.startsWith(`diff `)?`file`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`delete`:`context`}function fe(e){return e.replace(/\r\n/g,`
71
+ `).replace(/\r/g,`
72
+ `)}function pe(e){let t=0;return fe(e).split(`
73
+ `).map(e=>{let n={text:e,tone:de(e),start:t};return t+=e.length+1,n})}function he(e){t(ae)&&n.fixedRows!==void 0&&B(U,TG({previousRows:t(U),measuredRows:e,fallbackRows:t(ce),fixedRows:n.fixedRows}),!0)}function ge(){DG.cancel(ne)}function _e(){if(!t(ae)||!t(N)||!t(P)||!t(ee)||n.fixedRows!==void 0&&t(U)>=n.fixedRows)return;let e=t(P).clientWidth;if(e<=0){let n=t(N).getBoundingClientRect(),r=getComputedStyle(t(N));e=SG({borderBoxWidth:n.width,paddingLeft:bG(r.paddingLeft),paddingRight:bG(r.paddingRight),borderLeftWidth:bG(r.borderLeftWidth),borderRightWidth:bG(r.borderRightWidth)})}if(!(e<=0)){if(ne.lineHeight===void 0){let e=getComputedStyle(t(ee));ne.lineHeight=xG(e.lineHeight,e.fontSize)}return le=ne.lineHeight,wG(t(ee).scrollHeight,le)}}function ve(e){!n.onActivate||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),n.onActivate())}function Z(){t(ae)&&DG.queue(ne,{read:_e,apply:he})}W(()=>{t(ae)?he():(B(U,0),ge())}),W(()=>{t(ie),t(j),d(),t(oe),n.fixedRows,t(ae)&&Z()}),W(()=>{if(!t(ae)||!t(N)||!t(P)||!t(ee)||typeof ResizeObserver>`u`)return;let e,n=new ResizeObserver(t=>{let n=t.at(-1);if(!n)return;let r=n.contentBoxSize[0]?.inlineSize??n.contentRect.width;CG(e,r)&&(e=r,Z())});return n.observe(t(P)),Z(),()=>n.disconnect()}),W(()=>()=>ge());let ye=L(()=>t(ae)?String(n.fixedRows):void 0),be=L(()=>t(ae)?String(Math.max(t(U),1)):void 0);W(()=>{if(d()||!o()||t(oe)){B(A,void 0),B(j,void 0),B(M,void 0);return}let e=t(ie);if(t(j)===e||t(M)===e)return;let r=Rc(t(re).text,n.language),i=r.result;if(typeof i==`string`){B(A,i,!0),B(j,e,!0),B(M,void 0),r.release();return}if(!i){B(M,e,!0),r.release();return}let a=!1;return i.then(n=>{a||t(ie)!==e||(n?(B(A,n,!0),B(j,e,!0),B(M,void 0)):B(M,e,!0))}),()=>{a=!0,r.release()}});let xe=L(()=>b()&&!Tc.current),Se=L(()=>t(oe)?fe(t(re).text):t(re).text),Ce=new Dc({initialText:me(()=>t(Se))}),we=L(()=>{let e=performance.now();return Ce.update(t(Se),e),t(xe)||Ce.settle(),e});function Te(e,n){return Ce.segments(e,n,t(we))}let Ee=L(()=>{if(!d())return``;let e=t(re).text,n=Te(0,e.length);return n.some(e=>e.fresh)?n.map(t=>{let n=Sd(e.slice(t.start,t.end));return t.fresh?`<span class="stream-fresh" style="animation-delay:${-Math.round(t.ageMs)}ms">${n}</span>`:n}).join(``):t(V)}),De=L(()=>t(xe)&&_()&&t(ue)&&t(ae)&&t(U)>=(n.fixedRows??1/0)),Oe;W(()=>{let e=t(we),n=t(ee);if(e===Oe)return;Oe=e;let r=Ce.lastAppended;if(!t(De)||!n||!r||le<=0)return;let i=0;for(let e=r.start;e<r.end;e+=1)t(Se).charCodeAt(e)===10&&(i+=1);if(i===0)return;let a=Math.min(i,4)*le;n.animate([{transform:`translateY(${a}px)`},{transform:`translateY(0)`}],{duration:170,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`,composite:`add`})});let ke=Y(!1),Ae=!1,je;W(()=>{o()&&t(A)&&t(j)===t(ie)?Ae&&(Ae=!1,t(xe)&&(B(ke,!0),clearTimeout(je),je=setTimeout(()=>{je=void 0,B(ke,!1)},450))):Ae=!0}),W(()=>()=>clearTimeout(je));let Me=new yo,Ne=new Map,Pe=!1,Fe=L(()=>S()&&!o()&&!d()&&!t(oe)&&!!n.language&&!Tc.current);function Ie(e){return/<span class="line">([\s\S]*)<\/span><\/code>/.exec(e)?.[1]}function Le(e,t){let n=Ie(t);n!==void 0&&Me.set(e,{html:n,at:performance.now()})}function Re(e){if(!Pe)for(let t of e){if(!t.trim()||Me.has(t)||Ne.has(t))continue;let e=Rc(t,n.language),r=e.result;typeof r==`string`?(Le(t,r),e.release()):r?(Ne.set(t,e),r.then(n=>{Ne.delete(t),e.release(),!Pe&&n&&Le(t,n)})):e.release()}}let ze=new Mc(Re,150);W(()=>{if(!t(Fe))return;let e=t(re).text.split(`
74
+ `);e.pop(),ze.enqueue(e)});let Be=L(()=>{if(!t(Fe))return[];let e=t(re).text.split(`
75
+ `),n=Object.create(null),r=0;return e.map((t,i)=>{let a=n[t]??0;n[t]=a+1;let o=i===e.length-1,s={key:`${t}\0${a}`,text:t,start:r,highlighted:o?void 0:Me.get(t),last:o};return r+=t.length+1,s})});function Ve(e,t){t>0&&e.style.setProperty(`--highlight-delay`,`${-Math.round(t)}ms`)}W(()=>()=>{Pe=!0,ze.destroy();for(let e of Ne.values())e.release();Ne.clear()});var He=f(),Ue=R(He),We=e=>{var r=NG();let a,o;var c=q(r);let l;var d=q(c);let f;se(d,()=>t(Ee),!0),x(d),te(d,e=>B(ee,e),()=>t(ee)),x(c),te(c,e=>B(P,e),()=>t(P)),x(r),te(r,e=>B(N,e),()=>t(N)),F(e=>{a=X(r,1,`code-block terminal-output svelte-hhy3gv`,null,a,{"code-block--bare":t(O),"code-block--interactive":e}),J(r,`role`,n.onActivate?`button`:void 0),J(r,`tabindex`,n.onActivate?0:void 0),J(r,`aria-label`,n.onActivate?n.activateLabel:void 0),J(r,`data-wrap`,s()?`true`:`false`),J(r,`data-overflow`,u()),J(r,`data-fixed-rows`,t(ae)?`true`:void 0),J(r,`data-tail`,t(ue)?`true`:void 0),o=I(r,``,o,{"--code-block-fixed-rows":t(ye),"--code-block-visible-rows":t(be)}),l=I(c,``,l,{"max-height":t(ae)?void 0:i()}),f=X(d,1,`code-block__content svelte-hhy3gv`,null,f,{"stream-item-enter":C()})},[()=>!!n.onActivate]),h(`click`,r,function(...e){n.onActivate?.apply(this,e)}),h(`keydown`,r,ve),k(e,r)},Ge=e=>{var a=IG();let o,c;var d=q(a);let f;var p=q(d);let m;v(p,23,()=>t(H),(e,t)=>`${t}:${e.text}`,(e,n,i)=>{var a=FG(),o=q(a);r(o,()=>t(Se),()=>t(n).start,()=>t(n).start+t(n).text.length);var s=G(o),c=e=>{var t=PG();k(e,t)};l(s,e=>{y()&&t(i)===t(H).length-1&&e(c)}),x(a),F(()=>J(a,`data-tone`,t(n).tone)),k(e,a)}),x(p),te(p,e=>B(ee,e),()=>t(ee)),x(d),te(d,e=>B(P,e),()=>t(P)),x(a),te(a,e=>B(N,e),()=>t(N)),F(e=>{o=X(a,1,`code-block svelte-hhy3gv`,null,o,{"code-block--bare":t(O),"code-block--interactive":e}),J(a,`role`,n.onActivate?`button`:void 0),J(a,`tabindex`,n.onActivate?0:void 0),J(a,`aria-label`,n.onActivate?n.activateLabel:void 0),J(a,`data-wrap`,s()?`true`:`false`),J(a,`data-overflow`,u()),J(a,`data-fixed-rows`,t(ae)?`true`:void 0),J(a,`data-tail`,t(ue)?`true`:void 0),c=I(a,``,c,{"--code-block-fixed-rows":t(ye),"--code-block-visible-rows":t(be)}),f=I(d,``,f,{"max-height":t(ae)?void 0:i()}),m=X(p,1,`code-block__content code-block__content--diff svelte-hhy3gv`,null,m,{"stream-item-enter":C()})},[()=>!!n.onActivate]),h(`click`,a,function(...e){n.onActivate?.apply(this,e)}),h(`keydown`,a,ve),k(e,a)},Ke=e=>{var a=BG();let c,d;var p=q(a);let m;var _=q(p);let b;var S=q(_),w=e=>{var n=f(),r=R(n);se(r,()=>t(A)),k(e,n)},T=e=>{var n=zG(),i=q(n);v(i,17,()=>t(Be),e=>e.key,(e,n)=>{var i=RG(),a=R(i),o=e=>{var r=LG();jG(q(r),()=>t(n).highlighted.html),x(r),E(r,(e,t)=>Ve?.(e,t),()=>t(we)-t(n).highlighted.at),k(e,r)},s=e=>{r(e,()=>t(re).text,()=>t(n).start,()=>t(n).start+t(n).text.length)};l(a,e=>{t(n).highlighted?e(o):e(s,-1)});var c=G(a),u=e=>{var t=g();t.nodeValue=`
76
+ `,k(e,t)};l(c,e=>{t(n).last||e(u)}),k(e,i)});var a=G(i),o=e=>{var t=PG();k(e,t)};l(a,e=>{y()&&e(o)}),x(n),k(e,n)},D=e=>{var n=zG(),i=q(n);r(i,()=>t(re).text,()=>0,()=>t(re).text.length);var a=G(i),o=e=>{var t=PG();k(e,t)};l(a,e=>{y()&&e(o)}),x(n),k(e,n)};l(S,e=>{o()&&t(A)&&t(j)===t(ie)?e(w):t(Fe)?e(T,1):e(D,-1)}),x(_),te(_,e=>B(ee,e),()=>t(ee)),x(p),te(p,e=>B(P,e),()=>t(P)),x(a),te(a,e=>B(N,e),()=>t(N)),F(e=>{c=X(a,1,`code-block svelte-hhy3gv`,null,c,{"code-block--bare":t(O),"code-block--interactive":e}),J(a,`role`,n.onActivate?`button`:void 0),J(a,`tabindex`,n.onActivate?0:void 0),J(a,`aria-label`,n.onActivate?n.activateLabel:void 0),J(a,`data-wrap`,s()?`true`:`false`),J(a,`data-overflow`,u()),J(a,`data-fixed-rows`,t(ae)?`true`:void 0),J(a,`data-tail`,t(ue)?`true`:void 0),d=I(a,``,d,{"--code-block-fixed-rows":t(ye),"--code-block-visible-rows":t(be)}),m=I(p,``,m,{"max-height":t(ae)?void 0:i()}),b=X(_,1,`code-block__content svelte-hhy3gv`,null,b,{"stream-item-enter":C()}),J(_,`data-highlight-enter`,t(ke)?``:void 0)},[()=>!!n.onActivate]),h(`click`,a,function(...e){n.onActivate?.apply(this,e)}),h(`keydown`,a,ve),k(e,a)};l(Ue,e=>{d()?e(We):t(oe)?e(Ge,1):e(Ke,-1)}),k(e,He),D()}ue([`click`,`keydown`]);var HG=Symbol(`tool-motion`),UG={streamMotion:!1,enter:!1};function WG(e){o(HG,e)}function GG(){return a(HG)??UG}function KG(e){return`${Math.min(e,6)*22}ms`}function qG(e,n){c(n,!0);let r=K(n,`direction`,3,`head`),i=K(n,`collapsedLines`,3,6),a=K(n,`expanded`,3,!1),o=K(n,`terminal`,3,!1),s=K(n,`live`,3,!1),l=K(n,`overflow`,3,`auto`),u=GG(),d=L(()=>n.streamMotion??u.streamMotion),f=L(()=>!s()&&(n.enter??u.enter)),p=L(()=>s()&&t(d)&&!a()&&r()===`tail`&&!Tc.current),m=Y(U(me(()=>n.text.length))),h=new Oc(me(()=>n.text.length),{onReveal:e=>B(m,e,!0),pacer:{targetLagS:.12}});function g(e,t){let n=t;for(let t=e.length-2;t>=0;--t)if(e.charCodeAt(t)===10&&(--n,n===0))return t+1;return 0}W(()=>{let e=n.text;t(p)?me(()=>{let t=g(e,i()+4);h.shownLength<t&&h.snap(t),h.setTarget(e.length)}):(h.snap(e.length),B(m,e.length,!0))}),W(()=>()=>h.destroy());let _=L(()=>{if(!t(p))return n.text;let e=Math.min(t(m),n.text.length);return e>=n.text.length?n.text:n.text.slice(0,n.text.lastIndexOf(`
77
+ `,e-1)+1)}),v=L(()=>{if(a())return t(_);if(r()===`tail`)return SH(t(_),i()+(s()?4:0));let e=bH(t(_));return e.length<=i()?t(_):e.slice(0,i()).join(`
78
+ `)});{let c=L(()=>s()&&!a()),u=L(()=>t(d)&&!a()),p=L(()=>a()?`auto`:l()),m=L(()=>a()?void 0:i()),h=L(()=>!a()&&r()===`tail`);VG(e,{get code(){return t(v)},get language(){return n.language},trim:!1,get terminal(){return o()},get live(){return t(c)},get streamMotion(){return t(u)},get enter(){return t(f)},get overflow(){return t(p)},get fixedRows(){return t(m)},get tail(){return t(h)},get onActivate(){return n.onActivate},get activateLabel(){return n.activateLabel}})}D()}var JG=O(`<div><!></div>`);function YG(e,t){c(t,!0),kG();var r=JG(),i=q(r);n(i,()=>t.children??m),x(r),F(e=>X(r,1,e),[()=>T(ft(`min-w-0 overflow-hidden rounded-sm border bg-well [&>*+*]:border-t`,t.class))]),k(e,r),D()}function XG(e,t){c(t,!0);let r=AG();var i=f(),a=R(i),o=e=>{var r=f(),i=R(r);n(i,()=>t.children),k(e,r)},s=e=>{YG(e,{children:(e,r)=>{var i=f(),a=R(i);n(a,()=>t.children),k(e,i)},$$slots:{default:!0}})};l(a,e=>{r?e(o):e(s,-1)}),k(e,i),D()}var ZG=O(`<p class="m-0 font-mono text-ui text-muted-foreground wrap-anywhere"> </p>`),QG=O(`<!> <!>`,1),$G=O(`<span class="font-mono"> </span>`),eK=O(`; full diff: <!>`,1),tK=O(`<p class="m-0 text-ui text-muted-foreground">Diff cut<!></p>`),nK=O(`<div class="grid min-w-0 gap-1 pt-1 pb-0.5 pl-5.5"><!> <!></div>`),rK=O(`<button type="button" class="cursor-pointer border-0 bg-transparent p-0 font-mono text-primary hover:text-primary-strong disabled:cursor-default disabled:text-muted-foreground" title="Open in a new tab"> </button>`),iK=O(`<li class="min-w-0 truncate px-2.5 py-0.5 font-mono text-ui text-foreground"> </li>`),aK=O(`<ul class="m-0 list-none p-0 py-1" aria-label="Operations"></ul>`),oK=O(`<li class="px-2.5 py-0.5 text-caption text-muted-foreground"> </li>`),sK=O(`<span class="text-info">dry run</span>`),cK=O(`<button type="button" class="flex flex-none cursor-pointer items-baseline gap-1.5 rounded-sm border-0 bg-transparent p-0 text-caption text-muted-foreground tabular-nums outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-focus"><span> </span> <span class="text-success"> </span> <span class="text-destructive"> </span> <!> <!></button>`),lK=O(`<span class="flex-none text-caption text-muted-foreground tabular-nums"> </span>`),uK=O(`<li class="min-w-0 px-2.5 py-0.5 text-ui"><div class="flex min-w-0 items-baseline gap-2"><!> <span class="flex-none font-mono text-foreground"> </span> <span class="min-w-0 flex-1 truncate text-muted-foreground"><!></span> <!> <!></div> <!></li>`),dK=O(`<ul class="m-0 list-none p-0 py-1" aria-label="SDK calls"><!> <!> <!></ul>`),fK=O(`<p class="m-0 flex min-w-0 flex-wrap items-baseline gap-x-2 px-2.5 py-1 text-ui text-muted-foreground"><span>Created</span> <span class="min-w-0 text-foreground"> </span></p>`),pK=O(`<p class="m-0 flex min-w-0 flex-wrap items-baseline gap-x-2 px-2.5 py-1 text-ui text-muted-foreground"><span>Files</span> <!></p>`),mK=O(`<div class="px-2.5 py-2" aria-label="Script output"><p class="m-0 mb-1 text-ui text-muted-foreground">Output</p> <!></div>`),hK=O(`<p class="m-0 px-2.5 py-2 text-ui text-destructive [overflow-wrap:anywhere]"> </p>`),gK=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground" aria-label="Script output">No output.</div>`),_K=O(`<!> <!> <!> <!> <!>`,1);function vK(e,n){c(n,!0);let r=(e,n=m)=>{let r=L(()=>OU(n().diff)),a=L(()=>n().diffFile?t(C).get(n().diffFile):void 0);var o=nK(),s=q(o);v(s,17,()=>t(r).files,b,(e,n)=>{var r=QG(),i=R(r),a=e=>{var r=ZG(),i=z(r,!0);F(()=>w(i,t(n).path)),k(e,r)};l(i,e=>{t(n).path&&e(a)});var o=G(i,2),s=e=>{qG(e,{get text(){return t(n).diff},language:`diff`,expanded:!0})};l(o,e=>{t(n).diff&&e(s)}),k(e,r)});var c=G(s,2),u=e=>{var r=tK(),o=G(q(r)),s=e=>{var r=eK(),o=G(R(r)),s=e=>{i(e,()=>t(a))},c=e=>{var t=$G(),r=z(t,!0);F(()=>w(r,n().diffFile)),k(e,t)};l(o,e=>{t(a)?e(s):e(c,-1)}),k(e,r)};l(o,e=>{n().diffFile&&e(s)}),x(r),k(e,r)};l(c,e=>{t(r).cut&&e(u)}),x(o),k(e,o)},i=(e,t=m)=>{var r=rK(),i=z(r,!0);F(()=>{r.disabled=!n.onOpenFile,w(i,t().handle)}),h(`click`,r,()=>n.onOpenFile?.(t().path)),k(e,r)},a=K(n,`expanded`,3,!1),o=L(()=>a()?n.view.hostCalls:n.view.liveCalls?n.view.hostCalls.slice(-6):n.view.hostCalls.slice(0,6)),s=L(()=>n.view.hostCalls.length-t(o).length),u=L(()=>n.view.liveCalls&&!a()?t(s):0),d=L(()=>n.view.status!==void 0&&n.view.status!==`completed`),p=L(()=>n.view.hostCalls.length===0?oW(n.view.plannedOperations):[]),_=L(()=>SU(n.view.output)?``:n.view.output),y=L(()=>n.view.status!==void 0||n.toolCall.status===`completed`),S=L(()=>n.view.hostCalls.length>0||t(p).length>0||n.view.artifacts.length>0||n.view.created.length>0||t(_).length>0||t(y)),C=L(()=>new Map(n.view.artifacts.map(e=>[e.handle,e]))),T=/(artifact:[A-Za-z0-9._-]+)/;function E(e){return e.split(T).filter(Boolean).map(e=>({text:e,artifact:t(C).get(e)}))}let O=L(()=>new Set(n.view.hostCalls.flatMap(e=>E(e.summary??``).flatMap(e=>e.artifact?[e.artifact.handle]:[])))),A=L(()=>n.view.artifacts.filter(e=>!t(O).has(e.handle))),j=new mo;function M(e){j.has(e)?j.delete(e):j.add(e)}var N=f(),P=R(N),I=e=>{XG(e,{children:(e,c)=>{var m=_K(),S=R(m),C=e=>{var n=aK();v(n,21,()=>t(p),b,(e,n)=>{var r=iK(),i=z(r,!0);F(()=>{J(r,`title`,t(n)),w(i,t(n))}),k(e,r)}),x(n),k(e,n)};l(S,e=>{t(p).length>0&&e(C)});var T=G(S,2),D=e=>{var n=dK(),a=q(n),c=e=>{var n=oK(),r=z(n);F(()=>w(r,`+${t(u)??``} earlier`)),k(e,n)};l(a,e=>{t(u)>0&&e(c)});var d=G(a,2);v(d,19,()=>t(o),(e,n)=>t(u)+n,(e,n,a)=>{let o=L(()=>CU(t(n))),s=L(()=>j.has(t(u)+t(a)));var c=uK(),d=q(c),p=q(d),m=e=>{dn(e,{class:`size-3.5 flex-none translate-y-0.5 text-muted-foreground`,"aria-label":`Running`})},_=e=>{Wn(e,{class:`size-3.5 flex-none translate-y-0.5 text-success`,"aria-label":`Completed`})},y=e=>{Zh(e,{class:`size-3.5 flex-none translate-y-0.5 text-warning`,"aria-label":`Denied`})},S=e=>{xd(e,{class:`size-3.5 flex-none translate-y-0.5 text-destructive`,"aria-label":`Failed`})};l(p,e=>{t(n).outcome===`running`?e(m):t(n).outcome===`completed`?e(_,1):t(n).outcome===`denied`?e(y,2):e(S,-1)});var C=G(p,2),T=z(C,!0),D=G(C,2),O=q(D),A=e=>{var r=f(),a=R(r);v(a,17,()=>E(t(n).summary??``),b,(e,n)=>{var r=f(),a=R(r),o=e=>{i(e,()=>t(n).artifact)},s=e=>{var r=g();F(()=>w(r,t(n).text)),k(e,r)};l(a,e=>{t(n).artifact?e(o):e(s,-1)}),k(e,r)}),k(e,r)},N=e=>{var r=g();F(()=>w(r,t(n).error??t(n).summary??``)),k(e,r)};l(O,e=>{t(n).outcome===`completed`||t(n).outcome===`running`?e(A):e(N,-1)}),x(D);var P=G(D,2),I=e=>{let n=L(()=>wU(t(o)));var r=cK(),i=q(r),c=z(i,!0),d=G(i,2),f=z(d,!0),p=G(d,2),m=z(p,!0),g=G(p,2),_=e=>{var t=sK();k(e,t)};l(g,e=>{t(n).dryRun&&e(_)});var v=G(g,2);{let e=L(()=>`size-3 self-center transition-transform ${t(s)?`rotate-90`:``}`);mn(v,{get class(){return t(e)},"aria-hidden":`true`})}x(r),F(e=>{J(r,`aria-expanded`,t(s)),J(r,`aria-label`,e),J(r,`title`,t(s)?`Hide diff`:`Show diff`),w(c,t(n).files),w(f,t(n).added),w(m,t(n).removed)},[()=>`${t(s)?`Hide`:`Show`} diff: ${TU(t(o))}`]),h(`click`,r,()=>M(t(u)+t(a))),k(e,r)};l(P,e=>{t(o)&&e(I)});var ee=G(P,2),te=e=>{var r=lK(),i=z(r,!0);F(e=>w(i,e),[()=>uW(t(n).durationMs)]),k(e,r)};l(ee,e=>{t(n).outcome!==`running`&&e(te)}),x(d);var ne=G(d,2),re=e=>{r(e,()=>t(o))};l(ne,e=>{t(o)&&t(s)&&e(re)}),x(c),F(e=>{J(d,`title`,e),w(T,t(n).method)},[()=>t(n).outcome===`running`?void 0:[t(n).targets?.join(`, `),t(n).error].filter(Boolean).join(` — `)||void 0]),k(e,c)});var p=G(d,2),m=e=>{var n=oK(),r=z(n);F(()=>w(r,`+${t(s)??``} more`)),k(e,n)};l(p,e=>{t(s)>0&&t(u)===0&&e(m)}),x(n),k(e,n)};l(T,e=>{n.view.hostCalls.length>0&&e(D)});var O=G(T,2),N=e=>{var t=fK(),r=G(q(t),2),i=z(r,!0);x(t),F(e=>w(i,e),[()=>n.view.created.join(`, `)]),k(e,t)};l(O,e=>{n.view.created.length>0&&e(N)});var P=G(O,2),I=e=>{var n=pK(),r=G(q(n),2);v(r,17,()=>t(A),e=>e.handle,(e,n)=>{i(e,()=>t(n))}),x(n),k(e,n)};l(P,e=>{t(A).length>0&&e(I)});var ee=G(P,2),te=e=>{var n=mK();qG(G(q(n),2),{get text(){return t(_)},get expanded(){return a()}}),x(n),k(e,n)},ne=e=>{var t=hK(),r=z(t,!0);F(e=>w(r,e),[()=>n.view.error??n.view.status?.replaceAll(`_`,` `)]),k(e,t)},re=e=>{var t=gK();k(e,t)};l(ee,e=>{t(_).length>0?e(te):t(d)?e(ne,1):t(y)&&e(re,2)}),k(e,m)},$$slots:{default:!0}})};l(P,e=>{t(S)&&e(I)}),k(e,N),D()}ue([`click`]);var yK=Symbol.for(`nerve.conversationUi.capabilities`);function bK(e){return o(yK,e)}function xK(){return a(yK)??{askUserDrafts:dU()}}function SK(e,n){c(n,!0);let r=L(()=>ft(`tabular-nums`,n.item.mono&&`font-mono`));var i=f(),a=R(i),o=e=>{{let i=L(()=>n.item.tone??`neutral`);be(e,{get variant(){return t(i)},get class(){return t(r)},get title(){return n.item.openPath},onclick:()=>n.onOpenFile?.(n.item.openPath),children:(e,t)=>{y();var r=g();F(()=>w(r,n.item.text)),k(e,r)},$$slots:{default:!0}})}},s=e=>{{let i=L(()=>n.item.tone??`neutral`);be(e,{get variant(){return t(i)},get class(){return t(r)},get href(){return n.item.href},target:`_blank`,rel:`noreferrer noopener`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.item.text)),k(e,r)},$$slots:{default:!0}})}},u=e=>{{let i=L(()=>n.item.tone??`neutral`);be(e,{get variant(){return t(i)},get class(){return t(r)},children:(e,t)=>{y();var r=g();F(()=>w(r,n.item.text)),k(e,r)},$$slots:{default:!0}})}};l(a,e=>{n.item.openPath?e(o):n.item.href?e(s,1):e(u,-1)}),k(e,i),D()}function CK(e){return e.key??e.text}var wK=class{seen=new Map;order(e){let t=new Map;for(let n of e){let e=CK(n);t.has(e)||t.set(e,n),this.seen.has(e)||this.seen.set(e,this.seen.size)}return[...t.entries()].sort(([e],[t])=>(this.seen.get(e)??0)-(this.seen.get(t)??0)).map(([,e])=>e)}reset(){this.seen.clear()}},TK=O(`<span class="inline-flex"><!></span>`),EK=O(`<div class="flex min-w-0 flex-wrap items-center gap-1.5"></div>`),DK=O(`<div class="ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1.5"><!> <!> <!></div>`),OK=O(`<div class="flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1.5"><!> <!></div>`);function kK(e,r){c(r,!0);let i=K(r,`meta`,19,()=>[]),a=K(r,`cardActions`,19,()=>[]),o=new wK,s=L(()=>o.order(i())),u=L(()=>!!r.actions),d=L(()=>!!r.primaryAction),p=L(()=>a().length>0||t(d)||t(u)),m=L(()=>i().length>0||a().length>0||t(d)||t(u));var h=f(),_=R(h),C=e=>{var o=OK(),c=q(o),u=e=>{var n=EK();v(n,21,()=>t(s),e=>CK(e),(e,n)=>{var i=TK();SK(q(i),{get item(){return t(n)},get onOpenFile(){return r.onOpenFile}}),x(i),S(1,i,()=>yc,()=>({duration:Tc.current?0:200,start:.85})),k(e,i)}),x(n),k(e,n)};l(c,e=>{i().length>0&&e(u)});var d=G(c,2),m=e=>{var i=DK(),o=q(i);v(o,17,a,b,(e,n)=>{be(e,{variant:`neutral`,class:`max-w-full min-w-0 flex-[0_1_auto] text-left tabular-nums [overflow-wrap:anywhere]`,get"aria-label"(){return t(n).ariaLabel},get onclick(){return t(n).onClick},children:(e,r)=>{y();var i=g();F(()=>w(i,t(n).label)),k(e,i)},$$slots:{default:!0}})});var s=G(o,2),c=e=>{Q(e,{get"aria-label"(){return r.primaryAction.ariaLabel},get onclick(){return r.primaryAction.onClick},children:(e,t)=>{y();var n=g();F(()=>w(n,r.primaryAction.label)),k(e,n)},$$slots:{default:!0}})};l(s,e=>{r.primaryAction&&e(c)});var u=G(s,2),d=e=>{var t=f(),i=R(t);n(i,()=>r.actions),k(e,t)};l(u,e=>{r.actions&&e(d)}),x(i),k(e,i)};l(d,e=>{t(p)&&e(m)}),x(o),k(e,o)};l(_,e=>{t(m)&&e(C)}),k(e,h),D()}var AK=O(`<div class="bg-destructive-subtle px-2.5 py-2"><pre class="m-0 font-mono text-ui leading-snug whitespace-pre-wrap text-destructive [overflow-wrap:anywhere]"> </pre></div>`);function jK(e,t){var n=AK(),r=q(n),i=z(r,!0);x(n),F(()=>w(i,t.text)),k(e,n)}var MK=O(`<!>Dismissing…`,1),NK=O(`<!>Dismiss`,1),PK=O(`<!> `,1),FK=O(`<!> <!> <!>`,1);function IK(e,n){c(n,!0);let r=K(n,`controller`,7),i=xK().voice?.AudioAuthDialog,a=L(()=>r().questions.length);var o=FK(),s=R(o);{let e=L(()=>!!r().submitting);Q(s,{variant:`outline`,type:`button`,get disabled(){return t(e)},onclick:()=>void r().dismiss(),children:(e,t)=>{var n=f(),i=R(n),a=e=>{var t=MK(),n=R(t);dn(n,{"data-icon":`inline-start`}),y(),k(e,t)},o=e=>{var t=NK(),n=R(t);ye(n,{"data-icon":`inline-start`}),y(),k(e,t)};l(i,e=>{r().submitting===`dismiss`?e(a):e(o,-1)}),k(e,n)},$$slots:{default:!0}})}var u=G(s,2);{let e=L(()=>!!r().submitting||r().answeredCount===0&&!r().voiceActive),n=L(()=>r().voiceActive?`Stop recording, transcribe, and send`:void 0);Q(u,{type:`button`,get disabled(){return t(e)},get title(){return t(n)},onclick:()=>void r().send(),children:(e,n)=>{var i=f(),o=R(i),s=e=>{var t=PK(),n=R(t);dn(n,{"data-icon":`inline-start`});var i=G(n,1,!0);F(()=>w(i,r().transcribingForSend?`Transcribing…`:`Sending…`)),k(e,t)},c=e=>{var n=PK(),i=R(n);eT(i,{"data-icon":`inline-start`});var o=G(i,1,!0);F(()=>w(o,t(a)>1?`Send ${r().answeredCount}/${t(a)}`:`Send`)),k(e,n)};l(o,e=>{r().submitting===`answer`?e(s):e(c,-1)}),k(e,i)},$$slots:{default:!0}})}var d=G(u,2),p=e=>{i(e,{get open(){return r().authDialogOpen},set open(e){r().authDialogOpen=e}})};l(d,e=>{i&&e(p)}),k(e,o),D()}function LK(e){return e instanceof Error?e.message:String(e)}function RK(e,t){return e instanceof Error&&e.message.trim()?e.message:t}var zK=class{get drafts(){return this.#a().draftStore.get(this.toolCallId)}#e=Y();get submitting(){return t(this.#e)}set submitting(e){B(this.#e,e,!0)}#t=Y(!1);get transcribingForSend(){return t(this.#t)}set transcribingForSend(e){B(this.#t,e,!0)}#n=Y();get error(){return t(this.#n)}set error(e){B(this.#n,e,!0)}#r=Y(!1);get authDialogOpen(){return t(this.#r)}set authDialogOpen(e){B(this.#r,e,!0)}#i=Y();#a;constructor(e){this.#a=e;let t;W(()=>{let n=e().toolCall?.id;n&&n!==t&&(t=n,me(()=>{this.submitting=void 0,this.transcribingForSend=!1,this.error=void 0,this.authDialogOpen=!1}))}),W(()=>{let{toolCall:t,draftStore:n}=e();if(!t)return;let r=t.id;(![`committed`,`running`,`waiting`].includes(t.status)||t.interaction!=null&&t.interaction.status!==`pending`)&&me(()=>{n.clear(r)})})}get resolution(){return t(this.#i)?.toolCallId===this.toolCallId?t(this.#i):void 0}get toolCallId(){return this.#a().toolCall.id}get pending(){let{toolCall:e,questionRecord:t}=this.#a();return e.status===`waiting`&&t?.status===`pending`&&!this.resolution}get questions(){let{questionRecord:e,questions:t}=this.#a();return this.pending&&e?e.questions.map(e=>({...e,options:e.options??[]})):t}get dismissed(){let{toolCall:e,dismissed:t,questionRecord:n}=this.#a();return t||n?.status===`dismissed`||this.resolution?.kind===`dismissed`||e.status===`failed`||e.status===`denied`||e.status===`cancelled`}get answers(){return bU(this.questions,this.drafts)}get answeredCount(){return Object.keys(this.answers).length}answerFor(e){let t=this.resolution?.kind===`answered`?this.resolution.answers[e.id]:void 0;return e.answer??t}phaseFor(e){let{toolCall:t}=this.#a();return xU({pending:this.pending,settled:t.status!==`committed`&&t.status!==`running`&&t.status!==`waiting`||this.resolution!==void 0,dismissed:this.dismissed,answer:this.answerFor(e)})}voiceTarget(e){return{kind:`ask-user`,id:`${this.toolCallId}:${e.id}`}}get recordingTarget(){let{voice:e}=this.#a();if(e&&this.pending)return this.questions.map(e=>this.voiceTarget(e)).find(t=>e.session.isTargetActive(t)&&e.session.recording)}get voiceActive(){let{voice:e}=this.#a();return!e||!this.pending?!1:this.questions.some(t=>e.session.isTargetActive(this.voiceTarget(t))&&(e.session.recording||e.session.transcribing))}update(e,t){this.#a().draftStore.update(this.toolCallId,e,t)}async send(){let{voice:e,onAnswer:t,draftStore:n}=this.#a(),r=this.toolCallId;if(this.pending&&!this.submitting&&t){this.submitting=`answer`,this.error=void 0;try{let i=this.recordingTarget;if(e&&i&&(this.transcribingForSend=!0,await e.session.stop(i),this.transcribingForSend=!1),this.toolCallId!==r)return;let a=this.answers;if(Object.keys(a).length===0)return;await t(r,a),B(this.#i,{toolCallId:r,kind:`answered`,answers:a},!0),n.clear(r)}catch(e){this.toolCallId===r&&(this.error=RK(e,`Could not send the answers.`))}finally{this.toolCallId===r&&(this.transcribingForSend=!1,this.submitting=void 0)}}}async dismiss(){let{onDismiss:e,draftStore:t}=this.#a(),n=this.toolCallId;if(this.pending&&!this.submitting&&e){this.submitting=`dismiss`,this.error=void 0;try{await e(n),B(this.#i,{toolCallId:n,kind:`dismissed`},!0),t.clear(n)}catch(e){this.toolCallId===n&&(this.error=RK(e,`Could not dismiss the question.`))}finally{this.toolCallId===n&&(this.submitting=void 0)}}}},BK=O(`<span class="absolute top-1 right-1 size-1.5 rounded-full bg-destructive-solid motion-safe:animate-pulse" aria-hidden="true"></span>`),VK=O(`<!> <!>`,1);function HK(e,n){let r=K(n,`disabled`,3,!1);{let i=L(()=>n.recording?`relative text-destructive hover:text-destructive`:void 0),a=L(()=>n.transcribing?`Cancel transcription`:n.recording?`Stop recording; right-click to cancel`:n.idleLabel);Q(e,{variant:`outline`,size:`icon`,get class(){return t(i)},type:`button`,get disabled(){return r()},get onclick(){return n.onToggle},get oncontextmenu(){return n.onContextMenu},get"aria-label"(){return t(a)},get"aria-keyshortcuts"(){return n.shortcutAria},get title(){return n.title},children:(e,t)=>{var r=f(),i=R(r),a=e=>{ye(e,{})},o=e=>{var t=VK(),r=R(t);Et(r,{});var i=G(r,2),a=e=>{var t=BK();k(e,t)};l(i,e=>{n.recording&&e(a)}),k(e,t)};l(i,e=>{n.transcribing?e(a):e(o,-1)}),k(e,r)},$$slots:{default:!0}})}}var UK=class{getApi;cancelSession;#e;#t;#n=!1;#r=0;constructor(e,t){this.getApi=e,this.cancelSession=t}get active(){return!!this.#e?.active}get failed(){return this.active&&this.#n}sync(e){if(e.recording||e.transcribing){if(this.#n&&!e.recording||!e.recording&&!this.#e?.active)return;let t=this.#i();if(!t)return;this.#n=!1,e.recording&&(this.#r=e.elapsedMs),t.update(e.transcribing?`transcribing`:`recording`,this.#r)}else this.#n||this.discard()}resolve(e){let t=this.#e;if(!t?.active)return!1;this.#a();let n=e.trim();return n?t.resolve(n):t.cancel(),!0}fail(){let e=this.#e;return e?.active?(this.#n=!0,e.update(`failed`,this.#r),!0):!1}discard(){let e=this.#e;this.#a(),e?.active&&e.cancel()}#i(){if(this.#e?.active)return this.#e;let e=this.getApi();if(!e)return;let t=e.startDictation();return this.#e=t,this.#t=t.onRemoved(()=>{if(this.#e!==t)return;let e=this.#n;this.#a(),e||this.cancelSession()}),t}#a(){this.#t?.(),this.#t=void 0,this.#e=void 0,this.#n=!1,this.#r=0}},WK=O(`<span class="inline-flex h-[1lh] max-w-full items-center align-bottom"><!></span>`),GK=O(`<span class="wrap-anywhere"><!></span>`),KK=O(`<span><!></span>`);function qK(e,n){c(n,!0);let r=K(n,`width`,3,`w-24`),i=K(n,`streaming`,3,!1);var a=KK(),o=q(a),s=e=>{var n=WK(),i=q(n);{let e=L(()=>ft(`h-[0.7em] rounded-sm`,r()));eg(i,{get class(){return t(e)}})}x(n),k(e,n)},u=e=>{var t=GK();yG(q(t),{get text(){return n.text},get fade(){return i()}}),x(t),S(1,t,()=>gc,()=>({duration:Tc.current?0:220})),k(e,t)};l(o,e=>{n.text===void 0||n.text===``?e(s):e(u,-1)}),x(a),F(e=>X(a,1,e),[()=>T(ft(`min-w-0`,n.class))]),k(e,a),D()}var JK=O(`<span class="flex-none text-ui text-muted-foreground tabular-nums"> </span>`),YK=O(`<span class="flex-none text-ui text-muted-foreground"> </span>`),XK=O(`<p class="m-0 text-ui whitespace-pre-wrap text-muted-foreground"><span class="text-foreground">Context</span> · <!></p>`),ZK=O(`<p class="m-0 flex min-w-0 gap-1.5 text-ui text-muted-foreground"><!> <span class="min-w-0 whitespace-pre-wrap"><span class="text-foreground">Recommendation</span> · <!></span></p>`),QK=O(`<span> </span>`),$K=O(`<span class="text-muted-foreground"> </span>`),eq=O(`<span class="text-info">Recommended</span>`),tq=O(`<button type="button"><!> <!> <!> <!></button>`),nq=O(`<div class="flex flex-wrap gap-1.5" role="group" aria-label="Options"></div>`),rq=O(`<span class="text-ui text-muted-foreground">or</span> <button type="button" class="inline-flex cursor-pointer items-center gap-1 text-ui text-primary hover:text-foreground disabled:cursor-not-allowed disabled:text-muted-foreground"><!>Speak</button>`,1),iq=O(`<div class="flex items-center gap-2"><button type="button" class="cursor-pointer text-ui text-primary hover:text-foreground">Add detail</button> <!></div>`),aq=O(`<div class="ask-voice-controls svelte-pgj554"><!></div>`),oq=O(`<div class="ask-answer relative svelte-pgj554" role="group" aria-label="Answer input"><!> <!></div>`),sq=O(`<div class="min-w-0 border-l-2 border-primary-strong pl-2 text-body text-foreground"><!></div>`),cq=O(`<div><div class="flex min-w-0 items-baseline gap-2"><!> <p class="m-0 min-w-0 flex-1 text-body text-foreground"><!></p> <!></div> <!> <!> <!> <!></div>`);function lq(e,n){c(n,!0);let r=K(n,`streaming`,3,!1),i=K(n,`busy`,3,!1),a=K(n,`autoFocus`,3,!1),o=xK(),s=o.voice,u=o.askReply,d=L(()=>n.projectId&&n.conversationId?u?.completionSource?.({projectId:n.projectId,conversationId:n.conversationId}):void 0),f=L(()=>n.phase===`waiting`),p=L(()=>n.phase!==`waiting`),m=L(()=>n.total===1),g=L(()=>n.draft?.text??``),_=L(()=>t(f)?n.draft?.option:n.answer?.option),C=L(()=>n.answer?.text?.trim()??``),O=Y(!1),A=L(()=>n.question.options.length===0||t(m)||t(O)||t(g).length>0),j=L(()=>n.phase===`skipped`?`Skipped`:n.phase===`dismissed`?`Not answered`:void 0),M=L(()=>s&&t(f)?{kind:`ask-user`,id:`${n.toolCallId}:${n.question.id}`}:void 0),N=L(()=>!!(s&&t(M)&&s.session.isTargetActive(t(M))&&s.session.recording)),P=L(()=>!!(s&&t(M)&&s.session.isTargetActive(t(M))&&s.session.transcribing)),I=L(()=>!!(s&&t(M)&&s.session.isBusyForOtherTarget(t(M)))),ee=L(()=>!!s?.chatGptConfigured()),te=L(()=>!!s?.session.isSupported()),ne=s?.micShortcutLabel,re=L(()=>!t(P)&&(!s||!t(M)||i()||s.session.pending||!t(N)&&t(I))),ie=L(()=>s?t(P)?`Cancel transcription (Esc)${s.session.retryAttempt>0?` — retry ${s.session.retryAttempt}/${s.session.maxRetries}`:``}`:t(N)?`Stop recording${ne?` (${ne})`:``} — Esc or right-click to cancel (${As(s.session.elapsedMs)} / ${As(s.session.maxDurationMs)})`:t(I)?`Voice recording is active elsewhere`:t(ee)?ne?`Record voice answer (${ne})`:`Record voice answer`:`Connect ChatGPT to use voice input`:``),ae=Y(void 0),V=new UK(()=>t(ae),()=>{t(M)&&s?.session.cancel(t(M))});W(()=>{let e={recording:t(N),transcribing:t(P),elapsedMs:t(N)||t(P)?s?.session.elapsedMs??0:0};me(()=>V.sync(e))});let oe,se,H;function ce(e){let t=se;H?.(),H=void 0,se=void 0,oe=void 0,e&&t&&s?.session.cancelIfTarget(t)}W(()=>{if(!s)return;let e=t(M),r=e?s.targetKey(e):void 0;r!==oe&&(ce(!0),e&&r&&(se=e,oe=r,H=s.session.registerTargetHandlers(e,{appendTranscript:e=>{!V.resolve(e)&&e.trim()&&n.onText?.(s.appendTranscriptText(t(g),e))},onError:e=>{V.fail()||Ree.error(`Voice input failed`,{description:e})}})))}),pe(()=>{ce(!0),V.discard()});function U(){s&&t(M)&&(t(P)?s.session.cancel(t(M)):t(re)||(!t(N)&&!t(ee)?n.onNeedAuth?.():(B(O,!0),s.session.toggle(t(M)))))}function le(e){s&&t(M)&&(t(N)||t(P))&&(e?.preventDefault(),s.session.cancel(t(M)))}function ue(e){if(e.defaultPrevented||e.isComposing)return;let n=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;e.key===`Escape`&&n&&V.failed?(e.stopPropagation(),e.preventDefault(),V.discard()):e.key===`Escape`&&n&&(t(N)||t(P))?(e.stopPropagation(),le(e)):e.key.toLowerCase()!==`v`&&e.code!==`KeyV`||!e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),U())}function de(e){return e.addEventListener(`keydown`,ue),{destroy(){e.removeEventListener(`keydown`,ue)}}}function fe(e){if(!t(f)||i()||!e)return;let r=n.draft?.option===e?void 0:e;n.onSelect?.(r),r&&t(m)&&!t(g).trim()&&n.onSubmit?.()}var he=cq(),ge=q(he),_e=q(ge),ve=e=>{var t=JK(),r=z(t);F(()=>w(r,`${n.index+1}/${n.total??``}`)),k(e,t)};l(_e,e=>{n.total>1&&e(ve)});var Z=G(_e,2);qK(q(Z),{get text(){return n.question.question},width:`w-72`,get streaming(){return r()}}),x(Z);var ye=G(Z,2),be=e=>{var n=YK(),r=z(n,!0);F(()=>w(r,t(j))),S(1,n,()=>gc),k(e,n)};l(ye,e=>{t(j)&&e(be)}),x(ge);var xe=G(ge,2),Se=e=>{var t=XK();qK(G(q(t),2),{get text(){return n.question.context},width:`w-64`,get streaming(){return r()}}),x(t),k(e,t)};l(xe,e=>{n.question.context!==void 0&&e(Se)});var Ce=G(xe,2),we=e=>{var t=ZK(),i=q(t);kt(i,{class:`mt-px size-3.5 flex-none text-info`,"aria-hidden":`true`});var a=G(i,2);qK(G(q(a),2),{get text(){return n.question.recommendation},width:`w-56`,get streaming(){return r()}}),x(a),x(t),k(e,t)};l(Ce,e=>{n.question.recommendation!==void 0&&e(we)});var Te=G(Ce,2),Ee=e=>{var r=nq();v(r,21,()=>n.question.options,b,(e,n)=>{let r=L(()=>t(n).label!==void 0&&t(_)===t(n).label);var a=tq(),o=q(a),s=e=>{ic(e,{class:`size-3 flex-none self-center`})};l(o,e=>{t(r)&&e(s)});var c=G(o,2),u=e=>{eg(e,{class:`h-[0.7em] w-20 self-center rounded-sm bg-hover`})},d=e=>{var r=QK(),i=z(r,!0);F(()=>w(i,t(n).label)),k(e,r)};l(c,e=>{t(n).label===void 0?e(u):e(d,-1)});var m=G(c,2),g=e=>{var r=$K(),i=z(r,!0);F(()=>w(i,t(n).description)),k(e,r)};l(m,e=>{t(n).description&&e(g)});var v=G(m,2),y=e=>{var t=eq();k(e,t)};l(v,e=>{t(n).recommended&&e(y)}),x(a),F(e=>{a.disabled=!t(f)||i()||!t(n).label,J(a,`aria-pressed`,t(r)),X(a,1,e,`svelte-pgj554`)},[()=>T(ft(`inline-flex max-w-full min-w-0 items-baseline gap-1.5 rounded-sm border bg-background px-2 py-1 text-left text-ui transition-[color,border-color,opacity] duration-300`,t(f)&&!i()&&`cursor-pointer hover:border-primary-strong`,t(r)?t(p)?`border-success-strong text-success`:`border-primary-strong text-foreground`:`border-border text-foreground`,t(p)&&!t(r)&&`opacity-50`))]),h(`click`,a,()=>fe(t(n).label)),S(1,a,()=>gc,()=>({duration:200})),k(e,a)}),x(r),k(e,r)};l(Te,e=>{n.question.options.length>0&&e(Ee)});var De=G(Te,2),Oe=e=>{var n=iq(),r=q(n),i=G(r,2),a=e=>{var n=rq(),r=G(R(n),2),i=q(r);Et(i,{class:`size-3`}),y(),x(r),F(()=>{r.disabled=t(re),J(r,`title`,t(ie))}),h(`click`,r,U),k(e,n)};l(i,e=>{s&&t(te)&&e(a)}),x(n),h(`click`,r,()=>B(O,!0)),S(2,n,()=>gc,()=>({duration:120})),k(e,n)},ke=e=>{var r=oq(),o=q(r);{let e=L(()=>n.question.options.length>0?`Add detail, answer in your own words, or speak`:`Answer in your own words, or speak`),r=L(()=>`Answer: ${n.question.question??`question`}`),s=L(()=>t(O)||a()?1:0),c=L(()=>u?.onCompletionAction),l=L(()=>u?.readClipboardText),f=L(()=>u?.writeClipboardText),p=L(()=>u?.onClipboardError),m=L(()=>u?.pasteImage),h=L(()=>u?.dropFiles);LR(o,{get value(){return t(g)},get disabled(){return i()},get placeholder(){return t(e)},get ariaLabel(){return t(r)},get focusToken(){return t(s)},get completionSource(){return t(d)},get onCompletionAction(){return t(c)},get onReadClipboardText(){return t(l)},get onWriteClipboardText(){return t(f)},get onClipboardError(){return t(p)},onChange:e=>n.onText?.(e),onSubmit:()=>n.onSubmit?.(),get onPasteImage(){return t(m)},get onDropFiles(){return t(h)},onReady:e=>B(ae,e,!0)})}var c=G(o,2),f=e=>{var n=aq(),r=q(n);{let e=L(()=>t(ee)?`Record voice answer`:`Connect ChatGPT to use voice input`);HK(r,{get recording(){return t(N)},get transcribing(){return t(P)},get disabled(){return t(re)},get title(){return t(ie)},get idleLabel(){return t(e)},get shortcutAria(){return s.micShortcutAria},onToggle:U,onContextMenu:le})}x(n),k(e,n)};l(c,e=>{s&&t(te)&&e(f)}),x(r),E(r,e=>de?.(e)),S(3,r,()=>pc,()=>({duration:200})),k(e,r)},Ae=e=>{var r=sq(),i=q(r);wc(i,{get text(){return t(C)},preserveLineBreaks:!0,get onOpenFile(){return n.onOpenFile}}),x(r),S(1,r,()=>gc,()=>({duration:220})),k(e,r)};l(De,e=>{t(f)&&!t(A)?e(Oe):t(f)?e(ke,1):n.phase===`answered`&&t(C)&&e(Ae,2)}),x(he),F(e=>{X(he,1,e,`svelte-pgj554`),J(he,`data-question-id`,n.question.id),J(he,`data-tool-call-id`,n.toolCallId)},[()=>T(ft(`grid gap-2 px-3 py-2.5 transition-opacity duration-300`,t(j)&&`opacity-70`))]),k(e,he),D()}ue([`click`]);var uq=O(`<!> <!>`,1),dq=O(`<div class="grid select-text gap-2"><!> <!></div>`);function fq(e,n){c(n,!0);let r=e=>{var r=uq(),i=R(r);v(i,19,()=>t(s).questions,e=>`${n.toolCall.id}:${e.id}`,(e,r,i)=>{{let a=L(()=>t(s).phaseFor(t(r))),o=L(()=>t(s).answerFor(t(r))),c=L(()=>!!t(s).submitting),l=L(()=>t(i)===0);lq(e,{get toolCallId(){return n.toolCall.id},get projectId(){return n.toolCall.projectId},get conversationId(){return n.toolCall.conversationId},get question(){return t(r)},get index(){return t(i)},get total(){return t(s).questions.length},get phase(){return t(a)},get streaming(){return n.view.streaming},get draft(){return t(s).drafts[t(r).id]},get answer(){return t(o)},get busy(){return t(c)},get autoFocus(){return t(l)},onSelect:e=>t(s).update(t(r).id,{option:e}),onText:e=>t(s).update(t(r).id,{text:e}),onSubmit:()=>void t(s).send(),onNeedAuth:()=>t(s).authDialogOpen=!0,get onOpenFile(){return n.onOpenFile}})}});var a=G(i,2),o=e=>{jK(e,{get text(){return t(s).error}})};l(a,e=>{t(s).error&&e(o)}),k(e,r)},i=xK(),a=i.voice,o=new zK(()=>({toolCall:n.toolCall,questions:n.view.questions,dismissed:n.view.dismissed,questionRecord:n.questionRecord,voice:a,draftStore:i.askUserDrafts,onAnswer:n.onAnswerUserQuestion,onDismiss:n.onDismissUserQuestion})),s=L(()=>n.controller??o);var u=f(),d=R(u),p=e=>{r(e)},m=e=>{var n=dq(),i=q(n);YG(i,{children:(e,t)=>{r(e)},$$slots:{default:!0}});var a=G(i,2),o=e=>{kK(e,{actions:e=>{IK(e,{get controller(){return t(s)}})},$$slots:{actions:!0}})};l(a,e=>{t(s).pending&&e(o)}),x(n),k(e,n)};l(d,e=>{n.controller?e(p):e(m,-1)}),k(e,u),D()}var pq=O(`<div class="px-2.5 py-2" aria-label="Bash command"><p class="m-0 mb-1 text-ui text-muted-foreground">Command</p> <!></div>`),mq=O(`<p class="m-0 mb-1 text-ui text-muted-foreground">Output</p>`),hq=O(`<div class="px-2.5 py-2" aria-label="Command output"><!> <!></div>`),gq=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">No output.</div>`),_q=O(`<!> <!>`,1);function vq(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>!!n.view.command&&(/[\r\n]/.test(n.view.command??``)||(n.view.command?.length??0)>500)),a=L(()=>r()&&!!n.view.command&&/[\r\n]/.test(n.view.command??``));var o=f(),s=R(o),u=e=>{XG(e,{children:(e,o)=>{var s=_q(),c=R(s),u=e=>{var i=pq(),a=G(q(i),2);{let e=L(()=>n.view.command??``);qG(a,{get text(){return t(e)},language:`bash`,get expanded(){return r()}})}x(i),k(e,i)};l(c,e=>{t(a)&&e(u)});var d=G(c,2),f=e=>{var a=hq(),o=q(a),s=e=>{var t=mq();k(e,t)};l(o,e=>{t(i)&&e(s)});var c=G(o,2);{let e=L(()=>n.toolCall.status===`running`);qG(c,{get text(){return n.view.output},direction:`tail`,get expanded(){return r()},get live(){return t(e)},terminal:!0})}x(a),k(e,a)},p=e=>{var t=gq();k(e,t)};l(d,e=>{n.view.output.length>0?e(f):n.toolCall.status===`completed`&&e(p,1)}),k(e,s)},$$slots:{default:!0}})};l(s,e=>{(t(a)||n.view.output.length>0||n.toolCall.status===`completed`)&&e(u)}),k(e,o),D()}var yq=O(`<div class="px-2.5 py-2"><!></div>`),bq=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">No changes.</div>`);function xq(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>!r()&&tG(`edit`).argumentRegion===`persistent`),a=L(()=>n.toolCall.status===`completed`&&!n.view.diff&&(n.view.operations?.length??n.view.operationCount)===0);var o=f(),s=R(o),u=e=>{XG(e,{children:(e,a)=>{var o=f(),s=R(o),c=e=>{var t=yq();qG(q(t),{get text(){return n.view.diff},language:`diff`,direction:`tail`,get expanded(){return r()}}),x(t),k(e,t)},u=e=>{var t=bq();k(e,t)};l(s,e=>{!t(i)&&n.view.diff?e(c):e(u,-1)}),k(e,o)},$$slots:{default:!0}})};l(s,e=>{(t(i)?t(a):n.view.diff||n.toolCall.status===`completed`)&&e(u)}),k(e,o),D()}var Sq=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">No files found.</div>`),Cq=O(`<li><button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-ui text-primary hover:text-foreground"> </button></li>`),wq=O(`<ul class="m-0 list-none px-2.5 py-2 font-mono text-ui leading-snug text-foreground"></ul>`);function Tq(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=GG(),a=L(()=>(r()?n.view.paths:n.view.paths.slice(0,6)).map((e,t)=>({path:e,openPath:n.view.openPaths[t]??e})));var o=f(),s=R(o),u=e=>{XG(e,{children:(e,t)=>{var n=Sq();k(e,n)},$$slots:{default:!0}})},d=e=>{XG(e,{children:(e,r)=>{var o=wq();v(o,23,()=>t(a),e=>e.path,(e,r,a)=>{var o=Cq();let s,c;var l=q(o),u=z(l,!0);x(o),F(e=>{s=X(o,1,``,null,s,{"stream-item-enter":i.enter}),c=I(o,``,c,{"--stream-item-delay":e}),w(u,t(r).path)},[()=>i.enter?KG(t(a)):void 0]),h(`click`,l,()=>n.onOpenFile?.(t(r).openPath)),k(e,o)}),x(o),k(e,o)},$$slots:{default:!0}})};l(s,e=>{n.view.count===0&&n.toolCall.status===`completed`?e(u):n.view.count>0&&e(d,1)}),k(e,o),D()}ue([`click`]);var Eq=O(`<span> </span>`),Dq=O(`<p><!><!></p>`),Oq=O(`<div class="grid gap-1.5 py-0.5"></div>`),kq=O(`<div><!> <!></div>`);function Aq(e,n){c(n,!0);let r=K(n,`tail`,3,!1),i=K(n,`fixedRows`,3,6),a=K(n,`streaming`,3,!1),o=GG(),s=L(()=>a()&&o.streamMotion),u=me(()=>n.sections.length),d=[`w-11/12`,`w-3/4`,`w-5/6`];var p=f(),m=R(p);v(m,19,()=>n.sections,e=>e.key,(e,n,o)=>{var c=kq(),f=q(c),p=e=>{var r=Dq(),i=q(r),o=e=>{qK(e,{get text(){return t(n).caption},get streaming(){return a()}})};l(i,e=>{t(n).caption&&e(o)});var s=G(i),c=e=>{var r=Eq(),i=z(r);F(()=>w(i,`${t(n).caption?` · `:``}failed`)),k(e,r)},u=e=>{var r=Eq(),i=z(r);F(()=>w(i,`${t(n).caption?` · `:``}not applied`)),k(e,r)};l(s,e=>{t(n).status===`failed`?e(c):t(n).status===`not_applied`&&e(u,1)}),x(r),F(e=>X(r,1,e),[()=>T(ft(`m-0 text-ui wrap-anywhere`,t(n).status===`failed`?`text-destructive`:`text-muted-foreground`))]),k(e,r)};l(f,e=>{(t(n).caption!==void 0||t(n).status)&&e(p)});var m=G(f,2),h=e=>{var n=Oq();v(n,20,()=>d,e=>e,(e,n)=>{{let r=L(()=>ft(`h-2.5 rounded-sm`,n));eg(e,{get class(){return t(r)}})}}),x(n),k(e,n)},g=e=>{VG(e,{get code(){return t(n).text},language:`diff`,trim:!1,highlight:!1,wrap:!0,overflow:`hidden`,get tail(){return r()},get fixedRows(){return i()},get live(){return a()},get caret(){return a()},get streamMotion(){return t(s)}})};l(m,e=>{t(n).text===void 0?e(h):e(g,-1)}),x(c),F(e=>X(c,1,e),[()=>T(ft(`grid min-w-0 gap-1 px-2.5 py-2`,t(s)&&t(o)>=u&&`stream-item-enter`))]),k(e,c)}),k(e,p),D()}function jq(e,t){let n=t.trim().toLowerCase();return e.find(e=>e.name.trim().toLowerCase()===n)}function Mq(e){switch(e){case`running`:return{label:`working`,tone:`info`};case`waiting`:return{label:`needs you`,tone:`warning`};case`failed`:return{label:`failed`,tone:`destructive`};case`interrupted`:return{label:`stopped`,tone:`warning`};default:return{label:`idle`,tone:`neutral`}}}var Nq=O(`<!> <!>`,1),Pq=O(`<span class="ml-auto flex flex-none items-center"><!></span>`),Fq=O(`<p><!></p>`),Iq=O(`<div><div class="flex min-w-0 items-center gap-2"><span class="inline-flex size-3 flex-none items-center justify-center"><!></span> <!> <!> <!> <!></div> <!></div>`);function Lq(e,n){c(n,!0);let r=K(n,`followUp`,3,!1),i=K(n,`streaming`,3,!1),a=K(n,`enter`,3,!1),o=K(n,`expanded`,3,!1);var s=Iq(),u=q(s),d=q(u),p=q(d),m=e=>{var r=f(),i=R(r);H(i,()=>En,(e,r)=>{r(e,{delayDuration:200,children:(e,r)=>{var i=f(),a=R(i);H(a,()=>wn,(e,r)=>{r(e,{children:(e,r)=>{var i=Nq(),a=R(i);{let e=L(()=>`${n.title??`Item`}: ${n.status.label}`);H(a,()=>Cn,(r,i)=>{i(r,{get"aria-label"(){return t(e)},class:`inline-flex cursor-help items-center rounded-sm focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none`,children:(e,t)=>{Bn(e,{get tone(){return n.status.tone},size:`xs`,class:`transition-colors duration-300`})},$$slots:{default:!0}})})}var o=G(a,2);H(o,()=>Sn,(e,t)=>{t(e,{children:(e,t)=>{y();var r=g();F(()=>w(r,n.status.label)),k(e,r)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,i)},$$slots:{default:!0}})}),k(e,r)},h=e=>{eg(e,{class:`size-2 rounded-full`})};l(p,e=>{n.status?e(m):(i()||n.title===void 0)&&e(h,1)}),x(d);var _=G(d,2);qK(_,{get text(){return n.title},width:`w-32`,get streaming(){return i()},class:`text-ui text-foreground`});var v=G(_,2),b=e=>{qK(e,{get text(){return n.detail},width:`w-14`,get streaming(){return i()},class:`text-ui text-muted-foreground`})};l(v,e=>{(n.detail!==void 0||n.title===void 0)&&e(b)});var S=G(v,2),C=e=>{var t=f(),n=R(t);H(n,()=>En,(e,t)=>{t(e,{delayDuration:200,children:(e,t)=>{var n=f(),r=R(n);H(r,()=>wn,(e,t)=>{t(e,{children:(e,t)=>{var n=Nq(),r=R(n);H(r,()=>Cn,(e,t)=>{t(e,{"aria-label":`Follow-up to existing subagent`,class:`inline-flex flex-none cursor-help items-center rounded-sm text-muted-foreground focus-visible:ring-3 focus-visible:ring-focus focus-visible:outline-none`,children:(e,t)=>{Yre(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>Sn,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g(`Follow-up to existing subagent`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,t)};l(S,e=>{r()&&e(C)});var E=G(S,2),O=e=>{var r=Pq(),i=q(r);{let e=L(()=>`Open ${n.title??`item`}`);be(i,{variant:`brand`,get"aria-label"(){return t(e)},get onclick(){return n.onOpen},children:(e,t)=>{y();var n=g(`Open`);k(e,n)},$$slots:{default:!0}})}x(r),k(e,r)};l(E,e=>{n.onOpen&&e(O)}),x(u);var A=G(u,2),j=e=>{var t=Fq();qK(q(t),{get text(){return n.body},width:`w-3/4`,get streaming(){return i()},class:`w-full`}),x(t),F(e=>X(t,1,e),[()=>T(ft(`m-0 pl-5 text-ui whitespace-pre-line text-muted-foreground wrap-anywhere`,!o()&&`line-clamp-2`))]),k(e,t)};l(A,e=>{(n.body!==void 0||i())&&e(j)}),x(s),F(e=>X(s,1,e),[()=>T(ft(`grid min-w-0 gap-0.5 px-3 py-2`,a()&&`stream-item-enter`))]),k(e,s),D()}var Rq=O(`<div class="px-3 py-2"><p><span class="text-foreground"> </span> · <!></p></div>`),zq=O(`<!> <!>`,1);function Bq(e,n){c(n,!0);let r=K(n,`streaming`,3,!1),i=K(n,`expanded`,3,!1),a=GG(),o=L(()=>r()&&a.streamMotion),s=me(()=>n.items.length),u=xK().subagents,d=L(()=>u?.list()??[]);var f=zq(),p=R(f),m=e=>{var t=Rq(),a=q(t),o=q(a),s=z(o,!0);qK(G(o,2),{get text(){return n.context.text},width:`w-64`,get streaming(){return r()}}),x(a),x(t),F(()=>{X(a,1,`m-0 text-ui whitespace-pre-line text-muted-foreground wrap-anywhere ${i()?``:`line-clamp-3`}`),w(s,n.context.label)}),k(e,t)};l(p,e=>{n.context&&e(m)});var h=G(p,2);v(h,19,()=>n.items,e=>e.key,(e,n,a)=>{let c=L(()=>t(n).agentName?jq(t(d),t(n).agentName):void 0);{let l=L(()=>t(n).outcome??t(n).body),d=L(()=>t(c)?Mq(t(c).status):t(n).status),f=L(()=>t(c)&&u?()=>u.open(t(c).id):void 0),p=L(()=>t(o)&&t(a)>=s);Lq(e,{get title(){return t(n).title},get detail(){return t(n).detail},get body(){return t(l)},get status(){return t(d)},get followUp(){return t(n).followUp},get onOpen(){return t(f)},get streaming(){return r()},get expanded(){return i()},get enter(){return t(p)}})}}),k(e,f),D()}function Vq(e){let t=e;return kH(t.resultPreview??t.result)?.details}function Hq(e,t){let n=aW(e);if(n.kind!==`subagent`)return t;let r=Vq(e),i=n.action===`prompt`?Gq(n,r):n.action===`stop`?Jq(n,r):[];return[...t.map((e,t)=>{let n=i[t];return n?{...e,...n,title:e.title||n.title,detail:e.detail||n.detail,body:e.body||n.body,status:n.status??e.status}:e}),...i.slice(t.length)]}function Uq(e){return e.startsWith(`running`)?`info`:e.startsWith(`waiting`)?`warning`:e.startsWith(`failed`)?`destructive`:`neutral`}function Wq(e,t=Date.now()){let n=Date.parse(e);if(Number.isNaN(n))return;let r=Math.max(0,Math.floor((t-n)/1e3));return r<60?`active ${r}s ago`:`active ${js(e,{style:`long`,now:t})}`}function Gq(e,t){let n=ma.safeParse(t),r=new Map((n.success?n.data.assignments??[]:[]).map(e=>[e.name.toLowerCase(),e]));return e.assignments.map((e,t)=>{let n=e.name?r.get(e.name.toLowerCase()):void 0,i=n?.disposition??e.disposition,a=i===`rejected`,o=e.queuedState;return{key:String(t),title:e.name||void 0,detail:n?.profile??e.profile,body:e.prompt||void 0,outcome:a?n?.reason??e.reason:void 0,status:a?{tone:`destructive`,label:`rejected`}:i===`follow_up`?{tone:Uq(o??``),label:o??`queued`}:i===`created`?{tone:`neutral`,label:`created`}:void 0,followUp:i===`follow_up`,agentName:a?void 0:e.name||void 0}})}function Kq(e,t,n=Date.now()){let r=zi.safeParse(t);return r.success&&r.data.agents?r.data.agents.map((t,r)=>{let i=e.rows.find(e=>e.name.toLowerCase()===t.name.toLowerCase()),a=Mq(t.state===`stopped`?`interrupted`:t.state),o=[t.contextPercent===void 0?i?.context?`ctx ${i.context}`:void 0:`ctx ${Math.round(t.contextPercent)}%`,t.lastActivityAt?Wq(t.lastActivityAt,n):i?.activity].filter(Boolean).join(` · `);return{key:String(r),title:t.name,detail:t.profile,body:o||void 0,status:a,agentName:t.name}}):e.rows.map((e,t)=>({key:String(t),title:e.name,detail:e.profile,body:[e.context?`ctx ${e.context}`:void 0,e.activity].filter(Boolean).join(` · `)||void 0,status:{tone:Uq(e.state),label:e.state},agentName:e.name}))}var qq={stopped:{tone:`neutral`,label:`stopped`},already_idle:{tone:`neutral`,label:`already idle`},not_found:{tone:`warning`,label:`not found`},failed:{tone:`destructive`,label:`failed`}};function Jq(e,t){let n=wi.safeParse(t);return n.success&&n.data.results?n.data.results.map((e,t)=>{let n=uW(e.runMs);return{key:String(t),title:e.name,body:[qq[e.outcome].label,n?`ran ${n}`:void 0,e.reason].filter(Boolean).join(` · `)||void 0,status:qq[e.outcome]}}):e.lines.length===0?e.names.map((e,t)=>({key:String(t),title:e})):e.lines.map((e,t)=>({key:String(t),title:e.name,body:e.outcome,status:{tone:e.outcome.startsWith(`failed`)?`destructive`:e.outcome.includes(`not found`)?`warning`:`neutral`,label:e.outcome}}))}var Yq=O(`<p class="m-0 text-ui text-muted-foreground"> </p>`),Xq=O(`<div><!> <!></div>`),Zq=O(`<dt class="text-muted-foreground"> </dt> <dd><!></dd>`,1),Qq=O(`<dl></dl>`),$q=O(`<div><!> <p><!></p></div>`);function eJ(e,n){c(n,!0);let r=K(n,`fixedRows`,3,6),i=K(n,`highlight`,3,!0),a=K(n,`streaming`,3,!1),o=K(n,`section`,3,!1),s=L(()=>o()?`px-2.5 py-2`:``),u=GG(),d=L(()=>a()&&u.streamMotion);var p=f(),m=R(p),h=e=>{{let r=L(()=>n.toolCall?Hq(n.toolCall,n.body.items):n.body.items);Bq(e,{get items(){return t(r)},get context(){return n.body.context},get streaming(){return a()}})}},g=e=>{Aq(e,{get sections(){return n.body.sections},get tail(){return n.body.tail},get fixedRows(){return r()},get streaming(){return a()}})},_=e=>{var o=Xq(),c=q(o),u=e=>{var t=Yq(),r=z(t,!0);F(()=>w(r,n.body.label)),k(e,t)};l(c,e=>{n.body.label&&e(u)});var f=G(c,2);{let e=L(()=>n.body.language===`text`?void 0:n.body.language),o=L(()=>i()&&n.body.language!==`text`),s=L(()=>t(d)&&n.body.language!==`text`);VG(f,{get code(){return n.body.text},get language(){return t(e)},trim:!1,get highlight(){return t(o)},get progressiveHighlight(){return t(s)},wrap:!0,overflow:`hidden`,get tail(){return n.body.tail},get fixedRows(){return r()},get live(){return a()},get caret(){return a()},get streamMotion(){return t(d)}})}x(o),F(()=>X(o,1,`grid gap-1.5 ${t(s)}`)),k(e,o)},y=e=>{var i=Xq(),o=q(i),c=e=>{var t=Yq(),r=z(t,!0);F(()=>w(r,n.body.label)),k(e,t)};l(o,e=>{n.body.label&&e(c)}),VG(G(o,2),{get code(){return n.body.text},language:`diff`,trim:!1,highlight:!1,wrap:!0,overflow:`hidden`,get tail(){return n.body.tail},get fixedRows(){return r()},get live(){return a()},get caret(){return a()},get streamMotion(){return t(d)}}),x(i),F(()=>X(i,1,`grid gap-1.5 ${t(s)}`)),k(e,i)},b=e=>{var r=Qq();v(r,23,()=>n.body.items,(e,t)=>`${e.label}:${t}`,(e,n)=>{var r=Zq(),i=R(r),a=z(i,!0),o=G(i,2);let s;yG(q(o),{get text(){return t(n).value},get fade(){return t(d)}}),x(o),F(()=>{w(a,t(n).label),s=X(o,1,`m-0 min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,null,s,{"font-mono":t(n).mono,"text-warning":t(n).tone===`warning`,"text-destructive":t(n).tone===`destructive`,"text-success":t(n).tone===`success`,"text-info":t(n).tone===`info`})}),k(e,r)}),x(r),F(()=>X(r,1,`m-0 grid gap-x-3 gap-y-1 text-ui sm:grid-cols-[max-content_minmax(0,1fr)] ${t(s)}`)),k(e,r)},S=e=>{var r=$q(),i=q(r),a=e=>{var t=Yq(),r=z(t,!0);F(()=>w(r,n.body.label)),k(e,t)};l(i,e=>{n.body.label&&e(a)});var o=G(i,2);let c;yG(q(o),{get text(){return n.body.text},get fade(){return t(d)}}),x(o),x(r),F(()=>{X(r,1,`grid gap-1.5 ${t(s)}`),c=X(o,1,`m-0 whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]`,null,c,{"font-mono":n.body.mono,"text-ui":n.body.mono,"text-body":!n.body.mono,"leading-relaxed":!n.body.mono})}),k(e,r)};l(m,e=>{n.body.kind===`entities`?e(h):n.body.kind===`diff-sections`?e(g,1):n.body.kind===`code`?e(_,2):n.body.kind===`diff`?e(y,3):n.body.kind===`key-values`?e(b,4):n.body.kind===`text-summary`&&e(S,5)}),k(e,p),D()}var tJ=O(`<div class="px-2.5 py-2" aria-label="Recorded tool output"><p class="m-0 mb-1 text-ui text-muted-foreground">Result</p> <p> </p></div>`),nJ=O(`<div class="px-2.5 py-2" aria-label="Recorded tool output"><!></div>`),rJ=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">No output.</div>`),iJ=O(`<div class="px-2.5 py-2"><p class="m-0 mb-1 text-ui text-muted-foreground">Recorded arguments</p> <!></div>`),aJ=O(`<!> <!>`,1);function oJ(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>n.view.result.length>0?{kind:`key-values`,items:n.view.result.map(e=>({label:e.key,value:e.value,mono:!0,tone:e.redacted?`warning`:void 0}))}:void 0),a=L(()=>({kind:`key-values`,items:n.view.args.map(e=>({label:e.key,value:e.value,mono:!0,tone:e.redacted?`warning`:void 0}))})),o=L(()=>n.view.args.length>0&&(n.toolCall.status===`failed`||n.toolCall.status===`denied`||n.toolCall.status===`cancelled`)),s=L(()=>!!n.view.resultText||!!t(i));var u=f(),d=R(u),p=e=>{XG(e,{children:(e,s)=>{var c=aJ(),u=R(c),d=e=>{var t=tJ(),i=G(q(t),2);let a;var o=z(i,!0);x(t),F(()=>{a=X(i,1,`m-0 whitespace-pre-wrap text-ui leading-relaxed text-foreground [overflow-wrap:anywhere]`,null,a,{"line-clamp-6":!r()}),w(o,n.view.resultText)}),k(e,t)},f=e=>{var n=nJ();eJ(q(n),{get body(){return t(i)}}),x(n),k(e,n)},p=e=>{var t=rJ();k(e,t)};l(u,e=>{n.view.resultText?e(d):t(i)?e(f,1):n.toolCall.status===`completed`&&e(p,2)});var m=G(u,2),h=e=>{var n=iJ();eJ(G(q(n),2),{get body(){return t(a)}}),x(n),k(e,n)};l(m,e=>{t(o)&&e(h)}),k(e,c)},$$slots:{default:!0}})};l(d,e=>{(t(s)||t(o)||n.toolCall.status===`completed`)&&e(p)}),k(e,u),D()}var sJ=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">No matches.</div>`),cJ=O(`<button class="group grid w-full cursor-pointer grid-cols-[3rem_minmax(0,1fr)] gap-2 border-0 bg-transparent p-0 text-left" type="button"><span class="text-right text-muted-foreground"> </span><span class="break-words whitespace-pre-wrap text-foreground group-hover:text-primary"> </span></button>`),lJ=O(`<div><button class="cursor-pointer border-0 bg-transparent p-0 text-left font-medium text-primary hover:text-foreground" type="button" title="Open file pane"> </button> <!></div>`);function uJ(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=GG(),a=L(()=>{if(r())return n.view.allMatches;let e=[],t=0;for(let r of n.view.allMatches){if(t>=6)break;let n=r.matches.slice(0,6-t);e.push({path:r.path,openPath:r.openPath,matches:n}),t+=n.length}return e});var o=f(),s=R(o),u=e=>{XG(e,{children:(e,t)=>{var n=sJ();k(e,n)},$$slots:{default:!0}})},d=e=>{XG(e,{children:(e,r)=>{var o=f(),s=R(o);v(s,19,()=>t(a),e=>e.path,(e,r,a)=>{var o=lJ();let s,c;var l=q(o),u=z(l,!0),d=G(l,2);v(d,19,()=>t(r).matches,(e,n)=>`${t(r).path}:${e.line}:${n}:${e.text}`,(e,i)=>{var a=cJ(),o=q(a),s=z(o,!0),c=G(o),l=z(c,!0);x(a),F(()=>{J(a,`title`,`Open ${t(r).path}:${t(i).line}`),w(s,t(i).line),w(l,t(i).text)}),h(`click`,a,()=>n.onOpenFile?.(t(i).openPath??t(r).openPath??t(r).path,t(i).line)),k(e,a)}),x(o),F(e=>{s=X(o,1,`px-2.5 py-2 font-mono text-ui leading-[1.4]`,null,s,{"stream-item-enter":i.enter}),c=I(o,``,c,{"--stream-item-delay":e}),w(u,t(r).path)},[()=>i.enter?KG(t(a)):void 0]),h(`click`,l,()=>n.onOpenFile?.(t(r).openPath??t(r).path)),k(e,o)}),k(e,o)},$$slots:{default:!0}})};l(s,e=>{n.view.matchCount===0&&n.toolCall.status===`completed`?e(u):n.view.matchCount>0&&e(d,1)}),k(e,o),D()}ue([`click`]);var dJ=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">Empty directory.</div>`),fJ=O(`<button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-ui text-primary hover:text-foreground"> </button>`),pJ=O(`<span> </span>`),mJ=O(`<li><!> <!></li>`),hJ=O(`<ul class="m-0 list-none px-2.5 py-2 font-mono text-ui leading-normal text-foreground"></ul>`);function gJ(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=GG();function a(e){return[...e].sort((e,t)=>e.kind===t.kind?e.path.localeCompare(t.path):e.kind===`directory`?-1:1)}let o=L(()=>a(n.view.entries)),s=L(()=>r()?t(o):t(o).slice(0,6));var u=f(),d=R(u),p=e=>{XG(e,{children:(e,t)=>{var n=dJ();k(e,n)},$$slots:{default:!0}})},m=e=>{XG(e,{children:(e,r)=>{var a=hJ();v(a,23,()=>t(s),e=>e.path,(e,r,a)=>{var o=mJ();let s,c;var u=q(o),d=e=>{Zu(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})},f=e=>{Bw(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})};l(u,e=>{t(r).kind===`directory`?e(d):e(f,-1)});var p=G(u,2),m=e=>{var i=fJ(),a=z(i,!0);F(()=>w(a,t(r).path)),h(`click`,i,()=>n.onOpenFile?.(t(r).openPath??t(r).path)),k(e,i)},g=e=>{var n=pJ(),i=z(n,!0);F(()=>w(i,t(r).path)),k(e,n)};l(p,e=>{t(r).kind===`file`?e(m):e(g,-1)}),x(o),F(e=>{s=X(o,1,`flex items-center gap-1.5`,null,s,{"stream-item-enter":i.enter}),c=I(o,``,c,{"--stream-item-delay":e})},[()=>i.enter?KG(t(a)):void 0]),k(e,o)}),x(a),k(e,a)},$$slots:{default:!0}})};l(d,e=>{n.view.total===0&&n.toolCall.status===`completed`?e(p):n.view.total>0&&e(m,1)}),k(e,u),D()}ue([`click`]);var _J=O(`<!> <!>`,1),vJ=O(`<div class="inline-flex" role="group"><!> <!></div>`);function yJ(e,r){c(r,!0);let i=K(r,`variant`,3,`default`),a=K(r,`size`,3,`default`),o=K(r,`disabled`,3,!1),s=K(r,`menuAlign`,3,`end`),l=L(()=>r.menuDisabled??o()),u=L(()=>i()==="default"||i()===`success`?`border-l-primary-foreground/25`:`border-l-border-subtle`);var d=vJ(),p=q(d);Q(p,{get variant(){return i()},get size(){return a()},get disabled(){return o()},get onclick(){return r.onclick},class:`rounded-r-none`,children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.children),k(e,i)},$$slots:{default:!0}});var m=G(p,2);H(m,()=>Xn,(e,o)=>{o(e,{children:(e,o)=>{var c=_J(),d=R(c);{let e=L(()=>ft(xt({variant:i(),size:a()}),`-ml-px rounded-l-none border-l px-1.5`,t(u)));H(d,()=>Qn,(n,i)=>{i(n,{get class(){return t(e)},get disabled(){return t(l)},get"aria-label"(){return r.triggerLabel},children:(e,t)=>{qn(e,{class:`size-3.5`,strokeWidth:2.3})},$$slots:{default:!0}})})}var p=G(d,2);H(p,()=>Jn,(e,t)=>{t(e,{get align(){return s()},get class(){return r.menuClass},children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.menu),k(e,i)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})}),x(d),k(e,d),D()}function bJ(e,t){let n=t.model;return n&&(n.provider!==e.provider||n.modelId!==e.modelId)?!1:t.reasoningLevel===void 0||JR(e).includes(t.reasoningLevel)}var xJ=O(`<!> <!>`,1),SJ=O(`<div class="grid gap-2"><!></div>`);function CJ(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=K(n,`requirements`,19,()=>({})),a=Y(!1),o=Y(void 0),s=Y(`off`),l=L(()=>t(o)?n.models.find(e=>QR(e)===QR(t(o))):void 0),u=L(()=>!!t(l)&&bJ(t(l),i()));function d(e){r(e),n.onOpenChange?.(e)}function f(){if(!t(o)||!t(u))return;let e=t(a)?{implementationModel:t(o),implementationThinkingLevel:t(s)}:{};d(!1),n.onConfirm?.(e)}W(()=>{r()&&(n.initialModelKey,n.initialThinkingLevel,n.models,i(),me(()=>{B(a,!1);let e=n.models.find(e=>QR(e)===n.initialModelKey)??n.models[0],r=i().model??e;B(o,r?{provider:r.provider,modelId:r.modelId}:void 0,!0),B(s,i().reasoningLevel??YR(n.initialThinkingLevel,n.models.find(e=>t(o)&&QR(e)===QR(t(o)))),!0)}))}),ln(e,{get open(){return r()},get title(){return n.title},get description(){return n.description},onOpenChange:d,class:`max-w-xl`,footer:e=>{var r=xJ(),i=R(r);Q(i,{variant:`ghost`,onclick:()=>d(!1),children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var a=G(i,2);{let e=L(()=>!t(u));Q(a,{onclick:f,get disabled(){return t(e)},children:(e,t)=>{y();var r=g();F(()=>w(r,n.confirmLabel)),k(e,r)},$$slots:{default:!0}})}k(e,r)},children:(e,r)=>{var c=SJ(),l=q(c);{let e=L(()=>!!i().model),r=L(()=>i().reasoningLevel!==void 0);nB(l,{label:`Implementation model`,get models(){return n.models},get value(){return t(o)},get thinkingLevel(){return t(s)},emptyMessage:`No models available. Configure a provider or adjust Scoped Models in Settings.`,get modelDisabled(){return t(e)},get thinkingDisabled(){return t(r)},lockReason:`Required by the implementation profile`,isModelCompatible:e=>bJ(e,i()),onChange:e=>{B(a,!0),B(o,e.model,!0),B(s,e.thinkingLevel,!0)}})}x(c),k(e,c)},$$slots:{footer:!0,default:!0}}),D()}function wJ(e,t,n){return t??e??n??``}function TJ(e,t,n){if(t)return e;let r=e.split(`
79
+ `);return r.length>n?r.slice(0,n).join(`
80
+ `):e}var EJ=O(`<div class="min-w-0 p-3"><!></div>`),DJ=O(`<div class="px-2.5 py-2 font-mono text-ui leading-relaxed whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]"> </div>`),OJ=O(`<!> <!> <!> <!> <!> <!> <!>`,1),kJ=O(`<!> `,1),AJ=O(`<!> <!>`,1),jJ=O(`<p class="m-0 text-ui text-destructive" role="alert"> </p>`),MJ=O(`<div class="grid gap-2" aria-label="Plan review"><!> <!> <!> <!> <!> <!></div>`),NJ=O(`<p class="m-0 text-ui text-muted-foreground"> </p>`);function PJ(e,n){c(n,!0);let r=xK(),i=r.canCompactPlanBeforeImplementation!==!1,a=K(n,`expanded`,3,!1),o=K(n,`planReviewModels`,19,()=>[]),s=K(n,`planReviewModelKey`,3,``),u=K(n,`planReviewThinkingLevel`,3,`off`),d=Y(void 0);W(()=>{let e=n.planReview?.targetProfile,t=r.previewAgentProfile;if(B(d,void 0),!e||!n.planReview||n.planReview.status!==`pending`||!t)return;let i=!0;return t(n.planReview.conversationId,e.name).then(t=>{i&&t.status===`ready`&&t.preview.targetProfile.digest===e.digest&&B(d,t.preview,!0)}).catch(()=>{}),()=>{i=!1}});let p=Y(void 0),m=Y(void 0),h=Y(!1),_=Y(void 0);function v(e){return typeof e==`string`?e:void 0}function b(e){let t=UH(e),n=UH(t.review??UH(t.details).review);return typeof n.id==`string`||typeof n.content==`string`?n:void 0}function S(e){let t=e;return t.resultPreview??t.result}let C=L(()=>S(n.toolCall)),T=L(()=>b(t(C))),E=L(()=>n.planReview?{...t(T),...n.planReview,content:wJ(t(T)?.content,n.planReview.content,n.planReview.summary??t(T)?.summary)}:t(T)),O=L(()=>n.toolCall.toolName===`plan_present`&&n.toolCall.status===`waiting`&&n.planReview?.status===`pending`),A=L(()=>t(E)?.status??v(UH(t(C)).outcome)),j=L(()=>t(A)===`accepted`),M=L(()=>t(A)===`accepted_in_new_chat`),N=L(()=>t(A)===`changes_requested`||t(A)===`discarded`),P=Y(``);W(()=>{let e=wJ(t(E)?.content,n.planReview?.content,t(E)?.summary??n.view.planPreview);e.trim()&&B(P,e,!0)});let I=L(()=>wJ(t(E)?.content,n.planReview?.content,t(P)||t(E)?.summary||n.view.planPreview)),ee=L(()=>TJ(t(I),a(),6)),te=L(()=>n.toolCall.toolName===`plan_present`&&!!t(E)),ne=L(()=>!t(O)||!!t(m)||t(h)),re=L(()=>t(j)||t(M)?`success`:`default`),ie=L(()=>t(j)||t(M)?[{text:`Accepted`,tone:`success`}]:t(A)===`changes_requested`?[{text:`Changes requested`}]:t(A)===`discarded`?[{text:`Discarded`}]:t(O)?[{text:`Awaiting review`,tone:`warning`}]:[]);async function ae(e){if(n.planReview&&t(O)&&!t(m)&&!t(h)&&n.onAcceptPlanReview){B(m,`same`),B(_,void 0);try{await n.onAcceptPlanReview(n.planReview.toolCallId,e)}catch(e){B(_,RK(e,`Could not accept the plan.`),!0)}finally{B(m,void 0)}}}async function V(e){if(n.planReview&&t(O)&&!t(m)&&!t(h)&&n.onAcceptPlanReview){B(m,`compact`),B(_,void 0);try{await n.onAcceptPlanReview(n.planReview.toolCallId,{...e,compactBeforeImplementation:!0})}catch(e){B(_,RK(e,`Could not compact and accept the plan.`),!0)}finally{B(m,void 0)}}}async function oe(e){if(n.planReview&&t(O)&&!t(m)&&!t(h)&&n.onAcceptPlanReviewInNewChat){B(m,`new-chat`),B(_,void 0);try{await n.onAcceptPlanReviewInNewChat(n.planReview.toolCallId,e)}catch(e){B(_,RK(e,`Could not accept the plan.`),!0)}finally{B(m,void 0)}}}function se(){!t(O)||t(m)||t(h)||B(p,`same`)}function ce(){!t(O)||t(m)||t(h)||B(p,`compact`)}function U(){!t(O)||t(m)||t(h)||B(p,`new-chat`)}async function le(){if(n.planReview&&t(O)&&!t(m)&&!t(h)&&n.onRejectPlanReview){B(h,!0),B(_,void 0);try{await n.onRejectPlanReview(n.planReview.toolCallId)}catch(e){B(_,RK(e,`Could not reject the plan.`),!0)}finally{B(h,!1)}}}var ue=f(),de=R(ue),fe=e=>{var r=MJ(),c=q(r),v=e=>{YG(e,{children:(e,r)=>{var i=f(),o=R(i),s=e=>{var r=EJ(),i=q(r);wc(i,{get text(){return t(ee)},get onOpenFile(){return n.onOpenFile}}),x(r),k(e,r)},c=e=>{var n=DJ(),r=z(n,!0);F(()=>w(r,t(ee))),k(e,n)};l(o,e=>{a()?e(s):e(c,-1)}),k(e,i)},$$slots:{default:!0}})},b=L(()=>t(ee).trim());l(c,e=>{t(b)&&e(v)});var S=G(c,2);{let e=e=>{var r=AJ(),a=R(r);yJ(a,{get variant(){return t(re)},get disabled(){return t(ne)},menuAlign:`end`,menuClass:`w-60`,triggerLabel:`Accept options`,onclick:()=>void ae(),menu:e=>{var r=OJ(),a=R(r);H(a,()=>Zn,(e,n)=>{n(e,{get disabled(){return t(ne)},onSelect:()=>void ae(),children:(e,t)=>{y();var n=g(`Accept & implement`);k(e,n)},$$slots:{default:!0}})});var o=G(a,2),s=e=>{var n=f(),r=R(n);H(r,()=>Zn,(e,n)=>{n(e,{get disabled(){return t(ne)},onSelect:()=>void V(),children:(e,t)=>{y();var n=g(`Compact & implement`);k(e,n)},$$slots:{default:!0}})}),k(e,n)};l(o,e=>{i&&e(s)});var c=G(o,2),u=e=>{var n=f(),r=R(n);H(r,()=>Zn,(e,n)=>{n(e,{get disabled(){return t(ne)},onSelect:()=>void oe(),children:(e,t)=>{y();var n=g(`Accept in new chat`);k(e,n)},$$slots:{default:!0}})}),k(e,n)};l(c,e=>{n.onAcceptPlanReviewInNewChat&&e(u)});var d=G(c,2);H(d,()=>Yn,(e,t)=>{t(e,{})});var p=G(d,2);H(p,()=>Zn,(e,n)=>{n(e,{get disabled(){return t(ne)},onSelect:se,children:(e,t)=>{y();var n=g(`Choose model & implement`);k(e,n)},$$slots:{default:!0}})});var m=G(p,2),h=e=>{var n=f(),r=R(n);H(r,()=>Zn,(e,n)=>{n(e,{get disabled(){return t(ne)},onSelect:ce,children:(e,t)=>{y();var n=g(`Choose model & compact`);k(e,n)},$$slots:{default:!0}})}),k(e,n)};l(m,e=>{i&&e(h)});var _=G(m,2),v=e=>{var n=f(),r=R(n);H(r,()=>Zn,(e,n)=>{n(e,{get disabled(){return t(ne)},onSelect:U,children:(e,t)=>{y();var n=g(`Choose model & start new chat`);k(e,n)},$$slots:{default:!0}})}),k(e,n)};l(_,e=>{n.onAcceptPlanReviewInNewChat&&e(v)}),k(e,r)},children:(e,n)=>{var r=kJ(),i=R(r),a=e=>{ic(e,{class:`size-3.5`,strokeWidth:2.4})};l(i,e=>{(t(j)||t(M))&&e(a)});var o=G(i);F(()=>w(o,` ${t(m)===`same`?`Accepting…`:t(m)===`compact`?`Compacting…`:t(m)===`new-chat`?`Accepting in new chat…`:`Accept & Implement`}`)),k(e,r)},$$slots:{menu:!0,default:!0}});var o=G(a,2);Q(o,{variant:`outline`,get disabled(){return t(ne)},onclick:le,children:(e,n)=>{var r=kJ(),i=R(r),a=e=>{ic(e,{class:`size-3.5`,strokeWidth:2.4})};l(i,e=>{t(N)&&e(a)});var o=G(i);F(()=>w(o,` ${t(h)?`Rejecting…`:`Reject Plan`}`)),k(e,r)},$$slots:{default:!0}}),k(e,r)},r=L(()=>n.detailsAction?[n.detailsAction]:[]);kK(S,{get meta(){return t(ie)},get cardActions(){return t(r)},actions:e,$$slots:{actions:!0}})}var C=G(S,2),T=e=>{var n=jJ(),r=z(n,!0);F(()=>w(r,t(_))),k(e,n)};l(C,e=>{t(_)&&e(T)});var E=G(C,2);{let e=L(()=>t(d)?.requirements),n=L(()=>t(p)===`same`);CJ(E,{get requirements(){return t(e)},get open(){return t(n)},title:`Choose implementation model`,description:`The selected model will be used when implementation continues in this conversation.`,confirmLabel:`Accept and implement`,get models(){return o()},get initialModelKey(){return s()},get initialThinkingLevel(){return u()},onOpenChange:e=>{B(p,e?`same`:void 0,!0)},onConfirm:ae})}var D=G(E,2);{let e=L(()=>t(d)?.requirements),n=L(()=>t(p)===`compact`);CJ(D,{get requirements(){return t(e)},get open(){return t(n)},title:`Choose implementation model`,description:`The selected model will compact the planning context, then implement the plan in this conversation.`,confirmLabel:`Compact and implement`,get models(){return o()},get initialModelKey(){return s()},get initialThinkingLevel(){return u()},onOpenChange:e=>{B(p,e?`compact`:void 0,!0)},onConfirm:V})}var O=G(D,2),A=e=>{{let n=L(()=>t(d)?.requirements),r=L(()=>t(p)===`new-chat`);CJ(e,{get requirements(){return t(n)},get open(){return t(r)},title:`Choose implementation model`,description:`The selected model will be used by the new implementation chat.`,confirmLabel:`Accept in new chat`,get models(){return o()},get initialModelKey(){return s()},get initialThinkingLevel(){return u()},onOpenChange:e=>{B(p,e?`new-chat`:void 0,!0)},onConfirm:oe})}};l(O,e=>{n.onAcceptPlanReviewInNewChat&&e(A)}),x(r),k(e,r)},pe=e=>{var t=NJ(),r=z(t,!0);F(()=>w(r,n.view.summary)),k(e,t)};l(de,e=>{t(te)&&t(E)?e(fe):n.view.summary&&e(pe,1)}),k(e,ue),D()}var FJ=O(`<div class="px-2.5 py-2" aria-label="Python script"><p class="m-0 mb-1 text-ui text-muted-foreground">Script</p> <!></div>`),IJ=O(`<p class="m-0 mb-1 text-ui text-muted-foreground">Output</p>`),LJ=O(`<div class="px-2.5 py-2" aria-label="Python output"><!> <!></div>`),RJ=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground" aria-label="Python output">No output.</div>`),zJ=O(`<!> <!>`,1);function BJ(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>n.view.inputMode!==`file`&&!!n.view.code&&(/[\r\n]/.test(n.view.code??``)||(n.view.code?.length??0)>500)),a=L(()=>r()&&t(i)&&/[\r\n]/.test(n.view.code??``));var o=f(),s=R(o),u=e=>{XG(e,{children:(e,o)=>{var s=zJ(),c=R(s),u=e=>{var i=FJ(),a=G(q(i),2);{let e=L(()=>n.view.code??``);qG(a,{get text(){return t(e)},language:`python`,get expanded(){return r()}})}x(i),k(e,i)};l(c,e=>{t(a)&&e(u)});var d=G(c,2),f=e=>{var a=LJ(),o=q(a),s=e=>{var t=IJ();k(e,t)};l(o,e=>{t(i)&&e(s)});var c=G(o,2);{let e=L(()=>n.toolCall.status===`running`);qG(c,{get text(){return n.view.output},direction:`tail`,get expanded(){return r()},get live(){return t(e)},terminal:!0})}x(a),k(e,a)},p=e=>{var t=RJ();k(e,t)};l(d,e=>{n.view.output.length>0?e(f):n.toolCall.status===`completed`&&e(p,1)}),k(e,s)},$$slots:{default:!0}})};l(s,e=>{(t(a)||n.view.output.length>0||n.toolCall.status===`completed`)&&e(u)}),k(e,o),D()}var VJ=O(`<div role="img" aria-label="Image unavailable" class="flex min-h-24 items-center justify-center gap-2 rounded-sm bg-well p-4 text-ui text-muted-foreground"><!> <span>Image unavailable</span></div>`),HJ=O(`<img/>`);function UJ(e,n){let r=Y(void 0);var i=f(),a=R(i),o=e=>{var t=VJ(),n=q(t);zc(n,{class:`size-4`,"aria-hidden":`true`}),y(2),x(t),k(e,t)},s=e=>{var t=HJ();F(()=>{X(t,1,T(n.class)),J(t,`src`,n.src),J(t,`alt`,n.alt)}),M(`error`,t,()=>{B(r,n.src,!0)}),N(t),k(e,t)};l(a,e=>{t(r)===n.src?e(o):e(s,-1)}),k(e,i)}var WJ={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`jsonc`,css:`css`,html:`html`,svelte:`svelte`,md:`markdown`,markdown:`markdown`,py:`python`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,zsh:`shellscript`};function GJ(e){if(!e)return;let t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(`.`);return n<=0?void 0:WJ[t.slice(n+1).toLowerCase()]}var KJ=O(`<div class="p-2"><button class="cursor-pointer border-0 bg-transparent p-0" type="button" title="Open image pane"><!></button></div>`),qJ=O(`<div class="px-2.5 py-2"><!></div>`),JJ=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">Empty file.</div>`);function YJ(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>GJ(n.view.relPath)),a=L(()=>n.view.content!==void 0&&n.view.content.length>0);var o=f(),s=R(o),u=e=>{XG(e,{children:(e,o)=>{var s=f(),c=R(s),u=e=>{var r=KJ(),i=q(r),a=q(i);{let e=L(()=>n.view.relPath??`image`);UJ(a,{class:`max-h-60 max-w-80 rounded-sm object-contain`,get src(){return n.view.image.dataUrl},get alt(){return t(e)}})}x(i),x(r),h(`click`,i,()=>n.view.path&&n.onOpenFile?.(n.view.path)),k(e,r)},d=e=>{var a=qJ(),o=q(a);{let e=L(()=>n.view.content??``);qG(o,{get text(){return t(e)},get language(){return t(i)},get expanded(){return r()}})}x(a),k(e,a)},p=e=>{var t=JJ();k(e,t)};l(c,e=>{n.view.image?e(u):t(a)?e(d,1):e(p,-1)}),k(e,s)},$$slots:{default:!0}})};l(s,e=>{(n.view.image||t(a)||n.toolCall.status===`completed`)&&e(u)}),k(e,o),D()}ue([`click`]);var XJ=O(`<div class="px-2.5 py-2"><!></div>`),ZJ=O(`<p class="m-0 px-3 py-2 text-ui wrap-anywhere text-muted-foreground"> </p> <!>`,1),QJ=O(`<p class="m-0 px-3 py-2 text-ui text-muted-foreground">No sub-agents yet.</p>`);function $J(e,n){c(n,!0);let r=e=>{var r=f(),a=R(r),o=e=>{var t=ZJ(),r=R(t),a=z(r,!0),o=G(r,2),s=e=>{var t=XJ();qG(q(t),{get text(){return n.view.body},language:`markdown`,get expanded(){return i()}}),x(t),k(e,t)};l(o,e=>{n.view.body&&e(s)}),F(()=>w(a,n.view.header)),k(e,t)},c=e=>{Bq(e,{get items(){return t(s)},get context(){return t(u)},get expanded(){return i()}})},p=e=>{var t=QJ();k(e,t)};l(a,e=>{t(d)&&n.view.action===`status`?e(o):t(s).length>0?e(c,1):e(p,-1)}),k(e,r)},i=K(n,`expanded`,3,!1),a=AG(),o=L(()=>Vq(n.toolCall)),s=L(()=>n.view.action===`prompt`?Gq(n.view,t(o)):n.view.action===`status`?Kq(n.view,t(o)):Jq(n.view,t(o))),u=L(()=>n.view.action===`prompt`&&n.view.context?{label:`Shared context`,text:n.view.context}:void 0),d=L(()=>n.view.action===`status`&&t(s).length===0&&!!n.view.header&&(!n.view.name||FU(n.view.header).length===0)),p=L(()=>a&&n.view.action!==`status`),m=L(()=>!t(p)&&(t(s).length>0||t(d)||n.view.action===`status`&&n.toolCall.status===`completed`));var h=f(),g=R(h),_=e=>{var t=f(),n=R(t),i=e=>{r(e)},o=e=>{YG(e,{children:(e,t)=>{r(e)},$$slots:{default:!0}})};l(n,e=>{a?e(i):e(o,-1)}),k(e,t)};l(g,e=>{t(m)&&e(_)}),k(e,h),D()}var eY=O(`<div class="px-2.5 py-2"><!></div>`),tY=O(`<p class="m-0 px-2.5 py-2 text-ui text-muted-foreground">No content.</p>`);function nY(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>n.view.converted?`markdown`:void 0);XG(e,{children:(e,a)=>{var o=f(),s=R(o),c=e=>{var a=eY();qG(q(a),{get text(){return n.view.content},get language(){return t(i)},get expanded(){return r()}}),x(a),k(e,a)},u=e=>{var t=tY();k(e,t)};l(s,e=>{n.view.content!==void 0&&n.view.content.length>0?e(c):n.toolCall.status===`completed`&&e(u,1)}),k(e,o)},$$slots:{default:!0}}),D()}var rY=O(`<img class="col-start-1 row-start-1 size-full object-contain"/>`),iY=O(`<div class="col-start-1 row-start-1 flex items-center justify-center bg-muted text-muted-foreground"><!></div>`),aY=O(`<button type="button" class="min-w-0 cursor-pointer justify-self-start truncate border-0 bg-transparent p-0 text-left font-mono text-ui text-muted-foreground hover:text-foreground"> </button>`),oY=O(`<span class="min-w-0 truncate font-mono text-ui text-muted-foreground"> </span>`),sY=O(`<div class="grid gap-1.5 p-2"><div><!></div> <!></div>`);function cY(e,n){c(n,!0);let r=K(n,`ready`,3,!0),i=K(n,`alt`,3,``),a=K(n,`optional`,3,!1),o=K(n,`lightBackdrop`,3,!1),s=xK().imageSource,u=Y(void 0),d=Y(!0),p=L(()=>!!(s&&n.path)&&t(d));function m(e){return n.cwd?Fc(n.cwd,e):e}W(()=>{if(!s||!n.path)return;let e=!0;return s(m(n.path)).then(t=>{e&&(B(u,t,!0),B(d,!1))}),()=>{e=!1}});var g=f(),_=R(g),v=e=>{var a=sY(),s=q(a);let c;var d=q(s),m=e=>{var n=rY();F(()=>{J(n,`src`,t(u)),J(n,`alt`,i())}),S(1,n,()=>gc,()=>({duration:450})),k(e,n)},g=e=>{var t=iY(),n=q(t);ad(n,{class:`size-5`,strokeWidth:1.5,"aria-hidden":`true`}),x(t),S(1,t,()=>gc,()=>({duration:450})),k(e,t)},_=e=>{eg(e,{class:`col-start-1 row-start-1 size-full rounded-sm bg-hover`})};l(d,e=>{t(u)?e(m):r()&&!t(p)?e(g,1):e(_,-1)}),x(s);var v=G(s,2),y=e=>{var t=f(),r=R(t),i=e=>{var t=aY(),r=z(t,!0);F(()=>{J(t,`aria-label`,n.captionLabel),J(t,`title`,n.caption),w(r,n.caption)}),h(`click`,t,function(...e){n.onOpen?.apply(this,e)}),k(e,t)},a=e=>{var t=oY(),r=z(t,!0);F(()=>w(r,n.caption)),k(e,t)};l(r,e=>{n.onOpen?e(i):e(a,-1)}),k(e,t)};l(v,e=>{n.caption&&e(y)}),x(a),F(()=>{X(s,1,T([`grid w-full max-w-sm overflow-hidden rounded-sm`,o()&&`bg-image-well`])),c=I(s,``,c,{"aspect-ratio":n.ratio})}),k(e,a)};l(_,e=>{(!a()||t(p)||t(u))&&e(v)}),k(e,g),D()}ue([`click`]);var lY=O(`<button type="button" class="flex w-full min-w-0 cursor-pointer items-baseline gap-2 border-0 bg-transparent px-2.5 py-0.5 text-left text-ui text-muted-foreground hover:text-foreground" aria-label="Open artifact in a file tab"><span class="min-w-0 flex-1 truncate font-mono"> </span> <span class="flex-none text-caption tabular-nums"> </span></button>`),uY=O(`<li><!></li>`),dY=O(`<ul class="m-0 list-none p-0" aria-label="Artifacts"></ul>`);function fY(e,n){c(n,!0);let r=e=>e===`image/png`||e===`image/jpeg`;function i(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var a=dY();v(a,21,()=>n.artifacts,e=>e.handle,(e,a)=>{var o=uY(),s=q(o),c=e=>{{let r=L(()=>t(a).width&&t(a).height?t(a).width/t(a).height:4/3),o=L(()=>`${t(a).handle} · ${i(t(a).bytes)}`),s=L(()=>n.onOpenFile?()=>n.onOpenFile(t(a).path):void 0);cY(e,{get ratio(){return t(r)},get path(){return t(a).path},get alt(){return t(a).handle},get caption(){return t(o)},captionLabel:`Open artifact in a file tab`,lightBackdrop:!0,get onOpen(){return t(s)}})}},u=L(()=>r(t(a).mediaType)),d=e=>{var r=lY(),o=q(r),s=z(o,!0),c=G(o,2),l=z(c,!0);x(r),F(e=>{r.disabled=!n.onOpenFile,w(s,t(a).handle),w(l,e)},[()=>i(t(a).bytes)]),h(`click`,r,()=>n.onOpenFile?.(t(a).path)),k(e,r)};l(s,e=>{t(u)?e(c):e(d,-1)}),x(o),k(e,o)}),x(a),k(e,a),D()}ue([`click`]);var pY=O(`<p class="m-0 px-3 pt-2 text-caption text-muted-foreground"> </p>`),mY=O(`<span class="line-clamp-2 pl-6 text-ui text-muted-foreground"> </span>`),hY=O(`<a class="group grid gap-0.5 px-2.5 py-1.5 text-inherit no-underline hover:bg-hover" target="_blank" rel="noreferrer"><span class="flex min-w-0 items-baseline gap-2 text-ui"><span class="w-4 flex-none text-right font-mono text-muted-foreground tabular-nums"></span> <span class="min-w-0 flex-1 truncate text-foreground"> </span> <span class="flex-none font-mono text-muted-foreground"> </span></span> <!></a>`),gY=O(`<th class="border-b border-border-subtle px-2 py-1 font-normal text-muted-foreground"> </th>`),_Y=O(`<td class="px-2 py-1 align-top text-foreground [overflow-wrap:anywhere]"> </td>`),vY=O(`<tr></tr>`),yY=O(`<div class="min-w-0 overflow-x-auto px-2.5 py-2"><table class="w-full border-collapse text-left text-ui"><thead><tr></tr></thead><tbody></tbody></table></div>`),bY=O(`<div class="px-2.5 py-2"><!></div>`),xY=O(`<div class="min-w-0 p-3"><!></div>`),SY=O(`<p class="m-0 px-3 py-2 text-ui text-muted-foreground">No results.</p>`),CY=O(`<!> <!>`,1);function wY(e,n){c(n,!0);let r=K(n,`labelled`,3,!1),i=K(n,`expanded`,3,!1),a=L(()=>n.section.value),o=L(()=>typeof t(a)==`string`?t(a):``),s=L(()=>n.section.type===`links`?i()?sG(t(a)):sG(t(a)).slice(0,6):[]),u=L(()=>n.section.type===`table`?lG(t(a)):void 0),d=L(()=>t(u)?i()?t(u).rows:t(u).rows.slice(0,6):[]),p=L(()=>{if(n.section.type!==`artifacts`)return[];let e=uG(t(a));return e.length>0?n.artifacts.filter(t=>e.includes(t.handle)):n.artifacts}),m=L(()=>(n.section.type===`links`||n.section.type===`table`)&&Array.isArray(t(a))&&t(a).length===0);function h(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}}var g=CY(),_=R(g),y=e=>{var t=pY(),r=z(t,!0);F(()=>w(r,n.section.label)),k(e,t)};l(_,e=>{r()&&n.section.label&&e(y)});var S=G(_,2),C=e=>{var n=f(),r=R(n);v(r,17,()=>t(s),b,(e,n,r)=>{var i=hY(),a=q(i),o=q(a);o.textContent=r+1;var s=G(o,2),c=z(s,!0),u=G(s,2),d=z(u,!0);x(a);var f=G(a,2),p=e=>{var r=mY(),i=z(r,!0);F(()=>w(i,t(n).snippet)),k(e,r)};l(f,e=>{t(n).snippet&&e(p)}),x(i),F(e=>{J(i,`href`,t(n).url),J(i,`title`,t(n).url),w(c,t(n).title),w(d,e)},[()=>h(t(n).url)]),k(e,i)}),k(e,n)},T=e=>{var n=yY(),r=q(n),i=q(r),a=q(i);v(a,21,()=>t(u).columns,b,(e,n)=>{var r=gY(),i=z(r,!0);F(()=>w(i,t(n))),k(e,r)}),x(a),x(i);var o=G(i);v(o,21,()=>t(d),b,(e,n)=>{var r=vY();v(r,21,()=>t(n),b,(e,n)=>{var r=_Y(),i=z(r,!0);F(()=>w(i,t(n))),k(e,r)}),x(r),k(e,r)}),x(o),x(r),x(n),k(e,n)},E=e=>{fY(e,{get artifacts(){return t(p)},get onOpenFile(){return n.onOpenFile}})},O=e=>{var n=bY();qG(q(n),{get text(){return t(o)},direction:`tail`}),x(n),k(e,n)},A=e=>{var r=f(),a=R(r),s=e=>{var r=xY(),i=q(r);wc(i,{get text(){return t(o)},get onOpenFile(){return n.onOpenFile}}),x(r),k(e,r)},c=e=>{var n=bY();qG(q(n),{get text(){return t(o)},language:`markdown`,direction:`head`}),x(n),k(e,n)};l(a,e=>{i()?e(s):e(c,-1)}),k(e,r)},j=e=>{var n=bY();qG(q(n),{get text(){return t(o)},direction:`head`,get expanded(){return i()}}),x(n),k(e,n)},M=e=>{var t=SY();k(e,t)};l(S,e=>{n.section.type===`links`&&t(s).length>0?e(C):n.section.type===`table`&&t(u)?e(T,1):n.section.type===`artifacts`&&t(p).length>0?e(E,2):n.section.live&&t(o)?e(O,3):n.section.type===`markdown`&&t(o)?e(A,4):n.section.type===`text`&&t(o)?e(j,5):t(m)&&e(M,6)}),k(e,g),D()}var TY=O(`<div class="px-2.5 py-2"><!></div>`),EY=O(`<p class="m-0 px-3 py-2 text-ui text-muted-foreground">No output.</p>`),DY=O(`<!> <!> <!>`,1);function OY(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>n.view.sections.filter(e=>{let t=e.value;switch(e.type){case`text`:case`markdown`:return typeof t==`string`&&t.length>0;case`links`:return Array.isArray(t)||sG(t).length>0;case`table`:return Array.isArray(t)||lG(t)!==void 0;case`artifacts`:return n.view.artifacts.length>0}})),a=L(()=>t(i).some(e=>e.type===`artifacts`)),o=L(()=>t(i).flatMap(e=>e.type===`artifacts`?uG(e.value):[])),s=L(()=>t(a)&&t(o).length===0?[]:n.view.artifacts.filter(e=>!t(o).includes(e.handle)));XG(e,{children:(e,a)=>{var o=DY(),c=R(o);v(c,17,()=>t(i),e=>e.id,(e,a)=>{{let o=L(()=>t(i).length>1);wY(e,{get section(){return t(a)},get artifacts(){return n.view.artifacts},get labelled(){return t(o)},get expanded(){return r()},get onOpenFile(){return n.onOpenFile}})}});var u=G(c,2),d=e=>{fY(e,{get artifacts(){return t(s)},get onOpenFile(){return n.onOpenFile}})};l(u,e=>{t(s).length>0&&e(d)});var p=G(u,2),m=e=>{var t=f(),i=R(t),a=e=>{var t=TY();qG(q(t),{get text(){return n.view.resultText},direction:`head`,get expanded(){return r()}}),x(t),k(e,t)},o=e=>{var t=EY();k(e,t)};l(i,e=>{n.view.resultText?e(a):n.toolCall.status===`completed`&&e(o,1)}),k(e,t)};l(p,e=>{t(i).length===0&&n.view.artifacts.length===0&&!n.view.live&&e(m)}),k(e,o)},$$slots:{default:!0}}),D()}var kY=O(`<div class="px-2.5 py-2"><!></div>`),AY=O(`<div class="px-2.5 py-2 text-ui text-muted-foreground">Empty file written.</div>`);function jY(e,n){c(n,!0);let r=K(n,`expanded`,3,!1),i=L(()=>GJ(n.view.relPath)),a=L(()=>n.view.content!==void 0&&n.view.content.length>0),o=L(()=>!r()&&tG(`write`).argumentRegion===`persistent`),s=L(()=>n.toolCall.status===`completed`&&!t(a));var u=f(),d=R(u),p=e=>{XG(e,{children:(e,s)=>{var c=f(),u=R(c),d=e=>{var a=kY(),o=q(a);{let e=L(()=>n.view.content??``);qG(o,{get text(){return t(e)},get language(){return t(i)},direction:`tail`,get expanded(){return r()}})}x(a),k(e,a)},p=e=>{var t=AY();k(e,t)};l(u,e=>{!t(o)&&t(a)?e(d):e(p,-1)}),k(e,c)},$$slots:{default:!0}})};l(d,e=>{(t(o)?t(s):t(a)||t(s))&&e(p)}),k(e,u),D()}var MY={read:YJ,bash:vq,python:BJ,edit:xq,write:jY,grep:uJ,find:Tq,ls:gJ,ask_user:fq,subagent:$J,plan_present:PJ,extension:OY,web_fetch:nY,quick_script:vK,generic:oJ};function NY(e){return MY[e]??oJ}function PY(e){return e.replace(/\r\n/g,`
81
+ `).replace(/\r/g,`
82
+ `)}function FY(e,t){if(e.length===0)return``;let n=PY(e).split(`
83
+ `);return n.length<=t?n.join(`
84
+ `):n.slice(-t).join(`
85
+ `)}function IY(e,t){return e.length<=t?e:e.slice(-t)}function LY(e,t){let n=PY(e).trimEnd();if(n.length!==0)return FY(IY(n,t.maxChars),t.maxLines)}function RY(e){let t=``,n=0,r=!1,i=!1,a=()=>{t+=` `.repeat(n)},o=()=>{t=t.trimEnd(),t+=`
86
+ `,a()};for(let a of e)r?(t+=a,i?i=!1:a===`\\`?i=!0:a===`"`&&(r=!1)):a===`"`?(r=!0,t+=a):a===`{`||a===`[`?(t+=a,n+=1,o()):a===`}`||a===`]`?(n=Math.max(0,n-1),o(),t+=a):a===`,`?(t+=a,o()):a===`:`?t+=`: `:a!==` `&&a!==`
87
+ `&&a!==`\r`&&a!==` `&&(t+=a);return t.trimEnd()}function zY(e,t){let n=BY(e,t).argsPreview;return n?{kind:`code`,language:`json`,text:n,tail:!0}:void 0}function BY(e,t){if(e.toolName&&eG(e.toolName))return{};if(e.args!==void 0){let n=LY(JSON.stringify(e.args,null,2),t);return n?{argsPreview:n,argsPreviewLanguage:`json`}:{}}let n=e.argsText.trim();if(!n)return{};let r=LY(RY(n),t);return r?{argsPreview:r,argsPreviewLanguage:`json`}:{}}function VY(e,t){let n=new Set;return[...e,...t].filter(e=>!n.has(e.text)&&(n.add(e.text),!0))}function HY(e){if(e.preview)return e.kind===`edit`?{kind:`diff`,text:e.preview,tail:!0}:{kind:`code`,text:e.preview,language:`text`,tail:!0}}function UY(e){let t=e.argumentBody;return!!(e.preview?.length||e.inputPreview?.length||t&&t.kind!==`none`)}function WY(e){return typeof e==`string`?e:void 0}function GY(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function KY(e){if(e!==void 0)return e.length===0?0:e.split(`
88
+ `).length}function qY(e){return e.replace(/\r\n/g,`
89
+ `).replace(/\r/g,`
90
+ `)}function JY(e,t=10){if(e.length===0)return``;let n=qY(e).split(`
91
+ `);return n.length<=t?n.join(`
92
+ `):n.slice(-t).join(`
93
+ `)}function YY(e){return!qY(e).includes(`
94
+ `)}function XY(e){if(e===void 0||e.length===0)return{};let t=qY(e),n=KY(t);return YY(t)?{inlineInput:t,inputLineCount:n}:{inputPreview:JY(t),inputLineCount:n}}function ZY(e,t){let n=WY(UH(e.args).path)??e.progress?.path??uU(e).string(`path`);return n&&t?jc(n,t)??n:n}function QY(e,t){let n=WY(UH(e.args).content),r=uU(e),i=r.string(`content`),a=r.stringMetrics(`content`)?.lines??e.progress?.lineCount??e.progress?.generatedLineCount,o=i===void 0&&e.progress?.generatedPreview?JY(e.progress.generatedPreview):void 0,s=n===void 0&&!!e.progress?.estimated,c=[];return a!==void 0&&a>0&&c.push({key:`write-lines`,text:GY(a,`line`)}),{kind:`write`,toolName:`write`,path:ZY(e,t),statusText:e.done?`Submitting`:`Generating`,meta:c,lineCount:a,generatedLineCount:a,estimated:s,preview:o,done:!!e.done}}function $Y(e){return Array.isArray(e)?e:[]}function eX(e){if(!Array.isArray(e.edits))return;let t=0,n=0,r=$Y(e.edits),i=r.length;for(let e of r){let r=UH(e);t+=KY(WY(r.newText))??0,n+=KY(WY(r.oldText))??0}return{operations:i,generatedLines:t,estimatedAdditions:t,estimatedDeletions:n,estimated:!1}}function tX(e){let t=e.progress;if(t)return{operations:t.operationCount??0,generatedLines:t.generatedLineCount??0,estimatedAdditions:t.estimatedAdditions,estimatedDeletions:t.estimatedDeletions,estimated:t.estimated}}function nX(e){let t=uU({argsText:e}).objectArraySources(`edits`,1/0);if(!t.length)return;let n=t.reduce((e,t)=>e+(t.stringMetrics(`newText`)?.lines??0),0),r=t.reduce((e,t)=>e+(t.stringMetrics(`oldText`)?.lines??0),0);return{operations:t.length,generatedLines:n,estimatedAdditions:n,estimatedDeletions:r,estimated:!0}}function rX(e,t){let n=eX(UH(e.args)),r=e.argsText?nX(e.argsText):void 0,i=tX(e),a=n??r??i??{operations:0,generatedLines:0,estimated:!1},o=!n&&!r&&e.progress?.generatedPreview?JY(e.progress.generatedPreview):void 0,s=[],c=a.estimatedAdditions??a.generatedLines,l=a.estimatedDeletions??0;return(a.operations>0||c>0)&&(s.push({key:`add`,text:`+${c}`,tone:`success`}),s.push({key:`del`,text:`−${l}`,tone:`destructive`})),{kind:`edit`,toolName:`edit`,path:ZY(e,t),statusText:e.done?`Submitting`:`Generating`,meta:s,operationCount:a.operations,generatedLineCount:a.generatedLines,estimatedAdditions:a.estimatedAdditions,estimatedDeletions:a.estimatedDeletions,estimated:a.estimated,preview:o,previewLanguage:o?`diff`:void 0,done:!!e.done}}function iX(e){let t=WY(UH(e.args).command),n=uU(e).string(`command`),r=t??n,i=XY(r),a=uU(e).stringMetrics(`command`)?.lines,o=r!==void 0&&r.length>0,s=[];return a!==void 0&&a>1&&s.push({text:GY(a,`command line`),tone:`info`}),{kind:`bash`,toolName:`bash`,statusText:o?e.done?`Submitting command…`:`Generating command…`:`Waiting for command…`,meta:s,command:r,inputMode:`inline`,...i,language:`bash`,done:!!e.done}}function aX(e,t){let n=UH(e.args),r=ZY(e,t),i=WY(n.code),a=uU(e).string(`code`),o=i??a,s=XY(o),c=uU(e).stringMetrics(`code`)?.lines,l=o!==void 0&&o.length>0,u=r!==void 0&&r.length>0,d=u&&!l?`file`:`inline`,f=[];return c!==void 0&&c>0&&f.push({text:GY(c,`code line`),tone:`info`}),u&&!l&&f.push({text:`file`,tone:`info`}),{kind:`python`,toolName:`python_exec`,path:d===`file`?r:void 0,statusText:d===`file`?e.done?`Submitting Python file…`:`Preparing Python file…`:l?e.done?`Submitting Python code…`:`Generating Python code…`:`Waiting for Python code or path…`,meta:f,code:o,codeLineCount:c,inputMode:d,...s,language:`python`,done:!!e.done}}function oX(e,t,n){let r=t.toolName??`tool`,i=nG(r,{args:t.args,argsText:t.argsText},`drafting`,n),a=HY(e),o=i.body.kind===`none`?eG(r)?void 0:zY(t,{maxLines:10,maxChars:24e3}):i.body;return{...e,path:e.path??i.primaryArg?.text,primaryArg:i.primaryArg,meta:VY(e.meta,i.secondary),argumentBody:o??a??i.body,safetyNotes:i.safetyNotes}}function sX(e,t){if(e.toolName===`write`)return oX(QY(e,t),e,t);if(e.toolName===`edit`)return oX(rX(e,t),e,t);if(e.toolName===`bash`)return oX(iX(e),e,t);if(e.toolName===`python_exec`)return oX(aX(e,t),e,t);let n=e.toolName??`tool`,r=nG(n,{args:e.args,argsText:e.argsText},`drafting`,t);return oX({kind:`generic`,toolName:n,path:r.primaryArg?.text,statusText:e.done?`${n} arguments prepared.`:`Preparing ${n} arguments…`,meta:r.secondary,primaryArg:r.primaryArg,argumentBody:r.body,safetyNotes:r.safetyNotes,done:!!e.done},e,t)}var cX=new Set([`INVALID_TOOL_ARGUMENTS`,`TOOL_ARGUMENT_INVALID`]);function lX(e){if(e.status!==`failed`)return!1;let t=e.errorDetails?.code.toUpperCase();return t?cX.has(t)||t.endsWith(`_ARGUMENT_INVALID`):!1}function uX(e){if(!e.toolCall)return e.draft?.done?`prepared`:`drafting`;if(e.outcomeUnknown)return`outcome_unknown`;switch(e.toolCall.status){case`waiting`:return e.toolCall.interaction?.status===`pending`&&e.toolCall.interaction.kind===`approval`?`approval`:`interaction`;case`committed`:return e.toolCall.supervising?`supervising`:`queued`;case`running`:return`executing`;case`completed`:return`completed`;case`cancelled`:return`cancelled`;case`failed`:case`denied`:return`failed`}}function dX(e,t){return e===`queued`&&!t?`executing`:e}function fX(e){switch(e){case`supervising`:return{tone:`info`,pulse:!0,label:`Checking`};case`queued`:return{tone:`info`,pulse:!1,glyph:`pending`,label:`Approved · queued`};case`outcome_unknown`:return{tone:`warning`,pulse:!1,label:`Outcome unknown`};case`cancelled`:return{tone:`warning`,pulse:!1,label:`Cancelled`};default:return}}function pX(e,t,n){if(n?.dismissed&&e===`completed`)return`dismissed`;switch(e){case`drafting`:case`prepared`:return`drafting`;case`supervising`:return`supervising`;case`approval`:return`approval`;case`interaction`:return`waiting_for_user`;case`queued`:return`queued`;case`executing`:return`running`;case`outcome_unknown`:return`outcome_unknown`;case`completed`:return`completed`;case`cancelled`:return`cancelled`;case`failed`:return t===`denied`?`denied`:`failed`}}function mX(e){let t=new Set;for(let n of e??[])n.code===`outcome_unknown`&&n.proposalId&&t.add(n.proposalId);return t}function hX(e,t){return`chips:${e?.length??0}${t?`,details`:``}`}function gX(e){let t=e.toolCall?e.toolCall.status:e.draft?.done?`prepared`:`drafting`,n=e.toolCall?.status===`failed`||e.toolCall?.status===`denied`||e.toolCall?.status===`cancelled`,r=e.toolCall?.status===`running`&&!e.outcomeUnknown,i=!(!e.toolCall||r||e.toolCall.status!==`committed`&&e.toolCall.status!==`running`),a;a=!e.toolCall||n?`none`:e.hasInteraction?`output`:e.hasApproval||e.toolCall.status===`waiting`||i&&!e.hasDurableBodyContent?`none`:r&&!e.hasDurableBodyContent?e.resultPlaceholder?`placeholder`:`none`:`output`;let o=a===`output`;a===`output`&&!e.bodyHydrated&&(a=`none`);let s=e.argumentRegion===`none`?!1:e.argumentRegion===`persistent`?!!e.hasArgumentBody:!(!e.hasArgumentBody||o||e.argumentRegion===`until-settled`&&n),c=e.hasApproval?`approval`:`none`,l=!!(n&&e.toolCall?.error?.trim()),u=!e.hasInteraction&&((e.footerItems?.length??0)>0||!!e.hasDetailsAction),d=hX(e.footerItems,!!e.hasDetailsAction);return{phase:t,argumentVisible:s,interactionMode:c,resultMode:a,errorVisible:l,footerVisible:u,structuralRevision:[s?`arg`:`no-arg`,`interaction:${c}`,a===`placeholder`?`result:placeholder:${e.resultPlaceholder?.variant}:${e.resultPlaceholder?.rows}`:`result:${a}`,l?`error`:`no-error`,u?`footer:${d}`:`no-footer`].join(`|`)}}var _X=class{#e=Y(!1);get open(){return t(this.#e)}set open(e){B(this.#e,e,!0)}#t=Y(!1);get loading(){return t(this.#t)}set loading(e){B(this.#t,e,!0)}#n=Y(void 0);get error(){return t(this.#n)}set error(e){B(this.#n,e,!0)}#r=Y(void 0);get details(){return t(this.#r)}set details(e){B(this.#r,e,!0)}#i;#a;#o;constructor(e){this.#o=e}syncToolId(e){e!==this.#a&&(this.#a=e,this.open=!1,this.loading=!1,this.error=void 0,this.details=void 0,this.#i=void 0)}setOpen(e){this.open=e}show=async e=>{if(this.open=!0,!(this.details&&this.#i===e.updatedAt)){this.loading=!0,this.error=void 0;try{let t=this.#o();if(!t)throw Error(`Tool details are unavailable here.`);this.details=await t(e.id),this.#i=e.updatedAt}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}}}};function vX(e,t){return e&&t?.toolCallId===e.id&&e.status===`waiting`?t:void 0}function yX(e){return e?.interaction?.kind===`configuration_blocked`&&e.interaction.status===`pending`?e.interaction.request:void 0}function bX(e){return e?.kind===`plan_present`&&e.action===`present`}function xX(e){return e?.kind===`ask_user`||bX(e)}function SX(e){if(e){if(e.primaryArg)return e.primaryArg;if(e.path)return{text:e.path}}}function CX(e){return e.planInteractive?e.durable:e.durable??e.lifecycle??e.draft}function wX(e){let{activitySections:t}=e,n=e.hasAskUserDraftQuestions||e.hasAskUserView&&t.resultMode===`output`;return{hilBodyVisible:e.planInteractive&&t.resultMode===`output`,sheetVisible:!e.planInteractive&&(n||t.argumentVisible||t.resultMode!==`none`||t.errorVisible&&e.hasErrorPreview)}}var TX=92,EX=class{block;text=``;update(e,t,n){e&&(this.block=e),e?.argsText&&(this.text=e.argsText);let r=t||!e||!!e.done;if(r&&this.text&&n!==void 0){let e=JSON.stringify(n);e?.startsWith(this.text)&&(this.text=e)}return{block:e??(t?this.block:void 0),text:this.text,done:r}}};function DX(e,t){let n=Pc(e,t);if(n<=0)return n;let r=e.charCodeAt(n-1);r>=55296&&r<=56319&&--n;let i=n;for(;i>0&&e.charCodeAt(i-1)===TX;)--i;if((n-i)%2==1)return i;let a=e.lastIndexOf(`\\u`,n-1);if(a>=0&&n-a<6){let t=0;for(let n=a;n>=0&&e.charCodeAt(n)===TX;--n)t+=1;t%2==1&&(n=a)}return n}function OX(e,t,n,r){if(r||t.length===0)return e;let i=DX(t,n);return{...e,argsText:t.slice(0,i),args:void 0,progress:void 0,done:!1}}var kX=class{#e=new EX;#t;#n=Y(0);#r;#i;#a;constructor(e){this.#t=L(()=>this.#e.update(e.draft()?.block,e.hasToolCall(),e.argsPreview()??e.draft()?.block.args));let n=me(()=>t(this.#t).text.length);B(this.#n,n,!0);let r=new Oc(n,{onReveal:e=>{B(this.#n,e,!0)}});this.#r=L(()=>!!t(this.#t).block&&e.hydrated()&&!Tc.current),W(()=>{let e=t(this.#t).text.length,n=t(this.#t).done;t(this.#r)?r.setTarget(e,{done:n}):(r.snap(e),B(this.#n,e,!0))}),W(()=>()=>r.destroy()),this.#i=L(()=>t(this.#t).done&&t(this.#n)>=t(this.#t).text.length),this.#a=L(()=>t(this.#t).block?OX(t(this.#t).block,t(this.#t).text,t(this.#n),t(this.#i)):void 0)}get text(){return t(this.#t).text}get settled(){return t(this.#i)}get block(){return t(this.#a)}get draining(){return!!t(this.#t).block&&!t(this.#i)}};function AX(e){switch(e.kind){case`read`:return!!(e.image||e.content?.length);case`edit`:return!!e.diff;case`write`:return!!e.content?.length;case`grep`:return e.matchCount>0;case`find`:return e.count>0;case`ls`:return e.total>0;case`subagent`:return e.action===`prompt`?e.assignments.length>0:e.action===`status`?e.rows.length>0||!!e.header:e.lines.length>0;case`extension`:return!!(e.sections.some(e=>e.value!==void 0)||e.resultText?.length||e.artifacts.length);case`web_fetch`:return!!e.content?.length;case`ask_user`:case`plan_present`:return!0}}function jX(e){let t=[];return e.agentPreview&&t.push(`agent-preview`),e.artifacts&&t.push(`artifacts`),e.arguments&&t.push(`arguments`),e.completeResult&&t.push(`complete-result`),t}function MX(e,t){return t&&e.includes(t)?t:e[0]}var NX=new WeakMap;function PX(e){if(typeof e==`string`)return{text:e};let t=typeof e==`object`&&!!e;if(t){let t=NX.get(e);if(t)return t}let n;try{n={text:JSON.stringify(e,null,2)??String(e),language:`json`}}catch{n={text:String(e)}}return t&&NX.set(e,n),n}function FX(e){return(e?.blocks??[]).flatMap(e=>e.type===`text`&&e.text!==void 0?[e.text]:[]).join(`
95
+
96
+ `)}function IX(e){let t=!1,n=e.split(`
97
+ `).map(e=>{let n=e.trim(),r=n[0],i=n.at(-1);if(n.length<3||!(r===`{`&&i===`}`||r===`[`&&i===`]`))return e;let a;try{a=JSON.parse(n)}catch{return e}return JSON.stringify(a)===n?(t=!0,JSON.stringify(a,null,2)):e});return t?n.join(`
98
+ `):void 0}function LX(e,t=2e3){if(e.length===0)return[];let n=[],r=0;for(let i of e.split(`
99
+ `))if(i.length===0)n.push({key:r++,text:` `});else for(let e=0;e<i.length;e+=t)n.push({key:r++,text:i.slice(e,e+t)});return n}function RX(e){if(!e)return!1;switch(e.kind){case`bash`:case`python`:return e.output.length>0;case`quick_script`:return e.hostCalls.length>0||e.plannedOperations.length>0||e.artifacts.length>0||e.status!==void 0&&e.status!==`completed`;case`generic`:return!!(e.resultText||e.result.length);default:return AX(e)}}function zX(e){return e?e.status===`failed`||e.status===`denied`||e.status===`cancelled`?`failed`:e.status===`completed`?`completed`:`executing`:`drafting`}function BX(...e){let t=new Set;return e.flatMap(e=>e.map(e=>({...e,key:e.key??`meta:${e.text.replace(/\d+(?:\.\d+)?/g,`#`)}`}))).filter(e=>!t.has(e.key)&&(t.add(e.key),!0))}function VX(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function HX(e){return{startedAtMs:e?VX(e.startedAt??(e.status===`running`?e.updatedAt:void 0)):void 0,settledAtMs:VX(e?.settledAt)}}function UX(e){let t=e&&typeof e==`object`&&`size`in e?e.size:void 0;return typeof t==`string`?t:void 0}function WX(e){return e?`${e.openPath?`file`:e.href?`link`:`text`}:${e.preserveWhitespace?`preserve`:`wrap`}`:`none`}function GX(e){return[e.stage,e.activityRevision,`badge:${e.badge}`,`arg:${WX(e.arg)}`].join(`|`)}var KX=`lead`;function qX(e){let t=Math.max(0,Math.floor(e/1e3)),n=t%60,r=Math.floor(t/60)%60,i=Math.floor(t/3600),a=String(n).padStart(2,`0`);return i>0?`${i}:${String(r).padStart(2,`0`)}:${a}`:`${r}:${a}`}function JX(e){let t=Math.max(0,Math.round(e));if(t<1e3)return`${t}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;let n=Math.floor(t/1e3);return`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function YX(e){if(e.startedAtMs!==void 0&&e.settledAtMs!==void 0&&Number.isFinite(e.startedAtMs+e.settledAtMs))return JX(e.settledAtMs-e.startedAtMs)}function XX(e){let t=KX;switch(e.stage){case`drafting`:return{key:t,text:`drafting`};case`supervising`:return{key:t,text:`checking`};case`approval`:return{key:t,text:`needs approval`,tone:`warning`};case`queued`:return{key:t,text:`queued`,tone:`info`};case`waiting_for_user`:return{key:t,text:`waiting for you`,tone:`warning`};case`running`:return{key:t,text:qX(e.startedAtMs===void 0?0:e.nowMs-e.startedAtMs),tone:`info`};case`completed`:return{key:t,text:YX(e)??`completed`};case`failed`:{let n=YX(e);return n?{key:t,text:n}:{key:t,text:`failed`,tone:`destructive`}}case`denied`:return{key:t,text:`denied`,tone:`destructive`};case`cancelled`:return{key:t,text:`cancelled`,tone:`warning`};case`dismissed`:return{key:t,text:`dismissed`,tone:`warning`};case`outcome_unknown`:return{key:t,text:`outcome unknown`,tone:`warning`}}}var ZX=`risk`;function QX(e){if(e?.decision!==`approval`||!e.effectiveRisk)return;let t=e.effectiveRisk;return{key:ZX,text:t.replaceAll(`_`,` `),tone:t===`destructive`||t===`secret`?`destructive`:`warning`}}var $X=O(`<span class="tool-status-glyph inline-flex size-full items-center justify-center svelte-1mdyx18"><!></span>`),eZ=O(`<span><!></span>`);function tZ(e,n){c(n,!0);let r=K(n,`pulse`,3,!1),i=K(n,`waitingForUser`,3,!1),a=K(n,`size`,3,14),o=L(()=>!i()&&(r()||!n.glyph&&n.tone===`info`)),s={info:gd,success:Wn,warning:Qs,destructive:xd,neutral:gd,brand:gd},u={pending:hre,bell:wd,"bell-ring":Ow,"bell-dot":Dw,retry:cr,compaction:Pee,branch:nc,subagent:_d,system:Un},d=L(()=>n.glyph?u[n.glyph]:i()?jw:s[n.tone]),p=L(()=>`${i()?`waiting`:t(o)?`spin`:`static`}:${n.tone}:${n.glyph??`default`}`);var m=eZ();let h;var g=q(m);C(g,()=>t(p),e=>{var r=$X(),i=q(r),s=e=>{{let r=L(()=>`width:${a()}px;height:${a()}px`),i=L(()=>ft(`block`,ns[n.tone])),o=L(()=>n.label?void 0:`true`);dn(e,{get style(){return t(r)},get class(){return t(i)},get"aria-hidden"(){return t(o)},get"aria-label"(){return n.label}})}},c=e=>{var r=f(),i=R(r);{let e=L(()=>ft(`block`,ns[n.tone])),r=L(()=>n.label?void 0:`true`);H(i,()=>t(d),(i,o)=>{o(i,{get size(){return a()},strokeWidth:2.2,get class(){return t(e)},get"aria-hidden"(){return t(r)},get"aria-label"(){return n.label}})})}k(e,r)};l(i,e=>{t(o)?e(s):e(c,-1)}),x(r),k(e,r)}),x(m),F(e=>{X(m,1,e,`svelte-1mdyx18`),h=I(m,``,h,{width:`${a()}px`,height:`${a()}px`})},[()=>T(ft(`inline-flex shrink-0 items-center justify-center`,n.class))]),k(e,m),D()}var nZ=O(`<button type="button"> </button>`),rZ=O(`<a target="_blank" rel="noreferrer noopener"> </a>`),iZ=O(`<span> </span>`),aZ=O(`<div><!><span class="badge svelte-1f3g1sd"> </span><!></div>`);function oZ(e,t){c(t,!0);let n=K(t,`dotPulse`,3,!1),r=K(t,`waitingForUser`,3,!1),i=K(t,`argPending`,3,!1),a=K(t,`mono`,3,!1);var o=aZ();let s;var u=q(o);tZ(u,{get tone(){return t.dotTone},get pulse(){return n()},get waitingForUser(){return r()},get label(){return t.statusLabel},get glyph(){return t.glyph},size:14,class:`mr-1.5 align-middle`});var d=G(u),p=z(d,!0),m=G(d),g=e=>{qK(e,{width:`w-40`,streaming:!0,class:`ml-2 text-ui text-muted-foreground`})},_=e=>{var n=f(),r=R(n),i=e=>{var n=nZ();let r;var i=z(n,!0);F(()=>{r=X(n,1,`arg link svelte-1f3g1sd`,null,r,{"whitespace-pre-wrap":t.arg.preserveWhitespace}),J(n,`title`,t.arg.text),w(i,t.arg.text)}),h(`click`,n,()=>t.onOpenFile?.(t.arg.openPath,t.arg.line)),k(e,n)},a=e=>{var n=rZ();let r;var i=z(n,!0);F(()=>{r=X(n,1,`arg link svelte-1f3g1sd`,null,r,{"whitespace-pre-wrap":t.arg.preserveWhitespace}),J(n,`href`,t.arg.href),J(n,`title`,t.arg.text),w(i,t.arg.text)}),k(e,n)},o=e=>{var n=iZ();let r;var i=z(n,!0);F(()=>{r=X(n,1,`arg svelte-1f3g1sd`,null,r,{"whitespace-pre-wrap":t.arg.preserveWhitespace}),J(n,`title`,t.arg.text),w(i,t.arg.text)}),k(e,n)};l(r,e=>{t.arg.openPath?e(i):t.arg.href?e(a,1):e(o,-1)}),k(e,n)};l(m,e=>{i()&&!t.arg?e(g):t.arg&&e(_,1)}),x(o),F(()=>{s=X(o,1,`card-header svelte-1f3g1sd`,null,s,{mono:a()}),w(p,t.badge)}),k(e,o),D()}ue([`click`]);var sZ=Symbol(`conversation-motion-budget`);function cZ(e){o(sZ,e)}function lZ(){return a(sZ)}var uZ={standard:{durationMs:180,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`,settleOffsetPx:2,fromOpacity:.88},compact:{durationMs:120,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`,settleOffsetPx:0,fromOpacity:.9},minimal:{durationMs:90,easing:`ease-out`,settleOffsetPx:0,fromOpacity:.92}};function dZ(e){let t=uZ[e.profile],n=e.reducedMotion||!e.visible;return{animateContent:!n,durationMs:n?0:t.durationMs,easing:t.easing,settleOffsetPx:t.settleOffsetPx,fromOpacity:t.fromOpacity}}function fZ(e){let t,n=!1;function r(){t?.cancel(),t=void 0,e.style.removeProperty(`will-change`)}function i(i,a){if(n)return;let o=dZ({profile:a,reducedMotion:i,visible:e.getClientRects().length>0});if(r(),!o.animateContent)return;e.style.willChange=`transform, opacity`;let s=e.animate([{opacity:o.fromOpacity,transform:`translateY(${o.settleOffsetPx}px)`},{opacity:1,transform:`translateY(0)`}],{duration:o.durationMs,easing:o.easing});t=s,s.finished.then(()=>{t===s&&(t=void 0,e.style.removeProperty(`will-change`))}).catch(()=>void 0)}return{transition:i,snap(){n||r()},destroy(){n||=(r(),!0)}}}var pZ=O(`<div class="min-w-0"><!></div>`);function mZ(e,r){c(r,!0);let i=K(r,`profile`,15,`standard`),a=lZ(),o=Y(void 0),s,u;W(()=>{let e=r.revision;if(u===void 0||e===u){u=e;return}if(u=e,!t(o))return;let n=Tc.current,c=n?`standard`:a?.claim()??`standard`;i(c),s??=fZ(t(o)),s.transition(n,c)}),W(()=>{Tc.current&&s?.snap()}),W(()=>()=>s?.destroy());var d=pZ(),p=q(d),m=e=>{var t=f(),i=R(t);n(i,()=>r.children),k(e,t)};l(p,e=>{r.children&&e(m)}),x(d),te(d,e=>B(o,e),()=>t(o)),k(e,d),D()}var hZ=O(`<pre class="m-0 whitespace-pre-wrap break-words rounded-sm border border-destructive-strong bg-panel px-2.5 py-2 font-mono text-ui leading-snug text-destructive"> </pre>`),gZ=O(`<div class="grid min-w-0 gap-1.5"><!></div>`),_Z=O(`<article class="w-full py-2.5"><!> <div><!> <!> <!></div></article>`);function vZ(e,r){c(r,!0);let i=K(r,`dotPulse`,3,!1),a=K(r,`argPending`,3,!1),o=K(r,`meta`,19,()=>[]),s=K(r,`cardActions`,19,()=>[]),u=K(r,`footer`,3,!0),d=K(r,`bodyVisible`,3,!1),f=K(r,`layoutRevision`,3,`static`),p=K(r,`motionProfile`,15,`standard`),m=K(r,`monoHeader`,3,!1),h=L(()=>{if(r.draftPhase)return`running`;switch(r.status){case`committed`:return`queued`;case`waiting`:case`running`:return`running`;case`completed`:return`complete`;case`failed`:case`denied`:return`error`;case`cancelled`:return`idle`;default:return`idle`}}),g=L(()=>{if(r.draftPhase)return`Preparing tool call`;switch(r.status){case`waiting`:return`Needs approval`;case`committed`:return`Approved · queued`;case`running`:return`Executing tool call`;case`completed`:return`Tool call completed`;case`denied`:return`Tool call denied`;case`failed`:return`Tool call failed`;case`cancelled`:return`Tool call cancelled`;default:return`Tool call status`}}),_=L(()=>r.statusLabel??t(g)),v=L(()=>u()&&(o().length>0||s().length>0||!!r.primaryAction||!!r.actions)),y=L(()=>!!r.error||d()||t(v));mZ(e,{get revision(){return f()},get profile(){return p()},set profile(e){p(e)},children:(e,c)=>{var u=_Z(),f=q(u);{let e=L(()=>r.status===`waiting`),n=L(()=>a()&&r.draftPhase===`drafting`);oZ(f,{get dotTone(){return r.dotTone},get dotPulse(){return i()},get waitingForUser(){return t(e)},get statusLabel(){return t(_)},get glyph(){return r.glyph},get badge(){return r.badge},get arg(){return r.arg},get argPending(){return t(n)},get mono(){return m()},get onOpenFile(){return r.onOpenFile}})}var p=G(f,2),g=q(p),b=e=>{var t=hZ(),n=z(t,!0);F(()=>w(n,r.error)),k(e,t)};l(g,e=>{r.error&&e(b)});var S=G(g,2),C=e=>{var t=gZ(),i=q(t);n(i,()=>r.children),x(t),k(e,t)};l(S,e=>{d()&&r.children&&e(C)});var T=G(S,2),E=e=>{kK(e,{get meta(){return o()},get cardActions(){return s()},get primaryAction(){return r.primaryAction},get actions(){return r.actions},get onOpenFile(){return r.onOpenFile}})};l(T,e=>{t(v)&&e(E)}),x(p),x(u),F(()=>{J(u,`data-state`,r.draftPhase??t(h)),X(p,1,`grid min-w-0 gap-1.5${t(y)?` pt-1.5`:``}`)}),k(e,u)},$$slots:{default:!0}}),D()}var yZ=O(`<div aria-hidden="true"><!></div>`),bZ=O(`<div class="grid gap-1 px-2.5 py-1.5"><div class="flex min-w-0 items-center gap-2"><!> <!> <!></div> <div class="grid gap-1 pl-6"><!> <!></div></div>`),xZ=O(`<div aria-hidden="true"></div>`),SZ=O(`<div class="px-2.5 py-2"><!></div>`),CZ=O(`<div class="grid gap-1.5 px-2.5 py-2" aria-hidden="true"></div>`);function wZ(e,n){c(n,!0);let r=K(n,`variant`,3,`list`),i=K(n,`rows`,3,3),a=L(()=>Array.from({length:Math.max(1,i())},(e,t)=>t));function o(e){let t=/^(\d+)\s*[x×:]\s*(\d+)$/i.exec(e?.trim()??``);if(!t)return 1;let n=Number(t[1]),r=Number(t[2]);return n>0&&r>0?n/r:1}let s=[`w-full`,`w-2/3`];var u=f(),d=R(u),p=e=>{var r=yZ(),i=q(r);{let e=L(()=>o(n.ratio));cY(i,{get ratio(){return t(e)},ready:!1})}x(r),k(e,r)},m=e=>{var n=xZ();v(n,20,()=>t(a),e=>e,(e,t)=>{var n=bZ(),r=q(n),i=q(r);eg(i,{class:`h-2.5 w-4 flex-none rounded-sm`});var a=G(i,2);eg(a,{class:`h-2.5 flex-1 rounded-sm`}),eg(G(a,2),{class:`h-2.5 w-20 flex-none rounded-sm`}),x(r);var o=G(r,2),s=q(o);eg(s,{class:`h-2.5 w-full rounded-sm`}),eg(G(s,2),{class:`h-2.5 w-3/4 rounded-sm`}),x(o),x(n),k(e,n)}),x(n),k(e,n)},h=e=>{var n=xZ();v(n,20,()=>t(a),e=>e,(e,t)=>{var n=SZ();eg(q(n),{class:`h-5 w-full rounded-sm`}),x(n),k(e,n)}),x(n),k(e,n)},g=e=>{var n=CZ();v(n,20,()=>t(a),e=>e,(e,n)=>{{let r=L(()=>`h-3 ${s[n%2]}`);eg(e,{get class(){return t(r)}})}}),x(n),k(e,n)};l(d,e=>{r()===`image`?e(p):r()===`links`?e(m,1):r()===`list`?e(h,2):e(g,-1)}),k(e,u),D()}var TZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`]);function EZ(e,n){c(n,!0);let r=K(n,`ref`,15,null),i=K(n,`value`,15,``),a=V(n,TZ);var o=f(),s=R(o);{let e=L(()=>ft(`gap-2 group/tabs flex data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:gap-0`,n.class));H(s,()=>Cm,(n,o)=>{o(n,P({"data-slot":`tabs`,get class(){return t(e)}},()=>a,{get ref(){return r()},set ref(e){r(e)},get value(){return i()},set value(e){i(e)}}))})}k(e,o),D()}var DZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function OZ(e,n){c(n,!0);let r=K(n,`ref`,15,null),i=V(n,DZ);var a=f(),o=R(a);{let e=L(()=>ft(`text-ui flex-1 outline-none`,n.class));H(o,()=>Em,(n,a)=>{a(n,P({"data-slot":`tabs-content`,get class(){return t(e)}},()=>i,{get ref(){return r()},set ref(e){r(e)}}))})}k(e,a),D()}var kZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function AZ(e,n){c(n,!0);let r=K(n,`ref`,15,null),i=V(n,kZ);var a=f(),o=R(a);{let e=L(()=>ft(`group/tabs-list flex text-muted-foreground group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:w-fit group-data-[orientation=vertical]/tabs:flex-col group-data-[orientation=vertical]/tabs:gap-1 group-data-[orientation=vertical]/tabs:p-[3px]`,`group-data-[orientation=horizontal]/tabs:h-8 group-data-[orientation=horizontal]/tabs:w-full group-data-[orientation=horizontal]/tabs:items-stretch group-data-[orientation=horizontal]/tabs:overflow-x-auto group-data-[orientation=horizontal]/tabs:bg-chrome-track group-data-[orientation=horizontal]/tabs:shadow-[inset_0_-1px_0_var(--color-border)]`,n.class));H(o,()=>km,(n,a)=>{a(n,P({"data-slot":`tabs-list`,get class(){return t(e)}},()=>i,{get ref(){return r()},set ref(e){r(e)}}))})}k(e,a),D()}var jZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function MZ(e,n){c(n,!0);let r=K(n,`ref`,15,null),i=V(n,jZ);var a=f(),o=R(a);{let e=L(()=>ft(`relative inline-flex flex-none items-center gap-1.5 bg-transparent text-ui whitespace-nowrap text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-focus focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 data-active:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,`group-data-[orientation=horizontal]/tabs:border-t-2 group-data-[orientation=horizontal]/tabs:border-r group-data-[orientation=horizontal]/tabs:border-t-transparent group-data-[orientation=horizontal]/tabs:border-r-border-subtle group-data-[orientation=horizontal]/tabs:px-3 group-data-[orientation=horizontal]/tabs:not-data-active:hover:bg-hover group-data-[orientation=horizontal]/tabs:data-active:border-t-primary group-data-[orientation=horizontal]/tabs:data-active:bg-background`,`group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start group-data-[orientation=vertical]/tabs:rounded-md group-data-[orientation=vertical]/tabs:px-2 group-data-[orientation=vertical]/tabs:py-1 after:absolute after:bg-primary after:opacity-0 after:transition-opacity group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[orientation=vertical]/tabs:data-active:after:opacity-100`,n.class));H(o,()=>Mm,(n,a)=>{a(n,P({"data-slot":`tabs-trigger`,get class(){return t(e)}},()=>i,{get ref(){return r()},set ref(e){r(e)}}))})}k(e,a),D()}var NZ=O(`<p class="m-0 text-ui text-muted-foreground">The agent received an empty result.</p>`),PZ=O(`<div class="grid gap-2"><p class="m-0 text-ui text-muted-foreground"> </p> <!></div>`),FZ=O(`<p class="m-0 text-ui text-muted-foreground">No retained agent preview is available for this tool call.</p>`),IZ=O(`<div class="flex flex-wrap gap-1.5 text-ui text-muted-foreground"><!> <!> <!> <!></div>`),LZ=O(`<div class="grid gap-2 p-3"><!> <!></div>`);function RZ(e,n){c(n,!0);let r=K(n,`wrap`,3,!0),i=K(n,`indentJson`,3,!1);function a(e,t){if(!n.result||typeof n.result!=`object`||Array.isArray(n.result))return;let r=n.result.contentBlocks;if(!Array.isArray(r))return;let i=r[e];if(!i||typeof i!=`object`||Array.isArray(i))return;let a=i;if(a.type===`image`&&a.mimeType===t)return typeof a.assetId==`string`?`/api/assets/${encodeURIComponent(a.assetId)}`:typeof a.data==`string`?`data:${t};base64,${a.data}`:void 0}function o(e){return[`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e)}var s=LZ(),u=q(s),d=e=>{var s=f(),c=R(s),u=e=>{var t=NZ();k(e,t)},d=e=>{var s=f(),c=R(s);v(c,19,()=>n.preview.blocks,(e,t)=>`${e.type}:${t}`,(e,n)=>{var s=f(),c=R(s),u=e=>{{let a=L(()=>i()?IX(t(n).text)??t(n).text:t(n).text);VG(e,{bare:!0,get code(){return t(a)},get wrap(){return r()},maxHeight:`none`,trim:!1})}},d=e=>{let r=L(()=>a(t(n).resultContentBlockIndex,t(n).mimeType));var i=PZ(),s=q(i),c=z(s),u=G(s,2),d=e=>{UJ(e,{class:`max-h-80 max-w-full rounded-sm object-contain`,get src(){return t(r)},alt:`Supplied to the agent`})},f=L(()=>t(r)&&o(t(n).mimeType));l(u,e=>{t(f)&&e(d)}),x(i),F(e=>w(c,`Image supplied to the agent · ${t(n).mimeType??``} · ${e??``}
100
+ bytes`),[()=>t(n).byteLength.toLocaleString()]),k(e,i)};l(c,e=>{t(n).type===`text`?e(u):e(d,-1)}),k(e,s)}),k(e,s)};l(c,e=>{n.preview.blocks.length===0?e(u):e(d,-1)}),k(e,s)},p=e=>{var t=FZ();k(e,t)};l(u,e=>{n.preview?e(d):e(p,-1)});var m=G(u,2),h=e=>{var t=IZ(),r=q(t);be(r,{children:(e,t)=>{y();var r=g();F(()=>w(r,n.projection.profile)),k(e,r)},$$slots:{default:!0}});var i=G(r,2);be(i,{children:(e,t)=>{y();var r=g();F(()=>w(r,n.projection.strategy)),k(e,r)},$$slots:{default:!0}});var a=G(i,2);be(a,{children:(e,t)=>{y();var r=g();F((e,t)=>w(r,`${e??``} of ${t??``}
101
+ lines`),[()=>n.projection.displayedTextLines.toLocaleString(),()=>n.projection.originalTextLines.toLocaleString()]),k(e,r)},$$slots:{default:!0}});var o=G(a,2),s=e=>{be(e,{children:(e,t)=>{y();var r=g();F(e=>w(r,`Recovery: ${e??``}`),[()=>n.projection.recovery.replaceAll(`_`,` `)]),k(e,r)},$$slots:{default:!0}})};l(o,e=>{n.projection.recovery!==`none`&&e(s)}),x(t),k(e,t)};l(m,e=>{n.projection&&e(h)}),x(s),k(e,s),D()}var zZ=O(`<div class="p-3"><!></div>`);function BZ(e,n){c(n,!0);let r=K(n,`wrap`,3,!0),i=L(()=>PX(n.value));var a=zZ(),o=q(a);{let e=L(()=>t(i).text.length<=262144);VG(o,{bare:!0,get code(){return t(i).text},get language(){return t(i).language},get wrap(){return r()},maxHeight:`none`,trim:!1,get highlight(){return t(e)}})}x(a),k(e,a),D()}var VZ=O(`<div> </div>`),HZ=O(`<div><!></div>`);function UZ(e,n){c(n,!0);let r=K(n,`maxHeight`,3,`22rem`),i=K(n,`wrap`,3,!0),a=L(()=>LX(n.text));var o=HZ();let s;var l=q(o);id(l,{get items(){return t(a)},getKey:e=>e.key,estimateSize:()=>18,viewportAriaLabel:`Complete tool result`,viewportTabIndex:0,viewportClass:`max-h-(--result-max-height) font-mono text-ui text-foreground`,row:(e,t)=>{let n=()=>(t?.()).item;var r=VZ(),a=z(r,!0);F(()=>{X(r,1,T(i()?`whitespace-pre-wrap break-all leading-[1.35]`:`whitespace-pre leading-[1.35]`)),w(a,n().text)}),k(e,r)},$$slots:{row:!0}}),x(o),F(()=>s=I(o,``,s,{"--result-max-height":r()})),k(e,o),D()}var WZ=O(`<p class="m-0 text-ui text-muted-foreground">This tool call has no result.</p>`),GZ=O(`<p class="m-0 text-ui text-warning"> </p>`),KZ=O(`<p class="m-0 text-ui text-muted-foreground">Complete result loading is unavailable here.</p>`),qZ=O(`<p class="m-0 text-ui text-destructive"> </p> <!>`,1),JZ=O(`<p class="m-0 text-ui text-muted-foreground">The complete result is empty.</p>`),YZ=O(`<div class="flex flex-wrap items-center gap-2"><!> <!> <span class="text-ui text-muted-foreground"> </span></div>`),XZ=O(`<!> <!>`,1),ZZ=O(`<p class="m-0 text-ui text-muted-foreground">Loading complete result…</p>`),QZ=O(`<div class="grid gap-2 p-3"><!></div>`);function $Z(e,n){c(n,!0);let r=K(n,`wrap`,3,!0),i=262144,a=Y(!1),o=Y(``),s=Y(0),u=Y(!1),d=Y(U(me(()=>n.descriptor.status))),f=Y(void 0),p=0;W(()=>{n.toolCallId,n.descriptor.digest;let e=n.descriptor.hasResult,t=n.descriptor.status;me(()=>{p+=1,B(a,!1),B(o,``),B(s,0),B(u,!e),B(d,t,!0),B(f,void 0),h()})}),W(()=>{n.onTextChange?.(t(o))});async function m(e){if(!n.read||t(u)||t(a)||t(d)===`unavailable`||t(d)===`corrupt`)return!1;B(a,!0),B(f,void 0);try{let r=await n.read(n.toolCallId,t(s),65536);return e===p&&(B(d,r.status,!0),r.status===`unavailable`||r.status===`corrupt`?(B(o,``),B(u,!0),!1):(B(o,t(o)+r.text),B(s,r.nextByteOffset,!0),B(u,r.done,!0),!0))}catch(t){return e===p&&B(f,t instanceof Error?t.message:String(t),!0),!1}finally{e===p&&B(a,!1)}}async function h(){let e=p;do if(!await m(e)||e!==p)return;while(!t(u)&&n.descriptor.byteLength<=i)}async function _(){if(n.descriptor.byteLength>4194304&&!window.confirm(`Load the complete ${Math.ceil(n.descriptor.byteLength/1024/1024)} MB result?`))return;let e=p;for(;!t(u)&&e===p;)if(!await m(e))return}let v=L(()=>t(d)===`unavailable`?`The complete result payload is unavailable.`:t(d)===`corrupt`?`The complete result payload failed verification and was not displayed.`:t(d)===`legacy_bounded`?`Only the bounded legacy result is available.`:void 0),b=L(()=>n.descriptor.byteLength>i);var S=QZ(),C=q(S),T=e=>{var t=WZ();k(e,t)},E=e=>{var n=GZ(),r=z(n,!0);F(()=>w(r,t(v))),k(e,n)},O=e=>{var t=KZ();k(e,t)},A=e=>{var n=qZ(),r=R(n),i=z(r,!0),a=G(r,2);Q(a,{variant:`outline`,class:`w-fit`,onclick:()=>void h(),children:(e,t)=>{y();var n=g(`Retry`);k(e,n)},$$slots:{default:!0}}),F(()=>w(i,t(f))),k(e,n)},j=e=>{var t=JZ();k(e,t)},M=e=>{var i=XZ(),c=R(i),d=e=>{UZ(e,{get text(){return t(o)},get wrap(){return r()},maxHeight:`min(32rem, 55vh)`})},f=e=>{VG(e,{bare:!0,get code(){return t(o)},language:`json`,get wrap(){return r()},maxHeight:`none`,trim:!1})};l(c,e=>{t(b)?e(d):e(f,-1)});var h=G(c,2),v=e=>{var r=YZ(),i=q(r);Q(i,{variant:`outline`,get disabled(){return t(a)},onclick:()=>void m(p),children:(e,n)=>{y();var r=g();F(()=>w(r,t(a)?`Loading…`:`Load next chunk`)),k(e,r)},$$slots:{default:!0}});var o=G(i,2);Q(o,{variant:`ghost`,get disabled(){return t(a)},onclick:()=>void _(),children:(e,t)=>{y();var n=g(`Load all`);k(e,n)},$$slots:{default:!0}});var c=G(o,2),l=z(c);x(r),F((e,t)=>w(l,`${e??``} of ${t??``}
102
+ bytes loaded`),[()=>t(s).toLocaleString(),()=>n.descriptor.byteLength.toLocaleString()]),k(e,r)};l(h,e=>{t(u)||e(v)}),k(e,i)},N=e=>{var t=ZZ();k(e,t)};l(C,e=>{n.descriptor.hasResult?t(v)?e(E,1):n.read?t(f)?e(A,3):t(u)&&t(o).length===0?e(j,4):t(o).length>0?e(M,5):t(a)&&e(N,6):e(O,2):e(T)}),x(S),k(e,S),D()}var eQ=O(`<span class="text-ui text-muted-foreground"> </span> <!> <span class="flex-1"></span> <button type="button" class="flex min-w-0 items-center gap-1 rounded-sm text-ui text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-focus" title="Copy tool call id"><span class="truncate font-mono"> </span> <!></button>`,1),tQ=O(`<div class="flex min-h-40 items-center justify-center text-ui text-muted-foreground">Loading tool details…</div>`),nQ=O(`<div class="grid gap-3"><p class="m-0 text-ui text-destructive"> </p> <!></div>`),rQ=O(`<section class="grid gap-1.5"><div class="flex items-center justify-between gap-2"><!> <div class="flex items-center gap-1"><!> <!></div></div> <div class="rounded-md border bg-well px-2.5 py-2"><pre> </pre></div></section>`),iQ=O(`<span class="text-muted-foreground"> </span>`),aQ=O(` <!>`,1),oQ=O(`<div class="flex items-stretch"><!> <div class="flex items-center gap-1 bg-chrome-track px-1.5 shadow-[inset_0_-1px_0_var(--color-border)]"><!> <!> <!> <!></div></div> <div class="min-h-0 flex-1 overflow-auto bg-well"></div>`,1),sQ=O(`<!> <!>`,1),cQ=O(`<div class="flex h-full min-h-0 flex-col gap-3 p-3"><!> <!> <!></div>`);function lQ(e,n){c(n,!0);let r=e=>{tZ(e,{get tone(){return t(S).dotTone},get pulse(){return t(S).dotPulse},get glyph(){return t(S).glyph},get label(){return t(m).status},size:16})},i=e=>{be(e,{get variant(){return t(re).tone},class:`font-mono`,children:(e,n)=>{y();var r=g();F(()=>w(r,t(re).text)),k(e,r)},$$slots:{default:!0}})},a=e=>{var r=f(),i=R(r),a=e=>{{let n=L(()=>t(me)===`result`?ic:sr),r=L(()=>t(me)===`result`?`Copied`:`Copy result`);Mn(e,{get icon(){return t(n)},get label(){return t(r)},onclick:()=>void ge(`result`,t(U))})}};l(i,e=>{n.details&&t(U)&&e(a)}),k(e,r)},o=e=>{var r=eQ(),i=R(r),a=z(i,!0),o=G(i,2);v(o,17,()=>t(fe),b,(e,r)=>{SK(e,{get item(){return t(r)},get onOpenFile(){return n.onOpenFile}})});var s=G(o,4),c=q(s),u=z(c,!0),d=G(c,2),f=e=>{ic(e,{class:`size-3 shrink-0 text-success`,"aria-hidden":`true`})},p=e=>{sr(e,{class:`size-3 shrink-0`,"aria-hidden":`true`})};l(d,e=>{t(me)===`id`?e(f):e(p,-1)}),x(s),F(()=>{w(a,t(de)),J(s,`aria-label`,`Copy tool call id ${t(m).id}`),w(u,t(m).id)}),h(`click`,s,()=>void ge(`id`,t(m).id)),k(e,r)},s=K(n,`open`,15,!1),u=K(n,`loading`,3,!1),d={"agent-preview":`Agent preview`,artifacts:`Artifacts`,arguments:`Arguments`,"complete-result":`Raw result`},p=xK(),m=L(()=>n.details?.toolCall??n.previewToolCall),_=L(()=>iW(t(m))),S=L(()=>mG(t(_),t(m))),C=L(()=>n.details?.completeResult),E=L(()=>t(_).kind===`quick_script`?t(_).artifacts:[]),O=L(()=>jX({agentPreview:n.details?.toolCall.agentPreview!==void 0,artifacts:t(E).length>0,arguments:n.details?.toolCall.args!==void 0,completeResult:!!t(C)?.hasResult})),A=Y(void 0),j=L(()=>MX(t(O),t(A))),M=Y(!1);W(()=>{t(j)===`complete-result`&&B(M,!0)});let N=Y(!0),P=Y(!1),I=Y(``),ee=L(()=>t(_).kind===`bash`?{label:`Command`,text:t(_).command??``}:t(_).kind===`python`?{label:`Code`,text:t(_).code??``}:void 0),te=L(()=>!!t(ee)&&(t(ee).text.split(`
103
+ `).length>3||t(ee).text.length>300)),ne=L(()=>t(_).kind===`bash`||t(_).kind===`python`?t(_).exitCode:void 0),re=L(()=>t(ne)===void 0?{text:hW(t(m),t(_)),tone:t(S).dotTone}:{text:`exit ${t(ne)}`,tone:t(ne)===0?`success`:`destructive`}),ie=L(()=>{let e=(t(ee)?t(m).cwd:t(S).primaryArg?.text??t(m).cwd)?.split(`
104
+ `,1)[0]??``;return e.length>160?`${e.slice(0,160)}…`:e}),ae=L(()=>t(S).primaryArg?.openPath),V=L(()=>t(S).primaryArg?.line),oe=L(()=>FX(n.details?.toolCall.agentPreview)),se=L(()=>t(_).kind===`quick_script`?IX(t(oe)):void 0),ce=Y(!0),U=L(()=>t(_).kind===`bash`||t(_).kind===`python`?t(_).output:t(oe)),le=L(()=>PX(n.details?.toolCall.args).text),ue=L(()=>t(j)===`agent-preview`?t(ce)&&t(se)?t(se):t(oe):t(j)===`arguments`?t(le):t(j)===`complete-result`?t(I):``),de=L(()=>{let e=t(m).execution,n=e?.startedAt&&e.endedAt?Date.parse(e.endedAt)-Date.parse(e.startedAt):NaN;return[n>=0?uW(n):void 0,(t(_).kind===`bash`||t(_).kind===`python`)&&t(_).outputLineCount>0?`${t(_).outputLineCount.toLocaleString()} ${t(_).outputLineCount===1?`line`:`lines`}`:void 0,js(t(m).updatedAt,{style:`long`})].filter(Boolean).join(` · `)}),fe=L(()=>t(S).meta.filter(e=>e.text!==t(re).text&&!/^exit \d+$/.test(e.text)&&!/^[\d,]+ lines?$/.test(e.text)&&!/^\d[\d.]*\s?(ms|s|m|h)\b/.test(e.text))),me=Y(void 0),he;pe(()=>clearTimeout(he));async function ge(e,t){if(t){try{await Lee(t)}catch{return}B(me,e,!0),clearTimeout(he),he=setTimeout(()=>B(me,void 0),1600)}}{let c=L(()=>!!n.details),h=L(()=>n.details?`h-[min(40rem,calc(100dvh-2rem))]`:void 0),_=L(()=>n.details?a:void 0),b=L(()=>n.details?o:void 0);ln(e,{get title(){return t(m).toolName},get description(){return t(ie)},size:`wide`,get flush(){return t(c)},get class(){return t(h)},get leading(){return r},get titleExtra(){return i},get headerActions(){return t(_)},get footer(){return t(b)},get onOpenChange(){return n.onOpenChange},get open(){return s()},set open(e){s(e)},children:(e,r)=>{var i=f(),a=R(i),o=e=>{var t=tQ();k(e,t)},s=e=>{var t=nQ(),r=q(t),i=z(r,!0),a=G(r,2);Q(a,{variant:`outline`,class:`w-fit`,onclick:()=>void n.onRetry?.(),children:(e,t)=>{y();var n=g(`Retry`);k(e,n)},$$slots:{default:!0}}),x(t),F(()=>w(i,n.error)),k(e,t)},c=e=>{var r=cQ(),i=q(r),a=e=>{var n=rQ(),r=q(n),i=q(r);Rn(i,{get label(){return t(ee).label}});var a=G(i,2),o=q(a),s=e=>{Q(e,{variant:`ghost`,size:`sm`,class:`text-muted-foreground`,get"aria-expanded"(){return t(P)},onclick:()=>B(P,!t(P)),children:(e,n)=>{y();var r=g();F(()=>w(r,t(P)?`Show less`:`Show all`)),k(e,r)},$$slots:{default:!0}})};l(o,e=>{t(te)&&e(s)});var c=G(o,2);{let e=L(()=>t(me)===`command`?ic:sr),n=L(()=>t(me)===`command`?`Copied`:`Copy ${t(ee).label.toLowerCase()}`);Mn(c,{get icon(){return t(e)},get label(){return t(n)},onclick:()=>void ge(`command`,t(ee).text)})}x(a),x(r);var u=G(r,2),d=q(u),f=z(d,!0);x(u),x(n),F(e=>{X(d,1,e),w(f,t(ee).text)},[()=>T(ft(`m-0 font-mono text-ui break-all whitespace-pre-wrap`,!t(P)&&`line-clamp-3`))]),k(e,n)};l(i,e=>{t(ee)&&t(ee).text&&e(a)});var o=G(i,2),s=e=>{nn(e,{tone:`destructive`,get text(){return t(m).error}})};l(o,e=>{t(m).error&&e(s)});var c=G(o,2),u=e=>{var r=f(),i=R(r);H(i,()=>EZ,(e,r)=>{r(e,{get value(){return t(j)},onValueChange:e=>B(A,e,!0),class:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border`,children:(e,r)=>{var i=oQ(),a=R(i),o=q(a);H(o,()=>AZ,(e,n)=>{n(e,{class:`flex-1`,children:(e,n)=>{var r=f(),i=R(r);v(i,16,()=>t(O),e=>e,(e,n)=>{var r=f(),i=R(r);H(i,()=>MZ,(e,r)=>{r(e,{get value(){return n},class:`data-active:bg-well`,children:(e,r)=>{y();var i=aQ(),a=R(i),o=G(a),s=e=>{var n=iQ(),r=z(n,!0);F(e=>w(r,e),[()=>lW(t(C).byteLength)]),k(e,n)};l(o,e=>{n===`complete-result`&&t(C)&&e(s)}),F(()=>w(a,`${d[n]??``} `)),k(e,i)},$$slots:{default:!0}})}),k(e,r)}),k(e,r)},$$slots:{default:!0}})});var s=G(o,2),c=q(s);Mn(c,{get icon(){return Il},label:`Wrap lines`,get active(){return t(N)},onclick:()=>B(N,!t(N))});var u=G(c,2),m=e=>{Mn(e,{get icon(){return are},label:`Indent JSON`,get active(){return t(ce)},onclick:()=>B(ce,!t(ce))})};l(u,e=>{t(j)===`agent-preview`&&t(se)&&e(m)});var h=G(u,2);{let e=L(()=>t(me)===`pane`?ic:sr),n=L(()=>t(me)===`pane`?`Copied`:`Copy`),r=L(()=>!t(ue));Mn(h,{get icon(){return t(e)},get label(){return t(n)},get disabled(){return t(r)},onclick:()=>void ge(`pane`,t(ue))})}var g=G(h,2),_=e=>{Mn(e,{get icon(){return $s},label:`Open in editor`,onclick:()=>n.onOpenFile(t(ae),t(V))})};l(g,e=>{t(ae)&&n.onOpenFile&&e(_)}),x(s),x(a);var b=G(a,2);v(b,20,()=>t(O),e=>e,(e,r)=>{var i=f(),a=R(i);H(a,()=>OZ,(e,i)=>{i(e,{get value(){return r},children:(e,i)=>{var a=f(),o=R(a),s=e=>{},c=e=>{{let r=L(()=>t(ce)&&t(se)!==void 0);RZ(e,{get preview(){return n.details.toolCall.agentPreview},get projection(){return n.details.toolCall.agentProjection},get result(){return n.details.toolCall.result},get indentJson(){return t(r)},get wrap(){return t(N)}})}},u=e=>{fY(e,{get artifacts(){return t(E)},get onOpenFile(){return n.onOpenFile}})},d=e=>{BZ(e,{get value(){return n.details.toolCall.args},get wrap(){return t(N)}})},m=e=>{$Z(e,{get toolCallId(){return n.details.toolCall.id},get descriptor(){return t(C)},get read(){return p.readToolCallResult},get wrap(){return t(N)},onTextChange:e=>B(I,e,!0)})};l(o,e=>{r!==t(j)&&!(r===`complete-result`&&t(M))?e(s):r===`agent-preview`?e(c,1):r===`artifacts`?e(u,2):r===`arguments`?e(d,3):t(C)&&t(M)&&e(m,4)}),k(e,a)},$$slots:{default:!0}})}),k(e,i)}),x(b),k(e,i)},$$slots:{default:!0}})}),k(e,r)},h=e=>{var t=f(),n=R(t);H(n,()=>as,(e,t)=>{t(e,{class:`border`,children:(e,t)=>{var n=f(),r=R(n);H(r,()=>ts,(e,t)=>{t(e,{children:(e,t)=>{var n=sQ(),r=R(n);H(r,()=>os,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g(`No details retained`);k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>is,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g(`This tool call has no output or arguments to show.`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,t)};l(c,e=>{t(j)?e(u):t(m).error||e(h,1)}),x(r),k(e,r)};l(a,e=>{u()&&!n.details?e(o):n.error&&!n.details?e(s,1):n.details&&e(c,2)}),k(e,i)},$$slots:{default:!0}})}D()}ue([`click`]);var uQ=O(`<!> <!> <!> <!>`,1),dQ=O(`<!>Approving…`,1),fQ=O(`<!>Approve`,1),pQ=O(`<!>Denying…`,1),mQ=O(`<!>Deny`,1),hQ=O(`<!> <!>`,1),gQ=O(`<p class="m-0 text-ui text-destructive" role="alert"> </p>`),_Q=O(`<div class="flex flex-wrap items-center gap-2" aria-label="Tool approval"><!> <!></div>`),vQ=O(`<p class="text-ui text-muted-foreground"> </p>`),yQ=O(`<div class="grid gap-2" aria-label="Tool approval"><!> <!> <!></div>`);function bQ(e,n){c(n,!0);let r=e=>{var n=hQ(),r=R(n),i=e=>{{let n=e=>{var n=uQ(),r=R(n);{let e=L(()=>!!t(a));H(r,()=>Zn,(n,r)=>{r(n,{get disabled(){return t(e)},onSelect:()=>void s(`approve`),children:(e,t)=>{y();var n=g(`Approve once`);k(e,n)},$$slots:{default:!0}})})}var i=G(r,2),o=e=>{var n=f(),r=R(n);{let e=L(()=>!!t(a)),n=L(()=>`Allow ${t(S)} in this conversation${t(C)?` for ${t(C)}`:``}`);H(r,()=>Zn,(r,i)=>{i(r,{get disabled(){return t(e)},get title(){return t(n)},onSelect:()=>void s(`always_conversation`),children:(e,t)=>{y();var n=g(`Allow in this conversation`);k(e,n)},$$slots:{default:!0}})})}k(e,n)};l(i,e=>{t(h)&&e(o)});var c=G(i,2),u=e=>{var n=f(),r=R(n);{let e=L(()=>!!t(a)),n=L(()=>`Always approve ${t(S)} in this project${t(C)?` for ${t(C)}`:``}`);H(r,()=>Zn,(r,i)=>{i(r,{get disabled(){return t(e)},get title(){return t(n)},onSelect:()=>void s(`always_project`),children:(e,t)=>{y();var n=g(`Always approve in project`);k(e,n)},$$slots:{default:!0}})})}k(e,n)};l(c,e=>{t(_)&&e(u)});var d=G(c,2),p=e=>{var n=f(),r=R(n);{let e=L(()=>!!t(a)),n=L(()=>`Always approve ${t(S)} for this user${t(C)?` in ${t(C)}`:``}`);H(r,()=>Zn,(r,i)=>{i(r,{get disabled(){return t(e)},get title(){return t(n)},onSelect:()=>void s(`always_user`),children:(e,t)=>{y();var n=g(`Always approve for user`);k(e,n)},$$slots:{default:!0}})})}k(e,n)};l(d,e=>{t(v)&&e(p)}),k(e,n)},r=L(()=>!!t(a));yJ(e,{get disabled(){return t(r)},menuAlign:`end`,menuClass:`w-56`,triggerLabel:`Approval options`,onclick:()=>void s(`approve`),menu:n,children:(e,n)=>{var r=f(),i=R(r),o=e=>{var t=dQ(),n=R(t);dn(n,{class:`size-3.5`}),y(),k(e,t)},s=e=>{var t=fQ(),n=R(t);ic(n,{class:`size-3.5`,strokeWidth:2.4}),y(),k(e,t)};l(i,e=>{t(a)===`approve`?e(o):e(s,-1)}),k(e,r)},$$slots:{menu:!0,default:!0}})}},o=e=>{{let n=L(()=>!!t(a));Q(e,{get disabled(){return t(n)},onclick:()=>void s(`approve`),children:(e,n)=>{var r=f(),i=R(r),o=e=>{var t=dQ(),n=R(t);dn(n,{class:`size-3.5`}),y(),k(e,t)},s=e=>{var t=fQ(),n=R(t);ic(n,{class:`size-3.5`,strokeWidth:2.4}),y(),k(e,t)};l(i,e=>{t(a)===`approve`?e(o):e(s,-1)}),k(e,r)},$$slots:{default:!0}})}};l(r,e=>{t(b)?e(i):e(o,-1)});var c=G(r,2);{let e=L(()=>!!t(a));Q(c,{variant:`outline`,get disabled(){return t(e)},onclick:()=>void s(`deny`),children:(e,n)=>{var r=f(),i=R(r),o=e=>{var t=pQ(),n=R(t);dn(n,{class:`size-3.5`}),y(),k(e,t)},s=e=>{var t=mQ(),n=R(t);ye(n,{class:`size-3.5`,strokeWidth:2.4}),y(),k(e,t)};l(i,e=>{t(a)===`deny`?e(o):e(s,-1)}),k(e,r)},$$slots:{default:!0}})}k(e,n)},i=K(n,`embedded`,3,!1),a=Y(void 0),o=Y(void 0);async function s(e){if(t(a))return;let r=e===`deny`?n.onDenyApproval:n.onGrantApproval;if(r){B(a,e,!0),B(o,void 0);try{e===`deny`?await r(n.approval.toolCallId):await r(n.approval.toolCallId,e===`approve`?`single_call`:e)}catch(e){B(o,e instanceof Error&&e.message.trim()?e.message:`Could not resolve the approval.`,!0)}finally{B(a,void 0)}}}function u(e){return e===`destructive`||e===`secret`||e===`deployment`?`destructive`:e===`command`||e===`external_read`||e===`workspace_write`||e===`external_write`?`warning`:e===`agent_spawn`?`info`:`neutral`}function d(){let e=n.approval.suggestedRules;if(e.length>0&&e.every(e=>e.when.toolNames?.[0]===`quick_script`))return e.map(e=>e.description??e.id).join(`; `);let t=e[0];if(t){let e=t.when.toolNames?.join(`, `)??`matching tools`,n=t.when.primaryArgument;return n?.operator===`equals`?`${e}: exact ${String(n.value)}`:e}let r=n.approval.suggestedExceptions[0];return r?`${r.tool}: ${r.rule}`:`this request`}let p=L(()=>[...n.presentation.secondary,{text:n.approval.risk?.replaceAll(`_`,` `)??``,tone:u(n.approval.risk)}]),m=L(()=>n.approval.suggestedRules.length>0||n.approval.suggestedExceptions.length>0),h=L(()=>n.approval.offeredScopes.includes(`always_conversation`)&&t(m)),_=L(()=>n.approval.offeredScopes.includes(`always_project`)&&t(m)),v=L(()=>n.approval.offeredScopes.includes(`always_user`)&&t(m)),b=L(()=>t(h)||t(_)||t(v)),S=L(d),C=L(()=>n.approval.permissionRuleSetId?n.approval.permissionRuleSetId.replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase()):void 0);var T=f(),E=R(T),O=e=>{var n=_Q(),i=q(n);r(i);var a=G(i,2),s=e=>{var n=gQ(),r=z(n,!0);F(()=>w(r,t(o))),k(e,n)};l(a,e=>{t(o)&&e(s)}),x(n),k(e,n)},A=e=>{var i=yQ(),a=q(i),s=e=>{var n=vQ(),r=z(n);F(()=>w(r,`Durable grants apply only to the ${t(C)??``} permission rule
105
+ set.`)),k(e,n)};l(a,e=>{t(C)&&t(b)&&e(s)});var c=G(a,2);{let e=L(()=>n.detailsAction?[n.detailsAction]:[]);kK(c,{get meta(){return t(p)},get cardActions(){return t(e)},get actions(){return r}})}var u=G(c,2),d=e=>{var n=gQ(),r=z(n,!0);F(()=>w(r,t(o))),k(e,n)};l(u,e=>{t(o)&&e(d)}),x(i),k(e,i)};l(E,e=>{i()?e(O):e(A,-1)}),k(e,T),D()}function xQ(e,n){c(n,!0);var r=f(),i=R(r);v(i,17,()=>n.questions,b,(e,r,i)=>{lq(e,{toolCallId:`draft`,get question(){return t(r)},index:i,get total(){return n.questions.length},phase:`idle`,streaming:!0})}),k(e,r),D()}function SQ(e,t){if(e?.toolName!==`plan_present`||e.status!==`waiting`)return;let n=e.interaction;if(n?.kind===`plan_review`&&n.status===`pending`)return t?.toolCallId===e.id&&t.status===`pending`?t:{toolCallId:e.id,agentId:e.agentId,conversationId:e.conversationId,projectId:e.projectId,slug:n.request.slug,title:n.request.title,summary:n.request.summary,planPath:n.request.planPath,status:`pending`,requestedAt:n.requestedAt,updatedAt:n.updatedAt}}var CQ=O(`<p class="px-3 py-1 text-ui"> <span class="font-mono"> </span></p>`),wQ=O(`<p class="px-3 py-2 text-ui text-warning"> </p> <!>`,1),TQ=O(`<!> <!> <!> <!>`,1),EQ=O(`<!> <!>`,1);function DQ(e,n){c(n,!0);let r=e=>{var r=f(),i=R(r),a=e=>{var r=f(),i=R(r);H(i,()=>t(N),(e,r)=>{r(e,{get toolCall(){return n.toolCall},get view(){return t(j)},expanded:!1,get detailsAction(){return t(ze)},get onOpenFile(){return n.onOpenFile},get questionRecord(){return t(pe)},get planReview(){return t(ve)},get onAnswerUserQuestion(){return n.onAnswerUserQuestion},get planReviewModels(){return p()},get planReviewModelKey(){return m()},get planReviewThinkingLevel(){return h()},get onDismissUserQuestion(){return n.onDismissUserQuestion},get onAcceptPlanReview(){return n.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return n.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return n.onRejectPlanReview}})}),k(e,r)};l(i,e=>{n.toolCall&&t(j)&&t(N)&&e(a)}),k(e,r)},i=e=>{IK(e,{get controller(){return _e}})},a=e=>{var r=f(),i=R(r),a=e=>{{let r=L(()=>t(C)&&y.reviewConfigurationBlock&&t(C).diagnostics.some(e=>e.code===`needs-review`)?()=>y.reviewConfigurationBlock(t(C).diagnostics):void 0);gH(e,{onResolve:e=>y.resolveConfigurationBlocked(n.toolCall.id,e),get onReview(){return t(r)}})}};l(i,e=>{n.toolCall&&y.resolveConfigurationBlocked&&e(a)}),k(e,r)},o=e=>{var r=f(),i=R(r),a=e=>{bQ(e,{embedded:!0,get approval(){return t(ae)},get toolName(){return n.toolCall.toolName},get presentation(){return t(de)},get onGrantApproval(){return n.onGrantApproval},get onDenyApproval(){return n.onDenyApproval}})};l(i,e=>{t(ae)&&t(de)&&n.toolCall&&e(a)}),k(e,r)},s=K(n,`hydrateBody`,3,!0),u=K(n,`outcomeUnknown`,3,!1),d=K(n,`detailsEnabled`,3,!0),p=K(n,`planReviewModels`,19,()=>[]),m=K(n,`planReviewModelKey`,3,``),h=K(n,`planReviewThinkingLevel`,3,`off`),g=Y(!1),_=L(()=>s()||t(g)),y=xK(),S=new _X(()=>y.fetchToolCall),C=L(()=>yX(n.toolCall)),T=me(()=>n.liveOutput),E=Y(U(T)),O=T?.text??``,A=new Mc(e=>{B(E,e,!0)});W(()=>{let e=n.liveOutput,t=e?.text??``,r=t.slice(O.length),i=!(!n.toolCall||[`committed`,`waiting`,`running`].includes(n.toolCall.status));O=t,A.enqueue(e,{priority:i||r.includes(`
106
+ `)})}),W(()=>()=>A.destroy());let j=L(()=>n.toolCall?iW(n.toolCall,t(E)):void 0),M=L(()=>n.toolCall&&t(j)?mG(t(j),n.toolCall):void 0),N=L(()=>t(j)?NY(t(j).kind):void 0),P=new kX({draft:()=>n.draft,hasToolCall:()=>!!n.toolCall,argsPreview:()=>n.toolCall?.argsPreview,hydrated:()=>t(_)}),I=L(()=>P.settled),ee=L(()=>P.block),te=L(()=>P.draining?void 0:n.toolCall),ne=L(()=>t(ee)?sX(t(ee),n.cwd):void 0),re=L(()=>t(ne)?UY(t(ne)):!1),ie=L(()=>RX(t(j))),ae=L(()=>vX(n.toolCall,n.pendingApproval)),V=L(()=>tG(n.toolCall?.toolName??n.draft?.block.toolName??`tool`)),oe=L(()=>({args:n.draft?.block.args,argsText:n.draft?.block.argsText,argsPreview:n.toolCall?.argsPreview})),se=L(()=>{if(!n.toolCall)return;let e=n.toolCall.toolName;return nG(e,t(oe),zX(n.toolCall),n.cwd)}),ce=L(()=>UX(n.toolCall?.argsPreview)),le=L(()=>{if(!t(te))return t(ne)?.argumentBody;if(!lX(t(te)))return t(se)?.body}),ue=L(()=>t(te)?!!(t(le)&&t(le).kind!==`none`):t(re)),de=L(()=>{if(t(ae)&&n.toolCall)return nG(n.toolCall.toolName,t(oe),`approval`,n.cwd)}),fe=L(()=>xX(t(j))),pe=L(()=>fU(n.toolCall,n.pendingUserQuestion)),he=L(()=>bX(t(j))),J=L(()=>(n.toolCall?.toolName??n.draft?.block.toolName)===`ask_user`),ge=L(()=>t(j)?.kind===`ask_user`?t(j):void 0),_e=new zK(()=>({toolCall:n.toolCall,questions:t(ge)?.questions??[],dismissed:t(ge)?.dismissed??!1,questionRecord:t(pe),voice:y.voice,draftStore:y.askUserDrafts,onAnswer:n.onAnswerUserQuestion,onDismiss:n.onDismissUserQuestion})),X=L(()=>t(J)&&!t(te)&&t(ee)?yU(uU({args:t(ee).args,argsText:t(ee).argsText})):void 0),ve=L(()=>SQ(n.toolCall,n.pendingPlanReview)),Z=L(()=>HX(n.toolCall)),ye=L(()=>t(Z).startedAtMs),be=L(()=>t(Z).settledAtMs),xe=L(()=>!!n.toolCall&&n.toolCall?.status===`running`&&!u()),Se=uH(()=>t(xe)?1e3:void 0),Ce=L(()=>uX({draft:t(ee),toolCall:t(te),outcomeUnknown:u()})),we=Y(!1);W(()=>{if(t(Ce)!==`queued`){B(we,!1);return}let e=setTimeout(()=>{B(we,!0)},400);return()=>clearTimeout(e)});let Te=L(()=>dX(t(Ce),t(we))),Ee=L(()=>fX(t(Te))),De=L(()=>XX({stage:pX(t(Te),t(te)?.status,{dismissed:t(ge)?.dismissed}),startedAtMs:t(ye),settledAtMs:t(be),nowMs:Se.now})),Oe=L(()=>QX(n.toolCall?.supervision)),ke=L(()=>{let e=t(Oe)?[t(De),t(Oe)]:[t(De)];return!t(te)||!n.toolCall?BX(e,t(ne)?.meta??[]):BX(e,t(ne)?.meta??[],t(se)?.secondary??[],t(M)?.meta??[])}),Ae=L(()=>gX({draft:t(ee),toolCall:t(te),argumentRegion:t(V).argumentRegion,hasArgumentBody:t(ue),hasDurableBodyContent:t(ie),bodyHydrated:t(_),hasApproval:!!t(ae),hasInteraction:t(fe),outcomeUnknown:u(),resultPlaceholder:t(V).resultPlaceholder,footerItems:t(ke),hasDetailsAction:!!(n.toolCall&&d())||!!(t(Be)&&n.onOpenTask)})),je=L(()=>SX(t(ne))),Me=L(()=>t(M)?.badge??t(ne)?.toolName??n.draft?.block.toolName??`tool`),Ne=L(()=>CX({planInteractive:t(he),durable:t(M)?.primaryArg,lifecycle:t(se)?.primaryArg,draft:t(je)})),Pe=L(()=>GX({stage:t(Te),activityRevision:t(Ae).structuralRevision,badge:t(Me),arg:t(Ne)})),Fe=L(()=>t(Ee)?.tone??t(M)?.dotTone??`info`),Ie=L(()=>t(Ee)?t(Ee).glyph:t(M)?.glyph),Le=L(()=>t(Ee)?.pulse??t(M)?.dotPulse??!0),Re=L(()=>t(ke)),ze=L(()=>n.toolCall&&d()?{label:_H,ariaLabel:`View ${n.toolCall.toolName} details`,onClick:()=>S.show(n.toolCall)}:void 0),Be=L(()=>t(M)?.backgroundTaskId),Ve=L(()=>{let e=[],r=t(Be);return r&&n.onOpenTask&&e.push({label:`Open task`,ariaLabel:`Open background task ${r}`,onClick:()=>n.onOpenTask(r)}),t(ze)&&e.push(t(ze)),e}),He=L(()=>n.toolCall?.error?Cc(n.toolCall.error,{headLines:4,tailLines:2,maxChars:2e3}).text:void 0),Ue=L(()=>wX({planInteractive:t(he),activitySections:t(Ae),hasAskUserDraftQuestions:!!t(X)?.length,hasAskUserView:t(ge)!==void 0,hasErrorPreview:!!t(He)})),We=L(()=>t(Ue).hilBodyVisible),Ge=L(()=>t(Ue).sheetVisible);W(()=>{s()&&B(g,!0)}),W(()=>{S.syncToolId(n.toolCall?.id)});let Ke=Y(`standard`),qe=lZ(),Je=new Set([`read`,`grep`,`find`,`ls`]),Ye=Y(!1),Xe=me(()=>t(Ae).resultMode===`output`),Ze;W(()=>{t(Ae).resultMode!==`output`||Xe||(Xe=!0,(qe?.currentProfile()??`standard`)===`standard`&&!Tc.current&&Je.has(t(j)?.kind??``)&&(B(Ye,!0),Ze=setTimeout(()=>{Ze=void 0,B(Ye,!1)},700)))}),W(()=>()=>clearTimeout(Ze)),WG({get streamMotion(){return t(Ke)!==`minimal`&&!Tc.current},get enter(){return t(Ye)}});var Qe=EQ(),$e=R(Qe);{let e=L(()=>t(te)?.status),s=L(()=>t(te)?void 0:t(Ae).phase===`prepared`?`prepared`:`drafting`),c=L(()=>t(Ee)?.label),u=L(()=>!t(he)),d=L(()=>t(Ae).footerVisible||t(J)||!!t(C)),p=L(()=>t(Ge)||t(We)||!!t(C)),m=L(()=>t(C)?a:t(Ae).interactionMode===`approval`&&t(ae)?o:t(ge)&&n.toolCall&&_e.pending?i:void 0);vZ($e,{get status(){return t(e)},get draftPhase(){return t(s)},get dotTone(){return t(Fe)},get dotPulse(){return t(Le)},get glyph(){return t(Ie)},get statusLabel(){return t(c)},get badge(){return t(Me)},get arg(){return t(Ne)},get argPending(){return t(u)},monoHeader:!0,get meta(){return t(Re)},get footer(){return t(d)},get bodyVisible(){return t(p)},get layoutRevision(){return t(Pe)},get cardActions(){return t(Ve)},get actions(){return t(m)},get onOpenFile(){return n.onOpenFile},get motionProfile(){return t(Ke)},set motionProfile(e){B(Ke,e,!0)},children:(e,i)=>{var a=f(),o=R(a),s=e=>{YG(e,{children:(e,n)=>{var r=wQ(),i=R(r),a=z(i,!0),o=G(i,2);v(o,17,()=>t(C).diagnostics,b,(e,n)=>{var r=CQ(),i=q(r),a=G(i),o=z(a);x(r),F(()=>{w(i,`${t(n).code??``}: `),w(o,`${(t(n).path||t(n).document)??``}${t(n).pointer??``}`)}),k(e,r)}),F(e=>w(a,e),[()=>t(C).diagnostics.some(e=>e.code===`needs-review`)?`Configuration blocked · A permission file changed outside Nerve and waits for your review. Review it, then retry or cancel this request.`:`Configuration blocked · Repair the configuration, then retry or cancel this request.`]),k(e,r)},$$slots:{default:!0}})},c=e=>{r(e)},u=e=>{YG(e,{children:(e,i)=>{var a=TQ(),o=R(a),s=e=>{xQ(e,{get questions(){return t(X)}})},c=e=>{fq(e,{get toolCall(){return n.toolCall},get view(){return t(ge)},get questionRecord(){return t(pe)},get controller(){return _e},get onOpenFile(){return n.onOpenFile},get onAnswerUserQuestion(){return n.onAnswerUserQuestion},get onDismissUserQuestion(){return n.onDismissUserQuestion}})};l(o,e=>{t(X)?.length?e(s):t(ge)&&n.toolCall&&t(Ae).resultMode===`output`&&e(c,1)});var u=G(o,2),d=e=>{},f=e=>{{let r=L(()=>t(te)??n.toolCall),i=L(()=>t(I)&&!!(n.toolCall||n.draft?.block.done)),a=L(()=>!t(I)||!n.toolCall&&!n.draft?.block.done);eJ(e,{section:!0,get body(){return t(le)},get toolCall(){return t(r)},get highlight(){return t(i)},get streaming(){return t(a)}})}};l(u,e=>{t(ge)||t(X)?e(d):t(Ae).argumentVisible&&t(le)&&e(f,1)});var p=G(u,2),m=e=>{{let n=L(()=>t(V).resultPlaceholder.ratio??t(ce));wZ(e,{get variant(){return t(V).resultPlaceholder.variant},get rows(){return t(V).resultPlaceholder.rows},get ratio(){return t(n)}})}},h=e=>{r(e)};l(p,e=>{t(Ae).resultMode===`placeholder`&&t(V).resultPlaceholder?e(m):t(Ae).resultMode===`output`&&!t(ge)&&e(h,1)});var g=G(p,2),_=e=>{jK(e,{get text(){return t(He)}})};l(g,e=>{t(Ae).errorVisible&&t(He)&&e(_)}),k(e,a)},$$slots:{default:!0}})};l(o,e=>{t(C)?e(s):t(We)?e(c,1):t(Ge)&&e(u,2)}),k(e,a)},$$slots:{default:!0}})}var et=G($e,2),tt=e=>{lQ(e,{get open(){return S.open},get previewToolCall(){return n.toolCall},get details(){return S.details},get loading(){return S.loading},get error(){return S.error},get onOpenFile(){return n.onOpenFile},onRetry:()=>S.show(n.toolCall),onOpenChange:e=>S.setOpen(e)})};l(et,e=>{n.toolCall&&d()&&e(tt)}),k(e,Qe),D()}var OQ=O(`<article class="grid w-full gap-1.5 py-2.5"><div class="min-w-0 leading-normal"><!> <span class="font-mono text-ui font-medium text-foreground"> </span></div> <!></article>`);function kQ(e,n){c(n,!0);let r=L(()=>Cc(n.error,{headLines:18,tailLines:6,maxChars:6e3}).text);var i=OQ(),a=q(i),o=q(a);tZ(o,{tone:`destructive`,size:14,class:`mr-1.5 align-middle`});var s=G(o,2),l=z(s,!0);x(a),YG(G(a,2),{children:(e,n)=>{jK(e,{get text(){return t(r)}})},$$slots:{default:!0}}),x(i),F(()=>w(l,n.toolName)),k(e,i),D()}function AQ(e,n){c(n,!0);let r=K(n,`open`,15,!1);ln(e,{get title(){return n.details.title},get description(){return n.details.description},size:`wide`,get open(){return r()},set open(e){r(e)},children:(e,i)=>{var a=f(),o=R(a),s=e=>{{let r=L(()=>!!n.details.language&&n.details.text.length<=262144);VG(e,{get code(){return n.details.text},get language(){return n.details.language},maxHeight:`70vh`,trim:!1,get highlight(){return t(r)}})}};l(o,e=>{r()&&e(s)}),k(e,a)},$$slots:{default:!0}}),D()}var jQ=O(`<p class="m-0 text-body leading-6 text-muted-foreground"> </p>`),MQ=O(`<!> <!>`,1);function NQ(e,r){c(r,!0);let i=K(r,`layoutRevision`,3,`static`),a=K(r,`bodyVisible`,3,!1),o=Y(!1),s=L(()=>[...r.notice.action?[r.notice.action]:[],...r.details?[{label:_H,ariaLabel:`View ${r.notice.badge} details`,onClick:()=>B(o,!0)}]:[]]),u=L(()=>!!r.notice.summary),d=L(()=>a()||t(u));var p=MQ(),m=R(p);{let e=L(()=>r.notice.arg?{text:r.notice.arg}:void 0),o=L(()=>r.notice.chips??[]);vZ(m,{get glyph(){return r.notice.glyph},get dotTone(){return r.notice.tone},get dotPulse(){return r.notice.busy},get statusLabel(){return r.notice.statusLabel},get badge(){return r.notice.badge},get arg(){return t(e)},get error(){return r.notice.error},get meta(){return t(o)},get cardActions(){return t(s)},get primaryAction(){return r.notice.primaryAction},get actions(){return r.actions},get bodyVisible(){return t(d)},get layoutRevision(){return i()},children:(e,t)=>{var i=MQ(),o=R(i),s=e=>{var t=jQ(),n=z(t,!0);F(()=>w(n,r.notice.summary)),k(e,t)};l(o,e=>{r.notice.summary&&e(s)});var c=G(o,2),u=e=>{var t=f(),i=R(t);n(i,()=>r.children),k(e,t)};l(c,e=>{a()&&r.children&&e(u)}),k(e,i)},$$slots:{default:!0}})}var h=G(m,2),g=e=>{AQ(e,{get details(){return r.details},get open(){return t(o)},set open(e){B(o,e,!0)}})};l(h,e=>{r.details&&e(g)}),k(e,p),D()}function PQ(e){return e.bodyVisible?e.previewVisible?`preview`:`status`:`none`}function FQ(e){return[e.state,`body:${e.bodyKind}`,e.errorVisible?`error`:`no-error`,e.footerItemCount>0?`footer:${e.footerItemCount}`:`no-footer`].join(`|`)}function IQ(e){return e.reason===`threshold`?`auto compact`:e.reason===`overflow`?`overflow recovery`:`manual`}function LQ(e){let t=IQ(e);switch(e.state){case`queued`:return{tone:`neutral`,glyph:`compaction`,busy:!1,badge:`compact_pending`,arg:t,statusLabel:`Compaction pending`};case`running`:return{tone:`info`,glyph:`compaction`,busy:!0,badge:`compacting`,arg:t,statusLabel:e.stopping?`Stopping compaction`:`Compacting the conversation context`};case`cancelled`:return{tone:`warning`,glyph:`compaction`,busy:!1,badge:`compact_stopped`,arg:t,statusLabel:`Compaction stopped`};case`failed`:return{tone:e.code?`warning`:`destructive`,glyph:`bell-dot`,busy:!1,badge:`compact_failed`,arg:t,statusLabel:`Compaction failed`};default:return typeof e.tokensAfter==`number`&&typeof e.thresholdTokens==`number`&&e.tokensAfter>=e.thresholdTokens?{tone:`warning`,glyph:`compaction`,busy:!1,badge:`compacted`,arg:t,statusLabel:`Insufficient context reduction: still at or above the compaction threshold`}:{tone:`success`,glyph:`compaction`,busy:!1,badge:`compacted`,arg:t,statusLabel:`Context compacted`}}}function RQ(e,n){c(n,!0);let r=e=>{Q(e,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Cancel compaction`,onclick:()=>n.onCancelCompaction?.(),children:(e,t)=>{ye(e,{"aria-hidden":`true`})},$$slots:{default:!0}})},i=L(()=>n.notice.state===`queued`&&!!n.onCancelCompaction);function a(e){return e&&typeof e==`object`?e:void 0}let o=L(()=>a(n.notice.details)),s=L(()=>See.safeParse(t(o)?.accounting).data),l=L(()=>typeof t(o)?.compactedMessages==`number`?t(o).compactedMessages:void 0),u=L(()=>LQ(n.notice)),d=L(()=>{let e=n.notice.contextTokens??n.notice.tokensBefore;if(e&&n.notice.contextWindow)return Math.round(e/n.notice.contextWindow*100)}),f=L(()=>n.notice.summaryPreview?.trimEnd()??``),p=L(()=>{if(n.notice.state!==`completed`)return t(f);let e=(n.notice.summary??n.notice.text??``).trimEnd();return e?bH(e).slice(-6).join(`
107
+ `):``}),m=L(()=>{if(n.notice.state!==`completed`)return;let e=(n.notice.summary??n.notice.text??``).trim();return e?{title:`Compaction summary`,description:t(s)?`${t(u).arg??``} · Conversation estimate: ${ak(t(s).summaryTokens)} summary + ${ak(t(s).retainedTokens)} retained across ${t(s).retainedMessages} messages. Excludes system/tool/provider overhead.${t(s).retentionBudgetExceeded?` Newest intact message/tool group exceeds the retention target.`:``}`:t(u).arg,text:e,language:`markdown`}:void 0}),h=L(()=>{let e=[];return typeof n.notice.tokensBefore==`number`&&e.push({text:`${ak(n.notice.tokensBefore)} before`}),typeof n.notice.tokensAfter==`number`&&e.push({text:`≈${ak(n.notice.tokensAfter)} after`}),typeof n.notice.freedTokens==`number`&&n.notice.freedTokens>0&&e.push({text:`≈${ak(n.notice.freedTokens)} freed`,tone:t(u).tone===`warning`?`warning`:`success`}),typeof t(l)==`number`&&e.push({text:`${t(l)} summarized`}),t(s)?.retentionBudgetExceeded&&e.push({text:`retained group exceeds target`,tone:`warning`}),typeof t(d)==`number`&&e.push({text:`${t(d)}% context`}),e}),g=L(()=>{let e=[],r=n.notice.contextTokens??n.notice.tokensBefore;return typeof r==`number`&&e.push({text:`${ak(r)} before`}),typeof t(d)==`number`&&e.push({text:`${t(d)}% context`}),typeof n.notice.generatedLines==`number`&&n.notice.generatedLines>0&&e.push({text:`${n.notice.generatedLines} lines`}),e}),_=L(()=>t(f)?[{text:`uncommitted draft`,tone:`warning`}]:[]),v=L(()=>n.notice.state===`completed`?t(h):n.notice.state===`running`?t(g):t(_)),y=L(()=>n.notice.state===`failed`&&!n.notice.code?n.notice.errorMessage?.trim()||`Could not compact this conversation.`:void 0),b=L(()=>{if(n.notice.state===`queued`)return`Compaction pending. It runs at the next safe point.`;if(n.notice.state===`running`&&!t(p))return n.notice.stopping?`Stopping compaction…`:`Summarizing recent work…`;if(n.notice.state===`cancelled`)return`Compaction stopped early. Conversation history is unchanged.`;if(n.notice.state===`failed`&&n.notice.code)return n.notice.errorMessage?.trim()||`Could not compact this conversation.`;if(n.notice.state===`completed`&&t(u).tone===`warning`)return t(u).statusLabel}),x=L(()=>({kind:`compaction`,tone:t(u).tone,glyph:t(u).glyph,busy:t(u).busy,badge:t(u).badge,arg:t(u).arg,statusLabel:t(u).statusLabel,summary:t(b),error:t(y),chips:t(v)})),S=L(()=>t(p).length>0),C=L(()=>FQ({state:n.notice.state,bodyKind:PQ({bodyVisible:t(S),previewVisible:t(p).length>0}),errorVisible:!!t(y),footerItemCount:t(v).length+ +!!t(m)+ +!!t(i)}));{let a=L(()=>t(i)?r:void 0);NQ(e,{get notice(){return t(x)},get layoutRevision(){return t(C)},get bodyVisible(){return t(S)},get details(){return t(m)},get actions(){return t(a)},children:(e,r)=>{{let r=L(()=>n.notice.state===`running`),i=L(()=>n.notice.state===`running`&&!n.notice.stopping),a=L(()=>n.notice.state===`running`);VG(e,{get code(){return t(p)},language:`markdown`,trim:!1,wrap:!0,overflow:`hidden`,tail:!0,get live(){return t(r)},get caret(){return t(i)},get streamMotion(){return t(a)},progressiveHighlight:!0,get fixedRows(){return 6}})}},$$slots:{default:!0}})}D()}var zQ=3,BQ=1,VQ=new Set([`BUTTON`,`SVG`,`SCRIPT`,`STYLE`,`TEMPLATE`,`TEXTAREA`,`SELECT`]),HQ=new Set(`ADDRESS.ARTICLE.ASIDE.BLOCKQUOTE.DD.DETAILS.DIV.DL.DT.FIGURE.FOOTER.H1.H2.H3.H4.H5.H6.HEADER.HR.LI.MAIN.NAV.OL.P.PRE.SECTION.SUMMARY.TABLE.TBODY.TD.TFOOT.TH.THEAD.TR.UL`.split(`.`));function UQ(e){return e.nodeName.toUpperCase()}function WQ(e,t){return e.getAttribute?.(t)??null}function GQ(e){return Array.from(e.childNodes)}function KQ(e){return e.nodeType===BQ}function qQ(e){return KQ(e)&&HQ.has(UQ(e))}function JQ(e){if(!KQ(e))return!1;if(VQ.has(UQ(e))||WQ(e,`aria-hidden`)===`true`||WQ(e,`data-quote-skip`)!==null)return!0;let t=WQ(e,`class`)??``;return/(^|\s)code-copy(\s|$)/.test(t)}function YQ(e,t){for(let n=e;n;){if(KQ(n)&&UQ(n)===t)return n;n=n.parentNode}return null}function XQ(e){return e.replace(/[ \t\r\n\f]+/g,` `)}function ZQ(e){return e.split(`
108
+ `).map(e=>e.trim()).join(`
109
+ `).trim()}function QQ(e,t){return e.split(`
110
+ `).map(e=>e&&`${t}${e}`).join(`
111
+ `)}function $Q(e){let t=GQ(e).find(e=>UQ(e)===`CODE`);return`${WQ(e,`class`)??``} ${t?WQ(t,`class`)??``:``}`.match(/language-([\w-]+)/)?.[1]??``}function e$(e,t){let n=e.match(/^(\s*)([\s\S]*?)(\s*)$/);return n?.[2]?`${n[1]}${t}${n[2]}${t}${n[3]}`:e}function t$(e){let t=e.parentNode;return!t||UQ(t)!==`OL`?`- `:`${(Number(WQ(t,`start`)??`1`)||1)+GQ(t).filter(e=>UQ(e)===`LI`).indexOf(e)}. `}var n$=class{clip;constructor(e){this.clip=e}rawText(e){return e.nodeType===zQ?this.clip.textOf(e):!KQ(e)||JQ(e)||!this.clip.includes(e)?``:UQ(e)===`BR`?`
112
+ `:GQ(e).map(e=>this.rawText(e)).join(``)}inline(e){if(e.nodeType===zQ)return XQ(this.clip.textOf(e));if(!KQ(e)||JQ(e)||!this.clip.includes(e))return``;if(qQ(e))return this.block(e);let t=()=>GQ(e).map(e=>this.inline(e)).join(``);switch(UQ(e)){case`BR`:return`
113
+ `;case`STRONG`:case`B`:return e$(t(),`**`);case`EM`:case`I`:return e$(t(),`*`);case`DEL`:case`S`:return e$(t(),`~~`);case`CODE`:{let t=this.rawText(e);if(!t)return``;let n=t.includes("`")?"``":"`";return`${n}${t}${n}`}case`A`:{let n=t(),r=WQ(e,`href`);return!n.trim()||!r||r.startsWith(`#`)?n:n.trim()===r?r:`[${n}](${r})`}case`INPUT`:return WQ(e,`type`)===`checkbox`?WQ(e,`checked`)===null?`[ ] `:`[x] `:``;case`IMG`:{let t=WQ(e,`alt`)??``,n=WQ(e,`src`);return n?`![${t}](${n})`:t}default:return t()}}blocks(e){let t=[],n=``,r=()=>{let e=ZQ(n);e&&t.push(e),n=``};for(let i of GQ(e))if(qQ(i)){if(r(),JQ(i)||!this.clip.includes(i))continue;let e=this.block(i);e.trim()&&t.push(e)}else n+=this.inline(i);return r(),t}block(e){let t=UQ(e);switch(t){case`H1`:case`H2`:case`H3`:case`H4`:case`H5`:case`H6`:{let n=ZQ(this.blocks(e).join(` `));return n?`${`#`.repeat(Number(t[1]))} ${n}`:``}case`HR`:return`---`;case`PRE`:return this.pre(e);case`UL`:case`OL`:return this.list(e);case`LI`:return this.listItem(e,t$(e));case`BLOCKQUOTE`:return this.blocks(e).join(`
114
+
115
+ `).split(`
116
+ `).map(e=>e?`> ${e}`:`>`).join(`
117
+ `);case`TABLE`:return this.table(e);default:return this.blocks(e).join(`
118
+
119
+ `)}}pre(e){let t=this.rawText(e).replace(/\n+$/,``);if(!t.trim())return``;let n=t.includes("```")?"````":"```";return`${n}${$Q(e)}\n${t}\n${n}`}list(e){let t=[];for(let n of GQ(e)){if(UQ(n)!==`LI`||JQ(n)||!this.clip.includes(n))continue;let e=this.listItem(n,t$(n));e&&t.push(e)}return t.join(`
120
+ `)}listItem(e,t){let n=this.blocks(e).join(`
121
+ `);if(!n.trim())return``;let r=` `.repeat(t.length),[i=``,...a]=n.split(`
122
+ `);return[`${t}${i}`,...a.map(e=>QQ(e,r))].join(`
123
+ `)}table(e){let t=[],n=0,r=e=>{for(let i of GQ(e)){let e=UQ(i);if(e===`THEAD`||e===`TBODY`||e===`TFOOT`)r(i);else if(e===`TR`&&this.clip.includes(i)){let e=GQ(i).filter(e=>UQ(e)===`TH`||UQ(e)===`TD`).map(e=>this.clip.includes(e)?ZQ(this.blocks(e).join(` `)).replaceAll(`
124
+ `,` `).replaceAll(`|`,`\\|`):``);e.some(Boolean)&&(YQ(i,`THEAD`)&&t.length===n&&(n+=1),t.push(e))}}};if(r(e),t.length===0)return``;let i=Math.max(...t.map(e=>e.length)),a=t.map(e=>`| ${Array.from({length:i},(t,n)=>e[n]??``).join(` | `)} |`),o=`| ${Array.from({length:i},()=>`---`).join(` | `)} |`;return a.splice(Math.max(n,1),0,o),a.join(`
125
+ `)}};function r$(e,t){let n=new n$(t),r=YQ(e,`PRE`),i;return i=r?n.pre(r):e.nodeType===zQ?XQ(t.textOf(e)):qQ(e)?n.block(e):n.blocks(e).join(`
126
+
127
+ `),i$(i)}function i$(e){return e.split(`
128
+ `).map(e=>e.trimEnd()).join(`
129
+ `).replace(/^\n+/,``).replace(/\n{3,}/g,`
130
+
131
+ `).replace(/\n+$/,``)}function a$(e){let t=[];for(let n=0;n<e.rangeCount;n+=1){let r=e.getRangeAt(n),i=r$(r.commonAncestorContainer,{textOf(e){let t=e.textContent??``,n=e;if(!r.intersectsNode(n))return``;let i=n===r.startContainer?r.startOffset:0,a=n===r.endContainer?r.endOffset:t.length;return t.slice(i,a)},includes(e){return r.intersectsNode(e)}});i&&t.push(i)}return t.join(`
132
+
133
+ `)}function o$(e,t){if(!e||e.isCollapsed||e.rangeCount===0)return;let n=i$(e.toString());if(n.trim())try{for(let r=0;r<e.rangeCount;r+=1)if(e.getRangeAt(r).intersectsNode(t))return n}catch{}}var s$=O(`<div class="contents" role="presentation"><!></div>`);function c$(e,r){c(r,!0);let i=K(r,`disabled`,3,!1),a=Y(void 0),o=L(()=>r.menu(r.target,t(a)));function s(e){let t=window.getSelection(),n=o$(t,e.currentTarget);B(a,n&&t?{text:n,markdown:a$(t)||n}:void 0,!0)}var l=s$(),u=q(l);Uu(u,{get items(){return t(o)},get triggerClass(){return r.triggerClass},get disabled(){return i()},children:(e,t)=>{var i=f(),a=R(i);n(a,()=>r.children),k(e,i)},$$slots:{default:!0}}),x(l),h(`contextmenu`,l,s),k(e,l),D()}ue([`contextmenu`]);var l$=O(`<div> </div>`);function u$(e,t){c(t,!0);let n=K(t,`class`,3,``);var r=l$(),i=z(r,!0);F(e=>{X(r,1,e),w(i,t.text)},[()=>T(ft(`min-w-0 max-w-full whitespace-pre-wrap break-words`,n()))]),k(e,r),D()}var d$=O(`<div role="group" aria-label="Queued prompt actions"><!></div>`),f$=O(`<article class="group/user-bubble relative ml-auto w-fit min-w-0 max-w-[70%] rounded-lg rounded-br-sm px-3 py-2 text-body text-foreground @max-[40rem]:max-w-[88%]"><div aria-hidden="true"></div> <div aria-hidden="true"></div> <div class="relative min-w-0 overflow-hidden"><!> <!></div> <!></article>`);function p$(e,t){let r=K(t,`queued`,3,!1),i=K(t,`showActions`,19,r);var a=f$(),o=q(a);let s;var c=G(o,2);let u;var d=G(c,2),f=q(d),p=e=>{u$(e,{get text(){return t.text}})};l(f,e=>{t.text&&e(p)});var h=G(f,2);n(h,()=>t.children??m),x(d);var g=G(d,2),_=e=>{var r=d$(),a=q(r);n(a,()=>t.actions),x(r),F(()=>{X(r,1,T([`pointer-events-none absolute top-0 right-2 z-10 flex -translate-y-1/2 gap-0.5 rounded-md border bg-popover p-0.5 text-popover-foreground opacity-0 shadow-sm transition-opacity duration-[180ms] motion-reduce:transition-none`,i()&&`group-hover/user-bubble:pointer-events-auto group-hover/user-bubble:opacity-100 group-focus-within/user-bubble:pointer-events-auto group-focus-within/user-bubble:opacity-100 [@media(hover:none)]:pointer-events-auto [@media(hover:none)]:opacity-100`])),r.inert=!i(),J(r,`aria-hidden`,!i())}),k(e,r)};l(g,e=>{t.actions&&e(_)}),x(a),F(()=>{J(a,`aria-label`,r()?`Queued user prompt`:`User message`),J(a,`data-queued`,r()),s=X(o,1,`delivered-skin pointer-events-none absolute inset-0 rounded-[inherit] border transition-opacity duration-[180ms] motion-reduce:transition-none svelte-m4659z`,null,s,{"opacity-0":r()}),u=X(c,1,`queued-skin pointer-events-none absolute inset-0 rounded-[inherit] border border-dashed bg-panel transition-opacity duration-[180ms] motion-reduce:transition-none svelte-m4659z`,null,u,{"opacity-0":!r()})}),k(e,a)}var m$=O(`<!> <!>`,1),h$=O(`<!> <!> <!>`,1),g$=O(`<pre class="mt-2 whitespace-pre-wrap break-words rounded-md border border-destructive-strong bg-destructive-subtle p-3 font-mono text-ui text-destructive"> </pre>`);function _$(e,n){c(n,!0);let r=Y(void 0);async function i(e){if(!t(r)&&n.prompt){B(r,e,!0);try{e===`force-push`?await n.onForcePush?.(n.prompt):e===`edit`?await n.onMoveToComposer?.(n.prompt):await n.onDiscard?.(n.prompt)}catch{}finally{B(r,void 0)}}}let a=L(()=>n.prompt?{kind:`queued_prompt`,prompt:n.prompt,busy:!!t(r),canForcePush:!!n.onForcePush,canEdit:!!n.onMoveToComposer,canDiscard:!!n.onDiscard,onForcePush:()=>void i(`force-push`),onEdit:()=>void i(`edit`),onDiscard:()=>void i(`discard`)}:n.item?{kind:`message`,item:n.item}:void 0);var o=f(),s=R(o),u=e=>{c$(e,{get target(){return t(a)},get menu(){return n.transcriptMenu},triggerClass:`block select-text`,children:(e,a)=>{{let a=e=>{var a=f(),o=R(a);H(o,()=>En,(e,a)=>{a(e,{delayDuration:300,disableHoverableContent:!0,children:(e,a)=>{var o=h$(),s=R(o);H(s,()=>wn,(e,a)=>{a(e,{children:(e,a)=>{var o=m$(),s=R(o);{let e=(e,a)=>{let o=()=>(a?.()).props;{let a=L(()=>!n.prompt||!n.onForcePush||!!t(r));Q(e,P(o,{variant:`ghost`,size:`icon-sm`,get disabled(){return t(a)},ariaLabel:`Force push all queued prompts`,onclick:()=>void i(`force-push`),children:(e,t)=>{qne(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))}};H(s,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(s,2);H(c,()=>Sn,(e,t)=>{t(e,{sideOffset:4,children:(e,t)=>{y();var n=g(`Force push all queued prompts`);k(e,n)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})});var c=G(s,2);H(c,()=>wn,(e,a)=>{a(e,{children:(e,a)=>{var o=m$(),s=R(o);{let e=(e,a)=>{let o=()=>(a?.()).props;{let a=L(()=>!n.prompt||!n.onMoveToComposer||!!t(r));Q(e,P(o,{variant:`ghost`,size:`icon-sm`,get disabled(){return t(a)},ariaLabel:`Cancel and edit queued prompt`,onclick:()=>void i(`edit`),children:(e,t)=>{Dn(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))}};H(s,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(s,2);H(c,()=>Sn,(e,t)=>{t(e,{sideOffset:4,children:(e,t)=>{y();var n=g(`Cancel & Edit`);k(e,n)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})});var l=G(c,2);H(l,()=>wn,(e,a)=>{a(e,{children:(e,a)=>{var o=m$(),s=R(o);{let e=(e,a)=>{let o=()=>(a?.()).props;{let a=L(()=>!n.prompt||!n.onDiscard||!!t(r));Q(e,P(o,{variant:`ghost`,size:`icon-sm`,get disabled(){return t(a)},ariaLabel:`Discard queued prompt`,onclick:()=>void i(`discard`),children:(e,t)=>{kn(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))}};H(s,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(s,2);H(c,()=>Sn,(e,t)=>{t(e,{sideOffset:4,children:(e,t)=>{y();var n=g(`Discard`);k(e,n)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})}),k(e,o)},$$slots:{default:!0}})}),k(e,a)},o=L(()=>n.prompt?.text??n.item?.text??``),s=L(()=>!!(n.prompt&&n.prompt.presentation!==`starting`)),c=L(()=>!!n.prompt);p$(e,{get text(){return t(o)},get queued(){return t(s)},get showActions(){return t(c)},actions:a,children:(e,r)=>{var i=f(),a=R(i),o=e=>{var t=g$(),r=z(t,!0);F(e=>w(r,e),[()=>n.item.errorMessage.trim()]),k(e,t)},s=L(()=>n.item?.stopReason===`error`&&n.item.errorMessage?.trim());l(a,e=>{t(s)&&e(o)}),k(e,i)},$$slots:{actions:!0,default:!0}})}},$$slots:{default:!0}})};l(s,e=>{t(a)&&e(u)}),k(e,o),D()}function v$(e){switch(e.event){case`ready`:return{tone:`info`,glyph:`bell-ring`,badge:`task_ready`,spokenLabel:`task ready`,impliedStatuses:[`ready`,`running`]};case`completed`:return e.exitCode!==void 0&&e.exitCode!==null&&e.exitCode!==0?{tone:`destructive`,glyph:`bell-dot`,badge:`task_exited`,spokenLabel:`task exited`,impliedStatuses:[`completed`,`exited`,`stopped`,`failed`]}:{tone:`success`,glyph:`bell`,badge:`task_completed`,spokenLabel:`task completed`,impliedStatuses:[`completed`,`exited`,`stopped`]};case`failed`:return{tone:`destructive`,glyph:`bell-dot`,badge:`task_failed`,spokenLabel:`task failed`,impliedStatuses:[`failed`]};case`timed_out`:case`ready_timeout`:return{tone:`destructive`,glyph:`bell-dot`,badge:`task_timed_out`,spokenLabel:`task timed out`,impliedStatuses:[`timed_out`,`running`,`ready`]};case`interrupted`:return{tone:`warning`,glyph:`bell-dot`,badge:`task_interrupted`,spokenLabel:`task interrupted`,impliedStatuses:[`interrupted`]};case`cancelled`:return{tone:`warning`,glyph:`bell-dot`,badge:`task_cancelled`,spokenLabel:`task cancelled`,impliedStatuses:[`cancelled`,`stopped`,`aborted`]};default:return{tone:`neutral`,glyph:`bell`,badge:`task_update`,spokenLabel:`task update`,impliedStatuses:[]}}}function y$(e,t){let n=[];return e.exitCode!==void 0&&e.exitCode!==null?n.push({text:`exit ${e.exitCode}`,...e.exitCode===0?{}:{tone:`destructive`}}):e.signal&&n.push({text:`signal ${e.signal}`,tone:`warning`}),e.status&&!t.includes(e.status)&&n.push({text:e.status,tone:jee(e.status)}),e.groupName&&n.push({text:`group ${e.groupName}`}),n}function b$(e,t={}){let n=v$(e),r=e.taskId,i=t.onOpenTask,a=e.taskName??e.groupName,o=e.command?.trim(),s=e.commandPreview?.trim(),c=(o?.includes(`
134
+ `)??!1?void 0:s??o)??a??(o?`background task`:void 0);return{kind:`task`,tone:n.tone,glyph:n.glyph,badge:n.badge,arg:c,statusLabel:a?`Background ${n.spokenLabel}: ${a}`:`Background ${n.spokenLabel}`,chips:y$(e,n.impliedStatuses),action:r&&i?{label:`Open task`,ariaLabel:`Open task ${a??r}`,onClick:()=>i(r)}:void 0}}var x$=O(`<section class="grid gap-1" aria-label="Task command"><!></section>`),S$=O(`<section class="grid gap-1" aria-label="Task output"><!></section>`),C$=O(`<!> <!>`,1);function w$(e,n){c(n,!0);let r=L(()=>b$(n.notice,{onOpenTask:n.onOpenTask})),i=L(()=>n.notice.command?.trim()?n.notice.command:``),a=L(()=>t(i).includes(`
135
+ `)?t(i):``),o=L(()=>n.notice.output?.trim()?n.notice.output:``),s=L(()=>!!(t(a)||t(o))),u=L(()=>`${n.notice.event??`unknown`}:${n.notice.status??`none`}:${t(a)?`command`:`inline`}:${t(o)?`output`:`no-output`}`);NQ(e,{get notice(){return t(r)},get layoutRevision(){return t(u)},get bodyVisible(){return t(s)},children:(e,n)=>{var r=C$(),i=R(r),s=e=>{var n=x$();qG(q(n),{get text(){return t(a)},language:`bash`}),x(n),k(e,n)};l(i,e=>{t(a)&&e(s)});var c=G(i,2),u=e=>{var n=S$();qG(q(n),{get text(){return t(o)},direction:`tail`,terminal:!0}),x(n),k(e,n)};l(c,e=>{t(o)&&e(u)}),k(e,r)},$$slots:{default:!0}}),D()}function T$(e){return e.details&&typeof e.details==`object`?e.details:{}}function E$(e){return typeof e==`string`&&e.trim()?e:void 0}function D$(e){return e.kind===`subagent_run_event`||E$(T$(e).type)===`subagent_event`}function O$(e){if(D$(e)){let t=zU(e.text);if(t)return[t.outcome===`waiting`?t.detail:void 0,t.response].filter(Boolean).join(`
136
+ `)}return(e.summary??e.text).trim()}function k$(e){let t=xH(O$(e));return t>6?[{text:dW(t,`line`)}]:[]}function A$(e,t={}){let n=N$(e,t),r=[...n.chips??[],...k$(e)];return r.length>0?{...n,chips:r}:n}function j$(e,t){let n=T$(e),r=zU(e.text),i=r?.outcome??E$(n.outcome)??E$(n.status)??`update`,a=r?.reportPath;return{kind:`subagent`,tone:i===`completed`?`success`:i===`failed`?`destructive`:`warning`,glyph:`subagent`,badge:`subagent_${i}`,arg:r?.name??E$(n.childName)??`sub-agent`,statusLabel:`Sub-agent ${r?.name??``} ${i}; agent notified`,error:i===`failed`?r?.detail:void 0,chips:r?.profile?[{text:r.profile}]:[],action:a&&t?{label:`Open report`,ariaLabel:`Open full report for ${r?.name??`sub-agent`}`,onClick:()=>t(a)}:void 0}}function M$(e,t){let n=E$(e.sourceTitle),r=E$(e.sourceConversationId);return{kind:`fork`,tone:`info`,glyph:`branch`,badge:`forked`,arg:n,statusLabel:`Forked from ${n??`another conversation`}; agent notified`,action:r&&t?{label:`Open source`,ariaLabel:`Open source conversation ${n??``}`.trim(),onClick:()=>t(r)}:void 0}}function N$(e,t){let n=T$(e);if(n.subtype===`fork`)return M$(n,t.onOpenConversation);let r=E$(n.type);return e.kind===`branch_summary`?{kind:`branch`,tone:`info`,glyph:`branch`,badge:`branch_summarized`,arg:`context carried to this branch`,statusLabel:`Branch summary added to agent context`,chips:e.fromEntryId?[{text:`from ${e.fromEntryId}`,mono:!0}]:[]}:D$(e)?j$(e,t.onOpenFile):e.kind===`tool_result`?{kind:`tool_result`,tone:n.isError===!0?`destructive`:`neutral`,glyph:`system`,badge:`tool_result`,arg:E$(n.toolName)??E$(n.command),statusLabel:`Unpaired tool result in agent context`}:{kind:`system`,tone:`info`,glyph:`system`,badge:r&&/^[a-z][a-z0-9_]*$/.test(r)?r:e.kind===`message`?`system_event`:e.kind,statusLabel:`System event in conversation`}}function P$(e,n){c(n,!0);let{openConversation:r}=xK(),i=L(()=>A$(n.notice,{onOpenFile:n.onOpenFile,onOpenConversation:r})),a=L(()=>O$(n.notice)),o=L(()=>t(a)?{title:`${t(i).badge} details`,description:t(i).arg,text:t(a),language:`markdown`}:void 0);{let n=L(()=>!!t(a));NQ(e,{get notice(){return t(i)},get bodyVisible(){return t(n)},get details(){return t(o)},children:(e,n)=>{var r=f(),i=R(r),o=e=>{qG(e,{get text(){return t(a)},language:`markdown`,overflow:`hidden`})};l(i,e=>{t(a)&&e(o)}),k(e,r)},$$slots:{default:!0}})}D()}var F$=/rate.?limit|too many requests|usage limit|insufficient_quota|quota exceeded|available balance|out of budget/i,I$=/authentication|unauthorized|forbidden|invalid (?:api )?key|missing (?:api )?key|auth(?:entication)? failed/i,L$=/network.?error|connection.?error|connection.?refused|connection.?lost|fetch failed|upstream.?connect|socket hang up|reset before headers|websocket.?closed|websocket.?error|http2 request did not get a response|timed? out|timeout|terminated|stream ended/i;function R$(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function z$(e){let t=e?.status??e?.statusCode;return typeof t==`number`&&t>=100&&t<=599?Math.trunc(t):void 0}function B$(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function V$(e){let t=e.match(/^\s*(\d{3})(?:\s+|$)/),n=t?Number(t[1]):void 0,r=t?e.slice(t[0].length).trim():e.trim();if(!r.startsWith(`{`))return{httpStatus:n,parsed:!1};try{let e=R$(JSON.parse(r)),t=R$(e?.error);return{message:B$(t,`message`)??B$(e,`message`)??B$(t,`detail`)??B$(e,`detail`),type:B$(t,`type`)??B$(t,`code`)??B$(e,`type`)??B$(e,`code`),httpStatus:n??z$(e)??z$(t),parsed:!0}}catch{return{httpStatus:n,parsed:!1}}}function H$(e,t=`unknown`){let n=(e instanceof Error?e.message:String(e??``)).trim()||`Run failed.`,r=V$(n),i=r.message??n,a=`${r.type??``} ${i}`,o=r.httpStatus,s;return s=o===429||F$.test(a)?`rate_limit`:o===401||o===403||I$.test(a)?`authentication`:L$.test(a)?`connection`:t===`provider`||r.parsed||o?`provider`:t===`harness`?`harness`:`unknown`,{message:i,category:s,...o?{httpStatus:o}:{}}}function U$(e){return typeof e==`string`&&[`rate_limit`,`authentication`,`connection`,`provider`,`harness`,`unknown`].includes(e)?e:void 0}function W$(e){if(typeof e.attempt==`number`)return{text:typeof e.maxRetries==`number`?`retry ${e.attempt}/${e.maxRetries}`:`retry ${e.attempt}`}}var G$={rate_limit:`Rate limit`,authentication:`Authentication error`,connection:`Connection error`,provider:`API error`,harness:`Harness error`,unknown:`Run error`};function K$(e){if(!e.errorMessage?.trim()){let t=e.failureCategory??`unknown`;return{category:t,label:G$[t],httpStatus:e.httpStatus}}let t=H$(e.errorMessage),n=e.failureCategory??t.category;return{message:t.message,category:n,label:G$[n],httpStatus:e.httpStatus??t.httpStatus}}function q$(e){return e?{text:`HTTP ${e}`,mono:!0}:void 0}function J$(e,t={}){let n=K$(e),r=t.onContinue?{label:`Continue`,ariaLabel:`Continue this run`,onClick:t.onContinue}:void 0;if(e.state===`retrying`){let t=[{text:`UI-only`,tone:`neutral`}],r=W$(e);r&&t.push(r);let i=q$(n.httpStatus);return i&&t.push(i),{kind:`run`,tone:`destructive`,glyph:`bell-dot`,busy:!1,badge:`run_retrying`,arg:n.label,statusLabel:`Model request failed; waiting to retry`,error:n.message,chips:t}}let i=[{text:`UI-only`,tone:`neutral`}],a=W$(e);a&&i.push(a);let o=q$(n.httpStatus);return o&&i.push(o),e.state===`interrupted`?{kind:`run`,tone:`destructive`,glyph:`bell-dot`,badge:`run_interrupted`,arg:n.label,statusLabel:`Run interrupted`,error:n.message,summary:r?`Nothing will resume until you choose Continue.`:void 0,chips:i,primaryAction:r}:{kind:`run`,tone:`destructive`,glyph:`bell-dot`,badge:`run_failed`,arg:n.label,statusLabel:`Run failed`,error:n.message,chips:i,primaryAction:r}}function Y$(e,n){c(n,!0);let r=L(()=>n.notice.state!==`retrying`&&n.isLast&&!n.sending&&n.notice.retryable===!0&&!!n.notice.runId&&!!n.onContinueFromFailure),i=L(()=>J$(n.notice,{onContinue:t(r)&&n.notice.runId?()=>n.onContinueFromFailure?.(n.notice.runId):void 0})),a=L(()=>`${n.notice.state}:${t(r)?`continue`:`static`}`);NQ(e,{get notice(){return t(i)},get layoutRevision(){return t(a)},bodyVisible:!1}),D()}var X$=O(`<p>Provider returned redacted thinking.</p>`),Z$=O(`<div><!></div>`),Q$=O(`<div class="thinking-group svelte-lys2cq"><div class="thinking-content svelte-lys2cq"></div></div>`);function $$(e,n){var r=Q$(),i=q(r);v(i,23,()=>n.items,(e,t)=>e.id??t,(e,n)=>{let r=L(()=>!(!t(n).live||t(n).done));var i=Z$();let a;var o=q(i),s=e=>{var n=X$();let i;F(()=>i=X(n,1,`redacted svelte-lys2cq`,null,i,{"live-caret":t(r)})),k(e,n)},c=e=>{wc(e,{get text(){return t(n).text},get streaming(){return t(r)},reveal:!0,get caret(){return t(r)},get onCopy(){return Cd}})};l(o,e=>{t(n).redacted&&!t(n).text?e(s):e(c,-1)}),x(i),F(()=>a=X(i,1,`thinking-step`,null,a,{"step-live":t(r)})),k(e,i)}),x(i),x(r),k(e,r)}var e1={standard:280,compact:160,minimal:120},t1=6.64,n1=.5,r1=5,i1=class{value;velocity=0;goal;constructor(e){this.value=e,this.goal=e}get height(){return this.value}get target(){return this.goal}get settled(){return this.value===this.goal&&this.velocity===0}retarget(e){this.goal=e}snap(e=this.goal){this.goal=e,this.value=e,this.velocity=0}step(e,t){if(this.settled)return!0;if(t<=0)return this.snap(),!0;let n=Math.min(Math.max(0,e),24)/1e3,r=t1/(t/1e3),i=this.value-this.goal,a=this.velocity+r*i,o=Math.exp(-r*n);return this.value=this.goal+(i+a*n)*o,this.velocity=(this.velocity-r*a*n)*o,Math.abs(this.goal-this.value)<n1&&Math.abs(this.velocity)<r1&&(this.snap(),!0)}},a1=1e3/60;function o1(e){let t=e.maxActive??6,n=new Set,r,i;function a(){r===void 0&&n.size!==0&&(r=e.frames.request(o))}function o(e){r=void 0;let t=i===void 0?a1:e-i;i=e;for(let e of[...n])e.step(t)&&n.delete(e);n.size===0?i=void 0:a()}return{add(e){return n.has(e)?!0:n.size>=t?!1:(n.add(e),a(),!0)},remove(t){n.delete(t),n.size>0||r===void 0||(e.frames.cancel(r),r=void 0,i=void 0)},get activeCount(){return n.size}}}var s1;function c1(){if(s1)return s1;if(typeof requestAnimationFrame==`function`)return s1=o1({frames:{request:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)}}),s1}var l1=O(`<div><div class="flow-root"><!></div></div>`);function u1(e,r){c(r,!0);let i=K(r,`active`,3,!1),a=K(r,`visible`,3,!0),o=Y(void 0),s=Y(void 0),u=new i1(0),d=!1,p,m;function h(){return e1[r.profile?.()??`standard`]}function g(){t(o)?.style.removeProperty(`height`),t(o)?.style.removeProperty(`overflow`)}function _(){return i()&&a()&&!Tc.current&&h()>0}function v(e){t(o)&&(t(o).style.removeProperty(`overflow`),t(o).style.height=`${e}px`)}function y(){_()?v(u.height):g()}let b={step(e){let n=u.step(e,h());return n?(m=void 0,y()):t(o)&&(t(o).style.height=`${u.height}px`),n}};function S(e){u.snap(e),m&&=(m.remove(b),void 0),y()}function C(e){return _()&&!e}function w(e,n){if(!d){d=!0,p=n,S(e);return}let r=p!==void 0&&Math.abs(n-p)>.5;if(p=n,!C(r)||!m&&Math.abs(e-u.height)<.5){S(e);return}if(u.retarget(e),m)return;let i=c1();!i||!i.add(b)?S(e):(m=i,t(o)&&(t(o).style.overflow=`hidden`,t(o).style.height=`${u.height}px`))}W(()=>{let e=_();me(()=>{!m&&d&&(e?v(u.height):g())})}),W(()=>{let e=t(s);if(!e||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(e=>{let t=e.at(-1),n=t?.borderBoxSize?.[0];t&&n&&w(n.blockSize,n.inlineSize)});return n.observe(e),()=>{n.disconnect(),m?.remove(b),m=void 0}});var E=l1(),O=q(E),A=q(O),j=e=>{var t=f(),i=R(t);n(i,()=>r.children),k(e,t)};l(A,e=>{r.children&&e(j)}),x(O),te(O,e=>B(s,e),()=>t(s)),x(E),te(E,e=>B(o,e),()=>t(o)),F(()=>X(E,1,T(r.class))),k(e,E),D()}var d1=O(`<div class="relative min-w-0 px-[calc(var(--conversation-content-inset,1.5rem)/2)]"><!></div>`),f1=O(`<article class="transcript-entry assistant thinking-entry svelte-1scsvu5" data-state="static"><div class="message-body svelte-1scsvu5"><!></div></article>`),p1=O(`<div class="message-content svelte-1scsvu5"><!></div>`),m1=O(`<pre class="mt-2 whitespace-pre-wrap break-words rounded-md border border-destructive-strong bg-destructive-subtle p-3 font-mono text-ui text-destructive"> </pre>`),h1=O(`<article><div class="message-body svelte-1scsvu5"><!> <!></div></article>`),g1=O(`<div><!></div>`);function _1(e,n){c(n,!0);let r=K(n,`approvalsByToolCallId`,19,()=>new Map),i=K(n,`questionsByToolCallId`,19,()=>new Map),a=K(n,`reviewsByToolCallId`,19,()=>new Map),o=K(n,`outcomeUnknownToolCallIds`,19,()=>new Set),s=K(n,`hydrateToolBodies`,3,!0),u=K(n,`visible`,3,!0),d=K(n,`planReviewModels`,19,()=>[]),p=K(n,`planReviewModelKey`,3,``),m=K(n,`planReviewThinkingLevel`,3,`off`),h=L(()=>{if(n.node.kind!==`thinking_group`)return;let e=n.node.items[0]?.item;if(e)return{kind:`thinking`,item:{...e,text:n.node.items.map(e=>e.item.text).join(`
137
+
138
+ `)}}}),g=L(()=>{switch(n.node.kind){case`tool_result_error`:return{kind:`tool_result_error`,toolName:n.node.toolName,error:n.node.error};case`run_status`:return{kind:`run_status`,notice:n.node.notice};case`compaction`:return{kind:`compaction`,notice:n.node.notice};case`task_result`:return{kind:`task_result`,notice:n.node.notice};case`system_event`:return{kind:`system_event`,notice:n.node.notice};default:return}}),_=L(()=>{if(n.node.kind!==`message`)return`static`;let e=n.node.item;return e.role===`assistant`&&e.live?e.done?`complete`:`running`:`static`});function v(e){n.node.kind===`message`&&n.node.item.role===`assistant`&&n.onOpenMermaid?.(e,n.node.item.liveMessageId??n.node.item.id??n.node.key)}let y=new Set([`waiting`,`committed`,`running`]),b=L(()=>{switch(n.node.kind){case`tool`:return!!n.node.draft||!!n.node.liveOutput||y.has(n.node.toolCall?.status??``);case`message`:return!!n.node.item.live;case`thinking_group`:return n.node.items.some(e=>e.item.live&&!e.item.done);default:return!1}}),S=Y(!1),C=!1;W(()=>{let e=t(b),n=C&&!e;if(C=e,!n)return;B(S,!0);let r=setTimeout(()=>B(S,!1),1e3);return()=>clearTimeout(r)});let T=lZ(),E=()=>T?.currentProfile()??`standard`,O=Y(!1),A=Y(void 0),j;W(()=>{let e=n.entranceMotion;e&&e.token!==j&&(j=e.token,n.onClaimEntrance?.(e.token)&&(B(A,e,!0),B(O,!0)))});var N=g1();let P,ee;var te=q(N);{let e=L(()=>t(b)||t(S));u1(te,{get active(){return t(e)},get visible(){return u()},profile:E,children:(e,c)=>{var u=f(),y=R(u),b=e=>{var c=d1(),l=q(c);{let e=L(()=>n.node.toolCall?{kind:`tool`,anchorEntryId:n.node.anchorEntryId,toolCall:n.node.toolCall}:{kind:`tool_result_error`,toolName:n.node.draft?.block.toolName??`tool`,error:``}),c=L(()=>!n.node.toolCall);c$(l,{get target(){return t(e)},get menu(){return n.transcriptMenu},get disabled(){return t(c)},triggerClass:`block min-w-0 select-text`,children:(e,c)=>{{let c=L(()=>n.activeProject?.dir),l=L(()=>n.node.toolCall&&r().get(n.node.toolCall.id)?.status===`pending`?r().get(n.node.toolCall.id):void 0),u=L(()=>n.node.toolCall?i().get(n.node.toolCall.id):void 0),f=L(()=>n.node.toolCall?o().has(n.node.toolCall.id):!1),h=L(()=>n.node.toolCall?a().get(n.node.toolCall.id):void 0);DQ(e,{get draft(){return n.node.draft},get toolCall(){return n.node.toolCall},get liveOutput(){return n.node.liveOutput},get cwd(){return t(c)},get pendingApproval(){return t(l)},get pendingUserQuestion(){return t(u)},get hydrateBody(){return s()},get outcomeUnknown(){return t(f)},get pendingPlanReview(){return t(h)},get onOpenFile(){return n.onOpenFile},get onOpenTask(){return n.onOpenTask},get planReviewModels(){return d()},get planReviewModelKey(){return p()},get planReviewThinkingLevel(){return m()},get onAnswerUserQuestion(){return n.onAnswerUserQuestion},get onDismissUserQuestion(){return n.onDismissUserQuestion},get onGrantApproval(){return n.onGrantApproval},get onDenyApproval(){return n.onDenyApproval},get onAcceptPlanReview(){return n.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return n.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return n.onRejectPlanReview}})}},$$slots:{default:!0}})}x(c),k(e,c)},S=e=>{c$(e,{get target(){return t(g)},get menu(){return n.transcriptMenu},triggerClass:`block select-text`,children:(e,r)=>{var i=d1(),a=q(i),o=e=>{kQ(e,{get toolName(){return n.node.toolName},get error(){return n.node.error}})},s=e=>{{let r=L(()=>n.node.key===n.lastTimelineKey);Y$(e,{get notice(){return n.node.notice},get isLast(){return t(r)},get sending(){return n.sending},get onContinueFromFailure(){return n.onContinueFromFailure}})}},c=e=>{RQ(e,{get notice(){return n.node.notice},get onCancelCompaction(){return n.onCancelCompaction}})},u=e=>{w$(e,{get notice(){return n.node.notice},get onOpenTask(){return n.onOpenTask}})},d=e=>{P$(e,{get notice(){return n.node.notice},get onOpenFile(){return n.onOpenFile}})};l(a,e=>{n.node.kind===`tool_result_error`?e(o):n.node.kind===`run_status`?e(s,1):n.node.kind===`compaction`?e(c,2):n.node.kind===`task_result`?e(u,3):n.node.kind===`system_event`&&e(d,4)}),x(i),k(e,i)},$$slots:{default:!0}})},C=e=>{c$(e,{get target(){return t(h)},get menu(){return n.transcriptMenu},triggerClass:`select-text`,children:(e,r)=>{var i=f1(),a=q(i),o=q(a);{let e=L(()=>n.node.items.map(e=>e.item));$$(o,{get items(){return t(e)}})}x(a),x(i),k(e,i)},$$slots:{default:!0}})},T=e=>{_$(e,{get item(){return n.node.item},get prompt(){return n.queuedPrompt},get onForcePush(){return n.onForcePushQueuedPrompts},get onDiscard(){return n.onDiscardQueuedPrompt},get onMoveToComposer(){return n.onMoveQueuedPromptToComposer},get transcriptMenu(){return n.transcriptMenu}})},E=e=>{{let r=L(()=>({kind:`message`,item:n.node.item})),i=L(()=>`select-text ${n.node.item.role===`user`?`block`:``}`);c$(e,{get target(){return t(r)},get menu(){return n.transcriptMenu},get triggerClass(){return t(i)},children:(e,r)=>{var i=h1(),a=q(i),o=q(a),s=e=>{var r=p1(),i=q(r);{let e=L(()=>n.node.item.role!==`assistant`),r=L(()=>!(!n.node.item.live||n.node.item.done)),a=L(()=>n.node.item.role===`assistant`),o=L(()=>!(!n.node.item.live||n.node.item.done)),s=L(()=>n.activeProject?.dir),c=L(()=>n.node.item.role===`assistant`&&n.onOpenMermaid?v:void 0);wc(i,{get text(){return n.node.item.text},get trimCodeBlocks(){return t(e)},get streaming(){return t(r)},get reveal(){return t(a)},get caret(){return t(o)},get linkBasePath(){return t(s)},get onOpenFile(){return n.onOpenFile},get onOpenMermaid(){return t(c)},get onCopy(){return Cd}})}x(r),F(()=>J(r,`data-quotable`,n.node.item.role===`assistant`?``:void 0)),k(e,r)};l(o,e=>{n.node.item.text&&e(s)});var c=G(o,2),u=e=>{var t=m1(),r=z(t,!0);F(e=>w(r,e),[()=>n.node.item.errorMessage.trim()]),k(e,t)},d=L(()=>n.node.item.stopReason===`error`&&n.node.item.errorMessage?.trim());l(c,e=>{t(d)&&e(u)}),x(a),x(i),F(()=>{X(i,1,`transcript-entry ${n.node.item.role} ${n.node.item.live?`streaming`:``}`,`svelte-1scsvu5`),J(i,`data-state`,t(_))}),k(e,i)},$$slots:{default:!0}})}};l(y,e=>{n.node.kind===`tool`?e(b):t(g)?e(S,1):n.node.kind===`thinking_group`&&t(h)?e(C,2):n.node.kind===`message`&&n.node.item.role===`user`?e(T,3):n.node.kind===`message`&&e(E,4)}),k(e,u)},$$slots:{default:!0}})}x(N),F(()=>{P=X(N,1,`transcript-row-content svelte-1scsvu5`,null,P,{"transcript-enter-standard":t(O)&&t(A)?.profile===`standard`,"transcript-enter-compact":t(O)&&t(A)?.profile===`compact`,"transcript-enter-minimal":t(O)&&t(A)?.profile===`minimal`}),ee=I(N,``,ee,{"--transcript-enter-delay":t(A)?`${t(A).delayMs}ms`:void 0})}),M(`animationend`,N,e=>{e.target===e.currentTarget&&(B(O,!1),B(A,void 0))}),k(e,N),D()}var v1=O(`<span> </span>`),y1=O(`<!> <span class="truncate"> </span>`,1),b1=O(`<!> <span class="truncate font-mono"> </span>`,1),x1=O(`<span class="flex min-w-0 items-center gap-1 overflow-hidden"><!> <!></span>`),S1=O(`<div><div class="min-h-0 overflow-hidden"><div><span class="relative size-3.5 flex-none transition-[opacity,scale] duration-300 ease-out group-data-[kind=quiet]:scale-80 group-data-[kind=quiet]:opacity-50 group-data-[kind=waiting]:scale-80 group-data-[kind=waiting]:opacity-50" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" class="absolute inset-0 size-full text-primary"><defs><linearGradient x1="8" y1="1" x2="14" y2="12" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="currentColor" stop-opacity="0"></stop><stop offset="1" stop-color="currentColor"></stop></linearGradient></defs><g class="transition-opacity duration-200 group-data-[kind=done]:opacity-0 group-data-[kind=retry]:opacity-0 group-data-[kind=stopped]:opacity-0"><circle cx="8" cy="8" stroke-width="1.5" class="stroke-primary-subtle"></circle><g class="origin-center [transform-box:fill-box]"><circle cx="8" cy="8" stroke-width="1.75" stroke-linecap="round" transform="rotate(-90 8 8)"></circle></g></g><g class="opacity-0 transition-opacity duration-200 group-data-[kind=retry]:opacity-100"><circle cx="8" cy="8" stroke-width="2" class="stroke-warning-subtle"></circle><circle cx="8" cy="8" stroke-width="2" class="stroke-warning transition-[stroke-dashoffset] duration-300 ease-linear" transform="rotate(-90 8 8)"></circle></g></svg> <!> <!></span> <span class="inline-grid h-5 items-center overflow-hidden whitespace-nowrap transition-[width] duration-300 ease-out"><!></span> <!> <span> </span> <!></div></div></div>`);function C1(e,n){let r=d();c(n,!0);let i=K(n,`retrying`,3,!1),a=L(()=>(n.view.pending??[]).slice(0,4)),o=L(()=>Math.max(0,(n.view.pending?.length??0)-4)),s=6.5,u=2*Math.PI*s,p=u*.34,m=`run-activity-comet-${r}`,h=L(()=>Tc.current),_=L(()=>!t(h)&&n.view.spinnerRate>0&&(n.view.kind===`active`||n.view.kind===`quiet`||n.view.kind===`waiting`)),b=L(()=>u*(1-(n.view.countdownFraction??0))),O=L(()=>n.view.elapsedLabel?n.view.kind===`quiet`?`opacity-50`:`opacity-75`:`opacity-0`),A=Y(0);function j(e,t){let n=e.animate([{transform:`rotate(0turn)`},{transform:`rotate(1turn)`}],{duration:1300,iterations:1/0});function r({running:e,rate:t}){e?(n.playbackRate!==t&&n.updatePlaybackRate(t),n.playState!==`running`&&n.play()):n.pause()}return r(t),{update:r,destroy:()=>n.cancel()}}function M(e){B(A,e.scrollWidth,!0);let t=new ResizeObserver(()=>{B(A,e.scrollWidth,!0)});return t.observe(e),{destroy:()=>t.disconnect()}}function N(e,{direction:n}){return t(h)?{duration:150,css:e=>`opacity: ${e}`}:{duration:n===1?280:180,easing:td,css:(e,t)=>`opacity: ${e}; transform: translateY(${n*t*.7}em); filter: blur(${t*2}px)`}}var P=S1(),ee=q(P),te=q(ee),ne=q(te),re=q(ne),ie=q(re),ae=z(ie),V=G(ie),oe=q(V);J(oe,`r`,s);var se=G(oe),H=q(se);J(H,`r`,s),J(H,`stroke-dasharray`,`${p} ${u}`),x(se),E(se,(e,t)=>j?.(e,t),()=>({running:t(_),rate:n.view.spinnerRate})),x(V);var ce=G(V),U=q(ce);J(U,`r`,s);var le=G(U);J(le,`r`,s),J(le,`stroke-dasharray`,u),x(ce),x(re);var W=G(re,2);ic(W,{class:`absolute inset-0 size-full scale-50 -rotate-12 text-success opacity-0 transition-[opacity,scale,rotate] duration-300 ease-out group-data-[kind=done]:scale-100 group-data-[kind=done]:rotate-0 group-data-[kind=done]:opacity-100`,strokeWidth:2.5});var ue=G(W,2);Xs(ue,{class:`absolute inset-0 size-full scale-50 fill-current p-0.5 opacity-0 transition-[opacity,scale] duration-300 ease-out group-data-[kind=stopped]:scale-100 group-data-[kind=stopped]:opacity-100`}),x(ne);var de=G(ne,2);let fe;var pe=q(de);C(pe,()=>n.view.labelKey,e=>{var r=f(),i=R(r),a=e=>{var r=v1();let i;var a=z(r,!0);E(r,e=>M?.(e)),F(()=>{i=X(r,1,`col-start-1 row-start-1 w-max justify-self-start svelte-mmc2ed`,null,i,{shimmer:n.view.kind===`active`&&!t(h),"text-warning":n.view.tone===`warning`}),w(a,n.view.label)}),S(1,r,()=>N,()=>({direction:1})),S(2,r,()=>N,()=>({direction:-1})),k(e,r)};l(i,e=>{n.view.label&&e(a)}),k(e,r)}),x(de);var me=G(de,2),he=e=>{var r=x1(),i=q(r);v(i,17,()=>t(a),e=>e.kind+e.id,(e,r)=>{{let i=L(()=>t(r).kind===`agent`?`Open ${t(r).label}`:`Background command: ${t(r).label}`);be(e,{class:`max-w-48`,get title(){return t(i)},onclick:()=>n.onOpenPending?.(t(r)),children:(e,n)=>{var i=f(),a=R(i),o=e=>{var n=y1(),i=R(n);Bn(i,{tone:`info`,size:`xs`,pulse:!0});var a=G(i,2),o=z(a,!0);F(()=>w(o,t(r).label)),k(e,n)},s=e=>{var n=b1(),i=R(n);qc(i,{class:`size-3 flex-none text-muted-foreground`});var a=G(i,2),o=z(a,!0);F(()=>w(o,t(r).label)),k(e,n)};l(a,e=>{t(r).kind===`agent`?e(o):e(s,-1)}),k(e,i)},$$slots:{default:!0}})}});var s=G(i,2),c=e=>{be(e,{onclick:()=>{let e=n.view.pending?.[4];e&&n.onOpenPending?.(e)},children:(e,n)=>{y();var r=g();F(()=>w(r,`+${t(o)??``}`)),k(e,r)},$$slots:{default:!0}})};l(s,e=>{t(o)>0&&e(c)}),x(r),k(e,r)};l(me,e=>{n.view.kind===`waiting`&&e(he)});var ge=G(me,2),_e=z(ge,!0),ve=G(ge,2),Z=e=>{Mn(e,{get icon(){return zee},label:`Retry response`,get busy(){return i()},onclick:()=>{i()||n.onRetryResponse()}})};l(ve,e=>{n.view.retryEligible&&n.onRetryResponse&&e(Z)}),x(te),x(ee),x(P),F(()=>{X(P,1,T([`grid transition-[grid-template-rows] duration-300 ease-out`,n.view.open?`grid-rows-[1fr]`:`grid-rows-[0fr]`])),X(te,1,T([`group flex h-9 items-center px-3 gap-2 text-ui text-muted-foreground transition-[opacity,translate] duration-300 ease-out`,!n.view.open&&`translate-y-1 opacity-0`])),J(te,`data-kind`,n.view.kind),J(ae,`id`,m),J(H,`stroke`,`url(#${m})`),J(le,`stroke-dashoffset`,t(b)),fe=I(de,``,fe,{width:n.view.label?`${t(A)}px`:`0px`}),X(ge,1,T([`text-ui tabular-nums transition-opacity duration-300`,t(O)]),`svelte-mmc2ed`),w(_e,n.view.elapsedLabel??``)}),k(e,P),D()}var w1=2e4,T1=2200,E1=.4,D1={mounted:!1,open:!1,kind:`quiet`,tone:`neutral`,spinnerRate:1};function O1(e){if(!e)return`thinking`;if(e.kind===`message`)return e.item.role===`user`?`prompt`:e.item.live&&!e.item.done?`streaming`:e.item.role===`assistant`?`settling`:`thinking`;if(e.kind===`tool`){let t=e.toolCall?.status;return t?t===`waiting`?`awaiting_user`:t===`committed`||t===`running`?`tool`:`after_tools`:`tool`}return`thinking`}function k1(e,t,n=0){let r=e?`${n}:${e.runId}:${e.status}:${e.turns.length}:${e.retry?.attempt??0}`:`${n}`;return t?t.kind===`message`?`${r}|${t.key}:${t.item.text.length}:${+!!t.item.done}`:t.kind===`tool`?`${r}|${t.key}:${t.toolCall?.status??``}:${+!!t.draft?.block.done}`:`${r}|${t.key}`:r}function A1(e){let t=e?Date.parse(e):NaN;return Number.isFinite(t)?t:void 0}function j1(e){let t=e.lastRunOutcome;if(!t||e.outcomeSeenAtMs===void 0)return D1;let n=e.nowMs-e.outcomeSeenAtMs,r=A1(t.startedAt),i=A1(t.endedAt),a=r!==void 0&&i!==void 0?Math.max(0,i-r):0;if(!(t.outcome===`stopped`||t.outcome===`completed`&&a>=3e3))return n<300?{...D1,mounted:!0}:D1;if(n>=2500)return D1;let o=t.outcome===`stopped`;return{mounted:!0,open:n<T1,kind:o?`stopped`:`done`,labelKey:o?`stopped`:`done`,label:o?`Stopped after ${As(a)}`:`Done in ${As(a)}`,tone:o?`neutral`:`success`,spinnerRate:1}}function M1(e){let t=e.nowMs-(e.stoppedSeenAtMs??e.nowMs);return t>=2500?D1:{mounted:!0,open:t<T1,kind:`stopped`,labelKey:`stopped`,label:`Stopped`,tone:`neutral`,spinnerRate:1}}function N1(e,t){if(e.stopping)return{mounted:!0,open:!0,kind:`active`,labelKey:`stopping`,label:`Stopping…`,tone:`neutral`,spinnerRate:1};let n=A1(e.lastRunOutcome?.endedAt)??e.waitingSeenAtMs;return{mounted:!0,open:!0,kind:`waiting`,labelKey:`waiting`,label:`Waiting for`,tone:`neutral`,pending:t,elapsedLabel:n===void 0?void 0:As(e.nowMs-n),spinnerRate:E1}}function P1(e){let t=e.activeRun,n=e.compaction===`stopping`,r=A1(t?.startedAt)??e.runSeenAtMs,i=Math.max(0,e.nowMs-r);return{mounted:!0,open:!0,kind:`active`,labelKey:n?`compaction-stopping`:`compaction`,label:n?`Stopping compaction…`:`Compacting context…`,tone:`neutral`,spinnerRate:1,elapsedLabel:t&&t.status!==`interrupted`&&i>=3e3?As(i):void 0}}function F1(e){let t=e.activeRun,n=e.sending||!!(t&&t.status!==`interrupted`);if(e.compaction)return P1(e);if(!n)return e.pending?.length?N1(e,e.pending):e.stoppedSeenAtMs===void 0?j1(e):M1(e);if(t?.status===`interrupted`)return D1;let r=e.nowMs,i=A1(t?.startedAt)??e.runSeenAtMs,a=Math.max(0,r-i),o={mounted:!0,open:r-e.runSeenAtMs>=300,elapsedLabel:a>=3e3?As(a):void 0,spinnerRate:1},s=e=>({...o,kind:`quiet`,tone:`neutral`,spinnerRate:.8,...e?{label:e,labelKey:e}:{}});if(e.stopping||t?.status===`aborting`)return{...o,kind:`active`,labelKey:`stopping`,label:`Stopping…`,tone:`neutral`};if(t?.status===`retrying`&&t.retry){let e=t.retry,n=A1(e.retryAt),i=n===void 0?0:Math.max(0,n-r),a=Math.ceil(i/1e3),s=`(${e.attempt}/${e.maxRetries})`;return{...o,kind:`retry`,labelKey:`retry:${e.attempt}`,label:a>0?`Provider error · retrying in ${a}s ${s}`:`Retrying ${s}…`,tone:`warning`,countdownFraction:e.delayMs>0?Math.min(1,i/e.delayMs):0}}let c=O1(e.tail);if(t?.status===`waiting`||c===`awaiting_user`)return{...s(`Waiting for you`),elapsedLabel:void 0,spinnerRate:E1};if(c===`tool`)return s();let l=Math.max(0,r-e.lastChangeAtMs);if((c===`streaming`||c===`settling`)&&l<1500||l<300)return s();let u=l>=w1,d=u?`Still thinking…`:c===`after_tools`?`Reading results…`:!t||t.turns.length===0?`Starting…`:`Thinking…`;return{...o,kind:`active`,labelKey:d,label:d,tone:`neutral`,spinnerRate:u?.5:1,...u?{retryEligible:!0}:{}}}function I1(e,t,n){let r=e?.view;return r?.kind===`active`&&t.mounted&&t.kind===`quiet`&&!t.label&&n-e.activeSince<400?{view:{...t,kind:r.kind,label:r.label,labelKey:r.labelKey,tone:r.tone,spinnerRate:r.spinnerRate},activeSince:e.activeSince}:{view:t,activeSince:t.kind===`active`&&r?.kind!==`active`?n:e?.activeSince??n}}var L1=250;function R1(e){let n,r,i=Date.now(),a=e().lastRunOutcome?.runId,o,s,c,l=!1,u,d=L(()=>{let t=e(),d=Math.max(p.now,Date.now()),f=t.sending||!!(t.activeRun&&t.activeRun.status!==`interrupted`);f?n??=d:n=void 0;let m=k1(t.activeRun,t.tail,t.responseRevision);m!==r&&(r=m,i=d);let h=t.lastRunOutcome?.runId;return h!==a&&(a=h,o=h?d:void 0),!f&&t.pending?.length?c??=d:c=void 0,f?(l=!1,u=void 0):t.stopping&&t.pending?.length?l=!0:l&&!t.pending?.length&&(l=!1,u=d),s=I1(s,F1({...t,nowMs:d,runSeenAtMs:n??d,lastChangeAtMs:i,outcomeSeenAtMs:o,waitingSeenAtMs:c,stoppedSeenAtMs:u}),d),s.view}),f=L(()=>t(d).mounted),p=uH(()=>t(f)?L1:void 0);return{get view(){return t(d)}}}function z1(e){return e.kind===`message`&&e.item.role===`assistant`&&e.item.displayKind===`thinking`}function B1(e){let t=[];for(let n of e){if(!z1(n)){t.push(n);continue}let e=t.at(-1);e?.kind===`thinking_group`?e.items.push(n):t.push({kind:`thinking_group`,key:n.key,items:[n]})}return t}function V1(e){let t=`input:${e.id}`;return{kind:`timeline`,key:t,queuedPrompt:e,node:{kind:`message`,key:t,item:{inputId:e.id,role:`user`,text:e.text,createdAt:e.createdAt,optimistic:!0}}}}function H1(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}:duplicate:${n}`}function U1(e){return e.kind===`message`?!!e.item.live:e.kind===`thinking_group`?e.items.some(e=>!!e.item.live):e.kind===`task_result`||e.kind===`system_event`||e.kind===`run_status`||e.kind===`compaction`||e.kind===`tool`&&!!e.draft}function W1(e,t){if(e.kind===`activity`)return`activity`;let n=e.node;if(n.kind===`thinking_group`)return n.items.map(e=>`${e.item.text.length}:${e.item.live?`live`:`stored`}:${e.item.done?`done`:`open`}`).join(`|`);if(n.kind===`message`){let t=n.item;return[t.text.length,t.live?`live`:`stored`,t.done?`done`:`open`,t.optimistic?`optimistic`:`settled`,e.queuedPrompt?.presentation??`delivered`,t.stopReason??`ok`,t.errorMessage?.length??0].join(`:`)}if(n.kind===`tool`){if(!n.toolCall){let e=n.draft?.block,t=e?.progress,r=tG(e?.toolName??`tool`);return[`draft`,`arg:${r.argumentRegion}`,`placeholder:${r.resultPlaceholder?.variant??`none`}`,e?.argsText.length??0,e?.done?`done`:`open`,t?.lineCount??0,t?.generatedLineCount??0,t?.generatedPreview?.length??0,e?.argsText||t?.generatedPreview?`activity-visible`:`header-only`].join(`:`)}let e=n.toolCall.id,r=tG(n.toolCall.toolName),i=t.approvalsByToolCallId.get(e),a=t.questionsByToolCallId.get(e),o=t.reviewsByToolCallId.get(e);return[`tool`,`arg:${r.argumentRegion}`,`placeholder:${r.resultPlaceholder?.variant??`none`}`,n.toolCall.status,n.toolCall.updatedAt,n.liveOutput?.updatedAt??`no-output`,t.active?`body-hydrated`:`body-deferred`,n.toolCall.status===`failed`||n.toolCall.status===`denied`?`activity-error`:`activity-visible`,i?`${i.toolCallId}:${i.status}`:`no-approval`,a?`${a.toolCallId}:${a.status}`:`no-question`,o?`${o.toolCallId}:${o.status}`:`no-plan`,t.outcomeUnknownToolCallIds?.has(e)?`outcome-unknown`:`outcome-known`].join(`:`)}if(n.kind===`task_result`){let e=n.notice;return[`task`,e.event??`unknown`,e.status??`none`,e.exitCode??`no-exit`,e.signal??`no-signal`,e.taskName?.length??0,e.groupName?.length??0,e.commandPreview?.length??0,e.command?.length??0,e.output?.length??0,e.taskId?`actionable`:`static`].join(`:`)}if(n.kind===`system_event`)return[`system`,n.notice.kind,n.notice.summary?.length??0,n.notice.text.length].join(`:`);if(n.kind===`run_status`){let e=n.notice;return[`run`,e.state,e.attempt??`no-attempt`,e.maxRetries??`no-max`,e.retryable?`retryable`:`final`,e.errorMessage?.length??0].join(`:`)}if(n.kind===`compaction`){let e=n.notice;return[`compaction`,e.state,e.summaryPreview?.length??0,e.summary?.length??0,e.errorMessage?.length??0].join(`:`)}return n.key}function G1(e){return e.kind===`timeline`&&e.node.kind===`message`&&e.node.item.role===`user`}function K1(e){let t=[];return e.forEach((e,n)=>{G1(e)&&e.node.kind===`message`&&t.push({index:n,key:e.key,text:e.node.item.text})}),t}function q1(e,t){let n=e.findIndex(e=>e.kind===`timeline`&&e.node.kind===`message`&&(e.node.item.id===t||e.node.item.id?.startsWith(`${t}:`)));return n>=0?n:void 0}function J1(e){return{profile:`standard`,delaysMs:Array.from({length:e},()=>0)}}var Y1=class{allocateMotion;scope;seeded=!1;sequence=0;seen=new Set;pending=new Map;constructor(e=J1){this.allocateMotion=e}project(e,t){if(e!==this.scope&&this.reset(e),!this.seeded){for(let e of t)this.seen.add(e.key);return this.seeded=!0,new Map}let n=[];for(let e of t)this.seen.has(e.key)||(this.seen.add(e.key),e.eligible&&(this.sequence+=1,n.push({key:e.key,token:`${this.sequence}`})));if(n.length>0){let e=this.allocateMotion(n.length);n.forEach((t,n)=>{this.pending.set(t.key,{token:t.token,profile:e.profile,delayMs:e.delaysMs[n]??0})})}let r=new Set(t.map(e=>e.key));for(let e of this.pending.keys())r.has(e)||this.pending.delete(e);return new Map(t.flatMap(e=>{let t=this.pending.get(e.key);return t?[[e.key,t]]:[]}))}claim(e,t){return this.pending.get(e)?.token===t&&(this.pending.delete(e),!0)}reset(e){this.scope=e,this.seeded=!1,this.seen.clear(),this.pending.clear()}},X1={burstWindowMs:160,cooldownMs:240,compactThreshold:4,minimalThreshold:9,compactDelayStepMs:12,compactDelayCapMs:60},Z1={standard:0,compact:1,minimal:2};function Q1(e,t){return Z1[t]>Z1[e]?t:e}function $1(e){return e>=X1.minimalThreshold?`minimal`:e>=X1.compactThreshold?`compact`:`standard`}var e0=class{now;eventTimes=[];lastEventAt;activeProfile=`standard`;constructor(e=()=>performance.now()){this.now=e}allocateBatch(e){if(e<=0)return{profile:`standard`,delaysMs:[]};let t=this.now();this.prepareWindow(t);for(let n=0;n<e;n+=1)this.eventTimes.push(t);this.lastEventAt=t,this.activeProfile=Q1(this.activeProfile,$1(this.eventTimes.length));let n=Array.from({length:e},(e,t)=>this.activeProfile===`compact`?Math.min(t*X1.compactDelayStepMs,X1.compactDelayCapMs):0);return{profile:this.activeProfile,delaysMs:n}}claim(){return this.allocateBatch(1).profile}currentProfile(){return this.prepareWindow(this.now()),this.activeProfile}reset(){this.eventTimes.length=0,this.lastEventAt=void 0,this.activeProfile=`standard`}prepareWindow(e){this.lastEventAt!==void 0&&e-this.lastEventAt>=X1.cooldownMs&&this.reset();let t=e-X1.burstWindowMs;for(;this.eventTimes.length>0&&this.eventTimes[0]<t;)this.eventTimes.shift()}};function t0(e){return e.timelineLength>0||!!e.streamingText||e.sending||e.queuedPromptCount>0}var n0=O(`<div class="relative isolate h-full min-h-0 overflow-hidden" data-center-scroll-restoration="self"><!> <div aria-hidden="true"></div> <div aria-hidden="true"></div></div>`);function r0(e,n){c(n,!0);let r=K(n,`controller`,15),i=K(n,`atEnd`,15,!0),a=K(n,`messageMarks`,31,()=>U([])),o=K(n,`rowCount`,15),s=K(n,`paddingStart`,3,12),u=K(n,`paddingEnd`,3,0),d=K(n,`contentVisibility`,3,!1),p=K(n,`transcriptLabel`,3,`Conversation transcript`),m=K(n,`followBottom`,3,!0),h=K(n,`approvals`,19,()=>[]),g=K(n,`pendingUserQuestions`,19,()=>[]),_=K(n,`pendingPlanReviews`,19,()=>[]),v=K(n,`outcomeUnknownToolCallIds`,19,()=>new Set),y=K(n,`active`,3,!0),b=K(n,`planReviewModels`,19,()=>[]),S=K(n,`planReviewModelKey`,3,``),C=K(n,`planReviewThinkingLevel`,3,`off`),w=new e0;cZ(w);let T=new Y1(e=>w.allocateBatch(e)),E,O=0,A=L(()=>{let e=new Map,t=B1(n.timelinePrefix).map(t=>({kind:`timeline`,key:H1(t.key,e),node:t}));return O+=1,{revision:O,rows:t,seenKeys:e}}),j=L(()=>B1(n.timelineTail)),M=L(()=>{for(let e of[...n.timelineTail,...n.timelinePrefix].reverse())if(e.kind===`compaction`&&e.notice.state===`running`)return e.notice.stopping?`stopping`:`running`}),N=R1(()=>({sending:n.sending,activeRun:n.runActivity.activeRun,lastRunOutcome:n.runActivity.lastRunOutcome,stopping:n.runActivity.stopping,pending:n.runActivity.pending,responseRevision:n.runActivity.responseRevision,compaction:t(M),tail:n.timelineTail.at(-1)??n.timelinePrefix.at(-1)})),P=L(()=>N.view.mounted),I,ee=new yo,te=L(()=>{let e=new yo(t(A).seenKeys),r=[...t(A).rows],i=[...t(j)],a=r.at(-1),o=i[0];if(a?.node.kind===`thinking_group`&&o?.kind===`thinking_group`){r.pop(),i.shift();let t=e.get(a.node.key)??0;t<=1?e.delete(a.node.key):e.set(a.node.key,t-1),i.unshift({kind:`thinking_group`,key:a.node.key,items:[...a.node.items,...o.items]})}let s=i.map(t=>({kind:`timeline`,key:H1(t.key,e),node:t})),c=[...r,...s],l=n.heightCacheKey??`__default-transcript__`;l!==E&&(E=l,w.reset());let u=s.map(e=>`${e.key}:${+!!U1(e.node)}`).join(`|`),d=`${l}\0${t(A).revision}\0${u}`;d!==I&&(I=d,ee=T.project(l,c.map(e=>({key:e.key,eligible:U1(e.node)}))));let f=[...r,...s.map(e=>({...e,entranceMotion:ee.get(e.key)}))];for(let e of n.queuedPrompts)f.push(V1(e));return t(P)&&f.push({kind:`activity`,key:`__activity__`}),f});W(()=>{o()!==t(te).length&&o(t(te).length);let e=K1(t(te)),n=me(()=>a());e.length===n.length&&e.every((e,t)=>e.index===n[t].index&&e.key===n[t].key&&e.text===n[t].text)||a(e)});function ne(e){return q1(t(te),e)}let re=L(()=>new Map(h().map(e=>[e.toolCallId,e]))),z=L(()=>new Map(g().map(e=>[e.toolCallId,e]))),ie=L(()=>new Map(_().map(e=>[e.toolCallId,e]))),ae=L(()=>`${t(A).revision}\0${t(j).map(e=>e.key).join(`|`)}\0${t(P)?`activity`:``}\0${n.queuedPrompts.map(e=>e.id).join(`|`)}`);function V(e,t){return T.claim(e,t)}function oe(e){return W1(e,{approvalsByToolCallId:t(re),questionsByToolCallId:t(z),reviewsByToolCallId:t(ie),outcomeUnknownToolCallIds:v(),active:y()})}let se=L(()=>!t0({timelineLength:n.timelinePrefix.length+n.timelineTail.length,streamingText:n.streamingText,sending:n.sending,queuedPromptCount:n.queuedPrompts.length})),H=Y(!1),ce=Y(!1);function le(e){let t=Uc(e);B(H,t.top,!0),B(ce,t.bottom,!0)}W(()=>{let e=r()?.getViewportElement();if(!e)return;let t=()=>le(e);t(),e.addEventListener(`scroll`,t,{passive:!0});let n=new ResizeObserver(t);n.observe(e);let i=e.firstElementChild;return i instanceof HTMLElement&&n.observe(i),()=>{e.removeEventListener(`scroll`,t),n.disconnect()}});var ue={rowIndexOfEntry:ne},de=f(),fe=R(de),pe=e=>{{let r=L(()=>n.activeProject?.id),i=L(()=>n.activeProject?.dir);lH(e,{title:`The cursor is yours.`,message:`Bring the question. Nerve will bring the map, the tools, and the follow-through.`,get projectId(){return t(r)},get projectLabel(){return n.activeProjectLabel},get projectPath(){return t(i)},get review(){return n.projectReview}})}},he=e=>{var a=n0(),o=q(a);id(o,{get items(){return t(te)},getKey:e=>e.key,get structureVersion(){return t(ae)},get heightCacheKey(){return n.heightCacheKey},getMeasurementVersion:oe,get contentVisibility(){return d()},estimateSize:()=>120,overscan:10,anchor:`end`,get followOutput(){return m()},scrollEndThreshold:32,get paddingStart(){return s()},get paddingEnd(){return u()},gap:2,viewportTabIndex:0,get viewportAriaLabel(){return p()},viewportClass:`@container h-full px-[calc(var(--conversation-content-inset,1.5rem)/2)]`,get controller(){return r()},set controller(e){r(e)},get atEnd(){return i()},set atEnd(e){i(e)},row:(e,r)=>{let i=()=>(r?.()).item,a=()=>(r?.()).visible;var o=f(),s=R(o),c=e=>{_1(e,{get node(){return i().node},get visible(){return a()},get entranceMotion(){return i().entranceMotion},onClaimEntrance:e=>V(i().key,e),get sending(){return n.sending},get hydrateToolBodies(){return y()},get activeProject(){return n.activeProject},get approvalsByToolCallId(){return t(re)},get questionsByToolCallId(){return t(z)},get reviewsByToolCallId(){return t(ie)},get outcomeUnknownToolCallIds(){return v()},get lastTimelineKey(){return n.lastTimelineKey},get planReviewModels(){return b()},get planReviewModelKey(){return S()},get planReviewThinkingLevel(){return C()},get onOpenFile(){return n.onOpenFile},get onOpenTask(){return n.onOpenTask},get onOpenMermaid(){return n.onOpenMermaid},get onAnswerUserQuestion(){return n.onAnswerUserQuestion},get onDismissUserQuestion(){return n.onDismissUserQuestion},get onGrantApproval(){return n.onGrantApproval},get onDenyApproval(){return n.onDenyApproval},get onAcceptPlanReview(){return n.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return n.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return n.onRejectPlanReview},get onContinueFromFailure(){return n.onContinueFromFailure},get onCancelCompaction(){return n.onCancelCompaction},get transcriptMenu(){return n.transcriptMenu},get queuedPrompt(){return i().queuedPrompt},get onForcePushQueuedPrompts(){return n.onForcePushQueuedPrompts},get onDiscardQueuedPrompt(){return n.onDiscardQueuedPrompt},get onMoveQueuedPromptToComposer(){return n.onMoveQueuedPromptToComposer}})},u=e=>{C1(e,{get view(){return N.view},get onOpenPending(){return n.onOpenPendingWork},get onRetryResponse(){return n.onRetryResponse},get retrying(){return n.runActivity.retryingResponse}})};l(s,e=>{i().kind===`timeline`?e(c):i().kind===`activity`&&e(u,1)}),k(e,o)},$$slots:{row:!0}});var c=G(o,2);let h;var g=G(c,2);let _;x(a),F(()=>{h=X(c,1,`pointer-events-none absolute top-0 right-3 left-0 z-2 h-6 bg-linear-to-b from-background to-transparent opacity-0 transition-opacity duration-150`,null,h,{"opacity-100":t(H)}),_=X(g,1,`pointer-events-none absolute right-3 bottom-0 left-0 z-2 h-6 bg-linear-to-t from-background to-transparent opacity-0 transition-opacity duration-150`,null,_,{"opacity-100":t(ce)})}),k(e,a)};return l(fe,e=>{t(se)?e(pe):e(he,-1)}),k(e,de),D(ue)}var i0=O(`<button type="button" class="group pointer-events-auto absolute right-0 flex h-2 w-3 -translate-y-1/2 cursor-pointer items-center justify-end"><span></span></button>`),a0=O(`<div class="absolute right-5 w-max max-w-72 -translate-y-1/2 rounded-md border bg-popover px-2.5 py-1.5 text-ui text-popover-foreground shadow-overlay" role="tooltip"><span class="line-clamp-3 whitespace-pre-wrap break-words"> </span></div>`),o0=O(`<nav class="pointer-events-none absolute top-3 bottom-3 z-10 w-3" aria-label="Your messages"><!> <!></nav>`);function s0(e,n){c(n,!0);let r=Y(U({first:0,firstStart:0,last:-1})),i=Y(void 0);function a(e){let t=e.getBoundingClientRect(),n=1/0,r=1/0,i=-1;for(let a of e.querySelectorAll(`:scope > * > .virtual-scroller-row`)){let e=Number(a.dataset.index);if(!Number.isFinite(e))continue;let o=a.getBoundingClientRect();o.bottom<=t.top+4||o.top>=t.bottom-4||(n=Math.min(n,e),i=Math.max(i,e),o.top>=t.top-4&&(r=Math.min(r,e)))}return n===1/0?{first:0,firstStart:0,last:-1}:{first:n,firstStart:Math.min(r,i+1),last:i}}W(()=>{let e=n.viewport;if(!e)return;let t,i=()=>{t===void 0&&(t=requestAnimationFrame(()=>{t=void 0,B(r,a(e),!0)}))};i(),e.addEventListener(`scroll`,i,{passive:!0});let o=new ResizeObserver(i);return o.observe(e),()=>{t!==void 0&&cancelAnimationFrame(t),e.removeEventListener(`scroll`,i),o.disconnect()}});function o(e){let i=n.viewport?a(n.viewport):t(r),o=e<0?n.marks.findLast(e=>e.index<i.firstStart):n.marks.find(e=>e.index>i.first);return o?(n.onReveal(o.index),!0):!1}let s=e=>n.rowCount<=1?0:e/(n.rowCount-1)*100;var u={step:o},d=f(),p=R(d),m=e=>{var a=o0();I(a,``,{},{right:`calc(var(--conversation-scrollbar-lane, 0px) + 2px)`});var o=q(a);v(o,19,()=>n.marks,e=>e.key,(e,a,o)=>{let c=L(()=>t(a).index>=t(r).first&&t(a).index<=t(r).last);var l=i0();let u;var d=z(l);F((e,n)=>{J(l,`aria-label`,e),u=I(l,``,u,{top:n}),X(d,1,T([`h-0.5 rounded-full transition-[width,background-color] group-hover:w-3 group-hover:bg-primary group-hover:opacity-100 group-focus-visible:w-3 group-focus-visible:bg-primary group-focus-visible:opacity-100`,t(c)?`w-3 bg-primary`:`w-2 bg-muted-foreground opacity-40`]))},[()=>`Message ${t(o)+1} of ${n.marks.length}: ${t(a).text.slice(0,80)}`,()=>`${s(t(a).index)}%`]),M(`pointerenter`,l,()=>B(i,t(a),!0)),M(`pointerleave`,l,()=>B(i,void 0)),M(`focus`,l,()=>B(i,t(a),!0)),M(`blur`,l,()=>B(i,void 0)),h(`click`,l,()=>n.onReveal(t(a).index)),k(e,l)});var c=G(o,2),u=e=>{var n=a0();let r;var a=q(n),o=z(a,!0);x(n),F(e=>{r=I(n,``,r,{top:e}),w(o,t(i).text)},[()=>`${s(t(i).index)}%`]),k(e,n)};l(c,e=>{t(i)&&e(u)}),x(a),k(e,a)};return l(p,e=>{n.marks.length>1&&e(m)}),k(e,d),D(u)}ue([`click`]);var c0=6,l0=8;function u0(e,t,n){let r=n.width/2,i=t.right-t.left,a=(e.left+e.right)/2-t.left,o=i<n.width+16?i/2:Math.min(Math.max(a,r+l0),i-r-l0),s=e.top-t.top-c0-n.height;if(s>=l0)return{x:o,y:s,side:`above`};let c=e.bottom-t.top+c0,l=t.bottom-t.top-n.height-l0;return{x:o,y:Math.max(l0,Math.min(c,l)),side:`below`}}var d0=O(`<!>Quote`,1),f0=O(`<div role="toolbar" aria-label="Selection actions" tabindex="-1" class="absolute z-20 flex -translate-x-1/2 items-center gap-0.5 rounded-md border bg-popover p-0.5 text-popover-foreground shadow-overlay animate-in fade-in-0 zoom-in-95 duration-150"><!> <!></div>`);function p0(e,n){c(n,!0);let r=K(n,`enabled`,3,!0),i=Y(void 0),a=Y(void 0),o=!1,s;function u(){s!==void 0&&clearTimeout(s),s=void 0}function d(){u(),B(i,void 0)}function p(e){if(!n.container||!e)return!1;let t=e instanceof Element?e:e.parentElement,r=t?.closest(`[data-quotable]`);return!!(r&&n.container.contains(r)&&!t?.closest(`input, textarea, select, [contenteditable], .cm-editor`))}function m(){let e=window.getSelection();if(e&&!e.isCollapsed&&e.rangeCount!==0&&p(e.anchorNode)&&p(e.focusNode))return e.toString().trim()?e:void 0}function g(){s=void 0;let e=m();if(!r()||!n.container||!e)return d();let o=e.getRangeAt(e.rangeCount-1),c=n.container.getBoundingClientRect(),l=o.getBoundingClientRect();if(l.top<c.top){let e=o.getClientRects();l=e[e.length-1]??l}if(l.bottom<c.top||l.top>c.bottom)return d();B(i,u0(l,c,{width:t(a)?.offsetWidth||132,height:t(a)?.offsetHeight||32}),!0)}function _(){u(),s=setTimeout(g,220)}function v(e){t(a)?.contains(e.target)||(d(),o=e.button===0&&p(e.target))}function b(){o&&(o=!1,_())}function S(e){if(e.key===`Escape`)return d();(e.shiftKey||(e.ctrlKey||e.metaKey)&&e.key===`a`)&&_()}function C(){t(i)&&!m()&&d()}function w(e){t(i)&&n.container?.contains(e.target)&&d()}function T(e){let t=m();if(!e||!t)return d();let n=a$(t)||i$(t.toString());t.removeAllRanges(),d(),n&&e(n)}W(()=>{r()||d()}),W(()=>{if(n.container)return document.addEventListener(`pointerdown`,v,!0),document.addEventListener(`pointerup`,b,!0),document.addEventListener(`keyup`,S,!0),document.addEventListener(`selectionchange`,C),document.addEventListener(`scroll`,w,!0),window.addEventListener(`resize`,d),window.addEventListener(`blur`,d),()=>{document.removeEventListener(`pointerdown`,v,!0),document.removeEventListener(`pointerup`,b,!0),document.removeEventListener(`keyup`,S,!0),document.removeEventListener(`selectionchange`,C),document.removeEventListener(`scroll`,w,!0),window.removeEventListener(`resize`,d),window.removeEventListener(`blur`,d),d()}}),pe(u);var E=f(),O=R(E),A=e=>{var r=f0();let o;var s=q(r);Q(s,{variant:`ghost`,size:`sm`,title:`Quote in composer`,onclick:()=>T(n.actions.quote),children:(e,t)=>{var n=d0();vT(R(n),{"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}});var c=G(s,2),u=e=>{Q(e,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Quote and dictate`,title:`Quote and dictate`,onclick:()=>T(n.actions.quoteAndDictate),children:(e,t)=>{Et(e,{"aria-hidden":`true`})},$$slots:{default:!0}})};l(c,e=>{n.actions.quoteAndDictate&&e(u)}),x(r),te(r,e=>B(a,e),()=>t(a)),F(()=>o=I(r,``,o,{left:`${t(i).x??``}px`,top:`${t(i).y??``}px`})),h(`pointerdown`,r,e=>e.preventDefault()),k(e,r)};l(O,e=>{t(i)&&e(A)}),k(e,E),D()}ue([`pointerdown`]);function m0({atEnd:e,scrollDelta:t,userScrollAwayIntent:n,scrollbarPointerActive:r,epsilon:i=1}){return e?!1:r?!0:n&&t<-i}var h0=30,g0=6,_0=2400,v0=32,y0=100,b0=350,x0=120,S0=1,C0=120,w0=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),T0=new Set([`ArrowUp`,`Home`,`PageUp`]);function E0(e){return Math.max(e.scrollHeight-e.clientHeight-e.scrollTop,0)}function D0(e,t=v0){return E0(e)<=t}function O0(e,t){if(t.scrollHeight<=t.clientHeight)return!1;let n=t.offsetWidth-t.clientWidth;if(n<=0)return!1;let r=t.getBoundingClientRect();return e.clientX>=r.right-n&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom}function k0(e){let n=Y(void 0),r=Y(0),i=Y(void 0),a=Y(!0),o=Y(!0),s=Y(!0),c=Y(!1),l,u=Object.create(null),d,f=!1,p=!1,m,h=!1,g,_=!1,v;function y(){g!==void 0&&(clearTimeout(g),g=void 0)}function b(){v!==void 0&&(clearTimeout(v),v=void 0)}function x(){_=!0,b(),v=setTimeout(()=>{_=!1,v=void 0},x0)}function S(){B(s,!1),m!==void 0&&(cancelAnimationFrame(m),m=void 0)}function C(e){x(),t(i)?.scrollToEnd(e)}function w(e){let n=t(i);if(e){if(D0(e,v0)){B(o,!0);return}h&&E0(e)>y0&&(B(o,!1),S())}else n?.isAtEnd(v0)?B(o,!0):h&&(n?.getDistanceFromEnd()??0)>y0&&(B(o,!1),S())}function T(){B(o,!1),S()}function E(e){_||(h=e?.scrollAwayIntent??!!e?.disableFollowImmediately,e?.disableFollowImmediately&&T(),y(),g=setTimeout(()=>{h=!1,g=void 0},b0),requestAnimationFrame(()=>w(e?.viewport)))}function D(){let e=t(i);e&&(B(o,!0),e.getDistanceFromEnd()<=_0?C({behavior:`smooth`}):O())}function O(){S(),B(s,!0),B(o,!0);let e=0,n=()=>{m=void 0,e+=1;let r=t(i);r&&C({behavior:`instant`}),!r?.isAtEnd(v0)&&e<h0?m=requestAnimationFrame(n):B(s,!1)};n()}function k(e){let n=t(i);if(!n)return;S(),B(o,!1),B(s,!0);let r=0,a=()=>{m=void 0,r+=1,x(),n.scrollToIndex(e,{align:`start`}),r<g0?m=requestAnimationFrame(a):B(s,!1)};a()}function A(e){S(),B(s,!0),B(o,!1);let n=0,r=()=>{m=void 0,n+=1;let a=t(i)?.getViewportElement();a&&(x(),a.scrollTop=e,Math.abs(a.scrollTop-e)<=2)?B(s,!1):n<h0?m=requestAnimationFrame(r):B(s,!1)};r()}return W(()=>{if(t(a)||t(s)){B(c,!1);return}let e=setTimeout(()=>B(c,!0),C0);return()=>clearTimeout(e)}),W(()=>{if(!t(a))return;let e=t(i)?.getViewportElement();(!e||D0(e,v0))&&B(o,!0)}),W(()=>{let n=e.active?.()??!0,r=e.conversationId(),i=e.contentReady(),a=n&&!f;if(f=n,r!==l&&(l=r,d=r?u[r]:void 0,p=!1,B(o,!0),S(),B(s,!0)),!n)S();else if(e.conversationOpen()&&r&&i){if(p)a&&t(o)&&ne().then(O);else{p=!0;let e=d;d=void 0,e&&!e.atEnd?ne().then(()=>A(e.top)):ne().then(O)}}}),W(()=>{let i=t(n),a=e.active?.()??!0;if(!i||typeof ResizeObserver>`u`)return;let o=()=>{B(r,a?i.offsetHeight:0,!0)};o();let s=new ResizeObserver(o);return s.observe(i),()=>s.disconnect()}),W(()=>{let e=t(i)?.getViewportElement();if(!e)return;let n=e.scrollTop,r=!1,a=()=>{let t=e.scrollTop,i=t-n;if(n=t,l&&p&&(u[l]={top:t,atEnd:D0(e,v0)}),_)return;let a=D0(e,v0);a?B(o,!0):m0({atEnd:a,scrollDelta:i,userScrollAwayIntent:h,scrollbarPointerActive:r,epsilon:S0})&&T()},s=t=>{r=O0(t,e),r&&E({disableFollowImmediately:!0,viewport:e})},c=()=>{r&&E({disableFollowImmediately:!0,viewport:e})},d=()=>{r&&D0(e,v0)&&B(o,!0),r=!1},f=t=>{let n=t.deltaY<0;E({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})},m=()=>{E({disableFollowImmediately:!0,viewport:e})},g=t=>{if(!w0.has(t.key))return;let n=T0.has(t.key)||t.key===` `&&t.shiftKey;E({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})};return e.addEventListener(`scroll`,a,{passive:!0}),e.addEventListener(`wheel`,f,{passive:!0}),e.addEventListener(`touchmove`,m,{passive:!0}),e.addEventListener(`pointerdown`,s,{passive:!0}),e.addEventListener(`pointermove`,c,{passive:!0}),e.addEventListener(`pointerup`,d,{passive:!0}),e.addEventListener(`pointerleave`,d,{passive:!0}),e.addEventListener(`keydown`,g),()=>{e.removeEventListener(`scroll`,a),e.removeEventListener(`wheel`,f),e.removeEventListener(`touchmove`,m),e.removeEventListener(`pointerdown`,s),e.removeEventListener(`pointermove`,c),e.removeEventListener(`pointerup`,d),e.removeEventListener(`pointerleave`,d),e.removeEventListener(`keydown`,g)}}),W(()=>()=>{S(),y(),b(),h=!1,_=!1}),{get composerWrapEl(){return t(n)},set composerWrapEl(e){B(n,e,!0)},get composerHeight(){return t(r)},get controller(){return t(i)},set controller(e){B(i,e,!0)},get atEnd(){return t(a)},set atEnd(e){B(a,e,!0)},get followBottom(){return t(o)},get showLatest(){return t(c)},scrollToEnd:C,jumpToBottom:D,revealIndex:k}}var A0=O(`<div><span class="text-foreground"> </span> <!></div>`);function j0(e,t){let n=K(t,`tone`,3,`muted`);var r=A0(),i=q(r),a=z(i,!0),o=G(i,2),s=e=>{var n=g();F(()=>w(n,t.message)),k(e,n)};l(o,e=>{t.message&&e(s)}),x(r),F(()=>{X(r,1,`flex-none border-b px-4 py-2 text-ui text-muted-foreground ${n()===`warning`?`bg-warning-subtle`:`bg-muted`}`),w(a,t.title)}),k(e,r)}var M0=O(`<p class="max-w-md text-ui text-muted-foreground"> </p>`),N0=O(`<div class="flex min-h-0 flex-col items-center justify-center gap-2 p-4 text-center"><!> <p class="text-ui text-muted-foreground"> </p> <!></div>`);function P0(e,t){let n=K(t,`title`,3,`No conversation selected.`);var r=N0(),i=q(r);rie(i,{class:`size-8 text-muted-foreground`});var a=G(i,2),o=z(a,!0),s=G(a,2),c=e=>{var n=M0(),r=z(n,!0);F(()=>w(r,t.message)),k(e,n)};l(s,e=>{t.message&&e(c)}),x(r),F(()=>w(o,n())),k(e,r)}var F0=O(`<div class="absolute inset-0 z-20 flex min-h-0 flex-col bg-background"><!></div>`),I0=O(`<div class="relative flex h-full min-h-0 flex-col"><!> <div class="min-h-0 flex-1"><!></div> <!> <!> <!> <!></div>`),L0=O(`<p class="text-ui text-muted-foreground"> </p>`),R0=O(`<div class="flex min-w-0 items-start justify-between gap-2"><div class="min-w-0 flex-1"><!></div> <!></div>`);function z0(e,r){c(r,!0);let i=e=>{var i=f(),a=R(i),o=e=>{var i=f(),a=R(i);n(a,()=>r.activity,()=>t(A),()=>()=>v.jumpToBottom()),k(e,i)},s=e=>{Q(e,{variant:`outline`,size:`icon`,ariaLabel:`Scroll to latest`,title:`Scroll to latest`,onclick:()=>v.jumpToBottom(),children:(e,t)=>{Ys(e,{class:`size-4`,"aria-hidden":`true`})},$$slots:{default:!0}})};l(a,e=>{r.activity?e(o):t(A)&&e(s,1)}),k(e,i)},a=io(),o=a?KV:UV,s=L(()=>r.model.active??!0),u=L(()=>r.model.timeline.tail.at(-1)?.key??r.model.timeline.prefix.at(-1)?.key),d=L(()=>r.model.approvals?.filter(e=>e.status===`pending`)??[]),p=L(()=>t(d)[0]?.toolCallId),m=L(()=>t(d).length),h=L(()=>r.model.pendingUserQuestions?.filter(e=>e.status===`pending`).map(e=>e.toolCallId)??[]),g=L(()=>r.model.pendingPlanReviews?.filter(e=>e.status===`pending`).map(e=>e.toolCallId)??[]),_=L(()=>t0({timelineLength:r.model.timeline.prefix.length+r.model.timeline.tail.length,streamingText:r.model.streamingText,sending:r.model.sending,queuedPromptCount:r.model.queuedPrompts.length})),v=k0({active:()=>t(s),conversationOpen:()=>r.model.open,conversationId:()=>r.model.conversationId,contentReady:()=>t(_)}),y=Y(void 0),b=Y(void 0),S=Y(void 0),C=Y(U([])),T=Y(0),E=L(()=>r.model.transcriptView===`history`&&!!r.history),O=me(()=>r.model.messageStep?.token??0);W(()=>{let e=r.model.messageStep;e&&e.token!==O&&(O=e.token,t(s)&&!t(E)&&t(S)?.step(e.direction))});let A=L(()=>t(s)&&v.showLatest&&!t(E)),j={reveal(e){r.actions.onToggleHistory?.(),ne().then(()=>{let n=t(b)?.rowIndexOfEntry(e);n!==void 0&&v.revealIndex(n)})}},M;function N(){M!==void 0&&clearTimeout(M),M=void 0}pe(N),W(()=>{t(h).length===0&&N()});function I(){N(),v.jumpToBottom();let e=0,n=()=>{M=void 0;let r=t(h),i=v.composerWrapEl?.parentElement;if(r.length===0||!i)return;let a=[...i.querySelectorAll(`[data-tool-call-id]`)].filter(e=>r.includes(e.dataset.toolCallId??``)).at(-1)?.querySelector(`.cm-content, textarea, input, button`);a?a.focus():++e<8&&(M=setTimeout(n,80))};M=setTimeout(n,80)}o(e,{get open(){return r.model.open},get composerWrapRef(){return v.composerWrapEl},set composerWrapRef(e){v.composerWrapEl=e},announcer:e=>{ZV(e,{get active(){return t(s)},get sending(){return r.model.sending},get pendingApprovalId(){return t(p)},get pendingApprovalCount(){return t(m)},get pendingQuestionIds(){return t(h)},get pendingPlanReviewIds(){return t(g)}})},transcript:e=>{var i=I0(),o=q(i),c=e=>{j0(e,P(()=>r.model.banner))};l(o,e=>{r.model.banner&&e(c)});var d=G(o,2),p=q(d);{let e=L(()=>r.marker?52:12),n=L(()=>r.model.transcriptHeightCacheKey??r.model.conversationId),i=L(()=>t(s)?v.followBottom:!1);te(r0(p,{get paddingStart(){return t(e)},paddingEnd:18,get heightCacheKey(){return t(n)},get transcriptLabel(){return r.model.transcriptLabel},get timelinePrefix(){return r.model.timeline.prefix},get timelineTail(){return r.model.timeline.tail},get streamingText(){return r.model.streamingText},get sending(){return r.model.sending},get runActivity(){return r.model.runActivity},get queuedPrompts(){return r.model.queuedPrompts},get followBottom(){return t(i)},get activeProject(){return r.model.activeProject},get activeProjectLabel(){return r.model.activeProjectLabel},get projectReview(){return r.model.projectReview},get approvals(){return r.model.approvals},get pendingUserQuestions(){return r.model.pendingUserQuestions},get pendingPlanReviews(){return r.model.pendingPlanReviews},get outcomeUnknownToolCallIds(){return r.model.outcomeUnknownToolCallIds},get active(){return t(s)},get planReviewModels(){return r.model.planReviewModels},get planReviewModelKey(){return r.model.planReviewModelKey},get planReviewThinkingLevel(){return r.model.planReviewThinkingLevel},get lastTimelineKey(){return t(u)},get onOpenFile(){return r.actions.onOpenFile},get onOpenTask(){return r.actions.onOpenTask},get onOpenMermaid(){return r.actions.onOpenMermaid},get onAnswerUserQuestion(){return r.actions.onAnswerUserQuestion},get onDismissUserQuestion(){return r.actions.onDismissUserQuestion},get onGrantApproval(){return r.actions.onGrantApproval},get onDenyApproval(){return r.actions.onDenyApproval},get onAcceptPlanReview(){return r.actions.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return r.actions.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return r.actions.onRejectPlanReview},get onContinueFromFailure(){return r.actions.onContinueFromFailure},get onCancelCompaction(){return r.actions.onCancelCompaction},get onRetryResponse(){return r.actions.onRetryResponse},get onForcePushQueuedPrompts(){return r.actions.onForcePushQueuedPrompts},get onDiscardQueuedPrompt(){return r.actions.onDiscardQueuedPrompt},get onMoveQueuedPromptToComposer(){return r.actions.onMoveQueuedPromptToComposer},get onOpenPendingWork(){return r.actions.onOpenPendingWork},get transcriptMenu(){return r.menus.transcriptMenu},get controller(){return v.controller},set controller(e){v.controller=e},get atEnd(){return v.atEnd},set atEnd(e){v.atEnd=e},get messageMarks(){return t(C)},set messageMarks(e){B(C,e,!0)},get rowCount(){return t(T)},set rowCount(e){B(T,e,!0)}}),e=>B(b,e,!0),()=>t(b))}x(d);var m=G(d,2),h=e=>{var t=f(),i=R(t);n(i,()=>r.marker),k(e,t)};l(m,e=>{r.marker&&!t(E)&&e(h)});var g=G(m,2),_=e=>{{let n=L(()=>v.controller?.getViewportElement());te(s0(e,{get marks(){return t(C)},get rowCount(){return t(T)},get viewport(){return t(n)},onReveal:e=>v.revealIndex(e)}),e=>B(S,e,!0),()=>t(S))}};l(g,e=>{a||e(_)});var w=G(g,2),D=e=>{{let n=L(()=>t(s)&&!t(E));p0(e,{get container(){return t(y)},get actions(){return r.menus.selectionActions},get enabled(){return t(n)}})}};l(w,e=>{r.menus.selectionActions&&e(D)});var O=G(w,2),A=e=>{var t=F0(),i=q(t);n(i,()=>r.history,()=>j),x(t),k(e,t)};l(O,e=>{t(E)&&r.history&&e(A)}),x(i),te(i,e=>B(y,e),()=>t(y)),k(e,i)},composer:e=>{var a=f(),o=R(a),s=e=>{var t=f(),a=R(t);n(a,()=>r.composer,()=>i),k(e,t)},c=e=>{{let n=e=>{var t=R0(),n=q(t),a=q(n),o=e=>{var t=L0(),n=z(t,!0);F(()=>w(n,r.model.composer.hint)),k(e,t)};l(a,e=>{r.model.composer.hint&&e(o)}),x(n);var s=G(n,2);i(s),x(t),k(e,t)},a=L(()=>({...r.actions,onGoToQuestion:r.actions.onGoToQuestion??I}));BV(e,{get model(){return r.model.composer},get actions(){return t(a)},header:n,$$slots:{header:!0}})}};l(o,e=>{r.composer?e(s):e(c,-1)}),k(e,a)},empty:e=>{var t=f(),i=R(t),a=e=>{var t=f(),i=R(t);n(i,()=>r.emptyExtension),k(e,t)},o=e=>{P0(e,{get title(){return r.model.emptyTitle},get message(){return r.model.emptyMessage}})};l(i,e=>{r.emptyExtension?e(a):e(o,-1)}),k(e,t)},$$slots:{announcer:!0,transcript:!0,composer:!0,empty:!0}}),D()}var B0=[{profile:`coding`,label:`Coding`,icon:Fw,tagline:`For everyday work: features, fixes and refactors.`},{profile:`planning`,label:`Planning`,icon:_ie,tagline:`For bigger changes you want to think through before building.`},{profile:`lead`,label:`Lead`,icon:Zw,tagline:`For large efforts a team of agents can split and verify.`},{profile:`forge`,label:`Forge`,icon:Wre,tagline:`For making Nerve fit your workflow: skills, extensions, profiles.`}];function V0(e,t){return e-t}function H0(e){return[...e.turns].sort((e,t)=>V0(e.ordinal,t.ordinal))}function U0(e){return[...e.messages].sort((e,t)=>V0(e.messageOrdinal,t.messageOrdinal))}function W0(e){return[...e.blocks].sort((e,t)=>V0(e.contentIndex,t.contentIndex))}function G0(e){if(!e)return``;let t=[];for(let n of H0(e))for(let e of U0(n))for(let n of W0(e))n.kind===`text`&&n.text&&t.push(n.text);return t.join(`
139
+ `)}function K0(e,t,n){return`live:${e}:${t}:${n}`}function q0(e,t){return`tool-slot:${e}:${t}`}function J0(e){return Array.from(new Set([e.sourceToolCallId,e.providerToolCallId].filter(e=>!!e)))}function Y0(e){return e.liveMessageId&&typeof e.contentIndex==`number`?q0(e.liveMessageId,e.contentIndex):void 0}function X0(e){return e.status===`committed`||e.status===`waiting`||e.status===`running`}function Z0(e,t){let n=e.createdAt.localeCompare(t.createdAt);return n===0?e.id.localeCompare(t.id):n}function Q0(e){return Y0(e)??`tool:${e.id}`}function $0(e){let t=new Set(e.initiallyConsumedIds),n=new Set,r=new Set,i=(t,n)=>{let r=t.runId??(n?e.activeRunId:void 0);return r?[...new Set([...J0(t),...n?[n]:[]])].map(e=>`${r}:${t.toolName}:${e}`):[]},a=(e,a)=>{t.add(e.id);let o=Y0(e);o&&n.add(o);for(let t of i(e,a))r.add(t)};for(let t of e.initiallyConsumedIds){let n=e.toolCallsById.get(t);n&&a(n)}return{consume:a,isConsumed(e){if(t.has(e.id))return!0;let a=Y0(e);return a&&n.has(a)?!0:i(e).some(e=>r.has(e))}}}function e2(e,t,n){return!n||e.runId!==n.runId?!1:!!t||X0(e)}function t2(e,t){let n=new Map;if(!e)return n;for(let r of t.toolCallsByRunId.get(e.runId)??[]){if(!r.liveMessageId||typeof r.contentIndex!=`number`)continue;let e=n.get(r.liveMessageId)??[];e.push(r),n.set(r.liveMessageId,e)}return n}function n2(e,t,n){let r=[],i=$0({initiallyConsumedIds:n.consumedToolCallIds,toolCallsById:n.toolCallsById,activeRunId:e?.runId}),a=t=>e?.toolOutputsByToolCallId[t],o=t2(e,n);if(e)for(let t of H0(e))for(let s of U0(t))r2(r,e,t,s,{context:n,anchoredToolCalls:o.get(s.liveMessageId)??[],isToolConsumed:i.isConsumed,consumeTool:i.consume,liveOutputFor:a});e?.retry&&e.status===`retrying`&&!n.statusRunIds.has(e.runId)&&r.push({kind:`run_status`,key:`run-status:${e.runId}`,notice:{conversationId:e.conversationId,agentId:e.agentId,runId:e.runId,state:`retrying`,...e.retry}}),e?.status===`interrupted`&&e.recovery&&!n.statusRunIds.has(e.runId)&&r.push({kind:`run_status`,key:`run-status:${e.runId}`,notice:{conversationId:e.conversationId,agentId:e.agentId,runId:e.runId,state:`interrupted`,errorMessage:e.recovery.errorMessage,...e.recovery.failureCategory?{failureCategory:e.recovery.failureCategory}:{},...e.recovery.httpStatus?{httpStatus:e.recovery.httpStatus}:{},retryable:e.recovery.continuable}}),t?.compaction&&([t.compaction.id,t.compaction.entryId,t.compaction.runId?`run:${t.compaction.runId}`:void 0].filter(e=>!!e).some(e=>n.completedCompactionKeys.has(e))||r.push({kind:`compaction`,key:t.compaction.id,notice:t.compaction}));let s=new Map,c=e=>{e&&!s.has(e.id)&&s.set(e.id,e)};for(let e of n.liveCandidateToolCalls)c(e);if(e){for(let t of n.toolCallsByRunId.get(e.runId)??[])c(t);for(let t of Object.keys(e.toolOutputsByToolCallId))c(n.toolCallsById.get(t))}for(let t of[...s.values()].sort(Z0)){let n=a(t.id);!i.isConsumed(t)&&e2(t,n,e)&&(r.push({kind:`tool`,key:Q0(t),toolCall:t,liveOutput:n}),i.consume(t))}return r}function r2(e,t,n,r,i){let a=W0(r),o=a.map((e,t)=>({contentIndex:e.contentIndex,order:0,type:`block`,blockIndex:t})),s=new Set(a.filter(e=>e.kind===`tool_call_draft`).map(e=>e.contentIndex));for(let e of i.anchoredToolCalls)s.has(e.contentIndex)||o.push({contentIndex:e.contentIndex,order:1,type:`tool`,toolCall:e});o.sort((e,t)=>e.contentIndex===t.contentIndex?e.order-t.order:e.contentIndex-t.contentIndex);for(let s of o){if(s.type===`tool`){if(i.isToolConsumed(s.toolCall))continue;e.push({kind:`tool`,key:Q0(s.toolCall),toolCall:s.toolCall,liveOutput:i.liveOutputFor(s.toolCall.id)}),i.consumeTool(s.toolCall);continue}let o=a[s.blockIndex];if(o.kind!==`tool_call_draft`){if(!o.text&&!(o.kind===`thinking`&&o.redacted))continue;e.push({kind:`message`,key:K0(r.liveMessageId,o.kind,o.contentIndex),item:{id:K0(r.liveMessageId,o.kind,o.contentIndex),runId:t.runId,role:`assistant`,displayKind:o.kind===`thinking`?`thinking`:`message`,text:o.text,createdAt:r.startedAt,contentIndex:o.contentIndex,turnId:n.turnId,messageOrdinal:r.messageOrdinal,live:!o.done,done:o.done,redacted:o.redacted}});continue}let c=q0(r.liveMessageId,o.contentIndex),l=i.context.toolCallsBySlot.get(c)??(o.providerToolCallId?i.context.toolCallsByProviderId.get(o.providerToolCallId):void 0);l&&i.isToolConsumed(l)||(e.push({kind:`tool`,key:c,draft:{key:c,runId:t.runId,conversationId:t.conversationId,turnId:n.turnId,liveMessageId:r.liveMessageId,messageOrdinal:r.messageOrdinal,startedAt:r.startedAt,block:o},toolCall:l,liveOutput:l?i.liveOutputFor(l.id):void 0}),l&&i.consumeTool(l,o.providerToolCallId))}}var i2=/^\[Tool call:[\s\S]*\]$/;function a2(e){return e.role===`assistant`&&e.displayKind!==`thinking`&&i2.test(e.text.trim())}function o2(e,t){return e.entryId??t}function s2(e,t){return e===t||e.startsWith(`${t}:`)}function c2(e,t){return!!(e.id&&[...t].some(t=>s2(e.id,t)))}function l2(e,t){return e.role===`assistant`&&e.stopReason===`error`&&!!(e.runId&&t.has(e.runId))}function u2(e,t){let n=new Map;for(let r of e){if(r.role!==`assistant`||r.stopReason!==`error`||!r.runId||t.has(r.runId))continue;let e=H$(r.errorMessage??r.text),i=n.get(r.runId)?.createdAt;n.set(r.runId,{runId:r.runId,state:`failed`,errorMessage:e.message,failureCategory:e.category,httpStatus:e.httpStatus,retryable:!1,createdAt:i??r.createdAt})}return n}function d2(e,t,n={}){let r=[],i=t.filter(e=>n.includeHiddenToolCalls||!e.hidden).sort(Z0),a=new Map(i.map(e=>[e.id,e])),o=new Map,s=new Map,c=new Map,l=[];for(let e of i){for(let t of J0(e))o.has(t)||o.set(t,e);let t=Y0(e);if(t&&!c.has(t)&&c.set(t,e),e.runId){let t=s.get(e.runId)??[];t.push(e),s.set(e.runId,t)}X0(e)&&l.push(e)}let u=new Set,d=new Set,f=new Set;for(let t of e)t.runStatus?.failedEntryId&&d.add(t.runStatus.failedEntryId),t.runStatus?.runId&&f.add(t.runStatus.runId);let p=e=>c2(e,d)||l2(e,f),m=u2(e,f),h=new Set;e.forEach((e,t)=>{if(a2(e)){let t=e.liveMessageId?i.filter(t=>t.liveMessageId===e.liveMessageId&&!u.has(t.id)).sort((e,t)=>(e.contentIndex??0)-(t.contentIndex??0)||e.id.localeCompare(t.id)):[];for(let n of t)r.push({kind:`tool`,key:Q0(n),toolCall:n,anchorEntryId:e.id}),u.add(n.id);return}if(e.compaction){r.push({kind:`compaction`,key:e.compaction.entryId??e.id??`compaction-${t}`,notice:e.compaction});return}if(e.runStatus){r.push({kind:`run_status`,key:o2(e.runStatus,e.id??`run-status-${t}`),notice:e.runStatus});return}if(e.taskResult){r.push({kind:`task_result`,key:e.taskResult.entryId??e.id??`task-result-${t}`,notice:e.taskResult});return}if(p(e))return;let n=e.runId?m.get(e.runId):void 0;if(n&&e.role===`assistant`&&e.stopReason===`error`&&(h.has(e.runId)||(r.push({kind:`run_status`,key:`legacy-run-status:${e.runId}`,notice:n}),h.add(e.runId)),!e.text.trim()))return;let s=e.toolRecordId?a.get(e.toolRecordId):e.toolCallId?o.get(e.toolCallId):void 0;if(s){if(e.role===`assistant`&&e.text.trim()&&r.push({kind:`message`,key:e.id??`msg-${t}`,item:e}),u.has(s.id))return;r.push({kind:`tool`,key:Q0(s),toolCall:s,anchorEntryId:e.id}),u.add(s.id)}else e.role===`system`&&e.isToolError&&e.toolName?r.push({kind:`tool_result_error`,key:e.id??`tool-result-error-${t}`,runId:e.runId,toolName:e.toolName,error:e.text}):e.systemEvent?r.push({kind:`system_event`,key:e.systemEvent.entryId,notice:e.systemEvent}):r.push({kind:`message`,key:e.role===`user`&&e.inputId?`input:${e.inputId}`:e.id??`msg-${t}`,item:n?{...e,stopReason:void 0,errorMessage:void 0,legacyFailedAttempt:!0}:e})}),f2(r);let g=new Set(r.flatMap(e=>e.kind===`run_status`&&e.notice.runId&&!e.key.startsWith(`legacy-run-status:`)?[e.notice.runId]:[])),_=new Set(r.flatMap(e=>e.kind===`message`&&e.item.role===`assistant`&&(e.item.stopReason===`error`||e.item.legacyFailedAttempt)&&e.item.runId?[e.item.runId]:[])),v=new Set(r.flatMap(e=>{if(e.kind!==`compaction`)return[];let t=[e.notice.id,e.notice.entryId].filter(e=>!!e);return e.notice.runId&&t.push(`run:${e.notice.runId}`),t})),y=n.includeUnanchoredTerminalToolCalls===!0&&l.length===0?i.filter(e=>!u.has(e.id)&&p2(e)):[];if(y.length>0){for(let e of y)r.push({kind:`tool`,key:Q0(e),toolCall:e}),u.add(e.id);h2(r)}return{items:r,context:{orderedToolCalls:i,toolCallsById:a,toolCallsByProviderId:o,toolCallsByRunId:s,toolCallsBySlot:c,liveCandidateToolCalls:l,consumedToolCallIds:u,statusRunIds:g,failedAssistantRunIds:_,completedCompactionKeys:v}}}function f2(e){for(let t of[...e]){if(t.kind!==`run_status`||t.notice.retryable!==!0||!t.notice.runId)continue;let n=e.indexOf(t),r=n;for(let i=n+1;i<e.length;i+=1){let n=e[i];n?.kind===`task_result`&&n.notice.runId===t.notice.runId&&(r=i)}r!==n&&(e.splice(n,1),e.splice(r,0,t))}}function p2(e){return i_(e.status)}function m2(e){if(e.kind===`message`)return e.item.createdAt;if(e.kind===`tool`)return e.toolCall?.createdAt;if(e.kind===`compaction`||e.kind===`run_status`||e.kind===`task_result`||e.kind===`system_event`)return e.notice.createdAt}function h2(e){let t=e.map((e,t)=>({item:e,index:t,createdAt:m2(e)}));t.sort((e,t)=>e.createdAt&&t.createdAt&&e.createdAt!==t.createdAt?e.createdAt.localeCompare(t.createdAt):e.index-t.index),e.splice(0,e.length,...t.map(e=>e.item))}function g2(e){if(e.kind===`message`)return e.item.id;if(e.kind===`tool`)return e.anchorEntryId;if(e.kind===`tool_result_error`)return e.key;if(e.kind===`system_event`)return e.notice.entryId}function _2(e,t,n,r){let i=new Set;t?.retry?.failedEntryId&&i.add(t.retry.failedEntryId),n?.compaction?.state===`running`&&n.compaction.failedEntryId&&i.add(n.compaction.failedEntryId);let a=t&&(!r||r.failedAssistantRunIds.has(t.runId))?t.runId:void 0,o=t?.toolOutputsByToolCallId,s=!!(o&&Object.keys(o).length),c=!!(t&&e.some(e=>e.key===`legacy-run-status:${t.runId}`));if(i.size===0&&!a&&!s&&!c)return e;let l=[...i],u=[],d=!1;for(let n of e){let e=g2(n);if(e&&l.some(t=>s2(e,t)))d=!0;else if(t&&n.kind===`run_status`&&n.key===`legacy-run-status:${t.runId}`)d=!0;else if(a&&n.kind===`message`&&n.item.role===`assistant`&&(n.item.stopReason===`error`||n.item.legacyFailedAttempt)&&n.item.runId===a)d=!0;else{if(t&&n.kind===`tool`&&n.toolCall?.runId===t.runId){let e=o?.[n.toolCall.id];if(e&&n.liveOutput!==e){u.push({...n,liveOutput:e}),d=!0;continue}}u.push(n)}}return d?u:e}function v2(e){return typeof e==`string`&&e.length>0?e:void 0}function y2(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function b2(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.text==`string`?t.text:``,r=t.redacted===!0;return n.length>0||r?[{text:n,redacted:r}]:[]}):[]}function x2(e){return e.details&&typeof e.details==`object`?e.details:void 0}function S2(e){let t=x2(e),n=t?.details&&typeof t.details==`object`?t.details:void 0,r=n?.toolCall&&typeof n.toolCall==`object`?n.toolCall:void 0;return{toolCallId:v2(t?.toolCallId),toolRecordId:y2(t?.toolRecordId)??y2(r?.id),toolName:v2(t?.toolName),isToolError:t?.isError===!0}}function C2(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function w2(e){return e===`manual`||e===`threshold`||e===`overflow`?e:void 0}function T2(e){if(e.kind!==`compaction`)return;let t=x2(e),n=t?.policy&&typeof t.policy==`object`?t.policy:void 0,r=C2(t?.tokensAfter),i=C2(t?.freedTokens)??(typeof e.tokensBefore==`number`&&typeof r==`number`?Math.max(0,e.tokensBefore-r):void 0);return{id:e.id,state:`completed`,reason:w2(t?.reason),entryId:e.id,conversationId:e.conversationId,agentId:v2(e.agentId),runId:v2(e.runId),text:e.text,summary:e.summary??e.text,tokensBefore:e.tokensBefore,tokensAfter:r,freedTokens:i,contextWindow:C2(n?.contextWindow),thresholdTokens:C2(n?.thresholdTokens),triggerReserveTokens:C2(n?.triggerReserveTokens),keepRecentTokens:C2(n?.keepRecentTokens),firstKeptEntryId:v2(e.firstKeptEntryId),details:e.details,createdAt:e.createdAt,completedAt:e.createdAt}}function E2(e,t){if(!e||e.status===`completed`)return;let n=t.headEventId??null;if(e.status!==`queued`&&e.status!==`running`&&e.status!==`stopping`&&!(n===e.headEventId||t.pathEventIds!==void 0&&(e.headEventId===null||t.pathEventIds.has(e.headEventId))))return;let r=e.summaryPreview;return{id:e.id,state:e.status===`stopping`?`running`:e.status,reason:e.reason,conversationId:t.conversationId,...e.status===`stopping`?{stopping:!0}:{},...e.eventId?{entryId:e.eventId}:{},...e.errorMessage?{errorMessage:e.errorMessage}:{},summaryPreview:r,previewSequence:e.revision,generatedChars:r.length,generatedLines:r?r.split(`
140
+ `).length:0,createdAt:e.startedAt,...e.endedAt?{completedAt:e.endedAt}:{}}}function D2(e){if(e.kind!==`run_status`)return;let t=x2(e);if(t?.type!==`agent_run_retry_status`)return;let n=t.state;if(n===`retrying`||n===`retry_exhausted`||n===`failed`||n===`interrupted`)return{entryId:e.id,conversationId:e.conversationId,agentId:v2(e.agentId),runId:v2(t.runId)??e.runId,state:n,failedEntryId:v2(t.failedEntryId),attempt:typeof t.attempt==`number`?t.attempt:void 0,maxRetries:typeof t.maxRetries==`number`?t.maxRetries:void 0,delayMs:typeof t.delayMs==`number`?t.delayMs:void 0,retryAt:v2(t.retryAt),errorMessage:v2(t.errorMessage),failureCategory:U$(t.failureCategory),httpStatus:C2(t.httpStatus),retryable:t.retryable===!0,createdAt:e.createdAt}}function O2(e){if(e.kind!==`task_result`)return;let t=x2(e);if(t?.type===`task_result`)return{entryId:e.id,conversationId:e.conversationId,agentId:v2(e.agentId),runId:v2(e.runId),taskId:v2(t.taskId),taskName:v2(t.taskName),groupId:v2(t.groupId),groupName:v2(t.groupName),event:v2(t.event),status:v2(t.status),exitCode:C2(t.exitCode),signal:v2(t.signal),commandPreview:v2(t.commandPreview),command:v2(t.command),output:v2(t.output),nextCursor:C2(t.nextCursor),createdAt:e.createdAt}}function k2(e){let t=T2(e);if(t)return[{id:e.id,runId:e.runId,role:`system`,kind:e.kind,displayKind:`message`,text:e.summary??e.text,createdAt:e.createdAt,compaction:t}];let n=D2(e);if(n)return[{id:e.id,role:`system`,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,runStatus:n}];let r=O2(e);if(r)return[{id:e.id,runId:e.runId,role:`system`,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,taskResult:r}];let i=x2(e),a=S2(e),o=i?.stopReason===`error`||i?.stopReason===`aborted`?i.stopReason:void 0,s=v2(i?.errorMessage),c=[],l=b2(i?.thinkingBlocks);for(let[t,n]of l.entries())c.push({id:`${e.id}:thinking:${t}`,runId:e.runId,turnId:e.turnId,liveMessageId:e.liveMessageId,messageOrdinal:e.messageOrdinal,role:`assistant`,kind:e.kind,displayKind:`thinking`,text:n.text,redacted:n.redacted,createdAt:e.createdAt,stopReason:o,errorMessage:s});return c.push({id:e.id,inputId:e.inputId,runId:e.runId,turnId:e.turnId,liveMessageId:e.liveMessageId,messageOrdinal:e.messageOrdinal,role:e.role,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,usage:e.usage,stopReason:o,errorMessage:s,...a,...e.role===`system`?{systemEvent:{entryId:e.id,kind:e.kind,text:e.text,summary:e.summary,fromEntryId:e.fromEntryId,details:e.details,createdAt:e.createdAt}}:{}}),c}function A2(e){return e.flatMap(k2)}var j2=class{entries;optimisticMessages;toolCalls;committed;project(e){return this.committed&&this.entries===e.entries&&this.optimisticMessages===e.optimisticMessages&&this.toolCalls===e.toolCalls||(this.entries=e.entries,this.optimisticMessages=e.optimisticMessages,this.toolCalls=e.toolCalls,this.committed=d2([...A2(e.entries),...e.optimisticMessages],e.toolCalls,{includeUnanchoredTerminalToolCalls:!1})),this.committed}};function M2(e,t,n){let r={running:0,needsYou:0,background:0};for(let i of t)if(e.includes(i.projectId))switch(n[i.id]?.indicator){case`running`:r.running+=1;break;case`needs-user`:case`error`:r.needsYou+=1;break;case`awaiting-async`:r.background+=1}return r}function N2(e){return e.running+e.needsYou+e.background>0}function P2(e){let t=[];return e.running&&t.push(`${e.running} running`),e.needsYou&&t.push(`${e.needsYou} needs you`),e.background&&t.push(`${e.background} in background`),t.join(` · `)}function F2(e,t,n){let r=[],i=[];for(let a of e){let e=M2(a.projectIds,t,n);N2(e)?r.push({item:a,counts:e}):i.push(a)}return r.sort((e,t)=>Number(t.counts.needsYou>0)-Number(e.counts.needsYou>0)),{active:r,recent:i}}var I2=O(`<p class="px-6 py-12 text-center text-ui text-muted-foreground">No projects match your search.</p>`),L2=O(`<div class="px-3 pt-2"><!></div> <!> <!> <!>`,1);function R2(e,n){c(n,!0);let r=(e,n=m,r=m)=>{{let i=e=>{pr(e,{get projectId(){return n().project.id},get name(){return n().project.name},class:`size-8`})},a=L(()=>n().key===Ds.selectedProjectKey);Xa(e,{get title(){return n().project.name},get detail(){return r()},get selected(){return t(a)},onclick:()=>p(n()),leading:i,$$slots:{leading:!0}})}},i=Y(``),a=L(()=>Xr.projectSwitcherItems),o=L(()=>Xr.status?.storage.userHome),s=L(()=>t(a).filter(e=>Uo(t(i),e.label,e.project.name,e.project.directory))),u=L(()=>F2(t(s),Xr.conversations,Xr.conversationActivityById));function d(e){let n=Date.parse(e.sortAt);return[Or(e.project.directory,t(o)),Number.isNaN(n)?``:js(e.sortAt)].filter(Boolean).join(` · `)}function p(e){kO({kind:`project`,projectId:e.project.id})}function h(){Ds.projectPickerPath=void 0,Ds.projectPickerOpen=!0}JO(e,{children:(e,n)=>{{let n=e=>{QO(e,{})},o=L(()=>`${t(a).length} known`);$a(e,{title:`Projects`,get subtitle(){return t(o)},actions:n,children:(e,n)=>{var a=L2(),o=R(a),s=q(o);ks(s,{placeholder:`Search projects`,ariaLabel:`Search projects`,get value(){return t(i)},set value(e){B(i,e,!0)}}),x(o);var c=G(o,2),p=e=>{{let n=L(()=>`${t(u).active.length}`);Ha(e,{title:`Active`,get meta(){return t(n)},children:(e,n)=>{var i=f(),a=R(i);v(a,17,()=>t(u).active,e=>e.item.key,(e,n)=>{{let i=L(()=>P2(t(n).counts));r(e,()=>t(n).item,()=>t(i))}}),k(e,i)},$$slots:{default:!0}})}};l(c,e=>{t(u).active.length&&e(p)});var m=G(c,2),g=e=>{{let n=L(()=>t(u).active.length?`Recent`:`Projects`);Ha(e,{get title(){return t(n)},children:(e,n)=>{var i=f(),a=R(i);v(a,17,()=>t(u).recent,e=>e.key,(e,n)=>{{let i=L(()=>d(t(n)));r(e,()=>t(n),()=>t(i))}}),k(e,i)},$$slots:{default:!0}})}},_=e=>{var t=I2();k(e,t)};l(m,e=>{t(u).recent.length?e(g):t(u).active.length||e(_,1)});var y=G(m,2);Ha(y,{children:(e,t)=>{Xa(e,{title:`Open folder`,detail:`Choose a folder to open as a project`,get icon(){return tc},onclick:h})},$$slots:{default:!0}}),k(e,a)},$$slots:{actions:!0,default:!0}})}},$$slots:{default:!0}}),D()}var z2=O(`<div class="lazy-shell-pending svelte-14yeeqi" aria-busy="true"><!></div>`);function B2(e){var t=z2(),n=q(t);dn(n,{class:`size-5`}),x(t),k(e,t)}var V2={files:()=>Os(()=>import(`./MobileFilesHost-DvQOpQFH.js`),__vite__mapDeps([18,19,2,20,21,22,23,7,24,25,26,27,6,28,29,30,31,32,33,34,35,9,1,10,11,12,13,36,37,38,39,40,41,0,3,4,5,8,14,15,16,17,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74])),notes:()=>Os(()=>import(`./MobileNotesHost-Lg699XCv.js`),__vite__mapDeps([75,19,2,21,22,23,7,24,25,26,27,6,28,29,30,31,32,33,34,35,9,1,10,11,12,13,36,37,38,39,40,41,0,3,4,5,8,14,15,16,17,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,61,64,60,20,62,63,65,66,67,76,68,69,70])),note:()=>Os(()=>import(`./MobileNoteEditorHost-DSuZ0mU5.js`),__vite__mapDeps([77,19,2,60,31,23,7,30,25,26,27,43,61,20,62,63,24,44,45,46,42,47,64,65,66,67,78,41,29,79,76,4,5,6,11,12,16])),settings:()=>Os(()=>import(`./MobileSettingsHost-Bv1P74ck.js`),__vite__mapDeps([80,19,2,81,82,6,83,5,11,7,12,84,85,86,79,23,30,21,22,24,25,26,27,28,29,31,32,33,34,35,9,1,10,13,36,37,38,39,40,41,0,3,4,8,14,15,16,17,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,20,62,63,64,65,66,67,87,88,89,90,68,69,70,91,92,74,93,94,95,96,97,98,99,100])),"settings-page":()=>Os(()=>import(`./MobileSettingsPageHost-DudFqhZC.js`),__vite__mapDeps([101,19,2,102,22,23,7,24,25,26,27,6,83,5,11,12,87,0,1,3,4,8,9,10,13,14,15,16,17,47,88,89,90,103,45,32,43,36,37,50,51,104,105,106,28,29,30,31,79,34,35,38,39,40,107,21,33,41,42,44,46,48,49,52,53,54,55,56,57,58,59,62,63,96,69,70,108,109,110,78,61,111,112,81,20,64,113,74,114,115,116,117,84,118,119,85,120,95,121,122,97,123,124,125,126,127,128,129,130,131,82,86,132,133,134,72,73,60,65,66,67,135,68,100])),launches:()=>Os(()=>import(`./MobileLaunchesHost-0VtdW0x8.js`),__vite__mapDeps([136,19,2,60,31,23,7,30,25,26,27,43,61,20,62,63,24,44,45,46,42,47,64,65,66,67,132,78,133,21,22,6,28,29,32,33,34,35,9,1,10,11,12,13,36,37,38,39,40,41,0,3,4,5,8,14,15,16,17,48,49,50,51,52,53,54,55,56,57,58,59,125,137,79,138,139,110,90,111,74,122,129,140,131,141,142,104,105,106,143,103,144,145,146,147,121,98,148,149,68,69,70,150])),launch:()=>Os(()=>import(`./MobileLaunchOutputHost-pFJgIV1_.js`),__vite__mapDeps([151,19,2,55,60,31,23,7,30,25,26,27,43,61,20,62,63,24,44,45,46,42,47,64,65,66,67,132,145,57,139,79,34,35,9,1,6,10,11,12,13,36,37,38,39,40,110,33,32,90,41,111,4,5,17,53,74,137,122,129,140,131,141,142,104,105,106,143,138,103,22,50,51,144,28,29,21,0,3,8,14,15,16,48,49,52,54,56,58,59,78,133,146,147,125,121,98,150]))},H2=O(`<span class="flex size-8 flex-none items-center justify-center rounded-md bg-card text-muted-foreground"><!></span>`),U2=O(`<!> <!>`,1),W2=O(`<p class="px-6 py-10 text-center text-ui text-muted-foreground">Loading branches…</p>`),G2=O(`<!> <!> <!>`,1),K2=O(`<div class="grid gap-2 px-3 pt-2"><!> <!></div> <!> <!> <!>`,1),q2=O(`<!> <form class="grid gap-3 px-4 pb-4"><div class="grid gap-1.5"><!> <!> <p class="text-ui text-muted-foreground"> </p></div> <div class="flex justify-end gap-2"><!> <!></div></form>`,1),J2=O(`<!> <!> <!> <!>`,1);function Y2(e,n){c(n,!0);let r=(e,r=m)=>{var i=f(),o=R(i);v(o,17,r,e=>e.branch.name,(e,r)=>{let i=L(()=>t(a).switchingBranch===t(r).branch.name),o=L(()=>n.model.operations.deletingBranch===t(r).branch.name);{let n=e=>{var n=H2(),a=q(n),s=e=>{dn(e,{class:`size-4`})},c=e=>{Wn(e,{size:17,strokeWidth:1.9,class:`text-success`})},u=e=>{nc(e,{size:17,strokeWidth:1.9})};l(a,e=>{t(i)||t(o)?e(s):t(r).branch.current?e(c,1):e(u,-1)}),x(n),k(e,n)},a=L(()=>I(t(r))),s=L(()=>P(t(r)));Xa(e,{get title(){return t(r).branch.name},get detail(){return t(a)},get meta(){return t(r).updatedLabel},get menuItems(){return t(s)},onclick:()=>{t(u)&&!t(r).branch.current&&B(S,t(r).branch,!0)},leading:n,$$slots:{leading:!0}})}}),k(e,i)},i=L(()=>n.model.selectedRepository),a=L(()=>n.model.repoBranchState(t(i))),o=L(()=>t(a).repoSummary??n.model.repositorySummary),s=L(()=>t(o)?.baseBranch),u=L(()=>n.model.capabilities.branches.enabled),d=Y(``),p=Y(!1),h=L(()=>HC(t(a).branches,t(d),t(s),t(a).prHeads)),_=L(()=>t(h).local),b=L(()=>t(p)?t(h).remote:[]);W(()=>{let e=t(i);e&&me(()=>{n.actions.refreshBranches(e),n.actions.loadPullRequestBadges(e)})});let S=Y(void 0),C=Y(void 0),T=Y(!1),E=Y(``),O=Y(!1),A=L(()=>BC(t(E)));function j(){n.actions.refreshBranches(t(i)),n.actions.loadPullRequestBadges(t(i))}function N(e){UO(`pr`,()=>n.actions.openPullRequest(t(i),e))}function P(e){let{branch:n,pullRequest:r}=e,i=[{label:`Switch`,icon:nc,disabled:!t(u)||n.current,onSelect:()=>B(S,n,!0)}];return r&&i.push({label:`Open pull request #${r.number}`,icon:ac,onSelect:()=>N(r.number)}),i.push({label:`Delete`,icon:kn,destructive:!0,disabled:!t(u)||!VC(n,t(s)),onSelect:()=>B(C,n,!0)}),i}function I(e){let n=[];return e.branch.current&&n.push(`Current`),!e.branch.remote&&e.branch.name===t(s)&&n.push(`Base`),e.pullRequest&&n.push(`PR #${e.pullRequest.number}${e.pullRequest.isDraft?` (draft)`:``}`),n.join(` · `)||void 0}async function ee(e){if(e.preventDefault(),t(A)&&!t(O)){B(O,!0);try{await n.actions.createBranch(t(i),t(E).trim())!==!1&&(B(T,!1),B(E,``),j())}finally{B(O,!1)}}}var te=J2(),ne=R(te);{let e=e=>{var n=U2(),r=R(n);Q(r,{variant:`ghost`,size:`icon`,ariaLabel:`Refresh branches`,get disabled(){return t(a).loadingBranches},onclick:j,children:(e,t)=>{cr(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}});var i=G(r,2);{let e=L(()=>!t(u));Q(i,{variant:`ghost`,size:`icon`,ariaLabel:`New branch`,get disabled(){return t(e)},onclick:()=>B(T,!0),children:(e,t)=>{On(e,{size:18,strokeWidth:1.9})},$$slots:{default:!0}})}k(e,n)},n=L(()=>t(o)?`${t(o).name} · ${t(o).currentBranch??`detached`}`:void 0);$a(ne,{title:`Branches`,get subtitle(){return t(n)},get onBack(){return jO},backLabel:`Back`,actions:e,children:(e,n)=>{var i=K2(),o=R(i),s=q(o);ks(s,{placeholder:`Search branches`,ariaLabel:`Search branches`,get value(){return t(d)},set value(e){B(d,e,!0)}}),sD(G(s,2),{label:`Show remote branches`,class:`px-1`,get checked(){return t(p)},set checked(e){B(p,e,!0)}}),x(o);var c=G(o,2),u=e=>{{let n=L(()=>`${t(_).length}`);Ha(e,{title:`Local`,get meta(){return t(n)},children:(e,n)=>{r(e,()=>t(_))},$$slots:{default:!0}})}};l(c,e=>{t(_).length&&e(u)});var m=G(c,2),h=e=>{{let n=L(()=>`${t(b).length}`);Ha(e,{title:`Remote`,get meta(){return t(n)},children:(e,n)=>{r(e,()=>t(b))},$$slots:{default:!0}})}};l(m,e=>{t(b).length&&e(h)});var v=G(m,2),S=e=>{var n=f(),r=R(n),i=e=>{var t=W2();k(e,t)},o=e=>{var n=f(),r=R(n);H(r,()=>as,(e,n)=>{n(e,{class:`px-6 py-10`,children:(e,n)=>{var r=f(),i=R(r);H(i,()=>ts,(e,n)=>{n(e,{children:(e,n)=>{var r=G2(),i=R(r);H(i,()=>rs,(e,t)=>{t(e,{class:`text-muted-foreground`,children:(e,t)=>{nc(e,{size:28,strokeWidth:1.6})},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>os,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var n=g(`No branches`);k(e,n)},$$slots:{default:!0}})});var o=G(a,2);H(o,()=>is,(e,n)=>{n(e,{class:`text-ui`,children:(e,n)=>{y();var r=g();F(e=>w(r,e),[()=>t(d).trim()?`No branch matches this search.`:`This repository has no branches to show.`]),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,n)};l(r,e=>{t(a).loadingBranches?e(i):e(o,-1)}),k(e,n)};l(v,e=>{!t(_).length&&!t(b).length&&e(S)}),k(e,i)},$$slots:{actions:!0,default:!0}})}var re=G(ne,2);{let e=L(()=>!!t(S)),r=L(()=>`Switch to ${t(S)?.name??``}?`),a=L(()=>`Checks out ${t(S)?.name??``} in ${t(o)?.name??`this repository`}.`);jn(re,{get open(){return t(e)},get title(){return t(r)},get description(){return t(a)},confirmLabel:`Switch`,onConfirm:()=>{let e=t(S);B(S,void 0),e&&Promise.resolve(n.actions.switchBranch(t(i),e)).then(j)},onOpenChange:e=>{e||B(S,void 0)}})}var ie=G(re,2);{let e=L(()=>!!t(C)),r=L(()=>`${t(C)?.name??``} will be deleted locally. Unmerged commits on it may be lost.`);jn(ie,{get open(){return t(e)},destructive:!0,title:`Delete branch?`,get description(){return t(r)},confirmLabel:`Delete`,onConfirm:()=>{let e=t(C);B(C,void 0),e&&Promise.resolve(n.actions.deleteBranch(t(i),e)).then(j)},onOpenChange:e=>{e||B(C,void 0)}})}var ae=G(ie,2);H(ae,()=>qa,(e,n)=>{n(e,{get open(){return t(T)},onOpenChange:e=>{t(O)||B(T,e,!0)},children:(e,n)=>{var r=f(),i=R(r);H(i,()=>Cf,(e,n)=>{n(e,{side:`bottom`,class:`rounded-t-lg pb-[max(0.5rem,var(--safe-bottom))]`,children:(e,n)=>{var r=q2(),i=R(r);H(i,()=>Ua,(e,t)=>{t(e,{class:`px-4 pb-1 pt-3 text-ui font-medium`,children:(e,t)=>{y();var n=g(`New branch`);k(e,n)},$$slots:{default:!0}})});var a=G(i,2),s=q(a),c=q(s);un(c,{for:`mobile-branch-name`,children:(e,t)=>{y();var n=g(`Name`);k(e,n)},$$slots:{default:!0}});var l=G(c,2);{let e=L(()=>t(E).trim().length>0&&!t(A));an(l,{id:`mobile-branch-name`,placeholder:`feature/my-change`,autocapitalize:`off`,autocorrect:`off`,spellcheck:!1,class:`font-mono`,get disabled(){return t(O)},get"aria-invalid"(){return t(e)},get value(){return t(E)},set value(e){B(E,e,!0)}})}var d=G(l,2),f=z(d);x(s);var p=G(s,2),m=q(p);Q(m,{variant:`ghost`,get disabled(){return t(O)},onclick:()=>B(T,!1),children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var h=G(m,2);{let e=L(()=>!t(u)||t(O)||!t(A));Q(h,{type:`submit`,get disabled(){return t(e)},children:(e,n)=>{y();var r=g();F(()=>w(r,t(O)?`Creating…`:`Create branch`)),k(e,r)},$$slots:{default:!0}})}x(p),x(a),F(()=>w(f,`Created from ${t(o)?.currentBranch??`the current commit`??``}.`)),M(`submit`,a,ee),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,te),D()}var X2=new Map;function Z2(e,t){return X2.set(e,t),()=>{X2.get(e)===t&&X2.delete(e)}}function Q2(e){return{label:`Review`,onClick:()=>X2.get(e)?.()}}var $2={builtin:`Default`,user:`User`,project:`Project`,process:`Process`,recommendation:`Recommended`,conversation:`Conversation`,requirement:`Required`,frozen:`Frozen at creation`,launch:`Launch choice`};function e4(e,t){if(!e)return`Unavailable`;if(e.adjusted)return`Adjusted for ${t??`model`}`;let n=$2[e.source];return e.profile?`${n} · ${e.profile}`:n}function t4(e){return e==null?`Use settings`:typeof e==`string`?e||`(empty)`:JSON.stringify(e)}function n4(e){let t=t4(e.before),n=t4(e.after);return t===n?`${n} · ${e4(e.beforeSource)} → ${e4(e.afterSource)}`:`${t} → ${n}`}var r4=O(`<p class="text-ui text-muted-foreground">No effective setting or instruction changed. The definition metadata or
141
+ shadowed recommendations changed; your explicit choices remain intact.</p>`),i4=O(`<details class="text-ui"><summary class="cursor-pointer text-muted-foreground">Unchanged requirements <!></summary> <!></details>`),a4=O(`<!> <!> <!> <details class="text-ui"><summary class="cursor-pointer text-muted-foreground">Target definition details</summary><!><!><!><!></details>`,1),o4=O(`<!> <!> <!> <div class="flex justify-end gap-2"><!><!><!></div>`,1),s4=O(`<!> <!>`,1);function c4(e,n){c(n,!0);let r=Y(void 0),i=Y(!1),a=Y(!1),o=Y(!1),s=Y(void 0),u=Y(``),d=L(()=>t(r)?.resolution.diagnostics.some(e=>e.code===`unsupported-reasoning`||e.code===`model-required`)??!1);async function f(e=!1){let a=n.conversationId,c=n.applied,l=await El(`conversation.previewAgentProfile`,{conversationId:a,profile:c.name});a===n.conversationId&&c===n.applied&&(l.status===`ready`?t(i)&&!e&&t(r)?(t(r).targetProfile.digest!==l.preview.targetProfile.digest||t(r).expectedRevision!==l.preview.expectedRevision||t(r).expectedDigest!==l.preview.expectedDigest)&&(B(o,!0),B(s,`Configuration changed since this preview. Review again before confirming.`)):(B(o,!1),e&&B(s,void 0),B(r,l.preview,!0),l.preview.targetProfile.digest!==c.sourceDigest&&t(u)!==`${a}:${l.preview.targetProfile.digest}`&&(B(u,`${a}:${l.preview.targetProfile.digest}`),ui.warning(`Updated profile available`,{description:`${c.name} has changed. Your current snapshot is unchanged.`,action:Q2(a),activity:!1})),e&&B(i,!0)):e&&B(s,`Profile unavailable or untrusted. Repair it, then review again.`))}W(()=>Z2(n.conversationId,()=>{B(i,!0)})),W(()=>{Us.progressiveActive&&(n.conversationId,n.applied,f().catch(()=>void 0))}),W(()=>yl({recover:()=>f().catch(()=>void 0),disconnected(){},event(){},notice:e=>{e.type===`agentConfiguration.changed`&&f().catch(()=>void 0)}}));async function p(){if(!(!t(r)||t(a)||t(o))){B(a,!0),B(s,void 0);try{let e=await El(`conversation.setAgentProfile`,{conversationId:n.conversationId,action:`reapply`,targetProfile:t(r).targetProfile,expectedRevision:t(r).expectedRevision,expectedDigest:t(r).expectedDigest});e.status===`applied`?(await n.onApplied(),B(i,!1),ui.success(`Updated profile applied`,{activity:!0,description:`Conversation choices were preserved.`})):(B(r,e.status===`refresh_required`?e.preview:void 0,!0),B(s,`Profile or configuration changed. Review the refreshed preview and confirm again. Nothing was applied.`))}catch(e){B(s,e instanceof Error?e.message:String(e),!0)}finally{B(a,!1)}}}var m=s4(),h=R(m),_=e=>{Q(e,{size:`sm`,variant:`ghost`,onclick:()=>{B(s,void 0),f(!0).catch(e=>{B(s,String(e),!0)})},children:(e,t)=>{y();var n=g(`Apply updated profile`);k(e,n)},$$slots:{default:!0}})};l(h,e=>{t(r)&&t(r).targetProfile.digest!==n.applied.sourceDigest&&e(_)});var b=G(h,2);{let e=L(()=>`Apply updated ${n.applied.name} profile`);ln(b,{get title(){return t(e)},description:`Only changed fields are shown. Your conversation choices are preserved.`,get open(){return t(i)},set open(e){B(i,e,!0)},children:(e,n)=>{var c=o4(),u=R(c),m=e=>{nn(e,{layout:`block`,tone:`destructive`,get text(){return t(s)}})};l(u,e=>{t(s)&&e(m)});var h=G(u,2),_=e=>{nn(e,{layout:`block`,tone:`destructive`,text:`Profile requirement conflict: a model is missing or the required reasoning is unsupported by the effective model. Repair the definition or choose compatible underlying settings, then review again.`})};l(h,e=>{t(d)&&e(_)});var b=G(h,2),S=e=>{var n=a4(),i=R(n);v(i,17,()=>t(r).changedFields,e=>e.pointer,(e,n)=>{{let r=L(()=>n4(t(n)));U_(e,{get label(){return t(n).pointer},get value(){return t(r)}})}});var a=G(i,2),o=e=>{var t=r4();k(e,t)};l(a,e=>{t(r).changedFields.length||e(o)});var s=G(a,2),c=e=>{var n=i4(),i=q(n),a=G(q(i));be(a,{variant:`neutral`,children:(e,n)=>{y();var i=g();F(()=>w(i,t(r).unchangedRequirements.length)),k(e,i)},$$slots:{default:!0}}),x(i);var o=G(i,2);v(o,17,()=>t(r).unchangedRequirements,e=>e.pointer,(e,n)=>{{let r=L(()=>t4(t(n).value));U_(e,{get label(){return t(n).pointer},get value(){return t(r)}})}}),x(n),k(e,n)};l(s,e=>{t(r).unchangedRequirements.length&&e(c)});var u=G(s,2),d=G(q(u));{let e=L(()=>t(r).targetDefinition.label??t(r).targetDefinition.name);U_(d,{label:`Label`,get value(){return t(e)}})}var f=G(d);U_(f,{label:`When to use`,get value(){return t(r).targetDefinition.whenToUse}});var p=G(f);U_(p,{label:`Usable by`,get value(){return t(r).targetDefinition.usableBy}});var m=G(p);{let e=L(()=>t(r).targetDefinition.instructions||`(empty)`);U_(m,{label:`Instructions`,get value(){return t(e)}})}x(u),k(e,n)};l(b,e=>{t(r)&&e(S)});var C=G(b,2),T=q(C),E=e=>{Q(e,{variant:`outline`,get disabled(){return t(a)},onclick:()=>f(!0).catch(e=>{B(s,String(e),!0)}),children:(e,t)=>{y();var n=g(`Review again`);k(e,n)},$$slots:{default:!0}})};l(T,e=>{(t(s)||t(d))&&e(E)});var D=G(T);Q(D,{variant:`outline`,get disabled(){return t(a)},onclick:()=>{B(i,!1)},children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var O=G(D);{let e=L(()=>t(a)||!t(r)||t(o)||t(d));Q(O,{get disabled(){return t(e)},onclick:p,children:(e,n)=>{y();var r=g();F(()=>w(r,t(a)?`Applying…`:`Apply updated profile`)),k(e,r)},$$slots:{default:!0}})}x(C),k(e,c)},$$slots:{default:!0}})}k(e,m),D()}var l4=class{options;#e=new yo;#t=new mo;#n=new Map;#r=new Map;constructor(e){this.options=e}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}set(e,t){this.#e.set(e,t)}delete(e){this.#e.delete(e)}loading(e){return this.#t.has(e)}keys(){return[...this.#r.keys()]}ensure(e){return this.#e.has(e)?Promise.resolve(this.#e.get(e)):WD(this.#n,e,()=>this.#i(e))}refresh(e){return this.#n.delete(e),WD(this.#n,e,()=>this.#i(e))}#i(e){let t=(this.#r.get(e)??0)+1;this.#r.set(e,t);let n=()=>this.#r.get(e)===t;return this.#t.add(e),this.options.load(e).then(t=>{n()&&this.#e.set(e,t)},t=>{n()&&this.options.onError?.(e,t)}).then(()=>(n()&&this.#t.delete(e),this.#e.get(e)))}},u4=new class{loader;constructor(e){this.loader=new l4({load:e,onError:e=>this.loader.delete(e)})}get(e){return e?this.loader.get(e):void 0}async load(e,t=!1){await(t?this.loader.refresh(e):this.loader.ensure(e))}async refresh(e){await Promise.all(this.loader.keys().filter(t=>!e||t===e).map(e=>this.loader.refresh(e)))}}(e=>El(`agentConfiguration.resolveProject`,{projectId:e}));function d4(){let e=[`agentProfiles.changed`,`settings.updated`,`providers.catalog_changed`,`auth.providers_changed`].map(e=>$n(e,()=>{u4.refresh()})),t=yl({recover:()=>u4.refresh(),disconnected(){},event(){},notice:e=>{if(e.type===`agentConfiguration.changed`||e.type===`conversationDefaults.changed`){let t=e.data.scope;t.scope===`user`?u4.refresh():t.scope===`project`&&u4.refresh(t.projectId)}}});return()=>{for(let t of e)t();t()}}var f4=class{#e=Y();get result(){return t(this.#e)}set result(e){B(this.#e,e,!0)}get inherited(){return this.result?.status===`available`?this.result.inherited:void 0}get overrides(){let e=this.result?.status===`available`?this.result.overrides:{};return this.inherited===void 0?e:nV(e,this.inherited)}#t=Y();get error(){return t(this.#t)}set error(e){B(this.#t,e,!0)}#n=Y(!1);get saving(){return t(this.#n)}set saving(e){B(this.#n,e,!0)}scope;generation=0;async load(e){(this.scope?.scope!==e.scope||e.scope===`project`&&this.scope?.scope===`project`&&this.scope.projectId!==e.projectId)&&(this.result=void 0),this.scope=e;let t=++this.generation;try{let n=await El(`conversationDefaults.get`,{scope:e});if(t!==this.generation)return;this.result=n,this.error=n.status===`available`?void 0:`Creation preferences unavailable.`}catch(e){t===this.generation&&(this.result=void 0,this.error=String(e))}}async reload(){let e=this.scope;if(e)try{await nr(`agentConfiguration.reload`,{target:{document:`conversation-defaults`,scope:e}}),this.scope===e&&await this.load(e)}catch(t){this.scope===e&&(this.error=t instanceof Error?t.message:String(t))}}async save(e,t=[]){let n=this.result,r=this.scope;if(!this.saving&&r&&n?.status===`available`){this.saving=!0;try{let i=await El(`conversationDefaults.save`,{scope:r,expectedRevision:n.source.revision,expectedDigest:n.source.digest,changes:e,resets:t});if(this.scope!==r)return;await this.load(r),this.scope===r&&i.status!==`saved`&&(this.error=`Creation preferences ${i.status}. Refresh and try again.`)}catch(e){this.scope===r&&(this.error=String(e))}finally{this.saving=!1}}}observe(){return yl({recover:()=>this.scope?this.load(this.scope):Promise.resolve(),disconnected(){},event(){},notice:e=>{e.type===`conversationDefaults.changed`&&this.scope&&this.load(this.scope)}})}};function p4(e){let t=e?Date.parse(e):NaN;return Number.isFinite(t)?t:0}function m4(e,t){return p4(t.lastParentPromptAt)-p4(e.lastParentPromptAt)||p4(t.createdAt)-p4(e.createdAt)||(e.name??e.title??``).trim().localeCompare((t.name??t.title??``).trim())||e.id.localeCompare(t.id)}function h4(e,t){return t===void 0?e:tV(e,t)}function g4(e,t,n,r){return h4(Ki(e,{expectedRevision:0,expectedDigest:`missing`,changes:t,resets:n}),r)}function _4(e,t){let n=new Set(ta(t).map(([e])=>e));return{changes:t,resets:ta(e).filter(([e])=>!n.has(e)).map(([e])=>`/overrides${e}`)}}function v4(e){let n=Y(0),i=Y(void 0),a=Y(!1),o=Y(!1);W(()=>e.observe(()=>{B(n,t(n)+1)})),W(()=>{t(n);let o=e.target();if(B(a,!1),o.kind!==`draft`)return;let s=e.pending(),c=s?.explicitAgentProfile,l=r(s?.overrides??{});if(!c&&!Object.keys(l).length)return;let u=e.profiles(o.projectId).find(e=>e.name===c);if(c&&!u?.digest){B(i,void 0);return}let d=!0;return B(a,!0),e.resolve({projectId:o.projectId,agentProfile:u?.digest?{name:u.name,digest:u.digest}:void 0,overrides:l}).then(e=>{d&&B(i,{pendingId:o.pendingId,result:e},!0)}).catch(()=>{d&&B(i,void 0)}).finally(()=>{d&&B(a,!1)}),()=>{d=!1}}),W(()=>{t(n);let r=e.target();if(B(o,!1),r.kind!==`conversation`||r.readOnly)return;let i=!0;return B(o,!0),me(()=>e.capabilityEditor.load({scope:`conversation`,conversationId:r.conversationId})).finally(()=>{i&&B(o,!1)}),()=>{i=!1}});let s=L(()=>{t(n);let r=e.target();if(r.kind===`conversation`)return e.store()?.effective;let o=e.pending();return!o?.explicitAgentProfile&&!Object.keys(o?.overrides??{}).length?e.defaults(r.projectId):t(i)?.pendingId===r.pendingId?t(i).result:t(a)?e.defaults(r.projectId):void 0}),c=L(()=>t(s)?.status===`available`?t(s):void 0),l=L(()=>t(c)?.resolution),u=L(()=>({model:t(l)?.provenance[`/model`]?.source===`requirement`,thinking:t(l)?.provenance[`/reasoningLevel`]?.source===`requirement`,permission:t(l)?.provenance[`/permissionRuleSetId`]?.source===`requirement`,compaction:Object.entries(t(l)?.provenance??{}).some(([e,t])=>e.startsWith(`/compaction/`)&&t.source===`requirement`)})),d=L(()=>e.target().kind===`draft`?t(c)&&`inherited`in t(c)?t(c).inherited:void 0:e.store()?.configuration?.inherited),f=()=>{let t=e.target();return t.kind===`conversation`&&t.readOnly};async function p(n,r=[],i=!1){if(f())return;let a=e.pending();e.target().kind===`draft`&&a?a.overrides=g4(a.overrides??{},n,r,t(d)):i?await e.capabilityEditor.save(n,r):await e.store()?.configure(n,r)}return{get target(){return e.target()},get status(){if(t(c))return t(l)?.settings.model?`ready`:`unavailable`;let n=e.pending(),r=e.target().kind===`draft`&&!n?.explicitAgentProfile&&!Object.keys(n?.overrides??{}).length;return t(a)||t(s)===void 0&&(r||e.target().kind===`conversation`)?`loading`:`unavailable`},get error(){return e.capabilityEditor.error??(t(s)?.status===`unavailable`?t(s).diagnostics.map(e=>e.message??e.code).join(`
142
+ `):t(c)&&!t(l)?.settings.model?`Choose an available model to configure this conversation.`:void 0)},get saving(){return t(o)||(e.capabilityEditor.saving??!1)},get resolution(){return t(l)},get inherited(){return t(d)},get appliedProfile(){return t(c)?.appliedProfile?.name},get overrides(){return h4(e.target().kind===`draft`?e.pending()?.overrides??{}:e.store()?.configuration?.overrides??{},t(d))},get locked(){return t(u)},async setModel(n,r){if(f()||t(u).model)return;let i=$R(n);i&&await p({model:i,...t(u).thinking?{}:{reasoningLevel:e.clampReasoning(n,r??t(l)?.settings.reasoningLevel??`off`)}})},async setReasoning(n){if(f()||t(u).thinking)return;let r=t(l)?.settings.model;r&&await p({reasoningLevel:e.clampReasoning(QR(r),n)})},async setPermission(e){!f()&&!t(u).permission&&await p(e?{permissionRuleSetId:e}:{},e?[]:[`/overrides/permissionRuleSetId`])},async setProfile(t){if(f())return;let n=e.pending();e.target().kind===`draft`&&n?n.explicitAgentProfile=t:await e.store()?.setAgentProfile(t)},async patchCapabilities(e,n=[]){let r={...e};t(u).model&&delete r.model,t(u).thinking&&delete r.reasoningLevel,t(u).permission&&delete r.permissionRuleSetId,t(u).compaction&&delete r.compaction;let i=[...t(u).model?[`/overrides/model`]:[],...t(u).thinking?[`/overrides/reasoningLevel`]:[],...t(u).permission?[`/overrides/permissionRuleSetId`]:[],...t(u).compaction?[`/overrides/compaction`]:[]],a=n.filter(e=>!i.some(t=>e===t||e.startsWith(t+`/`)));(Object.keys(r).length||a.length)&&await p(r,a,!0)}}}var y4=Y(void 0),b4=()=>t(y4);function x4(e){return B(y4,e),()=>{t(y4)===e&&B(y4,void 0)}}var S4=class{clampThinking;#e=Y();get document(){return t(this.#e)}set document(e){B(this.#e,e,!0)}#t=Y(`lead`);get role(){return t(this.#t)}set role(e){B(this.#t,e,!0)}#n=Y();get resolution(){return t(this.#n)}set resolution(e){B(this.#n,e,!0)}get inherited(){return this.document?.status===`available`?{settings:this.document.inherited}:void 0}#r=Y();get error(){return t(this.#r)}set error(e){B(this.#r,e,!0)}#i=Y(!1);get saving(){return t(this.#i)}set saving(e){B(this.#i,e,!0)}scope;generation=0;constructor(e){this.clampThinking=e}get overrides(){return h4(this.document?.status===`available`?this.document.overrides:{},this.document?.status===`available`?this.document.inherited:void 0)}async load(e){let t=++this.generation;JSON.stringify(this.scope)!==JSON.stringify(e)&&(this.document=void 0,this.resolution=void 0),this.scope=e;try{let n=await El(`agentConfiguration.get`,{scope:e});if(t!==this.generation)return;if(this.document=n,n.status!==`available`)throw Error(`Scoped configuration unavailable. Repair the document, then reload.`);if(e.scope===`conversation`){let n=await El(`agentConfiguration.getEffective`,{conversationId:e.conversationId});if(t!==this.generation)return;if(n.status!==`available`)throw Error(`Effective configuration unavailable.`);this.role=n.role,this.resolution=n.resolution}else{this.role=`lead`;let r=e.scope===`project`?await El(`agentConfiguration.get`,{scope:{scope:`user`}}):void 0;if(t!==this.generation)return;if(r&&r.status!==`available`)throw Error(`User configuration unavailable. Project values cannot be resolved.`);let i=e.scope===`user`?{user:n.overrides}:{user:r?.status===`available`?r.overrides:void 0,project:n.overrides};this.resolution=Ii({role:`lead`,subagentDefaults:Object.fromEntries(Object.entries(n.inherited.subagents??{}).map(([e,t])=>[e,t.enabled??!0])),...i,clampThinking:this.clampThinking})}this.error=void 0}catch(e){t===this.generation&&(this.resolution=void 0,this.error=e instanceof Error?e.message:String(e))}}async reload(){let e=this.scope;if(e)try{await nr(`agentConfiguration.reload`,{target:{document:`agent`,scope:e}}),this.scope===e&&await this.load(e)}catch(t){this.scope===e&&(this.error=t instanceof Error?t.message:String(t))}}async save(e,t=[]){let n=this.scope,r=this.document;if(n&&r?.status===`available`&&!this.saving){this.saving=!0;try{let i=await El(`agentConfiguration.save`,{scope:n,expectedRevision:r.source.revision,expectedDigest:r.source.digest,changes:e,resets:t});if(this.scope!==n)return;await this.load(n),i.status!==`saved`&&(this.error=`Configuration ${i.status}. Reload and review your changes before trying again.`)}catch(e){this.scope===n&&(this.error=e instanceof Error?e.message:String(e))}finally{this.saving=!1}}}observe(){return yl({recover:()=>this.scope?this.load(this.scope):Promise.resolve(),disconnected(){},event(){},notice:e=>{e.type===`agentConfiguration.changed`&&this.scope&&this.load(this.scope)}})}},C4=U({suggestions:[],trustRequests:[],statuses:[],projectFile:void 0,diagnostics:[],loading:!1,error:void 0,lastProjectId:void 0,dismissedTrustIds:[]});async function w4(e,t={}){if(!e)C4.suggestions=[],C4.trustRequests=[],C4.lastProjectId=void 0;else{C4.loading=!0,C4.error=void 0;try{let n=await tte(e,t);C4.suggestions=n.suggestions,C4.trustRequests=n.trustRequests.filter(e=>!C4.dismissedTrustIds.includes(e.trustId)),C4.statuses=n.statuses,C4.diagnostics=n.diagnostics??[],C4.lastProjectId=e}catch(e){C4.error=LK(e)}finally{C4.loading=!1}}}async function T4(e){C4.loading=!0,C4.error=void 0;try{let t=await ete(e);C4.statuses=t.statuses,C4.projectFile=t.projectFile}catch(e){C4.error=LK(e)}finally{C4.loading=!1}}async function E4(e,t){try{for(let t of e)await Hee(t)}finally{await T4(t)}}async function D4(e,t){let n=await qee(e);return await T4(t),ui.success(`Prompt suggestion created`,{activity:!0}),n.suggestion}function O4(e){C4.dismissedTrustIds.includes(e)||(C4.dismissedTrustIds=[...C4.dismissedTrustIds,e]),C4.trustRequests=C4.trustRequests.filter(t=>t.trustId!==e)}function k4(e){return e.classification!==`migrated`}function A4(e){return`${e.projectId}\u0000${e.type}`}function j4(e){return Object.values(e).flat().filter(k4).map(e=>`${A4(e)}:${e.classification}:${e.classification===`legacy`?[...e.files??[]].sort().join(`;`):``}`).sort().join(`,`)}function M4(e){let t=Object.values(e).flat().filter(k4).reduce((e,t)=>e+(t.classification===`legacy`?t.files?.length??1:1),0);return`Project configuration needs attention · ${t} ${t===1?`file`:`files`}`}function N4(e,t){let n={...e};return t.issues.length?n[t.projectId]=t.issues:delete n[t.projectId],n}var P4=class{#e=Y(U({}));get byProject(){return t(this.#e)}set byProject(e){B(this.#e,e,!0)}#t=Y(!1);get pending(){return t(this.#t)}set pending(e){B(this.#t,e,!0)}#n=Y();get error(){return t(this.#n)}set error(e){B(this.#n,e,!0)}#r=Y();get resetTarget(){return t(this.#r)}set resetTarget(e){B(this.#r,e,!0)}listeners=new Set;issuesFor(e){return e?this.byProject[e]??[]:[]}apply(e){this.byProject=N4(this.byProject,e);for(let t of this.listeners)t(e)}onApplied(e){return this.listeners.add(e),()=>void this.listeners.delete(e)}async refresh(e){try{this.apply(hi.parse(await nr(`project.configuration.health`,{projectId:e})))}catch(e){this.error=F4(e,`Could not load project configuration health.`)}}async reload(e){await this.resolve({...e,action:`reload`})}async reset(e){await this.resolve(e.classification===`legacy`?{projectId:e.projectId,type:`legacy-files`,action:`remove-legacy`,confirmed:!0}:{projectId:e.projectId,type:e.type,action:`reset`,confirmed:!0})}requestReset(e){this.resetTarget=e}folderOpener;registerFolderOpener(e){return this.folderOpener=e,()=>{this.folderOpener=void 0}}async open(e){try{if(e.classification===`legacy`){if(!this.folderOpener)throw Error(`Folder navigation is unavailable`);await this.folderOpener(e)}else await Vd({projectId:e.projectId,path:e.path})}catch(e){this.error=F4(e,`Could not open project settings.`)}}async resolve(e){if(!this.pending){this.pending=!0,this.error=void 0;try{this.apply(hi.parse(await nr(`project.configuration.resolve`,e)))}catch(e){this.error=F4(e,`Could not update project configuration.`)}finally{this.pending=!1}}}};function F4(e,t){return e instanceof Error?e.message:t}var I4=new P4;async function L4(){return Ue.parse(await it(`/api/settings/health`))}async function R4(e){return Ue.parse(await nt(`/api/settings/health/resolve`,e))}async function z4(e,t){try{return{health:await t(),pending:!1}}catch(t){return{health:e.health,pending:!1,error:t instanceof Error?t.message:`Could not load settings health.`}}}function B4(e){return e.invalid.map(e=>e.id).sort().join(`,`)}function V4(e){let t=e.invalid.length;return`Settings need attention · ${t} ${t===1?`file`:`files`}`}var H4=new class{#e=Y(U({health:{invalid:[]},pending:!1}));get notice(){return t(this.#e)}set notice(e){B(this.#e,e,!0)}#t=Y();get resetId(){return t(this.#t)}set resetId(e){B(this.#t,e,!0)}async refresh(){this.notice.pending||(this.notice={...this.notice,pending:!0,error:void 0},this.notice=await z4(this.notice,L4))}async resolve(e){if(!this.notice.pending&&(this.notice={...this.notice,pending:!0,error:void 0},this.notice=await z4(this.notice,()=>R4(e)),!this.notice.error&&!this.notice.health.invalid.some(t=>t.id===e.id))){this.notice={...this.notice,pending:!0};try{await Bt()}catch(e){this.notice={...this.notice,error:e instanceof Error?e.message:`Settings were repaired, but the workbench could not refresh them.`}}finally{this.notice={...this.notice,pending:!1}}}}};function U4(e){return e.filter(e=>e.applicable!==!1&&!e.error&&e.usableBy!==`subagent`)}function W4(e){return e.filter(e=>e.trustState===`needs_review`&&e.applicable!==!1&&e.usableBy!==`subagent`)}var G4=``,K4=new class{loader=new l4({load:e=>nr(`agentProfiles.list`,{scope:e===G4?{scope:`user`}:{scope:`project`,projectId:e}}).then(({profiles:e})=>e.map(q4))});listening=!1;profiles(e){return this.loader.get(e??G4)??[]}loaded(e){return this.loader.has(e??G4)}async ensure(e){return this.listen(),await this.loader.ensure(e??G4)??[]}async refresh(e){return await this.loader.refresh(e??G4)??[]}listen(){if(this.listening)return;this.listening=!0;let e=()=>{for(let e of this.loader.keys())this.loader.has(e)&&this.loader.refresh(e)};ir(t=>{(t.type===`agentProfiles.changed`||t.type===`configuration.decided`&&t.data.target?.kind===`agent-profile`)&&e()}),tr(e)}};function q4(e){return{name:e.name,label:e.definition?.label??e.name,whenToUse:e.definition?.whenToUse??`Definition unavailable`,usableBy:e.definition?.usableBy??`both`,defaultEnabled:e.definition?.enabled??!0,applicable:e.applicable,digest:e.digest,source:e.source,...e.trustState?{trustState:e.trustState}:{},error:e.definition&&e.trustState===`trusted`?void 0:e.diagnostics.map(e=>e.code).join(`, `)||`Profile unavailable or untrusted`}}var J4=(e,t)=>`${e}:${t}`;function Y4(e){let t=e.indexOf(`:`),n=e.slice(0,t),r=e.slice(t+1);return t>0&&r&&(n===`user`||n===`project`)?{scope:n,name:r}:void 0}var X4={"agent-preferences":`Agent settings`,"agent-profile":`Agent profile`,"rule-set":`Permission rule set`,"permission-overlay":`Permission rules`,"launch-catalog":`Launch definitions`,"mcp-servers":`MCP servers`,skill:`Skill`,"prompt-suggestion":`Suggestion`,extension:`Extension`},Z4=new Set([`agent-preferences`,`permission-overlay`,`launch-catalog`]),Q4=`In this project, from the repository`,$4=`Yours, every project`;function e3(e){return X4[e]}function t3(e){return e.kind===`mcp-servers`?e.id===`mcp.json`?X4[e.kind]:`MCP server ${e.id}`:Z4.has(e.kind)?X4[e.kind]:`${X4[e.kind]} ${e.id}`}function n3(e){return e.scope===`user`||e.scope===`project`}function r3(e){if(n3(e)){if(e.state===`needs_review`)return`review`;if(e.state===`invalid`||e.state===`incompatible`||e.diagnostics.some(e=>e.level===`error`))return`broken`}}function i3(e,t,n){let r=e.scope===`project`?`project`:`user`;switch(e.kind){case`skill`:return t===`review`?{scope:r,pageId:`skills`,item:`${r}:${e.id}`}:{scope:r,pageId:`skills`};case`extension`:return{scope:r,pageId:`extensions`,item:e.id};case`prompt-suggestion`:return{scope:r,pageId:`suggestions`};case`launch-catalog`:return;case`mcp-servers`:return t===`review`&&e.id!==`mcp.json`?{scope:r,pageId:`mcp-servers`,item:J4(r,e.id)}:{scope:r,pageId:`mcp-servers`};case`agent-profile`:{let i=n?.(r,e.id)??`agents`;return t===`review`?{scope:r,pageId:i,item:`${r}:${e.id}`}:{scope:r,pageId:i}}case`rule-set`:case`permission-overlay`:return{scope:r,pageId:`permission-rules`};case`agent-preferences`:return{scope:r,pageId:`general`}}}function a3(e){return e.kind===`skill`?e.diagnostics.some(e=>e.code===`approval-outdated`)?`Changed since you trusted it. Not used until you trust it again.`:`Not used until you trust it.`:e.kind===`extension`?`Not loaded until you allow it.`:e.kind===`mcp-servers`?`Not started until you trust it.`:`Ignored until you trust it.`}function o3(e,t){let n=r3(e);if(!n||!n3(e))return;let r=t3(e),i=e.kind===`extension`&&e.state===`incompatible`,a=e.diagnostics[0]?.message,o=i3(e,n,t);return{key:[e.kind,e.scope,e.id,e.path??``].join(`\0`),group:n,kind:e.kind,id:e.id,scope:e.scope,...e.path?{path:e.path}:{},title:n===`review`?r:i?`${r} needs an upgrade`:`${r} can't load`,origin:e.scope===`project`?Q4:$4,detail:n===`review`?a3(e):a??``,...o?{target:o}:{},...n===`broken`?{askAgent:i?`upgrade`:`fix`}:{},diagnostics:e.diagnostics}}var s3=e=>e.replace(/[\\/]+$/,``);function c3(e,t=[],n){let r=new Set(t.map(s3)),i=new Set,a=[];for(let t of e){let e=o3(t,n);e&&!i.has(e.key)&&(e.group===`broken`&&e.path&&r.has(s3(e.path))||(i.add(e.key),a.push(e)))}return a}function l3(e){return{review:e.filter(e=>e.group===`review`),broken:e.filter(e=>e.group===`broken`)}}function u3(e){return e.map(e=>`${e.group}:${e.key}`).sort().join(`,`)}function d3(e,t){let{review:n,broken:r}=l3(e),i=[],a=r.filter(e=>e.askAgent===`upgrade`);n.length&&i.push(`${t?`${t} has `:``}${n.length} ${n.length===1?`item`:`items`} waiting for your review`),a.length&&i.push(`${a.length} ${a.length===1?`extension needs`:`extensions need`} an upgrade`);let o=r.length-a.length;return o&&i.push(`${o} ${o===1?`item doesn't`:`items don't`} work`),i.join(` · `)}function f3(e){return e.filter(e=>e.group===`review`&&e.scope===`project`&&e.target)}function p3(e){return e===1?`1 project file needs your review`:`${e} project files need your review`}function m3(e){let t={user:{},project:{}},n=e.filter(e=>e.group===`review`);for(let e of n){if(!e.target)continue;let n=t[e.target.scope];n[e.target.pageId]=(n[e.target.pageId]??0)+1}return{project:n.filter(e=>e.scope===`project`).length,user:n.filter(e=>e.scope===`user`).length,pages:t}}function h3(e){return[e.askAgent===`upgrade`?`Upgrade this configuration so it works with the current version of Nerve.`:`Fix this configuration so it loads.`,``,`Kind: ${e3(e.kind)} (${e.kind})`,`Id: ${e.id}`,`Scope: ${e.scope===`project`?`project (from the repository)`:`user (every project)`}`,...e.path?[`Path: ${e.path}`]:[],`Problems:`,...e.diagnostics.map(e=>`- [${e.level}] ${e.code}: ${e.message}${e.pointer?` (${e.pointer})`:``}`),``,`Do not approve or trust anything; I review that myself.`].join(`
143
+ `)}var g3=new class{#e=Y();get projectId(){return t(this.#e)}set projectId(e){B(this.#e,e,!0)}#t=Y(U([]));get resources(){return t(this.#t)}set resources(e){B(this.#t,e,!0)}#n=Y();get error(){return t(this.#n)}set error(e){B(this.#n,e,!0)}#r=Y(!1);get loaded(){return t(this.#r)}set loaded(e){B(this.#r,e,!0)}#i=0;#a=Nt(()=>void this.refresh(),300);get shownPaths(){return[...H4.notice.health.invalid.map(e=>e.path),...I4.issuesFor(this.projectId).filter(e=>e.classification!==`migrated`).flatMap(e=>[e.path,...e.files??[]])]}get entries(){return c3(this.resources,this.shownPaths,this.#o)}#o=(e,t)=>K4.profiles(e===`project`?this.projectId:void 0).find(n=>n.name===t&&(n.source??`builtin`)===e)?.usableBy===`subagent`?`sub-agents`:void 0;async openFile(e){this.projectId&&await Vd({projectId:this.projectId,path:e})}entriesFor(e){return this.entries.filter(t=>t.scope===`user`||e!==void 0&&this.projectId===e)}async refresh(e=this.projectId){this.#a.cancel();let t=++this.#i;try{let{resources:n}=await El(`configuration.attention`,{...e?{projectId:e}:{}});if(t!==this.#i)return;this.projectId=e,this.resources=n,this.loaded=!0,this.error=void 0,n.some(e=>e.kind===`agent-profile`&&e.state===`needs_review`)&&K4.ensure(e)}catch(e){if(t!==this.#i)return;this.error=e instanceof Error?e.message:`Could not check configuration.`}}refreshSoon(){this.#a.schedule()}reset(e){e!==this.projectId&&(this.#i++,this.projectId=e,this.resources=[],this.loaded=!1)}};function _3(e,t){return e.kind===t.kind&&e.scope===t.scope&&e.id===t.id&&(e.scope===`user`||e.projectId===t.projectId)}function v3(e){return[e.kind,e.scope,e.projectId??``,e.id].join(`\0`)}function y3(e,t){let{scope:n,id:r}=e,i={scope:n,...n===`project`&&e.projectId?{projectId:e.projectId}:{}};switch(e.kind){case`agent-profile`:return{...i,pageId:t?.(e)??`agents`,item:`${n}:${r}`};case`skill`:return{...i,pageId:`skills`,item:`${n}:${r}`};case`extension`:return{...i,pageId:`extensions`,item:r};case`prompt-suggestion`:return{...i,pageId:`suggestions`,...r.endsWith(`.json`)?{}:{item:n===`project`?`project:${e.projectId??``}:${r}`:`user:${r}`}};case`mcp-servers`:return r===`mcp.json`?{...i,pageId:`mcp-servers`}:{...i,pageId:`mcp-servers`,item:J4(n,r)};case`rule-set`:return{...i,pageId:`permission-rules`,item:r};case`permission-overlay`:return{...i,pageId:`permission-rules`};case`agent-preferences`:return{...i,pageId:`general`};case`launch-catalog`:return}}var b3=e=>`${v3(e.target)}\u0000${e.state}`,x3=(e,t)=>e instanceof Error&&e.message?e.message:t;async function S3(e,t,n){try{return{status:`decided`,review:await e.decide({target:t.target,digest:t.digest,trusted:n})}}catch(n){let r=await e.review(t.target).catch(()=>void 0);return r&&r.digest!==t.digest?{status:`stale`,review:r}:{status:`failed`,error:x3(n,`Could not save your decision.`)}}}var C3=`It changed while you were reviewing it. Review it again before you decide.`;function w3(){return{targets:[],index:0,phase:`idle`,review:void 0,error:void 0,notice:void 0,busy:!1}}var T3=class{fields;api;afterDecision;#e=0;#t=new Set;#n=new Set;constructor(e,t,n=()=>{}){this.fields=e,this.api=t,this.afterDecision=n}get targets(){return this.fields.targets}get index(){return this.fields.index}get phase(){return this.fields.phase}get review(){return this.fields.review}get error(){return this.fields.error}get notice(){return this.fields.notice}get busy(){return this.fields.busy}get open(){return this.fields.targets.length>0}get current(){return this.fields.targets[this.fields.index]}get hasPrevious(){return this.fields.index>0}get hasNext(){return this.fields.index<this.fields.targets.length-1}start(e,t=0){let n=new Set,r=e.filter(e=>{let t=v3(e);return!n.has(t)&&(n.add(t),!0)});if(!r.length)return this.close();this.fields.targets=r,this.#i(Math.min(Math.max(0,t),r.length-1))}close(){this.#e++,Object.assign(this.fields,w3())}previous(){this.hasPrevious&&this.#i(this.fields.index-1)}next(){this.hasNext&&this.#i(this.fields.index+1)}skip(){this.hasNext?this.#i(this.fields.index+1):this.close()}async reload(){let e=this.current;if(!e)return;let t=++this.#e,n=this.fields;n.review||(n.phase=`loading`),n.error=void 0;try{let r=await this.api.review(e);if(t!==this.#e)return;n.review=r,n.phase=`ready`}catch(e){if(t!==this.#e)return;n.review=void 0,n.error=x3(e,`Could not load the review.`),n.phase=`error`}}trust(){return this.#a(!0)}decline(){return this.#a(!1)}onDecision(e){return this.#t.add(e),()=>this.#t.delete(e)}announce(e){let t={target:e.target,state:e.state};this.#n.add(b3(t)),this.#r(t)}received(e){this.#n.delete(b3(e))||this.#r(e)}#r(e){for(let t of this.#t)t(e);Promise.resolve(this.afterDecision()).catch(()=>{})}includes(e){return this.fields.targets.some(t=>_3(t,e))}#i(e){Object.assign(this.fields,{index:e,review:void 0,error:void 0,notice:void 0,busy:!1,phase:`loading`}),this.reload()}async#a(e){let t=this.fields,n=t.review;if(!n||t.busy)return;t.busy=!0,t.error=void 0,t.notice=void 0;let r=this.#e,i=await S3(this.api,n,e);i.status===`decided`&&this.announce(i.review),r===this.#e&&(t.busy=!1,i.status===`decided`?this.skip():i.status===`stale`?(t.review=i.review,t.notice=C3):t.error=i.error)}},E3={review:e=>El(`configuration.review`,e),decide:e=>El(`configuration.decide`,e)},D3=new T3(U(w3()),E3,()=>g3.refresh());$n(`configuration.decided`,e=>{let t=Si.safeParse(e.data);t.success&&D3.received(t.data)}),D3.onDecision(e=>{e.target.kind===`skill`&&Mt()});function O3(e,t=0){D3.start(e,t)}function k3(e){return D3.onDecision(e)}function A3(e,t){let n=Object.entries(t.provenance).filter(([,e])=>e.source===`requirement`).map(([e])=>e),r=(e,t)=>e===t||e.startsWith(`${t}/`)||t.startsWith(`${e}/`);return ta(e).map(([e])=>e).filter(e=>/^\/(tools|skills|subagents)\//.test(e)).filter(e=>!n.some(t=>{let n=/^\/skills\/defaults\/([^/]+)$/.exec(t);return r(e,t)||!!(n&&r(e,`/skills/${n[1]}`))})).map(e=>`/overrides${e}`)}async function j3(){let e=si();if(e)return e.clipboard.readText();let t=globalThis.navigator?.clipboard;if(t?.readText)return t.readText();throw Error(`Clipboard API is not available.`)}function M3(e,t,n){if(e.type===`review-profile`)n?.(e.name);else if(e.type===`source`)e.actionId===`open_pull_requests`?(Zd(`pull-requests`,$d.isCompact),Xd(`pull-requests`)):Vt();else switch(e.item.kind){case`skill`:t(`skills`);break;case`tool`:t(`tools`);break;case`agent_profile`:t(`agents`);break;default:t(`sub-agents`)}}var N3=O(`<div aria-live="polite"><span class="activity-sr svelte-owdlt8"> </span> <span aria-hidden="true"> </span></div>`);function P3(e,n){c(n,!0);let r=K(n,`recording`,3,!1),i=K(n,`transcribing`,3,!1),a=K(n,`elapsedMs`,3,0),o=K(n,`maxDurationMs`,3,1),s=K(n,`retryAttempt`,3,0),u=K(n,`maxRetries`,3,0),d=K(n,`class`,3,``),p=L(()=>r()||i()),m=L(()=>As(a())),h=L(()=>As(o())),g=L(()=>Math.max(0,Math.min(1,o()>0?a()/o():0))),_=L(()=>t(g)>=.85),v=L(()=>r()?`${t(m)} / ${t(h)}`:s()>0?`Retry ${s()}/${u()}`:`Transcribing…`),y=L(()=>r()?`Recording ${t(m)} of ${t(h)}`:s()>0?`Retrying transcription ${s()} of ${u()}`:`Transcribing audio`);var b=f(),S=R(b),C=e=>{var n=N3(),i=q(n),a=z(i,!0),o=G(i,2),s=z(o,!0);x(n),F(()=>{X(n,1,`transcription-activity ${d()}`,`svelte-owdlt8`),J(n,`data-state`,r()?`recording`:`transcribing`),J(n,`data-near-limit`,t(_)?`true`:void 0),w(a,t(y)),w(s,t(v))}),k(e,n)};l(S,e=>{t(p)&&e(C)}),k(e,b),D()}var F3=48e4;ga({text:Hi()});function I3(){return{recording:!1,transcribing:!1,error:void 0,elapsedMs:0,retryAttempt:0,starting:!1,stopping:!1}}function L3(e){return e instanceof Error&&e.name===`AbortError`}function R3(e,t){return new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Transcription was cancelled.`,`AbortError`));return}let i=()=>{clearTimeout(a),t.removeEventListener(`abort`,i),r(new DOMException(`Transcription was cancelled.`,`AbortError`))},a=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})})}var z3=[500,1e3,2e3],B3=class{state;dependencies;callbacks;#e;#t;#n;#r;constructor(e,t,n){this.state=e,this.dependencies=t,this.callbacks=n}get pending(){return this.state.starting||this.state.stopping||this.state.transcribing}#i(e){return this.#e===e&&!e.signal.aborted}#a(e){let t=e instanceof Error?e.message:String(e);this.state.error=t,this.callbacks.onError?.(t)}#o(){clearInterval(this.#n),clearTimeout(this.#r),this.#n=void 0,this.#r=void 0}async start(){if(this.state.recording||this.pending)return;if(!this.dependencies.isSupported()){this.#a(`Audio recording is not supported in this browser.`);return}let e=new AbortController;this.#e=e,Object.assign(this.state,I3(),{starting:!0});let t;try{if(t=this.dependencies.createRecorder(),await t.start(),!this.#i(e)){await t.cancel();return}this.#t=t,this.state.recording=!0;let n=Date.now();this.#n=setInterval(()=>{this.#i(e)&&(this.state.elapsedMs=Math.min(Date.now()-n,this.dependencies.maxDurationMs))},250),this.#r=setTimeout(()=>{this.#i(e)&&this.state.recording&&this.stop()},this.dependencies.maxDurationMs)}catch(n){try{await t?.cancel()}catch{}this.#i(e)&&(this.#t=void 0,this.state.recording=!1,this.#a(n))}finally{this.#i(e)&&(this.state.starting=!1)}}async stop(){let e=this.#e,t=this.#t;if(!e||!t||this.state.stopping)return!1;this.#t=void 0,this.state.stopping=!0,this.#o();try{let n=await t.stop({maxDurationMs:this.dependencies.maxDurationMs});return this.#i(e)?(this.state.recording=!1,n.status===`skipped`?(this.callbacks.onSkipped?.(n.reason),!1):(this.state.elapsedMs=n.durationMs,await this.#s(e,n))):!1}catch(t){return this.#i(e)&&!L3(t)&&(this.state.recording=!1,this.#a(t)),!1}finally{this.#i(e)&&(this.state.stopping=!1,this.callbacks.onSettled?.())}}async cancel(){let e=this.#e;this.#e=void 0;let t=this.#t;this.#t=void 0,this.#o(),Object.assign(this.state,I3()),e?.abort(),await t?.cancel()}async#s(e,t){this.state.transcribing=!0,this.state.error=void 0,this.state.retryAttempt=0;try{for(let n=0;n<=this.dependencies.maxRetries;n+=1){if(!this.#i(e)||n>0&&(this.state.retryAttempt=n,await(this.dependencies.delay??R3)(z3[n-1]??2e3,e.signal),!this.#i(e)))return!1;try{let n=await this.dependencies.transcribe(t.blob,t.durationMs,e.signal);return!this.#i(e)||!n.trim()?!1:(this.callbacks.onTranscript(n),!0)}catch(t){if(!this.#i(e)||L3(t))return!1;if(n>=this.dependencies.maxRetries||!this.dependencies.isRetryable(t)){let e=t instanceof Error?t.message:String(t);return this.#a(n>=this.dependencies.maxRetries?`Transcription failed after ${this.dependencies.maxRetries} retries: ${e}`:e),!1}}}}catch(t){this.#i(e)&&!L3(t)&&this.#a(t)}finally{this.#i(e)&&(this.state.transcribing=!1,this.state.retryAttempt=0)}return!1}};function V3(e,t){if(!Number.isFinite(t)||t<=0)throw Error(`Sample rate must be positive and finite.`);let n=Math.max(1,Math.round(t*20/1e3)),r=10**(-45/10),i=t*60/1e3,a=t*300/1e3,o=-1,s=-1,c=0,l=0,u=e=>{o>=0&&e-o>=i&&(s<0&&(s=o),c=e,l+=e-o),o=-1};for(let t=0;t<e.length;t+=n){let i=Math.min(t+n,e.length),a=0;for(let n=t;n<i;n+=1)a+=e[n]*e[n];a/(i-t)>=r?o<0&&(o=t):u(t)}if(u(e.length),s<0)return{status:`skipped`,reason:`no-activity`};if(l<a)return{status:`skipped`,reason:`too-short`};let d=Math.round(t*200/1e3);return{status:`accepted`,samples:e.slice(Math.max(0,s-d),Math.min(e.length,c+d))}}var H3=16e3,U3=`audio/wav`,W3=4096;function G3(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function K3(e,t,n=H3){if(e.length===0)return new Float32Array;if(t===n)return new Float32Array(e);if(t<=0||n<=0)throw Error(`Sample rates must be positive.`);let r=Math.max(1,Math.round(e.length*n/t)),i=new Float32Array(r),a=t/n;for(let t=0;t<r;t+=1){let n=t*a,r=Math.floor(n),o=Math.min(r+1,e.length-1),s=n-r;i[t]=e[r]*(1-s)+e[o]*s}return i}function q3(e){let t=Math.max(-1,Math.min(1,e));return Math.round(t<0?t*32768:t*32767)}function J3(e,t,n){if(!n)return e;let r=Math.max(1,Math.round(t*n/1e3));return e.length<=r?e:e.slice(0,r)}function Y3(e,t=H3){let n=t*2,r=e.length*2,i=new ArrayBuffer(44+r),a=new DataView(i);X3(a,0,`RIFF`),a.setUint32(4,36+r,!0),X3(a,8,`WAVE`),X3(a,12,`fmt `),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,n,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),X3(a,36,`data`),a.setUint32(40,r,!0);let o=44;for(let t of e)a.setInt16(o,q3(t),!0),o+=2;return new Uint8Array(i)}function X3(e,t,n){for(let r=0;r<n.length;r+=1)e.setUint8(t+r,n.charCodeAt(r))}function Z3(e){let t=e.numberOfChannels,n=e.length;if(t===1)return new Float32Array(e.getChannelData(0));let r=new Float32Array(n);for(let i=0;i<t;i+=1){let a=e.getChannelData(i);for(let e=0;e<n;e+=1)r[e]+=a[e]/t}return r}function Q3(){if(typeof window<`u`)return window.AudioContext??window.webkitAudioContext}function $3(e){try{return new e({sampleRate:H3})}catch{return new e}}var e6=class e{audioContext;processor;source;stream;chunks=[];stopped=!0;static isSupported(){return!!(typeof navigator<`u`&&navigator.mediaDevices?.getUserMedia&&Q3())}async start(){if(!e.isSupported())throw Error(`Audio recording is not supported in this browser.`);if(!this.stopped)throw Error(`Recording is already in progress.`);let t=Q3();if(!t)throw Error(`Web Audio is not supported in this browser.`);this.chunks=[],this.stopped=!1;try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:{ideal:1},sampleRate:{ideal:H3},sampleSize:{ideal:16},echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}}),this.audioContext=$3(t),this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(W3,1,1),this.processor.onaudioprocess=e=>{if(!this.stopped){this.chunks.push(Z3(e.inputBuffer));for(let t=0;t<e.outputBuffer.numberOfChannels;t+=1)e.outputBuffer.getChannelData(t).fill(0)}},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(e){throw await this.cleanup(),e}}async stop(e={}){if(this.stopped)throw Error(`No recording is in progress.`);this.stopped=!0;let t=this.audioContext?.sampleRate??16e3,n=this.chunks;this.chunks=[],await this.cleanup();let r=V3(J3(K3(G3(n),t,H3),H3,e.maxDurationMs),H3);if(r.status===`skipped`)return r;let i=Y3(r.samples,H3),a=new ArrayBuffer(i.byteLength);return new Uint8Array(a).set(i),{status:`accepted`,blob:new Blob([a],{type:U3}),durationMs:r.samples.length/H3*1e3,mimeType:U3}}async cancel(){this.stopped=!0,this.chunks=[],await this.cleanup()}async cleanup(){this.processor?.disconnect(),this.processor=void 0,this.source?.disconnect(),this.source=void 0,this.stream?.getTracks().forEach(e=>{e.stop()}),this.stream=void 0;let e=this.audioContext;this.audioContext=void 0,e&&e.state!==`closed`&&await e.close().catch(()=>void 0)}};function t6(e){return L3(e)?!1:e instanceof ot?!e.status||e.status===408||e.status===429||e.status>=500:!0}var n6=class e{#e=Y(U(I3()));#t;maxDurationMs=F3;maxRetries=3;constructor(t){this.#t=new B3(this.#e.v,{createRecorder:()=>new e6,isSupported:()=>e.isSupported(),transcribe:(e,t,n)=>s_(e,t,{signal:n}),isRetryable:t6,maxDurationMs:this.maxDurationMs,maxRetries:this.maxRetries},t)}static isSupported(){return e6.isSupported()}get recording(){return t(this.#e).recording}get transcribing(){return t(this.#e).transcribing}get error(){return t(this.#e).error}get elapsedMs(){return t(this.#e).elapsedMs}get retryAttempt(){return t(this.#e).retryAttempt}get pending(){return this.#t.pending}toggle(){this.recording?this.stop():this.start()}start(){return this.#t.start()}stop(){return this.#t.stop()}cancel(){return this.#t.cancel()}};function r6(e){return`${e.kind}:${e.id}`}function i6(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function a6(e,t){let n=t.trim();return n?`${e}${e.trim()?/\s$/.test(e)?``:`
144
+
145
+ `:``}${n} `:e}var o6=new class{state;dependencies;#e;#t=new Map;#n;constructor(e,t){this.state=e,this.dependencies=t,this.#n=t.createController({onTranscript:e=>this.#a(e),onError:e=>this.#i(e),onSettled:()=>{this.state.activeTarget=void 0},onSkipped:e=>{this.state.activeTarget&&t.notifyInfo(e===`no-activity`?`No speech detected`:`Recording too short`)}})}get activeTarget(){return this.state.activeTarget}get recording(){return this.#n.recording}get transcribing(){return this.#n.transcribing}get pending(){return this.state.starting||this.#n.pending}get elapsedMs(){return this.#n.elapsedMs}get retryAttempt(){return this.#n.retryAttempt}get maxDurationMs(){return this.#n.maxDurationMs}get maxRetries(){return this.#n.maxRetries}isSupported(){return this.dependencies.isSupported()}isTargetActive(e){return i6(this.state.activeTarget,e)}isBusyForOtherTarget(e){return!(!this.state.activeTarget||i6(this.state.activeTarget,e))}registerTargetHandlers(e,t){let n=r6(e);return this.#t.set(n,t),()=>{this.#t.get(n)===t&&this.#t.delete(n)}}async toggle(e){this.isTargetActive(e)&&this.recording?await this.stop(e):await this.start(e)}async start(e){if(this.state.activeTarget)return!1;if(!this.isSupported())return this.#i(`Audio recording is not supported in this browser.`,e),!1;let t={};this.#e=t,this.state.activeTarget=e,this.state.starting=!0;try{await this.#n.start()}finally{this.#e===t&&(this.state.starting=!1)}return this.#e===t?!this.#n.recording&&!this.#n.pending?(i6(this.state.activeTarget,e)&&(this.state.activeTarget=void 0),!1):!0:!1}async stop(e){let t=this.state.activeTarget;if(!t||e&&!i6(t,e)||!this.#n.recording||this.#n.pending)return!1;let n=this.#e;try{let e=await this.#n.stop();return this.#e===n&&e}finally{this.#e===n&&(this.state.activeTarget=void 0)}}async cancel(e){let t=this.state.activeTarget;(!e||i6(t,e))&&(this.#e=void 0,this.state.activeTarget=void 0,this.state.starting=!1,await this.#n.cancel())}async cancelIfTarget(e){this.isTargetActive(e)&&await this.cancel(e)}async cancelIfTargets(e){let t=this.state.activeTarget;t&&e.some(e=>i6(t,e))&&await this.cancel(t)}#r(e=this.state.activeTarget){return e?this.#t.get(r6(e)):void 0}#i(e,t=this.state.activeTarget){let n=this.#r(t)?.onError;n?n(e):this.dependencies.notifyError(e)}#a(e){let t=this.state.activeTarget;if(!t)return;let n=this.#r(t);n?.appendTranscript&&n.appendTranscript(e)}}(U({activeTarget:void 0,starting:!1}),{createController:e=>new n6(e),isSupported:()=>n6.isSupported(),notifyError:e=>ui.error(`Voice input failed`,{description:e}),notifyInfo:e=>ui.message(e)});function s6(e){return o6.cancelIfTargets(e)}var c6=O(`<!> <span> </span>`,1),l6=O(`<span class="line-clamp-3"> </span>`),u6=O(`<span class="line-clamp-3 whitespace-pre-wrap"> </span>`),d6=O(`<span class="line-clamp-2 opacity-80"> </span>`),f6=O(`<div class="grid gap-1"><span class="font-medium"> </span> <!> <!> <span class="opacity-80"> </span></div>`),p6=O(`<!> <!>`,1),m6=O(`<div class="flex flex-wrap gap-1" role="group" aria-label="Suggested prompt actions"></div>`);function h6(e,n){c(n,!0);let r=K(n,`suggestions`,19,()=>[]),i=K(n,`running`,3,!1),a=L(()=>i()?`Click to queue — sends when the agent finishes · Right-click to add to the composer`:`Click to send · Right-click to add to the composer`);var o=f(),s=R(o),u=e=>{var i=f(),o=R(i);H(o,()=>En,(e,i)=>{i(e,{delayDuration:700,skipDelayDuration:0,disableHoverableContent:!0,children:(e,i)=>{var o=m6();v(o,21,r,e=>e.id,(e,r)=>{let i=L(()=>t(r).icon??kt);var o=f(),s=R(o);H(s,()=>wn,(e,o)=>{o(e,{children:(e,o)=>{var s=p6(),c=R(s);{let e=(e,o)=>{let s=()=>(o?.()).props;{let o=L(()=>`${t(r).label}. ${t(a)}`);Q(e,P(s,{type:`button`,variant:`outline`,class:`text-muted-foreground hover:text-foreground`,get"aria-label"(){return t(o)},onclick:()=>n.onSend?.(t(r)),oncontextmenu:e=>{e.preventDefault(),n.onDraft?.(t(r))},children:(e,n)=>{var a=c6(),o=R(a);H(o,()=>t(i),(e,t)=>{t(e,{class:`size-3.5 text-primary`,strokeWidth:2.2,"aria-hidden":`true`})});var s=G(o,2),c=z(s,!0);F(()=>w(c,t(r).label)),k(e,a)},$$slots:{default:!0}}))}};H(c,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var u=G(c,2);H(u,()=>Sn,(e,n)=>{n(e,{side:`top`,sideOffset:4,class:`max-w-sm`,children:(e,n)=>{var i=f6(),o=q(i),s=z(o,!0),c=G(o,2),u=e=>{var n=l6(),i=z(n,!0);F(()=>w(i,t(r).description)),k(e,n)},d=e=>{var n=u6(),i=z(n,!0);F(()=>w(i,t(r).prompt)),k(e,n)};l(c,e=>{t(r).description?e(u):e(d,-1)});var f=G(c,2),p=e=>{var n=d6(),i=z(n,!0);F(()=>w(i,t(r).context)),k(e,n)};l(f,e=>{t(r).context&&e(p)});var m=G(f,2),h=z(m,!0);x(i),F(()=>{w(s,t(r).label),w(h,t(a))}),k(e,i)},$$slots:{default:!0}})}),k(e,s)},$$slots:{default:!0}})}),k(e,o)}),x(o),k(e,o)},$$slots:{default:!0}})}),k(e,i)};l(s,e=>{r().length>0&&e(u)}),k(e,o),D()}var g6=O(`<!> <span> </span>`,1),_6=O(`<div class="suggestion-row flex gap-1.5 overflow-x-auto svelte-8rwvse" role="group" aria-label="Suggested prompt actions"></div>`);function v6(e,n){c(n,!0);let r=K(n,`suggestions`,19,()=>[]),i=K(n,`running`,3,!1);var a=f(),o=R(a),s=e=>{var a=_6();v(a,21,r,e=>e.id,(e,r)=>{let a=L(()=>t(r).icon??kt);{let o=L(()=>`${t(r).label}. ${i()?`Tap to queue — sends when the agent finishes.`:`Tap to send.`} Long-press to edit first.`);Q(e,{type:`button`,variant:`outline`,class:`flex-none text-muted-foreground`,get"aria-label"(){return t(o)},onclick:()=>n.onSend?.(t(r)),oncontextmenu:e=>{e.preventDefault(),n.onDraft?.(t(r))},children:(e,n)=>{var i=g6(),o=R(i);H(o,()=>t(a),(e,t)=>{t(e,{class:`size-3.5 text-primary`,strokeWidth:2.2,"aria-hidden":`true`})});var s=G(o,2),c=z(s,!0);F(()=>w(c,t(r).label)),k(e,i)},$$slots:{default:!0}})}}),x(a),k(e,a)};l(o,e=>{r().length>0&&e(s)}),k(e,a),D()}function y6(e){let t=e.hasProject&&e.hasConversation,n=!(!e.interactive||!t||e.blockedForReview||e.compacting||e.stopping),r=n&&e.hasModels;return{hasTarget:t,canEdit:n,canPrompt:r,canSubmit:r&&!e.voiceSubmitPending,canConfigureRuntime:!(!e.interactive||!t||e.compacting||e.stopping)}}function b6(e){return/\s/.test(e)?`"${e.replaceAll(`"`,`\\"`)}"`:e}function x6(e,t,n){return e.length===0?[]:e.map(e=>{let r=n(e).trim();if(!r)throw Error(`Could not resolve the native path for ${e.name||`a dropped item`}.`);return b6(jc(r,t)??r)})}async function S6(e){try{return await e.slice(0,1).arrayBuffer(),!0}catch{return!1}}async function C6(e,t){if(t.getPathForFile){if(!t.projectDir)throw Error(`Native file paths are unavailable in this window.`);return x6(e,t.projectDir,t.getPathForFile)}let n=0,r=await Promise.all(e.map(async e=>{if(!await S6(e))n+=1;else try{return await t.upload(e)}catch(n){t.notifyError(`Could not attach ${e.name||`file`}`,n instanceof Error?n.message:String(n));return}}));return n>0&&t.notifyInfo(`Folders can only be dropped in the desktop app`),r.filter(e=>!!e)}async function w6(e){return El(`skill.list`,{projectId:e})}var T6=U({slashCompletions:[],toolRisks:{}}),E6=U({paths:[]});function D6(e){return e.length===0?!0:b4()?(E6.paths=[...E6.paths,...e],!0):!1}function O6(){let e=E6.paths;return E6.paths=[],e}function k6(e,t,n,r){return e.registerTargetHandlers(t,{appendTranscript:e=>{r?.chip.resolve(e)?n.focus():e.trim()&&(n.update(a6(n.read(),e)),n.focus())},onError:r?e=>{r.chip.fail()||r.notifyError(e)}:void 0})}var A6=O(`<div><!></div>`),wie=O(`<div><div class="min-w-0 flex-1 overflow-hidden"><!></div> <!></div>`),j6=O(`<!> <!>`,1);function Tie(e,r){c(r,!0);let i=K(r,`text`,3,``),a=K(r,`pendingConversationActive`,3,!1),o=K(r,`approvals`,19,()=>[]),s=K(r,`pendingUserQuestions`,19,()=>[]),u=K(r,`pendingPlanReviews`,19,()=>[]),d=K(r,`interactive`,3,!0),f=K(r,`sending`,3,!1),p=K(r,`stoppable`,3,!1),m=K(r,`stopping`,3,!1),h=K(r,`compacting`,3,!1),g=K(r,`models`,19,()=>[]),_=K(r,`selectedModelKey`,3,``),v=K(r,`contextWindow`,3,0),y=K(r,`focusToken`,3,0),b=K(r,`composerEscapeToken`,3,0),S=K(r,`micShortcutToken`,3,0),C=K(r,`thinkingLevel`,3,`off`),w=K(r,`agentProfile`,3,da),E=K(r,`agentProfiles`,19,()=>[]),O=K(r,`profileDisabled`,3,!1),A=K(r,`permissionRuleSetId`,3,`autonomous`),j=K(r,`permissionRuleSets`,19,()=>[]),M=K(r,`permissionRuleSetsLoading`,3,!1),N=K(r,`slashCompletions`,19,()=>[]),P=K(r,`composerSuggestions`,19,()=>[]),ee=K(r,`historyOpen`,3,!1),ne=Y(void 0),re=io(),z=re?v6:h6,ie=Y(0);W(()=>{let e=t(ne);if(!e)return;let n=()=>{let t=getComputedStyle(e);B(ie,Math.max(0,e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)),!0)},r=new ResizeObserver(n);return n(),r.observe(e),()=>r.disconnect()});let ae=Y(U(me(()=>+!!a()))),V=Y(!1),oe,se,H,ce=Y(!1),le=Y(U([])),ue=Y(void 0),de=Y(!1),fe=0,he=L(()=>JSON.stringify([r.activeProject?.id,r.activeConversation?.id??r.activePendingConversation?.id,r.activePendingConversation?.explicitAgentProfile])),J=L(()=>r.composerView?.resolution?{resolution:r.composerView.resolution,overrides:r.composerView.overrides,role:`lead`}:void 0),ge=L(()=>K4.profiles(r.activeProject?.id).filter(e=>e.usableBy!==`lead`).map(e=>({name:e.name,label:e.label,whenToUse:e.whenToUse,defaultEnabled:e.defaultEnabled,error:e.error})));async function _e(){let e=r.activeConversation,t=r.activePendingConversation;if(!Us.progressiveActive||!r.activeProject||!e&&!t)return;let n=++fe,i=r.activeProject.id;B(de,!0);try{let e=await w6(i);n===fe&&B(le,e.skills,!0)}catch(e){if(n!==fe)return;B(ue,e instanceof Error?e.message:String(e),!0)}finally{n===fe&&B(de,!1)}}W(()=>{Us.progressiveActive&&(t(he),me(()=>{fe+=1,B(le,[],!0),B(ue,void 0),_e()}))}),W(()=>{Us.progressiveActive&&r.activeProject&&Gee().then(e=>{HU(UU(e)),T6.toolRisks=Object.fromEntries(e.map(e=>[e.name,Gi(e.baseRisk)]))}).catch(()=>void 0)});async function ve(e,t=[]){await r.composerView?.patchCapabilities(e,t)}function Z(){if(!t(J))return;let e=A3(t(J).overrides,t(J).resolution);if(e.length)return ve({},e)}let ye=dr(`composer.toggleMic`),be=xr(`composer.toggleMic`),xe=dr(`composer.cancelMic`),Se=dr(`composer.cycleProfile`),Ce=xr(`composer.cycleProfile`),we=dr(`composer.cyclePermission`),Te=xr(`composer.cyclePermission`),Ee=dr(`composer.stopRun`),De=dr(`conversation.toggleHistory`),Oe=xr(`composer.stopRun`),ke=L(()=>{if(r.activeConversation)return{kind:`conversation`,id:r.activeConversation.id};if(r.activePendingConversation)return{kind:`pending-conversation`,id:r.activePendingConversation.id}}),Ae=Y(void 0);W(()=>{if(!t(Ae)||E6.paths.length===0||b4()!==r.composerView)return;let e=O6();t(Ae).insertReferences(e.map(e=>cA(e)))});let je=new UK(()=>t(Ae),()=>{t(ke)&&o6.cancel(t(ke))});W(()=>{let e=t(ke);if(e)return k6(o6,e,{read:()=>i(),update:e=>r.onChange?.(e),focus:()=>{B(ae,t(ae)+1)}},{chip:je,notifyError:e=>ui.error(`Voice input failed`,{description:e})})});let Me=L(()=>!!(t(ke)&&o6.isTargetActive(t(ke))&&o6.recording)),Ne=L(()=>!!(t(ke)&&o6.isTargetActive(t(ke))&&o6.transcribing)),Pe=L(()=>!!(t(ke)&&o6.isBusyForOtherTarget(t(ke))));W(()=>{let e={recording:t(Me),transcribing:t(Ne),elapsedMs:t(Me)||t(Ne)?o6.elapsedMs:0};me(()=>je.sync(e))}),pe(()=>je.discard());let Fe=L(()=>o().length>0),Ie=L(()=>s().length>0),Le=L(()=>u().length>0),Re=L(()=>t(Fe)||t(Ie)||t(Le)),ze=L(()=>y6({interactive:d(),hasProject:!!r.activeProject,hasConversation:!!(r.activeConversation||a()),hasModels:g().length>0,blockedForReview:t(Re),compacting:h(),stopping:m(),voiceSubmitPending:t(V)})),Be=L(()=>t(ze).canPrompt),Ve=L(()=>!t(ze).canEdit),He=L(()=>!t(ze).canSubmit),Ue=L(()=>Zc.configured),We=L(()=>!!si()?.files),Ge=L(()=>o6.isSupported()),Ke=L(()=>!t(Ne)&&(!!r.editorOverlay||!d()||m()||!t(ke)||o6.pending||!t(Me)&&(!t(Be)||!t(Ge)||t(Pe)))),qe=L(()=>t(Ne)?`Cancel transcription${xe?` (${xe})`:` (Esc)`}${o6.retryAttempt>0?` — retry ${o6.retryAttempt}/${o6.maxRetries}`:``}`:t(Me)?`Stop recording${ye?` (${ye})`:``} — ${xe??`Esc`} to cancel; right-click to cancel (${As(o6.elapsedMs)} / ${As(o6.maxDurationMs)})`:t(Pe)?`Voice recording is active in another conversation`:t(Ue)?ye?`Record voice prompt (${ye})`:`Record voice prompt`:`Connect ChatGPT to use voice input`),Je=L(()=>t(V)?`Transcribing and sending prompt`:t(Me)?`Transcribe and send prompt`:h()?`Compacting context`:t(ze).canEdit&&g().length===0?`Waiting for an available model`:f()?`Queue prompt`:`Send prompt`),Ye=L(()=>t(V)?`Transcribing audio, then sending prompt`:t(Me)?`Stop recording, transcribe, and send prompt`:h()?`Compacting context`:t(ze).canEdit&&g().length===0?`Models are loading; you can continue drafting`:f()?`Queue prompt for the next agent turn`:`Send prompt`);async function Xe(){if(t(ze).canSubmit){if(t(Me)&&t(ke)){B(V,!0);try{await o6.stop(t(ke))&&r.onSubmit?.()}finally{B(V,!1)}}else r.onSubmit?.()}}function Ze(e){let t=XI(`/${e}`);switch(t?.name){case`plan`:r.onAgentProfileChange?.(`planning`);break;case`compact`:r.onCompact?.();break;case`abort`:r.onAbort?.();break;case`new`:r.activeProject&&kd(r.activeProject.dir);break;case`profile`:r.onAgentProfileChange?.(t.profile)}}function Qe(e){M3(e,e=>r.onOpenCapabilitySettings?.(e),et)}let $e=L(()=>W4(K4.profiles(r.activeProject?.id)).map(e=>({name:e.name,label:e.label,whenToUse:e.whenToUse,source:e.source})));function et(e){let t=r.activeProject?.id,n=W4(K4.profiles(t)).flatMap(e=>e.source===`user`?[{kind:`agent-profile`,scope:`user`,id:e.name}]:e.source===`project`&&t?[{kind:`agent-profile`,scope:`project`,projectId:t,id:e.name}]:[]),i=n.findIndex(t=>t.id===e);O3(n,Math.max(0,i))}async function tt(e){return Dd(e)}async function nt(e){try{return await C6(e,{getPathForFile:si()?.files?.getPathForFile,projectDir:r.activeProject?.dir,upload:Dd,notifyError:(e,t)=>ui.error(e,{description:t}),notifyInfo:e=>ui.message(e)})}catch(e){let t=e instanceof Error?e.message:String(e);throw ui.error(`Could not add dropped paths`,{description:t}),e}}async function rt(e){try{if(!e.type.startsWith(`image/`)&&t(We)){let[t]=await nt([e]);if(t)return t}return await Dd(e)}catch(t){let n=t instanceof Error?t.message:String(t);throw ui.error(`Could not attach ${e.name||`file`}`,{description:n}),t}}let it=L(()=>!d()||!(r.activeConversation||a())||m()||h()||t(Re)),at=L(()=>O()||!d()||!(r.activeConversation||a())),ot=L(()=>!t(ze).canConfigureRuntime),st=L(()=>t(ot)||g().length===0);function ct(){t(Ne)&&t(ke)?o6.cancel(t(ke)):!d()||t(Ke)||h()||m()||!t(ke)||(!t(Me)&&!t(Ue)?B(ce,!0):o6.toggle(t(ke)))}function Q(){return je.failed?(je.discard(),!0):!t(Me)&&!t(Ne)||!t(ke)?!1:(o6.cancel(t(ke)),!0)}W(()=>{oe===void 0||!d()?oe=y():y()!==oe&&(oe=y(),B(ae,t(ae)+1))}),W(()=>{se===void 0||!d()&&!t(Ne)?se=b():b()!==se&&(se=b(),Q()||B(ae,t(ae)+1))}),W(()=>{H===void 0||!d()&&!t(Ne)?H=S():S()!==H&&(H=S(),ct())});function lt(e){(t(Me)||t(Ne))&&t(ke)&&(e.preventDefault(),o6.cancel(t(ke)))}var ut=j6(),dt=R(ut);{let e=e=>{var i=wie();let a;var o=q(i),s=q(o),c=e=>{z(e,{get suggestions(){return P()},get running(){return f()},get onSend(){return r.onSendSuggestion},get onDraft(){return r.onDraftSuggestion}})};l(s,e=>{P().length>0&&!t(Re)&&!h()&&t(Be)&&e(c)}),x(o);var u=G(o,2),d=e=>{var t=A6(),i=q(t);n(i,()=>r.activity),x(t),F(()=>X(t,1,T([`relative shrink-0`,!re&&`-translate-y-1.5`]))),k(e,t)};l(u,e=>{r.activity&&e(d)}),x(i),te(i,e=>B(ne,e),()=>t(ne)),F(()=>{X(i,1,T([`@container/conversation-activity flex min-w-0 justify-between gap-2`,re?`items-center`:`items-start`])),a=I(i,``,a,{"--conversation-activity-width":`${t(ie)}px`})}),k(e,i)},a=e=>{var n=j6(),r=R(n),i=e=>{{let n=L(()=>t(ke)&&o6.isTargetActive(t(ke))?o6.retryAttempt:0);P3(e,{get recording(){return t(Me)},get transcribing(){return t(Ne)},get elapsedMs(){return o6.elapsedMs},get maxDurationMs(){return o6.maxDurationMs},get retryAttempt(){return t(n)},get maxRetries(){return o6.maxRetries},class:`composer-transcription-status`})}};l(r,e=>{t(Ae)||e(i)});var a=G(r,2);{let e=L(()=>t(Ue)?`Record voice prompt`:`Connect ChatGPT to use voice input`);HK(a,{get recording(){return t(Me)},get transcribing(){return t(Ne)},get disabled(){return t(Ke)},get title(){return t(qe)},get idleLabel(){return t(e)},get shortcutAria(){return be},onToggle:ct,onContextMenu:lt})}k(e,n)},o=L(()=>({text:i(),editorOverlay:r.editorOverlay,session:r.session,contextActions:r.contextActions,disabled:t(Ve),editorDisabled:t(Ve),submitDisabled:t(He),sending:f(),stopping:m(),compacting:h(),showStop:f()||m()||h()||p(),pendingApproval:t(Fe),pendingQuestion:t(Ie),pendingPlan:t(Le),models:g(),selectedModelKey:_(),thinkingLevel:C(),agentProfile:w(),agentProfiles:E(),pendingAgentProfiles:t($e),lockedFields:r.lockedFields,permissionRuleSetId:A(),permissionRuleSets:j(),permissionRuleSetsLoading:M(),permissionRuleSetsError:r.permissionRuleSetsError,contextUsage:r.contextUsage,conversationUsage:r.conversationUsage,agentUsage:r.agentUsage,agentUsageLoading:r.agentUsageLoading,agentUsageError:r.agentUsageError,contextWindow:v(),placeholder:t(Fe)?`Approval required before the agent can continue`:t(Le)?`Review the plan in the transcript before the agent can continue`:t(Ie)?`Reply in the transcript before the agent can continue`:h()?`Compacting context…`:f()?`Queue a prompt for the next agent turn`:`Ask the local Nerve agent`,focusToken:t(ae),controlsDisabled:t(it),profileDisabled:t(at),modelDisabled:t(st),capabilityDisabled:t(ot),sendAriaLabel:t(Je),sendTitle:t(Ye),stopAriaLabel:h()?`Stop compaction`:`Stop generation`,stopShortcutAria:Oe,stopTitle:m()?h()?`Stopping compaction`:`Stopping generation`:h()?Ee?`Stop compaction (${Ee})`:`Stop compaction`:Ee?`Stop generation (${Ee})`:`Stop generation`,permissionShortcut:we,permissionShortcutAria:Te,profileShortcut:Se,profileShortcutAria:Ce,historyOpen:ee(),historyShortcut:De,slashCompletions:N(),completionSource:r.completionSource,capabilityConfiguration:t(J),capabilitySkills:t(le),capabilityLoading:t(de)||r.composerView?.status===`loading`||r.composerView?.saving,capabilityError:r.composerView?.error??t(ue),capabilityScopeKey:t(he),capabilitySubagentProfiles:t(ge),subagentControlsEnabled:d()&&!r.activeConversation?.parentConversationId,capabilities:{voice:!0,imagePaste:!0,fileDrop:!0,completions:!0,suggestions:!0,shortcuts:!0,queueing:!0}})),s=L(()=>({onComposerChange:r.onChange,onSubmit:Xe,onAbort:r.onAbort,onCompact:r.onCompact,onUsageOpenChange:r.onUsageOpenChange,onUsageRetry:r.onUsageRetry,onOpenRequestPreview:r.onOpenRequestPreview,onToggleHistory:r.onToggleHistory,onModelSelectionChange:r.onModelSelectionChange,onAgentProfileChange:r.onAgentProfileChange,onPermissionRuleSetChange:r.onPermissionRuleSetChange,onRefreshPermissionRuleSets:r.onRefreshPermissionRuleSets,onOpenPermissionSettings:r.onOpenPermissionSettings,onOpenCapabilitySettings:r.onOpenCapabilitySettings,onCapabilityPatch:(e,t)=>void ve(e,t),onResetCapabilities:()=>void Z(),onRefreshCapabilities:()=>void _e(),onPasteImage:tt,onDropFiles:nt,onAttachFile:rt,onSlashCommand:Ze,onReviewAgentProfile:et,onCompletionAction:Qe,onEditorReady:e=>B(Ae,e,!0),onReadClipboardText:j3,onWriteClipboardText:ri,onClipboardError:e=>ui.error(`Could not ${e} using the clipboard`)}));BV(dt,{get model(){return t(o)},get actions(){return t(s)},header:e,sendLeading:a,$$slots:{header:!0,sendLeading:!0}})}var ft=G(dt,2);gl(ft,{get open(){return t(ce)},set open(e){B(ce,e,!0)}}),k(e,ut),D()}var Eie=`needs-review`,Die=e=>e.split(/[\\/]/).pop()??e,Oie=e=>/[\\/]rule-sets[\\/][^\\/]+$/.test(e);function kie(e,t){let n=[];for(let r of e){if(r.code!==Eie||r.scope===`conversation`)continue;let e=r.path||r.document,i=Die(e),a=Oie(e),o=a?`rule-set`:`permission-overlay`,s=a?i.replace(/\.json$/,``):i;r.scope===`user`?n.push({kind:o,scope:`user`,id:s}):t&&n.push({kind:o,scope:`project`,projectId:t,id:s})}return n}async function M6(e,t){let n=await El(`conversation.previewAgentProfile`,{conversationId:e,profile:t});if(n.status!==`ready`)throw Error(`Profile unavailable. Refresh and try again.`);let r=await El(`conversation.setAgentProfile`,{conversationId:e,action:`switch`,targetProfile:n.preview.targetProfile,expectedRevision:n.preview.expectedRevision,expectedDigest:n.preview.expectedDigest});if(r.status!==`applied`)throw Error(`Profile ${r.status}. Refresh and try again.`);return r}var Aie=3e4,N6=new Map;function jie(e,t=Date.now()){N6.set(e,t+Aie)}function Mie(e,t=Date.now()){let n=N6.get(e);return n!==void 0&&(N6.delete(e),n>=t)}function Nie(e){N6.delete(e)}function Pie(e,t){return e.filter(e=>e.turnId!==t)}var Fie=new Set([`stdout`,`stderr`,`combined`]),Iie=e=>{let t=typeof document<`u`&&document.hidden;if(!t&&typeof requestAnimationFrame==`function`){let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)}let n=setTimeout(e,t?250:16);return()=>clearTimeout(n)},Lie=class{commit;schedule;blocks=new Map;toolOutput={};toolStreams={};hasToolOutput=!1;cancel;disposed=!1;constructor(e,t=Iie){this.commit=e,this.schedule=t}get pending(){return this.blocks.size>0||this.hasToolOutput}text(e,t,n){this.block(e,t).text+=n,this.arm()}thinking(e,t,n){this.block(e,t).thinking+=n,this.arm()}toolCall(e,t,n){this.block(e,t).toolCall=n,this.arm()}progress(e,t,n){if(n&&!Fie.has(n)){let r=this.toolStreams[e]??={};r[n]=(r[n]??``)+t}else this.toolOutput[e]=(this.toolOutput[e]??``)+t;this.hasToolOutput=!0,this.arm()}flush(){if(this.disarm(),!this.pending)return;let e={blocks:[...this.blocks.values()],toolOutput:this.toolOutput,toolStreams:this.toolStreams};this.blocks=new Map,this.toolOutput={},this.toolStreams={},this.hasToolOutput=!1,this.commit(e)}dropTurn(e){for(let[t,n]of this.blocks)n.turnId===e&&this.blocks.delete(t);this.settle()}dropToolOutput(e){delete this.toolOutput[e],delete this.toolStreams[e],this.hasToolOutput=Object.keys(this.toolOutput).length>0||Object.keys(this.toolStreams).length>0,this.settle()}clear(){this.blocks=new Map,this.toolOutput={},this.toolStreams={},this.hasToolOutput=!1,this.disarm()}dispose(){this.disposed=!0,this.clear()}block(e,t){let n=`${e}\0${t}`,r=this.blocks.get(n);return r||(r={turnId:e,contentIndex:t,text:``,thinking:``},this.blocks.set(n,r)),r}arm(){this.disposed||this.cancel||(this.cancel=this.schedule(()=>{this.cancel=void 0,this.flush()}))}disarm(){this.cancel?.(),this.cancel=void 0}settle(){this.pending||this.disarm()}};function Rie(e,t){if(t.length===0)return e;let n=[...e];for(let e of t){let t=n.findIndex(t=>t.turnId===e.turnId&&t.contentIndex===e.contentIndex);if(t<0){n.push({...e});continue}let r=n[t];n[t]={...r,text:r.text+e.text,thinking:r.thinking+e.thinking,toolCall:e.toolCall??r.toolCall}}return n}var zie=class{finalized=new Set;active=new Set;accept(e){return!this.finalized.has(e)&&(this.active.add(e),!0)}finalize(e){this.active.delete(e),this.finalized.add(e)}finalizeActive(){for(let e of this.active)this.finalized.add(e);this.active.clear()}recover(e){this.active.clear(),this.finalized.clear();for(let t of e)this.finalized.add(t)}};function Bie(e,t){return!e||t.revision>e.revision?t:e}async function Vie(e,t,n=()=>!1){let r=await e({limit:t}),i=P6(r),a=r.length>0,o;for(;a&&!n();){let n=i[0];if(!n)break;try{let r=await e({beforeEventId:n.id,limit:t}),o=new Set(i.map(e=>e.id));if(i=[...P6(r).filter(e=>!o.has(e.id)),...i],a=r.length>0,i[0]?.id===n.id)break}catch(e){o=e instanceof Error?e.message:String(e);break}}return{events:i,hasOlder:a,headEventId:r[0]?.id??null,error:o}}function P6(e){return[...e].sort((e,t)=>e.sequence-t.sequence)}var Hie=1e3,Uie=3e5,Wie=class{conversationId;#e=Y();get effective(){return t(this.#e)}set effective(e){B(this.#e,e,!0)}#t=Y();get configuration(){return t(this.#t)}set configuration(e){B(this.#t,e,!0)}#n=Y();get snapshot(){return t(this.#n)}set snapshot(e){B(this.#n,e,!0)}#r=Y(U([]));get events(){return t(this.#r)}set events(e){B(this.#r,e,!0)}#i=Y();get historyEvents(){return t(this.#i)}set historyEvents(e){B(this.#i,e,!0)}#a=Y([]);get liveBlocks(){return t(this.#a)}set liveBlocks(e){B(this.#a,e)}#o=Y({});get toolOutput(){return t(this.#o)}set toolOutput(e){B(this.#o,e)}#s=Y({});get toolStreams(){return t(this.#s)}set toolStreams(e){B(this.#s,e)}#c=Y();get activity(){return t(this.#c)}set activity(e){B(this.#c,e,!0)}#l=Y(0);get responseRevision(){return t(this.#l)}set responseRevision(e){B(this.#l,e,!0)}#u=Y(!1);get stopping(){return t(this.#u)}set stopping(e){B(this.#u,e,!0)}#d=Y(!1);get loading(){return t(this.#d)}set loading(e){B(this.#d,e,!0)}#f=Y(!0);get hasOlder(){return t(this.#f)}set hasOlder(e){B(this.#f,e,!0)}#p=Y(!1);get connected(){return t(this.#p)}set connected(e){B(this.#p,e,!0)}#m=Y();get error(){return t(this.#m)}set error(e){B(this.#m,e,!0)}#h=Y(!1);get deleted(){return t(this.#h)}set deleted(e){B(this.#h,e,!0)}disposed=!1;configurationGeneration=0;liveTurns=new zie;liveDeltas=new Lie(e=>this.commitLive(e));refreshing;historyRefresh;historyDirty=!1;buffered=[];unobserve;constructor(e){this.conversationId=e,this.unobserve=yl({recover:e=>e&&e!==this.conversationId?Promise.resolve():this.recover(),disconnected:()=>{this.connected=!1},event:e=>{e.conversationId===this.conversationId&&(this.refreshing?this.buffered.push(e):this.append(e))},notice:e=>{if(e.type===`agentConfiguration.changed`){let t=e.data.scope;(t.scope===`user`||t.scope===`project`&&t.projectId===this.snapshot?.conversation.projectId||t.scope===`conversation`&&t.conversationId===this.conversationId)&&this.refreshConfiguration().catch(e=>{this.error=LK(e)});return}let t=e.type===`conversation.changed`?e.data.summary.id:`conversationId`in e.data?e.data.conversationId:void 0,n=e.type===`conversation.changed`&&e.data.summary.parentConversationId===this.conversationId,r=(e.type===`conversation.changed`||e.type===`conversation.deleted`)&&this.snapshot?.children.some(e=>e.id===t),i=this.refreshing&&(e.type===`conversation.changed`||e.type===`conversation.deleted`);(t===this.conversationId||n||r||i)&&(this.refreshing?this.buffered.push(e):this.applyNotice(e))},unavailable:e=>{e===this.conversationId&&this.markDeleted()}})}async open(){await this.recover(),this.disposed||await bl(this.conversationId)}recover(){return this.disposed||!xl()?Promise.resolve():(this.refreshing||=(this.loading=!0,this.error=void 0,this.loadSnapshot().catch(e=>{throw this.error=LK(e),e}).finally(()=>{this.refreshing=void 0,this.loading=!1;let e=this.buffered;if(this.buffered=[],!this.disposed)for(let t of e)`sequence`in t?this.append(t):this.applyNotice(t)})),this.refreshing)}async loadSnapshot(){let e=this.refreshConfiguration();e.catch(()=>void 0);let t=await El(`conversation.getSnapshot`,{conversationId:this.conversationId}),n=await this.fetchHistory();await e,this.disposed||(t.conversation.headEventId=n.headEventId,this.clearLive(),this.snapshot=t,this.publishHistory(n),this.liveTurns.recover(this.events.flatMap(e=>e.type===`assistant_message`&&e.turnId?[e.turnId]:[])),this.connected=!0,this.deleted=!1,Tl(this.conversationId,t.lastSequence))}append(e){this.historyEvents&&!this.historyEvents.some(t=>t.id===e.id)&&(this.historyEvents=[...this.historyEvents,e]);let t=this.snapshot;if(t){if(!this.events.some(t=>t.id===e.id)){if(e.previousEventId!==t.conversation.headEventId)return;this.events=[...this.events,e],t.conversation.headEventId=e.id}t.lastSequence=Math.max(t.lastSequence,e.sequence),e.type===`assistant_message`&&(e.turnId&&(this.liveTurns.finalize(e.turnId),this.liveDeltas.dropTurn(e.turnId)),this.liveBlocks=this.liveBlocks.filter(t=>t.turnId!==e.turnId)),e.type===`tool_call_response`&&(t.toolCalls=t.toolCalls.filter(t=>t.id!==e.payload.toolCallId),this.dropToolOutput(e.payload.toolCallId)),e.inputId&&(t.queue=t.queue.filter(t=>t.inputId!==e.inputId)),e.type===`system_event`&&e.payload.subtype===`execution_state`&&[`completed`,`failed`,`cancelled`,`interrupted`].includes(e.payload.transition)&&(this.liveTurns.finalizeActive(),this.clearLive())}}applyNotice(e){let t=this.snapshot;switch(e.type){case`conversation.deleted`:e.data.conversationId===this.conversationId?this.markDeleted():t&&(t.children=t.children.filter(t=>t.id!==e.data.conversationId));break;case`conversation.changed`:if(!t)break;if(e.data.summary.id===this.conversationId)T_(t.conversation,e.data.summary,!1);else{let n=e.data.summary,r=t.children.find(e=>e.id===n.id);r&&n.parentConversationId===this.conversationId?T_(r,n,!0):(t.children=t.children.filter(e=>e.id!==n.id),n.parentConversationId===this.conversationId&&t.children.push(n))}break;case`conversation.head`:t&&t.conversation.headEventId!==e.data.headEventId&&(t.conversation.headEventId=e.data.headEventId,this.liveTurns.finalizeActive(),this.clearLive(),this.refreshHistory().catch(e=>{this.error=LK(e)}));break;case`conversation.compaction`:t&&(t.compaction=Bie(t.compaction,e.data.compaction));break;case`conversation.config`:t&&(t.config=e.data.config);break;case`conversation.queue`:t&&(t.queue=e.data.queue);break;case`conversation.asyncBash`:t&&(t.asyncBash=e.data.asyncBash);break;case`conversation.toolCall`:{if(!t)break;let n=e.data.toolCall;t.toolCalls=t.toolCalls.filter(e=>e.id!==n.id),`removed`in n?this.dropToolOutput(n.id):t.toolCalls.push(n);break}case`conversation.live`:this.applyLive(e.data.delta)}}applyLive(e){e.type===`execution_activity`?this.activity=e.activity:e.type===`assistant_reset`?(this.liveDeltas.dropTurn(e.turnId),this.liveBlocks=Pie(this.liveBlocks,e.turnId),this.responseRevision+=1):e.type===`tool_progress`?this.liveDeltas.progress(e.toolCallId,e.update.chunk,e.update.stream):!this.disposed&&!this.deleted&&this.snapshot&&[`running`,`waiting`].includes(this.snapshot.conversation.status)&&this.liveTurns.accept(e.turnId)&&(e.type===`assistant_text`?this.liveDeltas.text(e.turnId,e.contentIndex,e.delta):e.type===`assistant_thinking`?this.liveDeltas.thinking(e.turnId,e.contentIndex,e.delta):this.liveDeltas.toolCall(e.turnId,e.contentIndex,{providerCallId:e.providerCallId,name:e.name,partialArgsText:e.partialArgsText}))}commitLive(e){if(!this.disposed){if(e.blocks.length&&(this.liveBlocks=Rie(this.liveBlocks,e.blocks)),Object.keys(e.toolOutput).length){let t={...this.toolOutput};for(let[n,r]of Object.entries(e.toolOutput))t[n]=(t[n]??``)+r;this.toolOutput=t}if(Object.keys(e.toolStreams).length){let t={...this.toolStreams};for(let[n,r]of Object.entries(e.toolStreams)){let e={...t[n]};for(let[t,n]of Object.entries(r))e[t]=((e[t]??``)+n).slice(-64e3);t[n]=e}this.toolStreams=t}}}dropToolOutput(e){if(this.liveDeltas.dropToolOutput(e),e in this.toolStreams){let t={...this.toolStreams};delete t[e],this.toolStreams=t}if(!(e in this.toolOutput))return;let t={...this.toolOutput};delete t[e],this.toolOutput=t}clearLive(){this.liveDeltas.clear(),this.liveBlocks=[],this.toolOutput={},this.toolStreams={},this.activity=void 0}refreshHistory(){return this.historyDirty=!0,this.historyRefresh||=(async()=>{for(;this.historyDirty&&!this.disposed;){this.historyDirty=!1;let e=this.snapshot?.conversation.headEventId,t=await this.fetchHistory();if(this.disposed)return;e===this.snapshot?.conversation.headEventId?this.publishHistory(t):this.historyDirty=!0}})().finally(()=>{this.historyRefresh=void 0}),this.historyRefresh}async fetchHistory(){let e=await Vie(e=>El(`conversation.getHistory`,{conversationId:this.conversationId,...e}),Hie,()=>this.disposed);return e.error&&(this.error=e.error),e}publishHistory({events:e,hasOlder:t}){this.events=e,this.historyEvents&&=[...Object.values(Object.fromEntries([...this.historyEvents,...e].map(e=>[e.id,e])))].sort((e,t)=>e.sequence-t.sequence),this.hasOlder=t}submit(e,t=Fd(`input`)){return El(`input.submit`,{conversationId:this.conversationId,inputId:t,text:e,source:`user`})}async refreshConfiguration(){let e=++this.configurationGeneration,[t,n]=await Promise.all([El(`agentConfiguration.getEffective`,{conversationId:this.conversationId}),El(`agentConfiguration.get`,{scope:{scope:`conversation`,conversationId:this.conversationId}})]);this.disposed||e===this.configurationGeneration&&(this.effective=t,this.configuration=n)}async configure(e,t=[]){let{model:n,reasoningLevel:r,permissionRuleSetId:i,systemPrompt:a,instructions:o,workingDirectory:s}=e,c={...a===void 0?{}:{systemPrompt:a},...o===void 0?{}:{instructions:o},...s===void 0?{}:{workingDirectory:s}};if(n!==void 0||r!==void 0||i!==void 0||t.length){let e=this.configuration;if(e?.status!==`available`)throw Error(`Configuration unavailable. Refresh and try again.`);let a=await El(`agentConfiguration.save`,{scope:{scope:`conversation`,conversationId:this.conversationId},expectedRevision:e.source.revision,expectedDigest:e.source.digest,changes:{...n===void 0?{}:{model:n},...r===void 0?{}:{reasoningLevel:r},...i===void 0?{}:{permissionRuleSetId:i}},resets:t});if(await this.refreshConfiguration(),a.status!==`saved`)throw Error(`Configuration ${a.status}. Refresh and try again.`)}Object.keys(c).length&&await El(`conversation.configure`,{conversationId:this.conversationId,patch:c})}async setAgentProfile(e){try{await M6(this.conversationId,e)}finally{await this.refreshConfiguration()}}update(e){return El(`conversation.update`,{conversationId:this.conversationId,patch:e})}control(e){return e===`stop`?(jie(this.conversationId),this.stopping=!0,El(`conversation.${e}`,{conversationId:this.conversationId}).finally(()=>this.stopping=!1)):El(`conversation.${e}`,{conversationId:this.conversationId})}cancelCompaction(){return El(`conversation.cancelCompaction`,{conversationId:this.conversationId})}retryResponse(){return El(`conversation.retryResponse`,{conversationId:this.conversationId})}cancelInput(e){return El(`input.cancel`,{inputId:e})}async moveInputToComposer(e){let t=this.snapshot?.queue.find(t=>t.inputId===e);if(!t||typeof t.content!=`string`)throw Error(`Queued prompt is unavailable`);return await this.cancelInput(e),t.content}async resolve(e,t,n=Fd(`input`)){let r=await El(`interaction.resolve`,{toolCallId:e,resolutionRequestId:n,resolution:t});return r.status===`applied`&&await this.refreshConfiguration(),r.status===`refresh_required`&&await this.recover(),r}selectHead(e){return El(`conversation.selectHead`,{conversationId:this.conversationId,eventId:e})}fork(e){return El(`conversation.fork`,{conversationId:this.conversationId,eventId:e},{timeoutMs:Uie})}async loadHistoryTree(){this.historyEvents??=[...this.events];let e=0;for(;!this.disposed;){let t=await El(`conversation.getEventsSince`,{conversationId:this.conversationId,sequence:e});if(this.disposed||t.length===0)return;let n=Math.max(...t.map(e=>e.sequence));if(n<=e)throw Error(`History replay did not advance`);let r=Object.fromEntries([...t,...this.historyEvents??[]].map(e=>[e.id,e]));this.historyEvents=Object.values(r).sort((e,t)=>e.sequence-t.sequence),e=n}}tree(){return El(`conversation.getTree`,{conversationId:this.conversationId})}cancelAsyncBash(e){return El(`asyncBash.cancel`,{bashId:e})}delete(){return El(`conversation.delete`,{conversationId:this.conversationId})}markDeleted(){this.deleted=!0,this.snapshot=void 0,this.events=[],this.clearLive(),Sl(this.conversationId).catch(()=>void 0)}dispose(){this.disposed=!0,this.liveDeltas.dispose(),this.unobserve(),Sl(this.conversationId).catch(()=>void 0)}},F6=new yo;function I6(e){return me(()=>{let t=F6.get(e);if(!t){let n=new Wie(e);t={store:n,users:0,ready:n.open()},F6.set(e,t)}t.users+=1;let n=t,r=!1;return{store:n.store,ready:n.ready,release(){r||(r=!0,--n.users,n.users===0&&(F6.delete(e),n.store.dispose()))}}})}function Gie(){return[...F6.values()].map(e=>e.store)}function Kie(e,t){let n=new Map,r=[...e.queue].sort((e,t)=>e.acceptanceSequence-t.acceptanceSequence);for(let[i,a]of r.entries()){let r=!1;for(let e of t)e.createdAt>=a.acceptedAt||e.type===`system_event`&&e.payload.subtype===`execution_state`&&(r=![`completed`,`failed`,`cancelled`,`interrupted`].includes(e.payload.transition));let o=e.toolCalls.length>0,s=t.some(e=>e.type===`user_message`&&e.inputId!==a.inputId&&e.createdAt>=a.acceptedAt);n.set(a.inputId,i>0||r||o||s?`waiting`:`starting`)}return n}function L6(e,t,n,r){let i=e.get(t);if(i&&i.deps.every((e,t)=>Object.is(e,n[t])))return i.value;let a=r();return e.set(t,{deps:n,value:a}),a}var qie=new WeakMap,Jie=new WeakMap;function R6(e){return typeof e==`string`?e:!e||typeof e!=`object`||Array.isArray(e)?``:`content`in e&&typeof e.content==`string`?e.content:`contentBlocks`in e&&Array.isArray(e.contentBlocks)?e.contentBlocks.flatMap(e=>e?.type===`text`&&typeof e.text==`string`?[e.text]:[]).join(`
146
+ `):``}function z6(e){let t={id:e.id,conversationId:e.conversationId,agentId:e.conversationId,parentEntryId:e.previousEventId??void 0,runId:e.turnId??void 0,turnId:e.turnId??void 0,kind:`message`,role:`system`,text:``,createdAt:e.createdAt};switch(e.type){case`user_message`:return{...t,role:`user`,inputId:e.inputId??void 0,text:e.payload.originalText};case`assistant_message`:return{...t,role:`assistant`,liveMessageId:e.id,text:e.payload.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
147
+ `)||(e.payload.content.some(e=>e.type===`toolCall`)?`[Tool call: `+e.payload.content.filter(e=>e.type===`toolCall`).map(e=>e.name).join(`, `)+`]`:``),usage:{...e.payload.usage,cost:e.payload.usage.cost.total},details:{thinkingBlocks:e.payload.content.filter(e=>e.type===`thinking`).map(e=>({text:e.thinking,redacted:e.redacted})),content:e.payload.content.map(e=>e.type===`thinking`?{...e,text:e.thinking}:e),stopReason:e.payload.stopReason,errorMessage:e.payload.errorMessage}};case`tool_call_response`:return{...t,kind:`tool_result`,text:R6(e.payload.userProjection.resultPreview),details:{toolCallId:e.payload.providerCallId,toolRecordId:e.payload.toolCallId,toolName:e.payload.toolName,isError:e.payload.outcome===`failed`}};case`compaction`:return{...t,kind:`compaction`,text:e.payload.summary,summary:e.payload.summary,tokensBefore:e.payload.tokensBefore,firstKeptEntryId:e.payload.firstKeptEventId??void 0,details:e.payload.details};case`system_event`:{let n=e.payload;return n.subtype===`execution_state`?{...t,runId:n.transition===`started`?e.id:n.executionId,kind:`run_status`,text:n.failure?.message??n.retry?.error??``,details:{type:`agent_run_retry_status`,state:n.retry?.exhausted?`retry_exhausted`:n.transition,errorMessage:n.failure?.message??n.retry?.error,failureCategory:n.failure?.category,attempt:n.retry?.attempt,maxRetries:n.retry?.maxAttempts,delayMs:n.retry?.delayMs,retryAt:n.retry?new Date(Date.parse(e.createdAt)+n.retry.delayMs).toISOString():void 0}}:n.subtype===`task_result`&&n.task.kind===`bash`?{...t,kind:`task_result`,text:n.text,details:{type:`task_result`,event:n.outcome,status:n.outcome,exitCode:n.task.exitCode,output:n.text}}:{...t,kind:n.subtype===`task_result`?`subagent_run_event`:`message`,text:n.text,details:n}}}}function B6(e,t,n){return L6(Jie,t,[`state`in t?`${t.state}:${t.updatedAt}`:void 0,e.conversation.projectId,e.conversation.id,e.config.workingDirectory,n,T6.toolRisks[`payload`in t?t.payload.toolName:t.toolName]],()=>Yie(e,t,n))}function Yie(e,t,n){let r=`state`in t,i=r?t:t.payload,a=r?t.state===`running`?`running`:t.state===`awaiting_input`||t.state===`awaiting_approval`?`waiting`:`committed`:t.payload.outcome===`indeterminate`?`failed`:t.payload.outcome,o=r?t.updatedAt:t.createdAt,s;if(r&&t.interaction&&!t.interaction.resolution){let e=t.interaction,n={status:`pending`,requestedAt:t.updatedAt,updatedAt:t.updatedAt};e.kind===`configuration_blocked`&&(s={...n,kind:`configuration_blocked`,request:e.request}),e.kind===`approval`&&(s={...n,kind:`approval`,request:{risk:i.supervision?.effectiveRisk??T6.toolRisks[t.toolName],reason:e.request.reason,offeredScopes:[`single_call`,`always_conversation`,`always_project`,`always_user`],suggestedExceptions:[],suggestedRules:e.request.suggestedRules.flatMap(e=>{let t=Yi.safeParse(e);return t.success?[t.data]:[]})}}),e.kind===`user_input`&&(s={...n,kind:`user_input`,request:{...e.request,required:!0}}),e.kind===`plan_review`&&(s={...n,kind:`plan_review`,request:{planPath:e.request.path,title:e.request.title,summary:e.request.summary,slug:t.id,allowNewConversation:!1}})}return{id:r?t.id:t.payload.toolCallId,projectId:e.conversation.projectId,conversationId:e.conversation.id,agentId:e.conversation.id,toolName:i.toolName,argsPreview:r?t.arguments:t.payload.userProjection.argsPreview,error:!r&&t.payload.outcome===`failed`?R6(t.payload.userProjection.resultPreview):void 0,resultPreview:r?void 0:t.payload.userProjection.resultPreview,previewOverflow:r?void 0:t.payload.userProjection.previewOverflow,status:a,phase:a===`committed`?`drafted`:a===`running`||a===`waiting`?`executing`:a,risk:i.supervision?.effectiveRisk??T6.toolRisks[i.toolName],supervision:i.supervision?{decision:i.supervision.decision,reason:i.supervision.reason,effectiveRisk:i.supervision.effectiveRisk,operations:i.supervision.operations}:void 0,supervising:r&&t.state===`supervising`?!0:void 0,startedAt:r?t.state===`running`?t.updatedAt:void 0:t.payload.startedAt,cwd:e.config.workingDirectory,revision:1,attempt:1,interaction:s,providerToolCallId:i.providerCallId??void 0,contentIndex:i.contentIndex??void 0,turnId:t.turnId??void 0,runId:n,liveMessageId:i.assistantEventId??void 0,createdAt:o,updatedAt:o,settledAt:r?void 0:o}}function Xie(e,t){let n=E2(e.compaction,{conversationId:e.conversation.id,headEventId:e.conversation.headEventId,pathEventIds:new Set(t.map(e=>e.id))});return n?{compaction:n}:void 0}function V6(e){let{snapshot:t,events:n}=e,r=n.filter(e=>!(e.type===`system_event`&&e.payload.subtype===`notification`&&e.payload.producer.startsWith(`agent-profile:`))&&!(e.type===`system_event`&&e.payload.subtype===`execution_state`&&[`started`,`waiting`,`completed`,`cancelled`].includes(e.payload.transition))),i=new Map,a;for(let e of n)e.type===`system_event`&&e.payload.subtype===`execution_state`&&(a=e.payload.transition===`started`?e.id:e.payload.executionId),e.turnId&&a&&i.set(e.turnId,a);let o=r.map(e=>{let n=e.type===`system_event`&&e.payload.subtype===`task_result`&&e.payload.task.kind===`bash`?e.payload.task.id:void 0,r=n?t.asyncBash.find(e=>e.id===n)?.command:void 0,a=e.turnId?i.get(e.turnId)??e.turnId:void 0;return L6(qie,e,[a,r],()=>{let t=z6(e);return r!==void 0&&(t.details={...t.details,command:r,commandPreview:r.split(`
148
+ `)[0]}),a&&(t.runId=a),t})}),s=new Map,c=Kie(t,n),l=t.queue.filter(e=>e.source===`user`).map(e=>({id:e.inputId,presentation:c.get(e.inputId),agentId:t.conversation.id,conversationId:t.conversation.id,projectId:t.conversation.projectId,text:typeof e.content==`string`?e.content:e.content.text,behavior:`follow-up`,status:`queued`,createdAt:e.acceptedAt,updatedAt:e.acceptedAt})),u=n.findLast(e=>e.type===`system_event`&&e.payload.subtype===`execution_state`),d=n.findLast(e=>e.type===`system_event`&&e.payload.subtype===`execution_state`&&e.payload.transition===`started`),f=u?.type===`system_event`&&u.payload.subtype===`execution_state`&&u.payload.transition!==`started`?u.payload.executionId:d?.id,p=f??t.conversation.id,m=e=>e?i.get(e)??p:p;for(let e of n)e.type===`tool_call_response`&&s.set(e.payload.toolCallId,B6(t,e,m(e.turnId??void 0)));for(let e of t.toolCalls)s.set(e.id,B6(t,e,m(e.turnId??void 0)));let h=t.conversation.status===`running`||t.conversation.status===`waiting`,g=u?.type===`system_event`&&u.payload.subtype===`execution_state`?u.payload.transition:void 0,_=!h&&d&&u&&g&&[`completed`,`failed`,`cancelled`,`interrupted`].includes(g)?{runId:p,startedAt:d.createdAt,endedAt:u.createdAt,outcome:g===`completed`?`completed`:g===`cancelled`?`stopped`:`failed`}:void 0,v=e.tree?.length?e.tree:n.map(e=>({id:e.id,previousEventId:e.previousEventId,type:e.type,preview:z6(e).text,createdAt:e.createdAt})),y=new Map(o.map(e=>[e.id,e])),b=new Map;for(let e of v){if(!e.previousEventId)continue;let t=b.get(e.previousEventId);t?t.push(e.id):b.set(e.previousEventId,[e.id])}let x=v.map(e=>({entry:y.get(e.id)??{id:e.id,conversationId:t.conversation.id,parentEntryId:e.previousEventId??void 0,role:e.type===`user_message`?`user`:e.type===`assistant_message`?`assistant`:`system`,kind:`message`,text:e.preview,createdAt:e.createdAt},childEntryIds:b.get(e.id)??[]})),S=[],C=[],w=[];for(let e of t.toolCalls){let n=e.interaction;if(!n||n.resolution)continue;let r={id:e.id,toolCallId:e.id,agentId:t.conversation.id,conversationId:t.conversation.id,projectId:t.conversation.projectId,requestedAt:e.updatedAt,updatedAt:e.updatedAt};n.kind===`approval`&&S.push({...r,risk:e.supervision?.effectiveRisk??T6.toolRisks[e.toolName],reason:n.request.reason,status:`pending`,offeredScopes:[`single_call`,`always_conversation`,`always_project`,`always_user`],suggestedExceptions:[],suggestedRules:n.request.suggestedRules.flatMap(e=>{let t=Yi.safeParse(e);return t.success?[t.data]:[]}),toolCall:s.get(e.id)}),n.kind===`user_input`&&C.push({...r,...n.request,status:`pending`}),n.kind===`plan_review`&&w.push({...r,slug:e.id,targetProfile:n.request.targetProfile,planPath:n.request.path,title:n.request.title,summary:n.request.summary,content:n.request.content,status:`pending`})}return{entries:o,toolCalls:[...s.values()],treeNodes:x,run:{running:h,status:t.conversation.status===`waiting`?`waiting`:`running`,runId:f,startedAt:d?.createdAt??t.conversation.updatedAt,conversationId:t.conversation.id,projectId:t.conversation.projectId,updatedAt:t.conversation.updatedAt},lastRunOutcome:_,queuedPrompts:l,approvals:S,pendingUserQuestions:C,pendingPlanReviews:w,sending:h,transient:Xie(t,n),optimisticMessages:[],recoveryIssues:n.flatMap(e=>e.type===`tool_call_response`&&e.payload.outcome===`indeterminate`?[{id:e.id,conversationId:e.conversationId,code:`outcome_unknown`,message:R6(e.payload.userProjection.resultPreview),actions:[`inspect`],createdAt:e.createdAt,proposalId:e.payload.toolCallId}]:[])}}function Zie(e){let{run:t,queuedPrompts:n,liveBlocks:r,toolOutput:i}=e,a=e.toolStreams??{};if(!t.running)return;let o=t.runId??r[0]?.turnId??t.conversationId,s=t.startedAt;return{runId:o,conversationId:t.conversationId,agentId:t.conversationId,projectId:t.projectId,status:t.status,startedAt:s,turns:[...new Set(r.map(e=>e.turnId))].map((e,t)=>({turnId:e,ordinal:t,messages:[{liveMessageId:e,messageOrdinal:0,startedAt:s,blocks:r.filter(t=>t.turnId===e).flatMap(t=>t.toolCall?[{kind:`tool_call_draft`,contentBlockId:`${e}:${t.contentIndex}`,contentIndex:t.contentIndex,providerToolCallId:t.toolCall.providerCallId,toolName:t.toolCall.name,argsText:t.toolCall.partialArgsText,progressRevision:0,done:!1}]:[{kind:t.thinking?`thinking`:`text`,contentBlockId:`${e}:${t.contentIndex}`,contentIndex:t.contentIndex,text:t.thinking||t.text,done:!1}])}]})),toolOutputsByToolCallId:Object.fromEntries([...new Set([...Object.keys(i),...Object.keys(a)])].map(e=>{let n=Object.entries(a[e]??{}).map(([e,n])=>({stream:e,text:n,ts:t.updatedAt}));return[e,{toolCallId:e,text:i[e]??n.map(e=>e.text).join(``),chunks:n,updatedAt:t.updatedAt}]})),queuedPrompts:n}}var H6=new WeakMap;function Qie(e,t){let n=[];for(let r of e){if(r.type===`text`){n.push(r);continue}let e=t.contentBlocks?.findIndex(e=>e.type===`image`&&e.assetId===r.assetId);if(e===void 0||e<0)return;let i=t.contentBlocks?.[e];n.push({type:`image`,mimeType:r.mimeType,byteLength:i?.type===`image`?i.byteLength??0:0,resultContentBlockIndex:e})}return{version:1,blocks:n}}async function U6(e){for(let t of Gie()){let n=t.snapshot;if(!n)continue;let r=Object.values(Object.fromEntries([...t.historyEvents??[],...t.events].map(e=>[e.id,e]))).sort((e,t)=>e.sequence-t.sequence),i=V6({snapshot:n,events:r}).toolCalls.find(t=>t.id===e);if(!i)continue;let a=H6.get(t);a||(a=new Map,H6.set(t,a));let o=a.get(e),s=`${i.status}:${i.updatedAt}`;if(o?.signature===s)return o.loading;let c=r.find(t=>t.type===`tool_call_response`&&t.payload.toolCallId===e),l=c?.type===`tool_call_response`?c.payload.arguments:n.toolCalls.find(t=>t.id===e)?.arguments,u=(async()=>{let n=c?await El(`toolCall.getDetails`,{conversationId:t.conversationId,toolCallId:e}):void 0,r=n?.result,a=new TextEncoder().encode(r===void 0?``:JSON.stringify(r)),o={...i};return delete o.argsPreview,delete o.previewOverflow,delete o.resultPreview,{bytes:a,details:{toolCall:{...o,args:l,result:r,agentPreview:n?Qie(n.agentProjection,n.result):void 0,error:i.status===`failed`?r?.content??i.error:i.error},completeResult:{status:n?`inline`:`unavailable`,hasResult:!!n,byteLength:a.length,mediaType:`application/json`,encoding:`utf-8`}}}})();return a.set(e,{signature:s,loading:u}),u.catch(()=>{a.get(e)?.loading===u&&a.delete(e)}),u}throw Error(`Tool call is outside the loaded conversation history`)}async function $ie(e){return(await U6(e)).details}async function eae(e,t,n=65536){let{details:r,bytes:i}=await U6(e),a=Math.min(i.length,t+n);for(;a>t&&a<i.length&&(i[a]&192)==128;)--a;if(a===t&&a<i.length)for(a+=1;a<i.length&&(i[a]&192)==128;)a+=1;return{status:r.completeResult.status,totalBytes:i.length,byteOffset:t,nextByteOffset:a,text:new TextDecoder().decode(i.slice(t,a)),done:a>=i.length}}function W6(e,t){let n={projectId:e,...t?{conversationId:t}:{}};return{search:(e,t)=>nr(`completion.search`,{...n,q:e,limit:Math.min(t?.limit??21,21)}),async select(e,t){if(!e.documentId||!e.version)throw Error(`Completion expired; search again`);return(await nr(`completion.select`,{...n,documentId:e.documentId,expectedVersion:e.version,action:t})).item},subscribe(n){let r=$n(`completion.changed`,r=>{let i=mi.safeParse(r.data);i.success&&i.data.projectId===e&&i.data.conversationId===t&&n()}),i=tr(n);return()=>{r(),i()}}}}var G6=new Map;function tae(e){let t=Wo.projectId;if(!t)return Promise.resolve(void 0);let n=`${t}\0${e}`,r=G6.get(n);return r||(r=Td(t,e).then(e=>e.type===`image`&&!e.truncated&&e.dataBase64?`data:${e.mimeType};base64,${e.dataBase64}`:void 0).catch(()=>{G6.delete(n)}),G6.set(n,r)),r}function nae(e){return{canCompactPlanBeforeImplementation:!1,previewAgentProfile:(e,t)=>El(`conversation.previewAgentProfile`,{conversationId:e,profile:t}),resolveConfigurationBlocked:async(e,t)=>{if((await El(`interaction.resolve`,{toolCallId:e,resolutionRequestId:Fd(`input`),resolution:{kind:`configuration_blocked`,decision:t}})).status!==`resolved`)throw Error(`Configuration is still blocked. Repair the document and retry.`)},reviewConfigurationBlock:e=>{let t=kie(e,Wo.projectId);t.length&&O3(t)},askUserDrafts:Id(),fetchToolCall:e=>$ie(e),readToolCallResult:(e,t,n)=>eae(e,t,n),subagents:e,openConversation:e=>{Rd(e).catch(e=>ui.error(e instanceof Error?e.message:String(e)))},imageSource:tae,voice:{session:o6,targetKey:r6,appendTranscriptText:a6,chatGptConfigured:()=>Zc.configured,micShortcutLabel:dr(`composer.toggleMic`),micShortcutAria:xr(`composer.toggleMic`),AudioAuthDialog:gl},askReply:{pasteImage:Dd,dropFiles:e=>{let t=si(),n=Ds.projects.find(e=>e.id===Wo.projectId);return C6(e,{getPathForFile:t?.files?.getPathForFile,projectDir:n?.directory,upload:Dd,notifyError:(e,t)=>ui.error(e,{description:t}),notifyInfo:e=>ui.message(e)})},completionSource:({projectId:e,conversationId:t})=>W6(e,t),onCompletionAction:e=>M3(e,e=>void Vt(e)),readClipboardText:j3,writeClipboardText:ri,onClipboardError:e=>ui.error(`Could not ${e} using the clipboard`)}}}function rae(e,n){c(n,!0);let r=K(n,`projectSelected`,3,!1),i=L(()=>n.availableProfiles?.length?B0.filter(e=>n.availableProfiles.includes(e.profile)):B0);{let a=L(()=>r()?`Pick how you want to work.`:`Bring a project. We'll bring the momentum.`),o=L(()=>!r());lH(e,{variant:`launchpad`,title:`Let's give this repo a plot twist.`,get message(){return t(a)},get projectLabel(){return n.projectLabel},get projectPath(){return n.projectPath},get projectId(){return n.projectId},get starters(){return t(i)},get defaultStarter(){return n.defaultProfile},get startersDisabled(){return t(o)},onSelectStarter:e=>n.onNewChat(e.profile),get review(){return n.review}})}D()}function iae(e){if(e.trust>0)return`trust`;if(e.conversations>0)return`conversation`}function K6(e){return e?e===`now`?`just now`:`${e} ago`:``}function q6(e){return`${e} waiting for your review`}var aae=O(`<span class="attention-ring pointer-events-none absolute inset-0 rounded-full text-warning" aria-hidden="true"></span>`),oae=O(`<div class="pointer-events-auto relative min-w-0" role="presentation"><!> <div class="flex h-control max-w-full items-center overflow-hidden rounded-full border border-warning-strong bg-popover shadow-overlay" role="status"><div class="flex h-full min-w-0 items-center bg-warning-subtle pr-0.5"><button type="button" class="flex h-full min-w-0 cursor-pointer items-center gap-2 rounded-full pr-1.5 pl-3 text-ui font-medium text-foreground hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus"><!> <span class="truncate tabular-nums"> </span></button> <!></div></div></div>`),sae=O(`<div class="pointer-events-none absolute inset-x-0 top-0 z-10 h-14 bg-linear-to-b from-background via-background to-transparent" aria-hidden="true"></div> <div class="pointer-events-none absolute inset-x-0 top-0 z-20 flex justify-center px-3 pt-3" data-attention-island=""><!></div>`,1);function cae(e,n){c(n,!0);let r=K(n,`pulse`,3,0),i=K(n,`pulsing`,3,!1),a=K(n,`openLabel`,3,`show the list`),o=L(()=>q6(n.count)),s=Y(!1);W(()=>{r(),B(s,!1)});function u(e,t){if(Tc.current)return 0;let n=getComputedStyle(e).getPropertyValue(`--motion-enter-duration`);return(parseFloat(n)||0)*t}function d(e){return{duration:u(e,1.6),easing:nd,css:e=>`opacity: ${Math.min(1,e*2)}; transform: translateY(${(1-e)*-10}px) scale(${.92+.08*e});`}}function f(e){return{duration:u(e,.6),easing:ed,css:e=>`opacity: ${e}; transform: translateY(${(1-e)*-6}px) scale(${.96+.04*e});`}}var p=sae(),m=R(p),g=G(m,2),_=q(g);C(_,r,e=>{var r=oae(),c=q(r),u=e=>{var t=aae();k(e,t)};l(c,e=>{i()&&!t(s)&&e(u)});var f=G(c,2),p=q(f),m=q(p),g=q(m);Dw(g,{class:`size-3.5 shrink-0 text-warning`,"aria-hidden":`true`});var _=G(g,2),v=z(_,!0);x(m);var y=G(m,2);Mn(y,{get icon(){return ye},label:`Later`,get onclick(){return n.onLater}}),x(p),x(f),x(r),F(()=>{J(m,`aria-label`,`${t(o)}, ${a()}`),w(v,t(o))}),M(`mouseenter`,r,()=>B(s,!0)),h(`click`,m,function(...e){n.onOpen?.apply(this,e)}),S(1,r,()=>d),k(e,r)}),x(g),S(3,m,()=>gc,()=>({duration:120})),S(2,g,()=>f),k(e,p),D()}ue([`click`]);function lae(){return{phase:`compact`,queue:[],trustArrivals:0,seenTrust:new Set,seenConversations:new Set,trustBaselines:new Set,conversationsBaselined:!1}}var uae=(e,t)=>Number(e.level!==`trust`)-Number(t.level!==`trust`);function J6(e,t){return{...e,phase:`arrival`,arrival:t,trustArrivals:e.trustArrivals+ +(t.level===`trust`)}}function Y6(e){if(e.phase!==`arrival`)return e;let[t,...n]=e.queue;return t?J6({...e,queue:n},t):{...e,phase:`compact`,arrival:void 0}}function X6(e,t){if(e.phase===`expanded`)return e;let n=e.phase===`later`?t.filter(e=>e.level===`trust`):t;if(!n.length)return e;let r=[...e.queue,...n].sort(uae);if(e.phase===`arrival`)return{...e,queue:r};let[i,...a]=r;return J6({...e,queue:a},i)}function dae(e,t,n){let r=new Set(e.seenTrust),i=n.filter(e=>!r.has(e));for(let e of n)r.add(e);return e.trustBaselines.has(t)?i.length?X6({...e,seenTrust:r},i.map(e=>({level:`trust`,key:e}))):e:{...e,seenTrust:r,trustBaselines:new Set([...e.trustBaselines,t])}}function fae(e,t,n){let r=new Set(e.seenConversations),i=t.filter(e=>!r.has(e.key));for(let e of t)r.add(e.key);return e.conversationsBaselined?i.length?X6({...e,seenConversations:r},i.filter(e=>e.conversationId!==n).map(e=>({level:`conversation`,key:e.key}))):e:{...e,seenConversations:r,conversationsBaselined:!0}}function pae(e,t){let n=e=>(e.level===`trust`?t.trust:t.conversations).has(e.key),r=e.queue.filter(n),i={...e,queue:r};return e.arrival&&!n(e.arrival)?Y6({...i,phase:`arrival`}):r.length===e.queue.length?e:i}function mae(e){return{...e,phase:`expanded`,arrival:void 0,queue:[]}}function hae(e){return e.phase===`expanded`?{...e,phase:`compact`}:e}function gae(e){return{...e,phase:`later`,arrival:void 0,queue:[]}}function _ae(e,t){return e.phase!==`later`&&t.trust+t.conversations>0}function vae(e,t){return e.phase!==`later`&&t>0}var yae=4e3,bae=2e3,Z6=new class{#e=Y(U(lae()));get state(){return t(this.#e)}set state(e){B(this.#e,e,!0)}#t=Y(U({}));get reviews(){return t(this.#t)}set reviews(e){B(this.#t,e,!0)}#n=!1;#r;#i=new Set;#a(e){let t=this.state;e!==t&&(this.state=e,e.phase===`arrival`&&(t.phase!==`arrival`||t.arrival!==e.arrival)?this.#o(yae):e.phase!==`arrival`&&clearTimeout(this.#r))}#o(e){clearTimeout(this.#r),this.#r=setTimeout(()=>{this.#n||this.#a(Y6(this.state))},e)}observeTrust(e,t){this.#a(dae(this.state,e,t))}observeConversations(e,t){this.#a(fae(this.state,e,t))}prune(e){this.#a(pae(this.state,e))}hover(e){this.#n=e,!e&&this.state.phase===`arrival`&&this.#o(bae)}expand(){this.#a(mae(this.state))}collapse(){this.#a(hae(this.state))}dismiss(){this.state.phase!==`later`&&this.#a({...this.state,phase:`compact`,arrival:void 0,queue:[]})}later(){this.#a(gae(this.state))}readReviews(e){let t=new Set(e.map(e=>e.key));Object.keys(this.reviews).some(e=>!t.has(e))&&(this.reviews=Object.fromEntries(Object.entries(this.reviews).filter(([e])=>t.has(e))));for(let{key:t,target:n}of e)this.#i.has(t)||(this.#i.add(t),El(`configuration.review`,n).then(e=>{this.reviews={...this.reviews,[t]:e}}).catch(()=>void 0).finally(()=>this.#i.delete(t)))}};function Q6(e){let t=e.conversations.filter(e=>!e.parentConversationId),n=new Map(t.map(e=>[e.id,e])),r=(t,r,i,a,o,s)=>{let c=n.get(t);return{id:a,kind:r,title:i,conversationId:t,conversationTitle:s??c?.title??``,projectId:c?.projectId,projectName:c?e.projectNameById[c.projectId]:void 0,at:o??c?.updatedAt??``,...c?.pendingInput?{pendingInput:c.pendingInput.kind}:{}}},i=Va({conversations:t,activityById:e.activityById}).needsYou.map(t=>{let n=e.activityById[t.conversationId];return r(t.conversationId,n?.indicator===`needs-user`?`attention`:`failed`,n?.indicator===`aborted`?`Agent interrupted`:n?.statusText??`Needs your attention`,t.id,t.at,t.title)}),a=t.filter(t=>e.activityById[t.id]?.indicator===`result-ready`).map(e=>r(e.id,`finished`,`Agent finished`,e.id));return[...i,...a]}var xae={"agent-preferences":vd,"agent-profile":_d,"rule-set":Wt,"permission-overlay":Wt,"launch-catalog":Qu,"mcp-servers":jt,skill:It,"prompt-suggestion":kt,extension:Ke},Sae={user_input:`asks a question`,approval:`waits for your approval`,configuration_blocked:`waits for your approval`,plan_review:`has a plan for you to review`};function Cae(e,t){return{kind:e.kind,scope:e.scope,...e.scope===`project`&&t?{projectId:t}:{},id:e.id}}var $6=new class{#e=L(()=>l3(g3.entries).review);get trustEntries(){return t(this.#e)}set trustEntries(e){B(this.#e,e)}#t=L(()=>this.trustEntries.map(e=>({key:e.key,target:Cae(e,g3.projectId)})));get trustItems(){return t(this.#t)}set trustItems(e){B(this.#t,e)}#n=L(()=>this.trustEntries.map(e=>{let t=Z6.reviews[e.key],n=t?.changedAt?K6(js(t.changedAt)):``;return{key:e.key,name:t?.name??e.id,kindLabel:t?.kindLabel??e3(e.kind),scopeLabel:e.scope===`project`?`Project`:`User`,icon:xae[e.kind],risk:t?.items.find(e=>e.broad)?.short,...t?{changed:[t.changedSinceDecision?`changed`:`added`,n].filter(Boolean).join(` `)}:{}}}));get trustRows(){return t(this.#n)}set trustRows(e){B(this.#n,e)}#r=L(()=>Q6({conversations:Xr.conversations,activityById:Xr.conversationActivityById,projectNameById:Object.fromEntries(Xr.projects.map(e=>[e.id,e.name]))}).filter(e=>e.kind===`attention`));get waiting(){return t(this.#r)}set waiting(e){B(this.#r,e)}#i=L(()=>this.waiting.map(e=>({key:e.id,conversationId:e.conversationId,title:e.conversationTitle||`Untitled conversation`,project:e.projectName,waits:e.pendingInput?Sae[e.pendingInput]:`needs your attention`,time:K6(js(e.at)),icon:e.pendingInput===`approval`||e.pendingInput===`configuration_blocked`?cT:Xw})));get conversationRows(){return t(this.#i)}set conversationRows(e){B(this.#i,e)}#a=L(()=>({trust:this.trustEntries.length,conversations:this.waiting.length}));get counts(){return t(this.#a)}set counts(e){B(this.#a,e)}#o=L(()=>{let e=Z6.state.arrival;if(!e)return;if(e.level===`trust`){let t=this.trustRows.find(t=>t.key===e.key);return t?{level:`trust`,row:t}:void 0}let t=this.conversationRows.find(t=>t.key===e.key);return t?{level:`conversation`,row:t}:void 0});get arrival(){return t(this.#o)}set arrival(e){B(this.#o,e)}review(e){let t=this.trustItems.map(e=>e.target),n=e?Math.max(0,this.trustItems.findIndex(t=>t.key===e)):0;Z6.dismiss(),O3(t,n)}openConversation(e){Z6.dismiss(),Rd(e.conversationId)}},e8={get fileViews(){return ef.fileViews},get mermaidViews(){return ef.mermaidViews},get openFileTabIds(){return ef.openFileTabIds}},t8={saveFileView:ote,setOpenFileTabIds(e){ef.openFileTabIds=e},restoreFileView(e,t){ef.fileViews[ls(e)]=t},restoreMermaidView(e,t){ef.mermaidViews[ss(e)]=t},discardFileView(e){delete ef.fileViews[ls(e)]},discardMermaidView(e){delete ef.mermaidViews[ss(e)]}};function wae(e,t,n){return`${e}:${encodeURIComponent(t)}:mermaid:${n.locator.startLine}:${n.locator.fingerprint}`}function Tae(e,t,n){return`${e}:inline-mermaid:${encodeURIComponent(t)}:${n.locator.ordinal}:${n.locator.fingerprint}`}function Eae(e,t,n){return Object.values(ef.mermaidViews).filter(r=>r.origin===`file`&&r.projectId===e&&r.path===t&&r.locator.fingerprint===n.locator.fingerprint).reduce((e,t)=>{if(!e)return t.id;let r=ef.mermaidViews[ss(e)],i=r?.origin===`file`?r.locator.startLine:1/0;return Math.abs(t.locator.startLine-n.locator.startLine)<Math.abs(i-n.locator.startLine)?t.id:e},void 0)}async function n8(e){let t=ef.mermaidViews[ss(e)];if(t&&t.origin!==`inline`){t.loading=!0,t.error=void 0;try{let e=await Td(t.projectId,t.path,t.locator.startLine);if(e.type!==`text`||e.text===void 0)throw Error(`The source Markdown file is not readable as text.`);let n=Ac(e.text,e.lineStart??1),r=kc(n,t.locator,{completeDocument:!e.truncated});if(!r)throw Error(`The referenced Mermaid block no longer exists.`);t.path=e.path,t.relativePath=e.relativePath,t.name=e.name,t.locator=r.locator,t.source=r.source,t.truncated=e.truncated,Cee()}catch(e){let n=e instanceof Error?e.message:String(e);t.error=n,ui.error(`Could not open Mermaid diagram`,{description:n})}finally{t.loading=!1}}}async function r8(e){if(e===Ds.selectedProjectId)return;let{selectProject:t}=await Os(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-DE0mQsY6.js`).then(e=>e.m);return{selectProject:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));await t(e)}function i8(e){Yo({kind:`mermaid`,id:e}),Ko({kind:`mermaid`,id:e})}async function Dae(e){await r8(e.projectId);let t=Eae(e.projectId,e.path,e.block)??wae(e.projectId,e.path,e.block),n=ss(t);ef.mermaidViews[n]??={origin:`file`,id:t,projectId:e.projectId,path:e.path,relativePath:e.relativePath,name:e.name,locator:e.block.locator,source:e.block.source,loading:!1};let r=ef.mermaidViews[n];r.origin===`file`&&(r.source=e.block.source,r.locator=e.block.locator,r.error=void 0,i8(t))}async function Oae(e){await r8(e.projectId);let t=Tae(e.projectId,e.sourceKey,e.block),n=ss(t);ef.mermaidViews[n]??={origin:`inline`,id:t,projectId:e.projectId,sourceKey:e.sourceKey,name:e.name??`Assistant diagram`,locator:e.block.locator,source:e.block.source,loading:!1};let r=ef.mermaidViews[n];r.origin===`inline`&&(r.source=e.block.source,r.locator=e.block.locator,r.name=e.name??`Assistant diagram`,r.error=void 0,i8(t))}async function kae(e){let t=ef.mermaidViews[ss(e)];t&&(i8(e),!t.source&&!t.loading&&await n8(e))}async function Aae(e){await n8(e)}function jae(e){let t={kind:`mermaid`,id:e},n=Ds.activeCenterTab?.kind===`mermaid`&&Ds.activeCenterTab.id===e,r=Go(t);Zo(t),delete ef.mermaidViews[ss(e)],n&&qo(r)}function a8(e,t){let n=t.map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]||e[1]-t[1]),r=[],i=0;for(let[t,a]of n){if(a<=i)continue;let n=Math.max(t,i);n>i&&r.push({text:e.slice(i,n),match:!1});let o=r[r.length-1];o?.match?o.text+=e.slice(n,a):r.push({text:e.slice(n,a),match:!0}),i=a}return i<e.length&&r.push({text:e.slice(i),match:!1}),r}function o8(e,t=0){let n=[];for(let r of[...e].sort((e,t)=>e-t)){let e=r-t;if(e<0)continue;let i=n[n.length-1];i&&i[1]===e?i[1]=e+1:(!i||e>=i[1])&&n.push([e,e+1])}return n}function Mae(e){let t=e.trim(),n=/^(.*?):(\d+)(?::\d+)?$/.exec(t);if(n){let e=Number(n[2]);if(Number.isSafeInteger(e)&&e>0)return{query:(n[1]??``).trim(),line:e}}return{query:t.replace(/:$/,``).trim()}}function Nae(e,t=[]){let n=e.lastIndexOf(`/`),r=n>=0?e.slice(0,n+1):``,i=e.slice(n+1);return{directory:r,name:i,directorySegments:a8(r,o8(t)),nameSegments:a8(i,o8(t,r.length))}}function Pae(e,t){let n=[...e].reverse(),r=[...new Set(n)];return t&&r.includes(t)?[t,...r.filter(e=>e!==t)]:r}var Fae=90,Iae=900,Lae=20,Rae=50,s8=new class{#e=Y(!1);get open(){return t(this.#e)}set open(e){B(this.#e,e,!0)}#t=Y(``);get query(){return t(this.#t)}set query(e){B(this.#t,e,!0)}#n=Y(U([]));get matches(){return t(this.#n)}set matches(e){B(this.#n,e,!0)}#r=Y(!1);get incomplete(){return t(this.#r)}set incomplete(e){B(this.#r,e,!0)}#i=Y(!1);get loading(){return t(this.#i)}set loading(e){B(this.#i,e,!0)}#a=Y();get error(){return t(this.#a)}set error(e){B(this.#a,e,!0)}#o=0;#s;#c=0;#l;show(e,t=``){this.#l=e,this.query=t,this.open=!0,this.schedule(0)}close(){this.open=!1,this.#u(),this.matches=[],this.error=void 0,this.incomplete=!1,this.loading=!1}setQuery(e){this.query=e,this.#c=0,this.parsed.query&&(this.loading=!0),this.schedule(Fae)}get parsed(){return Mae(this.query)}schedule(e){clearTimeout(this.#s),this.#s=setTimeout(()=>void this.#d(),e)}#u(){this.#o+=1,clearTimeout(this.#s)}async#d(){let e=this.#l,{query:t}=this.parsed,n=++this.#o;if(!e||!t)this.matches=[],this.incomplete=!1,this.loading=!1,this.error=void 0;else{this.loading=!0;try{let r=await Wee({projectId:e,query:t,limit:Rae,kinds:[`file`]});if(n!==this.#o)return;this.matches=r.matches,this.incomplete=r.incomplete,this.error=void 0,r.incomplete&&this.#c<Lae&&(this.#c+=1,this.schedule(Iae))}catch(e){if(n!==this.#o)return;this.matches=[],this.incomplete=!1,this.error=e instanceof Error?e.message:String(e)}finally{n===this.#o&&(this.loading=!1)}}}},zae=O(`<div class="px-2 py-1 text-caption text-muted-foreground">Recent files</div>`),c8=O(`<span> </span>`),Bae=O(`<span class="min-w-0 truncate text-muted-foreground"><span></span></span>`),Vae=O(`<span class="ml-auto shrink-0 text-caption text-muted-foreground"> </span>`),Hae=O(`<div role="option" tabindex="-1"><!> <span class="shrink-0 text-foreground"></span> <!> <!></div>`),Uae=O(`<span class="text-destructive"> </span>`),Wae=O(`<div class="px-3 py-6 text-center text-ui text-muted-foreground"><!></div>`),Gae=O(`<span class="ml-auto inline-flex items-center gap-1.5"><!> Indexing…</span>`),Kae=O(`<!> <!> <div class="border-b border-border-subtle p-2"><!></div> <div role="listbox" class="max-h-80 min-h-24 overflow-y-auto p-1"><!> <!></div> <div class="flex items-center gap-3 border-t border-border-subtle px-3 py-1.5 text-caption text-muted-foreground"><span class="inline-flex items-center gap-1"><!> Open</span> <span class="inline-flex items-center gap-1"><!> Reveal in Files</span> <!></div>`,1);function qae(e,n){let r=d();c(n,!0);let i=K(n,`open`,15,!1),a=K(n,`loading`,3,!1),o=K(n,`indexing`,3,!1),s=K(n,`hasProject`,3,!0),u=Y(void 0),p=Y(null),m=e=>`${r}-${encodeURIComponent(e.path)}`,_=bc({items:()=>n.items,getId:m,viewport:()=>t(u),onChoose:e=>n.onChoose(e,{reveal:!1})});W(()=>{n.items,_.reset()});function S(e){if(e.key===`Enter`){e.preventDefault();let t=n.items[_.index>=0?_.index:0];t&&n.onChoose(t,{reveal:e.altKey})}else _.handleKeydown(e)}var C=f(),E=R(C);H(E,()=>sf,(e,c)=>{c(e,{get onOpenChange(){return n.onOpenChange},get open(){return i()},set open(e){i(e)},children:(e,i)=>{var c=f(),d=R(c);H(d,()=>of,(e,i)=>{i(e,{showCloseButton:!1,layout:`shell`,class:`top-[20%] max-w-[calc(100%-2rem)] -translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-xl`,onOpenAutoFocus:e=>{e.preventDefault(),t(p)?.focus()},children:(e,i)=>{var c=Kae(),d=R(c);H(d,()=>af,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{y();var n=g(`Quick open`);k(e,n)},$$slots:{default:!0}})});var C=G(d,2);H(C,()=>rf,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{y();var n=g(`Search project files by name. Use arrow keys to move, Enter to open.`);k(e,n)},$$slots:{default:!0}})});var E=G(C,2),D=q(E);ks(D,{get value(){return n.query},placeholder:`Go to file (add :line to jump)`,ariaLabel:`Quick open`,get icon(){return Ore},get controls(){return r},get activeDescendant(){return _.activeDescendant},get onValueChange(){return n.onQueryChange},onkeydown:S,get ref(){return t(p)},set ref(e){B(p,e,!0)},trailing:e=>{var t=f(),n=R(t),r=e=>{dn(e,{class:`size-3.5 text-muted-foreground`})};l(n,e=>{a()&&e(r)}),k(e,t)},$$slots:{trailing:!0}}),x(E);var O=G(E,2),A=q(O),j=e=>{var t=zae();k(e,t)};l(A,e=>{n.recent&&n.items.length>0&&e(j)});var M=G(A,2);v(M,17,()=>n.items,e=>e.path,(e,r)=>{let i=L(()=>Nae(t(r).path,t(r).positions)),a=L(()=>_.activeDescendant===m(t(r)));var o=Hae(),s=q(o);Ic(s,{get name(){return t(i).name},kind:`file`});var c=G(s,2);v(c,21,()=>t(i).nameSegments,b,(e,n)=>{var r=c8(),i=z(r,!0);F(()=>{X(r,1,T(t(n).match?`font-medium text-primary`:``)),w(i,t(n).text)}),k(e,r)}),x(c);var u=G(c,2),d=e=>{var n=Bae(),r=q(n);v(r,21,()=>t(i).directorySegments,b,(e,n)=>{var r=c8(),i=z(r,!0);F(()=>{X(r,1,T(t(n).match?`font-medium text-primary`:``)),w(i,t(n).text)}),k(e,r)}),x(r),x(n),k(e,n)};l(u,e=>{t(i).directory&&e(d)});var f=G(u,2),p=e=>{var t=Vae(),r=z(t);F(()=>w(r,`:${n.line??``}`)),k(e,t)};l(f,e=>{n.line&&e(p)}),x(o),F((e,n)=>{J(o,`id`,e),J(o,`aria-selected`,t(a)),X(o,1,n)},[()=>m(t(r)),()=>T(Wc({selected:t(a)}).base({class:`flex h-control min-w-0 cursor-pointer items-center gap-2 px-2`}))]),h(`click`,o,e=>n.onChoose(t(r),{reveal:e.altKey})),k(e,o)},e=>{var t=Wae(),r=q(t),i=e=>{var t=g(`Select a project to search its files.`);k(e,t)},c=e=>{var t=Uae(),r=z(t,!0);F(()=>w(r,n.error)),k(e,t)},u=e=>{var t=g(`Searching…`);k(e,t)},d=e=>{var t=g(`Indexing…`);k(e,t)},f=e=>{var t=g(`No recent files. Type to search.`);k(e,t)},p=e=>{var t=g();F(()=>w(t,`No files match “${n.query??``}”.`)),k(e,t)};l(r,e=>{s()?n.error?e(c,1):a()?e(u,2):o()?e(d,3):n.recent?e(f,4):e(p,-1):e(i)}),x(t),k(e,t)}),x(O),te(O,e=>B(u,e),()=>t(u));var N=G(O,2),P=q(N),I=q(P);Ju(I,{children:(e,t)=>{y();var n=g(`↵`);k(e,n)},$$slots:{default:!0}}),y(),x(P);var ee=G(P,2),ne=q(ee);Ju(ne,{children:(e,t)=>{y();var n=g(`Alt ↵`);k(e,n)},$$slots:{default:!0}}),y(),x(ee);var re=G(ee,2),ie=e=>{var t=Gae(),n=q(t);dn(n,{class:`size-3`}),y(),x(t),k(e,t)};l(re,e=>{o()&&n.items.length>0&&e(ie)}),x(N),F(()=>{J(O,`id`,r),J(O,`aria-label`,n.recent?`Recent files`:`Matching files`)}),k(e,c)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})}),k(e,C),D()}ue([`click`]);function Jae(e){if(!(e instanceof vi))return;let t=e.data.details;if(t?.code!==`INVALID_SEARCH_PATTERN`)return;let n=t.column;return{message:e.data.message,...typeof n==`number`?{column:n}:{}}}function Yae(e){return e.column===void 0?e.message:`${e.message} (column ${e.column})`}var l8=12;function Xae(e){let t=e.text.length-e.text.trimStart().length,n=Math.min(...e.ranges.map(([e])=>e)),r=``;return Number.isFinite(n)&&n-t>l8&&(t=n-l8,r=`…`),{text:r+e.text.slice(t),ranges:e.ranges.map(([e,n])=>[e-t+r.length,n-t+r.length]).filter(([,e])=>e>0)}}function Zae(e){return`file:${e}`}function Qae(e){let t=[];for(let n of e){let e=Zae(n.path);t.push({type:`file`,key:e,path:n.path,count:n.matches.length}),n.matches.forEach((r,i)=>{let a=Xae(r);t.push({type:`match`,key:`match:${n.path}:${r.line}:${i}`,parentKey:e,path:n.path,line:r.line,text:a.text,ranges:a.ranges})})}return t}function $ae(e){return e.reduce((e,t)=>e+t.matches.length,0)}function u8(e){let t=e.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0}var eoe=300,toe=1e3,d8=new class{#e=Y(``);get query(){return t(this.#e)}set query(e){B(this.#e,e,!0)}#t=Y(!1);get regex(){return t(this.#t)}set regex(e){B(this.#t,e,!0)}#n=Y(!1);get caseSensitive(){return t(this.#n)}set caseSensitive(e){B(this.#n,e,!0)}#r=Y(!1);get wholeWord(){return t(this.#r)}set wholeWord(e){B(this.#r,e,!0)}#i=Y(!1);get includeIgnored(){return t(this.#i)}set includeIgnored(e){B(this.#i,e,!0)}#a=Y(``);get include(){return t(this.#a)}set include(e){B(this.#a,e,!0)}#o=Y(``);get exclude(){return t(this.#o)}set exclude(e){B(this.#o,e,!0)}#s=Y(!1);get showFilters(){return t(this.#s)}set showFilters(e){B(this.#s,e,!0)}#c=Y(`idle`);get status(){return t(this.#c)}set status(e){B(this.#c,e,!0)}#l=Y();get response(){return t(this.#l)}set response(e){B(this.#l,e)}#u=Y();get resultProjectId(){return t(this.#u)}set resultProjectId(e){B(this.#u,e,!0)}#d=Y();get error(){return t(this.#d)}set error(e){B(this.#d,e,!0)}#f=Y();get patternError(){return t(this.#f)}set patternError(e){B(this.#f,e,!0)}#p=Y(0);get focusToken(){return t(this.#p)}set focusToken(e){B(this.#p,e,!0)}handledFocusToken=0;#m=0;#h;requestFocus(e){e&&(this.query=e),this.focusToken+=1}schedule(e,t=!1){clearTimeout(this.#h),this.patternError=void 0,this.#h=setTimeout(()=>void this.run(e),t?0:eoe)}clear(){this.#m+=1,clearTimeout(this.#h),this.query=``,this.response=void 0,this.error=void 0,this.patternError=void 0,this.status=`idle`}async run(e){let t=this.query,n=++this.#m;if(!e||t.trim()===``)this.response=void 0,this.error=void 0,this.status=`idle`;else{this.status=`searching`,this.patternError=void 0;try{let r=await Uee({projectId:e,query:t,regex:this.regex||void 0,caseSensitive:this.caseSensitive||void 0,wholeWord:this.wholeWord||void 0,include:u8(this.include),exclude:u8(this.exclude),includeIgnored:this.includeIgnored||void 0,maxResults:toe});if(n!==this.#m)return;this.response=r,this.resultProjectId=e,this.error=void 0,this.status=`done`}catch(e){if(n!==this.#m)return;let t=Jae(e);if(t){this.response=void 0,this.error=void 0,this.patternError=t,this.status=`idle`;return}this.response=void 0,this.error=e instanceof Error?e.message:String(e),this.status=`error`}}}},noe=(e,n=m,r=m)=>{var i=f(),a=R(i);v(a,17,()=>a8(n(),r()),b,(e,n)=>{var r=f(),i=R(r),a=e=>{var r=ooe(),i=z(r,!0);F(()=>w(i,t(n).text)),k(e,r)},o=e=>{var r=g();F(()=>w(r,t(n).text)),k(e,r)};l(i,e=>{t(n).match?e(a):e(o,-1)}),k(e,r)}),k(e,i)},f8=O(`<!> <!>`,1),roe=O(`<p class="text-caption text-destructive" role="alert"> </p>`),ioe=O(`<!> <!> <!> <!>`,1),aoe=O(`<!> <div class="grid gap-1.5 pb-2"><!> <!> <!> <!></div>`,1),ooe=O(`<mark class="rounded-sm bg-warning-subtle text-foreground"> </mark>`),soe=O(`<div class="flex min-h-24 items-center justify-center"><!></div>`),coe=O(`<span class="text-foreground"> </span> <span class="text-muted-foreground"> </span>`,1),loe=O(`<span class="font-mono"><!></span>`),p8=O(`<span class="text-caption text-muted-foreground"> </span>`),uoe=O(`<div class="flex h-6 shrink-0 items-center gap-1.5 text-caption text-muted-foreground" aria-live="polite"><!> <span class="truncate"><!></span></div> <!> <!>`,1);function doe(e,n){let r=d();c(n,!0);let i=e=>{var i=aoe(),o=R(i);Xt(o,{title:`Search`,trailing:e=>{var r=f8(),i=R(r);tn(i,{get icon(){return vd},label:`Files to include or exclude`,get active(){return v()},onclick:()=>v(!v())});var o=G(i,2);{let e=L(()=>a()===``&&!n.response);tn(o,{get icon(){return ye},label:`Clear search`,get disabled(){return t(e)},get onclick(){return n.onClear}})}k(e,r)},$$slots:{trailing:!0}});var s=G(o,2),c=q(s);{let e=L(()=>n.patternError!==void 0),i=L(()=>n.patternError?r:void 0);ks(c,{placeholder:`Search in files`,ariaLabel:`Search in files`,get invalid(){return t(e)},get describedBy(){return t(i)},onValueChange:()=>n.onChange(),onkeydown:j,get value(){return a()},set value(e){a(e)},get ref(){return b()},set ref(e){b(e)}})}var u=G(c,2),d=e=>{var t=roe(),i=z(t,!0);F(e=>{J(t,`id`,r),w(i,e)},[()=>Yae(n.patternError)]),k(e,t)};l(u,e=>{n.patternError&&e(d)});var f=G(u,2);H(f,()=>ti,(e,n)=>{n(e,{type:`multiple`,variant:`chip`,size:`sm`,"aria-label":`Search options`,get value(){return t(O)},onValueChange:A,children:(e,t)=>{var n=ioe(),r=R(n);H(r,()=>ni,(e,t)=>{t(e,{value:`case`,"aria-label":`Match case`,title:`Match case`,children:(e,t)=>{jl(e,{"aria-hidden":`true`})},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>ni,(e,t)=>{t(e,{value:`word`,"aria-label":`Match whole word`,title:`Match whole word`,children:(e,t)=>{zl(e,{"aria-hidden":`true`})},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>ni,(e,t)=>{t(e,{value:`regex`,"aria-label":`Use regular expression`,title:`Use regular expression`,children:(e,t)=>{kl(e,{"aria-hidden":`true`})},$$slots:{default:!0}})});var o=G(a,2);H(o,()=>ni,(e,t)=>{t(e,{value:`ignored`,"aria-label":`Include ignored files`,title:`Include ignored files`,children:(e,t)=>{cf(e,{"aria-hidden":`true`})},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})});var p=G(f,2),m=e=>{var t=f8(),r=R(t);an(r,{ariaLabel:`Files to include`,placeholder:`Files to include (src/**, *.ts)`,oninput:()=>n.onChange(),onkeydown:j,get value(){return h()},set value(e){h(e)}});var i=G(r,2);an(i,{ariaLabel:`Files to exclude`,placeholder:`Files to exclude (**/*.test.ts)`,oninput:()=>n.onChange(),onkeydown:j,get value(){return _()},set value(e){_(e)}}),k(e,t)};l(p,e=>{v()&&e(m)}),x(s),k(e,i)},a=K(n,`query`,15,``),o=K(n,`regex`,15,!1),s=K(n,`caseSensitive`,15,!1),u=K(n,`wholeWord`,15,!1),p=K(n,`includeIgnored`,15,!1),h=K(n,`include`,15,``),_=K(n,`exclude`,15,``),v=K(n,`showFilters`,15,!1),b=K(n,`inputRef`,15,null),S=L(()=>Qae(n.response?.files??[])),C=L(()=>rn(t(S),{getKey:e=>e.key,getParentKey:e=>e.parentKey,getLabel:e=>e.type===`file`?e.path:e.text})),T=L(()=>$ae(n.response?.files??[])),E=L(()=>n.response?.files.length??0),O=L(()=>[o()&&`regex`,s()&&`case`,u()&&`word`,p()&&`ignored`].filter(e=>!!e));function A(e){o(e.includes(`regex`)),s(e.includes(`case`)),u(e.includes(`word`)),p(e.includes(`ignored`)),n.onChange()}function j(e){e.key===`Enter`&&(e.preventDefault(),n.onSubmit())}function M(e){let t=e.lastIndexOf(`/`);return{name:e.slice(t+1),directory:e.slice(0,t+1)}}function N(e){e.type===`match`&&n.onOpenMatch(e.path,e.line)}en(e,{get banner(){return i},children:(e,r)=>{var i=f(),a=R(i),o=e=>{Jt(e,{get icon(){return lf},title:`No project selected`,description:`Select a project to search its files.`})},s=e=>{Jt(e,{get icon(){return bn},title:`Search failed`,get description(){return n.error}})},c=e=>{Jt(e,{get icon(){return lf},title:`Search in files`,description:`Type to search file contents in this project.`})},u=e=>{var t=soe(),n=q(t);dn(n,{class:`size-4 text-muted-foreground`}),x(t),k(e,t)},d=e=>{var r=uoe(),i=R(r),a=q(i),o=e=>{dn(e,{class:`size-3`})};l(a,e=>{n.status===`searching`&&e(o)});var s=G(a,2),c=q(s),u=e=>{var t=g(`No results`);k(e,t)},d=e=>{var r=g();F(()=>w(r,`${t(T)??``}${n.response.truncated?`+`:``}
149
+ ${t(T)===1?`result`:`results`} in ${t(E)??``}
150
+ ${t(E)===1?`file`:`files`}`)),k(e,r)};l(c,e=>{t(T)===0?e(u):e(d,-1)}),x(s),x(i);var p=G(i,2),h=e=>{nn(e,{layout:`strip`,tone:`warning`,class:`mb-1`,children:(e,t)=>{y();var n=g(`Showing the first results only. Narrow the query or add file filters.`);k(e,n)},$$slots:{default:!0}})};l(p,e=>{n.response.truncated&&e(h)});var _=G(p,2),v=e=>{{let r=L(()=>`Nothing matched in ${n.response.searchedFiles} searched ${n.response.searchedFiles===1?`file`:`files`}.`);Jt(e,{get icon(){return lf},title:`No results`,get description(){return t(r)}})}},b=e=>{Qt(e,{get nodes(){return t(C)},ariaLabel:`Search results`,virtualized:!0,showDisclosure:!0,getItemTitle:e=>e.type===`file`?e.path:`${e.path}:${e.line}`,onItemActivate:N,itemLeading:(e,n=m)=>{var r=f(),i=R(r),a=e=>{{let r=L(()=>M(n().path).name);Ic(e,{get name(){return t(r)},kind:`file`})}};l(i,e=>{n().type===`file`&&e(a)}),k(e,r)},itemLabel:(e,n=m)=>{var r=f(),i=R(r),a=e=>{let r=L(()=>M(n().path));var i=coe(),a=R(i),o=z(a,!0),s=G(a,2),c=z(s,!0);F(()=>{w(o,t(r).name),w(c,t(r).directory)}),k(e,i)},o=e=>{var t=loe();noe(q(t),()=>n().text,()=>n().ranges),x(t),k(e,t)};l(i,e=>{n().type===`file`?e(a):e(o,-1)}),k(e,r)},itemBadges:(e,t=m)=>{var n=f(),r=R(n),i=e=>{var n=p8(),r=z(n,!0);F(()=>w(r,t().count)),k(e,n)},a=e=>{var n=p8(),r=z(n,!0);F(()=>w(r,t().line)),k(e,n)};l(r,e=>{t().type===`file`?e(i):e(a,-1)}),k(e,n)},$$slots:{itemLeading:!0,itemLabel:!0,itemBadges:!0}})};l(_,e=>{t(T)===0?e(v):e(b,-1)}),k(e,r)};l(a,e=>{n.hasProject?n.status===`error`?e(s,1):n.status===`idle`&&!n.response?e(c,2):n.response?e(d,-1):e(u,3):e(o)}),k(e,i)},$$slots:{default:!0}}),D()}var m8=U({projects:{}});function h8(e){return m8.projects[e]??={projectId:e,directories:{},expandedIds:new mo},m8.projects[e]}var g8=U({projectId:void 0,path:void 0,focus:!0,token:0}),_8=`nerve:files-panel-preferences:v1`,v8={hideIgnored:!1,showDotfiles:!0,autoReveal:!0};function y8(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function b8(e,t){let n=e[t];return typeof n==`boolean`?n:v8[t]}function foe(e=y8()){if(!e)return{...v8};try{let t=JSON.parse(e.getItem(_8)??`null`);return!t||typeof t!=`object`?{...v8}:{hideIgnored:b8(t,`hideIgnored`),showDotfiles:b8(t,`showDotfiles`),autoReveal:b8(t,`autoReveal`)}}catch{return{...v8}}}function poe(e,t=y8()){if(t)try{t.setItem(_8,JSON.stringify(e))}catch{}}var x8=U(foe());function S8(e,t){x8[e]=t,poe(x8)}function C8(e,t){return`file:${e}:${t}`}function moe(e,t){return t.hideDotfiles&&e.name.startsWith(`.`)?!0:!!(t.hideIgnored&&e.ignored)}function hoe(e,t){return e.toLowerCase().includes(t)}function w8(e,t,n,r,i,a){let o=e.directories[t];if(!o)return[];let s=[];r.creating&&r.creating.parentPath===t&&!i&&s.push({kind:`item`,id:`file-editor:${e.projectId}:${t}`,label:``,path:[t,`new`],value:{type:`editor`,mode:`create`,kind:r.creating.kind,parentPath:t},children:[]});for(let t of o.entries){if(moe(t,r))continue;let o=C8(e.projectId,t.path),c=t.kind===`directory`&&!t.symlink,l=c&&n.has(t.path),u=new Set(n).add(t.path),d=c&&!l?w8(e,t.path,u,r,i,a):[];(!i||hoe(t.name,i)||d.length!==0)&&(i&&d.length>0&&a.add(o),s.push({kind:`item`,id:o,label:t.name,path:t.path.split(`/`),value:{type:`entry`,entry:t},children:d,expandable:c&&!l}))}return o.error&&s.push({kind:`item`,id:`file-error:${e.projectId}:${t}`,label:`Could not refresh directory`,path:[t,`error`],value:{type:`error`,directoryPath:t,message:o.error},children:[]}),o.nextCursor&&s.push({kind:`item`,id:`file-more:${e.projectId}:${t}:${o.nextCursor}`,label:o.loading?`Loading…`:`Load more…`,path:[t,`more`],value:{type:`load-more`,directoryPath:t,cursor:o.nextCursor},children:[]}),s}function goe(e,t={}){let n=t.filter?.trim().toLowerCase()??``,r=new Set;return{nodes:w8(e,``,new Set([``]),t,n,r),filterExpandedIds:r}}var T8=500,_oe=4;function voe(e){return e instanceof Error?e.message:String(e)}function yoe(e,t){let n=h8(e);return n.directories[t]??={path:t,entries:[],pagesLoaded:0,loading:!1,refreshing:!1,generation:0,stale:!1},n.directories[t]}async function boe(e,t,n){let r=[],i,a=0;do{let n=await Bd({projectId:e,path:t||void 0,cursor:i,limit:T8});r.push(...n.entries),i=n.nextCursor,a+=1}while(i&&a<n);return{entries:r,nextCursor:i,pagesLoaded:a}}async function E8(e,t,n={}){let r=yoe(e,t);if(r.loading||r.refreshing)return;let i=++r.generation,a=n.refresh===!0;a?r.refreshing=!0:r.loading=!0,r.error=void 0;try{if(n.append&&r.nextCursor){let n=await Bd({projectId:e,path:t||void 0,cursor:r.nextCursor,limit:T8});if(r.generation!==i)return;let a=new yo(r.entries.map(e=>[e.path,e]));for(let e of n.entries)a.set(e.path,e);r.entries=[...a.values()],r.nextCursor=n.nextCursor,r.pagesLoaded+=1}else{let n=await boe(e,t,a?Math.max(1,r.pagesLoaded):1);if(r.generation!==i)return;r.entries=n.entries,r.nextCursor=n.nextCursor,r.pagesLoaded=n.pagesLoaded}r.stale=!1}catch(e){r.generation===i&&(r.error=voe(e))}finally{r.generation===i&&(r.loading=!1,r.refreshing=!1)}}async function D8(e){let t=h8(e).directories[``];(!t||t.error)&&await E8(e,``)}function xoe(e,t,n){if(t.type!==`entry`||t.entry.kind!==`directory`)return;let r=h8(e),i=C8(e,t.entry.path);if(n){if(t.entry.symlink)return;r.expandedIds.add(i);let n=r.directories[t.entry.path];(!n||n.stale)&&E8(e,t.entry.path,{refresh:!!n})}else{r.expandedIds.delete(i);for(let[e,n]of Object.entries(r.directories))(e===t.entry.path||e.startsWith(`${t.entry.path}/`))&&(n.stale=!0)}}function Soe(e,t){t.type===`load-more`?E8(e,t.directoryPath,{append:!0}):t.type===`error`&&E8(e,t.directoryPath,{refresh:!0})}async function Coe(e){let t=0;await Promise.all(Array.from({length:Math.min(_oe,e.length)},async()=>{for(;t<e.length;){let n=e[t++];n&&await n()}}))}function woe(e,t){let n=h8(e);for(let e of Object.keys(n.directories))(e===t||e.startsWith(`${t}/`))&&delete n.directories[e];let r=C8(e,t);for(let e of n.expandedIds)(e===r||e.startsWith(`${r}/`))&&n.expandedIds.delete(e)}function O8(e){let t=h8(e),n=`file:${e}:`;return[``,...[...t.expandedIds].filter(e=>e.startsWith(n)).map(e=>e.slice(n.length))]}async function Toe(e,t){let n=h8(e),r=new mo(O8(e));await Coe((t?[...new mo(t)].filter(e=>r.has(e)):[...r]).filter(e=>n.directories[e]).map(t=>()=>E8(e,t,{refresh:!0})))}function Eoe(e){let t=h8(e);t.expandedIds.clear();for(let[e,n]of Object.entries(t.directories))e!==``&&(n.stale=!0)}function Doe(e,t,n){let r=h8(e),i=C8(e,t),a=[...r.expandedIds].filter(e=>e===i||e.startsWith(`${i}/`));for(let i of a)r.expandedIds.delete(i),r.expandedIds.add(C8(e,nte(i.slice(`file:${e}:`.length),t,n)));for(let e of Object.keys(r.directories))(e===t||e.startsWith(`${t}/`))&&delete r.directories[e]}var Ooe=40,koe=125;async function k8(e,t){let n=h8(e);for(let e=0;e<koe;e+=1){let e=n.directories[t];if(e&&!e.loading&&!e.refreshing)return e;await new Promise(e=>setTimeout(e,Ooe))}return n.directories[t]}async function Aoe(e,t,n){let r=h8(e).directories[t];for(r?r.stale&&await E8(e,t,{refresh:!0}):await E8(e,t),r=await k8(e,t);r;){let i=r.entries.find(e=>e.path===n);if(i)return i;if(!r.nextCursor||(await E8(e,t,{append:!0}),r=await k8(e,t),r?.error))return}}async function A8(e,t,n={}){let r=t.split(`/`).filter(Boolean);if(r.length===0)return;let i=h8(e);await D8(e);let a,o=``,s={dotfile:!1,ignored:!1};for(let[t,n]of r.entries()){let c=o?`${o}/${n}`:n;if(a=await Aoe(e,o,c),!a)return;if(a.name.startsWith(`.`)&&(s.dotfile=!0),a.ignored&&(s.ignored=!0),t<r.length-1){if(a.kind!==`directory`||a.symlink)return;i.expandedIds.add(C8(e,c)),o=c}}n.auto||(s.dotfile&&!x8.showDotfiles&&S8(`showDotfiles`,!0),s.ignored&&x8.hideIgnored&&S8(`hideIgnored`,!1)),g8.projectId=e,g8.path=t,g8.focus=!n.auto,g8.token+=1}function joe(e){if(e)return e.split(`:thinking:`)[0]}function j8(e){if(e!=null){if(typeof e==`string`)return e.trim()||void 0;try{return JSON.stringify(e,null,2)}catch{return String(e)}}}function M8(e){let t=e.filter(e=>!!e?.trim());return t.length>0?t.join(`
151
+ `):void 0}function Moe(e,t){switch(e.kind){case`message`:case`thinking`:{let n=joe(e.item.id),r=n?t.get(n):void 0;return{content:e.item.text,id:e.item.id,idLabel:`message id`,quote:e.item.text,entryId:r?n:void 0,entry:r}}case`tool`:{let t=j8(e.toolCall.argsPreview),n=j8(e.toolCall.resultPreview);return{content:M8([e.toolCall.toolName,t?`Arguments:\n${t}`:void 0,n?`Result:\n${n}`:void 0,e.toolCall.error?`Error:\n${e.toolCall.error}`:void 0]),id:e.toolCall.id,idLabel:`tool id`,entryId:e.anchorEntryId}}case`tool_result_error`:return{content:M8([e.toolName,e.error])};case`run_status`:return{content:M8([`Run ${e.notice.state.replaceAll(`_`,` `)}`,e.notice.errorMessage]),id:e.notice.runId,idLabel:`run id`};case`compaction`:return{content:M8([`Compaction ${e.notice.state}`,e.notice.summary,e.notice.text,e.notice.errorMessage]),id:e.notice.id,idLabel:`compaction id`};case`task_result`:return{content:M8([e.notice.taskName?`Task: ${e.notice.taskName}`:`Task update`,e.notice.commandPreview,e.notice.status?`Status: ${e.notice.status}`:void 0,e.notice.exitCode===void 0?void 0:`Exit: ${e.notice.exitCode}`,e.notice.signal?`Signal: ${e.notice.signal}`:void 0]),id:e.notice.taskId??e.notice.entryId,idLabel:e.notice.taskId?`task id`:`entry id`};case`system_event`:return{content:M8([e.notice.summary,e.notice.text]),id:e.notice.entryId,idLabel:`entry id`};case`queued_prompt`:return{content:e.prompt.text,id:e.prompt.id,idLabel:`queued prompt id`}}}function Noe(e){let t=e.replace(/\s+$/,``).split(`
152
+ `);for(;t.length>0&&!t[0]?.trim();)t.shift();return t.map(e=>e.trim()?`> ${e.trimEnd()}`:`>`).join(`
153
+ `)}function Poe(e){return e.filter(e=>e.length>0).flatMap((e,t)=>t===0?e:[{type:`separator`},...e])}function Foe(e,t,n){let r=Moe(e,n.treeEntriesById),i=r.content?.trim()?r.content:void 0,a=t?.text.trim()?t.text:void 0,o=t?.markdown.trim()?t.markdown:a,s=[{label:`Copy selection`,disabled:!a,onSelect:()=>{a&&n.copyText(a,`selection`)}},{label:`Copy content`,disabled:!i,onSelect:()=>{i&&n.copyText(i,`content`)}}];r.quote?.trim()&&s.push({label:a?`Quote selection`:`Quote`,onSelect:()=>n.quoteInComposer(o??r.quote??``)});let c=[];e.kind===`message`&&r.entry?.role===`user`&&n.onEditEntry&&c.push({label:`Edit message`,disabled:n.rewindLocked,onSelect:()=>n.onEditEntry?.(r.entry)}),e.kind===`queued_prompt`&&c.push({label:`Force push all queued prompts`,disabled:e.busy||!e.canForcePush,onSelect:e.onForcePush},{label:`Edit prompt`,disabled:e.busy||!e.canEdit,onSelect:e.onEdit},{label:`Discard`,destructive:!0,disabled:e.busy||!e.canDiscard,onSelect:e.onDiscard}),r.entryId&&n.onNavigateToEntry&&c.push({label:`Rewind to here`,disabled:n.rewindLocked,onSelect:()=>n.onNavigateToEntry?.(r.entryId)}),r.entryId&&n.onForkFromEntry&&c.push({label:`Fork from here`,disabled:n.rewindLocked,onSelect:()=>n.onForkFromEntry?.(r.entryId)});let l=[];return r.id&&l.push({label:`Copy ID`,onSelect:()=>void n.copyText(r.id??``,r.idLabel??`id`)}),n.onOpenHistory&&l.push({label:`History`,onSelect:n.onOpenHistory}),Poe([s,c,l])}var Ioe={"Copy selection":sr,"Copy content":Pw,Quote:vT,"Quote selection":vT,"Edit message":Dn,"Edit prompt":Dn,Discard:kn,"Rewind to here":bT,"Fork from here":Ww,"Copy ID":sr,History:rd};function N8(e){return e.map(e=>e.type===`separator`||e.type===`label`?e:e.type===`submenu`?{...e,items:N8(e.items)}:{...e,icon:Ioe[e.label]})}function Loe(e,t,n){return N8(Foe(e,t,n))}var P8=U({commands:{},refreshVersions:{}});async function F8(e,t){let n=t??Ds.conversations.find(t=>t.id===e.conversationId)?.projectId;if(n&&n!==Ds.selectedProjectId){let{selectProject:e}=await Os(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-DE0mQsY6.js`).then(e=>e.m);return{selectProject:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));await e(n)}P8.commands[e.id]=e;let r={kind:`async-bash`,id:e.id,conversationId:e.conversationId,projectId:n,command:e.command};Yo(r),Ko(r)}function Roe(e){P8.refreshVersions[e]=(P8.refreshVersions[e]??0)+1}var zoe={get asyncBashes(){return P8.commands}};function Boe(e){delete P8.commands[e],delete P8.refreshVersions[e]}function Voe(e){let t={cancelled:!1},n=()=>{t.cancelled||e()};return typeof requestAnimationFrame==`function`?t.animationFrame=requestAnimationFrame(n):queueMicrotask(n),t}function Hoe(e){e.cancelled=!0,e.animationFrame!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(e.animationFrame)}var Uoe=class{commit;schedule;cancel;pending;hasPending=!1;frame;destroyed=!1;constructor(e,t=Voe,n=Hoe){this.commit=e,this.schedule=t,this.cancel=n}enqueue(e){this.destroyed||(this.pending=e,this.hasPending=!0,this.frame===void 0&&(this.frame=this.schedule(()=>this.flushPending())))}hold(e){this.destroyed||(this.pending=e,this.hasPending=!0,this.cancelFrame())}flushNow(e){this.destroyed||(arguments.length>0&&(this.pending=e,this.hasPending=!0),this.cancelFrame(),this.flushPending())}destroy(){this.destroyed||(this.destroyed=!0,this.cancelFrame(),this.pending=void 0,this.hasPending=!1)}cancelFrame(){this.frame!==void 0&&(this.cancel(this.frame),this.frame=void 0)}flushPending(){if(this.frame=void 0,this.destroyed||!this.hasPending)return;let e=this.pending;this.pending=void 0,this.hasPending=!1,this.commit(e)}};function Woe(e){let n=Y(e.initialValue),r=e.initialScope,i=e.initialActive,a=new Uoe(e=>{B(n,e)});return{get current(){return t(n)},update(e,t,n){let o=e!==r,s=t&&!i;r=e,i=t,o||s?a.flushNow(n):t?a.enqueue(n):a.hold(n)},destroy(){a.destroy()}}}var Goe=e=>{{let n=L(()=>Z6.state.phase===`arrival`&&Z6.state.arrival?.level===`trust`),r=L(()=>$d.isPhone?`review them`:`show the list`);cae(e,{get count(){return $6.counts.trust},get pulse(){return Z6.state.trustArrivals},get pulsing(){return t(n)},get openLabel(){return t(r)},onOpen:()=>$d.isPhone?$6.review():Z6.expand(),onLater:()=>Z6.later()})}};function Koe(e,n){c(n,!0);let r=K(n,`pendingWork`,19,()=>[]),i=K(n,`pendingConversationActive`,3,!1),a=K(n,`conversationLoading`,3,!1),o=K(n,`approvals`,19,()=>[]),s=K(n,`pendingUserQuestions`,19,()=>[]),u=K(n,`pendingPlanReviews`,19,()=>[]),d=K(n,`active`,3,!0),p=K(n,`entries`,19,()=>[]),h=K(n,`optimisticMessages`,19,()=>[]),g=K(n,`toolCalls`,19,()=>[]),_=K(n,`treeNodes`,19,()=>[]),v=K(n,`queuedPrompts`,19,()=>[]),y=K(n,`recoveryIssues`,19,()=>[]),b=K(n,`sending`,3,!1),x=K(n,`stoppable`,3,!1),S=K(n,`stopping`,3,!1),C=K(n,`responseRevision`,3,0),w=K(n,`retryingResponse`,3,!1),T=K(n,`composerText`,3,``),E=K(n,`models`,19,()=>[]),O=K(n,`selectedModelKey`,3,``),A=K(n,`planReviewModels`,19,()=>[]),j=K(n,`planReviewModelKey`,3,``),M=K(n,`planReviewThinkingLevel`,3,`off`),N=K(n,`contextWindow`,3,0),P=K(n,`composerFocusToken`,3,0),F=K(n,`composerEscapeToken`,3,0),I=K(n,`micShortcutToken`,3,0),ee=K(n,`thinkingLevel`,3,`off`),te=K(n,`agentProfile`,3,da),re=K(n,`agentProfiles`,19,()=>[]),z=K(n,`profileDisabled`,3,!1),ie=K(n,`permissionRuleSetId`,3,`autonomous`),B=K(n,`permissionRuleSets`,19,()=>[]),ae=K(n,`permissionRuleSetsLoading`,3,!1),V=K(n,`slashCompletions`,19,()=>[]),oe=K(n,`composerSuggestions`,19,()=>[]),se=K(n,`rewindLocked`,3,!1),H=K(n,`transcriptView`,3,`conversation`);bK(nae({list:()=>n.subagents?.list()??[],open:e=>n.subagents?.open(e)}));let ce=L(()=>!!(n.activeConversation||i())),U=L(()=>n.activeProject?.name),le=L(()=>{let e=n.activeProject?.id;if(!e||$d.isPhone)return;let t=f3(g3.entriesFor(e)),r=t[0]?.target;if(r)return{text:p3(t.length),onOpen:()=>void zt(e,r.pageId,r.item?{item:r.item}:{})}}),G=L(()=>n.activeConversation?.id??(i()?n.activePendingConversation?.id??`pending`:void 0));function ue(){return{entries:p(),optimisticMessages:h(),toolCalls:g(),activeRun:n.activeRun,transient:n.transient,queuedPrompts:v(),sending:b(),approvals:o(),pendingUserQuestions:s(),pendingPlanReviews:u()}}let de=Woe({initialScope:me(()=>t(G)),initialActive:me(()=>d()),initialValue:me(ue)});W(()=>{de.update(t(G),d(),ue())}),W(()=>()=>de.destroy());let fe=L(()=>de.current),pe=new j2,he=L(()=>pe.project({entries:t(fe).entries,optimisticMessages:t(fe).optimisticMessages,toolCalls:t(fe).toolCalls})),q=L(()=>n2(t(fe).activeRun,t(fe).transient,t(he).context)),J=L(()=>_2(t(he).items,t(fe).activeRun,t(fe).transient,t(he).context)),Y=L(()=>({prefix:t(J),tail:t(q)})),ge=L(()=>n.transient?.compaction?.state===`running`),_e=L(()=>mX(y())),X=L(()=>S()||n.activeRun?.status===`aborting`),ve=L(()=>G0(t(fe).activeRun)),Z=L(()=>new Map(_().map(e=>[e.entry.id,e.entry])));async function ye(e){try{await ri(e)}catch{ui.error(`Could not copy to clipboard`)}}function be(e){let t=Noe(e);if(!t)return;let r=T().trimEnd(),i=r?`${r}\n\n`:``;n.onComposerChange?.(`${i}${t}\n\n`),vl()}async function xe(e){be(e),await ne();let t=n.activeConversation?{kind:`conversation`,id:n.activeConversation.id}:n.activePendingConversation?{kind:`pending-conversation`,id:n.activePendingConversation.id}:void 0;t&&d()&&(o6.isTargetActive(t)&&(o6.recording||o6.transcribing)||_l())}let Se=L(()=>({quote:be,quoteAndDictate:o6.isSupported()?xe:void 0}));function Ce(e,t){if(!n.activeProject)return;let r=n.activeConversation?.id??n.activePendingConversation?.id??`pending`;Oae({projectId:n.activeProject.id,sourceKey:`${r}:${t}`,name:`Assistant diagram`,block:e})}function we(e,r){return Loe(e,r,{treeEntriesById:t(Z),copyText:ye,quoteInComposer:be,onNavigateToEntry:n.onNavigateToEntry,onEditEntry:n.onEditEntry,onForkFromEntry:n.onForkFromEntry,onOpenHistory:n.onOpenHistory,rewindLocked:se()||t(ge)||t(fe).sending})}{let c=(e,r=m)=>{{let a=L(()=>n.activeConversation?n.onCompact:void 0),c=L(()=>H()===`history`);Tie(e,{get composerView(){return n.composerView},get activity(){return r()},get text(){return T()},get editorOverlay(){return n.editorOverlay},get session(){return n.session},get contextActions(){return n.contextActions},get activeProject(){return n.activeProject},get activeConversation(){return n.activeConversation},get activePendingConversation(){return n.activePendingConversation},get pendingConversationActive(){return i()},get approvals(){return o()},get pendingUserQuestions(){return s()},get pendingPlanReviews(){return u()},get interactive(){return d()},get sending(){return b()},get stopping(){return t(X)},get stoppable(){return x()},get compacting(){return t(ge)},get models(){return E()},get selectedModelKey(){return O()},get contextUsage(){return n.contextUsage},get conversationUsage(){return n.conversationUsage},get agentUsage(){return n.agentUsage},get agentUsageLoading(){return n.agentUsageLoading},get agentUsageError(){return n.agentUsageError},get contextWindow(){return N()},get focusToken(){return P()},get composerEscapeToken(){return F()},get micShortcutToken(){return I()},get thinkingLevel(){return ee()},get agentProfile(){return te()},get agentProfiles(){return re()},get lockedFields(){return n.lockedFields},get profileDisabled(){return z()},get permissionRuleSetId(){return ie()},get permissionRuleSets(){return B()},get permissionRuleSetsLoading(){return ae()},get permissionRuleSetsError(){return n.permissionRuleSetsError},get slashCompletions(){return V()},get completionSource(){return n.completionSource},get composerSuggestions(){return oe()},get onSendSuggestion(){return n.onSendSuggestion},get onDraftSuggestion(){return n.onDraftSuggestion},get onChange(){return n.onComposerChange},get onSubmit(){return n.onSubmit},get onAbort(){return n.onAbort},get onCompact(){return t(a)},get onUsageOpenChange(){return n.onUsageOpenChange},get onUsageRetry(){return n.onUsageRetry},get onOpenRequestPreview(){return n.onOpenRequestPreview},get onModelSelectionChange(){return n.onModelSelectionChange},get onAgentProfileChange(){return n.onAgentProfileChange},get onPermissionRuleSetChange(){return n.onPermissionRuleSetChange},get onRefreshPermissionRuleSets(){return n.onRefreshPermissionRuleSets},get onOpenPermissionSettings(){return n.onOpenPermissionSettings},get onOpenCapabilitySettings(){return n.onOpenCapabilitySettings},get onToggleHistory(){return n.onToggleHistory},get historyOpen(){return t(c)}})}},p=e=>{var r=f(),i=R(r),o=e=>{{let r=L(()=>!!(n.activeProject&&n.onNewConversationInProject)),i=L(()=>n.activeProject?.id),a=L(()=>n.activeProject?.dir),o=L(()=>re().map(e=>e.name));rae(e,{get projectSelected(){return t(r)},get projectId(){return t(i)},get projectLabel(){return t(U)},get projectPath(){return t(a)},get availableProfiles(){return t(o)},get defaultProfile(){return n.defaultAgentProfile},get review(){return t(le)},onNewChat:e=>{n.activeProject&&n.onNewConversationInProject?.(n.activeProject.dir,e)}})}};l(i,e=>{a()||e(o)}),k(e,r)},h=L(()=>({conversationId:t(G),open:t(ce),active:d(),timeline:t(Y),streamingText:t(ve),sending:t(fe).sending,runActivity:{activeRun:t(fe).activeRun,lastRunOutcome:n.lastRunOutcome,stopping:t(X),pending:r(),responseRevision:C(),retryingResponse:w()},queuedPrompts:t(fe).queuedPrompts,approvals:t(fe).approvals,projectReview:t(le),pendingUserQuestions:t(fe).pendingUserQuestions,pendingPlanReviews:t(fe).pendingPlanReviews,outcomeUnknownToolCallIds:t(_e),activeProject:n.activeProject,activeProjectLabel:t(U),planReviewModels:A(),planReviewModelKey:j(),planReviewThinkingLevel:M(),banner:y().length?{tone:`warning`,title:`Recovery needs review`,message:`${y().length} external operation outcome${y().length===1?` is`:`s are`} unknown. Nerve did not repeat the operation. Inspect the transcript${y().some(e=>e.actions.includes(`authorize_retry`))?`, then cancel or explicitly authorize another attempt`:` before taking any further action`}.`}:void 0,emptyTitle:`Open a conversation or start a new one.`,transcriptView:H(),messageStep:n.messageStep,composer:{text:T(),disabled:!d(),sending:b(),stopping:t(X),compacting:t(ge),models:E(),selectedModelKey:O(),thinkingLevel:ee(),agentProfile:te(),agentProfiles:re(),lockedFields:n.lockedFields,profileDisabled:z(),permissionRuleSetId:ie(),permissionRuleSets:B(),permissionRuleSetsLoading:ae(),permissionRuleSetsError:n.permissionRuleSetsError,contextUsage:n.contextUsage,conversationUsage:n.conversationUsage,agentUsage:n.agentUsage,agentUsageLoading:n.agentUsageLoading,agentUsageError:n.agentUsageError,contextWindow:N(),capabilities:{voice:!0,imagePaste:!0,fileDrop:!0,completions:!0,suggestions:!0,shortcuts:!0,queueing:!0}}})),g=L(()=>({onOpenFile:n.onOpenFile,onOpenTask:n.onOpenTask,onOpenMermaid:Ce,onAnswerUserQuestion:n.onAnswerUserQuestion,onDismissUserQuestion:n.onDismissUserQuestion,onGrantApproval:n.onGrantApproval,onDenyApproval:n.onDenyApproval,onAcceptPlanReview:n.onAcceptPlanReview,onAcceptPlanReviewInNewChat:n.onAcceptPlanReviewInNewChat,onRejectPlanReview:n.onRejectPlanReview,onContinueFromFailure:n.onContinueFromFailure,onCancelCompaction:n.onCancelCompaction,onRetryResponse:n.onRetryResponse,onForcePushQueuedPrompts:n.onForcePushQueuedPrompts,onDiscardQueuedPrompt:n.onDiscardQueuedPrompt,onMoveQueuedPromptToComposer:n.onMoveQueuedPromptToComposer,onOpenPendingWork:n.onOpenPendingWork,onToggleHistory:n.onToggleHistory})),_=L(()=>({transcriptMenu:we,selectionActions:t(Se)})),v=L(()=>vae(Z6.state,$6.counts.trust)?Goe:void 0);z0(e,{get model(){return t(h)},get actions(){return t(g)},get menus(){return t(_)},get activity(){return n.activity},get history(){return n.history},get marker(){return t(v)},composer:c,emptyExtension:p,$$slots:{composer:!0,emptyExtension:!0}})}D()}function qoe(e,t){let n=e?.trim().toLowerCase();if(n)for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||r.toolName!==`subagent_prompt`)continue;let i=r.arguments?.assignments;if(Array.isArray(i))for(let e of i){if(!e||typeof e!=`object`)continue;let{name:t,prompt:r}=e;if(typeof t==`string`&&t.trim().toLowerCase()===n&&typeof r==`string`&&r.trim())return r}}}function I8(e){return{...e,dir:e.directory}}function L8(e){let t=e.conversation;return{...t,agentProfile:e.config.agentProfile??`Unknown profile`,activeAgentId:t.id,activeEntryId:t.headEventId??void 0,pinned:!!t.pinnedAt,completedAt:t.completedAt??void 0,lastUserMessageAt:t.lastUserMessageAt??void 0,runtimeStatusClearedAt:t.statusClearedAt??void 0}}function R8(e,t,n=[]){let r=t??e.conversation,i=e.config;return{id:r.id,conversationId:r.id,projectId:r.projectId,projectDir:i.workingDirectory,parentAgentId:t?e.conversation.id:void 0,lastParentPromptAt:t?.lastParentPromptAt,name:t?.title,task:t?qoe(t.title,[...n.flatMap(e=>e.type===`tool_call_response`&&e.payload.toolName===`subagent_prompt`?[{toolName:e.payload.toolName,arguments:e.payload.arguments}]:[]),...e.toolCalls.filter(e=>e.toolName===`subagent_prompt`).map(e=>({toolName:e.toolName,arguments:e.arguments}))]):void 0,agentProfile:t?.agentProfile??i.agentProfile??`Unknown profile`,permissionRuleSetId:t?.permissionRuleSetId??i.permissionRuleSetId,model:t?.model??i.model,thinkingLevel:t?void 0:i.reasoningLevel,systemPrompt:t?void 0:i.systemPrompt??void 0,createdAt:r.createdAt,updatedAt:r.updatedAt}}function z8(e,t,n=[]){let r=t.findLast(e=>e.type===`assistant_message`||e.type===`compaction`),i=r?.type===`assistant_message`?r.payload:void 0,a=n.find(t=>t.provider===(i?.provider??e.config.model?.provider)&&t.modelId===(i?.model??e.config.model?.modelId))?.contextWindow??0,o=i?i.usage.input+i.usage.cacheRead+i.usage.cacheWrite:null,s=[R8(e),...e.children.map(n=>R8(e,n,t))],c={},l=e.children.filter(e=>e.status===`running`||e.status===`waiting`||e.pendingWork).length+e.asyncBash.filter(e=>e.status===`running`).length;for(let t of[e.conversation,...e.children]){let n=t.id===e.conversation.id,r=n?l>0:`pendingWork`in t&&t.pendingWork,i=t.status===`running`?`running`:t.status===`waiting`?`awaiting_user`:t.status===`failed`?`error`:r?`awaiting_async`:t.status===`interrupted`?`aborted`:`idle`;c[t.id]={agentId:t.id,conversationId:t.id,state:i,pendingInteractionCount:n?e.toolCalls.filter(e=>e.interaction&&!e.interaction.resolution).length:0,pendingAsyncCount:n?l:0,updatedAt:t.updatedAt}}return{activeConversation:L8(e),conversationAgents:s,agentActivities:c,conversationUsage:SB(t.map(z6)),contextUsage:{tokens:o,contextWindow:a,percent:o!==null&&a?o/a*100:null},contextWindow:a}}var Joe=/^\[Tool call:([\s\S]*)\]$/,B8=new Set([`ask_user`,`plan_present`]),Yoe={read:`file-text`,bash:`terminal`,async_bash:`cpu`,launch:`cpu`,python:`terminal`,edit:`file-pen`,write:`file-plus`,grep:`search`,find:`folder-search`,ls:`folder-tree`,web_fetch:`download`,ask_user:`message-circle-question`,plan_present:`clipboard-check`};function V8(e){return e&&Yoe[e]||`wrench`}function H8(e){return e&&typeof e==`object`?e:void 0}function U8(e){return typeof e==`string`&&e.length>0?e:void 0}function W8(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function Xoe(e){let t=e?.thinkingBlocks;return Array.isArray(t)?t.some(e=>{let t=H8(e);return t?typeof t.text==`string`&&t.text.length>0||t.redacted===!0:!1}):!1}function Zoe(e){if(!e)return{};let t=H8(H8(e.details)?.toolCall);return{recordId:W8(e.toolRecordId)??W8(t?.id),providerId:U8(e.toolCallId)??U8(e.providerToolCallId)??U8(t?.providerToolCallId)}}function Qoe(e,t){let n=Zoe(e);if(n.recordId)return t.get(n.recordId);if(n.providerId)return[...t.values()].find(e=>e.providerToolCallId===n.providerId||e.sourceToolCallId===n.providerId)}function G8(e){let t=e.trim().match(Joe);if(!t)return[];let n=[...t[1].matchAll(/([a-z_][a-z0-9_]*)\s*\(/gi)];return n.length>0?n.map(e=>e[1]):t[1].split(`,`).map(e=>e.trim()).filter(e=>/^[a-z_][a-z0-9_]*$/i.test(e))}function K8(e,t=240){let n=e.replace(/```[^\n]*\n?/g,` `).replace(/!?\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/(\*\*|__|`)/g,``).replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+|\d+\.\s+)/gm,``).replace(/^\[[ xX]\]\s+/gm,``).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}var q8=e=>K8(e);function J8(e,t){let n=H8(e.details),r=[],i=e.usage?.totalTokens,a=()=>i&&i>0?{icon:`sparkles`,label:i>=1e3?`${Math.round(i/1e3)}k`:`${i}`,tone:`neutral`,title:`${i.toLocaleString()} tokens`}:void 0;if(e.kind===`compaction`)return{type:`compaction`,icon:`fold-vertical`,label:`Compacted`,preview:q8(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`branch_summary`)return{type:`branch_summary`,icon:`git-branch`,label:`Branch summary`,preview:q8(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.role===`user`)return{type:`user`,icon:`user`,label:`You`,preview:q8(e.text)||`empty message`,tone:`neutral`,mono:!1,badges:r};if(e.role===`assistant`){Xoe(n)&&r.push({icon:`brain`,tone:`info`,title:`Includes thinking`});let t=G8(e.text);if(t.length>0){let e=t[0],n=t.some(e=>B8.has(e)),i=t.length>1?` +${t.length-1}`:``;return{type:n?`human_loop`:`tool_call`,icon:V8(e),label:`${e}${i}`,preview:t.slice(0,4).join(`, `),tone:n?`warning`:`neutral`,mono:!0,badges:n?[{icon:`hand`,label:`input`,tone:`warning`},...r]:r}}let i=a();return i&&r.push(i),{type:`assistant`,icon:`sparkles`,label:`Assistant`,preview:q8(e.text)||`(thinking)`,tone:`neutral`,mono:!1,badges:r}}let o=U8(n?.toolName);if(o){let i=Qoe(n,t),a=n?.isError===!0||i?.status===`failed`||i?.status===`denied`,s=B8.has(o)||i?.risk===`interaction`||i?.interaction?.kind===`approval`;return s&&r.push({icon:`hand`,label:`human`,tone:`warning`}),a&&r.push({icon:`triangle-alert`,label:`error`,tone:`destructive`}),{type:s?`human_loop`:`tool_result`,icon:V8(o),label:o,preview:q8(e.text),tone:a?`destructive`:s?`warning`:`success`,mono:!0,badges:r}}return{type:`system`,icon:`info`,label:`System`,preview:q8(e.text)||`system entry`,tone:`neutral`,mono:!1,badges:r}}var Y8={user:ST,sparkles:$u,brain:kw,wrench:At,"file-text":hd,terminal:qc,"file-pen":Tre,"file-plus":zw,search:lf,"folder-search":Mre,"folder-tree":Ud,globe:Gn,download:df,cpu:Ft,bot:Ot,"message-circle-question":Xw,"clipboard-list":Nw,"clipboard-check":Mw,"fold-vertical":Gl,"git-branch":nc,info:Un,hand:Kre,"triangle-alert":bn},X8=`history-root`,Z8=new Set([`tool_call`,`tool_result`,`system`]);function Q8(e,t){let n=new Map,r=(e,t,r,i)=>{let a=n.get(e);return a||(a={key:e,icon:t,label:e,tone:r,count:0,tool:i,results:0},n.set(e,a)),a};for(let n of e){let e=J8(n,t);if(e.type===`tool_call`)for(let e of G8(n.text))r(e,V8(e),`neutral`,!0).count+=1;else if(e.type===`tool_result`){let t=r(e.label,e.icon,`neutral`,!0);t.results+=1,e.tone===`destructive`&&(t.tone=`destructive`)}else r(e.label,e.icon,`neutral`,!1).count+=1}let i=[...n.values()].map(({results:e,...t})=>({...t,count:t.tool?Math.max(t.count,e):t.count}));return i.sort((e,t)=>Number(t.tool)-Number(e.tool)||t.count-e.count),{steps:i,toolCount:i.reduce((e,t)=>e+(t.tool?t.count:0),0)}}function $oe(e,t,n=new Map){let r=new Map(e.map(e=>[e.entry.id,e])),i=e=>(r.get(e)?.childEntryIds??[]).filter(e=>r.has(e)),a=e.filter(e=>e.entry.parentEntryId===void 0||!r.has(e.entry.parentEntryId)).map(e=>e.entry.id),o=t!==void 0&&r.has(t),s=new Set;for(let e=o?t:void 0;e&&!s.has(e);e=r.get(e)?.entry.parentEntryId)s.add(e);let c=new Map,l=e=>{let t=c.get(e.id);return t||(t=J8(e,n),c.set(e.id,t)),t},u=e=>{let n=r.get(e);return e!==t&&i(e).length===1&&Z8.has(l(n.entry).type)},d=new Map,f=[],p=new Map,m={id:X8,kind:`start`,role:`start`,childIds:[],label:`Start of conversation`,folded:[],steps:[],toolCount:0,current:!0,head:!o};d.set(m.id,m),f.push(m.id);let h=new Set,g=[...a].reverse().map(e=>({entryId:e,parentId:m.id}));for(;g.length;){let{entryId:e,parentId:a}=g.pop();if(h.has(e))continue;let o=[],c=e;for(h.add(c);u(c);){o.push(r.get(c).entry);let e=i(c)[0];if(h.has(e))break;c=e,h.add(c)}let m=r.get(c).entry,_=l(m),{steps:v,toolCount:y}=Q8(o,n),b={id:c,kind:m.role===`user`?`user`:`assistant`,role:`entry`,entry:m,parentId:a,childIds:[],label:_.preview,descriptor:_,folded:o,steps:v,toolCount:y,current:s.has(c),head:c===t};d.set(b.id,b),f.push(b.id),p.set(c,b.id);for(let e of o)p.set(e.id,b.id);d.get(a).childIds.push(b.id);let x=i(c);for(let e=x.length-1;e>=0;e--)g.push({entryId:x[e],parentId:b.id})}for(let e of[...f].reverse()){let t=d.get(e);for(;t?.entry&&t.childIds.length===0&&Z8.has(t.descriptor?.type??``);){let e=t.parentId?d.get(t.parentId):void 0;if(!e?.entry||e.childIds.length!==1)break;e.folded.push(...t.folded,t.entry),Object.assign(e,Q8(e.folded,n)),e.head||=t.head,e.childIds=[];for(let[n,r]of p)r===t.id&&p.set(n,e.id);d.delete(t.id),f.splice(f.indexOf(t.id),1),t=e}}let _=0;for(let e of d.values())e.childIds.sort((e,t)=>Number(d.get(e).current)-Number(d.get(t).current)),e.childIds.length>1?e.role=`fork`:e.childIds.length===0&&(e.id!==`history-root`&&(e.role=`tip`),_+=1);return{nodes:d,order:f,headId:o?p.get(t)??`history-root`:X8,ownerOf:p,entryCount:e.length,branchCount:_}}function ese(e){let t=new Map;for(let n of e)for(let e of n.steps){let n=t.get(e.key);n?(n.count+=e.count,e.tone===`destructive`&&(n.tone=`destructive`)):t.set(e.key,{...e})}let n=[...t.values()].sort((e,t)=>Number(t.tool)-Number(e.tool)||t.count-e.count);return{steps:n,toolCount:n.reduce((e,t)=>e+(t.tool?t.count:0),0)}}function $8(e){for(let t=e.length-1;t>0;t--){let n=e[t];if(n.descriptor?.type===`assistant`)return n}let t=e.at(-1);return t&&e.length>1?t:void 0}function e5(e,t,n,r,i){let a=t.at(-1);return{id:e.id,node:e,targetId:a.id,members:t,reply:$8(t),...ese(t),parentId:i,childIds:r,current:e.current,head:n,startedAt:e.entry?.createdAt,endedAt:a.entry?.createdAt??e.entry?.createdAt}}function tse(e,t){let n=new Map,r=[];if(t===`steps`){for(let t of e.order){let i=e.nodes.get(t);n.set(t,e5(i,[i],i.head,[...i.childIds],i.parentId)),r.push(t)}return{items:n,order:r,rootId:X8,headId:e.headId}}let i=e=>e.id===`history-root`||e.kind===`user`,a=X8,o=[{id:X8}];for(;o.length;){let{id:t,parentId:s}=o.pop(),c=e.nodes.get(t),l=[c];for(let t=e.nodes.get(c.childIds.at(-1)??``);t&&!i(t);t=e.nodes.get(t.childIds.at(-1)??``))l.push(t);let u=[],d=c.head,f=[...c.childIds];for(;f.length;){let t=e.nodes.get(f.shift());i(t)?u.push(t.id):(d||=t.head,f.unshift(...t.childIds))}u.sort((t,n)=>Number(e.nodes.get(t).current)-Number(e.nodes.get(n).current));let p=l.slice(1),m=d&&!c.head,h=t;if(p.length){let e=$8(l)??p.at(-1),i={...e5(e,p,m,u,t),targetId:p.at(-1).id,startedAt:c.entry?.createdAt};n.set(t,e5(c,[c],c.head,[e.id],s)),r.push(t),n.set(e.id,i),r.push(e.id),h=e.id}else n.set(t,e5(c,l,d,u,s)),r.push(t);c.head?a=t:d&&(a=h);for(let e=u.length-1;e>=0;e--)o.push({id:u[e],parentId:h})}return{items:n,order:r,rootId:X8,headId:a}}function nse(e,t=new Set){let{items:n}=e,r=[],i=new Map,a=1,o=()=>[...i].map(([e,t])=>({lane:e,current:t})),s=e=>{let t=e;for(;i.has(t);)t+=1;return a=Math.max(a,t+1),t},c=(a,l)=>{if(t.has(a))r.push({itemId:a,lane:l,folded:{count:rse(e,a)},pass:o(),up:n.get(a).current,forks:[]});else for(let e=a;e;){let t=n.get(e),a=t.childIds.at(-1),u=t.childIds.slice(0,-1),d={itemId:e,lane:l,pass:o(),up:t.parentId?t.current:void 0,down:a?n.get(a).current:void 0,forks:[]};if(r.push(d),u.length){i.set(l,n.get(a).current);let e=u.map(e=>{let t=s(l+1);return i.set(t,n.get(e).current),t});d.forks=e.map((e,t)=>({lane:e,current:n.get(u[t]).current})),u.forEach((t,n)=>{i.delete(e[n]),c(t,e[n])}),i.delete(l)}e=a}};return c(e.rootId,0),{rows:r,laneCount:a}}function rse(e,t){let n=0,r=[t];for(;r.length;){let t=e.items.get(r.pop());t&&(n+=1,r.push(...t.childIds))}return n}function ise(e,t,n=3){let r=new Map,i=new Map;for(let n of[...e.order].reverse()){let a=e.items.get(n),o=1,s=t.has(n)||a.head;for(let e of a.childIds)o+=r.get(e)??0,s||=i.get(e)??!1;r.set(n,o),i.set(n,s)}let a=new Set;for(let t of e.order){let o=e.items.get(t);for(let e of o.childIds.slice(0,-1))(r.get(e)??0)>=n&&!i.get(e)&&a.add(e)}return a}function ase(e,t){let n=e.items.get(t);if(!n?.current||n.head)return 0;let r=0;for(let t=e.items.get(n.childIds.at(-1)??``);t?.current&&(r+=1,!t.head);t=e.items.get(t.childIds.at(-1)??``));return r}function ose(e,t){let n=new Set;if(t.trim().length<2)return n;for(let r of e.order)e.items.get(r).members.some(e=>{let n=e.entry;return n?Uo(t,n.summary,n.text,...e.folded.map(e=>e.text)):!1})&&n.add(r);return n}function sse(e,t){if(!e||!t)return;let n=new Date(t).getTime()-new Date(e).getTime();if(!Number.isFinite(n)||n<1e3)return;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60);if(i<60)return`${i}m ${r%60}s`;if(!(i>=1440))return`${Math.floor(i/60)}h ${i%60}m`}var cse=(e,t=m)=>{var n=f(),r=R(n),i=e=>{var n=n5(),r=z(n,!0);F(()=>w(r,t())),k(e,n)};l(r,e=>{t()&&e(i)}),k(e,n)},lse=(e,n=m)=>{let r=L(()=>n().node.entry);var i=r5(),a=R(i),o=e=>{be(e,{variant:`brand`,children:(e,t)=>{y();var n=g(`Current`);k(e,n)},$$slots:{default:!0}})},s=e=>{be(e,{children:(e,t)=>{y();var n=g(`Branch tip`);k(e,n)},$$slots:{default:!0}})};l(a,e=>{n().head?e(o):!n().current&&n().childIds.length===0&&e(s,1)});var c=G(a,2),u=e=>{var n=gse(),i=z(n,!0);F((e,t)=>{J(n,`title`,e),w(i,t)},[()=>Ms(t(r).createdAt),()=>js(t(r).createdAt)]),k(e,n)};l(c,e=>{t(r)&&e(u)}),k(e,i)},t5=O(`<span></span>`),use=O(`<div class="relative shrink-0 self-stretch"><!> <!> <!> <!> <span aria-hidden="true"><!></span></div>`),dse=O(`<!> `,1),fse=O(`<!>Fork here`,1),pse=O(`<!>Edit & resend`,1),mse=O(`<!>Show in conversation`,1),hse=O(`<div class="flex flex-wrap items-center gap-1.5 pt-1"><!> <!> <!> <!></div>`),n5=O(`<span class="shrink-0 text-caption text-muted-foreground tabular-nums"> </span>`),gse=O(`<span class="w-7 shrink-0 text-right text-caption text-muted-foreground tabular-nums"> </span>`),r5=O(`<!> <!>`,1),_se=O(`<div class="flex min-h-5 min-w-0 items-center gap-1.5 text-ui text-muted-foreground"><!> <span class="shrink-0"> </span> <span class="truncate"> </span></div>`),vse=O(`<div class="flex min-h-5 items-center text-ui text-muted-foreground">Start of conversation</div> <!>`,1),yse=O(`<p class="truncate text-caption text-muted-foreground"> </p>`),bse=O(`<div class="flex min-h-5 min-w-0 items-start gap-2"><span> </span> <div class="flex shrink-0 items-center gap-2"><!> <!></div></div> <!>`,1),xse=O(`<div class="grid min-w-0 flex-1 gap-1.5 py-1.5"><!></div>`),Sse=O(`<span class="text-caption text-muted-foreground tabular-nums"> </span>`),Cse=O(`<div class="flex flex-1 items-center justify-center gap-2 text-ui text-muted-foreground"><!>Loading history…</div>`),wse=O(`<div class="flex flex-1 items-center justify-center text-ui text-muted-foreground">No messages yet.</div>`),Tse=O(`<div role="option" tabindex="-1"><!> <!></div>`),Ese=O(`<div class="relative isolate flex min-h-0 flex-1 flex-col"><div class="min-h-0 flex-1 overflow-y-auto px-(--conversation-content-inset,1.5rem) py-2 outline-none [scrollbar-gutter:stable]" role="listbox" tabindex="0" aria-label="Conversation history"><div role="none"></div></div> <div aria-hidden="true"></div> <div aria-hidden="true"></div></div>`),Dse=O(`<div data-tour-id="conversation-history" class="flex h-full min-h-0 flex-col"><div class="flex flex-wrap items-center gap-2 border-b border-border-subtle py-1.5 pr-[calc(var(--conversation-content-inset,1.5rem)+var(--conversation-scrollbar-lane,0px))] pl-(--conversation-content-inset,1.5rem)"><!> <!> <span class="flex-1"></span> <!> <!> <!></div> <!> <!></div>`);function Ose(e,n){c(n,!0);let r=(e,n=m,r=m)=>{let i=L(()=>r().id===`history-root`?void 0:r().node.kind===`user`?Y8.user:r().node.descriptor?.type===`assistant`||!r().node.descriptor?Y8.sparkles:Y8[r().node.descriptor.icon]);var a=use();let o;var s=q(a);v(s,17,()=>n().pass,e=>e.lane,(e,n)=>{var r=t5();let i;F((e,t)=>{X(r,1,e),i=I(r,``,i,{left:t})},[()=>T([`absolute top-0 bottom-0 w-px`,Ee(t(n).current)]),()=>`${_(t(n).lane)}px`]),k(e,r)});var c=G(s,2),u=e=>{var t=t5();let r;F((e,n)=>{X(t,1,e),r=I(t,``,r,{left:n,height:`${p}px`})},[()=>T([`absolute top-0 w-px`,Ee(n().up)]),()=>`${_(n().lane)}px`]),k(e,t)};l(c,e=>{n().up!==void 0&&e(u)});var d=G(c,2),h=e=>{var t=t5();let r;F((e,n)=>{X(t,1,e),r=I(t,``,r,{left:n,top:`${p}px`})},[()=>T([`absolute bottom-0 w-px`,Ee(n().down)]),()=>`${_(n().lane)}px`]),k(e,t)};l(d,e=>{n().down!==void 0&&e(h)});var g=G(d,2);v(g,17,()=>n().forks,e=>e.lane,(e,r)=>{var i=t5();let a;F((e,n)=>{X(i,1,T([`absolute bottom-0 rounded-tr-md border-t border-r`,t(r).current?`border-primary`:`border-muted-foreground opacity-40`])),a=I(i,``,a,{left:e,top:`${p}px`,width:n})},[()=>`${_(n().lane)}px`,()=>`${_(t(r).lane)-_(n().lane)+1}px`]),k(e,i)});var y=G(g,2);let b;var S=q(y),C=e=>{var n=f(),r=R(n);H(r,()=>t(i),(e,t)=>{t(e,{class:`size-3`})}),k(e,n)};l(S,e=>{t(i)&&e(C)}),x(y),x(a),F(e=>{o=I(a,``,o,{width:`${t(ie)}px`}),X(y,1,T([`absolute flex items-center justify-center rounded-full border`,t(i)?`size-5`:`size-2.5 border-2`,r().node.kind===`user`?r().head?`border-info bg-info text-info-foreground`:r().current?`border-info bg-background text-info`:`border-muted-foreground bg-background text-muted-foreground`:r().head?`border-primary bg-primary text-primary-foreground`:r().current?`border-primary bg-background text-primary`:`border-muted-foreground bg-background text-muted-foreground`,n().folded&&`border-dashed`])),b=I(y,``,b,{left:e,top:`${p}px`,transform:`translate(-50%, -50%)`})},[()=>`${_(n().lane)+.5}px`]),k(e,a)},i=(e,r=m)=>{let i=L(()=>ase(t(j),r().id));var a=hse(),o=q(a),s=e=>{{let n=L(()=>!t(he)),a=L(()=>t(i)>0?`The ${t(i)} later ${t(i)===1?`message stays`:`messages stay`} as a side branch. Workspace files are not changed.`:`Workspace files are not changed.`);Q(e,{size:`sm`,get disabled(){return t(n)},get title(){return t(a)},onclick:()=>_e(r()),children:(e,t)=>{var n=dse(),i=R(n);bT(i,{});var a=G(i,1,!0);F(e=>w(a,e),[()=>Se(r())]),k(e,n)},$$slots:{default:!0}})}},c=L(()=>!u()&&ge(r()));l(o,e=>{t(c)&&e(s)});var d=G(o,2),f=e=>{{let n=L(()=>!t(he));Q(e,{size:`sm`,variant:`outline`,get disabled(){return t(n)},title:`Start a new conversation from here. This one is not changed.`,onclick:()=>Z(r()),children:(e,t)=>{var n=fse();Ww(R(n),{}),y(),k(e,n)},$$slots:{default:!0}})}},p=L(()=>!u()&&ve(r()));l(d,e=>{t(p)&&e(f)});var h=G(d,2),g=e=>{{let n=L(()=>!t(he));Q(e,{size:`sm`,variant:`outline`,get disabled(){return t(n)},onclick:()=>be(r()),children:(e,t)=>{var n=pse(),r=R(n);Dn(r,{}),y(),k(e,n)},$$slots:{default:!0}})}};l(h,e=>{!u()&&r().node.kind===`user`&&e(g)});var _=G(h,2),v=e=>{Q(e,{size:`sm`,variant:`ghost`,onclick:()=>n.onReveal(r().node.entry.id),children:(e,t)=>{var n=mse(),r=R(n);uf(r,{}),y(),k(e,n)},$$slots:{default:!0}})};l(_,e=>{r().current&&r().node.entry&&e(v)}),x(a),k(e,a)},a=(e,n=m,r=m,a=m)=>{let o=L(()=>r().node.kind===`user`),s=L(()=>t(o)?``:Te(r()));var c=xse(),d=q(c),f=e=>{var t=_se(),i=q(t);mn(i,{class:`size-3.5 shrink-0`});var a=G(i,2),o=z(a),s=G(a,2),c=z(s);x(t),F(e=>{w(o,`Side branch · ${n().folded.count??``}`),w(c,`“${e??``}”`)},[()=>K8(Ce(r()))]),k(e,t)},p=e=>{var t=vse(),n=G(R(t),2),o=e=>{i(e,r)};l(n,e=>{a()&&!u()&&!r().head&&e(o)}),k(e,t)},h=e=>{var n=bse(),c=R(n),u=q(c),d=z(u,!0),f=G(u,2),p=q(f);cse(p,()=>t(s)),lse(G(p,2),r),x(f),x(c);var m=G(c,2),h=e=>{var n=r5(),a=R(n),s=e=>{var t=yse(),n=z(t,!0);F(e=>w(n,e),[()=>we(r())]),k(e,t)};l(a,e=>{t(C)===`steps`&&!t(o)&&r().toolCount>0&&e(s)});var c=G(a,2);i(c,r),k(e,n)};l(m,e=>{a()&&e(h)}),F(e=>{X(u,1,T([`min-w-0 flex-1 text-ui break-words`,a()?t(o)?`line-clamp-8 whitespace-pre-wrap`:`line-clamp-6`:`truncate`,(!t(o)||!r().current)&&!a()&&`text-muted-foreground`])),w(d,e)},[()=>a()&&t(o)?Ce(r()):K8(Ce(r()))]),k(e,n)};l(d,e=>{n().folded?e(f):r().id===`history-root`?e(p,1):e(h,-1)}),x(c),k(e,c)},o=K(n,`toolCalls`,19,()=>[]),s=K(n,`loading`,3,!1),u=K(n,`readOnly`,3,!1),d=K(n,`rewindLocked`,3,!1),p=16,_=e=>11+e*22,b=L(()=>new Map(o().map(e=>[e.id,e]))),S=L(()=>$oe(n.treeNodes,n.activeEntryId,t(b))),C=Y(`messages`),E=Y(``),O=Y(void 0),A=new mo,j=L(()=>tse(t(S),t(C))),M=L(()=>ose(t(j),t(E))),N=L(()=>t(j).order.filter(e=>t(M).has(e))),P=L(()=>t(O)&&t(j).items.has(t(O))?t(O):t(j).headId),ee=L(()=>{let e=new Set([t(P),...t(M)]),n=ise(t(j),e);for(let e of A)n.delete(e);return n}),re=L(()=>nse(t(j),t(ee))),ie=L(()=>_(t(re).laneCount-1)+12),ae=L(()=>[...t(j).items.values()].filter(e=>e.node.kind===`user`).length),V=L(()=>t(j).items.size<=1),oe=Y(void 0),se=Y(!1),ce=Y(!1);W(()=>{let e=t(oe);if(!e)return;let n=()=>{let t=Uc(e);B(se,t.top,!0),B(ce,t.bottom,!0)};n(),e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(n);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,n),r.disconnect()}});function U(e){return t(oe)?.querySelector(`[data-history-item="${CSS.escape(e)}"]`)}let le=typeof matchMedia==`function`?matchMedia(`(prefers-reduced-motion: reduce)`):void 0;async function ue(e,n=!0){let r=[...new Set([t(P),e])],i=new Map(r.map(e=>[e,U(e)?.getBoundingClientRect().height]));B(O,e,!0),await ne();let a=[];for(let[e,t]of i){let n=U(e);if(!n||t===void 0||le?.matches)continue;for(let e of n.getAnimations())e.cancel();let r=n.getBoundingClientRect().height;if(Math.abs(r-t)<1)continue;let i=n.animate([{height:`${t}px`,overflow:`hidden`},{height:`${r}px`,overflow:`hidden`}],{duration:180,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`});a.push(i.finished.catch(()=>void 0))}n&&(await Promise.all(a),t(O)===e&&U(e)?.scrollIntoView({block:`nearest`}))}let de=!1;W(()=>{de||s()||t(V)||!t(oe)||(de=!0,ne().then(()=>{U(t(P))?.scrollIntoView({block:`center`}),t(oe)?.focus({preventScroll:!0})}))});async function fe(e){B(C,e,!0),await ne(),U(t(P))?.scrollIntoView({block:`center`})}function pe(e){let n=t(re).rows.map(e=>e.itemId),r=Math.max(0,n.indexOf(t(P))),i=n[Math.min(n.length-1,Math.max(0,r+e))];i&&ue(i)}function me(e){if(!t(N).length)return;let n=t(N).indexOf(t(P));ue(n<0?e>0?t(N)[0]:t(N).at(-1):t(N)[(n+e+t(N).length)%t(N).length])}let he=L(()=>!u()&&!d()),ge=e=>!e.head&&(e.id===`history-root`||e.node.kind!==`user`);function _e(e){t(he)&&ge(e)&&n.onRewind(e.id===`history-root`?void 0:e.targetId)}let ve=e=>!!n.onFork&&e.id!==`history-root`&&e.node.kind!==`user`;function Z(e){t(he)&&ve(e)&&n.onFork?.(e.targetId)}function be(e){let r=e.node.entry;t(he)&&e.node.kind===`user`&&r&&n.onEdit(r)}function xe(e){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=t(j).items.get(t(P)),i=t(re).rows.find(e=>e.itemId===t(P));switch(e.key){case`ArrowDown`:pe(1);break;case`ArrowUp`:pe(-1);break;case`Home`:ue(t(j).rootId);break;case`End`:case`c`:case`C`:ue(t(j).headId);break;case`ArrowRight`:i?.folded&&A.add(i.itemId);break;case`Enter`:i?.folded?A.add(i.itemId):r&&_e(r);break;case`e`:case`E`:r&&be(r);break;case`Escape`:n.onClose();break;default:return}e.preventDefault()}function Se(e){return e.id===`history-root`?`Rewind to start`:!e.current&&e.childIds.length===0?`Switch to this branch`:`Rewind here`}function Ce(e){let{entry:t,kind:n,label:r,descriptor:i}=e.node;return(n===`user`?t?.summary||t?.text:r)||i?.label||r}function we(e){return e.steps.filter(e=>e.tool).slice(0,3).map(e=>e.count>1?`${e.label} ×${e.count}`:e.label).join(`, `)}function Te(e){let t=[];e.toolCount&&t.push(`${e.toolCount} ${e.toolCount===1?`tool`:`tools`}`);let n=sse(e.startedAt,e.endedAt);return n&&t.push(n),t.join(` · `)}let Ee=e=>e?`bg-primary`:`bg-muted-foreground opacity-40`;var De=Dse(),Oe=q(De),ke=q(Oe);ks(ke,{placeholder:`Search messages`,ariaLabel:`Search messages`,class:`w-56`,onkeydown:e=>{e.key===`Enter`?(e.preventDefault(),me(e.shiftKey?-1:1)):e.key===`Escape`&&!t(E)&&(e.preventDefault(),t(oe)?.focus())},get value(){return t(E)},set value(e){B(E,e,!0)},trailing:e=>{var n=f(),r=R(n),i=e=>{var n=n5(),r=z(n,!0);F(e=>w(r,e),[()=>t(N).includes(t(P))?`${t(N).indexOf(t(P))+1}/${t(M).size}`:t(M).size]),k(e,n)},a=L(()=>t(E).trim().length>=2);l(r,e=>{t(a)&&e(i)}),k(e,n)},$$slots:{trailing:!0}});var Ae=G(ke,2);H(Ae,()=>ti,(e,n)=>{n(e,{type:`single`,variant:`chip`,size:`sm`,get value(){return t(C)},"aria-label":`History detail`,onValueChange:e=>{(e===`messages`||e===`steps`)&&fe(e)},children:(e,t)=>{var n=r5(),r=R(n);H(r,()=>ni,(e,t)=>{t(e,{value:`messages`,children:(e,t)=>{y();var n=g(`Messages`);k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>ni,(e,t)=>{t(e,{value:`steps`,children:(e,t)=>{y();var n=g(`All steps`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})});var je=G(Ae,4),Me=e=>{var n=Sse(),r=z(n);F(()=>w(r,`${t(ae)??``}
154
+ ${t(ae)===1?`message`:`messages`} · ${t(S).branchCount??``}
155
+ ${t(S).branchCount===1?`branch`:`branches`}`)),k(e,n)};l(je,e=>{t(V)||e(Me)});var Ne=G(je,2);Mn(Ne,{get icon(){return Qre},label:`Jump to current (C)`,onclick:()=>void ue(t(j).headId)});var Pe=G(Ne,2);Mn(Pe,{get icon(){return ye},label:`Back to conversation (Esc)`,get onclick(){return n.onClose}}),x(Oe);var Fe=G(Oe,2),Ie=e=>{nn(e,{class:`mt-2 mr-[calc(var(--conversation-content-inset,1.5rem)+var(--conversation-scrollbar-lane,0px))] ml-(--conversation-content-inset,1.5rem)`,layout:`strip`,get icon(){return ww},text:`Sub-agent history is read-only. Rewind from the lead conversation.`})},Le=e=>{nn(e,{class:`mt-2 mr-[calc(var(--conversation-content-inset,1.5rem)+var(--conversation-scrollbar-lane,0px))] ml-(--conversation-content-inset,1.5rem)`,tone:`warning`,layout:`strip`,get icon(){return Xs},text:`Stop the run to rewind or edit. You can still browse.`})};l(Fe,e=>{u()?e(Ie):d()&&e(Le,1)});var Re=G(Fe,2),ze=e=>{var t=Cse(),n=q(t);dn(n,{class:`size-4`}),y(),x(t),k(e,t)},Be=e=>{var t=wse();k(e,t)},Ve=e=>{var n=Ese(),i=q(n),o=q(i);v(o,21,()=>t(re).rows,e=>e.itemId,(e,n)=>{let i=L(()=>t(j).items.get(t(n).itemId)),o=L(()=>t(n).itemId===t(P));var s=Tse(),c=q(s);r(c,()=>t(n),()=>t(i));var l=G(c,2);a(l,()=>t(n),()=>t(i),()=>t(o)),x(s),F(e=>{J(s,`id`,`history-item-${t(n).itemId}`),J(s,`data-history-item`,t(n).itemId),X(s,1,e),J(s,`aria-selected`,t(o))},[()=>T(Wc({selected:t(o)}).base({class:[`flex cursor-pointer gap-1.5 pr-2`,t(E).trim().length>=2&&!t(M).has(t(n).itemId)&&`opacity-50`]}))]),h(`click`,s,()=>{t(n).folded&&A.add(t(n).itemId),ue(t(n).itemId,!1),t(oe)?.focus({preventScroll:!0})}),h(`keydown`,s,()=>void 0),k(e,s)}),x(o),x(i),te(i,e=>B(oe,e),()=>t(oe));var s=G(i,2);let c;var l=G(s,2);let u;x(n),F(()=>{J(i,`aria-activedescendant`,`history-item-${t(P)}`),c=X(s,1,`pointer-events-none absolute top-0 right-3 left-0 z-2 h-6 bg-linear-to-b from-background to-transparent opacity-0 transition-opacity duration-150`,null,c,{"opacity-100":t(se)}),u=X(l,1,`pointer-events-none absolute right-3 bottom-0 left-0 z-2 h-6 bg-linear-to-t from-background to-transparent opacity-0 transition-opacity duration-150`,null,u,{"opacity-100":t(ce)})}),h(`keydown`,i,xe),k(e,n)};l(Re,e=>{t(V)&&s()?e(ze):t(V)?e(Be,1):e(Ve,-1)}),x(De),k(e,De),D()}ue([`keydown`,`click`]);var kse=new Set([`$$slots`,`$$events`,`$$legacy`,`store`]);function Ase(e,n){c(n,!0);let r=V(n,kse),i=Y(!0);W(()=>{let e=n.store;B(i,!0),me(()=>e.loadHistoryTree()).catch(()=>void 0).finally(()=>{e===n.store&&B(i,!1)})});let a=L(()=>n.store.snapshot?V6({snapshot:n.store.snapshot,events:n.store.historyEvents??n.store.events}):void 0),o=L(()=>n.store.snapshot?L8(n.store.snapshot).activeEntryId:void 0);{let n=L(()=>t(a)?.treeNodes??[]),s=L(()=>t(a)?.toolCalls??[]);Ose(e,P(()=>r,{get treeNodes(){return t(n)},get toolCalls(){return t(s)},get activeEntryId(){return t(o)},get loading(){return t(i)}}))}D()}var jse=48;function i5(e){return e.agentProfile}function Mse(e){switch(e?.state){case`awaiting_user`:return`needs_you`;case`running`:return`working`;case`awaiting_async`:return`waiting`;case`error`:return`failed`;case`aborted`:return`stopped`;default:return`idle`}}function a5(e){return(e??[]).filter(e=>e.status===`running`)}function Nse(e){let t=e.trim().split(`
156
+ `)[0]??``;return t.length>jse?`${t.slice(0,47)}…`:t}function o5(e){if(!e)return!1;let t=e=>e===`running`||e===`waiting`;return t(e.conversation.status)||a5(e.asyncBash).length>0||e.children.some(e=>t(e.status)||e.pendingWork)}function Pse(e){return[...e.children.filter(e=>e.status===`running`||e.status===`waiting`||e.pendingWork).sort(m4).map(e=>({kind:`agent`,id:e.id,label:e.title.trim()||`Sub-agent`})),...a5(e.asyncBash).map(e=>({kind:`command`,id:e.id,label:Nse(e.command)}))]}var Fse=new Set([`idle`,`stopped`,`failed`]);function s5(e){let t=Date.parse(e);return Number.isFinite(t)?t:0}function c5(e,t){let n=Math.max(6,e.findLastIndex(t)+1);return e.length-n<=1?{rows:[...e],folded:[]}:{rows:e.slice(0,n),folded:e.slice(n)}}function Ise(e,t,n){let r=e.filter(e=>!!e.parentAgentId).map(e=>{let r=Mse(t[e.id]);return{agent:e,name:e.name?.trim()||`Sub-agent`,profile:i5(e),state:r,viewed:e.id===n}}).sort((e,t)=>m4(e.agent,t.agent));return{leadId:e.find(e=>!e.parentAgentId)?.id,...c5(r,e=>e.viewed||!Fse.has(e.state)),running:r.filter(e=>e.state===`working`||e.state===`waiting`).length,total:r.length}}function Lse(e){let t=e.filter(e=>e.status===`running`).sort((e,t)=>s5(t.startedAt)-s5(e.startedAt)||e.id.localeCompare(t.id)),n=e.filter(e=>e.status!==`running`).sort((e,t)=>s5(t.finishedAt??t.startedAt)-s5(e.finishedAt??e.startedAt)||e.id.localeCompare(t.id)).slice(0,5);return{...c5([...t,...n],e=>e.status===`running`),running:t.length,total:t.length+n.length}}var l5={running:`Running`,completed:`Completed`,failed:`Failed`,timed_out:`Timed out`,cancelled:`Cancelled`,lost:`Lost`};function u5(e,t){return e>0?`${e}/${t}`:String(t)}function Rse(e){return e.trim().split(/\r?\n/,1)[0]||`(empty command)`}var zse=O(`<span><span class="sr-only"> </span> <!></span>`);function d5(e,t){c(t,!0);let n=K(t,`animate`,3,!0);var r=zse();let i;var a=q(r),o=z(a,!0),s=G(a,2),u=e=>{var t=f(),r=R(t),i=e=>{dn(e,{class:`size-3.5 motion-reduce:animate-none!`,role:`presentation`,"aria-hidden":`true`})},a=e=>{Aw(e,{class:`size-3.5`,"aria-hidden":`true`})};l(r,e=>{n()?e(i):e(a,-1)}),k(e,t)},d=e=>{Wn(e,{class:`size-3.5`,"aria-hidden":`true`})},p=e=>{xd(e,{class:`size-3.5`,"aria-hidden":`true`})},m=e=>{mf(e,{class:`size-3.5`,"aria-hidden":`true`})},h=e=>{Ew(e,{class:`size-3.5`,"aria-hidden":`true`})},g=e=>{jw(e,{class:`size-3.5`,"aria-hidden":`true`})};l(s,e=>{t.status===`running`?e(u):t.status===`completed`?e(d,1):t.status===`failed`?e(p,2):t.status===`timed_out`?e(m,3):t.status===`cancelled`?e(h,4):e(g,-1)}),x(r),F(()=>{i=X(r,1,`flex size-4 shrink-0 items-center justify-center`,null,i,{"text-info":t.status===`running`,"text-success":t.status===`completed`,"text-destructive":t.status===`failed`,"text-warning":t.status===`timed_out`||t.status===`lost`,"text-muted-foreground":t.status===`cancelled`}),J(r,`title`,l5[t.status]),w(o,l5[t.status])}),k(e,r),D()}var Bse=O(`<span><span class="sr-only"> </span> <!></span>`),Vse=O(`<!> <span class="flex min-w-0 flex-1 items-center gap-1.5"><span class="min-w-0 truncate text-ui"> </span> <!></span>`,1),Hse=O(`<!> <span class="min-w-0 flex-1 truncate font-mono text-ui"> </span>`,1),Use=O(`<span class="flex size-4 shrink-0 items-center justify-center"><!></span> <span class="min-w-0 truncate"> <span class="tabular-nums"> </span> older</span>`,1),Wse=O(`<div class="flex flex-col divide-y"></div>`),f5=O(`<!> <!>`,1),Gse=O(`<p class="px-2.5 py-3 text-ui text-muted-foreground"> </p>`),Kse=O(`<span class="flex items-center gap-1 text-ui text-info tabular-nums"><!> <span class="sr-only">running</span></span>`),qse=O(`<div class="flex flex-col divide-y"><!></div>`),Jse=O(`<section class="absolute right-0 bottom-full flex max-h-[min(calc(var(--spacing)*80),var(--conversation-activity-height,100vh))] w-full flex-col overflow-hidden rounded-t-md border border-b-0 bg-popover text-popover-foreground shadow-overlay will-change-[clip-path,opacity,transform]"><div class="flex min-w-0 items-center gap-2 border-b px-2.5 py-1"><h2 class="shrink-0 text-ui font-medium"> </h2> <span class="flex min-w-0 flex-1 items-center"><!></span> <!></div> <div class="min-h-0 overflow-y-auto overscroll-contain"><!></div></section>`),p5=O(`<div class="flex shrink-0 overflow-hidden"><!></div>`),Yse=O(`<!> <!> <span class="@max-sm/conversation-activity:hidden">Agents</span> <span class="shrink-0 tabular-nums"> </span>`,1),Xse=O(`<!> <!> <span class="@max-sm/conversation-activity:hidden">Commands</span> <span class="shrink-0 tabular-nums"> </span>`,1),Zse=O(`<div class="relative min-w-0 max-w-(--conversation-activity-width) flex-none" data-tour-id="activity-island"><div><!> <div><div role="group" aria-label="Conversation activity and navigation"><!> <!> <!> <!></div></div></div></div>`);function Qse(e,r){let i=d();c(r,!0);let a=(e,t=m)=>{var n=Bse();let r;var i=q(n),a=z(i,!0),o=G(i,2),s=e=>{var t=f(),n=R(t),r=e=>{dn(e,{class:`size-3.5 motion-reduce:animate-none!`,role:`presentation`,"aria-hidden":`true`})},i=e=>{Aw(e,{class:`size-3.5`,"aria-hidden":`true`})};l(n,e=>{h()?e(r):e(i,-1)}),k(e,t)},c=e=>{jw(e,{class:`size-3.5`,"aria-hidden":`true`})},u=e=>{mf(e,{class:`size-3.5`,"aria-hidden":`true`})},d=e=>{Qs(e,{class:`size-3.5`,"aria-hidden":`true`})},p=e=>{Ew(e,{class:`size-3.5`,"aria-hidden":`true`})},g=e=>{Wn(e,{class:`size-3.5`,"aria-hidden":`true`})};l(o,e=>{t()===`working`?e(s):t()===`needs_you`?e(c,1):t()===`waiting`?e(u,2):t()===`failed`?e(d,3):t()===`stopped`?e(p,4):e(g,-1)}),x(n),F(()=>{r=X(n,1,`flex size-4 shrink-0 items-center justify-center`,null,r,{"text-info":t()===`working`||t()===`waiting`,"text-warning":t()===`needs_you`,"text-destructive":t()===`failed`,"text-muted-foreground":t()===`idle`||t()===`stopped`}),J(n,`title`,we[t()]),w(a,we[t()])}),k(e,n)},o=(e,n=m)=>{{let r=L(()=>n().viewed?`page`:void 0),i=L(()=>`Open ${n().name}${n().profile?` (${n().profile})`:``}: ${we[n().state]}`),o=L(()=>`Open ${n().name}`);Q(e,{"data-row-action":!0,variant:`ghost`,class:`w-full min-w-0 justify-start rounded-none text-left`,get"aria-current"(){return t(r)},get"aria-label"(){return t(i)},get title(){return t(o)},onclick:()=>Ce(n().agent.id),children:(e,t)=>{var r=Vse(),i=R(r);a(i,()=>n().state);var o=G(i,2),s=q(o),c=z(s,!0),u=G(s,2),d=e=>{be(e,{variant:`neutral`,class:`max-w-24 shrink-0 truncate`,get title(){return n().profile},children:(e,t)=>{y();var r=g();F(()=>w(r,n().profile)),k(e,r)},$$slots:{default:!0}})};l(u,e=>{n().profile&&e(d)}),x(o),F(()=>w(c,n().name)),k(e,r)},$$slots:{default:!0}})}},s=(e,n=m)=>{{let i=L(()=>`Open command tab: ${n().command} (${l5[n().status]})`);Q(e,{"data-row-action":!0,variant:`ghost`,class:`w-full min-w-0 justify-start rounded-none text-left`,get"aria-label"(){return t(i)},get title(){return n().command},onclick:()=>{V(),r.onOpenCommand(n())},children:(e,t)=>{var r=Hse(),i=R(r);d5(i,{get status(){return n().status},get animate(){return h()}});var a=G(i,2),o=z(a,!0);F(e=>w(o,e),[()=>Rse(n().command)]),k(e,r)},$$slots:{default:!0}})}},u=(e,r=m,a=m,o=m,s=m,c=m)=>{var u=f5(),d=R(u);v(d,17,r,e=>o()(e),(e,r)=>{var i=f(),a=R(i);n(a,s,()=>t(r)),k(e,i)});var p=G(d,2),h=e=>{var r=f5(),c=R(r);{let e=L(()=>`${i}-folded`);Q(c,{variant:`ghost`,class:`w-full min-w-0 justify-start rounded-none text-left text-ui text-muted-foreground hover:text-foreground`,get"aria-expanded"(){return t(E)},get"aria-controls"(){return t(e)},onclick:()=>B(E,!t(E)),children:(e,n)=>{var r=Use(),i=R(r),o=q(i);{let e=L(()=>[`size-3.5 transition-transform duration-(--motion-enter-compact-duration) ease-(--motion-enter-easing) motion-reduce:transition-none`,t(E)&&`rotate-90`]);mn(o,{get class(){return t(e)},"aria-hidden":`true`})}x(i);var s=G(i,2),c=q(s),l=G(c),u=z(l,!0);y(),x(s),F(()=>{w(c,`${t(E)?`Hide`:`Show`} `),w(u,a().length)}),k(e,r)},$$slots:{default:!0}})}var u=G(c,2),d=e=>{var r=Wse();v(r,21,a,e=>o()(e),(e,r)=>{var i=f(),a=R(i);n(a,s,()=>t(r)),k(e,i)}),x(r),F(()=>J(r,`id`,`${i}-folded`)),S(3,r,()=>le),k(e,r)};l(u,e=>{t(E)&&e(d)}),k(e,r)},g=e=>{var t=Gse(),n=z(t,!0);F(()=>w(n,c())),k(e,t)};l(p,e=>{a().length?e(h):r().length||e(g,1)}),k(e,u)},p=K(r,`open`,15,null),h=K(r,`active`,3,!0),_=L(()=>Ise(r.agents,r.activities,r.viewedId)),b=L(()=>Lse(r.commands)),E=Y(!1),O=L(()=>!!(t(_).leadId&&t(_).leadId!==r.viewedId)),A=L(()=>p()===`agents`?t(_):t(b)),j=Y(void 0),N=Y(void 0),P=Y(void 0),ee=Y(void 0),re=Y(null),ie=Y(null),ae=Y(void 0);W(()=>{if((p()||t(de))&&t(ae)||!t(ee)||!t(P))return;let e=t(ee),n=t(P);function r(){let r=e.getBoundingClientRect(),i=getComputedStyle(n),a=r.width+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),o=r.height+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth);(a!==t(ae)?.width||o!==t(ae)?.height)&&B(ae,{width:a,height:o},!0)}let i=new ResizeObserver(r);return i.observe(e),()=>i.disconnect()});function V(e=!0){let n=p()===`agents`?t(re):t(ie);p(null),e&&n?.focus({preventScroll:!0})}function oe(e){h()&&p()&&t(j)&&!e.composedPath().includes(t(j))&&V()}function se(e){h()&&p()&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),V())}function H(e,t=1){if(!h()||Tc.current)return 0;let n=getComputedStyle(e).getPropertyValue(`--motion-enter-duration`);return(parseFloat(n)||0)*t}function U(e,{leaving:t=!1}={}){return{delay:t?0:H(e,.35),duration:H(e,t?.6:1),easing:td,css:e=>`clip-path: inset(${(1-e)*100}% 0 0 0); opacity: ${Math.min(1,e*1.6)}; transform: translateY(${(1-e)*4}px);`}}function le(e){return pc(e,{duration:H(e,.8),easing:td})}function ue(e){return pc(e,{axis:`x`,duration:H(e,.8),easing:td})}let de=Y(!1),pe=Y(!1),me=L(()=>!!((p()||t(de))&&t(ae))),he,ge=null;fe(()=>{let e=p();if(e===ge)return;B(E,!1);let t=!!e!=!!ge;ge=e,t&&(B(de,!0),_e())});function _e(){clearTimeout(he);let e=t(P)?H(t(P),1.6):0;he=setTimeout(()=>B(de,!1),e&&e+40)}function ve(e){return e.target===e.currentTarget&&e.propertyName===`width`}function Z(e){ve(e)&&clearTimeout(he)}function ye(e){ve(e)&&(clearTimeout(he),B(de,!1))}function xe(e){ve(e)&&_e()}W(()=>()=>clearTimeout(he));async function Se(e,n){p(p()===e?null:e),p()&&n.detail===0&&(await ne(),t(N)?.querySelector(`[data-row-action]`)?.focus({preventScroll:!0}))}function Ce(e){V(!1),r.onSelectAgent(e)}let we={working:`Running`,needs_you:`Needs you`,waiting:`Waiting for background work`,failed:`Error`,stopped:`Aborted`,idle:`Idle`};var Te=f();M(`pointerdown`,ce,oe),M(`keydown`,ce,se);var Ee=R(Te),De=e=>{var n=Zse();let a;var c=q(n);let d;var f=q(c),m=e=>{var n=Jse(),r=q(n),a=q(r),c=z(a,!0),d=G(a,2),f=q(d),m=e=>{var n=Kse(),r=q(n),i=e=>{dn(e,{class:`size-3 motion-reduce:animate-none!`,"aria-hidden":`true`})},a=e=>{Aw(e,{class:`size-3`,"aria-hidden":`true`})};l(r,e=>{h()?e(i):e(a,-1)});var o=G(r,1,!0);y(),x(n),F(()=>{J(n,`title`,`${t(A).running} running`),w(o,t(A).running)}),k(e,n)};l(f,e=>{t(A).running&&e(m)}),x(d);var g=G(d,2);Q(g,{variant:`ghost`,size:`icon-sm`,title:`Collapse activity`,"aria-label":`Collapse activity`,onclick:()=>V(),children:(e,t)=>{qn(e,{class:`size-3.5`})},$$slots:{default:!0}}),x(r);var v=G(r,2),T=q(v);C(T,p,e=>{var n=qse(),r=q(n),i=e=>{u(e,()=>t(_).rows,()=>t(_).folded,()=>e=>e.agent.id,()=>o,()=>`No retained subagents`)},a=e=>{u(e,()=>t(b).rows,()=>t(b).folded,()=>e=>e.id,()=>s,()=>`No retained commands`)};l(r,e=>{p()===`agents`?e(i):e(a,-1)}),x(n),S(1,n,()=>gc,()=>({duration:H(document.body,.6)})),k(e,n)}),x(v),x(n),te(n,e=>B(N,e),()=>t(N)),F(()=>{J(n,`id`,`${i}-list`),J(n,`aria-label`,p()===`agents`?`Agents`:`Commands`),w(c,p()===`agents`?`Agents`:`Commands`)}),M(`introstart`,n,()=>B(pe,!0)),M(`outroend`,n,()=>B(pe,!1)),S(1,n,()=>U),S(2,n,()=>U,()=>({leaving:!0})),k(e,n)};l(f,e=>{p()&&e(m)});var g=G(f,2);let v;var E=q(g),D=q(E),ne=e=>{var n=p5(),r=q(n);Q(r,{variant:`ghost`,size:`icon`,class:`rounded-none`,title:`Back to lead`,"aria-label":`Back to lead`,onclick:()=>Ce(t(_).leadId),children:(e,t)=>{Ol(e,{class:`size-4`})},$$slots:{default:!0}}),x(n),S(3,n,()=>ue),k(e,n)};l(D,e=>{t(O)&&t(_).leadId&&e(ne)});var oe=G(D,2),se=e=>{{let n=L(()=>p()===`agents`),r=L(()=>p()===`agents`?`${i}-list`:void 0),a=L(()=>`Agents: ${t(_).running} running, ${t(_).total} retained`),o=L(()=>`Agents: ${t(_).running} running, ${t(_).total} retained`);Q(e,{variant:`ghost`,class:`min-w-0 flex-auto rounded-none text-ui`,get"aria-expanded"(){return t(n)},get"aria-controls"(){return t(r)},get"aria-label"(){return t(a)},get title(){return t(o)},onclick:e=>Se(`agents`,e),get ref(){return t(re)},set ref(e){B(re,e,!0)},children:(e,n)=>{var r=Yse(),i=R(r),a=e=>{dn(e,{class:`size-3.5 motion-reduce:animate-none!`,"aria-label":`Running agents`})};l(i,e=>{t(_).running&&h()&&e(a)});var o=G(i,2);_d(o,{class:`size-3.5`,"aria-hidden":`true`});var s=G(o,4),c=z(s,!0);F(e=>w(c,e),[()=>u5(t(_).running,t(_).total)]),k(e,r)},$$slots:{default:!0}})}};l(oe,e=>{(t(_).total||p()===`agents`)&&e(se)});var ce=G(oe,2),le=e=>{{let n=L(()=>p()===`commands`),r=L(()=>p()===`commands`?`${i}-list`:void 0),a=L(()=>`Commands: ${t(b).running} running, ${t(b).total} retained`),o=L(()=>`Commands: ${t(b).running} running, ${t(b).total} retained`);Q(e,{variant:`ghost`,class:`min-w-0 flex-auto rounded-none text-ui`,get"aria-expanded"(){return t(n)},get"aria-controls"(){return t(r)},get"aria-label"(){return t(a)},get title(){return t(o)},onclick:e=>Se(`commands`,e),get ref(){return t(ie)},set ref(e){B(ie,e,!0)},children:(e,n)=>{var r=Xse(),i=R(r),a=e=>{dn(e,{class:`size-3.5 motion-reduce:animate-none!`,"aria-label":`Running commands`})};l(i,e=>{t(b).running&&h()&&e(a)});var o=G(i,2);qc(o,{class:`size-3.5`,"aria-hidden":`true`});var s=G(o,4),c=z(s,!0);F(e=>w(c,e),[()=>u5(t(b).running,t(b).total)]),k(e,r)},$$slots:{default:!0}})}};l(ce,e=>{(t(b).total||p()===`commands`)&&e(le)});var W=G(ce,2),K=e=>{var t=p5(),n=q(t);Q(n,{variant:`ghost`,size:`icon`,class:`rounded-none`,title:`Jump to latest`,"aria-label":`Jump to latest`,get onclick(){return r.onJumpToBottom},children:(e,t)=>{Ys(e,{class:`size-4`})},$$slots:{default:!0}}),x(t),S(3,t,()=>ue),k(e,t)};l(W,e=>{r.showLatest&&e(K)}),x(E),te(E,e=>B(ee,e),()=>t(ee)),x(g),te(g,e=>B(P,e),()=>t(P)),x(c),x(n),te(n,e=>B(j,e),()=>t(j)),F(e=>{a=I(n,``,a,{width:t(ae)?`${t(ae).width}px`:void 0,height:t(ae)?`${t(ae).height}px`:void 0}),X(c,1,T([t(ae)?`absolute`:`relative`,`right-0 bottom-0 z-20 max-w-(--conversation-activity-width)`,t(de)&&`transition-[width] duration-(--motion-enter-duration) ease-(--motion-enter-easing) motion-reduce:transition-none`,t(de)&&!p()&&`delay-(--motion-enter-minimal-duration)`])),d=I(c,``,d,{width:p()&&t(ae)?`calc(var(--spacing) * 90)`:t(ae)?`${t(ae).width}px`:`max-content`}),v=X(g,1,`overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-sm transition-[border-radius] duration-(--motion-enter-compact-duration) ease-(--motion-enter-easing) motion-reduce:transition-none`,null,v,{"rounded-t-none":e}),X(E,1,`ml-auto flex max-w-(--conversation-activity-width) items-center divide-x ${t(me)?`w-full`:`w-max`}`)},[()=>!!p()||t(pe)]),M(`transitionrun`,c,Z),M(`transitionend`,c,ye),M(`transitioncancel`,c,xe),k(e,n)};l(Ee,e=>{(t(_).total||t(b).total||t(O)||r.showLatest)&&e(De)}),k(e,Te),D()}var m5=[{value:`aggressive`,label:`Aggressive`,detail:`Compact at 70% and retain about 10,000 recent tokens`},{value:`balanced`,label:`Balanced`,detail:`Compact at 80% and retain about 10,000 recent tokens`},{value:`conservative`,label:`Conservative`,detail:`Compact at 90% and retain about 10,000 recent tokens`},{value:`custom`,label:`Custom`,detail:`Choose the trigger; retains about 10,000 recent tokens`}],$se={aggressive:`Aggressive`,balanced:`Balanced`,conservative:`Conservative`,custom:`Custom`};function h5(e){if(!e.auto)return`Off`;let t=$se[e.profile];return e.profile===`custom`?`${t} · ${e.customTriggerPercent}%`:t}function ece(e){return e.auto?e.profile===`custom`?`Compact at ${e.customTriggerPercent}% and retain about 10,000 recent tokens`:m5.find(t=>t.value===e.profile)?.detail??``:`Auto-compaction is off`}function tce(e){let t=Fi.safeParse(e);if(!t.success)return t.error.issues[0]?.path[0]===`customTriggerPercent`?`Compact at must be a whole number from 60 to 90.`:`Invalid compaction settings.`}function nce(e,t){return e.auto===t.auto&&e.profile===t.profile&&e.customTriggerPercent===t.customTriggerPercent}var g5=ea;function _5(e){return ca(e)}function rce(e){return ca(e)>g5}function v5(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function ice(e){return e.trim()?e:null}var y5=O(`<!> <!> <!>`,1),ace=O(`<div class="grid gap-3"><div class="grid gap-1.5"><!> <!></div></div>`),b5=O(`<!> <!>`,1),x5=O(`<p class="text-ui text-destructive" role="alert"> </p>`),oce=O(`<div class="grid gap-3"><div class="flex items-center justify-between gap-3"><!> <!></div> <!> <!> <!></div>`),sce=O(`<div class="grid gap-1.5"><!> <p> </p> <!></div>`);function cce(e,n){c(n,!0);let r=K(n,`compactionOpen`,15,!1),i=K(n,`instructionsOpen`,15,!1),a=K(n,`compactionOverridden`,3,!1),o=Y(U({auto:!0,profile:`balanced`,customTriggerPercent:80})),s=Y(``),u=Y(!1),d=Y(void 0),f=!1;W(()=>{r()&&!f&&n.compaction&&(B(o,{...n.compaction},!0),B(d,void 0)),f=r()});let p=!1;W(()=>{i()&&!p&&(B(s,n.instructions??``,!0),B(d,void 0)),p=i()});let m=L(()=>tce(t(o))),h=L(()=>!n.compaction||!nce(n.compaction,t(o))),_=L(()=>_5(t(s))),v=L(()=>rce(t(s)));async function b(e,t){B(u,!0),B(d,void 0);try{await e(),t()}catch(e){B(d,e instanceof Error?e.message:String(e),!0)}finally{B(u,!1)}}function S(e){t(o).customTriggerPercent=Number(e)}var C=b5(),E=R(C);ln(E,{size:`sm`,title:`Compaction for this conversation`,description:`Applies to this conversation only; it inherits the project or user setting until you change it.`,get open(){return r()},set open(e){r(e)},footer:e=>{var i=y5(),s=R(i),c=e=>{Q(e,{variant:`ghost`,get disabled(){return t(u)},onclick:()=>void b(n.onResetCompaction,()=>r(!1)),children:(e,t)=>{y();var n=g(`Use inherited`);k(e,n)},$$slots:{default:!0}})};l(s,e=>{a()&&e(c)});var d=G(s,2);Q(d,{variant:`ghost`,get disabled(){return t(u)},onclick:()=>r(!1),children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var f=G(d,2);{let e=L(()=>t(u)||!!t(m)||!t(h));Q(f,{get disabled(){return t(e)},onclick:()=>void b(()=>n.onSaveCompaction({...t(o)}),()=>r(!1)),children:(e,t)=>{y();var n=g(`Save`);k(e,n)},$$slots:{default:!0}})}k(e,i)},children:(e,n)=>{var r=oce(),i=q(r),a=q(i);un(a,{for:`conversation-compaction-auto`,children:(e,t)=>{y();var n=g(`Auto-compact`);k(e,n)},$$slots:{default:!0}});var s=G(a,2);yn(s,{id:`conversation-compaction-auto`,get disabled(){return t(u)},get checked(){return t(o).auto},set checked(e){t(o).auto=e}}),x(i);var c=G(i,2),f=e=>{var n=b5(),r=R(n);lr(r,{get items(){return m5},get value(){return t(o).profile},ariaLabel:`Compaction profile`,get disabled(){return t(u)},onValueChange:e=>t(o).profile=e});var i=G(r,2),a=e=>{var n=ace(),r=q(n),i=q(r);un(i,{for:`conversation-compaction-trigger`,children:(e,t)=>{y();var n=g(`Compact at (%)`);k(e,n)},$$slots:{default:!0}});var a=G(i,2);{let e=L(()=>String(t(o).customTriggerPercent));an(a,{id:`conversation-compaction-trigger`,type:`number`,min:60,max:90,get value(){return t(e)},oninput:e=>S(e.currentTarget.value)})}x(r),x(n),k(e,n)};l(i,e=>{t(o).profile===`custom`&&e(a)}),k(e,n)};l(c,e=>{t(o).auto&&e(f)});var p=G(c,2),h=e=>{var n=x5(),r=z(n,!0);F(()=>w(r,t(m))),k(e,n)};l(p,e=>{t(m)&&t(o).profile===`custom`&&e(h)});var _=G(p,2),v=e=>{var n=x5(),r=z(n,!0);F(()=>w(r,t(d))),k(e,n)};l(_,e=>{t(d)&&e(v)}),x(r),k(e,r)},$$slots:{footer:!0,default:!0}});var O=G(E,2);ln(O,{title:`Instructions for this conversation`,description:`Added to the system prompt from the next turn.`,get open(){return i()},set open(e){i(e)},footer:e=>{var r=y5(),a=R(r);{let e=L(()=>t(u)||!(n.instructions??``).length);Q(a,{variant:`ghost`,get disabled(){return t(e)},onclick:()=>void b(()=>n.onSaveInstructions(null),()=>i(!1)),children:(e,t)=>{y();var n=g(`Clear`);k(e,n)},$$slots:{default:!0}})}var o=G(a,2);Q(o,{variant:`ghost`,get disabled(){return t(u)},onclick:()=>i(!1),children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var c=G(o,2);{let e=L(()=>t(u)||t(v));Q(c,{get disabled(){return t(e)},onclick:()=>void b(()=>n.onSaveInstructions(ice(t(s))),()=>i(!1)),children:(e,t)=>{y();var n=g(`Save`);k(e,n)},$$slots:{default:!0}})}k(e,r)},children:(e,n)=>{var r=sce(),i=q(r);Hn(i,{"aria-label":`Instructions`,class:`min-h-48`,placeholder:`Markdown added to the system prompt.`,get disabled(){return t(u)},get value(){return t(s)},set value(e){B(s,e,!0)}});var a=G(i,2),o=z(a),c=G(a,2),f=e=>{var n=x5(),r=z(n,!0);F(()=>w(r,t(d))),k(e,n)};l(c,e=>{t(d)&&e(f)}),x(r),F((e,n)=>{X(a,1,T([`text-right text-ui tabular-nums`,t(v)?`text-destructive`:`text-muted-foreground`])),w(o,`${e??``} / ${n??``}`)},[()=>v5(t(_)),()=>v5(g5)]),k(e,r)},$$slots:{footer:!0,default:!0}}),k(e,C),D()}var S5=e=>{var t=lce();k(e,t)},lce=O(`<span class="absolute top-1 right-1 size-1.5 rounded-full bg-primary" aria-hidden="true"></span>`),C5=O(`<!> <!>`,1),w5=O(`<span><!></span>`),uce=O(`<span class="text-muted-foreground"> </span>`),dce=O(`<p> </p> <p class="text-muted-foreground"> </p>`,1),fce=O(`<p class="text-muted-foreground">Loading…</p>`),pce=O(`<div class="flex items-baseline justify-between gap-4"><span>Compaction</span> <!></div> <!> <p class="pt-1 text-muted-foreground"> </p>`,1),mce=O(`<span class="text-muted-foreground tabular-nums"> </span>`),hce=O(`<p class="line-clamp-12 break-words whitespace-pre-wrap"> </p>`),gce=O(`<p class="text-muted-foreground">None</p>`),_ce=O(`<div class="flex items-baseline justify-between gap-4"><span>Custom instructions</span> <!></div> <!> <p class="pt-1 text-muted-foreground">Click to edit</p>`,1),vce=O(`<!> <!> <!>`,1);function yce(e,n){c(n,!0);let r=K(n,`compactionOverridden`,3,!1),i=K(n,`disabled`,3,!1),a=K(n,`compactionLocked`,3,!1),o=L(r),s=L(()=>n.instructions?.trim()??``);var u=vce(),d=R(u),p=e=>{be(e,{variant:`neutral`,class:`mr-1`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.profile)),k(e,r)},$$slots:{default:!0}})};l(d,e=>{n.profile&&e(p)});var m=G(d,2);H(m,()=>En,(e,s)=>{s(e,{delayDuration:200,children:(e,s)=>{var c=f(),u=R(c);H(u,()=>wn,(e,s)=>{s(e,{ignoreNonKeyboardFocus:!0,children:(e,s)=>{var c=C5(),u=R(c);{let e=(e,r)=>{let s=()=>(r?.()).props;var c=w5();ie(c,()=>({...s(),class:`inline-flex`}));var u=q(c);{let e=L(()=>i()||a()||!n.compaction),r=L(()=>n.compaction?`Compaction: ${h5(n.compaction)}`:`Compaction`);Q(u,{size:`icon-sm`,variant:`ghost`,get disabled(){return t(e)},class:`relative text-muted-foreground hover:text-foreground`,get ariaLabel(){return t(r)},get onclick(){return n.onEditCompaction},children:(e,n)=>{var r=C5(),i=R(r);Hw(i,{class:`size-3.5`,"aria-hidden":`true`});var a=G(i,2),s=e=>{S5(e)};l(a,e=>{t(o)&&e(s)}),k(e,r)},$$slots:{default:!0}})}x(c),k(e,c)};H(u,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var d=G(u,2);H(d,()=>Sn,(e,t)=>{t(e,{side:`top`,class:`max-w-sm flex-col items-stretch gap-1 py-2`,children:(e,t)=>{var i=pce(),o=R(i),s=G(q(o),2),c=e=>{var t=uce(),n=z(t,!0);F(()=>w(n,r()?`Conversation`:`Inherited`)),k(e,t)};l(s,e=>{n.compaction&&e(c)}),x(o);var u=G(o,2),d=e=>{var t=dce(),r=R(t),i=z(r,!0),a=G(r,2),o=z(a,!0);F((e,t)=>{w(i,e),w(o,t)},[()=>h5(n.compaction),()=>ece(n.compaction)]),k(e,t)},f=e=>{var t=fce();k(e,t)};l(u,e=>{n.compaction?e(d):e(f,-1)});var p=G(u,2),m=z(p,!0);F(()=>w(m,a()?`Locked by the active profile`:`Click to change`)),k(e,i)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})});var h=G(m,2);H(h,()=>En,(e,r)=>{r(e,{delayDuration:200,children:(e,r)=>{var a=f(),o=R(a);H(o,()=>wn,(e,r)=>{r(e,{ignoreNonKeyboardFocus:!0,children:(e,r)=>{var a=C5(),o=R(a);{let e=(e,r)=>{let a=()=>(r?.()).props;var o=w5();ie(o,()=>({...a(),class:`inline-flex`}));var c=q(o);{let e=L(()=>t(s)?`Custom instructions`:`Custom instructions: none`);Q(c,{size:`icon-sm`,variant:`ghost`,get disabled(){return i()},class:`relative text-muted-foreground hover:text-foreground`,get ariaLabel(){return t(e)},get onclick(){return n.onEditInstructions},children:(e,n)=>{var r=C5(),i=R(r);hd(i,{class:`size-3.5`,"aria-hidden":`true`});var a=G(i,2),o=e=>{S5(e)};l(a,e=>{t(s)&&e(o)}),k(e,r)},$$slots:{default:!0}})}x(o),k(e,o)};H(o,()=>Cn,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var c=G(o,2);H(c,()=>Sn,(e,n)=>{n(e,{side:`top`,class:`max-w-sm flex-col items-stretch gap-1 py-2`,children:(e,n)=>{var r=_ce(),i=R(r),a=G(q(i),2),o=e=>{var n=mce(),r=z(n,!0);F(e=>w(r,e),[()=>v5(_5(t(s)))]),k(e,n)};l(a,e=>{t(s)&&e(o)}),x(i);var c=G(i,2),u=e=>{var n=hce(),r=z(n,!0);F(()=>w(r,t(s))),k(e,n)},d=e=>{var t=gce();k(e,t)};l(c,e=>{t(s)?e(u):e(d,-1)}),y(2),k(e,r)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,a)},$$slots:{default:!0}})}),k(e,u),D()}var bce=class{#e=Y();get result(){return t(this.#e)}set result(e){B(this.#e,e,!0)}configuration;#t=Y();get error(){return t(this.#t)}set error(e){B(this.#t,e,!0)}#n=Y(!1);get saving(){return t(this.#n)}set saving(e){B(this.#n,e,!0)}get compaction(){let e=this.result?.status===`available`?this.result.resolution.settings.compaction:void 0;if(e?.auto!==void 0&&e.profile!==void 0&&e.customTriggerPercent!==void 0)return{auto:e.auto,profile:e.profile,customTriggerPercent:e.customTriggerPercent}}get overridden(){return this.result?.status===`available`&&this.configuration?.status===`available`&&h4(this.configuration.overrides,this.configuration.inherited).compaction!==void 0}scope;follow(e,t){(this.scope?.projectId!==e||this.scope?.conversationId!==t)&&(this.result=void 0,this.configuration=void 0,this.error=void 0,this.scope=e&&t?{projectId:e,conversationId:t}:void 0,this.refresh())}async refresh(){let e=this.scope;if(e)try{let[t,n]=await Promise.all([El(`agentConfiguration.getEffective`,{conversationId:e.conversationId}),El(`agentConfiguration.get`,{scope:{scope:`conversation`,conversationId:e.conversationId}})]);this.scope===e&&(this.result=t,this.configuration=n,this.error=void 0)}catch(t){this.scope===e&&(this.error=t instanceof Error?t.message:String(t))}}async saveCompaction(e){let t=this.scope;if(!t)return;let n=this.configuration;if(n?.status!==`available`)throw Error(`Configuration unavailable. Refresh and try again.`);this.saving=!0;try{let r=await El(`agentConfiguration.save`,{scope:{scope:`conversation`,conversationId:t.conversationId},expectedRevision:n.source.revision,expectedDigest:n.source.digest,changes:e===null?{}:{compaction:e},resets:e===null?[`/overrides/compaction`]:[]});if(r.status!==`saved`)throw Error(`Configuration ${r.status}. Refresh and try again.`);this.scope===t&&await this.refresh()}catch(e){throw await this.refresh(),e}finally{this.saving=!1}}observe(){return yl({recover:()=>this.refresh(),disconnected(){},event(){},notice:e=>{if(e.type!==`agentConfiguration.changed`)return;let t=this.scope;t&&(e.data.scope.scope===`user`||e.data.scope.scope===`project`&&e.data.scope.projectId===t.projectId||e.data.scope.scope===`conversation`&&e.data.scope.conversationId===t.conversationId)&&this.refresh()}})}};function xce(e,t){if(e&&t)return`${e.replace(/[\\/]+$/,``)}/conversations/${t}`}function Sce({status:e,activeProject:t,activeConversation:n}){return[{label:`Project`,value:t?.name},{label:`Directory`,value:t?.dir,mono:!0},{label:`Conversation`,value:n?.id,mono:!0},{label:`Daemon`,value:e?.daemonId,mono:!0},{label:`Data`,value:xce(e?.dataDir,n?.id),mono:!0}]}var T5=new class{#e=Y(U({}));get errors(){return t(this.#e)}set errors(e){B(this.#e,e,!0)}loader=new l4({load:()=>El(`permissionRuleSet.list`,{}).then(e=>e.ruleSets.map(({id:e,name:t,source:n,enabled:r,description:i})=>({id:e,name:t,source:n,enabled:r,description:i,available:r}))),onError:(e,t)=>{this.errors[e]=t instanceof Error&&t.message.trim()?t.message:`Could not load permission rule sets.`}});summaries(e){return(e?this.loader.get(e):void 0)??[...xee]}loading(e){return e?this.loader.loading(e):!1}error(e){return e?this.errors[e]:void 0}install(e,t){delete this.errors[e],this.loader.set(e,[...t])}async ensure(e){return this.loader.has(e)||delete this.errors[e],await this.loader.ensure(e),this.summaries(e)}async refresh(e){return delete this.errors[e],await this.loader.refresh(e),this.summaries(e)}};function Cce(e){if(e.pending){let t=e.pending;if(t.explicitAgentProfile&&e.targetProfile?.name!==t.explicitAgentProfile)throw Error(`Profile unavailable. Refresh and try again.`);let{systemPrompt:n,instructions:r,workingDirectory:i}=t.config;return{projectId:t.projectId,sourceId:`pending:${t.id}`,params:{projectId:t.projectId,config:{systemPrompt:n,instructions:r,workingDirectory:i},overrides:h4(la.parse(t.overrides??{}),e.inherited),...e.targetProfile?{agentProfile:{...e.targetProfile}}:{}}}}if(e.conversation)return{projectId:e.conversation.projectId,sourceId:e.conversation.id,params:{conversationId:e.conversation.id}}}var E5=U({panes:{}});async function wce(e){if(e.projectId!==Ds.selectedProjectId){let{selectProject:t}=await Os(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-DE0mQsY6.js`).then(e=>e.m);return{selectProject:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));await t(e.projectId)}let{sourceId:t,...n}=e;E5.panes[t]=n;let{addCenterTab:r,setActiveCenterTab:i}=await Os(async()=>{let{addCenterTab:e,setActiveCenterTab:t}=await import(`./center-tabs.svelte-8YpJhA1o.js`).then(e=>e.o);return{addCenterTab:e,setActiveCenterTab:t}},__vite__mapDeps([9,1,2,7,6,10,11,12,13])),a={kind:`system-prompt`,id:t};r(a),i(a)}function Tce(e,t){let n=E5.panes[e];n&&(n.section=t)}function Ece(e){delete E5.panes[e]}function Dce(e){return{async setComposerModelSelection(t){t.model?await e.setModel(QR(t.model),t.thinkingLevel):t.thinkingLevel!==void 0&&await e.setReasoning(t.thinkingLevel)},setComposerAgentProfile(t){return e.setProfile(t)},setComposerPermissionRuleSet(t){return e.setPermission(t)}}}function Oce(e){let t=!1;return async function(n){if(t)return;let r=e.pending(),i=Cce({pending:r,inherited:e.inherited(),targetProfile:(()=>{let t=e.profiles().find(e=>e.name===r?.explicitAgentProfile);return t?.digest?{name:t.name,digest:t.digest}:void 0})(),conversation:e.conversation()});if(i){t=!0;try{let e=await El(`conversation.previewSystemPrompt`,i.params);await wce({projectId:i.projectId,sourceId:i.sourceId,section:n,...e.status===`available`?{text:e.systemPrompt,tools:e.tools}:{text:`Configuration unavailable. Check scoped configuration diagnostics.`}})}finally{t=!1}}}}function kce(e){async function t(t,n){let r=await e()?.resolve(t,n);if(r?.status===`refresh_required`){let e=r.reason===`requirement_conflict`?`Profile requirements conflict with the chosen model or reasoning. The plan remains open; repair the conflict and confirm again. No implementation request was submitted.`:`Profile or configuration changed, or a previous approval was interrupted. The plan remains open; review the current configuration and refreshed requirements, then confirm again. No implementation request was submitted.`;throw ui.warning(`Plan review needs new confirmation`,{description:e,duration:1e4}),Error(e)}if(r?.status===`unavailable`)throw Error(`Configuration unavailable; reload it before confirming again. The review remains open and no implementation request was submitted.`)}return{answerUserQuestion(e,n){return t(e,{kind:`user_input`,answers:n})},dismissUserQuestion(e){return t(e,{kind:`user_input`,answers:{},dismissed:!0})},grantApproval(e,n){return t(e,{kind:`approval`,decision:`approve`,persistScope:n===`always_conversation`?`conversation`:n===`always_project`?`project`:n===`always_user`?`user`:void 0})},denyApproval(e){return t(e,{kind:`approval`,decision:`deny`})},async acceptPendingPlanReview(n,r){if(r?.compactBeforeImplementation)throw Error(`Compacting a pending plan is not supported by the conversation core`);let i=e()?.snapshot?.toolCalls.find(e=>e.id===n)?.interaction;if(i?.kind!==`plan_review`)throw Error(`Plan review unavailable. Refresh and try again.`);let a=i.request;await t(n,{kind:`plan_review`,decision:`approve`,feedback:r?.feedback,confirmation:{targetProfile:a.targetProfile,expectedRevision:a.expectedRevision,expectedDigest:a.expectedDigest,transitionId:Fd(`input`),choices:{...r?.implementationModel?{model:r.implementationModel}:{},...r?.implementationThinkingLevel===void 0?{}:{reasoningLevel:r.implementationThinkingLevel}}}})},rejectPendingPlanReview(e){return t(e,{kind:`plan_review`,decision:`reject`})}}}function D5(e,t){return e.some(e=>e.id===t.id)?e:[...e,t]}async function Ace(e,t,n){let{systemPrompt:r,instructions:i,workingDirectory:a}=e.config,o={systemPrompt:r,instructions:i,workingDirectory:a},s=h4(la.parse(e.overrides??{}),n.inherited),c=e.explicitAgentProfile,l=e.createdConversationId!==void 0,u;if(e.createdConversationId)await n.configure(e.createdConversationId,o),u=await n.getSnapshot(e.createdConversationId),c&&u.config.agentProfile!==c&&(await n.setAgentProfile(e.createdConversationId,c),u=await n.getSnapshot(e.createdConversationId));else{let t=c?await n.resolveProfile(e.projectId,c):void 0;u=await n.create({projectId:e.projectId,title:e.title,config:o,overrides:s,...t?{agentProfile:t}:{}})}let d=u.conversation.id;return e.createdConversationId=d,l&&await n.saveOverrides(d,s),await n.submit(d,t),u}async function O5(e){try{await e()}catch(e){ui.error(e instanceof Error?e.message:String(e))}}async function jce(e){let{pending:t,text:n,drafts:r}=e;if(!t.sending){t.sending=!0;try{let i=await Ace(t,n,{inherited:e.inherited,create:e=>El(`conversation.create`,{id:Fd(`conv`),...e}),getSnapshot:e=>El(`conversation.getSnapshot`,{conversationId:e}),configure:(e,t)=>El(`conversation.configure`,{conversationId:e,patch:t}),resolveProfile:async(e,t)=>{let n=(await K4.ensure(e)).find(e=>e.name===t);if(!n?.digest)throw Error(`Profile unavailable. Refresh and try again.`);return{name:t,digest:n.digest}},setAgentProfile:M6,saveOverrides:async(e,t)=>{let n={scope:`conversation`,conversationId:e},r=await El(`agentConfiguration.get`,{scope:n});if(r.status!==`available`)throw Error(`Configuration unavailable.`);let i=await El(`agentConfiguration.save`,{scope:n,expectedRevision:r.source.revision,expectedDigest:r.source.digest,..._4(r.overrides,t)});if(i.status!==`saved`)throw Error(`Configuration ${i.status}. Refresh and try again.`)},submit:(e,t)=>El(`input.submit`,{conversationId:e,inputId:Fd(`input`),text:t,source:`user`})}),a={kind:`pending-conversation`,id:t.id,projectId:t.projectId};e.clearComposer&&r.clearPromptIfUnchanged(a,n),r.promotePendingPrompt(t.id,i.conversation.id),Ds.conversations=D5(Ds.conversations,{...i.conversation,references:[],childCount:0,pendingWork:!1,pendingInput:null,agentProfile:i.config.agentProfile,model:i.config.model,permissionRuleSetId:i.config.permissionRuleSetId}),Dee(Ds.openCenterTabs.map(e=>e.kind===`pending-conversation`&&e.id===t.id?{kind:`conversation`,id:i.conversation.id}:e)),Xo.delete(t.id),await qo({kind:`conversation`,id:i.conversation.id})}catch(e){throw t.error=String(e),e}finally{t.sending=!1}}}var Mce=class{#e=Y();get editTarget(){return t(this.#e)}set editTarget(e){B(this.#e,e,!0)}#t=Y(``);get editText(){return t(this.#t)}set editText(e){B(this.#t,e,!0)}#n=Y(!1);get retryingResponse(){return t(this.#n)}set retryingResponse(e){B(this.#n,e,!0)}#r;constructor(e){this.#r=e}get composerText(){if(this.editTarget)return this.editText;let e=this.#r.promptDraftTarget();return e?this.#r.drafts.getPrompt(e):``}clearEdit(){this.editTarget=void 0}setComposerText=e=>{if(this.editTarget){this.editText=e;return}let t=this.#r.promptDraftTarget();t&&this.#r.drafts.setPrompt(t,e)};editEntry=e=>{this.editTarget=e,this.editText=e.text,this.#r.focusComposer()};applySuggestion=e=>{let t=this.composerText;this.setComposerText(t.trim()?`${t}\n\n${e.prompt}`:e.prompt)};sendSuggestion=e=>{O5(()=>this.submit(e.prompt,{clearComposer:!1}))};submit=async(e=this.composerText,t={})=>{if(!e.trim()||this.#r.viewedChildId())return;let n=this.#r.pending();if(n){await jce({pending:n,text:e,inherited:this.#r.inherited(),drafts:this.#r.drafts,clearComposer:t.clearComposer!==!1});return}let r=this.#r.store(),i=this.editTarget,a=this.#r.promptDraftTarget();r&&(i&&await r.selectHead(i.parentEntryId??null),await r.submit(e),!i&&a&&t.clearComposer!==!1&&this.#r.drafts.clearPromptIfUnchanged(a,e),this.editTarget!==i||i&&this.editText!==e||(this.editTarget=void 0))};abortActiveRun=async()=>{await this.#r.store()?.control(`stop`)};retryActiveResponse=async()=>{if(!this.retryingResponse){this.retryingResponse=!0;try{await this.#r.store()?.retryResponse()}finally{this.retryingResponse=!1}}}},k5=new mo;function Nce(e){return e!==void 0&&k5.has(e)}function A5(e,t){let n=e.conversationId;if(k5.has(n))return;k5.add(n);let r=e=>{Rd(e).catch(e=>ui.error(e instanceof Error?e.message:String(e)))},i=`fork:${n}`;ui.loading(`Forking conversation…`,i),e.fork(t).then(e=>{let{id:t,title:a}=e.conversation,o=Ds.activeCenterTab;o?.kind===`conversation`&&o.id===n&&r(t),oi(`Forked to «${a}»`,{id:i,kind:`success`,action:{label:`Open`,onClick:()=>r(t)}})}).catch(e=>oi(`Could not fork: ${e instanceof Error?e.message:String(e)}`,{id:i,kind:`error`})).finally(()=>k5.delete(n))}function Pce(e){return{forcePushQueuedPrompts(){return e.store()?.control(`forcePush`).then(()=>void 0)},discardQueuedPrompt(t){return e.store()?.cancelInput(t.id).then(()=>void 0)},async moveQueuedPromptToComposer(t){let n=await e.store()?.moveInputToComposer(t.id);n!==void 0&&(e.setComposerText(n),vl())}}}function Fce(){let e=()=>{T4(Wo.projectId),w4(Wo.projectId,{conversationId:Wo.conversationId})},t=[k3(t=>{t.target.kind===`prompt-suggestion`&&e()}),$n(`prompt_suggestions.enabled_updated`,e),$n(`prompt_suggestions.created`,e),tr(e)];return()=>{for(let e of t)e()}}var Ice={"commit-changes":`commit`,"commit-on-feature-branch":`branch`,"create-pull-request":`pull-request`,"update-pull-request":`pull-request-update`,"fix-failing-checks":`failed`,"push-commits":`push`,"pull-upstream":`pull`,"review-changes":`review`,"cleanup-merged-branch":`cleanup`,"continue-after-failure":`retry`};function Lce(e){let t=Ice;return e.source.kind!==`builtin`||!Object.hasOwn(t,e.name)?`default`:t[e.name]}var Rce={commit:Uw,branch:Rre,"pull-request":ac,"pull-request-update":Vre,failed:xd,push:Zs,pull:Ys,review:yie,cleanup:kn,retry:zn,default:$u},zce=class{#e;#t=Y(0);#n=L(()=>{let e=Lo.gitContext;return e?`${e.projectId}:${pS(e)}`:`none`});#r=L(()=>C4.suggestions.map(e=>({id:`prompt:${e.id}`,label:e.label,prompt:e.prompt,description:e.description,context:e.context,icon:Rce[Lce(e)]})));get suggestions(){return t(this.#r)}set suggestions(e){B(this.#r,e)}constructor(e){this.#e=e,W(()=>{if(!Us.progressiveActive||!this.#e.active())return;let e=this.#e.projectId();if(!e)return;let n,r=$n(`github.pr.changed`,r=>{r.data?.projectId===e&&(clearTimeout(n),n=setTimeout(()=>{B(this.#t,t(this.#t)+1)},1e3))});return()=>{r(),clearTimeout(n)}}),W(()=>{let e=this.#e.projectId();if(!Us.progressiveActive||!this.#e.active()||!e)return;let n=this.#e.store();t(this.#n),t(this.#t),n?.snapshot?.config,n?.snapshot?.conversation.status,n?.snapshot?.conversation.title,w4(e,{conversationId:this.#e.conversationId()})})}},Bce=class{#e;get leadContext(){return t(this.#e)}set leadContext(e){B(this.#e,e)}#t;#n=Y();get leadStore(){return t(this.#n)}set leadStore(e){B(this.#n,e,!0)}#r=Y();get viewedChildId(){return t(this.#r)}set viewedChildId(e){B(this.#r,e,!0)}#i=Y();get childStore(){return t(this.#i)}set childStore(e){B(this.#i,e,!0)}#a=Y(null);get activityOpen(){return t(this.#a)}set activityOpen(e){B(this.#a,e,!0)}#o;#s=L(()=>this.viewedChildId?this.childStore:this.leadStore);get store(){return t(this.#s)}set store(e){B(this.#s,e)}#c=L(()=>this.viewedChildId??this.leadStore?.snapshot?.conversation.id);get viewedConversationId(){return t(this.#c)}set viewedConversationId(e){B(this.#c,e)}#l=L(()=>this.store?.snapshot?Pse({children:this.store.snapshot.children,asyncBash:this.store.snapshot.asyncBash}):[]);get pendingWork(){return t(this.#l)}set pendingWork(e){B(this.#l,e)}#u=L(()=>{let e=this.viewedChildId;if(!e)return;let t=this.leadContext?.conversationAgents.find(t=>t.id===e);return t?i5(t):void 0});get viewedProfile(){return t(this.#u)}set viewedProfile(e){B(this.#u,e)}#d=L(()=>this.viewedChildId?{message:`Sub-agents take prompts only from their lead.`,actionLabel:`Back to lead`,onAction:()=>this.viewAgent(void 0)}:void 0);get composerOverlay(){return t(this.#d)}set composerOverlay(e){B(this.#d,e)}constructor(e){this.#t=e,this.#e=L(()=>this.viewedChildId?this.leadStore?.snapshot?z8(this.leadStore.snapshot,this.leadStore.events,Gt.models):void 0:this.#t.context()),W(()=>()=>me(()=>this.viewAgent(void 0))),W(()=>{this.viewedChildId&&this.childStore?.deleted&&this.viewAgent(void 0)}),W(()=>{let e=this.#t.conversationId();if(this.leadStore=void 0,me(()=>this.viewAgent(void 0)),this.#t.resetTree(),this.#t.clearEdit(),!e)return;let t=I6(e);return this.leadStore=t.store,t.ready.catch(e=>ui.error(String(e))),t.release})}viewAgent=e=>{if(this.#o?.(),this.#o=void 0,this.childStore=void 0,this.viewedChildId=void 0,this.activityOpen=null,this.#t.clearEdit(),!e||e===this.#t.conversationId())return;let t=I6(e);this.#o=t.release,this.childStore=t.store,this.viewedChildId=e,t.ready.catch(e=>ui.error(String(e)))};openPendingWork=e=>{e.kind===`agent`?this.viewAgent(e.id):this.activityOpen=`commands`}},Vce=class{options;id;enabled=!1;poll=!0;generation=0;pending=!1;stale=!1;disposed=!1;cancelTimer;state={loading:!1};schedule;constructor(e){this.options=e,this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)})}configure(e,t,n=!0){if(this.disposed)return;if(e===this.id&&t===this.enabled){if(n===this.poll)return;this.poll=n,n&&this.retry();return}this.poll=n;let r=e!==this.id;this.generation++,this.cancelTimer?.(),this.cancelTimer=void 0,this.id=e,this.enabled=t;let i=t&&!!e;this.state=r?{loading:i}:{...this.state,loading:i},this.options.publish(this.state),t&&e&&this.refresh()}invalidate(){!this.disposed&&this.enabled&&this.id&&(this.pending?this.stale=!0:this.retry())}retry(){this.cancelTimer?.(),this.cancelTimer=void 0,this.refresh()}dispose(){this.disposed=!0,this.generation++,this.cancelTimer?.(),this.cancelTimer=void 0}async refresh(){if(this.disposed||!this.enabled||!this.id||this.pending)return;let e=this.generation,t=this.id;this.pending=!0,this.state={...this.state,loading:!0},this.options.publish(this.state);try{let n=await this.options.fetch(t);if(e!==this.generation||this.disposed)return;this.state={usage:n,loading:!1},this.options.publish(this.state)}catch(t){if(e!==this.generation||this.disposed)return;this.state={...this.state,loading:!1,error:String(t)},this.options.publish(this.state)}finally{this.pending=!1,!this.disposed&&this.enabled&&this.id&&(e!==this.generation||this.stale?(this.stale=!1,this.refresh()):this.poll&&(this.cancelTimer=this.schedule(()=>{this.cancelTimer=void 0,this.refresh()},3e3)))}}},Hce=class{#e;get contextWindow(){return t(this.#e)}set contextWindow(e){B(this.#e,e)}#t;#n=Y(!1);get open(){return t(this.#n)}set open(e){B(this.#n,e,!0)}#r=Y(U({loading:!1}));get agentState(){return t(this.#r)}set agentState(e){B(this.#r,e,!0)}#i;constructor(e){this.#t=e,this.#e=L(()=>this.#t.contextWindow()??Gt.models.find(e=>QR(e)===this.#t.selectedModelKey())?.contextWindow??0),this.#i=new Vce({fetch:e=>El(`conversation.getUsage`,{conversationId:e}),publish:e=>{this.agentState=e}}),W(()=>{this.#i.configure(e.conversationId(),e.enabled(),this.open)}),W(()=>{e.responseCount(),me(()=>this.#i.invalidate())}),W(()=>()=>this.#i.dispose())}retry=()=>{this.#i.retry()}},Uce=new Set([`read_only`,`autonomous`]);function Wce(e){return e.viewingChild?[{name:e.selectedProfile,label:e.selectedProfile,source:e.resolvedProfiles.find(t=>t.name===e.selectedProfile)?.source}]:e.leadProfiles.map(e=>({name:e.name,label:e.label,whenToUse:e.whenToUse,source:e.source}))}function Gce(e,t){return e.filter(e=>!t||Uce.has(e.id))}var Kce=O(`<div class="flex items-center justify-end gap-1"><!> <!></div>`),qce=O(`<!> <!>`,1);function j5(e,n){c(n,!0);let r=K(n,`active`,3,!0),i=L(()=>n.tab??Ds.activeCenterTab),a=L(()=>t(i)?.kind===`conversation`?t(i).id:void 0),o=L(()=>t(i)?.kind===`pending-conversation`?t(i).id:void 0),s=L(()=>t(o)?Xo.get(t(o)):void 0),u=L(()=>!!t(s)),d=Y(U([])),p=new Bce({conversationId:()=>t(a),context:()=>t(C),clearEdit:()=>v.clearEdit(),resetTree:()=>{B(d,[],!0)}}),h=L(()=>p.store),g=Id(),_=L(()=>t(s)?{kind:`pending-conversation`,id:t(s).id,projectId:t(s).projectId}:t(a)?{kind:`conversation`,id:t(a)}:void 0),v=new Mce({store:()=>t(h),promptDraftTarget:()=>t(_),pending:()=>t(s),viewedChildId:()=>p.viewedChildId,inherited:()=>I.inherited,drafts:g,focusComposer:vl}),y=L(()=>t(h)?.snapshot?V6({snapshot:t(h).snapshot,events:t(h).events,tree:t(d)}):void 0),b=L(()=>t(y)?Zie({run:t(y).run,queuedPrompts:t(y).queuedPrompts,liveBlocks:t(h)?.liveBlocks??[],toolOutput:t(h)?.toolOutput??{},toolStreams:t(h)?.toolStreams??{}}):void 0),S=L(()=>t(h)?.snapshot&&t(y)?{...t(y),activeRun:t(b),stopping:!!t(h)?.stopping||!!t(y).transient?.compaction?.stopping,retryingResponse:v.retryingResponse,responseRevision:t(h).responseRevision,transient:t(y).transient}:void 0),C=L(()=>t(h)?.snapshot?z8(t(h).snapshot,t(h).events,Gt.models):void 0),w=L(()=>t(C)?.activeConversation),T=L(()=>{let e=t(s)?.projectId??t(h)?.snapshot?.conversation.projectId,n=e?Ds.projects.find(t=>t.id===e):Xr.activeProject;return n?I8(n):void 0});W(()=>{let e=C4.trustRequests;e.length&&me(()=>{if(D3.open)return;let n=t(T)?.id,r=e.flatMap(e=>e.sourceKind===`user`?[{kind:`prompt-suggestion`,scope:`user`,id:e.name}]:e.sourceKind===`project`&&(e.projectId??n)?[{kind:`prompt-suggestion`,scope:`project`,projectId:e.projectId??n,id:e.name}]:[]);for(let t of e)O4(t.trustId);r.length&&O3(r)})});let E=L(()=>t(S)?.approvals??[]),O=L(()=>t(S)?.pendingUserQuestions??[]),A=L(()=>t(S)?.pendingPlanReviews??[]),j=L(()=>t(s)?.projectId??t(h)?.snapshot?.conversation.projectId),M=L(()=>K4.profiles(t(j))),N=L(()=>t(h)?.effective?.status===`available`?t(h).effective:void 0),P=new f4;W(()=>{t(T)?.id&&P.load({scope:`project`,projectId:t(T).id})}),W(()=>P.observe());let F=L(()=>P.result?.status===`available`?P.result.effective:void 0),I=v4({target:()=>t(s)?{kind:`draft`,pendingId:t(s).id,projectId:t(s).projectId}:{kind:`conversation`,conversationId:p.viewedChildId??t(a)??``,readOnly:!!p.viewedChildId},pending:()=>t(s),store:()=>t(h),defaults:e=>u4.get(e),profiles:e=>K4.profiles(e),resolve:e=>El(`agentConfiguration.resolveProject`,e),clampReasoning:(e,t)=>YR(t,Gt.models.find(t=>QR(t)===e)),capabilityEditor:new S4,observe:e=>{let n=yl({recover:()=>(e(),Promise.resolve()),disconnected(){},event(){},notice:n=>{if(n.type!==`agentConfiguration.changed`&&n.type!==`conversationDefaults.changed`)return;let r=n.data.scope;(r.scope===`user`||r.scope===`project`&&r.projectId===t(T)?.id||r.scope===`conversation`&&r.conversationId===t(a))&&e()}}),r=$n(`agentProfiles.changed`,()=>{K4.refresh(t(T)?.id).then(()=>{t(s)||e()})});return()=>{n(),r()}}});W(()=>{if(r())return x4(I)});let ee=L(()=>I.resolution),te=L(()=>t(ee)?.settings.model?QR(t(ee).settings.model):``),ne=L(()=>t(ee)?.settings.reasoningLevel??`off`),re=L(()=>I.appliedProfile??`coding`),z=L(()=>t(ee)?.settings.permissionRuleSetId??`autonomous`),ie=L(()=>Wce({viewingChild:!!p.viewedChildId,selectedProfile:t(re),resolvedProfiles:t(M),leadProfiles:U4(t(M))})),ae=L(()=>({...I.locked,by:I.appliedProfile})),V=L(()=>!!t(ae).compaction);W(()=>{K4.ensure(t(j))});let oe=L(()=>dz(Gt.models,Gt.authProviders,t(F)?.scopedModels)),se=L(()=>t(te)),H=L(()=>t(ne)),ce=L(()=>Gce(Ho(T5.summaries(t(T)?.id)),!!p.viewedChildId)),le=L(()=>T5.loading(t(T)?.id)),ue=L(()=>T5.error(t(T)?.id)),de=Y(U([]));W(()=>{t(T)&&(El(`completion.slash.list`,{}).then(e=>{B(de,e.items,!0),T6.slashCompletions=e.items}),T5.refresh(t(T).id))});let fe=L(()=>t(C)?.conversationUsage??SB([])),pe=new Hce({conversationId:()=>t(h)?.conversationId,enabled:()=>r()&&!!t(h)?.connected,responseCount:()=>t(fe).responseCount,contextWindow:()=>t(C)?.contextWindow,selectedModelKey:()=>t(te)}),he=new zce({active:()=>r(),projectId:()=>t(T)?.id,store:()=>t(h),conversationId:()=>t(a)});async function J(){await t(h)?.control(`compact`)}async function ge(){await t(h)?.cancelCompaction()}let _e=Oce({pending:()=>t(s),inherited:()=>I.inherited,profiles:()=>t(M),conversation:()=>t(h)?.snapshot?.conversation}),X=v.abortActiveRun;function ve(e,n){t(T)&&Vd({projectId:t(T).id,path:e,line:n})}function Z(e){let n=t(h)?.snapshot?.asyncBash.find(t=>t.id===e);n?F8(n,t(T)?.id):jf(e)}let{setComposerModelSelection:ye,setComposerAgentProfile:be,setComposerPermissionRuleSet:xe}=Dce(I),{answerUserQuestion:Se,dismissUserQuestion:Ce,grantApproval:we,denyApproval:Te,acceptPendingPlanReview:Ee,rejectPendingPlanReview:De}=kce(()=>t(h)),Oe=()=>t(h)?.control(`continue`),{forcePushQueuedPrompts:ke,discardQueuedPrompt:Ae,moveQueuedPromptToComposer:je}=Pce({store:()=>t(h),setComposerText:v.setComposerText}),Me=Y(`conversation`);W(()=>{t(a),B(Me,`conversation`)});let Ne=me(()=>rl.historyRequest.token);W(()=>{let e=rl.historyRequest;e.token!==Ne&&(Ne=e.token,r()&&t(h)?.snapshot&&B(Me,e.mode===`open`?`history`:e.mode===`close`||t(Me)===`history`?`conversation`:`history`,!0))});function Pe(){B(Me,t(Me)===`history`?`conversation`:`history`,!0)}async function Fe(e){await Ie(e),B(Me,`conversation`),vl()}let Ie=async e=>{await t(h)?.selectHead(e??null)};W(()=>{let e=rl.editEntry;r()&&e&&e.conversationId===t(a)&&!p.viewedChildId&&(rl.editEntry=void 0,v.editEntry(e))});let Le=L(()=>t(T)?.id),Re=L(()=>p.viewedChildId??t(a)),ze=L(()=>r()&&t(Le)?W6(t(Le),t(Re)):void 0),Be=L(()=>t(h)?.snapshot?.asyncBash??[]);function Ve(e){F8(e,t(T)?.id)}let He=new bce;W(()=>He.follow(t(T)?.id,t(h)?.snapshot?.conversation.id)),W(()=>He.observe());let Ue=Y(!1),We=Y(!1),Ge=L(()=>t(h)?.snapshot?.config.instructions??null),Ke=L(()=>({fields:Sce({status:Ds.status,activeProject:t(T),activeConversation:t(w)}),onCopy:e=>{ri(e).catch(()=>ui.error(`Could not copy to clipboard`))}})),qe=L(()=>o5(t(h)?.snapshot)),Je=L(()=>t(qe)||Nce(t(a)));var Ye=qce(),Xe=R(Ye);{let e=(e,n=m)=>{var r=f(),i=R(r),a=e=>{{let r=L(()=>!!p.viewedChildId);Ase(e,{get store(){return t(h)},get readOnly(){return t(r)},get rewindLocked(){return t(Je)},onRewind:e=>void O5(()=>Fe(e)),onFork:e=>{t(h)&&A5(t(h),e)},onEdit:e=>{v.editEntry(e),B(Me,`conversation`)},get onReveal(){return n().reveal},onClose:()=>{B(Me,`conversation`)}})}};l(i,e=>{t(h)&&e(a)}),k(e,r)},n=(e,n=m)=>{{let r=L(()=>!t(h)?.snapshot||He.saving);yce(e,{get compaction(){return He.compaction},get compactionOverridden(){return He.overridden},get instructions(){return t(Ge)},get profile(){return p.viewedProfile},get disabled(){return t(r)},get compactionLocked(){return t(V)},onEditCompaction:()=>{n()(),B(Ue,!0)},onEditInstructions:()=>{n()(),B(We,!0)}})}},i=(e,n=m,i=m)=>{var a=Kce(),o=q(a),s=e=>{c4(e,{get conversationId(){return t(h).conversationId},get applied(){return t(N).appliedProfile},onApplied:()=>t(h).refreshConfiguration()})};l(o,e=>{t(N)?.appliedProfile&&t(h)&&!p.viewedChildId&&e(s)});var c=G(o,2),u=e=>{{let a=L(()=>p.leadContext?.conversationAgents??[]),o=L(()=>p.leadContext?.agentActivities??{});Qse(e,{get active(){return r()},get agents(){return t(a)},get activities(){return t(o)},get viewedId(){return p.viewedConversationId},get commands(){return t(Be)},get showLatest(){return n()},get onJumpToBottom(){return i()},onSelectAgent:e=>p.viewAgent(e),onOpenCommand:Ve,get open(){return p.activityOpen},set open(e){p.activityOpen=e}})}};l(c,e=>{p.viewedConversationId&&e(u)}),x(a),k(e,a)},o=L(()=>!(!t(a)||t(h)?.snapshot||t(h)?.error)),c=L(()=>t(S)?.entries??[]),d=L(()=>t(S)?.optimisticMessages??[]),g=L(()=>t(S)?.toolCalls??[]),_=L(()=>t(S)?.treeNodes??[]),y=L(()=>t(S)?.activeRun),b=L(()=>t(S)?.lastRunOutcome),D=L(()=>t(S)?.transient),j=L(()=>t(S)?.queuedPrompts??[]),M=L(()=>t(S)?.recoveryIssues??[]),P=L(()=>t(s)?.sending??t(S)?.sending??!1),ee=L(()=>t(S)?.stopping??!1),U=L(()=>t(S)?.retryingResponse??!1),W=L(()=>t(S)?.responseRevision??0),K=L(()=>p.viewedChildId?[]:he.suggestions),me=L(()=>t(F)?.defaultAgentProfile),Y=L(()=>!!p.viewedChildId),Ne=L(()=>t(C)?.contextUsage),Le=L(()=>t(s)||t(w)?e=>O5(()=>_e(e)):void 0),Re=L(()=>p.viewedChildId?void 0:(e,t)=>{Ie(e,t)}),Ye=L(()=>p.viewedChildId?void 0:e=>{v.editEntry(e)}),Ze=L(()=>p.viewedChildId?void 0:e=>{t(h)&&A5(t(h),e)}),Qe=L(()=>t(h)?.snapshot?Pe:void 0);Koe(Xe,{get active(){return r()},get pendingWork(){return p.pendingWork},get onOpenPendingWork(){return p.openPendingWork},subagents:{list:()=>[...p.leadStore?.snapshot?.children??[]].sort(m4).map(e=>({id:e.id,name:e.title,status:e.status})),open:e=>p.viewAgent(e)},get editorOverlay(){return p.composerOverlay},get session(){return t(Ke)},get activeProject(){return t(T)},get activeConversation(){return t(w)},get activePendingConversation(){return t(s)},get pendingConversationActive(){return t(u)},get conversationLoading(){return t(o)},get approvals(){return t(E)},get pendingUserQuestions(){return t(O)},get pendingPlanReviews(){return t(A)},get entries(){return t(c)},get optimisticMessages(){return t(d)},get toolCalls(){return t(g)},get treeNodes(){return t(_)},get activeRun(){return t(y)},get lastRunOutcome(){return t(b)},get transient(){return t(D)},get queuedPrompts(){return t(j)},get recoveryIssues(){return t(M)},get sending(){return t(P)},get stoppable(){return t(qe)},get stopping(){return t(ee)},get retryingResponse(){return t(U)},get responseRevision(){return t(W)},get composerText(){return v.composerText},get composerSuggestions(){return t(K)},get onSendSuggestion(){return v.sendSuggestion},get onDraftSuggestion(){return v.applySuggestion},get models(){return t(oe)},get selectedModelKey(){return t(te)},get thinkingLevel(){return t(ne)},get planReviewModels(){return t(oe)},get planReviewModelKey(){return t(se)},get planReviewThinkingLevel(){return t(H)},get agentProfile(){return t(re)},get agentProfiles(){return t(ie)},get defaultAgentProfile(){return t(me)},get lockedFields(){return t(ae)},get profileDisabled(){return t(Y)},get permissionRuleSetId(){return t(z)},get permissionRuleSets(){return t(ce)},get permissionRuleSetsLoading(){return t(le)},get permissionRuleSetsError(){return t(ue)},get slashCompletions(){return t(de)},get contextUsage(){return t(Ne)},get conversationUsage(){return t(fe)},get agentUsage(){return pe.agentState.usage},get agentUsageLoading(){return pe.agentState.loading},get agentUsageError(){return pe.agentState.error},onUsageOpenChange:e=>{pe.open=e},onUsageRetry:()=>pe.retry(),get contextWindow(){return pe.contextWindow},get composerFocusToken(){return rl.focusToken},get composerEscapeToken(){return rl.escapeToken},get micShortcutToken(){return rl.micToken},get completionSource(){return t(ze)},get onComposerChange(){return v.setComposerText},onSubmit:()=>{O5(v.submit)},get onAnswerUserQuestion(){return Se},get onDismissUserQuestion(){return Ce},onAbort:()=>{O5(t(S)?.transient?.compaction?.state===`running`?X:v.abortActiveRun)},onCompact:()=>{O5(J)},get onOpenRequestPreview(){return t(Le)},get onNewConversationInProject(){return kd},onOpenFile:ve,onOpenTask:Z,get composerView(){return I},onModelSelectionChange:e=>{O5(()=>ye(e))},onAgentProfileChange:e=>{O5(()=>be(e))},onPermissionRuleSetChange:e=>{O5(()=>xe(e))},onRefreshPermissionRuleSets:()=>{t(T)?.id&&T5.refresh(t(T).id)},onOpenPermissionSettings:()=>void Vt(`general`),onOpenCapabilitySettings:e=>void Vt(e),get onGrantApproval(){return we},get onDenyApproval(){return Te},get onAcceptPlanReview(){return Ee},onAcceptPlanReviewInNewChat:void 0,get onRejectPlanReview(){return De},onRetryResponse:()=>{O5(v.retryActiveResponse)},onCancelCompaction:()=>{O5(ge)},onContinueFromFailure:e=>{O5(()=>Oe(e))},get onForcePushQueuedPrompts(){return ke},get onDiscardQueuedPrompt(){return Ae},get onMoveQueuedPromptToComposer(){return je},get onNavigateToEntry(){return t(Re)},get onEditEntry(){return t(Ye)},get onForkFromEntry(){return t(Ze)},get rewindLocked(){return t(Je)},onOpenHistory:()=>{B(Me,`history`)},get transcriptView(){return t(Me)},get onToggleHistory(){return t(Qe)},get messageStep(){return rl.messageStep},history:e,contextActions:n,activity:i,$$slots:{history:!0,contextActions:!0,activity:!0}})}cce(G(Xe,2),{get compaction(){return He.compaction},get compactionOverridden(){return He.overridden},get instructions(){return t(Ge)},onSaveCompaction:e=>He.saveCompaction(e),onResetCompaction:()=>He.saveCompaction(null),onSaveInstructions:async e=>{await t(h)?.configure({instructions:e})},get compactionOpen(){return t(Ue)},set compactionOpen(e){B(Ue,e,!0)},get instructionsOpen(){return t(We)},set instructionsOpen(e){B(We,e,!0)}}),k(e,Ye),D()}var M5={"async-bash":()=>Os(()=>import(`./AsyncBashCenterHost-Dcx6zVCo.js`),__vite__mapDeps([152,19,2,95,14,6,5,9,1,7,10,11,12,13,137,110,23,33,35,32,46,90,142,104,105,106,143])),"system-prompt":()=>Os(()=>import(`./SystemPromptCenterHost-BqKV92Ew.js`),__vite__mapDeps([153,19,2,10,120,7,109,23,123,26,25,27,110,33,35,32,46,90,43,40,24,55,74,124,125,126,127])),launch:()=>Os(()=>import(`./LaunchCenterHost-CSy1io6s.js`),__vite__mapDeps([154,19,2,139,7,23,79,30,34,26,35,31,9,1,6,10,11,12,13,36,37,38,39,40,110,33,32,46,90,41,111,4,5,17,42,27,43,53,74,137,122,129,140,131,141,142,104,105,106,143])),file:()=>Os(()=>import(`./FileCenterComposedHost-BxLlLMBI.js`),__vite__mapDeps([155,19,2,5,6,11,7,12,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,9,1,10,13,36,37,38,39,40,41,0,3,4,8,14,15,16,17,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,68,69,70,79,113,83,81,74,114,115,116,117,84,118,119,85,120,156,103,104,105,106,157,158,110,90,159,160,98,123,109,124,125,126,127,161,72,73])),"extension-page":()=>Os(()=>import(`./ExtensionPageCenterHost-BO-5q4j_.js`),__vite__mapDeps([162,19,2,85,10,113,83,6,5,11,7,12,23,79,30,34,26,35,31,9,1,13,36,37,38,39,40,32,4,27,49,50,52,53,24,25,56,81,74,114,115,116,117,84,118,119,120])),mermaid:()=>Os(()=>import(`./MermaidCenterHost-kAV1ocvE.js`),__vite__mapDeps([163,19,2,157,46,120,7,32,23,55,158,54,110,33,35,90,105,74,159])),pr:()=>Os(()=>import(`./PullRequestCenterHost-BWJ-exw1.js`),__vite__mapDeps([164,19,2,3,4,5,6,0,1,7,8,9,10,11,12,13,14,15,16,17,165,46,23,98,32,123,26,25,27,109,110,33,35,90,43,40,24,55,74,124,125,120,126,127,131,93,57,79,30,45,21,22,28,29,31,34,36,37,38,39,41,42,44,47,48,49,50,51,52,53,54,56,58,59,115,62,63,130,111,166,119,107,156,103,104,105,106,157,158,159,160,116,161,167,117,129,168,64,65,20,169,70,170,171])),diff:()=>Os(()=>import(`./GitDiffCenterHost-D8i3Jq9A.js`),__vite__mapDeps([172,19,2,13,120,7,165,46,23,98,32,123,26,25,27,109,110,33,35,90,43,40,24,55,74,124,125,126,127,131,93,57,79,30,45,0,1,3,4,5,6,8,9,10,11,12,14,15,16,17,21,22,28,29,31,34,36,37,38,39,41,42,44,47,48,49,50,51,52,53,54,56,58,59,115,62,63,130,111,166,119,107,156,103,104,105,106,157,158,159,160,116,161,167,117,129,168,64,65,20,170])),settings:()=>Os(()=>import(`./SettingsCenterHost-BuiirrId.js`),__vite__mapDeps([173,19,2,22,23,7,24,25,26,27,87,0,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,83,47,88,89,90,102,103,45,32,43,36,37,50,51,104,105,106,28,29,30,31,79,34,35,38,39,40,107,21,33,41,42,44,46,48,49,52,53,54,55,56,57,58,59,62,63,96,69,70,108,109,110,78,61,111,112,81,20,64,113,74,114,115,116,117,84,118,119,85,120,95,121,122,97,123,124,125,126,127,128,129,130,131,82,86,132,133,134,72,73])),logs:()=>Os(()=>import(`./LogsCenterHost-xynA0TWK.js`),__vite__mapDeps([174,19,2,11,7,12,58,8,4,5,6,55,20,40,41,23,39,26,110,33,35,32,46,90,79,30,25,27,104,105,106,64,121])),discover:()=>Os(()=>import(`./DiscoverCenterHost-Bju7ypB-.js`),__vite__mapDeps([175,19,2,87,0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,83,47,88,89,90,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,68,69,70,91,92,60,61,20,62,63,64,65,66,67,74,93,94,85,95,96,97,98,86,99]))};function N5(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:e.kind===`discover`?{kind:`discover`,id:`discover`}:e.kind===`async-bash`?{kind:e.kind,id:e.id,conversationId:e.conversationId,projectId:e.projectId,command:e.command}:{kind:e.kind,id:e.id}}function P5(e){return[e.launch?.displayName,e.launch?.name,e.launch?.command].find(e=>e?.trim())?.trim()??e.id}function F5(e){if(e.kind===`async-bash`)return e.command?.trim()||`Bash · ${e.id}`;if(e.kind===`launch`)return P5(e);if(e.kind===`file`)return e.file?.name??e.relativePath?.split(`/`).pop()??e.path?.split(`/`).pop()??`File`;if(e.kind===`mermaid`){let t=e.locator?e.locator.ordinal+1:void 0;return e.origin===`inline`?`${e.name??`Assistant diagram`}${t?` ${t}`:``}`:`${e.name??e.relativePath?.split(`/`).pop()??e.path?.split(`/`).pop()??`Markdown`} · diagram ${t??``}`.trim()}if(e.kind===`pr`)return`#${e.number}`;if(e.kind===`diff`){let t=e.path?.split(`/`).pop()??`Diff`;return e.area===`staged`?`${t} (staged)`:t}return e.kind===`system-prompt`?`Next request`:e.kind===`settings`?`Settings`:e.kind===`logs`?`Nerve Logs`:e.kind===`discover`?`Discover`:e.kind===`extension-page`?e.id.split(`?`)[0].split(`/`).pop()??`Extension page`:e.kind===`pending-conversation`?e.title:$i(e.conversation.title)}function Jce(e,t){if(e.kind===`async-bash`)return`${F5(e)} · ${e.id}`;if(e.kind===`launch`)return e.launch?`${P5(e)} · ${e.launch.status} · ${hr(e.launch.cwd,t)} · ${e.launch.id}`:`Missing launch · ${e.id}`;if(e.kind===`file`)return e.file?.path??e.path??e.id;if(e.kind===`mermaid`)return e.origin===`inline`?`${F5(e)} · Mermaid diagram from assistant message`:`${e.path??e.id} · Mermaid diagram${e.locator?` at line ${e.locator.startLine}`:``}`;if(e.kind===`diff`)return`${e.path??e.id} · ${e.area===`staged`?`staged`:`unstaged`} changes${e.repo&&e.repo!==`.`?` · ${e.repo}`:``}`;if(e.kind===`pr`)return e.title?`#${e.number} ${e.title}`:`Pull request #${e.number}`;if(e.kind===`system-prompt`)return`System prompt and tools for the next request`;if(e.kind===`settings`)return`Workbench settings`;if(e.kind===`logs`)return`Nerve application logs`;if(e.kind===`discover`)return`Discover Nerve`;if(e.kind===`extension-page`)return`Extension page · ${e.id.split(`?`)[0]}`;let n=e.project?.directory?Vo(e.project.directory,t):e.kind===`pending-conversation`?Vo(e.projectDir,t):`Unknown project`;return e.kind===`pending-conversation`?`${e.title} · ${n} · created on first send`:`${$i(e.conversation.title)} · ${n} · ${e.conversation.id}`}function I5(e){if(e.error)return e.error;if(e.kind===`conversation`||e.kind===`pending-conversation`)return e.activity.label??(e.hasDraft?`Unsaved draft`:void 0);if(e.sending){if(e.kind===`launch`)return`Launch active`;if(e.kind===`file`)return`Loading file`;if(e.kind===`mermaid`)return`Loading diagram`;if(e.kind===`diff`)return`Loading diff`}if(e.kind===`launch`)return e.launch?.status??`missing`;if(e.kind===`file`&&e.file?.truncated)return`Truncated`}function Yce(e){return e.kind===`file`?e.displayMode===`rendered`?`Show code`:`Show preview`:``}function Xce(e){return e.kind===`file`?e.wrapLines?`Disable line wrap`:`Wrap long lines`:``}function Zce(e,t){let n=N5(t);return e.findIndex(e=>{let t=N5(e);return t.kind===n.kind&&t.id===n.id})}var Qce=O(`<div class="size-full min-h-0 min-w-0"><!></div>`);function $ce(e,n){c(n,!0);let r=L(()=>Xr.centerTabs.find(e=>{let t=N5(e);return t.kind===n.identity.kind&&t.id===n.identity.id})),i=L(()=>t(r)?F5(t(r)):`Loading…`),a=L(()=>Xr.activeProject?.name),o=L(()=>Xr.activeCenterTab?.kind===n.identity.kind&&Xr.activeCenterTab.id===n.identity.id),s=L(()=>n.identity.kind in M5?M5[n.identity.kind]:void 0);$a(e,{get title(){return t(i)},get subtitle(){return t(a)},get onBack(){return jO},backLabel:`Back`,scroll:!1,children:(e,r)=>{var i=f(),a=R(i),c=e=>{var n=f(),r=R(n);p(r,()=>t(s)(),e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n).default);var i=Qce(),a=q(i);H(a,()=>t(r),(e,t)=>{t(e,{})}),x(i),k(e,i)}),k(e,n)},u=e=>{B2(e,{})};l(a,e=>{n.visible&&t(o)&&t(s)?e(c):n.visible&&e(u,1)}),k(e,i)},$$slots:{default:!0}}),D()}var L5=U({});function ele(e){return L5[e]??`chat`}function tle(e,t){L5[e]=t}function nle(e){if(e.detached)return`Detached HEAD`;if(!e.hasUpstream){if(!e.hasRemote)return`No remote`;let t=e.unpublishedCount;return t?`${t} unpublished ${t===1?`commit`:`commits`} · not pushed`:`Not pushed`}let t=[];return e.ahead&&t.push(`${e.ahead} ahead`),e.behind&&t.push(`${e.behind} behind`),t.length?t.join(` · `):`Up to date`}function rle(e){if(!e)return;let t=[];return e.ahead&&t.push(`↑${e.ahead}`),e.behind&&t.push(`↓${e.behind}`),[e.currentBranch??`detached`,t.join(` `)].filter(Boolean).join(` · `)}var ile=O(`<div class="mx-3 mt-3 flex items-center gap-1 rounded-lg border border-border-subtle bg-card pr-1 shadow-sm"><button type="button" class="flex min-h-11 min-w-0 flex-1 items-center gap-3 rounded-lg px-3 py-2 text-left active:bg-muted" aria-label="Branches"><!> <span class="grid min-w-0"><span class="truncate text-ui text-foreground"> </span> <span class="truncate text-caption text-muted-foreground"> </span></span></button> <!> <!> <!></div>`),ale=O(`<p class="px-6 py-10 text-center text-ui text-muted-foreground"> </p>`),ole=O(`<p class="px-6 py-10 text-center text-ui text-muted-foreground">Loading changes…</p>`),R5=O(`<!> <!> <!>`,1),sle=O(`<!> <!>`,1),cle=O(`<div class="grid flex-none grid-cols-2 gap-2 border-t bg-panel px-3 pt-2 pb-[calc(var(--safe-bottom)+0.5rem)]"><!> <!></div>`),lle=O(`<div class="flex min-h-0 flex-1 flex-col"><div><!> <!></div> <!></div>`),ule=O(`<!> <!> <!> <!> <!> <!>`,1);function z5(e,n){c(n,!0);let r=(e,n=m,r=m)=>{var i=f(),a=R(i);v(a,17,n,e=>`${r()}:${e.path}`,(e,n)=>{let i=L(()=>oe(t(n).path));{let a=L(()=>t(i).dir||void 0),o=L(()=>ae(t(n),r())),s=L(()=>V(t(n),r())),c=L(()=>U(t(n),r()));Xa(e,{get title(){return t(i).name},get detail(){return t(a)},get meta(){return t(o)},get tone(){return t(s)},get menuItems(){return t(c)},get menuTitle(){return t(n).path},onclick:()=>se(t(n),r())})}}),k(e,i)},i=e=>{var r=f(),i=R(r),a=e=>{var r=ile(),i=q(r),a=q(i);nc(a,{size:16,class:`flex-none text-muted-foreground`});var o=G(a,2),c=q(o),d=z(c,!0),f=G(c,2),m=z(f,!0);x(o),x(i);var g=G(i,2),_=e=>{Q(e,{variant:`ghost`,size:`icon`,ariaLabel:`Switch repository`,onclick:()=>s(!0),children:(e,t)=>{Vw(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}})};l(g,e=>{n.model.repositories.length>1&&e(_)});var v=G(g,2);Q(v,{variant:`ghost`,size:`icon`,ariaLabel:`Refresh`,get disabled(){return n.model.refreshing},onclick:()=>void n.actions.refreshAll(),children:(e,t)=>{cr(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}});var y=G(v,2);{let e=L(()=>!t(p).hasRemote);Q(y,{variant:`ghost`,size:`icon`,ariaLabel:`Sync actions`,get disabled(){return t(e)},onclick:()=>u(!0),children:(e,t)=>{uo(e,{size:18,strokeWidth:1.9})},$$slots:{default:!0}})}x(r),F(e=>{i.disabled=!n.model.availability.available,w(d,t(p).currentBranch??`Detached HEAD`),w(m,e)},[()=>nle(t(p))]),h(`click`,i,()=>kO({kind:`branches`,projectId:n.projectId})),k(e,r)};l(i,e=>{t(p)&&e(a)}),k(e,r)},a=e=>{var i=sle(),a=R(i),o=e=>{var t=ale(),r=z(t,!0);F(()=>w(r,n.model.availability.message)),k(e,t)},s=e=>{var t=ole();k(e,t)},c=e=>{var t=f(),r=R(t);H(r,()=>as,(e,t)=>{t(e,{class:`px-6 py-10`,children:(e,t)=>{var r=f(),i=R(r);H(i,()=>ts,(e,t)=>{t(e,{children:(e,t)=>{var r=R5(),i=R(r);H(i,()=>rs,(e,t)=>{t(e,{class:`text-success`,children:(e,t)=>{nc(e,{size:28,strokeWidth:1.6})},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>os,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var n=g(`Working tree clean`);k(e,n)},$$slots:{default:!0}})});var o=G(a,2);H(o,()=>is,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.model.repositories.length?`No uncommitted changes in this repository.`:n.model.emptyMessage??`No Git repository in this project.`)),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,t)},u=e=>{var n=R5(),i=R(n),a=e=>{{let n=L(()=>`${t(_).staged.length}`);Ha(e,{title:`Staged`,get meta(){return t(n)},get menuItems(){return t(ee)},menuTitle:`Staged changes`,children:(e,n)=>{r(e,()=>t(_).staged,()=>`staged`)},$$slots:{default:!0}})}};l(i,e=>{t(_).staged.length&&e(a)});var o=G(i,2),s=e=>{{let n=L(()=>`${t(b).length}`);Ha(e,{title:`Changes`,get meta(){return t(n)},get menuItems(){return t(te)},menuTitle:`Unstaged changes`,children:(e,n)=>{r(e,()=>t(b),()=>`unstaged`)},$$slots:{default:!0}})}};l(o,e=>{t(b).length&&e(s)});var c=G(o,2),u=e=>{{let n=L(()=>`${t(S).length}`),i=L(()=>t(b).length?void 0:t(te));Ha(e,{title:`Untracked`,get meta(){return t(n)},get menuItems(){return t(i)},menuTitle:`Unstaged changes`,children:(e,n)=>{r(e,()=>t(S),()=>`unstaged`)},$$slots:{default:!0}})}};l(c,e=>{t(S).length&&e(u)}),k(e,n)};l(a,e=>{n.model.availability.available?n.model.initialLoading||n.model.repositories.length>0&&!n.model.changes?e(s,1):t(C)===0?e(c,2):e(u,-1):e(o)});var d=G(a,2),p=e=>{{let r=L(()=>`${n.model.stashes.length}`);Ha(e,{title:`Stashes`,get meta(){return t(r)},children:(e,r)=>{var i=f(),a=R(i);v(a,17,()=>n.model.stashes,e=>e.hash,(e,n)=>{{let r=L(()=>t(n).message||t(n).ref),i=L(()=>ne(t(n)));Xa(e,{get title(){return t(r)},get detail(){return t(n).ref},get meta(){return t(n).relativeDate},get icon(){return uw},get menuItems(){return t(i)}})}}),k(e,i)},$$slots:{default:!0}})}};l(d,e=>{n.model.availability.available&&n.model.stashes.length&&e(p)}),k(e,i)},o=K(n,`embedded`,3,!1),s=K(n,`repositoryPickerOpen`,15,!1),u=K(n,`remoteSheetOpen`,15,!1),d=L(()=>n.model.selectedRepository),p=L(()=>n.model.repositorySummary),_=L(()=>NC(n.model.changes?.files??[])),b=L(()=>t(_).unstaged.filter(e=>!e.untracked)),S=L(()=>t(_).unstaged.filter(e=>e.untracked)),C=L(()=>t(_).staged.length+t(b).length+t(S).length),E=Y(void 0),O=Y(!1),A=Y(void 0),j=L(()=>PC(n.model.changes?.files??[],`unstaged`).length),M=L(()=>!!n.model.operations.bulkMutation),N=L(()=>!!n.model.operations.stashMutation),P=L(()=>n.model.capabilities.bulkMutateFiles.enabled),I=L(()=>n.model.capabilities.stashes.enabled),ee=L(()=>[{label:`Unstage all`,icon:od,disabled:!t(P)||t(M),onSelect:()=>void n.actions.mutateFileScope(t(d),`staged`,`unstage`)},{label:`Stash staged`,icon:uw,disabled:!t(I)||t(N),onSelect:()=>void n.actions.createStash(t(d),`staged`)}]),te=L(()=>[{label:`Stage all`,icon:On,disabled:!t(P)||t(M),onSelect:()=>void n.actions.mutateFileScope(t(d),`unstaged`,`stage`)},{label:`Stash changes`,icon:uw,disabled:!t(I)||t(N),onSelect:()=>void n.actions.createStash(t(d),`unstaged`)},{type:`separator`},{label:`Discard all`,icon:bT,destructive:!0,disabled:!t(P)||t(M),onSelect:()=>B(O,!0)}]);function ne(e){return[{label:`Apply`,icon:dw,disabled:!t(I)||t(N),onSelect:()=>void n.actions.applyStash(t(d),e)},{label:`Drop`,icon:kn,destructive:!0,disabled:!t(I)||t(N),onSelect:()=>B(A,e,!0)}]}let re=L(()=>n.model.repositories.map(e=>({label:e.relativePath===`.`?e.name:e.relativePath,icon:nc,disabled:e.relativePath===t(d),onSelect:()=>void n.actions.selectRepository(e.relativePath)}))),ie=L(()=>[{label:`Pull`,icon:Sw,disabled:!n.model.capabilities.remote.pull.enabled,onSelect:()=>void n.actions.runRemoteOperation(t(d),`pull`)},{label:`Push`,icon:Cw,disabled:!n.model.capabilities.remote.push.enabled,onSelect:()=>void n.actions.runRemoteOperation(t(d),`push`)},{label:`Fetch`,icon:cr,disabled:!n.model.capabilities.remote.fetch.enabled,onSelect:()=>void n.actions.runRemoteOperation(t(d),`fetch`)}]);function ae(e,t){return e.untracked?`U`:(t===`staged`?e.index:e.worktree).trim()||`M`}function V(e,t){let n=ae(e,t);return n===`D`?`destructive`:n===`A`||n===`U`?`success`:`warning`}function oe(e){let t=e.lastIndexOf(`/`);return t<0?{name:e,dir:``}:{name:e.slice(t+1),dir:e.slice(0,t)}}function se(e,r){UO(`diff`,()=>n.actions.openDiff(t(d),e,r))}function ce(e){return e===`staged`?`staged`:`unstaged`}function U(e,r){let i=n.model.capabilities.mutateFiles.enabled,a=[r===`staged`?{label:`Unstage`,icon:od,disabled:!i,onSelect:()=>void n.actions.mutateFile(t(d),e,`unstage`)}:{label:`Stage`,icon:On,disabled:!i,onSelect:()=>void n.actions.mutateFile(t(d),e,`stage`)}];return a.push({label:`Stash this file`,icon:uw,disabled:!t(I)||t(N),onSelect:()=>void n.actions.createStash(t(d),ce(r),e.path)}),r===`unstaged`&&a.push({label:e.untracked?`Delete file`:`Discard changes`,icon:bT,destructive:!0,disabled:!i,onSelect:()=>B(E,e,!0)}),a}let le=L(()=>n.model.availability.available&&t(C)>0),W=L(()=>t(j)>0);var ue=ule(),de=R(ue),fe=e=>{var r=lle(),o=q(r),s=q(o);i(s);var c=G(s,2);a(c),x(o);var u=G(o,2),f=e=>{var r=cle(),i=q(r);{let e=L(()=>!t(W)||!t(P)||t(M));Q(i,{variant:`outline`,get disabled(){return t(e)},onclick:()=>void n.actions.mutateFileScope(t(d),`unstaged`,`stage`),children:(e,t)=>{y();var n=g(`Stage all`);k(e,n)},$$slots:{default:!0}})}var a=G(i,2);Q(a,{get onclick(){return n.onAskAgentToCommit},children:(e,t)=>{y();var n=g(`Ask agent to commit`);k(e,n)},$$slots:{default:!0}}),x(r),k(e,r)};l(u,e=>{t(le)&&e(f)}),x(r),F(()=>X(o,1,T([`min-h-0 flex-1 overflow-y-auto overscroll-contain`,t(le)?`pb-3`:`pb-[calc(0.75rem+var(--safe-bottom))]`]))),k(e,r)},pe=e=>{a(e)};l(de,e=>{o()?e(fe):e(pe,-1)});var me=G(de,2);Wa(me,{get open(){return s()},title:`Repository`,get items(){return t(re)},onOpenChange:e=>s(e)});var he=G(me,2);Wa(he,{get open(){return u()},title:`Sync`,get items(){return t(ie)},onOpenChange:e=>u(e)});var J=G(he,2);{let e=L(()=>`This will permanently discard all ${t(j)} unstaged ${t(j)===1?`change`:`changes`}.`);jn(J,{title:`Discard all changes?`,get description(){return t(e)},confirmLabel:`Discard all`,destructive:!0,onConfirm:()=>void n.actions.mutateFileScope(t(d),`unstaged`,`discard`),get open(){return t(O)},set open(e){B(O,e,!0)}})}var ge=G(J,2);{let e=L(()=>!!t(A)),r=L(()=>`${t(A)?.ref??``} (${t(A)?.message??``}) will be deleted. This cannot be undone.`);jn(ge,{get open(){return t(e)},title:`Drop stash?`,get description(){return t(r)},confirmLabel:`Drop`,destructive:!0,onConfirm:()=>{t(A)&&n.actions.dropStash(t(d),t(A)),B(A,void 0)},onOpenChange:e=>{e||B(A,void 0)}})}var _e=G(ge,2);{let e=L(()=>!!t(E)),r=L(()=>t(E)?.untracked?`Delete file?`:`Discard changes?`),i=L(()=>t(E)?t(E).untracked?`${t(E).path} is not tracked by git and will be deleted. This cannot be undone.`:`${t(E).path} will be restored to its last committed state. This cannot be undone.`:``),a=L(()=>t(E)?.untracked?`Delete`:`Discard`);jn(_e,{get open(){return t(e)},get title(){return t(r)},get description(){return t(i)},get confirmLabel(){return t(a)},destructive:!0,onConfirm:()=>{t(E)&&n.actions.mutateFile(t(d),t(E),`discard`),B(E,void 0)},onOpenChange:e=>{e||B(E,void 0)}})}k(e,ue),D()}ue([`click`]);var B5=O(`<!> <!>`,1),dle=O(`<p class="px-6 py-4 text-ui text-destructive"> </p>`),fle=O(`<p class="px-6 py-10 text-center text-ui text-muted-foreground">Loading pull requests…</p>`),V5=O(`<!> <!> <!>`,1),ple=O(`<div class="min-h-0 flex-1 overflow-y-auto overscroll-contain pb-[calc(0.75rem+var(--safe-bottom))]"><div class="flex items-center justify-end gap-1 px-3 pt-2"><!></div> <!></div>`),mle=O(`<!> <form class="grid min-h-0 gap-4 overflow-y-auto px-4 pb-4"><div class="grid gap-1.5"><!> <!></div> <div class="grid gap-1.5"><!> <!> <p class="text-ui text-muted-foreground">Comma-separated.</p></div> <div class="grid gap-1.5"><!> <!></div> <div class="flex justify-between gap-2"><!> <!></div></form>`,1);function H5(e,n){c(n,!0);let r=(e,n=m)=>{{let r=L(()=>T(n())),i=L(()=>js(n().updatedAt)),a=L(()=>jT(n().checks)),o=L(()=>Ps(n().checks));Xa(e,{get title(){return n().title},get detail(){return t(r)},get meta(){return t(i)},get tone(){return t(a)},get pulse(){return t(o)},onclick:()=>E(n())})}},i=e=>{var r=B5(),i=R(r);{let e=L(()=>t(d)?`default`:`icon`),n=L(()=>t(d)?`Pull request filters, ${t(d)} active`:`Pull request filters`);Q(i,{variant:`ghost`,get size(){return t(e)},get ariaLabel(){return t(n)},onclick:()=>s(!0),children:(e,n)=>{var r=B5(),i=R(r);qw(i,{size:17,strokeWidth:1.9});var a=G(i,2),o=e=>{be(e,{variant:`info`,children:(e,n)=>{y();var r=g();F(()=>w(r,t(d))),k(e,r)},$$slots:{default:!0}})};l(a,e=>{t(d)&&e(o)}),k(e,r)},$$slots:{default:!0}})}var a=G(i,2);Q(a,{variant:`ghost`,size:`icon`,ariaLabel:`Refresh pull requests`,get disabled(){return n.model.loadingPullRequests},onclick:()=>void n.actions.refreshPullRequests(t(u)),children:(e,t)=>{cr(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}}),k(e,r)},a=e=>{var i=B5(),a=R(i),s=e=>{var t=dle(),r=z(t,!0);F(()=>w(r,n.model.pullRequestError)),k(e,t)};l(a,e=>{n.model.pullRequestError&&e(s)});var c=G(a,2),u=e=>{var i=B5(),a=R(i),s=e=>{Ha(e,{title:`This branch`,children:(e,t)=>{r(e,()=>n.model.currentBranchPr)},$$slots:{default:!0}})};l(a,e=>{o()&&n.model.currentBranchPr&&e(s)});var c=G(a,2);{let e=L(()=>`${n.model.pullRequests.length}`);Ha(c,{title:`Open`,get meta(){return t(e)},children:(e,i)=>{var a=f(),o=R(a);v(o,17,()=>n.model.pullRequests,e=>e.number,(e,n)=>{r(e,()=>t(n))}),k(e,a)},$$slots:{default:!0}})}k(e,i)},d=e=>{var t=fle();k(e,t)},p=e=>{var t=f(),r=R(t);H(r,()=>as,(e,t)=>{t(e,{class:`px-6 py-10`,children:(e,t)=>{var r=f(),i=R(r);H(i,()=>ts,(e,t)=>{t(e,{children:(e,t)=>{var r=V5(),i=R(r);H(i,()=>rs,(e,t)=>{t(e,{class:`text-muted-foreground`,children:(e,t)=>{ac(e,{size:28,strokeWidth:1.6})},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>os,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var n=g(`No open pull requests`);k(e,n)},$$slots:{default:!0}})});var o=G(a,2);H(o,()=>is,(e,t)=>{t(e,{class:`text-ui`,children:(e,t)=>{y();var r=g();F(()=>w(r,n.model.github?.available===!1?`GitHub is not connected for this repository.`:`Pull requests matching this repository's filters appear here.`)),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,t)};l(c,e=>{n.model.pullRequests.length?e(u):n.model.loadingPullRequests?e(d,1):e(p,-1)}),k(e,i)},o=K(n,`embedded`,3,!1),s=K(n,`filtersOpen`,15,!1),u=L(()=>n.model.selectedRepository),d=L(()=>Ls(n.model.pullRequestFilters)),p=Y(U(zs(Rs))),h=L(()=>Vs(t(p))),_=L(()=>!Fs(t(h),n.model.pullRequestFilters)),b=L(()=>!Fs(n.model.pullRequestFilters,Rs));W(()=>{s()&&me(()=>{B(p,zs(n.model.pullRequestFilters),!0)})});function S(e){e.preventDefault(),t(_)&&(n.actions.configurePullRequests(t(h)),s(!1))}function C(){n.actions.resetPullRequestConfig(),s(!1)}function T(e){let t=[`#${e.number}`];return e.author&&t.push(e.author),e.isDraft&&t.push(`Draft`),t.push(`+${e.additions} −${e.deletions}`),t.join(` · `)}function E(e){UO(`pr`,()=>n.actions.openPullRequest(t(u),e.number))}var O=B5(),A=R(O),j=e=>{var t=ple(),n=q(t),r=q(n);i(r),x(n);var o=G(n,2);a(o),x(t),k(e,t)},N=e=>{a(e)};l(A,e=>{o()?e(j):e(N,-1)});var P=G(A,2);H(P,()=>qa,(e,n)=>{n(e,{get open(){return s()},onOpenChange:e=>s(e),children:(e,n)=>{var r=f(),i=R(r);H(i,()=>Cf,(e,n)=>{n(e,{side:`bottom`,class:`max-h-[90dvh] rounded-t-lg pb-[max(0.5rem,var(--safe-bottom))]`,children:(e,n)=>{var r=mle(),i=R(r);H(i,()=>Ua,(e,t)=>{t(e,{class:`px-4 pb-1 pt-3 text-ui font-medium`,children:(e,t)=>{y();var n=g(`Pull request filters`);k(e,n)},$$slots:{default:!0}})});var a=G(i,2),o=q(a),s=q(o);un(s,{children:(e,t)=>{y();var n=g(`Drafts`);k(e,n)},$$slots:{default:!0}});var c=G(s,2);H(c,()=>ti,(e,n)=>{n(e,{type:`single`,variant:`outline`,class:`w-full`,get value(){return t(p).drafts},"aria-label":`Draft pull requests`,onValueChange:e=>{(e===`include`||e===`exclude`||e===`only`)&&B(p,{...t(p),drafts:e},!0)},children:(e,t)=>{var n=V5(),r=R(n);H(r,()=>ni,(e,t)=>{t(e,{value:`include`,class:`flex-1`,children:(e,t)=>{y();var n=g(`Include`);k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>ni,(e,t)=>{t(e,{value:`exclude`,class:`flex-1`,children:(e,t)=>{y();var n=g(`Exclude`);k(e,n)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>ni,(e,t)=>{t(e,{value:`only`,class:`flex-1`,children:(e,t)=>{y();var n=g(`Only`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),x(o);var l=G(o,2),u=q(l);un(u,{for:`mobile-pr-labels`,children:(e,t)=>{y();var n=g(`Labels`);k(e,n)},$$slots:{default:!0}});var d=G(u,2);an(d,{id:`mobile-pr-labels`,placeholder:`bug, needs-review`,autocapitalize:`off`,get value(){return t(p).labels},set value(e){t(p).labels=e}}),y(2),x(l);var f=G(l,2),m=q(f);un(m,{children:(e,t)=>{y();var n=g(`Sort`);k(e,n)},$$slots:{default:!0}});var h=G(m,2);H(h,()=>ti,(e,n)=>{n(e,{type:`single`,variant:`outline`,class:`w-full`,get value(){return t(p).sort},"aria-label":`Sort pull requests`,onValueChange:e=>{(e===`updated-desc`||e===`updated-asc`)&&B(p,{...t(p),sort:e},!0)},children:(e,t)=>{var n=B5(),r=R(n);H(r,()=>ni,(e,t)=>{t(e,{value:`updated-desc`,class:`flex-1`,children:(e,t)=>{y();var n=g(`Newest`);k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>ni,(e,t)=>{t(e,{value:`updated-asc`,class:`flex-1`,children:(e,t)=>{y();var n=g(`Oldest`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),x(f);var v=G(f,2),w=q(v);{let e=L(()=>!t(b));Q(w,{variant:`ghost`,get disabled(){return t(e)},onclick:C,children:(e,t)=>{y();var n=g(`Reset`);k(e,n)},$$slots:{default:!0}})}var T=G(w,2);{let e=L(()=>!t(_));Q(T,{type:`submit`,get disabled(){return t(e)},children:(e,t)=>{y();var n=g(`Apply`);k(e,n)},$$slots:{default:!0}})}x(v),x(a),M(`submit`,a,S),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,O),D()}var hle=O(`<button type="button" class="mx-3 mt-2 flex min-h-11 flex-none items-center gap-3 rounded-lg border border-border-subtle bg-card px-3 py-2 text-left shadow-sm active:bg-muted"><span class="flex size-8 flex-none items-center justify-center rounded-md bg-warning-subtle text-warning"><!></span> <span class="grid min-w-0 flex-1"><span class="truncate text-ui text-foreground"> </span> <span class="truncate text-caption text-muted-foreground">Uncommitted</span></span> <span class="flex-none text-ui text-primary">Review</span></button>`),U5=O(`<div><!></div>`),gle=O(`<div class="flex min-h-0 flex-col"><div><!> <div class="grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)]"><!></div></div> <!> <!> <!></div>`),_le=O(`<!> <!>`,1);function vle(e,n){c(n,!0);let r=`Review the uncommitted changes in this repository and commit them with clear commit messages. Group unrelated changes into separate commits.`,i=L(()=>n.identity),a=L(()=>`${n.identity.kind}:${n.identity.id}`),o=L(()=>n.identity.kind===`conversation`?Xr.conversations.find(e=>e.id===n.identity.id):void 0),s=L(()=>Xr.centerTabs.find(e=>{let t=N5(e);return t.kind===n.identity.kind&&t.id===n.identity.id})),u=L(()=>t(o)?.title??(t(s)?F5(t(s)):`New chat`)),d=L(()=>t(o)?.projectId??Xr.activeProject?.id),m=L(()=>Xr.projects.find(e=>e.id===t(d))),g=L(()=>t(o)?Kk(t(o)):[]),_=L(()=>ele(t(a))),v=U({});W(()=>{v[t(_)]=!0});let b=ow(()=>t(m),()=>n.visible,()=>n.visible&&t(_)===`pr`),S=L(()=>b.model),C=L(()=>t(S).repositorySummary),E=L(()=>t(S).changes?.files.length??t(C)?.changeCount),O=L(()=>!!(n.identity.kind===`conversation`&&Xr.conversationActivityById[n.identity.id]?.busy)),A=L(()=>[t(m)?.name,t(C)?.currentBranch??void 0].filter(Boolean).join(` · `)),j=L(()=>[{id:`chat`,label:`Chat`},{id:`changes`,label:`Changes`,count:t(E),tone:t(E)?`warning`:void 0},{id:`files`,label:`Files`},{id:`pr`,label:`PR`}]),M=Y(!1);function N(e){tle(t(a),e)}function P(){t(d)&&kO({kind:`project`,projectId:t(d)})}function I(){let e=n.identity.kind===`conversation`?{kind:`conversation`,id:n.identity.id}:t(d)?{kind:`pending-conversation`,id:n.identity.id,projectId:t(d)}:void 0;if(e){let t=Id(),n=t.getPrompt(e).trimEnd();t.setPrompt(e,n?`${n}\n\n${r}`:r)}N(`chat`)}let ee=e=>t(_)===e?`flex min-h-0 flex-1 flex-col`:`hidden`;var te=_le(),ne=R(te);{let e=e=>{var n=f(),r=R(n),i=e=>{Q(e,{variant:`ghost`,size:`icon`,ariaLabel:`Conversation actions`,onclick:()=>B(M,!0),children:(e,t)=>{uo(e,{size:18,strokeWidth:1.9})},$$slots:{default:!0}})};l(r,e=>{t(g).length&&e(i)}),k(e,n)},r=e=>{Za(e,{get items(){return t(j)},get value(){return t(_)},label:`Conversation views`,onSelect:N})},a=L(()=>t(d)?P:void 0),o=L(()=>`Open ${t(m)?.name??`project`}`);$a(ne,{get title(){return t(u)},get subtitle(){return t(A)},get onSubtitleSelect(){return t(a)},get subtitleLabel(){return t(o)},get onBack(){return jO},backLabel:`Back`,scroll:!1,actions:e,below:r,children:(e,r)=>{var a=gle(),o=q(a),s=q(o),c=e=>{var n=hle(),r=q(n);Rw(q(r),{size:16}),x(r);var i=G(r,2),a=q(i),o=z(a);y(2),x(i),y(2),x(n),F(()=>w(o,`${t(E)??``}
157
+ ${t(E)===1?`file`:`files`} changed`)),h(`click`,n,()=>N(`changes`)),k(e,n)};l(s,e=>{t(_)===`chat`&&t(E)&&!t(O)&&e(c)});var u=G(s,2),m=q(u);{let e=L(()=>n.visible&&t(_)===`chat`);j5(m,{get tab(){return t(i)},get active(){return t(e)}})}x(u),x(o);var g=G(o,2),C=e=>{var n=U5();z5(q(n),{get projectId(){return t(d)},get model(){return t(S)},get actions(){return b.actions},embedded:!0,onAskAgentToCommit:I}),x(n),F(e=>X(n,1,e),[()=>T(ee(`changes`))]),k(e,n)};l(g,e=>{v.changes&&t(d)&&e(C)});var D=G(g,2),A=e=>{var n=U5(),r=q(n);p(r,()=>Os(()=>import(`./MobileFilesBody-CiwIT8Vf.js`),__vite__mapDeps([71,19,2,50,20,23,7,72,0,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,28,29,30,31,32,73,74,60,25,26,27,43,61,62,63,24,44,45,46,42,47,64,65,66,67])),null,(e,n)=>{var r=f(),i=R(r);H(i,()=>t(n).default,(e,n)=>{n(e,{get projectId(){return t(d)},path:``,embedded:!0})}),k(e,r)}),x(n),F(e=>X(n,1,e),[()=>T(ee(`files`))]),k(e,n)};l(D,e=>{v.files&&t(d)&&e(A)});var j=G(D,2),M=e=>{var n=U5();H5(q(n),{get model(){return t(S)},get actions(){return b.actions},embedded:!0}),x(n),F(e=>X(n,1,e),[()=>T(ee(`pr`))]),k(e,n)};l(j,e=>{v.pr&&e(M)}),x(a),F(e=>X(o,1,e),[()=>T(ee(`chat`))]),k(e,a)},$$slots:{actions:!0,below:!0,default:!0}})}var re=G(ne,2),ie=e=>{Wa(e,{get open(){return t(M)},get title(){return t(u)},get items(){return t(g)},onOpenChange:e=>B(M,e,!0)})};l(re,e=>{t(g).length&&e(ie)}),k(e,te),D()}ue([`click`]);function W5(e){switch(e?.indicator){case`needs-user`:return 0;case`error`:case`aborted`:return 1;default:return 2}}function yle(e,t){return Number(!!e.conversation.completedAt)-Number(!!t.conversation.completedAt)||Qo(e.conversation,t.conversation)}var ble={pinned:`Pinned`,"needs-you":`Needs you`,today:`Today`,yesterday:`Yesterday`,"previous-7-days":`Previous 7 days`,older:`Older`};function G5(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function xle(e,t){let n=new Date(zo(e));if(Number.isNaN(n.getTime()))return`older`;let r=G5(t),i=G5(n);if(i.getTime()>=r.getTime())return`today`;let a=new Date(r);if(a.setDate(a.getDate()-1),i.getTime()>=a.getTime())return`yesterday`;let o=new Date(r);return o.setDate(o.getDate()-7),i.getTime()>=o.getTime()?`previous-7-days`:`older`}function K5(e){let t=e.activityById??{},n=e.rows.filter(n=>!e.hideCompleted||!n.conversation.completedAt||t[n.conversation.id]?.indicator===`needs-user`),r=e.now??new Date,i=new Map;for(let e of n){let n=e.conversation.pinned?`pinned`:W5(t[e.conversation.id])<2?`needs-you`:xle(e.conversation,r),a=i.get(n)??[];a.push(e),i.set(n,a)}return[`pinned`,`needs-you`,`today`,`yesterday`,`previous-7-days`,`older`].flatMap(e=>{let n=i.get(e);return n?.length?[{key:e,label:ble[e],rows:n.sort((n,r)=>(e===`needs-you`?W5(t[n.conversation.id])-W5(t[r.conversation.id]):0)||(e===`pinned`||e===`needs-you`?Qo(n.conversation,r.conversation):yle(n,r)))}]:[]})}function Sle(e,t){let n=t;return e.flatMap(e=>{if(n<=0)return[];let t=e.rows.slice(0,n);return n-=t.length,t.length?[{...e,rows:t}]:[]})}var Cle=O(`<p class="px-6 py-12 text-center text-ui text-muted-foreground"> </p>`),wle=O(`<div class="px-3 pt-2"><!></div> <!> <!>`,1);function Tle(e,n){c(n,!0);let r=Y(``),i=L(()=>Xr.projects.find(e=>e.id===n.projectId)),a=L(()=>Xr.projectSwitcherItems.find(e=>e.project.id===n.projectId)?.projectIds??[n.projectId]),o=L(()=>O_(Xr.conversations.filter(e=>t(a).includes(e.projectId)))),s=L(()=>Xr.conversationActivityById),u=L(()=>K5({rows:Tee({conversations:t(o),agents:Rr(t(o)),projectIds:t(a),filter:t(r)}),hideCompleted:Yr.hideCompleted})),d=L(()=>t(u).reduce((e,t)=>e+t.rows.length,0));{let n=e=>{{let n=L(()=>!t(i));Q(e,{variant:`ghost`,size:`icon`,ariaLabel:`New chat`,get disabled(){return t(n)},onclick:()=>t(i)&&void GO(t(i)),children:(e,t)=>{On(e,{size:18,strokeWidth:2.1})},$$slots:{default:!0}})}},a=L(()=>[t(i)?.name,t(d)===1?`1 conversation`:`${t(d)} conversations`].filter(Boolean).join(` · `));$a(e,{title:`Conversations`,get subtitle(){return t(a)},get onBack(){return jO},backLabel:`Back to project`,actions:n,children:(e,n)=>{var i=wle(),a=R(i),o=q(a);ks(o,{placeholder:`Search conversations`,ariaLabel:`Search conversations`,get value(){return t(r)},set value(e){B(r,e,!0)}}),x(a);var c=G(a,2);v(c,17,()=>t(u),e=>e.key,(e,n)=>{{let r=L(()=>`${t(n).rows.length}`);Ha(e,{get title(){return t(n).label},get meta(){return t(r)},children:(e,r)=>{var i=f(),a=R(i);v(a,17,()=>t(n).rows,e=>e.conversation.id,(e,n,r,i)=>{let a=L(()=>t(s)[t(n).conversation.id]),o=L(()=>Yk(t(n).conversation));{let r=L(()=>js(zo(t(n).conversation))),i=L(()=>t(a)?.label),s=L(()=>t(a)?.tone??`neutral`),c=L(()=>t(a)?.pulse??!1),l=L(()=>Wo.conversationId===t(n).conversation.id);Xa(e,{get title(){return t(n).conversation.title},get meta(){return t(r)},get detail(){return t(i)},get tone(){return t(s)},get pulse(){return t(c)},get selected(){return t(l)},chevron:!1,get menuItems(){return t(o).menuItems},get swipeLeading(){return t(o).swipeLeading},get swipeTrailing(){return t(o).swipeTrailing},onclick:()=>void WO(t(n).conversation.id)})}}),k(e,i)},$$slots:{default:!0}})}});var p=G(c,2),m=e=>{var n=Cle(),i=z(n,!0);F(e=>w(i,e),[()=>t(r).trim()?`No conversations match your search.`:`No conversations in this project yet.`]),k(e,n)};l(p,e=>{t(d)===0&&e(m)}),k(e,i)},$$slots:{actions:!0,default:!0}})}D()}var Ele=O(`<div class="px-3 py-3"><!></div>`);function Dle(e,n){$a(e,{get title(){return n.title},get onBack(){return jO},backLabel:`Back`,children:(e,r)=>{var i=Ele(),a=q(i);{let e=L(()=>`Open ${n.title} in Nerve on a computer.`);Wh(a,{get icon(){return Dt},title:`Available on desktop`,get description(){return t(e)}})}x(i),k(e,i)},$$slots:{default:!0}})}var Ole=O(`<!> <!> <!>`,1);function kle(e,n){c(n,!0);let r=L(()=>n.model.repositorySummary),i=Y(!1),a=Y(!1);{let o=e=>{var i=Ole(),o=R(i);{let e=L(()=>!n.model.availability.available);Q(o,{variant:`ghost`,size:`icon`,ariaLabel:`Branches`,get disabled(){return t(e)},onclick:()=>kO({kind:`branches`,projectId:n.projectId}),children:(e,t)=>{nc(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}})}var s=G(o,2);Q(s,{variant:`ghost`,size:`icon`,ariaLabel:`Refresh`,get disabled(){return n.model.refreshing},onclick:()=>void n.actions.refreshAll(),children:(e,t)=>{cr(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}});var c=G(s,2);{let e=L(()=>!t(r)?.hasRemote);Q(c,{variant:`ghost`,size:`icon`,ariaLabel:`Sync actions`,get disabled(){return t(e)},onclick:()=>B(a,!0),children:(e,t)=>{uo(e,{size:18,strokeWidth:1.9})},$$slots:{default:!0}})}k(e,i)},s=L(()=>t(r)?.name??`Git changes`),c=L(()=>rle(t(r))),l=L(()=>n.model.repositories.length>1?()=>B(i,!0):void 0);$a(e,{get title(){return t(s)},get subtitle(){return t(c)},get onBack(){return jO},backLabel:`Back`,get onTitleSelect(){return t(l)},titleLabel:`Switch repository`,actions:o,children:(e,r)=>{z5(e,{get projectId(){return n.projectId},get model(){return n.model},get actions(){return n.actions},get repositoryPickerOpen(){return t(i)},set repositoryPickerOpen(e){B(i,e,!0)},get remoteSheetOpen(){return t(a)},set remoteSheetOpen(e){B(a,e,!0)}})},$$slots:{actions:!0,default:!0}})}D()}function q5(e){return e.lastUserMessageAt??e.createdAt}function Ale(e){if(e.hasUpstream)return`↑${e.ahead??0} ↓${e.behind??0}`}function jle(e){let t=e.conversations.filter(t=>!t.completedAt||e.activityById[t.id]?.busy).toSorted((t,n)=>Number(!!e.activityById[n.id]?.busy)-Number(!!e.activityById[t.id]?.busy)||q5(n).localeCompare(q5(t))).slice(0,5),n=e.git;return{recent:t,conversationCount:e.conversations.length,repo:n?{branch:n.detached?`Detached HEAD`:n.branch??`HEAD`,sync:Ale(n)}:void 0,changedCount:n?.changeCount??0,prCount:e.prCount,liveLaunchCount:e.liveLaunchCount}}var J5=(e,n=m)=>{var r=Mle(),i=q(r),a=q(i),o=e=>{{let r=L(()=>n().value?`text-success`:`text-muted-foreground`);ac(e,{size:16,strokeWidth:1.9,get class(){return t(r)}})}},s=e=>{{let r=L(()=>n().value?`text-info`:`text-muted-foreground`);Qu(e,{size:16,strokeWidth:1.9,get class(){return t(r)}})}};l(a,e=>{n().label===`Open PR`?e(o):n().label===`Running`&&e(s,1)});var c=G(a);x(i);var u=G(i,2),d=z(u,!0);x(r),F(()=>{X(r,1,T([`grid min-h-14 content-center gap-0.5 rounded-lg p-2.5 text-left`,n().tinted?`bg-warning-subtle`:`bg-muted`])),J(r,`aria-label`,`${n().value} ${n().label}`),X(i,1,T([`flex items-center gap-1 text-title font-medium tabular-nums`,n().tinted?`text-warning`:`text-foreground`])),w(c,` ${n().value??``}`),w(d,n().label)}),h(`click`,r,function(...e){n().open?.apply(this,e)}),k(e,r)},Mle=O(`<button type="button"><span><!> </span> <span class="text-caption text-muted-foreground"> </span></button>`),Nle=O(`<span class="flex-none text-caption text-muted-foreground"> </span>`),Ple=O(`<p class="px-4 py-4 text-ui text-muted-foreground">No open conversations.</p>`),Fle=O(`<span class="absolute right-2 top-1.5 size-2 animate-pulse rounded-full bg-info" role="img" aria-label="Running"></span>`),Ile=O(`<button type="button" class="relative grid min-h-16 content-center justify-items-center gap-1.5 rounded-xl border border-border-subtle bg-card py-3"><!> <span class="text-caption text-foreground"> </span> <!></button>`),Lle=O(`<div class="grid gap-3 px-3 pt-4 pb-2"><div class="grid gap-3 rounded-xl border border-border-subtle bg-card p-3.5"><div class="flex items-center gap-2"><!> <span class="min-w-0 flex-1 truncate text-ui"> </span> <!></div> <div class="grid grid-cols-3 gap-2"><!> <!> <!></div></div></div> <!> <div class="grid grid-cols-3 gap-2 px-3 pt-2"></div>`,1);function Rle(e,n){c(n,!0);let r=L(()=>Xr.projects.find(e=>e.id===n.projectId)),i=L(()=>Xr.projectSwitcherItems.find(e=>e.project.id===n.projectId)?.projectIds??[n.projectId]),a=L(()=>Xr.status?.storage.userHome),o=L(()=>Xr.activeProject?.id===n.projectId),s=L(()=>t(o)?QS.gitStatus:void 0),u=L(()=>jle({conversations:Xr.conversations.filter(e=>t(i).includes(e.projectId)),activityById:Xr.conversationActivityById,liveLaunchCount:XD(kf.launches,Xr.projects,n.projectId).filter(e=>GD.has(e.status)).length,git:t(s)?{changeCount:t(s).changeCount,branch:t(s).branch,ahead:t(s).ahead,behind:t(s).behind,hasUpstream:t(s).hasUpstream,detached:t(s).detached}:void 0,prCount:t(o)?n.gitModel.pullRequests.length:0})),d=L(()=>Xr.conversationActivityById),p=L(()=>[{label:`Files`,icon:Ud,live:!1,open:()=>kO({kind:`files`,projectId:n.projectId,path:``})},{label:`Launches`,icon:fT,live:t(u).liveLaunchCount>0,open:()=>kO({kind:`launches`,projectId:n.projectId})},{label:`Notes`,icon:$r,live:!1,open:()=>kO({kind:`notes`,projectId:n.projectId})}]);JO(e,{get project(){return t(r)},children:(e,i)=>{{let i=e=>{QO(e,{})},s=L(()=>t(r)?.name??`Project`),c=L(()=>t(r)?Or(t(r).directory,t(a)):void 0);$a(e,{get title(){return t(s)},get subtitle(){return t(c)},get onBack(){return jO},backLabel:`Back to projects`,actions:i,children:(e,r)=>{var i=Lle(),a=R(i),s=q(a),c=q(s),m=q(c);nc(m,{size:16,strokeWidth:1.9,class:`flex-none text-muted-foreground`});var g=G(m,2),_=z(g,!0),y=G(g,2),b=e=>{var n=Nle(),r=z(n,!0);F(()=>w(r,t(u).repo.sync)),k(e,n)};l(y,e=>{t(u).repo?.sync&&e(b)}),x(c);var S=G(c,2),C=q(S);J5(C,()=>({label:`Changed`,value:t(u).changedCount,tinted:t(u).changedCount>0,open:()=>kO({kind:`git`,projectId:n.projectId})}));var T=G(C,2);J5(T,()=>({label:`Open PR`,value:t(u).prCount,tinted:!1,open:()=>kO({kind:`pull-requests`,projectId:n.projectId})})),J5(G(T,2),()=>({label:`Running`,value:t(u).liveLaunchCount,tinted:!1,open:()=>kO({kind:`launches`,projectId:n.projectId})})),x(S),x(s),x(a);var E=G(a,2);{let e=L(()=>({label:`All ${t(u).conversationCount}`,onclick:()=>kO({kind:`conversations`,projectId:n.projectId})}));Ha(E,{title:`Conversations`,get action(){return t(e)},children:(e,n)=>{var r=f(),i=R(r);v(i,17,()=>t(u).recent,e=>e.id,(e,n,r,i)=>{let a=L(()=>t(d)[t(n).id]),o=L(()=>Yk(t(n)));{let r=L(()=>js(t(n).lastUserMessageAt??t(n).createdAt)),i=L(()=>t(a)?.label),s=L(()=>t(a)?.tone??`neutral`),c=L(()=>t(a)?.pulse??!1);Xa(e,{get title(){return t(n).title},get meta(){return t(r)},get detail(){return t(i)},get tone(){return t(s)},get pulse(){return t(c)},chevron:!1,get menuItems(){return t(o).menuItems},get swipeLeading(){return t(o).swipeLeading},get swipeTrailing(){return t(o).swipeTrailing},onclick:()=>void WO(t(n).id)})}},e=>{var t=Ple();k(e,t)}),k(e,r)},$$slots:{default:!0}})}var D=G(E,2);v(D,21,()=>t(p),e=>e.label,(e,n)=>{let r=L(()=>t(n).icon);var i=Ile(),a=q(i);H(a,()=>t(r),(e,t)=>{t(e,{size:20,strokeWidth:1.8,class:`text-muted-foreground`})});var o=G(a,2),s=z(o,!0),c=G(o,2),u=e=>{var t=Fle();k(e,t)};l(c,e=>{t(n).live&&e(u)}),x(i),F(()=>w(s,t(n).label)),h(`click`,i,function(...e){t(n).open?.apply(this,e)}),k(e,i)}),x(D),F(()=>w(_,t(u).repo?t(u).repo.branch:t(o)?`No repository`:`Repository`)),k(e,i)},$$slots:{actions:!0,default:!0}})}},$$slots:{default:!0}}),D()}ue([`click`]);var Y5=O(`<!> <!>`,1);function zle(e,n){c(n,!0);let r=L(()=>n.model.selectedRepository),i=L(()=>Ls(n.model.pullRequestFilters)),a=Y(!1);{let o=e=>{var o=Y5(),s=R(o);{let e=L(()=>t(i)?`default`:`icon`),n=L(()=>t(i)?`Pull request filters, ${t(i)} active`:`Pull request filters`);Q(s,{variant:`ghost`,get size(){return t(e)},get ariaLabel(){return t(n)},onclick:()=>B(a,!0),children:(e,n)=>{var r=Y5(),a=R(r);qw(a,{size:17,strokeWidth:1.9});var o=G(a,2),s=e=>{be(e,{variant:`info`,children:(e,n)=>{y();var r=g();F(()=>w(r,t(i))),k(e,r)},$$slots:{default:!0}})};l(o,e=>{t(i)&&e(s)}),k(e,r)},$$slots:{default:!0}})}var c=G(s,2);Q(c,{variant:`ghost`,size:`icon`,ariaLabel:`Refresh pull requests`,get disabled(){return n.model.loadingPullRequests},onclick:()=>void n.actions.refreshPullRequests(t(r)),children:(e,t)=>{cr(e,{size:17,strokeWidth:1.9})},$$slots:{default:!0}}),k(e,o)},s=L(()=>n.model.repositorySummary?.name);$a(e,{title:`Pull requests`,get subtitle(){return t(s)},get onBack(){return jO},backLabel:`Back`,actions:o,children:(e,r)=>{H5(e,{get model(){return n.model},get actions(){return n.actions},get filtersOpen(){return t(a)},set filtersOpen(e){B(a,e,!0)}})},$$slots:{actions:!0,default:!0}})}D()}function Ble(e,n){c(n,!0);var r=f(),i=R(r),a=e=>{Rle(e,{get projectId(){return n.route.projectId},get gitModel(){return n.gitPanel.model}})},o=e=>{Tle(e,{get projectId(){return n.route.projectId}})},s=e=>{kle(e,{get projectId(){return n.route.projectId},get model(){return n.gitPanel.model},get actions(){return n.gitPanel.actions}})},u=e=>{Y2(e,{get model(){return n.gitPanel.model},get actions(){return n.gitPanel.actions}})},d=e=>{Dle(e,{get title(){return n.route.title}})},m=e=>{zle(e,{get model(){return n.gitPanel.model},get actions(){return n.gitPanel.actions}})},h=e=>{var t=f(),r=R(t),i=e=>{vle(e,{get identity(){return n.route.identity},get visible(){return n.visible}})},a=e=>{$ce(e,{get identity(){return n.route.identity},get visible(){return n.visible}})};l(r,e=>{n.route.identity.kind===`conversation`||n.route.identity.kind===`pending-conversation`?e(i):e(a,-1)}),k(e,t)},g=e=>{var r=f(),i=R(r);p(i,()=>V2[n.route.kind](),e=>{B2(e,{})},(e,r)=>{let i=L(()=>t(r).default);var a=f(),o=R(a);H(o,()=>t(i),(e,t)=>{t(e,{get route(){return n.route},get visible(){return n.visible}})}),k(e,a)}),k(e,r)};l(i,e=>{n.route.kind===`project`?e(a):n.route.kind===`conversations`?e(o,1):n.route.kind===`git`?e(s,2):n.route.kind===`branches`?e(u,3):n.route.kind===`desktop-only`?e(d,4):n.route.kind===`pull-requests`?e(m,5):n.route.kind===`center`?e(h,6):e(g,-1)}),k(e,r),D()}function Vle(e){return e.find(e=>e.active)??e.find(e=>(e.usage?.quotas.length??0)>0)}var Hle=O(`<!> <span class="px-1.5 text-muted-foreground"> </span>`,1),Ule=O(`<span class="px-1.5 text-muted-foreground"> </span>`),Wle=O(`<span class="px-1.5 text-muted-foreground">No data</span>`),Gle=O(`<!> <!> <!> <!>`,1);function X5(e,n){c(n,!0);let r=L(()=>gk(n.usage)),i=L(()=>_k(n.usage)),a=L(()=>vk(n.usage));var o=Gle(),s=R(o);v(s,17,()=>t(r),e=>e.quota.id,(e,n)=>{{let r=L(()=>Ok(t(n).quota)),i=L(()=>t(n).quota.usedPercent??void 0),a=L(()=>Dk(t(n).quota)),o=L(()=>kk(t(n).quota));Sc(e,{get label(){return t(n).label},get value(){return t(r)},get percent(){return t(i)},get tone(){return t(a)},get caption(){return t(o)}})}});var u=G(s,2);v(u,17,()=>t(i),e=>e.id,(e,n)=>{var r=Hle(),i=R(r);mc(i,{children:(e,r)=>{{let r=L(()=>Ak(t(n))),i=L(()=>t(n).exhausted?`text-destructive`:void 0);cc(e,{get label(){return t(n).label},get value(){return t(r)},get valueClass(){return t(i)}})}},$$slots:{default:!0}});var a=G(i,2),o=z(a,!0);F(e=>w(o,e),[()=>kk(t(n))]),k(e,r)});var d=G(u,2),f=e=>{var n=Ule(),r=z(n,!0);F(()=>w(r,t(a))),k(e,n)};l(d,e=>{t(a)&&e(f)});var p=G(d,2),m=e=>{var t=Wle();k(e,t)};l(p,e=>{t(r).length===0&&t(i).length===0&&!t(a)&&e(m)}),k(e,o),D()}var Z5=O(`<span> </span>`),Kle=O(`<span aria-label="No data">—</span>`),qle=O(`<span class="inline-flex items-center gap-1"><!> <span class="h-1 w-6 overflow-hidden rounded-full bg-border"><span></span></span> <span> </span></span>`),Jle=O(`<span class="tabular-nums"> </span>`),Yle=O(`<span class="inline-flex items-center gap-1.5 whitespace-nowrap"><span> </span> <!> <!> <!></span>`),Xle=O(`<!> <!>`,1);function Zle(e,n){c(n,!0);let r=K(n,`usages`,19,()=>[]),i=K(n,`compact`,3,!1),a=K(n,`open`,15,!1);function o(e){return e==null?0:Math.min(100,Math.max(0,e))}let s={success:``,warning:`text-warning`,destructive:`text-destructive`},u={success:`bg-success`,warning:`bg-warning`,destructive:`bg-destructive-solid`};function d(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}let p=L(r),m=L(()=>Vle(t(p))),h=L(()=>gk(t(m)?.usage)),_=L(()=>{let e=t(h).filter(e=>e.abbreviation),n=t(h).filter(e=>!e.abbreviation),r=[...e,...n.slice(0,1)];return!i()||r.length<=1?r:[r.reduce((e,t)=>(t.quota.usedPercent??0)>(e.quota.usedPercent??0)?t:e)]}),b=L(()=>t(_).length===0?_k(t(m)?.usage)[0]:void 0),S=L(()=>i()||!t(_)[0]?null:Ck(t(_)[0].quota)),C=L(()=>d(t(p).map(e=>e.usage?.updatedAt).filter(e=>!!e).sort().at(-1))),E=L(()=>{let e=[];for(let n of t(p)){let t=[...gk(n.usage).map(e=>`${e.label.toLowerCase()} ${xk(e.quota.usedPercent)}`),..._k(n.usage).map(e=>`${e.label} ${Ak(e)}`)].join(` / `);e.push(`${mk(n.provider)} — ${t||`No data`}`)}return e.join(`
158
+ `)});var O=f(),A=R(O),j=e=>{dc(e,{size:`md`,get triggerClass(){return Zb},ariaLabel:`Open subscription usage details`,side:`top`,align:`end`,get open(){return a()},set open(e){a(e)},trigger:e=>{var n=Yle(),r=q(n),i=z(r,!0),a=G(r,2),c=e=>{var n=Z5(),r=z(n,!0);F((e,t)=>{X(n,1,e),w(r,t)},[()=>T(ft(`tabular-nums`,t(b).exhausted&&`text-destructive`)),()=>jk(t(b))]),k(e,n)},d=e=>{var t=Kle();k(e,t)};l(a,e=>{t(b)?e(c):t(_).length===0&&e(d,1)});var f=G(a,2);v(f,17,()=>t(_),e=>e.quota.id,(e,n)=>{let r=L(()=>t(n).quota.usedPercent),i=L(()=>Dk(t(n).quota));var a=qle(),c=q(a),d=e=>{var r=Z5(),i=z(r,!0);F(()=>w(i,t(n).abbreviation)),k(e,r)};l(c,e=>{t(n).abbreviation&&e(d)});var f=G(c,2),p=z(f),m=G(f,2),h=z(m,!0);x(a),F((e,t,n,r)=>{X(p,1,e),I(p,`width: ${t??``}%`),X(m,1,n),w(h,r)},[()=>T(ft(`block h-full rounded-full`,u[t(i)])),()=>o(t(r)),()=>T(ft(`tabular-nums`,s[t(i)])),()=>xk(t(r))]),k(e,a)});var p=G(f,2),h=e=>{var n=Jle(),r=z(n,!0);F(()=>w(r,t(S))),k(e,n)};l(p,e=>{t(S)&&e(h)}),x(n),F(e=>{J(n,`title`,t(E)),w(i,e)},[()=>mk(t(m).provider)]),k(e,n)},children:(e,n)=>{var r=Xle(),i=R(r);{let e=L(()=>t(C)?`Updated ${t(C)}`:void 0);fc(i,{title:`Subscription usage`,get meta(){return t(e)}})}var a=G(i,2);vc(a,{children:(e,n)=>{var r=f(),i=R(r);v(i,19,()=>t(p),e=>e.provider,(e,n,r)=>{{let i=e=>{var r=f(),i=R(r),a=e=>{be(e,{variant:`neutral`,children:(e,t)=>{y();var n=g(`Active`);k(e,n)},$$slots:{default:!0}})};l(i,e=>{t(n).active&&e(a)}),k(e,r)},a=L(()=>`${mk(t(n).provider)}${t(n).usage?.planType?` · ${t(n).usage.planType}`:``}`),o=L(()=>t(r)>0);lc(e,{get label(){return t(a)},get separated(){return t(o)},action:i,children:(e,r)=>{X5(e,{get usage(){return t(n).usage}})},$$slots:{action:!0,default:!0}})}}),k(e,r)},$$slots:{default:!0}}),k(e,r)},$$slots:{trigger:!0,default:!0}})};l(A,e=>{t(m)&&e(j)}),k(e,O),D()}function Qle(){let e=$n(`usage.subscription.updated`,$le),t=tr(()=>{Ut().catch(()=>void 0)});return()=>{e(),t()}}function $le(e){let t=e.data;t?.provider&&(Kt.subscriptionUsage={...Kt.subscriptionUsage,[t.provider]:t})}var eue={stopping_agents:`Checking and stopping agents`,events:`Deleting events`,leaves:`Deleting agent context leaves`,parent_links:`Detaching parent links`,record_projections:`Deleting history projections`,tool_projections:`Deleting tool projections`,records:`Deleting history records`,snapshots:`Deleting snapshots`,journal_heads:`Deleting journal metadata`,journal_commits:`Deleting journal commits`,metadata:`Deleting conversation metadata`,complete:`Finishing history deletion`,streams:`Removing streams`,payloads:`Removing payloads`};function tue(e){return eue[e]??e}function Q5(e){return{conversations:`Old conversations`,datedLogs:`Dated logs`,rotatedEventLog:`Rotated event log`,crashReports:`Crash reports`,cache:`Cache`,tmp:`Temporary files`}[e]}function $5(e){return e.kind===`delete_project`?`Removing project`:`Cleaning up`}function e7(e){if(!gi(e)||[`queued`,`preparing`,`discovering`,`finalizing`].includes(e.phase))return;let t=e.totalItems??e.totalTargets,n=e.totalItems===void 0?e.completedTargets:e.completedItems;return t>0&&n<t?Math.min(99,Math.round(n/t*100)):void 0}function t7(e){return e.totalItems===void 0?e.totalTargets>0?`${e.completedTargets} of ${e.totalTargets} items`:``:`${e.completedItems} of ${e.totalItems} conversations`}function n7(e){let t=e.currentItem;return t?`${t.title??t.conversationId} · ${tue(t.stage)}`:e.message}var nue=O(`<p class="truncate text-caption text-muted-foreground"> </p>`),rue=O(`<span class="flex-none text-caption text-muted-foreground"> </span>`),iue=O(`<!> <p class="truncate text-caption text-muted-foreground"> </p>`,1),aue=O(`<li> <!></li>`),oue=O(`<ul class="grid gap-0.5 text-caption text-muted-foreground"></ul>`),sue=O(`<p class="text-caption text-muted-foreground"> </p>`),cue=O(`<p class="break-words"> </p>`),lue=O(`<div class="flex items-center gap-2"><!> <span class="text-caption text-muted-foreground">Removed data stays removed.</span></div>`),uue=O(`<div class="grid min-w-0 gap-2" aria-live="polite" aria-atomic="true"><div class="flex items-start gap-2"><!> <div class="grid min-w-0 flex-1 gap-0.5"><p class="text-ui"> </p> <!></div> <!></div> <!> <!> <!> <!> <!> <!></div>`);function due(e,n){c(n,!0);let r=L(()=>gi(n.operation)),i=L(()=>e7(n.operation)),a=L(()=>t(r)?t7(n.operation):``),o=L(()=>[n.operation.removedConversationCount>0&&`${n.operation.removedConversationCount.toLocaleString()} conversations removed`,n.operation.removedLaunchCount>0&&`${n.operation.removedLaunchCount.toLocaleString()} launch records removed`].filter(Boolean).join(` · `));var s=uue(),u=q(s),d=q(u),p=e=>{dn(e,{class:`mt-0.5 size-4 shrink-0`})},m=e=>{Wn(e,{class:`mt-0.5 size-4 shrink-0 text-success`})},h=e=>{Qs(e,{class:`mt-0.5 size-4 shrink-0 text-warning`})};l(d,e=>{t(r)?e(p):n.operation.status===`succeeded`&&!n.operation.warnings.length?e(m,1):e(h,-1)});var _=G(d,2),S=q(_),C=z(S,!0),T=G(S,2),E=e=>{var t=nue(),r=z(t,!0);F(()=>{J(t,`title`,n.operation.project.directory),w(r,n.operation.project.name)}),k(e,t)};l(T,e=>{n.operation.project&&e(E)}),x(_);var O=G(_,2),A=e=>{var n=rue(),r=z(n,!0);F(()=>w(r,t(a))),k(e,n)};l(O,e=>{t(a)&&e(A)}),x(u);var j=G(u,2),M=e=>{var r=iue(),a=R(r),o=e=>{md(e,{get value(){return t(i)},"aria-label":`Cleanup progress`})};l(a,e=>{t(i)!==void 0&&e(o)});var s=G(a,2),c=z(s,!0);F((e,t)=>{J(s,`title`,e),w(c,t)},[()=>n7(n.operation),()=>n7(n.operation)]),k(e,r)};l(j,e=>{t(r)&&e(M)});var N=G(j,2),P=e=>{var r=oue();v(r,21,()=>n.operation.result.targets,e=>e.target,(e,n)=>{var r=aue(),i=q(r),a=G(i),o=e=>{var r=g();F(()=>w(r,`· ${t(n).note??``}`)),k(e,r)};l(a,e=>{t(n).note&&e(o)}),x(r),F((e,t)=>w(i,`${e??``} · ${t??``}`),[()=>Q5(t(n).target),()=>t(n).outcome===`succeeded`?`${t(n).removedItems.toLocaleString()} removed`:t(n).outcome]),k(e,r)}),x(r),k(e,r)};l(N,e=>{n.operation.result?.kind===`storage_cleanup`&&e(P)});var I=G(N,2),ee=e=>{var n=sue(),r=z(n,!0);F(()=>w(r,t(o))),k(e,n)};l(I,e=>{t(o)&&e(ee)});var te=G(I,2),ne=e=>{nn(e,{tone:`destructive`,get text(){return n.operation.error}})};l(te,e=>{n.operation.error&&e(ne)});var re=G(te,2),ie=e=>{nn(e,{tone:`warning`,children:(e,r)=>{var i=f(),a=R(i);v(a,17,()=>n.operation.warnings,b,(e,n)=>{var r=cue(),i=z(r,!0);F(()=>w(i,t(n))),k(e,r)}),k(e,i)},$$slots:{default:!0}})};l(re,e=>{n.operation.warnings.length&&e(ie)});var B=G(re,2),ae=e=>{var t=lue(),r=q(t);Q(r,{size:`sm`,variant:`outline`,get disabled(){return n.operation.cancellationRequested},get onclick(){return n.onCancel},children:(e,t)=>{y();var r=g();F(()=>w(r,n.operation.cancellationRequested?`Stopping`:n.operation.currentItem?`Stop after this conversation`:`Stop after this item`)),k(e,r)},$$slots:{default:!0}}),y(2),x(t),k(e,t)};l(B,e=>{t(r)&&n.operation.cancellable&&n.onCancel&&e(ae)}),x(s),F(e=>w(C,e),[()=>t(r)?$5(n.operation):n.operation.message]),k(e,s),D()}var fue=O(`<span class="inline-flex min-w-0 items-center gap-1.5"><!> <span class="max-w-40 truncate"> </span></span>`),pue=O(`<!> <!>`,1);function r7(e,n){c(n,!0);let r=K(n,`open`,15,!1),i=L(()=>n.operation.totalItems===void 0?`Cleanup in progress`:`Cleaning up ${n.operation.completedItems}/${n.operation.totalItems}`);{let a=e=>{var n=fue(),r=q(n);dn(r,{class:`size-3`});var a=G(r,2),o=z(a,!0);x(n),F(()=>w(o,t(i))),k(e,n)},o=L(()=>`${Zb} min-w-0`),s=L(()=>`${t(i)}. Show progress`);dc(e,{size:`lg`,side:`top`,align:`end`,get triggerClass(){return t(o)},get ariaLabel(){return t(s)},get triggerTitle(){return t(i)},get open(){return r()},set open(e){r(e)},trigger:a,children:(e,t)=>{var r=pue(),i=R(r);fc(i,{title:`Maintenance`});var a=G(i,2);vc(a,{children:(e,t)=>{due(e,{get operation(){return n.operation},get onCancel(){return n.onCancel}})},$$slots:{default:!0}}),k(e,r)},$$slots:{trigger:!0,default:!0}})}D()}var mue=O(`<!> <!> <!>`,1),hue=O(`<!> <!>`,1),gue=O(`<div class="px-3 pt-2"><!></div>`),_ue=O(`<!> <div class="max-h-[70dvh] overflow-y-auto pb-2 text-ui"><!> <!> <!> <!></div>`,1);function vue(e,n){c(n,!0);let r=L(()=>Xr.status),i=L(()=>ik.subscriptionUsages),a=L(()=>t(r)?.version?`v${t(r).version}`:void 0),o=L(()=>{if(!t(r)?.startedAt)return;let e=new Date(t(r).startedAt).getTime();if(!Number.isNaN(e))return uk((Date.now()-e)/6e4)});var s=f(),u=R(s);H(u,()=>qa,(e,n)=>{n(e,{get open(){return Ik.open},onOpenChange:e=>Ik.open=e,children:(e,n)=>{var s=f(),c=R(s);H(c,()=>Cf,(e,n)=>{n(e,{side:`bottom`,class:`rounded-t-lg pb-[max(0.5rem,var(--safe-bottom))]`,swipeToDismiss:!0,onSwipeDismiss:()=>Ik.open=!1,children:(e,n)=>{var s=_ue(),c=R(s);H(c,()=>Ua,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{y();var n=g(`Daemon status and usage`);k(e,n)},$$slots:{default:!0}})});var u=G(c,2),d=q(u);fc(d,{title:`Nerve daemon`,get meta(){return t(a)}});var f=G(d,2);vc(f,{children:(e,n)=>{mc(e,{children:(e,n)=>{var i=mue(),a=R(i);{let e=L(Bk);cc(a,{label:`Connection`,get value(){return t(e)}})}var s=G(a,2);{let e=L(()=>t(o)??void 0);cc(s,{label:`Uptime`,get value(){return t(e)}})}var c=G(s,2);{let e=L(()=>t(r)==null?void 0:t(r).storage.indexHealthy?`Healthy`:`Rebuilding`),n=L(()=>t(r)?.storage.indexHealthy?`text-success`:`text-warning`);cc(c,{label:`Index`,get value(){return t(e)},get valueClass(){return t(n)}})}k(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}});var p=G(f,2);v(p,17,()=>t(i),e=>e.provider,(e,n)=>{var r=hue(),i=R(r);{let e=L(()=>`${mk(t(n).provider)} usage`);fc(i,{get title(){return t(e)}})}var a=G(i,2);vc(a,{children:(e,r)=>{X5(e,{get usage(){return t(n).usage}})},$$slots:{default:!0}}),k(e,r)});var m=G(p,2),h=e=>{var t=gue();r7(q(t),{get operation(){return yf.operation},onCancel:()=>void yf.cancel()}),x(t),k(e,t)};l(m,e=>{yf.active&&yf.operation&&e(h)}),x(u),k(e,s)},$$slots:{default:!0}})}),k(e,s)},$$slots:{default:!0}})}),k(e,s),D()}function i7(){let e=history.state?.nerveMobileDepth;return typeof e==`number`&&Number.isInteger(e)&&e>0?e:0}function yue(){let e=i7(),t;W(()=>{let n=()=>{let n=CO({depth:e,reached:i7(),tab:DO.tab,forward:t});switch(n.kind){case`ignore`:return;case`back`:{let r=DO.stack,i=Math.max(0,r.length-n.count);t={tab:DO.tab,routes:[...r.slice(i),...t?.tab===DO.tab?t.routes:[]]},e-=n.count,MO(i-1);return}case`forward`:e+=n.routes.length,t={tab:DO.tab,routes:n.remaining};for(let e of n.routes)kO(e);return;case`rewind`:history.go(-n.count)}};return window.addEventListener(`popstate`,n),()=>{window.removeEventListener(`popstate`,n),e>0&&history.go(-e),e=0}}),W(()=>{let n=mO(DO.state);if(n!==e){if(t=void 0,n>e)for(;e<n;)e+=1,history.pushState({nerveMobileDepth:e},``);else{let t=e-n;e=n,history.go(-t)}}})}var bue=O(`<!> <!>`,1),xue=O(`<!> <!> <!>`,1);function Sue(e,n){c(n,!0),KO(),yue(),W(()=>Rk());let r=L(tA),i=L(()=>Object.values(Xr.conversationActivityById).some(e=>e?.busy)||kf.launches.some(e=>GD.has(e.status))),a=L(()=>[{id:`inbox`,label:`Inbox`,icon:xo,badge:t(r).needsYou.length},{id:`projects`,label:`Projects`,icon:tx},{id:`activity`,label:`Activity`,icon:$b,dot:t(i)}]),o=new mo;W(()=>{o.add(DO.tab)});let s=L(()=>[`project`,`git`,`pull-requests`,`branches`].includes(DO.top?.kind??``)),u=ow(()=>Xr.activeProject,()=>t(s),()=>t(s)),d=Y(!1);W(()=>{let e=Us.coreReady||Us.phase===`failed`;!t(d)&&e&&me(()=>{NO({projectIds:new Set(Xr.projects.map(e=>e.id)),conversationIds:new Set(Xr.conversations.map(e=>e.id))}),B(d,!0)})});let p=L(()=>DO.top?iO(DO.top):``);W(()=>{t(p)&&t(d)&&me(()=>{let e=DO.top;e&&zO(e)})});function m(e){rO(e)&&OO(e)}var h=xue(),g=R(h);{let e=L(()=>DO.stack.length===0);po(g,{get tabs(){return t(a)},get activeTab(){return DO.tab},onSelectTab:m,get tabBarVisible(){return t(e)},get overlays(){return n.overlays},children:(e,n)=>{var r=f(),i=R(r);v(i,16,()=>tO,e=>e,(e,n)=>{var r=f(),i=R(r),a=e=>{let r=L(()=>DO.state.stacks[n]),i=L(()=>n===DO.tab);var a=bue(),o=R(a);{let e=L(()=>!t(i)||t(r).length>0);fo(o,{get hidden(){return t(e)},children:(e,t)=>{var r=f(),i=R(r),a=e=>{nA(e,{})},o=e=>{R2(e,{})},s=e=>{Qk(e,{})};l(i,e=>{n===`inbox`?e(a):n===`projects`?e(o,1):e(s,-1)}),k(e,r)},$$slots:{default:!0}})}var s=G(o,2);v(s,19,()=>t(r),e=>iO(e),(e,n,a)=>{let o=L(()=>t(i)&&t(a)===t(r).length-1);{let r=L(()=>!t(o));fo(e,{get hidden(){return t(r)},children:(e,r)=>{Ble(e,{get route(){return t(n)},get visible(){return t(o)},get gitPanel(){return u}})},$$slots:{default:!0}})}}),k(e,a)},s=L(()=>o.has(n));l(i,e=>{t(s)&&e(a)}),k(e,r)}),k(e,r)},$$slots:{default:!0}})}var _=G(g,2);eA(_,{}),vue(G(_,2),{}),k(e,h),D()}var a7=U({quitRequested:!1}),Cue=O(`<div class="shutdown-overlay svelte-xmbw1i" role="status" aria-live="polite"><div class="shutdown-card svelte-xmbw1i"><div class="shutdown-spinner svelte-xmbw1i" aria-hidden="true"></div> <strong class="font-medium">Closing Nerve…</strong> <span class="svelte-xmbw1i">Stopping the local daemon safely.</span></div></div>`);function wue(e,n){c(n,!0);let r=L(()=>li.quitting||a7.quitRequested);var i=f(),a=R(i),o=e=>{var t=Cue();k(e,t)};l(a,e=>{li.isDesktop&&t(r)&&e(o)}),k(e,i),D()}function Tue(e,n){c(n,!0);let r=``;W(()=>{Us.progressiveActive&&Ds.connection===`connected`&&me(()=>void H4.refresh())}),W(()=>{let e=H4.notice.health,t=B4(e);t!==r&&(r=t,t&&ui.warning(V4(e),{duration:8e3,activity:!1,action:{label:`View`,onClick:()=>va.setOpen(!0)}}))});let i=L(()=>H4.resetId);{let n=L(()=>t(i)!==void 0),r=L(()=>`Reset ${t(i)??`settings`} to defaults?`),a=L(()=>`This changes the active settings. The original file will be kept in quarantine.${t(i)===`permissions`?` Resetting permission settings changes the policy for the next execution.`:``}`);jn(e,{get open(){return t(n)},get title(){return t(r)},get description(){return t(a)},confirmLabel:`Reset to defaults`,onOpenChange:e=>{e||(H4.resetId=void 0)},onConfirm:()=>{t(i)&&H4.resolve({id:t(i),action:`reset`})}})}D()}function Eue(e,n){c(n,!0);let r=``;W(()=>{let e=[$n(`project.configuration.health`,e=>{let t=hi.safeParse(e.data);t.success&&I4.apply(t.data)}),tr(()=>{for(let e of Object.keys(I4.byProject))I4.refresh(e)})];return()=>{for(let t of e)t()}}),W(()=>{let e=Xr.activeProject?.id;e&&Us.progressiveActive&&Ds.connection===`connected`&&me(()=>void I4.refresh(e))}),W(()=>{let e=j4(I4.byProject);e!==r&&(r=e,e&&ui.warning(M4(I4.byProject),{duration:8e3,activity:!1,action:{label:`View`,onClick:()=>va.setOpen(!0)}}))});let i=L(()=>I4.resetTarget);{let n=L(()=>t(i)!==void 0),r=L(()=>t(i)?.classification===`legacy`?`Remove old files?`:`Reset ${t(i)?t(i).label.toLowerCase():`configuration`}?`),a=L(()=>t(i)?.classification===`legacy`?`Move the listed old project settings to home quarantine. Nothing will be imported, and current settings will not change.`:`${t(i)?.resetDescription??``} The original file is kept in quarantine.`),o=L(()=>t(i)?.classification===`legacy`?`Remove old files`:`Reset`);jn(e,{get open(){return t(n)},get title(){return t(r)},get description(){return t(a)},get confirmLabel(){return t(o)},destructive:!0,onOpenChange:e=>{e||(I4.resetTarget=void 0)},onConfirm:()=>{t(i)&&I4.reset(t(i))}})}D()}function Due(e,t){c(t,!0);let n=[`extensions.changed`,`settings.updated`,`agentProfiles.changed`,`launchCatalog.changed`,`mcp.changed`,`project.configuration.health`,`project.permissions.updated`,`prompt_suggestions.enabled_updated`,`prompt_suggestions.created`],r={};W(()=>{let e=[...n.map(e=>$n(e,()=>g3.refreshSoon())),tr(()=>void g3.refresh())];return()=>{for(let t of e)t()}}),W(()=>{let e=Xr.activeProject?.id,t=Us.progressiveActive&&Ds.connection===`connected`;me(()=>{g3.reset(e),t&&g3.refresh(e)})}),W(()=>{va.open&&me(()=>void g3.refresh())}),W(()=>{if(!g3.loaded)return;let e=l3(g3.entries).broken,t=g3.projectId??``,n=u3(e);if(r[t]===n||(r[t]=n,!n))return;let i=me(()=>Xr.activeProject);ui.warning(d3(e,i?.name),{duration:8e3,activity:!1,action:{label:`View`,onClick:()=>va.setOpen(!0)}})}),W(()=>{if(!g3.loaded)return;g3.resources;let e=g3.projectId??``,t=$6.trustItems;me(()=>{Z6.observeTrust(e,t.map(e=>e.key)),Z6.readReviews(t)})}),W(()=>{if(!Us.progressiveActive)return;let e=$6.waiting.map(e=>({key:e.id,conversationId:e.conversationId})),t=Xr.activeCenterTab,n=t?.kind===`conversation`?t.id:void 0;me(()=>Z6.observeConversations(e,n))}),W(()=>{let e={trust:new Set($6.trustItems.map(e=>e.key)),conversations:new Set($6.waiting.map(e=>e.id))};me(()=>Z6.prune(e))});function i(){g3.loaded&&document.visibilityState===`visible`&&g3.refreshSoon()}M(`focus`,ce,i),M(`visibilitychange`,ee,i),D()}function Oue(e){let n=L(()=>Us.progressiveActive&&Ds.connection===`connected`);W(()=>{t(n)&&ko()}),W(()=>{let r=e();t(n)&&r&&Mo(r)}),W(()=>{if(t(n))return $n(`extensions.changed`,()=>{ko();let t=e();t&&Mo(t)})})}function kue(e,n){c(n,!0);let r=L(()=>Ds.selectedProjectId),i=L(()=>jo(n.viewId)),a=L(()=>Io(t(r))),o=L(()=>t(i)?t(a)?.panels.find(e=>e.extensionId===t(i).extensionId&&e.id===t(i).panelId):void 0);var s=f(),u=R(s),d=e=>{{let i=L(()=>({kind:`panel`,id:t(o).id}));Po(e,{get projectId(){return t(r)},get extensionId(){return t(o).extensionId},get extensionName(){return t(o).extensionName},get extensionIconName(){return t(o).icon},get contribution(){return t(i)},get frameUrl(){return t(o).frameUrl},get baseCssUrl(){return t(a).baseCssUrl},get title(){return t(o).label},get instance(){return n.viewId},onOpenPage:(e,n)=>Ao(t(r),t(o).extensionId,e,n)})}},p=e=>{en(e,{banner:e=>{{let n=L(()=>t(o)?.label??`Extension`);Xt(e,{get title(){return t(n)}})}},children:(e,t)=>{Jt(e,{title:`Panel unavailable`,description:`Open a project with this extension enabled.`})},$$slots:{banner:!0,default:!0}})};l(u,e=>{t(o)&&t(a)&&t(r)?e(d):e(p,-1)}),k(e,s),D()}function Aue(e,n){c(n,!0);let r=L(()=>Io(n.projectId)?.baseCssUrl);var i=f(),a=R(i),o=e=>{{let i=L(()=>({kind:`preview`,id:n.preview.id,edit:n.preview.edit})),a=L(()=>`${n.preview.label} preview: ${n.filePath}`);Po(e,{get projectId(){return n.projectId},get extensionId(){return n.preview.extensionId},get extensionName(){return n.preview.extensionName},get contribution(){return t(i)},get frameUrl(){return n.preview.frameUrl},get baseCssUrl(){return t(r)},get title(){return t(a)},get instance(){return n.instance},get filePath(){return n.filePath},get mode(){return n.mode},onOpenPage:(e,t)=>Ao(n.projectId,n.preview.extensionId,e,t),get onFileWritten(){return n.onFileWritten}})}};l(a,e=>{t(r)&&e(o)}),k(e,i),D()}var o7=`default`;function s7(e){return`${e.extensionId}/${e.id}`}function jue(e){let t=e.split(/[\\/]/).pop()??``,n=t.lastIndexOf(`.`);return n>0?t.slice(n).toLowerCase():``}function Mue(e,t){let n=(t.split(/[\\/]/).pop()??``).toLowerCase();return e.filter(e=>e.match.extensions.some(e=>n.length>e.length&&n.endsWith(e)))}function Nue(e){let t=e.tabChoice??e.remembered;if(t&&t!=="default")return e.matches.find(e=>s7(e)===t)}var c7=O(`<!> <!>`,1),Pue=O(`<!> Edit source`,1),Fue=O(`<div class="flex min-w-0 flex-none flex-wrap items-center gap-2 border-b border-border-subtle bg-panel px-3 py-1.5"><!> <!></div>`);function Iue(e,n){c(n,!0);let r=L(()=>n.selected?s7(n.selected):o7);var i=Fue(),a=q(i);H(a,()=>ti,(e,i)=>{i(e,{type:`single`,variant:`chip`,size:`sm`,get value(){return t(r)},"aria-label":`File view`,onValueChange:e=>{e&&n.onSelect(e)},children:(e,r)=>{var i=c7(),a=R(i);H(a,()=>ni,(e,t)=>{t(e,{get value(){return o7},children:(e,t)=>{y();var n=g(`Default`);k(e,n)},$$slots:{default:!0}})});var o=G(a,2);v(o,17,()=>n.previews,e=>s7(e),(e,n)=>{var r=f(),i=R(r);{let e=L(()=>s7(t(n))),r=L(()=>`${t(n).label} · ${t(n).extensionName}`);H(i,()=>ni,(i,a)=>{a(i,{get value(){return t(e)},get title(){return t(r)},children:(e,r)=>{y();var i=g();F(()=>w(i,t(n).label)),k(e,i)},$$slots:{default:!0}})})}k(e,r)}),k(e,i)},$$slots:{default:!0}})});var o=G(a,2),s=e=>{var t=f(),r=R(t);H(r,()=>ti,(e,t)=>{t(e,{type:`single`,variant:`chip`,size:`sm`,get value(){return n.mode},"aria-label":`Preview mode`,onValueChange:e=>{(e===`preview`||e===`edit`)&&n.onModeChange(e)},children:(e,t)=>{var n=c7(),r=R(n);H(r,()=>ni,(e,t)=>{t(e,{value:`preview`,children:(e,t)=>{y();var n=g(`Preview`);k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>ni,(e,t)=>{t(e,{value:`edit`,children:(e,t)=>{y();var n=g(`Edit`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,t)},u=e=>{Q(e,{variant:`ghost`,size:`sm`,get onclick(){return n.onEditSource},children:(e,t)=>{var n=Pue(),r=R(n);Dn(r,{}),y(),k(e,n)},$$slots:{default:!0}})};l(o,e=>{n.selected?.edit===`custom`?e(s):n.selected?.edit===`source`&&e(u,1)}),x(i),k(e,i),D()}function Lue(e){let t=new Map;for(let n of e){if(!n.newMenu)continue;let e=t.get(n.extensionId)??{extensionId:n.extensionId,pages:[]};e.pages.push(n),t.set(n.extensionId,e)}let n=[...t.values()];if(n.length>1)for(let e of n)e.heading=e.pages[0]?.extensionName??e.extensionId;return n}var Rue=O(`<!> <!>`,1);function zue(e,n){c(n,!0);let r=K(n,`tabs`,19,()=>[]),i=dr(`pane.refresh`),a=dr(`pane.close`),o=dr(`pane.closeOthers`),s=dr(`conversation.new`),u=xr(`conversation.new`),d=L(()=>{let e=Ds.selectedProjectId;return Lue(Io(e)?.pages??[]).map(t=>({heading:t.heading,entries:t.pages.map(t=>({key:`${t.extensionId}/${t.id}`,label:t.label,icon:Oo(t.icon),onSelect:()=>void Ao(e,t.extensionId,t.id)}))}))}),p=L(()=>r().map(v)),m=Y(void 0);function h(e,t){let n=e.key??`${e.kind}:${e.id}`,r=[...document.querySelectorAll(`[data-tab-key]`)].find(e=>e.dataset.tabKey===n);r&&B(m,{...t,anchor:r},!0)}function g(e){let t=r().find(t=>t.kind===e.kind&&t.id===e.id);return t?N5(t):e}function _(e){return r().find(t=>{let n=N5(t);return n.kind===e.kind&&n.id===e.id})}function v(e){let t={...N5(e),label:F5(e),title:Jce(e,n.homeDir),active:e.active,running:e.sending,error:e.error,closeable:!0,wide:e.kind===`launch`||e.kind===`file`||e.kind===`mermaid`||e.kind===`diff`,draft:e.kind===`file`?e.dirty:(e.kind===`conversation`||e.kind===`pending-conversation`)&&e.hasDraft};if(e.kind===`conversation`||e.kind===`pending-conversation`)t.status={conversationActivity:e.activity,label:I5(e)};else if(e.kind===`async-bash`)t.icon=qc;else if(e.kind===`launch`)t.status={label:I5(e)},t.selectIcon=qc;else if(e.kind===`file`)e.dirty&&(t.title=`${t.title} — unsaved changes`),e.renderKind?t.toggle={label:Yce(e),icon:e.displayMode===`rendered`?tre:Fw,disabled:!n.onToggleFileDisplayMode,onClick:()=>n.onToggleFileDisplayMode?.(e.id)}:t.icon=hd;else if(e.kind===`mermaid`)t.icon=Eo;else if(e.kind===`pr`)t.icon=ac;else if(e.kind===`diff`)t.icon=Rw;else if(e.kind===`settings`)t.icon=Xc;else if(e.kind===`logs`)t.icon=Yw;else if(e.kind===`discover`)t.icon=Iw;else if(e.kind===`extension-page`){let n=So(e.id),r=n?wo(n.extensionId,n.pageId):void 0;r&&(t.label=r.label,t.title=`${r.label} · ${r.extensionName}`),t.icon=Oo(r?.icon)}else e.kind===`system-prompt`&&(t.icon=gT);return t}async function y(e){if(e)try{await ri(e)}catch{ui.error(`Could not copy to clipboard`)}}function b(e){let t=_(e);if(!t)return[];let s=N5(t),c=Zce(r(),t),l=c>0,u=c!==-1&&c<r().length-1,d=[],f=[{label:`Refresh`,icon:cr,shortcut:i,disabled:!n.onRefresh||t.kind===`system-prompt`,onSelect:()=>n.onRefresh?.(s)}];if(t.kind===`conversation`){let{conversation:r}=t;d.push({label:`Rename`,icon:Dn,movesFocus:!0,disabled:!n.onUpdateConversationState,onSelect:()=>h(e,{id:r.id,title:r.title})},{label:r.pinnedAt?`Unpin`:`Pin`,icon:r.pinnedAt?Qr:xf,disabled:!n.onUpdateConversationState,onSelect:()=>n.onUpdateConversationState?.(r.id,{pinned:!r.pinnedAt})},{label:r.completedAt?`Reopen`:`Mark done`,icon:r.completedAt?zn:Wn,disabled:!n.onUpdateConversationState,onSelect:()=>n.onUpdateConversationState?.(r.id,{completed:!r.completedAt})}),f.push({label:`Copy ID`,icon:sr,onSelect:()=>void y(r.id)})}if(t.kind===`file`||t.kind===`mermaid`){let e=t.kind===`file`?t.file?.path??t.path:t.path,r=t.kind===`file`?t.relativePath??t.file?.relativePath:t.relativePath;if(d.push({label:`Copy path`,icon:sr,disabled:!e,onSelect:()=>void y(e)},{label:`Copy relative path`,icon:sr,disabled:!r,onSelect:()=>void y(r)}),t.kind===`file`){let e=t.file?.projectId;d.push({label:`Reveal in Files`,icon:Jw,disabled:!e||!r,onSelect:()=>{e&&r&&(Zd(`files`,$d.isCompact),Xd(`files`),A8(e,r))}},{label:Xce(t),icon:gT,disabled:!n.onToggleFileLineWrap,onSelect:()=>n.onToggleFileLineWrap?.(t.id)})}}return[d,[{label:`Close pane`,icon:ye,shortcut:a,onSelect:()=>n.onClose?.(s)},{label:`Close others`,icon:ye,shortcut:o,disabled:r().length<=1||!n.onCloseOther,onSelect:()=>n.onCloseOther?.(s)},{label:`Close to the right`,icon:ye,disabled:!u||!n.onCloseRight,onSelect:()=>n.onCloseRight?.(s)},{label:`Close to the left`,icon:ye,disabled:!l||!n.onCloseLeft,onSelect:()=>n.onCloseLeft?.(s)}],n.onReorder?[{label:`Move left`,icon:Ja,disabled:!l,onSelect:()=>n.onReorder(s,c-1)},{label:`Move right`,icon:Ka,disabled:!u,onSelect:()=>n.onReorder(s,c+1)}]:[],f].filter(e=>e.length>0).flatMap((e,t)=>t===0?e:[{type:`separator`},...e])}var x=Rue(),S=R(x);Ga(S,{get tabs(){return t(p)},get refreshShortcut(){return i},get closeShortcut(){return a},get closeOthersShortcut(){return o},newLabel:`New chat`,get newShortcut(){return s},get newShortcutAria(){return u},buildMenuItems:({tab:e})=>b(e),onSelect:e=>n.onSelect?.(g(e)),onClose:e=>n.onClose?.(g(e)),onRefresh:e=>n.onRefresh?.(g(e)),onCloseOther:e=>n.onCloseOther?.(g(e)),onCloseRight:e=>n.onCloseRight?.(g(e)),onCloseLeft:e=>n.onCloseLeft?.(g(e)),get onNew(){return n.onNew},get newMenuSections(){return t(d)},onReorder:(e,t)=>n.onReorder?.(g(e),t)});var w=G(S,2),T=e=>{let r=L(()=>t(m));var i=f(),a=R(i);C(a,()=>t(r),e=>{Dr(e,{get anchor(){return t(r).anchor},get title(){return t(r).title},onRename:e=>n.onUpdateConversationState?.(t(r).id,{title:e}),onClose:()=>{t(m)===t(r)&&B(m,void 0)}})}),k(e,i)};l(w,e=>{t(m)&&e(T)}),k(e,x),D()}function l7(e){return e?.kind===`conversation`||e?.kind===`pending-conversation`}function u7(e){return`${e.kind}:${e.id}`}function d7(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function Bue(e,t){return e.length===t.length&&e.every((e,n)=>d7(e,t[n]))}function Vue(e,t,n,r=4){let i=new Set(n.filter(l7).map(u7)),a=e.filter(e=>i.has(u7(e)));if(!l7(t))return a.slice(0,r);let o=u7(t);return i.has(o)?[t,...a.filter(e=>u7(e)!==o)].slice(0,r):a.slice(0,r)}function Hue(e,t,n=4){if(!l7(t))return e.slice(0,n);let r=u7(t);return e.some(e=>u7(e)===r)?e.slice(0,n):[t,...e].slice(0,n)}var f7=U({request:0});function p7(){f7.request+=1}tr(p7);var m7={kind:`logs`,id:`logs`};function Uue(){Ds.status?.capabilities.applicationLogs&&(Yo(m7),Ko(m7))}function Wue(){Ds.status?.capabilities.applicationLogs&&(Yo(m7),Ko(m7))}function Gue(){let e=Ds.activeCenterTab?.kind===`logs`,t=Go(m7);Zo(m7),e&&qo(t)}function Kue(e){return t=>{switch(t.kind){case`async-bash`:e.refreshAsyncBash(t.id);return;case`conversation`:e.refreshConversation(t.id);return;case`pending-conversation`:case`launch`:case`discover`:case`extension-page`:e.selectTab(t);return;case`system-prompt`:return;case`file`:e.refreshFile(t.id);return;case`mermaid`:e.refreshMermaid(t.id);return;case`pr`:e.refreshPullRequest(t.id);return;case`diff`:e.refreshDiff(t.id);return;case`settings`:e.loadSettings();return;case`logs`:e.refreshLogs();return}}}async function que(e){let t=I6(e);try{await t.ready,await t.store.recover()}finally{t.release()}}var h7=Kue({refreshConversation:e=>void que(e),refreshAsyncBash:Roe,selectTab:e=>void qo(e),refreshFile:e=>void ite(e),refreshMermaid:e=>void Aae(e),refreshPullRequest:e=>void hC(e),refreshDiff:e=>void iC(e),loadSettings:()=>void Pt(),refreshLogs:p7}),g7=new class{#e=new Map;positions(e){return[...this.#e.get(e)?.values()??[]]}record(e,t){let n=this.#e.get(e);n||(n=new Map,this.#e.set(e,n)),n.set(Yue(t),{...t,path:[...t.path]})}prune(e){for(let t of this.#e.keys())e.has(t)||this.#e.delete(t)}clear(){this.#e.clear()}},_7=`[data-slot="scroll-area-viewport"],.virtual-scroller-viewport,.cm-scroller,[data-center-scrollport]`,Jue=24,v7;function Yue(e){return e.path.join(`.`)}function y7(e){let t=e.dataset.slot;if(t)return`slot:${t}`;if(e.classList.contains(`virtual-scroller-viewport`))return`virtual:${e.getAttribute(`aria-label`)??``}`;if(e.classList.contains(`cm-scroller`))return`codemirror`;let n=e.dataset.centerScrollport;return n===void 0?`${e.tagName.toLowerCase()}:${e.getAttribute(`role`)??``}:${e.getAttribute(`aria-label`)??``}`:`explicit:${n}`}function Xue(e,t){let n=[],r=t;for(;r&&r!==e;){let e=r.parentElement;if(!e)return;let t=Array.prototype.indexOf.call(e.children,r);if(t<0)return;n.unshift(t),r=e}return r===e?n:void 0}function Zue(e,t){let n=e;for(let e of t){let t=n.children.item(e);if(!(t instanceof HTMLElement))return;n=t}return n}function b7(e){return e.matches(_7)&&e.parentElement?.dataset.centerScrollRestoration!==`self`}function x7(e){return[...e.querySelectorAll(_7)].filter(b7)}function Que(e,t){if(!b7(t))return;let n=Xue(e,t);if(!n)return;let r=y7(t),i=x7(e).filter(e=>y7(e)===r);return{path:n,signature:r,ordinal:Math.max(0,i.indexOf(t)),top:t.scrollTop,left:t.scrollLeft}}function $ue(e,t){let n=Zue(e,t.path);return n&&b7(n)&&y7(n)===t.signature?n:x7(e).filter(e=>y7(e)===t.signature)[t.ordinal]}var ede=(e,t)=>{let{tabKey:n}=t,r=t.active,i=r&&g7.positions(n).length>0,a,o=0,s=0,c=!1,l=()=>{i=!1,a!==void 0&&cancelAnimationFrame(a),a=void 0},u=()=>{if(a=void 0,c||!i)return;o+=1;let t=g7.positions(n),r=t.length>0,d=!0;for(let n of t){let t=$ue(e,n);t?(Math.abs(t.scrollTop-n.top)>1||Math.abs(t.scrollLeft-n.left)>1)&&(d=!1,t.scrollTop=n.top,t.scrollLeft=n.left):(r=!1,d=!1)}s=r&&d?s+1:0,s>=2?l():o>=Jue||(a=requestAnimationFrame(u))},d=()=>{r&&i&&a===void 0&&(a=requestAnimationFrame(u))},f=new MutationObserver(()=>{o=0,d()});f.observe(e,{attributes:!0,attributeFilter:[`style`],childList:!0,subtree:!0});let p=t=>{if(!r||i||!(t.target instanceof HTMLElement)||!b7(t.target))return;let a=Que(e,t.target);a&&g7.record(n,a)},m=()=>l();return e.addEventListener(`scroll`,p,!0),e.addEventListener(`wheel`,m,{capture:!0,passive:!0}),e.addEventListener(`touchstart`,m,{capture:!0,passive:!0}),e.addEventListener(`pointerdown`,m,{capture:!0,passive:!0}),e.addEventListener(`keydown`,m,!0),d(),{update(e){e.active!==r&&(r=e.active,r?(i=g7.positions(n).length>0,o=0,s=0,d()):l())},destroy(){c=!0,l(),f.disconnect(),e.removeEventListener(`scroll`,p,!0),e.removeEventListener(`wheel`,m,!0),e.removeEventListener(`touchstart`,m,!0),e.removeEventListener(`pointerdown`,m,!0),e.removeEventListener(`keydown`,m,!0)}}};function tde(e){v7!==void 0&&clearTimeout(v7);let t=new Set(e);v7=setTimeout(()=>{v7=void 0,g7.prune(t)},0)}var nde=O(`<div class="size-full min-h-0 min-w-0"><!></div>`);function S7(e,t){let r=K(t,`hidden`,3,!1);var i=nde(),a=q(i);n(a,()=>t.children),x(i),E(i,(e,t)=>ede?.(e,t),()=>({tabKey:t.tabKey,active:!r()})),F(()=>J(i,`hidden`,r())),k(e,i)}var rde=O(`<div class="center-workspace-content h-full svelte-b6foo6"><!> <!></div>`),C7=O(`<!> <!>`,1),ide=O(`<li class="truncate px-1 py-0.5"> </li>`),ade=O(`<ul class="m-0 max-h-40 list-none overflow-y-auto rounded-md border border-border bg-well p-2 font-mono text-ui"></ul>`),w7=O(`<!> <!> <!>`,1);function ode(e,n){c(n,!0);let r=L(()=>Xr.status),i=L(()=>Xr.centerTabs),a=L(()=>Xr.activeCenterTab),o=L(()=>Ds.openCenterTabs),s=L(()=>l7(t(a))?t(a):void 0),u=Y(U([])),d=L(()=>Hue(t(u),t(s)));W(()=>{tde(new Set(t(o).map(e=>Jo(e))))}),W(()=>{let e=Vue(t(u),t(a),t(o));Bue(t(u),e)||B(u,e,!0)});function m(e){Pn(Nd(e),e)}let h=U({});W(()=>{let e=t(a)?.kind;if(!e||!(e in M5))return;let n=e;h[n]??=M5[n]()});function _(e){Pn(Kee(e),e)}function b(e){Pn(Jee(e),e)}var S=C7(),T=R(S);ro(T,{contentVisible:!0,tabStrip:e=>{{let n=L(()=>t(r)?.storage.userHome);zue(e,{get tabs(){return t(i)},get homeDir(){return t(n)},onSelect:e=>void qo(e),onClose:e=>void Ln(e),get onRefresh(){return h7},onCloseOther:m,onCloseRight:_,onCloseLeft:b,get onToggleFileDisplayMode(){return rte},get onToggleFileLineWrap(){return ate},get onNew(){return Pd},get onReorder(){return wee},onUpdateConversationState:(e,t)=>void Zee(e,t)})}},content:e=>{var n=rde(),r=q(n),i=e=>{var n=f(),r=R(n);C(r,()=>Jo(t(a)),e=>{{let n=L(()=>Jo(t(a)));S7(e,{get tabKey(){return t(n)},children:(e,n)=>{var r=f(),i=R(r),o=e=>{var n=f(),r=R(n);p(r,()=>h[`async-bash`],e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},s=e=>{var n=f(),r=R(n);p(r,()=>h[`system-prompt`],e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},c=e=>{var n=f(),r=R(n);p(r,()=>h.launch,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},u=e=>{var n=f(),r=R(n);p(r,()=>h.file,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},d=e=>{var n=f(),r=R(n);p(r,()=>h.mermaid,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},m=e=>{var n=f(),r=R(n);p(r,()=>h.pr,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},g=e=>{var n=f(),r=R(n);p(r,()=>h.diff,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},_=e=>{var n=f(),r=R(n);p(r,()=>h.settings,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},v=e=>{var n=f(),r=R(n);p(r,()=>h.logs,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},y=e=>{var n=f(),r=R(n);p(r,()=>h[`extension-page`],e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)},b=e=>{var n=f(),r=R(n);p(r,()=>h.discover,e=>{B2(e,{})},(e,n)=>{let r=L(()=>t(n)?.default);var i=f(),a=R(i),o=e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{})}),k(e,n)};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,n)};l(i,e=>{t(a).kind===`async-bash`?e(o):t(a).kind===`system-prompt`?e(s,1):t(a).kind===`launch`?e(c,2):t(a).kind===`file`?e(u,3):t(a).kind===`mermaid`?e(d,4):t(a).kind===`pr`?e(m,5):t(a).kind===`diff`?e(g,6):t(a).kind===`settings`?e(_,7):t(a).kind===`logs`?e(v,8):t(a).kind===`extension-page`?e(y,9):t(a).kind===`discover`&&e(b,10)}),k(e,r)},$$slots:{default:!0}})}}),k(e,n)},o=L(()=>t(a)&&!l7(t(a)));l(r,e=>{t(o)&&e(i)});var c=G(r,2),u=e=>{var n=f(),r=R(n);v(r,17,()=>t(d),e=>u7(e),(e,n)=>{let r=L(()=>d7(t(s),t(n)));{let i=L(()=>u7(t(n))),a=L(()=>!t(r));S7(e,{get tabKey(){return t(i)},get hidden(){return t(a)},children:(e,i)=>{j5(e,{get tab(){return t(n)},get active(){return t(r)}})},$$slots:{default:!0}})}}),k(e,n)},m=e=>{j5(e,{active:!0})};l(c,e=>{t(d).length>0?e(u):t(a)||e(m,1)}),x(n),k(e,n)},$$slots:{tabStrip:!0,content:!0}});var E=G(T,2);H(E,()=>sf,(e,n)=>{n(e,{get open(){return In.open},onOpenChange:e=>{e||Nn(`cancel`)},children:(e,n)=>{var r=f(),i=R(r);H(i,()=>of,(e,n)=>{n(e,{showCloseButton:!1,children:(e,n)=>{var r=w7(),i=R(r);H(i,()=>nf,(e,t)=>{t(e,{children:(e,t)=>{var n=C7(),r=R(n);H(r,()=>af,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(()=>w(n,In.files.length>1?`Save changes before closing files?`:`Save changes before closing?`)),k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>rf,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(()=>w(n,In.files.length>1?`${In.files.length} files have unsaved changes.`:`“${In.files[0]?.name??`This file`}” has unsaved changes.`)),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})});var a=G(i,2),o=e=>{var n=ade();v(n,21,()=>In.files,e=>e.id,(e,n)=>{var r=ide(),i=z(r,!0);F(()=>{J(r,`title`,t(n).name),w(i,t(n).name)}),k(e,r)}),x(n),k(e,n)};l(a,e=>{In.files.length>1&&e(o)});var s=G(a,2);H(s,()=>tf,(e,t)=>{t(e,{children:(e,t)=>{var n=w7(),r=R(n);Q(r,{variant:`outline`,onclick:()=>Nn(`cancel`),children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var i=G(r,2);Q(i,{variant:`destructive`,onclick:()=>Nn(`discard`),children:(e,t)=>{y();var n=g();F(()=>w(n,In.files.length>1?`Discard all`:`Discard`)),k(e,n)},$$slots:{default:!0}});var a=G(i,2);Q(a,{onclick:()=>Nn(`save`),children:(e,t)=>{y();var n=g();F(()=>w(n,In.files.length>1?`Save all`:`Save`)),k(e,n)},$$slots:{default:!0}}),k(e,n)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,S),D()}function sde(e,n){c(n,!0);let r=Object.create(null),i=L(()=>Qd.find(e=>e.id===n.viewId)),a=L(()=>{if(!t(i))return;let e=r[t(i).id];return e||(e=t(i).propsKind===`git`?t(i).load().then(({default:e})=>({propsKind:`git`,component:e})):t(i).load().then(({default:e})=>({propsKind:`none`,component:e})),r[t(i).id]=e),e});var o=f(),s=R(o),u=e=>{kue(e,{get viewId(){return n.viewId}})},d=L(()=>jo(n.viewId)),m=e=>{var r=f(),i=R(r);p(i,()=>t(a),e=>{B2(e,{})},(e,r)=>{var i=f(),a=R(i),o=e=>{let i=L(()=>t(r).component);var a=f(),o=R(a);H(o,()=>t(i),(e,t)=>{t(e,{get gitModel(){return n.gitModel},get gitActions(){return n.gitActions}})}),k(e,a)},s=e=>{let n=L(()=>t(r).component);var i=f(),a=R(i);H(a,()=>t(n),(e,t)=>{t(e,{})}),k(e,i)};l(a,e=>{t(r).propsKind===`git`?e(o):e(s,-1)}),k(e,i)}),k(e,r)};l(s,e=>{t(d)?e(u):t(a)&&e(m,1)}),k(e,o),D()}function cde(e,n){c(n,!0);let r=L(()=>Xr.activeProject?.id),i=L(()=>Xr.activeCenterTab),a=L(()=>{let e=e8.fileViews,n=e8.openFileTabIds.flatMap(n=>{let i=e[ls(n)];return i&&i.projectId===t(r)?[i.content?.relativePath??i.path]:[]}),a=t(i)?.kind===`file`?e[ls(t(i).id)]:void 0;return Pae(n,a?.content?.relativePath??a?.path)}),o=L(()=>s8.parsed),s=L(()=>t(o).query===``),l=L(()=>t(s)?t(a).map(e=>({path:e,positions:[]})):s8.matches);async function u(e,n){let i=t(o).line;if(s8.close(),t(r)){if(n.reveal){Zd(`files`,$d.isCompact),Xd(`files`);try{await A8(t(r),e.path)}catch(e){ui.error(`Could not reveal file`,{description:e instanceof Error?e.message:String(e)})}}else await Vd({projectId:t(r),path:e.path,line:i})}}{let n=L(()=>t(s)?void 0:t(o).line),i=L(()=>t(r)!==void 0);qae(e,{get open(){return s8.open},get query(){return s8.query},get items(){return t(l)},get line(){return t(n)},get recent(){return t(s)},get loading(){return s8.loading},get indexing(){return s8.incomplete},get error(){return s8.error},get hasProject(){return t(i)},onQueryChange:e=>s8.setQuery(e),onChoose:(e,t)=>void u(e,t),onOpenChange:e=>{e||s8.close()}})}D()}function lde(e){return e.split(/(`[^`]+`)/).filter(e=>e!==``).map(e=>e.length>2&&e.startsWith("`")&&e.endsWith("`")?{text:e.slice(1,-1),code:!0}:{text:e,code:!1})}function T7(e){return`${e.kindLabel} · ${e.target.scope===`user`?`User`:`Project`}`}function ude(e){let t=e=>(e.broad?0:2)+ +!e.new;return e.map((e,t)=>({item:e,index:t})).sort((e,n)=>t(e.item)-t(n.item)||e.index-n.index).map(({item:e})=>e)}var E7=6e4,D7=60*E7,O7=24*D7;function dde(e,t){let n=Date.parse(e);if(Number.isNaN(n))return;let r=Math.max(0,t-n);return r<E7?`just now`:r<D7?`${Math.floor(r/E7)} min ago`:r<O7?`${Math.floor(r/D7)} h ago`:r<30*O7?`${Math.floor(r/O7)} d ago`:new Date(n).toLocaleDateString()}function fde(e,t){if(e.state!==`needs_review`&&!e.changedSinceDecision)return;let n=e.changedSinceDecision?`Changed`:`Added`,r=e.changedAt?dde(e.changedAt,t):void 0;return`${n} outside Nerve's settings${r?` · ${r}`:``}`}var pde=O(`<code class="rounded-sm bg-muted px-1 font-mono break-all"> </code>`);function mde(e,n){c(n,!0);var r=f(),i=R(r);v(i,17,()=>lde(n.text),b,(e,n)=>{var r=f(),i=R(r),a=e=>{var r=pde(),i=z(r,!0);F(()=>w(i,t(n).text)),k(e,r)},o=e=>{var r=g();F(()=>w(r,t(n).text)),k(e,r)};l(i,e=>{t(n).code?e(a):e(o,-1)}),k(e,r)}),k(e,r),D()}var hde=O(`<span class="size-1 rounded-full bg-muted-foreground" aria-hidden="true"></span>`),gde=O(`<li class="flex items-start gap-2 text-ui"><span class="flex h-5 w-3.5 flex-none items-center justify-center"><!></span> <span class="min-w-0 flex-1 leading-5"><!></span> <!></li>`),_de=O(`<ul class="grid gap-1" aria-label="What it can do"></ul>`),vde=O(`<p class="text-ui text-muted-foreground">Nothing to report.</p>`);function k7(e,n){c(n,!0);let r=K(n,`highlight`,3,!0),i=L(()=>ude(n.items));var a=f(),o=R(a),s=e=>{var n=_de();v(n,21,()=>t(i),b,(e,n)=>{var i=gde(),a=q(i),o=q(a),s=e=>{{let n=L(()=>r()?`size-3.5 text-warning`:`size-3.5 text-muted-foreground`);bn(e,{get class(){return t(n)},"aria-label":`Broad`})}},c=e=>{var t=hde();k(e,t)};l(o,e=>{t(n).broad?e(s):e(c,-1)}),x(a);var u=G(a,2);mde(q(u),{get text(){return t(n).text}}),x(u);var d=G(u,2),f=e=>{be(e,{variant:`info`,children:(e,t)=>{y();var n=g(`New`);k(e,n)},$$slots:{default:!0}})};l(d,e=>{t(n).new&&e(f)}),x(i),k(e,i)}),x(n),k(e,n)},u=e=>{var t=vde();k(e,t)};l(o,e=>{t(i).length?e(s):e(u,-1)}),k(e,a),D()}var yde=O(`<!> <span class="min-w-0 flex-1 truncate font-mono text-ui"> </span> <!>`,1),bde=O(`<button type="button"><!> <!></button>`),xde=O(`<div><!></div>`),Sde=O(`<div role="listitem"><!></div>`),Cde=O(`<p class="px-2.5 py-1.5 text-ui text-muted-foreground">No files.</p>`),wde=O(`<button type="button" class="flex h-7 w-full items-center px-2.5 text-left text-ui text-muted-foreground hover:bg-hover hover:text-foreground focus-visible:bg-hover focus-visible:outline-none"> </button>`),Tde=O(`<div class="min-w-0 divide-y divide-border rounded-md border bg-card" role="list" aria-label="Source"><!> <!></div>`);function A7(e,n){c(n,!0);let r=K(n,`highlight`,3,!0),i=Y(!1),a=L(()=>[...n.sources].sort((e,t)=>Number(!!t.script)-Number(!!e.script))),o=L(()=>t(a).length>6),s=L(()=>t(o)&&!t(i)?t(a).slice(0,4):t(a));var u=Tde(),d=q(u);v(d,17,()=>t(s),e=>e.path,(e,i)=>{L(()=>t(i).script?Lw:hd);var a=Sde();{let e=e=>{var n=yde(),a=R(n);H(a,()=>t(u),(e,t)=>{t(e,{class:`size-3.5 flex-none text-muted-foreground`,"aria-hidden":`true`})});var o=G(a,2),s=z(o,!0),c=G(o,2),d=e=>{{let n=L(()=>r()?`warning`:`neutral`);be(e,{get variant(){return t(n)},children:(e,t)=>{y();var n=g(`Script`);k(e,n)},$$slots:{default:!0}})}};l(c,e=>{t(i).script&&e(d)}),F(()=>w(s,t(i).label)),k(e,n)},u=L(()=>t(i).script?Lw:hd);var o=q(a),s=r=>{var a=bde();X(a,1,`group flex h-7 w-full min-w-0 items-center gap-2 px-2.5 text-left hover:bg-hover focus-visible:bg-hover focus-visible:outline-none`);var o=q(a);e(o);var s=G(o,2);$s(s,{class:`size-3.5 flex-none text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`,"aria-hidden":`true`}),x(a),F(()=>{J(a,`title`,`Open ${t(i).path}`),J(a,`aria-label`,`Open ${t(i).label}`)}),h(`click`,a,()=>n.onOpen(t(i).path)),k(r,a)},c=n=>{var r=xde();X(r,1,T(`group flex h-7 w-full min-w-0 items-center gap-2 px-2.5 text-left`));var a=q(r);e(a),x(r),F(()=>J(r,`title`,t(i).path)),k(n,r)};l(o,e=>{n.onOpen?e(s):e(c,-1)}),x(a)}k(e,a)},e=>{var t=Cde();k(e,t)});var f=G(d,2),p=e=>{var n=wde(),r=z(n,!0);F(()=>{J(n,`aria-expanded`,t(i)),w(r,t(i)?`Show fewer`:`Show ${t(a).length-4} more ${t(a).length-4==1?`file`:`files`}`)}),h(`click`,n,()=>B(i,!t(i))),k(e,n)};l(f,e=>{t(o)&&e(p)}),x(u),k(e,u),D()}ue([`click`]);var Ede={"agent-preferences":vd,"agent-profile":_d,"rule-set":Wt,"permission-overlay":Wt,"launch-catalog":hie,"mcp-servers":jt,skill:It,"prompt-suggestion":kt,extension:Ke},Dde=O(`<span class="flex size-8 items-center justify-center rounded-md border bg-card"><!></span>`),Ode=O(`<div class="flex flex-none items-center gap-1 whitespace-nowrap"><span class="text-caption text-muted-foreground tabular-nums max-sm:sr-only"> </span> <!> <!></div>`),kde=O(`<!> <!>`,1),Ade=O(`<p class="flex items-center gap-1.5 text-ui text-muted-foreground"><!> </p>`),jde=O(`<span class="font-normal text-muted-foreground tabular-nums"> </span>`),Mde=O(`<!> <section class="grid gap-1" aria-labelledby="configuration-review-can"><h3 id="configuration-review-can" class="text-ui font-medium">What it can do</h3> <!></section> <section class="grid gap-1" aria-labelledby="configuration-review-source"><h3 id="configuration-review-source" class="text-ui font-medium">Source <!></h3> <!></section> <p class="text-ui text-muted-foreground"> </p>`,1),Nde=O(`<div class="grid gap-2" aria-busy="true"><!> <!> <!></div>`),Pde=O(`<div class="grid gap-3"><!> <!> <!></div>`);function Fde(e,n){c(n,!0);let r=K(n,`loading`,3,!1),i=K(n,`position`,3,0),a=K(n,`total`,3,1),o=K(n,`busy`,3,!1),s=K(n,`now`,19,()=>Date.now()),u=L(()=>n.review?Ede[n.review.target.kind]:void 0),d=L(()=>n.review?fde(n.review,s()):void 0),p=L(()=>n.review?.state!==`trusted`);{let s=e=>{var n=f(),r=R(n),i=e=>{var n=Dde(),r=q(n);H(r,()=>t(u),(e,t)=>{t(e,{class:`size-4`,"aria-hidden":`true`})}),x(n),k(e,n)};l(r,e=>{t(u)&&e(i)}),k(e,n)},c=e=>{var t=f(),r=R(t),i=e=>{ly(e,{get state(){return n.review.state},get changedSinceDecision(){return n.review.changedSinceDecision}})};l(r,e=>{n.review&&e(i)}),k(e,t)},m=e=>{var r=f(),s=R(r),c=e=>{var r=Ode(),s=q(r),c=z(s),l=G(s,2);{let e=L(()=>i()<=0||o());Mn(l,{get icon(){return wf},label:`Previous`,get disabled(){return t(e)},onclick:()=>n.onPrevious?.()})}var u=G(l,2);{let e=L(()=>i()>=a()-1||o());Mn(u,{get icon(){return mn},label:`Next`,get disabled(){return t(e)},onclick:()=>n.onNext?.()})}x(r),F(()=>w(c,`${i()+1} of ${a()??``}`)),k(e,r)};l(s,e=>{a()>1&&e(c)}),k(e,r)},h=e=>{var t=kde(),r=R(t),s=e=>{Q(e,{variant:`ghost`,class:`mr-auto`,get onclick(){return n.onDetails},children:(e,t)=>{y();var n=g(`Details`);k(e,n)},$$slots:{default:!0}})};l(r,e=>{n.onDetails&&n.review&&e(s)});var c=G(r,2),u=e=>{dy(e,{variant:`dialog`,get state(){return n.review.state},get busy(){return o()},get onSkip(){return n.onSkip},get onTrust(){return n.onTrust},get onDecline(){return n.onDecline},get onRevoke(){return n.onDecline}})},d=e=>{Q(e,{variant:`ghost`,get onclick(){return n.onSkip},children:(e,t)=>{y();var n=g();F(()=>w(n,i()<a()-1?`Not now`:`Close`)),k(e,n)},$$slots:{default:!0}})};l(c,e=>{n.review?e(u):e(d,-1)}),k(e,t)},_=L(()=>n.review?n.review.state===`trusted`?`“${n.review.name}”`:`Trust “${n.review.name}”?`:`Review`),v=L(()=>n.review?T7(n.review):void 0);ln(e,{get open(){return n.open},size:`md`,get title(){return t(_)},get description(){return t(v)},closeLabel:`Close review`,onOpenChange:e=>{e||n.onClose()},leading:s,titleExtra:c,headerActions:m,footer:h,children:(e,i)=>{var a=Pde(),o=q(a),s=e=>{nn(e,{tone:`warning`,get icon(){return bn},get text(){return n.notice}})};l(o,e=>{n.notice&&e(s)});var c=G(o,2),u=e=>{nn(e,{tone:`destructive`,get text(){return n.error},actions:e=>{var t=f(),r=R(t),i=e=>{Q(e,{size:`sm`,variant:`outline`,get onclick(){return n.onRetry},children:(e,t)=>{y();var n=g(`Retry`);k(e,n)},$$slots:{default:!0}})};l(r,e=>{!n.review&&n.onRetry&&e(i)}),k(e,t)},$$slots:{actions:!0}})};l(c,e=>{n.error&&e(u)});var m=G(c,2),h=e=>{var r=Mde(),i=R(r),a=e=>{var n=Ade(),r=q(n);fie(r,{class:`size-3.5 flex-none`,"aria-hidden":`true`});var i=G(r);x(n),F(()=>w(i,` ${t(d)??``}`)),k(e,n)};l(i,e=>{t(d)&&e(a)});var o=G(i,2);k7(G(q(o),2),{get items(){return n.review.items},get highlight(){return t(p)}}),x(o);var s=G(o,2),c=q(s),u=G(q(c)),f=e=>{var t=jde(),r=z(t);F(()=>w(r,`· ${n.review.sources.length??``} files`)),k(e,t)};l(u,e=>{n.review.sources.length>1&&e(f)}),x(c);var m=G(c,2);C(m,()=>n.review,e=>{A7(e,{get sources(){return n.review.sources},get onOpen(){return n.onOpenSource},get highlight(){return t(p)}})}),x(s);var h=G(s,2),g=z(h,!0);F(()=>w(g,n.review.state===`trusted`?`You trusted this exact version. Revoke turns it off.`:`Trust covers this exact version. A change outside Nerve asks again.`)),k(e,r)},_=e=>{var t=Nde(),n=q(t);eg(n,{class:`h-4 w-1/2`});var r=G(n,2);eg(r,{class:`h-16 w-full`}),eg(G(r,2),{class:`h-9 w-full`}),x(t),k(e,t)};l(m,e=>{n.review?e(h):r()&&e(_,1)}),x(a),k(e,a)},$$slots:{leading:!0,titleExtra:!0,headerActions:!0,footer:!0,default:!0}})}D()}function Ide(e,n){c(n,!0);let r=uH(()=>D3.open?3e4:void 0),i=L(()=>$d.isPhone);function a(e){return K4.profiles(e.projectId??Ds.selectedProjectId).find(t=>t.name===e.id&&(t.source??`builtin`)===e.scope)?.usableBy===`subagent`?`sub-agents`:`agents`}function o(){let e=D3.current,t=e?y3(e,a):void 0;if(!t)return;D3.close();let n=t.item?{item:t.item}:{};t.scope===`project`&&t.projectId?zt(t.projectId,t.pageId,n):Vt(t.pageId,n)}let s=L(()=>D3.current?.projectId??Ds.selectedProjectId);function l(e){let n=t(s);n&&(D3.close(),Vd({projectId:n,path:e}))}{let n=L(()=>D3.phase===`loading`),a=L(()=>t(i)||!D3.current||!y3(D3.current)?void 0:o),c=L(()=>t(i)||!t(s)?void 0:l);Fde(e,{get open(){return D3.open},get review(){return D3.review},get loading(){return t(n)},get position(){return D3.index},get total(){return D3.targets.length},get busy(){return D3.busy},get error(){return D3.error},get notice(){return D3.notice},get now(){return r.now},onClose:()=>D3.close(),onPrevious:()=>D3.previous(),onNext:()=>D3.next(),onSkip:()=>D3.skip(),onTrust:()=>void D3.trust(),onDecline:()=>void D3.decline(),onRetry:()=>void D3.reload(),get onDetails(){return t(a)},get onOpenSource(){return t(c)}})}D()}var Lde=O(`<!> <!>`,1);function Rde(e,n){c(n,!0);let r=Y(!1),i=Y(!1),a=Y(!1),o=u_(e=>{B(i,e,!0),e||B(a,!1)}),s=Y(!1),u=Y(void 0),d=Y(0),f=Y(!1),p=Y(void 0),m=Y(`/`),h=Y(void 0),g=Y(!1),_=0,v=L(()=>t(h)??Xr.status?.storage.userHome),y=L(()=>Xr.projects.map(e=>({id:e.id,name:e.name,directory:e.directory})));function b(e){let n=Or(e,t(v));return t(m)===`\\`?n.replaceAll(`/`,`\\`):n}function x(e){return e instanceof Error?e.message:String(e)}function S(e){return Array.from(e.dataTransfer?.types??[]).includes(`Files`)}function C(){o.reset()}function w(e){t(r)&&S(e)&&o.enter()}function T(e){e.relatedTarget===null&&O(e)?C():o.leave()}function E(e){S(e)&&o.over()}function O(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function A(e){e.key===`Escape`&&C()}function j(e){t(r)&&!e.defaultPrevented&&S(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))}function N(e){t(r)&&!e.defaultPrevented&&S(e)&&e.preventDefault()}function P(e){S(e)&&(e.preventDefault(),B(a,!0),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))}function F(){B(a,!1)}function I(e){let t=si()?.files?.getPathForFile;if(!t)return[];let n=[],r=Array.from(e.dataTransfer?.items??[]).filter(e=>e.kind===`file`);return Array.from(e.dataTransfer?.files??[]).forEach((e,i)=>{let a;try{a=t(e)}catch{return}if(!a)return;let o=r[i]?.webkitGetAsEntry?.();n.push({path:a,hint:o?o.isDirectory?`folder`:`file`:`unknown`})}),n}function ee(e){if(C(),!t(r)||!S(e))return;e.preventDefault();let n=I(e);n.length>0&&ne(n)}async function te(e){if(e.hint!==`file`)try{let t=await Od(e.path);return{item:{path:e.path,kind:`folder`,signals:t.signals}}}catch(t){if(e.hint===`folder`)return{item:{path:e.path,kind:`folder`},error:x(t)}}return{item:{path:e.path,kind:`file`}}}async function ne(e){let n=++_;B(u,void 0),B(p,void 0),B(f,!1),B(d,0),B(s,!0);let r=await Promise.all(e.map(te)),i=r.find(e=>e.error)?.error,a=r.map(e=>e.item);if(a.length===1&&a[0].kind===`file`){let e=gr(a[0].path);try{let t=await Od(e);a[0]={...a[0],containingFolder:{path:e,signals:t.signals}}}catch(e){i=x(e)}}n===_&&(B(u,fr(a,t(y),t(g)),!0),B(d,Math.max(t(u).defaultPick,0),!0),B(p,i,!0))}function re(){_+=1,B(s,!1),B(u,void 0),B(p,void 0),B(f,!1)}async function z(){let e=t(u)?.rows[t(d)];if(!e?.selectable||t(f))return;B(f,!0),B(p,void 0);try{await Od(e.path)}catch(e){B(p,x(e),!0),B(f,!1);return}let{projectId:n,path:r}=e;re(),n?await jd(n):await Ad(r)}function ie(e){t(r)&&e.length!==0&&ne(e.map(e=>({path:e,hint:`unknown`})))}le(()=>{let e=si();if(!e?.files?.getPathForFile)return;let t=!1,n;return pi().then(i=>{!t&&i&&(B(r,!0),n=e.files.onOpenPathRequest?.(ie),br().then(e=>{B(m,e.separator,!0),B(h,e.home,!0),B(g,e.caseInsensitive,!0)}).catch(()=>void 0))}).catch(()=>void 0),()=>{t=!0,B(r,!1),o.dispose(),n?.()}});var ae=Lde();M(`dragenter`,ce,w,!0),M(`dragleave`,ce,T,!0),M(`dragover`,ce,E,!0),M(`keydown`,ce,A,!0),M(`blur`,ce,C),M(`dragover`,ce,j),M(`drop`,ce,C,!0),M(`drop`,ce,N),M(`dragend`,ce,C);var V=R(ae),oe=e=>{ur(e,{get over(){return t(a)},ondragover:P,ondragleave:F,ondrop:ee})};l(V,e=>{t(r)&&t(i)&&e(oe)});var se=G(V,2),H=e=>{Tr(e,{get plan(){return t(u)},get busy(){return t(f)},get error(){return t(p)},displayPath:b,onConfirm:()=>void z(),onCancel:re,get open(){return t(s)},set open(e){B(s,e,!0)},get pick(){return t(d)},set pick(e){B(d,e,!0)}})};l(se,e=>{t(r)&&e(H)}),k(e,ae),D()}var zde={locations:br,list:Od,create:Bee},Bde={platform:`other`,separator:`/`,home:``,caseInsensitive:!1},j7;function M7(e){return e instanceof Error?e.message:String(e)}var Vde=class{#e=Y();get locations(){return t(this.#e)}set locations(e){B(this.#e,e,!0)}#t=Y();get cwd(){return t(this.#t)}set cwd(e){B(this.#t,e,!0)}#n=Y();get listing(){return t(this.#n)}set listing(e){B(this.#n,e,!0)}#r=Y(!1);get loading(){return t(this.#r)}set loading(e){B(this.#r,e,!0)}#i=Y();get error(){return t(this.#i)}set error(e){B(this.#i,e,!0)}#a=Y(U([]));get history(){return t(this.#a)}set history(e){B(this.#a,e,!0)}#o=Y(U([]));get future(){return t(this.#o)}set future(e){B(this.#o,e,!0)}#s=Y(``);get filter(){return t(this.#s)}set filter(e){B(this.#s,e,!0)}#c=Y(!1);get showHidden(){return t(this.#c)}set showHidden(e){B(this.#c,e,!0)}#l=Y();get selectedPath(){return t(this.#l)}set selectedPath(e){B(this.#l,e,!0)}#u=Y(!1);get creating(){return t(this.#u)}set creating(e){B(this.#u,e,!0)}#d=Y();get createError(){return t(this.#d)}set createError(e){B(this.#d,e,!0)}#f=Y(!1);get creatingBusy(){return t(this.#f)}set creatingBusy(e){B(this.#f,e,!0)}#p=0;#m;constructor(e=zde){this.#m=e}#h=L(()=>this.locations??Bde);get ctx(){return t(this.#h)}set ctx(e){B(this.#h,e)}#g=L(()=>this.cwd===``);get atThisPC(){return t(this.#g)}set atThisPC(e){B(this.#g,e)}#_=L(()=>this.cwd===void 0||this.atThisPC?void 0:this.listing?.parent??__(this.cwd,this.ctx));get parent(){return t(this.#_)}set parent(e){B(this.#_,e)}#v=L(()=>this.atThisPC?(this.locations?.locations??[]).map(e=>({name:e.label,path:e.path,kind:`directory`,hidden:!1,signals:[]})):this.listing?.entries??[]);get allEntries(){return t(this.#v)}set allEntries(e){B(this.#v,e)}#y=L(()=>this.allEntries.filter(e=>Uo(this.filter,e.name)));get entries(){return t(this.#y)}set entries(e){B(this.#y,e)}#b=L(()=>this.entries.find(e=>e.path===this.selectedPath));get selectedEntry(){return t(this.#b)}set selectedEntry(e){B(this.#b,e)}#x=L(()=>this.selectedPath??(this.atThisPC?void 0:this.cwd));get target(){return t(this.#x)}set target(e){B(this.#x,e)}#S=L(()=>this.selectedEntry?this.selectedEntry.signals:this.selectedPath?[]:this.listing?.signals??[]);get targetSignals(){return t(this.#S)}set targetSignals(e){B(this.#S,e)}async open(e){if(this.history=[],this.future=[],this.filter=``,this.selectedPath=void 0,this.creating=!1,!this.locations)try{this.locations=await this.#m.locations()}catch{}await this.#C(e??j7,`replace`)}go(e){return this.#C(e,`push`)}async goTyped(e){if(e===``&&this.ctx.platform===`win32`)await this.#C(``,`push`);else try{let t=await this.#m.list(e,this.showHidden);this.#w(t.path,t,`push`);return}catch(e){return M7(e)}}up(){return this.parent===void 0?void 0:this.go(this.parent)}back(){let e=this.history.at(-1);if(e!==void 0)return this.cwd!==void 0&&(this.future=[this.cwd,...this.future]),this.history=this.history.slice(0,-1),this.#C(e,`replace`)}forward(){let e=this.future[0];if(e!==void 0)return this.cwd!==void 0&&(this.history=[...this.history,this.cwd]),this.future=this.future.slice(1),this.#C(e,`replace`)}refresh(){return this.#C(this.cwd,`keep`)}setShowHidden(e){return this.showHidden=e,this.#C(this.cwd,`keep`)}select(e){this.selectedPath=e}startCreate(){!this.atThisPC&&this.cwd&&(this.createError=void 0,this.creating=!0)}cancelCreate(){this.creating=!1,this.createError=void 0}async create(e){let t=this.cwd,n=e.trim();if(t&&!this.atThisPC&&n){this.creatingBusy=!0,this.createError=void 0;try{let e=await this.#m.create(t,n);this.creating=!1,await this.#C(t,`keep`),this.selectedPath=e.path}catch(e){this.createError=M7(e)}finally{this.creatingBusy=!1}}}async#C(e,t){let n=++this.#p;if(e===``)this.#w(``,void 0,t);else{this.loading=!0,this.error=void 0;try{let r=await this.#m.list(e,this.showHidden);if(n!==this.#p)return;this.#w(r.path,r,t)}catch(r){if(n!==this.#p)return;this.listing=void 0,this.error=M7(r),e!==void 0&&(t===`push`&&this.cwd!==void 0&&(this.history=[...this.history,this.cwd],this.future=[]),this.cwd=e),this.selectedPath=void 0}finally{n===this.#p&&(this.loading=!1)}}}#w(e,t,n){this.#p+=1,n===`push`&&this.cwd!==void 0&&this.cwd!==e&&(this.history=[...this.history,this.cwd],this.future=[]),n===`keep`?this.selectedPath&&!t?.entries.some(e=>e.path===this.selectedPath)&&(this.selectedPath=void 0):(this.filter=``,this.selectedPath=void 0),this.cwd=e,this.listing=t,this.error=void 0,this.loading=!1,e!==``&&(j7=e)}},Hde=O(`<!> `,1),Ude=O(`<!>Switch to project`,1),Wde=O(`<!>Open`,1),Gde=O(`<div class="flex min-w-0 flex-1 items-center gap-2 max-sm:w-full"><!> <span class="min-w-0 truncate font-mono text-ui"> </span> <span class="flex shrink-0 gap-1 max-sm:hidden"></span></div> <div class="flex items-center gap-1 max-sm:w-full"><span class="mr-2 flex items-center gap-1 text-ui text-muted-foreground max-sm:hidden"><!> open <!> enter</span> <!> <!></div>`,1);function Kde(e,n){c(n,!0);let r=K(n,`signals`,19,()=>[]),i=K(n,`known`,3,!1),a=K(n,`busy`,3,!1);var o=Gde(),s=R(o),u=q(s);tc(u,{class:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`});var d=G(u,2),p=z(d,!0),m=G(d,2);v(m,20,()=>Er(r()),e=>e,(e,n)=>{let r=L(()=>wr[n]),i=L(()=>t(r).icon);{let n=L(()=>t(r).tone??`neutral`);be(e,{get variant(){return t(n)},get title(){return t(r).title},children:(e,n)=>{var a=Hde(),o=R(a);H(o,()=>t(i),(e,t)=>{t(e,{})});var s=G(o,1,!0);F(()=>w(s,t(r).label)),k(e,a)},$$slots:{default:!0}})}}),x(m),x(s);var h=G(s,2),_=q(h),b=q(_);Ju(b,{children:(e,t)=>{y();var n=g(`Enter`);k(e,n)},$$slots:{default:!0}});var S=G(b,2);Ju(S,{children:(e,t)=>{y();var n=g(`→`);k(e,n)},$$slots:{default:!0}}),y(),x(_);var C=G(_,2);Q(C,{variant:`ghost`,class:`max-sm:flex-1`,get onclick(){return n.onCancel},children:(e,t)=>{y();var n=g(`Cancel`);k(e,n)},$$slots:{default:!0}});var T=G(C,2);{let e=L(()=>!n.path||a());Q(T,{class:`max-sm:flex-1`,get disabled(){return t(e)},get onclick(){return n.onOpen},children:(e,t)=>{var n=f(),r=R(n),a=e=>{var t=Ude(),n=R(t);bf(n,{}),y(),k(e,t)},o=e=>{var t=Wde(),n=R(t);tc(n,{}),y(),k(e,t)};l(r,e=>{i()?e(a):e(o,-1)}),k(e,n)},$$slots:{default:!0}})}x(h),F(()=>{J(d,`title`,n.path),w(p,n.displayPath??`Choose a folder`)}),k(e,o),D()}var qde=(e,n=m)=>{var r=f(),i=R(r);v(i,16,()=>new Set(n()),e=>e,(e,n)=>{let r=L(()=>wr[n]);var i=f(),a=R(i),o=e=>{let n=L(()=>t(r).icon);{let i=L(()=>t(r).tone??`neutral`);be(e,{get variant(){return t(i)},get title(){return t(r).title},children:(e,i)=>{var a=Jde(),o=R(a);H(o,()=>t(n),(e,t)=>{t(e,{})});var s=G(o,1,!0);F(()=>w(s,t(r).label)),k(e,a)},$$slots:{default:!0}})}};l(a,e=>{t(r)&&e(o)}),k(e,i)}),k(e,r)},Jde=O(`<!> `,1),Yde=O(`<p class="px-2 text-ui text-destructive" role="alert"> </p>`),Xde=O(`<div class="mb-1 flex flex-col gap-1"><div class="flex items-center gap-2 rounded-md border border-ring px-2 py-0.5"><!> <!> <span class="shrink-0 text-ui text-muted-foreground max-sm:hidden">Enter to create</span></div> <!></div>`),Zde=O(`<div class="flex flex-col gap-1 p-1" role="status" aria-label="Loading"></div>`),Qde=O(`<!>Parent folder`,1),$de=O(`<!>Retry`,1),efe=O(`<div class="flex h-full flex-col items-center justify-center gap-2 p-6 text-center" role="alert"><!> <span class="text-ui"> </span> <span class="max-w-md text-ui text-muted-foreground"> </span> <div class="flex gap-1"><!> <!></div></div>`),tfe=O(`<span class="text-ui text-muted-foreground"> </span>`),nfe=O(`<div class="flex h-full flex-col items-center justify-center gap-2 p-6 text-center"><!> <span class="text-ui"> </span> <!></div>`),rfe=O(`<div role="option" tabindex="-1"><!> <span> </span> <span class="ml-auto flex shrink-0 gap-1 max-sm:hidden"><!></span> <button type="button" tabindex="-1" class="shrink-0 rounded-sm text-muted-foreground opacity-0 group-hover:opacity-100 max-sm:ml-auto max-sm:opacity-100"><!></button></div>`),ife=O(`<div class="flex flex-col outline-none" tabindex="0" role="listbox" aria-label="Folders"></div>`),afe=O(`<div tabindex="-1" class="min-h-0 flex-1 overflow-y-auto p-1.5 outline-none"><!> <!></div>`);function ofe(e,n){c(n,!0);let r=K(n,`el`,15),i=Y(``),a=Y(null),o=L(()=>n.browser.entries.findIndex(e=>e.path===n.browser.selectedPath)),s=L(()=>t(o)>=0?`folder-row-${t(o)}`:void 0),u=L(()=>n.browser.cwd===void 0?``:y_(n.browser.cwd,n.browser.ctx));W(()=>{n.browser.creating&&(B(i,``),t(a)?.focus())}),W(()=>{t(s)&&r()?.querySelector(`#${t(s)}`)?.scrollIntoView({block:`nearest`})});function d(e){e.stopPropagation(),e.key===`Escape`?(e.preventDefault(),n.browser.cancelCreate()):e.key===`Enter`&&(e.preventDefault(),n.browser.create(t(i)))}var f=afe(),p=q(f),m=e=>{var r=Xde(),o=q(r),s=q(o);ec(s,{class:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`});var c=G(s,2);an(c,{ariaLabel:`New folder name`,placeholder:`New folder name`,class:`border-0 bg-transparent px-0 shadow-none focus-visible:ring-0`,get disabled(){return n.browser.creatingBusy},onkeydown:d,get ref(){return t(a)},set ref(e){B(a,e,!0)},get value(){return t(i)},set value(e){B(i,e,!0)}}),y(2),x(o);var u=G(o,2),f=e=>{var t=Yde(),r=z(t,!0);F(()=>w(r,n.browser.createError)),k(e,t)};l(u,e=>{n.browser.createError&&e(f)}),x(r),k(e,r)};l(p,e=>{n.browser.creating&&e(m)});var g=G(p,2),_=e=>{var t=Zde();v(t,20,()=>[0,1,2,3,4,5,6,7],e=>e,(e,t)=>{eg(e,{class:`h-8`})}),x(t),k(e,t)},b=e=>{var r=efe(),i=q(r);bn(i,{class:`size-6 text-destructive`,"aria-hidden":`true`});var a=G(i,2),o=z(a),s=G(a,2),c=z(s,!0),d=G(s,2),f=q(d),p=e=>{Q(e,{variant:`ghost`,size:`sm`,onclick:()=>void n.browser.up(),children:(e,t)=>{var n=Qde(),r=R(n);Zs(r,{}),y(),k(e,n)},$$slots:{default:!0}})};l(f,e=>{n.browser.parent!==void 0&&e(p)});var m=G(f,2);Q(m,{variant:`outline`,size:`sm`,onclick:()=>void n.browser.refresh(),children:(e,t)=>{var n=$de(),r=R(n);cr(r,{}),y(),k(e,n)},$$slots:{default:!0}}),x(d),x(r),F(()=>{w(o,`Can't read ${t(u)??``}`),w(c,n.browser.error)}),k(e,r)},S=e=>{var r=nfe(),i=q(r);Pre(i,{class:`size-6 text-muted-foreground`,"aria-hidden":`true`});var a=G(i,2),o=z(a,!0),s=G(a,2),c=e=>{var n=tfe(),r=z(n);F(()=>w(r,`You can still open ${t(u)??``} itself.`)),k(e,n)};l(s,e=>{n.browser.atThisPC||e(c)}),x(r),F(e=>w(o,e),[()=>n.browser.filter.trim()?`No folders match "${n.browser.filter.trim()}"`:n.browser.atThisPC?`No drives found`:`No subfolders`]),k(e,r)},C=e=>{var r=ife();v(r,23,()=>n.browser.entries,e=>e.path,(e,r,i)=>{let a=L(()=>n.projectIdForPath(t(r).path)),o=L(()=>n.browser.selectedPath===t(r).path),s=L(()=>Wc({selected:t(o)}));var c=rfe(),u=q(c),d=e=>{{let n=L(()=>t(s).icon({class:`size-4 shrink-0`}));Tt(e,{get class(){return t(n)},"aria-hidden":`true`})}},f=e=>{pr(e,{get projectId(){return t(a)},get name(){return t(r).name},class:`size-4 rounded-sm`})},p=e=>{tc(e,{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`})},m=e=>{{let n=L(()=>t(s).icon({class:`size-4 shrink-0`}));Zu(e,{get class(){return t(n)},"aria-hidden":`true`})}};l(u,e=>{n.browser.atThisPC?e(d):t(a)?e(f,1):t(r).signals.length?e(p,2):e(m,-1)});var g=G(u,2),_=z(g,!0),v=G(g,2);qde(q(v),()=>t(r).signals),x(v);var y=G(v,2),b=q(y);mn(b,{class:`size-4`,"aria-hidden":`true`}),x(y),x(c),F((e,n)=>{J(c,`id`,`folder-row-${t(i)}`),J(c,`aria-selected`,t(o)),X(c,1,e),X(g,1,n),w(_,t(r).name),J(y,`aria-label`,`Open folder ${t(r).name}`)},[()=>T(t(s).base({class:`group flex w-full cursor-default items-center gap-2 px-2 py-1.5 text-left max-sm:py-2`})),()=>T(t(s).label({class:ft(`truncate`,t(r).hidden&&`text-muted-foreground`)}))]),h(`click`,c,()=>n.browser.select(t(r).path)),h(`dblclick`,c,()=>void n.browser.go(t(r).path)),h(`click`,y,e=>{e.stopPropagation(),n.browser.go(t(r).path)}),k(e,c)}),x(r),F(()=>{J(r,`aria-busy`,n.browser.loading),J(r,`aria-activedescendant`,t(s))}),k(e,r)};l(g,e=>{n.browser.loading&&!n.browser.listing&&!n.browser.atThisPC?e(_):n.browser.error?e(b,1):n.browser.entries.length===0?e(S,2):e(C,-1)}),x(f),te(f,e=>r(e),()=>r()),k(e,f),D()}ue([`click`,`dblclick`]);var sfe=O(`<p class="absolute top-full right-0 left-0 z-10 mt-1 rounded-md border bg-popover px-2 py-1 text-ui text-destructive shadow-overlay" role="alert"> </p>`),cfe=O(`<li role="option"><button type="button" tabindex="-1"><!> <span> </span></button></li>`),lfe=O(`<ul role="listbox" aria-label="Path suggestions" class="absolute top-full right-0 left-0 z-10 mt-1 flex flex-col rounded-md border bg-popover p-1 shadow-overlay"></ul>`),ufe=O(`<div class="relative"><!> <!></div> <!>`,1),dfe=O(`<!> <button type="button"> </button>`,1),ffe=O(`<div class="group flex h-control cursor-text items-center gap-0.5 overflow-hidden rounded-md border border-input bg-input-background px-1"><nav aria-label="Folder path" class="flex min-w-0 flex-1 items-center gap-0.5 overflow-hidden"></nav> <button type="button" class="shrink-0 rounded-sm p-1 text-muted-foreground hover:bg-hover hover:text-foreground" aria-label="Edit path"><!></button></div>`),pfe=O(`<div class="relative min-w-0 flex-1"><!></div>`);function mfe(e,n){c(n,!0);let r=K(n,`editing`,15,!1),i=`folder-browser-path-completions`,a=Y(``),o=Y(void 0),s=Y(U([])),u=Y(-1),d=Y(null),f=Y(void 0),p,m=0,g,_=L(()=>n.browser.ctx),y=L(()=>t(_).platform===`darwin`?n.browser.locations?.locations.find(e=>e.kind===`root`)?.label??`Macintosh HD`:`/`),b=L(()=>n.browser.cwd===void 0?[]:C_(n.browser.cwd,t(_),t(y)));function S(){if(n.browser.cwd===void 0)return;let e=n.browser.cwd===``?``:y_(n.browser.cwd,t(_));B(a,e&&!e.endsWith(t(_).separator)?e+t(_).separator:e,!0),B(o,void 0),B(u,-1),p=void 0,r(!0)}function C(){r(!1),B(o,void 0),B(s,[],!0),clearTimeout(g)}W(()=>{if(!r())return;let e=t(d);e&&(e.focus(),e.select())}),W(()=>{t(b),t(f)&&(t(f).scrollLeft=t(f).scrollWidth)}),W(()=>{if(!r())return;let e=t(a);n.browser.showHidden,clearTimeout(g);let i=S_(e,t(_));if(!i){B(s,[],!0);return}let o=++m;return g=setTimeout(async()=>{try{if(p?.dir!==i.dir){let e=await Od(i.dir,!1);p={dir:i.dir,names:e.entries.map(e=>({name:e.name,path:e.path}))}}if(o!==m)return;let e=t(_).caseInsensitive||t(_).platform===`win32`?i.prefix.toLowerCase():i.prefix;B(s,p.names.filter(n=>(t(_).caseInsensitive||t(_).platform===`win32`?n.name.toLowerCase():n.name).startsWith(e)).slice(0,8).map(e=>e.path),!0),B(u,-1)}catch{o===m&&B(s,[],!0)}},120),()=>clearTimeout(g)});async function E(e){B(o,void 0);let t=await n.browser.goTyped(e);t?B(o,t,!0):C()}function O(e){B(a,e+t(_).separator),B(u,-1),t(d)?.focus()}function A(e){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),C();else if(e.key===`Enter`){e.preventDefault();let n=t(s)[t(u)];E(n??x_(t(a),t(_)))}else if(e.key===`ArrowDown`&&t(s).length)e.preventDefault(),B(u,(t(u)+1)%t(s).length);else if(e.key===`ArrowUp`&&t(s).length)e.preventDefault(),B(u,t(u)<=0?t(s).length-1:t(u)-1,!0);else if(e.key===`Tab`&&t(s).length&&!e.shiftKey){e.preventDefault();let n=t(s)[t(u)>=0?t(u):0];n&&O(n)}}function j(){S()}var M={beginEditing:j},N=pfe(),P=q(N),I=e=>{var n=ufe(),r=R(n),c=q(r);{let e=L(()=>t(s).length>0),n=L(()=>t(o)?!0:void 0);an(c,{ariaLabel:`Folder path`,class:`pr-7 font-mono`,role:`combobox`,get"aria-expanded"(){return t(e)},"aria-controls":i,get"aria-invalid"(){return t(n)},autocomplete:`off`,spellcheck:!1,onkeydown:A,onblur:C,get ref(){return t(d)},set ref(e){B(d,e,!0)},get value(){return t(a)},set value(e){B(a,e,!0)}})}var f=G(c,2);Kl(f,{class:`pointer-events-none absolute top-1/2 right-2 size-3 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),x(r);var p=G(r,2),m=e=>{var n=sfe(),r=z(n,!0);F(()=>w(r,t(o))),k(e,n)},g=e=>{var n=lfe();J(n,`id`,i),v(n,22,()=>t(s),e=>e,(e,n,r)=>{let i=L(()=>Wc({selected:t(r)===t(u)}));var a=cfe(),o=q(a),s=q(o);{let e=L(()=>t(i).icon({class:`size-3.5 shrink-0`}));Zu(s,{get class(){return t(e)},"aria-hidden":`true`})}var c=G(s,2),l=z(c,!0);x(o),x(a),F((e,n,i)=>{J(a,`aria-selected`,t(r)===t(u)),X(o,1,e),X(c,1,n),w(l,i)},[()=>T(t(i).base({class:`flex w-full items-center gap-2 px-2 py-1 text-left font-mono`})),()=>T(t(i).label({class:`truncate`})),()=>y_(n,t(_))]),h(`mousedown`,o,e=>e.preventDefault()),h(`click`,o,()=>void E(n)),k(e,a)}),x(n),k(e,n)};l(p,e=>{t(o)?e(m):t(s).length&&e(g,1)}),k(e,n)},ee=e=>{var r=ffe(),i=q(r);v(i,23,()=>t(b),(e,t)=>e.path+t,(e,r,i)=>{var a=dfe(),o=R(a),s=e=>{mn(e,{class:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`})};l(o,e=>{t(i)>0&&e(s)});var c=G(o,2),u=z(c,!0);F(e=>{X(c,1,e),J(c,`aria-current`,t(i)===t(b).length-1?`page`:void 0),w(u,t(r).label)},[()=>T(ft(`shrink-0 rounded-sm px-1 font-mono text-ui hover:bg-hover`,t(i)===t(b).length-1?`text-foreground`:`text-muted-foreground`))]),h(`click`,c,()=>void n.browser.go(t(r).path)),k(e,a)}),x(i),te(i,e=>B(f,e),()=>t(f));var a=G(i,2),o=q(a);Dn(o,{class:`size-3`,"aria-hidden":`true`}),x(a),x(r),h(`click`,r,e=>{e.target===e.currentTarget&&S()}),h(`click`,a,S),k(e,r)};return l(P,e=>{r()?e(I):e(ee,-1)}),x(N),k(e,N),D(M)}ue([`mousedown`,`click`]);var hfe=O(`<span class="block truncate font-mono text-foreground"> </span>`),gfe=O(`<div class="flex flex-col gap-0.5"><span class="px-2 pb-1 text-ui text-muted-foreground"> </span> <!></div>`),_fe=O(`<!> `,1),vfe=O(`<nav class="flex w-48 shrink-0 flex-col gap-3 overflow-y-auto border-r bg-panel p-2 max-sm:hidden" aria-label="Places"><!> <!> <!></nav> <nav class="flex shrink-0 gap-1 overflow-x-auto border-b px-3 py-2 sm:hidden" aria-label="Places"></nav>`,1);function yfe(e,n){c(n,!0);let r=(e,r=m,i=m,a)=>{let o=ve(()=>u(a?.(),!1));var s=f(),c=R(s),d=e=>{var a=gfe(),s=q(a),c=z(s,!0),l=G(s,2);v(l,17,i,e=>e.key,(e,r)=>{let i=e=>{var n=f(),i=R(n);H(i,()=>t(r).icon,(e,t)=>{t(e,{class:`size-4 shrink-0`,"aria-hidden":`true`})}),k(e,n)},a=e=>{var n=hfe(),i=z(n,!0);F(()=>w(i,t(r).label)),k(e,n)},s=L(()=>g(t(r).path));{let c=L(()=>t(o)?a:t(r).label),l=L(()=>t(r).path===``?void 0:t(r).path);Kc(e,{get label(){return t(c)},get icon(){return i},get selected(){return t(s)},get current(){return t(s)},get title(){return t(l)},class:`px-2`,onclick:()=>void n.browser.go(t(r).path)})}}),x(a),F(()=>w(c,r())),k(e,a)};l(c,e=>{i().length&&e(d)}),k(e,s)},i={home:Kw,desktop:Dt,documents:hd,downloads:df,projects:Zu},a={root:Tt,drive:Tt,volume:Tt,removable:Tt,network:Cie},o=L(()=>n.browser.ctx),s=L(()=>t(o).platform===`win32`),d=L(()=>(n.browser.locations?.places??[]).map(e=>({key:`place:${e.id}`,label:e.label,path:e.path,icon:i[e.id]}))),p=L(()=>[...t(s)?[{key:`this-pc`,label:`This PC`,path:``,icon:Dt}]:[],...(n.browser.locations?.locations??[]).map(e=>({key:`location:${e.path}`,label:e.label,path:e.path,icon:a[e.kind]}))]),h=L(()=>w_(n.projectDirectories,t(o)).map(e=>({key:`root:${e}`,label:y_(e,t(o)),path:e,icon:mf})));function g(e){return n.browser.cwd!==void 0&&Kr(e,t(o).caseInsensitive)===Kr(n.browser.cwd,t(o).caseInsensitive)&&(e!==``||n.browser.cwd===``)}var _=vfe(),y=R(_),b=q(y);r(b,()=>`Places`,()=>t(d));var S=G(b,2);r(S,()=>t(s)?`Drives`:`Locations`,()=>t(p)),r(G(S,2),()=>`Project roots`,()=>t(h),()=>!0),x(y);var C=G(y,2);v(C,21,()=>[...t(d),...t(p),...t(h)],e=>e.key,(e,r)=>{{let i=L(()=>g(t(r).path)?`outline`:`ghost`);Q(e,{get variant(){return t(i)},size:`sm`,class:`shrink-0`,onclick:()=>void n.browser.go(t(r).path),children:(e,n)=>{var i=_fe(),a=R(i);H(a,()=>t(r).icon,(e,t)=>{t(e,{"aria-hidden":`true`})});var o=G(a,1,!0);F(()=>w(o,t(r).label)),k(e,i)},$$slots:{default:!0}})}}),x(C),k(e,_),D()}var bfe=O(`<div data-folder-filter=""><!></div>`),xfe=O(`<div class="flex h-full min-h-0 flex-col" role="presentation"><div class="flex items-center gap-1 border-b px-3 pb-2"><div class="flex items-center gap-1 max-sm:hidden"><!> <!></div> <!> <!> <!> <!> <div class="max-sm:hidden"><!></div> <!></div> <div class="flex min-h-0 flex-1 max-sm:flex-col"><!> <div class="flex min-h-0 min-w-0 flex-1 flex-col"><!> <!></div></div></div>`);function Sfe(e,n){c(n,!0);let r=(e,t=m)=>{var n=bfe(),r=q(n);ks(r,{placeholder:`Filter`,ariaLabel:`Filter folders`,get value(){return i().filter},set value(e){i().filter=e}}),x(n),F(()=>X(n,1,T(t()))),k(e,n)},i=K(n,`browser`,7),a=Y(void 0),o=Y(!1),s=Y(void 0);function l(){(t(s)?.querySelector(`[role=listbox]`)??t(s))?.focus()}W(()=>{if(i().cwd===void 0||i().loading||!t(s))return;let e=setTimeout(()=>{l()},60);return()=>clearTimeout(e)});let u=!1;W(()=>{let e=t(o)||i().creating;u&&!e&&requestAnimationFrame(()=>{l()}),u=e});let d=L(()=>!i().atThisPC&&i().cwd!==void 0);function f(e){let t=i().entries;if(!t.length)return;let n=t.findIndex(e=>e.path===i().selectedPath),r=n<0?e===1?0:t.length-1:Math.min(t.length-1,Math.max(0,n+e));i().select(t[r]?.path)}function p(e){let r=e.target,o=!!r?.closest(`[data-folder-filter]`),s=r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement;if(s&&!o)return;let c=e.metaKey||e.ctrlKey;if(c&&e.key.toLowerCase()===`l`)e.preventDefault(),t(a)?.beginEditing();else if(e.altKey&&e.key.toLowerCase()===`d`)e.preventDefault(),t(a)?.beginEditing();else if(e.altKey&&e.key===`ArrowLeft`)e.preventDefault(),i().back();else if(e.altKey&&e.key===`ArrowRight`)e.preventDefault(),i().forward();else if((c||e.altKey)&&e.key===`ArrowUp`)e.preventDefault(),i().up();else switch(e.key){case`ArrowDown`:e.preventDefault(),f(1);break;case`ArrowUp`:e.preventDefault(),f(-1);break;case`ArrowRight`:!s&&i().selectedPath&&!i().creating&&(e.preventDefault(),i().go(i().selectedPath));break;case`ArrowLeft`:case`Backspace`:s||(e.preventDefault(),i().up());break;case`Enter`:if(r instanceof HTMLButtonElement)return;e.preventDefault(),o&&!i().selectedPath&&i().entries[0]?i().select(i().entries[0].path):n.onOpen()}}var g=xfe(),_=q(g),v=q(_),y=q(v);{let e=L(()=>!i().history.length);Mn(y,{get icon(){return Ol},label:`Back`,get disabled(){return t(e)},onclick:()=>void i().back()})}var b=G(y,2);{let e=L(()=>!i().future.length);Mn(b,{get icon(){return bf},label:`Forward`,get disabled(){return t(e)},onclick:()=>void i().forward()})}x(v);var S=G(v,2);{let e=L(()=>i().parent===void 0);Mn(S,{get icon(){return Zs},label:`Parent folder`,get disabled(){return t(e)},onclick:()=>void i().up()})}var C=G(S,2);te(mfe(C,{get browser(){return i()},get editing(){return t(o)},set editing(e){B(o,e,!0)}}),e=>B(a,e,!0),()=>t(a));var w=G(C,2);r(w,()=>`w-40 shrink-0 max-sm:hidden`);var E=G(w,2);{let e=L(()=>i().showHidden?ww:cf),n=L(()=>i().showHidden?`Hide hidden folders`:`Show hidden folders`);Mn(E,{get icon(){return t(e)},get label(){return t(n)},onclick:()=>void i().setShowHidden(!i().showHidden)})}var O=G(E,2),A=q(O);Mn(A,{get icon(){return cr},label:`Refresh`,get busy(){return i().loading},onclick:()=>void i().refresh()}),x(O);var j=G(O,2);{let e=L(()=>!t(d));Mn(j,{get icon(){return ec},label:`New folder`,get disabled(){return t(e)},onclick:()=>i().startCreate()})}x(_);var M=G(_,2),N=q(M);yfe(N,{get browser(){return i()},get projectDirectories(){return n.projectDirectories}});var P=G(N,2),I=q(P);r(I,()=>`px-3 pt-2 sm:hidden`),ofe(G(I,2),{get browser(){return i()},get projectIdForPath(){return n.projectIdForPath},get el(){return t(s)},set el(e){B(s,e,!0)}}),x(P),x(M),x(g),h(`keydown`,g,p),k(e,g),D()}ue([`keydown`]);function Cfe(e,n){c(n,!0);let r=e=>{{let n=L(()=>t(f)?y_(t(f),o.ctx):void 0),r=L(()=>!!t(p)),i=L(()=>o.loading||!!o.error);Kde(e,{get path(){return t(f)},get displayPath(){return t(n)},get signals(){return o.targetSignals},get known(){return t(r)},get busy(){return t(i)},onCancel:()=>h(!1),onOpen:()=>void g()})}},i=K(n,`open`,15,!1),a=K(n,`projects`,19,()=>[]),o=new Vde,s=!1,l=L(()=>o.ctx.caseInsensitive),u=L(()=>new Map(a().map(e=>[Kr(e.directory,t(l)),e.id]))),d=L(()=>a().map(e=>e.directory)),f=L(()=>o.target),p=L(()=>t(f)?t(u).get(Kr(t(f),t(l))):void 0);function m(e){return t(u).get(Kr(e,t(l)))}function h(e){i(e),e||n.onClose?.()}async function g(){t(f)&&(t(p)?await n.onSelectProject?.(t(p)):await n.onOpenDirectory?.(t(f)),h(!1))}W(()=>{i()&&!s&&o.open(n.initialPath),s=i()});{let a=L(()=>n.hostLabel?`Folders on ${n.hostLabel}`:`Choose a folder to open as a project`);ln(e,{flush:!0,title:`Open project`,get description(){return t(a)},class:`project-picker-dialog`,get footer(){return r},onOpenChange:h,get open(){return i()},set open(e){i(e)},children:(e,n)=>{Sfe(e,{get browser(){return o},get projectDirectories(){return t(d)},projectIdForPath:m,onOpen:()=>void g()})},$$slots:{default:!0}})}D()}function wfe(e,n){c(n,!0);let r=L(()=>Xr.projects),i=new Set([`localhost`,`127.0.0.1`,`[::1]`,`::1`]),a=Y(void 0);W(()=>{if(!Ds.projectPickerOpen)return;let e=!0,t=typeof location>`u`?void 0:i.has(location.hostname)?`this computer`:location.hostname;if(!yee())B(a,t,!0);else return pi().then(t=>{e&&B(a,t?`this computer`:void 0,!0)}),()=>{e=!1}}),Cfe(e,{get projects(){return t(r)},get initialPath(){return Ds.projectPickerPath},get hostLabel(){return t(a)},onSelectProject:e=>void jd(e),onOpenDirectory:e=>void Ad(e),get open(){return Ds.projectPickerOpen},set open(e){Ds.projectPickerOpen=e}}),D()}var Tfe=O(`<span> </span>`),Efe=O(`<span class="inline-flex items-center gap-1.5"><!> <!></span>`),Dfe=O(`<!> <!> <!> <!>`,1),Ofe=O(`<!> <!>`,1);function kfe(e,n){c(n,!0);let r=K(n,`connection`,3,`connecting`),i=K(n,`live`,3,!1),a=K(n,`side`,3,`top`),o=K(n,`compact`,3,!1),s=K(n,`open`,15,!1),u=L(()=>i()?`success`:r()===`error`?`destructive`:r()===`closed`?`warning`:`info`),d=L(()=>i()?`Connected`:r()),f=L(()=>n.status?.version?ld(n.status.version,n.latestRelease?.version):!1),p=L(()=>n.status?.version?t(f)&&n.latestRelease?`${fd(n.status.version)} · ${fd(n.latestRelease.version)} available`:fd(n.status.version):void 0),m=L(()=>{if(!n.status?.startedAt)return null;let e=new Date(n.status.startedAt).getTime();return Number.isNaN(e)?null:uk((Date.now()-e)/6e4)});dc(e,{size:`sm`,get triggerClass(){return Zb},ariaLabel:`Open daemon status`,get side(){return a()},align:`end`,get open(){return s()},set open(e){s(e)},trigger:e=>{var n=Efe(),r=q(n);Bn(r,{get tone(){return t(u)},get pulse(){return i()}});var a=G(r,2),s=e=>{var n=Tfe(),r=z(n,!0);F(()=>w(r,t(d))),k(e,n)};l(a,e=>{o()||e(s)}),x(n),F(()=>J(n,`title`,`Nerve daemon · ${t(d)}`)),k(e,n)},children:(e,r)=>{var i=Ofe(),a=R(i);fc(a,{title:`Nerve daemon`});var o=G(a,2);vc(o,{children:(e,r)=>{mc(e,{children:(e,r)=>{var i=Dfe(),a=R(i);{let e=L(()=>t(f)?`text-warning`:void 0);cc(a,{label:`Version`,get value(){return t(p)},get valueClass(){return t(e)}})}var o=G(a,2);{let e=L(()=>t(m)??void 0);cc(o,{label:`Uptime`,get value(){return t(e)}})}var s=G(o,2);{let e=L(()=>n.status==null?void 0:n.status.storage.indexHealthy?`Healthy`:`Rebuilding`),r=L(()=>n.status?.storage.indexHealthy?`text-success`:`text-warning`);cc(s,{label:`Index`,get value(){return t(e)},get valueClass(){return t(r)}})}var c=G(s,2);{let e=L(()=>n.status?.storage.home),r=L(()=>n.status?.storage.home);cc(c,{label:`Data dir`,get value(){return t(e)},valueClass:`font-mono`,get title(){return t(r)}})}k(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}}),k(e,i)},$$slots:{trigger:!0,default:!0}}),D()}var Afe=O(`<span class="inline-flex items-center gap-1.5 tabular-nums"><!> <span> </span></span>`),jfe=O(`<div class="flex items-center justify-between gap-2 px-1.5"><div class="flex items-center gap-1" aria-label="Zoom controls"><!> <!> <!></div> <span class="text-muted-foreground"> </span></div> <!>`,1),Mfe=O(`<!> <!>`,1);function Nfe(e,n){c(n,!0);let r=K(n,`zoomLevel`,3,0),i=K(n,`dockToggles`,19,()=>[]),a=K(n,`open`,15,!1),o={left:Qa,right:no,bottom:oo},s={left:`view.toggleLeftDock`,right:`view.toggleRightDock`,bottom:`view.toggleBottomDock`};function u(e){let t=yr(s[e]);return t?mr(t.defaultBinding):void 0}let d=L(()=>We(r())),p=L(()=>Ge(t(d))),m=L(()=>t(d)>0?`+${t(d)}`:String(t(d)));function h(e){n.onZoomLevelChange?.(We(e))}function _(e){h(t(d)+e)}dc(e,{size:`sm`,get triggerClass(){return Zb},ariaLabel:`Open layout controls`,side:`top`,align:`end`,get open(){return a()},set open(e){a(e)},trigger:e=>{var n=Afe(),r=q(n);el(r,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,2),a=z(i);x(n),F(()=>{J(n,`title`,`Layout · Zoom ${t(p)}%`),w(a,`${t(p)??``}%`)}),k(e,n)},children:(e,n)=>{var r=Mfe(),a=R(r);{let e=L(()=>`Zoom ${t(p)}%`);fc(a,{title:`Layout`,get meta(){return t(e)}})}var s=G(a,2);vc(s,{children:(e,n)=>{var r=jfe(),a=R(r),s=q(a),c=q(s);{let e=L(()=>t(d)<=-8);Q(c,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Zoom out`,title:`Zoom out`,get disabled(){return t(e)},onclick:()=>_(-1),children:(e,t)=>{pf(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}var p=G(c,2);{let e=L(()=>t(d)===0);Q(p,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Reset zoom`,title:`Reset zoom`,get disabled(){return t(e)},onclick:()=>h(0),children:(e,t)=>{zn(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}var b=G(p,2);{let e=L(()=>t(d)>=8);Q(b,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Zoom in`,title:`Zoom in`,get disabled(){return t(e)},onclick:()=>_(1),children:(e,t)=>{ff(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}x(s);var S=G(s,2),C=z(S);x(a);var T=G(a,2);lc(T,{label:`Panels`,separated:!0,children:(e,n)=>{var r=f(),a=R(r);v(a,17,i,e=>e.dock,(e,n)=>{let r=L(()=>o[t(n).dock]),i=L(()=>u(t(n).dock));Kc(e,{get label(){return eo[t(n).dock]},get selected(){return t(n).open},get onclick(){return t(n).onToggle},icon:e=>{var n=f(),i=R(n);H(i,()=>t(r),(e,t)=>{t(e,{class:`size-4 flex-none text-muted-foreground`,"aria-hidden":`true`})}),k(e,n)},trailing:e=>{var n=f(),r=R(n),a=e=>{Ju(e,{class:`flex-none`,children:(e,n)=>{y();var r=g();F(()=>w(r,t(i))),k(e,r)},$$slots:{default:!0}})};l(r,e=>{t(i)&&e(a)}),k(e,n)},$$slots:{icon:!0,trailing:!0}})}),k(e,r)},$$slots:{default:!0}}),F(()=>w(C,`Zoom level ${t(m)??``}`)),k(e,r)},$$slots:{default:!0}}),k(e,r)},$$slots:{trigger:!0,default:!0}}),D()}var N7=O(`<span class="inline-flex shrink-0 items-center gap-0.5"><!> </span>`),Pfe=O(`<span aria-label="Uncommitted changes">•</span>`),Ffe=O(`<span><!> <span class="min-w-0 truncate"> </span> <!> <!> <!></span>`),Ife=O(`<span><!> <span> </span></span>`),Lfe=O(`<!> <span> </span>`,1),Rfe=O(`<span><span class="truncate"> </span></span> <!> <!> <!>`,1),zfe=O(`<span class="inline-flex items-center gap-0.5" data-tour-id="status-controls"><!> <!> <!> <!></span>`);function Bfe(e,n){c(n,!0);let r=K(n,`connection`,3,`connecting`),i=K(n,`live`,3,!1),a=K(n,`pendingApprovals`,3,0),o=K(n,`launches`,19,()=>[]),s=K(n,`subscriptionUsages`,19,()=>[]),u=K(n,`zoomLevel`,3,0),d=K(n,`dockToggles`,19,()=>[]),f=K(n,`phone`,3,!1),p=L(()=>o().filter(e=>[`starting`,`running`,`ready`,`stopping`].includes(e.status)).length),m=L(()=>n.activeProject?Or(n.activeProject.dir,n.homeDir):`No project`),h=L(()=>f()?n.activeProject?.name??`No project`:t(m));function g(e){return`${e} ${e===1?`change`:`changes`}`}function _(e){let t=[e.detached?`Detached HEAD`:`Branch: ${e.branch}`];return e.repoCount>1&&t.unshift(`Repo: ${e.relativePath===`.`?e.repoName:e.relativePath}`),e.changeCount>0&&t.push(g(e.changeCount)),(e.ahead??0)>0&&t.push(`${e.ahead} ahead`),(e.behind??0)>0&&t.push(`${e.behind} behind`),!e.hasUpstream&&!e.detached&&t.push(`No upstream`),t.join(` • `)}so(e,{get toggles(){return d()},left:e=>{var r=Rfe(),i=R(r),o=q(i),s=z(o,!0);x(i);var c=G(i,2),u=e=>{var t=Ffe(),r=q(t);nc(r,{class:`shrink-0`,size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,2),a=z(i,!0),o=G(i,2),s=e=>{var t=N7(),r=q(t);xre(r,{size:11,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,1,!0);x(t),F(e=>{J(t,`aria-label`,e),w(i,n.gitStatus.changeCount)},[()=>g(n.gitStatus.changeCount)]),k(e,t)},c=e=>{var t=Pfe();k(e,t)};l(o,e=>{n.gitStatus.changeCount>0?e(s):n.gitStatus.dirty&&e(c,1)});var u=G(o,2),d=e=>{var t=N7(),r=q(t);Zs(r,{size:11,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,1,!0);x(t),F(()=>{J(t,`aria-label`,`${n.gitStatus.ahead} ahead`),w(i,n.gitStatus.ahead)}),k(e,t)};l(u,e=>{(n.gitStatus.ahead??0)>0&&e(d)});var f=G(u,2),p=e=>{var t=N7(),r=q(t);Ys(r,{size:11,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,1,!0);x(t),F(()=>{J(t,`aria-label`,`${n.gitStatus.behind} behind`),w(i,n.gitStatus.behind)}),k(e,t)};l(f,e=>{(n.gitStatus.behind??0)>0&&e(p)}),x(t),F((e,r)=>{X(t,1,e),J(t,`title`,r),w(a,n.gitStatus.branch)},[()=>T(ft(Xb,`min-w-0 shrink gap-2`)),()=>_(n.gitStatus)]),k(e,t)};l(c,e=>{!f()&&n.gitStatus&&e(u)});var d=G(c,2),m=e=>{var n=Ife(),r=q(n);qc(r,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,2),a=z(i,!0);x(n),F(()=>{X(n,1,T(Xb)),J(n,`title`,`${t(p)} running ${t(p)===1?`launch`:`launches`}`),w(a,t(p))}),k(e,n)};l(d,e=>{t(p)>0&&e(m)});var v=G(d,2),y=e=>{{let r=L(()=>ft(Zb,`text-warning hover:text-warning focus-visible:text-warning`)),i=L(()=>`Open ${a()===1?`pending approval`:`pending approvals`}`),o=L(()=>`${a()} ${a()===1?`pending approval`:`pending approvals`} · Open conversation`);Q(e,{variant:`ghost`,size:`sm`,get class(){return t(r)},get ariaLabel(){return t(i)},get title(){return t(o)},onclick:()=>n.onOpenPendingApproval?.(),children:(e,t)=>{var n=Lfe(),r=R(n);bn(r,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=G(r,2),o=z(i,!0);F(()=>w(o,a())),k(e,n)},$$slots:{default:!0}})}};l(v,e=>{a()>0&&e(y)}),F(e=>{X(i,1,e),J(i,`title`,n.activeProject?.dir),w(s,t(h))},[()=>T(ft(Xb,`min-w-0 shrink`))]),k(e,r)},right:e=>{var t=zfe(),a=q(t),o=e=>{r7(e,{get operation(){return n.maintenanceOperation},onCancel:()=>n.onCancelMaintenance?.()})};l(a,e=>{n.maintenanceOperation&&e(o)});var c=G(a,2);Zle(c,{get usages(){return s()},get compact(){return f()}});var p=G(c,2),m=e=>{Nfe(e,{get zoomLevel(){return u()},get dockToggles(){return d()},get onZoomLevelChange(){return n.onZoomLevelChange}})};l(p,e=>{f()||e(m)}),kfe(G(p,2),{get connection(){return r()},get live(){return i()},get status(){return n.status},get latestRelease(){return n.latestRelease},side:`top`,get compact(){return f()}}),x(t),k(e,t)},$$slots:{left:!0,right:!0}}),D()}function Vfe(e,n){c(n,!0);let r=L(()=>jr(Xr.activeProject?[Xr.activeProject]:[])[0]),i=new $O;W(()=>i.observe());let a=L(()=>i.connected?`connected`:Xr.connection===`connected`?`reconnecting`:Xr.connection),o=L(()=>i.connected),s=L(()=>t(r)?Xr.conversations.filter(e=>e.projectId===t(r).id&&e.status===`waiting`):[]),l=L(()=>t(s).length),u=L(()=>t(s)[0]?.id),d=L(()=>kf.scopedLaunches),f=L(()=>QS.gitStatus),p=L(()=>ik.subscriptionUsages),m=L(()=>Xr.status),h=L(()=>Sf.settingsDraft),g=L(()=>yf.active?yf.operation:null),_=L(()=>t(h)?.ui.zoomLevel??Ze.level),v=L(()=>$d.isCompact),y=L(()=>$d.isPhone);function b(){let e=t(u);e&&Rd(e)}let x=L(()=>to.filter(e=>e!==`bottom`||pte(e)).map(e=>({dock:e,label:eo[e].toLowerCase(),open:t(v)?e===`left`?Wd.primary:Wd.secondary:Kd(e),onToggle:()=>Hd(e,t(v))})));{let n=L(()=>t(m)?.storage.userHome);Bfe(e,{get activeProject(){return t(r)},get connection(){return t(a)},get live(){return t(o)},get pendingApprovals(){return t(l)},onOpenPendingApproval:b,get launches(){return t(d)},get gitStatus(){return t(f)},get subscriptionUsages(){return t(p)},get status(){return t(m)},get latestRelease(){return pd.latest},get maintenanceOperation(){return t(g)},get homeDir(){return t(n)},get zoomLevel(){return t(_)},get dockToggles(){return t(x)},get phone(){return t(y)},get onZoomLevelChange(){return Rt},onCancelMaintenance:()=>void yf.cancel()})}D()}var Hfe=O(`<span class="size-1.5 flex-none rounded-full bg-info" role="img" aria-label="Unread"></span>`),Ufe=O(`<span> </span>`),Wfe=O(`<span class="-my-1 grid flex-none grid-flow-col items-center justify-items-end gap-1"><!> <!></span>`),Gfe=O(`<p class="line-clamp-2 text-ui break-words text-muted-foreground"> </p>`),Kfe=O(`<p> </p>`),qfe=O(`<!> `,1),Jfe=O(`<div class="-ml-1.5 flex flex-wrap items-center"><!> <!></div>`),Yfe=O(`<div><span><!></span> <div class="grid min-w-0 grid-cols-1 gap-0.5"><div class="flex min-h-5 items-center gap-2"><p> </p> <!> <!></div> <!> <!> <!> <!> <!></div></div>`);function P7(e,r){c(r,!0);let i=K(r,`unread`,3,!1),a=K(r,`actions`,19,()=>[]),o=K(r,`expanded`,15,!1),s=K(r,`interactive`,3,!1),u={attention:Ow,failed:Qs,warning:bn,succeeded:Wn,cancelled:Ew,info:Un},d={attention:`text-warning`,failed:`text-destructive`,warning:`text-warning`,running:`text-muted-foreground`,succeeded:`text-success`,cancelled:`text-muted-foreground`,info:`text-info`},p=L(()=>r.tone===`running`?void 0:u[r.tone]);var m=Yfe(),h=q(m),_=q(h),b=e=>{var n=f(),r=R(n);H(r,()=>t(p),(e,t)=>{t(e,{class:`size-4`,"aria-hidden":`true`})}),k(e,n)},S=e=>{dn(e,{class:`size-4`})};l(_,e=>{t(p)?e(b):e(S,-1)}),x(h);var C=G(h,2),E=q(C),O=q(E),A=z(O,!0),j=G(O,2),M=e=>{var t=Hfe();k(e,t)};l(j,e=>{i()&&e(M)});var N=G(j,2),P=e=>{var n=Wfe(),i=q(n),a=e=>{var t=Ufe(),n=z(t,!0);F(()=>{X(t,1,T([`col-start-1 row-start-1 text-caption tabular-nums text-muted-foreground`,r.onDismiss&&`pointer-fine:group-hover/entry:invisible pointer-fine:group-focus-within/entry:invisible`])),w(n,r.time)}),k(e,t)};l(i,e=>{r.time&&e(a)});var o=G(i,2),s=e=>{{let n=L(()=>`Dismiss ${r.title}`);Q(e,{variant:`ghost`,size:`icon-sm`,class:`row-start-1 text-muted-foreground pointer-coarse:col-start-2 pointer-fine:col-start-1 pointer-fine:opacity-0 pointer-fine:group-hover/entry:opacity-100 pointer-fine:group-focus-within/entry:opacity-100`,get ariaLabel(){return t(n)},title:`Dismiss`,get onclick(){return r.onDismiss},children:(e,t)=>{ye(e,{"aria-hidden":`true`})},$$slots:{default:!0}})}};l(o,e=>{r.onDismiss&&e(s)}),x(n),k(e,n)};l(N,e=>{(r.time||r.onDismiss)&&e(P)}),x(E);var I=G(E,2),ee=e=>{var t=Gfe(),n=z(t,!0);F(()=>{J(t,`title`,r.context),w(n,r.context)}),k(e,t)};l(I,e=>{r.context&&e(ee)});var te=G(I,2),ne=e=>{var t=Kfe(),n=z(t,!0);F(()=>{X(t,1,`line-clamp-2 text-ui break-words ${r.tone===`failed`?`text-destructive`:`text-muted-foreground`}`),J(t,`title`,r.detail),w(n,r.detail)}),k(e,t)};l(te,e=>{r.detail&&e(ne)});var re=G(te,2),ie=e=>{md(e,{class:`mt-1`,get value(){return r.progress}})};l(re,e=>{r.progress!==void 0&&e(ie)});var B=G(re,2),ae=e=>{var n=Jfe(),i=q(n),s=e=>{Q(e,{variant:`ghost`,size:`sm`,class:`group/disc text-muted-foreground`,get"aria-expanded"(){return o()},onclick:()=>o(!o()),children:(e,t)=>{var n=qfe(),i=R(n);mn(i,{class:`transition-transform group-aria-expanded/disc:rotate-90`,"aria-hidden":`true`});var a=G(i);F(()=>w(a,`${o()?`Hide`:`Show`}
159
+ ${r.disclosure??``}`)),k(e,n)},$$slots:{default:!0}})};l(i,e=>{r.disclosure&&e(s)});var c=G(i,2);v(c,17,a,e=>e.label,(e,n)=>{{let r=L(()=>t(n).destructive?`text-destructive`:`text-muted-foreground hover:text-foreground`);Q(e,{variant:`ghost`,size:`sm`,get class(){return t(r)},get disabled(){return t(n).disabled},get onclick(){return t(n).onSelect},children:(e,r)=>{y();var i=g();F(()=>w(i,t(n).label)),k(e,i)},$$slots:{default:!0}})}}),x(n),k(e,n)};l(B,e=>{(a().length||r.disclosure)&&e(ae)});var V=G(B,2),oe=e=>{var t=f(),i=R(t);n(i,()=>r.children),k(e,t)};l(V,e=>{r.children&&(!r.disclosure||o())&&e(oe)}),x(C),x(m),F(()=>{X(m,1,T([`group/entry grid grid-cols-[1rem_minmax(0,1fr)] items-start gap-x-2 rounded-md py-2 pl-1.5 pr-1 text-left`,s()&&`cursor-pointer hover:bg-hover`])),X(h,1,`mt-0.5 flex-none ${d[r.tone]??``}`),X(O,1,`min-w-0 flex-1 truncate text-ui ${r.tone===`cancelled`?`text-muted-foreground`:``}`),J(O,`title`,r.titleHint??r.title),w(A,r.title)}),k(e,m),D()}var F7=ia([`starting`,`upgrading`,`ready`,`failed`]),Xfe=ga({step:Hi(),label:Hi(),done:Ri().nonnegative().optional(),total:Ri().nonnegative().optional()}),Zfe=ga({kind:ia([`conversation`,`configuration`]),id:Hi(),title:Hi().optional(),reason:Hi()}),Qfe=ga({code:Hi(),message:Hi(),step:Hi().optional(),phase:Hi().optional(),reportPath:Hi().optional(),retryable:Ni(),discardable:Mi(Zfe).optional(),rollbackAvailable:Ni().optional()}),$fe=ga({state:F7,version:Hi(),startedAt:Hi(),message:Hi(),progress:Xfe.optional(),failure:Qfe.optional()});ga({discardIds:Mi(Hi().min(1)).min(1).optional()}).strict(),ga({status:Ai(`ok`),version:Hi(),lifecycle:F7}),ga({error:Ai(`starting`),lifecycle:$fe});var epe=Hi().regex(/^\d{4}-[a-z0-9-]+$/),tpe=ga({kind:ia([`conversation`,`configuration`]),id:Hi(),title:Hi().optional(),reason:Hi(),quarantinePath:Hi()}),npe=ga({reason:Hi(),count:Ri().int().nonnegative()}),rpe=ga({step:epe,description:Hi(),completedAt:Hi(),setAside:Mi(tpe),losses:Mi(npe)}),ipe=ga({reports:Mi(rpe)});async function ape(){let e=await it(`/api/storage/upgrade-reports`);return ipe.parse(e).reports}async function ope(e){await nt(`/api/storage/upgrade-reports/${Qe(e)}/dismiss`,{})}async function spe(e,t,n){await Promise.all(e.reports.map(async({step:r})=>{try{await t(r),e.reports=e.reports.filter(e=>e.step!==r)}catch(e){n(e)}}))}var I7=U({reports:[],loaded:!1});async function cpe(){if(!I7.loaded){I7.loaded=!0;try{I7.reports=await ape()}catch(e){gf(`warn`,`storage-upgrade`,`Upgrade report fetch failed`,{error:e})}}}async function L7(){await spe(I7,ope,e=>gf(`warn`,`storage-upgrade`,`Upgrade report dismiss failed`,{error:e}))}function lpe(){return I7.reports.length>0}var R7=U({open:!1});function z7(e,t,n){return`${e} ${e===1?t:n}`}function B7(e){return e.flatMap(e=>e.setAside)}function V7(e){let t=new Map;for(let n of e.flatMap(e=>e.losses))t.set(n.reason,(t.get(n.reason)??0)+n.count);return[...t].map(([e,t])=>({reason:e,count:t}))}function upe(e){let t=B7(e),n=t.filter(e=>e.kind===`conversation`).length,r=t.length-n,i=[];n>0&&i.push(z7(n,`conversation`,`conversations`)),r>0&&i.push(z7(r,`settings file`,`settings files`));let a=V7(e).reduce((e,t)=>e+t.count,0),o=`Upgrade complete: `;if(i.length===0)return a>0?`${o}${z7(a,`item`,`items`)} could not be fully upgraded.`:`${o}nothing needed attention.`;let s=n+r;return`${o}${i.join(` and `)} ${s===1?`was`:`were`} set aside because ${s===1?`it`:`they`} couldn't be upgraded.`}function dpe(e){let t=B7(e),n=t.filter(e=>e.kind===`conversation`).length,r=t.length-n,i=V7(e).reduce((e,t)=>e+t.count,0),a=[];return n>0&&a.push(z7(n,`conversation`,`conversations`)),r>0&&a.push(z7(r,`settings file`,`settings files`)),a.length>0?{title:`Upgrade finished with issues`,description:`${a.join(` and `)} couldn't be upgraded`}:i>0?{title:`Upgrade finished with issues`,description:`${z7(i,`item`,`items`)} not fully upgraded`}:{title:`Upgrade finished`,description:`Nothing needed attention`}}function fpe(e){let t=new Map;for(let n of B7(e)){let e=n.reason.replace(/(?<![\w])(?:[A-Za-z]:[\\/]|\/)[^\s:;,]+:?\s*/g,``).trim(),r=`${n.kind}\u0000${e}`,i=t.get(r)??{kind:n.kind,reason:e,count:0,paths:[]};i.count++,i.paths.length<3&&i.paths.push(n.quarantinePath),t.set(r,i)}return[...t.values()]}function ppe(e){return`${e.kind===`conversation`?z7(e.count,`conversation`,`conversations`):z7(e.count,`settings file`,`settings files`)} couldn't be read`}function mpe(e,t){if(!t)return e;let n=Ec(t),r=Ec(e),i=/^[A-Za-z]:\/|^\/\//.test(n),a=n.endsWith(`/`)?n:`${n}/`;return(i?r.toLowerCase():r).startsWith(i?a.toLowerCase():a)?e.trim().slice(a.length):e}function hpe(e,n){c(n,!0);let r=L(()=>I7.reports),i=L(()=>upe(t(r))),a=L(()=>dpe(t(r)));function o(){L7()}var s=f(),u=R(s),d=e=>{{let r=L(()=>t(a).title===`Upgrade finished`?`succeeded`:`warning`),s=L(()=>[{label:`Details`,onSelect:n.onDetails}]);P7(e,{get tone(){return t(r)},get title(){return t(a).title},get context(){return t(a).description},get titleHint(){return t(i)},get actions(){return t(s)},onDismiss:o})}};l(u,e=>{t(r).length>0&&e(d)}),k(e,s),D()}var H7=O(`<!> <!>`,1),gpe=O(`<p class="text-ui break-words text-muted-foreground"> </p>`),_pe=O(`<!>Show examples`,1),vpe=O(`<li class="truncate font-mono text-ui text-muted-foreground"> </li>`),ype=O(`<ul class="grid gap-0.5 border-l pl-2"></ul>`),bpe=O(`<li class="grid min-w-0 gap-0.5"><p class="text-ui"> </p> <!> <!></li>`),xpe=O(`<section class="grid gap-2" aria-label="Set aside"><h3 class="text-ui text-muted-foreground">Set aside</h3> <ul class="grid gap-3"></ul></section>`),Spe=O(`<li class="break-words"><span class="tabular-nums"> </span> </li>`),Cpe=O(`<section class="grid gap-2" aria-label="Adjusted during upgrade"><h3 class="text-ui text-muted-foreground">Adjusted during upgrade</h3> <ul class="grid gap-1 text-ui text-muted-foreground"></ul></section>`),wpe=O(`<div><!></div>`),Tpe=O(`<div class="grid gap-4 pr-3"><!> <!> <!></div>`),Epe=O(`<!> <!> <!>`,1);function Dpe(e,n){c(n,!0);let r=L(()=>I7.reports),i=L(()=>fpe(t(r))),a=L(()=>V7(t(r))),o=U({});async function s(){try{await ri(`${n.home}/quarantine`)}catch{ui.error(`Could not copy to clipboard`)}}function u(){R7.open=!1,L7()}var d=f(),p=R(d);H(p,()=>sf,(e,r)=>{r(e,{get open(){return R7.open},set open(e){R7.open=e},children:(e,r)=>{var c=f(),d=R(c);H(d,()=>of,(e,r)=>{r(e,{class:`grid-cols-[minmax(0,1fr)] sm:max-w-lg`,children:(e,r)=>{var c=Epe(),d=R(c);H(d,()=>nf,(e,n)=>{n(e,{children:(e,n)=>{var r=H7(),a=R(r);H(a,()=>af,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g(`Upgrade report`);k(e,n)},$$slots:{default:!0}})});var o=G(a,2);H(o,()=>rf,(e,n)=>{n(e,{children:(e,n)=>{y();var r=g();F(()=>w(r,`Nerve upgraded your data.${t(i).length?` Some items need your attention.`:``}`)),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})});var f=G(d,2);fn(f,{class:`max-h-[60vh] min-w-0`,children:(e,r)=>{var c=Tpe(),u=q(c),d=e=>{var r=xpe(),a=G(q(r),2);v(a,21,()=>t(i),e=>`${e.kind}:${e.reason}`,(e,r)=>{let i=L(()=>`${t(r).kind}:${t(r).reason}`);var a=bpe(),s=q(a),c=z(s,!0),u=G(s,2),d=e=>{var n=gpe(),i=z(n,!0);F(()=>w(i,t(r).reason)),k(e,n)};l(u,e=>{t(r).reason&&e(d)});var f=G(u,2);{let e=L(()=>o[t(i)]??!1);H(f,()=>yd,(a,s)=>{s(a,{get open(){return t(e)},onOpenChange:e=>o[t(i)]=e,children:(e,a)=>{var s=H7(),c=R(s);{let e=(e,t)=>{Q(e,P(()=>(t?.()).props,{variant:`ghost`,size:`sm`,class:`group/disc -ml-1.5 text-muted-foreground`,children:(e,t)=>{var n=_pe(),r=R(n);mn(r,{class:`transition-transform group-aria-expanded/disc:rotate-90`,"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}}))};H(c,()=>bd,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}var u=G(c,2),d=e=>{var i=ype();v(i,20,()=>t(r).paths,e=>e,(e,t)=>{var r=vpe(),i=z(r,!0);F(e=>{J(r,`title`,t),w(i,e)},[()=>mpe(t,n.home)]),k(e,r)}),x(i),k(e,i)};l(u,e=>{o[t(i)]&&e(d)}),k(e,s)},$$slots:{default:!0}})})}x(a),F(e=>w(c,e),[()=>ppe(t(r))]),k(e,a)}),x(a),x(r),k(e,r)};l(u,e=>{t(i).length&&e(d)});var f=G(u,2),p=e=>{var n=Cpe(),r=G(q(n),2);v(r,21,()=>t(a),e=>e.reason,(e,n)=>{var r=Spe(),i=q(r),a=z(i,!0),o=G(i);x(r),F(()=>{w(a,t(n).count),w(o,` · ${t(n).reason??``}`)}),k(e,r)}),x(r),x(n),k(e,n)};l(f,e=>{t(a).length&&e(p)});var m=G(f,2),h=e=>{var t=wpe(),n=q(t);Q(n,{variant:`ghost`,size:`sm`,class:`-ml-1.5 text-muted-foreground`,onclick:()=>void s(),children:(e,t)=>{y();var n=g(`Copy quarantine folder path`);k(e,n)},$$slots:{default:!0}}),x(t),k(e,t)};l(m,e=>{n.home&&t(i).length&&e(h)}),x(c),k(e,c)},$$slots:{default:!0}});var p=G(f,2);H(p,()=>tf,(e,t)=>{t(e,{children:(e,t)=>{var n=H7(),r=R(n);Q(r,{variant:`ghost`,onclick:()=>R7.open=!1,children:(e,t)=>{y();var n=g(`Close`);k(e,n)},$$slots:{default:!0}});var i=G(r,2);Q(i,{onclick:u,children:(e,t)=>{y();var n=g(`Dismiss notice`);k(e,n)},$$slots:{default:!0}}),k(e,n)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})}),k(e,c)},$$slots:{default:!0}})}),k(e,d),D()}var Ope=O(`<section class="grid gap-0" aria-label="Settings need attention" data-testid="settings-health-item"><!> <!></section>`);function kpe(e,n){c(n,!0);let r=K(n,`pending`,3,!1);var i=Ope(),a=q(i);v(a,17,()=>n.health.invalid,e=>e.id,(e,i)=>{{let a=L(()=>`${t(i).id}.json needs attention`),o=L(()=>t(i).id===`permissions`?`Tool execution is blocked until repaired`:`Using defaults until repaired`),s=L(()=>[{label:`Reload`,disabled:r(),onSelect:()=>n.onReload(t(i).id)},{label:`Reset to defaults`,disabled:r(),onSelect:()=>n.onReset(t(i).id)}]);P7(e,{tone:`failed`,get title(){return t(a)},get titleHint(){return t(i).path},get context(){return t(o)},get detail(){return t(i).reason},get actions(){return t(s)}})}});var o=G(a,2),s=e=>{{let i=L(()=>[{label:`Retry`,disabled:r(),onSelect:n.onRetry}]);P7(e,{tone:`warning`,title:`Couldn't check settings`,get detail(){return n.error},get actions(){return t(i)}})}};l(o,e=>{n.error&&e(s)}),x(i),k(e,i),D()}function U7(e){return e.classification===`incompatible`?`Written by a newer Nerve. Upgrade Nerve to use it; the file is left untouched.`:e.message}function Ape(e){let t=e.replaceAll(`\\`,`/`),n=t.lastIndexOf(`/.nerve/`);return n===-1?e:t.slice(n+1)}function W7(e,t,n){let r={disabled:t,onSelect:()=>n.onReload(e)};if(e.classification===`migrated`)return[{label:`Dismiss`,...r}];let i=[{label:e.classification===`legacy`?`Open folder`:`Open file`,onSelect:()=>n.onOpen(e)},{label:`Reload`,...r}],a=e.classification===`legacy`?`Remove old files`:e.classification===`corrupted`&&e.resetOffered?`Reset`:void 0;return a&&i.push({label:a,disabled:t,onSelect:()=>n.onReset(e)}),i}var jpe=O(`<section class="grid gap-0" aria-label="Project configuration" data-testid="project-configuration-health"><!> <!></section>`);function Mpe(e,n){c(n,!0);let r=K(n,`pending`,3,!1);function i(e){return e.classification===`legacy`?(e.files??[]).join(`
160
+ `):`${Ape(e.path)}\n${e.path}`}var a=jpe(),o=q(a);v(o,17,()=>n.issues,e=>`${e.projectId}:${e.type}`,(e,a)=>{{let o=L(()=>t(a).classification===`migrated`?`info`:t(a).classification===`corrupted`?`failed`:`warning`),s=L(()=>i(t(a))),c=L(()=>[n.projectName(t(a).projectId),t(a).classification===`migrated`?`Upgraded to the current format`:void 0].filter(Boolean).join(` · `)),l=L(()=>t(a).classification===`migrated`?void 0:U7(t(a))),u=L(()=>t(a).classification===`migrated`?[]:W7(t(a),r(),{onOpen:n.onOpen,onReload:n.onReload,onReset:n.onReset})),d=L(()=>t(a).classification===`migrated`&&!r()?()=>n.onReload(t(a)):void 0);P7(e,{get tone(){return t(o)},get title(){return t(a).label},get titleHint(){return t(s)},get context(){return t(c)},get detail(){return t(l)},get actions(){return t(u)},get onDismiss(){return t(d)}})}});var s=G(o,2),u=e=>{P7(e,{tone:`failed`,title:`Couldn't update project configuration`,get detail(){return n.error}})};l(s,e=>{n.error&&e(u)}),x(a),k(e,a),D()}var G7=O(`<!> <!>`,1),Npe=O(`<section class="grid gap-0" aria-label="Configuration needs attention" data-testid="configuration-attention"><!> <!></section>`);function Ppe(e,n){c(n,!0);let r=L(()=>[{id:`review`,label:`Waiting for your review`,tone:`attention`,rows:n.rows.filter(e=>e.group===`review`)},{id:`broken`,label:`Not working`,tone:`failed`,rows:n.rows.filter(e=>e.group===`broken`)}]);var i=Npe(),a=q(i),o=e=>{{let r=L(()=>q6(n.review.count)),i=L(()=>[{label:`Show`,onSelect:n.review.onOpen}]);P7(e,{tone:`attention`,get title(){return t(r)},context:`Not used until you trust them`,get actions(){return t(i)}})}};l(a,e=>{n.review?.count&&e(o)});var s=G(a,2);v(s,17,()=>t(r).filter(e=>e.rows.length&&!(n.review&&e.id===`review`)),e=>e.id,(e,n)=>{var r=G7(),i=R(r);Rn(i,{class:`px-3 pt-2`,get label(){return t(n).label},get count(){return t(n).rows.length}});var a=G(i,2);v(a,17,()=>t(n).rows,e=>e.key,(e,r)=>{P7(e,{get tone(){return t(n).tone},get title(){return t(r).title},get titleHint(){return t(r).titleHint},get context(){return t(r).context},get detail(){return t(r).detail},get actions(){return t(r).actions}})}),k(e,r)}),x(i),k(e,i),D()}function Fpe(e,t){return e.map(e=>{let{target:n,path:r,askAgent:i}=e,a=[];return e.group===`review`?n&&a.push({label:`Review`,onSelect:()=>t.onOpenTarget(n)}):(i&&t.projectId&&a.push({label:i===`upgrade`?`Ask the agent to upgrade`:`Ask the agent to fix`,onSelect:()=>t.onAskAgent(e)}),n?a.push({label:`Details`,onSelect:()=>t.onOpenTarget(n)}):r&&e.scope===`project`&&a.push({label:`Open file`,onSelect:()=>t.onOpenFile(r)})),{key:e.key,group:e.group,title:e.title,...r?{titleHint:r}:{},context:e.origin,detail:e.detail,actions:a}})}function K7(e){return e.kind===`attention`||e.needsAttention?0:e.kind===`running`?1:2}var q7=e=>e.status===`failed`||e.status===`interrupted`;function Ipe(e){let t=e?.split(/[\\/]/).filter(Boolean).pop();return t===`.`?void 0:t}function J7(e){let t=new Map;for(let n of e){let e=n.projectId||n.projectName,r=t.get(e);r||(r={key:e,projectName:n.projectName||n.projectId||`Unknown project`,entries:[]},t.set(e,r)),r.entries.push(n)}let n=e[0]?.error;return{sharedError:e.length>1&&e.every(e=>e.error===n)?n:void 0,groups:[...t.values()]}}function Lpe(e){let t=J7(e).groups.map(e=>e.projectName),n=t.slice(0,2).join(`, `);return t.length>2?`${n} +${t.length-2} more`:n}function Rpe(e){return e.status===`succeeded`?`done`:e.status===`queued`?`queued`:e.status===`running`?`running`:`failed`}function zpe(e,t,n){let r=_i(e),i=e.scope,a=i?.projectId&&i.projectId===n.activeProjectId?void 0:i?.projectName??i?.projectId,o=t.filter(e=>e.status===`succeeded`).length,s=e.unreadableConversations?.length?Lpe(e.unreadableConversations):[a,Ipe(i?.repositoryPath),r?e.phase??e.message:void 0,r&&t.length?`${o} of ${t.length}`:void 0].filter(Boolean).join(` · `),c=e.progress??(t.length?{completed:o,total:t.length}:void 0),l=r&&e.actions.cancel?{label:`Stop`,intent:`cancel`}:e.actions.retry?{label:`Retry`,intent:`retry`}:e.settingsPage?{label:`Open settings`,intent:`settings`}:void 0;return{id:e.id,unreadableConversations:e.unreadableConversations,settingsPage:e.settingsPage,needsAttention:!!e.unreadableConversations?.length||!!e.settingsPage,kind:r?`running`:q7(e)?`failed`:e.status===`cancelled`?`cancelled`:`succeeded`,title:e.title,context:s,detail:e.unreadableConversations?.length?J7(e.unreadableConversations).sharedError:q7(e)?e.error?.message??e.message:void 0,at:r?e.startedAt:e.finishedAt??e.updatedAt,progress:r?c:void 0,children:t.map(e=>({id:e.id,title:e.title,status:Rpe(e)})),action:l,unread:!r&&!n.readIds.has(e.id)}}function Bpe(e){let t=new Set(e.activities.map(e=>e.id)),n=new Map;for(let r of e.activities){if(!r.parentId||!t.has(r.parentId))continue;let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}let r=e.needsYou.map(t=>{let n=`${t.kind}:${t.id}`;return{id:n,kind:t.kind===`attention`?`attention`:t.kind===`failed`?`failed`:`succeeded`,title:t.title,context:[t.projectId===e.activeProjectId?void 0:t.projectName,t.conversationTitle].filter(Boolean).join(` · `),at:t.at,children:[],action:{label:`Open`,intent:`open`},unread:!e.readIds.has(n),conversationId:t.conversationId,needsAttention:t.kind!==`finished`}}),i=e.activities.filter(e=>!e.parentId).map(t=>zpe(t,n.get(t.id)??[],e));return[...r,...i].sort((e,t)=>K7(e)-K7(t)||Date.parse(t.at)-Date.parse(e.at))}function Vpe(e,t){let n=Math.max(0,Math.floor((t-Date.parse(e.at))/1e3));return e.kind===`running`?n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`:n<60?`now`:n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}d`}var Hpe=O(`<p class="truncate text-ui text-destructive"> </p>`),Upe=O(`<li class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"><p class="truncate text-ui"> </p> <!></div> <!></li>`),Wpe=O(`<section class="grid"><h3 class="flex items-center gap-1 py-0.5 text-ui text-muted-foreground"><span class="min-w-0 truncate"> </span> <span class="tabular-nums"> </span></h3> <ul class="grid"></ul></section>`),Gpe=O(`<div class="mt-1 grid gap-2 border-l pl-2"></div>`);function Kpe(e,n){c(n,!0);let r=L(()=>J7(n.entries));var i=Gpe();v(i,21,()=>t(r).groups,e=>e.key,(e,i)=>{var a=Wpe(),o=q(a),s=q(o),c=z(s,!0),u=G(s,2),d=z(u);x(o);var f=G(o,2);v(f,21,()=>t(i).entries,e=>e.id,(e,i)=>{var a=Upe(),o=q(a),s=q(o),c=z(s,!0),u=G(s,2),d=e=>{var n=Hpe(),r=z(n,!0);F(()=>{J(n,`title`,t(i).error),w(r,t(i).error)}),k(e,n)};l(u,e=>{t(r).sharedError||e(d)}),x(o);var f=G(o,2);{let e=L(()=>`Delete ${t(i).title||t(i).id}`);Q(f,{variant:`ghost`,size:`icon-sm`,class:`text-muted-foreground hover:text-destructive`,get ariaLabel(){return t(e)},onclick:()=>n.onDelete?.([t(i)]),children:(e,t)=>{kn(e,{"aria-hidden":`true`})},$$slots:{default:!0}})}x(a),F(()=>{J(s,`title`,t(i).title||t(i).id),w(c,t(i).title||t(i).id)}),k(e,a)}),x(f),x(a),F(()=>{J(a,`aria-label`,t(i).projectName),w(c,t(i).projectName),w(d,`· ${t(i).entries.length??``}`)}),k(e,a)}),x(i),k(e,i),D()}var qpe=O(`<div role="alert"><!></div>`),Y7=O(`<!> <!>`,1),Jpe=O(`<li class="flex items-center gap-1.5 text-ui"><!> <span class="min-w-0 flex-1 truncate"> </span> <span class="text-caption text-muted-foreground"> </span></li>`),Ype=O(`<ul class="mt-1 grid gap-0.5 border-l pl-2"></ul>`),Xpe=O(`<span aria-hidden="true"><span class="relative z-10 text-warning-foreground"> </span></span>`),Zpe=O(`<span aria-hidden="true"></span>`),Qpe=O(`<span class="absolute bottom-1 right-1 size-1.5 rounded-full bg-destructive-solid" aria-hidden="true"></span>`),$pe=O(`<!> <!> <!> <!>`,1);function eme(e,r){c(r,!0);let i=e=>{var i=f(),a=R(i),o=e=>{lc(e,{label:`System`,children:(e,t)=>{var i=Y7(),a=R(i),o=e=>{var t=qpe();P7(q(t),{tone:`failed`,title:`Notifications couldn't update`,get detail(){return r.error}}),x(t),k(e,t)};l(a,e=>{r.error&&e(o)});var s=G(a,2),c=e=>{var t=f(),i=R(t);n(i,()=>r.attention),k(e,t)};l(s,e=>{r.attention&&e(c)}),k(e,i)},$$slots:{default:!0}})};l(a,e=>{t(p)||e(o)}),k(e,i)},a=(e,n=m)=>{let i=L(()=>n().unreadableConversations??[]);var a=()=>h[n().id]??!1,o=e=>h[n().id]=e;{let s=L(()=>Vpe(n(),t(ee))),c=L(()=>!!n().conversationId),u=L(()=>n().progress?n().progress.total?Math.min(100,n().progress.completed/n().progress.total*100):0:void 0),d=L(()=>ne(n())),p=L(()=>K7(n())===2?()=>r.onDismiss?.(n().id):void 0),m=L(()=>t(i).length?`${t(i).length} conversation${t(i).length===1?``:`s`}`:n().children.length?`${n().children.length} step${n().children.length===1?``:`s`}`:void 0);P7(e,{get tone(){return n().kind},get title(){return n().title},get context(){return n().context},get detail(){return n().detail},get time(){return t(s)},get unread(){return n().unread},get interactive(){return t(c)},get progress(){return t(u)},get actions(){return t(d)},get onDismiss(){return t(p)},get disclosure(){return t(m)},get expanded(){return a()},set expanded(e){o(e)},children:(e,a)=>{var o=f(),s=R(o),c=e=>{Kpe(e,{get entries(){return t(i)},onDelete:e=>r.onDeleteConversations?.(e)})},u=e=>{var r=Ype();v(r,21,()=>n().children,e=>e.id,(e,n)=>{var r=Jpe(),i=q(r),a=e=>{Wn(e,{class:`size-3 text-success`,"aria-hidden":`true`})},o=e=>{dn(e,{class:`size-3`})},s=e=>{Qs(e,{class:`size-3 text-destructive`,"aria-hidden":`true`})},c=e=>{Aw(e,{class:`size-3 text-muted-foreground`,"aria-hidden":`true`})};l(i,e=>{t(n).status===`done`?e(a):t(n).status===`running`?e(o,1):t(n).status===`failed`?e(s,2):e(c,-1)});var u=G(i,2),d=z(u,!0),f=G(u,2),p=z(f,!0);x(r),F(()=>{w(d,t(n).title),w(p,re[t(n).status])}),k(e,r)}),x(r),k(e,r)};l(s,e=>{t(i).length?e(c):n().children.length&&e(u,1)}),k(e,o)},$$slots:{default:!0}})}},o=K(r,`items`,19,()=>[]),s=K(r,`unseenFailure`,3,!1),u=K(r,`muted`,3,!1),d=K(r,`open`,3,!1),p=Y(``),h=U({}),_=L(()=>o().map(e=>({...e,key:e.id,label:e.title,group:K7(e)===0?`Needs attention`:K7(e)===1?`Running`:`Finished`,keywords:[e.context,e.detail??``]}))),b=L(()=>o().filter(e=>e.kind===`attention`).length),S=L(()=>o().filter(e=>e.kind===`running`).length),C=L(()=>o().filter(e=>K7(e)===2).length),E=L(()=>_c(t(_),t(p)).flatMap(e=>e.items).filter(e=>e.unread).map(e=>e.id)),O=L(()=>o().some(e=>e.unreadableConversations?.length)),A=L(()=>`Notifications${t(b)?`, ${t(b)} need you`:t(S)?`, running`:``}${s()?`, unseen failure`:``}${u()?`, muted`:``}${r.attention?`, settings need attention`:t(O)?`, conversations need attention`:``}`),j=L(()=>t(b)||r.attention||t(O)?`${t(b)}:${!!r.attention}:${t(O)}`:``),M=Y(``);W(()=>{d()&&B(M,t(j),!0)});let N=L(()=>!u()&&t(j)!==``&&t(j)!==t(M)),I=uH(()=>d()?t(S)?1e3:3e4:void 0),ee=L(()=>I.now);W(()=>{if(!d()||!t(E).length)return;let e=t(E),n=setTimeout(()=>r.onViewed?.(e),2e3);return()=>clearTimeout(n)});function te(e){e.conversationId&&r.onOpenItem?.(e)}function ne(e){let t=[],n=e.unreadableConversations??[];if(n.length&&t.push({label:n.length===1?`Delete`:`Delete all`,destructive:!0,onSelect:()=>r.onDeleteConversations?.(n)}),e.action&&e.action.intent!==`open`){let n=e.action.intent;t.push({label:e.action.label,onSelect:()=>r.onAction?.(n,e)})}return t}let re={done:`Done`,running:`Running`,queued:`Queued`,failed:`Failed`};dc(e,{get open(){return d()},size:`lg`,height:`tall`,align:`end`,get ariaLabel(){return t(A)},triggerTitle:`Notifications`,onOpenChange:e=>{B(p,``),r.onOpenChange?.(e)},triggerChild:(e,n)=>{Q(e,P(()=>(n?.()).props,{variant:`ghost`,size:`icon`,class:`relative`,get ariaLabel(){return t(A)},children:(e,n)=>{var i=$pe(),a=R(i),o=e=>{Qne(e,{class:`size-4`,"aria-hidden":`true`})},c=e=>{dn(e,{class:`size-4`})},d=e=>{wd(e,{class:`size-4`,"aria-hidden":`true`})};l(a,e=>{u()?e(o):!t(b)&&t(S)?e(c,1):e(d,-1)});var f=G(a,2),p=e=>{var n=Xpe(),r=q(n),i=z(r,!0);x(n),F(()=>{X(n,1,T([`absolute -right-0.5 -top-0.5 min-w-4 rounded-full bg-warning px-1 text-center text-caption leading-4 text-warning`,t(N)&&`attention-ping`])),w(i,t(b))}),k(e,n)};l(f,e=>{t(b)&&e(p)});var m=G(f,2),h=e=>{var n=Zpe();F(()=>X(n,1,T([`absolute -right-0.5 -top-0.5 size-2 rounded-full bg-warning text-warning`,t(N)&&`attention-ping`]))),k(e,n)};l(m,e=>{(r.attention||t(O))&&!t(b)&&e(h)});var g=G(m,2),_=e=>{var t=Qpe();k(e,t)};l(g,e=>{s()&&e(_)}),k(e,i)},$$slots:{default:!0}}))},children:(e,n)=>{var s=Y7(),c=R(s);{let e=e=>{var n=Y7(),i=R(n);Q(i,{variant:`ghost`,size:`sm`,onclick:()=>r.onToggleMute?.(),children:(e,t)=>{y();var n=g();F(()=>w(n,u()?`Unmute`:`Mute 1 h`)),k(e,n)},$$slots:{default:!0}});var a=G(i,2);{let e=L(()=>!t(C));Q(a,{variant:`ghost`,size:`sm`,get disabled(){return t(e)},onclick:()=>r.onClearFinished?.(),children:(e,t)=>{y();var n=g(`Clear finished`);k(e,n)},$$slots:{default:!0}})}k(e,n)},n=L(()=>t(b)?`${t(b)} need you`:void 0);fc(c,{title:`Notifications`,get meta(){return t(n)},actions:e,$$slots:{actions:!0}})}var l=G(c,2);{let e=(e,t=m)=>{a(e,t)},n=L(()=>r.error||r.attention?i:void 0),s=L(()=>o().length?`No notifications match your search.`:`You're all caught up`);sc(l,{get items(){return t(_)},rowMode:`container`,placeholder:`Search notifications`,ariaLabel:`Notifications`,get leading(){return t(n)},onChoose:te,get empty(){return t(s)},get query(){return t(p)},set query(e){B(p,e,!0)},row:e,$$slots:{row:!0}})}k(e,s)},$$slots:{triggerChild:!0,default:!0}}),D()}var tme=O(`<!> <span class="text-warning"> </span>`,1),nme=O(`<!> <span class="text-info"> </span>`,1),rme=O(`<button type="button" class="flex h-control min-w-control cursor-pointer items-center justify-center gap-1 rounded-md px-1.5 text-ui font-medium whitespace-nowrap tabular-nums hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus" title="Waiting for you"><!></button>`),ime=O(`<span class="flex min-w-0 items-center gap-1 text-warning"><!> <span class="truncate"> </span></span>`),ame=O(`<span class="min-w-0 truncate text-muted-foreground">needs your review</span>`),ome=O(`<div class="flex h-control max-w-96 items-center gap-2 pr-0.5 pl-2"><button type="button"><!> <span class="max-w-40 shrink-0 truncate font-medium"> </span> <!></button> <!></div>`),sme=O(`<div class="flex h-control max-w-96 items-center gap-2 pr-0.5 pl-2"><button type="button"><!> <span class="max-w-48 shrink-0 truncate font-medium"> </span> <span class="min-w-0 truncate text-muted-foreground"> </span></button> <!></div>`),cme=O(`<span class="flex min-w-0 items-center gap-1 text-caption text-warning"><!> <span class="truncate"> </span></span>`),lme=O(`<div role="listitem"><button type="button"><span><!></span> <span class="grid min-w-0 flex-1"><span class="truncate text-ui text-foreground"> </span> <!> <span class="truncate text-caption text-muted-foreground"> </span></span> <!></button></div>`),ume=O(`<!> <div class="flex flex-col" role="list" aria-label="Needs your review"></div>`,1),dme=O(`<div role="listitem"><button type="button"><span><!></span> <span class="grid min-w-0 flex-1"><span class="truncate text-ui text-foreground"> </span> <span class="truncate text-caption text-muted-foreground"> </span></span> <!></button></div>`),fme=O(`<!> <div class="flex flex-col" role="list" aria-label="Conversations waiting"></div>`,1),pme=O(`<div class="flex w-96 flex-col"><div class="flex h-control items-center gap-2 pr-0.5 pl-3"><span class="min-w-0 flex-1 truncate text-ui font-medium">Waiting for you</span> <!></div> <div class="max-h-112 overflow-y-auto overscroll-contain border-t border-border-subtle p-0.5"><!> <!></div> <div class="flex items-center gap-1 border-t border-border-subtle px-1.5 py-1.5"><!> <span class="flex-1"></span> <!> <!></div></div>`),mme=O(`<div><!></div>`),hme=O(`<div class="relative h-control flex-none transition-[width] duration-(--motion-enter-duration) ease-(--motion-enter-easing) motion-reduce:transition-none" data-attention-island=""><div class="invisible absolute top-0 right-0 w-max" aria-hidden="true" inert=""><!></div> <div role="region" aria-label="Waiting for you"><div class="absolute top-0 right-0 w-max"><!></div></div></div>`);function gme(e,n){c(n,!0);let r=e=>{var r=rme(),i=q(r),a=e=>{var n=tme(),r=R(n);Dw(r,{class:`size-4 text-warning`,"aria-hidden":`true`});var i=G(r,2),a=z(i,!0);F(()=>w(a,t(u))),k(e,n)},o=e=>{var t=nme(),r=R(t);Xw(r,{class:`size-4 text-info`,"aria-hidden":`true`});var i=G(r,2),a=z(i,!0);F(()=>w(a,n.conversations.length)),k(e,t)};l(i,e=>{t(d)===`trust`?e(a):e(o,-1)}),x(r),F(()=>J(r,`aria-label`,`${t(te)}, show the list`)),h(`click`,r,function(...e){n.onExpand?.apply(this,e)}),k(e,r)},i=(e,t=m)=>{var r=ome(),i=q(r);X(i,1,T(ae));var a=q(i);H(a,()=>t().icon,(e,t)=>{t(e,{class:`size-4 shrink-0 text-warning`,"aria-hidden":`true`})});var o=G(a,2),s=z(o,!0),c=G(o,2),u=e=>{var n=ime(),r=q(n);bn(r,{class:`size-3 shrink-0`,"aria-hidden":`true`});var i=G(r,2),a=z(i,!0);x(n),F(()=>w(a,t().risk)),k(e,n)},d=e=>{var t=ame();k(e,t)};l(c,e=>{t().risk?e(u):e(d,-1)}),x(i);var f=G(i,2);Q(f,{size:`sm`,onclick:()=>n.onReview(t()),children:(e,t)=>{y();var n=g(`Review`);k(e,n)},$$slots:{default:!0}}),x(r),F(()=>{J(i,`aria-label`,`New: ${t().name}, ${t().kindLabel}. Show all waiting items`),w(s,t().name)}),h(`click`,i,function(...e){n.onExpand?.apply(this,e)}),k(e,r)},a=(e,t=m)=>{var r=sme(),i=q(r);X(i,1,T(ae));var a=q(i);H(a,()=>t().icon,(e,t)=>{t(e,{class:`size-4 shrink-0 text-info`,"aria-hidden":`true`})});var o=G(a,2),s=z(o,!0),c=G(o,2),l=z(c,!0);x(i);var u=G(i,2);Q(u,{size:`sm`,onclick:()=>n.onOpenConversation(t()),children:(e,t)=>{y();var n=g(`Open`);k(e,n)},$$slots:{default:!0}}),x(r),F(()=>{J(i,`aria-label`,`${t().title} ${t().waits}. Show all waiting items`),w(s,t().title),w(l,t().waits)}),h(`click`,i,function(...e){n.onExpand?.apply(this,e)}),k(e,r)},o=e=>{var r=pme(),i=q(r),a=G(q(i),2);Mn(a,{get icon(){return Tf},label:`Collapse`,get onclick(){return n.onCollapse}}),x(i);var o=G(i,2),s=q(o),c=e=>{var r=ume(),i=R(r);Rn(i,{label:`Needs your review`,get count(){return t(u)},get icon(){return Dw},class:`px-2 pt-1.5 pb-0.5 text-warning`});var a=G(i,2);v(a,21,()=>n.trust,e=>e.key,(e,r)=>{var i=lme(),a=q(i);X(a,1,T(ne));var o=q(a);X(o,1,T([ie,`text-foreground`]));var s=q(o);H(s,()=>t(r).icon,(e,t)=>{t(e,{class:`size-3.5`,"aria-hidden":`true`})}),x(o);var c=G(o,2),u=q(c),d=z(u,!0),f=G(u,2),p=e=>{var n=cme(),i=q(n);bn(i,{class:`size-3 flex-none`,"aria-hidden":`true`});var a=G(i,2),o=z(a,!0);x(n),F(()=>w(o,t(r).risk)),k(e,n)};l(f,e=>{t(r).risk&&e(p)});var m=G(f,2),g=z(m,!0);x(c);var _=G(c,2);mn(_,{class:`size-4 flex-none text-muted-foreground transition-transform group-hover/item:translate-x-0.5`,"aria-hidden":`true`}),x(a),x(i),F(e=>{J(a,`aria-label`,`Review ${t(r).name}`),w(d,t(r).name),w(g,e)},[()=>[t(r).kindLabel,t(r).scopeLabel,t(r).changed].filter(Boolean).join(` · `)]),h(`click`,a,()=>n.onReview(t(r))),S(1,i,()=>Tn),S(2,i,()=>xn),k(e,i)}),x(a),k(e,r)};l(s,e=>{t(u)&&e(c)});var d=G(s,2),f=e=>{var r=fme(),i=R(r);{let e=L(()=>[`px-2 pb-0.5`,t(u)?`pt-2.5`:`pt-1.5`].join(` `));Rn(i,{label:`Conversations waiting`,get count(){return n.conversations.length},get icon(){return Xw},get class(){return t(e)}})}var a=G(i,2);v(a,21,()=>n.conversations,e=>e.key,(e,r)=>{var i=dme(),a=q(i);X(a,1,T(ne));var o=q(a);X(o,1,T([ie,`text-info`]));var s=q(o);H(s,()=>t(r).icon,(e,t)=>{t(e,{class:`size-3.5`,"aria-hidden":`true`})}),x(o);var c=G(o,2),l=q(c),u=z(l,!0),d=G(l,2),f=z(d,!0);x(c);var p=G(c,2);mn(p,{class:`size-4 flex-none text-muted-foreground transition-transform group-hover/item:translate-x-0.5`,"aria-hidden":`true`}),x(a),x(i),F(e=>{J(a,`aria-label`,`Open ${t(r).title}`),w(u,t(r).title),w(f,e)},[()=>[t(r).project,t(r).waits,t(r).time].filter(Boolean).join(` · `)]),h(`click`,a,()=>n.onOpenConversation(t(r))),S(1,i,()=>Tn),S(2,i,()=>xn),k(e,i)}),x(a),k(e,r)};l(d,e=>{n.conversations.length&&e(f)}),x(o);var p=G(o,2),m=q(p);Q(m,{variant:`ghost`,size:`sm`,get onclick(){return n.onAllNotifications},children:(e,t)=>{y();var n=g(`All notifications`);k(e,n)},$$slots:{default:!0}});var _=G(m,4);Q(_,{variant:`ghost`,size:`sm`,get onclick(){return n.onLater},children:(e,t)=>{y();var n=g(`Later`);k(e,n)},$$slots:{default:!0}});var b=G(_,2),C=e=>{Q(e,{size:`sm`,get onclick(){return n.onReviewAll},children:(e,n)=>{y();var r=g();F(()=>w(r,`Review all (${t(u)??``})`)),k(e,r)},$$slots:{default:!0}})};l(b,e=>{t(u)&&e(C)}),x(p),x(r),k(e,r)},s=L(()=>n.phase===`arrival`&&n.arrival?`arrival`:n.phase===`expanded`?`expanded`:`compact`),u=L(()=>n.trust.length),d=L(()=>iae({trust:n.trust.length,conversations:n.conversations.length})),f=Y(0),p=Y(0),_=Y(0),b=Y(0),E=L(()=>t(s)===`expanded`?t(f):t(p)),O=L(()=>t(s)===`expanded`?0:(t(b)-t(_))/2);W(()=>()=>n.onHover?.(!1));function A(e,t=1){if(Tc.current)return 0;let n=getComputedStyle(e).getPropertyValue(`--motion-enter-duration`);return(parseFloat(n)||0)*t}function j(e){return gc(e,{duration:A(e,.8),delay:A(e,.35)})}function N(e){return e.composedPath().some(e=>e instanceof HTMLElement&&e.dataset.attentionIsland!==void 0)}function P(e){t(s)===`expanded`&&!N(e)&&n.onCollapse()}function ee(e){t(s)===`expanded`&&e.key===`Escape`&&n.onCollapse()}let te=L(()=>[t(u)?`${t(u)} to review`:``,n.conversations.length?`${n.conversations.length} ${n.conversations.length===1?`conversation`:`conversations`} waiting`:``].filter(Boolean).join(`, `)),ne=`group/item flex w-full cursor-pointer items-center gap-2.5 rounded-md px-2 py-1.5 text-left hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus`,ie=`flex size-7 flex-none items-center justify-center self-start rounded-md border bg-card`,ae=`flex min-w-0 cursor-pointer items-center gap-1.5 text-left text-ui whitespace-nowrap focus-visible:outline-2 focus-visible:outline-focus`;var V=hme();M(`pointerdown`,ce,P),M(`keydown`,ce,ee);let oe;var se=q(V);r(q(se)),x(se);var U=G(se,2);let le;var ue=q(U),K=q(ue);C(K,()=>`${t(s)}:${t(s)===`arrival`?n.arrival?.row.key:``}`,e=>{var c=mme(),u=q(c),d=e=>{i(e,()=>n.arrival.row)},f=e=>{a(e,()=>n.arrival.row)},p=e=>{o(e)},m=e=>{r(e)};l(u,e=>{t(s)===`arrival`&&n.arrival?.level===`trust`?e(d):t(s)===`arrival`&&n.arrival?.level===`conversation`?e(f,1):t(s)===`expanded`?e(p,2):e(m,-1)}),x(c),S(1,c,()=>j),k(e,c)}),x(ue),x(U),x(V),F(()=>{oe=I(V,``,oe,{width:`${t(E)}px`}),X(U,1,T([`absolute right-0 z-40 overflow-hidden outline -outline-offset-1 transition-[width,height,top,box-shadow,background-color,outline-color,border-radius] duration-(--motion-enter-duration) ease-(--motion-enter-easing) motion-reduce:transition-none`,t(s)===`compact`?`rounded-md bg-transparent outline-transparent`:t(s)===`arrival`?`rounded-md bg-popover text-popover-foreground shadow-overlay outline-border`:`rounded-xl bg-popover text-popover-foreground shadow-overlay outline-border`])),le=I(U,``,le,{width:`${t(p)}px`,height:`${t(_)}px`,top:`${t(O)}px`})}),re(se,`clientWidth`,e=>B(f,e)),M(`mouseenter`,U,()=>n.onHover?.(!0)),M(`mouseleave`,U,()=>n.onHover?.(!1)),re(ue,`clientWidth`,e=>B(p,e)),re(ue,`clientHeight`,e=>B(_,e)),re(V,`clientHeight`,e=>B(b,e)),k(e,V),D()}ue([`click`]);var _me=4e3,vme=36e5;function yme(e){return!e.focused||e.now-e.lastInputAt>=6e4?`away`:e.viewing?`watching`:`elsewhere`}function bme(e){if(e.kind===`finished`)return`completed`;if(e.kind!==`input`)return`failed`;switch(e.inputKind){case`user_input`:return`question`;case`plan_review`:return`planReview`;default:return`approval`}}function xme(e,t){return t||e===`watching`?{surface:`none`,sound:!1}:{surface:e===`away`?`system`:`toast`,sound:!0}}function Sme(e=_me){let t;return{tryAcquire(n){return t!==void 0&&n-t<e?!1:(t=n,!0)}}}var Cme=100,X7=()=>!1,Z7=Date.now(),Q7=!1,wme=Sme(),$7=[],e9,t9=U({until:void 0}),n9,r9={get muted(){return t9.until!==void 0},get until(){return t9.until},mute(e=vme){clearTimeout(n9),t9.until=Date.now()+e,n9=setTimeout(()=>r9.unmute(),e)},unmute(){clearTimeout(n9),t9.until=void 0}};function Tme(e){X7=e.isViewing;let t=i9();return()=>{X7=()=>!1,t()}}function i9(){if(Q7||typeof window>`u`)return()=>void 0;Q7=!0,Z7=Date.now();let e=()=>{Z7=Date.now()},t=[`keydown`,`pointerdown`,`pointermove`,`wheel`];for(let n of t)window.addEventListener(n,e,{capture:!0,passive:!0});return window.addEventListener(`focus`,e),()=>{for(let n of t)window.removeEventListener(n,e,!0);window.removeEventListener(`focus`,e),Q7=!1}}function a9(e){return yme({focused:typeof document<`u`&&document.visibilityState===`visible`&&document.hasFocus(),lastInputAt:Z7,now:Date.now(),viewing:X7(e)})}function Eme(){return a9(``)!==`away`}function o9(e,t={}){i9();let n=xme(t.test?`away`:a9(e.conversationId),r9.muted);if(n.sound&&Dme(e,t.test===!0),n.surface===`none`)return;let{title:r}=e,i=e.kind===`finished`?`success`:`error`;n.surface===`toast`?oi(r,{description:e.body,id:e.conversationId,kind:e.kind===`input`?`message`:i,action:{label:`Open`,onClick:e.open}}):_ee({title:r,body:e.body,urgency:e.kind===`finished`?`normal`:`attention`},{tag:e.conversationId,onOpen:e.open,kind:e.kind===`input`?`message`:i})}function Dme(e,t){t?s9(e):($7.push(e),e9??=setTimeout(Ome,Cme))}function Ome(){let e=t_($7);$7=[],e9=void 0,e&&wme.tryAcquire(Date.now())&&s9(e)}function s9(e){if(!ai.soundsEnabled)return;let t=ai.eventSounds[bme(e)];t!==`none`&&fee(t)}async function kme(){ai.permission==="default"&&await ci(),o9({kind:`finished`,conversationId:`nerve-test-notification`,title:`Test notification`,body:`Notifications are working.`,open:()=>void 0},{test:!0})}var Ame=O(`<!> Update`,1),jme=O(`<p class="px-1.5 text-warning"> </p> <!>`,1),Mme=O(`<!> <!> <!>`,1);function Nme(e,n){c(n,!0);let r=L(()=>fd(n.currentVersion)),i=L(()=>n.latestRelease?fd(n.latestRelease.version):void 0),a=L(()=>ld(n.currentVersion,n.latestRelease?.version)),o=L(()=>`Update available: ${t(i)??``}, running ${t(r)}`);var s=f(),u=R(s),d=e=>{dc(e,{get ariaLabel(){return t(o)},side:`bottom`,align:`end`,size:`md`,triggerChild:(e,n)=>{Q(e,P(()=>(n?.()).props,{variant:`ghost`,class:`text-warning hover:text-warning aria-expanded:text-warning`,get ariaLabel(){return t(o)},title:`Update available`,children:(e,t)=>{var n=Ame();cre(R(n),{class:`size-4`,"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}}))},children:(e,a)=>{var o=Mme(),s=R(o);{let e=L(()=>`${t(r)} · latest ${t(i)}`);fc(s,{title:`Nerve`,get meta(){return t(e)}})}var c=G(s,2);vc(c,{children:(e,r)=>{var a=jme(),o=R(a),s=z(o),c=G(o,2);lc(c,{label:`Run the latest release`,separated:!0,children:(e,t)=>{ud(e,{get version(){return n.latestRelease.version}})},$$slots:{default:!0}}),F(()=>w(s,`This version is out of date. Update to ${t(i)??``} to use the latest stable
161
+ release.`)),k(e,a)},$$slots:{default:!0}});var l=G(c,2);uc(l,{children:(e,t)=>{Q(e,{variant:`ghost`,size:`sm`,get href(){return n.latestRelease.releaseUrl},target:`_blank`,rel:`noreferrer`,children:(e,t)=>{y();var n=g(`Release notes`);k(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),k(e,o)},$$slots:{triggerChild:!0,default:!0}})};l(u,e=>{t(a)&&n.latestRelease&&t(i)&&e(d)}),k(e,s),D()}var Pme=A(`<path d="m22.5 57.8 35.3-35.3c1.4-1.4 3.6-1.4 5 0l.1.1c1.4 1.4 1.4 3.6 0 5L27.6 62.9c-1.4 1.4-3.6 1.4-5 0l-.1-.1c-1.3-1.4-1.3-3.6 0-5Z"></path><path d="m27.6 22.5 35.3 35.3c1.4 1.4 1.4 3.6 0 5l-.1.1c-1.4 1.4-3.6 1.4-5 0L22.5 27.6c-1.4-1.4-1.4-3.6 0-5l.1-.1c1.4-1.3 3.6-1.3 5 0Z"></path>`,1),Fme=A(`<path d="M17.8 39.1h49.9c1.9 0 3.5 1.6 3.5 3.5v.1c0 1.9-1.6 3.5-3.5 3.5H17.8c-1.9 0-3.5-1.6-3.5-3.5v-.1c0-1.9 1.5-3.5 3.5-3.5Z"></path>`),Ime=A(`<path d="M31.2 20.8h26.7c3.6 0 6.5 2.9 6.5 6.5V54Zm23.2 43.7H27.6c-3.6 0-6.5-2.9-6.5-6.5V31.2Z"></path>`),Lme=A(`<svg viewBox="0 0 85.4 85.4" aria-hidden="true" focusable="false"><circle cx="42.7" cy="42.7" r="42.7"></circle><circle cx="42.7" cy="42.7" r="39.1"></circle><g class="opacity-0 group-hover/window-controls:opacity-100 group-focus-within/window-controls:opacity-100"><!></g></svg>`);function c9(e,t){let n={close:{border:`#e24b41`,fill:`#ed6a5f`,symbol:`#460804`},minimize:{border:`#e1a73e`,fill:`#f6be50`,symbol:`#90591d`},maximize:{border:`#2dac2f`,fill:`#61c555`,symbol:`#2a6218`}};var r=Lme(),i=q(r),a=G(i),o=G(a),s=q(o),c=e=>{var t=Pme();y(),k(e,t)},u=e=>{var t=Fme();k(e,t)},d=e=>{var t=Ime();k(e,t)};l(s,e=>{t.kind===`close`?e(c):t.kind===`minimize`?e(u,1):e(d,-1)}),x(o),x(r),F(()=>{X(r,0,T(t.class)),J(i,`fill`,n[t.kind].border),J(a,`fill`,n[t.kind].fill),J(o,`fill`,n[t.kind].symbol)}),k(e,r)}var Rme=O(`<div class="group/window-controls mr-1.5 flex flex-none items-center gap-2 [-webkit-app-region:no-drag]" aria-label="Window controls"><button type="button" class="size-3.5 rounded-full p-0 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50"><!></button> <button type="button" class="size-3.5 rounded-full p-0 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50" aria-label="Minimize window" title="Minimize"><!></button> <button type="button" class="size-3.5 rounded-full p-0 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50"><!></button></div>`),l9=O(`<div class="flex flex-none items-center gap-0.5 [-webkit-app-region:no-drag]" aria-label="Window controls"><!> <!> <!></div>`),u9=O(`<span class="flex size-4.5 items-center justify-center rounded-full group-hover/linux-control:bg-foreground group-hover/linux-control:text-background group-focus-visible/linux-control:bg-foreground group-focus-visible/linux-control:text-background"><!></span>`),zme=O(`<span class="flex size-4.5 items-center justify-center rounded-full group-hover/linux-control:bg-destructive-subtle group-hover/linux-control:text-destructive group-focus-visible/linux-control:bg-destructive-subtle group-focus-visible/linux-control:text-destructive"><!></span>`);function d9(e,n){c(n,!0);let r=K(n,`maximized`,3,!1),i=K(n,`closeToTray`,3,!1),a=K(n,`quitting`,3,!1),o=L(()=>a()?`Closing Nerve`:i()?`Close window to tray`:`Close Nerve`),s=L(()=>a()?`Closing Nerve…`:i()?`Close to tray`:`Close Nerve`);var u=f(),d=R(u),p=e=>{var i=Rme(),c=q(i),u=q(c),d=e=>{dn(e,{class:`size-3.5`})},f=e=>{c9(e,{kind:`close`,class:`size-3.5`})};l(u,e=>{a()?e(d):e(f,-1)}),x(c);var p=G(c,2);c9(q(p),{kind:`minimize`,class:`size-3.5`}),x(p);var m=G(p,2);c9(q(m),{kind:`maximize`,class:`size-3.5`}),x(m),x(i),F(()=>{J(c,`aria-label`,t(o)),J(c,`title`,t(s)),c.disabled=a(),p.disabled=a(),J(m,`aria-label`,r()?`Restore window`:`Maximize window`),J(m,`title`,r()?`Restore`:`Maximize`),m.disabled=a()}),h(`click`,c,()=>n.onClose?.()),h(`click`,p,()=>n.onMinimize?.()),h(`click`,m,()=>n.onToggleMaximize?.()),k(e,i)},m=e=>{var i=l9(),c=q(i);Q(c,{variant:`ghost`,size:`icon`,class:`rounded-full`,ariaLabel:`Minimize window`,title:`Minimize`,get disabled(){return a()},onclick:()=>n.onMinimize?.(),children:(e,t)=>{od(e,{class:`size-3.5`,strokeWidth:1.75})},$$slots:{default:!0}});var u=G(c,2);{let e=L(()=>r()?`Restore window`:`Maximize window`),i=L(()=>r()?`Restore`:`Maximize`);Q(u,{variant:`ghost`,size:`icon`,class:`rounded-full`,get ariaLabel(){return t(e)},get title(){return t(i)},get disabled(){return a()},onclick:()=>n.onToggleMaximize?.(),children:(e,t)=>{var n=f(),i=R(n),a=e=>{sr(e,{class:`size-3`,strokeWidth:1.75})},o=e=>{Xs(e,{class:`size-3`,strokeWidth:1.75})};l(i,e=>{r()?e(a):e(o,-1)}),k(e,n)},$$slots:{default:!0}})}var d=G(u,2);Q(d,{variant:`ghost`,size:`icon`,class:`size-7 rounded-full hover:bg-destructive-solid hover:text-destructive-solid-foreground focus-visible:bg-destructive-solid focus-visible:text-destructive-solid-foreground`,get ariaLabel(){return t(o)},get title(){return t(s)},get disabled(){return a()},onclick:()=>n.onClose?.(),children:(e,t)=>{var n=f(),r=R(n),i=e=>{dn(e,{})},o=e=>{ye(e,{class:`size-3.5`,strokeWidth:1.75})};l(r,e=>{a()?e(i):e(o,-1)}),k(e,n)},$$slots:{default:!0}}),x(i),k(e,i)},g=e=>{var i=l9(),c=q(i);Q(c,{variant:`ghost`,size:`icon`,class:`group/linux-control size-7 rounded-full hover:bg-transparent focus-visible:bg-transparent`,ariaLabel:`Minimize window`,title:`Minimize`,get disabled(){return a()},onclick:()=>n.onMinimize?.(),children:(e,t)=>{var n=u9(),r=q(n);qn(r,{class:`size-3.5`,strokeWidth:2}),x(n),k(e,n)},$$slots:{default:!0}});var u=G(c,2);{let e=L(()=>r()?`Restore window`:`Maximize window`),i=L(()=>r()?`Restore`:`Maximize`);Q(u,{variant:`ghost`,size:`icon`,class:`group/linux-control size-7 rounded-full hover:bg-transparent focus-visible:bg-transparent`,get ariaLabel(){return t(e)},get title(){return t(i)},get disabled(){return a()},onclick:()=>n.onToggleMaximize?.(),children:(e,t)=>{var n=u9(),i=q(n),a=e=>{yre(e,{class:`size-2.5`,strokeWidth:2})},o=e=>{Tf(e,{class:`size-3.5`,strokeWidth:2})};l(i,e=>{r()?e(a):e(o,-1)}),x(n),k(e,n)},$$slots:{default:!0}})}var d=G(u,2);Q(d,{variant:`ghost`,size:`icon`,class:`group/linux-control size-7 rounded-full hover:bg-transparent focus-visible:bg-transparent`,get ariaLabel(){return t(o)},get title(){return t(s)},get disabled(){return a()},onclick:()=>n.onClose?.(),children:(e,t)=>{var n=f(),r=R(n),i=e=>{dn(e,{})},o=e=>{var t=zme(),n=q(t);ye(n,{class:`size-3.5`,strokeWidth:2}),x(t),k(e,t)};l(r,e=>{a()?e(i):e(o,-1)}),k(e,n)},$$slots:{default:!0}}),x(i),k(e,i)};l(d,e=>{n.headerType===`macos`?e(p):n.headerType===`windows`?e(m,1):e(g,-1)}),k(e,u),D()}ue([`click`]);var Bme=O(`<span class="inline-flex items-center gap-1.5 text-foreground"><span class="brand-mark svelte-a35yzb"><!></span></span> <!>`,1),Vme=O(`<span class="inline-flex flex-none items-center rounded-sm bg-warning px-1.5 py-0.5 text-ui leading-none font-semibold text-warning-foreground" role="img"><span aria-hidden="true"> </span></span>`),Hme=O(`<span class="absolute -right-0.5 -top-0.5 min-w-4 rounded-full bg-info px-1 text-center text-caption leading-4 text-info-foreground" aria-hidden="true"> </span>`),Ume=O(`<span class="absolute -right-0.5 -top-0.5 size-2 rounded-full bg-muted-foreground" aria-hidden="true"></span>`),Wme=O(`<!> <!>`,1),Gme=O(`<span class="mx-0.5 h-5 w-px bg-border" aria-hidden="true"></span> <!>`,1),Kme=O(`<!> <!> <!> <!> <!> <!>`,1);function qme(e,r){c(r,!0);let i=K(r,`projects`,19,()=>[]),a=K(r,`projectOptions`,19,()=>[]),o=K(r,`desktop`,3,!1),s=K(r,`headerType`,3,`linux`),u=K(r,`maximized`,3,!1),d=K(r,`closeToTray`,3,!1),p=K(r,`quitting`,3,!1),h=K(r,`settingsActive`,3,!1),g=K(r,`discoverActive`,3,!1),_=K(r,`discoverBadge`,19,()=>({kind:`none`})),v=K(r,`logsActive`,3,!1),y=K(r,`applicationLogsEnabled`,3,!1),b=K(r,`projectSwitcherOpen`,15,!1);ao(e,{get desktop(){return o()},leadingControls:e=>{var t=f(),n=R(t),i=e=>{d9(e,{get headerType(){return s()},get maximized(){return u()},get closeToTray(){return d()},get quitting(){return p()},get onMinimize(){return r.onMinimize},get onToggleMaximize(){return r.onToggleMaximize},get onClose(){return r.onClose}})};l(n,e=>{o()&&s()===`macos`&&e(i)}),k(e,t)},left:e=>{var t=Bme(),n=R(t),o=q(n);oA(q(o),{compact:!0}),x(o),x(n);var s=G(n,2);zr(s,{get items(){return i()},get popoverItems(){return a()},get activeKey(){return r.activeProjectKey},get homeDir(){return r.homeDir},get buildMenuItems(){return r.buildProjectMenuItems},get onSelect(){return r.onSelectProject},get onOpenPicker(){return r.onOpenProject},get onOpenPath(){return r.onOpenProjectPath},get onUseSystemPicker(){return r.onUseSystemPicker},get open(){return b()},set open(e){b(e)}}),k(e,t)},actions:e=>{var i=f(),a=R(i);H(a,()=>Rm,(e,i)=>{i(e,{class:`flex min-w-0 flex-none items-center gap-1.5 [-webkit-app-region:no-drag]`,"aria-label":`Application actions`,children:(e,i)=>{var a=Kme(),c=R(a),f=e=>{var t=Vme(),n=q(t),i=z(n);x(t),F(()=>{J(t,`aria-label`,`Development instance, slot ${r.developmentSlot}`),J(t,`title`,`Development instance (slot ${r.developmentSlot})`),w(i,`DEV ${r.developmentSlot??``}`)}),k(e,t)},b=e=>{Nme(e,{get currentVersion(){return r.currentVersion},get latestRelease(){return r.latestRelease}})};l(c,e=>{r.developmentSlot?e(f):r.currentVersion&&e(b,1)});var S=G(c,2);n(S,()=>r.activity??m);var C=G(S,2);{let e=L(()=>_().kind===`count`?`Open Discover, ${_().value} unread updates`:_().kind===`dot`?`Open Discover, setup is unfinished`:`Open Discover`);Q(C,{variant:`ghost`,size:`icon`,class:`relative max-sm:hidden`,"data-tour-id":`help`,get ariaLabel(){return t(e)},title:`Open Discover`,get active(){return g()},get pressed(){return g()},onclick:()=>r.onOpenDiscover?.(),children:(e,t)=>{var n=Wme(),r=R(n);Iw(r,{size:16,strokeWidth:2.1});var i=G(r,2),a=e=>{var t=Hme(),n=z(t,!0);F(()=>w(n,_().value)),k(e,t)},o=e=>{var t=Ume();k(e,t)};l(i,e=>{_().kind===`count`?e(a):_().kind===`dot`&&e(o,1)}),k(e,n)},$$slots:{default:!0}})}var T=G(C,2),E=e=>{Q(e,{variant:`ghost`,size:`icon`,ariaLabel:`Open Nerve logs`,title:`Open Nerve logs`,get active(){return v()},get pressed(){return v()},onclick:()=>r.onOpenLogs?.(),children:(e,t)=>{Yw(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}})};l(T,e=>{y()&&e(E)});var D=G(T,2);Q(D,{variant:`ghost`,size:`icon`,ariaLabel:`Open settings`,title:`Open settings`,"data-tour-id":`settings`,get active(){return h()},get pressed(){return h()},onclick:()=>r.onOpenSettings?.(),children:(e,t)=>{Xc(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var O=G(D,2),A=e=>{var t=Gme();d9(G(R(t),2),{get headerType(){return s()},get maximized(){return u()},get closeToTray(){return d()},get quitting(){return p()},get onMinimize(){return r.onMinimize},get onToggleMaximize(){return r.onToggleMaximize},get onClose(){return r.onClose}}),k(e,t)};l(O,e=>{o()&&s()!==`macos`&&e(A)}),k(e,a)},$$slots:{default:!0}})}),k(e,i)},$$slots:{leadingControls:!0,left:!0,actions:!0}}),D()}var Jme=O(`<div class="fixed left-0 right-0 top-0 bg-scrim"></div> <div class="fixed bottom-0 left-0 right-0 bg-scrim"></div> <div class="fixed left-0 bg-scrim"></div> <div class="fixed right-0 bg-scrim"></div> <div class="fixed rounded-lg ring-2 ring-primary ring-offset-2 ring-offset-background" aria-hidden="true"></div>`,1),Yme=O(`<div class="fixed inset-0 bg-scrim"></div>`),Xme=O(`<p class="rounded-md bg-muted p-3 text-ui text-muted-foreground"> </p>`),Zme=O(`<p class="text-ui text-muted-foreground">Opening this feature…</p>`),Qme=O(`<!> Back`,1),$me=O(`<!> `,1),ehe=O(`Next <!>`,1),the=O(`<div role="presentation"><!> <div role="dialog" aria-labelledby="guided-tour-title" aria-describedby="guided-tour-description"><div class="grid gap-2"><div class="flex items-center justify-between gap-3 text-ui text-muted-foreground"><span> </span> <span> </span></div> <!></div> <div class="grid gap-2" aria-live="polite"><h2 id="guided-tour-title" class="text-title font-medium text-foreground"> </h2> <p id="guided-tour-description" class="text-body leading-relaxed text-muted-foreground"> </p> <!></div> <div class="flex flex-wrap items-center justify-between gap-2"><!> <div class="flex items-center gap-2"><!> <!></div></div></div></div>`);function f9(e,n){c(n,!0);let r=K(n,`variant`,3,`modal`),i=K(n,`preparing`,3,!1),a=K(n,`compact`,3,!1),o=Y(void 0),s=Y(null),u=Y(384),d=Y(220),f=Y(U(typeof window>`u`?1024:window.innerWidth)),p=Y(U(typeof window>`u`?768:window.innerHeight)),m=L(()=>r()===`modal`),h=L(()=>n.index===n.count-1),_=L(()=>`introducedIn`in n.step&&n.step.id===`finish`||t(h)&&!t(o)),v=L(()=>sl({target:t(o),viewportWidth:t(f),viewportHeight:t(p),calloutWidth:t(u),calloutHeight:t(d),compact:a(),centered:t(_)}));function b(){if(n.step.targetId)return[...document.querySelectorAll(`[data-tour-id="${n.step.targetId}"]`)].find(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0})}function S(){B(f,window.innerWidth,!0),B(p,window.innerHeight,!0);let e=b();if(!e)B(o,void 0);else{let t=e.getBoundingClientRect(),n=Math.max(0,t.left-6),r=Math.max(0,t.top-6),i=Math.min(window.innerWidth,t.right+6),a=Math.min(window.innerHeight,t.bottom+6);B(o,{top:r,right:i,bottom:a,left:n,width:i-n,height:a-r},!0)}if(t(s)){let e=t(s).getBoundingClientRect();B(u,e.width,!0),B(d,e.height,!0)}}W(()=>{let e=n.step.targetId,r=t(m);ne().then(()=>{S(),r&&t(s)?.focus({preventScroll:!0})});let i=e?b():void 0,a=new ResizeObserver(S),o=new MutationObserver(S);return i?a.observe(i):e&&o.observe(document.body,{childList:!0,subtree:!0}),t(s)&&a.observe(t(s)),()=>{a.disconnect(),o.disconnect()}});function C(e){if(e.key===`Escape`){e.preventDefault(),n.onClose();return}if(!t(m)||e.key!==`Tab`||!t(s))return;let r=[...t(s).querySelectorAll(`button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])`)];if(r.length===0)return;let i=r.indexOf(document.activeElement);e.shiftKey&&i<=0?(e.preventDefault(),r.at(-1)?.focus()):!e.shiftKey&&i===r.length-1&&(e.preventDefault(),r[0]?.focus())}var T=the();M(`resize`,ce,S),M(`scroll`,ce,S),M(`keydown`,ce,C);var E=q(T),O=e=>{var n=Jme(),r=R(n);let i;var a=G(r,2);let s;var c=G(a,2);let l;var u=G(c,2);let d;var f=G(u,2);let p;F(()=>{i=I(r,``,i,{height:`${t(o).top}px`}),s=I(a,``,s,{top:`${t(o).bottom}px`}),l=I(c,``,l,{top:`${t(o).top}px`,width:`${t(o).left}px`,height:`${t(o).height}px`}),d=I(u,``,d,{top:`${t(o).top}px`,left:`${t(o).right}px`,height:`${t(o).height}px`}),p=I(f,``,p,{top:`${t(o).top}px`,left:`${t(o).left}px`,width:`${t(o).width}px`,height:`${t(o).height}px`})}),k(e,n)},A=e=>{var t=Yme();k(e,t)};l(E,e=>{t(o)?e(O):e(A,-1)});var j=G(E,2);let N;var P=q(j),ee=q(P),re=q(ee),ie=z(re,!0),ae=G(re,2),V=z(ae);x(ee);var oe=G(ee,2);{let e=L(()=>n.index+1),r=L(()=>`${t(m)?`Workbench tour`:`Guide`} progress`);md(oe,{get value(){return t(e)},get max(){return n.count},get"aria-label"(){return t(r)}})}x(P);var se=G(P,2),H=q(se),le=z(H,!0),ue=G(H,2),de=z(ue,!0),fe=G(ue,2),pe=e=>{var t=Xme(),r=z(t,!0);F(()=>w(r,n.step.fallback)),k(e,t)},me=e=>{var t=Zme();k(e,t)};l(fe,e=>{!t(o)&&n.step.fallback?e(pe):i()&&e(me,1)}),x(se);var he=G(se,2),ge=q(he);Q(ge,{variant:`ghost`,get onclick(){return n.onClose},children:(e,n)=>{y();var r=g();F(()=>w(r,t(m)?`Not now`:`Close guide`)),k(e,r)},$$slots:{default:!0}});var _e=G(ge,2),ve=q(_e);{let e=L(()=>n.index===0||i());Q(ve,{variant:`outline`,get disabled(){return t(e)},get onclick(){return n.onBack},children:(e,t)=>{var n=Qme(),r=R(n);Ol(r,{class:`size-3.5`,"aria-hidden":`true`}),y(),k(e,n)},$$slots:{default:!0}})}var Z=G(ve,2),ye=e=>{Q(e,{get disabled(){return i()},get onclick(){return n.onComplete},children:(e,n)=>{var r=$me(),i=R(r);ic(i,{class:`size-3.5`,"aria-hidden":`true`});var a=G(i);F(()=>w(a,` ${t(m)?`Finish`:`Finish guide`}`)),k(e,r)},$$slots:{default:!0}})},be=e=>{Q(e,{get disabled(){return i()},get onclick(){return n.onNext},children:(e,t)=>{y();var n=ehe(),r=G(R(n));bf(r,{class:`size-3.5`,"aria-hidden":`true`}),k(e,n)},$$slots:{default:!0}})};l(Z,e=>{t(h)?e(ye):e(be,-1)}),x(_e),x(he),x(j),te(j,e=>B(s,e),()=>t(s)),x(T),F(()=>{X(T,1,`fixed inset-0 z-100 ${t(m)?``:`pointer-events-none`}`),X(j,1,`fixed grid max-w-[calc(100vw-1.5rem)] gap-4 rounded-xl border border-border bg-popover p-5 text-popover-foreground shadow-overlay outline-none ${t(m)?`w-96`:`pointer-events-auto w-80`}`),J(j,`aria-modal`,t(m)?`true`:`false`),J(j,`tabindex`,t(m)?-1:void 0),N=I(j,``,N,{top:`${t(v).top}px`,left:`${t(v).left}px`}),w(ie,t(m)?`Workbench tour`:`Guide`),w(V,`Step ${n.index+1} of ${n.count??``}`),w(le,n.step.title),w(de,n.step.description)}),k(e,T),D()}function nhe(e,n){c(n,!0);let r=L(ll),i=L(al);var a=f(),o=R(a),s=e=>{f9(e,{get step(){return t(r)},variant:`modal`,get index(){return ol.stepIndex},get count(){return ol.runSteps.length},get preparing(){return ol.preparing},get compact(){return $d.isCompact},onBack:()=>ul(-1),onNext:()=>ul(1),get onComplete(){return ml},get onClose(){return pl}})},u=e=>{f9(e,{get step(){return t(i)},variant:`coach`,get index(){return ol.setupStepIndex},get count(){return ol.setupSteps.length},get preparing(){return ol.preparing},compact:!1,onBack:()=>void fl(-1),onNext:()=>void fl(1),get onComplete(){return ml},get onClose(){return pl}})};l(o,e=>{!$d.isPhone&&ol.mode===`tour`&&t(r)?e(s):!$d.isPhone&&ol.mode===`coach`&&t(i)&&e(u,1)}),k(e,a),D()}function rhe(e,t){return e===`auto`?t===`darwin`?`macos`:t===`win32`?`windows`:`linux`:e}function p9(e){return e instanceof Error?e.message:String(e)}function m9(e){Ds.projectPickerPath=e,Ds.projectPickerOpen=!0}async function h9(e){let t=await br().catch(()=>void 0),n=t?x_(e,t):e.trim();if(!n)return;let r=t?.caseInsensitive??!1,i=e=>Ds.projects.find(t=>Kr(t.directory,r)===Kr(e,r)),a=i(n);if(a){await jd(a.id);return}let o;try{o=(await Od(n)).path}catch(e){let r=t?__(n,t):void 0;ui.error(`Could not open folder`,{description:p9(e),action:{label:`Browse in Nerve`,onClick:()=>m9(r||void 0)}});return}let s=i(o);s?await jd(s.id):await Ad(o)}async function ihe(){return typeof si()?.dialog?.pickDirectory==`function`&&await pi()}async function ahe(e){let t=si()?.dialog?.pickDirectory;if(!t)return;let n=await br().catch(()=>void 0),r=(e&&n?__(e,n):void 0)||void 0,i;try{i=(await t({title:`Open folder`,defaultPath:r})).path}catch(e){ui.error(`Could not open the system picker`,{description:p9(e),action:{label:`Browse in Nerve`,onClick:()=>m9()}});return}i&&await h9(i)}var ohe=O(`<!> <!> <!> <!>`,1),she=O(`<!> <!> <!> <!> <!>`,1);function che(e,n){c(n,!0);let r=e=>{kpe(e,{get health(){return H4.notice.health},get pending(){return H4.notice.pending},get error(){return H4.notice.error},onReset:e=>ae(()=>H4.resetId=e),onReload:e=>void H4.resolve({id:e,action:`reload`}),onRetry:()=>void H4.refresh()})},i=e=>{var n=ohe(),i=R(n);hpe(i,{onDetails:()=>ae(()=>R7.open=!0)});var a=G(i,2),o=e=>{r(e)};l(a,e=>{(H4.notice.health.invalid.length||H4.notice.error)&&e(o)});var s=G(a,2),c=e=>{{let n=L(()=>({count:$6.counts.trust,onOpen:()=>{va.setOpen(!1),Z6.expand()}}));Ppe(e,{get rows(){return t(b)},get review(){return t(n)}})}};l(s,e=>{(t(b).length||$6.counts.trust)&&e(c)});var u=G(s,2),d=e=>{Mpe(e,{get issues(){return t(h)},projectName:e=>Xr.projects.find(t=>t.id===e)?.name,get pending(){return I4.pending},get error(){return I4.error},onOpen:e=>{va.setOpen(!1),I4.open(e)},onReload:e=>void I4.reload(e),onReset:e=>ae(()=>I4.requestReset(e))})};l(u,e=>{t(h).length&&e(d)}),k(e,n)},a=L(()=>Xr.projectSwitcherItems),o=L(()=>Xr.status),s=L(()=>O_(Xr.conversations)),u=L(()=>Bpe({activities:va.activities,needsYou:Q6({conversations:Xr.conversations,activityById:Xr.conversationActivityById,projectNameById:Object.fromEntries(Xr.projects.map(e=>[e.id,e.name]))}),activeProjectId:Xr.activeProject?.id,readIds:va.readIds})),d=L(()=>t(u).some(e=>e.conversationId&&e.kind===`failed`&&e.unread));function p(e){let n=t(u).find(t=>t.id===e&&t.conversationId&&t.kind===`succeeded`);n?.conversationId?Hr.delete(n.conversationId):va.action(`dismiss`,e)}function m(){Hr.clear(),va.clear()}let h=L(()=>Object.values(I4.byProject).flat()),g=L(()=>g3.entries.filter(e=>e.group!==`review`)),_=L(()=>_ae(Z6.state,$6.counts)&&!va.open),v=L(()=>Z6.state.phase===`later`?`compact`:Z6.state.phase),y=L(()=>g3.projectId),b=L(()=>Fpe(t(g),{projectId:t(y),onOpenTarget:e=>{va.setOpen(!1);let n=e.item?{item:e.item}:{};e.scope===`project`&&t(y)?zt(t(y),e.pageId,n):Vt(e.pageId,n)},onAskAgent:e=>{va.setOpen(!1),t(y)&&Xee(t(y),`forge`,h3(e))},onOpenFile:e=>{va.setOpen(!1),g3.openFile(e)}})),x=dr(`conversation.new`),S=Y(void 0),C=Y(void 0),w=L(()=>{let e=t(C)??[];return`Delete ${e.length===1?`“${e[0].title||e[0].id}”`:`${e.length} unreadable conversations`} and all ${e.length===1?`its`:`their`} descendants? Stored messages and files will be permanently removed.`}),T=Y(void 0),E=L(()=>$d.isPhone?1:$d.isCompact?2:5),O=L(()=>Nr(t(a),Ds.selectedProjectKey,t(E))),A=L(()=>Xr.activeCenterTab),j=L(()=>Sf.settingsDraft),M=L(()=>rhe(t(j)?.desktop.headerType??`auto`,li.platform)),N=L(cl),P=L(()=>li.quitting||a7.quitRequested),F=L(()=>({homeDir:t(o)?.storage.userHome,newConversationShortcut:x,conversationCount:e=>Ar(t(s),e),maintenanceActive:yf.active,onNewConversationInProject:kd,onOpenProjectSettings:e=>void zt(e),requestPrune:e=>{B(T,{id:e.id,label:Vo(e.dir,t(o)?.storage.userHome)},!0)},requestDelete:e=>B(S,e,!0)}));function I(e){return Gr(e.project,t(F))}function ee(){t(S)?.kind===`project`&&!yf.active&&Yee(t(S).id)}function te(e){t(T)&&!yf.active&&qr(t(T).id,e)}function ne(){m9()}let re=Y(!1);W(()=>{let e=!0;return ihe().then(t=>{e&&B(re,t,!0)}),()=>{e=!1}});function z(){ahe(Xr.activeProject?.directory)}async function ie(){let e=t(j)?.desktop.closeToTray??!1;e||(a7.quitRequested=!0,li.quitting=!0);try{await hee({closeToTray:e})}catch(t){e||(a7.quitRequested=!1,li.quitting=!1),Ds.error=t instanceof Error?t.message:String(t)}}function ae(e){va.setOpen(!1),e()}let V=!1;W(()=>{!V&&Us.progressiveActive&&Ds.connection===`connected`&&(V=!0,cpe())});var oe=she(),se=R(oe);{let e=e=>{var n=f(),r=R(n),a=e=>{gme(e,{get phase(){return t(v)},get arrival(){return $6.arrival},get trust(){return $6.trustRows},get conversations(){return $6.conversationRows},onExpand:()=>Z6.expand(),onCollapse:()=>Z6.collapse(),onLater:()=>Z6.later(),onReview:e=>$6.review(e.key),onReviewAll:()=>$6.review(),onOpenConversation:e=>$6.openConversation(e),onAllNotifications:()=>{Z6.dismiss(),va.setOpen(!0)},onHover:e=>Z6.hover(e)})},o=e=>{{let n=L(()=>va.unseenFailure||t(d)),r=L(()=>H4.notice.health.invalid.length||H4.notice.error||t(h).length||t(b).length||$6.counts.trust||lpe()?i:void 0);eme(e,{get items(){return t(u)},get error(){return va.error},get unseenFailure(){return t(n)},get muted(){return r9.muted},get attention(){return t(r)},get open(){return va.open},get onOpenChange(){return va.setOpen},onOpenItem:e=>{e.conversationId&&(va.setOpen(!1),Rd(e.conversationId))},onAction:(e,t)=>{e===`open`?t.conversationId&&(va.setOpen(!1),Rd(t.conversationId)):e===`settings`?t.settingsPage&&(va.setOpen(!1),Vt(t.settingsPage)):va.action(e,t.id)},onDeleteConversations:e=>ae(()=>B(C,e,!0)),onDismiss:p,onClearFinished:m,onToggleMute:()=>r9.muted?r9.unmute():r9.mute(),get onViewed(){return va.markRead}})}};l(r,e=>{t(_)?e(a):e(o,-1)}),k(e,n)},n=L(()=>t(o)?.storage.userHome),r=L(()=>t(j)?.desktop.closeToTray??!1),s=L(()=>t(A)?.kind===`settings`),c=L(()=>t(A)?.kind===`discover`||ol.mode!==`closed`),g=L(()=>t(A)?.kind===`logs`),y=L(()=>t(o)?.capabilities.applicationLogs??!1),x=L(()=>t(o)?.version),S=L(()=>t(re)?z:void 0);qme(se,{get projects(){return t(O)},get projectOptions(){return t(a)},get activeProjectKey(){return Ds.selectedProjectKey},get homeDir(){return t(n)},get desktop(){return li.isDesktop},get developmentSlot(){return li.developmentSlot},get headerType(){return t(M)},get maximized(){return li.windowState.maximized},get closeToTray(){return t(r)},get quitting(){return t(P)},get settingsActive(){return t(s)},get discoverActive(){return t(c)},get discoverBadge(){return t(N)},get logsActive(){return t(g)},get applicationLogsEnabled(){return t(y)},get currentVersion(){return t(x)},get latestRelease(){return pd.latest},buildProjectMenuItems:I,onOpenProject:ne,onOpenProjectPath:e=>void h9(e),get onUseSystemPicker(){return t(S)},onSelectProject:e=>void jd(e),onOpenLogs:()=>Uue(),get onOpenDiscover(){return $c},onOpenSettings:()=>void Vt(),onMinimize:()=>void dee(),onToggleMaximize:()=>void ii(),onClose:()=>void ie(),get projectSwitcherOpen(){return Ds.projectSwitcherOpen},set projectSwitcherOpen(e){Ds.projectSwitcherOpen=e},activity:e,$$slots:{activity:!0}})}var H=G(se,2);{let e=L(()=>t(o)?.storage.home);Dpe(H,{get home(){return t(e)}})}var ce=G(H,2);{let e=L(()=>t(S)?.kind===`project`),n=L(()=>t(S)?`This removes “${t(S).label}” from Nerve and deletes its Nerve conversations. Files on disk are not deleted.`:``);jn(ce,{get open(){return t(e)},title:`Remove project?`,get description(){return t(n)},confirmLabel:`Remove`,destructive:!0,onConfirm:ee,onOpenChange:e=>{e||B(S,void 0)}})}var U=G(ce,2);{let e=L(()=>!!t(T)),n=L(()=>t(T)?.label??``),r=L(()=>t(T)?Ar(t(s),t(T).id):0);Sr(U,{get open(){return t(e)},get projectLabel(){return t(n)},get totalCount(){return t(r)},ageEligible:e=>t(T)?Vr(t(s),t(T).id,e):0,keepEligible:e=>t(T)?Ir(t(s),t(T).id,e):0,completedEligible:()=>t(T)?Lr(t(s),t(T).id):0,get disabled(){return yf.active},onConfirm:te,onOpenChange:e=>{e||B(T,void 0)}})}var le=G(U,2);{let e=L(()=>!!t(C)?.length),n=L(()=>t(C)?.length===1?`Delete unreadable conversation?`:`Delete unreadable conversations?`),r=L(()=>t(C)?.length===1?`Delete`:`Delete ${t(C)?.length??0}`);jn(le,{get open(){return t(e)},get title(){return t(n)},get description(){return t(w)},get confirmLabel(){return t(r)},destructive:!0,onConfirm:()=>{t(C)?.length&&va.deleteConversations(t(C).map(e=>e.id))},onOpenChange:e=>{e||B(C,void 0)}})}k(e,oe),D()}function lhe(e,t=()=>{}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Set;function s(s){o.add(s);let c=a.get(s);if(c)return c;let l=(async()=>{await Promise.resolve();try{for(;;){let a=i.get(s)??0;try{let o=await e(s);if(a!==(i.get(s)??0)||(n.set(s,o),r.delete(s),t(),a!==(i.get(s)??0)))continue;return}catch(e){if(a!==(i.get(s)??0)||(r.set(s,e instanceof Error?e.message:String(e)),t(),a!==(i.get(s)??0)))continue;throw e}}}finally{a.delete(s)}})();return a.set(s,l),l}function c(e){return i.set(e,(i.get(e)??0)+1),s(e)}return{cached:e=>e?n.get(e):void 0,error:e=>e?r.get(e):void 0,load:s,invalidate:c,revalidate:()=>Promise.all([...o].map(c)).then(()=>{})}}var g9=Y(0),_9=lhe(Lf,()=>{B(g9,t(g9)+1)});$n(`launchCatalog.changed`,e=>{let t=e.data?.projectId;if(typeof t==`string`)return _9.invalidate(t).catch(()=>{})}),tr(()=>_9.revalidate().catch(()=>{}));function v9(e){return t(g9),_9.cached(e)}function uhe(e){return t(g9),_9.error(e)}function dhe(e){return v9(e)?.definitions}var y9=_9.invalidate,b9=_9.invalidate;function fhe(){return W(()=>{if(!Us.progressiveActive)return;let e=Xr.activeProject?.id;e&&me(()=>{y9(e).catch(()=>{})})}),{get count(){let e=v9(Xr.activeProject?.id);return e?Ef(e.definitions,e.folders,kf.launches).activeDefinitionCount:0}}}var x9=new class{#e=Y([]);get accounts(){return t(this.#e)}set accounts(e){B(this.#e,e)}#t=Y([]);get kinds(){return t(this.#t)}set kinds(e){B(this.#t,e)}#n=Y([]);get health(){return t(this.#n)}set health(e){B(this.#n,e)}#r=Y(!1);get loaded(){return t(this.#r)}set loaded(e){B(this.#r,e,!0)}async load(){let e=await nr(`accounts.list`,{});this.accounts=e.accounts,this.kinds=e.kinds,this.loaded=!0}async loadHealth(){this.health=(await nr(`accounts.health.list`,{})).health}healthOf(e,t){return this.health.find(n=>n.kind===e&&n.accountId===t)}setHealth(e){this.health=[...this.health.filter(t=>t.kind!==e.kind||t.accountId!==e.accountId),e]}},S9=U({}),phe=(e,t)=>`${e}.${t}`;function C9(e){if(e.target.scope===`user`)for(let t of e.extensions)for(let[e,n]of Object.entries(t.settingsSchema.fields)){if(n.type!==`account`)continue;let r=t.fields[e]?.value,i=phe(t.metadata.id,e);typeof r==`string`&&r?S9[i]=r:delete S9[i]}}async function mhe(){C9(await nr(`extensions.get`,{target:{scope:`user`}}))}function hhe(){W(()=>{if(!Us.progressiveActive)return;let e=e=>()=>void e().catch(()=>{}),t=e(()=>x9.load()),n=e(()=>x9.loadHealth()),r=e(mhe);me(()=>{t(),n(),r()});let i=[$n(`accounts.changed`,()=>{t(),r()}),$n(`accounts.health_changed`,n),$n(`extensions.changed`,r)];return()=>i.forEach(e=>e())})}var ghe=O(`<aside class="fixed right-4 bottom-4 z-50 w-[min(24rem,calc(100vw-2rem))] rounded-lg border border-border bg-card p-4 text-card-foreground shadow-overlay" aria-live="polite" aria-label="Notification permission"><div class="flex gap-3"><div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground"><!></div> <div class="min-w-0 flex-1 space-y-3"><div class="space-y-1"><h2 class="text-ui">Enable desktop notifications</h2> <p class="text-ui text-muted-foreground">Let Nerve alert you when an agent needs approval, asks a question,
162
+ or finishes in the background.</p></div> <div class="flex flex-wrap justify-end gap-2"><!> <!></div></div></div></aside>`);function _he(e,t){c(t,!1),he();var n=f(),r=R(n),i=e=>{var t=ghe(),n=q(t),r=q(n),i=q(r);wd(i,{class:`size-4`,strokeWidth:2}),x(r);var a=G(r,2),o=G(q(a),2),s=q(o);Q(s,{variant:`ghost`,get onclick(){return mee},children:(e,t)=>{y();var n=g(`Not now`);k(e,n)},$$slots:{default:!0}});var c=G(s,2);Q(c,{onclick:()=>void ci(),children:(e,t)=>{y();var n=g(`Enable notifications`);k(e,n)},$$slots:{default:!0}}),x(o),x(a),x(n),x(t),k(e,t)};l(r,e=>{ai.promptVisible&&e(i)}),k(e,n),D()}var w9=O(`<!> <!>`,1);function vhe(e,n){c(n,!0);let r=L(()=>!!$o.current);var i=f(),a=R(i);H(a,()=>ree,(e,n)=>{n(e,{get open(){return t(r)},onOpenChange:e=>{e||$o.current},children:(e,t)=>{var n=f(),r=R(n);H(r,()=>see,(e,t)=>{t(e,{onEscapeKeydown:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:(e,t)=>{var n=w9(),r=R(n);H(r,()=>iee,(e,t)=>{t(e,{children:(e,t)=>{var n=w9(),r=R(n);H(r,()=>An,(e,t)=>{t(e,{children:(e,t)=>{y();var n=g();F(()=>w(n,$o.current?.title)),k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>aee,(e,t)=>{t(e,{class:`whitespace-pre-wrap break-words`,children:(e,t)=>{y();var n=g();F(()=>w(n,$o.current?.details)),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})});var i=G(r,2);H(i,()=>nee,(e,t)=>{t(e,{children:(e,t)=>{var n=f(),r=R(n);H(r,()=>oee,(e,t)=>{t(e,{get onclick(){return Aee},children:(e,t)=>{y();var n=g(`OK`);k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,n)},$$slots:{default:!0}})}),k(e,i),D()}function yhe(e){return e.map((e,t)=>({id:Do(e.extensionId,e.id),title:e.label,icon:Oo(e.icon),defaultDock:`right`,defaultOrder:100+t}))}var T9=e=>{var t=bhe(),n=R(t);Tue(n,{});var r=G(n,2);Eue(r,{});var i=G(r,2);Due(i,{});var a=G(i,2),o=G(a,2);_he(o,{});var s=G(o,2);vhe(s,{});var c=G(s,2);dl(c,{});var l=G(c,2);nhe(l,{}),wue(G(l,2),{}),k(e,t)},bhe=O(`<!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),xhe=O(`<!> <!> <!> <!> <!>`,1);function She(e,n){c(n,!0);let r=fhe();hhe(),Oue(()=>Xr.activeProject?.id);let i=L(()=>yhe(Io(Xr.activeProject?.id)?.panels??[]));W(()=>{Io(Xr.activeProject?.id)&&dte(t(i))});let a=L(()=>[...Qd,...t(i)].map(e=>e.id===`launches`?{...e,activity:r.count>0?{count:r.count,description:`${r.count} active saved launch ${r.count===1?`configuration`:`configurations`}`}:void 0}:e));pe(()=>{yf.dispose(),va.dispose()}),W(()=>{Us.progressiveActive&&(yf.start(),va.start())}),W(()=>{Us.progressiveActive&&Ds.connection===`connected`&&(yf.reconnect(),va.reconnect())});let o=L(()=>$d.isPhone),s=L(()=>$d.isCompact&&!t(o)),u=L(()=>Xr.activeCenterTab);function d(e){return Object.entries(Gd.current.docks).some(([n,r])=>!r.activeViewId||!e.includes(r.activeViewId)?!1:t(s)?n===`left`?Wd.primary:Wd.secondary:!r.collapsed)}let f=L(()=>d([`git`,`pull-requests`])),p=L(()=>d([`pull-requests`])),h=ow(()=>Xr.activeProject,()=>t(f),()=>t(p)),g;W(()=>{let e=t(u)?`${t(u).kind}:${t(u).id}`:void 0;e!==g&&(g=e,Wd.primary&&Jd())}),W(()=>{!t(s)&&(Wd.primary||Wd.secondary)&&Jd()});var _=xhe(),v=R(_),y=e=>{Sue(e,{get overlays(){return T9}})},b=e=>{{let n=e=>{che(e,{})},r=e=>{ode(e,{})},i=(e,t=m)=>{sde(e,{get viewId(){return t()},get gitModel(){return h.model},get gitActions(){return h.actions}})},o=e=>{Vfe(e,{})},c=e=>{T9(e)},l=L(()=>({onActivateView:Xd,onMoveView:Yd,onHideView:lte,onToggleDock:fte,onDockResize:ute,onSheetOpenChange:qd}));co(e,{get layout(){return Gd.current},get descriptors(){return t(a)},get compact(){return t(s)},get primarySheetOpen(){return Wd.primary},get secondarySheetOpen(){return Wd.secondary},get actions(){return t(l)},titlebar:n,editor:r,panelView:i,statusBar:o,overlays:c,$$slots:{titlebar:!0,editor:!0,panelView:!0,statusBar:!0,overlays:!0}})}};l(v,e=>{t(o)?e(y):e(b,-1)});var x=G(v,2);wfe(x,{});var S=G(x,2);Rde(S,{});var C=G(S,2);cde(C,{}),Ide(G(C,2),{}),k(e,_),D()}var Che=class{projectId;#e=Y(U([]));get roots(){return t(this.#e)}set roots(e){B(this.#e,e,!0)}#t=Y(U({}));get children(){return t(this.#t)}set children(e){B(this.#t,e,!0)}#n=Y(U({}));get expanded(){return t(this.#n)}set expanded(e){B(this.#n,e,!0)}#r=Y(!1);get loading(){return t(this.#r)}set loading(e){B(this.#r,e,!0)}#i=Y();get error(){return t(this.#i)}set error(e){B(this.#i,e,!0)}refreshing;childLoads=new yo;childNotices=new yo;buffered=[];disposed=!1;unobserve;constructor(e){this.projectId=e,this.unobserve=yl({recover:e=>e?Promise.resolve():this.recover(),disconnected:()=>void 0,event:()=>void 0,notice:e=>{if(!(e.type!==`conversation.changed`&&e.type!==`conversation.deleted`||e.data.projectId!==this.projectId)){for(let t of this.childNotices.values())t.push(e);this.refreshing?this.buffered.push(e):this.applyNotice(e)}}})}open(){return this.recover()}recover(){return this.disposed||!xl()?Promise.resolve():(this.refreshing||=(this.loading=!0,this.error=void 0,(async()=>{let e=await El(`conversation.list`,{projectId:this.projectId,parentConversationId:null});if(this.disposed)return;this.roots=E9(e);let t=Object.keys(this.expanded).filter(e=>this.expanded[e]);await Promise.all(t.map(e=>this.loadChildren(e)))})().catch(e=>{throw this.error=D9(e),e}).finally(()=>{this.refreshing=void 0,this.loading=!1;let e=this.buffered;if(this.buffered=[],!this.disposed)for(let t of e)this.applyNotice(t)})),this.refreshing)}async toggleChildren(e){this.expanded[e]=!this.expanded[e],this.expanded[e]&&await this.loadChildren(e)}loadChildren(e){let t=this.childLoads.get(e);if(t)return t;let n=[];this.childNotices.set(e,n);let r=El(`conversation.list`,{projectId:this.projectId,parentConversationId:e}).then(t=>{if(!this.disposed){this.children[e]=E9(t);for(let e of n)this.applyNotice(e)}}).catch(e=>{throw this.error=D9(e),e}).finally(()=>{this.childNotices.delete(e),this.childLoads.delete(e)});return this.childLoads.set(e,r),r}applyNotice(e){if(e.type===`conversation.deleted`){let t=e.data.conversationId;this.roots=this.roots.filter(e=>e.id!==t);for(let e of Object.keys(this.children))this.children[e]=this.children[e].filter(e=>e.id!==t);delete this.children[t],delete this.expanded[t]}else if(e.type===`conversation.changed`){let t=e.data.summary,n=t.parentConversationId,r=(n===null?this.roots:this.children[n])?.find(e=>e.id===t.id);if(r&&E_(r,t))return;this.roots=this.roots.filter(e=>e.id!==t.id);for(let e of Object.keys(this.children))this.children[e]=this.children[e].filter(e=>e.id!==t.id);t.parentConversationId===null?this.roots=E9([...this.roots,t]):this.children[t.parentConversationId]&&(this.children[t.parentConversationId]=E9([...this.children[t.parentConversationId],t]))}}dispose(){this.disposed=!0,this.unobserve()}};function E9(e){return[...e].sort((e,t)=>e.pinnedAt===t.pinnedAt?t.updatedAt.localeCompare(e.updatedAt)||e.id.localeCompare(t.id):e.pinnedAt?t.pinnedAt?t.pinnedAt.localeCompare(e.pinnedAt):-1:1)}function D9(e){return e instanceof Error?e.message:String(e)}var O9={activeCenterTab:void 0},k9=O9;function whe(e){return k9=e,()=>{k9===e&&(k9=O9)}}var The={get activeCenterFileView(){let e=k9.activeCenterTab;if(e?.kind===`file`)return ef.fileViews[ls(e.id)]},get activeCenterMermaidView(){let e=k9.activeCenterTab;if(e?.kind===`mermaid`)return ef.mermaidViews[ss(e.id)]},get openFileTabs(){return ef.openFileTabIds}},Ehe={get diffViews(){return Lo.diffViews},get prViews(){return Lo.prViews},get openDiffTabIds(){return Lo.openDiffTabIds},get openPrTabIds(){return Lo.openPrTabIds}},A9={setOpenDiffTabIds(e){Lo.openDiffTabIds=e},setOpenPrTabIds(e){Lo.openPrTabIds=e},restorePrView(e,t){Lo.prViews[us(e)]=t},restoreDiffView(e,t){Lo.diffViews[fs(e)]=t},discardDiffView(e){delete Lo.diffViews[fs(e)]}},j9=U({logsTabOpen:!1}),Dhe={get tabOpen(){return j9.logsTabOpen}};function Ohe(e){j9.logsTabOpen=e}var khe={get message(){return Gt.settingsMessage},get saveStatus(){return Gt.settingsSaveStatus},get tabOpen(){return Gt.settingsTabOpen}};function Ahe(e){Gt.settingsTabOpen=e}function jhe(e,t){return t&&e.some(e=>e.id===t)?t:e[0]?.id}var Mhe={get launches(){return Df.launches},get openLaunchTabIds(){return Df.openLaunchTabIds},get selectedLaunchId(){return Df.selectedLaunchId},get selectedRunByEntry(){return Df.selectedRunByEntry},get launchLogs(){return Df.launchLogs}},Nhe={setLaunches(e){Df.launches=e},setOpenLaunchTabIds(e){Df.openLaunchTabIds=e},setSelectedLaunchId(e){Df.selectedLaunchId=e},clearLaunchLogs(){Df.launchLogs=void 0},resolveSelectedLaunchId:jhe,loadLaunchLogWindow:Nf};function Phe(){let e=Qee(e=>new Che(e)),t=bee({conversations:{read:{get asyncBashes(){return zoe.asyncBashes}},commands:{cancelVoiceInputTargets:s6,discardAsyncBashTab:Boe,discardSystemPromptPane:Ece}},filesystem:{read:e8,commands:{...t8,restoreFileView:(e,t)=>t8.restoreFileView(e,t),restoreMermaidView:(e,t)=>t8.restoreMermaidView(e,t)}},git:{read:Ehe,commands:{...A9,restorePrView:(e,t)=>A9.restorePrView(e,t),restoreDiffView:(e,t)=>A9.restoreDiffView(e,t)}},logs:{read:Dhe,commands:{setTabOpen:Ohe}},settings:{read:khe,commands:{setTabOpen:Ahe}},launches:{read:Mhe,commands:Nhe}}),n=rk({get selectedProvider(){return b4()?.resolution?.settings.model?.provider}}),r=whe({get activeCenterTab(){return Ds.activeCenterTab}}),i=ZS({get activeCenterTab(){return Ds.activeCenterTab},get activeProjectId(){return Xr.activeProject?.id}}),a=If({get activeProjectId(){return Xr.activeProject?.id},get activeCenterTab(){return Ds.activeCenterTab}});return()=>{n(),a(),i(),r(),t(),e()}}function Fhe(e,t){let n=e=>e.replaceAll(`\\`,`/`).replace(/\/+$/,``),r=n(e),i=n(t);return i===r?``:i.startsWith(`${r}/`)?i.slice(r.length+1):void 0}function Ihe(){let e=I4.onApplied(e=>void b9(e.projectId).catch(()=>{})),t=I4.registerFolderOpener(async e=>{let t=si();if(t){let n=await Vee(e.projectId),r=n?Fhe(n.directory,e.path):void 0;if(r!==void 0){await t.files.openProjectEntry({projectId:e.projectId,relativePath:r});return}}await jd(e.projectId),await E8(e.projectId,``,{refresh:!0}),await E8(e.projectId,`.nerve`,{refresh:!0}),h8(e.projectId).expandedIds.add(C8(e.projectId,`.nerve`)),Xd(`files`)});return()=>{e(),t()}}function Lhe(){let e=Ds.activeCenterTab;if(e?.kind===`conversation`)return{kind:`conversation`,id:e.id};if(e?.kind===`pending-conversation`){let t=Xo.get(e.id)?.projectId;return t?{kind:`pending-conversation`,id:e.id,projectId:t}:void 0}return Wo.conversationId?{kind:`conversation`,id:Wo.conversationId}:void 0}function Rhe(){return Co({conversationStarted:async(e,t,n)=>{if(n.draft!==void 0&&Id().setPrompt({kind:`conversation`,id:t},n.draft),!n.open)return;let r=await El(`conversation.getSnapshot`,{conversationId:t});Ds.conversations=D5(Ds.conversations,{...r.conversation,references:[],childCount:0,pendingWork:!1,pendingInput:null,agentProfile:r.config.agentProfile,model:r.config.model,permissionRuleSetId:r.config.permissionRuleSetId}),await qo({kind:`conversation`,id:t})},openFile:async(e,t)=>{await Vd({projectId:e,path:t})},insertIntoComposer:e=>{let t=Lhe();if(!t)throw Error(`Open a conversation first`);let n=Id(),r=n.getPrompt(t);n.setPrompt(t,r.trim()?`${r}\n\n${e}`:e),Ds.activeCenterTab?.kind!==t.kind&&qo({kind:t.kind,id:t.id})}})}Eee({select:{conversation:e=>{Wo.conversationId=e.id,Ko(e)},"pending-conversation":e=>Ko(e),"async-bash":e=>Ko(e),launch:e=>Mf(e.id),file:e=>ste(e.id),mermaid:e=>kae(e.id),pr:e=>mC(e.id),diff:e=>rC(e.id),"system-prompt":e=>Ko(e),settings:()=>tee(),logs:()=>Wue(),discover:()=>Qc(),"extension-page":e=>No(e.id)},close:{conversation:e=>zd([e]),"pending-conversation":e=>zd([e]),"async-bash":e=>zd([e]),launch:e=>Pf(e.id),file:e=>cte(e.id),mermaid:e=>jae(e.id),pr:e=>bC(e.id),diff:e=>oC(e.id),"system-prompt":e=>zd([e]),settings:()=>Ht(),logs:()=>Gue(),discover:()=>nl(),"extension-page":e=>Fo(e.id)}});function zhe(){let e=[Ab(),Af(),Yc(),Jc(),Qle(),xC(),Fce(),Ihe(),Rhe()];return()=>{for(let t of e.splice(0))t()}}function Bhe(e){function t(t){return!(t.metaKey||t.ctrlKey)||t.altKey?!1:t.key===`=`||t.key===`+`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()+1),!0):t.key===`-`||t.key===`_`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()-1),!0):t.key===`0`&&(t.preventDefault(),e.setUiZoomLevel(0),!0)}function n(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:e.kind===`discover`?{kind:`discover`,id:`discover`}:e.kind===`async-bash`?{kind:e.kind,id:e.id,conversationId:e.conversationId,projectId:e.projectId,command:e.command}:{kind:e.kind,id:e.id}}function r(){let t=e.activeCenterTab();return t?e.centerTabs().findIndex(e=>e.kind===t.kind&&e.id===t.id):-1}function i(t){let i=e.centerTabs();if(i.length===0)return!1;let a=r(),o=((a===-1?0:a)+t+i.length)%i.length;return e.selectCenterTab(n(i[o])),!0}function a(t){let r=e.centerTabs()[t];return r?(e.selectCenterTab(n(r)),!0):!1}function o(){if(!e.hasConversationComposer())return!1;let t=e.permissionRuleSetIds();if(t.length<=1)return!1;let n=t[(t.indexOf(e.selectedPermissionRuleSetId())+1)%t.length]??t[0];return n?(e.setComposerPermissionRuleSet(n),!0):!1}function s(){if(!e.hasConversationComposer())return!1;let t=e.usableModels();if(t.length<=1)return!1;let n=t.map(e=>`${e.provider}:${e.modelId}`),r=n[(n.indexOf(e.selectedModelKey())+1)%n.length]??n[0];return r?(e.setComposerModel(r),!0):!1}function c(){if(!e.hasConversationComposer())return!1;let t=e.usableModels().find(t=>`${t.provider}:${t.modelId}`===e.selectedModelKey()),n=t?.supportedThinkingLevels?.length?t.supportedThinkingLevels:[`off`];if(n.length<=1)return!1;let r=n[(n.indexOf(e.selectedThinkingLevel())+1)%n.length]??n[0]??`off`;return e.setComposerThinkingLevel(r),!0}function l(){if(!e.hasConversationComposer())return!1;let t=e.agentProfileNames();if(t.length<=1)return!1;let n=t[(t.indexOf(e.selectedAgentProfile())+1)%t.length]??t[0];return n?(e.setComposerAgentProfile(n),!0):!1}function u(t){if(t.startsWith(`pane.focusByIndex.`)){let e=Number(t.split(`.`).at(-1))-1;return Number.isInteger(e)&&a(e)}let n=e.activeCenterTab();switch(t){case`conversation.new`:return e.newConversation(),!0;case`conversation.newFromProject`:return e.openProjectPicker(),!0;case`project.openFolder`:return e.openFolder(),!0;case`pane.close`:return n?(e.closeCenterTab(n),!0):!1;case`pane.closeOthers`:return n?(e.closeCenterTabs(e.centerTabsExcept(n),n),!0):!1;case`pane.refresh`:return n?(e.refreshCenterTab(n),!0):!1;case`pane.previous`:return i(-1);case`pane.next`:return i(1);case`projectSearch.focus`:return e.focusProjectSearch(),!0;case`quickOpen.open`:return e.openQuickOpen(),!0;case`contentSearch.focus`:return e.focusContentSearch(),!0;case`composer.focus`:case`composer.cancelMic`:return e.hasConversationComposer()?(e.composerEscape(),!0):!1;case`composer.stopRun`:return e.canStop()?(e.abortActiveRun(),!0):!1;case`composer.toggleMic`:return e.hasConversationComposer()?(e.toggleMic(),!0):!1;case`conversation.toggleHistory`:return e.activeCenterTab()?.kind===`conversation`&&(e.toggleHistory(),!0);case`conversation.previousMessage`:case`conversation.nextMessage`:return e.activeCenterTab()?.kind===`conversation`&&(e.stepMessage(t===`conversation.previousMessage`?-1:1),!0);case`composer.cycleProfile`:return l();case`composer.cycleModel`:return s();case`composer.cyclePermission`:return o();case`composer.cycleThinking`:return c();case`view.toggleLeftDock`:return e.togglePanelDock(`left`),!0;case`view.toggleRightDock`:return e.togglePanelDock(`right`),!0;case`view.toggleBottomDock`:return e.togglePanelDock(`bottom`),!0;case`zoom.in`:case`zoom.out`:case`zoom.reset`:case`composer.send`:return!1}return!1}function d(e){if(t(e))return;let n=vr.find(t=>ei(e,t.defaultBinding));if(!n||n.promptComposerOnly&&!Cr(e.target))return;let r=n.id===`pane.close`;r&&e.preventDefault(),(!_r(e.target)||n.allowInEditable)&&u(n.id)&&!r&&n.id!==`composer.focus`&&n.id!==`composer.cancelMic`&&e.preventDefault()}return{activeCenterTabIndex:r,centerTabIdentity:n,cycleModel:s,cyclePermissionRuleSet:o,cycleThinkingLevel:c,handleWorkbenchShortcut:d,handleZoomShortcut:t,runShortcutCommand:u,selectCenterTabByIndex:a,selectRelativeCenterTab:i,cycleAgentProfile:l}}var Vhe={finished:`Agent finished`,failed:`Agent failed`,interrupted:`Agent interrupted`},Hhe=class{deps;edges;constructor(e){this.deps=e;let t=e.now??Date.now;this.edges=new n_(e=>Mie(e,t()))}seed(e){this.edges.seed(e)}reset(){this.edges.reset()}observe(e){let t=this.edges.observe(e);t&&(t.kind!==`input`&&this.deps.presence(e.id)!==`watching`&&this.deps.unseen.add(e.id),this.deps.deliver(this.event(e,t)))}forget(e){this.edges.forget(e),Nie(e),this.deps.unseen.delete(e)}event(e,t){let n=t.kind===`input`?e.pendingInput:null,r=n?.conversationId??e.id;return{...t,conversationId:e.id,title:n?Vn(e.id,n):Vhe[t.kind],body:[this.deps.projectName(e.projectId),$i(e.title)].filter(Boolean).join(` · `),subAgentName:n&&n.conversationId!==e.id?$i(n.conversationTitle):void 0,open:()=>this.deps.open(r)}}};function M9(){let e=Ds.activeCenterTab;if(e?.kind===`conversation`)return e.id;if(e?.kind===`pending-conversation`)return Xo.get(e.id)?.createdConversationId}function N9(){let e=[],t=M9(),n=new Map(Xr.conversations.map(e=>[e.id,e]));for(;t&&!e.includes(t);)e.push(t),t=n.get(t)?.parentConversationId??void 0;return e}var P9=new Hhe({deliver:o9,presence:a9,projectName:e=>Ds.projects.find(t=>t.id===e)?.name,open:e=>void Rd(e),unseen:Hr});function Uhe(){return Q6({conversations:Xr.conversations,activityById:Xr.conversationActivityById,projectNameById:{}}).filter(e=>e.kind===`attention`).length}function Whe(){let e=Tme({isViewing:e=>N9().includes(e)}),t=oe(()=>{W(()=>{M9(),me(()=>{for(let e of N9())Hr.delete(e)})}),W(()=>{di(Uhe())})}),n=()=>{if(Hr.size!==0)for(let e of N9())Hr.delete(e)},r=[`focus`,`pointerdown`,`keydown`];for(let e of r)window.addEventListener(e,n,{capture:!0,passive:!0});return()=>{for(let e of r)window.removeEventListener(e,n,!0);t(),e(),P9.reset(),di(0)}}function Ghe(e){let t;return{sync(n,r=!1){(r||t?.active!==n.active||t.muted!==n.muted)&&(t=n,e(n).catch(()=>{t===n&&(t=void 0)}))}}}var Khe=5e3,F9=[`keydown`,`pointerdown`,`wheel`];function qhe(){let e=Ghe(e=>nr(`access.presence.report`,e)),t=()=>({active:Eme(),muted:r9.muted}),n=()=>e.sync(t()),r=er(n=>{n&&e.sync(t(),!0)}),i=oe(()=>{W(()=>{r9.muted,n()})}),a=setInterval(n,Khe);for(let e of F9)window.addEventListener(e,n,{capture:!0,passive:!0});return window.addEventListener(`focus`,n),window.addEventListener(`blur`,n),document.addEventListener(`visibilitychange`,n),n(),()=>{clearInterval(a);for(let e of F9)window.removeEventListener(e,n,!0);window.removeEventListener(`focus`,n),window.removeEventListener(`blur`,n),document.removeEventListener(`visibilitychange`,n),r(),i()}}var I9=vf({run:Ut,intervalMs:1e4}),L9,R9,z9,B9;async function Jhe(){let e=Js();Ws(e,`critical`),R9=He(),Fee(),qe(Je());try{let t=await c_();return Ds.config=t,Ds.status=t.status,t.status.capabilities.applicationLogs&&hf(),await Dl(t.wsUrl),await ar(t.wsUrl,()=>Ed.reconcile()),L9?.(),L9=yl({recover:async e=>{e||(c_().then(e=>Md(e.status.tunnel)).catch(()=>void 0),await Ld(),P9.seed(Ds.conversations)),Ds.connection=`connected`},disconnected:()=>{P9.reset(),Ds.connection=`reconnecting`},event:()=>void 0,notice:e=>{if(e.type===`conversation.changed`){let t=e.data.summary,n=Ds.conversations.find(e=>e.id===t.id);if(n&&!T_(n,t,!0))return;P9.observe(t),n||(Ds.conversations=D5(Ds.conversations,t))}else if(e.type===`conversation.deleted`){let t=e.data.conversationId;P9.forget(t),Id().clearPrompt({kind:`conversation`,id:t}),Ds.conversations=Ds.conversations.filter(e=>e.id!==t),Oee(e=>e.kind===`conversation`&&e.id===t),zd([{kind:`conversation`,id:t}])}}}),await Bt(),await Ld(),P9.seed(Ds.conversations),z9?.(),z9=Whe(),B9?.(),B9=qhe(),Ds.connection=`connected`,Ds.error=void 0,Ws(e,`core-ready`),Ws(e,`progressive`),sd(),Lt(),I9.start(),!0}catch(t){throw Gs(e,t),Ds.connection=`error`,Ds.error=t instanceof Error?t.message:String(t),t}}function Yhe(){qs(),R9?.(),R9=void 0,I9.stop(),L9?.(),L9=void 0,z9?.(),z9=void 0,B9?.(),B9=void 0,dd(),Ed.reset(),cee(),Cl(),Ds.connection=`closed`}var Xhe=1e3,Zhe=`Starting Nerve`;function V9(e){if(!e)return{status:Zhe};let t=e.message.trim()||`Starting Nerve`,n=e.progress;if(!n)return{status:t};let{done:r,total:i}=n,a=r!==void 0&&i!==void 0&&i>0;return{status:t,detail:`${n.label}${a?` · ${r.toLocaleString()} of ${i.toLocaleString()}`:``}`,meter:a?{done:r,total:i,fraction:Math.max(0,Math.min(1,r/i))}:void 0}}function H9(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.state==`string`&&[`starting`,`upgrading`,`ready`,`failed`].includes(t.state)&&typeof t.version==`string`)return t}function Qhe(e,t){return e!==void 0&&e!==t.version?`reload`:`resume`}function $he(e){return e?.code===`MIGRATION_ROLLED_BACK`?`rolled-back`:e?.discardable?.length?`discardable`:`generic`}var U9=(e,t,n)=>`${e} ${e===1?t:n}`;function ege(e){let t=e.filter(e=>e.kind===`conversation`),n=e.filter(e=>e.kind===`configuration`),r=U9(n.length,`file`,`files`),i=U9(t.length,`conversation`,`conversations`);return{conversations:t,files:n,heading:t.length&&n.length?`Some data couldn't be read or upgraded`:n.length?`Some settings files couldn't be upgraded`:`Some conversations couldn't be upgraded`,action:t.length&&n.length?`Set aside and continue`:`Set aside ${n.length?r:i} and continue`,confirmation:`These items will be set aside in quarantine. Their original data is kept until you delete it.`}}function tge(e,t){return[e.message,`Code: ${e.code}`,e.phase?`Phase: ${e.phase}`:void 0,e.step?`Step: ${e.step}`:void 0,e.reportPath?`Report: ${e.reportPath}`:void 0,t?`Version: ${t.version}`:void 0,t?`Started: ${t.startedAt}`:void 0].filter(Boolean).join(`
163
+ `)}async function nge(){try{let e=await fetch(`/api/lifecycle`,{credentials:`same-origin`,cache:`no-store`});return e.status===401&&et(),(e.headers.get(`content-type`)??``).includes(`json`)?H9(await e.json()):void 0}catch{return}}async function W9(e,t){try{let n=await fetch(e,{method:`POST`,credentials:`same-origin`,...t===void 0?{}:{headers:{"content-type":`application/json`},body:JSON.stringify(t)}});return n.status===202?H9(await n.json()):void 0}catch{return}}function rge(e){return W9(`/api/lifecycle/retry`,e?.length?{discardIds:e}:void 0)}function ige(){return W9(`/api/lifecycle/rollback`)}var G9=U({phase:`booting`,lifecycle:void 0,view:V9(void 0),retrying:!1,splashRetry:!1,retryError:void 0,reconnecting:!1}),K9,q9=!1,age=e=>new Promise(t=>setTimeout(t,e));async function J9(e){q9=!0;try{for(;;){let t=await nge();if(t&&(G9.lifecycle=t),t?.state===`failed`)return G9.phase=`failed`,G9.retrying=!1,G9.splashRetry=!1,qb(),`failed`;if(t?.state===`ready`)return G9.retrying=!1,K9===void 0?(K9=t.version,G9.phase=`ready`,`boot`):Qhe(K9,t)===`reload`?(location.reload(),`reloading`):(G9.phase=`ready`,G9.reconnecting=!1,`resumed`);e?.();let n=V9(t);G9.view=n,Yb(n),await age(500)}}finally{q9=!1}}async function oge(){return G9.phase=`booting`,await J9()===`boot`}async function sge(e){return Y9(()=>rge(e),`Nerve could not start another attempt. Please try again.`)}async function cge(){await Y9(ige,`Nerve could not restore your previous data.`)}async function Y9(e,t){G9.retryError=void 0;let n=await e();if(!n)return G9.retryError=t,!1;G9.retrying=!0,G9.splashRetry=Jb(),G9.lifecycle=n;let r=K9===void 0,i=await J9();return r&&i===`boot`}function lge(){q9||K9===void 0||J9(()=>{G9.reconnecting=!0})}function uge(){let e,t=()=>{e||q9||G9.phase!==`ready`||(e=setTimeout(()=>{e=void 0,lge()},Xhe))},n=()=>{xl()&&rr()&&(clearTimeout(e),e=void 0)},r=[wl(e=>e?n():t()),er(e=>e?n():t()),rt(t)];return()=>{clearTimeout(e);for(let e of r)e()}}var dge=O(`<p class="text-ui text-muted-foreground"> </p>`),fge=O(`<div class="grid min-w-0 gap-2" role="status" aria-live="polite"><div class="flex items-center gap-2"><!> <p class="text-ui"> </p></div> <!> <!></div>`);function X9(e,t){c(t,!0);var n=fge(),r=q(n),i=q(r);dn(i,{class:`size-4 shrink-0`});var a=G(i,2),o=z(a,!0);x(r);var s=G(r,2),u=e=>{var n=dge(),r=z(n,!0);F(()=>w(r,t.view.detail)),k(e,n)};l(s,e=>{t.view.detail&&e(u)});var d=G(s,2),f=e=>{md(e,{get value(){return t.view.meter.done},get max(){return t.view.meter.total},"aria-label":`Startup progress`})};l(d,e=>{t.view.meter&&e(f)}),x(n),F(()=>w(o,t.view.status)),k(e,n),D()}var pge=O(`<div class="fixed inset-0 z-[1000] grid place-items-center bg-scrim backdrop-blur-sm"><div class="w-72 max-w-[calc(100vw-2rem)] rounded-lg border bg-card p-4 text-card-foreground shadow-overlay"><!></div></div>`);function mge(e,n){c(n,!0);let r=L(()=>G9.lifecycle),i=L(()=>t(r)&&t(r).state!==`ready`?V9(t(r)):{status:`Reconnecting to Nerve…`});var a=f(),o=R(a),s=e=>{var n=pge(),r=q(n);X9(q(r),{get view(){return t(i)}}),x(r),x(n),k(e,n)};l(o,e=>{G9.reconnecting&&G9.phase===`ready`&&e(s)}),k(e,a),D()}var hge=O(`<!> Technical details`,1),gge=O(`<!> `,1),_ge=O(`<pre class="mt-2 max-h-48 overflow-auto rounded-md bg-well p-2 font-mono text-ui whitespace-pre-wrap break-all select-text"> </pre> <!>`,1),vge=O(`<!> <!>`,1),yge=O(`<p class="text-ui text-muted-foreground">Stop the Nerve server, then start the previous version.</p>`),bge=O(`<div class="flex justify-end"><!></div>`),xge=O(`<div class="grid gap-1"><h1 class="text-title font-medium">Your previous data was restored</h1> <p class="text-ui text-muted-foreground">Nerve undid the upgrade and your data is back to how it was. Quit
164
+ Nerve and reinstall the previous version to keep using it.</p></div> <!> <!> <!>`,1),Sge=O(`<li class="grid gap-0.5 px-3 py-2 text-ui"><span class="break-words"> </span> <span class="text-ui break-words text-muted-foreground"> </span></li>`),Cge=O(`<div class="px-3 pt-2 text-ui font-medium text-muted-foreground"> </div> <ul class="grid divide-y"></ul>`,1),wge=O(`<p class="text-ui text-destructive break-words"> </p>`),Tge=O(`<p class="text-ui text-destructive"> </p>`),Ege=O(`<div class="grid gap-1"><h1 class="text-title font-medium"> </h1> <p class="text-ui text-muted-foreground break-words"><!></p></div> <!> <!> <!> <!> <div class="flex flex-wrap items-center justify-end gap-2"><!> <!> <!></div>`,1),Dge=O(`<div><div class="grid w-full max-w-xl gap-4 rounded-lg border bg-card p-6 shadow-overlay [-webkit-app-region:no-drag]"><!></div></div> <!> <!>`,1);function Oge(e,n){c(n,!0);let r=e=>{var n=f(),r=R(n),i=e=>{var n=f(),r=R(n);H(r,()=>yd,(e,n)=>{n(e,{children:(e,n)=>{var r=vge(),i=R(r);H(i,()=>bd,(e,t)=>{t(e,{class:`group flex items-center gap-1 text-ui text-muted-foreground hover:text-foreground`,children:(e,t)=>{var n=hge(),r=R(n);mn(r,{class:`size-3.5 transition-transform group-data-[state=open]:rotate-90`}),y(),k(e,n)},$$slots:{default:!0}})});var a=G(i,2);H(a,()=>Nee,(e,n)=>{n(e,{children:(e,n)=>{var r=_ge(),i=R(r),a=z(i,!0),o=G(i,2);Q(o,{class:`mt-2`,size:`sm`,variant:`outline`,onclick:E,children:(e,n)=>{var r=gge(),i=R(r);sr(i,{});var a=G(i,1,!0);F(()=>w(a,t(_)?`Copied`:`Copy diagnostics`)),k(e,r)},$$slots:{default:!0}}),F(()=>w(a,t(p))),k(e,r)},$$slots:{default:!0}})}),k(e,r)},$$slots:{default:!0}})}),k(e,n)};l(r,e=>{t(o)&&e(i)}),k(e,n)},i=e=>{var n=f(),r=R(n),i=e=>{Q(e,{class:`mr-auto`,variant:`ghost`,onclick:()=>void fi(),children:(e,t)=>{y();var n=g(`Quit Nerve`);k(e,n)},$$slots:{default:!0}})};l(r,e=>{t(h)&&e(i)}),k(e,n)},a=L(()=>G9.lifecycle),o=L(()=>t(a)?.failure),s=L(()=>$he(t(o))),u=L(()=>t(o)?.discardable??[]),d=L(()=>ege(t(u))),p=L(()=>t(o)?tge(t(o),t(a)):``),m=L(()=>G9.retrying),h=L(()=>li.isDesktop),_=Y(!1),b=Y(void 0),S=Y(void 0),C=`[-webkit-app-region:no-drag]`;async function E(){try{await navigator.clipboard.writeText(t(p)),B(_,!0),setTimeout(()=>B(_,!1),1500)}catch{}}var O=f(),A=R(O),j=e=>{var c=Dge(),p=R(c),_=q(p),E=q(_),D=e=>{{let n=L(()=>V9(t(a)?.state===`failed`?void 0:t(a)));X9(e,{get view(){return t(n)}})}},O=e=>{var n=xge(),i=G(R(n),2),a=e=>{var t=yge();k(e,t)};l(i,e=>{t(h)||e(a)});var o=G(i,2);r(o);var s=G(o,2),c=e=>{var t=bge(),n=q(t);Q(n,{onclick:()=>void fi(),children:(e,t)=>{y();var n=g(`Quit Nerve`);k(e,n)},$$slots:{default:!0}}),x(t),k(e,t)};l(s,e=>{t(h)&&e(c)}),k(e,n)},A=e=>{var a=Ege(),c=R(a),p=q(c),m=z(p,!0),h=G(p,2),_=q(h),S=e=>{var n=g();F(()=>w(n,`Nerve can continue without ${t(u).length===1?`this item`:`these items`}. Review ${t(u).length===1?`it`:`them`} below${t(o)?.rollbackAvailable?`, or restore your previous data`:``}.`)),k(e,n)},C=e=>{var n=g();F(()=>w(n,t(o)?.message??`Nerve reported a startup failure.`)),k(e,n)};l(_,e=>{t(s)===`discardable`?e(S):e(C,-1)}),x(h),x(c);var T=G(c,2),E=e=>{fn(e,{class:`max-h-48 rounded-md border bg-well`,children:(e,n)=>{var r=f(),i=R(r);v(i,17,()=>[{label:`Conversations`,items:t(d).conversations,note:``},{label:`Settings files`,items:t(d).files,note:`Original files are kept in quarantine.`}],e=>e.label,(e,n)=>{var r=f(),i=R(r),a=e=>{var r=Cge(),i=R(r),a=z(i,!0),o=G(i,2);v(o,21,()=>t(n).items,e=>e.id,(e,n)=>{var r=Sge(),i=q(r),a=z(i,!0),o=G(i,2),s=z(o,!0);x(r),F(()=>{w(a,t(n).title||t(n).id),w(s,t(n).reason)}),k(e,r)}),x(o),F(()=>w(a,t(n).label)),k(e,r)};l(i,e=>{t(n).items.length&&e(a)}),k(e,r)}),k(e,r)},$$slots:{default:!0}})};l(T,e=>{t(s)===`discardable`&&e(E)});var D=G(T,2);r(D);var O=G(D,2),A=e=>{var n=wge(),r=z(n,!0);F(()=>w(r,t(o).message)),k(e,n)},j=L(()=>t(s)===`discardable`&&t(o)?.message.startsWith(`Rollback failed`));l(O,e=>{t(j)&&e(A)});var M=G(O,2),N=e=>{var t=Tge(),n=z(t,!0);F(()=>w(n,G9.retryError)),k(e,t)};l(M,e=>{G9.retryError&&e(N)});var P=G(M,2),I=q(P);i(I);var ee=G(I,2),te=e=>{Q(e,{variant:`outline`,onclick:()=>B(b,`rollback`),children:(e,t)=>{y();var n=g(`Restore previous version`);k(e,n)},$$slots:{default:!0}})};l(ee,e=>{t(o)?.rollbackAvailable&&e(te)});var ne=G(ee,2),re=e=>{Q(e,{onclick:()=>B(b,`discard`),children:(e,n)=>{y();var r=g();F(()=>w(r,t(d).action)),k(e,r)},$$slots:{default:!0}})},ie=e=>{Q(e,{get onclick(){return n.onRetry},children:(e,t)=>{y();var n=g(`Try again`);k(e,n)},$$slots:{default:!0}})};l(ne,e=>{t(s)===`discardable`?e(re):t(o)?.retryable&&e(ie,1)}),x(P),F(()=>w(m,t(s)===`discardable`?t(d).heading:`Nerve couldn't start`)),k(e,a)};l(E,e=>{t(m)?e(D):t(s)===`rolled-back`?e(O,1):e(A,-1)}),x(_),x(p),te(p,e=>B(S,e),()=>t(S));var j=G(p,2);{let e=L(()=>({to:t(S)})),r=L(()=>t(b)===`discard`),i=L(()=>t(d).conversations.length?`Discard and continue?`:`Reset to defaults?`),a=L(()=>`${t(d).confirmation} Nerve then continues starting, which can take a few minutes.`),o=L(()=>t(d).conversations.length?`Discard and continue`:`Reset and continue`);jn(j,{class:C,get portalProps(){return t(e)},get open(){return t(r)},get title(){return t(i)},get description(){return t(a)},get confirmLabel(){return t(o)},destructive:!0,onConfirm:()=>n.onDiscardAndRetry(t(u).map(e=>e.id)),onOpenChange:e=>{e||B(b,void 0)}})}var M=G(j,2);{let e=L(()=>({to:t(S)})),r=L(()=>t(b)===`rollback`);jn(M,{class:C,get portalProps(){return t(e)},get open(){return t(r)},title:`Restore previous version?`,description:`This undoes the upgrade and restores your data as it was before. Afterwards you need to quit Nerve and reinstall the previous version.`,confirmLabel:`Restore previous version`,get onConfirm(){return n.onRollback},onOpenChange:e=>{e||B(b,void 0)}})}F(()=>X(p,1,T([`fixed inset-0 z-[1000] grid place-items-center bg-background p-4 text-foreground`,t(h)&&`[-webkit-app-region:drag]`]))),k(e,c)};l(A,e=>{G9.phase===`failed`&&!G9.splashRetry&&e(j)}),k(e,O),D()}var kge=O(`<!> <!> <!>`,1);function Age(e,r){c(r,!0);let i=Phe();pe(i);let a=L(()=>Xr.activeProject);W(()=>{t(a)?.id&&u4.load(t(a).id)}),W(()=>d4());let o=Y(void 0);W(()=>{let e=Wo.conversationId;if(B(o,void 0),!e)return;let t=I6(e);return B(o,t.store,!0),t.ready.catch(()=>void 0),t.release});let s=new f4;W(()=>{t(a)?.id&&s.load({scope:`project`,projectId:t(a).id})}),W(()=>s.observe());let u=L(()=>Xr.activeCenterTab),d=L(()=>Xr.centerTabs),p=L(Fn),h=L(()=>U4(K4.profiles(t(a)?.id)).map(e=>e.name)),g=L(()=>Ho(T5.summaries(t(a)?.id)).map(e=>e.id)),_=L(()=>o5(t(o)?.snapshot)),v=L(()=>Sf.settingsDraft),y=L(()=>dz(Gt.models,Gt.authProviders,s.result?.status===`available`?s.result.effective.scopedModels:void 0)),b=L(()=>t(v)?.ui.zoomLevel??Ze.level),x=L(()=>Ks(Us.phase));W(()=>{t(x)&&Kb()}),W(()=>{if(!t(p)||typeof window>`u`)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)});function S(){$d.isPhone?(Ds.projectPickerPath=void 0,Ds.projectPickerOpen=!0):Ds.projectSwitcherOpen=!0}function C(){Ds.projectPickerPath=void 0,Ds.projectPickerOpen=!0}function w(){Zd(`conversations`,$d.isCompact),Br()}function T(){s8.show(t(a)?.id)}function E(){let e=typeof window>`u`?``:window.getSelection()?.toString().trim()??``,t=e&&e.length<=200&&!e.includes(`
165
+ `)?e:void 0;Zd(`search`,$d.isCompact),d8.requestFocus(t)}let O=Bhe({currentZoomLevel:()=>t(b),setUiZoomLevel:Rt,centerTabs:()=>t(d),activeCenterTab:()=>t(u),selectCenterTab:qo,newConversation:Pd,openProjectPicker:S,openFolder:C,closeCenterTab:Ln,closeCenterTabs:Pn,centerTabsExcept:Nd,refreshCenterTab:h7,focusProjectSearch:w,openQuickOpen:T,focusContentSearch:E,hasConversationComposer:()=>{let e=b4();return!!e&&!(e.target.kind===`conversation`&&e.target.readOnly)},canStop:()=>t(_),abortActiveRun:async()=>{await t(o)?.control(`stop`)},composerEscape:hl,toggleMic:_l,toggleHistory:tl,stepMessage:il,selectedPermissionRuleSetId:()=>b4()?.resolution?.settings.permissionRuleSetId??`autonomous`,permissionRuleSetIds:()=>t(g),setComposerPermissionRuleSet:async e=>{await b4()?.setPermission(e)},usableModels:()=>t(y),selectedModelKey:()=>{let e=b4()?.resolution?.settings.model;return e?QR(e):``},setComposerModel:async e=>{await b4()?.setModel(e)},selectedThinkingLevel:()=>b4()?.resolution?.settings.reasoningLevel??`off`,setComposerThinkingLevel:async e=>{await b4()?.setReasoning(e)},agentProfileNames:()=>t(h),selectedAgentProfile:()=>b4()?.appliedProfile??``,setComposerAgentProfile:async e=>{await b4()?.setProfile(e)},togglePanelDock:e=>Hd(e,$d.isCompact)});W(()=>{let e=t(v)?.notifications;e&&vee(e)});let A;W(()=>{let e=t(v)?.desktop.closeToTray;li.isDesktop&&e!==void 0&&e!==A&&(A=e,lee(e))});let j=SC(e=>{e?KS(e):qS()});W(()=>{j.update(Us.progressiveActive,t(a)?.id)}),W(()=>{if(!Us.progressiveActive)return;let e=Ia(),t=sC();return()=>{e(),t()}});let M,N=!1;async function P(){await oge()&&await F()}async function F(){try{if(!await Jhe())return}catch{return}si()?.app.reportRendererCoreReady().catch(()=>void 0),pee(),M?.(),M=uge(),N&&Vt()}async function I(e){await sge(e)&&await F()}le(()=>{let e=zhe(),t=gee(),n=uee();return N=window.location.pathname===`/settings`||window.location.pathname===`/settings/`,N&&window.history.replaceState({},``,`/${window.location.search}${window.location.hash}`),window.addEventListener(`keydown`,O.handleWorkbenchShortcut,{capture:!0}),P(),()=>{M?.(),window.removeEventListener(`keydown`,O.handleWorkbenchShortcut,{capture:!0}),n(),t(),e(),Yhe()}});var ee=kge(),te=R(ee),ne=e=>{var t=f(),i=R(t);n(i,()=>r.children??m),k(e,t)};l(te,e=>{t(x)&&e(ne)});var re=G(te,2);Oge(re,{onRetry:()=>void I(),onDiscardAndRetry:e=>void I(e),onRollback:()=>void cge()}),mge(G(re,2),{}),k(e,ee),D()}function jge(e,n){c(n,!0);let r=L(()=>li.developmentSlot?`[DEV ${li.developmentSlot}] nerve`:`nerve`);s(`629kra`,e=>{de(()=>{ee.title=t(r)??``})}),nh(e,{onGateVisibleChange:e=>e?qb():Jb(),children:(e,t)=>{Age(e,{children:(e,t)=>{She(e,{})},$$slots:{default:!0}})},$$slots:{default:!0}}),D()}function Mge(e,t){c(t,!1),he();var n=f(),r=R(n),i=e=>{jge(e,{})};l(r,e=>{e(i,-1)}),k(e,n),D()}var Nge=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pge(e,t){let n=V(t,Nge);Zg(e,P({class:`toaster group`,style:`--normal-bg: var(--color-popover); --normal-text: var(--color-popover-foreground); --normal-border: var(--color-border);`},()=>n,{loadingIcon:e=>{dn(e,{class:`size-4`})},successIcon:e=>{Wn(e,{class:`size-4`})},errorIcon:e=>{oie(e,{class:`size-4`})},infoIcon:e=>{Un(e,{class:`size-4`})},warningIcon:e=>{bn(e,{class:`size-4`})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}}))}var Fge=O(`<!> <!>`,1);function Ige(e,n){c(n,!1),he(),Bf(e,{get client(){return Be},children:(e,n)=>{var r=Fge(),i=R(r);Mge(i,{});var a=G(i,2),o=e=>{{let n=ve(()=>Wi(Xe.theme));Pge(e,{position:`bottom-right`,closeButton:!0,get theme(){return t(n)}})}};l(a,e=>{li.isDesktop||e(o)}),k(e,r)},$$slots:{default:!0}}),D()}var Lge=`false`,Rge=`false`,Z9=Lge===`true`,zge=Rge===`true`;function Bge(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,Z9||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await Os(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!zge){if(Z9)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function Vge(e){let t=vf({run:e.checkForUpdate,intervalMs:e.intervalMs??36e5,minGapMs:e.minimumCheckIntervalMs??6e4,onError:()=>void 0,clock:e.clock,environment:_f(e.window,e.document)});return t.start(),()=>t.stop()}var Hge=`nerve-pwa-update`;function Uge(){if(!Wge())return;let e,t=Bge({immediate:!0,onNeedRefresh:()=>{go.message(`Update available`,{id:Hge,description:`A new version of Nerve is ready.`,duration:1/0,dismissible:!1,action:{label:`Reload`,onClick:()=>{t().catch(e=>{console.error(`Failed to activate the Nerve update.`,e)})}}})},onRegisteredSW:(t,n)=>{e?.(),e=n?Vge({checkForUpdate:async()=>{await n.update()}}):void 0},onRegisterError:e=>{console.error(`Failed to register the Nerve service worker.`,e)}})}function Wge(){return`serviceWorker`in navigator&&window.nerveDesktop?.kind!==`electron`}var Q9=null;try{Q9=window.sessionStorage.getItem(`nerve.initialZoomLevel`),window.sessionStorage.removeItem(`nerve.initialZoomLevel`)}catch{}Q9!==null&&Ye(Number(Q9));var $9=document.getElementById(`app`);if(!$9)throw Error(`Missing #app mount target.`);Uge(),_(Ige,{target:$9});export{g8 as $,jw as $n,X_ as $r,iF as $t,Sle as A,IT as An,mb as Ar,yJ as At,woe as B,Qw as Bn,Uv as Br,Lz as Bt,Aue as C,RT as Cn,Ub as Cr,C4 as Ct,e7 as D,HT as Dn,Wb as Dr,AZ as Dt,t7 as E,BT as En,Nb as Er,MZ as Et,d5 as F,gT as Fn,sy as Fr,iV as Ft,Doe as G,Hw as Gn,Mv as Gr,hz as Gt,E8 as H,qw as Hn,zv as Hr,xz as Ht,I8 as I,mT as In,ay as Ir,nB as It,goe as J,zw as Jn,uv as Jr,QR as Jt,A8 as K,Vw as Kn,Cv as Kr,fz as Kt,P8 as L,fT as Ln,iy as Lr,Bz as Lt,E5 as M,LT as Mn,dy as Mr,UU as Mt,T5 as N,ST as Nn,ly as Nr,HU as Nt,$5 as O,WT as On,Mb as Or,OZ as Ot,m5 as P,bT as Pn,oy as Pr,uH as Pt,h8 as Q,Pw as Qn,Q_ as Qr,IF as Qt,Soe as R,eT as Rn,ty as Rr,Wz as Rt,Nue as S,PT as Sn,ux as Sr,E4 as St,n7 as T,NT as Tn,Bb as Tr,f4 as Tt,O8 as U,Gw as Un,Rv as Ur,_z as Ut,D8 as V,Jw as Vn,Hv as Vr,Ez as Vt,Toe as W,Uw as Wn,Fv as Wr,vz as Wt,x8 as X,Iw as Xn,iv as Xr,JR as Xt,C8 as Y,Lw as Yn,av as Yr,YR as Yt,S8 as Z,Fw as Zn,nv as Zr,ZR as Zt,Iue as _,mp as _i,JD as _n,iC as _r,K4 as _t,dhe as a,O_ as ai,qP as an,uw as ar,D6 as at,Mue as b,sD as bn,JS as br,D4 as bt,y9 as c,qh as ci,YN as cn,rw as cr,O3 as ct,U7 as d,Eh as di,zO as dn,UC as dr,S3 as dt,G_ as ei,NF as en,Ow as er,m8 as et,W7 as f,wh as fi,UO as fn,hC as fr,_3 as ft,f7 as g,Vp as gi,AO as gn,gC as gr,Y4 as gt,T7 as h,sh as hi,kO as hn,yC as hr,J4 as ht,v9 as i,k_ as ii,GP as in,vw as ir,Dae as it,Tce as j,KT as jn,cb as jr,LK as jt,K5 as k,FT as kn,kb as kr,EZ as kt,r9 as l,Wh as li,qN as ln,wte as lr,E3 as lt,k7 as m,xh as mi,jO as mn,_C as mr,m3 as mt,C9 as n,B_ as ni,NP as nn,ww as nr,d8 as nt,b9 as o,eg as oi,MP as on,lw as or,D3 as ot,A7 as p,Sh as pi,HO as pn,vC as pr,g3 as pt,xoe as q,Bw as qn,pv as qr,rz as qt,x9 as r,z_ as ri,$P as rn,yw as rr,s8 as rt,uhe as s,Zh as si,XN as sn,sw as sr,k3 as st,The as t,U_ as ti,EF as tn,Tw as tr,doe as tt,kme as u,Bh as ui,NN as un,WC as ur,C3 as ut,o7 as v,XD as vn,aC as vr,U4 as vt,Q5 as w,zT as wn,Hb as wr,S4 as wt,s7 as x,$T as xn,Hx as xr,T4 as xt,jue as y,UD as yn,QS as yr,I4 as yt,Eoe as z,$w as zn,Wv as zr,Gz as zt};