@uibot/mcp-server 0.19.0 → 0.20.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.
- package/README.md +34 -0
- package/dist/http.js +105 -105
- package/dist/resources/bundle.json +1 -1
- package/dist/resources/templates/shadcn-admin.yaml +21 -21
- package/dist/server.d.ts +3 -0
- package/dist/server.js +105 -105
- package/dist/snapshots/4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f/r/admin-shell.json +173 -0
- package/dist/snapshots/4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f/r/charts.json +238 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/chat-workspace.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/collection-shared.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/commerce-workspace.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/console-page.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/console-shell.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/creation-shared.json +2 -2
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/crm-workspace.json +1 -1
- package/dist/snapshots/4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f/r/dashboard-01.json +78 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/dashboard.json +113 -3
- package/dist/snapshots/4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f/r/data-table.json +352 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/data.json +9 -2
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/document-assistant.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/document-workspace.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/drilldown-menu.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/education-workspace.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/feedback.json +15 -2
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/form.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/layout.json +27 -8
- package/dist/snapshots/4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f/r/nav.json +285 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/shadcn-admin.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-primitives.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/workspace.json +9 -2
- package/dist/snapshots/4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f/snapshot.json +1 -0
- package/package.json +10 -9
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-shell.json +0 -160
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/charts.json +0 -211
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/data-table.json +0 -242
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/nav.json +0 -257
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/snapshot.json +0 -1
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/licenses/UIBot-LICENSE +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/licenses/blocks-icons-LICENSE +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/licenses/shadcn-THIRD_PARTY_LICENSE +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-apps.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-chats.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-dashboard.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-error-401.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-error-403.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-error-404.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-error-500.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-error-503.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-forgot-password.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-help.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-otp.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-overview.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-settings-account.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-settings-appearance.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-settings-display.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-settings-notifications.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-settings-profile.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-settings.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-sign-in-2.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-sign-in.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-sign-up.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-tasks.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/admin-users.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/ai-chat.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/analytics-dashboard.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/app-shell-floating.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/app-shell-icon-rail.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/app-shell-inset.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/app-shell-settings.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/app-shell-sidebar.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/app-shell-workspace.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/auth-centered.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/auth-enterprise.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/auth-recovery.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/auth-registration.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/auth-split.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/auth.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/blog.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/chat-artifact.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/chat-focused.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/chat-history.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/chat-knowledge.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/chat-support.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/console-billing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/content.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/crm.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/data-studio.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/document-library.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/document-reading.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/document-writing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/ecommerce.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/field.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/grid.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/interactive.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/item-grid.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/kanban.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/lms.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/marketing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/portfolio.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/presentation.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/pricing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/primitives.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/saas-landing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sections.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/settings.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/shadcn-admin-shell.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-01.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-02.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-03.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-04.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-05.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-06.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-07.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-08.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-09.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-10.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-11.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-12.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-13.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-14.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-15.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-16.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/sidebar-drilldown.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/store.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/support-inbox.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/team-directory.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → 4501a880e17691677109b35118b89434252d4e65aa7b9a7c3a174a38ce2b418f}/r/uibot-base.json +0 -0
package/dist/server.js
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as vu}from"node:module";var fu=Object.create;var{getPrototypeOf:mu,defineProperty:ls,getOwnPropertyNames:yu}=Object;var us=Object.prototype.hasOwnProperty;function hu(e){return this[e]}var bu,wu,Su=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?bu??=new WeakMap:wu??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?fu(mu(e)):{};let o=t||!e||!e.__esModule||!us.call(e,"default")?ls(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of yu(e))if(!us.call(o,a))ls(o,a,{get:hu.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ut=vu(import.meta.url);var Be=h(function(yR,ds){var Cu=Number.MAX_SAFE_INTEGER||9007199254740991,ku=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ds.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Cu,RELEASE_TYPES:ku,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var nt=h(function(hR,ps){var Ru=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};ps.exports=Ru});var qe=h(function(ie,gs){var{MAX_SAFE_COMPONENT_LENGTH:fn,MAX_SAFE_BUILD_LENGTH:xu,MAX_LENGTH:Iu}=Be(),Au=nt();ie=gs.exports={};var Eu=ie.re=[],Pu=ie.safeRe=[],b=ie.src=[],Tu=ie.safeSrc=[],w=ie.t={},Ou=0,mn="[a-zA-Z0-9-]",Du=[["\\s",1],["\\d",Iu],[mn,xu]],Lu=(e)=>{for(let[t,r]of Du)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},I=(e,t,r)=>{let n=Lu(t),i=Ou++;Au(e,i,t),w[e]=i,b[i]=t,Tu[i]=n,Eu[i]=new RegExp(t,r?"g":void 0),Pu[i]=new RegExp(n,r?"g":void 0)};I("NUMERICIDENTIFIER","0|[1-9]\\d*");I("NUMERICIDENTIFIERLOOSE","\\d+");I("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mn}*`);I("MAINVERSION",`(${b[w.NUMERICIDENTIFIER]})\\.(${b[w.NUMERICIDENTIFIER]})\\.(${b[w.NUMERICIDENTIFIER]})`);I("MAINVERSIONLOOSE",`(${b[w.NUMERICIDENTIFIERLOOSE]})\\.(${b[w.NUMERICIDENTIFIERLOOSE]})\\.(${b[w.NUMERICIDENTIFIERLOOSE]})`);I("PRERELEASEIDENTIFIER",`(?:${b[w.NONNUMERICIDENTIFIER]}|${b[w.NUMERICIDENTIFIER]})`);I("PRERELEASEIDENTIFIERLOOSE",`(?:${b[w.NONNUMERICIDENTIFIER]}|${b[w.NUMERICIDENTIFIERLOOSE]})`);I("PRERELEASE",`(?:-(${b[w.PRERELEASEIDENTIFIER]}(?:\\.${b[w.PRERELEASEIDENTIFIER]})*))`);I("PRERELEASELOOSE",`(?:-?(${b[w.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[w.PRERELEASEIDENTIFIERLOOSE]})*))`);I("BUILDIDENTIFIER",`${mn}+`);I("BUILD",`(?:\\+(${b[w.BUILDIDENTIFIER]}(?:\\.${b[w.BUILDIDENTIFIER]})*))`);I("FULLPLAIN",`v?${b[w.MAINVERSION]}${b[w.PRERELEASE]}?${b[w.BUILD]}?`);I("FULL",`^${b[w.FULLPLAIN]}$`);I("LOOSEPLAIN",`[v=\\s]*${b[w.MAINVERSIONLOOSE]}${b[w.PRERELEASELOOSE]}?${b[w.BUILD]}?`);I("LOOSE",`^${b[w.LOOSEPLAIN]}$`);I("GTLT","((?:<|>)?=?)");I("XRANGEIDENTIFIERLOOSE",`${b[w.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);I("XRANGEIDENTIFIER",`${b[w.NUMERICIDENTIFIER]}|x|X|\\*`);I("XRANGEPLAIN",`[v=\\s]*(${b[w.XRANGEIDENTIFIER]})(?:\\.(${b[w.XRANGEIDENTIFIER]})(?:\\.(${b[w.XRANGEIDENTIFIER]})(?:${b[w.PRERELEASE]})?${b[w.BUILD]}?)?)?`);I("XRANGEPLAINLOOSE",`[v=\\s]*(${b[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[w.XRANGEIDENTIFIERLOOSE]})(?:${b[w.PRERELEASELOOSE]})?${b[w.BUILD]}?)?)?`);I("XRANGE",`^${b[w.GTLT]}\\s*${b[w.XRANGEPLAIN]}$`);I("XRANGELOOSE",`^${b[w.GTLT]}\\s*${b[w.XRANGEPLAINLOOSE]}$`);I("COERCEPLAIN",`(^|[^\\d])(\\d{1,${fn}})(?:\\.(\\d{1,${fn}}))?(?:\\.(\\d{1,${fn}}))?`);I("COERCE",`${b[w.COERCEPLAIN]}(?:$|[^\\d])`);I("COERCEFULL",b[w.COERCEPLAIN]+`(?:${b[w.PRERELEASE]})?(?:${b[w.BUILD]})?(?:$|[^\\d])`);I("COERCERTL",b[w.COERCE],!0);I("COERCERTLFULL",b[w.COERCEFULL],!0);I("LONETILDE","(?:~>?)");I("TILDETRIM",`(\\s*)${b[w.LONETILDE]}\\s+`,!0);ie.tildeTrimReplace="$1~";I("TILDE",`^${b[w.LONETILDE]}${b[w.XRANGEPLAIN]}$`);I("TILDELOOSE",`^${b[w.LONETILDE]}${b[w.XRANGEPLAINLOOSE]}$`);I("LONECARET","(?:\\^)");I("CARETTRIM",`(\\s*)${b[w.LONECARET]}\\s+`,!0);ie.caretTrimReplace="$1^";I("CARET",`^${b[w.LONECARET]}${b[w.XRANGEPLAIN]}$`);I("CARETLOOSE",`^${b[w.LONECARET]}${b[w.XRANGEPLAINLOOSE]}$`);I("COMPARATORLOOSE",`^${b[w.GTLT]}\\s*(${b[w.LOOSEPLAIN]})$|^$`);I("COMPARATOR",`^${b[w.GTLT]}\\s*(${b[w.FULLPLAIN]})$|^$`);I("COMPARATORTRIM",`(\\s*)${b[w.GTLT]}\\s*(${b[w.LOOSEPLAIN]}|${b[w.XRANGEPLAIN]})`,!0);ie.comparatorTrimReplace="$1$2$3";I("HYPHENRANGE",`^\\s*(${b[w.XRANGEPLAIN]})\\s+-\\s+(${b[w.XRANGEPLAIN]})\\s*$`);I("HYPHENRANGELOOSE",`^\\s*(${b[w.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[w.XRANGEPLAINLOOSE]})\\s*$`);I("STAR","(<|>)?=?\\s*\\*");I("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");I("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ht=h(function(bR,fs){var Nu=Object.freeze({loose:!0}),_u=Object.freeze({}),Mu=(e)=>{if(!e)return _u;if(typeof e!=="object")return Nu;return e};fs.exports=Mu});var yn=h(function(wR,hs){var ms=/^[0-9]+$/,ys=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=ms.test(e),n=ms.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},$u=(e,t)=>ys(t,e);hs.exports={compareIdentifiers:ys,rcompareIdentifiers:$u}});var B=h(function(SR,ws){var Vt=nt(),{MAX_LENGTH:bs,MAX_SAFE_INTEGER:zt}=Be(),{safeRe:Gt,t:Kt}=qe(),Bu=Ht(),{compareIdentifiers:hn}=yn(),qu=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(hn(e[n],r[n])!==0)return!1;return!0};class Z{constructor(e,t){if(t=Bu(t),e instanceof Z)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>bs)throw TypeError(`version is longer than ${bs} characters`);Vt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Gt[Kt.LOOSE]:Gt[Kt.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>zt||this.major<0)throw TypeError("Invalid major version");if(this.minor>zt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>zt||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<zt)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Vt("SemVer.compare",this.version,this.options,e),!(e instanceof Z)){if(typeof e==="string"&&e===this.version)return 0;e=new Z(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Z))e=new Z(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Z))e=new Z(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Vt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return hn(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Z))e=new Z(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Vt("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return hn(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Gt[Kt.PRERELEASELOOSE]:Gt[Kt.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(qu(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}ws.exports=Z});var fe=h(function(vR,vs){var Ss=B(),Fu=(e,t,r=!1)=>{if(e instanceof Ss)return e;try{return new Ss(e,t)}catch(n){if(!r)return null;throw n}};vs.exports=Fu});var ks=h(function(CR,Cs){var ju=fe(),Uu=(e,t)=>{let r=ju(e,t);return r?r.version:null};Cs.exports=Uu});var xs=h(function(kR,Rs){var Hu=fe(),Vu=(e,t)=>{let r=Hu(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Rs.exports=Vu});var Es=h(function(RR,As){var Is=B(),zu=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Is(e instanceof Is?e.version:e,r).inc(t,n,i).version}catch(s){return null}};As.exports=zu});var Os=h(function(xR,Ts){var Ps=fe(),Gu=(e,t)=>{let r=Ps(e,null,!0),n=Ps(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let g=c?"pre":"";if(r.major!==n.major)return g+"major";if(r.minor!==n.minor)return g+"minor";if(r.patch!==n.patch)return g+"patch";return"prerelease"};Ts.exports=Gu});var Ls=h(function(IR,Ds){var Ku=B(),Wu=(e,t)=>new Ku(e,t).major;Ds.exports=Wu});var _s=h(function(AR,Ns){var Yu=B(),Ju=(e,t)=>new Yu(e,t).minor;Ns.exports=Ju});var $s=h(function(ER,Ms){var Qu=B(),Xu=(e,t)=>new Qu(e,t).patch;Ms.exports=Xu});var qs=h(function(PR,Bs){var Zu=fe(),ed=(e,t)=>{let r=Zu(e,t);return r&&r.prerelease.length?r.prerelease:null};Bs.exports=ed});var W=h(function(TR,js){var Fs=B(),td=(e,t,r)=>new Fs(e,r).compare(new Fs(t,r));js.exports=td});var Hs=h(function(OR,Us){var rd=W(),nd=(e,t,r)=>rd(t,e,r);Us.exports=nd});var zs=h(function(DR,Vs){var id=W(),sd=(e,t)=>id(e,t,!0);Vs.exports=sd});var Wt=h(function(LR,Ks){var Gs=B(),od=(e,t,r)=>{let n=new Gs(e,r),i=new Gs(t,r);return n.compare(i)||n.compareBuild(i)};Ks.exports=od});var Ys=h(function(NR,Ws){var ad=Wt(),cd=(e,t)=>e.sort((r,n)=>ad(r,n,t));Ws.exports=cd});var Qs=h(function(_R,Js){var ld=Wt(),ud=(e,t)=>e.sort((r,n)=>ld(n,r,t));Js.exports=ud});var it=h(function(MR,Xs){var dd=W(),pd=(e,t,r)=>dd(e,t,r)>0;Xs.exports=pd});var Yt=h(function($R,Zs){var gd=W(),fd=(e,t,r)=>gd(e,t,r)<0;Zs.exports=fd});var bn=h(function(BR,eo){var md=W(),yd=(e,t,r)=>md(e,t,r)===0;eo.exports=yd});var wn=h(function(qR,to){var hd=W(),bd=(e,t,r)=>hd(e,t,r)!==0;to.exports=bd});var Jt=h(function(FR,ro){var wd=W(),Sd=(e,t,r)=>wd(e,t,r)>=0;ro.exports=Sd});var Qt=h(function(jR,no){var vd=W(),Cd=(e,t,r)=>vd(e,t,r)<=0;no.exports=Cd});var Sn=h(function(UR,io){var kd=bn(),Rd=wn(),xd=it(),Id=Jt(),Ad=Yt(),Ed=Qt(),Pd=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return kd(e,r,n);case"!=":return Rd(e,r,n);case">":return xd(e,r,n);case">=":return Id(e,r,n);case"<":return Ad(e,r,n);case"<=":return Ed(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};io.exports=Pd});var oo=h(function(HR,so){var Td=B(),Od=fe(),{safeRe:Xt,t:Zt}=qe(),Dd=(e,t)=>{if(e instanceof Td)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Xt[Zt.COERCEFULL]:Xt[Zt.COERCE]);else{let c=t.includePrerelease?Xt[Zt.COERCERTLFULL]:Xt[Zt.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Od(`${n}.${i}.${s}${o}${a}`,t)};so.exports=Dd});var lo=h(function(VR,co){var Ld=fe(),ao=Be(),Nd=B(),_d=(e,t,r)=>{if(!ao.RELEASE_TYPES.includes(t))return null;let n=Md(e,r);return n&&$d(n,t)},Md=(e,t)=>{let r=e instanceof Nd?e.version:e;return Ld(r,t)},$d=(e,t)=>{if(Bd(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Bd=(e)=>e.startsWith("pre");co.exports=_d});var go=h(function(zR,po){class uo{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}po.exports=uo});var Y=h(function(GR,ho){var qd=/\s+/g;class st{constructor(e,t){if(t=jd(t),e instanceof st)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new st(e.raw,t);if(e instanceof er)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(qd," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!mo(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Jd(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Yd,"");let r=((this.options.includePrerelease&&Kd)|(this.options.loose&&Wd))+":"+e,n=fo.get(r);if(n)return n;let i=this.options.loose,s=i?j[q.HYPHENRANGELOOSE]:j[q.HYPHENRANGE];e=e.replace(s,ap(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(j[q.COMPARATORTRIM],Vd),T("comparator trim",e),e=e.replace(j[q.TILDETRIM],zd),T("tilde trim",e),e=e.replace(j[q.CARETTRIM],Gd),T("caret trim",e);let o=e.split(" ").map((g)=>Qd(g,this.options)).join(" ").split(/\s+/).map((g)=>op(g,this.options));if(i)o=o.filter((g)=>(T("loose invalid filter",g,this.options),!!g.match(j[q.COMPARATORLOOSE])));T("range list",o);let a=new Map,c=o.map((g)=>new er(g,this.options));for(let g of c){if(mo(g))return[g];a.set(g.value,g)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return fo.set(r,l),l}intersects(e,t){if(!(e instanceof st))throw TypeError("a Range is required");return this.set.some((r)=>yo(r,t)&&e.set.some((n)=>yo(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Ud(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(cp(this.set[t],e,this.options))return!0;return!1}}ho.exports=st;var Fd=go(),fo=new Fd,jd=Ht(),er=ot(),T=nt(),Ud=B(),{safeRe:j,src:Hd,t:q,comparatorTrimReplace:Vd,tildeTrimReplace:zd,caretTrimReplace:Gd}=qe(),{FLAG_INCLUDE_PRERELEASE:Kd,FLAG_LOOSE:Wd}=Be(),Yd=new RegExp(Hd[q.BUILD],"g"),mo=(e)=>e.value==="<0.0.0-0",Jd=(e)=>e.value==="",yo=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},Qd=(e,t)=>(e=e.replace(j[q.BUILD],""),T("comp",e,t),e=tp(e,t),T("caret",e),e=Zd(e,t),T("tildes",e),e=np(e,t),T("xrange",e),e=sp(e,t),T("stars",e),e),N=(e)=>!e||e.toLowerCase()==="x"||e==="*",Xd=(e,t,r)=>N(e)&&!N(t)||N(t)&&r&&!N(r),Zd=(e,t)=>e.trim().split(/\s+/).map((r)=>ep(r,t)).join(" "),ep=(e,t)=>{let r=t.loose?j[q.TILDELOOSE]:j[q.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{T("tilde",e,i,s,o,a,c);let l;if(N(s))l="";else if(N(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(N(a))l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(c)T("replaceTilde pr",c),l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return T("tilde return",l),l})},tp=(e,t)=>e.trim().split(/\s+/).map((r)=>rp(r,t)).join(" "),rp=(e,t)=>{T("caret",e,t);let r=t.loose?j[q.CARETLOOSE]:j[q.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{T("caret",e,i,s,o,a,c);let l;if(N(s))l="";else if(N(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(N(a))if(s==="0")l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(c)if(T("replaceCaret pr",c),s==="0")if(o==="0")l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`;else if(T("no pr"),s==="0")if(o==="0")l=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`;return T("caret return",l),l})},np=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>ip(r,t)).join(" ")),ip=(e,t)=>{e=e.trim();let r=t.loose?j[q.XRANGELOOSE]:j[q.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{if(T("xRange",e,n,i,s,o,a,c),Xd(s,o,a))return e;let l=N(s),g=l||N(o),p=g||N(a),d=p;if(i==="="&&d)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&d){if(g)o=0;if(a=0,i===">")if(i=">=",g)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",g)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(g)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(p)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return T("xRange return",n),n})},sp=(e,t)=>(T("replaceStars",e,t),e.trim().replace(j[q.STAR],"")),op=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(j[t.includePrerelease?q.GTE0PRE:q.GTE0],"")),ap=(e)=>(t,r,n,i,s,o,a,c,l,g,p,d)=>{if(N(n))r="";else if(N(i))r=`>=${n}.0.0${e?"-0":""}`;else if(N(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(N(l))c="";else if(N(g))c=`<${+l+1}.0.0-0`;else if(N(p))c=`<${l}.${+g+1}.0-0`;else if(d)c=`<=${l}.${g}.${p}-${d}`;else if(e)c=`<${l}.${g}.${+p+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},cp=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(T(e[n].semver),e[n].semver===er.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var ot=h(function(KR,ko){var at=Symbol("SemVer ANY");class tr{static get ANY(){return at}constructor(e,t){if(t=bo(t),e instanceof tr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Cn("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===at)this.value="";else this.value=this.operator+this.semver.version;Cn("comp",this)}parse(e){let t=this.options.loose?wo[So.COMPARATORLOOSE]:wo[So.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=at;else this.semver=new vo(r[2],this.options.loose)}toString(){return this.value}test(e){if(Cn("Comparator.test",e,this.options.loose),this.semver===at||e===at)return!0;if(typeof e==="string")try{e=new vo(e,this.options)}catch(t){return!1}return vn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof tr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Co(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Co(this.value,t).test(e.semver)}if(t=bo(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(vn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(vn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}ko.exports=tr;var bo=Ht(),{safeRe:wo,t:So}=qe(),vn=Sn(),Cn=nt(),vo=B(),Co=Y()});var ct=h(function(WR,Ro){var lp=Y(),up=(e,t,r)=>{try{t=new lp(t,r)}catch(n){return!1}return t.test(e)};Ro.exports=up});var Io=h(function(YR,xo){var dp=Y(),pp=(e,t)=>new dp(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));xo.exports=pp});var Eo=h(function(JR,Ao){var gp=B(),fp=Y(),mp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new fp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new gp(n,r)}}),n};Ao.exports=mp});var To=h(function(QR,Po){var yp=B(),hp=Y(),bp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new hp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new yp(n,r)}}),n};Po.exports=bp});var Lo=h(function(XR,Do){var kn=B(),wp=Y(),Oo=it(),Sp=(e,t)=>{e=new wp(e,t);let r=new kn("0.0.0");if(e.test(r))return r;if(r=new kn("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let a=new kn(o.semver.version);switch(o.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!s||Oo(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Oo(r,s)))r=s}if(r&&e.test(r))return r;return null};Do.exports=Sp});var _o=h(function(ZR,No){var vp=Y(),Cp=(e,t)=>{try{return new vp(e,t).range||"*"}catch(r){return null}};No.exports=Cp});var rr=h(function(ex,qo){var kp=B(),Bo=ot(),{ANY:Rp}=Bo,xp=Y(),Ip=ct(),Mo=it(),$o=Yt(),Ap=Qt(),Ep=Jt(),Pp=(e,t,r,n)=>{e=new kp(e,n),t=new xp(t,n);let i,s,o,a,c;switch(r){case">":i=Mo,s=Ap,o=$o,a=">",c=">=";break;case"<":i=$o,s=Ep,o=Mo,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Ip(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let g=t.set[l],p=null,d=null;if(g.forEach((u)=>{if(u.semver===Rp)u=new Bo(">=0.0.0");if(p=p||u,d=d||u,i(u.semver,p.semver,n))p=u;else if(o(u.semver,d.semver,n))d=u}),p.operator===a||p.operator===c)return!1;if((!d.operator||d.operator===a)&&s(e,d.semver))return!1;else if(d.operator===c&&o(e,d.semver))return!1}return!0};qo.exports=Pp});var jo=h(function(tx,Fo){var Tp=rr(),Op=(e,t,r)=>Tp(e,t,">",r);Fo.exports=Op});var Ho=h(function(rx,Uo){var Dp=rr(),Lp=(e,t,r)=>Dp(e,t,"<",r);Uo.exports=Lp});var Go=h(function(nx,zo){var Vo=Y(),Np=(e,t,r)=>(e=new Vo(e,r),t=new Vo(t,r),e.intersects(t,r));zo.exports=Np});var Wo=h(function(ix,Ko){var _p=ct(),Mp=W();Ko.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((g,p)=>Mp(g,p,r));for(let g of o)if(_p(g,t,r)){if(s=g,!i)i=g}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[g,p]of n)if(g===p)a.push(g);else if(!p&&g===o[0])a.push("*");else if(!p)a.push(`>=${g}`);else if(g===o[0])a.push(`<=${p}`);else a.push(`${g} - ${p}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var ea=h(function(sx,Zo){var Yo=Y(),In=ot(),{ANY:Rn}=In,xn=ct(),An=W(),$p=(e,t,r={})=>{if(e===t)return!0;e=new Yo(e,r),t=new Yo(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=qp(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Bp=[new In(">=0.0.0-0")],Jo=[new In(">=0.0.0")],qp=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Rn)if(t.length===1&&t[0].semver===Rn)return!0;else if(r.includePrerelease)e=Bp;else e=Jo;if(t.length===1&&t[0].semver===Rn)if(r.includePrerelease)return!0;else t=Jo;let n=new Set,i,s;for(let u of e)if(u.operator===">"||u.operator===">=")i=Qo(i,u,r);else if(u.operator==="<"||u.operator==="<=")s=Xo(s,u,r);else n.add(u.semver);if(n.size>1)return null;let o;if(i&&s){if(o=An(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let u of n){if(i&&!xn(u,String(i),r))return null;if(s&&!xn(u,String(s),r))return null;for(let m of t)if(!xn(u,String(m),r))return!1;return!0}let a,c,l,g,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0)p=!1;for(let u of t){if(g=g||u.operator===">"||u.operator===">=",l=l||u.operator==="<"||u.operator==="<=",i){if(d){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===d.major&&u.semver.minor===d.minor&&u.semver.patch===d.patch)d=!1}if(u.operator===">"||u.operator===">="){if(a=Qo(i,u,r),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(s){if(p){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===p.major&&u.semver.minor===p.minor&&u.semver.patch===p.patch)p=!1}if(u.operator==="<"||u.operator==="<="){if(c=Xo(s,u,r),c===u&&c!==s)return!1}else if(s.operator==="<="&&!u.test(s.semver))return!1}if(!u.operator&&(s||i)&&o!==0)return!1}if(i&&l&&!s&&o!==0)return!1;if(s&&g&&!i&&o!==0)return!1;if(d||p)return!1;return!0},Qo=(e,t,r)=>{if(!e)return t;let n=An(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Xo=(e,t,r)=>{if(!e)return t;let n=An(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Zo.exports=$p});var ra=h(function(ox,ta){var Fe=qe(),nr=Be(),Fp=B(),ir=yn(),jp=fe(),Up=ks(),Hp=xs(),Vp=Es(),zp=Os(),Gp=Ls(),Kp=_s(),Wp=$s(),Yp=qs(),Jp=W(),Qp=Hs(),Xp=zs(),Zp=Wt(),eg=Ys(),tg=Qs(),rg=it(),ng=Yt(),ig=bn(),sg=wn(),og=Jt(),ag=Qt(),cg=Sn(),lg=oo(),ug=lo(),dg=ot(),pg=Y(),gg=ct(),fg=Io(),mg=Eo(),yg=To(),hg=Lo(),bg=_o(),wg=rr(),Sg=jo(),vg=Ho(),Cg=Go(),kg=Wo(),Rg=ea();ta.exports={parse:jp,valid:Up,clean:Hp,inc:Vp,diff:zp,major:Gp,minor:Kp,patch:Wp,prerelease:Yp,compare:Jp,rcompare:Qp,compareLoose:Xp,compareBuild:Zp,sort:eg,rsort:tg,gt:rg,lt:ng,eq:ig,neq:sg,gte:og,lte:ag,cmp:cg,coerce:lg,truncate:ug,Comparator:dg,Range:pg,satisfies:gg,toComparators:fg,maxSatisfying:mg,minSatisfying:yg,minVersion:hg,validRange:bg,outside:wg,gtr:Sg,ltr:vg,intersects:Cg,simplifyRange:kg,subset:Rg,SemVer:Fp,re:Fe.re,src:Fe.src,tokens:Fe.t,SEMVER_SPEC_VERSION:nr.SEMVER_SPEC_VERSION,RELEASE_TYPES:nr.RELEASE_TYPES,compareIdentifiers:ir.compareIdentifiers,rcompareIdentifiers:ir.rcompareIdentifiers}});var E=h(function(Gg){var On=Symbol.for("yaml.alias"),fa=Symbol.for("yaml.document"),dr=Symbol.for("yaml.map"),ma=Symbol.for("yaml.pair"),Dn=Symbol.for("yaml.scalar"),pr=Symbol.for("yaml.seq"),le=Symbol.for("yaml.node.type"),qg=(e)=>!!e&&typeof e==="object"&&e[le]===On,Fg=(e)=>!!e&&typeof e==="object"&&e[le]===fa,jg=(e)=>!!e&&typeof e==="object"&&e[le]===dr,Ug=(e)=>!!e&&typeof e==="object"&&e[le]===ma,ya=(e)=>!!e&&typeof e==="object"&&e[le]===Dn,Hg=(e)=>!!e&&typeof e==="object"&&e[le]===pr;function ha(e){if(e&&typeof e==="object")switch(e[le]){case dr:case pr:return!0}return!1}function Vg(e){if(e&&typeof e==="object")switch(e[le]){case On:case dr:case Dn:case pr:return!0}return!1}var zg=(e)=>(ya(e)||ha(e))&&!!e.anchor;Gg.ALIAS=On;Gg.DOC=fa;Gg.MAP=dr;Gg.NODE_TYPE=le;Gg.PAIR=ma;Gg.SCALAR=Dn;Gg.SEQ=pr;Gg.hasAnchor=zg;Gg.isAlias=qg;Gg.isCollection=ha;Gg.isDocument=Fg;Gg.isMap=jg;Gg.isNode=Vg;Gg.isPair=Ug;Gg.isScalar=ya;Gg.isSeq=Hg});var gt=h(function(uf){var _=E(),V=Symbol("break visit"),ba=Symbol("skip children"),se=Symbol("remove node");function gr(e,t){let r=wa(t);if(_.isDocument(e)){if(Ue(null,e.contents,r,Object.freeze([e]))===se)e.contents=null}else Ue(null,e,r,Object.freeze([]))}gr.BREAK=V;gr.SKIP=ba;gr.REMOVE=se;function Ue(e,t,r,n){let i=Sa(e,t,r,n);if(_.isNode(i)||_.isPair(i))return va(e,n,i),Ue(e,i,r,n);if(typeof i!=="symbol"){if(_.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){let o=Ue(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===V)return V;else if(o===se)t.items.splice(s,1),s-=1}}else if(_.isPair(t)){n=Object.freeze(n.concat(t));let s=Ue("key",t.key,r,n);if(s===V)return V;else if(s===se)t.key=null;let o=Ue("value",t.value,r,n);if(o===V)return V;else if(o===se)t.value=null}}return i}async function fr(e,t){let r=wa(t);if(_.isDocument(e)){if(await He(null,e.contents,r,Object.freeze([e]))===se)e.contents=null}else await He(null,e,r,Object.freeze([]))}fr.BREAK=V;fr.SKIP=ba;fr.REMOVE=se;async function He(e,t,r,n){let i=await Sa(e,t,r,n);if(_.isNode(i)||_.isPair(i))return va(e,n,i),He(e,i,r,n);if(typeof i!=="symbol"){if(_.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){let o=await He(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===V)return V;else if(o===se)t.items.splice(s,1),s-=1}}else if(_.isPair(t)){n=Object.freeze(n.concat(t));let s=await He("key",t.key,r,n);if(s===V)return V;else if(s===se)t.key=null;let o=await He("value",t.value,r,n);if(o===V)return V;else if(o===se)t.value=null}}return i}function wa(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function Sa(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(_.isMap(t))return r.Map?.(e,t,n);if(_.isSeq(t))return r.Seq?.(e,t,n);if(_.isPair(t))return r.Pair?.(e,t,n);if(_.isScalar(t))return r.Scalar?.(e,t,n);if(_.isAlias(t))return r.Alias?.(e,t,n);return}function va(e,t,r){let n=t[t.length-1];if(_.isCollection(n))n.items[e]=r;else if(_.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(_.isDocument(n))n.contents=r;else{let i=_.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}uf.visit=gr;uf.visitAsync=fr});var Ln=h(function(yf){var Ca=E(),gf=gt(),ff={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mf=(e)=>e.replace(/[!,[\]{}]/g,(t)=>ff[t]);class Q{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Q.defaultYaml,e),this.tags=Object.assign({},Q.defaultTags,t)}clone(){let e=new Q(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new Q(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Q.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Q.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:Q.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Q.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[i,s]=r;return this.tags[i]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let s=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,s),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);if(s==="!"||s==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return s}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(s){return t(String(s)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+mf(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&Ca.isNode(e.contents)){let i={};gf.visit(e.contents,(s,o)=>{if(Ca.isNode(o)&&o.tag)i[o.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,s]of r){if(i==="!!"&&s==="tag:yaml.org,2002:")continue;if(!e||n.some((o)=>o.startsWith(s)))t.push(`%TAG ${i} ${s}`)}return t.join(`
|
|
3
|
-
`)}}
|
|
4
|
-
`)?
|
|
2
|
+
import{createRequire as Tu}from"node:module";var Cu=Object.create;var{getPrototypeOf:Ru,defineProperty:mo,getOwnPropertyNames:xu}=Object;var yo=Object.prototype.hasOwnProperty;function Iu(e){return this[e]}var Au,Eu,Pu=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Au??=new WeakMap:Eu??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?Cu(Ru(e)):{};let s=t||!e||!e.__esModule||!yo.call(e,"default")?mo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of xu(e))if(!yo.call(s,a))mo(s,a,{get:Iu.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Gt=Tu(import.meta.url);var je=h(function(jR,vo){var Fu=Number.MAX_SAFE_INTEGER||9007199254740991,ju=["major","premajor","minor","preminor","patch","prepatch","prerelease"];vo.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Fu,RELEASE_TYPES:ju,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var at=h(function(UR,So){var Uu=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};So.exports=Uu});var Ue=h(function(se,ko){var{MAX_SAFE_COMPONENT_LENGTH:wn,MAX_SAFE_BUILD_LENGTH:Hu,MAX_LENGTH:Vu}=je(),zu=at();se=ko.exports={};var Gu=se.re=[],Ku=se.safeRe=[],v=se.src=[],Wu=se.safeSrc=[],S=se.t={},Yu=0,vn="[a-zA-Z0-9-]",Ju=[["\\s",1],["\\d",Vu],[vn,Hu]],Qu=(e)=>{for(let[t,r]of Ju)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},A=(e,t,r)=>{let n=Qu(t),i=Yu++;zu(e,i,t),S[e]=i,v[i]=t,Wu[i]=n,Gu[i]=new RegExp(t,r?"g":void 0),Ku[i]=new RegExp(n,r?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","\\d+");A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${vn}*`);A("MAINVERSION",`(${v[S.NUMERICIDENTIFIER]})\\.(${v[S.NUMERICIDENTIFIER]})\\.(${v[S.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${v[S.NUMERICIDENTIFIERLOOSE]})\\.(${v[S.NUMERICIDENTIFIERLOOSE]})\\.(${v[S.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${v[S.NONNUMERICIDENTIFIER]}|${v[S.NUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${v[S.NONNUMERICIDENTIFIER]}|${v[S.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASE",`(?:-(${v[S.PRERELEASEIDENTIFIER]}(?:\\.${v[S.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${v[S.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${v[S.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER",`${vn}+`);A("BUILD",`(?:\\+(${v[S.BUILDIDENTIFIER]}(?:\\.${v[S.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${v[S.MAINVERSION]}${v[S.PRERELEASE]}?${v[S.BUILD]}?`);A("FULL",`^${v[S.FULLPLAIN]}$`);A("LOOSEPLAIN",`[v=\\s]*${v[S.MAINVERSIONLOOSE]}${v[S.PRERELEASELOOSE]}?${v[S.BUILD]}?`);A("LOOSE",`^${v[S.LOOSEPLAIN]}$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${v[S.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${v[S.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${v[S.XRANGEIDENTIFIER]})(?:\\.(${v[S.XRANGEIDENTIFIER]})(?:\\.(${v[S.XRANGEIDENTIFIER]})(?:${v[S.PRERELEASE]})?${v[S.BUILD]}?)?)?`);A("XRANGEPLAINLOOSE",`[v=\\s]*(${v[S.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[S.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[S.XRANGEIDENTIFIERLOOSE]})(?:${v[S.PRERELEASELOOSE]})?${v[S.BUILD]}?)?)?`);A("XRANGE",`^${v[S.GTLT]}\\s*${v[S.XRANGEPLAIN]}$`);A("XRANGELOOSE",`^${v[S.GTLT]}\\s*${v[S.XRANGEPLAINLOOSE]}$`);A("COERCEPLAIN",`(^|[^\\d])(\\d{1,${wn}})(?:\\.(\\d{1,${wn}}))?(?:\\.(\\d{1,${wn}}))?`);A("COERCE",`${v[S.COERCEPLAIN]}(?:$|[^\\d])`);A("COERCEFULL",v[S.COERCEPLAIN]+`(?:${v[S.PRERELEASE]})?(?:${v[S.BUILD]})?(?:$|[^\\d])`);A("COERCERTL",v[S.COERCE],!0);A("COERCERTLFULL",v[S.COERCEFULL],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${v[S.LONETILDE]}\\s+`,!0);se.tildeTrimReplace="$1~";A("TILDE",`^${v[S.LONETILDE]}${v[S.XRANGEPLAIN]}$`);A("TILDELOOSE",`^${v[S.LONETILDE]}${v[S.XRANGEPLAINLOOSE]}$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${v[S.LONECARET]}\\s+`,!0);se.caretTrimReplace="$1^";A("CARET",`^${v[S.LONECARET]}${v[S.XRANGEPLAIN]}$`);A("CARETLOOSE",`^${v[S.LONECARET]}${v[S.XRANGEPLAINLOOSE]}$`);A("COMPARATORLOOSE",`^${v[S.GTLT]}\\s*(${v[S.LOOSEPLAIN]})$|^$`);A("COMPARATOR",`^${v[S.GTLT]}\\s*(${v[S.FULLPLAIN]})$|^$`);A("COMPARATORTRIM",`(\\s*)${v[S.GTLT]}\\s*(${v[S.LOOSEPLAIN]}|${v[S.XRANGEPLAIN]})`,!0);se.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${v[S.XRANGEPLAIN]})\\s+-\\s+(${v[S.XRANGEPLAIN]})\\s*$`);A("HYPHENRANGELOOSE",`^\\s*(${v[S.XRANGEPLAINLOOSE]})\\s+-\\s+(${v[S.XRANGEPLAINLOOSE]})\\s*$`);A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Kt=h(function(HR,Co){var Xu=Object.freeze({loose:!0}),Zu=Object.freeze({}),ed=(e)=>{if(!e)return Zu;if(typeof e!=="object")return Xu;return e};Co.exports=ed});var Sn=h(function(VR,Io){var Ro=/^[0-9]+$/,xo=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Ro.test(e),n=Ro.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},td=(e,t)=>xo(t,e);Io.exports={compareIdentifiers:xo,rcompareIdentifiers:td}});var q=h(function(zR,Eo){var Wt=at(),{MAX_LENGTH:Ao,MAX_SAFE_INTEGER:Yt}=je(),{safeRe:Jt,t:Qt}=Ue(),rd=Kt(),{compareIdentifiers:kn}=Sn(),nd=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(kn(e[n],r[n])!==0)return!1;return!0};class ee{constructor(e,t){if(t=rd(t),e instanceof ee)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ao)throw TypeError(`version is longer than ${Ao} characters`);Wt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Jt[Qt.LOOSE]:Jt[Qt.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Yt||this.major<0)throw TypeError("Invalid major version");if(this.minor>Yt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Yt||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Yt)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Wt("SemVer.compare",this.version,this.options,e),!(e instanceof ee)){if(typeof e==="string"&&e===this.version)return 0;e=new ee(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof ee))e=new ee(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof ee))e=new ee(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Wt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return kn(r,n)}while(++t)}compareBuild(e){if(!(e instanceof ee))e=new ee(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Wt("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return kn(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Jt[Qt.PRERELEASELOOSE]:Jt[Qt.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(nd(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Eo.exports=ee});var he=h(function(GR,To){var Po=q(),id=(e,t,r=!1)=>{if(e instanceof Po)return e;try{return new Po(e,t)}catch(n){if(!r)return null;throw n}};To.exports=id});var Do=h(function(KR,Oo){var od=he(),sd=(e,t)=>{let r=od(e,t);return r?r.version:null};Oo.exports=sd});var No=h(function(WR,Lo){var ad=he(),cd=(e,t)=>{let r=ad(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Lo.exports=cd});var $o=h(function(YR,Mo){var _o=q(),ld=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new _o(e instanceof _o?e.version:e,r).inc(t,n,i).version}catch(o){return null}};Mo.exports=ld});var Fo=h(function(JR,qo){var Bo=he(),ud=(e,t)=>{let r=Bo(e,null,!0),n=Bo(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let p=c?"pre":"";if(r.major!==n.major)return p+"major";if(r.minor!==n.minor)return p+"minor";if(r.patch!==n.patch)return p+"patch";return"prerelease"};qo.exports=ud});var Uo=h(function(QR,jo){var dd=q(),pd=(e,t)=>new dd(e,t).major;jo.exports=pd});var Vo=h(function(XR,Ho){var gd=q(),fd=(e,t)=>new gd(e,t).minor;Ho.exports=fd});var Go=h(function(ZR,zo){var md=q(),yd=(e,t)=>new md(e,t).patch;zo.exports=yd});var Wo=h(function(ex,Ko){var hd=he(),bd=(e,t)=>{let r=hd(e,t);return r&&r.prerelease.length?r.prerelease:null};Ko.exports=bd});var Y=h(function(tx,Jo){var Yo=q(),wd=(e,t,r)=>new Yo(e,r).compare(new Yo(t,r));Jo.exports=wd});var Xo=h(function(rx,Qo){var vd=Y(),Sd=(e,t,r)=>vd(t,e,r);Qo.exports=Sd});var es=h(function(nx,Zo){var kd=Y(),Cd=(e,t)=>kd(e,t,!0);Zo.exports=Cd});var Xt=h(function(ix,rs){var ts=q(),Rd=(e,t,r)=>{let n=new ts(e,r),i=new ts(t,r);return n.compare(i)||n.compareBuild(i)};rs.exports=Rd});var is=h(function(ox,ns){var xd=Xt(),Id=(e,t)=>e.sort((r,n)=>xd(r,n,t));ns.exports=Id});var ss=h(function(sx,os){var Ad=Xt(),Ed=(e,t)=>e.sort((r,n)=>Ad(n,r,t));os.exports=Ed});var ct=h(function(ax,as){var Pd=Y(),Td=(e,t,r)=>Pd(e,t,r)>0;as.exports=Td});var Zt=h(function(cx,cs){var Od=Y(),Dd=(e,t,r)=>Od(e,t,r)<0;cs.exports=Dd});var Cn=h(function(lx,ls){var Ld=Y(),Nd=(e,t,r)=>Ld(e,t,r)===0;ls.exports=Nd});var Rn=h(function(ux,us){var _d=Y(),Md=(e,t,r)=>_d(e,t,r)!==0;us.exports=Md});var er=h(function(dx,ds){var $d=Y(),Bd=(e,t,r)=>$d(e,t,r)>=0;ds.exports=Bd});var tr=h(function(px,ps){var qd=Y(),Fd=(e,t,r)=>qd(e,t,r)<=0;ps.exports=Fd});var xn=h(function(gx,gs){var jd=Cn(),Ud=Rn(),Hd=ct(),Vd=er(),zd=Zt(),Gd=tr(),Kd=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return jd(e,r,n);case"!=":return Ud(e,r,n);case">":return Hd(e,r,n);case">=":return Vd(e,r,n);case"<":return zd(e,r,n);case"<=":return Gd(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};gs.exports=Kd});var ms=h(function(fx,fs){var Wd=q(),Yd=he(),{safeRe:rr,t:nr}=Ue(),Jd=(e,t)=>{if(e instanceof Wd)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?rr[nr.COERCEFULL]:rr[nr.COERCE]);else{let c=t.includePrerelease?rr[nr.COERCERTLFULL]:rr[nr.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Yd(`${n}.${i}.${o}${s}${a}`,t)};fs.exports=Jd});var bs=h(function(mx,hs){var Qd=he(),ys=je(),Xd=q(),Zd=(e,t,r)=>{if(!ys.RELEASE_TYPES.includes(t))return null;let n=ep(e,r);return n&&tp(n,t)},ep=(e,t)=>{let r=e instanceof Xd?e.version:e;return Qd(r,t)},tp=(e,t)=>{if(rp(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},rp=(e)=>e.startsWith("pre");hs.exports=Zd});var Ss=h(function(yx,vs){class ws{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}vs.exports=ws});var J=h(function(hx,xs){var np=/\s+/g;class lt{constructor(e,t){if(t=op(t),e instanceof lt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new lt(e.raw,t);if(e instanceof ir)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(np," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Cs(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&fp(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(gp,"");let r=((this.options.includePrerelease&&dp)|(this.options.loose&&pp))+":"+e,n=ks.get(r);if(n)return n;let i=this.options.loose,o=i?U[F.HYPHENRANGELOOSE]:U[F.HYPHENRANGE];e=e.replace(o,xp(this.options.includePrerelease)),O("hyphen replace",e),e=e.replace(U[F.COMPARATORTRIM],cp),O("comparator trim",e),e=e.replace(U[F.TILDETRIM],lp),O("tilde trim",e),e=e.replace(U[F.CARETTRIM],up),O("caret trim",e);let s=e.split(" ").map((p)=>mp(p,this.options)).join(" ").split(/\s+/).map((p)=>Rp(p,this.options));if(i)s=s.filter((p)=>(O("loose invalid filter",p,this.options),!!p.match(U[F.COMPARATORLOOSE])));O("range list",s);let a=new Map,c=s.map((p)=>new ir(p,this.options));for(let p of c){if(Cs(p))return[p];a.set(p.value,p)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return ks.set(r,l),l}intersects(e,t){if(!(e instanceof lt))throw TypeError("a Range is required");return this.set.some((r)=>Rs(r,t)&&e.set.some((n)=>Rs(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new sp(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Ip(this.set[t],e,this.options))return!0;return!1}}xs.exports=lt;var ip=Ss(),ks=new ip,op=Kt(),ir=ut(),O=at(),sp=q(),{safeRe:U,src:ap,t:F,comparatorTrimReplace:cp,tildeTrimReplace:lp,caretTrimReplace:up}=Ue(),{FLAG_INCLUDE_PRERELEASE:dp,FLAG_LOOSE:pp}=je(),gp=new RegExp(ap[F.BUILD],"g"),Cs=(e)=>e.value==="<0.0.0-0",fp=(e)=>e.value==="",Rs=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},mp=(e,t)=>(e=e.replace(U[F.BUILD],""),O("comp",e,t),e=wp(e,t),O("caret",e),e=hp(e,t),O("tildes",e),e=Sp(e,t),O("xrange",e),e=Cp(e,t),O("stars",e),e),_=(e)=>!e||e.toLowerCase()==="x"||e==="*",yp=(e,t,r)=>_(e)&&!_(t)||_(t)&&r&&!_(r),hp=(e,t)=>e.trim().split(/\s+/).map((r)=>bp(r,t)).join(" "),bp=(e,t)=>{let r=t.loose?U[F.TILDELOOSE]:U[F.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{O("tilde",e,i,o,s,a,c);let l;if(_(o))l="";else if(_(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(_(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)O("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return O("tilde return",l),l})},wp=(e,t)=>e.trim().split(/\s+/).map((r)=>vp(r,t)).join(" "),vp=(e,t)=>{O("caret",e,t);let r=t.loose?U[F.CARETLOOSE]:U[F.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{O("caret",e,i,o,s,a,c);let l;if(_(o))l="";else if(_(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(_(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(O("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(O("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return O("caret return",l),l})},Sp=(e,t)=>(O("replaceXRanges",e,t),e.split(/\s+/).map((r)=>kp(r,t)).join(" ")),kp=(e,t)=>{e=e.trim();let r=t.loose?U[F.XRANGELOOSE]:U[F.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(O("xRange",e,n,i,o,s,a,c),yp(o,s,a))return e;let l=_(o),p=l||_(s),u=p||_(a),g=u;if(i==="="&&g)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&g){if(p)s=0;if(a=0,i===">")if(i=">=",p)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",p)o=+o+1;else s=+s+1;if(i==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(p)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(u)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return O("xRange return",n),n})},Cp=(e,t)=>(O("replaceStars",e,t),e.trim().replace(U[F.STAR],"")),Rp=(e,t)=>(O("replaceGTE0",e,t),e.trim().replace(U[t.includePrerelease?F.GTE0PRE:F.GTE0],"")),xp=(e)=>(t,r,n,i,o,s,a,c,l,p,u,g)=>{if(_(n))r="";else if(_(i))r=`>=${n}.0.0${e?"-0":""}`;else if(_(o))r=`>=${n}.${i}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(_(l))c="";else if(_(p))c=`<${+l+1}.0.0-0`;else if(_(u))c=`<${l}.${+p+1}.0-0`;else if(g)c=`<=${l}.${p}.${u}-${g}`;else if(e)c=`<${l}.${p}.${+u+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},Ip=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(O(e[n].semver),e[n].semver===ir.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var ut=h(function(bx,Os){var dt=Symbol("SemVer ANY");class or{static get ANY(){return dt}constructor(e,t){if(t=Is(t),e instanceof or)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),An("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===dt)this.value="";else this.value=this.operator+this.semver.version;An("comp",this)}parse(e){let t=this.options.loose?As[Es.COMPARATORLOOSE]:As[Es.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=dt;else this.semver=new Ps(r[2],this.options.loose)}toString(){return this.value}test(e){if(An("Comparator.test",e,this.options.loose),this.semver===dt||e===dt)return!0;if(typeof e==="string")try{e=new Ps(e,this.options)}catch(t){return!1}return In(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof or))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ts(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ts(this.value,t).test(e.semver)}if(t=Is(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(In(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(In(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Os.exports=or;var Is=Kt(),{safeRe:As,t:Es}=Ue(),In=xn(),An=at(),Ps=q(),Ts=J()});var pt=h(function(wx,Ds){var Ap=J(),Ep=(e,t,r)=>{try{t=new Ap(t,r)}catch(n){return!1}return t.test(e)};Ds.exports=Ep});var Ns=h(function(vx,Ls){var Pp=J(),Tp=(e,t)=>new Pp(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Ls.exports=Tp});var Ms=h(function(Sx,_s){var Op=q(),Dp=J(),Lp=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Dp(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Op(n,r)}}),n};_s.exports=Lp});var Bs=h(function(kx,$s){var Np=q(),_p=J(),Mp=(e,t,r)=>{let n=null,i=null,o=null;try{o=new _p(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new Np(n,r)}}),n};$s.exports=Mp});var js=h(function(Cx,Fs){var En=q(),$p=J(),qs=ct(),Bp=(e,t)=>{e=new $p(e,t);let r=new En("0.0.0");if(e.test(r))return r;if(r=new En("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new En(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||qs(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||qs(r,o)))r=o}if(r&&e.test(r))return r;return null};Fs.exports=Bp});var Hs=h(function(Rx,Us){var qp=J(),Fp=(e,t)=>{try{return new qp(e,t).range||"*"}catch(r){return null}};Us.exports=Fp});var sr=h(function(xx,Ks){var jp=q(),Gs=ut(),{ANY:Up}=Gs,Hp=J(),Vp=pt(),Vs=ct(),zs=Zt(),zp=tr(),Gp=er(),Kp=(e,t,r,n)=>{e=new jp(e,n),t=new Hp(t,n);let i,o,s,a,c;switch(r){case">":i=Vs,o=zp,s=zs,a=">",c=">=";break;case"<":i=zs,o=Gp,s=Vs,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Vp(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let p=t.set[l],u=null,g=null;if(p.forEach((d)=>{if(d.semver===Up)d=new Gs(">=0.0.0");if(u=u||d,g=g||d,i(d.semver,u.semver,n))u=d;else if(s(d.semver,g.semver,n))g=d}),u.operator===a||u.operator===c)return!1;if((!g.operator||g.operator===a)&&o(e,g.semver))return!1;else if(g.operator===c&&s(e,g.semver))return!1}return!0};Ks.exports=Kp});var Ys=h(function(Ix,Ws){var Wp=sr(),Yp=(e,t,r)=>Wp(e,t,">",r);Ws.exports=Yp});var Qs=h(function(Ax,Js){var Jp=sr(),Qp=(e,t,r)=>Jp(e,t,"<",r);Js.exports=Qp});var ea=h(function(Ex,Zs){var Xs=J(),Xp=(e,t,r)=>(e=new Xs(e,r),t=new Xs(t,r),e.intersects(t,r));Zs.exports=Xp});var ra=h(function(Px,ta){var Zp=pt(),eg=Y();ta.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((p,u)=>eg(p,u,r));for(let p of s)if(Zp(p,t,r)){if(o=p,!i)i=p}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,null]);let a=[];for(let[p,u]of n)if(p===u)a.push(p);else if(!u&&p===s[0])a.push("*");else if(!u)a.push(`>=${p}`);else if(p===s[0])a.push(`<=${u}`);else a.push(`${p} - ${u}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var ca=h(function(Tx,aa){var na=J(),On=ut(),{ANY:Pn}=On,Tn=pt(),Dn=Y(),tg=(e,t,r={})=>{if(e===t)return!0;e=new na(e,r),t=new na(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=ng(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},rg=[new On(">=0.0.0-0")],ia=[new On(">=0.0.0")],ng=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Pn)if(t.length===1&&t[0].semver===Pn)return!0;else if(r.includePrerelease)e=rg;else e=ia;if(t.length===1&&t[0].semver===Pn)if(r.includePrerelease)return!0;else t=ia;let n=new Set,i,o;for(let d of e)if(d.operator===">"||d.operator===">=")i=oa(i,d,r);else if(d.operator==="<"||d.operator==="<=")o=sa(o,d,r);else n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Dn(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Tn(d,String(i),r))return null;if(o&&!Tn(d,String(o),r))return null;for(let m of t)if(!Tn(d,String(m),r))return!1;return!0}let a,c,l,p,u=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(u&&u.prerelease.length===1&&o.operator==="<"&&u.prerelease[0]===0)u=!1;for(let d of t){if(p=p||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",i){if(g){if(d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===g.major&&d.semver.minor===g.minor&&d.semver.patch===g.patch)g=!1}if(d.operator===">"||d.operator===">="){if(a=oa(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!d.test(i.semver))return!1}if(o){if(u){if(d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===u.major&&d.semver.minor===u.minor&&d.semver.patch===u.patch)u=!1}if(d.operator==="<"||d.operator==="<="){if(c=sa(o,d,r),c===d&&c!==o)return!1}else if(o.operator==="<="&&!d.test(o.semver))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&p&&!i&&s!==0)return!1;if(g||u)return!1;return!0},oa=(e,t,r)=>{if(!e)return t;let n=Dn(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},sa=(e,t,r)=>{if(!e)return t;let n=Dn(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};aa.exports=tg});var ua=h(function(Ox,la){var He=Ue(),ar=je(),ig=q(),cr=Sn(),og=he(),sg=Do(),ag=No(),cg=$o(),lg=Fo(),ug=Uo(),dg=Vo(),pg=Go(),gg=Wo(),fg=Y(),mg=Xo(),yg=es(),hg=Xt(),bg=is(),wg=ss(),vg=ct(),Sg=Zt(),kg=Cn(),Cg=Rn(),Rg=er(),xg=tr(),Ig=xn(),Ag=ms(),Eg=bs(),Pg=ut(),Tg=J(),Og=pt(),Dg=Ns(),Lg=Ms(),Ng=Bs(),_g=js(),Mg=Hs(),$g=sr(),Bg=Ys(),qg=Qs(),Fg=ea(),jg=ra(),Ug=ca();la.exports={parse:og,valid:sg,clean:ag,inc:cg,diff:lg,major:ug,minor:dg,patch:pg,prerelease:gg,compare:fg,rcompare:mg,compareLoose:yg,compareBuild:hg,sort:bg,rsort:wg,gt:vg,lt:Sg,eq:kg,neq:Cg,gte:Rg,lte:xg,cmp:Ig,coerce:Ag,truncate:Eg,Comparator:Pg,Range:Tg,satisfies:Og,toComparators:Dg,maxSatisfying:Lg,minSatisfying:Ng,minVersion:_g,validRange:Mg,outside:$g,gtr:Bg,ltr:qg,intersects:Fg,simplifyRange:jg,subset:Ug,SemVer:ig,re:He.re,src:He.src,tokens:He.t,SEMVER_SPEC_VERSION:ar.SEMVER_SPEC_VERSION,RELEASE_TYPES:ar.RELEASE_TYPES,compareIdentifiers:cr.compareIdentifiers,rcompareIdentifiers:cr.rcompareIdentifiers}});var P=h(function(gf){var Mn=Symbol.for("yaml.alias"),Ca=Symbol.for("yaml.document"),mr=Symbol.for("yaml.map"),Ra=Symbol.for("yaml.pair"),$n=Symbol.for("yaml.scalar"),yr=Symbol.for("yaml.seq"),de=Symbol.for("yaml.node.type"),sf=(e)=>!!e&&typeof e==="object"&&e[de]===Mn,af=(e)=>!!e&&typeof e==="object"&&e[de]===Ca,cf=(e)=>!!e&&typeof e==="object"&&e[de]===mr,lf=(e)=>!!e&&typeof e==="object"&&e[de]===Ra,xa=(e)=>!!e&&typeof e==="object"&&e[de]===$n,uf=(e)=>!!e&&typeof e==="object"&&e[de]===yr;function Ia(e){if(e&&typeof e==="object")switch(e[de]){case mr:case yr:return!0}return!1}function df(e){if(e&&typeof e==="object")switch(e[de]){case Mn:case mr:case $n:case yr:return!0}return!1}var pf=(e)=>(xa(e)||Ia(e))&&!!e.anchor;gf.ALIAS=Mn;gf.DOC=Ca;gf.MAP=mr;gf.NODE_TYPE=de;gf.PAIR=Ra;gf.SCALAR=$n;gf.SEQ=yr;gf.hasAnchor=pf;gf.isAlias=sf;gf.isCollection=Ia;gf.isDocument=af;gf.isMap=cf;gf.isNode=df;gf.isPair=lf;gf.isScalar=xa;gf.isSeq=uf});var ht=h(function(Tf){var M=P(),z=Symbol("break visit"),Aa=Symbol("skip children"),ae=Symbol("remove node");function hr(e,t){let r=Ea(t);if(M.isDocument(e)){if(ze(null,e.contents,r,Object.freeze([e]))===ae)e.contents=null}else ze(null,e,r,Object.freeze([]))}hr.BREAK=z;hr.SKIP=Aa;hr.REMOVE=ae;function ze(e,t,r,n){let i=Pa(e,t,r,n);if(M.isNode(i)||M.isPair(i))return Ta(e,n,i),ze(e,i,r,n);if(typeof i!=="symbol"){if(M.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=ze(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===z)return z;else if(s===ae)t.items.splice(o,1),o-=1}}else if(M.isPair(t)){n=Object.freeze(n.concat(t));let o=ze("key",t.key,r,n);if(o===z)return z;else if(o===ae)t.key=null;let s=ze("value",t.value,r,n);if(s===z)return z;else if(s===ae)t.value=null}}return i}async function br(e,t){let r=Ea(t);if(M.isDocument(e)){if(await Ge(null,e.contents,r,Object.freeze([e]))===ae)e.contents=null}else await Ge(null,e,r,Object.freeze([]))}br.BREAK=z;br.SKIP=Aa;br.REMOVE=ae;async function Ge(e,t,r,n){let i=await Pa(e,t,r,n);if(M.isNode(i)||M.isPair(i))return Ta(e,n,i),Ge(e,i,r,n);if(typeof i!=="symbol"){if(M.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=await Ge(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===z)return z;else if(s===ae)t.items.splice(o,1),o-=1}}else if(M.isPair(t)){n=Object.freeze(n.concat(t));let o=await Ge("key",t.key,r,n);if(o===z)return z;else if(o===ae)t.key=null;let s=await Ge("value",t.value,r,n);if(s===z)return z;else if(s===ae)t.value=null}}return i}function Ea(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function Pa(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(M.isMap(t))return r.Map?.(e,t,n);if(M.isSeq(t))return r.Seq?.(e,t,n);if(M.isPair(t))return r.Pair?.(e,t,n);if(M.isScalar(t))return r.Scalar?.(e,t,n);if(M.isAlias(t))return r.Alias?.(e,t,n);return}function Ta(e,t,r){let n=t[t.length-1];if(M.isCollection(n))n.items[e]=r;else if(M.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(M.isDocument(n))n.contents=r;else{let i=M.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Tf.visit=hr;Tf.visitAsync=br});var Bn=h(function(Mf){var Oa=P(),Lf=ht(),Nf={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_f=(e)=>e.replace(/[!,[\]{}]/g,(t)=>Nf[t]);class X{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},X.defaultYaml,e),this.tags=Object.assign({},X.defaultTags,t)}clone(){let e=new X(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new X(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:X.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},X.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:X.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},X.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);if(o==="!"||o==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return o}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(o){return t(String(o)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+_f(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&Oa.isNode(e.contents)){let i={};Lf.visit(e.contents,(o,s)=>{if(Oa.isNode(s)&&s.tag)i[s.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,o]of r){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
|
|
3
|
+
`)}}X.defaultYaml={explicit:!1,version:"1.2"};X.defaultTags={"!!":"tag:yaml.org,2002:"};Mf.Directives=X});var wr=h(function(jf){var Da=P(),Bf=ht();function qf(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(r)}return!0}function La(e){let t=new Set;return Bf.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}}),t}function Na(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function Ff(e,t){let r=[],n=new Map,i=null;return{onAnchor:(o)=>{r.push(o),i??(i=La(e));let s=Na(t,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s==="object"&&s.anchor&&(Da.isScalar(s.node)||Da.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}jf.anchorIsValid=qf;jf.anchorNames=La;jf.createNodeAnchors=Ff;jf.findNewAnchor=Na});var qn=h(function(Gf){function bt(e,t,r,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=bt(e,n,String(i),s);if(a===void 0)delete n[i];else if(a!==s)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=bt(e,n,i,o);if(s===void 0)n.delete(i);else if(s!==o)n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=bt(e,n,i,i);if(o===void 0)n.delete(i);else if(o!==i)n.delete(i),n.add(o)}else for(let[i,o]of Object.entries(n)){let s=bt(e,n,i,o);if(s===void 0)delete n[i];else if(s!==o)n[i]=s}return e.call(t,r,n)}Gf.applyReviver=bt});var be=h(function(Yf){var Wf=P();function _a(e,t,r){if(Array.isArray(e))return e.map((n,i)=>_a(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!Wf.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=(o)=>{n.res=o,delete r.onCreate};let i=e.toJSON(t,r);if(r.onCreate)r.onCreate(i);return i}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}Yf.toJS=_a});var vr=h(function(Zf){var Qf=qn(),Ma=P(),Xf=be();class $a{constructor(e){Object.defineProperty(this,Ma.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:i}={}){if(!Ma.isDocument(e))throw TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},s=Xf.toJS(this,"",o);if(typeof n==="function")for(let{count:a,res:c}of o.anchors.values())n(c,a);return typeof i==="function"?Qf.applyReviver(i,{"":s},"",s):s}}Zf.NodeBase=$a});var wt=h(function(om){var tm=wr(),rm=ht(),Ke=P(),nm=vr(),im=be();class Ba extends nm.NodeBase{constructor(e){super(Ke.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let r;if(t?.aliasResolveCache)r=t.aliasResolveCache;else if(r=[],rm.visit(e,{Node:(i,o)=>{if(Ke.isAlias(o)||Ke.hasAnchor(o))r.push(o)}}),t)t.aliasResolveCache=r;let n=void 0;for(let i of r){if(i===this)break;if(i.anchor===this.source)n=i}if(n&&t){let{anchors:i,doc:o,maxAliasCount:s}=t,a=i.get(n);if(!a)im.toJS(n,null,t),a=i.get(n);if(a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(s>=0){if(a.count+=1,a.aliasCount===0)a.aliasCount=Sr(o,n,i);if(a.count*a.aliasCount>s)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}}return n}toJSON(e,t){if(!t)return{source:this.source};let r=this.resolve(t.doc,t);if(!r){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(n)}return t.anchors.get(r).res}toString(e,t,r){let n=`*${this.source}`;if(e){if(tm.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(e.implicitKey)return`${n} `}return n}}function Sr(e,t,r){if(Ke.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Ke.isCollection(t)){let n=0;for(let i of t.items){let o=Sr(e,i,r);if(o>n)n=o}return n}else if(Ke.isPair(t)){let n=Sr(e,t.key,r),i=Sr(e,t.value,r);return Math.max(n,i)}return 1}om.Alias=Ba});var D=h(function(dm){var am=P(),cm=vr(),lm=be(),um=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class Oe extends cm.NodeBase{constructor(e){super(am.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:lm.toJS(this.value,e,t)}toString(){return String(this.value)}}Oe.BLOCK_FOLDED="BLOCK_FOLDED";Oe.BLOCK_LITERAL="BLOCK_LITERAL";Oe.PLAIN="PLAIN";Oe.QUOTE_DOUBLE="QUOTE_DOUBLE";Oe.QUOTE_SINGLE="QUOTE_SINGLE";dm.Scalar=Oe;dm.isScalarValue=um});var vt=h(function(bm){var fm=wt(),De=P(),qa=D(),mm="tag:yaml.org,2002:";function ym(e,t,r){if(t){let n=r.filter((o)=>o.tag===t),i=n.find((o)=>!o.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return r.find((n)=>n.identify?.(e)&&!n.format)}function hm(e,t,r){if(De.isDocument(e))e=e.contents;if(De.isNode(e))return e;if(De.isPair(e)){let u=r.schema[De.MAP].createNode?.(r.schema,null,r);return u.items.push(e),u}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c=void 0;if(n&&e&&typeof e==="object")if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new fm.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=mm+t.slice(2);let l=ym(e,t,s.tags);if(!l){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let u=new qa.Scalar(e);if(c)c.node=u;return u}l=e instanceof Map?s[De.MAP]:(Symbol.iterator in Object(e))?s[De.SEQ]:s[De.MAP]}if(o)o(l),delete r.onTagObj;let p=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from==="function"?l.nodeClass.from(r.schema,e,r):new qa.Scalar(e);if(t)p.tag=t;else if(!l.default)p.tag=l.tag;if(c)c.node=p;return p}bm.createNode=hm});var kr=h(function(km){var vm=vt(),ce=P(),Sm=vr();function Fn(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o==="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return vm.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Fa=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class ja extends Sm.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((r)=>ce.isNode(r)||ce.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(Fa(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(ce.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(r,Fn(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(ce.isCollection(n))return n.deleteIn(r);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,i=this.get(r,!0);if(n.length===0)return!t&&ce.isScalar(i)?i.value:i;else return ce.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!ce.isPair(t))return!1;let r=t.value;return r==null||e&&ce.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return ce.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let i=this.get(r,!0);if(ce.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(r,Fn(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}km.Collection=ja;km.collectionFromPath=Fn;km.isEmptyPath=Fa});var St=h(function(Em){var Im=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function jn(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var Am=(e,t,r)=>e.endsWith(`
|
|
4
|
+
`)?jn(r,t):r.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+
|
|
7
|
-
`){if(r==="block")f=
|
|
8
|
-
`&&
|
|
9
|
-
`&&R!=="\t")
|
|
10
|
-
${t}${e.slice(0,x)}`;else{if(r==="quoted"&&
|
|
11
|
-
${t}${e.slice(R+1,x)}`}}return
|
|
12
|
-
`);n=t,i=t+1,
|
|
13
|
-
`){if(s
|
|
6
|
+
`+jn(r,t):(e.endsWith(" ")?"":" ")+r;Em.indentComment=jn;Em.lineComment=Am;Em.stringifyComment=Im});var Ha=h(function(Lm){function Dm(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;if(i<o)o=0;let c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;let l=[],p={},u=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,o))l.push(0);else u=i-n;let g=void 0,d=void 0,m=!1,f=-1,y=-1,w=-1;if(r==="block"){if(f=Ua(e,f,t.length),f!==-1)u=f+c}for(let k;k=e[f+=1];){if(r==="quoted"&&k==="\\"){switch(y=f,e[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}w=f}if(k===`
|
|
7
|
+
`){if(r==="block")f=Ua(e,f,t.length);u=f+t.length+c,g=void 0}else{if(k===" "&&d&&d!==" "&&d!==`
|
|
8
|
+
`&&d!=="\t"){let R=e[f+1];if(R&&R!==" "&&R!==`
|
|
9
|
+
`&&R!=="\t")g=f}if(f>=u)if(g)l.push(g),u=g+c,g=void 0;else if(r==="quoted"){while(d===" "||d==="\t")d=k,k=e[f+=1],m=!0;let R=f>w+1?f-2:y-1;if(p[R])return e;l.push(R),p[R]=!0,u=R+c,g=void 0}else m=!0}d=k}if(m&&a)a();if(l.length===0)return e;if(s)s();let b=e.slice(0,l[0]);for(let k=0;k<l.length;++k){let R=l[k],x=l[k+1]||e.length;if(R===0)b=`
|
|
10
|
+
${t}${e.slice(0,x)}`;else{if(r==="quoted"&&p[R])b+=`${e[R]}\\`;b+=`
|
|
11
|
+
${t}${e.slice(R+1,x)}`}}return b}function Ua(e,t,r){let n=t,i=t+1,o=e[i];while(o===" "||o==="\t")if(t<i+r)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
12
|
+
`);n=t,i=t+1,o=e[i]}return n}Lm.FOLD_BLOCK="block";Lm.FOLD_FLOW="flow";Lm.FOLD_QUOTED="quoted";Lm.foldFlowLines=Dm});var Ct=h(function(jm){var re=D(),we=Ha(),Rr=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),xr=(e)=>/^(%|---|\.\.\.)/m.test(e);function Bm(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(e[o]===`
|
|
13
|
+
`){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function kt(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(xr(e)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c]){if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n")s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\";if(l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let p=r.substr(c+2,4);switch(p){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:if(p.substr(0,2)==="00")s+="\\x"+p.substr(2);else s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{s+=r.slice(a,c)+`
|
|
14
14
|
|
|
15
|
-
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')
|
|
16
|
-
`,c+=2;if(o
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return
|
|
18
|
-
${r}`)+"'";return t.implicitKey?n:
|
|
15
|
+
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')s+=`
|
|
16
|
+
`,c+=2;if(s+=o,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,n?s:we.foldFlowLines(s,o,we.FOLD_QUOTED,Rr(t,!1))}function Un(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return kt(e,t);let r=t.indent||(xr(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${r}`)+"'";return t.implicitKey?n:we.foldFlowLines(n,r,we.FOLD_FLOW,Rr(t,!1))}function We(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=kt;else{let i=e.includes('"'),o=e.includes("'");if(i&&!o)n=Un;else if(o&&!i)n=kt;else n=r?Un:kt}return n(e,t)}var Hn;try{Hn=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{Hn=/\n+(?!\n|$)/g}function Cr({comment:e,type:t,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return We(r,n);let l=n.indent||(n.forceBlockIndent||xr(r)?" ":""),p=s==="literal"?!0:s==="folded"||t===re.Scalar.BLOCK_FOLDED?!1:t===re.Scalar.BLOCK_LITERAL?!0:!Bm(r,c,l.length);if(!r)return p?`|
|
|
22
22
|
`:`>
|
|
23
|
-
`;let
|
|
24
|
-
`&&x!=="\t"&&x!==" ")break}let
|
|
25
|
-
`);if(m===-1)
|
|
26
|
-
`)
|
|
27
|
-
`)
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),
|
|
29
|
-
${l}${
|
|
30
|
-
${l}${
|
|
31
|
-
`)||
|
|
32
|
-
`)?
|
|
33
|
-
`))return
|
|
34
|
-
${c}`);if(
|
|
35
|
-
${t.indent}${a}`}
|
|
36
|
-
${a}:`}else if(y=`${y}:`,
|
|
37
|
-
`:"",
|
|
38
|
-
${
|
|
39
|
-
`&&k)
|
|
23
|
+
`;let u,g;for(g=r.length;g>0;--g){let x=r[g-1];if(x!==`
|
|
24
|
+
`&&x!=="\t"&&x!==" ")break}let d=r.substring(g),m=d.indexOf(`
|
|
25
|
+
`);if(m===-1)u="-";else if(r===d||m!==d.length-1){if(u="+",o)o()}else u="";if(d){if(r=r.slice(0,-d.length),d[d.length-1]===`
|
|
26
|
+
`)d=d.slice(0,-1);d=d.replace(Hn,`$&${l}`)}let f=!1,y,w=-1;for(y=0;y<r.length;++y){let x=r[y];if(x===" ")f=!0;else if(x===`
|
|
27
|
+
`)w=y;else break}let b=r.substring(0,w<y?w+1:y);if(b)r=r.substring(b.length),b=b.replace(/\n+/g,`$&${l}`);let R=(f?l?"2":"1":"")+u;if(e){if(R+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!p){let x=r.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),I=!1,T=Rr(n,!0);if(s!=="folded"&&t!==re.Scalar.BLOCK_FOLDED)T.onOverflow=()=>{I=!0};let C=we.foldFlowLines(`${b}${x}${d}`,l,we.FOLD_BLOCK,T);if(!I)return`>${R}
|
|
29
|
+
${l}${C}`}return r=r.replace(/\n+/g,`$&${l}`),`|${R}
|
|
30
|
+
${l}${b}${r}${d}`}function qm(e,t,r,n){let{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:p}=t;if(a&&o.includes(`
|
|
31
|
+
`)||p&&/[[\]{},]/.test(o))return We(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||p||!o.includes(`
|
|
32
|
+
`)?We(o,t):Cr(e,t,r,n);if(!a&&!p&&i!==re.Scalar.PLAIN&&o.includes(`
|
|
33
|
+
`))return Cr(e,t,r,n);if(xr(o)){if(c==="")return t.forceBlockIndent=!0,Cr(e,t,r,n);else if(a&&c===l)return We(o,t)}let u=o.replace(/\n+/g,`$&
|
|
34
|
+
${c}`);if(s){let g=(f)=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(u),{compat:d,tags:m}=t.doc.schema;if(m.some(g)||d?.some(g))return We(o,t)}return a?u:we.foldFlowLines(u,c,we.FOLD_FLOW,Rr(t,!1))}function Fm(e,t,r,n){let{implicitKey:i,inFlow:o}=t,s=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==re.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value))a=re.Scalar.QUOTE_DOUBLE}let c=(p)=>{switch(p){case re.Scalar.BLOCK_FOLDED:case re.Scalar.BLOCK_LITERAL:return i||o?We(s.value,t):Cr(s,t,r,n);case re.Scalar.QUOTE_DOUBLE:return kt(s.value,t);case re.Scalar.QUOTE_SINGLE:return Un(s.value,t);case re.Scalar.PLAIN:return qm(s,t,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:p,defaultStringType:u}=t.options,g=i&&p||u;if(l=c(g),l===null)throw Error(`Unsupported default string type ${g}`)}return l}jm.stringifyString=Fm});var Rt=h(function(Jm){var Hm=wr(),ve=P(),Vm=St(),zm=Ct();function Gm(e,t){let r=Object.assign({blockQuote:!0,commentString:Vm.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent==="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Km(e,t){if(t.tag){let i=e.filter((o)=>o.tag===t.tag);if(i.length>0)return i.find((o)=>o.format===t.format)??i[0]}let r=void 0,n;if(ve.isScalar(t)){n=t.value;let i=e.filter((o)=>o.identify?.(n));if(i.length>1){let o=i.filter((s)=>s.test);if(o.length>0)i=o}r=i.find((o)=>o.format===t.format)??i.find((o)=>!o.format)}else n=t,r=e.find((i)=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${i} value`)}return r}function Wm(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(ve.isScalar(e)||ve.isCollection(e))&&e.anchor;if(o&&Hm.anchorIsValid(o))r.add(o),i.push(`&${o}`);let s=e.tag??(t.default?null:t.tag);if(s)i.push(n.directives.tagString(s));return i.join(" ")}function Ym(e,t,r,n){if(ve.isPair(e))return e.toString(t,r,n);if(ve.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let i=void 0,o=ve.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>i=c});i??(i=Km(t.doc.schema.tags,o));let s=Wm(o,i,t);if(s.length>0)t.indentAtStart=(t.indentAtStart??0)+s.length+1;let a=typeof i.stringify==="function"?i.stringify(o,t,r,n):ve.isScalar(o)?zm.stringifyString(o,t,r,n):o.toString(t,r,n);if(!s)return a;return ve.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
35
|
+
${t.indent}${a}`}Jm.createStringifyContext=Gm;Jm.stringify=Ym});var Ga=h(function(ey){var pe=P(),Va=D(),za=Rt(),xt=St();function Zm({key:e,value:t},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:p,simpleKeys:u}}=r,g=pe.isNode(e)&&e.comment||null;if(u){if(g)throw Error("With simple keys, key nodes cannot have comments");if(pe.isCollection(e)||!pe.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let d=!u&&(!e||g&&t==null&&!r.inFlow||pe.isCollection(e)||(pe.isScalar(e)?e.type===Va.Scalar.BLOCK_FOLDED||e.type===Va.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!d&&(u||!o),indent:a+c});let m=!1,f=!1,y=za.stringify(e,r,()=>m=!0,()=>f=!0);if(!d&&!r.inFlow&&y.length>1024){if(u)throw Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(r.inFlow){if(o||t==null){if(m&&n)n();return y===""?"?":d?`? ${y}`:y}}else if(o&&!u||t==null&&d){if(y=`? ${y}`,g&&!m)y+=xt.lineComment(y,r.indent,l(g));else if(f&&i)i();return y}if(m)g=null;if(d){if(g)y+=xt.lineComment(y,r.indent,l(g));y=`? ${y}
|
|
36
|
+
${a}:`}else if(y=`${y}:`,g)y+=xt.lineComment(y,r.indent,l(g));let w,b,k;if(pe.isNode(t))w=!!t.spaceBefore,b=t.commentBefore,k=t.comment;else if(w=!1,b=null,k=null,t&&typeof t==="object")t=s.createNode(t);if(r.implicitKey=!1,!d&&!g&&pe.isScalar(t))r.indentAtStart=y.length+1;if(f=!1,!p&&c.length>=2&&!r.inFlow&&!d&&pe.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let R=!1,x=za.stringify(t,r,()=>R=!0,()=>f=!0),I=" ";if(g||w||b){if(I=w?`
|
|
37
|
+
`:"",b){let T=l(b);I+=`
|
|
38
|
+
${xt.indentComment(T,r.indent)}`}if(x===""&&!r.inFlow){if(I===`
|
|
39
|
+
`&&k)I=`
|
|
40
40
|
|
|
41
|
-
`}else
|
|
42
|
-
${r.indent}`}else if(!
|
|
43
|
-
`),
|
|
41
|
+
`}else I+=`
|
|
42
|
+
${r.indent}`}else if(!d&&pe.isCollection(t)){let T=x[0],C=x.indexOf(`
|
|
43
|
+
`),L=C!==-1,me=r.inFlow??t.flow??t.items.length===0;if(L||!me){let Fe=!1;if(L&&(T==="&"||T==="!")){let N=x.indexOf(" ");if(T==="&"&&N!==-1&&N<C&&x[N+1]==="!")N=x.indexOf(" ",N+1);if(N===-1||C<N)Fe=!0}if(!Fe)I=`
|
|
44
44
|
${r.indent}`}}else if(x===""||x[0]===`
|
|
45
|
-
`)
|
|
45
|
+
`)I="";if(y+=I+x,r.inFlow){if(R&&n)n()}else if(k&&!R)y+=xt.lineComment(y,r.indent,l(k));else if(f&&i)i();return y}ey.stringifyPair=Zm});var Vn=h(function(iy){var Ka=Gt("process");function ry(e,...t){if(e==="debug")console.log(...t)}function ny(e,t){if(e==="debug"||e==="warn")if(typeof Ka.emitWarning==="function")Ka.emitWarning(t);else console.warn(t)}iy.debug=ry;iy.warn=ny});var Pr=h(function(cy){var Er=P(),Wa=D(),Ir="<<",Ar={identify:(e)=>e===Ir||typeof e==="symbol"&&e.description===Ir,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Wa.Scalar(Symbol(Ir)),{addToJSMap:Ya}),stringify:()=>Ir},ay=(e,t)=>(Ar.identify(t)||Er.isScalar(t)&&(!t.type||t.type===Wa.Scalar.PLAIN)&&Ar.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===Ar.tag&&r.default);function Ya(e,t,r){let n=Ja(e,r);if(Er.isSeq(n))for(let i of n.items)zn(e,t,i);else if(Array.isArray(n))for(let i of n)zn(e,t,i);else zn(e,t,n)}function zn(e,t,r){let n=Ja(e,r);if(!Er.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[o,s]of i)if(t instanceof Map){if(!t.has(o))t.set(o,s)}else if(t instanceof Set)t.add(o);else if(!Object.prototype.hasOwnProperty.call(t,o))Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function Ja(e,t){return e&&Er.isAlias(t)?t.resolve(e.doc,e):t}cy.addMergeToJSMap=Ya;cy.isMergeKey=ay;cy.merge=Ar});var Kn=h(function(yy){var py=Vn(),Qa=Pr(),gy=Rt(),Xa=P(),Gn=be();function fy(e,t,{key:r,value:n}){if(Xa.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(Qa.isMergeKey(e,r))Qa.addMergeToJSMap(e,t,n);else{let i=Gn.toJS(r,"",e);if(t instanceof Map)t.set(i,Gn.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let o=my(r,i,e),s=Gn.toJS(n,o,e);if(o in t)Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});else t[o]=s}}return t}function my(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(Xa.isNode(e)&&r?.doc){let n=gy.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);if(o.length>40)o=o.substring(0,36)+'..."';py.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}yy.addPairToJSMap=fy});var Se=h(function(Sy){var Za=vt(),by=Ga(),wy=Kn(),Tr=P();function vy(e,t,r){let n=Za.createNode(e,void 0,r),i=Za.createNode(t,void 0,r);return new Or(n,i)}class Or{constructor(e,t=null){Object.defineProperty(this,Tr.NODE_TYPE,{value:Tr.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(Tr.isNode(t))t=t.clone(e);if(Tr.isNode(r))r=r.clone(e);return new Or(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return wy.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?by.stringifyPair(this,e,t,r):JSON.stringify(this)}}Sy.Pair=Or;Sy.createPair=vy});var Wn=h(function(Ay){var Le=P(),ec=Rt(),Dr=St();function Ry(e,t,r){return(t.inFlow??e.flow?Iy:xy)(e,t,r)}function xy({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,p=Object.assign({},r,{indent:o,type:null}),u=!1,g=[];for(let m=0;m<t.length;++m){let f=t[m],y=null;if(Le.isNode(f)){if(!u&&f.spaceBefore)g.push("");if(Lr(r,g,f.commentBefore,u),f.comment)y=f.comment}else if(Le.isPair(f)){let b=Le.isNode(f.key)?f.key:null;if(b){if(!u&&b.spaceBefore)g.push("");Lr(r,g,b.commentBefore,u)}}u=!1;let w=ec.stringify(f,p,()=>y=null,()=>u=!0);if(y)w+=Dr.lineComment(w,o,l(y));if(u&&y)u=!1;g.push(n+w)}let d;if(g.length===0)d=i.start+i.end;else{d=g[0];for(let m=1;m<g.length;++m){let f=g[m];d+=f?`
|
|
46
46
|
${c}${f}`:`
|
|
47
|
-
`}}if(e){if(
|
|
48
|
-
`+
|
|
49
|
-
`)),m<e.length-1)
|
|
50
|
-
${
|
|
47
|
+
`}}if(e){if(d+=`
|
|
48
|
+
`+Dr.indentComment(l(e),c),a)a()}else if(u&&s)s();return d}function Iy({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;n+=o;let c=Object.assign({},t,{indent:n,inFlow:!0,type:null}),l=!1,p=0,u=[];for(let m=0;m<e.length;++m){let f=e[m],y=null;if(Le.isNode(f)){if(f.spaceBefore)u.push("");if(Lr(t,u,f.commentBefore,!1),f.comment)y=f.comment}else if(Le.isPair(f)){let b=Le.isNode(f.key)?f.key:null;if(b){if(b.spaceBefore)u.push("");if(Lr(t,u,b.commentBefore,!1),b.comment)l=!0}let k=Le.isNode(f.value)?f.value:null;if(k){if(k.comment)y=k.comment;if(k.commentBefore)l=!0}else if(f.value==null&&b?.comment)y=b.comment}if(y)l=!0;let w=ec.stringify(f,c,()=>y=null);if(l||(l=u.length>p||w.includes(`
|
|
49
|
+
`)),m<e.length-1)w+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=u.reduce((b,k)=>b+k.length+2,2)+(w.length+2)>t.options.lineWidth);if(l)w+=","}if(y)w+=Dr.lineComment(w,n,a(y));u.push(w),p=u.length}let{start:g,end:d}=r;if(u.length===0)return g+d;else{if(!l){let m=u.reduce((f,y)=>f+y.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=g;for(let f of u)m+=f?`
|
|
50
|
+
${o}${i}${f}`:`
|
|
51
51
|
`;return`${m}
|
|
52
|
-
${i}${
|
|
53
|
-
`:" ")}return
|
|
54
|
-
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let
|
|
55
|
-
${s.comment}`:n.comment}n=i}e.items[r]=Mr.isPair(n)?n:new Zn.Pair(n)}else t("Expected a sequence for this tag");return e}function sc(e,t,r){let{replacer:n}=r,i=new xh.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,String(s++),o);let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;i.items.push(Zn.createPair(a,c,r))}return i}var Ih={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ic,createNode:sc};Ah.createPairs=sc;Ah.pairs=Ih;Ah.resolvePairs=ic});var ti=h(function(Lh){var oc=E(),ei=me(),xt=Se(),Oh=ve(),ac=$r();class Oe extends Oh.YAMLSeq{constructor(){super();this.add=xt.YAMLMap.prototype.add.bind(this),this.delete=xt.YAMLMap.prototype.delete.bind(this),this.get=xt.YAMLMap.prototype.get.bind(this),this.has=xt.YAMLMap.prototype.has.bind(this),this.set=xt.YAMLMap.prototype.set.bind(this),this.tag=Oe.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,s;if(oc.isPair(n))i=ei.toJS(n.key,"",t),s=ei.toJS(n.value,i,t);else i=ei.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,s)}return r}static from(e,t,r){let n=ac.createPairs(e,t,r),i=new this;return i.items=n.items,i}}Oe.tag="tag:yaml.org,2002:omap";var Dh={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=ac.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(oc.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new Oe,r)},createNode:(e,t,r)=>Oe.from(e,t,r)};Lh.YAMLOMap=Oe;Lh.omap=Dh});var pc=h(function(Mh){var cc=O();function lc({value:e,source:t},r){if(t&&(e?uc:dc).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var uc={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new cc.Scalar(!0),stringify:lc},dc={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new cc.Scalar(!1),stringify:lc};Mh.falseTag=dc;Mh.trueTag=uc});var gc=h(function(Hh){var qh=O(),ri=We(),Fh={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ri.stringifyNumber},jh={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():ri.stringifyNumber(e)}},Uh={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new qh.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:ri.stringifyNumber};Hh.float=Uh;Hh.floatExp=jh;Hh.floatNaN=Fh});var mc=h(function(Qh){var fc=We(),It=(e)=>typeof e==="bigint"||Number.isInteger(e);function Br(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let s=parseInt(e,r);return i==="-"?-1*s:s}function ni(e,t,r){let{value:n}=e;if(It(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return fc.stringifyNumber(e)}var Kh={identify:It,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Br(e,2,2,r),stringify:(e)=>ni(e,2,"0b")},Wh={identify:It,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Br(e,1,8,r),stringify:(e)=>ni(e,8,"0")},Yh={identify:It,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Br(e,0,10,r),stringify:fc.stringifyNumber},Jh={identify:It,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Br(e,2,16,r),stringify:(e)=>ni(e,16,"0x")};Qh.int=Yh;Qh.intBin=Kh;Qh.intHex=Jh;Qh.intOct=Wh});var ii=h(function(nb){var jr=E(),qr=be(),Fr=Se();class De extends Fr.YAMLMap{constructor(e){super(e);this.tag=De.tag}add(e){let t;if(jr.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new qr.Pair(e.key,null);else t=new qr.Pair(e,null);if(!Fr.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Fr.findPair(this.items,e);return!t&&jr.isPair(r)?jr.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Fr.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new qr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,s,s);i.items.push(qr.createPair(s,null,r))}return i}}De.tag="tag:yaml.org,2002:set";var rb={collection:"map",identify:(e)=>e instanceof Set,nodeClass:De,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>De.from(e,t,r),resolve(e,t){if(jr.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new De,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};nb.YAMLSet=De;nb.set=rb});var oi=h(function(lb){var ob=We();function si(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(o)=>t?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}function yc(e){let{value:t}=e,r=(o)=>o;if(typeof t==="bigint")r=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ob.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),s=[t%i];if(t<60)s.unshift(0);else if(t=(t-s[0])/i,s.unshift(t%i),t>=60)t=(t-s[0])/i,s.unshift(t);return n+s.map((o)=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ab={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>si(e,r),stringify:yc},cb={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>si(e,!1),stringify:yc},hc={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(hc.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,s||0,o||0,a||0,c),g=t[8];if(g&&g!=="Z"){let p=si(g,!1);if(Math.abs(p)<30)p*=60;l-=60000*p}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};lb.floatTime=cb;lb.intTime=ab;lb.timestamp=hc});var wc=h(function(kb){var gb=Ge(),fb=Lr(),mb=Ke(),yb=kt(),hb=Xn(),bc=pc(),ai=gc(),Ur=mc(),bb=xr(),wb=ti(),Sb=$r(),vb=ii(),ci=oi(),Cb=[gb.map,mb.seq,yb.string,fb.nullTag,bc.trueTag,bc.falseTag,Ur.intBin,Ur.intOct,Ur.int,Ur.intHex,ai.floatNaN,ai.floatExp,ai.float,hb.binary,bb.merge,wb.omap,Sb.pairs,vb.set,ci.intTime,ci.floatTime,ci.timestamp];kb.schema=Cb});var Pc=h(function(Db){var kc=Ge(),xb=Lr(),Rc=Ke(),Ib=kt(),Ab=Vn(),li=Gn(),ui=Wn(),Eb=tc(),Pb=nc(),xc=Xn(),At=xr(),Ic=ti(),Ac=$r(),Sc=wc(),Ec=ii(),Hr=oi(),vc=new Map([["core",Eb.schema],["failsafe",[kc.map,Rc.seq,Ib.string]],["json",Pb.schema],["yaml11",Sc.schema],["yaml-1.1",Sc.schema]]),Cc={binary:xc.binary,bool:Ab.boolTag,float:li.float,floatExp:li.floatExp,floatNaN:li.floatNaN,floatTime:Hr.floatTime,int:ui.int,intHex:ui.intHex,intOct:ui.intOct,intTime:Hr.intTime,map:kc.map,merge:At.merge,null:xb.nullTag,omap:Ic.omap,pairs:Ac.pairs,seq:Rc.seq,set:Ec.set,timestamp:Hr.timestamp},Tb={"tag:yaml.org,2002:binary":xc.binary,"tag:yaml.org,2002:merge":At.merge,"tag:yaml.org,2002:omap":Ic.omap,"tag:yaml.org,2002:pairs":Ac.pairs,"tag:yaml.org,2002:set":Ec.set,"tag:yaml.org,2002:timestamp":Hr.timestamp};function Ob(e,t,r){let n=vc.get(t);if(n&&!e)return r&&!n.includes(At.merge)?n.concat(At.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(vc.keys()).filter((o)=>o!=="yaml11").map((o)=>JSON.stringify(o)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)i=i.concat(s);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat(At.merge);return i.reduce((s,o)=>{let a=typeof o==="string"?Cc[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(Cc).map((g)=>JSON.stringify(g)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!s.includes(a))s.push(a);return s},[])}Db.coreKnownTags=Tb;Db.getTags=Ob});var gi=h(function(qb){var di=E(),_b=Ge(),Mb=Ke(),$b=kt(),Vr=Pc(),Bb=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class pi{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:s,toStringDefaults:o}){this.compat=Array.isArray(e)?Vr.getTags(e,"compat"):e?Vr.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Vr.coreKnownTags:{},this.tags=Vr.getTags(t,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,di.MAP,{value:_b.map}),Object.defineProperty(this,di.SCALAR,{value:$b.string}),Object.defineProperty(this,di.SEQ,{value:Mb.seq}),this.sortMapEntries=typeof s==="function"?s:s===!0?Bb:null}clone(){let e=Object.create(pi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}qb.Schema=pi});var Tc=h(function(Hb){var jb=E(),fi=St(),Et=ht();function Ub(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let i=fi.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=s(e.commentBefore);r.unshift(Et.indentComment(c,""))}let o=!1,a=null;if(e.contents){if(jb.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let g=s(e.contents.commentBefore);r.push(Et.indentComment(g,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>o=!0,l=fi.stringify(e.contents,i,()=>a=null,c);if(a)l+=Et.lineComment(l,"",s(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(fi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);if(c.includes(`
|
|
56
|
-
`))r.push("..."),r.push(
|
|
52
|
+
${i}${d}`}else return`${g}${s}${u.join(" ")}${s}${d}`}}function Lr({indent:e,options:{commentString:t}},r,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let o=Dr.indentComment(t(n),e);r.push(o.trimStart())}}Ay.stringifyCollection=Ry});var Ce=h(function(Ly){var Py=Wn(),Ty=Kn(),Oy=kr(),ke=P(),Nr=Se(),Dy=D();function It(e,t){let r=ke.isScalar(t)?t.value:t;for(let n of e)if(ke.isPair(n)){if(n.key===t||n.key===r)return n;if(ke.isScalar(n.key)&&n.key.value===r)return n}return}class tc extends Oy.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ke.MAP,e);this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:i}=r,o=new this(e),s=(a,c)=>{if(typeof i==="function")c=i.call(t,a,c);else if(Array.isArray(i)&&!i.includes(a))return;if(c!==void 0||n)o.items.push(Nr.createPair(a,c,r))};if(t instanceof Map)for(let[a,c]of t)s(a,c);else if(t&&typeof t==="object")for(let a of Object.keys(t))s(a,t[a]);if(typeof e.sortMapEntries==="function")o.items.sort(e.sortMapEntries);return o}add(e,t){let r;if(ke.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new Nr.Pair(e,e?.value);else r=new Nr.Pair(e.key,e.value);let n=It(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);if(ke.isScalar(n.value)&&Dy.isScalarValue(r.value))n.value.value=r.value;else n.value=r.value}else if(i){let o=this.items.findIndex((s)=>i(r,s)<0);if(o===-1)this.items.push(r);else this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=It(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=It(this.items,e)?.value;return(!t&&ke.isScalar(n)?n.value:n)??void 0}has(e){return!!It(this.items,e)}set(e,t){this.add(new Nr.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let i of this.items)Ty.addPairToJSMap(t,n,i);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!ke.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return Py.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}Ly.YAMLMap=tc;Ly.findPair=It});var Ye=h(function(By){var My=P(),rc=Ce(),$y={collection:"map",default:!0,nodeClass:rc.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!My.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>rc.YAMLMap.from(e,t,r)};By.map=$y});var Re=h(function(zy){var Fy=vt(),jy=Wn(),Uy=kr(),Mr=P(),Hy=D(),Vy=be();class nc extends Uy.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Mr.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=_r(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=_r(e);if(typeof r!=="number")return;let n=this.items[r];return!t&&Mr.isScalar(n)?n.value:n}has(e){let t=_r(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=_r(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];if(Mr.isScalar(n)&&Hy.isScalarValue(t))n.value=t;else this.items[r]=t}toJSON(e,t){let r=[];if(t?.onCreate)t.onCreate(r);let n=0;for(let i of this.items)r.push(Vy.toJS(i,String(n++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return jy.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t})}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let s of t){if(typeof n==="function"){let a=t instanceof Set?s:String(o++);s=n.call(t,a,s)}i.items.push(Fy.createNode(s,void 0,r))}}return i}}function _r(e){let t=Mr.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}zy.YAMLSeq=nc});var Je=h(function(Yy){var Ky=P(),ic=Re(),Wy={collection:"seq",default:!0,nodeClass:ic.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!Ky.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>ic.YAMLSeq.from(e,t,r)};Yy.seq=Wy});var At=h(function(Zy){var Qy=Ct(),Xy={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),Qy.stringifyString(e,t,r,n)}};Zy.string=Xy});var $r=h(function(th){var oc=D(),sc={identify:(e)=>e==null,createNode:()=>new oc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new oc.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&sc.test.test(e)?e:t.options.nullStr};th.nullTag=sc});var Yn=h(function(ih){var nh=D(),ac={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new nh.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&ac.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};ih.boolTag=ac});var Qe=h(function(ah){function sh({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n==="bigint")return String(n);let i=typeof n==="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");if(s<0)s=o.length,o+=".";let a=t-(o.length-s-1);while(a-- >0)o+="0"}return o}ah.stringifyNumber=sh});var Qn=h(function(gh){var lh=D(),Jn=Qe(),uh={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Jn.stringifyNumber},dh={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Jn.stringifyNumber(e)}},ph={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new lh.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:Jn.stringifyNumber};gh.float=ph;gh.floatExp=dh;gh.floatNaN=uh});var Zn=h(function(vh){var cc=Qe(),Br=(e)=>typeof e==="bigint"||Number.isInteger(e),Xn=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function lc(e,t,r){let{value:n}=e;if(Br(n)&&n>=0)return r+n.toString(t);return cc.stringifyNumber(e)}var hh={identify:(e)=>Br(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>Xn(e,2,8,r),stringify:(e)=>lc(e,8,"0o")},bh={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>Xn(e,0,10,r),stringify:cc.stringifyNumber},wh={identify:(e)=>Br(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>Xn(e,2,16,r),stringify:(e)=>lc(e,16,"0x")};vh.int=bh;vh.intHex=wh;vh.intOct=hh});var uc=h(function(Th){var Rh=Ye(),xh=$r(),Ih=Je(),Ah=At(),Eh=Yn(),ei=Qn(),ti=Zn(),Ph=[Rh.map,Ih.seq,Ah.string,xh.nullTag,Eh.boolTag,ti.intOct,ti.int,ti.intHex,ei.floatNaN,ei.floatExp,ei.float];Th.schema=Ph});var pc=h(function(Bh){var Dh=D(),Lh=Ye(),Nh=Je();function dc(e){return typeof e==="bigint"||Number.isInteger(e)}var qr=({value:e})=>JSON.stringify(e),_h=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:qr},{identify:(e)=>e==null,createNode:()=>new Dh.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:qr},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:qr},{identify:dc,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>dc(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:qr}],Mh={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},$h=[Lh.map,Nh.seq].concat(_h,Mh);Bh.schema=$h});var ni=h(function(Uh){var Et=Gt("buffer"),ri=D(),Fh=Ct(),jh={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Et.Buffer==="function")return Et.Buffer.from(e,"base64");else if(typeof atob==="function"){let r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof Et.Buffer==="function")a=s instanceof Et.Buffer?s.toString("base64"):Et.Buffer.from(s.buffer).toString("base64");else if(typeof btoa==="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ri.Scalar.BLOCK_LITERAL),t!==ri.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),p=Array(l);for(let u=0,g=0;u<l;++u,g+=c)p[u]=a.substr(g,c);a=p.join(t===ri.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Fh.stringifyString({comment:e,type:t,value:a},n,i,o)}};Uh.binary=jh});var jr=h(function(Kh){var Fr=P(),ii=Se(),Vh=D(),zh=Re();function gc(e,t){if(Fr.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(Fr.isPair(n))continue;else if(Fr.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new ii.Pair(new Vh.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
54
|
+
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment}
|
|
55
|
+
${o.comment}`:n.comment}n=i}e.items[r]=Fr.isPair(n)?n:new ii.Pair(n)}else t("Expected a sequence for this tag");return e}function fc(e,t,r){let{replacer:n}=r,i=new zh.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(o++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(ii.createPair(a,c,r))}return i}var Gh={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:gc,createNode:fc};Kh.createPairs=fc;Kh.pairs=Gh;Kh.resolvePairs=gc});var si=h(function(Zh){var mc=P(),oi=be(),Pt=Ce(),Qh=Re(),yc=jr();class Ne extends Qh.YAMLSeq{constructor(){super();this.add=Pt.YAMLMap.prototype.add.bind(this),this.delete=Pt.YAMLMap.prototype.delete.bind(this),this.get=Pt.YAMLMap.prototype.get.bind(this),this.has=Pt.YAMLMap.prototype.has.bind(this),this.set=Pt.YAMLMap.prototype.set.bind(this),this.tag=Ne.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,o;if(mc.isPair(n))i=oi.toJS(n.key,"",t),o=oi.toJS(n.value,i,t);else i=oi.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let n=yc.createPairs(e,t,r),i=new this;return i.items=n.items,i}}Ne.tag="tag:yaml.org,2002:omap";var Xh={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:Ne,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=yc.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(mc.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new Ne,r)},createNode:(e,t,r)=>Ne.from(e,t,r)};Zh.YAMLOMap=Ne;Zh.omap=Xh});var Sc=h(function(rb){var hc=D();function bc({value:e,source:t},r){if(t&&(e?wc:vc).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var wc={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new hc.Scalar(!0),stringify:bc},vc={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new hc.Scalar(!1),stringify:bc};rb.falseTag=vc;rb.trueTag=wc});var kc=h(function(lb){var ob=D(),ai=Qe(),sb={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ai.stringifyNumber},ab={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():ai.stringifyNumber(e)}},cb={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new ob.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:ai.stringifyNumber};lb.float=cb;lb.floatExp=ab;lb.floatNaN=sb});var Rc=h(function(hb){var Cc=Qe(),Tt=(e)=>typeof e==="bigint"||Number.isInteger(e);function Ur(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,r);return i==="-"?-1*o:o}function ci(e,t,r){let{value:n}=e;if(Tt(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return Cc.stringifyNumber(e)}var gb={identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Ur(e,2,2,r),stringify:(e)=>ci(e,2,"0b")},fb={identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Ur(e,1,8,r),stringify:(e)=>ci(e,8,"0")},mb={identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Ur(e,0,10,r),stringify:Cc.stringifyNumber},yb={identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Ur(e,2,16,r),stringify:(e)=>ci(e,16,"0x")};hb.int=mb;hb.intBin=gb;hb.intHex=yb;hb.intOct=fb});var li=h(function(Cb){var zr=P(),Hr=Se(),Vr=Ce();class _e extends Vr.YAMLMap{constructor(e){super(e);this.tag=_e.tag}add(e){let t;if(zr.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Hr.Pair(e.key,null);else t=new Hr.Pair(e,null);if(!Vr.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Vr.findPair(this.items,e);return!t&&zr.isPair(r)?zr.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Vr.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Hr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,o,o);i.items.push(Hr.createPair(o,null,r))}return i}}_e.tag="tag:yaml.org,2002:set";var kb={collection:"map",identify:(e)=>e instanceof Set,nodeClass:_e,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>_e.from(e,t,r),resolve(e,t){if(zr.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new _e,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};Cb.YAMLSet=_e;Cb.set=kb});var di=h(function(Pb){var Ib=Qe();function ui(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function xc(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Ib.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),o=[t%i];if(t<60)o.unshift(0);else if(t=(t-o[0])/i,o.unshift(t%i),t>=60)t=(t-o[0])/i,o.unshift(t);return n+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Ab={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>ui(e,r),stringify:xc},Eb={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>ui(e,!1),stringify:xc},Ic={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(Ic.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),p=t[8];if(p&&p!=="Z"){let u=ui(p,!1);if(Math.abs(u)<30)u*=60;l-=60000*u}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Pb.floatTime=Eb;Pb.intTime=Ab;Pb.timestamp=Ic});var Ec=h(function(Hb){var Lb=Ye(),Nb=$r(),_b=Je(),Mb=At(),$b=ni(),Ac=Sc(),pi=kc(),Gr=Rc(),Bb=Pr(),qb=si(),Fb=jr(),jb=li(),gi=di(),Ub=[Lb.map,_b.seq,Mb.string,Nb.nullTag,Ac.trueTag,Ac.falseTag,Gr.intBin,Gr.intOct,Gr.int,Gr.intHex,pi.floatNaN,pi.floatExp,pi.float,$b.binary,Bb.merge,qb.omap,Fb.pairs,jb.set,gi.intTime,gi.floatTime,gi.timestamp];Hb.schema=Ub});var Bc=h(function(Xb){var Dc=Ye(),zb=$r(),Lc=Je(),Gb=At(),Kb=Yn(),fi=Qn(),mi=Zn(),Wb=uc(),Yb=pc(),Nc=ni(),Ot=Pr(),_c=si(),Mc=jr(),Pc=Ec(),$c=li(),Kr=di(),Tc=new Map([["core",Wb.schema],["failsafe",[Dc.map,Lc.seq,Gb.string]],["json",Yb.schema],["yaml11",Pc.schema],["yaml-1.1",Pc.schema]]),Oc={binary:Nc.binary,bool:Kb.boolTag,float:fi.float,floatExp:fi.floatExp,floatNaN:fi.floatNaN,floatTime:Kr.floatTime,int:mi.int,intHex:mi.intHex,intOct:mi.intOct,intTime:Kr.intTime,map:Dc.map,merge:Ot.merge,null:zb.nullTag,omap:_c.omap,pairs:Mc.pairs,seq:Lc.seq,set:$c.set,timestamp:Kr.timestamp},Jb={"tag:yaml.org,2002:binary":Nc.binary,"tag:yaml.org,2002:merge":Ot.merge,"tag:yaml.org,2002:omap":_c.omap,"tag:yaml.org,2002:pairs":Mc.pairs,"tag:yaml.org,2002:set":$c.set,"tag:yaml.org,2002:timestamp":Kr.timestamp};function Qb(e,t,r){let n=Tc.get(t);if(n&&!e)return r&&!n.includes(Ot.merge)?n.concat(Ot.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(Tc.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat(Ot.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?Oc[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Oc).map((p)=>JSON.stringify(p)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!o.includes(a))o.push(a);return o},[])}Xb.coreKnownTags=Jb;Xb.getTags=Qb});var bi=h(function(ow){var yi=P(),tw=Ye(),rw=Je(),nw=At(),Wr=Bc(),iw=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class hi{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Wr.getTags(e,"compat"):e?Wr.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Wr.coreKnownTags:{},this.tags=Wr.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,yi.MAP,{value:tw.map}),Object.defineProperty(this,yi.SCALAR,{value:nw.string}),Object.defineProperty(this,yi.SEQ,{value:rw.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?iw:null}clone(){let e=Object.create(hi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}ow.Schema=hi});var qc=h(function(lw){var aw=P(),wi=Rt(),Dt=St();function cw(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let i=wi.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=o(e.commentBefore);r.unshift(Dt.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(aw.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let p=o(e.contents.commentBefore);r.push(Dt.indentComment(p,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=wi.stringify(e.contents,i,()=>a=null,c);if(a)l+=Dt.lineComment(l,"",o(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(wi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);if(c.includes(`
|
|
56
|
+
`))r.push("..."),r.push(Dt.indentComment(c,""));else r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;if(c&&s)c=c.replace(/^\n+/,"");if(c){if((!s||a)&&r[r.length-1]!=="")r.push("");r.push(Dt.indentComment(o(c),""))}}return r.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
59
|
-
`;
|
|
58
|
+
`}lw.stringifyDocument=cw});var Lt=h(function(bw){var dw=wt(),Xe=kr(),Z=P(),pw=Se(),gw=be(),fw=bi(),mw=qc(),vi=wr(),yw=qn(),hw=vt(),Si=Bn();class ki{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Z.NODE_TYPE,{value:Z.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t,t=void 0;let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;if(r?._directives){if(this.directives=r._directives.atDocument(),this.directives.yaml.explicit)o=this.directives.yaml.version}else this.directives=new Si.Directives({version:o});this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(ki.prototype,{[Z.NODE_TYPE]:{value:Z.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=Z.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(Ze(this.contents))this.contents.add(e)}addIn(e,t){if(Ze(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=vi.anchorNames(this);e.anchor=!t||r.has(t)?vi.findNewAnchor(t||"a",r):t}return new dw.Alias(e.anchor)}createNode(e,t,r){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let f=(w)=>typeof w==="number"||w instanceof String||w instanceof Number,y=t.filter(f).map(String);if(y.length>0)t=t.concat(y);n=t}else if(r===void 0&&t)r=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:c,tag:l}=r??{},{onAnchor:p,setAnchors:u,sourceObjects:g}=vi.createNodeAnchors(this,o||"a"),d={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:p,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:g},m=hw.createNode(e,l,d);if(s&&Z.isCollection(m))m.flow=!0;return u(),m}createPair(e,t,r={}){let n=this.createNode(e,null,r),i=this.createNode(t,null,r);return new pw.Pair(n,i)}delete(e){return Ze(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(Xe.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return Ze(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Z.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(Xe.isEmptyPath(e))return!t&&Z.isScalar(this.contents)?this.contents.value:this.contents;return Z.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Z.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(Xe.isEmptyPath(e))return this.contents!==void 0;return Z.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=Xe.collectionFromPath(this.schema,[e],t);else if(Ze(this.contents))this.contents.set(e,t)}setIn(e,t){if(Xe.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=Xe.collectionFromPath(this.schema,Array.from(e),t);else if(Ze(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let r;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Si.Directives({version:"1.1"});r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new Si.Directives({version:e});r={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;r=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new fw.Schema(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=gw.toJS(this.contents,t??"",s);if(typeof i==="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o==="function"?yw.applyReviver(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return mw.stringifyDocument(this,e)}}function Ze(e){if(Z.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}bw.Document=ki});var Nt=h(function(Sw){class Yr extends Error{constructor(e,t,r,n){super();this.name=e,this.code=r,this.message=n,this.pos=t}}class Fc extends Yr{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class jc extends Yr{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var vw=(e,t)=>(r)=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map((a)=>t.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80)s=s.substring(0,79)+"…";if(n>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`…
|
|
59
|
+
`;s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];if(c?.line===n&&c.col>i)a=Math.max(1,Math.min(c.col-i,80-o));let l=" ".repeat(o)+"^".repeat(a);r.message+=`:
|
|
60
60
|
|
|
61
|
-
${
|
|
61
|
+
${s}
|
|
62
62
|
${l}
|
|
63
|
-
`}};
|
|
64
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(
|
|
65
|
-
`+f.comment;else a.comment=f.comment;continue}if(f.newlineAfterProp||
|
|
66
|
-
`+k.comment;else
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+y.comment;else l.comment=y.comment;l.range=[n.offset,f,y.offset]}else l.range=[n.offset,f,f];return l}
|
|
71
|
-
`.repeat(Math.max(1,
|
|
72
|
-
`;for(let f=
|
|
73
|
-
`;else if(y.length>c||
|
|
74
|
-
`;else if(!
|
|
75
|
-
`)
|
|
63
|
+
`}};Sw.YAMLError=Yr;Sw.YAMLParseError=Fc;Sw.YAMLWarning=jc;Sw.prettifyError=vw});var _t=h(function(Aw){function Iw(e,{flow:t,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,p=a,u="",g="",d=!1,m=!1,f=null,y=null,w=null,b=null,k=null,R=null,x=null;for(let C of e){if(m){if(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma")o(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");m=!1}if(f){if(l&&C.type!=="comment"&&C.type!=="newline")o(f,"TAB_AS_INDENT","Tabs are not allowed as indentation");f=null}switch(C.type){case"space":if(!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes("\t"))f=C;p=!0;break;case"comment":{if(!p)o(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=C.source.substring(1)||" ";if(!u)u=L;else u+=g+L;g="",l=!1;break}case"newline":if(l){if(u)u+=C.source;else if(!R||r!=="seq-item-ind")c=!0}else g+=C.source;if(l=!0,d=!0,y||w)b=C;p=!0;break;case"anchor":if(y)o(C,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(C.source.endsWith(":"))o(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);y=C,x??(x=C.offset),l=!1,p=!1,m=!0;break;case"tag":{if(w)o(C,"MULTIPLE_TAGS","A node can have at most one tag");w=C,x??(x=C.offset),l=!1,p=!1,m=!0;break}case r:if(y||w)o(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`);if(R)o(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`);R=C,l=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(t){if(k)o(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);k=C,l=!1,p=!1;break}default:o(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),l=!1,p=!1}}let I=e[e.length-1],T=I?I.offset+I.source.length:i;if(m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(f&&(l&&f.indent<=s||n?.type==="block-map"||n?.type==="block-seq"))o(f,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:k,found:R,spaceBefore:c,comment:u,hasNewline:d,anchor:y,tag:w,newlineAfterProp:b,end:T,start:x??T}}Aw.resolveProps=Iw});var Jr=h(function(Pw){function Ci(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
64
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(Ci(t.key)||Ci(t.value))return!0}return!1;default:return!0}}Pw.containsNewline=Ci});var Ri=h(function(Lw){var Ow=Jr();function Dw(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&Ow.containsNewline(t))r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Lw.flowIndentCheck=Dw});var xi=h(function(Mw){var Uc=P();function _w(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(o,s)=>o===s||Uc.isScalar(o)&&Uc.isScalar(s)&&o.value===s.value;return t.some((o)=>i(o.key,r))}Mw.mapIncludes=_w});var Kc=h(function(Uw){var Hc=Se(),Bw=Ce(),Vc=_t(),qw=Jr(),zc=Ri(),Fw=xi(),Gc="All mapping items must start at the same column";function jw({composeNode:e,composeEmptyNode:t},r,n,i,o){let a=new(o?.nodeClass??Bw.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=n.offset,l=null;for(let p of n.items){let{start:u,key:g,sep:d,value:m}=p,f=Vc.resolveProps(u,{indicator:"explicit-key-ind",next:g??d?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),y=!f.found;if(y){if(g){if(g.type==="block-seq")i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in g&&g.indent!==n.indent)i(c,"BAD_INDENT",Gc)}if(!f.anchor&&!f.tag&&!d){if(l=f.end,f.comment)if(a.comment)a.comment+=`
|
|
65
|
+
`+f.comment;else a.comment=f.comment;continue}if(f.newlineAfterProp||qw.containsNewline(g))i(g??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(f.found?.indent!==n.indent)i(c,"BAD_INDENT",Gc);r.atKey=!0;let w=f.end,b=g?e(r,g,f,i):t(r,w,u,null,f,i);if(r.schema.compat)zc.flowIndentCheck(n.indent,g,i);if(r.atKey=!1,Fw.mapIncludes(r,a.items,b))i(w,"DUPLICATE_KEY","Map keys must be unique");let k=Vc.resolveProps(d??[],{indicator:"map-value-ind",next:m,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!g||g.type==="block-scalar"});if(c=k.end,k.found){if(y){if(m?.type==="block-map"&&!k.hasNewline)i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&f.start<k.found.offset-1024)i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let R=m?e(r,m,k,i):t(r,c,d,null,k,i);if(r.schema.compat)zc.flowIndentCheck(n.indent,m,i);c=R.range[2];let x=new Hc.Pair(b,R);if(r.options.keepSourceTokens)x.srcToken=p;a.items.push(x)}else{if(y)i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(k.comment)if(b.comment)b.comment+=`
|
|
66
|
+
`+k.comment;else b.comment=k.comment;let R=new Hc.Pair(b);if(r.options.keepSourceTokens)R.srcToken=p;a.items.push(R)}}if(l&&l<c)i(l,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,c,l??c],a}Uw.resolveBlockMap=jw});var Wc=h(function(Ww){var Vw=Re(),zw=_t(),Gw=Ri();function Kw({composeNode:e,composeEmptyNode:t},r,n,i,o){let a=new(o?.nodeClass??Vw.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=n.offset,l=null;for(let{start:p,value:u}of n.items){let g=zw.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||u)if(u?.type==="block-seq")i(g.end,"BAD_INDENT","All sequence items must start at the same column");else i(c,"MISSING_CHAR","Sequence item without - indicator");else{if(l=g.end,g.comment)a.comment=g.comment;continue}let d=u?e(r,u,g,i):t(r,g.end,p,null,g,i);if(r.schema.compat)Gw.flowIndentCheck(n.indent,u,i);c=d.range[2],a.items.push(d)}return a.range=[n.offset,c,l??c],a}Ww.resolveBlockSeq=Kw});var et=h(function(Qw){function Jw(e,t,r,n){let i="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{if(r&&!o)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";if(!i)i=p;else i+=s+p;s="";break}case"newline":if(i)s+=c;o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Qw.resolveEnd=Jw});var Qc=h(function(sv){var Zw=P(),ev=Se(),Yc=Ce(),tv=Re(),rv=et(),Jc=_t(),nv=Jr(),iv=xi(),Ii="Block collections are not allowed within flow collections",Ai=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function ov({composeNode:e,composeEmptyNode:t},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",l=new(o?.nodeClass??(s?Yc.YAMLMap:tv.YAMLSeq))(r.schema);l.flow=!0;let p=r.atRoot;if(p)r.atRoot=!1;if(r.atKey)r.atKey=!1;let u=n.offset+n.start.source.length;for(let y=0;y<n.items.length;++y){let w=n.items[y],{start:b,key:k,sep:R,value:x}=w,I=Jc.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:k??R?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!R&&!x){if(y===0&&I.comma)i(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(y<n.items.length-1)i(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(I.comment)if(l.comment)l.comment+=`
|
|
67
|
+
`+I.comment;else l.comment=I.comment;u=I.end;continue}if(!s&&r.options.strict&&nv.containsNewline(k))i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0){if(I.comma)i(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!I.comma)i(I.start,"MISSING_CHAR",`Missing , between ${a} items`);if(I.comment){let T="";e:for(let C of b)switch(C.type){case"comma":case"space":break;case"comment":T=C.source.substring(1);break e;default:break e}if(T){let C=l.items[l.items.length-1];if(Zw.isPair(C))C=C.value??C.key;if(C.comment)C.comment+=`
|
|
68
|
+
`+T;else C.comment=T;I.comment=I.comment.substring(T.length+1)}}}if(!s&&!R&&!I.found){let T=x?e(r,x,I,i):t(r,I.end,R,null,I,i);if(l.items.push(T),u=T.range[2],Ai(x))i(T.range,"BLOCK_IN_FLOW",Ii)}else{r.atKey=!0;let T=I.end,C=k?e(r,k,I,i):t(r,T,b,null,I,i);if(Ai(k))i(C.range,"BLOCK_IN_FLOW",Ii);r.atKey=!1;let L=Jc.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:x,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(L.found){if(!s&&!I.found&&r.options.strict){if(R)for(let N of R){if(N===L.found)break;if(N.type==="newline"){i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(I.start<L.found.offset-1024)i(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(x)if("source"in x&&x.source?.[0]===":")i(x,"MISSING_CHAR",`Missing space after : in ${a}`);else i(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let me=x?e(r,x,L,i):L.found?t(r,L.end,R,null,L,i):null;if(me){if(Ai(x))i(me.range,"BLOCK_IN_FLOW",Ii)}else if(L.comment)if(C.comment)C.comment+=`
|
|
69
|
+
`+L.comment;else C.comment=L.comment;let Fe=new ev.Pair(C,me);if(r.options.keepSourceTokens)Fe.srcToken=w;if(s){let N=l;if(iv.mapIncludes(r,N.items,C))i(T,"DUPLICATE_KEY","Map keys must be unique");N.items.push(Fe)}else{let N=new Yc.YAMLMap(r.schema);N.flow=!0,N.items.push(Fe);let fo=(me??C).range;N.range=[C.range[0],fo[1],fo[2]],l.items.push(N)}u=me?me.range[2]:L.end}}let g=s?"}":"]",[d,...m]=n.end,f=u;if(d?.source===g)f=d.offset+d.source.length;else{let y=a[0].toUpperCase()+a.substring(1),w=p?`${y} must end with a ${g}`:`${y} in block collection must be sufficiently indented and end with a ${g}`;if(i(u,p?"MISSING_CHAR":"BAD_INDENT",w),d&&d.source.length!==1)m.unshift(d)}if(m.length>0){let y=rv.resolveEnd(m,f,r.options.strict,i);if(y.comment)if(l.comment)l.comment+=`
|
|
70
|
+
`+y.comment;else l.comment=y.comment;l.range=[n.offset,f,y.offset]}else l.range=[n.offset,f,f];return l}sv.resolveFlowCollection=ov});var Xc=h(function(yv){var cv=P(),lv=D(),uv=Ce(),dv=Re(),pv=Kc(),gv=Wc(),fv=Qc();function Ei(e,t,r,n,i,o){let s=r.type==="block-map"?pv.resolveBlockMap(e,t,r,n,o):r.type==="block-seq"?gv.resolveBlockSeq(e,t,r,n,o):fv.resolveFlowCollection(e,t,r,n,o),a=s.constructor;if(i==="!"||i===a.tagName)return s.tag=a.tagName,s;if(i)s.tag=i;return s}function mv(e,t,r,n,i){let o=n.tag,s=!o?null:t.directives.tagName(o.source,(g)=>i(o,"TAG_RESOLVE_FAILED",g));if(r.type==="block-seq"){let{anchor:g,newlineAfterProp:d}=n,m=g&&o?g.offset>o.offset?g:o:g??o;if(m&&(!d||d.offset<m.offset))i(m,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===uv.YAMLMap.tagName&&a==="map"||s===dv.YAMLSeq.tagName&&a==="seq")return Ei(e,t,r,i,s);let c=t.schema.tags.find((g)=>g.tag===s&&g.collection===a);if(!c){let g=t.schema.knownTags[s];if(g?.collection===a)t.schema.tags.push(Object.assign({},g,{default:!1})),c=g;else{if(g)i(o,"BAD_COLLECTION_TYPE",`${g.tag} used for ${a} collection, but expects ${g.collection??"scalar"}`,!0);else i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0);return Ei(e,t,r,i,s)}}let l=Ei(e,t,r,i,s,c),p=c.resolve?.(l,(g)=>i(o,"TAG_RESOLVE_FAILED",g),t.options)??l,u=cv.isNode(p)?p:new lv.Scalar(p);if(u.range=l.range,u.tag=s,c?.format)u.format=c.format;return u}yv.composeCollection=mv});var Ti=h(function(Sv){var Pi=D();function bv(e,t,r){let n=t.offset,i=wv(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?Pi.Scalar.BLOCK_FOLDED:Pi.Scalar.BLOCK_LITERAL,s=t.source?vv(t.source):[],a=s.length;for(let f=s.length-1;f>=0;--f){let y=s[f][1];if(y===""||y==="\r")a=f;else break}if(a===0){let f=i.chomp==="+"&&s.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,s.length-1)):"",y=n+i.length;if(t.source)y+=t.source.length;return{value:f,type:o,comment:i.comment,range:[n,y,y]}}let c=t.indent+i.indent,l=t.offset+i.length,p=0;for(let f=0;f<a;++f){let[y,w]=s[f];if(w===""||w==="\r"){if(i.indent===0&&y.length>c)c=y.length}else{if(y.length<c)r(l+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)c=y.length;if(p=f,c===0&&!e.atRoot)r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=y.length+w.length+1}for(let f=s.length-1;f>=a;--f)if(s[f][0].length>c)a=f+1;let u="",g="",d=!1;for(let f=0;f<p;++f)u+=s[f][0].slice(c)+`
|
|
72
|
+
`;for(let f=p;f<a;++f){let[y,w]=s[f];l+=y.length+w.length+1;let b=w[w.length-1]==="\r";if(b)w=w.slice(0,-1);if(w&&y.length<c){let R=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-w.length-(b?2:1),"BAD_INDENT",R),y=""}if(o===Pi.Scalar.BLOCK_LITERAL)u+=g+y.slice(c)+w,g=`
|
|
73
|
+
`;else if(y.length>c||w[0]==="\t"){if(g===" ")g=`
|
|
74
|
+
`;else if(!d&&g===`
|
|
75
|
+
`)g=`
|
|
76
76
|
|
|
77
|
-
`;
|
|
78
|
-
`,
|
|
79
|
-
`)
|
|
80
|
-
`;else
|
|
81
|
-
`;else
|
|
82
|
-
`+
|
|
83
|
-
`)
|
|
84
|
-
`;break;default:
|
|
85
|
-
`}let m=n+i.length+t.source.length;return{value:
|
|
86
|
-
`)s
|
|
87
|
-
`;else s
|
|
77
|
+
`;u+=g+y.slice(c)+w,g=`
|
|
78
|
+
`,d=!0}else if(w==="")if(g===`
|
|
79
|
+
`)u+=`
|
|
80
|
+
`;else g=`
|
|
81
|
+
`;else u+=g+w,g=" ",d=!1}switch(i.chomp){case"-":break;case"+":for(let f=a;f<s.length;++f)u+=`
|
|
82
|
+
`+s[f][0].slice(c);if(u[u.length-1]!==`
|
|
83
|
+
`)u+=`
|
|
84
|
+
`;break;default:u+=`
|
|
85
|
+
`}let m=n+i.length+t.source.length;return{value:u,type:o,comment:i.comment,range:[n,m,m]}}function wv({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],o=i[0],s=0,a="",c=-1;for(let g=1;g<i.length;++g){let d=i[g];if(!a&&(d==="-"||d==="+"))a=d;else{let m=Number(d);if(!s&&m)s=m;else if(c===-1)c=e+g}}if(c!==-1)n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,p="",u=i.length;for(let g=1;g<t.length;++g){let d=t[g];switch(d.type){case"space":l=!0;case"newline":u+=d.source.length;break;case"comment":if(r&&!l)n(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");u+=d.source.length,p=d.source.substring(1);break;case"error":n(d,"UNEXPECTED_TOKEN",d.message),u+=d.source.length;break;default:{let m=`Unexpected token in block scalar header: ${d.type}`;n(d,"UNEXPECTED_TOKEN",m);let f=d.source;if(f&&typeof f==="string")u+=f.length}}}return{mode:o,indent:s,chomp:a,comment:p,length:u}}function vv(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}Sv.resolveBlockScalar=bv});var Di=h(function(Ov){var Oi=D(),Cv=et();function Rv(e,t,r){let{offset:n,type:i,source:o,end:s}=e,a,c,l=(g,d,m)=>r(n+g,d,m);switch(i){case"scalar":a=Oi.Scalar.PLAIN,c=xv(o,l);break;case"single-quoted-scalar":a=Oi.Scalar.QUOTE_SINGLE,c=Iv(o,l);break;case"double-quoted-scalar":a=Oi.Scalar.QUOTE_DOUBLE,c=Av(o,l);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let p=n+o.length,u=Cv.resolveEnd(s,p,t,r);return{value:c,type:a,comment:u.comment,range:[n,p,u.offset]}}function xv(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}if(r)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return Zc(e)}function Iv(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return Zc(e.slice(1,-1)).replace(/''/g,"'")}function Zc(e){let t=/(.*?)\r?\n/sy,r=t.exec(e);if(!r)return e;let n,i;try{n=new RegExp("(?<![ \t])[ \t]+$"),i=new RegExp("^[ \t]+|(?<![ \t])[ \t]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let o=r[1].replace(n,""),s=" ",a=t.lastIndex;while(r=t.exec(e)){let l=r[1].replace(i,"");if(l==="")if(s===`
|
|
86
|
+
`)o+=s;else s=`
|
|
87
|
+
`;else o+=s+l,s=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),o+s+(r?.[1]??"")}function Av(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
|
|
88
88
|
`)continue;if(i===`
|
|
89
|
-
`){let{fold:
|
|
90
|
-
`){
|
|
91
|
-
`){
|
|
92
|
-
`&&!(
|
|
93
|
-
`))r+=n>
|
|
89
|
+
`){let{fold:o,offset:s}=Ev(e,n);r+=o,n=s}else if(i==="\\"){let o=e[++n],s=Pv[o];if(s)r+=s;else if(o===`
|
|
90
|
+
`){o=e[n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="\r"&&e[n+1]===`
|
|
91
|
+
`){o=e[++n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=Tv(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i==="\t"){let o=n,s=e[n+1];while(s===" "||s==="\t")s=e[++n+1];if(s!==`
|
|
92
|
+
`&&!(s==="\r"&&e[n+2]===`
|
|
93
|
+
`))r+=n>o?e.slice(o,n+1):i}else r+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function Ev(e,t){let r="",n=e[t+1];while(n===" "||n==="\t"||n===`
|
|
94
94
|
`||n==="\r"){if(n==="\r"&&e[t+2]!==`
|
|
95
95
|
`)break;if(n===`
|
|
96
96
|
`)r+=`
|
|
97
|
-
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var
|
|
98
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
97
|
+
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var Pv={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
98
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Tv(e,t,r,n){let i=e.substr(t,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Ov.resolveFlowScalar=Rv});var tl=h(function(Bv){var Me=P(),el=D(),Lv=Ti(),Nv=Di();function _v(e,t,r,n){let{value:i,type:o,comment:s,range:a}=t.type==="block-scalar"?Lv.resolveBlockScalar(e,t,n):Nv.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,(u)=>n(r,"TAG_RESOLVE_FAILED",u)):null,l;if(e.options.stringKeys&&e.atKey)l=e.schema[Me.SCALAR];else if(c)l=Mv(e.schema,i,c,r,n);else if(t.type==="scalar")l=$v(e,i,t,n);else l=e.schema[Me.SCALAR];let p;try{let u=l.resolve(i,(g)=>n(r??t,"TAG_RESOLVE_FAILED",g),e.options);p=Me.isScalar(u)?u:new el.Scalar(u)}catch(u){let g=u instanceof Error?u.message:String(u);n(r??t,"TAG_RESOLVE_FAILED",g),p=new el.Scalar(i)}if(p.range=a,p.source=i,o)p.type=o;if(c)p.tag=c;if(l.format)p.format=l.format;if(s)p.comment=s;return p}function Mv(e,t,r,n,i){if(r==="!")return e[Me.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[r];if(s&&!s.collection)return e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[Me.SCALAR]}function $v({atKey:e,directives:t,schema:r},n,i,o){let s=r.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[Me.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(n))??r[Me.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),p=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",p,!0)}}return s}Bv.composeScalar=_v});var rl=h(function(jv){function Fv(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}jv.emptyScalarPosition=Fv});var ol=h(function(Jv){var Hv=wt(),Vv=P(),zv=Xc(),nl=tl(),Gv=et(),Kv=rl(),Wv={composeNode:il,composeEmptyNode:Li};function il(e,t,r,n){let i=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,p=!0;switch(t.type){case"alias":if(l=Yv(e,t,n),a||c)n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(l=nl.composeScalar(e,t,c,n),a)l.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(l=zv.composeCollection(Wv,e,t,r,n),a)l.anchor=a.source.substring(1)}catch(u){let g=u instanceof Error?u.message:String(u);n(t,"RESOURCE_EXHAUSTION",g)}break;default:{let u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",u),p=!1}}if(l??(l=Li(e,t.offset,void 0,null,r,n)),a&&l.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!Vv.isScalar(l)||typeof l.value!=="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str"))n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(o)l.spaceBefore=!0;if(s)if(t.type==="scalar"&&t.source==="")l.comment=s;else l.commentBefore=s;if(e.options.keepSourceTokens&&p)l.srcToken=t;return l}function Li(e,t,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let p={type:"scalar",offset:Kv.emptyScalarPosition(t,r,n),indent:-1,source:""},u=nl.composeScalar(e,p,a,l);if(s){if(u.anchor=s.source.substring(1),u.anchor==="")l(s,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)u.spaceBefore=!0;if(o)u.comment=o,u.range[2]=c;return u}function Yv({options:e},{offset:t,source:r,end:n},i){let o=new Hv.Alias(r.substring(1));if(o.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(o.source.endsWith(":"))i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,a=Gv.resolveEnd(n,s,e.strict,i);if(o.range=[t,s,a.offset],a.comment)o.comment=a.comment;return o}Jv.composeEmptyNode=Li;Jv.composeNode=il});var al=h(function(nS){var Zv=Lt(),sl=ol(),eS=et(),tS=_t();function rS(e,t,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:t},e),c=new Zv.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=tS.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});if(p.found){if(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline)s(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=i?sl.composeNode(l,i,p,s):sl.composeEmptyNode(l,p.end,n,null,p,s);let u=c.contents.range[2],g=eS.resolveEnd(o,u,!1,s);if(g.comment)c.comment=g.comment;return c.range=[r,u,g.offset],c}nS.composeDoc=rS});var Ni=h(function(uS){var oS=Gt("process"),sS=Bn(),aS=Lt(),Mt=Nt(),cl=P(),cS=al(),lS=et();function $t(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+(typeof r==="string"?r.length:1)]}function ll(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let o=e[i];switch(o[0]){case"#":t+=(t===""?"":n?`
|
|
99
99
|
|
|
100
100
|
`:`
|
|
101
|
-
`)+(
|
|
102
|
-
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(
|
|
103
|
-
${
|
|
104
|
-
${
|
|
105
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
101
|
+
`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;r=!1;break;default:if(!r)n=!0;r=!1}}return{comment:t,afterEmptyLine:n}}class ul{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,i)=>{let o=$t(t);if(i)this.warnings.push(new Mt.YAMLWarning(o,r,n));else this.errors.push(new Mt.YAMLParseError(o,r,n))},this.directives=new sS.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=ll(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
102
|
+
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(cl.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];if(cl.isPair(o))o=o.key;let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
103
|
+
${s}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
|
|
104
|
+
${o}`:r}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ll(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){if(oS.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let i=$t(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=cS.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Mt.YAMLParseError($t(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new Mt.YAMLParseError($t(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=lS.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
105
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Mt.YAMLParseError($t(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new aS.Document(void 0,r);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}uS.Composer=ul});var gl=h(function(wS){var pS=Ti(),gS=Di(),fS=Nt(),dl=Ct();function mS(e,t=!0,r){if(e){let n=(i,o,s)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new fS.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gS.resolveFlowScalar(e,t,n);case"block-scalar":return pS.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function yS(e,t){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=t,a=dl.stringifyString({type:s,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
106
106
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
107
|
-
`),
|
|
108
|
-
`,
|
|
109
|
-
`});return{type:"block-scalar",offset:
|
|
107
|
+
`),p=a.substring(0,l),u=a.substring(l+1)+`
|
|
108
|
+
`,g=[{type:"block-scalar-header",offset:o,indent:n,source:p}];if(!pl(g,c))g.push({type:"newline",offset:-1,indent:n,source:`
|
|
109
|
+
`});return{type:"block-scalar",offset:o,indent:n,props:g,source:u}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function hS(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=dl.stringifyString({type:s,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":bS(e,c);break;case'"':_i(e,c,"double-quoted-scalar");break;case"'":_i(e,c,"single-quoted-scalar");break;default:_i(e,c,"scalar")}}function bS(e,t){let r=t.indexOf(`
|
|
110
110
|
`),n=t.substring(0,r),i=t.substring(r+1)+`
|
|
111
|
-
`;if(e.type==="block-scalar"){let
|
|
112
|
-
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:
|
|
113
|
-
`};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((
|
|
111
|
+
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw Error("Invalid block scalar header");o.source=n,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];if(!pl(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:s,source:`
|
|
112
|
+
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function pl(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function _i(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(let o of n)o.offset+=i;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
113
|
+
`};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((o)=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))if(o!=="type"&&o!=="offset")delete e[o];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}wS.createScalarToken=yS;wS.resolveAsScalar=mS;wS.setScalarValue=hS});var fl=h(function(RS){var CS=(e)=>("type"in e)?Xr(e):Qr(e);function Xr(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=Xr(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=Qr(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=Qr(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=Qr(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function Qr({start:e,key:t,sep:r,value:n}){let i="";for(let o of e)i+=o.source;if(t)i+=Xr(t);if(r)for(let o of r)i+=o.source;if(n)i+=Xr(n);return i}RS.stringify=CS});var hl=h(function(AS){var Mi=Symbol("break visit"),IS=Symbol("skip children"),ml=Symbol("remove item");function $e(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};yl(Object.freeze([]),e,t)}$e.BREAK=Mi;$e.SKIP=IS;$e.REMOVE=ml;$e.itemAtPath=(e,t)=>{let r=e;for(let[n,i]of t){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};$e.parentCollection=(e,t)=>{let r=$e.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function yl(e,t,r){let n=r(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let o=t[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=yl(Object.freeze(e.concat([[i,s]])),o.items[s],r);if(typeof a==="number")s=a-1;else if(a===Mi)return Mi;else if(a===ml)o.items.splice(s,1),s-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}AS.visit=$e});var Zr=h(function(_S){var $i=gl(),PS=fl(),TS=hl(),Bi="\uFEFF",qi="\x02",Fi="\x18",ji="\x1F",OS=(e)=>!!e&&("items"in e),DS=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function LS(e){switch(e){case Bi:return"<BOM>";case qi:return"<DOC>";case Fi:return"<FLOW_END>";case ji:return"<SCALAR>";default:return JSON.stringify(e)}}function NS(e){switch(e){case Bi:return"byte-order-mark";case qi:return"doc-mode";case Fi:return"flow-error-end";case ji:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
114
114
|
`:case`\r
|
|
115
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
116
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
117
|
-
\r `)
|
|
115
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}_S.createScalarToken=$i.createScalarToken;_S.resolveAsScalar=$i.resolveAsScalar;_S.setScalarValue=$i.setScalarValue;_S.stringify=PS.stringify;_S.visit=TS.visit;_S.BOM=Bi;_S.DOCUMENT=qi;_S.FLOW_END=Fi;_S.SCALAR=ji;_S.isCollection=OS;_S.isScalar=DS;_S.prettyToken=LS;_S.tokenType=NS});var Hi=h(function(QS){var Bt=Zr();function ne(e){switch(e){case void 0:case" ":case`
|
|
116
|
+
`:case"\r":case"\t":return!0;default:return!1}}var bl=new Set("0123456789ABCDEFabcdef"),YS=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),en=new Set(",[]{}"),JS=new Set(` ,[]{}
|
|
117
|
+
\r `),Ui=(e)=>!e||JS.has(e);class wl{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";while(r&&(t||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
118
118
|
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
119
119
|
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;while(t===" ")t=this.buffer[++r+e];if(t==="\r"){let n=this.buffer[r+e+1];if(n===`
|
|
120
120
|
`||!n&&!this.atEnd)return e+r+1}return t===`
|
|
121
|
-
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&
|
|
122
|
-
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
121
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ne(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&e<this.pos)e=this.buffer.indexOf(`
|
|
122
|
+
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Bt.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,r=e.indexOf("#");while(r!==-1){let i=e[r-1];if(i===" "||i==="\t"){t=r-1;break}else r=e.indexOf("#",r+1)}while(!0){let i=e[t-1];if(i===" "||i==="\t")t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Bt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&ne(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ne(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ne(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ui),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=r=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if(r!==-1&&r<this.indentNext&&n[0]!=="#"||r===0&&(n.startsWith("---")||n.startsWith("..."))&&ne(n[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Bt.FLOW_END,yield*this.parseLineStart()}let i=0;while(n[i]===",")i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),n[i]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ui),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ne(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")while(t!==-1&&this.buffer[t+1]==="'")t=this.buffer.indexOf("'",t+2);else while(t!==-1){let i=0;while(this.buffer[t-1-i]==="\\")i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf(`
|
|
123
123
|
`,this.pos);if(n!==-1){while(n!==-1){let i=this.continueScalar(n+1);if(i===-1)break;n=r.indexOf(`
|
|
124
|
-
`,i)}if(n!==-1)t=n-(r[n-1]==="\r"?2:1)}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;while(!0){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((t)=>
|
|
125
|
-
`:e=i,t=0;break;case"\r":{let
|
|
124
|
+
`,i)}if(n!==-1)t=n-(r[n-1]==="\r"?2:1)}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;while(!0){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((t)=>ne(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
|
|
125
|
+
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
126
126
|
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
127
127
|
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;r=this.buffer[n];while(r===" ")r=this.buffer[++n];if(r==="\t"){while(r==="\t"||r===" "||r==="\r"||r===`
|
|
128
|
-
`)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,
|
|
129
|
-
`&&i>=this.pos&&i+1+t>
|
|
128
|
+
`)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];if(o==="\r")o=this.buffer[--i];let s=i;while(o===" ")o=this.buffer[--i];if(o===`
|
|
129
|
+
`&&i>=this.pos&&i+1+t>s)e=i;else break}while(!0);return yield Bt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,n;while(n=this.buffer[++r])if(n===":"){let i=this.buffer[r+1];if(ne(i)||e&&en.has(i))break;t=r}else if(ne(n)){let i=this.buffer[r+1];if(n==="\r")if(i===`
|
|
130
130
|
`)r+=1,n=`
|
|
131
|
-
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&
|
|
132
|
-
`){let
|
|
131
|
+
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&en.has(i))break;if(n===`
|
|
132
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&en.has(n))break;t=r}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Bt.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);if(r)return yield r,this.pos+=r.length,r.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Ui),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(ne(r)||t&&en.has(r)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!ne(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(YS.has(t))t=this.buffer[++e];else if(t==="%"&&bl.has(this.buffer[e+1])&&bl.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
|
|
133
133
|
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
134
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}
|
|
134
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}QS.Lexer=wl});var Vi=h(function(ZS){class vl{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,r=this.lineStarts.length;while(t<r){let i=t+r>>1;if(this.lineStarts[i]<e)t=i+1;else r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}ZS.LineCounter=vl});var zi=h(function(nk){var tk=Gt("process"),Sl=Zr(),rk=Hi();function xe(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function kl(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Rl(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tn(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function tt(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function rn(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function Cl(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!xe(t.start,"explicit-key-ind")&&!xe(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,Rl(t.value))if(t.value.end)rn(t.value.end,t.sep);else t.value.end=t.sep;else rn(t.start,t.sep);delete t.sep}}}class xl{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rk.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);if(!t)yield*this.end()}*next(e){if(this.source=e,tk.env.LOG_TOKENS)console.log("|",Sl.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Sl.tokenType(e);if(!t){let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in r?r.indent:0;else if(t.type==="flow-collection"&&r.type==="document")t.indent=0;if(t.type==="flow-collection")Cl(t);switch(r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];if(n.value)r.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=r.items[r.items.length-1];if(!n||n.value)r.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&kl(n.start)===-1&&(t.indent===0||n.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(r.type==="document")r.end=n.start;else r.items.push({start:n.start});t.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(kl(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=tn(this.peek(2)),r=tt(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
135
135
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
136
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){
|
|
136
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){rn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let o=[];for(let s=0;s<t.sep.length;++s){let a=t.sep[s];switch(a.type){case"newline":o.push(s);break;case"space":break;case"comment":if(a.indent>e.indent)o.length=0;break;default:o.length=0}}if(o.length>=2)i=t.sep.splice(o[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(xe(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=tt(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xe(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Rl(t.key)&&!xe(t.sep,"newline")){let o=tt(t.start),{key:s,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:a}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(xe(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(o);else Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0;return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!xe(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(r)e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){rn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||xe(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);if(r)this.stack.push(r);else yield*this.pop(),yield*this.step()}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=tn(r),i=tt(n);Cl(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
137
137
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Qr(e),r=Xe(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Qr(e),r=Xe(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((r)=>r.type==="newline"||r.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}$v.Parser=yl});var vl=h(function(Gv){var hl=Pi(),qv=Pt(),_t=Tt(),Fv=qn(),jv=E(),Uv=qi(),bl=Fi();function wl(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Uv.LineCounter||null,prettyErrors:t}}function Hv(e,t={}){let{lineCounter:r,prettyErrors:n}=wl(t),i=new bl.Parser(r?.addNewLine),s=new hl.Composer(t),o=Array.from(s.compose(i.parse(e)));if(n&&r)for(let a of o)a.errors.forEach(_t.prettifyError(e,r)),a.warnings.forEach(_t.prettifyError(e,r));if(o.length>0)return o;return Object.assign([],{empty:!0},s.streamInfo())}function Sl(e,t={}){let{lineCounter:r,prettyErrors:n}=wl(t),i=new bl.Parser(r?.addNewLine),s=new hl.Composer(t),o=null;for(let a of s.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new _t.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&r)o.errors.forEach(_t.prettifyError(e,r)),o.warnings.forEach(_t.prettifyError(e,r));return o}function Vv(e,t,r){let n=void 0;if(typeof t==="function")n=t;else if(r===void 0&&t&&typeof t==="object")r=t;let i=Sl(e,r);if(!i)return null;if(i.warnings.forEach((s)=>Fv.warn(i.options.logLevel,s)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},r))}function zv(e,t,r){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t;if(typeof r==="string")r=r.length;if(typeof r==="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=r??t??{};if(!i)return}if(jv.isDocument(e)&&!n)return e.toString(r);return new qv.Document(e,n,r).toString(r)}Gv.parse=Vv;Gv.parseAllDocuments=Hv;Gv.parseDocument=Sl;Gv.stringify=zv});import{realpathSync as gu}from"node:fs";import{fileURLToPath as nR}from"node:url";import{Server as iR}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as sR}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as oR,ListToolsRequestSchema as aR}from"@modelcontextprotocol/sdk/types.js";var xg=Su(ra(),1);var na=["SetState","ResetState","Request","Link","Validate","DisplayMessage","Login","Logout","CallMethod"],En={SetState:{name:"SetState",description:"Set a page state path to an evaluated declarative value",params:{path:{type:"string"},value:{description:"Literal or supported PropValue expression"}},generation:{evaluatedParams:["value"],prerequisites:["Declare the state path on the same page"],example:{action:"SetState",params:{path:"open",value:{_not:{_state:"open"}}}}}},ResetState:{name:"ResetState",description:"Restore paths from the supplied initial map; missing values become null",params:{paths:{type:"array",items:{type:"string"}},initial:{type:"object"}},generation:{evaluatedParams:[],prerequisites:["Supply literal initial values; omitting paths resets keys in initial"],example:{action:"ResetState",params:{paths:["open"],initial:{open:!1}}}}},Request:{name:"Request",description:"Execute a configured connection request",params:{connectionId:{type:"string"},request:{type:"object"},loadingPath:{type:"string"},responsePath:{type:"string"},errorPath:{type:"string"}},generation:{evaluatedParams:["connectionId","request"],prerequisites:["Host must inject the declared connection driver; no implicit secrets or persistence"],example:{action:"Request",params:{connectionId:"projects",request:{id:"list",connectionId:"projects",payload:{operation:"FindAll",resource:"projects"}},responsePath:"rows"}}}},Link:{name:"Link",description:"Emit navigation to a literal URL or page path",params:{path:{type:"string"},url:{type:"string"},target:{enum:["_self","_blank"]}},generation:{evaluatedParams:[],prerequisites:["Host handles navigation; local page paths must exist"],example:{action:"Link",params:{path:"/details"}}}},Validate:{name:"Validate",description:"Emit form validation event; does not itself throw for invalid fields",params:{formId:{type:"string"},errorPath:{type:"string"}},generation:{evaluatedParams:[],prerequisites:["Requires host form:validate listener; prefer native required controls and Form.Submit"],example:{action:"Validate",params:{formId:"contact"}}}},DisplayMessage:{name:"DisplayMessage",description:"Emit an evaluated message for the host to display",params:{message:{description:"Literal or supported PropValue expression"},level:{enum:["info","success","warning","error"]},duration:{type:"number"}},generation:{evaluatedParams:["message"],prerequisites:["Requires host message:display listener"],example:{action:"DisplayMessage",params:{message:"Saved locally",level:"success"}}}},Login:{name:"Login",description:"Set a supplied local session user or request external login",params:{user:{type:"object"},provider:{type:"string"}},generation:{evaluatedParams:[],prerequisites:["Requires host session/auth; setting a local user is not server authentication"],example:{action:"Login",params:{provider:"configured-provider"}}}},Logout:{name:"Logout",description:"Clear the local session and emit auth:logout",params:{},generation:{evaluatedParams:[],prerequisites:["Host owns server session invalidation"],example:{action:"Logout",params:{}}}},CallMethod:{name:"CallMethod",description:"Emit a call to an existing block method",params:{blockId:{type:"string"},method:{type:"string"},args:{type:"array"}},generation:{evaluatedParams:["args"],prerequisites:["Requires an explicitly documented installed block method/listener; never invent a method"],example:{action:"CallMethod",params:{blockId:"documented-block",method:"documented-method",args:[]}}}}};var Pn={navigation:["sidebar","navbar"],container:["default","fluid","boxed"],navigationStyle:["attached","floating"],offcanvas:["attached","floating"],sidebar:["expanded","folded","hover"]},ia={navigation:"sidebar",container:"fluid",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"};var Tg={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},pI=Array.from(new Set(Object.values(Tg).flat()));var lt=["component","template","design-guide","example","skill","block","package","theme"],je=["experimental","candidate","recommended"],sa=["declared","verified","external-consumer"],sr=["missing","declared","verified","external-consumer"],or=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],ar=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var Og=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],hI=[...Og,"radius","font-display","font-body","font-mono"];var ce=(e)=>!!e&&typeof e==="object"&&!Array.isArray(e),z=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e),oa=(e)=>ce(e)&&Object.entries(e).every(([t,r])=>z(t)&&z(r));function aa(e){if(e.composition===void 0)return;let t=e.composition;if(!ce(t)||t.schema!=="uibot.solution-composition.v1"||!Array.isArray(t.pages))throw Error("invalid-solution-composition");let r=new Set;for(let n of t.pages){if(!ce(n)||!z(n.resourceId)||!z(n.version)||typeof n.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(n.sourceHash)||!z(n.sourcePageId)||!z(n.targetPageId)||r.has(n.targetPageId)||!ce(n.baseline)||n.baseline.id!==n.targetPageId||typeof n.baseline.path!=="string"||!Array.isArray(n.baseline.blocks)||!ce(n.bindings)||!["source","target"].includes(String(n.bindings.layout))||!oa(n.bindings.paths)||!oa(n.bindings.connections)||n.bindings.frame!==void 0&&(!ce(n.bindings.frame)||Object.keys(n.bindings.frame).some((i)=>!["props","slots","events"].includes(i)))||n.detached!==void 0&&typeof n.detached!=="boolean"||n.configuration!==void 0&&(!ce(n.configuration)||Object.entries(n.configuration).some(([i,s])=>!z(i)||!["string","number","boolean"].includes(typeof s)||typeof s==="number"&&!Number.isFinite(s))))throw Error("invalid-solution-adoption");r.add(n.targetPageId)}if(t.regions!==void 0){if(!Array.isArray(t.regions))throw Error("invalid-solution-regions");let n=new Set;for(let i of t.regions){if(!ce(i)||!z(i.resourceId)||!z(i.version)||typeof i.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(i.sourceHash)||!z(i.targetPageId)||n.has(i.targetPageId)||!z(i.role)||i.target!=="page-frame"||!z(i.contentBlockId)||!ce(i.baseline)||!z(i.baseline.type))throw Error("invalid-solution-region");n.add(i.targetPageId)}}}var ua=["resource-mcp-invalid-argument","resource-query-failed"];function dt(e,t){return`Tool '${e}' is not wired in this build: no '${t}' discovery provider was supplied. `+`This is not an empty result — supply a 'discovery.${t}' provider to enable it.`}function ca(e){return`Tool '${e}' is not wired in this build: no Hub service was supplied. Supply a service to enable component requests and task status.`}function Dg(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function Lg(e){switch(e.status){case"ready":return{taskId:e.taskId,status:"ready",artifact:e.artifact};case"failed":return{taskId:e.taskId,status:"failed",error:e.error};case"pending":case"running":return{taskId:e.taskId,status:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function ee(e){return{content:[{type:"json",json:e}]}}function U(e){return{content:[{type:"text",text:e}],isError:!0}}function Tn(e,t){return{content:[{type:"json",json:{error:{code:e,detail:t}}}],isError:!0}}var pt="uibot_resource_";function Ng(e){return`${pt}${e}`}function la(e,t){let r;if(e==="resource-kind")r={type:"string",enum:[...lt]};else if(e==="resource-maturity")r={type:"string",enum:[...je]};else if(e==="positive-integer")r={type:"integer",minimum:1};else r={type:"string"};return t?{type:"array",items:r}:r}function _g(){return ar.map((e)=>{let t={},r=[];for(let n of e.positionals)if(t[n.property]=la(n.type,"variadic"in n&&n.variadic===!0),n.required)r.push(n.property);for(let n of e.options)t[n.property]=la(n.type,"multiple"in n&&n.multiple===!0);return{name:Ng(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class J extends Error{detail;code=ua[0];constructor(e){super(e);this.detail=e;this.name="ResourceMcpArgumentError"}}function ut(e,t){let r=new Set(t),n=Object.keys(e).find((i)=>!r.has(i));if(n)throw new J(`unsupported argument: ${n}`)}function cr(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string"||!r.trim())throw new J(`${t} must be a non-empty string`);return r}function Ae(e,t,r){let n=e[t];if(n===void 0)return;if(!Array.isArray(n)||n.length===0||n.some((i)=>typeof i!=="string"||!i.trim()))throw new J(`${t} must be a non-empty string array`);if(r){let i=n.find((s)=>!r.includes(s));if(i)throw new J(`${t} contains unsupported value: ${i}`)}return n}function Mg(e){if(e instanceof J)return Tn(e.code,e.detail);if(e&&typeof e==="object"){let t=e;if(typeof t.code==="string"){let r=typeof t.detail==="string"?t.detail:typeof t.message==="string"?t.message:t.code;return Tn(t.code,r)}}return Tn(ua[1],"resource query callback failed")}async function $g(e,t,r){try{if(e==="manifest")return ut(t,[]),ee({data:{index:await r.manifest()}});if(e==="search"){ut(t,["text","kinds","tags","categories","capabilities","maturities","functions","scenarios","units","industries","limit"]);let i=cr(t,"text"),s=Ae(t,"kinds",lt),o=Ae(t,"tags"),a=Ae(t,"categories"),c=Ae(t,"capabilities"),l=Ae(t,"maturities",je),g=Object.fromEntries(["functions","scenarios","units","industries"].flatMap((u)=>{let m=Ae(t,u);return m?[[u,m]]:[]})),p=t.limit;if(p!==void 0&&(typeof p!=="number"||!Number.isInteger(p)||p<=0))throw new J("limit must be a positive integer");let d={...g,...i?{text:i}:{},...s?{kinds:s}:{},...o?{tags:o}:{},...a?{categories:a}:{},...c?{capabilities:c}:{},...l?{maturities:l}:{},...typeof p==="number"?{limit:p}:{}};return ee({data:{matches:await r.search(d)}})}if(e==="get"){ut(t,["id"]);let i=cr(t,"id");if(!i)throw new J("id must be a non-empty string");return ee({data:{resource:await r.get(i)}})}if(e==="docs"||e==="examples"||e==="install-plan"){ut(t,e==="docs"?["id","locale","page"]:e==="examples"?["id","page"]:["id"]);let i=cr(t,"id");if(!i)throw new J("id must be a non-empty string");let s=cr(t,"locale");if(s&&s!=="zh"&&s!=="en")throw new J("locale must be zh or en");if(!(e==="docs"?r.docs:e==="examples"?r.examples:r.installPlan))return U(dt(e,e));let a=t.page;if(a!==void 0&&(typeof a!=="number"||!Number.isSafeInteger(a)||a<1))throw new J("page must be a positive integer");let c=e==="docs"?await r.docs?.(i,s,a):e==="examples"?await r.examples?.(i,a):await r.installPlan?.(i);return ee({data:c})}ut(t,["roots"]);let n=Ae(t,"roots");if(!n)throw new J("roots must be a non-empty string array");return ee({data:{plan:await r.build(n)}})}catch(n){return Mg(n)}}function da(e){let t=[{name:"uibot_request_component",description:"Request a missing component from the UIBot Hub runtime.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Component name"},context:{type:"string",description:"Optional usage context"},requestedBy:{type:"string",description:"Requester identifier"},priority:{type:"string",enum:["low","normal","high"]}},required:["name"]}},{name:"uibot_get_task_status",description:"Read the status of a Hub task.",inputSchema:{type:"object",properties:{taskId:{type:"string",description:"Hub task identifier"}},required:["taskId"]}},{name:"uibot_list_catalog",description:"List catalog components available to agents (read-only discovery). Returns name/description/category entries.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter on name/description"}}}},{name:"uibot_get_design_md",description:"Get design-md entries (read-only). Omit id to list summaries; provide id for one full entry.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Optional design-md id"}}}},{name:"uibot_list_templates",description:"List installable UIBot templates (read-only discovery).",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter"}}}},{name:"uibot_validate",description:"Validate a generated artifact. Pass `spec` (UIBot Spec object, or JSON/YAML text) to compile it against the catalog and get missing-component gaps and warnings; pass `html` to run the design-quality rules. Fix every gap before handing the result on.",inputSchema:{type:"object",properties:{spec:{description:"UIBot Spec object, or its JSON/YAML text"},html:{type:"string",description:"Generated HTML document"}}}},..._g()];return{listTools(){return t.filter((r)=>{if(r.name==="uibot_request_component")return e.serviceAvailable!==!1;if(r.name==="uibot_get_task_status")return e.serviceAvailable!==!1;if(r.name==="uibot_list_catalog")return e.discovery?.listCatalog!=null;if(r.name==="uibot_get_design_md")return e.discovery?.getDesignMd!=null;if(r.name==="uibot_list_templates")return e.discovery?.listTemplates!=null;if(r.name==="uibot_validate")return e.validate!=null;if(r.name.startsWith(pt)){let n=r.name.slice(pt.length),i=n==="install-plan"?"installPlan":n;return e.resourceQuery!=null&&typeof e.resourceQuery[i]==="function"}return!0})},async callTool(r,n){if(r.startsWith(pt)){let i=r.slice(pt.length);if(!ar.some((o)=>o.name===i))return U(`Unknown tool: ${r}`);if(!e.resourceQuery)return U(dt(r,"resourceQuery"));return $g(i,n,e.resourceQuery)}if(r==="uibot_request_component"){if(e.serviceAvailable===!1)return U(ca(r));let i=typeof n.name==="string"?n.name:"";if(!i)return U("Field 'name' is required");let s=await e.service.requestComponent({name:i,...typeof n.context==="string"?{context:n.context}:{},...typeof n.requestedBy==="string"?{requestedBy:n.requestedBy}:{},...n.priority==="low"||n.priority==="normal"||n.priority==="high"?{priority:n.priority}:{}});return ee(Dg(s))}if(r==="uibot_get_task_status"){if(e.serviceAvailable===!1)return U(ca(r));let i=typeof n.taskId==="string"?n.taskId:"";if(!i)return U("Field 'taskId' is required");let s=e.service.getTaskStatus(i);return s?ee(Lg(s)):U("Task not found")}if(r==="uibot_list_catalog"){let i=e.discovery?.listCatalog;if(!i)return U(dt(r,"listCatalog"));let s=await i(),o=Array.isArray(s)?s:[],a=typeof n.query==="string"?n.query.toLowerCase():"",c=a?o.filter((l)=>JSON.stringify(l).toLowerCase().includes(a)):o;return ee({items:c,count:c.length})}if(r==="uibot_get_design_md"){let i=e.discovery?.getDesignMd;if(!i)return U(dt(r,"getDesignMd"));let s=typeof n.id==="string"?n.id:void 0,o=await i(s)??(s?null:[]);return ee({id:s??null,data:o})}if(r==="uibot_list_templates"){let i=e.discovery?.listTemplates;if(!i)return U(dt(r,"listTemplates"));let s=await i(),o=Array.isArray(s)?s:[],a=typeof n.query==="string"?n.query.toLowerCase():"",c=a?o.filter((l)=>JSON.stringify(l).toLowerCase().includes(a)):o;return ee({items:c,count:c.length})}if(r==="uibot_validate"){if(!e.validate)return U(`Tool '${r}' is not wired in this build: no 'validate' provider was supplied.`);let i=typeof n.html==="string"?n.html:void 0;if(n.spec===void 0&&i===void 0)return U("Provide 'spec' or 'html'");try{return ee(await e.validate({...n.spec===void 0?{}:{spec:n.spec},...i===void 0?{}:{html:i}}))}catch(s){return U(s instanceof Error?s.message:String(s))}}return U(`Unknown tool: ${r}`)}}}function pa(e){return e.map((t)=>t.type==="text"?{type:"text",text:t.text}:{type:"text",text:t.json===void 0?"null":JSON.stringify(t.json,null,2)})}import{existsSync as ss,readFileSync as Xk}from"node:fs";import{fileURLToPath as os}from"node:url";var Bg=["sidebar","surface","foreground","accent","accent-foreground","primary","primary-foreground","border","font","font-display","font-body","font-mono"],ga={type:"object",additionalProperties:!1,properties:Object.fromEntries(Bg.map((e)=>[e,{type:"string"}])),description:"Frame-local tokens; surface is page background. Other keys are rejected."};var lr={ConsolePage:{name:"ConsolePage",description:"Console reference pages.",category:"composite",level:"L2",tags:["console","workspace","interactive"],props:{view:{type:"string"},options:{type:"object"}},events:{onAction:{description:"Serializable values in event.values"}}},ItemGrid:{name:"ItemGrid",description:"Public-facing collection of whole-card buttons with optional images, local search and category filters. Use for browsable pets, products or projects instead of duplicating cards and a management table. No data writes.",category:"composite",level:"L2",tags:["cards","search","collection","gallery"],props:{label:{type:"string"},items:{type:"array",items:{type:"object",required:["id","title"],properties:{id:{type:"string"},title:{type:"string"},description:{type:"string"},category:{type:"string"},meta:{type:"string"},image:{type:"string",description:"Supplied image URL or inline data:image illustration; never invent an asset URL"},imageAlt:{type:"string"}}}},columns:{type:"string",enum:["2","3"],default:"3"},searchable:{type:"boolean",default:!1},filterable:{type:"boolean",default:!1},searchPlaceholder:{type:"string"},filterLabel:{type:"string"},allLabel:{type:"string"},emptyText:{type:"string"},actionLabel:{type:"string"}},events:{onSelect:{description:'Whole-card click or keyboard activation emits the selected string id in {"_event":"values.id"}.'}},constraints:["Use unique non-empty string item IDs. Category filters derive from items; search and category combine on these same cards. Set all control labels in the product language. Image is optional; omit it when unavailable."]},AppNavigation:{name:"AppNavigation",tags:["navigation"],description:"Workspace navigation with configured groups, brand and account",category:"composite",level:"L2",props:{activePath:{type:"string"},brand:{type:"string"},logoSrc:{type:"string",description:"Brand image URL; preserve aspect ratio"},subtitle:{type:"string"},groups:{type:"array"},workspaces:{type:"array"},userName:{type:"string"},email:{type:"string"},initials:{type:"string"},profileHref:{type:"string"}},events:{onNavigate:{description:"Serializable values in event.values"}}},Field:{name:"Field",tags:["form"],description:"Accessible controlled or local form field; native validation and scalar event values",category:"composite",level:"L2",props:{kind:{type:"string"},label:{type:"string"},name:{type:"string"},value:{description:"String, boolean, or string array according to kind"},defaultValue:{description:"Initial string, boolean, or string array"},options:{type:"array"},description:{type:"string"},error:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},placeholder:{type:"string"},rows:{type:"number"},length:{type:"number"},autoComplete:{type:"string"}},events:{onChange:{description:"Serializable values in event.values"}}},StatCard:{name:"StatCard",tags:["metric"],description:"Metric with label, value and supporting text",category:"composite",level:"L2",props:{label:{type:"string"},value:{type:"string"},description:{type:"string"},icon:{type:"string"}},events:{}},BarChart:{name:"BarChart",tags:["chart"],description:"Accessible deterministic bar series with visible labels and hover values",category:"composite",level:"L2",props:{label:{type:"string"},data:{type:"array"},height:{type:"number"},prefix:{type:"string"}},events:{}},AvatarList:{name:"AvatarList",tags:["list"],description:"Compact people and activity list",category:"composite",level:"L2",props:{items:{type:"array"}},events:{}},IntegrationGrid:{name:"IntegrationGrid",tags:["data"],description:"Searchable integrations with explicit capability availability",category:"composite",level:"L2",props:{configurations:{type:"array"},configurable:{type:"boolean"},items:{type:"array"},pending:{type:"boolean"},error:{type:"string"}},events:{onConfigure:{description:"Workspace configuration intent and existing record version"},onAction:{description:"Serializable values in event.values"}}},ChatPanel:{name:"ChatPanel",tags:["interactive"],description:"Conversation selector and controlled message composition",category:"composite",level:"L2",props:{draft:{type:"string"},currentUserId:{type:"string"},conversations:{type:"array"},messages:{type:"array"},selectedId:{type:"string"},pending:{type:"boolean"},canSend:{type:"boolean"},error:{type:"string"}},events:{onDraftChange:{description:"event.value draft; clear after persistence confirmation"},onSelect:{description:"Serializable values in event.values"},onSend:{description:"Serializable values in event.values"}}},DataTable:{name:"DataTable",description:"Configurable record table with search, facets, sorting, stable selection and pagination. Server mode emits query intent without filtering current-page rows.",category:"composite",level:"L2",tags:["table","records","admin"],props:{locale:{type:"string",enum:["en","zh-CN"],default:"en",description:"Language for controls, status and accessible labels"},rows:{type:"array"},columns:{type:"array"},filters:{type:"array"},actions:{type:"array"},bulkActions:{type:"array"},rowKey:{type:"string",default:"id"},searchKeys:{type:"array"},selectedIds:{type:"array"},view:{description:"TableView or URL view JSON"},pageSize:{type:"number",default:10},server:{type:"boolean"},total:{type:"number"},hasNextPage:{type:"boolean"},loading:{type:"boolean"},error:{type:"string"},minWidth:{type:"number"},searchPlaceholder:{type:"string"},label:{type:"string"},selectable:{type:"boolean"},emptyText:{type:"string"}},events:{onViewChange:{description:"event.values query: search, filters JSON, sort, descending, page, pageSize"},onSelectionChange:{description:"Stable ids in event.values.ids"},onRowAction:{description:"event.values.id and action"},onBulkAction:{description:"event.values.ids and action"}}},Box:{name:"Box",description:"Flex container for composing layout. Use as a row or column spacer between other blocks.",category:"primitive",level:"L1",tags:["container","layout"],props:{className:{type:"string",description:"Tailwind classes"},direction:{type:"string",enum:["col","row"],default:"col",description:"Flex direction"},gap:{type:"string",enum:["none","xs","sm","md","lg","xl"],default:"md"},padding:{type:"string",enum:["none","xs","sm","md","lg","xl"]},align:{type:"string",enum:["start","center","end","stretch"]},justify:{type:"string",enum:["start","center","end","between","around"]},wrap:{type:"boolean",default:!1},full:{type:"boolean",default:!1}},usageScenarios:["Horizontal row of action buttons","Vertical stack of form fields","Two-column grid using two Box[direction=row] with flex-1 children"],constraints:["Do not use Box as a semantic section; prefer Card or PageLayout for major layout regions"]},PageLayout:{name:"PageLayout",description:"App header, navigation, content and footer.",category:"composite",level:"L2",tags:["page","layout"],props:{creditLabel:{type:"string"},language:{type:"string"},userName:{type:"string"},email:{type:"string"},subtitle:{type:"string"},appearance:{type:"string",enum:["default","admin","standalone","console"]},layout:{type:"object",properties:{navigation:{type:"string",enum:["sidebar","navbar"]},container:{type:"string",enum:["default","fluid","boxed"]},navigationStyle:{type:"string",enum:["attached","floating"]},offcanvas:{type:"string",enum:["attached","floating"]},sidebar:{type:"string",enum:["expanded","folded","hover"]}}},routes:{type:"array"},headerLinks:{type:"array"},accountLinks:{type:"array"},tokens:ga,theme:{type:"string"},font:{type:"string"},direction:{type:"string"},initials:{type:"string"},title:{type:"string",description:"Header title."},variant:{type:"string",enum:["sidebar","inset","floating"],default:"sidebar"},sidebarWidth:{type:"string",enum:["default","wide"],default:"default",description:"224/256px."},collapsible:{type:"string",enum:["none","icon","offcanvas"],default:"none"}},events:{onThemeChange:{description:"Selected theme: event.value."},onAction:{description:"Serializable values in event.values"}},slots:{headerActions:{description:"Header actions."},sidebar:{description:"Navigation."},footer:{description:"Footer."}},usageScenarios:["Admin dashboard shell","Settings page with left navigation","Landing page with header and main content"],constraints:["Use at most one PageLayout per page","Do not nest PageLayout inside another PageLayout"]},Card:{name:"Card",description:"Surface container with rounded border and optional header (title + description + actions slot).",category:"composite",level:"L2",tags:["card","surface"],props:{className:{type:"string",description:"Tailwind classes"},title:{type:"string",description:"Card heading"},description:{type:"string",description:"Supporting subtitle text"}},slots:{actions:{description:"Action buttons rendered in the top-right of the card header"},default:{description:"Card body content"}},usageScenarios:["Stats overview section","User profile panel","Settings form container"],constraints:["Avoid nesting Card directly inside another Card"]},Tabs:{name:"Tabs",description:"Tab switcher. Each child maps to the tab at the same index. Supports up to 6 tabs.",category:"composite",level:"L2",tags:["tabs","navigation"],props:{variant:{type:"string",enum:["underline","segmented"]},disabledTabs:{type:"array",items:{type:"integer"}},value:{type:"integer"},tabs:{type:"array",items:{type:"string"},description:"Tab labels"},defaultTab:{type:"integer",default:0,description:"Initial tab index (0-based)"}},usageScenarios:["Split view of Overview / Settings / Logs","Mobile-friendly section switcher"],constraints:["Children count must equal tabs array length","Do not use more than 6 tabs"]},Drawer:{name:"Drawer",description:"Off-canvas side panel for secondary context (filters, details, comments). Rendered inline in preview.",category:"composite",level:"L2",tags:["drawer","overlay"],events:{onClose:{description:"Close requested; set controlled open false"}},props:{description:{type:"string"},open:{type:"boolean"},pending:{type:"boolean"},title:{type:"string"}},usageScenarios:["Filter panel for a table","Item detail side sheet"],constraints:["Drawer is always visible in static preview — use conditionally in production via state"]},Modal:{name:"Modal",description:"Centered overlay dialog for focused tasks or confirmations. Rendered inline in preview.",category:"composite",level:"L2",tags:["modal","overlay"],events:{onClose:{description:"Close requested; set controlled open false"}},props:{open:{type:"boolean"},pending:{type:"boolean"},title:{type:"string"},description:{type:"string"}},usageScenarios:["Create / edit form dialog","Image preview lightbox"],constraints:["Modal is always visible in static preview — drive open/close state from actions in production"]},Divider:{name:"Divider",description:"Thin horizontal (default) or vertical separator line.",category:"primitive",level:"L1",tags:["separator"],props:{orientation:{type:"string",enum:["horizontal","vertical"],default:"horizontal"}},usageScenarios:["Visual break between form sections","Vertical separator between two columns"],constraints:[]},DrilldownMenu:{name:"DrilldownMenu",description:"Drilldown section navigation; host owns routing.",category:"composite",level:"L2",tags:["sidebar","navigation","drilldown","nested"],props:{sections:{type:"array",items:{type:"object"},description:"[{id,label?,items:[{id,label,icon?,href?,children?:sections}]}]; unique IDs, max256/6 levels."},activeHref:{type:"string"},panelId:{type:"string",description:"Bind panelId+onPanelChange; empty=root."},defaultPanelId:{type:"string"},showActiveLabel:{type:"boolean"},navigateOnEnter:{type:"boolean"},workspaceLabel:{type:"string"},label:{type:"string",default:"Main navigation"},backLabel:{type:"string",default:"Back to all sections"}},slots:{header:{description:"Optional brand content"},panelHeader:{description:"Below section heading"},footer:{description:"Account or organization switcher"}},events:{onPanelChange:{description:"event.values.panelId; empty=root."},onNavigate:{description:"event.values.href."},onEnter:{description:"Branch only: event.value=href; values.id/href."},onWorkspaceAction:{description:"event.value=create|manage."}},usageScenarios:["Console section navigation","Billing and settings secondary navigation"],constraints:["Host owns routing; no persistence."]},PageSiderMenu:{name:"PageSiderMenu",description:"Vertical sidebar navigation. Place MenuLink or MenuGroup blocks as children. Usually placed in the PageLayout sidebar slot.",category:"composite",level:"L2",tags:["sidebar","nav"],props:{title:{type:"string",description:"Section heading above menu items"}},slots:{header:{description:"Workspace switcher or brand above the menu list"},footer:{description:"User card or secondary links below the menu list"}},usageScenarios:["Admin left nav (Dashboard, Users, Settings)","Docs section navigation"],constraints:["Always use as a sibling inside PageLayout sidebar slot; do not place in main content area"]},MenuGroup:{name:"MenuGroup",description:"Labeled group of MenuLink items inside PageSiderMenu.",category:"composite",level:"L2",tags:["sidebar","nav"],props:{title:{type:"string",description:"Group heading shown above the links"}},usageScenarios:["Platform vs Workspace nav groups","Settings section grouping"],constraints:["Must be a direct child of PageSiderMenu"]},MenuLink:{name:"MenuLink",description:"Single navigation item inside a PageSiderMenu. Renders as an anchor with optional icon and badge.",category:"primitive",level:"L1",tags:["nav","link"],props:{label:{type:"string"},href:{type:"string"},icon:{type:"string",description:"Emoji or Unicode glyph"},badge:{type:"string",description:"Count or label shown on the right"},active:{type:"boolean",default:!1}},usageScenarios:["Dashboard menu item","Settings section link with unread badge"],constraints:["Must be a direct child of PageSiderMenu or MenuGroup"]},Link:{name:"Link",description:"Inline hyperlink. Variants: default (blue underline), muted (gray), button (filled CTA), outline (bordered CTA).",category:"primitive",level:"L1",tags:["link"],props:{label:{type:"string"},href:{type:"string"},variant:{type:"string",enum:["default","muted","button","outline"],default:"default"},target:{type:"string",enum:["_self","_blank"],default:"_self"},className:{type:"string",description:"Additional utility classes"}},usageScenarios:["Inline 'Read more' link in a paragraph","CTA button-style link in a hero section"],constraints:[]},Breadcrumb:{name:"Breadcrumb",description:"Hierarchical page path trail. Pass an items array of {label, href?}.",category:"composite",level:"L2",tags:["breadcrumb","nav"],props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},href:{type:"string"}}},description:"Path segments"}},usageScenarios:["Page location context in an admin CRUD view","Multi-step wizard progress"],constraints:[]},List:{name:"List",description:"Unordered list of child blocks. Use with divided or compact for different visual densities.",category:"composite",level:"L2",tags:["list"],props:{divided:{type:"boolean",default:!1,description:"Add hairline dividers between items"},compact:{type:"boolean",default:!1},label:{type:"string",description:"ARIA label"}},usageScenarios:["Recent activity feed","Search result list"],constraints:[]},Table:{name:"Table",description:"Data grid with typed columns and row data. Columns define keys and display labels.",category:"composite",level:"L2",tags:["table","grid","data"],props:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"},align:{type:"string",enum:["left","center","right"]}}},description:"[{key, label, align?}]"},rows:{type:"array",items:{type:"object"},description:"Rows keyed to column.key"},emptyText:{type:"string",default:"No data"},striped:{type:"boolean",default:!0},caption:{type:"string"}},usageScenarios:["User management list","Order history table","API endpoint catalog"],constraints:["rows entries must have keys matching column.key; missing keys render empty string","Avoid more than 8 columns"]},Stat:{name:"Stat",description:"KPI metric card: large value, label, optional trend arrow, and change string.",category:"primitive",level:"L2",tags:["stat","kpi","metric"],props:{label:{type:"string"},value:{type:"string",description:"Main metric value, e.g. 1,234 or $12k"},change:{type:"string",description:'Change label, e.g. "+12% vs last month"'},trend:{type:"string",enum:["up","down"]},description:{type:"string",description:"Secondary helper text"}},usageScenarios:["Dashboard KPI row (4 Stat blocks side-by-side in a Box[direction=row])","Single revenue metric in a Card"],constraints:["Do not put detailed charts inside a Stat; use Stat only for a single number + context"]},Markdown:{name:"Markdown",description:"Renders Markdown source into HTML. Supports # headings, **bold**, *italic*, `code`, and - lists.",category:"primitive",level:"L1",tags:["text","markdown","content"],props:{content:{type:"string",description:"Markdown source text"}},usageScenarios:["Documentation sections","Feature descriptions on a landing page","Release notes"],constraints:["No HTML injection; only Markdown syntax is parsed"]},Heading:{name:"Heading",description:"Semantic h1–h6. Optional visual size is independent of level; display scales with the viewport.",category:"primitive",level:"L1",tags:["text","heading","typography"],props:{className:{type:"string",description:"Tailwind classes"},text:{type:"string"},font:{type:"string",enum:["inherit","display","body","mono"],description:"Theme font role."},size:{type:"string",enum:["xs","sm","md","lg","xl","display"],description:"16/20/24/32/40px; display: fluid 36–72px."},measure:{type:"string",enum:["narrow","normal","wide"],description:"Max line width: 16/24/36ch."},align:{type:"string",enum:["start","center","end"],description:"Text alignment, not block placement."},level:{type:"integer",default:2,description:"Semantic heading level 1–6."},muted:{type:"boolean",default:!1,description:"Render in muted-foreground"}},usageScenarios:["Section title above a Table or Card","Hero headline on a landing page"],constraints:["Use only one h1 per page"]},Paragraph:{name:"Paragraph",description:"Body text block. Use lead for fluid introductory copy; optional measure bounds reading width.",category:"primitive",level:"L1",tags:["text","typography"],props:{className:{type:"string",description:"Tailwind classes"},text:{type:"string"},font:{type:"string",enum:["inherit","display","body","mono"],description:"Theme font role."},size:{type:"string",enum:["sm","md","lg","lead"],default:"md",description:"lead: fluid 18–22px; legacy sizes unchanged."},measure:{type:"string",enum:["narrow","normal","wide"],description:"Max line width: 45/65/80ch."},align:{type:"string",enum:["start","center","end"],description:"Text alignment, not block placement."},muted:{type:"boolean",default:!1}},usageScenarios:["Feature description below a Heading","Helper caption below a form field"],constraints:[]},Form:{name:"Form",description:"Form wrapper that prevents default submission. Place Form.Input, Form.Select, etc. as children and end with Form.Submit.",category:"composite",level:"L2",tags:["form","input"],props:{idempotent:{type:"boolean",description:"Stable event.value idempotency key for unchanged-value retries"},pending:{type:"boolean"},label:{type:"string"},layout:{type:"string",enum:["vertical","horizontal"],default:"vertical"}},events:{onChange:{description:"Bubbled native field changes with { type, name, value, checked }."},onSubmit:{description:"Runs after native submission is prevented.",payload:{type:"object",description:"{ type: 'submit', values: Record<string, value> }"}}},usageScenarios:["Create / edit entity form","Login form","Search filter form"],constraints:["Always include exactly one Form.Submit as the last child","Do not nest forms inside forms"]},"Form.Input":{name:"Form.Input",description:"Single-line text field. Supports text, email, password, number, tel, url, date types.",category:"primitive",level:"L1",tags:["form","input"],props:{name:{type:"string",description:"Unique form field name"},label:{type:"string"},type:{type:"string",enum:["text","email","password","number","tel","url","date","search"],default:"text"},placeholder:{type:"string"},helpText:{type:"string"},error:{type:"string"},required:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1},value:{type:"string",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value }."}},usageScenarios:["Email address field in a login form","Search bar with type=search","Price input with type=number"],constraints:["name prop is required and must be unique within the parent Form"]},"Form.Select":{name:"Form.Select",description:"Dropdown select field with an options array [{value, label}].",category:"primitive",level:"L1",tags:["form","select"],props:{name:{type:"string"},label:{type:"string"},options:{type:"array",items:{type:"object",properties:{value:{type:"string"},label:{type:"string"}}},description:"[{value, label}]"},placeholder:{type:"string"},required:{type:"boolean",default:!1},value:{type:"string",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value }."}},usageScenarios:["Role selector (Admin/Editor/Viewer)","Status filter dropdown"],constraints:[]},"Form.TextArea":{name:"Form.TextArea",description:"Multi-line text input. Use for descriptions, messages, or any free-form long text.",category:"primitive",level:"L1",tags:["form","textarea"],props:{name:{type:"string"},label:{type:"string"},placeholder:{type:"string"},rows:{type:"integer",default:4},helpText:{type:"string"},required:{type:"boolean",default:!1},value:{type:"string",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value }."}},usageScenarios:["Bio / description field on a profile form","Message body in a contact form"],constraints:[]},"Form.Checkbox":{name:"Form.Checkbox",description:"Single boolean checkbox with optional description beneath the label.",category:"primitive",level:"L1",tags:["form","checkbox"],props:{name:{type:"string"},label:{type:"string"},description:{type:"string"},checked:{type:"boolean",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value, checked }."}},usageScenarios:["Terms & conditions consent","Opt-in notification preference"],constraints:[]},"Form.Submit":{name:"Form.Submit",description:"Form submit button. Use variant=destructive for irreversible actions.",category:"primitive",level:"L1",tags:["form","button"],props:{disabled:{type:"boolean",default:!1},label:{type:"string",default:"Submit"},variant:{type:"string",enum:["default","destructive","outline","ghost"],default:"default"},full:{type:"boolean",default:!1}},events:{onClick:{description:"Runs with a plain click payload before the parent form submits."}},usageScenarios:["Save button at the bottom of a form","Delete action with variant=destructive"],constraints:["Must be inside a Form block"]},Button:{name:"Button",description:"Standalone action button. Six visual variants and five sizes. Does not submit forms — use Form.Submit for that.",category:"primitive",level:"L1",tags:["button","action"],props:{label:{type:"string"},variant:{type:"string",enum:["default","destructive","outline","secondary","ghost","link"],default:"default"},size:{type:"string",enum:["xs","sm","default","lg","icon"],default:"default"},full:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1}},events:{onClick:{description:"Runs with a plain click payload."}},usageScenarios:["Primary CTA on a hero section","Row of outline action buttons in a Card actions slot","Ghost icon button in a toolbar"],constraints:["Use Form.Submit, not Button[type=submit], inside a Form","Do not place more than 3 primary (default) buttons on the same view"]},Toast:{name:"Toast",description:"Alert banner (info, success, warning, error); placement top-right floats it as a dismissible corner notice.",category:"primitive",level:"L1",tags:["toast","alert","notification"],props:{message:{type:"string"},title:{type:"string"},level:{type:"string",enum:["info","success","warning","error"],default:"info"},closeable:{type:"boolean",default:!0},placement:{type:"string",enum:["inline","top-right"],default:"inline"},duration:{type:"number",description:"Auto-dismiss after ms"}},usageScenarios:["Transient success message after form submit","Contextual inline data notice"],constraints:["Floating notices must auto-dismiss; keep persistent disclosure inline, clear of navigation and controls"]},Dialog:{name:"Dialog",description:"Confirmation with explicit action intents. Boolean open uses a native modal; omitted open keeps an inline composition.",category:"composite",level:"L2",tags:["dialog","modal","confirm"],props:{open:{type:"boolean",description:"Omit for inline."},pending:{type:"boolean",description:"Lock actions/dismissal."},title:{type:"string"},description:{type:"string"},cancelLabel:{type:"string"},confirmLabel:{type:"string"},confirmVariant:{type:"string",enum:["default","destructive","outline"],default:"default"}},events:{onConfirm:{description:"value=values.action=confirm."},onCancel:{description:"value=values.action=cancel."},onClose:{description:"Dismiss: value=values.open=false."}},usageScenarios:["Delete confirmation prompt","Unsaved changes warning before navigation"],constraints:["Host owns open/pending and persistence; no automatic close/write/retry."]},PanelHeader:{name:"PanelHeader",description:"Section title with optional eyebrow, description and an `actions` slot for buttons or links.",category:"primitive",level:"L1",tags:["header","section","title"],props:{eyebrow:{type:"string"},title:{type:"string"},description:{type:"string"}},slots:{actions:{description:"Buttons or links aligned to the right of the title"}},usageScenarios:["Title and helper text above a table","Panel header with a Refresh button"],constraints:["Use Heading for in-flow headings that need an explicit level"]},EmptyState:{name:"EmptyState",description:"Empty or recoverable status panel (role=status) with title, message and an optional action button.",category:"primitive",level:"L1",tags:["empty","status","placeholder"],props:{title:{type:"string"},message:{type:"string"},description:{type:"string",description:"Alias of message"},actionLabel:{type:"string",description:"Renders an action button when set"}},events:{onClick:{description:"Action button click; onAction is accepted as an alias."}},usageScenarios:["No results after filtering, with a Clear filters action"],constraints:["Use Alert for errors that need immediate attention"]},FactList:{name:"FactList",description:"Key/value fact list (dl). Pass `items` or FactRow children. Not a KPI card; use StatCard for metrics.",category:"composite",level:"L1",tags:["facts","key-value","details"],props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"},code:{type:"boolean"},href:{type:"string"},hrefSection:{type:"string"}}}}},usageScenarios:["Provider detail: base URL, model, revision"],constraints:["Items render as plain rows or links; use FactRow children for onClick"]},FactRow:{name:"FactRow",description:"One fact row inside FactList. `code` renders the value monospaced; `href` / `hrefSection` (-> #section) render a link; onClick makes the value a button.",category:"primitive",level:"L1",tags:["facts","key-value"],props:{label:{type:"string"},value:{type:"string"},code:{type:"boolean",default:!1},href:{type:"string"},hrefSection:{type:"string"}},events:{onClick:{description:"Runs with a plain click payload."}},constraints:["Place inside FactList"]},Alert:{name:"Alert",description:"Inline alert with icon, title and description. destructive uses role=alert; other variants role=status. Status is conveyed by icon and hidden label text, not colour alone.",category:"primitive",level:"L1",tags:["alert","notice","feedback"],props:{variant:{type:"string",enum:["default","destructive","warning","success"],default:"default"},title:{type:"string"},description:{type:"string"},message:{type:"string",description:"Alias of description"}},usageScenarios:["Guardrail notice","Save succeeded","Request failed"]},Badge:{name:"Badge",description:"Small status label. Text is the status; colour is only reinforcement. Children or `label` provide the text.",category:"primitive",level:"L1",tags:["badge","status","label"],props:{variant:{type:"string",enum:["default","secondary","outline","success","warning","destructive"],default:"default"},label:{type:"string"}},usageScenarios:["Provider state: Active / Disabled","Row status in a table"]},Switch:{name:"Switch",description:"Controlled boolean switch (role=switch) with accessible label. Supports _bindState on checked; onChange carries event.checked.",category:"primitive",level:"L1",tags:["switch","toggle","form"],props:{label:{type:"string"},checked:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1}},events:{onChange:{description:"Runs with { type: 'change', checked }"}},usageScenarios:["Enable or disable a provider","Feature flag toggle"],constraints:["Always set label so the control has an accessible name"]},Skeleton:{name:"Skeleton",description:"Animated loading placeholder. Three presets: lines (text), card (avatar + lines), table (header + rows).",category:"primitive",level:"L1",tags:["skeleton","loading","placeholder"],props:{lines:{type:"integer",default:3,description:"Number of skeleton rows (for lines and table types)"},type:{type:"string",enum:["lines","card","table"],default:"lines"}},usageScenarios:["Loading state while fetching table data","Card placeholder during profile load"],constraints:["Replace with real content once data loads; do not keep Skeleton visible indefinitely"]}};var ur={Grid:{name:"Grid",description:"Declarative grid layout. Maps cols/gap/responsive props to Tailwind grid classes; children become grid cells directly.",category:"primitive",level:"L1",tags:["layout","grid","container"],props:{cols:{enum:["1","2","3","4","5","6","auto",1,2,3,4,5,6],default:"auto",description:"Column count, or 'auto' for auto-fit minmax(220px,1fr)"},gap:{type:"string",enum:["none","xs","sm","md","lg","xl"],default:"md"},responsive:{type:"boolean",default:!1,description:"Use a mobile-first ladder (grid-cols-1 → sm:2 → lg:N) instead of a fixed column count"},align:{type:"string",enum:["start","center","end","stretch"]},justify:{type:"string",enum:["start","center","end","between","around"]}},usageScenarios:["4-up Stat dashboard row (cols=4)","Responsive card gallery (cols=3, responsive=true)","Two-column form layout (cols=2)"],constraints:["Grid children become grid cells directly; do not wrap each child in a Box","Use cols='auto' when the number of children is dynamic"]},StatGrid:{name:"StatGrid",description:"Responsive grid of KPI cards. Prefers child Stat blocks; falls back to inline rendering of an items array when there are no children.",category:"composite",level:"L2",tags:["stat","kpi","dashboard","grid"],props:{cols:{type:"string",enum:["1","2","3","4","auto"],default:"auto"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"},change:{type:"string"},trend:{type:"string",enum:["up","down"]},description:{type:"string"}}},description:"Inline KPI items used when no Stat children are provided"}},usageScenarios:["Overview dashboard KPI row","Operations metrics summary above a table"],constraints:["Provide either Stat children or items, not both — children win when present"]},TrendChart:{name:"TrendChart",description:"Pure-SVG line / area chart with no third-party dependency. Draws one polyline per series on a shared vertical scale. Alias: LineChart.",category:"composite",level:"L2",tags:["chart","trend","line","svg"],props:{title:{type:"string"},series:{type:"array",items:{type:"object",properties:{name:{type:"string"},points:{type:"array",items:{type:"number"}},area:{type:"boolean",default:!1}}},description:"[{name, points:number[], area?}]"},labels:{type:"array",items:{type:"string"},description:"Optional x-axis labels"},width:{type:"integer",default:480},height:{type:"integer",default:160}},usageScenarios:["Evolution score trend over versions","Daily active users line chart"],constraints:["Keep each series under ~200 points; larger inputs produce heavy SVG DOM"]},LineChart:{name:"LineChart",description:"Alias of TrendChart — pure-SVG multi-series line / area chart.",category:"composite",level:"L2",tags:["chart","line","svg"],props:{title:{type:"string"},series:{type:"array",items:{type:"object",properties:{name:{type:"string"},points:{type:"array",items:{type:"number"}},area:{type:"boolean"}}}},width:{type:"integer",default:480},height:{type:"integer",default:160}},usageScenarios:["Same as TrendChart; use whichever name reads better in the spec"],constraints:["Identical implementation to TrendChart"]},KanbanBoard:{name:"KanbanBoard",description:"Horizontal kanban board: columns as swimlanes, cards grouped by their column id. Read-only display.",category:"composite",level:"L3",tags:["kanban","board","operations"],props:{columns:{type:"array",items:{type:"object",properties:{id:{type:"string"},title:{type:"string"}}},description:"[{id, title}] swimlane definitions"},cards:{type:"array",items:{type:"object",properties:{id:{type:"string"},column:{type:"string"},title:{type:"string"},subtitle:{type:"string"},badge:{type:"string"}}},description:"[{id, column, title, subtitle?, badge?}] — column must match a column id"}},usageScenarios:["Operations task board (Todo / In progress / Done)","Release pipeline stages"],constraints:["Each card.column must reference an existing column.id, else the card is dropped","Up to 4 columns fit the container as an equal-width grid (no scrollbar); 5+ columns switch to a horizontal scroll strip"]},Matrix:{name:"Matrix",description:"Two-dimensional intensity grid (heatmap). Cell intensities are 0..1 and map to a color-mix of the primary token via inline style. Alias: Heatmap.",category:"composite",level:"L3",tags:["matrix","heatmap","grid","governance"],props:{caption:{type:"string"},rows:{type:"array",items:{type:"string"},description:"Row labels"},cols:{type:"array",items:{type:"string"},description:"Column labels"},cells:{type:"array",items:{type:"array",items:{type:"number"}},description:"rows×cols grid of intensities in [0,1]"},showValues:{type:"boolean",default:!1,description:"Print the numeric value in each cell"}},usageScenarios:["Governance capability coverage matrix","Risk heatmap (likelihood × impact)"],constraints:["Intensities are single-polar 0..1; negative / diverging scales are not supported","cells should be rows.length × cols.length; missing cells render as 0"]},Heatmap:{name:"Heatmap",description:"Alias of Matrix — two-dimensional 0..1 intensity grid.",category:"composite",level:"L3",tags:["heatmap","matrix","grid"],props:{caption:{type:"string"},rows:{type:"array",items:{type:"string"}},cols:{type:"array",items:{type:"string"}},cells:{type:"array",items:{type:"array",items:{type:"number"}}},showValues:{type:"boolean",default:!1}},usageScenarios:["Same as Matrix"],constraints:["Identical implementation to Matrix"]},DiagnosticsList:{name:"DiagnosticsList",description:"Levelled diagnostics list with a coloured left bar and glyph per severity (info / warn / error).",category:"composite",level:"L2",tags:["diagnostics","list","status","overview"],props:{items:{type:"array",items:{type:"object",properties:{level:{type:"string",enum:["info","warn","error"]},title:{type:"string"},detail:{type:"string"}}},description:"[{level, title, detail?}]"}},usageScenarios:["Overview page diagnostics slot","Spec validation results list"],constraints:["level defaults to 'info' when omitted or unrecognised"]},TimelineList:{name:"TimelineList",description:"Vertical timeline with a left rail and a status dot per item (ok / warn / error).",category:"composite",level:"L2",tags:["timeline","activity","operations"],props:{items:{type:"array",items:{type:"object",properties:{time:{type:"string"},title:{type:"string"},desc:{type:"string"},status:{type:"string",enum:["ok","warn","error"]}}},description:"[{time, title, desc?, status?}]"}},usageScenarios:["Operations event timeline","Deployment / audit history"],constraints:["status defaults to 'ok' when omitted"]},SearchableTable:{name:"SearchableTable",description:"Table with a built-in search box. Typing dispatches SetState onto searchKey and filters the resolved rows (case-insensitive substring across all columns).",category:"feature",level:"L3",tags:["table","search","interactive","data"],props:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"},align:{type:"string",enum:["left","center","right"]}}}},rows:{type:"array",items:{type:"object"},description:"Row objects keyed to column.key"},searchKey:{type:"string",default:"search",description:"State path the search query writes to"},placeholder:{type:"string",default:"Search…"},emptyText:{type:"string",default:"No matching rows",description:"Copy shown when the filtered row set is empty"}},usageScenarios:["Searchable plugins / catalog list in studio","User management table with live filtering"],constraints:["Requires a live host (dispatch) for the search box to update host state; client-side filtering still works on already-resolved rows"]},SplitMasterDetail:{name:"SplitMasterDetail",description:"Master/detail split: a selectable left list and a right detail pane. Clicking an item dispatches SetState onto selectKey; the detail slot (or children) renders the right pane.",category:"feature",level:"L3",tags:["split","master-detail","interactive","layout"],props:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},title:{type:"string"},subtitle:{type:"string"}}},description:"[{id, title, subtitle?}] left-list entries"},selectKey:{type:"string",default:"selectedId",description:"State path the selected id writes to"}},slots:{detail:{description:"Right-pane content; usually host-composed from the selected item via _find"}},usageScenarios:["Skills list → skill detail","Agents directory → agent inspector"],constraints:["Selection defaults to the first item's id until the host updates selectKey"]},DetailField:{name:"DetailField",description:"Label + value display row, for use inside a detail pane.",category:"primitive",level:"L1",tags:["detail","field","display"],props:{label:{type:"string"},value:{type:"string",description:"Any scalar; rendered as '—' when empty"},inline:{type:"boolean",default:!1,description:"Render label and value on one line"}},usageScenarios:["Field row inside a SplitMasterDetail detail pane","Read-only record summary"],constraints:["Use for scalar values; for structured data prefer KeyValueGrid"]},BadgeGroup:{name:"BadgeGroup",description:"Horizontal group of status badges. Items may be plain strings or {label, tone}.",category:"composite",level:"L1",tags:["badge","status","tags"],props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},tone:{type:"string",enum:["default","success","warning","error","info"]}}},description:"Array of strings or [{label, tone?}]"}},usageScenarios:["Status / tag chips on a list row","Capability flags on an agent card"],constraints:["tone defaults to 'default' when omitted or unrecognised"]},KeyValueGrid:{name:"KeyValueGrid",description:"Compact key/value grid for metadata. Accepts an items array or a plain record object.",category:"composite",level:"L1",tags:["key-value","metadata","grid","display"],props:{items:{type:"array",items:{type:"object",properties:{key:{type:"string"},value:{type:"string"}}},description:"[{key, value}] pairs (or pass a plain object as `data`)"},cols:{enum:["1","2","3",1,2,3],default:"2"}},usageScenarios:["Model metadata panel (provider, context, pricing)","Request / response header summary"],constraints:["Values are stringified for display; pass pre-formatted strings for control"]},Hero:{name:"Hero",description:"Asymmetric editorial hero: serif display title (with optional italic emphasis word), mono eyebrow with amber dot, warm radial-glow + blueprint dot-grid backdrop, grain overlay, staggered reveal, and primary/secondary CTAs. An optional right-side visual renders via the `aside` slot or children.",category:"presentation",level:"L3",tags:["hero","marketing","landing","editorial"],props:{eyebrow:{type:"string",description:"Mono uppercase kicker above the title"},title:{type:"string",description:"Serif display headline"},titleEmphasis:{type:"string",description:"Optional trailing word rendered italic + amber for emphasis"},subtitle:{type:"string",description:"Supporting lead paragraph"},primaryCta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber button"},secondaryCta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — outline button"},note:{type:"string",description:"Small mono note under the CTAs"}},slots:{aside:{description:"Right-pane visual (e.g. a rendered spec preview); hidden on mobile"}},usageScenarios:["Studio landing-page hero introducing 'AI writes the spec, the platform renders the UI'","Product launch hero with a spec snippet preview on the right"],constraints:["CTA props are {label, href}; href defaults to '#' when omitted","Use titleEmphasis for a single emphasis word, not the whole title"]},BrowserFrame:{name:"BrowserFrame",description:"Product-screenshot window shell: frames its `content` slot (or children) in a precise browser/app chrome — three traffic-light dots + a mono title/address bar — with a hairline border, long soft shadow, and an optional 3D tilt. Used to present a live-rendered UI as a product-shot visual (dogfood) instead of a static screenshot.",category:"presentation",level:"L2",tags:["frame","browser","window","screenshot","marketing"],props:{title:{type:"string",description:"Address/title shown in the window chrome (defaults to 'app.uibot.studio')"},variant:{type:"string",enum:["flat","tilt"],default:"flat",description:"'tilt' adds a subtle 3D perspective tilt for a product-shot feel"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index for the chrome address bar wash (0 amber · 1 teal · 2 rose · 3 indigo)"}},slots:{content:{description:"The UI rendered inside the frame; usually a real dashboard composed from data blocks"}},usageScenarios:["Hero visual framing a live-rendered mini dashboard as the product shot","Showcase row of small frames each rendering a different UI from the same engine"],constraints:["Frames the `content` slot, falling back to children; supply real spec blocks to render a live UI","Decorative chrome only — it does not add browser behaviour (no real address bar)"]},SectionHeader:{name:"SectionHeader",description:"Editorial section header: oversized mono section number (e.g. '01'), mono eyebrow, serif title, and a lead paragraph. Sets the rhythm between page sections.",category:"presentation",level:"L2",tags:["section","header","marketing","editorial"],props:{sectionNo:{type:"string",description:"Oversized mono numeral, e.g. '01'"},eyebrow:{type:"string",description:"Mono uppercase kicker"},title:{type:"string",description:"Serif section title"},lead:{type:"string",description:"Lead / intro paragraph"}},usageScenarios:["Numbered section dividers on a landing page (01 Features, 02 How it works)","Editorial chapter header above a FeatureGrid"],constraints:["sectionNo is display text; any string works (e.g. '01', 'A', '§1')"]},FeatureGrid:{name:"FeatureGrid",description:"Responsive grid of hairline feature cards with hover lift. Renders an `items` array (icon name + title + desc) into FeatureCards, or lays out FeatureCard children directly.",category:"presentation",level:"L2",tags:["features","grid","cards","marketing"],props:{cols:{type:"string",enum:["2","3","4"],default:"3"},items:{type:"array",items:{type:"object",properties:{icon:{type:"string",description:"lucide icon name (sparkles, zap, layers, code, cpu, workflow, gauge, shield, wand, boxes)"},title:{type:"string"},desc:{type:"string"}}},description:"[{icon, title, desc}] feature entries"}},usageScenarios:["Three-up feature highlights under a SectionHeader","Capability grid (declarative spec, gap recovery, plugin catalog)"],constraints:["icon is a lucide name mapped to a built-in inline SVG; unknown names fall back to a dot","Provide either items or FeatureCard children — children win when present"]},FeatureCard:{name:"FeatureCard",description:"Single hairline feature card: inline-SVG icon, serif title, body copy, and optional children. Designed to sit inside a FeatureGrid but works standalone.",category:"presentation",level:"L1",tags:["feature","card","marketing"],props:{icon:{type:"string",description:"lucide icon name (see FeatureGrid)"},title:{type:"string"},desc:{type:"string"}},usageScenarios:["A single emphasised feature beside a screenshot","Composed children inside a FeatureGrid for custom card bodies"],constraints:["icon resolves against the built-in inline-SVG set; unknown → dot fallback"]},CodeShowcase:{name:"CodeShowcase",description:"Mono code panel with window chrome (three dots) and line numbers, used to showcase a UIBot YAML/JSON spec. Pure CSS, no syntax-highlighter dependency.",category:"presentation",level:"L2",tags:["code","spec","showcase","marketing"],props:{title:{type:"string",description:"Filename / label shown in the window chrome"},code:{type:"string",description:"Raw code string; newline-separated, rendered with line numbers"},caption:{type:"string",description:"Caption under the panel"}},usageScenarios:["Show an example UIBot YAML spec on the landing page","Before/after spec snippet in a docs section"],constraints:["code is plain text rendered verbatim with line numbers; no highlighting/escaping beyond React's default"]},CtaBand:{name:"CtaBand",description:"Inverted ink-black call-to-action band with grain overlay and a single amber CTA. Closes a landing page with high contrast.",category:"presentation",level:"L2",tags:["cta","band","marketing","conversion"],props:{title:{type:"string",description:"Serif headline"},subtitle:{type:"string",description:"Supporting line"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber button"}},usageScenarios:["Final 'Start building' band at the bottom of the landing page","Newsletter / docs CTA between sections"],constraints:["Single CTA by design; cta.href defaults to '#' when omitted"]},Faq:{name:"Faq",description:"Editorial accordion FAQ built on native <details>/<summary> — fully functional with zero JS / state wiring. Optional eyebrow/title/lead header; rows carry a mono index numeral, a hairline plus-mark that rotates 45° into a close-mark on open, and a grid-rows expand transition.",category:"presentation",level:"L2",tags:["faq","accordion","marketing","content"],props:{eyebrow:{type:"string",description:"Optional mono overline above the title (accent colored)"},title:{type:"string",description:"Optional serif heading above the list"},lead:{type:"string",description:"Optional muted intro line under the title"},defaultOpenFirst:{type:"boolean",description:"When true, the first row renders open on mount"},items:{type:"array",items:{type:"object",properties:{q:{type:"string"},a:{type:"string"}}},description:"[{q, a}] question/answer pairs; rows with an empty q are dropped"}},usageScenarios:["Pricing / product FAQ section on a landing page","Docs 'common questions' block"],constraints:["Uses native <details> so multiple rows can be open at once; no single-open behaviour","Answers render as plain text; pass pre-formatted strings"]},TeamGrid:{name:"TeamGrid",description:"Grid of team-member cards. Each shows an avatar (image when `avatar` is a URL, otherwise tinted initials), name, mono role and optional bio. Hairline cards with hover lift.",category:"presentation",level:"L2",tags:["team","people","grid","marketing"],props:{columns:{type:"string",enum:["2","3","4"],default:"3"},members:{type:"array",items:{type:"object",properties:{name:{type:"string"},role:{type:"string"},bio:{type:"string"},avatar:{type:"string",description:"Image URL, or short text/emoji shown as the avatar; falls back to initials"}}},description:"[{name, role?, bio?, avatar?}] — members with an empty name are dropped"}},usageScenarios:["About page 'meet the team' grid","Advisors / contributors showcase"],constraints:["avatar is treated as an image when it looks like a URL (http(s):/data:/leading slash); otherwise rendered as text","Initials are derived from the name when no avatar is given"]},Steps:{name:"Steps",description:"'How it works' steps with oversized mono numerals. variant 'numbered' (default) is a responsive card row; variant 'connected' is a vertical rail with a connecting line between numbered dots.",category:"presentation",level:"L2",tags:["steps","how-it-works","process","marketing"],props:{variant:{type:"string",enum:["numbered","connected"],default:"numbered",description:"'numbered' = card row with big numerals; 'connected' = vertical rail with a line"},steps:{type:"array",items:{type:"object",properties:{title:{type:"string"},desc:{type:"string"},icon:{type:"string",description:"Optional lucide icon name; replaces the numeral in the 'connected' dot"}}},description:"[{title, desc?, icon?}] in sequence order; steps with an empty title are dropped"}},usageScenarios:["Three-step onboarding ('Describe → Generate → Render')","Connected setup sequence in docs"],constraints:["Numbering is automatic (01, 02, …) from array order","icon only affects the 'connected' variant's dot; the numbered variant always shows the numeral","Numbered variant derives its column count from the step count (clamped 2–4), so 4 steps fill one row"]},BentoGrid:{name:"BentoGrid",description:"Asymmetric bento layout. Lays BentoCell children, or an `items` array, onto a CSS grid whose base column count is `cols`; cells opt into col/row spans to break the rhythm into a mixed-size mosaic. Hairline cards, per-cell accent tone.",category:"presentation",level:"L3",tags:["bento","grid","layout","marketing"],props:{cols:{type:"string",enum:["2","3","4","6"],default:"3",description:"Base column count of the grid (cells may span fewer/more)"},gap:{type:"string",enum:["none","sm","md","lg"],default:"md"},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},desc:{type:"string"},icon:{type:"string",description:"lucide icon name"},tone:{type:"integer",description:"Accent-hue index 0–3 (amber/teal/rose/indigo)"},span:{type:"object",properties:{col:{type:"integer"},row:{type:"integer"}},description:"Cell span; col 1–4, row 1–3"}}},description:"Inline cells used when no BentoCell children are provided"}},usageScenarios:["Feature mosaic where one tile is hero-sized (span col 2) and the rest are small","Capability bento mixing tall and wide tiles"],constraints:["Provide either BentoCell children or items — children win when present","span.col is clamped to 1–4 and span.row to 1–3 via static class maps (no purge risk)"]},BentoCell:{name:"BentoCell",description:"A single bento tile, usable standalone inside a BentoGrid. Reads span.col / span.row and maps them to static span classes so the cell can be as wide/tall as the mosaic needs. Optional icon/title/desc plus composed children.",category:"presentation",level:"L1",tags:["bento","cell","card","marketing"],props:{title:{type:"string"},desc:{type:"string"},icon:{type:"string",description:"lucide icon name"},tone:{type:"integer",description:"Accent-hue index 0–3 (amber/teal/rose/indigo)"},span:{type:"object",properties:{col:{type:"integer"},row:{type:"integer"}},description:"{col?, row?} — col clamped 1–4, row clamped 1–3"}},usageScenarios:["A hero tile (span col 2, row 2) holding a rendered preview inside a BentoGrid","Custom-bodied bento tile composed from child blocks"],constraints:["Spans are clamped 1–4 (col) / 1–3 (row) and emitted as static classes","Designed to sit inside a BentoGrid; standalone it renders as a lone card"]},Callout:{name:"Callout",description:"Emphasis callout panel: a tinted box (semantic or brand colour) with an icon, optional title and body. color-mix against the chosen token keeps the wash subtle and legible in light and dark.",category:"presentation",level:"L1",tags:["callout","note","alert","marketing"],props:{variant:{type:"string",enum:["info","success","warn","accent"],default:"info",description:"Colour/role: info (indigo) · success (green) · warn (amber) · accent (brand amber)"},title:{type:"string",description:"Emphasised lead line, coloured to the variant"},body:{type:"string",description:"Supporting paragraph"},icon:{type:"string",description:"Optional lucide icon name; defaults to a sensible glyph per variant"}},usageScenarios:["Inline 'Note' / 'Tip' block inside docs or a landing section","Success confirmation or warning banner above content"],constraints:["variant falls back to 'info' when omitted or unrecognised","icon defaults per variant (info→info, success→check, warn→alert, accent→sparkles)"]},PricingTable:{name:"PricingTable",description:"Responsive 2–4 column pricing grid of hairline cards. The `highlighted` plan gets an amber border + 'Popular' badge + solid amber CTA; others use an outline CTA. Features list with amber check glyphs. CTAs are {label, href} anchors.",category:"presentation",level:"L3",tags:["pricing","plans","marketing","conversion"],props:{plans:{type:"array",items:{type:"object",properties:{name:{type:"string"},price:{type:"string",description:"Display price, e.g. '$29' or 'Free'"},period:{type:"string",description:"Billing period suffix, e.g. '/mo'"},description:{type:"string",description:"Short plan summary line"},features:{type:"array",items:{type:"string"},description:"Bullet feature list"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber when highlighted, else outline"},highlighted:{type:"boolean",default:!1,description:"Mark the featured/popular plan"}}},description:"[{name, price, period?, description?, features[], cta{label,href}, highlighted?}]"},billingNote:{type:"string",description:"Mono note under the grid, e.g. 'Billed annually · cancel anytime'"}},usageScenarios:["Three-tier SaaS pricing section (Starter / Pro / Enterprise)","Two-up free-vs-paid comparison with a highlighted paid plan"],constraints:["Column count is derived from plans.length, clamped to 2–4","CTA props are {label, href}; href defaults to '#'","Mark at most one plan highlighted for a clear focal point"]},Testimonials:{name:"Testimonials",description:"Grid of testimonial cards (hairline `.mkt-card`, hover lift): optional star rating, serif italic pull-quote, and an initials avatar token + author + role. `columns` (1–3) controls the grid; avatar tints cycle the four accents.",category:"presentation",level:"L2",tags:["testimonials","social-proof","marketing","quotes"],props:{items:{type:"array",items:{type:"object",properties:{quote:{type:"string"},author:{type:"string"},role:{type:"string",description:"Author title / company"},avatar:{type:"string",description:"Explicit avatar token; defaults to author initials"},rating:{type:"integer",description:"Optional 1–5 star rating"}}},description:"[{quote, author, role?, avatar?, rating?}]"},columns:{type:"string",enum:["1","2","3"],description:"Grid column count (defaults from item count)"}},usageScenarios:["Three-up customer quote wall under a SectionHeader","Single highlighted testimonial beside a feature"],constraints:["avatar defaults to first-letter initials of author; no external images","rating is clamped to 0–5 and omitted when absent"]},LogoCloud:{name:"LogoCloud",description:"A single grayscale 'trusted by' logo strip. With no external images each logo is a mono wordmark (initials for long names); the row is dimmed/desaturated and lifts to full foreground on hover. Optional mono `label` above the row.",category:"presentation",level:"L1",tags:["logos","social-proof","marketing","brands"],props:{label:{type:"string",description:"Eyebrow above the row, e.g. 'Trusted by teams at'"},logos:{type:"array",items:{type:"object",properties:{name:{type:"string"}}},description:"Array of strings or [{name}] — rendered as mono wordmarks/initials"}},usageScenarios:["Logo strip directly under the hero for social proof","Press/partner row between sections"],constraints:["Text-only wordmarks — no external logo images are loaded","Names longer than 14 chars collapse to initials"]},StatBand:{name:"StatBand",description:"Big-number statistics band: oversized serif values with mono labels, divided by hairline rules. `tone` switches the surface — plain, muted (soft card panel) or inverse (ink-black panel with warm amber→rose glow + grain).",category:"presentation",level:"L2",tags:["stats","metrics","marketing","band"],props:{stats:{type:"array",items:{type:"object",properties:{value:{type:"string",description:"Big display value, e.g. '99.9%' or '12k+'"},label:{type:"string"},sub:{type:"string",description:"Optional sub-label under the metric"}}},description:"[{value, label, sub?}]"},tone:{type:"string",enum:["plain","muted","inverse"],default:"plain",description:"Surface treatment: plain (transparent) · muted (card panel) · inverse (ink-black glow panel)"}},usageScenarios:["Four-up headline metrics band (uptime / users / latency / saved)","Inverse-tone impact band between marketing sections"],constraints:["Column count derives from stats.length, clamped to 1–4","Values are display strings; pre-format numbers/units yourself"]},Newsletter:{name:"Newsletter",description:"Email-capture band: serif title + supporting line, then a token-styled email input beside a CTA anchor. Presentational — the input is decorative and the CTA navigates via {label, href}; wire real submission at the host.",category:"presentation",level:"L2",tags:["newsletter","subscribe","marketing","email"],props:{title:{type:"string",description:"Serif headline"},subtitle:{type:"string",description:"Supporting line under the title"},placeholder:{type:"string",default:"you@example.com",description:"Email input placeholder"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber submit button (defaults to 'Subscribe' / '#')"}},usageScenarios:["End-of-page 'Stay in the loop' email signup","Docs/blog newsletter band between content sections"],constraints:["Input is decorative; the form action points at cta.href — handle real submission upstream","Single email field + single CTA by design"]},Banner:{name:"Banner",description:"Slim full-width announcement bar: optional icon + message, an inline CTA link and a decorative dismiss '×'. `tone` picks one of the four brand accents; `solid` fills the strip with the accent instead of a soft tint.",category:"presentation",level:"L1",tags:["banner","announcement","marketing","notice"],props:{message:{type:"string",description:"Announcement text"},icon:{type:"string",description:"lucide icon name (defaults to 'sparkles')"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index (0 amber · 1 teal · 2 rose · 3 indigo)"},solid:{type:"boolean",default:!1,description:"Fill the strip with the accent colour"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — inline mono link on the right"},dismissible:{type:"boolean",default:!0,description:"Show the decorative × (presentational only)"}},usageScenarios:["Top-of-page launch/announcement strip above the hero","Soft-tint 'new docs available' notice between sections"],constraints:["The dismiss × is decorative — wire real dismissal at the host","tone is 0–3; CTA href defaults to '#'"]},FeatureSplit:{name:"FeatureSplit",description:"Alternating two-column feature section: an editorial text column (eyebrow, serif title, body, bulleted benefits, optional CTA) beside a visual column. The visual renders the `visual` slot (or children) — e.g. a BrowserFrame — falling back to a tinted blueprint placeholder. `reverse` flips the column order for an alternating page rhythm.",category:"presentation",level:"L3",tags:["feature","split","two-column","marketing"],props:{eyebrow:{type:"string",description:"Mono uppercase kicker"},title:{type:"string",description:"Serif feature title"},body:{type:"string",description:"Supporting paragraph"},bullets:{type:"array",items:{type:"object",properties:{icon:{type:"string"},text:{type:"string"}}},description:"Array of strings or [{icon?, text}] benefit rows"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber button"},reverse:{type:"boolean",default:!1,description:"Place the visual on the left"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index for the bullet chips / placeholder"}},slots:{visual:{description:"Right-pane visual (BrowserFrame, rendered preview, image); falls back to children then a placeholder"}},usageScenarios:["Alternating feature rows down a landing page (reverse every other)","Text + live BrowserFrame preview feature block"],constraints:["Provide a visual slot/children for the right pane; otherwise a tinted placeholder renders","bullets accept strings or {icon?, text}; CTA href defaults to '#'"]},ComparisonTable:{name:"ComparisonTable",description:"Feature comparison table across products/plans. The header lists columns (a `highlighted` column gets an amber-washed spine); each row pairs a feature label with one value per column — booleans render as amber check / muted cross glyphs, strings render verbatim. Horizontally scrollable on small screens.",category:"presentation",level:"L3",tags:["comparison","table","pricing","marketing"],props:{featureLabel:{type:"string",description:"Header label for the feature column (often blank)"},columns:{type:"array",items:{type:"object",properties:{name:{type:"string"},highlighted:{type:"boolean"}}},description:"Array of strings or [{name, highlighted?}] — column headers"},rows:{type:"array",items:{type:"object",properties:{feature:{type:"string"},values:{type:"array",items:{},description:"One value per column (boolean → ✓/✗, string → verbatim)"}}},description:"[{feature, values[]}] — values align positionally with columns"}},usageScenarios:["Plan feature comparison (Free / Pro / Enterprise) with a highlighted column","Product-vs-competitor capability matrix"],constraints:["values align by index with columns; missing/falsey values render as a muted cross","Booleans (or 'yes'/'no'/'true'/'false') become glyphs; other strings render verbatim"]},Roadmap:{name:"Roadmap",description:"Product roadmap / milestone timeline. A vertical rail with one node per milestone; node state drives the dot — a filled amber check for 'done', an amber ring + rocket for 'active', an outline flag for 'planned'. A marketing roadmap (distinct from the operational TimelineList activity log).",category:"presentation",level:"L2",tags:["roadmap","milestones","timeline","marketing"],props:{milestones:{type:"array",items:{type:"object",properties:{date:{type:"string",description:"Quarter/date label, e.g. 'Q3 2026'"},title:{type:"string"},desc:{type:"string"},state:{type:"string",enum:["done","active","planned"]}}},description:"[{date?, title, desc?, state?}] in sequence order"}},usageScenarios:["Public product roadmap section (shipped / in progress / planned)","Launch sequence with dated milestones"],constraints:["state defaults to 'planned' when omitted or unrecognised","milestones with an empty title are dropped"]},StatHighlight:{name:"StatHighlight",description:"Single big-number spotlight: an oversized serif value with an optional trend delta (up = amber, down = rose), a mono label and supporting copy. Draws the eye to one headline metric (distinct from StatBand's multi-stat row).",category:"presentation",level:"L1",tags:["stat","metric","highlight","marketing"],props:{value:{type:"string",description:"Big display value, e.g. '99.9%' or '12k+'"},label:{type:"string",description:"Mono uppercase label under the value"},body:{type:"string",description:"Supporting paragraph"},delta:{type:"string",description:"Trend delta pill text, e.g. '+12%'"},trend:{type:"string",enum:["up","down"],default:"up",description:"Delta direction: up (amber, arrow up) or down (rose, arrow down)"}},usageScenarios:["Centered headline metric between two content sections","Single KPI spotlight with a growth delta"],constraints:["Values/deltas are display strings; pre-format numbers/units yourself","trend only affects the delta pill colour/arrow; omit delta to hide the pill"]},IconList:{name:"IconList",description:"Benefit / checklist list with icons. Each item shows a tinted icon chip, a title and optional supporting line, laid into a 1–3 column grid; tints cycle the four accents. Lighter-weight than FeatureGrid (no card material) — for inline benefit/checklist runs.",category:"presentation",level:"L1",tags:["benefits","checklist","list","marketing"],props:{columns:{type:"string",enum:["1","2","3"],default:"2"},icon:{type:"string",description:"Default lucide icon for items without their own (defaults to 'check')"},items:{type:"array",items:{type:"object",properties:{icon:{type:"string"},title:{type:"string"},desc:{type:"string"}}},description:"Array of strings or [{icon?, title, desc?}]"}},usageScenarios:["Two-column 'what's included' benefit list","Checklist of capabilities under a SectionHeader"],constraints:["items accept plain strings (→ title only) or {icon?, title, desc?}","icon falls back to the block-level `icon` (default 'check'); unknown names → dot"]},Footer:{name:"Footer",description:"Multi-column marketing footer: a brand block (serif wordmark + tagline) beside grouped link columns, with a bottom rule carrying a copyright line and small print. Pure layout off theme tokens.",category:"presentation",level:"L2",tags:["footer","navigation","marketing","layout"],props:{brand:{type:"string",description:"Brand wordmark (serif display under .marketing)"},tagline:{type:"string",description:"Short brand tagline under the wordmark"},groups:{type:"array",items:{type:"object",properties:{title:{type:"string"},links:{type:"array",items:{type:"object",properties:{label:{type:"string"},href:{type:"string"}}}}}},description:"[{title, links:[{label, href}]}] link columns"},copyright:{type:"string",description:"Bottom-left copyright line"},note:{type:"string",description:"Bottom-right mono small print"}},usageScenarios:["Site-wide marketing footer with Product / Company / Legal columns","Compact footer with brand + a single link group"],constraints:["link href defaults to '#' when omitted; empty groups/links are dropped","The bottom rule only renders when copyright or note is provided"]},AccordionList:{name:"AccordionList",description:"General-purpose content accordion on native <details>/<summary> — fully functional with zero JS. Each row is a standalone hairline card with an optional leading icon chip, a title and a body. `defaultOpenFirst` opens the first row. (Faq is the divided-single-card Q&A variant.)",category:"presentation",level:"L2",tags:["accordion","details","content","marketing"],props:{title:{type:"string",description:"Optional serif heading above the list"},defaultOpenFirst:{type:"boolean",default:!1,description:"Open the first row by default"},items:{type:"array",items:{type:"object",properties:{icon:{type:"string",description:"Optional lucide icon for the row chip"},title:{type:"string"},body:{type:"string"}}},description:"[{icon?, title, body}] — rows with an empty title are dropped"}},usageScenarios:["Expandable feature explainers (icon + title + body) on a landing page","Docs 'details' sections with one card per topic"],constraints:["Uses native <details> so multiple rows can be open at once (no single-open behaviour)","Bodies render as plain text; pass pre-formatted strings"]},MetricCard:{name:"MetricCard",description:"KPI metric card with an inline pure-SVG sparkline: a mono label, a big value, a trend delta pill (up = amber, down = rose) and a sparkline drawn from a `points` series — no chart dependency. A `.mkt-card` with hover lift; `tone` selects the accent. Designed to sit in a Grid/StatGrid for a metrics row.",category:"presentation",level:"L2",tags:["metric","kpi","sparkline","card","dashboard"],props:{label:{type:"string",description:"Mono uppercase metric label"},value:{type:"string",description:"Big display value"},delta:{type:"string",description:"Trend delta pill, e.g. '+8.2%'"},trend:{type:"string",enum:["up","down"],default:"up",description:"Delta direction: up (amber) or down (rose)"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index for the sparkline stroke/fill"},points:{type:"array",items:{type:"number"},description:"Numeric series for the inline sparkline (auto-scaled)"}},usageScenarios:["Four-up KPI metrics row inside a Grid (revenue / users / latency / churn)","Single highlighted metric with a trend sparkline"],constraints:["points are auto-scaled to the card's min/max; keep series small (~<60 points)","value/delta are display strings; the sparkline is hidden when points is empty"]},GalleryGrid:{name:"GalleryGrid",description:"Caption gallery grid. Lays image tiles (or, with no `src`, a tinted blueprint placeholder) onto a 2–4 column responsive grid; a tile may opt into `wide` to span two columns for a mixed-rhythm mosaic. Captions sit on a gradient scrim over each tile. Hairline framing, hover lift — no external images required.",category:"presentation",level:"L2",tags:["gallery","images","grid","marketing"],props:{columns:{type:"string",enum:["2","3","4"],default:"3"},items:{type:"array",items:{type:"object",properties:{src:{type:"string",description:"Image URL; omit for a tinted placeholder"},caption:{type:"string",description:"Caption shown over a gradient scrim"},tone:{type:"integer",description:"Accent-hue index 0–3 for the placeholder"},wide:{type:"boolean",description:"Span two columns"}}},description:"[{src?, caption?, tone?, wide?}] gallery tiles"}},usageScenarios:["Screenshot gallery with a wide hero tile and smaller supporting tiles","Placeholder-driven layout mock before real imagery exists"],constraints:["src is treated as an image when it looks like a URL (http(s):/data:/leading slash); otherwise a placeholder renders","wide spans two columns from the sm breakpoint up"]}};var Qv=Pi(),Xv=Pt(),Zv=gi(),ji=Tt(),eC=mt(),ke=E(),tC=be(),rC=O(),nC=Se(),iC=ve(),vP=Yr(),sC=Bi(),oC=qi(),aC=Fi(),Zr=vl(),Cl=gt();var cC=Qv.Composer,lC=Xv.Document,uC=Zv.Schema,{YAMLError:dC,YAMLParseError:pC,YAMLWarning:gC}=ji,fC=eC.Alias,{isAlias:mC,isCollection:yC,isDocument:hC,isMap:bC,isNode:wC,isPair:SC,isScalar:vC,isSeq:CC}=ke,kC=tC.Pair,RC=rC.Scalar,xC=nC.YAMLMap,IC=iC.YAMLSeq;var AC=sC.Lexer,EC=oC.LineCounter,PC=aC.Parser,{parse:Re,parseAllDocuments:TC,parseDocument:OC,stringify:DC}=Zr,{visit:LC,visitAsync:NC}=Cl;class F extends Error{code;details;constructor(e,t,r){super(t);this.name="CompileSpecError",this.code=e,this.details=r}}function _C(e,t){let r=Object.hasOwn(t,e)?t[e]:void 0;if(!r)throw new F("unknown-template",`unknown template "${e}"`,{template:e});let n=r.pages[0]?.blocks[0];if(!n||n.type!=="PageLayout")throw new F("invalid-shell-root",`template "${e}" root is not PageLayout`,{template:e});return n}function en(e,t,r,n){let i=e;if(e.template){if(r.has(e.template))throw new F("template-cycle",`template cycle at "${e.template}"`,{template:e.template});let s=_C(e.template,t),o=new Set(r);o.add(e.template);let a={...s.slots,...e.slots};if(n&&!e.slots?.sidebar)delete a.sidebar;let c=e.children??s.children,l=e.events??s.events,g=e.visible??s.visible;return i={...s,...e.id?{id:e.id}:{},props:{...s.props,...e.props},slots:a,...c?{children:c}:{},...l?{events:l}:{},...g!==void 0?{visible:g}:{}},en(i,t,o,n)}return{...i,...i.children?{children:i.children.map((s)=>en(s,t,r,n))}:{},...i.slots?{slots:Object.fromEntries(Object.entries(i.slots).map(([s,o])=>[s,o.map((a)=>en(a,t,r,n))]))}:{}}}function MC(e){let t=(r)=>{if(r.template)return!0;if(r.children?.some(t))return!0;return Object.values(r.slots??{}).some((n)=>n.some(t))};return e.pages.some((r)=>r.blocks.some(t))}function kl(e,t){return e.map((r)=>{if("children"in r&&Array.isArray(r.children))return{type:"MenuGroup",props:{title:r.label},children:kl(r.children,t)};let n=r,i={label:n.label,href:n.path};if(n.icon)i.icon=n.icon;if(n.path===t)i.active=!0;return{type:"MenuLink",props:i}})}function $C(e){let t=e.menus?.items;if(!t?.length)return e;return{...e,pages:e.pages.map((r)=>({...r,blocks:r.blocks.map((n)=>{if(n.type!=="PageLayout")return n;if(n.slots?.sidebar?.length)return n;return{...n,slots:{...n.slots,sidebar:[{type:"PageSiderMenu",props:{title:r.title??n.props?.title??"Menu"},children:kl(t,r.path)}]}}})}))}}function Ui(e,t={}){let r=Boolean(e.menus?.items?.length),n=MC(e)?{...e,pages:e.pages.map((i)=>({...i,blocks:i.blocks.map((s)=>en(s,t,new Set,r))}))}:e;return $C(n)}function Rl(e,t){if(e===void 0)return;function r(){throw new F("invalid-layout","Invalid application or page layout",{...t?{pageId:t}:{}})}if(!e||typeof e!=="object"||Array.isArray(e))r();for(let[n,i]of Object.entries(e)){if(t!==void 0&&n==="inherit"&&typeof i==="boolean")continue;let s=Pn[n];if(!Object.hasOwn(Pn,n)||!s?.includes(i))r()}}function xl(e,t){if(Rl(e.layout),Rl(t.layout,t.id),!t.blocks.some((o)=>o.type==="PageLayout"&&o.props?.appearance!=="standalone")){if(!t.layout)return t.blocks;if(Object.keys(t.layout).some((a)=>a!=="inherit"&&a!=="container"))throw new F("invalid-layout","Standalone pages only support container layout",{pageId:t.id});if(t.blocks.some((a)=>a.type==="PageLayout"&&a.props?.appearance==="standalone"))return t.blocks.map((a)=>a.type==="PageLayout"?{...a,props:{...a.props,layout:{container:t.layout?.container??"fluid"}}}:a);return[{type:"PageLayout",props:{appearance:"standalone",layout:{container:t.layout.container??"fluid"}},children:t.blocks}]}if(!e.layout&&!t.layout)return t.blocks;let{inherit:n,...i}=t.layout??{},s={...ia,...t.layout?.inherit===!1?{}:e.layout,...i};return t.blocks.map((o)=>o.type==="PageLayout"?{...o,props:{...o.props,layout:s}}:o)}function BC(e){aa(e);let t=new Map,r=new Map,n=new Map,i=(s,o)=>{if(s.id!==void 0){if(n.has(s.id)){let a=n.get(s.id);throw new F("duplicate-block-id",`Block id "${s.id}" is declared more than once`,{blockId:s.id,firstPageId:a,pageId:o})}n.set(s.id,o)}for(let a of s.children??[])i(a,o);for(let a of Object.values(s.slots??{}))for(let c of a)i(c,o)};return e.pages.forEach((s,o)=>{let a=t.get(s.id);if(a!==void 0)throw new F("duplicate-page-id",`Page id "${s.id}" is declared more than once`,{pageId:s.id,firstIndex:a,pageIndex:o});if(t.set(s.id,o),r.has(s.path)){let c=r.get(s.path);throw new F("duplicate-page-path",`Page path "${s.path}" is declared more than once`,{path:s.path,firstPageId:c,pageId:s.id})}r.set(s.path,s.id);for(let c of s.blocks)i(c,s.id)}),new Set(n.keys())}function qC(e,t,r){while(!0){let n=t.counter++,i=r?`${r}_${n}`:`${e}_${n}`;if(!t.reservedIds.has(i)&&!t.assignedIds.has(i))return i}}function Hi(e,t,r,n,i,s){let o=e.id??qC(t,n,s??i);if(n.assignedIds.has(o))throw new F("duplicate-block-id",`Block id "${o}" is declared more than once`,{blockId:o,pageId:t});n.assignedIds.add(o);let a=(e.children??[]).map((g)=>Hi(g,t,r,n,o,o)),c={};for(let[g,p]of Object.entries(e.slots??{}))c[g]=p.map((d)=>Hi(d,t,r,n,o,`${o}_${g}`));let l={id:o,pageId:t,type:e.type,...i?{parentId:i}:{},...e.props?{props:e.props}:{},...a.length?{children:a}:{},...Object.keys(c).length?{slots:c}:{},...e.events?{events:e.events}:{},...e.visible!==void 0?{visible:e.visible}:{},...e.template?{template:e.template}:{},...e.variant?{variant:e.variant}:{}};return r[o]=l,o}function Vi(e,t={}){e=Ui(e,t);let n={counter:0,reservedIds:BC(e),assignedIds:new Set},i=Object.create(null);return{version:"2.0",pages:e.pages.map((o)=>{let a=[];for(let c of xl(e,o))a.push(Hi(c,o.id,i,n));return{id:o.id,path:o.path,...o.title?{title:o.title}:{},rootBlockIds:a,...o.state?{state:o.state}:{},...o.auth?{auth:o.auth}:{},...o.lifecycle?{lifecycle:o.lifecycle}:{},...o.computed?{computed:o.computed}:{},...o.urlState?{urlState:o.urlState}:{}}}),...e.design?{design:e.design}:{},...e.connections?{connections:e.connections.map((o)=>({...o}))}:{},blocks:i}}var Mt=[{id:"_state",generation:{syntax:"page-state path",positions:["props","computed","action-value","visible"],example:{_state:"open"},prerequisite:"Declare the path on the same page"},bucket:"client",description:"Reads a value from the page state store"},{id:"_bindState",generation:{syntax:"page-state path",positions:["binding"],example:{_bindState:"name"},prerequisite:"Only installed controls implementing two-way binding"},bucket:"client",description:"Two-way state binding (read + write)"},{id:"_payload",generation:{syntax:"payload field",positions:["request-context"],example:{_payload:"name"},prerequisite:"Caller must supply request payload; ordinary preview props have no payload"},bucket:"client",description:"Request payload field"},{id:"_event",generation:{syntax:"event field",positions:["action-value"],example:{_event:"value"},prerequisite:"Only within an event action; permitted fields: type,name,value,checked,values. Read own-property dotted paths such as values.id or values.name"},bucket:"client",description:"Event payload field (e.g. form submit value)"},{id:"_global",generation:{syntax:"host-global field",positions:["host-context"],example:{_global:"configuredValue"},prerequisite:"Host-dependent and excluded from ordinary creation; no secrets"},bucket:"client",description:"Global (window) property access"},{id:"_if",generation:{syntax:"[condition, then, else]",positions:["props","computed","action-value"],example:{_if:[{_state:"open"},"Open","Closed"]}},bucket:"client",description:"Conditional ternary: [condition, then, else]"},{id:"_eq",generation:{syntax:"[a, b]",positions:["props","computed","action-value","visible","predicate"],example:{_eq:[{_state:"status"},"Active"]}},bucket:"client",description:"Equality: [a, b] → a === b"},{id:"_ne",generation:{syntax:"[a, b]",positions:["props","computed","action-value","visible","predicate"],example:{_ne:[{_state:"status"},"Active"]}},bucket:"client",description:"Inequality: [a, b] → a !== b"},{id:"_contains",generation:{syntax:"[haystack, needle]",positions:["props","computed","action-value","visible","predicate"],example:{_contains:[{_state:"name"},"orion"]}},bucket:"client",description:"Case-insensitive substring match: [haystack, needle] → haystack contains needle (empty needle → true)"},{id:"_gt",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_gt:[{_state:"count"},0]}},bucket:"client",description:"Greater-than for finite numbers: [a, b] → a > b. Non-numbers are false"},{id:"_lt",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_lt:[{_state:"count"},10]}},bucket:"client",description:"Less-than for finite numbers: [a, b] → a < b. Non-numbers are false"},{id:"_gte",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_gte:[{_state:"count"},0]}},bucket:"client",description:"Greater-or-equal for finite numbers: [a, b] → a >= b. Non-numbers are false"},{id:"_lte",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_lte:[{_state:"count"},10]}},bucket:"client",description:"Less-or-equal for finite numbers: [a, b] → a <= b. Non-numbers are false"},{id:"_in",generation:{syntax:"[value, array]",positions:["props","computed","action-value","visible","predicate"],example:{_in:[{_state:"status"},["Active","Draft"]]}},bucket:"client",description:"Membership: [value, array] → array includes value"},{id:"_not",generation:{syntax:"condition",positions:["props","computed","action-value","visible","predicate"],example:{_not:{_state:"open"}}},bucket:"client",description:"Logical NOT"},{id:"_and",generation:{syntax:"[condition, ...]",positions:["props","computed","action-value","visible","predicate"],example:{_and:[{_state:"ready"},{_state:"open"}]}},bucket:"client",description:"Logical AND over a list of conditions"},{id:"_or",generation:{syntax:"[condition, ...]",positions:["props","computed","action-value","visible","predicate"],example:{_or:[{_state:"ready"},{_state:"open"}]}},bucket:"client",description:"Logical OR over a list of conditions"},{id:"_user",generation:{syntax:"session user field",positions:["props","computed","action-value"],example:{_user:"name"},prerequisite:"Requires injected host session; no server ACL guarantee"},bucket:"client",description:"Current session user field (client-visible)"},{id:"_item",generation:{syntax:"item field or empty string",positions:["predicate","loop-props"],example:{_item:"name"},prerequisite:"Only inside a declared loop or filter/find predicate"},bucket:"client",description:"Current list item in a loop scope"},{id:"_index",generation:{syntax:"ignored scalar marker",positions:["predicate","loop-props"],example:{_index:0},prerequisite:"Only inside a declared loop or filter/find predicate"},bucket:"client",description:"Current list index in a loop scope"},{id:"_array.length",generation:{syntax:"array expression",positions:["props","computed","action-value"],example:{"_array.length":{_state:"rows"}}},bucket:"client",description:"Array length"},{id:"_string.concat",generation:{syntax:"[value, ...]",positions:["props","computed","action-value"],example:{"_string.concat":["Hello ",{_state:"name"}]}},bucket:"client",description:"String concatenation over a list"},{id:"_number.add",generation:{syntax:"[left, right] (finite numbers)",positions:["action-value"],example:{"_number.add":[{_state:"count"},1]},prerequisite:"Both operands must evaluate to finite numbers or the action fails and writes nothing; use it in SetState value for counters (e.g. SetState count = count + 1), never for strings or arrays"},bucket:"client",description:"Finite number addition: [left, right] → left + right. Throws on non-number, non-finite or overflowing operands (no coercion, no fallback to 0)"},{id:"_computed",generation:{syntax:"computed name",positions:["props","computed","action-value","visible"],example:{_computed:"filtered"},prerequisite:"Declare page computed expression"},bucket:"client",description:"Reads a derived (computed) state value by name from the __computed namespace"},{id:"_filter",generation:{syntax:"[array, predicate]",positions:["props","computed","action-value"],example:{_filter:[{_state:"rows"},{_eq:[{_item:"status"},"Active"]}]}},bucket:"client",description:"Filters an array: [arrayExpr, predExpr] with { _item, _index } scope"},{id:"_find",generation:{syntax:"[array, predicate]",positions:["props","computed","action-value"],example:{_find:[{_state:"rows"},{_eq:[{_item:"name"},"Orion"]}]}},bucket:"client",description:"Finds the first matching element: [arrayExpr, predExpr] with { _item, _index } scope"},{id:"_len",generation:{syntax:"array/string/object expression",positions:["props","computed","action-value"],example:{_len:{_state:"rows"}}},bucket:"client",description:"Length of an array, string, or object (0 if empty)"},{id:"_concat",generation:{syntax:"[value, ...]",positions:["props","computed","action-value"],example:{_concat:[[1],[2]]},prerequisite:"Concatenation is not numeric addition"},bucket:"client",description:"Concatenates a list: arrays are joined, otherwise values are string-concatenated"},{id:"_count",generation:{syntax:"array or [array, predicate?]",positions:["props","computed","action-value"],example:{_count:[{_state:"rows"}]}},bucket:"client",description:"Count of an array, or of elements matching a predicate: [array, predicate?]"},{id:"_groupCount",generation:{syntax:"[array, field]",positions:["props","computed","action-value"],example:{_groupCount:[{_state:"rows"},"status"]}},bucket:"client",description:"Counts array items by a field in one pass: [array, field] → { value: count }"},{id:"_sort",generation:{syntax:"[array, {by, order?, rank?}]",positions:["props","computed","action-value"],example:{_sort:[{_state:"rows"},{by:"name",order:"asc"}]}},bucket:"client",description:"Stable sort: [array, { by, order?: asc|desc, rank?: { field: values[] } }]. rank is enum order"},{id:"_js",generation:{syntax:"disabled",positions:[],example:{_js:"disabled"},prerequisite:"Arbitrary code execution is disabled; permissions do not enable it",disabled:!0},bucket:"client",description:"Legacy JS expression; execution is always disabled"}],tn=new Set(Mt.map((e)=>e.id));var Il=new Set(na),FC=new Map(Mt.map((e)=>[e.id,e])),Pl=new Set(["array","boolean","integer","null","number","object","string"]),Tl=new Set(["additionalProperties","default","description","enum","items","properties","required","type"]);function Al(e){if(!e)return[];return Object.keys(e)}function jC(e){if(!e||e.type!=="array")return;let t=e.items;if(!t||typeof t!=="object"||t.type!=="object"||!t.properties)return;return new Set(Object.keys(t.properties))}function zi(e,t,r){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let[n,i]of e.entries())zi(i,`${t}[${n}]`,r);return}for(let[n,i]of Object.entries(e)){let s=t?`${t}.${n}`:n;r(n,i,s),zi(i,s,r)}}function rn(e,t,r,n,i,s,o,a){zi(n,i,(c,l,g)=>{if((c==="_state"||c==="_bindState")&&typeof l==="string"){let p=l.split("."),d=p[0]??"";if(d==="__computed"){let u=p[1]??"";if(!o.has(u))e.push({code:"refs:computed-declared",message:`${t}: _computed "${u}" is not declared`,elementKey:r,path:g});return}if(!s.has(d))e.push({code:"refs:state-declared",message:`${t}: _state "${d}" is not declared in state`,elementKey:r,path:g})}if(c==="_computed"&&typeof l==="string"&&!o.has(l))e.push({code:"refs:computed-declared",message:`${t}: _computed "${l}" is not declared`,elementKey:r,path:g});if(c==="_item"&&typeof l==="string"&&l!==""&&a&&!a.has(l))e.push({code:"item:field-exists",message:`${t}: _item "${l}" is not in the item schema`,elementKey:r,path:g})})}function H(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function $t(e){return H(e)&&Object.keys(e).some((t)=>t.startsWith("_"))}var El=new Set(["_eq","_ne","_contains","_gt","_lt","_gte","_lte","_in","_not","_and","_or"]);function UC(e,t){if(new Set(["_eq","_ne","_contains","_gt","_lt","_gte","_lte","_in","_filter","_find","_groupCount","_sort","_number.add"]).has(e)){if(!Array.isArray(t)||t.length!==2)return!1;if(e==="_groupCount")return typeof t[1]==="string";if(e==="_sort"){let n=t[1];if(!H(n))return!1;if(!(typeof n.by==="string"&&n.by.length>0||Array.isArray(n.by)&&n.by.length>0&&n.by.every((s)=>typeof s==="string"&&s.length>0)))return!1;if(n.order!==void 0&&n.order!=="asc"&&n.order!=="desc")return!1;if(n.rank!==void 0&&(!H(n.rank)||Object.values(n.rank).some((s)=>!Array.isArray(s))))return!1;return Object.keys(n).every((s)=>["by","order","rank"].includes(s))}return!0}if(e==="_if")return Array.isArray(t)&&t.length===3;if(e==="_and"||e==="_or")return Array.isArray(t)&&t.length>0;if(e==="_string.concat"||e==="_concat")return Array.isArray(t)&&t.length>0;if(e==="_count")return!Array.isArray(t)||t.length===1||t.length===2;if(e==="_index")return typeof t==="number"&&Number.isFinite(t);if(["_state","_bindState","_computed","_event","_global","_payload","_user"].includes(e))return typeof t==="string"&&t.length>0;if(e==="_item")return typeof t==="string";return!0}function Ol(e){return e.enum===void 0||Array.isArray(e.enum)&&e.enum.length>0&&e.enum.every((t)=>t===null||typeof t==="string"||typeof t==="boolean"||typeof t==="number"&&Number.isFinite(t))}function _e(e,t,r,n,i,s){if(r==="predicate"&&(!$t(e)||!El.has(Object.keys(e)[0]??"")))return n.push({code:"props:expression",message:`${i}: predicate must be a supported expression node`,elementKey:s,path:t}),!1;if(e===void 0)return n.push({code:"props:expression",message:`${i}: value is not part of the supported serialized expression syntax`,elementKey:s,path:t}),!1;if(Array.isArray(e))return e.reduce((d,u,m)=>_e(u,`${t}[${m}]`,r,n,i,s)&&d,!0);if(!H(e)){if(typeof e==="number"&&!Number.isFinite(e)||e!==null&&!["string","number","boolean"].includes(typeof e))return n.push({code:"props:expression",message:`${i}: value is not part of the supported serialized expression syntax`,elementKey:s,path:t}),!1;return e===null||["string","number","boolean"].includes(typeof e)}let o=Object.keys(e).filter((d)=>d.startsWith("_"));if(o.length===0)return Object.entries(e).reduce((d,[u,m])=>_e(m,`${t}.${u}`,r,n,i,s)&&d,!0);let a=o[0]??"",c=FC.get(a),l=`${t}.${a}`;if(o.length!==1||Object.keys(e).length!==1||!c)return n.push({code:"props:expression",message:`${i}: expression shape is not supported`,elementKey:s,path:l}),!1;if(c.generation?.disabled||!c.generation?.positions.includes(r)&&!(r==="props"&&c.generation?.positions.includes("binding"))&&!(r==="predicate-value"&&c.generation?.positions.some((d)=>["props","computed","predicate"].includes(d))))return n.push({code:"props:expression",message:`${i}: expression is not supported in this value position`,elementKey:s,path:l}),!1;let g=e[a];if(!UC(a,g))return n.push({code:"props:expression",message:`${i}: expression operand shape is not supported`,elementKey:s,path:l}),!1;let p=(d)=>$t(d)||Array.isArray(d);if(["_filter","_find","_groupCount","_sort"].includes(a)&&!p(Array.isArray(g)?g[0]:void 0)||a==="_in"&&!p(Array.isArray(g)?g[1]:void 0))return n.push({code:"props:expression",message:`${i}: expression array operand has an unsupported literal shape`,elementKey:s,path:l}),!1;if(a==="_count"&&(Array.isArray(g)?!p(g[0]):!p(g))||a==="_array.length"&&!p(g))return n.push({code:"props:expression",message:`${i}: expression array operand has an unsupported literal shape`,elementKey:s,path:l}),!1;if(["_gt","_lt","_gte","_lte"].includes(a)&&Array.isArray(g)){if(g.some((u)=>!$t(u)&&(typeof u!=="number"||!Number.isFinite(u))))return n.push({code:"props:expression",message:`${i}: numeric comparison literals must be finite numbers`,elementKey:s,path:l}),!1}if(Array.isArray(g))return g.reduce((d,u,m)=>{let f=r;if((["_filter","_find"].includes(a)||a==="_count")&&m===1)f="predicate";else if(r==="predicate"||r==="predicate-value"){if(f=El.has(a)?"predicate-value":r,r==="predicate"&&["_and","_or"].includes(a))f="predicate"}return _e(u,`${l}[${m}]`,f,n,i,s)&&d},!0);if(H(g))return _e(g,l,r==="predicate"&&a==="_not"?"predicate-value":r,n,i,s);return!0}function Gi(e,t,r,n,i,s,o){let a=(p)=>o==="props"?`props:${p}`:`actions:params-${p}`;if(Object.keys(t).filter((p)=>!Tl.has(p)).length>0){n.push({code:"schema:unsupported",message:`${i}: schema contains unsupported constraints`,elementKey:s,path:r});return}if(t.type!==void 0&&!Pl.has(t.type)){n.push({code:"schema:unsupported",message:`${i}: schema type is not supported`,elementKey:s,path:r});return}if(!Ol(t)){n.push({code:"schema:unsupported",message:`${i}: schema enum is not supported`,elementKey:s,path:r});return}if(t.required!==void 0&&(!Array.isArray(t.required)||t.required.some((p)=>typeof p!=="string"))){n.push({code:"schema:unsupported",message:`${i}: schema required list is not supported`,elementKey:s,path:r});return}if(t.items!==void 0&&(t.type!=="array"||!H(t.items))){n.push({code:"schema:unsupported",message:`${i}: schema items must describe an array`,elementKey:s,path:r});return}if(t.properties!==void 0&&(t.type!=="object"||!H(t.properties))){n.push({code:"schema:unsupported",message:`${i}: schema properties must describe an object`,elementKey:s,path:r});return}if(t.required?.length&&t.type!=="object"){n.push({code:"schema:unsupported",message:`${i}: schema required list is only supported for objects`,elementKey:s,path:r});return}if($t(e))return;let l=t.type;if(!(l===void 0||l==="null"&&e===null||l==="string"&&typeof e==="string"||l==="boolean"&&typeof e==="boolean"||l==="number"&&typeof e==="number"&&Number.isFinite(e)||l==="integer"&&typeof e==="number"&&Number.isInteger(e)||l==="array"&&Array.isArray(e)||l==="object"&&H(e))){n.push({code:a("type"),message:`${i}: value does not match the declared type`,elementKey:s,path:r});return}if(t.enum&&!t.enum.some((p)=>Object.is(p,e)))n.push({code:a("enum"),message:`${i}: value is outside the declared enum`,elementKey:s,path:r});if(l==="object"&&H(e)){if(t.additionalProperties===!1){for(let p of Object.keys(e))if(!Object.hasOwn(t.properties??{},p))n.push({code:o==="props"?"props:unknown":"actions:params-unknown",message:`${i}: object field is not declared`,elementKey:s,path:`${r}.${p}`})}for(let p of t.required??[])if(!Object.hasOwn(e,p))n.push({code:a("required"),message:`${i}: required object field is missing`,elementKey:s,path:`${r}.${p}`});for(let[p,d]of Object.entries(t.properties??{}))if(Object.hasOwn(e,p))Gi(e[p],d,`${r}.${p}`,n,i,s,o)}if(l==="array"&&Array.isArray(e)&&t.items)e.forEach((p,d)=>{Gi(p,t.items,`${r}[${d}]`,n,i,s,o)})}function Dl(e,t,r,n,i,s,o){if(!r)return;for(let[a,c]of Object.entries(r)){let l=`${n}.${a}`;if(Ki(c,l,e,i,s)&&t&&Object.hasOwn(t,a))Gi(t[a],c,l,e,i,s,o)}}function Ll(e,t,r,n,i,s,o={}){for(let[a,c]of Object.entries(t??{})){let l=n==="action-value"&&!o.evaluatedParams?.has(a)?"action-literal":n;_e(c,`${r}.${a}`,l,e,i,s)}}function Ki(e,t,r,n,i){if(Object.keys(e).some((o)=>!Tl.has(o))||e.type!==void 0&&!Pl.has(e.type)||!Ol(e)||e.required!==void 0&&(!Array.isArray(e.required)||e.required.some((o)=>typeof o!=="string"))||e.items!==void 0&&(e.type!=="array"||!H(e.items))||e.properties!==void 0&&(e.type!=="object"||!H(e.properties))||e.additionalProperties!==void 0&&(e.type!=="object"||typeof e.additionalProperties!=="boolean")||Boolean(e.required?.length)&&e.type!=="object")return r.push({code:"schema:unsupported",message:`${n}: schema contains unsupported constraints`,elementKey:i,path:t}),!1;for(let[o,a]of Object.entries(e.properties??{}))if(!Ki(a,`${t}.${o}`,r,n,i))return!1;if(e.items&&!Ki(e.items,`${t}[]`,r,n,i))return!1;return!0}function nn(e,t,r,n,i,s,o){if(!Array.isArray(n)){if(o)e.push({code:"actions:chain",message:`${t}: action chain must be an array`,elementKey:r,path:i});return}for(let[a,c]of n.entries()){if(!H(c)){if(o)e.push({code:"actions:chain",message:`${t}: action step must be an object`,elementKey:r,path:`${i}[${a}]`});continue}let l=c.action,g=`${i}[${a}]`;if(o&&(typeof l!=="string"||l.length===0))e.push({code:"actions:chain",message:`${t}: action step needs an action name`,elementKey:r,path:`${g}.action`});if(typeof l==="string"&&!Il.has(l)&&!Object.hasOwn(s.actions??{},l))e.push({code:"actions:registered",message:`${t}: action "${l}" is not in the catalog. Registered actions: ${[...Il,...Object.keys(s.actions??{})].join(", ")}. No equivalent is guaranteed: preserve the requirement and report unsupported behavior instead of disabling it.`,elementKey:r,path:`${g}.action`});if(o&&typeof l==="string"){let p=Object.hasOwn(s.actions??{},l)?s.actions[l]:Object.hasOwn(En,l)?En[l]:void 0,d=c.params;if(d!==void 0&&!H(d))e.push({code:"actions:chain",message:`${t}: action params must be an object`,elementKey:r,path:`${g}.params`});else{if(H(d))Ll(e,d,`${g}.params`,"action-value",t,r,{evaluatedParams:new Set(p?.generation?.evaluatedParams??[])});if(p)Dl(e,H(d)?d:void 0,p.params,`${g}.params`,t,r,"actions:params")}}if(Object.hasOwn(c,"onSuccess"))nn(e,t,r,c.onSuccess,`${g}.onSuccess`,s,o);if(Object.hasOwn(c,"onError"))nn(e,t,r,c.onError,`${g}.onError`,s,o)}}function Nl(e,t,r=!1){let n=[],i=new Set([...Al(e.state),...e.connectionIds??[]]),s=new Set(Al(e.computed)),o=e.pageId??e.root;if(e.computed)for(let[a,c]of Object.entries(e.computed)){if(r)_e(c,`computed.${a}`,"computed",n,`${o}.computed`,o);rn(n,`${o}.computed`,o,c,`computed.${a}`,i,s,HC(e,t))}if(e.urlState)for(let[a,c]of Object.entries(e.urlState)){if(!i.has(a))n.push({code:"refs:url-state-declared",message:`${o}: urlState "${a}" is not declared in state`,elementKey:o,path:`urlState.${a}`});if(!c||typeof c.param!=="string"||c.param.length===0)n.push({code:"refs:url-state-declared",message:`${o}: urlState "${a}" needs a param name`,elementKey:o,path:`urlState.${a}.param`})}for(let[a,c]of Object.entries(e.elements)){let l=Object.hasOwn(t.components,c.type)?t.components[c.type]:void 0;if(!l)continue;let g=`${o}/${a}`,p=_l(l.props);if(r)Ll(n,c.props,"props","props",g,a);if(c.visible!==null&&typeof c.visible==="object"){let d=Object.keys(c.visible);if(Array.isArray(c.visible)||d.length!==1||!d[0]?.startsWith("_"))n.push({code:"visibility:expression",message:`${g}: visible must be a boolean or an operator expression, not a literal record`,elementKey:a,path:"visible"})}if(r&&c.visible!==void 0)if(typeof c.visible!=="boolean"&&!$t(c.visible))n.push({code:"visibility:expression",message:`${g}: visible must be a boolean or an operator expression`,elementKey:a,path:"visible"});else _e(c.visible,"visible","visible",n,g,a);if(rn(n,g,a,c.props,"props",i,s,p),rn(n,g,a,c.visible,"visible",i,s,p),rn(n,g,a,c.events,"events",i,s,p),l.props){let d=new Set(Object.keys(l.props));for(let u of Object.keys(c.props??{}))if(!d.has(u))n.push({code:"props:declared",message:`${g}: prop "${u}" is not declared on ${c.type}`,elementKey:a,path:`props.${u}`});if(r)Dl(n,c.props,l.props,"props",g,a,"props")}if(l.events){let d=new Set(Object.keys(l.events));for(let[u,m]of Object.entries(c.events??{})){if(!d.has(u))n.push({code:"events:declared",message:`${g}: event "${u}" is not declared on ${c.type}`,elementKey:a,path:`events.${u}`});nn(n,g,a,m,`events.${u}`,t,r)}}else for(let[d,u]of Object.entries(c.events??{}))nn(n,g,a,u,`events.${d}`,t,r)}return n.map((a)=>({...a,path:a.elementKey===o?`${o}/${a.path}`:`${o}/${a.elementKey}/${a.path}`}))}function _l(e){let t=new Set;for(let r of Object.values(e??{})){let n=jC(r);if(!n)continue;for(let i of n)t.add(i)}return t.size>0?t:void 0}function HC(e,t){let r=new Set;for(let n of Object.values(e.elements)){let i=Object.hasOwn(t.components,n.type)?t.components[n.type]:void 0,s=_l(i?.props);if(!s)continue;for(let o of s)r.add(o)}return r.size>0?r:void 0}function Ml(e){return e.map((t)=>({code:t.code,message:t.message,elementKey:t.elementKey,path:t.path}))}var $l=[{id:"_request",bucket:"server",description:"Executes a connection request server-side and injects the result"},{id:"_secret",bucket:"server",description:"Reads a server-side secret value; never transmitted to the client"}],sn=new Set($l.map((e)=>e.id));function on(e){if(!e||typeof e!=="object"||Array.isArray(e))return e;let t=e;if(typeof t.version==="number")return{...t,version:Number.isInteger(t.version)?t.version.toFixed(1):String(t.version)};return t}function Wi(e){return{...e,...e.props?{props:{...e.props}}:{},...e.children?{children:[...e.children]}:{},...e.slots?{slots:{...e.slots}}:{},...e.events?{events:{...e.events}}:{}}}function Bl(e){return{...e,...e.roots?{roots:[...e.roots]}:{},...e.state?{state:{...e.state}}:{},elements:Object.fromEntries(Object.entries(e.elements).map(([t,r])=>[t,Wi(r)]))}}function zC(e){return e.type==="compiler:operator"}function GC(e){return e.type==="compiler:validator"}class Bt{operators;validators;constructor(e={}){let t=(e.capabilities??[]).filter(zC).map((n)=>n.contribution),r=(e.capabilities??[]).filter(GC).map((n)=>n.contribution);this.operators=[...e.operators??[],...t],this.validators=[...e.validators??[],...r]}merge(e){if(e instanceof Bt)return new Bt({operators:[...this.operators,...e.operators],validators:[...this.validators,...e.validators]});return new Bt({operators:[...this.operators,...e.operators??[]],validators:[...this.validators,...e.validators??[]],...e.capabilities?{capabilities:e.capabilities}:{}})}}function KC(e={}){return new Bt(e)}function Yi(e,t={}){let r=t.format??"auto";if(r==="json")return on(JSON.parse(e));if(r==="yaml")return on(Re(e));let n=e.trim();if(n.startsWith("{")||n.startsWith("["))return on(JSON.parse(n));return on(Re(e))}function WC(e,t,r){let n=e.pages.find((o)=>o.id===t),i=[...n?.rootBlockIds??[]],s=Object.fromEntries(Object.entries(e.blocks).filter(([,o])=>o.pageId===t).map(([o,a])=>{let{id:c,pageId:l,parentId:g,...p}=a;return[o,Wi(p)]}));if(r&&i.length===0){let o=e.blocks.__empty__?`__empty__:${t}`:"__empty__";i.push(o),s[o]={type:"Empty"}}return{version:e.version,root:i[0]??"__empty__",roots:i,pageId:t,...n?.state?{state:n.state}:{},...n?.computed?{computed:n.computed}:{},...n?.urlState?{urlState:n.urlState}:{},...e.connections?{connectionIds:e.connections.map((o)=>o.id)}:{},elements:s}}function YC(e,t){let r=[...t.roots??e.roots??[]];if(r.length>0&&t.root!==e.root)r[0]=t.root;else if(r.length===0&&t.elements[t.root])r.push(t.root);return r}async function JC(e,t,r,n){let i=Bl(e);for(let s of r.operators){let o={spec:i,catalog:t,warnings:n,getElement(c){return i.elements[c]},updateElement(c,l){i={...i,elements:{...i.elements,[c]:Wi(l)}}},addWarning(c){n.push(c)}},a=await s.apply(o);if(a)i=Bl(a)}return i}function ql(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function QC(e,t,r,n,i){let s=Object.entries(e.elements);for(let a of e.roots?.length?e.roots:[e.root])if(!e.elements[a])r.push({code:"missing-root",message:`Root element "${a}" is missing from the elements map`,elementKey:a});for(let[a,c]of s){if(!(ql(t.components,c.type)??ql(t.templates,c.type)))n.push({missingType:c.type,elementKey:a,reason:c.template?"missing-template":"missing-component",context:`Element ${a} references ${c.type}`,path:`blocks.${a}.type`});for(let g of c.children??[])if(!e.elements[g])r.push({code:"dangling-child",message:`Element "${a}" references missing child "${g}"`,elementKey:a})}let o=Nl(e,t,i);if(i){for(let a of o)n.push({missingType:a.code,elementKey:a.elementKey,reason:"invalid-spec",context:a.message,code:a.code,path:a.path});return}r.push(...Ml(o))}async function XC(e,t,r,n,i){for(let s of r.validators){let o={spec:e,catalog:t,warnings:n,gaps:i,addWarning(a){n.push(a)},addGap(a){i.push(a)}};await s.validate(o)}}function Ze(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let r of e)Ze(r,t);return}for(let[r,n]of Object.entries(e)){if(r.startsWith("_"))t.add(r);Ze(n,t)}}function ZC(e){let t=new Map;for(let[n,i]of Object.entries(e.blocks)){let s=new Set;Ze(i.props,s),Ze(i.visible,s);for(let o of s){let a=t.get(o)??new Set;a.add(n),t.set(o,a)}}for(let n of e.pages){let i=new Set;Ze(n.computed,i),Ze(n.lifecycle,i);for(let s of i){let o=t.get(s)??new Set;o.add(n.id),t.set(s,o)}}let r=[];for(let[n,i]of t){let s=tn.has(n)?"client":sn.has(n)?"server":n==="_ref"?"build":"shared";r.push({operatorId:n,bucket:s,blockIds:[...i]})}return r}async function Fl(e,t,r={}){let n=[],i=[],s=r.registry??KC(),o=Vi(e,r.templates),a=Object.create(null),c=[];for(let[p,d]of o.pages.entries()){let u=WC(o,d.id,p===0),m=await JC(u,t,s,n);QC(m,t,n,i,r.strict===!0),await XC(m,t,s,n,i);for(let[f,y]of Object.entries(m.elements)){let S=a[f];if(S)throw new F("duplicate-block-id",`Compiler output block id "${f}" conflicts across pages`,{blockId:f,firstPageId:S.pageId,pageId:d.id});let C=o.blocks[f];a[f]={...y,id:f,pageId:d.id,...C?.pageId===d.id&&C.parentId?{parentId:C.parentId}:{}}}c.push({...d,rootBlockIds:YC(u,m)})}let l={version:"2.0",pages:c,...o.design?{design:o.design}:{},...o.connections?{connections:o.connections.map((p)=>({...p}))}:{},blocks:a};if(r.strict===!0&&e.version!=="2.0")i.push({missingType:"spec:version",elementKey:"spec",reason:"invalid-spec",context:"Native Spec version must be 2.0",code:"spec:version",path:"version"});let g=ZC(l);return{spec:l,gaps:i,warnings:n,...g.length>0?{operatorUsage:g}:{}}}import{readFileSync as ck}from"node:fs";var jl=["auto","user","override"];function an(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function ek(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function et(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{meta:"",body:e.trim()};return{meta:(t[1]??"").trim(),body:(t[2]??"").trim()}}function cn(e){let{meta:t}=et(e);if(!t)throw Error("design-md file is missing YAML frontmatter");let r=Re(t);if(!r||typeof r!=="object")throw Error("design-md frontmatter must be a YAML object");let n=typeof r.title==="string"?r.title.trim():"",i=typeof r.name==="string"?r.name.trim():"",s=n||i;if(!s)throw Error("design-md frontmatter must include a non-empty 'title' or 'name' field");let o=an(r.id)??an(r.slug)??ek(s);if(!o)throw Error("design-md frontmatter must include a non-empty 'id' field");let a={id:o,title:s,category:an(r.category)??"general",tags:Array.isArray(r.tags)?r.tags:[],origin:typeof r.origin==="string"?r.origin:"local"};if(i)a.name=i;if(typeof r.version==="string"&&r.version.trim())a.version=r.version.trim();let c=an(r.description);if(c)a.description=c;if(typeof r.sourceUrl==="string")a.sourceUrl=r.sourceUrl;if(Array.isArray(r.exemptRules)){let l=r.exemptRules.filter((g)=>typeof g==="string"&&g.trim().length>0);if(l.length>0)a.exemptRules=l.map((g)=>g.trim())}if(Array.isArray(r.extractedTokens))a.extractedTokens=r.extractedTokens;if(typeof r.layer==="string")if(jl.includes(r.layer))a.layer=r.layer;else console.warn(`[design-md] ignoring invalid layer "${r.layer}" on id="${a.id}"; expected one of ${jl.join("|")}`);return a}var tk=["colors","typography","rounded","spacing","components"],rk=["themes","forbidden"],Hl=new Set([...tk,...rk]),nk=new Set(["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","fontFeature","fontVariation"]);function xe(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function ln(e){return Object.fromEntries(Object.entries(xe(e)).flatMap(([t,r])=>typeof r==="string"||typeof r==="number"?[[t,String(r)]]:[]))}function Ul(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function ik(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function sk(e){let{meta:t,body:r}=et(e),n=[],i=[];for(let[s,o]of[t,...ik(r)].entries()){if(!o.trim())continue;let a;try{a=xe(Re(o))}catch(c){if(s===0)n.push({severity:"error",message:`frontmatter is not valid YAML: ${c.message}`});continue}if(s===0||Object.keys(a).some((c)=>Hl.has(c)))i.push(a)}return{sources:i,issues:n}}function ok(e){let t={};for(let[r,n]of Object.entries(xe(e)))if(typeof n==="string")t[r]={fontFamily:n};else{let i={};for(let[s,o]of Object.entries(xe(n)))if(nk.has(s)&&(typeof o==="string"||typeof o==="number"))i[s]=o;t[r]=i}return t}function Ji(e){let{sources:t}=sk(e),r=Object.assign({},...t);if(!Object.keys(r).some((c)=>Hl.has(c)))return;let n={colors:ln(r.colors),typography:ok(r.typography),rounded:ln(r.rounded),spacing:Object.fromEntries(Object.entries(xe(r.spacing)).flatMap(([c,l])=>typeof l==="string"||typeof l==="number"?[[c,l]]:[])),components:Object.fromEntries(Object.entries(xe(r.components)).map(([c,l])=>[c,ln(l)]))},i=Object.fromEntries(Object.entries(xe(r.themes)).map(([c,l])=>[c,ln(l)]));if(Object.keys(i).length)n.themes=i;let s=xe(r.forbidden),o=Ul(s.colors),a=Ul(s.fonts);if(o.length||a.length)n.forbidden={colors:o,fonts:a};return n}var ak=[{pattern:/`?(--[\w-]+)`?\s*:\s*([#\w()%., ]+)/g,group:"css-var"},{pattern:/`?([\w-]+(?:Color|Bg|Text|Border|Shadow|Radius|Font|Size|Space))`?\s*[=:]\s*["']?([^"'\n,]+)["']?/gi,group:"token"}];function Qi(e){let t=new Set,r=[];for(let{pattern:n,group:i}of ak){let s=new RegExp(n.source,n.flags),o;while((o=s.exec(e))!==null){let a=(o[1]??"").trim(),c=(o[2]??"").trim(),l=`${a}:${c}`;if(!t.has(l))t.add(l),r.push({name:a,value:c,group:i})}}return r}function qt(e){let t=ck(e,"utf-8"),{body:r}=et(t),n=cn(t),i=Ji(t),s=n.extractedTokens??(i&&Object.keys(i.colors).length?Object.entries(i.colors).map(([a,c])=>({name:a,value:c,group:"color"})):Qi(r)),o={id:n.id,title:n.title,category:n.category,tags:n.tags??[],origin:n.origin??"local",body:r,filePath:e};if(n.sourceUrl)o.sourceUrl=n.sourceUrl;if(n.description)o.description=n.description;if(i)o.tokens=i;if(n.exemptRules)o.exemptRules=n.exemptRules;if(n.layer)o.layer=n.layer;if(s.length>0)o.extractedTokens=s;return o}import{fileURLToPath as lk}from"node:url";import{existsSync as uk,readdirSync as dk}from"node:fs";import{join as pk}from"node:path";var Vl=lk(new URL("../content",import.meta.url));function un(e=Vl){if(!uk(e))return[];let t=[];for(let r of dk(e).sort()){if(r.startsWith("_")||!r.endsWith(".design.md"))continue;try{t.push(qt(pk(e,r)))}catch(n){console.warn(`[design-md] skipping seed ${r}: ${n.message}`)}}return t}function yk(e){return e==="quality"?"blocking":"advisory"}var hk=["streamline your","empower your","supercharge your","unlock the power","best-in-class","enterprise-grade","next-generation","cutting-edge","revolutionize","game-changer","game changer","future-proof","seamless experience","drive growth","harness the power","take it to the next level","world-class","state-of-the-art","robust solution","powerful platform","effortlessly","seamlessly integrate","elevate your","transform your"],bk=["Inter","Roboto","Geist","Fraunces","Plus Jakarta","Space Grotesk"];function de(e,t){let r=e.match(t);return r?r.length:0}var wk=[{id:"marketing-buzzword",category:"slop",severity:"P2",message:"Marketing buzzwords read as AI filler — prefer concrete, specific copy.",detect:(e)=>{let t=e.toLowerCase();return hk.reduce((r,n)=>r+(t.includes(n)?1:0),0)}},{id:"em-dash-overuse",category:"slop",severity:"P3",message:"Em-dash overuse (≥5) is a strong AI-writing tell.",detect:(e)=>{let t=de(e,/[—]|--(?=\S)/g);return t>=5?t-4:0}},{id:"aphoristic-cadence",category:"slop",severity:"P2",message:'Manufactured-contrast cadence ("Not an X. Just Y.") is a recognizable AI pattern.',detect:(e)=>{let t=de(e,/\bNot\s+(?:an?|just)\b[^.?!]*[.?!]/gi),r=de(e,/\b[A-Z][^.?!]*\.\s+(?:No|Just)\s+[a-z]/g),n=t+r;return n>=3?n:0}},{id:"numbered-section-markers",category:"slop",severity:"P3",message:"Numbered section scaffolding (01 / 02 / 03) is an overused AI layout tell.",detect:(e)=>{let t=e.match(/\b(0[1-9]|1[0-2])\b/g)??[],r=new Set(t);if(r.size<3)return 0;let n=[...r].map(Number).sort((s,o)=>s-o);return n.some((s,o)=>o>0&&s-n[o-1]===1)?r.size:0}}],Sk=[{id:"gradient-text",category:"slop",severity:"P2",message:"Gradient text (bg-clip-text + transparent) is a classic AI hero tell.",detect:(e)=>de(e,/bg-clip-text[^"']*text-transparent|text-transparent[^"']*bg-clip-text|-webkit-background-clip\s*:\s*text/gi)},{id:"ai-color-palette",category:"slop",severity:"P2",message:"Purple/violet gradient palette is the most recognizable AI color tell.",detect:(e)=>de(e,/(from|via|to)-(purple|violet|fuchsia|indigo)-\d{3}|linear-gradient\([^)]*(?:#(?:8b5cf6|a855f7|7c3aed|6366f1))/gi)},{id:"side-tab",category:"slop",severity:"P2",message:"Thick colored side-border on a card (border-l-4 + accent) is the single most recognizable AI card tell.",detect:(e)=>de(e,/border-l-(4|8)\s+border-(purple|violet|indigo|blue|primary)/gi)},{id:"overused-font",category:"slop",severity:"P3",message:"Over-represented font (Inter/Geist/…) without a brand reason reads as default AI styling.",detect:(e)=>bk.reduce((t,r)=>t+(new RegExp(`font-family[^;"']*${r}`,"i").test(e)?1:0),0)},{id:"emoji-icon",category:"slop",severity:"P2",message:"Emoji used as a heading/list/button icon is a stock AI tell — use a real icon or nothing.",detect:(e)=>de(e,/<(?:h[1-6]|li|button|summary|th)\b[^>]*>\s*(?:<[^>]+>\s*)*\p{Extended_Pictographic}/giu)},{id:"github-dark-glow",category:"slop",severity:"P3",message:"Flat #0D1117 background with a neon cyan/violet glow is the default AI dark-mode look.",detect:(e)=>/#0d1117/i.test(e)&&/(?:box-shadow|drop-shadow|text-shadow)[^;"']*(?:#06b6d4|#22d3ee|#00f0ff|#a78bfa|#8b5cf6|cyan|violet)/i.test(e)?1:0},{id:"tiny-text",category:"quality",severity:"P1",message:"Body text below ~14px (text-[10px]/[11px]/[12px]) harms readability and accessibility.",detect:(e)=>de(e,/text-\[(?:8|9|10|11|12)px\]|font-size\s*:\s*(?:8|9|10|11|12)px/gi)},{id:"gray-on-color",category:"quality",severity:"P1",message:"Gray text on a colored fill commonly fails WCAG contrast.",detect:(e)=>de(e,/bg-(?:primary|blue|indigo|violet|purple)-\d{3}[^"']*text-(?:gray|slate|zinc|neutral)-\d{3}/gi)}],zl={P0:0.3,P1:0.15,P2:0.08,P3:0.04};function vk(e){if(e>=0.9)return"A";if(e>=0.8)return"B";if(e>=0.65)return"C";if(e>=0.5)return"D";return"F"}var Gl="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",vO=new RegExp(`["']?\\b(?:${Gl})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),CO=new RegExp(`^\\s*-?\\s*(?:${Gl})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function Kl(e){let t=e.text??e.html??"",r=e.html??e.text??"",n=new Set(e.exempt??[]),i=[],s=(a,c)=>{for(let l of a){let g=yk(l.category);if(g==="advisory"&&n.has(l.id))continue;let p=l.detect(c);if(p>0)i.push({ruleId:l.id,category:l.category,severity:l.severity,level:g,message:l.message,count:p})}};s(wk,t),s(Sk,r);let o=1;for(let a of i){let c=Math.min(zl[a.severity]*(1+(a.count-1)/3),zl[a.severity]*2);o-=c}return o=Math.max(0,Math.min(1,o)),{score:o,grade:vk(o),findings:i,blocked:i.some((a)=>a.level==="blocking")}}import{readdirSync as Ck,readFileSync as kk,statSync as Rk}from"node:fs";import{basename as xk,join as Ik}from"node:path";var Ak="0.1.0";function Wl(e){let{dir:t}=e,r;try{r=Ck(t)}catch{return[]}let n=e.defaultVersion??Ak,i=e.defaultLevel??"L4",s=e.defaultCategory??"template",o=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Ik(t,a);try{if(!Rk(c).isFile())continue}catch{continue}let l=kk(c,"utf8");if(!l.trim())continue;let g=xk(a).replace(/\.ya?ml$/i,""),p=Ek(g),d=Pk(g),u=Tk(l)??`${d} template`;o.push({name:p,version:n,title:d,description:u,yaml:l,absolutePath:c,templateContract:{name:p,description:u,level:i,category:s,keywords:[p,g.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:Ok(l)}})}return o.sort((a,c)=>a.name.localeCompare(c.name))}function Xi(e){let t=new Map;for(let r of e)for(let n of Wl(r)){let i=t.get(n.name);if(i)throw Error(`duplicate template source name "${n.name}": ${i.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function Ek(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function Pk(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function Tk(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function Ok(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var MO=new Set(or),$O=new Set(sr);var Lk=/^(unknown|unlicensed|none|n\/?a)$/i;function Zi(e){let t=e?.trim();if(!t||Lk.test(t))return;return t}var Nk="uibot.resource.index.v1";class rt extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function G(e,t){return e<t?-1:e>t?1:0}function M(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function _k(e){let t=M(e).replace(/ /g,"-");if(!t)throw new rt("invalid-resource-source-id",e);return t}function pe(e,t){return`${e}:${_k(t)}`}function dn(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=M(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>G(r,n)).map(([,r])=>r)}function Ft(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function Mk(e){let t=Zi(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.sourceHash?{sourceHash:e.sourceHash}:{},...e.packageName?{packageName:e.packageName}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function tt(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:dn(e.tags),aliases:dn(e.aliases),capabilities:dn(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(G),source:Mk(e.source),receipt:e.receipt,...e.solution?{solution:structuredClone(e.solution)}:{}}}function $k(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function Bk(e){if(e.solution){let t=(r)=>{if(r&&typeof r==="object"){for(let n of Object.values(r))t(n);Object.freeze(r)}};t(e.solution)}return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function qk(e){let t=new Map;for(let r of Object.keys(e).sort(G)){let n=e[r];if(!n)continue;let i=pe("component",r);for(let s of dn([r,n.name])){let o=M(s),a=t.get(o)??[];if(!a.includes(i))a.push(i);t.set(o,a.sort(G))}}return t}function Fk(e,t,r){let n=r.get(M(e))??[];if(n.length===0)throw new rt("dangling-resource-dependency",`${t} -> ${pe("component",e)}`);if(n.length>1)throw new rt("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function jk(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return pe("template",i);return Fk(e,t,r)}function jt(e,t,r){return Zi(r?.[e]??t)}function Yl(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>G(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[pe("template",t)]}))}function Jl(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],s=e.skills??[],o=e.licenses,a=qk(t),c=[];for(let u of Object.keys(t).sort(G)){let m=t[u];if(!m)continue;let f=pe("component",u),y=jt(f,void 0,o);c.push(tt({id:f,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[u,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:u,...y?{license:y}:{}},receipt:Ft(Boolean(y))}))}for(let u of Object.keys(r).sort(G)){let m=r[u];if(!m)continue;let f=pe("template",u),y=jt(f,void 0,o);c.push(tt({id:f,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[u,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((S)=>jk(S,f,a,r)),source:{type:"template-contract",id:u,...y?{license:y}:{}},receipt:Ft(Boolean(y))}))}for(let u of[...n].sort((m,f)=>G(m.id,f.id))){let m=pe("design-guide",u.id),f=jt(m,void 0,o);c.push(tt({id:m,kind:"design-guide",title:u.title,description:$k(u),category:u.category,tags:u.tags,aliases:[u.id,u.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:u.id,...u.sourceUrl?{url:u.sourceUrl}:{},...f?{license:f}:{}},receipt:Ft(Boolean(f))}))}for(let u of[...i].sort((m,f)=>G(m.id,f.id))){let m=pe("example",u.id),f=jt(m,u.license,o);c.push(tt({id:m,kind:"example",title:u.title,description:u.description,...u.category?{category:u.category}:{},tags:u.tags??[],aliases:[u.id,u.title,...u.aliases??[]],capabilities:u.capabilities??[],dependencies:u.dependencies??[],source:{type:"example",id:u.id,...u.version?{version:u.version}:{},...u.sourceUrl?{url:u.sourceUrl}:{},...f?{license:f}:{}},receipt:Ft(Boolean(f))}))}for(let u of[...s].sort((m,f)=>G(m.id,f.id))){let m=pe("skill",u.id),f=jt(m,void 0,o);c.push(tt({id:m,kind:"skill",title:u.title,description:u.description?.trim()||u.title,tags:[...u.tags??[],...u.triggers??[]],aliases:[u.id,u.title,...u.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:u.id,...u.version?{version:u.version}:{},...f?{license:f}:{}},receipt:Ft(Boolean(f))}))}for(let u of e.additional??[])c.push(tt(u));c.sort((u,m)=>G(u.id,m.id));let l=new Set;for(let u of c){if(l.has(u.id))throw new rt("duplicate-resource-id",u.id);l.add(u.id)}for(let u of c)for(let m of u.dependencies)if(!l.has(m))throw new rt("dangling-resource-dependency",`${u.id} -> ${m}`);let g=new Map;for(let u of c)for(let m of u.aliases){let f=M(m);if(!f)continue;let y=g.get(f)??new Set;y.add(u.id),g.set(f,y)}let p=Object.freeze(Object.fromEntries([...g.entries()].sort(([u],[m])=>G(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(G))]))),d=Object.freeze(c.map(Bk));return Object.freeze({schemaVersion:Nk,resources:d,aliases:p})}var Uk=[["chat","assistant","聊天","助手","对话"],["document","documents","文档","写作"],["auth","authentication","认证","登录"],["data table","data grid","datatable","table","表格","数据表","数据表格"],["button","action button","按钮","操作按钮"],["dashboard","admin dashboard","仪表盘","后台","管理后台"],["kanban","kanban board","看板","任务看板"],["form","input form","表单","输入表单"],["navigation","nav","sidebar","导航","侧边栏"]],Hk=Object.freeze(Uk.map((e)=>Object.freeze([...e]))),Ql=new Map;for(let e of Hk){let t=Object.freeze([...new Set(e.map(M).filter(Boolean))].sort());for(let r of t)Ql.set(r,t)}function es(e){let t=M(e);return Ql.get(t)??Object.freeze([t])}class ne extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var ns=Object.freeze({function:180,scenario:180,unit:180,industry:180,"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),Vk=Object.freeze(Object.keys(ns)),Xl=new Map(Vk.map((e,t)=>[e,t])),Zl=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function K(e,t){return e<t?-1:e>t?1:0}function eu(e){return new Set((e??[]).map(M).filter(Boolean))}function Me(e,t){let r=eu(t);if(r.size===0)return!0;let n=eu(e);return[...r].some((i)=>n.has(i))}function zk(e,t){if(!Me(e.solution?.functions??[],t.functions))return!1;if(!Me(e.solution?.scenarios??[],t.scenarios))return!1;if(!Me(e.solution?[e.solution.unit]:[],t.units))return!1;if(!Me(e.solution?.industries??[],t.industries))return!1;if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!Me(e.tags,t.tags))return!1;if(!Me(e.category?[e.category]:[],t.categories))return!1;if(!Me(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function Gk(e){return Boolean(e.functions?.length||e.scenarios?.length||e.units?.length||e.industries?.length||e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function ae(e,t,r,n=ns[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function ts(e,t){return e.find((r)=>M(r)===t)}function rs(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities,...e.solution?.functions??[],...e.solution?.scenarios??[],...e.solution?.industries??[]]}function Kk(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,s)=>s);for(let i=1;i<=e.length;i+=1){let s=[i],o=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(s[a-1]??r+1)+1,c);s.push(l),o=Math.min(o,l)}if(o>r)return r+1;n=s}return n[t.length]??r+1}function tu(e,t){let r=M(t),n=[];if(M(e.id)===r)ae(n,"exact-id",e.id);if(M(e.title)===r)ae(n,"exact-title",e.title);let i=ts(e.aliases,r);if(i)ae(n,"alias",i);let s=ts(e.tags,r);if(s)ae(n,"tag",s);let o=ts(e.capabilities,r);if(o)ae(n,"capability",o);if(e.category&&M(e.category)===r)ae(n,"category",e.category);if(!i){let l=es(r).filter((p)=>p!==r),g=new Set(rs(e).map(M));if(l.some((p)=>g.has(p)))ae(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=M(rs(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))ae(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let g of rs(e)){let p=M(g);if(p.length<4)continue;let d=Kk(r,p,2);if(d<=2&&(!l||d<l.distance||d===l.distance&&K(g,l.value)<0))l={value:g,distance:d}}if(l)ae(n,"fuzzy",l.value,ns.fuzzy-l.distance)}return n.sort((l,g)=>{if(l.score!==g.score)return g.score-l.score;return(Xl.get(l.code)??99)-(Xl.get(g.code)??99)||K(l.value,g.value)})}function ru(e,t,r){if(t.has(r))return[r];let n=M(r),i=e.aliases[n];if(i?.length)return[...i];let s=new Set;for(let o of es(n))for(let a of e.aliases[o]??[])s.add(a);return[...s].sort(K)}function nu(e,t){return new ne("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function pn(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),s=ru(e,t,i);if(s.length===0)throw new ne("resource-not-found",i);if(s.length>1)throw nu(i,s);let o=s[0],a=o?t.get(o):void 0;if(!a)throw new ne("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!Gk(n))throw new ne("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new ne("resource-query-invalid-limit",String(n.limit));let s=e.resources.filter((o)=>zk(o,n)).filter((o)=>!i||tu(o,i).length>0).map((o)=>{let a=i?tu(o,i):[];for(let[c,l]of[[n.functions,"function"],[n.scenarios,"scenario"],[n.units,"unit"],[n.industries,"industry"]])if(c?.length)ae(a,l,c.join(","));return{resource:o,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((o)=>!i||o.reasons.length>0).sort((o,a)=>a.score-o.score||K(o.resource.id,a.resource.id));return n.limit===void 0?s:s.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((d)=>!d.trim()))throw new ne("resource-query-empty","at least one build root is required");let i=[],s=new Set;for(let d of n){let u=d.trim(),m=ru(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw nu(u,m);else{let f=m[0];if(f)s.add(f)}}let o=new Set,a=new Set,c=new Set,l=[],g=[],p=(d,u)=>{if(o.has(d))return;if(a.has(d)){i.push({id:d,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(d);if(!m){i.push({id:d,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(d),c.add(d);let f=[...m.dependencies].sort((y,S)=>{let C=t.get(y),k=t.get(S);return(Zl.get(C?.kind??"")??99)-(Zl.get(k?.kind??"")??99)||K(y,S)});for(let y of f)g.push({from:d,to:y,relation:"depends-on"}),p(y,d);a.delete(d),o.add(d),l.push(d)};for(let d of[...s].sort(K))p(d);return{roots:[...s].sort(K),nodes:[...c].sort(K).map((d)=>{let u=t.get(d);if(!u)throw new ne("resource-not-found",d);return{id:d,kind:u.kind,maturity:u.receipt.maturity}}),edges:g.sort((d,u)=>K(d.from,u.from)||K(d.to,u.to)),order:l,gaps:i.sort((d,u)=>K(d.id,u.id)||K(d.requiredBy??"",u.requiredBy??"")||K(d.reason,u.reason))}}})}function is(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");Qk(e);let t=e;if(t.schemaVersion!=="uibot.public-resources.v1"||typeof t.release?.version!=="string"||!/^[a-f0-9]{64}$/.test(t.release?.sourceHash)||t.index?.schemaVersion!=="uibot.resource.index.v1"||!Array.isArray(t.index.resources)||!t.index.aliases||!t.showcases)throw Error("invalid-public-resource-bundle");if(t.documents&&(!Array.isArray(t.documents)||t.documents.some((i)=>typeof i.title!=="string"||typeof i.markdown!=="string"||!/^\/(?:en\/)?docs\/[a-z0-9-]+$/.test(i.path))))throw Error("invalid-public-documentation");let r=new Set,n=new Set;for(let i of t.index.resources){if(!i||typeof i.id!=="string"||r.has(i.id)||!lt.includes(i.kind)||!i.id.startsWith(`${i.kind}:`)||typeof i.description!=="string"||typeof i.title!=="string"||!Array.isArray(i.dependencies)||!i.source||!i.receipt||!Array.isArray(i.aliases)||!Array.isArray(i.tags)||!Array.isArray(i.capabilities)||![i.aliases,i.dependencies,i.tags,i.capabilities].every((o)=>o.every((a)=>typeof a==="string"&&a.length<=1000))||!["catalog","template-contract","design-md","example","skill","registry","package","theme"].includes(i.source.type)||typeof i.source.id!=="string"||i.source.sourceHash!==void 0&&!/^[a-f0-9]{64}$/.test(i.source.sourceHash)||i.source.packageName!==void 0&&(typeof i.source.packageName!=="string"||!i.source.packageName.startsWith("@uibot/"))||!je.includes(i.receipt.maturity)||!sa.includes(i.receipt.level)||!Array.isArray(i.receipt.evidence)||!i.receipt.evidence.every((o)=>typeof o==="string")||!or.every((o)=>sr.includes(i.receipt.checks?.[o])))throw Error("invalid-public-resource");if(r.add(i.id),i.solution){let o=i.solution;if(![o.functions,o.scenarios,o.industries,o.hostRequirements,o.limitations].every((a)=>Array.isArray(a)&&a.every((c)=>typeof c==="string"&&c.length>0&&c.length<=2000))||!["page","flow","industry"].includes(o.unit)||!["interactive-demo","needs-enhancement"].includes(o.readiness)||o.members!==void 0&&(!Array.isArray(o.members)||o.members.some((a)=>typeof a.resourceId!=="string"||typeof a.version!=="string"||!a.version||a.sourceHash!==void 0&&(typeof a.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(a.sourceHash)))))throw Error("invalid-resource-solution")}let s=t.showcases[i.id];if(!s||s.resourceId!==i.id||typeof s.docs?.zh!=="string"||typeof s.docs?.en!=="string"||!Array.isArray(s.examples)||!Array.isArray(s.distributions))throw Error("invalid-resource-showcase");if(s.collection!==void 0){let o=s.collection;if(!o||typeof o.id!=="string"||!/^[a-z0-9-]+$/.test(o.id)||typeof o.group?.id!=="string"||!/^[a-z0-9-]+$/.test(o.group.id)||[o.title,o.group.title].some((a)=>!a||[a.zh,a.en].some((c)=>typeof c!=="string"||!c.trim()||c.length>200)))throw Error("invalid-resource-collection")}if(s.agentKit!==void 0){let o=s.agentKit;if(n.has(i.source?.id))throw Error("invalid-resource-agent-kit");if(n.add(i.source?.id),!o||!["skill","prompt","recipe"].includes(o.type)||(o.type==="skill"?i.kind!=="skill":i.kind!=="example")||!/^[a-z][a-z0-9-]*$/.test(i.source.id)||o.fileName!=={skill:"SKILL.md",prompt:"PROMPT.md",recipe:"RECIPE.md"}[o.type]||[o.summary?.zh,o.summary?.en].some((a)=>typeof a!=="string"||!a.trim())||!Array.isArray(o.resources)||new Set(o.resources.map((a)=>a?.id)).size!==o.resources.length||o.resources.some((a)=>!a||!i.dependencies.includes(a.id)||!t.index.resources.some((c)=>c.id===a.id&&(c.source.version??null)===a.version)||a.version!==null&&(typeof a.version!=="string"||!a.version)||typeof a.contentHash!=="string"||!/^[a-f0-9]{64}$/.test(a.contentHash)||a.sourceHash!==void 0&&(typeof a.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(a.sourceHash)))||o.resources.length!==i.dependencies.length)throw Error("invalid-resource-agent-kit")}if(s.solutionControls!==void 0){let o=new Set;if(!Array.isArray(s.solutionControls)||s.solutionControls.some((a)=>{if(!a||typeof a.id!=="string"||o.has(a.id)||typeof a.label?.zh!=="string"||typeof a.label?.en!=="string"||!Array.isArray(a.values)||!a.values.length||a.values.some((c)=>!["string","boolean","number"].includes(typeof c)||typeof c==="number"&&!Number.isFinite(c))||typeof a.target?.pageId!=="string"||typeof a.target?.property!=="string"||["__proto__","prototype","constructor"].includes(a.target.property)||a.target.blockId!==void 0&&typeof a.target.blockId!=="string")return!0;return o.add(a.id),!1}))throw Error("invalid-solution-controls")}if(s.templateContract&&(s.templateContract.name!==i.source.id||typeof s.templateContract.description!=="string"||!["L3","L4","L5"].includes(s.templateContract.level)||!["feature","template","page","app"].includes(s.templateContract.category)||!Array.isArray(s.templateContract.keywords)))throw Error("invalid-public-template-contract");if(typeof s.title?.zh!=="string"||typeof s.title?.en!=="string"||s.examples.some((o)=>!o||typeof o.id!=="string"||typeof o.title!=="string"||typeof o.code!=="string"||!["spec","tsx","source"].includes(o.mode)||!["tsx","json","yaml","css","ts"].includes(o.language)||!Array.isArray(o.dependencies)||!o.dependencies.every((a)=>typeof a==="string"))||s.distributions.some((o)=>!o||!["spec","npm","shadcn"].includes(o.channel)||typeof o.name!=="string"||!/^[@a-zA-Z0-9._/-]+$/.test(o.name)||typeof o.version!=="string"||!["source","published"].includes(o.availability)))throw Error("invalid-resource-content")}for(let[i,s]of Object.entries(t.index.aliases))if(!i||!Array.isArray(s)||s.some((o)=>!r.has(o)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((i)=>!r.has(i)))throw Error("unexpected-public-resource-showcase");for(let i of t.index.resources)for(let s of i.dependencies)if(!r.has(s))throw Error("invalid-public-resource-dependency");if(t.distributionSnapshot){let i=t.distributionSnapshot;if(!/^[a-f0-9]{64}$/.test(i.snapshotId)||i.manifestPath!==`../snapshots/${i.snapshotId}/snapshot.json`||!i.resources||!i.unavailable||!i.external||Object.entries(i.external).some(([s,o])=>!Object.hasOwn(i.unavailable,s)||!Array.isArray(o)||o.some((a)=>typeof a!=="string"||a.startsWith("@uibot/"))))throw Error("invalid-distribution-snapshot-reference");for(let[s,o]of Object.entries(i.resources))if(!r.has(s)||o.version!==(t.index.resources.find((a)=>a.id===s)?.source.version??t.release.version)||!/^[a-f0-9]{64}$/.test(o.resourceHash)||!Array.isArray(o.entrypoints)||!o.entrypoints.length||!Array.isArray(o.closure)||![...o.entrypoints,...o.closure].every((a)=>/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(a))||o.entrypoints.some((a)=>!o.closure.includes(a)))throw Error("invalid-distribution-snapshot-resource")}}function iu(e){is(e),e=JSON.parse(JSON.stringify(e));let t=(i)=>{if(i&&typeof i==="object"){for(let s of Object.values(i))t(s);Object.freeze(i)}};t(e);let r=pn(e.index),n=(i)=>{let s=r.get(i),o=e.showcases[s.id];if(!o)throw new ne("resource-not-found",s.id);return o};return Object.freeze({...r,get(i){let s=r.get(i),o=n(i).agentKit;return o?Object.freeze({...s,agentKit:o}):s},docs(i,s="zh",o=1){if(s!=="zh"&&s!=="en")throw Error("unsupported-resource-locale");let a=n(i);return{resourceId:a.resourceId,locale:s,...Yk(a.docs[s],o),release:e.release}},examples(i,s=1){let o=n(i);return{resourceId:o.resourceId,...Jk(o.examples,s),release:e.release}},installPlan(i){let s=n(i);return{resourceId:s.resourceId,distributions:s.distributions,dependencies:r.build([s.resourceId]),release:e.release,snapshot:e.distributionSnapshot&&Object.hasOwn(e.distributionSnapshot.resources,s.resourceId)?{snapshotId:e.distributionSnapshot.snapshotId,manifestPath:e.distributionSnapshot.manifestPath,...e.distributionSnapshot.resources[s.resourceId]}:null,snapshotUnavailable:e.distributionSnapshot?.unavailable[s.resourceId]??null,install:s.distributions.map((o)=>Wk(o,e.distributionSnapshot,s.resourceId))}}})}function Wk(e,t,r){let{channel:n,name:i,version:s}=e;if(n==="npm")return{channel:n,name:i,command:`add ${i}@${s}`,note:null};if(n==="spec")return{channel:n,name:i,command:null,note:"Read the Spec through examples and compile it strictly with the matching Catalog."};let o=!!t&&Object.hasOwn(t.resources,r),a=t?.external[r]??[];return{channel:n,name:i,command:`shadcn add @uibot/${i}`,registries:{"@uibot":"/r/{name}.json"},externalRegistryDependencies:a,note:o?"A hash-pinned snapshot exists: export and verify it, then map @uibot to the local snapshot server.":a.length?`No hash-pinned snapshot: the install also pulls stock shadcn items (${a.join(", ")}) from the host's default registry. Installing through the portal mapping still works; report the files as not snapshot-verified.`:"No hash-pinned snapshot; report the files as not snapshot-verified."}}var Ie=24000;function su(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new ne("resource-query-invalid-limit","page is outside the available range")}function Yk(e,t){let r=Math.max(1,Math.ceil(e.length/Ie));return su(t,r),{markdown:e.slice((t-1)*Ie,t*Ie),page:t,totalPages:r,...t<r?{nextPage:t+1}:{}}}function Jk(e,t){let r=e.flatMap((n)=>Array.from({length:Math.max(1,Math.ceil(n.code.length/Ie))},(i,s)=>({...n,code:n.code.slice(s*Ie,(s+1)*Ie),codeOffset:s*Ie,codeLength:n.code.length,complete:n.code.length<=Ie})));return su(t,r.length),{examples:r.slice(t-1,t),page:t,totalPages:r.length,...t<r.length?{nextPage:t+1}:{}}}function Qk(e){let t=0,r=0,n=new Set,i=(s,o)=>{if(++t>300000||o>64)throw Error("public-resource-budget-exceeded");if(typeof s==="string"){if(r+=new TextEncoder().encode(s).length,r>16777216)throw Error("public-resource-budget-exceeded")}else if(s&&typeof s==="object"){if(n.has(s))throw Error("invalid-public-resource-cycle");let a=Object.getPrototypeOf(s);if(!Array.isArray(s)&&a!==Object.prototype&&a!==null)throw Error("invalid-public-resource-object");n.add(s);for(let[c,l]of Object.entries(s))i(c,o+1),i(l,o+1);n.delete(s)}else if(s!==null&&typeof s!=="boolean"&&(typeof s!=="number"||!Number.isFinite(s)))throw Error("invalid-public-resource-json")};i(e,1)}var JO=new TextDecoder("utf-8",{fatal:!0});function lu(){return{listCatalog:()=>[...rR],getDesignMd:(e)=>{let t=du();if(!e)return t.map(({body:r,...n})=>n);return t.find((r)=>r.id===e)??null},listTemplates:()=>as().map((e)=>({name:e.name,title:e.title,description:e.description,level:e.templateContract.level,category:e.templateContract.category,composedFrom:e.templateContract.composedFrom??[]}))}}async function uu(e){let t={};if(e.spec!==void 0){let r=typeof e.spec==="string"?Yi(e.spec):e.spec;if(typeof r!=="object"||r===null||!Array.isArray(r.pages))throw Error("spec must be a UIBot Spec object with a pages array");let i=await Fl(r,{components:{...lr,...ur},actions:{},templates:{}},{templates:eR()});t.spec={ok:i.gaps.length===0,gaps:i.gaps,warnings:i.warnings}}if(e.html!==void 0){let r=Kl({html:e.html});t.html={ok:!r.blocked,...r}}return t}function Zk(){let e=["./resources/templates","./resources/shells","../../../examples/templates","../../../examples/shells"].map((i)=>os(new URL(i,import.meta.url))),t=[],r=new Set,n=new Set;for(let i of e){let s=i.endsWith("shells")?"shells":"templates";if(!ss(i)||r.has(i)||n.has(s))continue;if(n.add(s),r.add(i),i.endsWith("/shells")||i.endsWith("\\shells"))t.push({dir:i,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});else t.push({dir:i})}return t}var ou,au,cu;function as(){return ou??=Xi(Zk()),ou}function eR(){return au??=Object.fromEntries(as().map((e)=>[e.name,Yi(e.yaml)])),au}function du(){let e=os(new URL("./resources/design-md",import.meta.url));return cu??=ss(e)?un(e):un(),cu}var gn;function pu(){let e=["./resources/bundle.json","../../../public/resources/bundle.json"].map((r)=>os(new URL(r,import.meta.url))).find(ss);if(e){let r=JSON.parse(Xk(e,"utf8"));return is(r),iu(r)}if(gn)return gn;let t=Object.fromEntries(as().map((r)=>[r.name,r.templateContract]));return gn=pn(Jl({components:{...lr,...ur},templates:t,designGuides:du(),examples:Yl(t)})),gn}function tR(){let e=new Map;for(let t of[...Object.values(lr),...Object.values(ur)]){if(e.has(t.name))throw Error(`Duplicate catalog block name '${t.name}' across the shadcn and studio catalogs`);e.set(t.name,t)}return[...e.values()].sort((t,r)=>t.name.localeCompare(r.name))}var rR=Object.freeze(tR());var cR="This uibot-mcp process has no Hub service wired, so component generation and task status are unavailable. Embed it with createUIBotMcpServer({ service, discovery }) to enable those tools.";function lR(){return{requestComponent:()=>Promise.reject(Error(cR)),getTask:()=>{return},listTasks:()=>[],getTaskStatus:()=>{return}}}function uR(e,t){let r=Object.fromEntries(Object.entries(t??{}).filter(([,n])=>n!=null));return{...e,...r}}function dR(e={}){let t=da({service:e.service??lR(),serviceAvailable:e.service!=null,discovery:uR(lu(),e.discovery),resourceQuery:e.resourceQuery??pu(),validate:e.validate??uu}),r=new iR({name:"uibot",version:"0.1.0"},{capabilities:{tools:{}}});return r.setRequestHandler(aR,()=>({tools:t.listTools().filter((n)=>!e.resourceOnly||n.name.startsWith("uibot_resource_"))})),r.setRequestHandler(oR,async(n)=>{if(e.resourceOnly&&!n.params.name.startsWith("uibot_resource_"))return{content:[{type:"text",text:"public-resource-tool-unavailable"}],isError:!0};let i={...n.params.arguments};if(n.params.name==="uibot_resource_search"){if(i.limit===void 0)i.limit=12;else if(typeof i.limit==="number"&&i.limit>50)i.limit=50}try{let s=await t.callTool(n.params.name,i),o=pa(s.content);if(n.params.name.startsWith("uibot_resource_")&&new TextEncoder().encode(JSON.stringify(o)).length>(n.params.name==="uibot_resource_manifest"?1048576:262144))return{isError:!0,content:[{type:"text",text:JSON.stringify({error:{code:"resource-response-too-large",detail:"Use search with a smaller limit, then get, docs or paged examples for one resource."}})}]};return{content:o,...s.isError?{isError:!0}:{}}}catch(s){return{content:[{type:"text",text:s instanceof Error?s.message:String(s)}],isError:!0}}}),r}function pR(e=process.argv[1],t=import.meta.url){if(!e)return!1;try{return gu(nR(t))===gu(e)}catch{return!1}}async function gR(){let e=dR();await e.connect(new sR);for(let t of["SIGINT","SIGTERM"])process.on(t,()=>{e.close().finally(()=>process.exit(0))})}if(pR())gR().catch((e)=>{console.error(e),process.exit(1)});export{dR as createUIBotMcpServer,pR as isEntryPoint,gR as main};
|
|
138
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=tn(e),r=tt(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=tn(e),r=tt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((r)=>r.type==="newline"||r.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}nk.Parser=xl});var Tl=h(function(pk){var Il=Ni(),ok=Lt(),qt=Nt(),sk=Vn(),ak=P(),ck=Vi(),Al=zi();function El(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ck.LineCounter||null,prettyErrors:t}}function lk(e,t={}){let{lineCounter:r,prettyErrors:n}=El(t),i=new Al.Parser(r?.addNewLine),o=new Il.Composer(t),s=Array.from(o.compose(i.parse(e)));if(n&&r)for(let a of s)a.errors.forEach(qt.prettifyError(e,r)),a.warnings.forEach(qt.prettifyError(e,r));if(s.length>0)return s;return Object.assign([],{empty:!0},o.streamInfo())}function Pl(e,t={}){let{lineCounter:r,prettyErrors:n}=El(t),i=new Al.Parser(r?.addNewLine),o=new Il.Composer(t),s=null;for(let a of o.compose(i.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new qt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&r)s.errors.forEach(qt.prettifyError(e,r)),s.warnings.forEach(qt.prettifyError(e,r));return s}function uk(e,t,r){let n=void 0;if(typeof t==="function")n=t;else if(r===void 0&&t&&typeof t==="object")r=t;let i=Pl(e,r);if(!i)return null;if(i.warnings.forEach((o)=>sk.warn(i.options.logLevel,o)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},r))}function dk(e,t,r){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t;if(typeof r==="string")r=r.length;if(typeof r==="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=r??t??{};if(!i)return}if(ak.isDocument(e)&&!n)return e.toString(r);return new ok.Document(e,n,r).toString(r)}pk.parse=uk;pk.parseAllDocuments=lk;pk.parseDocument=Pl;pk.stringify=dk});import{createHash as bo,randomUUID as Ou}from"node:crypto";import{mkdir as Du,realpath as Lu,writeFile as Nu}from"node:fs/promises";import{join as _u}from"node:path";var oe=(e,t=[])=>({type:"object",properties:e,required:t,additionalProperties:!1}),ye={type:"string",minLength:1},st=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,bn={original:"image","favicon-16":"web/favicon-16.png","favicon-32":"web/favicon-32.png","icon-512":"pwa/icon-512.png"},Mu=oe({requestId:{type:"string",pattern:st.source},provider:ye,model:ye,brief:oe({brand:{...ye,maxLength:100},description:{...ye,maxLength:2000},style:{enum:["symbol","monogram","mascot"]},colors:{type:"string",maxLength:300},direction:{type:"string",maxLength:2000},transparentBackground:{type:"boolean"}},["brand","description","style","colors","direction","transparentBackground"]),referenceAssetId:ye,refinement:{...ye,maxLength:2000}},["requestId","provider","model","brief"]),$u=oe({targets:{type:"array",items:{enum:["ios","android","web","pwa"]},minItems:1,maxItems:4,uniqueItems:!0},background:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"},spacing:{enum:["balanced","spacious"]},trimTransparent:{type:"boolean"},removeFaintFringe:{type:"boolean",description:"Opt in to cropping near-transparent margins below 1/32 of peak alpha. May remove faint edge details; source is unchanged. Requires trimTransparent."}},["targets","background","spacing","trimTransparent"]),Bu=[{name:"providers",description:"List configured image providers and exact model IDs before generating a logo.",inputSchema:oe({}),readOnly:!0},{name:"assets",description:"List saved logo assets and provenance. Use status with the original requestId to reconcile a generation.",inputSchema:oe({}),readOnly:!0},{name:"status",description:"Read a retained Logo request by its original UUID, including after a lost response or backend restart. running/unknown are not completion. Never automatically replay an unknown generation with a new ID.",inputSchema:oe({requestId:{type:"string",pattern:st.source}},["requestId"]),readOnly:!0},{name:"targets",description:"List supported app icon export targets and files.",inputSchema:oe({}),readOnly:!0},{name:"preview",description:"Inspect an existing logo before refining: original PNG or favicon-16/favicon-32/icon-512 on white with balanced spacing and transparent margins trimmed. Returns an image plus dimensions and SHA-256. Does not generate or change the asset.",inputSchema:oe({id:ye,variant:{enum:Object.keys(bn),default:"original"},removeFaintFringe:{type:"boolean",description:"Opt in for icon variants to crop near-transparent margins below 1/32 of peak alpha. May remove faint edge details; source is unchanged."}},["id"]),readOnly:!0},{name:"generate",description:"Generate and save one logo (may incur model cost), or refine an existing asset. Inspect the returned asset with preview before refining. Save an explicit requestId UUID before submitting. Same ID and content never dispatch twice; different content conflicts. On uncertainty query status with that same ID; never automatically generate with a new ID.",inputSchema:oe({request:Mu},["request"]),readOnly:!1},{name:"export",description:"Export an existing logo as an app icon ZIP into the configured output directory. Returns a local path, byte count and SHA-256, not binary content. Requires output directory configuration.",inputSchema:oe({id:ye,request:$u},["id","request"]),readOnly:!1}];class E extends Error{code;outcomeUnknown;requestId;constructor(e,t=!1,r){super(e);this.code=e;this.outcomeUnknown=t;this.requestId=r}}async function ho(e,t,r,n){await Du(e,{recursive:!0});let i=await Lu(e),o=_u(i,`logo-${t}-${Ou()}.${r}`);return await Nu(o,n,{flag:"wx",mode:384}),{path:o,contentType:r==="png"?"image/png":"application/zip",bytes:n.length,sha256:bo("sha256").update(n).digest("hex")}}async function qu(e,t){let r=e.body?.getReader();if(!r)throw new E("logo-empty-response");let n=[],i=0;try{for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.length,i>t)throw new E("logo-response-too-large");n.push(c)}}finally{await r.cancel().catch(()=>{})}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o}function wo(e){let t;try{t=new URL(e.url)}catch{throw new E("logo-invalid-backend-origin")}if(!/^https?:$/.test(t.protocol)||t.username||t.password||t.pathname!=="/"||t.search||t.hash)throw new E("logo-invalid-backend-origin");if(t.protocol==="http:"&&!["localhost","127.0.0.1","[::1]"].includes(t.hostname))throw new E("logo-https-required");if(!e.token||/[\r\n]/.test(e.token))throw new E("logo-auth-required");let r=Bu.filter((i)=>i.name!=="export"||e.outputDir),n=async(i,o={},s)=>{let a=r.find((f)=>f.name===i);if(!a)throw new E("logo-operation-unavailable");let c=Object.keys(a.inputSchema.properties);if(Object.keys(o).some((f)=>!c.includes(f))||a.inputSchema.required.some((f)=>o[f]===void 0))throw new E("logo-invalid-arguments");if((i==="generate"||i==="export")&&(!o.request||typeof o.request!=="object"||Array.isArray(o.request)))throw new E("logo-invalid-request");if((i==="export"||i==="preview")&&(typeof o.id!=="string"||!st.test(o.id)))throw new E("logo-invalid-asset-id");let l=i==="generate"?o.request.requestId:i==="status"?o.requestId:void 0;if((i==="generate"||i==="status")&&(typeof l!=="string"||!st.test(l)))throw new E("logo-request-id-required");let p=typeof l==="string"?l:void 0,u=o.variant===void 0?"original":o.variant;if(i==="preview"&&(typeof u!=="string"||!Object.hasOwn(bn,u)))throw new E("logo-invalid-preview-variant");if(i==="preview"&&o.removeFaintFringe!==void 0&&(typeof o.removeFaintFringe!=="boolean"||u==="original"&&o.removeFaintFringe))throw new E("logo-invalid-preview-options");let g=i==="status"?`requests/${l}`:i==="targets"?"export-targets":i==="export"?`assets/${o.id}/app-kit`:i==="preview"?`assets/${o.id}/${u==="original"?"image":"preview"}`:i,d=new URL(`/api/studio/logo/${g}`,t);if(i==="preview"&&u!=="original"){if(d.search=new URLSearchParams({file:bn[u],background:"#ffffff",spacing:"balanced",trim:"1"}).toString(),o.removeFaintFringe!==void 0)d.searchParams.set("fringe",o.removeFaintFringe?"1":"0")}let m;try{m=await(e.fetch??fetch)(d,{method:a.readOnly?"GET":"POST",redirect:"error",headers:{authorization:`Bearer ${e.token}`,...a.readOnly?{}:{"content-type":"application/json"}},...a.readOnly?{}:{body:JSON.stringify(o.request)},signal:s?AbortSignal.any([s,AbortSignal.timeout(600000)]):AbortSignal.timeout(600000)})}catch{throw new E("logo-transport-failed",i==="generate",p)}if(!m.ok)throw new E(`logo-http-${m.status}`,i==="generate"&&(m.status>=500||m.status===499),p);try{let f=await qu(m,i==="export"?33554432:i==="preview"?20000000:1048576);if(i==="preview"){if(m.headers.get("content-type")?.split(";")[0]?.trim()!=="image/png"||f.length<45||![137,80,78,71,13,10,26,10].every((I,T)=>f[T]===I)||new TextDecoder().decode(f.subarray(12,16))!=="IHDR"||new TextDecoder().decode(f.subarray(-8,-4))!=="IEND")throw new E("logo-invalid-preview-response");let b=new DataView(f.buffer,f.byteOffset,f.byteLength),k=b.getUint32(16),R=b.getUint32(20),x=u==="original"?void 0:Number(String(u).split("-")[1]);if(!k||!R||k>4096||R>4096||k*R>4000000||x!==void 0&&(k!==x||R!==x))throw new E("logo-invalid-preview-response");return{preview:{id:o.id,variant:u,...u!=="original"?{removeFaintFringe:o.removeFaintFringe===!0}:{},contentType:"image/png",width:k,height:R,bytes:f.length,sha256:bo("sha256").update(f).digest("hex")},image:{type:"image",mimeType:"image/png",data:Buffer.from(f).toString("base64")}}}if(i==="export"){if(!m.headers.get("content-type")?.startsWith("application/zip"))throw new E("logo-invalid-export-response");let b=e.outputDir;if(!b)throw new E("logo-output-directory-required");return{artifact:await ho(b,String(o.id),"zip",f)}}let y=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(f));if(!y||typeof y!=="object")throw new E("logo-invalid-response");let w=y;if(i==="generate"||i==="status"){let b=w.request;if(!b||b.schema!=="uibot.logo-request.v1"||b.requestId!==p||!["running","succeeded","failed","unknown"].includes(String(b.state)))throw new E("logo-invalid-response");if(b.state==="succeeded"){let k=w.asset;if(!k||k.schema!=="uibot.logo-asset.v1"||typeof b.assetId!=="string"||!st.test(b.assetId)||k.id!==b.assetId||k.requestId!==p||typeof b.requestHash!=="string"||!/^[0-9a-f]{64}$/.test(b.requestHash)||k.requestHash!==b.requestHash)throw new E("logo-invalid-response")}else{if(w.asset!==void 0)throw new E("logo-invalid-response");w.next=`Query logo status ${p}. State ${String(b.state)} is not a generated asset; do not automatically submit a new ID.`}}else if(!Array.isArray(w[i]))throw new E("logo-invalid-response");return y}catch{throw new E("logo-response-failed",i==="generate",p)}};return{operations:r,call:n,async savePreview(i,o){if(!e.outputDir)throw new E("logo-output-directory-required");let{image:s,...a}=await n("preview",i,o);if(!s)throw new E("logo-invalid-preview-response");try{return{...a,artifact:await ho(e.outputDir,String(i.id),"png",Buffer.from(s.data,"base64"))}}catch{throw new E("logo-preview-write-failed")}}}}import{realpathSync as ku}from"node:fs";import{fileURLToPath as RR}from"node:url";import{Server as xR}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as IR}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as AR,ListToolsRequestSchema as ER}from"@modelcontextprotocol/sdk/types.js";var Hg=Pu(ua(),1);var da=["SetState","ResetState","Request","Link","Validate","DisplayMessage","Login","Logout","CallMethod"],Ln={SetState:{name:"SetState",description:"Set a page state path to an evaluated declarative value",params:{path:{type:"string"},value:{description:"Literal or supported PropValue expression"}},generation:{evaluatedParams:["value"],prerequisites:["Declare the state path on the same page"],example:{action:"SetState",params:{path:"open",value:{_not:{_state:"open"}}}}}},ResetState:{name:"ResetState",description:"Restore paths from the supplied initial map; missing values become null",params:{paths:{type:"array",items:{type:"string"}},initial:{type:"object"}},generation:{evaluatedParams:[],prerequisites:["Supply literal initial values; omitting paths resets keys in initial"],example:{action:"ResetState",params:{paths:["open"],initial:{open:!1}}}}},Request:{name:"Request",description:"Execute a configured connection request",params:{connectionId:{type:"string"},request:{type:"object"},loadingPath:{type:"string"},responsePath:{type:"string"},errorPath:{type:"string"}},generation:{evaluatedParams:["connectionId","request"],prerequisites:["Host must inject the declared connection driver; no implicit secrets or persistence"],example:{action:"Request",params:{connectionId:"projects",request:{id:"list",connectionId:"projects",payload:{operation:"FindAll",resource:"projects"}},responsePath:"rows"}}}},Link:{name:"Link",description:"Emit navigation to a literal URL or page path",params:{path:{type:"string"},url:{type:"string"},target:{enum:["_self","_blank"]}},generation:{evaluatedParams:[],prerequisites:["Host handles navigation; local page paths must exist"],example:{action:"Link",params:{path:"/details"}}}},Validate:{name:"Validate",description:"Emit form validation event; does not itself throw for invalid fields",params:{formId:{type:"string"},errorPath:{type:"string"}},generation:{evaluatedParams:[],prerequisites:["Requires host form:validate listener; prefer native required controls and Form.Submit"],example:{action:"Validate",params:{formId:"contact"}}}},DisplayMessage:{name:"DisplayMessage",description:"Emit an evaluated message for the host to display",params:{message:{description:"Literal or supported PropValue expression"},level:{enum:["info","success","warning","error"]},duration:{type:"number"}},generation:{evaluatedParams:["message"],prerequisites:["Requires host message:display listener"],example:{action:"DisplayMessage",params:{message:"Saved locally",level:"success"}}}},Login:{name:"Login",description:"Set a supplied local session user or request external login",params:{user:{type:"object"},provider:{type:"string"}},generation:{evaluatedParams:[],prerequisites:["Requires host session/auth; setting a local user is not server authentication"],example:{action:"Login",params:{provider:"configured-provider"}}}},Logout:{name:"Logout",description:"Clear the local session and emit auth:logout",params:{},generation:{evaluatedParams:[],prerequisites:["Host owns server session invalidation"],example:{action:"Logout",params:{}}}},CallMethod:{name:"CallMethod",description:"Emit a call to an existing block method",params:{blockId:{type:"string"},method:{type:"string"},args:{type:"array"}},generation:{evaluatedParams:["args"],prerequisites:["Requires an explicitly documented installed block method/listener; never invent a method"],example:{action:"CallMethod",params:{blockId:"documented-block",method:"documented-method",args:[]}}}}};var Nn={navigation:["sidebar","navbar"],container:["default","fluid","boxed"],navigationStyle:["attached","floating"],offcanvas:["attached","floating"],sidebar:["expanded","folded","hover"]},pa={navigation:"sidebar",container:"fluid",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"};var Wg={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},$I=Array.from(new Set(Object.values(Wg).flat()));var gt=["component","template","design-guide","example","skill","block","package","theme"],Ve=["experimental","candidate","recommended"],ga=["declared","verified","external-consumer"],lr=["missing","declared","verified","external-consumer"],ur=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],dr=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var Yg=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],UI=[...Yg,"radius","font-display","font-body","font-mono"];var ue=(e)=>!!e&&typeof e==="object"&&!Array.isArray(e),G=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e),fa=(e)=>ue(e)&&Object.entries(e).every(([t,r])=>G(t)&&G(r));function ma(e){if(e.composition===void 0)return;let t=e.composition;if(!ue(t)||t.schema!=="uibot.solution-composition.v1"||!Array.isArray(t.pages))throw Error("invalid-solution-composition");let r=new Set;for(let n of t.pages){if(!ue(n)||!G(n.resourceId)||!G(n.version)||typeof n.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(n.sourceHash)||!G(n.sourcePageId)||!G(n.targetPageId)||r.has(n.targetPageId)||!ue(n.baseline)||n.baseline.id!==n.targetPageId||typeof n.baseline.path!=="string"||!Array.isArray(n.baseline.blocks)||!ue(n.bindings)||!["source","target"].includes(String(n.bindings.layout))||!fa(n.bindings.paths)||!fa(n.bindings.connections)||n.bindings.frame!==void 0&&(!ue(n.bindings.frame)||Object.keys(n.bindings.frame).some((i)=>!["props","slots","events"].includes(i)))||n.detached!==void 0&&typeof n.detached!=="boolean"||n.configuration!==void 0&&(!ue(n.configuration)||Object.entries(n.configuration).some(([i,o])=>!G(i)||!["string","number","boolean"].includes(typeof o)||typeof o==="number"&&!Number.isFinite(o))))throw Error("invalid-solution-adoption");r.add(n.targetPageId)}if(t.regions!==void 0){if(!Array.isArray(t.regions))throw Error("invalid-solution-regions");let n=new Set;for(let i of t.regions){if(!ue(i)||!G(i.resourceId)||!G(i.version)||typeof i.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(i.sourceHash)||!G(i.targetPageId)||n.has(i.targetPageId)||!G(i.role)||i.target!=="page-frame"||!G(i.contentBlockId)||!ue(i.baseline)||!G(i.baseline.type))throw Error("invalid-solution-region");n.add(i.targetPageId)}}}var ba=["resource-mcp-invalid-argument","resource-query-failed"];function mt(e,t){return`Tool '${e}' is not wired in this build: no '${t}' discovery provider was supplied. `+`This is not an empty result — supply a 'discovery.${t}' provider to enable it.`}function ya(e){return`Tool '${e}' is not wired in this build: no Hub service was supplied. Supply a service to enable component requests and task status.`}function Qg(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function Xg(e){switch(e.status){case"ready":return{taskId:e.taskId,status:"ready",artifact:e.artifact};case"failed":return{taskId:e.taskId,status:"failed",error:e.error};case"pending":case"running":return{taskId:e.taskId,status:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function te(e){return{content:[{type:"json",json:e}]}}function H(e){return{content:[{type:"text",text:e}],isError:!0}}function _n(e,t){return{content:[{type:"json",json:{error:{code:e,detail:t}}}],isError:!0}}var yt="uibot_resource_";function Zg(e){return`${yt}${e}`}function ha(e,t){let r;if(e==="resource-kind")r={type:"string",enum:[...gt]};else if(e==="resource-maturity")r={type:"string",enum:[...Ve]};else if(e==="positive-integer")r={type:"integer",minimum:1};else r={type:"string"};return t?{type:"array",items:r}:r}function ef(){return dr.map((e)=>{let t={},r=[];for(let n of e.positionals)if(t[n.property]=ha(n.type,"variadic"in n&&n.variadic===!0),n.required)r.push(n.property);for(let n of e.options)t[n.property]=ha(n.type,"multiple"in n&&n.multiple===!0);return{name:Zg(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class Q extends Error{detail;code=ba[0];constructor(e){super(e);this.detail=e;this.name="ResourceMcpArgumentError"}}function ft(e,t){let r=new Set(t),n=Object.keys(e).find((i)=>!r.has(i));if(n)throw new Q(`unsupported argument: ${n}`)}function pr(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string"||!r.trim())throw new Q(`${t} must be a non-empty string`);return r}function Te(e,t,r){let n=e[t];if(n===void 0)return;if(!Array.isArray(n)||n.length===0||n.some((i)=>typeof i!=="string"||!i.trim()))throw new Q(`${t} must be a non-empty string array`);if(r){let i=n.find((o)=>!r.includes(o));if(i)throw new Q(`${t} contains unsupported value: ${i}`)}return n}function tf(e){if(e instanceof Q)return _n(e.code,e.detail);if(e&&typeof e==="object"){let t=e;if(typeof t.code==="string"){let r=typeof t.detail==="string"?t.detail:typeof t.message==="string"?t.message:t.code;return _n(t.code,r)}}return _n(ba[1],"resource query callback failed")}async function rf(e,t,r){try{if(e==="manifest")return ft(t,[]),te({data:{index:await r.manifest()}});if(e==="search"){ft(t,["text","kinds","tags","categories","capabilities","maturities","functions","scenarios","units","industries","limit"]);let i=pr(t,"text"),o=Te(t,"kinds",gt),s=Te(t,"tags"),a=Te(t,"categories"),c=Te(t,"capabilities"),l=Te(t,"maturities",Ve),p=Object.fromEntries(["functions","scenarios","units","industries"].flatMap((d)=>{let m=Te(t,d);return m?[[d,m]]:[]})),u=t.limit;if(u!==void 0&&(typeof u!=="number"||!Number.isInteger(u)||u<=0))throw new Q("limit must be a positive integer");let g={...p,...i?{text:i}:{},...o?{kinds:o}:{},...s?{tags:s}:{},...a?{categories:a}:{},...c?{capabilities:c}:{},...l?{maturities:l}:{},...typeof u==="number"?{limit:u}:{}};return te({data:{matches:await r.search(g)}})}if(e==="get"){ft(t,["id"]);let i=pr(t,"id");if(!i)throw new Q("id must be a non-empty string");return te({data:{resource:await r.get(i)}})}if(e==="docs"||e==="examples"||e==="install-plan"){ft(t,e==="docs"?["id","locale","page"]:e==="examples"?["id","page"]:["id"]);let i=pr(t,"id");if(!i)throw new Q("id must be a non-empty string");let o=pr(t,"locale");if(o&&o!=="zh"&&o!=="en")throw new Q("locale must be zh or en");if(!(e==="docs"?r.docs:e==="examples"?r.examples:r.installPlan))return H(mt(e,e));let a=t.page;if(a!==void 0&&(typeof a!=="number"||!Number.isSafeInteger(a)||a<1))throw new Q("page must be a positive integer");let c=e==="docs"?await r.docs?.(i,o,a):e==="examples"?await r.examples?.(i,a):await r.installPlan?.(i);return te({data:c})}ft(t,["roots"]);let n=Te(t,"roots");if(!n)throw new Q("roots must be a non-empty string array");return te({data:{plan:await r.build(n)}})}catch(n){return tf(n)}}function wa(e){let t=[{name:"uibot_request_component",description:"Request a missing component from the UIBot Hub runtime.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Component name"},context:{type:"string",description:"Optional usage context"},requestedBy:{type:"string",description:"Requester identifier"},priority:{type:"string",enum:["low","normal","high"]}},required:["name"]}},{name:"uibot_get_task_status",description:"Read the status of a Hub task.",inputSchema:{type:"object",properties:{taskId:{type:"string",description:"Hub task identifier"}},required:["taskId"]}},{name:"uibot_list_catalog",description:"List catalog components available to agents (read-only discovery). Returns name/description/category entries.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter on name/description"}}}},{name:"uibot_get_design_md",description:"Get design-md entries (read-only). Omit id to list summaries; provide id for one full entry.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Optional design-md id"}}}},{name:"uibot_list_templates",description:"List installable UIBot templates (read-only discovery).",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter"}}}},{name:"uibot_validate",description:"Validate a generated artifact. Pass `spec` (UIBot Spec object, or JSON/YAML text) to compile it against the catalog and get missing-component gaps and warnings; pass `html` to run the design-quality rules. Fix every gap before handing the result on.",inputSchema:{type:"object",properties:{spec:{description:"UIBot Spec object, or its JSON/YAML text"},html:{type:"string",description:"Generated HTML document"}}}},...ef()];return{listTools(){return t.filter((r)=>{if(r.name==="uibot_request_component")return e.serviceAvailable!==!1;if(r.name==="uibot_get_task_status")return e.serviceAvailable!==!1;if(r.name==="uibot_list_catalog")return e.discovery?.listCatalog!=null;if(r.name==="uibot_get_design_md")return e.discovery?.getDesignMd!=null;if(r.name==="uibot_list_templates")return e.discovery?.listTemplates!=null;if(r.name==="uibot_validate")return e.validate!=null;if(r.name.startsWith(yt)){let n=r.name.slice(yt.length),i=n==="install-plan"?"installPlan":n;return e.resourceQuery!=null&&typeof e.resourceQuery[i]==="function"}return!0})},async callTool(r,n){if(r.startsWith(yt)){let i=r.slice(yt.length);if(!dr.some((s)=>s.name===i))return H(`Unknown tool: ${r}`);if(!e.resourceQuery)return H(mt(r,"resourceQuery"));return rf(i,n,e.resourceQuery)}if(r==="uibot_request_component"){if(e.serviceAvailable===!1)return H(ya(r));let i=typeof n.name==="string"?n.name:"";if(!i)return H("Field 'name' is required");let o=await e.service.requestComponent({name:i,...typeof n.context==="string"?{context:n.context}:{},...typeof n.requestedBy==="string"?{requestedBy:n.requestedBy}:{},...n.priority==="low"||n.priority==="normal"||n.priority==="high"?{priority:n.priority}:{}});return te(Qg(o))}if(r==="uibot_get_task_status"){if(e.serviceAvailable===!1)return H(ya(r));let i=typeof n.taskId==="string"?n.taskId:"";if(!i)return H("Field 'taskId' is required");let o=e.service.getTaskStatus(i);return o?te(Xg(o)):H("Task not found")}if(r==="uibot_list_catalog"){let i=e.discovery?.listCatalog;if(!i)return H(mt(r,"listCatalog"));let o=await i(),s=Array.isArray(o)?o:[],a=typeof n.query==="string"?n.query.toLowerCase():"",c=a?s.filter((l)=>JSON.stringify(l).toLowerCase().includes(a)):s;return te({items:c,count:c.length})}if(r==="uibot_get_design_md"){let i=e.discovery?.getDesignMd;if(!i)return H(mt(r,"getDesignMd"));let o=typeof n.id==="string"?n.id:void 0,s=await i(o)??(o?null:[]);return te({id:o??null,data:s})}if(r==="uibot_list_templates"){let i=e.discovery?.listTemplates;if(!i)return H(mt(r,"listTemplates"));let o=await i(),s=Array.isArray(o)?o:[],a=typeof n.query==="string"?n.query.toLowerCase():"",c=a?s.filter((l)=>JSON.stringify(l).toLowerCase().includes(a)):s;return te({items:c,count:c.length})}if(r==="uibot_validate"){if(!e.validate)return H(`Tool '${r}' is not wired in this build: no 'validate' provider was supplied.`);let i=typeof n.html==="string"?n.html:void 0;if(n.spec===void 0&&i===void 0)return H("Provide 'spec' or 'html'");try{return te(await e.validate({...n.spec===void 0?{}:{spec:n.spec},...i===void 0?{}:{html:i}}))}catch(o){return H(o instanceof Error?o.message:String(o))}}return H(`Unknown tool: ${r}`)}}}var va="0.20.0";function Sa(e){return e.map((t)=>t.type==="text"?{type:"text",text:t.text}:{type:"text",text:t.json===void 0?"null":JSON.stringify(t.json,null,2)})}import{existsSync as uo,readFileSync as wR}from"node:fs";import{fileURLToPath as po}from"node:url";var of=["sidebar","surface","foreground","accent","accent-foreground","primary","primary-foreground","border","font","font-display","font-body","font-mono"],ka={type:"object",additionalProperties:!1,properties:Object.fromEntries(of.map((e)=>[e,{type:"string"}])),description:"Frame-local tokens; surface is page background. Other keys are rejected."};var gr={ConsolePage:{name:"ConsolePage",description:"Console reference pages.",category:"composite",level:"L2",tags:["console","workspace","interactive"],props:{view:{type:"string"},options:{type:"object"}},events:{onAction:{description:"Serializable values in event.values"}}},ItemGrid:{name:"ItemGrid",description:"Public-facing collection of whole-card buttons with optional images, local search and category filters. Use for browsable pets, products or projects instead of duplicating cards and a management table. No data writes.",category:"composite",level:"L2",tags:["cards","search","collection","gallery"],props:{label:{type:"string"},items:{type:"array",items:{type:"object",required:["id","title"],properties:{id:{type:"string"},title:{type:"string"},description:{type:"string"},category:{type:"string"},meta:{type:"string"},image:{type:"string",description:"Supplied image URL or inline data:image illustration; never invent an asset URL"},imageAlt:{type:"string"}}}},columns:{type:"string",enum:["2","3"],default:"3"},searchable:{type:"boolean",default:!1},filterable:{type:"boolean",default:!1},searchPlaceholder:{type:"string"},filterLabel:{type:"string"},allLabel:{type:"string"},emptyText:{type:"string"},actionLabel:{type:"string"}},events:{onSelect:{description:'Whole-card click or keyboard activation emits the selected string id in {"_event":"values.id"}.'}},constraints:["Use unique non-empty string item IDs. Category filters derive from items; search and category combine on these same cards. Set all control labels in the product language. Image is optional; omit it when unavailable."]},AppNavigation:{name:"AppNavigation",tags:["navigation"],description:"Workspace navigation with configured groups, brand and account",category:"composite",level:"L2",props:{activePath:{type:"string"},brand:{type:"string"},logoSrc:{type:"string",description:"Brand image URL; preserve aspect ratio"},subtitle:{type:"string"},groups:{type:"array"},workspaces:{type:"array"},userName:{type:"string"},email:{type:"string"},initials:{type:"string"},profileHref:{type:"string"}},events:{onNavigate:{description:"Serializable values in event.values"}}},Field:{name:"Field",tags:["form"],description:"Accessible controlled or local form field; native validation and scalar event values",category:"composite",level:"L2",props:{kind:{type:"string"},label:{type:"string"},name:{type:"string"},value:{description:"String, boolean, or string array according to kind"},defaultValue:{description:"Initial string, boolean, or string array"},options:{type:"array"},description:{type:"string"},error:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},placeholder:{type:"string"},rows:{type:"number"},length:{type:"number"},autoComplete:{type:"string"}},events:{onChange:{description:"Serializable values in event.values"}}},StatCard:{name:"StatCard",tags:["metric"],description:"Metric with label, value and supporting text",category:"composite",level:"L2",props:{label:{type:"string"},value:{type:"string"},description:{type:"string"},icon:{type:"string"}},events:{}},BarChart:{name:"BarChart",tags:["chart"],description:"Accessible deterministic bar series with visible labels and hover values",category:"composite",level:"L2",replacement:{family:"dashboard.series.v1",variants:[{id:"bar",title:"Bar chart"}]},props:{label:{type:"string"},data:{type:"array"},height:{type:"number"},prefix:{type:"string"}},events:{}},AvatarList:{name:"AvatarList",tags:["list"],description:"Compact people and activity list",category:"composite",level:"L2",replacement:{family:"dashboard.records.v1",variants:[{id:"list",title:"Avatar list"}]},props:{items:{type:"array"}},events:{}},SeriesChart:{name:"SeriesChart",description:"Accessible line or area chart over the same label/value data as BarChart",category:"composite",level:"L2",tags:["chart","line","area"],replacement:{family:"dashboard.series.v1",presentationProps:["variant"],variants:[{id:"line",title:"Line chart",props:{variant:"line"}},{id:"area",title:"Area chart",props:{variant:"area"}}]},props:{label:{type:"string"},data:{type:"array"},height:{type:"number"},prefix:{type:"string"},variant:{type:"string",enum:["line","area"]}},events:{}},RecordCards:{name:"RecordCards",description:"Readonly record cards over the same items contract as AvatarList",category:"composite",level:"L2",tags:["list","cards"],replacement:{family:"dashboard.records.v1",variants:[{id:"cards",title:"Record cards"}]},props:{items:{type:"array"}},events:{}},IntegrationGrid:{name:"IntegrationGrid",tags:["data"],description:"Searchable integrations with explicit capability availability",category:"composite",level:"L2",props:{configurations:{type:"array"},configurable:{type:"boolean"},items:{type:"array"},pending:{type:"boolean"},error:{type:"string"}},events:{onConfigure:{description:"Workspace configuration intent and existing record version"},onAction:{description:"Serializable values in event.values"}}},ChatPanel:{name:"ChatPanel",tags:["interactive"],description:"Conversation selector and controlled message composition",category:"composite",level:"L2",props:{draft:{type:"string"},currentUserId:{type:"string"},conversations:{type:"array"},messages:{type:"array"},selectedId:{type:"string"},pending:{type:"boolean"},canSend:{type:"boolean"},error:{type:"string"}},events:{onDraftChange:{description:"event.value draft; clear after persistence confirmation"},onSelect:{description:"Serializable values in event.values"},onSend:{description:"Serializable values in event.values"}}},DataTable:{name:"DataTable",description:"Configurable record table with search, facets, sorting, stable selection and pagination. Server mode emits query intent without filtering current-page rows.",category:"composite",level:"L2",tags:["table","records","admin"],props:{locale:{type:"string",enum:["en","zh-CN"],default:"en",description:"UI language"},rows:{type:"array"},columns:{type:"array",description:"action,editor(text|number|select),options"},reorderable:{type:"boolean"},rowOrder:{type:"array"},cellFeedback:{type:"object",description:"id,column,operationId,attempt,status,message"},views:{type:"array",description:"value,label,badge,placeholder"},searchable:{type:"boolean"},addLabel:{type:"string"},filters:{type:"array"},actions:{type:"array"},bulkActions:{type:"array"},rowKey:{type:"string",default:"id"},searchKeys:{type:"array"},selectedIds:{type:"array"},view:{description:"TableView or URL view JSON"},pageSize:{type:"number",default:10},server:{type:"boolean"},total:{type:"number"},hasNextPage:{type:"boolean"},loading:{type:"boolean"},error:{type:"string"},minWidth:{type:"number"},searchPlaceholder:{type:"string"},label:{type:"string"},selectable:{type:"boolean"},emptyText:{type:"string"}},events:{onViewChange:{description:"event.values: search,filters JSON,sort,descending,page,pageSize,tab"},onSelectionChange:{description:"Stable ids in event.values.ids"},onRowAction:{description:"event.values.id and action"},onBulkAction:{description:"event.values.ids and action"},onReorder:{description:"ids,activeId,overId"},onCellChange:{description:"id,column,value,version,operationId,attempt; reply cellFeedback"},onAdd:{description:"Create intent"}}},Box:{name:"Box",description:"Flex container for composing layout. Use as a row or column spacer between other blocks.",category:"primitive",level:"L1",tags:["container","layout"],props:{className:{type:"string",description:"Tailwind classes"},direction:{type:"string",enum:["col","row"],default:"col",description:"Flex direction"},gap:{type:"string",enum:["none","xs","sm","md","lg","xl"],default:"md"},padding:{type:"string",enum:["none","xs","sm","md","lg","xl"]},align:{type:"string",enum:["start","center","end","stretch"]},justify:{type:"string",enum:["start","center","end","between","around"]},wrap:{type:"boolean",default:!1},full:{type:"boolean",default:!1}},usageScenarios:["Horizontal row of action buttons","Vertical stack of form fields","Two-column grid using two Box[direction=row] with flex-1 children"],constraints:["Do not use Box as a semantic section; prefer Card or PageLayout for major layout regions"]},PageLayout:{name:"PageLayout",description:"App header, navigation, content and footer.",category:"composite",level:"L2",tags:["page","layout"],props:{creditLabel:{type:"string"},language:{type:"string"},userName:{type:"string"},email:{type:"string"},subtitle:{type:"string"},appearance:{type:"string",enum:["default","admin","standalone","console"]},layout:{type:"object",properties:{navigation:{type:"string",enum:["sidebar","navbar"]},container:{type:"string",enum:["default","fluid","boxed"]},navigationStyle:{type:"string",enum:["attached","floating"]},offcanvas:{type:"string",enum:["attached","floating"]},sidebar:{type:"string",enum:["expanded","folded","hover"]}}},routes:{type:"array"},headerLinks:{type:"array"},accountLinks:{type:"array"},tokens:ka,theme:{type:"string"},font:{type:"string"},direction:{type:"string"},initials:{type:"string"},title:{type:"string",description:"Header title."},variant:{type:"string",enum:["sidebar","inset","floating"],default:"sidebar"},sidebarWidth:{type:"string",enum:["default","wide"],default:"default",description:"224/256px."},collapsible:{type:"string",enum:["none","icon","offcanvas"],default:"none"}},events:{onThemeChange:{description:"Selected theme: event.value."},onAction:{description:"Serializable values in event.values"}},slots:{headerActions:{description:"Header actions."},sidebar:{description:"Navigation."},footer:{description:"Footer."}},usageScenarios:["Admin dashboard shell","Settings page with left navigation","Landing page with header and main content"],constraints:["Use at most one PageLayout per page","Do not nest PageLayout inside another PageLayout"]},Card:{name:"Card",description:"Surface container with rounded border and optional header (title + description + actions slot).",category:"composite",level:"L2",tags:["card","surface"],props:{className:{type:"string",description:"Tailwind classes"},title:{type:"string",description:"Card heading"},description:{type:"string",description:"Supporting subtitle text"}},slots:{actions:{description:"Action buttons rendered in the top-right of the card header"},default:{description:"Card body content"}},usageScenarios:["Stats overview section","User profile panel","Settings form container"],constraints:["Avoid nesting Card directly inside another Card"]},Tabs:{name:"Tabs",description:"Tab switcher. Each child maps to the tab at the same index. Supports up to 6 tabs.",category:"composite",level:"L2",tags:["tabs","navigation"],props:{variant:{type:"string",enum:["underline","segmented"]},disabledTabs:{type:"array",items:{type:"integer"}},value:{type:"integer"},tabs:{type:"array",items:{type:"string"},description:"Tab labels"},defaultTab:{type:"integer",default:0,description:"Initial tab index (0-based)"}},usageScenarios:["Split view of Overview / Settings / Logs","Mobile-friendly section switcher"],constraints:["Children count must equal tabs array length","Do not use more than 6 tabs"]},Drawer:{name:"Drawer",description:"Off-canvas side panel for secondary context (filters, details, comments). Rendered inline in preview.",category:"composite",level:"L2",tags:["drawer","overlay"],events:{onClose:{description:"Close requested; set controlled open false"}},props:{description:{type:"string"},open:{type:"boolean"},pending:{type:"boolean"},title:{type:"string"},placement:{type:"string",enum:["end","responsive"]}},usageScenarios:["Filter panel for a table","Item detail side sheet"],constraints:["Control visibility with props.open"]},Modal:{name:"Modal",description:"Centered overlay dialog for focused tasks or confirmations. Rendered inline in preview.",category:"composite",level:"L2",tags:["modal","overlay"],events:{onClose:{description:"Close requested; set controlled open false"}},props:{open:{type:"boolean"},pending:{type:"boolean"},title:{type:"string"},description:{type:"string"}},usageScenarios:["Create / edit form dialog","Image preview lightbox"],constraints:["Modal is always visible in static preview — drive open/close state from actions in production"]},Divider:{name:"Divider",description:"Thin horizontal (default) or vertical separator line.",category:"primitive",level:"L1",tags:["separator"],props:{orientation:{type:"string",enum:["horizontal","vertical"],default:"horizontal"}},usageScenarios:["Visual break between form sections","Vertical separator between two columns"],constraints:[]},DrilldownMenu:{name:"DrilldownMenu",description:"Drilldown section navigation; host owns routing.",category:"composite",level:"L2",tags:["sidebar","navigation","drilldown","nested"],props:{sections:{type:"array",items:{type:"object"},description:"[{id,label?,items:[{id,label,icon?,href?,children?:sections}]}]; unique IDs, max256/6 levels."},activeHref:{type:"string"},panelId:{type:"string",description:"Bind panelId+onPanelChange; empty=root."},defaultPanelId:{type:"string"},showActiveLabel:{type:"boolean"},navigateOnEnter:{type:"boolean"},workspaceLabel:{type:"string"},label:{type:"string",default:"Main navigation"},backLabel:{type:"string",default:"Back to all sections"}},slots:{header:{description:"Optional brand content"},panelHeader:{description:"Below section heading"},footer:{description:"Account or organization switcher"}},events:{onPanelChange:{description:"event.values.panelId; empty=root."},onNavigate:{description:"event.values.href."},onEnter:{description:"Branch only: event.value=href; values.id/href."},onWorkspaceAction:{description:"event.value=create|manage."}},usageScenarios:["Console section navigation","Billing and settings secondary navigation"],constraints:["Host owns routing; no persistence."]},PageSiderMenu:{name:"PageSiderMenu",description:"Vertical sidebar navigation. Place MenuLink or MenuGroup blocks as children. Usually placed in the PageLayout sidebar slot.",category:"composite",level:"L2",tags:["sidebar","nav"],props:{title:{type:"string",description:"Section heading above menu items"}},slots:{header:{description:"Workspace switcher or brand above the menu list"},footer:{description:"User card or secondary links below the menu list"}},usageScenarios:["Admin left nav (Dashboard, Users, Settings)","Docs section navigation"],constraints:["Use in the PageLayout sidebar slot, not main content"]},MenuGroup:{name:"MenuGroup",description:"Labeled group of MenuLink items inside PageSiderMenu.",category:"composite",level:"L2",tags:["sidebar","nav"],props:{title:{type:"string",description:"Group heading shown above the links"}},usageScenarios:["Platform vs Workspace nav groups","Settings section grouping"],constraints:["Child of PageSiderMenu"]},MenuLink:{name:"MenuLink",description:"Sidebar link with icon/badge. An onClick chain renders an action button.",category:"primitive",level:"L1",tags:["nav","link"],props:{label:{type:"string"},href:{type:"string"},icon:{type:"string",description:"Emoji or Unicode glyph"},iconName:{type:"string",description:"Lucide name"},badge:{type:"string",description:"Trailing count/label"},active:{type:"boolean",default:!1}},usageScenarios:["Dashboard menu item","Settings section link with unread badge"],constraints:["Child of PageSiderMenu/MenuGroup"],events:{onClick:{description:"Renders a button; ignores href"}}},Link:{name:"Link",description:"Inline hyperlink. Variants: default (blue underline), muted (gray), button (filled CTA), outline (bordered CTA).",category:"primitive",level:"L1",tags:["link"],props:{label:{type:"string"},href:{type:"string"},variant:{type:"string",enum:["default","muted","button","outline"],default:"default"},target:{type:"string",enum:["_self","_blank"],default:"_self"},className:{type:"string",description:"Additional utility classes"}},usageScenarios:["Inline 'Read more' link in a paragraph","CTA button-style link in a hero section"],constraints:[]},Breadcrumb:{name:"Breadcrumb",description:"Hierarchical page path trail. Pass an items array of {label, href?}.",category:"composite",level:"L2",tags:["breadcrumb","nav"],props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},href:{type:"string"}}},description:"Path segments"}},usageScenarios:["Page location context in an admin CRUD view","Multi-step wizard progress"],constraints:[]},List:{name:"List",description:"Unordered list of child blocks. Use with divided or compact for different visual densities.",category:"composite",level:"L2",tags:["list"],props:{divided:{type:"boolean",default:!1,description:"Add hairline dividers between items"},compact:{type:"boolean",default:!1},label:{type:"string",description:"ARIA label"}},usageScenarios:["Recent activity feed","Search result list"],constraints:[]},Table:{name:"Table",description:"Data grid with typed columns and row data. Columns define keys and display labels.",category:"composite",level:"L2",tags:["table","grid","data"],props:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"},align:{type:"string",enum:["left","center","right"]}}},description:"[{key, label, align?}]"},rows:{type:"array",items:{type:"object"},description:"Rows keyed to column.key"},emptyText:{type:"string",default:"No data"},striped:{type:"boolean",default:!0},caption:{type:"string"}},usageScenarios:["User management list","Order history table","API endpoint catalog"],constraints:["rows entries must have keys matching column.key; missing keys render empty string","Avoid more than 8 columns"]},Stat:{name:"Stat",description:"KPI metric card: large value, label, optional trend arrow, and change string.",category:"primitive",level:"L2",tags:["stat","kpi","metric"],props:{label:{type:"string"},value:{type:"string",description:"Main metric value, e.g. 1,234 or $12k"},change:{type:"string",description:'Change label, e.g. "+12% vs last month"'},trend:{type:"string",enum:["up","down"]},description:{type:"string",description:"Secondary helper text"}},usageScenarios:["Dashboard KPI row (4 Stat blocks side-by-side in a Box[direction=row])","Single revenue metric in a Card"],constraints:["Do not put detailed charts inside a Stat; use Stat only for a single number + context"]},Markdown:{name:"Markdown",description:"Renders Markdown source into HTML. Supports # headings, **bold**, *italic*, `code`, and - lists.",category:"primitive",level:"L1",tags:["text","markdown","content"],props:{content:{type:"string",description:"Markdown source text"}},usageScenarios:["Documentation sections","Feature descriptions on a landing page","Release notes"],constraints:["No HTML injection; only Markdown syntax is parsed"]},Heading:{name:"Heading",description:"Semantic h1–h6. Optional visual size is independent of level; display scales with the viewport.",category:"primitive",level:"L1",tags:["text","heading","typography"],props:{className:{type:"string",description:"Tailwind classes"},text:{type:"string"},font:{type:"string",enum:["inherit","display","body","mono"],description:"Theme font role."},size:{type:"string",enum:["xs","sm","md","lg","xl","display"],description:"16/20/24/32/40px; display: fluid 36–72px."},measure:{type:"string",enum:["narrow","normal","wide"],description:"Max line width: 16/24/36ch."},align:{type:"string",enum:["start","center","end"],description:"Text alignment, not block placement."},level:{type:"integer",default:2,description:"Semantic heading level 1–6."},muted:{type:"boolean",default:!1,description:"Render in muted-foreground"}},usageScenarios:["Section title above a Table or Card","Hero headline on a landing page"],constraints:["Use only one h1 per page"]},Paragraph:{name:"Paragraph",description:"Body text block. Use lead for fluid introductory copy; optional measure bounds reading width.",category:"primitive",level:"L1",tags:["text","typography"],props:{className:{type:"string",description:"Tailwind classes"},text:{type:"string"},font:{type:"string",enum:["inherit","display","body","mono"],description:"Theme font role."},size:{type:"string",enum:["sm","md","lg","lead"],default:"md",description:"lead: fluid 18–22px; legacy sizes unchanged."},measure:{type:"string",enum:["narrow","normal","wide"],description:"Max line width: 45/65/80ch."},align:{type:"string",enum:["start","center","end"],description:"Text alignment, not block placement."},muted:{type:"boolean",default:!1}},usageScenarios:["Feature description below a Heading","Helper caption below a form field"],constraints:[]},Form:{name:"Form",description:"Form wrapper that prevents default submission. Place Form.Input, Form.Select, etc. as children and end with Form.Submit.",category:"composite",level:"L2",tags:["form","input"],props:{idempotent:{type:"boolean",description:"Stable event.value idempotency key for unchanged-value retries"},pending:{type:"boolean"},label:{type:"string"},layout:{type:"string",enum:["vertical","horizontal"],default:"vertical"}},events:{onChange:{description:"Bubbled native field changes with { type, name, value, checked }."},onSubmit:{description:"Runs after native submission is prevented.",payload:{type:"object",description:"{ type: 'submit', values: Record<string, value> }"}}},usageScenarios:["Create / edit entity form","Login form","Search filter form"],constraints:["Always include exactly one Form.Submit as the last child","Do not nest forms inside forms"]},"Form.Input":{name:"Form.Input",description:"Single-line text field. Supports text, email, password, number, tel, url, date types.",category:"primitive",level:"L1",tags:["form","input"],props:{name:{type:"string",description:"Unique form field name"},label:{type:"string"},type:{type:"string",enum:["text","email","password","number","tel","url","date","search"],default:"text"},placeholder:{type:"string"},helpText:{type:"string"},error:{type:"string"},required:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1},value:{type:"string",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value }."}},usageScenarios:["Email address field in a login form","Search bar with type=search","Price input with type=number"],constraints:["name prop is required and must be unique within the parent Form"]},"Form.Select":{name:"Form.Select",description:"Dropdown select field with an options array [{value, label}].",category:"primitive",level:"L1",tags:["form","select"],props:{name:{type:"string"},label:{type:"string"},options:{type:"array",items:{type:"object",properties:{value:{type:"string"},label:{type:"string"}}},description:"[{value, label}]"},placeholder:{type:"string"},required:{type:"boolean",default:!1},value:{type:"string",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value }."}},usageScenarios:["Role selector (Admin/Editor/Viewer)","Status filter dropdown"],constraints:[]},"Form.TextArea":{name:"Form.TextArea",description:"Multi-line text input. Use for descriptions, messages, or any free-form long text.",category:"primitive",level:"L1",tags:["form","textarea"],props:{name:{type:"string"},label:{type:"string"},placeholder:{type:"string"},rows:{type:"integer",default:4},helpText:{type:"string"},required:{type:"boolean",default:!1},value:{type:"string",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value }."}},usageScenarios:["Bio / description field on a profile form","Message body in a contact form"],constraints:[]},"Form.Checkbox":{name:"Form.Checkbox",description:"Single boolean checkbox with optional description beneath the label.",category:"primitive",level:"L1",tags:["form","checkbox"],props:{name:{type:"string"},label:{type:"string"},description:{type:"string"},checked:{type:"boolean",description:"Two-way {_bindState:'path'}."}},events:{onChange:{description:"Runs with { type, name, value, checked }."}},usageScenarios:["Terms & conditions consent","Opt-in notification preference"],constraints:[]},"Form.Submit":{name:"Form.Submit",description:"Form submit button. Use variant=destructive for irreversible actions.",category:"primitive",level:"L1",tags:["form","button"],props:{disabled:{type:"boolean",default:!1},label:{type:"string",default:"Submit"},variant:{type:"string",enum:["default","destructive","outline","ghost"],default:"default"},full:{type:"boolean",default:!1}},events:{onClick:{description:"Runs with a plain click payload before the parent form submits."}},usageScenarios:["Save button at the bottom of a form","Delete action with variant=destructive"],constraints:["Must be inside a Form block"]},Button:{name:"Button",description:"Standalone action button. Six visual variants and five sizes. Does not submit forms — use Form.Submit for that.",category:"primitive",level:"L1",tags:["button","action"],props:{label:{type:"string"},variant:{type:"string",enum:["default","destructive","outline","secondary","ghost","link"],default:"default"},size:{type:"string",enum:["xs","sm","default","lg","icon"],default:"default"},full:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1}},events:{onClick:{description:"Runs with a plain click payload."}},usageScenarios:["Primary CTA on a hero section","Row of outline action buttons in a Card actions slot","Ghost icon button in a toolbar"],constraints:["Use Form.Submit, not Button[type=submit], inside a Form","Do not place more than 3 primary (default) buttons on the same view"]},Toast:{name:"Toast",description:"Alert banner (info, success, warning, error); placement top-right floats it as a dismissible corner notice.",category:"primitive",level:"L1",tags:["toast","alert","notification"],props:{message:{type:"string"},title:{type:"string"},level:{type:"string",enum:["info","success","warning","error"],default:"info"},closeable:{type:"boolean",default:!0},placement:{type:"string",enum:["inline","top-right"],default:"inline"},duration:{type:"number",description:"Auto-dismiss after ms"}},usageScenarios:["Transient success message after form submit","Contextual inline data notice"],constraints:["Floating notices must auto-dismiss; keep persistent disclosure inline, clear of navigation and controls"]},Dialog:{name:"Dialog",description:"Confirmation with explicit action intents. Boolean open uses a native modal; omitted open keeps an inline composition.",category:"composite",level:"L2",tags:["dialog","modal","confirm"],props:{open:{type:"boolean",description:"Omit for inline."},pending:{type:"boolean",description:"Lock actions/dismissal."},title:{type:"string"},description:{type:"string"},cancelLabel:{type:"string"},confirmLabel:{type:"string"},confirmVariant:{type:"string",enum:["default","destructive","outline"],default:"default"}},events:{onConfirm:{description:"value=values.action=confirm."},onCancel:{description:"value=values.action=cancel."},onClose:{description:"Dismiss: value=values.open=false."}},usageScenarios:["Delete confirmation prompt","Unsaved changes warning before navigation"],constraints:["Host owns open/pending and persistence; no automatic close/write/retry."]},PanelHeader:{name:"PanelHeader",description:"Section title with optional eyebrow, description and an `actions` slot for buttons or links.",category:"primitive",level:"L1",tags:["header","section","title"],props:{eyebrow:{type:"string"},title:{type:"string"},description:{type:"string"}},slots:{actions:{description:"Buttons or links aligned to the right of the title"}},usageScenarios:["Title and helper text above a table","Panel header with a Refresh button"],constraints:["Use Heading for in-flow headings that need an explicit level"]},EmptyState:{name:"EmptyState",description:"Empty or recoverable status panel (role=status) with title, message and an optional action button.",category:"primitive",level:"L1",tags:["empty","status","placeholder"],props:{title:{type:"string"},message:{type:"string"},description:{type:"string",description:"Alias of message"},actionLabel:{type:"string",description:"Renders an action button when set"}},events:{onClick:{description:"Action button click; onAction is accepted as an alias."}},usageScenarios:["No results after filtering, with a Clear filters action"],constraints:["Use Alert for errors that need immediate attention"]},FactList:{name:"FactList",description:"Key/value fact list (dl). Pass `items` or FactRow children. Not a KPI card; use StatCard for metrics.",category:"composite",level:"L1",tags:["facts","key-value","details"],props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"},code:{type:"boolean"},href:{type:"string"},hrefSection:{type:"string"}}}}},usageScenarios:["Provider detail: base URL, model, revision"],constraints:["Items render as plain rows or links; use FactRow children for onClick"]},FactRow:{name:"FactRow",description:"One fact row inside FactList. `code` renders the value monospaced; `href` / `hrefSection` (-> #section) render a link; onClick makes the value a button.",category:"primitive",level:"L1",tags:["facts","key-value"],props:{label:{type:"string"},value:{type:"string"},code:{type:"boolean",default:!1},href:{type:"string"},hrefSection:{type:"string"}},events:{onClick:{description:"Runs with a plain click payload."}},constraints:["Place inside FactList"]},Alert:{name:"Alert",description:"Inline alert with icon, title and description. destructive uses role=alert; other variants role=status. Status is conveyed by icon and hidden label text, not colour alone.",category:"primitive",level:"L1",tags:["alert","notice","feedback"],props:{variant:{type:"string",enum:["default","destructive","warning","success"],default:"default"},title:{type:"string"},description:{type:"string"},message:{type:"string",description:"Alias of description"}},usageScenarios:["Guardrail notice","Save succeeded","Request failed"]},Badge:{name:"Badge",description:"Small status label. Text is the status; colour is only reinforcement. Children or `label` provide the text.",category:"primitive",level:"L1",tags:["badge","status","label"],props:{variant:{type:"string",enum:["default","secondary","outline","success","warning","destructive"],default:"default"},label:{type:"string"}},usageScenarios:["Provider state: Active / Disabled","Row status in a table"]},Switch:{name:"Switch",description:"Controlled boolean switch (role=switch) with accessible label. Supports _bindState on checked; onChange carries event.checked.",category:"primitive",level:"L1",tags:["switch","toggle","form"],props:{label:{type:"string"},checked:{type:"boolean",default:!1},disabled:{type:"boolean",default:!1}},events:{onChange:{description:"Runs with { type: 'change', checked }"}},usageScenarios:["Enable or disable a provider","Feature flag toggle"],constraints:["Always set label so the control has an accessible name"]},Skeleton:{name:"Skeleton",description:"Animated loading placeholder. Three presets: lines (text), card (avatar + lines), table (header + rows).",category:"primitive",level:"L1",tags:["skeleton","loading","placeholder"],props:{lines:{type:"integer",default:3,description:"Number of skeleton rows (for lines and table types)"},type:{type:"string",enum:["lines","card","table"],default:"lines"}},usageScenarios:["Loading state while fetching table data","Card placeholder during profile load"],constraints:["Replace with real content once data loads; do not keep Skeleton visible indefinitely"]}};var fr={Grid:{name:"Grid",description:"Declarative grid layout. Maps cols/gap/responsive props to Tailwind grid classes; children become grid cells directly.",category:"primitive",level:"L1",tags:["layout","grid","container"],props:{cols:{enum:["1","2","3","4","5","6","auto",1,2,3,4,5,6],default:"auto",description:"Column count, or 'auto' for auto-fit minmax(220px,1fr)"},gap:{type:"string",enum:["none","xs","sm","md","lg","xl"],default:"md"},responsive:{type:"boolean",default:!1,description:"Use a mobile-first ladder (grid-cols-1 → sm:2 → lg:N) instead of a fixed column count"},align:{type:"string",enum:["start","center","end","stretch"]},justify:{type:"string",enum:["start","center","end","between","around"]}},usageScenarios:["4-up Stat dashboard row (cols=4)","Responsive card gallery (cols=3, responsive=true)","Two-column form layout (cols=2)"],constraints:["Grid children become grid cells directly; do not wrap each child in a Box","Use cols='auto' when the number of children is dynamic"]},StatGrid:{name:"StatGrid",description:"Responsive grid of KPI cards. Prefers child Stat blocks; falls back to inline rendering of an items array when there are no children.",category:"composite",level:"L2",tags:["stat","kpi","dashboard","grid"],props:{cols:{type:"string",enum:["1","2","3","4","auto"],default:"auto"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"},change:{type:"string"},trend:{type:"string",enum:["up","down"]},description:{type:"string"}}},description:"Inline KPI items used when no Stat children are provided"}},usageScenarios:["Overview dashboard KPI row","Operations metrics summary above a table"],constraints:["Provide either Stat children or items, not both — children win when present"]},TrendChart:{name:"TrendChart",description:"SVG line/area chart: shared axes, pointer/keyboard values and crosshair. Alias: LineChart.",category:"composite",level:"L2",tags:["chart","trend","line","svg"],props:{variant:{type:"string",enum:["card","plain"],default:"card"},title:{type:"string"},series:{type:"array",items:{type:"object",properties:{name:{type:"string"},points:{type:"array",items:{type:"number"}},area:{type:"boolean",default:!1}}}},labels:{type:"array",items:{type:"string"}},width:{type:"integer",default:480},height:{type:"integer",default:160}},usageScenarios:["Evolution score trend over versions","Daily active users line chart"],constraints:["Max ~200 points/series"]},LineChart:{name:"LineChart",description:"Alias of TrendChart, including pointer/keyboard inspection.",category:"composite",level:"L2",tags:["chart","line","svg"],props:{variant:{type:"string",enum:["card","plain"],default:"card"},labels:{type:"array",items:{type:"string"}},title:{type:"string"},series:{type:"array",items:{type:"object",properties:{name:{type:"string"},points:{type:"array",items:{type:"number"}},area:{type:"boolean",default:!1}}}},width:{type:"integer",default:480},height:{type:"integer",default:160}},usageScenarios:["Same as TrendChart; use whichever name reads better in the spec"],constraints:["Same as TrendChart"]},KanbanBoard:{name:"KanbanBoard",description:"Horizontal kanban board: columns as swimlanes, cards grouped by their column id. Read-only display.",category:"composite",level:"L3",tags:["kanban","board","operations"],props:{columns:{type:"array",items:{type:"object",properties:{id:{type:"string"},title:{type:"string"}}},description:"[{id, title}] swimlane definitions"},cards:{type:"array",items:{type:"object",properties:{id:{type:"string"},column:{type:"string"},title:{type:"string"},subtitle:{type:"string"},badge:{type:"string"}}},description:"[{id, column, title, subtitle?, badge?}] — column must match a column id"}},usageScenarios:["Operations task board (Todo / In progress / Done)","Release pipeline stages"],constraints:["Each card.column must reference an existing column.id, else the card is dropped","Up to 4 columns fit the container as an equal-width grid (no scrollbar); 5+ columns switch to a horizontal scroll strip"]},Matrix:{name:"Matrix",description:"Two-dimensional intensity grid (heatmap). Cell intensities are 0..1 and map to a color-mix of the primary token via inline style. Alias: Heatmap.",category:"composite",level:"L3",tags:["matrix","heatmap","grid","governance"],props:{caption:{type:"string"},rows:{type:"array",items:{type:"string"},description:"Row labels"},cols:{type:"array",items:{type:"string"},description:"Column labels"},cells:{type:"array",items:{type:"array",items:{type:"number"}},description:"rows×cols grid of intensities in [0,1]"},showValues:{type:"boolean",default:!1,description:"Print the numeric value in each cell"}},usageScenarios:["Governance capability coverage matrix","Risk heatmap (likelihood × impact)"],constraints:["Intensities are single-polar 0..1; negative / diverging scales are not supported","cells should be rows.length × cols.length; missing cells render as 0"]},Heatmap:{name:"Heatmap",description:"Alias of Matrix — two-dimensional 0..1 intensity grid.",category:"composite",level:"L3",tags:["heatmap","matrix","grid"],props:{caption:{type:"string"},rows:{type:"array",items:{type:"string"}},cols:{type:"array",items:{type:"string"}},cells:{type:"array",items:{type:"array",items:{type:"number"}}},showValues:{type:"boolean",default:!1}},usageScenarios:["Same as Matrix"],constraints:["Identical implementation to Matrix"]},DiagnosticsList:{name:"DiagnosticsList",description:"Levelled diagnostics list with a coloured left bar and glyph per severity (info / warn / error).",category:"composite",level:"L2",tags:["diagnostics","list","status","overview"],props:{items:{type:"array",items:{type:"object",properties:{level:{type:"string",enum:["info","warn","error"]},title:{type:"string"},detail:{type:"string"}}},description:"[{level, title, detail?}]"}},usageScenarios:["Overview page diagnostics slot","Spec validation results list"],constraints:["level defaults to 'info' when omitted or unrecognised"]},TimelineList:{name:"TimelineList",description:"Vertical timeline with a left rail and a status dot per item (ok / warn / error).",category:"composite",level:"L2",tags:["timeline","activity","operations"],props:{items:{type:"array",items:{type:"object",properties:{time:{type:"string"},title:{type:"string"},desc:{type:"string"},status:{type:"string",enum:["ok","warn","error"]}}},description:"[{time, title, desc?, status?}]"}},usageScenarios:["Operations event timeline","Deployment / audit history"],constraints:["status defaults to 'ok' when omitted"]},SearchableTable:{name:"SearchableTable",description:"Table with a built-in search box. Typing dispatches SetState onto searchKey and filters the resolved rows (case-insensitive substring across all columns).",category:"feature",level:"L3",tags:["table","search","interactive","data"],props:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"},align:{type:"string",enum:["left","center","right"]}}}},rows:{type:"array",items:{type:"object"},description:"Row objects keyed to column.key"},searchKey:{type:"string",default:"search",description:"State path the search query writes to"},placeholder:{type:"string",default:"Search…"},emptyText:{type:"string",default:"No matching rows",description:"Copy shown when the filtered row set is empty"}},usageScenarios:["Searchable plugins / catalog list in studio","User management table with live filtering"],constraints:["Requires a live host (dispatch) for the search box to update host state; client-side filtering still works on already-resolved rows"]},SplitMasterDetail:{name:"SplitMasterDetail",description:"Master/detail split: a selectable left list and a right detail pane. Clicking an item dispatches SetState onto selectKey; the detail slot (or children) renders the right pane.",category:"feature",level:"L3",tags:["split","master-detail","interactive","layout"],props:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},title:{type:"string"},subtitle:{type:"string"}}},description:"[{id, title, subtitle?}] left-list entries"},selectKey:{type:"string",default:"selectedId",description:"State path the selected id writes to"}},slots:{detail:{description:"Right-pane content; usually host-composed from the selected item via _find"}},usageScenarios:["Skills list → skill detail","Agents directory → agent inspector"],constraints:["Selection defaults to the first item's id until the host updates selectKey"]},DetailField:{name:"DetailField",description:"Label + value display row, for use inside a detail pane.",category:"primitive",level:"L1",tags:["detail","field","display"],props:{label:{type:"string"},value:{type:"string",description:"Any scalar; rendered as '—' when empty"},inline:{type:"boolean",default:!1,description:"Render label and value on one line"}},usageScenarios:["Field row inside a SplitMasterDetail detail pane","Read-only record summary"],constraints:["Use for scalar values; for structured data prefer KeyValueGrid"]},BadgeGroup:{name:"BadgeGroup",description:"Horizontal group of status badges. Items may be plain strings or {label, tone}.",category:"composite",level:"L1",tags:["badge","status","tags"],props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},tone:{type:"string",enum:["default","success","warning","error","info"]}}},description:"Array of strings or [{label, tone?}]"}},usageScenarios:["Status / tag chips on a list row","Capability flags on an agent card"],constraints:["tone defaults to 'default' when omitted or unrecognised"]},KeyValueGrid:{name:"KeyValueGrid",description:"Compact key/value grid for metadata. Accepts an items array or a plain record object.",category:"composite",level:"L1",tags:["key-value","metadata","grid","display"],props:{items:{type:"array",items:{type:"object",properties:{key:{type:"string"},value:{type:"string"}}},description:"[{key, value}] pairs (or pass a plain object as `data`)"},cols:{enum:["1","2","3",1,2,3],default:"2"}},usageScenarios:["Model metadata panel (provider, context, pricing)","Request / response header summary"],constraints:["Values are stringified for display; pass pre-formatted strings for control"]},Hero:{name:"Hero",description:"Asymmetric editorial hero: serif display title (with optional italic emphasis word), mono eyebrow with amber dot, warm radial-glow + blueprint dot-grid backdrop, grain overlay, staggered reveal, and primary/secondary CTAs. An optional right-side visual renders via the `aside` slot or children.",category:"presentation",level:"L3",tags:["hero","marketing","landing","editorial"],props:{eyebrow:{type:"string",description:"Mono uppercase kicker above the title"},title:{type:"string",description:"Serif display headline"},titleEmphasis:{type:"string",description:"Optional trailing word rendered italic + amber for emphasis"},subtitle:{type:"string",description:"Supporting lead paragraph"},primaryCta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber button"},secondaryCta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — outline button"},note:{type:"string",description:"Small mono note under the CTAs"}},slots:{aside:{description:"Right-pane visual (e.g. a rendered spec preview); hidden on mobile"}},usageScenarios:["Studio landing-page hero introducing 'AI writes the spec, the platform renders the UI'","Product launch hero with a spec snippet preview on the right"],constraints:["CTA props are {label, href}; href defaults to '#' when omitted","Use titleEmphasis for a single emphasis word, not the whole title"]},BrowserFrame:{name:"BrowserFrame",description:"Product-screenshot window shell: frames its `content` slot (or children) in a precise browser/app chrome — three traffic-light dots + a mono title/address bar — with a hairline border, long soft shadow, and an optional 3D tilt. Used to present a live-rendered UI as a product-shot visual (dogfood) instead of a static screenshot.",category:"presentation",level:"L2",tags:["frame","browser","window","screenshot","marketing"],props:{title:{type:"string",description:"Address/title shown in the window chrome (defaults to 'app.uibot.studio')"},variant:{type:"string",enum:["flat","tilt"],default:"flat",description:"'tilt' adds a subtle 3D perspective tilt for a product-shot feel"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index for the chrome address bar wash (0 amber · 1 teal · 2 rose · 3 indigo)"}},slots:{content:{description:"The UI rendered inside the frame; usually a real dashboard composed from data blocks"}},usageScenarios:["Hero visual framing a live-rendered mini dashboard as the product shot","Showcase row of small frames each rendering a different UI from the same engine"],constraints:["Frames the `content` slot, falling back to children; supply real spec blocks to render a live UI","Decorative chrome only — it does not add browser behaviour (no real address bar)"]},SectionHeader:{name:"SectionHeader",description:"Editorial section header: oversized mono section number (e.g. '01'), mono eyebrow, serif title, and a lead paragraph. Sets the rhythm between page sections.",category:"presentation",level:"L2",tags:["section","header","marketing","editorial"],props:{sectionNo:{type:"string",description:"Oversized mono numeral, e.g. '01'"},eyebrow:{type:"string",description:"Mono uppercase kicker"},title:{type:"string",description:"Serif section title"},lead:{type:"string",description:"Lead / intro paragraph"}},usageScenarios:["Numbered section dividers on a landing page (01 Features, 02 How it works)","Editorial chapter header above a FeatureGrid"],constraints:["sectionNo is display text; any string works (e.g. '01', 'A', '§1')"]},FeatureGrid:{name:"FeatureGrid",description:"Responsive grid of hairline feature cards with hover lift. Renders an `items` array (icon name + title + desc) into FeatureCards, or lays out FeatureCard children directly.",category:"presentation",level:"L2",tags:["features","grid","cards","marketing"],props:{cols:{type:"string",enum:["2","3","4"],default:"3"},items:{type:"array",items:{type:"object",properties:{icon:{type:"string",description:"lucide icon name (sparkles, zap, layers, code, cpu, workflow, gauge, shield, wand, boxes)"},title:{type:"string"},desc:{type:"string"}}},description:"[{icon, title, desc}] feature entries"}},usageScenarios:["Three-up feature highlights under a SectionHeader","Capability grid (declarative spec, gap recovery, plugin catalog)"],constraints:["icon is a lucide name mapped to a built-in inline SVG; unknown names fall back to a dot","Provide either items or FeatureCard children — children win when present"]},FeatureCard:{name:"FeatureCard",description:"Single hairline feature card: inline-SVG icon, serif title, body copy, and optional children. Designed to sit inside a FeatureGrid but works standalone.",category:"presentation",level:"L1",tags:["feature","card","marketing"],props:{icon:{type:"string",description:"lucide icon name (see FeatureGrid)"},title:{type:"string"},desc:{type:"string"}},usageScenarios:["A single emphasised feature beside a screenshot","Composed children inside a FeatureGrid for custom card bodies"],constraints:["icon resolves against the built-in inline-SVG set; unknown → dot fallback"]},CodeShowcase:{name:"CodeShowcase",description:"Mono code panel with window chrome (three dots) and line numbers, used to showcase a UIBot YAML/JSON spec. Pure CSS, no syntax-highlighter dependency.",category:"presentation",level:"L2",tags:["code","spec","showcase","marketing"],props:{title:{type:"string",description:"Filename / label shown in the window chrome"},code:{type:"string",description:"Raw code string; newline-separated, rendered with line numbers"},caption:{type:"string",description:"Caption under the panel"}},usageScenarios:["Show an example UIBot YAML spec on the landing page","Before/after spec snippet in a docs section"],constraints:["code is plain text rendered verbatim with line numbers; no highlighting/escaping beyond React's default"]},CtaBand:{name:"CtaBand",description:"Inverted ink-black call-to-action band with grain overlay and a single amber CTA. Closes a landing page with high contrast.",category:"presentation",level:"L2",tags:["cta","band","marketing","conversion"],props:{title:{type:"string",description:"Serif headline"},subtitle:{type:"string",description:"Supporting line"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber button"}},usageScenarios:["Final 'Start building' band at the bottom of the landing page","Newsletter / docs CTA between sections"],constraints:["Single CTA by design; cta.href defaults to '#' when omitted"]},Faq:{name:"Faq",description:"Editorial accordion FAQ built on native <details>/<summary> — fully functional with zero JS / state wiring. Optional eyebrow/title/lead header; rows carry a mono index numeral, a hairline plus-mark that rotates 45° into a close-mark on open, and a grid-rows expand transition.",category:"presentation",level:"L2",tags:["faq","accordion","marketing","content"],props:{eyebrow:{type:"string",description:"Optional mono overline above the title (accent colored)"},title:{type:"string",description:"Optional serif heading above the list"},lead:{type:"string",description:"Optional muted intro line under the title"},defaultOpenFirst:{type:"boolean",description:"When true, the first row renders open on mount"},items:{type:"array",items:{type:"object",properties:{q:{type:"string"},a:{type:"string"}}},description:"[{q, a}] question/answer pairs; rows with an empty q are dropped"}},usageScenarios:["Pricing / product FAQ section on a landing page","Docs 'common questions' block"],constraints:["Uses native <details> so multiple rows can be open at once; no single-open behaviour","Answers render as plain text; pass pre-formatted strings"]},TeamGrid:{name:"TeamGrid",description:"Grid of team-member cards. Each shows an avatar (image when `avatar` is a URL, otherwise tinted initials), name, mono role and optional bio. Hairline cards with hover lift.",category:"presentation",level:"L2",tags:["team","people","grid","marketing"],props:{columns:{type:"string",enum:["2","3","4"],default:"3"},members:{type:"array",items:{type:"object",properties:{name:{type:"string"},role:{type:"string"},bio:{type:"string"},avatar:{type:"string",description:"Image URL, or short text/emoji shown as the avatar; falls back to initials"}}},description:"[{name, role?, bio?, avatar?}] — members with an empty name are dropped"}},usageScenarios:["About page 'meet the team' grid","Advisors / contributors showcase"],constraints:["avatar is treated as an image when it looks like a URL (http(s):/data:/leading slash); otherwise rendered as text","Initials are derived from the name when no avatar is given"]},Steps:{name:"Steps",description:"'How it works' steps with oversized mono numerals. variant 'numbered' (default) is a responsive card row; variant 'connected' is a vertical rail with a connecting line between numbered dots.",category:"presentation",level:"L2",tags:["steps","how-it-works","process","marketing"],props:{variant:{type:"string",enum:["numbered","connected"],default:"numbered",description:"'numbered' = card row with big numerals; 'connected' = vertical rail with a line"},steps:{type:"array",items:{type:"object",properties:{title:{type:"string"},desc:{type:"string"},icon:{type:"string",description:"Optional lucide icon name; replaces the numeral in the 'connected' dot"}}},description:"[{title, desc?, icon?}] in sequence order; steps with an empty title are dropped"}},usageScenarios:["Three-step onboarding ('Describe → Generate → Render')","Connected setup sequence in docs"],constraints:["Numbering is automatic (01, 02, …) from array order","icon only affects the 'connected' variant's dot; the numbered variant always shows the numeral","Numbered variant derives its column count from the step count (clamped 2–4), so 4 steps fill one row"]},BentoGrid:{name:"BentoGrid",description:"Asymmetric bento layout. Lays BentoCell children, or an `items` array, onto a CSS grid whose base column count is `cols`; cells opt into col/row spans to break the rhythm into a mixed-size mosaic. Hairline cards, per-cell accent tone.",category:"presentation",level:"L3",tags:["bento","grid","layout","marketing"],props:{cols:{type:"string",enum:["2","3","4","6"],default:"3",description:"Base column count of the grid (cells may span fewer/more)"},gap:{type:"string",enum:["none","sm","md","lg"],default:"md"},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},desc:{type:"string"},icon:{type:"string",description:"lucide icon name"},tone:{type:"integer",description:"Accent-hue index 0–3 (amber/teal/rose/indigo)"},span:{type:"object",properties:{col:{type:"integer"},row:{type:"integer"}},description:"Cell span; col 1–4, row 1–3"}}},description:"Inline cells used when no BentoCell children are provided"}},usageScenarios:["Feature mosaic where one tile is hero-sized (span col 2) and the rest are small","Capability bento mixing tall and wide tiles"],constraints:["Provide either BentoCell children or items — children win when present","span.col is clamped to 1–4 and span.row to 1–3 via static class maps (no purge risk)"]},BentoCell:{name:"BentoCell",description:"A single bento tile, usable standalone inside a BentoGrid. Reads span.col / span.row and maps them to static span classes so the cell can be as wide/tall as the mosaic needs. Optional icon/title/desc plus composed children.",category:"presentation",level:"L1",tags:["bento","cell","card","marketing"],props:{title:{type:"string"},desc:{type:"string"},icon:{type:"string",description:"lucide icon name"},tone:{type:"integer",description:"Accent-hue index 0–3 (amber/teal/rose/indigo)"},span:{type:"object",properties:{col:{type:"integer"},row:{type:"integer"}},description:"{col?, row?} — col clamped 1–4, row clamped 1–3"}},usageScenarios:["A hero tile (span col 2, row 2) holding a rendered preview inside a BentoGrid","Custom-bodied bento tile composed from child blocks"],constraints:["Spans are clamped 1–4 (col) / 1–3 (row) and emitted as static classes","Designed to sit inside a BentoGrid; standalone it renders as a lone card"]},Callout:{name:"Callout",description:"Emphasis callout panel: a tinted box (semantic or brand colour) with an icon, optional title and body. color-mix against the chosen token keeps the wash subtle and legible in light and dark.",category:"presentation",level:"L1",tags:["callout","note","alert","marketing"],props:{variant:{type:"string",enum:["info","success","warn","accent"],default:"info",description:"Colour/role: info (indigo) · success (green) · warn (amber) · accent (brand amber)"},title:{type:"string",description:"Emphasised lead line, coloured to the variant"},body:{type:"string",description:"Supporting paragraph"},icon:{type:"string",description:"Optional lucide icon name; defaults to a sensible glyph per variant"}},usageScenarios:["Inline 'Note' / 'Tip' block inside docs or a landing section","Success confirmation or warning banner above content"],constraints:["variant falls back to 'info' when omitted or unrecognised","icon defaults per variant (info→info, success→check, warn→alert, accent→sparkles)"]},PricingTable:{name:"PricingTable",description:"Responsive 2–4 column pricing grid of hairline cards. The `highlighted` plan gets an amber border + 'Popular' badge + solid amber CTA; others use an outline CTA. Features list with amber check glyphs. CTAs are {label, href} anchors.",category:"presentation",level:"L3",tags:["pricing","plans","marketing","conversion"],props:{plans:{type:"array",items:{type:"object",properties:{name:{type:"string"},price:{type:"string",description:"Display price, e.g. '$29' or 'Free'"},period:{type:"string",description:"Billing period suffix, e.g. '/mo'"},description:{type:"string",description:"Short plan summary line"},features:{type:"array",items:{type:"string"},description:"Bullet feature list"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber when highlighted, else outline"},highlighted:{type:"boolean",default:!1,description:"Mark the featured/popular plan"}}},description:"[{name, price, period?, description?, features[], cta{label,href}, highlighted?}]"},billingNote:{type:"string",description:"Mono note under the grid, e.g. 'Billed annually · cancel anytime'"}},usageScenarios:["Three-tier SaaS pricing section (Starter / Pro / Enterprise)","Two-up free-vs-paid comparison with a highlighted paid plan"],constraints:["Column count is derived from plans.length, clamped to 2–4","CTA props are {label, href}; href defaults to '#'","Mark at most one plan highlighted for a clear focal point"]},Testimonials:{name:"Testimonials",description:"Grid of testimonial cards (hairline `.mkt-card`, hover lift): optional star rating, serif italic pull-quote, and an initials avatar token + author + role. `columns` (1–3) controls the grid; avatar tints cycle the four accents.",category:"presentation",level:"L2",tags:["testimonials","social-proof","marketing","quotes"],props:{items:{type:"array",items:{type:"object",properties:{quote:{type:"string"},author:{type:"string"},role:{type:"string",description:"Author title / company"},avatar:{type:"string",description:"Explicit avatar token; defaults to author initials"},rating:{type:"integer",description:"Optional 1–5 star rating"}}},description:"[{quote, author, role?, avatar?, rating?}]"},columns:{type:"string",enum:["1","2","3"],description:"Grid column count (defaults from item count)"}},usageScenarios:["Three-up customer quote wall under a SectionHeader","Single highlighted testimonial beside a feature"],constraints:["avatar defaults to first-letter initials of author; no external images","rating is clamped to 0–5 and omitted when absent"]},LogoCloud:{name:"LogoCloud",description:"A single grayscale 'trusted by' logo strip. With no external images each logo is a mono wordmark (initials for long names); the row is dimmed/desaturated and lifts to full foreground on hover. Optional mono `label` above the row.",category:"presentation",level:"L1",tags:["logos","social-proof","marketing","brands"],props:{label:{type:"string",description:"Eyebrow above the row, e.g. 'Trusted by teams at'"},logos:{type:"array",items:{type:"object",properties:{name:{type:"string"}}},description:"Array of strings or [{name}] — rendered as mono wordmarks/initials"}},usageScenarios:["Logo strip directly under the hero for social proof","Press/partner row between sections"],constraints:["Text-only wordmarks — no external logo images are loaded","Names longer than 14 chars collapse to initials"]},StatBand:{name:"StatBand",description:"Big-number statistics band: oversized serif values with mono labels, divided by hairline rules. `tone` switches the surface — plain, muted (soft card panel) or inverse (ink-black panel with warm amber→rose glow + grain).",category:"presentation",level:"L2",tags:["stats","metrics","marketing","band"],props:{stats:{type:"array",items:{type:"object",properties:{value:{type:"string",description:"Big display value, e.g. '99.9%' or '12k+'"},label:{type:"string"},sub:{type:"string",description:"Optional sub-label under the metric"}}},description:"[{value, label, sub?}]"},tone:{type:"string",enum:["plain","muted","inverse"],default:"plain",description:"Surface treatment: plain (transparent) · muted (card panel) · inverse (ink-black glow panel)"}},usageScenarios:["Four-up headline metrics band (uptime / users / latency / saved)","Inverse-tone impact band between marketing sections"],constraints:["Column count derives from stats.length, clamped to 1–4","Values are display strings; pre-format numbers/units yourself"]},Newsletter:{name:"Newsletter",description:"Email-capture band: serif title + supporting line, then a token-styled email input beside a CTA anchor. Presentational — the input is decorative and the CTA navigates via {label, href}; wire real submission at the host.",category:"presentation",level:"L2",tags:["newsletter","subscribe","marketing","email"],props:{title:{type:"string",description:"Serif headline"},subtitle:{type:"string",description:"Supporting line under the title"},placeholder:{type:"string",default:"you@example.com",description:"Email input placeholder"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber submit button (defaults to 'Subscribe' / '#')"}},usageScenarios:["End-of-page 'Stay in the loop' email signup","Docs/blog newsletter band between content sections"],constraints:["Input is decorative; the form action points at cta.href — handle real submission upstream","Single email field + single CTA by design"]},Banner:{name:"Banner",description:"Slim full-width announcement bar: optional icon + message, an inline CTA link and a decorative dismiss '×'. `tone` picks one of the four brand accents; `solid` fills the strip with the accent instead of a soft tint.",category:"presentation",level:"L1",tags:["banner","announcement","marketing","notice"],props:{message:{type:"string",description:"Announcement text"},icon:{type:"string",description:"lucide icon name (defaults to 'sparkles')"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index (0 amber · 1 teal · 2 rose · 3 indigo)"},solid:{type:"boolean",default:!1,description:"Fill the strip with the accent colour"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — inline mono link on the right"},dismissible:{type:"boolean",default:!0,description:"Show the decorative × (presentational only)"}},usageScenarios:["Top-of-page launch/announcement strip above the hero","Soft-tint 'new docs available' notice between sections"],constraints:["The dismiss × is decorative — wire real dismissal at the host","tone is 0–3; CTA href defaults to '#'"]},FeatureSplit:{name:"FeatureSplit",description:"Alternating two-column feature section: an editorial text column (eyebrow, serif title, body, bulleted benefits, optional CTA) beside a visual column. The visual renders the `visual` slot (or children) — e.g. a BrowserFrame — falling back to a tinted blueprint placeholder. `reverse` flips the column order for an alternating page rhythm.",category:"presentation",level:"L3",tags:["feature","split","two-column","marketing"],props:{eyebrow:{type:"string",description:"Mono uppercase kicker"},title:{type:"string",description:"Serif feature title"},body:{type:"string",description:"Supporting paragraph"},bullets:{type:"array",items:{type:"object",properties:{icon:{type:"string"},text:{type:"string"}}},description:"Array of strings or [{icon?, text}] benefit rows"},cta:{type:"object",properties:{label:{type:"string"},href:{type:"string"}},description:"{label, href} — solid amber button"},reverse:{type:"boolean",default:!1,description:"Place the visual on the left"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index for the bullet chips / placeholder"}},slots:{visual:{description:"Right-pane visual (BrowserFrame, rendered preview, image); falls back to children then a placeholder"}},usageScenarios:["Alternating feature rows down a landing page (reverse every other)","Text + live BrowserFrame preview feature block"],constraints:["Provide a visual slot/children for the right pane; otherwise a tinted placeholder renders","bullets accept strings or {icon?, text}; CTA href defaults to '#'"]},ComparisonTable:{name:"ComparisonTable",description:"Feature comparison table across products/plans. The header lists columns (a `highlighted` column gets an amber-washed spine); each row pairs a feature label with one value per column — booleans render as amber check / muted cross glyphs, strings render verbatim. Horizontally scrollable on small screens.",category:"presentation",level:"L3",tags:["comparison","table","pricing","marketing"],props:{featureLabel:{type:"string",description:"Header label for the feature column (often blank)"},columns:{type:"array",items:{type:"object",properties:{name:{type:"string"},highlighted:{type:"boolean"}}},description:"Array of strings or [{name, highlighted?}] — column headers"},rows:{type:"array",items:{type:"object",properties:{feature:{type:"string"},values:{type:"array",items:{},description:"One value per column (boolean → ✓/✗, string → verbatim)"}}},description:"[{feature, values[]}] — values align positionally with columns"}},usageScenarios:["Plan feature comparison (Free / Pro / Enterprise) with a highlighted column","Product-vs-competitor capability matrix"],constraints:["values align by index with columns; missing/falsey values render as a muted cross","Booleans (or 'yes'/'no'/'true'/'false') become glyphs; other strings render verbatim"]},Roadmap:{name:"Roadmap",description:"Product roadmap / milestone timeline. A vertical rail with one node per milestone; node state drives the dot — a filled amber check for 'done', an amber ring + rocket for 'active', an outline flag for 'planned'. A marketing roadmap (distinct from the operational TimelineList activity log).",category:"presentation",level:"L2",tags:["roadmap","milestones","timeline","marketing"],props:{milestones:{type:"array",items:{type:"object",properties:{date:{type:"string",description:"Quarter/date label, e.g. 'Q3 2026'"},title:{type:"string"},desc:{type:"string"},state:{type:"string",enum:["done","active","planned"]}}},description:"[{date?, title, desc?, state?}] in sequence order"}},usageScenarios:["Public product roadmap section (shipped / in progress / planned)","Launch sequence with dated milestones"],constraints:["state defaults to 'planned' when omitted or unrecognised","milestones with an empty title are dropped"]},StatHighlight:{name:"StatHighlight",description:"Single big-number spotlight: an oversized serif value with an optional trend delta (up = amber, down = rose), a mono label and supporting copy. Draws the eye to one headline metric (distinct from StatBand's multi-stat row).",category:"presentation",level:"L1",tags:["stat","metric","highlight","marketing"],props:{value:{type:"string",description:"Big display value, e.g. '99.9%' or '12k+'"},label:{type:"string",description:"Mono uppercase label under the value"},body:{type:"string",description:"Supporting paragraph"},delta:{type:"string",description:"Trend delta pill text, e.g. '+12%'"},trend:{type:"string",enum:["up","down"],default:"up",description:"Delta direction: up (amber, arrow up) or down (rose, arrow down)"}},usageScenarios:["Centered headline metric between two content sections","Single KPI spotlight with a growth delta"],constraints:["Values/deltas are display strings; pre-format numbers/units yourself","trend only affects the delta pill colour/arrow; omit delta to hide the pill"]},IconList:{name:"IconList",description:"Benefit / checklist list with icons. Each item shows a tinted icon chip, a title and optional supporting line, laid into a 1–3 column grid; tints cycle the four accents. Lighter-weight than FeatureGrid (no card material) — for inline benefit/checklist runs.",category:"presentation",level:"L1",tags:["benefits","checklist","list","marketing"],props:{columns:{type:"string",enum:["1","2","3"],default:"2"},icon:{type:"string",description:"Default lucide icon for items without their own (defaults to 'check')"},items:{type:"array",items:{type:"object",properties:{icon:{type:"string"},title:{type:"string"},desc:{type:"string"}}},description:"Array of strings or [{icon?, title, desc?}]"}},usageScenarios:["Two-column 'what's included' benefit list","Checklist of capabilities under a SectionHeader"],constraints:["items accept plain strings (→ title only) or {icon?, title, desc?}","icon falls back to the block-level `icon` (default 'check'); unknown names → dot"]},Footer:{name:"Footer",description:"Multi-column marketing footer: a brand block (serif wordmark + tagline) beside grouped link columns, with a bottom rule carrying a copyright line and small print. Pure layout off theme tokens.",category:"presentation",level:"L2",tags:["footer","navigation","marketing","layout"],props:{brand:{type:"string",description:"Brand wordmark (serif display under .marketing)"},tagline:{type:"string",description:"Short brand tagline under the wordmark"},groups:{type:"array",items:{type:"object",properties:{title:{type:"string"},links:{type:"array",items:{type:"object",properties:{label:{type:"string"},href:{type:"string"}}}}}},description:"[{title, links:[{label, href}]}] link columns"},copyright:{type:"string",description:"Bottom-left copyright line"},note:{type:"string",description:"Bottom-right mono small print"}},usageScenarios:["Site-wide marketing footer with Product / Company / Legal columns","Compact footer with brand + a single link group"],constraints:["link href defaults to '#' when omitted; empty groups/links are dropped","The bottom rule only renders when copyright or note is provided"]},AccordionList:{name:"AccordionList",description:"General-purpose content accordion on native <details>/<summary> — fully functional with zero JS. Each row is a standalone hairline card with an optional leading icon chip, a title and a body. `defaultOpenFirst` opens the first row. (Faq is the divided-single-card Q&A variant.)",category:"presentation",level:"L2",tags:["accordion","details","content","marketing"],props:{title:{type:"string",description:"Optional serif heading above the list"},defaultOpenFirst:{type:"boolean",default:!1,description:"Open the first row by default"},items:{type:"array",items:{type:"object",properties:{icon:{type:"string",description:"Optional lucide icon for the row chip"},title:{type:"string"},body:{type:"string"}}},description:"[{icon?, title, body}] — rows with an empty title are dropped"}},usageScenarios:["Expandable feature explainers (icon + title + body) on a landing page","Docs 'details' sections with one card per topic"],constraints:["Uses native <details> so multiple rows can be open at once (no single-open behaviour)","Bodies render as plain text; pass pre-formatted strings"]},MetricCard:{name:"MetricCard",description:"KPI metric card with an inline pure-SVG sparkline: a mono label, a big value, a trend delta pill (up = amber, down = rose) and a sparkline drawn from a `points` series — no chart dependency. A `.mkt-card` with hover lift; `tone` selects the accent. Designed to sit in a Grid/StatGrid for a metrics row.",category:"presentation",level:"L2",tags:["metric","kpi","sparkline","card","dashboard"],props:{label:{type:"string",description:"Mono uppercase metric label"},value:{type:"string",description:"Big display value"},delta:{type:"string",description:"Trend delta pill, e.g. '+8.2%'"},trend:{type:"string",enum:["up","down"],default:"up",description:"Delta direction: up (amber) or down (rose)"},tone:{type:"string",enum:["0","1","2","3"],default:"0",description:"Accent-hue index for the sparkline stroke/fill"},points:{type:"array",items:{type:"number"},description:"Numeric series for the inline sparkline (auto-scaled)"}},usageScenarios:["Four-up KPI metrics row inside a Grid (revenue / users / latency / churn)","Single highlighted metric with a trend sparkline"],constraints:["points are auto-scaled to the card's min/max; keep series small (~<60 points)","value/delta are display strings; the sparkline is hidden when points is empty"]},GalleryGrid:{name:"GalleryGrid",description:"Caption gallery grid. Lays image tiles (or, with no `src`, a tinted blueprint placeholder) onto a 2–4 column responsive grid; a tile may opt into `wide` to span two columns for a mixed-rhythm mosaic. Captions sit on a gradient scrim over each tile. Hairline framing, hover lift — no external images required.",category:"presentation",level:"L2",tags:["gallery","images","grid","marketing"],props:{columns:{type:"string",enum:["2","3","4"],default:"3"},items:{type:"array",items:{type:"object",properties:{src:{type:"string",description:"Image URL; omit for a tinted placeholder"},caption:{type:"string",description:"Caption shown over a gradient scrim"},tone:{type:"integer",description:"Accent-hue index 0–3 for the placeholder"},wide:{type:"boolean",description:"Span two columns"}}},description:"[{src?, caption?, tone?, wide?}] gallery tiles"}},usageScenarios:["Screenshot gallery with a wide hero tile and smaller supporting tiles","Placeholder-driven layout mock before real imagery exists"],constraints:["src is treated as an image when it looks like a URL (http(s):/data:/leading slash); otherwise a placeholder renders","wide spans two columns from the sm breakpoint up"]}};var hk=Ni(),bk=Lt(),wk=bi(),Gi=Nt(),vk=wt(),Ie=P(),Sk=Se(),kk=D(),Ck=Ce(),Rk=Re(),YP=Zr(),xk=Hi(),Ik=Vi(),Ak=zi(),nn=Tl(),Ol=ht();var Ek=hk.Composer,Pk=bk.Document,Tk=wk.Schema,{YAMLError:Ok,YAMLParseError:Dk,YAMLWarning:Lk}=Gi,Nk=vk.Alias,{isAlias:_k,isCollection:Mk,isDocument:$k,isMap:Bk,isNode:qk,isPair:Fk,isScalar:jk,isSeq:Uk}=Ie,Hk=Sk.Pair,Vk=kk.Scalar,zk=Ck.YAMLMap,Gk=Rk.YAMLSeq;var Kk=xk.Lexer,Wk=Ik.LineCounter,Yk=Ak.Parser,{parse:Ae,parseAllDocuments:Jk,parseDocument:Qk,stringify:Xk}=nn,{visit:Zk,visitAsync:eC}=Ol;class j extends Error{code;details;constructor(e,t,r){super(t);this.name="CompileSpecError",this.code=e,this.details=r}}function tC(e,t){let r=Object.hasOwn(t,e)?t[e]:void 0;if(!r)throw new j("unknown-template",`unknown template "${e}"`,{template:e});let n=r.pages[0]?.blocks[0];if(!n||n.type!=="PageLayout")throw new j("invalid-shell-root",`template "${e}" root is not PageLayout`,{template:e});return n}function on(e,t,r,n){let i=e;if(e.template){if(r.has(e.template))throw new j("template-cycle",`template cycle at "${e.template}"`,{template:e.template});let o=tC(e.template,t),s=new Set(r);s.add(e.template);let a={...o.slots,...e.slots};if(n&&!e.slots?.sidebar)delete a.sidebar;let c=e.children??o.children,l=e.events??o.events,p=e.visible??o.visible;return i={...o,...e.id?{id:e.id}:{},props:{...o.props,...e.props},slots:a,...c?{children:c}:{},...l?{events:l}:{},...p!==void 0?{visible:p}:{}},on(i,t,s,n)}return{...i,...i.children?{children:i.children.map((o)=>on(o,t,r,n))}:{},...i.slots?{slots:Object.fromEntries(Object.entries(i.slots).map(([o,s])=>[o,s.map((a)=>on(a,t,r,n))]))}:{}}}function rC(e){let t=(r)=>{if(r.template)return!0;if(r.children?.some(t))return!0;return Object.values(r.slots??{}).some((n)=>n.some(t))};return e.pages.some((r)=>r.blocks.some(t))}function Dl(e,t){return e.map((r)=>{if("children"in r&&Array.isArray(r.children))return{type:"MenuGroup",props:{title:r.label},children:Dl(r.children,t)};let n=r,i={label:n.label,href:n.path};if(n.icon)i.icon=n.icon;if(n.path===t)i.active=!0;return{type:"MenuLink",props:i}})}function nC(e){let t=e.menus?.items;if(!t?.length)return e;return{...e,pages:e.pages.map((r)=>({...r,blocks:r.blocks.map((n)=>{if(n.type!=="PageLayout")return n;if(n.slots?.sidebar?.length)return n;return{...n,slots:{...n.slots,sidebar:[{type:"PageSiderMenu",props:{title:r.title??n.props?.title??"Menu"},children:Dl(t,r.path)}]}}})}))}}function Ki(e,t={}){let r=Boolean(e.menus?.items?.length),n=rC(e)?{...e,pages:e.pages.map((i)=>({...i,blocks:i.blocks.map((o)=>on(o,t,new Set,r))}))}:e;return nC(n)}function Ll(e,t){if(e===void 0)return;function r(){throw new j("invalid-layout","Invalid application or page layout",{...t?{pageId:t}:{}})}if(!e||typeof e!=="object"||Array.isArray(e))r();for(let[n,i]of Object.entries(e)){if(t!==void 0&&n==="inherit"&&typeof i==="boolean")continue;let o=Nn[n];if(!Object.hasOwn(Nn,n)||!o?.includes(i))r()}}function Nl(e,t){if(Ll(e.layout),Ll(t.layout,t.id),!t.blocks.some((s)=>s.type==="PageLayout"&&s.props?.appearance!=="standalone")){if(!t.layout)return t.blocks;if(Object.keys(t.layout).some((a)=>a!=="inherit"&&a!=="container"))throw new j("invalid-layout","Standalone pages only support container layout",{pageId:t.id});if(t.blocks.some((a)=>a.type==="PageLayout"&&a.props?.appearance==="standalone"))return t.blocks.map((a)=>a.type==="PageLayout"?{...a,props:{...a.props,layout:{container:t.layout?.container??"fluid"}}}:a);return[{type:"PageLayout",props:{appearance:"standalone",layout:{container:t.layout.container??"fluid"}},children:t.blocks}]}if(!e.layout&&!t.layout)return t.blocks;let{inherit:n,...i}=t.layout??{},o={...pa,...t.layout?.inherit===!1?{}:e.layout,...i};return t.blocks.map((s)=>s.type==="PageLayout"?{...s,props:{...s.props,layout:o}}:s)}function iC(e){ma(e);let t=new Map,r=new Map,n=new Map,i=(o,s)=>{if(o.id!==void 0){if(n.has(o.id)){let a=n.get(o.id);throw new j("duplicate-block-id",`Block id "${o.id}" is declared more than once`,{blockId:o.id,firstPageId:a,pageId:s})}n.set(o.id,s)}for(let a of o.children??[])i(a,s);for(let a of Object.values(o.slots??{}))for(let c of a)i(c,s)};return e.pages.forEach((o,s)=>{let a=t.get(o.id);if(a!==void 0)throw new j("duplicate-page-id",`Page id "${o.id}" is declared more than once`,{pageId:o.id,firstIndex:a,pageIndex:s});if(t.set(o.id,s),r.has(o.path)){let c=r.get(o.path);throw new j("duplicate-page-path",`Page path "${o.path}" is declared more than once`,{path:o.path,firstPageId:c,pageId:o.id})}r.set(o.path,o.id);for(let c of o.blocks)i(c,o.id)}),new Set(n.keys())}function oC(e,t,r){while(!0){let n=t.counter++,i=r?`${r}_${n}`:`${e}_${n}`;if(!t.reservedIds.has(i)&&!t.assignedIds.has(i))return i}}function Wi(e,t,r,n,i,o){let s=e.id??oC(t,n,o??i);if(n.assignedIds.has(s))throw new j("duplicate-block-id",`Block id "${s}" is declared more than once`,{blockId:s,pageId:t});n.assignedIds.add(s);let a=(e.children??[]).map((p)=>Wi(p,t,r,n,s,s)),c={};for(let[p,u]of Object.entries(e.slots??{}))c[p]=u.map((g)=>Wi(g,t,r,n,s,`${s}_${p}`));let l={id:s,pageId:t,type:e.type,...i?{parentId:i}:{},...e.props?{props:e.props}:{},...a.length?{children:a}:{},...Object.keys(c).length?{slots:c}:{},...e.events?{events:e.events}:{},...e.visible!==void 0?{visible:e.visible}:{},...e.template?{template:e.template}:{},...e.variant?{variant:e.variant}:{}};return r[s]=l,s}function Yi(e,t={}){e=Ki(e,t);let n={counter:0,reservedIds:iC(e),assignedIds:new Set},i=Object.create(null);return{version:"2.0",pages:e.pages.map((s)=>{let a=[];for(let c of Nl(e,s))a.push(Wi(c,s.id,i,n));return{id:s.id,path:s.path,...s.title?{title:s.title}:{},rootBlockIds:a,...s.state?{state:s.state}:{},...s.auth?{auth:s.auth}:{},...s.lifecycle?{lifecycle:s.lifecycle}:{},...s.computed?{computed:s.computed}:{},...s.urlState?{urlState:s.urlState}:{}}}),...e.design?{design:e.design}:{},...e.connections?{connections:e.connections.map((s)=>({...s}))}:{},blocks:i}}var Ft=[{id:"_state",generation:{syntax:"page-state path",positions:["props","computed","action-value","visible"],example:{_state:"open"},prerequisite:"Declare the path on the same page"},bucket:"client",description:"Reads a value from the page state store"},{id:"_bindState",generation:{syntax:"page-state path",positions:["binding"],example:{_bindState:"name"},prerequisite:"Only installed controls implementing two-way binding"},bucket:"client",description:"Two-way state binding (read + write)"},{id:"_payload",generation:{syntax:"payload field",positions:["request-context"],example:{_payload:"name"},prerequisite:"Caller must supply request payload; ordinary preview props have no payload"},bucket:"client",description:"Request payload field"},{id:"_event",generation:{syntax:"event field",positions:["action-value"],example:{_event:"value"},prerequisite:"Only within an event action; permitted fields: type,name,value,checked,values. Read own-property dotted paths such as values.id or values.name"},bucket:"client",description:"Event payload field (e.g. form submit value)"},{id:"_global",generation:{syntax:"host-global field",positions:["host-context"],example:{_global:"configuredValue"},prerequisite:"Host-dependent and excluded from ordinary creation; no secrets"},bucket:"client",description:"Global (window) property access"},{id:"_if",generation:{syntax:"[condition, then, else]",positions:["props","computed","action-value"],example:{_if:[{_state:"open"},"Open","Closed"]}},bucket:"client",description:"Conditional ternary: [condition, then, else]"},{id:"_eq",generation:{syntax:"[a, b]",positions:["props","computed","action-value","visible","predicate"],example:{_eq:[{_state:"status"},"Active"]}},bucket:"client",description:"Equality: [a, b] → a === b"},{id:"_ne",generation:{syntax:"[a, b]",positions:["props","computed","action-value","visible","predicate"],example:{_ne:[{_state:"status"},"Active"]}},bucket:"client",description:"Inequality: [a, b] → a !== b"},{id:"_contains",generation:{syntax:"[haystack, needle]",positions:["props","computed","action-value","visible","predicate"],example:{_contains:[{_state:"name"},"orion"]}},bucket:"client",description:"Case-insensitive substring match: [haystack, needle] → haystack contains needle (empty needle → true)"},{id:"_gt",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_gt:[{_state:"count"},0]}},bucket:"client",description:"Greater-than for finite numbers: [a, b] → a > b. Non-numbers are false"},{id:"_lt",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_lt:[{_state:"count"},10]}},bucket:"client",description:"Less-than for finite numbers: [a, b] → a < b. Non-numbers are false"},{id:"_gte",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_gte:[{_state:"count"},0]}},bucket:"client",description:"Greater-or-equal for finite numbers: [a, b] → a >= b. Non-numbers are false"},{id:"_lte",generation:{syntax:"[finite-number, finite-number]",positions:["props","computed","action-value","visible","predicate"],example:{_lte:[{_state:"count"},10]}},bucket:"client",description:"Less-or-equal for finite numbers: [a, b] → a <= b. Non-numbers are false"},{id:"_in",generation:{syntax:"[value, array]",positions:["props","computed","action-value","visible","predicate"],example:{_in:[{_state:"status"},["Active","Draft"]]}},bucket:"client",description:"Membership: [value, array] → array includes value"},{id:"_not",generation:{syntax:"condition",positions:["props","computed","action-value","visible","predicate"],example:{_not:{_state:"open"}}},bucket:"client",description:"Logical NOT"},{id:"_and",generation:{syntax:"[condition, ...]",positions:["props","computed","action-value","visible","predicate"],example:{_and:[{_state:"ready"},{_state:"open"}]}},bucket:"client",description:"Logical AND over a list of conditions"},{id:"_or",generation:{syntax:"[condition, ...]",positions:["props","computed","action-value","visible","predicate"],example:{_or:[{_state:"ready"},{_state:"open"}]}},bucket:"client",description:"Logical OR over a list of conditions"},{id:"_user",generation:{syntax:"session user field",positions:["props","computed","action-value"],example:{_user:"name"},prerequisite:"Requires injected host session; no server ACL guarantee"},bucket:"client",description:"Current session user field (client-visible)"},{id:"_item",generation:{syntax:"item field or empty string",positions:["predicate","loop-props"],example:{_item:"name"},prerequisite:"Only inside a declared loop or filter/find predicate"},bucket:"client",description:"Current list item in a loop scope"},{id:"_index",generation:{syntax:"ignored scalar marker",positions:["predicate","loop-props"],example:{_index:0},prerequisite:"Only inside a declared loop or filter/find predicate"},bucket:"client",description:"Current list index in a loop scope"},{id:"_array.length",generation:{syntax:"array expression",positions:["props","computed","action-value"],example:{"_array.length":{_state:"rows"}}},bucket:"client",description:"Array length"},{id:"_string.concat",generation:{syntax:"[value, ...]",positions:["props","computed","action-value"],example:{"_string.concat":["Hello ",{_state:"name"}]}},bucket:"client",description:"String concatenation over a list"},{id:"_number.add",generation:{syntax:"[left, right] (finite numbers)",positions:["action-value"],example:{"_number.add":[{_state:"count"},1]},prerequisite:"Both operands must evaluate to finite numbers or the action fails and writes nothing; use it in SetState value for counters (e.g. SetState count = count + 1), never for strings or arrays"},bucket:"client",description:"Finite number addition: [left, right] → left + right. Throws on non-number, non-finite or overflowing operands (no coercion, no fallback to 0)"},{id:"_computed",generation:{syntax:"computed name",positions:["props","computed","action-value","visible"],example:{_computed:"filtered"},prerequisite:"Declare page computed expression"},bucket:"client",description:"Reads a derived (computed) state value by name from the __computed namespace"},{id:"_filter",generation:{syntax:"[array, predicate]",positions:["props","computed","action-value"],example:{_filter:[{_state:"rows"},{_eq:[{_item:"status"},"Active"]}]}},bucket:"client",description:"Filters an array: [arrayExpr, predExpr] with { _item, _index } scope"},{id:"_find",generation:{syntax:"[array, predicate]",positions:["props","computed","action-value"],example:{_find:[{_state:"rows"},{_eq:[{_item:"name"},"Orion"]}]}},bucket:"client",description:"Finds the first matching element: [arrayExpr, predExpr] with { _item, _index } scope"},{id:"_len",generation:{syntax:"array/string/object expression",positions:["props","computed","action-value"],example:{_len:{_state:"rows"}}},bucket:"client",description:"Length of an array, string, or object (0 if empty)"},{id:"_concat",generation:{syntax:"[value, ...]",positions:["props","computed","action-value"],example:{_concat:[[1],[2]]},prerequisite:"Concatenation is not numeric addition"},bucket:"client",description:"Concatenates a list: arrays are joined, otherwise values are string-concatenated"},{id:"_count",generation:{syntax:"array or [array, predicate?]",positions:["props","computed","action-value"],example:{_count:[{_state:"rows"}]}},bucket:"client",description:"Count of an array, or of elements matching a predicate: [array, predicate?]"},{id:"_groupCount",generation:{syntax:"[array, field]",positions:["props","computed","action-value"],example:{_groupCount:[{_state:"rows"},"status"]}},bucket:"client",description:"Counts array items by a field in one pass: [array, field] → { value: count }"},{id:"_sort",generation:{syntax:"[array, {by, order?, rank?}]",positions:["props","computed","action-value"],example:{_sort:[{_state:"rows"},{by:"name",order:"asc"}]}},bucket:"client",description:"Stable sort: [array, { by, order?: asc|desc, rank?: { field: values[] } }]. rank is enum order"},{id:"_js",generation:{syntax:"disabled",positions:[],example:{_js:"disabled"},prerequisite:"Arbitrary code execution is disabled; permissions do not enable it",disabled:!0},bucket:"client",description:"Legacy JS expression; execution is always disabled"}],sn=new Set(Ft.map((e)=>e.id));var _l=new Set(da),sC=new Map(Ft.map((e)=>[e.id,e])),Bl=new Set(["array","boolean","integer","null","number","object","string"]),ql=new Set(["additionalProperties","default","description","enum","items","properties","required","type"]);function Ml(e){if(!e)return[];return Object.keys(e)}function aC(e){if(!e||e.type!=="array")return;let t=e.items;if(!t||typeof t!=="object"||t.type!=="object"||!t.properties)return;return new Set(Object.keys(t.properties))}function Ji(e,t,r){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let[n,i]of e.entries())Ji(i,`${t}[${n}]`,r);return}for(let[n,i]of Object.entries(e)){let o=t?`${t}.${n}`:n;r(n,i,o),Ji(i,o,r)}}function an(e,t,r,n,i,o,s,a){Ji(n,i,(c,l,p)=>{if((c==="_state"||c==="_bindState")&&typeof l==="string"){let u=l.split("."),g=u[0]??"";if(g==="__computed"){let d=u[1]??"";if(!s.has(d))e.push({code:"refs:computed-declared",message:`${t}: _computed "${d}" is not declared`,elementKey:r,path:p});return}if(!o.has(g))e.push({code:"refs:state-declared",message:`${t}: _state "${g}" is not declared in state`,elementKey:r,path:p})}if(c==="_computed"&&typeof l==="string"&&!s.has(l))e.push({code:"refs:computed-declared",message:`${t}: _computed "${l}" is not declared`,elementKey:r,path:p});if(c==="_item"&&typeof l==="string"&&l!==""&&a&&!a.has(l))e.push({code:"item:field-exists",message:`${t}: _item "${l}" is not in the item schema`,elementKey:r,path:p})})}function V(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function jt(e){return V(e)&&Object.keys(e).some((t)=>t.startsWith("_"))}var $l=new Set(["_eq","_ne","_contains","_gt","_lt","_gte","_lte","_in","_not","_and","_or"]);function cC(e,t){if(new Set(["_eq","_ne","_contains","_gt","_lt","_gte","_lte","_in","_filter","_find","_groupCount","_sort","_number.add"]).has(e)){if(!Array.isArray(t)||t.length!==2)return!1;if(e==="_groupCount")return typeof t[1]==="string";if(e==="_sort"){let n=t[1];if(!V(n))return!1;if(!(typeof n.by==="string"&&n.by.length>0||Array.isArray(n.by)&&n.by.length>0&&n.by.every((o)=>typeof o==="string"&&o.length>0)))return!1;if(n.order!==void 0&&n.order!=="asc"&&n.order!=="desc")return!1;if(n.rank!==void 0&&(!V(n.rank)||Object.values(n.rank).some((o)=>!Array.isArray(o))))return!1;return Object.keys(n).every((o)=>["by","order","rank"].includes(o))}return!0}if(e==="_if")return Array.isArray(t)&&t.length===3;if(e==="_and"||e==="_or")return Array.isArray(t)&&t.length>0;if(e==="_string.concat"||e==="_concat")return Array.isArray(t)&&t.length>0;if(e==="_count")return!Array.isArray(t)||t.length===1||t.length===2;if(e==="_index")return typeof t==="number"&&Number.isFinite(t);if(["_state","_bindState","_computed","_event","_global","_payload","_user"].includes(e))return typeof t==="string"&&t.length>0;if(e==="_item")return typeof t==="string";return!0}function Fl(e){return e.enum===void 0||Array.isArray(e.enum)&&e.enum.length>0&&e.enum.every((t)=>t===null||typeof t==="string"||typeof t==="boolean"||typeof t==="number"&&Number.isFinite(t))}function Be(e,t,r,n,i,o){if(r==="predicate"&&(!jt(e)||!$l.has(Object.keys(e)[0]??"")))return n.push({code:"props:expression",message:`${i}: predicate must be a supported expression node`,elementKey:o,path:t}),!1;if(e===void 0)return n.push({code:"props:expression",message:`${i}: value is not part of the supported serialized expression syntax`,elementKey:o,path:t}),!1;if(Array.isArray(e))return e.reduce((g,d,m)=>Be(d,`${t}[${m}]`,r,n,i,o)&&g,!0);if(!V(e)){if(typeof e==="number"&&!Number.isFinite(e)||e!==null&&!["string","number","boolean"].includes(typeof e))return n.push({code:"props:expression",message:`${i}: value is not part of the supported serialized expression syntax`,elementKey:o,path:t}),!1;return e===null||["string","number","boolean"].includes(typeof e)}let s=Object.keys(e).filter((g)=>g.startsWith("_"));if(s.length===0)return Object.entries(e).reduce((g,[d,m])=>Be(m,`${t}.${d}`,r,n,i,o)&&g,!0);let a=s[0]??"",c=sC.get(a),l=`${t}.${a}`;if(s.length!==1||Object.keys(e).length!==1||!c)return n.push({code:"props:expression",message:`${i}: expression shape is not supported`,elementKey:o,path:l}),!1;if(c.generation?.disabled||!c.generation?.positions.includes(r)&&!(r==="props"&&c.generation?.positions.includes("binding"))&&!(r==="predicate-value"&&c.generation?.positions.some((g)=>["props","computed","predicate"].includes(g))))return n.push({code:"props:expression",message:`${i}: expression is not supported in this value position`,elementKey:o,path:l}),!1;let p=e[a];if(!cC(a,p))return n.push({code:"props:expression",message:`${i}: expression operand shape is not supported`,elementKey:o,path:l}),!1;let u=(g)=>jt(g)||Array.isArray(g);if(["_filter","_find","_groupCount","_sort"].includes(a)&&!u(Array.isArray(p)?p[0]:void 0)||a==="_in"&&!u(Array.isArray(p)?p[1]:void 0))return n.push({code:"props:expression",message:`${i}: expression array operand has an unsupported literal shape`,elementKey:o,path:l}),!1;if(a==="_count"&&(Array.isArray(p)?!u(p[0]):!u(p))||a==="_array.length"&&!u(p))return n.push({code:"props:expression",message:`${i}: expression array operand has an unsupported literal shape`,elementKey:o,path:l}),!1;if(["_gt","_lt","_gte","_lte"].includes(a)&&Array.isArray(p)){if(p.some((d)=>!jt(d)&&(typeof d!=="number"||!Number.isFinite(d))))return n.push({code:"props:expression",message:`${i}: numeric comparison literals must be finite numbers`,elementKey:o,path:l}),!1}if(Array.isArray(p))return p.reduce((g,d,m)=>{let f=r;if((["_filter","_find"].includes(a)||a==="_count")&&m===1)f="predicate";else if(r==="predicate"||r==="predicate-value"){if(f=$l.has(a)?"predicate-value":r,r==="predicate"&&["_and","_or"].includes(a))f="predicate"}return Be(d,`${l}[${m}]`,f,n,i,o)&&g},!0);if(V(p))return Be(p,l,r==="predicate"&&a==="_not"?"predicate-value":r,n,i,o);return!0}function Qi(e,t,r,n,i,o,s){let a=(u)=>s==="props"?`props:${u}`:`actions:params-${u}`;if(Object.keys(t).filter((u)=>!ql.has(u)).length>0){n.push({code:"schema:unsupported",message:`${i}: schema contains unsupported constraints`,elementKey:o,path:r});return}if(t.type!==void 0&&!Bl.has(t.type)){n.push({code:"schema:unsupported",message:`${i}: schema type is not supported`,elementKey:o,path:r});return}if(!Fl(t)){n.push({code:"schema:unsupported",message:`${i}: schema enum is not supported`,elementKey:o,path:r});return}if(t.required!==void 0&&(!Array.isArray(t.required)||t.required.some((u)=>typeof u!=="string"))){n.push({code:"schema:unsupported",message:`${i}: schema required list is not supported`,elementKey:o,path:r});return}if(t.items!==void 0&&(t.type!=="array"||!V(t.items))){n.push({code:"schema:unsupported",message:`${i}: schema items must describe an array`,elementKey:o,path:r});return}if(t.properties!==void 0&&(t.type!=="object"||!V(t.properties))){n.push({code:"schema:unsupported",message:`${i}: schema properties must describe an object`,elementKey:o,path:r});return}if(t.required?.length&&t.type!=="object"){n.push({code:"schema:unsupported",message:`${i}: schema required list is only supported for objects`,elementKey:o,path:r});return}if(jt(e))return;let l=t.type;if(!(l===void 0||l==="null"&&e===null||l==="string"&&typeof e==="string"||l==="boolean"&&typeof e==="boolean"||l==="number"&&typeof e==="number"&&Number.isFinite(e)||l==="integer"&&typeof e==="number"&&Number.isInteger(e)||l==="array"&&Array.isArray(e)||l==="object"&&V(e))){n.push({code:a("type"),message:`${i}: value does not match the declared type`,elementKey:o,path:r});return}if(t.enum&&!t.enum.some((u)=>Object.is(u,e)))n.push({code:a("enum"),message:`${i}: value is outside the declared enum`,elementKey:o,path:r});if(l==="object"&&V(e)){if(t.additionalProperties===!1){for(let u of Object.keys(e))if(!Object.hasOwn(t.properties??{},u))n.push({code:s==="props"?"props:unknown":"actions:params-unknown",message:`${i}: object field is not declared`,elementKey:o,path:`${r}.${u}`})}for(let u of t.required??[])if(!Object.hasOwn(e,u))n.push({code:a("required"),message:`${i}: required object field is missing`,elementKey:o,path:`${r}.${u}`});for(let[u,g]of Object.entries(t.properties??{}))if(Object.hasOwn(e,u))Qi(e[u],g,`${r}.${u}`,n,i,o,s)}if(l==="array"&&Array.isArray(e)&&t.items)e.forEach((u,g)=>{Qi(u,t.items,`${r}[${g}]`,n,i,o,s)})}function jl(e,t,r,n,i,o,s){if(!r)return;for(let[a,c]of Object.entries(r)){let l=`${n}.${a}`;if(Xi(c,l,e,i,o)&&t&&Object.hasOwn(t,a))Qi(t[a],c,l,e,i,o,s)}}function Ul(e,t,r,n,i,o,s={}){for(let[a,c]of Object.entries(t??{})){let l=n==="action-value"&&!s.evaluatedParams?.has(a)?"action-literal":n;Be(c,`${r}.${a}`,l,e,i,o)}}function Xi(e,t,r,n,i){if(Object.keys(e).some((s)=>!ql.has(s))||e.type!==void 0&&!Bl.has(e.type)||!Fl(e)||e.required!==void 0&&(!Array.isArray(e.required)||e.required.some((s)=>typeof s!=="string"))||e.items!==void 0&&(e.type!=="array"||!V(e.items))||e.properties!==void 0&&(e.type!=="object"||!V(e.properties))||e.additionalProperties!==void 0&&(e.type!=="object"||typeof e.additionalProperties!=="boolean")||Boolean(e.required?.length)&&e.type!=="object")return r.push({code:"schema:unsupported",message:`${n}: schema contains unsupported constraints`,elementKey:i,path:t}),!1;for(let[s,a]of Object.entries(e.properties??{}))if(!Xi(a,`${t}.${s}`,r,n,i))return!1;if(e.items&&!Xi(e.items,`${t}[]`,r,n,i))return!1;return!0}function cn(e,t,r,n,i,o,s){if(!Array.isArray(n)){if(s)e.push({code:"actions:chain",message:`${t}: action chain must be an array`,elementKey:r,path:i});return}for(let[a,c]of n.entries()){if(!V(c)){if(s)e.push({code:"actions:chain",message:`${t}: action step must be an object`,elementKey:r,path:`${i}[${a}]`});continue}let l=c.action,p=`${i}[${a}]`;if(s&&(typeof l!=="string"||l.length===0))e.push({code:"actions:chain",message:`${t}: action step needs an action name`,elementKey:r,path:`${p}.action`});if(typeof l==="string"&&!_l.has(l)&&!Object.hasOwn(o.actions??{},l))e.push({code:"actions:registered",message:`${t}: action "${l}" is not in the catalog. Registered actions: ${[..._l,...Object.keys(o.actions??{})].join(", ")}. No equivalent is guaranteed: preserve the requirement and report unsupported behavior instead of disabling it.`,elementKey:r,path:`${p}.action`});if(s&&typeof l==="string"){let u=Object.hasOwn(o.actions??{},l)?o.actions[l]:Object.hasOwn(Ln,l)?Ln[l]:void 0,g=c.params;if(g!==void 0&&!V(g))e.push({code:"actions:chain",message:`${t}: action params must be an object`,elementKey:r,path:`${p}.params`});else{if(V(g))Ul(e,g,`${p}.params`,"action-value",t,r,{evaluatedParams:new Set(u?.generation?.evaluatedParams??[])});if(u)jl(e,V(g)?g:void 0,u.params,`${p}.params`,t,r,"actions:params")}}if(Object.hasOwn(c,"onSuccess"))cn(e,t,r,c.onSuccess,`${p}.onSuccess`,o,s);if(Object.hasOwn(c,"onError"))cn(e,t,r,c.onError,`${p}.onError`,o,s)}}function Hl(e,t,r=!1){let n=[],i=new Set([...Ml(e.state),...e.connectionIds??[]]),o=new Set(Ml(e.computed)),s=e.pageId??e.root;if(e.computed)for(let[a,c]of Object.entries(e.computed)){if(r)Be(c,`computed.${a}`,"computed",n,`${s}.computed`,s);an(n,`${s}.computed`,s,c,`computed.${a}`,i,o,lC(e,t))}if(e.urlState)for(let[a,c]of Object.entries(e.urlState)){if(!i.has(a))n.push({code:"refs:url-state-declared",message:`${s}: urlState "${a}" is not declared in state`,elementKey:s,path:`urlState.${a}`});if(!c||typeof c.param!=="string"||c.param.length===0)n.push({code:"refs:url-state-declared",message:`${s}: urlState "${a}" needs a param name`,elementKey:s,path:`urlState.${a}.param`})}for(let[a,c]of Object.entries(e.elements)){let l=Object.hasOwn(t.components,c.type)?t.components[c.type]:void 0;if(!l)continue;let p=`${s}/${a}`,u=Vl(l.props);if(r)Ul(n,c.props,"props","props",p,a);if(c.visible!==null&&typeof c.visible==="object"){let g=Object.keys(c.visible);if(Array.isArray(c.visible)||g.length!==1||!g[0]?.startsWith("_"))n.push({code:"visibility:expression",message:`${p}: visible must be a boolean or an operator expression, not a literal record`,elementKey:a,path:"visible"})}if(r&&c.visible!==void 0)if(typeof c.visible!=="boolean"&&!jt(c.visible))n.push({code:"visibility:expression",message:`${p}: visible must be a boolean or an operator expression`,elementKey:a,path:"visible"});else Be(c.visible,"visible","visible",n,p,a);if(an(n,p,a,c.props,"props",i,o,u),an(n,p,a,c.visible,"visible",i,o,u),an(n,p,a,c.events,"events",i,o,u),l.props){let g=new Set(Object.keys(l.props));for(let d of Object.keys(c.props??{}))if(!g.has(d))n.push({code:"props:declared",message:`${p}: prop "${d}" is not declared on ${c.type}`,elementKey:a,path:`props.${d}`});if(r)jl(n,c.props,l.props,"props",p,a,"props")}if(l.events){let g=new Set(Object.keys(l.events));for(let[d,m]of Object.entries(c.events??{})){if(!g.has(d))n.push({code:"events:declared",message:`${p}: event "${d}" is not declared on ${c.type}`,elementKey:a,path:`events.${d}`});cn(n,p,a,m,`events.${d}`,t,r)}}else for(let[g,d]of Object.entries(c.events??{}))cn(n,p,a,d,`events.${g}`,t,r)}return n.map((a)=>({...a,path:a.elementKey===s?`${s}/${a.path}`:`${s}/${a.elementKey}/${a.path}`}))}function Vl(e){let t=new Set;for(let r of Object.values(e??{})){let n=aC(r);if(!n)continue;for(let i of n)t.add(i)}return t.size>0?t:void 0}function lC(e,t){let r=new Set;for(let n of Object.values(e.elements)){let i=Object.hasOwn(t.components,n.type)?t.components[n.type]:void 0,o=Vl(i?.props);if(!o)continue;for(let s of o)r.add(s)}return r.size>0?r:void 0}function zl(e){return e.map((t)=>({code:t.code,message:t.message,elementKey:t.elementKey,path:t.path}))}var Gl=[{id:"_request",bucket:"server",description:"Executes a connection request server-side and injects the result"},{id:"_secret",bucket:"server",description:"Reads a server-side secret value; never transmitted to the client"}],ln=new Set(Gl.map((e)=>e.id));function un(e){if(!e||typeof e!=="object"||Array.isArray(e))return e;let t=e;if(typeof t.version==="number")return{...t,version:Number.isInteger(t.version)?t.version.toFixed(1):String(t.version)};return t}function Zi(e){return{...e,...e.props?{props:{...e.props}}:{},...e.children?{children:[...e.children]}:{},...e.slots?{slots:{...e.slots}}:{},...e.events?{events:{...e.events}}:{}}}function Kl(e){return{...e,...e.roots?{roots:[...e.roots]}:{},...e.state?{state:{...e.state}}:{},elements:Object.fromEntries(Object.entries(e.elements).map(([t,r])=>[t,Zi(r)]))}}function dC(e){return e.type==="compiler:operator"}function pC(e){return e.type==="compiler:validator"}class Ut{operators;validators;constructor(e={}){let t=(e.capabilities??[]).filter(dC).map((n)=>n.contribution),r=(e.capabilities??[]).filter(pC).map((n)=>n.contribution);this.operators=[...e.operators??[],...t],this.validators=[...e.validators??[],...r]}merge(e){if(e instanceof Ut)return new Ut({operators:[...this.operators,...e.operators],validators:[...this.validators,...e.validators]});return new Ut({operators:[...this.operators,...e.operators??[]],validators:[...this.validators,...e.validators??[]],...e.capabilities?{capabilities:e.capabilities}:{}})}}function gC(e={}){return new Ut(e)}function eo(e,t={}){let r=t.format??"auto";if(r==="json")return un(JSON.parse(e));if(r==="yaml")return un(Ae(e));let n=e.trim();if(n.startsWith("{")||n.startsWith("["))return un(JSON.parse(n));return un(Ae(e))}function fC(e,t,r){let n=e.pages.find((s)=>s.id===t),i=[...n?.rootBlockIds??[]],o=Object.fromEntries(Object.entries(e.blocks).filter(([,s])=>s.pageId===t).map(([s,a])=>{let{id:c,pageId:l,parentId:p,...u}=a;return[s,Zi(u)]}));if(r&&i.length===0){let s=e.blocks.__empty__?`__empty__:${t}`:"__empty__";i.push(s),o[s]={type:"Empty"}}return{version:e.version,root:i[0]??"__empty__",roots:i,pageId:t,...n?.state?{state:n.state}:{},...n?.computed?{computed:n.computed}:{},...n?.urlState?{urlState:n.urlState}:{},...e.connections?{connectionIds:e.connections.map((s)=>s.id)}:{},elements:o}}function mC(e,t){let r=[...t.roots??e.roots??[]];if(r.length>0&&t.root!==e.root)r[0]=t.root;else if(r.length===0&&t.elements[t.root])r.push(t.root);return r}async function yC(e,t,r,n){let i=Kl(e);for(let o of r.operators){let s={spec:i,catalog:t,warnings:n,getElement(c){return i.elements[c]},updateElement(c,l){i={...i,elements:{...i.elements,[c]:Zi(l)}}},addWarning(c){n.push(c)}},a=await o.apply(s);if(a)i=Kl(a)}return i}function Wl(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function hC(e,t,r,n,i){let o=Object.entries(e.elements);for(let a of e.roots?.length?e.roots:[e.root])if(!e.elements[a])r.push({code:"missing-root",message:`Root element "${a}" is missing from the elements map`,elementKey:a});for(let[a,c]of o){if(!(Wl(t.components,c.type)??Wl(t.templates,c.type)))n.push({missingType:c.type,elementKey:a,reason:c.template?"missing-template":"missing-component",context:`Element ${a} references ${c.type}`,path:`blocks.${a}.type`});for(let p of c.children??[])if(!e.elements[p])r.push({code:"dangling-child",message:`Element "${a}" references missing child "${p}"`,elementKey:a})}let s=Hl(e,t,i);if(i){for(let a of s)n.push({missingType:a.code,elementKey:a.elementKey,reason:"invalid-spec",context:a.message,code:a.code,path:a.path});return}r.push(...zl(s))}async function bC(e,t,r,n,i){for(let o of r.validators){let s={spec:e,catalog:t,warnings:n,gaps:i,addWarning(a){n.push(a)},addGap(a){i.push(a)}};await o.validate(s)}}function rt(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let r of e)rt(r,t);return}for(let[r,n]of Object.entries(e)){if(r.startsWith("_"))t.add(r);rt(n,t)}}function wC(e){let t=new Map;for(let[n,i]of Object.entries(e.blocks)){let o=new Set;rt(i.props,o),rt(i.visible,o);for(let s of o){let a=t.get(s)??new Set;a.add(n),t.set(s,a)}}for(let n of e.pages){let i=new Set;rt(n.computed,i),rt(n.lifecycle,i);for(let o of i){let s=t.get(o)??new Set;s.add(n.id),t.set(o,s)}}let r=[];for(let[n,i]of t){let o=sn.has(n)?"client":ln.has(n)?"server":n==="_ref"?"build":"shared";r.push({operatorId:n,bucket:o,blockIds:[...i]})}return r}async function Yl(e,t,r={}){let n=[],i=[],o=r.registry??gC(),s=Yi(e,r.templates),a=Object.create(null),c=[];for(let[u,g]of s.pages.entries()){let d=fC(s,g.id,u===0),m=await yC(d,t,o,n);hC(m,t,n,i,r.strict===!0),await bC(m,t,o,n,i);for(let[f,y]of Object.entries(m.elements)){let w=a[f];if(w)throw new j("duplicate-block-id",`Compiler output block id "${f}" conflicts across pages`,{blockId:f,firstPageId:w.pageId,pageId:g.id});let b=s.blocks[f];a[f]={...y,id:f,pageId:g.id,...b?.pageId===g.id&&b.parentId?{parentId:b.parentId}:{}}}c.push({...g,rootBlockIds:mC(d,m)})}let l={version:"2.0",pages:c,...s.design?{design:s.design}:{},...s.connections?{connections:s.connections.map((u)=>({...u}))}:{},blocks:a};if(r.strict===!0&&e.version!=="2.0")i.push({missingType:"spec:version",elementKey:"spec",reason:"invalid-spec",context:"Native Spec version must be 2.0",code:"spec:version",path:"version"});let p=wC(l);return{spec:l,gaps:i,warnings:n,...p.length>0?{operatorUsage:p}:{}}}import{readFileSync as EC}from"node:fs";var Jl=["auto","user","override"];function dn(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function vC(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function nt(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{meta:"",body:e.trim()};return{meta:(t[1]??"").trim(),body:(t[2]??"").trim()}}function pn(e){let{meta:t}=nt(e);if(!t)throw Error("design-md file is missing YAML frontmatter");let r=Ae(t);if(!r||typeof r!=="object")throw Error("design-md frontmatter must be a YAML object");let n=typeof r.title==="string"?r.title.trim():"",i=typeof r.name==="string"?r.name.trim():"",o=n||i;if(!o)throw Error("design-md frontmatter must include a non-empty 'title' or 'name' field");let s=dn(r.id)??dn(r.slug)??vC(o);if(!s)throw Error("design-md frontmatter must include a non-empty 'id' field");let a={id:s,title:o,category:dn(r.category)??"general",tags:Array.isArray(r.tags)?r.tags:[],origin:typeof r.origin==="string"?r.origin:"local"};if(i)a.name=i;if(typeof r.version==="string"&&r.version.trim())a.version=r.version.trim();let c=dn(r.description);if(c)a.description=c;if(typeof r.sourceUrl==="string")a.sourceUrl=r.sourceUrl;if(Array.isArray(r.exemptRules)){let l=r.exemptRules.filter((p)=>typeof p==="string"&&p.trim().length>0);if(l.length>0)a.exemptRules=l.map((p)=>p.trim())}if(Array.isArray(r.extractedTokens))a.extractedTokens=r.extractedTokens;if(typeof r.layer==="string")if(Jl.includes(r.layer))a.layer=r.layer;else console.warn(`[design-md] ignoring invalid layer "${r.layer}" on id="${a.id}"; expected one of ${Jl.join("|")}`);return a}var SC=["colors","typography","rounded","spacing","components"],kC=["themes","forbidden"],Xl=new Set([...SC,...kC]),CC=new Set(["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","fontFeature","fontVariation"]);function Ee(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function gn(e){return Object.fromEntries(Object.entries(Ee(e)).flatMap(([t,r])=>typeof r==="string"||typeof r==="number"?[[t,String(r)]]:[]))}function Ql(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function RC(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function xC(e){let{meta:t,body:r}=nt(e),n=[],i=[];for(let[o,s]of[t,...RC(r)].entries()){if(!s.trim())continue;let a;try{a=Ee(Ae(s))}catch(c){if(o===0)n.push({severity:"error",message:`frontmatter is not valid YAML: ${c.message}`});continue}if(o===0||Object.keys(a).some((c)=>Xl.has(c)))i.push(a)}return{sources:i,issues:n}}function IC(e){let t={};for(let[r,n]of Object.entries(Ee(e)))if(typeof n==="string")t[r]={fontFamily:n};else{let i={};for(let[o,s]of Object.entries(Ee(n)))if(CC.has(o)&&(typeof s==="string"||typeof s==="number"))i[o]=s;t[r]=i}return t}function to(e){let{sources:t}=xC(e),r=Object.assign({},...t);if(!Object.keys(r).some((c)=>Xl.has(c)))return;let n={colors:gn(r.colors),typography:IC(r.typography),rounded:gn(r.rounded),spacing:Object.fromEntries(Object.entries(Ee(r.spacing)).flatMap(([c,l])=>typeof l==="string"||typeof l==="number"?[[c,l]]:[])),components:Object.fromEntries(Object.entries(Ee(r.components)).map(([c,l])=>[c,gn(l)]))},i=Object.fromEntries(Object.entries(Ee(r.themes)).map(([c,l])=>[c,gn(l)]));if(Object.keys(i).length)n.themes=i;let o=Ee(r.forbidden),s=Ql(o.colors),a=Ql(o.fonts);if(s.length||a.length)n.forbidden={colors:s,fonts:a};return n}var AC=[{pattern:/`?(--[\w-]+)`?\s*:\s*([#\w()%., ]+)/g,group:"css-var"},{pattern:/`?([\w-]+(?:Color|Bg|Text|Border|Shadow|Radius|Font|Size|Space))`?\s*[=:]\s*["']?([^"'\n,]+)["']?/gi,group:"token"}];function ro(e){let t=new Set,r=[];for(let{pattern:n,group:i}of AC){let o=new RegExp(n.source,n.flags),s;while((s=o.exec(e))!==null){let a=(s[1]??"").trim(),c=(s[2]??"").trim(),l=`${a}:${c}`;if(!t.has(l))t.add(l),r.push({name:a,value:c,group:i})}}return r}function Ht(e){let t=EC(e,"utf-8"),{body:r}=nt(t),n=pn(t),i=to(t),o=n.extractedTokens??(i&&Object.keys(i.colors).length?Object.entries(i.colors).map(([a,c])=>({name:a,value:c,group:"color"})):ro(r)),s={id:n.id,title:n.title,category:n.category,tags:n.tags??[],origin:n.origin??"local",body:r,filePath:e};if(n.sourceUrl)s.sourceUrl=n.sourceUrl;if(n.description)s.description=n.description;if(i)s.tokens=i;if(n.exemptRules)s.exemptRules=n.exemptRules;if(n.layer)s.layer=n.layer;if(o.length>0)s.extractedTokens=o;return s}import{fileURLToPath as PC}from"node:url";import{existsSync as TC,readdirSync as OC}from"node:fs";import{join as DC}from"node:path";var Zl=PC(new URL("../content",import.meta.url));function fn(e=Zl){if(!TC(e))return[];let t=[];for(let r of OC(e).sort()){if(r.startsWith("_")||!r.endsWith(".design.md"))continue;try{t.push(Ht(DC(e,r)))}catch(n){console.warn(`[design-md] skipping seed ${r}: ${n.message}`)}}return t}function MC(e){return e==="quality"?"blocking":"advisory"}var $C=["streamline your","empower your","supercharge your","unlock the power","best-in-class","enterprise-grade","next-generation","cutting-edge","revolutionize","game-changer","game changer","future-proof","seamless experience","drive growth","harness the power","take it to the next level","world-class","state-of-the-art","robust solution","powerful platform","effortlessly","seamlessly integrate","elevate your","transform your"],BC=["Inter","Roboto","Geist","Fraunces","Plus Jakarta","Space Grotesk"];function ge(e,t){let r=e.match(t);return r?r.length:0}var qC=[{id:"marketing-buzzword",category:"slop",severity:"P2",message:"Marketing buzzwords read as AI filler — prefer concrete, specific copy.",detect:(e)=>{let t=e.toLowerCase();return $C.reduce((r,n)=>r+(t.includes(n)?1:0),0)}},{id:"em-dash-overuse",category:"slop",severity:"P3",message:"Em-dash overuse (≥5) is a strong AI-writing tell.",detect:(e)=>{let t=ge(e,/[—]|--(?=\S)/g);return t>=5?t-4:0}},{id:"aphoristic-cadence",category:"slop",severity:"P2",message:'Manufactured-contrast cadence ("Not an X. Just Y.") is a recognizable AI pattern.',detect:(e)=>{let t=ge(e,/\bNot\s+(?:an?|just)\b[^.?!]*[.?!]/gi),r=ge(e,/\b[A-Z][^.?!]*\.\s+(?:No|Just)\s+[a-z]/g),n=t+r;return n>=3?n:0}},{id:"numbered-section-markers",category:"slop",severity:"P3",message:"Numbered section scaffolding (01 / 02 / 03) is an overused AI layout tell.",detect:(e)=>{let t=e.match(/\b(0[1-9]|1[0-2])\b/g)??[],r=new Set(t);if(r.size<3)return 0;let n=[...r].map(Number).sort((o,s)=>o-s);return n.some((o,s)=>s>0&&o-n[s-1]===1)?r.size:0}}],FC=[{id:"gradient-text",category:"slop",severity:"P2",message:"Gradient text (bg-clip-text + transparent) is a classic AI hero tell.",detect:(e)=>ge(e,/bg-clip-text[^"']*text-transparent|text-transparent[^"']*bg-clip-text|-webkit-background-clip\s*:\s*text/gi)},{id:"ai-color-palette",category:"slop",severity:"P2",message:"Purple/violet gradient palette is the most recognizable AI color tell.",detect:(e)=>ge(e,/(from|via|to)-(purple|violet|fuchsia|indigo)-\d{3}|linear-gradient\([^)]*(?:#(?:8b5cf6|a855f7|7c3aed|6366f1))/gi)},{id:"side-tab",category:"slop",severity:"P2",message:"Thick colored side-border on a card (border-l-4 + accent) is the single most recognizable AI card tell.",detect:(e)=>ge(e,/border-l-(4|8)\s+border-(purple|violet|indigo|blue|primary)/gi)},{id:"overused-font",category:"slop",severity:"P3",message:"Over-represented font (Inter/Geist/…) without a brand reason reads as default AI styling.",detect:(e)=>BC.reduce((t,r)=>t+(new RegExp(`font-family[^;"']*${r}`,"i").test(e)?1:0),0)},{id:"emoji-icon",category:"slop",severity:"P2",message:"Emoji used as a heading/list/button icon is a stock AI tell — use a real icon or nothing.",detect:(e)=>ge(e,/<(?:h[1-6]|li|button|summary|th)\b[^>]*>\s*(?:<[^>]+>\s*)*\p{Extended_Pictographic}/giu)},{id:"github-dark-glow",category:"slop",severity:"P3",message:"Flat #0D1117 background with a neon cyan/violet glow is the default AI dark-mode look.",detect:(e)=>/#0d1117/i.test(e)&&/(?:box-shadow|drop-shadow|text-shadow)[^;"']*(?:#06b6d4|#22d3ee|#00f0ff|#a78bfa|#8b5cf6|cyan|violet)/i.test(e)?1:0},{id:"tiny-text",category:"quality",severity:"P1",message:"Body text below ~14px (text-[10px]/[11px]/[12px]) harms readability and accessibility.",detect:(e)=>ge(e,/text-\[(?:8|9|10|11|12)px\]|font-size\s*:\s*(?:8|9|10|11|12)px/gi)},{id:"gray-on-color",category:"quality",severity:"P1",message:"Gray text on a colored fill commonly fails WCAG contrast.",detect:(e)=>ge(e,/bg-(?:primary|blue|indigo|violet|purple)-\d{3}[^"']*text-(?:gray|slate|zinc|neutral)-\d{3}/gi)}],eu={P0:0.3,P1:0.15,P2:0.08,P3:0.04};function jC(e){if(e>=0.9)return"A";if(e>=0.8)return"B";if(e>=0.65)return"C";if(e>=0.5)return"D";return"F"}var tu="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",Y0=new RegExp(`["']?\\b(?:${tu})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),J0=new RegExp(`^\\s*-?\\s*(?:${tu})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function ru(e){let t=e.text??e.html??"",r=e.html??e.text??"",n=new Set(e.exempt??[]),i=[],o=(a,c)=>{for(let l of a){let p=MC(l.category);if(p==="advisory"&&n.has(l.id))continue;let u=l.detect(c);if(u>0)i.push({ruleId:l.id,category:l.category,severity:l.severity,level:p,message:l.message,count:u})}};o(qC,t),o(FC,r);let s=1;for(let a of i){let c=Math.min(eu[a.severity]*(1+(a.count-1)/3),eu[a.severity]*2);s-=c}return s=Math.max(0,Math.min(1,s)),{score:s,grade:jC(s),findings:i,blocked:i.some((a)=>a.level==="blocking")}}import{readdirSync as UC,readFileSync as HC,statSync as VC}from"node:fs";import{basename as zC,join as GC}from"node:path";var KC="0.1.0";function nu(e){let{dir:t}=e,r;try{r=UC(t)}catch{return[]}let n=e.defaultVersion??KC,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=GC(t,a);try{if(!VC(c).isFile())continue}catch{continue}let l=HC(c,"utf8");if(!l.trim())continue;let p=zC(a).replace(/\.ya?ml$/i,""),u=WC(p),g=YC(p),d=JC(l)??`${g} template`;s.push({name:u,version:n,title:g,description:d,yaml:l,absolutePath:c,templateContract:{name:u,description:d,level:i,category:o,keywords:[u,p.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:QC(l)}})}return s.sort((a,c)=>a.name.localeCompare(c.name))}function no(e){let t=new Map;for(let r of e)for(let n of nu(r)){let i=t.get(n.name);if(i)throw Error(`duplicate template source name "${n.name}": ${i.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function WC(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function YC(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function JC(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function QC(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var uO=new Set(ur),dO=new Set(lr);var ZC=/^(unknown|unlicensed|none|n\/?a)$/i;function io(e){let t=e?.trim();if(!t||ZC.test(t))return;return t}var eR="uibot.resource.index.v1";class ot extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function K(e,t){return e<t?-1:e>t?1:0}function B(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function tR(e){let t=B(e).replace(/ /g,"-");if(!t)throw new ot("invalid-resource-source-id",e);return t}function fe(e,t){return`${e}:${tR(t)}`}function mn(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=B(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>K(r,n)).map(([,r])=>r)}function Vt(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function rR(e){let t=io(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.sourceHash?{sourceHash:e.sourceHash}:{},...e.packageName?{packageName:e.packageName}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function it(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:mn(e.tags),aliases:mn(e.aliases),capabilities:mn(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(K),source:rR(e.source),receipt:e.receipt,...e.solution?{solution:structuredClone(e.solution)}:{}}}function nR(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function iR(e){if(e.solution){let t=(r)=>{if(r&&typeof r==="object"){for(let n of Object.values(r))t(n);Object.freeze(r)}};t(e.solution)}return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function oR(e){let t=new Map;for(let r of Object.keys(e).sort(K)){let n=e[r];if(!n)continue;let i=fe("component",r);for(let o of mn([r,n.name])){let s=B(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(K))}}return t}function sR(e,t,r){let n=r.get(B(e))??[];if(n.length===0)throw new ot("dangling-resource-dependency",`${t} -> ${fe("component",e)}`);if(n.length>1)throw new ot("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function aR(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return fe("template",i);return sR(e,t,r)}function zt(e,t,r){return io(r?.[e]??t)}function iu(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>K(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[fe("template",t)]}))}function ou(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=oR(t),c=[];for(let d of Object.keys(t).sort(K)){let m=t[d];if(!m)continue;let f=fe("component",d),y=zt(f,void 0,s);c.push(it({id:f,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[d,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:d,...y?{license:y}:{}},receipt:Vt(Boolean(y))}))}for(let d of Object.keys(r).sort(K)){let m=r[d];if(!m)continue;let f=fe("template",d),y=zt(f,void 0,s);c.push(it({id:f,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[d,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((w)=>aR(w,f,a,r)),source:{type:"template-contract",id:d,...y?{license:y}:{}},receipt:Vt(Boolean(y))}))}for(let d of[...n].sort((m,f)=>K(m.id,f.id))){let m=fe("design-guide",d.id),f=zt(m,void 0,s);c.push(it({id:m,kind:"design-guide",title:d.title,description:nR(d),category:d.category,tags:d.tags,aliases:[d.id,d.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:d.id,...d.sourceUrl?{url:d.sourceUrl}:{},...f?{license:f}:{}},receipt:Vt(Boolean(f))}))}for(let d of[...i].sort((m,f)=>K(m.id,f.id))){let m=fe("example",d.id),f=zt(m,d.license,s);c.push(it({id:m,kind:"example",title:d.title,description:d.description,...d.category?{category:d.category}:{},tags:d.tags??[],aliases:[d.id,d.title,...d.aliases??[]],capabilities:d.capabilities??[],dependencies:d.dependencies??[],source:{type:"example",id:d.id,...d.version?{version:d.version}:{},...d.sourceUrl?{url:d.sourceUrl}:{},...f?{license:f}:{}},receipt:Vt(Boolean(f))}))}for(let d of[...o].sort((m,f)=>K(m.id,f.id))){let m=fe("skill",d.id),f=zt(m,void 0,s);c.push(it({id:m,kind:"skill",title:d.title,description:d.description?.trim()||d.title,tags:[...d.tags??[],...d.triggers??[]],aliases:[d.id,d.title,...d.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:d.id,...d.version?{version:d.version}:{},...f?{license:f}:{}},receipt:Vt(Boolean(f))}))}for(let d of e.additional??[])c.push(it(d));c.sort((d,m)=>K(d.id,m.id));let l=new Set;for(let d of c){if(l.has(d.id))throw new ot("duplicate-resource-id",d.id);l.add(d.id)}for(let d of c)for(let m of d.dependencies)if(!l.has(m))throw new ot("dangling-resource-dependency",`${d.id} -> ${m}`);let p=new Map;for(let d of c)for(let m of d.aliases){let f=B(m);if(!f)continue;let y=p.get(f)??new Set;y.add(d.id),p.set(f,y)}let u=Object.freeze(Object.fromEntries([...p.entries()].sort(([d],[m])=>K(d,m)).map(([d,m])=>[d,Object.freeze([...m].sort(K))]))),g=Object.freeze(c.map(iR));return Object.freeze({schemaVersion:eR,resources:g,aliases:u})}var cR=[["chat","assistant","聊天","助手","对话"],["document","documents","文档","写作"],["auth","authentication","认证","登录"],["data table","data grid","datatable","table","表格","数据表","数据表格"],["button","action button","按钮","操作按钮"],["dashboard","admin dashboard","仪表盘","后台","管理后台"],["kanban","kanban board","看板","任务看板"],["form","input form","表单","输入表单"],["navigation","nav","sidebar","导航","侧边栏"]],lR=Object.freeze(cR.map((e)=>Object.freeze([...e]))),su=new Map;for(let e of lR){let t=Object.freeze([...new Set(e.map(B).filter(Boolean))].sort());for(let r of t)su.set(r,t)}function oo(e){let t=B(e);return su.get(t)??Object.freeze([t])}class ie extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var co=Object.freeze({function:180,scenario:180,unit:180,industry:180,"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),uR=Object.freeze(Object.keys(co)),au=new Map(uR.map((e,t)=>[e,t])),cu=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function W(e,t){return e<t?-1:e>t?1:0}function lu(e){return new Set((e??[]).map(B).filter(Boolean))}function qe(e,t){let r=lu(t);if(r.size===0)return!0;let n=lu(e);return[...r].some((i)=>n.has(i))}function dR(e,t){if(!qe(e.solution?.functions??[],t.functions))return!1;if(!qe(e.solution?.scenarios??[],t.scenarios))return!1;if(!qe(e.solution?[e.solution.unit]:[],t.units))return!1;if(!qe(e.solution?.industries??[],t.industries))return!1;if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!qe(e.tags,t.tags))return!1;if(!qe(e.category?[e.category]:[],t.categories))return!1;if(!qe(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function pR(e){return Boolean(e.functions?.length||e.scenarios?.length||e.units?.length||e.industries?.length||e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function le(e,t,r,n=co[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function so(e,t){return e.find((r)=>B(r)===t)}function ao(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities,...e.solution?.functions??[],...e.solution?.scenarios??[],...e.solution?.industries??[]]}function gR(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],s=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(o[a-1]??r+1)+1,c);o.push(l),s=Math.min(s,l)}if(s>r)return r+1;n=o}return n[t.length]??r+1}function uu(e,t){let r=B(t),n=[];if(B(e.id)===r)le(n,"exact-id",e.id);if(B(e.title)===r)le(n,"exact-title",e.title);let i=so(e.aliases,r);if(i)le(n,"alias",i);let o=so(e.tags,r);if(o)le(n,"tag",o);let s=so(e.capabilities,r);if(s)le(n,"capability",s);if(e.category&&B(e.category)===r)le(n,"category",e.category);if(!i){let l=oo(r).filter((u)=>u!==r),p=new Set(ao(e).map(B));if(l.some((u)=>p.has(u)))le(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=B(ao(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))le(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let p of ao(e)){let u=B(p);if(u.length<4)continue;let g=gR(r,u,2);if(g<=2&&(!l||g<l.distance||g===l.distance&&W(p,l.value)<0))l={value:p,distance:g}}if(l)le(n,"fuzzy",l.value,co.fuzzy-l.distance)}return n.sort((l,p)=>{if(l.score!==p.score)return p.score-l.score;return(au.get(l.code)??99)-(au.get(p.code)??99)||W(l.value,p.value)})}function du(e,t,r){if(t.has(r))return[r];let n=B(r),i=e.aliases[n];if(i?.length)return[...i];let o=new Set;for(let s of oo(n))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(W)}function pu(e,t){return new ie("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function yn(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),o=du(e,t,i);if(o.length===0)throw new ie("resource-not-found",i);if(o.length>1)throw pu(i,o);let s=o[0],a=s?t.get(s):void 0;if(!a)throw new ie("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!pR(n))throw new ie("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new ie("resource-query-invalid-limit",String(n.limit));let o=e.resources.filter((s)=>dR(s,n)).filter((s)=>!i||uu(s,i).length>0).map((s)=>{let a=i?uu(s,i):[];for(let[c,l]of[[n.functions,"function"],[n.scenarios,"scenario"],[n.units,"unit"],[n.industries,"industry"]])if(c?.length)le(a,l,c.join(","));return{resource:s,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||W(s.resource.id,a.resource.id));return n.limit===void 0?o:o.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((g)=>!g.trim()))throw new ie("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let g of n){let d=g.trim(),m=du(e,t,d);if(m.length===0)i.push({id:d,reason:"missing-resource"});else if(m.length>1)throw pu(d,m);else{let f=m[0];if(f)o.add(f)}}let s=new Set,a=new Set,c=new Set,l=[],p=[],u=(g,d)=>{if(s.has(g))return;if(a.has(g)){i.push({id:g,...d?{requiredBy:d}:{},reason:"dependency-cycle"});return}let m=t.get(g);if(!m){i.push({id:g,...d?{requiredBy:d}:{},reason:"missing-resource"});return}a.add(g),c.add(g);let f=[...m.dependencies].sort((y,w)=>{let b=t.get(y),k=t.get(w);return(cu.get(b?.kind??"")??99)-(cu.get(k?.kind??"")??99)||W(y,w)});for(let y of f)p.push({from:g,to:y,relation:"depends-on"}),u(y,g);a.delete(g),s.add(g),l.push(g)};for(let g of[...o].sort(W))u(g);return{roots:[...o].sort(W),nodes:[...c].sort(W).map((g)=>{let d=t.get(g);if(!d)throw new ie("resource-not-found",g);return{id:g,kind:d.kind,maturity:d.receipt.maturity}}),edges:p.sort((g,d)=>W(g.from,d.from)||W(g.to,d.to)),order:l,gaps:i.sort((g,d)=>W(g.id,d.id)||W(g.requiredBy??"",d.requiredBy??"")||W(g.reason,d.reason))}}})}function lo(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");bR(e);let t=e;if(t.schemaVersion!=="uibot.public-resources.v1"||typeof t.release?.version!=="string"||!/^[a-f0-9]{64}$/.test(t.release?.sourceHash)||t.index?.schemaVersion!=="uibot.resource.index.v1"||!Array.isArray(t.index.resources)||!t.index.aliases||!t.showcases)throw Error("invalid-public-resource-bundle");if(t.documents&&(!Array.isArray(t.documents)||t.documents.some((i)=>typeof i.title!=="string"||typeof i.markdown!=="string"||!/^\/(?:en\/)?docs\/[a-z0-9-]+$/.test(i.path))))throw Error("invalid-public-documentation");let r=new Set,n=new Set;for(let i of t.index.resources){if(!i||typeof i.id!=="string"||r.has(i.id)||!gt.includes(i.kind)||!i.id.startsWith(`${i.kind}:`)||typeof i.description!=="string"||typeof i.title!=="string"||!Array.isArray(i.dependencies)||!i.source||!i.receipt||!Array.isArray(i.aliases)||!Array.isArray(i.tags)||!Array.isArray(i.capabilities)||![i.aliases,i.dependencies,i.tags,i.capabilities].every((s)=>s.every((a)=>typeof a==="string"&&a.length<=1000))||!["catalog","template-contract","design-md","example","skill","registry","package","theme"].includes(i.source.type)||typeof i.source.id!=="string"||i.source.sourceHash!==void 0&&!/^[a-f0-9]{64}$/.test(i.source.sourceHash)||i.source.packageName!==void 0&&(typeof i.source.packageName!=="string"||!i.source.packageName.startsWith("@uibot/"))||!Ve.includes(i.receipt.maturity)||!ga.includes(i.receipt.level)||!Array.isArray(i.receipt.evidence)||!i.receipt.evidence.every((s)=>typeof s==="string")||!ur.every((s)=>lr.includes(i.receipt.checks?.[s])))throw Error("invalid-public-resource");if(r.add(i.id),i.solution){let s=i.solution;if(![s.functions,s.scenarios,s.industries,s.hostRequirements,s.limitations].every((a)=>Array.isArray(a)&&a.every((c)=>typeof c==="string"&&c.length>0&&c.length<=2000))||!["page","flow","industry"].includes(s.unit)||!["interactive-demo","needs-enhancement"].includes(s.readiness)||s.members!==void 0&&(!Array.isArray(s.members)||s.members.some((a)=>typeof a.resourceId!=="string"||typeof a.version!=="string"||!a.version||a.sourceHash!==void 0&&(typeof a.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(a.sourceHash)))))throw Error("invalid-resource-solution")}let o=t.showcases[i.id];if(!o||o.resourceId!==i.id||typeof o.docs?.zh!=="string"||typeof o.docs?.en!=="string"||!Array.isArray(o.examples)||!Array.isArray(o.distributions))throw Error("invalid-resource-showcase");if(o.collection!==void 0){let s=o.collection;if(!s||typeof s.id!=="string"||!/^[a-z0-9-]+$/.test(s.id)||typeof s.group?.id!=="string"||!/^[a-z0-9-]+$/.test(s.group.id)||[s.title,s.group.title].some((a)=>!a||[a.zh,a.en].some((c)=>typeof c!=="string"||!c.trim()||c.length>200)))throw Error("invalid-resource-collection")}if(o.agentKit!==void 0){let s=o.agentKit;if(n.has(i.source?.id))throw Error("invalid-resource-agent-kit");if(n.add(i.source?.id),!s||!["skill","prompt","recipe"].includes(s.type)||(s.type==="skill"?i.kind!=="skill":i.kind!=="example")||!/^[a-z][a-z0-9-]*$/.test(i.source.id)||s.fileName!=={skill:"SKILL.md",prompt:"PROMPT.md",recipe:"RECIPE.md"}[s.type]||[s.summary?.zh,s.summary?.en].some((a)=>typeof a!=="string"||!a.trim())||!Array.isArray(s.resources)||new Set(s.resources.map((a)=>a?.id)).size!==s.resources.length||s.resources.some((a)=>!a||!i.dependencies.includes(a.id)||!t.index.resources.some((c)=>c.id===a.id&&(c.source.version??null)===a.version)||a.version!==null&&(typeof a.version!=="string"||!a.version)||typeof a.contentHash!=="string"||!/^[a-f0-9]{64}$/.test(a.contentHash)||a.sourceHash!==void 0&&(typeof a.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(a.sourceHash)))||s.resources.length!==i.dependencies.length)throw Error("invalid-resource-agent-kit")}if(o.solutionControls!==void 0){let s=new Set;if(!Array.isArray(o.solutionControls)||o.solutionControls.some((a)=>{if(!a||typeof a.id!=="string"||s.has(a.id)||typeof a.label?.zh!=="string"||typeof a.label?.en!=="string"||!Array.isArray(a.values)||!a.values.length||a.values.some((c)=>!["string","boolean","number"].includes(typeof c)||typeof c==="number"&&!Number.isFinite(c))||typeof a.target?.pageId!=="string"||typeof a.target?.property!=="string"||["__proto__","prototype","constructor"].includes(a.target.property)||a.target.blockId!==void 0&&typeof a.target.blockId!=="string")return!0;return s.add(a.id),!1}))throw Error("invalid-solution-controls")}if(o.templateContract&&(o.templateContract.name!==i.source.id||typeof o.templateContract.description!=="string"||!["L3","L4","L5"].includes(o.templateContract.level)||!["feature","template","page","app"].includes(o.templateContract.category)||!Array.isArray(o.templateContract.keywords)))throw Error("invalid-public-template-contract");if(typeof o.title?.zh!=="string"||typeof o.title?.en!=="string"||o.examples.some((s)=>!s||typeof s.id!=="string"||typeof s.title!=="string"||typeof s.code!=="string"||!["spec","tsx","source"].includes(s.mode)||!["tsx","json","yaml","css","ts"].includes(s.language)||!Array.isArray(s.dependencies)||!s.dependencies.every((a)=>typeof a==="string"))||o.distributions.some((s)=>!s||!["spec","npm","shadcn"].includes(s.channel)||typeof s.name!=="string"||!/^[@a-zA-Z0-9._/-]+$/.test(s.name)||typeof s.version!=="string"||!["source","published"].includes(s.availability)||s.connections!==void 0&&(s.channel!=="spec"||!Array.isArray(s.connections)||s.connections.some((a)=>typeof a!=="string"||!a))))throw Error("invalid-resource-content")}for(let[i,o]of Object.entries(t.index.aliases))if(!i||!Array.isArray(o)||o.some((s)=>!r.has(s)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((i)=>!r.has(i)))throw Error("unexpected-public-resource-showcase");for(let i of t.index.resources)for(let o of i.dependencies)if(!r.has(o))throw Error("invalid-public-resource-dependency");if(t.distributionSnapshot){let i=t.distributionSnapshot;if(!/^[a-f0-9]{64}$/.test(i.snapshotId)||i.manifestPath!==`../snapshots/${i.snapshotId}/snapshot.json`||!i.resources||!i.unavailable||!i.external||Object.entries(i.external).some(([o,s])=>!Object.hasOwn(i.unavailable,o)||!Array.isArray(s)||s.some((a)=>typeof a!=="string"||a.startsWith("@uibot/"))))throw Error("invalid-distribution-snapshot-reference");for(let[o,s]of Object.entries(i.resources))if(!r.has(o)||s.version!==(t.index.resources.find((a)=>a.id===o)?.source.version??t.release.version)||!/^[a-f0-9]{64}$/.test(s.resourceHash)||!Array.isArray(s.entrypoints)||!s.entrypoints.length||!Array.isArray(s.closure)||![...s.entrypoints,...s.closure].every((a)=>/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(a))||s.entrypoints.some((a)=>!s.closure.includes(a)))throw Error("invalid-distribution-snapshot-resource")}}function gu(e){lo(e),e=JSON.parse(JSON.stringify(e));let t=(i)=>{if(i&&typeof i==="object"){for(let o of Object.values(i))t(o);Object.freeze(i)}};t(e);let r=yn(e.index),n=(i)=>{let o=r.get(i),s=e.showcases[o.id];if(!s)throw new ie("resource-not-found",o.id);return s};return Object.freeze({...r,get(i){let o=r.get(i),s=n(i).agentKit;return s?Object.freeze({...o,agentKit:s}):o},docs(i,o="zh",s=1){if(o!=="zh"&&o!=="en")throw Error("unsupported-resource-locale");let a=n(i);return{resourceId:a.resourceId,locale:o,...yR(a.docs[o],s),release:e.release}},examples(i,o=1){let s=n(i);return{resourceId:s.resourceId,...hR(s.examples,o),release:e.release}},installPlan(i){let o=n(i);return{resourceId:o.resourceId,distributions:o.distributions,dependencies:r.build([o.resourceId]),release:e.release,snapshot:e.distributionSnapshot&&Object.hasOwn(e.distributionSnapshot.resources,o.resourceId)?{snapshotId:e.distributionSnapshot.snapshotId,manifestPath:e.distributionSnapshot.manifestPath,...e.distributionSnapshot.resources[o.resourceId]}:null,snapshotUnavailable:e.distributionSnapshot?.unavailable[o.resourceId]??null,install:o.distributions.map((s)=>mR(s,e.distributionSnapshot,o.resourceId))}}})}var fR={"NowAPI.Collection":{real:"@uibot/connection-nowapi",demo:"createAdminPreviewDriver from @uibot/blocks-shadcn/solutions"},"Mock.Collection":{real:null,demo:"@uibot/connection-mock/browser"},Http:{real:"@uibot/connection-http",demo:null},"Pg.Collection":{real:"@uibot/connection-pg (server only)",demo:null}};function mR(e,t,r){let{channel:n,name:i,version:o}=e;if(n==="npm")return{channel:n,name:i,command:`add ${i}@${o}`,note:null};if(n==="spec"){let c=Object.entries(e.dependencies??{}).map(([l,p])=>`${l}@${p}`);return{channel:n,name:i,command:c.length?`add ${c.join(" ")}`:null,drivers:(e.connections??[]).map((l)=>({type:l,...fR[l]??{real:null,demo:null}})),note:"Read the Spec through examples (join paginated code), compile it strictly at build time with the Catalog from @uibot/blocks-shadcn/catalog (plus the other packages listed), then render with createLiveRuntimeAdapter from @uibot/runtime and UIBotLiveRenderer from @uibot/renderer-react, one adapter per page. Register a driver for each connection type."}}let s=!!t&&Object.hasOwn(t.resources,r),a=t?.external[r]??[];return{channel:n,name:i,command:`shadcn add @uibot/${i}`,registries:{"@uibot":"/r/{name}.json"},externalRegistryDependencies:a,note:s?"A hash-pinned snapshot exists: export and verify it, then map @uibot to the local snapshot server.":a.length?`No hash-pinned snapshot: the install also pulls stock shadcn items (${a.join(", ")}) from the host's default registry. Installing through the portal mapping still works; report the files as not snapshot-verified.`:"No hash-pinned snapshot; report the files as not snapshot-verified."}}var Pe=24000;function fu(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new ie("resource-query-invalid-limit","page is outside the available range")}function yR(e,t){let r=Math.max(1,Math.ceil(e.length/Pe));return fu(t,r),{markdown:e.slice((t-1)*Pe,t*Pe),page:t,totalPages:r,...t<r?{nextPage:t+1}:{}}}function hR(e,t){let r=e.flatMap((n)=>Array.from({length:Math.max(1,Math.ceil(n.code.length/Pe))},(i,o)=>({...n,code:n.code.slice(o*Pe,(o+1)*Pe),codeOffset:o*Pe,codeLength:n.code.length,complete:n.code.length<=Pe})));return fu(t,r.length),{examples:r.slice(t-1,t),page:t,totalPages:r.length,...t<r.length?{nextPage:t+1}:{}}}function bR(e){let t=0,r=0,n=new Set,i=(o,s)=>{if(++t>300000||s>64)throw Error("public-resource-budget-exceeded");if(typeof o==="string"){if(r+=new TextEncoder().encode(o).length,r>16777216)throw Error("public-resource-budget-exceeded")}else if(o&&typeof o==="object"){if(n.has(o))throw Error("invalid-public-resource-cycle");let a=Object.getPrototypeOf(o);if(!Array.isArray(o)&&a!==Object.prototype&&a!==null)throw Error("invalid-public-resource-object");n.add(o);for(let[c,l]of Object.entries(o))i(c,s+1),i(l,s+1);n.delete(o)}else if(o!==null&&typeof o!=="boolean"&&(typeof o!=="number"||!Number.isFinite(o)))throw Error("invalid-public-resource-json")};i(e,1)}var RO=new TextDecoder("utf-8",{fatal:!0});function bu(){return{listCatalog:()=>[...CR],getDesignMd:(e)=>{let t=vu();if(!e)return t.map(({body:r,...n})=>n);return t.find((r)=>r.id===e)??null},listTemplates:()=>go().map((e)=>({name:e.name,title:e.title,description:e.description,level:e.templateContract.level,category:e.templateContract.category,composedFrom:e.templateContract.composedFrom??[]}))}}async function wu(e){let t={};if(e.spec!==void 0){let r=typeof e.spec==="string"?eo(e.spec):e.spec;if(typeof r!=="object"||r===null||!Array.isArray(r.pages))throw Error("spec must be a UIBot Spec object with a pages array");let i=await Yl(r,{components:{...gr,...fr},actions:{},templates:{}},{templates:SR()});t.spec={ok:i.gaps.length===0,gaps:i.gaps,warnings:i.warnings}}if(e.html!==void 0){let r=ru({html:e.html});t.html={ok:!r.blocked,...r}}return t}function vR(){let e=["./resources/templates","./resources/shells","../../../examples/templates","../../../examples/shells"].map((i)=>po(new URL(i,import.meta.url))),t=[],r=new Set,n=new Set;for(let i of e){let o=i.endsWith("shells")?"shells":"templates";if(!uo(i)||r.has(i)||n.has(o))continue;if(n.add(o),r.add(i),i.endsWith("/shells")||i.endsWith("\\shells"))t.push({dir:i,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});else t.push({dir:i})}return t}var mu,yu,hu;function go(){return mu??=no(vR()),mu}function SR(){return yu??=Object.fromEntries(go().map((e)=>[e.name,eo(e.yaml)])),yu}function vu(){let e=po(new URL("./resources/design-md",import.meta.url));return hu??=uo(e)?fn(e):fn(),hu}var hn;function Su(){let e=["./resources/bundle.json","../../../public/resources/bundle.json"].map((r)=>po(new URL(r,import.meta.url))).find(uo);if(e){let r=JSON.parse(wR(e,"utf8"));return lo(r),gu(r)}if(hn)return hn;let t=Object.fromEntries(go().map((r)=>[r.name,r.templateContract]));return hn=yn(ou({components:{...gr,...fr},templates:t,designGuides:vu(),examples:iu(t)})),hn}function kR(){let e=new Map;for(let t of[...Object.values(gr),...Object.values(fr)]){if(e.has(t.name))throw Error(`Duplicate catalog block name '${t.name}' across the shadcn and studio catalogs`);e.set(t.name,t)}return[...e.values()].sort((t,r)=>t.name.localeCompare(r.name))}var CR=Object.freeze(kR());var PR="This uibot-mcp process has no Hub service wired, so component generation and task status are unavailable. Embed it with createUIBotMcpServer({ service, discovery }) to enable those tools.";function TR(){return{requestComponent:()=>Promise.reject(Error(PR)),getTask:()=>{return},listTasks:()=>[],getTaskStatus:()=>{return}}}function OR(e,t){let r=Object.fromEntries(Object.entries(t??{}).filter(([,n])=>n!=null));return{...e,...r}}function DR(e={}){let t=wa({service:e.service??TR(),serviceAvailable:e.service!=null,discovery:OR(bu(),e.discovery),resourceQuery:e.resourceQuery??Su(),validate:e.validate??wu}),r=new xR({name:"uibot",version:va},{capabilities:{tools:{}}});return r.setRequestHandler(ER,()=>({tools:t.listTools().filter((n)=>!e.resourceOnly||n.name.startsWith("uibot_resource_")).map((n)=>({...n,annotations:{readOnlyHint:n.name!=="uibot_request_component",destructiveHint:!1,idempotentHint:n.name!=="uibot_request_component",openWorldHint:!0}})).concat((!e.resourceOnly&&e.logo?e.logo.operations:[]).map((n)=>({name:`uibot_logo_${n.name}`,description:n.name==="preview"?`${n.description} Defaults to icon-512. Inline PNGs are limited to 512 KiB; use CLI preview --out for larger originals.`:n.description,inputSchema:n.name==="preview"?{...n.inputSchema,properties:{...n.inputSchema.properties,variant:{...n.inputSchema.properties.variant,default:"icon-512"}}}:n.inputSchema,annotations:{readOnlyHint:n.readOnly,destructiveHint:!1,idempotentHint:n.readOnly||n.name==="generate",openWorldHint:!0}})))})),r.setRequestHandler(AR,async(n,i)=>{if(e.resourceOnly&&!n.params.name.startsWith("uibot_resource_"))return{content:[{type:"text",text:"public-resource-tool-unavailable"}],isError:!0};if(n.params.name.startsWith("uibot_logo_"))try{if(e.resourceOnly||!e.logo)throw new E("logo-unavailable");let s=n.params.name.slice(11),a={...n.params.arguments};if(s==="preview"&&a.variant===void 0)a.variant="icon-512";let c=await e.logo.call(s,a,i.signal),{image:l,...p}=c,u=s==="preview"?p:c;if(s==="preview"&&l&&Buffer.byteLength(l.data,"base64")>524288){let g={...p,error:{code:"logo-preview-inline-too-large",outcomeUnknown:!1,next:"Use a smaller variant, or save the original with uibot logo preview <asset-id> --out <directory> and open the PNG with the host image viewer."}};return{content:[{type:"text",text:JSON.stringify(g)}],structuredContent:g,isError:!0}}return{content:[{type:"text",text:JSON.stringify(u)},...s==="preview"&&l?[l]:[]],structuredContent:u}}catch(s){let a={error:{code:s instanceof E?s.code:"logo-failed",outcomeUnknown:s instanceof E&&s.outcomeUnknown,...s instanceof E&&s.requestId?{requestId:s.requestId,next:`Call uibot_logo_status with requestId ${s.requestId}; do not automatically submit a new ID.`}:{}}};return{content:[{type:"text",text:JSON.stringify(a)}],structuredContent:a,isError:!0}}let o={...n.params.arguments};if(n.params.name==="uibot_resource_search"){if(o.limit===void 0)o.limit=12;else if(typeof o.limit==="number"&&o.limit>50)o.limit=50}try{let s=await t.callTool(n.params.name,o),a=Sa(s.content);if(n.params.name.startsWith("uibot_resource_")&&new TextEncoder().encode(JSON.stringify(a)).length>(n.params.name==="uibot_resource_manifest"?1048576:262144))return{isError:!0,content:[{type:"text",text:JSON.stringify({error:{code:"resource-response-too-large",detail:"Use search with a smaller limit, then get, docs or paged examples for one resource."}})}]};let c=s.content.find((p)=>p.type==="json"),l=c?.type==="json"&&c.json!==null&&typeof c.json==="object"&&!Array.isArray(c.json)?c.json:void 0;return{content:a,...l?{structuredContent:l}:{},...s.isError?{isError:!0}:{}}}catch(s){return{content:[{type:"text",text:s instanceof Error?s.message:String(s)}],isError:!0}}}),r}function LR(e=process.argv[1],t=import.meta.url){if(!e)return!1;try{return ku(RR(t))===ku(e)}catch{return!1}}async function NR(){let e=process.env.UIBOT_BACKEND_URL,t=process.env.UIBOT_AUTH_BEARER;if(!!e!==!!t)throw Error("Logo MCP requires both UIBOT_BACKEND_URL and UIBOT_AUTH_BEARER");let r=process.env.UIBOT_LOGO_OUTPUT_DIR,n=e&&t?wo({url:e,token:t,...r?{outputDir:r}:{}}):void 0,i=DR(n?{logo:n}:{});await i.connect(new IR);for(let o of["SIGINT","SIGTERM"])process.on(o,()=>{i.close().finally(()=>process.exit(0))})}if(LR())NR().catch((e)=>{console.error(e),process.exit(1)});export{DR as createUIBotMcpServer,LR as isEntryPoint,NR as main};
|