@kitn.ai/ui 0.27.0 → 0.29.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 (612) hide show
  1. package/README.md +10 -2
  2. package/dist/{Icon-BnFKqqtY.js → Icon-DObhsRtm.js} +1 -1
  3. package/dist/{action-icons-CBskfBMz.js → action-icons-CcgNN2oT.js} +1 -1
  4. package/dist/agent-tooling/construct/public.d.ts +15 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +111 -0
  6. package/dist/arrow-down-CjRU3JgV.js +1 -0
  7. package/dist/arrow-left-Bnpb1UEW.js +1 -0
  8. package/dist/{artifact-CvXEm1lS.js → artifact-Bwt7OgcR.js} +1 -1
  9. package/dist/{attachments-C43ZegEq.js → attachments-Qr4kg-2b.js} +1 -1
  10. package/dist/{audio-visualizer-B-79y1Tj.js → audio-visualizer-DToYdfSc.js} +1 -1
  11. package/dist/{badge-BpUbq8c0.js → badge-CdEu_jn2.js} +1 -1
  12. package/dist/{bell-sn17Ip9v.js → bell-DQAAOpDz.js} +1 -1
  13. package/dist/{button-BH6rN0U-.js → button-DkuOnGLy.js} +1 -1
  14. package/dist/{card-renderer-Cb1gQmth.js → card-renderer-Jx70m6_l.js} +1 -1
  15. package/dist/{card-routing-DifQgS7n.js → card-routing-0YidER_3.js} +1 -1
  16. package/dist/check-njkVdZu2.js +1 -0
  17. package/dist/{checkbox-Dc9Yov_B.js → checkbox-D7iRB3nL.js} +1 -1
  18. package/dist/{checkbox-group-B1kDLLYk.js → checkbox-group-B2_rpoPM.js} +1 -1
  19. package/dist/chevron-down-B72s6PXR.js +1 -0
  20. package/dist/chevron-right-BatuHzUm.js +1 -0
  21. package/dist/{choice-card-BT3c1S8g.js → choice-card-m0BYqqOK.js} +1 -1
  22. package/dist/circle-check-B62pODB3.js +1 -0
  23. package/dist/{circle-x-wobWkoSx.js → circle-x-BPG0iPst.js} +1 -1
  24. package/dist/circle-zx0ByzY9.js +1 -0
  25. package/dist/code-block-ClMLKb7C.js +1 -0
  26. package/dist/{collapsible-CPJbf6FM.js → collapsible-B4DlWicL.js} +1 -1
  27. package/dist/components/chat-thread.d.ts +89 -1
  28. package/dist/components/conversation-item.d.ts +16 -0
  29. package/dist/components/conversation-panel.d.ts +29 -0
  30. package/dist/components/home-panel.d.ts +34 -0
  31. package/dist/components/widget-tab-bar.d.ts +16 -0
  32. package/dist/{composer-CjngLzal.js → composer-sQ0HcvyG.js} +3 -3
  33. package/dist/{confirm-card-DCx_A4bU.js → confirm-card-rQWDQsnC.js} +1 -1
  34. package/dist/construct-cli.es.js +185 -17
  35. package/dist/construct.d.ts +5 -0
  36. package/dist/construct.js +327 -0
  37. package/dist/{context-BY8V-Nlp.js → context-0kg4ZX1J.js} +1 -1
  38. package/dist/controllable-CnGpMF6r.js +1 -0
  39. package/dist/conversation-item-BxwQLaFJ.js +1 -0
  40. package/dist/conversation-list-BCfGN1JU.js +1 -0
  41. package/dist/{copy-B6DO4PqB.js → copy-n9u9rqpi.js} +1 -1
  42. package/dist/core-C8fzo39E.js +1 -12
  43. package/dist/{create-tween-CnMHviKB.js → create-tween-C-q-JCM-.js} +1 -1
  44. package/dist/{create-tween-D1aiGZZh.js → create-tween-CRrJXxBd.js} +1 -1
  45. package/dist/{create-tween-BPzaefTp.js → create-tween-DZ3RRDHD.js} +1 -1
  46. package/dist/{create-tween-DUSQUKpr.js → create-tween-uPkArjIG.js} +1 -1
  47. package/dist/custom-elements.json +51 -2
  48. package/dist/{default-input-CucQEOqH.js → default-input-CaMrJkgH.js} +1 -1
  49. package/dist/define-By-uL588.js +1 -0
  50. package/dist/define.js +2 -2
  51. package/dist/define.server.js +2 -2
  52. package/dist/{disclosure-CbLtajUQ.js → disclosure-WUImBbDv.js} +1 -1
  53. package/dist/{dropdown-BwhViJFd.js → dropdown-wZVeJOMd.js} +1 -1
  54. package/dist/elements/agent-card.js +1 -1
  55. package/dist/elements/artifact.js +1 -1
  56. package/dist/elements/attachments.js +1 -1
  57. package/dist/elements/audio-visualizer.js +1 -1
  58. package/dist/elements/avatar.js +1 -1
  59. package/dist/elements/badge.js +1 -1
  60. package/dist/elements/button.js +1 -1
  61. package/dist/elements/card.js +1 -1
  62. package/dist/elements/cards.js +1 -1
  63. package/dist/elements/chain-of-thought.js +1 -1
  64. package/dist/elements/chat-scope-picker.js +1 -1
  65. package/dist/elements/chat-workspace.js +1 -1
  66. package/dist/elements/chat.js +1 -1
  67. package/dist/elements/checkbox-group.js +1 -1
  68. package/dist/elements/checkbox.js +1 -1
  69. package/dist/elements/checkpoint.js +1 -1
  70. package/dist/elements/choice.js +1 -1
  71. package/dist/elements/coachmark.js +1 -1
  72. package/dist/elements/code-block.js +1 -1
  73. package/dist/elements/command.js +1 -1
  74. package/dist/elements/compare.js +1 -1
  75. package/dist/elements/composer.js +1 -1
  76. package/dist/elements/confirm-card.js +1 -1
  77. package/dist/elements/context-meter.js +1 -1
  78. package/dist/elements/conversation-item.js +1 -1
  79. package/dist/elements/conversation-list.js +1 -1
  80. package/dist/elements/dialog.js +1 -1
  81. package/dist/elements/dock.js +3 -3
  82. package/dist/elements/dropdown.js +1 -1
  83. package/dist/elements/editable-label.js +1 -1
  84. package/dist/elements/embed.js +1 -1
  85. package/dist/elements/empty.js +1 -1
  86. package/dist/elements/feedback-bar.js +1 -1
  87. package/dist/elements/file-tree.js +1 -1
  88. package/dist/elements/file-upload.js +1 -1
  89. package/dist/elements/form.js +1 -1
  90. package/dist/elements/hover-card.js +1 -1
  91. package/dist/elements/icon.js +1 -1
  92. package/dist/elements/image.js +1 -1
  93. package/dist/elements/input.js +1 -1
  94. package/dist/elements/kbd.js +1 -1
  95. package/dist/elements/link-preview.js +1 -1
  96. package/dist/elements/loader.js +1 -1
  97. package/dist/elements/markdown.js +1 -1
  98. package/dist/elements/menu.js +1 -1
  99. package/dist/elements/message-skills.js +1 -1
  100. package/dist/elements/message.js +1 -1
  101. package/dist/elements/model-switcher.js +1 -1
  102. package/dist/elements/nav.js +1 -1
  103. package/dist/elements/notice.js +1 -1
  104. package/dist/elements/pane-grid.js +1 -1
  105. package/dist/elements/pane-group.js +1 -1
  106. package/dist/elements/pane.js +1 -1
  107. package/dist/elements/popover.js +1 -1
  108. package/dist/elements/progress-bar.js +1 -1
  109. package/dist/elements/prompt-dock.js +1 -1
  110. package/dist/elements/prompt-input.js +1 -1
  111. package/dist/elements/prompt-suggestions.js +1 -1
  112. package/dist/elements/radio-group.js +1 -1
  113. package/dist/elements/reasoning.js +1 -1
  114. package/dist/elements/remote.js +1 -1
  115. package/dist/elements/resizable.js +1 -1
  116. package/dist/elements/response-stream.js +1 -1
  117. package/dist/elements/screen.js +1 -1
  118. package/dist/elements/scroll-area.js +1 -1
  119. package/dist/elements/scroll-button.js +1 -1
  120. package/dist/elements/search.js +1 -1
  121. package/dist/elements/segmented.js +1 -1
  122. package/dist/elements/select.js +1 -1
  123. package/dist/elements/separator.js +1 -1
  124. package/dist/elements/setting-item.js +1 -1
  125. package/dist/elements/settings-group.js +1 -1
  126. package/dist/elements/skeleton.js +1 -1
  127. package/dist/elements/slider.js +1 -1
  128. package/dist/elements/source.js +1 -1
  129. package/dist/elements/status.js +1 -1
  130. package/dist/elements/switch.js +1 -1
  131. package/dist/elements/tabs.js +1 -1
  132. package/dist/elements/tasks.js +1 -1
  133. package/dist/elements/text-shimmer.js +1 -1
  134. package/dist/elements/thinking-bar.js +1 -1
  135. package/dist/elements/thread.js +1 -1
  136. package/dist/elements/toast.js +1 -1
  137. package/dist/elements/tool.js +1 -1
  138. package/dist/elements/tooltip.js +1 -1
  139. package/dist/elements/voice-input.js +1 -1
  140. package/dist/elements/voice-output.js +1 -1
  141. package/dist/elements.d.ts +20 -4
  142. package/dist/{ellipsis-DFr4Vqr3.js → ellipsis-CbOpJnU3.js} +1 -1
  143. package/dist/{embed-5s_vU4J0.js → embed-CrfjkbUG.js} +1 -1
  144. package/dist/engine-javascript-C1x7zo1_.js +1 -141
  145. package/dist/{external-link-u9d85ORQ.js → external-link-ByXAwBBQ.js} +1 -1
  146. package/dist/{file-text-CX7_x42o.js → file-text-DMib2qwt.js} +1 -1
  147. package/dist/{file-tree-D3kBjXI5.js → file-tree-CJqM2aP7.js} +1 -1
  148. package/dist/{folder-V-YdIL8f.js → folder-_BAb929C.js} +1 -1
  149. package/dist/{form-BRNUMCN2.js → form-DSZgZQZk.js} +1 -1
  150. package/dist/{hover-card-DaeiYrTA.js → hover-card-BQbul9eq.js} +1 -1
  151. package/dist/{icon-BpixdZNq.js → icon-CdcfRhYI.js} +1 -1
  152. package/dist/index.d.ts +3 -1
  153. package/dist/index.js +2842 -2703
  154. package/dist/index.server.js +2820 -2681
  155. package/dist/{info-8mFsIjS3.js → info-DsFjGuI_.js} +1 -1
  156. package/dist/{input-d1Yuu-hz.js → input-DKbmkMos.js} +1 -1
  157. package/dist/kai.es.js +1 -1
  158. package/dist/{kbd-961zMPFB.js → kbd-PvdGhX4s.js} +1 -1
  159. package/dist/{link-preview-DIIbV2Sd.js → link-preview-DbM1866N.js} +1 -1
  160. package/dist/{link-DlZZBGaR.js → link-zF8PzWfF.js} +1 -1
  161. package/dist/{loader-YQszHFaW.js → loader-BM4CEz4G.js} +1 -1
  162. package/dist/{markdown-CVk1MPsj.js → markdown-LMvmAyBk.js} +7 -7
  163. package/dist/mcp.es.js +79 -5
  164. package/dist/{message-CwKVEdZg.js → message-BSsgvHvf.js} +1 -1
  165. package/dist/{message-DS8lzHc1.js → message-BYZECyek.js} +1 -1
  166. package/dist/message-circle-DruwObfX.js +1 -0
  167. package/dist/message-square-BG6q6mlm.js +1 -0
  168. package/dist/{minimize-2-UEZmP2QT.js → minimize-2-BQRoBV1V.js} +1 -1
  169. package/dist/{model-switcher-Kk1jEQ5t.js → model-switcher-CMpCOYcB.js} +1 -1
  170. package/dist/{overlay-C1od6LOz.js → overlay-Cb-MkyDa.js} +1 -1
  171. package/dist/{panel-right-ryET0yyn.js → panel-right-i8warFxT.js} +1 -1
  172. package/dist/{paperclip-BDNoZFJP.js → paperclip-ByY3UVO6.js} +1 -1
  173. package/dist/play-BvKKq3fX.js +1 -0
  174. package/dist/primitives/conversation-store.d.ts +54 -0
  175. package/dist/{progress-bar-BvYX0aoy.js → progress-bar-jVAHvMUf.js} +1 -1
  176. package/dist/{prompt-suggestion-BRFu2lcu.js → prompt-suggestion-CD-qtNgC.js} +1 -1
  177. package/dist/{radio-DcL23cNJ.js → radio-BsoBMhkF.js} +1 -1
  178. package/dist/react/index.d.ts +393 -0
  179. package/dist/react.js +20 -20
  180. package/dist/{reasoning-Cackq4Rh.js → reasoning-4kBPtlTx.js} +1 -1
  181. package/dist/register-impl-B1hLkrI8.js +424 -0
  182. package/dist/{resizable-Cp9HUYih.js → resizable-uPmY9VY-.js} +1 -1
  183. package/dist/{rotate-ccw-0DLRDHH5.js → rotate-ccw-B2xn93py.js} +1 -1
  184. package/dist/{rotate-cw-DOB9IGcU.js → rotate-cw-CMVLoCyH.js} +1 -1
  185. package/dist/{scroll-area-emVmWP4K.js → scroll-area-BqLUo8ZZ.js} +1 -1
  186. package/dist/{scroll-button-CeP_gv1x.js → scroll-button-DslXiJyL.js} +1 -1
  187. package/dist/{select-CWmu00tS.js → select-2cLRtPGT.js} +1 -1
  188. package/dist/{separator-CE6vly6z.js → separator-BWQtNJcM.js} +1 -1
  189. package/dist/{settings-CE-78SvZ.js → settings-BBR63jLg.js} +1 -1
  190. package/dist/{settings-group-ZFWNxFQR.js → settings-group-B2ciy-Iw.js} +1 -1
  191. package/dist/{skeleton-BebdP4mf.js → skeleton-CkHI-HgC.js} +1 -1
  192. package/dist/{slider-BAKRYUlz.js → slider-DDR9U-i0.js} +1 -1
  193. package/dist/{solid-BE5ui6sy.js → solid-BzCFdL25.js} +7720 -7058
  194. package/dist/{solid-DFhsce3O.js → solid-DruVOXnf.js} +5864 -5283
  195. package/dist/solid.d.ts +6 -2
  196. package/dist/solid.js +217 -210
  197. package/dist/solid.server.js +217 -210
  198. package/dist/{source-B0FlguSx.js → source-GEnFF528.js} +1 -1
  199. package/dist/{star-CBMZvLuN.js → star-CilHq8GP.js} +1 -1
  200. package/dist/store-Ciyk6eZG.js +1 -0
  201. package/dist/{switch-CViARZCy.js → switch-KkeQIbuH.js} +1 -1
  202. package/dist/{tasks-card-MjCcOhR_.js → tasks-card-BrN4bggJ.js} +1 -1
  203. package/dist/{text-shimmer-DKlwRF2G.js → text-shimmer-Dcj1MHuq.js} +1 -1
  204. package/dist/{textarea-3ay2Me2-.js → textarea-Dpvbngbg.js} +1 -1
  205. package/dist/theme.tokens.css +28 -0
  206. package/dist/{thumbs-up-DQcu2HMO.js → thumbs-up-CsT9Wzb9.js} +1 -1
  207. package/dist/{toast-store-C6yKOhbk.js → toast-store-tgK6MuMv.js} +1 -1
  208. package/dist/{tool-BCYNlfKy.js → tool-DzUjIBT8.js} +1 -1
  209. package/dist/{tooltip-05zI4hjs.js → tooltip-Bkkg_4t0.js} +1 -1
  210. package/dist/{trash-2-BR1RxGky.js → trash-2-jBKxjGGQ.js} +1 -1
  211. package/dist/{triangle-alert-DHohDOCy.js → triangle-alert-DlQ68ppf.js} +1 -1
  212. package/dist/types.d.ts +48 -3
  213. package/dist/ui/dock.d.ts +29 -0
  214. package/dist/{upload-BbGW6A_u.js → upload-TcAHXv9W.js} +1 -1
  215. package/dist/{url-scheme-policy-DHpoTJwB.js → url-scheme-policy-DR5DgvkM.js} +1 -1
  216. package/dist/{use-card-resolution-CJW4grFa.js → use-card-resolution-DaZqAdWf.js} +1 -1
  217. package/dist/{variant-aurora-xiMPty8f.js → variant-aurora-BhLuYxJR.js} +1 -1
  218. package/dist/{variant-aurora-BUOVgPOB.js → variant-aurora-CNmfHhcx.js} +2 -2
  219. package/dist/{variant-aurora-CUsUJvFI.js → variant-aurora-D6GsdTPA.js} +2 -2
  220. package/dist/{variant-aurora-CW2i4bfr.js → variant-aurora-DbW_OWL2.js} +1 -1
  221. package/dist/{variant-custom-D91HjAKz.js → variant-custom-BRvaNHSi.js} +1 -1
  222. package/dist/{variant-custom-BQtOnmeO.js → variant-custom-BvYHR62b.js} +1 -1
  223. package/dist/{variant-custom-CAnzzppW.js → variant-custom-DMTrEO5w.js} +2 -2
  224. package/dist/{variant-custom-CAm9L-E5.js → variant-custom-DV2x254s.js} +2 -2
  225. package/dist/{variant-wave-Ca1Ls4_y.js → variant-wave-BNMGrDfj.js} +2 -2
  226. package/dist/{variant-wave-uY5crU_K.js → variant-wave-BpDd8t3Z.js} +1 -1
  227. package/dist/{variant-wave-CxX39DKd.js → variant-wave-CyBueXj9.js} +2 -2
  228. package/dist/{variant-wave-DYyzIIZv.js → variant-wave-sp-qwsdI.js} +1 -1
  229. package/dist/x-Z5UntkIJ.js +1 -0
  230. package/frameworks/react/index.tsx +14 -4
  231. package/llms-full.txt +7 -2
  232. package/package.json +16 -16
  233. package/src/elements/element-meta.json +49 -6
  234. package/theme.css +28 -0
  235. package/bin/route.test.js +0 -58
  236. package/dist/arrow-down-Br0qtpsz.js +0 -1
  237. package/dist/arrow-left-Dj7xgE12.js +0 -1
  238. package/dist/check-DPeeMUYx.js +0 -1
  239. package/dist/chevron-down-CHSWk7ZT.js +0 -1
  240. package/dist/chevron-right-B7l_fMgx.js +0 -1
  241. package/dist/circle-Bb0yOpqM.js +0 -1
  242. package/dist/circle-check-BGZpCiz7.js +0 -1
  243. package/dist/code-block-CUQ5mtv0.js +0 -1
  244. package/dist/controllable-D43BKmtX.js +0 -1
  245. package/dist/conversation-list-D4lLU_yS.js +0 -1
  246. package/dist/define-CGGX-7Vg.js +0 -1
  247. package/dist/message-circle-Xf8Q-vZp.js +0 -1
  248. package/dist/message-square-Cxnwgkns.js +0 -1
  249. package/dist/play-OFIvYXUQ.js +0 -1
  250. package/dist/register-impl-C7rENvPK.js +0 -424
  251. package/dist/store-7eoadydQ.js +0 -1
  252. package/dist/x-C5m1JFgi.js +0 -1
  253. package/src/agent-tooling/archetypes.ts +0 -205
  254. package/src/agent-tooling/catalog/README.md +0 -676
  255. package/src/agent-tooling/catalog/catalog-types.ts +0 -231
  256. package/src/agent-tooling/catalog/fabrications.ts +0 -96
  257. package/src/agent-tooling/catalog/invariants.ts +0 -284
  258. package/src/agent-tooling/catalog/labs-titles.ts +0 -114
  259. package/src/agent-tooling/catalog/scenarios.ts +0 -87
  260. package/src/agent-tooling/catalog/surfaces.ts +0 -347
  261. package/src/agent-tooling/construct/cli-entry.ts +0 -8
  262. package/src/agent-tooling/construct/cli.ts +0 -131
  263. package/src/agent-tooling/construct/codegen.ts +0 -1353
  264. package/src/agent-tooling/construct/construct.v1.schema.json +0 -250
  265. package/src/agent-tooling/construct/dev.ts +0 -148
  266. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
  267. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
  268. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -23
  269. package/src/agent-tooling/construct/schema.ts +0 -371
  270. package/src/agent-tooling/integrations/anthropic.ts +0 -442
  271. package/src/agent-tooling/integrations/cloudflare.ts +0 -218
  272. package/src/agent-tooling/integrations/langgraph.ts +0 -133
  273. package/src/agent-tooling/integrations/mastra.ts +0 -182
  274. package/src/agent-tooling/integrations/mock.ts +0 -148
  275. package/src/agent-tooling/integrations/ollama.ts +0 -97
  276. package/src/agent-tooling/integrations/openai.ts +0 -95
  277. package/src/agent-tooling/integrations/openrouter.ts +0 -82
  278. package/src/agent-tooling/integrations/pi.ts +0 -176
  279. package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
  280. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
  281. package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
  282. package/src/agent-tooling/mcp/manifest.ts +0 -422
  283. package/src/agent-tooling/mcp/server.ts +0 -116
  284. package/src/agent-tooling/mcp/stdio.ts +0 -18
  285. package/src/agent-tooling/mcp/tools/construct.ts +0 -130
  286. package/src/agent-tooling/mcp/tools/debug.ts +0 -621
  287. package/src/agent-tooling/mcp/tools/reference.ts +0 -980
  288. package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
  289. package/src/agent-tooling/mcp/tools/theme.ts +0 -456
  290. package/src/agent-tooling/mcp/tools/types.ts +0 -14
  291. package/src/agent-tooling/mcp/validate-args.ts +0 -141
  292. package/src/agent-tooling/recipes/composed-thread.ts +0 -714
  293. package/src/agent-tooling/recipes/index.ts +0 -22
  294. package/src/agent-tooling/recipes/types.ts +0 -32
  295. package/src/agent-tooling/registry.ts +0 -132
  296. package/src/agent-tooling/route-emit.ts +0 -305
  297. package/src/agent-tooling/types.ts +0 -390
  298. package/src/components/artifact-card.tsx +0 -120
  299. package/src/components/artifact.tsx +0 -914
  300. package/src/components/attachment-types.ts +0 -66
  301. package/src/components/attachments.tsx +0 -536
  302. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
  303. package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
  304. package/src/components/audio-visualizer/fit-scale.ts +0 -112
  305. package/src/components/audio-visualizer/index.tsx +0 -528
  306. package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
  307. package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
  308. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
  309. package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
  310. package/src/components/audio-visualizer/sizes.ts +0 -54
  311. package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
  312. package/src/components/audio-visualizer/variant-bar.tsx +0 -175
  313. package/src/components/audio-visualizer/variant-custom.tsx +0 -344
  314. package/src/components/audio-visualizer/variant-grid.tsx +0 -175
  315. package/src/components/audio-visualizer/variant-radial.tsx +0 -163
  316. package/src/components/audio-visualizer/variant-wave.tsx +0 -130
  317. package/src/components/audio-visualizer/wave.glsl.ts +0 -130
  318. package/src/components/card-fallback.tsx +0 -60
  319. package/src/components/card-renderer.tsx +0 -220
  320. package/src/components/card.tsx +0 -212
  321. package/src/components/chain-of-thought.tsx +0 -348
  322. package/src/components/chat-container.tsx +0 -89
  323. package/src/components/chat-scope-picker.tsx +0 -57
  324. package/src/components/chat-thread.tsx +0 -518
  325. package/src/components/checkpoint.tsx +0 -88
  326. package/src/components/choice-card.tsx +0 -743
  327. package/src/components/coachmark.tsx +0 -249
  328. package/src/components/code-block.tsx +0 -181
  329. package/src/components/composer-dom.ts +0 -159
  330. package/src/components/composer-highlight.ts +0 -242
  331. package/src/components/composer-history.ts +0 -82
  332. package/src/components/composer.tsx +0 -1075
  333. package/src/components/confirm-card.tsx +0 -402
  334. package/src/components/context.tsx +0 -377
  335. package/src/components/conversation-item.tsx +0 -218
  336. package/src/components/conversation-list.tsx +0 -429
  337. package/src/components/dismissed-stub.tsx +0 -80
  338. package/src/components/embed.tsx +0 -200
  339. package/src/components/empty.tsx +0 -177
  340. package/src/components/feedback-bar.tsx +0 -166
  341. package/src/components/file-tree.tsx +0 -530
  342. package/src/components/file-upload.tsx +0 -167
  343. package/src/components/form-widgets.tsx +0 -525
  344. package/src/components/form.tsx +0 -1296
  345. package/src/components/image.tsx +0 -65
  346. package/src/components/link-preview.tsx +0 -195
  347. package/src/components/loader.tsx +0 -367
  348. package/src/components/markdown.tsx +0 -162
  349. package/src/components/message-skills.tsx +0 -40
  350. package/src/components/message.tsx +0 -765
  351. package/src/components/model-switcher.tsx +0 -132
  352. package/src/components/prompt-input.tsx +0 -188
  353. package/src/components/prompt-suggestion.tsx +0 -150
  354. package/src/components/reasoning.tsx +0 -293
  355. package/src/components/response-compare-types.ts +0 -152
  356. package/src/components/response-compare.tsx +0 -455
  357. package/src/components/response-stream.tsx +0 -109
  358. package/src/components/screen.tsx +0 -181
  359. package/src/components/scroll-button.tsx +0 -93
  360. package/src/components/source.tsx +0 -192
  361. package/src/components/tasks-card.tsx +0 -801
  362. package/src/components/text-shimmer.tsx +0 -37
  363. package/src/components/thinking-bar.tsx +0 -50
  364. package/src/components/thread.tsx +0 -228
  365. package/src/components/toast.tsx +0 -503
  366. package/src/components/tool-classify.ts +0 -26
  367. package/src/components/tool-types.ts +0 -49
  368. package/src/components/tool.tsx +0 -190
  369. package/src/components/use-card-resolution.ts +0 -44
  370. package/src/components/voice-input.tsx +0 -222
  371. package/src/components/voice-output.tsx +0 -242
  372. package/src/components/workspace-shell.tsx +0 -285
  373. package/src/diagnostics/hook.ts +0 -352
  374. package/src/diagnostics/index.ts +0 -82
  375. package/src/diagnostics/report-request.ts +0 -296
  376. package/src/elements/agent-card.tsx +0 -67
  377. package/src/elements/artifact.tsx +0 -194
  378. package/src/elements/attachments.tsx +0 -140
  379. package/src/elements/audio-visualizer.tsx +0 -227
  380. package/src/elements/autoloader.ts +0 -89
  381. package/src/elements/avatar.tsx +0 -33
  382. package/src/elements/badge.tsx +0 -32
  383. package/src/elements/button.tsx +0 -149
  384. package/src/elements/card.tsx +0 -133
  385. package/src/elements/cards.tsx +0 -266
  386. package/src/elements/chain-of-thought.tsx +0 -141
  387. package/src/elements/chat-scope-picker.tsx +0 -65
  388. package/src/elements/chat-types.ts +0 -102
  389. package/src/elements/chat-workspace.tsx +0 -188
  390. package/src/elements/chat.tsx +0 -212
  391. package/src/elements/checkbox-group.tsx +0 -164
  392. package/src/elements/checkbox.tsx +0 -134
  393. package/src/elements/checkpoint.tsx +0 -47
  394. package/src/elements/choice.tsx +0 -100
  395. package/src/elements/coachmark.tsx +0 -90
  396. package/src/elements/code-block.tsx +0 -60
  397. package/src/elements/command.tsx +0 -197
  398. package/src/elements/compare.tsx +0 -111
  399. package/src/elements/compiled.css +0 -2
  400. package/src/elements/composer.tsx +0 -162
  401. package/src/elements/confirm-card.tsx +0 -76
  402. package/src/elements/context-meter.tsx +0 -107
  403. package/src/elements/conversation-item.tsx +0 -120
  404. package/src/elements/conversation-list.tsx +0 -203
  405. package/src/elements/css.ts +0 -5
  406. package/src/elements/default-input.tsx +0 -392
  407. package/src/elements/define-entry.ts +0 -12
  408. package/src/elements/define.tsx +0 -563
  409. package/src/elements/diagnostic-events.ts +0 -114
  410. package/src/elements/dialog.tsx +0 -145
  411. package/src/elements/disclosure.ts +0 -95
  412. package/src/elements/dock.tsx +0 -215
  413. package/src/elements/dropdown.tsx +0 -123
  414. package/src/elements/editable-label.tsx +0 -140
  415. package/src/elements/element-data-types.ts +0 -152
  416. package/src/elements/element-diagnostics.ts +0 -392
  417. package/src/elements/element-manifest.json +0 -354
  418. package/src/elements/element-nonscalar.json +0 -185
  419. package/src/elements/element-types.d.ts +0 -4337
  420. package/src/elements/embed.tsx +0 -35
  421. package/src/elements/empty.tsx +0 -29
  422. package/src/elements/feedback-bar.tsx +0 -66
  423. package/src/elements/file-tree.tsx +0 -62
  424. package/src/elements/file-upload.tsx +0 -44
  425. package/src/elements/form.tsx +0 -94
  426. package/src/elements/hover-card.tsx +0 -80
  427. package/src/elements/icon.tsx +0 -41
  428. package/src/elements/image.tsx +0 -32
  429. package/src/elements/input.tsx +0 -492
  430. package/src/elements/kbd.tsx +0 -45
  431. package/src/elements/link-preview.tsx +0 -34
  432. package/src/elements/loader.tsx +0 -25
  433. package/src/elements/markdown.tsx +0 -38
  434. package/src/elements/menu.tsx +0 -241
  435. package/src/elements/message-skills.tsx +0 -83
  436. package/src/elements/message.tsx +0 -361
  437. package/src/elements/model-switcher.tsx +0 -121
  438. package/src/elements/nav.tsx +0 -87
  439. package/src/elements/notice.tsx +0 -53
  440. package/src/elements/pane-grid.tsx +0 -111
  441. package/src/elements/pane-group.tsx +0 -119
  442. package/src/elements/pane.tsx +0 -129
  443. package/src/elements/popover.tsx +0 -81
  444. package/src/elements/progress-bar.tsx +0 -39
  445. package/src/elements/prompt-dock.tsx +0 -82
  446. package/src/elements/prompt-input.tsx +0 -240
  447. package/src/elements/prompt-suggestions.tsx +0 -113
  448. package/src/elements/radio-group.tsx +0 -129
  449. package/src/elements/reasoning.tsx +0 -71
  450. package/src/elements/register-impl.ts +0 -148
  451. package/src/elements/register.ts +0 -76
  452. package/src/elements/remote.tsx +0 -225
  453. package/src/elements/resizable.globals.d.ts +0 -36
  454. package/src/elements/resizable.tsx +0 -704
  455. package/src/elements/response-stream.tsx +0 -40
  456. package/src/elements/screen.tsx +0 -90
  457. package/src/elements/scroll-area.tsx +0 -33
  458. package/src/elements/scroll-button.tsx +0 -179
  459. package/src/elements/search.tsx +0 -185
  460. package/src/elements/segmented.tsx +0 -129
  461. package/src/elements/select.tsx +0 -165
  462. package/src/elements/separator.tsx +0 -36
  463. package/src/elements/setting-item.tsx +0 -50
  464. package/src/elements/settings-group.tsx +0 -37
  465. package/src/elements/skeleton.tsx +0 -45
  466. package/src/elements/slider.tsx +0 -171
  467. package/src/elements/slot-text.ts +0 -73
  468. package/src/elements/slots.ts +0 -787
  469. package/src/elements/source.tsx +0 -126
  470. package/src/elements/status.tsx +0 -42
  471. package/src/elements/styles.css +0 -328
  472. package/src/elements/switch.tsx +0 -118
  473. package/src/elements/tabs.tsx +0 -95
  474. package/src/elements/tasks.tsx +0 -103
  475. package/src/elements/text-shimmer.tsx +0 -28
  476. package/src/elements/thinking-bar.tsx +0 -43
  477. package/src/elements/thread.tsx +0 -139
  478. package/src/elements/toast.tsx +0 -106
  479. package/src/elements/tool.tsx +0 -78
  480. package/src/elements/tooltip.tsx +0 -85
  481. package/src/elements/validate-messages.ts +0 -76
  482. package/src/elements/voice-input.tsx +0 -100
  483. package/src/elements/voice-output.tsx +0 -82
  484. package/src/index.ts +0 -428
  485. package/src/primitives/audio-bands.ts +0 -174
  486. package/src/primitives/card-component-types.ts +0 -63
  487. package/src/primitives/card-contract.ts +0 -80
  488. package/src/primitives/card-data-types.ts +0 -361
  489. package/src/primitives/card-host.tsx +0 -37
  490. package/src/primitives/card-recovery.ts +0 -160
  491. package/src/primitives/card-registry.tsx +0 -78
  492. package/src/primitives/card-resolution.ts +0 -36
  493. package/src/primitives/card-routing.ts +0 -85
  494. package/src/primitives/card-schemas/artifact.schema.json +0 -92
  495. package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
  496. package/src/primitives/card-schemas/card-event.schema.json +0 -12
  497. package/src/primitives/card-schemas/choice.schema.json +0 -75
  498. package/src/primitives/card-schemas/confirm.schema.json +0 -65
  499. package/src/primitives/card-schemas/embed.schema.json +0 -63
  500. package/src/primitives/card-schemas/form.result.schema.json +0 -7
  501. package/src/primitives/card-schemas/form.schema.json +0 -53
  502. package/src/primitives/card-schemas/link.schema.json +0 -54
  503. package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
  504. package/src/primitives/card-schemas/tasks.schema.json +0 -83
  505. package/src/primitives/card-tags.ts +0 -61
  506. package/src/primitives/card-validate-cards.ts +0 -255
  507. package/src/primitives/card-validate-schemas.ts +0 -58
  508. package/src/primitives/card-validate.ts +0 -131
  509. package/src/primitives/chat-config.tsx +0 -103
  510. package/src/primitives/composer-model.ts +0 -49
  511. package/src/primitives/composer-triggers.ts +0 -35
  512. package/src/primitives/controllable.ts +0 -21
  513. package/src/primitives/create-kai-chat.ts +0 -66
  514. package/src/primitives/create-tween.ts +0 -266
  515. package/src/primitives/embed-providers.ts +0 -254
  516. package/src/primitives/field-mask.ts +0 -256
  517. package/src/primitives/field-semantics.ts +0 -115
  518. package/src/primitives/highlighter.ts +0 -157
  519. package/src/primitives/input-mask.ts +0 -853
  520. package/src/primitives/link-preview.ts +0 -87
  521. package/src/primitives/message-feedback.ts +0 -124
  522. package/src/primitives/pdf-preview.ts +0 -121
  523. package/src/primitives/toast-store.ts +0 -338
  524. package/src/primitives/url-scheme-policy.ts +0 -70
  525. package/src/primitives/use-audio-analysis.ts +0 -340
  526. package/src/primitives/use-auto-resize.ts +0 -31
  527. package/src/primitives/use-resize-observer.ts +0 -45
  528. package/src/primitives/use-sequencer.ts +0 -72
  529. package/src/primitives/use-speech-recognition.ts +0 -146
  530. package/src/primitives/use-stick-to-bottom.ts +0 -75
  531. package/src/primitives/use-text-stream.ts +0 -143
  532. package/src/primitives/use-voice-recorder.ts +0 -62
  533. package/src/primitives/visualizer-sequences.ts +0 -350
  534. package/src/remote/host-embed.ts +0 -345
  535. package/src/remote/index.ts +0 -2
  536. package/src/remote/origin.ts +0 -30
  537. package/src/remote/provider-runtime.ts +0 -262
  538. package/src/remote/provider.ts +0 -2
  539. package/src/remote/validate.ts +0 -22
  540. package/src/remote/version.ts +0 -12
  541. package/src/remote/wire.ts +0 -48
  542. package/src/schemas/from-tool-call.ts +0 -151
  543. package/src/schemas/index.ts +0 -341
  544. package/src/schemas/provider-subsets.ts +0 -538
  545. package/src/schemas/registry.ts +0 -355
  546. package/src/schemas/tool-defs.ts +0 -793
  547. package/src/solid.ts +0 -165
  548. package/src/state/index.ts +0 -44
  549. package/src/state/messages.ts +0 -53
  550. package/src/state/mock.ts +0 -297
  551. package/src/state/parts.ts +0 -295
  552. package/src/state/persistence.ts +0 -180
  553. package/src/state/stream.ts +0 -246
  554. package/src/state/suggestions.ts +0 -9
  555. package/src/state/threads.ts +0 -142
  556. package/src/test-utils/fake-clock.ts +0 -88
  557. package/src/types.ts +0 -53
  558. package/src/ui/action-icons.ts +0 -53
  559. package/src/ui/agent-card.tsx +0 -218
  560. package/src/ui/avatar.tsx +0 -23
  561. package/src/ui/badge.tsx +0 -21
  562. package/src/ui/button.tsx +0 -49
  563. package/src/ui/card.tsx +0 -245
  564. package/src/ui/checkbox-group.tsx +0 -153
  565. package/src/ui/checkbox.tsx +0 -63
  566. package/src/ui/collapsible.tsx +0 -163
  567. package/src/ui/command.tsx +0 -103
  568. package/src/ui/dialog.tsx +0 -223
  569. package/src/ui/dock.tsx +0 -584
  570. package/src/ui/dropdown.tsx +0 -636
  571. package/src/ui/editable-label.tsx +0 -112
  572. package/src/ui/hover-card.tsx +0 -345
  573. package/src/ui/icon.tsx +0 -167
  574. package/src/ui/input.tsx +0 -391
  575. package/src/ui/kbd.tsx +0 -118
  576. package/src/ui/nav.tsx +0 -282
  577. package/src/ui/notice.tsx +0 -84
  578. package/src/ui/overlay.tsx +0 -277
  579. package/src/ui/pane-grid.tsx +0 -117
  580. package/src/ui/pane-group.tsx +0 -291
  581. package/src/ui/pane.tsx +0 -193
  582. package/src/ui/popover.tsx +0 -106
  583. package/src/ui/progress-bar.tsx +0 -83
  584. package/src/ui/prompt-dock.tsx +0 -145
  585. package/src/ui/radio.tsx +0 -150
  586. package/src/ui/resizable.tsx +0 -693
  587. package/src/ui/scroll-area.tsx +0 -26
  588. package/src/ui/segmented.tsx +0 -109
  589. package/src/ui/select.tsx +0 -168
  590. package/src/ui/separator.tsx +0 -10
  591. package/src/ui/settings-group.tsx +0 -67
  592. package/src/ui/skeleton.tsx +0 -73
  593. package/src/ui/slider.tsx +0 -178
  594. package/src/ui/status.tsx +0 -48
  595. package/src/ui/switch.tsx +0 -119
  596. package/src/ui/tabs.tsx +0 -168
  597. package/src/ui/textarea.tsx +0 -21
  598. package/src/ui/tooltip.tsx +0 -118
  599. package/src/utils/cn.ts +0 -30
  600. package/src/wire/chunk.ts +0 -248
  601. package/src/wire/consume.ts +0 -599
  602. package/src/wire/diagnostics.ts +0 -727
  603. package/src/wire/encode-probe.ts +0 -214
  604. package/src/wire/encode.ts +0 -947
  605. package/src/wire/files.ts +0 -342
  606. package/src/wire/formats/anthropic.ts +0 -274
  607. package/src/wire/formats/openai.ts +0 -228
  608. package/src/wire/index.ts +0 -95
  609. package/src/wire/media-types.ts +0 -344
  610. package/src/wire/read.ts +0 -396
  611. package/src/wire/sink-helpers.ts +0 -50
  612. package/src/wire/sse.ts +0 -153
