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,396 @@
1
+ import{o as e,t}from"./chunk-B--rR4-3.js";import{t as n}from"./chunk-uAI_Zi6n.js";import{t as r}from"./chunk-CasDHXCj.js";import{i,r as a,t as o}from"./chunk-4-QO2z6r.js";import{a as s,i as c,o as l,r as u,s as d}from"./chunk-B409KI5N.js";import"./chunk-DnR17T-6.js";import*as f from"node:fs";import{existsSync as p}from"node:fs";import m,{basename as h,dirname as g,join as _,posix as v,relative as y,resolve as b,win32 as x}from"node:path";import{fileURLToPath as S}from"node:url";import C,{chdir as w,env as T,exit as E}from"node:process";import{execSync as D}from"node:child_process";import{copyFile as O,cp as k,lstat as ee,mkdir as A,readFile as j,readdir as M,readlink as N,realpath as P,rm as F,stat as I,writeFile as L}from"node:fs/promises";import R from"process";import{createHash as te}from"node:crypto";import{Buffer as z}from"buffer";import{chmodSync as B,lstatSync as V,lstatSync as H,readdir as U,readdirSync as ne,readlinkSync as re,realpathSync as ie,renameSync as ae,rmSync as oe,rmdirSync as se,statSync as ce,unlinkSync as W}from"fs";import{EventEmitter as le}from"node:events";import ue from"node:stream";import{StringDecoder as G}from"node:string_decoder";import{basename as de,parse as K,resolve as fe}from"path";import{inspect as pe}from"util";import me from"fs/promises";import{setTimeout as he}from"timers/promises";import{tmpdir as ge}from"os";var _e=(e,t,n)=>{let r=e instanceof RegExp?ve(e,n):e,i=t instanceof RegExp?ve(t,n):t,a=r!==null&&i!=null&&ye(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)}},ve=(e,t)=>{let n=t.match(e);return n?n[0]:null},ye=(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},be=`\0SLASH`+Math.random()+`\0`,xe=`\0OPEN`+Math.random()+`\0`,Se=`\0CLOSE`+Math.random()+`\0`,Ce=`\0COMMA`+Math.random()+`\0`,we=`\0PERIOD`+Math.random()+`\0`,Te=new RegExp(be,`g`),Ee=new RegExp(xe,`g`),De=new RegExp(Se,`g`),Oe=new RegExp(Ce,`g`),ke=new RegExp(we,`g`),Ae=/\\\\/g,je=/\\{/g,Me=/\\}/g,Ne=/\\,/g,Pe=/\\./g,Fe=1e5;function Ie(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Le(e){return e.replace(Ae,be).replace(je,xe).replace(Me,Se).replace(Ne,Ce).replace(Pe,we)}function Re(e){return e.replace(Te,`\\`).replace(Ee,`{`).replace(De,`}`).replace(Oe,`,`).replace(ke,`.`)}function ze(e){if(!e)return[``];let t=[],n=_e(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=ze(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function Be(e,t={}){if(!e)return[];let{max:n=Fe}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),Ge(Le(e),n,!0).map(Re)}function Ve(e){return`{`+e+`}`}function He(e){return/^-?0\d/.test(e)}function Ue(e,t){return e<=t}function We(e,t){return e>=t}function Ge(e,t,n){let r=[],i=_e(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?Ge(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+Se+i.post,Ge(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=ze(i.body),d.length===1&&d[0]!==void 0&&(d=Ge(d[0],t,!1).map(Ve),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=Ie(d[0]),t=Ie(d[1]),n=Math.max(d[0].length,d[1].length),r=d.length===3&&d[2]!==void 0?Math.abs(Ie(d[2])):1,i=Ue;t<e&&(r*=-1,i=We);let a=d.some(He);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,Ge(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 Ke=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},qe={"[: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]},Je=e=>e.replace(/[[\]\\-]/g,`\\$&`),Ye=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Xe=e=>e.join(``),Ze=(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(qe))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(Je(d)+`-`+Je(t)):t===d&&r.push(Je(t)),d=``,a++):e.startsWith(`-]`,a+1)?(r.push(Je(t+`-`)),a+=2):e.startsWith(`-`,a+1)?(d=t,a+=2):(r.push(Je(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[Ye(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+Xe(r)+`]`,p=`[`+(l?``:`^`)+Xe(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},Qe=(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`),$e=/* @__PURE__ */ new Set([`!`,`?`,`+`,`*`,`@`]),et=e=>$e.has(e),tt=`(?!(?:^|/)\\.\\.?(?:$|/))`,nt=`(?!\\.)`,rt=/* @__PURE__ */ new Set([`[`,`.`]),it=/* @__PURE__ */ new Set([`..`,`.`]),at=/* @__PURE__ */ new Set(`().*{}+?[]^$\\!`),ot=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),st=`[^/]`,ct=st+`*?`,lt=st+`+?`,ut=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&&et(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(et(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&&it.has(this.#r[0]))){let e=rt,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?tt:o?nt:``}let o=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(o=`(?:$|\\/)`),[a+i+o,Qe(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,Qe(this.toString()),!1,!1]}let o=!r||t||n||!nt?``:this.#p(!0);o===a&&(o=``),o&&(a=`(?:${a})(?:${o})*?`);let s=``;if(this.type===`!`&&this.#u)s=(this.isStart()&&!n?nt:``)+lt;else{let e=this.type===`!`?`))`+(this.isStart()&&!n&&!t?nt:``)+ct+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&o?`)`:this.type===`*`&&o?`)?`:`)${this.type}`;s=i+a+e}return[s,Qe(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)?lt:ct,t=!0}else if(o=!1,c===`\\`)s===e.length-1?i+=`\\\\`:r=!0;else{if(c===`[`){let[n,r,o,c]=Ze(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}c===`?`?(i+=st,t=!0):i+=ot(c)}}return[i,Qe(e),!!t,a]}},dt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),ft=(e,t,n={})=>(Ke(t),!n.nocomment&&t.charAt(0)===`#`?!1:new Ut(t,n).match(e)),pt=/^\*+([^+@!?\*\[\(]*)$/,mt=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),ht=e=>t=>t.endsWith(e),gt=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),_t=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),vt=/^\*+\.\*+$/,yt=e=>!e.startsWith(`.`)&&e.includes(`.`),bt=e=>e!==`.`&&e!==`..`&&e.includes(`.`),xt=/^\.\*+$/,St=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Ct=/^\*+$/,wt=e=>e.length!==0&&!e.startsWith(`.`),Tt=e=>e.length!==0&&e!==`.`&&e!==`..`,Et=/^\?+([^+@!?\*\[\(]*)?$/,Dt=([e,t=``])=>{let n=jt([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Ot=([e,t=``])=>{let n=Mt([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},kt=([e,t=``])=>{let n=Mt([e]);return t?e=>n(e)&&e.endsWith(t):n},At=([e,t=``])=>{let n=jt([e]);return t?e=>n(e)&&e.endsWith(t):n},jt=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},Mt=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},Nt=typeof R==`object`&&R?typeof R.env==`object`&&R.env&&R.env.__MINIMATCH_TESTING_PLATFORM__||R.platform:`posix`,Pt={win32:{sep:`\\`},posix:{sep:`/`}};ft.sep=Nt===`win32`?Pt.win32.sep:Pt.posix.sep;var Ft=Symbol(`globstar **`);ft.GLOBSTAR=Ft;var It=`[^/]*?`,Lt=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,Rt=`(?:(?!(?:\\/|^)\\.).)*?`;ft.filter=(e,t={})=>n=>ft(n,e,t);var zt=(e,t={})=>Object.assign({},e,t);ft.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return ft;let t=ft;return Object.assign((n,r,i={})=>t(n,r,zt(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,zt(e,n))}static defaults(n){return t.defaults(zt(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,zt(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,zt(e,r))}},unescape:(n,r={})=>t.unescape(n,zt(e,r)),escape:(n,r={})=>t.escape(n,zt(e,r)),filter:(n,r={})=>t.filter(n,zt(e,r)),defaults:n=>t.defaults(zt(e,n)),makeRe:(n,r={})=>t.makeRe(n,zt(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,zt(e,r)),match:(n,r,i={})=>t.match(n,r,zt(e,i)),sep:t.sep,GLOBSTAR:Ft})};var Bt=(e,t={})=>(Ke(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Be(e,{max:t.braceExpandMax}));ft.braceExpand=Bt,ft.makeRe=(e,t={})=>new Ut(e,t).makeRe(),ft.match=(e,t,n={})=>{let r=new Ut(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var Vt=/[?*]|[+@!]\(.*?\)|\[|\]/,Ht=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Ut=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Ke(e),t||={},this.options=t,this.pattern=e,this.platform=t.platform||Nt,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]===`?`||!Vt.test(e[2]))&&!Vt.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===Ft){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 Bt(this.pattern,this.options)}parse(e){Ke(e);let t=this.options;if(e===`**`)return Ft;if(e===``)return``;let n,r=null;(n=e.match(Ct))?r=t.dot?Tt:wt:(n=e.match(pt))?r=(t.nocase?t.dot?_t:gt:t.dot?ht:mt)(n[1]):(n=e.match(Et))?r=(t.nocase?t.dot?Ot:Dt:t.dot?kt:At)(n):(n=e.match(vt))?r=t.dot?bt:yt:(n=e.match(xt))&&(r=St);let i=ut.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?It:t.dot?Lt:Rt,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`?Ht(e):e===Ft?Ft:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==Ft||a===Ft||(a===void 0?i!==void 0&&i!==Ft?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==Ft&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=Ft))});let i=t.filter(e=>e!==Ft);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 ft.defaults(e).Minimatch}};ft.AST=ut,ft.Minimatch=Ut,ft.escape=dt,ft.unescape=Qe;var Wt=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Gt=/* @__PURE__ */ new Set,Kt=typeof R==`object`&&R?R:{},qt=(e,t,n,r)=>{typeof Kt.emitWarning==`function`?Kt.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},Jt=globalThis.AbortController,Yt=globalThis.AbortSignal;if(typeof Jt>`u`){Yt=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},Jt=class{constructor(){t()}signal=new Yt;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=Kt.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,qt("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 Xt=e=>!Gt.has(e),Zt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Qt=e=>Zt(e)?e<=256?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?$t:null:null,$t=class extends Array{constructor(e){super(e),this.fill(0)}},en=class e{heap;length;static#e=!1;static create(t){let n=Qt(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:x,allowStaleOnFetchAbort:S,ignoreFetchAbort:C,perf:w}=t;if(w!==void 0&&typeof w?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=w??Wt,n!==0&&!Zt(n))throw TypeError(`max option must be a nonnegative integer`);let T=n?Qt(n):Array;if(!T)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 T(n),this.#m=new T(n),this.#h=0,this.#g=0,this.#_=en.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=!!x,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(this.#t!==0&&!Zt(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!Zt(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=Zt(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!Zt(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`;Xt(t)&&(Gt.add(t),qt(`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 $t(this.#e),t=new $t(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 $t(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(!Zt(n)){if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Zt(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 Jt,{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 Jt}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)}}},nn=typeof R==`object`&&R?R:{stdout:null,stderr:null},rn=e=>!!e&&typeof e==`object`&&(e instanceof Kn||e instanceof ue||an(e)||on(e)),an=e=>!!e&&typeof e==`object`&&e instanceof le&&typeof e.pipe==`function`&&e.pipe!==ue.Writable.prototype.pipe,on=e=>!!e&&typeof e==`object`&&e instanceof le&&typeof e.write==`function`&&typeof e.end==`function`,sn=Symbol(`EOF`),cn=Symbol(`maybeEmitEnd`),ln=Symbol(`emittedEnd`),un=Symbol(`emittingEnd`),dn=Symbol(`emittedError`),fn=Symbol(`closed`),pn=Symbol(`read`),mn=Symbol(`flush`),hn=Symbol(`flushChunk`),gn=Symbol(`encoding`),_n=Symbol(`decoder`),vn=Symbol(`flowing`),yn=Symbol(`paused`),bn=Symbol(`resume`),xn=Symbol(`buffer`),Sn=Symbol(`pipes`),Cn=Symbol(`bufferLength`),wn=Symbol(`bufferPush`),Tn=Symbol(`bufferShift`),En=Symbol(`objectMode`),q=Symbol(`destroyed`),Dn=Symbol(`error`),On=Symbol(`emitData`),kn=Symbol(`emitEnd`),An=Symbol(`emitEnd2`),jn=Symbol(`async`),Mn=Symbol(`abort`),Nn=Symbol(`aborted`),Pn=Symbol(`signal`),Fn=Symbol(`dataListeners`),In=Symbol(`discarded`),Ln=e=>Promise.resolve().then(e),Rn=e=>e(),zn=e=>e===`end`||e===`finish`||e===`prefinish`,Bn=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,Vn=e=>!z.isBuffer(e)&&ArrayBuffer.isView(e),Hn=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[bn](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Un=class extends Hn{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)}},Wn=e=>!!e.objectMode,Gn=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`,Kn=class extends le{[vn]=!1;[yn]=!1;[Sn]=[];[xn]=[];[En];[gn];[jn];[_n];[sn]=!1;[ln]=!1;[un]=!1;[fn]=!1;[dn]=null;[Cn]=0;[q]=!1;[Pn];[Nn]=!1;[Fn]=0;[In]=!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`);Wn(t)?(this[En]=!0,this[gn]=null):Gn(t)?(this[gn]=t.encoding,this[En]=!1):(this[En]=!1,this[gn]=null),this[jn]=!!t.async,this[_n]=this[gn]?new G(this[gn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[xn]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Sn]});let{signal:n}=t;n&&(this[Pn]=n,n.aborted?this[Mn]():n.addEventListener(`abort`,()=>this[Mn]()))}get bufferLength(){return this[Cn]}get encoding(){return this[gn]}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[En]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[jn]}set async(e){this[jn]=this[jn]||!!e}[Mn](){this[Nn]=!0,this.emit(`abort`,this[Pn]?.reason),this.destroy(this[Pn]?.reason)}get aborted(){return this[Nn]}set aborted(e){}write(e,t,n){if(this[Nn])return!1;if(this[sn])throw Error(`write after end`);if(this[q])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[jn]?Ln:Rn;if(!this[En]&&!z.isBuffer(e)){if(Vn(e))e=z.from(e.buffer,e.byteOffset,e.byteLength);else if(Bn(e))e=z.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[En]?(this[vn]&&this[Cn]!==0&&this[mn](!0),this[vn]?this.emit(`data`,e):this[wn](e),this[Cn]!==0&&this.emit(`readable`),n&&r(n),this[vn]):e.length?(typeof e==`string`&&(t!==this[gn]||this[_n]?.lastNeed)&&(e=z.from(e,t)),z.isBuffer(e)&&this[gn]&&(e=this[_n].write(e)),this[vn]&&this[Cn]!==0&&this[mn](!0),this[vn]?this.emit(`data`,e):this[wn](e),this[Cn]!==0&&this.emit(`readable`),n&&r(n),this[vn]):(this[Cn]!==0&&this.emit(`readable`),n&&r(n),this[vn])}read(e){if(this[q])return null;if(this[In]=!1,this[Cn]===0||e===0||e&&e>this[Cn])return this[cn](),null;this[En]&&(e=null),this[xn].length>1&&!this[En]&&(this[xn]=[this[gn]?this[xn].join(``):z.concat(this[xn],this[Cn])]);let t=this[pn](e||null,this[xn][0]);return this[cn](),t}[pn](e,t){if(this[En])this[Tn]();else{let n=t;e===n.length||e===null?this[Tn]():typeof n==`string`?(this[xn][0]=n.slice(e),t=n.slice(0,e),this[Cn]-=e):(this[xn][0]=n.subarray(e),t=n.subarray(0,e),this[Cn]-=e)}return this.emit(`data`,t),!this[xn].length&&!this[sn]&&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[sn]=!0,this.writable=!1,(this[vn]||!this[yn])&&this[cn](),this}[bn](){this[q]||(!this[Fn]&&!this[Sn].length&&(this[In]=!0),this[yn]=!1,this[vn]=!0,this.emit(`resume`),this[xn].length?this[mn]():this[sn]?this[cn]():this.emit(`drain`))}resume(){return this[bn]()}pause(){this[vn]=!1,this[yn]=!0,this[In]=!1}get destroyed(){return this[q]}get flowing(){return this[vn]}get paused(){return this[yn]}[wn](e){this[En]?this[Cn]+=1:this[Cn]+=e.length,this[xn].push(e)}[Tn](){return this[En]?--this[Cn]:this[Cn]-=this[xn][0].length,this[xn].shift()}[mn](e=!1){do;while(this[hn](this[Tn]())&&this[xn].length);!e&&!this[xn].length&&!this[sn]&&this.emit(`drain`)}[hn](e){return this.emit(`data`,e),this[vn]}pipe(e,t){if(this[q])return e;this[In]=!1;let n=this[ln];return t||={},e===nn.stdout||e===nn.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[Sn].push(t.proxyErrors?new Un(this,e,t):new Hn(this,e,t)),this[jn]?Ln(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this[Sn].find(t=>t.dest===e);t&&(this[Sn].length===1?(this[vn]&&this[Fn]===0&&(this[vn]=!1),this[Sn]=[]):this[Sn].splice(this[Sn].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[In]=!1,this[Fn]++,!this[Sn].length&&!this[vn]&&this[bn]();else if(e===`readable`&&this[Cn]!==0)super.emit(`readable`);else if(zn(e)&&this[ln])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[dn]){let e=t;this[jn]?Ln(()=>e.call(this,this[dn])):e.call(this,this[dn])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[Fn]=this.listeners(`data`).length,this[Fn]===0&&!this[In]&&!this[Sn].length&&(this[vn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[Fn]=0,!this[In]&&!this[Sn].length&&(this[vn]=!1)),t}get emittedEnd(){return this[ln]}[cn](){!this[un]&&!this[ln]&&!this[q]&&this[xn].length===0&&this[sn]&&(this[un]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[fn]&&this.emit(`close`),this[un]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==q&&this[q])return!1;if(e===`data`)return!this[En]&&!n?!1:this[jn]?(Ln(()=>this[On](n)),!0):this[On](n);if(e===`end`)return this[kn]();if(e===`close`){if(this[fn]=!0,!this[ln]&&!this[q])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}if(e===`error`){this[dn]=n,super.emit(Dn,n);let e=!this[Pn]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[cn](),e}if(e===`resume`){let e=super.emit(`resume`);return this[cn](),e}if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[cn](),r}[On](e){for(let t of this[Sn])t.dest.write(e)===!1&&this.pause();let t=!this[In]&&super.emit(`data`,e);return this[cn](),t}[kn](){return!this[ln]&&(this[ln]=!0,this.readable=!1,this[jn]?(Ln(()=>this[An]()),!0):this[An]())}[An](){if(this[_n]){let e=this[_n].end();if(e){for(let t of this[Sn])t.dest.write(e);this[In]||super.emit(`data`,e)}}for(let e of this[Sn])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[En]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[En]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[En])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[gn]?e.join(``):z.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(q,()=>t(/* @__PURE__ */ Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[In]=!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[sn])return t();let r,i,a=e=>{this.off(`data`,o),this.off(`end`,s),this.off(q,c),t(),i(e)},o=e=>{this.off(`error`,a),this.off(`end`,s),this.off(q,c),this.pause(),r({value:e,done:!!this[sn]})},s=()=>{this.off(`error`,a),this.off(`data`,o),this.off(q,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(q,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[In]=!1;let e=!1,t=()=>(this.pause(),this.off(Dn,t),this.off(q,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(Dn,t),this.once(q,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[q])return e?this.emit(`error`,e):this.emit(q),this;this[q]=!0,this[In]=!0,this[xn].length=0,this[Cn]=0;let t=this;return typeof t.close==`function`&&!this[fn]&&t.close(),e?this.emit(`error`,e):this.emit(q),this}static get isStream(){return rn}},qn=ie.native,Jn={lstatSync:V,readdir:U,readdirSync:ne,readlinkSync:re,realpathSync:qn,promises:{lstat:ee,readdir:M,readlink:N,realpath:P}},Yn=e=>!e||e===Jn||e===f?Jn:{...Jn,...e,promises:{...Jn.promises,...e.promises||{}}},Xn=/^\\\\\?\\([a-z]:)\\?$/i,Zn=e=>e.replace(/\//g,`\\`).replace(Xn,`$1\\`),Qn=/[\\\/]/,$n=0,er=1,tr=2,nr=4,rr=6,ir=8,ar=10,or=12,sr=15,cr=~sr,lr=16,ur=32,dr=64,fr=128,pr=256,mr=512,hr=dr|fr|mr,gr=1023,_r=e=>e.isFile()?ir:e.isDirectory()?nr:e.isSymbolicLink()?ar:e.isCharacterDevice()?tr:e.isBlockDevice()?rr:e.isSocket()?or:e.isFIFO()?er:$n,vr=new tn({max:4096}),yr=e=>{let t=vr.get(e);if(t)return t;let n=e.normalize(`NFKD`);return vr.set(e,n),n},br=new tn({max:4096}),xr=e=>{let t=br.get(e);if(t)return t;let n=yr(e.toLowerCase());return br.set(e,n),n},Sr=class extends tn{constructor(){super({max:256})}},Cr=class extends tn{constructor(e=16384){super({maxSize:e,sizeCalculation:e=>e.length+1})}},wr=Symbol(`PathScurry setAsCwd`),Tr=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=$n,n,r,i,a,o){this.name=e,this.#y=i?xr(e):yr(e),this.#T=t&gr,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:Yn(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&=~lr,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?xr(e):yr(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,$n,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#T|=fr),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&sr)===$n}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&sr)===ir}isDirectory(){return(this.#T&sr)===nr}isCharacterDevice(){return(this.#T&sr)===tr}isBlockDevice(){return(this.#T&sr)===rr}isFIFO(){return(this.#T&sr)===er}isSocket(){return(this.#T&sr)===or}isSymbolicLink(){return(this.#T&ar)===ar}lstatCached(){return this.#T&ur?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&sr;return!(e!==$n&&e!==ar||this.#T&pr||this.#T&fr)}calledReaddir(){return!!(this.#T&lr)}isENOENT(){return!!(this.#T&fr)}isNamed(e){return this.nocase?this.#y===xr(e):this.#y===yr(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|=lr;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#j()}}#j(){this.#T&fr||(this.#T=(this.#T|fr)&cr,this.#M())}#M(){let e=this.children();e.provisional=0;for(let t of e)t.#j()}#N(){this.#T|=mr,this.#P()}#P(){if(this.#T&dr)return;let e=this.#T;(e&sr)===nr&&(e&=cr),this.#T=e|dr,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|=pr,e===`ENOENT`&&(t|=fr),(e===`EINVAL`||e===`UNKNOWN`)&&(t&=cr),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=_r(e),r=this.newChild(e.name,n,{parent:this}),i=r.#T&sr;return i!==nr&&i!==ar&&i!==$n&&(r.#T|=dr),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?xr(e.name):yr(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&cr|_r(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&fr)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#I(e.code)}}lstatSync(){if((this.#T&fr)===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=_r(e);this.#T=this.#T&cr|y|ur,y!==$n&&y!==nr&&y!==ar&&(this.#T|=dr)}#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&hr)return!1;let e=sr&this.#T;return e===$n||e===nr||e===ar}shouldWalk(e,t){return(this.#T&nr)===nr&&!(this.#T&hr)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((mr|pr|fr)&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(!((mr|pr|fr)&this.#T))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}[wr](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}},Er=class e extends Tr{sep=`\\`;splitSep=Qn;constructor(e,t=$n,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=$n,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return x.parse(e).root}getRoot(e){if(e=Zn(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 kr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(Xn,`$1\\`),e===t}},Dr=class e extends Tr{splitSep=`/`;sep=`/`;constructor(e,t=$n,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=$n,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Or=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=R.cwd(),t,n,{nocase:r,childrenCacheSize:i=16384,fs:a=Jn}={}){this.#r=Yn(a),(e instanceof URL||e.startsWith(`file://`))&&(e=S(e));let o=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new Sr,this.#t=new Sr,this.#n=new Cr(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(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 Tr||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new Kn({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 Tr||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new Kn({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[wr](t)}},kr=class extends Or{sep=`\\`;constructor(e=R.cwd(),t={}){let{nocase:n=!0}=t;super(e,x,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return x.parse(e).root.toUpperCase()}newRoot(e){return new Er(this.rootPath,nr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}},Ar=class extends Or{sep=`/`;constructor(e=R.cwd(),t={}){let{nocase:n=!1}=t;super(e,v,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new Dr(this.rootPath,nr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}},jr=class extends Ar{constructor(e=R.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};R.platform;var Mr=R.platform===`win32`?kr:R.platform===`darwin`?jr:Ar,Nr=e=>e.length>=1,Pr=e=>e.length>=1,Fr=Symbol.for(`nodejs.util.inspect.custom`),Ir=class e{#e;#t;#n;length;#r;#i;#a;#o;#s;#c;#l=!0;constructor(e,t,n,r){if(!Nr(e))throw TypeError(`empty pattern list`);if(!Pr(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}}}[Fr](){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]===Ft}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)}},Lr=typeof R==`object`&&R&&typeof R.platform==`string`?R.platform:`linux`,Rr=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:r,noglobstar:i,platform:a=Lr}){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 Ut(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 Ir(n,r,0,this.platform),a=new Ut(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}},zr=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()]))}},Br=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)])}},Vr=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())}},Hr=class e{hasWalkedCache;matches=new Br;subwalks=new Vr;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new zr}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===Ft){(!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===Ft?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))}},Ur=(e,t)=>typeof e==`string`?new Rr([e],t):Array.isArray(e)?new Rr(e,t):e,Wr=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=Ur(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 Hr(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 Hr(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()}},Gr=class extends Wr{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}},Kr=class extends Wr{results;constructor(e,t,n){super(e,t,n),this.results=new Kn({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}},qr=typeof R==`object`&&R&&typeof R.platform==`string`?R.platform:`linux`,Jr=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=S(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||qr,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`?kr:t.platform===`darwin`?jr:t.platform?Ar:Mr;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 Ut(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 Ir(e,n,0,this.platform)})}async walk(){return[...await new Gr(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 Gr(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 Kr(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 Kr(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()}},Yr=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let n of e)if(new Ut(n,t).hasMagic())return!0;return!1};function Xr(e,t={}){return new Jr(e,t).streamSync()}function Zr(e,t={}){return new Jr(e,t).stream()}function Qr(e,t={}){return new Jr(e,t).walkSync()}async function $r(e,t={}){return new Jr(e,t).walk()}function ei(e,t={}){return new Jr(e,t).iterateSync()}function ti(e,t={}){return new Jr(e,t).iterate()}var ni=Xr,ri=Object.assign(Zr,{sync:Xr}),ii=ei,ai=Object.assign(ti,{sync:ei}),oi=Object.assign(Qr,{stream:Xr,iterate:ei}),si=Object.assign($r,{glob:$r,globSync:Qr,sync:oi,globStream:Zr,stream:ri,globStreamSync:Xr,streamSync:ni,globIterate:ti,iterate:ai,globIterateSync:ei,iterateSync:ii,Glob:Jr,hasMagic:Yr,escape:dt,unescape:Qe});si.glob=si;const ci=(e,t)=>e===void 0||typeof e===t,li=e=>!!e&&typeof e==`object`&&ci(e.preserveRoot,`boolean`)&&ci(e.tmp,`string`)&&ci(e.maxRetries,`number`)&&ci(e.retryDelay,`number`)&&ci(e.backoff,`number`)&&ci(e.maxBackoff,`number`)&&(ci(e.glob,`boolean`)||e.glob&&typeof e.glob==`object`)&&ci(e.filter,`function`),ui=e=>{if(!li(e))throw Error(`invalid rimraf options`)},di=e=>{ui(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}}},fi=(e={})=>di(e),pi=(e={})=>di(e),mi=(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`?pe(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=fe(e);let{root:r}=K(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(R.platform===`win32`){let t=/[*|"<>?:]/,{root:n}=K(e);if(t.test(e.substring(n.length)))throw Object.assign(/* @__PURE__ */ Error(`Illegal characters in path.`),{path:e,code:`EINVAL`})}return e},hi=e=>ne(e,{withFileTypes:!0}),gi={chmod:me.chmod,mkdir:me.mkdir,readdir:e=>me.readdir(e,{withFileTypes:!0}),rename:me.rename,rm:me.rm,rmdir:me.rmdir,stat:me.stat,lstat:me.lstat,unlink:me.unlink},{readdir:_i}=gi,vi=e=>_i(e).catch(e=>e),yi=e=>{try{return hi(e)}catch(e){return e}},bi=e=>!!e&&typeof e==`object`,xi=(e,t)=>t in e&&typeof e[t]==`string`,Si=e=>bi(e)&&xi(e,`code`)&&xi(e,`path`),Ci=e=>bi(e)&&xi(e,`code`)?e.code:null,wi=async(e,t)=>e.catch(e=>{if(Ci(e)!==`ENOENT`)throw t??e}),Ti=(e,t)=>{try{return e()}catch(e){if(Ci(e)===`ENOENT`)return;throw t??e}},{lstat:Ei,rmdir:Di,unlink:Oi}=gi,ki=async(e,t)=>(t?.signal?.throwIfAborted(),await wi(Ei(e).then(n=>ji(e,t,n)))??!0),Ai=(e,t)=>(t?.signal?.throwIfAborted(),Ti(()=>Mi(e,t,H(e)))??!0),ji=async(e,t,n)=>{t?.signal?.throwIfAborted();let r=n.isDirectory()?await vi(e):null;if(!Array.isArray(r)){
4
+ /* c8 ignore start */
5
+ if(r){if(Ci(r)===`ENOENT`)return!0;if(Ci(r)!==`ENOTDIR`)throw r}return t.filter&&!await t.filter(e,n)?!1:(await wi(Oi(e)),!0)}return!(await Promise.all(r.map(n=>ji(fe(e,n.name),t,n)))).every(e=>e===!0)||t.preserveRoot===!1&&e===K(e).root||t.filter&&!await t.filter(e,n)?!1:(await wi(Di(e)),!0)},Mi=(e,t,n)=>{t?.signal?.throwIfAborted();let r=n.isDirectory()?yi(e):null;if(!Array.isArray(r)){
6
+ /* c8 ignore start */
7
+ if(r){if(Ci(r)===`ENOENT`)return!0;if(Ci(r)!==`ENOTDIR`)throw r}return t.filter&&!t.filter(e,n)?!1:(Ti(()=>W(e)),!0)}let i=!0;for(let n of r){let r=fe(e,n.name);i=Mi(r,t,n)&&i}return t.preserveRoot===!1&&e===K(e).root||!i||t.filter&&!t.filter(e,n)?!1:(Ti(()=>se(e)),!0)},{chmod:Ni}=gi,Pi=e=>async t=>{try{await wi(e(t));return}catch(n){if(Ci(n)===`EPERM`){if(!await wi(Ni(t,438).then(()=>!0),n))return;await e(t);return}throw n}},Fi=e=>t=>{try{Ti(()=>e(t));return}catch(n){if(Ci(n)===`EPERM`){if(!Ti(()=>(B(t,438),!0),n))return;e(t);return}throw n}},Ii=/* @__PURE__ */ new Set([`EMFILE`,`ENFILE`,`EBUSY`]),Li=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(Si(e)&&e.path===n&&Ii.has(e.code)){if(i=Math.ceil(i*s),a=i+a,a<o)return await he(i),t(n,r,i,a);if(l<c){l++;continue}}throw e}};return t},Ri=e=>(t,n)=>{let r=n.maxRetries||10,i=0;for(;;)try{return e(t)}catch(e){if(Si(e)&&e.path===t&&Ii.has(e.code)&&i<r){i++;continue}throw e}},{stat:zi}=gi,Bi=e=>{try{return ce(e).isDirectory()}catch{return!1}},Vi=e=>zi(e).then(e=>e.isDirectory(),()=>!1),Hi=async e=>{let{root:t}=K(e),n=ge(),{root:r}=K(n);if(t.toLowerCase()===r.toLowerCase())return n;let i=fe(t,`/temp`);return await Vi(i)?i:t},Ui=e=>{let{root:t}=K(e),n=ge(),{root:r}=K(n);if(t.toLowerCase()===r.toLowerCase())return n;let i=fe(t,`/temp`);return Bi(i)?i:t},Wi=async()=>ge(),Gi=()=>ge(),Ki=R.platform===`win32`?Hi:Wi,qi=R.platform===`win32`?Ui:Gi,{lstat:Ji,rename:Yi,unlink:Xi,rmdir:Zi}=gi,Qi=e=>`.${de(e)}.${Math.random()}`,$i=Pi(Xi),ea=Fi(W),ta=async(e,t)=>(t?.signal?.throwIfAborted(),await wi(Ji(e).then(n=>na(e,t,n)))??!0),na=async(e,t,n)=>{if(t?.signal?.throwIfAborted(),!t.tmp)return na(e,{...t,tmp:await Ki(e)},n);if(e===t.tmp&&K(e).root!==e)throw Error(`cannot delete temp directory used for deletion`);let r=n.isDirectory()?await vi(e):null;if(!Array.isArray(r)){
8
+ /* c8 ignore start */
9
+ if(r){if(Ci(r)===`ENOENT`)return!0;if(Ci(r)!==`ENOTDIR`)throw r}return t.filter&&!await t.filter(e,n)?!1:(await wi(ra(e,t.tmp,$i)),!0)}return!(await Promise.all(r.map(n=>na(fe(e,n.name),t,n)))).every(e=>e===!0)||t.preserveRoot===!1&&e===K(e).root||t.filter&&!await t.filter(e,n)?!1:(await wi(ra(e,t.tmp,Zi)),!0)},ra=async(e,t,n)=>{let r=fe(t,Qi(e));return await Yi(e,r),await n(r)},ia=(e,t)=>(t?.signal?.throwIfAborted(),Ti(()=>aa(e,t,H(e)))??!0),aa=(e,t,n)=>{if(t?.signal?.throwIfAborted(),!t.tmp)return aa(e,{...t,tmp:qi(e)},n);let r=t.tmp;if(e===t.tmp&&K(e).root!==e)throw Error(`cannot delete temp directory used for deletion`);let i=n.isDirectory()?yi(e):null;if(!Array.isArray(i)){
10
+ /* c8 ignore start */
11
+ if(i){if(Ci(i)===`ENOENT`)return!0;if(Ci(i)!==`ENOTDIR`)throw i}return t.filter&&!t.filter(e,n)?!1:(Ti(()=>oa(e,r,ea)),!0)}let a=!0;for(let n of i){let r=fe(e,n.name);a=aa(r,t,n)&&a}return!a||t.preserveRoot===!1&&e===K(e).root||t.filter&&!t.filter(e,n)?!1:(Ti(()=>oa(e,r,se)),!0)},oa=(e,t,n)=>{let r=fe(t,Qi(e));return ae(e,r),n(r)},{unlink:sa,rmdir:ca,lstat:la}=gi,ua=Li(Pi(sa)),da=Ri(Fi(W)),fa=Li(Pi(ca)),pa=Ri(Fi(se)),ma=async(e,{filter:t,...n})=>{
12
+ /* c8 ignore next */
13
+ n?.signal?.throwIfAborted();try{return await fa(e,n),!0}catch(t){if(Ci(t)===`ENOTEMPTY`)return ta(e,n);throw t}},ha=(e,{filter:t,...n})=>{n?.signal?.throwIfAborted();try{return pa(e,n),!0}catch(t){if(Ci(t)===`ENOTEMPTY`)return ia(e,n);throw t}},ga=Symbol(`start`),_a=Symbol(`child`),va=Symbol(`finish`),ya=async(e,t)=>(t?.signal?.throwIfAborted(),await wi(la(e).then(n=>xa(e,t,n,ga)))??!0),ba=(e,t)=>(t?.signal?.throwIfAborted(),Ti(()=>Sa(e,t,H(e),ga))??!0),xa=async(e,t,n,r=ga)=>{t?.signal?.throwIfAborted();let i=n.isDirectory()?await vi(e):null;if(!Array.isArray(i)){
14
+ /* c8 ignore start */
15
+ if(i){if(Ci(i)===`ENOENT`)return!0;if(Ci(i)!==`ENOTDIR`)throw i}return t.filter&&!await t.filter(e,n)?!1:(await wi(ua(e,t)),!0)}let a=r===ga?_a:r,o=(await Promise.all(i.map(n=>xa(fe(e,n.name),t,n,a)))).every(e=>e===!0);if(r===ga)return xa(e,t,n,va);if(r===va){if(t.preserveRoot===!1&&e===K(e).root||!o||t.filter&&!await t.filter(e,n))return!1;await wi(ma(e,t))}return!0},Sa=(e,t,n,r=ga)=>{let i=n.isDirectory()?yi(e):null;if(!Array.isArray(i)){
16
+ /* c8 ignore start */
17
+ if(i){if(Ci(i)===`ENOENT`)return!0;if(Ci(i)!==`ENOTDIR`)throw i}return t.filter&&!t.filter(e,n)?!1:(Ti(()=>da(e,t)),!0)}let a=!0;for(let n of i){let i=r===ga?_a:r,o=fe(e,n.name);a=Sa(o,t,n,i)&&a}if(r===ga)return Sa(e,t,n,va);if(r===va){if(t.preserveRoot===!1&&e===K(e).root||!a||t.filter&&!t.filter(e,n))return!1;Ti(()=>ha(e,t))}return!0},Ca=R.platform===`win32`?ya:ki,wa=R.platform===`win32`?ba:Ai,{rm:Ta}=gi,Ea=async(e,t)=>(await Ta(e,{...t,force:!0,recursive:!0}),!0),Da=(e,t)=>(oe(e,{...t,force:!0,recursive:!0}),!0),[Oa=0,ka=0]=R.version.replace(/^v/,``).split(`.`).map(e=>parseInt(e,10)),Aa=Oa>14||Oa===14&&ka>=14,ja=!Aa||R.platform===`win32`?()=>!1:e=>!e?.signal&&!e?.filter,Ma=!Aa||R.platform===`win32`?()=>!1:e=>!e?.signal&&!e?.filter,Na=e=>async(t,n)=>{let r=fi(n);return r.glob&&(t=await si(t,r.glob)),Array.isArray(t)?!!(await Promise.all(t.map(t=>e(mi(t,r),r)))).reduce((e,t)=>e&&t,!0):!!await e(mi(t,r),r)},Pa=e=>(t,n)=>{let r=pi(n);return r.glob&&(t=Qr(t,r.glob)),Array.isArray(t)?!!t.map(t=>e(mi(t,r),r)).reduce((e,t)=>e&&t,!0):!!e(mi(t,r),r)},Fa=Pa(Da),Ia=Object.assign(Na(Ea),{sync:Fa}),La=Pa(wa),Ra=Object.assign(Na(Ca),{sync:La}),za=Pa(ba),Ba=Object.assign(Na(ya),{sync:za}),Va=Pa(Ai),Ha=Object.assign(Na(ki),{sync:Va}),Ua=Pa(ia),Wa=Object.assign(Na(ta),{sync:Ua}),Ga=Pa((e,t)=>Ma(t)?Da(e,t):wa(e,t)),Ka=Na((e,t)=>ja(t)?Ea(e,t):Ca(e,t)),qa=Object.assign(Ka,{rimraf:Ka,sync:Ga,rimrafSync:Ga,manual:Ra,manualSync:La,native:Ia,nativeSync:Fa,posix:Ha,posixSync:Va,windows:Ba,windowsSync:za,moveRemove:Wa,moveRemoveSync:Ua});qa.rimraf=qa;async function Ja(e,t,{baseDir:n=``,readdirImpl:r=M,cpImpl:i=k,joinImpl:a=_}={}){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 Ya(e,t,n={},{statImpl:r=I,cpImpl:i=k}={}){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 Xa(e,{statImpl:t=I}={}){for(let n of e)try{return await t(n),n}catch{}return null}function Za({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(m.join(e,t));if(t&&t!==e&&i.has(r.dest))for(let e of r.sources)o.push(m.join(t,e));return!e&&!t&&o.push(...r.sources),{sources:o,dest:a,...r.opts?{opts:r.opts}:{}}})}function Qa(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=>m.join(e,t)):t}function $a(e){return e?[m.join(e,`shadow-claw-config.json`),m.join(e,`shadow-claw.config.json`),m.join(e,`shadowclaw.config.json`),m.join(e,`pages/shadow-claw-config.json`),m.join(e,`pages/shadow-claw.config.json`),m.join(e,`site-config.json`),m.join(e,`pages/site-config.json`)]:[`shadow-claw-config.json`,`shadow-claw.config.json`,`shadowclaw.config.json`,`site-config.json`]}function eo(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`}}var to=/* @__PURE__ */ t((e=>{function t(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var i=0;i<e.length;i++)if(r(e,i)){var a=e[i];if(t.call(void 0,a,i,e))return a}}function n(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors==`function`&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze==`function`?t.freeze(e):e}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function i(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)r(t,n)&&(e[n]=t[n]);return e}var a=n({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function o(e){return r(a,e.toLowerCase())}var s=n({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function c(e){return r(s,e.toLowerCase())}var l=n({script:!1,style:!1,textarea:!0,title:!0});function u(e){var t=e.toLowerCase();return r(l,t)&&!l[t]}function d(e){var t=e.toLowerCase();return r(l,t)&&l[t]}function f(e){return e===m.HTML}function p(e){return f(e)||e===m.XML_XHTML_APPLICATION}var m=n({HTML:`text/html`,XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),h=Object.keys(m).map(function(e){return m[e]});function g(e){return h.indexOf(e)>-1}var _=n({HTML:`http://www.w3.org/1999/xhtml`,SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=i,e.find=t,e.freeze=n,e.HTML_BOOLEAN_ATTRIBUTES=a,e.HTML_RAW_TEXT_ELEMENTS=l,e.HTML_VOID_ELEMENTS=s,e.hasDefaultHTMLNamespace=p,e.hasOwn=r,e.isHTMLBooleanAttribute=o,e.isHTMLRawTextElement=u,e.isHTMLEscapableRawTextElement=d,e.isHTMLMimeType=f,e.isHTMLVoidElement=c,e.isValidMimeType=g,e.MIME_TYPE=m,e.NAMESPACE=_})),no=/* @__PURE__ */ t((e=>{var t=to();function n(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var r=t.freeze({Error:`Error`,IndexSizeError:`IndexSizeError`,DomstringSizeError:`DomstringSizeError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NoDataAllowedError:`NoDataAllowedError`,NoModificationAllowedError:`NoModificationAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InUseAttributeError:`InUseAttributeError`,InvalidStateError:`InvalidStateError`,SyntaxError:`SyntaxError`,InvalidModificationError:`InvalidModificationError`,NamespaceError:`NamespaceError`,InvalidAccessError:`InvalidAccessError`,ValidationError:`ValidationError`,TypeMismatchError:`TypeMismatchError`,SecurityError:`SecurityError`,NetworkError:`NetworkError`,AbortError:`AbortError`,URLMismatchError:`URLMismatchError`,QuotaExceededError:`QuotaExceededError`,TimeoutError:`TimeoutError`,InvalidNodeTypeError:`InvalidNodeTypeError`,DataCloneError:`DataCloneError`,EncodingError:`EncodingError`,NotReadableError:`NotReadableError`,UnknownError:`UnknownError`,ConstraintError:`ConstraintError`,DataError:`DataError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,OperationError:`OperationError`,NotAllowedError:`NotAllowedError`,OptOutError:`OptOutError`}),i=Object.keys(r);function a(e){return typeof e==`number`&&e>=1&&e<=25}function o(e){return typeof e==`string`&&e.substring(e.length-r.Error.length)===r.Error}function s(e,t){a(e)?(this.name=i[e],this.message=t||``):(this.message=e,this.name=o(t)?t:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,s)}n(s,!0),Object.defineProperties(s.prototype,{code:{enumerable:!0,get:function(){var e=i.indexOf(this.name);return a(e)?e:0}}});for(var c={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},l=Object.entries(c),u=0;u<l.length;u++){var d=l[u][0];s[d]=l[u][1]}function f(e,t,n){this.message=e,this.locator=t,this.cause=n,Error.captureStackTrace&&Error.captureStackTrace(this,f)}n(f),e.DOMException=s,e.DOMExceptionName=r,e.ExceptionCode=c,e.ParseError=f})),ro=/* @__PURE__ */ t((e=>{function t(e){try{typeof e!=`function`&&(e=RegExp);var t=new e(`𝌆`,`u`).exec(`𝌆`);return!!t&&t[0].length===2}catch{}return!1}var n=t();function r(e){if(e.source[0]!==`[`)throw Error(e+` can not be used with chars`);return e.source.slice(1,e.source.lastIndexOf(`]`))}function i(e,t){if(e.source[0]!==`[`)throw Error(`/`+e.source+`/ can not be used with chars_without`);if(!t||typeof t!=`string`)throw Error(JSON.stringify(t)+` is not a valid search`);if(e.source.indexOf(t)===-1)throw Error(`"`+t+`" is not is /`+e.source+`/`);if(t===`-`&&e.source.indexOf(t)!==1)throw Error(`"`+t+`" is not at the first postion of /`+e.source+`/`);return new RegExp(e.source.replace(t,``),n?`u`:``)}function a(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(e){var n=typeof e==`string`;if(n&&t===void 0&&e===`|`)throw Error("use regg instead of reg to wrap expressions with `|`!");return n?e:e.source}).join(``),n?`u`:``)}function o(e){if(arguments.length===0)throw Error(`no parameters provided`);return a.apply(o,[`(?:`].concat(Array.prototype.slice.call(arguments),[`)`]))}var s=`�`,c=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;n&&(c=a(`[`,r(c),`\\u{10000}-\\u{10FFFF}`,`]`));var l=RegExp(`[^`+r(c)+`]`,n?`u`:``),u=/[\x20\x09\x0D\x0A]/,d=r(u),f=a(u,`+`),p=a(u,`*`),m=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;n&&(m=a(`[`,r(m),`\\u{10000}-\\u{10FFFF}`,`]`));var h=a(`[`,r(m),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),`]`),g=a(m,h,`*`),_=a(`^`,g,`$`),v=a(h,`+`),y=o(a(`&`,g,`;`),`|`,o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)),b=a(`%`,g,`;`),x=o(a(`"`,o(/[^%&"]/,`|`,b,`|`,y),`*`,`"`),`|`,a(`'`,o(/[^%&']/,`|`,b,`|`,y),`*`,`'`)),S=o(`"`,o(/[^<&"]/,`|`,y),`*`,`"`,`|`,`'`,o(/[^<&']/,`|`,y),`*`,`'`),C=a(i(m,`:`),i(h,`:`),`*`),w=a(`^`,C,`$`),T=a(C,o(`:`,C),`?`),E=a(`^`,T,`$`),D=a(`(`,T,`)`),O=o(/"[^"]*"|'[^']*'/),k=a(/^<\?/,`(`,g,`)`,o(f,`(?!`,u,`)(`,c,`*?)`),`?`,/\?>/),ee=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,A=o(`"`,ee,`*"`,`|`,`'`,i(ee,`'`),`*'`),j=`<!--`,M=`-->`,N=a(j,o(i(c,`-`),`|`,a(`-`,i(c,`-`))),`*`,M),P=`#PCDATA`,F=o(`EMPTY`,`|`,`ANY`,`|`,o(a(/\(/,p,P,o(p,/\|/,p,T),`*`,p,/\)\*/),`|`,a(/\(/,p,P,p,/\)/)),`|`,a(/\([^>]+\)/,/[?*+]?/)),I=a(`<!ELEMENT`,f,o(T,`|`,b),f,o(F,`|`,b),p,`>`),L=a(`<!ATTLIST`,f,g,o(f,g,f,o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,`|`,o(a(`NOTATION`,f,/\(/,p,g,o(p,/\|/,p,g),`*`,p,/\)/),`|`,a(/\(/,p,v,o(p,/\|/,p,v),`*`,p,/\)/))),f,o(/#REQUIRED|#IMPLIED/,`|`,o(o(`#FIXED`,f),`?`,S))),`*`,p,`>`),R=`about:legacy-compat`,te=o(`"`+R+`"`,`|`,`'`+R+`'`),z=`SYSTEM`,B=`PUBLIC`,V=o(o(z,f,O),`|`,o(B,f,A,f,O)),H=a(`^`,o(o(z,f,`(?<SystemLiteralOnly>`,O,`)`),`|`,o(B,f,`(?<PubidLiteral>`,A,`)`,f,`(?<SystemLiteral>`,O,`)`))),U=a(`^`,A,`$`),ne=a(`^`,O,`$`),re=o(x,`|`,o(V,o(f,`NDATA`,f,g),`?`)),ie=`<!ENTITY`,ae=o(a(ie,f,g,f,re,p,`>`),`|`,a(ie,f,`%`,f,g,f,o(x,`|`,V),p,`>`)),oe=a(`<!NOTATION`,f,g,f,o(V,`|`,a(B,f,A)),p,`>`),se=a(p,`=`,p),ce=/1[.]\d+/,W=a(f,`version`,se,o(`'`,ce,`'`,`|`,`"`,ce,`"`)),le=/[A-Za-z][-A-Za-z0-9._]*/,ue=a(/^<\?xml/,W,o(f,`encoding`,se,o(`"`,le,`"`,`|`,`'`,le,`'`)),`?`,o(f,`standalone`,se,o(`'`,o(`yes`,`|`,`no`),`'`,`|`,`"`,o(`yes`,`|`,`no`),`"`)),`?`,p,/\?>/),G=`<!DOCTYPE`,de=`<![CDATA[`,K=`]]>`,fe=a(/<!\[CDATA\[/,a(c,`*?`,/\]\]>/));e.chars=r,e.chars_without=i,e.detectUnicodeSupport=t,e.reg=a,e.regg=o,e.ABOUT_LEGACY_COMPAT=R,e.ABOUT_LEGACY_COMPAT_SystemLiteral=te,e.AttlistDecl=L,e.CDATA_START=de,e.CDATA_END=K,e.CDSect=fe,e.Char=c,e.Comment=N,e.COMMENT_START=j,e.COMMENT_END=M,e.DOCTYPE_DECL_START=G,e.elementdecl=I,e.EntityDecl=ae,e.EntityValue=x,e.ExternalID=V,e.ExternalID_match=H,e.Name=g,e.Name_exact=_,e.NCName_exact=w,e.NotationDecl=oe,e.Reference=y,e.PEReference=b,e.PI=k,e.PUBLIC=B,e.PubidLiteral=A,e.PubidLiteral_match=U,e.QName=T,e.QName_exact=E,e.QName_group=D,e.S=f,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=z,e.SystemLiteral=O,e.SystemLiteral_match=ne,e.InvalidChar=l,e.UNICODE_REPLACEMENT_CHARACTER=s,e.UNICODE_SUPPORT=n,e.XMLDecl=ue})),io=/* @__PURE__ */ t((e=>{var t=to(),n=t.find,r=t.hasDefaultHTMLNamespace,i=t.hasOwn,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.isHTMLVoidElement,c=t.MIME_TYPE,l=t.NAMESPACE,u=Symbol(),d=no(),f=d.DOMException,p=d.DOMExceptionName,m=ro();function h(e){if(e!==u)throw TypeError(`Illegal constructor`)}function g(e){return e!==``}function _(e){return e?e.split(/[\t\n\f\r ]+/).filter(g):[]}function v(e,t){return i(e,t)||(e[t]=!0),e}function y(e){if(!e)return[];var t=_(e);return Object.keys(t.reduce(v,{}))}function b(e){return function(t){return e&&e.indexOf(t)!==-1}}function x(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in qualified name "`+e+`"`)}function S(e,n){x(n),e||=null;var r=null,i=n;if(n.indexOf(`:`)>=0){var a=n.split(`:`);r=a[0],i=a[1]}if(r!==null&&e===null)throw new f(f.NAMESPACE_ERR,`prefix is non-null and namespace is null`);if(r===`xml`&&e!==t.NAMESPACE.XML)throw new f(f.NAMESPACE_ERR,`prefix is "xml" and namespace is not the XML namespace`);if((r===`xmlns`||n===`xmlns`)&&e!==t.NAMESPACE.XMLNS)throw new f(f.NAMESPACE_ERR,`either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace`);if(e===t.NAMESPACE.XMLNS&&r!==`xmlns`&&n!==`xmlns`)throw new f(f.NAMESPACE_ERR,`namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"`);return[e,r,i]}function C(e,t){for(var n in e)i(e,n)&&(t[n]=e[n])}function w(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,C(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var T={},E=T.ELEMENT_NODE=1,D=T.ATTRIBUTE_NODE=2,O=T.TEXT_NODE=3,k=T.CDATA_SECTION_NODE=4,ee=T.ENTITY_REFERENCE_NODE=5,A=T.ENTITY_NODE=6,j=T.PROCESSING_INSTRUCTION_NODE=7,M=T.COMMENT_NODE=8,N=T.DOCUMENT_NODE=9,P=T.DOCUMENT_TYPE_NODE=10,F=T.DOCUMENT_FRAGMENT_NODE=11,I=T.NOTATION_NODE=12,L=t.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function R(e,t){if(t.length<e.length)return R(t,e);var n=null;for(var r in e){if(e[r]!==t[r])return n;n=e[r]}return n}function te(e){return e.guid||=Math.random(),e.guid}function z(){}z.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e?{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null},n=[],r=0;r<this.length;r++)He(this[r],n,null,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},z.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function B(e,t){this._node=e,this._refresh=t,V(this)}function V(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ge(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)i(e,r)&&delete e[r];C(n,e),e._inc=t}}B.prototype.item=function(e){return V(this),this[e]||null},w(B,z);function H(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function U(e,t){for(var n=0;n<e.length;){if(e[n]===t)return n;n++}}function ne(e,t,n){if(!t)return e._noNsIndex;var r=e._nsIndex[t];return!r&&n&&(r=e._nsIndex[t]=Object.create(null)),r}function re(e,t,n){var r=ne(e,t,!1);return r&&r[n]||null}function ie(e,t){ne(e,t.namespaceURI,!0)[t.localName]=t}function ae(e,t){var n=ne(e,t.namespaceURI,!1);n&&delete n[t.localName]}function oe(e,t,n,r){if(r?t[U(t,r)]=n:(t[t.length]=n,t.length++),ie(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&fe(i,e,r),K(i,e,n))}}function se(e,t,n){var r=U(t,n);if(r>=0){for(var i=t.length-1;r<=i;)t[r]=t[++r];if(t.length=i,ae(t,n),e){var a=e.ownerDocument;a&&fe(a,e,n),n.ownerElement=null}}}H.prototype={length:0,item:z.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var n=this[t];if(n.nodeName===e)return n;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new f(f.INUSE_ATTRIBUTE_ERR);var n=re(this,e.namespaceURI,e.localName);return n===e?e:(oe(this._ownerElement,this,e,n),n)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new f(f.NOT_FOUND_ERR,e);return se(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);if(!n)throw new f(f.NOT_FOUND_ERR,e?e+` : `+t:t);return se(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){e||=null;for(var n=0;n<this.length;){var r=this[n];if(r.localName===t&&r.namespaceURI===e)return r;n++}return null}},H.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function ce(){}ce.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=c.XML_APPLICATION;e===l.HTML?r=c.XML_XHTML_APPLICATION:e===l.SVG&&(r=c.XML_SVG_IMAGE);var i=new de(u,{contentType:r});if(i.implementation=this,i.childNodes=new z,i.doctype=n||null,n&&i.appendChild(n),t){var a=i.createElementNS(e,t);i.appendChild(a)}return i},createDocumentType:function(e,t,n,r){x(e);var i=new Me(u);return i.name=e,i.nodeName=e,i.publicId=t||``,i.systemId=n||``,i.internalSubset=r||``,i.childNodes=new z,i},createHTMLDocument:function(e){var t=new de(u,{contentType:c.HTML});if(t.implementation=this,t.childNodes=new z,e!==!1){t.doctype=this.createDocumentType(`html`),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var n=t.createElement(`html`);t.appendChild(n);var r=t.createElement(`head`);if(n.appendChild(r),typeof e==`string`){var i=t.createElement(`title`);i.appendChild(t.createTextNode(e)),r.appendChild(i)}n.appendChild(t.createElement(`body`))}return t}};function W(e){h(e)}W.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:`about:blank`,get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=t.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;for(var t=[{node:this,other:e}];t.length>0;){var n=t.pop(),r=n.node,i=n.other;if(r.nodeType!==i.nodeType)return!1;switch(r.nodeType){case r.DOCUMENT_TYPE_NODE:if(r.name!==i.name||r.publicId!==i.publicId||r.systemId!==i.systemId)return!1;break;case r.ELEMENT_NODE:if(r.namespaceURI!==i.namespaceURI||r.prefix!==i.prefix||r.localName!==i.localName||r.attributes.length!==i.attributes.length)return!1;for(var a=0;a<r.attributes.length;a++){var o=r.attributes.item(a),s=i.getAttributeNodeNS(o.namespaceURI,o.localName);if(!s)return!1;t.push({node:o,other:s})}break;case r.ATTRIBUTE_NODE:if(r.namespaceURI!==i.namespaceURI||r.localName!==i.localName||r.value!==i.value)return!1;break;case r.PROCESSING_INSTRUCTION_NODE:if(r.target!==i.target||r.data!==i.data)return!1;break;case r.TEXT_NODE:case r.CDATA_SECTION_NODE:case r.COMMENT_NODE:if(r.data!==i.data)return!1}if(r.childNodes.length!==i.childNodes.length)return!1;for(var a=r.childNodes.length-1;a>=0;a--)t.push({node:r.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Te(this,e,t)},replaceChild:function(e,t){Te(this,e,t,we),t&&this.removeChild(t)},removeChild:function(e){return me(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return We(this.ownerDocument||this,this,e)},normalize:function(){G(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===O&&t.nodeType===O){for(var r=[],i=n;i!==null&&i.nodeType===O;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),pe(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(i(n,r)&&n[r]===e)return r}t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&i(n,e))return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,n=this,r=null,i=null;if(t instanceof De&&(r=t,t=r.ownerElement),n instanceof De&&(i=n,n=i.ownerElement,r&&t&&n===t))for(var a=0,o;o=n.attributes[a];a++){if(o===r)return L.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+L.DOCUMENT_POSITION_PRECEDING;if(o===i)return L.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+L.DOCUMENT_POSITION_FOLLOWING}if(!t||!n||n.ownerDocument!==t.ownerDocument)return L.DOCUMENT_POSITION_DISCONNECTED+L.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(te(n.ownerDocument)>te(t.ownerDocument)?L.DOCUMENT_POSITION_FOLLOWING:L.DOCUMENT_POSITION_PRECEDING);if(i&&t===n)return L.DOCUMENT_POSITION_CONTAINS+L.DOCUMENT_POSITION_PRECEDING;if(r&&t===n)return L.DOCUMENT_POSITION_CONTAINED_BY+L.DOCUMENT_POSITION_FOLLOWING;for(var s=[],c=t.parentNode;c;){if(!i&&c===n)return L.DOCUMENT_POSITION_CONTAINED_BY+L.DOCUMENT_POSITION_FOLLOWING;s.push(c),c=c.parentNode}s.reverse();for(var l=[],u=n.parentNode;u;){if(!r&&u===t)return L.DOCUMENT_POSITION_CONTAINS+L.DOCUMENT_POSITION_PRECEDING;l.push(u),u=u.parentNode}l.reverse();var d=R(s,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===n)return L.DOCUMENT_POSITION_FOLLOWING;if(p===t)return L.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return L.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return L.DOCUMENT_POSITION_PRECEDING}return 0}};function le(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}C(T,W),C(T,W.prototype),C(L,W),C(L,W.prototype);function ue(e,t){G(e,null,{enter:function(e){return!t(e)||G.STOP}})}function G(e,t,n){for(var r=[{node:e,context:t,phase:G.ENTER}];r.length>0;){var i=r.pop();if(i.phase===G.ENTER){var a=n.enter(i.node,i.context);if(a===G.STOP)return G.STOP;if(r.push({node:i.node,context:a,phase:G.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:G.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}G.STOP=Symbol(`walkDOM.STOP`),G.ENTER=0,G.EXIT=1;function de(e,t){h(e);var n=t||{};this.ownerDocument=this,this.contentType=n.contentType||c.XML_APPLICATION,this.type=a(this.contentType)?`html`:`xml`}function K(e,t,n){e&&e._inc++,n.namespaceURI===l.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function fe(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function pe(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n&&!n.nextSibling)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function me(e,t){if(e!==t.parentNode)throw new f(f.NOT_FOUND_ERR,`child's parent is not parent`);var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,pe(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function he(e){return e&&(e.nodeType===W.DOCUMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.ELEMENT_NODE)}function ge(e){return e&&(e.nodeType===W.CDATA_SECTION_NODE||e.nodeType===W.COMMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.DOCUMENT_TYPE_NODE||e.nodeType===W.ELEMENT_NODE||e.nodeType===W.PROCESSING_INSTRUCTION_NODE||e.nodeType===W.TEXT_NODE)}function _e(e){return e&&e.nodeType===W.DOCUMENT_TYPE_NODE}function ve(e){return e&&e.nodeType===W.ELEMENT_NODE}function ye(e){return e&&e.nodeType===W.TEXT_NODE}function be(e,t){var r=e.childNodes||[];if(n(r,ve)||_e(t))return!1;var i=n(r,_e);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function xe(e,t){var r=e.childNodes||[];function i(e){return ve(e)&&e!==t}if(n(r,i))return!1;var a=n(r,_e);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function Se(e,t,n){if(!he(e))throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new f(f.NOT_FOUND_ERR,`child not in parent`);if(!ge(t)||_e(t)&&e.nodeType!==W.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function Ce(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var o=a.filter(ve);if(o.length>1||n(a,ye))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!be(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(ve(t)&&!be(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(_e(t)){if(n(i,_e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,ve);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`);if(!r&&s)throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can not be appended since element is present`)}}function we(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var o=a.filter(ve);if(o.length>1||n(a,ye))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!xe(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(ve(t)&&!xe(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(_e(t)){function e(e){return _e(e)&&e!==r}if(n(i,e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,ve);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`)}}function Te(e,t,n,r){Se(e,t,n),e.nodeType===W.DOCUMENT_NODE&&(r||Ce)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===F){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do a.parentNode=e;while(a!==o&&(a=a.nextSibling));return pe(e.ownerDocument||e,e,t),t.nodeType==F&&(t.firstChild=t.lastChild=null),t}de.prototype={implementation:null,nodeName:`#document`,nodeType:N,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===F){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Te(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===E&&(this.documentElement=e),e},removeChild:function(e){var t=me(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Te(this,e,t,we),e.ownerDocument=this,t&&this.removeChild(t),ve(e)&&(this.documentElement=e)},importNode:function(e,t){return Ue(this,e,t)},getElementById:function(e){var t=null;return ue(this.documentElement,function(n){if(n.nodeType==E&&n.getAttribute(`id`)==e)return t=n,!0}),t},createElement:function(e){var t=new Ee(u);t.ownerDocument=this,this.type===`html`&&(e=e.toLowerCase()),r(this.contentType)&&(t.namespaceURI=l.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new z;var n=t.attributes=new H;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Ie(u);return e.ownerDocument=this,e.childNodes=new z,e},createTextNode:function(e){var t=new ke(u);return t.ownerDocument=this,t.childNodes=new z,t.appendData(e),t},createComment:function(e){var t=new Ae(u);return t.ownerDocument=this,t.childNodes=new z,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new f(f.INVALID_CHARACTER_ERR,`data contains "]]>"`);var t=new je(u);return t.ownerDocument=this,t.childNodes=new z,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Le(u);return n.ownerDocument=this,n.childNodes=new z,n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in name "`+e+`"`);return this.type===`html`&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new De(u);return t.ownerDocument=this,t.childNodes=new z,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!m.Name_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`not a valid xml name "`+e+`"`);if(this.type===`html`)throw new f(`document is an html document`,p.NotSupportedError);var t=new Fe(u);return t.ownerDocument=this,t.childNodes=new z,t.nodeName=e,t},createElementNS:function(e,t){var n=S(e,t),r=new Ee(u),i=r.attributes=new H;return r.childNodes=new z,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],i._ownerElement=r,r},createAttributeNS:function(e,t){var n=S(e,t),r=new De(u);return r.ownerDocument=this,r.childNodes=new z,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],r}},w(de,W);function Ee(e){h(e),this._nsMap=Object.create(null)}Ee.prototype={nodeType:E,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+`:`+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type===`html`&&this.namespaceURI===l.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var n=this.getAttributeNode(e);n?n.value=n.nodeValue=``+t:(n=this.ownerDocument._createAttribute(e),n.value=n.nodeValue=``+t,this.setAttributeNode(n))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n?n.value:null},setAttributeNS:function(e,t,n){var r=S(e,t)[2],i=this.getAttributeNodeNS(e,r);i?i.value=i.nodeValue=``+n:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=``+n,this.setAttributeNode(i))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=y(e);return new B(this,function(n){var r=[];return t.length>0&&ue(n,function(i){if(i!==n&&i.nodeType===E){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var s=y(a);o=t.every(b(s))}o&&r.push(i)}}}),r})},getElementsByTagName:function(e){var t=(this.nodeType===N?this:this.ownerDocument).type===`html`,n=e.toLowerCase();return new B(this,function(r){var i=[];return ue(r,function(a){a!==r&&a.nodeType===E&&(e===`*`||a.getQualifiedName()===(t&&a.namespaceURI===l.HTML?n:e))&&i.push(a)}),i})},getElementsByTagNameNS:function(e,t){return new B(this,function(n){var r=[];return ue(n,function(i){i!==n&&i.nodeType===E&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},de.prototype.getElementsByClassName=Ee.prototype.getElementsByClassName,de.prototype.getElementsByTagName=Ee.prototype.getElementsByTagName,de.prototype.getElementsByTagNameNS=Ee.prototype.getElementsByTagNameNS,w(Ee,W);function De(e){h(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}De.prototype.nodeType=D,w(De,W);function Oe(e){h(e)}Oe.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},w(Oe,W);function ke(e){h(e)}ke.prototype={nodeName:`#text`,nodeType:O,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},w(ke,Oe);function Ae(e){h(e)}Ae.prototype={nodeName:`#comment`,nodeType:M},w(Ae,Oe);function je(e){h(e)}je.prototype={nodeName:`#cdata-section`,nodeType:k},w(je,ke);function Me(e){h(e)}Me.prototype.nodeType=P,w(Me,W);function Ne(e){h(e)}Ne.prototype.nodeType=I,w(Ne,W);function Pe(e){h(e)}Pe.prototype.nodeType=A,w(Pe,W);function Fe(e){h(e)}Fe.prototype.nodeType=ee,w(Fe,W);function Ie(e){h(e)}Ie.prototype.nodeName=`#document-fragment`,Ie.prototype.nodeType=F,w(Ie,W);function Le(e){h(e)}Le.prototype.nodeType=j,w(Le,Oe);function Re(){}Re.prototype.serializeToString=function(e,t){return ze.call(e,t)},W.prototype.toString=ze;function ze(e){var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e==null?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null}:{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null},n=[],r=this.nodeType===N&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return He(this,n,o,t),n.join(``)}function Be(e,t,n){var r=e.prefix||``,i=e.namespaceURI;if(!i||r===`xml`&&i===l.XML||i===l.XMLNS)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix===r)return o.namespace!==i}return!0}function Ve(e,t,n,r){if(r&&!m.QName_exact.test(t))throw new f(`The attribute name "`+t+`" is not a valid XML QName`,p.InvalidStateError);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,le),`"`)}function He(e,t,n,r){n||=[];var i=r.nodeFilter,a=r.requireWellFormed,c=r.splitCDATASections,u=(e.nodeType===N?e:e.ownerDocument).type===`html`;G(e,{ns:n},{enter:function(e,n){var d=n.ns;if(i){if(e=i(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case E:var h=e.attributes,g=h.length,_=e.tagName,v=_;if(!u&&!e.prefix&&e.namespaceURI){for(var y,b=0;b<h.length;b++)if(h.item(b).name===`xmlns`){y=h.item(b).value;break}if(!y)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.prefix===``&&S.namespace===e.namespaceURI){y=S.namespace;break}}if(y!==e.namespaceURI)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.namespace===e.namespaceURI){S.prefix&&(v=S.prefix+`:`+_);break}}}if(a&&!m.QName_exact.test(v))throw new f(`The element name "`+v+`" is not a valid XML QName`,p.InvalidStateError);t.push(`<`,v);for(var C=d.slice(),w=0;w<g;w++){var T=h.item(w);T.prefix==`xmlns`?C.push({prefix:T.localName,namespace:T.value}):T.nodeName==`xmlns`&&C.push({prefix:``,namespace:T.value})}for(var w=0;w<g;w++){var T=h.item(w);if(Be(T,u,C)){var A=T.prefix||``,I=T.namespaceURI;Ve(t,A?`xmlns:`+A:`xmlns`,I,a),C.push({prefix:A,namespace:I})}var L=i?i(T):T;L&&(typeof L==`string`?t.push(L):Ve(t,L.name,L.value,a))}if(_===v&&Be(e,u,C)){var R=e.prefix||``,I=e.namespaceURI;Ve(t,R?`xmlns:`+R:`xmlns`,I,a),C.push({prefix:R,namespace:I})}var te=!e.firstChild;if(te&&(u||e.namespaceURI===l.HTML)&&(te=s(_)),te)return t.push(`/>`),null;if(t.push(`>`),u&&o(_)){for(var z=e.firstChild;z;)z.data?t.push(z.data):He(z,t,C.slice(),r),z=z.nextSibling;return t.push(`</`,v,`>`),null}return{ns:C,tag:v};case N:case F:if(a&&e.nodeType===N&&e.documentElement==null)throw new f(`The Document has no documentElement`,p.InvalidStateError);return{ns:d};case D:return Ve(t,e.name,e.value,a),null;case O:if(a&&m.InvalidChar.test(e.data))throw new f(`The Text node data contains characters outside the XML Char production`,p.InvalidStateError);return t.push(e.data.replace(/[<&>]/g,le)),null;case k:if(a&&e.data.indexOf(`]]>`)!==-1)throw new f(`The CDATASection data contains "]]>"`,p.InvalidStateError);return c?t.push(m.CDATA_START,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),m.CDATA_END):t.push(m.CDATA_START,e.data,m.CDATA_END),null;case M:if(a){if(m.InvalidChar.test(e.data))throw new f(`The comment node data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`--`)!==-1||e.data[e.data.length-1]===`-`)throw new f(`The comment node data contains "--" or ends with "-"`,p.InvalidStateError)}return t.push(m.COMMENT_START,e.data,m.COMMENT_END),null;case P:var B=e.publicId,V=e.systemId;if(a){if(!m.Name_exact.test(e.name))throw new f(`The doctype name "`+e.name+`" is not a valid XML Name`,p.InvalidStateError);if(B&&!m.PubidLiteral_match.test(B))throw new f(`DocumentType publicId is not a valid PubidLiteral`,p.InvalidStateError);if(V&&V!==`.`&&!m.SystemLiteral_match.test(V))throw new f(`DocumentType systemId is not a valid SystemLiteral`,p.InvalidStateError);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new f(`DocumentType internalSubset contains "]>"`,p.InvalidStateError)}return t.push(m.DOCTYPE_DECL_START,` `,e.name),B?(t.push(` `,m.PUBLIC,` `,B),V&&V!==`.`&&t.push(` `,V)):V&&V!==`.`&&t.push(` `,m.SYSTEM,` `,V),e.internalSubset&&t.push(` [`,e.internalSubset,`]`),t.push(`>`),null;case j:if(a){if(!m.NCName_exact.test(e.target)||e.target.toLowerCase()===`xml`)throw new f(`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`,p.InvalidStateError);if(m.InvalidChar.test(e.data))throw new f(`The ProcessingInstruction data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`?>`)!==-1)throw new f(`The ProcessingInstruction data contains "?>"`,p.InvalidStateError)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case ee:if(a&&!m.Name_exact.test(e.nodeName))throw new f(`The entity reference name "`+e.nodeName+`" is not a valid XML Name`,p.InvalidStateError);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function Ue(e,t,n){var r;return G(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===D||n?a:null}}),r}function We(e,t,n){var r;return G(t,null,{enter:function(t,a){var o=new t.constructor(u);for(var s in t)if(i(t,s)){var c=t[s];typeof c!=`object`&&c!=o[s]&&(o[s]=c)}t.childNodes&&(o.childNodes=new z),o.ownerDocument=e;var l=n;switch(o.nodeType){case E:var d=t.attributes,f=o.attributes=new H,p=d.length;f._ownerElement=o;for(var m=0;m<p;m++)o.setAttributeNode(We(e,d.item(m),!0));break;case D:l=!0}return a===null?r=o:a.appendChild(o),l?o:null}}),r}function Ge(e,t,n){e[t]=n}function Ke(e){for(var t=[],n=e.firstChild;n;)n.nodeType===E&&t.push(n),n=n.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty(B.prototype,"length",{get:function(){return V(this),this.$$length}}),Object.defineProperty(W.prototype,"textContent",{get:function(){if(this.nodeType===E||this.nodeType===F){var e=[];return G(this,null,{enter:function(t){if(t.nodeType===E||t.nodeType===F)return!0;if(t.nodeType===j||t.nodeType===M)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case E:case F:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Object.defineProperty(Oe.prototype,"data",{get:function(){return this._data==null?``:this._data},set:function(e){this._data=e,this.length=typeof e==`string`?e.length:0}}),Object.defineProperty(Oe.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ee.prototype,"children",{get:function(){return new B(this,Ke)}}),Object.defineProperty(de.prototype,"children",{get:function(){return new B(this,Ke)}}),Object.defineProperty(Ie.prototype,"children",{get:function(){return new B(this,Ke)}}),Ge=function(e,t,n){e[`$$`+t]=n})}catch{}e._updateLiveList=V,e.Attr=De,e.CDATASection=je,e.CharacterData=Oe,e.Comment=Ae,e.Document=de,e.DocumentFragment=Ie,e.DocumentType=Me,e.DOMImplementation=ce,e.Element=Ee,e.Entity=Pe,e.EntityReference=Fe,e.LiveNodeList=B,e.NamedNodeMap=H,e.Node=W,e.NodeList=z,e.Notation=Ne,e.Text=ke,e.ProcessingInstruction=Le,e.walkDOM=G,e.XMLSerializer=Re})),ao=/* @__PURE__ */ t((e=>{var t=to().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:`⁡`,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:`⁡`,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:`⁣`,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:`⁢`,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:`‎`,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:`​`,NegativeThickSpace:`​`,NegativeThinSpace:`​`,NegativeVeryThinSpace:`​`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
18
+ `,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:`⁠`,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:`‏`,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:`­`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:`  `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:`​`,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:`‍`,zwnj:`‌`}),e.entityMap=e.HTML_ENTITIES})),oo=/* @__PURE__ */ t((e=>{var t=to(),n=ro(),r=no(),i=t.isHTMLEscapableRawTextElement,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.hasOwn,c=t.NAMESPACE,l=r.ParseError,u=r.DOMException,d=0,f=1,p=2,m=3,h=4,g=5,_=6,v=7;function y(){}y.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),E(t,t=Object.create(null)),x(e,t,n,r,this.errorHandler),r.endDocument()}};var b=/&#?\w+;?/g;function x(e,r,i,o,c){var d=a(o.mimeType);e.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&c.warning(`Unicode replacement character detected, source encoding issues?`);function f(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e[e.length-1]===`;`?e:e+`;`;if(!d&&t!==e)return c.error(`EntityRef: expecting ;`),e;var r=n.Reference.exec(t);if(!r||r[0].length!==t.length)return c.error(`entity not matching Reference production: `+e),e;var a=t.slice(1,-1);return s(i,a)?i[a]:a.charAt(0)===`#`?f(parseInt(a.substring(1).replace(`x`,`0x`))):(c.error(`entity not found:`+e),e)}function m(t){if(t>D){var n=e.substring(D,t).replace(b,p);v&&y(D),o.characters(n,0,t-D),D=t}}var h=0,g=0,_=/\r\n?|\n|$/g,v=o.locator;function y(t,n){for(;t>=g&&(n=_.exec(e));)h=g,g=n.index+n[0].length,v.lineNumber++;v.columnNumber=t-h+1}for(var x=[{currentNSMap:r}],E=[],D=0;;){try{var O=e.indexOf(`<`,D);if(O<0){if(!d&&E.length>0)return c.fatalError(`unclosed xml tag(s): `+E.join(`, `));if(!e.substring(D).match(/^\s*$/)){var j=o.doc,M=j.createTextNode(e.substring(D));if(j.documentElement)return c.error(`Extra content at the end of the document`);j.appendChild(M),o.currentElement=M}return}if(O>D){var N=e.substring(D,O);!d&&E.length===0&&(N=N.replace(new RegExp(n.S_OPT.source,`g`),``),N&&c.error(`Unexpected content outside root element: '`+N+`'`)),m(O)}switch(e.charAt(O+1)){case`/`:var P=e.indexOf(`>`,O+2),F=e.substring(O+2,P>0?P:void 0);if(!F)return c.fatalError(`end tag name missing`);var I=n.reg(`^`,n.QName_group,n.S_OPT,`$`),L=P>0&&I.exec(F);if(!L){var R=P>0&&n.reg(`^`,n.QName_group).exec(F);if(d&&R)c.warning(`end tag name contains invalid trailing characters: "`+F+`"`),L=R;else if(R&&new RegExp(I.source,I.flags+`m`).test(F))c.error(`end tag name is followed by a line break and trailing content: "`+F+`"`),L=R;else return c.fatalError(`end tag name contains invalid characters: "`+F+`"`)}if(!o.currentElement&&!o.doc.documentElement)return;var te=E[E.length-1]||o.currentElement.tagName||o.doc.documentElement.tagName||``;if(te!==L[1]){var z=L[1].toLowerCase();if(!d||te.toLowerCase()!==z)return c.fatalError(`Opening and ending tag mismatch: "`+te+`" != "`+F+`"`)}var B=x.pop();E.pop();var V=B.localNSMap;if(o.endElement(B.uri,B.localName,te),V)for(var H in V)s(V,H)&&o.endPrefixMapping(H);P++;break;case`?`:v&&y(O),P=ee(e,O,o,c);break;case`!`:v&&y(O),P=k(e,O,o,c,d);break;default:v&&y(O);var U=new A,ne=x[x.length-1].currentNSMap,P=C(e,O,U,ne,p,c,d),re=U.length;if(U.closed||(d&&t.isHTMLVoidElement(U.tagName)?U.closed=!0:E.push(U.tagName)),v&&re){for(var ie=S(v,{}),ae=0;ae<re;ae++){var oe=U[ae];y(oe.offset),oe.locator=S(v,{})}o.locator=ie,w(U,o,ne)&&x.push(U),o.locator=v}else w(U,o,ne)&&x.push(U);d&&!U.closed?P=T(e,P,U.tagName,p,o):P++}}catch(e){if(e instanceof l)throw e;if(e instanceof u)return c.fatalError(`Error constructing the DOM: `+e.name+`: `+e.message,e);c.error(`element parse error: `+e),P=-1}P>D?D=P:m(Math.max(O,D)+1)}}function S(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function C(e,t,n,r,i,a,o){function c(e,t,r){if(s(n.attributeNames,e))return a.fatalError(`Attribute `+e+` redefined`);if(!o&&t.indexOf(`<`)>=0)return a.fatalError(`Unescaped '<' not allowed in attributes values`);n.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(b,i),r)}for(var l,u,y=++t,x=d;;){var S=e.charAt(y);if(x===d&&S===`<`)throw Error(`unexpected < in tag name: `+e.slice(t,y));switch(S){case`=`:if(x===f)l=e.slice(t,y),x=m;else if(x===p)x=m;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(x===m||x===f){if(x===f&&(a.warning(`attribute value must after "="`),l=e.slice(t,y)),t=y+1,y=e.indexOf(S,t),y>0)u=e.slice(t,y),c(l,u,t-1),x=g;else throw Error(`attribute value no end '`+S+`' match`)}else if(x==h)u=e.slice(t,y),c(l,u,t),a.warning(`attribute "`+l+`" missed start quot(`+S+`)!!`),t=y+1,x=g;else throw Error(`attribute value must after "="`);break;case`/`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:x=v,n.closed=!0;case h:case f:break;case p:n.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return a.error(`unexpected end of input`),x==d&&n.setTagName(e.slice(t,y)),y;case`>`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:break;case h:case f:u=e.slice(t,y),u.slice(-1)===`/`&&(n.closed=!0,u=u.slice(0,-1));case p:x===p&&(u=l),x==h?(a.warning(`attribute "`+u+`" missed quot(")!`),c(l,u,t)):(o||a.warning(`attribute "`+u+`" missed value!! "`+u+`" instead!!`),c(u,u,t));break;case m:if(!o)return a.fatalError(`AttValue: ' or " expected`)}return y;case`€`:S=` `;default:if(S<=` `)switch(x){case d:n.setTagName(e.slice(t,y)),x=_;break;case f:l=e.slice(t,y),x=p;break;case h:var u=e.slice(t,y);a.warning(`attribute "`+u+`" missed quot(")!!`),c(l,u,t);case g:x=_}else switch(x){case p:o||a.warning(`attribute "`+l+`" missed value!! "`+l+`" instead2!!`),c(l,l,t),t=y,x=f;break;case g:a.warning(`attribute space is required"`+l+`"!!`);case _:x=f,t=y;break;case m:x=h,t=y;break;case v:throw Error(`elements closed character '/' and '>' must be connected to`)}}y++}}function w(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var o=e[a],l=o.qName,u=o.value,d=l.indexOf(`:`);if(d>0)var f=o.prefix=l.slice(0,d),p=l.slice(d+1),m=f===`xmlns`&&p;else p=l,f=null,m=l===`xmlns`&&``;o.localName=p,m!==!1&&(i??(i=Object.create(null),n=Object.create(n)),n[m]=i[m]=u,o.uri=c.XMLNS,t.startPrefixMapping(m,u))}for(var a=e.length;a--;)o=e[a],o.prefix&&(o.prefix===`xml`&&(o.uri=c.XML),o.prefix!==`xmlns`&&(o.uri=n[o.prefix]));var d=r.indexOf(`:`);d>0?(f=e.prefix=r.slice(0,d),p=e.localName=r.slice(d+1)):(f=null,p=e.localName=r);var h=e.uri=n[f||``];if(t.startElement(h,p,r,e),e.closed){if(t.endElement(h,p,r),i)for(f in i)s(i,f)&&t.endPrefixMapping(f)}else return e.currentNSMap=n,e.localNSMap=i,!0}function T(e,t,n,r,a){var s=i(n);if(s||o(n)){var c=RegExp(`</`+n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`>`,`ig`);c.lastIndex=t;var l=c.exec(e),u=l?l.index:-1;if(u<0)return t+1;var d=e.substring(t+1,u);return s&&(d=d.replace(b,r)),a.characters(d,0,d.length),u}return t+1}function E(e,t){for(var n in e)s(e,n)&&(t[n]=e[n])}function D(e,t){var r=t;function i(t){return t||=0,e.charAt(r+t)}function a(e){e||=1,r+=e}function o(){for(var t=0;r<e.length;){var n=i();if(n!==` `&&n!==`
19
+ `&&n!==` `&&n!==`\r`)return t;t++,a()}return-1}function s(){return e.substring(r)}function c(t){return e.substring(r,r+t.length)===t}function l(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}function u(e){var t=n.reg(`^`,e).exec(s());return t?(a(t[0].length),t[0]):null}return{char:i,getIndex:function(){return r},getMatch:u,getSource:function(){return e},skip:a,skipBlanks:o,substringFromIndex:s,substringStartsWith:c,substringStartsWithCaseInsensitive:l}}function O(e,t){function r(e,t){var r=n.PI.exec(e.substringFromIndex());return r?r[1].toLowerCase()===`xml`?t.fatalError(`xml declaration is only allowed at the start of the document, but found at position `+e.getIndex()):(e.skip(r[0].length),r[0]):t.fatalError(`processing instruction is not well-formed at position `+e.getIndex())}var i=e.getSource();if(e.char()===`[`){e.skip(1);for(var a=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),e.char()===`]`){var o=i.substring(a,e.getIndex());return e.skip(1),o}var s=null;if(e.char()===`<`&&e.char(1)===`!`)switch(e.char(2)){case`E`:e.char(3)===`L`?s=e.getMatch(n.elementdecl):e.char(3)===`N`&&(s=e.getMatch(n.EntityDecl));break;case`A`:s=e.getMatch(n.AttlistDecl);break;case`N`:s=e.getMatch(n.NotationDecl);break;case`-`:s=e.getMatch(n.Comment)}else if(e.char()===`<`&&e.char(1)===`?`)s=r(e,t);else if(e.char()===`%`)s=e.getMatch(n.PEReference);else return t.fatalError(`Error detected in Markup declaration`);if(!s)return t.fatalError(`Error in internal subset at position `+e.getIndex())}return t.fatalError(`doctype internal subset is not well-formed, missing ]`)}}function k(e,t,r,i,a){var o=D(e,t);switch(a?o.char(2).toUpperCase():o.char(2)){case`-`:var s=o.getMatch(n.Comment);return s?(r.comment(s,n.COMMENT_START.length,s.length-n.COMMENT_START.length-n.COMMENT_END.length),o.getIndex()):i.fatalError(`comment is not well-formed at position `+o.getIndex());case`[`:var c=o.getMatch(n.CDSect);return c?!a&&!r.currentElement?i.fatalError(`CDATA outside of element`):(r.startCDATA(),r.characters(c,n.CDATA_START.length,c.length-n.CDATA_START.length-n.CDATA_END.length),r.endCDATA(),o.getIndex()):i.fatalError(`Invalid CDATA starting at position `+t);case`D`:if(r.doc&&r.doc.documentElement)return i.fatalError(`Doctype not allowed inside or after documentElement at position `+o.getIndex());if(a?!o.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!o.substringStartsWith(n.DOCTYPE_DECL_START))return i.fatalError(`Expected `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());if(o.skip(n.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=o.getMatch(n.Name),!l.name)return i.fatalError(`doctype name missing or contains unexpected characters at position `+o.getIndex());if(a&&l.name.toLowerCase()!==`html`&&i.warning(`Unexpected DOCTYPE in HTML document at position `+o.getIndex()),o.skipBlanks(),o.substringStartsWith(n.PUBLIC)||o.substringStartsWith(n.SYSTEM)){var u=n.ExternalID_match.exec(o.substringFromIndex());if(!u)return i.fatalError(`doctype external id is not well-formed at position `+o.getIndex());u.groups.SystemLiteralOnly===void 0?(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral):l.systemId=u.groups.SystemLiteralOnly,o.skip(u[0].length)}else if(a&&o.substringStartsWithCaseInsensitive(n.SYSTEM)){if(o.skip(n.SYSTEM.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.SYSTEM+` at position `+o.getIndex());if(l.systemId=o.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return i.fatalError(`Expected `+n.ABOUT_LEGACY_COMPAT+` in single or double quotes after `+n.SYSTEM+` at position `+o.getIndex())}return a&&l.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&i.warning(`Unexpected doctype.systemId in HTML document at position `+o.getIndex()),a||(o.skipBlanks(),l.internalSubset=O(o,i)),o.skipBlanks(),o.char()===`>`?(o.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),o.getIndex()):i.fatalError(`doctype not terminated with > at position `+o.getIndex());default:return i.fatalError(`Not well-formed XML starting with "<!" at position `+t)}}function ee(e,t,r,i){var a=e.substring(t).match(n.PI);if(!a)return i.fatalError(`Invalid processing instruction starting at position `+t);if(a[1].toLowerCase()===`xml`){if(t>0)return i.fatalError(`processing instruction at position `+t+` is an xml declaration which is only at the start of the document`);if(!n.XMLDecl.test(e.substring(t)))return i.fatalError(`xml declaration is not well-formed`)}return r.processingInstruction(a[1],a[2]),t+a[0].length}function A(){this.attributeNames=Object.create(null)}A.prototype={setTagName:function(e){if(!n.QName_exact.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,r){if(!n.QName_exact.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},e.XMLReader=y,e.parseUtils=D,e.parseDoctypeCommentOrCData=k})),so=/* @__PURE__ */ t((e=>{var t=to(),n=io(),r=no(),i=ao(),a=oo(),o=n.DOMImplementation,s=t.hasDefaultHTMLNamespace,c=t.isHTMLMimeType,l=t.isValidMimeType,u=t.MIME_TYPE,d=t.NAMESPACE,f=r.ParseError,p=a.XMLReader;function m(e){return e.replace(/\r[\n\u0085]/g,`
20
+ `).replace(/[\r\u0085\u2028\u2029]/g,`
21
+ `)}function h(e){if(e||={},e.locator===void 0&&(e.locator=!0),this.assign=e.assign||t.assign,this.domHandler=e.domHandler||g,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!=`function`)throw TypeError(`errorHandler object is no longer supported, switch to onError!`);e.errorHandler&&e.errorHandler(`warning`,"The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||m,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}h.prototype.parseFromString=function(e,n){if(!l(n))throw TypeError(`DOMParser.parseFromString: the provided mimeType "`+n+`" is not valid.`);var r=this.assign(Object.create(null),this.xmlns),a=i.XML_ENTITIES,o=r[``]||null;s(n)?(a=i.HTML_ENTITIES,o=d.HTML):n===u.XML_SVG_IMAGE&&(o=d.SVG),r[``]=o,r.xml=r.xml||d.XML;var c=new this.domHandler({mimeType:n,defaultNamespace:o,onError:this.onError}),f=this.locator?{}:void 0;this.locator&&c.setDocumentLocator(f);var m=new p;return m.errorHandler=c,m.domBuilder=c,!t.isHTMLMimeType(n)&&typeof e!=`string`&&m.errorHandler.fatalError(`source is not a string`),m.parse(this.normalizeLineEndings(String(e)),r,a),c.doc.documentElement||m.errorHandler.fatalError(`missing root element`),c.doc};function g(e){var t=e||{};this.mimeType=t.mimeType||u.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function _(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}g.prototype={startDocument:function(){var e=new o;this.doc=c(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,``)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;b(this,a),this.currentElement=a,this.locator&&_(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&_(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&_(this.locator,n),b(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=y.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&_(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,n){e=y.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&_(this.locator,r),b(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n,r){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(e,t,n,r);this.locator&&_(this.locator,a),b(this,a),this.doc.doctype=a}},reportError:function(e,t){if(typeof this.onError==`function`)try{this.onError(e,t,this)}catch(n){throw new f(`Reporting `+e+` "`+t+`" caused `+n,this.locator)}else console.error(`[xmldom `+e+`] `+t,v(this.locator))},warning:function(e){this.reportError(`warning`,e)},error:function(e){this.reportError(`error`,e)},fatalError:function(e,t){throw this.reportError(`fatalError`,e),new f(e,this.locator,t)}};function v(e){if(e)return`
22
+ @#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function y(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){g.prototype[e]=function(){return null}});function b(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}function x(e){if(e===`error`)throw`onErrorStopParsing`}function S(){throw`onWarningStopParsing`}e.__DOMHandler=g,e.DOMParser=h,e.normalizeLineEndings=m,e.onErrorStopParsing=x,e.onWarningStopParsing=S})),co=(/* @__PURE__ */ t((e=>{var t=to();e.assign=t.assign,e.hasDefaultHTMLNamespace=t.hasDefaultHTMLNamespace,e.isHTMLMimeType=t.isHTMLMimeType,e.isValidMimeType=t.isValidMimeType,e.MIME_TYPE=t.MIME_TYPE,e.NAMESPACE=t.NAMESPACE;var n=no();e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=io();e.Attr=r.Attr,e.CDATASection=r.CDATASection,e.CharacterData=r.CharacterData,e.Comment=r.Comment,e.Document=r.Document,e.DocumentFragment=r.DocumentFragment,e.DocumentType=r.DocumentType,e.DOMImplementation=r.DOMImplementation,e.Element=r.Element,e.Entity=r.Entity,e.EntityReference=r.EntityReference,e.LiveNodeList=r.LiveNodeList,e.NamedNodeMap=r.NamedNodeMap,e.Node=r.Node,e.NodeList=r.NodeList,e.Notation=r.Notation,e.ProcessingInstruction=r.ProcessingInstruction,e.Text=r.Text,e.XMLSerializer=r.XMLSerializer;var i=so();e.DOMParser=i.DOMParser,e.normalizeLineEndings=i.normalizeLineEndings,e.onErrorStopParsing=i.onErrorStopParsing,e.onWarningStopParsing=i.onWarningStopParsing})))(),lo=/* @__PURE__ */ e(r(),1);function uo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var fo=uo();function po(e){fo=e}var mo={exec:()=>null};function ho(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function J(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(_o.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var go=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),_o={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ho(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ho(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:ho(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:ho(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ho(e=>RegExp(`^ {0,${e}}(?:</?(?:${Mo})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:ho(e=>RegExp(`^ {0,${e}}>`))},vo=/^(?:[ \t]*(?:\n|$))+/,yo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,bo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,So=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Co=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,wo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,To=J(wo).replace(/bull/g,Co).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Eo=J(wo).replace(/bull/g,Co).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Do=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Oo=/^[^\n]+/,ko=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ao=J(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ko).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jo=J(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Co).getRegex(),Mo=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,No=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Po=J(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,No).replace(`tag`,Mo).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fo=e=>J(Do).replace(`hr`,xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Mo).getRegex(),Io=Fo(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Lo=Fo(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ro={blockquote:J(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Lo).getRegex(),code:yo,def:Ao,fences:bo,heading:So,hr:xo,html:Po,lheading:To,list:jo,newline:vo,paragraph:Io,table:mo,text:Oo},zo=J(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Mo).getRegex(),Bo={...Ro,lheading:Eo,table:zo,paragraph:J(Do).replace(`hr`,xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,zo).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Mo).getRegex()},Vo={...Ro,html:J(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,No).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:mo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:J(Do).replace(`hr`,xo).replace(`heading`,` *#{1,6} *[^
23
+ ]`).replace(`lheading`,To).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ho=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Uo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wo=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Go=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ko=/[\p{P}\p{S}]/u,qo=/[\s\p{P}\p{S}]/u,Jo=/[^\s\p{P}\p{S}]/u,Yo=J(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,qo).getRegex(),Xo=/[\p{Pi}\p{Ps}"']/u,Zo=/(?!~)[\p{P}\p{S}]/u,Qo=/(?!~)[\s\p{P}\p{S}]/u,$o=/(?:[^\s\p{P}\p{S}]|~)/u,es=J(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,go?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),ts=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ns=J(ts,`u`).replace(/punct/g,Ko).getRegex(),rs=J(ts,`u`).replace(/punct/g,Zo).getRegex(),is=J(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Xo).replace(/punct/g,Ko).getRegex(),as=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,os=J(as,`gu`).replace(/notPunctSpace/g,Jo).replace(/punctSpace/g,qo).replace(/punct/g,Ko).getRegex(),ss=J(as,`gu`).replace(/notPunctSpace/g,$o).replace(/punctSpace/g,Qo).replace(/punct/g,Zo).getRegex(),cs=J(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Jo).replace(/punctSpace/g,qo).replace(/punct/g,Ko).getRegex(),ls=J(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Jo).replace(/punctSpace/g,qo).replace(/punct/g,Ko).getRegex(),us=J(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Jo).replace(/punctSpace/g,qo).replace(/punct/g,Ko).getRegex(),ds=J(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Ko).getRegex(),fs=J(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Jo).replace(/punctSpace/g,qo).replace(/punct/g,Ko).getRegex(),ps=J(/\\(punct)/,`gu`).replace(/punct/g,Ko).getRegex(),ms=J(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hs=J(No).replace(`(?:-->|$)`,`-->`).getRegex(),gs=J(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,hs).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_s=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,vs=J(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,_s).getRegex(),ys=J(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,vs).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bs=J(/^!?\[(label)\]\[(ref)\]/).replace(`label`,vs).replace(`ref`,ko).getRegex(),xs=J(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ko).getRegex(),Ss=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Cs=J(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,_s).getRegex(),ws=J(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,J(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Cs).replace(`ref`,Ss).getRegex()).replace(`nolink`,J(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ss).getRegex()).getRegex(),Ts=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Es=J(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ds={_backpedal:mo,anyPunctuation:ps,autolink:ms,blockSkip:es,br:Wo,code:Uo,del:mo,delLDelim:mo,delRDelim:mo,emStrongLDelim:ns,emStrongRDelimAst:os,emStrongRDelimUnd:ls,escape:Ho,link:ys,nolink:xs,punctuation:Yo,reflink:bs,reflinkSearch:ws,tag:gs,text:Go,url:mo},Os={...Ds,emStrongLDelim:is,emStrongRDelimAst:cs,emStrongRDelimUnd:us,link:J(/^!?\[(label)\]\((.*?)\)/).replace(`label`,vs).getRegex(),reflink:J(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,vs).getRegex()},ks={...Ds,emStrongRDelimAst:ss,emStrongLDelim:rs,delLDelim:ds,delRDelim:fs,url:J(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Es).replace(`protocol`,Ts).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:J(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Ts).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},As={...ks,br:J(Wo).replace(`{2,}`,`*`).getRegex(),text:J(ks.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},js={normal:Ro,gfm:Bo,pedantic:Vo},Ms={normal:Ds,gfm:ks,breaks:As,pedantic:Os},Ns={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Ps=e=>Ns[e];function Fs(e,t){if(t){if(_o.escapeTest.test(e))return e.replace(_o.escapeReplace,Ps)}else if(_o.escapeTestNoEncode.test(e))return e.replace(_o.escapeReplaceNoEncode,Ps);return e}function Is(e){return e.replace(_o.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function Ls(e){try{e=encodeURI(e).replace(_o.percentDecode,`%`)}catch{return null}return e}function Rs(e,t){let n=e.replace(_o.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(_o.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(_o.slashPipe,`|`);return n}function zs(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Bs(e){let t=e.split(`
24
+ `),n=t.length-1;for(;n>=0&&_o.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
25
+ `)}function Vs(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Hs(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Us(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Ws(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function Gs(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
26
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
27
+ `)}function Ks(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var qs=class{options;rules;lexer;constructor(e){this.options=e||fo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Bs(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Gs(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=zs(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:zs(t[0],`
28
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:zs(t[0],`
29
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=zs(t[0],`
30
+ `).split(`
31
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
32
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
33
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
34
+ ${s}`:s,r=r?`${r}
35
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
36
+ `),o=t.raw+`
37
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
38
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
39
+ ${d.join(`
40
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
41
+ `+e.join(`
42
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
43
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
44
+ `,1)[0],l=t[1].length,u=this.options.pedantic?Us(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>Us(e,l)),d=e.split(`
45
+ `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
46
+ `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
47
+ `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
48
+ `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
49
+ `+d}f=!d.trim(),r+=l+`
50
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Bs(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Hs(t[2],`()`)!==-1)return;let e=Vs(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:zs(t[0],`
51
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Rs(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
52
+ `):[],a={type:`table`,raw:zs(t[0],`
53
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Rs(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:zs(t[0],`
54
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
55
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Ks(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=zs(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Hs(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Ws(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Ks(e,n[1],r,this.rules))return;let i=t[Vs((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ws(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Is(t[0]),escaped:e}}}},Js=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||fo,this.options.tokenizer=this.options.tokenizer||new qs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:_o,block:js.normal,inline:Ms.normal};this.options.pedantic?(t.block=js.pedantic,t.inline=Ms.pedantic):this.options.gfm&&(t.block=js.gfm,t.inline=this.options.breaks?Ms.breaks:Ms.gfm),this.tokenizer.rules=t}static get rules(){return{block:js,inline:Ms}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(_o.carriageReturn,`
56
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(_o.tabCharGlobal,` `).replace(_o.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
57
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
58
+ `)?``:`
59
+ `)+i.raw,n.text+=`
60
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
61
+ `)?``:`
62
+ `)+i.raw,n.text+=`
63
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
64
+ `)?``:`
65
+ `)+i.raw,r.text+=`
66
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
67
+ `)?``:`
68
+ `)+i.raw,n.text+=`
69
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Vs(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Vs(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Ys=class{options;parser;constructor(e){this.options=e||fo}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(_o.notSpaceStart)?.[0],i=e?e.replace(_o.endingNewline,``)+`
70
+ `:``;return r?`<pre><code class="language-`+Fs(r)+`">`+(n?i:Fs(i,!0))+`</code></pre>
71
+ `:`<pre><code>`+(n?i:Fs(i,!0))+`</code></pre>
72
+ `}blockquote({tokens:e}){return`<blockquote>
73
+ ${this.parser.parse(e)}</blockquote>
74
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
75
+ `}hr(e){return`<hr>
76
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
77
+ `+r+`</`+i+`>
78
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
79
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
80
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
81
+ <thead>
82
+ `+t+`</thead>
83
+ `+r+`</table>
84
+ `}tablerow({text:e}){return`<tr>
85
+ ${e}</tr>
86
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
87
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Fs(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Fs(n,!0):this.parser.parseInline(r),o=Ls(e);if(o===null)return a;e=Fs(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Fs(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ls(e);if(i===null)return Fs(n);e=i;let a=`<img src="${Fs(e)}" alt="${Fs(n)}"`;return t&&(a+=` title="${Fs(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Fs(e.text)}},Xs=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Zs=class e{options;renderer;textRenderer;constructor(e){this.options=e||fo,this.options.renderer=this.options.renderer||new Ys,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xs}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Qs=class{options;block;constructor(e){this.options=e||fo}static passThroughHooks=/* @__PURE__ */ new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=/* @__PURE__ */ new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Js.lex:Js.lexInline}provideParser(e=this.block){return e?Zs.parse:Zs.parseInline}},$s=new class{defaults=uo();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Zs;Renderer=Ys;TextRenderer=Xs;Lexer=Js;Tokenizer=qs;Hooks=Qs;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ys(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new qs(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Qs;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Qs.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Qs.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Js.lex(e,t??this.defaults)}parser(e,t){return Zs.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(/* @__PURE__ */ Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(/* @__PURE__ */ Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(/* @__PURE__ */ Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Js.lex:Js.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Zs.parse:Zs.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Js.lex:Js.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Zs.parse:Zs.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
88
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Fs(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Y(e,t){return $s.parse(e,t)}Y.options=Y.setOptions=function(e){return $s.setOptions(e),Y.defaults=$s.defaults,po(Y.defaults),Y},Y.getDefaults=uo,Y.defaults=fo;function ec(...e){return $s.use(...e),Y.defaults=$s.defaults,po(Y.defaults),Y}Y.use=ec,Y.walkTokens=function(e,t){return $s.walkTokens(e,t)},Y.parseInline=$s.parseInline,Y.Parser=Zs,Y.parser=Zs.parse,Y.Renderer=Ys,Y.TextRenderer=Xs,Y.Lexer=Js,Y.lexer=Js.lex,Y.Tokenizer=qs,Y.Hooks=Qs,Y.parse=Y,Y.options,Y.setOptions,Y.walkTokens,Y.parseInline,Zs.parse,Js.lex;function tc(e,t){if(!t||typeof t.createElement!=`function`)throw Error(`A valid documentInstance is required to build frontmatter DOM.`);let n=JSON.stringify(e,null,2)||`{}`,r=t.createElement(`section`);r.setAttribute(`class`,`markdown-frontmatter`),r.setAttribute(`data-markdown-frontmatter`,``),r.setAttribute(`data-frontmatter`,n);let i=t.createElement(`details`);i.setAttribute(`class`,`markdown-frontmatter__details`),i.setAttribute(`hidden`,`hidden`);let a=t.createElement(`summary`);a.setAttribute(`class`,`markdown-frontmatter__summary`),a.appendChild(t.createTextNode(`Frontmatter`));let o=t.createElement(`pre`);o.setAttribute(`class`,`markdown-frontmatter__pre`);let s=t.createElement(`code`);return s.setAttribute(`class`,`language-json`),s.appendChild(t.createTextNode(n)),o.appendChild(s),i.appendChild(a),i.appendChild(o),r.appendChild(i),r}function nc(e,t){if(typeof t==`function`)return t;let n=e?.defaultView?.XMLSerializer||globalThis.XMLSerializer;return typeof n==`function`?e=>new n().serializeToString(e):null}function rc(e,t,n={}){let r=n.documentInstance||(typeof document<`u`?document:null);if(!r)throw Error(`No document instance available for frontmatter rendering.`);let i=t(e,r);if(typeof i.outerHTML==`string`)return i.outerHTML;let a=nc(r,n.serializeNode);if(a)return a(i);throw Error(`No serializer available for frontmatter DOM element.`)}function ic(e,t){let n=t instanceof Set?t:Array.isArray(t)?new Set(t):null;return e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/giu,(e,t,r)=>{if(r.trim())return``;let i=t.match(/\bsrc\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+))/iu),a=i?i[1]||i[2]||i[3]:``;if(!a)return``;if(n&&n.size>0){let t=a.split(`?`)[0].split(`#`)[0].trim(),r=e=>e.replace(/^\.?\//,``).replace(/^pages\/main\//,``).toLowerCase(),i=r(t);if(Array.from(n).some(e=>e===t||r(e)===i))return e}return``}).replace(/\son[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/giu,``)}function ac(e){if(e==null||e===``||e===!0)return 1;let t=String(e).trim().toLowerCase();if(t===`all`)return`all`;if(t===`none`||t===`0`||t===`false`)return 0;if(t===`1`||t===`current`||t===`single`)return 1;let n=parseInt(t,10);return!isNaN(n)&&n>=0?n:1}function oc(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 X(e,t){let n=oc(e);return n===-1?`${t}\n${e}`:e.slice(0,n)+t+`
89
+ `+e.slice(n)}function sc(e,t){let n=`<script id="shadow-claw-static-manifest" type="application/json">${l(t)}<\/script>`,r=e;return r=/id="shadow-claw-static-manifest"/iu.test(r)?r.replace(/<script\s+id="shadow-claw-static-manifest"[\s\S]*?<\/script>/iu,()=>n):X(r,` ${n}`),/id="shadow-claw-static-routing"/iu.test(r)||(r=X(r,` <script id="shadow-claw-static-routing" type="application/json">{"routes":{}}<\/script>`)),r}function cc(e){if(!e||e.length<8)return null;if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e.length>=24)return{type:`png`,width:e.readUInt32BE(16),height:e.readUInt32BE(20)};if(e[0]===71&&e[1]===73&&e[2]===70&&e.length>=10)return{type:`gif`,width:e.readUInt16LE(6),height:e.readUInt16LE(8)};if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=30&&e.subarray(8,12).toString(`ascii`)===`WEBP`){let t=e.subarray(12,16).toString(`ascii`);if(t===`VP8 `)return{type:`webp`,width:e.readUInt16LE(26)&16383,height:e.readUInt16LE(28)&16383};if(t===`VP8L`&&e.length>=25){let t=e[21],n=e[22],r=e[23],i=e[24];return{type:`webp`,width:1+((n&63)<<8|t),height:1+((i&15)<<10|r<<2|(n&192)>>6)}}if(t===`VP8X`)return{type:`webp`,width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}}if(e[0]===255&&e[1]===216){let t=2;for(;t<e.length-1;){if(e[t]!==255){t++;continue}let n=e[t+1];if((n>=192&&n<=195||n>=197&&n<=199||n>=201&&n<=203||n>=205&&n<=207)&&t+9<=e.length){let n=e.readUInt16BE(t+5);return{type:`jpeg`,width:e.readUInt16BE(t+7),height:n}}if(n===217||n===218)break;if(t+3<e.length){let n=e.readUInt16BE(t+2);t+=2+n}else break}}let t=e.subarray(0,1024).toString(`utf8`);if(/<svg\b[^>]*>/iu.test(t)){let e=t.match(/\bwidth=["']?(\d+(?:\.\d+)?)/iu),n=t.match(/\bheight=["']?(\d+(?:\.\d+)?)/iu);if(e&&n)return{type:`svg`,width:Math.round(parseFloat(e[1])),height:Math.round(parseFloat(n[1]))};let r=t.match(/\bviewBox=["']?\s*[\d.-]+\s+[\d.-]+\s+(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)/iu);if(r)return{type:`svg`,width:Math.round(parseFloat(r[1])),height:Math.round(parseFloat(r[2]))}}return null}async function lc(e){try{let t=null,n=null;if(R!==void 0&&typeof R.getBuiltinModule==`function`){let e=R.getBuiltinModule(`node:fs/promises`),r=R.getBuiltinModule(`node:path`);t=e?.readFile,n=r?.resolve}if(!t)return null;let r=n?n(e):e;return cc(await t(r))}catch{return null}}function uc(e,t,n=R.cwd(),r=[]){if(/^(?:https?:|\/\/|data:|blob:)/iu.test(e))return null;let i=e.split(`?`)[0].split(`#`)[0],a=i.replace(/^\/+/,``),o=[];p(i)&&o.push(i),t&&!i.startsWith(`/`)&&o.push(b(n,g(t),a)),o.push(b(n,a));for(let e of r)o.push(b(n,e,a));o.push(b(n,`pages/main/assets`,a.replace(/^pages\/main\/assets\/?/,``)),b(n,`pages/main`,a.replace(/^pages\/main\/?/,``)),b(n,`pages`,a.replace(/^pages\/?/,``)),b(n,`assets`,a.replace(/^assets\/?/,``)),b(n,`dist/public`,a));for(let e of o)if(p(e))return e;return null}async function dc(e,t={}){let n=/<img\b([^>]*?)>/giu,r=t.baseDir||R.cwd(),i=[],a;for(;(a=n.exec(e))!==null;)i.push({fullMatch:a[0],attributes:a[1],index:a.index});if(i.length===0)return e;let o=e,s=0;for(let e=0;e<i.length;e++){let n=i[e],a=n.attributes,c=a.match(/\bsrc=["']([^"']+)["']/iu),l=c?c[1]:null,u=/\bwidth=["']?\d+/iu.test(a),d=/\bheight=["']?\d+/iu.test(a),f=/\bloading=["']/iu.test(a),p=/\bdecoding=["']/iu.test(a),m=/\bfetchpriority=["']/iu.test(a),h=/\/\s*$/u.test(a);if(h&&(a=a.replace(/\/\s*$/u,``).trimEnd()),(!u||!d)&&l){let e=uc(l,t.pagePath,r,t.assetDirs);if(e){let t=await lc(e);t&&(u||(a+=` width="${t.width}"`),d||(a+=` height="${t.height}"`))}}e===0?(f||(a+=` loading="eager"`),m||(a+=` fetchpriority="high"`)):f||(a+=` loading="lazy"`),p||(a+=` decoding="async"`);let g=`<img${a}${h?` />`:`>`}`,_=n.index+s,v=_+n.fullMatch.length;o=o.slice(0,_)+g+o.slice(v),s+=g.length-n.fullMatch.length}return o}function fc(e){return e.replace(/^\.?\//,``).replace(/^pages\/main\//,``).toLowerCase().trim()}function pc(e){return(e.split(`/`).pop()||``).toLowerCase().trim()}function mc(e){return pc(e).replace(/\.(js|mjs|cjs|ts)$/i,``).toLowerCase().trim()}function hc(e=[],t,n){if(!Array.isArray(e)||e.length===0)return[];let r=e.map(e=>typeof e==`string`?{src:e}:e&&typeof e==`object`&&typeof e.src==`string`?e:null).filter(e=>e!==null),i=[],a=/* @__PURE__ */ new Set;for(let e of r)(e.global===!0||e.autoload===!0)&&(a.has(e.src)||(a.add(e.src),i.push(e)));if(!t&&!n)return i;let o=[];if(Array.isArray(t))o.push(...t);else if(typeof t==`string`)o.push(...t.split(/[,;\s]+/));else if(typeof t==`object`&&t){let e=t;Array.isArray(e.dependencies)?o.push(...e.dependencies):typeof e.dependencies==`string`&&o.push(...e.dependencies.split(/[,;\s]+/)),Array.isArray(e.scripts)?o.push(...e.scripts):typeof e.scripts==`string`&&o.push(...e.scripts.split(/[,;\s]+/))}if(typeof n==`string`&&n){let e=n.matchAll(/<script\b[^>]*src=["']([^"']+)["'][^>]*>/gi);for(let t of e)t[1]&&o.push(t[1]);for(let e of r){let t=[e.id,e.name,mc(e.src),pc(e.src)].filter(Boolean);for(let e of t)if(e.includes(`-`)&&RegExp(`<${e}[\\s>/]`,`i`).test(n)){o.push(e);break}}}let s=[];for(let e of o)if(typeof e==`string`){let t=e.trim();t&&s.push(t)}else if(e&&typeof e==`object`){let t=e.id||e.name||e.src;typeof t==`string`&&t.trim()&&s.push(t.trim())}for(let e of s){let t=e.toLowerCase(),n=fc(e),o=pc(e),s=mc(e),c=r.find(r=>{if(r.id&&r.id.toLowerCase()===t||r.name&&r.name.toLowerCase()===t||r.src===e||r.src.toLowerCase()===t||fc(r.src)===n)return!0;let i=pc(r.src);if(i&&(i===o||i===t))return!0;let a=mc(r.src);return!(!a||a!==s&&a!==t)});c?a.has(c.src)||(a.add(c.src),i.push(c)):console.warn(`[ShadowClaw] Script dependency "${e}" declared in page frontmatter was not found in approved customElements.scripts config.`)}return i}function gc(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))return e;let t=e.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``);return t.startsWith(`/`)?t:`/${t}`}function _c(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function vc(e,t=_c){return!Array.isArray(e)||e.length===0?``:e.map(e=>{if(typeof e==`string`)return` <script type="module" src="${t(gc(e))}"><\/script>`;if(e&&typeof e==`object`&&e.src){let n=gc(e.src),r=[` <script${e.type?` type="${t(e.type)}"`:` type="module"`}${e.async?` async`:``}${e.defer?` defer`:``} src="${t(n)}"><\/script>`];return e.hasInit&&r.push(` <script type="module">import("${t(n)}").then((m) => { try { if (typeof m?.init === "function") m.init(); } catch (e) { console.error("[ShadowClaw] Error executing init for ${t(n)}", e); } }).catch(() => {});<\/script>`),r.join(`
90
+ `)}return``}).filter(Boolean).join(`
91
+ `)}const yc=[`pages/resources/`,`pages/deps/`,`resources/`,`deps/`,`pages/assets/`,`pages/main/assets/`];function bc(e){for(let t of yc)if(e.startsWith(t))return e.slice(t.length).replace(/^\/+/,``);return e.replace(/^\/+/,``)}Y.use({tokenizer:{html(e){let t=e.match(/^ {0,3}<([a-zA-Z][a-zA-Z0-9]*-[a-zA-Z0-9_-]*)(?:\s+[^>]*)?>[\s\S]*?<\/\1>(?:[ \t]*(?:\n+|$))?/i)||e.match(/^ {0,3}<([a-zA-Z][a-zA-Z0-9]*-[a-zA-Z0-9_-]*)(?:\s+[^>]*)?\s*\/>(?:[ \t]*(?:\n+|$))?/i);return t?{type:`html`,block:!0,raw:t[0],text:t[0],pre:!1}:!1}}});const xc=/* @__PURE__ */ new Set([`.md`,`.markdown`,`.html`,`.htm`,`.xhtml`]),Sc=new co.DOMImplementation().createDocument(null,`html`,null),Cc=new co.XMLSerializer;function wc(){return[{absolutePath:null,displayPath:`index.html`,inlineContent:i},{absolutePath:null,displayPath:`MEMORY.md`,inlineContent:a}]}function Tc(e){let t=(0,lo.default)(e);return{data:t.data&&typeof t.data==`object`?t.data:{},content:t.content||``}}function Ec(e){let t=e.match(/<template[^>]*>([\s\S]*?)<\/template>/iu);if(!t)throw Error(`Template wrapper not found while generating DSD.`);return t[1].trim()}function Dc(e,t,n){let r=`br-${m.basename(t)}`;e[r]||(e[r]={});let i=n.split(`/`),a=e[r];for(let e=0;e<i.length-1;e++){let t=i[e];a[t]||(a[t]={}),a=a[t]}a.purgePreRenderedStaticPages=!0}function Oc(e){let t=m.extname(e).toLowerCase();return xc.has(t)}function kc(e,t=`desc`){return[...e].sort((e,n)=>{let r=m.basename(e),i=m.basename(n),a=/^index\.(html?|xhtml)$/iu.test(r),o=/^index\.(html?|xhtml)$/iu.test(i);if(a&&!o)return-1;if(!a&&o)return 1;let s=/^memory\.(md|markdown)$/iu.test(r),c=/^memory\.(md|markdown)$/iu.test(i);return s&&!c?1:!s&&c?-1:t===`desc`?n.localeCompare(e,void 0,{numeric:!0,sensitivity:`base`}):e.localeCompare(n,void 0,{numeric:!0,sensitivity:`base`})})}async function Ac(e,t=`desc`,n){let r;try{r=await I(e)}catch(e){if(e?.code===`ENOENT`)return wc();throw e}if(r.isFile()){let t=u(m.basename(e));return o(t,{allowList:n?.allowList??n?.allowlist,denyList:n?.denyList??n?.denylist,basePathPrefix:e})?[{absolutePath:e,displayPath:t}]:wc()}let i=[];async function a(t){let r=await M(t,{withFileTypes:!0});for(let s of r){let r=m.join(t,s.name);if(s.isDirectory()){await a(r);continue}if(!s.isFile()||!Oc(s.name))continue;let c=u(m.relative(e,r));if(o(c,{allowList:n?.allowList??n?.allowlist,denyList:n?.denyList??n?.denylist,basePathPrefix:e}))i.push({absolutePath:r,displayPath:c});else if(c.endsWith(`.md`))try{(await j(r,`utf8`)).includes(`slug: "shadow-claw--purge-pages"`)&&i.push({absolutePath:r,displayPath:c})}catch{}}}if(await a(e),i.length===0)return wc();let s=new Map(i.map(e=>[e.displayPath,e]));return kc(i.map(e=>e.displayPath),t).map(e=>s.get(e))}async function jc(e){let t=[],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set;async function i(e,a){try{let t=await P(e);if(r.has(t))return;r.add(t)}catch{return}let o=await M(e,{withFileTypes:!0});for(let r of o){let o=m.join(e,r.name),s=r.isDirectory(),c=r.isFile();if(r.isSymbolicLink())try{let e=await I(o);s=e.isDirectory(),c=e.isFile()}catch{continue}if(s)await i(o,a);else if(c){let e=u(m.relative(a,o));if(n.has(e))continue;n.add(e);let i={absolutePath:o,displayPath:e};if(m.extname(r.name).toLowerCase()===`.md`)try{let e=Tc(await j(o,`utf8`));e.data.slug===`shadow-claw--purge-skills`&&(i.isPurgeMarker=!0,e.data[`purge-id`]!==void 0&&(i.purgeId=String(e.data[`purge-id`])))}catch{}t.push(i)}}}try{(await I(e)).isDirectory()&&await i(e,e)}catch(e){if(e?.code!==`ENOENT`)throw e}if(m.basename(e)===`main`&&m.basename(m.dirname(e))===`skills`){let t=m.dirname(e);try{if((await I(t)).isDirectory()){let e=await M(t,{withFileTypes:!0});for(let n of e){if(n.name===`main`)continue;let e=m.join(t,n.name),a=n.isDirectory();if(n.isSymbolicLink())try{a=(await I(e)).isDirectory()}catch{continue}a&&(r.clear(),await i(e,t))}}}catch(e){if(e?.code!==`ENOENT`)throw e}}return t.sort((e,t)=>e.displayPath.localeCompare(t.displayPath))}async function Mc(e){try{if(!(await I(e)).isDirectory())return[]}catch(t){if(t?.code===`ENOENT`)return m.basename(e)===`main`&&m.basename(m.dirname(e))===`tools`?Mc(m.dirname(e)):[];throw t}let t=[];async function n(r){let i=await M(r,{withFileTypes:!0});for(let a of i){let i=m.join(r,a.name);if(a.isDirectory())await n(i);else if(a.isFile()&&a.name.endsWith(`.json`)){let n=u(m.relative(e,i)),r=n.startsWith(`main/`)?n.slice(5):n;t.push({absolutePath:i,displayPath:r})}}}return await n(e),t.sort((e,t)=>e.displayPath.localeCompare(t.displayPath))}async function Nc(e,t,n){let r=m.extname(t).toLowerCase(),i=r===`.html`||r===`.htm`||r===`.xhtml`,a=Array.isArray(n)||n instanceof Set?n:n?.approvedScripts,o,c;if(i)o=Tc(e),c=ic(o.content,a);else try{o=Tc(e),c=ic(await Y.parse(o.content),a)}catch{o={data:{},content:e},c=`<p>${s(e)}</p>`}if(t){let e=m.posix.dirname(u(t)),n=`/files/main/${e===`.`?``:e+`/`}`;c=c.replace(/<img\s+([^>]*?)src="([^"]+)"([^>]*)>/giu,(e,t,r,i)=>/^(?:[a-z]+:|#|\/)/iu.test(r)?e:`<img ${t}src="${n}${r}"${i}>`)}let l=n&&typeof n==`object`&&!Array.isArray(n)&&!(n instanceof Set)?n.baseDir||n.contentRoot:void 0;return c=await dc(c,{pagePath:t,baseDir:l}),o.data&&Object.keys(o.data).length>0&&(c=`${rc(o.data,tc,{documentInstance:Sc,serializeNode:e=>Cc.serializeToString(e)})}\n${c}`),c}function Pc(e,t){let n=/<\/?template\b[^>]*>/giu;n.lastIndex=t;let r=0,i=!1,a=n.exec(e);for(;a;){if(a[0].toLowerCase().startsWith(`</template`)?--r:(r+=1,i=!0),i&&r===0)return n.lastIndex;a=n.exec(e)}return-1}function Fc(e){let t=e.indexOf(`<template shadowrootmode="open" data-shadow-claw-dsd="true">`);if(t===-1)return e;let n=Pc(e,t);return n===-1?e:`${e.slice(0,t)}${e.slice(n)}`}function Ic(e){return e.replace(/\s*<div\s+aria-hidden="true"\s+class="boot-shell">[\s\S]*?<\/div>\s*/iu,`
92
+ `)}function Lc(e){return[`<details class="pages__group-details" open>`,` <summary class="pages__group-label">`,` <span>Main</span><span class="pages__group-icon">▼</span>`,` </summary>`,` <div class="pages__group-pages">`,e.map((e,t)=>{let n=t===0,r=n?` active`:``,i=n?` is-default`:``,a=s(e.displayPath);return[` <div class="pages__list-item${r}">`,` <span class="pages__drag-handle" draggable="true" title="Drag to reorder">⠿</span>`,` <span class="pages__default-btn${i}" title="Default page">⭐</span>`,` <button type="button" class="pages__select" title="Open ${a}">`,` <span class="pages__list-path">${a}</span>`,` </button>`,` <button class="pages__edit" type="button" title="Edit in file editor" aria-label="Edit ${a} in file editor">✏️</button>`,` <button class="pages__remove" type="button" title="Remove from Pages" aria-label="Remove ${a} from Pages in Main">✕</button>`,` </div>`].join(`
93
+ `)}).join(`
94
+ `),` </div>`,`</details>`].join(`
95
+ `)}function Rc(e,t,n=``,r=``){return e.replace(/(<shadow-claw-page-header\b[^>]*>)([\s\S]*?)(<\/shadow-claw-page-header>)/iu,(e,i,a,o)=>{if(/^\s*<template\s+shadowrootmode=/iu.test(a))return e;let c=i.match(/\sicon="([^"]*)"/iu),l=i.match(/\stitle="([^"]*)"/iu),u=c?c[1]:``,d=l?l[1]:``;n&&(d=`${d} — ${n}`);let f=[u,d].filter(Boolean).join(` `),p=t;return p=p.replace(/<h2\s+class="header__title"><\/h2>/iu,()=>`<h2 class="header__title">${s(f)}</h2>`),p=p.replace(/<details\s+class="header__actions-disclosure">/iu,`<details class="header__actions-disclosure" hidden>`),p=p.replace(/<div\s+class="header__actions"\s+id="header-actions-panel">/iu,`<div class="header__actions" id="header-actions-panel" hidden>`),[i,`<template shadowrootmode="open" data-shadow-claw-page-header-dsd="true">`,`<style data-dsd-style>${r}</style>`,p,`</template>`,a.trim(),o].join(`
96
+ `)})}function zc(e,t,n,r,i=``,a=``){let o=t.length===1?`1 saved page`:`${t.length} saved pages`,c=Lc(t),l=t[0]?.displayPath||`Select a page...`,u=e;return u=u.replace(/<div\b[^>]*\bdata-pages-status\b[^>]*><\/div>/iu,()=>`<div class="pages__status" data-pages-status>${s(o)}</div>`),u=u.replace(/<span\b[^>]*?\bdata-pages-dropdown-selected\b[^>]*>[\s\S]*?<\/span\s*>/iu,()=>`<span class="pages__dropdown-selected" data-pages-dropdown-selected>${s(l)}</span>`),u=u.replace(/<div\s+class="pages__list"\s+data-pages-list\s+role="list"><\/div>/giu,()=>`<div class="pages__list" data-pages-list role="list">\n${c}\n</div>`),u=u.replace(/<div\s+class="pages__empty"\s+data-pages-empty>/iu,()=>`<div class="pages__empty" data-pages-empty hidden>`),u=u.replace(/<div\s+class="pages__rendered"\s+data-pages-rendered\s+hidden><\/div>/iu,()=>`<div class="pages__rendered" data-pages-rendered data-initial-path="${s(l)}">${n}</div>`),Rc(u,r,i,a)}function Bc(e,t,n,r,i=``,a=``,o=``,c=``){let l=zc(e,t,n,r,i,o),u=c?`<link rel="stylesheet" data-theme-stylesheet="true" href="${s(c)}">`:``;return[`<shadow-claw-pages>`,`<template shadowrootmode="open" data-shadow-claw-pages-dsd="true">`,`<style data-dsd-style>${a}</style>`,u,l,`</template>`,`</shadow-claw-pages>`].filter(Boolean).join(`
97
+ `)}function Vc(e){let t=e;return t=t.replace(/<div\s+class="pages__empty"\s+data-pages-empty>[\s\S]*?<\/div>/iu,`<div class="pages__empty" data-pages-empty hidden></div>`),t}function Hc(e,t=``,n=``){let r=Vc(e),i=n?`<link rel="stylesheet" data-theme-stylesheet="true" href="${s(n)}">`:``;return[`<shadow-claw-pages>`,`<template shadowrootmode="open" data-shadow-claw-pages-dsd="true">`,`<style data-dsd-style>${t}</style>`,i,r,`</template>`,`</shadow-claw-pages>`].filter(Boolean).join(`
98
+ `)}function Uc(e){return e.replace(/(<shadow-claw-dialog\b[^>]*>)([\s\S]*?)(<\/shadow-claw-dialog>)/giu,(e,t,n,r)=>{if(/^\s*<template\b/iu.test(n))return e;let i=n.trim();return i?[t,`<template>`,i,`</template>`,r].join(`
99
+ `):`${t}<template></template>${r}`})}function Wc(e,t={}){let n=e;if(!t||typeof t!=`object`)return n;let r=e=>{let t=RegExp(`(<li\\s+class="[^"]*nav-item[^"]*"\\s+data-page="${e}")(?![^>]*\\bhidden\\b)([^>]*>)`,`iu`);n=n.replace(t,`$1 hidden aria-hidden="true"$2`)};return t.pagesHidden&&r(`pages`),t.chatHidden&&(r(`chat`),n=n.replace(/(<shadow-claw-conversations)(?![^>]*\bhidden\b)([^>]*>)/iu,`$1 hidden aria-hidden="true"$2`)),t.tasksHidden&&r(`tasks`),t.filesHidden&&r(`files`),n}function Gc(e,t,n=``,r={}){let i=e.replace(/<shadow-claw-pages><\/shadow-claw-pages>/iu,()=>t);i===e&&(i=e.replace(/(<div\s+class="page(?:\s+active)?"\s+data-page-id="pages">)[\s\S]*?(<\/div>)/iu,`$1\n ${t}\n $2`)),i=Wc(i,r);let a=Uc(i);return[`<template shadowrootmode="open" data-shadow-claw-dsd="true">`,`<style data-dsd-style>${n}</style>`,a,`</template>`].join(`
100
+ `)}function Kc(e,t=``,n={}){let r=e;r=r.replace(/(<li\s+class="nav-item)\s+active(\s*"\s+data-page="pages">)/iu,`$1$2`),r=r.replace(/(<div\s+class="page)\s+active("\s+data-page-id="pages">)/iu,`$1$2`),r=r.replace(/(<li\s+class="nav-item[^"]*"\s+data-page="pages")>/iu,`$1 hidden aria-hidden="true">`);let i=n?.chatHidden?n?.tasksHidden?n?.filesHidden?`chat`:`files`:`tasks`:`chat`;r=r.replace(RegExp(`(<li\\s+class="nav-item)(\\s*"\\s+data-page="${i}">)`,`iu`),`$1 active$2`),r=r.replace(RegExp(`(<div\\s+class="page\\s+${i}-page)("\\s+data-page-id="${i}">)`,`iu`),`$1 active$2`),r=Wc(r,n);let a=Uc(r);return[`<template shadowrootmode="open" data-shadow-claw-dsd="true">`,`<style data-dsd-style>${t}</style>`,a,`</template>`].join(`
101
+ `)}function qc(e,t){let n=e.match(/<shadow-claw\b[^>]*>/iu),r=n?n[0]:null,i=n?.index??-1;if(i===-1||!r)throw Error(`Unable to find <shadow-claw> host in index.html.`);let a=e.indexOf(`</shadow-claw>`,i);if(a===-1)throw Error(`Unable to find </shadow-claw> host in index.html.`);let o=i+r.length,s=Ic(Fc(e.slice(o,a))).trim(),c=s?`\n ${t}\n${s}\n `:`\n ${t}\n `;return`${e.slice(0,o)}${c}${e.slice(a)}`}function Jc(e){return e.replace(/<shadow-claw(\s[^>]*)?>/iu,(e,t=``)=>/\sdata-prerender-no-seed\s*=\s*/iu.test(t)?`<shadow-claw${t}>`:`<shadow-claw${t} data-prerender-no-seed="true">`)}async function Yc(e,t,n){if(n?.singleFile||!(n?.isProduction===void 0?C.env.NODE_ENV===`production`:n.isProduction))return e;let r=e;try{let e=m.join(t,`index.css`),n=await j(e,`utf8`);r=r.replace(/<link\b[^>]*?href="(?:\/)?index\.css"[^>]*?>/iu,()=>`<style>${n}</style>`)}catch(e){console.warn(`Failed to inline index.css`,e.message)}try{let e=m.join(t,`theme-init.js`),n=await j(e,`utf8`);r=r.replace(/<script\b[^>]*?src="(?:\/)?theme-init\.js"[^>]*?><\/script>/iu,()=>`<script>${n}<\/script>`)}catch(e){console.warn(`Failed to inline theme-init.js`,e.message)}try{let e=m.join(t,`service-worker/init.js`),n=await j(e,`utf8`);r=r.replace(/<script\b[^>]*?src="(?:\/)?service-worker\/init\.js"[^>]*?><\/script>/iu,()=>`<script type="module">${n}<\/script>`)}catch(e){console.warn(`Failed to inline service-worker/init.js`,e.message)}try{let e=m.join(t,`index.js`);if(await I(e).then(()=>!0).catch(()=>!1)){let n=await j(e,`utf8`),i=/* @__PURE__ */ new Set;i.add(`index.js`);let a=/(?:(?:import|export)\b[^;]*?\bfrom\s*|import\s*\(|import\s*)\s*[`"']\.\/([^`"']+?\.js)[`"']/g,o;for(;(o=a.exec(n))!==null;)i.add(o[1]);for(let e of Array.from(i))if(e.startsWith(`shadow-claw-`)||e.startsWith(`chunk-`))try{let n=m.join(t,e),r=await j(n,`utf8`),a,o=/(?:(?:import|export)\b[^;]*?\bfrom\s*|import\s*\(|import\s*)\s*[`"']\.\/([^`"']+?\.js)[`"']/g;for(;(a=o.exec(r))!==null;)i.add(a[1])}catch{}let s=[];for(let e of i){let t=`<link rel="modulepreload" href="${e}" />`;!r.includes(t)&&!r.includes(`rel="modulepreload" href="${e}"`)&&s.push(` ${t}`)}s.length>0&&(r=X(r,s.join(`
102
+ `)))}}catch(e){console.warn(`Failed to inject modulepreload tags`,e.message)}return r}function Xc(e){if(!e||typeof e!=`string`)return e;let t=[],n=e.replace(/<pre\b[^>]*>[\s\S]*?<\/pre>|<textarea\b[^>]*>[\s\S]*?<\/textarea>/gi,e=>{let n=t.length;return t.push(e),`___PRESERVED_BLOCK_${n}___`}),r=e=>e.replace(/\s+/g,` `).replace(/>\s+</g,`><`).trim();function i(e){let t=/<template\b[^>]*>/gi,n,a=0,o=``;for(;(n=t.exec(e))!==null;){let s=n[0],c=n.index,l=/<\/?template\b[^>]*>/gi;l.lastIndex=c;let u=0,d=!1,f=l.exec(e),p=-1,m=0;for(;f;){if(f[0].toLowerCase().startsWith(`</template`)?--u:(u+=1,d=!0),d&&u===0){p=f.index,m=f[0].length;break}f=l.exec(e)}if(p!==-1){o+=e.slice(a,c);let n=e.slice(c+s.length,p),l=r(i(n));o+=`${s}${l}</template>`,a=p+m,t.lastIndex=a}}return o+=e.slice(a),o}let a=i(n);a=a.replace(/(<template\s+shadowrootmode="?[a-z]+"?[^>]*>)([\s\S]*?)(<\/template>)/gi,(e,t,n,i)=>`${t}${r(n)}${i}`);for(let e=0;e<t.length;e++)a=a.replace(`___PRESERVED_BLOCK_${e}___`,()=>t[e]);return a}async function Zc(e={}){let t=m.resolve(e.indexPath||`dist/public/index.html`),n=m.resolve(e.sourcePath||`pages/main`),r=m.resolve(e.skillsSourcePath||m.join(m.dirname(n),`..`,`.agents`,`skills`,`main`)),i=m.resolve(e.toolsSourcePath||m.join(m.dirname(n),`..`,`.agents`,`tools`,`main`)),a=m.resolve(e.publicDir||m.dirname(t)),o=e.isProduction===void 0?C.env.NODE_ENV===`production`:e.isProduction,s=e.singleFile??!1,c=ac(e.prerenderPages===void 0?e.noSeed?0:C.env.PRERENDER_PAGES??1:e.prerenderPages),l=e.siteConfig||{};if(!e.siteConfig){let t=[e.siteConfigPath,m.resolve(`shadow-claw-config.json`),m.resolve(`shadow-claw.config.json`),m.resolve(`shadowclaw.config.json`),m.resolve(`pages/shadow-claw-config.json`),m.resolve(`pages/shadow-claw.config.json`),m.resolve(`site-config.json`),m.resolve(`pages/site-config.json`)].filter(Boolean);for(let e of t)try{let t=await j(m.resolve(e),`utf8`);l=JSON.parse(t);break}catch{}}let u=e.sortOrder||l?.pages?.sortOrder||`desc`,d=m.join(a,`components/shadow-claw/shadow-claw.html`),f=m.join(a,`components/shadow-claw-pages/shadow-claw-pages.html`),p=m.join(a,`components/shadow-claw-page-header/shadow-claw-page-header.html`),h=m.join(a,`components/shadow-claw/shadow-claw.css`),g=m.join(a,`components/shadow-claw-pages/shadow-claw-pages.css`),_=m.join(a,`components/shadow-claw-page-header/shadow-claw-page-header.css`),[v,y,b,x,S,w,T,E,D,O]=await Promise.all([j(t,`utf8`),j(d,`utf8`),j(f,`utf8`).catch(()=>``),j(p,`utf8`).catch(()=>``),Ac(n,u,{allowList:l?.pages?.allowList??l?.pages?.allowlist??l?.allowList??l?.allowlist,denyList:l?.pages?.denyList??l?.pages?.denylist??l?.denyList??l?.denylist}),jc(r),Mc(i),j(h,`utf8`).catch(()=>``),j(g,`utf8`).catch(()=>``),j(_,`utf8`).catch(()=>``)]),ee=await Promise.all(S.map(async e=>{let t=typeof e.inlineContent==`string`?e.inlineContent:await j(e.absolutePath,`utf8`);return{...e,content:t}})),M,N={},P=ee.filter(e=>{if(e.displayPath.endsWith(`.md`)&&/^---\r?\n[\s\S]*?slug:\s*"shadow-claw--purge-pages"[\s\S]*?---/mu.test(e.content)){if(Dc(N,n,e.displayPath),!M){let t=Tc(e.content).data[`purge-id`];t!=null&&(M=String(t))}return!1}return!0}),F=P.map(e=>({displayPath:e.displayPath,content:e.content})),R={pages:F},te=await Promise.all(w.filter(e=>!e.isPurgeMarker).map(async e=>({displayPath:e.displayPath,content:await j(e.absolutePath,`utf8`)})));te.length>0&&(R.skills=te);let z=await Promise.all(T.map(async e=>({displayPath:e.displayPath,content:await j(e.absolutePath,`utf8`)})));z.length>0&&(R.tools=z);let B=w.find(e=>e.isPurgeMarker);B?.purgeId&&(R.skillsPurgeId=B.purgeId),Object.keys(N).length>0&&(R.preRenderedStaticPages=N),M&&(R.purgeId=M);let V=m.join(a,`static-main-manifest.json`);await A(a,{recursive:!0}),await L(V,JSON.stringify(R,null,2),`utf8`);try{if((await I(n)).isDirectory()){let e=m.join(a,`static-main`);await A(e,{recursive:!0}),await k(n,e,{recursive:!0});let t=m.join(a,`files/main`);await A(t,{recursive:!0}),await k(n,t,{recursive:!0})}}catch{}try{(await I(i)).isDirectory()&&(await A(m.join(a,`tools/main`),{recursive:!0}),await k(i,m.join(a,`tools/main`),{recursive:!0}))}catch{}try{(await I(r)).isDirectory()&&(await A(m.join(a,`skills/main`),{recursive:!0}),await k(r,m.join(a,`skills/main`),{recursive:!0}))}catch{}for(let e of w)if(!e.isPurgeMarker)try{let t=m.join(a,`skills/main`,e.displayPath);await A(m.dirname(t),{recursive:!0}),await k(e.absolutePath,t,{force:!0})}catch{}let H=Ec(y);if(c===0){let n=Kc(H,E,l.sidebar),r=await Yc(Xc(sc(qc(Jc(v),n),JSON.stringify({pages:[],skills:[]}))),a,{isProduction:o,singleFile:s});await L(t,r,`utf8`),(e.silent??C.env.NODE_ENV===`test`)||console.log(`Injected DSD shell into ${t} (pages DSD disabled).`);return}let U=[],ne=[];c===`all`?(U=P,ne=F):typeof c==`number`&&(U=P.slice(0,c),ne=F.slice(0,c));let re=Ec(b),ie=Ec(x),ae=l?.theme?.stylesheet,oe=``;if(typeof ae==`string`&&ae.trim()){let e=bc(ae.trim());oe=e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)?e:e.replace(/^\/+/,``)}let se;if(P.length===0)se=Gc(H,Hc(re,D,oe),E,l.sidebar);else{let e=P[0],t=Tc(e.content),n=t.data&&t.data.title?t.data.title:``,r=(l?.customElements?.scripts||[]).map(e=>typeof e==`string`?e:e?.src).filter(Boolean),i=await Nc(e.content,e.absolutePath||e.displayPath,{approvedScripts:r});se=Gc(H,Bc(re,U,i,ie,n,D,O,oe),E,l.sidebar)}let ce=Jc(qc(v,se)),W={pages:ne};te.length>0&&(W.skills=te),z.length>0&&(W.tools=z),B?.purgeId&&(W.skillsPurgeId=B.purgeId),Object.keys(N).length>0&&(W.preRenderedStaticPages=N),M&&(W.purgeId=M);let le=sc(ce,JSON.stringify(W)),ue=hc(l?.customElements?.scripts||[],(P[0]?.content?Tc(P[0].content):{data:{}}).data,P[0]?.content),G=le;if(ue.length>0){let e=G.match(/<head[^>]*>([\s\S]*?)<\/head>/i),t=e?e[1]:``,n=ue.filter(e=>!t.includes(`src="${e.src}"`)&&!t.includes(`src='${e.src}'`));if(n.length>0){let e=vc(n);G=X(G,` ${e.trim()}`)}}let de=await Yc(Xc(G),a,{isProduction:o,singleFile:s});await L(t,de,`utf8`),(e.silent??C.env.NODE_ENV===`test`)||console.log(`Injected DSD shell into ${t} from ${n} (${U.length} of ${S.length} page${S.length===1?``:`s`} prerendered).`)}async function Qc(){let e=C.argv.slice(2).filter(e=>!e.startsWith(`--`)),t=C.argv.slice(2).filter(e=>e.startsWith(`--`)),n=t.includes(`--no-seed`),r;for(let e of t)e.startsWith(`--prerender-pages=`)?r=e.slice(18):e.startsWith(`--pages=`)&&(r=e.slice(8));let[i=`dist/public/index.html`,a=`pages/main`]=e;await Zc({indexPath:i,sourcePath:a,noSeed:n,prerenderPages:r})}C.argv[1]&&m.resolve(C.argv[1])===m.resolve(S(import.meta.url))&&Qc().catch(e=>{console.error(e),C.exit(1)});function $c(e){let t=c(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 el(e,t){let n=`<script id="shadow-claw-static-routing" type="application/json">${l(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):X(e,` ${n}`)}function tl(e){let t=(e.siteTitle||``).trim(),n=e.pageTitle?d(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+${il(i)}\\s+)${il(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 nl(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=>d(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 rl(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 il(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function al(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 ol(e,t){let n=al(e);return n===-1?`${t}\n${e}`:`${e.slice(0,n)} ${t}\n${e.slice(n)}`}function sl(e,t){let n=e;if(t.title){let e=s(t.title);n=/<title>[^<]*<\/title>/iu.test(n)?n.replace(/<title>[^<]*<\/title>/iu,`<title>${e}</title>`):ol(n,`<title>${e}</title>`)}if(t.description){let e=`<meta name="description" content="${s(t.description)}" />`;n=/<meta\s+name="description"\s+content="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<meta\s+name="description"\s+content="[^"]*"\s*\/?>/iu,e):ol(n,e)}if(t.canonicalUrl){let e=`<link rel="canonical" href="${s(t.canonicalUrl)}" />`;n=/<link\s+rel="canonical"\s+href="[^"]*"\s*\/?>/iu.test(n)?n.replace(/<link\s+rel="canonical"\s+href="[^"]*"\s*\/?>/iu,e):ol(n,e)}if(t.title){let e=`<meta property="og:title" content="${s(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):ol(n,e)}if(t.description){let e=`<meta property="og:description" content="${s(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):ol(n,e)}if(t.canonicalUrl){let e=`<meta property="og:url" content="${s(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):ol(n,e)}if(t.siteTitle){let e=`<meta property="og:site_name" content="${s(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):ol(n,e)}if(t.type){let e=`<meta property="og:type" content="${s(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):ol(n,e)}if(t.title){let e=`<meta name="twitter:title" content="${s(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):ol(n,e)}if(t.description){let e=`<meta name="twitter:description" content="${s(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):ol(n,e)}if(t.image){let e=s(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):ol(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):ol(n,i)}return n}const cl=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`);function ll(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 ul(e,t){let n=t.endsWith(`/`)?t:`${t}/`,r=/* @__PURE__ */ new Set([n]);for(let t of ll(e))r.add(n+t.replace(/^\/+/,``));return`<?xml version="1.0" encoding="UTF-8"?>
103
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
104
+ ${[...r].map(e=>` <url>\n <loc>${cl(e)}</loc>\n </url>`).join(`
105
+ `)}
106
+ </urlset>
107
+ `}const Z=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`);function dl(e){return`<![CDATA[${e.replace(/]]>/g,`]]]]><![CDATA[>`)}]]>`}function fl(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 pl(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 ml(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 hl(e){let t=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/mu,``).match(/^#+\s+(.+)$/m);return t?t[1].trim():``}function gl(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 _l(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=m.basename(e);i&&n.add(i)}return Array.from(n)}function vl(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 yl(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=_l(e,n);if(t.denyList&&t.denyList.length>0&&t.denyList.some(e=>vl(e,s))||t.allowList&&t.allowList.length>0&&!t.allowList.some(e=>vl(e,s)))continue;let c=``;if(t.pagesDir){let n=[m.join(t.pagesDir,e.replace(/^\/pages\/main\//,``).replace(/^\/main\//,``).replace(/^\//,``)),m.join(t.pagesDir,m.basename(e))];for(let e of n)try{c=await j(e,`utf8`);break}catch{}}let l={},u=c;if(c)try{let e=(0,lo.default)(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||hl(c)||m.basename(e,m.extname(e)).replace(/[-_]/g,` `),f=l.date||l.pubDate||l.created||l.updated||a.date||ml(e),p=f?new Date(f):void 0,h=l.updated||l.created||f,g=h?new Date(h):p,_=a.description||l.description||l.excerpt||l.summary||gl(u),v=`${r}${n.replace(/^\/+/,``)}`,y=l.author||a.author||t.author,b=Array.isArray(l.categories)?l.categories:Array.isArray(l.tags)?l.tags:typeof l.section==`string`?[l.section]:[];i.push({title:d,link:v,guid:v,pubDate:p,updated:g,description:_,content:u?u.trim():void 0,author:y,categories:b})}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 bl(e){let t=e.lang||`en-US`,n=fl(e.lastBuildDate),r=e.link.endsWith(`/`)?e.link:`${e.link}/`,i=e.feedUrl||`${r}feed/`,a=e.items.map(t=>{let n=fl(t.pubDate),r=t.guid||t.link,i=t.author||e.author||e.title,a=(t.categories||[]).map(e=>` <category>${dl(e)}</category>`).join(`
108
+ `),o=t.content?` <content:encoded>${dl(t.content)}</content:encoded>\n`:``;return` <item>
109
+ <title>${Z(t.title)}</title>
110
+ <link>${Z(t.link)}</link>
111
+ <pubDate>${n}</pubDate>
112
+ <dc:creator>${dl(i)}</dc:creator>
113
+ <guid isPermaLink="true">${Z(r)}</guid>
114
+ <description>${dl(t.description||``)}</description>
115
+ ${o}${a?a+`
116
+ `:``} </item>`}).join(`
117
+ `);return`<?xml version="1.0" encoding="UTF-8"?>
118
+ <rss version="2.0"
119
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
120
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
121
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
122
+ xmlns:atom="http://www.w3.org/2005/Atom"
123
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
124
+ xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
125
+ >
126
+ <channel>
127
+ <title>${Z(e.title)}</title>
128
+ <atom:link href="${Z(i)}" rel="self" type="application/rss+xml" />
129
+ <link>${Z(e.link)}</link>
130
+ <description>${Z(e.description||``)}</description>
131
+ <lastBuildDate>${n}</lastBuildDate>
132
+ <language>${Z(t)}</language>
133
+ <sy:updatePeriod>hourly</sy:updatePeriod>
134
+ <sy:updateFrequency>1</sy:updateFrequency>
135
+ <generator>ShadowClaw</generator>
136
+ ${a?a+`
137
+ `:``} </channel>
138
+ </rss>
139
+ `}function xl(e){let t=e.lang||`en-US`,n=pl(e.lastBuildDate),r=e.link.endsWith(`/`)?e.link:`${e.link}/`,i=e.feedUrl||`${r}feed/atom/`,a=e.items.map(t=>{let n=pl(t.pubDate),r=pl(t.updated||t.pubDate),i=t.guid||t.link,a=t.author||e.author||e.title,o=t.description?` <summary type="html">${dl(t.description)}</summary>\n`:``,s=t.content?` <content type="html" xml:base="${Z(t.link)}">${dl(t.content)}</content>\n`:``,c=(t.categories||[]).map(e=>` <category term="${Z(e)}" />`).join(`
140
+ `);return` <entry>
141
+ <author><name>${Z(a)}</name></author>
142
+ <title type="html">${dl(t.title)}</title>
143
+ <link rel="alternate" type="text/html" href="${Z(t.link)}" />
144
+ <id>${Z(i)}</id>
145
+ <updated>${r}</updated>
146
+ <published>${n}</published>
147
+ ${o}${s}${c?c+`
148
+ `:``} </entry>`}).join(`
149
+ `);return`<?xml version="1.0" encoding="UTF-8"?>
150
+ <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="${Z(t)}">
151
+ <title type="text">${Z(e.title)}</title>
152
+ <subtitle type="text">${Z(e.description||``)}</subtitle>
153
+ <updated>${n}</updated>
154
+ <link rel="alternate" type="text/html" href="${Z(e.link)}" />
155
+ <id>${Z(i)}</id>
156
+ <link rel="self" type="application/atom+xml" href="${Z(i)}" />
157
+ <generator uri="https://github.com/xt-ml/shadow-claw">ShadowClaw</generator>
158
+ ${a?a+`
159
+ `:``}
160
+ </feed>
161
+ `}function Sl(e){let t=e.lang||`en-US`,n=pl(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="${Z(e.link)}" />`).join(`
162
+ `),o=e.items.map(t=>{let n=pl(t.pubDate),r=t.author||e.author||e.title,i=t.content?` <content:encoded>${dl(t.content)}</content:encoded>\n`:``;return`<item rdf:about="${Z(t.link)}">
163
+ <title>${Z(t.title)}</title>
164
+ <link>${Z(t.link)}</link>
165
+ <dc:date>${n}</dc:date>
166
+ <dc:creator>${Z(r)}</dc:creator>
167
+ <description>${dl(t.description||``)}</description>
168
+ ${i}</item>`}).join(`
169
+
170
+ `);return`<?xml version="1.0" encoding="UTF-8"?>
171
+ <rdf:RDF
172
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
173
+ xmlns="http://purl.org/rss/1.0/"
174
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
175
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
176
+ xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
177
+ xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
178
+ xmlns:admin="http://webns.net/mvcb/"
179
+ >
180
+ <channel rdf:about="${Z(i)}">
181
+ <title>${Z(e.title)}</title>
182
+ <link>${Z(e.link)}</link>
183
+ <description>${Z(e.description||``)}</description>
184
+ <dc:date>${n}</dc:date>
185
+ <dc:language>${Z(t)}</dc:language>
186
+ <syn:updatePeriod>hourly</syn:updatePeriod>
187
+ <syn:updateFrequency>1</syn:updateFrequency>
188
+ <syn:updateBase>1970-01-01T00:00+00:00</syn:updateBase>
189
+ <items>
190
+ <rdf:Seq>
191
+ ${a?a+`
192
+ `:``} </rdf:Seq>
193
+ </items>
194
+ </channel>
195
+
196
+ ${o}
197
+ </rdf:RDF>
198
+ `}function Cl(e,t,n){return`<!DOCTYPE html>
199
+ <html lang="en">
200
+ <head>
201
+ <meta charset="utf-8" />
202
+ <meta http-equiv="refresh" content="0; url=${Z(e)}" />
203
+ <link rel="alternate" type="${Z(n)}" title="${Z(t)}" href="${Z(e)}" />
204
+ <title>${Z(t)}</title>
205
+ </head>
206
+ <body>
207
+ <p><a href="${Z(e)}">Click here to view ${Z(t)}</a></p>
208
+ </body>
209
+ </html>
210
+ `}function wl(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}${Z(s)}`}catch{return e}})}async function Tl(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 yl(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/`},_=bl(m),v=xl(h),y=Sl(g);return{rss2:_,atom:v,rdf:y,files:{"feed/rss.xml":_,"feed/index.xml":_,"feed/index.html":Cl(`rss.xml`,`${a} Feed`,`application/rss+xml`),"feed/atom/atom.xml":v,"feed/atom/index.xml":v,"feed/atom/index.html":Cl(`atom.xml`,`${a} Atom Feed`,`application/atom+xml`),"feed/rdf/index.xml":y,"feed/rdf/index.html":Cl(`index.xml`,`${a} RDF Feed`,`application/rdf+xml`)}}}function El(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 Dl(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 Ol(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?Dl(n,t):!1})),n}function Q(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}const kl=[`pages/resources/`,`pages/deps/`,`resources/`,`deps/`,`pages/assets/`,`pages/main/assets/`];function Al(e){for(let t of kl)if(e.startsWith(t))return e.slice(t.length).replace(/^\/+/,``);return e.replace(/^\/+/,``)}async function jl(e){try{return JSON.parse(await j(e,`utf8`))}catch{return null}}async function Ml(e){try{return await j(e,`utf8`)}catch{return null}}async function Nl(e,t){await L(e,t,`utf8`)}function Pl(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="${Q(e.headerHref)}" class="sidebar-link">${Q(e.title||``)}</a>`:`<span>${Q(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="${Q(e.target)}"`:``,i=e.rel?` rel="${Q(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="${Q(n)}"${r}${i} class="sidebar-link${a}"${o}>${Q(t)}</a></div>`}).join(`
211
+ `);return[` <section class="sidebar-section" id="${n}">`,i,a,` </section>`].filter(Boolean).join(`
212
+ `)}).join(`
213
+ `)}\n</nav>`}function Fl(e){let t=e.trim();if(!t||t===`/`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return n.endsWith(`/`)?n:`${n}/`}function Il(e){if(!e||typeof e!=`string`||!e.trim())return null;let t=e.trim();try{return Fl(new URL(t).pathname||`/`)}catch{return t.startsWith(`/`)?Fl(t):null}}function Ll(e={}){return e.basePath&&e.basePath.trim()?Fl(e.basePath):Il(e.pagesOrigin)||Il(e.siteUrl)||(e.defaultBasePath&&e.defaultBasePath.trim()?Fl(e.defaultBasePath):`/`)}function Rl(e,t){let n=Fl(t);return e.replace(/<base\s+href="[^"]*"\s*\/?>/iu,`<base href="${Q(n)}" />`)}function zl(e,t,n,r){let i=e,a=t.site||{};a.title&&(i=i.replace(/<title>[^<]*<\/title>/iu,`<title>${Q(a.title)}</title>`)),a.description&&(i=i.replace(/<meta\s+name="description"\s+content="[^"]*"\s*\/?>/iu,`<meta name="description" content="${Q(a.description)}" />`)),a.themeColor&&(i=i.replace(/<meta\s+name="theme-color"\s+content="[^"]*"\s*\/?>/iu,`<meta name="theme-color" content="${Q(a.themeColor)}" />`)),a.lang&&(i=i.replace(/<html\s+lang="[^"]*"/iu,`<html lang="${a.lang}"`));let o=t.branding||{},s=r?.isProduction??C.env.NODE_ENV===`production`;if(r?.basePath&&r.basePath.trim())i=Rl(i,r.basePath);else if(s&&(r?.pagesOrigin||o.siteUrl)){let e=Ll({pagesOrigin:r?.pagesOrigin,siteUrl:o.siteUrl});i=Rl(i,e)}if(o.faviconPath){let e=o.faviconPath.replace(/^pages\/main\//,``),t=e.endsWith(`.svg`)?`image/svg+xml`:e.endsWith(`.png`)?`image/png`:`image/x-icon`,n=`<link href="${Q(e)}" rel="icon" type="${t}" />`,r=!1;i=i.replace(/<link\b[^>]*\brel=["']?(?:shortcut\s+)?icon["']?[^>]*\/?>/giu,()=>r?``:(r=!0,n)),r||(i=X(i,` ${n}`))}if(o.appleTouchIconPath){let e=`<link href="${Q(o.appleTouchIconPath.replace(/^pages\/main\//,``))}" rel="apple-touch-icon" />`,t=!1;i=i.replace(/<link\b[^>]*\brel=["']?apple-touch-icon["']?[^>]*\/?>/giu,()=>t?``:(t=!0,e)),t||(i=X(i,` ${e}`))}if(o.titleText||o.siteUrl||o.logoSlotHtml!==void 0){let e=o.siteUrl||``;i=i.replace(/<a\b([^>]*\bslot="header-title-link"[^>]*)>([\s\S]*?)<\/a>/iu,(n,r,i)=>{let a=``;if(o.logoSlotHtml!==void 0){let e=typeof o.logoSlotHtml==`string`?o.logoSlotHtml.trim():``;e!==``&&e.toLowerCase()!==`none`&&(a=o.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 s=i.match(/<(h1|span)\b[^>]*\bclass="[^"]*header-title[^"]*"[^>]*>([\s\S]*?)<\/\1>/iu),c=s?s[1]:/<h1\b/i.test(i)?`h1`:`span`,l=s?s[2].trim():`ShadowClaw`,u=o.titleText||t.site?.title||l;return[`<a`,` aria-label="${Q(u)}"`,` class="header-title-link"`,e?` href="${Q(e)}"`:``,` slot="header-title-link"`,` >`,a?` ${a.trim()}`:``,` <${c} class="header-title">${Q(u)}</${c}>`,` </a>`].filter(Boolean).join(`
214
+ `)})}if(o.repoUrl){let e=o.repoLabel||`Project on GitHub`;i=i.replace(/<a\b[^>]*\bslot="header-actions-logo"[^>]*>[\s\S]*?<\/a>/iu,[`<a`,` aria-label="${Q(e)}"`,` class="header-actions-logo-link"`,` href="${Q(o.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(`
215
+ `))}o.siteUrl&&!o.siteUrl.includes(`xt-ml.github.io`)&&(i=i.replace(/\s*<meta\s+http-equiv="origin-trial"\s+content="[^"]*"\s*\/?>\s*/iu,`
216
+ `));let c=t.theme||{};if(c.stylesheet){let e=Al(c.stylesheet),t=`<link rel="stylesheet" href="${Q(e)}" />`,n=Q(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),a=RegExp(`<link\\s+[^>]*href=["'](?:${r}|${n})["'][^>]*>`,`iu`),o=oc(i),s=(o===-1?i:i.slice(0,o)).replace(/<script\b[\s\S]*?<\/script>/gi,``);a.test(s)||(i=/<link\s+rel="stylesheet"\s+href="index\.css"\s*\/?>/iu.test(i)?i.replace(/(<link\s+rel="stylesheet"\s+href="index\.css"\s*\/?>)/iu,`$1\n ${t}`):X(i,` ${t}`))}let{allowedDomains:l}=El(t,c),u=Ol(t,l),d=`<script id="shadow-claw-site-config" type="application/json">${JSON.stringify(u).replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/\//g,`\\u002f`)}<\/script>`;i=i.includes(`<script id="shadow-claw-site-config"`)?i.replace(/<script\s+id="shadow-claw-site-config"[\s\S]*?<\/script>/iu,()=>d):i.includes(`<script src="theme-init.js">`)?i.replace(`<script src="theme-init.js">`,`${d}\n <script src="theme-init.js">`):/<script\b[^>]*>\s*var\s+ShadowClawThemeInit\b/iu.test(i)?i.replace(/(<script\b[^>]*>\s*var\s+ShadowClawThemeInit\b)/iu,`${d}\n $1`):X(i,` ${d}`),i=i.replace(/\s*<meta\s+name="shadow-claw-override-prerender-skeleton"[^>]*>/giu,``),typeof t.settings?.overridePrerenderSkeleton==`boolean`&&(i=i.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 f=n||t.sidebar?.slotHtml||(t.sidebar?.sections?Pl(t.sidebar.sections):``);if(f){let e=f.trim();/\bslot="sidebar(?:-nav|-content|-footer)?"/iu.test(e)||(e=`<div slot="sidebar" class="sidebar-custom-sections">\n${e}\n</div>`);let t=i.match(/<[^>]+?\bslot="sidebar(?:-nav|-content|-footer)?"[^>]*>[\s\S]*?<\/[^>]+>/iu);t&&(i=i.replace(t[0],``)),i.includes(`</shadow-claw>`)?i=i.replace(`</shadow-claw>`,` ${e}\n</shadow-claw>`):i.includes(`<shadow-claw></shadow-claw>`)&&(i=i.replace(`<shadow-claw></shadow-claw>`,`<shadow-claw>\n ${e}\n</shadow-claw>`))}if(t.sidebar&&(i=Wc(i,t.sidebar)),t.feed===!0||typeof t.feed==`object`&&t.feed?.enabled===!0){let e=o.titleText||a.title||`ShadowClaw`,t=o.siteUrl?o.siteUrl.endsWith(`/`)?o.siteUrl:`${o.siteUrl}/`:``,n=`<link rel="alternate" type="application/rss+xml" title="${Q(e)} &raquo; Feed" href="${Q(t)}feed/" />`,r=`<link rel="alternate" type="application/atom+xml" title="${Q(e)} &raquo; Atom Feed" href="${Q(t)}feed/atom/" />`,s=`<link rel="alternate" type="application/rdf+xml" title="${Q(e)} &raquo; RDF Feed" href="${Q(t)}feed/rdf/" />`;i.includes(`type="application/rss+xml"`)||(i=X(i,` ${n}`)),i.includes(`type="application/atom+xml"`)||(i=X(i,` ${r}`)),i.includes(`type="application/rdf+xml"`)||(i=X(i,` ${s}`))}return i}function Bl(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 Vl(e,t){let n=typeof e==`string`?JSON.parse(e):e,r=t.pwa||{},i=t.site||{},a=C.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(Bl),t=Array.isArray(n.icons)?n.icons.flatMap(Bl):[],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(Bl));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 Hl(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>${Q(r.origin+i+e.pathname+e.search)}</loc>`}catch{return`<loc>${Q(n)}</loc>`}}):e.split(`
217
+ `).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(`
218
+ `)}function Ul(e,t,n){let r=e,i=t.site||{};if(i.title&&(r=r.replace(/<title>[^<]*<\/title>/iu,`<title>${Q(i.title)} - Not Found</title>`)),n){let e=n.endsWith(`/`)?n:n+`/`;r=r.replace(/l\.replace\(["']\/shadow-claw\/["']\)/gu,`l.replace("${Q(e)}")`)}return r}function Wl(e){let t=m.resolve(e),n=t.split(m.sep),r=n[n.length-1],i=n[n.length-2];return(r===`resources`||r===`deps`)&&i===`pages`?m.resolve(t,`../..`):r===`resources`||r===`deps`||r===`pages`?m.resolve(t,`..`):t}function Gl(e){let t=m.resolve(e),n=m.basename(t);return n===`resources`||n===`deps`||n===`pages`?m.resolve(t,`..`):t}function Kl(e,t,n){if(!e||typeof e!=`string`)return[];if(m.isAbsolute(e))return[e];let r=e.replace(/^\/+/,``).replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),i=Wl(t);return[m.resolve(t,`resources`,r),m.resolve(t,`deps`,r),m.resolve(t,`main`,r),m.resolve(i,`pages`,`resources`,r),m.resolve(i,`pages`,`resources`,e),m.resolve(i,`pages`,`deps`,r),m.resolve(i,`pages`,`deps`,e),m.resolve(i,`resources`,r),m.resolve(i,`resources`,e),m.resolve(i,`deps`,r),m.resolve(i,`deps`,e),m.resolve(n,`pages`,`resources`,r),m.resolve(n,`pages`,`deps`,r),m.resolve(n,`resources`,r),m.resolve(n,`deps`,r),m.resolve(n,`pages`,e),m.resolve(n,`pages`,r),m.resolve(n,`pages`,`main`,r),m.resolve(i,`pages`,e),m.resolve(i,`pages`,r),m.resolve(i,`pages`,`main`,r),m.resolve(i,`pages`,`main`,e),m.resolve(t,e),m.resolve(t,r),m.resolve(n,e),m.resolve(n,r),m.resolve(i,e),m.resolve(i,r)]}async function ql(e,t,n){if(!n)return null;let r=await Jl([...Qa(e),...Qa(t),...Qa(Wl(e))]);if(!r)return null;let i=await jl(r);return i?ul(i,n):null}async function Jl(e){for(let t of e)if(t)try{return await I(t),t}catch{}return null}async function Yl(e,t,n){let r=n?m.dirname(m.resolve(n)):C.cwd(),i=Gl(r),a=Wl(r),o=[m.resolve(r,`resources`),m.resolve(r,`deps`),m.resolve(i,`resources`),m.resolve(i,`deps`),m.resolve(i,`pages`,`resources`),m.resolve(i,`pages`,`deps`),m.resolve(a,`resources`),m.resolve(a,`deps`),m.resolve(a,`pages`,`resources`),m.resolve(a,`pages`,`deps`)];for(let e of o)try{let n=await M(e,{withFileTypes:!0});for(let r of n){let n=m.join(e,r.name),i=m.join(t,r.name);r.isDirectory()?await k(n,i,{recursive:!0,force:!0}):r.isFile()&&(await A(m.dirname(i),{recursive:!0}),await O(n,i))}}catch{}let s=await Jl([...e.pages?.notFoundPath?Kl(e.pages.notFoundPath,r,i):[],...e.branding?.notFoundPath?Kl(e.branding.notFoundPath,r,i):[],...e.notFoundPath?Kl(e.notFoundPath,r,i):[],...Kl(`404.html`,r,i)]);if(s)try{await O(s,m.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 Jl([...e.pwa?.manifestPath?Kl(e.pwa.manifestPath,r,i):[],...e.manifestPath?Kl(e.manifestPath,r,i):[],...Kl(`manifest.json`,r,i)]);if(c)try{await O(c,m.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 Jl(Kl(e.feedPath,r,i));if(n)try{let e=m.basename(n);await O(n,m.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 Jl(Kl(e.sitemapPath,r,i));if(n)try{let e=m.basename(n);await O(n,m.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 Jl(Kl(`sitemap.xml`,r,i));if(e)try{await O(e,m.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 Jl(Kl(`sitemap.txt`,r,i));if(n)try{await O(n,m.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=>Kl(e,r,i)),...Kl(`assets`,r,i)].filter(e=>e&&typeof e==`string`))),p=m.join(t,`assets`);if(u)try{await F(p,{recursive:!0,force:!0}),await A(p,{recursive:!0}),console.log(` Cleared dist public assets for complete template asset overwrite.`)}catch{}let h=/* @__PURE__ */ new Set,g=[...f].reverse();for(let e of g)if(!h.has(e))try{let t=await I(e);if(h.add(e),t.isDirectory())await k(e,p,{recursive:!0,force:!0}),console.log(` Copied custom assets: ${e} → ${p}`);else if(t.isFile()){let t=m.basename(e);await A(p,{recursive:!0}),await O(e,m.join(p,t)),console.log(` Copied custom asset file: ${e} → ${p}`)}}catch{}}async function Xl(e,t,n){let r=e.theme||{};if(!r.stylesheet)return;let i=n?m.dirname(m.resolve(n)):C.cwd(),a=Gl(i),o=await Jl(Kl(r.stylesheet,i,a));if(!o)return;let s=r.stylesheet.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),c=m.join(t,s);try{await A(m.dirname(c),{recursive:!0}),await O(o,c),console.log(` Copied theme stylesheet: ${o} → ${c}`)}catch(e){console.warn(` Warning: Could not copy theme stylesheet ${o}: ${e.message}`)}}async function Zl(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?m.dirname(m.resolve(n)):C.cwd(),a=Gl(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 Jl(Kl(n,i,a));if(r){let e=n.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),i=m.join(t,e);try{await A(m.dirname(i),{recursive:!0}),await O(r,i),console.log(` Copied custom script: ${r} → ${i}`)}catch(e){console.warn(` Warning: Could not copy custom script ${r}: ${e.message}`)}}}}async function Ql(e,t,n){let r=e.branding||{},i=e.pwa||{},a=n?m.dirname(m.resolve(n)):C.cwd(),o=Gl(a),s=[],c=await Jl(Kl(i.manifestPath||e.manifestPath||`manifest.json`,a,o));if(c){let e=await jl(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 Jl(Kl(e,a,o));if(n){let r=e.replace(/^(pages\/)?(resources\/|deps\/|main\/)?/,``),i=m.join(t,r);if(d.has(i))continue;d.add(i);try{await A(m.dirname(i),{recursive:!0}),await O(n,i),console.log(` Copied branding asset: ${n} → ${i}`)}catch(e){console.warn(` Warning: Could not copy branding asset ${n}: ${e.message}`)}}}}async function $l(e,t,n){let r=await jl(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||C.env.PAGES_ORIGIN||``,a=n?.basePath||C.env.PAGES_BASE_PATH||``,o=n?.isProduction??C.env.NODE_ENV===`production`;await Yl(r,e,t);let s=t?m.dirname(m.resolve(t)):C.cwd(),c=Gl(s),l;if(r.sidebar?.slotHtml)l=r.sidebar.slotHtml;else if(r.sidebar?.sections)l=Pl(r.sidebar.sections);else{let e=await Jl([r.sidebar?.slotPath,`pages/main/sidebar.html`,`pages/sidebar.html`,`sidebar.html`,`resources/sidebar.html`].filter(Boolean).flatMap(e=>Kl(e,s,c)));e&&(l=await Ml(e)??void 0,console.log(` Found slotted sidebar: ${e}`))}let u=m.join(e,`index.html`),d=await Ml(u);d&&(await Nl(u,zl(d,r,l,{basePath:a,pagesOrigin:i,isProduction:o})),console.log(` Patched index.html`));let f=m.join(e,`share/share-target.html`),p=await Ml(f);if(p){let e=`/`;a&&a.trim()?e=a:o&&(i||r.branding?.siteUrl)&&(e=Ll({pagesOrigin:i,siteUrl:r.branding?.siteUrl})),await Nl(f,Rl(p,e)),console.log(` Patched share/share-target.html`)}let h=m.join(e,`manifest.json`),g=await Ml(h);g&&(await Nl(h,Vl(g,r)),console.log(` Patched manifest.json`));let _=m.join(e,`sitemap.xml`),v=!!await Ml(m.join(e,`sitemap.txt`)),y=!1;if(!await Ml(_)&&!v){let e=await ql(s,c,i||r.branding?.siteUrl||``);e&&(await Nl(_,e),y=!0,console.log(` Generated sitemap.xml from routes.json`))}let b=y?``:await Ml(_);b&&(await Nl(_,Hl(b,i)),console.log(` Patched sitemap.xml`));let x=m.join(e,`sitemap.txt`),S=await Ml(x);if(S&&(await Nl(x,Hl(S,i)),console.log(` Patched sitemap.txt`)),r.feed===!0||typeof r.feed==`object`&&r.feed?.enabled===!0){let t=await Jl([...Qa(s),...Qa(c),...Qa(Wl(s))]);if(t){let n=await jl(t);if(n){let t=await Jl([m.join(e,`pages/main`),m.join(e,`files/main`),m.join(e,`static-main`),m.join(s,`pages/main`),m.join(s,`main`),m.join(c,`pages/main`),m.resolve(`pages/main`)]),a=await Tl({routesJson:n,siteConfig:r,origin:i||r.branding?.siteUrl||``,pagesDir:t||void 0});for(let[t,n]of Object.entries(a.files)){let r=m.join(e,t);await A(m.dirname(r),{recursive:!0}),await Nl(r,t.endsWith(`.xml`)?wl(n,i):n)}console.log(` Generated RSS 2.0, Atom, and RDF feeds`)}}}let w=m.join(e,`404.html`),T=await Ml(w);return T&&(await Nl(w,Ul(T,r,a)),console.log(` Patched 404.html`)),await Xl(r,e,t),await Zl(r,e,t),await Ql(r,e,t),console.log(`Site configuration applied successfully.`),{applied:!0}}async function eu(){let[e,t]=C.argv.slice(2);(!e||!t)&&(console.error(`Usage: node bin/site-config/apply.mjs <distPublicDir> <siteConfigPath>`),C.exit(1)),await $l(e,t)}C.argv[1]&&m.resolve(C.argv[1])===m.resolve(S(import.meta.url))&&eu().catch(e=>{console.error(`site-config/apply.ts failed:`,e),C.exit(1)});function tu(e){let t=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/mu,``).match(/^#+\s+(.+)$/m);return t?t[1].trim():``}async function nu(e={}){let t=m.resolve(e.publicDir||`dist/public`),n=m.resolve(e.routesPath||`pages/routes.json`),r=m.resolve(e.sourcePath||`pages/main`),i=m.resolve(e.indexPath||m.join(t,`index.html`)),a=e.siteConfig||{},s=!!e.siteConfig;if(!e.siteConfig){let n=[e.siteConfigPath,m.resolve(m.dirname(r),`shadow-claw.config.json`),m.resolve(m.dirname(r),`site-config.json`),m.resolve(`shadow-claw.config.json`),m.resolve(`site-config.json`),m.join(t,`shadow-claw.config.json`),m.join(t,`site-config.json`)].filter(Boolean);for(let i of n)try{let n=await j(i,`utf8`);a=JSON.parse(n),(e.siteConfigPath||i.startsWith(m.dirname(r))||i.startsWith(t)||t.startsWith(C.cwd()))&&(s=!0);break}catch{}}let l=ac(e.prerenderPages===void 0?C.env.PRERENDER_PAGES??1:e.prerenderPages),u;try{u=await j(n,`utf8`)}catch(e){if(e?.code===`ENOENT`)return{count:0,skipped:!0,reason:`No routes.json found`};throw e}let d;try{d=JSON.parse(u)}catch(e){return console.warn(`Failed to parse ${n}:`,e),{count:0,skipped:!0,reason:`Invalid JSON in routes.json`}}if(!d||typeof d!=`object`)return{count:0,skipped:!0,reason:`Invalid routes.json`};d.routes||(d.routes={});let f={...d.routes||{}},p=/* @__PURE__ */ new Set;async function h(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=m.resolve(m.dirname(t),e);if(typeof e==`string`&&e.startsWith(`pages/`)&&(n=m.resolve(e)),!p.has(n)){p.add(n);try{let e=await j(n,`utf8`),t=JSON.parse(e);t.routes&&Object.assign(f,t.routes),await h(t,n)}catch(e){console.warn(`Failed to read subRoute: ${n}`,e?.message)}}}}await h(d,n),Object.assign(d.routes,f),Array.isArray(d.subRoutes)&&delete d.subRoutes;let g={allowList:a?.pages?.allowList??a?.pages?.allowlist??a?.allowList??a?.allowlist,denyList:a?.pages?.denyList??a?.pages?.denylist??a?.denyList??a?.denylist};for(let[e,t]of Object.entries(f)){let n=$c(e);(!o(n,{...g,basePathPrefix:r})||!o(e,g)||t?.prettyPath&&!o(t.prettyPath,g))&&(delete f[e],delete d.routes[e])}let _=Object.entries(f);if(_.length===0)return{count:0,skipped:!0,reason:`Empty routes table`};let v=JSON.stringify(d,null,2),y=m.join(t,`static-routing.json`);await A(t,{recursive:!0}),await L(y,v,`utf8`);let b=JSON.stringify(d),x=m.join(t,`components/shadow-claw/shadow-claw.html`),S=m.join(t,`components/shadow-claw-pages/shadow-claw-pages.html`),w=m.join(t,`components/shadow-claw-page-header/shadow-claw-page-header.html`),T=m.join(t,`components/shadow-claw/shadow-claw.css`),E=m.join(t,`components/shadow-claw-pages/shadow-claw-pages.css`),D=m.join(t,`components/shadow-claw-page-header/shadow-claw-page-header.css`),[O,ee,N,P,F,R,te,z]=await Promise.all([j(i,`utf8`),j(x,`utf8`),j(S,`utf8`).catch(()=>``),j(w,`utf8`).catch(()=>``),Ac(r,`desc`,{allowList:a?.pages?.allowList??a?.pages?.allowlist??a?.allowList??a?.allowlist,denyList:a?.pages?.denyList??a?.pages?.denylist??a?.denyList??a?.denylist}),j(T,`utf8`).catch(()=>``),j(E,`utf8`).catch(()=>``),j(D,`utf8`).catch(()=>``)]),B=e.isProduction??C.env.NODE_ENV===`production`,V=e.singleFile??!1,H=e.basePath===void 0?C.env.PAGES_BASE_PATH||``:e.basePath,U=e.pagesOrigin||C.env.PAGES_ORIGIN||``,ne=s&&(B||e.basePath===void 0)?a?.branding?.siteUrl:void 0,re=O.match(/<base\s+href="([^"]*)"/i),ie=re?re[1]:`/`,ae=H||U||ne?Ll({basePath:H,pagesOrigin:U,siteUrl:ne,defaultBasePath:ie}):ie,oe=re?Rl(O,H===``?ae===`/`?ie:ae:H):O,se=(await Promise.all(F.map(async e=>{let t=typeof e.inlineContent==`string`?e.inlineContent:await j(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||``))),ce=await Yc(Xc(el(oe,b)),t,{isProduction:B,singleFile:V});await L(i,ce,`utf8`);let W=Ec(ee),le=Ec(N),ue=Ec(P),G=se.map(e=>({displayPath:e.displayPath,content:e.content})),de=m.join(t,`static-main-manifest.json`),K={};try{K=JSON.parse(await j(de,`utf8`))}catch{}let fe={pages:G,...Array.isArray(K.skills)?{skills:K.skills}:{},...Array.isArray(K.tools)?{tools:K.tools}:{},...K.skillsPurgeId?{skillsPurgeId:K.skillsPurgeId}:{},...K.preRenderedStaticPages?{preRenderedStaticPages:K.preRenderedStaticPages}:{},...K.purgeId?{purgeId:K.purgeId}:{}};await L(de,JSON.stringify(fe,null,2),`utf8`);try{if((await I(r)).isDirectory()){let e=m.join(t,`static-main`);await A(e,{recursive:!0}),await k(r,e,{recursive:!0});let n=m.join(t,`files/main`);await A(n,{recursive:!0}),await k(r,n,{recursive:!0})}}catch{}let pe=[],me=0;for(let[e,n]of _){if(!n||!n.prettyPath)continue;let i=c(n.prettyPath);if(i===`feed`||i.startsWith(`feed/`)||e.endsWith(`.xml`))continue;let o=$c(e),s=se.find(e=>e.displayPath===o);if(!s)try{let e=m.join(r,o);s={absolutePath:e,displayPath:o,content:await j(e,`utf8`)}}catch{console.warn(`Could not find page file for route: ${e} (${o})`);continue}let u=se.filter(e=>e.displayPath!==s.displayPath),d=[],f=[];l===`all`?(d=[s,...u],f=d.map(e=>({displayPath:e.displayPath,content:e.content}))):typeof l==`number`&&(l===0?(d=[],f=[]):(d=[s,...u.slice(0,l-1)],f=d.map(e=>({displayPath:e.displayPath,content:e.content}))));let p=Tc(s.content||``),h=p.data&&p.data.title?p.data.title:``,g=(a?.customElements?.scripts||[]).map(e=>typeof e==`string`?e:e?.src).filter(Boolean),_=await Nc(s.content||``,s.displayPath,{approvedScripts:g}),v=a?.theme?.stylesheet,y=``;if(typeof v==`string`&&v.trim()){let e=bc(v.trim());y=e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)?e:e.replace(/^\/+/,``)}let x;x=l===0?Kc(W,R,a.sidebar):Gc(W,Bc(le,d,_,ue,h,te,z,y),R,a.sidebar);let S=sc(Jc(qc(oe,x)),JSON.stringify({pages:f,...Array.isArray(K.skills)?{skills:K.skills}:{},...Array.isArray(K.tools)?{tools:K.tools}:{},...K.skillsPurgeId?{skillsPurgeId:K.skillsPurgeId}:{},...K.preRenderedStaticPages?{preRenderedStaticPages:K.preRenderedStaticPages}:{},...K.purgeId?{purgeId:K.purgeId}:{}})),C=c(n.prettyPath),w=C===``||C===`index.html`||n.prettyPath===`/`,T=oe.match(/<base\s+href="([^"]*)"/i),E=T?T[1]:void 0,D=a?.branding?.siteUrl||void 0,O=sl(S,{title:tl({pageTitle:n.title||p.data?.seo_title||p.data?.seoTitle||p.data?.title||tu(s.content||``),siteTitle:a?.site?.title||`ShadowClaw`,siteDescription:a?.site?.description,separator:a?.site?.titleSeparator??a?.site?.sep,titleTemplate:a?.site?.titleTemplate,isHome:w}),description:n.description||p.data?.seo_description||p.data?.seoDescription||p.data?.description||p.data?.excerpt||p.data?.summary||nl(s.content||``,{fallback:a?.site?.description})||a?.site?.description,canonicalUrl:rl({origin:D,basePath:E,prettyPath:n.prettyPath}),siteTitle:a?.site?.title||`ShadowClaw`,type:w?`website`:`article`}),ee=hc(a?.customElements?.scripts||[],p.data,s.content),N=O;if(ee.length>0){let e=N.match(/<head[^>]*>([\s\S]*?)<\/head>/i),t=e?e[1]:``,n=ee.filter(e=>!t.includes(`src="${e.src}"`)&&!t.includes(`src='${e.src}'`));if(n.length>0){let e=vc(n);N=X(N,` ${e.trim()}`)}}let P=await Yc(Xc(el(N,b)),t,{isProduction:B,singleFile:V}),F;F=C.endsWith(`.html`)?C:m.join(C,`index.html`);let I=m.join(t,F),H=m.dirname(I);if(await A(H,{recursive:!0}),await L(I,P,`utf8`),s&&s.absolutePath)try{let e=m.dirname(s.absolutePath),t=await M(e,{withFileTypes:!0});for(let n of t)n.isFile()&&!Oc(n.name)&&n.name!==`routes.json`&&await k(m.join(e,n.name),m.join(H,n.name))}catch(t){console.warn(`Failed to copy co-located assets for ${e}:`,t)}if(pe.push(F.replace(/\\/g,`/`)),!C.endsWith(`.html`)&&C.length>0){let e=`${C}.html`,n=m.join(t,e);await A(m.dirname(n),{recursive:!0}),await L(n,P,`utf8`),pe.push(e.replace(/\\/g,`/`))}me++}return(e.silent??C.env.NODE_ENV===`test`)||console.log(`Prerendered ${me} pretty path page${me===1?``:`s`} from ${n} (prerender-pages: ${l}).`),{count:me,generatedPaths:pe,skipped:!1}}async function ru(){let e=C.argv.slice(2).filter(e=>!e.startsWith(`--`)),t=C.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 nu({publicDir:r,routesPath:e[1]||`pages/routes.json`,sourcePath:e[2]||`pages/main`,indexPath:e[3]||m.join(r,`index.html`),prerenderPages:n})}C.argv[1]&&m.resolve(C.argv[1])===m.resolve(S(import.meta.url))&&ru().catch(e=>{console.error(e),C.exit(1)});function iu(){return[`const shadowClawServiceWorkerTrustedTypesFactory = Reflect.get(self, "trustedTypes");`,`let shadowClawServiceWorkerTrustedTypesPolicy = null;`,`if (shadowClawServiceWorkerTrustedTypesFactory && typeof shadowClawServiceWorkerTrustedTypesFactory.createPolicy === "function") {`,` try {`,` if (typeof shadowClawServiceWorkerTrustedTypesFactory.getPolicy === "function") {`,` shadowClawServiceWorkerTrustedTypesPolicy =`,` shadowClawServiceWorkerTrustedTypesFactory.getPolicy("default") ||`,` shadowClawServiceWorkerTrustedTypesFactory.getPolicy("shadowclaw-sandbox") ||`,` null;`,` }`,``,` if (!shadowClawServiceWorkerTrustedTypesPolicy) {`,` shadowClawServiceWorkerTrustedTypesPolicy =`,` shadowClawServiceWorkerTrustedTypesFactory.createPolicy("default", {`,` createHTML: (input) => input,`,` createScriptURL: (input) => input,`,` });`,` }`,` } catch {`,` // Ignore policy creation failures and fall back to raw importScripts.`,` }`,`}`,``,`const shadowClawNativeImportScripts = typeof importScripts === "function" ? importScripts.bind(self) : null;`,``,`const shadowClawImportScripts = (...urls) => {`,` if (!shadowClawNativeImportScripts) {`,` return;`,` }`,``,` if (!shadowClawServiceWorkerTrustedTypesPolicy || typeof shadowClawServiceWorkerTrustedTypesPolicy.createScriptURL !== "function") {`,` shadowClawNativeImportScripts(...urls);`,``,` return;`,` }`,``,` shadowClawNativeImportScripts(...urls.map((url) => shadowClawServiceWorkerTrustedTypesPolicy.createScriptURL(url)));`,`};`].join(`
219
+ `)}function au(e){return e.includes(`shadowClawImportScripts`)||!e.includes(`if(!self.define){`)||!e.includes(`importScripts(`)?e:`${iu()}\n${e.replace(/importScripts\(/g,`shadowClawImportScripts(`)}`}const ou=b(C.cwd(),`dist/public/service-worker.js`);async function su(e=ou,{readFileImpl:t=j,writeFileImpl:n=L,patchImpl:r=au,logImpl:i=console.log}={}){let a=await t(e,`utf8`),o=r(a);o!==a&&(await n(e,o,`utf8`),i(`Patched Trusted Types imports in ${e}`))}async function cu(){await su(C.argv[2]||ou)}C.argv[1]&&m.resolve(C.argv[1])===m.resolve(S(import.meta.url))&&cu().catch(e=>{console.error(e),C.exit(1)});function lu(e,t){return`// build: ${t}
220
+ const CDN_BASE = ${JSON.stringify(e.replace(/\/+$/,``)+`/`)};
221
+ const CACHE_NAME = "shadow-claw-single-file";
222
+
223
+ self.addEventListener("message", (event) => {
224
+ if (event.data && event.data.type === "SKIP_WAITING") {
225
+ self.skipWaiting();
226
+ }
227
+ });
228
+
229
+ self.addEventListener("activate", (event) => {
230
+ event.waitUntil(self.clients.claim());
231
+ });
232
+
233
+ async function networkFirst(request) {
234
+ const cache = await caches.open(CACHE_NAME);
235
+ try {
236
+ const response = await fetch(request);
237
+ if (response.ok) {
238
+ await cache.put(request, response.clone());
239
+ }
240
+ return response;
241
+ } catch (err) {
242
+ const cached = await cache.match(request);
243
+ if (cached) {
244
+ return cached;
245
+ }
246
+ throw err;
247
+ }
248
+ }
249
+
250
+ async function staleWhileRevalidate(request) {
251
+ const cache = await caches.open(CACHE_NAME);
252
+ const cached = await cache.match(request);
253
+ const network = fetch(request)
254
+ .then(async (response) => {
255
+ if (response.ok) {
256
+ await cache.put(request, response.clone());
257
+ }
258
+ return response;
259
+ })
260
+ .catch(() => cached);
261
+ return cached || network;
262
+ }
263
+
264
+ self.addEventListener("fetch", (event) => {
265
+ const request = event.request;
266
+ if (request.method !== "GET") {
267
+ return;
268
+ }
269
+
270
+ if (request.mode === "navigate") {
271
+ event.respondWith(networkFirst(request));
272
+ } else if (request.url.startsWith(CDN_BASE)) {
273
+ event.respondWith(staleWhileRevalidate(request));
274
+ }
275
+ });
276
+ `}function uu(e){return` <script data-shadow-claw-sw="true">
277
+ (() => {
278
+ if (!("serviceWorker" in navigator)) return;
279
+ const CHECK_INTERVAL_MS = ${Number(e.checkIntervalMs)};
280
+ const CHECK_ON_FOCUS = ${!!e.checkOnFocus};
281
+ const CHECK_MIN_GAP_MS = ${Number(e.checkMinGapMs)};
282
+ const REPROMPT_INTERVAL_MS = ${Number(e.repromptIntervalMs)};
283
+ const hadController = Boolean(navigator.serviceWorker.controller);
284
+ let registration = null;
285
+ let updateRequested = false;
286
+ let prompting = false;
287
+ let nextPromptAt = 0;
288
+ let lastCheckAt = 0;
289
+
290
+ async function requestDialog(options) {
291
+ const startedAt = Date.now();
292
+ while (Date.now() - startedAt < 5000) {
293
+ const el = document.querySelector("shadow-claw");
294
+ if (el && typeof el.requestDialog === "function") {
295
+ return el.requestDialog(options);
296
+ }
297
+ await new Promise((resolve) => setTimeout(resolve, 50));
298
+ }
299
+ return null;
300
+ }
301
+
302
+ async function promptUpdate() {
303
+ const waiting = registration && registration.waiting;
304
+ if (!waiting || prompting || Date.now() < nextPromptAt) return;
305
+ prompting = true;
306
+ try {
307
+ const accepted = await requestDialog({
308
+ title: "Update Available",
309
+ message: "A new version of ShadowClaw is ready. Reload now to apply the update?",
310
+ confirmLabel: "Reload now",
311
+ cancelLabel: "Later",
312
+ });
313
+ if (accepted === null) return;
314
+ if (accepted) {
315
+ updateRequested = true;
316
+ waiting.postMessage({ type: "SKIP_WAITING" });
317
+ } else {
318
+ nextPromptAt = Date.now() + REPROMPT_INTERVAL_MS;
319
+ }
320
+ } finally {
321
+ prompting = false;
322
+ }
323
+ }
324
+
325
+ async function checkForUpdate(fromFocus) {
326
+ if (!registration) return;
327
+ if (fromFocus && Date.now() - lastCheckAt < CHECK_MIN_GAP_MS) return;
328
+ lastCheckAt = Date.now();
329
+ try {
330
+ await registration.update();
331
+ } catch {}
332
+ await promptUpdate();
333
+ }
334
+
335
+ navigator.serviceWorker.addEventListener("controllerchange", async () => {
336
+ if (updateRequested) {
337
+ location.reload();
338
+ return;
339
+ }
340
+ if (!hadController) return;
341
+ const accepted = await requestDialog({
342
+ title: "Update Installed",
343
+ message: "A new version of ShadowClaw was installed. Reload now?",
344
+ confirmLabel: "Reload now",
345
+ cancelLabel: "Later",
346
+ });
347
+ if (accepted) location.reload();
348
+ });
349
+
350
+ window.addEventListener("load", async () => {
351
+ try {
352
+ let swUrl = "service-worker.js";
353
+ try {
354
+ if (window.trustedTypes && typeof window.trustedTypes.getPolicy === "function") {
355
+ const defaultPolicy =
356
+ window.trustedTypes.getPolicy("default") ||
357
+ window.trustedTypes.getPolicy("shadowclaw-sandbox");
358
+ if (defaultPolicy && typeof defaultPolicy.createScriptURL === "function") {
359
+ swUrl = defaultPolicy.createScriptURL(swUrl);
360
+ }
361
+ }
362
+ } catch {}
363
+ registration = await navigator.serviceWorker.register(swUrl, {
364
+ updateViaCache: "none",
365
+ });
366
+ } catch {
367
+ return;
368
+ }
369
+ registration.addEventListener("updatefound", () => {
370
+ const installing = registration.installing;
371
+ if (!installing) return;
372
+ installing.addEventListener("statechange", () => {
373
+ if (installing.state === "installed" && navigator.serviceWorker.controller) {
374
+ promptUpdate();
375
+ }
376
+ });
377
+ });
378
+ promptUpdate();
379
+ if (CHECK_INTERVAL_MS > 0) {
380
+ setInterval(() => checkForUpdate(false), CHECK_INTERVAL_MS);
381
+ }
382
+ if (CHECK_ON_FOCUS) {
383
+ window.addEventListener("focus", () => checkForUpdate(true));
384
+ document.addEventListener("visibilitychange", () => {
385
+ if (document.visibilityState === "visible") checkForUpdate(true);
386
+ });
387
+ }
388
+ });
389
+ })();
390
+ <\/script>`}async function du(e,{writeFileImpl:t=L}={}){let r=e||_(n(import.meta.url),`dist`,`public`);await t(_(r,`.nojekyll`),``,`utf-8`)}C.argv[1]&&m.resolve(C.argv[1])===m.resolve(S(import.meta.url))&&await du();const fu=n(import.meta.url);async function $(e){try{return await I(e),!0}catch{return!1}}async function pu(e,t){let n=[t?_(t,`package.json`):``,_(fu,`package.json`),_(e,`package.json`)].filter(Boolean);for(let e of n)if(await $(e))try{let t=JSON.parse(await j(e,`utf8`));if(t.name===`shadow-claw`&&t.version)return t.version}catch{}let r=_(e,`package.json`);if(await $(r))try{let e=JSON.parse(await j(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 mu(e){let{indexPath:t,mainSourcePath:n,contentRoot:r,toolchainRoot:o,cdnBase:s,serviceWorker:c,isQuiet:l,log:u}=e;if(l||u(`Embedding pages, theme, and CDN runtime for single-file distribution...`),await $(t)){let l=await j(t,`utf8`),u=await Xa([_(n,`theme.css`),_(r,`pages/main/theme.css`),_(r,`pages/theme.css`),_(r,`theme.css`)]);if(u)try{let e=await j(u,`utf8`);if(e.trim()&&!l.includes(`id="shadow-claw-theme"`)){let t=`<style id="shadow-claw-theme">\n${e.trim()}\n</style>`;l=X(l,` ${t}`)}}catch{}try{let e=await Ac(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 j(n.absolutePath,`utf8`)),typeof e==`string`){let r=/^memory\.(md|markdown)$/iu.test(n.displayPath)&&e.trim()===a.trim(),o=n.displayPath===`index.html`&&e.trim()===i.trim();r||o?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&&(l=X(l,` ${t.join(`
391
+ `)}`))}catch{}let d=s||T.SHADOWCLAW_CDN;d||=`https://cdn.jsdelivr.net/npm/shadow-claw@${await pu(r,o)}`,d=d.replace(/\/+$/,``),c&&/@(?:latest|next|canary|dev)\b/.test(d)&&console.warn(`Warning: Using --service-worker with an unpinned CDN URL may cause stale runtime assets to be cached.`);let f=`${d}/dist/public/`;l=l.includes(`name="shadow-claw-asset-base"`)?l.replace(/<meta\s+name="shadow-claw-asset-base"[^>]*>/i,`<meta name="shadow-claw-asset-base" content="${f}" />`):/<base\s+href="[^"]*"\s*\/?>/i.test(l)?l.replace(/(<base\s+href="[^"]*"\s*\/?>)/i,`$1\n <meta name="shadow-claw-asset-base" content="${f}" />`):X(l,` <meta name="shadow-claw-asset-base" content="${f}" />`),l=l.replace(/<script\b[^>]*>\s*var\s+ShadowClawThemeInit\b[\s\S]*?<\/script>/giu,`<script src="${f}theme-init.js"><\/script>`),l=l.replace(/<script\s+src="[^"]*?theme-init\.js"><\/script>/gi,`<script src="${f}theme-init.js"><\/script>`),l=/index\.css/i.test(l)?l.replace(/<link\b([^>]*?)href="[^"]*?index\.css"([^>]*?)\/?>/gi,`<link$1href="${f}index.css"$2 />`):X(l,` <link rel="stylesheet" href="${f}index.css" />`);let p=e.siteConfig;if(!p&&e.siteConfigPath&&await $(e.siteConfigPath))try{p=JSON.parse(await j(e.siteConfigPath,`utf8`))}catch{}let m=p?.branding||{},h=p?.pwa||{},v=m.siteUrl||e.pagesOrigin,y=typeof v==`string`&&v.trim()?v.trim().replace(/\/*$/,`/`):``,b=(h.manifestPath||m.manifestPath||`manifest.json`).replace(/^\/+/,``),x=y?`${y}${b}`:`${f}manifest.json`;l=l.replace(/<link\b[^>]*\b(?:href="[^"]*?manifest\.json"|rel=["']?manifest["']?)[^>]*\/?>/giu,`<link rel="manifest" href="${x}" />`);let S=(m.faviconPath||`assets/icons/favicon.ico`).replace(/^\/+/,``).replace(/^pages\/main\//,``),C=y?`${y}${S}`:`${f}assets/icons/favicon.ico`,w=S.endsWith(`.svg`)?`image/svg+xml`:S.endsWith(`.png`)?`image/png`:`image/x-icon`,E=!1;l=l.replace(/<link\b[^>]*\brel=["']?(?:shortcut\s+)?icon["']?[^>]*\/?>/giu,()=>E?``:(E=!0,`<link rel="icon" href="${C}" type="${w}" />`)),E||(l=X(l,` <link rel="icon" href="${C}" type="${w}" />`));let D=(m.appleTouchIconPath||`assets/icons/180.png`).replace(/^\/+/,``).replace(/^pages\/main\//,``),O=y?`${y}${D}`:`${f}assets/icons/180.png`,k=!1;if(l=l.replace(/<link\b[^>]*\brel=["']?apple-touch-icon["']?[^>]*\/?>/giu,()=>k?``:(k=!0,`<link rel="apple-touch-icon" href="${O}" />`)),!k&&y&&(l=X(l,` <link rel="apple-touch-icon" href="${O}" />`)),l=l.replace(/\s*<script\s+type="module"\s+src="(?:\.\/|\/)?index\.js"><\/script>/gi,``),l=l.replace(/\s*<script\s+type="module"\s+src="(?:\.\/|\/)?service-worker\/init\.js"><\/script>/gi,``),l=l.replace(/\s*<link\b[^>]*\brel=["']?modulepreload["']?[^>]*\/?>/giu,e=>/\bhref=["']?(?:https?:)?\/\//iu.test(e)?e:``),l=l.replace(/\s*<script\b[^>]*\btype=["']?module["']?[^>]*\bsrc=["'](?!(?:https?:)?\/\/)[^"']*["'][^>]*><\/script>/giu,``),l=l.replace(/\s*<script\b[^>]*\btype=["']?module["']?[^>]*>(?:(?!<\/script>)[\s\S])*?service-worker\.js(?:(?!<\/script>)[\s\S])*?<\/script>/giu,``),l.includes(`<script type="importmap">`))l=l.replace(/"shadow-claw":\s*"[^"]*?\/dist\/lib\/index\.js"/g,`"shadow-claw": "${d}/dist/lib/index.js"`),l=l.replace(/"shadow-claw\/":\s*"[^"]*?"/g,`"shadow-claw/": "${d}/"`);else{let e=[` <!-- Import Map -->`,` <script type="importmap">`,` {`,` "imports": {`,` "shadow-claw": "${d}/dist/lib/index.js",`,` "shadow-claw/": "${d}/"`,` }`,` }`,` <\/script>`,` <!-- ShadowClaw Library Module -->`,` <script type="module">`,` import "shadow-claw";`,` <\/script>`].join(`
392
+ `);l=X(l,e)}if(!l.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(`
393
+ `);l=X(l,e)}if(!l.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(`
394
+ `);l=X(l,e)}let ee=_(g(t),`service-worker.js`);if(c){let e=te(`sha256`).update(l).digest(`hex`).slice(0,12);await L(ee,lu(d,e),`utf8`),l.includes(`data-shadow-claw-sw="true"`)||(l=X(l,uu({checkIntervalMs:36e5,checkOnFocus:!0,checkMinGapMs:3e4,repromptIntervalMs:9e5})))}else await F(ee,{force:!0});await L(t,l,`utf8`)}}async function hu(e={}){let t=R.env.NODE_ENV;try{let t=e.quiet??(R.env.NODE_ENV===`test`&&!R.env.VERBOSE),n=e.stdio??(R.env.NODE_ENV===`test`&&!R.env.VERBOSE?`pipe`:`inherit`),r=(...e)=>{t||console.log(...e)},i=b(e.contentRoot||T.SHADOWCLAW_CONTENT_ROOT||R.cwd()),a=b(e.toolchainRoot||fu),o=i===a,{isProduction:s,copyAllAssets:c,prerenderPages:l,prerenderMainMemory:u}=eo({...T,...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?R.env.NODE_ENV=`production`:e.isProduction===!1&&(R.env.NODE_ENV=`development`);async function d(e,r={}){!t&&!r.quiet&&console.log(`> ${e}`);let i=r.stdio??n,a={...R.env,...s?{NODE_ENV:`production`}:{},...r.env||{}};D(e,{stdio:i,...r,env:a})}if(o){if(w(fu),await qa(`dist/public`),await A(`dist/public/assets`,{recursive:!0}),c)await k(`assets`,`dist/public`,{recursive:!0});else{await k(`assets/icons`,`dist/public/assets/icons`,{recursive:!0}),await k(`assets/screenshots`,`dist/public/assets/screenshots`,{recursive:!0});try{await k(`assets/fonts`,`dist/public/assets/fonts`,{recursive:!0})}catch{}}await Ja([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],`dist/public`);for(let e of Za())await Ya(e.sources,e.dest,e.opts||{});try{await k(`e2e/README.md`,`dist/public/e2e/README.md`)}catch{}try{await k(`pages`,`dist/public/pages`,{recursive:!0})}catch{}try{await k(`pages/main`,`dist/public/files/main`,{recursive:!0})}catch{}let n;try{let{isTestFileOrDir:e}=await import(`./chunk-zkXQUEv6.js`);n=t=>!e(h(t),t)}catch{}try{await k(`pages/main`,`dist/public/static-main`,{recursive:!0})}catch{}try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await e(R.cwd())}catch{}try{await k(`.agents/skills`,`dist/public/.agents/skills`,{recursive:!0,...n?{filter:n}:{}})}catch{}try{await k(`.agents/tools`,`dist/public/.agents/tools`,{recursive:!0,...n?{filter:n}:{}})}catch{}try{await k(`.agents/scripts`,`dist/public/.agents/scripts`,{recursive:!0,...n?{filter:n}:{}})}catch{}if(await $(`.agents/skills`))try{let{generateSkillsIndex:e}=await import(`./chunk-zkXQUEv6.js`);await e(fu)}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}if(await $(`.well-known`))try{await k(`.well-known`,`dist/public/.well-known`,{recursive:!0,force:!0})}catch{}await d(`npm run -s rolldown`);let o=await Xa($a()),f=o||`pages/site-config.json`,p;if(o)try{p=JSON.parse(await j(o,`utf8`))}catch{}let m=e.pagesOrigin||T.PAGES_ORIGIN,g=s?Ll({basePath:e.basePath||T.PAGES_BASE_PATH,pagesOrigin:m,siteUrl:p?.branding?.siteUrl,defaultBasePath:`/shadow-claw/`}):e.basePath||T.PAGES_BASE_PATH||`/`;u?await Zc({indexPath:`dist/public/index.html`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:f,isProduction:s,singleFile:e.singleFile}):await Zc({indexPath:`dist/public/index.html`,noSeed:!0,siteConfigPath:f,isProduction:s,singleFile:e.singleFile});try{await $l(`dist/public`,f,{basePath:g,pagesOrigin:m,isProduction:s})}catch{}try{let e=JSON.parse(await j(`package.json`,`utf8`));if(e.version){let t=`dist/public/index.html`,n=await j(t,`utf8`);await L(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=_(`dist/public`,t);if(await $(n))try{let t=JSON.parse(await j(n,`utf8`));t.version!==e.version&&(t.version=e.version,await L(n,JSON.stringify(t,null,2)+`
395
+ `,`utf8`))}catch{}}}}catch{}try{let e=`dist/public/index.html`,t=await j(e,`utf8`);await L(e,Rl(t,g),`utf8`);let n=`dist/public/share/share-target.html`;if(await $(n)){let e=await j(n,`utf8`);await L(n,Rl(e,g),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${m||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${g}`),m)try{let e=`dist/public/manifest.json`,t=await j(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=m,await L(e,JSON.stringify(n,null,2),`utf8`))}catch{}await du(`dist/public`);let e=``;try{e=D(`npm run -s build:pkg:get:meta`,{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}e&&await d(`npm run -s build:pkg:meta "${e}"`)}await nu({publicDir:`dist/public`,routesPath:await Xa(Qa())||`pages/routes.json`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:f,basePath:g,pagesOrigin:m,isProduction:s,singleFile:e.singleFile}),await d(`npm run -s build:service-worker`);let v=`dist/public/service-worker.js`;if(await $(v)&&await su(v,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-C7i38c2x.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 mu({indexPath:`dist/public/index.html`,mainSourcePath:`pages/main`,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,serviceWorker:e.serviceWorker,siteConfig:p,siteConfigPath:f,pagesOrigin:m,isQuiet:t,log:r}),r(`Build completed successfully.`);return}let f=e.outDir||`dist/public`,p=b(i,f);await qa(p),await A(p,{recursive:!0}),await A(_(p,`assets`),{recursive:!0});let m=_(a,`dist/public`);await $(_(m,`index.js`))||(r(`Building ShadowClaw core toolchain...`),await qa(_(a,`dist/public`)),await qa(_(a,`dist-electron`)),await d(`npm run -s rolldown`,{cwd:a})),await k(m,p,{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=y(m,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 qa(_(p,`sitemap.xml`)),await qa(_(p,`sitemap.txt`)));let g=_(a,`assets`);if(i!==a&&await $(g)){let e=_(g,`icons`);await $(e)&&await k(e,_(p,`assets/icons`),{recursive:!0,force:!1,errorOnExist:!1});let t=_(g,`screenshots`);await $(t)&&await k(t,_(p,`assets/screenshots`),{recursive:!0,force:!1,errorOnExist:!1});let n=_(g,`fonts`);await $(n)&&await k(n,_(p,`assets/fonts`),{recursive:!0,force:!1,errorOnExist:!1})}let v=_(i,`assets`);await $(v)&&(c?await k(v,p,{recursive:!0,force:!0}):(await $(_(v,`icons`))&&await k(_(v,`icons`),_(p,`assets/icons`),{recursive:!0,force:!0}),await $(_(v,`screenshots`))&&await k(_(v,`screenshots`),_(p,`assets/screenshots`),{recursive:!0,force:!0}),await $(_(v,`fonts`))&&await k(_(v,`fonts`),_(p,`assets/fonts`),{recursive:!0,force:!0}))),await Ja([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],p,{baseDir:i});let x=Za({contentRoot:i,toolchainRoot:a,distPublicDir:p});for(let e of x)await Ya(e.sources,e.dest,e.opts||{});let S=_(i,`pages`);await $(S)&&await k(S,_(p,`pages`),{recursive:!0,force:!0});let C=_(i,`pages/main`);await $(C)&&(await k(C,_(p,`files/main`),{recursive:!0,force:!0}),await k(C,_(p,`static-main`),{recursive:!0,force:!0}));try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await $(_(i,`.agents`))&&await e(i),i!==a&&await $(_(a,`.agents`))&&await e(a)}catch{}let E=_(i,`.agents/skills`);await $(E)&&await k(E,_(p,`.agents/skills`),{recursive:!0,force:!0});let O=_(a,`.agents/skills`);i!==a&&await $(O)&&await k(O,_(p,`.agents/skills`),{recursive:!0,force:!1,errorOnExist:!1});let ee=_(i,`.agents/tools`);if(await $(ee))await k(ee,_(p,`.agents/tools`),{recursive:!0,force:!0});else{let e=_(a,`.agents/tools`);await $(e)&&await k(e,_(p,`.agents/tools`),{recursive:!0,force:!0})}let M=_(i,`.agents/scripts`);if(await $(M))await k(M,_(p,`.agents/scripts`),{recursive:!0,force:!0});else{let e=_(a,`.agents/scripts`);await $(e)&&await k(e,_(p,`.agents/scripts`),{recursive:!0,force:!0})}let N=_(a,`.well-known`);await $(N)&&await k(N,_(p,`.well-known`),{recursive:!0,force:!0});let P=_(i,`.well-known`);if(i!==a&&await $(P)&&await k(P,_(p,`.well-known`),{recursive:!0,force:!0}),await $(_(p,`.agents/skills`)))try{let{generateSkillsIndex:e}=await import(`./chunk-zkXQUEv6.js`);if(await e(p,{metadataRoot:i,outDir:`.well-known/agent-skills`,toolchainRoot:a,includeBundled:!0}),await $(E))try{await e(i,{toolchainRoot:a,includeBundled:!0})}catch{}}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}let F=await Xa($a(i)),I=F||_(i,`pages/site-config.json`),te=u,z;if(F)try{z=JSON.parse(await j(F,`utf8`))}catch{}e.prerenderMainMemory===void 0&&z&&(z?.settings?.prerenderMainMemory===!1?(te=!1,r(` site-config: prerenderMainMemory=false — pages DSD pre-rendering disabled.`)):z?.settings?.overridePrerenderSkeleton===!1&&r(` site-config: overridePrerenderSkeleton=false — skeleton overlay disabled.`));let B=_(p,`index.html`),V=await $(C);te&&(V||e.singleFile)?await Zc({indexPath:B,sourcePath:V?C:_(a,`pages/main`),prerenderPages:l,siteConfigPath:I,isProduction:s,singleFile:e.singleFile}):await Zc({indexPath:B,noSeed:!0,siteConfigPath:I,isProduction:s,singleFile:e.singleFile});let H=e.pagesOrigin||T.PAGES_ORIGIN,U=s?Ll({basePath:e.basePath||T.PAGES_BASE_PATH,pagesOrigin:H,siteUrl:z?.branding?.siteUrl,defaultBasePath:`/`}):e.basePath||T.PAGES_BASE_PATH||`/`;try{await $l(p,I,{basePath:U,pagesOrigin:H,isProduction:s})}catch{}try{let e=await j(B,`utf8`);e=Rl(e,U);let t=``;try{let e=await Xa([_(i,`package.json`),_(a,`package.json`)]);e&&(t=JSON.parse(await j(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=_(p,e);if(await $(n))try{let e=JSON.parse(await j(n,`utf8`));e.version!==t&&(e.version=t,await L(n,JSON.stringify(e,null,2)+`
396
+ `,`utf8`))}catch{}}}await L(B,e,`utf8`);let n=_(p,`share/share-target.html`);if(await $(n)){let e=await j(n,`utf8`);await L(n,Rl(e,U),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${H||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${U}`),H)try{let e=_(p,`manifest.json`),t=await j(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=H,await L(e,JSON.stringify(n,null,2),`utf8`))}catch{}await L(_(p,`.nojekyll`),``,`utf8`);let e=``;try{e=D(`git rev-parse HEAD`,{cwd:i,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{try{e=D(`git rev-parse HEAD`,{cwd:a,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}}if(e){let t=await j(B,`utf8`);await L(B,t.replace(/<meta\s+name="revision"[^>]*>/,`<meta name="revision" content="${e}" />`),`utf8`)}}let ne=await Xa(Qa(i))||_(i,`pages/routes.json`),re=await $(C)?C:_(a,`pages/main`);await nu({publicDir:p,routesPath:ne,sourcePath:re,prerenderPages:l,siteConfigPath:I,basePath:U,pagesOrigin:H,isProduction:s,singleFile:e.singleFile});let ie=_(p,`service-worker.js`);if(await $(ie)&&await su(ie,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-C7i38c2x.js`),n=await e(p,{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 mu({indexPath:_(p,`index.html`),mainSourcePath:re,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,serviceWorker:e.serviceWorker,siteConfig:z,siteConfigPath:I,pagesOrigin:H,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 R.env.NODE_ENV:R.env.NODE_ENV=t}}R.argv[1]&&b(R.argv[1])===b(S(import.meta.url))&&hu().catch(e=>{console.error(e),E(1)});export{hu as t};