shadow-claw 1.59.6 → 1.60.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 (358) hide show
  1. package/.well-known/mcp/server-card.json +1 -1
  2. package/.well-known/mcp.json +1 -1
  3. package/README.md +6 -2
  4. package/dist/cli/build/build.js +1 -1
  5. package/dist/cli/chunk-3C5izdQW.js +1 -0
  6. package/dist/cli/chunk-B-75h9gX.js +1 -0
  7. package/dist/cli/{chunk-C9o6lXP3.js → chunk-B7Kn-otm.js} +1 -1
  8. package/dist/cli/{chunk-YX32FcN7.js → chunk-BBczgswQ.js} +1 -1
  9. package/dist/cli/{chunk-DcNxjqH6.js → chunk-BE-lYWcn.js} +1 -1
  10. package/dist/cli/{chunk-DJqHK-qS.js → chunk-BECr0WxI.js} +11 -11
  11. package/dist/cli/chunk-BEz1PD1_.js +1 -0
  12. package/dist/cli/chunk-BLzI1Fp2.js +1 -0
  13. package/dist/cli/{chunk-yiVdvGCJ.js → chunk-BVSC1MNQ.js} +11 -11
  14. package/dist/cli/{chunk-CX2itile.js → chunk-BdWcep6o.js} +1 -1
  15. package/dist/cli/{chunk-DLde6nuO.js → chunk-BfTpnSS4.js} +1 -1
  16. package/dist/cli/{chunk-D2_eAO83.js → chunk-BgvqTf7w.js} +1 -1
  17. package/dist/cli/chunk-BwsJfUT3.js +1 -0
  18. package/dist/cli/{chunk--PFY91kE.js → chunk-C9b4b7c_.js} +1 -1
  19. package/dist/cli/{chunk-D3y7h9Xe.js → chunk-CAw9XYFe.js} +1 -1
  20. package/dist/cli/chunk-CFCcbFs2.js +396 -0
  21. package/dist/cli/{chunk-Cnjb8Usu.js → chunk-CTarF4FC.js} +1 -1
  22. package/dist/cli/{chunk-DM4xsTry.js → chunk-Cbq5hpjb.js} +4 -4
  23. package/dist/cli/chunk-CjTjKy_v.js +310 -0
  24. package/dist/cli/chunk-Cjyu4cr_.js +36 -0
  25. package/dist/cli/{chunk-DUGZPka_.js → chunk-ClMKygjZ.js} +1 -1
  26. package/dist/cli/chunk-Cppnq1KF.js +1 -0
  27. package/dist/cli/{chunk-DvemF16v.js → chunk-D9QCNFMO.js} +1 -1
  28. package/dist/cli/chunk-DB21BMqt.js +7 -0
  29. package/dist/cli/{chunk-_Vo-o_e3.js → chunk-DHoIWvCc.js} +1 -1
  30. package/dist/cli/chunk-DZEN9T5y.js +1 -0
  31. package/dist/cli/{chunk-5rLO4DWS.js → chunk-Dl14OyYO.js} +9 -9
  32. package/dist/cli/chunk-Dl_vv0dI.js +1 -0
  33. package/dist/cli/chunk-Dpmfhlyl.js +1 -0
  34. package/dist/cli/{chunk-BrR1DOBS.js → chunk-Du7Xtucq.js} +1 -1
  35. package/dist/cli/{chunk-Bc_weULz.js → chunk-DxcDFUi_.js} +1 -1
  36. package/dist/cli/{chunk-Dt7-hzJU.js → chunk-DyyEWbV7.js} +1 -1
  37. package/dist/cli/chunk-N0x3mXU0.js +1 -0
  38. package/dist/cli/{chunk-CGoE4llV.js → chunk-V-w0Bata.js} +1 -1
  39. package/dist/cli/{chunk-C8DBACtx.js → chunk-ZxDxSSn-.js} +1 -1
  40. package/dist/cli/chunk-lPvFUkd5.js +7 -0
  41. package/dist/cli/{chunk-Ctg5L55n.js → chunk-n5s-sCdU.js} +1 -1
  42. package/dist/cli/{chunk-Dw8GndPD.js → chunk-nD9VPVMq.js} +1 -1
  43. package/dist/cli/{chunk-Cq_kQohv.js → chunk-rFuy8aS_.js} +1 -1
  44. package/dist/cli/{chunk-Bq38OubR.js → chunk-wjM6JXWa.js} +1 -1
  45. package/dist/cli/{chunk-3wTukVof.js → chunk-zcES9rut.js} +1 -1
  46. package/dist/cli/cli.js +3 -3
  47. package/dist/headless-agent.js +2 -2
  48. package/dist/lib/{app-routes-DJdIjp2V.js → app-routes-BXiRvlNl.js} +7 -25
  49. package/dist/lib/{app-routes-DJdIjp2V.js.map → app-routes-BXiRvlNl.js.map} +1 -1
  50. package/dist/lib/{attachment-capabilities-Dbb-4ZP5.js → attachment-capabilities-BjkEPip8.js} +2 -2
  51. package/dist/lib/{attachment-capabilities-Dbb-4ZP5.js.map → attachment-capabilities-BjkEPip8.js.map} +1 -1
  52. package/dist/lib/{channel-Dlru5ofR.js → channel-DB77spML.js} +3 -3
  53. package/dist/lib/{channel-Dlru5ofR.js.map → channel-DB77spML.js.map} +1 -1
  54. package/dist/lib/{chat-template-BuuLY8l7.js → chat-template-DPEKGJhB.js} +2 -2
  55. package/dist/lib/{chat-template-BuuLY8l7.js.map → chat-template-DPEKGJhB.js.map} +1 -1
  56. package/dist/lib/{compact-context-BtR55YPU.js → compact-context-Q9t9aL1e.js} +19 -19
  57. package/dist/lib/{compact-context-BtR55YPU.js.map → compact-context-Q9t9aL1e.js.map} +1 -1
  58. package/dist/lib/components/common/shadow-claw-provider-model-picker.js +1 -1
  59. package/dist/lib/components/index.js +27 -27
  60. package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
  61. package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
  62. package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
  63. package/dist/lib/components/settings/shadow-claw-git.js +1 -1
  64. package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
  65. package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
  66. package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
  67. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  68. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  69. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  70. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  71. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  72. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  73. package/dist/lib/components/shadow-claw-a2ui.js +1 -1
  74. package/dist/lib/components/shadow-claw-accounts.js +1 -1
  75. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  76. package/dist/lib/components/shadow-claw-channels.js +1 -1
  77. package/dist/lib/components/shadow-claw-chat.js +1 -1
  78. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  79. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  80. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  81. package/dist/lib/components/shadow-claw-files.js +1 -1
  82. package/dist/lib/components/shadow-claw-git.js +1 -1
  83. package/dist/lib/components/shadow-claw-integrations.js +1 -1
  84. package/dist/lib/components/shadow-claw-llm.js +1 -1
  85. package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
  86. package/dist/lib/components/shadow-claw-networking.js +1 -1
  87. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  88. package/dist/lib/components/shadow-claw-page-header.js +1 -1
  89. package/dist/lib/components/shadow-claw-pages.js +1 -1
  90. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  91. package/dist/lib/components/shadow-claw-provider-model-picker.js +1 -1
  92. package/dist/lib/components/shadow-claw-settings.js +1 -1
  93. package/dist/lib/components/shadow-claw-storage.js +1 -1
  94. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  95. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  96. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  97. package/dist/lib/components/shadow-claw-tools.js +1 -1
  98. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  99. package/dist/lib/components/shadow-claw.js +1 -1
  100. package/dist/lib/{config-DxNI3TlW.js → config-BrHR97zt.js} +2 -2
  101. package/dist/lib/{config-DxNI3TlW.js.map → config-BrHR97zt.js.map} +1 -1
  102. package/dist/lib/{configure-peer-js-ChDhOZU4.js → configure-peer-js-CgFiwoxY.js} +3 -3
  103. package/dist/lib/{configure-peer-js-ChDhOZU4.js.map → configure-peer-js-CgFiwoxY.js.map} +1 -1
  104. package/dist/lib/{connections-DC4NZkJE.js → connections-C1FWsBsE.js} +2 -2
  105. package/dist/lib/{connections-DC4NZkJE.js.map → connections-C1FWsBsE.js.map} +1 -1
  106. package/dist/lib/content/build-attachment-content-blocks.d.ts +2 -0
  107. package/dist/lib/{credentials-5vpz0XPk.js → credentials-CZbngHXW.js} +2 -2
  108. package/dist/lib/{credentials-5vpz0XPk.js.map → credentials-CZbngHXW.js.map} +1 -1
  109. package/dist/lib/{discover-skills-CD0sKvAI.js → discover-skills-CXyaWHKi.js} +13 -13
  110. package/dist/lib/{discover-skills-CD0sKvAI.js.map → discover-skills-CXyaWHKi.js.map} +1 -1
  111. package/dist/lib/{download-group-file-Dk3qaxhJ.js → download-group-file-D0wgg10Q.js} +2 -2
  112. package/dist/lib/{download-group-file-Dk3qaxhJ.js.map → download-group-file-D0wgg10Q.js.map} +1 -1
  113. package/dist/lib/{file-viewer-B4pRW-_G.js → file-viewer-DOfvX6yy.js} +5 -5
  114. package/dist/lib/{file-viewer-B4pRW-_G.js.map → file-viewer-DOfvX6yy.js.map} +1 -1
  115. package/dist/lib/{get-or-create-subscriber-id-HCcgDEPz.js → get-or-create-subscriber-id-wyzaML7Z.js} +2 -2
  116. package/dist/lib/{get-or-create-subscriber-id-HCcgDEPz.js.map → get-or-create-subscriber-id-wyzaML7Z.js.map} +1 -1
  117. package/dist/lib/{git-B3Q1euc5.js → git-CogDRlEz.js} +5 -5
  118. package/dist/lib/{git-B3Q1euc5.js.map → git-CogDRlEz.js.map} +1 -1
  119. package/dist/lib/{iframe-bridge-scripts-D8iuFhUk.js → iframe-bridge-scripts-Dx825LLG.js} +2 -2
  120. package/dist/lib/{iframe-bridge-scripts-D8iuFhUk.js.map → iframe-bridge-scripts-Dx825LLG.js.map} +1 -1
  121. package/dist/lib/index.js +28 -28
  122. package/dist/lib/{init-chat-split-resize-B0ODULx9.js → init-chat-split-resize-Cc0bd2z9.js} +2 -2
  123. package/dist/lib/{init-chat-split-resize-B0ODULx9.js.map → init-chat-split-resize-Cc0bd2z9.js.map} +1 -1
  124. package/dist/lib/{init-control-plane-C1FRRmjC.js → init-control-plane-CEGdzgWX.js} +15 -15
  125. package/dist/lib/{init-control-plane-C1FRRmjC.js.map → init-control-plane-CEGdzgWX.js.map} +1 -1
  126. package/dist/lib/{invoke-agent-CzN7sVh-.js → invoke-agent-cac3gCsj.js} +11 -11
  127. package/dist/lib/{invoke-agent-CzN7sVh-.js.map → invoke-agent-cac3gCsj.js.map} +1 -1
  128. package/dist/lib/{markdown-mbNo7cV3.js → markdown--6vTAPEH.js} +2 -2
  129. package/dist/lib/{markdown-mbNo7cV3.js.map → markdown--6vTAPEH.js.map} +1 -1
  130. package/dist/lib/{mcp-reconnect-3T7yWGEY.js → mcp-reconnect-BeqQvNWO.js} +3 -3
  131. package/dist/lib/{mcp-reconnect-3T7yWGEY.js.map → mcp-reconnect-BeqQvNWO.js.map} +1 -1
  132. package/dist/lib/{model-ranking-DGNSWYwN.js → model-ranking-BhsJV7vb.js} +2 -2
  133. package/dist/lib/{model-ranking-DGNSWYwN.js.map → model-ranking-BhsJV7vb.js.map} +1 -1
  134. package/dist/lib/{move-group-entry-NMTJ59M9.js → move-group-entry-D8dptMg0.js} +5 -5
  135. package/dist/lib/{move-group-entry-NMTJ59M9.js.map → move-group-entry-D8dptMg0.js.map} +1 -1
  136. package/dist/lib/{orchestrator-B8FV1V7x.js → orchestrator-BBAwy9Nm.js} +24 -24
  137. package/dist/lib/{orchestrator-B8FV1V7x.js.map → orchestrator-BBAwy9Nm.js.map} +1 -1
  138. package/dist/lib/{orchestrator-i_QJ-o22.js → orchestrator-cRBe3lhq.js} +11 -11
  139. package/dist/lib/orchestrator-cRBe3lhq.js.map +1 -0
  140. package/dist/lib/{parse-path-DPCn-HwI.js → parse-path-BOHQP_IQ.js} +3 -3
  141. package/dist/lib/{parse-path-DPCn-HwI.js.map → parse-path-BOHQP_IQ.js.map} +1 -1
  142. package/dist/lib/{peerjs-z5zeioPV.js → peerjs-BLg8aGUj.js} +8 -8
  143. package/dist/lib/{peerjs-z5zeioPV.js.map → peerjs-BLg8aGUj.js.map} +1 -1
  144. package/dist/lib/{process-peer-query-param-CJp7w7AU.js → process-peer-query-param-BnsVnxzH.js} +5 -5
  145. package/dist/lib/{process-peer-query-param-CJp7w7AU.js.map → process-peer-query-param-BnsVnxzH.js.map} +1 -1
  146. package/dist/lib/{process-pending-shared-payloads-B6_TlBFA.js → process-pending-shared-payloads-DBZfZOOa.js} +4 -4
  147. package/dist/lib/{process-pending-shared-payloads-B6_TlBFA.js.map → process-pending-shared-payloads-DBZfZOOa.js.map} +1 -1
  148. package/dist/lib/{process-room-query-param-C3FFGGn6.js → process-room-query-param-B8EYg_-r.js} +4 -4
  149. package/dist/lib/{process-room-query-param-C3FFGGn6.js.map → process-room-query-param-B8EYg_-r.js.map} +1 -1
  150. package/dist/lib/{provider-DcQZypu5.js → provider-BC9KPI14.js} +3 -3
  151. package/dist/lib/{provider-DcQZypu5.js.map → provider-BC9KPI14.js.map} +1 -1
  152. package/dist/lib/{push-client-Cx5rMs6J.js → push-client-CAm6UMvE.js} +5 -5
  153. package/dist/lib/{push-client-Cx5rMs6J.js.map → push-client-CAm6UMvE.js.map} +1 -1
  154. package/dist/lib/{read-group-file-bytes-CXOG_YyM.js → read-group-file-bytes-UQIk1eJG.js} +2 -2
  155. package/dist/lib/{read-group-file-bytes-CXOG_YyM.js.map → read-group-file-bytes-UQIk1eJG.js.map} +1 -1
  156. package/dist/lib/{rooms-CwlkYLDU.js → rooms-Dzphx3rK.js} +2 -2
  157. package/dist/lib/{rooms-CwlkYLDU.js.map → rooms-Dzphx3rK.js.map} +1 -1
  158. package/dist/lib/{shadow-claw-DoQ7fgl5.js → shadow-claw-CGl8tXtG.js} +17 -20
  159. package/dist/lib/shadow-claw-CGl8tXtG.js.map +1 -0
  160. package/dist/lib/{shadow-claw-a2ui-Br6qJMs1.js → shadow-claw-a2ui-lG0vQbW8.js} +2 -2
  161. package/dist/lib/{shadow-claw-a2ui-Br6qJMs1.js.map → shadow-claw-a2ui-lG0vQbW8.js.map} +1 -1
  162. package/dist/lib/{shadow-claw-accounts-BTDILfWw.js → shadow-claw-accounts-CkqyCxwp.js} +3 -3
  163. package/dist/lib/{shadow-claw-accounts-BTDILfWw.js.map → shadow-claw-accounts-CkqyCxwp.js.map} +1 -1
  164. package/dist/lib/{shadow-claw-channel-config-IKiL34tI.js → shadow-claw-channel-config-BNIWCdsL.js} +4 -4
  165. package/dist/lib/{shadow-claw-channel-config-IKiL34tI.js.map → shadow-claw-channel-config-BNIWCdsL.js.map} +1 -1
  166. package/dist/lib/{shadow-claw-channels-JgEzuHWK.js → shadow-claw-channels-C2QSn4Ew.js} +3 -3
  167. package/dist/lib/{shadow-claw-channels-JgEzuHWK.js.map → shadow-claw-channels-C2QSn4Ew.js.map} +1 -1
  168. package/dist/lib/{shadow-claw-chat-SGUDT31r.js → shadow-claw-chat-Wx3y9y6c.js} +15 -15
  169. package/dist/lib/{shadow-claw-chat-SGUDT31r.js.map → shadow-claw-chat-Wx3y9y6c.js.map} +1 -1
  170. package/dist/lib/{shadow-claw-control-plane-CRWFZ3vD.js → shadow-claw-control-plane-D5E4cFGu.js} +7 -7
  171. package/dist/lib/{shadow-claw-control-plane-CRWFZ3vD.js.map → shadow-claw-control-plane-D5E4cFGu.js.map} +1 -1
  172. package/dist/lib/{shadow-claw-conversations-D23GJ7qo.js → shadow-claw-conversations-BtDv7GRW.js} +7 -7
  173. package/dist/lib/{shadow-claw-conversations-D23GJ7qo.js.map → shadow-claw-conversations-BtDv7GRW.js.map} +1 -1
  174. package/dist/lib/{shadow-claw-file-viewer-C1V8WTiU.js → shadow-claw-file-viewer-CG40kwWV.js} +10 -10
  175. package/dist/lib/{shadow-claw-file-viewer-C1V8WTiU.js.map → shadow-claw-file-viewer-CG40kwWV.js.map} +1 -1
  176. package/dist/lib/{shadow-claw-files-DN7irmE1.js → shadow-claw-files-BOUULrlX.js} +11 -11
  177. package/dist/lib/{shadow-claw-files-DN7irmE1.js.map → shadow-claw-files-BOUULrlX.js.map} +1 -1
  178. package/dist/lib/{shadow-claw-git-D-1oIh65.js → shadow-claw-git-BeHV73_9.js} +6 -6
  179. package/dist/lib/{shadow-claw-git-D-1oIh65.js.map → shadow-claw-git-BeHV73_9.js.map} +1 -1
  180. package/dist/lib/{shadow-claw-integrations-CZjnm7cM.js → shadow-claw-integrations-RZZ-m-Id.js} +4 -4
  181. package/dist/lib/{shadow-claw-integrations-CZjnm7cM.js.map → shadow-claw-integrations-RZZ-m-Id.js.map} +1 -1
  182. package/dist/lib/{shadow-claw-llm-4Gefh5FN.js → shadow-claw-llm-KONyWKZM.js} +9 -9
  183. package/dist/lib/{shadow-claw-llm-4Gefh5FN.js.map → shadow-claw-llm-KONyWKZM.js.map} +1 -1
  184. package/dist/lib/{shadow-claw-mcp-remote-B9ssb3YV.js → shadow-claw-mcp-remote-BKFROurv.js} +4 -4
  185. package/dist/lib/{shadow-claw-mcp-remote-B9ssb3YV.js.map → shadow-claw-mcp-remote-BKFROurv.js.map} +1 -1
  186. package/dist/lib/{shadow-claw-networking-BN5BB4hb.js → shadow-claw-networking-Diy3JJkc.js} +2 -2
  187. package/dist/lib/{shadow-claw-networking-BN5BB4hb.js.map → shadow-claw-networking-Diy3JJkc.js.map} +1 -1
  188. package/dist/lib/{shadow-claw-notifications-71KARtkY.js → shadow-claw-notifications-C-upPa-4.js} +3 -3
  189. package/dist/lib/{shadow-claw-notifications-71KARtkY.js.map → shadow-claw-notifications-C-upPa-4.js.map} +1 -1
  190. package/dist/lib/{shadow-claw-page-header-DMGO-TSe.js → shadow-claw-page-header-C_Qr3xZM.js} +2 -2
  191. package/dist/lib/{shadow-claw-page-header-DMGO-TSe.js.map → shadow-claw-page-header-C_Qr3xZM.js.map} +1 -1
  192. package/dist/lib/{shadow-claw-pages-BiRM6qiA.js → shadow-claw-pages-CfAjUKgd.js} +11 -11
  193. package/dist/lib/{shadow-claw-pages-BiRM6qiA.js.map → shadow-claw-pages-CfAjUKgd.js.map} +1 -1
  194. package/dist/lib/{shadow-claw-peerjs-BZu7jNSe.js → shadow-claw-peerjs-t4YibS9s.js} +6 -6
  195. package/dist/lib/{shadow-claw-peerjs-BZu7jNSe.js.map → shadow-claw-peerjs-t4YibS9s.js.map} +1 -1
  196. package/dist/lib/{shadow-claw-provider-model-picker-BXYXEobD.js → shadow-claw-provider-model-picker-B-Ct4yW-.js} +2 -2
  197. package/dist/lib/{shadow-claw-provider-model-picker-BXYXEobD.js.map → shadow-claw-provider-model-picker-B-Ct4yW-.js.map} +1 -1
  198. package/dist/lib/{shadow-claw-settings-CcT5EK08.js → shadow-claw-settings-Cg5V0e9g.js} +7 -7
  199. package/dist/lib/{shadow-claw-settings-CcT5EK08.js.map → shadow-claw-settings-Cg5V0e9g.js.map} +1 -1
  200. package/dist/lib/{shadow-claw-storage-eTOpbvpi.js → shadow-claw-storage-C7tCnsSG.js} +5 -5
  201. package/dist/lib/{shadow-claw-storage-eTOpbvpi.js.map → shadow-claw-storage-C7tCnsSG.js.map} +1 -1
  202. package/dist/lib/{shadow-claw-task-server-DFImTUbw.js → shadow-claw-task-server-BObsRdf8.js} +2 -2
  203. package/dist/lib/{shadow-claw-task-server-DFImTUbw.js.map → shadow-claw-task-server-BObsRdf8.js.map} +1 -1
  204. package/dist/lib/{shadow-claw-tasks-BjaxsmUx.js → shadow-claw-tasks-B2EEqrcY.js} +9 -9
  205. package/dist/lib/{shadow-claw-tasks-BjaxsmUx.js.map → shadow-claw-tasks-B2EEqrcY.js.map} +1 -1
  206. package/dist/lib/{shadow-claw-terminal-C-4wreFe.js → shadow-claw-terminal-DSHfO2b9.js} +2 -2
  207. package/dist/lib/{shadow-claw-terminal-C-4wreFe.js.map → shadow-claw-terminal-DSHfO2b9.js.map} +1 -1
  208. package/dist/lib/{shadow-claw-tools-COdrGZJk.js → shadow-claw-tools-DwPBADua.js} +7 -7
  209. package/dist/lib/{shadow-claw-tools-COdrGZJk.js.map → shadow-claw-tools-DwPBADua.js.map} +1 -1
  210. package/dist/lib/{shadow-claw-webvm-sxqVjO0L.js → shadow-claw-webvm-CY4qGaMB.js} +3 -3
  211. package/dist/lib/{shadow-claw-webvm-sxqVjO0L.js.map → shadow-claw-webvm-CY4qGaMB.js.map} +1 -1
  212. package/dist/lib/{sync-web-mcp-registration-D4hdUwtv.js → sync-web-mcp-registration-BiOZvW-R.js} +6 -6
  213. package/dist/lib/{sync-web-mcp-registration-D4hdUwtv.js.map → sync-web-mcp-registration-BiOZvW-R.js.map} +1 -1
  214. package/dist/lib/{system-prompt-DT_KeYaL.js → system-prompt-CxJ3Nx4c.js} +9 -8
  215. package/dist/lib/system-prompt-CxJ3Nx4c.js.map +1 -0
  216. package/dist/lib/{tools-Beuyh8y1.js → tools-B8OJ4sMF.js} +4 -4
  217. package/dist/lib/{tools-Beuyh8y1.js.map → tools-B8OJ4sMF.js.map} +1 -1
  218. package/dist/lib/{transformers-DydnReu4.js → transformers-BMURofG6.js} +2 -2
  219. package/dist/lib/{transformers-DydnReu4.js.map → transformers-BMURofG6.js.map} +1 -1
  220. package/dist/lib/{trusted-types-CfwZl_rr.js → trusted-types-HwsGS5Nj.js} +19 -17
  221. package/dist/lib/{trusted-types-CfwZl_rr.js.map → trusted-types-HwsGS5Nj.js.map} +1 -1
  222. package/dist/lib/{upload-group-file-BbBzjTcN.js → upload-group-file-CJpoNjEb.js} +3 -3
  223. package/dist/lib/{upload-group-file-BbBzjTcN.js.map → upload-group-file-CJpoNjEb.js.map} +1 -1
  224. package/dist/lib/utils/index.js +1 -1
  225. package/dist/lib/utils/namespaced-storage.js +1 -1
  226. package/dist/lib/utils/runtime-assets.js +1 -1
  227. package/dist/lib/utils/utils.js +1 -1
  228. package/dist/lib/{webmcp-DCfAFiIO.js → webmcp-BoMTvgmX.js} +3 -3
  229. package/dist/lib/{webmcp-DCfAFiIO.js.map → webmcp-BoMTvgmX.js.map} +1 -1
  230. package/dist/lib/{write-group-file-bytes-Ccn-VFUU.js → write-group-file-bytes-CNT7DqOZ.js} +3 -3
  231. package/dist/lib/{write-group-file-bytes-Ccn-VFUU.js.map → write-group-file-bytes-CNT7DqOZ.js.map} +1 -1
  232. package/dist/public/.well-known/mcp/server-card.json +1 -1
  233. package/dist/public/.well-known/mcp.json +1 -1
  234. package/dist/public/AGENTS.md +3 -1
  235. package/dist/public/README.md +6 -2
  236. package/dist/public/agent.worker.js +1 -1
  237. package/dist/public/attachment-capabilities-AdwXt3--.js +1 -0
  238. package/dist/public/{channel-BylT3rJC.js → channel-DIpDQekL.js} +1 -1
  239. package/dist/public/{chat-template-DPHJy7tr.js → chat-template-CXKs8lFR.js} +1 -1
  240. package/dist/public/compact-context-BQ2ZXoAc.js +5 -0
  241. package/dist/public/{compact-context-BINQh64w.js → compact-context-dHitmPsV.js} +2 -2
  242. package/dist/public/config-C16fFWtP.js +1 -0
  243. package/dist/public/{configure-peer-js-DChhcOfe.js → configure-peer-js-DV1rqvFX.js} +1 -1
  244. package/dist/public/{connections-CHaw0VqP.js → connections-Dxwj8yK_.js} +1 -1
  245. package/dist/public/{create-model-cache-fetch-DQebkoPL.js → create-model-cache-fetch-B0mSCEk6.js} +1 -1
  246. package/dist/public/{credentials-CgVqS119.js → credentials-CJUQ5Ep2.js} +1 -1
  247. package/dist/public/{custom-element-security-kiDhPfb8.js → custom-element-security-B2daIE5r.js} +2 -2
  248. package/dist/public/{discover-skills-Cvmx5I9V.js → discover-skills-BWJB8HUA.js} +6 -6
  249. package/dist/public/docs/architecture/overview.md +1 -1
  250. package/dist/public/docs/example/article/index.html +29 -30
  251. package/dist/public/docs/example/article.html +29 -30
  252. package/dist/public/docs/publishing/index.html +29 -30
  253. package/dist/public/docs/publishing.html +29 -30
  254. package/dist/public/docs/skill-creator/index.html +29 -30
  255. package/dist/public/docs/skill-creator.html +29 -30
  256. package/dist/public/docs/subsystems/attachment-capabilities.md +14 -1
  257. package/dist/public/docs/subsystems/cli.md +95 -51
  258. package/dist/public/docs/subsystems/pages.md +5 -0
  259. package/dist/public/{download-group-file-BapoRgfU.js → download-group-file-BkMH-JKi.js} +1 -1
  260. package/dist/public/e2e/README.md +1 -1
  261. package/dist/public/{e2e-bridge-C0g8vZKr.js → e2e-bridge-lP2qqiv3.js} +1 -1
  262. package/dist/public/get-group-dir-D--BiEyk.js +1 -0
  263. package/dist/public/{get-or-create-subscriber-id-GvRZYXwA.js → get-or-create-subscriber-id-jVHnQfbr.js} +1 -1
  264. package/dist/public/{git-CaAAZfVd.js → git-DjmQ16rm.js} +2 -2
  265. package/dist/public/{iframe-bridge-scripts-BnqtKhE4.js → iframe-bridge-scripts-CO0izGjW.js} +1 -1
  266. package/dist/public/index.html +29 -30
  267. package/dist/public/index.js +1 -1
  268. package/dist/public/{init-chat-split-resize-Btonoy8u.js → init-chat-split-resize-C8AqCCiK.js} +1 -1
  269. package/dist/public/init-control-plane-Ctz7FI8M.js +1 -0
  270. package/dist/public/{invoke-agent-B3Osw6K7.js → invoke-agent-C_geruwq.js} +1 -1
  271. package/dist/public/llms.txt +1 -1
  272. package/dist/public/main/index.html +29 -30
  273. package/dist/public/main/memory/index.html +29 -30
  274. package/dist/public/main/memory.html +29 -30
  275. package/dist/public/main.html +29 -30
  276. package/dist/public/{markdown-CPbU4r1U.js → markdown-CDSb5Hrl.js} +1 -1
  277. package/dist/public/{mcp-reconnect-CzROVsXG.js → mcp-reconnect-iPZPihwX.js} +1 -1
  278. package/dist/public/{memory-storage-BkoMlxOr.js → memory-storage-2m7KZ-aP.js} +1 -1
  279. package/dist/public/{model-ranking-CK0iBo3Z.js → model-ranking-BgOSaNIy.js} +1 -1
  280. package/dist/public/{move-group-entry-CTxoq7lw.js → move-group-entry-QQ9Hkk54.js} +1 -1
  281. package/dist/public/{orchestrator-BrDjQbGf.js → orchestrator-C1kaTltu.js} +2 -2
  282. package/dist/public/orchestrator-Li1UAsv7.js +63 -0
  283. package/dist/public/{peerjs-CgF4Iz5W.js → peerjs-DbBryE-9.js} +1 -1
  284. package/dist/public/{process-peer-query-param-BL2k0Hu-.js → process-peer-query-param-DQIgr3KL.js} +1 -1
  285. package/dist/public/{process-pending-shared-payloads-C1AgGvn8.js → process-pending-shared-payloads-Ctb-TFqB.js} +1 -1
  286. package/dist/public/{process-room-query-param-DM0QCq3_.js → process-room-query-param-F-XnIVoZ.js} +1 -1
  287. package/dist/public/provider-YPZmsuHR.js +1 -0
  288. package/dist/public/{push-client-DJEOz7bi.js → push-client-DRx9Eggz.js} +1 -1
  289. package/dist/public/{rooms-C6LXIJl4.js → rooms-BurBI7is.js} +1 -1
  290. package/dist/public/service-worker/init.js +1 -1
  291. package/dist/public/service-worker.js +1 -1
  292. package/dist/public/shadow-claw-Bg9AQ5x_.js +1176 -0
  293. package/dist/public/{shadow-claw-accounts--4hd_oCz.js → shadow-claw-accounts-B3mjYI0M.js} +1 -1
  294. package/dist/public/{shadow-claw-card-IbNlZAdK.js → shadow-claw-card-tcXRS1GF.js} +1 -1
  295. package/dist/public/{shadow-claw-channels-Vq_pPGa2.js → shadow-claw-channels-BiSfLvWv.js} +1 -1
  296. package/dist/public/{shadow-claw-chat-D7_GS25e.js → shadow-claw-chat-N5jMsXZZ.js} +3 -3
  297. package/dist/public/{shadow-claw-control-plane-WTMEV8_p.js → shadow-claw-control-plane-DFVe_Xdq.js} +2 -2
  298. package/dist/public/{shadow-claw-conversations-CLQgU1IT.js → shadow-claw-conversations-wAR06_ya.js} +1 -1
  299. package/dist/public/{shadow-claw-empty-state-D4CrFGsN.js → shadow-claw-empty-state-CnPm3NVM.js} +1 -1
  300. package/dist/public/{shadow-claw-file-viewer-BhqiqLWQ.js → shadow-claw-file-viewer-sZN_FCDW.js} +4 -4
  301. package/dist/public/{shadow-claw-files-senDiG9l.js → shadow-claw-files-CnvkCbd4.js} +2 -2
  302. package/dist/public/{shadow-claw-git-DOOCqY23.js → shadow-claw-git-BBHfClGk.js} +2 -2
  303. package/dist/public/{shadow-claw-integrations-Bsvc3Agq.js → shadow-claw-integrations-DvdBqzRJ.js} +1 -1
  304. package/dist/public/{shadow-claw-llm-actYICAk.js → shadow-claw-llm-YfohG519.js} +2 -2
  305. package/dist/public/{shadow-claw-mcp-remote-BYUgrK3v.js → shadow-claw-mcp-remote-BAVbf5pi.js} +1 -1
  306. package/dist/public/{shadow-claw-networking-Dk3p5Ny_.js → shadow-claw-networking-CZ4LWPW7.js} +1 -1
  307. package/dist/public/{shadow-claw-notifications-CzPAlay8.js → shadow-claw-notifications-BHwyREkG.js} +1 -1
  308. package/dist/public/{shadow-claw-page-header-CjJpVkyL.js → shadow-claw-page-header-De6Qf6eY.js} +1 -1
  309. package/dist/public/{shadow-claw-page-header-action-button-2DH5O1TD.js → shadow-claw-page-header-action-button-FSOhTc9z.js} +1 -1
  310. package/dist/public/{shadow-claw-pages-3r5I-wI8.js → shadow-claw-pages-D_oPyDca.js} +6 -6
  311. package/dist/public/{shadow-claw-pdf-viewer-BiCEwsoY.js → shadow-claw-pdf-viewer-CrU4wqRq.js} +1 -1
  312. package/dist/public/{shadow-claw-settings-DgB9RSZN.js → shadow-claw-settings-DkUhvxVr.js} +2 -2
  313. package/dist/public/{shadow-claw-storage-JB_43nd8.js → shadow-claw-storage-D0o56Tjw.js} +1 -1
  314. package/dist/public/{shadow-claw-task-server-oi5UIxdA.js → shadow-claw-task-server-4rkroO9K.js} +1 -1
  315. package/dist/public/{shadow-claw-tasks-CnyiOt81.js → shadow-claw-tasks-BdP7lmvu.js} +3 -3
  316. package/dist/public/{shadow-claw-terminal-BC3RynHt.js → shadow-claw-terminal-DVHX7Fsu.js} +1 -1
  317. package/dist/public/{shadow-claw-toast-YjG--2Za.js → shadow-claw-toast-B9Y9tSkW.js} +1 -1
  318. package/dist/public/{shadow-claw-tools-Bbwk4vlT.js → shadow-claw-tools-BwwY53Lr.js} +1 -1
  319. package/dist/public/{shadow-claw-webvm-HZqzl2H5.js → shadow-claw-webvm-CXGdkCNM.js} +1 -1
  320. package/dist/public/{sync-web-mcp-registration-BaH2nAP0.js → sync-web-mcp-registration-DVK_IhXZ.js} +1 -1
  321. package/dist/public/{system-prompt-Dck3N8T0.js → system-prompt-BmswoQwF.js} +2 -2
  322. package/dist/public/{tools-DHA1dK2I.js → tools-D-52Zmfc.js} +1 -1
  323. package/dist/public/{transformers-C-DuTM2K.js → transformers-CQ9ss9rD.js} +1 -1
  324. package/dist/public/{upload-group-file-Cejr3zo1.js → upload-group-file-A8kB7lvO.js} +1 -1
  325. package/dist/public/{webmcp-CMRtu57-.js → webmcp-DIUZjVF5.js} +1 -1
  326. package/dist/public/{workbox-92eae37e.js → workbox-e4022e15.js} +1 -1
  327. package/dist/public/{write-group-file-CmJuVQNO.js → write-group-file-R67DjJ-q.js} +1 -1
  328. package/dist/public/{write-group-file-bytes-Cejr3zo1.js → write-group-file-bytes-A8kB7lvO.js} +1 -1
  329. package/dist/public/{zip-reader-CuQ13eLe.js → zip-reader-JHoTbATw.js} +1 -1
  330. package/dist/server.js +6 -6
  331. package/package.json +1 -1
  332. package/dist/cli/chunk-2gZFafgY.js +0 -1
  333. package/dist/cli/chunk-BFziiMKt.js +0 -7
  334. package/dist/cli/chunk-BM3llsxb.js +0 -1
  335. package/dist/cli/chunk-BUNoeMKY.js +0 -36
  336. package/dist/cli/chunk-Bj5qFsDi.js +0 -7
  337. package/dist/cli/chunk-Bj95zm-y.js +0 -1
  338. package/dist/cli/chunk-BpyP-esT.js +0 -1
  339. package/dist/cli/chunk-CX696s3_.js +0 -1
  340. package/dist/cli/chunk-DRxCrCAA.js +0 -139
  341. package/dist/cli/chunk-DjbCHa0h.js +0 -1
  342. package/dist/cli/chunk-Ds5-K-9o.js +0 -1
  343. package/dist/cli/chunk-DsQhAF31.js +0 -1
  344. package/dist/cli/chunk-VM-dECyG.js +0 -1
  345. package/dist/cli/chunk-gvNsvav0.js +0 -225
  346. package/dist/cli/chunk-heu2xRw1.js +0 -1
  347. package/dist/lib/orchestrator-i_QJ-o22.js.map +0 -1
  348. package/dist/lib/shadow-claw-DoQ7fgl5.js.map +0 -1
  349. package/dist/lib/system-prompt-DT_KeYaL.js.map +0 -1
  350. package/dist/public/app-routes-V_-URXc5.js +0 -1
  351. package/dist/public/attachment-capabilities-B6ibLwQB.js +0 -1
  352. package/dist/public/compact-context-CX4H8V57.js +0 -5
  353. package/dist/public/config-C-YdSFZB.js +0 -1
  354. package/dist/public/get-group-dir-DL44kvqW.js +0 -1
  355. package/dist/public/init-control-plane-BoJijVtf.js +0 -1
  356. package/dist/public/orchestrator-CaUpEVkQ.js +0 -63
  357. package/dist/public/provider-DNIL4-Hw.js +0 -1
  358. package/dist/public/shadow-claw-DdgeYPg5.js +0 -1176
