@uibot/mcp-server 0.19.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +38 -0
  2. package/dist/content.d.ts +5 -1
  3. package/dist/discovery.d.ts +5 -3
  4. package/dist/http.d.ts +4 -1
  5. package/dist/http.js +154 -119
  6. package/dist/resources/bundle.json +1 -1
  7. package/dist/resources/templates/shadcn-admin.yaml +1491 -334
  8. package/dist/server.d.ts +8 -1
  9. package/dist/server.js +151 -116
  10. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-apps.json +61 -0
  11. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-chats.json +54 -0
  12. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-account.json +1 -1
  13. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-appearance.json +1 -1
  14. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-display.json +1 -1
  15. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-notifications.json +1 -1
  16. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-profile.json +1 -1
  17. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-settings.json +65 -0
  18. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-shell.json +173 -0
  19. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-tasks.json +66 -0
  20. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-users.json +66 -0
  21. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/agent-run-console.json +64 -0
  22. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/auth-minimal.json +59 -0
  23. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/billing-overview.json +66 -0
  24. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/billing-usage-ledger.json +66 -0
  25. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/charts.json +238 -0
  26. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-workspace.json +1 -1
  27. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/collection-kanban.json +134 -0
  28. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/collection-shared.json +1 -1
  29. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/commerce-workspace.json +1 -1
  30. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/console-billing.json +68 -0
  31. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/console-page.json +14 -14
  32. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/console-shell.json +29 -0
  33. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/creation-shared.json +2 -2
  34. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/crm-workspace.json +1 -1
  35. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/dashboard-01.json +78 -0
  36. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/dashboard.json +113 -3
  37. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-gallery.json +66 -0
  38. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-kanban.json +66 -0
  39. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-master-detail.json +66 -0
  40. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-table.json +66 -0
  41. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-table.json +352 -0
  42. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/data.json +9 -2
  43. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-assistant.json +1 -1
  44. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-workspace.json +1 -1
  45. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/drilldown-menu.json +1 -1
  46. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/education-workspace.json +1 -1
  47. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/feedback.json +15 -2
  48. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/form.json +1 -1
  49. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/launch-site.json +72 -0
  50. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/layout.json +806 -0
  51. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/nav.json +285 -0
  52. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/onboarding-checklist.json +63 -0
  53. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/onboarding-wizard.json +66 -0
  54. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/prompt-eval-workbench.json +65 -0
  55. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/record-master-detail.json +132 -0
  56. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/shadcn-admin.json +77 -0
  57. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-primitives.json +1 -1
  58. package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/workspace.json +9 -2
  59. package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/snapshot.json +1 -0
  60. package/dist/spec-ops.d.ts +31 -0
  61. package/package.json +12 -9
  62. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-apps.json +0 -61
  63. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-chats.json +0 -54
  64. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings.json +0 -65
  65. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-shell.json +0 -160
  66. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-tasks.json +0 -66
  67. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-users.json +0 -66
  68. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/charts.json +0 -211
  69. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-billing.json +0 -68
  70. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-shell.json +0 -29
  71. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/data-table.json +0 -242
  72. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/layout.json +0 -771
  73. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/nav.json +0 -257
  74. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/shadcn-admin.json +0 -77
  75. package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/snapshot.json +0 -1
  76. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/licenses/UIBot-LICENSE +0 -0
  77. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/licenses/blocks-icons-LICENSE +0 -0
  78. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/licenses/shadcn-THIRD_PARTY_LICENSE +0 -0
  79. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-dashboard.json +0 -0
  80. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-401.json +0 -0
  81. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-403.json +0 -0
  82. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-404.json +0 -0
  83. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-500.json +0 -0
  84. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-503.json +0 -0
  85. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-forgot-password.json +0 -0
  86. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-help.json +0 -0
  87. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-otp.json +0 -0
  88. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-overview.json +0 -0
  89. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-sign-in-2.json +0 -0
  90. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-sign-in.json +0 -0
  91. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-sign-up.json +0 -0
  92. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/ai-chat.json +0 -0
  93. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/analytics-dashboard.json +0 -0
  94. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-floating.json +0 -0
  95. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-icon-rail.json +0 -0
  96. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-inset.json +0 -0
  97. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-settings.json +0 -0
  98. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-sidebar.json +0 -0
  99. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-workspace.json +0 -0
  100. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-centered.json +0 -0
  101. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-enterprise.json +0 -0
  102. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-recovery.json +0 -0
  103. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-registration.json +0 -0
  104. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-split.json +0 -0
  105. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth.json +0 -0
  106. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/blog.json +0 -0
  107. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-artifact.json +0 -0
  108. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-focused.json +0 -0
  109. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-history.json +0 -0
  110. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-knowledge.json +0 -0
  111. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-support.json +0 -0
  112. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/content.json +0 -0
  113. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/crm.json +0 -0
  114. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/data-studio.json +0 -0
  115. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-library.json +0 -0
  116. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-reading.json +0 -0
  117. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-writing.json +0 -0
  118. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/ecommerce.json +0 -0
  119. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/field.json +0 -0
  120. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/grid.json +0 -0
  121. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/interactive.json +0 -0
  122. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/item-grid.json +0 -0
  123. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/kanban.json +0 -0
  124. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/lms.json +0 -0
  125. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/marketing.json +0 -0
  126. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/portfolio.json +0 -0
  127. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/presentation.json +0 -0
  128. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/pricing.json +0 -0
  129. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/primitives.json +0 -0
  130. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/saas-landing.json +0 -0
  131. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sections.json +0 -0
  132. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/settings.json +0 -0
  133. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/shadcn-admin-shell.json +0 -0
  134. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-01.json +0 -0
  135. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-02.json +0 -0
  136. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-03.json +0 -0
  137. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-04.json +0 -0
  138. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-05.json +0 -0
  139. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-06.json +0 -0
  140. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-07.json +0 -0
  141. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-08.json +0 -0
  142. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-09.json +0 -0
  143. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-10.json +0 -0
  144. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-11.json +0 -0
  145. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-12.json +0 -0
  146. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-13.json +0 -0
  147. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-14.json +0 -0
  148. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-15.json +0 -0
  149. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-16.json +0 -0
  150. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-drilldown.json +0 -0
  151. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/store.json +0 -0
  152. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/support-inbox.json +0 -0
  153. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/team-directory.json +0 -0
  154. /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/uibot-base.json +0 -0
package/dist/http.js CHANGED
@@ -1,137 +1,172 @@
1
- import{createRequire as Cu}from"node:module";var mu=Object.create;var{getPrototypeOf:yu,defineProperty:us,getOwnPropertyNames:hu}=Object;var ds=Object.prototype.hasOwnProperty;function bu(e){return this[e]}var wu,Su,vu=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?wu??=new WeakMap:Su??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?mu(yu(e)):{};let o=t||!e||!e.__esModule||!ds.call(e,"default")?us(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of hu(e))if(!ds.call(o,a))us(o,a,{get:bu.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=Cu(import.meta.url);var Be=h(function(bR,ps){var ku=Number.MAX_SAFE_INTEGER||9007199254740991,Ru=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ps.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ku,RELEASE_TYPES:Ru,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var nt=h(function(wR,gs){var xu=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};gs.exports=xu});var qe=h(function(ie,fs){var{MAX_SAFE_COMPONENT_LENGTH:fn,MAX_SAFE_BUILD_LENGTH:Iu,MAX_LENGTH:Au}=Be(),Eu=nt();ie=fs.exports={};var Pu=ie.re=[],Tu=ie.safeRe=[],b=ie.src=[],Ou=ie.safeSrc=[],w=ie.t={},Du=0,mn="[a-zA-Z0-9-]",Lu=[["\\s",1],["\\d",Au],[mn,Iu]],Nu=(e)=>{for(let[t,r]of Lu)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},I=(e,t,r)=>{let n=Nu(t),i=Du++;Eu(e,i,t),w[e]=i,b[i]=t,Ou[i]=n,Pu[i]=new RegExp(t,r?"g":void 0),Tu[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(SR,ms){var _u=Object.freeze({loose:!0}),Mu=Object.freeze({}),$u=(e)=>{if(!e)return Mu;if(typeof e!=="object")return _u;return e};ms.exports=$u});var yn=h(function(vR,bs){var ys=/^[0-9]+$/,hs=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=ys.test(e),n=ys.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Bu=(e,t)=>hs(t,e);bs.exports={compareIdentifiers:hs,rcompareIdentifiers:Bu}});var B=h(function(CR,Ss){var Vt=nt(),{MAX_LENGTH:ws,MAX_SAFE_INTEGER:zt}=Be(),{safeRe:Gt,t:Kt}=qe(),qu=Ht(),{compareIdentifiers:hn}=yn(),Fu=(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=qu(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>ws)throw TypeError(`version is longer than ${ws} 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(Fu(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}}Ss.exports=Z});var fe=h(function(kR,Cs){var vs=B(),ju=(e,t,r=!1)=>{if(e instanceof vs)return e;try{return new vs(e,t)}catch(n){if(!r)return null;throw n}};Cs.exports=ju});var Rs=h(function(RR,ks){var Uu=fe(),Hu=(e,t)=>{let r=Uu(e,t);return r?r.version:null};ks.exports=Hu});var Is=h(function(xR,xs){var Vu=fe(),zu=(e,t)=>{let r=Vu(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};xs.exports=zu});var Ps=h(function(IR,Es){var As=B(),Gu=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new As(e instanceof As?e.version:e,r).inc(t,n,i).version}catch(s){return null}};Es.exports=Gu});var Ds=h(function(AR,Os){var Ts=fe(),Ku=(e,t)=>{let r=Ts(e,null,!0),n=Ts(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 d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};Os.exports=Ku});var Ns=h(function(ER,Ls){var Wu=B(),Yu=(e,t)=>new Wu(e,t).major;Ls.exports=Yu});var Ms=h(function(PR,_s){var Ju=B(),Qu=(e,t)=>new Ju(e,t).minor;_s.exports=Qu});var Bs=h(function(TR,$s){var Xu=B(),Zu=(e,t)=>new Xu(e,t).patch;$s.exports=Zu});var Fs=h(function(OR,qs){var ed=fe(),td=(e,t)=>{let r=ed(e,t);return r&&r.prerelease.length?r.prerelease:null};qs.exports=td});var W=h(function(DR,Us){var js=B(),rd=(e,t,r)=>new js(e,r).compare(new js(t,r));Us.exports=rd});var Vs=h(function(LR,Hs){var nd=W(),id=(e,t,r)=>nd(t,e,r);Hs.exports=id});var Gs=h(function(NR,zs){var sd=W(),od=(e,t)=>sd(e,t,!0);zs.exports=od});var Wt=h(function(_R,Ws){var Ks=B(),ad=(e,t,r)=>{let n=new Ks(e,r),i=new Ks(t,r);return n.compare(i)||n.compareBuild(i)};Ws.exports=ad});var Js=h(function(MR,Ys){var cd=Wt(),ld=(e,t)=>e.sort((r,n)=>cd(r,n,t));Ys.exports=ld});var Xs=h(function($R,Qs){var ud=Wt(),dd=(e,t)=>e.sort((r,n)=>ud(n,r,t));Qs.exports=dd});var it=h(function(BR,Zs){var pd=W(),gd=(e,t,r)=>pd(e,t,r)>0;Zs.exports=gd});var Yt=h(function(qR,eo){var fd=W(),md=(e,t,r)=>fd(e,t,r)<0;eo.exports=md});var bn=h(function(FR,to){var yd=W(),hd=(e,t,r)=>yd(e,t,r)===0;to.exports=hd});var wn=h(function(jR,ro){var bd=W(),wd=(e,t,r)=>bd(e,t,r)!==0;ro.exports=wd});var Jt=h(function(UR,no){var Sd=W(),vd=(e,t,r)=>Sd(e,t,r)>=0;no.exports=vd});var Qt=h(function(HR,io){var Cd=W(),kd=(e,t,r)=>Cd(e,t,r)<=0;io.exports=kd});var Sn=h(function(VR,so){var Rd=bn(),xd=wn(),Id=it(),Ad=Jt(),Ed=Yt(),Pd=Qt(),Td=(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 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);case"<=":return Pd(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};so.exports=Td});var ao=h(function(zR,oo){var Od=B(),Dd=fe(),{safeRe:Xt,t:Zt}=qe(),Ld=(e,t)=>{if(e instanceof Od)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 Dd(`${n}.${i}.${s}${o}${a}`,t)};oo.exports=Ld});var uo=h(function(GR,lo){var Nd=fe(),co=Be(),_d=B(),Md=(e,t,r)=>{if(!co.RELEASE_TYPES.includes(t))return null;let n=$d(e,r);return n&&Bd(n,t)},$d=(e,t)=>{let r=e instanceof _d?e.version:e;return Nd(r,t)},Bd=(e,t)=>{if(qd(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()},qd=(e)=>e.startsWith("pre");lo.exports=Md});var fo=h(function(KR,go){class po{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}}go.exports=po});var Y=h(function(WR,bo){var Fd=/\s+/g;class st{constructor(e,t){if(t=Ud(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(Fd," "),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)=>!yo(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&&Qd(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(Jd,"");let r=((this.options.includePrerelease&&Wd)|(this.options.loose&&Yd))+":"+e,n=mo.get(r);if(n)return n;let i=this.options.loose,s=i?j[q.HYPHENRANGELOOSE]:j[q.HYPHENRANGE];e=e.replace(s,cp(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(j[q.COMPARATORTRIM],zd),T("comparator trim",e),e=e.replace(j[q.TILDETRIM],Gd),T("tilde trim",e),e=e.replace(j[q.CARETTRIM],Kd),T("caret trim",e);let o=e.split(" ").map((d)=>Xd(d,this.options)).join(" ").split(/\s+/).map((d)=>ap(d,this.options));if(i)o=o.filter((d)=>(T("loose invalid filter",d,this.options),!!d.match(j[q.COMPARATORLOOSE])));T("range list",o);let a=new Map,c=o.map((d)=>new er(d,this.options));for(let d of c){if(yo(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return mo.set(r,l),l}intersects(e,t){if(!(e instanceof st))throw TypeError("a Range is required");return this.set.some((r)=>ho(r,t)&&e.set.some((n)=>ho(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 Hd(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(lp(this.set[t],e,this.options))return!0;return!1}}bo.exports=st;var jd=fo(),mo=new jd,Ud=Ht(),er=ot(),T=nt(),Hd=B(),{safeRe:j,src:Vd,t:q,comparatorTrimReplace:zd,tildeTrimReplace:Gd,caretTrimReplace:Kd}=qe(),{FLAG_INCLUDE_PRERELEASE:Wd,FLAG_LOOSE:Yd}=Be(),Jd=new RegExp(Vd[q.BUILD],"g"),yo=(e)=>e.value==="<0.0.0-0",Qd=(e)=>e.value==="",ho=(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},Xd=(e,t)=>(e=e.replace(j[q.BUILD],""),T("comp",e,t),e=rp(e,t),T("caret",e),e=ep(e,t),T("tildes",e),e=ip(e,t),T("xrange",e),e=op(e,t),T("stars",e),e),N=(e)=>!e||e.toLowerCase()==="x"||e==="*",Zd=(e,t,r)=>N(e)&&!N(t)||N(t)&&r&&!N(r),ep=(e,t)=>e.trim().split(/\s+/).map((r)=>tp(r,t)).join(" "),tp=(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})},rp=(e,t)=>e.trim().split(/\s+/).map((r)=>np(r,t)).join(" "),np=(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})},ip=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>sp(r,t)).join(" ")),sp=(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),Zd(s,o,a))return e;let l=N(s),d=l||N(o),g=d||N(a),p=g;if(i==="="&&p)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&p){if(d)o=0;if(a=0,i===">")if(i=">=",d)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",d)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(d)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(g)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return T("xRange return",n),n})},op=(e,t)=>(T("replaceStars",e,t),e.trim().replace(j[q.STAR],"")),ap=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(j[t.includePrerelease?q.GTE0PRE:q.GTE0],"")),cp=(e)=>(t,r,n,i,s,o,a,c,l,d,g,p)=>{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(d))c=`<${+l+1}.0.0-0`;else if(N(g))c=`<${l}.${+d+1}.0-0`;else if(p)c=`<=${l}.${d}.${g}-${p}`;else if(e)c=`<${l}.${d}.${+g+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},lp=(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(YR,Ro){var at=Symbol("SemVer ANY");class tr{static get ANY(){return at}constructor(e,t){if(t=wo(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?So[vo.COMPARATORLOOSE]:So[vo.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 Co(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 Co(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 ko(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new ko(this.value,t).test(e.semver)}if(t=wo(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}}Ro.exports=tr;var wo=Ht(),{safeRe:So,t:vo}=qe(),vn=Sn(),Cn=nt(),Co=B(),ko=Y()});var ct=h(function(JR,xo){var up=Y(),dp=(e,t,r)=>{try{t=new up(t,r)}catch(n){return!1}return t.test(e)};xo.exports=dp});var Ao=h(function(QR,Io){var pp=Y(),gp=(e,t)=>new pp(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Io.exports=gp});var Po=h(function(XR,Eo){var fp=B(),mp=Y(),yp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new mp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new fp(n,r)}}),n};Eo.exports=yp});var Oo=h(function(ZR,To){var hp=B(),bp=Y(),wp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new bp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new hp(n,r)}}),n};To.exports=wp});var No=h(function(ex,Lo){var kn=B(),Sp=Y(),Do=it(),vp=(e,t)=>{e=new Sp(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||Do(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Do(r,s)))r=s}if(r&&e.test(r))return r;return null};Lo.exports=vp});var Mo=h(function(tx,_o){var Cp=Y(),kp=(e,t)=>{try{return new Cp(e,t).range||"*"}catch(r){return null}};_o.exports=kp});var rr=h(function(rx,Fo){var Rp=B(),qo=ot(),{ANY:xp}=qo,Ip=Y(),Ap=ct(),$o=it(),Bo=Yt(),Ep=Qt(),Pp=Jt(),Tp=(e,t,r,n)=>{e=new Rp(e,n),t=new Ip(t,n);let i,s,o,a,c;switch(r){case">":i=$o,s=Ep,o=Bo,a=">",c=">=";break;case"<":i=Bo,s=Pp,o=$o,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Ap(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let d=t.set[l],g=null,p=null;if(d.forEach((u)=>{if(u.semver===xp)u=new qo(">=0.0.0");if(g=g||u,p=p||u,i(u.semver,g.semver,n))g=u;else if(o(u.semver,p.semver,n))p=u}),g.operator===a||g.operator===c)return!1;if((!p.operator||p.operator===a)&&s(e,p.semver))return!1;else if(p.operator===c&&o(e,p.semver))return!1}return!0};Fo.exports=Tp});var Uo=h(function(nx,jo){var Op=rr(),Dp=(e,t,r)=>Op(e,t,">",r);jo.exports=Dp});var Vo=h(function(ix,Ho){var Lp=rr(),Np=(e,t,r)=>Lp(e,t,"<",r);Ho.exports=Np});var Ko=h(function(sx,Go){var zo=Y(),_p=(e,t,r)=>(e=new zo(e,r),t=new zo(t,r),e.intersects(t,r));Go.exports=_p});var Yo=h(function(ox,Wo){var Mp=ct(),$p=W();Wo.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((d,g)=>$p(d,g,r));for(let d of o)if(Mp(d,t,r)){if(s=d,!i)i=d}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[d,g]of n)if(d===g)a.push(d);else if(!g&&d===o[0])a.push("*");else if(!g)a.push(`>=${d}`);else if(d===o[0])a.push(`<=${g}`);else a.push(`${d} - ${g}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var ta=h(function(ax,ea){var Jo=Y(),In=ot(),{ANY:Rn}=In,xn=ct(),An=W(),Bp=(e,t,r={})=>{if(e===t)return!0;e=new Jo(e,r),t=new Jo(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=Fp(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},qp=[new In(">=0.0.0-0")],Qo=[new In(">=0.0.0")],Fp=(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=qp;else e=Qo;if(t.length===1&&t[0].semver===Rn)if(r.includePrerelease)return!0;else t=Qo;let n=new Set,i,s;for(let u of e)if(u.operator===">"||u.operator===">=")i=Xo(i,u,r);else if(u.operator==="<"||u.operator==="<=")s=Zo(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,d,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,p=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0)g=!1;for(let u of t){if(d=d||u.operator===">"||u.operator===">=",l=l||u.operator==="<"||u.operator==="<=",i){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(a=Xo(i,u,r),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(s){if(g){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===g.major&&u.semver.minor===g.minor&&u.semver.patch===g.patch)g=!1}if(u.operator==="<"||u.operator==="<="){if(c=Zo(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&&d&&!i&&o!==0)return!1;if(p||g)return!1;return!0},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=(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};ea.exports=Bp});var na=h(function(cx,ra){var Fe=qe(),nr=Be(),jp=B(),ir=yn(),Up=fe(),Hp=Rs(),Vp=Is(),zp=Ps(),Gp=Ds(),Kp=Ns(),Wp=Ms(),Yp=Bs(),Jp=Fs(),Qp=W(),Xp=Vs(),Zp=Gs(),eg=Wt(),tg=Js(),rg=Xs(),ng=it(),ig=Yt(),sg=bn(),og=wn(),ag=Jt(),cg=Qt(),lg=Sn(),ug=ao(),dg=uo(),pg=ot(),gg=Y(),fg=ct(),mg=Ao(),yg=Po(),hg=Oo(),bg=No(),wg=Mo(),Sg=rr(),vg=Uo(),Cg=Vo(),kg=Ko(),Rg=Yo(),xg=ta();ra.exports={parse:Up,valid:Hp,clean:Vp,inc:zp,diff:Gp,major:Kp,minor:Wp,patch:Yp,prerelease:Jp,compare:Qp,rcompare:Xp,compareLoose:Zp,compareBuild:eg,sort:tg,rsort:rg,gt:ng,lt:ig,eq:sg,neq:og,gte:ag,lte:cg,cmp:lg,coerce:ug,truncate:dg,Comparator:pg,Range:gg,satisfies:fg,toComparators:mg,maxSatisfying:yg,minSatisfying:hg,minVersion:bg,validRange:wg,outside:Sg,gtr:vg,ltr:Cg,intersects:kg,simplifyRange:Rg,subset:xg,SemVer:jp,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(Kg){var On=Symbol.for("yaml.alias"),ma=Symbol.for("yaml.document"),dr=Symbol.for("yaml.map"),ya=Symbol.for("yaml.pair"),Dn=Symbol.for("yaml.scalar"),pr=Symbol.for("yaml.seq"),le=Symbol.for("yaml.node.type"),Fg=(e)=>!!e&&typeof e==="object"&&e[le]===On,jg=(e)=>!!e&&typeof e==="object"&&e[le]===ma,Ug=(e)=>!!e&&typeof e==="object"&&e[le]===dr,Hg=(e)=>!!e&&typeof e==="object"&&e[le]===ya,ha=(e)=>!!e&&typeof e==="object"&&e[le]===Dn,Vg=(e)=>!!e&&typeof e==="object"&&e[le]===pr;function ba(e){if(e&&typeof e==="object")switch(e[le]){case dr:case pr:return!0}return!1}function zg(e){if(e&&typeof e==="object")switch(e[le]){case On:case dr:case Dn:case pr:return!0}return!1}var Gg=(e)=>(ha(e)||ba(e))&&!!e.anchor;Kg.ALIAS=On;Kg.DOC=ma;Kg.MAP=dr;Kg.NODE_TYPE=le;Kg.PAIR=ya;Kg.SCALAR=Dn;Kg.SEQ=pr;Kg.hasAnchor=Gg;Kg.isAlias=Fg;Kg.isCollection=ba;Kg.isDocument=jg;Kg.isMap=Ug;Kg.isNode=zg;Kg.isPair=Hg;Kg.isScalar=ha;Kg.isSeq=Vg});var gt=h(function(df){var _=E(),V=Symbol("break visit"),wa=Symbol("skip children"),se=Symbol("remove node");function gr(e,t){let r=Sa(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=wa;gr.REMOVE=se;function Ue(e,t,r,n){let i=va(e,t,r,n);if(_.isNode(i)||_.isPair(i))return Ca(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=Sa(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=wa;fr.REMOVE=se;async function He(e,t,r,n){let i=await va(e,t,r,n);if(_.isNode(i)||_.isPair(i))return Ca(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 Sa(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 va(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 Ca(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`)}}df.visit=gr;df.visitAsync=fr});var Ln=h(function(hf){var ka=E(),ff=gt(),mf={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yf=(e)=>e.replace(/[!,[\]{}]/g,(t)=>mf[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+yf(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&&ka.isNode(e.contents)){let i={};ff.visit(e.contents,(s,o)=>{if(ka.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(`
2
- `)}}Q.defaultYaml={explicit:!1,version:"1.2"};Q.defaultTags={"!!":"tag:yaml.org,2002:"};hf.Directives=Q});var mr=h(function(Cf){var Ra=E(),wf=gt();function Sf(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 xa(e){let t=new Set;return wf.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}}),t}function Ia(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function vf(e,t){let r=[],n=new Map,i=null;return{onAnchor:(s)=>{r.push(s),i??(i=xa(e));let o=Ia(t,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o==="object"&&o.anchor&&(Ra.isScalar(o.node)||Ra.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:n}}Cf.anchorIsValid=Sf;Cf.anchorNames=xa;Cf.createNodeAnchors=vf;Cf.findNewAnchor=Ia});var Nn=h(function(Af){function ft(e,t,r,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],a=ft(e,n,String(i),o);if(a===void 0)delete n[i];else if(a!==o)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=ft(e,n,i,s);if(o===void 0)n.delete(i);else if(o!==s)n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=ft(e,n,i,i);if(s===void 0)n.delete(i);else if(s!==i)n.delete(i),n.add(s)}else for(let[i,s]of Object.entries(n)){let o=ft(e,n,i,s);if(o===void 0)delete n[i];else if(o!==s)n[i]=o}return e.call(t,r,n)}Af.applyReviver=ft});var me=h(function(Tf){var Pf=E();function Aa(e,t,r){if(Array.isArray(e))return e.map((n,i)=>Aa(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!Pf.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=(s)=>{n.res=s,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}Tf.toJS=Aa});var yr=h(function(Nf){var Df=Nn(),Ea=E(),Lf=me();class Pa{constructor(e){Object.defineProperty(this,Ea.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(!Ea.isDocument(e))throw TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},o=Lf.toJS(this,"",s);if(typeof n==="function")for(let{count:a,res:c}of s.anchors.values())n(c,a);return typeof i==="function"?Df.applyReviver(i,{"":o},"",o):o}}Nf.NodeBase=Pa});var mt=h(function(Ff){var Mf=mr(),$f=gt(),Ve=E(),Bf=yr(),qf=me();class Ta extends Bf.NodeBase{constructor(e){super(Ve.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=[],$f.visit(e,{Node:(i,s)=>{if(Ve.isAlias(s)||Ve.hasAnchor(s))r.push(s)}}),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:s,maxAliasCount:o}=t,a=i.get(n);if(!a)qf.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(o>=0){if(a.count+=1,a.aliasCount===0)a.aliasCount=hr(s,n,i);if(a.count*a.aliasCount>o)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(Mf.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 hr(e,t,r){if(Ve.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Ve.isCollection(t)){let n=0;for(let i of t.items){let s=hr(e,i,r);if(s>n)n=s}return n}else if(Ve.isPair(t)){let n=hr(e,t.key,r),i=hr(e,t.value,r);return Math.max(n,i)}return 1}Ff.Alias=Ta});var O=h(function(Gf){var Uf=E(),Hf=yr(),Vf=me(),zf=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class Ee extends Hf.NodeBase{constructor(e){super(Uf.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:Vf.toJS(this.value,e,t)}toString(){return String(this.value)}}Ee.BLOCK_FOLDED="BLOCK_FOLDED";Ee.BLOCK_LITERAL="BLOCK_LITERAL";Ee.PLAIN="PLAIN";Ee.QUOTE_DOUBLE="QUOTE_DOUBLE";Ee.QUOTE_SINGLE="QUOTE_SINGLE";Gf.Scalar=Ee;Gf.isScalarValue=zf});var yt=h(function(Zf){var Yf=mt(),Pe=E(),Oa=O(),Jf="tag:yaml.org,2002:";function Qf(e,t,r){if(t){let n=r.filter((s)=>s.tag===t),i=n.find((s)=>!s.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return r.find((n)=>n.identify?.(e)&&!n.format)}function Xf(e,t,r){if(Pe.isDocument(e))e=e.contents;if(Pe.isNode(e))return e;if(Pe.isPair(e)){let g=r.schema[Pe.MAP].createNode?.(r.schema,null,r);return g.items.push(e),g}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:s,schema:o,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 Yf.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=Jf+t.slice(2);let l=Qf(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let g=new Oa.Scalar(e);if(c)c.node=g;return g}l=e instanceof Map?o[Pe.MAP]:(Symbol.iterator in Object(e))?o[Pe.SEQ]:o[Pe.MAP]}if(s)s(l),delete r.onTagObj;let d=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from==="function"?l.nodeClass.from(r.schema,e,r):new Oa.Scalar(e);if(t)d.tag=t;else if(!l.default)d.tag=l.tag;if(c)c.node=d;return d}Zf.createNode=Xf});var br=h(function(nm){var tm=yt(),oe=E(),rm=yr();function _n(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let s=t[i];if(typeof s==="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return tm.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 Da=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class La extends rm.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)=>oe.isNode(r)||oe.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(Da(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(oe.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(r,_n(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(oe.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&&oe.isScalar(i)?i.value:i;else return oe.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!oe.isPair(t))return!1;let r=t.value;return r==null||e&&oe.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 oe.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(oe.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(r,_n(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}nm.Collection=La;nm.collectionFromPath=_n;nm.isEmptyPath=Da});var ht=h(function(lm){var am=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Mn(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var cm=(e,t,r)=>e.endsWith(`
3
- `)?Mn(r,t):r.includes(`
1
+ import{createRequire as Af}from"node:module";var vf=Object.create;var{getPrototypeOf:kf,defineProperty:wl,getOwnPropertyNames:wf}=Object;var Sl=Object.prototype.hasOwnProperty;function Sf(e){return this[e]}var xf,Cf,If=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?xf??=new WeakMap:Cf??=new WeakMap,o=i.get(e);if(o)return o}n=e!=null?vf(kf(e)):{};let s=t||!e||!e.__esModule||!Sl.call(e,"default")?wl(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of wf(e))if(!Sl.call(s,a))wl(s,a,{get:Sf.bind(e,a),enumerable:!0})}if(r)i.set(e,s);return s};var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lr=Af(import.meta.url);var Rt=w(function(AE,Al){var Lf=Number.MAX_SAFE_INTEGER||9007199254740991,Mf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Al.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Lf,RELEASE_TYPES:Mf,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var sn=w(function(RE,Rl){var $f=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Rl.exports=$f});var Pt=w(function(Pe,Pl){var{MAX_SAFE_COMPONENT_LENGTH:lo,MAX_SAFE_BUILD_LENGTH:Ff,MAX_LENGTH:Uf}=Rt(),jf=sn();Pe=Pl.exports={};var qf=Pe.re=[],Vf=Pe.safeRe=[],I=Pe.src=[],Hf=Pe.safeSrc=[],A=Pe.t={},zf=0,co="[a-zA-Z0-9-]",Kf=[["\\s",1],["\\d",Uf],[co,Ff]],Gf=(e)=>{for(let[t,n]of Kf)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},O=(e,t,n)=>{let r=Gf(t),i=zf++;jf(e,i,t),A[e]=i,I[i]=t,Hf[i]=r,qf[i]=new RegExp(t,n?"g":void 0),Vf[i]=new RegExp(r,n?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*");O("NUMERICIDENTIFIERLOOSE","\\d+");O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${co}*`);O("MAINVERSION",`(${I[A.NUMERICIDENTIFIER]})\\.(${I[A.NUMERICIDENTIFIER]})\\.(${I[A.NUMERICIDENTIFIER]})`);O("MAINVERSIONLOOSE",`(${I[A.NUMERICIDENTIFIERLOOSE]})\\.(${I[A.NUMERICIDENTIFIERLOOSE]})\\.(${I[A.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASEIDENTIFIER",`(?:${I[A.NONNUMERICIDENTIFIER]}|${I[A.NUMERICIDENTIFIER]})`);O("PRERELEASEIDENTIFIERLOOSE",`(?:${I[A.NONNUMERICIDENTIFIER]}|${I[A.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASE",`(?:-(${I[A.PRERELEASEIDENTIFIER]}(?:\\.${I[A.PRERELEASEIDENTIFIER]})*))`);O("PRERELEASELOOSE",`(?:-?(${I[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[A.PRERELEASEIDENTIFIERLOOSE]})*))`);O("BUILDIDENTIFIER",`${co}+`);O("BUILD",`(?:\\+(${I[A.BUILDIDENTIFIER]}(?:\\.${I[A.BUILDIDENTIFIER]})*))`);O("FULLPLAIN",`v?${I[A.MAINVERSION]}${I[A.PRERELEASE]}?${I[A.BUILD]}?`);O("FULL",`^${I[A.FULLPLAIN]}$`);O("LOOSEPLAIN",`[v=\\s]*${I[A.MAINVERSIONLOOSE]}${I[A.PRERELEASELOOSE]}?${I[A.BUILD]}?`);O("LOOSE",`^${I[A.LOOSEPLAIN]}$`);O("GTLT","((?:<|>)?=?)");O("XRANGEIDENTIFIERLOOSE",`${I[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);O("XRANGEIDENTIFIER",`${I[A.NUMERICIDENTIFIER]}|x|X|\\*`);O("XRANGEPLAIN",`[v=\\s]*(${I[A.XRANGEIDENTIFIER]})(?:\\.(${I[A.XRANGEIDENTIFIER]})(?:\\.(${I[A.XRANGEIDENTIFIER]})(?:${I[A.PRERELEASE]})?${I[A.BUILD]}?)?)?`);O("XRANGEPLAINLOOSE",`[v=\\s]*(${I[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[A.XRANGEIDENTIFIERLOOSE]})(?:${I[A.PRERELEASELOOSE]})?${I[A.BUILD]}?)?)?`);O("XRANGE",`^${I[A.GTLT]}\\s*${I[A.XRANGEPLAIN]}$`);O("XRANGELOOSE",`^${I[A.GTLT]}\\s*${I[A.XRANGEPLAINLOOSE]}$`);O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${lo}})(?:\\.(\\d{1,${lo}}))?(?:\\.(\\d{1,${lo}}))?`);O("COERCE",`${I[A.COERCEPLAIN]}(?:$|[^\\d])`);O("COERCEFULL",I[A.COERCEPLAIN]+`(?:${I[A.PRERELEASE]})?(?:${I[A.BUILD]})?(?:$|[^\\d])`);O("COERCERTL",I[A.COERCE],!0);O("COERCERTLFULL",I[A.COERCEFULL],!0);O("LONETILDE","(?:~>?)");O("TILDETRIM",`(\\s*)${I[A.LONETILDE]}\\s+`,!0);Pe.tildeTrimReplace="$1~";O("TILDE",`^${I[A.LONETILDE]}${I[A.XRANGEPLAIN]}$`);O("TILDELOOSE",`^${I[A.LONETILDE]}${I[A.XRANGEPLAINLOOSE]}$`);O("LONECARET","(?:\\^)");O("CARETTRIM",`(\\s*)${I[A.LONECARET]}\\s+`,!0);Pe.caretTrimReplace="$1^";O("CARET",`^${I[A.LONECARET]}${I[A.XRANGEPLAIN]}$`);O("CARETLOOSE",`^${I[A.LONECARET]}${I[A.XRANGEPLAINLOOSE]}$`);O("COMPARATORLOOSE",`^${I[A.GTLT]}\\s*(${I[A.LOOSEPLAIN]})$|^$`);O("COMPARATOR",`^${I[A.GTLT]}\\s*(${I[A.FULLPLAIN]})$|^$`);O("COMPARATORTRIM",`(\\s*)${I[A.GTLT]}\\s*(${I[A.LOOSEPLAIN]}|${I[A.XRANGEPLAIN]})`,!0);Pe.comparatorTrimReplace="$1$2$3";O("HYPHENRANGE",`^\\s*(${I[A.XRANGEPLAIN]})\\s+-\\s+(${I[A.XRANGEPLAIN]})\\s*$`);O("HYPHENRANGELOOSE",`^\\s*(${I[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[A.XRANGEPLAINLOOSE]})\\s*$`);O("STAR","(<|>)?=?\\s*\\*");O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var cr=w(function(PE,Tl){var Wf=Object.freeze({loose:!0}),Yf=Object.freeze({}),Jf=(e)=>{if(!e)return Yf;if(typeof e!=="object")return Wf;return e};Tl.exports=Jf});var po=w(function(TE,Nl){var El=/^[0-9]+$/,Ol=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let n=El.test(e),r=El.test(t);if(n&&r)e=+e,t=+t;return e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},Qf=(e,t)=>Ol(t,e);Nl.exports={compareIdentifiers:Ol,rcompareIdentifiers:Qf}});var X=w(function(EE,Bl){var dr=sn(),{MAX_LENGTH:_l,MAX_SAFE_INTEGER:pr}=Rt(),{safeRe:ur,t:mr}=Pt(),Xf=cr(),{compareIdentifiers:uo}=po(),Zf=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let r=0;r<n.length;r++)if(uo(e[r],n[r])!==0)return!1;return!0};class ke{constructor(e,t){if(t=Xf(t),e instanceof ke)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>_l)throw TypeError(`version is longer than ${_l} characters`);dr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?ur[mr.LOOSE]:ur[mr.FULL]);if(!n)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>pr||this.major<0)throw TypeError("Invalid major version");if(this.minor>pr||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>pr||this.patch<0)throw TypeError("Invalid patch version");if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map((r)=>{if(/^[0-9]+$/.test(r)){let i=+r;if(i>=0&&i<pr)return i}return r});this.build=n[5]?n[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(dr("SemVer.compare",this.version,this.options,e),!(e instanceof ke)){if(typeof e==="string"&&e===this.version)return 0;e=new ke(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof ke))e=new ke(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 ke))e=new ke(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 n=this.prerelease[t],r=e.prerelease[t];if(dr("prerelease compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return uo(n,r)}while(++t)}compareBuild(e){if(!(e instanceof ke))e=new ke(e,this.options);let t=0;do{let n=this.build[t],r=e.build[t];if(dr("build compare",t,n,r),n===void 0&&r===void 0)return 0;else if(r===void 0)return 1;else if(n===void 0)return-1;else if(n===r)continue;else return uo(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw Error("invalid increment argument: identifier is empty");if(t){let r=`-${t}`.match(this.options.loose?ur[mr.PRERELEASELOOSE]:ur[mr.PRERELEASE]);if(!r||r[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,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,n);this.inc("pre",t,n);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 r=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[r];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(".")&&n===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){let i=[t,r];if(n===!1)i=[t];if(Zf(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}}Bl.exports=ke});var Ve=w(function(OE,Ll){var Dl=X(),eh=(e,t,n=!1)=>{if(e instanceof Dl)return e;try{return new Dl(e,t)}catch(r){if(!n)return null;throw r}};Ll.exports=eh});var $l=w(function(NE,Ml){var th=Ve(),nh=(e,t)=>{let n=th(e,t);return n?n.version:null};Ml.exports=nh});var Ul=w(function(_E,Fl){var rh=Ve(),ih=(e,t)=>{let n=rh(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};Fl.exports=ih});var Vl=w(function(BE,ql){var jl=X(),oh=(e,t,n,r,i)=>{if(typeof n==="string")i=r,r=n,n=void 0;try{return new jl(e instanceof jl?e.version:e,n).inc(t,r,i).version}catch(o){return null}};ql.exports=oh});var Kl=w(function(DE,zl){var Hl=Ve(),sh=(e,t)=>{let n=Hl(e,null,!0),r=Hl(t,null,!0),i=n.compare(r);if(i===0)return null;let o=i>0,s=o?n:r,a=o?r:n,l=!!s.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=l?"pre":"";if(n.major!==r.major)return d+"major";if(n.minor!==r.minor)return d+"minor";if(n.patch!==r.patch)return d+"patch";return"prerelease"};zl.exports=sh});var Wl=w(function(LE,Gl){var ah=X(),lh=(e,t)=>new ah(e,t).major;Gl.exports=lh});var Jl=w(function(ME,Yl){var ch=X(),dh=(e,t)=>new ch(e,t).minor;Yl.exports=dh});var Xl=w(function($E,Ql){var ph=X(),uh=(e,t)=>new ph(e,t).patch;Ql.exports=uh});var ec=w(function(FE,Zl){var mh=Ve(),gh=(e,t)=>{let n=mh(e,t);return n&&n.prerelease.length?n.prerelease:null};Zl.exports=gh});var pe=w(function(UE,nc){var tc=X(),fh=(e,t,n)=>new tc(e,n).compare(new tc(t,n));nc.exports=fh});var ic=w(function(jE,rc){var hh=pe(),yh=(e,t,n)=>hh(t,e,n);rc.exports=yh});var sc=w(function(qE,oc){var bh=pe(),vh=(e,t)=>bh(e,t,!0);oc.exports=vh});var gr=w(function(VE,lc){var ac=X(),kh=(e,t,n)=>{let r=new ac(e,n),i=new ac(t,n);return r.compare(i)||r.compareBuild(i)};lc.exports=kh});var dc=w(function(HE,cc){var wh=gr(),Sh=(e,t)=>e.sort((n,r)=>wh(n,r,t));cc.exports=Sh});var uc=w(function(zE,pc){var xh=gr(),Ch=(e,t)=>e.sort((n,r)=>xh(r,n,t));pc.exports=Ch});var an=w(function(KE,mc){var Ih=pe(),Ah=(e,t,n)=>Ih(e,t,n)>0;mc.exports=Ah});var fr=w(function(GE,gc){var Rh=pe(),Ph=(e,t,n)=>Rh(e,t,n)<0;gc.exports=Ph});var mo=w(function(WE,fc){var Th=pe(),Eh=(e,t,n)=>Th(e,t,n)===0;fc.exports=Eh});var go=w(function(YE,hc){var Oh=pe(),Nh=(e,t,n)=>Oh(e,t,n)!==0;hc.exports=Nh});var hr=w(function(JE,yc){var _h=pe(),Bh=(e,t,n)=>_h(e,t,n)>=0;yc.exports=Bh});var yr=w(function(QE,bc){var Dh=pe(),Lh=(e,t,n)=>Dh(e,t,n)<=0;bc.exports=Lh});var fo=w(function(XE,vc){var Mh=mo(),$h=go(),Fh=an(),Uh=hr(),jh=fr(),qh=yr(),Vh=(e,t,n,r)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return Mh(e,n,r);case"!=":return $h(e,n,r);case">":return Fh(e,n,r);case">=":return Uh(e,n,r);case"<":return jh(e,n,r);case"<=":return qh(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}};vc.exports=Vh});var wc=w(function(ZE,kc){var Hh=X(),zh=Ve(),{safeRe:br,t:vr}=Pt(),Kh=(e,t)=>{if(e instanceof Hh)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?br[vr.COERCEFULL]:br[vr.COERCE]);else{let l=t.includePrerelease?br[vr.COERCERTLFULL]:br[vr.COERCERTL],c;while((c=l.exec(e))&&(!n||n.index+n[0].length!==e.length)){if(!n||c.index+c[0].length!==n.index+n[0].length)n=c;l.lastIndex=c.index+c[1].length+c[2].length}l.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return zh(`${r}.${i}.${o}${s}${a}`,t)};kc.exports=Kh});var Cc=w(function(eO,xc){var Gh=Ve(),Sc=Rt(),Wh=X(),Yh=(e,t,n)=>{if(!Sc.RELEASE_TYPES.includes(t))return null;let r=Jh(e,n);return r&&Qh(r,t)},Jh=(e,t)=>{let n=e instanceof Wh?e.version:e;return Gh(n,t)},Qh=(e,t)=>{if(Xh(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()},Xh=(e)=>e.startsWith("pre");xc.exports=Yh});var Rc=w(function(tO,Ac){class Ic{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 r=this.map.keys().next().value;this.delete(r)}this.map.set(e,t)}return this}}Ac.exports=Ic});var ue=w(function(nO,Oc){var Zh=/\s+/g;class ln{constructor(e,t){if(t=ty(t),e instanceof ln)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new ln(e.raw,t);if(e instanceof kr)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(Zh," "),this.set=this.raw.split("||").map((n)=>this.parseRange(n.trim())).filter((n)=>n.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter((r)=>!Tc(r[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&dy(r[0])){this.set=[r];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 n=0;n<t.length;n++){if(n>0)this.formatted+=" ";this.formatted+=t[n].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(cy,"");let n=((this.options.includePrerelease&&ay)|(this.options.loose&&ly))+":"+e,r=Pc.get(n);if(r)return r;let i=this.options.loose,o=i?oe[Z.HYPHENRANGELOOSE]:oe[Z.HYPHENRANGE];e=e.replace(o,wy(this.options.includePrerelease)),q("hyphen replace",e),e=e.replace(oe[Z.COMPARATORTRIM],iy),q("comparator trim",e),e=e.replace(oe[Z.TILDETRIM],oy),q("tilde trim",e),e=e.replace(oe[Z.CARETTRIM],sy),q("caret trim",e);let s=e.split(" ").map((d)=>py(d,this.options)).join(" ").split(/\s+/).map((d)=>ky(d,this.options));if(i)s=s.filter((d)=>(q("loose invalid filter",d,this.options),!!d.match(oe[Z.COMPARATORLOOSE])));q("range list",s);let a=new Map,l=s.map((d)=>new kr(d,this.options));for(let d of l){if(Tc(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let c=[...a.values()];return Pc.set(n,c),c}intersects(e,t){if(!(e instanceof ln))throw TypeError("a Range is required");return this.set.some((n)=>Ec(n,t)&&e.set.some((r)=>Ec(r,t)&&n.every((i)=>r.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new ny(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Sy(this.set[t],e,this.options))return!0;return!1}}Oc.exports=ln;var ey=Rc(),Pc=new ey,ty=cr(),kr=cn(),q=sn(),ny=X(),{safeRe:oe,src:ry,t:Z,comparatorTrimReplace:iy,tildeTrimReplace:oy,caretTrimReplace:sy}=Pt(),{FLAG_INCLUDE_PRERELEASE:ay,FLAG_LOOSE:ly}=Rt(),cy=new RegExp(ry[Z.BUILD],"g"),Tc=(e)=>e.value==="<0.0.0-0",dy=(e)=>e.value==="",Ec=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();while(n&&r.length)n=r.every((o)=>i.intersects(o,t)),i=r.pop();return n},py=(e,t)=>(e=e.replace(oe[Z.BUILD],""),q("comp",e,t),e=fy(e,t),q("caret",e),e=my(e,t),q("tildes",e),e=yy(e,t),q("xrange",e),e=vy(e,t),q("stars",e),e),G=(e)=>!e||e.toLowerCase()==="x"||e==="*",uy=(e,t,n)=>G(e)&&!G(t)||G(t)&&n&&!G(n),my=(e,t)=>e.trim().split(/\s+/).map((n)=>gy(n,t)).join(" "),gy=(e,t)=>{let n=t.loose?oe[Z.TILDELOOSE]:oe[Z.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,a,l)=>{q("tilde",e,i,o,s,a,l);let c;if(G(o))c="";else if(G(s))c=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(G(a))c=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`;else if(l)q("replaceTilde pr",l),c=`>=${o}.${s}.${a}-${l} <${o}.${+s+1}.0-0`;else c=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return q("tilde return",c),c})},fy=(e,t)=>e.trim().split(/\s+/).map((n)=>hy(n,t)).join(" "),hy=(e,t)=>{q("caret",e,t);let n=t.loose?oe[Z.CARETLOOSE]:oe[Z.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,a,l)=>{q("caret",e,i,o,s,a,l);let c;if(G(o))c="";else if(G(s))c=`>=${o}.0.0${r} <${+o+1}.0.0-0`;else if(G(a))if(o==="0")c=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`;else c=`>=${o}.${s}.0${r} <${+o+1}.0.0-0`;else if(l)if(q("replaceCaret pr",l),o==="0")if(s==="0")c=`>=${o}.${s}.${a}-${l} <${o}.${s}.${+a+1}-0`;else c=`>=${o}.${s}.${a}-${l} <${o}.${+s+1}.0-0`;else c=`>=${o}.${s}.${a}-${l} <${+o+1}.0.0-0`;else if(q("no pr"),o==="0")if(s==="0")c=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else c=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return q("caret return",c),c})},yy=(e,t)=>(q("replaceXRanges",e,t),e.split(/\s+/).map((n)=>by(n,t)).join(" ")),by=(e,t)=>{e=e.trim();let n=t.loose?oe[Z.XRANGELOOSE]:oe[Z.XRANGE];return e.replace(n,(r,i,o,s,a,l)=>{if(q("xRange",e,r,i,o,s,a,l),uy(o,s,a))return e;let c=G(o),d=c||G(s),p=d||G(a),m=p;if(i==="="&&m)i="";if(l=t.includePrerelease?"-0":"",c)if(i===">"||i==="<")r="<0.0.0-0";else r="*";else if(i&&m){if(d)s=0;if(a=0,i===">")if(i=">=",d)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",d)o=+o+1;else s=+s+1;if(i==="<")l="-0";r=`${i+o}.${s}.${a}${l}`}else if(d)r=`>=${o}.0.0${l} <${+o+1}.0.0-0`;else if(p)r=`>=${o}.${s}.0${l} <${o}.${+s+1}.0-0`;return q("xRange return",r),r})},vy=(e,t)=>(q("replaceStars",e,t),e.trim().replace(oe[Z.STAR],"")),ky=(e,t)=>(q("replaceGTE0",e,t),e.trim().replace(oe[t.includePrerelease?Z.GTE0PRE:Z.GTE0],"")),wy=(e)=>(t,n,r,i,o,s,a,l,c,d,p,m)=>{if(G(r))n="";else if(G(i))n=`>=${r}.0.0${e?"-0":""}`;else if(G(o))n=`>=${r}.${i}.0${e?"-0":""}`;else if(s)n=`>=${n}`;else n=`>=${n}${e?"-0":""}`;if(G(c))l="";else if(G(d))l=`<${+c+1}.0.0-0`;else if(G(p))l=`<${c}.${+d+1}.0-0`;else if(m)l=`<=${c}.${d}.${p}-${m}`;else if(e)l=`<${c}.${d}.${+p+1}-0`;else l=`<=${l}`;return`${n} ${l}`.trim()},Sy=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let r=0;r<e.length;r++){if(q(e[r].semver),e[r].semver===kr.ANY)continue;if(e[r].semver.prerelease.length>0){let i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var cn=w(function(rO,Mc){var dn=Symbol("SemVer ANY");class wr{static get ANY(){return dn}constructor(e,t){if(t=Nc(t),e instanceof wr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),yo("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===dn)this.value="";else this.value=this.operator+this.semver.version;yo("comp",this)}parse(e){let t=this.options.loose?_c[Bc.COMPARATORLOOSE]:_c[Bc.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=n[1]!==void 0?n[1]:"",this.operator==="=")this.operator="";if(!n[2])this.semver=dn;else this.semver=new Dc(n[2],this.options.loose)}toString(){return this.value}test(e){if(yo("Comparator.test",e,this.options.loose),this.semver===dn||e===dn)return!0;if(typeof e==="string")try{e=new Dc(e,this.options)}catch(t){return!1}return ho(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof wr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Lc(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Lc(this.value,t).test(e.semver)}if(t=Nc(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(ho(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(ho(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Mc.exports=wr;var Nc=cr(),{safeRe:_c,t:Bc}=Pt(),ho=fo(),yo=sn(),Dc=X(),Lc=ue()});var pn=w(function(iO,$c){var xy=ue(),Cy=(e,t,n)=>{try{t=new xy(t,n)}catch(r){return!1}return t.test(e)};$c.exports=Cy});var Uc=w(function(oO,Fc){var Iy=ue(),Ay=(e,t)=>new Iy(e,t).set.map((n)=>n.map((r)=>r.value).join(" ").trim().split(" "));Fc.exports=Ay});var qc=w(function(sO,jc){var Ry=X(),Py=ue(),Ty=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Py(t,n)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!r||i.compare(s)===-1)r=s,i=new Ry(r,n)}}),r};jc.exports=Ty});var Hc=w(function(aO,Vc){var Ey=X(),Oy=ue(),Ny=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Oy(t,n)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!r||i.compare(s)===1)r=s,i=new Ey(r,n)}}),r};Vc.exports=Ny});var Gc=w(function(lO,Kc){var bo=X(),_y=ue(),zc=an(),By=(e,t)=>{e=new _y(e,t);let n=new bo("0.0.0");if(e.test(n))return n;if(n=new bo("0.0.0-0"),e.test(n))return n;n=null;for(let r=0;r<e.set.length;++r){let i=e.set[r],o=null;if(i.forEach((s)=>{let a=new bo(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||zc(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||zc(n,o)))n=o}if(n&&e.test(n))return n;return null};Kc.exports=By});var Yc=w(function(cO,Wc){var Dy=ue(),Ly=(e,t)=>{try{return new Dy(e,t).range||"*"}catch(n){return null}};Wc.exports=Ly});var Sr=w(function(dO,Zc){var My=X(),Xc=cn(),{ANY:$y}=Xc,Fy=ue(),Uy=pn(),Jc=an(),Qc=fr(),jy=yr(),qy=hr(),Vy=(e,t,n,r)=>{e=new My(e,r),t=new Fy(t,r);let i,o,s,a,l;switch(n){case">":i=Jc,o=jy,s=Qc,a=">",l=">=";break;case"<":i=Qc,o=qy,s=Jc,a="<",l="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Uy(e,t,r))return!1;for(let c=0;c<t.set.length;++c){let d=t.set[c],p=null,m=null;if(d.forEach((u)=>{if(u.semver===$y)u=new Xc(">=0.0.0");if(p=p||u,m=m||u,i(u.semver,p.semver,r))p=u;else if(s(u.semver,m.semver,r))m=u}),p.operator===a||p.operator===l)return!1;if((!m.operator||m.operator===a)&&o(e,m.semver))return!1;else if(m.operator===l&&s(e,m.semver))return!1}return!0};Zc.exports=Vy});var td=w(function(pO,ed){var Hy=Sr(),zy=(e,t,n)=>Hy(e,t,">",n);ed.exports=zy});var rd=w(function(uO,nd){var Ky=Sr(),Gy=(e,t,n)=>Ky(e,t,"<",n);nd.exports=Gy});var sd=w(function(mO,od){var id=ue(),Wy=(e,t,n)=>(e=new id(e,n),t=new id(t,n),e.intersects(t,n));od.exports=Wy});var ld=w(function(gO,ad){var Yy=pn(),Jy=pe();ad.exports=(e,t,n)=>{let r=[],i=null,o=null,s=e.sort((d,p)=>Jy(d,p,n));for(let d of s)if(Yy(d,t,n)){if(o=d,!i)i=d}else{if(o)r.push([i,o]);o=null,i=null}if(i)r.push([i,null]);let a=[];for(let[d,p]of r)if(d===p)a.push(d);else if(!p&&d===s[0])a.push("*");else if(!p)a.push(`>=${d}`);else if(d===s[0])a.push(`<=${p}`);else a.push(`${d} - ${p}`);let l=a.join(" || "),c=typeof t.raw==="string"?t.raw:String(t);return l.length<c.length?l:t}});var gd=w(function(fO,md){var cd=ue(),wo=cn(),{ANY:vo}=wo,ko=pn(),So=pe(),Qy=(e,t,n={})=>{if(e===t)return!0;e=new cd(e,n),t=new cd(t,n);let r=!1;e:for(let i of e.set){for(let o of t.set){let s=Zy(i,o,n);if(r=r||s!==null,s)continue e}if(r)return!1}return!0},Xy=[new wo(">=0.0.0-0")],dd=[new wo(">=0.0.0")],Zy=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vo)if(t.length===1&&t[0].semver===vo)return!0;else if(n.includePrerelease)e=Xy;else e=dd;if(t.length===1&&t[0].semver===vo)if(n.includePrerelease)return!0;else t=dd;let r=new Set,i,o;for(let u of e)if(u.operator===">"||u.operator===">=")i=pd(i,u,n);else if(u.operator==="<"||u.operator==="<=")o=ud(o,u,n);else r.add(u.semver);if(r.size>1)return null;let s;if(i&&o){if(s=So(i.semver,o.semver,n),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let u of r){if(i&&!ko(u,String(i),n))return null;if(o&&!ko(u,String(o),n))return null;for(let f of t)if(!ko(u,String(f),n))return!1;return!0}let a,l,c,d,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0)p=!1;for(let u of t){if(d=d||u.operator===">"||u.operator===">=",c=c||u.operator==="<"||u.operator==="<=",i){if(m){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===m.major&&u.semver.minor===m.minor&&u.semver.patch===m.patch)m=!1}if(u.operator===">"||u.operator===">="){if(a=pd(i,u,n),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(o){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(l=ud(o,u,n),l===u&&l!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||i)&&s!==0)return!1}if(i&&c&&!o&&s!==0)return!1;if(o&&d&&!i&&s!==0)return!1;if(m||p)return!1;return!0},pd=(e,t,n)=>{if(!e)return t;let r=So(e.semver,t.semver,n);return r>0?e:r<0?t:t.operator===">"&&e.operator===">="?t:e},ud=(e,t,n)=>{if(!e)return t;let r=So(e.semver,t.semver,n);return r<0?e:r>0?t:t.operator==="<"&&e.operator==="<="?t:e};md.exports=Qy});var hd=w(function(hO,fd){var Tt=Pt(),xr=Rt(),eb=X(),Cr=po(),tb=Ve(),nb=$l(),rb=Ul(),ib=Vl(),ob=Kl(),sb=Wl(),ab=Jl(),lb=Xl(),cb=ec(),db=pe(),pb=ic(),ub=sc(),mb=gr(),gb=dc(),fb=uc(),hb=an(),yb=fr(),bb=mo(),vb=go(),kb=hr(),wb=yr(),Sb=fo(),xb=wc(),Cb=Cc(),Ib=cn(),Ab=ue(),Rb=pn(),Pb=Uc(),Tb=qc(),Eb=Hc(),Ob=Gc(),Nb=Yc(),_b=Sr(),Bb=td(),Db=rd(),Lb=sd(),Mb=ld(),$b=gd();fd.exports={parse:tb,valid:nb,clean:rb,inc:ib,diff:ob,major:sb,minor:ab,patch:lb,prerelease:cb,compare:db,rcompare:pb,compareLoose:ub,compareBuild:mb,sort:gb,rsort:fb,gt:hb,lt:yb,eq:bb,neq:vb,gte:kb,lte:wb,cmp:Sb,coerce:xb,truncate:Cb,Comparator:Ib,Range:Ab,satisfies:Rb,toComparators:Pb,maxSatisfying:Tb,minSatisfying:Eb,minVersion:Ob,validRange:Nb,outside:_b,gtr:Bb,ltr:Db,intersects:Lb,simplifyRange:Mb,subset:$b,SemVer:eb,re:Tt.re,src:Tt.src,tokens:Tt.t,SEMVER_SPEC_VERSION:xr.SEMVER_SPEC_VERSION,RELEASE_TYPES:xr.RELEASE_TYPES,compareIdentifiers:Cr.compareIdentifiers,rcompareIdentifiers:Cr.rcompareIdentifiers}});var M=w(function(kv){var Ho=Symbol.for("yaml.alias"),Wd=Symbol.for("yaml.document"),_r=Symbol.for("yaml.map"),Yd=Symbol.for("yaml.pair"),zo=Symbol.for("yaml.scalar"),Br=Symbol.for("yaml.seq"),Le=Symbol.for("yaml.node.type"),mv=(e)=>!!e&&typeof e==="object"&&e[Le]===Ho,gv=(e)=>!!e&&typeof e==="object"&&e[Le]===Wd,fv=(e)=>!!e&&typeof e==="object"&&e[Le]===_r,hv=(e)=>!!e&&typeof e==="object"&&e[Le]===Yd,Jd=(e)=>!!e&&typeof e==="object"&&e[Le]===zo,yv=(e)=>!!e&&typeof e==="object"&&e[Le]===Br;function Qd(e){if(e&&typeof e==="object")switch(e[Le]){case _r:case Br:return!0}return!1}function bv(e){if(e&&typeof e==="object")switch(e[Le]){case Ho:case _r:case zo:case Br:return!0}return!1}var vv=(e)=>(Jd(e)||Qd(e))&&!!e.anchor;kv.ALIAS=Ho;kv.DOC=Wd;kv.MAP=_r;kv.NODE_TYPE=Le;kv.PAIR=Yd;kv.SCALAR=zo;kv.SEQ=Br;kv.hasAnchor=vv;kv.isAlias=mv;kv.isCollection=Qd;kv.isDocument=gv;kv.isMap=fv;kv.isNode=bv;kv.isPair=hv;kv.isScalar=Jd;kv.isSeq=yv});var vn=w(function(Mv){var Y=M(),ae=Symbol("break visit"),Xd=Symbol("skip children"),Oe=Symbol("remove node");function Dr(e,t){let n=Zd(t);if(Y.isDocument(e)){if(_t(null,e.contents,n,Object.freeze([e]))===Oe)e.contents=null}else _t(null,e,n,Object.freeze([]))}Dr.BREAK=ae;Dr.SKIP=Xd;Dr.REMOVE=Oe;function _t(e,t,n,r){let i=ep(e,t,n,r);if(Y.isNode(i)||Y.isPair(i))return tp(e,r,i),_t(e,i,n,r);if(typeof i!=="symbol"){if(Y.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=_t(o,t.items[o],n,r);if(typeof s==="number")o=s-1;else if(s===ae)return ae;else if(s===Oe)t.items.splice(o,1),o-=1}}else if(Y.isPair(t)){r=Object.freeze(r.concat(t));let o=_t("key",t.key,n,r);if(o===ae)return ae;else if(o===Oe)t.key=null;let s=_t("value",t.value,n,r);if(s===ae)return ae;else if(s===Oe)t.value=null}}return i}async function Lr(e,t){let n=Zd(t);if(Y.isDocument(e)){if(await Bt(null,e.contents,n,Object.freeze([e]))===Oe)e.contents=null}else await Bt(null,e,n,Object.freeze([]))}Lr.BREAK=ae;Lr.SKIP=Xd;Lr.REMOVE=Oe;async function Bt(e,t,n,r){let i=await ep(e,t,n,r);if(Y.isNode(i)||Y.isPair(i))return tp(e,r,i),Bt(e,i,n,r);if(typeof i!=="symbol"){if(Y.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=await Bt(o,t.items[o],n,r);if(typeof s==="number")o=s-1;else if(s===ae)return ae;else if(s===Oe)t.items.splice(o,1),o-=1}}else if(Y.isPair(t)){r=Object.freeze(r.concat(t));let o=await Bt("key",t.key,n,r);if(o===ae)return ae;else if(o===Oe)t.key=null;let s=await Bt("value",t.value,n,r);if(s===ae)return ae;else if(s===Oe)t.value=null}}return i}function Zd(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 ep(e,t,n,r){if(typeof n==="function")return n(e,t,r);if(Y.isMap(t))return n.Map?.(e,t,r);if(Y.isSeq(t))return n.Seq?.(e,t,r);if(Y.isPair(t))return n.Pair?.(e,t,r);if(Y.isScalar(t))return n.Scalar?.(e,t,r);if(Y.isAlias(t))return n.Alias?.(e,t,r);return}function tp(e,t,n){let r=t[t.length-1];if(Y.isCollection(r))r.items[e]=n;else if(Y.isPair(r))if(e==="key")r.key=n;else r.value=n;else if(Y.isDocument(r))r.contents=n;else{let i=Y.isAlias(r)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Mv.visit=Dr;Mv.visitAsync=Lr});var Ko=w(function(Vv){var np=M(),Uv=vn(),jv={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},qv=(e)=>e.replace(/[!,[\]{}]/g,(t)=>jv[t]);class fe{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},fe.defaultYaml,e),this.tags=Object.assign({},fe.defaultTags,t)}clone(){let e=new fe(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new fe(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:fe.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},fe.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:fe.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},fe.defaultTags),this.atNextDocument=!1;let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(n.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),n.length<2)return!1}let[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;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 ${r}`,!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[,n,r]=e.match(/^(.*!)([^!]*)$/s);if(!r)t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(o){return t(String(o)),null}if(n==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+qv(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&np.isNode(e.contents)){let i={};Uv.visit(e.contents,(o,s)=>{if(np.isNode(s)&&s.tag)i[s.tag]=!0}),r=Object.keys(i)}else r=[];for(let[i,o]of n){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||r.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
2
+ `)}}fe.defaultYaml={explicit:!1,version:"1.2"};fe.defaultTags={"!!":"tag:yaml.org,2002:"};Vv.Directives=fe});var Mr=w(function(Wv){var rp=M(),zv=vn();function Kv(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(n)}return!0}function ip(e){let t=new Set;return zv.visit(e,{Value(n,r){if(r.anchor)t.add(r.anchor)}}),t}function op(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Gv(e,t){let n=[],r=new Map,i=null;return{onAnchor:(o)=>{n.push(o),i??(i=ip(e));let s=op(t,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s==="object"&&s.anchor&&(rp.isScalar(s.node)||rp.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:r}}Wv.anchorIsValid=Kv;Wv.anchorNames=ip;Wv.createNodeAnchors=Gv;Wv.findNewAnchor=op});var Go=w(function(Zv){function kn(e,t,n,r){if(r&&typeof r==="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=kn(e,r,String(i),s);if(a===void 0)delete r[i];else if(a!==s)r[i]=a}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=kn(e,r,i,o);if(s===void 0)r.delete(i);else if(s!==o)r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=kn(e,r,i,i);if(o===void 0)r.delete(i);else if(o!==i)r.delete(i),r.add(o)}else for(let[i,o]of Object.entries(r)){let s=kn(e,r,i,o);if(s===void 0)delete r[i];else if(s!==o)r[i]=s}return e.call(t,n,r)}Zv.applyReviver=kn});var Ke=w(function(nk){var tk=M();function sp(e,t,n){if(Array.isArray(e))return e.map((r,i)=>sp(r,String(i),n));if(e&&typeof e.toJSON==="function"){if(!n||!tk.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=(o)=>{r.res=o,delete n.onCreate};let i=e.toJSON(t,n);if(n.onCreate)n.onCreate(i);return i}if(typeof e==="bigint"&&!n?.keep)return Number(e);return e}nk.toJS=sp});var $r=w(function(sk){var ik=Go(),ap=M(),ok=Ke();class lp{constructor(e){Object.defineProperty(this,ap.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:n,onAnchor:r,reviver:i}={}){if(!ap.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 n==="number"?n:100},s=ok.toJS(this,"",o);if(typeof r==="function")for(let{count:a,res:l}of o.anchors.values())r(l,a);return typeof i==="function"?ik.applyReviver(i,{"":s},"",s):s}}sk.NodeBase=lp});var wn=w(function(uk){var lk=Mr(),ck=vn(),Dt=M(),dk=$r(),pk=Ke();class cp extends dk.NodeBase{constructor(e){super(Dt.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 n;if(t?.aliasResolveCache)n=t.aliasResolveCache;else if(n=[],ck.visit(e,{Node:(i,o)=>{if(Dt.isAlias(o)||Dt.hasAnchor(o))n.push(o)}}),t)t.aliasResolveCache=n;let r=void 0;for(let i of n){if(i===this)break;if(i.anchor===this.source)r=i}if(r&&t){let{anchors:i,doc:o,maxAliasCount:s}=t,a=i.get(r);if(!a)pk.toJS(r,null,t),a=i.get(r);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=Fr(o,r,i);if(a.count*a.aliasCount>s)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(r)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(lk.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`${r} `}return r}}function Fr(e,t,n){if(Dt.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Dt.isCollection(t)){let r=0;for(let i of t.items){let o=Fr(e,i,n);if(o>r)r=o}return r}else if(Dt.isPair(t)){let r=Fr(e,t.key,n),i=Fr(e,t.value,n);return Math.max(r,i)}return 1}uk.Alias=cp});var z=w(function(bk){var gk=M(),fk=$r(),hk=Ke(),yk=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class ft extends fk.NodeBase{constructor(e){super(gk.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:hk.toJS(this.value,e,t)}toString(){return String(this.value)}}ft.BLOCK_FOLDED="BLOCK_FOLDED";ft.BLOCK_LITERAL="BLOCK_LITERAL";ft.PLAIN="PLAIN";ft.QUOTE_DOUBLE="QUOTE_DOUBLE";ft.QUOTE_SINGLE="QUOTE_SINGLE";bk.Scalar=ft;bk.isScalarValue=yk});var Sn=w(function(Ik){var wk=wn(),ht=M(),dp=z(),Sk="tag:yaml.org,2002:";function xk(e,t,n){if(t){let r=n.filter((o)=>o.tag===t),i=r.find((o)=>!o.format)??r[0];if(!i)throw Error(`Tag ${t} not found`);return i}return n.find((r)=>r.identify?.(e)&&!r.format)}function Ck(e,t,n){if(ht.isDocument(e))e=e.contents;if(ht.isNode(e))return e;if(ht.isPair(e)){let p=n.schema[ht.MAP].createNode?.(n.schema,null,n);return p.items.push(e),p}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,l=void 0;if(r&&e&&typeof e==="object")if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new wk.Alias(l.anchor);else l={anchor:null,node:null},a.set(e,l);if(t?.startsWith("!!"))t=Sk+t.slice(2);let c=xk(e,t,s.tags);if(!c){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let p=new dp.Scalar(e);if(l)l.node=p;return p}c=e instanceof Map?s[ht.MAP]:(Symbol.iterator in Object(e))?s[ht.SEQ]:s[ht.MAP]}if(o)o(c),delete n.onTagObj;let d=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from==="function"?c.nodeClass.from(n.schema,e,n):new dp.Scalar(e);if(t)d.tag=t;else if(!c.default)d.tag=c.tag;if(l)l.node=d;return d}Ik.createNode=Ck});var Ur=w(function(Tk){var Rk=Sn(),Ne=M(),Pk=$r();function Wo(e,t,n){let r=n;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]=r,r=s}else r=new Map([[o,r]])}return Rk.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var pp=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class up extends Pk.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((n)=>Ne.isNode(n)||Ne.isPair(n)?n.clone(e):n),this.range)t.range=this.range.slice();return t}addIn(e,t){if(pp(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Ne.isCollection(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Wo(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Ne.isCollection(r))return r.deleteIn(n);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);if(r.length===0)return!t&&Ne.isScalar(i)?i.value:i;else return Ne.isCollection(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!Ne.isPair(t))return!1;let n=t.value;return n==null||e&&Ne.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Ne.isCollection(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let i=this.get(n,!0);if(Ne.isCollection(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(n,Wo(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}}Tk.Collection=up;Tk.collectionFromPath=Wo;Tk.isEmptyPath=pp});var xn=w(function(Dk){var _k=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Yo(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var Bk=(e,t,n)=>e.endsWith(`
3
+ `)?Yo(n,t):n.includes(`
4
4
  `)?`
5
- `+Mn(r,t):(e.endsWith(" ")?"":" ")+r;lm.indentComment=Mn;lm.lineComment=cm;lm.stringifyComment=am});var _a=h(function(fm){function gm(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;if(i<s)s=0;let c=Math.max(1+s,1+i-t.length);if(e.length<=c)return e;let l=[],d={},g=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,s))l.push(0);else g=i-n;let p=void 0,u=void 0,m=!1,f=-1,y=-1,S=-1;if(r==="block"){if(f=Na(e,f,t.length),f!==-1)g=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}S=f}if(k===`
6
- `){if(r==="block")f=Na(e,f,t.length);g=f+t.length+c,p=void 0}else{if(k===" "&&u&&u!==" "&&u!==`
7
- `&&u!=="\t"){let R=e[f+1];if(R&&R!==" "&&R!==`
8
- `&&R!=="\t")p=f}if(f>=g)if(p)l.push(p),g=p+c,p=void 0;else if(r==="quoted"){while(u===" "||u==="\t")u=k,k=e[f+=1],m=!0;let R=f>S+1?f-2:y-1;if(d[R])return e;l.push(R),d[R]=!0,g=R+c,p=void 0}else m=!0}u=k}if(m&&a)a();if(l.length===0)return e;if(o)o();let C=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)C=`
9
- ${t}${e.slice(0,x)}`;else{if(r==="quoted"&&d[R])C+=`${e[R]}\\`;C+=`
10
- ${t}${e.slice(R+1,x)}`}}return C}function Na(e,t,r){let n=t,i=t+1,s=e[i];while(s===" "||s==="\t")if(t<i+r)s=e[++t];else{do s=e[++t];while(s&&s!==`
11
- `);n=t,i=t+1,s=e[i]}return n}fm.FOLD_BLOCK="block";fm.FOLD_FLOW="flow";fm.FOLD_QUOTED="quoted";fm.foldFlowLines=gm});var wt=h(function(Cm){var te=O(),ye=_a(),Sr=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),vr=(e)=>/^(%|---|\.\.\.)/m.test(e);function wm(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(e[s]===`
12
- `){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function bt(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(vr(e)?" ":""),o="",a=0;for(let c=0,l=r[c];l;l=r[++c]){if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n")o+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\";if(l==="\\")switch(r[c+1]){case"u":{o+=r.slice(a,c);let d=r.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:if(d.substr(0,2)==="00")o+="\\x"+d.substr(2);else o+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{o+=r.slice(a,c)+`
5
+ `+Yo(n,t):(e.endsWith(" ")?"":" ")+n;Dk.indentComment=Yo;Dk.lineComment=Bk;Dk.stringifyComment=_k});var gp=w(function(Uk){function Fk(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;if(i<o)o=0;let l=Math.max(1+o,1+i-t.length);if(e.length<=l)return e;let c=[],d={},p=i-t.length;if(typeof r==="number")if(r>i-Math.max(2,o))c.push(0);else p=i-r;let m=void 0,u=void 0,f=!1,g=-1,h=-1,b=-1;if(n==="block"){if(g=mp(e,g,t.length),g!==-1)p=g+l}for(let v;v=e[g+=1];){if(n==="quoted"&&v==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(v===`
6
+ `){if(n==="block")g=mp(e,g,t.length);p=g+t.length+l,m=void 0}else{if(v===" "&&u&&u!==" "&&u!==`
7
+ `&&u!=="\t"){let k=e[g+1];if(k&&k!==" "&&k!==`
8
+ `&&k!=="\t")m=g}if(g>=p)if(m)c.push(m),p=m+l,m=void 0;else if(n==="quoted"){while(u===" "||u==="\t")u=v,v=e[g+=1],f=!0;let k=g>b+1?g-2:h-1;if(d[k])return e;c.push(k),d[k]=!0,p=k+l,m=void 0}else f=!0}u=v}if(f&&a)a();if(c.length===0)return e;if(s)s();let y=e.slice(0,c[0]);for(let v=0;v<c.length;++v){let k=c[v],S=c[v+1]||e.length;if(k===0)y=`
9
+ ${t}${e.slice(0,S)}`;else{if(n==="quoted"&&d[k])y+=`${e[k]}\\`;y+=`
10
+ ${t}${e.slice(k+1,S)}`}}return y}function mp(e,t,n){let r=t,i=t+1,o=e[i];while(o===" "||o==="\t")if(t<i+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
11
+ `);r=t,i=t+1,o=e[i]}return r}Uk.FOLD_BLOCK="block";Uk.FOLD_FLOW="flow";Uk.FOLD_QUOTED="quoted";Uk.foldFlowLines=Fk});var In=w(function(Wk){var Se=z(),Ge=gp(),qr=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Vr=(e)=>/^(%|---|\.\.\.)/m.test(e);function zk(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let o=0,s=0;o<i;++o)if(e[o]===`
12
+ `){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function Cn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Vr(e)?" ":""),s="",a=0;for(let l=0,c=n[l];c;c=n[++l]){if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n")s+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\";if(c==="\\")switch(n[l+1]){case"u":{s+=n.slice(a,l);let d=n.substr(l+2,4);switch(d){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(d.substr(0,2)==="00")s+="\\x"+d.substr(2);else s+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<i)l+=1;else{s+=n.slice(a,l)+`
13
13
 
14
- `;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')o+=`
15
- `,c+=2;if(o+=s,r[c+2]===" ")o+="\\";c+=1,a=c+1}break;default:c+=1}}return o=a?o+r.slice(a):r,n?o:ye.foldFlowLines(o,s,ye.FOLD_QUOTED,Sr(t,!1))}function $n(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test(e))return bt(e,t);let r=t.indent||(vr(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${r}`)+"'";return t.implicitKey?n:ye.foldFlowLines(n,r,ye.FOLD_FLOW,Sr(t,!1))}function ze(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=bt;else{let i=e.includes('"'),s=e.includes("'");if(i&&!s)n=$n;else if(s&&!i)n=bt;else n=r?$n:bt}return n(e,t)}var Bn;try{Bn=new RegExp(`(^|(?<!
14
+ `;while(n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"')s+=`
15
+ `,l+=2;if(s+=o,n[l+2]===" ")s+="\\";l+=1,a=l+1}break;default:l+=1}}return s=a?s+n.slice(a):n,r?s:Ge.foldFlowLines(s,o,Ge.FOLD_QUOTED,qr(t,!1))}function Jo(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Cn(e,t);let n=t.indent||(Vr(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${n}`)+"'";return t.implicitKey?r:Ge.foldFlowLines(r,n,Ge.FOLD_FLOW,qr(t,!1))}function Lt(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Cn;else{let i=e.includes('"'),o=e.includes("'");if(i&&!o)r=Jo;else if(o&&!i)r=Cn;else r=n?Jo:Cn}return r(e,t)}var Qo;try{Qo=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{Bn=/\n+(?!\n|$)/g}function wr({comment:e,type:t,value:r},n,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(r))return ze(r,n);let l=n.indent||(n.forceBlockIndent||vr(r)?" ":""),d=o==="literal"?!0:o==="folded"||t===te.Scalar.BLOCK_FOLDED?!1:t===te.Scalar.BLOCK_LITERAL?!0:!wm(r,c,l.length);if(!r)return d?`|
20
+ |$)`,"g")}catch{Qo=/\n+(?!\n|$)/g}function jr({comment:e,type:t,value:n},r,i,o){let{blockQuote:s,commentString:a,lineWidth:l}=r.options;if(!s||/\n[\t ]+$/.test(n))return Lt(n,r);let c=r.indent||(r.forceBlockIndent||Vr(n)?" ":""),d=s==="literal"?!0:s==="folded"||t===Se.Scalar.BLOCK_FOLDED?!1:t===Se.Scalar.BLOCK_LITERAL?!0:!zk(n,l,c.length);if(!n)return d?`|
21
21
  `:`>
22
- `;let g,p;for(p=r.length;p>0;--p){let x=r[p-1];if(x!==`
23
- `&&x!=="\t"&&x!==" ")break}let u=r.substring(p),m=u.indexOf(`
24
- `);if(m===-1)g="-";else if(r===u||m!==u.length-1){if(g="+",s)s()}else g="";if(u){if(r=r.slice(0,-u.length),u[u.length-1]===`
25
- `)u=u.slice(0,-1);u=u.replace(Bn,`$&${l}`)}let f=!1,y,S=-1;for(y=0;y<r.length;++y){let x=r[y];if(x===" ")f=!0;else if(x===`
26
- `)S=y;else break}let C=r.substring(0,S<y?S+1:y);if(C)r=r.substring(C.length),C=C.replace(/\n+/g,`$&${l}`);let R=(f?l?"2":"1":"")+g;if(e){if(R+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!d){let x=r.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),A=!1,P=Sr(n,!0);if(o!=="folded"&&t!==te.Scalar.BLOCK_FOLDED)P.onOverflow=()=>{A=!0};let v=ye.foldFlowLines(`${C}${x}${u}`,l,ye.FOLD_BLOCK,P);if(!A)return`>${R}
28
- ${l}${v}`}return r=r.replace(/\n+/g,`$&${l}`),`|${R}
29
- ${l}${C}${r}${u}`}function Sm(e,t,r,n){let{type:i,value:s}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=t;if(a&&s.includes(`
30
- `)||d&&/[[\]{},]/.test(s))return ze(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||d||!s.includes(`
31
- `)?ze(s,t):wr(e,t,r,n);if(!a&&!d&&i!==te.Scalar.PLAIN&&s.includes(`
32
- `))return wr(e,t,r,n);if(vr(s)){if(c==="")return t.forceBlockIndent=!0,wr(e,t,r,n);else if(a&&c===l)return ze(s,t)}let g=s.replace(/\n+/g,`$&
33
- ${c}`);if(o){let p=(f)=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(g),{compat:u,tags:m}=t.doc.schema;if(m.some(p)||u?.some(p))return ze(s,t)}return a?g:ye.foldFlowLines(g,c,ye.FOLD_FLOW,Sr(t,!1))}function vm(e,t,r,n){let{implicitKey:i,inFlow:s}=t,o=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==te.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value))a=te.Scalar.QUOTE_DOUBLE}let c=(d)=>{switch(d){case te.Scalar.BLOCK_FOLDED:case te.Scalar.BLOCK_LITERAL:return i||s?ze(o.value,t):wr(o,t,r,n);case te.Scalar.QUOTE_DOUBLE:return bt(o.value,t);case te.Scalar.QUOTE_SINGLE:return $n(o.value,t);case te.Scalar.PLAIN:return Sm(o,t,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:d,defaultStringType:g}=t.options,p=i&&d||g;if(l=c(p),l===null)throw Error(`Unsupported default string type ${p}`)}return l}Cm.stringifyString=vm});var St=h(function(Om){var Rm=mr(),he=E(),xm=ht(),Im=wt();function Am(e,t){let r=Object.assign({blockQuote:!0,commentString:xm.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 Em(e,t){if(t.tag){let i=e.filter((s)=>s.tag===t.tag);if(i.length>0)return i.find((s)=>s.format===t.format)??i[0]}let r=void 0,n;if(he.isScalar(t)){n=t.value;let i=e.filter((s)=>s.identify?.(n));if(i.length>1){let s=i.filter((o)=>o.test);if(s.length>0)i=s}r=i.find((s)=>s.format===t.format)??i.find((s)=>!s.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 Pm(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(he.isScalar(e)||he.isCollection(e))&&e.anchor;if(s&&Rm.anchorIsValid(s))r.add(s),i.push(`&${s}`);let o=e.tag??(t.default?null:t.tag);if(o)i.push(n.directives.tagString(o));return i.join(" ")}function Tm(e,t,r,n){if(he.isPair(e))return e.toString(t,r,n);if(he.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,s=he.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>i=c});i??(i=Em(t.doc.schema.tags,s));let o=Pm(s,i,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;let a=typeof i.stringify==="function"?i.stringify(s,t,r,n):he.isScalar(s)?Im.stringifyString(s,t,r,n):s.toString(t,r,n);if(!o)return a;return he.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
- ${t.indent}${a}`}Om.createStringifyContext=Am;Om.stringify=Tm});var Ba=h(function(_m){var ue=E(),Ma=O(),$a=St(),vt=ht();function Nm({key:e,value:t},r,n,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:g}}=r,p=ue.isNode(e)&&e.comment||null;if(g){if(p)throw Error("With simple keys, key nodes cannot have comments");if(ue.isCollection(e)||!ue.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let u=!g&&(!e||p&&t==null&&!r.inFlow||ue.isCollection(e)||(ue.isScalar(e)?e.type===Ma.Scalar.BLOCK_FOLDED||e.type===Ma.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!u&&(g||!s),indent:a+c});let m=!1,f=!1,y=$a.stringify(e,r,()=>m=!0,()=>f=!0);if(!u&&!r.inFlow&&y.length>1024){if(g)throw Error("With simple keys, single line scalar must not span more than 1024 characters");u=!0}if(r.inFlow){if(s||t==null){if(m&&n)n();return y===""?"?":u?`? ${y}`:y}}else if(s&&!g||t==null&&u){if(y=`? ${y}`,p&&!m)y+=vt.lineComment(y,r.indent,l(p));else if(f&&i)i();return y}if(m)p=null;if(u){if(p)y+=vt.lineComment(y,r.indent,l(p));y=`? ${y}
35
- ${a}:`}else if(y=`${y}:`,p)y+=vt.lineComment(y,r.indent,l(p));let S,C,k;if(ue.isNode(t))S=!!t.spaceBefore,C=t.commentBefore,k=t.comment;else if(S=!1,C=null,k=null,t&&typeof t==="object")t=o.createNode(t);if(r.implicitKey=!1,!u&&!p&&ue.isScalar(t))r.indentAtStart=y.length+1;if(f=!1,!d&&c.length>=2&&!r.inFlow&&!u&&ue.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let R=!1,x=$a.stringify(t,r,()=>R=!0,()=>f=!0),A=" ";if(p||S||C){if(A=S?`
36
- `:"",C){let P=l(C);A+=`
37
- ${vt.indentComment(P,r.indent)}`}if(x===""&&!r.inFlow){if(A===`
38
- `&&k)A=`
22
+ `;let p,m;for(m=n.length;m>0;--m){let S=n[m-1];if(S!==`
23
+ `&&S!=="\t"&&S!==" ")break}let u=n.substring(m),f=u.indexOf(`
24
+ `);if(f===-1)p="-";else if(n===u||f!==u.length-1){if(p="+",o)o()}else p="";if(u){if(n=n.slice(0,-u.length),u[u.length-1]===`
25
+ `)u=u.slice(0,-1);u=u.replace(Qo,`$&${c}`)}let g=!1,h,b=-1;for(h=0;h<n.length;++h){let S=n[h];if(S===" ")g=!0;else if(S===`
26
+ `)b=h;else break}let y=n.substring(0,b<h?b+1:h);if(y)n=n.substring(y.length),y=y.replace(/\n+/g,`$&${c}`);let k=(g?c?"2":"1":"")+p;if(e){if(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!d){let S=n.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),x=!1,T=qr(r,!0);if(s!=="folded"&&t!==Se.Scalar.BLOCK_FOLDED)T.onOverflow=()=>{x=!0};let C=Ge.foldFlowLines(`${y}${S}${u}`,c,Ge.FOLD_BLOCK,T);if(!x)return`>${k}
28
+ ${c}${C}`}return n=n.replace(/\n+/g,`$&${c}`),`|${k}
29
+ ${c}${y}${n}${u}`}function Kk(e,t,n,r){let{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:d}=t;if(a&&o.includes(`
30
+ `)||d&&/[[\]{},]/.test(o))return Lt(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||d||!o.includes(`
31
+ `)?Lt(o,t):jr(e,t,n,r);if(!a&&!d&&i!==Se.Scalar.PLAIN&&o.includes(`
32
+ `))return jr(e,t,n,r);if(Vr(o)){if(l==="")return t.forceBlockIndent=!0,jr(e,t,n,r);else if(a&&l===c)return Lt(o,t)}let p=o.replace(/\n+/g,`$&
33
+ ${l}`);if(s){let m=(g)=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(p),{compat:u,tags:f}=t.doc.schema;if(f.some(m)||u?.some(m))return Lt(o,t)}return a?p:Ge.foldFlowLines(p,l,Ge.FOLD_FLOW,qr(t,!1))}function Gk(e,t,n,r){let{implicitKey:i,inFlow:o}=t,s=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==Se.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value))a=Se.Scalar.QUOTE_DOUBLE}let l=(d)=>{switch(d){case Se.Scalar.BLOCK_FOLDED:case Se.Scalar.BLOCK_LITERAL:return i||o?Lt(s.value,t):jr(s,t,n,r);case Se.Scalar.QUOTE_DOUBLE:return Cn(s.value,t);case Se.Scalar.QUOTE_SINGLE:return Jo(s.value,t);case Se.Scalar.PLAIN:return Kk(s,t,n,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:p}=t.options,m=i&&d||p;if(c=l(m),c===null)throw Error(`Unsupported default string type ${m}`)}return c}Wk.stringifyString=Gk});var An=w(function(rw){var Jk=Mr(),We=M(),Qk=xn(),Xk=In();function Zk(e,t){let n=Object.assign({blockQuote:!0,commentString:Qk.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),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent==="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function ew(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 n=void 0,r;if(We.isScalar(t)){r=t.value;let i=e.filter((o)=>o.identify?.(r));if(i.length>1){let o=i.filter((s)=>s.test);if(o.length>0)i=o}n=i.find((o)=>o.format===t.format)??i.find((o)=>!o.format)}else r=t,n=e.find((i)=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw Error(`Tag not resolved for ${i} value`)}return n}function tw(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],o=(We.isScalar(e)||We.isCollection(e))&&e.anchor;if(o&&Jk.anchorIsValid(o))n.add(o),i.push(`&${o}`);let s=e.tag??(t.default?null:t.tag);if(s)i.push(r.directives.tagString(s));return i.join(" ")}function nw(e,t,n,r){if(We.isPair(e))return e.toString(t,n,r);if(We.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=We.isNode(e)?e:t.doc.createNode(e,{onTagObj:(l)=>i=l});i??(i=ew(t.doc.schema.tags,o));let s=tw(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,n,r):We.isScalar(o)?Xk.stringifyString(o,t,n,r):o.toString(t,n,r);if(!s)return a;return We.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
34
+ ${t.indent}${a}`}rw.createStringifyContext=Zk;rw.stringify=nw});var yp=w(function(aw){var Me=M(),fp=z(),hp=An(),Rn=xn();function sw({key:e,value:t},n,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:p}}=n,m=Me.isNode(e)&&e.comment||null;if(p){if(m)throw Error("With simple keys, key nodes cannot have comments");if(Me.isCollection(e)||!Me.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let u=!p&&(!e||m&&t==null&&!n.inFlow||Me.isCollection(e)||(Me.isScalar(e)?e.type===fp.Scalar.BLOCK_FOLDED||e.type===fp.Scalar.BLOCK_LITERAL:typeof e==="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!u&&(p||!o),indent:a+l});let f=!1,g=!1,h=hp.stringify(e,n,()=>f=!0,()=>g=!0);if(!u&&!n.inFlow&&h.length>1024){if(p)throw Error("With simple keys, single line scalar must not span more than 1024 characters");u=!0}if(n.inFlow){if(o||t==null){if(f&&r)r();return h===""?"?":u?`? ${h}`:h}}else if(o&&!p||t==null&&u){if(h=`? ${h}`,m&&!f)h+=Rn.lineComment(h,n.indent,c(m));else if(g&&i)i();return h}if(f)m=null;if(u){if(m)h+=Rn.lineComment(h,n.indent,c(m));h=`? ${h}
35
+ ${a}:`}else if(h=`${h}:`,m)h+=Rn.lineComment(h,n.indent,c(m));let b,y,v;if(Me.isNode(t))b=!!t.spaceBefore,y=t.commentBefore,v=t.comment;else if(b=!1,y=null,v=null,t&&typeof t==="object")t=s.createNode(t);if(n.implicitKey=!1,!u&&!m&&Me.isScalar(t))n.indentAtStart=h.length+1;if(g=!1,!d&&l.length>=2&&!n.inFlow&&!u&&Me.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)n.indent=n.indent.substring(2);let k=!1,S=hp.stringify(t,n,()=>k=!0,()=>g=!0),x=" ";if(m||b||y){if(x=b?`
36
+ `:"",y){let T=c(y);x+=`
37
+ ${Rn.indentComment(T,n.indent)}`}if(S===""&&!n.inFlow){if(x===`
38
+ `&&v)x=`
39
39
 
40
- `}else A+=`
41
- ${r.indent}`}else if(!u&&ue.isCollection(t)){let P=x[0],v=x.indexOf(`
42
- `),D=v!==-1,ge=r.inFlow??t.flow??t.items.length===0;if(D||!ge){let $e=!1;if(D&&(P==="&"||P==="!")){let L=x.indexOf(" ");if(P==="&"&&L!==-1&&L<v&&x[L+1]==="!")L=x.indexOf(" ",L+1);if(L===-1||v<L)$e=!0}if(!$e)A=`
43
- ${r.indent}`}}else if(x===""||x[0]===`
44
- `)A="";if(y+=A+x,r.inFlow){if(R&&n)n()}else if(k&&!R)y+=vt.lineComment(y,r.indent,l(k));else if(f&&i)i();return y}_m.stringifyPair=Nm});var qn=h(function(qm){var qa=Ut("process");function $m(e,...t){if(e==="debug")console.log(...t)}function Bm(e,t){if(e==="debug"||e==="warn")if(typeof qa.emitWarning==="function")qa.emitWarning(t);else console.warn(t)}qm.debug=$m;qm.warn=Bm});var xr=h(function(Hm){var Rr=E(),Fa=O(),Cr="<<",kr={identify:(e)=>e===Cr||typeof e==="symbol"&&e.description===Cr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Fa.Scalar(Symbol(Cr)),{addToJSMap:ja}),stringify:()=>Cr},Um=(e,t)=>(kr.identify(t)||Rr.isScalar(t)&&(!t.type||t.type===Fa.Scalar.PLAIN)&&kr.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===kr.tag&&r.default);function ja(e,t,r){let n=Ua(e,r);if(Rr.isSeq(n))for(let i of n.items)Fn(e,t,i);else if(Array.isArray(n))for(let i of n)Fn(e,t,i);else Fn(e,t,n)}function Fn(e,t,r){let n=Ua(e,r);if(!Rr.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[s,o]of i)if(t instanceof Map){if(!t.has(s))t.set(s,o)}else if(t instanceof Set)t.add(s);else if(!Object.prototype.hasOwnProperty.call(t,s))Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Ua(e,t){return e&&Rr.isAlias(t)?t.resolve(e.doc,e):t}Hm.addMergeToJSMap=ja;Hm.isMergeKey=Um;Hm.merge=kr});var Un=h(function(Qm){var Km=qn(),Ha=xr(),Wm=St(),Va=E(),jn=me();function Ym(e,t,{key:r,value:n}){if(Va.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(Ha.isMergeKey(e,r))Ha.addMergeToJSMap(e,t,n);else{let i=jn.toJS(r,"",e);if(t instanceof Map)t.set(i,jn.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let s=Jm(r,i,e),o=jn.toJS(n,s,e);if(s in t)Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});else t[s]=o}}return t}function Jm(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(Va.isNode(e)&&r?.doc){let n=Wm.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);if(s.length>40)s=s.substring(0,36)+'..."';Km.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}Qm.addPairToJSMap=Ym});var be=h(function(ry){var za=yt(),Zm=Ba(),ey=Un(),Ir=E();function ty(e,t,r){let n=za.createNode(e,void 0,r),i=za.createNode(t,void 0,r);return new Ar(n,i)}class Ar{constructor(e,t=null){Object.defineProperty(this,Ir.NODE_TYPE,{value:Ir.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(Ir.isNode(t))t=t.clone(e);if(Ir.isNode(r))r=r.clone(e);return new Ar(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return ey.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?Zm.stringifyPair(this,e,t,r):JSON.stringify(this)}}ry.Pair=Ar;ry.createPair=ty});var Hn=h(function(cy){var Te=E(),Ga=St(),Er=ht();function sy(e,t,r){return(t.inFlow??e.flow?ay:oy)(e,t,r)}function oy({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=r,d=Object.assign({},r,{indent:s,type:null}),g=!1,p=[];for(let m=0;m<t.length;++m){let f=t[m],y=null;if(Te.isNode(f)){if(!g&&f.spaceBefore)p.push("");if(Pr(r,p,f.commentBefore,g),f.comment)y=f.comment}else if(Te.isPair(f)){let C=Te.isNode(f.key)?f.key:null;if(C){if(!g&&C.spaceBefore)p.push("");Pr(r,p,C.commentBefore,g)}}g=!1;let S=Ga.stringify(f,d,()=>y=null,()=>g=!0);if(y)S+=Er.lineComment(S,s,l(y));if(g&&y)g=!1;p.push(n+S)}let u;if(p.length===0)u=i.start+i.end;else{u=p[0];for(let m=1;m<p.length;++m){let f=p[m];u+=f?`
45
- ${c}${f}`:`
40
+ `}else x+=`
41
+ ${n.indent}`}else if(!u&&Me.isCollection(t)){let T=S[0],C=S.indexOf(`
42
+ `),R=C!==-1,U=n.inFlow??t.flow??t.items.length===0;if(R||!U){let L=!1;if(R&&(T==="&"||T==="!")){let B=S.indexOf(" ");if(T==="&"&&B!==-1&&B<C&&S[B+1]==="!")B=S.indexOf(" ",B+1);if(B===-1||C<B)L=!0}if(!L)x=`
43
+ ${n.indent}`}}else if(S===""||S[0]===`
44
+ `)x="";if(h+=x+S,n.inFlow){if(k&&r)r()}else if(v&&!k)h+=Rn.lineComment(h,n.indent,c(v));else if(g&&i)i();return h}aw.stringifyPair=sw});var Xo=w(function(pw){var bp=lr("process");function cw(e,...t){if(e==="debug")console.log(...t)}function dw(e,t){if(e==="debug"||e==="warn")if(typeof bp.emitWarning==="function")bp.emitWarning(t);else console.warn(t)}pw.debug=cw;pw.warn=dw});var Gr=w(function(fw){var Kr=M(),vp=z(),Hr="<<",zr={identify:(e)=>e===Hr||typeof e==="symbol"&&e.description===Hr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new vp.Scalar(Symbol(Hr)),{addToJSMap:kp}),stringify:()=>Hr},gw=(e,t)=>(zr.identify(t)||Kr.isScalar(t)&&(!t.type||t.type===vp.Scalar.PLAIN)&&zr.identify(t.value))&&e?.doc.schema.tags.some((n)=>n.tag===zr.tag&&n.default);function kp(e,t,n){let r=wp(e,n);if(Kr.isSeq(r))for(let i of r.items)Zo(e,t,i);else if(Array.isArray(r))for(let i of r)Zo(e,t,i);else Zo(e,t,r)}function Zo(e,t,n){let r=wp(e,n);if(!Kr.isMap(r))throw Error("Merge sources must be maps or map aliases");let i=r.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 wp(e,t){return e&&Kr.isAlias(t)?t.resolve(e.doc,e):t}fw.addMergeToJSMap=kp;fw.isMergeKey=gw;fw.merge=zr});var ts=w(function(xw){var vw=Xo(),Sp=Gr(),kw=An(),xp=M(),es=Ke();function ww(e,t,{key:n,value:r}){if(xp.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Sp.isMergeKey(e,n))Sp.addMergeToJSMap(e,t,r);else{let i=es.toJS(n,"",e);if(t instanceof Map)t.set(i,es.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let o=Sw(n,i,e),s=es.toJS(r,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 Sw(e,t,n){if(t===null)return"";if(typeof t!=="object")return String(t);if(xp.isNode(e)&&n?.doc){let r=kw.createStringifyContext(n.doc,{});r.anchors=new Set;for(let o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);if(o.length>40)o=o.substring(0,36)+'..."';vw.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}xw.addPairToJSMap=ww});var Ye=w(function(Pw){var Cp=Sn(),Iw=yp(),Aw=ts(),Wr=M();function Rw(e,t,n){let r=Cp.createNode(e,void 0,n),i=Cp.createNode(t,void 0,n);return new Yr(r,i)}class Yr{constructor(e,t=null){Object.defineProperty(this,Wr.NODE_TYPE,{value:Wr.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;if(Wr.isNode(t))t=t.clone(e);if(Wr.isNode(n))n=n.clone(e);return new Yr(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Aw.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Iw.stringifyPair(this,e,t,n):JSON.stringify(this)}}Pw.Pair=Yr;Pw.createPair=Rw});var ns=w(function(Bw){var yt=M(),Ip=An(),Jr=xn();function Ow(e,t,n){return(t.inFlow??e.flow?_w:Nw)(e,t,n)}function Nw({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:o,type:null}),p=!1,m=[];for(let f=0;f<t.length;++f){let g=t[f],h=null;if(yt.isNode(g)){if(!p&&g.spaceBefore)m.push("");if(Qr(n,m,g.commentBefore,p),g.comment)h=g.comment}else if(yt.isPair(g)){let y=yt.isNode(g.key)?g.key:null;if(y){if(!p&&y.spaceBefore)m.push("");Qr(n,m,y.commentBefore,p)}}p=!1;let b=Ip.stringify(g,d,()=>h=null,()=>p=!0);if(h)b+=Jr.lineComment(b,o,c(h));if(p&&h)p=!1;m.push(r+b)}let u;if(m.length===0)u=i.start+i.end;else{u=m[0];for(let f=1;f<m.length;++f){let g=m[f];u+=g?`
45
+ ${l}${g}`:`
46
46
  `}}if(e){if(u+=`
47
- `+Er.indentComment(l(e),c),a)a()}else if(g&&o)o();return u}function ay({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=t;n+=s;let c=Object.assign({},t,{indent:n,inFlow:!0,type:null}),l=!1,d=0,g=[];for(let m=0;m<e.length;++m){let f=e[m],y=null;if(Te.isNode(f)){if(f.spaceBefore)g.push("");if(Pr(t,g,f.commentBefore,!1),f.comment)y=f.comment}else if(Te.isPair(f)){let C=Te.isNode(f.key)?f.key:null;if(C){if(C.spaceBefore)g.push("");if(Pr(t,g,C.commentBefore,!1),C.comment)l=!0}let k=Te.isNode(f.value)?f.value:null;if(k){if(k.comment)y=k.comment;if(k.commentBefore)l=!0}else if(f.value==null&&C?.comment)y=C.comment}if(y)l=!0;let S=Ga.stringify(f,c,()=>y=null);if(l||(l=g.length>d||S.includes(`
48
- `)),m<e.length-1)S+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=g.reduce((C,k)=>C+k.length+2,2)+(S.length+2)>t.options.lineWidth);if(l)S+=","}if(y)S+=Er.lineComment(S,n,a(y));g.push(S),d=g.length}let{start:p,end:u}=r;if(g.length===0)return p+u;else{if(!l){let m=g.reduce((f,y)=>f+y.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let f of g)m+=f?`
49
- ${s}${i}${f}`:`
50
- `;return`${m}
51
- ${i}${u}`}else return`${p}${o}${g.join(" ")}${o}${u}`}}function Pr({indent:e,options:{commentString:t}},r,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let s=Er.indentComment(t(n),e);r.push(s.trimStart())}}cy.stringifyCollection=sy});var Se=h(function(fy){var uy=Hn(),dy=Un(),py=br(),we=E(),Tr=be(),gy=O();function Ct(e,t){let r=we.isScalar(t)?t.value:t;for(let n of e)if(we.isPair(n)){if(n.key===t||n.key===r)return n;if(we.isScalar(n.key)&&n.key.value===r)return n}return}class Ka extends py.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(we.MAP,e);this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:i}=r,s=new this(e),o=(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)s.items.push(Tr.createPair(a,c,r))};if(t instanceof Map)for(let[a,c]of t)o(a,c);else if(t&&typeof t==="object")for(let a of Object.keys(t))o(a,t[a]);if(typeof e.sortMapEntries==="function")s.items.sort(e.sortMapEntries);return s}add(e,t){let r;if(we.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new Tr.Pair(e,e?.value);else r=new Tr.Pair(e.key,e.value);let n=Ct(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);if(we.isScalar(n.value)&&gy.isScalarValue(r.value))n.value.value=r.value;else n.value=r.value}else if(i){let s=this.items.findIndex((o)=>i(r,o)<0);if(s===-1)this.items.push(r);else this.items.splice(s,0,r)}else this.items.push(r)}delete(e){let t=Ct(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Ct(this.items,e)?.value;return(!t&&we.isScalar(n)?n.value:n)??void 0}has(e){return!!Ct(this.items,e)}set(e,t){this.add(new Tr.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)dy.addPairToJSMap(t,n,i);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!we.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 uy.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}fy.YAMLMap=Ka;fy.findPair=Ct});var Ge=h(function(wy){var hy=E(),Wa=Se(),by={collection:"map",default:!0,nodeClass:Wa.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!hy.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>Wa.YAMLMap.from(e,t,r)};wy.map=by});var ve=h(function(Iy){var vy=yt(),Cy=Hn(),ky=br(),Dr=E(),Ry=O(),xy=me();class Ya extends ky.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Dr.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Or(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=Or(e);if(typeof r!=="number")return;let n=this.items[r];return!t&&Dr.isScalar(n)?n.value:n}has(e){let t=Or(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=Or(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];if(Dr.isScalar(n)&&Ry.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(xy.toJS(i,String(n++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return Cy.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 s=0;for(let o of t){if(typeof n==="function"){let a=t instanceof Set?o:String(s++);o=n.call(t,a,o)}i.items.push(vy.createNode(o,void 0,r))}}return i}}function Or(e){let t=Dr.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Iy.YAMLSeq=Ya});var Ke=h(function(Ty){var Ey=E(),Ja=ve(),Py={collection:"seq",default:!0,nodeClass:Ja.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!Ey.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>Ja.YAMLSeq.from(e,t,r)};Ty.seq=Py});var kt=h(function(Ny){var Dy=wt(),Ly={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),Dy.stringifyString(e,t,r,n)}};Ny.string=Ly});var Lr=h(function(My){var Qa=O(),Xa={identify:(e)=>e==null,createNode:()=>new Qa.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Qa.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Xa.test.test(e)?e:t.options.nullStr};My.nullTag=Xa});var Vn=h(function(qy){var By=O(),Za={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new By.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&Za.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};qy.boolTag=Za});var We=h(function(Uy){function jy({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 s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");if(o<0)o=s.length,s+=".";let a=t-(s.length-o-1);while(a-- >0)s+="0"}return s}Uy.stringifyNumber=jy});var Gn=h(function(Wy){var Vy=O(),zn=We(),zy={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:zn.stringifyNumber},Gy={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():zn.stringifyNumber(e)}},Ky={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 Vy.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:zn.stringifyNumber};Wy.float=Ky;Wy.floatExp=Gy;Wy.floatNaN=zy});var Wn=h(function(th){var ec=We(),Nr=(e)=>typeof e==="bigint"||Number.isInteger(e),Kn=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function tc(e,t,r){let{value:n}=e;if(Nr(n)&&n>=0)return r+n.toString(t);return ec.stringifyNumber(e)}var Xy={identify:(e)=>Nr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>Kn(e,2,8,r),stringify:(e)=>tc(e,8,"0o")},Zy={identify:Nr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>Kn(e,0,10,r),stringify:ec.stringifyNumber},eh={identify:(e)=>Nr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>Kn(e,2,16,r),stringify:(e)=>tc(e,16,"0x")};th.int=Zy;th.intHex=eh;th.intOct=Xy});var rc=h(function(dh){var sh=Ge(),oh=Lr(),ah=Ke(),ch=kt(),lh=Vn(),Yn=Gn(),Jn=Wn(),uh=[sh.map,ah.seq,ch.string,oh.nullTag,lh.boolTag,Jn.intOct,Jn.int,Jn.intHex,Yn.floatNaN,Yn.floatExp,Yn.float];dh.schema=uh});var ic=h(function(wh){var gh=O(),fh=Ge(),mh=Ke();function nc(e){return typeof e==="bigint"||Number.isInteger(e)}var _r=({value:e})=>JSON.stringify(e),yh=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:_r},{identify:(e)=>e==null,createNode:()=>new gh.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_r},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:_r},{identify:nc,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})=>nc(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:_r}],hh={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},bh=[fh.map,mh.seq].concat(yh,hh);wh.schema=bh});var Xn=h(function(kh){var Rt=Ut("buffer"),Qn=O(),vh=wt(),Ch={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Rt.Buffer==="function")return Rt.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,s){if(!r)return"";let o=r,a;if(typeof Rt.Buffer==="function")a=o instanceof Rt.Buffer?o.toString("base64"):Rt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa==="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Qn.Scalar.BLOCK_LITERAL),t!==Qn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),d=Array(l);for(let g=0,p=0;g<l;++g,p+=c)d[g]=a.substr(p,c);a=d.join(t===Qn.Scalar.BLOCK_LITERAL?`
52
- `:" ")}return vh.stringifyString({comment:e,type:t,value:a},n,i,s)}};kh.binary=Ch});var $r=h(function(Eh){var Mr=E(),Zn=be(),xh=O(),Ih=ve();function sc(e,t){if(Mr.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(Mr.isPair(n))continue;else if(Mr.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new Zn.Pair(new xh.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
53
- ${i.key.commentBefore}`:n.commentBefore;if(n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
54
- ${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 oc(e,t,r){let{replacer:n}=r,i=new Ih.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 Ah={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:sc,createNode:oc};Eh.createPairs=oc;Eh.pairs=Ah;Eh.resolvePairs=sc});var ti=h(function(Nh){var ac=E(),ei=me(),xt=Se(),Dh=ve(),cc=$r();class Oe extends Dh.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(ac.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=cc.createPairs(e,t,r),i=new this;return i.items=n.items,i}}Oe.tag="tag:yaml.org,2002:omap";var Lh={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=cc.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(ac.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)};Nh.YAMLOMap=Oe;Nh.omap=Lh});var gc=h(function($h){var lc=O();function uc({value:e,source:t},r){if(t&&(e?dc:pc).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var dc={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 lc.Scalar(!0),stringify:uc},pc={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 lc.Scalar(!1),stringify:uc};$h.falseTag=pc;$h.trueTag=dc});var fc=h(function(Vh){var Fh=O(),ri=We(),jh={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},Uh={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)}},Hh={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 Fh.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};Vh.float=Hh;Vh.floatExp=Uh;Vh.floatNaN=jh});var yc=h(function(Xh){var mc=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 mc.stringifyNumber(e)}var Wh={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")},Yh={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")},Jh={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:mc.stringifyNumber},Qh={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")};Xh.int=Jh;Xh.intBin=Wh;Xh.intHex=Qh;Xh.intOct=Yh});var ii=h(function(ib){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 nb={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}};ib.YAMLSet=De;ib.set=nb});var oi=h(function(ub){var ab=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 hc(e){let{value:t}=e,r=(o)=>o;if(typeof t==="bigint")r=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ab.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 cb={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:hc},lb={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:hc},bc={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(bc.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),d=t[8];if(d&&d!=="Z"){let g=si(d,!1);if(Math.abs(g)<30)g*=60;l-=60000*g}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ub.floatTime=lb;ub.intTime=cb;ub.timestamp=bc});var Sc=h(function(Rb){var fb=Ge(),mb=Lr(),yb=Ke(),hb=kt(),bb=Xn(),wc=gc(),ai=fc(),Ur=yc(),wb=xr(),Sb=ti(),vb=$r(),Cb=ii(),ci=oi(),kb=[fb.map,yb.seq,hb.string,mb.nullTag,wc.trueTag,wc.falseTag,Ur.intBin,Ur.intOct,Ur.int,Ur.intHex,ai.floatNaN,ai.floatExp,ai.float,bb.binary,wb.merge,Sb.omap,vb.pairs,Cb.set,ci.intTime,ci.floatTime,ci.timestamp];Rb.schema=kb});var Tc=h(function(Lb){var Rc=Ge(),Ib=Lr(),xc=Ke(),Ab=kt(),Eb=Vn(),li=Gn(),ui=Wn(),Pb=rc(),Tb=ic(),Ic=Xn(),At=xr(),Ac=ti(),Ec=$r(),vc=Sc(),Pc=ii(),Hr=oi(),Cc=new Map([["core",Pb.schema],["failsafe",[Rc.map,xc.seq,Ab.string]],["json",Tb.schema],["yaml11",vc.schema],["yaml-1.1",vc.schema]]),kc={binary:Ic.binary,bool:Eb.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:Rc.map,merge:At.merge,null:Ib.nullTag,omap:Ac.omap,pairs:Ec.pairs,seq:xc.seq,set:Pc.set,timestamp:Hr.timestamp},Ob={"tag:yaml.org,2002:binary":Ic.binary,"tag:yaml.org,2002:merge":At.merge,"tag:yaml.org,2002:omap":Ac.omap,"tag:yaml.org,2002:pairs":Ec.pairs,"tag:yaml.org,2002:set":Pc.set,"tag:yaml.org,2002:timestamp":Hr.timestamp};function Db(e,t,r){let n=Cc.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(Cc.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"?kc[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(kc).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!s.includes(a))s.push(a);return s},[])}Lb.coreKnownTags=Ob;Lb.getTags=Db});var gi=h(function(Fb){var di=E(),Mb=Ge(),$b=Ke(),Bb=kt(),Vr=Tc(),qb=(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:Mb.map}),Object.defineProperty(this,di.SCALAR,{value:Bb.string}),Object.defineProperty(this,di.SEQ,{value:$b.seq}),this.sortMapEntries=typeof s==="function"?s:s===!0?qb:null}clone(){let e=Object.create(pi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}Fb.Schema=pi});var Oc=h(function(Vb){var Ub=E(),fi=St(),Et=ht();function Hb(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(Ub.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let d=s(e.contents.commentBefore);r.push(Et.indentComment(d,""))}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(`
55
- `))r.push("..."),r.push(Et.indentComment(c,""));else r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;if(c&&o)c=c.replace(/^\n+/,"");if(c){if((!o||a)&&r[r.length-1]!=="")r.push("");r.push(Et.indentComment(s(c),""))}}return r.join(`
47
+ `+Jr.indentComment(c(e),l),a)a()}else if(p&&s)s();return u}function _w({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;r+=o;let l=Object.assign({},t,{indent:r,inFlow:!0,type:null}),c=!1,d=0,p=[];for(let f=0;f<e.length;++f){let g=e[f],h=null;if(yt.isNode(g)){if(g.spaceBefore)p.push("");if(Qr(t,p,g.commentBefore,!1),g.comment)h=g.comment}else if(yt.isPair(g)){let y=yt.isNode(g.key)?g.key:null;if(y){if(y.spaceBefore)p.push("");if(Qr(t,p,y.commentBefore,!1),y.comment)c=!0}let v=yt.isNode(g.value)?g.value:null;if(v){if(v.comment)h=v.comment;if(v.commentBefore)c=!0}else if(g.value==null&&y?.comment)h=y.comment}if(h)c=!0;let b=Ip.stringify(g,l,()=>h=null);if(c||(c=p.length>d||b.includes(`
48
+ `)),f<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)c||(c=p.reduce((y,v)=>y+v.length+2,2)+(b.length+2)>t.options.lineWidth);if(c)b+=","}if(h)b+=Jr.lineComment(b,r,a(h));p.push(b),d=p.length}let{start:m,end:u}=n;if(p.length===0)return m+u;else{if(!c){let f=p.reduce((g,h)=>g+h.length+2,2);c=t.options.lineWidth>0&&f>t.options.lineWidth}if(c){let f=m;for(let g of p)f+=g?`
49
+ ${o}${i}${g}`:`
50
+ `;return`${f}
51
+ ${i}${u}`}else return`${m}${s}${p.join(" ")}${s}${u}`}}function Qr({indent:e,options:{commentString:t}},n,r,i){if(r&&i)r=r.replace(/^\n+/,"");if(r){let o=Jr.indentComment(t(r),e);n.push(o.trimStart())}}Bw.stringifyCollection=Ow});var Qe=w(function(Uw){var Lw=ns(),Mw=ts(),$w=Ur(),Je=M(),Xr=Ye(),Fw=z();function Pn(e,t){let n=Je.isScalar(t)?t.value:t;for(let r of e)if(Je.isPair(r)){if(r.key===t||r.key===n)return r;if(Je.isScalar(r.key)&&r.key.value===n)return r}return}class Ap extends $w.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Je.MAP,e);this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(a,l)=>{if(typeof i==="function")l=i.call(t,a,l);else if(Array.isArray(i)&&!i.includes(a))return;if(l!==void 0||r)o.items.push(Xr.createPair(a,l,n))};if(t instanceof Map)for(let[a,l]of t)s(a,l);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 n;if(Je.isPair(e))n=e;else if(!e||typeof e!=="object"||!("key"in e))n=new Xr.Pair(e,e?.value);else n=new Xr.Pair(e.key,e.value);let r=Pn(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);if(Je.isScalar(r.value)&&Fw.isScalarValue(n.value))r.value.value=n.value;else r.value=n.value}else if(i){let o=this.items.findIndex((s)=>i(n,s)<0);if(o===-1)this.items.push(n);else this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Pn(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let r=Pn(this.items,e)?.value;return(!t&&Je.isScalar(r)?r.value:r)??void 0}has(e){return!!Pn(this.items,e)}set(e,t){this.add(new Xr.Pair(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(r);for(let i of this.items)Mw.addPairToJSMap(t,r,i);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!Je.isPair(r))throw Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return Lw.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}Uw.YAMLMap=Ap;Uw.findPair=Pn});var Mt=w(function(zw){var Vw=M(),Rp=Qe(),Hw={collection:"map",default:!0,nodeClass:Rp.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!Vw.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,n)=>Rp.YAMLMap.from(e,t,n)};zw.map=Hw});var Xe=w(function(Xw){var Gw=Sn(),Ww=ns(),Yw=Ur(),ei=M(),Jw=z(),Qw=Ke();class Pp extends Yw.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ei.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Zr(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let n=Zr(e);if(typeof n!=="number")return;let r=this.items[n];return!t&&ei.isScalar(r)?r.value:r}has(e){let t=Zr(e);return typeof t==="number"&&t<this.items.length}set(e,t){let n=Zr(e);if(typeof n!=="number")throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];if(ei.isScalar(r)&&Jw.isScalarValue(t))r.value=t;else this.items[n]=t}toJSON(e,t){let n=[];if(t?.onCreate)t.onCreate(n);let r=0;for(let i of this.items)n.push(Qw.toJS(i,String(r++),t));return n}toString(e,t,n){if(!e)return JSON.stringify(this);return Ww.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t})}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let s of t){if(typeof r==="function"){let a=t instanceof Set?s:String(o++);s=r.call(t,a,s)}i.items.push(Gw.createNode(s,void 0,n))}}return i}}function Zr(e){let t=ei.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Xw.YAMLSeq=Pp});var $t=w(function(nS){var eS=M(),Tp=Xe(),tS={collection:"seq",default:!0,nodeClass:Tp.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!eS.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,n)=>Tp.YAMLSeq.from(e,t,n)};nS.seq=tS});var Tn=w(function(sS){var iS=In(),oS={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),iS.stringifyString(e,t,n,r)}};sS.string=oS});var ti=w(function(lS){var Ep=z(),Op={identify:(e)=>e==null,createNode:()=>new Ep.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ep.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Op.test.test(e)?e:t.options.nullStr};lS.nullTag=Op});var rs=w(function(pS){var dS=z(),Np={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new dS.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Np.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};pS.boolTag=Np});var Ft=w(function(gS){function mS({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==="bigint")return String(r);let i=typeof r==="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="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}gS.stringifyNumber=mS});var os=w(function(kS){var hS=z(),is=Ft(),yS={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:is.stringifyNumber},bS={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():is.stringifyNumber(e)}},vS={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 hS.Scalar(parseFloat(e)),n=e.indexOf(".");if(n!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-n-1;return t},stringify:is.stringifyNumber};kS.float=vS;kS.floatExp=bS;kS.floatNaN=yS});var as=w(function(RS){var _p=Ft(),ni=(e)=>typeof e==="bigint"||Number.isInteger(e),ss=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Bp(e,t,n){let{value:r}=e;if(ni(r)&&r>=0)return n+r.toString(t);return _p.stringifyNumber(e)}var CS={identify:(e)=>ni(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ss(e,2,8,n),stringify:(e)=>Bp(e,8,"0o")},IS={identify:ni,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ss(e,0,10,n),stringify:_p.stringifyNumber},AS={identify:(e)=>ni(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ss(e,2,16,n),stringify:(e)=>Bp(e,16,"0x")};RS.int=IS;RS.intHex=AS;RS.intOct=CS});var Dp=w(function(MS){var OS=Mt(),NS=ti(),_S=$t(),BS=Tn(),DS=rs(),ls=os(),cs=as(),LS=[OS.map,_S.seq,BS.string,NS.nullTag,DS.boolTag,cs.intOct,cs.int,cs.intHex,ls.floatNaN,ls.floatExp,ls.float];MS.schema=LS});var Mp=w(function(zS){var FS=z(),US=Mt(),jS=$t();function Lp(e){return typeof e==="bigint"||Number.isInteger(e)}var ri=({value:e})=>JSON.stringify(e),qS=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:ri},{identify:(e)=>e==null,createNode:()=>new FS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ri},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:ri},{identify:Lp,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Lp(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:ri}],VS={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},HS=[US.map,jS.seq].concat(qS,VS);zS.schema=HS});var ps=w(function(YS){var En=lr("buffer"),ds=z(),GS=In(),WS={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof En.Buffer==="function")return En.Buffer.from(e,"base64");else if(typeof atob==="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,o){if(!n)return"";let s=n,a;if(typeof En.Buffer==="function")a=s instanceof En.Buffer?s.toString("base64"):En.Buffer.from(s.buffer).toString("base64");else if(typeof btoa==="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ds.Scalar.BLOCK_LITERAL),t!==ds.Scalar.QUOTE_DOUBLE){let l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),d=Array(c);for(let p=0,m=0;p<c;++p,m+=l)d[p]=a.substr(m,l);a=d.join(t===ds.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return GS.stringifyString({comment:e,type:t,value:a},r,i,o)}};YS.binary=WS});var oi=w(function(ex){var ii=M(),us=Ye(),QS=z(),XS=Xe();function $p(e,t){if(ii.isSeq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(ii.isPair(r))continue;else if(ii.isMap(r)){if(r.items.length>1)t("Each pair must have its own sequence indicator");let i=r.items[0]||new us.Pair(new QS.Scalar(null));if(r.commentBefore)i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
53
+ ${i.key.commentBefore}`:r.commentBefore;if(r.comment){let o=i.value??i.key;o.comment=o.comment?`${r.comment}
54
+ ${o.comment}`:r.comment}r=i}e.items[n]=ii.isPair(r)?r:new us.Pair(r)}else t("Expected a sequence for this tag");return e}function Fp(e,t,n){let{replacer:r}=n,i=new XS.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 r==="function")s=r.call(t,String(o++),s);let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;i.items.push(us.createPair(a,l,n))}return i}var ZS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$p,createNode:Fp};ex.createPairs=Fp;ex.pairs=ZS;ex.resolvePairs=$p});var gs=w(function(sx){var Up=M(),ms=Ke(),On=Qe(),ix=Xe(),jp=oi();class bt extends ix.YAMLSeq{constructor(){super();this.add=On.YAMLMap.prototype.add.bind(this),this.delete=On.YAMLMap.prototype.delete.bind(this),this.get=On.YAMLMap.prototype.get.bind(this),this.has=On.YAMLMap.prototype.has.bind(this),this.set=On.YAMLMap.prototype.set.bind(this),this.tag=bt.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;if(t?.onCreate)t.onCreate(n);for(let r of this.items){let i,o;if(Up.isPair(r))i=ms.toJS(r.key,"",t),o=ms.toJS(r.value,i,t);else i=ms.toJS(r,"",t);if(n.has(i))throw Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let r=jp.createPairs(e,t,n),i=new this;return i.items=r.items,i}}bt.tag="tag:yaml.org,2002:omap";var ox={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:bt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=jp.resolvePairs(e,t),r=[];for(let{key:i}of n.items)if(Up.isScalar(i))if(r.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else r.push(i.value);return Object.assign(new bt,n)},createNode:(e,t,n)=>bt.from(e,t,n)};sx.YAMLOMap=bt;sx.omap=ox});var Kp=w(function(cx){var qp=z();function Vp({value:e,source:t},n){if(t&&(e?Hp:zp).test.test(t))return t;return e?n.options.trueStr:n.options.falseStr}var Hp={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 qp.Scalar(!0),stringify:Vp},zp={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 qp.Scalar(!1),stringify:Vp};cx.falseTag=zp;cx.trueTag=Hp});var Gp=w(function(hx){var ux=z(),fs=Ft(),mx={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:fs.stringifyNumber},gx={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():fs.stringifyNumber(e)}},fx={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 ux.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");if(r[r.length-1]==="0")t.minFractionDigits=r.length}return t},stringify:fs.stringifyNumber};hx.float=fx;hx.floatExp=gx;hx.floatNaN=mx});var Yp=w(function(Cx){var Wp=Ft(),Nn=(e)=>typeof e==="bigint"||Number.isInteger(e);function si(e,t,n,{intAsBigInt:r}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),r){switch(n){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,n);return i==="-"?-1*o:o}function hs(e,t,n){let{value:r}=e;if(Nn(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Wp.stringifyNumber(e)}var kx={identify:Nn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>si(e,2,2,n),stringify:(e)=>hs(e,2,"0b")},wx={identify:Nn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>si(e,1,8,n),stringify:(e)=>hs(e,8,"0")},Sx={identify:Nn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>si(e,0,10,n),stringify:Wp.stringifyNumber},xx={identify:Nn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>si(e,2,16,n),stringify:(e)=>hs(e,16,"0x")};Cx.int=Sx;Cx.intBin=kx;Cx.intHex=xx;Cx.intOct=wx});var ys=w(function(Ex){var ci=M(),ai=Ye(),li=Qe();class vt extends li.YAMLMap{constructor(e){super(e);this.tag=vt.tag}add(e){let t;if(ci.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new ai.Pair(e.key,null);else t=new ai.Pair(e,null);if(!li.findPair(this.items,t.key))this.items.push(t)}get(e,t){let n=li.findPair(this.items,e);return!t&&ci.isPair(n)?ci.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=li.findPair(this.items,e);if(n&&!t)this.items.splice(this.items.indexOf(n),1);else if(!n&&t)this.items.push(new ai.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);else throw Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof r==="function")o=r.call(t,o,o);i.items.push(ai.createPair(o,null,n))}return i}}vt.tag="tag:yaml.org,2002:set";var Tx={collection:"map",identify:(e)=>e instanceof Set,nodeClass:vt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>vt.from(e,t,n),resolve(e,t){if(ci.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new vt,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};Ex.YAMLSet=vt;Ex.set=Tx});var vs=w(function(Lx){var _x=Ft();function bs(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function Jp(e){let{value:t}=e,n=(s)=>s;if(typeof t==="bigint")n=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return _x.stringifyNumber(e);let r="";if(t<0)r="-",t*=n(-1);let i=n(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 r+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Bx={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:n})=>bs(e,n),stringify:Jp},Dx={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)=>bs(e,!1),stringify:Jp},Qp={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(Qp.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(n,r-1,i,o||0,s||0,a||0,l),d=t[8];if(d&&d!=="Z"){let p=bs(d,!1);if(Math.abs(p)<30)p*=60;c-=60000*p}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Lx.floatTime=Dx;Lx.intTime=Bx;Lx.timestamp=Qp});var Zp=w(function(Jx){var Ux=Mt(),jx=ti(),qx=$t(),Vx=Tn(),Hx=ps(),Xp=Kp(),ks=Gp(),di=Yp(),zx=Gr(),Kx=gs(),Gx=oi(),Wx=ys(),ws=vs(),Yx=[Ux.map,qx.seq,Vx.string,jx.nullTag,Xp.trueTag,Xp.falseTag,di.intBin,di.intOct,di.int,di.intHex,ks.floatNaN,ks.floatExp,ks.float,Hx.binary,zx.merge,Kx.omap,Gx.pairs,Wx.set,ws.intTime,ws.floatTime,ws.timestamp];Jx.schema=Yx});var cu=w(function(oC){var ru=Mt(),Xx=ti(),iu=$t(),Zx=Tn(),eC=rs(),Ss=os(),xs=as(),tC=Dp(),nC=Mp(),ou=ps(),_n=Gr(),su=gs(),au=oi(),eu=Zp(),lu=ys(),pi=vs(),tu=new Map([["core",tC.schema],["failsafe",[ru.map,iu.seq,Zx.string]],["json",nC.schema],["yaml11",eu.schema],["yaml-1.1",eu.schema]]),nu={binary:ou.binary,bool:eC.boolTag,float:Ss.float,floatExp:Ss.floatExp,floatNaN:Ss.floatNaN,floatTime:pi.floatTime,int:xs.int,intHex:xs.intHex,intOct:xs.intOct,intTime:pi.intTime,map:ru.map,merge:_n.merge,null:Xx.nullTag,omap:su.omap,pairs:au.pairs,seq:iu.seq,set:lu.set,timestamp:pi.timestamp},rC={"tag:yaml.org,2002:binary":ou.binary,"tag:yaml.org,2002:merge":_n.merge,"tag:yaml.org,2002:omap":su.omap,"tag:yaml.org,2002:pairs":au.pairs,"tag:yaml.org,2002:set":lu.set,"tag:yaml.org,2002:timestamp":pi.timestamp};function iC(e,t,n){let r=tu.get(t);if(r&&!e)return n&&!r.includes(_n.merge)?r.concat(_n.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(tu.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(n)i=i.concat(_n.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?nu[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(nu).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${l}; use one of ${c}`)}if(!o.includes(a))o.push(a);return o},[])}oC.coreKnownTags=rC;oC.getTags=iC});var As=w(function(uC){var Cs=M(),lC=Mt(),cC=$t(),dC=Tn(),ui=cu(),pC=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Is{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?ui.getTags(e,"compat"):e?ui.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=r?ui.coreKnownTags:{},this.tags=ui.getTags(t,this.name,n),this.toStringOptions=s??null,Object.defineProperty(this,Cs.MAP,{value:lC.map}),Object.defineProperty(this,Cs.SCALAR,{value:dC.string}),Object.defineProperty(this,Cs.SEQ,{value:cC.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?pC:null}clone(){let e=Object.create(Is.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}uC.Schema=Is});var du=w(function(hC){var gC=M(),Rs=An(),Bn=xn();function fC(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);if(l)n.push(l),r=!0;else if(e.directives.docStart)r=!0}if(r)n.push("---");let i=Rs.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(n.length!==1)n.unshift("");let l=o(e.commentBefore);n.unshift(Bn.indentComment(l,""))}let s=!1,a=null;if(e.contents){if(gC.isNode(e.contents)){if(e.contents.spaceBefore&&r)n.push("");if(e.contents.commentBefore){let d=o(e.contents.commentBefore);n.push(Bn.indentComment(d,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>s=!0,c=Rs.stringify(e.contents,i,()=>a=null,l);if(a)c+=Bn.lineComment(c,"",o(a));if((c[0]==="|"||c[0]===">")&&n[n.length-1]==="---")n[n.length-1]=`--- ${c}`;else n.push(c)}else n.push(Rs.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=o(e.comment);if(l.includes(`
55
+ `))n.push("..."),n.push(Bn.indentComment(l,""));else n.push(`... ${l}`)}else n.push("...");else{let l=e.comment;if(l&&s)l=l.replace(/^\n+/,"");if(l){if((!s||a)&&n[n.length-1]!=="")n.push("");n.push(Bn.indentComment(o(l),""))}}return n.join(`
56
56
  `)+`
57
- `}Vb.stringifyDocument=Hb});var Pt=h(function(Zb){var Gb=mt(),Ye=br(),X=E(),Kb=be(),Wb=me(),Yb=gi(),Jb=Oc(),mi=mr(),Qb=Nn(),Xb=yt(),yi=Ln();class hi{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,X.NODE_TYPE,{value:X.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:s}=i;if(r?._directives){if(this.directives=r._directives.atDocument(),this.directives.yaml.explicit)s=this.directives.yaml.version}else this.directives=new yi.Directives({version:s});this.setSchema(s,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(hi.prototype,{[X.NODE_TYPE]:{value:X.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=X.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(Je(this.contents))this.contents.add(e)}addIn(e,t){if(Je(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=mi.anchorNames(this);e.anchor=!t||r.has(t)?mi.findNewAnchor(t||"a",r):t}return new Gb.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=(S)=>typeof S==="number"||S instanceof String||S 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:s,flow:o,keepUndefined:a,onTagObj:c,tag:l}=r??{},{onAnchor:d,setAnchors:g,sourceObjects:p}=mi.createNodeAnchors(this,s||"a"),u={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:d,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:p},m=Xb.createNode(e,l,u);if(o&&X.isCollection(m))m.flow=!0;return g(),m}createPair(e,t,r={}){let n=this.createNode(e,null,r),i=this.createNode(t,null,r);return new Kb.Pair(n,i)}delete(e){return Je(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(Ye.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return Je(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return X.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(Ye.isEmptyPath(e))return!t&&X.isScalar(this.contents)?this.contents.value:this.contents;return X.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return X.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(Ye.isEmptyPath(e))return this.contents!==void 0;return X.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=Ye.collectionFromPath(this.schema,[e],t);else if(Je(this.contents))this.contents.set(e,t)}setIn(e,t){if(Ye.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=Ye.collectionFromPath(this.schema,Array.from(e),t);else if(Je(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 yi.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 yi.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 Yb.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:s}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=Wb.toJS(this.contents,t??"",o);if(typeof i==="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s==="function"?Qb.applyReviver(s,{"":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 Jb.stringifyDocument(this,e)}}function Je(e){if(X.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}Zb.Document=hi});var Tt=h(function(rw){class zr extends Error{constructor(e,t,r,n){super();this.name=e,this.code=r,this.message=n,this.pos=t}}class Dc extends zr{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class Lc extends zr{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var tw=(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 s=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80)o=o.substring(0,79)+"…";if(n>1&&/^ *$/.test(o.substring(0,s))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`…
58
- `;o=a+o}if(/[^ ]/.test(o)){let a=1,c=r.linePos[1];if(c?.line===n&&c.col>i)a=Math.max(1,Math.min(c.col-i,80-s));let l=" ".repeat(s)+"^".repeat(a);r.message+=`:
57
+ `}hC.stringifyDocument=fC});var Dn=w(function(IC){var bC=wn(),Ut=Ur(),he=M(),vC=Ye(),kC=Ke(),wC=As(),SC=du(),Ps=Mr(),xC=Go(),CC=Sn(),Ts=Ko();class Es{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,he.NODE_TYPE,{value:he.DOC});let r=null;if(typeof t==="function"||Array.isArray(t))r=t;else if(n===void 0&&t)n=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"},n);this.options=i;let{version:o}=i;if(n?._directives){if(this.directives=n._directives.atDocument(),this.directives.yaml.explicit)o=this.directives.yaml.version}else this.directives=new Ts.Directives({version:o});this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let e=Object.create(Es.prototype,{[he.NODE_TYPE]:{value:he.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=he.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(jt(this.contents))this.contents.add(e)}addIn(e,t){if(jt(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Ps.anchorNames(this);e.anchor=!t||n.has(t)?Ps.findNewAnchor(t||"a",n):t}return new bC.Alias(e.anchor)}createNode(e,t,n){let r=void 0;if(typeof t==="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let g=(b)=>typeof b==="number"||b instanceof String||b instanceof Number,h=t.filter(g).map(String);if(h.length>0)t=t.concat(h);r=t}else if(n===void 0&&t)n=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:l,tag:c}=n??{},{onAnchor:d,setAnchors:p,sourceObjects:m}=Ps.createNodeAnchors(this,o||"a"),u={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:m},f=CC.createNode(e,c,u);if(s&&he.isCollection(f))f.flow=!0;return p(),f}createPair(e,t,n={}){let r=this.createNode(e,null,n),i=this.createNode(t,null,n);return new vC.Pair(r,i)}delete(e){return jt(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(Ut.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return jt(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return he.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(Ut.isEmptyPath(e))return!t&&he.isScalar(this.contents)?this.contents.value:this.contents;return he.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return he.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(Ut.isEmptyPath(e))return this.contents!==void 0;return he.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=Ut.collectionFromPath(this.schema,[e],t);else if(jt(this.contents))this.contents.set(e,t)}setIn(e,t){if(Ut.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=Ut.collectionFromPath(this.schema,Array.from(e),t);else if(jt(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let n;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Ts.Directives({version:"1.1"});n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new Ts.Directives({version:e});n={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;n=null;break;default:{let r=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new wC.Schema(Object.assign(n,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},a=kC.toJS(this.contents,t??"",s);if(typeof i==="function")for(let{count:l,res:c}of s.anchors.values())i(c,l);return typeof o==="function"?xC.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 SC.stringifyDocument(this,e)}}function jt(e){if(he.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}IC.Document=Es});var Ln=w(function(PC){class mi extends Error{constructor(e,t,n,r){super();this.name=e,this.code=n,this.message=r,this.pos=t}}class pu extends mi{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class uu extends mi{constructor(e,t,n){super("YAMLWarning",e,t,n)}}var RC=(e,t)=>(n)=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map((a)=>t.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[r-1],t.lineStarts[r]).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(r>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);if(a.length>80)a=a.substring(0,79)+`…
58
+ `;s=a+s}if(/[^ ]/.test(s)){let a=1,l=n.linePos[1];if(l?.line===r&&l.col>i)a=Math.max(1,Math.min(l.col-i,80-o));let c=" ".repeat(o)+"^".repeat(a);n.message+=`:
59
59
 
60
- ${o}
61
- ${l}
62
- `}};rw.YAMLError=zr;rw.YAMLParseError=Dc;rw.YAMLWarning=Lc;rw.prettifyError=tw});var Ot=h(function(cw){function aw(e,{flow:t,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,g="",p="",u=!1,m=!1,f=null,y=null,S=null,C=null,k=null,R=null,x=null;for(let v of e){if(m){if(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma")s(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");m=!1}if(f){if(l&&v.type!=="comment"&&v.type!=="newline")s(f,"TAB_AS_INDENT","Tabs are not allowed as indentation");f=null}switch(v.type){case"space":if(!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&v.source.includes("\t"))f=v;d=!0;break;case"comment":{if(!d)s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=v.source.substring(1)||" ";if(!g)g=D;else g+=p+D;p="",l=!1;break}case"newline":if(l){if(g)g+=v.source;else if(!R||r!=="seq-item-ind")c=!0}else p+=v.source;if(l=!0,u=!0,y||S)C=v;d=!0;break;case"anchor":if(y)s(v,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(v.source.endsWith(":"))s(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);y=v,x??(x=v.offset),l=!1,d=!1,m=!0;break;case"tag":{if(S)s(v,"MULTIPLE_TAGS","A node can have at most one tag");S=v,x??(x=v.offset),l=!1,d=!1,m=!0;break}case r:if(y||S)s(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`);if(R)s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${t??"collection"}`);R=v,l=r==="seq-item-ind"||r==="explicit-key-ind",d=!1;break;case"comma":if(t){if(k)s(v,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);k=v,l=!1,d=!1;break}default:s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,d=!1}}let A=e[e.length-1],P=A?A.offset+A.source.length:i;if(m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(f&&(l&&f.indent<=o||n?.type==="block-map"||n?.type==="block-seq"))s(f,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:k,found:R,spaceBefore:c,comment:g,hasNewline:u,anchor:y,tag:S,newlineAfterProp:C,end:P,start:x??P}}cw.resolveProps=aw});var Gr=h(function(uw){function bi(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
63
- `))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(bi(t.key)||bi(t.value))return!0}return!1;default:return!0}}uw.containsNewline=bi});var wi=h(function(fw){var pw=Gr();function gw(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&pw.containsNewline(t))r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fw.flowIndentCheck=gw});var Si=h(function(hw){var Nc=E();function yw(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(s,o)=>s===o||Nc.isScalar(s)&&Nc.isScalar(o)&&s.value===o.value;return t.some((s)=>i(s.key,r))}hw.mapIncludes=yw});var qc=h(function(kw){var _c=be(),ww=Se(),Mc=Ot(),Sw=Gr(),$c=wi(),vw=Si(),Bc="All mapping items must start at the same column";function Cw({composeNode:e,composeEmptyNode:t},r,n,i,s){let a=new(s?.nodeClass??ww.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=n.offset,l=null;for(let d of n.items){let{start:g,key:p,sep:u,value:m}=d,f=Mc.resolveProps(g,{indicator:"explicit-key-ind",next:p??u?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),y=!f.found;if(y){if(p){if(p.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 p&&p.indent!==n.indent)i(c,"BAD_INDENT",Bc)}if(!f.anchor&&!f.tag&&!u){if(l=f.end,f.comment)if(a.comment)a.comment+=`
64
- `+f.comment;else a.comment=f.comment;continue}if(f.newlineAfterProp||Sw.containsNewline(p))i(p??g[g.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",Bc);r.atKey=!0;let S=f.end,C=p?e(r,p,f,i):t(r,S,g,null,f,i);if(r.schema.compat)$c.flowIndentCheck(n.indent,p,i);if(r.atKey=!1,vw.mapIncludes(r,a.items,C))i(S,"DUPLICATE_KEY","Map keys must be unique");let k=Mc.resolveProps(u??[],{indicator:"map-value-ind",next:m,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!p||p.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(C.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,u,null,k,i);if(r.schema.compat)$c.flowIndentCheck(n.indent,m,i);c=R.range[2];let x=new _c.Pair(C,R);if(r.options.keepSourceTokens)x.srcToken=d;a.items.push(x)}else{if(y)i(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(k.comment)if(C.comment)C.comment+=`
65
- `+k.comment;else C.comment=k.comment;let R=new _c.Pair(C);if(r.options.keepSourceTokens)R.srcToken=d;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}kw.resolveBlockMap=Cw});var Fc=h(function(Pw){var xw=ve(),Iw=Ot(),Aw=wi();function Ew({composeNode:e,composeEmptyNode:t},r,n,i,s){let a=new(s?.nodeClass??xw.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=n.offset,l=null;for(let{start:d,value:g}of n.items){let p=Iw.resolveProps(d,{indicator:"seq-item-ind",next:g,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||g)if(g?.type==="block-seq")i(p.end,"BAD_INDENT","All sequence items must start at the same column");else i(c,"MISSING_CHAR","Sequence item without - indicator");else{if(l=p.end,p.comment)a.comment=p.comment;continue}let u=g?e(r,g,p,i):t(r,p.end,d,null,p,i);if(r.schema.compat)Aw.flowIndentCheck(n.indent,g,i);c=u.range[2],a.items.push(u)}return a.range=[n.offset,c,l??c],a}Pw.resolveBlockSeq=Ew});var Qe=h(function(Dw){function Ow(e,t,r,n){let i="";if(e){let s=!1,o="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{if(r&&!s)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";if(!i)i=d;else i+=o+d;o="";break}case"newline":if(i)o+=c;s=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Dw.resolveEnd=Ow});var Hc=h(function(jw){var Nw=E(),_w=be(),jc=Se(),Mw=ve(),$w=Qe(),Uc=Ot(),Bw=Gr(),qw=Si(),vi="Block collections are not allowed within flow collections",Ci=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function Fw({composeNode:e,composeEmptyNode:t},r,n,i,s){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=new(s?.nodeClass??(o?jc.YAMLMap:Mw.YAMLSeq))(r.schema);l.flow=!0;let d=r.atRoot;if(d)r.atRoot=!1;if(r.atKey)r.atKey=!1;let g=n.offset+n.start.source.length;for(let y=0;y<n.items.length;++y){let S=n.items[y],{start:C,key:k,sep:R,value:x}=S,A=Uc.resolveProps(C,{flow:a,indicator:"explicit-key-ind",next:k??R?.[0],offset:g,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!R&&!x){if(y===0&&A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(y<n.items.length-1)i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(A.comment)if(l.comment)l.comment+=`
66
- `+A.comment;else l.comment=A.comment;g=A.end;continue}if(!o&&r.options.strict&&Bw.containsNewline(k))i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0){if(A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!A.comma)i(A.start,"MISSING_CHAR",`Missing , between ${a} items`);if(A.comment){let P="";e:for(let v of C)switch(v.type){case"comma":case"space":break;case"comment":P=v.source.substring(1);break e;default:break e}if(P){let v=l.items[l.items.length-1];if(Nw.isPair(v))v=v.value??v.key;if(v.comment)v.comment+=`
67
- `+P;else v.comment=P;A.comment=A.comment.substring(P.length+1)}}}if(!o&&!R&&!A.found){let P=x?e(r,x,A,i):t(r,A.end,R,null,A,i);if(l.items.push(P),g=P.range[2],Ci(x))i(P.range,"BLOCK_IN_FLOW",vi)}else{r.atKey=!0;let P=A.end,v=k?e(r,k,A,i):t(r,P,C,null,A,i);if(Ci(k))i(v.range,"BLOCK_IN_FLOW",vi);r.atKey=!1;let D=Uc.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:x,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(D.found){if(!o&&!A.found&&r.options.strict){if(R)for(let L of R){if(L===D.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<D.found.offset-1024)i(D.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(D.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let ge=x?e(r,x,D,i):D.found?t(r,D.end,R,null,D,i):null;if(ge){if(Ci(x))i(ge.range,"BLOCK_IN_FLOW",vi)}else if(D.comment)if(v.comment)v.comment+=`
68
- `+D.comment;else v.comment=D.comment;let $e=new _w.Pair(v,ge);if(r.options.keepSourceTokens)$e.srcToken=S;if(o){let L=l;if(qw.mapIncludes(r,L.items,v))i(P,"DUPLICATE_KEY","Map keys must be unique");L.items.push($e)}else{let L=new jc.YAMLMap(r.schema);L.flow=!0,L.items.push($e);let ls=(ge??v).range;L.range=[v.range[0],ls[1],ls[2]],l.items.push(L)}g=ge?ge.range[2]:D.end}}let p=o?"}":"]",[u,...m]=n.end,f=g;if(u?.source===p)f=u.offset+u.source.length;else{let y=a[0].toUpperCase()+a.substring(1),S=d?`${y} must end with a ${p}`:`${y} in block collection must be sufficiently indented and end with a ${p}`;if(i(g,d?"MISSING_CHAR":"BAD_INDENT",S),u&&u.source.length!==1)m.unshift(u)}if(m.length>0){let y=$w.resolveEnd(m,f,r.options.strict,i);if(y.comment)if(l.comment)l.comment+=`
69
- `+y.comment;else l.comment=y.comment;l.range=[n.offset,f,y.offset]}else l.range=[n.offset,f,f];return l}jw.resolveFlowCollection=Fw});var Vc=h(function(Qw){var Hw=E(),Vw=O(),zw=Se(),Gw=ve(),Kw=qc(),Ww=Fc(),Yw=Hc();function ki(e,t,r,n,i,s){let o=r.type==="block-map"?Kw.resolveBlockMap(e,t,r,n,s):r.type==="block-seq"?Ww.resolveBlockSeq(e,t,r,n,s):Yw.resolveFlowCollection(e,t,r,n,s),a=o.constructor;if(i==="!"||i===a.tagName)return o.tag=a.tagName,o;if(i)o.tag=i;return o}function Jw(e,t,r,n,i){let s=n.tag,o=!s?null:t.directives.tagName(s.source,(p)=>i(s,"TAG_RESOLVE_FAILED",p));if(r.type==="block-seq"){let{anchor:p,newlineAfterProp:u}=n,m=p&&s?p.offset>s.offset?p:s:p??s;if(m&&(!u||u.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(!s||!o||o==="!"||o===zw.YAMLMap.tagName&&a==="map"||o===Gw.YAMLSeq.tagName&&a==="seq")return ki(e,t,r,i,o);let c=t.schema.tags.find((p)=>p.tag===o&&p.collection===a);if(!c){let p=t.schema.knownTags[o];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else{if(p)i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0);else i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0);return ki(e,t,r,i,o)}}let l=ki(e,t,r,i,o,c),d=c.resolve?.(l,(p)=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??l,g=Hw.isNode(d)?d:new Vw.Scalar(d);if(g.range=l.range,g.tag=o,c?.format)g.format=c.format;return g}Qw.composeCollection=Jw});var xi=h(function(rS){var Ri=O();function Zw(e,t,r){let n=t.offset,i=eS(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?Ri.Scalar.BLOCK_FOLDED:Ri.Scalar.BLOCK_LITERAL,o=t.source?tS(t.source):[],a=o.length;for(let f=o.length-1;f>=0;--f){let y=o[f][1];if(y===""||y==="\r")a=f;else break}if(a===0){let f=i.chomp==="+"&&o.length>0?`
70
- `.repeat(Math.max(1,o.length-1)):"",y=n+i.length;if(t.source)y+=t.source.length;return{value:f,type:s,comment:i.comment,range:[n,y,y]}}let c=t.indent+i.indent,l=t.offset+i.length,d=0;for(let f=0;f<a;++f){let[y,S]=o[f];if(S===""||S==="\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(d=f,c===0&&!e.atRoot)r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=y.length+S.length+1}for(let f=o.length-1;f>=a;--f)if(o[f][0].length>c)a=f+1;let g="",p="",u=!1;for(let f=0;f<d;++f)g+=o[f][0].slice(c)+`
71
- `;for(let f=d;f<a;++f){let[y,S]=o[f];l+=y.length+S.length+1;let C=S[S.length-1]==="\r";if(C)S=S.slice(0,-1);if(S&&y.length<c){let R=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-S.length-(C?2:1),"BAD_INDENT",R),y=""}if(s===Ri.Scalar.BLOCK_LITERAL)g+=p+y.slice(c)+S,p=`
72
- `;else if(y.length>c||S[0]==="\t"){if(p===" ")p=`
73
- `;else if(!u&&p===`
74
- `)p=`
60
+ ${s}
61
+ ${c}
62
+ `}};PC.YAMLError=mi;PC.YAMLParseError=pu;PC.YAMLWarning=uu;PC.prettifyError=RC});var Mn=w(function(BC){function _C(e,{flow:t,indicator:n,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,d=a,p="",m="",u=!1,f=!1,g=null,h=null,b=null,y=null,v=null,k=null,S=null;for(let C of e){if(f){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");f=!1}if(g){if(c&&C.type!=="comment"&&C.type!=="newline")o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");g=null}switch(C.type){case"space":if(!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&C.source.includes("\t"))g=C;d=!0;break;case"comment":{if(!d)o(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=C.source.substring(1)||" ";if(!p)p=R;else p+=m+R;m="",c=!1;break}case"newline":if(c){if(p)p+=C.source;else if(!k||n!=="seq-item-ind")l=!0}else m+=C.source;if(c=!0,u=!0,h||b)y=C;d=!0;break;case"anchor":if(h)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);h=C,S??(S=C.offset),c=!1,d=!1,f=!0;break;case"tag":{if(b)o(C,"MULTIPLE_TAGS","A node can have at most one tag");b=C,S??(S=C.offset),c=!1,d=!1,f=!0;break}case n:if(h||b)o(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`);if(k)o(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`);k=C,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){if(v)o(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);v=C,c=!1,d=!1;break}default:o(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,d=!1}}let x=e[e.length-1],T=x?x.offset+x.source.length:i;if(f&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!==""))o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(g&&(c&&g.indent<=s||r?.type==="block-map"||r?.type==="block-seq"))o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:v,found:k,spaceBefore:l,comment:p,hasNewline:u,anchor:h,tag:b,newlineAfterProp:y,end:T,start:S??T}}BC.resolveProps=_C});var gi=w(function(LC){function Os(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
63
+ `))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 n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(Os(t.key)||Os(t.value))return!0}return!1;default:return!0}}LC.containsNewline=Os});var Ns=w(function(UC){var $C=gi();function FC(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];if(r.indent===e&&(r.source==="]"||r.source==="}")&&$C.containsNewline(t))n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}UC.flowIndentCheck=FC});var _s=w(function(VC){var mu=M();function qC(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==="function"?r:(o,s)=>o===s||mu.isScalar(o)&&mu.isScalar(s)&&o.value===s.value;return t.some((o)=>i(o.key,n))}VC.mapIncludes=qC});var bu=w(function(YC){var gu=Ye(),zC=Qe(),fu=Mn(),KC=gi(),hu=Ns(),GC=_s(),yu="All mapping items must start at the same column";function WC({composeNode:e,composeEmptyNode:t},n,r,i,o){let a=new(o?.nodeClass??zC.YAMLMap)(n.schema);if(n.atRoot)n.atRoot=!1;let l=r.offset,c=null;for(let d of r.items){let{start:p,key:m,sep:u,value:f}=d,g=fu.resolveProps(p,{indicator:"explicit-key-ind",next:m??u?.[0],offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!g.found;if(h){if(m){if(m.type==="block-seq")i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in m&&m.indent!==r.indent)i(l,"BAD_INDENT",yu)}if(!g.anchor&&!g.tag&&!u){if(c=g.end,g.comment)if(a.comment)a.comment+=`
64
+ `+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||KC.containsNewline(m))i(m??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(g.found?.indent!==r.indent)i(l,"BAD_INDENT",yu);n.atKey=!0;let b=g.end,y=m?e(n,m,g,i):t(n,b,p,null,g,i);if(n.schema.compat)hu.flowIndentCheck(r.indent,m,i);if(n.atKey=!1,GC.mapIncludes(n,a.items,y))i(b,"DUPLICATE_KEY","Map keys must be unique");let v=fu.resolveProps(u??[],{indicator:"map-value-ind",next:f,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!m||m.type==="block-scalar"});if(l=v.end,v.found){if(h){if(f?.type==="block-map"&&!v.hasNewline)i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(n.options.strict&&g.start<v.found.offset-1024)i(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let k=f?e(n,f,v,i):t(n,l,u,null,v,i);if(n.schema.compat)hu.flowIndentCheck(r.indent,f,i);l=k.range[2];let S=new gu.Pair(y,k);if(n.options.keepSourceTokens)S.srcToken=d;a.items.push(S)}else{if(h)i(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(v.comment)if(y.comment)y.comment+=`
65
+ `+v.comment;else y.comment=v.comment;let k=new gu.Pair(y);if(n.options.keepSourceTokens)k.srcToken=d;a.items.push(k)}}if(c&&c<l)i(c,"IMPOSSIBLE","Map comment with trailing content");return a.range=[r.offset,l,c??l],a}YC.resolveBlockMap=WC});var vu=w(function(tI){var QC=Xe(),XC=Mn(),ZC=Ns();function eI({composeNode:e,composeEmptyNode:t},n,r,i,o){let a=new(o?.nodeClass??QC.YAMLSeq)(n.schema);if(n.atRoot)n.atRoot=!1;if(n.atKey)n.atKey=!1;let l=r.offset,c=null;for(let{start:d,value:p}of r.items){let m=XC.resolveProps(d,{indicator:"seq-item-ind",next:p,offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||p)if(p?.type==="block-seq")i(m.end,"BAD_INDENT","All sequence items must start at the same column");else i(l,"MISSING_CHAR","Sequence item without - indicator");else{if(c=m.end,m.comment)a.comment=m.comment;continue}let u=p?e(n,p,m,i):t(n,m.end,d,null,m,i);if(n.schema.compat)ZC.flowIndentCheck(r.indent,p,i);l=u.range[2],a.items.push(u)}return a.range=[r.offset,l,c??l],a}tI.resolveBlockSeq=eI});var qt=w(function(iI){function rI(e,t,n,r){let i="";if(e){let o=!1,s="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{if(n&&!o)r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";if(!i)i=d;else i+=s+d;s="";break}case"newline":if(i)s+=l;o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}iI.resolveEnd=rI});var Su=w(function(mI){var sI=M(),aI=Ye(),ku=Qe(),lI=Xe(),cI=qt(),wu=Mn(),dI=gi(),pI=_s(),Bs="Block collections are not allowed within flow collections",Ds=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function uI({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",c=new(o?.nodeClass??(s?ku.YAMLMap:lI.YAMLSeq))(n.schema);c.flow=!0;let d=n.atRoot;if(d)n.atRoot=!1;if(n.atKey)n.atKey=!1;let p=r.offset+r.start.source.length;for(let h=0;h<r.items.length;++h){let b=r.items[h],{start:y,key:v,sep:k,value:S}=b,x=wu.resolveProps(y,{flow:a,indicator:"explicit-key-ind",next:v??k?.[0],offset:p,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!k&&!S){if(h===0&&x.comma)i(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(h<r.items.length-1)i(x.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(x.comment)if(c.comment)c.comment+=`
66
+ `+x.comment;else c.comment=x.comment;p=x.end;continue}if(!s&&n.options.strict&&dI.containsNewline(v))i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0){if(x.comma)i(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!x.comma)i(x.start,"MISSING_CHAR",`Missing , between ${a} items`);if(x.comment){let T="";e:for(let C of y)switch(C.type){case"comma":case"space":break;case"comment":T=C.source.substring(1);break e;default:break e}if(T){let C=c.items[c.items.length-1];if(sI.isPair(C))C=C.value??C.key;if(C.comment)C.comment+=`
67
+ `+T;else C.comment=T;x.comment=x.comment.substring(T.length+1)}}}if(!s&&!k&&!x.found){let T=S?e(n,S,x,i):t(n,x.end,k,null,x,i);if(c.items.push(T),p=T.range[2],Ds(S))i(T.range,"BLOCK_IN_FLOW",Bs)}else{n.atKey=!0;let T=x.end,C=v?e(n,v,x,i):t(n,T,y,null,x,i);if(Ds(v))i(C.range,"BLOCK_IN_FLOW",Bs);n.atKey=!1;let R=wu.resolveProps(k??[],{flow:a,indicator:"map-value-ind",next:S,offset:C.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(R.found){if(!s&&!x.found&&n.options.strict){if(k)for(let B of k){if(B===R.found)break;if(B.type==="newline"){i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(x.start<R.found.offset-1024)i(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(S)if("source"in S&&S.source?.[0]===":")i(S,"MISSING_CHAR",`Missing space after : in ${a}`);else i(R.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let U=S?e(n,S,R,i):R.found?t(n,R.end,k,null,R,i):null;if(U){if(Ds(S))i(U.range,"BLOCK_IN_FLOW",Bs)}else if(R.comment)if(C.comment)C.comment+=`
68
+ `+R.comment;else C.comment=R.comment;let L=new aI.Pair(C,U);if(n.options.keepSourceTokens)L.srcToken=b;if(s){let B=c;if(pI.mapIncludes(n,B.items,C))i(T,"DUPLICATE_KEY","Map keys must be unique");B.items.push(L)}else{let B=new ku.YAMLMap(n.schema);B.flow=!0,B.items.push(L);let on=(U??C).range;B.range=[C.range[0],on[1],on[2]],c.items.push(B)}p=U?U.range[2]:R.end}}let m=s?"}":"]",[u,...f]=r.end,g=p;if(u?.source===m)g=u.offset+u.source.length;else{let h=a[0].toUpperCase()+a.substring(1),b=d?`${h} must end with a ${m}`:`${h} in block collection must be sufficiently indented and end with a ${m}`;if(i(p,d?"MISSING_CHAR":"BAD_INDENT",b),u&&u.source.length!==1)f.unshift(u)}if(f.length>0){let h=cI.resolveEnd(f,g,n.options.strict,i);if(h.comment)if(c.comment)c.comment+=`
69
+ `+h.comment;else c.comment=h.comment;c.range=[r.offset,g,h.offset]}else c.range=[r.offset,g,g];return c}mI.resolveFlowCollection=uI});var xu=w(function(xI){var fI=M(),hI=z(),yI=Qe(),bI=Xe(),vI=bu(),kI=vu(),wI=Su();function Ls(e,t,n,r,i,o){let s=n.type==="block-map"?vI.resolveBlockMap(e,t,n,r,o):n.type==="block-seq"?kI.resolveBlockSeq(e,t,n,r,o):wI.resolveFlowCollection(e,t,n,r,o),a=s.constructor;if(i==="!"||i===a.tagName)return s.tag=a.tagName,s;if(i)s.tag=i;return s}function SI(e,t,n,r,i){let o=r.tag,s=!o?null:t.directives.tagName(o.source,(m)=>i(o,"TAG_RESOLVE_FAILED",m));if(n.type==="block-seq"){let{anchor:m,newlineAfterProp:u}=r,f=m&&o?m.offset>o.offset?m:o:m??o;if(f&&(!u||u.offset<f.offset))i(f,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===yI.YAMLMap.tagName&&a==="map"||s===bI.YAMLSeq.tagName&&a==="seq")return Ls(e,t,n,i,s);let l=t.schema.tags.find((m)=>m.tag===s&&m.collection===a);if(!l){let m=t.schema.knownTags[s];if(m?.collection===a)t.schema.tags.push(Object.assign({},m,{default:!1})),l=m;else{if(m)i(o,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection??"scalar"}`,!0);else i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0);return Ls(e,t,n,i,s)}}let c=Ls(e,t,n,i,s,l),d=l.resolve?.(c,(m)=>i(o,"TAG_RESOLVE_FAILED",m),t.options)??c,p=fI.isNode(d)?d:new hI.Scalar(d);if(p.range=c.range,p.tag=s,l?.format)p.format=l.format;return p}xI.composeCollection=SI});var $s=w(function(PI){var Ms=z();function II(e,t,n){let r=t.offset,i=AI(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?Ms.Scalar.BLOCK_FOLDED:Ms.Scalar.BLOCK_LITERAL,s=t.source?RI(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&s.length>0?`
70
+ `.repeat(Math.max(1,s.length-1)):"",h=r+i.length;if(t.source)h+=t.source.length;return{value:g,type:o,comment:i.comment,range:[r,h,h]}}let l=t.indent+i.indent,c=t.offset+i.length,d=0;for(let g=0;g<a;++g){let[h,b]=s[g];if(b===""||b==="\r"){if(i.indent===0&&h.length>l)l=h.length}else{if(h.length<l)n(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)l=h.length;if(d=g,l===0&&!e.atRoot)n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+b.length+1}for(let g=s.length-1;g>=a;--g)if(s[g][0].length>l)a=g+1;let p="",m="",u=!1;for(let g=0;g<d;++g)p+=s[g][0].slice(l)+`
71
+ `;for(let g=d;g<a;++g){let[h,b]=s[g];c+=h.length+b.length+1;let y=b[b.length-1]==="\r";if(y)b=b.slice(0,-1);if(b&&h.length<l){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(c-b.length-(y?2:1),"BAD_INDENT",k),h=""}if(o===Ms.Scalar.BLOCK_LITERAL)p+=m+h.slice(l)+b,m=`
72
+ `;else if(h.length>l||b[0]==="\t"){if(m===" ")m=`
73
+ `;else if(!u&&m===`
74
+ `)m=`
75
75
 
76
- `;g+=p+y.slice(c)+S,p=`
77
- `,u=!0}else if(S==="")if(p===`
78
- `)g+=`
79
- `;else p=`
80
- `;else g+=p+S,p=" ",u=!1}switch(i.chomp){case"-":break;case"+":for(let f=a;f<o.length;++f)g+=`
81
- `+o[f][0].slice(c);if(g[g.length-1]!==`
82
- `)g+=`
83
- `;break;default:g+=`
84
- `}let m=n+i.length+t.source.length;return{value:g,type:s,comment:i.comment,range:[n,m,m]}}function eS({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],s=i[0],o=0,a="",c=-1;for(let p=1;p<i.length;++p){let u=i[p];if(!a&&(u==="-"||u==="+"))a=u;else{let m=Number(u);if(!o&&m)o=m;else if(c===-1)c=e+p}}if(c!==-1)n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,d="",g=i.length;for(let p=1;p<t.length;++p){let u=t[p];switch(u.type){case"space":l=!0;case"newline":g+=u.source.length;break;case"comment":if(r&&!l)n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");g+=u.source.length,d=u.source.substring(1);break;case"error":n(u,"UNEXPECTED_TOKEN",u.message),g+=u.source.length;break;default:{let m=`Unexpected token in block scalar header: ${u.type}`;n(u,"UNEXPECTED_TOKEN",m);let f=u.source;if(f&&typeof f==="string")g+=f.length}}}return{mode:s,indent:o,chomp:a,comment:d,length:g}}function tS(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<t.length;o+=2)s.push([t[o],t[o+1]]);return s}rS.resolveBlockScalar=Zw});var Ai=h(function(pS){var Ii=O(),iS=Qe();function sS(e,t,r){let{offset:n,type:i,source:s,end:o}=e,a,c,l=(p,u,m)=>r(n+p,u,m);switch(i){case"scalar":a=Ii.Scalar.PLAIN,c=oS(s,l);break;case"single-quoted-scalar":a=Ii.Scalar.QUOTE_SINGLE,c=aS(s,l);break;case"double-quoted-scalar":a=Ii.Scalar.QUOTE_DOUBLE,c=cS(s,l);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let d=n+s.length,g=iS.resolveEnd(o,d,t,r);return{value:c,type:a,comment:g.comment,range:[n,d,g.offset]}}function oS(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 aS(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 s=r[1].replace(n,""),o=" ",a=t.lastIndex;while(r=t.exec(e)){let l=r[1].replace(i,"");if(l==="")if(o===`
85
- `)s+=o;else o=`
86
- `;else s+=o+l,o=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),s+o+(r?.[1]??"")}function cS(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
76
+ `;p+=m+h.slice(l)+b,m=`
77
+ `,u=!0}else if(b==="")if(m===`
78
+ `)p+=`
79
+ `;else m=`
80
+ `;else p+=m+b,m=" ",u=!1}switch(i.chomp){case"-":break;case"+":for(let g=a;g<s.length;++g)p+=`
81
+ `+s[g][0].slice(l);if(p[p.length-1]!==`
82
+ `)p+=`
83
+ `;break;default:p+=`
84
+ `}let f=r+i.length+t.source.length;return{value:p,type:o,comment:i.comment,range:[r,f,f]}}function AI({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],o=i[0],s=0,a="",l=-1;for(let m=1;m<i.length;++m){let u=i[m];if(!a&&(u==="-"||u==="+"))a=u;else{let f=Number(u);if(!s&&f)s=f;else if(l===-1)l=e+m}}if(l!==-1)r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",p=i.length;for(let m=1;m<t.length;++m){let u=t[m];switch(u.type){case"space":c=!0;case"newline":p+=u.source.length;break;case"comment":if(n&&!c)r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");p+=u.source.length,d=u.source.substring(1);break;case"error":r(u,"UNEXPECTED_TOKEN",u.message),p+=u.source.length;break;default:{let f=`Unexpected token in block scalar header: ${u.type}`;r(u,"UNEXPECTED_TOKEN",f);let g=u.source;if(g&&typeof g==="string")p+=g.length}}}return{mode:o,indent:s,chomp:a,comment:d,length:p}}function RI(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),o=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}PI.resolveBlockScalar=II});var Us=w(function($I){var Fs=z(),EI=qt();function OI(e,t,n){let{offset:r,type:i,source:o,end:s}=e,a,l,c=(m,u,f)=>n(r+m,u,f);switch(i){case"scalar":a=Fs.Scalar.PLAIN,l=NI(o,c);break;case"single-quoted-scalar":a=Fs.Scalar.QUOTE_SINGLE,l=_I(o,c);break;case"double-quoted-scalar":a=Fs.Scalar.QUOTE_DOUBLE,l=BI(o,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let d=r+o.length,p=EI.resolveEnd(s,d,t,n);return{value:l,type:a,comment:p.comment,range:[r,d,p.offset]}}function NI(e,t){let n="";switch(e[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}if(n)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`);return Cu(e)}function _I(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return Cu(e.slice(1,-1)).replace(/''/g,"'")}function Cu(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=new RegExp("(?<![ \t])[ \t]+$"),i=new RegExp("^[ \t]+|(?<![ \t])[ \t]+$","g")}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let o=n[1].replace(r,""),s=" ",a=t.lastIndex;while(n=t.exec(e)){let c=n[1].replace(i,"");if(c==="")if(s===`
85
+ `)o+=s;else s=`
86
+ `;else o+=s+c,s=" ";a=t.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(e),o+s+(n?.[1]??"")}function BI(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if(i==="\r"&&e[r+1]===`
87
87
  `)continue;if(i===`
88
- `){let{fold:s,offset:o}=lS(e,n);r+=s,n=o}else if(i==="\\"){let s=e[++n],o=uS[s];if(o)r+=o;else if(s===`
89
- `){s=e[n+1];while(s===" "||s==="\t")s=e[++n+1]}else if(s==="\r"&&e[n+1]===`
90
- `){s=e[++n+1];while(s===" "||s==="\t")s=e[++n+1]}else if(s==="x"||s==="u"||s==="U"){let a=s==="x"?2:s==="u"?4:8;r+=dS(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 s=n,o=e[n+1];while(o===" "||o==="\t")o=e[++n+1];if(o!==`
91
- `&&!(o==="\r"&&e[n+2]===`
92
- `))r+=n>s?e.slice(s,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 lS(e,t){let r="",n=e[t+1];while(n===" "||n==="\t"||n===`
93
- `||n==="\r"){if(n==="\r"&&e[t+2]!==`
94
- `)break;if(n===`
95
- `)r+=`
96
- `;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var uS={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
97
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function dS(e,t,r,n){let i=e.substr(t,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}pS.resolveFlowScalar=sS});var Kc=h(function(wS){var Le=E(),Gc=O(),fS=xi(),mS=Ai();function yS(e,t,r,n){let{value:i,type:s,comment:o,range:a}=t.type==="block-scalar"?fS.resolveBlockScalar(e,t,n):mS.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,(g)=>n(r,"TAG_RESOLVE_FAILED",g)):null,l;if(e.options.stringKeys&&e.atKey)l=e.schema[Le.SCALAR];else if(c)l=hS(e.schema,i,c,r,n);else if(t.type==="scalar")l=bS(e,i,t,n);else l=e.schema[Le.SCALAR];let d;try{let g=l.resolve(i,(p)=>n(r??t,"TAG_RESOLVE_FAILED",p),e.options);d=Le.isScalar(g)?g:new Gc.Scalar(g)}catch(g){let p=g instanceof Error?g.message:String(g);n(r??t,"TAG_RESOLVE_FAILED",p),d=new Gc.Scalar(i)}if(d.range=a,d.source=i,s)d.type=s;if(c)d.tag=c;if(l.format)d.format=l.format;if(o)d.comment=o;return d}function hS(e,t,r,n,i){if(r==="!")return e[Le.SCALAR];let s=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(t))return a;let o=e.knownTags[r];if(o&&!o.collection)return e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[Le.SCALAR]}function bS({atKey:e,directives:t,schema:r},n,i,s){let o=r.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[Le.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(n))??r[Le.SCALAR];if(o.tag!==a.tag){let c=t.tagString(o.tag),l=t.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}wS.composeScalar=yS});var Wc=h(function(CS){function vS(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}CS.emptyScalarPosition=vS});var Qc=h(function(OS){var RS=mt(),xS=E(),IS=Vc(),Yc=Kc(),AS=Qe(),ES=Wc(),PS={composeNode:Jc,composeEmptyNode:Ei};function Jc(e,t,r,n){let i=e.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=r,l,d=!0;switch(t.type){case"alias":if(l=TS(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=Yc.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=IS.composeCollection(PS,e,t,r,n),a)l.anchor=a.source.substring(1)}catch(g){let p=g instanceof Error?g.message:String(g);n(t,"RESOURCE_EXHAUSTION",p)}break;default:{let g=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",g),d=!1}}if(l??(l=Ei(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&&(!xS.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(s)l.spaceBefore=!0;if(o)if(t.type==="scalar"&&t.source==="")l.comment=o;else l.commentBefore=o;if(e.options.keepSourceTokens&&d)l.srcToken=t;return l}function Ei(e,t,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let d={type:"scalar",offset:ES.emptyScalarPosition(t,r,n),indent:-1,source:""},g=Yc.composeScalar(e,d,a,l);if(o){if(g.anchor=o.source.substring(1),g.anchor==="")l(o,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)g.spaceBefore=!0;if(s)g.comment=s,g.range[2]=c;return g}function TS({options:e},{offset:t,source:r,end:n},i){let s=new RS.Alias(r.substring(1));if(s.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(s.source.endsWith(":"))i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+r.length,a=AS.resolveEnd(n,o,e.strict,i);if(s.range=[t,o,a.offset],a.comment)s.comment=a.comment;return s}OS.composeEmptyNode=Ei;OS.composeNode=Jc});var Zc=h(function(BS){var NS=Pt(),Xc=Qc(),_S=Qe(),MS=Ot();function $S(e,t,{offset:r,start:n,value:i,end:s},o){let a=Object.assign({_directives:t},e),c=new NS.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=MS.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});if(d.found){if(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline)o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=i?Xc.composeNode(l,i,d,o):Xc.composeEmptyNode(l,d.end,n,null,d,o);let g=c.contents.range[2],p=_S.resolveEnd(s,g,!1,o);if(p.comment)c.comment=p.comment;return c.range=[r,g,p.offset],c}BS.composeDoc=$S});var Pi=h(function(zS){var FS=Ut("process"),jS=Ln(),US=Pt(),Dt=Tt(),el=E(),HS=Zc(),VS=Qe();function Lt(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 tl(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(t===""?"":n?`
88
+ `){let{fold:o,offset:s}=DI(e,r);n+=o,r=s}else if(i==="\\"){let o=e[++r],s=LI[o];if(s)n+=s;else if(o===`
89
+ `){o=e[r+1];while(o===" "||o==="\t")o=e[++r+1]}else if(o==="\r"&&e[r+1]===`
90
+ `){o=e[++r+1];while(o===" "||o==="\t")o=e[++r+1]}else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=MI(e,r+1,a,t),r+=a}else{let a=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i==="\t"){let o=r,s=e[r+1];while(s===" "||s==="\t")s=e[++r+1];if(s!==`
91
+ `&&!(s==="\r"&&e[r+2]===`
92
+ `))n+=r>o?e.slice(o,r+1):i}else n+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}function DI(e,t){let n="",r=e[t+1];while(r===" "||r==="\t"||r===`
93
+ `||r==="\r"){if(r==="\r"&&e[t+2]!==`
94
+ `)break;if(r===`
95
+ `)n+=`
96
+ `;t+=1,r=e[t+1]}if(!n)n=" ";return{fold:n,offset:t}}var LI={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
97
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function MI(e,t,n,r){let i=e.substr(t,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}$I.resolveFlowScalar=OI});var Au=w(function(zI){var kt=M(),Iu=z(),UI=$s(),jI=Us();function qI(e,t,n,r){let{value:i,type:o,comment:s,range:a}=t.type==="block-scalar"?UI.resolveBlockScalar(e,t,r):jI.resolveFlowScalar(t,e.options.strict,r),l=n?e.directives.tagName(n.source,(p)=>r(n,"TAG_RESOLVE_FAILED",p)):null,c;if(e.options.stringKeys&&e.atKey)c=e.schema[kt.SCALAR];else if(l)c=VI(e.schema,i,l,n,r);else if(t.type==="scalar")c=HI(e,i,t,r);else c=e.schema[kt.SCALAR];let d;try{let p=c.resolve(i,(m)=>r(n??t,"TAG_RESOLVE_FAILED",m),e.options);d=kt.isScalar(p)?p:new Iu.Scalar(p)}catch(p){let m=p instanceof Error?p.message:String(p);r(n??t,"TAG_RESOLVE_FAILED",m),d=new Iu.Scalar(i)}if(d.range=a,d.source=i,o)d.type=o;if(l)d.tag=l;if(c.format)d.format=c.format;if(s)d.comment=s;return d}function VI(e,t,n,r,i){if(n==="!")return e[kt.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)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[n];if(s&&!s.collection)return e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s;return i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[kt.SCALAR]}function HI({atKey:e,directives:t,schema:n},r,i,o){let s=n.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(r))||n[kt.SCALAR];if(n.compat){let a=n.compat.find((l)=>l.default&&l.test?.test(r))??n[kt.SCALAR];if(s.tag!==a.tag){let l=t.tagString(s.tag),c=t.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;o(i,"TAG_RESOLVE_FAILED",d,!0)}}return s}zI.composeScalar=qI});var Ru=w(function(WI){function GI(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++r];while(i?.type==="space")e+=i.source.length,i=t[++r];break}}return e}WI.emptyScalarPosition=GI});var Eu=w(function(rA){var JI=wn(),QI=M(),XI=xu(),Pu=Au(),ZI=qt(),eA=Ru(),tA={composeNode:Tu,composeEmptyNode:js};function Tu(e,t,n,r){let i=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=n,c,d=!0;switch(t.type){case"alias":if(c=nA(e,t,r),a||l)r(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(c=Pu.composeScalar(e,t,l,r),a)c.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(c=XI.composeCollection(tA,e,t,n,r),a)c.anchor=a.source.substring(1)}catch(p){let m=p instanceof Error?p.message:String(p);r(t,"RESOURCE_EXHAUSTION",m)}break;default:{let p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",p),d=!1}}if(c??(c=js(e,t.offset,void 0,null,n,r)),a&&c.anchor==="")r(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!QI.isScalar(c)||typeof c.value!=="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str"))r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(o)c.spaceBefore=!0;if(s)if(t.type==="scalar"&&t.source==="")c.comment=s;else c.commentBefore=s;if(e.options.keepSourceTokens&&d)c.srcToken=t;return c}function js(e,t,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:l},c){let d={type:"scalar",offset:eA.emptyScalarPosition(t,n,r),indent:-1,source:""},p=Pu.composeScalar(e,d,a,c);if(s){if(p.anchor=s.source.substring(1),p.anchor==="")c(s,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)p.spaceBefore=!0;if(o)p.comment=o,p.range[2]=l;return p}function nA({options:e},{offset:t,source:n,end:r},i){let o=new JI.Alias(n.substring(1));if(o.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(o.source.endsWith(":"))i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=ZI.resolveEnd(r,s,e.strict,i);if(o.range=[t,s,a.offset],a.comment)o.comment=a.comment;return o}rA.composeEmptyNode=js;rA.composeNode=Tu});var Nu=w(function(dA){var sA=Dn(),Ou=Eu(),aA=qt(),lA=Mn();function cA(e,t,{offset:n,start:r,value:i,end:o},s){let a=Object.assign({_directives:t},e),l=new sA.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=lA.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});if(d.found){if(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline)s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}l.contents=i?Ou.composeNode(c,i,d,s):Ou.composeEmptyNode(c,d.end,r,null,d,s);let p=l.contents.range[2],m=aA.resolveEnd(o,p,!1,s);if(m.comment)l.comment=m.comment;return l.range=[n,p,m.offset],l}dA.composeDoc=cA});var qs=w(function(yA){var uA=lr("process"),mA=Ko(),gA=Dn(),$n=Ln(),_u=M(),fA=Nu(),hA=qt();function Fn(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:n}=e;return[t,t+(typeof n==="string"?n.length:1)]}function Bu(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let o=e[i];switch(o[0]){case"#":t+=(t===""?"":r?`
98
98
 
99
99
  `:`
100
- `)+(s.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 rl{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,i)=>{let s=Lt(t);if(i)this.warnings.push(new Dt.YAMLWarning(s,r,n));else this.errors.push(new Dt.YAMLParseError(s,r,n))},this.directives=new jS.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=tl(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
101
- ${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(el.isCollection(i)&&!i.flow&&i.items.length>0){let s=i.items[0];if(el.isPair(s))s=s.key;let o=s.commentBefore;s.commentBefore=o?`${r}
102
- ${o}`:r}else{let s=i.commentBefore;i.commentBefore=s?`${r}
103
- ${s}`: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:tl(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(FS.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let i=Lt(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=HS.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 Dt.YAMLParseError(Lt(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 Dt.YAMLParseError(Lt(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=VS.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}
104
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Dt.YAMLParseError(Lt(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 US.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}}}zS.Composer=rl});var sl=h(function(ev){var KS=xi(),WS=Ai(),YS=Tt(),nl=wt();function JS(e,t=!0,r){if(e){let n=(i,s,o)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,s,o);else throw new YS.YAMLParseError([a,a+1],s,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return WS.resolveFlowScalar(e,t,n);case"block-scalar":return KS.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function QS(e,t){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=t,a=nl.stringifyString({type:o,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:`
105
- `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
106
- `),d=a.substring(0,l),g=a.substring(l+1)+`
107
- `,p=[{type:"block-scalar-header",offset:s,indent:n,source:d}];if(!il(p,c))p.push({type:"newline",offset:-1,indent:n,source:`
108
- `});return{type:"block-scalar",offset:s,indent:n,props:p,source:g}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:a,end:c};default:return{type:"scalar",offset:s,indent:n,source:a,end:c}}}function XS(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=r,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=nl.stringifyString({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ZS(e,c);break;case'"':Ti(e,c,"double-quoted-scalar");break;case"'":Ti(e,c,"single-quoted-scalar");break;default:Ti(e,c,"scalar")}}function ZS(e,t){let r=t.indexOf(`
109
- `),n=t.substring(0,r),i=t.substring(r+1)+`
110
- `;if(e.type==="block-scalar"){let s=e.props[0];if(s.type!=="block-scalar-header")throw Error("Invalid block scalar header");s.source=n,e.source=i}else{let{offset:s}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:n}];if(!il(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:o,source:`
111
- `});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function il(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 Ti(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 s of n)s.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:`
112
- `};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((s)=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(e))if(s!=="type"&&s!=="offset")delete e[s];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}ev.createScalarToken=QS;ev.resolveAsScalar=JS;ev.setScalarValue=XS});var ol=h(function(sv){var iv=(e)=>("type"in e)?Wr(e):Kr(e);function Wr(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=Wr(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=Kr(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=Kr(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=Kr(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 Kr({start:e,key:t,sep:r,value:n}){let i="";for(let s of e)i+=s.source;if(t)i+=Wr(t);if(r)for(let s of r)i+=s.source;if(n)i+=Wr(n);return i}sv.stringify=iv});var ll=h(function(cv){var Oi=Symbol("break visit"),av=Symbol("skip children"),al=Symbol("remove item");function Ne(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};cl(Object.freeze([]),e,t)}Ne.BREAK=Oi;Ne.SKIP=av;Ne.REMOVE=al;Ne.itemAtPath=(e,t)=>{let r=e;for(let[n,i]of t){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};Ne.parentCollection=(e,t)=>{let r=Ne.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 cl(e,t,r){let n=r(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let s=t[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=cl(Object.freeze(e.concat([[i,o]])),s.items[o],r);if(typeof a==="number")o=a-1;else if(a===Oi)return Oi;else if(a===al)s.items.splice(o,1),o-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}cv.visit=Ne});var Yr=h(function(yv){var Di=sl(),uv=ol(),dv=ll(),Li="\uFEFF",Ni="\x02",_i="\x18",Mi="\x1F",pv=(e)=>!!e&&("items"in e),gv=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function fv(e){switch(e){case Li:return"<BOM>";case Ni:return"<DOC>";case _i:return"<FLOW_END>";case Mi:return"<SCALAR>";default:return JSON.stringify(e)}}function mv(e){switch(e){case Li:return"byte-order-mark";case Ni:return"doc-mode";case _i:return"flow-error-end";case Mi:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
100
+ `)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;n=!1;break;default:if(!n)r=!0;n=!1}}return{comment:t,afterEmptyLine:r}}class Du{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,r,i)=>{let o=Fn(t);if(i)this.warnings.push(new $n.YAMLWarning(o,n,r));else this.errors.push(new $n.YAMLParseError(o,n,r))},this.directives=new mA.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Bu(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
101
+ ${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(_u.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];if(_u.isPair(o))o=o.key;let s=o.commentBefore;o.commentBefore=s?`${n}
102
+ ${s}`:n}else{let o=i.commentBefore;i.commentBefore=o?`${n}
103
+ ${o}`:n}}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:Bu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let r of e)yield*this.next(r);yield*this.end(t,n)}*next(e){if(uA.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let i=Fn(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=fA.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,n=new $n.YAMLParseError(Fn(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(n);else this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){this.errors.push(new $n.YAMLParseError(Fn(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=hA.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
104
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new $n.YAMLParseError(Fn(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 n=Object.assign({_directives:this.directives},this.options),r=new gA.Document(void 0,n);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");r.range=[0,t,t],this.decorate(r,!1),yield r}}}yA.Composer=Du});var $u=w(function(AA){var vA=$s(),kA=Us(),wA=Ln(),Lu=In();function SA(e,t=!0,n){if(e){let r=(i,o,s)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,o,s);else throw new wA.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return kA.resolveFlowScalar(e,t,r);case"block-scalar":return vA.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function xA(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=t,a=Lu.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:r,source:`
105
+ `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
106
+ `),d=a.substring(0,c),p=a.substring(c+1)+`
107
+ `,m=[{type:"block-scalar-header",offset:o,indent:r,source:d}];if(!Mu(m,l))m.push({type:"newline",offset:-1,indent:r,source:`
108
+ `});return{type:"block-scalar",offset:o,indent:r,props:m,source:p}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:l};default:return{type:"scalar",offset:o,indent:r,source:a,end:l}}}function CA(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(r&&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 c=e.props[0];if(c.type!=="block-scalar-header")throw Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=Lu.stringifyString({type:s,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":IA(e,l);break;case'"':Vs(e,l,"double-quoted-scalar");break;case"'":Vs(e,l,"single-quoted-scalar");break;default:Vs(e,l,"scalar")}}function IA(e,t){let n=t.indexOf(`
109
+ `),r=t.substring(0,n),i=t.substring(n+1)+`
110
+ `;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw Error("Invalid block scalar header");o.source=r,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:r}];if(!Mu(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:s,source:`
111
+ `});for(let l of Object.keys(e))if(l!=="type"&&l!=="offset")delete e[l];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function Mu(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Vs(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=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 r)o.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
112
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="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:n,indent:r,source:t,end:i})}}}AA.createScalarToken=xA;AA.resolveAsScalar=SA;AA.setScalarValue=CA});var Fu=w(function(OA){var EA=(e)=>("type"in e)?hi(e):fi(e);function hi(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=hi(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=fi(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=fi(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=fi(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function fi({start:e,key:t,sep:n,value:r}){let i="";for(let o of e)i+=o.source;if(t)i+=hi(t);if(n)for(let o of n)i+=o.source;if(r)i+=hi(r);return i}OA.stringify=EA});var qu=w(function(BA){var Hs=Symbol("break visit"),_A=Symbol("skip children"),Uu=Symbol("remove item");function wt(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};ju(Object.freeze([]),e,t)}wt.BREAK=Hs;wt.SKIP=_A;wt.REMOVE=Uu;wt.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};wt.parentCollection=(e,t)=>{let n=wt.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function ju(e,t,n){let r=n(t,e);if(typeof r==="symbol")return r;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=ju(Object.freeze(e.concat([[i,s]])),o.items[s],n);if(typeof a==="number")s=a-1;else if(a===Hs)return Hs;else if(a===Uu)o.items.splice(s,1),s-=1}if(typeof r==="function"&&i==="key")r=r(t,e)}}return typeof r==="function"?r(t,e):r}BA.visit=wt});var yi=w(function(qA){var zs=$u(),LA=Fu(),MA=qu(),Ks="\uFEFF",Gs="\x02",Ws="\x18",Ys="\x1F",$A=(e)=>!!e&&("items"in e),FA=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function UA(e){switch(e){case Ks:return"<BOM>";case Gs:return"<DOC>";case Ws:return"<FLOW_END>";case Ys:return"<SCALAR>";default:return JSON.stringify(e)}}function jA(e){switch(e){case Ks:return"byte-order-mark";case Gs:return"doc-mode";case Ws:return"flow-error-end";case Ys:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
113
113
  `:case`\r
114
- `: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}yv.createScalarToken=Di.createScalarToken;yv.resolveAsScalar=Di.resolveAsScalar;yv.setScalarValue=Di.setScalarValue;yv.stringify=uv.stringify;yv.visit=dv.visit;yv.BOM=Li;yv.DOCUMENT=Ni;yv.FLOW_END=_i;yv.SCALAR=Mi;yv.isCollection=pv;yv.isScalar=gv;yv.prettyToken=fv;yv.tokenType=mv});var Bi=h(function(Dv){var Nt=Yr();function re(e){switch(e){case void 0:case" ":case`
115
- `:case"\r":case"\t":return!0;default:return!1}}var ul=new Set("0123456789ABCDEFabcdef"),Tv=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jr=new Set(",[]{}"),Ov=new Set(` ,[]{}
116
- \r `),$i=(e)=>!e||Ov.has(e);class dl{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===`
114
+ `: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}qA.createScalarToken=zs.createScalarToken;qA.resolveAsScalar=zs.resolveAsScalar;qA.setScalarValue=zs.setScalarValue;qA.stringify=LA.stringify;qA.visit=MA.visit;qA.BOM=Ks;qA.DOCUMENT=Gs;qA.FLOW_END=Ws;qA.SCALAR=Ys;qA.isCollection=$A;qA.isScalar=FA;qA.prettyToken=UA;qA.tokenType=jA});var Qs=w(function(i0){var Un=yi();function xe(e){switch(e){case void 0:case" ":case`
115
+ `:case"\r":case"\t":return!0;default:return!1}}var Vu=new Set("0123456789ABCDEFabcdef"),n0=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),bi=new Set(",[]{}"),r0=new Set(` ,[]{}
116
+ \r `),Js=(e)=>!e||r0.has(e);class Hu{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 n=this.next??"stream";while(n&&(t||this.hasChars(1)))n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
117
117
  `)return!0;if(t==="\r")return this.buffer[e+1]===`
118
- `;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===`
119
- `||!n&&!this.atEnd)return e+r+1}return t===`
120
- `||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&re(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(`
121
- `,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]===Nt.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 Nt.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==="...")&&re(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&&!re(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===":")&&re(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($i),"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("..."))&&re(n[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Nt.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($i),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||re(s)||s===",")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(`
122
- `,this.pos);if(n!==-1){while(n!==-1){let i=this.continueScalar(n+1);if(i===-1)break;n=r.indexOf(`
123
- `,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)=>re(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`
124
- `:e=i,t=0;break;case"\r":{let s=this.buffer[i+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
125
- `)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(`
126
- `,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===`
127
- `)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,s=this.buffer[i];if(s==="\r")s=this.buffer[--i];let o=i;while(s===" ")s=this.buffer[--i];if(s===`
128
- `&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Nt.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(re(i)||e&&Jr.has(i))break;t=r}else if(re(n)){let i=this.buffer[r+1];if(n==="\r")if(i===`
129
- `)r+=1,n=`
130
- `,i=this.buffer[r+1];else t=r;if(i==="#"||e&&Jr.has(i))break;if(n===`
131
- `){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(e&&Jr.has(n))break;t=r}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Nt.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($i),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(re(r)||t&&Jr.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(!re(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(Tv.has(t))t=this.buffer[++e];else if(t==="%"&&ul.has(this.buffer[e+1])&&ul.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===`
118
+ `;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;while(t===" ")t=this.buffer[++n+e];if(t==="\r"){let r=this.buffer[n+e+1];if(r===`
119
+ `||!r&&!this.atEnd)return e+n+1}return t===`
120
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&xe(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(`
121
+ `,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]===Un.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,n=e.indexOf("#");while(n!==-1){let i=e[n-1];if(i===" "||i==="\t"){t=n-1;break}else n=e.indexOf("#",n+1)}while(!0){let i=e[t-1];if(i===" "||i==="\t")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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 Un.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==="...")&&xe(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&&!xe(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===":")&&xe(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"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(Js),"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,n=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=n=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let r=this.getLine();if(r===null)return this.setNext("flow");if(n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&xe(r[3])){if(!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Un.FLOW_END,yield*this.parseLineStart()}let i=0;while(r[i]===",")i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.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(Js),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||xe(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 n=this.buffer.substring(0,t),r=n.indexOf(`
122
+ `,this.pos);if(r!==-1){while(r!==-1){let i=this.continueScalar(r+1);if(i===-1)break;r=n.indexOf(`
123
+ `,i)}if(r!==-1)t=r-(n[r-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)=>xe(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`
124
+ `:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
125
+ `)break}default:break e}if(!n&&!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(`
126
+ `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;n=this.buffer[r];while(n===" ")n=this.buffer[++r];if(n==="\t"){while(n==="\t"||n===" "||n==="\r"||n===`
127
+ `)n=this.buffer[++r];e=r-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===`
128
+ `&&i>=this.pos&&i+1+t>s)e=i;else break}while(!0);return yield Un.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;while(r=this.buffer[++n])if(r===":"){let i=this.buffer[n+1];if(xe(i)||e&&bi.has(i))break;t=n}else if(xe(r)){let i=this.buffer[n+1];if(r==="\r")if(i===`
129
+ `)n+=1,r=`
130
+ `,i=this.buffer[n+1];else t=n;if(i==="#"||e&&bi.has(i))break;if(r===`
131
+ `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&bi.has(r))break;t=n}if(!r&&!this.atEnd)return this.setNext("plain-scalar");return yield Un.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 n=this.buffer.slice(this.pos,e);if(n)return yield n,this.pos+=n.length,n.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(Js),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(xe(n)||t&&bi.has(n)){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(!xe(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(n0.has(t))t=this.buffer[++e];else if(t==="%"&&Vu.has(this.buffer[e+1])&&Vu.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===`
132
132
  `)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
133
- `)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)}}Dv.Lexer=dl});var qi=h(function(Nv){class pl{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}}}}Nv.LineCounter=pl});var Fi=h(function(Bv){var Mv=Ut("process"),gl=Yr(),$v=Bi();function Ce(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function fl(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 yl(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 Qr(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 Xe(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 Xr(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 ml(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!Ce(t.start,"explicit-key-ind")&&!Ce(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,yl(t.value))if(t.value.end)Xr(t.value.end,t.sep);else t.value.end=t.sep;else Xr(t.start,t.sep);delete t.sep}}}class hl{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 $v.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,Mv.env.LOG_TOKENS)console.log("|",gl.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=gl.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")ml(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&&fl(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(fl(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=Qr(this.peek(2)),r=Xe(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(`
133
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n==="\t");let r=t-this.pos;if(r>0)yield this.buffer.substr(this.pos,r),this.pos=t;return r}*pushUntil(e){let t=this.pos,n=this.buffer[t];while(!e(n))n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}i0.Lexer=Hu});var Xs=w(function(s0){class zu{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,n=this.lineStarts.length;while(t<n){let i=t+n>>1;if(this.lineStarts[i]<e)t=i+1;else n=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}s0.LineCounter=zu});var Zs=w(function(d0){var l0=lr("process"),Ku=yi(),c0=Qs();function Ze(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Gu(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 Yu(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 vi(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 Vt(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 ki(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Wu(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!Ze(t.start,"explicit-key-ind")&&!Ze(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,Yu(t.value))if(t.value.end)ki(t.value.end,t.sep);else t.value.end=t.sep;else ki(t.start,t.sep);delete t.sep}}}class Ju{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 c0.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);if(!t)yield*this.end()}*next(e){if(this.source=e,l0.env.LOG_TOKENS)console.log("|",Ku.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Ku.tokenType(e);if(!t){let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 n=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in n?n.indent:0;else if(t.type==="flow-collection"&&n.type==="document")t.indent=0;if(t.type==="flow-collection")Wu(t);switch(n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let r=n.items[n.items.length-1];if(r.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=n.items[n.items.length-1];if(r.value)n.items.push({start:[],value:t});else r.value=t;break}case"flow-collection":{let r=n.items[n.items.length-1];if(!r||r.value)n.items.push({start:[],key:t,sep:[]});else if(r.sep)r.value=t;else Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let r=t.items[t.items.length-1];if(r&&!r.sep&&!r.value&&r.start.length>0&&Gu(r.start)===-1&&(t.indent===0||r.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(n.type==="document")n.end=r.start;else n.items.push({start:r.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(Gu(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=vi(this.peek(2)),n=Vt(t),r;if(e.end)r=e.end,r.push(this.sourceToken),delete e.end;else r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};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(`
134
134
  `)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
135
- `,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)){Xr(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 s=[];for(let o=0;o<t.sep.length;++o){let a=t.sep[o];switch(a.type){case"newline":s.push(o);break;case"space":break;case"comment":if(a.indent>e.indent)s.length=0;break;default:s.length=0}}if(s.length>=2)i=t.sep.splice(s[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(Ce(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let s=Xe(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ce(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(yl(t.key)&&!Ce(t.sep,"newline")){let s=Xe(t.start),{key:o,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:s,key:o,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(Ce(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 s=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(s);else Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0;return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Ce(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(s);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)){Xr(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||Ce(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=Qr(r),i=Xe(n);ml(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
135
+ `,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 n="end"in t.value?t.value.end:void 0;if((Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment")n?.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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){ki(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&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(r||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(r||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(Ze(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Vt(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(Ze(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(Yu(t.key)&&!Ze(t.sep,"newline")){let o=Vt(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||r)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(Ze(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(r||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&&!Ze(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(n)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 n="end"in t.value?t.value.end:void 0;if((Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment")n?.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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){ki(r,t.start),r.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||Ze(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.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 r=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:r,sep:[]});else if(t.sep)this.stack.push(r);else Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);if(n)this.stack.push(n);else yield*this.pop(),yield*this.step()}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let r=vi(n),i=Vt(r);Wu(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(`
136
136
  `)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
137
- `,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()}}}Bv.Parser=hl});var Cl=h(function(Kv){var bl=Pi(),Fv=Pt(),_t=Tt(),jv=qn(),Uv=E(),Hv=qi(),wl=Fi();function Sl(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Hv.LineCounter||null,prettyErrors:t}}function Vv(e,t={}){let{lineCounter:r,prettyErrors:n}=Sl(t),i=new wl.Parser(r?.addNewLine),s=new bl.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 vl(e,t={}){let{lineCounter:r,prettyErrors:n}=Sl(t),i=new wl.Parser(r?.addNewLine),s=new bl.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 zv(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=vl(e,r);if(!i)return null;if(i.warnings.forEach((s)=>jv.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 Gv(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(Uv.isDocument(e)&&!n)return e.toString(r);return new Fv.Document(e,n,r).toString(r)}Kv.parse=zv;Kv.parseAllDocuments=Vv;Kv.parseDocument=vl;Kv.stringify=Gv});import{WebStandardStreamableHTTPServerTransport as fR}from"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";import{realpathSync as fu}from"node:fs";import{fileURLToPath as iR}from"node:url";import{Server as sR}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as oR}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as aR,ListToolsRequestSchema as cR}from"@modelcontextprotocol/sdk/types.js";var Ig=vu(na(),1);var ia=["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"]},sa={navigation:"sidebar",container:"fluid",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"};var Og={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},fI=Array.from(new Set(Object.values(Og).flat()));var lt=["component","template","design-guide","example","skill","block","package","theme"],je=["experimental","candidate","recommended"],oa=["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 Dg=["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"],wI=[...Dg,"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),aa=(e)=>ce(e)&&Object.entries(e).every(([t,r])=>z(t)&&z(r));function ca(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))||!aa(n.bindings.paths)||!aa(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 da=["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 la(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 Lg(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function Ng(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 _g(e){return`${pt}${e}`}function ua(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 Mg(){return ar.map((e)=>{let t={},r=[];for(let n of e.positionals)if(t[n.property]=ua(n.type,"variadic"in n&&n.variadic===!0),n.required)r.push(n.property);for(let n of e.options)t[n.property]=ua(n.type,"multiple"in n&&n.multiple===!0);return{name:_g(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class J extends Error{detail;code=da[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 $g(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(da[1],"resource query callback failed")}async function Bg(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),d=Object.fromEntries(["functions","scenarios","units","industries"].flatMap((u)=>{let m=Ae(t,u);return m?[[u,m]]:[]})),g=t.limit;if(g!==void 0&&(typeof g!=="number"||!Number.isInteger(g)||g<=0))throw new J("limit must be a positive integer");let p={...d,...i?{text:i}:{},...s?{kinds:s}:{},...o?{tags:o}:{},...a?{categories:a}:{},...c?{capabilities:c}:{},...l?{maturities:l}:{},...typeof g==="number"?{limit:g}:{}};return ee({data:{matches:await r.search(p)}})}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 $g(n)}}function pa(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"}}}},...Mg()];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 Bg(i,n,e.resourceQuery)}if(r==="uibot_request_component"){if(e.serviceAvailable===!1)return U(la(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(Lg(s))}if(r==="uibot_get_task_status"){if(e.serviceAvailable===!1)return U(la(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(Ng(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 ga(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 Zk}from"node:fs";import{fileURLToPath as os}from"node:url";var qg=["sidebar","surface","foreground","accent","accent-foreground","primary","primary-foreground","border","font","font-display","font-body","font-mono"],fa={type:"object",additionalProperties:!1,properties:Object.fromEntries(qg.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:fa,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 Xv=Pi(),Zv=Pt(),eC=gi(),ji=Tt(),tC=mt(),ke=E(),rC=be(),nC=O(),iC=Se(),sC=ve(),kP=Yr(),oC=Bi(),aC=qi(),cC=Fi(),Zr=Cl(),kl=gt();var lC=Xv.Composer,uC=Zv.Document,dC=eC.Schema,{YAMLError:pC,YAMLParseError:gC,YAMLWarning:fC}=ji,mC=tC.Alias,{isAlias:yC,isCollection:hC,isDocument:bC,isMap:wC,isNode:SC,isPair:vC,isScalar:CC,isSeq:kC}=ke,RC=rC.Pair,xC=nC.Scalar,IC=iC.YAMLMap,AC=sC.YAMLSeq;var EC=oC.Lexer,PC=aC.LineCounter,TC=cC.Parser,{parse:Re,parseAllDocuments:OC,parseDocument:DC,stringify:LC}=Zr,{visit:NC,visitAsync:_C}=kl;class F extends Error{code;details;constructor(e,t,r){super(t);this.name="CompileSpecError",this.code=e,this.details=r}}function MC(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=MC(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,d=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}:{},...d!==void 0?{visible:d}:{}},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 $C(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 Rl(e,t){return e.map((r)=>{if("children"in r&&Array.isArray(r.children))return{type:"MenuGroup",props:{title:r.label},children:Rl(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 BC(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:Rl(t,r.path)}]}}})}))}}function Ui(e,t={}){let r=Boolean(e.menus?.items?.length),n=$C(e)?{...e,pages:e.pages.map((i)=>({...i,blocks:i.blocks.map((s)=>en(s,t,new Set,r))}))}:e;return BC(n)}function xl(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 Il(e,t){if(xl(e.layout),xl(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={...sa,...t.layout?.inherit===!1?{}:e.layout,...i};return t.blocks.map((o)=>o.type==="PageLayout"?{...o,props:{...o.props,layout:s}}:o)}function qC(e){ca(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 FC(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??FC(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((d)=>Hi(d,t,r,n,o,o)),c={};for(let[d,g]of Object.entries(e.slots??{}))c[d]=g.map((p)=>Hi(p,t,r,n,o,`${o}_${d}`));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:qC(e),assignedIds:new Set},i=Object.create(null);return{version:"2.0",pages:e.pages.map((o)=>{let a=[];for(let c of Il(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 Al=new Set(ia),jC=new Map(Mt.map((e)=>[e.id,e])),Tl=new Set(["array","boolean","integer","null","number","object","string"]),Ol=new Set(["additionalProperties","default","description","enum","items","properties","required","type"]);function El(e){if(!e)return[];return Object.keys(e)}function UC(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,d)=>{if((c==="_state"||c==="_bindState")&&typeof l==="string"){let g=l.split("."),p=g[0]??"";if(p==="__computed"){let u=g[1]??"";if(!o.has(u))e.push({code:"refs:computed-declared",message:`${t}: _computed "${u}" is not declared`,elementKey:r,path:d});return}if(!s.has(p))e.push({code:"refs:state-declared",message:`${t}: _state "${p}" is not declared in state`,elementKey:r,path:d})}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:d});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:d})})}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 Pl=new Set(["_eq","_ne","_contains","_gt","_lt","_gte","_lte","_in","_not","_and","_or"]);function HC(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 Dl(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)||!Pl.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((p,u,m)=>_e(u,`${t}[${m}]`,r,n,i,s)&&p,!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((p)=>p.startsWith("_"));if(o.length===0)return Object.entries(e).reduce((p,[u,m])=>_e(m,`${t}.${u}`,r,n,i,s)&&p,!0);let a=o[0]??"",c=jC.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((p)=>["props","computed","predicate"].includes(p))))return n.push({code:"props:expression",message:`${i}: expression is not supported in this value position`,elementKey:s,path:l}),!1;let d=e[a];if(!HC(a,d))return n.push({code:"props:expression",message:`${i}: expression operand shape is not supported`,elementKey:s,path:l}),!1;let g=(p)=>$t(p)||Array.isArray(p);if(["_filter","_find","_groupCount","_sort"].includes(a)&&!g(Array.isArray(d)?d[0]:void 0)||a==="_in"&&!g(Array.isArray(d)?d[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(d)?!g(d[0]):!g(d))||a==="_array.length"&&!g(d))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(d)){if(d.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(d))return d.reduce((p,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=Pl.has(a)?"predicate-value":r,r==="predicate"&&["_and","_or"].includes(a))f="predicate"}return _e(u,`${l}[${m}]`,f,n,i,s)&&p},!0);if(H(d))return _e(d,l,r==="predicate"&&a==="_not"?"predicate-value":r,n,i,s);return!0}function Gi(e,t,r,n,i,s,o){let a=(g)=>o==="props"?`props:${g}`:`actions:params-${g}`;if(Object.keys(t).filter((g)=>!Ol.has(g)).length>0){n.push({code:"schema:unsupported",message:`${i}: schema contains unsupported constraints`,elementKey:s,path:r});return}if(t.type!==void 0&&!Tl.has(t.type)){n.push({code:"schema:unsupported",message:`${i}: schema type is not supported`,elementKey:s,path:r});return}if(!Dl(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((g)=>typeof g!=="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((g)=>Object.is(g,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 g of Object.keys(e))if(!Object.hasOwn(t.properties??{},g))n.push({code:o==="props"?"props:unknown":"actions:params-unknown",message:`${i}: object field is not declared`,elementKey:s,path:`${r}.${g}`})}for(let g of t.required??[])if(!Object.hasOwn(e,g))n.push({code:a("required"),message:`${i}: required object field is missing`,elementKey:s,path:`${r}.${g}`});for(let[g,p]of Object.entries(t.properties??{}))if(Object.hasOwn(e,g))Gi(e[g],p,`${r}.${g}`,n,i,s,o)}if(l==="array"&&Array.isArray(e)&&t.items)e.forEach((g,p)=>{Gi(g,t.items,`${r}[${p}]`,n,i,s,o)})}function Ll(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 Nl(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)=>!Ol.has(o))||e.type!==void 0&&!Tl.has(e.type)||!Dl(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,d=`${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:`${d}.action`});if(typeof l==="string"&&!Al.has(l)&&!Object.hasOwn(s.actions??{},l))e.push({code:"actions:registered",message:`${t}: action "${l}" is not in the catalog. Registered actions: ${[...Al,...Object.keys(s.actions??{})].join(", ")}. No equivalent is guaranteed: preserve the requirement and report unsupported behavior instead of disabling it.`,elementKey:r,path:`${d}.action`});if(o&&typeof l==="string"){let g=Object.hasOwn(s.actions??{},l)?s.actions[l]:Object.hasOwn(En,l)?En[l]:void 0,p=c.params;if(p!==void 0&&!H(p))e.push({code:"actions:chain",message:`${t}: action params must be an object`,elementKey:r,path:`${d}.params`});else{if(H(p))Nl(e,p,`${d}.params`,"action-value",t,r,{evaluatedParams:new Set(g?.generation?.evaluatedParams??[])});if(g)Ll(e,H(p)?p:void 0,g.params,`${d}.params`,t,r,"actions:params")}}if(Object.hasOwn(c,"onSuccess"))nn(e,t,r,c.onSuccess,`${d}.onSuccess`,s,o);if(Object.hasOwn(c,"onError"))nn(e,t,r,c.onError,`${d}.onError`,s,o)}}function _l(e,t,r=!1){let n=[],i=new Set([...El(e.state),...e.connectionIds??[]]),s=new Set(El(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,VC(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 d=`${o}/${a}`,g=Ml(l.props);if(r)Nl(n,c.props,"props","props",d,a);if(c.visible!==null&&typeof c.visible==="object"){let p=Object.keys(c.visible);if(Array.isArray(c.visible)||p.length!==1||!p[0]?.startsWith("_"))n.push({code:"visibility:expression",message:`${d}: 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:`${d}: visible must be a boolean or an operator expression`,elementKey:a,path:"visible"});else _e(c.visible,"visible","visible",n,d,a);if(rn(n,d,a,c.props,"props",i,s,g),rn(n,d,a,c.visible,"visible",i,s,g),rn(n,d,a,c.events,"events",i,s,g),l.props){let p=new Set(Object.keys(l.props));for(let u of Object.keys(c.props??{}))if(!p.has(u))n.push({code:"props:declared",message:`${d}: prop "${u}" is not declared on ${c.type}`,elementKey:a,path:`props.${u}`});if(r)Ll(n,c.props,l.props,"props",d,a,"props")}if(l.events){let p=new Set(Object.keys(l.events));for(let[u,m]of Object.entries(c.events??{})){if(!p.has(u))n.push({code:"events:declared",message:`${d}: event "${u}" is not declared on ${c.type}`,elementKey:a,path:`events.${u}`});nn(n,d,a,m,`events.${u}`,t,r)}}else for(let[p,u]of Object.entries(c.events??{}))nn(n,d,a,u,`events.${p}`,t,r)}return n.map((a)=>({...a,path:a.elementKey===o?`${o}/${a.path}`:`${o}/${a.elementKey}/${a.path}`}))}function Ml(e){let t=new Set;for(let r of Object.values(e??{})){let n=UC(r);if(!n)continue;for(let i of n)t.add(i)}return t.size>0?t:void 0}function VC(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=Ml(i?.props);if(!s)continue;for(let o of s)r.add(o)}return r.size>0?r:void 0}function $l(e){return e.map((t)=>({code:t.code,message:t.message,elementKey:t.elementKey,path:t.path}))}var Bl=[{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(Bl.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 ql(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 GC(e){return e.type==="compiler:operator"}function KC(e){return e.type==="compiler:validator"}class Bt{operators;validators;constructor(e={}){let t=(e.capabilities??[]).filter(GC).map((n)=>n.contribution),r=(e.capabilities??[]).filter(KC).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 WC(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 YC(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:d,...g}=a;return[o,Wi(g)]}));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 JC(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 QC(e,t,r,n){let i=ql(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=ql(a)}return i}function Fl(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function XC(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(!(Fl(t.components,c.type)??Fl(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 d of c.children??[])if(!e.elements[d])r.push({code:"dangling-child",message:`Element "${a}" references missing child "${d}"`,elementKey:a})}let o=_l(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(...$l(o))}async function ZC(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 ek(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 jl(e,t,r={}){let n=[],i=[],s=r.registry??WC(),o=Vi(e,r.templates),a=Object.create(null),c=[];for(let[g,p]of o.pages.entries()){let u=YC(o,p.id,g===0),m=await QC(u,t,s,n);XC(m,t,n,i,r.strict===!0),await ZC(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:p.id});let C=o.blocks[f];a[f]={...y,id:f,pageId:p.id,...C?.pageId===p.id&&C.parentId?{parentId:C.parentId}:{}}}c.push({...p,rootBlockIds:JC(u,m)})}let l={version:"2.0",pages:c,...o.design?{design:o.design}:{},...o.connections?{connections:o.connections.map((g)=>({...g}))}:{},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 d=ek(l);return{spec:l,gaps:i,warnings:n,...d.length>0?{operatorUsage:d}:{}}}import{readFileSync as lk}from"node:fs";var Ul=["auto","user","override"];function an(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function tk(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)??tk(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((d)=>typeof d==="string"&&d.trim().length>0);if(l.length>0)a.exemptRules=l.map((d)=>d.trim())}if(Array.isArray(r.extractedTokens))a.extractedTokens=r.extractedTokens;if(typeof r.layer==="string")if(Ul.includes(r.layer))a.layer=r.layer;else console.warn(`[design-md] ignoring invalid layer "${r.layer}" on id="${a.id}"; expected one of ${Ul.join("|")}`);return a}var rk=["colors","typography","rounded","spacing","components"],nk=["themes","forbidden"],Vl=new Set([...rk,...nk]),ik=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 Hl(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function sk(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function ok(e){let{meta:t,body:r}=et(e),n=[],i=[];for(let[s,o]of[t,...sk(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)=>Vl.has(c)))i.push(a)}return{sources:i,issues:n}}function ak(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(ik.has(s)&&(typeof o==="string"||typeof o==="number"))i[s]=o;t[r]=i}return t}function Ji(e){let{sources:t}=ok(e),r=Object.assign({},...t);if(!Object.keys(r).some((c)=>Vl.has(c)))return;let n={colors:ln(r.colors),typography:ak(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=Hl(s.colors),a=Hl(s.fonts);if(o.length||a.length)n.forbidden={colors:o,fonts:a};return n}var ck=[{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 ck){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=lk(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 uk}from"node:url";import{existsSync as dk,readdirSync as pk}from"node:fs";import{join as gk}from"node:path";var zl=uk(new URL("../content",import.meta.url));function un(e=zl){if(!dk(e))return[];let t=[];for(let r of pk(e).sort()){if(r.startsWith("_")||!r.endsWith(".design.md"))continue;try{t.push(qt(gk(e,r)))}catch(n){console.warn(`[design-md] skipping seed ${r}: ${n.message}`)}}return t}function hk(e){return e==="quality"?"blocking":"advisory"}var bk=["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"],wk=["Inter","Roboto","Geist","Fraunces","Plus Jakarta","Space Grotesk"];function de(e,t){let r=e.match(t);return r?r.length:0}var Sk=[{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 bk.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}}],vk=[{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)=>wk.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)}],Gl={P0:0.3,P1:0.15,P2:0.08,P3:0.04};function Ck(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 Kl="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",kO=new RegExp(`["']?\\b(?:${Kl})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),RO=new RegExp(`^\\s*-?\\s*(?:${Kl})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function Wl(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 d=hk(l.category);if(d==="advisory"&&n.has(l.id))continue;let g=l.detect(c);if(g>0)i.push({ruleId:l.id,category:l.category,severity:l.severity,level:d,message:l.message,count:g})}};s(Sk,t),s(vk,r);let o=1;for(let a of i){let c=Math.min(Gl[a.severity]*(1+(a.count-1)/3),Gl[a.severity]*2);o-=c}return o=Math.max(0,Math.min(1,o)),{score:o,grade:Ck(o),findings:i,blocked:i.some((a)=>a.level==="blocking")}}import{readdirSync as kk,readFileSync as Rk,statSync as xk}from"node:fs";import{basename as Ik,join as Ak}from"node:path";var Ek="0.1.0";function Yl(e){let{dir:t}=e,r;try{r=kk(t)}catch{return[]}let n=e.defaultVersion??Ek,i=e.defaultLevel??"L4",s=e.defaultCategory??"template",o=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Ak(t,a);try{if(!xk(c).isFile())continue}catch{continue}let l=Rk(c,"utf8");if(!l.trim())continue;let d=Ik(a).replace(/\.ya?ml$/i,""),g=Pk(d),p=Tk(d),u=Ok(l)??`${p} template`;o.push({name:g,version:n,title:p,description:u,yaml:l,absolutePath:c,templateContract:{name:g,description:u,level:i,category:s,keywords:[g,d.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:Dk(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 Yl(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 Pk(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function Tk(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function Ok(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 Dk(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 BO=new Set(or),qO=new Set(sr);var Nk=/^(unknown|unlicensed|none|n\/?a)$/i;function Zi(e){let t=e?.trim();if(!t||Nk.test(t))return;return t}var _k="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 Mk(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}:${Mk(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 $k(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:$k(e.source),receipt:e.receipt,...e.solution?{solution:structuredClone(e.solution)}:{}}}function Bk(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function qk(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 Fk(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 jk(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 Uk(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return pe("template",i);return jk(e,t,r)}function jt(e,t,r){return Zi(r?.[e]??t)}function Jl(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 Ql(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],s=e.skills??[],o=e.licenses,a=Fk(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)=>Uk(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:Bk(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 d=new Map;for(let u of c)for(let m of u.aliases){let f=M(m);if(!f)continue;let y=d.get(f)??new Set;y.add(u.id),d.set(f,y)}let g=Object.freeze(Object.fromEntries([...d.entries()].sort(([u],[m])=>G(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(G))]))),p=Object.freeze(c.map(qk));return Object.freeze({schemaVersion:_k,resources:p,aliases:g})}var Hk=[["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","导航","侧边栏"]],Vk=Object.freeze(Hk.map((e)=>Object.freeze([...e]))),Xl=new Map;for(let e of Vk){let t=Object.freeze([...new Set(e.map(M).filter(Boolean))].sort());for(let r of t)Xl.set(r,t)}function es(e){let t=M(e);return Xl.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}),zk=Object.freeze(Object.keys(ns)),Zl=new Map(zk.map((e,t)=>[e,t])),eu=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 tu(e){return new Set((e??[]).map(M).filter(Boolean))}function Me(e,t){let r=tu(t);if(r.size===0)return!0;let n=tu(e);return[...r].some((i)=>n.has(i))}function Gk(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 Kk(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 Wk(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 ru(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((g)=>g!==r),d=new Set(rs(e).map(M));if(l.some((g)=>d.has(g)))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 d of rs(e)){let g=M(d);if(g.length<4)continue;let p=Wk(r,g,2);if(p<=2&&(!l||p<l.distance||p===l.distance&&K(d,l.value)<0))l={value:d,distance:p}}if(l)ae(n,"fuzzy",l.value,ns.fuzzy-l.distance)}return n.sort((l,d)=>{if(l.score!==d.score)return d.score-l.score;return(Zl.get(l.code)??99)-(Zl.get(d.code)??99)||K(l.value,d.value)})}function nu(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 iu(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=nu(e,t,i);if(s.length===0)throw new ne("resource-not-found",i);if(s.length>1)throw iu(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&&!Kk(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)=>Gk(o,n)).filter((o)=>!i||ru(o,i).length>0).map((o)=>{let a=i?ru(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((p)=>!p.trim()))throw new ne("resource-query-empty","at least one build root is required");let i=[],s=new Set;for(let p of n){let u=p.trim(),m=nu(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw iu(u,m);else{let f=m[0];if(f)s.add(f)}}let o=new Set,a=new Set,c=new Set,l=[],d=[],g=(p,u)=>{if(o.has(p))return;if(a.has(p)){i.push({id:p,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(p);if(!m){i.push({id:p,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(p),c.add(p);let f=[...m.dependencies].sort((y,S)=>{let C=t.get(y),k=t.get(S);return(eu.get(C?.kind??"")??99)-(eu.get(k?.kind??"")??99)||K(y,S)});for(let y of f)d.push({from:p,to:y,relation:"depends-on"}),g(y,p);a.delete(p),o.add(p),l.push(p)};for(let p of[...s].sort(K))g(p);return{roots:[...s].sort(K),nodes:[...c].sort(K).map((p)=>{let u=t.get(p);if(!u)throw new ne("resource-not-found",p);return{id:p,kind:u.kind,maturity:u.receipt.maturity}}),edges:d.sort((p,u)=>K(p.from,u.from)||K(p.to,u.to)),order:l,gaps:i.sort((p,u)=>K(p.id,u.id)||K(p.requiredBy??"",u.requiredBy??"")||K(p.reason,u.reason))}}})}function is(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");Xk(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)||!oa.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 su(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,...Jk(a.docs[s],o),release:e.release}},examples(i,s=1){let o=n(i);return{resourceId:o.resourceId,...Qk(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)=>Yk(o,e.distributionSnapshot,s.resourceId))}}})}function Yk(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 ou(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 Jk(e,t){let r=Math.max(1,Math.ceil(e.length/Ie));return ou(t,r),{markdown:e.slice((t-1)*Ie,t*Ie),page:t,totalPages:r,...t<r?{nextPage:t+1}:{}}}function Qk(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 ou(t,r.length),{examples:r.slice(t-1,t),page:t,totalPages:r.length,...t<r.length?{nextPage:t+1}:{}}}function Xk(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 XO=new TextDecoder("utf-8",{fatal:!0});function uu(){return{listCatalog:()=>[...nR],getDesignMd:(e)=>{let t=pu();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 du(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 jl(r,{components:{...lr,...ur},actions:{},templates:{}},{templates:tR()});t.spec={ok:i.gaps.length===0,gaps:i.gaps,warnings:i.warnings}}if(e.html!==void 0){let r=Wl({html:e.html});t.html={ok:!r.blocked,...r}}return t}function eR(){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 au,cu,lu;function as(){return au??=Xi(eR()),au}function tR(){return cu??=Object.fromEntries(as().map((e)=>[e.name,Yi(e.yaml)])),cu}function pu(){let e=os(new URL("./resources/design-md",import.meta.url));return lu??=ss(e)?un(e):un(),lu}var gn;function gu(){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(Zk(e,"utf8"));return is(r),su(r)}if(gn)return gn;let t=Object.fromEntries(as().map((r)=>[r.name,r.templateContract]));return gn=pn(Ql({components:{...lr,...ur},templates:t,designGuides:pu(),examples:Jl(t)})),gn}function rR(){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 nR=Object.freeze(rR());var lR="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 uR(){return{requestComponent:()=>Promise.reject(Error(lR)),getTask:()=>{return},listTasks:()=>[],getTaskStatus:()=>{return}}}function dR(e,t){let r=Object.fromEntries(Object.entries(t??{}).filter(([,n])=>n!=null));return{...e,...r}}function cs(e={}){let t=pa({service:e.service??uR(),serviceAvailable:e.service!=null,discovery:dR(uu(),e.discovery),resourceQuery:e.resourceQuery??gu(),validate:e.validate??du}),r=new sR({name:"uibot",version:"0.1.0"},{capabilities:{tools:{}}});return r.setRequestHandler(cR,()=>({tools:t.listTools().filter((n)=>!e.resourceOnly||n.name.startsWith("uibot_resource_"))})),r.setRequestHandler(aR,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=ga(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 fu(iR(t))===fu(e)}catch{return!1}}async function gR(){let e=cs();await e.connect(new oR);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)});function $0(e){return async(t)=>{let r=t.headers.get("origin"),n=new URL(t.url).origin;if(r&&r!==n&&!e.allowedOrigins?.includes(r))return new Response("origin-not-allowed",{status:403});if(t.method==="OPTIONS")return new Response(null,{status:204,headers:{"access-control-allow-origin":r??n,"access-control-allow-methods":"POST, OPTIONS","access-control-allow-headers":"content-type, mcp-protocol-version",vary:"Origin"}});if(t.method!=="POST")return new Response("method-not-allowed",{status:405,headers:{allow:"POST, OPTIONS"}});let i;try{i=await mR(t,1048576)}catch(c){return new Response("invalid-request-body",{status:c instanceof Error&&c.message==="too-large"?413:400})}let s;try{s=JSON.parse(i)}catch{return new Response("invalid-json",{status:400})}let o=new fR({enableJsonResponse:!0}),a=cs({resourceOnly:!0,resourceQuery:e.resourceQuery});await a.connect(o);try{let c=await o.handleRequest(t,{parsedBody:s}),l=await c.arrayBuffer(),d=new Headers(c.headers);if(r)d.set("access-control-allow-origin",r),d.set("vary","Origin");return new Response(c.status===204?null:l,{status:c.status,headers:d})}finally{await a.close()}}}async function mR(e,t){let r=e.body?.getReader();if(!r)return"";let n=[],i=0,s=!1,o=setTimeout(()=>{s=!0,r.cancel()},1e4);try{for(;;){let{done:l,value:d}=await r.read();if(s)throw Error("body-timeout");if(l)break;if(i+=d.byteLength,i>t)throw await r.cancel(),Error("too-large");n.push(d)}}finally{clearTimeout(o),r.releaseLock()}let a=new Uint8Array(i),c=0;for(let l of n)a.set(l,c),c+=l.byteLength;return new TextDecoder("utf-8",{fatal:!0}).decode(a)}export{$0 as createUIBotMcpHttpHandler};
137
+ `,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=vi(e),n=Vt(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=vi(e),n=Vt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,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((n)=>n.type==="newline"||n.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()}}}d0.Parser=Ju});var tm=w(function(v0){var Qu=qs(),u0=Dn(),jn=Ln(),m0=Xo(),g0=M(),f0=Xs(),Xu=Zs();function Zu(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new f0.LineCounter||null,prettyErrors:t}}function h0(e,t={}){let{lineCounter:n,prettyErrors:r}=Zu(t),i=new Xu.Parser(n?.addNewLine),o=new Qu.Composer(t),s=Array.from(o.compose(i.parse(e)));if(r&&n)for(let a of s)a.errors.forEach(jn.prettifyError(e,n)),a.warnings.forEach(jn.prettifyError(e,n));if(s.length>0)return s;return Object.assign([],{empty:!0},o.streamInfo())}function em(e,t={}){let{lineCounter:n,prettyErrors:r}=Zu(t),i=new Xu.Parser(n?.addNewLine),o=new Qu.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 jn.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(r&&n)s.errors.forEach(jn.prettifyError(e,n)),s.warnings.forEach(jn.prettifyError(e,n));return s}function y0(e,t,n){let r=void 0;if(typeof t==="function")r=t;else if(n===void 0&&t&&typeof t==="object")n=t;let i=em(e,n);if(!i)return null;if(i.warnings.forEach((o)=>m0.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:r},n))}function b0(e,t,n){let r=null;if(typeof t==="function"||Array.isArray(t))r=t;else if(n===void 0&&t)n=t;if(typeof n==="string")n=n.length;if(typeof n==="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}if(g0.isDocument(e)&&!r)return e.toString(n);return new u0.Document(e,r,n).toString(n)}v0.parse=y0;v0.parseAllDocuments=h0;v0.parseDocument=em;v0.stringify=b0});import{WebStandardStreamableHTTPServerTransport as hE}from"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";import{createHash as Cl,randomUUID as Rf}from"node:crypto";import{mkdir as Pf,realpath as Tf,writeFile as Ef}from"node:fs/promises";import{join as Of}from"node:path";var Re=(e,t=[])=>({type:"object",properties:e,required:t,additionalProperties:!1}),qe={type:"string",minLength:1},At=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,ao={original:"image","favicon-16":"web/favicon-16.png","favicon-32":"web/favicon-32.png","icon-512":"pwa/icon-512.png"},Nf=Re({requestId:{type:"string",pattern:At.source},provider:qe,model:qe,brief:Re({brand:{...qe,maxLength:100},description:{...qe,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:qe,refinement:{...qe,maxLength:2000}},["requestId","provider","model","brief"]),_f=Re({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"]),Bf=[{name:"providers",description:"List configured image providers and exact model IDs before generating a logo.",inputSchema:Re({}),readOnly:!0},{name:"assets",description:"List saved logo assets and provenance. Use status with the original requestId to reconcile a generation.",inputSchema:Re({}),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:Re({requestId:{type:"string",pattern:At.source}},["requestId"]),readOnly:!0},{name:"targets",description:"List supported app icon export targets and files.",inputSchema:Re({}),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:Re({id:qe,variant:{enum:Object.keys(ao),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:Re({request:Nf},["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:Re({id:qe,request:_f},["id","request"]),readOnly:!1}];class D extends Error{code;outcomeUnknown;requestId;constructor(e,t=!1,n){super(e);this.code=e;this.outcomeUnknown=t;this.requestId=n}}async function xl(e,t,n,r){await Pf(e,{recursive:!0});let i=await Tf(e),o=Of(i,`logo-${t}-${Rf()}.${n}`);return await Ef(o,r,{flag:"wx",mode:384}),{path:o,contentType:n==="png"?"image/png":"application/zip",bytes:r.length,sha256:Cl("sha256").update(r).digest("hex")}}async function Df(e,t){let n=e.body?.getReader();if(!n)throw new D("logo-empty-response");let r=[],i=0;try{for(;;){let{done:a,value:l}=await n.read();if(a)break;if(i+=l.length,i>t)throw new D("logo-response-too-large");r.push(l)}}finally{await n.cancel().catch(()=>{})}let o=new Uint8Array(i),s=0;for(let a of r)o.set(a,s),s+=a.length;return o}function Il(e){let t;try{t=new URL(e.url)}catch{throw new D("logo-invalid-backend-origin")}if(!/^https?:$/.test(t.protocol)||t.username||t.password||t.pathname!=="/"||t.search||t.hash)throw new D("logo-invalid-backend-origin");if(t.protocol==="http:"&&!["localhost","127.0.0.1","[::1]"].includes(t.hostname))throw new D("logo-https-required");if(!e.token||/[\r\n]/.test(e.token))throw new D("logo-auth-required");let n=Bf.filter((i)=>i.name!=="export"||e.outputDir),r=async(i,o={},s)=>{let a=n.find((g)=>g.name===i);if(!a)throw new D("logo-operation-unavailable");let l=Object.keys(a.inputSchema.properties);if(Object.keys(o).some((g)=>!l.includes(g))||a.inputSchema.required.some((g)=>o[g]===void 0))throw new D("logo-invalid-arguments");if((i==="generate"||i==="export")&&(!o.request||typeof o.request!=="object"||Array.isArray(o.request)))throw new D("logo-invalid-request");if((i==="export"||i==="preview")&&(typeof o.id!=="string"||!At.test(o.id)))throw new D("logo-invalid-asset-id");let c=i==="generate"?o.request.requestId:i==="status"?o.requestId:void 0;if((i==="generate"||i==="status")&&(typeof c!=="string"||!At.test(c)))throw new D("logo-request-id-required");let d=typeof c==="string"?c:void 0,p=o.variant===void 0?"original":o.variant;if(i==="preview"&&(typeof p!=="string"||!Object.hasOwn(ao,p)))throw new D("logo-invalid-preview-variant");if(i==="preview"&&o.removeFaintFringe!==void 0&&(typeof o.removeFaintFringe!=="boolean"||p==="original"&&o.removeFaintFringe))throw new D("logo-invalid-preview-options");let m=i==="status"?`requests/${c}`:i==="targets"?"export-targets":i==="export"?`assets/${o.id}/app-kit`:i==="preview"?`assets/${o.id}/${p==="original"?"image":"preview"}`:i,u=new URL(`/api/studio/logo/${m}`,t);if(i==="preview"&&p!=="original"){if(u.search=new URLSearchParams({file:ao[p],background:"#ffffff",spacing:"balanced",trim:"1"}).toString(),o.removeFaintFringe!==void 0)u.searchParams.set("fringe",o.removeFaintFringe?"1":"0")}let f;try{f=await(e.fetch??fetch)(u,{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 D("logo-transport-failed",i==="generate",d)}if(!f.ok)throw new D(`logo-http-${f.status}`,i==="generate"&&(f.status>=500||f.status===499),d);try{let g=await Df(f,i==="export"||i==="assets"?33554432:i==="preview"?20000000:1048576);if(i==="preview"){if(f.headers.get("content-type")?.split(";")[0]?.trim()!=="image/png"||g.length<45||![137,80,78,71,13,10,26,10].every((x,T)=>g[T]===x)||new TextDecoder().decode(g.subarray(12,16))!=="IHDR"||new TextDecoder().decode(g.subarray(-8,-4))!=="IEND")throw new D("logo-invalid-preview-response");let y=new DataView(g.buffer,g.byteOffset,g.byteLength),v=y.getUint32(16),k=y.getUint32(20),S=p==="original"?void 0:Number(String(p).split("-")[1]);if(!v||!k||v>4096||k>4096||v*k>4000000||S!==void 0&&(v!==S||k!==S))throw new D("logo-invalid-preview-response");return{preview:{id:o.id,variant:p,...p!=="original"?{removeFaintFringe:o.removeFaintFringe===!0}:{},contentType:"image/png",width:v,height:k,bytes:g.length,sha256:Cl("sha256").update(g).digest("hex")},image:{type:"image",mimeType:"image/png",data:Buffer.from(g).toString("base64")}}}if(i==="export"){if(!f.headers.get("content-type")?.startsWith("application/zip"))throw new D("logo-invalid-export-response");let y=e.outputDir;if(!y)throw new D("logo-output-directory-required");return{artifact:await xl(y,String(o.id),"zip",g)}}let h=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(g));if(!h||typeof h!=="object")throw new D("logo-invalid-response");let b=h;if(i==="assets"){let y=h.assets;if(!Array.isArray(y)||y.length>500)throw new D("logo-invalid-response");let v=new Set;for(let k of y){if(!k||typeof k!=="object"||Array.isArray(k))throw new D("logo-invalid-response");let S=k;if(S.schema!=="uibot.logo-asset.v1"||typeof S.id!=="string"||!At.test(S.id)||v.has(S.id)||new TextEncoder().encode(JSON.stringify(S)).byteLength>64000)throw new D("logo-invalid-response");v.add(S.id)}}if(i==="generate"||i==="status"){let y=b.request;if(!y||y.schema!=="uibot.logo-request.v1"||y.requestId!==d||!["running","succeeded","failed","unknown"].includes(String(y.state)))throw new D("logo-invalid-response");if(y.state==="succeeded"){let v=b.asset;if(!v||v.schema!=="uibot.logo-asset.v1"||typeof y.assetId!=="string"||!At.test(y.assetId)||v.id!==y.assetId||v.requestId!==d||typeof y.requestHash!=="string"||!/^[0-9a-f]{64}$/.test(y.requestHash)||v.requestHash!==y.requestHash)throw new D("logo-invalid-response")}else{if(b.asset!==void 0)throw new D("logo-invalid-response");b.next=`Query logo status ${d}. State ${String(y.state)} is not a generated asset; do not automatically submit a new ID.`}}else if(!Array.isArray(b[i]))throw new D("logo-invalid-response");return h}catch{throw new D("logo-response-failed",i==="generate",d)}};return{operations:n,call:r,async savePreview(i,o){if(!e.outputDir)throw new D("logo-output-directory-required");let{image:s,...a}=await r("preview",i,o);if(!s)throw new D("logo-invalid-preview-response");try{return{...a,artifact:await xl(e.outputDir,String(i.id),"png",Buffer.from(s.data,"base64"))}}catch{throw new D("logo-preview-write-failed")}}}}import{realpathSync as hf}from"node:fs";import{fileURLToPath as sE}from"node:url";import{Server as aE}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as lE}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as cE,ListToolsRequestSchema as dE}from"@modelcontextprotocol/sdk/types.js";var Fb=If(hd(),1);var yd=["SetState","ResetState","Request","Link","Validate","DisplayMessage","Login","Logout","CallMethod"],xo={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 bd=["unauthenticated","not-found","invalid-request","upstream-error","http-error","transport-error","forbidden","validation","conflict","rate-limited","unbound"];var Co={shell:["admin-sidebar","console-drilldown","sidebar-floating","sidebar-inset","top-navbar","dual-pane"],navigation:["sidebar","navbar"],container:["default","fluid","boxed"],navigationStyle:["attached","floating"],offcanvas:["attached","floating"],sidebar:["expanded","folded","hover"]},vd={navigation:"sidebar",container:"fluid",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"};var Hb={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},SN=Array.from(new Set(Object.values(Hb).flat()));var un=["component","template","design-guide","example","skill","block","package","theme"],Et=["experimental","candidate","recommended"],kd=["declared","verified","external-consumer"],Ir=["missing","declared","verified","external-consumer"],Ar=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],Rr=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 zb=["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"],RN=[...zb,"radius","font-display","font-body","font-mono"];var Kb=["L1","L2","L3","L4"],Ao=["shell","page","frame","section","block"],Gb=["block-node","block-prop","block-events","block-children","page-field","spec-layout"],we=(e)=>Boolean(e)&&typeof e==="object"&&!Array.isArray(e),Be=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e),Io=(e)=>we(e)&&typeof e.zh==="string"&&typeof e.en==="string";function Wb(e,t){if(e==="shell"){if(!we(t.shellLayout))throw Error("missing-variant-payload");return}if(e==="page"){let n=t.pageTemplate;if(!we(n)||!Be(n.id)||typeof n.path!=="string"||!Array.isArray(n.blocks))throw Error("missing-variant-payload");return}if(e==="frame"){let n=t.frameTemplate;if(!we(n)||!Be(n.contentBlockId)||!we(n.frame)||!Be(n.frame.type))throw Error("missing-variant-payload");return}if(!we(t.blockTemplate)||!Be(t.blockTemplate.type))throw Error("missing-variant-payload")}function Ro(e){if(!we(e)||e.schema!=="uibot.variant-contract.v1"||!Be(e.familyId)||!Kb.includes(e.level)||!Ao.includes(e.targetKind)||!Io(e.title)||typeof e.description!=="string"||!Array.isArray(e.semanticSlots)||!Array.isArray(e.variants)||e.variants.length===0)throw Error("invalid-variant-contract");let t=new Set;for(let o of e.semanticSlots){if(!we(o)||!Be(o.id)||!Io(o.label))throw Error("invalid-variant-slot");if(o.preserveMode!==void 0&&o.preserveMode!=="always"&&o.preserveMode!=="when-customized")throw Error("invalid-variant-slot");if(t.has(o.id))throw Error("duplicate-variant-slot");t.add(o.id)}let n=new Set,r=new Set,i=e.targetKind;for(let o of e.variants){if(!we(o)||!Be(o.id)||!Io(o.title)||typeof o.description!=="string"||!we(o.slotBindings))throw Error("invalid-variant-member");if(n.has(o.id)||r.has(o.id))throw Error("duplicate-variant-id");if(n.add(o.id),o.aliases!==void 0){if(!Array.isArray(o.aliases))throw Error("invalid-variant-alias");for(let s of o.aliases){if(!Be(s))throw Error("invalid-variant-alias");if(n.has(s)||r.has(s))throw Error("duplicate-variant-alias");r.add(s)}}for(let[s,a]of Object.entries(o.slotBindings)){if(!Be(s)||!t.has(s))throw Error(`undeclared-variant-slot:${s}`);if(!we(a)||!Gb.includes(a.kind)||a.occurrence!==void 0&&(typeof a.occurrence!=="number"||!Number.isInteger(a.occurrence)||a.occurrence<0))throw Error(`invalid-variant-slot-binding:${s}`)}Wb(i,o)}}var Te=(e)=>!!e&&typeof e==="object"&&!Array.isArray(e),te=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e),wd=(e)=>Te(e)&&Object.entries(e).every(([t,n])=>te(t)&&te(n));function W(e){if(e.composition===void 0)return;let t=e.composition;if(!Te(t)||t.schema!=="uibot.solution-composition.v1"||!Array.isArray(t.pages))throw Error("invalid-solution-composition");let n=new Set;for(let r of t.pages){if(!Te(r)||!te(r.resourceId)||!te(r.version)||typeof r.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(r.sourceHash)||!te(r.sourcePageId)||!te(r.targetPageId)||n.has(r.targetPageId)||!Te(r.baseline)||r.baseline.id!==r.targetPageId||typeof r.baseline.path!=="string"||!Array.isArray(r.baseline.blocks)||!Te(r.bindings)||!["source","target"].includes(String(r.bindings.layout))||!wd(r.bindings.paths)||!wd(r.bindings.connections)||r.bindings.frame!==void 0&&(!Te(r.bindings.frame)||Object.keys(r.bindings.frame).some((i)=>!["props","slots","events"].includes(i)))||r.detached!==void 0&&typeof r.detached!=="boolean"||r.configuration!==void 0&&(!Te(r.configuration)||Object.entries(r.configuration).some(([i,o])=>!te(i)||!["string","number","boolean"].includes(typeof o)||typeof o==="number"&&!Number.isFinite(o))))throw Error("invalid-solution-adoption");n.add(r.targetPageId)}if(t.regions!==void 0){if(!Array.isArray(t.regions))throw Error("invalid-solution-regions");let r=new Set;for(let i of t.regions){if(!Te(i)||!te(i.resourceId)||!te(i.version)||typeof i.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(i.sourceHash)||!te(i.targetPageId)||r.has(i.targetPageId)||!te(i.role)||i.target!=="page-frame"||!te(i.contentBlockId)||!Te(i.baseline)||!te(i.baseline.type))throw Error("invalid-solution-region");r.add(i.targetPageId)}}if(t.variants!==void 0){if(!Array.isArray(t.variants))throw Error("invalid-solution-variants");let r=new Set;for(let i of t.variants){if(!Te(i)||!te(i.familyId)||!te(i.variantId)||!te(i.targetId)||!Ao.includes(i.targetKind))throw Error("invalid-solution-variant");let o=`${i.targetKind}:${i.targetId}:${i.familyId}`;if(r.has(o))throw Error("invalid-solution-variant");r.add(o)}}}var Pr=["Find","FindPage","FindOne","InsertOne","UpdateOne","DeleteOne","UpdateBatch","DeleteBatch"],Jb=/^[A-Za-z][A-Za-z0-9_]{0,63}$/,Qb=["string","number","boolean","date","datetime","enum","json","ref"];function Tr(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e))}function V(e,t){if(!Tr(e)||t&&Object.keys(e).some((n)=>!t.includes(n)))throw Error("Invalid data object or unknown field");return e}function mt(e){if(typeof e!=="string"||!Jb.test(e))throw Error("Invalid data name")}function gn(e){if(typeof e!=="string"||!e||e.length>2048)throw Error("Invalid data text")}function Cd(e){return e===null||typeof e==="string"||typeof e==="boolean"||typeof e==="number"&&Number.isFinite(e)}function Id(e){for(let t=0;t<e.length;t++)if(!Object.hasOwn(e,t))return!1;return!0}function Ot(e,t={left:1e4},n=0){if(--t.left<0||n>32)return!1;if(Cd(e))return!0;if(Array.isArray(e)){if(e.length>t.left||!Id(e))return!1;return e.every((r)=>Ot(r,t,n+1))}return Tr(e)&&Object.values(e).every((r)=>Ot(r,t,n+1))}function Ad(e,t){if(t===null)return!e.required;switch(e.type){case"string":return typeof t==="string"&&(e.maxLength===void 0||t.length<=e.maxLength);case"number":return typeof t==="number"&&Number.isFinite(t);case"boolean":return typeof t==="boolean";case"date":return typeof t==="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t)&&Number.isFinite(Date.parse(t))&&new Date(t).toISOString().slice(0,10)===t;case"datetime":return typeof t==="string"&&/^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(t)&&Ad({type:"date",required:!0},t.slice(0,10))&&Number.isFinite(Date.parse(t));case"enum":return typeof t==="string"&&!!e.values?.includes(t);case"ref":return Cd(t)&&t!==null;case"json":return Ot(t)}}function Ee(e){let t=V(e,["entities"]),n=V(t.entities);if(Object.keys(n).length>64)throw Error("Data model exceeds 64 entities");for(let[r,i]of Object.entries(n)){mt(r);let o=V(i,["title","key","fields","version"]);if(o.title!==void 0)gn(o.title);mt(o.key);let s=V(o.fields);if(Object.keys(s).length>128)throw Error("Data entity exceeds 128 fields");if(!Object.hasOwn(s,o.key))throw Error("Data key must name an entity field");if(o.version!==void 0){if(mt(o.version),!Object.hasOwn(s,o.version))throw Error("Unknown data version field")}for(let[a,l]of Object.entries(s)){mt(a);let c=V(l,["type","title","required","readOnly","default","values","entity","maxLength"]);if(typeof c.type!=="string"||!Qb.includes(c.type))throw Error("Invalid data field type");if(c.title!==void 0)gn(c.title);for(let d of["required","readOnly"])if(c[d]!==void 0&&typeof c[d]!=="boolean")throw Error("Invalid data field flag");if(c.type==="enum"||c.values!==void 0){if(!Array.isArray(c.values)||!c.values.length||c.values.length>500||!Id(c.values)||c.values.some((d)=>typeof d!=="string"||d.length>2048))throw Error("Data enum requires bounded string values")}if(c.type==="ref"||c.entity!==void 0){if(mt(c.entity),!Object.hasOwn(n,c.entity))throw Error("Unknown referenced data entity")}if(c.maxLength!==void 0&&(!Number.isSafeInteger(c.maxLength)||c.maxLength<0))throw Error("Invalid data maxLength");if(Object.hasOwn(c,"default")&&!Ot(c.default))throw Error("Invalid or excessive data default")}}return e}function Xb(e,t,n){let r={},i=(o,s)=>{if(Object.keys(r).length<32)Object.defineProperty(r,o,{value:s.slice(0,200),enumerable:!0,configurable:!0})};if(!Tr(t))return i("data","Expected a data row"),r;for(let[o,s]of Object.entries(t))if(!Object.hasOwn(e.fields,o))i(o,"Unknown field");else{let a=e.fields[o];if(!a)continue;if(n!=="seed"&&a.readOnly)i(o,"Field is read-only");else if(!Ad(a,s))i(o,"Invalid field value")}if(n!=="update"){for(let[o,s]of Object.entries(e.fields))if(s.required&&!(n==="insert"&&s.readOnly)&&(!Object.hasOwn(t,o)||t[o]===null))i(o,"Required field is missing")}return r}function To(e,t,n){return Object.entries(Xb(e,t,n)).map(([r,i])=>`${r}: ${i}`)}var Zb=["date-iso","datetime-iso","epoch-seconds","epoch-millis","number-string","boolean-01"],ev=/^[a-z][a-z0-9-]{0,31}$/;function xd(e){if(typeof e!=="string"||!ev.test(e))throw Error("Invalid data environment name")}function mn(e){if(typeof e!=="string"||e.length>1024||e.split(".").length>8||!e.split(".").every((t)=>/^(?:[A-Za-z_][A-Za-z0-9_]{0,63}|[0-9]{1,8})$/.test(t)&&!["__proto__","prototype","constructor"].includes(t)))throw Error("Invalid data point path")}function Rd(e,t=!1){if(typeof e!=="string"||!(t&&e==="ids")&&!["limit","cursor","order","data","id"].includes(e)&&!/^(?:data|filter)\.[A-Za-z][A-Za-z0-9_]{0,63}$/.test(e))throw Error("Invalid HTTP mapping source")}function Pd(e){if(e!==void 0&&!Zb.includes(e))throw Error("Invalid data field format")}function Po(e,t,n=!1){let r=V(e,["from","value","format"]);if(Object.hasOwn(r,"value")){if(Object.hasOwn(r,"from")||Object.hasOwn(r,"format")||!Ot(r.value))throw Error("Invalid HTTP literal mapping")}else{if(Rd(r.from,!t&&n),t&&r.from==="order"&&r.format==="field-direction")return;Pd(r.format)}}function tv(e){gn(e);let t=e;for(let r=0;r<4;r++){if(!t.startsWith("/")||t.startsWith("//")||t.includes("://")||/\.\.|[?#\\]/.test(t)||[...t].some((o)=>o.charCodeAt(0)<33||o.charCodeAt(0)===127))throw Error("Invalid HTTP mapping path");let i=decodeURIComponent(t);if(i===t)break;if(r===3)throw Error("Excessive HTTP path encoding");t=i}let n=t.replace(/\{(?:id|filter\.[A-Za-z][A-Za-z0-9_]{0,63})\}/g,"value");if(/[{}]/.test(n))throw Error("Invalid HTTP path placeholder")}function nv(e){let t=V(e);if(Object.keys(t).length>128)throw Error("Excessive HTTP field mappings");for(let[n,r]of Object.entries(t))if(mt(n),typeof r==="string")mn(r);else{let i=V(r,["from","format"]);mn(i.from),Pd(i.format)}}function Eo(e){let t=V(e);if(gn(t.upstream),t.fields!==void 0)nv(t.fields);if(t.driver==="nowapi"||t.driver==="pg")V(t,["driver","upstream","table","fields"]),gn(t.table);else if(t.driver==="http"){V(t,["driver","upstream","operations","response","fields","errors"]);let n=V(t.operations,Pr);for(let[r,i]of Object.entries(n)){let o=r==="UpdateBatch"||r==="DeleteBatch",s=V(i,["method","path","query","body","ifMatch"]);if(!["GET","POST","PUT","PATCH","DELETE"].includes(s.method))throw Error("Invalid HTTP mapping method");if(tv(s.path),s.ifMatch!==void 0)mt(s.ifMatch);if(s.query!==void 0){let a=V(s.query);if(Object.keys(a).length>128)throw Error("Excessive HTTP query mappings");for(let l of Object.values(a))Po(l,!0)}if(s.body!==void 0)if(typeof s.body==="string")Rd(s.body,o);else{let a=V(s.body);if(Object.hasOwn(a,"from")||Object.hasOwn(a,"value"))Po(a,!1,o);else{if(Object.keys(a).length>128)throw Error("Excessive HTTP body mappings");for(let l of Object.values(a))Po(l,!1,o)}}}if(t.response!==void 0){let r=V(t.response,["rows","item","nextCursor","nextCursorHeader","total"]);for(let[i,o]of Object.entries(r))if(i!=="nextCursorHeader")mn(o);else if(typeof o!=="string"||o.length>128||!/^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/.test(o)||/(authorization|cookie|password|secret|api[-_]?key|credential|(?:^|[-_])(?:access|refresh|id|auth(?:entication)?)[-_]?token(?:$|[-_]))/i.test(o))throw Error("Invalid HTTP pagination header");if(r.nextCursor!==void 0&&r.nextCursorHeader!==void 0)throw Error("HTTP cursor body and header mappings are mutually exclusive")}if(t.errors!==void 0){let r=V(t.errors,["message","fields","codes"]);if(r.message!==void 0)mn(r.message);if(r.fields!==void 0)mn(r.fields);if(r.codes!==void 0){let i=V(r.codes);if(Object.keys(i).length>500)throw Error("Excessive HTTP error mappings");for(let[o,s]of Object.entries(i))if(!/^[45][0-9]{2}$/.test(o)||!bd.includes(s))throw Error("Invalid HTTP error code mapping")}}}else throw Error("Invalid data binding driver");return e}function Td(e,t){if(xd(t.environment),!["development","production"].includes(t.channel))throw Error("Invalid data channel");let n={};for(let r of e.connections??[]){if(r.type!=="Collection"||Object.keys(r).some((a)=>!["id","type","entity","mock","bindings"].includes(a)))throw Error("Invalid data connection");if(r.bindings!==void 0){let a=V(r.bindings);for(let[l,c]of Object.entries(a)){if(xd(l),l==="mock")throw Error("The mock environment cannot have a binding");Eo(c)}}if(r.mock!==void 0){let a=V(r.mock,["seed","generate"]);if(a.seed!==void 0){if(!Array.isArray(a.seed)||a.seed.length>500)throw Error("Mock seed exceeds 500 rows or is invalid");let l=r.entity&&e.data&&Object.hasOwn(e.data.entities,r.entity)?e.data.entities[r.entity]:void 0;for(let c of a.seed)if(!Tr(c)||!Ot(c)||l&&To(l,c,"seed").length)throw Error("Invalid mock seed row")}if(a.generate!==void 0&&(!Number.isSafeInteger(a.generate)||a.generate<0||a.generate>500))throw Error("Mock generation count must be between 0 and 500")}let i=t.environment==="mock",o=!i&&r.bindings&&Object.hasOwn(r.bindings,t.environment)?r.bindings[t.environment]:void 0,s={state:i?t.channel==="development"?"mock":"unbound":o?"bound":"unbound",...o?{binding:o}:{},missingOperations:o?.driver==="http"?Pr.filter((a)=>!Object.hasOwn(o.operations,a)):[]};Object.defineProperty(n,r.id,{value:s,enumerable:!0})}return n}var No=200,Nd=64,_o=64;class P extends Error{code;opIndex;opKind;constructor(e,t,n,r){super(`${e} at op[${t}] (${n}): ${r}`);this.code=e;this.opIndex=t;this.opKind=n;this.name="SpecPatchError"}}var Er=new Set(["__proto__","prototype","constructor"]),rv=/^@[A-Za-z_][A-Za-z0-9_]*$/,Ed=/^(0|[1-9]\d*)$/,iv=/^[A-Za-z_][A-Za-z0-9_]*$/,ne=(e)=>Boolean(e)&&typeof e==="object"&&!Array.isArray(e),H=(e)=>typeof e==="string"&&e.length>0&&!Er.has(e);function He(e,t=64){let n=(r,i)=>{if(i>t)throw Error("spec-json-depth-exceeded");if(r===null||typeof r!=="object")return;if(Array.isArray(r)){for(let o of r)n(o,i+1);return}for(let o of Object.getOwnPropertyNames(r)){if(Er.has(o))throw Error(`unsafe-spec-key:${o}`);n(r[o],i+1)}};n(e,0)}function ze(e,t={}){let n;if(typeof e==="string"){let o=e.trim(),s=o.startsWith("uibot-path:")?o.slice(11):o;if(s===""){if(t.allowRoot)return[];throw Error("invalid-spec-block-path")}n=s.split(".")}else if(Array.isArray(e))n=e;else throw Error("invalid-spec-block-path");if(n.length===0){if(t.allowRoot)return[];throw Error("invalid-spec-block-path")}let r=[];for(let o=0;o<n.length;o++){let s=n[o];if(typeof s==="number"){if(!Number.isInteger(s)||s<0)throw Error("invalid-spec-block-path");if(o>0&&typeof r[r.length-1]==="number");r.push(s);continue}if(typeof s==="string"){if(Ed.test(s)){r.push(Number(s));continue}if(rv.test(s)){let a=s.slice(1);if(Er.has(a))throw Error("invalid-spec-block-path");if(o===0)throw Error("invalid-spec-block-path");if(o<n.length-1){let l=n[o+1];if(!(typeof l==="number"&&Number.isInteger(l)&&l>=0||typeof l==="string"&&Ed.test(l)))throw Error("invalid-spec-block-path")}else if(!t.allowSlotEnd)throw Error("invalid-spec-block-path");r.push(s);continue}}throw Error("invalid-spec-block-path")}if(typeof r[0]!=="number")throw Error("invalid-spec-block-path");let i=r[r.length-1];if(typeof i!=="number"&&!(t.allowSlotEnd&&typeof i==="string"))throw Error("invalid-spec-block-path");return r}function Oo(e,t,n){if(!ne(e)||!H(e.pageId))throw new P("invalid-spec-patch",t,n,"target.pageId is required");if(!e.blockId&&e.blockPath===void 0)throw new P("invalid-spec-patch",t,n,"target requires blockId or blockPath");if(e.blockId!==void 0&&!H(e.blockId))throw new P("invalid-spec-patch",t,n,"invalid target.blockId");if(e.blockPath!==void 0)try{ze(e.blockPath,{allowRoot:!1,allowSlotEnd:!1})}catch{throw new P("invalid-spec-block-path",t,n,"invalid target.blockPath")}}function Od(e,t,n){if(!ne(e)||!H(e.pageId))throw new P("invalid-spec-patch",t,n,"target.pageId is required");if(e.parentBlockId!==void 0&&!H(e.parentBlockId))throw new P("invalid-spec-patch",t,n,"invalid parentBlockId");if(e.parentPath!==void 0)try{ze(e.parentPath,{allowRoot:!0,allowSlotEnd:!0})}catch{throw new P("invalid-spec-block-path",t,n,"invalid parentPath")}if(e.slot!==void 0){if(typeof e.slot!=="string"||!iv.test(e.slot)||Er.has(e.slot))throw new P("patch-slot-invalid",t,n,"invalid target.slot")}if(e.index!==void 0&&(typeof e.index!=="number"||!Number.isInteger(e.index)||e.index<0))throw new P("invalid-spec-patch",t,n,"invalid target.index")}function _d(e){if(He(e),!ne(e)||!Array.isArray(e.pages)||e.pages.length===0)throw Error("invalid-blueprint-pages");if(e.pages.length>64)throw Error("invalid-blueprint-pages");if(e.connections!==void 0){if(!Array.isArray(e.connections))throw Error("invalid-blueprint-connection");let t=new Set;for(let n of e.connections){if(!ne(n)||!H(n.id)||!H(n.entity))throw Error("invalid-blueprint-connection");if(t.has(n.id))throw Error("duplicate-blueprint-connection");if(t.add(n.id),Object.hasOwn(n,"bindings")&&n.bindings!==void 0)throw Error("blueprint-connection-bindings-forbidden");if(n.mockSeed!==void 0&&(!Array.isArray(n.mockSeed)||n.mockSeed.some((r)=>!ne(r))))throw Error("invalid-blueprint-connection");if(n.mockGenerate!==void 0&&(typeof n.mockGenerate!=="number"||!Number.isInteger(n.mockGenerate)||n.mockGenerate<0||n.mockGenerate>500))throw Error("invalid-blueprint-connection")}}for(let t of e.pages){if(!ne(t))throw Error("invalid-blueprint-page");if(t.id!==void 0&&!H(t.id))throw Error("invalid-blueprint-page");if(t.path!==void 0&&typeof t.path!=="string")throw Error("invalid-blueprint-page");if(t.kind==="blocks"||t.kind===void 0&&Array.isArray(t.blocks)){if(!H(t.id)||typeof t.path!=="string"||!Array.isArray(t.blocks))throw Error("invalid-blueprint-page");continue}if(!(H(t.solutionId)||H(t.familyId)&&H(t.variantId)))throw Error("invalid-blueprint-page")}}function Bd(e,t={}){if(!Array.isArray(e))throw new P("invalid-spec-patch",0,"batch","operations must be an array");if(e.length>200)throw new P("spec-patch-batch-too-large",e.length,"batch","exceeds maximum batch size 200");for(let n=0;n<e.length;n++){let r=e[n];if(!ne(r)||typeof r.op!=="string")throw new P("invalid-spec-patch",n,"unknown","operation must declare op");let i=r.op;try{He(r)}catch(o){let s=o instanceof Error?o.message:"unsafe json",a=s.includes("spec-json-depth-exceeded")?"spec-json-depth-exceeded":"unsafe-spec-key";throw new P(a,n,i,s)}switch(i){case"addPage":if(!ne(r.page)||!H(r.page.id)||typeof r.page.path!=="string"||!Array.isArray(r.page.blocks))throw new P("invalid-spec-patch",n,i,"invalid page object");break;case"removePage":case"updatePage":case"setPageState":if(!H(r.pageId))throw new P("invalid-spec-patch",n,i,"pageId is required");break;case"insertBlock":if(Od(r.target,n,i),!ne(r.block)||!H(r.block.type))throw new P("invalid-spec-patch",n,i,"block.type is required");break;case"replaceBlock":if(Oo(r.target,n,i),!ne(r.block)||!H(r.block.type))throw new P("invalid-spec-patch",n,i,"block.type is required");break;case"removeBlock":case"updateProps":case"setEvents":Oo(r.target,n,i);break;case"moveBlock":Oo(r.from,n,i),Od(r.to,n,i);break;case"upsertEntity":if(!H(r.name)||!ne(r.entity))throw new P("invalid-spec-patch",n,i,"name and entity required");break;case"removeEntity":if(!H(r.name))throw new P("invalid-spec-patch",n,i,"name is required");break;case"upsertConnection":if(!ne(r.connection)||!H(r.connection.id)||!H(r.connection.entity))throw new P("invalid-spec-patch",n,i,"valid connection is required");if(!t.allowConnectionBindings&&Object.hasOwn(r.connection,"bindings")&&r.connection.bindings!==void 0)throw new P("spec-patch-connection-bindings-forbidden",n,i,"connection.bindings is host-owned and forbidden in spec patches");break;case"removeConnection":if(!H(r.connectionId))throw new P("invalid-spec-patch",n,i,"connectionId is required");break;case"setLayout":if(!ne(r.layout))throw new P("invalid-spec-patch",n,i,"layout object is required");break;case"setMenus":if(!ne(r.menus)||!Array.isArray(r.menus.items))throw new P("invalid-spec-patch",n,i,"menus.items is required");break;case"setDesign":if(!ne(r.design))throw new P("invalid-spec-patch",n,i,"design object is required");break;case"swapVariant":if(!ne(r.target)||typeof r.targetVariantId!=="string")throw new P("invalid-spec-patch",n,i,"target and targetVariantId are required");if(r.target.blockPath!==void 0)try{ze(r.target.blockPath,{allowRoot:!1,allowSlotEnd:!1})}catch{throw new P("invalid-spec-block-path",n,i,"invalid target.blockPath")}break;default:throw new P("invalid-spec-patch",n,i,`unknown op "${i}"`)}}}var Md=["resource-mcp-invalid-argument","resource-query-failed"];function Nt(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 Dd(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 ov(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function sv(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 me(e){return{content:[{type:"json",json:e}]}}function Q(e){return{content:[{type:"text",text:e}],isError:!0}}function Nr(e,t){return{content:[{type:"json",json:{error:{code:e,detail:t}}}],isError:!0}}var hn="uibot_resource_";function av(e){return`${hn}${e}`}function Ld(e,t){let n;if(e==="resource-kind")n={type:"string",enum:[...un]};else if(e==="resource-maturity")n={type:"string",enum:[...Et]};else if(e==="positive-integer")n={type:"integer",minimum:1};else n={type:"string"};return t?{type:"array",items:n}:n}function lv(){return Rr.map((e)=>{let t={},n=[];for(let r of e.positionals)if(t[r.property]=Ld(r.type,"variadic"in r&&r.variadic===!0),r.required)n.push(r.property);for(let r of e.options)t[r.property]=Ld(r.type,"multiple"in r&&r.multiple===!0);return{name:av(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...n.length?{required:n}:{}}}})}class ge extends Error{detail;code=Md[0];constructor(e){super(e);this.detail=e;this.name="ResourceMcpArgumentError"}}function fn(e,t){let n=new Set(t),r=Object.keys(e).find((i)=>!n.has(i));if(r)throw new ge(`unsupported argument: ${r}`)}function Or(e,t){let n=e[t];if(n===void 0)return;if(typeof n!=="string"||!n.trim())throw new ge(`${t} must be a non-empty string`);return n}function gt(e,t,n){let r=e[t];if(r===void 0)return;if(!Array.isArray(r)||r.length===0||r.some((i)=>typeof i!=="string"||!i.trim()))throw new ge(`${t} must be a non-empty string array`);if(n){let i=r.find((o)=>!n.includes(o));if(i)throw new ge(`${t} contains unsupported value: ${i}`)}return r}function cv(e){if(e instanceof ge)return Nr(e.code,e.detail);if(e&&typeof e==="object"){let t=e;if(typeof t.code==="string"){let n=typeof t.detail==="string"?t.detail:typeof t.message==="string"?t.message:t.code;return Nr(t.code,n)}}return Nr(Md[1],"resource query callback failed")}async function dv(e,t,n){try{if(e==="manifest")return fn(t,[]),me({data:{index:await n.manifest()}});if(e==="search"){fn(t,["text","kinds","tags","categories","capabilities","maturities","functions","scenarios","units","industries","limit"]);let i=Or(t,"text"),o=gt(t,"kinds",un),s=gt(t,"tags"),a=gt(t,"categories"),l=gt(t,"capabilities"),c=gt(t,"maturities",Et),d=Object.fromEntries(["functions","scenarios","units","industries"].flatMap((u)=>{let f=gt(t,u);return f?[[u,f]]:[]})),p=t.limit;if(p!==void 0&&(typeof p!=="number"||!Number.isInteger(p)||p<=0))throw new ge("limit must be a positive integer");let m={...d,...i?{text:i}:{},...o?{kinds:o}:{},...s?{tags:s}:{},...a?{categories:a}:{},...l?{capabilities:l}:{},...c?{maturities:c}:{},...typeof p==="number"?{limit:p}:{}};return me({data:{matches:await n.search(m)}})}if(e==="get"){fn(t,["id"]);let i=Or(t,"id");if(!i)throw new ge("id must be a non-empty string");return me({data:{resource:await n.get(i)}})}if(e==="docs"||e==="examples"||e==="install-plan"){fn(t,e==="docs"?["id","locale","page"]:e==="examples"?["id","page"]:["id"]);let i=Or(t,"id");if(!i)throw new ge("id must be a non-empty string");let o=Or(t,"locale");if(o&&o!=="zh"&&o!=="en")throw new ge("locale must be zh or en");if(!(e==="docs"?n.docs:e==="examples"?n.examples:n.installPlan))return Q(Nt(e,e));let a=t.page;if(a!==void 0&&(typeof a!=="number"||!Number.isSafeInteger(a)||a<1))throw new ge("page must be a positive integer");let l=e==="docs"?await n.docs?.(i,o,a):e==="examples"?await n.examples?.(i,a):await n.installPlan?.(i);return me({data:l})}fn(t,["roots"]);let r=gt(t,"roots");if(!r)throw new ge("roots must be a non-empty string array");return me({data:{plan:await n.build(r)}})}catch(r){return cv(r)}}function $d(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 run deterministic autofix (unless `autofix: false`), strictly compile it against the catalog and return JSON-path gaps, warnings and multi-page route reachability; or pass `html` to run design-quality rules.",inputSchema:{type:"object",properties:{spec:{description:"UIBot Spec object, or its JSON/YAML text"},html:{type:"string",description:"Generated HTML document"},autofix:{type:"boolean",description:"Automatically repair undeclared page.state roots, misplaced block fields, duplicate ids and relative paths before strict compilation (default: true)"}}}},{name:"uibot_spec_compose",description:"Compose a valid multi-page UIBot Spec 2.0 application deterministically from an AppBlueprint (pages, solutions/variants, shellVariant, entities, mock collections and theme) without hand-authoring full JSON.",inputSchema:{type:"object",properties:{title:{type:"string",description:"Application title"},shellVariant:{type:"string",description:"Target L4 shell variant id (e.g. admin-sidebar, top-navbar, console-drilldown)"},pages:{type:"array",description:"Blueprint page entries ({ solutionId, familyId, variantId, path, title, configuration } or custom blocks pages)"},entities:{type:"object",description:"Data entities map keyed by entity name"},connections:{type:"array",description:"Collection connection definitions ({ id, entity, mockSeed, mockGenerate })"},mockSeed:{type:"object",description:"Optional entity-keyed seed arrays used to populate mock collections"},layout:{type:"object",description:"Optional global AppLayoutOptions overrides"},design:{type:"object",description:"Optional UIBotDesignSystem metadata"},menus:{type:"object",description:"Optional navigation menu configuration"},auth:{type:"object",description:"Optional AuthConfig metadata"},autofix:{type:"boolean",description:"Run deterministic autofix after composing (default: true)"},format:{type:"string",enum:["json","yaml"],description:"Output serialization format: 'json' returns `spec` (default), 'yaml' returns `yaml`"}},required:["pages"]}},{name:"uibot_variant_list",description:"List switchable UIBot variant families (L1-L4) with semantic slot contracts, variant IDs and optional matches against a supplied Spec.",inputSchema:{type:"object",properties:{familyId:{type:"string",description:"Exact variant family id (e.g. shell.workspace.v1)"},resourceId:{type:"string",description:"Filter families containing this resource id"},level:{type:"string",enum:["L1","L2","L3","L4"],description:"Capability level filter"},targetKind:{type:"string",enum:["shell","page","frame","section","block"],description:"Target kind filter"},query:{type:"string",description:"Substring search across family/variant metadata"},spec:{description:"Optional UIBot Spec (object or JSON/YAML string) to annotate currentMatches"}}}},{name:"uibot_spec_swap",description:"Losslessly swap an L1-L4 variant (shell, page, frame, section or block) inside an existing UIBot Spec using semantic slot projection and return unmappedWarnings without dropping bindings.",inputSchema:{type:"object",properties:{spec:{description:"Source UIBot Spec object or JSON/YAML text"},target:{type:"object",description:"Swap target descriptor: { kind: 'shell'|'page'|'frame'|'section'|'block', pageId?, blockId?, role? }"},targetVariant:{type:"string",description:"Target variant id"},targetVariantId:{type:"string",description:"Alias of targetVariant"},familyId:{type:"string",description:"Optional explicit variant family id"},preserveCustomizations:{type:"boolean",description:"Preserve customized props/titles/events across swap (default: true)"},pageMapping:{type:"object",description:"Optional page id/path overrides when swapping"},autofix:{type:"boolean",description:"Run deterministic autofix after swap (default: true)"},format:{type:"string",enum:["json","yaml"],description:"Output serialization format: 'json' returns `spec` (default), 'yaml' returns `yaml`"}},required:["spec","target"]}},{name:"uibot_spec_patch",description:"Apply an atomic sequence of surgical SpecPatchOp mutations (insertBlock, replaceBlock, removeBlock, moveBlock, updateProps, setEvents, addPage, removePage, updatePage, setPageState, upsertEntity, upsertConnection, setLayout, swapVariant) with full rollback on error.",inputSchema:{type:"object",properties:{spec:{description:"Source UIBot Spec object or JSON/YAML text"},operations:{type:"array",description:"Ordered SpecPatchOp[] list"},autofix:{type:"boolean",description:"Run deterministic autofix after patching (default: true)"},format:{type:"string",enum:["json","yaml"],description:"Output serialization format: 'json' returns `spec` (default), 'yaml' returns `yaml`"}},required:["spec","operations"]}},...lv()],n={uibot_spec_compose:"compose",uibot_variant_list:"listVariants",uibot_spec_swap:"swap",uibot_spec_patch:"patch"};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 in n){let i=n[r.name];return typeof e.specOps?.[i]==="function"}if(r.name.startsWith(hn)){let i=r.name.slice(hn.length),o=i==="install-plan"?"installPlan":i;return e.resourceQuery!=null&&typeof e.resourceQuery[o]==="function"}return!0})},async callTool(r,i){if(r.startsWith(hn)){let o=r.slice(hn.length);if(!Rr.some((a)=>a.name===o))return Q(`Unknown tool: ${r}`);if(!e.resourceQuery)return Q(Nt(r,"resourceQuery"));return dv(o,i,e.resourceQuery)}if(r==="uibot_request_component"){if(e.serviceAvailable===!1)return Q(Dd(r));let o=typeof i.name==="string"?i.name:"";if(!o)return Q("Field 'name' is required");let s=await e.service.requestComponent({name:o,...typeof i.context==="string"?{context:i.context}:{},...typeof i.requestedBy==="string"?{requestedBy:i.requestedBy}:{},...i.priority==="low"||i.priority==="normal"||i.priority==="high"?{priority:i.priority}:{}});return me(ov(s))}if(r==="uibot_get_task_status"){if(e.serviceAvailable===!1)return Q(Dd(r));let o=typeof i.taskId==="string"?i.taskId:"";if(!o)return Q("Field 'taskId' is required");let s=e.service.getTaskStatus(o);return s?me(sv(s)):Q("Task not found")}if(r==="uibot_list_catalog"){let o=e.discovery?.listCatalog;if(!o)return Q(Nt(r,"listCatalog"));let s=await o(),a=Array.isArray(s)?s:[],l=typeof i.query==="string"?i.query.toLowerCase():"",c=l?a.filter((d)=>JSON.stringify(d).toLowerCase().includes(l)):a;return me({items:c,count:c.length})}if(r==="uibot_get_design_md"){let o=e.discovery?.getDesignMd;if(!o)return Q(Nt(r,"getDesignMd"));let s=typeof i.id==="string"?i.id:void 0,a=await o(s)??(s?null:[]);return me({id:s??null,data:a})}if(r==="uibot_list_templates"){let o=e.discovery?.listTemplates;if(!o)return Q(Nt(r,"listTemplates"));let s=await o(),a=Array.isArray(s)?s:[],l=typeof i.query==="string"?i.query.toLowerCase():"",c=l?a.filter((d)=>JSON.stringify(d).toLowerCase().includes(l)):a;return me({items:c,count:c.length})}if(r in n){let o=n[r],s=e.specOps?.[o];if(!s)return Q(Nt(r,`specOps.${o}`));try{return me(await s(i))}catch(a){if(a&&typeof a==="object"&&"code"in a){let l=a;if(typeof l.code==="string"){let c=typeof l.detail==="string"?l.detail:typeof l.message==="string"?l.message:l.code;return Nr(l.code,c)}}return Q(a instanceof Error?a.message:String(a))}}if(r==="uibot_validate"){if(!e.validate)return Q(`Tool '${r}' is not wired in this build: no 'validate' provider was supplied.`);let o=typeof i.html==="string"?i.html:void 0;if(i.spec===void 0&&o===void 0)return Q("Provide 'spec' or 'html'");if(i.autofix!==void 0&&typeof i.autofix!=="boolean")return Q("Field 'autofix' must be a boolean");try{return me(await e.validate({...i.spec===void 0?{}:{spec:i.spec},...o===void 0?{}:{html:o},...typeof i.autofix==="boolean"?{autofix:i.autofix}:{}}))}catch(s){return Q(s instanceof Error?s.message:String(s))}}return Q(`Unknown tool: ${r}`)}}}var Fd="0.22.0";function Ud(e,t={}){let n=t.compact?void 0:2;return e.map((r)=>r.type==="text"?{type:"text",text:r.text}:{type:"text",text:r.json===void 0?"null":JSON.stringify(r.json,null,n)})}import{existsSync as hl,readFileSync as nE}from"node:fs";import{fileURLToPath as yl}from"node:url";var uv=["sidebar","surface","foreground","accent","accent-foreground","primary","primary-foreground","border","font","font-display","font-body","font-mono"],jd={type:"object",additionalProperties:!1,properties:Object.fromEntries(uv.map((e)=>[e,{type:"string"}])),description:"Frame-local tokens; surface is page background. Other keys are rejected."};var yn={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"}}},CollectionKanban:{name:"CollectionKanban",description:"Kanban.",category:"composite",level:"L2",tags:["kanban"],props:{label:{type:"string"},rows:{type:"array"},groupBy:{type:"string"},lanes:{type:"array"},titleField:{type:"string"},subtitleField:{type:"string"},badgeField:{type:"string"},selectedId:{type:"string"}},events:{onSelect:{description:""},onMove:{description:""},onDelete:{description:""}}},RecordMasterDetail:{name:"RecordMasterDetail",description:"Master-detail.",category:"composite",level:"L2",tags:["master-detail"],props:{label:{type:"string"},rows:{type:"array"},selectedId:{type:"string"},titleField:{type:"string"},subtitleField:{type:"string"},badgeField:{type:"string"},fields:{type:"array"}},events:{onSelect:{description:""},onDelete:{description:""}},slots:{detail:{description:"Detail"}}},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:{shell:{type:"string",enum:["admin-sidebar","console-drilldown","sidebar-floating","sidebar-inset","top-navbar","dual-pane"]},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:jd,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 shell","Settings page","Landing page"],constraints:["One per page; no nesting."]},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 De={eyebrow:"AI-First Modular UI",title:"Assemble production apps in",titleEmphasis:"minutes",subtitle:"Compose typed L1–L4 building blocks, hot-swap shells or conversion sections without losing business copy, and ship clean React or Spec 2.0.",primaryCta:{label:"Start building free",href:"#pricing"},secondaryCta:{label:"Explore catalog",href:"#features"},note:"Open source · Zero vendor lock-in · Deterministic compilation"},Bo=[{id:"launch-hero-frame",type:"BrowserFrame",props:{title:"studio.uibot.dev/launch",variant:"flat",tone:"0"},slots:{content:[{id:"launch-hero-stats",type:"StatGrid",props:{cols:"2",items:[{label:"Compile pass rate",value:"99.4%",trend:"up",change:"+14%"},{label:"Swappable blocks",value:"92+",description:"L1–L4 contracts"}]}}]}}],zd=[{icon:"layers",title:"Four-layer swappable contracts",desc:"Hot-swap shells, page views, and marketing sections while preserving bindings and custom copy.",tone:0,span:{col:2,row:1}},{icon:"zap",title:"Deterministic AI operators",desc:"Compose, patch, and autofix specs via MCP 2.0 and CLI without fragile hand-written JSON.",tone:1},{icon:"code",title:"Dual-mode output",desc:"Run live in the Spec 2.0 runtime or materialize clean, zero-lock-in React TSX + Vite.",tone:2},{icon:"shield",title:"Host-owned data boundary",desc:"Keep credentials and real SQL/API gateways strictly on your server while previewing with mock seeds.",tone:3,span:{col:2,row:1}}];function qd(){return zd.map((e)=>{let t={icon:e.icon,title:e.title,desc:e.desc,tone:e.tone};if(e.span)t.span={col:e.span.col,row:e.span.row};return t})}var Vd=[{name:"Starter",price:"$0",period:"/mo",description:"For solo builders prototyping modular apps.",features:["All L1–L4 public blocks","Local mock Collections","CLI & MCP spec operators"],cta:{label:"Get started",href:"#cta"},highlighted:!1},{name:"Pro",price:"$39",period:"/mo",description:"For product teams shipping AI-generated apps.",features:["Everything in Starter","Custom private registries","Team review & release gates","Priority email support"],cta:{label:"Start 14-day trial",href:"#cta"},highlighted:!0},{name:"Enterprise",price:"Custom",period:"",description:"Self-hosted gateways and custom design systems.",features:["Dedicated data gateway adapters","SSO / SAML & audit logs","Custom DESIGN.md & SLA"],cta:{label:"Contact sales",href:"#cta"},highlighted:!1}],Do=[{quote:"Swapping our operations workspace between Table, Kanban, and Master-Detail took one tool call with zero broken bindings.",author:"Lin Chen",role:"Staff Frontend Engineer, Northstar",rating:5},{quote:"Materializing a 4-page app into standalone React + Vite gave our team full ownership of the code from day one.",author:"Elena Vance",role:"VP of Engineering, Kestrel Cloud",rating:5},{quote:"The semantic slot contract turned AI generation from hit-or-miss HTML into a repeatable engineering workflow.",author:"Marcus Sato",role:"Product Architect, OrbitLabs",rating:5}],Hd=[{q:"Can we switch section layouts after customizing our copy?",a:"Yes. Every L2 marketing section family projects titles, items, plans, and CTAs through semantic slots and reports any unmapped properties explicitly."},{q:"Does the exported React TSX depend on a hosted UIBot runtime?",a:"No. Running `uibot materialize --target react-tsx --scaffold vite-react` outputs standalone React and Tailwind code with zero `@uibot/*` runtime dependencies."},{q:"How do real APIs and databases stay secure?",a:"Specs only declare logical entities and mock seeds. Real upstream URLs, credentials, and authorization remain strictly inside your host data gateway."}],Lo={schema:"uibot.variant-contract.v1",familyId:"marketing.section.hero",level:"L2",targetKind:"section",title:{zh:"官网首屏 Hero 区块",en:"Marketing hero section"},description:"Swappable L2 hero section variants (editorial showcase, split visual, reversed split) preserving headline, subtitle, CTA and visual slot.",presentationProps:["reverse","tone","titleEmphasis","secondaryCta","note"],semanticSlots:[{id:"eyebrow",label:{zh:"眉标",en:"Eyebrow"},preserveMode:"when-customized"},{id:"title",label:{zh:"主标题",en:"Headline"},required:!0,preserveMode:"always"},{id:"subtitle",label:{zh:"副标题",en:"Subtitle"},preserveMode:"always"},{id:"primaryCta",label:{zh:"主行动按钮",en:"Primary CTA"},preserveMode:"always"},{id:"visual",label:{zh:"右侧配图槽",en:"Visual slot"},preserveMode:"when-customized"}],variants:[{id:"hero-editorial",aliases:["editorial","centered-hero"],title:{zh:"编辑风首屏 Hero",en:"Editorial hero"},description:"Asymmetric editorial display headline with primary/secondary CTAs and aside slot.",slotBindings:{eyebrow:{kind:"block-prop",property:"eyebrow"},title:{kind:"block-prop",property:"title"},subtitle:{kind:"block-prop",property:"subtitle"},primaryCta:{kind:"block-prop",property:"primaryCta"},visual:{kind:"block-children",property:"aside"}},blockTemplate:{type:"Hero",props:structuredClone(De),slots:{aside:structuredClone(Bo)}}},{id:"hero-split",aliases:["split","split-hero"],title:{zh:"左右分栏首屏",en:"Split hero"},description:"Two-column product split pairing copy and CTA on the left with a visual on the right.",slotBindings:{eyebrow:{kind:"block-prop",property:"eyebrow"},title:{kind:"block-prop",property:"title"},subtitle:{kind:"block-prop",property:"body"},primaryCta:{kind:"block-prop",property:"cta"},visual:{kind:"block-children",property:"visual"}},blockTemplate:{type:"FeatureSplit",props:{eyebrow:De.eyebrow,title:De.title,body:De.subtitle,cta:structuredClone(De.primaryCta),reverse:!1,tone:"0"},slots:{visual:structuredClone(Bo)}}},{id:"hero-split-reversed",aliases:["split-reversed"],title:{zh:"左图右文分栏首屏",en:"Reversed split hero"},description:"Visual-first two-column hero with media on the left and headline/CTA on the right.",slotBindings:{eyebrow:{kind:"block-prop",property:"eyebrow"},title:{kind:"block-prop",property:"title"},subtitle:{kind:"block-prop",property:"body"},primaryCta:{kind:"block-prop",property:"cta"},visual:{kind:"block-children",property:"visual"}},blockTemplate:{type:"FeatureSplit",props:{eyebrow:De.eyebrow,title:De.title,body:De.subtitle,cta:structuredClone(De.primaryCta),reverse:!0,tone:"1"},slots:{visual:structuredClone(Bo)}}}]},Mo={schema:"uibot.variant-contract.v1",familyId:"marketing.section.bento-features",level:"L2",targetKind:"section",title:{zh:"特性 Bento / 卡片网格区块",en:"Bento & feature grid section"},description:"Swappable L2 feature showcase layouts (3-column bento, 4-column bento, uniform 3-column feature grid) sharing `{icon, title, desc}` items.",presentationProps:["cols","gap"],semanticSlots:[{id:"items",label:{zh:"特性条目",en:"Feature items"},required:!0,preserveMode:"always"}],variants:[{id:"bento-3col",aliases:["bento","bento-mosaic"],title:{zh:"三列 Bento 拼贴",en:"3-column Bento mosaic"},description:"Asymmetric 3-column BentoGrid highlighting hero capability spans.",slotBindings:{items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"BentoGrid",props:{cols:"3",gap:"md",items:qd()}}},{id:"bento-4col",aliases:["bento-wide"],title:{zh:"四列宽屏 Bento",en:"4-column Bento grid"},description:"High-density 4-column BentoGrid for broad platform capability matrices.",slotBindings:{items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"BentoGrid",props:{cols:"4",gap:"md",items:qd()}}},{id:"feature-grid-3col",aliases:["feature-grid","cards-3col"],title:{zh:"均衡三列特性卡",en:"Uniform 3-column feature grid"},description:"Clean uniform FeatureGrid cards with hover lift and icon badges.",slotBindings:{items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"FeatureGrid",props:{cols:"3",items:zd.map(({icon:e,title:t,desc:n})=>({icon:e,title:t,desc:n}))}}}]},$o={schema:"uibot.variant-contract.v1",familyId:"marketing.section.pricing",level:"L2",targetKind:"section",title:{zh:"官网定价方案区块",en:"Pricing table section"},description:"Swappable L2 SaaS pricing tiers (3-tier recommended, 2-tier focused, 4-tier matrix) preserving customized plans and billing note.",semanticSlots:[{id:"plans",label:{zh:"定价方案列表",en:"Pricing plans"},required:!0,preserveMode:"when-customized"},{id:"billingNote",label:{zh:"计费说明",en:"Billing note"},preserveMode:"when-customized"}],variants:[{id:"pricing-3tier",aliases:["3-tier","saas-3tier"],title:{zh:"三档经典定价",en:"3-tier SaaS pricing"},description:"Starter, highlighted Pro, and Enterprise tiers.",slotBindings:{plans:{kind:"block-prop",property:"plans"},billingNote:{kind:"block-prop",property:"billingNote"}},blockTemplate:{type:"PricingTable",props:{plans:structuredClone(Vd),billingNote:"Billed annually · Cancel or upgrade anytime · Transparent seat pricing"}}},{id:"pricing-2tier",aliases:["2-tier","simple-pricing"],title:{zh:"双档精简定价",en:"2-tier focused pricing"},description:"Compact Free vs Pro comparison for fast self-serve conversion.",slotBindings:{plans:{kind:"block-prop",property:"plans"},billingNote:{kind:"block-prop",property:"billingNote"}},blockTemplate:{type:"PricingTable",props:{plans:structuredClone(Vd.slice(0,2)),billingNote:"No credit card required to start · Upgrade in one click"}}}]},Fo={schema:"uibot.variant-contract.v1",familyId:"marketing.section.testimonials",level:"L2",targetKind:"section",title:{zh:"客户证言与口碑区块",en:"Testimonials & social proof section"},description:"Swappable L2 testimonial layouts (3-column wall, 2-column grid, single spotlight quote) sharing quote items.",presentationProps:["columns"],semanticSlots:[{id:"items",label:{zh:"证言列表",en:"Testimonial quotes"},required:!0,preserveMode:"always"}],variants:[{id:"testimonials-3col",aliases:["wall-3col"],title:{zh:"三列客户口碑墙",en:"3-column quote wall"},description:"Balanced 3-column grid of customer quotes and ratings.",slotBindings:{items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"Testimonials",props:{columns:"3",items:structuredClone(Do)}}},{id:"testimonials-2col",aliases:["grid-2col"],title:{zh:"双列证言卡片",en:"2-column testimonial grid"},description:"Roomier 2-column editorial layout for longer case quotes.",slotBindings:{items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"Testimonials",props:{columns:"2",items:structuredClone(Do)}}},{id:"testimonials-spotlight",aliases:["spotlight"],title:{zh:"单栏精选证言",en:"Single spotlight quote"},description:"Full-width stacked testimonial spotlight for high-emphasis social proof.",slotBindings:{items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"Testimonials",props:{columns:"1",items:structuredClone(Do)}}}]},Uo={schema:"uibot.variant-contract.v1",familyId:"marketing.section.faq-accordion",level:"L2",targetKind:"section",title:{zh:"常见问题 FAQ 折叠区块",en:"FAQ accordion section"},description:"Swappable L2 FAQ accordion presets (first answer expanded vs compact all-collapsed) preserving heading and Q&A items.",presentationProps:["defaultOpenFirst"],semanticSlots:[{id:"eyebrow",label:{zh:"眉标",en:"Eyebrow"},preserveMode:"when-customized"},{id:"title",label:{zh:"区块标题",en:"Title"},preserveMode:"when-customized"},{id:"lead",label:{zh:"副说明",en:"Lead"},preserveMode:"when-customized"},{id:"items",label:{zh:"问答条目",en:"Q&A items"},required:!0,preserveMode:"always"}],variants:[{id:"faq-open-first",aliases:["editorial-faq","open-first"],title:{zh:"首条展开 FAQ",en:"Expanded-first FAQ"},description:"Editorial accordion with the top question expanded on initial render.",slotBindings:{eyebrow:{kind:"block-prop",property:"eyebrow"},title:{kind:"block-prop",property:"title"},lead:{kind:"block-prop",property:"lead"},items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"Faq",props:{eyebrow:"FAQ",title:"Frequently asked questions",lead:"Answers about modular compilation, React TSX export, and host data boundaries.",defaultOpenFirst:!0,items:structuredClone(Hd)}}},{id:"faq-collapsed",aliases:["compact-faq","collapsed"],title:{zh:"紧凑全收起 FAQ",en:"Compact collapsed FAQ"},description:"Compact FAQ list with all items collapsed until clicked.",slotBindings:{eyebrow:{kind:"block-prop",property:"eyebrow"},title:{kind:"block-prop",property:"title"},lead:{kind:"block-prop",property:"lead"},items:{kind:"block-prop",property:"items"}},blockTemplate:{type:"Faq",props:{eyebrow:"FAQ",title:"Frequently asked questions",lead:"Answers about modular compilation, React TSX export, and host data boundaries.",defaultOpenFirst:!1,items:structuredClone(Hd)}}}]},jo={schema:"uibot.variant-contract.v1",familyId:"marketing.section.cta-banner",level:"L2",targetKind:"section",title:{zh:"底部转化 CTA / 订阅条区块",en:"CTA banner & newsletter section"},description:"Swappable L2 conversion closers (high-contrast CTA band, email newsletter capture, compact announcement banner) preserving headline and CTA.",presentationProps:["placeholder","icon","tone","solid","dismissible"],semanticSlots:[{id:"title",label:{zh:"主文案",en:"Headline"},required:!0,preserveMode:"always"},{id:"subtitle",label:{zh:"副文案",en:"Subtitle"},preserveMode:"when-customized"},{id:"cta",label:{zh:"行动按钮",en:"Call to action"},required:!0,preserveMode:"always"}],variants:[{id:"cta-band",aliases:["dark-band","conversion-band"],title:{zh:"高对比转化通栏",en:"High-contrast CTA band"},description:"Inverted dark conversion band closing the landing page with a primary button.",slotBindings:{title:{kind:"block-prop",property:"title"},subtitle:{kind:"block-prop",property:"subtitle"},cta:{kind:"block-prop",property:"cta"}},blockTemplate:{type:"CtaBand",props:{title:"Ship your next product surface today",subtitle:"Start from a verified modular Spec or materialize standalone React + Vite.",cta:{label:"Launch in Studio",href:"#top"}}}},{id:"cta-newsletter",aliases:["newsletter","waitlist"],title:{zh:"邮件订阅 / 等候名单条",en:"Newsletter signup capture"},description:"Email capture CTA card for product launches, changelogs, and early access.",slotBindings:{title:{kind:"block-prop",property:"title"},subtitle:{kind:"block-prop",property:"subtitle"},cta:{kind:"block-prop",property:"cta"}},blockTemplate:{type:"Newsletter",props:{title:"Get release notes and new block drops",subtitle:"Monthly engineering updates — zero spam, unsubscribe anytime.",placeholder:"you@company.com",cta:{label:"Subscribe",href:"#top"}}}},{id:"cta-announcement",aliases:["announcement-banner","banner"],title:{zh:"紧凑横幅公告条",en:"Compact announcement banner"},description:"Lightweight single-line conversion strip with icon and inline CTA link.",slotBindings:{title:{kind:"block-prop",property:"message"},cta:{kind:"block-prop",property:"cta"}},blockTemplate:{type:"Banner",props:{message:"Ship your next product surface today",icon:"sparkles",tone:"0",solid:!0,dismissible:!1,cta:{label:"Launch in Studio",href:"#top"}}}}]},qo=[Lo,Mo,$o,Fo,Uo,jo];function Kd(e={}){let t=e.brand??"Northwind",n=structuredClone(Lo.variants[0]?.blockTemplate);if(n.id="launch-hero",n.props){if(e.heroTitle)n.props.title=e.heroTitle;if(e.heroEmphasis)n.props.titleEmphasis=e.heroEmphasis;if(e.heroSubtitle)n.props.subtitle=e.heroSubtitle}let r=structuredClone(Mo.variants[0]?.blockTemplate);r.id="launch-features";let i=structuredClone($o.variants[0]?.blockTemplate);i.id="launch-pricing";let o=structuredClone(Fo.variants[0]?.blockTemplate);o.id="launch-testimonials";let s=structuredClone(Uo.variants[0]?.blockTemplate);s.id="launch-faq";let a=structuredClone(jo.variants[0]?.blockTemplate);return a.id="launch-cta",{id:"launch-site",path:"/",title:`${t} — Product Launch`,blocks:[{id:"launch-page-container",type:"Box",props:{className:"mx-auto flex max-w-6xl flex-col gap-16 px-4 py-8 sm:px-6 lg:px-8"},children:[{id:"launch-navbar",type:"Box",props:{direction:"row",className:"flex flex-wrap items-center justify-between gap-4 border-b border-border pb-4"},children:[{id:"launch-brand",type:"Heading",props:{level:3,text:t}},{id:"launch-nav-links",type:"Box",props:{direction:"row",className:"flex flex-wrap items-center gap-4"},children:[{id:"nav-features",type:"Link",props:{label:"Features",href:"#features"}},{id:"nav-pricing",type:"Link",props:{label:"Pricing",href:"#pricing"}},{id:"nav-faq",type:"Link",props:{label:"FAQ",href:"#faq"}},{id:"nav-cta",type:"Link",props:{label:"Start free",href:"#cta",variant:"button"}}]}]},n,{id:"launch-features-header",type:"SectionHeader",props:{sectionNo:"01",eyebrow:"CAPABILITIES",title:"Built for teams that ship modular interfaces",lead:"Swap any section layout in one click without rewriting your copy or losing bindings."}},r,{id:"launch-pricing-header",type:"SectionHeader",props:{sectionNo:"02",eyebrow:"PRICING",title:"Simple pricing that scales with your team",lead:"Start free on local mocks and connect your own production gateways when ready."}},i,{id:"launch-testimonials-header",type:"SectionHeader",props:{sectionNo:"03",eyebrow:"CUSTOMERS",title:"Trusted by engineering teams",lead:"Real feedback from product teams running Spec 2.0 and materialized React."}},o,s,a,{id:"launch-footer",type:"Footer",props:{brand:t,tagline:"Modular AI-First UI blocks & deterministic compilers.",groups:[{title:"Product",links:[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"FAQ",href:"#faq"}]},{title:"Developers",links:[{label:"Documentation",href:"#docs"},{label:"CLI & MCP",href:"#cli"}]}],copyright:`© 2026 ${t}. All rights reserved.`,note:"Composed with L2 marketing.section.* blocks"}}]}]}}function Gd(e={}){return{version:"2.0",pages:[Kd(e)]}}var Vo={id:"launch-site",title:{zh:"模块化产品发布官网",en:"Modular product launch site"},description:"Responsive product launch landing page assembled from all six swappable L2 conversion section families (hero, bento-features, pricing, testimonials, faq-accordion, cta-banner).",solution:{functions:["marketing"],scenarios:["landing","features","pricing","cases","contact"],unit:"page",industries:["creation","commerce"],readiness:"interactive-demo",hostRequirements:["Wire CTA links and newsletter form submissions to your host marketing/signup routes"],limitations:["Marketing copy, plans and testimonials are demonstration fixtures; newsletter capture does not submit externally"]},spec:Gd(),controls:[]};var bn={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 C0=qs(),I0=Dn(),A0=As(),ea=Ln(),R0=wn(),et=M(),P0=Ye(),T0=z(),E0=Qe(),O0=Xe(),YB=yi(),N0=Qs(),_0=Xs(),B0=Zs(),wi=tm(),nm=vn();var D0=C0.Composer,L0=I0.Document,M0=A0.Schema,{YAMLError:$0,YAMLParseError:F0,YAMLWarning:U0}=ea,j0=R0.Alias,{isAlias:q0,isCollection:V0,isDocument:H0,isMap:z0,isNode:K0,isPair:G0,isScalar:W0,isSeq:Y0}=et,J0=P0.Pair,Q0=T0.Scalar,X0=E0.YAMLMap,Z0=O0.YAMLSeq;var eR=N0.Lexer,tR=_0.LineCounter,nR=B0.Parser,{parse:tt,parseAllDocuments:rR,parseDocument:iR,stringify:ta}=wi,{visit:oR,visitAsync:sR}=nm;class ee extends Error{code;details;constructor(e,t,n){super(t);this.name="CompileSpecError",this.code=e,this.details=n}}function aR(e,t){let n=Object.hasOwn(t,e)?t[e]:void 0;if(!n)throw new ee("unknown-template",`unknown template "${e}"`,{template:e});let r=n.pages[0]?.blocks[0];if(!r||r.type!=="PageLayout")throw new ee("invalid-shell-root",`template "${e}" root is not PageLayout`,{template:e});return r}function Si(e,t,n,r){let i=e;if(e.template){if(n.has(e.template))throw new ee("template-cycle",`template cycle at "${e.template}"`,{template:e.template});let o=aR(e.template,t),s=new Set(n);s.add(e.template);let a={...o.slots,...e.slots};if(r&&!e.slots?.sidebar)delete a.sidebar;let l=e.children??o.children,c=e.events??o.events,d=e.visible??o.visible;return i={...o,...e.id?{id:e.id}:{},props:{...o.props,...e.props},slots:a,...l?{children:l}:{},...c?{events:c}:{},...d!==void 0?{visible:d}:{}},Si(i,t,s,r)}return{...i,...i.children?{children:i.children.map((o)=>Si(o,t,n,r))}:{},...i.slots?{slots:Object.fromEntries(Object.entries(i.slots).map(([o,s])=>[o,s.map((a)=>Si(a,t,n,r))]))}:{}}}function lR(e){let t=(n)=>{if(n.template)return!0;if(n.children?.some(t))return!0;return Object.values(n.slots??{}).some((r)=>r.some(t))};return e.pages.some((n)=>n.blocks.some(t))}function rm(e,t){return e.map((n)=>{if("children"in n&&Array.isArray(n.children))return{type:"MenuGroup",props:{title:n.label},children:rm(n.children,t)};let r=n,i={label:r.label,href:r.path};if(r.icon)i.icon=r.icon;if(r.path===t)i.active=!0;return{type:"MenuLink",props:i}})}function cR(e){let t=e.menus?.items;if(!t?.length)return e;return{...e,pages:e.pages.map((n)=>({...n,blocks:n.blocks.map((r)=>{if(r.type!=="PageLayout")return r;if(r.slots?.sidebar?.length)return r;return{...r,slots:{...r.slots,sidebar:[{type:"PageSiderMenu",props:{title:n.title??r.props?.title??"Menu"},children:rm(t,n.path)}]}}})}))}}function qn(e,t={}){let n=Boolean(e.menus?.items?.length),r=lR(e)?{...e,pages:e.pages.map((i)=>({...i,blocks:i.blocks.map((o)=>Si(o,t,new Set,n))}))}:e;return cR(r)}function im(e,t){if(e===void 0)return;function n(){throw new ee("invalid-layout","Invalid application or page layout",{...t?{pageId:t}:{}})}if(!e||typeof e!=="object"||Array.isArray(e))n();for(let[r,i]of Object.entries(e)){if(t!==void 0&&r==="inherit"&&typeof i==="boolean")continue;let o=Co[r];if(!Object.hasOwn(Co,r)||!o?.includes(i))n()}}function om(e,t){if(im(e.layout),im(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 ee("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:r,...i}=t.layout??{},o={...vd,...t.layout?.inherit===!1?{}:e.layout,...i};return t.blocks.map((s)=>s.type==="PageLayout"?{...s,props:{...s.props,layout:o}}:s)}var xi=[{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"}],Vn=new Set(xi.map((e)=>e.id));var dR=new Set([...Vn,"_ref"]);function Ht(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function K(e){if(!Ht(e))return!1;let t=Object.keys(e);return t.length===1&&dR.has(t[0]??"")}function N(e){return Ht(e)&&!K(e)}function zn(e){return e.data!==void 0||Boolean(e.connections?.length)}function sm(e,t){let n=N(e.request)?e.request:void 0,r=e.connectionId??n?.connectionId;return typeof r==="string"?t.find((i)=>i.id===r):void 0}function Hn(e,t,n){if(!Array.isArray(e))return;e.forEach((r,i)=>{if(!N(r))return;let o=`${t}[${i}]`;n(r,o);for(let s of["onSuccess","onError"])if(Hn(r[s],`${o}.${s}`,n),r.action==="Request"&&N(r.params)&&N(r.params.request))Hn(r.params.request[s],`${o}.params.request.${s}`,n)})}function lm(e,t,n){if(!N(e))return;for(let[r,i]of Object.entries(e))Hn(i,`${t}.${r}`,n)}function cm(e,t,n){if(!N(e))return;for(let r of["onMount","onUnmount"])Hn(e[r],`${t}.${r}`,n);if(Array.isArray(e.onStateChange))e.onStateChange.forEach((r,i)=>{if(N(r))Hn(r.run,`${t}.onStateChange[${i}].run`,n)})}function am(e){return e instanceof Error?e.message:"Invalid data declaration"}function nt(e,t){if(!N(e))return e;return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,K(r)&&Object.hasOwn(t,n)?t[n]:r]))}function pR(e){let t=nt(e,{entities:{}});if(!N(t)||!N(t.entities))return t;let n=Object.keys(t.entities),r=Object.fromEntries(Object.entries(t.entities).map(([i,o])=>{if(K(o))return[i,{key:"id",fields:{id:{type:"json"}}}];let s=nt(o,{title:"dynamic",key:"id",fields:Object.fromEntries([[N(o)&&typeof o.key==="string"?o.key:"id",{type:"json"}],...N(o)&&typeof o.version==="string"?[[o.version,{type:"json"}]]:[]]),version:void 0});if(!N(s)||!N(s.fields))return[i,s];let a=Object.fromEntries(Object.entries(s.fields).map(([l,c])=>[l,K(c)?{type:"json"}:nt(c,{type:"json",title:"dynamic",required:!1,readOnly:!1,values:["dynamic"],entity:n[0]??i,maxLength:void 0})]));return[i,{...s,fields:a,...N(o)&&K(o.key)?{key:Object.keys(a)[0]??"id"}:{}}]}));return{...t,entities:r}}function uR(e){let t=nt(e,{driver:N(e)&&e.operations!==void 0?"http":"pg",upstream:"dynamic",table:"dynamic",fields:{},operations:{},response:{},errors:{}});if(!N(t))return t;if(N(t.fields))t.fields=Object.fromEntries(Object.entries(t.fields).map(([r,i])=>[r,K(i)?"dynamic":nt(i,{from:"dynamic",format:void 0})]));let n=(r,i=!1)=>K(r)?{value:null}:nt(r,{from:i&&N(r)&&r.format==="field-direction"?"order":"id",format:void 0});if(N(t.operations))t.operations=Object.fromEntries(Object.entries(t.operations).map(([r,i])=>{if(K(i))return[r,{method:"GET",path:"/dynamic"}];let o=nt(i,{method:"GET",path:"/dynamic",query:{},body:{value:null},ifMatch:void 0});if(!N(o))return[r,o];if(N(o.query))o.query=Object.fromEntries(Object.entries(o.query).map(([s,a])=>[s,n(a,!0)]));if(N(o.body))o.body=Object.hasOwn(o.body,"from")||Object.hasOwn(o.body,"value")?n(o.body):Object.fromEntries(Object.entries(o.body).map(([s,a])=>[s,n(a)]));return[r,o]}));if(N(t.response))t.response=Object.fromEntries(Object.entries(t.response).map(([r,i])=>[r,K(i)?"dynamic":i]));if(N(t.errors)){if(t.errors=nt(t.errors,{message:"dynamic",fields:"dynamic",codes:{}}),N(t.errors)&&N(t.errors.codes))t.errors.codes=Object.fromEntries(Object.entries(t.errors.codes).map(([r,i])=>[r,K(i)?"invalid-request":i]))}return t}function dm(e,t){if(!t||!zn(t.source))return[];let{source:n}=t,r=[],i=e.pageId??e.root,o=(m,u,f,g=i)=>{r.push({code:m,message:u,path:f,elementKey:g})},s=n.connections??[],a;if(n.data!==void 0&&!K(n.data))try{a=Ee(pR(n.data))}catch(m){if(t.global)o("data:entity-shape",am(m),"data")}let l=(m)=>{let u=n.data?.entities,f=m.entity;if(typeof f!=="string"||!N(u)||!Object.hasOwn(u,f))return;let g=u[f];if(!N(g)||!N(g.fields))return;return a?.entities[f]};if(t.global){let m=new Set;for(let[u,f]of s.entries()){let g=`connections[${u}]`;if(m.has(f.id))o("data:connection-shape","Connection id is duplicated",`${g}.id`);if(m.add(f.id),f.type!=="Collection"||Object.keys(f).some((y)=>!["id","type","entity","mock","bindings"].includes(y)))o("data:connection-shape","Connection must use the logical collection contract",g);let h=l(f),b=typeof f.entity==="string"&&a&&Object.hasOwn(a.entities,f.entity);if(!K(f.entity)&&(!f.entity||a&&N(n.data?.entities)&&!b||n.data===void 0))o("data:connection-shape","Logical connection must reference a declared entity",`${g}.entity`);if(N(f.bindings))for(let[y,v]of Object.entries(f.bindings)){let k=`${g}.bindings.${y}`;if(!/^[a-z][a-z0-9-]{0,31}$/.test(y)||y==="mock")o("data:connection-shape","Invalid or reserved data environment name",k);if(K(v))continue;try{let S=Eo(uR(v));for(let x of Object.keys(S.fields??{}))if(h&&!Object.hasOwn(h.fields,x))o("data:binding-shape","Binding field is not declared in the entity",`${k}.fields.${x}`)}catch(S){o("data:binding-shape",am(S),k)}}else if(f.bindings!==void 0&&!K(f.bindings))o("data:binding-shape","Bindings must be an environment map",`${g}.bindings`);if(f.mock!==void 0&&!K(f.mock)){let y=f.mock;if(!Ht(y)||Object.keys(y).some((v)=>!["seed","generate"].includes(v))){o("data:connection-shape","Invalid mock declaration",`${g}.mock`);continue}if(y.generate!==void 0&&!K(y.generate)&&(typeof y.generate!=="number"||!Number.isSafeInteger(y.generate)||y.generate<0||y.generate>500))o("data:connection-shape","Mock generation count must be between 0 and 500",`${g}.mock.generate`);if(y.seed!==void 0&&!K(y.seed)&&(!Array.isArray(y.seed)||y.seed.length>500))o("data:connection-shape","Mock seed exceeds 500 rows or is invalid",`${g}.mock.seed`);else if(h&&Array.isArray(y.seed))y.seed.forEach((v,k)=>{if(K(v))return;let S=To(h,v,"seed").filter((x)=>{let T=x.split(":")[0]??"";return!Ht(v)||!Object.hasOwn(h.fields,T)||!K(v[T])});if(S.length)o("data:connection-shape",S[0]??"Invalid mock row",`${g}.mock.seed[${k}]`)})}}c(n,"spec")}function c(m,u){if(Array.isArray(m)){m.forEach((f,g)=>{c(f,`${u}[${g}]`)});return}if(!Ht(m))return;for(let[f,g]of Object.entries(m)){let h=`${u}.${f}`;if(/(password|secret|token|api[-_]?key|authorization)/i.test(f)&&typeof g==="string"&&g.length>=8)o("security:no-literal-secret","Credential-like string literals are not allowed in Specs",h);c(g,h)}}let d=(m=i)=>(u,f)=>{if(u.action!=="Request"||!N(u.params))return;let g=u.params,h=N(g.request)?g.request:void 0,b=g.connectionId,y=h?.connectionId;for(let[S,x]of[[b,"connectionId"],[y,"request.connectionId"]])if(typeof S==="string"&&!s.some((T)=>T.id===S))o("data:connection-ref","Request connection is not declared",`${f}.params.${x}`,m);if(typeof b==="string"&&typeof y==="string"&&b!==y&&(sm(g,s)||!s.some((S)=>S.id===b)))o("data:connection-ref","Request connection IDs do not match",`${f}.params.request.connectionId`,m);let v=sm(g,s);if(!v||!h)return;if(Object.hasOwn(h,"properties"))o("data:binding-shape","Logical connections do not accept request.properties",`${f}.params.request.properties`,m);let k=N(h.payload)?h.payload:void 0;if(k){let S=k.operation;if(S!==void 0&&!K(S)&&!Pr.includes(S))o("data:operation","Unknown data operation",`${f}.params.request.payload.operation`,m);if((S==="UpdateOne"||S==="DeleteOne")&&N(k.filter)&&!Object.hasOwn(k.filter,"id"))o("data:operation","Single-row writes require filter.id",`${f}.params.request.payload.filter`,m);let x=l(v);if(x)p(k,x,`${f}.params.request.payload`,m)}for(let S of["responsePath","loadingPath","errorPath"]){let x=g[S];if(typeof x==="string"&&!Object.hasOwn(e.state??{},x.split(".")[0]??""))o("data:state-paths","Request state path root is not declared on this page",`${f}.params.${S}`,m)}};function p(m,u,f,g){for(let h of["data","filter"]){if(!N(m[h]))continue;for(let b of Object.keys(m[h])){if(h==="filter"&&b==="id")continue;if(!Object.hasOwn(u.fields,b)||h==="data"&&u.fields[b]?.readOnly)o("data:payload-fields",h==="data"&&u.fields[b]?.readOnly?"Data field is read-only":"Data field is not declared in the entity",`${f}.${h}.${b}`,g)}}if(Array.isArray(m.order))m.order.forEach((h,b)=>{if(N(h)&&typeof h.field==="string"&&!Object.hasOwn(u.fields,h.field))o("data:payload-fields","Order field is not declared in the entity",`${f}.order[${b}].field`,g)})}for(let[m,u]of Object.entries(e.elements))lm(u.events,"events",d(m));return cm(e.lifecycle,"lifecycle",d()),r}function pm(e){if(!e.connections?.length)return;let t=new Set(["mock"]);for(let n of e.connections){if(!N(n.bindings))continue;for(let r of Object.keys(n.bindings))t.add(r)}try{return Object.fromEntries([...t].map((n)=>[n,Object.fromEntries(Object.entries(Td(e,{environment:n,channel:"development"})).map(([r,{state:i,missingOperations:o}])=>[r,{state:i,missingOperations:o}]))]))}catch{return}}function na(e,t){function n(o){if(Array.isArray(o))return o.map(n);if(!Ht(o))return o;return Object.fromEntries(Object.entries(o).map(([s,a])=>[s,n(a)]))}let r=n(e),i=(o)=>{if(o.action!=="Request"||!N(o.params)||!N(o.params.request))return;let{properties:s,...a}=o.params.request;o.params.request=a};for(let o of Object.values(r.blocks))lm(o.events,"events",i);for(let o of r.pages)cm(o.lifecycle,"lifecycle",i);return r}function mR(e){W(e);let t=new Map,n=new Map,r=new Map,i=(o,s)=>{if(o.id!==void 0){if(r.has(o.id)){let a=r.get(o.id);throw new ee("duplicate-block-id",`Block id "${o.id}" is declared more than once`,{blockId:o.id,firstPageId:a,pageId:s})}r.set(o.id,s)}for(let a of o.children??[])i(a,s);for(let a of Object.values(o.slots??{}))for(let l of a)i(l,s)};return e.pages.forEach((o,s)=>{let a=t.get(o.id);if(a!==void 0)throw new ee("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),n.has(o.path)){let l=n.get(o.path);throw new ee("duplicate-page-path",`Page path "${o.path}" is declared more than once`,{path:o.path,firstPageId:l,pageId:o.id})}n.set(o.path,o.id);for(let l of o.blocks)i(l,o.id)}),new Set(r.keys())}function gR(e,t,n){while(!0){let r=t.counter++,i=n?`${n}_${r}`:`${e}_${r}`;if(!t.reservedIds.has(i)&&!t.assignedIds.has(i))return i}}function ra(e,t,n,r,i,o){let s=e.id??gR(t,r,o??i);if(r.assignedIds.has(s))throw new ee("duplicate-block-id",`Block id "${s}" is declared more than once`,{blockId:s,pageId:t});r.assignedIds.add(s);let a=(e.children??[]).map((d)=>ra(d,t,n,r,s,s)),l={};for(let[d,p]of Object.entries(e.slots??{}))l[d]=p.map((m)=>ra(m,t,n,r,s,`${s}_${d}`));let c={id:s,pageId:t,type:e.type,...i?{parentId:i}:{},...e.props?{props:e.props}:{},...a.length?{children:a}:{},...Object.keys(l).length?{slots:l}:{},...e.events?{events:e.events}:{},...e.visible!==void 0?{visible:e.visible}:{},...e.template?{template:e.template}:{},...e.variant?{variant:e.variant}:{}};return n[s]=c,s}function um(e,t={}){e=qn(e,t);let r={counter:0,reservedIds:mR(e),assignedIds:new Set},i=Object.create(null);return{version:"2.0",pages:e.pages.map((s)=>{let a=[];for(let l of om(e,s))a.push(ra(l,s.id,i,r));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.data!==void 0?{data:e.data}:{},...e.design?{design:e.design}:{},...e.connections?{connections:e.connections.map((s)=>({...s}))}:{},blocks:i}}var mm=new Set(yd),fR=new Map(xi.map((e)=>[e.id,e])),fm=new Set(["array","boolean","integer","null","number","object","string"]),hm=new Set(["additionalProperties","default","description","enum","items","properties","required","type"]);function ia(e){if(!e)return[];return Object.keys(e)}function hR(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 oa(e,t,n){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let[r,i]of e.entries())oa(i,`${t}[${r}]`,n);return}for(let[r,i]of Object.entries(e)){let o=t?`${t}.${r}`:r;n(r,i,o),oa(i,o,n)}}function Ci(e,t,n,r,i,o,s,a){oa(r,i,(l,c,d)=>{if((l==="_state"||l==="_bindState")&&typeof c==="string"){let p=c.split("."),m=p[0]??"";if(m==="__computed"){let u=p[1]??"";if(!s.has(u))e.push({code:"refs:computed-declared",message:`${t}: _computed "${u}" is not declared`,elementKey:n,path:d});return}if(!o.has(m))e.push({code:"refs:state-declared",message:`${t}: _state "${m}" is not declared in state`,elementKey:n,path:d})}if(l==="_computed"&&typeof c==="string"&&!s.has(c))e.push({code:"refs:computed-declared",message:`${t}: _computed "${c}" is not declared`,elementKey:n,path:d});if(l==="_item"&&typeof c==="string"&&c!==""&&a&&!a.has(c))e.push({code:"item:field-exists",message:`${t}: _item "${c}" is not in the item schema`,elementKey:n,path:d})})}function re(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Kn(e){return re(e)&&Object.keys(e).some((t)=>t.startsWith("_"))}var gm=new Set(["_eq","_ne","_contains","_gt","_lt","_gte","_lte","_in","_not","_and","_or"]);function yR(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 r=t[1];if(!re(r))return!1;if(!(typeof r.by==="string"&&r.by.length>0||Array.isArray(r.by)&&r.by.length>0&&r.by.every((o)=>typeof o==="string"&&o.length>0)))return!1;if(r.order!==void 0&&r.order!=="asc"&&r.order!=="desc")return!1;if(r.rank!==void 0&&(!re(r.rank)||Object.values(r.rank).some((o)=>!Array.isArray(o))))return!1;return Object.keys(r).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 ym(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 St(e,t,n,r,i,o){if(n==="predicate"&&(!Kn(e)||!gm.has(Object.keys(e)[0]??"")))return r.push({code:"props:expression",message:`${i}: predicate must be a supported expression node`,elementKey:o,path:t}),!1;if(e===void 0)return r.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((m,u,f)=>St(u,`${t}[${f}]`,n,r,i,o)&&m,!0);if(!re(e)){if(typeof e==="number"&&!Number.isFinite(e)||e!==null&&!["string","number","boolean"].includes(typeof e))return r.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((m)=>m.startsWith("_"));if(s.length===0)return Object.entries(e).reduce((m,[u,f])=>St(f,`${t}.${u}`,n,r,i,o)&&m,!0);let a=s[0]??"",l=fR.get(a),c=`${t}.${a}`;if(s.length!==1||Object.keys(e).length!==1||!l)return r.push({code:"props:expression",message:`${i}: expression shape is not supported`,elementKey:o,path:c}),!1;if(l.generation?.disabled||!l.generation?.positions.includes(n)&&!(n==="props"&&l.generation?.positions.includes("binding"))&&!(n==="predicate-value"&&l.generation?.positions.some((m)=>["props","computed","predicate"].includes(m))))return r.push({code:"props:expression",message:`${i}: expression is not supported in this value position`,elementKey:o,path:c}),!1;let d=e[a];if(!yR(a,d))return r.push({code:"props:expression",message:`${i}: expression operand shape is not supported`,elementKey:o,path:c}),!1;let p=(m)=>Kn(m)||Array.isArray(m);if(["_filter","_find","_groupCount","_sort"].includes(a)&&!p(Array.isArray(d)?d[0]:void 0)||a==="_in"&&!p(Array.isArray(d)?d[1]:void 0))return r.push({code:"props:expression",message:`${i}: expression array operand has an unsupported literal shape`,elementKey:o,path:c}),!1;if(a==="_count"&&(Array.isArray(d)?!p(d[0]):!p(d))||a==="_array.length"&&!p(d))return r.push({code:"props:expression",message:`${i}: expression array operand has an unsupported literal shape`,elementKey:o,path:c}),!1;if(["_gt","_lt","_gte","_lte"].includes(a)&&Array.isArray(d)){if(d.some((u)=>!Kn(u)&&(typeof u!=="number"||!Number.isFinite(u))))return r.push({code:"props:expression",message:`${i}: numeric comparison literals must be finite numbers`,elementKey:o,path:c}),!1}if(Array.isArray(d))return d.reduce((m,u,f)=>{let g=n;if((["_filter","_find"].includes(a)||a==="_count")&&f===1)g="predicate";else if(n==="predicate"||n==="predicate-value"){if(g=gm.has(a)?"predicate-value":n,n==="predicate"&&["_and","_or"].includes(a))g="predicate"}return St(u,`${c}[${f}]`,g,r,i,o)&&m},!0);if(re(d))return St(d,c,n==="predicate"&&a==="_not"?"predicate-value":n,r,i,o);return!0}function sa(e,t,n,r,i,o,s){let a=(p)=>s==="props"?`props:${p}`:`actions:params-${p}`;if(Object.keys(t).filter((p)=>!hm.has(p)).length>0){r.push({code:"schema:unsupported",message:`${i}: schema contains unsupported constraints`,elementKey:o,path:n});return}if(t.type!==void 0&&!fm.has(t.type)){r.push({code:"schema:unsupported",message:`${i}: schema type is not supported`,elementKey:o,path:n});return}if(!ym(t)){r.push({code:"schema:unsupported",message:`${i}: schema enum is not supported`,elementKey:o,path:n});return}if(t.required!==void 0&&(!Array.isArray(t.required)||t.required.some((p)=>typeof p!=="string"))){r.push({code:"schema:unsupported",message:`${i}: schema required list is not supported`,elementKey:o,path:n});return}if(t.items!==void 0&&(t.type!=="array"||!re(t.items))){r.push({code:"schema:unsupported",message:`${i}: schema items must describe an array`,elementKey:o,path:n});return}if(t.properties!==void 0&&(t.type!=="object"||!re(t.properties))){r.push({code:"schema:unsupported",message:`${i}: schema properties must describe an object`,elementKey:o,path:n});return}if(t.required?.length&&t.type!=="object"){r.push({code:"schema:unsupported",message:`${i}: schema required list is only supported for objects`,elementKey:o,path:n});return}if(Kn(e))return;let c=t.type;if(!(c===void 0||c==="null"&&e===null||c==="string"&&typeof e==="string"||c==="boolean"&&typeof e==="boolean"||c==="number"&&typeof e==="number"&&Number.isFinite(e)||c==="integer"&&typeof e==="number"&&Number.isInteger(e)||c==="array"&&Array.isArray(e)||c==="object"&&re(e))){r.push({code:a("type"),message:`${i}: value does not match the declared type`,elementKey:o,path:n});return}if(t.enum&&!t.enum.some((p)=>Object.is(p,e)))r.push({code:a("enum"),message:`${i}: value is outside the declared enum`,elementKey:o,path:n});if(c==="object"&&re(e)){if(t.additionalProperties===!1){for(let p of Object.keys(e))if(!Object.hasOwn(t.properties??{},p))r.push({code:s==="props"?"props:unknown":"actions:params-unknown",message:`${i}: object field is not declared`,elementKey:o,path:`${n}.${p}`})}for(let p of t.required??[])if(!Object.hasOwn(e,p))r.push({code:a("required"),message:`${i}: required object field is missing`,elementKey:o,path:`${n}.${p}`});for(let[p,m]of Object.entries(t.properties??{}))if(Object.hasOwn(e,p))sa(e[p],m,`${n}.${p}`,r,i,o,s)}if(c==="array"&&Array.isArray(e)&&t.items)e.forEach((p,m)=>{sa(p,t.items,`${n}[${m}]`,r,i,o,s)})}function bm(e,t,n,r,i,o,s){if(!n)return;for(let[a,l]of Object.entries(n)){let c=`${r}.${a}`;if(aa(l,c,e,i,o)&&t&&Object.hasOwn(t,a))sa(t[a],l,c,e,i,o,s)}}function vm(e,t,n,r,i,o,s={}){for(let[a,l]of Object.entries(t??{})){let c=r==="action-value"&&!s.evaluatedParams?.has(a)?"action-literal":r;St(l,`${n}.${a}`,c,e,i,o)}}function aa(e,t,n,r,i){if(Object.keys(e).some((s)=>!hm.has(s))||e.type!==void 0&&!fm.has(e.type)||!ym(e)||e.required!==void 0&&(!Array.isArray(e.required)||e.required.some((s)=>typeof s!=="string"))||e.items!==void 0&&(e.type!=="array"||!re(e.items))||e.properties!==void 0&&(e.type!=="object"||!re(e.properties))||e.additionalProperties!==void 0&&(e.type!=="object"||typeof e.additionalProperties!=="boolean")||Boolean(e.required?.length)&&e.type!=="object")return n.push({code:"schema:unsupported",message:`${r}: schema contains unsupported constraints`,elementKey:i,path:t}),!1;for(let[s,a]of Object.entries(e.properties??{}))if(!aa(a,`${t}.${s}`,n,r,i))return!1;if(e.items&&!aa(e.items,`${t}[]`,n,r,i))return!1;return!0}function Ii(e,t,n,r,i,o,s){if(!Array.isArray(r)){if(s)e.push({code:"actions:chain",message:`${t}: action chain must be an array`,elementKey:n,path:i});return}for(let[a,l]of r.entries()){if(!re(l)){if(s)e.push({code:"actions:chain",message:`${t}: action step must be an object`,elementKey:n,path:`${i}[${a}]`});continue}let c=l.action,d=`${i}[${a}]`;if(s&&(typeof c!=="string"||c.length===0))e.push({code:"actions:chain",message:`${t}: action step needs an action name`,elementKey:n,path:`${d}.action`});if(typeof c==="string"&&!mm.has(c)&&!Object.hasOwn(o.actions??{},c))e.push({code:"actions:registered",message:`${t}: action "${c}" is not in the catalog. Registered actions: ${[...mm,...Object.keys(o.actions??{})].join(", ")}. No equivalent is guaranteed: preserve the requirement and report unsupported behavior instead of disabling it.`,elementKey:n,path:`${d}.action`});if(s&&typeof c==="string"){let p=Object.hasOwn(o.actions??{},c)?o.actions[c]:Object.hasOwn(xo,c)?xo[c]:void 0,m=l.params;if(m!==void 0&&!re(m))e.push({code:"actions:chain",message:`${t}: action params must be an object`,elementKey:n,path:`${d}.params`});else{if(re(m))vm(e,m,`${d}.params`,"action-value",t,n,{evaluatedParams:new Set(p?.generation?.evaluatedParams??[])});if(p)bm(e,re(m)?m:void 0,p.params,`${d}.params`,t,n,"actions:params")}}if(Object.hasOwn(l,"onSuccess"))Ii(e,t,n,l.onSuccess,`${d}.onSuccess`,o,s);if(Object.hasOwn(l,"onError"))Ii(e,t,n,l.onError,`${d}.onError`,o,s)}}function la(e,t,n=!1,r){let i=dm(e,r),o=new Set([...ia(e.state),...e.connectionIds??[]]),s=new Set(ia(e.computed)),a=e.pageId??e.root;if(e.computed)for(let[l,c]of Object.entries(e.computed)){if(n)St(c,`computed.${l}`,"computed",i,`${a}.computed`,a);Ci(i,`${a}.computed`,a,c,`computed.${l}`,o,s,bR(e,t,r))}if(e.urlState)for(let[l,c]of Object.entries(e.urlState)){if(!o.has(l))i.push({code:"refs:url-state-declared",message:`${a}: urlState "${l}" is not declared in state`,elementKey:a,path:`urlState.${l}`});if(!c||typeof c.param!=="string"||c.param.length===0)i.push({code:"refs:url-state-declared",message:`${a}: urlState "${l}" needs a param name`,elementKey:a,path:`urlState.${l}.param`})}for(let[l,c]of Object.entries(e.elements)){let d=Object.hasOwn(t.components,c.type)?t.components[c.type]:void 0;if(!d)continue;let p=`${a}/${l}`,m=km(d.props);if(n)vm(i,c.props,"props","props",p,l);if(c.visible!==null&&typeof c.visible==="object"){let u=Object.keys(c.visible);if(Array.isArray(c.visible)||u.length!==1||!u[0]?.startsWith("_"))i.push({code:"visibility:expression",message:`${p}: visible must be a boolean or an operator expression, not a literal record`,elementKey:l,path:"visible"})}if(n&&c.visible!==void 0)if(typeof c.visible!=="boolean"&&!Kn(c.visible))i.push({code:"visibility:expression",message:`${p}: visible must be a boolean or an operator expression`,elementKey:l,path:"visible"});else St(c.visible,"visible","visible",i,p,l);if(Ci(i,p,l,c.props,"props",o,s,m),Ci(i,p,l,c.visible,"visible",o,s,m),Ci(i,p,l,c.events,"events",o,s,m),d.props){let u=new Set(Object.keys(d.props));for(let f of Object.keys(c.props??{}))if(!u.has(f))i.push({code:"props:declared",message:`${p}: prop "${f}" is not declared on ${c.type}`,elementKey:l,path:`props.${f}`});if(n)bm(i,c.props,d.props,"props",p,l,"props")}if(d.events){let u=new Set(Object.keys(d.events));for(let[f,g]of Object.entries(c.events??{})){if(!u.has(f))i.push({code:"events:declared",message:`${p}: event "${f}" is not declared on ${c.type}`,elementKey:l,path:`events.${f}`});Ii(i,p,l,g,`events.${f}`,t,n)}}else for(let[u,f]of Object.entries(c.events??{}))Ii(i,p,l,f,`events.${u}`,t,n)}return i.map((l)=>({...l,path:l.elementKey===a?`${a}/${l.path}`:`${a}/${l.elementKey}/${l.path}`}))}function km(e){let t=new Set;for(let n of Object.values(e??{})){let r=hR(n);if(!r)continue;for(let i of r)t.add(i)}return t.size>0?t:void 0}function bR(e,t,n){let r=new Set;for(let i of Object.values(e.elements)){let o=Object.hasOwn(t.components,i.type)?t.components[i.type]:void 0,s=km(o?.props);if(!s)continue;for(let a of s)r.add(a)}for(let i of Object.values(n?.source.data?.entities??{}))for(let o of ia(i?.fields))r.add(o);for(let i of Object.values(e.state??{})){if(!Array.isArray(i))continue;for(let o of i)if(re(o))for(let s of Object.keys(o))r.add(s)}return r.size>0?r:void 0}function wm(e){return e.map((t)=>({code:t.code,message:t.message,elementKey:t.elementKey,path:t.path}))}var $e=new Set(["__proto__","prototype","constructor"]),kR=new Set([void 0,null,"",2,2,"2","2.0","v2","v2.0"]),j=(e)=>Boolean(e)&&typeof e==="object"&&!Array.isArray(e);function Sm(e,t){if(!e?.components||!Object.hasOwn(e.components,t))return;return e.components[t]}function wR(e,t){if(e.version==="2.0")return;if(kR.has(e.version))e.version="2.0",t.push({kind:"normalize-version",path:"version",message:'Normalized spec.version to "2.0".'})}function SR(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!i||typeof i.path!=="string")continue;if(n&&!n.has(i.id))continue;let o=i.path.trim();if(o===""&&r===0){if(i.path!=="/")i.path="/",t.push({kind:"normalize-page-path",path:`pages[${r}].path`,message:'Normalized entry page path to "/".'});continue}if(o.length>0&&!o.startsWith("/")&&!/^https?:\/\//i.test(o))i.path=`/${o}`,t.push({kind:"normalize-page-path",path:`pages[${r}].path`,message:`Added leading "/" to page path "${i.path}".`});else if(o!==i.path&&o.startsWith("/"))i.path=o,t.push({kind:"normalize-page-path",path:`pages[${r}].path`,message:`Trimmed whitespace on page path "${i.path}".`})}}function ca(e,t,n,r){let i=e;if((typeof i.type!=="string"||i.type.trim().length===0)&&typeof i.component==="string"&&i.component.trim().length>0){let a=i.component.trim();i.type=a,delete i.component,r.push({kind:"normalize-block-type",path:`${t}.type`,message:`Normalized block field "component" to "type" ("${a}").`})}let o=Sm(n,e.type),s=o?.props;if(j(e.props)){let a=e.props;for(let l of["children","slots","events","visible"]){if(!Object.hasOwn(a,l))continue;if(s&&Object.hasOwn(s,l))continue;let c=a[l];if(l==="children"){let d=Array.isArray(c)?c:j(c)?[c]:void 0;if(d)e.children=e.children?[...e.children,...d]:d,delete a.children,r.push({kind:"hoist-misplaced-block-field",path:`${t}.props.children`,message:`Hoisted misplaced children out of ${e.type}.props.`})}else if(l==="slots"&&j(c))e.slots={...c,...e.slots},delete a.slots,r.push({kind:"hoist-misplaced-block-field",path:`${t}.props.slots`,message:`Hoisted misplaced slots out of ${e.type}.props.`});else if(l==="events"&&j(c))e.events={...c,...e.events},delete a.events,r.push({kind:"hoist-misplaced-block-field",path:`${t}.props.events`,message:`Hoisted misplaced events out of ${e.type}.props.`});else if(l==="visible"&&(typeof c==="boolean"||j(c))){if(e.visible===void 0)e.visible=c;delete a.visible,r.push({kind:"hoist-misplaced-block-field",path:`${t}.props.visible`,message:`Hoisted misplaced visible condition out of ${e.type}.props.`})}}if(Object.keys(a).length===0)delete e.props}if(Array.isArray(e.events)&&o?.events){let a=Object.keys(o.events),l=a.length===1?a[0]:a.includes("onClick")?"onClick":void 0;if(l)e.events={[l]:e.events},r.push({kind:"normalize-action-step",path:`${t}.events`,message:`Wrapped array-form ${e.type}.events into "${l}".`})}if(e.children!==void 0&&!Array.isArray(e.children)){if(j(e.children))e.children=[e.children],r.push({kind:"normalize-slot-array",path:`${t}.children`,message:"Wrapped single child block object into an array."})}if(j(e.slots)){for(let[l,c]of Object.entries(e.slots)){if($e.has(l))continue;if(c!==void 0&&!Array.isArray(c)&&j(c))e.slots[l]=[c],r.push({kind:"normalize-slot-array",path:`${t}.slots.${l}`,message:`Wrapped single block in slot "${l}" into an array.`})}if(Array.isArray(e.slots.children)){let l=e.slots.children;e.children=e.children?[...e.children,...l]:l,delete e.slots.children,r.push({kind:"hoist-children-slot",path:`${t}.slots.children`,message:`Hoisted slots.children onto ${e.type}.children.`})}if(!Boolean(o?.slots&&Object.hasOwn(o.slots,"default"))&&Array.isArray(e.slots.default)){let l=e.slots.default;e.children=e.children?[...e.children,...l]:l,delete e.slots.default,r.push({kind:"hoist-children-slot",path:`${t}.slots.default`,message:`Hoisted undeclared slots.default onto ${e.type}.children.`})}if(Object.keys(e.slots).length===0)delete e.slots}for(let a=0;a<(e.children?.length??0);a++){let l=e.children?.[a];if(l)ca(l,`${t}.children[${a}]`,n,r)}for(let[a,l]of Object.entries(e.slots??{}))for(let c=0;c<l.length;c++){let d=l[c];if(d)ca(d,`${t}.slots.${a}[${c}]`,n,r)}}function xR(e,t){if(t.size===0)return;let n=(i)=>{if(!Array.isArray(i))return;for(let o of i){if(!j(o))continue;if(o.action==="CallMethod"&&j(o.params)){let s=o.params.blockId;if(typeof s==="string"&&t.has(s))o.params.blockId=t.get(s)}if(n(o.onSuccess),n(o.onError),o.action==="Request"&&j(o.params)&&j(o.params.request))n(o.params.request.onSuccess),n(o.params.request.onError)}};for(let i of[e.lifecycle?.onMount,e.lifecycle?.onUnmount])n(i);for(let i of e.lifecycle?.onStateChange??[])n(i.run);let r=(i)=>{for(let o of i){for(let s of Object.values(o.events??{}))n(s);if(o.children?.length)r(o.children);for(let s of Object.values(o.slots??{}))r(s)}};r(e.blocks)}function da(e,t){for(let n of e){if(!n)continue;if(typeof n.id==="string"&&n.id.length>0&&!$e.has(n.id))t.add(n.id);if(n.children?.length)da(n.children,t);for(let r of Object.values(n.slots??{}))da(r,t)}}function CR(e,t,n){let r=new Set;if(n){for(let i of e)if(i&&!n.has(i.id)&&Array.isArray(i.blocks))da(i.blocks,r)}for(let i=0;i<e.length;i++){let o=e[i];if(!o)continue;if(n&&!n.has(o.id))continue;let s=new Set,a=new Map,l=new Set,c=(m)=>{let u=`${o.id}-${m}`,f=u,g=2;while(r.has(f))f=`${u}-${g}`,g+=1;return f},d=(m,u)=>{for(let f=0;f<m.length;f++){let g=m[f];if(!g)continue;let h=`${u}[${f}]`;if(typeof g.id==="string"&&g.id.length>0&&!$e.has(g.id))if(r.has(g.id)){let b=g.id,y=c(b);if(g.id=y,r.add(y),t.push({kind:"deduplicate-block-id",path:`${h}.id`,message:`Renamed duplicate block id "${b}" to "${y}".`}),a.has(b))l.add(b);else a.set(b,y)}else r.add(g.id),s.add(g.id);if(g.children?.length)d(g.children,`${h}.children`);for(let[b,y]of Object.entries(g.slots??{}))d(y,`${h}.slots.${b}`)}};d(o.blocks,`pages[${i}].blocks`);let p=new Map;for(let[m,u]of a.entries())if(!s.has(m)&&!l.has(m))p.set(m,u);xR(o,p)}}function IR(e){if(e==="array")return{value:[],priority:2};if(e==="boolean")return{value:!1,priority:2};if(e==="number"||e==="integer")return{value:0,priority:2};if(e==="object")return{value:{},priority:2};return{value:"",priority:1}}function AR(e){if(typeof e==="boolean")return{value:!1,priority:2};if(typeof e==="number")return{value:0,priority:2};if(Array.isArray(e))return{value:[],priority:2};if(j(e))return{value:{},priority:2};return{value:"",priority:1}}function RR(e,t){let n=t.segments[0];if(!n||$e.has(n))return;if(t.segments.length===1){let s=e[n];if(!s||t.priority>s.priority)e[n]={value:structuredClone(t.value),priority:t.priority};return}let r=e[n];if(!r||!j(r.value))r={value:{},priority:Math.max(t.priority,2)},e[n]=r;let i=r.value;for(let s=1;s<t.segments.length-1;s++){let a=t.segments[s];if(!a||$e.has(a))return;if(!j(i[a]))i[a]={};i=i[a]}let o=t.segments[t.segments.length-1];if(o&&!$e.has(o)&&!Object.hasOwn(i,o))i[o]=structuredClone(t.value)}function se(e,t,n){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let r of e)se(r,void 0,n);return}for(let[r,i]of Object.entries(e)){if((r==="_state"||r==="_bindState")&&typeof i==="string"){let o=i.split(".").filter(Boolean),s=o[0];if(!s||s==="__computed"||$e.has(s))continue;let a=IR(o.length===1?t:void 0);n.push({segments:o,value:a.value,priority:a.priority});continue}if(r==="_len"||r==="_count"||r==="_filter"||r==="_find"){if(Array.isArray(i)){se(i[0],"array",n);for(let o=1;o<i.length;o++)se(i[o],void 0,n)}else se(i,"array",n);continue}if(r==="_number.add"){if(Array.isArray(i))for(let o of i)se(o,"number",n);else se(i,"number",n);continue}if(r==="_not"||r==="_and"||r==="_or"){se(i,"boolean",n);continue}if(r==="_if"&&Array.isArray(i)){se(i[0],"boolean",n),se(i[1],t,n),se(i[2],t,n);continue}se(i,void 0,n)}}function rt(e,t){if(!Array.isArray(e))return;for(let n of e){if(!j(n))continue;let r=n.action,i=j(n.params)?n.params:void 0;if(i){if(se(i,void 0,t),r==="SetState"&&typeof i.path==="string"&&i.path.length>0){let o=i.path.split(".").filter(Boolean),s=AR(i.value);t.push({segments:o,value:s.value,priority:s.priority})}else if(r==="ResetState"){let o=j(i.initial)?i.initial:void 0;if(Array.isArray(i.paths))for(let s of i.paths){if(typeof s!=="string"||!s)continue;let l=s.split(".").filter(Boolean)[0];if(!l)continue;let c=o&&Object.hasOwn(o,l)?o[l]:null;t.push({segments:[l],value:c,priority:3})}if(o)for(let[s,a]of Object.entries(o))t.push({segments:[s],value:a,priority:3})}else if(r==="Request"){if(typeof i.loadingPath==="string"&&i.loadingPath.length>0)t.push({segments:i.loadingPath.split(".").filter(Boolean),value:!1,priority:3});if(typeof i.errorPath==="string"&&i.errorPath.length>0)t.push({segments:i.errorPath.split(".").filter(Boolean),value:null,priority:3});if(typeof i.responsePath==="string"&&i.responsePath.length>0){let o=j(i.request)?i.request:void 0,a=(o&&j(o.payload)?o.payload:void 0)?.operation,l=a==="Find"?[]:a==="FindPage"?{items:[],nextCursor:null,total:0}:null;t.push({segments:i.responsePath.split(".").filter(Boolean),value:l,priority:a?3:2})}if(j(i.request))rt(i.request.onSuccess,t),rt(i.request.onError,t)}else if(r==="Validate"&&typeof i.errorPath==="string"&&i.errorPath.length>0)t.push({segments:i.errorPath.split(".").filter(Boolean),value:null,priority:3})}rt(n.onSuccess,t),rt(n.onError,t)}}function PR(e,t,n,r){let i=new Set((e.connections??[]).map((o)=>o.id));for(let o=0;o<e.pages.length;o++){let s=e.pages[o];if(!s)continue;if(r&&!r.has(s.id))continue;let a=[];for(let[m,u]of Object.entries(s.urlState??{})){if($e.has(m))continue;a.push({segments:[m],value:u.default!==void 0?u.default:"",priority:3})}for(let m of Object.values(s.computed??{}))se(m,void 0,a);rt(s.lifecycle?.onMount,a),rt(s.lifecycle?.onUnmount,a);for(let m of s.lifecycle?.onStateChange??[])rt(m.run,a);let l=(m)=>{for(let u of m){let f=Sm(t,u.type);for(let[g,h]of Object.entries(u.props??{})){let b=f?.props&&Object.hasOwn(f.props,g)?f.props[g]:void 0;se(h,b?.type,a)}se(u.visible,"boolean",a);for(let g of Object.values(u.events??{}))rt(g,a);if(u.children?.length)l(u.children);for(let g of Object.values(u.slots??{}))l(g)}};l(s.blocks);let c=Object.create(null);for(let m of a){let u=m.segments[0];if(!u||i.has(u)||u==="__computed"||$e.has(u))continue;RR(c,m)}let d=s.state??{},p=s.state?{...s.state}:void 0;for(let[m,u]of Object.entries(c)){if(Object.hasOwn(d,m))continue;p??={},Object.defineProperty(p,m,{value:structuredClone(u.value),enumerable:!0,writable:!0,configurable:!0}),n.push({kind:"declare-page-state",path:`pages[${o}].state.${m}`,message:`Auto-declared missing page.state root "${m}" on page "${s.id}".`})}if(p)s.state=p}}function it(e,t,n){if(!Array.isArray(e))return;for(let r=0;r<e.length;r++){let i=e[r];if(!j(i))continue;let o=`${t}[${r}]`;if(!(typeof i.action==="string"&&i.action.trim().length>0)&&typeof i.type==="string"&&i.type.trim().length>0){let a=i.type.trim();i.action=a,delete i.type,n.push({kind:"normalize-action-step",path:`${o}.action`,message:`Normalized action step field "type" to "action" ("${a}").`})}if(it(i.onSuccess,`${o}.onSuccess`,n),it(i.onError,`${o}.onError`,n),j(i.params)&&j(i.params.request))it(i.params.request.onSuccess,`${o}.params.request.onSuccess`,n),it(i.params.request.onError,`${o}.params.request.onError`,n)}}function TR(e,t,n){let r=(i,o)=>{for(let s=0;s<i.length;s++){let a=i[s];if(!a)continue;let l=`${o}[${s}]`;if(j(a.events))for(let[c,d]of Object.entries(a.events))it(d,`${l}.events.${c}`,t);if(Array.isArray(a.children))r(a.children,`${l}.children`);if(j(a.slots)){for(let[c,d]of Object.entries(a.slots))if(Array.isArray(d))r(d,`${l}.slots.${c}`)}}};for(let i=0;i<e.length;i++){let o=e[i];if(!o)continue;if(n&&!n.has(o.id))continue;it(o.lifecycle?.onMount,`pages[${i}].lifecycle.onMount`,t),it(o.lifecycle?.onUnmount,`pages[${i}].lifecycle.onUnmount`,t);let s=o.lifecycle?.onStateChange??[];for(let a=0;a<s.length;a++)it(s[a]?.run,`pages[${i}].lifecycle.onStateChange[${a}].run`,t);if(Array.isArray(o.blocks))r(o.blocks,`pages[${i}].blocks`)}}function zt(e,t={}){He(e);let n=structuredClone(e),r=[],i=t.onlyPageIds!==void 0?new Set(t.onlyPageIds):void 0;if(wR(n,r),Array.isArray(n.pages)){SR(n.pages,r,i);for(let o=0;o<n.pages.length;o++){let s=n.pages[o];if(!s||!Array.isArray(s.blocks))continue;if(i&&!i.has(s.id))continue;for(let a=0;a<s.blocks.length;a++){let l=s.blocks[a];if(l)ca(l,`pages[${o}].blocks[${a}]`,t.catalog,r)}}TR(n.pages,r,i),CR(n.pages,r,i),PR(n,t.catalog,r,i)}return{spec:n,fixesApplied:r}}var Ce=(e)=>Boolean(e)&&typeof e==="object"&&!Array.isArray(e),xm=(e)=>Ce(e)&&Object.keys(e).some((t)=>t.startsWith("_"));function Ri(e){let t=e.trim();return t.length===0||t.startsWith("#")||t.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)}function Ai(e){let t=e.split("#")[0]??e,r=(t.split("?")[0]??t).trim(),i=r.startsWith("/")?r:`/${r}`;if(i.length>1&&i.endsWith("/"))return i.slice(0,-1);return i}function ER(e){return e.startsWith(":")||e.startsWith("$")||e.startsWith("[")&&e.endsWith("]")}function pa(e,t){let n=t.find((i)=>Ai(i.path)===e);if(n)return n;let r=e.split("/").filter(Boolean);for(let i of t){let o=Ai(i.path).split("/").filter(Boolean);if(o.length!==r.length)continue;if(o.every((a,l)=>a===r[l]||ER(a)))return i}return}function Cm(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;if("visible"in i&&i.visible===!1)continue;let o=`${t}[${r}]`;if("children"in i&&Array.isArray(i.children)){Cm(i.children,`${o}.children`,n);continue}if("path"in i&&typeof i.path==="string"&&!Ri(i.path))n.push({target:i.path,path:`${o}.path`})}}function xt(e,t,n,r,i){if(!Array.isArray(e))return;for(let o=0;o<e.length;o++){let s=e[o];if(!Ce(s))continue;let a=`${t}[${o}]`;if(s.action==="Link"&&Ce(s.params))for(let l of["path","url"]){let c=s.params[l];if(c===void 0)continue;if(xm(c))i.push({sourcePageId:n,path:`${a}.params.${l}`});else if(typeof c==="string"&&!Ri(c))r.push({target:c,path:`${a}.params.${l}`})}if(xt(s.onSuccess,`${a}.onSuccess`,n,r,i),xt(s.onError,`${a}.onError`,n,r,i),s.action==="Request"&&Ce(s.params)&&Ce(s.params.request))xt(s.params.request.onSuccess,`${a}.params.request.onSuccess`,n,r,i),xt(s.params.request.onError,`${a}.params.request.onError`,n,r,i)}}function ua(e,t,n,r,i){if(e===void 0)return;if(xm(e))i.push({sourcePageId:n,path:t});else if(typeof e==="string"&&!Ri(e))r.push({target:e,path:t})}function Kt(e,t,n,r,i,o=0){if(!Array.isArray(e)||o>8)return;for(let s=0;s<e.length;s++){let a=e[s];if(!Ce(a)||a.visible===!1)continue;let l=`${t}[${s}]`;if(ua(a.href,`${l}.href`,n,r,i),Array.isArray(a.items))Kt(a.items,`${l}.items`,n,r,i,o+1);if(Array.isArray(a.children))Kt(a.children,`${l}.children`,n,r,i,o+1)}}function OR(e,t,n,r){let i=[];if(t.auth?.redirect&&!Ri(t.auth.redirect))i.push({target:t.auth.redirect,path:`pages[${n}].auth.redirect`});for(let[a,l]of[["onMount",t.lifecycle?.onMount],["onUnmount",t.lifecycle?.onUnmount]])xt(l,`pages[${n}].lifecycle.${a}`,t.id,i,r);for(let a=0;a<(t.lifecycle?.onStateChange?.length??0);a++){let l=t.lifecycle?.onStateChange?.[a];if(l)xt(l.run,`pages[${n}].lifecycle.onStateChange[${a}].run`,t.id,i,r)}if(t.blocks.some((a)=>a.type==="PageLayout"||Boolean(a.template))&&e.menus?.items?.length)Cm(e.menus.items,"menus.items",i);let s=(a,l)=>{for(let c=0;c<a.length;c++){let d=a[c];if(!d||d.visible===!1)continue;let p=`${l}[${c}]`;if(d.type==="PageLayout"&&Ce(d.props))for(let m of["routes","headerLinks"])Kt(d.props[m],`${p}.props.${m}`,t.id,i,r);if(d.type==="AppNavigation"&&Ce(d.props)){ua(d.props.profileHref,`${p}.props.profileHref`,t.id,i,r);for(let m of["items","groups"])Kt(d.props[m],`${p}.props.${m}`,t.id,i,r)}if(d.type==="DrilldownNavigation"&&Ce(d.props))for(let m of["items","sections"])Kt(d.props[m],`${p}.props.${m}`,t.id,i,r);if(d.type==="Breadcrumb"&&Ce(d.props))Kt(d.props.items,`${p}.props.items`,t.id,i,r);if((d.type==="Link"||d.type==="MenuLink")&&Ce(d.props))for(let m of["href","to","path"])ua(d.props[m],`${p}.props.${m}`,t.id,i,r);for(let[m,u]of Object.entries(d.events??{}))xt(u,`${p}.events.${m}`,t.id,i,r);if(d.children?.length)s(d.children,`${p}.children`);for(let[m,u]of Object.entries(d.slots??{}))s(u,`${p}.slots.${m}`)}};return s(t.blocks,`pages[${n}].blocks`),i}function ma(e,t={}){let n=e.pages??[];if(n.length===0)return{ok:!0,reachablePageIds:[],orphanPageIds:[],brokenLinks:[],dynamicLinks:[]};let r=[];if(t.entryPaths?.length)for(let f of t.entryPaths){let g=pa(Ai(f),n);if(g&&!r.some((h)=>h.id===g.id))r.push(g)}else{let f=pa("/",n)??n[0];if(f)r.push(f)}let i=new Set(r.map((f)=>f.id)),o=[...r],s=[],a=[],l=new Set,c=new Set,d=new Map;for(let f=0;f<n.length;f++){let g=n[f];if(!g)continue;let h=[],b=OR(e,g,f,h);for(let v of h){let k=`${v.sourcePageId}|${v.path}`;if(!c.has(k))c.add(k),a.push(v)}let y=[];for(let v of b){let k=Ai(v.target),S=pa(k,n);if(S){if(!y.includes(S.id))y.push(S.id)}else{let x=`${g.id}|${k}|${v.path}`;if(!l.has(x))l.add(x),s.push({sourcePageId:g.id,targetPath:k,path:v.path,reason:"missing-target-page"})}}d.set(g.id,y)}while(o.length>0){let f=o.shift();if(!f)continue;for(let g of d.get(f.id)??[]){if(i.has(g))continue;i.add(g);let h=n.find((b)=>b.id===g);if(h)o.push(h)}}let p=n.filter((f)=>i.has(f.id)).map((f)=>f.id),m=n.filter((f)=>!i.has(f.id)).map((f)=>f.id),u=r[0]?.id;return{ok:m.length===0&&s.length===0,...u!==void 0?{entryPageId:u}:{},reachablePageIds:p,orphanPageIds:m,brokenLinks:s,dynamicLinks:a}}function Pi(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 ga(e){return{...e,...e.props?{props:{...e.props}}:{},...e.children?{children:[...e.children]}:{},...e.slots?{slots:{...e.slots}}:{},...e.events?{events:{...e.events}}:{}}}function Im(e){return{...e,...e.roots?{roots:[...e.roots]}:{},...e.state?{state:{...e.state}}:{},elements:Object.fromEntries(Object.entries(e.elements).map(([t,n])=>[t,ga(n)]))}}function NR(e){return e.type==="compiler:operator"}function _R(e){return e.type==="compiler:validator"}class Gn{operators;validators;constructor(e={}){let t=(e.capabilities??[]).filter(NR).map((r)=>r.contribution),n=(e.capabilities??[]).filter(_R).map((r)=>r.contribution);this.operators=[...e.operators??[],...t],this.validators=[...e.validators??[],...n]}merge(e){if(e instanceof Gn)return new Gn({operators:[...this.operators,...e.operators],validators:[...this.validators,...e.validators]});return new Gn({operators:[...this.operators,...e.operators??[]],validators:[...this.validators,...e.validators??[]],...e.capabilities?{capabilities:e.capabilities}:{}})}}function BR(e={}){return new Gn(e)}function Ti(e,t={}){let n=t.format??"auto",r=t.maxAliasCount!==void 0?{maxAliasCount:t.maxAliasCount}:void 0;if(n==="json")return Pi(JSON.parse(e));if(n==="yaml")return Pi(tt(e,r));let i=e.trim();if(i.startsWith("{")||i.startsWith("["))return Pi(JSON.parse(i));return Pi(tt(e,r))}function Rm(e){return ta(e,{aliasDuplicateObjects:!1})}function DR(e,t,n){let r=e.pages.find((s)=>s.id===t),i=[...r?.rootBlockIds??[]],o=Object.fromEntries(Object.entries(e.blocks).filter(([,s])=>s.pageId===t).map(([s,a])=>{let{id:l,pageId:c,parentId:d,...p}=a;return[s,ga(p)]}));if(n&&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,...r?.state?{state:r.state}:{},...r?.computed?{computed:r.computed}:{},...r?.lifecycle?{lifecycle:r.lifecycle}:{},...r?.urlState?{urlState:r.urlState}:{},...e.connections?{connectionIds:e.connections.map((s)=>s.id)}:{},elements:o}}function LR(e,t){let n=[...t.roots??e.roots??[]];if(n.length>0&&t.root!==e.root)n[0]=t.root;else if(n.length===0&&t.elements[t.root])n.push(t.root);return n}async function MR(e,t,n,r){let i=Im(e);for(let o of n.operators){let s={spec:i,catalog:t,warnings:r,getElement(l){return i.elements[l]},updateElement(l,c){i={...i,elements:{...i.elements,[l]:ga(c)}}},addWarning(l){r.push(l)}},a=await o.apply(s);if(a)i=Im(a)}return i}function Am(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Pm(e,t,n,r){if(r)for(let i of e)n.push({missingType:i.code,elementKey:i.elementKey,reason:"invalid-spec",context:i.message,code:i.code,path:i.path});else t.push(...wm(e))}function $R(e,t,n,r,i,o){let s=Object.entries(e.elements);for(let l of e.roots?.length?e.roots:[e.root])if(!e.elements[l])n.push({code:"missing-root",message:`Root element "${l}" is missing from the elements map`,elementKey:l});for(let[l,c]of s){if(!(Am(t.components,c.type)??Am(t.templates,c.type)))r.push({missingType:c.type,elementKey:l,reason:c.template?"missing-template":"missing-component",context:`Element ${l} references ${c.type}`,path:`blocks.${l}.type`});for(let p of c.children??[])if(!e.elements[p])n.push({code:"dangling-child",message:`Element "${l}" references missing child "${p}"`,elementKey:l})}let a=la(e,t,i,o);Pm(a,n,r,i)}async function FR(e,t,n,r,i){for(let o of n.validators){let s={spec:e,catalog:t,warnings:r,gaps:i,addWarning(a){r.push(a)},addGap(a){i.push(a)}};await o.validate(s)}}function Gt(e,t){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let n of e)Gt(n,t);return}for(let[n,r]of Object.entries(e)){if(n.startsWith("_"))t.add(n);Gt(r,t)}}function UR(e){let t=new Map;for(let[r,i]of Object.entries(e.blocks)){let o=new Set;Gt(i.props,o),Gt(i.visible,o);for(let s of o){let a=t.get(s)??new Set;a.add(r),t.set(s,a)}}for(let r of e.pages){let i=new Set;Gt(r.computed,i),Gt(r.lifecycle,i);for(let o of i){let s=t.get(o)??new Set;s.add(r.id),t.set(o,s)}}let n=[];for(let[r,i]of t){let o=Vn.has(r)?"client":r==="_ref"?"build":"shared";n.push({operatorId:r,bucket:o,blockIds:[...i]})}return n}async function fa(e,t,n={}){let r=[],i=[],o=n.registry??BR(),s=um(e,n.templates),a=Object.create(null),l=[];if(s.pages.length===0&&zn(e))Pm(la({root:"spec",elements:{}},t,n.strict===!0,{source:e,global:!0}),r,i,n.strict===!0);for(let[u,f]of s.pages.entries()){let g=DR(s,f.id,u===0),h=await MR(g,t,o,r);$R(h,t,r,i,n.strict===!0,{source:e,global:u===0}),await FR(h,t,o,r,i);for(let[b,y]of Object.entries(h.elements)){let v=a[b];if(v)throw new ee("duplicate-block-id",`Compiler output block id "${b}" conflicts across pages`,{blockId:b,firstPageId:v.pageId,pageId:f.id});let k=s.blocks[b];a[b]={...y,id:b,pageId:f.id,...k?.pageId===f.id&&k.parentId?{parentId:k.parentId}:{}}}l.push({...f,rootBlockIds:LR(g,h)})}let c={version:"2.0",pages:l,...s.data!==void 0?{data:s.data}:{},...s.design?{design:s.design}:{},...s.connections?{connections:s.connections.map((u)=>({...u}))}:{},blocks:a},d=pm(e);if(d)c.dataReadiness=d;let p=zn(e)?na(c,e.connections??[]):c;if(n.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 m=UR(p);return{spec:p,gaps:i,warnings:r,...m.length>0?{operatorUsage:m}:{}}}import{readFileSync as YR}from"node:fs";var Tm=["auto","user","override"];function Ei(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function jR(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Wt(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 Oi(e){let{meta:t}=Wt(e);if(!t)throw Error("design-md file is missing YAML frontmatter");let n=tt(t);if(!n||typeof n!=="object")throw Error("design-md frontmatter must be a YAML object");let r=typeof n.title==="string"?n.title.trim():"",i=typeof n.name==="string"?n.name.trim():"",o=r||i;if(!o)throw Error("design-md frontmatter must include a non-empty 'title' or 'name' field");let s=Ei(n.id)??Ei(n.slug)??jR(o);if(!s)throw Error("design-md frontmatter must include a non-empty 'id' field");let a={id:s,title:o,category:Ei(n.category)??"general",tags:Array.isArray(n.tags)?n.tags:[],origin:typeof n.origin==="string"?n.origin:"local"};if(i)a.name=i;if(typeof n.version==="string"&&n.version.trim())a.version=n.version.trim();let l=Ei(n.description);if(l)a.description=l;if(typeof n.sourceUrl==="string")a.sourceUrl=n.sourceUrl;if(Array.isArray(n.exemptRules)){let c=n.exemptRules.filter((d)=>typeof d==="string"&&d.trim().length>0);if(c.length>0)a.exemptRules=c.map((d)=>d.trim())}if(Array.isArray(n.extractedTokens))a.extractedTokens=n.extractedTokens;if(typeof n.layer==="string")if(Tm.includes(n.layer))a.layer=n.layer;else console.warn(`[design-md] ignoring invalid layer "${n.layer}" on id="${a.id}"; expected one of ${Tm.join("|")}`);return a}var qR=["colors","typography","rounded","spacing","components"],VR=["themes","forbidden"],Om=new Set([...qR,...VR]),HR=new Set(["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","fontFeature","fontVariation"]);function ot(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function Ni(e){return Object.fromEntries(Object.entries(ot(e)).flatMap(([t,n])=>typeof n==="string"||typeof n==="number"?[[t,String(n)]]:[]))}function Em(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function zR(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function KR(e){let{meta:t,body:n}=Wt(e),r=[],i=[];for(let[o,s]of[t,...zR(n)].entries()){if(!s.trim())continue;let a;try{a=ot(tt(s))}catch(l){if(o===0)r.push({severity:"error",message:`frontmatter is not valid YAML: ${l.message}`});continue}if(o===0||Object.keys(a).some((l)=>Om.has(l)))i.push(a)}return{sources:i,issues:r}}function GR(e){let t={};for(let[n,r]of Object.entries(ot(e)))if(typeof r==="string")t[n]={fontFamily:r};else{let i={};for(let[o,s]of Object.entries(ot(r)))if(HR.has(o)&&(typeof s==="string"||typeof s==="number"))i[o]=s;t[n]=i}return t}function ha(e){let{sources:t}=KR(e),n=Object.assign({},...t);if(!Object.keys(n).some((l)=>Om.has(l)))return;let r={colors:Ni(n.colors),typography:GR(n.typography),rounded:Ni(n.rounded),spacing:Object.fromEntries(Object.entries(ot(n.spacing)).flatMap(([l,c])=>typeof c==="string"||typeof c==="number"?[[l,c]]:[])),components:Object.fromEntries(Object.entries(ot(n.components)).map(([l,c])=>[l,Ni(c)]))},i=Object.fromEntries(Object.entries(ot(n.themes)).map(([l,c])=>[l,Ni(c)]));if(Object.keys(i).length)r.themes=i;let o=ot(n.forbidden),s=Em(o.colors),a=Em(o.fonts);if(s.length||a.length)r.forbidden={colors:s,fonts:a};return r}var WR=[{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 ya(e){let t=new Set,n=[];for(let{pattern:r,group:i}of WR){let o=new RegExp(r.source,r.flags),s;while((s=o.exec(e))!==null){let a=(s[1]??"").trim(),l=(s[2]??"").trim(),c=`${a}:${l}`;if(!t.has(c))t.add(c),n.push({name:a,value:l,group:i})}}return n}function Wn(e){let t=YR(e,"utf-8"),{body:n}=Wt(t),r=Oi(t),i=ha(t),o=r.extractedTokens??(i&&Object.keys(i.colors).length?Object.entries(i.colors).map(([a,l])=>({name:a,value:l,group:"color"})):ya(n)),s={id:r.id,title:r.title,category:r.category,tags:r.tags??[],origin:r.origin??"local",body:n,filePath:e};if(r.sourceUrl)s.sourceUrl=r.sourceUrl;if(r.description)s.description=r.description;if(i)s.tokens=i;if(r.exemptRules)s.exemptRules=r.exemptRules;if(r.layer)s.layer=r.layer;if(o.length>0)s.extractedTokens=o;return s}import{fileURLToPath as JR}from"node:url";import{existsSync as QR,readdirSync as XR}from"node:fs";import{join as ZR}from"node:path";var Nm=JR(new URL("../content",import.meta.url));function _i(e=Nm){if(!QR(e))return[];let t=[];for(let n of XR(e).sort()){if(n.startsWith("_")||!n.endsWith(".design.md"))continue;try{t.push(Wn(ZR(e,n)))}catch(r){console.warn(`[design-md] skipping seed ${n}: ${r.message}`)}}return t}import{readdirSync as rP,readFileSync as iP,statSync as oP}from"node:fs";import{basename as sP,join as aP}from"node:path";var lP="0.1.0";function _m(e){let{dir:t}=e,n;try{n=rP(t)}catch{return[]}let r=e.defaultVersion??lP,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of n){if(!/\.ya?ml$/i.test(a))continue;let l=aP(t,a);try{if(!oP(l).isFile())continue}catch{continue}let c=iP(l,"utf8");if(!c.trim())continue;let d=sP(a).replace(/\.ya?ml$/i,""),p=cP(d),m=dP(d),u=pP(c)??`${m} template`;s.push({name:p,version:r,title:m,description:u,yaml:c,absolutePath:l,templateContract:{name:p,description:u,level:i,category:o,keywords:[p,d.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:uP(c)}})}return s.sort((a,l)=>a.name.localeCompare(l.name))}function ba(e){let t=new Map;for(let n of e)for(let r of _m(n)){let i=t.get(r.name);if(i)throw Error(`duplicate template source name "${r.name}": ${i.absolutePath} and ${r.absolutePath}`);t.set(r.name,r)}return[...t.values()].sort((n,r)=>n.name.localeCompare(r.name))}function cP(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function dP(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function pP(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 uP(e){let t=new Set;for(let n of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let r=n[1]?.trim();if(r)t.add(r)}for(let n of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let r=n[1]?.trim();if(r)t.add(r)}return[...t].sort()}var gM=new Set(Ar),fM=new Set(Ir);var gP=/^(unknown|unlicensed|none|n\/?a)$/i;function va(e){let t=e?.trim();if(!t||gP.test(t))return;return t}var fP="uibot.resource.index.v1";class Jt extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function le(e,t){return e<t?-1:e>t?1:0}function J(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 hP(e){let t=J(e).replace(/ /g,"-");if(!t)throw new Jt("invalid-resource-source-id",e);return t}function Fe(e,t){return`${e}:${hP(t)}`}function Bi(e){let t=new Map;for(let n of e){let r=n?.trim();if(!r)continue;let i=J(r);if(!i||t.has(i))continue;t.set(i,r)}return[...t.entries()].sort(([n],[r])=>le(n,r)).map(([,n])=>n)}function Yn(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 yP(e){let t=va(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 Yt(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:Bi(e.tags),aliases:Bi(e.aliases),capabilities:Bi(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(le),source:yP(e.source),receipt:e.receipt,...e.solution?{solution:structuredClone(e.solution)}:{}}}function bP(e){return(e.body.split(/\r?\n/).map((n)=>n.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function vP(e){if(e.solution){let t=(n)=>{if(n&&typeof n==="object"){for(let r of Object.values(n))t(r);Object.freeze(n)}};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 kP(e){let t=new Map;for(let n of Object.keys(e).sort(le)){let r=e[n];if(!r)continue;let i=Fe("component",n);for(let o of Bi([n,r.name])){let s=J(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(le))}}return t}function wP(e,t,n){let r=n.get(J(e))??[];if(r.length===0)throw new Jt("dangling-resource-dependency",`${t} -> ${Fe("component",e)}`);if(r.length>1)throw new Jt("ambiguous-resource-dependency",`${t} -> ${e}: ${r.join(",")}`);return r[0]}function SP(e,t,n,r){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(r,i))return Fe("template",i);return wP(e,t,n)}function Jn(e,t,n){return va(n?.[e]??t)}function Bm(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[n])=>le(t,n)).map(([t,n])=>({id:`${t}-example`,title:`${n.name} Example`,description:n.description,category:n.category,tags:n.keywords,aliases:[`${t} example`,`${n.name} example`],capabilities:["example:template"],dependencies:[Fe("template",t)]}))}function Dm(e){let t=e.components??{},n=e.templates??{},r=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=kP(t),l=[];for(let u of Object.keys(t).sort(le)){let f=t[u];if(!f)continue;let g=Fe("component",u),h=Jn(g,void 0,s);l.push(Yt({id:g,kind:"component",title:f.name,description:f.description,category:f.category,tags:f.tags??[],aliases:[u,f.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:u,...h?{license:h}:{}},receipt:Yn(Boolean(h))}))}for(let u of Object.keys(n).sort(le)){let f=n[u];if(!f)continue;let g=Fe("template",u),h=Jn(g,void 0,s);l.push(Yt({id:g,kind:"template",title:f.name,description:f.description,category:f.category,tags:f.keywords,aliases:[u,f.name],capabilities:[],dependencies:(f.composedFrom??[]).map((b)=>SP(b,g,a,n)),source:{type:"template-contract",id:u,...h?{license:h}:{}},receipt:Yn(Boolean(h))}))}for(let u of[...r].sort((f,g)=>le(f.id,g.id))){let f=Fe("design-guide",u.id),g=Jn(f,void 0,s);l.push(Yt({id:f,kind:"design-guide",title:u.title,description:bP(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}:{},...g?{license:g}:{}},receipt:Yn(Boolean(g))}))}for(let u of[...i].sort((f,g)=>le(f.id,g.id))){let f=Fe("example",u.id),g=Jn(f,u.license,s);l.push(Yt({id:f,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}:{},...g?{license:g}:{}},receipt:Yn(Boolean(g))}))}for(let u of[...o].sort((f,g)=>le(f.id,g.id))){let f=Fe("skill",u.id),g=Jn(f,void 0,s);l.push(Yt({id:f,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}:{},...g?{license:g}:{}},receipt:Yn(Boolean(g))}))}for(let u of e.additional??[])l.push(Yt(u));l.sort((u,f)=>le(u.id,f.id));let c=new Set;for(let u of l){if(c.has(u.id))throw new Jt("duplicate-resource-id",u.id);c.add(u.id)}for(let u of l)for(let f of u.dependencies)if(!c.has(f))throw new Jt("dangling-resource-dependency",`${u.id} -> ${f}`);let d=new Map;for(let u of l)for(let f of u.aliases){let g=J(f);if(!g)continue;let h=d.get(g)??new Set;h.add(u.id),d.set(g,h)}let p=Object.freeze(Object.fromEntries([...d.entries()].sort(([u],[f])=>le(u,f)).map(([u,f])=>[u,Object.freeze([...f].sort(le))]))),m=Object.freeze(l.map(vP));return Object.freeze({schemaVersion:fP,resources:m,aliases:p})}var xP=[["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","导航","侧边栏"]],CP=Object.freeze(xP.map((e)=>Object.freeze([...e]))),Lm=new Map;for(let e of CP){let t=Object.freeze([...new Set(e.map(J).filter(Boolean))].sort());for(let n of t)Lm.set(n,t)}function ka(e){let t=J(e);return Lm.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 xa=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}),IP=Object.freeze(Object.keys(xa)),Mm=new Map(IP.map((e,t)=>[e,t])),$m=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function ce(e,t){return e<t?-1:e>t?1:0}function Fm(e){return new Set((e??[]).map(J).filter(Boolean))}function Ct(e,t){let n=Fm(t);if(n.size===0)return!0;let r=Fm(e);return[...n].some((i)=>r.has(i))}function AP(e,t){if(!Ct(e.solution?.functions??[],t.functions))return!1;if(!Ct(e.solution?.scenarios??[],t.scenarios))return!1;if(!Ct(e.solution?[e.solution.unit]:[],t.units))return!1;if(!Ct(e.solution?.industries??[],t.industries))return!1;if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!Ct(e.tags,t.tags))return!1;if(!Ct(e.category?[e.category]:[],t.categories))return!1;if(!Ct(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function RP(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 _e(e,t,n,r=xa[t]){if(e.some((i)=>i.code===t&&i.value===n))return;e.push({code:t,value:n,score:r})}function wa(e,t){return e.find((n)=>J(n)===t)}function Sa(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 PP(e,t,n){if(Math.abs(e.length-t.length)>n)return n+1;let r=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 l=(r[a-1]??n+1)+(e[i-1]===t[a-1]?0:1),c=Math.min((r[a]??n+1)+1,(o[a-1]??n+1)+1,l);o.push(c),s=Math.min(s,c)}if(s>n)return n+1;r=o}return r[t.length]??n+1}function Um(e,t){let n=J(t),r=[];if(J(e.id)===n)_e(r,"exact-id",e.id);if(J(e.title)===n)_e(r,"exact-title",e.title);let i=wa(e.aliases,n);if(i)_e(r,"alias",i);let o=wa(e.tags,n);if(o)_e(r,"tag",o);let s=wa(e.capabilities,n);if(s)_e(r,"capability",s);if(e.category&&J(e.category)===n)_e(r,"category",e.category);if(!i){let c=ka(n).filter((p)=>p!==n),d=new Set(Sa(e).map(J));if(c.some((p)=>d.has(p)))_e(r,"alias",t.trim())}let a=n.split(" ").filter(Boolean),l=J(Sa(e).join(" "));if(a.length>0&&a.every((c)=>l.includes(c)))_e(r,"token",t.trim());if(r.length===0&&n.length>=4){let c;for(let d of Sa(e)){let p=J(d);if(p.length<4)continue;let m=PP(n,p,2);if(m<=2&&(!c||m<c.distance||m===c.distance&&ce(d,c.value)<0))c={value:d,distance:m}}if(c)_e(r,"fuzzy",c.value,xa.fuzzy-c.distance)}return r.sort((c,d)=>{if(c.score!==d.score)return d.score-c.score;return(Mm.get(c.code)??99)-(Mm.get(d.code)??99)||ce(c.value,d.value)})}function jm(e,t,n){if(t.has(n))return[n];let r=J(n),i=e.aliases[r];if(i?.length)return[...i];let o=new Set;for(let s of ka(r))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(ce)}function qm(e,t){return new Ie("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function Di(e){let t=new Map(e.resources.map((r)=>[r.id,r]));function n(r){let i=r.trim(),o=jm(e,t,i);if(o.length===0)throw new Ie("resource-not-found",i);if(o.length>1)throw qm(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(r){let i=r.text?.trim()??"";if(!i&&!RP(r))throw new Ie("resource-query-empty","text or filter is required");if(r.limit!==void 0&&(!Number.isInteger(r.limit)||r.limit<=0))throw new Ie("resource-query-invalid-limit",String(r.limit));let o=e.resources.filter((s)=>AP(s,r)).filter((s)=>!i||Um(s,i).length>0).map((s)=>{let a=i?Um(s,i):[];for(let[l,c]of[[r.functions,"function"],[r.scenarios,"scenario"],[r.units,"unit"],[r.industries,"industry"]])if(l?.length)_e(a,c,l.join(","));return{resource:s,score:a.reduce((l,c)=>l+c.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||ce(s.resource.id,a.resource.id));return r.limit===void 0?o:o.slice(0,r.limit)},get:n,build(r){if(r.length===0||r.every((m)=>!m.trim()))throw new Ie("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let m of r){let u=m.trim(),f=jm(e,t,u);if(f.length===0)i.push({id:u,reason:"missing-resource"});else if(f.length>1)throw qm(u,f);else{let g=f[0];if(g)o.add(g)}}let s=new Set,a=new Set,l=new Set,c=[],d=[],p=(m,u)=>{if(s.has(m))return;if(a.has(m)){i.push({id:m,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let f=t.get(m);if(!f){i.push({id:m,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(m),l.add(m);let g=[...f.dependencies].sort((h,b)=>{let y=t.get(h),v=t.get(b);return($m.get(y?.kind??"")??99)-($m.get(v?.kind??"")??99)||ce(h,b)});for(let h of g)d.push({from:m,to:h,relation:"depends-on"}),p(h,m);a.delete(m),s.add(m),c.push(m)};for(let m of[...o].sort(ce))p(m);return{roots:[...o].sort(ce),nodes:[...l].sort(ce).map((m)=>{let u=t.get(m);if(!u)throw new Ie("resource-not-found",m);return{id:m,kind:u.kind,maturity:u.receipt.maturity}}),edges:d.sort((m,u)=>ce(m.from,u.from)||ce(m.to,u.to)),order:c,gaps:i.sort((m,u)=>ce(m.id,u.id)||ce(m.requiredBy??"",u.requiredBy??"")||ce(m.reason,u.reason))}}})}function Ca(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");_P(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 n=new Set,r=new Set;for(let i of t.index.resources){if(!i||typeof i.id!=="string"||n.has(i.id)||!un.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/"))||!Et.includes(i.receipt.maturity)||!kd.includes(i.receipt.level)||!Array.isArray(i.receipt.evidence)||!i.receipt.evidence.every((s)=>typeof s==="string")||!Ar.every((s)=>Ir.includes(i.receipt.checks?.[s])))throw Error("invalid-public-resource");if(n.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((l)=>typeof l==="string"&&l.length>0&&l.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((l)=>typeof l!=="string"||!l.trim()||l.length>200)))throw Error("invalid-resource-collection")}if(o.agentKit!==void 0){let s=o.agentKit;if(r.has(i.source?.id))throw Error("invalid-resource-agent-kit");if(r.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((l)=>l.id===a.id&&(l.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((l)=>!["string","boolean","number"].includes(typeof l)||typeof l==="number"&&!Number.isFinite(l))||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)=>!n.has(s)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((i)=>!n.has(i)))throw Error("unexpected-public-resource-showcase");for(let i of t.index.resources)for(let o of i.dependencies)if(!n.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(!n.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 Vm(e){Ca(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 n=Di(e.index),r=(i)=>{let o=n.get(i),s=e.showcases[o.id];if(!s)throw new Ie("resource-not-found",o.id);return s};return Object.freeze({...n,get(i){let o=n.get(i),s=r(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=r(i);return{resourceId:a.resourceId,locale:o,...OP(a.docs[o],s),release:e.release}},examples(i,o=1){let s=r(i);return{resourceId:s.resourceId,...NP(s.examples,o),release:e.release}},installPlan(i){let o=r(i);return{resourceId:o.resourceId,distributions:o.distributions,dependencies:n.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)=>EP(s,e.distributionSnapshot,o.resourceId))}}})}var TP={Collection:{real:"@uibot/application/data-gateway (server only; nowapi/http/pg bindings)",demo:"createMockCollectionConnectionDriver from @uibot/connection-mock/browser"}};function EP(e,t,n){let{channel:r,name:i,version:o}=e;if(r==="npm")return{channel:r,name:i,command:`add ${i}@${o}`,note:null};if(r==="spec"){let l=Object.entries(e.dependencies??{}).map(([c,d])=>`${c}@${d}`);return{channel:r,name:i,command:l.length?`add ${l.join(" ")}`:null,drivers:(e.connections??[]).map((c)=>({type:c,...TP[c]??{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. Inject the model-driven mock adapter or a same-origin host adapter; real nowapi/http/pg bindings execute only in the server data gateway."}}let s=!!t&&Object.hasOwn(t.resources,n),a=t?.external[n]??[];return{channel:r,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 st=24000;function Hm(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 OP(e,t){let n=Math.max(1,Math.ceil(e.length/st));return Hm(t,n),{markdown:e.slice((t-1)*st,t*st),page:t,totalPages:n,...t<n?{nextPage:t+1}:{}}}function NP(e,t){let n=e.flatMap((r)=>Array.from({length:Math.max(1,Math.ceil(r.code.length/st))},(i,o)=>({...r,code:r.code.slice(o*st,(o+1)*st),codeOffset:o*st,codeLength:r.code.length,complete:r.code.length<=st})));return Hm(t,n.length),{examples:n.slice(t-1,t),page:t,totalPages:n.length,...t<n.length?{nextPage:t+1}:{}}}function _P(e){let t=0,n=0,r=new Set,i=(o,s)=>{if(++t>300000||s>64)throw Error("public-resource-budget-exceeded");if(typeof o==="string"){if(n+=new TextEncoder().encode(o).length,n>16777216)throw Error("public-resource-budget-exceeded")}else if(o&&typeof o==="object"){if(r.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");r.add(o);for(let[l,c]of Object.entries(o))i(l,s+1),i(c,s+1);r.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 BP=(e)=>e.length>0&&!["__proto__","constructor","prototype"].includes(e);function Qn(e){return e.flatMap((t)=>[t,...Qn(t.children??[]),...Object.values(t.slots??{}).flatMap(Qn)])}function zm(e,t,n){let r=structuredClone(e);for(let[i,o]of Object.entries(n)){let s=t.find((l)=>l.id===i);if(!s?.values.includes(o)||!BP(s.target.property))throw Error(`invalid-solution-control:${i}`);let a=r.pages?.find((l)=>l.id===s.target.pageId);if(!a)throw Error(`solution-page-missing:${i}`);if(s.target.blockId){let l=Qn(a.blocks).filter((d)=>d.id===s.target.blockId),c=l[0];if(l.length!==1||!c)throw Error(`solution-block-missing:${i}`);c.props={...c.props,[s.target.property]:o}}else a.state={...a.state,[s.target.property]:o}}return r}function Li(e,t,n={}){let r=new Set((e.pages??[]).map((a)=>a.id)),i=new Set((e.pages??[]).map((a)=>a.path)),o=new Set((e.pages??[]).flatMap((a)=>Qn(a.blocks).flatMap((l)=>l.id?[l.id]:[])));for(let a of t.pages??[]){if(r.has(a.id)||i.has(a.path))throw Error(`solution-page-conflict:${a.id}:${a.path}`);r.add(a.id),i.add(a.path);for(let l of Qn(a.blocks))if(l.id){if(o.has(l.id))throw Error(`solution-block-conflict:${l.id}`);o.add(l.id)}}if(t.connections||t.auth||t.layout)throw Error("solution-global-config-conflict");if(n.addNavigation){let a=new Set((e.menus?.items??[]).map((l)=>l.key));for(let l of t.pages)if(a.has(`solution:${l.id}`))throw Error(`solution-navigation-conflict:${l.id}`)}let s=n.addNavigation?{...structuredClone(e.menus),items:[...structuredClone(e.menus?.items??[]),...t.pages.map((a)=>({key:`solution:${a.id}`,label:a.title??a.id,path:a.path}))]}:e.menus;return{...structuredClone(e),...s?{menus:structuredClone(s)}:{},pages:[...structuredClone(e.pages??[]),...structuredClone(t.pages??[])]}}function _(e){if(Array.isArray(e))return`[${e.map(_).join(",")}]`;if(e&&typeof e==="object")return`{${Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[n])=>t<n?-1:t>n?1:0).map(([t,n])=>`${JSON.stringify(t)}:${_(n)}`).join(",")}}`;return JSON.stringify(e)??"null"}var Mi=(e)=>typeof e==="string"&&e.length>0&&!["__proto__","prototype","constructor"].includes(e);function DP(e){if(!Mi(e.resourceId)||!Mi(e.version)||!/^[a-f0-9]{64}$/.test(e.sourceHash))throw Error("invalid-solution-identity")}function LP(e,t,n,r=e.id){let i=structuredClone(e);if(i.id=r,i.path=n.paths[e.path]??e.path,!Mi(i.id)||typeof i.path!=="string"||!i.path.startsWith("/"))throw Error("invalid-solution-page-target");if(n.frame)i.blocks=i.blocks.map((s)=>s.type==="PageLayout"?{...s,props:{...s.props,...structuredClone(n.frame?.props)},slots:{...s.slots,...structuredClone(n.frame?.slots)},events:{...s.events,...structuredClone(n.frame?.events)}}:s);let o=(s)=>{if(!s||typeof s!=="object")return;for(let[a,l]of Object.entries(s))if(typeof l==="string"){if(a==="connectionId"&&n.connections[l])s[a]=n.connections[l];else if(["href","path","url","redirect","currentPath"].includes(a)&&n.paths[l])s[a]=n.paths[l]}else o(l)};if(o(i),n.layout==="source"&&t.layout&&i.blocks.some((s)=>s.type==="PageLayout"))i.layout={...structuredClone(t.layout),...i.layout,inherit:!1};return i}function Km(e,t){if(!t.data)return structuredClone(e.data);let n=structuredClone(e.data?.entities??{});for(let[r,i]of Object.entries(t.data.entities)){if(Object.hasOwn(n,r)&&_(n[r])!==_(i))throw Error(`solution-entity-conflict:${r}`);Object.defineProperty(n,r,{value:structuredClone(i),enumerable:!0,writable:!0,configurable:!0})}return Ee({entities:n})}function Gm(e,t,n){Km(e,t);let r=structuredClone(e.connections??[]);for(let i of t.connections??[]){let o=n[i.id];if(!o||!Mi(o))throw Error(`solution-connection-binding-required:${i.id}`);let s=r.find((a)=>a.id===o);if(s&&s.type!==i.type)throw Error(`solution-connection-type-conflict:${i.id}:${o}`);if(s&&s.entity!==i.entity)throw Error(`solution-connection-entity-conflict:${i.id}:${o}`);if(!s)r.push({id:o,type:i.type,entity:i.entity,...i.mock?{mock:structuredClone(i.mock)}:{}})}return r}function MP(e,t,n,r){let i=new Set([...e.pages,...n].map((l)=>l.path)),o=new Set(t.pages.map((l)=>r.paths[l.path]??l.path)),s=new Set(Gm(e,t,r.connections).map((l)=>l.id)),a=(l)=>{if(!l||typeof l!=="object")return;for(let[c,d]of Object.entries(l))if(typeof d==="string"){if(c==="connectionId"&&!s.has(d))throw Error(`solution-connection-missing:${d}`);if(["href","url","redirect","path"].includes(c)&&o.has(d)&&!i.has(d))throw Error(`solution-route-dependency-missing:${d}`)}else a(d)};for(let l of n)a(l)}function Wm(e,t,n){if(DP(t.identity),W(e),t.spec.auth)throw Error("solution-host-auth-required");let r=zm(t.spec,t.controls??[],n.configuration??{}),i={paths:{...n.paths},connections:{...n.connections},layout:n.layout,...n.frame?{frame:structuredClone(n.frame)}:{}},o=Gm(e,r,i.connections),s=n.selectedPageIds?r.pages.filter((p)=>n.selectedPageIds?.includes(p.id)):r.pages;if(!s.length||n.selectedPageIds&&s.length!==new Set(n.selectedPageIds).size)throw Error("solution-select-pages");let a=s.map((p)=>LP(p,r,i,n.pageIds?.[p.id]??p.id));MP(e,t.spec,a,i);let l=Li(e,{version:"2.0",pages:a},{addNavigation:n.addNavigation??!1}),c=s.map((p,m)=>({...t.identity,sourcePageId:p.id,targetPageId:a[m]?.id??p.id,baseline:structuredClone(a[m]),bindings:structuredClone(i),...n.configuration?{configuration:structuredClone(n.configuration)}:{}}));if(l.composition={...structuredClone(e.composition),schema:"uibot.solution-composition.v1",pages:[...structuredClone(e.composition?.pages??[]),...c]},o.length)l.connections=o;let d=Km(e,r);if(d)l.data=d;return{spec:l,pages:a.map((p)=>({id:p.id,path:p.path})),connections:o.filter((p)=>!e.connections?.some((m)=>m.id===p.id)),layout:n.layout}}function at(e,t=160){let n=typeof e==="string"?e:JSON.stringify(e)??String(e);if(n.length<=t)return n;return`${n.slice(0,t-3)}...`}function Qt(e){return e.flatMap((t)=>[t,...Qt(t.children??[]),...Object.values(t.slots??{}).flatMap(Qt)])}function Ym(e){if(e?.type!=="Box"||e.template||e.slots||e.events||e.visible!==void 0)throw Error("solution-region-slot-invalid");return e}function Jm(e,t){let n=Qt(e).filter((r)=>r.id===t);if(n.length!==1)return;return n[0]}function Ia(e,t){return Ym(Jm([e],t))}function $P(e,t){return Qt([e]).some((n)=>n.id===t)}function Aa(e,t,n,r){if(e.type!==t.type){r.push({code:"unmapped-block",path:`${n}.type`,message:`Outer frame block type changed from "${t.type}" to "${e.type}".`,preservedSummary:at(e)});return}let i=new Set([...Object.keys(e.props??{}),...Object.keys(t.props??{})]);for(let d of i){let p=e.props?.[d],m=t.props?.[d];if(_(p)!==_(m))r.push({code:"unmapped-frame-prop",path:`${n}.props.${d}`,message:`Customized outer frame prop "${d}" does not map automatically to the replacement frame.`,preservedSummary:`${d}=${at(p??null)}`})}let o=new Set([...Object.keys(e.events??{}),...Object.keys(t.events??{})]);for(let d of o){let p=e.events?.[d],m=t.events?.[d];if(_(p)!==_(m))r.push({code:"unmapped-event",path:`${n}.events.${d}`,message:`Customized outer frame event "${d}" does not map automatically to the replacement frame.`,preservedSummary:`${d}:${at(p??null)}`})}if(_(e.visible)!==_(t.visible))r.push({code:"unmapped-frame-prop",path:`${n}.visible`,message:"Customized outer frame visibility condition does not map to the replacement frame.",preservedSummary:`visible=${at(e.visible??null)}`});let s=e.children??[],a=t.children??[],l=Math.min(s.length,a.length);for(let d=0;d<l;d++){let p=s[d],m=a[d];if(p&&m)Aa(p,m,`${n}.children[${d}]`,r)}for(let d=l;d<s.length;d++){let p=s[d];if(p)r.push({code:"unmapped-block",path:`${n}.children[${d}]`,message:"Additional block inside outer frame was not carried over into the new frame.",preservedSummary:at(p)})}let c=new Set([...Object.keys(e.slots??{}),...Object.keys(t.slots??{})]);for(let d of c){let p=e.slots?.[d]??[],m=t.slots?.[d]??[],u=Math.min(p.length,m.length);for(let f=0;f<u;f++){let g=p[f],h=m[f];if(g&&h)Aa(g,h,`${n}.slots.${d}[${f}]`,r)}for(let f=u;f<p.length;f++){let g=p[f];if(g)r.push({code:"unmapped-block",path:`${n}.slots.${d}[${f}]`,message:`Additional block in frame slot "${d}" was not carried over into the new frame.`,preservedSummary:at(g)})}}}function Qm(e,t,n,r){if(W(e),!t.identity.resourceId||!t.identity.version||!/^[a-f0-9]{64}$/.test(t.identity.sourceHash))throw Error("invalid-solution-identity");let i=Object.entries(n);if(!i.length||i.some(([a,l])=>!a||!l)||new Set(i.map(([,a])=>a)).size!==i.length)throw Error("solution-region-explicit-mapping-required");let o=structuredClone(e),s=[];for(let[a,l]of i){let c=o.pages.findIndex((b)=>b.id===l),d=c>=0?o.pages[c]:void 0;if(!d||Qt(d.blocks).some((b)=>b.type==="PageLayout"))throw Error(`solution-region-independent-page-required:${l}`);let p=d.blocks,m=o.composition?.regions?.find((b)=>b.targetPageId===l);if(m)if(r?.strictBaseline){if(d.blocks.length!==1||!d.blocks[0])throw Error("solution-region-frame-customized");let b=structuredClone(d.blocks[0]),y=Ia(b,m.contentBlockId);if(p=y.children??[],y.children=[],_(b)!==_(m.baseline))throw Error("solution-region-frame-customized")}else{let b=structuredClone(d.blocks),y=Jm(b,m.contentBlockId);if(!y)s.push({code:"unmapped-block",path:`pages[${c}].blocks`,message:`Previous frame content slot "${m.contentBlockId}" could not be isolated; preserved full page body inside the new frame.`,preservedSummary:at(d.blocks)}),p=d.blocks;else{let v=Ym(y);p=v.children??[],v.children=[];let k=b.findIndex((x)=>$P(x,m.contentBlockId)),S=k>=0?b[k]:void 0;if(S)Aa(S,m.baseline,`pages[${c}].blocks[${k}]`,s);for(let x=0;x<b.length;x++){if(x===k)continue;let T=b[x];if(T)s.push({code:"unmapped-block",path:`pages[${c}].blocks[${x}]`,message:"Extra sibling block outside the frame content slot was not mapped to the new frame.",preservedSummary:at(T)})}}}let u=structuredClone(t.frame);if(Ia(u,t.contentBlockId).children?.length)throw Error("solution-region-slot-not-empty");for(let b of Qt([u]))if(b.id)b.id=`${l}-${b.id}`;let f=`${l}-${t.contentBlockId}`,g=structuredClone(u);Ia(u,f).children=structuredClone(p),d.blocks=[u];let h={...t.identity,targetPageId:l,role:a,target:"page-frame",contentBlockId:f,baseline:g};o.composition??={schema:"uibot.solution-composition.v1",pages:[]},o.composition.regions=[...(o.composition.regions??[]).filter((b)=>b.targetPageId!==l),h]}return Li({version:"2.0",pages:[]},{version:"2.0",pages:o.pages}),W(o),{spec:o,unmappedWarnings:s}}var FP=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Fi(e){let t=new TextEncoder().encode(e),n=t.length*8,r=Math.ceil((t.length+9)/64)*64,i=new Uint8Array(r);i.set(t),i[t.length]=128;let o=new DataView(i.buffer),s=Math.floor(n/4294967296),a=n>>>0;o.setUint32(r-8,s,!1),o.setUint32(r-4,a,!1);let l=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],c=new Uint32Array(64),d=(p,m)=>p>>>m|p<<32-m;for(let p=0;p<r;p+=64){for(let k=0;k<16;k++)c[k]=o.getUint32(p+k*4,!1);for(let k=16;k<64;k++){let S=c[k-15]??0,x=c[k-2]??0,T=d(S,7)^d(S,18)^S>>>3,C=d(x,17)^d(x,19)^x>>>10;c[k]=(c[k-16]??0)+T+(c[k-7]??0)+C>>>0}let[m,u,f,g,h,b,y,v]=l;for(let k=0;k<64;k++){let S=d(h,6)^d(h,11)^d(h,25),x=h&b^~h&y,T=v+S+x+(FP[k]??0)+(c[k]??0)>>>0,C=d(m,2)^d(m,13)^d(m,22),R=m&u^m&f^u&f,U=C+R>>>0;v=y,y=b,b=h,h=g+T>>>0,g=f,f=u,u=m,m=T+U>>>0}l[0]=(l[0]??0)+m>>>0,l[1]=(l[1]??0)+u>>>0,l[2]=(l[2]??0)+f>>>0,l[3]=(l[3]??0)+g>>>0,l[4]=(l[4]??0)+h>>>0,l[5]=(l[5]??0)+b>>>0,l[6]=(l[6]??0)+y>>>0,l[7]=(l[7]??0)+v>>>0}return l.map((p)=>p.toString(16).padStart(8,"0")).join("")}function ye(e,t=160){let n=typeof e==="string"?e:JSON.stringify(e)??String(e);if(n.length<=t)return n;return`${n.slice(0,t-3)}...`}function Xm(e=[]){let t=new Map,n=(r)=>{Ro(r),t.set(r.familyId,structuredClone(r))};for(let r of e)n(r);return{register:n,get:(r)=>{let i=t.get(r);return i?structuredClone(i):void 0},list:(r)=>Zm([...t.values()],r)}}function UP(e,t){if(!t)return!0;if(t.familyId&&e.familyId!==t.familyId)return!1;if(t.level&&e.level!==t.level)return!1;if(t.targetKind&&e.targetKind!==t.targetKind)return!1;if(t.resourceId&&!e.variants.some((n)=>n.resourceId===t.resourceId||n.identity?.resourceId===t.resourceId))return!1;if(t.query){let n=t.query.trim().toLowerCase();if(n){if(![e.familyId,e.title.zh,e.title.en,e.description,...e.variants.flatMap((i)=>[i.id,i.title.zh,i.title.en,i.description,i.resourceId??""])].join(`
138
+ `).toLowerCase().includes(n))return!1}}return!0}function Zm(e,t){return e.filter((n)=>UP(n,t)).map((n)=>structuredClone(n))}function Zt(e,t){if(!Array.isArray(e)&&"list"in e&&typeof e.list==="function")return e.list(t);return Zm(e,t)}function eg(e){let t=new Map;for(let[r,i]of Object.entries(e)){let o=i.replacement?.family;if(!o)continue;let s=t.get(o)??[];s.push({component:r,entry:i}),t.set(o,s)}let n=[];for(let[r,i]of t.entries()){let o=Array.from(new Set(i.flatMap((c)=>c.entry.replacement?.presentationProps??[]))),s=new Map,a=(c,d)=>{if(!s.has(c))s.set(c,{id:c,label:{zh:c,en:c},preserveMode:d})};for(let{entry:c}of i){let d=new Set(c.replacement?.presentationProps??[]);for(let p of Object.keys(c.props??{}))if(!d.has(p))a(`prop:${p}`,"when-customized");for(let p of Object.keys(c.events??{}))a(`event:${p}`,"always");for(let p of Object.keys(c.slots??{}))a(`slot:${p}`,"always")}let l=[];for(let{component:c,entry:d}of i){let p=new Set(d.replacement?.presentationProps??[]),m={};for(let u of Object.keys(d.props??{}))if(!p.has(u))m[`prop:${u}`]={kind:"block-prop",property:u};for(let u of Object.keys(d.events??{}))m[`event:${u}`]={kind:"block-events",property:u};for(let u of Object.keys(d.slots??{}))m[`slot:${u}`]=u==="children"?{kind:"block-children"}:{kind:"block-children",property:u};for(let u of d.replacement?.variants??[])l.push({id:`${c}:${u.id}`,title:{zh:u.title,en:u.title},description:d.description,resourceId:`component:${c.toLowerCase()}`,slotBindings:structuredClone(m),blockTemplate:{type:c,...u.props?{props:structuredClone(u.props)}:{}}})}if(l.length>0){let c=i[0];n.push({schema:"uibot.variant-contract.v1",familyId:r,level:"L1",targetKind:"block",title:{zh:c?.entry.name??r,en:c?.entry.name??r},description:c?.entry.description??`Component replacement family ${r}`,semanticSlots:[...s.values()],presentationProps:o,variants:l})}}return n}function Xt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let o=`${t}[${r}]`;if(n({node:i,path:o}),i.children?.length)Xt(i.children,`${o}.children`,n);for(let[s,a]of Object.entries(i.slots??{}))Xt(a,`${o}.slots.${s}`,n)}}function Ta(e,t,n){let r=[];return Xt(e,n,(i)=>{if(t.blockIdSuffix){let o=i.node.id??"";if(o===t.blockIdSuffix||o.endsWith(`-${t.blockIdSuffix}`))r.push(i);return}if(t.blockType){if(i.node.type===t.blockType)r.push(i);return}r.push(i)}),r[t.occurrence??0]}function It(e,t,n){if(t.kind==="page-field"){let i=t.property??"";return{value:e[i],path:`${n}.${i}`}}let r=Ta(e.blocks,t,`${n}.blocks`);if(!r)return{value:void 0,path:`${n}.blocks`};if(t.kind==="block-node")return{value:r.node,path:r.path,locatedNodePath:r.path};if(t.kind==="block-prop"){let i=t.property??"";return{value:r.node.props?.[i],path:`${r.path}.props.${i}`,locatedNodePath:r.path}}if(t.kind==="block-events"){let i=t.property;return{value:i?r.node.events?.[i]:r.node.events,path:i?`${r.path}.events.${i}`:`${r.path}.events`,locatedNodePath:r.path}}if(t.kind==="block-children"){let i=t.property;return{value:i?r.node.slots?.[i]:r.node.children,path:i?`${r.path}.slots.${i}`:`${r.path}.children`,locatedNodePath:r.path}}return{value:void 0,path:n}}function jP(e,t,n,r){let i={...structuredClone(e.props)};for(let[o,s]of Object.entries(t.props??{})){let a=n?.props?.[o];if(s!==null&&typeof s==="object"&&!Array.isArray(s)||!n||_(s)!==_(a))i[o]=structuredClone(s)}if(Object.keys(i).length>0)e.props=i;if(t.visible!==void 0)e.visible=structuredClone(t.visible);if(t.events&&(!n||_(t.events)!==_(n.events)))e.events=structuredClone(t.events);else if(!e.events&&t.events)e.events=structuredClone(t.events);if(t.children&&(!n||_(t.children)!==_(n.children)))e.children=structuredClone(t.children);else if(!e.children&&t.children)e.children=structuredClone(t.children);if(t.slots&&(!n||_(t.slots)!==_(n.slots)))e.slots=structuredClone(t.slots);else if(!e.slots&&t.slots)e.slots=structuredClone(t.slots);if(t.id&&!r.has(t.id))e.id=t.id}function tg(e,t,n,r,i){if(t.kind==="page-field"){let s=t.property;if(!s||["__proto__","prototype","constructor"].includes(s))return!1;return e[s]=structuredClone(n),!0}let o=Ta(e.blocks,t,"page.blocks");if(!o)return!1;if(t.kind==="block-node"){if(!n||typeof n!=="object")return!1;return jP(o.node,n,r&&typeof r==="object"?r:void 0,i),!0}if(t.kind==="block-prop"){let s=t.property;if(!s)return!1;return o.node.props??={},o.node.props[s]=structuredClone(n),!0}if(t.kind==="block-events"){let s=t.property;if(s)o.node.events??={},o.node.events[s]=structuredClone(n);else if(n&&typeof n==="object")o.node.events=structuredClone(n);return!0}if(t.kind==="block-children"){let s=t.property;if(s)o.node.slots??={},o.node.slots[s]=structuredClone(n);else o.node.children=structuredClone(n);return!0}return!1}function qP(e,t){Xt(e,"",({node:n})=>{if(n.id)t.add(n.id)})}function VP(e,t){let n=new Set;for(let r of e){if(r.id===t)continue;qP(r.blocks,n)}return n}function HP(e,t,n){let r=new Set,i=(o)=>{let s=`${n}-${o}`;if(t.has(s)||r.has(s)){let a=2;while(t.has(`${s}-${a}`)||r.has(`${s}-${a}`))a+=1;s=`${s}-${a}`}return s};Xt(e,"",({node:o})=>{if(!o.id)return;if(t.has(o.id)||r.has(o.id))o.id=i(o.id);r.add(o.id)})}function zP(e,t,n){let r=new Set;if(!t)return r;for(let i of Object.values(t.slotBindings)){if(i.kind==="page-field")continue;let o=Ta(e.blocks,i,`${n}.blocks`);if(!o)continue;if(i.kind==="block-node")r.add(`${o.path}.*`);else if(i.kind==="block-prop"&&i.property)r.add(`${o.path}.props.${i.property}`);else if(i.kind==="block-events")r.add(i.property?`${o.path}.events.${i.property}`:`${o.path}.events.*`);else if(i.kind==="block-children")r.add(i.property?`${o.path}.slots.${i.property}`:`${o.path}.children`)}return r}function Ra(e,t,n,r,i){let o=Math.min(e.length,t.length);for(let s=0;s<o;s++){let a=e[s],l=t[s];if(!a||!l)continue;let c=`${n}[${s}]`;if(r.has(`${c}.*`))continue;if(a.type!==l.type){i.push({code:"unmapped-block",path:c,message:`Customized block "${a.type}" does not match template structure "${l.type}".`,preservedSummary:ye(a)});continue}let d=new Set([...Object.keys(a.props??{}),...Object.keys(l.props??{})]);for(let u of d){let f=`${c}.props.${u}`;if(r.has(f))continue;let g=a.props?.[u],h=l.props?.[u];if(_(g)!==_(h))i.push({code:"unmapped-frame-prop",path:f,message:`Customized layout prop "${u}" cannot be projected onto target variant.`,preservedSummary:`${u}=${ye(g??null)}`})}let p=new Set([...Object.keys(a.events??{}),...Object.keys(l.events??{})]);for(let u of p){let f=`${c}.events.${u}`;if(r.has(`${c}.events.*`)||r.has(f))continue;let g=a.events?.[u],h=l.events?.[u];if(_(g)!==_(h))i.push({code:"unmapped-event",path:f,message:`Customized event "${u}" outside semantic slots cannot be mapped.`,preservedSummary:`${u}:${ye(g??null)}`})}if(!r.has(`${c}.children`))Ra(a.children??[],l.children??[],`${c}.children`,r,i);let m=new Set([...Object.keys(a.slots??{}),...Object.keys(l.slots??{})]);for(let u of m){if(r.has(`${c}.slots.${u}`))continue;Ra(a.slots?.[u]??[],l.slots?.[u]??[],`${c}.slots.${u}`,r,i)}}for(let s=o;s<e.length;s++){let a=e[s];if(!a)continue;let l=`${n}[${s}]`;if(r.has(`${l}.*`))continue;i.push({code:"unmapped-block",path:l,message:"Extra user-added block outside semantic slots is not in target variant.",preservedSummary:ye(a)})}}function KP(e,t){let n=e.variants.find((o)=>o.id===t);if(n)return n;let r=e.variants.find((o)=>o.aliases?.includes(t));if(r)return r;let i=e.variants.filter((o)=>o.id.endsWith(`:${t}`));if(i.length===1&&i[0])return i[0];throw Error(`unknown-variant:${e.familyId}:${t}`)}function Ui(e,t){e.composition??={schema:"uibot.solution-composition.v1",pages:[]},e.composition.variants=[...(e.composition.variants??[]).filter((n)=>!(n.targetKind===t.targetKind&&n.targetId===t.targetId&&n.familyId===t.familyId)),t]}function GP(e,t,n){let r=e.composition?.variants?.find((a)=>a.targetKind==="page"&&a.targetId===t.id&&a.familyId===n.familyId);if(r){let a=n.variants.find((l)=>l.id===r.variantId);if(a)return a}let i=e.composition?.pages.find((a)=>a.targetPageId===t.id);if(i){let a=n.variants.find((l)=>l.resourceId===i.resourceId);if(a)return a}let o,s=-1;for(let a of n.variants){let l=a.pageTemplate;if(!l)continue;let c=0;if(l.id===t.id)c+=4;if(l.blocks.length>0&&t.blocks.length>0&&l.blocks[0]?.type===t.blocks[0]?.type)c+=2;for(let d of n.semanticSlots){let p=a.slotBindings[d.id];if(!p||p.kind==="page-field")continue;let m=It(t,p,"page"),u=It(l,p,"template");if(m.value!==void 0){if(c+=2,_(m.value)===_(u.value))c+=3}}if(l.state&&t.state)for(let[d,p]of Object.entries(l.state)){if(d==="currentPath")continue;if(d in t.state){if(c+=1,_(t.state[d])===_(p))c+=2}}if(c>s)s=c,o=a}return o}function WP(e,t,n,r){let i=r.preserveCustomizations??!0,o=r.target.pageId??(e.pages.length===1?e.pages[0]?.id:void 0),s=e.pages.findIndex((v)=>v.id===o);if(s<0)throw Error(`unknown-variant-target-page:${r.target.pageId??""}`);let a=e.pages[s];if(!a||!n.pageTemplate)throw Error(`missing-variant-payload:${t.familyId}:${n.id}`);let l=GP(e,a,t),c=l?.pageTemplate,d=`pages[${s}]`,p=VP(e.pages,a.id),m=[];for(let v of t.semanticSlots){let k=l?.slotBindings[v.id]??n.slotBindings[v.id];if(!k)continue;let S=It(a,k,d);if(S.value===void 0)continue;let x=c?It(c,k,"baseline"):{value:void 0,path:"baseline"},T=x.value===void 0||_(S.value)!==_(x.value);if(v.preserveMode==="always"||i&&T)m.push({slotId:v.id,value:S.value,baselineValue:x.value,sourcePath:S.path})}let u=[];if(c&&i){let v=zP(a,l,d);Ra(a.blocks,c.blocks,`${d}.blocks`,v,u)}let f=structuredClone(n.pageTemplate);f.id=a.id,f.path=a.path;let g=a.title!==void 0&&c?.title!==void 0&&a.title!==c.title;if(a.title!==void 0&&(g&&i||f.title===void 0))f.title=a.title;if(a.layout)f.layout=structuredClone(a.layout);if(a.auth)f.auth=structuredClone(a.auth);if(a.lifecycle)f.lifecycle=structuredClone(a.lifecycle);if(a.computed)f.computed=structuredClone(a.computed);if(a.urlState)f.urlState=structuredClone(a.urlState);let h={...f.state??{}};if(a.state)for(let[v,k]of Object.entries(a.state)){if(v==="currentPath")continue;if(!c?.state||!(v in c.state)){h[v]=structuredClone(k);continue}if(_(k)!==_(c.state[v]))h[v]=structuredClone(k);else if(!(v in h))h[v]=structuredClone(k)}if("currentPath"in h||a.state?.currentPath!==void 0)h.currentPath=a.path;if(Object.keys(h).length>0)f.state=h;for(let v of m){let k=n.slotBindings[v.slotId];if(!k){u.push({code:"unmapped-slot",slotId:v.slotId,path:v.sourcePath,message:`Target variant "${n.id}" does not expose semantic slot "${v.slotId}".`,preservedSummary:ye(v.value)});continue}let S=It(n.pageTemplate,k,"targetTemplate").value;if(!tg(f,k,v.value,v.baselineValue??S,p))u.push({code:"unmapped-slot",slotId:v.slotId,path:v.sourcePath,message:`Target variant "${n.id}" slot "${v.slotId}" could not be located during projection.`,preservedSummary:ye(v.value)})}let b=$i(n.pageTemplate.lifecycle),y=$i(f.lifecycle??a.lifecycle);if(b&&y&&b!==y)Pa(f.blocks,b,y);return HP(f.blocks,p,f.id),e.pages[s]=f,Ui(e,{familyId:t.familyId,variantId:n.id,targetKind:"page",targetId:f.id}),W(e),{spec:e,familyId:t.familyId,...l?{fromVariantId:l.id}:{},toVariantId:n.id,changedPaths:[d],unmappedWarnings:u}}function $i(e){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let n of e){let r=$i(n);if(r)return r}return}let t=e;if(typeof t.connectionId==="string"&&t.connectionId)return t.connectionId;for(let n of Object.values(t)){let r=$i(n);if(r)return r}return}function Pa(e,t,n){if(!e||typeof e!=="object")return;if(Array.isArray(e)){for(let i of e)Pa(i,t,n);return}let r=e;if(r.connectionId===t)r.connectionId=n;for(let i of Object.values(r))Pa(i,t,n)}function YP(e,t){let n=e.composition?.variants?.find((i)=>i.targetKind==="shell"&&i.familyId===t.familyId);if(n){let i=t.variants.find((o)=>o.id===n.variantId||o.aliases?.includes(n.variantId));if(i)return i}let r=e.layout;if(!r)return;if(r.shell){let i=t.variants.filter((o)=>o.shellLayout?.shell===r.shell);if(i.length===1)return i[0];if(i.length>1)return i.find((o)=>Object.entries(o.shellLayout??{}).every(([s,a])=>r[s]===a))??i.find((o)=>r.sidebar?o.shellLayout?.sidebar===r.sidebar:!0)??i[0]}return t.variants.find((i)=>{if(!i.shellLayout)return!1;let o=Object.entries(i.shellLayout).filter(([s])=>s!=="shell");return o.length>0&&o.every(([s,a])=>r[s]===a)})}function JP(e,t,n,r){if(!n.shellLayout)throw Error(`missing-variant-payload:${t.familyId}:${n.id}`);let i=YP(e,t),o=structuredClone(e.layout??{}),s=n.shellCapabilities?.supportsSidebarBehavior??n.shellCapabilities?.supportsSidebarSlots??!0,a=n.shellCapabilities?.sidebarSlotPlacement??(n.shellCapabilities?.supportsSidebarSlots??!0?"sidebar":"hidden"),{sidebar:l,shell:c,...d}=o,p={...d,...s&&l!==void 0?{sidebar:l}:{},...structuredClone(n.shellLayout)},m=[];if(!s&&l!==void 0)m.push({code:"unmapped-shell-option",path:"layout.sidebar",...t.semanticSlots.some((u)=>u.id==="sidebarBehavior")?{slotId:"sidebarBehavior"}:{},message:`Target shell "${n.id}" does not use sidebar folding behavior.`,preservedSummary:`sidebar=${l}`});if(a==="hidden")for(let u=0;u<e.pages.length;u++){let f=e.pages[u];if(!f||f.layout?.inherit===!1)continue;Xt(f.blocks,`pages[${u}].blocks`,({node:g,path:h})=>{if(g.type==="PageLayout"&&g.slots?.sidebar?.length)m.push({code:"unmapped-slot",path:`${h}.slots.sidebar`,message:`PageLayout sidebar slot on page "${f.id}" is hidden under "${n.id}".`,preservedSummary:ye(g.slots.sidebar)})})}return e.layout=p,Ui(e,{familyId:t.familyId,variantId:n.id,targetKind:"shell",targetId:"spec"}),W(e),{spec:e,familyId:t.familyId,...i?{fromVariantId:i.id}:{},toVariantId:n.id,changedPaths:["layout"],unmappedWarnings:m}}function QP(e,t,n,r){if(!n.frameTemplate)throw Error(`missing-variant-payload:${t.familyId}:${n.id}`);let i=r.pageMapping??(r.target.pageId?{[r.target.role??r.target.pageId]:r.target.pageId}:{}),o=t.variants.find((l)=>Object.values(i).some((c)=>e.composition?.regions?.some((d)=>d.targetPageId===c&&(d.resourceId===l.resourceId||d.resourceId===`layout:${l.id}`)))),s={identity:n.identity??{resourceId:n.resourceId??`layout:${n.id}`,version:"1",sourceHash:Fi(_(n.frameTemplate))},contentBlockId:n.frameTemplate.contentBlockId,frame:structuredClone(n.frameTemplate.frame)},a=Qm(e,s,i);for(let l of Object.values(i))Ui(a.spec,{familyId:t.familyId,variantId:n.id,targetKind:"frame",targetId:l});return W(a.spec),{spec:a.spec,familyId:t.familyId,...o?{fromVariantId:o.id}:{},toVariantId:n.id,changedPaths:Object.values(i).map((l)=>{let c=a.spec.pages.findIndex((d)=>d.id===l);return c>=0?`pages[${c}].blocks[0]`:`pages.${l}.blocks[0]`}),unmappedWarnings:a.unmappedWarnings}}function XP(e,t,n,r){let i=n.map((u,f)=>{if(typeof u==="number"||f===0)return u;if(/^(0|[1-9]\d*)$/.test(u)||u.startsWith("@"))return u;if(u.startsWith("slots."))return`@${u.slice(6)}`;return`@${u}`}),o=ze(i,{allowRoot:!1,allowSlotEnd:!1}),s=e.blocks,a=null,l=e.blocks,c=0,d,p=`pages[${t}].blocks`,m=0;while(m<o.length){let u=o[m];if(typeof u==="string"&&u.startsWith("@")){let f=u.slice(1),g=o[m+1];if(!a||typeof g!=="number")return;let h=a.slots?.[f];if(!h?.[g])return;l=h,c=g,d=h[g],a=d??null,s=d?.children??[],p=`${p}.slots.${f}[${g}]`,m+=2;continue}if(typeof u!=="number"||!s[u])return;l=s,c=u,d=s[u],a=d??null,s=d?.children??[],p=m===0?`${p}[${u}]`:`${p}.children[${u}]`,m+=1}if(!d)return;if(r&&d.id!==r)throw Error(`mismatched-variant-target-block:${r}`);return{pageIndex:t,blockPath:p,block:d,replace:(u)=>{l[c]=u}}}function ZP(e,t,n,r){for(let i=0;i<e.pages.length;i++){let o=e.pages[i];if(!o||t&&o.id!==t)continue;if(r!==void 0){let l=XP(o,i,r,n);if(l)return l;continue}let s=(l,c)=>{for(let d=0;d<l.length;d++){let p=l[d];if(!p)continue;let m=`${c}[${d}]`;if(n?p.id===n:l.length===1&&c.endsWith(".blocks"))return{pageIndex:i,blockPath:m,block:p,replace:(u)=>{l[d]=u}};if(p.children?.length){let u=s(p.children,`${m}.children`);if(u)return u}for(let[u,f]of Object.entries(p.slots??{})){let g=s(f,`${m}.slots.${u}`);if(g)return g}}return},a=s(o.blocks,`pages[${i}].blocks`);if(a)return a}throw Error(`unknown-variant-target-block:${n??""}`)}function eT(e,t){let n,r=-1;for(let i of t.variants){let o=i.blockTemplate;if(!o||o.type!==e.type)continue;let s=1;for(let[a,l]of Object.entries(o.props??{}))if(_(e.props?.[a])===_(l))s+=2;if(s>r)r=s,n=i}return n}function tT(e,t,n,r){if(!n.blockTemplate)throw Error(`missing-variant-payload:${t.familyId}:${n.id}`);let i=r.preserveCustomizations??!0,o=ZP(e,r.target.pageId,r.target.blockId,r.target.blockPath),s=o.block,a=eT(s,t),l={id:"_block",path:"/_block",blocks:[s]},c={id:"_target",path:"/_target",blocks:[structuredClone(n.blockTemplate)]},d=new Set(t.presentationProps??[]),p=new Set,m=new Set,u=!1,f=(y)=>{if(!y)return;if(y.kind==="block-prop"&&y.property)d.add(y.property);if(y.kind==="block-events")if(y.property)p.add(y.property);else for(let v of Object.keys(s.events??{}))p.add(v);if(y.kind==="block-children")if(y.property)m.add(y.property);else u=!0},g=[];for(let y of t.semanticSlots){let v=a?.slotBindings[y.id]??n.slotBindings[y.id];if(f(v),!v)continue;let k=It(l,v,o.blockPath);if(k.value===void 0)continue;let S=a?.blockTemplate?It({id:"_base",path:"/_base",blocks:[a.blockTemplate]},v,"baseline").value:void 0,x=S===void 0||_(k.value)!==_(S);if(y.preserveMode!=="always"&&!(i&&x))continue;let T=n.slotBindings[y.id];if(!T){g.push({code:"unmapped-slot",slotId:y.id,path:k.path,message:`Target variant "${n.id}" does not support semantic slot "${y.id}".`,preservedSummary:ye(k.value)});continue}tg(c,T,k.value,S,new Set)}let h=c.blocks[0];if(!h)throw Error("variant-block-instantiation-failed");if(s.id)h.id=s.id;if(s.visible!==void 0)h.visible=structuredClone(s.visible);let b=s.type===h.type;for(let[y,v]of Object.entries(s.props??{})){if(d.has(y))continue;if(b)h.props??={},h.props[y]=structuredClone(v);else g.push({code:"unmapped-prop",path:`${o.blockPath}.props.${y}`,message:`Custom property "${y}" on "${s.type}" does not map to "${h.type}".`,preservedSummary:`${y}=${ye(v)}`})}for(let[y,v]of Object.entries(s.events??{})){if(p.has(y))continue;if(b)h.events??={},h.events[y]=structuredClone(v);else g.push({code:"unmapped-event",path:`${o.blockPath}.events.${y}`,message:`Event handler "${y}" on "${s.type}" does not map to "${h.type}".`,preservedSummary:ye(v)})}for(let[y,v]of Object.entries(s.slots??{})){if(m.has(y))continue;if(b)h.slots??={},h.slots[y]=structuredClone(v);else g.push({code:"unmapped-slot",path:`${o.blockPath}.slots.${y}`,message:`Named slot "${y}" on "${s.type}" does not map to "${h.type}".`,preservedSummary:ye(v)})}if(!u&&s.children?.length)if(b)h.children=structuredClone(s.children);else g.push({code:"unmapped-block",path:`${o.blockPath}.children`,message:`Child blocks of "${s.type}" cannot auto-map onto "${h.type}".`,preservedSummary:ye(s.children)});return o.replace(h),Ui(e,{familyId:t.familyId,variantId:n.id,targetKind:t.targetKind,targetId:s.id??o.blockPath}),W(e),{spec:e,familyId:t.familyId,...a?{fromVariantId:a.id}:{},toVariantId:n.id,changedPaths:[o.blockPath],unmappedWarnings:g}}function nT(e,t){if(t.familyId){let r=!Array.isArray(e)&&"get"in e?e.get(t.familyId):e.find((i)=>i.familyId===t.familyId);if(!r)throw Error(`unknown-variant-family:${t.familyId}`);return r}let n=Zt(e,{targetKind:t.target.kind}).filter((r)=>r.variants.some((i)=>i.id===t.targetVariantId||Boolean(i.aliases?.includes(t.targetVariantId))||i.id.endsWith(`:${t.targetVariantId}`)));if(n.length===1&&n[0])return n[0];if(n.length>1){let r=t.target.kind==="shell"?"spec":t.target.kind==="page"||t.target.kind==="frame"?t.target.pageId:t.target.blockId??(t.target.blockPath?`pages[${Math.max(0,t.spec.pages.findIndex((o)=>o.id===t.target.pageId))}].blocks.${t.target.blockPath.join(".")}`:void 0),i=(t.spec.composition?.variants??[]).filter((o)=>o.targetKind===t.target.kind&&(!r||o.targetId===r)).map((o)=>n.find((s)=>s.familyId===o.familyId)).filter((o)=>Boolean(o));if(i.length===1&&i[0])return i[0]}throw Error("ambiguous-or-unknown-variant-family")}function lt(e,t){let n=nT(e,t);if(Ro(n),n.targetKind!==t.target.kind)throw Error(`variant-target-kind-mismatch:${n.targetKind}:${t.target.kind}`);let r=KP(n,t.targetVariantId),i=structuredClone(t.spec);if(W(i),n.targetKind==="shell")return JP(i,n,r,t);if(n.targetKind==="frame")return QP(i,n,r,t);if(n.targetKind==="page")return WP(i,n,r,t);return tT(i,n,r,t)}var rT=(e)=>Boolean(e)&&typeof e==="object"&&!Array.isArray(e);function Oa(e,t,n){for(let r of e){if(r===n)continue;if(r.id)t.add(r.id);if(r.children?.length)Oa(r.children,t,n);for(let i of Object.values(r.slots??{}))Oa(i,t,n)}}function ji(e,t){let n=new Set;for(let r of e.pages)Oa(r.blocks,n,t);return n}function qi(e,t,n,r){let i=new Set,o=(s)=>{if(s.id){if(t.has(s.id)||i.has(s.id))throw new P("invalid-spec-patch",n,r,`duplicate block id "${s.id}"`);i.add(s.id)}for(let a of s.children??[])o(a);for(let a of Object.values(s.slots??{}))for(let l of a)o(l)};o(e)}function Xn(e,t,n,r){let i=e.pages.findIndex((s)=>s.id===t),o=i>=0?e.pages[i]:void 0;if(!o)throw new P("patch-page-not-found",n,r,`unknown page "${t}"`);return{page:o,pageIndex:i}}function Vi(e,t,n,r,i){for(let o=0;o<e.length;o++){let s=e[o];if(!s)continue;let a=[...n,o];if(s.id===t)return{pageIndex:i,page:r,node:s,path:a,parentList:e,index:o};if(s.children?.length){let l=Vi(s.children,t,a,r,i);if(l)return l}for(let[l,c]of Object.entries(s.slots??{})){let d=Vi(c,t,[...a,`@${l}`],r,i);if(d)return d}}return}function Na(e,t,n,r,i){let o;try{o=ze(n,{allowRoot:!1,allowSlotEnd:!1})}catch{throw new P("invalid-spec-block-path",r,i,"malformed blockPath")}let s=e.blocks,a=null,l,c=e.blocks,d=0,p=0;while(p<o.length){let m=o[p];if(typeof m==="string"&&m.startsWith("@")){let u=m.slice(1),f=o[p+1];if(!a||typeof f!=="number")throw new P("patch-block-not-found",r,i,"invalid slot path");let g=a.slots?.[u];if(!g?.[f])throw new P("patch-block-not-found",r,i,`block missing at slot "${u}[${f}]"`);c=g,d=f,l=g[f],a=l??null,s=l?.children??[],p+=2;continue}if(typeof m!=="number")throw new P("invalid-spec-block-path",r,i,"expected index segment");if(!s[m])throw new P("patch-block-not-found",r,i,`block missing at path segment ${m}`);c=s,d=m,l=s[m],a=l??null,s=l?.children??[],p+=1}if(!l)throw new P("patch-block-not-found",r,i,"target block not found");return{pageIndex:t,page:e,node:l,path:o,parentList:c,index:d}}function en(e,t,n,r){let{page:i,pageIndex:o}=Xn(e,t.pageId,n,r);if(t.blockPath!==void 0)return Na(i,o,t.blockPath,n,r);if(t.blockId){let s=Vi(i.blocks,t.blockId,[],i,o);if(!s)throw new P("patch-block-not-found",n,r,`unknown blockId "${t.blockId}" on page "${t.pageId}"`);return s}throw new P("invalid-spec-patch",n,r,"locator needs blockId or blockPath")}function Ea(e,t,n,r){let{page:i,pageIndex:o}=Xn(e,t.pageId,n,r);if(t.parentBlockId){let s=Vi(i.blocks,t.parentBlockId,[],i,o);if(!s)throw new P("patch-block-not-found",n,r,`unknown parentBlockId "${t.parentBlockId}"`);let a=s.node;if(t.slot){let l=t.slot;return{page:i,parentNode:a,parentNodePath:s.path,list:a.slots?.[l]??[],ensureCreated:()=>(a.slots??={},a.slots[l]??=[],a.slots[l])}}return{page:i,parentNode:a,parentNodePath:s.path,list:a.children??[],ensureCreated:()=>(a.children??=[],a.children)}}if(t.parentPath!==void 0){let s;try{s=ze(t.parentPath,{allowRoot:!0,allowSlotEnd:!0})}catch{throw new P("invalid-spec-block-path",n,r,"invalid parentPath")}if(s.length===0){if(t.slot)throw new P("patch-slot-invalid",n,r,"root page has no named slot");return{page:i,parentNode:null,parentNodePath:[],list:i.blocks,ensureCreated:()=>i.blocks}}let a=s[s.length-1];if(typeof a==="string"&&a.startsWith("@")){let c=a.slice(1),d=s.slice(0,-1),p=Na(i,o,d,n,r);return{page:i,parentNode:p.node,parentNodePath:p.path,list:p.node.slots?.[c]??[],ensureCreated:()=>(p.node.slots??={},p.node.slots[c]??=[],p.node.slots[c])}}let l=Na(i,o,s,n,r);if(t.slot){let c=t.slot;return{page:i,parentNode:l.node,parentNodePath:l.path,list:l.node.slots?.[c]??[],ensureCreated:()=>(l.node.slots??={},l.node.slots[c]??=[],l.node.slots[c])}}return{page:i,parentNode:l.node,parentNodePath:l.path,list:l.node.children??[],ensureCreated:()=>(l.node.children??=[],l.node.children)}}if(t.slot)throw new P("patch-slot-invalid",n,r,"slot requires a parent block");return{page:i,parentNode:null,parentNodePath:[],list:i.blocks,ensureCreated:()=>i.blocks}}function iT(e,t){return e.length<=t.length&&e.every((n,r)=>t[r]===n)}function ng(e,t){let n=[];for(let r of e){if("children"in r&&Array.isArray(r.children)){let i=ng(r.children,t);n.push({...r,children:i});continue}if("path"in r&&r.path===t)continue;n.push(r)}return n}function rg(e,t,n={}){He(e),Bd(t,n);let r=structuredClone(e);W(r);let i=new Set,o=[];for(let s=0;s<t.length;s++){let a=t[s];if(!a)continue;switch(a.op){case"addPage":{let l=r.pages.some((u)=>u.id===a.page.id),c=r.pages.some((u)=>u.path===a.page.path);if(l||c)throw new P("patch-page-conflict",s,a.op,`page id "${a.page.id}" or path "${a.page.path}" already exists`);let d=ji(r),p=structuredClone(a.page);for(let u of p.blocks)qi(u,d,s,a.op);let m=a.index!==void 0?Math.max(0,Math.min(a.index,r.pages.length)):r.pages.length;if(r.pages.splice(m,0,p),a.addToMenu===!0)r.menus??={items:[]},r.menus.items.push({key:`page:${p.id}`,label:p.title??p.id,path:p.path}),i.add("menus");i.add("pages");break}case"removePage":{let{page:l,pageIndex:c}=Xn(r,a.pageId,s,a.op);if(r.pages.splice(c,1),r.composition){if(r.composition.pages=r.composition.pages.filter((d)=>d.targetPageId!==a.pageId),r.composition.regions)r.composition.regions=r.composition.regions.filter((d)=>d.targetPageId!==a.pageId);if(r.composition.variants)r.composition.variants=r.composition.variants.filter((d)=>!((d.targetKind==="page"||d.targetKind==="frame")&&d.targetId===a.pageId))}if(a.removeFromMenu!==!1&&r.menus?.items)r.menus.items=ng(r.menus.items,l.path),i.add("menus");i.add("pages");break}case"updatePage":{let{page:l,pageIndex:c}=Xn(r,a.pageId,s,a.op);if(a.patch.path!==void 0){if(r.pages.some((p,m)=>m!==c&&p.path===a.patch.path))throw new P("patch-page-conflict",s,a.op,`page path "${a.patch.path}" already exists`);l.path=a.patch.path}if(a.patch.title!==void 0)l.title=a.patch.title;if(a.patch.layout!==void 0)l.layout=structuredClone(a.patch.layout);if(a.patch.auth!==void 0)l.auth=structuredClone(a.patch.auth);i.add(`pages[${c}]`);break}case"setPageState":{let{page:l,pageIndex:c}=Xn(r,a.pageId,s,a.op);if(a.state)l.state={...l.state,...structuredClone(a.state)};if(a.removeStateKeys?.length&&l.state)for(let d of a.removeStateKeys)delete l.state[d];if(a.computed!==void 0)l.computed=structuredClone(a.computed);if(a.lifecycle!==void 0)l.lifecycle=structuredClone(a.lifecycle);if(a.urlState!==void 0)l.urlState=structuredClone(a.urlState);i.add(`pages[${c}]`);break}case"insertBlock":{let l=Ea(r,a.target,s,a.op),c=ji(r),d=structuredClone(a.block);qi(d,c,s,a.op);let p=l.ensureCreated(),m=a.target.index!==void 0?Math.max(0,Math.min(a.target.index,p.length)):p.length;p.splice(m,0,d);let u=r.pages.indexOf(l.page);i.add(`pages[${u}].blocks`);break}case"replaceBlock":{let l=en(r,a.target,s,a.op),c=ji(r,l.node),d=structuredClone(a.block);if((a.preserveId??!0)&&!d.id&&l.node.id)d.id=l.node.id;qi(d,c,s,a.op),l.parentList[l.index]=d,i.add(`pages[${l.pageIndex}].blocks`);break}case"removeBlock":{let l=en(r,a.target,s,a.op);l.parentList.splice(l.index,1),i.add(`pages[${l.pageIndex}].blocks`);break}case"moveBlock":{if(a.from.pageId!==a.to.pageId){let f=en(r,a.from,s,a.op),g=Ea(r,a.to,s,a.op),h=ji(r,f.node);qi(f.node,h,s,a.op);let[b]=f.parentList.splice(f.index,1);if(!b)break;let y=g.ensureCreated(),v=a.to.index!==void 0?Math.max(0,Math.min(a.to.index,y.length)):y.length;y.splice(v,0,b),i.add(`pages[${f.pageIndex}].blocks`),i.add(`pages[${r.pages.indexOf(g.page)}].blocks`);break}let l=en(r,a.from,s,a.op),c=Ea(r,a.to,s,a.op);if(iT(l.path,c.parentNodePath))throw new P("patch-move-cycle",s,a.op,"cannot move a block into itself or its descendant");let d=c.ensureCreated(),p=d===l.parentList,m=a.to.index!==void 0?Math.max(0,Math.min(a.to.index,d.length)):d.length,[u]=l.parentList.splice(l.index,1);if(!u)break;if(p&&m>l.index)m=Math.max(0,m-1);d.splice(m,0,u),i.add(`pages[${l.pageIndex}].blocks`);break}case"updateProps":{let l=en(r,a.target,s,a.op),c={...l.node.props};for(let[d,p]of Object.entries(a.props))c[d]=structuredClone(p);if(a.removeKeys?.length)for(let d of a.removeKeys)delete c[d];if(Object.keys(c).length>0)l.node.props=c;else delete l.node.props;i.add(`pages[${l.pageIndex}].blocks`);break}case"setEvents":{let l=en(r,a.target,s,a.op),c=a.merge?{...l.node.events}:{};for(let[d,p]of Object.entries(a.events))c[d]=structuredClone(p);if(a.removeEvents?.length)for(let d of a.removeEvents)delete c[d];if(Object.keys(c).length>0)l.node.events=c;else delete l.node.events;i.add(`pages[${l.pageIndex}].blocks`);break}case"upsertEntity":{let l=structuredClone(r.data?.entities??{});l[a.name]=structuredClone(a.entity);try{r.data=Ee({entities:l})}catch(c){throw new P("invalid-spec-patch",s,a.op,c instanceof Error?c.message:"invalid entity")}i.add(`data.entities.${a.name}`);break}case"removeEntity":{if(!r.data?.entities||!Object.hasOwn(r.data.entities,a.name))throw new P("patch-entity-not-found",s,a.op,`unknown entity "${a.name}"`);let l=structuredClone(r.data.entities);delete l[a.name],r.data=Ee({entities:l}),i.add("data.entities");break}case"upsertConnection":{if(r.data?.entities&&!Object.hasOwn(r.data.entities,a.connection.entity))throw new P("patch-entity-not-found",s,a.op,`connection references undeclared entity "${a.connection.entity}"`);let l=structuredClone(a.connection);r.connections??=[];let c=r.connections.findIndex((d)=>d.id===l.id);if(c>=0)r.connections[c]=l;else r.connections.push(l);i.add("connections");break}case"removeConnection":{let l=r.connections?.findIndex((c)=>c.id===a.connectionId)??-1;if(l<0)throw new P("patch-connection-not-found",s,a.op,`unknown connection "${a.connectionId}"`);r.connections?.splice(l,1),i.add("connections");break}case"setLayout":{r.layout=a.merge?{...r.layout,...structuredClone(a.layout)}:structuredClone(a.layout),i.add("layout");break}case"setMenus":{r.menus=structuredClone(a.menus),i.add("menus");break}case"setDesign":{let l=structuredClone(a.design);if(a.merge&&r.design)r.design={...r.design,...l,...r.design.tokens||l.tokens?{tokens:{...r.design.tokens,...l.tokens}}:{}};else r.design=l;i.add("design");break}case"swapVariant":{if(!n.variantRegistry)throw new P("patch-variant-failed",s,a.op,"variantRegistry option is required for swapVariant patch ops");try{let l,c=-1;if(a.target.kind==="page"&&a.target.pageId){c=r.pages.findIndex((m)=>m.id===a.target.pageId);let p=c>=0?r.pages[c]:void 0;if(p&&p.blocks.length===1&&p.blocks[0]?.type==="PageLayout"&&p.blocks[0].children&&rT(p.blocks[0].children)===!1){let m=p.blocks[0];l={...m,children:[]},p.blocks=structuredClone(m.children??[])}}let d=lt(n.variantRegistry,{spec:r,...a.familyId!==void 0?{familyId:a.familyId}:{},target:a.target,targetVariantId:a.targetVariantId,...a.preserveCustomizations!==void 0?{preserveCustomizations:a.preserveCustomizations}:{},...a.pageMapping?{pageMapping:a.pageMapping}:{}});if(r=d.spec,l&&c>=0){let p=r.pages[c];if(p&&!p.blocks.some((m)=>m.type==="PageLayout"))l.children=p.blocks,p.blocks=[l]}for(let p of d.changedPaths)i.add(p);o.push(...d.unmappedWarnings)}catch(l){throw new P("patch-variant-failed",s,a.op,l instanceof Error?l.message:"swapVariant failed")}break}}}return W(r),{spec:r,appliedCount:t.length,changedPaths:[...i],unmappedWarnings:o}}var oT=new Set(["__proto__","prototype","constructor"]);function ig(e){let t=e.trim();if(!t)return"/";return t.startsWith("/")?t:`/${t}`}function _a(e,t){for(let n of e){if(n.id)t.add(n.id);if(n.children?.length)_a(n.children,t);for(let r of Object.values(n.slots??{}))_a(r,t)}}function og(e,t,n){let r=(i)=>{for(let o of i){if(o.id){if(n.has(o.id)){let s=`${t}-${o.id}`,a=2;while(n.has(s))s=`${t}-${o.id}-${a}`,a+=1;o.id=s}n.add(o.id)}if(o.children?.length)r(o.children);for(let s of Object.values(o.slots??{}))r(s)}};r(e)}function sT(e,t,n){if(!e)return;let r=Zt(e,{targetKind:"shell"});if(n){let i=r.find((o)=>o.familyId===n);if(i)return i}return r.find((i)=>i.variants.some((o)=>o.id===t))??r[0]}function aT(e,t){if(!e)return{};let n=Zt(e,{targetKind:"page"});if(t.familyId){let r=n.find((o)=>o.familyId===t.familyId);if(!r)throw Error(`unknown-variant-family:${t.familyId}`);if(t.solutionId){let o=`template:${t.solutionId}`;if(!r.variants.some((a)=>a.resourceId===o||a.id===t.solutionId))throw Error(`blueprint-solution-variant-mismatch:${t.solutionId}:${t.familyId}`)}let i=t.variantId?r.variants.find((o)=>o.id===t.variantId):r.variants[0];if(t.variantId&&!i)throw Error(`unknown-variant:${r.familyId}:${t.variantId}`);return{family:r,...i?{variant:i}:{}}}if(t.solutionId){let r=`template:${t.solutionId}`;for(let i of n){let o=i.variants.find((s)=>s.resourceId===r);if(o){let s=t.variantId?i.variants.find((a)=>a.id===t.variantId):o;if(t.variantId&&!s)throw Error(`unknown-variant:${i.familyId}:${t.variantId}`);return{family:i,...s?{variant:s}:{}}}}}return{}}function sg(e,t,n,r){if(!t)return;if(e.blocks.some((s)=>s.type==="PageLayout"||Boolean(s.template)))return;let i=`${e.id}-shell`,o=2;while(n.has(i))i=`${e.id}-shell-${o}`,o+=1;n.add(i),e.blocks=[{id:i,type:"PageLayout",props:{title:e.title??r??e.id},children:e.blocks}]}function ag(e,t={}){_d(e);let n={version:"2.0",pages:[],...e.layout?{layout:structuredClone(e.layout)}:{},...e.design?{design:structuredClone(e.design)}:{},...e.auth?{auth:structuredClone(e.auth)}:{},...e.menus?{menus:structuredClone(e.menus)}:{}};if(e.entities&&Object.keys(e.entities).length>0)n.data=Ee({entities:structuredClone(e.entities)});let r=[];if(e.connections?.length){let c=[];for(let d of e.connections){let p=d.mockSeed!==void 0||d.mockGenerate!==void 0;c.push({id:d.id,type:"Collection",entity:d.entity,...p?{mock:{...d.mockSeed?{seed:structuredClone(d.mockSeed)}:{},...d.mockGenerate!==void 0?{generate:d.mockGenerate}:{}}}:{}}),r.push(d.id)}n.connections=c}let i=[];if(e.shellVariant){let c=sT(t.variantRegistry,e.shellVariant,t.shellFamilyId??"shell.workspace.v1");if(!c)throw Error(`unknown-shell-variant:${e.shellVariant}`);let d=lt(t.variantRegistry??[c],{spec:n,familyId:c.familyId,target:{kind:"shell"},targetVariantId:e.shellVariant});if(n=d.spec,i.push(...d.unmappedWarnings),e.layout)n.layout={...n.layout,...structuredClone(e.layout)}}let o=Boolean(e.shellVariant||n.layout),s=new Set,a=[],l=[];for(let c of e.pages){if(c.kind==="blocks"||c.kind===void 0&&"blocks"in c){let R=c,U=ig(R.path);if(n.pages.some((on)=>on.id===R.id||on.path===U)||oT.has(R.id))throw Error(`solution-page-conflict:${R.id}:${U}`);let L={id:R.id,path:U,...R.title!==void 0?{title:R.title}:{},...R.standalone?{layout:{inherit:!1}}:{},...R.state?{state:structuredClone(R.state)}:{},blocks:structuredClone(R.blocks)};og(L.blocks,L.id,s);let B=!R.standalone&&(R.wrapInShell??o);if(sg(L,B,s,e.title),n.pages.push(L),a.push({id:L.id,path:L.path}),!R.standalone)l.push({id:L.id,label:L.title??L.id,path:L.path});continue}let p=c,{family:m,variant:u}=aT(t.variantRegistry,p),f=t.solutions??[],g=p.solutionId?f.find((R)=>R.id===p.solutionId):void 0;if(!g&&u?.resourceId?.startsWith("template:")){let R=u.resourceId.slice(9);g=f.find((U)=>U.id===R)}let h,b=p.solutionId?`template:${p.solutionId}`:u?.resourceId;if(g){if(h=structuredClone(g.spec),h.auth)n.auth??=structuredClone(h.auth),delete h.auth}else if(u?.pageTemplate)h={version:"2.0",pages:[structuredClone(u.pageTemplate)]},b??=`variant:${m?.familyId??"page"}:${u.id}`;if(!h||h.pages.length===0||!b)throw Error(`unknown-blueprint-solution:${p.solutionId??`${p.familyId??""}:${p.variantId??""}`}`);let y=p.selectedPageIds?h.pages.filter((R)=>p.selectedPageIds?.includes(R.id)):h.pages;if(y.length===0)throw Error("solution-select-pages");let v={...p.connectionBindings};for(let R of h.connections??[]){if(v[R.id])continue;let U=n.connections?.find((B)=>B.id===R.id&&B.entity===R.entity);if(U){v[R.id]=U.id;continue}let L=n.connections?.filter((B)=>B.entity===R.entity)??[];if(L.length===1&&L[0])v[R.id]=L[0].id;else v[R.id]=R.id}let k={...p.pathBindings},S={};if(y.length===1&&y[0]){let R=y[0];if(p.id)S[R.id]=p.id;if(p.path)k[R.path]=ig(p.path)}for(let R of y){let U=S[R.id]??R.id;og(R.blocks,U,s)}let x=n.auth?structuredClone(n.auth):void 0;if(x)delete n.auth;let T=u?.identity??{resourceId:b,version:"0.22.0",sourceHash:Fi(_(h))},C=Wm(n,{identity:T,spec:h,...g?.controls?{controls:g.controls}:{}},{...p.selectedPageIds?{selectedPageIds:p.selectedPageIds}:{},...Object.keys(k).length?{paths:k}:{},...Object.keys(S).length?{pageIds:S}:{},connections:v,layout:"target",...p.configuration?{configuration:p.configuration}:{}});if(n=C.spec,x)n.auth=x;for(let R of C.connections)if(!r.includes(R.id))r.push(R.id);for(let R of C.pages){let U=R.id;if(m&&u&&u.resourceId!==b){let B=lt(t.variantRegistry??[m],{spec:n,familyId:m.familyId,target:{kind:"page",pageId:U},targetVariantId:u.id});n=B.spec,i.push(...B.unmappedWarnings)}else if(m&&u)n.composition??={schema:"uibot.solution-composition.v1",pages:[]},n.composition.variants=[...(n.composition.variants??[]).filter((B)=>!(B.targetKind==="page"&&B.targetId===U&&B.familyId===m.familyId)),{familyId:m.familyId,variantId:u.id,targetKind:"page",targetId:U}];let L=n.pages.find((B)=>B.id===U);if(L){if(p.title!==void 0&&C.pages.length===1)L.title=p.title;if(p.standalone)L.layout={...L.layout,inherit:!1};_a(L.blocks,s);let B=!p.standalone&&(p.wrapInShell??o);if(sg(L,B,s,e.title),a.push({id:L.id,path:L.path}),!p.standalone)l.push({id:L.id,label:L.title??L.id,path:L.path})}}}for(let c of n.connections??[])if(!n.data?.entities||!Object.hasOwn(n.data.entities,c.entity))throw Error(`blueprint-missing-entity:${c.entity}`);if(!n.menus&&l.length>0&&o)n.menus={items:l.map((c)=>({key:`nav-${c.id}`,label:c.label,path:c.path}))};return W(n),{spec:n,addedPages:a,addedConnections:r,unmappedWarnings:i}}var n2=new TextDecoder("utf-8",{fatal:!0});var lg={ChatWorkspace:{name:"ChatWorkspace",description:"Interactive chat over a host-owned transport; optional isolated local demonstration.",category:"feature",level:"L2",props:{bindingId:{type:"string",default:"chat"},variant:{enum:["focused","history","knowledge","support","artifact","copilot"],default:"focused"},title:{type:"string",default:"Assistant"},showSuggestions:{type:"boolean",default:!0},previewState:{enum:["ready","empty","loading","error","readonly"],default:"ready"}},events:{},constraints:["The host must authorize the binding and inject a transport. Demo responses are local fixtures, never model results."],tags:["interactive","chat","assistant","knowledge"]}};var Da=[["focused","专注单会话","Focused conversation"],["history","历史会话助手","Conversation workspace"],["knowledge","引用型知识问答","Knowledge questions"],["support","客服会话工作台","Support conversations"],["artifact","聊天与作品双栏","Chat beside your work"]].map(([e,t,n])=>{let r=`chat-${e}`;return{id:r,title:{zh:t,en:n},description:`${n}: shared message rendering, composer, local streaming demonstration and explicit host transport.`,solution:{functions:["chat"],scenarios:[e],unit:"page",industries:e==="support"?["support"]:e==="knowledge"?["knowledge","education"]:["creation"],readiness:"interactive-demo",hostRequirements:["Authorized chat binding","Host model transport and cancellation","Host conversation persistence",...e==="knowledge"?["Authorized context[].id values and source-document/source-url parts with matching sourceId; send.contextId is a selection hint, never authorization"]:[]],limitations:["Preview replies and context are local demonstration data.","Attachments, retrieval, customer records and artifact persistence require additional host integration."]},spec:{version:"2.0",pages:[{id:r,path:`/${r}`,title:n,blocks:[{id:`${r}-surface`,type:"ChatWorkspace",props:{bindingId:"chat",variant:e,title:n,showSuggestions:!0,previewState:"ready"}}]}]},controls:[{id:"layout",label:{zh:"会话布局",en:"Conversation layout"},values:["focused","history","knowledge","support","artifact"],target:{pageId:r,blockId:`${r}-surface`,property:"variant"}},{id:"suggestions",label:{zh:"建议问题",en:"Suggestions"},values:[!0,!1],target:{pageId:r,blockId:`${r}-surface`,property:"showSuggestions"}},{id:"state",label:{zh:"演示状态",en:"Demo state"},values:["ready","empty","loading","error","readonly"],target:{pageId:r,blockId:`${r}-surface`,property:"previewState"}}]}}),dg={schema:"uibot.variant-contract.v1",familyId:"ai.chat.v1",level:"L3",targetKind:"page",title:{zh:"AI 会话工作台",en:"AI chat workspaces"},description:"Five swappable ChatWorkspace layouts sharing host bindingId, composer controls, demo state and events.",presentationProps:["variant"],semanticSlots:[{id:"bindingId",label:{zh:"对话传输绑定",en:"Host binding ID"},required:!0,preserveMode:"always"},{id:"workspaceTitle",label:{zh:"工作台标题",en:"Workspace title"},preserveMode:"when-customized"},{id:"showSuggestions",label:{zh:"显示建议问题",en:"Show suggestions"},preserveMode:"when-customized"},{id:"previewState",label:{zh:"演示状态",en:"Preview state"},preserveMode:"when-customized"},{id:"workspaceEvents",label:{zh:"对话事件处理",en:"Workspace events"},preserveMode:"when-customized"}],variants:Da.map((e)=>{let t=e.id.replace(/^chat-/,""),n=e.spec.pages[0];if(!n)throw Error(`missing-chat-solution-page:${e.id}`);return{id:t,title:e.title,description:e.description,resourceId:`template:${e.id}`,slotBindings:{bindingId:{kind:"block-prop",blockType:"ChatWorkspace",occurrence:0,property:"bindingId"},workspaceTitle:{kind:"block-prop",blockType:"ChatWorkspace",occurrence:0,property:"title"},showSuggestions:{kind:"block-prop",blockType:"ChatWorkspace",occurrence:0,property:"showSuggestions"},previewState:{kind:"block-prop",blockType:"ChatWorkspace",occurrence:0,property:"previewState"},workspaceEvents:{kind:"block-events",blockType:"ChatWorkspace",occurrence:0}},pageTemplate:structuredClone(n)}})};var pg=[{id:"RUN-401",title:"Release notes synthesis",status:"completed",model:"gpt-6.2-sol",score:"96 / 100",latencyMs:"1,240 ms",summary:"Compiled 14 PR diffs into changelog sections with 0 citation drift.",version:1},{id:"RUN-402",title:"Support ticket triage batch",status:"running",model:"gemini-3.1-flash",score:"91 / 100",latencyMs:"680 ms",summary:"Classifying 48 inbound support threads with confidence thresholds.",version:1},{id:"RUN-403",title:"SQL migration policy audit",status:"failed",model:"claude-4.5-sonnet",score:"54 / 100",latencyMs:"2,110 ms",summary:"Tool guard blocked destructive DROP statement pending human approval.",version:1}],lT={entities:{agentRuns:{key:"id",version:"version",fields:{id:{type:"string",readOnly:!0},version:{type:"number",readOnly:!0},title:{type:"string"},status:{type:"string"},model:{type:"string"},score:{type:"string"},latencyMs:{type:"string"},summary:{type:"string"}}}}};function La(){return[{action:"Request",params:{connectionId:"agent-runs-db",request:{id:"find-agent-runs",connectionId:"agent-runs-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"}}]}function cT(){return{rows:structuredClone(pg),loading:!1,uiError:"",statusFilter:"all",selectedRunId:"RUN-401",promptDraft:"Summarize failed tool calls and propose safe retry parameters.",newRunTitle:"Regression eval batch",newRunModel:"gpt-6.2-sol"}}function dT(){return{filteredRuns:{_filter:[{_state:"rows"},{_or:[{_eq:[{_state:"statusFilter"},"all"]},{_eq:[{_item:"status"},{_state:"statusFilter"}]}]}]}}}function pT(){return[{id:"ai-ops-root",type:"Box",props:{className:"mx-auto flex max-w-6xl flex-col gap-6 p-6"},children:[{id:"ai-ops-header",type:"Box",props:{className:"flex flex-wrap items-center justify-between gap-3"},children:[{id:"ai-ops-heading-group",type:"Box",props:{className:"flex flex-col gap-1"},children:[{id:"ai-ops-title",type:"Heading",props:{level:1,text:"Agent run console"}},{id:"ai-ops-subtitle",type:"Paragraph",props:{muted:!0,size:"sm",text:"Monitor live agent executions, inspect tool failures, and intervene with the embedded operator copilot."}}]},{id:"ai-ops-trigger-btn",type:"Button",props:{label:"Trigger test run",size:"sm"},events:{onClick:[{action:"Request",params:{connectionId:"agent-runs-db",request:{id:"insert-agent-run",connectionId:"agent-runs-db",payload:{operation:"InsertOne",data:{title:{_state:"newRunTitle"},status:"completed",model:{_state:"newRunModel"},score:"94 / 100",latencyMs:"920 ms",summary:"Triggered from Agent run console demonstration toolbar."}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:La()}]}}]},{id:"ai-ops-stats",type:"Box",props:{className:"grid gap-4 sm:grid-cols-3"},children:[{id:"ai-stat-pass",type:"Stat",props:{label:"Completion rate",value:"96.4%",change:"+1.8%",trend:"up"}},{id:"ai-stat-latency",type:"Stat",props:{label:"Median latency",value:"1.12 s",change:"-140 ms",trend:"down"}},{id:"ai-stat-guard",type:"Stat",props:{label:"Guardrail intercepts",value:"1",description:"Pending review"}}]},{id:"ai-ops-filter",type:"Form.Select",props:{name:"statusFilter",label:"Execution status",value:{_bindState:"statusFilter"},options:[{value:"all",label:"All runs"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}]}},{id:"ai-ops-table",type:"DataTable",props:{label:"Agent runs",rowKey:"id",searchable:!0,searchPlaceholder:"Filter runs by title or model…",searchKeys:["id","title","model","status"],columns:[{key:"id",label:"Run ID"},{key:"title",label:"Task"},{key:"model",label:"Model"},{key:"status",label:"Status"},{key:"latencyMs",label:"Latency"},{key:"score",label:"Eval score"}],rows:{_computed:"filteredRuns"}}},{id:"ai-ops-chat",type:"ChatWorkspace",props:{bindingId:"agent-console",variant:"focused",title:"Run operator copilot",showSuggestions:!0,previewState:"ready"}}]}]}function uT(){return[{id:"ai-ops-root",type:"Box",props:{className:"mx-auto flex max-w-6xl flex-col gap-6 p-6"},children:[{id:"ai-ops-header",type:"Box",props:{className:"flex flex-wrap items-center justify-between gap-3"},children:[{id:"ai-ops-heading-group",type:"Box",props:{className:"flex flex-col gap-1"},children:[{id:"ai-ops-title",type:"Heading",props:{level:1,text:"Prompt evaluation workbench"}},{id:"ai-ops-subtitle",type:"Paragraph",props:{muted:!0,size:"sm",text:"Iterate on system prompts, compare case scores side-by-side, and log new evaluation runs."}}]},{id:"ai-ops-trigger-btn",type:"Button",props:{label:"Run evaluation case",size:"sm"},events:{onClick:[{action:"Request",params:{connectionId:"agent-runs-db",request:{id:"insert-eval-run",connectionId:"agent-runs-db",payload:{operation:"InsertOne",data:{title:{_state:"newRunTitle"},status:"completed",model:{_state:"newRunModel"},score:"95 / 100",latencyMs:"870 ms",summary:{_state:"promptDraft"}}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:La()}]}}]},{id:"ai-eval-prompt-card",type:"Card",props:{title:"Candidate prompt & filter",description:"Draft prompt instructions and filter evaluation cases by status."},children:[{id:"ai-eval-prompt-input",type:"Form.TextArea",props:{name:"promptDraft",label:"System prompt template",value:{_bindState:"promptDraft"}}},{id:"ai-ops-filter",type:"Form.Select",props:{name:"statusFilter",label:"Case status",value:{_bindState:"statusFilter"},options:[{value:"all",label:"All cases"},{value:"completed",label:"Passed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"}]}}]},{id:"ai-eval-master-detail",type:"RecordMasterDetail",props:{label:"Evaluation cases",rows:{_computed:"filteredRuns"},selectedId:{_state:"selectedRunId"},titleField:"title",subtitleField:"model",badgeField:"score",fields:[{key:"id",label:"Case ID"},{key:"status",label:"Status"},{key:"model",label:"Model"},{key:"latencyMs",label:"Latency"},{key:"summary",label:"Evaluation notes"}]},events:{onSelect:[{action:"SetState",params:{path:"selectedRunId",value:{_event:"id"}}}]}},{id:"ai-ops-chat",type:"ChatWorkspace",props:{bindingId:"agent-console",variant:"focused",title:"Prompt test sandbox",showSuggestions:!0,previewState:"ready"}}]}]}function Ba(e){let t=e==="agent-run-console"?"Agent Run Console":"Prompt Evaluation Workbench";return{id:"ai-workspace",path:`/${e}`,title:t,lifecycle:{onMount:La()},state:cT(),computed:dT(),blocks:[{id:"ai-workspace-shell",type:"PageLayout",props:{title:t,appearance:"admin",routes:[{label:t,href:`/${e}`}]},children:e==="agent-run-console"?pT():uT()}]}}function cg(e){return{version:"2.0",data:structuredClone(lT),connections:[{id:"agent-runs-db",type:"Collection",entity:"agentRuns",mock:{seed:structuredClone(pg)}}],pages:[Ba(e)]}}var ug=[{id:"agent-run-console",title:{zh:"智能体运行监控台",en:"Agent run console"},description:"AI operations console combining Collection-backed agent run telemetry, status filtering, and an embedded operator ChatWorkspace.",solution:{functions:["chat","tasks"],scenarios:["copilot","execution"],unit:"page",industries:["admin","creation"],readiness:"interactive-demo",hostRequirements:["Bind `agent-runs-db` Collection to host agent run telemetry and wire `agent-console` chat transport"],limitations:["Run telemetry and operator replies use local demonstration data until connected to a host backend"]},spec:cg("agent-run-console"),controls:[]},{id:"prompt-eval-workbench",title:{zh:"Prompt 评测工作台",en:"Prompt evaluation workbench"},description:"Prompt iteration and case-by-case evaluation workbench with master-detail scoring and embedded sandbox chat, hot-swappable with agent-run-console.",solution:{functions:["chat","analytics"],scenarios:["copilot","metrics"],unit:"page",industries:["creation","knowledge"],readiness:"interactive-demo",hostRequirements:["Connect evaluation runner persistence to `agent-runs-db` and bind `agent-console` to your host LLM endpoint"],limitations:["Evaluation cases run against local mock seeds without invoking external LLM providers"]},spec:cg("prompt-eval-workbench"),controls:[]}],mg={schema:"uibot.variant-contract.v1",familyId:"ai.workspace.v1",level:"L3",targetKind:"page",title:{zh:"AI 智能体运维与评测台",en:"AI agent ops & eval workbenches"},description:"Swappable AI-native operational pages (agent run console ↔ prompt evaluation workbench) sharing run Collection data and ChatWorkspace binding.",semanticSlots:[{id:"pageTitle",label:{zh:"页面标题",en:"Page title"},preserveMode:"when-customized"},{id:"bindingId",label:{zh:"助手传输绑定",en:"Chat binding ID"},required:!0,preserveMode:"always"},{id:"pageState",label:{zh:"筛选与草稿状态",en:"Filter & draft state"},preserveMode:"when-customized"},{id:"pageComputed",label:{zh:"派生列表",en:"Computed runs"},preserveMode:"always"},{id:"pageLifecycle",label:{zh:"初始加载",en:"Initial query"},preserveMode:"always"},{id:"pagePath",label:{zh:"页面路由",en:"Route path"},preserveMode:"when-customized"}],variants:[{id:"agent-run-console",aliases:["run-console","agent-ops"],title:{zh:"智能体运行监控台",en:"Agent run console"},description:"KPI strip, searchable agent runs table, and embedded operator copilot.",resourceId:"template:agent-run-console",slotBindings:{pageTitle:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},bindingId:{kind:"block-prop",blockType:"ChatWorkspace",occurrence:0,property:"bindingId"},pageState:{kind:"page-field",property:"state"},pageComputed:{kind:"page-field",property:"computed"},pageLifecycle:{kind:"page-field",property:"lifecycle"},pagePath:{kind:"page-field",property:"path"}},pageTemplate:Ba("agent-run-console")},{id:"prompt-eval-workbench",aliases:["prompt-eval","eval-workbench"],title:{zh:"Prompt 评测工作台",en:"Prompt eval workbench"},description:"Prompt template editor, master-detail eval case inspector, and test sandbox chat.",resourceId:"template:prompt-eval-workbench",slotBindings:{pageTitle:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},bindingId:{kind:"block-prop",blockType:"ChatWorkspace",occurrence:0,property:"bindingId"},pageState:{kind:"page-field",property:"state"},pageComputed:{kind:"page-field",property:"computed"},pageLifecycle:{kind:"page-field",property:"lifecycle"},pagePath:{kind:"page-field",property:"path"}},pageTemplate:Ba("prompt-eval-workbench")}]};var gg={id:"dashboard",path:"/",title:"Dashboard",state:{direction:"ltr",font:"Inter",theme:"light",currentPath:"/"},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Dashboard"}}]},{type:"Button",props:{label:"Download",disabled:!0}}]},{type:"Tabs",props:{tabs:["Overview","Analytics","Reports","Notifications"],disabledTabs:[2,3],variant:"segmented"},children:[{type:"Box",props:{gap:"md"},children:[{type:"Box",props:{className:"!grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4"},children:[{type:"StatCard",props:{label:"Total Revenue",value:"$45,231.89",description:"+20.1% from last month",icon:"chart-no-axes-column"}},{type:"StatCard",props:{label:"Subscriptions",value:"+2350",description:"+180.1% from last month",icon:"users"}},{type:"StatCard",props:{label:"Sales",value:"+12,234",description:"+19% from last month",icon:"boxes"}},{type:"StatCard",props:{label:"Active Now",value:"+573",description:"+201 since last hour",icon:"chart-no-axes-column"}}]},{type:"Box",props:{className:"!grid grid-cols-1 gap-4 lg:grid-cols-7"},children:[{type:"Box",props:{className:"lg:col-span-4"},children:[{type:"Card",props:{title:"Overview"},children:[{type:"BarChart",props:{prefix:"$",height:350,data:[{label:"Jan",value:1500},{label:"Feb",value:5800},{label:"Mar",value:5500},{label:"Apr",value:2200},{label:"May",value:4800},{label:"Jun",value:1600},{label:"Jul",value:2800},{label:"Aug",value:2300},{label:"Sep",value:5700},{label:"Oct",value:1400},{label:"Nov",value:2900},{label:"Dec",value:1900}]}}]}]},{type:"Box",props:{className:"lg:col-span-3"},children:[{type:"Card",props:{title:"Recent Sales",description:"You made 265 sales this month."},children:[{type:"AvatarList",props:{items:[{id:"0",initials:"OM",name:"Olivia Martin",description:"olivia.martin@email.com",value:"+$1,999.00"},{id:"1",initials:"JL",name:"Jackson Lee",description:"jackson.lee@email.com",value:"+$39.00"},{id:"2",initials:"IN",name:"Isabella Nguyen",description:"isabella.nguyen@email.com",value:"+$299.00"},{id:"3",initials:"WK",name:"William Kim",description:"will@email.com",value:"+$99.00"},{id:"4",initials:"SD",name:"Sofia Davis",description:"sofia.davis@email.com",value:"+$39.00"}]}}]}]}]}]},{type:"Box",props:{gap:"md"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Analytics"}},{type:"Paragraph",props:{text:"Revenue and subscription performance.",muted:!0,size:"sm"}}]}]},{type:"Box",props:{className:"!grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4"},children:[{type:"StatCard",props:{label:"Total Revenue",value:"$45,231.89",description:"+20.1% from last month",icon:"chart-no-axes-column"}},{type:"StatCard",props:{label:"Subscriptions",value:"+2350",description:"+180.1% from last month",icon:"users"}},{type:"StatCard",props:{label:"Sales",value:"+12,234",description:"+19% from last month",icon:"boxes"}},{type:"StatCard",props:{label:"Active Now",value:"+573",description:"+201 since last hour",icon:"chart-no-axes-column"}}]},{type:"Card",props:{title:"Revenue over time"},children:[{type:"BarChart",props:{prefix:"$",data:[{label:"Apr",value:18200},{label:"May",value:21400},{label:"Jun",value:28000},{label:"Jul",value:26200},{label:"Aug",value:31500},{label:"Sep",value:45231}]}}]}]}]}],template:"shadcn-admin-shell"}]};var fg={id:"tasks",lifecycle:{onMount:[{action:"Request",params:{connectionId:"tasks-db",request:{id:"load-tasks",connectionId:"tasks-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]},path:"/tasks",title:"Tasks",state:{direction:"ltr",font:"Inter",selectionEvent:null,theme:"light",currentPath:"/tasks",rows:[{id:"TASK-8782",title:"Document release rollback steps",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8783",title:"Fix keyboard focus in the task drawer",label:"bug",status:"todo",priority:"high"},{id:"TASK-8784",title:"Add status filters to the task list",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8785",title:"Update deployment checklist",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8786",title:"Investigate duplicate task submissions",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8787",title:"Add saved table views",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8788",title:"Document task priority definitions",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8789",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8790",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8791",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8792",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8793",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"feature",status:"todo",priority:"low"},{id:"TASK-8794",title:"We need to bypass the neural TCP card!",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8795",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"bug",status:"done",priority:"high"},{id:"TASK-8796",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8797",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8798",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"bug",status:"todo",priority:"high"},{id:"TASK-8799",title:"Update the onboarding documentation for team members.",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8800",title:"Review project permissions before the next release.",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8801",title:"Make the settings form usable with keyboard navigation.",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8802",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8803",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8804",title:"We need to bypass the neural TCP card!",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8805",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"feature",status:"done",priority:"low"},{id:"TASK-8806",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8807",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8808",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"feature",status:"todo",priority:"low"},{id:"TASK-8809",title:"Update the onboarding documentation for team members.",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8810",title:"Review project permissions before the next release.",label:"bug",status:"done",priority:"high"},{id:"TASK-8811",title:"Make the settings form usable with keyboard navigation.",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8812",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8813",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"bug",status:"todo",priority:"high"},{id:"TASK-8814",title:"We need to bypass the neural TCP card!",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8815",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8816",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8817",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8818",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8819",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8820",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8821",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8822",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8823",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"feature",status:"todo",priority:"low"},{id:"TASK-8824",title:"We need to bypass the neural TCP card!",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8825",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"bug",status:"done",priority:"high"},{id:"TASK-8826",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8827",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8828",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"bug",status:"todo",priority:"high"},{id:"TASK-8829",title:"Update the onboarding documentation for team members.",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8830",title:"Review project permissions before the next release.",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8831",title:"Make the settings form usable with keyboard navigation.",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8832",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8833",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8834",title:"We need to bypass the neural TCP card!",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8835",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"feature",status:"done",priority:"low"},{id:"TASK-8836",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8837",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8838",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"feature",status:"todo",priority:"low"},{id:"TASK-8839",title:"Update the onboarding documentation for team members.",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8840",title:"Review project permissions before the next release.",label:"bug",status:"done",priority:"high"},{id:"TASK-8841",title:"Make the settings form usable with keyboard navigation.",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8842",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8843",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"bug",status:"todo",priority:"high"},{id:"TASK-8844",title:"We need to bypass the neural TCP card!",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8845",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8846",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8847",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8848",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8849",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8850",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8851",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8852",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8853",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"feature",status:"todo",priority:"low"},{id:"TASK-8854",title:"We need to bypass the neural TCP card!",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8855",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"bug",status:"done",priority:"high"},{id:"TASK-8856",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8857",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8858",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"bug",status:"todo",priority:"high"},{id:"TASK-8859",title:"Update the onboarding documentation for team members.",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8860",title:"Review project permissions before the next release.",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8861",title:"Make the settings form usable with keyboard navigation.",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8862",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8863",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8864",title:"We need to bypass the neural TCP card!",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8865",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"feature",status:"done",priority:"low"},{id:"TASK-8866",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8867",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8868",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"feature",status:"todo",priority:"low"},{id:"TASK-8869",title:"Update the onboarding documentation for team members.",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8870",title:"Review project permissions before the next release.",label:"bug",status:"done",priority:"high"},{id:"TASK-8871",title:"Make the settings form usable with keyboard navigation.",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8872",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8873",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"bug",status:"todo",priority:"high"},{id:"TASK-8874",title:"We need to bypass the neural TCP card!",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8875",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8876",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8877",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8878",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8879",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8880",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8881",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"}],editorOpen:!1,deleteOpen:!1,draft:{},loading:!1,saving:!1,uiError:null,tableView:"",serverMode:!1,selectedIds:[],total:null,hasNextPage:!1,reloadRequested:0,pageNotice:"",bulkOpen:!1,bulkRequest:null,bulkSubmit:!1,bulkAction:"",bulkStatus:"backlog",bulkSummary:"",bulkError:null,bulkConfirmDisabled:!0,bulkDisabled:!0,bulkUnavailable:"Select records with known versions to enable batch actions."},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Tasks"}},{type:"Paragraph",props:{text:"Sample tasks for triage and prioritization.",muted:!0,size:"sm"}}]},{type:"Button",props:{label:"Create",variant:"default"},events:{onClick:[{action:"SetState",params:{path:"draft",value:{action:"create"}}},{action:"SetState",params:{path:"uiError",value:null}},{action:"SetState",params:{path:"editorOpen",value:!0}}]}}]},{type:"Paragraph",visible:{_state:"serverMode"},props:{text:{_state:"pageNotice"},muted:!0,size:"sm"}},{type:"DataTable",props:{server:{_state:"serverMode"},total:{_state:"total"},hasNextPage:{_state:"hasNextPage"},selectedIds:{_if:[{_state:"serverMode"},{_state:"selectedIds"},null]},rows:{_state:"rows"},loading:{_state:"loading"},error:{_state:"uiError.message"},columns:[{key:"id",label:"Task",kind:"muted"},{key:"title",label:"Title",kind:"text",badgeKey:"label"},{key:"status",label:"Status",kind:"badge"},{key:"priority",label:"Priority",kind:"text"}],filters:[{key:"status",label:"Status",options:[{value:"backlog",label:"Backlog"},{value:"todo",label:"Todo"},{value:"in progress",label:"In Progress"},{value:"done",label:"Done"},{value:"canceled",label:"Canceled"}]},{key:"priority",label:"Priority",options:[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]}],searchKeys:["id","title"],searchPlaceholder:"Filter tasks...",actions:[{id:"edit",label:"Edit"},{id:"delete",label:"Delete"}],bulkActions:{_if:[{_state:"serverMode"},[{id:"delete",label:"Delete selected",disabled:{_state:"bulkDisabled"}},{id:"status",label:"Change status",disabled:{_state:"bulkDisabled"}}],[{id:"delete",label:"Delete selected",disabled:!0}]]},view:{_state:"tableView"},minWidth:950},events:{onRowAction:[{action:"SetState",params:{path:"uiError",value:null}},{action:"SetState",params:{path:"draft",value:{_event:"values"}}},{action:"SetState",params:{path:"editorOpen",value:{_eq:[{_state:"draft.action"},"edit"]}}},{action:"SetState",params:{path:"deleteOpen",value:{_eq:[{_state:"draft.action"},"delete"]}}}],onBulkAction:[{action:"SetState",params:{path:"bulkRequest",value:{_event:"values"}}}],onSelectionChange:[{action:"SetState",params:{path:"selectionEvent",value:{_event:"values"}}},{action:"SetState",params:{path:"selectedIds",value:{_state:"selectionEvent.ids"}}}],onViewChange:[{action:"SetState",params:{path:"tableView",value:{_event:"value"}}}]}},{type:"Paragraph",visible:{_state:"serverMode"},props:{text:{_state:"bulkUnavailable"},muted:!0,size:"sm"}},{type:"Button",visible:{_state:"serverMode"},props:{label:"Reload first page",variant:"outline",disabled:{_or:[{_state:"loading"},{_state:"saving"}]}},events:{onClick:[{action:"SetState",params:{path:"reloadRequested",value:{_not:{_state:"reloadRequested"}}}}]}},{type:"Modal",props:{open:{_state:"bulkOpen"},pending:{_state:"saving"},title:{_if:[{_eq:[{_state:"bulkAction"},"delete"]},"Delete selected records?","Change selected status?"]},description:"Review the selected IDs, versions and change before confirming."},children:[{type:"Field",visible:{_eq:[{_state:"bulkAction"},"status"]},props:{name:"bulkStatus",label:"New status",kind:"select",value:{_bindState:"bulkStatus"},disabled:{_state:"saving"},options:[{value:"backlog",label:"Backlog"},{value:"todo",label:"Todo"},{value:"in progress",label:"In Progress"},{value:"done",label:"Done"},{value:"canceled",label:"Canceled"}]}},{type:"Paragraph",props:{text:{_state:"bulkSummary"},className:"whitespace-pre-wrap break-all max-h-48 overflow-auto font-mono text-xs"}},{type:"Paragraph",visible:{_state:"bulkError"},props:{text:{_state:"bulkError.message"},className:"text-destructive"}},{type:"Box",props:{direction:"row",justify:"end"},children:[{type:"Button",props:{label:"Cancel",variant:"outline",disabled:{_state:"saving"}},events:{onClick:[{action:"SetState",params:{path:"bulkOpen",value:!1}}]}},{type:"Button",props:{label:"Confirm batch",disabled:{_state:"bulkConfirmDisabled"}},events:{onClick:[{action:"SetState",params:{path:"bulkSubmit",value:{_not:{_state:"bulkSubmit"}}}}]}}]}],events:{onClose:[{action:"SetState",params:{path:"bulkOpen",value:!1}}]}},{type:"Drawer",props:{open:{_state:"editorOpen"},pending:{_state:"saving"},title:"Create or edit task",description:"Update the details below. Click save when you’re done."},children:[{type:"Form",props:{label:"Record details",pending:{_state:"saving"},idempotent:!0},children:[{type:"Field",props:{name:"title",label:"Title",kind:"text",value:{_bindState:"draft.title"},required:!0}},{type:"Field",props:{name:"label",label:"Label",kind:"select",value:{_bindState:"draft.label"},required:!0,options:[{value:"documentation",label:"Documentation"},{value:"bug",label:"Bug"},{value:"feature",label:"Feature"}]}},{type:"Field",props:{name:"status",label:"Status",kind:"select",value:{_bindState:"draft.status"},required:!0,options:[{value:"backlog",label:"Backlog"},{value:"todo",label:"Todo"},{value:"in progress",label:"In Progress"},{value:"done",label:"Done"},{value:"canceled",label:"Canceled"}]}},{type:"Field",props:{name:"priority",label:"Priority",kind:"radio",value:{_bindState:"draft.priority"},required:!0,options:[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0,size:"sm"},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Save changes",disabled:{_state:"saving"}}}],events:{onSubmit:[{action:"Request",params:{connectionId:"tasks-db",request:{id:"mutate-tasks",connectionId:"tasks-db",payload:{_if:[{_eq:[{_if:[{_eq:[{_state:"draft.action"},"create"]},"InsertOne","UpdateOne"]},"InsertOne"]},{operation:"InsertOne",data:{title:{_event:"values.title"},label:{_event:"values.label"},status:{_event:"values.status"},priority:{_event:"values.priority"}}},{operation:"UpdateOne",data:{title:{_event:"values.title"},label:{_event:"values.label"},status:{_event:"values.status"},priority:{_event:"values.priority"}},filter:{id:{_state:"draft.id"}},version:{_state:"draft.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"editorOpen",value:!1}},{action:"SetState",params:{path:"deleteOpen",value:!1}},{action:"Request",params:{connectionId:"tasks-db",request:{id:"load-tasks",connectionId:"tasks-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}}],events:{onClose:[{action:"SetState",params:{path:"editorOpen",value:!1}}]}},{type:"Modal",props:{open:{_state:"deleteOpen"},pending:{_state:"saving"},title:"Delete this record?",description:"This action cannot be undone. The record will be permanently removed."},children:[{type:"Paragraph",visible:{_state:"uiError"},props:{text:{_state:"uiError.message"},className:"text-destructive"}},{type:"Box",props:{direction:"row",justify:"end"},children:[{type:"Button",props:{label:"Cancel",variant:"outline",disabled:{_state:"saving"}},events:{onClick:[{action:"SetState",params:{path:"deleteOpen",value:!1}}]}},{type:"Button",props:{label:"Delete",variant:"destructive",disabled:{_state:"saving"}},events:{onClick:[{action:"Request",params:{connectionId:"tasks-db",request:{id:"mutate-tasks",connectionId:"tasks-db",payload:{operation:"DeleteOne",filter:{id:{_state:"draft.id"}},version:{_state:"draft.version"}}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"editorOpen",value:!1}},{action:"SetState",params:{path:"deleteOpen",value:!1}},{action:"Request",params:{connectionId:"tasks-db",request:{id:"load-tasks",connectionId:"tasks-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}}]}],events:{onClose:[{action:"SetState",params:{path:"deleteOpen",value:!1}}]}}],template:"shadcn-admin-shell"}],urlState:{tableView:{param:"view",default:""}}};var hg={id:"users",lifecycle:{onMount:[{action:"Request",params:{connectionId:"users-db",request:{id:"load-users",connectionId:"users-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]},path:"/users",title:"Users",state:{direction:"ltr",font:"Inter",selectionEvent:null,theme:"light",currentPath:"/users",rows:[{id:"user-1",username:"liam.anderson",firstName:"Liam",lastName:"Anderson",email:"liam.anderson@example.com",phoneNumber:"+1 (555) 010-0000",status:"active",role:"admin"},{id:"user-2",username:"olivia.baker",firstName:"Olivia",lastName:"Baker",email:"olivia.baker@example.com",phoneNumber:"+1 (555) 010-0001",status:"inactive",role:"manager"},{id:"user-3",username:"noah.carter",firstName:"Noah",lastName:"Carter",email:"noah.carter@example.com",phoneNumber:"+1 (555) 010-0002",status:"invited",role:"cashier"},{id:"user-4",username:"emma.davis",firstName:"Emma",lastName:"Davis",email:"emma.davis@example.com",phoneNumber:"+1 (555) 010-0003",status:"suspended",role:"superadmin"},{id:"user-5",username:"elijah.evans",firstName:"Elijah",lastName:"Evans",email:"elijah.evans@example.com",phoneNumber:"+1 (555) 010-0004",status:"active",role:"admin"},{id:"user-6",username:"amelia.foster",firstName:"Amelia",lastName:"Foster",email:"amelia.foster@example.com",phoneNumber:"+1 (555) 010-0005",status:"inactive",role:"manager"},{id:"user-7",username:"james.garcia",firstName:"James",lastName:"Garcia",email:"james.garcia@example.com",phoneNumber:"+1 (555) 010-0006",status:"invited",role:"cashier"},{id:"user-8",username:"charlotte.harris",firstName:"Charlotte",lastName:"Harris",email:"charlotte.harris@example.com",phoneNumber:"+1 (555) 010-0007",status:"suspended",role:"superadmin"},{id:"user-9",username:"william.irwin",firstName:"William",lastName:"Irwin",email:"william.irwin@example.com",phoneNumber:"+1 (555) 010-0008",status:"active",role:"admin"},{id:"user-10",username:"sophia.jones",firstName:"Sophia",lastName:"Jones",email:"sophia.jones@example.com",phoneNumber:"+1 (555) 010-0009",status:"inactive",role:"manager"},{id:"user-11",username:"benjamin.kim",firstName:"Benjamin",lastName:"Kim",email:"benjamin.kim@example.com",phoneNumber:"+1 (555) 010-0010",status:"invited",role:"cashier"},{id:"user-12",username:"isabella.lewis",firstName:"Isabella",lastName:"Lewis",email:"isabella.lewis@example.com",phoneNumber:"+1 (555) 010-0011",status:"suspended",role:"superadmin"},{id:"user-13",username:"liam.anderson",firstName:"Liam",lastName:"Anderson",email:"liam.anderson@example.com",phoneNumber:"+1 (555) 010-0012",status:"active",role:"admin"},{id:"user-14",username:"olivia.baker",firstName:"Olivia",lastName:"Baker",email:"olivia.baker@example.com",phoneNumber:"+1 (555) 010-0013",status:"inactive",role:"manager"},{id:"user-15",username:"noah.carter",firstName:"Noah",lastName:"Carter",email:"noah.carter@example.com",phoneNumber:"+1 (555) 010-0014",status:"invited",role:"cashier"},{id:"user-16",username:"emma.davis",firstName:"Emma",lastName:"Davis",email:"emma.davis@example.com",phoneNumber:"+1 (555) 010-0015",status:"suspended",role:"superadmin"},{id:"user-17",username:"elijah.evans",firstName:"Elijah",lastName:"Evans",email:"elijah.evans@example.com",phoneNumber:"+1 (555) 010-0016",status:"active",role:"admin"},{id:"user-18",username:"amelia.foster",firstName:"Amelia",lastName:"Foster",email:"amelia.foster@example.com",phoneNumber:"+1 (555) 010-0017",status:"inactive",role:"manager"},{id:"user-19",username:"james.garcia",firstName:"James",lastName:"Garcia",email:"james.garcia@example.com",phoneNumber:"+1 (555) 010-0018",status:"invited",role:"cashier"},{id:"user-20",username:"charlotte.harris",firstName:"Charlotte",lastName:"Harris",email:"charlotte.harris@example.com",phoneNumber:"+1 (555) 010-0019",status:"suspended",role:"superadmin"},{id:"user-21",username:"william.irwin",firstName:"William",lastName:"Irwin",email:"william.irwin@example.com",phoneNumber:"+1 (555) 010-0020",status:"active",role:"admin"},{id:"user-22",username:"sophia.jones",firstName:"Sophia",lastName:"Jones",email:"sophia.jones@example.com",phoneNumber:"+1 (555) 010-0021",status:"inactive",role:"manager"},{id:"user-23",username:"benjamin.kim",firstName:"Benjamin",lastName:"Kim",email:"benjamin.kim@example.com",phoneNumber:"+1 (555) 010-0022",status:"invited",role:"cashier"},{id:"user-24",username:"isabella.lewis",firstName:"Isabella",lastName:"Lewis",email:"isabella.lewis@example.com",phoneNumber:"+1 (555) 010-0023",status:"suspended",role:"superadmin"},{id:"user-25",username:"liam.anderson",firstName:"Liam",lastName:"Anderson",email:"liam.anderson@example.com",phoneNumber:"+1 (555) 010-0024",status:"active",role:"admin"},{id:"user-26",username:"olivia.baker",firstName:"Olivia",lastName:"Baker",email:"olivia.baker@example.com",phoneNumber:"+1 (555) 010-0025",status:"inactive",role:"manager"},{id:"user-27",username:"noah.carter",firstName:"Noah",lastName:"Carter",email:"noah.carter@example.com",phoneNumber:"+1 (555) 010-0026",status:"invited",role:"cashier"},{id:"user-28",username:"emma.davis",firstName:"Emma",lastName:"Davis",email:"emma.davis@example.com",phoneNumber:"+1 (555) 010-0027",status:"suspended",role:"superadmin"},{id:"user-29",username:"elijah.evans",firstName:"Elijah",lastName:"Evans",email:"elijah.evans@example.com",phoneNumber:"+1 (555) 010-0028",status:"active",role:"admin"},{id:"user-30",username:"amelia.foster",firstName:"Amelia",lastName:"Foster",email:"amelia.foster@example.com",phoneNumber:"+1 (555) 010-0029",status:"inactive",role:"manager"},{id:"user-31",username:"james.garcia",firstName:"James",lastName:"Garcia",email:"james.garcia@example.com",phoneNumber:"+1 (555) 010-0030",status:"invited",role:"cashier"},{id:"user-32",username:"charlotte.harris",firstName:"Charlotte",lastName:"Harris",email:"charlotte.harris@example.com",phoneNumber:"+1 (555) 010-0031",status:"suspended",role:"superadmin"},{id:"user-33",username:"william.irwin",firstName:"William",lastName:"Irwin",email:"william.irwin@example.com",phoneNumber:"+1 (555) 010-0032",status:"active",role:"admin"},{id:"user-34",username:"sophia.jones",firstName:"Sophia",lastName:"Jones",email:"sophia.jones@example.com",phoneNumber:"+1 (555) 010-0033",status:"inactive",role:"manager"},{id:"user-35",username:"benjamin.kim",firstName:"Benjamin",lastName:"Kim",email:"benjamin.kim@example.com",phoneNumber:"+1 (555) 010-0034",status:"invited",role:"cashier"},{id:"user-36",username:"isabella.lewis",firstName:"Isabella",lastName:"Lewis",email:"isabella.lewis@example.com",phoneNumber:"+1 (555) 010-0035",status:"suspended",role:"superadmin"}],editorOpen:!1,deleteOpen:!1,draft:{},loading:!1,saving:!1,uiError:null,tableView:"",serverMode:!1,selectedIds:[],total:null,hasNextPage:!1,reloadRequested:0,pageNotice:"",bulkOpen:!1,bulkRequest:null,bulkSubmit:!1,bulkAction:"",bulkStatus:"active",bulkSummary:"",bulkError:null,bulkConfirmDisabled:!0,bulkDisabled:!0,bulkUnavailable:"Select records with known versions to enable batch actions."},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Users"}},{type:"Paragraph",props:{text:"Manage your users and their roles here.",muted:!0,size:"sm"}}]},{type:"Button",props:{label:"Add User",variant:"default"},events:{onClick:[{action:"SetState",params:{path:"draft",value:{action:"create"}}},{action:"SetState",params:{path:"uiError",value:null}},{action:"SetState",params:{path:"editorOpen",value:!0}}]}}]},{type:"Paragraph",visible:{_state:"serverMode"},props:{text:{_state:"pageNotice"},muted:!0,size:"sm"}},{type:"DataTable",props:{server:{_state:"serverMode"},total:{_state:"total"},hasNextPage:{_state:"hasNextPage"},selectedIds:{_if:[{_state:"serverMode"},{_state:"selectedIds"},null]},rows:{_state:"rows"},loading:{_state:"loading"},error:{_state:"uiError.message"},columns:[{key:"username",label:"Username",kind:"muted"},{key:"firstName",displayKeys:["firstName","lastName"],label:"Name",kind:"text"},{key:"email",label:"Email",kind:"muted"},{key:"phoneNumber",label:"Phone Number",kind:"muted"},{key:"status",label:"Status",kind:"badge"},{key:"role",label:"Role",kind:"text"}],filters:[{key:"status",label:"Status",options:[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"invited",label:"Invited"},{value:"suspended",label:"Suspended"}]},{key:"role",label:"Role",options:[{value:"admin",label:"Admin"},{value:"manager",label:"Manager"},{value:"cashier",label:"Cashier"},{value:"superadmin",label:"Superadmin"}]}],searchKeys:["username","firstName","lastName","email"],searchPlaceholder:"Filter users...",actions:[{id:"edit",label:"Edit"},{id:"delete",label:"Delete"}],bulkActions:{_if:[{_state:"serverMode"},[{id:"delete",label:"Delete selected",disabled:{_state:"bulkDisabled"}},{id:"status",label:"Change status",disabled:{_state:"bulkDisabled"}}],[{id:"delete",label:"Delete selected",disabled:!0}]]},view:{_state:"tableView"},minWidth:950},events:{onRowAction:[{action:"SetState",params:{path:"uiError",value:null}},{action:"SetState",params:{path:"draft",value:{_event:"values"}}},{action:"SetState",params:{path:"editorOpen",value:{_eq:[{_state:"draft.action"},"edit"]}}},{action:"SetState",params:{path:"deleteOpen",value:{_eq:[{_state:"draft.action"},"delete"]}}}],onBulkAction:[{action:"SetState",params:{path:"bulkRequest",value:{_event:"values"}}}],onSelectionChange:[{action:"SetState",params:{path:"selectionEvent",value:{_event:"values"}}},{action:"SetState",params:{path:"selectedIds",value:{_state:"selectionEvent.ids"}}}],onViewChange:[{action:"SetState",params:{path:"tableView",value:{_event:"value"}}}]}},{type:"Paragraph",visible:{_state:"serverMode"},props:{text:{_state:"bulkUnavailable"},muted:!0,size:"sm"}},{type:"Button",visible:{_state:"serverMode"},props:{label:"Reload first page",variant:"outline",disabled:{_or:[{_state:"loading"},{_state:"saving"}]}},events:{onClick:[{action:"SetState",params:{path:"reloadRequested",value:{_not:{_state:"reloadRequested"}}}}]}},{type:"Modal",props:{open:{_state:"bulkOpen"},pending:{_state:"saving"},title:{_if:[{_eq:[{_state:"bulkAction"},"delete"]},"Delete selected records?","Change selected status?"]},description:"Review the selected IDs, versions and change before confirming."},children:[{type:"Field",visible:{_eq:[{_state:"bulkAction"},"status"]},props:{name:"bulkStatus",label:"New status",kind:"select",value:{_bindState:"bulkStatus"},disabled:{_state:"saving"},options:[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"invited",label:"Invited"},{value:"suspended",label:"Suspended"}]}},{type:"Paragraph",props:{text:{_state:"bulkSummary"},className:"whitespace-pre-wrap break-all max-h-48 overflow-auto font-mono text-xs"}},{type:"Paragraph",visible:{_state:"bulkError"},props:{text:{_state:"bulkError.message"},className:"text-destructive"}},{type:"Box",props:{direction:"row",justify:"end"},children:[{type:"Button",props:{label:"Cancel",variant:"outline",disabled:{_state:"saving"}},events:{onClick:[{action:"SetState",params:{path:"bulkOpen",value:!1}}]}},{type:"Button",props:{label:"Confirm batch",disabled:{_state:"bulkConfirmDisabled"}},events:{onClick:[{action:"SetState",params:{path:"bulkSubmit",value:{_not:{_state:"bulkSubmit"}}}}]}}]}],events:{onClose:[{action:"SetState",params:{path:"bulkOpen",value:!1}}]}},{type:"Drawer",props:{open:{_state:"editorOpen"},pending:{_state:"saving"},title:"Create or edit user",description:"Update the details below. Click save when you’re done."},children:[{type:"Form",props:{label:"Record details",pending:{_state:"saving"},idempotent:!0},children:[{type:"Field",props:{name:"username",label:"Username",kind:"text",value:{_bindState:"draft.username"},required:!0}},{type:"Field",props:{name:"firstName",label:"First name",kind:"text",value:{_bindState:"draft.firstName"},required:!0}},{type:"Field",props:{name:"lastName",label:"Last name",kind:"text",value:{_bindState:"draft.lastName"},required:!0}},{type:"Field",props:{name:"email",label:"Email",kind:"email",value:{_bindState:"draft.email"},required:!0}},{type:"Field",props:{name:"phoneNumber",label:"Phone Number",kind:"text",value:{_bindState:"draft.phoneNumber"},required:!0}},{type:"Field",props:{name:"status",label:"Status",kind:"select",value:{_bindState:"draft.status"},required:!0,options:[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"invited",label:"Invited"},{value:"suspended",label:"Suspended"}]}},{type:"Field",props:{name:"role",label:"Role",kind:"select",value:{_bindState:"draft.role"},required:!0,options:[{value:"admin",label:"Admin"},{value:"manager",label:"Manager"},{value:"cashier",label:"Cashier"},{value:"superadmin",label:"Superadmin"}]}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0,size:"sm"},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Save changes",disabled:{_state:"saving"}}}],events:{onSubmit:[{action:"Request",params:{connectionId:"users-db",request:{id:"mutate-users",connectionId:"users-db",payload:{_if:[{_eq:[{_if:[{_eq:[{_state:"draft.action"},"create"]},"InsertOne","UpdateOne"]},"InsertOne"]},{operation:"InsertOne",data:{username:{_event:"values.username"},firstName:{_event:"values.firstName"},lastName:{_event:"values.lastName"},email:{_event:"values.email"},phoneNumber:{_event:"values.phoneNumber"},status:{_event:"values.status"},role:{_event:"values.role"}}},{operation:"UpdateOne",data:{username:{_event:"values.username"},firstName:{_event:"values.firstName"},lastName:{_event:"values.lastName"},email:{_event:"values.email"},phoneNumber:{_event:"values.phoneNumber"},status:{_event:"values.status"},role:{_event:"values.role"}},filter:{id:{_state:"draft.id"}},version:{_state:"draft.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"editorOpen",value:!1}},{action:"SetState",params:{path:"deleteOpen",value:!1}},{action:"Request",params:{connectionId:"users-db",request:{id:"load-users",connectionId:"users-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}}],events:{onClose:[{action:"SetState",params:{path:"editorOpen",value:!1}}]}},{type:"Modal",props:{open:{_state:"deleteOpen"},pending:{_state:"saving"},title:"Delete this record?",description:"This action cannot be undone. The record will be permanently removed."},children:[{type:"Paragraph",visible:{_state:"uiError"},props:{text:{_state:"uiError.message"},className:"text-destructive"}},{type:"Box",props:{direction:"row",justify:"end"},children:[{type:"Button",props:{label:"Cancel",variant:"outline",disabled:{_state:"saving"}},events:{onClick:[{action:"SetState",params:{path:"deleteOpen",value:!1}}]}},{type:"Button",props:{label:"Delete",variant:"destructive",disabled:{_state:"saving"}},events:{onClick:[{action:"Request",params:{connectionId:"users-db",request:{id:"mutate-users",connectionId:"users-db",payload:{operation:"DeleteOne",filter:{id:{_state:"draft.id"}},version:{_state:"draft.version"}}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"editorOpen",value:!1}},{action:"SetState",params:{path:"deleteOpen",value:!1}},{action:"Request",params:{connectionId:"users-db",request:{id:"load-users",connectionId:"users-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}}]}],events:{onClose:[{action:"SetState",params:{path:"deleteOpen",value:!1}}]}}],template:"shadcn-admin-shell"}],urlState:{tableView:{param:"view",default:""}}};var yg={id:"apps",path:"/apps",title:"Apps",state:{direction:"ltr",font:"Inter",submitted:!1,theme:"light",currentPath:"/apps",integrationSettings:[],editorOpen:!1,draft:{},saving:!1,loading:!1,uiError:null},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"App Integrations"}},{type:"Paragraph",props:{text:"Here’s a list of your apps for the integration!",muted:!0,size:"sm"}}]}]},{type:"IntegrationGrid",props:{items:[{id:"telegram",brand:"telegram",name:"Telegram",description:"Connect with Telegram for real-time communication.",icon:"boxes",available:!1,connected:!1},{id:"notion",brand:"notion",name:"Notion",description:"Sync Notion pages for collaboration.",icon:"boxes",available:!1,connected:!1},{id:"figma",brand:"figma",name:"Figma",description:"View and collaborate on Figma designs in one place.",icon:"boxes",available:!1,connected:!1},{id:"trello",brand:"trello",name:"Trello",description:"Sync Trello cards for project management.",icon:"boxes",available:!1,connected:!1},{id:"slack",brand:"slack",name:"Slack",description:"Integrate Slack for team communication.",icon:"boxes",available:!1,connected:!1},{id:"zoom",brand:"zoom",name:"Zoom",description:"Host Zoom meetings from your dashboard.",icon:"boxes",available:!1,connected:!1},{id:"stripe",brand:"stripe",name:"Stripe",description:"Manage Stripe transactions and payments.",icon:"boxes",available:!1,connected:!1},{id:"gmail",brand:"gmail",name:"Gmail",description:"Access and manage Gmail messages.",icon:"boxes",available:!1,connected:!1},{id:"medium",brand:"medium",name:"Medium",description:"Explore and share Medium stories.",icon:"boxes",available:!1,connected:!1},{id:"skype",brand:"skype",name:"Skype",description:"Connect with Skype contacts.",icon:"boxes",available:!1,connected:!1},{id:"docker",brand:"docker",name:"Docker",description:"Manage Docker containers.",icon:"boxes",available:!1,connected:!1},{id:"github",brand:"github",name:"GitHub",description:"Connect your repositories and issues.",icon:"boxes",available:!1,connected:!1},{id:"gitlab",brand:"gitlab",name:"GitLab",description:"Coordinate projects with GitLab.",icon:"boxes",available:!1,connected:!1},{id:"discord",brand:"discord",name:"Discord",description:"Connect with your Discord community.",icon:"boxes",available:!1,connected:!1},{id:"whatsapp",brand:"whatsapp",name:"WhatsApp",description:"Keep in touch with your contacts.",icon:"boxes",available:!1,connected:!1}],configurable:!0,configurations:{_state:"integrationSettings"},pending:{_state:"saving"},error:{_state:"uiError.message"}},events:{onConfigure:[{action:"SetState",params:{path:"draft",value:{_event:"values"}}},{action:"SetState",params:{path:"uiError",value:null}},{action:"SetState",params:{path:"editorOpen",value:!0}}]}},{type:"Drawer",props:{title:"Integration preferences",description:"Save workspace configuration. External provider authorization remains unavailable.",open:{_state:"editorOpen"},pending:{_state:"saving"}},events:{onClose:[{action:"SetState",params:{path:"editorOpen",value:!1}}]},children:[{type:"Form",props:{label:"Integration preferences",pending:{_state:"saving"},idempotent:!0},children:[{type:"Field",props:{name:"enabled",label:"Enable in workspace",kind:"switch",value:{_bindState:"draft.enabled"}}},{type:"Field",props:{name:"label",label:"Display label",kind:"text",value:{_bindState:"draft.label"}}},{type:"Field",props:{name:"channel",label:"Channel",kind:"text",value:{_bindState:"draft.channel"}}},{type:"Paragraph",props:{text:{_state:"uiError.message"}},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Save preferences",disabled:{_state:"saving"}}}],events:{onSubmit:[{action:"SetState",params:{path:"submitted",value:{_event:"values"}}},{action:"Request",params:{connectionId:"integrations-db",request:{id:"save-integration",connectionId:"integrations-db",payload:{_if:[{_eq:[{_if:[{_state:"draft.id"},"UpdateOne","InsertOne"]},"InsertOne"]},{operation:"InsertOne",data:{provider:{_state:"draft.provider"},enabled:{_state:"submitted.enabled"},config:{label:{_state:"submitted.label"},channel:{_state:"submitted.channel"}}}},{operation:"UpdateOne",data:{provider:{_state:"draft.provider"},enabled:{_state:"submitted.enabled"},config:{label:{_state:"submitted.label"},channel:{_state:"submitted.channel"}}},filter:{id:{_state:"draft.id"}},version:{_state:"draft.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"integrations-db",request:{id:"load-integrations",connectionId:"integrations-db",payload:{operation:"Find"}},responsePath:"integrationSettings",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"editorOpen",value:!1}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}}]}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"integrations-db",request:{id:"load-integrations",connectionId:"integrations-db",payload:{operation:"Find"}},responsePath:"integrationSettings",loadingPath:"loading",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var bg={id:"chats",path:"/chats",title:"Chats",state:{currentUserId:"user-demo",direction:"ltr",font:"Inter",messageSubmission:null,theme:"light",currentPath:"/chats",conversations:[{id:"conversation-0",name:"Alex Johnson",initials:"AJ",preview:"Hey, how’s it going?"},{id:"conversation-1",name:"Sarah Wilson",initials:"SW",preview:"Did you see the new design?"},{id:"conversation-2",name:"Michael Brown",initials:"MB",preview:"Thanks for your help!"},{id:"conversation-3",name:"Emily Davis",initials:"ED",preview:"Let’s catch up tomorrow."},{id:"conversation-4",name:"David Miller",initials:"DM",preview:"The update looks great."},{id:"conversation-5",name:"Jessica Garcia",initials:"JG",preview:"Can you review my pull request?"}],messages:[{id:"m1",conversationId:"conversation-0",text:"Hey, how’s it going?",time:"10:30 AM",own:!1},{id:"m2",conversationId:"conversation-0",text:"Pretty good! Working on the dashboard.",time:"10:31 AM",own:!0}],draft:"",selectedId:"",sending:!1,uiError:null},blocks:[{type:"PageLayout",children:[{type:"ChatPanel",props:{conversations:{_state:"conversations"},messages:{_state:"messages"},selectedId:{_state:"selectedId"},draft:{_state:"draft"},pending:{_state:"sending"},error:{_state:"uiError.message"},canSend:!0,currentUserId:{_state:"currentUserId"}},events:{onSelect:[{action:"SetState",params:{path:"selectedId",value:{_event:"value"}}}],onDraftChange:[{action:"SetState",params:{path:"draft",value:{_event:"value"}}}],onSend:[{action:"SetState",params:{path:"messageSubmission",value:{_event:"values"}}},{action:"Request",params:{connectionId:"messages-db",request:{id:"send-message",connectionId:"messages-db",payload:{operation:"InsertOne",data:{conversationId:{_state:"messageSubmission.conversationId"},text:{_state:"messageSubmission.text"},createdAt:{_state:"messageSubmission.createdAt"}}}},loadingPath:"sending",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"messages-db",request:{id:"load-messages",connectionId:"messages-db",payload:{operation:"Find"}},responsePath:"messages",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"draft",value:""}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}},{type:"Paragraph",props:{text:"Workspace messages are stored here. External delivery is not configured.",muted:!0,size:"sm"}}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"conversations-db",request:{id:"load-conversations",connectionId:"conversations-db",payload:{operation:"Find"}},responsePath:"conversations",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"Request",params:{connectionId:"messages-db",request:{id:"load-messages",connectionId:"messages-db",payload:{operation:"Find"}},responsePath:"messages",errorPath:"uiError"},onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var vg={id:"settings-profile",path:"/settings/profile",title:"Settings · Profile",state:{direction:"ltr",font:"Inter",loading:!1,theme:"light",currentPath:"/settings/profile",saving:!1,uiError:null,saved:!1,form:{username:"shadcn",email:"m@example.com",bio:"I own a computer.",urls:["https://shadcn.com"]},preferences:[]},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Settings"}},{type:"Paragraph",props:{text:"Manage your account settings and set e-mail preferences.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Box",props:{className:"!flex-col gap-10 lg:!flex-row"},children:[{type:"Box",props:{className:"w-full shrink-0 lg:!flex-col lg:w-48 [&>a]:shrink-0 [&>a]:px-3 [&>a]:py-2 [&>a]:rounded-md lg:[&>a]:px-0 lg:[&>a]:py-0",direction:"row",wrap:!0,gap:"md"},children:[{type:"Link",props:{label:"Profile",href:"/settings/profile",variant:"default",className:"bg-muted font-medium lg:bg-transparent"}},{type:"Link",props:{label:"Account",href:"/settings/account",variant:"muted"}},{type:"Link",props:{label:"Appearance",href:"/settings/appearance",variant:"muted"}},{type:"Link",props:{label:"Notifications",href:"/settings/notifications",variant:"muted"}},{type:"Link",props:{label:"Display",href:"/settings/display",variant:"muted"}}]},{type:"Box",props:{className:"max-w-2xl flex-1",gap:"lg"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:2,text:"Profile"}},{type:"Paragraph",props:{text:"This is how others will see you on the site.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Form",props:{label:"Profile settings",pending:{_or:[{_state:"saving"},{_state:"loading"}]},idempotent:!0},children:[{type:"Field",props:{name:"username",label:"Username",description:"This is your public display name.",required:!0,value:{_bindState:"form.username"}}},{type:"Field",props:{name:"email",label:"Email",kind:"email",required:!0,value:{_bindState:"form.email"}}},{type:"Field",props:{name:"bio",label:"Bio",kind:"textarea",description:"Describe your role and what you work on.",value:{_bindState:"form.bio"}}},{type:"Field",props:{name:"urls",label:"URLs",kind:"urls",description:"Add links to your website, blog, or social media profiles.",value:{_bindState:"form.urls"}},events:{onChange:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}}]}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Update profile",disabled:{_state:"saving"}}}],events:{onChange:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}}],onSubmit:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}},{action:"Request",params:{connectionId:"preferences-db",request:{id:"save-preferences",connectionId:"preferences-db",payload:{_if:[{_eq:[{_if:[{_state:"preferences.0.id"},"UpdateOne","InsertOne"]},"InsertOne"]},{operation:"InsertOne",data:{section:"profile",values:{_event:"values"}}},{operation:"UpdateOne",data:{section:"profile",values:{_event:"values"}},filter:{id:{_state:"preferences.0.id"}},version:{_state:"preferences.0.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"profile"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"saved",value:{_not:{_state:"uiError"}}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}},{type:"Paragraph",props:{text:"Settings saved.",muted:!0},visible:{_state:"saved"}}]}]}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"profile"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var kg={id:"settings-account",path:"/settings/account",title:"Settings · Account",state:{direction:"ltr",font:"Inter",loading:!1,theme:"light",currentPath:"/settings/account",saving:!1,uiError:null,saved:!1,form:{name:"shadcn",birthday:"",language:"English"},preferences:[]},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Settings"}},{type:"Paragraph",props:{text:"Manage your account settings and set e-mail preferences.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Box",props:{className:"!flex-col gap-10 lg:!flex-row"},children:[{type:"Box",props:{className:"w-full shrink-0 !flex-row flex-wrap gap-1 lg:!flex-col lg:w-48 [&>a]:shrink-0 [&>a]:px-3 [&>a]:py-2 [&>a]:rounded-md lg:[&>a]:px-0 lg:[&>a]:py-0"},children:[{type:"Link",props:{label:"Profile",href:"/settings/profile",variant:"muted"}},{type:"Link",props:{label:"Account",href:"/settings/account",variant:"default",className:"bg-muted font-medium lg:bg-transparent"}},{type:"Link",props:{label:"Appearance",href:"/settings/appearance",variant:"muted"}},{type:"Link",props:{label:"Notifications",href:"/settings/notifications",variant:"muted"}},{type:"Link",props:{label:"Display",href:"/settings/display",variant:"muted"}}]},{type:"Box",props:{className:"max-w-2xl flex-1",gap:"lg"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:2,text:"Account"}},{type:"Paragraph",props:{text:"Update your account settings. Set your preferred language and timezone.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Form",props:{label:"Account settings",pending:{_or:[{_state:"saving"},{_state:"loading"}]},idempotent:!0},children:[{type:"Field",props:{name:"name",label:"Name",description:"This is the name that will be displayed on your profile.",required:!0,value:{_bindState:"form.name"}}},{type:"Field",props:{name:"birthday",label:"Date of birth",kind:"date",description:"Your date of birth is used to calculate your age.",value:{_bindState:"form.birthday"}}},{type:"Field",props:{name:"language",label:"Language",kind:"combobox",options:[{value:"English",label:"English"},{value:"Chinese",label:"Chinese"},{value:"French",label:"French"},{value:"German",label:"German"},{value:"Japanese",label:"Japanese"}],value:{_bindState:"form.language"}}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Update account",disabled:{_state:"saving"}}}],events:{onChange:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}}],onSubmit:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}},{action:"Request",params:{connectionId:"preferences-db",request:{id:"save-preferences",connectionId:"preferences-db",payload:{_if:[{_eq:[{_if:[{_state:"preferences.0.id"},"UpdateOne","InsertOne"]},"InsertOne"]},{operation:"InsertOne",data:{section:"account",values:{_event:"values"}}},{operation:"UpdateOne",data:{section:"account",values:{_event:"values"}},filter:{id:{_state:"preferences.0.id"}},version:{_state:"preferences.0.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"account"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"saved",value:{_not:{_state:"uiError"}}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}},{type:"Paragraph",props:{text:"Settings saved.",muted:!0},visible:{_state:"saved"}}]}]}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"account"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var wg={id:"settings-appearance",path:"/settings/appearance",title:"Settings · Appearance",state:{direction:"ltr",font:"Inter",loading:!1,theme:"light",currentPath:"/settings/appearance",saving:!1,uiError:null,saved:!1,form:{font:"Inter",theme:"light",direction:"ltr"},preferences:[]},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Settings"}},{type:"Paragraph",props:{text:"Manage your account settings and set e-mail preferences.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Box",props:{className:"!flex-col gap-10 lg:!flex-row"},children:[{type:"Box",props:{className:"w-full shrink-0 !flex-row flex-wrap gap-1 lg:!flex-col lg:w-48 [&>a]:shrink-0 [&>a]:px-3 [&>a]:py-2 [&>a]:rounded-md lg:[&>a]:px-0 lg:[&>a]:py-0"},children:[{type:"Link",props:{label:"Profile",href:"/settings/profile",variant:"muted"}},{type:"Link",props:{label:"Account",href:"/settings/account",variant:"muted"}},{type:"Link",props:{label:"Appearance",href:"/settings/appearance",variant:"default",className:"bg-muted font-medium lg:bg-transparent"}},{type:"Link",props:{label:"Notifications",href:"/settings/notifications",variant:"muted"}},{type:"Link",props:{label:"Display",href:"/settings/display",variant:"muted"}}]},{type:"Box",props:{className:"max-w-2xl flex-1",gap:"lg"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:2,text:"Appearance"}},{type:"Paragraph",props:{text:"Customize the appearance of the app. Automatically switch between day and night themes.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Form",props:{label:"Appearance settings",pending:{_or:[{_state:"saving"},{_state:"loading"}]},idempotent:!0},children:[{type:"Field",props:{name:"font",label:"Font",kind:"select",options:[{value:"Inter",label:"Inter"},{value:"System",label:"System"},{value:"Manrope",label:"Manrope"}],value:{_bindState:"form.font"}}},{type:"Field",props:{name:"theme",label:"Theme",kind:"radio",options:[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}],value:{_bindState:"form.theme"}}},{type:"Field",props:{name:"direction",label:"Direction",kind:"select",options:[{value:"ltr",label:"Ltr"},{value:"rtl",label:"Rtl"}],value:{_bindState:"form.direction"}}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Update appearance",disabled:{_state:"saving"}}}],events:{onChange:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}}],onSubmit:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}},{action:"Request",params:{connectionId:"preferences-db",request:{id:"save-preferences",connectionId:"preferences-db",payload:{_if:[{_eq:[{_if:[{_state:"preferences.0.id"},"UpdateOne","InsertOne"]},"InsertOne"]},{operation:"InsertOne",data:{section:"appearance",values:{_event:"values"}}},{operation:"UpdateOne",data:{section:"appearance",values:{_event:"values"}},filter:{id:{_state:"preferences.0.id"}},version:{_state:"preferences.0.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"appearance"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"saved",value:{_not:{_state:"uiError"}}}},{action:"SetState",params:{path:"theme",value:{_state:"form.theme"}}},{action:"SetState",params:{path:"direction",value:{_state:"form.direction"}}},{action:"SetState",params:{path:"font",value:{_state:"form.font"}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}},{type:"Paragraph",props:{text:"Settings saved.",muted:!0},visible:{_state:"saved"}}]}]}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"appearance"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var Sg={id:"settings-notifications",path:"/settings/notifications",title:"Settings · Notifications",state:{direction:"ltr",font:"Inter",loading:!1,theme:"light",currentPath:"/settings/notifications",saving:!1,uiError:null,saved:!1,form:{notify:"all",communication:!1,marketing:!1,social:!0,security:!0},preferences:[]},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Settings"}},{type:"Paragraph",props:{text:"Manage your account settings and set e-mail preferences.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Box",props:{className:"!flex-col gap-10 lg:!flex-row"},children:[{type:"Box",props:{className:"w-full shrink-0 !flex-row flex-wrap gap-1 lg:!flex-col lg:w-48 [&>a]:shrink-0 [&>a]:px-3 [&>a]:py-2 [&>a]:rounded-md lg:[&>a]:px-0 lg:[&>a]:py-0"},children:[{type:"Link",props:{label:"Profile",href:"/settings/profile",variant:"muted"}},{type:"Link",props:{label:"Account",href:"/settings/account",variant:"muted"}},{type:"Link",props:{label:"Appearance",href:"/settings/appearance",variant:"muted"}},{type:"Link",props:{label:"Notifications",href:"/settings/notifications",variant:"default",className:"bg-muted font-medium lg:bg-transparent"}},{type:"Link",props:{label:"Display",href:"/settings/display",variant:"muted"}}]},{type:"Box",props:{className:"max-w-2xl flex-1",gap:"lg"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:2,text:"Notifications"}},{type:"Paragraph",props:{text:"Configure how you receive notifications.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Form",props:{label:"Notifications settings",pending:{_or:[{_state:"saving"},{_state:"loading"}]},idempotent:!0},children:[{type:"Field",props:{name:"notify",label:"Notify me about...",kind:"radio",options:[{label:"All new messages",value:"all"},{label:"Direct messages and mentions",value:"mentions"},{label:"Nothing",value:"none"}],value:{_bindState:"form.notify"}}},{type:"Field",props:{name:"communication",kind:"switch",label:"Communication emails",description:"Receive emails about your account activity.",value:{_bindState:"form.communication"}}},{type:"Field",props:{name:"marketing",kind:"switch",label:"Marketing emails",description:"Receive emails about new products and features.",value:{_bindState:"form.marketing"}}},{type:"Field",props:{name:"social",kind:"switch",label:"Social emails",description:"Receive emails for friend requests and follows.",value:{_bindState:"form.social"}}},{type:"Field",props:{name:"security",kind:"switch",label:"Security emails",description:"Receive emails about your account security.",value:{_bindState:"form.security"}}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Update notifications",disabled:{_state:"saving"}}}],events:{onChange:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}}],onSubmit:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}},{action:"Request",params:{connectionId:"preferences-db",request:{id:"save-preferences",connectionId:"preferences-db",payload:{_if:[{_eq:[{_if:[{_state:"preferences.0.id"},"UpdateOne","InsertOne"]},"InsertOne"]},{operation:"InsertOne",data:{section:"notifications",values:{_event:"values"}}},{operation:"UpdateOne",data:{section:"notifications",values:{_event:"values"}},filter:{id:{_state:"preferences.0.id"}},version:{_state:"preferences.0.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"notifications"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"saved",value:{_not:{_state:"uiError"}}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}},{type:"Paragraph",props:{text:"Settings saved.",muted:!0},visible:{_state:"saved"}}]}]}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"notifications"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var xg={id:"settings-display",path:"/settings/display",title:"Settings · Display",state:{direction:"ltr",font:"Inter",loading:!1,theme:"light",currentPath:"/settings/display",saving:!1,uiError:null,saved:!1,form:{recents:!0,home:!0,applications:!0,desktop:!0,downloads:!0,documents:!0},preferences:[]},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Settings"}},{type:"Paragraph",props:{text:"Manage your account settings and set e-mail preferences.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Box",props:{className:"!flex-col gap-10 lg:!flex-row"},children:[{type:"Box",props:{className:"w-full shrink-0 !flex-row flex-wrap gap-1 lg:!flex-col lg:w-48 [&>a]:shrink-0 [&>a]:px-3 [&>a]:py-2 [&>a]:rounded-md lg:[&>a]:px-0 lg:[&>a]:py-0"},children:[{type:"Link",props:{label:"Profile",href:"/settings/profile",variant:"muted"}},{type:"Link",props:{label:"Account",href:"/settings/account",variant:"muted"}},{type:"Link",props:{label:"Appearance",href:"/settings/appearance",variant:"muted"}},{type:"Link",props:{label:"Notifications",href:"/settings/notifications",variant:"muted"}},{type:"Link",props:{label:"Display",href:"/settings/display",variant:"default",className:"bg-muted font-medium lg:bg-transparent"}}]},{type:"Box",props:{className:"max-w-2xl flex-1",gap:"lg"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:2,text:"Display"}},{type:"Paragraph",props:{text:"Turn items on or off to control what’s displayed in the app.",muted:!0,size:"sm"}}]}]},{type:"Divider"},{type:"Form",props:{label:"Display settings",pending:{_or:[{_state:"saving"},{_state:"loading"}]},idempotent:!0},children:[{type:"Paragraph",props:{text:"Select the items you want to display in the sidebar.",muted:!0}},{type:"Field",props:{name:"recents",label:"Recents",kind:"checkbox",value:{_bindState:"form.recents"}}},{type:"Field",props:{name:"home",label:"Home",kind:"checkbox",value:{_bindState:"form.home"}}},{type:"Field",props:{name:"applications",label:"Applications",kind:"checkbox",value:{_bindState:"form.applications"}}},{type:"Field",props:{name:"desktop",label:"Desktop",kind:"checkbox",value:{_bindState:"form.desktop"}}},{type:"Field",props:{name:"downloads",label:"Downloads",kind:"checkbox",value:{_bindState:"form.downloads"}}},{type:"Field",props:{name:"documents",label:"Documents",kind:"checkbox",value:{_bindState:"form.documents"}}},{type:"Paragraph",props:{text:{_state:"uiError.message"},muted:!0},visible:{_state:"uiError"}},{type:"Form.Submit",props:{label:"Update display",disabled:{_state:"saving"}}}],events:{onChange:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}}],onSubmit:[{action:"SetState",params:{path:"saved",value:!1}},{action:"SetState",params:{path:"uiError",value:null}},{action:"Request",params:{connectionId:"preferences-db",request:{id:"save-preferences",connectionId:"preferences-db",payload:{_if:[{_eq:[{_if:[{_state:"preferences.0.id"},"UpdateOne","InsertOne"]},"InsertOne"]},{operation:"InsertOne",data:{section:"display",values:{_event:"values"}}},{operation:"UpdateOne",data:{section:"display",values:{_event:"values"}},filter:{id:{_state:"preferences.0.id"}},version:{_state:"preferences.0.version"}}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"display"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]},{action:"SetState",params:{path:"saved",value:{_not:{_state:"uiError"}}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}},{type:"Paragraph",props:{text:"Settings saved.",muted:!0},visible:{_state:"saved"}}]}]}],template:"shadcn-admin-shell"}],lifecycle:{onMount:[{action:"Request",params:{connectionId:"preferences-db",request:{id:"load-preferences",connectionId:"preferences-db",payload:{operation:"Find",filter:{section:"display"}}},responsePath:"preferences",loadingPath:"loading",errorPath:"uiError"},onSuccess:[{action:"SetState",params:{path:"form",value:{_if:[{_state:"preferences.0.id"},{_state:"preferences.0.values"},{_state:"form"}]}}}],onError:[{action:"SetState",params:{path:"requestFailed",value:!0}}]}]}};var be={"sign-in":{type:"Form",props:{label:"Login",pending:{_state:"saving"}},children:[{type:"Field",props:{name:"email",label:"Email",kind:"email",required:!0}},{type:"Field",props:{name:"password",label:"Password",kind:"password",required:!0}},{type:"Form.Submit",props:{label:"Login",full:!0,disabled:!0}}]},"sign-up":{type:"Form",props:{label:"Create an account",pending:{_state:"saving"}},children:[{type:"Field",props:{name:"email",label:"Email",kind:"email",required:!0}},{type:"Field",props:{name:"password",label:"Password",kind:"password",required:!0}},{type:"Field",props:{name:"confirm",label:"Confirm password",kind:"password",required:!0}},{type:"Form.Submit",props:{label:"Create account",full:!0,disabled:!0}}]},"forgot-password":{type:"Form",props:{label:"Forgot Password",pending:{_state:"saving"}},children:[{type:"Field",props:{name:"email",label:"Email",kind:"email",required:!0}},{type:"Form.Submit",props:{label:"Send reset link",full:!0,disabled:!0}}]},otp:{type:"Form",props:{label:"Two-factor Authentication",pending:{_state:"saving"}},children:[{type:"Field",props:{name:"code",label:"Authentication code",kind:"otp",required:!0}},{type:"Form.Submit",props:{label:"Verify",full:!0,disabled:!0}}]}};var Cg={id:"sign-in",path:"/sign-in",title:"Login",state:{saving:!1,currentPath:"/sign-in"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center bg-background px-6",gap:"lg"},children:[{type:"Heading",props:{level:3,text:"UiBot Admin"}},{type:"Box",props:{className:"w-full max-w-sm",gap:"lg"},children:[{type:"Heading",props:{level:2,text:"Login"}},{type:"Paragraph",props:{text:"Enter your email and password below to log into your account.",muted:!0,size:"sm"}},be["sign-in"],{type:"Paragraph",props:{text:"Connect an authentication provider to continue.",muted:!0,size:"sm"}},{type:"Box",props:{direction:"row",justify:"between"},children:[{type:"Link",props:{label:"Forgot password?",href:"/forgot-password"}},{type:"Link",props:{label:"Create account",href:"/sign-up"}}]},{type:"Paragraph",props:{text:"By continuing, you agree to our Terms of Service and Privacy Policy.",muted:!0,size:"sm"}}]}]}]};var Ig={id:"sign-in-2",path:"/sign-in-2",title:"Login",state:{saving:!1,currentPath:"/sign-in-2"},blocks:[{type:"Box",props:{className:"!grid lg:grid-cols-2 min-h-dvh",gap:"none"},children:[{type:"Box",props:{className:"min-h-dvh items-center justify-center px-6 py-12",gap:"lg"},children:[{type:"Heading",props:{level:3,text:"UiBot Admin"}},{type:"Box",props:{className:"w-full max-w-sm",gap:"lg"},children:[{type:"Heading",props:{level:2,text:"Login"}},{type:"Paragraph",props:{text:"Welcome back! Please enter your details.",muted:!0,size:"sm"}},be["sign-in"],{type:"Paragraph",props:{text:"Connect an authentication provider to continue.",muted:!0,size:"sm"}},{type:"Box",props:{direction:"row",justify:"between"},children:[{type:"Link",props:{label:"Forgot password?",href:"/forgot-password"}},{type:"Link",props:{label:"Create account",href:"/sign-up"}}]},{type:"Paragraph",props:{text:"By continuing, you agree to our Terms of Service and Privacy Policy.",muted:!0,size:"sm"}}]}]},{type:"Box",props:{className:"hidden lg:flex relative overflow-hidden bg-muted min-h-dvh p-10",gap:"lg"},children:[{type:"Box",props:{className:"absolute top-24 start-16 w-[960px] rounded-xl border bg-background p-8",gap:"lg"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Dashboard"}}]},{type:"Button",props:{label:"Download",disabled:!0}}]},{type:"Tabs",props:{tabs:["Overview","Analytics","Reports","Notifications"],disabledTabs:[2,3],variant:"segmented"},children:[{type:"Box",props:{gap:"md"},children:[{type:"Box",props:{className:"!grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4"},children:[{type:"StatCard",props:{label:"Total Revenue",value:"$45,231.89",description:"+20.1% from last month",icon:"chart-no-axes-column"}},{type:"StatCard",props:{label:"Subscriptions",value:"+2350",description:"+180.1% from last month",icon:"users"}},{type:"StatCard",props:{label:"Sales",value:"+12,234",description:"+19% from last month",icon:"boxes"}},{type:"StatCard",props:{label:"Active Now",value:"+573",description:"+201 since last hour",icon:"chart-no-axes-column"}}]},{type:"Box",props:{className:"!grid grid-cols-1 gap-4 lg:grid-cols-7"},children:[{type:"Box",props:{className:"lg:col-span-4"},children:[{type:"Card",props:{title:"Overview"},children:[{type:"BarChart",props:{prefix:"$",height:350,data:[{label:"Jan",value:1500},{label:"Feb",value:5800},{label:"Mar",value:5500},{label:"Apr",value:2200},{label:"May",value:4800},{label:"Jun",value:1600},{label:"Jul",value:2800},{label:"Aug",value:2300},{label:"Sep",value:5700},{label:"Oct",value:1400},{label:"Nov",value:2900},{label:"Dec",value:1900}]}}]}]},{type:"Box",props:{className:"lg:col-span-3"},children:[{type:"Card",props:{title:"Recent Sales",description:"You made 265 sales this month."},children:[{type:"AvatarList",props:{items:[{id:"0",initials:"OM",name:"Olivia Martin",description:"olivia.martin@email.com",value:"+$1,999.00"},{id:"1",initials:"JL",name:"Jackson Lee",description:"jackson.lee@email.com",value:"+$39.00"},{id:"2",initials:"IN",name:"Isabella Nguyen",description:"isabella.nguyen@email.com",value:"+$299.00"},{id:"3",initials:"WK",name:"William Kim",description:"will@email.com",value:"+$99.00"},{id:"4",initials:"SD",name:"Sofia Davis",description:"sofia.davis@email.com",value:"+$39.00"}]}}]}]}]}]},{type:"Box",props:{gap:"md"},children:[{type:"Box",props:{className:"!flex-row items-start justify-between gap-4 mb-6"},children:[{type:"Box",props:{gap:"xs"},children:[{type:"Heading",props:{level:1,text:"Analytics"}},{type:"Paragraph",props:{text:"Revenue and subscription performance.",muted:!0,size:"sm"}}]}]},{type:"Box",props:{className:"!grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4"},children:[{type:"StatCard",props:{label:"Total Revenue",value:"$45,231.89",description:"+20.1% from last month",icon:"chart-no-axes-column"}},{type:"StatCard",props:{label:"Subscriptions",value:"+2350",description:"+180.1% from last month",icon:"users"}},{type:"StatCard",props:{label:"Sales",value:"+12,234",description:"+19% from last month",icon:"boxes"}},{type:"StatCard",props:{label:"Active Now",value:"+573",description:"+201 since last hour",icon:"chart-no-axes-column"}}]},{type:"Card",props:{title:"Revenue over time"},children:[{type:"BarChart",props:{prefix:"$",data:[{label:"Apr",value:18200},{label:"May",value:21400},{label:"Jun",value:28000},{label:"Jul",value:26200},{label:"Aug",value:31500},{label:"Sep",value:45231}]}}]}]}]}]}]}]}]};var Ag={id:"sign-up",path:"/sign-up",title:"Create an account",state:{saving:!1,currentPath:"/sign-up"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center bg-background px-6",gap:"lg"},children:[{type:"Heading",props:{level:3,text:"UiBot Admin"}},{type:"Box",props:{className:"w-full max-w-sm",gap:"lg"},children:[{type:"Heading",props:{level:2,text:"Create an account"}},{type:"Paragraph",props:{text:"Enter your email and password to create an account.",muted:!0,size:"sm"}},be["sign-up"],{type:"Paragraph",props:{text:"Connect an authentication provider to continue.",muted:!0,size:"sm"}},{type:"Box",props:{direction:"row",justify:"between"},children:[{type:"Link",props:{label:"Forgot password?",href:"/forgot-password"}},{type:"Link",props:{label:"Create account",href:"/sign-up"}}]},{type:"Paragraph",props:{text:"By continuing, you agree to our Terms of Service and Privacy Policy.",muted:!0,size:"sm"}}]}]}]};var Rg={id:"forgot-password",path:"/forgot-password",title:"Forgot Password",state:{saving:!1,currentPath:"/forgot-password"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center bg-background px-6",gap:"lg"},children:[{type:"Heading",props:{level:3,text:"UiBot Admin"}},{type:"Box",props:{className:"w-full max-w-sm",gap:"lg"},children:[{type:"Heading",props:{level:2,text:"Forgot Password"}},{type:"Paragraph",props:{text:"Enter your registered email and we will send you a reset link.",muted:!0,size:"sm"}},be["forgot-password"],{type:"Paragraph",props:{text:"Connect an authentication provider to continue.",muted:!0,size:"sm"}},{type:"Box",props:{direction:"row",justify:"between"},children:[{type:"Link",props:{label:"Forgot password?",href:"/forgot-password"}},{type:"Link",props:{label:"Create account",href:"/sign-up"}}]},{type:"Paragraph",props:{text:"By continuing, you agree to our Terms of Service and Privacy Policy.",muted:!0,size:"sm"}}]}]}]};var Pg={id:"otp",path:"/otp",title:"Two-factor Authentication",state:{saving:!1,currentPath:"/otp"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center bg-background px-6",gap:"lg"},children:[{type:"Heading",props:{level:3,text:"UiBot Admin"}},{type:"Box",props:{className:"w-full max-w-sm",gap:"lg"},children:[{type:"Heading",props:{level:2,text:"Two-factor Authentication"}},{type:"Paragraph",props:{text:"Please enter the authentication code sent to your email.",muted:!0,size:"sm"}},be.otp,{type:"Paragraph",props:{text:"Connect an authentication provider to continue.",muted:!0,size:"sm"}},{type:"Box",props:{direction:"row",justify:"between"},children:[{type:"Link",props:{label:"Forgot password?",href:"/forgot-password"}},{type:"Link",props:{label:"Create account",href:"/sign-up"}}]},{type:"Paragraph",props:{text:"By continuing, you agree to our Terms of Service and Privacy Policy.",muted:!0,size:"sm"}}]}]}]};var Tg={id:"error-401",path:"/errors/401",title:"Unauthorized",state:{currentPath:"/errors/401"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center px-6 text-center",gap:"lg"},children:[{type:"Heading",props:{level:1,text:"401",className:"!text-[7rem] !leading-tight !font-bold"}},{type:"Heading",props:{level:2,text:"Unauthorized"}},{type:"Paragraph",props:{text:"Please log in with the appropriate credentials to access this resource.",muted:!0}},{type:"Link",props:{label:"Back to Home",href:"/",variant:"button"}}]}]};var Eg={id:"error-403",path:"/errors/403",title:"Access Forbidden",state:{currentPath:"/errors/403"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center px-6 text-center",gap:"lg"},children:[{type:"Heading",props:{level:1,text:"403",className:"!text-[7rem] !leading-tight !font-bold"}},{type:"Heading",props:{level:2,text:"Access Forbidden"}},{type:"Paragraph",props:{text:"You don’t have the necessary permission to view this page.",muted:!0}},{type:"Link",props:{label:"Back to Home",href:"/",variant:"button"}}]}]};var Og={id:"error-404",path:"/errors/404",title:"Oops! Page Not Found!",state:{currentPath:"/errors/404"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center px-6 text-center",gap:"lg"},children:[{type:"Heading",props:{level:1,text:"404",className:"!text-[7rem] !leading-tight !font-bold"}},{type:"Heading",props:{level:2,text:"Oops! Page Not Found!"}},{type:"Paragraph",props:{text:"It seems like the page you’re looking for does not exist or might have been removed.",muted:!0}},{type:"Link",props:{label:"Back to Home",href:"/",variant:"button"}}]}]};var Ng={id:"error-500",path:"/errors/500",title:"Oops! Something went wrong",state:{currentPath:"/errors/500"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center px-6 text-center",gap:"lg"},children:[{type:"Heading",props:{level:1,text:"500",className:"!text-[7rem] !leading-tight !font-bold"}},{type:"Heading",props:{level:2,text:"Oops! Something went wrong"}},{type:"Paragraph",props:{text:"We apologize for the inconvenience. Please try again later.",muted:!0}},{type:"Link",props:{label:"Back to Home",href:"/",variant:"button"}}]}]};var _g={id:"error-503",path:"/errors/503",title:"Website is under maintenance!",state:{currentPath:"/errors/503"},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center px-6 text-center",gap:"lg"},children:[{type:"Heading",props:{level:1,text:"503",className:"!text-[7rem] !leading-tight !font-bold"}},{type:"Heading",props:{level:2,text:"Website is under maintenance!"}},{type:"Paragraph",props:{text:"The site is not available at the moment. We’ll be back online shortly.",muted:!0}},{type:"Link",props:{label:"Back to Home",href:"/",variant:"button"}}]}]};var Bg={id:"help",path:"/help-center",title:"Help Center",state:{direction:"ltr",font:"Inter",theme:"light",currentPath:"/help-center"},blocks:[{type:"PageLayout",children:[{type:"Box",props:{className:"min-h-[65vh] items-center justify-center",gap:"md"},children:[{type:"Heading",props:{level:1,text:"Coming Soon!"}},{type:"Paragraph",props:{text:"We’re working on the Help Center. Stay tuned!",muted:!0}}]}],template:"shadcn-admin-shell"}]};var Hi=[gg,fg,hg,yg,bg,vg,kg,wg,Sg,xg,Cg,Ig,Ag,Rg,Pg,Tg,Eg,Og,Ng,_g,Bg];var tn={version:"2.0",pages:[{id:"shadcn-admin-shell",state:{currentPath:"/",direction:"ltr",font:"Inter",theme:"light"},path:"/",blocks:[{type:"PageLayout",props:{appearance:"admin",routes:[{label:"Dashboard",href:"/",icon:"layout-dashboard"},{label:"Tasks",href:"/tasks",icon:"list-todo"},{label:"Apps",href:"/apps",icon:"boxes"},{label:"Chats",href:"/chats",icon:"message-circle",badge:"3"},{label:"Users",href:"/users",icon:"users"},{label:"Auth",href:"/sign-in",icon:"shield"},{label:"Errors",href:"/errors/500",icon:"circle-help"},{label:"Settings",href:"/settings/profile",icon:"settings"},{label:"Help Center",href:"/help-center",icon:"circle-help"},{label:"Account",href:"/settings/account"},{label:"Appearance",href:"/settings/appearance"},{label:"Notifications",href:"/settings/notifications"},{label:"Display",href:"/settings/display"}],headerLinks:[{label:"Overview",href:"/"},{label:"Customers",href:"/users"},{label:"Products",href:"/apps"},{label:"Settings",href:"/settings/profile"}],font:{_state:"font"},theme:{_state:"theme"},direction:{_state:"direction"}},slots:{sidebar:[{type:"AppNavigation",props:{brand:"UiBot Admin",subtitle:"Vite + ShadcnUI",groups:[{label:"General",items:[{label:"Dashboard",href:"/",icon:"layout-dashboard"},{label:"Tasks",href:"/tasks",icon:"list-todo"},{label:"Apps",href:"/apps",icon:"boxes"},{label:"Chats",href:"/chats",icon:"message-circle",badge:"3"},{label:"Users",href:"/users",icon:"users"}]},{label:"Pages",items:[{label:"Auth",href:"/sign-in",icon:"shield",children:[{label:"Sign in",href:"/sign-in"},{label:"Sign in (split)",href:"/sign-in-2"},{label:"Sign up",href:"/sign-up"},{label:"Forgot password",href:"/forgot-password"},{label:"OTP",href:"/otp"}]},{label:"Errors",href:"/errors/500",icon:"circle-help",children:[{label:"401",href:"/errors/401"},{label:"403",href:"/errors/403"},{label:"404",href:"/errors/404"},{label:"500",href:"/errors/500"},{label:"503",href:"/errors/503"}]}]},{label:"Other",items:[{label:"Settings",href:"/settings/profile",icon:"settings",children:[{label:"Profile",href:"/settings/profile"},{label:"Account",href:"/settings/account"},{label:"Appearance",href:"/settings/appearance"},{label:"Notifications",href:"/settings/notifications"},{label:"Display",href:"/settings/display"}]},{label:"Help Center",href:"/help-center",icon:"circle-help"}]}],activePath:{_state:"currentPath"},userName:"satnaing",email:"satnaingdev@gmail.com",initials:"SN",workspaces:[{label:"Personal workspace",href:"/"},{label:"Team workspace",href:"/users"}]}}]},events:{onThemeChange:[{action:"SetState",params:{path:"theme",value:{_event:"value"}}}]}}]}]};var Zn={tasks:[{id:"TASK-8782",title:"Document release rollback steps",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8783",title:"Fix keyboard focus in the task drawer",label:"bug",status:"todo",priority:"high"},{id:"TASK-8784",title:"Add status filters to the task list",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8785",title:"Update deployment checklist",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8786",title:"Investigate duplicate task submissions",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8787",title:"Add saved table views",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8788",title:"Document task priority definitions",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8789",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8790",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8791",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8792",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8793",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"feature",status:"todo",priority:"low"},{id:"TASK-8794",title:"We need to bypass the neural TCP card!",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8795",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"bug",status:"done",priority:"high"},{id:"TASK-8796",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8797",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8798",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"bug",status:"todo",priority:"high"},{id:"TASK-8799",title:"Update the onboarding documentation for team members.",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8800",title:"Review project permissions before the next release.",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8801",title:"Make the settings form usable with keyboard navigation.",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8802",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8803",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8804",title:"We need to bypass the neural TCP card!",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8805",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"feature",status:"done",priority:"low"},{id:"TASK-8806",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8807",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8808",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"feature",status:"todo",priority:"low"},{id:"TASK-8809",title:"Update the onboarding documentation for team members.",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8810",title:"Review project permissions before the next release.",label:"bug",status:"done",priority:"high"},{id:"TASK-8811",title:"Make the settings form usable with keyboard navigation.",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8812",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8813",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"bug",status:"todo",priority:"high"},{id:"TASK-8814",title:"We need to bypass the neural TCP card!",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8815",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8816",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8817",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8818",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8819",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8820",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8821",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8822",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8823",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"feature",status:"todo",priority:"low"},{id:"TASK-8824",title:"We need to bypass the neural TCP card!",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8825",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"bug",status:"done",priority:"high"},{id:"TASK-8826",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8827",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8828",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"bug",status:"todo",priority:"high"},{id:"TASK-8829",title:"Update the onboarding documentation for team members.",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8830",title:"Review project permissions before the next release.",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8831",title:"Make the settings form usable with keyboard navigation.",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8832",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8833",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8834",title:"We need to bypass the neural TCP card!",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8835",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"feature",status:"done",priority:"low"},{id:"TASK-8836",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8837",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8838",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"feature",status:"todo",priority:"low"},{id:"TASK-8839",title:"Update the onboarding documentation for team members.",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8840",title:"Review project permissions before the next release.",label:"bug",status:"done",priority:"high"},{id:"TASK-8841",title:"Make the settings form usable with keyboard navigation.",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8842",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8843",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"bug",status:"todo",priority:"high"},{id:"TASK-8844",title:"We need to bypass the neural TCP card!",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8845",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8846",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8847",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8848",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8849",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8850",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8851",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8852",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8853",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"feature",status:"todo",priority:"low"},{id:"TASK-8854",title:"We need to bypass the neural TCP card!",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8855",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"bug",status:"done",priority:"high"},{id:"TASK-8856",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8857",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8858",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"bug",status:"todo",priority:"high"},{id:"TASK-8859",title:"Update the onboarding documentation for team members.",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8860",title:"Review project permissions before the next release.",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8861",title:"Make the settings form usable with keyboard navigation.",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8862",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8863",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8864",title:"We need to bypass the neural TCP card!",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8865",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"feature",status:"done",priority:"low"},{id:"TASK-8866",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"documentation",status:"canceled",priority:"medium"},{id:"TASK-8867",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"bug",status:"backlog",priority:"high"},{id:"TASK-8868",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"feature",status:"todo",priority:"low"},{id:"TASK-8869",title:"Update the onboarding documentation for team members.",label:"documentation",status:"in progress",priority:"medium"},{id:"TASK-8870",title:"Review project permissions before the next release.",label:"bug",status:"done",priority:"high"},{id:"TASK-8871",title:"Make the settings form usable with keyboard navigation.",label:"feature",status:"canceled",priority:"low"},{id:"TASK-8872",title:"You can’t compress the program without quantifying the open-source SSD pixel!",label:"documentation",status:"backlog",priority:"medium"},{id:"TASK-8873",title:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",label:"bug",status:"todo",priority:"high"},{id:"TASK-8874",title:"We need to bypass the neural TCP card!",label:"feature",status:"in progress",priority:"low"},{id:"TASK-8875",title:"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",label:"documentation",status:"done",priority:"medium"},{id:"TASK-8876",title:"I’ll transmit the primary HTTP panel, that should feed the UTF-8 protocol!",label:"bug",status:"canceled",priority:"high"},{id:"TASK-8877",title:"Use the digital TLS panel, then you can transmit the haptic system!",label:"feature",status:"backlog",priority:"low"},{id:"TASK-8878",title:"The RAM monitor is down, parsing the virtual circuit will help.",label:"documentation",status:"todo",priority:"medium"},{id:"TASK-8879",title:"Update the onboarding documentation for team members.",label:"bug",status:"in progress",priority:"high"},{id:"TASK-8880",title:"Review project permissions before the next release.",label:"feature",status:"done",priority:"low"},{id:"TASK-8881",title:"Make the settings form usable with keyboard navigation.",label:"documentation",status:"canceled",priority:"medium"}],users:[{id:"user-1",username:"liam.anderson",firstName:"Liam",lastName:"Anderson",email:"liam.anderson@example.com",phoneNumber:"+1 (555) 010-0000",status:"active",role:"admin"},{id:"user-2",username:"olivia.baker",firstName:"Olivia",lastName:"Baker",email:"olivia.baker@example.com",phoneNumber:"+1 (555) 010-0001",status:"inactive",role:"manager"},{id:"user-3",username:"noah.carter",firstName:"Noah",lastName:"Carter",email:"noah.carter@example.com",phoneNumber:"+1 (555) 010-0002",status:"invited",role:"cashier"},{id:"user-4",username:"emma.davis",firstName:"Emma",lastName:"Davis",email:"emma.davis@example.com",phoneNumber:"+1 (555) 010-0003",status:"suspended",role:"superadmin"},{id:"user-5",username:"elijah.evans",firstName:"Elijah",lastName:"Evans",email:"elijah.evans@example.com",phoneNumber:"+1 (555) 010-0004",status:"active",role:"admin"},{id:"user-6",username:"amelia.foster",firstName:"Amelia",lastName:"Foster",email:"amelia.foster@example.com",phoneNumber:"+1 (555) 010-0005",status:"inactive",role:"manager"},{id:"user-7",username:"james.garcia",firstName:"James",lastName:"Garcia",email:"james.garcia@example.com",phoneNumber:"+1 (555) 010-0006",status:"invited",role:"cashier"},{id:"user-8",username:"charlotte.harris",firstName:"Charlotte",lastName:"Harris",email:"charlotte.harris@example.com",phoneNumber:"+1 (555) 010-0007",status:"suspended",role:"superadmin"},{id:"user-9",username:"william.irwin",firstName:"William",lastName:"Irwin",email:"william.irwin@example.com",phoneNumber:"+1 (555) 010-0008",status:"active",role:"admin"},{id:"user-10",username:"sophia.jones",firstName:"Sophia",lastName:"Jones",email:"sophia.jones@example.com",phoneNumber:"+1 (555) 010-0009",status:"inactive",role:"manager"},{id:"user-11",username:"benjamin.kim",firstName:"Benjamin",lastName:"Kim",email:"benjamin.kim@example.com",phoneNumber:"+1 (555) 010-0010",status:"invited",role:"cashier"},{id:"user-12",username:"isabella.lewis",firstName:"Isabella",lastName:"Lewis",email:"isabella.lewis@example.com",phoneNumber:"+1 (555) 010-0011",status:"suspended",role:"superadmin"},{id:"user-13",username:"liam.anderson",firstName:"Liam",lastName:"Anderson",email:"liam.anderson@example.com",phoneNumber:"+1 (555) 010-0012",status:"active",role:"admin"},{id:"user-14",username:"olivia.baker",firstName:"Olivia",lastName:"Baker",email:"olivia.baker@example.com",phoneNumber:"+1 (555) 010-0013",status:"inactive",role:"manager"},{id:"user-15",username:"noah.carter",firstName:"Noah",lastName:"Carter",email:"noah.carter@example.com",phoneNumber:"+1 (555) 010-0014",status:"invited",role:"cashier"},{id:"user-16",username:"emma.davis",firstName:"Emma",lastName:"Davis",email:"emma.davis@example.com",phoneNumber:"+1 (555) 010-0015",status:"suspended",role:"superadmin"},{id:"user-17",username:"elijah.evans",firstName:"Elijah",lastName:"Evans",email:"elijah.evans@example.com",phoneNumber:"+1 (555) 010-0016",status:"active",role:"admin"},{id:"user-18",username:"amelia.foster",firstName:"Amelia",lastName:"Foster",email:"amelia.foster@example.com",phoneNumber:"+1 (555) 010-0017",status:"inactive",role:"manager"},{id:"user-19",username:"james.garcia",firstName:"James",lastName:"Garcia",email:"james.garcia@example.com",phoneNumber:"+1 (555) 010-0018",status:"invited",role:"cashier"},{id:"user-20",username:"charlotte.harris",firstName:"Charlotte",lastName:"Harris",email:"charlotte.harris@example.com",phoneNumber:"+1 (555) 010-0019",status:"suspended",role:"superadmin"},{id:"user-21",username:"william.irwin",firstName:"William",lastName:"Irwin",email:"william.irwin@example.com",phoneNumber:"+1 (555) 010-0020",status:"active",role:"admin"},{id:"user-22",username:"sophia.jones",firstName:"Sophia",lastName:"Jones",email:"sophia.jones@example.com",phoneNumber:"+1 (555) 010-0021",status:"inactive",role:"manager"},{id:"user-23",username:"benjamin.kim",firstName:"Benjamin",lastName:"Kim",email:"benjamin.kim@example.com",phoneNumber:"+1 (555) 010-0022",status:"invited",role:"cashier"},{id:"user-24",username:"isabella.lewis",firstName:"Isabella",lastName:"Lewis",email:"isabella.lewis@example.com",phoneNumber:"+1 (555) 010-0023",status:"suspended",role:"superadmin"},{id:"user-25",username:"liam.anderson",firstName:"Liam",lastName:"Anderson",email:"liam.anderson@example.com",phoneNumber:"+1 (555) 010-0024",status:"active",role:"admin"},{id:"user-26",username:"olivia.baker",firstName:"Olivia",lastName:"Baker",email:"olivia.baker@example.com",phoneNumber:"+1 (555) 010-0025",status:"inactive",role:"manager"},{id:"user-27",username:"noah.carter",firstName:"Noah",lastName:"Carter",email:"noah.carter@example.com",phoneNumber:"+1 (555) 010-0026",status:"invited",role:"cashier"},{id:"user-28",username:"emma.davis",firstName:"Emma",lastName:"Davis",email:"emma.davis@example.com",phoneNumber:"+1 (555) 010-0027",status:"suspended",role:"superadmin"},{id:"user-29",username:"elijah.evans",firstName:"Elijah",lastName:"Evans",email:"elijah.evans@example.com",phoneNumber:"+1 (555) 010-0028",status:"active",role:"admin"},{id:"user-30",username:"amelia.foster",firstName:"Amelia",lastName:"Foster",email:"amelia.foster@example.com",phoneNumber:"+1 (555) 010-0029",status:"inactive",role:"manager"},{id:"user-31",username:"james.garcia",firstName:"James",lastName:"Garcia",email:"james.garcia@example.com",phoneNumber:"+1 (555) 010-0030",status:"invited",role:"cashier"},{id:"user-32",username:"charlotte.harris",firstName:"Charlotte",lastName:"Harris",email:"charlotte.harris@example.com",phoneNumber:"+1 (555) 010-0031",status:"suspended",role:"superadmin"},{id:"user-33",username:"william.irwin",firstName:"William",lastName:"Irwin",email:"william.irwin@example.com",phoneNumber:"+1 (555) 010-0032",status:"active",role:"admin"},{id:"user-34",username:"sophia.jones",firstName:"Sophia",lastName:"Jones",email:"sophia.jones@example.com",phoneNumber:"+1 (555) 010-0033",status:"inactive",role:"manager"},{id:"user-35",username:"benjamin.kim",firstName:"Benjamin",lastName:"Kim",email:"benjamin.kim@example.com",phoneNumber:"+1 (555) 010-0034",status:"invited",role:"cashier"},{id:"user-36",username:"isabella.lewis",firstName:"Isabella",lastName:"Lewis",email:"isabella.lewis@example.com",phoneNumber:"+1 (555) 010-0035",status:"suspended",role:"superadmin"}],conversations:[{id:"conversation-0",name:"Alex Johnson",initials:"AJ",preview:"Hey, how’s it going?"},{id:"conversation-1",name:"Sarah Wilson",initials:"SW",preview:"Did you see the new design?"},{id:"conversation-2",name:"Michael Brown",initials:"MB",preview:"Thanks for your help!"},{id:"conversation-3",name:"Emily Davis",initials:"ED",preview:"Let’s catch up tomorrow."},{id:"conversation-4",name:"David Miller",initials:"DM",preview:"The update looks great."},{id:"conversation-5",name:"Jessica Garcia",initials:"JG",preview:"Can you review my pull request?"}],messages:[{id:"m1",conversationId:"conversation-0",text:"Hey, how’s it going?",time:"10:30 AM",own:!1},{id:"m2",conversationId:"conversation-0",text:"Pretty good! Working on the dashboard.",time:"10:31 AM",own:!0}]},Dg={entities:{tasks:{key:"id",version:"version",fields:{version:{type:"number",readOnly:!0},id:{type:"string",readOnly:!0},title:{type:"string"},label:{type:"string"},status:{type:"string"},priority:{type:"string"}}},users:{key:"id",version:"version",fields:{version:{type:"number",readOnly:!0},id:{type:"string",readOnly:!0},username:{type:"string"},firstName:{type:"string"},lastName:{type:"string"},email:{type:"string"},phoneNumber:{type:"string"},status:{type:"string"},role:{type:"string"}}},preferences:{key:"id",version:"version",fields:{version:{type:"number",readOnly:!0},id:{type:"string",readOnly:!0},section:{type:"string"},values:{type:"json"}}},integrations:{key:"id",version:"version",fields:{version:{type:"number",readOnly:!0},id:{type:"string",readOnly:!0},provider:{type:"string"},enabled:{type:"boolean"},config:{type:"json"}}},conversations:{key:"id",fields:{id:{type:"string",readOnly:!0},name:{type:"string"},initials:{type:"string"},preview:{type:"string"},createdAt:{type:"datetime",readOnly:!0}}},messages:{key:"id",fields:{id:{type:"string",readOnly:!0},conversationId:{type:"string"},text:{type:"string"},time:{type:"string"},own:{type:"boolean"},createdAt:{type:"datetime"},senderId:{type:"string",readOnly:!0}}}}};var ct={version:"2.0",layout:{navigation:"sidebar",container:"fluid",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"},data:structuredClone(Dg),connections:[{id:"tasks-db",type:"Collection",entity:"tasks",mock:{seed:structuredClone(Zn.tasks)}},{id:"users-db",type:"Collection",entity:"users",mock:{seed:structuredClone(Zn.users)}},{id:"preferences-db",type:"Collection",entity:"preferences",mock:{seed:[]}},{id:"conversations-db",type:"Collection",entity:"conversations",mock:{seed:structuredClone(Zn.conversations)}},{id:"messages-db",type:"Collection",entity:"messages",mock:{seed:structuredClone(Zn.messages)}},{id:"integrations-db",type:"Collection",entity:"integrations",mock:{seed:[]}}]};function er(e,t){for(let n of e){t(n),er(n.children??[],t);for(let r of Object.values(n.slots??{}))er(r,t)}}function tr(e,t=["tasks","users"]){for(let n of e.pages){if(!t.includes(n.id)||!("blocks"in n)||n.computed?.editorDirty)continue;let r;if(er(n.blocks,(l)=>{if(l.type==="Drawer"&&l.props?.open&&typeof l.props.open==="object"&&"_state"in l.props.open&&l.props.open._state==="editorOpen")r=l}),!r)continue;let i=new Set;if(er(r.children??[],(l)=>{let c=l.type==="Form.Checkbox"?l.props?.checked:l.props?.value;if(["Field","Form.Input","Form.Select","Form.TextArea","Form.Checkbox"].includes(l.type)&&c&&typeof c==="object"&&"_bindState"in c&&typeof c._bindState==="string"&&c._bindState.startsWith("draft."))i.add(c._bindState)}),!i.size)continue;n.state={...n.state,editorBaseline:{},discardEditorOpen:!1};let o=(l)=>({_if:[{_state:l},{_state:l},""]});n.computed={...n.computed,editorDirty:{_not:{_and:[...i].map((l)=>({_eq:[o(l),o(l.replace(/^draft\./,"editorBaseline."))]}))}}},n.lifecycle={...n.lifecycle,onStateChange:[...n.lifecycle?.onStateChange??[],{watch:["editorOpen",...i],run:[]}]},er(n.blocks,(l)=>{for(let c of Object.values(l.events??{})){let d=c.findIndex((p)=>p.action==="SetState"&&p.params?.path==="editorOpen");if(d<0||!c.some((p)=>p.action==="SetState"&&p.params?.path==="draft"))continue;c.splice(d,0,{action:"SetState",params:{path:"editorBaseline",value:Object.fromEntries([...i].map((p)=>[p.slice(6),{_state:p}]))}})}});let s=[{action:"SetState",params:{path:"discardEditorOpen",value:!1}}],a=r.events?.onClose??[];r.events={...r.events,onClose:[{action:"SetState",params:{path:"discardEditorOpen",value:{_computed:"editorDirty"}}},{action:"SetState",params:{path:"editorOpen",value:{_computed:"editorDirty"}}}]},n.blocks.push({type:"Modal",props:{open:{_state:"discardEditorOpen"},pending:{_state:"saving"},title:"Discard unsaved changes?",description:"Your edits will be lost if you discard them."},events:{onClose:s},children:[{type:"Button",props:{label:"Stay",variant:"outline"},events:{onClick:s}},{type:"Button",props:{label:"Discard",variant:"destructive"},events:{onClick:[...s,...a]}}]})}}function zi(e,t){for(let n of e){t(n),zi(n.children??[],t);for(let r of Object.values(n.slots??{}))zi(r,t)}}var mT={login:"sign-in",signup:"sign-up",verification:"otp",recovery:"forgot-password",reset:"sign-up"};function Lg(e,t){return zi(e,(n)=>{if(n.type==="Link"&&n.props?.href?.toString().startsWith("/"))n.visible=!1;if(n.type==="Form"){if(t==="reset")n.props={...n.props,label:"Set a new password"},n.children=(n.children??[]).filter((r)=>r.type!=="Field"||r.props?.name==="password");n.props={...n.props,idempotent:!0},n.events={onSubmit:[{action:"SetState",params:{path:"notice",value:"本地校验完成,未执行认证、发信或密码变更。Local validation only; no authentication, email or credential change occurred."}}]}}if(n.type==="Form.Submit")n.props={...n.props,disabled:!1}}),e}function Mg(e){return[{type:"Paragraph",props:{text:{_state:"notice"}}},{type:"Button",visible:{_state:"showSso"},props:{label:"企业登录 / Enterprise sign in",variant:"outline"},events:{onClick:[{action:"SetState",params:{path:"notice",value:"企业身份服务需由宿主接入。Connect your host identity provider."}}]}},...e.map(([t,n])=>({type:"Link",props:{label:t,href:n}}))]}function Ma(e,t,n,r){if(e==="login"&&t==="minimal-card"){let a=structuredClone(be["sign-in"]);return Lg([a],e),{id:n,path:`/${n}`,title:"Login",state:{saving:!1,currentPath:`/${n}`,notice:"",showSso:!1},blocks:[{type:"Box",props:{className:"min-h-dvh items-center justify-center bg-muted/40 px-6 py-12",gap:"md",align:"center",justify:"center"},children:[{type:"Card",props:{className:"w-full max-w-sm",title:"Login",description:"Enter your email and password below to log into your account."},children:[a,...Mg(r)]}]}]}}let i=Hi.find((a)=>a.id===(e==="login"&&t==="split"?"sign-in-2":mT[e]));if(!i)throw Error(`unknown-auth-step:${e}`);let o=structuredClone(i);if(o.id=n,o.path=`/${n}`,o.state={...o.state,currentPath:o.path,notice:"",showSso:t==="enterprise"},e==="reset")o.title="Set a new password";Lg(o.blocks,e);let s=o.blocks;return zi(o.blocks,(a)=>{if(a.children?.some((l)=>l.type==="Form"))s=a.children}),s.push(...Mg(r)),o}var gT=[["auth-centered","居中登录","Centered sign in","centered",["login"]],["auth-split","品牌分栏登录","Brand split sign in","split",["login"]],["auth-enterprise","企业登录入口","Enterprise sign in","enterprise",["login"]],["auth-minimal","极简卡片登录","Minimal card sign in","minimal-card",["login"]],["auth-registration","注册与验证流程","Registration flow","centered",["signup","verification","login"]],["auth-recovery","账号恢复流程","Account recovery flow","centered",["recovery","verification","reset","login"]]],Gi=gT.map(([e,t,n,r,i])=>({id:e,title:{zh:t,en:n},description:`${n}: shared Admin forms, native validation and host-owned authentication.`,solution:{functions:["auth"],scenarios:i.map((o)=>o==="reset"?"recovery":o),unit:i.length>1?"flow":"page",industries:[],readiness:"interactive-demo",hostRequirements:["Host authentication, session and verification/recovery policy","Replace local demonstration submit actions with authorized host bindings"],limitations:["No real authentication, mail, OAuth or password change occurs.","Never persist credentials in Spec state, exports or logs."]},spec:{version:"2.0",pages:i.map((o)=>Ma(o,r,`${e}-${o==="verification"?"verify":o}`,i.filter((s)=>s!==o).map((s)=>[s,`/${e}-${s==="verification"?"verify":s}`])))},controls:[{id:"sso",label:{zh:"企业登录入口",en:"Enterprise sign in"},values:[!1,!0],target:{pageId:`${e}-${i[0]}`,property:"showSso"}}]}));function $a(e){let t=Gi.find((n)=>n.id===e);if(!t)throw Error(`missing-auth-solution:${e}`);return t}function fT(e){let t=$a(e).spec.pages[0];if(!t)throw Error(`missing-auth-solution-page:${e}`);return structuredClone(t)}var hT={brandHeading:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},entryHeading:{kind:"block-prop",blockType:"Heading",occurrence:1,property:"text"},entrySubtitle:{kind:"block-prop",blockType:"Paragraph",occurrence:0,property:"text"},authForm:{kind:"block-node",blockType:"Form",occurrence:0},ssoButtonLabel:{kind:"block-prop",blockType:"Button",occurrence:0,property:"label"},ssoAction:{kind:"block-events",blockType:"Button",occurrence:0,property:"onClick"}},yT=[["centered","auth-centered"],["split-brand","auth-split"],["enterprise-sso","auth-enterprise"],["minimal-card","auth-minimal"]],Fa={schema:"uibot.variant-contract.v1",familyId:"auth.entry.v1",level:"L3",targetKind:"page",title:{zh:"认证入口页面族",en:"Authentication entry pages"},description:"Swappable single-page sign-in entry variants sharing form fields, host events and state contracts.",semanticSlots:[{id:"brandHeading",label:{zh:"品牌标题",en:"Brand heading"},preserveMode:"when-customized"},{id:"entryHeading",label:{zh:"入口主标题",en:"Entry heading"},required:!0,preserveMode:"when-customized"},{id:"entrySubtitle",label:{zh:"入口副标题",en:"Entry subtitle"},preserveMode:"when-customized"},{id:"authForm",label:{zh:"认证表单与事件",en:"Auth form & submit events"},required:!0,preserveMode:"always"},{id:"ssoButtonLabel",label:{zh:"企业登录文案",en:"SSO button label"},preserveMode:"when-customized"},{id:"ssoAction",label:{zh:"企业登录动作",en:"SSO action"},preserveMode:"always"}],variants:yT.map(([e,t])=>{let n=$a(t);return{id:e,title:n.title,description:n.description,resourceId:`template:${n.id}`,slotBindings:e==="minimal-card"?{entryHeading:{kind:"block-prop",blockType:"Card",occurrence:0,property:"title"},entrySubtitle:{kind:"block-prop",blockType:"Card",occurrence:0,property:"description"},authForm:{kind:"block-node",blockType:"Form",occurrence:0},ssoButtonLabel:{kind:"block-prop",blockType:"Button",occurrence:0,property:"label"},ssoAction:{kind:"block-events",blockType:"Button",occurrence:0,property:"onClick"}}:structuredClone(hT),pageTemplate:fT(t)}})},bT=$a("auth-centered"),Ki=Ma("login","centered","auth-login",[]);Ki.path="/";Ki.state={...Ki.state,currentPath:"/"};var Ua={id:"auth",title:{zh:"登录",en:"Sign in"},description:"Sign in using the shared authentication page source.",solution:structuredClone(bT.solution),spec:{version:"2.0",pages:[Ki]},controls:[]};var Wi=[{id:"attached",title:{zh:"标准侧栏",en:"Attached sidebar"},layout:{navigation:"sidebar",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"}},{id:"floating",title:{zh:"悬浮侧栏",en:"Floating sidebar"},layout:{navigation:"sidebar",navigationStyle:"floating",offcanvas:"floating",sidebar:"expanded"}},{id:"compact",title:{zh:"紧凑折叠侧栏",en:"Compact sidebar"},layout:{navigation:"sidebar",navigationStyle:"attached",offcanvas:"attached",sidebar:"folded"}}],$g=[{id:"attached",aliases:["admin-sidebar"],title:{zh:"标准侧栏",en:"Attached sidebar"},description:"Expanded attached sidebar navigation workspace shell.",layout:{shell:"admin-sidebar",...structuredClone(Wi[0]?.layout??{})},supportsSidebarSlots:!0,supportsSidebarBehavior:!0,sidebarSlotPlacement:"sidebar"},{id:"floating",aliases:["sidebar-floating","floating-inset"],title:{zh:"悬浮侧栏",en:"Floating sidebar"},description:"Workspace shell with floating navigation rail and floating drawer.",layout:{shell:"sidebar-floating",...structuredClone(Wi[1]?.layout??{})},supportsSidebarSlots:!0,supportsSidebarBehavior:!0,sidebarSlotPlacement:"sidebar"},{id:"compact",title:{zh:"紧凑折叠侧栏",en:"Compact sidebar"},description:"Collapsed icon rail maximizing horizontal canvas width.",layout:{shell:"admin-sidebar",...structuredClone(Wi[2]?.layout??{})},supportsSidebarSlots:!0,supportsSidebarBehavior:!0,sidebarSlotPlacement:"sidebar"},{id:"top-navbar",title:{zh:"顶部横栏导航",en:"Top navbar navigation"},description:"Horizontal top bar navigation shell without a persistent sidebar rail.",layout:{shell:"top-navbar",navigation:"navbar",navigationStyle:"attached",offcanvas:"attached"},supportsSidebarSlots:!1,supportsSidebarBehavior:!1,sidebarSlotPlacement:"hidden"},{id:"console-drilldown",title:{zh:"控制台下钻侧栏",en:"Console drilldown"},description:"ConsoleShell workspace with top command bar and hierarchical drilldown sidebar navigation.",layout:{shell:"console-drilldown",navigation:"sidebar",navigationStyle:"attached",offcanvas:"attached"},supportsSidebarSlots:!0,supportsSidebarBehavior:!1,sidebarSlotPlacement:"sidebar"},{id:"sidebar-inset",title:{zh:"内嵌卡片工作区",en:"Inset sidebar workspace"},description:"Attached sidebar paired with an inset rounded workspace canvas card on a muted backdrop.",layout:{shell:"sidebar-inset",navigation:"sidebar",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"},supportsSidebarSlots:!0,supportsSidebarBehavior:!0,sidebarSlotPlacement:"sidebar"},{id:"dual-pane",title:{zh:"双栏主从工作台",en:"Dual-pane workspace"},description:"Primary icon rail beside a secondary navigation pane sharing the same main workspace canvas.",layout:{shell:"dual-pane",navigation:"sidebar",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded"},supportsSidebarSlots:!0,supportsSidebarBehavior:!0,sidebarSlotPlacement:"sidebar"}],ja={schema:"uibot.variant-contract.v1",familyId:"shell.workspace.v1",level:"L4",targetKind:"shell",title:{zh:"应用工作台壳",en:"Application workspace shell"},description:"Swappable PageLayout navigation shells preserving all pages, menus, entities and standalone routes.",semanticSlots:[{id:"shell",label:{zh:"工作台壳结构",en:"Workspace shell structure"},required:!0},{id:"navigation",label:{zh:"主导航模式",en:"Primary navigation mode"},required:!0},{id:"navigationStyle",label:{zh:"导航容器风格",en:"Navigation chrome style"}},{id:"offcanvas",label:{zh:"抽屉贴边策略",en:"Mobile drawer style"}},{id:"sidebarBehavior",label:{zh:"侧栏折叠行为",en:"Sidebar behavior"}}],variants:$g.map((e)=>({id:e.id,...e.aliases?{aliases:e.aliases}:{},title:e.title,description:e.description,resourceId:`shell:${e.id}`,slotBindings:{shell:{kind:"spec-layout",property:"shell"},navigation:{kind:"spec-layout",property:"navigation"},navigationStyle:{kind:"spec-layout",property:"navigationStyle"},offcanvas:{kind:"spec-layout",property:"offcanvas"},...e.supportsSidebarBehavior?{sidebarBehavior:{kind:"spec-layout",property:"sidebar"}}:{}},shellLayout:structuredClone(e.layout),shellCapabilities:{supportsSidebarSlots:e.supportsSidebarSlots,supportsSidebarBehavior:e.supportsSidebarBehavior,sidebarSlotPlacement:e.sidebarSlotPlacement}}))},Fg=[{id:"auth-frame-centered",title:{zh:"独立居中布局",en:"Standalone centered layout"},contentBlockId:"auth-content",frame:{type:"Box",id:"auth-frame",props:{className:"min-h-dvh bg-background",gap:"none"},children:[{type:"Box",id:"auth-content",props:{className:"w-full",gap:"none"},children:[]}]}},{id:"auth-frame-split",title:{zh:"品牌分栏布局",en:"Brand split layout"},contentBlockId:"auth-content",frame:{type:"Box",id:"auth-frame",props:{className:"!grid lg:grid-cols-2 min-h-dvh",gap:"none"},children:[{type:"Box",id:"auth-brand",props:{className:"hidden lg:flex bg-muted items-center justify-center px-6",gap:"lg"},children:[{type:"Heading",props:{text:"Welcome",level:2}},{type:"Paragraph",props:{text:"Your workspace, connected.",muted:!0}}]},{type:"Box",id:"auth-content",props:{className:"w-full",gap:"none"},children:[]}]}}],qa={schema:"uibot.variant-contract.v1",familyId:"auth.frame.v1",level:"L3",targetKind:"frame",title:{zh:"认证页面外框",en:"Authentication outer frame"},description:"Swappable outer frames wrapping standalone authentication pages while preserving forms and host events.",semanticSlots:[{id:"content",label:{zh:"认证页面正文",en:"Authentication body"},required:!0,preserveMode:"always"},{id:"brandHeading",label:{zh:"分栏品牌标题",en:"Split brand heading"},preserveMode:"when-customized"},{id:"brandTagline",label:{zh:"分栏品牌说明",en:"Split brand tagline"},preserveMode:"when-customized"}],variants:Fg.map((e)=>({id:e.id,title:e.title,description:`${e.title.en}: outer frame slot wrapper`,resourceId:`layout:${e.id}`,slotBindings:{content:{kind:"block-children",blockIdSuffix:e.contentBlockId},...e.id==="auth-frame-split"?{brandHeading:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},brandTagline:{kind:"block-prop",blockType:"Paragraph",occurrence:0,property:"text"}}:{}},frameTemplate:{contentBlockId:e.contentBlockId,frame:structuredClone(e.frame)}}))};var Ug=[{value:"backlog",label:"Backlog"},{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],jg=[{key:"id",label:"ID"},{key:"title",label:"Title"},{key:"status",label:"Status"},{key:"priority",label:"Priority"},{key:"category",label:"Category"}],Va=[{id:"TASK-101",title:"Finalize Q4 release checklist",description:"Confirm CI, tarball smoke and rollback steps before cutover.",status:"in-progress",priority:"high",category:"Release",meta:"High · In Progress",version:1},{id:"TASK-102",title:"Audit API rate-limit alerts",description:"Review warning thresholds across staging and production gateways.",status:"todo",priority:"medium",category:"Operations",meta:"Medium · To Do",version:1},{id:"TASK-103",title:"Publish onboarding guide",description:"Add quickstart walkthrough and sample workspace presets.",status:"done",priority:"low",category:"Docs",meta:"Low · Done",version:1},{id:"TASK-104",title:"Investigate webhook retry spikes",description:"Trace timeout spikes on partner callback endpoints.",status:"backlog",priority:"high",category:"Operations",meta:"High · Backlog",version:1}];function nr(e){return[{action:"Request",params:{connectionId:e,request:{id:`find-${e}`,connectionId:e,payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"}}]}function vT(e,t){return{id:"crud-create-form",type:"Form",props:{label:"Create record"},events:{onSubmit:[{action:"Request",params:{connectionId:e,request:{id:`insert-${e}`,connectionId:e,payload:{operation:"InsertOne",data:{title:{_state:"draftTitle"},description:{_state:"draftDescription"},status:{_state:"draftStatus"},priority:{_state:"draftPriority"},category:{_state:"draftCategory"}}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:[...nr(e),{action:"SetState",params:{path:"createOpen",value:!1}},{action:"SetState",params:{path:"draftTitle",value:""}},{action:"SetState",params:{path:"draftDescription",value:""}},{action:"DisplayMessage",params:{content:"Record created"}}]}]},children:[{id:"crud-create-title",type:"Form.Input",props:{name:"title",label:"Title",placeholder:"Enter title...",required:!0,value:{_bindState:"draftTitle"}}},{id:"crud-create-description",type:"Form.TextArea",props:{name:"description",label:"Description",placeholder:"Add details...",value:{_bindState:"draftDescription"}}},{id:"crud-create-status",type:"Form.Select",props:{name:"status",label:"Status",options:t,value:{_bindState:"draftStatus"}}},{id:"crud-create-priority",type:"Form.Select",props:{name:"priority",label:"Priority",options:[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],value:{_bindState:"draftPriority"}}},{id:"crud-create-submit",type:"Form.Submit",props:{label:"Create"}}]}}function kT(e,t){return{id:"crud-update-form",type:"Form",props:{label:"Update selected record"},events:{onSubmit:[{action:"Request",params:{connectionId:e,request:{id:`update-${e}`,connectionId:e,payload:{operation:"UpdateOne",filter:{id:{_state:"selectedId"}},data:{title:{_state:"editTitle"},status:{_state:"editStatus"},priority:{_state:"editPriority"}}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:[...nr(e),{action:"DisplayMessage",params:{content:"Record updated"}}]}]},children:[{id:"crud-edit-title",type:"Form.Input",props:{name:"editTitle",label:"Selected Title",value:{_bindState:"editTitle"}}},{id:"crud-edit-status",type:"Form.Select",props:{name:"editStatus",label:"Status",options:t,value:{_bindState:"editStatus"}}},{id:"crud-edit-priority",type:"Form.Select",props:{name:"editPriority",label:"Priority",options:[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],value:{_bindState:"editPriority"}}},{id:"crud-edit-submit",type:"Form.Submit",props:{label:"Save changes"}}]}}function wT(e){return{id:"crud-delete-btn",type:"Button",props:{label:"Delete selected",variant:"destructive"},events:{onClick:[{action:"Request",params:{connectionId:e,request:{id:`delete-${e}`,connectionId:e,payload:{operation:"DeleteOne",filter:{id:{_state:"selectedId"}}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:[...nr(e),{action:"DisplayMessage",params:{content:"Record deleted"}}]}]}}}function ST(e){return{id:"crud-toolbar",type:"Box",props:{direction:"row",gap:"sm",align:"end",wrap:!0},children:[{id:"crud-search",type:"Form.Input",props:{name:"searchQuery",label:"Search",placeholder:"Filter by title...",value:{_bindState:"searchQuery"}}},{id:"crud-status-filter",type:"Form.Select",props:{name:"statusFilter",label:"Status",options:[{value:"",label:"All statuses"},...e],value:{_bindState:"statusFilter"}}},{id:"crud-new-toggle",type:"Button",props:{label:"New record"},events:{onClick:[{action:"SetState",params:{path:"createOpen",value:{_not:{_state:"createOpen"}}}}]}}]}}function xT(e,t,n,r,i,o,s){let a=[{action:"SetState",params:{path:"selectedId",value:{_event:"values.id"}}}];if(e==="kanban-view")return[{id:"crud-view-kanban",type:"CollectionKanban",props:{label:n,rows:{_computed:"filteredRows"},groupBy:"status",lanes:r,titleField:"title",subtitleField:"description",badgeField:"priority",selectedId:{_state:"selectedId"}},events:{onSelect:a,onMove:[{action:"SetState",params:{path:"selectedId",value:{_event:"values.id"}}},{action:"Request",params:{connectionId:t,request:{id:`move-${t}`,connectionId:t,payload:{operation:"UpdateOne",filter:{id:{_event:"values.id"}},data:{status:{_event:"values.to"}}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:[...nr(t),{action:"DisplayMessage",params:{content:"Status updated"}}]}]}},{id:"crud-selected-panel",type:"Card",props:{title:"Selected record",description:"Edit or remove the currently selected item."},children:[o,s]}];if(e==="gallery-view")return[{id:"crud-view-gallery",type:"ItemGrid",props:{label:n,items:{_computed:"filteredRows"},columns:"3",actionLabel:"Select record",emptyText:"No matching records"},events:{onSelect:a}},{id:"crud-selected-panel",type:"Card",props:{title:"Selected record",description:"Edit or remove the currently selected item."},children:[o,s]}];if(e==="master-detail-view")return[{id:"crud-view-master-detail",type:"RecordMasterDetail",props:{label:n,rows:{_computed:"filteredRows"},selectedId:{_state:"selectedId"},titleField:"title",subtitleField:"description",badgeField:"status",fields:i},events:{onSelect:a},slots:{detail:[o,s]}}];return[{id:"crud-view-table",type:"DataTable",props:{label:n,rows:{_computed:"filteredRows"},columns:i,rowKey:"id",selectable:!0,actions:[{id:"select",label:"Select"}]},events:{onRowAction:a,onAdd:[{action:"SetState",params:{path:"createOpen",value:!0}}]}},{id:"crud-selected-panel",type:"Card",props:{title:"Selected record",description:"Edit or remove the currently selected item."},children:[o,s]}]}function Ha(e,t={}){let n=t.pageId??"records",r=t.path??"/records",i=t.title??"Task Records",o=t.description??"Browse, filter, create, update and delete records across views.",s=t.connectionId??"records-db",a=structuredClone(t.lanes??Ug),l=structuredClone(t.columns??jg),c=structuredClone(t.seedRows??Va),d=c[0]??{},p=typeof d.id==="string"?d.id:"",m=typeof d.title==="string"?d.title:"",u=typeof d.status==="string"?d.status:a[0]?.value??"todo",f=typeof d.priority==="string"?d.priority:"medium",g=vT(s,a),h=kT(s,a),b=wT(s);return{id:n,path:r,title:i,lifecycle:{onMount:nr(s)},state:{currentPath:r,rows:c,loading:!1,uiError:"",searchQuery:"",statusFilter:"",selectedId:p,createOpen:!1,draftTitle:"",draftDescription:"",draftStatus:a[0]?.value??"todo",draftPriority:"medium",draftCategory:"General",editTitle:m,editStatus:u,editPriority:f},computed:{filteredRows:{_filter:[{_state:"rows"},{_and:[{_or:[{_eq:[{_state:"statusFilter"},""]},{_eq:[{_item:"status"},{_state:"statusFilter"}]}]},{_or:[{_eq:[{_state:"searchQuery"},""]},{_contains:[{_item:"title"},{_state:"searchQuery"}]}]}]}]},selectedRecord:{_find:[{_state:"rows"},{_eq:[{_item:"id"},{_state:"selectedId"}]}]},visibleCount:{_len:{_computed:"filteredRows"}}},blocks:[{id:"crud-shell",type:"PageLayout",props:{title:i,appearance:"admin",routes:[{label:i,href:r}]},children:[{id:"crud-header",type:"PanelHeader",props:{title:i,description:o}},ST(a),{id:"crud-create-card",type:"Card",visible:{_state:"createOpen"},props:{title:"Create record",description:"Add a new entry to this collection."},children:[g]},...xT(e,s,i,a,l,h,b)]}]}}function qg(e,t={}){let n=t.entityName??"tasks",r=t.connectionId??"records-db",i=structuredClone(t.seedRows??Va),o=Ha(e,t),s={entities:{[n]:{key:"id",version:"version",fields:{id:{type:"string",readOnly:!0},version:{type:"number",readOnly:!0},title:{type:"string"},description:{type:"string"},status:{type:"string"},priority:{type:"string"},category:{type:"string"},meta:{type:"string"}}}}};return{version:"2.0",layout:{shell:"admin-sidebar",navigation:"sidebar",navigationStyle:"attached",offcanvas:"attached",sidebar:"expanded",container:"fluid"},data:s,connections:[{id:r,type:"Collection",entity:n,mock:{seed:i}}],pages:[o]}}var Vg=[{id:"table-view",solutionId:"data-crud-table",aliases:["table"],title:{zh:"表格视图",en:"Table view"},description:"High-density searchable CRUD data table bound to a uibot.data.v1 Collection."},{id:"kanban-view",solutionId:"data-crud-kanban",aliases:["kanban","board"],title:{zh:"看板视图",en:"Kanban board view"},description:"Status-lane kanban board with drag/button transitions and CRUD forms."},{id:"gallery-view",solutionId:"data-crud-gallery",aliases:["gallery","cards"],title:{zh:"卡片画廊视图",en:"Card gallery view"},description:"Responsive card gallery over the same Collection filter, selection and CRUD state."},{id:"master-detail-view",solutionId:"data-crud-master-detail",aliases:["master-detail","split"],title:{zh:"主从分栏视图",en:"Master-detail view"},description:"Split selectable list paired with an inline detail inspector and CRUD editor."}],za=Vg.map((e)=>({id:e.solutionId,title:e.title,description:e.description,solution:{functions:["data","tasks"],scenarios:["crud",e.id,"collection"],unit:"page",industries:[],readiness:"interactive-demo",hostRequirements:["Connect the logical Collection driver or keep mock seeds for development preview"],limitations:["Portal preview writes stay session-local until bound to a host data gateway."],requirements:{connections:[{id:"records-db",type:"Collection"}]}},spec:qg(e.id),controls:[]})),Ka={schema:"uibot.variant-contract.v1",familyId:"data.crud-page.v1",level:"L3",targetKind:"page",title:{zh:"数据集合多视图工作页",en:"Collection CRUD multi-view page"},description:"Four swappable Collection CRUD page views (Table, Kanban, Gallery, Master-Detail) sharing one uibot.data.v1 entity, filter, selection and mutation contract.",semanticSlots:[{id:"pageTitle",label:{zh:"页面标题",en:"Page title"},preserveMode:"when-customized"},{id:"headerTitle",label:{zh:"页头标题",en:"Header title"},preserveMode:"when-customized"},{id:"headerDescription",label:{zh:"页头说明",en:"Header description"},preserveMode:"when-customized"},{id:"searchInput",label:{zh:"搜索框",en:"Search input"},preserveMode:"always"},{id:"statusFilter",label:{zh:"状态筛选",en:"Status filter"},preserveMode:"always"},{id:"createForm",label:{zh:"新建记录表单",en:"Create record form"},required:!0,preserveMode:"always"},{id:"updateForm",label:{zh:"编辑记录表单",en:"Update record form"},required:!0,preserveMode:"always"},{id:"deleteButton",label:{zh:"删除记录动作",en:"Delete record action"},required:!0,preserveMode:"always"},{id:"lifecycle",label:{zh:"集合加载生命周期",en:"Collection load lifecycle"},required:!0,preserveMode:"always"},{id:"state",label:{zh:"筛选与表单状态",en:"Filter & form state"},required:!0,preserveMode:"always"},{id:"computed",label:{zh:"派生活跃集合",en:"Derived filtered collection"},required:!0,preserveMode:"always"}],variants:Vg.map((e)=>({id:e.id,aliases:e.aliases,title:e.title,description:e.description,resourceId:`solution:${e.solutionId}`,slotBindings:{pageTitle:{kind:"page-field",property:"title"},headerTitle:{kind:"block-prop",blockIdSuffix:"crud-header",blockType:"PanelHeader",property:"title"},headerDescription:{kind:"block-prop",blockIdSuffix:"crud-header",blockType:"PanelHeader",property:"description"},searchInput:{kind:"block-node",blockIdSuffix:"crud-search",blockType:"Form.Input"},statusFilter:{kind:"block-node",blockIdSuffix:"crud-status-filter",blockType:"Form.Select"},createForm:{kind:"block-node",blockIdSuffix:"crud-create-form",blockType:"Form"},updateForm:{kind:"block-node",blockIdSuffix:"crud-update-form",blockType:"Form"},deleteButton:{kind:"block-node",blockIdSuffix:"crud-delete-btn",blockType:"Button"},lifecycle:{kind:"page-field",property:"lifecycle"},state:{kind:"page-field",property:"state"},computed:{kind:"page-field",property:"computed"}},pageTemplate:Ha(e.id)}))};function CT(){return{step:"workspace",workspaceName:"Acme Studio",teamSize:"11-50",primaryGoal:"internal-tools",inviteEmails:"alex@acme.dev, maya@acme.dev",enableSso:!1,stepWorkspaceDone:!0,stepDataDone:!1,stepTeamDone:!1,completed:!1,statusMessage:""}}function IT(){return[{id:"onboarding-root",type:"Box",props:{className:"mx-auto flex max-w-3xl flex-col gap-6 p-6"},children:[{id:"onboarding-header",type:"Box",props:{className:"flex flex-wrap items-center justify-between gap-3"},children:[{id:"onboarding-title-group",type:"Box",props:{className:"flex flex-col gap-1"},children:[{id:"onboarding-title",type:"Heading",props:{level:1,text:"Set up your workspace"}},{id:"onboarding-subtitle",type:"Paragraph",props:{muted:!0,size:"sm",text:"Configure workspace defaults, pick a starter workflow, and invite collaborators."}}]},{id:"onboarding-stage-badge",type:"Badge",props:{variant:"secondary",label:{_state:"step"}}}]},{id:"onboarding-step-nav",type:"Box",props:{direction:"row",className:"flex flex-wrap gap-2"},children:[{id:"step-btn-workspace",type:"Button",props:{label:"1. Workspace",variant:"outline",size:"sm"},events:{onClick:[{action:"SetState",params:{path:"step",value:"workspace"}}]}},{id:"step-btn-workflow",type:"Button",props:{label:"2. Starter Goal",variant:"outline",size:"sm"},events:{onClick:[{action:"SetState",params:{path:"step",value:"workflow"}}]}},{id:"step-btn-team",type:"Button",props:{label:"3. Invite Team",variant:"outline",size:"sm"},events:{onClick:[{action:"SetState",params:{path:"step",value:"team"}}]}}]},{id:"onboarding-complete-alert",type:"Alert",visible:{_state:"completed"},props:{variant:"success",title:"Workspace ready",description:{_state:"statusMessage"}}},{id:"onboarding-step-workspace-card",type:"Card",visible:{_eq:[{_state:"step"},"workspace"]},props:{title:"Step 1 · Workspace profile",description:"Choose a display name and team size for your workspace."},children:[{id:"onboarding-workspace-form",type:"Form",props:{label:"Workspace details",idempotent:!0},events:{onSubmit:[{action:"SetState",params:{path:"stepWorkspaceDone",value:!0}},{action:"SetState",params:{path:"step",value:"workflow"}}]},children:[{id:"onboarding-name-input",type:"Form.Input",props:{name:"workspaceName",label:"Workspace name",placeholder:"e.g. Acme Product Ops",required:!0,value:{_bindState:"workspaceName"}}},{id:"onboarding-team-size",type:"Form.Select",props:{name:"teamSize",label:"Team size",value:{_bindState:"teamSize"},options:[{value:"1-10",label:"1–10 people"},{value:"11-50",label:"11–50 people"},{value:"51-200",label:"51–200 people"},{value:"200+",label:"200+ people"}]}},{id:"onboarding-step1-next",type:"Form.Submit",props:{label:"Continue to starter goal"}}]}]},{id:"onboarding-step-workflow-card",type:"Card",visible:{_eq:[{_state:"step"},"workflow"]},props:{title:"Step 2 · Primary use case",description:"Tailor default views and connection templates to your main workflow."},children:[{id:"onboarding-goal-select",type:"Form.Select",props:{name:"primaryGoal",label:"Primary workflow",value:{_bindState:"primaryGoal"},options:[{value:"internal-tools",label:"Internal ops & CRUD tables"},{value:"ai-copilot",label:"AI assistant & agent console"},{value:"customer-portal",label:"Customer portal & billing"}]}},{id:"onboarding-sso-checkbox",type:"Form.Checkbox",props:{name:"enableSso",label:"Require enterprise SSO after launch",description:"Host identity provider wiring is configured after onboarding.",checked:{_bindState:"enableSso"}}},{id:"onboarding-step2-actions",type:"Box",props:{direction:"row",className:"flex gap-2 pt-3"},children:[{id:"onboarding-step2-back",type:"Button",props:{label:"Back",variant:"outline"},events:{onClick:[{action:"SetState",params:{path:"step",value:"workspace"}}]}},{id:"onboarding-step2-next",type:"Button",props:{label:"Continue to team invite"},events:{onClick:[{action:"SetState",params:{path:"stepDataDone",value:!0}},{action:"SetState",params:{path:"step",value:"team"}}]}}]}]},{id:"onboarding-step-team-card",type:"Card",visible:{_eq:[{_state:"step"},"team"]},props:{title:"Step 3 · Invite teammates",description:"Enter comma-separated emails to prepare initial workspace invitations."},children:[{id:"onboarding-invite-input",type:"Form.Input",props:{name:"inviteEmails",label:"Teammate emails",placeholder:"alex@acme.dev, maya@acme.dev",value:{_bindState:"inviteEmails"}}},{id:"onboarding-step3-actions",type:"Box",props:{direction:"row",className:"flex gap-2 pt-3"},children:[{id:"onboarding-step3-back",type:"Button",props:{label:"Back",variant:"outline"},events:{onClick:[{action:"SetState",params:{path:"step",value:"workflow"}}]}},{id:"onboarding-finish-btn",type:"Button",props:{label:"Finish onboarding"},events:{onClick:[{action:"SetState",params:{path:"stepTeamDone",value:!0}},{action:"SetState",params:{path:"completed",value:!0}},{action:"SetState",params:{path:"statusMessage",value:"Local demo setup saved. Connect your host provisioning API to create real workspaces and send invites."}}]}}]}]}]}]}function AT(){return[{id:"onboarding-root",type:"Box",props:{className:"mx-auto flex max-w-4xl flex-col gap-6 p-6"},children:[{id:"onboarding-header",type:"Box",props:{className:"flex flex-wrap items-center justify-between gap-3"},children:[{id:"onboarding-title-group",type:"Box",props:{className:"flex flex-col gap-1"},children:[{id:"onboarding-title",type:"Heading",props:{level:1,text:"Workspace launch checklist"}},{id:"onboarding-subtitle",type:"Paragraph",props:{muted:!0,size:"sm",text:"Track activation milestones and finalize initial workspace configuration in one view."}}]},{id:"onboarding-finish-btn",type:"Button",props:{label:"Complete setup"},events:{onClick:[{action:"SetState",params:{path:"stepWorkspaceDone",value:!0}},{action:"SetState",params:{path:"stepDataDone",value:!0}},{action:"SetState",params:{path:"stepTeamDone",value:!0}},{action:"SetState",params:{path:"completed",value:!0}},{action:"SetState",params:{path:"statusMessage",value:"All activation checks marked complete in demo mode. Wire your host onboarding endpoint for persistence."}}]}}]},{id:"onboarding-complete-alert",type:"Alert",visible:{_state:"completed"},props:{variant:"success",title:"Activation complete",description:{_state:"statusMessage"}}},{id:"onboarding-checklist-grid",type:"Box",props:{className:"grid gap-4 md:grid-cols-2"},children:[{id:"onboarding-checklist-card",type:"Card",props:{title:"Activation checklist",description:"Check off each milestone as your team prepares for launch."},children:[{id:"check-workspace",type:"Form.Checkbox",props:{name:"stepWorkspaceDone",label:"Name workspace and choose team size",checked:{_bindState:"stepWorkspaceDone"}}},{id:"check-data",type:"Form.Checkbox",props:{name:"stepDataDone",label:"Select starter workflow & SSO policy",checked:{_bindState:"stepDataDone"}}},{id:"check-team",type:"Form.Checkbox",props:{name:"stepTeamDone",label:"Prepare teammate invitations",checked:{_bindState:"stepTeamDone"}}}]},{id:"onboarding-quick-profile-card",type:"Card",props:{title:"Workspace quick settings",description:"Adjust name, goal, and invite list before launch."},children:[{id:"onboarding-name-input",type:"Form.Input",props:{name:"workspaceName",label:"Workspace name",value:{_bindState:"workspaceName"}}},{id:"onboarding-goal-select",type:"Form.Select",props:{name:"primaryGoal",label:"Primary workflow",value:{_bindState:"primaryGoal"},options:[{value:"internal-tools",label:"Internal ops & CRUD tables"},{value:"ai-copilot",label:"AI assistant & agent console"},{value:"customer-portal",label:"Customer portal & billing"}]}},{id:"onboarding-invite-input",type:"Form.Input",props:{name:"inviteEmails",label:"Teammate emails",value:{_bindState:"inviteEmails"}}}]}]}]}]}function Yi(e){return{id:"onboarding",path:"/onboarding",title:e==="onboarding-wizard"?"Guided Onboarding Wizard":"Workspace Launch Checklist",state:CT(),blocks:e==="onboarding-wizard"?IT():AT()}}function Ga(e){return{version:"2.0",pages:[Yi(e)]}}var Wa=[{id:"onboarding-wizard",title:{zh:"引导式新手向导",en:"Guided onboarding wizard"},description:"Multi-step interactive workspace onboarding wizard covering profile setup, starter workflow selection, and team invitations.",solution:{functions:["onboarding"],scenarios:["welcome","workspace","guided-setup"],unit:"flow",industries:["admin","crm"],readiness:"interactive-demo",hostRequirements:["Connect workspace provisioning and team invitation endpoints in your host action handler"],limitations:["Completing onboarding updates local demo state only; no tenant or email invitation is dispatched"]},spec:Ga("onboarding-wizard"),controls:[]},{id:"onboarding-checklist",title:{zh:"工作区启动清单",en:"Workspace launch checklist"},description:"Single-screen activation checklist paired with workspace quick settings, hot-swappable with onboarding-wizard.",solution:{functions:["onboarding"],scenarios:["profile","workspace","guided-setup"],unit:"page",industries:["admin","creation"],readiness:"interactive-demo",hostRequirements:["Persist activation checklist milestones and workspace profile through your host API"],limitations:["Checklist toggles and profile inputs operate on local demonstration state until bound to a host service"]},spec:Ga("onboarding-checklist"),controls:[]}],Ya={schema:"uibot.variant-contract.v1",familyId:"onboarding.flow.v1",level:"L3",targetKind:"page",title:{zh:"SaaS 首次使用与引导套件",en:"SaaS onboarding flows"},description:"Swappable workspace onboarding experiences (multi-step wizard ↔ single-screen activation checklist) sharing workspace setup state.",semanticSlots:[{id:"pageTitle",label:{zh:"页面标题",en:"Page title"},preserveMode:"when-customized"},{id:"pageState",label:{zh:"引导状态",en:"Onboarding state"},preserveMode:"when-customized"},{id:"pagePath",label:{zh:"页面路由",en:"Route path"},preserveMode:"when-customized"}],variants:[{id:"onboarding-wizard",aliases:["wizard","guided-setup"],title:{zh:"分步引导向导",en:"Guided wizard"},description:"Three-step guided onboarding flow (workspace, starter goal, team invite).",resourceId:"template:onboarding-wizard",slotBindings:{pageTitle:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},pageState:{kind:"page-field",property:"state"},pagePath:{kind:"page-field",property:"path"}},pageTemplate:Yi("onboarding-wizard")},{id:"onboarding-checklist",aliases:["checklist","launch-checklist"],title:{zh:"启动检查清单",en:"Launch checklist"},description:"Single-screen activation checklist alongside workspace quick settings.",resourceId:"template:onboarding-checklist",slotBindings:{pageTitle:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},pageState:{kind:"page-field",property:"state"},pagePath:{kind:"page-field",property:"path"}},pageTemplate:Yi("onboarding-checklist")}]};var Hg=[{id:"INV-2026-11",period:"Nov 2026",plan:"Team Pro",status:"paid",amount:"$149.00",seats:"12 seats",version:1},{id:"INV-2026-10",period:"Oct 2026",plan:"Team Pro",status:"paid",amount:"$149.00",seats:"12 seats",version:1},{id:"INV-2026-09",period:"Sep 2026",plan:"Growth",status:"pending",amount:"$79.00",seats:"6 seats",version:1}],RT={entities:{invoices:{key:"id",version:"version",fields:{id:{type:"string",readOnly:!0},version:{type:"number",readOnly:!0},period:{type:"string"},plan:{type:"string"},status:{type:"string"},amount:{type:"string"},seats:{type:"string"}}}}};function Qa(){return[{action:"Request",params:{connectionId:"billing-db",request:{id:"find-billing-invoices",connectionId:"billing-db",payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"}}]}function PT(){return{rows:structuredClone(Hg),loading:!1,uiError:"",annualBilling:!0,statusFilter:"all",selectedInvoiceId:"INV-2026-11",notice:"",newPeriod:"Dec 2026",newPlan:"Team Pro",newAmount:"$149.00"}}function TT(){return{filteredInvoices:{_filter:[{_state:"rows"},{_or:[{_eq:[{_state:"statusFilter"},"all"]},{_eq:[{_item:"status"},{_state:"statusFilter"}]}]}]},activePlanPrice:{_if:[{_state:"annualBilling"},"$119 / mo (billed annually)","$149 / mo (billed monthly)"]}}}function ET(){return[{id:"billing-root",type:"Box",props:{className:"mx-auto flex max-w-5xl flex-col gap-6 p-6"},children:[{id:"billing-header",type:"Box",props:{className:"flex flex-wrap items-center justify-between gap-4"},children:[{id:"billing-title-group",type:"Box",props:{className:"flex flex-col gap-1"},children:[{id:"billing-title",type:"Heading",props:{level:1,text:"Subscription & billing"}},{id:"billing-subtitle",type:"Paragraph",props:{muted:!0,size:"sm",text:"Manage your active plan, monitor monthly quotas, and review workspace invoices."}}]},{id:"billing-cycle-switch",type:"Switch",props:{label:"Annual billing (save 20%)",checked:{_bindState:"annualBilling"}}}]},{id:"billing-kpi-row",type:"Box",props:{className:"grid gap-4 sm:grid-cols-3"},children:[{id:"billing-stat-plan",type:"Stat",props:{label:"Current plan",value:"Team Pro",description:{_computed:"activePlanPrice"}}},{id:"billing-stat-seats",type:"Stat",props:{label:"Active seats",value:"12 / 20",change:"+2 this month",trend:"up"}},{id:"billing-stat-usage",type:"Stat",props:{label:"API calls",value:"84.2k / 100k",change:"84% quota",trend:"up"}}]},{id:"billing-notice",type:"Alert",visible:{_not:{_eq:[{_state:"notice"},""]}},props:{variant:"default",title:"Billing notice",description:{_state:"notice"}}},{id:"billing-toolbar",type:"Box",props:{className:"flex flex-wrap items-end justify-between gap-3"},children:[{id:"billing-status-filter",type:"Form.Select",props:{name:"statusFilter",label:"Invoice status",value:{_bindState:"statusFilter"},options:[{value:"all",label:"All invoices"},{value:"paid",label:"Paid"},{value:"pending",label:"Pending"},{value:"overdue",label:"Overdue"}]}},{id:"billing-record-btn",type:"Button",props:{label:"Issue demo invoice",size:"sm"},events:{onClick:[{action:"Request",params:{connectionId:"billing-db",request:{id:"insert-billing-invoice",connectionId:"billing-db",payload:{operation:"InsertOne",data:{period:{_state:"newPeriod"},plan:{_state:"newPlan"},status:"pending",amount:{_state:"newAmount"},seats:"12 seats"}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:[...Qa(),{action:"SetState",params:{path:"notice",value:"Recorded demo invoice in local Collection. Real payment actions require host billing integration."}}]}]}}]},{id:"billing-invoices-table",type:"DataTable",props:{label:"Invoices",rowKey:"id",searchable:!0,searchPlaceholder:"Search invoices…",searchKeys:["id","period","plan","status"],columns:[{key:"id",label:"Invoice ID"},{key:"period",label:"Billing period"},{key:"plan",label:"Plan"},{key:"seats",label:"Seats"},{key:"status",label:"Status"},{key:"amount",label:"Amount"}],rows:{_computed:"filteredInvoices"}}}]}]}function OT(){return[{id:"billing-root",type:"Box",props:{className:"mx-auto flex max-w-5xl flex-col gap-6 p-6"},children:[{id:"billing-header",type:"Box",props:{className:"flex flex-wrap items-center justify-between gap-4"},children:[{id:"billing-title-group",type:"Box",props:{className:"flex flex-col gap-1"},children:[{id:"billing-title",type:"Heading",props:{level:1,text:"Usage metering & invoice ledger"}},{id:"billing-subtitle",type:"Paragraph",props:{muted:!0,size:"sm",text:"Track metered consumption by month and inspect individual invoice records."}}]},{id:"billing-cycle-switch",type:"Switch",props:{label:"Annual billing",checked:{_bindState:"annualBilling"}}}]},{id:"billing-usage-chart",type:"BarChart",props:{label:"Monthly metered spend",prefix:"$",height:180,data:[{label:"Jul",value:79},{label:"Aug",value:96},{label:"Sep",value:112},{label:"Oct",value:149},{label:"Nov",value:149}]}},{id:"billing-toolbar",type:"Box",props:{className:"flex flex-wrap items-end justify-between gap-3"},children:[{id:"billing-status-filter",type:"Form.Select",props:{name:"statusFilter",label:"Filter by status",value:{_bindState:"statusFilter"},options:[{value:"all",label:"All invoices"},{value:"paid",label:"Paid"},{value:"pending",label:"Pending"},{value:"overdue",label:"Overdue"}]}},{id:"billing-record-btn",type:"Button",props:{label:"Issue demo invoice",size:"sm"},events:{onClick:[{action:"Request",params:{connectionId:"billing-db",request:{id:"insert-billing-invoice",connectionId:"billing-db",payload:{operation:"InsertOne",data:{period:{_state:"newPeriod"},plan:{_state:"newPlan"},status:"pending",amount:{_state:"newAmount"},seats:"12 seats"}}},loadingPath:"loading",errorPath:"uiError"},onSuccess:Qa()}]}}]},{id:"billing-ledger-master-detail",type:"RecordMasterDetail",props:{label:"Invoice ledger",rows:{_computed:"filteredInvoices"},selectedId:{_state:"selectedInvoiceId"},titleField:"id",subtitleField:"period",badgeField:"status",fields:[{key:"plan",label:"Plan"},{key:"amount",label:"Amount"},{key:"seats",label:"Seats"},{key:"status",label:"Status"}]},events:{onSelect:[{action:"SetState",params:{path:"selectedInvoiceId",value:{_event:"id"}}}]}}]}]}function Ji(e){let t=e==="billing-overview"?"Subscription & Billing":"Usage Metering & Invoice Ledger";return{id:"billing",path:"/billing",title:t,lifecycle:{onMount:Qa()},state:PT(),computed:TT(),blocks:[{id:"billing-shell",type:"PageLayout",props:{title:t,appearance:"admin",routes:[{label:t,href:"/billing"}]},children:e==="billing-overview"?ET():OT()}]}}function Ja(e){return{version:"2.0",data:structuredClone(RT),connections:[{id:"billing-db",type:"Collection",entity:"invoices",mock:{seed:structuredClone(Hg)}}],pages:[Ji(e)]}}var Xa=[{id:"billing-overview",title:{zh:"SaaS 订阅与账单总览",en:"SaaS billing overview"},description:"Brand-neutral SaaS billing page with annual/monthly toggle, seat & API quota KPIs, and Collection-backed invoice table.",solution:{functions:["billing"],scenarios:["plans","subscriptions","usage","invoices"],unit:"page",industries:["admin","commerce"],readiness:"interactive-demo",hostRequirements:["Bind the logical `billing-db` Collection to your host billing ledger and connect payment actions to Stripe/host gateway"],limitations:["Demo invoices use local mock seeds; no real payment gateway or subscription mutation is performed"]},spec:Ja("billing-overview"),controls:[]},{id:"billing-usage-ledger",title:{zh:"用量计量与明细账单",en:"Usage metering & invoice ledger"},description:"Metered spend chart paired with a master-detail invoice ledger, hot-swappable with billing-overview over the same invoices entity.",solution:{functions:["billing","analytics"],scenarios:["usage","invoices","metrics"],unit:"page",industries:["admin"],readiness:"interactive-demo",hostRequirements:["Bind the logical `billing-db` Collection and supply metered usage aggregates from your host backend"],limitations:["Monthly spend chart and ledger rows use demonstration fixtures until connected to host billing services"]},spec:Ja("billing-usage-ledger"),controls:[]}],Za={schema:"uibot.variant-contract.v1",familyId:"billing.suite.v1",level:"L3",targetKind:"page",title:{zh:"SaaS 订阅与用量套件",en:"SaaS billing & usage suite"},description:"Swappable brand-neutral SaaS billing pages (subscription overview ↔ metered usage ledger) over a shared invoices Collection.",semanticSlots:[{id:"pageTitle",label:{zh:"页面标题",en:"Page title"},preserveMode:"when-customized"},{id:"pageState",label:{zh:"计费与筛选状态",en:"Billing & filter state"},preserveMode:"when-customized"},{id:"pageComputed",label:{zh:"派生列表",en:"Computed projections"},preserveMode:"always"},{id:"pageLifecycle",label:{zh:"初始加载",en:"Initial query"},preserveMode:"always"},{id:"pagePath",label:{zh:"页面路由",en:"Route path"},preserveMode:"when-customized"}],variants:[{id:"billing-overview",aliases:["overview","subscription"],title:{zh:"订阅与账单总览",en:"Subscription overview"},description:"Plan KPI cards, annual/monthly toggle, and searchable invoice table.",resourceId:"template:billing-overview",slotBindings:{pageTitle:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},pageState:{kind:"page-field",property:"state"},pageComputed:{kind:"page-field",property:"computed"},pageLifecycle:{kind:"page-field",property:"lifecycle"},pagePath:{kind:"page-field",property:"path"}},pageTemplate:Ji("billing-overview")},{id:"billing-usage-ledger",aliases:["usage-ledger","metered"],title:{zh:"用量计量明细",en:"Usage & invoice ledger"},description:"Metered spend bar chart paired with master-detail invoice inspector.",resourceId:"template:billing-usage-ledger",slotBindings:{pageTitle:{kind:"block-prop",blockType:"Heading",occurrence:0,property:"text"},pageState:{kind:"page-field",property:"state"},pageComputed:{kind:"page-field",property:"computed"},pageLifecycle:{kind:"page-field",property:"lifecycle"},pagePath:{kind:"page-field",property:"path"}},pageTemplate:Ji("billing-usage-ledger")}]};var Qi={url:"https://ui.shadcn.com/view/new-york-v4/dashboard-01",registryUrl:"https://ui.shadcn.com/r/styles/new-york-v4/dashboard-01.json",license:"MIT",registrySha256:"ec8e10eb0dc64e8c2a3077ca6abb771efc03c8499aa8044811f7a8525141ec0d",files:[{path:"registry/new-york-v4/blocks/dashboard-01/page.tsx",sha256:"042f13bbb8c0033e4546232b6767f83349ec29db3b2bcd93a07291ff549b6a65"},{path:"registry/new-york-v4/blocks/dashboard-01/data.json",sha256:"a8dcfbe6d014ab33adb4be2ccc221313d0bbf5d1d69a06bc08527b66148e849a"},{path:"registry/new-york-v4/blocks/dashboard-01/components/app-sidebar.tsx",sha256:"4b5d8891b26d61f651059f240a85a1294fdcea7b9f27e7ade467412a6847cf33"},{path:"registry/new-york-v4/blocks/dashboard-01/components/chart-area-interactive.tsx",sha256:"5d6ec1ac623dbae184b63d2840cb4dc54ee7eb2ae754d5a42b319ae93a00170a"},{path:"registry/new-york-v4/blocks/dashboard-01/components/data-table.tsx",sha256:"d05b74af48e3585521b916bae116b32c575688b2c87bf555ec5933ff3a26ee88"},{path:"registry/new-york-v4/blocks/dashboard-01/components/nav-documents.tsx",sha256:"d28f7c121410e1e35b2bbd49be5db672e14ca5ee10feed6cf1e08101c96c2468"},{path:"registry/new-york-v4/blocks/dashboard-01/components/nav-main.tsx",sha256:"215c602b782adda1b9f1a7c4a701ef8354f892ae2fe609723cea9814a74cb8ae"},{path:"registry/new-york-v4/blocks/dashboard-01/components/nav-secondary.tsx",sha256:"61dd4c2b73c0de29178595183e15283518388959cc2c636c7862df4c16e6e01b"},{path:"registry/new-york-v4/blocks/dashboard-01/components/nav-user.tsx",sha256:"c2e13a8ac430387c03b746e98dea7912f1f92e8b081786a8ee89ba367d75c183"},{path:"registry/new-york-v4/blocks/dashboard-01/components/section-cards.tsx",sha256:"680e2816e3161c5d2e05eb833b6f39cb268690b2135a5303cc76fd7968d15ea1"},{path:"registry/new-york-v4/blocks/dashboard-01/components/site-header.tsx",sha256:"ed1cd67ed4663f47908f64d3df288435c7e49ec24a09f0ae22adf3b2c11289a2"}]},rr=[{id:"1",header:"Cover page",type:"Cover page",status:"In Process",target:"18",limit:"5",reviewer:"Eddie Lake"},{id:"2",header:"Table of contents",type:"Table of contents",status:"Done",target:"29",limit:"24",reviewer:"Eddie Lake"},{id:"3",header:"Executive summary",type:"Narrative",status:"Done",target:"10",limit:"13",reviewer:"Eddie Lake"},{id:"4",header:"Technical approach",type:"Narrative",status:"Done",target:"27",limit:"23",reviewer:"Jamik Tashpulatov"},{id:"5",header:"Design",type:"Narrative",status:"In Process",target:"2",limit:"16",reviewer:"Jamik Tashpulatov"},{id:"6",header:"Capabilities",type:"Narrative",status:"In Process",target:"20",limit:"8",reviewer:"Jamik Tashpulatov"},{id:"7",header:"Integration with existing systems",type:"Narrative",status:"In Process",target:"19",limit:"21",reviewer:"Jamik Tashpulatov"},{id:"8",header:"Innovation and Advantages",type:"Narrative",status:"Done",target:"25",limit:"26",reviewer:"Assign reviewer"},{id:"9",header:"Overview of EMR's Innovative Solutions",type:"Technical content",status:"Done",target:"7",limit:"23",reviewer:"Assign reviewer"},{id:"10",header:"Advanced Algorithms and Machine Learning",type:"Narrative",status:"Done",target:"30",limit:"28",reviewer:"Assign reviewer"},{id:"11",header:"Adaptive Communication Protocols",type:"Narrative",status:"Done",target:"9",limit:"31",reviewer:"Assign reviewer"},{id:"12",header:"Advantages Over Current Technologies",type:"Narrative",status:"Done",target:"12",limit:"0",reviewer:"Assign reviewer"},{id:"13",header:"Past Performance",type:"Narrative",status:"Done",target:"22",limit:"33",reviewer:"Assign reviewer"},{id:"14",header:"Customer Feedback and Satisfaction Levels",type:"Narrative",status:"Done",target:"15",limit:"34",reviewer:"Assign reviewer"},{id:"15",header:"Implementation Challenges and Solutions",type:"Narrative",status:"Done",target:"3",limit:"35",reviewer:"Assign reviewer"},{id:"16",header:"Security Measures and Data Protection Policies",type:"Narrative",status:"In Process",target:"6",limit:"36",reviewer:"Assign reviewer"},{id:"17",header:"Scalability and Future Proofing",type:"Narrative",status:"Done",target:"4",limit:"37",reviewer:"Assign reviewer"},{id:"18",header:"Cost-Benefit Analysis",type:"Plain language",status:"Done",target:"14",limit:"38",reviewer:"Assign reviewer"},{id:"19",header:"User Training and Onboarding Experience",type:"Narrative",status:"Done",target:"17",limit:"39",reviewer:"Assign reviewer"},{id:"20",header:"Future Development Roadmap",type:"Narrative",status:"Done",target:"11",limit:"40",reviewer:"Assign reviewer"},{id:"21",header:"System Architecture Overview",type:"Technical content",status:"In Process",target:"24",limit:"18",reviewer:"Maya Johnson"},{id:"22",header:"Risk Management Plan",type:"Narrative",status:"Done",target:"15",limit:"22",reviewer:"Carlos Rodriguez"},{id:"23",header:"Compliance Documentation",type:"Legal",status:"In Process",target:"31",limit:"27",reviewer:"Sarah Chen"},{id:"24",header:"API Documentation",type:"Technical content",status:"Done",target:"8",limit:"12",reviewer:"Raj Patel"},{id:"25",header:"User Interface Mockups",type:"Visual",status:"In Process",target:"19",limit:"25",reviewer:"Leila Ahmadi"},{id:"26",header:"Database Schema",type:"Technical content",status:"Done",target:"22",limit:"20",reviewer:"Thomas Wilson"},{id:"27",header:"Testing Methodology",type:"Technical content",status:"In Process",target:"17",limit:"14",reviewer:"Assign reviewer"},{id:"28",header:"Deployment Strategy",type:"Narrative",status:"Done",target:"26",limit:"30",reviewer:"Eddie Lake"},{id:"29",header:"Budget Breakdown",type:"Financial",status:"In Process",target:"13",limit:"16",reviewer:"Jamik Tashpulatov"},{id:"30",header:"Market Analysis",type:"Research",status:"Done",target:"29",limit:"32",reviewer:"Sophia Martinez"},{id:"31",header:"Competitor Comparison",type:"Research",status:"In Process",target:"21",limit:"19",reviewer:"Assign reviewer"},{id:"32",header:"Maintenance Plan",type:"Technical content",status:"Done",target:"16",limit:"23",reviewer:"Alex Thompson"},{id:"33",header:"User Personas",type:"Research",status:"In Process",target:"27",limit:"24",reviewer:"Nina Patel"},{id:"34",header:"Accessibility Compliance",type:"Legal",status:"Done",target:"18",limit:"21",reviewer:"Assign reviewer"},{id:"35",header:"Performance Metrics",type:"Technical content",status:"In Process",target:"23",limit:"26",reviewer:"David Kim"},{id:"36",header:"Disaster Recovery Plan",type:"Technical content",status:"Done",target:"14",limit:"17",reviewer:"Jamik Tashpulatov"},{id:"37",header:"Third-party Integrations",type:"Technical content",status:"In Process",target:"25",limit:"28",reviewer:"Eddie Lake"},{id:"38",header:"User Feedback Summary",type:"Research",status:"Done",target:"20",limit:"15",reviewer:"Assign reviewer"},{id:"39",header:"Localization Strategy",type:"Narrative",status:"In Process",target:"12",limit:"19",reviewer:"Maria Garcia"},{id:"40",header:"Mobile Compatibility",type:"Technical content",status:"Done",target:"28",limit:"31",reviewer:"James Wilson"},{id:"41",header:"Data Migration Plan",type:"Technical content",status:"In Process",target:"19",limit:"22",reviewer:"Assign reviewer"},{id:"42",header:"Quality Assurance Protocols",type:"Technical content",status:"Done",target:"30",limit:"33",reviewer:"Priya Singh"},{id:"43",header:"Stakeholder Analysis",type:"Research",status:"In Process",target:"11",limit:"14",reviewer:"Eddie Lake"},{id:"44",header:"Environmental Impact Assessment",type:"Research",status:"Done",target:"24",limit:"27",reviewer:"Assign reviewer"},{id:"45",header:"Intellectual Property Rights",type:"Legal",status:"In Process",target:"17",limit:"20",reviewer:"Sarah Johnson"},{id:"46",header:"Customer Support Framework",type:"Narrative",status:"Done",target:"22",limit:"25",reviewer:"Jamik Tashpulatov"},{id:"47",header:"Version Control Strategy",type:"Technical content",status:"In Process",target:"15",limit:"18",reviewer:"Assign reviewer"},{id:"48",header:"Continuous Integration Pipeline",type:"Technical content",status:"Done",target:"26",limit:"29",reviewer:"Michael Chen"},{id:"49",header:"Regulatory Compliance",type:"Legal",status:"In Process",target:"13",limit:"16",reviewer:"Assign reviewer"},{id:"50",header:"User Authentication System",type:"Technical content",status:"Done",target:"28",limit:"31",reviewer:"Eddie Lake"},{id:"51",header:"Data Analytics Framework",type:"Technical content",status:"In Process",target:"21",limit:"24",reviewer:"Jamik Tashpulatov"},{id:"52",header:"Cloud Infrastructure",type:"Technical content",status:"Done",target:"16",limit:"19",reviewer:"Assign reviewer"},{id:"53",header:"Network Security Measures",type:"Technical content",status:"In Process",target:"29",limit:"32",reviewer:"Lisa Wong"},{id:"54",header:"Project Timeline",type:"Planning",status:"Done",target:"14",limit:"17",reviewer:"Eddie Lake"},{id:"55",header:"Resource Allocation",type:"Planning",status:"In Process",target:"27",limit:"30",reviewer:"Assign reviewer"},{id:"56",header:"Team Structure and Roles",type:"Planning",status:"Done",target:"20",limit:"23",reviewer:"Jamik Tashpulatov"},{id:"57",header:"Communication Protocols",type:"Planning",status:"In Process",target:"15",limit:"18",reviewer:"Assign reviewer"},{id:"58",header:"Success Metrics",type:"Planning",status:"Done",target:"30",limit:"33",reviewer:"Eddie Lake"},{id:"59",header:"Internationalization Support",type:"Technical content",status:"In Process",target:"23",limit:"26",reviewer:"Jamik Tashpulatov"},{id:"60",header:"Backup and Recovery Procedures",type:"Technical content",status:"Done",target:"18",limit:"21",reviewer:"Assign reviewer"},{id:"61",header:"Monitoring and Alerting System",type:"Technical content",status:"In Process",target:"25",limit:"28",reviewer:"Daniel Park"},{id:"62",header:"Code Review Guidelines",type:"Technical content",status:"Done",target:"12",limit:"15",reviewer:"Eddie Lake"},{id:"63",header:"Documentation Standards",type:"Technical content",status:"In Process",target:"27",limit:"30",reviewer:"Jamik Tashpulatov"},{id:"64",header:"Release Management Process",type:"Planning",status:"Done",target:"22",limit:"25",reviewer:"Assign reviewer"},{id:"65",header:"Feature Prioritization Matrix",type:"Planning",status:"In Process",target:"19",limit:"22",reviewer:"Emma Davis"},{id:"66",header:"Technical Debt Assessment",type:"Technical content",status:"Done",target:"24",limit:"27",reviewer:"Eddie Lake"},{id:"67",header:"Capacity Planning",type:"Planning",status:"In Process",target:"21",limit:"24",reviewer:"Jamik Tashpulatov"},{id:"68",header:"Service Level Agreements",type:"Legal",status:"Done",target:"26",limit:"29",reviewer:"Assign reviewer"}],zg=[{date:"2024-04-01",desktop:222,mobile:150},{date:"2024-04-02",desktop:97,mobile:180},{date:"2024-04-03",desktop:167,mobile:120},{date:"2024-04-04",desktop:242,mobile:260},{date:"2024-04-05",desktop:373,mobile:290},{date:"2024-04-06",desktop:301,mobile:340},{date:"2024-04-07",desktop:245,mobile:180},{date:"2024-04-08",desktop:409,mobile:320},{date:"2024-04-09",desktop:59,mobile:110},{date:"2024-04-10",desktop:261,mobile:190},{date:"2024-04-11",desktop:327,mobile:350},{date:"2024-04-12",desktop:292,mobile:210},{date:"2024-04-13",desktop:342,mobile:380},{date:"2024-04-14",desktop:137,mobile:220},{date:"2024-04-15",desktop:120,mobile:170},{date:"2024-04-16",desktop:138,mobile:190},{date:"2024-04-17",desktop:446,mobile:360},{date:"2024-04-18",desktop:364,mobile:410},{date:"2024-04-19",desktop:243,mobile:180},{date:"2024-04-20",desktop:89,mobile:150},{date:"2024-04-21",desktop:137,mobile:200},{date:"2024-04-22",desktop:224,mobile:170},{date:"2024-04-23",desktop:138,mobile:230},{date:"2024-04-24",desktop:387,mobile:290},{date:"2024-04-25",desktop:215,mobile:250},{date:"2024-04-26",desktop:75,mobile:130},{date:"2024-04-27",desktop:383,mobile:420},{date:"2024-04-28",desktop:122,mobile:180},{date:"2024-04-29",desktop:315,mobile:240},{date:"2024-04-30",desktop:454,mobile:380},{date:"2024-05-01",desktop:165,mobile:220},{date:"2024-05-02",desktop:293,mobile:310},{date:"2024-05-03",desktop:247,mobile:190},{date:"2024-05-04",desktop:385,mobile:420},{date:"2024-05-05",desktop:481,mobile:390},{date:"2024-05-06",desktop:498,mobile:520},{date:"2024-05-07",desktop:388,mobile:300},{date:"2024-05-08",desktop:149,mobile:210},{date:"2024-05-09",desktop:227,mobile:180},{date:"2024-05-10",desktop:293,mobile:330},{date:"2024-05-11",desktop:335,mobile:270},{date:"2024-05-12",desktop:197,mobile:240},{date:"2024-05-13",desktop:197,mobile:160},{date:"2024-05-14",desktop:448,mobile:490},{date:"2024-05-15",desktop:473,mobile:380},{date:"2024-05-16",desktop:338,mobile:400},{date:"2024-05-17",desktop:499,mobile:420},{date:"2024-05-18",desktop:315,mobile:350},{date:"2024-05-19",desktop:235,mobile:180},{date:"2024-05-20",desktop:177,mobile:230},{date:"2024-05-21",desktop:82,mobile:140},{date:"2024-05-22",desktop:81,mobile:120},{date:"2024-05-23",desktop:252,mobile:290},{date:"2024-05-24",desktop:294,mobile:220},{date:"2024-05-25",desktop:201,mobile:250},{date:"2024-05-26",desktop:213,mobile:170},{date:"2024-05-27",desktop:420,mobile:460},{date:"2024-05-28",desktop:233,mobile:190},{date:"2024-05-29",desktop:78,mobile:130},{date:"2024-05-30",desktop:340,mobile:280},{date:"2024-05-31",desktop:178,mobile:230},{date:"2024-06-01",desktop:178,mobile:200},{date:"2024-06-02",desktop:470,mobile:410},{date:"2024-06-03",desktop:103,mobile:160},{date:"2024-06-04",desktop:439,mobile:380},{date:"2024-06-05",desktop:88,mobile:140},{date:"2024-06-06",desktop:294,mobile:250},{date:"2024-06-07",desktop:323,mobile:370},{date:"2024-06-08",desktop:385,mobile:320},{date:"2024-06-09",desktop:438,mobile:480},{date:"2024-06-10",desktop:155,mobile:200},{date:"2024-06-11",desktop:92,mobile:150},{date:"2024-06-12",desktop:492,mobile:420},{date:"2024-06-13",desktop:81,mobile:130},{date:"2024-06-14",desktop:426,mobile:380},{date:"2024-06-15",desktop:307,mobile:350},{date:"2024-06-16",desktop:371,mobile:310},{date:"2024-06-17",desktop:475,mobile:520},{date:"2024-06-18",desktop:107,mobile:170},{date:"2024-06-19",desktop:341,mobile:290},{date:"2024-06-20",desktop:408,mobile:450},{date:"2024-06-21",desktop:169,mobile:210},{date:"2024-06-22",desktop:317,mobile:270},{date:"2024-06-23",desktop:480,mobile:530},{date:"2024-06-24",desktop:132,mobile:180},{date:"2024-06-25",desktop:141,mobile:190},{date:"2024-06-26",desktop:434,mobile:380},{date:"2024-06-27",desktop:448,mobile:490},{date:"2024-06-28",desktop:149,mobile:200},{date:"2024-06-29",desktop:103,mobile:160},{date:"2024-06-30",desktop:446,mobile:400}],Kg=`MIT License
139
+
140
+ Copyright (c) 2023 shadcn
141
+
142
+ Permission is hereby granted, free of charge, to any person obtaining a copy
143
+ of this software and associated documentation files (the "Software"), to deal
144
+ in the Software without restriction, including without limitation the rights
145
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
146
+ copies of the Software, and to permit persons to whom the Software is
147
+ furnished to do so, subject to the following conditions:
148
+
149
+ The above copyright notice and this permission notice shall be included in all
150
+ copies or substantial portions of the Software.
151
+
152
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
153
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
154
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
155
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
156
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
157
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
158
+ SOFTWARE.
159
+ `;var Zi="dashboard-sections",pt="dashboard-sections-db",F=(e,t)=>({action:"SetState",params:{path:e,value:t}}),E=(e)=>({_state:e}),de=(e,t)=>({_eq:[E(e),t]}),dt=(e,t="")=>({type:"Paragraph",props:{text:e,className:t}}),Gg=[F("draft",{action:"create",header:"",type:"Narrative",status:"In Process",target:"0",limit:"0",reviewer:"Assign reviewer"}),F("uiError",null),F("saved",!1),F("editorOpen",!0)],ir={action:"Request",params:{connectionId:pt,request:{id:"load-dashboard-sections",connectionId:pt,payload:{operation:"Find"}},responsePath:"rows",loadingPath:"loading",errorPath:"uiError"},onError:[F("saved",!1)]};function Wg(e,t){return{action:"Request",params:{connectionId:pt,request:{id:"mutate-dashboard-section",connectionId:pt,payload:e==="DeleteOne"?{operation:"DeleteOne",filter:{id:E("draft.id")},version:E("draft.version")}:{_if:[de("draft.action","create"),{operation:"InsertOne",data:{header:{_event:"values.header"},type:{_event:"values.type"},status:{_event:"values.status"},target:{_event:"values.target"},limit:{_event:"values.limit"},reviewer:{_event:"values.reviewer"},favorite:E("draft.favorite")}},{operation:"UpdateOne",filter:{id:E("draft.id")},data:{header:{_event:"values.header"},type:{_event:"values.type"},status:{_event:"values.status"},target:{_event:"values.target"},limit:{_event:"values.limit"},reviewer:{_event:"values.reviewer"},favorite:E("draft.favorite")},version:E("draft.version")}]}},loadingPath:"saving",errorPath:"uiError"},onSuccess:[{...structuredClone(ir),params:{...structuredClone(ir.params),loadingPath:"saving"},onSuccess:t}],onError:[F("saved",!1)]}}var Yg=[F("editorOpen",!1),F("deleteOpen",!1),F("saved",!0)],sl=(e)=>({id:E("cellIntent.id"),column:E("cellIntent.column"),operationId:E("cellIntent.operationId"),attempt:E("cellIntent.attempt"),status:e,message:E("cellError.message")}),Jg=[F("cellFeedback",sl("error"))],NT=[F("cellIntent",{_event:"values"}),F("cellError",null),F("cellFeedback",sl("pending")),{action:"Request",params:{connectionId:pt,request:{id:"edit-dashboard-cell",connectionId:pt,payload:{operation:"UpdateOne",filter:{id:E("cellIntent.id")},data:{_if:[{_eq:[E("cellIntent.column"),"target"]},{target:E("cellIntent.value")},{_if:[{_eq:[E("cellIntent.column"),"limit"]},{limit:E("cellIntent.value")},{reviewer:E("cellIntent.value")}]}]},version:E("cellIntent.version")}},errorPath:"cellError"},onSuccess:[{...structuredClone(ir),params:{...ir.params,errorPath:"cellError",loadingPath:"cellLoading"},onSuccess:[F("cellFeedback",sl("success"))],onError:Jg}],onError:Jg}];function el(e){let t=zg.slice(-e);return{series:[{name:"Desktop",points:t.map((n)=>n.desktop),area:!0},{name:"Mobile",points:t.map((n)=>n.mobile),area:!0}],labels:t.map((n)=>n.date.slice(5))}}var tl={week:el(7),month:el(30),quarter:el(90)},Qg=(e)=>({_if:[de("range","7"),tl.week[e],{_if:[de("range","30"),tl.month[e],tl.quarter[e]]}]}),nl=(e,t,n="text")=>({type:"Form.Input",props:{name:e,label:t,type:n,value:{_bindState:`draft.${e}`},required:!0}}),rl=(e,t,n)=>({type:"Form.Select",props:{name:e,label:t,required:!0,value:{_bindState:`draft.${e}`},options:n.map((r)=>({value:r,label:r}))}}),Xi=(e,t,n,r,i)=>({type:"Card",props:{className:"bg-gradient-to-t from-muted/40 to-card shadow-xs"},children:[{type:"Box",props:{direction:"row",align:"center",justify:"between",gap:"sm"},children:[dt(e,"text-sm text-muted-foreground"),{type:"Badge",props:{label:n,variant:"outline"}}]},{type:"Heading",props:{text:t,level:2,className:"mt-2 text-3xl font-semibold tracking-tight tabular-nums"}},dt(r,"mt-6 text-sm font-medium"),dt(i,"mt-1 text-sm text-muted-foreground")]}),il=(e,t,n)=>({type:"MenuLink",props:{label:e,iconName:n,active:de("section",t)},events:{onClick:[F("section",t)]}}),al={version:"2.0",layout:{navigation:"sidebar",container:"fluid",navigationStyle:"floating",sidebar:"expanded",offcanvas:"floating"},data:{entities:{dashboardSections:{key:"id",version:"version",fields:{id:{type:"string",readOnly:!0},header:{type:"string"},type:{type:"string"},status:{type:"string"},target:{type:"string"},limit:{type:"string"},reviewer:{type:"string"},version:{type:"number"},favorite:{type:"boolean"}}}}},connections:[{id:pt,type:"Collection",entity:"dashboardSections",mock:{seed:rr.map((e)=>({...e,version:1,favorite:!1}))}}],pages:[{id:Zi,path:"/dashboard-01",title:"Documents",state:{theme:"system",direction:"ltr",range:"90",section:"dashboard",templateSource:{...Qi,licenseText:Kg},rows:rr.map((e)=>({...e,version:1,favorite:!1})),loading:!1,saving:!1,saved:!1,uiError:null,editorOpen:!1,deleteOpen:!1,draft:{},tableView:null,rowOrder:[],cellFeedback:null,cellIntent:{},reorderIntent:{},cellError:null,cellLoading:!1},lifecycle:{onMount:[ir]},blocks:[{id:"dashboard-01-frame",type:"PageLayout",props:{title:"Documents",theme:E("theme"),direction:E("direction"),initials:"CN",tokens:{primary:"var(--foreground)","primary-foreground":"var(--background)"},routes:[{label:"Documents",href:"/dashboard-01"}],accountLinks:[{label:"Documents",href:"/dashboard-01"}]},events:{onThemeChange:[F("theme",{_event:"value"})]},slots:{sidebar:[{type:"PageSiderMenu",props:{title:"Acme Inc."},slots:{footer:[{type:"Box",props:{direction:"row",align:"center",gap:"sm"},children:[dt("CN","shrink-0 text-xs font-semibold"),{type:"Box",props:{className:"uibot-menu-label min-w-0",gap:"xs"},children:[dt("shadcn","text-sm font-medium"),dt("m@example.com","truncate text-xs text-muted-foreground")]}]}]},children:[{type:"MenuLink",props:{label:"Quick create",iconName:"plus"},events:{onClick:Gg}},il("Dashboard","dashboard","layout-dashboard"),il("Analytics","analytics","chart-no-axes-column"),{type:"MenuGroup",props:{title:"Documents"},children:[il("Data library","documents","list-todo")]}]}]},children:[{type:"Box",visible:{_not:de("section","documents")},props:{className:"!grid grid-cols-1 gap-4 sm:grid-cols-2 2xl:grid-cols-4"},children:[Xi("Total Revenue","$1,250.00","↗ +12.5%","Trending up this month ↗","Visitors for the last 6 months"),Xi("New Customers","1,234","↘ −20%","Down 20% this period ↘","Acquisition needs attention"),Xi("Active Accounts","45,678","↗ +12.5%","Strong user retention ↗","Engagement exceeds targets"),Xi("Growth Rate","4.5%","↗ +4.5%","Steady performance increase ↗","Meets growth projections")]},{type:"Card",visible:{_not:de("section","documents")},props:{title:"Total Visitors",description:"Illustrative desktop and mobile traffic"},slots:{actions:[{type:"Form.Select",props:{name:"range",value:{_bindState:"range"},placeholder:"Date range",options:[{value:"90",label:"Last 3 months"},{value:"30",label:"Last 30 days"},{value:"7",label:"Last 7 days"}]}}]},children:[{id:"dashboard-01-chart",type:"TrendChart",props:{variant:"plain",title:"Daily visitors",series:Qg("series"),labels:Qg("labels"),width:1000,height:240}}]},{type:"Box",visible:{_not:de("section","analytics")},props:{gap:"md"},children:[{type:"Alert",visible:E("saved"),props:{variant:"success",title:"Changes confirmed",description:"The section list has been refreshed from the connected host."}},{id:"dashboard-01-table",type:"DataTable",props:{label:"Document sections",rows:E("rows"),loading:E("loading"),error:E("uiError.message"),pageSize:10,minWidth:900,searchKeys:["header","reviewer"],searchPlaceholder:"Filter sections…",view:E("tableView"),reorderable:!0,rowOrder:E("rowOrder"),cellFeedback:E("cellFeedback"),searchable:!1,addLabel:"Add section",views:[{value:"outline",label:"Outline"},{value:"performance",label:"Past Performance",badge:3,placeholder:!0,emptyText:"No past performance sections yet."},{value:"personnel",label:"Key Personnel",badge:2,placeholder:!0,emptyText:"No key personnel sections yet."},{value:"documents",label:"Focus Documents",placeholder:!0,emptyText:"No focus documents yet."}],columns:[{key:"header",label:"Header",hideable:!1,action:"edit"},{key:"type",label:"Section type",kind:"badge"},{key:"status",label:"Status",kind:"badge",statusIcons:!0},{key:"target",label:"Target",editor:"number",align:"end"},{key:"limit",label:"Limit",editor:"number",align:"end"},{key:"reviewer",label:"Reviewer",editor:"select",emptyValue:"Assign reviewer",options:["Eddie Lake","Jamik Tashpulatov","Mary Pascoe"].map((e)=>({value:e,label:e}))}],actions:[{id:"edit",label:"Edit"},{id:"copy",label:"Make a copy"},{id:"favorite",label:"Favorite"},{id:"delete",label:"Delete",destructive:!0}]},events:{onViewChange:[F("tableView",{_event:"value"})],onAdd:Gg,onReorder:[F("reorderIntent",{_event:"values"}),F("rowOrder",E("reorderIntent.ids"))],onCellChange:NT,onRowAction:[F("draft",{_event:"values"}),F("draft.action",{_if:[de("draft.action","copy"),"create",E("draft.action")]}),F("draft.favorite",{_if:[de("draft.action","favorite"),{_not:E("draft.favorite")},E("draft.favorite")]}),F("uiError",null),F("saved",!1),F("editorOpen",{_not:de("draft.action","delete")}),F("deleteOpen",de("draft.action","delete"))]}}]},{type:"Drawer",props:{placement:"responsive",open:E("editorOpen"),pending:E("saving"),title:{_if:[de("draft.action","create"),"Add section",E("draft.header")]},description:"Changes are submitted to the host before the list is refreshed."},events:{onClose:[F("editorOpen",!1)]},children:[{type:"Box",props:{className:"hidden md:flex mb-6 border-b pb-6",gap:"sm"},children:[{type:"TrendChart",props:{variant:"plain",height:150,width:420,labels:["January","February","March","April","May","June"],series:[{name:"Desktop",points:[186,305,237,73,209,214],area:!0},{name:"Mobile",points:[80,200,120,190,130,140],area:!0}]}},dt("Trending up by 5.2% this month ↗","text-sm font-medium"),dt("Illustrative visitor totals for the last 6 months.","text-sm text-muted-foreground")]},{type:"Form",props:{label:"Section details",pending:E("saving"),idempotent:!0},events:{onSubmit:[F("saved",!1),Wg({_if:[de("draft.action","create"),"InsertOne","UpdateOne"]},Yg)]},children:[nl("header","Header"),rl("type","Section type",[...new Set(rr.map((e)=>e.type))]),rl("status","Status",["In Process","Done"]),{type:"Box",props:{className:"!grid grid-cols-2 gap-4"},children:[nl("target","Target","number"),nl("limit","Limit","number")]},rl("reviewer","Reviewer",[...new Set(rr.map((e)=>e.reviewer))]),{type:"Form.Checkbox",props:{name:"favorite",label:"Favorite",checked:{_bindState:"draft.favorite"}}},{type:"Alert",visible:E("uiError"),props:{variant:"destructive",title:"Changes were not confirmed",description:E("uiError.message")}},{type:"Form.Submit",props:{label:"Save changes",disabled:E("saving")}}]}]},{type:"Modal",props:{open:E("deleteOpen"),pending:E("saving"),title:"Delete section?",description:"This removes the section from the document outline."},events:{onClose:[F("deleteOpen",!1)]},children:[{type:"Alert",visible:E("uiError"),props:{variant:"destructive",title:"Deletion was not confirmed",description:E("uiError.message")}},{type:"Button",props:{label:"Cancel",variant:"outline",disabled:E("saving")},events:{onClick:[F("deleteOpen",!1)]}},{type:"Button",props:{label:"Delete section",variant:"destructive",disabled:E("saving")},events:{onClick:[Wg("DeleteOne",Yg)]}}]}]}]}]};tr(al,[Zi]);var ol=al.pages[0]?.blocks[0]?.children?.find((e)=>e.type==="Drawer");if(ol)ol.slots={footer:[{type:"Button",props:{label:"Done",variant:"outline",disabled:E("saving")},events:{onClick:structuredClone(ol.events?.onClose??[])}}]};var ll={id:"dashboard-01",title:{zh:"Dashboard 01 · 数据工作台",en:"Dashboard 01 · Documents"},description:"An inset dashboard with four metrics, date-range visitor trends and an editable document outline, adapted from shadcn/ui dashboard-01.",spec:al,solution:{functions:["analytics","data"],scenarios:["dashboard","metrics","table"],unit:"page",industries:[],readiness:"interactive-demo",requirements:{connections:[{id:pt,type:"Collection"}]},hostRequirements:["Host routing, session and authorization","Collection data gateway for Find, InsertOne, UpdateOne and DeleteOne; authorize fields and enforce single-record versions"],limitations:["Metrics and visitor trends are fixed sample data. Portal writes are confined to this preview session.","Drag order is session-local. The three additional table views are placeholders matching the upstream template; additional application routes and report export are not included.","Copy and favorite open a protected draft and require Save changes. Cell edits require successful host readback; the host enforces field authorization and single-record versions. Unknown writes are never replayed automatically.","A host must reconcile uncertain writes; refreshing the list after an ambiguous write does not authorize replay."]},controls:[{id:"chart-height",label:{zh:"图表高度",en:"Chart height"},values:[180,240,300],target:{pageId:Zi,blockId:"dashboard-01-chart",property:"height"}},{id:"page-size",label:{zh:"每页条数",en:"Rows per page"},values:[10,20,30],target:{pageId:Zi,blockId:"dashboard-01-table",property:"pageSize"}}]};var Ue=(e,t=!0)=>({type:"Paragraph",props:{text:e,size:"sm",muted:t}}),ut=(e,t=3,n="")=>({type:"Heading",props:{text:e,level:t,className:[t===1?"text-2xl! font-semibold!":t===2?"text-2xl!":"text-base! font-medium!",n].filter(Boolean).join(" ")}}),ie=(e,t,n="col")=>({type:"Box",props:{className:e,direction:n},children:t}),_T=(e,t)=>({type:"Link",props:{label:e,href:t}}),Ae=(e,t,n,r)=>({type:"Card",props:{title:e,...t?{description:t}:{},className:"shadow-none!"},...r?{slots:{actions:[_T(...r)]}}:{},children:n}),eo=(e,t,n)=>Ae(e,t,[ie("flex min-h-40 flex-col items-center justify-center text-center",[Ue("No data. Recent usage can take a few hours to appear here.")])],n),Xg=(e,t)=>({type:"Table",props:{caption:e,striped:!1,columns:[{key:"date",label:"Date"},{key:"description",label:"Description"},{key:"status",label:"Status"},{key:"amount",label:"Amount",align:"right"}],rows:t}}),BT=[{date:"Oct 1, 2026",description:"Promotional API credit",status:"Free",amount:"$100.00"}],DT=[{id:"dashboard",items:[{id:"home",label:"Dashboard",href:"/",icon:"layout-dashboard"}]},{id:"build",label:"Build & configure",items:[{id:"messages",label:"Messages",icon:"braces",href:"/workspaces/default/messages-overview",children:[{id:"message-pages",items:[{id:"message-overview",label:"Overview",href:"/workspaces/default/messages-overview"},{id:"playground",label:"Playground",href:"/workspaces/default/playground"},{id:"batches",label:"Batches",href:"/workspaces/default/batches"},{id:"logs",label:"Logs",href:"/workspaces/default/logs"}]}]},{id:"agents",label:"Agents",icon:"workflow",href:"/workspaces/default/agents-overview",children:[{id:"agent-pages",items:[{id:"agent-overview",label:"Overview",href:"/workspaces/default/agents-overview"},{id:"agent-quickstart",label:"Create",href:"/workspaces/default/agent-quickstart"},{id:"agent-list",label:"Agents",href:"/workspaces/default/agents"},{id:"sessions",label:"Sessions",href:"/workspaces/default/sessions"},{id:"deployments",label:"Deployments",href:"/workspaces/default/deployments"},{id:"environments",label:"Environments",href:"/workspaces/default/environments"},{id:"memory",label:"Memory",href:"/workspaces/default/memory-stores"},{id:"vaults",label:"Credential vaults",href:"/workspaces/default/vaults"}]}]},{id:"resources",label:"Resources",icon:"wrench",href:"/workspaces/default/resources-overview",children:[{id:"resource-pages",items:[{id:"resource-overview",label:"Overview",href:"/workspaces/default/resources-overview"},{id:"files",label:"Files",href:"/workspaces/default/files"},{id:"skills",label:"Skills",href:"/workspaces/default/skills"},{id:"webhooks",label:"Webhooks",href:"/settings/workspaces/default/webhooks"},{id:"app-integrations",label:"App integrations",href:"/settings/workspaces/default/app-integrations"}]}]}]},{id:"organization",label:"Organization",items:[{id:"spending",label:"Spending",icon:"credit-card",href:"/spending",children:[{id:"spending-pages",items:[{id:"spend-overview",label:"Overview",href:"/spending"},{id:"cost",label:"Cost & spend",href:"/cost"},{id:"billing",label:"Billing & payments",href:"/billing"},{id:"usage",label:"API usage",href:"/usage"},{id:"limits",label:"Rate limits",href:"/limits"}]}]},{id:"keys",label:"Keys & access",icon:"key-round",href:"/settings/keys",children:[{id:"access-pages",items:[{id:"api-keys",label:"API keys",href:"/settings/keys"},{id:"service-accounts",label:"Service accounts",href:"/settings/service-accounts"},{id:"workload-identity",label:"Workload identity",href:"/settings/workload-identity-federation"}]}]},{id:"security",label:"Security & data",icon:"shield",href:"/settings/privacy",children:[{id:"security-pages",items:[{id:"privacy",label:"Data retention",href:"/settings/privacy"}]}]},{id:"settings",label:"Settings",icon:"settings",href:"/settings/general",children:[{id:"settings-pages",items:[{id:"profile",label:"Profile",href:"/settings/general"},{id:"organization",label:"Organization",href:"/settings/organization"},{id:"workspaces",label:"Workspaces",href:"/settings/workspaces"},{id:"capabilities",label:"Capabilities",href:"/settings/capabilities"},{id:"telemetry",label:"OpenTelemetry",href:"/settings/telemetry-destinations"},{id:"code-settings",label:"Claude Code settings",href:"/claude-code/settings"}]}]}]}],LT=[ie("grid grid-cols-1 gap-4 lg:grid-cols-2",[Ae("Spend this month","",[ut("$0.00",2),Ue("0% of $500 limit")],["View cost","/cost"]),Ae("Credit balance","",[ie("flex flex-wrap items-center justify-between gap-4",[ie("",[ut("$0.00",2),Ue("$100.00 promotional credit available")]),{type:"Badge",props:{label:"No payment method",variant:"secondary"}}],"row")],["View billing","/billing"])]),ut("Spend breakdown",3,"mt-7 mb-4"),ie("grid grid-cols-1 gap-4 lg:grid-cols-2",[eo("Daily cost","Last 30 days, all workspaces",["Open cost","/cost"]),eo("Token usage","Input vs output",["Open usage","/usage"])]),ut("Billing and limits",3,"mt-7 mb-4"),ie("grid grid-cols-1 gap-4 lg:grid-cols-2",[Ae("Rate limits","Peak minute, last 24 hours",[ie("flex min-h-24 items-center justify-center",[Ue("No usage in the last 24 hours")])],["Open rate limits","/limits"]),Ae("Recent invoices","",[ie("flex flex-wrap items-center justify-between gap-4 min-h-24",[ie("",[Ue("Oct 1, 2026",!1),Ue("Promotional API credit")]),ie("flex items-center gap-4",[{type:"Badge",props:{label:"Free",variant:"secondary"}},Ue("$100.00",!1)],"row")],"row")],["Open billing","/billing"])])],Zg=[["spending","/spending","Spending and billing","How spend is tracking against your limits, and what you’re being billed.",LT],["dashboard","/","Dashboard","Your organization at a glance.",[{type:"ConsolePage",props:{view:"dashboard"}}]],["cost","/cost","Cost and spend","Last 30 days · all workspaces",[ie("flex flex-col gap-4",[eo("Daily cost","No billable requests recorded in this example",["Open usage","/usage"]),Ae("Workspace breakdown","Current billing period",[Xg("Example workspace costs",[{date:"This month",description:"Default workspace",status:"No usage",amount:"$0.00"}])])])]],["usage","/usage","API usage","Input and output tokens across your organization.",[ie("flex flex-col gap-4",[ie("grid grid-cols-1 gap-4 lg:grid-cols-2",[Ae("Input tokens","This month",[ut("0",2)]),Ae("Output tokens","This month",[ut("0",2)])]),eo("Token usage","Input vs output, last 30 days",["Open rate limits","/limits"])])]],["billing","/billing","Billing and payments","Manage payment methods, credits and invoices.",[ie("flex flex-col gap-4",[Ae("Credit balance","$100.00 promotional credit available",[ut("$0.00",2),Ue("No payment method. Connect the host billing service to manage payments.")]),Ae("Invoices","Example data",[Xg("Invoice history",BT)])])]],["limits","/limits","Rate limits","Peak minute, last 24 hours.",[Ae("API rate limits","Example limits; the host provides the actual account policy.",[{type:"Table",props:{columns:[{key:"metric",label:"Metric"},{key:"limit",label:"Limit"},{key:"usage",label:"Usage"}],rows:[{metric:"Requests per minute",limit:"50",usage:"0"},{metric:"Input tokens per minute",limit:"30,000",usage:"0"},{metric:"Output tokens per minute",limit:"8,000",usage:"0"}]}}])]],["messages","/workspaces/default/messages-overview","Messages","",[{type:"ConsolePage",props:{view:"messages"}}]],["agents","/workspaces/default/agents-overview","Agents","",[{type:"ConsolePage",props:{view:"agents"}}]],["resources","/workspaces/default/resources-overview","Resources","",[{type:"ConsolePage",props:{view:"resources"}}]],["playground","/workspaces/default/playground","Playground","",[{type:"ConsolePage",props:{view:"playground"}}]],["batches","/workspaces/default/batches","Batches","",[{type:"ConsolePage",props:{view:"batches"}}]],["logs","/workspaces/default/logs","Logs","",[{type:"ConsolePage",props:{view:"logs"}}]],["agent-list","/workspaces/default/agents","Agents","",[{type:"ConsolePage",props:{view:"agent-list"}}]],["sessions","/workspaces/default/sessions","Sessions","",[{type:"ConsolePage",props:{view:"sessions"}}]],["deployments","/workspaces/default/deployments","Deployments","",[{type:"ConsolePage",props:{view:"deployments"}}]],["deployment-new","/workspaces/default/deployments/new","New deployment","",[{type:"ConsolePage",props:{view:"deployment-new"}}]],["environments","/workspaces/default/environments","Environments","",[{type:"ConsolePage",props:{view:"environments"}}]],["environment-new","/workspaces/default/environments/new","New environment","",[{type:"ConsolePage",props:{view:"environment-new"}}]],["memory","/workspaces/default/memory-stores","Memory stores","",[{type:"ConsolePage",props:{view:"memory"}}]],["vaults","/workspaces/default/vaults","Credential vaults","",[{type:"ConsolePage",props:{view:"vaults"}}]],["agent-new","/workspaces/default/agents/new","Create agent","",[{type:"ConsolePage",props:{view:"agent-new"}}]],["agent-quickstart","/workspaces/default/agent-quickstart","Create","",[{type:"ConsolePage",props:{view:"agent-quickstart"}}]],["files","/workspaces/default/files","Files","",[{type:"ConsolePage",props:{view:"files"}}]],["skills","/workspaces/default/skills","Skills","",[{type:"ConsolePage",props:{view:"skills"}}]],["webhooks","/settings/workspaces/default/webhooks","Webhooks","",[{type:"ConsolePage",props:{view:"webhooks"}}]],["app-integrations","/settings/workspaces/default/app-integrations","App integrations","",[{type:"ConsolePage",props:{view:"app-integrations"}}]],["notifications","/notifications","Notifications","",[{type:"ConsolePage",props:{view:"notifications"}}]],["api-keys","/settings/keys","API keys","",[{type:"ConsolePage",props:{view:"api-keys"}}]],["service-accounts","/settings/service-accounts","Service accounts","",[{type:"ConsolePage",props:{view:"service-accounts"}}]],["workload-identity","/settings/workload-identity-federation","Workload identity federation","",[{type:"ConsolePage",props:{view:"workload-identity"}}]],["privacy","/settings/privacy","Data retention","",[{type:"ConsolePage",props:{view:"privacy"}}]],["profile","/settings/general","Profile","",[{type:"ConsolePage",props:{view:"profile"}}]],["organization","/settings/organization","Organization","",[{type:"ConsolePage",props:{view:"organization"}}]],["workspaces","/settings/workspaces","Workspaces","",[{type:"ConsolePage",props:{view:"workspaces"}}]],["workspace-new","/settings/workspaces/new","Create workspace","",[{type:"ConsolePage",props:{view:"workspace-new"}}]],["capabilities","/settings/capabilities","Capabilities","",[{type:"ConsolePage",props:{view:"capabilities"}}]],["telemetry","/settings/telemetry-destinations","OpenTelemetry","",[{type:"ConsolePage",props:{view:"telemetry"}}]],["code-settings","/claude-code/settings","Claude Code settings","",[{type:"ConsolePage",props:{view:"code-settings"}}]]];function MT([e,t,n,r,i]){let o=["messages","playground","batches","logs"].includes(e)?"messages":["agents","agent-list","sessions","deployments","deployment-new","environments","environment-new","memory","vaults","agent-new","agent-quickstart"].includes(e)?"agents":["resources","files","skills","webhooks","app-integrations"].includes(e)?"resources":["api-keys","service-accounts","workload-identity"].includes(e)?"keys":["profile","organization","workspaces","workspace-new","capabilities","telemetry","code-settings"].includes(e)?"settings":e==="privacy"?"security":["dashboard","notifications"].includes(e)?"":"spending";return{id:e,path:t,title:n,blocks:[{type:"PageLayout",props:{appearance:"console",creditLabel:"$100.00",title:"Acme Console",routes:Zg.map(([s,a,l])=>({id:s,path:a,title:l})),sidebarWidth:"wide",collapsible:"offcanvas"},slots:{sidebar:[{type:"DrilldownMenu",props:{sections:DT,activeHref:t,defaultPanelId:o,showActiveLabel:!0,navigateOnEnter:!0,...["messages","agents","resources"].includes(o)?{workspaceLabel:"Default"}:{}}}]},children:[...i[0]?.type==="ConsolePage"?[]:[ie("flex flex-wrap items-start justify-between gap-4 pb-4",[ie("space-y-2",[ut(n,1),Ue(r)]),{type:"Button",props:{label:"Add payment method",size:"sm",disabled:!0}}],"row")],...structuredClone(i)]}]}}var cl={id:"console-billing",title:{zh:"AI 平台控制台",en:"AI platform console"},description:"An AI platform console with drilldown navigation, dashboard, Messages playground, Agents, Resources, Settings and billing. UI and local interactions inspired by Claude Console; host owns services.",spec:{version:"2.0",pages:Zg.map(MT)},controls:[],solution:{functions:["billing","analytics"],scenarios:["usage","invoices","metrics"],unit:"flow",industries:[],readiness:"interactive-demo",hostRequirements:["Host router, organization, session and authorization","Host Messages API, Agents, Resources and billing data/action adapters"],limitations:["Fictional demonstration data; no requests to payment or account services","Account, payment and model actions require host adapters; no service write or financial transaction is performed"]}};var $T={dashboard:["概览工作台","Overview dashboard",["analytics"],["dashboard","metrics"]],tasks:["任务管理","Task management",["tasks","data"],["tasks","table"]],users:["成员与记录管理","Members & records",["collaboration","data"],["members","table"]],apps:["集成目录与配置","Integration settings",["settings"],["integrations"]],chats:["团队会话与消息","Team conversations",["collaboration","chat"],["conversations"]],"settings-profile":["个人资料设置","Profile settings",["settings"],["profile"]],"settings-account":["账号设置","Account settings",["settings"],["account"]],"settings-appearance":["外观设置","Appearance settings",["settings"],["appearance"]],"settings-notifications":["通知偏好设置","Notification preferences",["settings"],["notifications"]],"settings-display":["显示设置","Display settings",["settings"],["display"]],"sign-in":["Admin 居中登录","Admin centered sign in",["auth"],["login"]],"sign-in-2":["Admin 分栏登录","Admin split sign in",["auth"],["login"]],"sign-up":["Admin 注册","Admin registration",["auth"],["signup"]],"forgot-password":["Admin 找回密码","Admin account recovery",["auth"],["recovery"]],otp:["Admin 双重验证","Admin verification",["auth"],["verification"]],"error-401":["未登录提示","Unauthorized",["system"],["unauthorized"]],"error-403":["无权限提示","Access forbidden",["system"],["forbidden"]],"error-404":["页面不存在","Page not found",["system"],["not-found"]],"error-500":["服务异常","Server error",["system"],["server-error"]],"error-503":["维护提示","Maintenance",["system"],["maintenance"]],help:["帮助中心入口","Help center",["publishing"],["help"]]};function FT(e){let t=$T[e.id];if(!t)throw Error(`unmapped-admin-page:${e.id}`);let[n,r,i,o]=t,s=structuredClone(e);for(let p of s.blocks)if(p.type==="PageLayout"){delete p.template;let m=tn.pages[0]?.blocks[0]?.events;if(m)p.events=structuredClone(m);p.props={...p.props,headerLinks:[{label:s.title??s.id,href:s.path}],appearance:"admin",routes:[{label:s.title??s.id,href:s.path}],theme:{_state:"theme"},direction:{_state:"direction"},font:{_state:"font"}}}let a=new Set,l=(p)=>{if(!p||typeof p!=="object")return;for(let[m,u]of Object.entries(p))if(m==="connectionId"&&typeof u==="string")a.add(u);else l(u)};l(s);let c=structuredClone(ct.connections?.filter((p)=>a.has(p.id))??[]),d={version:"2.0",...s.blocks.some((p)=>p.type==="PageLayout")?{layout:structuredClone(ct.layout)}:{},pages:[s],...c.length?{connections:c,data:structuredClone(ct.data)}:{}};return tr(d),{id:e.id==="dashboard"?"admin-overview":`admin-${e.id}`,title:{zh:n,en:r},description:`${r}: shared UiBot Admin page source.`,solution:{functions:i,scenarios:o,unit:"page",industries:[],readiness:e.id==="help"||i.includes("auth")?"needs-enhancement":"interactive-demo",hostRequirements:["Host router, session, authorization and connection drivers",...c.length?["Authorize declared models and fields; provide storage and write confirmation"]:[]],limitations:["Portal data adapters are session-local demonstrations, not real services.",...i.includes("auth")?["Authentication submission remains disabled until a host provider is connected; use the configurable authentication suites for local validation demos."]:[],...e.id==="dashboard"?["Metrics and charts contain sample data."]:[],...e.id==="apps"?["Saving a connector preference does not authorize OAuth or connect a provider."]:[],...e.id==="chats"?["Team messages are not AI responses or verified external delivery."]:[],...e.id==="help"?["The existing help page remains a placeholder."]:[]],...c.length?{requirements:{connections:c.map(({id:p,type:m})=>({id:p,type:m}))}}:{}},spec:d,controls:[]}}var to=Hi.map(FT),ef={id:"admin-settings",title:{zh:"个人设置套件",en:"Personal settings suite"},description:"Profile, account, appearance, notifications and display settings.",solution:{functions:["settings"],scenarios:["profile","account","appearance","notifications","display"],unit:"flow",industries:[],readiness:"interactive-demo",hostRequirements:["Host preferences storage, routing and dirty-form protection"],limitations:["Local demo storage is not production persistence."]},spec:{version:"2.0",pages:to.filter((e)=>e.id.startsWith("admin-settings-")).flatMap((e)=>structuredClone(e.spec.pages)),connections:structuredClone((ct.connections??[]).filter((e)=>e.entity==="preferences")),data:structuredClone(ct.data)},controls:[]},G$={id:"shadcn-admin",title:{zh:"UiBot Admin",en:"UiBot Admin"},description:"21 shared functional pages composed with the UiBot Admin frame.",members:to.map((e)=>e.id),configuration:structuredClone(ct),frame:structuredClone(tn.pages[0]?.blocks[0]),solution:{functions:[],scenarios:["workspace"],unit:"industry",industries:["admin"],readiness:"interactive-demo",requirements:{connections:(ct.connections??[]).map(({id:e,type:t})=>({id:e,type:t}))},hostRequirements:["Host router, authorized data drivers, session and authentication","Explicit storage, write confirmation and dirty-form navigation protection"],limitations:["Authentication is disabled until connected by a host.","Help content is a placeholder; metrics and demo adapters are illustrative.","Connector preferences do not authorize OAuth; messages do not prove external delivery."]}};var tf={DocumentWorkspace:{name:"DocumentWorkspace",description:"Rich document editing using the shared editor and host-owned revision/CAS client.",category:"feature",level:"L2",props:{variant:{enum:["writing","reading","library","assistant"],default:"writing"},bindingId:{type:"string",default:"document"},title:{type:"string",default:"Untitled / 无标题"},markdown:{type:"string",default:`# Your next idea
160
+
161
+ Write something useful.`},readOnly:{type:"boolean",default:!1},autoSaveMs:{type:"number",default:1500},locale:{enum:["zh-CN","en"],default:"zh-CN"},previewState:{enum:["ready","empty","loading","error","conflict","readonly"],default:"ready"}},events:{},tags:["interactive","documents","editor","writing"],constraints:["Inject an authorized document/client binding. Local preview saves are not persistence receipts."]}};var nf=[["writing","专注写作","Focused writing"],["reading","目录阅读","Reading with an outline"],["library","文档列表与编辑","Document library"],["assistant","文档与 AI 双栏","Document with an assistant"]].map(([e,t,n])=>{let r=`document-${e}`,i={id:`${r}-editor`,type:"DocumentWorkspace",props:{bindingId:"document",title:n,markdown:`# Project notes
162
+
163
+ Capture the decisions behind your next idea.
164
+
165
+ ## Overview
166
+
167
+ Write, select text, and explore the formatting controls.
168
+
169
+ ## Next steps
170
+
171
+ - Review the draft
172
+ - Connect your document host`,readOnly:e==="reading",autoSaveMs:1500,locale:"zh-CN",previewState:"ready",variant:e}};return{id:r,title:{zh:t,en:n},description:`${n}: shared rich editor with revision-aware host saves and protected drafts.`,solution:{functions:e==="assistant"?["documents","chat"]:["documents"],scenarios:[e],unit:"page",industries:["knowledge","education"],readiness:"interactive-demo",hostRequirements:["Authorized document and DocumentEditorClient","Host revision and idempotency handling",...e==="assistant"?["Authorized chat binding and explicit host mapping of approved document context"]:[]],limitations:["Preview documents are stored in memory for this compilation only.","Sharing, collaboration, file upload and model editing require host services.",...e==="assistant"?["The assistant does not automatically read or replace the editor's unsaved draft."]:[]]},spec:{version:"2.0",pages:[{id:r,path:`/${r}`,title:n,blocks:e==="assistant"?[{type:"Grid",props:{cols:2,gap:"md",responsive:!0},children:[i,{id:`${r}-chat`,type:"ChatWorkspace",props:{bindingId:"chat",variant:"copilot",title:"Writing assistant / 写作助手"}}]}]:[i]}]},controls:[...e!=="assistant"?[{id:"layout",label:{zh:"文档布局",en:"Document layout"},values:["writing","reading","library"],target:{pageId:r,blockId:`${r}-editor`,property:"variant"}}]:[],{id:"readonly",label:{zh:"只读",en:"Read only"},values:[!1,!0],target:{pageId:r,blockId:`${r}-editor`,property:"readOnly"}},{id:"autosave",label:{zh:"自动保存间隔",en:"Autosave delay"},values:[0,1500,5000],target:{pageId:r,blockId:`${r}-editor`,property:"autoSaveMs"}},{id:"state",label:{zh:"演示状态",en:"Demo state"},values:["ready","empty","loading","error","conflict","readonly"],target:{pageId:r,blockId:`${r}-editor`,property:"previewState"}}]}});function UT(e){return e==="quality"?"blocking":"advisory"}var jT=["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"],qT=["Inter","Roboto","Geist","Fraunces","Plus Jakarta","Space Grotesk"];function je(e,t){let n=e.match(t);return n?n.length:0}var VT=[{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 jT.reduce((n,r)=>n+(t.includes(r)?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=je(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=je(e,/\bNot\s+(?:an?|just)\b[^.?!]*[.?!]/gi),n=je(e,/\b[A-Z][^.?!]*\.\s+(?:No|Just)\s+[a-z]/g),r=t+n;return r>=3?r: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)??[],n=new Set(t);if(n.size<3)return 0;let r=[...n].map(Number).sort((o,s)=>o-s);return r.some((o,s)=>s>0&&o-r[s-1]===1)?n.size:0}}],HT=[{id:"gradient-text",category:"slop",severity:"P2",message:"Gradient text (bg-clip-text + transparent) is a classic AI hero tell.",detect:(e)=>je(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)=>je(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)=>je(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)=>qT.reduce((t,n)=>t+(new RegExp(`font-family[^;"']*${n}`,"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)=>je(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)=>je(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)=>je(e,/bg-(?:primary|blue|indigo|violet|purple)-\d{3}[^"']*text-(?:gray|slate|zinc|neutral)-\d{3}/gi)}],rf={P0:0.3,P1:0.15,P2:0.08,P3:0.04};function zT(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 of="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",sF=new RegExp(`["']?\\b(?:${of})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),aF=new RegExp(`^\\s*-?\\s*(?:${of})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function sf(e){let t=e.text??e.html??"",n=e.html??e.text??"",r=new Set(e.exempt??[]),i=[],o=(a,l)=>{for(let c of a){let d=UT(c.category);if(d==="advisory"&&r.has(c.id))continue;let p=c.detect(l);if(p>0)i.push({ruleId:c.id,category:c.category,severity:c.severity,level:d,message:c.message,count:p})}};o(VT,t),o(HT,n);let s=1;for(let a of i){let l=Math.min(rf[a.severity]*(1+(a.count-1)/3),rf[a.severity]*2);s-=l}return s=Math.max(0,Math.min(1,s)),{score:s,grade:zT(s),findings:i,blocked:i.some((a)=>a.level==="blocking")}}var or=524288,KT=131072,GT=50000,ar=2000,af=["uibot_spec_compose","uibot_variant_list","uibot_spec_swap","uibot_spec_patch","uibot_validate"];class ve extends Error{code;detail;constructor(e,t){super(t);this.code=e;this.detail=t;this.name="SpecOpsInputError"}}function WT(){return{components:{...yn,...bn,...lg,...tf},actions:{},templates:{}}}function YT(){return[cl,...Xa,Ua,...Gi,...Wa,...za,...to,ef,ll,...Da,...ug,...nf,Vo]}function JT(e){let t=Xm([ja,qa,Fa,Ka,Ya,Za,dg,mg,...qo]);for(let n of eg(e.components))if(!t.get(n.familyId))t.register(n);return t}var gl=WT(),QT=YT(),XT=JT(gl),rn={"shadcn-admin-shell":structuredClone(tn)};function ZT(e){let t=typeof e==="string"?e:JSON.stringify(e)??"";return new TextEncoder().encode(t).length}function nn(e,t,n){if(ZT(e)>t)throw new ve(n,`input exceeds ${t} UTF-8 bytes budget`)}function sr(e,t=GT){try{He(e,Nd)}catch(i){let o=i instanceof Error?i.message:String(i);throw new ve(o==="spec-json-depth-exceeded"||o==="unsafe-spec-key"?o:"invalid-spec-input",o)}let n=0,r=[e];while(r.length>0){let i=r.pop();if(n+=1,n>t)throw new ve("spec-input-too-complex",`input exceeds ${t} JSON values limit`);if(i&&typeof i==="object")if(Array.isArray(i))for(let o of i)r.push(o);else for(let o of Object.values(i))r.push(o)}}function ul(e){let t=0;for(let n of e){if(t+=1,t>ar)return t;if(n.children?.length){if(t+=ul(n.children),t>ar)return t}for(let r of Object.values(n.slots??{}))if(t+=ul(r),t>ar)return t}return t}function ml(e){for(let t of e){if(t.template)return!0;if(t.children?.length&&ml(t.children))return!0;for(let n of Object.values(t.slots??{}))if(ml(n))return!0}return!1}function io(e,t){let n=e;if(t&&e.pages.some((i)=>ml(i.blocks??[])))n=qn(e,t);let r=0;for(let i of n.pages)if(r+=ul(i.blocks??[]),r>ar)throw new ve("spec-block-budget-exceeded",`expanded block count exceeds ${ar}`)}function lf(e){for(let t of e.connections??[])if(t&&typeof t==="object"&&"bindings"in t&&t.bindings!==void 0)throw new ve("spec-connection-bindings-forbidden",`connection "${t.id}" must not declare upstream bindings in Spec MCP`)}function no(e){nn(e,or,"spec-input-too-large");let t=e;if(typeof e==="string")try{t=Ti(e,{maxAliasCount:0})}catch(r){let i=r instanceof Error?r.message:String(r);if(/alias/i.test(i))throw new ve("spec-yaml-alias-forbidden","YAML aliases are disabled");throw Error("spec must be a UIBot Spec object with a pages array")}if(typeof t!=="object"||t===null||Array.isArray(t)||!Array.isArray(t.pages))throw Error("spec must be a UIBot Spec object with a pages array");if(t.pages.length>_o)throw new ve("spec-page-budget-exceeded",`pages exceed maximum of ${_o}`);sr(t);let n=t;return lf(n),n}function dl(e){if(e===void 0||e==="json")return"json";if(e==="yaml")return"yaml";throw new ve("invalid-spec-format","format must be 'json' or 'yaml'")}async function ro(e,t,n){lf(e),io(e,n);let[r,i]=await Promise.all([fa(e,t,{strict:!0,...n?{templates:n}:{}}),Promise.resolve(ma(e))]);return{ok:r.gaps.length===0,gaps:r.gaps,warnings:r.warnings,reachability:i}}function pl(e,t){return t==="yaml"?{yaml:Rm(e)}:{spec:e}}function eE(e){if(!e||typeof e!=="object"||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))if(r&&typeof r==="object"&&!Array.isArray(r)){let i={...r},o=i.fields&&typeof i.fields==="object"&&!Array.isArray(i.fields)?i.fields:void 0;if(i.key===void 0&&o&&Object.hasOwn(o,"id"))i.key="id";t[n]=i}else t[n]=r;return t}function tE(e){let t=Array.isArray(e.connections)?structuredClone(e.connections):[];for(let r of t)if(r&&typeof r==="object"&&"bindings"in r&&r.bindings!==void 0)throw new ve("spec-connection-bindings-forbidden",`connection "${String(r.id??"unknown")}" must not declare upstream bindings in Spec MCP`);let n=e.mockSeed;if(n&&typeof n==="object"&&!Array.isArray(n))for(let[r,i]of Object.entries(n)){if(!Array.isArray(i))continue;let o=t.find((s)=>s.entity===r);if(o){if(!o.mockSeed)o.mockSeed=i}else t.push({id:`${r}-db`,entity:r,mockSeed:i})}return t.length>0?t:void 0}async function fl(e,t,n=gl){let r={};if(e.spec!==void 0){let i=no(e.spec);io(i,t);let o=e.autofix!==!1,s=!1;try{s=(await fa(i,n,{strict:!0,...t?{templates:t}:{}})).gaps.length===0}catch{s=!1}let a=i,l=[];if(o){let p=zt(i,{catalog:n});if(l=p.fixesApplied,l.length>0)a=p.spec}let c=await ro(a,n,t),d=l.length>0;r.spec={ok:c.ok,rawOk:s,autofixed:d,autofixesApplied:l,...d?{autofixedSpec:a}:{},gaps:c.gaps,warnings:c.warnings,reachability:c.reachability}}if(e.html!==void 0){nn(e.html,KT,"html-input-too-large");let i=sf({html:e.html});r.html={ok:!i.blocked,...i}}return r}function oo(e=()=>rn,t=gl,n=QT,r=XT){let i=()=>({...rn,...e()});return{specOps:{async compose(s){nn(s,or,"spec-input-too-large"),sr(s);let a=dl(s.format),l=s.autofix!==!1,c=tE(s),d=eE(s.entities),p={pages:s.pages};if(typeof s.title==="string")p.title=s.title;if(typeof s.shellVariant==="string")p.shellVariant=s.shellVariant;if(s.layout)p.layout=s.layout;if(s.design)p.design=s.design;if(s.menus)p.menus=s.menus;if(s.auth)p.auth=s.auth;if(d)p.entities=d;if(c)p.connections=c;let m=ag(p,{solutions:n,variantRegistry:r}),u=m.spec,f=[];if(l){let h=zt(u,{catalog:t});if(f=h.fixesApplied,f.length>0)u=h.spec}let g=await ro(u,t,i());return{...pl(u,a),addedPages:m.addedPages,addedConnections:m.addedConnections,unmappedWarnings:m.unmappedWarnings,autofixesApplied:f,compile:g,summary:{pageCount:u.pages.length,gapCount:g.gaps.length,orphanPageCount:g.reachability.orphanPageIds.length,brokenLinkCount:g.reachability.brokenLinks.length}}},listVariants(s){nn(s,or,"spec-input-too-large"),sr(s);let a=typeof s.familyId==="string"?s.familyId:void 0,l=typeof s.resourceId==="string"?s.resourceId:void 0,c=typeof s.level==="string"?s.level:void 0,d=typeof s.targetKind==="string"?s.targetKind:void 0,p=typeof s.query==="string"?s.query:void 0,m=s.spec!==void 0?no(s.spec):void 0,u=Zt(r,{...a?{familyId:a}:{},...l?{resourceId:l}:{},...c?{level:c}:{},...d?{targetKind:d}:{},...p?{query:p}:{}});return{count:u.length,families:u.map((f)=>{let g=m?(m.composition?.variants??[]).filter((h)=>h.familyId===f.familyId).map((h)=>({targetKind:h.targetKind,targetId:h.targetId,variantId:h.variantId})):void 0;return{familyId:f.familyId,level:f.level,targetKind:f.targetKind,title:f.title,description:f.description,semanticSlots:f.semanticSlots,...g?{currentMatches:g}:{},variants:f.variants.map((h)=>({id:h.id,title:h.title,description:h.description,...h.resourceId?{resourceId:h.resourceId}:{},semanticRequirements:f.semanticSlots.filter((b)=>b.required).map((b)=>b.id),...h.previewNotes?{previewNotes:h.previewNotes}:{}}))}})}},async swap(s){nn(s,or,"spec-input-too-large"),sr(s);let a=dl(s.format),l=s.autofix!==!1,c=no(s.spec),d=i();io(c,d);let p=typeof s.targetVariantId==="string"?s.targetVariantId:typeof s.targetVariant==="string"?s.targetVariant:"";if(!p)throw new ve("invalid-swap-arguments","targetVariant or targetVariantId is required");if(!s.target||typeof s.target!=="object"||Array.isArray(s.target))throw new ve("invalid-swap-arguments","target object is required");let m=lt(r,{spec:c,...typeof s.familyId==="string"?{familyId:s.familyId}:{},target:s.target,targetVariantId:p,...typeof s.preserveCustomizations==="boolean"?{preserveCustomizations:s.preserveCustomizations}:{},...s.pageMapping&&typeof s.pageMapping==="object"?{pageMapping:s.pageMapping}:{}}),u=m.spec,f=[];if(l){let h=zt(u,{catalog:t});if(f=h.fixesApplied,f.length>0)u=h.spec}let g=await ro(u,t,d);return{...pl(u,a),familyId:m.familyId,fromVariantId:m.fromVariantId??null,toVariantId:m.toVariantId,changedPaths:m.changedPaths,unmappedWarnings:m.unmappedWarnings,autofixesApplied:f,compile:g}},async patch(s){nn(s,or,"spec-input-too-large"),sr(s);let a=dl(s.format),l=s.autofix!==!1,c=no(s.spec),d=i();if(io(c,d),!Array.isArray(s.operations)||s.operations.length>No)throw new P(Array.isArray(s.operations)?"spec-patch-batch-too-large":"invalid-spec-patch",-1,"batch",Array.isArray(s.operations)?`operations exceed max batch size (${No})`:"operations must be an array");let p=rg(c,s.operations,{variantRegistry:r,allowConnectionBindings:!1}),m=p.spec,u=[];if(l){let g=zt(m,{catalog:t});if(u=g.fixesApplied,u.length>0)m=g.spec}let f=await ro(m,t,d);return{...pl(m,a),appliedCount:p.appliedCount,changedPaths:p.changedPaths,unmappedWarnings:p.unmappedWarnings,autofixesApplied:u,compile:f}}},validate:(s)=>fl(s,i(),t)}}function uf(){return{listCatalog:()=>[...oE],getDesignMd:(e)=>{let t=gf();if(!e)return t.map(({body:n,...r})=>r);return t.find((n)=>n.id===e)??null},listTemplates:()=>bl().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 mf(e){return fl(e,vl())}function rE(){let e=["./resources/templates","./resources/shells","../../../examples/templates","../../../examples/shells"].flatMap((i)=>{try{return[yl(new URL(i,import.meta.url))]}catch{return[]}}),t=[],n=new Set,r=new Set;for(let i of e){let o=i.endsWith("shells")?"shells":"templates";if(!hl(i)||n.has(i)||r.has(o))continue;if(r.add(o),n.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 cf,df,pf;function bl(){return cf??=ba(rE()),cf}function vl(){return df??={...rn,...Object.fromEntries(bl().map((e)=>[e.name,Ti(e.yaml)]))},df}function gf(){let e=yl(new URL("./resources/design-md",import.meta.url));return pf??=hl(e)?_i(e):_i(),pf}var so;function ff(){let e=["./resources/bundle.json","../../../public/resources/bundle.json"].map((n)=>yl(new URL(n,import.meta.url))).find(hl);if(e){let n=JSON.parse(nE(e,"utf8"));return Ca(n),Vm(n)}if(so)return so;let t=Object.fromEntries(bl().map((n)=>[n.name,n.templateContract]));return so=Di(Dm({components:{...yn,...bn},templates:t,designGuides:gf(),examples:Bm(t)})),so}function iE(){let e=new Map;for(let t of[...Object.values(yn),...Object.values(bn)]){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,n)=>t.name.localeCompare(n.name))}var oE=Object.freeze(iE());var bf=new Set(af);function yf(e){return e.startsWith("uibot_resource_")||bf.has(e)}var pE="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 uE(){return{requestComponent:()=>Promise.reject(Error(pE)),getTask:()=>{return},listTasks:()=>[],getTaskStatus:()=>{return}}}function mE(e,t){let n=Object.fromEntries(Object.entries(t??{}).filter(([,r])=>r!=null));return{...e,...n}}function kl(e={}){let t=e.specOps&&e.validate?void 0:oo(vl),n=e.specOps??t?.specOps,r=$d({service:e.service??uE(),serviceAvailable:e.service!=null,discovery:mE(uf(),e.discovery),resourceQuery:e.resourceQuery??ff(),...n?{specOps:n}:{},validate:e.validate??t?.validate??mf}),i=new aE({name:"uibot",version:Fd},{capabilities:{tools:{}}});return i.setRequestHandler(dE,()=>({tools:r.listTools().filter((o)=>!e.resourceOnly||yf(o.name)).map((o)=>({...o,annotations:{readOnlyHint:o.name!=="uibot_request_component",destructiveHint:!1,idempotentHint:o.name!=="uibot_request_component",openWorldHint:!0}})).concat((!e.resourceOnly&&e.logo?e.logo.operations:[]).map((o)=>({name:`uibot_logo_${o.name}`,description:o.name==="preview"?`${o.description} Defaults to icon-512. Inline PNGs are limited to 512 KiB; use CLI preview --out for larger originals.`:o.description,inputSchema:o.name==="preview"?{...o.inputSchema,properties:{...o.inputSchema.properties,variant:{...o.inputSchema.properties.variant,default:"icon-512"}}}:o.inputSchema,annotations:{readOnlyHint:o.readOnly,destructiveHint:!1,idempotentHint:o.readOnly||o.name==="generate",openWorldHint:!0}})))})),i.setRequestHandler(cE,async(o,s)=>{if(e.resourceOnly&&!yf(o.params.name))return{content:[{type:"text",text:"public-resource-tool-unavailable"}],isError:!0};if(o.params.name.startsWith("uibot_logo_"))try{if(e.resourceOnly||!e.logo)throw new D("logo-unavailable");let l=o.params.name.slice(11),c={...o.params.arguments};if(l==="preview"&&c.variant===void 0)c.variant="icon-512";let d=await e.logo.call(l,c,s.signal),{image:p,...m}=d,u=l==="preview"?m:d;if(l==="preview"&&p&&Buffer.byteLength(p.data,"base64")>524288){let f={...m,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(f)}],structuredContent:f,isError:!0}}return{content:[{type:"text",text:JSON.stringify(u)},...l==="preview"&&p?[p]:[]],structuredContent:u}}catch(l){let c={error:{code:l instanceof D?l.code:"logo-failed",outcomeUnknown:l instanceof D&&l.outcomeUnknown,...l instanceof D&&l.requestId?{requestId:l.requestId,next:`Call uibot_logo_status with requestId ${l.requestId}; do not automatically submit a new ID.`}:{}}};return{content:[{type:"text",text:JSON.stringify(c)}],structuredContent:c,isError:!0}}let a={...o.params.arguments};if(o.params.name==="uibot_resource_search"){if(a.limit===void 0)a.limit=12;else if(typeof a.limit==="number"&&a.limit>50)a.limit=50}try{let l=await r.callTool(o.params.name,a),c=bf.has(o.params.name),d=Ud(l.content,{compact:c}),p=l.content.find((u)=>u.type==="json"),m=p?.type==="json"&&p.json!==null&&typeof p.json==="object"&&!Array.isArray(p.json)?p.json:void 0;if(o.params.name.startsWith("uibot_resource_")){let u=o.params.name==="uibot_resource_manifest"?1048576:262144;if(new TextEncoder().encode(JSON.stringify(d)).length>u)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."}})}]}}else if(c){if(new TextEncoder().encode(JSON.stringify({content:d,...m?{structuredContent:m}:{}})).length>1048576)return{isError:!0,content:[{type:"text",text:JSON.stringify({error:{code:"response-too-large",detail:"Serialized Spec tool response exceeded 1 MiB limit; use uibot_spec_patch or format: 'json' on smaller subsets."}})}]}}return{content:d,...m?{structuredContent:m}:{},...l.isError?{isError:!0}:{}}}catch(l){return{content:[{type:"text",text:l instanceof Error?l.message:String(l)}],isError:!0}}}),i}function gE(e=process.argv[1],t=import.meta.url){if(!e)return!1;try{return hf(sE(t))===hf(e)}catch{return!1}}async function fE(){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 n=process.env.UIBOT_LOGO_OUTPUT_DIR,r=e&&t?Il({url:e,token:t,...n?{outputDir:n}:{}}):void 0,i=kl(r?{logo:r}:{});await i.connect(new lE);for(let o of["SIGINT","SIGTERM"])process.on(o,()=>{i.close().finally(()=>process.exit(0))})}if(gE())fE().catch((e)=>{console.error(e),process.exit(1)});function zF(e){let t=oo(()=>rn);return async(n)=>{let r=n.headers.get("origin"),i=new URL(n.url).origin;if(r&&r!==i&&!e.allowedOrigins?.includes(r))return new Response("origin-not-allowed",{status:403});if(n.method==="OPTIONS")return new Response(null,{status:204,headers:{"access-control-allow-origin":r??i,"access-control-allow-methods":"POST, OPTIONS","access-control-allow-headers":"content-type, mcp-protocol-version",vary:"Origin"}});if(n.method!=="POST")return new Response("method-not-allowed",{status:405,headers:{allow:"POST, OPTIONS"}});let o;try{o=await yE(n,1048576)}catch(c){return new Response("invalid-request-body",{status:c instanceof Error&&c.message==="too-large"?413:400})}let s;try{s=JSON.parse(o)}catch{return new Response("invalid-json",{status:400})}if(!s||typeof s!=="object"||Array.isArray(s))return new Response("invalid-json",{status:400});let a=new hE({enableJsonResponse:!0}),l=kl({resourceOnly:!0,resourceQuery:e.resourceQuery,discovery:{},specOps:t.specOps,validate:t.validate});await l.connect(a);try{let c=await a.handleRequest(n,{parsedBody:s}),d=await c.arrayBuffer(),p=new Headers(c.headers);if(r)p.set("access-control-allow-origin",r),p.set("vary","Origin");return new Response(c.status===204?null:d,{status:c.status,headers:p})}finally{await l.close()}}}async function yE(e,t){let n=e.body?.getReader();if(!n)return"";let r=[],i=0,o=!1,s=setTimeout(()=>{o=!0,n.cancel()},1e4);try{for(;;){let{done:c,value:d}=await n.read();if(o)throw Error("body-timeout");if(c)break;if(i+=d.byteLength,i>t)throw await n.cancel(),Error("too-large");r.push(d)}}finally{clearTimeout(s),n.releaseLock()}let a=new Uint8Array(i),l=0;for(let c of r)a.set(c,l),l+=c.byteLength;return new TextDecoder("utf-8",{fatal:!0}).decode(a)}export{zF as createUIBotMcpHttpHandler};