@@ -440,7 +440,7 @@ export interface KaiCardsElement extends HTMLElement {
440
440
  /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `types`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.schemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name, matching `mergeCardTags`, where your entry is spread over ours. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. See `CardSchemaMap` in components/card-renderer.tsx. */
441
441
  schemas?: Record<string, object>;
442
442
  /** Optional CardPolicy handling child events. Property: `el.policy`. */
443
- policy?: { onSubmit?: ((cardId: string, data: unknown) => void); onAction?: ((cardId: string, action: string, payload?: unknown) => void); onSendPrompt?: ((text: string, opts: { mode: "compose" | "send"; context?: unknown; }) => void); onOpen?: ((url: string, target: "tab" | "artifact") => void); onState?: ((cardId: string, patch: unknown) => void); onDismiss?: ((cardId: string) => void); onReopen?: ((cardId: string) => void); onError?: ((cardId: string, message: string) => void); maxSendPromptMode?: "compose" | "send" };
443
+ policy?: { onSubmit?: ((cardId: string, data: unknown) => void); onAction?: ((cardId: string, action: string, payload?: unknown) => void); onSendPrompt?: ((text: string, opts: { mode: "compose" | "send"; context?: unknown }) => void); onOpen?: ((url: string, target: "tab" | "artifact") => void); onState?: ((cardId: string, patch: unknown) => void); onDismiss?: ((cardId: string) => void); onReopen?: ((cardId: string) => void); onError?: ((cardId: string, message: string) => void); maxSendPromptMode?: "compose" | "send" };
444
444
  /** Validate each envelope's `data` against the schema for its type before rendering it, using a built-in's own schema or yours from `schemas`. Default `true`; set `validate-cards="false"` (or `el.validateCards = false`) to opt out. A hard failure (wrong type, a missing required field) renders a diagnostic naming the field instead of the card; a soft failure (bounds) renders the card unchanged. Both emit a contract `error` event. On in production too: a model emitting a bad shape is a production failure mode, so stripping the check there would hide it from exactly the person who needs to see it. */
445
445
  validateCards?: boolean;
446
446
  /** Programmatically resolve a child card by id: set that envelope's `resolution` so the child re-renders into its read-only/resolved view. The imperative twin of the consumer mutating the cards array. No-op for an unknown id. */
@@ -541,6 +541,12 @@ export interface KaiChatElement extends HTMLElement {
541
541
  cardTypes?: Record<string, string>;
542
542
  /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
543
543
  cardSchemas?: Record<string, object>;
544
+ /** Turns on the prior-conversations list (a list-toggle button in the header, plus a second list view sharing the panel, C-1). Attribute- settable like every other boolean flag on this element: `<kai-chat conversations>`. Requires `store`. A row select, "new conversation," or the visitor's mount-time auto-restore all deliver their messages the same way: listen for `kai-conversation-load` and set `el.messages` from `event.detail.messages` (a fresh array): this element does not update `messages` for you. Set with no `store`, the underlying `ChatThread` decides loudly (one console.error) and stays visually off; this facade always supplies its own internal load handler (the `kai-conversation-load` dispatch below), so the second ChatThread guard, missing `onConversationLoad`, never trips here, even for a consumer who never listens for the event. Default false. */
545
+ conversations?: boolean;
546
+ /** The adapter this thread persists conversations through: an object of three functions (`list`/`load`/`save`; `ConversationStore`, exported from `@kitn.ai/ui`'s `primitives/conversation-store`). A JS PROPERTY ONLY: `el.store = myAdapter`. It can never be an attribute, since a function-bearing object has no HTML string form, the same reasoning that keeps `messages`/`cardSchemas` property-only (the kai- contract: array/object props are JS properties, never attributes). Two built-ins ship: `localStorageStore(name, userId?)` and `fetchStore(url, userId?)`. */
547
+ store?: { list: () => Promise<{ id: string; title: string; groupId?: string; scope?: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt?: string; updatedAt: string; trailing?: string; lastReadAt?: string }[]>; load: (id: string) => Promise<{ id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } | { kind: "dismissed"; at?: string } | { kind: "expired"; reason?: string; at?: string } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[]>; save: (id: string, messages: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } | { kind: "dismissed"; at?: string } | { kind: "expired"; reason?: string; at?: string } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[]) => Promise<void>; markRead?: ((id: string) => Promise<void>) };
548
+ /** Turns on the widget home screen (Intercom-pattern): the panel boots into a `home` view, with a greeting, most-recent-conversation card, a "new conversation" CTA, and host-defined links, plus a Home/Messages tab bar for switching back to the thread. An OBJECT, so it is a JS property only: `el.home = { greeting: { title: 'Hey' }, links: [...] }`, never an attribute (the kai- contract: array/object props are JS properties). A `links` entry with no `href` fires `kai-home-link` with that entry when tapped, rather than navigating; one WITH `href` opens it directly (only when the URL passes the kit's own scheme allowlist). Omit for the no-home widget (chat view only, unchanged). */
549
+ home?: { greeting?: { title?: string; subtitle?: string }; recentConversation?: boolean; newConversation?: { label?: string }; links?: { label: string; href?: string; description?: string; icon?: string }[] };
544
550
  /** Focus the composer, meaning the contenteditable (or textarea) inside the shadow root. A native `focus()` on the host lands on the host itself and never reaches it, so this is the only way to focus the input programmatically. */
545
551
  focus(options?: FocusOptions): void;
546
552
  /** Blur whatever currently holds focus inside the shadow root. The companion to `focus()`, for the same reason: a native `blur()` on the host misses the real focus target. */
@@ -803,7 +809,7 @@ export interface KaiConversationsElement extends HTMLElement {
803
809
  /** The list's section headers (`{ id, name, sortOrder, createdAt }`), rendered in array order. A group carries no conversations of its own; it is matched against `conversations` by id, so the two props are complementary rather than alternatives. Omit for an ungrouped list. Set as a JS property. */
804
810
  groups: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
805
811
  /** Every conversation the list renders, flat. Each one is filed under the group whose `id` equals its `groupId`; one with no `groupId`, or with a `groupId` matching no entry in `groups`, falls into a trailing "Ungrouped" section, so nothing you pass in is ever dropped. There is no recency bucketing. Set as a JS property. Omit to supply them as `<kai-conversation>` light-DOM children instead, or for the empty state. A search query that matches nothing shows a visible "No conversations match your search" state, distinct from the zero-conversations empty state. Slotted `<kai-conversation-item>` children switch the list into item mode instead: your own rows win and this array is not rendered. */
806
- conversations: { id: string; title: string; groupId?: string; scope?: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt?: string; updatedAt: string; trailing?: string }[];
812
+ conversations: { id: string; title: string; groupId?: string; scope?: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt?: string; updatedAt: string; trailing?: string; lastReadAt?: string }[];
807
813
  /** The id of the currently-open conversation, highlighted in the list. */
808
814
  activeId?: string;
809
815
  /** Controlled collapsed state. Set as a JS property (`el.collapsed = true`) to drive the rail from your app, updating it in response to `kai-collapse-toggle`. Omit for uncontrolled (the element manages it). Collapsed shrinks the rail to a floating reopen button. */
@@ -2391,7 +2397,7 @@ export interface KaiCardsElementProps {
2391
2397
  /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `types`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.schemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name, matching `mergeCardTags`, where your entry is spread over ours. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. See `CardSchemaMap` in components/card-renderer.tsx. */
2392
2398
  schemas?: Record<string, object>;
2393
2399
  /** Optional CardPolicy handling child events. Property: `el.policy`. */
2394
- policy?: { onSubmit?: ((cardId: string, data: unknown) => void); onAction?: ((cardId: string, action: string, payload?: unknown) => void); onSendPrompt?: ((text: string, opts: { mode: "compose" | "send"; context?: unknown; }) => void); onOpen?: ((url: string, target: "tab" | "artifact") => void); onState?: ((cardId: string, patch: unknown) => void); onDismiss?: ((cardId: string) => void); onReopen?: ((cardId: string) => void); onError?: ((cardId: string, message: string) => void); maxSendPromptMode?: "compose" | "send" };
2400
+ policy?: { onSubmit?: ((cardId: string, data: unknown) => void); onAction?: ((cardId: string, action: string, payload?: unknown) => void); onSendPrompt?: ((text: string, opts: { mode: "compose" | "send"; context?: unknown }) => void); onOpen?: ((url: string, target: "tab" | "artifact") => void); onState?: ((cardId: string, patch: unknown) => void); onDismiss?: ((cardId: string) => void); onReopen?: ((cardId: string) => void); onError?: ((cardId: string, message: string) => void); maxSendPromptMode?: "compose" | "send" };
2395
2401
  /** Validate each envelope's `data` against the schema for its type before rendering it, using a built-in's own schema or yours from `schemas`. Default `true`; set `validate-cards="false"` (or `el.validateCards = false`) to opt out. A hard failure (wrong type, a missing required field) renders a diagnostic naming the field instead of the card; a soft failure (bounds) renders the card unchanged. Both emit a contract `error` event. On in production too: a model emitting a bad shape is a production failure mode, so stripping the check there would hide it from exactly the person who needs to see it. */
2396
2402
  validateCards?: boolean;
2397
2403
  }
@@ -2480,6 +2486,12 @@ export interface KaiChatElementProps {
2480
2486
  cardTypes?: Record<string, string>;
2481
2487
  /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
2482
2488
  cardSchemas?: Record<string, object>;
2489
+ /** Turns on the prior-conversations list (a list-toggle button in the header, plus a second list view sharing the panel, C-1). Attribute- settable like every other boolean flag on this element: `<kai-chat conversations>`. Requires `store`. A row select, "new conversation," or the visitor's mount-time auto-restore all deliver their messages the same way: listen for `kai-conversation-load` and set `el.messages` from `event.detail.messages` (a fresh array): this element does not update `messages` for you. Set with no `store`, the underlying `ChatThread` decides loudly (one console.error) and stays visually off; this facade always supplies its own internal load handler (the `kai-conversation-load` dispatch below), so the second ChatThread guard, missing `onConversationLoad`, never trips here, even for a consumer who never listens for the event. Default false. */
2490
+ conversations?: boolean;
2491
+ /** The adapter this thread persists conversations through: an object of three functions (`list`/`load`/`save`; `ConversationStore`, exported from `@kitn.ai/ui`'s `primitives/conversation-store`). A JS PROPERTY ONLY: `el.store = myAdapter`. It can never be an attribute, since a function-bearing object has no HTML string form, the same reasoning that keeps `messages`/`cardSchemas` property-only (the kai- contract: array/object props are JS properties, never attributes). Two built-ins ship: `localStorageStore(name, userId?)` and `fetchStore(url, userId?)`. */
2492
+ store?: { list: () => Promise<{ id: string; title: string; groupId?: string; scope?: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt?: string; updatedAt: string; trailing?: string; lastReadAt?: string }[]>; load: (id: string) => Promise<{ id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } | { kind: "dismissed"; at?: string } | { kind: "expired"; reason?: string; at?: string } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[]>; save: (id: string, messages: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } | { kind: "dismissed"; at?: string } | { kind: "expired"; reason?: string; at?: string } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[]) => Promise<void>; markRead?: ((id: string) => Promise<void>) };
2493
+ /** Turns on the widget home screen (Intercom-pattern): the panel boots into a `home` view, with a greeting, most-recent-conversation card, a "new conversation" CTA, and host-defined links, plus a Home/Messages tab bar for switching back to the thread. An OBJECT, so it is a JS property only: `el.home = { greeting: { title: 'Hey' }, links: [...] }`, never an attribute (the kai- contract: array/object props are JS properties). A `links` entry with no `href` fires `kai-home-link` with that entry when tapped, rather than navigating; one WITH `href` opens it directly (only when the URL passes the kit's own scheme allowlist). Omit for the no-home widget (chat view only, unchanged). */
2494
+ home?: { greeting?: { title?: string; subtitle?: string }; recentConversation?: boolean; newConversation?: { label?: string }; links?: { label: string; href?: string; description?: string; icon?: string }[] };
2483
2495
  }
2484
2496
 
2485
2497
  export interface KaiCheckboxElementProps {
@@ -2682,7 +2694,7 @@ export interface KaiConversationsElementProps {
2682
2694
  /** The list's section headers (`{ id, name, sortOrder, createdAt }`), rendered in array order. A group carries no conversations of its own; it is matched against `conversations` by id, so the two props are complementary rather than alternatives. Omit for an ungrouped list. Set as a JS property. */
2683
2695
  groups?: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
2684
2696
  /** Every conversation the list renders, flat. Each one is filed under the group whose `id` equals its `groupId`; one with no `groupId`, or with a `groupId` matching no entry in `groups`, falls into a trailing "Ungrouped" section, so nothing you pass in is ever dropped. There is no recency bucketing. Set as a JS property. Omit to supply them as `<kai-conversation>` light-DOM children instead, or for the empty state. A search query that matches nothing shows a visible "No conversations match your search" state, distinct from the zero-conversations empty state. Slotted `<kai-conversation-item>` children switch the list into item mode instead: your own rows win and this array is not rendered. */
2685
- conversations?: { id: string; title: string; groupId?: string; scope?: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt?: string; updatedAt: string; trailing?: string }[];
2697
+ conversations?: { id: string; title: string; groupId?: string; scope?: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt?: string; updatedAt: string; trailing?: string; lastReadAt?: string }[];
2686
2698
  /** The id of the currently-open conversation, highlighted in the list. */
2687
2699
  activeId?: string;
2688
2700
  /** Controlled collapsed state. Set as a JS property (`el.collapsed = true`) to drive the rail from your app, updating it in response to `kai-collapse-toggle`. Omit for uncontrolled (the element manages it). Collapsed shrinks the rail to a floating reopen button. */
@@ -3758,6 +3770,10 @@ export interface KaiChatElementEvents {
3758
3770
  onKaiAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3759
3771
  /** One or more picked files were refused because `accept` excluded them. The element renders NO message of its own: it reports the facts (name, media type, whether the kit could have sent it) and what the user should see is the application's call. Only ever fires when `accept` is set. */
3760
3772
  onKaiAttachmentsRejected?: (event: CustomEvent<{ rejected: { filename: string; mediaType: string; reason: "filtered" | "unsupported" }[] }>) => void;
3773
+ /** A conversation's history loaded: a row tap in the list, "new conversation," or the visitor's own mount-time auto-restore of their most recent thread (only fires when `conversations` is on and a `store` is set). `detail.id` is that conversation's id, `undefined` for the "new conversation" case (no id exists until the first message mints one, C-6). Set `el.messages = event.detail.messages` (already a fresh array) to actually render it, since this element does not do that for you; `messages` stays your own state like everywhere else on this element. */
3774
+ onKaiConversationLoad?: (event: CustomEvent<{ id: string | undefined; messages: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: undefined | { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: undefined | string; index?: undefined | number; streamId?: undefined | string; signature?: undefined | string; raw?: undefined | { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: undefined | "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: undefined | Record<string, unknown>; rawInput?: undefined | string; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string; raw?: undefined | { source: string; payload: unknown } }; raw?: undefined | { source: string; payload: unknown } } | { type: "card"; envelope: { type: string; id: string; data: unknown; title?: undefined | string; resolution?: undefined | { kind: "action"; action: string; payload?: unknown; at?: undefined | string } | { kind: "submit"; data: unknown; at?: undefined | string } | { kind: "dismissed"; at?: undefined | string } | { kind: "expired"; reason?: undefined | string; at?: undefined | string } }; raw?: undefined | { source: string; payload: unknown } } | { type: "source"; source: { id?: undefined | string; url?: undefined | string; title?: undefined | string; snippet?: undefined | string; index?: undefined | number }; raw?: undefined | { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }; raw?: undefined | { source: string; payload: unknown } })[]; actions?: undefined | ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | "like" | "dislike" }[] }>) => void;
3775
+ /** A `home.links` entry with no `href` was activated (tapped/clicked/Enter). Meaningful only when `home` is set. */
3776
+ onKaiHomeLink?: (event: CustomEvent<{ entry: { label: string; href?: undefined | string; description?: undefined | string; icon?: undefined | string } }>) => void;
3761
3777
  /** An action button on a message was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
3762
3778
  onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3763
3779
  /** The header model switcher changed. */
@@ -1 +1 @@
1
- import{I as r}from"./Icon-BnFKqqtY.js";import{c as e,q as i}from"./define-CGGX-7Vg.js";var l=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],a=c=>e(r,i(c,{name:"Ellipsis",iconNode:l})),o=a;export{o as e};
1
+ import{I as r}from"./Icon-DObhsRtm.js";import{c as e,q as i}from"./define-By-uL588.js";var l=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],a=c=>e(r,i(c,{name:"Ellipsis",iconNode:l})),o=a;export{o as e};
@@ -1 +1 @@
1
- import{c as l,q as A,s as G,g as P,k as g,o as H,j as D,x as M,p as J,i as u,S as w,u as K,a as y,d as m,l as Q,t as f,e as W}from"./define-CGGX-7Vg.js";import{c as X}from"./cn-DN5AWfiS.js";import{p as ee}from"./play-OFIvYXUQ.js";import{e as re}from"./external-link-u9d85ORQ.js";import{t as te}from"./triangle-alert-DHohDOCy.js";import{I as oe}from"./Icon-BnFKqqtY.js";var ne=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ae=e=>l(oe,A(e,{name:"Video",iconNode:ne})),ie=ae;const k="allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox",$="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",se=new Set;function le(e){const r=N(e);return r!==void 0&&se.has(r)}function N(e){try{return new URL(e).origin}catch{return}}function O(e){let r;try{r=new URL(e)}catch{return}const n=r.hostname.replace(/^www\./,"");if(n==="youtu.be")return E(r.pathname.slice(1));if(n==="youtube.com"||n==="m.youtube.com"||n==="youtube-nocookie.com"){const i=r.searchParams.get("v");if(i)return E(i);const h=r.pathname.match(/^\/(?:shorts|embed|v)\/([^/?#]+)/);if(h)return E(h[1])}}function T(e){let r;try{r=new URL(e)}catch{return}const n=r.hostname.replace(/^www\./,"");if(n!=="vimeo.com"&&n!=="player.vimeo.com")return;const i=r.pathname.match(/(?:^|\/)(\d+)(?:\/|$)/);return i?i[1]:void 0}function E(e){return/^[A-Za-z0-9_-]+$/.test(e)?e:void 0}function ue(e){const r=e.start?`&start=${e.start}`:"";switch(e.provider){case"youtube":{const n=e.id??(e.url?O(e.url):void 0);if(!n)throw new Error("youtube embed: missing or unparseable id/url");return{embedUrl:`https://www.youtube-nocookie.com/embed/${n}?autoplay=1&rel=0${r}`,posterUrl:e.poster??`https://i.ytimg.com/vi/${n}/hqdefault.jpg`,sandbox:k,allow:$}}case"vimeo":{const n=e.id??(e.url?T(e.url):void 0);if(!n)throw new Error("vimeo embed: missing or unparseable id/url");return{embedUrl:`https://player.vimeo.com/video/${n}?autoplay=1&dnt=1${e.start?`#t=${e.start}s`:""}`,posterUrl:e.poster,sandbox:k,allow:$}}case"generic":{if(!e.url)throw new Error("generic embed: missing url");if(ce(e.url),!le(e.url))throw new Error(`generic embed: origin not allowlisted \u2014 call configureEmbedAllowlist([...]) to permit ${N(e.url)??e.url}`);return{embedUrl:e.url,posterUrl:e.poster,sandbox:k,allow:$}}}}function ce(e){let r;try{r=new URL(e).protocol}catch{throw new Error(`generic embed: invalid url "${e}"`)}if(r!=="https:")throw new Error(`generic embed: only https player URLs are allowed (got ${r})`)}function de(e){switch(e.provider){case"youtube":{const r=e.id??(e.url?O(e.url):void 0);return r?`https://www.youtube.com/watch?v=${r}`:e.url}case"vimeo":{const r=e.id??(e.url?T(e.url):void 0);return r?`https://vimeo.com/${r}`:e.url}case"generic":return e.url}}function me(e){switch(e){case"youtube":return"YouTube";case"vimeo":return"Vimeo";case"generic":return"site"}}function fe(e){switch(e){case"4:3":return"4 / 3";case"1:1":return"1 / 1";case"9:16":return"9 / 16";default:return"16 / 9"}}var pe=f('<div tabindex=-1 class="absolute inset-0 outline-none"><iframe allowfullscreen class="absolute inset-0 h-full w-full border-0">'),ve=f('<button type=button class="inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">Open on '),be=f('<div><div class="relative w-full bg-black"></div><div class="flex items-center justify-between gap-2 px-3 py-2"><span class="flex min-w-0 items-center gap-1.5 text-sm text-foreground"><span class=truncate>'),he=f(`<div role=img aria-label="Can't load this video"class="absolute inset-0 flex flex-col items-center justify-center gap-2 bg-muted p-4 text-center text-sm text-muted-foreground"><span>Can't load this video`),ge=f('<img class="absolute inset-0 h-full w-full object-cover">'),we=f('<button type=button class="group absolute inset-0 flex h-full w-full items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"><span class="relative flex h-14 w-14 items-center justify-center rounded-full bg-black/60 text-white shadow-lg transition-transform motion-safe:group-hover:scale-110"aria-hidden=true>'),ye=f('<div class="absolute inset-0 bg-gradient-to-br from-zinc-800 to-zinc-950"aria-hidden=true>');function xe(e){const[r,n]=G(e,["cardId","data","onEmit","class"]),i=o=>{var p;return(p=r.onEmit)==null?void 0:p.call(r,o)},[h,U]=P(!1),[Y,C]=P(!1);let x;const c=g(()=>{try{return{ok:!0,value:ue(r.data)}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}}),Z=g(()=>fe(r.data.aspectRatio)),_=()=>r.data.title??"Embedded video",I=g(()=>c().ok&&!Y()?c().value.posterUrl:void 0),j=g(()=>de(r.data)),z=()=>me(r.data.provider);H(()=>i({kind:"ready",cardId:r.cardId})),D(M(c,o=>{o.ok||i({kind:"error",cardId:r.cardId,message:o.error})})),D(M(()=>r.data,()=>{U(!1),C(!1)},{defer:!0}));const L=()=>{c().ok&&(U(!0),queueMicrotask(()=>x?.focus()))},B=o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),L())},F=()=>{const o=j();o&&i({kind:"open",cardId:r.cardId,url:o,target:"tab"})};return(()=>{var o=be(),p=o.firstChild,R=p.nextSibling,S=R.firstChild,q=S.firstChild;return J(o,A({get class(){return X("overflow-hidden rounded-xl border border-border bg-card text-card-foreground",r.class)}},n),!1,!0),u(p,l(w,{get when(){return c().ok},get fallback(){return(()=>{var t=he(),s=t.firstChild;return u(t,l(te,{size:28,"aria-hidden":"true"}),s),t})()},get children(){return l(w,{get when(){return h()},get fallback(){return(()=>{var t=we(),s=t.firstChild;return t.$$keydown=B,t.$$click=()=>L(),u(t,l(w,{get when(){return I()},get fallback(){return ye()},get children(){var a=ge();return a.addEventListener("error",()=>C(!0)),y(d=>{var v=I(),b=r.data.title??"";return v!==d.e&&m(a,"src",d.e=v),b!==d.t&&m(a,"alt",d.t=b),d},{e:void 0,t:void 0}),a}}),s),u(s,l(ee,{size:26,fill:"currentColor"})),y(()=>m(t,"aria-label",`Play ${r.data.title??"video"}`)),t})()},get children(){var t=pe(),s=t.firstChild;return K(a=>x=a,t),y(a=>{var d=c().value.embedUrl,v=_(),b=c().value.sandbox,V=c().value.allow;return d!==a.e&&m(s,"src",a.e=d),v!==a.t&&m(s,"title",a.t=v),b!==a.a&&m(s,"sandbox",a.a=b),V!==a.o&&m(s,"allow",a.o=V),a},{e:void 0,t:void 0,a:void 0,o:void 0}),t}})}})),u(S,l(ie,{size:14,class:"shrink-0 opacity-70","aria-hidden":"true"}),q),u(q,()=>r.data.title??z()),u(R,l(w,{get when(){return j()},get children(){var t=ve();return t.firstChild,t.$$click=()=>F(),u(t,z,null),u(t,l(re,{size:12,"aria-hidden":"true"}),null),t}}),null),y(t=>Q(p,"aspect-ratio",Z())),o})()}W(["click","keydown"]);export{xe as E};
1
+ import{c as l,q as A,s as G,g as P,k as g,o as H,j as D,x as M,p as J,i as u,S as w,u as K,a as y,d as m,l as Q,t as f,e as W}from"./define-By-uL588.js";import{c as X}from"./cn-DN5AWfiS.js";import{p as ee}from"./play-BvKKq3fX.js";import{e as re}from"./external-link-ByXAwBBQ.js";import{t as te}from"./triangle-alert-DlQ68ppf.js";import{I as oe}from"./Icon-DObhsRtm.js";var ne=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ae=e=>l(oe,A(e,{name:"Video",iconNode:ne})),ie=ae;const k="allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox",$="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",se=new Set;function le(e){const r=N(e);return r!==void 0&&se.has(r)}function N(e){try{return new URL(e).origin}catch{return}}function O(e){let r;try{r=new URL(e)}catch{return}const n=r.hostname.replace(/^www\./,"");if(n==="youtu.be")return E(r.pathname.slice(1));if(n==="youtube.com"||n==="m.youtube.com"||n==="youtube-nocookie.com"){const i=r.searchParams.get("v");if(i)return E(i);const h=r.pathname.match(/^\/(?:shorts|embed|v)\/([^/?#]+)/);if(h)return E(h[1])}}function T(e){let r;try{r=new URL(e)}catch{return}const n=r.hostname.replace(/^www\./,"");if(n!=="vimeo.com"&&n!=="player.vimeo.com")return;const i=r.pathname.match(/(?:^|\/)(\d+)(?:\/|$)/);return i?i[1]:void 0}function E(e){return/^[A-Za-z0-9_-]+$/.test(e)?e:void 0}function ue(e){const r=e.start?`&start=${e.start}`:"";switch(e.provider){case"youtube":{const n=e.id??(e.url?O(e.url):void 0);if(!n)throw new Error("youtube embed: missing or unparseable id/url");return{embedUrl:`https://www.youtube-nocookie.com/embed/${n}?autoplay=1&rel=0${r}`,posterUrl:e.poster??`https://i.ytimg.com/vi/${n}/hqdefault.jpg`,sandbox:k,allow:$}}case"vimeo":{const n=e.id??(e.url?T(e.url):void 0);if(!n)throw new Error("vimeo embed: missing or unparseable id/url");return{embedUrl:`https://player.vimeo.com/video/${n}?autoplay=1&dnt=1${e.start?`#t=${e.start}s`:""}`,posterUrl:e.poster,sandbox:k,allow:$}}case"generic":{if(!e.url)throw new Error("generic embed: missing url");if(ce(e.url),!le(e.url))throw new Error(`generic embed: origin not allowlisted \u2014 call configureEmbedAllowlist([...]) to permit ${N(e.url)??e.url}`);return{embedUrl:e.url,posterUrl:e.poster,sandbox:k,allow:$}}}}function ce(e){let r;try{r=new URL(e).protocol}catch{throw new Error(`generic embed: invalid url "${e}"`)}if(r!=="https:")throw new Error(`generic embed: only https player URLs are allowed (got ${r})`)}function de(e){switch(e.provider){case"youtube":{const r=e.id??(e.url?O(e.url):void 0);return r?`https://www.youtube.com/watch?v=${r}`:e.url}case"vimeo":{const r=e.id??(e.url?T(e.url):void 0);return r?`https://vimeo.com/${r}`:e.url}case"generic":return e.url}}function me(e){switch(e){case"youtube":return"YouTube";case"vimeo":return"Vimeo";case"generic":return"site"}}function fe(e){switch(e){case"4:3":return"4 / 3";case"1:1":return"1 / 1";case"9:16":return"9 / 16";default:return"16 / 9"}}var pe=f('<div tabindex=-1 class="absolute inset-0 outline-none"><iframe allowfullscreen class="absolute inset-0 h-full w-full border-0">'),ve=f('<button type=button class="inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">Open on '),be=f('<div><div class="relative w-full bg-black"></div><div class="flex items-center justify-between gap-2 px-3 py-2"><span class="flex min-w-0 items-center gap-1.5 text-sm text-foreground"><span class=truncate>'),he=f(`<div role=img aria-label="Can't load this video"class="absolute inset-0 flex flex-col items-center justify-center gap-2 bg-muted p-4 text-center text-sm text-muted-foreground"><span>Can't load this video`),ge=f('<img class="absolute inset-0 h-full w-full object-cover">'),we=f('<button type=button class="group absolute inset-0 flex h-full w-full items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"><span class="relative flex h-14 w-14 items-center justify-center rounded-full bg-black/60 text-white shadow-lg transition-transform motion-safe:group-hover:scale-110"aria-hidden=true>'),ye=f('<div class="absolute inset-0 bg-gradient-to-br from-zinc-800 to-zinc-950"aria-hidden=true>');function xe(e){const[r,n]=G(e,["cardId","data","onEmit","class"]),i=o=>{var p;return(p=r.onEmit)==null?void 0:p.call(r,o)},[h,U]=P(!1),[Y,C]=P(!1);let x;const c=g(()=>{try{return{ok:!0,value:ue(r.data)}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}}),Z=g(()=>fe(r.data.aspectRatio)),_=()=>r.data.title??"Embedded video",I=g(()=>c().ok&&!Y()?c().value.posterUrl:void 0),j=g(()=>de(r.data)),z=()=>me(r.data.provider);H(()=>i({kind:"ready",cardId:r.cardId})),D(M(c,o=>{o.ok||i({kind:"error",cardId:r.cardId,message:o.error})})),D(M(()=>r.data,()=>{U(!1),C(!1)},{defer:!0}));const L=()=>{c().ok&&(U(!0),queueMicrotask(()=>x?.focus()))},B=o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),L())},F=()=>{const o=j();o&&i({kind:"open",cardId:r.cardId,url:o,target:"tab"})};return(()=>{var o=be(),p=o.firstChild,R=p.nextSibling,S=R.firstChild,q=S.firstChild;return J(o,A({get class(){return X("overflow-hidden rounded-xl border border-border bg-card text-card-foreground",r.class)}},n),!1,!0),u(p,l(w,{get when(){return c().ok},get fallback(){return(()=>{var t=he(),s=t.firstChild;return u(t,l(te,{size:28,"aria-hidden":"true"}),s),t})()},get children(){return l(w,{get when(){return h()},get fallback(){return(()=>{var t=we(),s=t.firstChild;return t.$$keydown=B,t.$$click=()=>L(),u(t,l(w,{get when(){return I()},get fallback(){return ye()},get children(){var a=ge();return a.addEventListener("error",()=>C(!0)),y(d=>{var v=I(),b=r.data.title??"";return v!==d.e&&m(a,"src",d.e=v),b!==d.t&&m(a,"alt",d.t=b),d},{e:void 0,t:void 0}),a}}),s),u(s,l(ee,{size:26,fill:"currentColor"})),y(()=>m(t,"aria-label",`Play ${r.data.title??"video"}`)),t})()},get children(){var t=pe(),s=t.firstChild;return K(a=>x=a,t),y(a=>{var d=c().value.embedUrl,v=_(),b=c().value.sandbox,V=c().value.allow;return d!==a.e&&m(s,"src",a.e=d),v!==a.t&&m(s,"title",a.t=v),b!==a.a&&m(s,"sandbox",a.a=b),V!==a.o&&m(s,"allow",a.o=V),a},{e:void 0,t:void 0,a:void 0,o:void 0}),t}})}})),u(S,l(ie,{size:14,class:"shrink-0 opacity-70","aria-hidden":"true"}),q),u(q,()=>r.data.title??z()),u(R,l(w,{get when(){return j()},get children(){var t=ve();return t.firstChild,t.$$click=()=>F(),u(t,z,null),u(t,l(re,{size:12,"aria-hidden":"true"}),null),t}}),null),y(t=>Q(p,"aspect-ratio",Z())),o})()}W(["click","keydown"]);export{xe as E};
@@ -1,141 +1 @@
1
- var Pn=Object.defineProperty,Fn=Object.getPrototypeOf,Un=Reflect.get,De=e=>{throw TypeError(e)},Bn=(e,n,t)=>n in e?Pn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ie=(e,n,t)=>Bn(e,typeof n!="symbol"?n+"":n,t),me=(e,n,t)=>n.has(e)||De("Cannot "+t),E=(e,n,t)=>(me(e,n,"read from private field"),t?t.call(e):n.get(e)),X=(e,n,t)=>n.has(e)?De("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),L=(e,n,t,r)=>(me(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Oe=(e,n,t)=>(me(e,n,"access private method"),t),Gn=(e,n,t)=>Un(Fn(e),t,n),be=class{constructor(e,n={}){ie(this,"patterns"),ie(this,"options"),ie(this,"regexps"),this.patterns=e,this.options=n;const{forgiving:t=!1,cache:r,regexConstructor:a}=n;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=r?.get(o);if(s){if(s instanceof RegExp)return s;if(t)return null;throw s}try{const i=a(o);return r?.set(o,i),i}catch(i){if(r?.set(o,i),t)return null;throw i}})}findNextMatchSync(e,n,t){const r=typeof e=="string"?e:e.content,a=[];function o(s,i,u=0){return{index:s,captureIndices:i.indices.map(c=>c==null?{start:4294967295,end:4294967295,length:0}:{start:c[0]+u,end:c[1]+u,length:c[1]-c[0]})}}for(let s=0;s<this.regexps.length;s++){const i=this.regexps[s];if(i)try{i.lastIndex=n;const u=i.exec(r);if(!u)continue;if(u.index===n)return o(s,u,0);a.push([s,u,0])}catch(u){if(this.options.forgiving)continue;throw u}}if(a.length){const s=Math.min(...a.map(i=>i[1].index));for(const[i,u,c]of a)if(u.index===s)return o(i,u,c)}return null}};function Z(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Dn(e,n,t){return e.has(n)||e.set(n,t),e.get(n)}const Ce=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),x=String.raw;function Q(e,n){if(e==null)throw new Error(n??"Value expected");return e}const Te=x`\[\^?`,We=`c.? | C(?:-.?)?|${x`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${x`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${x`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${x`o\{[^\}]*\}?`}|${x`\d{1,3}`}`,xe=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,ue=new RegExp(x`
2
- \\ (?:
3
- ${We}
4
- | [gk]<[^>]*>?
5
- | [gk]'[^']*'?
6
- | .
7
- )
8
- | \( (?:
9
- \? (?:
10
- [:=!>({]
11
- | <[=!]
12
- | <[^>]*>
13
- | '[^']*'
14
- | ~\|?
15
- | #(?:[^)\\]|\\.?)*
16
- | [^:)]*[:)]
17
- )?
18
- | \*[^\)]*\)?
19
- )?
20
- | (?:${xe.source})+
21
- | ${Te}
22
- | .
23
- `.replace(/\s+/g,""),"gsu"),ke=new RegExp(x`
24
- \\ (?:
25
- ${We}
26
- | .
27
- )
28
- | \[:(?:\^?\p{Alpha}+|\^):\]
29
- | ${Te}
30
- | &&
31
- | .
32
- `.replace(/\s+/g,""),"gsu");function On(e,n={}){const t={flags:"",...n,rules:{captureGroup:!1,singleline:!1,...n.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=at(t.flags),a=[r.extended],o={captureGroup:t.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(l){a.push(l)},replaceCurrentModX(l){a[a.length-1]=l},singleline:t.rules.singleline};let s=[],i;for(ue.lastIndex=0;i=ue.exec(e);){const l=Tn(o,e,i[0],ue.lastIndex);l.tokens?s.push(...l.tokens):l.token&&s.push(l.token),l.lastIndex!==void 0&&(ue.lastIndex=l.lastIndex)}const u=[];let c=0;s.filter(l=>l.type==="GroupOpen").forEach(l=>{l.kind==="capturing"?l.number=++c:l.raw==="("&&u.push(l)}),c||u.forEach((l,d)=>{l.kind="capturing",l.number=d+1});const p=c||u.length;return{tokens:s.map(l=>l.type==="EscapedNumber"?it(l,p):l).flat(),flags:r}}function Tn(e,n,t,r){const[a,o]=t;if(t==="["||t==="[^"){const s=Wn(n,t,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(o))return{token:Ve(t,t)};if(/^\\g[<']/.test(t)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(t))throw new Error(`Invalid group name "${t}"`);return{token:Kn(t)}}if(/^\\k[<']/.test(t)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(t))throw new Error(`Invalid group name "${t}"`);return{token:je(t)}}if(o==="K")return{token:Xe("keep",t)};if(o==="N"||o==="R")return{token:O("newline",t,{negate:o==="N"})};if(o==="O")return{token:O("any",t)};if(o==="X")return{token:O("text_segment",t)};const s=ze(t,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(a==="("){if(o==="*")return{token:tt(t)};if(t==="(?{")throw new Error(`Unsupported callout "${t}"`);if(t.startsWith("(?#")){if(n[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(t))return{token:nt(t,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,t==="("&&!e.captureGroup||t==="(?:")return{token:q("group",t)};if(t==="(?>")return{token:q("atomic",t)};if(t==="(?="||t==="(?!"||t==="(?<="||t==="(?<!")return{token:q(t[2]==="<"?"lookbehind":"lookahead",t,{negate:t.endsWith("!")})};if(t==="("&&e.captureGroup||t.startsWith("(?<")&&t.endsWith(">")||t.startsWith("(?'")&&t.endsWith("'"))return{token:q("capturing",t,{...t!=="("&&{name:t.slice(3,-1)}})};if(t.startsWith("(?~")){if(t==="(?~|")throw new Error(`Unsupported absence function kind "${t}"`);return{token:q("absence_repeater",t)}}throw t==="(?("?new Error(`Unsupported conditional "${t}"`):new Error(`Invalid or unsupported group option "${t}"`)}if(t===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Qn(t)}}if(e.getCurrentModX()){if(t==="#"){const s=n.indexOf(`
33
- `,r);return{lastIndex:s===-1?n.length:s}}if(/^\s$/.test(t)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(n)?s.lastIndex:r}}}if(t===".")return{token:O("dot",t)};if(t==="^"||t==="$"){const s=e.singleline?{"^":x`\A`,$:x`\Z`}[t]:t;return{token:Ve(s,t)}}return t==="|"?{token:Vn(t)}:xe.test(t)?{tokens:ut(t)}:{token:R(Z(t),t)}}function Wn(e,n,t){const r=[He(n[1]==="^",n)];let a=1,o;for(ke.lastIndex=t;o=ke.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")a++,r.push(He(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(R(93,s));else if(a--,r.push(jn(s)),!a)break}else{const i=zn(s);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:ke.lastIndex||e.length}}function zn(e){if(e[0]==="\\")return ze(e,{inCharClass:!0});if(e[0]==="["){const n=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!n||!Ce.has(n.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return O("posix",e,{value:n.groups.name,negate:!!n.groups.negate})}return e==="-"?Hn(e):e==="&&"?Xn(e):R(Z(e),e)}function ze(e,{inCharClass:n}){const t=e[1];if(t==="c"||t==="C")return et(e);if("dDhHsSwW".includes(t))return rt(e);if(e.startsWith(x`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return ot(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...a].map(s=>{const i=[...o.encode(s)].map(u=>`\\x${u.toString(16)}`).join("");return R(Z(s),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(t==="u"||t==="x")return R(st(e),e);if(Ze.has(t))return R(Ze.get(t),e);if(/\d/.test(t))return Zn(n,e);if(e==="\\")throw new Error(x`Incomplete escape "\"`);if(t==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return R(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Vn(e){return{type:"Alternator",raw:e}}function Ve(e,n){return{type:"Assertion",kind:e,raw:n}}function je(e){return{type:"Backreference",raw:e}}function R(e,n){return{type:"Character",value:e,raw:n}}function jn(e){return{type:"CharacterClassClose",raw:e}}function Hn(e){return{type:"CharacterClassHyphen",raw:e}}function Xn(e){return{type:"CharacterClassIntersector",raw:e}}function He(e,n){return{type:"CharacterClassOpen",negate:e,raw:n}}function O(e,n,t={}){return{type:"CharacterSet",kind:e,...t,raw:n}}function Xe(e,n,t={}){return e==="keep"?{type:"Directive",kind:e,raw:n}:{type:"Directive",kind:e,flags:Q(t.flags),raw:n}}function Zn(e,n){return{type:"EscapedNumber",inCharClass:e,raw:n}}function Qn(e){return{type:"GroupClose",raw:e}}function q(e,n,t={}){return{type:"GroupOpen",kind:e,...t,raw:n}}function qn(e,n,t,r){return{type:"NamedCallout",kind:e,tag:n,arguments:t,raw:r}}function Jn(e,n,t,r){return{type:"Quantifier",kind:e,min:n,max:t,raw:r}}function Kn(e){return{type:"Subroutine",raw:e}}const Yn=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Ze=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function et(e){const n=e[1]==="c"?e[2]:e[3];if(!n||!/[A-Za-z]/.test(n))throw new Error(`Unsupported control character "${e}"`);return R(Z(n.toUpperCase())-64,e)}function nt(e,n){let{on:t,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const a=(n.getCurrentModX()||t.includes("x"))&&!r.includes("x"),o=qe(t),s=qe(r),i={};if(o&&(i.enable=o),s&&(i.disable=s),e.endsWith(")"))return n.replaceCurrentModX(a),Xe("flags",e,{flags:i});if(e.endsWith(":"))return n.pushModX(a),n.numOpenGroups++,q("group",e,{...(o||s)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function tt(e){const n=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!n)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:t,tag:r,args:a}=n.groups;if(!t)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=a?a.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[s,i,u]=o,c=Yn.has(t)?t.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof i=="number"||!/^(?:[<>!=]=|[<>])$/.test(i))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument three must be a tag or number "${u}"`);break;case"custom":throw new Error(`Undefined callout name "${t}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return qn(c,r??null,a?.split(",")??null,e)}function Qe(e){let n=null,t,r;if(e[0]==="{"){const{minStr:a,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+a>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(t=+a,r=o===void 0?+a:o===""?1/0:+o,t>r&&(n="possessive",[t,r]=[r,t]),e.endsWith("?")){if(n==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');n="lazy"}else n||(n="greedy")}else t=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,n=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Jn(n,t,r,e)}function rt(e){const n=e[1].toLowerCase();return O({d:"digit",h:"hex",s:"space",w:"word"}[n],e,{negate:e[1]!==n})}function ot(e){const{p:n,neg:t,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return O("property",e,{value:r,negate:n==="P"&&!t||n==="p"&&!!t})}function qe(e){const n={};return e.includes("i")&&(n.ignoreCase=!0),e.includes("m")&&(n.dotAll=!0),e.includes("x")&&(n.extended=!0),Object.keys(n).length?n:null}function at(e){const n={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let t=0;t<e.length;t++){const r=e[t];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(t)))throw new Error('Invalid or unspecified flag "y" mode');n.textSegmentMode=e[t+2]==="g"?"grapheme":"word",t+=3;continue}n[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return n}function st(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const n=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(n,16)}function it(e,n){const{raw:t,inCharClass:r}=e,a=t.slice(1);if(!r&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=n))return[je(t)];const o=[],s=a.match(/^[0-7]+|\d/g);for(let i=0;i<s.length;i++){const u=s[i];let c;if(i===0&&u!=="8"&&u!=="9"){if(c=parseInt(u,8),c>127)throw new Error(x`Octal encoded byte above 177 unsupported "${t}"`)}else c=Z(u);o.push(R(c,(i===0?"\\":"")+u))}return o}function ut(e){const n=[],t=new RegExp(xe,"gy");let r;for(;r=t.exec(e);){const a=r[0];if(a[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(o){const{min:s,max:i}=o.groups;if(+s>+i&&a.endsWith("?")){t.lastIndex--,n.push(Qe(a.slice(0,-1)));continue}}}n.push(Qe(a))}return n}function Je(e,n){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const t=e.body[0];return!n||Object.keys(n).every(r=>n[r]===t[r])}function ct(e){return lt.has(e.type)}const lt=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Ke(e,n={}){const t={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...n,rules:{captureGroup:!1,singleline:!1,...n.rules}},r=On(e,{flags:t.flags,rules:{captureGroup:t.rules.captureGroup,singleline:t.rules.singleline}}),a=(d,g)=>{const f=r.tokens[o.nextIndex];switch(o.parent=d,o.nextIndex++,f.type){case"Alternator":return T();case"Assertion":return pt(f);case"Backreference":return dt(f,o);case"Character":return ce(f.value,{useLastValid:!!g.isCheckingRangeEnd});case"CharacterClassHyphen":return ft(f,o,g);case"CharacterClassOpen":return gt(f,o,g);case"CharacterSet":return ht(f,o);case"Directive":return xt(f.kind,{flags:f.flags});case"GroupOpen":return wt(f,o,g);case"NamedCallout":return Et(f.kind,f.tag,f.arguments);case"Quantifier":return yt(f,o);case"Subroutine":return mt(f,o);default:throw new Error(`Unexpected token type "${f.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:t.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:t.skipBackrefValidation,skipLookbehindValidation:t.skipLookbehindValidation,skipPropertyNameValidation:t.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:t.unicodePropertyMap,walk:a},s=vt(kt(r.flags));let i=s.body[0];for(;o.nextIndex<r.tokens.length;){const d=a(i,{});d.type==="Alternative"?(s.body.push(d),i=d):i.body.push(d)}const{capturingGroups:u,hasNumberedRef:c,namedGroupsByName:p,subroutines:l}=o;if(c&&p.size&&!t.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of l)if(typeof d=="number"){if(d>u.length)throw new Error("Subroutine uses a group number that's not defined");d&&(u[d-1].isSubroutined=!0)}else if(p.has(d)){if(p.get(d).length>1)throw new Error(x`Subroutine uses a duplicate group name "\g<${d}>"`);p.get(d)[0].isSubroutined=!0}else throw new Error(x`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function pt({kind:e}){return Ee(Q({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===x`\B`||e===x`\Y`})}function dt({raw:e},n){const t=/^\\k[<']/.test(e),r=t?e.slice(3,-1):e.slice(1),a=(o,s=!1)=>{const i=n.capturingGroups.length;let u=!1;if(o>i)if(n.skipBackrefValidation)u=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return n.hasNumberedRef=!0,$e(s?i+1-o:o,{orphan:u})};if(t){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(o)return a(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!n.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return $e(r)}return a(+r)}function ft(e,n,t){const{tokens:r,walk:a}=n,o=n.parent,s=o.body.at(-1),i=r[n.nextIndex];if(!t.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&i&&i.type!=="CharacterClassOpen"&&i.type!=="CharacterClassClose"&&i.type!=="CharacterClassIntersector"){const u=a(o,{...t,isCheckingRangeEnd:!0});if(s.type==="Character"&&u.type==="Character")return o.body.pop(),Ct(s,u);throw new Error("Invalid character class range")}return ce(Z("-"))}function gt({negate:e},n,t){const{tokens:r,walk:a}=n,o=[le()],s=r[n.nextIndex];let i=an(s);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")o.push(le()),n.nextIndex++;else{const c=o.at(-1);c.body.push(a(c,t))}i=an(r[n.nextIndex],s)}const u=le({negate:e});return o.length===1?u.body=o[0].body:(u.kind="intersection",u.body=o.map(c=>c.body.length===1?c.body[0]:c)),n.nextIndex++,u}function ht({kind:e,negate:n,value:t},r){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:o,unicodePropertyMap:s}=r;if(e==="property"){const i=pe(t);if(Ce.has(i)&&!(s!=null&&s.has(i)))e="posix",t=i;else return J(t,{negate:n,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?$t(t,{negate:n}):ve(e,{negate:n})}function wt(e,n,t){const{tokens:r,capturingGroups:a,namedGroupsByName:o,skipLookbehindValidation:s,walk:i}=n,u=At(e),c=u.type==="AbsenceFunction",p=on(u),l=p&&u.negate;if(u.type==="CapturingGroup"&&(a.push(u),u.name&&Dn(o,u.name,[]).push(u)),c&&t.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=sn(r[n.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")u.body.push(T()),n.nextIndex++;else{const g=u.body.at(-1),f=i(g,{...t,isInAbsenceFunction:t.isInAbsenceFunction||c,isInLookbehind:t.isInLookbehind||p,isInNegLookbehind:t.isInNegLookbehind||l});if(g.body.push(f),(p||t.isInLookbehind)&&!s){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(l||t.isInNegLookbehind){if(rn(f)||f.type==="CapturingGroup")throw new Error(w)}else if(rn(f)||on(f)&&f.negate)throw new Error(w)}}d=sn(r[n.nextIndex])}return n.nextIndex++,u}function yt({kind:e,min:n,max:t},r){const a=r.parent,o=a.body.at(-1);if(!o||!ct(o))throw new Error("Quantifier requires a repeatable token");const s=en(e,n,t,o);return a.body.pop(),s}function mt({raw:e},n){const{capturingGroups:t,subroutines:r}=n;let a=e.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(o){const i=+o.groups.num,u=t.length;if(n.hasNumberedRef=!0,a={"":i,"+":u+i,"-":u+1-i}[o.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const s=nn(a);return r.push(s),s}function bt(e,n){if(e!=="repeater")throw new Error(`Unexpected absence function kind "${e}"`);return{type:"AbsenceFunction",kind:e,body:re(n?.body)}}function T(e){return{type:"Alternative",body:tn(e?.body)}}function Ee(e,n){const t={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(t.negate=!!(n!=null&&n.negate)),t}function $e(e,n){const t=!!(n!=null&&n.orphan);return{type:"Backreference",ref:e,...t&&{orphan:t}}}function Ye(e,n){const t={name:void 0,isSubroutined:!1,...n};if(t.name!==void 0&&!It(t.name))throw new Error(`Group name "${t.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...t.name&&{name:t.name},...t.isSubroutined&&{isSubroutined:t.isSubroutined},body:re(n?.body)}}function ce(e,n){const t={useLastValid:!1,...n};if(e>1114111){const r=e.toString(16);if(t.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function le(e){const n={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:n.kind,negate:n.negate,body:tn(e?.body)}}function Ct(e,n){if(n.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:n}}function ve(e,n){const t=!!(n!=null&&n.negate),r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=t),(e==="text_segment"||e==="newline"&&!t)&&(r.variableLength=!0),r}function xt(e,n={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Q(n.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function kt(e){return{type:"Flags",...e}}function _(e){const n=e?.atomic,t=e?.flags;if(n&&t)throw new Error("Atomic group cannot have flags");return{type:"Group",...n&&{atomic:n},...t&&{flags:t},body:re(e?.body)}}function W(e){const n={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:n.behind?"lookbehind":"lookahead",negate:n.negate,body:re(e?.body)}}function Et(e,n,t){return{type:"NamedCallout",kind:e,tag:n,arguments:t}}function $t(e,n){const t=!!(n!=null&&n.negate);if(!Ce.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:t}}function en(e,n,t,r){if(n>t)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:n,max:t,body:r}}function vt(e,n){return{type:"Regex",body:re(n?.body),flags:e}}function nn(e){return{type:"Subroutine",ref:e}}function J(e,n){var t;const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...n};let a=(t=r.unicodePropertyMap)==null?void 0:t.get(pe(e));if(!a){if(r.normalizeUnknownPropertyNames)a=St(e);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(x`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:a??e,negate:r.negate}}function At({flags:e,kind:n,name:t,negate:r,number:a}){switch(n){case"absence_repeater":return bt("repeater");case"atomic":return _({atomic:!0});case"capturing":return Ye(a,{name:t});case"group":return _({flags:e});case"lookahead":case"lookbehind":return W({behind:n==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${n}"`)}}function re(e){if(e===void 0)e=[T()];else if(!Array.isArray(e)||!e.length||!e.every(n=>n.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function tn(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(n=>!!n.type))throw new Error("Invalid body; expected array of nodes");return e}function rn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function on(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function It(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function St(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function pe(e){return e.replace(/[- _]+/g,"").toLowerCase()}function an(e,n){const t=n;return Q(e,`Unclosed character class${t?.type==="Character"&&t.value===93&&t.raw==="]"?' (started with "]")':""}`)}function sn(e){return Q(e,"Unclosed group")}function oe(e,n,t=null){function r(o,s){for(let i=0;i<o.length;i++){const u=a(o[i],s,i,o);i=Math.max(-1,i+u)}}function a(o,s=null,i=null,u=null){var c,p;let l=0,d=!1;const g={node:o,parent:s,key:i,container:u,root:e,remove(){de(u).splice(Math.max(0,K(i)+l),1),l--,d=!0},removeAllNextSiblings(){return de(u).splice(K(i)+1)},removeAllPrevSiblings(){const m=K(i)+l;return l-=m,de(u).splice(0,Math.max(0,m))},replaceWith(m,k={}){const I=!!k.traverse;u?u[Math.max(0,K(i)+l)]=m:Q(s,"Can't replace root node")[i]=m,I&&a(m,s,i,u),d=!0},replaceWithMultiple(m,k={}){const I=!!k.traverse;if(de(u).splice(Math.max(0,K(i)+l),1,...m),l+=m.length-1,I){let D=0;for(let S=0;S<m.length;S++)D+=a(m[S],s,K(i)+S+D,u)}d=!0},skip(){d=!0}},{type:f}=o,w=n["*"],y=n[f],N=typeof w=="function"?w:w?.enter,$=typeof y=="function"?y:y?.enter;if(N?.(g,t),$?.(g,t),!d)switch(f){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(o.min,o,"min"),a(o.max,o,"max");break;case"Quantifier":a(o.body,o,"body");break;case"Regex":r(o.body,o),a(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return(c=y?.exit)==null||c.call(y,g,t),(p=w?.exit)==null||p.call(w,g,t),l}return a(e),e}function de(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function K(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const _t=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Mt(e,n){for(let t=0;t<e.length;t++)e[t]>=n&&e[t]++}function Nt(e,n,t,r){return e.slice(0,n)+r+e.slice(n+t.length)}const v=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Ae(e,n,t,r){const a=new RegExp(String.raw`${n}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,i="";for(const u of e.matchAll(a)){const{0:c,groups:{$skip:p}}=u;if(!p&&(!r||r===v.DEFAULT==!s)){t instanceof Function?i+=t(u,{context:s?v.CHAR_CLASS:v.DEFAULT,negated:o[o.length-1]}):i+=t;continue}c[0]==="["?(s++,o.push(c[1]==="^")):c==="]"&&s&&(s--,o.pop()),i+=c}return i}function un(e,n,t,r){Ae(e,n,t,r)}function Lt(e,n,t=0,r){if(!new RegExp(n,"su").test(e))return null;const a=new RegExp(`${n}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=t;let o=0,s;for(;s=a.exec(e);){const{0:i,groups:{$skip:u}}=s;if(!u&&(!r||r===v.DEFAULT==!o))return s;i==="["?o++:i==="]"&&o&&o--,a.lastIndex==s.index&&a.lastIndex++}return null}function fe(e,n,t){return!!Lt(e,n,0,t)}function Rt(e,n){const t=/\\?./gsu;t.lastIndex=n;let r=e.length,a=0,o=1,s;for(;s=t.exec(e);){const[i]=s;if(i==="[")a++;else if(a)i==="]"&&a--;else if(i==="(")o++;else if(i===")"&&(o--,!o)){r=s.index;break}}return e.slice(n,r)}const cn=new RegExp(String.raw`(?<noncapturingStart>${_t})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Pt(e,n){const t=n?.hiddenCaptures??[];let r=n?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:t};const a="(?>",o="(?:(?=(",s=[0],i=[];let u=0,c=0,p=NaN,l;do{l=!1;let d=0,g=0,f=!1,w;for(cn.lastIndex=Number.isNaN(p)?0:p+o.length;w=cn.exec(e);){const{0:y,index:N,groups:{capturingStart:$,noncapturingStart:m}}=w;if(y==="[")d++;else if(d)y==="]"&&d--;else if(y===a&&!f)p=N,f=!0;else if(f&&m)g++;else if($)f?g++:(u++,s.push(u+c));else if(y===")"&&f){if(!g){c++;const k=u+c;if(e=`${e.slice(0,p)}${o}${e.slice(p+a.length,N)}))<$$${k}>)${e.slice(N+1)}`,l=!0,i.push(k),Mt(t,k),r.size){const I=new Map;r.forEach((D,S)=>{I.set(S>=k?S+1:S,D.map(H=>H>=k?H+1:H))}),r=I}break}g--}}}while(l);return t.push(...i),e=Ae(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:g,wrappedBackrefNum:f}})=>{if(g){const w=+g;if(w>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[w]}`}return`\\${f}`},v.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:t}}const ln=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Ie=new RegExp(String.raw`
34
- \\(?: \d+
35
- | c[A-Za-z]
36
- | [gk]<[^>]+>
37
- | [pPu]\{[^\}]+\}
38
- | u[A-Fa-f\d]{4}
39
- | x[A-Fa-f\d]{2}
40
- )
41
- | \((?: \? (?: [:=!>]
42
- | <(?:[=!]|[^>]+>)
43
- | [A-Za-z\-]+:
44
- | \(DEFINE\)
45
- ))?
46
- | (?<qBase>${ln})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
47
- | \\?.
48
- `.replace(/\s+/g,""),"gsu");function Ft(e){if(!new RegExp(`${ln}\\+`).test(e))return{pattern:e};const n=[];let t=null,r=null,a="",o=0,s;for(Ie.lastIndex=0;s=Ie.exec(e);){const{0:i,index:u,groups:{qBase:c,qMod:p,invalidQ:l}}=s;if(i==="[")o||(r=u),o++;else if(i==="]")o?o--:r=null;else if(!o)if(p==="+"&&a&&!a.startsWith("(")){if(l)throw new Error(`Invalid quantifier "${i}"`);let d=-1;if(/^\{\d+\}$/.test(c))e=Nt(e,u+c.length,p,"");else{if(a===")"||a==="]"){const g=a===")"?t:r;if(g===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,g)}(?>${e.slice(g,u)}${c})${e.slice(u+i.length)}`}else e=`${e.slice(0,u-a.length)}(?>${a}${c})${e.slice(u+i.length)}`;d+=4}Ie.lastIndex+=d}else i[0]==="("?n.push(u):i===")"&&(t=n.length?n.pop():null);a=i}return{pattern:e}}const A=String.raw,Ut=A`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Se=A`\(\?R=(?<rDepth>[^\)]+)\)|${Ut}`,ge=A`\(\?<(?![=!])(?<captureName>[^>]+)>`,pn=A`${ge}|(?<unnamed>\()(?!\?)`,z=new RegExp(A`${ge}|${Se}|\(\?|\\?.`,"gsu"),_e="Cannot use multiple overlapping recursions";function Bt(e,n){const{hiddenCaptures:t,mode:r}={hiddenCaptures:[],mode:"plugin",...n};let a=n?.captureTransfers??new Map;if(!new RegExp(Se,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:t};if(r==="plugin"&&fe(e,A`\(\?\(DEFINE\)`,v.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=fe(e,A`\\[1-9]`,v.DEFAULT),i=new Map,u=[];let c=!1,p=0,l=0,d;for(z.lastIndex=0;d=z.exec(e);){const{0:g,groups:{captureName:f,rDepth:w,gRNameOrNum:y,gRDepth:N}}=d;if(g==="[")p++;else if(p)g==="]"&&p--;else if(w){if(dn(w),c)throw new Error(_e);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const $=e.slice(0,d.index),m=e.slice(z.lastIndex);if(fe(m,Se,v.DEFAULT))throw new Error(_e);const k=+w-1;e=fn($,m,k,!1,t,o,l),a=hn(a,$,k,o.length,0,l);break}else if(y){dn(N);let $=!1;for(const te of u)if(te.name===y||te.num===+y){if($=!0,te.hasRecursedWithin)throw new Error(_e);break}if(!$)throw new Error(A`Recursive \g cannot be used outside the referenced group "${r==="external"?y:A`\g<${y}&R=${N}>`}"`);const m=i.get(y),k=Rt(e,m);if(s&&fe(k,A`${ge}|\((?!\?)`,v.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const I=e.slice(m,d.index),D=k.slice(I.length+g.length),S=o.length,H=+N-1,Ge=fn(I,D,H,!0,t,o,l);a=hn(a,I,H,o.length-S,S,l);const Ln=e.slice(0,m),Rn=e.slice(m+k.length);e=`${Ln}${Ge}${Rn}`,z.lastIndex+=Ge.length-g.length-I.length-D.length,u.forEach(te=>te.hasRecursedWithin=!0),c=!0}else if(f)l++,i.set(String(l),z.lastIndex),i.set(f,z.lastIndex),u.push({num:l,name:f});else if(g[0]==="("){const $=g==="(";$&&(l++,i.set(String(l),z.lastIndex)),u.push($?{num:l}:{})}else g===")"&&u.pop()}return t.push(...o),{pattern:e,captureTransfers:a,hiddenCaptures:t}}function dn(e){const n=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(n);if(e=+e,e<2||e>100)throw new Error(n)}function fn(e,n,t,r,a,o,s){const i=new Set;r&&un(e+n,ge,({groups:{captureName:c}})=>{i.add(c)},v.DEFAULT);const u=[t,r?i:null,a,o,s];return`${e}${gn(`(?:${e}`,"forward",...u)}(?:)${gn(`${n})`,"backward",...u)}${n}`}function gn(e,n,t,r,a,o,s){const i=c=>n==="forward"?c+2:t-c+2-1;let u="";for(let c=0;c<t;c++){const p=i(c);u+=Ae(e,A`${pn}|\\k<(?<backref>[^>]+)>`,({0:l,groups:{captureName:d,unnamed:g,backref:f}})=>{if(f&&r&&!r.has(f))return l;const w=`_$${p}`;if(g||d){const y=s+o.length+1;return o.push(y),Gt(a,y),g?l:`(?<${d}${w}>`}return A`\k<${f}${w}>`},v.DEFAULT)}return u}function Gt(e,n){for(let t=0;t<e.length;t++)e[t]>=n&&e[t]++}function hn(e,n,t,r,a,o){if(e.size&&r){let s=0;un(n,pn,()=>s++,v.DEFAULT);const i=o-s+a,u=new Map;return e.forEach((c,p)=>{const l=(r-s*t)/t,d=s*t,g=p>i+s?p+r:p,f=[];for(const w of c)if(w<=i)f.push(w);else if(w>i+s+l)f.push(w+r);else if(w<=i+s)for(let y=0;y<=t;y++)f.push(w+s*y);else for(let y=0;y<=t;y++)f.push(w+d+l*y);u.set(g,f)}),u}return e}var C=String.fromCodePoint,h=String.raw,M={},he=globalThis.RegExp;M.flagGroups=(()=>{try{new he("(?i:)")}catch{return!1}return!0})(),M.unicodeSets=(()=>{try{new he("[[]]","v")}catch{return!1}return!0})(),M.bugFlagVLiteralHyphenIsRange=M.unicodeSets?(()=>{try{new he(h`[\d\-a]`,"v")}catch{return!0}return!1})():!1,M.bugNestedClassIgnoresNegation=M.unicodeSets&&new he("[[^a]]","v").test("a");function we(e,{enable:n,disable:t}){return{dotAll:!(t!=null&&t.dotAll)&&!!(n!=null&&n.dotAll||e.dotAll),ignoreCase:!(t!=null&&t.ignoreCase)&&!!(n!=null&&n.ignoreCase||e.ignoreCase)}}function ae(e,n,t){return e.has(n)||e.set(n,t),e.get(n)}function Me(e,n){return wn[e]>=wn[n]}function Dt(e,n){if(e==null)throw new Error(n??"Value expected");return e}var wn={ES2025:2025,ES2024:2024,ES2018:2018},Ot={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function yn(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Ot[e.target])throw new Error(`Unexpected target "${e.target}"`);const n={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return n.target==="auto"&&(n.target=M.flagGroups?"ES2025":M.unicodeSets?"ES2024":"ES2018"),n}var Tt="[ -\r ]",Wt=new Set([C(304),C(305)]),P=h`[\p{L}\p{M}\p{N}\p{Pc}]`;function mn(e){if(Wt.has(e))return[e];const n=new Set,t=e.toLowerCase(),r=t.toUpperCase(),a=jt.get(t),o=zt.get(t),s=Vt.get(t);return[...r].length===1&&n.add(r),s&&n.add(s),a&&n.add(a),n.add(t),o&&n.add(o),[...n]}var Ne=new Map(`C Other
49
- Cc Control cntrl
50
- Cf Format
51
- Cn Unassigned
52
- Co Private_Use
53
- Cs Surrogate
54
- L Letter
55
- LC Cased_Letter
56
- Ll Lowercase_Letter
57
- Lm Modifier_Letter
58
- Lo Other_Letter
59
- Lt Titlecase_Letter
60
- Lu Uppercase_Letter
61
- M Mark Combining_Mark
62
- Mc Spacing_Mark
63
- Me Enclosing_Mark
64
- Mn Nonspacing_Mark
65
- N Number
66
- Nd Decimal_Number digit
67
- Nl Letter_Number
68
- No Other_Number
69
- P Punctuation punct
70
- Pc Connector_Punctuation
71
- Pd Dash_Punctuation
72
- Pe Close_Punctuation
73
- Pf Final_Punctuation
74
- Pi Initial_Punctuation
75
- Po Other_Punctuation
76
- Ps Open_Punctuation
77
- S Symbol
78
- Sc Currency_Symbol
79
- Sk Modifier_Symbol
80
- Sm Math_Symbol
81
- So Other_Symbol
82
- Z Separator
83
- Zl Line_Separator
84
- Zp Paragraph_Separator
85
- Zs Space_Separator
86
- ASCII
87
- ASCII_Hex_Digit AHex
88
- Alphabetic Alpha
89
- Any
90
- Assigned
91
- Bidi_Control Bidi_C
92
- Bidi_Mirrored Bidi_M
93
- Case_Ignorable CI
94
- Cased
95
- Changes_When_Casefolded CWCF
96
- Changes_When_Casemapped CWCM
97
- Changes_When_Lowercased CWL
98
- Changes_When_NFKC_Casefolded CWKCF
99
- Changes_When_Titlecased CWT
100
- Changes_When_Uppercased CWU
101
- Dash
102
- Default_Ignorable_Code_Point DI
103
- Deprecated Dep
104
- Diacritic Dia
105
- Emoji
106
- Emoji_Component EComp
107
- Emoji_Modifier EMod
108
- Emoji_Modifier_Base EBase
109
- Emoji_Presentation EPres
110
- Extended_Pictographic ExtPict
111
- Extender Ext
112
- Grapheme_Base Gr_Base
113
- Grapheme_Extend Gr_Ext
114
- Hex_Digit Hex
115
- IDS_Binary_Operator IDSB
116
- IDS_Trinary_Operator IDST
117
- ID_Continue IDC
118
- ID_Start IDS
119
- Ideographic Ideo
120
- Join_Control Join_C
121
- Logical_Order_Exception LOE
122
- Lowercase Lower
123
- Math
124
- Noncharacter_Code_Point NChar
125
- Pattern_Syntax Pat_Syn
126
- Pattern_White_Space Pat_WS
127
- Quotation_Mark QMark
128
- Radical
129
- Regional_Indicator RI
130
- Sentence_Terminal STerm
131
- Soft_Dotted SD
132
- Terminal_Punctuation Term
133
- Unified_Ideograph UIdeo
134
- Uppercase Upper
135
- Variation_Selector VS
136
- White_Space space
137
- XID_Continue XIDC
138
- XID_Start XIDS`.split(/\s/).map(e=>[pe(e),e])),zt=new Map([["s",C(383)],[C(383),"s"]]),Vt=new Map([[C(223),C(7838)],[C(107),C(8490)],[C(229),C(8491)],[C(969),C(8486)]]),jt=new Map([U(453),U(456),U(459),U(498),...Le(8072,8079),...Le(8088,8095),...Le(8104,8111),U(8124),U(8140),U(8188)]),Ht=new Map([["alnum",h`[\p{Alpha}\p{Nd}]`],["alpha",h`\p{Alpha}`],["ascii",h`\p{ASCII}`],["blank",h`[\p{Zs}\t]`],["cntrl",h`\p{Cc}`],["digit",h`\p{Nd}`],["graph",h`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",h`\p{Lower}`],["print",h`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",h`[\p{P}\p{S}]`],["space",h`\p{space}`],["upper",h`\p{Upper}`],["word",h`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",h`\p{AHex}`]]);function Xt(e,n){const t=[];for(let r=e;r<=n;r++)t.push(r);return t}function U(e){const n=C(e);return[n.toLowerCase(),n]}function Le(e,n){return Xt(e,n).map(t=>U(t))}var bn=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Zt(e,n){const t={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...n};Cn(e);const r={accuracy:t.accuracy,asciiWordBoundaries:t.asciiWordBoundaries,avoidSubclass:t.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Me(t.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};oe(e,Qt,r);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};oe(e,qt,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return oe(e,Jt,s),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var Qt={AbsenceFunction({node:e,parent:n,replaceWith:t}){const{body:r,kind:a}=e;if(a==="repeater"){const o=_();o.body[0].body.push(W({negate:!0,body:r}),J("Any"));const s=_();s.body[0].body.push(en("greedy",0,1/0,o)),t(b(s,n),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:n,key:t},{flagDirectivesByAlt:r}){const a=e.body.filter(o=>o.kind==="flags");for(let o=t+1;o<n.body.length;o++){const s=n.body[o];ae(r,s,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:n}){var t;if((t=n.get(e))!=null&&t.length){const r=En(n.get(e));if(r){const a=_({flags:r});a.body[0].body=e.body,e.body=[b(a,e)]}}}},Assertion({node:e,parent:n,key:t,container:r,root:a,remove:o,replaceWith:s},i){const{kind:u,negate:c}=e,{asciiWordBoundaries:p,avoidSubclass:l,supportedGNodes:d,wordIsAscii:g}=i;if(u==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(u==="line_end")s(b(W({body:[T({body:[Ee("string_end")]}),T({body:[ce(10)]})]}),n));else if(u==="line_start")s(b(F(h`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),n));else if(u==="search_start")if(d.has(e))a.flags.sticky=!0,o();else{const f=r[t-1];if(f&&rr(f))s(b(W({negate:!0}),n));else{if(l)throw new Error(h`Uses "\G" in a way that requires a subclass`);s(B(Ee("string_start"),n)),i.strategy="clip_search"}}else if(!(u==="string_end"||u==="string_start"))if(u==="string_end_newline")s(b(F(h`(?=\n?\z)`),n));else if(u==="word_boundary"){if(!g&&!p){const f=`(?:(?<=${P})(?!${P})|(?<!${P})(?=${P}))`,w=`(?:(?<=${P})(?=${P})|(?<!${P})(?!${P}))`;s(b(F(c?w:f),n))}}else throw new Error(`Unexpected assertion kind "${u}"`)},Backreference({node:e},{jsGroupNameMap:n}){let{ref:t}=e;typeof t=="string"&&!Pe(t)&&(t=Re(t,n),e.ref=t)},CapturingGroup({node:e},{jsGroupNameMap:n,subroutineRefMap:t}){let{name:r}=e;r&&!Pe(r)&&(r=Re(r,n),e.name=r),t.set(e.number,e),r&&t.set(r,e)},CharacterClassRange({node:e,parent:n,replaceWith:t}){if(n.kind==="intersection"){const r=le({body:[e]});t(b(r,n),{traverse:!0})}},CharacterSet({node:e,parent:n,replaceWith:t},{accuracy:r,minTargetEs2024:a,digitIsAscii:o,spaceIsAscii:s,wordIsAscii:i}){const{kind:u,negate:c,value:p}=e;if(o&&(u==="digit"||p==="digit")){t(B(ve("digit",{negate:c}),n));return}if(s&&(u==="space"||p==="space")){t(b(Fe(F(Tt),c),n));return}if(i&&(u==="word"||p==="word")){t(B(ve("word",{negate:c}),n));return}if(u==="any")t(B(J("Any"),n));else if(u==="digit")t(B(J("Nd",{negate:c}),n));else if(u!=="dot")if(u==="text_segment"){if(r==="strict")throw new Error(h`Use of "\X" requires non-strict accuracy`);const l="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=h`\p{RI}{2}|${l}(?:\u200D${l})*`;t(b(F(h`(?>\r\n|${a?h`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),n))}else if(u==="hex")t(B(J("AHex",{negate:c}),n));else if(u==="newline")t(b(F(c?`[^
139
- ]`:`(?>\r
140
- ?|[
141
- \v\f\x85\u2028\u2029])`),n));else if(u==="posix")if(!a&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let l={graph:"!-~",print:" -~"}[p];c&&(l=`\0-${C(l.codePointAt(0)-1)}${C(l.codePointAt(2)+1)}-\u{10FFFF}`),t(b(F(`[${l}]`),n))}else t(b(Fe(F(Ht.get(p)),c),n));else if(u==="property")Ne.has(pe(p))||(e.key="sc");else if(u==="space")t(B(J("space",{negate:c}),n));else if(u==="word")t(b(Fe(F(P),c),n));else throw new Error(`Unexpected character set kind "${u}"`)},Directive({node:e,parent:n,root:t,remove:r,replaceWith:a,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:i,flags:u}=e;if(i==="flags")if(!u.enable&&!u.disable)r();else{const c=_({flags:u});c.body[0].body=s(),a(b(c,n),{traverse:!0})}else if(i==="keep"){const c=t.body[0],p=t.body.length===1&&Je(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:t;if(n.parent!==p||p.body.length>1)throw new Error(h`Uses "\K" in a way that's unsupported`);const l=W({behind:!0});l.body[0].body=o(),a(b(l,n))}else throw new Error(`Unexpected directive kind "${i}"`)},Flags({node:e,parent:n}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),n.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:n,disable:t}=e.flags;n!=null&&n.extended&&delete n.extended,t!=null&&t.extended&&delete t.extended,n!=null&&n.dotAll&&t!=null&&t.dotAll&&delete n.dotAll,n!=null&&n.ignoreCase&&t!=null&&t.ignoreCase&&delete n.ignoreCase,n&&!Object.keys(n).length&&delete e.flags.enable,t&&!Object.keys(t).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},n){const{kind:t}=e;t==="lookbehind"&&(n.passedLookbehind=!0)},NamedCallout({node:e,parent:n,replaceWith:t}){const{kind:r}=e;if(r==="fail")t(b(W({negate:!0}),n));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const n=_();n.body[0].body.push(e.body),e.body=b(n,e)}},Regex:{enter({node:e},{supportedGNodes:n}){const t=[];let r=!1,a=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=vn(o.body);s?(r=!0,Array.isArray(s)?t.push(...s):t.push(s)):a=!0}r&&!a&&t.forEach(o=>n.add(o))},exit(e,{accuracy:n,passedLookbehind:t,strategy:r}){if(n==="strict"&&t&&r)throw new Error(h`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:n}){let{ref:t}=e;typeof t=="string"&&!Pe(t)&&(t=Re(t,n),e.ref=t)}},qt={Backreference({node:e},{multiplexCapturesToLeftByRef:n,reffedNodesByReferencer:t}){const{orphan:r,ref:a}=e;r||t.set(e,[...n.get(a).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:n,replaceWith:t,skip:r},{groupOriginByCopy:a,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:i,reffedNodesByReferencer:u}){const c=a.get(e);if(c&&i.has(e.number)){const l=B(kn(e.number),n);u.set(l,i.get(e.number)),t(l);return}i.set(e.number,e),s.set(e.number,[]),e.name&&ae(s,e.name,[]);const p=s.get(e.name??e.number);for(let l=0;l<p.length;l++){const d=p[l];if(c===d.node||c&&c===d.origin||e===d.origin){p.splice(l,1);break}}if(s.get(e.number).push({node:e,origin:c}),e.name&&s.get(e.name).push({node:e,origin:c}),e.name){const l=ae(o,e.name,new Map);let d=!1;if(c)d=!0;else for(const g of l.values())if(!g.hasDuplicateNameToRemove){d=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:d})}},exit({node:e},{openRefs:n}){n.get(e.number)===e&&n.delete(e.number)}},Group:{enter({node:e},n){n.prevFlags=n.currentFlags,e.flags&&(n.currentFlags=we(n.currentFlags,e.flags))},exit(e,n){n.currentFlags=n.prevFlags}},Subroutine({node:e,parent:n,replaceWith:t},r){const{isRecursive:a,ref:o}=e;if(a){let p=n;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===o||p.number===o)););r.reffedNodesByReferencer.set(e,p);return}const s=r.subroutineRefMap.get(o),i=o===0,u=i?kn(0):xn(s,r.groupOriginByCopy,null);let c=u;if(!i){const p=En(er(s,d=>d.type==="Group"&&!!d.flags)),l=p?we(r.globalFlags,p):r.globalFlags;Kt(l,r.currentFlags)||(c=_({flags:nr(l)}),c.body[0].body.push(u))}t(b(c,n),{traverse:!i})}},Jt={Backreference({node:e,parent:n,replaceWith:t},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const a=r.reffedNodesByReferencer.get(e).filter(o=>Yt(o,e));if(!a.length)t(b(W({negate:!0}),n));else if(a.length>1){const o=_({atomic:!0,body:a.reverse().map(s=>T({body:[$e(s.number)]}))});t(b(o,n))}else e.ref=a[0].number},CapturingGroup({node:e},n){e.number=++n.numCapturesToLeft,e.name&&n.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},n){const t=Math.max(n.highestOrphanBackref-n.numCapturesToLeft,0);for(let r=0;r<t;r++){const a=Ye();e.body.at(-1).body.push(a)}}},Subroutine({node:e},n){!e.isRecursive||e.ref===0||(e.ref=n.reffedNodesByReferencer.get(e).number)}};function Cn(e){oe(e,{"*"({node:n,parent:t}){n.parent=t}})}function Kt(e,n){return e.dotAll===n.dotAll&&e.ignoreCase===n.ignoreCase}function Yt(e,n){let t=n;do{if(t.type==="Regex")return!1;if(t.type==="Alternative")continue;if(t===e)return!1;const r=$n(t.parent);for(const a of r){if(a===t)break;if(a===e||An(a,e))return!0}}while(t=t.parent);throw new Error("Unexpected path")}function xn(e,n,t,r){const a=Array.isArray(e)?[]:{};for(const[o,s]of Object.entries(e))o==="parent"?a.parent=Array.isArray(t)?r:t:s&&typeof s=="object"?a[o]=xn(s,n,a,t):(o==="type"&&s==="CapturingGroup"&&n.set(a,n.get(e)??e),a[o]=s);return a}function kn(e){const n=nn(e);return n.isRecursive=!0,n}function er(e,n){const t=[];for(;e=e.parent;)(!n||n(e))&&t.push(e);return t}function Re(e,n){if(n.has(e))return n.get(e);const t=`$${n.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return n.set(e,t),t}function En(e){const n=["dotAll","ignoreCase"],t={enable:{},disable:{}};return e.forEach(({flags:r})=>{n.forEach(a=>{var o,s;(o=r.enable)!=null&&o[a]&&(delete t.disable[a],t.enable[a]=!0),(s=r.disable)!=null&&s[a]&&(t.disable[a]=!0)})}),Object.keys(t.enable).length||delete t.enable,Object.keys(t.disable).length||delete t.disable,t.enable||t.disable?t:null}function nr({dotAll:e,ignoreCase:n}){const t={};return(e||n)&&(t.enable={},e&&(t.enable.dotAll=!0),n&&(t.enable.ignoreCase=!0)),(!e||!n)&&(t.disable={},!e&&(t.disable.dotAll=!0),!n&&(t.disable.ignoreCase=!0)),t}function $n(e){if(!e)throw new Error("Node expected");const{body:n}=e;return Array.isArray(n)?n:n?[n]:null}function vn(e){const n=e.find(t=>t.kind==="search_start"||or(t,{negate:!1})||!tr(t));if(!n)return null;if(n.kind==="search_start")return n;if(n.type==="LookaroundAssertion")return n.body[0].body[0];if(n.type==="CapturingGroup"||n.type==="Group"){const t=[];for(const r of n.body){const a=vn(r.body);if(!a)return null;Array.isArray(a)?t.push(...a):t.push(a)}return t}return null}function An(e,n){const t=$n(e)??[];for(const r of t)if(r===n||An(r,n))return!0;return!1}function tr({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function rr(e){const n=["Character","CharacterClass","CharacterSet"];return n.includes(e.type)||e.type==="Quantifier"&&e.min&&n.includes(e.body.type)}function or(e,n){const t={negate:null,...n};return e.type==="LookaroundAssertion"&&(t.negate===null||e.negate===t.negate)&&e.body.length===1&&Je(e.body[0],{type:"Assertion",kind:"search_start"})}function Pe(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function F(e,n){const t=Ke(e,{...n,unicodePropertyMap:Ne}).body;return t.length>1||t[0].body.length>1?_({body:t}):t[0].body[0]}function Fe(e,n){return e.negate=n,e}function B(e,n){return e.parent=n,e}function b(e,n){return Cn(e),e.parent=n,e}function ar(e,n){const t=yn(n),r=Me(t.target,"ES2024"),a=Me(t.target,"ES2025"),o=t.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,i=null;if(!a){const g=[e.flags.ignoreCase];oe(e,sr,{getCurrentModI:()=>g.at(-1),popModI(){g.pop()},pushModI(f){g.push(f)},setHasCasedChar(){g.at(-1)?s=!0:i=!0}})}const u={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!i)};let c=e;const p={accuracy:t.accuracy,appliedGlobalFlags:u,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!a&&s&&i),useFlagMods:a,useFlagV:r,verbose:t.verbose};function l(g){return p.lastNode=c,c=g,Dt(ir[g.type],`Unexpected node type "${g.type}"`)(g,p,l)}const d={pattern:e.body.map(l).join("|"),flags:l(e.flags),options:{...e.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],p.captureMap.forEach((g,f)=>{g.hidden&&d._hiddenCaptures.push(f),g.transferTo&&ae(d._captureTransfers,g.transferTo,[]).push(f)}),d}var sr={"*":{enter({node:e},n){if(_n(e)){const t=n.getCurrentModI();n.pushModI(e.flags?we({ignoreCase:t},e.flags).ignoreCase:t)}},exit({node:e},n){_n(e)&&n.popModI()}},Backreference(e,n){n.setHasCasedChar()},Character({node:e},n){Ue(C(e.value))&&n.setHasCasedChar()},CharacterClassRange({node:e,skip:n},t){n(),Sn(e,{firstOnly:!0}).length&&t.setHasCasedChar()},CharacterSet({node:e},n){e.kind==="property"&&bn.has(e.value)&&n.setHasCasedChar()}},ir={Alternative({body:e},n,t){return e.map(t).join("")},Assertion({kind:e,negate:n}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return n?h`\B`:h`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},n){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!n.useFlagMods&&n.accuracy==="strict"&&n.currentFlags.ignoreCase&&!n.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,n,t){const{body:r,name:a,number:o}=e,s={ignoreCase:n.currentFlags.ignoreCase},i=n.originMap.get(e);return i&&(s.hidden=!0,o>i.number&&(s.transferTo=i.number)),n.captureMap.set(o,s),`(${a?`?<${a}>`:""}${r.map(t).join("|")})`},Character({value:e},n){const t=C(e),r=Y(e,{escDigit:n.lastNode.type==="Backreference",inCharClass:n.inCharClass,useFlagV:n.useFlagV});if(r!==t)return r;if(n.useAppliedIgnoreCase&&n.currentFlags.ignoreCase&&Ue(t)){const a=mn(t);return n.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return t},CharacterClass(e,n,t){const{kind:r,negate:a,parent:o}=e;let{body:s}=e;if(r==="intersection"&&!n.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");M.bugFlagVLiteralHyphenIsRange&&n.useFlagV&&s.some(Mn)&&(s=[ce(45),...s.filter(c=>!Mn(c))]);const i=()=>`[${a?"^":""}${s.map(t).join(r==="intersection"?"&&":"")}]`;if(!n.inCharClass){if((!n.useFlagV||M.bugNestedClassIgnoresNegation)&&!a){const p=s.filter(l=>l.type==="CharacterClass"&&l.kind==="union"&&l.negate);if(p.length){const l=_(),d=l.body[0];return l.parent=o,d.parent=l,s=s.filter(g=>!p.includes(g)),e.body=s,s.length?(e.parent=d,d.body.push(e)):l.body.pop(),p.forEach(g=>{const f=T({body:[g]});g.parent=f,f.parent=l,l.body.push(f)}),t(l)}}n.inCharClass=!0;const c=i();return n.inCharClass=!1,c}const u=s[0];if(r==="union"&&!a&&u&&((!n.useFlagV||!n.verbose)&&o.kind==="union"&&!(M.bugFlagVLiteralHyphenIsRange&&n.useFlagV)||!n.verbose&&o.kind==="intersection"&&s.length===1&&u.type!=="CharacterClassRange"))return s.map(t).join("");if(!n.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,n){const t=e.min.value,r=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:n.useFlagV},o=Y(t,a),s=Y(r,a),i=new Set;if(n.useAppliedIgnoreCase&&n.currentFlags.ignoreCase){const u=Sn(e);dr(u).forEach(c=>{i.add(Array.isArray(c)?`${Y(c[0],a)}-${Y(c[1],a)}`:Y(c,a))})}return`${o}-${s}${[...i].join("")}`},CharacterSet({kind:e,negate:n,value:t,key:r},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":h`[^\n]`;if(e==="digit")return n?h`\D`:h`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&bn.has(t))throw new Error(`Unicode property "${t}" can't be case-insensitive when other chars have specific case`);return`${n?h`\P`:h`\p`}{${r?`${r}=`:""}${t}}`}if(e==="word")return n?h`\W`:h`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,n){return(n.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:n,flags:t,parent:r},a,o){const s=a.currentFlags;t&&(a.currentFlags=we(s,t));const i=n.map(o).join("|"),u=!a.verbose&&n.length===1&&r.type!=="Quantifier"&&!e&&(!a.useFlagMods||!t)?i:`(?${fr(e,t,a.useFlagMods)}${i})`;return a.currentFlags=s,u},LookaroundAssertion({body:e,kind:n,negate:t},r,a){return`(?${`${n==="lookahead"?"":"<"}${t?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,n,t){return t(e.body)+gr(e)},Subroutine({isRecursive:e,ref:n},t){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=t.recursionLimit;return n===0?`(?R=${r})`:h`\g<${n}&R=${r}>`}},ur=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),cr=new Set(["-","\\","]","^","["]),lr=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),In=new Map([[9,h`\t`],[10,h`\n`],[11,h`\v`],[12,h`\f`],[13,h`\r`],[8232,h`\u2028`],[8233,h`\u2029`],[65279,h`\uFEFF`]]),pr=new RegExp("^\\p{Cased}$","u");function Ue(e){return pr.test(e)}function Sn(e,n){const t=!!(n!=null&&n.firstOnly),r=e.min.value,a=e.max.value,o=[];if(r<65&&(a===65535||a>=131071)||r===65536&&a>=131071)return o;for(let s=r;s<=a;s++){const i=C(s);if(!Ue(i))continue;const u=mn(i).filter(c=>{const p=c.codePointAt(0);return p<r||p>a});if(u.length&&(o.push(...u),t))break}return o}function Y(e,{escDigit:n,inCharClass:t,useFlagV:r}){if(In.has(e))return In.get(e);if(e<32||e>126&&e<160||e>262143||n&&hr(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=t?r?lr:cr:ur,o=C(e);return(a.has(o)?"\\":"")+o}function dr(e){const n=e.map(a=>a.codePointAt(0)).sort((a,o)=>a-o),t=[];let r=null;for(let a=0;a<n.length;a++)n[a+1]===n[a]+1?r??(r=n[a]):r===null?t.push(n[a]):(t.push([r,n[a]]),r=null);return t}function fr(e,n,t){if(e)return">";let r="";if(n&&t){const{enable:a,disable:o}=n;r=(a!=null&&a.ignoreCase?"i":"")+(a!=null&&a.dotAll?"s":"")+(o?"-":"")+(o!=null&&o.ignoreCase?"i":"")+(o!=null&&o.dotAll?"s":"")}return`${r}:`}function gr({kind:e,max:n,min:t}){let r;return!t&&n===1?r="?":!t&&n===1/0?r="*":t===1&&n===1/0?r="+":t===n?r=`{${t}}`:r=`{${t},${n===1/0?"":n}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function _n({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function hr(e){return e>47&&e<58}function Mn({type:e,value:n}){return e==="Character"&&n===45}var V,G,ee,j,ne,ye,Be,se,wr=(se=class extends RegExp{constructor(e,n,t){var r=(...o)=>(super(...o),X(this,ye),X(this,V,new Map),X(this,G,null),X(this,ee),X(this,j,null),X(this,ne,null),ie(this,"rawOptions",{}),this);const a=!!(t!=null&&t.lazyCompile);if(e instanceof RegExp){if(t)throw new Error("Cannot provide options when copying a regexp");const o=e;r(o,n),L(this,ee,o.source),o instanceof se&&(L(this,V,E(o,V)),L(this,j,E(o,j)),L(this,ne,E(o,ne)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...t};r(a?"":e,n),L(this,ee,e),L(this,V,mr(o.hiddenCaptures,o.transfers)),L(this,ne,o.strategy),this.rawOptions=t??{}}a||L(this,G,this)}get source(){return E(this,ee)||"(?:)"}exec(e){if(!E(this,G)){const{lazyCompile:r,...a}=this.rawOptions;L(this,G,new se(E(this,ee),this.flags,a))}const n=this.global||this.sticky,t=this.lastIndex;if(E(this,ne)==="clip_search"&&n&&t){this.lastIndex=0;const r=Oe(this,ye,Be).call(this,e.slice(t));return r&&(yr(r,t,e,this.hasIndices),this.lastIndex+=t),r}return Oe(this,ye,Be).call(this,e)}},V=new WeakMap,G=new WeakMap,ee=new WeakMap,j=new WeakMap,ne=new WeakMap,ye=new WeakSet,Be=function(e){E(this,G).lastIndex=this.lastIndex;const n=Gn(se.prototype,this,"exec").call(E(this,G),e);if(this.lastIndex=E(this,G).lastIndex,!n||!E(this,V).size)return n;const t=[...n];n.length=1;let r;this.hasIndices&&(r=[...n.indices],n.indices.length=1);const a=[0];for(let o=1;o<t.length;o++){const{hidden:s,transferTo:i}=E(this,V).get(o)??{};if(s?a.push(null):(a.push(n.length),n.push(t[o]),this.hasIndices&&n.indices.push(r[o])),i&&t[o]!==void 0){const u=a[i];if(!u)throw new Error(`Invalid capture transfer to "${u}"`);if(n[u]=t[o],this.hasIndices&&(n.indices[u]=r[o]),n.groups){E(this,j)||L(this,j,br(this.source));const c=E(this,j).get(i);c&&(n.groups[c]=t[o],this.hasIndices&&(n.indices.groups[c]=r[o]))}}}return n},se);function yr(e,n,t,r){if(e.index+=n,e.input=t,r){const a=e.indices;for(let s=0;s<a.length;s++){const i=a[s];i&&(a[s]=[i[0]+n,i[1]+n])}const o=a.groups;o&&Object.keys(o).forEach(s=>{const i=o[s];i&&(o[s]=[i[0]+n,i[1]+n])})}}function mr(e,n){const t=new Map;for(const r of e)t.set(r,{hidden:!0});for(const[r,a]of n)for(const o of a)ae(t,o,{}).transferTo=r;return t}function br(e){const n=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,t=new Map;let r=0,a=0,o;for(;o=n.exec(e);){const{0:s,groups:{capture:i,name:u}}=o;s==="["?r++:r?s==="]"&&r--:i&&(a++,u&&t.set(a,u))}return t}function Cr(e,n){const t=xr(e,n);return t.options?new wr(t.pattern,t.flags,t.options):new RegExp(t.pattern,t.flags)}function xr(e,n){const t=yn(n),r=Ke(e,{flags:t.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:t.rules.captureGroup,singleline:t.rules.singleline},skipBackrefValidation:t.rules.allowOrphanBackrefs,unicodePropertyMap:Ne}),a=Zt(r,{accuracy:t.accuracy,asciiWordBoundaries:t.rules.asciiWordBoundaries,avoidSubclass:t.avoidSubclass,bestEffortTarget:t.target}),o=ar(a,t),s=Bt(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),i=Ft(s.pattern),u=Pt(i.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),c={pattern:u.pattern,flags:`${t.hasIndices?"d":""}${t.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(t.avoidSubclass){if(t.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=u.hiddenCaptures.sort((f,w)=>f-w),l=Array.from(u.captureTransfers),d=a._strategy,g=c.pattern.length>=t.lazyCompileLength;(p.length||l.length||d||g)&&(c.options={...p.length&&{hiddenCaptures:p},...l.length&&{transfers:l},...d&&{strategy:d},...g&&{lazyCompile:g}})}return c}function Nn(e,n){return Cr(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...n})}function kr(e={}){const n={target:"auto",cache:new Map,...e};return n.regexConstructor||(n.regexConstructor=t=>Nn(t,{target:n.target})),{createScanner(t){return new be(t,n)},createString(t){return{content:t}}}}function Er(){const e={cache:new Map,regexConstructor:()=>{throw new Error("JavaScriptRawEngine: only support precompiled grammar")}};return{createScanner(n){return new be(n,e)},createString(n){return{content:n}}}}export{be as JavaScriptScanner,Er as createJavaScriptRawEngine,kr as createJavaScriptRegexEngine,Nn as defaultJavaScriptRegexConstructor};
1
+ export * from "./engine-javascript-vq0WuIJl.js";
@@ -1 +1 @@
1
- import{I as e}from"./Icon-BnFKqqtY.js";import{c as r,q as t}from"./define-CGGX-7Vg.js";var o=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],p=a=>r(e,t(a,{name:"ExternalLink",iconNode:o})),h=p;export{h as e};
1
+ import{I as e}from"./Icon-DObhsRtm.js";import{c as r,q as t}from"./define-By-uL588.js";var o=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],p=a=>r(e,t(a,{name:"ExternalLink",iconNode:o})),h=p;export{h as e};
@@ -1 +1 @@
1
- import{I as t}from"./Icon-BnFKqqtY.js";import{c as e,q as r}from"./define-CGGX-7Vg.js";var p=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],h=a=>e(t,r(a,{name:"FileText",iconNode:p})),o=h;export{o as f};
1
+ import{I as t}from"./Icon-DObhsRtm.js";import{c as e,q as r}from"./define-By-uL588.js";var p=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],h=a=>e(t,r(a,{name:"FileText",iconNode:p})),o=h;export{o as f};
@@ -1 +1 @@
1
- import{c,q as E,s as Y,k as V,g as j,i as s,S as w,a as O,b as z,d as S,p as ee,F as L,t as b,n as R,e as te}from"./define-CGGX-7Vg.js";import{c as $}from"./cn-DN5AWfiS.js";import{c as ne}from"./chevron-right-B7l_fMgx.js";import{I as N}from"./Icon-BnFKqqtY.js";import{f as re}from"./file-text-CX7_x42o.js";import{f as ae}from"./folder-V-YdIL8f.js";var ie=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],oe=e=>c(N,E(e,{name:"FileImage",iconNode:ie})),de=oe,le=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]],se=e=>c(N,E(e,{name:"FileType",iconNode:le})),ue=se,ce=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],he=e=>c(N,E(e,{name:"File",iconNode:ce})),fe=he,pe=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ge=e=>c(N,E(e,{name:"FolderOpen",iconNode:pe})),ve=ge,me=b('<span class="text-tool-green tabular-nums">+'),ke=b('<span class="text-tool-red tabular-nums">-'),xe=b("<button type=button>"),be=b('<div part=summary class="flex items-center gap-2 px-2 py-1.5 text-xs text-muted-foreground border-b border-border"><span class="font-medium text-foreground"> <!> changed'),ye=b("<div role=tree aria-label=Files>"),we=b("<div role=group>"),Se=b('<div role=none><div role=treeitem data-tree-kind=folder><span class="truncate font-medium">'),Fe=b('<span part=stat-additions class="text-tool-green tabular-nums">+'),$e=b('<span part=stat-deletions class="text-tool-red tabular-nums">-'),Ce=b("<span part=status>"),De=b('<span class="ml-auto flex items-center gap-1.5 shrink-0 pl-2 text-xs"aria-hidden=true>'),qe=b('<div role=treeitem data-tree-kind=file><span class="w-3.5 shrink-0"></span><span>');const T={added:{letter:"A",label:"added",class:"text-tool-green"},modified:{letter:"M",label:"modified",class:"text-tool-amber"},deleted:{letter:"D",label:"deleted",class:"text-tool-red"},renamed:{letter:"R",label:"renamed",class:"text-tool-blue"},untracked:{letter:"U",label:"untracked",class:"text-muted-foreground"}};function Me(e){const t={children:[]};for(const r of e){const h=r.path.split("/").filter(l=>l.length>0);if(h.length===0)continue;let v=t;for(let l=0;l<h.length-1;l++){const m=h[l],a=h.slice(0,l+1).join("/");let d=v.children.find(x=>x.kind==="folder"&&x.name===m);d||(d={kind:"folder",name:m,path:a,children:[]},v.children.push(d)),v=d}const F=h[h.length-1],u=v.children.find(l=>l.kind==="file"&&l.name===F);u?u.file=r:v.children.push({kind:"file",name:F,path:r.path,file:r})}return U(t.children),t.children}function U(e){e.sort((t,r)=>t.kind!==r.kind?t.kind==="folder"?-1:1:t.name.localeCompare(r.name,void 0,{sensitivity:"base"}));for(const t of e)t.kind==="folder"&&U(t.children)}function _(e,t,r=[]){for(const h of e)r.push(h),h.kind==="folder"&&t(h.path)&&_(h.children,t,r);return r}function Ae(e){switch(e){case"image":return de;case"pdf":return ue;case"html":return re;default:return fe}}function B(e,t=[]){for(const r of e)r.kind==="folder"&&(t.push(r.path),B(r.children,t));return t}function G(e,t=[]){for(const r of e)r.kind==="folder"?G(r.children,t):t.push(r.file);return t}function Ee(e){return e.status!==void 0||e.additions!==void 0||e.deletions!==void 0}function ze(e,t){if(!Ee(t))return;const r=[];return t.status&&r.push(T[t.status].label),t.additions!==void 0&&r.push(`${t.additions} addition${t.additions===1?"":"s"}`),t.deletions!==void 0&&r.push(`${t.deletions} deletion${t.deletions===1?"":"s"}`),[e,...r].join(", ")}function He(e){const[t,r]=Y(e,["files","activeFile","onSelect","defaultExpanded","summary","class"]),h=V(()=>Me(t.files)),v=()=>t.defaultExpanded===void 0,[F,u]=j(new Set(t.defaultExpanded??[]),{equals:!1}),[l,m]=j(new Set,{equals:!1}),a=n=>v()?!l().has(n):F().has(n),d=n=>{v()?m(o=>{const p=new Set(o);return p.has(n)?p.delete(n):p.add(n),p}):u(o=>{const p=new Set(o);return p.has(n)?p.delete(n):p.add(n),p})},x=V(()=>B(h())),y=V(()=>G(h())),i=()=>y().length,f=()=>y().reduce((n,o)=>n+(o.additions??0),0),q=()=>y().reduce((n,o)=>n+(o.deletions??0),0),C=()=>x().some(n=>a(n)),H=()=>{v()?m(new Set(x())):u(new Set)},P=()=>{v()?m(new Set):u(new Set(x()))},K=()=>C()?H():P(),[Q,Z]=j(),I=n=>{var o;Z(n.path),(o=t.onSelect)==null||o.call(t,n.path,n.file)},W=(n,o)=>{const p=_(h(),a),D=p.findIndex(k=>k.path===o.path&&k.kind===o.kind),g=k=>{var M,A;if(!k)return;Z(k.path);const X=`[data-tree-path="${Ke(k.path)}"][data-tree-kind="${k.kind}"]`;(A=(M=n.currentTarget.closest('[role="tree"]'))==null?void 0:M.querySelector(X))==null||A.focus()};switch(n.key){case"ArrowDown":n.preventDefault(),g(p[D+1]);break;case"ArrowUp":n.preventDefault(),g(p[D-1]);break;case"ArrowRight":n.preventDefault(),o.kind==="folder"&&(a(o.path)?g(p[D+1]):d(o.path));break;case"ArrowLeft":n.preventDefault(),o.kind==="folder"&&a(o.path)&&d(o.path);break;case"Enter":case" ":n.preventDefault(),o.kind==="folder"?d(o.path):I(o);break}};return[c(w,{get when(){return t.summary},get children(){var n=be(),o=n.firstChild,p=o.firstChild,D=p.nextSibling;return D.nextSibling,s(o,i,p),s(o,()=>i()===1?"file":"files",D),s(n,c(w,{get when(){return f()>0},get children(){var g=me();return g.firstChild,s(g,f,null),g}}),null),s(n,c(w,{get when(){return q()>0},get children(){var g=ke();return g.firstChild,s(g,q,null),g}}),null),s(n,c(w,{get when(){return x().length>0},get children(){var g=xe();return g.$$click=K,s(g,()=>C()?"Collapse all":"Expand all"),O(k=>{var M=$("ml-auto rounded-md px-1.5 py-0.5 font-medium text-muted-foreground outline-none","hover:bg-muted hover:text-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"),A=C()?"Collapse all folders":"Expand all folders";return M!==k.e&&z(g,k.e=M),A!==k.t&&S(g,"aria-label",k.t=A),k},{e:void 0,t:void 0}),g}}),null),n}}),(()=>{var n=ye();return ee(n,E({get class(){return $("text-sm select-none",t.class)}},r),!1,!0),s(n,c(L,{get each(){return h()},children:o=>c(J,{node:o,depth:0,isOpen:a,toggle:d,activeFile:()=>t.activeFile,focusedPath:Q,onSelectFile:I,onKeyDown:W})})),n})()]}function J(e){const t=()=>e.node,r=()=>e.node.kind==="folder"&&e.isOpen(e.node.path),h=()=>e.node.kind==="file"&&e.activeFile()===e.node.path,v=()=>{const u=e.focusedPath();return u!==void 0?e.node.path===u?0:-1:h()?0:-1},F=()=>({"padding-left":`${e.depth*12+8}px`});return c(w,{get when(){return e.node.kind==="folder"},get fallback(){const u=e.node.file,l=ze(t().name,u),m=l!==void 0,a=u.status?T[u.status]:void 0;return(()=>{var d=qe(),x=d.firstChild,y=x.nextSibling;return d.$$keydown=i=>e.onKeyDown(i,e.node),d.$$click=()=>e.onSelectFile(e.node),S(d,"aria-label",l),s(d,()=>{const i=Ae(u.type);return c(i,{size:14,class:"shrink-0 opacity-70","aria-hidden":"true"})},y),s(y,()=>t().name),s(d,c(w,{when:m,get children(){var i=De();return s(i,c(w,{get when(){return u.additions!==void 0},get children(){var f=Fe();return f.firstChild,s(f,()=>u.additions,null),f}}),null),s(i,c(w,{get when(){return u.deletions!==void 0},get children(){var f=$e();return f.firstChild,s(f,()=>u.deletions,null),f}}),null),s(i,c(w,{when:a,get children(){var f=Ce();return s(f,()=>a.letter),O(()=>z(f,$("w-3 text-center font-mono font-semibold",a.class))),f}}),null),i}}),null),O(i=>{var f=h(),q=e.node.path,C=v(),H=$("flex items-center gap-1.5 rounded-md py-1 pr-2 cursor-pointer outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",h()?"bg-primary/10 text-foreground font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"),P=F(),K=$("truncate",m&&"min-w-0 flex-1");return f!==i.e&&S(d,"aria-selected",i.e=f),q!==i.t&&S(d,"data-tree-path",i.t=q),C!==i.a&&S(d,"tabindex",i.a=C),H!==i.o&&z(d,i.o=H),i.i=R(d,P,i.i),K!==i.n&&z(y,i.n=K),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),d})()},get children(){var u=Se(),l=u.firstChild,m=l.firstChild;return l.$$keydown=a=>e.onKeyDown(a,e.node),l.$$click=()=>e.toggle(e.node.path),s(l,c(ne,{size:14,get class(){return $("shrink-0 transition-transform opacity-70",r()&&"rotate-90")},"aria-hidden":"true"}),m),s(l,()=>{const a=r()?ve:ae;return c(a,{size:14,class:"shrink-0 text-foreground/80","aria-hidden":"true"})},m),s(m,()=>t().name),s(u,c(w,{get when(){return r()},get children(){var a=we();return s(a,c(L,{get each(){return e.node.children},children:d=>c(J,{node:d,get depth(){return e.depth+1},get isOpen(){return e.isOpen},get toggle(){return e.toggle},get activeFile(){return e.activeFile},get focusedPath(){return e.focusedPath},get onSelectFile(){return e.onSelectFile},get onKeyDown(){return e.onKeyDown}})})),a}}),null),O(a=>{var d=r(),x=e.node.path,y=v(),i=$("flex items-center gap-1.5 rounded-md py-1 pr-2 cursor-pointer outline-none text-foreground","hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"),f=F();return d!==a.e&&S(l,"aria-expanded",a.e=d),x!==a.t&&S(l,"data-tree-path",a.t=x),y!==a.a&&S(l,"tabindex",a.a=y),i!==a.o&&z(l,a.o=i),a.i=R(l,f,a.i),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u}})}function Ke(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}te(["click","keydown"]);export{He as F};
1
+ import{c,q as E,s as Y,k as V,g as j,i as s,S as w,a as O,b as z,d as S,p as ee,F as L,t as b,n as R,e as te}from"./define-By-uL588.js";import{c as $}from"./cn-DN5AWfiS.js";import{c as ne}from"./chevron-right-BatuHzUm.js";import{I as N}from"./Icon-DObhsRtm.js";import{f as re}from"./file-text-DMib2qwt.js";import{f as ae}from"./folder-_BAb929C.js";var ie=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],oe=e=>c(N,E(e,{name:"FileImage",iconNode:ie})),de=oe,le=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]],se=e=>c(N,E(e,{name:"FileType",iconNode:le})),ue=se,ce=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],he=e=>c(N,E(e,{name:"File",iconNode:ce})),fe=he,pe=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ge=e=>c(N,E(e,{name:"FolderOpen",iconNode:pe})),ve=ge,me=b('<span class="text-tool-green tabular-nums">+'),ke=b('<span class="text-tool-red tabular-nums">-'),xe=b("<button type=button>"),be=b('<div part=summary class="flex items-center gap-2 px-2 py-1.5 text-xs text-muted-foreground border-b border-border"><span class="font-medium text-foreground"> <!> changed'),ye=b("<div role=tree aria-label=Files>"),we=b("<div role=group>"),Se=b('<div role=none><div role=treeitem data-tree-kind=folder><span class="truncate font-medium">'),Fe=b('<span part=stat-additions class="text-tool-green tabular-nums">+'),$e=b('<span part=stat-deletions class="text-tool-red tabular-nums">-'),Ce=b("<span part=status>"),De=b('<span class="ml-auto flex items-center gap-1.5 shrink-0 pl-2 text-xs"aria-hidden=true>'),qe=b('<div role=treeitem data-tree-kind=file><span class="w-3.5 shrink-0"></span><span>');const T={added:{letter:"A",label:"added",class:"text-tool-green"},modified:{letter:"M",label:"modified",class:"text-tool-amber"},deleted:{letter:"D",label:"deleted",class:"text-tool-red"},renamed:{letter:"R",label:"renamed",class:"text-tool-blue"},untracked:{letter:"U",label:"untracked",class:"text-muted-foreground"}};function Me(e){const t={children:[]};for(const r of e){const h=r.path.split("/").filter(l=>l.length>0);if(h.length===0)continue;let v=t;for(let l=0;l<h.length-1;l++){const m=h[l],a=h.slice(0,l+1).join("/");let d=v.children.find(x=>x.kind==="folder"&&x.name===m);d||(d={kind:"folder",name:m,path:a,children:[]},v.children.push(d)),v=d}const F=h[h.length-1],u=v.children.find(l=>l.kind==="file"&&l.name===F);u?u.file=r:v.children.push({kind:"file",name:F,path:r.path,file:r})}return U(t.children),t.children}function U(e){e.sort((t,r)=>t.kind!==r.kind?t.kind==="folder"?-1:1:t.name.localeCompare(r.name,void 0,{sensitivity:"base"}));for(const t of e)t.kind==="folder"&&U(t.children)}function _(e,t,r=[]){for(const h of e)r.push(h),h.kind==="folder"&&t(h.path)&&_(h.children,t,r);return r}function Ae(e){switch(e){case"image":return de;case"pdf":return ue;case"html":return re;default:return fe}}function B(e,t=[]){for(const r of e)r.kind==="folder"&&(t.push(r.path),B(r.children,t));return t}function G(e,t=[]){for(const r of e)r.kind==="folder"?G(r.children,t):t.push(r.file);return t}function Ee(e){return e.status!==void 0||e.additions!==void 0||e.deletions!==void 0}function ze(e,t){if(!Ee(t))return;const r=[];return t.status&&r.push(T[t.status].label),t.additions!==void 0&&r.push(`${t.additions} addition${t.additions===1?"":"s"}`),t.deletions!==void 0&&r.push(`${t.deletions} deletion${t.deletions===1?"":"s"}`),[e,...r].join(", ")}function He(e){const[t,r]=Y(e,["files","activeFile","onSelect","defaultExpanded","summary","class"]),h=V(()=>Me(t.files)),v=()=>t.defaultExpanded===void 0,[F,u]=j(new Set(t.defaultExpanded??[]),{equals:!1}),[l,m]=j(new Set,{equals:!1}),a=n=>v()?!l().has(n):F().has(n),d=n=>{v()?m(o=>{const p=new Set(o);return p.has(n)?p.delete(n):p.add(n),p}):u(o=>{const p=new Set(o);return p.has(n)?p.delete(n):p.add(n),p})},x=V(()=>B(h())),y=V(()=>G(h())),i=()=>y().length,f=()=>y().reduce((n,o)=>n+(o.additions??0),0),q=()=>y().reduce((n,o)=>n+(o.deletions??0),0),C=()=>x().some(n=>a(n)),H=()=>{v()?m(new Set(x())):u(new Set)},P=()=>{v()?m(new Set):u(new Set(x()))},K=()=>C()?H():P(),[Q,Z]=j(),I=n=>{var o;Z(n.path),(o=t.onSelect)==null||o.call(t,n.path,n.file)},W=(n,o)=>{const p=_(h(),a),D=p.findIndex(k=>k.path===o.path&&k.kind===o.kind),g=k=>{var M,A;if(!k)return;Z(k.path);const X=`[data-tree-path="${Ke(k.path)}"][data-tree-kind="${k.kind}"]`;(A=(M=n.currentTarget.closest('[role="tree"]'))==null?void 0:M.querySelector(X))==null||A.focus()};switch(n.key){case"ArrowDown":n.preventDefault(),g(p[D+1]);break;case"ArrowUp":n.preventDefault(),g(p[D-1]);break;case"ArrowRight":n.preventDefault(),o.kind==="folder"&&(a(o.path)?g(p[D+1]):d(o.path));break;case"ArrowLeft":n.preventDefault(),o.kind==="folder"&&a(o.path)&&d(o.path);break;case"Enter":case" ":n.preventDefault(),o.kind==="folder"?d(o.path):I(o);break}};return[c(w,{get when(){return t.summary},get children(){var n=be(),o=n.firstChild,p=o.firstChild,D=p.nextSibling;return D.nextSibling,s(o,i,p),s(o,()=>i()===1?"file":"files",D),s(n,c(w,{get when(){return f()>0},get children(){var g=me();return g.firstChild,s(g,f,null),g}}),null),s(n,c(w,{get when(){return q()>0},get children(){var g=ke();return g.firstChild,s(g,q,null),g}}),null),s(n,c(w,{get when(){return x().length>0},get children(){var g=xe();return g.$$click=K,s(g,()=>C()?"Collapse all":"Expand all"),O(k=>{var M=$("ml-auto rounded-md px-1.5 py-0.5 font-medium text-muted-foreground outline-none","hover:bg-muted hover:text-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"),A=C()?"Collapse all folders":"Expand all folders";return M!==k.e&&z(g,k.e=M),A!==k.t&&S(g,"aria-label",k.t=A),k},{e:void 0,t:void 0}),g}}),null),n}}),(()=>{var n=ye();return ee(n,E({get class(){return $("text-sm select-none",t.class)}},r),!1,!0),s(n,c(L,{get each(){return h()},children:o=>c(J,{node:o,depth:0,isOpen:a,toggle:d,activeFile:()=>t.activeFile,focusedPath:Q,onSelectFile:I,onKeyDown:W})})),n})()]}function J(e){const t=()=>e.node,r=()=>e.node.kind==="folder"&&e.isOpen(e.node.path),h=()=>e.node.kind==="file"&&e.activeFile()===e.node.path,v=()=>{const u=e.focusedPath();return u!==void 0?e.node.path===u?0:-1:h()?0:-1},F=()=>({"padding-left":`${e.depth*12+8}px`});return c(w,{get when(){return e.node.kind==="folder"},get fallback(){const u=e.node.file,l=ze(t().name,u),m=l!==void 0,a=u.status?T[u.status]:void 0;return(()=>{var d=qe(),x=d.firstChild,y=x.nextSibling;return d.$$keydown=i=>e.onKeyDown(i,e.node),d.$$click=()=>e.onSelectFile(e.node),S(d,"aria-label",l),s(d,()=>{const i=Ae(u.type);return c(i,{size:14,class:"shrink-0 opacity-70","aria-hidden":"true"})},y),s(y,()=>t().name),s(d,c(w,{when:m,get children(){var i=De();return s(i,c(w,{get when(){return u.additions!==void 0},get children(){var f=Fe();return f.firstChild,s(f,()=>u.additions,null),f}}),null),s(i,c(w,{get when(){return u.deletions!==void 0},get children(){var f=$e();return f.firstChild,s(f,()=>u.deletions,null),f}}),null),s(i,c(w,{when:a,get children(){var f=Ce();return s(f,()=>a.letter),O(()=>z(f,$("w-3 text-center font-mono font-semibold",a.class))),f}}),null),i}}),null),O(i=>{var f=h(),q=e.node.path,C=v(),H=$("flex items-center gap-1.5 rounded-md py-1 pr-2 cursor-pointer outline-none","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",h()?"bg-primary/10 text-foreground font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"),P=F(),K=$("truncate",m&&"min-w-0 flex-1");return f!==i.e&&S(d,"aria-selected",i.e=f),q!==i.t&&S(d,"data-tree-path",i.t=q),C!==i.a&&S(d,"tabindex",i.a=C),H!==i.o&&z(d,i.o=H),i.i=R(d,P,i.i),K!==i.n&&z(y,i.n=K),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),d})()},get children(){var u=Se(),l=u.firstChild,m=l.firstChild;return l.$$keydown=a=>e.onKeyDown(a,e.node),l.$$click=()=>e.toggle(e.node.path),s(l,c(ne,{size:14,get class(){return $("shrink-0 transition-transform opacity-70",r()&&"rotate-90")},"aria-hidden":"true"}),m),s(l,()=>{const a=r()?ve:ae;return c(a,{size:14,class:"shrink-0 text-foreground/80","aria-hidden":"true"})},m),s(m,()=>t().name),s(u,c(w,{get when(){return r()},get children(){var a=we();return s(a,c(L,{get each(){return e.node.children},children:d=>c(J,{node:d,get depth(){return e.depth+1},get isOpen(){return e.isOpen},get toggle(){return e.toggle},get activeFile(){return e.activeFile},get focusedPath(){return e.focusedPath},get onSelectFile(){return e.onSelectFile},get onKeyDown(){return e.onKeyDown}})})),a}}),null),O(a=>{var d=r(),x=e.node.path,y=v(),i=$("flex items-center gap-1.5 rounded-md py-1 pr-2 cursor-pointer outline-none text-foreground","hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"),f=F();return d!==a.e&&S(l,"aria-expanded",a.e=d),x!==a.t&&S(l,"data-tree-path",a.t=x),y!==a.a&&S(l,"tabindex",a.a=y),i!==a.o&&z(l,a.o=i),a.i=R(l,f,a.i),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u}})}function Ke(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}te(["click","keydown"]);export{He as F};
@@ -1 +1 @@
1
- import{I as o}from"./Icon-BnFKqqtY.js";import{c as r,q as e}from"./define-CGGX-7Vg.js";var t=[["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"}]],m=a=>r(o,e(a,{name:"Folder",iconNode:t})),p=m;export{p as f};
1
+ import{I as o}from"./Icon-DObhsRtm.js";import{c as r,q as e}from"./define-By-uL588.js";var t=[["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"}]],m=a=>r(o,e(a,{name:"Folder",iconNode:t})),p=m;export{p as f};