@@ -0,0 +1,310 @@
1
+ import{t as e}from"./chunk-uAI_Zi6n.js";import{C as t,E as n,S as r,T as i,_ as a,a as o,b as s,d as c,f as l,g as u,h as d,i as f,l as p,m,o as h,p as g,r as _,t as v,w as y,x as b,y as ee}from"./chunk-Di6Kyrgh.js";import{i as te,r as x,t as S}from"./chunk-4-QO2z6r.js";import{a as C,i as ne,o as w,s as T}from"./chunk-B409KI5N.js";import{n as re}from"./chunk-kF1oe5Yi.js";import*as E from"node:fs";import D,{basename as ie,dirname as ae,join as O,posix as oe,relative as se,resolve as ce,win32 as le}from"node:path";import{fileURLToPath as k}from"node:url";import A,{chdir as ue,env as de,exit as fe}from"node:process";import{execSync as pe}from"node:child_process";import{copyFile as j,cp as M,lstat as me,mkdir as N,readFile as P,readdir as he,readlink as ge,realpath as _e,rm as ve,stat as ye,writeFile as F}from"node:fs/promises";import{createHash as be}from"node:crypto";import{chmodSync as xe,lstatSync as Se,lstatSync as Ce,readdir as we,readdirSync as Te,readlinkSync as Ee,realpathSync as De,renameSync as Oe,rmSync as ke,rmdirSync as Ae,statSync as je,unlinkSync as Me}from"fs";import{EventEmitter as Ne}from"node:events";import Pe from"node:stream";import{StringDecoder as Fe}from"node:string_decoder";import{basename as Ie,parse as I,resolve as Le}from"path";import{inspect as Re}from"util";import ze from"fs/promises";import{setTimeout as Be}from"timers/promises";import{tmpdir as L}from"os";import Ve from"gray-matter";var He=(e,t,n)=>{let r=e instanceof RegExp?Ue(e,n):e,i=t instanceof RegExp?Ue(t,n):t,a=r!==null&&i!=null&&We(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},Ue=(e,t)=>{let n=t.match(e);return n?n[0]:null},We=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Ge=`\0SLASH`+Math.random()+`\0`,Ke=`\0OPEN`+Math.random()+`\0`,qe=`\0CLOSE`+Math.random()+`\0`,Je=`\0COMMA`+Math.random()+`\0`,Ye=`\0PERIOD`+Math.random()+`\0`,Xe=new RegExp(Ge,`g`),Ze=new RegExp(Ke,`g`),Qe=new RegExp(qe,`g`),$e=new RegExp(Je,`g`),et=new RegExp(Ye,`g`),tt=/\\\\/g,nt=/\\{/g,rt=/\\}/g,it=/\\,/g,at=/\\./g,ot=1e5;function st(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function ct(e){return e.replace(tt,Ge).replace(nt,Ke).replace(rt,qe).replace(it,Je).replace(at,Ye)}function lt(e){return e.replace(Xe,`\\`).replace(Ze,`{`).replace(Qe,`}`).replace($e,`,`).replace(et,`.`)}function ut(e){if(!e)return[``];let t=[],n=He(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=ut(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function dt(e,t={}){if(!e)return[];let{max:n=ot}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),gt(ct(e),n,!0).map(lt)}function ft(e){return`{`+e+`}`}function pt(e){return/^-?0\d/.test(e)}function mt(e,t){return e<=t}function ht(e,t){return e>=t}function gt(e,t,n){let r=[],i=He(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?gt(i.post,t,!1):[``];if(/\$$/.test(i.pre))for(let e=0;e<o.length&&e<t;e++){let t=a+`{`+i.body+`}`+o[e];r.push(t)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=s||c,u=i.body.indexOf(`,`)>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+qe+i.post,gt(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=ut(i.body),d.length===1&&d[0]!==void 0&&(d=gt(d[0],t,!1).map(ft),d.length===1))return o.map(e=>i.pre+d[0]+e);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let e=st(d[0]),t=st(d[1]),n=Math.max(d[0].length,d[1].length),r=d.length===3&&d[2]!==void 0?Math.abs(st(d[2])):1,i=mt;t<e&&(r*=-1,i=ht);let a=d.some(pt);f=[];for(let o=e;i(o,t);o+=r){let e;if(c)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,gt(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<o.length&&r.length<t;i++){let t=a+f[e]+o[i];(!n||l||t)&&r.push(t)}}return r}var _t=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},vt={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},yt=e=>e.replace(/[[\]\\-]/g,`\\$&`),bt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),xt=e=>e.join(``),St=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;t:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1)l=!0,a++;else{if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c)c=!0,a++;else{if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(vt))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue t}}c=!1,d?(t>d?r.push(yt(d)+`-`+yt(t)):t===d&&r.push(yt(t)),d=``,a++):e.startsWith(`-]`,a+1)?(r.push(yt(t+`-`)),a+=2):e.startsWith(`-`,a+1)?(d=t,a+=2):(r.push(yt(t)),a++)}}}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[bt(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+xt(r)+`]`,p=`[`+(l?``:`^`)+xt(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},Ct=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`):t?e.replace(/\[([^\/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,`$1$2`).replace(/\\([^\/{}])/g,`$1`),wt=/* @__PURE__ */ new Set([`!`,`?`,`+`,`*`,`@`]),Tt=e=>wt.has(e),Et=`(?!(?:^|/)\\.\\.?(?:$|/))`,Dt=`(?!\\.)`,Ot=/* @__PURE__ */ new Set([`[`,`.`]),kt=/* @__PURE__ */ new Set([`..`,`.`]),At=/* @__PURE__ */ new Set(`().*{}+?[]^$\\!`),jt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Mt=`[^/]`,Nt=Mt+`*?`,Pt=Mt+`+?`,Ft=class e{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.#l=this.type?this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...t){for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let n=0;n<this.#a;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#f(t,n,r,i){let a=!1,o=!1,s=-1,c=!1;if(n.type===null){let l=r,u=``;for(;l<t.length;){let r=t.charAt(l++);if(a||r===`\\`)a=!a,u+=r;else if(o)l===s+1?(r===`^`||r===`!`)&&(c=!0):r===`]`&&!(l===s+2&&c)&&(o=!1),u+=r;else if(r===`[`)o=!0,s=l,c=!1,u+=r;else if(!i.noext&&Tt(r)&&t.charAt(l)===`(`){n.push(u),u=``;let a=new e(r,n);l=e.#f(t,a,l,i),n.push(a)}else u+=r}return n.push(u),l}let l=r+1,u=new e(null,n),d=[],f=``;for(;l<t.length;){let r=t.charAt(l++);if(a||r===`\\`)a=!a,f+=r;else if(o)l===s+1?(r===`^`||r===`!`)&&(c=!0):r===`]`&&!(l===s+2&&c)&&(o=!1),f+=r;else if(r===`[`)o=!0,s=l,c=!1,f+=r;else if(Tt(r)&&t.charAt(l)===`(`){u.push(f),f=``;let n=new e(r,u);u.push(n),l=e.#f(t,n,l,i)}else if(r===`|`)u.push(f),f=``,d.push(u),u=new e(null,n);else{if(r===`)`)return f===``&&n.#r.length===0&&(n.#u=!0),u.push(f),f=``,n.push(...d,u),l;f+=r}}return n.type=null,n.#t=void 0,n.#r=[t.substring(r-1)],l}static fromGlob(t,n={}){let r=new e(null,void 0,n);return e.#f(t,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(t){let n=t??!!this.#c.dot;if(this.#e===this&&this.#d(),!this.type){let r=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),i=this.#r.map(n=>{let[i,a,o,s]=typeof n==`string`?e.#m(n,this.#t,r):n.toRegExpSource(t);return this.#t=this.#t||o,this.#n=this.#n||s,i}).join(``),a=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&kt.has(this.#r[0]))){let e=Ot,r=n&&e.has(i.charAt(0))||i.startsWith(`\\.`)&&e.has(i.charAt(2))||i.startsWith(`\\.\\.`)&&e.has(i.charAt(4)),o=!n&&!t&&e.has(i.charAt(0));a=r?Et:o?Dt:``}let o=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(o=`(?:$|\\/)`),[a+i+o,Ct(i),this.#t=!!this.#t,this.#n]}let r=this.type===`*`||this.type===`+`,i=this.type===`!`?`(?:(?!(?:`:`(?:`,a=this.#p(n);if(this.isStart()&&this.isEnd()&&!a&&this.type!==`!`){let e=this.toString();return this.#r=[e],this.type=null,this.#t=void 0,[e,Ct(this.toString()),!1,!1]}let o=!r||t||n||!Dt?``:this.#p(!0);o===a&&(o=``),o&&(a=`(?:${a})(?:${o})*?`);let s=``;if(this.type===`!`&&this.#u)s=(this.isStart()&&!n?Dt:``)+Pt;else{let e=this.type===`!`?`))`+(this.isStart()&&!n&&!t?Dt:``)+Nt+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&o?`)`:this.type===`*`&&o?`)?`:`)${this.type}`;s=i+a+e}return[s,Ct(a),this.#t=!!this.#t,this.#n]}#p(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#m(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r)r=!1,i+=(At.has(c)?`\\`:``)+c;else if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?Pt:Nt,t=!0}else if(o=!1,c===`\\`)s===e.length-1?i+=`\\\\`:r=!0;else{if(c===`[`){let[n,r,o,c]=St(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}c===`?`?(i+=Mt,t=!0):i+=jt(c)}}return[i,Ct(e),!!t,a]}},It=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),R=(e,t,n={})=>(_t(t),!n.nocomment&&t.charAt(0)===`#`?!1:new pn(t,n).match(e)),Lt=/^\*+([^+@!?\*\[\(]*)$/,Rt=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),zt=e=>t=>t.endsWith(e),Bt=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Vt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Ht=/^\*+\.\*+$/,Ut=e=>!e.startsWith(`.`)&&e.includes(`.`),Wt=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Gt=/^\.\*+$/,Kt=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),qt=/^\*+$/,Jt=e=>e.length!==0&&!e.startsWith(`.`),Yt=e=>e.length!==0&&e!==`.`&&e!==`..`,Xt=/^\?+([^+@!?\*\[\(]*)?$/,Zt=([e,t=``])=>{let n=tn([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Qt=([e,t=``])=>{let n=nn([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},$t=([e,t=``])=>{let n=nn([e]);return t?e=>n(e)&&e.endsWith(t):n},en=([e,t=``])=>{let n=tn([e]);return t?e=>n(e)&&e.endsWith(t):n},tn=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},nn=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},rn=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,an={win32:{sep:`\\`},posix:{sep:`/`}};R.sep=rn===`win32`?an.win32.sep:an.posix.sep;var z=Symbol(`globstar **`);R.GLOBSTAR=z;var on=`[^/]*?`,sn=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,cn=`(?:(?!(?:\\/|^)\\.).)*?`;R.filter=(e,t={})=>n=>R(n,e,t);var ln=(e,t={})=>Object.assign({},e,t);R.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return R;let t=R;return Object.assign((n,r,i={})=>t(n,r,ln(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,ln(e,n))}static defaults(n){return t.defaults(ln(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,ln(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,ln(e,r))}},unescape:(n,r={})=>t.unescape(n,ln(e,r)),escape:(n,r={})=>t.escape(n,ln(e,r)),filter:(n,r={})=>t.filter(n,ln(e,r)),defaults:n=>t.defaults(ln(e,n)),makeRe:(n,r={})=>t.makeRe(n,ln(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,ln(e,r)),match:(n,r,i={})=>t.match(n,r,ln(e,i)),sep:t.sep,GLOBSTAR:z})};var un=(e,t={})=>(_t(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:dt(e,{max:t.braceExpandMax}));R.braceExpand=un,R.makeRe=(e,t={})=>new pn(e,t).makeRe(),R.match=(e,t,n={})=>{let r=new pn(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var dn=/[?*]|[+@!]\(.*?\)|\[|\]/,fn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),pn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){_t(e),t||={},this.options=t,this.pattern=e,this.platform=t.platform||rn,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!dn.test(e[2]))&&!dn.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=this.options;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),r=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),i=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),a=!i&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),o=r?3:n?0:void 0,s=a?3:i?0:void 0;if(typeof o==`number`&&typeof s==`number`){let[n,r]=[e[o],t[s]];n.toLowerCase()===r.toLowerCase()&&(t[s]=n,s>o?t=t.slice(s):o>s&&(e=e.slice(o)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug(`matchOne`,this,{file:e,pattern:t}),this.debug(`matchOne`,e.length,t.length);for(var a=0,o=0,s=e.length,c=t.length;a<s&&o<c;a++,o++){this.debug(`matchOne loop`);var l=t[o],u=e[a];if(this.debug(t,l,u),l===!1)return!1;if(l===z){this.debug(`GLOBSTAR`,[t,l,u]);var d=a,f=o+1;if(f===c){for(this.debug(`** at the end`);a<s;a++)if(e[a]===`.`||e[a]===`..`||!r.dot&&e[a].charAt(0)===`.`)return!1;return!0}for(;d<s;){var p=e[d];if(this.debug(`
2
+ globstar while`,e,d,t,f,p),this.matchOne(e.slice(d),t.slice(f),n))return this.debug(`globstar found match!`,d,s,p),!0;if(p===`.`||p===`..`||!r.dot&&p.charAt(0)===`.`){this.debug(`dot detected!`,e,d,t,f);break}this.debug(`globstar swallow a segment, and continue`),d++}return!!(n&&(this.debug(`
3
+ >>> no match, partial?`,e,d,t,f),d===s))}let i;if(typeof l==`string`?(i=u===l,this.debug(`string match`,l,u,i)):(i=l.test(u),this.debug(`pattern match`,l,u,i)),!i)return!1}if(a===s&&o===c)return!0;if(a===s)return n;if(o===c)return a===s-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return un(this.pattern,this.options)}parse(e){_t(e);let t=this.options;if(e===`**`)return z;if(e===``)return``;let n,r=null;(n=e.match(qt))?r=t.dot?Yt:Jt:(n=e.match(Lt))?r=(t.nocase?t.dot?Vt:Bt:t.dot?zt:Rt)(n[1]):(n=e.match(Xt))?r=(t.nocase?t.dot?Qt:Zt:t.dot?$t:en)(n):(n=e.match(Ht))?r=t.dot?Wt:Ut:(n=e.match(Gt))&&(r=Kt);let i=Ft.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?on:t.dot?sn:cn,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?fn(e):e===z?z:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==z||a===z||(a===void 0?i!==void 0&&i!==z?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==z&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=z))});let i=t.filter(e=>e!==z);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return R.defaults(e).Minimatch}};R.AST=Ft,R.Minimatch=pn,R.escape=It,R.unescape=Ct;var mn=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,hn=/* @__PURE__ */ new Set,gn=typeof process==`object`&&process?process:{},_n=(e,t,n,r)=>{typeof gn.emitWarning==`function`?gn.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},vn=globalThis.AbortController,yn=globalThis.AbortSignal;if(typeof vn>`u`){yn=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},vn=class{constructor(){t()}signal=new yn;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=gn.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,_n("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}var bn=e=>!hn.has(e),xn=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Sn=e=>xn(e)?e<=256?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?Cn:null:null,Cn=class extends Array{constructor(e){super(e),this.fill(0)}},wn=class e{heap;length;static#e=!1;static create(t){let n=Sn(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Tn=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#V(t),backgroundFetch:(t,n,r,i)=>e.#B(t,n,r,i),moveToTail:t=>e.#U(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:h=0,sizeCalculation:g,fetchMethod:_,memoMethod:v,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:ee,allowStaleOnFetchAbort:te,ignoreFetchAbort:x,perf:S}=t;if(S!==void 0&&typeof S?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=S??mn,n!==0&&!xn(n))throw TypeError(`max option must be a nonnegative integer`);let C=n?Sn(n):Array;if(!C)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=m,this.maxEntrySize=h||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(v!==void 0&&typeof v!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=v,_!==void 0&&typeof _!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=_,this.#w=!!_,this.#u=/* @__PURE__ */ new Map,this.#d=Array(n).fill(void 0),this.#f=Array(n).fill(void 0),this.#p=new C(n),this.#m=new C(n),this.#h=0,this.#g=0,this.#_=wn.create(n),this.#c=0,this.#l=0,typeof l==`function`&&(this.#n=l),typeof u==`function`&&(this.#r=u),typeof d==`function`?(this.#i=d,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!ee,this.allowStaleOnFetchAbort=!!te,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#t!==0&&!xn(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!xn(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=xn(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!xn(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;bn(t)&&(hn.add(t),_n(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new Cn(this.#e),t=new Cn(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array(this.#e):void 0;this.#S=n,this.#A=(r,i,a=this.#s.now())=>{if(t[r]=i===0?0:a,e[r]=i,n?.[r]&&(clearTimeout(n[r]),n[r]=void 0),i!==0&&n){let e=setTimeout(()=>{this.#j(r)&&this.#W(this.#d[r],`expire`)},i+1);e.unref&&e.unref(),n[r]=e}},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now()},this.#k=(n,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;n.ttl=o,n.start=s,n.now=r||i(),n.remainingTTL=o-(n.now-s)}};let r=0,i=()=>{let e=this.#s.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{let a=this.#u.get(n);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((r||i())-s)},this.#j=n=>{let a=t[n],o=e[n];return!!o&&!!a&&(r||i())-a>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new Cn(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(this.#V(t))return 0;if(!xn(n)){if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!xn(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#z(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;!(!this.#R(t)||((e||!this.#j(t))&&(yield t),t===this.#h));)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;!(!this.#R(t)||((e||!this.#j(t))&&(yield t),t===this.#g));)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#V(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#V(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#V(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#V(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#V(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#V(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.get(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#W(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#V(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#V(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#F(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#W(e,`set`),this;let u=this.#c===0?void 0:this.#u.get(e);if(u===void 0)u=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#z(!1):this.#c:this.#_.pop(),this.#d[u]=e,this.#f[u]=t,this.#u.set(e,u),this.#p[this.#g]=u,this.#m[u]=this.#g,this.#g=u,this.#c++,this.#P(u,l,s),s&&(s.set=`add`),c=!1,this.#E&&this.#r?.(t,e,`add`);else{this.#U(u);let n=this.#f[u];if(t!==n){if(this.#w&&this.#V(n)){n.__abortController.abort(/* @__PURE__ */ Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#C&&this.#n?.(t,e,`set`),this.#T&&this.#v?.push([t,e,`set`]))}else a||(this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`]));if(this.#N(u),this.#P(u,l,s),this.#f[u]=t,s){s.set=`replace`;let e=n&&this.#V(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#E&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#x&&this.#D(),this.#x&&(c||this.#A(u,r,i),s&&this.#k(s,u)),!a&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#z(!0),this.#V(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#z(e){let t=this.#h,n=this.#d[t],r=this.#f[t];return this.#w&&this.#V(r)?r.__abortController.abort(/* @__PURE__ */ Error(`evicted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(r,n,`evict`),this.#T&&this.#v?.push([r,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#V(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#u.get(e);if(r===void 0||!n&&this.#j(r))return;let i=this.#f[r];return this.#V(i)?i.__staleWhileFetching:i}#B(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#V(i))return i;let a=new vn,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason,l);let d=f,p=this.#f[t];return(p===f||c&&i&&p===void 0)&&(r===void 0?d.__staleWhileFetching===void 0?this.#W(e,`fetch`):this.#f[t]=d.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e,!1)),u=(r,i)=>{let{aborted:o}=a.signal,s=o&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=f;if(this.#f[t]===f&&(!l||!i&&u.__staleWhileFetching===void 0?this.#W(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},d=(t,r)=>{let o=this.#a?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=p,p}#V(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof vn}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#w)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#B(e,y,v,m);return t.__returned=t}{let t=this.#f[y];if(this.#V(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#U(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#B(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o!==void 0){let t=this.#f[o],s=this.#V(t);return a&&this.#k(a,o),this.#j(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#W(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#U(o),r&&this.#O(o),t))}a&&(a.get=`miss`)}#H(e,t){this.#m[t]=e,this.#p[e]=t}#U(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#H(this.#m[e],this.#p[e]),this.#H(this.#g,e),this.#g=e)}delete(e){return this.#W(e,`delete`)}#W(e,t){let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0){if(this.#S?.[r]&&(clearTimeout(this.#S?.[r]),this.#S[r]=void 0),n=!0,this.#c===1)this.#G(t);else{this.#N(r);let n=this.#f[r];if(this.#V(n)?n.__abortController.abort(/* @__PURE__ */ Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(n,e,t),this.#T&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#G(`delete`)}#G(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#V(n))n.__abortController.abort(/* @__PURE__ */ Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}},En=typeof process==`object`&&process?process:{stdout:null,stderr:null},Dn=e=>!!e&&typeof e==`object`&&(e instanceof lr||e instanceof Pe||On(e)||kn(e)),On=e=>!!e&&typeof e==`object`&&e instanceof Ne&&typeof e.pipe==`function`&&e.pipe!==Pe.Writable.prototype.pipe,kn=e=>!!e&&typeof e==`object`&&e instanceof Ne&&typeof e.write==`function`&&typeof e.end==`function`,An=Symbol(`EOF`),jn=Symbol(`maybeEmitEnd`),Mn=Symbol(`emittedEnd`),Nn=Symbol(`emittingEnd`),Pn=Symbol(`emittedError`),Fn=Symbol(`closed`),In=Symbol(`read`),Ln=Symbol(`flush`),Rn=Symbol(`flushChunk`),zn=Symbol(`encoding`),Bn=Symbol(`decoder`),B=Symbol(`flowing`),Vn=Symbol(`paused`),Hn=Symbol(`resume`),V=Symbol(`buffer`),H=Symbol(`pipes`),U=Symbol(`bufferLength`),Un=Symbol(`bufferPush`),Wn=Symbol(`bufferShift`),W=Symbol(`objectMode`),G=Symbol(`destroyed`),Gn=Symbol(`error`),Kn=Symbol(`emitData`),qn=Symbol(`emitEnd`),Jn=Symbol(`emitEnd2`),Yn=Symbol(`async`),Xn=Symbol(`abort`),Zn=Symbol(`aborted`),Qn=Symbol(`signal`),$n=Symbol(`dataListeners`),K=Symbol(`discarded`),er=e=>Promise.resolve().then(e),tr=e=>e(),nr=e=>e===`end`||e===`finish`||e===`prefinish`,rr=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,ir=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),ar=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Hn](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},or=class extends ar{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}},sr=e=>!!e.objectMode,cr=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`,lr=class extends Ne{[B]=!1;[Vn]=!1;[H]=[];[V]=[];[W];[zn];[Yn];[Bn];[An]=!1;[Mn]=!1;[Nn]=!1;[Fn]=!1;[Pn]=null;[U]=0;[G]=!1;[Qn];[Zn]=!1;[$n]=0;[K]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);sr(t)?(this[W]=!0,this[zn]=null):cr(t)?(this[zn]=t.encoding,this[W]=!1):(this[W]=!1,this[zn]=null),this[Yn]=!!t.async,this[Bn]=this[zn]?new Fe(this[zn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[V]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[H]});let{signal:n}=t;n&&(this[Qn]=n,n.aborted?this[Xn]():n.addEventListener(`abort`,()=>this[Xn]()))}get bufferLength(){return this[U]}get encoding(){return this[zn]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[W]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[Yn]}set async(e){this[Yn]=this[Yn]||!!e}[Xn](){this[Zn]=!0,this.emit(`abort`,this[Qn]?.reason),this.destroy(this[Qn]?.reason)}get aborted(){return this[Zn]}set aborted(e){}write(e,t,n){if(this[Zn])return!1;if(this[An])throw Error(`write after end`);if(this[G])return this.emit(`error`,Object.assign(/* @__PURE__ */ Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[Yn]?er:tr;if(!this[W]&&!Buffer.isBuffer(e)){if(ir(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(rr(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[W]?(this[B]&&this[U]!==0&&this[Ln](!0),this[B]?this.emit(`data`,e):this[Un](e),this[U]!==0&&this.emit(`readable`),n&&r(n),this[B]):e.length?(typeof e==`string`&&(t!==this[zn]||this[Bn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zn]&&(e=this[Bn].write(e)),this[B]&&this[U]!==0&&this[Ln](!0),this[B]?this.emit(`data`,e):this[Un](e),this[U]!==0&&this.emit(`readable`),n&&r(n),this[B]):(this[U]!==0&&this.emit(`readable`),n&&r(n),this[B])}read(e){if(this[G])return null;if(this[K]=!1,this[U]===0||e===0||e&&e>this[U])return this[jn](),null;this[W]&&(e=null),this[V].length>1&&!this[W]&&(this[V]=[this[zn]?this[V].join(``):Buffer.concat(this[V],this[U])]);let t=this[In](e||null,this[V][0]);return this[jn](),t}[In](e,t){if(this[W])this[Wn]();else{let n=t;e===n.length||e===null?this[Wn]():typeof n==`string`?(this[V][0]=n.slice(e),t=n.slice(0,e),this[U]-=e):(this[V][0]=n.subarray(e),t=n.subarray(0,e),this[U]-=e)}return this.emit(`data`,t),!this[V].length&&!this[An]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[An]=!0,this.writable=!1,(this[B]||!this[Vn])&&this[jn](),this}[Hn](){this[G]||(!this[$n]&&!this[H].length&&(this[K]=!0),this[Vn]=!1,this[B]=!0,this.emit(`resume`),this[V].length?this[Ln]():this[An]?this[jn]():this.emit(`drain`))}resume(){return this[Hn]()}pause(){this[B]=!1,this[Vn]=!0,this[K]=!1}get destroyed(){return this[G]}get flowing(){return this[B]}get paused(){return this[Vn]}[Un](e){this[W]?this[U]+=1:this[U]+=e.length,this[V].push(e)}[Wn](){return this[W]?--this[U]:this[U]-=this[V][0].length,this[V].shift()}[Ln](e=!1){do;while(this[Rn](this[Wn]())&&this[V].length);!e&&!this[V].length&&!this[An]&&this.emit(`drain`)}[Rn](e){return this.emit(`data`,e),this[B]}pipe(e,t){if(this[G])return e;this[K]=!1;let n=this[Mn];return t||={},e===En.stdout||e===En.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[H].push(t.proxyErrors?new or(this,e,t):new ar(this,e,t)),this[Yn]?er(()=>this[Hn]()):this[Hn]()),e}unpipe(e){let t=this[H].find(t=>t.dest===e);t&&(this[H].length===1?(this[B]&&this[$n]===0&&(this[B]=!1),this[H]=[]):this[H].splice(this[H].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[K]=!1,this[$n]++,!this[H].length&&!this[B]&&this[Hn]();else if(e===`readable`&&this[U]!==0)super.emit(`readable`);else if(nr(e)&&this[Mn])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[Pn]){let e=t;this[Yn]?er(()=>e.call(this,this[Pn])):e.call(this,this[Pn])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[$n]=this.listeners(`data`).length,this[$n]===0&&!this[K]&&!this[H].length&&(this[B]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[$n]=0,!this[K]&&!this[H].length&&(this[B]=!1)),t}get emittedEnd(){return this[Mn]}[jn](){!this[Nn]&&!this[Mn]&&!this[G]&&this[V].length===0&&this[An]&&(this[Nn]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[Fn]&&this.emit(`close`),this[Nn]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==G&&this[G])return!1;if(e===`data`)return!this[W]&&!n?!1:this[Yn]?(er(()=>this[Kn](n)),!0):this[Kn](n);if(e===`end`)return this[qn]();if(e===`close`){if(this[Fn]=!0,!this[Mn]&&!this[G])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}if(e===`error`){this[Pn]=n,super.emit(Gn,n);let e=!this[Qn]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[jn](),e}if(e===`resume`){let e=super.emit(`resume`);return this[jn](),e}if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[jn](),r}[Kn](e){for(let t of this[H])t.dest.write(e)===!1&&this.pause();let t=!this[K]&&super.emit(`data`,e);return this[jn](),t}[qn](){return!this[Mn]&&(this[Mn]=!0,this.readable=!1,this[Yn]?(er(()=>this[Jn]()),!0):this[Jn]())}[Jn](){if(this[Bn]){let e=this[Bn].end();if(e){for(let t of this[H])t.dest.write(e);this[K]||super.emit(`data`,e)}}for(let e of this[H])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[W]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[W]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[W])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[zn]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(G,()=>t(/* @__PURE__ */ Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[K]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[An])return t();let r,i,a=e=>{this.off(`data`,o),this.off(`end`,s),this.off(G,c),t(),i(e)},o=e=>{this.off(`error`,a),this.off(`end`,s),this.off(G,c),this.pause(),r({value:e,done:!!this[An]})},s=()=>{this.off(`error`,a),this.off(`data`,o),this.off(G,c),t(),r({done:!0,value:void 0})},c=()=>a(/* @__PURE__ */ Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(G,c),this.once(`error`,a),this.once(`end`,s),this.once(`data`,o)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[K]=!1;let e=!1,t=()=>(this.pause(),this.off(Gn,t),this.off(G,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(Gn,t),this.once(G,t),{next:()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[G])return e?this.emit(`error`,e):this.emit(G),this;this[G]=!0,this[K]=!0,this[V].length=0,this[U]=0;let t=this;return typeof t.close==`function`&&!this[Fn]&&t.close(),e?this.emit(`error`,e):this.emit(G),this}static get isStream(){return Dn}},ur=De.native,dr={lstatSync:Se,readdir:we,readdirSync:Te,readlinkSync:Ee,realpathSync:ur,promises:{lstat:me,readdir:he,readlink:ge,realpath:_e}},fr=e=>!e||e===dr||e===E?dr:{...dr,...e,promises:{...dr.promises,...e.promises||{}}},pr=/^\\\\\?\\([a-z]:)\\?$/i,mr=e=>e.replace(/\//g,`\\`).replace(pr,`$1\\`),hr=/[\\\/]/,gr=0,_r=1,vr=2,yr=4,br=6,xr=8,Sr=10,Cr=12,wr=15,Tr=~wr,Er=16,Dr=32,Or=64,kr=128,Ar=256,jr=512,Mr=Or|kr|jr,Nr=1023,Pr=e=>e.isFile()?xr:e.isDirectory()?yr:e.isSymbolicLink()?Sr:e.isCharacterDevice()?vr:e.isBlockDevice()?br:e.isSocket()?Cr:e.isFIFO()?_r:gr,Fr=new Tn({max:4096}),Ir=e=>{let t=Fr.get(e);if(t)return t;let n=e.normalize(`NFKD`);return Fr.set(e,n),n},Lr=new Tn({max:4096}),Rr=e=>{let t=Lr.get(e);if(t)return t;let n=Ir(e.toLowerCase());return Lr.set(e,n),n},zr=class extends Tn{constructor(){super({max:256})}},Br=class extends Tn{constructor(e=16384){super({maxSize:e,sizeCalculation:e=>e.length+1})}},Vr=Symbol(`PathScurry setAsCwd`),q=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#o;get rdev(){return this.#o}#s;get blksize(){return this.#s}#c;get ino(){return this.#c}#l;get size(){return this.#l}#u;get blocks(){return this.#u}#d;get atimeMs(){return this.#d}#f;get mtimeMs(){return this.#f}#p;get ctimeMs(){return this.#p}#m;get birthtimeMs(){return this.#m}#h;get atime(){return this.#h}#g;get mtime(){return this.#g}#_;get ctime(){return this.#_}#v;get birthtime(){return this.#v}#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=gr,n,r,i,a,o){this.name=e,this.#y=i?Rr(e):Ir(e),this.#T=t&Nr,this.nocase=i,this.roots=r,this.root=n||this,this.#E=a,this.#x=o.fullpath,this.#C=o.relative,this.#w=o.relativePosix,this.parent=o.parent,this.#e=this.parent?this.parent.#e:fr(o.fs)}depth(){return this.#b===void 0?this.#b=this.parent?this.parent.depth()+1:0:this.#b}childrenCache(){return this.#E}resolve(e){if(!e)return this;let t=this.getRootString(e),n=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(n):this.#k(n)}#k(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#E.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#E.set(this,t),this.#T&=~Er,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?Rr(e):Ir(e);for(let e of n)if(e.#y===r)return e;let i=this.parent?this.sep:``,a=this.#x?this.#x+i+e:void 0,o=this.newChild(e,gr,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#T|=kr),n.push(o),o}relative(){if(this.isCWD)return``;if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let n=t.relative();return n+(!n||!t.parent?``:this.sep)+e}relativePosix(){if(this.sep===`/`)return this.relative();if(this.isCWD)return``;if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?``:`/`)+e}fullpath(){if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.name;let n=t.fullpath()+(t.parent?this.sep:``)+e;return this.#x=n}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep===`/`)return this.#S=this.fullpath();if(!this.parent){let e=this.fullpath().replace(/\\/g,`/`);return this.#S=/^[a-z]:\//i.test(e)?`//?/${e}`:e}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?``:`/`)+this.name;return this.#S=n}isUnknown(){return(this.#T&wr)===gr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?`Unknown`:this.isDirectory()?`Directory`:this.isFile()?`File`:this.isSymbolicLink()?`SymbolicLink`:this.isFIFO()?`FIFO`:this.isCharacterDevice()?`CharacterDevice`:this.isBlockDevice()?`BlockDevice`:this.isSocket()?`Socket`:`Unknown`}isFile(){return(this.#T&wr)===xr}isDirectory(){return(this.#T&wr)===yr}isCharacterDevice(){return(this.#T&wr)===vr}isBlockDevice(){return(this.#T&wr)===br}isFIFO(){return(this.#T&wr)===_r}isSocket(){return(this.#T&wr)===Cr}isSymbolicLink(){return(this.#T&Sr)===Sr}lstatCached(){return this.#T&Dr?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let e=this.#T&wr;return!(e!==gr&&e!==Sr||this.#T&Ar||this.#T&kr)}calledReaddir(){return!!(this.#T&Er)}isENOENT(){return!!(this.#T&kr)}isNamed(e){return this.nocase?this.#y===Rr(e):this.#y===Ir(e)}async readlink(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}readlinkSync(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}#A(e){this.#T|=Er;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#j()}}#j(){this.#T&kr||(this.#T=(this.#T|kr)&Tr,this.#M())}#M(){let e=this.children();e.provisional=0;for(let t of e)t.#j()}#N(){this.#T|=jr,this.#P()}#P(){if(this.#T&Or)return;let e=this.#T;(e&wr)===yr&&(e&=Tr),this.#T=e|Or,this.#M()}#F(e=``){e===`ENOTDIR`||e===`EPERM`?this.#P():e===`ENOENT`?this.#j():this.children().provisional=0}#I(e=``){e===`ENOTDIR`?this.parent.#P():e===`ENOENT`&&this.#j()}#L(e=``){let t=this.#T;t|=Ar,e===`ENOENT`&&(t|=kr),(e===`EINVAL`||e===`UNKNOWN`)&&(t&=Tr),this.#T=t,e===`ENOTDIR`&&this.parent&&this.parent.#P()}#R(e,t){return this.#B(e,t)||this.#z(e,t)}#z(e,t){let n=Pr(e),r=this.newChild(e.name,n,{parent:this}),i=r.#T&wr;return i!==yr&&i!==Sr&&i!==gr&&(r.#T|=Or),t.unshift(r),t.provisional++,r}#B(e,t){for(let n=t.provisional;n<t.length;n++){let r=t[n];if((this.nocase?Rr(e.name):Ir(e.name))===r.#y)return this.#V(e,r,n,t)}}#V(e,t,n,r){let i=t.name;return t.#T=t.#T&Tr|Pr(e),i!==e.name&&(t.name=e.name),n!==r.provisional&&(n===r.length-1?r.pop():r.splice(n,1),r.unshift(t)),r.provisional++,t}async lstat(){if((this.#T&kr)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#I(e.code)}}lstatSync(){if((this.#T&kr)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#I(e.code)}}#H(e){let{atime:t,atimeMs:n,birthtime:r,birthtimeMs:i,blksize:a,blocks:o,ctime:s,ctimeMs:c,dev:l,gid:u,ino:d,mode:f,mtime:p,mtimeMs:m,nlink:h,rdev:g,size:_,uid:v}=e;this.#h=t,this.#d=n,this.#v=r,this.#m=i,this.#s=a,this.#u=o,this.#_=s,this.#p=c,this.#t=l,this.#a=u,this.#c=d,this.#n=f,this.#g=p,this.#f=m,this.#r=h,this.#o=g,this.#l=_,this.#i=v;let y=Pr(e);this.#T=this.#T&Tr|y|Dr,y!==gr&&y!==yr&&y!==Sr&&(this.#T|=Or)}#U=[];#W=!1;#G(e){this.#W=!1;let t=this.#U.slice();this.#U.length=0,t.forEach(t=>t(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#U.push(e),this.#W)return;this.#W=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(e,t)=>{if(e)this.#F(e.code),n.provisional=0;else{for(let e of t)this.#R(e,n);this.#A(n)}this.#G(n.slice(0,n.provisional))})}#K;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#K)await this.#K;else{let n=()=>{};this.#K=new Promise(e=>n=e);try{for(let n of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}this.#K=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#T&Mr)return!1;let e=wr&this.#T;return e===gr||e===yr||e===Sr}shouldWalk(e,t){return(this.#T&yr)===yr&&!(this.#T&Mr)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((jr|Ar|kr)&this.#T))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!((jr|Ar|kr)&this.#T))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}[Vr](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=/* @__PURE__ */ new Set([]),n=[],r=this;for(;r&&r.parent;)t.add(r),r.#C=n.join(this.sep),r.#w=n.join(`/`),r=r.parent,n.push(`..`);for(r=e;r&&r.parent&&!t.has(r);)r.#C=void 0,r.#w=void 0,r=r.parent}},Hr=class e extends q{sep=`\\`;splitSep=hr;constructor(e,t=gr,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=gr,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return le.parse(e).root}getRoot(e){if(e=mr(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Gr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(pr,`$1\\`),e===t}},Ur=class e extends q{splitSep=`/`;sep=`/`;constructor(e,t=gr,n,r,i,a,o){super(e,t,n,r,i,a,o)}getRootString(e){return e.startsWith(`/`)?`/`:``}getRoot(e){return this.root}newChild(t,n=gr,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Wr=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),t,n,{nocase:r,childrenCacheSize:i=16384,fs:a=dr}={}){this.#r=fr(a),(e instanceof URL||e.startsWith(`file://`))&&(e=k(e));let o=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new zr,this.#t=new zr,this.#n=new Br(i);let s=o.substring(this.rootPath.length).split(n);if(s.length===1&&!s[0]&&s.pop(),r===void 0)throw TypeError(`must provide nocase setting to PathScurryBase ctor`);this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let c=this.root,l=s.length-1,u=t.sep,d=this.rootPath,f=!1;for(let e of s){let t=l--;c=c.child(e,{relative:Array(t).fill(`..`).join(u),relativePosix:Array(t).fill(`..`).join(`/`),fullpath:d+=(f?``:u)+e}),f=!0}this.cwd=c}depth(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r&&r!==`.`&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#e.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r&&r!==`.`&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#t.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let t=await e.readdir();return n?t:t.map(e=>e.name)}return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(e=>e.name):[]}async lstat(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=/* @__PURE__ */ new Set,c=(e,t)=>{s.add(e),e.readdirCB((e,l)=>{if(e)return t(e);let u=l.length;if(!u)return t();let d=()=>{--u===0&&t()};for(let e of l)(!i||i(e))&&o.push(n?e:e.fullpath()),r&&e.isSymbolicLink()?e.realpath().then(e=>e?.isUnknown()?e.lstat():e).then(e=>e?.shouldWalk(s,a)?c(e,d):d()):e.shouldWalk(s,a)?c(e,d):d()},!0)},l=e;return new Promise((e,t)=>{c(l,n=>{if(n)return t(n);e(o)})})}walkSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=/* @__PURE__ */ new Set([e]);for(let e of s){let t=e.readdirSync();for(let e of t){(!i||i(e))&&o.push(n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&s.add(t)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t;(!i||i(e))&&(yield n?e:e.fullpath());let o=/* @__PURE__ */ new Set([e]);for(let e of o){let t=e.readdirSync();for(let e of t){(!i||i(e))&&(yield n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(o,a)&&o.add(t)}}}stream(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new lr({objectMode:!0});(!i||i(e))&&o.write(n?e:e.fullpath());let s=/* @__PURE__ */ new Set,c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let d=(t,p,m=!1)=>{if(t)return o.emit(`error`,t);if(r&&!m){let e=[];for(let t of p)t.isSymbolicLink()&&e.push(t.realpath().then(e=>e?.isUnknown()?e.lstat():e));if(e.length){Promise.all(e).then(()=>d(null,p,!0));return}}for(let t of p)t&&(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of p){let t=e.realpathCached()||e;t.shouldWalk(s,a)&&c.push(t)}e&&!o.flowing?o.once(`drain`,u):f||u()},f=!0;t.readdirCB(d,!0),f=!1}};return u(),o}streamSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new lr({objectMode:!0}),s=/* @__PURE__ */ new Set;(!i||i(e))&&o.write(n?e:e.fullpath());let c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let u=t.readdirSync();for(let t of u)(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of u){let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&c.push(t)}}e&&!o.flowing&&o.once(`drain`,u)};return u(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e==`string`?this.cwd.resolve(e):e,this.cwd[Vr](t)}},Gr=class extends Wr{sep=`\\`;constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,le,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return le.parse(e).root.toUpperCase()}newRoot(e){return new Hr(this.rootPath,yr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}},Kr=class extends Wr{sep=`/`;constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,oe,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new Ur(this.rootPath,yr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}},qr=class extends Kr{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};process.platform;var Jr=process.platform===`win32`?Gr:process.platform===`darwin`?qr:Kr,Yr=e=>e.length>=1,Xr=e=>e.length>=1,Zr=Symbol.for(`nodejs.util.inspect.custom`),Qr=class e{#e;#t;#n;length;#r;#i;#a;#o;#s;#c;#l=!0;constructor(e,t,n,r){if(!Yr(e))throw TypeError(`empty pattern list`);if(!Xr(t))throw TypeError(`empty glob list`);if(t.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,n<0||n>=this.length)throw TypeError(`index out of range`);if(this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#n===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#e,[a,o,s,c,...l]=this.#t;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#e=[u,...i],this.#t=[d,...l],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#e,[n,...r]=this.#t;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#e=[i,...t],this.#t=[a,...r],this.length=this.#e.length}}}[Zr](){return`Pattern <`+this.#t.slice(this.#n).join(`/`)+`>`}pattern(){return this.#e[this.#n]}isString(){return typeof this.#e[this.#n]==`string`}isGlobstar(){return this.#e[this.#n]===z}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join(`/`):this.#t.join(`/`):this.#t.slice(this.#n).join(`/`))}hasMore(){return this.length>this.#n+1}rest(){return this.#i===void 0?this.hasMore()?(this.#i=new e(this.#e,this.#t,this.#n+1,this.#r),this.#i.#c=this.#c,this.#i.#s=this.#s,this.#i.#o=this.#o,this.#i):this.#i=null:this.#i}isUNC(){let e=this.#e;return this.#s===void 0?this.#s=this.#r===`win32`&&this.#n===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#s}isDrive(){let e=this.#e;return this.#o===void 0?this.#o=this.#r===`win32`&&this.#n===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#o}isAbsolute(){let e=this.#e;return this.#c===void 0?this.#c=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#c}root(){let e=this.#e[0];return typeof e==`string`&&this.isAbsolute()&&this.#n===0?e:``}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}},$r=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`,ei=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:r,noglobstar:i,platform:a=$r}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:r,noglobstar:i,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(e){let t=new pn(e,this.mmopts);for(let e=0;e<t.set.length;e++){let n=t.set[e],r=t.globParts[e];if(!n||!r)throw Error(`invalid pattern object`);for(;n[0]===`.`&&r[0]===`.`;)n.shift(),r.shift();let i=new Qr(n,r,0,this.platform),a=new pn(i.globString(),this.mmopts),o=r[r.length-1]===`**`,s=i.isAbsolute();s?this.absolute.push(a):this.relative.push(a),o&&(s?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),n=`${t}/`,r=e.relative()||`.`,i=`${r}/`;for(let e of this.relative)if(e.match(r)||e.match(i))return!0;for(let e of this.absolute)if(e.match(t)||e.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+`/`,n=(e.relative()||`.`)+`/`;for(let e of this.relativeChildren)if(e.match(n))return!0;for(let e of this.absoluteChildren)if(e.match(t))return!0;return!1}},ti=class e{store;constructor(e=/* @__PURE__ */ new Map){this.store=e}copy(){return new e(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,/* @__PURE__ */ new Set([t.globString()]))}},ni=class{store=/* @__PURE__ */ new Map;add(e,t,n){let r=(t?2:0)|!!n,i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},ri=class{store=/* @__PURE__ */ new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ii=class e{hasWalkedCache;matches=new ni;subwalks=new ri;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new ti}processPatterns(e,t){this.patterns=t;let n=t.map(t=>[e,t]);for(let[e,t]of n){this.hasWalkedCache.storeWalked(e,t);let n=t.root(),r=t.isAbsolute()&&this.opts.absolute!==!1;if(n){e=e.resolve(n===`/`&&this.opts.root!==void 0?this.opts.root:n);let r=t.rest();if(r)t=r;else{this.matches.add(e,!0,!1);continue}}if(e.isENOENT())continue;let i,a,o=!1;for(;typeof(i=t.pattern())==`string`&&(a=t.rest());)e=e.resolve(i),t=a,o=!0;if(i=t.pattern(),a=t.rest(),o){if(this.hasWalkedCache.hasWalked(e,t))continue;this.hasWalkedCache.storeWalked(e,t)}if(typeof i==`string`){let t=i===`..`||i===``||i===`.`;this.matches.add(e.resolve(i),r,t)}else if(i===z){(!e.isSymbolicLink()||this.follow||t.checkFollowGlobstar())&&this.subwalks.add(e,t);let n=a?.pattern(),i=a?.rest();if(!a||(n===``||n===`.`)&&!i)this.matches.add(e,r,n===``||n===`.`);else if(n===`..`){let t=e.parent||e;i?this.hasWalkedCache.hasWalked(t,i)||this.subwalks.add(t,i):this.matches.add(t,r,!0)}}else i instanceof RegExp&&this.subwalks.add(e,t)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),r=this.child();for(let e of t)for(let t of n){let n=t.isAbsolute(),i=t.pattern(),a=t.rest();i===z?r.testGlobstar(e,t,a,n):i instanceof RegExp?r.testRegExp(e,i,a,n):r.testString(e,i,a,n)}return r}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}},ai=(e,t)=>typeof e==`string`?new ei([e],t):Array.isArray(e)?new ei(e,t):e,oi=class{path;patterns;opts;seen=/* @__PURE__ */ new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=ai(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let t=`${e.relativePosix()}/**`;this.#t.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#n:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#n)?`.`+this.#n:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ii(this.opts),n)}walkCB2(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ii(this.opts),n)}walkCB2Sync(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}},si=class extends oi{matches=/* @__PURE__ */ new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},ci=class extends oi{results;constructor(e,t,n){super(e,t,n),this.results=new lr({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},li=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`,ui=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw TypeError(`glob options required`);if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith(`file://`))&&(t.cwd=k(t.cwd)):this.cwd=``,this.cwd=t.cwd||``,this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth==`number`?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof e==`string`&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(t.noglobstar)throw TypeError(`base matching requires globstar`);e=e.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=e,this.platform=t.platform||li,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else{let e=t.platform===`win32`?Gr:t.platform===`darwin`?qr:t.platform?Kr:Jr;this.scurry=new e(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform===`darwin`||this.platform===`win32`,r={braceExpandMax:1e4,...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[i,a]=this.pattern.map(e=>new pn(e,r)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=i.map((e,t)=>{let n=a[t];if(!n)throw Error(`invalid pattern object`);return new Qr(e,n,0,this.platform)})}async walk(){return[...await new si(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new si(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ci(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ci(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},di=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let n of e)if(new pn(n,t).hasMagic())return!0;return!1};function fi(e,t={}){return new ui(e,t).streamSync()}function pi(e,t={}){return new ui(e,t).stream()}function mi(e,t={}){return new ui(e,t).walkSync()}async function hi(e,t={}){return new ui(e,t).walk()}function gi(e,t={}){return new ui(e,t).iterateSync()}function _i(e,t={}){return new ui(e,t).iterate()}var vi=fi,yi=Object.assign(pi,{sync:fi}),bi=gi,xi=Object.assign(_i,{sync:gi}),Si=Object.assign(mi,{stream:fi,iterate:gi}),Ci=Object.assign(hi,{glob:hi,globSync:mi,sync:Si,globStream:pi,stream:yi,globStreamSync:fi,streamSync:vi,globIterate:_i,iterate:xi,globIterateSync:gi,iterateSync:bi,Glob:ui,hasMagic:di,escape:It,unescape:Ct});Ci.glob=Ci;const wi=(e,t)=>e===void 0||typeof e===t,Ti=e=>!!e&&typeof e==`object`&&wi(e.preserveRoot,`boolean`)&&wi(e.tmp,`string`)&&wi(e.maxRetries,`number`)&&wi(e.retryDelay,`number`)&&wi(e.backoff,`number`)&&wi(e.maxBackoff,`number`)&&(wi(e.glob,`boolean`)||e.glob&&typeof e.glob==`object`)&&wi(e.filter,`function`),Ei=e=>{if(!Ti(e))throw Error(`invalid rimraf options`)},Di=e=>{Ei(e);let{glob:t,...n}=e;if(!t)return n;let r=t===!0?e.signal?{signal:e.signal}:{}:e.signal?{signal:e.signal,...t}:t;return{...n,glob:{...r,absolute:!0,withFileTypes:!1}}},Oi=(e={})=>Di(e),ki=(e={})=>Di(e),Ai=(e,t={})=>{let n=typeof e;if(n!==`string`){let t=e&&n===`object`&&e.constructor,r=`The "path" argument must be of type string. Received ${t&&t.name?`an instance of ${t.name}`:n===`object`?Re(e):`type ${n} ${e}`}`;throw Object.assign(TypeError(r),{path:e,code:`ERR_INVALID_ARG_TYPE`})}if(/\0/.test(e))throw Object.assign(/* @__PURE__ */ TypeError(`path must be a string without null bytes`),{path:e,code:`ERR_INVALID_ARG_VALUE`});e=Le(e);let{root:r}=I(e);if(e===r&&t.preserveRoot!==!1)throw Object.assign(/* @__PURE__ */ Error(`refusing to remove root directory without preserveRoot:false`),{path:e,code:`ERR_PRESERVE_ROOT`});if(process.platform===`win32`){let t=/[*|"<>?:]/,{root:n}=I(e);if(t.test(e.substring(n.length)))throw Object.assign(/* @__PURE__ */ Error(`Illegal characters in path.`),{path:e,code:`EINVAL`})}return e},ji=e=>Te(e,{withFileTypes:!0}),Mi={chmod:ze.chmod,mkdir:ze.mkdir,readdir:e=>ze.readdir(e,{withFileTypes:!0}),rename:ze.rename,rm:ze.rm,rmdir:ze.rmdir,stat:ze.stat,lstat:ze.lstat,unlink:ze.unlink},{readdir:Ni}=Mi,Pi=e=>Ni(e).catch(e=>e),Fi=e=>{try{return ji(e)}catch(e){return e}},Ii=e=>!!e&&typeof e==`object`,Li=(e,t)=>t in e&&typeof e[t]==`string`,Ri=e=>Ii(e)&&Li(e,`code`)&&Li(e,`path`),J=e=>Ii(e)&&Li(e,`code`)?e.code:null,zi=async(e,t)=>e.catch(e=>{if(J(e)!==`ENOENT`)throw t??e}),Bi=(e,t)=>{try{return e()}catch(e){if(J(e)===`ENOENT`)return;throw t??e}},{lstat:Vi,rmdir:Hi,unlink:Ui}=Mi,Wi=async(e,t)=>(t?.signal?.throwIfAborted(),await zi(Vi(e).then(n=>Ki(e,t,n)))??!0),Gi=(e,t)=>(t?.signal?.throwIfAborted(),Bi(()=>qi(e,t,Ce(e)))??!0),Ki=async(e,t,n)=>{t?.signal?.throwIfAborted();let r=n.isDirectory()?await Pi(e):null;if(!Array.isArray(r)){
4
+ /* c8 ignore start */
5
+ if(r){if(J(r)===`ENOENT`)return!0;if(J(r)!==`ENOTDIR`)throw r}return t.filter&&!await t.filter(e,n)?!1:(await zi(Ui(e)),!0)}return!(await Promise.all(r.map(n=>Ki(Le(e,n.name),t,n)))).every(e=>e===!0)||t.preserveRoot===!1&&e===I(e).root||t.filter&&!await t.filter(e,n)?!1:(await zi(Hi(e)),!0)},qi=(e,t,n)=>{t?.signal?.throwIfAborted();let r=n.isDirectory()?Fi(e):null;if(!Array.isArray(r)){
6
+ /* c8 ignore start */
7
+ if(r){if(J(r)===`ENOENT`)return!0;if(J(r)!==`ENOTDIR`)throw r}return t.filter&&!t.filter(e,n)?!1:(Bi(()=>Me(e)),!0)}let i=!0;for(let n of r){let r=Le(e,n.name);i=qi(r,t,n)&&i}return t.preserveRoot===!1&&e===I(e).root||!i||t.filter&&!t.filter(e,n)?!1:(Bi(()=>Ae(e)),!0)},{chmod:Ji}=Mi,Yi=e=>async t=>{try{await zi(e(t));return}catch(n){if(J(n)===`EPERM`){if(!await zi(Ji(t,438).then(()=>!0),n))return;await e(t);return}throw n}},Xi=e=>t=>{try{Bi(()=>e(t));return}catch(n){if(J(n)===`EPERM`){if(!Bi(()=>(xe(t,438),!0),n))return;e(t);return}throw n}},Zi=/* @__PURE__ */ new Set([`EMFILE`,`ENFILE`,`EBUSY`]),Qi=e=>{let t=async(n,r,i=1,a=0)=>{let o=r.maxBackoff||200,s=r.backoff||1.2,c=r.maxRetries||10,l=0;for(;;)try{return await e(n)}catch(e){if(Ri(e)&&e.path===n&&Zi.has(e.code)){if(i=Math.ceil(i*s),a=i+a,a<o)return await Be(i),t(n,r,i,a);if(l<c){l++;continue}}throw e}};return t},$i=e=>(t,n)=>{let r=n.maxRetries||10,i=0;for(;;)try{return e(t)}catch(e){if(Ri(e)&&e.path===t&&Zi.has(e.code)&&i<r){i++;continue}throw e}},{stat:ea}=Mi,ta=e=>{try{return je(e).isDirectory()}catch{return!1}},na=e=>ea(e).then(e=>e.isDirectory(),()=>!1),ra=async e=>{let{root:t}=I(e),n=L(),{root:r}=I(n);if(t.toLowerCase()===r.toLowerCase())return n;let i=Le(t,`/temp`);return await na(i)?i:t},ia=e=>{let{root:t}=I(e),n=L(),{root:r}=I(n);if(t.toLowerCase()===r.toLowerCase())return n;let i=Le(t,`/temp`);return ta(i)?i:t},aa=async()=>L(),oa=()=>L(),sa=process.platform===`win32`?ra:aa,ca=process.platform===`win32`?ia:oa,{lstat:la,rename:ua,unlink:da,rmdir:fa}=Mi,pa=e=>`.${Ie(e)}.${Math.random()}`,ma=Yi(da),ha=Xi(Me),ga=async(e,t)=>(t?.signal?.throwIfAborted(),await zi(la(e).then(n=>_a(e,t,n)))??!0),_a=async(e,t,n)=>{if(t?.signal?.throwIfAborted(),!t.tmp)return _a(e,{...t,tmp:await sa(e)},n);if(e===t.tmp&&I(e).root!==e)throw Error(`cannot delete temp directory used for deletion`);let r=n.isDirectory()?await Pi(e):null;if(!Array.isArray(r)){
8
+ /* c8 ignore start */
9
+ if(r){if(J(r)===`ENOENT`)return!0;if(J(r)!==`ENOTDIR`)throw r}return t.filter&&!await t.filter(e,n)?!1:(await zi(va(e,t.tmp,ma)),!0)}return!(await Promise.all(r.map(n=>_a(Le(e,n.name),t,n)))).every(e=>e===!0)||t.preserveRoot===!1&&e===I(e).root||t.filter&&!await t.filter(e,n)?!1:(await zi(va(e,t.tmp,fa)),!0)},va=async(e,t,n)=>{let r=Le(t,pa(e));return await ua(e,r),await n(r)},ya=(e,t)=>(t?.signal?.throwIfAborted(),Bi(()=>ba(e,t,Ce(e)))??!0),ba=(e,t,n)=>{if(t?.signal?.throwIfAborted(),!t.tmp)return ba(e,{...t,tmp:ca(e)},n);let r=t.tmp;if(e===t.tmp&&I(e).root!==e)throw Error(`cannot delete temp directory used for deletion`);let i=n.isDirectory()?Fi(e):null;if(!Array.isArray(i)){
10
+ /* c8 ignore start */
11
+ if(i){if(J(i)===`ENOENT`)return!0;if(J(i)!==`ENOTDIR`)throw i}return t.filter&&!t.filter(e,n)?!1:(Bi(()=>xa(e,r,ha)),!0)}let a=!0;for(let n of i){let r=Le(e,n.name);a=ba(r,t,n)&&a}return!a||t.preserveRoot===!1&&e===I(e).root||t.filter&&!t.filter(e,n)?!1:(Bi(()=>xa(e,r,Ae)),!0)},xa=(e,t,n)=>{let r=Le(t,pa(e));return Oe(e,r),n(r)},{unlink:Sa,rmdir:Ca,lstat:wa}=Mi,Ta=Qi(Yi(Sa)),Ea=$i(Xi(Me)),Da=Qi(Yi(Ca)),Oa=$i(Xi(Ae)),ka=async(e,{filter:t,...n})=>{
12
+ /* c8 ignore next */
13
+ n?.signal?.throwIfAborted();try{return await Da(e,n),!0}catch(t){if(J(t)===`ENOTEMPTY`)return ga(e,n);throw t}},Aa=(e,{filter:t,...n})=>{n?.signal?.throwIfAborted();try{return Oa(e,n),!0}catch(t){if(J(t)===`ENOTEMPTY`)return ya(e,n);throw t}},ja=Symbol(`start`),Ma=Symbol(`child`),Na=Symbol(`finish`),Pa=async(e,t)=>(t?.signal?.throwIfAborted(),await zi(wa(e).then(n=>Ia(e,t,n,ja)))??!0),Fa=(e,t)=>(t?.signal?.throwIfAborted(),Bi(()=>La(e,t,Ce(e),ja))??!0),Ia=async(e,t,n,r=ja)=>{t?.signal?.throwIfAborted();let i=n.isDirectory()?await Pi(e):null;if(!Array.isArray(i)){
14
+ /* c8 ignore start */
15
+ if(i){if(J(i)===`ENOENT`)return!0;if(J(i)!==`ENOTDIR`)throw i}return t.filter&&!await t.filter(e,n)?!1:(await zi(Ta(e,t)),!0)}let a=r===ja?Ma:r,o=(await Promise.all(i.map(n=>Ia(Le(e,n.name),t,n,a)))).every(e=>e===!0);if(r===ja)return Ia(e,t,n,Na);if(r===Na){if(t.preserveRoot===!1&&e===I(e).root||!o||t.filter&&!await t.filter(e,n))return!1;await zi(ka(e,t))}return!0},La=(e,t,n,r=ja)=>{let i=n.isDirectory()?Fi(e):null;if(!Array.isArray(i)){
16
+ /* c8 ignore start */
17
+ if(i){if(J(i)===`ENOENT`)return!0;if(J(i)!==`ENOTDIR`)throw i}return t.filter&&!t.filter(e,n)?!1:(Bi(()=>Ea(e,t)),!0)}let a=!0;for(let n of i){let i=r===ja?Ma:r,o=Le(e,n.name);a=La(o,t,n,i)&&a}if(r===ja)return La(e,t,n,Na);if(r===Na){if(t.preserveRoot===!1&&e===I(e).root||!a||t.filter&&!t.filter(e,n))return!1;Bi(()=>Aa(e,t))}return!0},Ra=process.platform===`win32`?Pa:Wi,za=process.platform===`win32`?Fa:Gi,{rm:Ba}=Mi,Va=async(e,t)=>(await Ba(e,{...t,force:!0,recursive:!0}),!0),Ha=(e,t)=>(ke(e,{...t,force:!0,recursive:!0}),!0),[Ua=0,Wa=0]=process.version.replace(/^v/,``).split(`.`).map(e=>parseInt(e,10)),Ga=Ua>14||Ua===14&&Wa>=14,Ka=!Ga||process.platform===`win32`?()=>!1:e=>!e?.signal&&!e?.filter,qa=!Ga||process.platform===`win32`?()=>!1:e=>!e?.signal&&!e?.filter,Ja=e=>async(t,n)=>{let r=Oi(n);return r.glob&&(t=await Ci(t,r.glob)),Array.isArray(t)?!!(await Promise.all(t.map(t=>e(Ai(t,r),r)))).reduce((e,t)=>e&&t,!0):!!await e(Ai(t,r),r)},Ya=e=>(t,n)=>{let r=ki(n);return r.glob&&(t=mi(t,r.glob)),Array.isArray(t)?!!t.map(t=>e(Ai(t,r),r)).reduce((e,t)=>e&&t,!0):!!e(Ai(t,r),r)},Xa=Ya(Ha),Za=Object.assign(Ja(Va),{sync:Xa}),Qa=Ya(za),$a=Object.assign(Ja(Ra),{sync:Qa}),eo=Ya(Fa),to=Object.assign(Ja(Pa),{sync:eo}),no=Ya(Gi),ro=Object.assign(Ja(Wi),{sync:no}),io=Ya(ya),ao=Object.assign(Ja(ga),{sync:io}),oo=Ya((e,t)=>qa(t)?Ha(e,t):za(e,t)),so=Ja((e,t)=>Ka(t)?Va(e,t):Ra(e,t)),co=Object.assign(so,{rimraf:so,sync:oo,rimrafSync:oo,manual:$a,manualSync:Qa,native:Za,nativeSync:Xa,posix:ro,posixSync:no,windows:to,windowsSync:eo,moveRemove:ao,moveRemoveSync:io});co.rimraf=co;async function lo(e,t,{baseDir:n=``,readdirImpl:r=he,cpImpl:i=M,joinImpl:a=O}={}){for(let o of e){let e=n?a(n,o):o;try{let n=await r(e,{withFileTypes:!0});for(let r of n){let n=a(e,r.name),o=a(t,r.name);r.isDirectory()?await i(n,o,{recursive:!0,force:!0}):r.isFile()&&await i(n,o,{force:!0})}}catch{}}}async function uo(e,t,n={},{statImpl:r=ye,cpImpl:i=M}={}){let a=Array.isArray(e)?e:[e];for(let e of a)try{return await r(e),await i(e,t,n),!0}catch{}return!1}async function fo(e,{statImpl:t=ye}={}){for(let n of e)try{return await t(n),n}catch{}return null}function po({contentRoot:e=``,toolchainRoot:t=``,distPublicDir:n=`dist/public`}={}){let r=[{sources:[`pages/resources/README.md`,`pages/deps/README.md`,`resources/README.md`,`deps/README.md`,`pages/README.md`,`README.md`],dest:`dist/public/README.md`},{sources:[`pages/resources/docs`,`pages/deps/docs`,`resources/docs`,`deps/docs`,`pages/docs`,`docs`],dest:`dist/public/docs`,opts:{recursive:!0}},{sources:[`pages/resources/AGENTS.md`,`pages/deps/AGENTS.md`,`resources/AGENTS.md`,`deps/AGENTS.md`,`pages/AGENTS.md`,`AGENTS.md`],dest:`dist/public/AGENTS.md`},{sources:[`pages/resources/llms.txt`,`pages/deps/llms.txt`,`resources/llms.txt`,`deps/llms.txt`,`pages/llms.txt`,`llms.txt`],dest:`dist/public/llms.txt`},{sources:[`pages/resources/robots.txt`,`pages/deps/robots.txt`,`resources/robots.txt`,`deps/robots.txt`,`pages/robots.txt`,`robots.txt`],dest:`dist/public/robots.txt`},{sources:[`pages/resources/sitemap.xml`,`pages/deps/sitemap.xml`,`resources/sitemap.xml`,`deps/sitemap.xml`,`pages/sitemap.xml`,`pages/main/sitemap.xml`,`sitemap.xml`],dest:`dist/public/sitemap.xml`},{sources:[`pages/resources/sitemap.txt`,`pages/deps/sitemap.txt`,`resources/sitemap.txt`,`deps/sitemap.txt`,`pages/sitemap.txt`,`pages/main/sitemap.txt`,`sitemap.txt`],dest:`dist/public/sitemap.txt`},{sources:[`pages/resources/404.html`,`pages/deps/404.html`,`resources/404.html`,`deps/404.html`,`pages/404.html`,`pages/main/404.html`,`404.html`],dest:`dist/public/404.html`},{sources:[`pages/resources/manifest.json`,`pages/deps/manifest.json`,`resources/manifest.json`,`deps/manifest.json`,`pages/manifest.json`,`pages/main/manifest.json`,`manifest.json`],dest:`dist/public/manifest.json`},{sources:[`pages/resources/assets/icons/favicon.svg`,`pages/deps/assets/icons/favicon.svg`,`resources/assets/icons/favicon.svg`,`deps/assets/icons/favicon.svg`,`pages/resources/assets/favicon.svg`,`pages/resources/favicon.svg`,`pages/deps/favicon.svg`,`resources/favicon.svg`,`deps/favicon.svg`,`pages/favicon.svg`,`pages/main/favicon.svg`,`assets/icons/favicon.svg`],dest:`dist/public/favicon.svg`},{sources:[`pages/resources/assets/icons/favicon.ico`,`pages/deps/assets/icons/favicon.ico`,`resources/assets/icons/favicon.ico`,`deps/assets/icons/favicon.ico`,`pages/resources/assets/favicon.ico`,`pages/resources/favicon.ico`,`pages/deps/favicon.ico`,`resources/favicon.ico`,`deps/favicon.ico`,`pages/favicon.ico`,`pages/main/favicon.ico`,`assets/icons/favicon.ico`],dest:`dist/public/favicon.ico`}];if(!e&&!t&&n===`dist/public`)return r;let i=/* @__PURE__ */ new Set([`dist/public/404.html`,`dist/public/manifest.json`,`dist/public/robots.txt`,`dist/public/favicon.svg`,`dist/public/favicon.ico`]);return r.map(r=>{let a=n?r.dest.replace(/^dist\/public/,n):r.dest,o=[];if(e)for(let t of r.sources)o.push(D.join(e,t));if(t&&t!==e&&i.has(r.dest))for(let e of r.sources)o.push(D.join(t,e));return!e&&!t&&o.push(...r.sources),{sources:o,dest:a,...r.opts?{opts:r.opts}:{}}})}function mo(e){let t=[`pages/resources/routes.json`,`pages/deps/routes.json`,`resources/routes.json`,`deps/routes.json`,`pages/routes.json`,`routes.json`];return e?t.map(t=>D.join(e,t)):t}function ho(e){return e?[D.join(e,`shadow-claw-config.json`),D.join(e,`shadow-claw.config.json`),D.join(e,`shadowclaw.config.json`),D.join(e,`pages/shadow-claw-config.json`),D.join(e,`pages/shadow-claw.config.json`),D.join(e,`site-config.json`),D.join(e,`pages/site-config.json`)]:[`shadow-claw-config.json`,`shadow-claw.config.json`,`shadowclaw.config.json`,`site-config.json`]}function go(e={}){let t=e.PRERENDER_PAGES||`all`;return{isProduction:e.NODE_ENV===`production`,copyAllAssets:e.COPY_ALL_ASSETS===`true`,prerenderPages:t,prerenderMainMemory:e.PRERENDER_MAIN_MEMORY!==`false`&&t!==`none`&&t!==`0`}}function _o(e){let t=ne(e);if(t.startsWith(`pages/main/`))return t.slice(11);if(t.startsWith(`pages/br:main/`)||t.startsWith(`pages/br-main/`))return t.slice(14);if(t.startsWith(`main/`))return t.slice(5);if(t.startsWith(`pages/`)){let e=t.split(`/`);if(e.length>=3)return e.slice(2).join(`/`)}return t}function vo(e,t){let n=`<script id="shadow-claw-static-routing" type="application/json">${w(t)}<\/script>`;return/id="shadow-claw-static-routing"/iu.test(e)?e.replace(/<script\s+id="shadow-claw-static-routing"[\s\S]*?<\/script>/iu,()=>n):i(e,` ${n}`)}function yo(e){let t=(e.siteTitle||``).trim(),n=e.pageTitle?T(e.pageTitle).trim():``;if(e.isHome||!n)return t;if(!t)return n;if(n.toLowerCase()===t.toLowerCase())return t;let r=e.separator==null?` - `:e.separator;r&&!r.startsWith(` `)&&!r.endsWith(` `)&&(r=` ${r} `);let i=r.trim();return RegExp(`(?:\\s*[-|—•·]\\s*|\\s+${So(i)}\\s+)${So(t)}$`,`i`).test(n)?n:e.titleTemplate?e.titleTemplate.replace(/%%title%%|%title%/g,n).replace(/%%sitename%%|%%site%%|%sitename%|%site%/g,t).replace(/%%sep%%|%sep%/g,i).replace(/%%sitedesc%%|%%description%%|%sitedesc%|%description%/g,(e.siteDescription||``).trim()).replace(/\s+/g,` `).trim():`${n}${r}${t}`}function bo(e,t){if(!e)return t?.fallback||``;let n=t?.maxLength??160,r=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/mu,``);r=r.replace(/```[\s\S]*?```/gu,``),r=r.replace(/~~~[\s\S]*?~~~/gu,``),r=r.replace(/^#{1,6}\s+.*$/gmu,``),r=r.replace(/!\[.*?\]\(.*?\)/gu,``),r=r.replace(/\[([^\]]+)\]\([^)]+\)/gu,`$1`),r=r.replace(/^>\s*/gmu,``),r=r.replace(/\*\*([^*]+)\*\*/gu,`$1`),r=r.replace(/\*([^*]+)\*/gu,`$1`),r=r.replace(/__([^_]+)__/gu,`$1`),r=r.replace(/_([^_]+)_/gu,`$1`),r=r.replace(/`([^`]+)`/gu,`$1`);let i=r.split(/\r?\n\s*\r?\n/).map(e=>T(e).replace(/\s+/g,` `).trim()).filter(e=>e.length>0);if(i.length===0)return t?.fallback||``;let a=i[0];if(a.length<=n)return a;let o=a.slice(0,n),s=o.lastIndexOf(` `);return s>n*.7&&(o=o.slice(0,s)),o=o.replace(/[,;.:\-—]+$/u,``).trim(),`${o}...`}function xo(e){let t=(e.origin||``).trim().replace(/\/+$/,``),n=(e.basePath||``).trim(),r=e.prettyPath.trim();if(r.startsWith(`/`)||(r=`/${r}`),n&&n!==`/`){let e=`/${n.replace(/^\/+|\/+$/g,``)}`;r.startsWith(e)||t.endsWith(e)||(r=`${e}${r}`)}return t?`${t}${r}`:r}function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Co(e){let t=/<!--[\s\S]*?-->|<script\b[\s\S]*?<\/script>|<style\b[\s\S]*?<\/style>|<template\b[\s\S]*?<\/template>|<\/head>/gi,n;for(;(n=t.exec(e))!==null;)if(n[0].toLowerCase().startsWith(`</head`))return n.index;return-1}function wo(e,t){let n=Co(e);return n===-1?`${t}\n${e}`:`${e.slice(0,n)} ${t}\n${e.slice(n)}`}function To(e,t){let n=e;if(t.title){let e=C(t.title);n=/<title>[^<]*<\/title>/iu.test(n)?n.replace(/<title>[^<]*<\/title>/iu,`<title>${e}</title>`):wo(n,`<title>${e}</title>`)}if(t.description){let e=`<meta name="description" content="${C(t.description)}" />`;n=/<meta\s+name="description"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+name="description"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.canonicalUrl){let e=`<link rel="canonical" href="${C(t.canonicalUrl)}" />`;n=/<link\s+rel="canonical"\s+href="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<link\s+rel="canonical"\s+href="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.title){let e=`<meta property="og:title" content="${C(t.title)}" />`;n=/<meta\s+property="og:title"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+property="og:title"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.description){let e=`<meta property="og:description" content="${C(t.description)}" />`;n=/<meta\s+property="og:description"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+property="og:description"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.canonicalUrl){let e=`<meta property="og:url" content="${C(t.canonicalUrl)}" />`;n=/<meta\s+property="og:url"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+property="og:url"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.siteTitle){let e=`<meta property="og:site_name" content="${C(t.siteTitle)}" />`;n=/<meta\s+property="og:site_name"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+property="og:site_name"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.type){let e=`<meta property="og:type" content="${C(t.type)}" />`;n=/<meta\s+property="og:type"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+property="og:type"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.title){let e=`<meta name="twitter:title" content="${C(t.title)}" />`;n=/<meta\s+name="twitter:title"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+name="twitter:title"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.description){let e=`<meta name="twitter:description" content="${C(t.description)}" />`;n=/<meta\s+name="twitter:description"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+name="twitter:description"\s+content="[^"]*"\s*\/?>/iu,e):wo(n,e)}if(t.image){let e=C(t.image),r=`<meta property="og:image" content="${e}" />`;n=/<meta\s+property="og:image"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+property="og:image"\s+content="[^"]*"\s*\/?>/iu,r):wo(n,r);let i=`<meta name="twitter:image" content="${e}" />`;n=/<meta\s+name="twitter:image"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+name="twitter:image"\s+content="[^"]*"\s*\/?>/iu,i):wo(n,i)}return n}const Eo=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`);function Do(e){let t=e?.routes;if(!t||typeof t!=`object`)return[];let n=/* @__PURE__ */ new Set;for(let e of Object.values(t)){let t=e?.prettyPath;typeof t==`string`&&t&&n.add(t)}return[...n]}function Oo(e,t){let n=t.endsWith(`/`)?t:`${t}/`,r=/* @__PURE__ */ new Set([n]);for(let t of Do(e))r.add(n+t.replace(/^\/+/,``));return`<?xml version="1.0" encoding="UTF-8"?>
18
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
19
+ ${[...r].map(e=>` <url>\n <loc>${Eo(e)}</loc>\n </url>`).join(`
20
+ `)}
21
+ </urlset>
22
+ `}const Y=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`);function ko(e){return`<![CDATA[${e.replace(/]]>/g,`]]]]><![CDATA[>`)}]]>`}function Ao(e){if(!e)return(/* @__PURE__ */ new Date()).toUTCString();let t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?(/* @__PURE__ */ new Date()).toUTCString():t.toUTCString()}function jo(e){if(!e)return(/* @__PURE__ */ new Date()).toISOString();let t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?(/* @__PURE__ */ new Date()).toISOString():t.toISOString()}function Mo(e){let t=e.match(/\b(19\d\d|20\d\d)[-_/](0[1-9]|1[0-2])[-_/](0[1-9]|[12]\d|3[01])\b/);if(t)return`${t[1]}-${t[2]}-${t[3]}T00:00:00Z`}function No(e){let t=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/mu,``).match(/^#+\s+(.+)$/m);return t?t[1].trim():``}function Po(e){let t=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/mu,``).replace(/^#+.*$/gm,``).replace(/<[^>]+>/g,``).trim().split(/\n\s*\n/);return t[0]?t[0].trim().slice(0,300):``}function Fo(e,t){let n=/* @__PURE__ */ new Set;if(t){n.add(t);let e=t.replace(/^\/+|\/+$/g,``);e&&n.add(e)}if(e){n.add(e);let t=e.replace(/^\/+|\/+$/g,``);t&&n.add(t);let r=t.replace(/^pages\/main\//,``).replace(/^pages\//,``).replace(/^main\//,``);r&&n.add(r);let i=D.basename(e);i&&n.add(i)}return Array.from(n)}function Io(e,t){let n=e.trim();if(!n)return!1;if(n.includes(`*`)){let e=n.replace(/^\/+/,``).replace(/\/+$/,``).replace(/[.+?^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`.*`).replace(/\*/g,`[^/]*`),r=RegExp(`^${e}$`,`i`);return t.some(e=>r.test(e))}if(n.endsWith(`/`)){let e=n.replace(/^\/+/,``).replace(/\/+$/,``).toLowerCase();return t.some(t=>{let n=t.replace(/^\/+/,``).replace(/\/+$/,``).toLowerCase();return n===e||n.startsWith(`${e}/`)})}let r=n.replace(/^\/+/,``).replace(/\/+$/,``).toLowerCase();for(let e of t){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).toLowerCase();if(t===r||t.replace(/\.(md|markdown|html|xhtml|txt)$/i,``)===r.replace(/\.(md|markdown|html|xhtml|txt)$/i,``))return!0}return!1}async function Lo(e,t){let n=e?.routes;if(!n||typeof n!=`object`)return[];let r=t.origin.endsWith(`/`)?t.origin:`${t.origin}/`,i=[];for(let[e,a]of Object.entries(n)){let n=a?.prettyPath;if(!n||typeof n!=`string`)continue;let o=n.replace(/^\/+|\/+$/g,``);if(o===``||o===`index.html`||o===`main`||o===`feed`||o.startsWith(`feed/`)||e.endsWith(`.xml`))continue;let s=Fo(e,n);if(t.denyList&&t.denyList.length>0&&t.denyList.some(e=>Io(e,s))||t.allowList&&t.allowList.length>0&&!t.allowList.some(e=>Io(e,s)))continue;let c=``;if(t.pagesDir){let n=[D.join(t.pagesDir,e.replace(/^\/pages\/main\//,``).replace(/^\/main\//,``).replace(/^\//,``)),D.join(t.pagesDir,D.basename(e))];for(let e of n)try{c=await P(e,`utf8`);break}catch{}}let l={},u=c;if(c)try{let e=Ve(c);l=e.data||{},u=e.content||``}catch{}if(l.slug===`shadow-claw--purge-pages`||l.draft===!0||l.published===!1||l.feed===!1||l.feed?.enabled===!1||l.feed?.exclude===!0||l.syndication===!1||l.syndicate===!1||l.rss===!1)continue;let d=a.title||l.title||No(c)||D.basename(e,D.extname(e)).replace(/[-_]/g,` `),f=l.date||l.pubDate||l.created||l.updated||a.date||Mo(e),p=f?new Date(f):void 0,m=l.updated||l.created||f,h=m?new Date(m):p,g=a.description||l.description||l.excerpt||l.summary||Po(u),_=`${r}${n.replace(/^\/+/,``)}`,v=l.author||a.author||t.author,y=Array.isArray(l.categories)?l.categories:Array.isArray(l.tags)?l.tags:typeof l.section==`string`?[l.section]:[];i.push({title:d,link:_,guid:_,pubDate:p,updated:h,description:g,content:u?u.trim():void 0,author:v,categories:y})}let a=t.sortOrder!==`asc`;return i.sort((e,t)=>{let n=e.pubDate?new Date(e.pubDate).getTime():0,r=t.pubDate?new Date(t.pubDate).getTime():0;return n===r?e.title.localeCompare(t.title):a?r-n:n-r}),i}function Ro(e){let t=e.lang||`en-US`,n=Ao(e.lastBuildDate),r=e.link.endsWith(`/`)?e.link:`${e.link}/`,i=e.feedUrl||`${r}feed/`,a=e.items.map(t=>{let n=Ao(t.pubDate),r=t.guid||t.link,i=t.author||e.author||e.title,a=(t.categories||[]).map(e=>` <category>${ko(e)}</category>`).join(`
23
+ `),o=t.content?` <content:encoded>${ko(t.content)}</content:encoded>\n`:``;return` <item>
24
+ <title>${Y(t.title)}</title>
25
+ <link>${Y(t.link)}</link>
26
+ <pubDate>${n}</pubDate>
27
+ <dc:creator>${ko(i)}</dc:creator>
28
+ <guid isPermaLink="true">${Y(r)}</guid>
29
+ <description>${ko(t.description||``)}</description>
30
+ ${o}${a?a+`
31
+ `:``} </item>`}).join(`
32
+ `);return`<?xml version="1.0" encoding="UTF-8"?>
33
+ <rss version="2.0"
34
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
35
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
36
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
37
+ xmlns:atom="http://www.w3.org/2005/Atom"
38
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
39
+ xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
40
+ >
41
+ <channel>
42
+ <title>${Y(e.title)}</title>
43
+ <atom:link href="${Y(i)}" rel="self" type="application/rss+xml" />
44
+ <link>${Y(e.link)}</link>
45
+ <description>${Y(e.description||``)}</description>
46
+ <lastBuildDate>${n}</lastBuildDate>
47
+ <language>${Y(t)}</language>
48
+ <sy:updatePeriod>hourly</sy:updatePeriod>
49
+ <sy:updateFrequency>1</sy:updateFrequency>
50
+ <generator>ShadowClaw</generator>
51
+ ${a?a+`
52
+ `:``} </channel>
53
+ </rss>
54
+ `}function zo(e){let t=e.lang||`en-US`,n=jo(e.lastBuildDate),r=e.link.endsWith(`/`)?e.link:`${e.link}/`,i=e.feedUrl||`${r}feed/atom/`,a=e.items.map(t=>{let n=jo(t.pubDate),r=jo(t.updated||t.pubDate),i=t.guid||t.link,a=t.author||e.author||e.title,o=t.description?` <summary type="html">${ko(t.description)}</summary>\n`:``,s=t.content?` <content type="html" xml:base="${Y(t.link)}">${ko(t.content)}</content>\n`:``,c=(t.categories||[]).map(e=>` <category term="${Y(e)}" />`).join(`
55
+ `);return` <entry>
56
+ <author><name>${Y(a)}</name></author>
57
+ <title type="html">${ko(t.title)}</title>
58
+ <link rel="alternate" type="text/html" href="${Y(t.link)}" />
59
+ <id>${Y(i)}</id>
60
+ <updated>${r}</updated>
61
+ <published>${n}</published>
62
+ ${o}${s}${c?c+`
63
+ `:``} </entry>`}).join(`
64
+ `);return`<?xml version="1.0" encoding="UTF-8"?>
65
+ <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="${Y(t)}">
66
+ <title type="text">${Y(e.title)}</title>
67
+ <subtitle type="text">${Y(e.description||``)}</subtitle>
68
+ <updated>${n}</updated>
69
+ <link rel="alternate" type="text/html" href="${Y(e.link)}" />
70
+ <id>${Y(i)}</id>
71
+ <link rel="self" type="application/atom+xml" href="${Y(i)}" />
72
+ <generator uri="https://github.com/xt-ml/shadow-claw">ShadowClaw</generator>
73
+ ${a?a+`
74
+ `:``}
75
+ </feed>
76
+ `}function Bo(e){let t=e.lang||`en-US`,n=jo(e.lastBuildDate),r=e.link.endsWith(`/`)?e.link:`${e.link}/`,i=e.feedUrl||`${r}feed/rdf/`,a=e.items.map(e=>` <rdf:li rdf:resource="${Y(e.link)}" />`).join(`
77
+ `),o=e.items.map(t=>{let n=jo(t.pubDate),r=t.author||e.author||e.title,i=t.content?` <content:encoded>${ko(t.content)}</content:encoded>\n`:``;return`<item rdf:about="${Y(t.link)}">
78
+ <title>${Y(t.title)}</title>
79
+ <link>${Y(t.link)}</link>
80
+ <dc:date>${n}</dc:date>
81
+ <dc:creator>${Y(r)}</dc:creator>
82
+ <description>${ko(t.description||``)}</description>
83
+ ${i}</item>`}).join(`
84
+
85
+ `);return`<?xml version="1.0" encoding="UTF-8"?>
86
+ <rdf:RDF
87
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
88
+ xmlns="http://purl.org/rss/1.0/"
89
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
90
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
91
+ xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
92
+ xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
93
+ xmlns:admin="http://webns.net/mvcb/"
94
+ >
95
+ <channel rdf:about="${Y(i)}">
96
+ <title>${Y(e.title)}</title>
97
+ <link>${Y(e.link)}</link>
98
+ <description>${Y(e.description||``)}</description>
99
+ <dc:date>${n}</dc:date>
100
+ <dc:language>${Y(t)}</dc:language>
101
+ <syn:updatePeriod>hourly</syn:updatePeriod>
102
+ <syn:updateFrequency>1</syn:updateFrequency>
103
+ <syn:updateBase>1970-01-01T00:00+00:00</syn:updateBase>
104
+ <items>
105
+ <rdf:Seq>
106
+ ${a?a+`
107
+ `:``} </rdf:Seq>
108
+ </items>
109
+ </channel>
110
+
111
+ ${o}
112
+ </rdf:RDF>
113
+ `}function Vo(e,t,n){return`<!DOCTYPE html>
114
+ <html lang="en">
115
+ <head>
116
+ <meta charset="utf-8" />
117
+ <meta http-equiv="refresh" content="0; url=${Y(e)}" />
118
+ <link rel="alternate" type="${Y(n)}" title="${Y(t)}" href="${Y(e)}" />
119
+ <title>${Y(t)}</title>
120
+ </head>
121
+ <body>
122
+ <p><a href="${Y(e)}">Click here to view ${Y(t)}</a></p>
123
+ </body>
124
+ </html>
125
+ `}function Ho(e,t){if(!t)return e;let n=t.endsWith(`/`)?t:`${t}/`,r=new URL(n),i=r.pathname.replace(/\/$/,``);return e.replace(/(<(?:link|guid|id)[^>]*>|rdf:about="|rdf:resource="|href="|xml:base=")(https?:\/\/[^"<>\s]+)/giu,(e,t,n)=>{try{let e=new URL(n),a=e.pathname;i&&a.startsWith(i+`/`)?a=a.slice(i.length):i&&a===i&&(a=`/`);let o=a.startsWith(`/`)?a:`/${a}`,s=`${r.origin}${i}${o}${e.search}${e.hash}`;return`${t}${Y(s)}`}catch{return e}})}async function Uo(e){let t=e.origin||``,n=t.endsWith(`/`)?t:`${t}/`,r=e.siteConfig?.site||{},i=e.siteConfig?.branding||{},a=i.titleText||r.title||`ShadowClaw`,o=r.description||``,s=r.lang||`en-US`,c=i.repoLabel||r.author||a,l=e.lastBuildDate||/* @__PURE__ */ new Date,u=typeof e.siteConfig?.feed==`object`?e.siteConfig.feed:{},d=[...u?.allowList||u?.allowlist||[],...e.siteConfig?.pages?.allowList||e.siteConfig?.allowList||[]],f=[...u?.denyList||u?.denylist||[],...e.siteConfig?.pages?.denyList||e.siteConfig?.denyList||[]],p=await Lo(e.routesJson,{origin:n,pagesDir:e.pagesDir,allowList:d.length>0?d:void 0,denyList:f.length>0?f:void 0,sortOrder:e.siteConfig?.pages?.sortOrder,author:c}),m={title:a,link:n,feedUrl:`${n}feed/`,description:o,lang:s,author:c,lastBuildDate:l,items:p},h={...m,feedUrl:`${n}feed/atom/`},g={...m,feedUrl:`${n}feed/rdf/`},_=Ro(m),v=zo(h),y=Bo(g);return{rss2:_,atom:v,rdf:y,files:{"feed/rss.xml":_,"feed/index.xml":_,"feed/index.html":Vo(`rss.xml`,`${a} Feed`,`application/rss+xml`),"feed/atom/atom.xml":v,"feed/atom/index.xml":v,"feed/atom/index.html":Vo(`atom.xml`,`${a} Atom Feed`,`application/atom+xml`),"feed/rdf/index.xml":y,"feed/rdf/index.html":Vo(`index.xml`,`${a} RDF Feed`,`application/rdf+xml`)}}}function Wo(e={},t={}){let n=e.customElements;return{rawScripts:(typeof n==`object`&&!Array.isArray(n)?n.scripts:n)||e.scripts||t.scripts||[],allowedDomains:(typeof n==`object`&&!Array.isArray(n)?n.allowedDomains:void 0)||e.allowedCustomElementDomains||[]}}function Go(e,t){if(!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`//`)||!t||Array.isArray(t)&&t.length===0)return!0;try{let n=new URL(e,`https://localhost`).hostname.toLowerCase();return(Array.isArray(t)?t:String(t).split(/[\n,]+/)).some(e=>{let t=e.trim().toLowerCase();return n===t||n.endsWith(`.`+t)||t===`*`})}catch{return!1}}function Ko(e,t){let n=JSON.parse(JSON.stringify(e));return n.customElements&&typeof n.customElements==`object`&&Array.isArray(n.customElements.scripts)&&(n.customElements.scripts=n.customElements.scripts.filter(e=>{let n=typeof e==`string`?e:e?.src;return n?Go(n,t):!1})),n}function X(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}const qo=[`pages/resources/`,`pages/deps/`,`resources/`,`deps/`,`pages/assets/`,`pages/main/assets/`];function Jo(e){for(let t of qo)if(e.startsWith(t))return e.slice(t.length).replace(/^\/+/,``);return e.replace(/^\/+/,``)}async function Yo(e){try{return JSON.parse(await P(e,`utf8`))}catch{return null}}async function Xo(e){try{return await P(e,`utf8`)}catch{return null}}async function Zo(e,t){await F(e,t,`utf8`)}function Qo(e){return!Array.isArray(e)||e.length===0?``:`<nav slot="sidebar" class="sidebar-custom-sections" aria-label="Site Navigation">\n${e.map((e,t)=>{if(e.html)return e.html;let n=e.title?`sidebar-${e.title.toLowerCase().replace(/[^a-z0-9]+/g,`-`)}`:`sidebar-section-${t+1}`,r=e.headerHref?`<a href="${X(e.headerHref)}" class="sidebar-link">${X(e.title||``)}</a>`:`<span>${X(e.title||``)}</span>`,i=e.title?` <div class="sidebar-section-header">${r}</div>`:``,a=(e.items||[]).map(e=>{let t=e.title||e.label||``,n=e.href||`#`,r=e.target?` target="${X(e.target)}"`:``,i=e.rel?` rel="${X(e.rel)}"`:e.target===`_blank`?` rel="noopener noreferrer"`:``,a=e.active?` active`:``,o=e.active?` aria-current="page"`:``;return` <div class="sidebar-item"><a href="${X(n)}"${r}${i} class="sidebar-link${a}"${o}>${X(t)}</a></div>`}).join(`
126
+ `);return[` <section class="sidebar-section" id="${n}">`,i,a,` </section>`].filter(Boolean).join(`
127
+ `)}).join(`
128
+ `)}\n</nav>`}function $o(e){let t=e.trim();if(!t||t===`/`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return n.endsWith(`/`)?n:`${n}/`}function es(e){if(!e||typeof e!=`string`||!e.trim())return null;let t=e.trim();try{return $o(new URL(t).pathname||`/`)}catch{return t.startsWith(`/`)?$o(t):null}}function ts(e={}){return e.basePath&&e.basePath.trim()?$o(e.basePath):es(e.pagesOrigin)||es(e.siteUrl)||(e.defaultBasePath&&e.defaultBasePath.trim()?$o(e.defaultBasePath):`/`)}function ns(e,t){let n=$o(t);return e.replace(/<base\s+href="[^"]*"\s*\/?>/iu,`<base href="${X(n)}" />`)}function rs(e,t,n,r){let a=e,o=t.site||{};o.title&&(a=a.replace(/<title>[^<]*<\/title>/iu,`<title>${X(o.title)}</title>`)),o.description&&(a=a.replace(/<meta\s+name="description"\s+content="[^"]*"\s*\/?>/iu,`<meta name="description" content="${X(o.description)}" />`)),o.themeColor&&(a=a.replace(/<meta\s+name="theme-color"\s+content="[^"]*"\s*\/?>/iu,`<meta name="theme-color" content="${X(o.themeColor)}" />`)),o.lang&&(a=a.replace(/<html\s+lang="[^"]*"/iu,`<html lang="${o.lang}"`));let s=t.branding||{},c=r?.isProduction??A.env.NODE_ENV===`production`;if(r?.basePath&&r.basePath.trim())a=ns(a,r.basePath);else if(c&&(r?.pagesOrigin||s.siteUrl)){let e=ts({pagesOrigin:r?.pagesOrigin,siteUrl:s.siteUrl});a=ns(a,e)}if(s.faviconPath){let e=s.faviconPath.replace(/^pages\/main\//,``),t=e.endsWith(`.svg`)?`image/svg+xml`:e.endsWith(`.png`)?`image/png`:`image/x-icon`,n=`<link href="${X(e)}" rel="icon" type="${t}" />`,r=!1;a=a.replace(/<link\b[^>]*\brel=["']?(?:shortcut\s+)?icon["']?[^>]*\/?>/giu,()=>r?``:(r=!0,n)),r||(a=i(a,` ${n}`))}if(s.appleTouchIconPath){let e=`<link href="${X(s.appleTouchIconPath.replace(/^pages\/main\//,``))}" rel="apple-touch-icon" />`,t=!1;a=a.replace(/<link\b[^>]*\brel=["']?apple-touch-icon["']?[^>]*\/?>/giu,()=>t?``:(t=!0,e)),t||(a=i(a,` ${e}`))}if(s.titleText||s.siteUrl||s.logoSlotHtml!==void 0){let e=s.siteUrl||``;a=a.replace(/<a\b([^>]*\bslot="header-title-link"[^>]*)>([\s\S]*?)<\/a>/iu,(n,r,i)=>{let a=``;if(s.logoSlotHtml!==void 0){let e=typeof s.logoSlotHtml==`string`?s.logoSlotHtml.trim():``;e!==``&&e.toLowerCase()!==`none`&&(a=s.logoSlotHtml)}else{let e=i.match(/<svg\b[\s\S]*?<\/svg>/iu)||i.match(/<img\b[^>]*\bclass="[^"]*header-title-logo[^"]*"[^>]*\/?>/iu);e&&(a=e[0])}let o=i.match(/<(h1|span)\b[^>]*\bclass="[^"]*header-title[^"]*"[^>]*>([\s\S]*?)<\/\1>/iu),c=o?o[1]:/<h1\b/i.test(i)?`h1`:`span`,l=o?o[2].trim():`ShadowClaw`,u=s.titleText||t.site?.title||l;return[`<a`,` aria-label="${X(u)}"`,` class="header-title-link"`,e?` href="${X(e)}"`:``,` slot="header-title-link"`,` >`,a?` ${a.trim()}`:``,` <${c} class="header-title">${X(u)}</${c}>`,` </a>`].filter(Boolean).join(`
129
+ `)})}if(s.repoUrl){let e=s.repoLabel||`Project on GitHub`;a=a.replace(/<a\b[^>]*\bslot="header-actions-logo"[^>]*>[\s\S]*?<\/a>/iu,[`<a`,` aria-label="${X(e)}"`,` class="header-actions-logo-link"`,` href="${X(s.repoUrl)}"`,` slot="header-actions-logo"`,` >`,` <svg aria-hidden="true" focusable="false" viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg">`,` <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8z" fill="var(--shadow-claw-bg-primary-reverse, currentColor)"></path>`,` </svg>`,` </a>`].join(`
130
+ `))}s.siteUrl&&!s.siteUrl.includes(`xt-ml.github.io`)&&(a=a.replace(/\s*<meta\s+http-equiv="origin-trial"\s+content="[^"]*"\s*\/?>\s*/iu,`
131
+ `));let l=t.theme||{};if(l.stylesheet){let e=Jo(l.stylesheet),t=`<link rel="stylesheet" href="${X(e)}" />`,n=X(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),o=RegExp(`<link\\s+[^>]*href=["'](?:${r}|${n})["'][^>]*>`,`iu`),s=y(a),c=(s===-1?a:a.slice(0,s)).replace(/<script\b[\s\S]*?<\/script>/gi,``);o.test(c)||(a=/<link\s+rel="stylesheet"\s+href="index\.css"\s*\/?>/iu.test(a)?a.replace(/(<link\s+rel="stylesheet"\s+href="index\.css"\s*\/?>)/iu,`$1\n ${t}`):i(a,` ${t}`))}let{allowedDomains:u}=Wo(t,l),d=Ko(t,u),f=`<script id="shadow-claw-site-config" type="application/json">${JSON.stringify(d).replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/\//g,`\\u002f`)}<\/script>`;a=a.includes(`<script id="shadow-claw-site-config"`)?a.replace(/<script\s+id="shadow-claw-site-config"[\s\S]*?<\/script>/iu,()=>f):a.includes(`<script src="theme-init.js">`)?a.replace(`<script src="theme-init.js">`,`${f}\n <script src="theme-init.js">`):/<script\b[^>]*>\s*var\s+ShadowClawThemeInit\b/iu.test(a)?a.replace(/(<script\b[^>]*>\s*var\s+ShadowClawThemeInit\b)/iu,`${f}\n $1`):i(a,` ${f}`),a=a.replace(/\s*<meta\s+name="shadow-claw-override-prerender-skeleton"[^>]*>/giu,``),typeof t.settings?.overridePrerenderSkeleton==`boolean`&&(a=a.replace(`<script id="shadow-claw-site-config"`,`<meta name="shadow-claw-override-prerender-skeleton" content="${t.settings.overridePrerenderSkeleton}" />\n <script id="shadow-claw-site-config"`));let p=n||t.sidebar?.slotHtml||(t.sidebar?.sections?Qo(t.sidebar.sections):``);if(p){let e=p.trim();/\bslot="sidebar(?:-nav|-content|-footer)?"/iu.test(e)||(e=`<div slot="sidebar" class="sidebar-custom-sections">\n${e}\n</div>`);let t=a.match(/<[^>]+?\bslot="sidebar(?:-nav|-content|-footer)?"[^>]*>[\s\S]*?<\/[^>]+>/iu);t&&(a=a.replace(t[0],``)),a.includes(`</shadow-claw>`)?a=a.replace(`</shadow-claw>`,` ${e}\n</shadow-claw>`):a.includes(`<shadow-claw></shadow-claw>`)&&(a=a.replace(`<shadow-claw></shadow-claw>`,`<shadow-claw>\n ${e}\n</shadow-claw>`))}if(t.sidebar&&(a=v(a,t.sidebar)),t.feed===!0||typeof t.feed==`object`&&t.feed?.enabled===!0){let e=s.titleText||o.title||`ShadowClaw`,t=s.siteUrl?s.siteUrl.endsWith(`/`)?s.siteUrl:`${s.siteUrl}/`:``,n=`<link rel="alternate" type="application/rss+xml" title="${X(e)} &raquo; Feed" href="${X(t)}feed/" />`,r=`<link rel="alternate" type="application/atom+xml" title="${X(e)} &raquo; Atom Feed" href="${X(t)}feed/atom/" />`,c=`<link rel="alternate" type="application/rdf+xml" title="${X(e)} &raquo; RDF Feed" href="${X(t)}feed/rdf/" />`;a.includes(`type="application/rss+xml"`)||(a=i(a,` ${n}`)),a.includes(`type="application/atom+xml"`)||(a=i(a,` ${r}`)),a.includes(`type="application/rdf+xml"`)||(a=i(a,` ${c}`))}return a}function is(e){let t=(e.src||``).replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),n=e.type||(t.endsWith(`.svg`)?`image/svg+xml`:t.endsWith(`.png`)?`image/png`:`image/x-icon`),r=(e.purpose||`any`).trim();return n===`image/svg+xml`||t.endsWith(`.svg`)?[{...e,src:t,type:n,purpose:`any`}]:r.includes(`any`)&&r.includes(`maskable`)?[{...e,src:t,type:n,purpose:`any`},{...e,src:t,type:n,purpose:`maskable`}]:[{...e,src:t,type:n,purpose:r}]}function as(e,t){let n=typeof e==`string`?JSON.parse(e):e,r=t.pwa||{},i=t.site||{},a=A.env.PAGES_ORIGIN;if((r.name||i.title)&&(n.name=r.name||i.title),(r.shortName||i.title)&&(n.short_name=r.shortName||i.title),i.description&&(n.description=i.description),r.backgroundColor&&(n.background_color=r.backgroundColor),(r.themeColor||i.themeColor)&&(n.theme_color=r.themeColor||i.themeColor),r.startUrl?n.start_url=r.startUrl:a?n.start_url=a:n.start_url||=`./`,r.icons&&Array.isArray(r.icons)){let e=r.icons.flatMap(is),t=Array.isArray(n.icons)?n.icons.flatMap(is):[],i=new Set(e.map(e=>e.src));n.icons=[...e,...t.filter(e=>!i.has(e.src))]}else Array.isArray(n.icons)&&(n.icons=n.icons.flatMap(is));return r.screenshots&&Array.isArray(r.screenshots)&&(n.screenshots=r.screenshots.map(e=>{let t=(e.src||``).replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``);return{...e,src:t}})),JSON.stringify(n,null,2)}function os(e,t){if(!t)return e;let n=t.endsWith(`/`)?t:t+`/`;return/<loc>/i.test(e)?e.replace(/<loc>([^<]*)<\/loc>/giu,(e,t)=>{try{let e=new URL(t.trim()),r=new URL(n),i=r.pathname.replace(/\/$/,``);return`<loc>${X(r.origin+i+e.pathname+e.search)}</loc>`}catch{return`<loc>${X(n)}</loc>`}}):e.split(`
132
+ `).map(e=>{let t=e.trim();if(!t)return e;if(t.startsWith(`http://`)||t.startsWith(`https://`))try{let e=new URL(t),r=new URL(n);return e.protocol=r.protocol,e.host=r.host,e.pathname=(r.pathname.endsWith(`/`)?r.pathname.slice(0,-1):r.pathname)+e.pathname,e.toString()}catch{return n}if(t.startsWith(`/`))try{return new URL(t,n).toString()}catch{return e}return e}).join(`
133
+ `)}function ss(e,t,n){let r=e,i=t.site||{};if(i.title&&(r=r.replace(/<title>[^<]*<\/title>/iu,`<title>${X(i.title)} - Not Found</title>`)),n){let e=n.endsWith(`/`)?n:n+`/`;r=r.replace(/l\.replace\(["']\/shadow-claw\/["']\)/gu,`l.replace("${X(e)}")`)}return r}function cs(e){let t=D.resolve(e),n=t.split(D.sep),r=n[n.length-1],i=n[n.length-2];return(r===`resources`||r===`deps`)&&i===`pages`?D.resolve(t,`../..`):r===`resources`||r===`deps`||r===`pages`?D.resolve(t,`..`):t}function ls(e){let t=D.resolve(e),n=D.basename(t);return n===`resources`||n===`deps`||n===`pages`?D.resolve(t,`..`):t}function Z(e,t,n){if(!e||typeof e!=`string`)return[];if(D.isAbsolute(e))return[e];let r=e.replace(/^\/+/,``).replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),i=cs(t);return[D.resolve(t,`resources`,r),D.resolve(t,`deps`,r),D.resolve(t,`main`,r),D.resolve(i,`pages`,`resources`,r),D.resolve(i,`pages`,`resources`,e),D.resolve(i,`pages`,`deps`,r),D.resolve(i,`pages`,`deps`,e),D.resolve(i,`resources`,r),D.resolve(i,`resources`,e),D.resolve(i,`deps`,r),D.resolve(i,`deps`,e),D.resolve(n,`pages`,`resources`,r),D.resolve(n,`pages`,`deps`,r),D.resolve(n,`resources`,r),D.resolve(n,`deps`,r),D.resolve(n,`pages`,e),D.resolve(n,`pages`,r),D.resolve(n,`pages`,`main`,r),D.resolve(i,`pages`,e),D.resolve(i,`pages`,r),D.resolve(i,`pages`,`main`,r),D.resolve(i,`pages`,`main`,e),D.resolve(t,e),D.resolve(t,r),D.resolve(n,e),D.resolve(n,r),D.resolve(i,e),D.resolve(i,r)]}async function us(e,t,n){if(!n)return null;let r=await Q([...mo(e),...mo(t),...mo(cs(e))]);if(!r)return null;let i=await Yo(r);return i?Oo(i,n):null}async function Q(e){for(let t of e)if(t)try{return await ye(t),t}catch{}return null}async function ds(e,t,n){let r=n?D.dirname(D.resolve(n)):A.cwd(),i=ls(r),a=cs(r),o=[D.resolve(r,`resources`),D.resolve(r,`deps`),D.resolve(i,`resources`),D.resolve(i,`deps`),D.resolve(i,`pages`,`resources`),D.resolve(i,`pages`,`deps`),D.resolve(a,`resources`),D.resolve(a,`deps`),D.resolve(a,`pages`,`resources`),D.resolve(a,`pages`,`deps`)];for(let e of o)try{let n=await he(e,{withFileTypes:!0});for(let r of n){let n=D.join(e,r.name),i=D.join(t,r.name);r.isDirectory()?await M(n,i,{recursive:!0,force:!0}):r.isFile()&&(await N(D.dirname(i),{recursive:!0}),await j(n,i))}}catch{}let s=await Q([...e.pages?.notFoundPath?Z(e.pages.notFoundPath,r,i):[],...e.branding?.notFoundPath?Z(e.branding.notFoundPath,r,i):[],...e.notFoundPath?Z(e.notFoundPath,r,i):[],...Z(`404.html`,r,i)]);if(s)try{await j(s,D.join(t,`404.html`)),console.log(` Copied custom 404.html: ${s}`)}catch(e){console.warn(` Warning: Could not copy custom 404.html: ${e.message}`)}let c=await Q([...e.pwa?.manifestPath?Z(e.pwa.manifestPath,r,i):[],...e.manifestPath?Z(e.manifestPath,r,i):[],...Z(`manifest.json`,r,i)]);if(c)try{await j(c,D.join(t,`manifest.json`)),console.log(` Copied custom manifest.json: ${c}`)}catch(e){console.warn(` Warning: Could not copy custom manifest.json: ${e.message}`)}if(e.feedPath){let n=await Q(Z(e.feedPath,r,i));if(n)try{let e=D.basename(n);await j(n,D.join(t,e)),console.log(` Copied custom feed: ${n} → ${e}`)}catch(e){console.warn(` Warning: Could not copy custom feed: ${e.message}`)}}let l=!1;if(e.sitemapPath){let n=await Q(Z(e.sitemapPath,r,i));if(n)try{let e=D.basename(n);await j(n,D.join(t,e)),console.log(` Copied custom sitemap: ${n} → ${e}`),l=!0}catch(e){console.warn(` Warning: Could not copy custom sitemap: ${e.message}`)}}if(!l){let e=await Q(Z(`sitemap.xml`,r,i));if(e)try{await j(e,D.join(t,`sitemap.xml`)),console.log(` Copied custom sitemap.xml: ${e}`)}catch(e){console.warn(` Warning: Could not copy custom sitemap.xml: ${e.message}`)}let n=await Q(Z(`sitemap.txt`,r,i));if(n)try{await j(n,D.join(t,`sitemap.txt`)),console.log(` Copied custom sitemap.txt: ${n}`)}catch(e){console.warn(` Warning: Could not copy custom sitemap.txt: ${e.message}`)}}let u=e.overwriteAssets===!0||e.branding?.overwriteAssets===!0,d=Array.isArray(e.assets)?e.assets:[e.assetsDir,e.assets].filter(Boolean),f=Array.from(new Set([...d.flatMap(e=>Z(e,r,i)),...Z(`assets`,r,i)].filter(e=>e&&typeof e==`string`))),p=D.join(t,`assets`);if(u)try{await ve(p,{recursive:!0,force:!0}),await N(p,{recursive:!0}),console.log(` Cleared dist public assets for complete template asset overwrite.`)}catch{}let m=/* @__PURE__ */ new Set,h=[...f].reverse();for(let e of h)if(!m.has(e))try{let t=await ye(e);if(m.add(e),t.isDirectory())await M(e,p,{recursive:!0,force:!0}),console.log(` Copied custom assets: ${e} → ${p}`);else if(t.isFile()){let t=D.basename(e);await N(p,{recursive:!0}),await j(e,D.join(p,t)),console.log(` Copied custom asset file: ${e} → ${p}`)}}catch{}}async function fs(e,t,n){let r=e.theme||{};if(!r.stylesheet)return;let i=n?D.dirname(D.resolve(n)):A.cwd(),a=ls(i),o=await Q(Z(r.stylesheet,i,a));if(!o)return;let s=r.stylesheet.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),c=D.join(t,s);try{await N(D.dirname(c),{recursive:!0}),await j(o,c),console.log(` Copied theme stylesheet: ${o} → ${c}`)}catch(e){console.warn(` Warning: Could not copy theme stylesheet ${o}: ${e.message}`)}}async function ps(e,t,n){let r=(e.customElements&&typeof e.customElements==`object`&&!Array.isArray(e.customElements)?e.customElements?.scripts:void 0)||e.scripts||[];if(!Array.isArray(r)||r.length===0)return;let i=n?D.dirname(D.resolve(n)):A.cwd(),a=ls(i);for(let e of r){let n=typeof e==`string`?e:e?.src;if(!n||n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))continue;let r=await Q(Z(n,i,a));if(r){let e=n.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),i=D.join(t,e);try{await N(D.dirname(i),{recursive:!0}),await j(r,i),console.log(` Copied custom script: ${r} → ${i}`)}catch(e){console.warn(` Warning: Could not copy custom script ${r}: ${e.message}`)}}}}async function ms(e,t,n){let r=e.branding||{},i=e.pwa||{},a=n?D.dirname(D.resolve(n)):A.cwd(),o=ls(a),s=[],c=await Q(Z(i.manifestPath||e.manifestPath||`manifest.json`,a,o));if(c){let e=await Yo(c);e&&Array.isArray(e.icons)&&(s=e.icons.map(e=>e?.src).filter(Boolean))}let l=[r.faviconPath,r.appleTouchIconPath,`assets/icons/favicon.svg`,`assets/icons/favicon.ico`,`favicon.svg`,`favicon.ico`,`pages/resources/assets/icons/favicon.svg`,`pages/resources/assets/icons/favicon.ico`,`pages/resources/favicon.svg`,`pages/deps/favicon.svg`,`pages/main/favicon.svg`,...Array.isArray(i.icons)?i.icons.map(e=>e.src):[],...s].filter(e=>!!e&&typeof e==`string`&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`//`));if(l.length===0)return;let u=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set;for(let e of l){if(u.has(e))continue;u.add(e);let n=await Q(Z(e,a,o));if(n){let r=e.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),i=D.join(t,r);if(d.has(i))continue;d.add(i);try{await N(D.dirname(i),{recursive:!0}),await j(n,i),console.log(` Copied branding asset: ${n} → ${i}`)}catch(e){console.warn(` Warning: Could not copy branding asset ${n}: ${e.message}`)}}}}async function hs(e,t,n){let r=await Yo(t);if(!r)return console.log(`No site-config.json found — skipping site configuration.`),{applied:!1};console.log(`Applying site-config.json...`);let i=n?.pagesOrigin||A.env.PAGES_ORIGIN||``,a=n?.basePath||A.env.PAGES_BASE_PATH||``,o=n?.isProduction??A.env.NODE_ENV===`production`;await ds(r,e,t);let s=t?D.dirname(D.resolve(t)):A.cwd(),c=ls(s),l;if(r.sidebar?.slotHtml)l=r.sidebar.slotHtml;else if(r.sidebar?.sections)l=Qo(r.sidebar.sections);else{let e=await Q([r.sidebar?.slotPath,`pages/main/sidebar.html`,`pages/sidebar.html`,`sidebar.html`,`resources/sidebar.html`].filter(Boolean).flatMap(e=>Z(e,s,c)));e&&(l=await Xo(e)??void 0,console.log(` Found slotted sidebar: ${e}`))}let u=D.join(e,`index.html`),d=await Xo(u);d&&(await Zo(u,rs(d,r,l,{basePath:a,pagesOrigin:i,isProduction:o})),console.log(` Patched index.html`));let f=D.join(e,`share/share-target.html`),p=await Xo(f);if(p){let e=`/`;a&&a.trim()?e=a:o&&(i||r.branding?.siteUrl)&&(e=ts({pagesOrigin:i,siteUrl:r.branding?.siteUrl})),await Zo(f,ns(p,e)),console.log(` Patched share/share-target.html`)}let m=D.join(e,`manifest.json`),h=await Xo(m);h&&(await Zo(m,as(h,r)),console.log(` Patched manifest.json`));let g=D.join(e,`sitemap.xml`),_=!!await Xo(D.join(e,`sitemap.txt`)),v=!1;if(!await Xo(g)&&!_){let e=await us(s,c,i||r.branding?.siteUrl||``);e&&(await Zo(g,e),v=!0,console.log(` Generated sitemap.xml from routes.json`))}let y=v?``:await Xo(g);y&&(await Zo(g,os(y,i)),console.log(` Patched sitemap.xml`));let b=D.join(e,`sitemap.txt`),ee=await Xo(b);if(ee&&(await Zo(b,os(ee,i)),console.log(` Patched sitemap.txt`)),r.feed===!0||typeof r.feed==`object`&&r.feed?.enabled===!0){let t=await Q([...mo(s),...mo(c),...mo(cs(s))]);if(t){let n=await Yo(t);if(n){let t=await Q([D.join(e,`pages/main`),D.join(e,`files/main`),D.join(e,`static-main`),D.join(s,`pages/main`),D.join(s,`main`),D.join(c,`pages/main`),D.resolve(`pages/main`)]),a=await Uo({routesJson:n,siteConfig:r,origin:i||r.branding?.siteUrl||``,pagesDir:t||void 0});for(let[t,n]of Object.entries(a.files)){let r=D.join(e,t);await N(D.dirname(r),{recursive:!0}),await Zo(r,t.endsWith(`.xml`)?Ho(n,i):n)}console.log(` Generated RSS 2.0, Atom, and RDF feeds`)}}}let te=D.join(e,`404.html`),x=await Xo(te);return x&&(await Zo(te,ss(x,r,a)),console.log(` Patched 404.html`)),await fs(r,e,t),await ps(r,e,t),await ms(r,e,t),console.log(`Site configuration applied successfully.`),{applied:!0}}async function gs(){let[e,t]=A.argv.slice(2);(!e||!t)&&(console.error(`Usage: node bin/site-config/apply.mjs <distPublicDir> <siteConfigPath>`),A.exit(1)),await hs(e,t)}A.argv[1]&&D.resolve(A.argv[1])===D.resolve(k(import.meta.url))&&gs().catch(e=>{console.error(`site-config/apply.ts failed:`,e),A.exit(1)});function _s(e){let t=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/mu,``).match(/^#+\s+(.+)$/m);return t?t[1].trim():``}async function vs(e={}){let u=D.resolve(e.publicDir||`dist/public`),v=D.resolve(e.routesPath||`pages/routes.json`),y=D.resolve(e.sourcePath||`pages/main`),te=D.resolve(e.indexPath||D.join(u,`index.html`)),x=e.siteConfig||{},C=!!e.siteConfig;if(!e.siteConfig){let t=[e.siteConfigPath,D.resolve(D.dirname(y),`shadow-claw.config.json`),D.resolve(D.dirname(y),`site-config.json`),D.resolve(`shadow-claw.config.json`),D.resolve(`site-config.json`),D.join(u,`shadow-claw.config.json`),D.join(u,`site-config.json`)].filter(Boolean);for(let n of t)try{let t=await P(n,`utf8`);x=JSON.parse(t),(e.siteConfigPath||n.startsWith(D.dirname(y))||n.startsWith(u)||u.startsWith(A.cwd()))&&(C=!0);break}catch{}}let w=e.prerenderPages===void 0?A.env.PRERENDER_PAGES??1:e.prerenderPages,T=n(w),re;try{re=await P(v,`utf8`)}catch(e){if(e?.code===`ENOENT`)return{count:0,skipped:!0,reason:`No routes.json found`};throw e}let E;try{E=JSON.parse(re)}catch(e){return console.warn(`Failed to parse ${v}:`,e),{count:0,skipped:!0,reason:`Invalid JSON in routes.json`}}if(!E||typeof E!=`object`)return{count:0,skipped:!0,reason:`Invalid routes.json`};E.routes||(E.routes={});let ie={...E.routes||{}},ae=/* @__PURE__ */ new Set;async function O(e,t){if(!e.subRoutes)return;let n=Array.isArray(e.subRoutes)?e.subRoutes:Object.values(e.subRoutes);for(let e of n){let n=D.resolve(D.dirname(t),e);if(typeof e==`string`&&e.startsWith(`pages/`)&&(n=D.resolve(e)),!ae.has(n)){ae.add(n);try{let e=await P(n,`utf8`),t=JSON.parse(e);t.routes&&Object.assign(ie,t.routes),await O(t,n)}catch(e){console.warn(`Failed to read subRoute: ${n}`,e?.message)}}}}await O(E,v),Object.assign(E.routes,ie),Array.isArray(E.subRoutes)&&delete E.subRoutes;let oe={allowList:x?.pages?.allowList??x?.pages?.allowlist??x?.allowList??x?.allowlist,denyList:x?.pages?.denyList??x?.pages?.denylist??x?.denyList??x?.denylist};for(let[e,t]of Object.entries(ie)){let n=_o(e);(!S(n,{...oe,basePathPrefix:y})||!S(e,oe)||t?.prettyPath&&!S(t.prettyPath,oe))&&(delete ie[e],delete E.routes[e])}let se=Object.entries(ie);if(se.length===0)return{count:0,skipped:!0,reason:`Empty routes table`};let ce=JSON.stringify(E,null,2),le=D.join(u,`static-routing.json`);await N(u,{recursive:!0}),await F(le,ce,`utf8`);let k=JSON.stringify(E),ue=D.join(u,`components/shadow-claw/shadow-claw.html`),de=D.join(u,`components/shadow-claw-pages/shadow-claw-pages.html`),fe=D.join(u,`components/shadow-claw-page-header/shadow-claw-page-header.html`),pe=D.join(u,`components/shadow-claw/shadow-claw.css`),j=D.join(u,`components/shadow-claw-pages/shadow-claw-pages.css`),me=D.join(u,`components/shadow-claw-page-header/shadow-claw-page-header.css`),[ge,_e,ve,be,xe,Se,Ce,we]=await Promise.all([P(te,`utf8`),P(ue,`utf8`),P(de,`utf8`).catch(()=>``),P(fe,`utf8`).catch(()=>``),h(y,`desc`,{allowList:x?.pages?.allowList??x?.pages?.allowlist??x?.allowList??x?.allowlist,denyList:x?.pages?.denyList??x?.pages?.denylist??x?.denyList??x?.denylist}),P(pe,`utf8`).catch(()=>``),P(j,`utf8`).catch(()=>``),P(me,`utf8`).catch(()=>``)]),Te=e.isProduction??A.env.NODE_ENV===`production`,Ee=e.singleFile??!1,De=e.basePath===void 0?A.env.PAGES_BASE_PATH||``:e.basePath,Oe=e.pagesOrigin||A.env.PAGES_ORIGIN||``,ke=C&&(Te||e.basePath===void 0)?x?.branding?.siteUrl:void 0,Ae=ge.match(/<base\s+href="([^"]*)"/i),je=Ae?Ae[1]:`/`,Me=De||Oe||ke?ts({basePath:De,pagesOrigin:Oe,siteUrl:ke,defaultBasePath:je}):je,Ne=Ae?ns(ge,De===``?Me===`/`?je:Me:De):ge,Pe=(await Promise.all(xe.map(async e=>{let t=typeof e.inlineContent==`string`?e.inlineContent:await P(e.absolutePath,`utf8`);return{...e,content:t}}))).filter(e=>!(e.displayPath.endsWith(`.md`)&&/^---\r?\n[\s\S]*?slug:\s*"shadow-claw--purge-pages"[\s\S]*?---/mu.test(e.content||``))),Fe=d(vo(Ne,k)),Ie=await l(Fe,u,{isProduction:Te,singleFile:Ee});await F(te,Ie,`utf8`);let I=p(_e),Le=p(ve),Re=p(be),ze=Pe.map(e=>({displayPath:e.displayPath,content:e.content})),Be=D.join(u,`static-main-manifest.json`),L={};try{L=JSON.parse(await P(Be,`utf8`))}catch{}let Ve={pages:ze,...Array.isArray(L.skills)?{skills:L.skills}:{},...Array.isArray(L.tools)?{tools:L.tools}:{},...L.skillsPurgeId?{skillsPurgeId:L.skillsPurgeId}:{},...L.preRenderedStaticPages?{preRenderedStaticPages:L.preRenderedStaticPages}:{},...L.purgeId?{purgeId:L.purgeId}:{}};await F(Be,JSON.stringify(Ve,null,2),`utf8`);try{if((await ye(y)).isDirectory()){let e=D.join(u,`static-main`);await N(e,{recursive:!0}),await M(y,e,{recursive:!0});let t=D.join(u,`files/main`);await N(t,{recursive:!0}),await M(y,t,{recursive:!0})}}catch{}let He=[],Ue=0;for(let[e,n]of se){if(!n||!n.prettyPath)continue;let p=ne(n.prettyPath);if(p===`feed`||p.startsWith(`feed/`)||e.endsWith(`.xml`))continue;let h=_o(e),v=Pe.find(e=>e.displayPath===h);if(!v)try{let e=D.join(y,h);v={absolutePath:e,displayPath:h,content:await P(e,`utf8`)}}catch{console.warn(`Could not find page file for route: ${e} (${h})`);continue}let te=Pe.filter(e=>e.displayPath!==v.displayPath),S=[],C=[];T===`all`?(S=[v,...te],C=S.map(e=>({displayPath:e.displayPath,content:e.content}))):typeof T==`number`&&(T===0?(S=[],C=[]):(S=[v,...te.slice(0,T-1)],C=S.map(e=>({displayPath:e.displayPath,content:e.content}))));let w=ee(v.content||``),re=w.data&&w.data.title?w.data.title:``,E=(x?.customElements?.scripts||[]).map(e=>typeof e==`string`?e:e?.src).filter(Boolean),ie=await a(v.content||``,v.displayPath,{approvedScripts:E}),ae=x?.theme?.stylesheet,O=``;if(typeof ae==`string`&&ae.trim()){let e=s(ae.trim());O=e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)?e:e.replace(/^\/+/,``)}let oe;if(T===0)oe=o(I,Se,x.sidebar);else{let e=_(Le,S,ie,Re,re,Ce,we,O);oe=f(I,e,Se,x.sidebar)}let se=c(Ne,oe),ce=m(se),le=JSON.stringify({pages:C,...Array.isArray(L.skills)?{skills:L.skills}:{},...Array.isArray(L.tools)?{tools:L.tools}:{},...L.skillsPurgeId?{skillsPurgeId:L.skillsPurgeId}:{},...L.preRenderedStaticPages?{preRenderedStaticPages:L.preRenderedStaticPages}:{},...L.purgeId?{purgeId:L.purgeId}:{}}),A=t(ce,le),ue=ne(n.prettyPath),de=ue===``||ue===`index.html`||n.prettyPath===`/`,fe=Ne.match(/<base\s+href="([^"]*)"/i),pe=fe?fe[1]:void 0,j=x?.branding?.siteUrl||void 0,me=To(A,{title:yo({pageTitle:n.title||w.data?.seo_title||w.data?.seoTitle||w.data?.title||_s(v.content||``),siteTitle:x?.site?.title||`ShadowClaw`,siteDescription:x?.site?.description,separator:x?.site?.titleSeparator??x?.site?.sep,titleTemplate:x?.site?.titleTemplate,isHome:de}),description:n.description||w.data?.seo_description||w.data?.seoDescription||w.data?.description||w.data?.excerpt||w.data?.summary||bo(v.content||``,{fallback:x?.site?.description})||x?.site?.description,canonicalUrl:xo({origin:j,basePath:pe,prettyPath:n.prettyPath}),siteTitle:x?.site?.title||`ShadowClaw`,type:de?`website`:`article`}),ge=x?.customElements?.scripts||[],_e=r(ge,w.data,v.content),ve=me;if(_e.length>0){let e=ve.match(/<head[^>]*>([\s\S]*?)<\/head>/i),t=e?e[1]:``,n=_e.filter(e=>!t.includes(`src="${e.src}"`)&&!t.includes(`src='${e.src}'`));if(n.length>0){let e=b(n);ve=i(ve,` ${e.trim()}`)}}let ye=d(vo(ve,k)),be=await l(ye,u,{isProduction:Te,singleFile:Ee}),xe;xe=ue.endsWith(`.html`)?ue:D.join(ue,`index.html`);let De=D.join(u,xe),Oe=D.dirname(De);if(await N(Oe,{recursive:!0}),await F(De,be,`utf8`),v&&v.absolutePath)try{let e=D.dirname(v.absolutePath),t=await he(e,{withFileTypes:!0});for(let n of t)n.isFile()&&!g(n.name)&&n.name!==`routes.json`&&await M(D.join(e,n.name),D.join(Oe,n.name))}catch(t){console.warn(`Failed to copy co-located assets for ${e}:`,t)}if(He.push(xe.replace(/\\/g,`/`)),!ue.endsWith(`.html`)&&ue.length>0){let e=`${ue}.html`,t=D.join(u,e);await N(D.dirname(t),{recursive:!0}),await F(t,be,`utf8`),He.push(e.replace(/\\/g,`/`))}Ue++}return(e.silent??A.env.NODE_ENV===`test`)||console.log(`Prerendered ${Ue} pretty path page${Ue===1?``:`s`} from ${v} (prerender-pages: ${T}).`),{count:Ue,generatedPaths:He,skipped:!1}}async function ys(){let e=A.argv.slice(2).filter(e=>!e.startsWith(`--`)),t=A.argv.slice(2).filter(e=>e.startsWith(`--`)),n;for(let e of t)e.startsWith(`--prerender-pages=`)?n=e.slice(18):e.startsWith(`--pages=`)&&(n=e.slice(8));let r=e[0]||`dist/public`;await vs({publicDir:r,routesPath:e[1]||`pages/routes.json`,sourcePath:e[2]||`pages/main`,indexPath:e[3]||D.join(r,`index.html`),prerenderPages:n})}A.argv[1]&&D.resolve(A.argv[1])===D.resolve(k(import.meta.url))&&ys().catch(e=>{console.error(e),A.exit(1)});function bs(e,t){return`// build: ${t}
134
+ const CDN_BASE = ${JSON.stringify(e.replace(/\/+$/,``)+`/`)};
135
+ const CACHE_NAME = "shadow-claw-single-file";
136
+
137
+ self.addEventListener("message", (event) => {
138
+ if (event.data && event.data.type === "SKIP_WAITING") {
139
+ self.skipWaiting();
140
+ }
141
+ });
142
+
143
+ self.addEventListener("activate", (event) => {
144
+ event.waitUntil(self.clients.claim());
145
+ });
146
+
147
+ async function networkFirst(request) {
148
+ const cache = await caches.open(CACHE_NAME);
149
+ try {
150
+ const response = await fetch(request);
151
+ if (response.ok) {
152
+ await cache.put(request, response.clone());
153
+ }
154
+ return response;
155
+ } catch (err) {
156
+ const cached = await cache.match(request);
157
+ if (cached) {
158
+ return cached;
159
+ }
160
+ throw err;
161
+ }
162
+ }
163
+
164
+ async function staleWhileRevalidate(request) {
165
+ const cache = await caches.open(CACHE_NAME);
166
+ const cached = await cache.match(request);
167
+ const network = fetch(request)
168
+ .then(async (response) => {
169
+ if (response.ok) {
170
+ await cache.put(request, response.clone());
171
+ }
172
+ return response;
173
+ })
174
+ .catch(() => cached);
175
+ return cached || network;
176
+ }
177
+
178
+ self.addEventListener("fetch", (event) => {
179
+ const request = event.request;
180
+ if (request.method !== "GET") {
181
+ return;
182
+ }
183
+
184
+ if (request.mode === "navigate") {
185
+ event.respondWith(networkFirst(request));
186
+ } else if (request.url.startsWith(CDN_BASE)) {
187
+ event.respondWith(staleWhileRevalidate(request));
188
+ }
189
+ });
190
+ `}function xs(e){return` <script data-shadow-claw-sw="true">
191
+ (() => {
192
+ if (!("serviceWorker" in navigator)) return;
193
+ const CHECK_INTERVAL_MS = ${Number(e.checkIntervalMs)};
194
+ const CHECK_ON_FOCUS = ${!!e.checkOnFocus};
195
+ const CHECK_MIN_GAP_MS = ${Number(e.checkMinGapMs)};
196
+ const REPROMPT_INTERVAL_MS = ${Number(e.repromptIntervalMs)};
197
+ const hadController = Boolean(navigator.serviceWorker.controller);
198
+ let registration = null;
199
+ let updateRequested = false;
200
+ let prompting = false;
201
+ let nextPromptAt = 0;
202
+ let lastCheckAt = 0;
203
+
204
+ async function requestDialog(options) {
205
+ const startedAt = Date.now();
206
+ while (Date.now() - startedAt < 5000) {
207
+ const el = document.querySelector("shadow-claw");
208
+ if (el && typeof el.requestDialog === "function") {
209
+ return el.requestDialog(options);
210
+ }
211
+ await new Promise((resolve) => setTimeout(resolve, 50));
212
+ }
213
+ return null;
214
+ }
215
+
216
+ async function promptUpdate() {
217
+ const waiting = registration && registration.waiting;
218
+ if (!waiting || prompting || Date.now() < nextPromptAt) return;
219
+ prompting = true;
220
+ try {
221
+ const accepted = await requestDialog({
222
+ title: "Update Available",
223
+ message: "A new version of ShadowClaw is ready. Reload now to apply the update?",
224
+ confirmLabel: "Reload now",
225
+ cancelLabel: "Later",
226
+ });
227
+ if (accepted === null) return;
228
+ if (accepted) {
229
+ updateRequested = true;
230
+ waiting.postMessage({ type: "SKIP_WAITING" });
231
+ } else {
232
+ nextPromptAt = Date.now() + REPROMPT_INTERVAL_MS;
233
+ }
234
+ } finally {
235
+ prompting = false;
236
+ }
237
+ }
238
+
239
+ async function checkForUpdate(fromFocus) {
240
+ if (!registration) return;
241
+ if (fromFocus && Date.now() - lastCheckAt < CHECK_MIN_GAP_MS) return;
242
+ lastCheckAt = Date.now();
243
+ try {
244
+ await registration.update();
245
+ } catch {}
246
+ await promptUpdate();
247
+ }
248
+
249
+ navigator.serviceWorker.addEventListener("controllerchange", async () => {
250
+ if (updateRequested) {
251
+ location.reload();
252
+ return;
253
+ }
254
+ if (!hadController) return;
255
+ const accepted = await requestDialog({
256
+ title: "Update Installed",
257
+ message: "A new version of ShadowClaw was installed. Reload now?",
258
+ confirmLabel: "Reload now",
259
+ cancelLabel: "Later",
260
+ });
261
+ if (accepted) location.reload();
262
+ });
263
+
264
+ window.addEventListener("load", async () => {
265
+ try {
266
+ let swUrl = "service-worker.js";
267
+ try {
268
+ if (window.trustedTypes && typeof window.trustedTypes.getPolicy === "function") {
269
+ const defaultPolicy =
270
+ window.trustedTypes.getPolicy("default") ||
271
+ window.trustedTypes.getPolicy("shadowclaw-sandbox");
272
+ if (defaultPolicy && typeof defaultPolicy.createScriptURL === "function") {
273
+ swUrl = defaultPolicy.createScriptURL(swUrl);
274
+ }
275
+ }
276
+ } catch {}
277
+ registration = await navigator.serviceWorker.register(swUrl, {
278
+ updateViaCache: "none",
279
+ });
280
+ } catch {
281
+ return;
282
+ }
283
+ registration.addEventListener("updatefound", () => {
284
+ const installing = registration.installing;
285
+ if (!installing) return;
286
+ installing.addEventListener("statechange", () => {
287
+ if (installing.state === "installed" && navigator.serviceWorker.controller) {
288
+ promptUpdate();
289
+ }
290
+ });
291
+ });
292
+ promptUpdate();
293
+ if (CHECK_INTERVAL_MS > 0) {
294
+ setInterval(() => checkForUpdate(false), CHECK_INTERVAL_MS);
295
+ }
296
+ if (CHECK_ON_FOCUS) {
297
+ window.addEventListener("focus", () => checkForUpdate(true));
298
+ document.addEventListener("visibilitychange", () => {
299
+ if (document.visibilityState === "visible") checkForUpdate(true);
300
+ });
301
+ }
302
+ });
303
+ })();
304
+ <\/script>`}async function Ss(t,{writeFileImpl:n=F}={}){let r=t||O(e(import.meta.url),`dist`,`public`);await n(O(r,`.nojekyll`),``,`utf-8`)}A.argv[1]&&D.resolve(A.argv[1])===D.resolve(k(import.meta.url))&&await Ss();const Cs=e(import.meta.url);async function $(e){try{return await ye(e),!0}catch{return!1}}async function ws(e,t){let n=[t?O(t,`package.json`):``,O(Cs,`package.json`),O(e,`package.json`)].filter(Boolean);for(let e of n)if(await $(e))try{let t=JSON.parse(await P(e,`utf8`));if(t.name===`shadow-claw`&&t.version)return t.version}catch{}let r=O(e,`package.json`);if(await $(r))try{let e=JSON.parse(await P(r,`utf8`)),t=e.dependencies?.[`shadow-claw`]||e.devDependencies?.[`shadow-claw`];if(typeof t==`string`&&t.trim()){let e=t.replace(/^[~^>=<v\s]+/,``);if(e)return e}}catch{}return`latest`}async function Ts(e){let{indexPath:t,mainSourcePath:n,contentRoot:r,toolchainRoot:a,cdnBase:o,serviceWorker:s,isQuiet:c,log:l}=e;if(c||l(`Embedding pages, theme, and CDN runtime for single-file distribution...`),await $(t)){let c=await P(t,`utf8`),l=await fo([O(n,`theme.css`),O(r,`pages/main/theme.css`),O(r,`pages/theme.css`),O(r,`theme.css`)]);if(l)try{let e=await P(l,`utf8`);if(e.trim()&&!c.includes(`id="shadow-claw-theme"`)){let t=`<style id="shadow-claw-theme">\n${e.trim()}\n</style>`;c=i(c,` ${t}`)}}catch{}try{let e=await h(n),t=[];for(let n of e){let e=null;if(typeof n.inlineContent==`string`?e=n.inlineContent:n.absolutePath&&await $(n.absolutePath)&&(e=await P(n.absolutePath,`utf8`)),typeof e==`string`){let r=/^memory\.(md|markdown)$/iu.test(n.displayPath)&&e.trim()===x.trim(),i=n.displayPath===`index.html`&&e.trim()===te.trim();r||i?t.push(`<!-- prettier-ignore -->\n <script type="text/markdown" data-shadow-claw-page="${n.displayPath}"><\/script>`):t.push(`<!-- prettier-ignore -->\n <script type="text/markdown" data-shadow-claw-page="${n.displayPath}">${e}<\/script>`)}}t.length>0&&(c=i(c,` ${t.join(`
305
+ `)}`))}catch{}let u=o||de.SHADOWCLAW_CDN;u||=`https://cdn.jsdelivr.net/npm/shadow-claw@${await ws(r,a)}`,u=u.replace(/\/+$/,``),s&&/@(?:latest|next|canary|dev)\b/.test(u)&&console.warn(`Warning: Using --service-worker with an unpinned CDN URL may cause stale runtime assets to be cached.`);let d=`${u}/dist/public/`;c=c.includes(`name="shadow-claw-asset-base"`)?c.replace(/<meta\s+name="shadow-claw-asset-base"[^>]*>/i,`<meta name="shadow-claw-asset-base" content="${d}" />`):/<base\s+href="[^"]*"\s*\/?>/i.test(c)?c.replace(/(<base\s+href="[^"]*"\s*\/?>)/i,`$1\n <meta name="shadow-claw-asset-base" content="${d}" />`):i(c,` <meta name="shadow-claw-asset-base" content="${d}" />`),c=c.replace(/<script\b[^>]*>\s*var\s+ShadowClawThemeInit\b[\s\S]*?<\/script>/giu,`<script src="${d}theme-init.js"><\/script>`),c=c.replace(/<script\s+src="[^"]*?theme-init\.js"><\/script>/gi,`<script src="${d}theme-init.js"><\/script>`),c=/index\.css/i.test(c)?c.replace(/<link\b([^>]*?)href="[^"]*?index\.css"([^>]*?)\/?>/gi,`<link$1href="${d}index.css"$2 />`):i(c,` <link rel="stylesheet" href="${d}index.css" />`);let f=e.siteConfig;if(!f&&e.siteConfigPath&&await $(e.siteConfigPath))try{f=JSON.parse(await P(e.siteConfigPath,`utf8`))}catch{}let p=f?.branding||{},m=f?.pwa||{},g=p.siteUrl||e.pagesOrigin,_=typeof g==`string`&&g.trim()?g.trim().replace(/\/*$/,`/`):``,v=(m.manifestPath||p.manifestPath||`manifest.json`).replace(/^\/+/,``),y=_?`${_}${v}`:`${d}manifest.json`;c=c.replace(/<link\b[^>]*\b(?:href="[^"]*?manifest\.json"|rel=["']?manifest["']?)[^>]*\/?>/giu,`<link rel="manifest" href="${y}" />`);let b=(p.faviconPath||`assets/icons/favicon.ico`).replace(/^\/+/,``).replace(/^pages\/main\//,``),ee=_?`${_}${b}`:`${d}assets/icons/favicon.ico`,S=b.endsWith(`.svg`)?`image/svg+xml`:b.endsWith(`.png`)?`image/png`:`image/x-icon`,C=!1;c=c.replace(/<link\b[^>]*\brel=["']?(?:shortcut\s+)?icon["']?[^>]*\/?>/giu,()=>C?``:(C=!0,`<link rel="icon" href="${ee}" type="${S}" />`)),C||(c=i(c,` <link rel="icon" href="${ee}" type="${S}" />`));let ne=(p.appleTouchIconPath||`assets/icons/180.png`).replace(/^\/+/,``).replace(/^pages\/main\//,``),w=_?`${_}${ne}`:`${d}assets/icons/180.png`,T=!1;if(c=c.replace(/<link\b[^>]*\brel=["']?apple-touch-icon["']?[^>]*\/?>/giu,()=>T?``:(T=!0,`<link rel="apple-touch-icon" href="${w}" />`)),!T&&_&&(c=i(c,` <link rel="apple-touch-icon" href="${w}" />`)),c=c.replace(/\s*<script\s+type="module"\s+src="(?:\.\/|\/)?index\.js"><\/script>/gi,``),c=c.replace(/\s*<script\s+type="module"\s+src="(?:\.\/|\/)?service-worker\/init\.js"><\/script>/gi,``),c=c.replace(/\s*<link\b[^>]*\brel=["']?modulepreload["']?[^>]*\/?>/giu,e=>/\bhref=["']?(?:https?:)?\/\//iu.test(e)?e:``),c=c.replace(/\s*<script\b[^>]*\btype=["']?module["']?[^>]*\bsrc=["'](?!(?:https?:)?\/\/)[^"']*["'][^>]*><\/script>/giu,``),c=c.replace(/\s*<script\b[^>]*\btype=["']?module["']?[^>]*>(?:(?!<\/script>)[\s\S])*?service-worker\.js(?:(?!<\/script>)[\s\S])*?<\/script>/giu,``),c.includes(`<script type="importmap">`))c=c.replace(/"shadow-claw":\s*"[^"]*?\/dist\/lib\/index\.js"/g,`"shadow-claw": "${u}/dist/lib/index.js"`),c=c.replace(/"shadow-claw\/":\s*"[^"]*?"/g,`"shadow-claw/": "${u}/"`);else{let e=[` <!-- Import Map -->`,` <script type="importmap">`,` {`,` "imports": {`,` "shadow-claw": "${u}/dist/lib/index.js",`,` "shadow-claw/": "${u}/"`,` }`,` }`,` <\/script>`,` <!-- ShadowClaw Library Module -->`,` <script type="module">`,` import "shadow-claw";`,` <\/script>`].join(`
306
+ `);c=i(c,e)}if(!c.includes(`data-shadow-claw-dedent="true"`)){let e=[` <!-- Dedent embedded markdown scripts if indented by formatters (e.g. Prettier) -->`,` <script data-shadow-claw-dedent="true">`,` for (const el of document.querySelectorAll('script[type="text/markdown"][data-shadow-claw-page]')) {`,` const text = el.textContent || '';`,` const m = text.match(/^\\r?\\n([ \\t]+)/);`,` if (m) {`,` const indent = m[1].length;`," const regex = new RegExp(`^[ \\\\t]{1,${indent}}`, 'gm');",` el.textContent = text.replace(/^\\r?\\n/, '').replace(regex, '').replace(/\\r?\\n[ \\t]*$/, '\\n');`,` }`,` }`,` <\/script>`].join(`
307
+ `);c=i(c,e)}if(!c.includes(`data-shadow-claw-opfs-cleanup="true"`)){let e=[` <!-- Self-heal stale pre-seeded OPFS files with leading whitespace before frontmatter -->`,` <script data-shadow-claw-opfs-cleanup="true">`,` (async () => {`,` try {`,` if (!navigator.storage?.getDirectory) return;`,` const root = await navigator.storage.getDirectory();`,` const scDir = await root.getDirectoryHandle("shadowclaw", { create: false }).catch(() => null);`,` if (!scDir) return;`,` const groupsDir = await scDir.getDirectoryHandle("groups", { create: false }).catch(() => null);`,` if (!groupsDir) return;`,` for await (const [, grp] of groupsDir.entries()) {`,` if (grp.kind !== "directory") continue;`,` async function cleanDir(dir) {`,` for await (const [name, handle] of dir.entries()) {`,` if (handle.kind === "directory") {`,` await cleanDir(handle);`,` } else if (handle.kind === "file") {`,` try {`,` const file = await handle.getFile();`,` const text = await file.text();`,` if (/^(?:\\r?\\n)+[ \\t]*---/.test(text) || /^[ \\t]+---/.test(text)) {`,` await dir.removeEntry(name);`,` }`,` } catch {}`,` }`,` }`,` }`,` await cleanDir(grp);`,` }`,` } catch {}`,` })();`,` <\/script>`].join(`
308
+ `);c=i(c,e)}let re=O(ae(t),`service-worker.js`);if(s){let e=be(`sha256`).update(c).digest(`hex`).slice(0,12);await F(re,bs(u,e),`utf8`),c.includes(`data-shadow-claw-sw="true"`)||(c=i(c,xs({checkIntervalMs:36e5,checkOnFocus:!0,checkMinGapMs:3e4,repromptIntervalMs:9e5})))}else await ve(re,{force:!0});await F(t,c,`utf8`)}}async function Es(e={}){let t=process.env.NODE_ENV;try{let t=e.quiet??(process.env.NODE_ENV===`test`&&!process.env.VERBOSE),n=e.stdio??(process.env.NODE_ENV===`test`&&!process.env.VERBOSE?`pipe`:`inherit`),r=(...e)=>{t||console.log(...e)},i=ce(e.contentRoot||de.SHADOWCLAW_CONTENT_ROOT||process.cwd()),a=ce(e.toolchainRoot||Cs),o=i===a,{isProduction:s,copyAllAssets:c,prerenderPages:l,prerenderMainMemory:d}=go({...de,...e.isProduction===void 0?{}:{NODE_ENV:e.isProduction?`production`:`development`},...e.copyAllAssets===void 0?{}:{COPY_ALL_ASSETS:String(e.copyAllAssets)},...e.prerenderPages===void 0?{}:{PRERENDER_PAGES:String(e.prerenderPages)},...e.prerenderMainMemory===void 0?{}:{PRERENDER_MAIN_MEMORY:String(e.prerenderMainMemory)}});s?process.env.NODE_ENV=`production`:e.isProduction===!1&&(process.env.NODE_ENV=`development`);async function f(e,r={}){!t&&!r.quiet&&console.log(`> ${e}`);let i=r.stdio??n,a={...process.env,...s?{NODE_ENV:`production`}:{},...r.env||{}};pe(e,{stdio:i,...r,env:a})}if(o){if(ue(Cs),await co(`dist/public`),await N(`dist/public/assets`,{recursive:!0}),c)await M(`assets`,`dist/public`,{recursive:!0});else{await M(`assets/icons`,`dist/public/assets/icons`,{recursive:!0}),await M(`assets/screenshots`,`dist/public/assets/screenshots`,{recursive:!0});try{await M(`assets/fonts`,`dist/public/assets/fonts`,{recursive:!0})}catch{}}await lo([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],`dist/public`);for(let e of po())await uo(e.sources,e.dest,e.opts||{});try{await M(`e2e/README.md`,`dist/public/e2e/README.md`)}catch{}try{await M(`pages`,`dist/public/pages`,{recursive:!0})}catch{}try{await M(`pages/main`,`dist/public/files/main`,{recursive:!0})}catch{}let n;try{let{isTestFileOrDir:e}=await import(`./chunk-V-w0Bata.js`);n=t=>!e(ie(t),t)}catch{}try{await M(`pages/main`,`dist/public/static-main`,{recursive:!0})}catch{}try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await e(process.cwd())}catch{}try{await M(`.agents/skills`,`dist/public/.agents/skills`,{recursive:!0,...n?{filter:n}:{}})}catch{}try{await M(`.agents/tools`,`dist/public/.agents/tools`,{recursive:!0,...n?{filter:n}:{}})}catch{}try{await M(`.agents/scripts`,`dist/public/.agents/scripts`,{recursive:!0,...n?{filter:n}:{}})}catch{}if(await $(`.agents/skills`))try{let{generateSkillsIndex:e}=await import(`./chunk-V-w0Bata.js`);await e(Cs)}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}if(await $(`.well-known`))try{await M(`.well-known`,`dist/public/.well-known`,{recursive:!0,force:!0})}catch{}await f(`npm run -s rolldown`);let o=await fo(ho()),p=o||`pages/site-config.json`,m;if(o)try{m=JSON.parse(await P(o,`utf8`))}catch{}let h=e.pagesOrigin||de.PAGES_ORIGIN,g=s?ts({basePath:e.basePath||de.PAGES_BASE_PATH,pagesOrigin:h,siteUrl:m?.branding?.siteUrl,defaultBasePath:`/shadow-claw/`}):e.basePath||de.PAGES_BASE_PATH||`/`;d?await u({indexPath:`dist/public/index.html`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:p,isProduction:s,singleFile:e.singleFile}):await u({indexPath:`dist/public/index.html`,noSeed:!0,siteConfigPath:p,isProduction:s,singleFile:e.singleFile});try{await hs(`dist/public`,p,{basePath:g,pagesOrigin:h,isProduction:s})}catch{}try{let e=JSON.parse(await P(`package.json`,`utf8`));if(e.version){let t=`dist/public/index.html`,n=await P(t,`utf8`);await F(t,n.replace(/<meta\s+name="version"[^>]*>/,`<meta name="version" content="${e.version}" />`),`utf8`);for(let t of[`.well-known/mcp.json`,`.well-known/mcp/server-card.json`]){let n=O(`dist/public`,t);if(await $(n))try{let t=JSON.parse(await P(n,`utf8`));t.version!==e.version&&(t.version=e.version,await F(n,JSON.stringify(t,null,2)+`
309
+ `,`utf8`))}catch{}}}}catch{}try{let e=`dist/public/index.html`,t=await P(e,`utf8`);await F(e,ns(t,g),`utf8`);let n=`dist/public/share/share-target.html`;if(await $(n)){let e=await P(n,`utf8`);await F(n,ns(e,g),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${h||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${g}`),h)try{let e=`dist/public/manifest.json`,t=await P(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=h,await F(e,JSON.stringify(n,null,2),`utf8`))}catch{}await Ss(`dist/public`);let e=``;try{e=pe(`npm run -s build:pkg:get:meta`,{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}e&&await f(`npm run -s build:pkg:meta "${e}"`)}await vs({publicDir:`dist/public`,routesPath:await fo(mo())||`pages/routes.json`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:p,basePath:g,pagesOrigin:h,isProduction:s,singleFile:e.singleFile}),await f(`npm run -s build:service-worker`);let _=`dist/public/service-worker.js`;if(await $(_)&&await re(_,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-Cwpkwpa9.js`),n=await e(`dist/public`,{silent:t});!t&&n.count>0&&r(`Pre-compressed ${n.count} assets (.br and .gz).`)}catch(e){t||console.warn(`Notice: Asset pre-compression encountered an issue:`,e)}e.singleFile&&await Ts({indexPath:`dist/public/index.html`,mainSourcePath:`pages/main`,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,serviceWorker:e.serviceWorker,siteConfig:m,siteConfigPath:p,pagesOrigin:h,isQuiet:t,log:r}),r(`Build completed successfully.`);return}let p=e.outDir||`dist/public`,m=ce(i,p);await co(m),await N(m,{recursive:!0}),await N(O(m,`assets`),{recursive:!0});let h=O(a,`dist/public`);await $(O(h,`index.js`))||(r(`Building ShadowClaw core toolchain...`),await co(O(a,`dist/public`)),await co(O(a,`dist-electron`)),await f(`npm run -s rolldown`,{cwd:a})),await M(h,m,{recursive:!0,filter:e=>{if(e.includes(`/assets/cache/`)||e.includes(`\\assets\\cache\\`)||e.includes(`/.cache/`)||e.includes(`\\.cache\\`)||e.includes(`/cache/`)||e.includes(`\\cache\\`)||e.endsWith(`/cache`)||e.endsWith(`\\cache`))return!1;if(i!==a){let t=se(h,e).replace(/\\/g,`/`);if(t===`docs`||t.startsWith(`docs/`)||t===`main`||t.startsWith(`main/`)||t===`main.html`||t.startsWith(`main.html.`)||t===`static-main`||t.startsWith(`static-main/`)||t===`static-main-manifest.json`||t.startsWith(`static-main-manifest.json.`)||t===`static-routing.json`||t.startsWith(`static-routing.json.`)||t===`files`||t.startsWith(`files/`)||t===`pages`||t.startsWith(`pages/`)||t===`sitemap.xml`||t.startsWith(`sitemap.xml.`)||t===`sitemap.txt`||t.startsWith(`sitemap.txt.`)||t===`llms.txt`||t.startsWith(`llms.txt.`)||t===`README.md`||t.startsWith(`README.md.`)||t===`AGENTS.md`||t.startsWith(`AGENTS.md.`))return!1}return!0}}),i!==a&&(await co(O(m,`sitemap.xml`)),await co(O(m,`sitemap.txt`)));let g=O(a,`assets`);if(i!==a&&await $(g)){let e=O(g,`icons`);await $(e)&&await M(e,O(m,`assets/icons`),{recursive:!0,force:!1,errorOnExist:!1});let t=O(g,`screenshots`);await $(t)&&await M(t,O(m,`assets/screenshots`),{recursive:!0,force:!1,errorOnExist:!1});let n=O(g,`fonts`);await $(n)&&await M(n,O(m,`assets/fonts`),{recursive:!0,force:!1,errorOnExist:!1})}let _=O(i,`assets`);await $(_)&&(c?await M(_,m,{recursive:!0,force:!0}):(await $(O(_,`icons`))&&await M(O(_,`icons`),O(m,`assets/icons`),{recursive:!0,force:!0}),await $(O(_,`screenshots`))&&await M(O(_,`screenshots`),O(m,`assets/screenshots`),{recursive:!0,force:!0}),await $(O(_,`fonts`))&&await M(O(_,`fonts`),O(m,`assets/fonts`),{recursive:!0,force:!0}))),await lo([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],m,{baseDir:i});let v=po({contentRoot:i,toolchainRoot:a,distPublicDir:m});for(let e of v)await uo(e.sources,e.dest,e.opts||{});let y=O(i,`pages`);await $(y)&&await M(y,O(m,`pages`),{recursive:!0,force:!0});let b=O(i,`pages/main`);await $(b)&&(await M(b,O(m,`files/main`),{recursive:!0,force:!0}),await M(b,O(m,`static-main`),{recursive:!0,force:!0}));try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await $(O(i,`.agents`))&&await e(i),i!==a&&await $(O(a,`.agents`))&&await e(a)}catch{}let ee=O(i,`.agents/skills`);await $(ee)&&await M(ee,O(m,`.agents/skills`),{recursive:!0,force:!0});let te=O(a,`.agents/skills`);i!==a&&await $(te)&&await M(te,O(m,`.agents/skills`),{recursive:!0,force:!1,errorOnExist:!1});let x=O(i,`.agents/tools`);if(await $(x))await M(x,O(m,`.agents/tools`),{recursive:!0,force:!0});else{let e=O(a,`.agents/tools`);await $(e)&&await M(e,O(m,`.agents/tools`),{recursive:!0,force:!0})}let S=O(i,`.agents/scripts`);if(await $(S))await M(S,O(m,`.agents/scripts`),{recursive:!0,force:!0});else{let e=O(a,`.agents/scripts`);await $(e)&&await M(e,O(m,`.agents/scripts`),{recursive:!0,force:!0})}let C=O(a,`.well-known`);await $(C)&&await M(C,O(m,`.well-known`),{recursive:!0,force:!0});let ne=O(i,`.well-known`);if(i!==a&&await $(ne)&&await M(ne,O(m,`.well-known`),{recursive:!0,force:!0}),await $(O(m,`.agents/skills`)))try{let{generateSkillsIndex:e}=await import(`./chunk-V-w0Bata.js`);if(await e(m,{metadataRoot:i,outDir:`.well-known/agent-skills`,toolchainRoot:a,includeBundled:!0}),await $(ee))try{await e(i,{toolchainRoot:a,includeBundled:!0})}catch{}}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}let w=await fo(ho(i)),T=w||O(i,`pages/site-config.json`),E=d,D;if(w)try{D=JSON.parse(await P(w,`utf8`))}catch{}e.prerenderMainMemory===void 0&&D&&(D?.settings?.prerenderMainMemory===!1?(E=!1,r(` site-config: prerenderMainMemory=false — pages DSD pre-rendering disabled.`)):D?.settings?.overridePrerenderSkeleton===!1&&r(` site-config: overridePrerenderSkeleton=false — skeleton overlay disabled.`));let ae=O(m,`index.html`),oe=await $(b);E&&(oe||e.singleFile)?await u({indexPath:ae,sourcePath:oe?b:O(a,`pages/main`),prerenderPages:l,siteConfigPath:T,isProduction:s,singleFile:e.singleFile}):await u({indexPath:ae,noSeed:!0,siteConfigPath:T,isProduction:s,singleFile:e.singleFile});let le=e.pagesOrigin||de.PAGES_ORIGIN,k=s?ts({basePath:e.basePath||de.PAGES_BASE_PATH,pagesOrigin:le,siteUrl:D?.branding?.siteUrl,defaultBasePath:`/`}):e.basePath||de.PAGES_BASE_PATH||`/`;try{await hs(m,T,{basePath:k,pagesOrigin:le,isProduction:s})}catch{}try{let e=await P(ae,`utf8`);e=ns(e,k);let t=``;try{let e=await fo([O(i,`package.json`),O(a,`package.json`)]);e&&(t=JSON.parse(await P(e,`utf8`)).version||``)}catch{}if(t){e=e.replace(/<meta\s+name="version"[^>]*>/,`<meta name="version" content="${t}" />`);for(let e of[`.well-known/mcp.json`,`.well-known/mcp/server-card.json`]){let n=O(m,e);if(await $(n))try{let e=JSON.parse(await P(n,`utf8`));e.version!==t&&(e.version=t,await F(n,JSON.stringify(e,null,2)+`
310
+ `,`utf8`))}catch{}}}await F(ae,e,`utf8`);let n=O(m,`share/share-target.html`);if(await $(n)){let e=await P(n,`utf8`);await F(n,ns(e,k),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${le||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${k}`),le)try{let e=O(m,`manifest.json`),t=await P(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=le,await F(e,JSON.stringify(n,null,2),`utf8`))}catch{}await F(O(m,`.nojekyll`),``,`utf8`);let e=``;try{e=pe(`git rev-parse HEAD`,{cwd:i,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{try{e=pe(`git rev-parse HEAD`,{cwd:a,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}}if(e){let t=await P(ae,`utf8`);await F(ae,t.replace(/<meta\s+name="revision"[^>]*>/,`<meta name="revision" content="${e}" />`),`utf8`)}}let A=await fo(mo(i))||O(i,`pages/routes.json`),fe=await $(b)?b:O(a,`pages/main`);await vs({publicDir:m,routesPath:A,sourcePath:fe,prerenderPages:l,siteConfigPath:T,basePath:k,pagesOrigin:le,isProduction:s,singleFile:e.singleFile});let j=O(m,`service-worker.js`);if(await $(j)&&await re(j,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-Cwpkwpa9.js`),n=await e(m,{silent:t});!t&&n.count>0&&r(`Pre-compressed ${n.count} assets (.br and .gz).`)}catch(e){t||console.warn(`Notice: Asset pre-compression encountered an issue:`,e)}e.singleFile?await Ts({indexPath:O(m,`index.html`),mainSourcePath:fe,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,serviceWorker:e.serviceWorker,siteConfig:D,siteConfigPath:T,pagesOrigin:le,isQuiet:t,log:r}):e.serviceWorker&&console.warn(`Warning: --service-worker is only supported in combination with --single-file and will be ignored.`),r(`Build completed successfully.`)}finally{t===void 0?delete process.env.NODE_ENV:process.env.NODE_ENV=t}}process.argv[1]&&ce(process.argv[1])===ce(k(import.meta.url))&&Es().catch(e=>{console.error(e),fe(1)});export{Es as t};