@spencerboucher/switchyard 0.6.0 → 0.7.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 (163) hide show
  1. package/README.md +6 -6
  2. package/dist/bridge/switchyard-terminal.js +62 -1
  3. package/dist/switchyard.mjs +869 -643
  4. package/package.json +1 -1
  5. package/web-dist/assets/AutomationView-BIW_pO0M.js +2 -0
  6. package/web-dist/assets/AutomationView-BIW_pO0M.js.map +1 -0
  7. package/web-dist/assets/Badge-BiDp7NKI.js +2 -0
  8. package/web-dist/assets/Badge-BiDp7NKI.js.map +1 -0
  9. package/web-dist/assets/InteractionCard-CWxyDv81.js +6 -0
  10. package/web-dist/assets/InteractionCard-CWxyDv81.js.map +1 -0
  11. package/web-dist/assets/{Menu-GymfuHGP.js → Menu-BDt1bxwz.js} +2 -2
  12. package/web-dist/assets/{Menu-GymfuHGP.js.map → Menu-BDt1bxwz.js.map} +1 -1
  13. package/web-dist/assets/{SegmentedControl-ChdVilXb.js → SegmentedControl-D-2BCZzd.js} +2 -2
  14. package/web-dist/assets/{SegmentedControl-ChdVilXb.js.map → SegmentedControl-D-2BCZzd.js.map} +1 -1
  15. package/web-dist/assets/Tabs-ByiPklAw.js +184 -0
  16. package/web-dist/assets/Tabs-ByiPklAw.js.map +1 -0
  17. package/web-dist/assets/TextArea-BYr88SnV.js +2 -0
  18. package/web-dist/assets/TextArea-BYr88SnV.js.map +1 -0
  19. package/web-dist/assets/attention-Bya8XHKI.js +2 -0
  20. package/web-dist/assets/attention-Bya8XHKI.js.map +1 -0
  21. package/web-dist/assets/automations-DiXKRcnE.js +2 -0
  22. package/web-dist/assets/automations-DiXKRcnE.js.map +1 -0
  23. package/web-dist/assets/board-BrLaJwLJ.js +10 -0
  24. package/web-dist/assets/board-BrLaJwLJ.js.map +1 -0
  25. package/web-dist/assets/c-Cz4nF6n_.js +1 -0
  26. package/web-dist/assets/c-SSSlmE39.js +2 -0
  27. package/web-dist/assets/c-SSSlmE39.js.map +1 -0
  28. package/web-dist/assets/code-DKLO8bzz.js +11 -0
  29. package/web-dist/assets/code-DKLO8bzz.js.map +1 -0
  30. package/web-dist/assets/cpp-Cts1PyIS.js +2 -0
  31. package/web-dist/assets/cpp-Cts1PyIS.js.map +1 -0
  32. package/web-dist/assets/cpp-DzjeI0uH.js +1 -0
  33. package/web-dist/assets/css-BGIxQoYs.js +2 -0
  34. package/web-dist/assets/css-BGIxQoYs.js.map +1 -0
  35. package/web-dist/assets/css-DgaLhXQH.js +1 -0
  36. package/web-dist/assets/describe-DnvH6_fl.js +5 -0
  37. package/web-dist/assets/describe-DnvH6_fl.js.map +1 -0
  38. package/web-dist/assets/diff-woXpYk--.js +2 -0
  39. package/web-dist/assets/diff-woXpYk--.js.map +1 -0
  40. package/web-dist/assets/{dist-Bgkh2hc5.js → dist-BE_V9dwJ.js} +2 -2
  41. package/web-dist/assets/dist-BE_V9dwJ.js.map +1 -0
  42. package/web-dist/assets/dockerfile-IyjqRm3v.js +2 -0
  43. package/web-dist/assets/dockerfile-IyjqRm3v.js.map +1 -0
  44. package/web-dist/assets/enroll-DUDpbJoB.js +2 -0
  45. package/web-dist/assets/enroll-DUDpbJoB.js.map +1 -0
  46. package/web-dist/assets/github-dark-C-LZuMrd.js +2 -0
  47. package/web-dist/assets/github-dark-C-LZuMrd.js.map +1 -0
  48. package/web-dist/assets/github-light-EUqPIrTm.js +2 -0
  49. package/web-dist/assets/github-light-EUqPIrTm.js.map +1 -0
  50. package/web-dist/assets/go-rLFTqkRN.js +2 -0
  51. package/web-dist/assets/go-rLFTqkRN.js.map +1 -0
  52. package/web-dist/assets/html-BMn1ogTm.js +2 -0
  53. package/web-dist/assets/html-BMn1ogTm.js.map +1 -0
  54. package/web-dist/assets/html-BWDvXlHg.js +1 -0
  55. package/web-dist/assets/index-DvRcMGEe.css +2 -0
  56. package/web-dist/assets/index-vIzH1m8u.js +11 -0
  57. package/web-dist/assets/index-vIzH1m8u.js.map +1 -0
  58. package/web-dist/assets/java-BtIQNnN0.js +2 -0
  59. package/web-dist/assets/java-BtIQNnN0.js.map +1 -0
  60. package/web-dist/assets/java-_ATy9zCa.js +1 -0
  61. package/web-dist/assets/javascript-BzbQS41l.js +2 -0
  62. package/web-dist/assets/javascript-BzbQS41l.js.map +1 -0
  63. package/web-dist/assets/javascript-CpIGwZ_Y.js +1 -0
  64. package/web-dist/assets/json-qhed-kSA.js +2 -0
  65. package/web-dist/assets/json-qhed-kSA.js.map +1 -0
  66. package/web-dist/assets/jsonc-CYpm1nAK.js +2 -0
  67. package/web-dist/assets/jsonc-CYpm1nAK.js.map +1 -0
  68. package/web-dist/assets/jsx-C4yDKi0A.js +1 -0
  69. package/web-dist/assets/jsx-D3KKoC5L.js +2 -0
  70. package/web-dist/assets/jsx-D3KKoC5L.js.map +1 -0
  71. package/web-dist/assets/logic-xb-QF00E.js +2 -0
  72. package/web-dist/assets/logic-xb-QF00E.js.map +1 -0
  73. package/web-dist/assets/lua-DjuecEsk.js +2 -0
  74. package/web-dist/assets/lua-DjuecEsk.js.map +1 -0
  75. package/web-dist/assets/lua-fPRBWD-V.js +1 -0
  76. package/web-dist/assets/{more-CRGJsz6E.js → more-BP5x45cs.js} +2 -2
  77. package/web-dist/assets/{more-CRGJsz6E.js.map → more-BP5x45cs.js.map} +1 -1
  78. package/web-dist/assets/now--XjJC37b.js +2 -0
  79. package/web-dist/assets/now--XjJC37b.js.map +1 -0
  80. package/web-dist/assets/python-gzcpVVnB.js +2 -0
  81. package/web-dist/assets/python-gzcpVVnB.js.map +1 -0
  82. package/web-dist/assets/ruby-Bx-U2qjP.js +2 -0
  83. package/web-dist/assets/ruby-Bx-U2qjP.js.map +1 -0
  84. package/web-dist/assets/rust-DpiIf5JO.js +2 -0
  85. package/web-dist/assets/rust-DpiIf5JO.js.map +1 -0
  86. package/web-dist/assets/scss-8bKmll0B.js +2 -0
  87. package/web-dist/assets/scss-8bKmll0B.js.map +1 -0
  88. package/web-dist/assets/send-BKjswHxB.js +2 -0
  89. package/web-dist/assets/send-BKjswHxB.js.map +1 -0
  90. package/web-dist/assets/settings-D8T1esWq.js +7 -0
  91. package/web-dist/assets/settings-D8T1esWq.js.map +1 -0
  92. package/web-dist/assets/shared-CZ7fcu_B.js +3 -0
  93. package/web-dist/assets/shared-CZ7fcu_B.js.map +1 -0
  94. package/web-dist/assets/shellscript-CVTB3cr6.js +1 -0
  95. package/web-dist/assets/shellscript-CqHdAlCp.js +2 -0
  96. package/web-dist/assets/shellscript-CqHdAlCp.js.map +1 -0
  97. package/web-dist/assets/sliders-horizontal-DAoirila.js +2 -0
  98. package/web-dist/assets/sliders-horizontal-DAoirila.js.map +1 -0
  99. package/web-dist/assets/sql-CNu3Or2W.js +2 -0
  100. package/web-dist/assets/sql-CNu3Or2W.js.map +1 -0
  101. package/web-dist/assets/sql-CfM2IJm3.js +1 -0
  102. package/web-dist/assets/states--geW2Ntl.js +2 -0
  103. package/web-dist/assets/states--geW2Ntl.js.map +1 -0
  104. package/web-dist/assets/swift-CyEgAFGc.js +2 -0
  105. package/web-dist/assets/swift-CyEgAFGc.js.map +1 -0
  106. package/web-dist/assets/terminal-login-BJxV78au.js +2 -0
  107. package/web-dist/assets/terminal-login-BJxV78au.js.map +1 -0
  108. package/web-dist/assets/toml-CcmNWLt0.js +2 -0
  109. package/web-dist/assets/toml-CcmNWLt0.js.map +1 -0
  110. package/web-dist/assets/tsx-BOvsFOI6.js +2 -0
  111. package/web-dist/assets/tsx-BOvsFOI6.js.map +1 -0
  112. package/web-dist/assets/tsx-CGosfAUg.js +1 -0
  113. package/web-dist/assets/typescript-Bb1J8qyy.js +1 -0
  114. package/web-dist/assets/typescript-j_1H8WHN.js +2 -0
  115. package/web-dist/assets/typescript-j_1H8WHN.js.map +1 -0
  116. package/web-dist/assets/useNow-jxdoOC_1.js +2 -0
  117. package/web-dist/assets/{useNow-Bc_NlDY3.js.map → useNow-jxdoOC_1.js.map} +1 -1
  118. package/web-dist/assets/xml-DuKfbPI6.js +1 -0
  119. package/web-dist/assets/xml-WY0zc4PG.js +2 -0
  120. package/web-dist/assets/xml-WY0zc4PG.js.map +1 -0
  121. package/web-dist/assets/yaml-DDA_XMNu.js +1 -0
  122. package/web-dist/assets/yaml-DijMHRDA.js +2 -0
  123. package/web-dist/assets/yaml-DijMHRDA.js.map +1 -0
  124. package/web-dist/index.html +4 -3
  125. package/web-dist/sw.js +1 -1
  126. package/web-dist/sw.js.map +1 -1
  127. package/web-dist/assets/AutomationView-DgZn3ltn.js +0 -2
  128. package/web-dist/assets/AutomationView-DgZn3ltn.js.map +0 -1
  129. package/web-dist/assets/InteractionCard-cvPWKSu1.js +0 -4
  130. package/web-dist/assets/InteractionCard-cvPWKSu1.js.map +0 -1
  131. package/web-dist/assets/Markdown-jXkvZeRp.js +0 -31
  132. package/web-dist/assets/Markdown-jXkvZeRp.js.map +0 -1
  133. package/web-dist/assets/Overlay-oYnnwvFM.js +0 -2
  134. package/web-dist/assets/Overlay-oYnnwvFM.js.map +0 -1
  135. package/web-dist/assets/TextArea-BsQHOQMe.js +0 -2
  136. package/web-dist/assets/TextArea-BsQHOQMe.js.map +0 -1
  137. package/web-dist/assets/attention-Bxg9W15n.js +0 -2
  138. package/web-dist/assets/attention-Bxg9W15n.js.map +0 -1
  139. package/web-dist/assets/automations-DdB97dnL.js +0 -2
  140. package/web-dist/assets/automations-DdB97dnL.js.map +0 -1
  141. package/web-dist/assets/board-s4LuDPcg.js +0 -10
  142. package/web-dist/assets/board-s4LuDPcg.js.map +0 -1
  143. package/web-dist/assets/code-B0KXn7lD.js +0 -8
  144. package/web-dist/assets/code-B0KXn7lD.js.map +0 -1
  145. package/web-dist/assets/describe-C_3FJuSs.js +0 -5
  146. package/web-dist/assets/describe-C_3FJuSs.js.map +0 -1
  147. package/web-dist/assets/dist-Bgkh2hc5.js.map +0 -1
  148. package/web-dist/assets/enroll-DijmoolY.js +0 -2
  149. package/web-dist/assets/enroll-DijmoolY.js.map +0 -1
  150. package/web-dist/assets/index-C5n2QB-Y.css +0 -2
  151. package/web-dist/assets/index-Cf6ZUCfK.js +0 -11
  152. package/web-dist/assets/index-Cf6ZUCfK.js.map +0 -1
  153. package/web-dist/assets/logic-D_Eq9DMW.js +0 -2
  154. package/web-dist/assets/logic-D_Eq9DMW.js.map +0 -1
  155. package/web-dist/assets/now-D6lDofYy.js +0 -2
  156. package/web-dist/assets/now-D6lDofYy.js.map +0 -1
  157. package/web-dist/assets/settings-Csal1F-W.js +0 -8
  158. package/web-dist/assets/settings-Csal1F-W.js.map +0 -1
  159. package/web-dist/assets/sliders-horizontal-S3tmwxsP.js +0 -2
  160. package/web-dist/assets/sliders-horizontal-S3tmwxsP.js.map +0 -1
  161. package/web-dist/assets/states-DrTQuYXw.js +0 -2
  162. package/web-dist/assets/states-DrTQuYXw.js.map +0 -1
  163. package/web-dist/assets/useNow-Bc_NlDY3.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scss-8bKmll0B.js","names":["css","css_default","lang","scss_default"],"sources":["../../../../node_modules/.pnpm/@shikijs+langs@4.5.0/node_modules/@shikijs/langs/dist/scss.mjs"],"sourcesContent":["import css from './css.mjs'\n\nconst lang = Object.freeze(JSON.parse(\"{\\\"displayName\\\":\\\"SCSS\\\",\\\"name\\\":\\\"scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable_setting\\\"},{\\\"include\\\":\\\"#at_rule_forward\\\"},{\\\"include\\\":\\\"#at_rule_use\\\"},{\\\"include\\\":\\\"#at_rule_include\\\"},{\\\"include\\\":\\\"#at_rule_import\\\"},{\\\"include\\\":\\\"#general\\\"},{\\\"include\\\":\\\"#flow_control\\\"},{\\\"include\\\":\\\"#rules\\\"},{\\\"include\\\":\\\"#property_list\\\"},{\\\"include\\\":\\\"#at_rule_mixin\\\"},{\\\"include\\\":\\\"#at_rule_media\\\"},{\\\"include\\\":\\\"#at_rule_function\\\"},{\\\"include\\\":\\\"#at_rule_charset\\\"},{\\\"include\\\":\\\"#at_rule_option\\\"},{\\\"include\\\":\\\"#at_rule_namespace\\\"},{\\\"include\\\":\\\"#at_rule_fontface\\\"},{\\\"include\\\":\\\"#at_rule_page\\\"},{\\\"include\\\":\\\"#at_rule_keyframes\\\"},{\\\"include\\\":\\\"#at_rule_at_root\\\"},{\\\"include\\\":\\\"#at_rule_supports\\\"},{\\\"match\\\":\\\";\\\",\\\"name\\\":\\\"punctuation.terminator.rule.css\\\"}],\\\"repository\\\":{\\\"at_rule_at_root\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)(at-root))(\\\\\\\\s+|$)\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.at-root.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.at-root.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"},{\\\"include\\\":\\\"#functions\\\"},{\\\"include\\\":\\\"#selectors\\\"}]},\\\"at_rule_charset\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)charset)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.charset.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*((?=;|$))\\\",\\\"name\\\":\\\"meta.at-rule.charset.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"}]},\\\"at_rule_content\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)content)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.content.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*((?=;))\\\",\\\"name\\\":\\\"meta.content.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#selectors\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"at_rule_each\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)each)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.each.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*((?=}))\\\",\\\"name\\\":\\\"meta.at-rule.each.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\b(in|,)\\\\\\\\b\\\",\\\"name\\\":\\\"keyword.control.operator\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"$self\\\"}]},\\\"at_rule_else\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)else(\\\\\\\\s*(if)?))\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.else.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.else.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#conditional_operators\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"at_rule_extend\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)extend)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.extend.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=;)\\\",\\\"name\\\":\\\"meta.at-rule.extend.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#selectors\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"at_rule_fontface\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"^\\\\\\\\s*((@)font-face)\\\\\\\\b\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.fontface.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.fontface.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"}]}]},\\\"at_rule_for\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)for)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.for.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.for.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"(==|!=|<=|>=|[<>]|from|to|through)\\\",\\\"name\\\":\\\"keyword.control.operator\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"$self\\\"}]},\\\"at_rule_forward\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)forward)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.forward.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=;)\\\",\\\"name\\\":\\\"meta.at-rule.forward.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\b(as|hide|show)\\\\\\\\b\\\",\\\"name\\\":\\\"keyword.control.operator\\\"},{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"entity.other.attribute-name.module.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.wildcard.scss\\\"}},\\\"match\\\":\\\"\\\\\\\\b([-\\\\\\\\w]+)(\\\\\\\\*)\\\"},{\\\"match\\\":\\\"\\\\\\\\b[-\\\\\\\\w]+\\\\\\\\b\\\",\\\"name\\\":\\\"entity.name.function.scss\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"},{\\\"include\\\":\\\"#comment_line\\\"},{\\\"include\\\":\\\"#comment_block\\\"}]},\\\"at_rule_function\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"\\\\\\\\s*((@)function)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.function.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.function.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"}]},{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.function.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"}},\\\"match\\\":\\\"\\\\\\\\s*((@)function)\\\\\\\\b\\\\\\\\s*\\\",\\\"name\\\":\\\"meta.at-rule.function.scss\\\"}]},\\\"at_rule_if\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)if)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.if.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.if.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#conditional_operators\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"at_rule_import\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)import)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.import.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*((?=;)|(?=}))\\\",\\\"name\\\":\\\"meta.at-rule.import.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"},{\\\"include\\\":\\\"#functions\\\"},{\\\"include\\\":\\\"#comment_line\\\"}]},\\\"at_rule_include\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"(?<=@include)\\\\\\\\s+(?:([-\\\\\\\\w]+)\\\\\\\\s*(\\\\\\\\.))?([-\\\\\\\\w]+)\\\\\\\\s*(\\\\\\\\()\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"variable.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.access.module.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"},\\\"4\\\":{\\\"name\\\":\\\"punctuation.definition.parameters.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.parameters.end.bracket.round.scss\\\"}},\\\"name\\\":\\\"meta.at-rule.include.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"}]},{\\\"captures\\\":{\\\"0\\\":{\\\"name\\\":\\\"meta.at-rule.include.scss\\\"},\\\"1\\\":{\\\"name\\\":\\\"variable.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.access.module.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"}},\\\"match\\\":\\\"(?<=@include)\\\\\\\\s+(?:([-\\\\\\\\w]+)\\\\\\\\s*(\\\\\\\\.))?([-\\\\\\\\w]+)\\\"},{\\\"captures\\\":{\\\"0\\\":{\\\"name\\\":\\\"meta.at-rule.include.scss\\\"},\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.include.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"match\\\":\\\"((@)include)\\\\\\\\b\\\"}]},\\\"at_rule_keyframes\\\":{\\\"begin\\\":\\\"(?<=^|\\\\\\\\s)(@)(?:-(?:webkit|moz)-)?keyframes\\\\\\\\b\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"keyword.control.at-rule.keyframes.scss\\\"},\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"(?<=})\\\",\\\"name\\\":\\\"meta.at-rule.keyframes.scss\\\",\\\"patterns\\\":[{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"}},\\\"match\\\":\\\"(?<=@keyframes)\\\\\\\\s+((?:[A-Z_a-z][-\\\\\\\\w]|-[A-Z_a-z])[-\\\\\\\\w]*)\\\"},{\\\"begin\\\":\\\"(?<=@keyframes)\\\\\\\\s+(\\\\\\\")\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.string.begin.scss\\\"}},\\\"contentName\\\":\\\"entity.name.function.scss\\\",\\\"end\\\":\\\"\\\\\\\"\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.string.end.scss\\\"}},\\\"name\\\":\\\"string.quoted.double.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"include\\\":\\\"#interpolation\\\"}]},{\\\"begin\\\":\\\"(?<=@keyframes)\\\\\\\\s+(')\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.string.begin.scss\\\"}},\\\"contentName\\\":\\\"entity.name.function.scss\\\",\\\"end\\\":\\\"'\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.string.end.scss\\\"}},\\\"name\\\":\\\"string.quoted.single.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"include\\\":\\\"#interpolation\\\"}]},{\\\"begin\\\":\\\"\\\\\\\\{\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.section.keyframes.begin.scss\\\"}},\\\"end\\\":\\\"}\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.section.keyframes.end.scss\\\"}},\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\b(?:(?:100|[1-9]\\\\\\\\d|\\\\\\\\d)%|from|to)(?=\\\\\\\\s*\\\\\\\\{)\\\",\\\"name\\\":\\\"entity.other.attribute-name.scss\\\"},{\\\"include\\\":\\\"#flow_control\\\"},{\\\"include\\\":\\\"#interpolation\\\"},{\\\"include\\\":\\\"#property_list\\\"},{\\\"include\\\":\\\"#rules\\\"}]}]},\\\"at_rule_media\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"^\\\\\\\\s*((@)media)\\\\\\\\b\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.media.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.media.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#comment_docblock\\\"},{\\\"include\\\":\\\"#comment_block\\\"},{\\\"include\\\":\\\"#comment_line\\\"},{\\\"match\\\":\\\"\\\\\\\\b(only)\\\\\\\\b\\\",\\\"name\\\":\\\"keyword.control.operator.css.scss\\\"},{\\\"begin\\\":\\\"\\\\\\\\(\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.media-query.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.media-query.end.bracket.round.scss\\\"}},\\\"name\\\":\\\"meta.property-list.media-query.scss\\\",\\\"patterns\\\":[{\\\"begin\\\":\\\"(?<![-a-z])(?=[-a-z])\\\",\\\"end\\\":\\\"$|(?![-a-z])\\\",\\\"name\\\":\\\"meta.property-name.media-query.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"source.css#media-features\\\"},{\\\"include\\\":\\\"source.css#property-names\\\"}]},{\\\"begin\\\":\\\"(:)\\\\\\\\s*(?!(\\\\\\\\s*\\\\\\\\{))\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.separator.key-value.scss\\\"}},\\\"contentName\\\":\\\"meta.property-value.media-query.scss\\\",\\\"end\\\":\\\"\\\\\\\\s*(;|(?=[)}]))\\\",\\\"endCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.terminator.rule.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#general\\\"},{\\\"include\\\":\\\"#property_values\\\"}]}]},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#conditional_operators\\\"},{\\\"include\\\":\\\"source.css#media-types\\\"}]}]},\\\"at_rule_mixin\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"(?<=@mixin)\\\\\\\\s+([-\\\\\\\\w]+)\\\\\\\\s*(\\\\\\\\()\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.parameters.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.parameters.end.bracket.round.scss\\\"}},\\\"name\\\":\\\"meta.at-rule.mixin.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"}]},{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"}},\\\"match\\\":\\\"(?<=@mixin)\\\\\\\\s+([-\\\\\\\\w]+)\\\",\\\"name\\\":\\\"meta.at-rule.mixin.scss\\\"},{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.mixin.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"match\\\":\\\"((@)mixin)\\\\\\\\b\\\",\\\"name\\\":\\\"meta.at-rule.mixin.scss\\\"}]},\\\"at_rule_namespace\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"(?<=@namespace)\\\\\\\\s+(?=url)\\\",\\\"end\\\":\\\"(?=;|$)\\\",\\\"name\\\":\\\"meta.at-rule.namespace.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"}]},{\\\"begin\\\":\\\"(?<=@namespace)\\\\\\\\s+([-\\\\\\\\w]*)\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"entity.name.namespace-prefix.scss\\\"}},\\\"end\\\":\\\"(?=;|$)\\\",\\\"name\\\":\\\"meta.at-rule.namespace.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variables\\\"},{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"}]},{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.namespace.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"match\\\":\\\"((@)namespace)\\\\\\\\b\\\",\\\"name\\\":\\\"meta.at-rule.namespace.scss\\\"}]},\\\"at_rule_option\\\":{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.charset.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"match\\\":\\\"^\\\\\\\\s*((@)option)\\\\\\\\b\\\\\\\\s*\\\",\\\"name\\\":\\\"meta.at-rule.option.scss\\\"},\\\"at_rule_page\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"^\\\\\\\\s*((@)page)(?=[:\\\\\\\\s])\\\\\\\\s*([-:\\\\\\\\w]*)\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.page.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"entity.name.function.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=\\\\\\\\{)\\\",\\\"name\\\":\\\"meta.at-rule.page.scss\\\"}]},\\\"at_rule_return\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)(return))\\\\\\\\b\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.return.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*((?=;))\\\",\\\"name\\\":\\\"meta.at-rule.return.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"at_rule_supports\\\":{\\\"begin\\\":\\\"(?<=^|\\\\\\\\s)(@)supports\\\\\\\\b\\\",\\\"captures\\\":{\\\"0\\\":{\\\"name\\\":\\\"keyword.control.at-rule.supports.scss\\\"},\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"(?=\\\\\\\\{)|$\\\",\\\"name\\\":\\\"meta.at-rule.supports.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#logical_operators\\\"},{\\\"include\\\":\\\"#properties\\\"},{\\\"match\\\":\\\"\\\\\\\\(\\\",\\\"name\\\":\\\"punctuation.definition.condition.begin.bracket.round.scss\\\"},{\\\"match\\\":\\\"\\\\\\\\)\\\",\\\"name\\\":\\\"punctuation.definition.condition.end.bracket.round.scss\\\"}]},\\\"at_rule_use\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)use)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.at-rule.use.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=;)\\\",\\\"name\\\":\\\"meta.at-rule.use.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\b(as|with)\\\\\\\\b\\\",\\\"name\\\":\\\"keyword.control.operator\\\"},{\\\"match\\\":\\\"\\\\\\\\b[-\\\\\\\\w]+\\\\\\\\b\\\",\\\"name\\\":\\\"variable.scss\\\"},{\\\"match\\\":\\\"\\\\\\\\*\\\",\\\"name\\\":\\\"variable.language.expanded-namespace.scss\\\"},{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"},{\\\"include\\\":\\\"#comment_line\\\"},{\\\"include\\\":\\\"#comment_block\\\"},{\\\"begin\\\":\\\"\\\\\\\\(\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.parameters.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.parameters.end.bracket.round.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"}]}]},\\\"at_rule_warn\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)(warn|debug|error))\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.warn.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=;)\\\",\\\"name\\\":\\\"meta.at-rule.warn.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#string_double\\\"},{\\\"include\\\":\\\"#string_single\\\"}]},\\\"at_rule_while\\\":{\\\"begin\\\":\\\"\\\\\\\\s*((@)while)\\\\\\\\b\\\\\\\\s*\\\",\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"keyword.control.while.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.keyword.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\s*(?=})\\\",\\\"name\\\":\\\"meta.at-rule.while.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#conditional_operators\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"$self\\\"}]},\\\"comment_block\\\":{\\\"begin\\\":\\\"/\\\\\\\\*\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.comment.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\*/\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.comment.scss\\\"}},\\\"name\\\":\\\"comment.block.scss\\\"},\\\"comment_docblock\\\":{\\\"begin\\\":\\\"///\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.comment.scss\\\"}},\\\"end\\\":\\\"(?=$)\\\",\\\"name\\\":\\\"comment.block.documentation.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"source.sassdoc\\\"}]},\\\"comment_line\\\":{\\\"begin\\\":\\\"//\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.comment.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\n\\\",\\\"name\\\":\\\"comment.line.scss\\\"},\\\"comparison_operators\\\":{\\\"match\\\":\\\"==|!=|<=|>=|[<>]\\\",\\\"name\\\":\\\"keyword.operator.comparison.scss\\\"},\\\"conditional_operators\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#comparison_operators\\\"},{\\\"include\\\":\\\"#logical_operators\\\"}]},\\\"constant_default\\\":{\\\"match\\\":\\\"!default\\\",\\\"name\\\":\\\"keyword.other.default.scss\\\"},\\\"constant_functions\\\":{\\\"begin\\\":\\\"(?:([-\\\\\\\\w]+)(\\\\\\\\.))?([-\\\\\\\\w]+)(\\\\\\\\()\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"variable.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.access.module.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"support.function.misc.scss\\\"},\\\"4\\\":{\\\"name\\\":\\\"punctuation.section.function.scss\\\"}},\\\"end\\\":\\\"(\\\\\\\\))\\\",\\\"endCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.section.function.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#parameters\\\"}]},\\\"constant_important\\\":{\\\"match\\\":\\\"!important\\\",\\\"name\\\":\\\"keyword.other.important.scss\\\"},\\\"constant_mathematical_symbols\\\":{\\\"match\\\":\\\"\\\\\\\\b([-*+/])\\\\\\\\b\\\",\\\"name\\\":\\\"support.constant.mathematical-symbols.scss\\\"},\\\"constant_optional\\\":{\\\"match\\\":\\\"!optional\\\",\\\"name\\\":\\\"keyword.other.optional.scss\\\"},\\\"constant_sass_functions\\\":{\\\"begin\\\":\\\"(headings|stylesheet-url|rgba?|hsla?|ie-hex-str|red|green|blue|alpha|opacity|hue|saturation|lightness|prefixed|prefix|-moz|-svg|-css2|-pie|-webkit|-ms|font-(?:files|url)|grid-image|image-(?:width|height|url|color)|sprites?|sprite-(?:map|map-name|file|url|position)|inline-(?:font-files|image)|opposite-position|grad-point|grad-end-position|color-stops|color-stops-in-percentages|grad-color-stops|(?:radial|linear)-(?:|svg-)gradient|opacify|fade-?in|transparentize|fade-?out|lighten|darken|saturate|desaturate|grayscale|adjust-(?:hue|lightness|saturation|color)|scale-(?:lightness|saturation|color)|change-color|spin|complement|invert|mix|-compass-(?:list|space-list|slice|nth|list-size)|blank|compact|nth|first-value-of|join|length|append|nest|append-selector|headers|enumerate|range|percentage|unitless|unit|if|type-of|comparable|elements-of-type|quote|unquote|escape|e|sin|cos|tan|abs|round|ceil|floor|pi|translate[XY])(\\\\\\\\()\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"support.function.misc.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.section.function.scss\\\"}},\\\"end\\\":\\\"(\\\\\\\\))\\\",\\\"endCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.section.function.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#parameters\\\"}]},\\\"flow_control\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#at_rule_if\\\"},{\\\"include\\\":\\\"#at_rule_else\\\"},{\\\"include\\\":\\\"#at_rule_warn\\\"},{\\\"include\\\":\\\"#at_rule_for\\\"},{\\\"include\\\":\\\"#at_rule_while\\\"},{\\\"include\\\":\\\"#at_rule_each\\\"},{\\\"include\\\":\\\"#at_rule_return\\\"}]},\\\"function_attributes\\\":{\\\"patterns\\\":[{\\\"match\\\":\\\":\\\",\\\"name\\\":\\\"punctuation.separator.key-value.scss\\\"},{\\\"include\\\":\\\"#general\\\"},{\\\"include\\\":\\\"#property_values\\\"},{\\\"match\\\":\\\"[;=?@{}]\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]},\\\"functions\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"([-\\\\\\\\w]+)(\\\\\\\\()\\\\\\\\s*\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"support.function.misc.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.section.function.scss\\\"}},\\\"end\\\":\\\"(\\\\\\\\))\\\",\\\"endCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.section.function.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#parameters\\\"}]},{\\\"match\\\":\\\"([-\\\\\\\\w]+)\\\",\\\"name\\\":\\\"support.function.misc.scss\\\"}]},\\\"general\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#comment_docblock\\\"},{\\\"include\\\":\\\"#comment_block\\\"},{\\\"include\\\":\\\"#comment_line\\\"}]},\\\"interpolation\\\":{\\\"begin\\\":\\\"#\\\\\\\\{\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.interpolation.begin.bracket.curly.scss\\\"}},\\\"end\\\":\\\"}\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.interpolation.end.bracket.curly.scss\\\"}},\\\"name\\\":\\\"variable.interpolation.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"logical_operators\\\":{\\\"match\\\":\\\"\\\\\\\\b(not|or|and)\\\\\\\\b\\\",\\\"name\\\":\\\"keyword.operator.logical.scss\\\"},\\\"map\\\":{\\\"begin\\\":\\\"\\\\\\\\(\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.map.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.map.end.bracket.round.scss\\\"}},\\\"name\\\":\\\"meta.definition.variable.map.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#comment_docblock\\\"},{\\\"include\\\":\\\"#comment_block\\\"},{\\\"include\\\":\\\"#comment_line\\\"},{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"support.type.map.key.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.separator.key-value.scss\\\"}},\\\"match\\\":\\\"\\\\\\\\b([-\\\\\\\\w]+)\\\\\\\\s*(:)\\\"},{\\\"match\\\":\\\",\\\",\\\"name\\\":\\\"punctuation.separator.delimiter.scss\\\"},{\\\"include\\\":\\\"#map\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"include\\\":\\\"#property_values\\\"}]},\\\"operators\\\":{\\\"match\\\":\\\"[-*+/](?!\\\\\\\\s*[-*+/])\\\",\\\"name\\\":\\\"keyword.operator.css\\\"},\\\"parameters\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#variable\\\"},{\\\"begin\\\":\\\"\\\\\\\\(\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.end.bracket.round.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#function_attributes\\\"}]},{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"#comment_block\\\"},{\\\"match\\\":\\\"[^\\\\\\\\t \\\\\\\"'),]+\\\",\\\"name\\\":\\\"variable.parameter.url.scss\\\"},{\\\"match\\\":\\\",\\\",\\\"name\\\":\\\"punctuation.separator.delimiter.scss\\\"}]},\\\"parent_selector_suffix\\\":{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.entity.css\\\"},\\\"2\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.identifier.scss\\\"}]}},\\\"match\\\":\\\"(?<=&)((?:[-0-9A-Z_a-z[^\\\\\\\\x00-\\\\\\\\x7F]]|\\\\\\\\\\\\\\\\(?:\\\\\\\\h{1,6}|.)|#\\\\\\\\{|[$}])+)(?=$|[#)+,.:>\\\\\\\\[{|~\\\\\\\\s]|/\\\\\\\\*)\\\",\\\"name\\\":\\\"entity.other.attribute-name.parent-selector-suffix.css\\\"},\\\"properties\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"(?<![-a-z])(?=[-a-z])\\\",\\\"end\\\":\\\"$|(?![-a-z])\\\",\\\"name\\\":\\\"meta.property-name.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"source.css#property-names\\\"},{\\\"include\\\":\\\"#at_rule_include\\\"}]},{\\\"begin\\\":\\\"(:)\\\\\\\\s*(?!(\\\\\\\\s*\\\\\\\\{))\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.separator.key-value.scss\\\"}},\\\"contentName\\\":\\\"meta.property-value.scss\\\",\\\"end\\\":\\\"\\\\\\\\s*(;|(?=[)}]))\\\",\\\"endCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.terminator.rule.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#general\\\"},{\\\"include\\\":\\\"#property_values\\\"}]}]},\\\"property_list\\\":{\\\"begin\\\":\\\"\\\\\\\\{\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.section.property-list.begin.bracket.curly.scss\\\"}},\\\"end\\\":\\\"}\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.section.property-list.end.bracket.curly.scss\\\"}},\\\"name\\\":\\\"meta.property-list.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#flow_control\\\"},{\\\"include\\\":\\\"#rules\\\"},{\\\"include\\\":\\\"#properties\\\"},{\\\"include\\\":\\\"$self\\\"}]},\\\"property_values\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#string_single\\\"},{\\\"include\\\":\\\"#string_double\\\"},{\\\"include\\\":\\\"#constant_functions\\\"},{\\\"include\\\":\\\"#constant_sass_functions\\\"},{\\\"include\\\":\\\"#constant_important\\\"},{\\\"include\\\":\\\"#constant_default\\\"},{\\\"include\\\":\\\"#constant_optional\\\"},{\\\"include\\\":\\\"source.css#numeric-values\\\"},{\\\"include\\\":\\\"source.css#property-keywords\\\"},{\\\"include\\\":\\\"source.css#color-keywords\\\"},{\\\"include\\\":\\\"source.css#property-names\\\"},{\\\"include\\\":\\\"#constant_mathematical_symbols\\\"},{\\\"include\\\":\\\"#operators\\\"},{\\\"begin\\\":\\\"\\\\\\\\(\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.begin.bracket.round.scss\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.end.bracket.round.scss\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#general\\\"},{\\\"include\\\":\\\"#property_values\\\"}]}]},\\\"rules\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#general\\\"},{\\\"include\\\":\\\"#at_rule_extend\\\"},{\\\"include\\\":\\\"#at_rule_content\\\"},{\\\"include\\\":\\\"#at_rule_include\\\"},{\\\"include\\\":\\\"#at_rule_media\\\"},{\\\"include\\\":\\\"#selectors\\\"}]},\\\"selector_attribute\\\":{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.attribute-selector.begin.bracket.square.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"entity.other.attribute-name.attribute.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]},\\\"3\\\":{\\\"name\\\":\\\"keyword.operator.scss\\\"},\\\"4\\\":{\\\"name\\\":\\\"string.unquoted.attribute-value.scss\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]},\\\"5\\\":{\\\"name\\\":\\\"string.quoted.double.attribute-value.scss\\\"},\\\"6\\\":{\\\"name\\\":\\\"punctuation.definition.string.begin.scss\\\"},\\\"7\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]},\\\"8\\\":{\\\"name\\\":\\\"punctuation.definition.string.end.scss\\\"},\\\"9\\\":{\\\"name\\\":\\\"string.quoted.single.attribute-value.scss\\\"},\\\"10\\\":{\\\"name\\\":\\\"punctuation.definition.string.begin.scss\\\"},\\\"11\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]},\\\"12\\\":{\\\"name\\\":\\\"punctuation.definition.string.end.scss\\\"},\\\"13\\\":{\\\"name\\\":\\\"punctuation.definition.attribute-selector.end.bracket.square.scss\\\"}},\\\"match\\\":\\\"(?i)(\\\\\\\\[)\\\\\\\\s*((?:[-0-9A-Z_a-z[^\\\\\\\\x00-\\\\\\\\x7F]]|\\\\\\\\\\\\\\\\(?:\\\\\\\\h{1,6}|.)|#\\\\\\\\{|\\\\\\\\.?\\\\\\\\$|})+?)(?:\\\\\\\\s*([$*^|~]?=)\\\\\\\\s*(?:((?:[-0-9A-Z_a-z[^\\\\\\\\x00-\\\\\\\\x7F]]|\\\\\\\\\\\\\\\\(?:\\\\\\\\h{1,6}|.)|#\\\\\\\\{|\\\\\\\\.?\\\\\\\\$|})+)|((\\\\\\\")(.*?)(\\\\\\\"))|((')(.*?)('))))?\\\\\\\\s*(])\\\",\\\"name\\\":\\\"meta.attribute-selector.scss\\\"},\\\"selector_class\\\":{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.entity.css\\\"},\\\"2\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]}},\\\"match\\\":\\\"(\\\\\\\\.)((?:[-0-9A-Z_a-z[^\\\\\\\\x00-\\\\\\\\x7F]]|\\\\\\\\\\\\\\\\(?:\\\\\\\\h{1,6}|.)|#\\\\\\\\{|\\\\\\\\.?\\\\\\\\$|})+)(?=$|[#)+,:>\\\\\\\\[{|~\\\\\\\\s]|\\\\\\\\.[^$]|/\\\\\\\\*|;)\\\",\\\"name\\\":\\\"entity.other.attribute-name.class.css\\\"},\\\"selector_custom\\\":{\\\"match\\\":\\\"\\\\\\\\b([0-9A-Za-z]+(-[0-9A-Za-z]+)+)(?=\\\\\\\\.|\\\\\\\\s++[^:]|\\\\\\\\s*[,\\\\\\\\[{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-((?:|last-)(?:child|of-type))|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\\\\\\\\([0-9A-Za-z]*\\\\\\\\))?)\\\",\\\"name\\\":\\\"entity.name.tag.custom.scss\\\"},\\\"selector_id\\\":{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.entity.css\\\"},\\\"2\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.identifier.scss\\\"}]}},\\\"match\\\":\\\"(#)((?:[-0-9A-Z_a-z[^\\\\\\\\x00-\\\\\\\\x7F]]|\\\\\\\\\\\\\\\\(?:\\\\\\\\h{1,6}|.)|#\\\\\\\\{|\\\\\\\\.?\\\\\\\\$|})+)(?=$|[#)+,:>\\\\\\\\[{|~\\\\\\\\s]|\\\\\\\\.[^$]|/\\\\\\\\*)\\\",\\\"name\\\":\\\"entity.other.attribute-name.id.css\\\"},\\\"selector_placeholder\\\":{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"punctuation.definition.entity.css\\\"},\\\"2\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"match\\\":\\\"[$}]\\\",\\\"name\\\":\\\"invalid.illegal.identifier.scss\\\"}]}},\\\"match\\\":\\\"(%)((?:[-0-9A-Z_a-z[^\\\\\\\\x00-\\\\\\\\x7F]]|\\\\\\\\\\\\\\\\(?:\\\\\\\\h{1,6}|.)|#\\\\\\\\{|\\\\\\\\.\\\\\\\\$|[$}])+)(?=;|$|[#)+,:>\\\\\\\\[{|~\\\\\\\\s]|\\\\\\\\.[^$]|/\\\\\\\\*)\\\",\\\"name\\\":\\\"entity.other.attribute-name.placeholder.css\\\"},\\\"selector_pseudo_class\\\":{\\\"patterns\\\":[{\\\"begin\\\":\\\"((:)\\\\\\\\bnth-(?:|last-)(?:child|of-type))(\\\\\\\\()\\\",\\\"beginCaptures\\\":{\\\"1\\\":{\\\"name\\\":\\\"entity.other.attribute-name.pseudo-class.css\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.definition.entity.css\\\"},\\\"3\\\":{\\\"name\\\":\\\"punctuation.definition.pseudo-class.begin.bracket.round.css\\\"}},\\\"end\\\":\\\"\\\\\\\\)\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.pseudo-class.end.bracket.round.css\\\"}},\\\"patterns\\\":[{\\\"include\\\":\\\"#interpolation\\\"},{\\\"match\\\":\\\"\\\\\\\\d+\\\",\\\"name\\\":\\\"constant.numeric.css\\\"},{\\\"match\\\":\\\"(?:(?<=\\\\\\\\d)n|\\\\\\\\b(n|even|odd))\\\\\\\\b\\\",\\\"name\\\":\\\"constant.other.scss\\\"},{\\\"match\\\":\\\"\\\\\\\\w+\\\",\\\"name\\\":\\\"invalid.illegal.scss\\\"}]},{\\\"include\\\":\\\"source.css#pseudo-classes\\\"},{\\\"include\\\":\\\"source.css#pseudo-elements\\\"},{\\\"include\\\":\\\"source.css#functional-pseudo-classes\\\"}]},\\\"selectors\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"source.css#tag-names\\\"},{\\\"include\\\":\\\"#selector_custom\\\"},{\\\"include\\\":\\\"#selector_class\\\"},{\\\"include\\\":\\\"#selector_id\\\"},{\\\"include\\\":\\\"#selector_pseudo_class\\\"},{\\\"include\\\":\\\"#tag_wildcard\\\"},{\\\"include\\\":\\\"#tag_parent_reference\\\"},{\\\"include\\\":\\\"source.css#pseudo-elements\\\"},{\\\"include\\\":\\\"#selector_attribute\\\"},{\\\"include\\\":\\\"#selector_placeholder\\\"},{\\\"include\\\":\\\"#parent_selector_suffix\\\"}]},\\\"string_double\\\":{\\\"begin\\\":\\\"\\\\\\\"\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.string.begin.scss\\\"}},\\\"end\\\":\\\"\\\\\\\"\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.string.end.scss\\\"}},\\\"name\\\":\\\"string.quoted.double.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"include\\\":\\\"#interpolation\\\"}]},\\\"string_single\\\":{\\\"begin\\\":\\\"'\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.string.begin.scss\\\"}},\\\"end\\\":\\\"'\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.definition.string.end.scss\\\"}},\\\"name\\\":\\\"string.quoted.single.scss\\\",\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\\\\\\\\\(\\\\\\\\h{1,6}|.)\\\",\\\"name\\\":\\\"constant.character.escape.scss\\\"},{\\\"include\\\":\\\"#interpolation\\\"}]},\\\"tag_parent_reference\\\":{\\\"match\\\":\\\"&\\\",\\\"name\\\":\\\"entity.name.tag.reference.scss\\\"},\\\"tag_wildcard\\\":{\\\"match\\\":\\\"\\\\\\\\*\\\",\\\"name\\\":\\\"entity.name.tag.wildcard.scss\\\"},\\\"variable\\\":{\\\"patterns\\\":[{\\\"include\\\":\\\"#variables\\\"},{\\\"include\\\":\\\"#interpolation\\\"}]},\\\"variable_setting\\\":{\\\"begin\\\":\\\"(?=\\\\\\\\$[-\\\\\\\\w]+\\\\\\\\s*:)\\\",\\\"contentName\\\":\\\"meta.definition.variable.scss\\\",\\\"end\\\":\\\";\\\",\\\"endCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.terminator.rule.scss\\\"}},\\\"patterns\\\":[{\\\"match\\\":\\\"\\\\\\\\$[-\\\\\\\\w]+(?=\\\\\\\\s*:)\\\",\\\"name\\\":\\\"variable.scss\\\"},{\\\"begin\\\":\\\":\\\",\\\"beginCaptures\\\":{\\\"0\\\":{\\\"name\\\":\\\"punctuation.separator.key-value.scss\\\"}},\\\"end\\\":\\\"(?=;)\\\",\\\"patterns\\\":[{\\\"include\\\":\\\"#comment_docblock\\\"},{\\\"include\\\":\\\"#comment_block\\\"},{\\\"include\\\":\\\"#comment_line\\\"},{\\\"include\\\":\\\"#map\\\"},{\\\"include\\\":\\\"#property_values\\\"},{\\\"include\\\":\\\"#variable\\\"},{\\\"match\\\":\\\",\\\",\\\"name\\\":\\\"punctuation.separator.delimiter.scss\\\"}]}]},\\\"variables\\\":{\\\"patterns\\\":[{\\\"captures\\\":{\\\"1\\\":{\\\"name\\\":\\\"variable.scss\\\"},\\\"2\\\":{\\\"name\\\":\\\"punctuation.access.module.scss\\\"},\\\"3\\\":{\\\"name\\\":\\\"variable.scss\\\"}},\\\"match\\\":\\\"\\\\\\\\b([-\\\\\\\\w]+)(\\\\\\\\.)(\\\\\\\\$[-\\\\\\\\w]+)\\\\\\\\b\\\"},{\\\"match\\\":\\\"(\\\\\\\\$|--)[-0-9A-Z_a-z]+\\\\\\\\b\\\",\\\"name\\\":\\\"variable.scss\\\"}]}},\\\"scopeName\\\":\\\"source.css.scss\\\",\\\"embeddedLangs\\\":[\\\"css\\\"]}\"))\n\nexport default [\n...css,\nlang\n]\n"],"ignoreList":[0],"mappings":"A,sCAEA,IAAME,EAAO,OAAO,OAAO,KAAK,MAAM,890BAA+j7B,CAAC,EAEtm7BC,EAAe,CACf,GAAGH,EACHE,CACA,E"}
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./jsx-runtime-D13aM9HY.js";var t={name:`send`,size:24,node:[[`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`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};t.node;var n=e(t);export{n as t};
2
+ //# sourceMappingURL=send-BKjswHxB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-BKjswHxB.js","names":["createLucideIcon","__iconData","Send"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/send.mjs"],"sourcesContent":["/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"send\",\n size: 24,\n node: [\n [\n \"path\",\n {\n 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\",\n key: \"1ffxy3\"\n }\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }]\n ]\n};\n__iconData.node;\nconst Send = createLucideIcon(__iconData);\n\nexport { __iconData, Send as default };\n//# sourceMappingURL=send.mjs.map\n"],"ignoreList":[0],"mappings":"A,8CASA,IAAMC,EAAa,CACjB,KAAM,OACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,kIACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,6BAA8B,IAAK,QAAS,CAAC,CAC7D,CACF,EACAA,EAAW,KACX,IAAMC,EAAOF,EAAiBC,CAAU,E"}
@@ -0,0 +1,7 @@
1
+ import{_ as e,c as t,f as n,i as r,l as i,m as a,n as o,p as s,t as c,u as l}from"./jsx-runtime-D13aM9HY.js";import{A as u,B as d,E as f,G as p,H as m,P as h,R as g,U as _,V as v,W as y,_ as b,c as x,d as S,g as C,h as w,i as T,l as E,m as D,n as O,o as k,p as A,r as j,t as M,u as ee,v as te}from"./states--geW2Ntl.js";import{t as N}from"./server-SxFxIScj.js";import{n as ne,t as re}from"./sliders-horizontal-DAoirila.js";import{t as ie}from"./chevron-right-evVLS6hq.js";import{t as ae}from"./copy-oWgGHmkS.js";import{C as P,E as oe,S as se,T as ce,_ as F,a as I,b as L,c as R,d as le,f as ue,g as de,h as fe,i as pe,l as z,m as B,n as me,o as V,p as H,r as U,s as W,t as G,u as he,v as ge,w as _e,x as ve,y as ye}from"./shared-CZ7fcu_B.js";import{n as be,t as xe}from"./pencil-DI8QbCN8.js";import{t as Se}from"./key-round-VDbE9E4X.js";import{t as K}from"./plus-BLP-wIYD.js";import{t as Ce}from"./save-DEvZPWlS.js";import{t as we}from"./send-BKjswHxB.js";import{t as Te}from"./trash-C6X2OLrI.js";import{B as Ee,C as De,D as Oe,F as ke,L as Ae,N as je,O as Me,P as q,R as Ne,c as Pe,f as Fe,i as Ie,k as Le,l as J,r as Re,x as ze}from"./index-vIzH1m8u.js";import{n as Y,r as Be,t as Ve}from"./TextArea-BYr88SnV.js";import{i as He,l as Ue,o as We,s as Ge,t as Ke,u as qe}from"./dist-BE_V9dwJ.js";import{d as Je,f as Ye,g as Xe,h as Ze,l as Qe,m as $e,p as et,r as tt,u as nt,v as rt,y as it}from"./logic-xb-QF00E.js";var at={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`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`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};at.node;var ot=o(at),st={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`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`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};st.node;var ct=o(st),lt={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`,key:`1kt360`}]]};lt.node;var ut=o(lt),dt={name:`folder-search`,size:24,node:[[`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`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]};dt.node;var ft=o(dt),pt={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};pt.node;var mt=o(pt),ht={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};ht.node;var gt=o(ht),_t={name:`shield-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]};_t.node;var vt=o(_t),yt={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};yt.node;var bt=o(yt),xt={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};xt.node;var St=o(xt),X=e(a(),1),Ct=class extends Error{constructor(e){super(`Unexpected response from ${e}. The coordinator and this app may be out of sync.`),this.name=`UnexpectedResponseError`}};function wt(e,t){let[n,r]=(0,X.useState)({data:void 0,error:null,loading:e!==null,fatal:!1}),[i,a]=(0,X.useState)(0);(0,X.useEffect)(()=>{if(!e)return;let n=new AbortController;return r(e=>({...e,loading:!0,error:null,fatal:!1})),v(e,void 0,n.signal).then(i=>{n.signal.aborted||(t&&!t(i)?r(t=>({...t,loading:!1,error:new Ct(e),fatal:!0})):r({data:i,error:null,loading:!1,fatal:!1}))}).catch(e=>{n.signal.aborted||r(t=>({...t,loading:!1,error:e,fatal:!1}))}),()=>n.abort()},[e,i]);let o=(0,X.useCallback)(()=>a(e=>e+1),[]),s=(0,X.useCallback)(e=>r({data:e,error:null,loading:!1,fatal:!1}),[]);return{...n,reload:o,setData:s}}function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Q=c(),Tt={active:{icon:q,label:`Active`,tone:`success`},disabled:{icon:Le,label:`Disabled`,tone:`neutral`},error:{icon:Me,label:`Error`,tone:`danger`}};function Et({status:e}){let t=Tt[e]??Tt.error;return(0,Q.jsx)(W,{icon:t.icon,label:t.label,tone:t.tone})}var Dt={project:`Project`,owner:`Owner`,plugin:`Plugin`,bundled:`Bundled`},Ot={info:{icon:De,label:`Info`,tone:`info`},warning:{icon:C,label:`Warning`,tone:`warning`},error:{icon:Me,label:`Error`,tone:`danger`}};function kt({level:e}){let t=Ot[e]??Ot.info;return(0,Q.jsx)(W,{icon:t.icon,label:t.label,tone:t.tone})}function At(e){let t=h(e=>e.diagnostics);return(0,X.useMemo)(()=>{let n=new Set,r=[];for(let i of[...e??[],...t]){let e=`${i.at}|${i.adapterId??``}|${i.sessionId??``}|${i.message}`;n.has(e)||(n.add(e),r.push(i))}return r.sort((e,t)=>t.at.localeCompare(e.at))},[e,t])}function jt(){let e=P(),t=h(e=>e.adapters),n=h(e=>e.hosts),i=wt(`/api/diagnostics`,Z),a=At(Array.isArray(i.data?.diagnostics)?i.data.diagnostics:void 0),o=(0,X.useMemo)(()=>Object.entries(t).filter(([,e])=>e.length>0).map(([e,t])=>({hostId:e,hostName:n[e]?.name??`Unknown host (${e})`,adapters:[...t].sort((e,t)=>e.id.localeCompare(t.id))})).sort((e,t)=>e.hostName.localeCompare(t.hostName)),[t,n]);return(0,Q.jsxs)(H,{title:`Adapters`,description:`Adapters translate Pi extensions into Switchyard cards, panels and interactions. Each host reports its own.`,children:[(0,Q.jsx)(z,{}),i.error!==null&&!i.fatal&&(0,Q.jsx)(O,{compact:!0,title:`Could not load adapter diagnostics history`,error:i.error,onRetry:i.reload}),e?o.length===0?(0,Q.jsx)(M,{icon:(0,Q.jsx)(te,{className:`size-8`}),title:`No adapters reported`,description:`Hosts report adapters when their agent connects. Check that your hosts are connected.`,action:{label:`Open hosts`,to:L(`hosts`)}}):o.map(e=>(0,Q.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsx)(`h2`,{className:`text-base font-semibold`,children:(0,Q.jsx)(r,{to:L(`hosts/${encodeURIComponent(e.hostId)}`),className:`hover:underline`,children:e.hostName})}),e.adapters.map(e=>(0,Q.jsx)(Mt,{adapter:e,diagnostics:a.filter(t=>t.adapterId===e.id)},e.id))]},e.hostId)):(0,Q.jsx)(k,{label:`Loading adapters…`})]})}function Mt({adapter:e,diagnostics:t}){return(0,Q.jsxs)(G,{title:(0,Q.jsx)(`span`,{className:`break-all font-mono`,children:e.id}),actions:(0,Q.jsx)(Et,{status:e.status}),children:[(0,Q.jsx)(R,{items:[[`Version`,e.version],[`Tier`,Dt[e.tier]??e.tier],[`Target extension`,(0,Q.jsx)(`span`,{className:`break-all font-mono`,children:e.target.extension},`t`)],[`Version range`,(0,Q.jsx)(`span`,{className:`font-mono`,children:e.target.versionRange},`r`)],[`Tested versions`,e.target.testedVersions.length?e.target.testedVersions.join(`, `):`None recorded`],[`Capabilities`,e.capabilities.length?e.capabilities.join(`, `):`None`],[`Web renderer`,e.webRenderer?`Yes (runs in a sandboxed frame; mobile uses a fallback)`:`No (native cards only)`],...e.detail?[[`Detail`,e.detail]]:[]]}),(0,Q.jsx)(`h3`,{className:`mt-3 mb-1 text-sm font-semibold`,children:`Recent diagnostics`}),t.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No diagnostics for this adapter.`}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:t.slice(0,10).map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-start gap-2 text-sm`,children:[(0,Q.jsx)(kt,{level:e.level}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.message}),(0,Q.jsx)(`time`,{dateTime:e.at,className:`text-xs text-muted`,children:D(e.at)})]},`${e.at}-${e.message}`))})]})}function Nt(e){return Z(e)&&Z(e.versions)}var Pt=`/api/diagnostics`,Ft=`switchyard coordinator backup <file>`,It=`switchyard coordinator restore <file>`;function Lt(e){let t=e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/_/g,` `);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function Rt(e,t){return t==null?`None`:typeof t==`string`&&/At$|time|date/i.test(e)?D(t):typeof t==`object`?JSON.stringify(t):String(t)}function zt(){let e=wt(Pt,Nt),t=e.data&&Z(e.data.backup)?e.data.backup:null;return(0,Q.jsxs)(H,{title:`Backups`,description:`The coordinator keeps all state in one SQLite database. Back it up from the machine that runs the coordinator.`,children:[(0,Q.jsxs)(G,{title:`Back up`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-sm`,children:`Writes a consistent copy of the database to a file while the coordinator keeps running.`}),(0,Q.jsx)(pe,{text:Ft,label:`Backup command`,copyLabel:`Copy command`})]}),(0,Q.jsxs)(G,{title:`Restore`,children:[(0,Q.jsxs)(`p`,{className:`mb-2 text-sm`,children:[`Restore refuses to run while the coordinator is running: stop it first. The current database is kept next to it as`,` `,(0,Q.jsx)(`code`,{className:`break-all`,children:`coordinator.db.bak-<ts>`}),`.`]}),(0,Q.jsx)(pe,{text:It,label:`Restore command`,copyLabel:`Copy command`}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:`Hosts keep running sessions during a coordinator restart and replay their events when it comes back.`})]}),(0,Q.jsx)(G,{title:`Last backup`,children:e.fatal?(0,Q.jsx)(j,{error:e.error}):e.error&&!e.data?(0,Q.jsx)(O,{compact:!0,title:`Could not load backup info`,error:e.error,onRetry:e.reload}):e.data?t&&Object.keys(t).length>0?(0,Q.jsx)(R,{items:Object.entries(t).map(([e,t])=>[Lt(e),Rt(e,t)])}):(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No backup info is recorded by the coordinator. Keep track of your backup files yourself, or schedule the backup command with cron or launchd.`}):(0,Q.jsx)(k,{label:`Loading backup info…`})})]})}var Bt={browser:`Browser`,pwa:`Home Screen app`,terminal:`Terminal`,cli:`CLI`},Vt={granted:`allowed`,denied:`blocked`,default:`not requested`,unknown:`unknown`};function Ht({kind:e}){return(0,Q.jsx)(e===`pwa`?bt:e===`browser`?mt:ce,{"aria-hidden":!0,className:`mt-0.5 size-5 shrink-0 text-muted`})}function Ut(){let e=P(),t=h(e=>e.devices);Ee(e=>e.me);let n=Ae(),r=(0,X.useMemo)(()=>Object.values(t).filter(e=>e.revokedAt===null).sort((e,t)=>Number(t.id===n)-Number(e.id===n)||(t.lastSeenAt??``).localeCompare(e.lastSeenAt??``)),[t,n]),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(null),[g,v]=(0,X.useState)(!1),[b,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(null),w=async()=>{if(f){v(!0),x(null);try{await _(`/api/devices/${encodeURIComponent(f.id)}/revoke`),J.success(`${f.name} revoked`),p(null)}catch(e){x(e)}finally{v(!1)}}},T=async e=>{C(e.id);try{await m(`/api/devices/${encodeURIComponent(e.id)}`,{preferredMobile:!0}),J.success(`${e.name} is now the preferred mobile device`)}catch(e){J.error(`Could not set the preferred device: ${y(e)}`)}finally{C(null)}},D=async()=>{if(!i)return;let e=o.trim();if(e){l(!0),d(null);try{await m(`/api/devices/${encodeURIComponent(i.id)}`,{name:e}),J.success(`Renamed to ${e}`),a(null)}catch(e){d(e)}finally{l(!1)}}};return(0,Q.jsxs)(H,{testId:`settings-devices`,title:`Devices`,description:`Browsers, Home Screen apps and terminals signed in to this coordinator. Revoke one to sign it out.`,children:[(0,Q.jsx)(z,{}),e?r.length===0?(0,Q.jsx)(M,{icon:(0,Q.jsx)(oe,{className:`size-8`}),title:`No devices`,description:`Browsers and terminals appear here once they sign in.`}):(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:r.map(e=>{let t=e.id===n;return(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-start gap-3 border-b border-border px-4 py-3 last:border-b-0`,children:[(0,Q.jsx)(Ht,{kind:e.kind}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e.name}),t&&(0,Q.jsx)(W,{icon:mt,tone:`info`,label:`This device`}),e.preferredMobile&&(0,Q.jsx)(W,{icon:St,tone:`success`,label:`Preferred mobile`})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted`,children:[(0,Q.jsx)(`span`,{children:Bt[e.kind]}),(0,Q.jsxs)(`span`,{children:[`Last seen `,A(e.lastSeenAt)]}),(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.push.subscribed?(0,Q.jsx)(ct,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,Q.jsx)(ot,{"aria-hidden":!0,className:`size-4 shrink-0`}),e.push.subscribed?`Push subscribed`:`No push subscription`,`, permission`,` `,Vt[e.push.permission]]})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[!e.preferredMobile&&(0,Q.jsx)(E,{size:`sm`,icon:(0,Q.jsx)(St,{className:`size-4`}),busy:S===e.id,onClick:()=>T(e),children:`Set as preferred mobile device`}),(0,Q.jsx)(E,{size:`sm`,variant:`ghost`,"data-testid":`device-rename`,icon:(0,Q.jsx)(xe,{className:`size-4`}),onClick:()=>{d(null),s(e.name),a(e)},children:`Rename`}),(0,Q.jsx)(E,{size:`sm`,variant:`ghost`,className:`text-danger`,icon:(0,Q.jsx)(vt,{className:`size-4`}),onClick:()=>{x(null),p(e)},children:`Revoke`})]})]},e.id)})}):(0,Q.jsx)(k,{label:`Loading devices…`}),(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`The preferred mobile device receives push notifications when no desktop was recently active.`}),(0,Q.jsx)(U,{open:i!==null,onClose:()=>a(null),title:`Rename device`,confirmLabel:`Save`,danger:!1,busy:c,error:u,confirmDisabled:!o.trim(),onConfirm:D,children:(0,Q.jsx)(Y,{"aria-label":`Device name`,maxLength:80,value:o,autoComplete:`off`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o.trim()&&!c&&D()}})}),(0,Q.jsxs)(U,{open:f!==null,onClose:()=>p(null),title:f?`Revoke ${f.name}?`:`Revoke device`,confirmLabel:`Revoke device`,busy:g,error:b,onConfirm:w,children:[(0,Q.jsx)(`p`,{className:`text-sm`,children:`Its credential stops working immediately and its push subscription is removed. To use it again, sign in on it again.`}),f?.id===n&&(0,Q.jsx)(`p`,{className:`text-sm font-medium text-danger`,children:`This is the device you are using now. Revoking it signs you out here.`})]})]})}function Wt(){let e=Pe(e=>e.sendWithEnter),t=Pe(e=>e.set),n=Re(),r=Ie();Ee(e=>e.me);let i=Ae(),a=h(e=>i?e.devices[i]:void 0);return(0,Q.jsxs)(H,{title:`This device`,description:`These preferences are stored in this browser only; your other devices keep their own.`,children:[(0,Q.jsx)(G,{title:`Composer`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(fe,{label:`Send with Enter`,description:`On desktop, Enter sends the message and Shift+Enter inserts a newline. When off, Enter inserts a newline; send with the Send button.`,checked:e,onChange:e=>t(`sendWithEnter`,e)}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted`,children:[`On mobile, Return always inserts a newline and messages are sent with the Send button.`,n===`mobile`||r?` That applies on this device now.`:``]})]})}),(0,Q.jsx)(G,{title:`Identity`,children:(0,Q.jsx)(R,{items:[[`Name`,a?.name??`Unknown`],[`Kind`,a?Bt[a.kind]:`Unknown`],[`Device ID`,(0,Q.jsx)(`span`,{className:`break-all font-mono`,children:i??`Unknown`},`id`)]]})})]})}var $=e=>e==null||e===``?`Unknown`:String(e);function Gt(){let e=wt(Pt,Nt),t=e.data,n=At(Array.isArray(t?.diagnostics)?t.diagnostics:void 0),r=h(e=>e.hosts),i=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{icon:(0,Q.jsx)(ae,{className:`size-4`}),disabled:!t,onClick:()=>t&&de(JSON.stringify(t,null,2),`Diagnostics JSON copied`),children:`Copy diagnostics JSON`}),(0,Q.jsx)(E,{busy:e.loading&&!!t,icon:(0,Q.jsx)(b,{className:`size-4`}),onClick:e.reload,children:`Refresh`})]}),a;if(e.fatal)a=(0,Q.jsx)(j,{error:e.error,diagnosticsHref:`/settings/diagnostics`});else if(e.error&&!t)a=(0,Q.jsx)(O,{title:`Could not load diagnostics`,error:e.error,onRetry:e.reload});else if(!t)a=(0,Q.jsx)(k,{label:`Loading diagnostics…`});else{let i=t.migrationLevel!==void 0&&t.latestMigration!==void 0&&t.migrationLevel>=t.latestMigration,o=(t.hosts??[]).filter(e=>!e.revokedAt);a=(0,Q.jsxs)(Q.Fragment,{children:[e.error?(0,Q.jsx)(O,{compact:!0,title:`Refresh failed`,error:e.error,onRetry:e.reload}):null,(0,Q.jsx)(G,{title:`Versions`,children:(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(`table`,{className:`w-full min-w-0 text-left text-sm`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{className:`border-b border-border text-muted`,children:[(0,Q.jsx)(`th`,{scope:`col`,className:`py-1 pr-4 font-medium`,children:`Component`}),(0,Q.jsx)(`th`,{scope:`col`,className:`py-1 font-medium`,children:`Version`})]})}),(0,Q.jsxs)(`tbody`,{children:[Object.entries(t.versions).map(([e,t])=>(0,Q.jsxs)(`tr`,{className:`border-b border-border last:border-b-0`,children:[(0,Q.jsx)(`th`,{scope:`row`,className:`py-1 pr-4 font-normal capitalize`,children:e}),(0,Q.jsx)(`td`,{className:`py-1 font-mono break-all`,children:$(t)})]},e)),(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`row`,className:`py-1 pr-4 font-normal`,children:`Supported Pi`}),(0,Q.jsx)(`td`,{className:`py-1 font-mono`,children:Ke})]})]})]})})}),(0,Q.jsx)(G,{title:`Coordinator`,children:(0,Q.jsx)(R,{items:[[`Database migration`,(0,Q.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`span`,{children:[`Level `,$(t.migrationLevel),` of `,$(t.latestMigration)]}),i?(0,Q.jsx)(W,{icon:q,tone:`success`,label:`Up to date`}):(0,Q.jsx)(W,{icon:C,tone:`warning`,label:`Behind latest`})]},`m`)],[`Public URL`,(0,Q.jsx)(`span`,{className:`break-all`,children:$(t.publicUrl)},`u`)],[`Events`,t.events?`Seq ${$(t.events.minSeq)} to ${$(t.events.maxSeq)} stored (current ${$(t.events.currentSeq)}, oldest retained ${$(t.events.minRetainedSeq)})`:`Unknown`],[`Event retention`,t.events?.retentionDays==null?`Unknown`:`${t.events.retentionDays} days`],[`Push`,t.push?`${t.push.vapidConfigured?`VAPID keys configured`:`VAPID keys not configured`}, ${$(t.push.subscriptions)} subscription(s)`:`Unknown`],[`Connected clients`,`${$(t.clients?.connectedDevices)} device(s)`]]})}),(0,Q.jsx)(G,{title:`Hosts`,children:o.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No hosts enrolled.`}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col divide-y divide-border`,children:o.map(e=>{let t=r[e.id];return(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1 py-2 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,Q.jsx)(Fe,{kind:`host`,value:t?.connectivity??e.connectivity}),(0,Q.jsx)(le,{host:e})]}),(0,Q.jsxs)(`div`,{className:`text-xs text-muted`,children:[`Agent `,$(e.agentVersion),` · Last seen `,A(e.lastSeenAt)]}),e.unsupported&&e.unsupported.length>0&&(0,Q.jsx)(`ul`,{className:`list-disc pl-5 text-xs text-muted`,children:e.unsupported.map(e=>(0,Q.jsxs)(`li`,{className:`break-words`,children:[e.capability,`: `,e.reason]},e.capability))})]},e.id)})})}),(0,Q.jsx)(G,{title:`Recent diagnostics`,children:n.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No diagnostics recorded.`}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:n.slice(0,100).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-start gap-2 text-sm`,children:[(0,Q.jsx)(kt,{level:e.level}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1 break-words`,children:[e.message,e.adapterId&&(0,Q.jsxs)(`span`,{className:`block text-xs text-muted`,children:[`Adapter `,e.adapterId]})]}),(0,Q.jsx)(`time`,{dateTime:e.at,className:`text-xs text-muted`,children:D(e.at)})]},`${e.at}-${t}`))})})]})}return(0,Q.jsxs)(H,{title:`Diagnostics`,description:`Versions, database state, hosts and recent problems. Copy the JSON when reporting a problem.`,actions:i,children:[(0,Q.jsx)(z,{}),a]})}function Kt(e){return _(`/api/enrollments`,{kind:e})}function qt({expiresAt:e,onRenew:t,busy:n}){let r=se(e);return r!==null&&r<=0?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,role:`status`,children:[(0,Q.jsx)(C,{"aria-hidden":!0,className:`size-4 shrink-0 text-warning`}),(0,Q.jsx)(`span`,{className:`font-medium`,children:`Expired: create a new link`}),(0,Q.jsx)(E,{size:`sm`,busy:n,icon:(0,Q.jsx)(b,{className:`size-4`}),onClick:t,children:`Create new link`})]}):(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,Q.jsx)(Oe,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,Q.jsxs)(`span`,{children:[`Expires in`,` `,(0,Q.jsx)(`span`,{className:`font-mono tabular-nums`,children:r===null?`unknown`:ge(r)}),`. Single use.`]})]})}function Jt({busy:e,error:t,onRetry:n}){return e?(0,Q.jsx)(k,{label:`Creating a single-use link…`}):t?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(V,{error:t}),(0,Q.jsx)(E,{icon:(0,Q.jsx)(b,{className:`size-4`}),onClick:n,children:`Retry`})]}):null}function Yt(e){let t=ve(e),n=t.find(e=>!He(e));return n?{folders:t,problem:`"${n}" is not an absolute path or a ~/ path.`}:t.length>20?{folders:t,problem:`Use at most 20 folders.`}:{folders:t,problem:null}}function Xt(e,t=Date.now()){return e?e.state===`running`?`Scanning…`:e.state===`failed`?`Last scan failed ${A(e.finishedAt??e.startedAt,t)}: ${e.errors.at(-1)??`unknown error`}`:`Last scanned ${A(e.finishedAt,t)}: ${e.repositories} repositories, ${e.checkoutsAdded} new checkouts, ${e.projectsCreated} new projects.`:`Not scanned yet.`}function Zt({host:e}){let t=(0,X.useId)(),n=(e.projectFolders??[]).join(`
2
+ `),[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(!1),[l,u]=(0,X.useState)(null),d=r??n,f=r!==null&&r!==n,{folders:p,problem:h}=Yt(d),g=e.projectScan,v=s||g?.state===`running`,y=e.connectivity===`connected`,b=n?y?v?`A scan is running`:null:`${e.name} is offline`:`Save a folder first`,x=async()=>{o(!0),u(null);try{await m(`/api/hosts/${encodeURIComponent(e.id)}`,{projectFolders:p}),J.success(`Project folders saved`),i(null)}catch(e){u(e)}finally{o(!1)}},S=async()=>{c(!0),u(null);try{let t=await _(`/api/hosts/${encodeURIComponent(e.id)}/scan-projects`);J.success(`Found ${t.repositories} repositories; ${t.projectsCreated} new projects`)}catch(e){u(e)}finally{c(!1)}},C=f?h:null;return(0,Q.jsx)(G,{title:`Project folders`,description:`Every Git repository directly inside these folders becomes a project, or another checkout of the project with the same remote. Folders are rescanned when the host connects and every 10 minutes; nothing is removed automatically.`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsx)(I,{id:`${t}-folders`,label:`Folders on this host`,hint:`One per line: an absolute path or ~/..., e.g. ~/Projects.`,error:C,children:(0,Q.jsx)(Ve,{id:`${t}-folders`,value:d,onChange:e=>i(e.target.value),minRows:3,placeholder:`~/Projects`,className:`font-mono`,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,...F(`${t}-folders`,{hint:!0,error:C})})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(E,{variant:`primary`,icon:(0,Q.jsx)(Ce,{className:`size-4`}),busy:a,disabled:!f||!!h,onClick:x,children:`Save folders`}),(0,Q.jsx)(E,{icon:(0,Q.jsx)(ft,{className:`size-4`}),busy:s,disabled:!!b,title:b??void 0,onClick:S,children:`Scan now`})]}),(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-muted`,children:s?`Scanning…`:Xt(g)}),g&&g.state!==`running`&&g.errors.length>0&&(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-0.5 text-xs text-muted`,children:g.errors.map(e=>(0,Q.jsx)(`li`,{className:`break-words`,children:e},e))}),(0,Q.jsx)(V,{error:l})]})})}var Qt={prompt:`Prompt`,steer:`Steer a running turn`,followUp:`Queue follow-up`,abort:`Abort`,resume:`Resume`,rename:`Rename session`,importInactive:`Import inactive sessions`,extensionDialogs:`Extension dialogs`,customUi:`Custom extension UI`,widgetsText:`Text widgets`,widgetsComponent:`Component widgets`,tokenAccounting:`Token accounting`,costAccounting:`Cost accounting`};function $t(){let e=P(),t=f(),[n,r]=(0,X.useState)(!1),i=t.filter(e=>e.connectivity!==`connected`);return(0,Q.jsxs)(H,{testId:`settings-hosts`,title:`Hosts`,description:`Machines that run Pi sessions through the Switchyard host agent.`,actions:(0,Q.jsx)(E,{variant:`primary`,icon:(0,Q.jsx)(K,{className:`size-4`}),onClick:()=>r(!0),children:`Add host`}),children:[(0,Q.jsx)(z,{}),e?t.length===0?(0,Q.jsx)(M,{icon:(0,Q.jsx)(N,{className:`size-8`}),title:`No hosts yet`,description:`Add a host to run Pi sessions. You will get a command to run on that machine.`,action:{label:`Add host`,onClick:()=>r(!0)}}):(0,Q.jsxs)(Q.Fragment,{children:[i.map(e=>(0,Q.jsx)(T,{compact:!0,hostName:e.name,connectivity:e.connectivity===`reconnecting`?`reconnecting`:`unreachable`,lastSeenAt:e.lastSeenAt},e.id)),(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:t.map(e=>(0,Q.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,Q.jsx)(en,{host:e})},e.id))})]}):(0,Q.jsx)(k,{label:`Loading hosts…`}),(0,Q.jsx)(rn,{open:n,onClose:()=>r(!1)})]})}function en({host:e}){return(0,Q.jsxs)(r,{to:L(`hosts/${encodeURIComponent(e.id)}`),className:`tap flex min-w-0 items-center gap-3 px-4 py-3 hover:bg-surface-2`,children:[(0,Q.jsx)(N,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted`,children:he[e.platform]})]}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(Fe,{kind:`host`,value:e.connectivity}),(0,Q.jsx)(le,{host:e}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted`,children:[`Last seen `,A(e.lastSeenAt)]})]})]}),(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})}var tn=`@spencerboucher/switchyard`;function nn(e){return[`npm install -g ${tn}`,e,`switchyard host install-service`].join(`
3
+ `)}function rn({open:e,onClose:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(null),c=async()=>{a(!0),s(null);try{r(await Kt(`host`))}catch(e){s(e)}finally{a(!1)}},l=()=>{r(null),s(null),t()};return(0,Q.jsx)(Be,{open:e,onClose:l,title:`Add host`,description:`Enroll a machine that runs Pi. Provider credentials stay on that machine.`,footer:(0,Q.jsx)(E,{onClick:l,children:`Done`}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[!n&&!i&&!o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-sm`,children:`Create a single-use enrollment, then run the command it shows on the new host. The host appears here once its agent connects.`}),(0,Q.jsx)(E,{variant:`primary`,onClick:c,children:`Create enrollment command`})]}),(0,Q.jsx)(Jt,{busy:i,error:o,onRetry:c}),n&&!i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-sm`,children:`Run this on the host, as the user that should run Pi (it needs Node 24 or newer, git and Pi):`}),(0,Q.jsx)(pe,{text:n.command?nn(n.command):n.url,label:n.command?`Host setup commands`:`Host enrollment link`,copyLabel:`Copy commands`}),(0,Q.jsx)(qt,{expiresAt:n.expiresAt,onRenew:c,busy:i})]})]})})}function an(){let{hostId:e=``}=s(),t=P(),i=h(t=>t.hosts[e]),a=h(t=>t.adapters[e]),o=h(e=>e.checkouts),c=h(e=>e.projects),l=n(),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),[m,g]=(0,X.useState)(null),v=(0,X.useMemo)(()=>Object.values(o).filter(t=>t.hostId===e).sort((e,t)=>e.path.localeCompare(t.path)),[o,e]),y={to:L(`hosts`),label:`Hosts`};if(!t)return(0,Q.jsx)(H,{title:`Host`,back:y,children:(0,Q.jsx)(k,{label:`Loading host…`})});if(!i||i.revokedAt)return(0,Q.jsx)(H,{title:`Host`,back:y,children:(0,Q.jsx)(M,{icon:(0,Q.jsx)(N,{className:`size-8`}),title:i?`This host was revoked`:`Host not found`,description:i?`${i.name} was revoked ${A(i.revokedAt)}. Add it again to use it.`:`It may have been revoked or never enrolled with this coordinator.`,action:{label:`Back to hosts`,to:L(`hosts`)}})});let b=async()=>{p(!0),g(null);try{await _(`/api/hosts/${encodeURIComponent(i.id)}/revoke`),J.success(`Host ${i.name} revoked`),d(!1),l(L(`hosts`))}catch(e){g(e)}finally{p(!1)}},S=i.capabilities,C=e=>S?.unsupported.find(t=>t.capability===e)?.reason,w=S?.unsupported.filter(e=>!We.includes(e.capability))??[];return(0,Q.jsxs)(H,{title:i.name,description:`${he[i.platform]} host`,back:y,actions:(0,Q.jsx)(E,{variant:`danger`,icon:(0,Q.jsx)(vt,{className:`size-4`}),onClick:()=>{g(null),d(!0)},children:`Revoke host`}),children:[(0,Q.jsx)(z,{}),i.connectivity!==`connected`&&(0,Q.jsx)(T,{compact:!0,hostName:i.name,connectivity:i.connectivity===`reconnecting`?`reconnecting`:`unreachable`,lastSeenAt:i.lastSeenAt}),(0,Q.jsx)(G,{title:`Connectivity and versions`,children:(0,Q.jsx)(R,{items:[[`Status`,(0,Q.jsx)(Fe,{kind:`host`,value:i.connectivity},`s`)],[`Last seen`,i.lastSeenAt?`${A(i.lastSeenAt)} (${D(i.lastSeenAt)})`:`Never`],[`Platform`,he[i.platform]],[`Agent version`,(0,Q.jsx)(`span`,{className:`font-mono`,children:i.agentVersion},`a`)],[`Pi`,(0,Q.jsx)(le,{host:i},`p`)],[`Enrolled`,D(i.createdAt)]]})}),(0,Q.jsx)(G,{title:`Capabilities`,description:`What Pi on this host supports. Unsupported features are hidden or explained in sessions.`,children:S?(0,Q.jsxs)(`ul`,{className:`grid min-w-0 gap-2 sm:grid-cols-2`,children:[We.map(e=>{let t=S[e],n=C(e);return(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,children:[t?(0,Q.jsx)(q,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-success`}):(0,Q.jsx)(Le,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-muted`}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:Qt[e]}),(0,Q.jsxs)(`span`,{className:`text-muted`,children:[`: `,t?`Supported`:`Not supported`]}),!t&&n&&(0,Q.jsx)(`span`,{className:`block break-words text-xs text-muted`,children:n})]})]},e)}),w.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,children:[(0,Q.jsx)(Le,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-muted`}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`font-medium break-words`,children:e.capability}),(0,Q.jsx)(`span`,{className:`text-muted`,children:`: Not supported`}),(0,Q.jsx)(`span`,{className:`block break-words text-xs text-muted`,children:e.reason})]})]},e.capability))]}):(0,Q.jsx)(x,{capability:`Capability report`,reason:`This host has not reported its Pi capabilities yet. It may be offline, or Pi may be missing or incompatible.`})}),(0,Q.jsx)(Zt,{host:i}),(0,Q.jsx)(G,{title:`Checkout mappings`,description:`Project clones on this host. Sessions and runs for a project use these paths.`,children:v.length===0?(0,Q.jsx)(M,{className:`py-4`,title:`No checkouts on this host`,description:`Create a project or add a checkout to an existing project.`,action:{label:`Open projects`,to:L(`projects`)}}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col divide-y divide-border`,children:v.map(e=>(0,Q.jsxs)(`li`,{className:`min-w-0 py-2 text-sm`,children:[(0,Q.jsx)(r,{to:L(`projects/${encodeURIComponent(e.projectId)}`),className:`font-medium text-accent hover:underline`,children:c[e.projectId]?.name??`Unknown project`}),(0,Q.jsx)(`div`,{className:`break-all font-mono text-xs`,children:e.path}),(0,Q.jsxs)(`div`,{className:`text-xs text-muted`,children:[`Default branch: `,e.defaultBranch]})]},e.id))})}),(0,Q.jsx)(G,{title:`Adapters`,actions:(0,Q.jsx)(r,{to:L(`adapters`),className:`text-sm font-medium text-accent`,children:`All adapters`}),children:!a||a.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No adapters reported by this host.`}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:a.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:`break-all font-mono`,children:e.id}),(0,Q.jsx)(`span`,{className:`text-muted`,children:e.version}),(0,Q.jsx)(Et,{status:e.status})]},e.id))})}),(0,Q.jsx)(U,{open:u,onClose:()=>d(!1),title:`Revoke ${i.name}?`,confirmLabel:`Revoke host`,busy:f,error:m,onConfirm:b,children:(0,Q.jsx)(`p`,{className:`text-sm`,children:`The host agent is disconnected and its credential stops working. Sessions on it are not moved or restarted elsewhere. To use this machine again, add it as a new host.`})})]})}var on={granted:{icon:ct,label:`Allowed`,tone:`success`,guidance:`This device can show Switchyard notifications.`},denied:{icon:ot,label:`Blocked`,tone:`danger`,guidance:`Notifications are blocked for this site. Allow them in your browser's site settings (or the system notification settings for the Home Screen app), then reload.`},default:{icon:ke,label:`Not requested yet`,tone:`neutral`,guidance:`Enable notifications to hear about sessions that need input, failed, or are ready for review.`},unknown:{icon:ke,label:`Unknown`,tone:`neutral`,guidance:`The browser did not report a permission state. Try enabling notifications.`},unsupported:{icon:Le,label:`Not supported`,tone:`warning`,guidance:`This browser cannot receive web push here. On iPhone and iPad, add Switchyard to the Home Screen first.`}};function sn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}function cn(e){let t=Z(e)&&Z(e.settings)?e.settings:e;return!Z(t)||typeof t.privatePreviews!=`boolean`?null:{quietHours:Z(t.quietHours)?t.quietHours:null,privatePreviews:t.privatePreviews,preferredDeviceId:typeof t.preferredDeviceId==`string`?t.preferredDeviceId:null}}function ln(){let[e,t]=(0,X.useState)(()=>Ye()),[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),c=nt()&&!Je();(0,X.useEffect)(()=>{let e=!0;Qe().then(t=>e&&r(t!==null)).catch(()=>e&&r(!1));let n=()=>{document.visibilityState===`visible`&&t(Ye())};return document.addEventListener(`visibilitychange`,n),()=>{e=!1,document.removeEventListener(`visibilitychange`,n)}},[]);let l=()=>{a(`enable`),s(null),$e().then(e=>{t(e),e===`granted`?(r(!0),J.success(`Notifications enabled on this device`)):e===`denied`&&J.error(`Notifications were blocked. Allow them in your browser settings.`)}).catch(e=>{s(e),t(Ye())}).finally(()=>a(null))},u=async()=>{a(`disable`),s(null);try{await Ze(),r(!1),J.success(`Notifications disabled on this device`)}catch(e){s(e)}finally{a(null)}},d=async()=>{a(`test`),s(null);try{await et(),J.success(`Test notification sent. It can take a few seconds to arrive.`)}catch(e){s(e),J.error(`Test notification failed: ${y(e)}`)}finally{a(null)}},f=on[e]??on.unknown;return(0,Q.jsxs)(H,{testId:`settings-notifications`,title:`Notifications`,description:`Push notifications for sessions that need input, failed, or are ready for review.`,children:[(0,Q.jsx)(G,{title:`This device`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`Permission:`}),(0,Q.jsx)(W,{icon:f.icon,label:f.label,tone:f.tone}),n!==null&&e===`granted`&&(0,Q.jsx)(`span`,{className:`text-muted`,children:n?`Subscribed to push`:`Not subscribed to push`})]}),(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:f.guidance}),c&&(0,Q.jsxs)(`div`,{className:`rounded-md border border-border bg-surface-2 p-3 text-sm`,children:[(0,Q.jsxs)(`p`,{className:`mb-2 flex items-center gap-2 font-medium`,children:[(0,Q.jsx)(bt,{"aria-hidden":!0,className:`size-4 shrink-0`}),`On iPhone and iPad, notifications need the Home Screen app`]}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-1 pl-5`,children:[(0,Q.jsx)(`li`,{children:`Tap Share`}),(0,Q.jsx)(`li`,{children:`Add to Home Screen`}),(0,Q.jsx)(`li`,{children:`Open Switchyard from the Home Screen`}),(0,Q.jsx)(`li`,{children:`Enable notifications here`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e!==`unsupported`&&!(e===`granted`&&n)&&(0,Q.jsx)(E,{variant:`primary`,icon:(0,Q.jsx)(ct,{className:`size-4`}),busy:i===`enable`,disabled:i!==null&&i!==`enable`,onClick:l,children:`Enable notifications`}),n&&(0,Q.jsx)(E,{icon:(0,Q.jsx)(ot,{className:`size-4`}),busy:i===`disable`,disabled:i!==null&&i!==`disable`,onClick:u,children:`Disable on this device`}),(0,Q.jsx)(E,{icon:(0,Q.jsx)(we,{className:`size-4`}),busy:i===`test`,disabled:i!==null&&i!==`test`,onClick:d,children:`Send test notification`})]}),e===`unsupported`&&(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Enabling is not possible in this browser. A test notification still goes to your other subscribed devices.`}),(0,Q.jsx)(V,{error:o}),(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`Delivery and clearing are best effort: browsers and operating systems may delay, group or keep notifications even after you answer elsewhere.`})]})}),(0,Q.jsx)(un,{})]})}function un(){let e=wt(`/api/me/notification-settings`,e=>!!cn(e)),t=(0,X.useMemo)(()=>e.data?cn(e.data):null,[e.data]),n=e.error instanceof g&&e.error.status===404;return(0,Q.jsx)(G,{title:`Delivery preferences`,description:`Shared by all your devices. Attention items in Switchyard are unaffected.`,children:n?(0,Q.jsx)(x,{capability:`Notification settings`,reason:`This coordinator does not expose notification settings yet`}):e.fatal?(0,Q.jsx)(j,{error:e.error}):e.error&&!t?(0,Q.jsx)(O,{compact:!0,title:`Could not load notification settings`,error:e.error,onRetry:e.reload}):t?(0,Q.jsx)(fn,{settings:t,onSaved:t=>e.setData(t)}):(0,Q.jsx)(k,{label:`Loading notification settings…`})})}var dn=/^\d{2}:\d{2}$/;function fn({settings:e,onSaved:t}){let n=(0,X.useId)(),r=h(e=>e.devices),i=(0,X.useMemo)(()=>Object.values(r).filter(e=>e.revokedAt===null).sort((e,t)=>e.name.localeCompare(t.name)),[r]),[a,o]=(0,X.useState)(e.quietHours!==null),[s,c]=(0,X.useState)(e.quietHours?.start??`22:00`),[l,u]=(0,X.useState)(e.quietHours?.end??`07:00`),[d,f]=(0,X.useState)(e.quietHours?.timezone??sn()),[p,g]=(0,X.useState)(e.privatePreviews),[_,v]=(0,X.useState)(e.preferredDeviceId??``),[y,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(null),C=a&&!dn.test(s)?`Use a time like 22:00.`:null,w=a&&!dn.test(l)?`Use a time like 07:00.`:null,T=a&&!d.trim()?`Enter a time zone, e.g. Europe/Berlin.`:null,D=!_||i.some(e=>e.id===_);return(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:async e=>{if(e.preventDefault(),C||w||T)return;let n={quietHours:a?{start:s,end:l,timezone:d.trim()}:null,privatePreviews:p,preferredDeviceId:_||null};b(!0),S(null);try{t(cn(await m(`/api/me/notification-settings`,n))??n),J.success(`Notification preferences saved`)}catch(e){S(e)}finally{b(!1)}},noValidate:!0,children:[(0,Q.jsx)(fe,{label:`Quiet hours`,description:`No push notifications during these hours. Attention items still collect in Switchyard.`,checked:a,onChange:o}),a&&(0,Q.jsxs)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-3`,children:[(0,Q.jsx)(I,{id:`${n}-start`,label:`From`,error:C,children:(0,Q.jsx)(Y,{id:`${n}-start`,type:`time`,value:s,onChange:e=>c(e.target.value),...F(`${n}-start`,{error:C})})}),(0,Q.jsx)(I,{id:`${n}-end`,label:`Until`,error:w,children:(0,Q.jsx)(Y,{id:`${n}-end`,type:`time`,value:l,onChange:e=>u(e.target.value),...F(`${n}-end`,{error:w})})}),(0,Q.jsx)(I,{id:`${n}-tz`,label:`Time zone`,error:T,children:(0,Q.jsx)(Y,{id:`${n}-tz`,value:d,onChange:e=>f(e.target.value),autoCapitalize:`off`,spellCheck:!1,...F(`${n}-tz`,{error:T})})})]}),(0,Q.jsx)(fe,{label:`Private previews`,description:`Hide task and session text in notifications; show only the status, e.g. Needs input.`,checked:p,onChange:g}),(0,Q.jsx)(I,{id:`${n}-device`,label:`Preferred device`,hint:`Receives push when no desktop was recently active.`,children:(0,Q.jsxs)(B,{id:`${n}-device`,value:_,onChange:e=>v(e.target.value),...F(`${n}-device`,{hint:!0}),children:[(0,Q.jsx)(`option`,{value:``,children:`Automatic (the preferred mobile device)`}),i.map(e=>(0,Q.jsxs)(`option`,{value:e.id,children:[e.name,e.push.subscribed?``:` (no push subscription)`]},e.id)),!D&&(0,Q.jsxs)(`option`,{value:_,children:[`Unknown device (`,_,`)`]})]})}),(0,Q.jsx)(V,{error:x}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(E,{type:`submit`,variant:`primary`,busy:y,icon:(0,Q.jsx)(Ce,{className:`size-4`}),children:`Save preferences`})})]})}var pn={ask:`Ask`,approve:`Approve`,ignore:`Ignore`},mn={ask:`Ask before trusting project-local Pi settings and extensions.`,approve:`Trust project-local Pi settings and extensions automatically.`,ignore:`Never load project-local Pi settings or extensions.`},hn=Ue.options,gn={all:`Loads your extensions, skills and prompt templates.`,vanilla:`Starts Pi with --no-extensions --no-skills --no-prompt-templates (also no built-in MCP). Your logins, default model and AGENTS.md still apply, and Switchyard's model, effort, context and command controls keep working.`};function _n(e){let t=[];return e.forEach((e,n)=>{let r=Ge.safeParse(e);r.success||t.push(`Line ${n+1} (${e}): ${r.error.issues[0]?.message??`invalid argument`}`)}),t}function vn(){let e=P(),t=h(e=>e.profiles),n=h(e=>e.projects),r=(0,X.useMemo)(()=>Object.values(t).sort((e,t)=>e.name.localeCompare(t.name)),[t]),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(!1),[u,f]=(0,X.useState)(null),p=async()=>{if(o){l(!0),f(null);try{await d(`/api/profiles/${encodeURIComponent(o.id)}`),J.success(`Profile ${o.name} deleted`),s(null)}catch(e){f(e)}finally{l(!1)}}},m=e=>Object.values(n).filter(t=>t.defaultProfileId===e).map(e=>e.name);return(0,Q.jsxs)(H,{title:`Pi profiles`,description:`Presets for provider, model, thinking level and Pi flags. Sessions keep a snapshot of the profile they started with.`,actions:(0,Q.jsx)(E,{variant:`primary`,icon:(0,Q.jsx)(K,{className:`size-4`}),onClick:()=>a(`new`),children:`New profile`}),children:[(0,Q.jsx)(z,{}),e?r.length===0?(0,Q.jsx)(M,{icon:(0,Q.jsx)(re,{className:`size-8`}),title:`No profiles`,description:`Create a profile to choose a provider and model for sessions.`,action:{label:`New profile`,onClick:()=>a(`new`)}}):(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:r.map(e=>{let t=m(e.id);return(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-start gap-3 border-b border-border px-4 py-3 last:border-b-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,Q.jsxs)(`span`,{className:`break-words text-muted`,children:[e.provider??`Default provider`,` / `,e.model??`default model`,` · Thinking`,` `,e.thinking??`default`,` · Project trust `,pn[e.projectTrust],e.resources===`vanilla`&&` · Vanilla Pi`]}),e.extraArgs.length>0&&(0,Q.jsx)(`span`,{className:`break-all font-mono text-xs text-muted`,children:e.extraArgs.join(` `)}),t.length>0&&(0,Q.jsxs)(`span`,{className:`text-xs text-muted`,children:[`Default for `,t.join(`, `)]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(E,{size:`sm`,icon:(0,Q.jsx)(xe,{className:`size-4`}),onClick:()=>a(e),children:`Edit`}),(0,Q.jsx)(E,{size:`sm`,variant:`ghost`,className:`text-danger`,icon:(0,Q.jsx)(Te,{className:`size-4`}),onClick:()=>{f(null),s(e)},children:`Delete`})]})]},e.id)})}):(0,Q.jsx)(k,{label:`Loading profiles…`}),i&&(0,Q.jsx)(yn,{profile:i===`new`?null:i,onClose:()=>a(null)},i===`new`?`new`:i.id),(0,Q.jsx)(U,{open:o!==null,onClose:()=>s(null),title:o?`Delete ${o.name}?`:`Delete profile`,confirmLabel:`Delete profile`,busy:c,error:u,onConfirm:p,children:(0,Q.jsx)(`p`,{className:`text-sm`,children:`Existing sessions keep their snapshot of this profile. Projects that use it as their default must be changed first.`})})]})}function yn({profile:e,onClose:t}){let n=(0,X.useId)(),[r,i]=(0,X.useState)(e?.name??``),[a,o]=(0,X.useState)(e?.provider??``),[s,c]=(0,X.useState)(e?.model??``),[l,u]=(0,X.useState)(e?.thinking??``),[d,f]=(0,X.useState)(e?.projectTrust??`ask`),[p,h]=(0,X.useState)(e?.resources??`all`),[g,v]=(0,X.useState)((e?.extraArgs??[]).join(`
4
+ `)),[y,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(!1),[C,w]=(0,X.useState)(null),T=ve(g),D=_n(T),O=y&&!r.trim()?`Enter a profile name.`:null,k=D.length?D.join(`
5
+ `):null,A=async n=>{if(n.preventDefault(),b(!0),!r.trim()||D.length)return;let i={name:r.trim(),provider:a.trim()||null,model:s.trim()||null,thinking:l||null,projectTrust:d,resources:p,extraArgs:T};S(!0),w(null);try{e?(await m(`/api/profiles/${encodeURIComponent(e.id)}`,i),J.success(`Profile ${i.name} saved`)):(await _(`/api/profiles`,i),J.success(`Profile ${i.name} created`)),t()}catch(e){w(e)}finally{S(!1)}},j=`${n}-form`;return(0,Q.jsx)(Be,{open:!0,onClose:x?()=>void 0:t,dismissOnBackdrop:!x,title:e?`Edit ${e.name}`:`New profile`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{onClick:t,disabled:x,children:`Cancel`}),(0,Q.jsx)(E,{type:`submit`,form:j,variant:`primary`,busy:x,children:e?`Save profile`:`Create profile`})]}),children:(0,Q.jsxs)(`form`,{id:j,className:`flex min-w-0 flex-col gap-4`,onSubmit:A,noValidate:!0,children:[(0,Q.jsx)(I,{id:`${n}-name`,label:`Name`,error:O,children:(0,Q.jsx)(Y,{id:`${n}-name`,value:r,onChange:e=>i(e.target.value),...F(`${n}-name`,{error:O})})}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)(I,{id:`${n}-provider`,label:`Provider`,hint:`Empty uses Pi's default.`,children:(0,Q.jsx)(Y,{id:`${n}-provider`,value:a,onChange:e=>o(e.target.value),placeholder:`anthropic`,autoCapitalize:`off`,spellCheck:!1,...F(`${n}-provider`,{hint:!0})})}),(0,Q.jsx)(I,{id:`${n}-model`,label:`Model`,hint:`Empty uses Pi's default.`,children:(0,Q.jsx)(Y,{id:`${n}-model`,value:s,onChange:e=>c(e.target.value),autoCapitalize:`off`,spellCheck:!1,...F(`${n}-model`,{hint:!0})})})]}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)(I,{id:`${n}-thinking`,label:`Thinking`,children:(0,Q.jsxs)(B,{id:`${n}-thinking`,value:l,onChange:e=>u(e.target.value),children:[(0,Q.jsx)(`option`,{value:``,children:`Default (none)`}),hn.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))]})}),(0,Q.jsx)(I,{id:`${n}-trust`,label:`Project trust`,hint:mn[d],children:(0,Q.jsx)(B,{id:`${n}-trust`,value:d,onChange:e=>f(e.target.value),...F(`${n}-trust`,{hint:!0}),children:Object.keys(pn).map(e=>(0,Q.jsx)(`option`,{value:e,children:pn[e]},e))})})]}),(0,Q.jsx)(I,{id:`${n}-resources`,label:`Resources`,hint:gn[p],children:(0,Q.jsxs)(B,{id:`${n}-resources`,value:p,onChange:e=>h(e.target.value),...F(`${n}-resources`,{hint:!0}),children:[(0,Q.jsx)(`option`,{value:`all`,children:`Your Pi setup`}),(0,Q.jsx)(`option`,{value:`vanilla`,children:`Vanilla Pi`})]})}),(0,Q.jsx)(I,{id:`${n}-extra`,label:`Extra Pi arguments`,hint:`One long flag per line, e.g. --max-turns=40. Session, mode and extension flags are managed by Switchyard.`,error:k,children:(0,Q.jsx)(Ve,{id:`${n}-extra`,value:g,minRows:3,onChange:e=>v(e.target.value),className:`font-mono`,autoCapitalize:`off`,spellCheck:!1,...F(`${n}-extra`,{hint:!0,error:k})})}),(0,Q.jsx)(V,{error:C})]})})}var bn={managed:`Managed by Switchyard`,discovered:`Discovered worktree`,main:`Main checkout`},xn={none:{icon:je,label:`No setup`,tone:`neutral`},running:{icon:ze,label:`Setup running`,tone:`info`},succeeded:{icon:q,label:`Setup succeeded`,tone:`success`},failed:{icon:Me,label:`Setup failed`,tone:`danger`}};function Sn(e){let t=[e.dirty?`Uncommitted changes (${e.changedFiles} file${e.changedFiles===1?``:`s`})`:`Clean`];return(e.ahead||e.behind)&&t.push(`${e.ahead} ahead, ${e.behind} behind`),t.push(e.unmerged?`Not merged into base`:`Merged`),t.join(` · `)}function Cn({project:e}){let t=h(e=>e.workspaces),n=h(e=>e.hosts),r=(0,X.useMemo)(()=>Object.values(t).filter(t=>t.projectId===e.id&&t.archivedAt===null).sort((e,t)=>Number(t.provenance===`main`)-Number(e.provenance===`main`)||(e.branch??``).localeCompare(t.branch??``)),[t,e.id]),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),c=async e=>{s(e.id);try{await _(`/api/workspaces/${encodeURIComponent(e.id)}/refresh`),J.success(`Workspace status refreshed`)}catch(e){J.error(`Could not refresh: ${y(e)}`)}finally{s(null)}};return(0,Q.jsxs)(G,{title:`Workspaces`,description:`Worktrees where sessions and runs work. Removing one never deletes its branch.`,children:[r.length===0?(0,Q.jsx)(M,{className:`py-4`,title:`No workspaces`,description:`Workspaces appear after a checkout is discovered. Use Refresh to discover them again.`}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col divide-y divide-border`,children:r.map(e=>{let t=n[e.hostId],r=t?.connectivity!==`connected`,i=xn[e.setup.state]??xn.none;return(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1.5 py-3 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(be,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted`}),(0,Q.jsx)(`span`,{className:`min-w-0 break-all font-mono font-medium`,children:e.branch??`(detached HEAD)`}),(0,Q.jsx)(`span`,{className:`text-xs text-muted`,children:bn[e.provenance]})]}),(0,Q.jsxs)(`div`,{className:`break-all font-mono text-xs text-muted`,children:[t?.name?`${t.name}: `:``,e.path]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:Sn(e.git)}),(0,Q.jsx)(W,{icon:i.icon,label:i.label,tone:i.tone,spin:e.setup.state===`running`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(E,{size:`sm`,icon:(0,Q.jsx)(b,{className:`size-4`}),busy:o===e.id,disabled:r,onClick:()=>c(e),children:`Refresh status`}),e.provenance!==`main`&&(0,Q.jsx)(E,{size:`sm`,variant:`ghost`,className:`text-danger`,icon:(0,Q.jsx)(Te,{className:`size-4`}),disabled:r,onClick:()=>a(e),children:`Remove`}),e.provenance===`main`&&(0,Q.jsx)(`span`,{className:`text-xs text-muted`,children:`The main checkout cannot be removed; remove the project's checkout instead.`}),r&&(0,Q.jsxs)(`span`,{className:`text-xs text-muted`,children:[`Host `,t?.name??`unknown`,` is `,t?.connectivity??`unknown`,`: refresh and removal need it online.`]})]})]},e.id)})}),i&&(0,Q.jsx)(wn,{workspace:t[i.id]??i,onClose:()=>a(null)},i.id)]})}function wn({workspace:e,onClose:t}){let[n,r]=(0,X.useState)(e.git.dirty),[i,a]=(0,X.useState)(e.git.unmerged),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(!1),[f,m]=(0,X.useState)(null),h=n&&!o||i&&!c;return(0,Q.jsxs)(U,{open:!0,onClose:t,title:`Remove workspace?`,description:(0,Q.jsx)(`span`,{className:`break-all font-mono`,children:e.branch??e.path}),confirmLabel:`Remove workspace`,busy:u,error:f,onConfirm:async()=>{d(!0),m(null);try{await _(`/api/workspaces/${encodeURIComponent(e.id)}/remove`,{force:{dirty:o,unmerged:c}}),J.success(`Workspace ${e.branch??e.path} removed`),t()}catch(e){p(e,`workspace_dirty`)&&r(!0),p(e,`workspace_unmerged`)&&a(!0),m(e)}finally{d(!1)}},confirmDisabled:h,disabledReason:`Check the boxes above to confirm what will be lost.`,children:[(0,Q.jsxs)(`p`,{className:`text-sm`,children:[`The worktree at `,(0,Q.jsx)(`span`,{className:`break-all font-mono`,children:e.path}),` is deleted from the host. The branch is kept.`]}),n&&(0,Q.jsx)(me,{label:`Discard uncommitted changes`,description:e.git.dirty?`${e.git.changedFiles} changed file${e.git.changedFiles===1?``:`s`} will be lost.`:`The host reported uncommitted changes; they will be lost.`,checked:o,onChange:s}),i&&(0,Q.jsx)(me,{label:`Remove although the branch is not merged`,description:`Commits stay on the branch, but the workspace is gone.`,checked:c,onChange:l})]})}var Tn=`Inside the repository, for example .worktrees or .git/worktrees-switchyard`;function En(e){let t=e.trim();return t?t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.includes(`\\`)?`Use a relative path inside the repository, e.g. .worktrees.`:t.split(`/`).includes(`..`)?`The folder must stay inside the repository (no ..).`:qe.safeParse(t).success?null:`Use a plain relative path such as .worktrees (no empty or . segments).`:`Enter a folder inside the repository, e.g. .worktrees.`}function Dn(){let{projectId:e=``}=s(),t=P(),n=h(t=>t.projects[e]),r=h(e=>e.hosts),i=h(e=>e.profiles),[a,o]=(0,X.useState)(!1),[c,l]=(0,X.useState)([]),u=f(),d=(0,X.useMemo)(()=>Object.values(i).sort((e,t)=>e.name.localeCompare(t.name)),[i]),p={to:L(`projects`),label:`Projects`};return t?n?(0,Q.jsxs)(H,{title:n.name,description:(0,Q.jsx)(`span`,{className:`break-all`,children:n.repoIdentity}),back:p,actions:(0,Q.jsx)(E,{busy:a,icon:(0,Q.jsx)(b,{className:`size-4`}),onClick:async()=>{o(!0);try{let e=await _(`/api/projects/${encodeURIComponent(n.id)}/refresh`),t=Array.isArray(e?.errors)?e.errors:[];l(t),t.length?J.error(`Refreshed with ${t.length} checkout error(s)`):J.success(`Workspaces refreshed`)}catch(e){J.error(`Refresh failed: ${y(e)}`)}finally{o(!1)}},children:`Refresh`}),children:[(0,Q.jsx)(z,{}),c&&c.length>0&&(0,Q.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-border bg-danger-soft px-3 py-2 text-sm`,children:[(0,Q.jsx)(`p`,{className:`font-medium`,children:`Some checkouts could not be refreshed`}),(0,Q.jsx)(`ul`,{className:`list-disc pl-5`,children:c.map(e=>(0,Q.jsx)(`li`,{className:`break-words`,children:e.message},e.checkoutId))})]}),(0,Q.jsx)(On,{project:n,hosts:u,profiles:d},n.id),(0,Q.jsx)(kn,{project:n,hosts:u,hostsById:r}),(0,Q.jsx)(Cn,{project:n})]}):(0,Q.jsx)(H,{title:`Project`,back:p,children:(0,Q.jsx)(M,{icon:(0,Q.jsx)(ne,{className:`size-8`}),title:`Project not found`,description:`It may have been removed, or this link is from another coordinator.`,action:{label:`Back to projects`,to:L(`projects`)}})}):(0,Q.jsx)(H,{title:`Project`,back:p,children:(0,Q.jsx)(k,{label:`Loading project…`})})}function On({project:e,hosts:t,profiles:n}){let r=(0,X.useId)(),[i,a]=(0,X.useState)(e.name),[o,s]=(0,X.useState)(e.setupCommand??``),[c,l]=(0,X.useState)(e.checks.join(`
6
+ `)),[u,d]=(0,X.useState)(String(e.maxConcurrentRuns)),[f,p]=(0,X.useState)(e.automationEnabled),[h,g]=(0,X.useState)(e.workspaceSharing),[_,v]=(0,X.useState)(e.defaultProfileId??``),[y,b]=(0,X.useState)(e.defaultHostId??``),[x,S]=(0,X.useState)(e.worktreeDir??`.worktrees`),[C,w]=(0,X.useState)(!1),[T,D]=(0,X.useState)(null),O=Number(u),k=i.trim()?null:`Enter a project name.`,A=Number.isInteger(O)&&O>=1&&O<=32?null:`Use a whole number from 1 to 32.`,j=En(x),M=async t=>{if(t.preventDefault(),!(k||A||j)){w(!0),D(null);try{await m(`/api/projects/${encodeURIComponent(e.id)}`,{name:i.trim(),setupCommand:o.trim()||null,checks:ve(c),maxConcurrentRuns:O,automationEnabled:f,workspaceSharing:h,defaultProfileId:_||null,defaultHostId:y||null,worktreeDir:x.trim()}),J.success(`Project settings saved`)}catch(e){D(e)}finally{w(!1)}}},ee=!y||t.some(e=>e.id===y),te=!_||n.some(e=>e.id===_);return(0,Q.jsx)(G,{title:`Project settings`,children:(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:M,noValidate:!0,children:[(0,Q.jsx)(I,{id:`${r}-name`,label:`Name`,error:k,children:(0,Q.jsx)(Y,{id:`${r}-name`,value:i,onChange:e=>a(e.target.value),...F(`${r}-name`,{error:k})})}),(0,Q.jsx)(I,{id:`${r}-setup`,label:`Setup command`,hint:`Runs in each new workspace before the first session, e.g. pnpm install. Leave empty for none.`,children:(0,Q.jsx)(Y,{id:`${r}-setup`,value:o,onChange:e=>s(e.target.value),className:`font-mono`,spellCheck:!1,autoCapitalize:`off`,...F(`${r}-setup`,{hint:!0})})}),(0,Q.jsx)(I,{id:`${r}-checks`,label:`Checks`,hint:`One command per line. Runs must pass these before review.`,children:(0,Q.jsx)(Ve,{id:`${r}-checks`,value:c,minRows:3,onChange:e=>l(e.target.value),className:`font-mono`,spellCheck:!1,autoCapitalize:`off`,...F(`${r}-checks`,{hint:!0})})}),(0,Q.jsx)(I,{id:`${r}-runs`,label:`Max concurrent runs`,hint:`Between 1 and 32.`,error:A,children:(0,Q.jsx)(Y,{id:`${r}-runs`,type:`number`,inputMode:`numeric`,min:1,max:32,step:1,value:u,onChange:e=>d(e.target.value),className:`max-w-32`,...F(`${r}-runs`,{hint:!0,error:A})})}),(0,Q.jsx)(I,{id:`${r}-worktree`,label:`Worktree folder`,hint:Tn,error:j,children:(0,Q.jsx)(Y,{id:`${r}-worktree`,"data-testid":`project-worktree-dir`,value:x,onChange:e=>S(e.target.value),placeholder:`.worktrees`,className:`font-mono`,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,...F(`${r}-worktree`,{hint:!0,error:j})})}),(0,Q.jsx)(fe,{label:`Automation`,description:`When off, ready tasks in this project wait instead of starting automatically.`,checked:f,onChange:p}),(0,Q.jsxs)(`fieldset`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Q.jsx)(`legend`,{className:`mb-1 text-sm font-medium`,children:`Workspace sharing`}),[[`single_writer`,`Single writer`,`Only one run or session writes in a workspace at a time; others wait. Safest.`],[`shared`,`Shared`,`Several sessions may write in the same workspace at once. Their changes can interleave.`]].map(([e,t,n])=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`input`,{id:`${r}-sharing-${e}`,type:`radio`,name:`${r}-sharing`,value:e,checked:h===e,onChange:()=>g(e),"aria-describedby":`${r}-sharing-${e}-desc`,className:`tap mt-0.5 size-5 shrink-0 accent-[var(--sy-accent)]`}),(0,Q.jsxs)(`label`,{htmlFor:`${r}-sharing-${e}`,className:`min-w-0 text-sm`,children:[(0,Q.jsx)(`span`,{className:`block font-medium`,children:t}),(0,Q.jsx)(`span`,{id:`${r}-sharing-${e}-desc`,className:`block text-muted`,children:n})]})]},e))]}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)(I,{id:`${r}-profile`,label:`Default Pi profile`,children:(0,Q.jsxs)(B,{id:`${r}-profile`,value:_,onChange:e=>v(e.target.value),children:[(0,Q.jsx)(`option`,{value:``,children:`None (use the coordinator default)`}),n.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.name},e.id)),!te&&(0,Q.jsxs)(`option`,{value:_,children:[`Unknown profile (`,_,`)`]})]})}),(0,Q.jsx)(I,{id:`${r}-host`,label:`Default host`,hint:`Runs start here when the task does not choose a host.`,children:(0,Q.jsxs)(B,{id:`${r}-host`,value:y,onChange:e=>b(e.target.value),...F(`${r}-host`,{hint:!0}),children:[(0,Q.jsx)(`option`,{value:``,children:`None (any host with a checkout)`}),t.map(e=>(0,Q.jsxs)(`option`,{value:e.id,children:[e.name,e.connectivity===`connected`?``:` (${e.connectivity})`]},e.id)),!ee&&(0,Q.jsxs)(`option`,{value:y,children:[`Unknown host (`,y,`)`]})]})})]}),(0,Q.jsx)(V,{error:T}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(E,{type:`submit`,variant:`primary`,busy:C,icon:(0,Q.jsx)(Ce,{className:`size-4`}),children:`Save project`})})]})})}function kn({project:e,hosts:t,hostsById:n}){let r=h(e=>e.checkouts),i=(0,X.useMemo)(()=>Object.values(r).filter(t=>t.projectId===e.id).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)),[r,e.id]),[a,o]=(0,X.useState)(!1);return(0,Q.jsxs)(G,{title:`Checkouts`,description:`Clones of this repository. Add one per host that should run this project.`,actions:(0,Q.jsx)(E,{size:`sm`,icon:(0,Q.jsx)(K,{className:`size-4`}),onClick:()=>o(!0),children:`Add checkout`}),children:[i.length===0?(0,Q.jsx)(M,{className:`py-4`,title:`No checkouts`,description:`Add a checkout so sessions and runs have somewhere to work.`,action:{label:`Add checkout`,onClick:()=>o(!0)}}):(0,Q.jsx)(`ul`,{className:`flex min-w-0 flex-col divide-y divide-border`,children:i.map(e=>{let t=n[e.hostId];return(0,Q.jsxs)(`li`,{className:`min-w-0 py-2 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:t?.name??`Unknown host`}),t&&t.connectivity!==`connected`&&(0,Q.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,t.connectivity,`)`]})]}),(0,Q.jsx)(`div`,{className:`break-all font-mono text-xs`,children:e.path}),(0,Q.jsxs)(`div`,{className:`text-xs text-muted`,children:[`Default branch: `,e.defaultBranch]})]},e.id)})}),(0,Q.jsx)(An,{open:a,onClose:()=>o(!1),project:e,hosts:t})]})}function An({open:e,onClose:t,project:n,hosts:r}){let i=(0,X.useId)(),a=r.filter(e=>e.connectivity===`connected`),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(null),g=o||a[0]?.id||``,v=u||c?_e(c):null,y=()=>{f||(d(!1),h(null),t())},b=async e=>{if(e.preventDefault(),d(!0),g&&!_e(c)){p(!0),h(null);try{await _(`/api/projects/${encodeURIComponent(n.id)}/checkouts`,{hostId:g,path:c.trim()}),J.success(`Checkout added`),l(``),d(!1),t()}catch(e){h(e)}finally{p(!1)}}},x=`${i}-form`;return(0,Q.jsx)(Be,{open:e,onClose:y,dismissOnBackdrop:!f,title:`Add checkout`,description:`Another clone of ${n.repoIdentity}.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{onClick:y,disabled:f,children:`Cancel`}),(0,Q.jsx)(E,{type:`submit`,form:x,variant:`primary`,busy:f,disabled:a.length===0,children:`Add checkout`})]}),children:(0,Q.jsxs)(`form`,{id:x,className:`flex min-w-0 flex-col gap-4`,onSubmit:b,noValidate:!0,children:[a.length===0&&(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No host is connected. The checkout is inspected on its host, so the host must be online.`}),(0,Q.jsx)(I,{id:`${i}-host`,label:`Host`,hint:`Only connected hosts are listed.`,children:(0,Q.jsxs)(B,{id:`${i}-host`,value:g,onChange:e=>s(e.target.value),disabled:a.length===0,...F(`${i}-host`,{hint:!0}),children:[a.length===0&&(0,Q.jsx)(`option`,{value:``,children:`No connected hosts`}),a.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}),(0,Q.jsx)(I,{id:`${i}-path`,label:`Checkout path on the host`,hint:`Absolute path of an existing clone of this repository.`,error:v,children:(0,Q.jsx)(Y,{id:`${i}-path`,value:c,onChange:e=>l(e.target.value),placeholder:`/Users/me/src/app`,className:`font-mono`,autoCapitalize:`off`,autoComplete:`off`,spellCheck:!1,...F(`${i}-path`,{hint:!0,error:v})})}),(0,Q.jsx)(V,{error:m})]})})}var jn=e=>L(`projects/${encodeURIComponent(e)}`);function Mn(){let e=P(),t=u(),n=h(e=>e.checkouts),i=h(e=>e.workspaces),a=(0,X.useMemo)(()=>{let e={},t=t=>(e[t]??={checkouts:0,workspaces:0},e[t]);for(let e of Object.values(n))t(e.projectId).checkouts++;for(let e of Object.values(i))e.archivedAt||t(e.projectId).workspaces++;return e},[n,i]);return(0,Q.jsxs)(H,{testId:`settings-projects`,title:`Projects`,description:`A project is one repository. It can have checkouts on several hosts. Repositories in a host's project folders are added automatically.`,actions:(0,Q.jsxs)(r,{to:L(`projects/new`),className:ee(`primary`),children:[(0,Q.jsx)(K,{"aria-hidden":!0,className:`size-4`}),`New project`]}),children:[(0,Q.jsx)(z,{}),e?t.length===0?(0,Q.jsx)(M,{icon:(0,Q.jsx)(ne,{className:`size-8`}),title:`No projects yet`,description:`Create a project from a Git checkout on one of your hosts.`,action:{label:`New project`,to:L(`projects/new`)}}):(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:t.map(e=>(0,Q.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,Q.jsx)(Nn,{project:e,counts:a[e.id]})},e.id))}):(0,Q.jsx)(k,{label:`Loading projects…`})]})}function Nn({project:e,counts:t}){let n=t??{checkouts:0,workspaces:0};return(0,Q.jsxs)(r,{to:jn(e.id),className:`tap flex min-w-0 items-center gap-3 px-4 py-3 hover:bg-surface-2`,children:[(0,Q.jsx)(ne,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words font-medium`,children:e.name}),(0,Q.jsx)(`span`,{className:`break-all text-xs text-muted`,children:e.repoIdentity}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-x-3 text-xs text-muted`,children:[(0,Q.jsxs)(`span`,{children:[n.checkouts,` checkout`,n.checkouts===1?``:`s`]}),(0,Q.jsxs)(`span`,{children:[n.workspaces,` workspace`,n.workspaces===1?``:`s`]}),(0,Q.jsxs)(`span`,{children:[`Automation `,e.automationEnabled?`on`:`off`]})]})]}),(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})}function Pn(){let e=P(),t=f(),i=h(e=>e.profiles),a=(0,X.useMemo)(()=>Object.values(i).sort((e,t)=>e.name.localeCompare(t.name)),[i]),o=t.filter(e=>e.connectivity===`connected`),s=n(),c=(0,X.useId)(),[l,u]=(0,X.useState)(``),[d,p]=(0,X.useState)(``),[m,g]=(0,X.useState)(``),[v,y]=(0,X.useState)(``),[b,S]=(0,X.useState)(`.worktrees`),[C,w]=(0,X.useState)(!1),[T,D]=(0,X.useState)(!1),[O,A]=(0,X.useState)(null),j=d||o[0]?.id||``,M=C&&!l.trim()?`Enter a project name.`:null,ee=C&&!j?`Choose a connected host.`:null,te=C||m?_e(m):null,N=En(b),ne=async e=>{if(e.preventDefault(),w(!0),l.trim()&&j&&!_e(m)&&!N){D(!0),A(null);try{let e=await _(`/api/projects`,{name:l.trim(),hostId:j,path:m.trim(),defaultProfileId:v||null,worktreeDir:b.trim()});J.success(`Project ${l.trim()} created`),s(e?.id?jn(e.id):L(`projects`))}catch(e){A(e)}finally{D(!1)}}},re={to:L(`projects`),label:`Projects`};return e?(0,Q.jsxs)(H,{title:`New project`,description:`Switchyard inspects the checkout on the host, then discovers its worktrees.`,back:re,children:[o.length===0&&(0,Q.jsx)(x,{capability:`Creating a project`,reason:t.length===0?`No hosts are enrolled. Add a host first.`:`No host is connected. The checkout is inspected on its host, so the host must be online.`,fallback:(0,Q.jsx)(r,{to:L(`hosts`),className:`font-medium text-accent`,children:`Open hosts`})}),(0,Q.jsx)(G,{children:(0,Q.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:ne,noValidate:!0,children:[(0,Q.jsx)(I,{id:`${c}-name`,label:`Name`,error:M,children:(0,Q.jsx)(Y,{id:`${c}-name`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,...F(`${c}-name`,{error:M})})}),(0,Q.jsx)(I,{id:`${c}-host`,label:`Host`,hint:`Only connected hosts are listed.`,error:ee,children:(0,Q.jsxs)(B,{id:`${c}-host`,value:j,onChange:e=>p(e.target.value),disabled:o.length===0,...F(`${c}-host`,{hint:!0,error:ee}),children:[o.length===0&&(0,Q.jsx)(`option`,{value:``,children:`No connected hosts`}),o.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}),(0,Q.jsx)(I,{id:`${c}-path`,label:`Checkout path on the host`,hint:`Absolute path of an existing Git checkout, e.g. /Users/me/src/app.`,error:te,children:(0,Q.jsx)(Y,{id:`${c}-path`,value:m,onChange:e=>g(e.target.value),placeholder:`/Users/me/src/app`,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,className:`font-mono`,...F(`${c}-path`,{hint:!0,error:te})})}),(0,Q.jsx)(I,{id:`${c}-worktree`,label:`Worktree folder`,hint:Tn,error:N,children:(0,Q.jsx)(Y,{id:`${c}-worktree`,value:b,onChange:e=>S(e.target.value),placeholder:`.worktrees`,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,className:`font-mono`,...F(`${c}-worktree`,{hint:!0,error:N})})}),(0,Q.jsx)(I,{id:`${c}-profile`,label:`Default Pi profile (optional)`,children:(0,Q.jsxs)(B,{id:`${c}-profile`,value:v,onChange:e=>y(e.target.value),children:[(0,Q.jsx)(`option`,{value:``,children:`None`}),a.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}),(0,Q.jsx)(V,{error:O}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(E,{type:`submit`,variant:`primary`,busy:T,icon:(0,Q.jsx)(ut,{className:`size-4`}),disabled:o.length===0,children:`Create project`}),o.length===0&&(0,Q.jsx)(W,{icon:ut,label:`Needs a connected host`})]})]})})]}):(0,Q.jsx)(H,{title:`New project`,back:re,children:(0,Q.jsx)(k,{})})}function Fn(){let e=wt(`/api/auth/methods`,ye),[t,n]=(0,X.useState)(!1),[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(null),g=async()=>{if(r){o(!0),c(null);try{await d(`/api/auth/passkeys/${encodeURIComponent(r.id)}`),J.success(`Passkey ${r.name} removed`),i(null),e.reload()}catch(e){c(e)}finally{o(!1)}}},v=async()=>{p(!0),h(null);try{await _(`/api/logout`),u(!1),Ne(null)}catch(e){h(e)}finally{p(!1)}},y=e.data,b=y?.passkeyAvailability,x=it(),S=y?b?.available?x?null:`This browser does not support passkeys.`:b?.reason??`Passkeys are not available on this server.`:null;return(0,Q.jsxs)(H,{testId:`settings-signin`,title:`Sign-in`,description:`How you sign in to Switchyard on new devices. Each signed-in device keeps its own revocable credential.`,children:[(0,Q.jsx)(z,{}),e.loading&&!y?(0,Q.jsx)(k,{label:`Loading sign-in methods…`}):e.error&&!y?(0,Q.jsx)(O,{title:`Could not load sign-in methods`,error:e.error,onRetry:e.reload}):y?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(G,{title:`Passkeys`,description:`Sign in on any device with its fingerprint, face or screen lock. Passkeys are stored on this server only as public keys.`,actions:(0,Q.jsx)(E,{"data-testid":`passkey-add`,variant:`primary`,icon:(0,Q.jsx)(K,{className:`size-4`}),disabled:S!==null,onClick:()=>n(!0),children:`Add a passkey`}),children:[S&&(0,Q.jsxs)(`p`,{role:`status`,className:`mb-3 flex items-start gap-2 rounded-md bg-warning-soft px-3 py-2 text-sm`,children:[(0,Q.jsx)(C,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),(0,Q.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`Adding a passkey is unavailable: `,S]})]}),y.passkeys.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted`,children:`No passkeys yet. Add one as a backup to single sign-on, or to sign in without it.`}):(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border`,children:y.passkeys.map(e=>(0,Q.jsxs)(`li`,{"data-testid":`passkey-row`,className:`flex min-w-0 flex-wrap items-center gap-3 border-b border-border px-3 py-2 last:border-b-0`,children:[(0,Q.jsx)(Se,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`break-words font-medium`,children:e.name}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 text-sm text-muted`,children:[(0,Q.jsxs)(`span`,{children:[`Added `,A(e.createdAt)]}),(0,Q.jsxs)(`span`,{children:[`Last used `,A(e.lastUsedAt)]})]})]}),(0,Q.jsx)(E,{size:`sm`,variant:`ghost`,className:`text-danger`,icon:(0,Q.jsx)(Te,{className:`size-4`}),"aria-label":`Remove passkey ${e.name}`,onClick:()=>{c(null),i(e)},children:`Remove`})]},e.id))})]}),(0,Q.jsx)(G,{title:`Single sign-on`,description:`Configured on the server`,children:y.oidc?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(R,{items:[[`Button label`,y.oidc.label],[`Provider`,(0,Q.jsx)(`span`,{className:`break-all`,children:y.oidc.issuer},`i`)],[`Allowed account`,y.oidc.ownerMatch],[`Status`,y.oidc.status===`ready`?(0,Q.jsx)(W,{icon:q,tone:`success`,label:`Ready`},`s`):(0,Q.jsx)(W,{icon:C,tone:`danger`,label:`Error`},`s`)]]}),y.oidc.status===`error`&&y.oidc.error&&(0,Q.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-danger`,children:y.oidc.error})]}):(0,Q.jsxs)(`p`,{"data-testid":`signin-oidc-status`,className:`text-sm text-muted`,children:[`Not configured. Set the `,(0,Q.jsx)(`code`,{children:`SWITCHYARD_OIDC_*`}),` variables on the server to sign in with an identity provider.`]})})]}):null,(0,Q.jsx)(G,{title:`This device`,description:`Signing out removes this device's credential here. Other devices stay signed in; revoke a device in Settings › Devices to cut it off.`,children:(0,Q.jsx)(E,{icon:(0,Q.jsx)(gt,{className:`size-4`}),onClick:()=>{h(null),u(!0)},children:`Sign out of this device`})}),(0,Q.jsx)(In,{open:t,onClose:()=>n(!1),onAdded:()=>{n(!1),e.reload()}}),(0,Q.jsx)(U,{open:r!==null,onClose:()=>i(null),title:r?`Remove passkey ${r.name}?`:`Remove passkey`,confirmLabel:`Remove passkey`,busy:a,error:s,onConfirm:g,children:(0,Q.jsxs)(`p`,{className:`text-sm`,children:[`Devices already signed in stay signed in. This passkey can no longer sign in new devices.`,y&&y.passkeys.length===1&&!y.oidc?` It is your only passkey and no single sign-on is set up: afterwards new browsers need switchyard pair run on the server.`:``]})}),(0,Q.jsx)(U,{open:l,onClose:()=>u(!1),title:`Sign out of this device?`,confirmLabel:`Sign out`,busy:f,error:m,onConfirm:v,children:(0,Q.jsxs)(`p`,{className:`text-sm`,children:[`You will need single sign-on, a passkey or `,(0,Q.jsx)(`code`,{children:`switchyard pair`}),` on the server to sign in here again.`]})})]})}function In({open:e,onClose:t,onAdded:n}){let r=(0,X.useId)(),[i,a]=(0,X.useState)(()=>tt()),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(null),u=Xe(),d=i.trim()?null:`Enter a name for this passkey.`,f=()=>{if(u.waiting)u.cancel();else if(o)return;l(null),t()},p=async e=>{if(e.preventDefault(),!d){s(!0),l(null);try{let{challengeId:e,options:t}=await _(`/api/auth/passkeys/register/options`),r=await u.run(()=>rt({optionsJSON:t}));if(!r.ok){s(!1);return}let a=r.value;await _(`/api/auth/passkeys/register/verify`,{challengeId:e,name:i.trim().slice(0,80),response:a}),J.success(`Passkey added`),n()}catch(e){l(e instanceof Error&&e.name===`NotAllowedError`?Error(`The passkey prompt was cancelled or timed out. Try again.`):e instanceof Error?e:Error(y(e)))}finally{s(!1)}}},m=`${r}-form`;return(0,Q.jsx)(Be,{open:e,onClose:f,dismissOnBackdrop:!o||u.waiting,title:`Add a passkey`,description:`Name it after where it is stored, then confirm with your device.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{onClick:f,disabled:o&&!u.waiting,children:`Cancel`}),(0,Q.jsx)(E,{type:`submit`,form:m,variant:`primary`,busy:o,children:`Create passkey`})]}),children:(0,Q.jsxs)(`form`,{id:m,className:`flex min-w-0 flex-col gap-4`,onSubmit:p,noValidate:!0,children:[(0,Q.jsx)(I,{id:`${r}-name`,label:`Passkey name`,error:d,children:(0,Q.jsx)(Y,{id:`${r}-name`,value:i,maxLength:80,autoComplete:`off`,onChange:e=>a(e.target.value),...F(`${r}-name`,{error:d})})}),u.waiting&&(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted`,children:[(0,Q.jsx)(S,{}),` Waiting for your passkey… Cancel stops it.`]}),(0,Q.jsx)(V,{error:c})]})})}function Ln(){let e=Re(),n=e===`mobile`,r=(0,Q.jsxs)(i,{children:[(0,Q.jsx)(t,{index:!0,element:n?(0,Q.jsx)(Hn,{}):(0,Q.jsx)(Vn,{})}),(0,Q.jsx)(t,{path:`hosts`,element:(0,Q.jsx)($t,{})}),(0,Q.jsx)(t,{path:`hosts/:hostId`,element:(0,Q.jsx)(an,{})}),(0,Q.jsx)(t,{path:`devices`,element:(0,Q.jsx)(Ut,{})}),(0,Q.jsx)(t,{path:`sign-in`,element:(0,Q.jsx)(Fn,{})}),(0,Q.jsx)(t,{path:`projects`,element:(0,Q.jsx)(Mn,{})}),(0,Q.jsx)(t,{path:`projects/new`,element:(0,Q.jsx)(Pn,{})}),(0,Q.jsx)(t,{path:`projects/:projectId`,element:(0,Q.jsx)(Dn,{})}),(0,Q.jsx)(t,{path:`profiles`,element:(0,Q.jsx)(vn,{})}),(0,Q.jsx)(t,{path:`adapters`,element:(0,Q.jsx)(jt,{})}),(0,Q.jsx)(t,{path:`notifications`,element:(0,Q.jsx)(ln,{})}),(0,Q.jsx)(t,{path:`backups`,element:(0,Q.jsx)(zt,{})}),(0,Q.jsx)(t,{path:`diagnostics`,element:(0,Q.jsx)(Gt,{})}),(0,Q.jsx)(t,{path:`device`,element:(0,Q.jsx)(Wt,{})}),(0,Q.jsx)(t,{path:`*`,element:(0,Q.jsx)(Un,{})})]});return n?(0,Q.jsx)(`div`,{className:`min-w-0`,children:r}):(0,Q.jsxs)(`div`,{className:`flex min-h-full min-w-0`,children:[(0,Q.jsx)(zn,{compact:e===`compact`}),(0,Q.jsx)(`div`,{className:`min-w-0 flex-1`,children:r})]})}function Rn(){let{pathname:e}=l(),t=e.split(`/`),n=t.indexOf(`settings`);return n>=0&&(t[n+1]??null)||null}function zn({compact:e}){let t=Rn();return(0,Q.jsx)(`div`,{className:w(`shrink-0 border-r border-border`,e?`w-52`:`w-60`),children:(0,Q.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-testid":`settings-nav`,className:`sticky top-0 flex max-h-dvh flex-col gap-1 overflow-y-auto px-2 py-4`,children:[(0,Q.jsx)(r,{to:L(),"aria-current":t===null?`page`:void 0,className:w(`tap mb-2 rounded-md px-3 py-1 text-base font-semibold`,t===null?`bg-accent-soft`:`hover:bg-surface-2`),children:`Settings`}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:ue.map(({path:e,label:n,icon:i})=>{let a=t===e;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(r,{to:L(e),"aria-current":a?`page`:void 0,className:w(`tap flex h-10 items-center gap-3 rounded-md px-3 text-sm font-medium`,a?`bg-accent-soft text-text`:`text-muted hover:bg-surface-2 hover:text-text`),children:[(0,Q.jsx)(i,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:n})]})},e)})})]})})}function Bn(){let e=h(e=>e.hosts),t=h(e=>e.devices),n=h(e=>e.projects),r=h(e=>e.profiles),i=h(e=>e.adapters),a=h(e=>e.hydrated);return(0,X.useMemo)(()=>{if(!a)return{};let o=Object.values(e).filter(e=>e.revokedAt===null),s=o.filter(e=>e.connectivity===`connected`).length,c=Object.values(i).reduce((e,t)=>e+t.length,0),l=(e,t)=>`${e} ${t}${e===1?``:`s`}`;return{hosts:`${l(o.length,`host`)}, ${s} connected`,devices:l(Object.values(t).filter(e=>e.revokedAt===null).length,`device`),projects:l(Object.keys(n).length,`project`),profiles:l(Object.keys(r).length,`profile`),adapters:l(c,`adapter`)}},[e,t,n,r,i,a])}function Vn(){let e=Bn();return(0,Q.jsxs)(H,{title:`Settings`,description:`Configure Switchyard and check its health.`,children:[(0,Q.jsx)(z,{}),(0,Q.jsx)(`ul`,{className:`grid min-w-0 grid-cols-1 gap-3 lg:grid-cols-2 2xl:grid-cols-3`,children:ue.map(({path:t,label:n,description:i,icon:a})=>(0,Q.jsx)(`li`,{className:`min-w-0`,children:(0,Q.jsxs)(r,{to:L(t),className:`tap flex h-full min-w-0 items-start gap-3 rounded-lg border border-border bg-surface p-4 hover:bg-surface-2`,children:[(0,Q.jsx)(a,{"aria-hidden":!0,className:`mt-0.5 size-5 shrink-0 text-muted`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block font-medium`,children:n}),(0,Q.jsx)(`span`,{className:`block text-sm text-muted`,children:i}),e[t]&&(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-subtle`,children:e[t]})]}),(0,Q.jsx)(ie,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-subtle`})]})},t))})]})}function Hn(){let e=Bn();return(0,Q.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-xl flex-col gap-3 px-4 py-4`,children:[(0,Q.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Settings`}),(0,Q.jsx)(z,{}),(0,Q.jsx)(`nav`,{"aria-label":`Settings sections`,"data-testid":`settings-nav`,children:(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:ue.map(({path:t,label:n,description:i,icon:a})=>(0,Q.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,Q.jsxs)(r,{to:L(t),className:`tap flex min-h-14 items-center gap-3 px-4 py-2 hover:bg-surface-2`,children:[(0,Q.jsx)(a,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block font-medium`,children:n}),(0,Q.jsx)(`span`,{className:`block truncate text-sm text-muted`,children:e[t]??i})]}),(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})},t))})})]})}function Un(){return(0,Q.jsx)(M,{title:`Settings page not found`,description:`This link does not match a settings section.`,action:{label:`Open Settings`,to:L()}})}export{Ln as default};
7
+ //# sourceMappingURL=settings-D8T1esWq.js.map