@uibot/cli 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/cli.js +152 -148
- package/dist/commands/app.d.ts +10 -0
- package/dist/commands/resource.d.ts +1 -0
- package/dist/distribution-snapshot.d.ts +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12029 -214
- package/dist/resource-runtime.d.ts +1 -0
- package/dist/resources/bundle.json +1 -1
- package/dist/shells/shadcn-admin-shell.yaml +5 -4
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/licenses/UIBot-LICENSE +21 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/licenses/blocks-icons-LICENSE +46 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/licenses/shadcn-THIRD_PARTY_LICENSE +21 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-apps.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-chats.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-dashboard.json +70 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-error-401.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-error-403.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-error-404.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-error-500.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-error-503.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-forgot-password.json +59 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-help.json +53 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-otp.json +59 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-overview.json +62 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings-account.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings-appearance.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings-display.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings-notifications.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings-profile.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings.json +65 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-shell.json +160 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-sign-in-2.json +67 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-sign-in.json +59 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-sign-up.json +59 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-tasks.json +66 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-users.json +66 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/ai-chat.json +74 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/analytics-dashboard.json +65 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/app-shell-floating.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/app-shell-icon-rail.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/app-shell-inset.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/app-shell-settings.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/app-shell-sidebar.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/app-shell-workspace.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/auth-centered.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/auth-enterprise.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/auth-recovery.json +64 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/auth-registration.json +63 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/auth-split.json +67 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/auth.json +61 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/blog.json +64 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/charts.json +211 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/chat-artifact.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/chat-focused.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/chat-history.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/chat-knowledge.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/chat-support.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/chat-workspace.json +136 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/collection-shared.json +23 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/commerce-workspace.json +69 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-billing.json +68 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-page.json +289 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-shell.json +29 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/content.json +444 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/creation-shared.json +24 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/crm-workspace.json +73 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/crm.json +67 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/dashboard.json +147 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/data-studio.json +368 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/data-table.json +242 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/data.json +398 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/document-assistant.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/document-library.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/document-reading.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/document-workspace.json +164 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/document-writing.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/drilldown-menu.json +233 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/ecommerce.json +65 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/education-workspace.json +82 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/feedback.json +331 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/field.json +164 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/form.json +429 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/grid.json +188 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/interactive.json +355 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/item-grid.json +219 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/kanban.json +154 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/layout.json +771 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/lms.json +74 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/marketing.json +402 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/nav.json +257 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/portfolio.json +62 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/presentation.json +454 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/pricing.json +63 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/primitives.json +360 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/saas-landing.json +60 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sections.json +734 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/settings.json +72 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/shadcn-admin-shell.json +49 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/shadcn-admin.json +77 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-01.json +42 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-02.json +42 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-03.json +30 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-04.json +30 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-05.json +36 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-06.json +42 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-07.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-08.json +54 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-09.json +36 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-10.json +66 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-11.json +30 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-12.json +48 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-13.json +30 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-14.json +30 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-15.json +84 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-16.json +66 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-drilldown.json +29 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/sidebar-primitives.json +155 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/store.json +75 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/support-inbox.json +63 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/team-directory.json +59 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/uibot-base.json +30 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/workspace.json +174 -0
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/snapshot.json +1 -0
- package/dist/templates/auth.yaml +84 -67
- package/dist/templates/shadcn-admin.yaml +12210 -122
- package/package.json +9 -9
package/dist/cli.js
CHANGED
|
@@ -1,142 +1,145 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
var $d=Object.create;var{getPrototypeOf:Md,defineProperty:ns,getOwnPropertyNames:_d}=Object;var is=Object.prototype.hasOwnProperty;function Fd(e){return this[e]}var jd,qd,Bd=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?jd??=new WeakMap:qd??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?$d(Md(e)):{};let s=t||!e||!e.__esModule||!is.call(e,"default")?ns(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of _d(e))if(!is.call(s,a))ns(s,a,{get:Fd.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var K=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var er=import.meta.require;var Ye=y(function(nD,As){var ef=Number.MAX_SAFE_INTEGER||9007199254740991,tf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];As.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ef,RELEASE_TYPES:tf,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var yt=y(function(iD,Ds){var rf=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ds.exports=rf});var Ge=y(function(ie,Os){var{MAX_SAFE_COMPONENT_LENGTH:Xn,MAX_SAFE_BUILD_LENGTH:nf,MAX_LENGTH:of}=Ye(),sf=yt();ie=Os.exports={};var af=ie.re=[],cf=ie.safeRe=[],R=ie.src=[],lf=ie.safeSrc=[],C=ie.t={},uf=0,Zn="[a-zA-Z0-9-]",df=[["\\s",1],["\\d",of],[Zn,nf]],pf=(e)=>{for(let[t,r]of df)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},P=(e,t,r)=>{let n=pf(t),i=uf++;sf(e,i,t),C[e]=i,R[i]=t,lf[i]=n,af[i]=new RegExp(t,r?"g":void 0),cf[i]=new RegExp(n,r?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Zn}*`);P("MAINVERSION",`(${R[C.NUMERICIDENTIFIER]})\\.(${R[C.NUMERICIDENTIFIER]})\\.(${R[C.NUMERICIDENTIFIER]})`);P("MAINVERSIONLOOSE",`(${R[C.NUMERICIDENTIFIERLOOSE]})\\.(${R[C.NUMERICIDENTIFIERLOOSE]})\\.(${R[C.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASEIDENTIFIER",`(?:${R[C.NONNUMERICIDENTIFIER]}|${R[C.NUMERICIDENTIFIER]})`);P("PRERELEASEIDENTIFIERLOOSE",`(?:${R[C.NONNUMERICIDENTIFIER]}|${R[C.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASE",`(?:-(${R[C.PRERELEASEIDENTIFIER]}(?:\\.${R[C.PRERELEASEIDENTIFIER]})*))`);P("PRERELEASELOOSE",`(?:-?(${R[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[C.PRERELEASEIDENTIFIERLOOSE]})*))`);P("BUILDIDENTIFIER",`${Zn}+`);P("BUILD",`(?:\\+(${R[C.BUILDIDENTIFIER]}(?:\\.${R[C.BUILDIDENTIFIER]})*))`);P("FULLPLAIN",`v?${R[C.MAINVERSION]}${R[C.PRERELEASE]}?${R[C.BUILD]}?`);P("FULL",`^${R[C.FULLPLAIN]}$`);P("LOOSEPLAIN",`[v=\\s]*${R[C.MAINVERSIONLOOSE]}${R[C.PRERELEASELOOSE]}?${R[C.BUILD]}?`);P("LOOSE",`^${R[C.LOOSEPLAIN]}$`);P("GTLT","((?:<|>)?=?)");P("XRANGEIDENTIFIERLOOSE",`${R[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P("XRANGEIDENTIFIER",`${R[C.NUMERICIDENTIFIER]}|x|X|\\*`);P("XRANGEPLAIN",`[v=\\s]*(${R[C.XRANGEIDENTIFIER]})(?:\\.(${R[C.XRANGEIDENTIFIER]})(?:\\.(${R[C.XRANGEIDENTIFIER]})(?:${R[C.PRERELEASE]})?${R[C.BUILD]}?)?)?`);P("XRANGEPLAINLOOSE",`[v=\\s]*(${R[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[C.XRANGEIDENTIFIERLOOSE]})(?:${R[C.PRERELEASELOOSE]})?${R[C.BUILD]}?)?)?`);P("XRANGE",`^${R[C.GTLT]}\\s*${R[C.XRANGEPLAIN]}$`);P("XRANGELOOSE",`^${R[C.GTLT]}\\s*${R[C.XRANGEPLAINLOOSE]}$`);P("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Xn}})(?:\\.(\\d{1,${Xn}}))?(?:\\.(\\d{1,${Xn}}))?`);P("COERCE",`${R[C.COERCEPLAIN]}(?:$|[^\\d])`);P("COERCEFULL",R[C.COERCEPLAIN]+`(?:${R[C.PRERELEASE]})?(?:${R[C.BUILD]})?(?:$|[^\\d])`);P("COERCERTL",R[C.COERCE],!0);P("COERCERTLFULL",R[C.COERCEFULL],!0);P("LONETILDE","(?:~>?)");P("TILDETRIM",`(\\s*)${R[C.LONETILDE]}\\s+`,!0);ie.tildeTrimReplace="$1~";P("TILDE",`^${R[C.LONETILDE]}${R[C.XRANGEPLAIN]}$`);P("TILDELOOSE",`^${R[C.LONETILDE]}${R[C.XRANGEPLAINLOOSE]}$`);P("LONECARET","(?:\\^)");P("CARETTRIM",`(\\s*)${R[C.LONECARET]}\\s+`,!0);ie.caretTrimReplace="$1^";P("CARET",`^${R[C.LONECARET]}${R[C.XRANGEPLAIN]}$`);P("CARETLOOSE",`^${R[C.LONECARET]}${R[C.XRANGEPLAINLOOSE]}$`);P("COMPARATORLOOSE",`^${R[C.GTLT]}\\s*(${R[C.LOOSEPLAIN]})$|^$`);P("COMPARATOR",`^${R[C.GTLT]}\\s*(${R[C.FULLPLAIN]})$|^$`);P("COMPARATORTRIM",`(\\s*)${R[C.GTLT]}\\s*(${R[C.LOOSEPLAIN]}|${R[C.XRANGEPLAIN]})`,!0);ie.comparatorTrimReplace="$1$2$3";P("HYPHENRANGE",`^\\s*(${R[C.XRANGEPLAIN]})\\s+-\\s+(${R[C.XRANGEPLAIN]})\\s*$`);P("HYPHENRANGELOOSE",`^\\s*(${R[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[C.XRANGEPLAINLOOSE]})\\s*$`);P("STAR","(<|>)?=?\\s*\\*");P("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var pr=y(function(oD,Ts){var ff=Object.freeze({loose:!0}),gf=Object.freeze({}),mf=(e)=>{if(!e)return gf;if(typeof e!=="object")return ff;return e};Ts.exports=mf});var ei=y(function(sD,$s){var Ls=/^[0-9]+$/,Ns=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Ls.test(e),n=Ls.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},hf=(e,t)=>Ns(t,e);$s.exports={compareIdentifiers:Ns,rcompareIdentifiers:hf}});var q=y(function(aD,_s){var fr=yt(),{MAX_LENGTH:Ms,MAX_SAFE_INTEGER:gr}=Ye(),{safeRe:mr,t:hr}=Ge(),yf=pr(),{compareIdentifiers:ti}=ei(),bf=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(ti(e[n],r[n])!==0)return!1;return!0};class te{constructor(e,t){if(t=yf(t),e instanceof te)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>Ms)throw TypeError(`version is longer than ${Ms} characters`);fr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?mr[hr.LOOSE]:mr[hr.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>gr||this.major<0)throw TypeError("Invalid major version");if(this.minor>gr||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>gr||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<gr)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(fr("SemVer.compare",this.version,this.options,e),!(e instanceof te)){if(typeof e==="string"&&e===this.version)return 0;e=new te(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof te))e=new te(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 te))e=new te(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(fr("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 ti(r,n)}while(++t)}compareBuild(e){if(!(e instanceof te))e=new te(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(fr("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 ti(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?mr[hr.PRERELEASELOOSE]:mr[hr.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(bf(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}}_s.exports=te});var ye=y(function(cD,js){var Fs=q(),Sf=(e,t,r=!1)=>{if(e instanceof Fs)return e;try{return new Fs(e,t)}catch(n){if(!r)return null;throw n}};js.exports=Sf});var Bs=y(function(lD,qs){var Rf=ye(),Cf=(e,t)=>{let r=Rf(e,t);return r?r.version:null};qs.exports=Cf});var Vs=y(function(uD,Us){var kf=ye(),wf=(e,t)=>{let r=kf(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Us.exports=wf});var zs=y(function(dD,Hs){var Ks=q(),xf=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Ks(e instanceof Ks?e.version:e,r).inc(t,n,i).version}catch(o){return null}};Hs.exports=xf});var Ws=y(function(pD,Gs){var Ys=ye(),vf=(e,t)=>{let r=Ys(e,null,!0),n=Ys(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let 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"};Gs.exports=vf});var Qs=y(function(fD,Js){var Ef=q(),If=(e,t)=>new Ef(e,t).major;Js.exports=If});var Zs=y(function(gD,Xs){var Pf=q(),Af=(e,t)=>new Pf(e,t).minor;Xs.exports=Af});var ta=y(function(mD,ea){var Df=q(),Of=(e,t)=>new Df(e,t).patch;ea.exports=Of});var na=y(function(hD,ra){var Tf=ye(),Lf=(e,t)=>{let r=Tf(e,t);return r&&r.prerelease.length?r.prerelease:null};ra.exports=Lf});var W=y(function(yD,oa){var ia=q(),Nf=(e,t,r)=>new ia(e,r).compare(new ia(t,r));oa.exports=Nf});var aa=y(function(bD,sa){var $f=W(),Mf=(e,t,r)=>$f(t,e,r);sa.exports=Mf});var la=y(function(SD,ca){var _f=W(),Ff=(e,t)=>_f(e,t,!0);ca.exports=Ff});var yr=y(function(RD,da){var ua=q(),jf=(e,t,r)=>{let n=new ua(e,r),i=new ua(t,r);return n.compare(i)||n.compareBuild(i)};da.exports=jf});var fa=y(function(CD,pa){var qf=yr(),Bf=(e,t)=>e.sort((r,n)=>qf(r,n,t));pa.exports=Bf});var ma=y(function(kD,ga){var Uf=yr(),Vf=(e,t)=>e.sort((r,n)=>Uf(n,r,t));ga.exports=Vf});var bt=y(function(wD,ha){var Kf=W(),Hf=(e,t,r)=>Kf(e,t,r)>0;ha.exports=Hf});var br=y(function(xD,ya){var zf=W(),Yf=(e,t,r)=>zf(e,t,r)<0;ya.exports=Yf});var ri=y(function(vD,ba){var Gf=W(),Wf=(e,t,r)=>Gf(e,t,r)===0;ba.exports=Wf});var ni=y(function(ED,Sa){var Jf=W(),Qf=(e,t,r)=>Jf(e,t,r)!==0;Sa.exports=Qf});var Sr=y(function(ID,Ra){var Xf=W(),Zf=(e,t,r)=>Xf(e,t,r)>=0;Ra.exports=Zf});var Rr=y(function(PD,Ca){var eg=W(),tg=(e,t,r)=>eg(e,t,r)<=0;Ca.exports=tg});var ii=y(function(AD,ka){var rg=ri(),ng=ni(),ig=bt(),og=Sr(),sg=br(),ag=Rr(),cg=(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 rg(e,r,n);case"!=":return ng(e,r,n);case">":return ig(e,r,n);case">=":return og(e,r,n);case"<":return sg(e,r,n);case"<=":return ag(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ka.exports=cg});var xa=y(function(DD,wa){var lg=q(),ug=ye(),{safeRe:Cr,t:kr}=Ge(),dg=(e,t)=>{if(e instanceof lg)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?Cr[kr.COERCEFULL]:Cr[kr.COERCE]);else{let c=t.includePrerelease?Cr[kr.COERCERTLFULL]:Cr[kr.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ug(`${n}.${i}.${o}${s}${a}`,t)};wa.exports=dg});var Ea=y(function(OD,va){var pg=ye(),fg=Ye(),gg=q(),mg=(e,t,r)=>{if(!fg.RELEASE_TYPES.includes(t))return null;let n=hg(e,r);return n&&yg(n,t)},hg=(e,t)=>{let r=e instanceof gg?e.version:e;return pg(r,t)},yg=(e,t)=>{if(bg(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()},bg=(e)=>e.startsWith("pre");va.exports=mg});var Aa=y(function(TD,Pa){class Ia{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}}Pa.exports=Ia});var J=y(function(LD,La){var Sg=/\s+/g;class St{constructor(e,t){if(t=Cg(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 oi)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(Sg," "),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)=>!Oa(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&&Dg(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(Ag,"");let r=((this.options.includePrerelease&&Ig)|(this.options.loose&&Pg))+":"+e,n=Da.get(r);if(n)return n;let i=this.options.loose,o=i?V[B.HYPHENRANGELOOSE]:V[B.HYPHENRANGE];e=e.replace(o,Bg(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(V[B.COMPARATORTRIM],xg),T("comparator trim",e),e=e.replace(V[B.TILDETRIM],vg),T("tilde trim",e),e=e.replace(V[B.CARETTRIM],Eg),T("caret trim",e);let s=e.split(" ").map((d)=>Og(d,this.options)).join(" ").split(/\s+/).map((d)=>qg(d,this.options));if(i)s=s.filter((d)=>(T("loose invalid filter",d,this.options),!!d.match(V[B.COMPARATORLOOSE])));T("range list",s);let a=new Map,c=s.map((d)=>new oi(d,this.options));for(let d of c){if(Oa(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return Da.set(r,l),l}intersects(e,t){if(!(e instanceof St))throw TypeError("a Range is required");return this.set.some((r)=>Ta(r,t)&&e.set.some((n)=>Ta(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new kg(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Ug(this.set[t],e,this.options))return!0;return!1}}La.exports=St;var Rg=Aa(),Da=new Rg,Cg=pr(),oi=Rt(),T=yt(),kg=q(),{safeRe:V,src:wg,t:B,comparatorTrimReplace:xg,tildeTrimReplace:vg,caretTrimReplace:Eg}=Ge(),{FLAG_INCLUDE_PRERELEASE:Ig,FLAG_LOOSE:Pg}=Ye(),Ag=new RegExp(wg[B.BUILD],"g"),Oa=(e)=>e.value==="<0.0.0-0",Dg=(e)=>e.value==="",Ta=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},Og=(e,t)=>(e=e.replace(V[B.BUILD],""),T("comp",e,t),e=$g(e,t),T("caret",e),e=Lg(e,t),T("tildes",e),e=_g(e,t),T("xrange",e),e=jg(e,t),T("stars",e),e),F=(e)=>!e||e.toLowerCase()==="x"||e==="*",Tg=(e,t,r)=>F(e)&&!F(t)||F(t)&&r&&!F(r),Lg=(e,t)=>e.trim().split(/\s+/).map((r)=>Ng(r,t)).join(" "),Ng=(e,t)=>{let r=t.loose?V[B.TILDELOOSE]:V[B.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("tilde",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)T("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return T("tilde return",l),l})},$g=(e,t)=>e.trim().split(/\s+/).map((r)=>Mg(r,t)).join(" "),Mg=(e,t)=>{T("caret",e,t);let r=t.loose?V[B.CARETLOOSE]:V[B.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("caret",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(T("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(T("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return T("caret return",l),l})},_g=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Fg(r,t)).join(" ")),Fg=(e,t)=>{e=e.trim();let r=t.loose?V[B.XRANGELOOSE]:V[B.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(T("xRange",e,n,i,o,s,a,c),Tg(o,s,a))return e;let l=F(o),d=l||F(s),p=d||F(a),f=p;if(i==="="&&f)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&f){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==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(d)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(p)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return T("xRange return",n),n})},jg=(e,t)=>(T("replaceStars",e,t),e.trim().replace(V[B.STAR],"")),qg=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(V[t.includePrerelease?B.GTE0PRE:B.GTE0],"")),Bg=(e)=>(t,r,n,i,o,s,a,c,l,d,p,f)=>{if(F(n))r="";else if(F(i))r=`>=${n}.0.0${e?"-0":""}`;else if(F(o))r=`>=${n}.${i}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(F(l))c="";else if(F(d))c=`<${+l+1}.0.0-0`;else if(F(p))c=`<${l}.${+d+1}.0-0`;else if(f)c=`<=${l}.${d}.${p}-${f}`;else if(e)c=`<${l}.${d}.${+p+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},Ug=(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===oi.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 Rt=y(function(ND,ja){var Ct=Symbol("SemVer ANY");class wr{static get ANY(){return Ct}constructor(e,t){if(t=Na(t),e instanceof wr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),ai("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ct)this.value="";else this.value=this.operator+this.semver.version;ai("comp",this)}parse(e){let t=this.options.loose?$a[Ma.COMPARATORLOOSE]:$a[Ma.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=Ct;else this.semver=new _a(r[2],this.options.loose)}toString(){return this.value}test(e){if(ai("Comparator.test",e,this.options.loose),this.semver===Ct||e===Ct)return!0;if(typeof e==="string")try{e=new _a(e,this.options)}catch(t){return!1}return si(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 Fa(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Fa(this.value,t).test(e.semver)}if(t=Na(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(si(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(si(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}ja.exports=wr;var Na=pr(),{safeRe:$a,t:Ma}=Ge(),si=ii(),ai=yt(),_a=q(),Fa=J()});var kt=y(function($D,qa){var Vg=J(),Kg=(e,t,r)=>{try{t=new Vg(t,r)}catch(n){return!1}return t.test(e)};qa.exports=Kg});var Ua=y(function(MD,Ba){var Hg=J(),zg=(e,t)=>new Hg(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Ba.exports=zg});var Ka=y(function(_D,Va){var Yg=q(),Gg=J(),Wg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Gg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Yg(n,r)}}),n};Va.exports=Wg});var za=y(function(FD,Ha){var Jg=q(),Qg=J(),Xg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Qg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new Jg(n,r)}}),n};Ha.exports=Xg});var Wa=y(function(jD,Ga){var ci=q(),Zg=J(),Ya=bt(),em=(e,t)=>{e=new Zg(e,t);let r=new ci("0.0.0");if(e.test(r))return r;if(r=new ci("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new ci(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||Ya(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Ya(r,o)))r=o}if(r&&e.test(r))return r;return null};Ga.exports=em});var Qa=y(function(qD,Ja){var tm=J(),rm=(e,t)=>{try{return new tm(e,t).range||"*"}catch(r){return null}};Ja.exports=rm});var xr=y(function(BD,tc){var nm=q(),ec=Rt(),{ANY:im}=ec,om=J(),sm=kt(),Xa=bt(),Za=br(),am=Rr(),cm=Sr(),lm=(e,t,r,n)=>{e=new nm(e,n),t=new om(t,n);let i,o,s,a,c;switch(r){case">":i=Xa,o=am,s=Za,a=">",c=">=";break;case"<":i=Za,o=cm,s=Xa,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(sm(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let d=t.set[l],p=null,f=null;if(d.forEach((u)=>{if(u.semver===im)u=new ec(">=0.0.0");if(p=p||u,f=f||u,i(u.semver,p.semver,n))p=u;else if(s(u.semver,f.semver,n))f=u}),p.operator===a||p.operator===c)return!1;if((!f.operator||f.operator===a)&&o(e,f.semver))return!1;else if(f.operator===c&&s(e,f.semver))return!1}return!0};tc.exports=lm});var nc=y(function(UD,rc){var um=xr(),dm=(e,t,r)=>um(e,t,">",r);rc.exports=dm});var oc=y(function(VD,ic){var pm=xr(),fm=(e,t,r)=>pm(e,t,"<",r);ic.exports=fm});var cc=y(function(KD,ac){var sc=J(),gm=(e,t,r)=>(e=new sc(e,r),t=new sc(t,r),e.intersects(t,r));ac.exports=gm});var uc=y(function(HD,lc){var mm=kt(),hm=W();lc.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((d,p)=>hm(d,p,r));for(let d of s)if(mm(d,t,r)){if(o=d,!i)i=d}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,null]);let a=[];for(let[d,p]of n)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 c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var hc=y(function(zD,mc){var dc=J(),di=Rt(),{ANY:li}=di,ui=kt(),pi=W(),ym=(e,t,r={})=>{if(e===t)return!0;e=new dc(e,r),t=new dc(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=Sm(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},bm=[new di(">=0.0.0-0")],pc=[new di(">=0.0.0")],Sm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===li)if(t.length===1&&t[0].semver===li)return!0;else if(r.includePrerelease)e=bm;else e=pc;if(t.length===1&&t[0].semver===li)if(r.includePrerelease)return!0;else t=pc;let n=new Set,i,o;for(let u of e)if(u.operator===">"||u.operator===">=")i=fc(i,u,r);else if(u.operator==="<"||u.operator==="<=")o=gc(o,u,r);else n.add(u.semver);if(n.size>1)return null;let s;if(i&&o){if(s=pi(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let u of n){if(i&&!ui(u,String(i),r))return null;if(o&&!ui(u,String(o),r))return null;for(let m of t)if(!ui(u,String(m),r))return!1;return!0}let a,c,l,d,p=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.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===">=",l=l||u.operator==="<"||u.operator==="<=",i){if(f){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===f.major&&u.semver.minor===f.minor&&u.semver.patch===f.patch)f=!1}if(u.operator===">"||u.operator===">="){if(a=fc(i,u,r),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(c=gc(o,u,r),c===u&&c!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&d&&!i&&s!==0)return!1;if(f||p)return!1;return!0},fc=(e,t,r)=>{if(!e)return t;let n=pi(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},gc=(e,t,r)=>{if(!e)return t;let n=pi(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};mc.exports=ym});var Rc=y(function(YD,Sc){var fi=Ge(),yc=Ye(),Rm=q(),bc=ei(),Cm=ye(),km=Bs(),wm=Vs(),xm=zs(),vm=Ws(),Em=Qs(),Im=Zs(),Pm=ta(),Am=na(),Dm=W(),Om=aa(),Tm=la(),Lm=yr(),Nm=fa(),$m=ma(),Mm=bt(),_m=br(),Fm=ri(),jm=ni(),qm=Sr(),Bm=Rr(),Um=ii(),Vm=xa(),Km=Ea(),Hm=Rt(),zm=J(),Ym=kt(),Gm=Ua(),Wm=Ka(),Jm=za(),Qm=Wa(),Xm=Qa(),Zm=xr(),eh=nc(),th=oc(),rh=cc(),nh=uc(),ih=hc();Sc.exports={parse:Cm,valid:km,clean:wm,inc:xm,diff:vm,major:Em,minor:Im,patch:Pm,prerelease:Am,compare:Dm,rcompare:Om,compareLoose:Tm,compareBuild:Lm,sort:Nm,rsort:$m,gt:Mm,lt:_m,eq:Fm,neq:jm,gte:qm,lte:Bm,cmp:Um,coerce:Vm,truncate:Km,Comparator:Hm,Range:zm,satisfies:Ym,toComparators:Gm,maxSatisfying:Wm,minSatisfying:Jm,minVersion:Qm,validRange:Xm,outside:Zm,gtr:eh,ltr:th,intersects:rh,simplifyRange:nh,subset:ih,SemVer:Rm,re:fi.re,src:fi.src,tokens:fi.t,SEMVER_SPEC_VERSION:yc.SEMVER_SPEC_VERSION,RELEASE_TYPES:yc.RELEASE_TYPES,compareIdentifiers:bc.compareIdentifiers,rcompareIdentifiers:bc.rcompareIdentifiers}});var oh;var gi=K(()=>{oh=Bd(Rc(),1)});var A=y(function(fh){var mi=Symbol.for("yaml.alias"),Cc=Symbol.for("yaml.document"),vr=Symbol.for("yaml.map"),kc=Symbol.for("yaml.pair"),hi=Symbol.for("yaml.scalar"),Er=Symbol.for("yaml.seq"),pe=Symbol.for("yaml.node.type"),sh=(e)=>!!e&&typeof e==="object"&&e[pe]===mi,ah=(e)=>!!e&&typeof e==="object"&&e[pe]===Cc,ch=(e)=>!!e&&typeof e==="object"&&e[pe]===vr,lh=(e)=>!!e&&typeof e==="object"&&e[pe]===kc,wc=(e)=>!!e&&typeof e==="object"&&e[pe]===hi,uh=(e)=>!!e&&typeof e==="object"&&e[pe]===Er;function xc(e){if(e&&typeof e==="object")switch(e[pe]){case vr:case Er:return!0}return!1}function dh(e){if(e&&typeof e==="object")switch(e[pe]){case mi:case vr:case hi:case Er:return!0}return!1}var ph=(e)=>(wc(e)||xc(e))&&!!e.anchor;fh.ALIAS=mi;fh.DOC=Cc;fh.MAP=vr;fh.NODE_TYPE=pe;fh.PAIR=kc;fh.SCALAR=hi;fh.SEQ=Er;fh.hasAnchor=ph;fh.isAlias=sh;fh.isCollection=xc;fh.isDocument=ah;fh.isMap=ch;fh.isNode=dh;fh.isPair=lh;fh.isScalar=wc;fh.isSeq=uh});var wt=y(function(Dh){var j=A(),z=Symbol("break visit"),vc=Symbol("skip children"),oe=Symbol("remove node");function Ir(e,t){let r=Ec(t);if(j.isDocument(e)){if(We(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else We(null,e,r,Object.freeze([]))}Ir.BREAK=z;Ir.SKIP=vc;Ir.REMOVE=oe;function We(e,t,r,n){let i=Ic(e,t,r,n);if(j.isNode(i)||j.isPair(i))return Pc(e,n,i),We(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=We(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===z)return z;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=We("key",t.key,r,n);if(o===z)return z;else if(o===oe)t.key=null;let s=We("value",t.value,r,n);if(s===z)return z;else if(s===oe)t.value=null}}return i}async function Pr(e,t){let r=Ec(t);if(j.isDocument(e)){if(await Je(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else await Je(null,e,r,Object.freeze([]))}Pr.BREAK=z;Pr.SKIP=vc;Pr.REMOVE=oe;async function Je(e,t,r,n){let i=await Ic(e,t,r,n);if(j.isNode(i)||j.isPair(i))return Pc(e,n,i),Je(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=await Je(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===z)return z;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=await Je("key",t.key,r,n);if(o===z)return z;else if(o===oe)t.key=null;let s=await Je("value",t.value,r,n);if(s===z)return z;else if(s===oe)t.value=null}}return i}function Ec(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 Ic(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(j.isMap(t))return r.Map?.(e,t,n);if(j.isSeq(t))return r.Seq?.(e,t,n);if(j.isPair(t))return r.Pair?.(e,t,n);if(j.isScalar(t))return r.Scalar?.(e,t,n);if(j.isAlias(t))return r.Alias?.(e,t,n);return}function Pc(e,t,r){let n=t[t.length-1];if(j.isCollection(n))n.items[e]=r;else if(j.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(j.isDocument(n))n.contents=r;else{let i=j.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Dh.visit=Ir;Dh.visitAsync=Pr});var yi=y(function(Mh){var Ac=A(),Lh=wt(),Nh={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},$h=(e)=>e.replace(/[!,[\]{}]/g,(t)=>Nh[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,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);if(o==="!"||o==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return o}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(o){return t(String(o)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+$h(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&&Ac.isNode(e.contents)){let i={};Lh.visit(e.contents,(o,s)=>{if(Ac.isNode(s)&&s.tag)i[s.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,o]of r){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { createRequire as __uibotCreateRequire } from "node:module";
|
|
3
|
+
import { fileURLToPath as __uibotFileURLToPath } from "node:url";
|
|
4
|
+
const __uibotRequire = __uibotCreateRequire(import.meta.url);
|
|
5
|
+
const __uibotDir = __uibotFileURLToPath(new URL(".", import.meta.url));
|
|
6
|
+
import{createRequire as qp}from"node:module";var Np=Object.create;var{getPrototypeOf:Lp,defineProperty:$o,getOwnPropertyNames:$p}=Object;var Mo=Object.prototype.hasOwnProperty;function Mp(e){return this[e]}var _p,jp,Fp=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?_p??=new WeakMap:jp??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?Np(Lp(e)):{};let o=t||!e||!e.__esModule||!Mo.call(e,"default")?$o(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of $p(e))if(!Mo.call(o,a))$o(o,a,{get:Mp.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Qe=qp(import.meta.url);var st=y(function(ID,ca){var Zf=Number.MAX_SAFE_INTEGER||9007199254740991,eg=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ca.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Zf,RELEASE_TYPES:eg,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Lt=y(function(ED,la){var tg=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};la.exports=tg});var ot=y(function(pe,ua){var{MAX_SAFE_COMPONENT_LENGTH:Ci,MAX_SAFE_BUILD_LENGTH:rg,MAX_LENGTH:ng}=st(),ig=Lt();pe=ua.exports={};var sg=pe.re=[],og=pe.safeRe=[],x=pe.src=[],ag=pe.safeSrc=[],I=pe.t={},cg=0,xi="[a-zA-Z0-9-]",lg=[["\\s",1],["\\d",ng],[xi,rg]],ug=(e)=>{for(let[t,r]of lg)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},T=(e,t,r)=>{let n=ug(t),i=cg++;ig(e,i,t),I[e]=i,x[i]=t,ag[i]=n,sg[i]=new RegExp(t,r?"g":void 0),og[i]=new RegExp(n,r?"g":void 0)};T("NUMERICIDENTIFIER","0|[1-9]\\d*");T("NUMERICIDENTIFIERLOOSE","\\d+");T("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xi}*`);T("MAINVERSION",`(${x[I.NUMERICIDENTIFIER]})\\.(${x[I.NUMERICIDENTIFIER]})\\.(${x[I.NUMERICIDENTIFIER]})`);T("MAINVERSIONLOOSE",`(${x[I.NUMERICIDENTIFIERLOOSE]})\\.(${x[I.NUMERICIDENTIFIERLOOSE]})\\.(${x[I.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASEIDENTIFIER",`(?:${x[I.NONNUMERICIDENTIFIER]}|${x[I.NUMERICIDENTIFIER]})`);T("PRERELEASEIDENTIFIERLOOSE",`(?:${x[I.NONNUMERICIDENTIFIER]}|${x[I.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASE",`(?:-(${x[I.PRERELEASEIDENTIFIER]}(?:\\.${x[I.PRERELEASEIDENTIFIER]})*))`);T("PRERELEASELOOSE",`(?:-?(${x[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${x[I.PRERELEASEIDENTIFIERLOOSE]})*))`);T("BUILDIDENTIFIER",`${xi}+`);T("BUILD",`(?:\\+(${x[I.BUILDIDENTIFIER]}(?:\\.${x[I.BUILDIDENTIFIER]})*))`);T("FULLPLAIN",`v?${x[I.MAINVERSION]}${x[I.PRERELEASE]}?${x[I.BUILD]}?`);T("FULL",`^${x[I.FULLPLAIN]}$`);T("LOOSEPLAIN",`[v=\\s]*${x[I.MAINVERSIONLOOSE]}${x[I.PRERELEASELOOSE]}?${x[I.BUILD]}?`);T("LOOSE",`^${x[I.LOOSEPLAIN]}$`);T("GTLT","((?:<|>)?=?)");T("XRANGEIDENTIFIERLOOSE",`${x[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T("XRANGEIDENTIFIER",`${x[I.NUMERICIDENTIFIER]}|x|X|\\*`);T("XRANGEPLAIN",`[v=\\s]*(${x[I.XRANGEIDENTIFIER]})(?:\\.(${x[I.XRANGEIDENTIFIER]})(?:\\.(${x[I.XRANGEIDENTIFIER]})(?:${x[I.PRERELEASE]})?${x[I.BUILD]}?)?)?`);T("XRANGEPLAINLOOSE",`[v=\\s]*(${x[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[I.XRANGEIDENTIFIERLOOSE]})(?:${x[I.PRERELEASELOOSE]})?${x[I.BUILD]}?)?)?`);T("XRANGE",`^${x[I.GTLT]}\\s*${x[I.XRANGEPLAIN]}$`);T("XRANGELOOSE",`^${x[I.GTLT]}\\s*${x[I.XRANGEPLAINLOOSE]}$`);T("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ci}})(?:\\.(\\d{1,${Ci}}))?(?:\\.(\\d{1,${Ci}}))?`);T("COERCE",`${x[I.COERCEPLAIN]}(?:$|[^\\d])`);T("COERCEFULL",x[I.COERCEPLAIN]+`(?:${x[I.PRERELEASE]})?(?:${x[I.BUILD]})?(?:$|[^\\d])`);T("COERCERTL",x[I.COERCE],!0);T("COERCERTLFULL",x[I.COERCEFULL],!0);T("LONETILDE","(?:~>?)");T("TILDETRIM",`(\\s*)${x[I.LONETILDE]}\\s+`,!0);pe.tildeTrimReplace="$1~";T("TILDE",`^${x[I.LONETILDE]}${x[I.XRANGEPLAIN]}$`);T("TILDELOOSE",`^${x[I.LONETILDE]}${x[I.XRANGEPLAINLOOSE]}$`);T("LONECARET","(?:\\^)");T("CARETTRIM",`(\\s*)${x[I.LONECARET]}\\s+`,!0);pe.caretTrimReplace="$1^";T("CARET",`^${x[I.LONECARET]}${x[I.XRANGEPLAIN]}$`);T("CARETLOOSE",`^${x[I.LONECARET]}${x[I.XRANGEPLAINLOOSE]}$`);T("COMPARATORLOOSE",`^${x[I.GTLT]}\\s*(${x[I.LOOSEPLAIN]})$|^$`);T("COMPARATOR",`^${x[I.GTLT]}\\s*(${x[I.FULLPLAIN]})$|^$`);T("COMPARATORTRIM",`(\\s*)${x[I.GTLT]}\\s*(${x[I.LOOSEPLAIN]}|${x[I.XRANGEPLAIN]})`,!0);pe.comparatorTrimReplace="$1$2$3";T("HYPHENRANGE",`^\\s*(${x[I.XRANGEPLAIN]})\\s+-\\s+(${x[I.XRANGEPLAIN]})\\s*$`);T("HYPHENRANGELOOSE",`^\\s*(${x[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${x[I.XRANGEPLAINLOOSE]})\\s*$`);T("STAR","(<|>)?=?\\s*\\*");T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Mr=y(function(AD,da){var dg=Object.freeze({loose:!0}),pg=Object.freeze({}),fg=(e)=>{if(!e)return pg;if(typeof e!=="object")return dg;return e};da.exports=fg});var Ii=y(function(PD,ga){var pa=/^[0-9]+$/,fa=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=pa.test(e),n=pa.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},gg=(e,t)=>fa(t,e);ga.exports={compareIdentifiers:fa,rcompareIdentifiers:gg}});var H=y(function(DD,ha){var _r=Lt(),{MAX_LENGTH:ma,MAX_SAFE_INTEGER:jr}=st(),{safeRe:Fr,t:qr}=ot(),mg=Mr(),{compareIdentifiers:Ei}=Ii(),hg=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Ei(e[n],r[n])!==0)return!1;return!0};class ae{constructor(e,t){if(t=mg(t),e instanceof ae)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>ma)throw TypeError(`version is longer than ${ma} characters`);_r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Fr[qr.LOOSE]:Fr[qr.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>jr||this.major<0)throw TypeError("Invalid major version");if(this.minor>jr||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>jr||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<jr)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(_r("SemVer.compare",this.version,this.options,e),!(e instanceof ae)){if(typeof e==="string"&&e===this.version)return 0;e=new ae(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof ae))e=new ae(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 ae))e=new ae(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(_r("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 Ei(r,n)}while(++t)}compareBuild(e){if(!(e instanceof ae))e=new ae(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(_r("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 Ei(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?Fr[qr.PRERELEASELOOSE]:Fr[qr.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(hg(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}}ha.exports=ae});var Ce=y(function(OD,ba){var ya=H(),yg=(e,t,r=!1)=>{if(e instanceof ya)return e;try{return new ya(e,t)}catch(n){if(!r)return null;throw n}};ba.exports=yg});var wa=y(function(TD,Sa){var bg=Ce(),Sg=(e,t)=>{let r=bg(e,t);return r?r.version:null};Sa.exports=Sg});var Ra=y(function(ND,ka){var wg=Ce(),kg=(e,t)=>{let r=wg(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};ka.exports=kg});var xa=y(function(LD,Ca){var va=H(),Rg=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new va(e instanceof va?e.version:e,r).inc(t,n,i).version}catch(s){return null}};Ca.exports=Rg});var Aa=y(function($D,Ea){var Ia=Ce(),vg=(e,t)=>{let r=Ia(e,null,!0),n=Ia(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 u=c?"pre":"";if(r.major!==n.major)return u+"major";if(r.minor!==n.minor)return u+"minor";if(r.patch!==n.patch)return u+"patch";return"prerelease"};Ea.exports=vg});var Da=y(function(MD,Pa){var Cg=H(),xg=(e,t)=>new Cg(e,t).major;Pa.exports=xg});var Ta=y(function(_D,Oa){var Ig=H(),Eg=(e,t)=>new Ig(e,t).minor;Oa.exports=Eg});var La=y(function(jD,Na){var Ag=H(),Pg=(e,t)=>new Ag(e,t).patch;Na.exports=Pg});var Ma=y(function(FD,$a){var Dg=Ce(),Og=(e,t)=>{let r=Dg(e,t);return r&&r.prerelease.length?r.prerelease:null};$a.exports=Og});var ee=y(function(qD,ja){var _a=H(),Tg=(e,t,r)=>new _a(e,r).compare(new _a(t,r));ja.exports=Tg});var qa=y(function(BD,Fa){var Ng=ee(),Lg=(e,t,r)=>Ng(t,e,r);Fa.exports=Lg});var Ua=y(function(UD,Ba){var $g=ee(),Mg=(e,t)=>$g(e,t,!0);Ba.exports=Mg});var Br=y(function(VD,Ha){var Va=H(),_g=(e,t,r)=>{let n=new Va(e,r),i=new Va(t,r);return n.compare(i)||n.compareBuild(i)};Ha.exports=_g});var za=y(function(HD,Ka){var jg=Br(),Fg=(e,t)=>e.sort((r,n)=>jg(r,n,t));Ka.exports=Fg});var Ya=y(function(KD,Ga){var qg=Br(),Bg=(e,t)=>e.sort((r,n)=>qg(n,r,t));Ga.exports=Bg});var $t=y(function(zD,Ja){var Ug=ee(),Vg=(e,t,r)=>Ug(e,t,r)>0;Ja.exports=Vg});var Ur=y(function(GD,Wa){var Hg=ee(),Kg=(e,t,r)=>Hg(e,t,r)<0;Wa.exports=Kg});var Ai=y(function(YD,Qa){var zg=ee(),Gg=(e,t,r)=>zg(e,t,r)===0;Qa.exports=Gg});var Pi=y(function(JD,Xa){var Yg=ee(),Jg=(e,t,r)=>Yg(e,t,r)!==0;Xa.exports=Jg});var Vr=y(function(WD,Za){var Wg=ee(),Qg=(e,t,r)=>Wg(e,t,r)>=0;Za.exports=Qg});var Hr=y(function(QD,ec){var Xg=ee(),Zg=(e,t,r)=>Xg(e,t,r)<=0;ec.exports=Zg});var Di=y(function(XD,tc){var em=Ai(),tm=Pi(),rm=$t(),nm=Vr(),im=Ur(),sm=Hr(),om=(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 em(e,r,n);case"!=":return tm(e,r,n);case">":return rm(e,r,n);case">=":return nm(e,r,n);case"<":return im(e,r,n);case"<=":return sm(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};tc.exports=om});var nc=y(function(ZD,rc){var am=H(),cm=Ce(),{safeRe:Kr,t:zr}=ot(),lm=(e,t)=>{if(e instanceof am)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?Kr[zr.COERCEFULL]:Kr[zr.COERCE]);else{let c=t.includePrerelease?Kr[zr.COERCERTLFULL]:Kr[zr.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 cm(`${n}.${i}.${s}${o}${a}`,t)};rc.exports=lm});var oc=y(function(eO,sc){var um=Ce(),ic=st(),dm=H(),pm=(e,t,r)=>{if(!ic.RELEASE_TYPES.includes(t))return null;let n=fm(e,r);return n&&gm(n,t)},fm=(e,t)=>{let r=e instanceof dm?e.version:e;return um(r,t)},gm=(e,t)=>{if(mm(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()},mm=(e)=>e.startsWith("pre");sc.exports=pm});var lc=y(function(tO,cc){class ac{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}}cc.exports=ac});var te=y(function(rO,fc){var hm=/\s+/g;class Mt{constructor(e,t){if(t=bm(t),e instanceof Mt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new Mt(e.raw,t);if(e instanceof Gr)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(hm," "),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)=>!dc(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&&Em(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(Im,"");let r=((this.options.includePrerelease&&Cm)|(this.options.loose&&xm))+":"+e,n=uc.get(r);if(n)return n;let i=this.options.loose,s=i?z[K.HYPHENRANGELOOSE]:z[K.HYPHENRANGE];e=e.replace(s,jm(this.options.includePrerelease)),j("hyphen replace",e),e=e.replace(z[K.COMPARATORTRIM],km),j("comparator trim",e),e=e.replace(z[K.TILDETRIM],Rm),j("tilde trim",e),e=e.replace(z[K.CARETTRIM],vm),j("caret trim",e);let o=e.split(" ").map((u)=>Am(u,this.options)).join(" ").split(/\s+/).map((u)=>_m(u,this.options));if(i)o=o.filter((u)=>(j("loose invalid filter",u,this.options),!!u.match(z[K.COMPARATORLOOSE])));j("range list",o);let a=new Map,c=o.map((u)=>new Gr(u,this.options));for(let u of c){if(dc(u))return[u];a.set(u.value,u)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return uc.set(r,l),l}intersects(e,t){if(!(e instanceof Mt))throw TypeError("a Range is required");return this.set.some((r)=>pc(r,t)&&e.set.some((n)=>pc(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 Sm(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Fm(this.set[t],e,this.options))return!0;return!1}}fc.exports=Mt;var ym=lc(),uc=new ym,bm=Mr(),Gr=_t(),j=Lt(),Sm=H(),{safeRe:z,src:wm,t:K,comparatorTrimReplace:km,tildeTrimReplace:Rm,caretTrimReplace:vm}=ot(),{FLAG_INCLUDE_PRERELEASE:Cm,FLAG_LOOSE:xm}=st(),Im=new RegExp(wm[K.BUILD],"g"),dc=(e)=>e.value==="<0.0.0-0",Em=(e)=>e.value==="",pc=(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},Am=(e,t)=>(e=e.replace(z[K.BUILD],""),j("comp",e,t),e=Tm(e,t),j("caret",e),e=Dm(e,t),j("tildes",e),e=Lm(e,t),j("xrange",e),e=Mm(e,t),j("stars",e),e),U=(e)=>!e||e.toLowerCase()==="x"||e==="*",Pm=(e,t,r)=>U(e)&&!U(t)||U(t)&&r&&!U(r),Dm=(e,t)=>e.trim().split(/\s+/).map((r)=>Om(r,t)).join(" "),Om=(e,t)=>{let r=t.loose?z[K.TILDELOOSE]:z[K.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{j("tilde",e,i,s,o,a,c);let l;if(U(s))l="";else if(U(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(U(a))l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(c)j("replaceTilde pr",c),l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return j("tilde return",l),l})},Tm=(e,t)=>e.trim().split(/\s+/).map((r)=>Nm(r,t)).join(" "),Nm=(e,t)=>{j("caret",e,t);let r=t.loose?z[K.CARETLOOSE]:z[K.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{j("caret",e,i,s,o,a,c);let l;if(U(s))l="";else if(U(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(U(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(j("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(j("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 j("caret return",l),l})},Lm=(e,t)=>(j("replaceXRanges",e,t),e.split(/\s+/).map((r)=>$m(r,t)).join(" ")),$m=(e,t)=>{e=e.trim();let r=t.loose?z[K.XRANGELOOSE]:z[K.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{if(j("xRange",e,n,i,s,o,a,c),Pm(s,o,a))return e;let l=U(s),u=l||U(o),p=u||U(a),f=p;if(i==="="&&f)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&f){if(u)o=0;if(a=0,i===">")if(i=">=",u)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",u)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(u)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(p)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return j("xRange return",n),n})},Mm=(e,t)=>(j("replaceStars",e,t),e.trim().replace(z[K.STAR],"")),_m=(e,t)=>(j("replaceGTE0",e,t),e.trim().replace(z[t.includePrerelease?K.GTE0PRE:K.GTE0],"")),jm=(e)=>(t,r,n,i,s,o,a,c,l,u,p,f)=>{if(U(n))r="";else if(U(i))r=`>=${n}.0.0${e?"-0":""}`;else if(U(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(U(l))c="";else if(U(u))c=`<${+l+1}.0.0-0`;else if(U(p))c=`<${l}.${+u+1}.0-0`;else if(f)c=`<=${l}.${u}.${p}-${f}`;else if(e)c=`<${l}.${u}.${+p+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},Fm=(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(j(e[n].semver),e[n].semver===Gr.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 _t=y(function(nO,Sc){var jt=Symbol("SemVer ANY");class Yr{static get ANY(){return jt}constructor(e,t){if(t=gc(t),e instanceof Yr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Ti("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===jt)this.value="";else this.value=this.operator+this.semver.version;Ti("comp",this)}parse(e){let t=this.options.loose?mc[hc.COMPARATORLOOSE]:mc[hc.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=jt;else this.semver=new yc(r[2],this.options.loose)}toString(){return this.value}test(e){if(Ti("Comparator.test",e,this.options.loose),this.semver===jt||e===jt)return!0;if(typeof e==="string")try{e=new yc(e,this.options)}catch(t){return!1}return Oi(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Yr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new bc(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new bc(this.value,t).test(e.semver)}if(t=gc(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(Oi(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Oi(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Sc.exports=Yr;var gc=Mr(),{safeRe:mc,t:hc}=ot(),Oi=Di(),Ti=Lt(),yc=H(),bc=te()});var Ft=y(function(iO,wc){var qm=te(),Bm=(e,t,r)=>{try{t=new qm(t,r)}catch(n){return!1}return t.test(e)};wc.exports=Bm});var Rc=y(function(sO,kc){var Um=te(),Vm=(e,t)=>new Um(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));kc.exports=Vm});var Cc=y(function(oO,vc){var Hm=H(),Km=te(),zm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Km(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new Hm(n,r)}}),n};vc.exports=zm});var Ic=y(function(aO,xc){var Gm=H(),Ym=te(),Jm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Ym(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new Gm(n,r)}}),n};xc.exports=Jm});var Pc=y(function(cO,Ac){var Ni=H(),Wm=te(),Ec=$t(),Qm=(e,t)=>{e=new Wm(e,t);let r=new Ni("0.0.0");if(e.test(r))return r;if(r=new Ni("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 Ni(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||Ec(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Ec(r,s)))r=s}if(r&&e.test(r))return r;return null};Ac.exports=Qm});var Oc=y(function(lO,Dc){var Xm=te(),Zm=(e,t)=>{try{return new Xm(e,t).range||"*"}catch(r){return null}};Dc.exports=Zm});var Jr=y(function(uO,$c){var eh=H(),Lc=_t(),{ANY:th}=Lc,rh=te(),nh=Ft(),Tc=$t(),Nc=Ur(),ih=Hr(),sh=Vr(),oh=(e,t,r,n)=>{e=new eh(e,n),t=new rh(t,n);let i,s,o,a,c;switch(r){case">":i=Tc,s=ih,o=Nc,a=">",c=">=";break;case"<":i=Nc,s=sh,o=Tc,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(nh(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],p=null,f=null;if(u.forEach((d)=>{if(d.semver===th)d=new Lc(">=0.0.0");if(p=p||d,f=f||d,i(d.semver,p.semver,n))p=d;else if(o(d.semver,f.semver,n))f=d}),p.operator===a||p.operator===c)return!1;if((!f.operator||f.operator===a)&&s(e,f.semver))return!1;else if(f.operator===c&&o(e,f.semver))return!1}return!0};$c.exports=oh});var _c=y(function(dO,Mc){var ah=Jr(),ch=(e,t,r)=>ah(e,t,">",r);Mc.exports=ch});var Fc=y(function(pO,jc){var lh=Jr(),uh=(e,t,r)=>lh(e,t,"<",r);jc.exports=uh});var Uc=y(function(fO,Bc){var qc=te(),dh=(e,t,r)=>(e=new qc(e,r),t=new qc(t,r),e.intersects(t,r));Bc.exports=dh});var Hc=y(function(gO,Vc){var ph=Ft(),fh=ee();Vc.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((u,p)=>fh(u,p,r));for(let u of o)if(ph(u,t,r)){if(s=u,!i)i=u}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[u,p]of n)if(u===p)a.push(u);else if(!p&&u===o[0])a.push("*");else if(!p)a.push(`>=${u}`);else if(u===o[0])a.push(`<=${p}`);else a.push(`${u} - ${p}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var Wc=y(function(mO,Jc){var Kc=te(),Mi=_t(),{ANY:Li}=Mi,$i=Ft(),_i=ee(),gh=(e,t,r={})=>{if(e===t)return!0;e=new Kc(e,r),t=new Kc(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=hh(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},mh=[new Mi(">=0.0.0-0")],zc=[new Mi(">=0.0.0")],hh=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Li)if(t.length===1&&t[0].semver===Li)return!0;else if(r.includePrerelease)e=mh;else e=zc;if(t.length===1&&t[0].semver===Li)if(r.includePrerelease)return!0;else t=zc;let n=new Set,i,s;for(let d of e)if(d.operator===">"||d.operator===">=")i=Gc(i,d,r);else if(d.operator==="<"||d.operator==="<=")s=Yc(s,d,r);else n.add(d.semver);if(n.size>1)return null;let o;if(i&&s){if(o=_i(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let d of n){if(i&&!$i(d,String(i),r))return null;if(s&&!$i(d,String(s),r))return null;for(let m of t)if(!$i(d,String(m),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0)p=!1;for(let d of t){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",i){if(f){if(d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch)f=!1}if(d.operator===">"||d.operator===">="){if(a=Gc(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!d.test(i.semver))return!1}if(s){if(p){if(d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch)p=!1}if(d.operator==="<"||d.operator==="<="){if(c=Yc(s,d,r),c===d&&c!==s)return!1}else if(s.operator==="<="&&!d.test(s.semver))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}if(i&&l&&!s&&o!==0)return!1;if(s&&u&&!i&&o!==0)return!1;if(f||p)return!1;return!0},Gc=(e,t,r)=>{if(!e)return t;let n=_i(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Yc=(e,t,r)=>{if(!e)return t;let n=_i(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Jc.exports=gh});var Xc=y(function(hO,Qc){var at=ot(),Wr=st(),yh=H(),Qr=Ii(),bh=Ce(),Sh=wa(),wh=Ra(),kh=xa(),Rh=Aa(),vh=Da(),Ch=Ta(),xh=La(),Ih=Ma(),Eh=ee(),Ah=qa(),Ph=Ua(),Dh=Br(),Oh=za(),Th=Ya(),Nh=$t(),Lh=Ur(),$h=Ai(),Mh=Pi(),_h=Vr(),jh=Hr(),Fh=Di(),qh=nc(),Bh=oc(),Uh=_t(),Vh=te(),Hh=Ft(),Kh=Rc(),zh=Cc(),Gh=Ic(),Yh=Pc(),Jh=Oc(),Wh=Jr(),Qh=_c(),Xh=Fc(),Zh=Uc(),ey=Hc(),ty=Wc();Qc.exports={parse:bh,valid:Sh,clean:wh,inc:kh,diff:Rh,major:vh,minor:Ch,patch:xh,prerelease:Ih,compare:Eh,rcompare:Ah,compareLoose:Ph,compareBuild:Dh,sort:Oh,rsort:Th,gt:Nh,lt:Lh,eq:$h,neq:Mh,gte:_h,lte:jh,cmp:Fh,coerce:qh,truncate:Bh,Comparator:Uh,Range:Vh,satisfies:Hh,toComparators:Kh,maxSatisfying:zh,minSatisfying:Gh,minVersion:Yh,validRange:Jh,outside:Wh,gtr:Qh,ltr:Xh,intersects:Zh,simplifyRange:ey,subset:ty,SemVer:yh,re:at.re,src:at.src,tokens:at.t,SEMVER_SPEC_VERSION:Wr.SEMVER_SPEC_VERSION,RELEASE_TYPES:Wr.RELEASE_TYPES,compareIdentifiers:Qr.compareIdentifiers,rcompareIdentifiers:Qr.rcompareIdentifiers}});var ry;var ji=G(()=>{ry=Fp(Xc(),1)});var L=y(function(uy){var Fi=Symbol.for("yaml.alias"),Zc=Symbol.for("yaml.document"),Xr=Symbol.for("yaml.map"),el=Symbol.for("yaml.pair"),qi=Symbol.for("yaml.scalar"),Zr=Symbol.for("yaml.seq"),Se=Symbol.for("yaml.node.type"),ny=(e)=>!!e&&typeof e==="object"&&e[Se]===Fi,iy=(e)=>!!e&&typeof e==="object"&&e[Se]===Zc,sy=(e)=>!!e&&typeof e==="object"&&e[Se]===Xr,oy=(e)=>!!e&&typeof e==="object"&&e[Se]===el,tl=(e)=>!!e&&typeof e==="object"&&e[Se]===qi,ay=(e)=>!!e&&typeof e==="object"&&e[Se]===Zr;function rl(e){if(e&&typeof e==="object")switch(e[Se]){case Xr:case Zr:return!0}return!1}function cy(e){if(e&&typeof e==="object")switch(e[Se]){case Fi:case Xr:case qi:case Zr:return!0}return!1}var ly=(e)=>(tl(e)||rl(e))&&!!e.anchor;uy.ALIAS=Fi;uy.DOC=Zc;uy.MAP=Xr;uy.NODE_TYPE=Se;uy.PAIR=el;uy.SCALAR=qi;uy.SEQ=Zr;uy.hasAnchor=ly;uy.isAlias=ny;uy.isCollection=rl;uy.isDocument=iy;uy.isMap=sy;uy.isNode=cy;uy.isPair=oy;uy.isScalar=tl;uy.isSeq=ay});var qt=y(function(Ey){var V=L(),W=Symbol("break visit"),nl=Symbol("skip children"),fe=Symbol("remove node");function en(e,t){let r=il(t);if(V.isDocument(e)){if(ct(null,e.contents,r,Object.freeze([e]))===fe)e.contents=null}else ct(null,e,r,Object.freeze([]))}en.BREAK=W;en.SKIP=nl;en.REMOVE=fe;function ct(e,t,r,n){let i=sl(e,t,r,n);if(V.isNode(i)||V.isPair(i))return ol(e,n,i),ct(e,i,r,n);if(typeof i!=="symbol"){if(V.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){let o=ct(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===W)return W;else if(o===fe)t.items.splice(s,1),s-=1}}else if(V.isPair(t)){n=Object.freeze(n.concat(t));let s=ct("key",t.key,r,n);if(s===W)return W;else if(s===fe)t.key=null;let o=ct("value",t.value,r,n);if(o===W)return W;else if(o===fe)t.value=null}}return i}async function tn(e,t){let r=il(t);if(V.isDocument(e)){if(await lt(null,e.contents,r,Object.freeze([e]))===fe)e.contents=null}else await lt(null,e,r,Object.freeze([]))}tn.BREAK=W;tn.SKIP=nl;tn.REMOVE=fe;async function lt(e,t,r,n){let i=await sl(e,t,r,n);if(V.isNode(i)||V.isPair(i))return ol(e,n,i),lt(e,i,r,n);if(typeof i!=="symbol"){if(V.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){let o=await lt(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===W)return W;else if(o===fe)t.items.splice(s,1),s-=1}}else if(V.isPair(t)){n=Object.freeze(n.concat(t));let s=await lt("key",t.key,r,n);if(s===W)return W;else if(s===fe)t.key=null;let o=await lt("value",t.value,r,n);if(o===W)return W;else if(o===fe)t.value=null}}return i}function il(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 sl(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(V.isMap(t))return r.Map?.(e,t,n);if(V.isSeq(t))return r.Seq?.(e,t,n);if(V.isPair(t))return r.Pair?.(e,t,n);if(V.isScalar(t))return r.Scalar?.(e,t,n);if(V.isAlias(t))return r.Alias?.(e,t,n);return}function ol(e,t,r){let n=t[t.length-1];if(V.isCollection(n))n.items[e]=r;else if(V.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(V.isDocument(n))n.contents=r;else{let i=V.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Ey.visit=en;Ey.visitAsync=tn});var Bi=y(function(Ny){var al=L(),Dy=qt(),Oy={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ty=(e)=>e.replace(/[!,[\]{}]/g,(t)=>Oy[t]);class re{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},re.defaultYaml,e),this.tags=Object.assign({},re.defaultTags,t)}clone(){let e=new re(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new re(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:re.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},re.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:re.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},re.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+Ty(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&&al.isNode(e.contents)){let i={};Dy.visit(e.contents,(s,o)=>{if(al.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(`
|
|
7
|
+
`)}}re.defaultYaml={explicit:!1,version:"1.2"};re.defaultTags={"!!":"tag:yaml.org,2002:"};Ny.Directives=re});var rn=y(function(jy){var cl=L(),$y=qt();function My(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 ll(e){let t=new Set;return $y.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}}),t}function ul(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function _y(e,t){let r=[],n=new Map,i=null;return{onAnchor:(s)=>{r.push(s),i??(i=ll(e));let o=ul(t,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o==="object"&&o.anchor&&(cl.isScalar(o.node)||cl.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}}jy.anchorIsValid=My;jy.anchorNames=ll;jy.createNodeAnchors=_y;jy.findNewAnchor=ul});var Ui=y(function(Vy){function Bt(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=Bt(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=Bt(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=Bt(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=Bt(e,n,i,s);if(o===void 0)delete n[i];else if(o!==s)n[i]=o}return e.call(t,r,n)}Vy.applyReviver=Bt});var xe=y(function(zy){var Ky=L();function dl(e,t,r){if(Array.isArray(e))return e.map((n,i)=>dl(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!Ky.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}zy.toJS=dl});var nn=y(function(Wy){var Yy=Ui(),pl=L(),Jy=xe();class fl{constructor(e){Object.defineProperty(this,pl.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(!pl.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=Jy.toJS(this,"",s);if(typeof n==="function")for(let{count:a,res:c}of s.anchors.values())n(c,a);return typeof i==="function"?Yy.applyReviver(i,{"":o},"",o):o}}Wy.NodeBase=fl});var Ut=y(function(rb){var Xy=rn(),Zy=qt(),ut=L(),eb=nn(),tb=xe();class gl extends eb.NodeBase{constructor(e){super(ut.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=[],Zy.visit(e,{Node:(i,s)=>{if(ut.isAlias(s)||ut.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)tb.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=sn(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(Xy.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 sn(e,t,r){if(ut.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(ut.isCollection(t)){let n=0;for(let i of t.items){let s=sn(e,i,r);if(s>n)n=s}return n}else if(ut.isPair(t)){let n=sn(e,t.key,r),i=sn(e,t.value,r);return Math.max(n,i)}return 1}rb.Alias=gl});var q=y(function(cb){var ib=L(),sb=nn(),ob=xe(),ab=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class Be extends sb.NodeBase{constructor(e){super(ib.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:ob.toJS(this.value,e,t)}toString(){return String(this.value)}}Be.BLOCK_FOLDED="BLOCK_FOLDED";Be.BLOCK_LITERAL="BLOCK_LITERAL";Be.PLAIN="PLAIN";Be.QUOTE_DOUBLE="QUOTE_DOUBLE";Be.QUOTE_SINGLE="QUOTE_SINGLE";cb.Scalar=Be;cb.isScalarValue=ab});var Vt=y(function(mb){var db=Ut(),Ue=L(),ml=q(),pb="tag:yaml.org,2002:";function fb(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 gb(e,t,r){if(Ue.isDocument(e))e=e.contents;if(Ue.isNode(e))return e;if(Ue.isPair(e)){let p=r.schema[Ue.MAP].createNode?.(r.schema,null,r);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: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 db.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=pb+t.slice(2);let l=fb(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let p=new ml.Scalar(e);if(c)c.node=p;return p}l=e instanceof Map?o[Ue.MAP]:(Symbol.iterator in Object(e))?o[Ue.SEQ]:o[Ue.MAP]}if(s)s(l),delete r.onTagObj;let u=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from==="function"?l.nodeClass.from(r.schema,e,r):new ml.Scalar(e);if(t)u.tag=t;else if(!l.default)u.tag=l.tag;if(c)c.node=u;return u}mb.createNode=gb});var on=y(function(Sb){var yb=Vt(),ge=L(),bb=nn();function Vi(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 yb.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 hl=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class yl extends bb.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)=>ge.isNode(r)||ge.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(hl(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(ge.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(r,Vi(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(ge.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&&ge.isScalar(i)?i.value:i;else return ge.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!ge.isPair(t))return!1;let r=t.value;return r==null||e&&ge.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 ge.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(ge.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(r,Vi(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}Sb.Collection=yl;Sb.collectionFromPath=Vi;Sb.isEmptyPath=hl});var Ht=y(function(xb){var vb=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Hi(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var Cb=(e,t,r)=>e.endsWith(`
|
|
8
|
+
`)?Hi(r,t):r.includes(`
|
|
6
9
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`){if(r==="block")g=
|
|
9
|
-
`&&
|
|
10
|
-
`&&
|
|
11
|
-
${t}${e.slice(0,
|
|
12
|
-
${t}${e.slice(
|
|
13
|
-
`);n=t,i=t+1,
|
|
14
|
-
`){if(o
|
|
15
|
-
|
|
16
|
-
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')
|
|
17
|
-
`,c+=2;if(s
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return
|
|
19
|
-
${r}`)+"'";return t.implicitKey?n:
|
|
10
|
+
`+Hi(r,t):(e.endsWith(" ")?"":" ")+r;xb.indentComment=Hi;xb.lineComment=Cb;xb.stringifyComment=vb});var Sl=y(function(Db){function Pb(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=[],u={},p=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,s))l.push(0);else p=i-n;let f=void 0,d=void 0,m=!1,g=-1,h=-1,b=-1;if(r==="block"){if(g=bl(e,g,t.length),g!==-1)p=g+c}for(let C;C=e[g+=1];){if(r==="quoted"&&C==="\\"){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(C===`
|
|
11
|
+
`){if(r==="block")g=bl(e,g,t.length);p=g+t.length+c,f=void 0}else{if(C===" "&&d&&d!==" "&&d!==`
|
|
12
|
+
`&&d!=="\t"){let P=e[g+1];if(P&&P!==" "&&P!==`
|
|
13
|
+
`&&P!=="\t")f=g}if(g>=p)if(f)l.push(f),p=f+c,f=void 0;else if(r==="quoted"){while(d===" "||d==="\t")d=C,C=e[g+=1],m=!0;let P=g>b+1?g-2:h-1;if(u[P])return e;l.push(P),u[P]=!0,p=P+c,f=void 0}else m=!0}d=C}if(m&&a)a();if(l.length===0)return e;if(o)o();let S=e.slice(0,l[0]);for(let C=0;C<l.length;++C){let P=l[C],D=l[C+1]||e.length;if(P===0)S=`
|
|
14
|
+
${t}${e.slice(0,D)}`;else{if(r==="quoted"&&u[P])S+=`${e[P]}\\`;S+=`
|
|
15
|
+
${t}${e.slice(P+1,D)}`}}return S}function bl(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!==`
|
|
16
|
+
`);n=t,i=t+1,s=e[i]}return n}Db.FOLD_BLOCK="block";Db.FOLD_FLOW="flow";Db.FOLD_QUOTED="quoted";Db.foldFlowLines=Pb});var zt=y(function(jb){var ce=q(),Ie=Sl(),cn=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ln=(e)=>/^(%|---|\.\.\.)/m.test(e);function $b(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]===`
|
|
17
|
+
`){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function Kt(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(ln(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 u=r.substr(c+2,4);switch(u){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(u.substr(0,2)==="00")o+="\\x"+u.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)+`
|
|
18
|
+
|
|
19
|
+
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')o+=`
|
|
20
|
+
`,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:Ie.foldFlowLines(o,s,Ie.FOLD_QUOTED,cn(t,!1))}function Ki(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
21
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Kt(e,t);let r=t.indent||(ln(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
22
|
+
${r}`)+"'";return t.implicitKey?n:Ie.foldFlowLines(n,r,Ie.FOLD_FLOW,cn(t,!1))}function dt(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=Kt;else{let i=e.includes('"'),s=e.includes("'");if(i&&!s)n=Ki;else if(s&&!i)n=Kt;else n=r?Ki:Kt}return n(e,t)}var zi;try{zi=new RegExp(`(^|(?<!
|
|
20
23
|
))
|
|
21
24
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
25
|
+
|$)`,"g")}catch{zi=/\n+(?!\n|$)/g}function an({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 dt(r,n);let l=n.indent||(n.forceBlockIndent||ln(r)?" ":""),u=o==="literal"?!0:o==="folded"||t===ce.Scalar.BLOCK_FOLDED?!1:t===ce.Scalar.BLOCK_LITERAL?!0:!$b(r,c,l.length);if(!r)return u?`|
|
|
23
26
|
`:`>
|
|
24
|
-
`;let p,f;for(f=r.length;f>0;--f){let
|
|
25
|
-
`&&
|
|
26
|
-
`);if(m===-1)p="-";else if(r===
|
|
27
|
-
`)
|
|
28
|
-
`)b=h;else break}let S=r.substring(0,b<h?b+1:h);if(S)r=r.substring(S.length),S=S.replace(/\n+/g,`$&${l}`);let
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),
|
|
30
|
-
${l}${
|
|
31
|
-
${l}${S}${r}${
|
|
32
|
-
`)||
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${c}`);if(
|
|
36
|
-
${t.indent}${a}`}
|
|
37
|
-
${a}:`}else if(h=`${h}:`,f)h+=
|
|
38
|
-
`:"",S){let O=l(S);
|
|
39
|
-
${
|
|
40
|
-
`&&
|
|
41
|
-
|
|
42
|
-
`}else
|
|
43
|
-
${r.indent}`}else if(!
|
|
44
|
-
`),
|
|
45
|
-
${r.indent}`}}else if(
|
|
46
|
-
`)
|
|
27
|
+
`;let p,f;for(f=r.length;f>0;--f){let D=r[f-1];if(D!==`
|
|
28
|
+
`&&D!=="\t"&&D!==" ")break}let d=r.substring(f),m=d.indexOf(`
|
|
29
|
+
`);if(m===-1)p="-";else if(r===d||m!==d.length-1){if(p="+",s)s()}else p="";if(d){if(r=r.slice(0,-d.length),d[d.length-1]===`
|
|
30
|
+
`)d=d.slice(0,-1);d=d.replace(zi,`$&${l}`)}let g=!1,h,b=-1;for(h=0;h<r.length;++h){let D=r[h];if(D===" ")g=!0;else if(D===`
|
|
31
|
+
`)b=h;else break}let S=r.substring(0,b<h?b+1:h);if(S)r=r.substring(S.length),S=S.replace(/\n+/g,`$&${l}`);let P=(g?l?"2":"1":"")+p;if(e){if(P+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!u){let D=r.replace(/\n+/g,`
|
|
32
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),A=!1,O=cn(n,!0);if(o!=="folded"&&t!==ce.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{A=!0};let R=Ie.foldFlowLines(`${S}${D}${d}`,l,Ie.FOLD_BLOCK,O);if(!A)return`>${P}
|
|
33
|
+
${l}${R}`}return r=r.replace(/\n+/g,`$&${l}`),`|${P}
|
|
34
|
+
${l}${S}${r}${d}`}function Mb(e,t,r,n){let{type:i,value:s}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&s.includes(`
|
|
35
|
+
`)||u&&/[[\]{},]/.test(s))return dt(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
36
|
+
`)?dt(s,t):an(e,t,r,n);if(!a&&!u&&i!==ce.Scalar.PLAIN&&s.includes(`
|
|
37
|
+
`))return an(e,t,r,n);if(ln(s)){if(c==="")return t.forceBlockIndent=!0,an(e,t,r,n);else if(a&&c===l)return dt(s,t)}let p=s.replace(/\n+/g,`$&
|
|
38
|
+
${c}`);if(o){let f=(g)=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(p),{compat:d,tags:m}=t.doc.schema;if(m.some(f)||d?.some(f))return dt(s,t)}return a?p:Ie.foldFlowLines(p,c,Ie.FOLD_FLOW,cn(t,!1))}function _b(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!==ce.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value))a=ce.Scalar.QUOTE_DOUBLE}let c=(u)=>{switch(u){case ce.Scalar.BLOCK_FOLDED:case ce.Scalar.BLOCK_LITERAL:return i||s?dt(o.value,t):an(o,t,r,n);case ce.Scalar.QUOTE_DOUBLE:return Kt(o.value,t);case ce.Scalar.QUOTE_SINGLE:return Ki(o.value,t);case ce.Scalar.PLAIN:return Mb(o,t,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:p}=t.options,f=i&&u||p;if(l=c(f),l===null)throw Error(`Unsupported default string type ${f}`)}return l}jb.stringifyString=_b});var Gt=y(function(Gb){var qb=rn(),Ee=L(),Bb=Ht(),Ub=zt();function Vb(e,t){let r=Object.assign({blockQuote:!0,commentString:Bb.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 Hb(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(Ee.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 Kb(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(Ee.isScalar(e)||Ee.isCollection(e))&&e.anchor;if(s&&qb.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 zb(e,t,r,n){if(Ee.isPair(e))return e.toString(t,r,n);if(Ee.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=Ee.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>i=c});i??(i=Hb(t.doc.schema.tags,s));let o=Kb(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):Ee.isScalar(s)?Ub.stringifyString(s,t,r,n):s.toString(t,r,n);if(!o)return a;return Ee.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
39
|
+
${t.indent}${a}`}Gb.createStringifyContext=Vb;Gb.stringify=zb});var Rl=y(function(Qb){var we=L(),wl=q(),kl=Gt(),Yt=Ht();function Wb({key:e,value:t},r,n,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:p}}=r,f=we.isNode(e)&&e.comment||null;if(p){if(f)throw Error("With simple keys, key nodes cannot have comments");if(we.isCollection(e)||!we.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let d=!p&&(!e||f&&t==null&&!r.inFlow||we.isCollection(e)||(we.isScalar(e)?e.type===wl.Scalar.BLOCK_FOLDED||e.type===wl.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!d&&(p||!s),indent:a+c});let m=!1,g=!1,h=kl.stringify(e,r,()=>m=!0,()=>g=!0);if(!d&&!r.inFlow&&h.length>1024){if(p)throw Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(r.inFlow){if(s||t==null){if(m&&n)n();return h===""?"?":d?`? ${h}`:h}}else if(s&&!p||t==null&&d){if(h=`? ${h}`,f&&!m)h+=Yt.lineComment(h,r.indent,l(f));else if(g&&i)i();return h}if(m)f=null;if(d){if(f)h+=Yt.lineComment(h,r.indent,l(f));h=`? ${h}
|
|
40
|
+
${a}:`}else if(h=`${h}:`,f)h+=Yt.lineComment(h,r.indent,l(f));let b,S,C;if(we.isNode(t))b=!!t.spaceBefore,S=t.commentBefore,C=t.comment;else if(b=!1,S=null,C=null,t&&typeof t==="object")t=o.createNode(t);if(r.implicitKey=!1,!d&&!f&&we.isScalar(t))r.indentAtStart=h.length+1;if(g=!1,!u&&c.length>=2&&!r.inFlow&&!d&&we.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let P=!1,D=kl.stringify(t,r,()=>P=!0,()=>g=!0),A=" ";if(f||b||S){if(A=b?`
|
|
41
|
+
`:"",S){let O=l(S);A+=`
|
|
42
|
+
${Yt.indentComment(O,r.indent)}`}if(D===""&&!r.inFlow){if(A===`
|
|
43
|
+
`&&C)A=`
|
|
44
|
+
|
|
45
|
+
`}else A+=`
|
|
46
|
+
${r.indent}`}else if(!d&&we.isCollection(t)){let O=D[0],R=D.indexOf(`
|
|
47
|
+
`),_=R!==-1,w=r.inFlow??t.flow??t.items.length===0;if(_||!w){let k=!1;if(_&&(O==="&"||O==="!")){let v=D.indexOf(" ");if(O==="&"&&v!==-1&&v<R&&D[v+1]==="!")v=D.indexOf(" ",v+1);if(v===-1||R<v)k=!0}if(!k)A=`
|
|
48
|
+
${r.indent}`}}else if(D===""||D[0]===`
|
|
49
|
+
`)A="";if(h+=A+D,r.inFlow){if(P&&n)n()}else if(C&&!P)h+=Yt.lineComment(h,r.indent,l(C));else if(g&&i)i();return h}Qb.stringifyPair=Wb});var Gi=y(function(tS){var vl=Qe("process");function Zb(e,...t){if(e==="debug")console.log(...t)}function eS(e,t){if(e==="debug"||e==="warn")if(typeof vl.emitWarning==="function")vl.emitWarning(t);else console.warn(t)}tS.debug=Zb;tS.warn=eS});var fn=y(function(sS){var pn=L(),Cl=q(),un="<<",dn={identify:(e)=>e===un||typeof e==="symbol"&&e.description===un,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Cl.Scalar(Symbol(un)),{addToJSMap:xl}),stringify:()=>un},iS=(e,t)=>(dn.identify(t)||pn.isScalar(t)&&(!t.type||t.type===Cl.Scalar.PLAIN)&&dn.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===dn.tag&&r.default);function xl(e,t,r){let n=Il(e,r);if(pn.isSeq(n))for(let i of n.items)Yi(e,t,i);else if(Array.isArray(n))for(let i of n)Yi(e,t,i);else Yi(e,t,n)}function Yi(e,t,r){let n=Il(e,r);if(!pn.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 Il(e,t){return e&&pn.isAlias(t)?t.resolve(e.doc,e):t}sS.addMergeToJSMap=xl;sS.isMergeKey=iS;sS.merge=dn});var Wi=y(function(fS){var lS=Gi(),El=fn(),uS=Gt(),Al=L(),Ji=xe();function dS(e,t,{key:r,value:n}){if(Al.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(El.isMergeKey(e,r))El.addMergeToJSMap(e,t,n);else{let i=Ji.toJS(r,"",e);if(t instanceof Map)t.set(i,Ji.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let s=pS(r,i,e),o=Ji.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 pS(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(Al.isNode(e)&&r?.doc){let n=uS.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)+'..."';lS.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)}fS.addPairToJSMap=dS});var Ae=y(function(bS){var Pl=Vt(),mS=Rl(),hS=Wi(),gn=L();function yS(e,t,r){let n=Pl.createNode(e,void 0,r),i=Pl.createNode(t,void 0,r);return new mn(n,i)}class mn{constructor(e,t=null){Object.defineProperty(this,gn.NODE_TYPE,{value:gn.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(gn.isNode(t))t=t.clone(e);if(gn.isNode(r))r=r.clone(e);return new mn(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return hS.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?mS.stringifyPair(this,e,t,r):JSON.stringify(this)}}bS.Pair=mn;bS.createPair=yS});var Qi=y(function(CS){var Ve=L(),Dl=Gt(),hn=Ht();function kS(e,t,r){return(t.inFlow??e.flow?vS:RS)(e,t,r)}function RS({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:s,type:null}),p=!1,f=[];for(let m=0;m<t.length;++m){let g=t[m],h=null;if(Ve.isNode(g)){if(!p&&g.spaceBefore)f.push("");if(yn(r,f,g.commentBefore,p),g.comment)h=g.comment}else if(Ve.isPair(g)){let S=Ve.isNode(g.key)?g.key:null;if(S){if(!p&&S.spaceBefore)f.push("");yn(r,f,S.commentBefore,p)}}p=!1;let b=Dl.stringify(g,u,()=>h=null,()=>p=!0);if(h)b+=hn.lineComment(b,s,l(h));if(p&&h)p=!1;f.push(n+b)}let d;if(f.length===0)d=i.start+i.end;else{d=f[0];for(let m=1;m<f.length;++m){let g=f[m];d+=g?`
|
|
47
50
|
${c}${g}`:`
|
|
48
|
-
`}}if(e){if(
|
|
49
|
-
`+
|
|
50
|
-
`)),m<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=p.reduce((S,
|
|
51
|
-
${
|
|
51
|
+
`}}if(e){if(d+=`
|
|
52
|
+
`+hn.indentComment(l(e),c),a)a()}else if(p&&o)o();return d}function vS({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,u=0,p=[];for(let m=0;m<e.length;++m){let g=e[m],h=null;if(Ve.isNode(g)){if(g.spaceBefore)p.push("");if(yn(t,p,g.commentBefore,!1),g.comment)h=g.comment}else if(Ve.isPair(g)){let S=Ve.isNode(g.key)?g.key:null;if(S){if(S.spaceBefore)p.push("");if(yn(t,p,S.commentBefore,!1),S.comment)l=!0}let C=Ve.isNode(g.value)?g.value:null;if(C){if(C.comment)h=C.comment;if(C.commentBefore)l=!0}else if(g.value==null&&S?.comment)h=S.comment}if(h)l=!0;let b=Dl.stringify(g,c,()=>h=null);if(l||(l=p.length>u||b.includes(`
|
|
53
|
+
`)),m<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=p.reduce((S,C)=>S+C.length+2,2)+(b.length+2)>t.options.lineWidth);if(l)b+=","}if(h)b+=hn.lineComment(b,n,a(h));p.push(b),u=p.length}let{start:f,end:d}=r;if(p.length===0)return f+d;else{if(!l){let m=p.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=f;for(let g of p)m+=g?`
|
|
54
|
+
${s}${i}${g}`:`
|
|
52
55
|
`;return`${m}
|
|
53
|
-
${i}${
|
|
54
|
-
`:" ")}return
|
|
55
|
-
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let
|
|
56
|
-
${o.comment}`:n.comment}n=i}e.items[r]=Jr.isPair(n)?n:new _i.Pair(n)}else t("Expected a sequence for this tag");return e}function pl(e,t,r){let{replacer:n}=r,i=new HS.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(o++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(_i.createPair(a,c,r))}return i}var zS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dl,createNode:pl};YS.createPairs=pl;YS.pairs=zS;YS.resolvePairs=dl});var ji=y(function(ZS){var fl=A(),Fi=be(),$t=we(),QS=xe(),gl=Qr();class $e extends QS.YAMLSeq{constructor(){super();this.add=$t.YAMLMap.prototype.add.bind(this),this.delete=$t.YAMLMap.prototype.delete.bind(this),this.get=$t.YAMLMap.prototype.get.bind(this),this.has=$t.YAMLMap.prototype.has.bind(this),this.set=$t.YAMLMap.prototype.set.bind(this),this.tag=$e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,o;if(fl.isPair(n))i=Fi.toJS(n.key,"",t),o=Fi.toJS(n.value,i,t);else i=Fi.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let n=gl.createPairs(e,t,r),i=new this;return i.items=n.items,i}}$e.tag="tag:yaml.org,2002:omap";var XS={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=gl.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(fl.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 $e,r)},createNode:(e,t,r)=>$e.from(e,t,r)};ZS.YAMLOMap=$e;ZS.omap=XS});var Sl=y(function(rR){var ml=L();function hl({value:e,source:t},r){if(t&&(e?yl:bl).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var yl={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 ml.Scalar(!0),stringify:hl},bl={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 ml.Scalar(!1),stringify:hl};rR.falseTag=bl;rR.trueTag=yl});var Rl=y(function(lR){var oR=L(),qi=tt(),sR={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:qi.stringifyNumber},aR={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():qi.stringifyNumber(e)}},cR={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 oR.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:qi.stringifyNumber};lR.float=cR;lR.floatExp=aR;lR.floatNaN=sR});var kl=y(function(yR){var Cl=tt(),Mt=(e)=>typeof e==="bigint"||Number.isInteger(e);function Xr(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,r);return i==="-"?-1*o:o}function Bi(e,t,r){let{value:n}=e;if(Mt(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return Cl.stringifyNumber(e)}var fR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Xr(e,2,2,r),stringify:(e)=>Bi(e,2,"0b")},gR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Xr(e,1,8,r),stringify:(e)=>Bi(e,8,"0")},mR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Xr(e,0,10,r),stringify:Cl.stringifyNumber},hR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Xr(e,2,16,r),stringify:(e)=>Bi(e,16,"0x")};yR.int=mR;yR.intBin=fR;yR.intHex=hR;yR.intOct=gR});var Ui=y(function(wR){var tn=A(),Zr=Ce(),en=we();class Me extends en.YAMLMap{constructor(e){super(e);this.tag=Me.tag}add(e){let t;if(tn.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Zr.Pair(e.key,null);else t=new Zr.Pair(e,null);if(!en.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=en.findPair(this.items,e);return!t&&tn.isPair(r)?tn.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=en.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Zr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,o,o);i.items.push(Zr.createPair(o,null,r))}return i}}Me.tag="tag:yaml.org,2002:set";var kR={collection:"map",identify:(e)=>e instanceof Set,nodeClass:Me,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Me.from(e,t,r),resolve(e,t){if(tn.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new Me,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};wR.YAMLSet=Me;wR.set=kR});var Ki=y(function(AR){var ER=tt();function Vi(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function wl(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return ER.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),o=[t%i];if(t<60)o.unshift(0);else if(t=(t-o[0])/i,o.unshift(t%i),t>=60)t=(t-o[0])/i,o.unshift(t);return n+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var IR={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})=>Vi(e,r),stringify:wl},PR={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)=>Vi(e,!1),stringify:wl},xl={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(xl.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),d=t[8];if(d&&d!=="Z"){let p=Vi(d,!1);if(Math.abs(p)<30)p*=60;l-=60000*p}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};AR.floatTime=PR;AR.intTime=IR;AR.timestamp=xl});var El=y(function(VR){var LR=Ze(),NR=Yr(),$R=et(),MR=Lt(),_R=Mi(),vl=Sl(),Hi=Rl(),rn=kl(),FR=jr(),jR=ji(),qR=Qr(),BR=Ui(),zi=Ki(),UR=[LR.map,$R.seq,MR.string,NR.nullTag,vl.trueTag,vl.falseTag,rn.intBin,rn.intOct,rn.int,rn.intHex,Hi.floatNaN,Hi.floatExp,Hi.float,_R.binary,FR.merge,jR.omap,qR.pairs,BR.set,zi.intTime,zi.floatTime,zi.timestamp];VR.schema=UR});var Ml=y(function(XR){var Dl=Ze(),HR=Yr(),Ol=et(),zR=Lt(),YR=Pi(),Yi=Di(),Gi=Ti(),GR=cl(),WR=ul(),Tl=Mi(),_t=jr(),Ll=ji(),Nl=Qr(),Il=El(),$l=Ui(),nn=Ki(),Pl=new Map([["core",GR.schema],["failsafe",[Dl.map,Ol.seq,zR.string]],["json",WR.schema],["yaml11",Il.schema],["yaml-1.1",Il.schema]]),Al={binary:Tl.binary,bool:YR.boolTag,float:Yi.float,floatExp:Yi.floatExp,floatNaN:Yi.floatNaN,floatTime:nn.floatTime,int:Gi.int,intHex:Gi.intHex,intOct:Gi.intOct,intTime:nn.intTime,map:Dl.map,merge:_t.merge,null:HR.nullTag,omap:Ll.omap,pairs:Nl.pairs,seq:Ol.seq,set:$l.set,timestamp:nn.timestamp},JR={"tag:yaml.org,2002:binary":Tl.binary,"tag:yaml.org,2002:merge":_t.merge,"tag:yaml.org,2002:omap":Ll.omap,"tag:yaml.org,2002:pairs":Nl.pairs,"tag:yaml.org,2002:set":$l.set,"tag:yaml.org,2002:timestamp":nn.timestamp};function QR(e,t,r){let n=Pl.get(t);if(n&&!e)return r&&!n.includes(_t.merge)?n.concat(_t.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(Pl.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat(_t.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?Al[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Al).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!o.includes(a))o.push(a);return o},[])}XR.coreKnownTags=JR;XR.getTags=QR});var Qi=y(function(oC){var Wi=A(),tC=Ze(),rC=et(),nC=Lt(),on=Ml(),iC=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Ji{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?on.getTags(e,"compat"):e?on.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?on.coreKnownTags:{},this.tags=on.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,Wi.MAP,{value:tC.map}),Object.defineProperty(this,Wi.SCALAR,{value:nC.string}),Object.defineProperty(this,Wi.SEQ,{value:rC.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?iC:null}clone(){let e=Object.create(Ji.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}oC.Schema=Ji});var _l=y(function(lC){var aC=A(),Xi=Dt(),Ft=It();function cC(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=Xi.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=o(e.commentBefore);r.unshift(Ft.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(aC.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let d=o(e.contents.commentBefore);r.push(Ft.indentComment(d,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=Xi.stringify(e.contents,i,()=>a=null,c);if(a)l+=Ft.lineComment(l,"",o(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(Xi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);if(c.includes(`
|
|
57
|
-
`))r.push("..."),r.push(
|
|
56
|
+
${i}${d}`}else return`${f}${o}${p.join(" ")}${o}${d}`}}function yn({indent:e,options:{commentString:t}},r,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let s=hn.indentComment(t(n),e);r.push(s.trimStart())}}CS.stringifyCollection=kS});var De=y(function(DS){var IS=Qi(),ES=Wi(),AS=on(),Pe=L(),bn=Ae(),PS=q();function Jt(e,t){let r=Pe.isScalar(t)?t.value:t;for(let n of e)if(Pe.isPair(n)){if(n.key===t||n.key===r)return n;if(Pe.isScalar(n.key)&&n.key.value===r)return n}return}class Ol extends AS.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Pe.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(bn.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(Pe.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new bn.Pair(e,e?.value);else r=new bn.Pair(e.key,e.value);let n=Jt(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);if(Pe.isScalar(n.value)&&PS.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=Jt(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Jt(this.items,e)?.value;return(!t&&Pe.isScalar(n)?n.value:n)??void 0}has(e){return!!Jt(this.items,e)}set(e,t){this.add(new bn.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)ES.addPairToJSMap(t,n,i);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Pe.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 IS.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}DS.YAMLMap=Ol;DS.findPair=Jt});var pt=y(function($S){var NS=L(),Tl=De(),LS={collection:"map",default:!0,nodeClass:Tl.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!NS.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>Tl.YAMLMap.from(e,t,r)};$S.map=LS});var Oe=y(function(US){var _S=Vt(),jS=Qi(),FS=on(),wn=L(),qS=q(),BS=xe();class Nl extends FS.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(wn.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Sn(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=Sn(e);if(typeof r!=="number")return;let n=this.items[r];return!t&&wn.isScalar(n)?n.value:n}has(e){let t=Sn(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=Sn(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];if(wn.isScalar(n)&&qS.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(BS.toJS(i,String(n++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return jS.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(_S.createNode(o,void 0,r))}}return i}}function Sn(e){let t=wn.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}US.YAMLSeq=Nl});var ft=y(function(zS){var HS=L(),Ll=Oe(),KS={collection:"seq",default:!0,nodeClass:Ll.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!HS.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>Ll.YAMLSeq.from(e,t,r)};zS.seq=KS});var Wt=y(function(WS){var YS=zt(),JS={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),YS.stringifyString(e,t,r,n)}};WS.string=JS});var kn=y(function(XS){var $l=q(),Ml={identify:(e)=>e==null,createNode:()=>new $l.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $l.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Ml.test.test(e)?e:t.options.nullStr};XS.nullTag=Ml});var Xi=y(function(tw){var ew=q(),_l={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new ew.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&_l.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};tw.boolTag=_l});var gt=y(function(iw){function nw({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}iw.stringifyNumber=nw});var es=y(function(uw){var ow=q(),Zi=gt(),aw={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:Zi.stringifyNumber},cw={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():Zi.stringifyNumber(e)}},lw={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 ow.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:Zi.stringifyNumber};uw.float=lw;uw.floatExp=cw;uw.floatNaN=aw});var rs=y(function(yw){var jl=gt(),Rn=(e)=>typeof e==="bigint"||Number.isInteger(e),ts=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function Fl(e,t,r){let{value:n}=e;if(Rn(n)&&n>=0)return r+n.toString(t);return jl.stringifyNumber(e)}var gw={identify:(e)=>Rn(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>ts(e,2,8,r),stringify:(e)=>Fl(e,8,"0o")},mw={identify:Rn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>ts(e,0,10,r),stringify:jl.stringifyNumber},hw={identify:(e)=>Rn(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>ts(e,2,16,r),stringify:(e)=>Fl(e,16,"0x")};yw.int=mw;yw.intHex=hw;yw.intOct=gw});var ql=y(function(Ew){var kw=pt(),Rw=kn(),vw=ft(),Cw=Wt(),xw=Xi(),ns=es(),is=rs(),Iw=[kw.map,vw.seq,Cw.string,Rw.nullTag,xw.boolTag,is.intOct,is.int,is.intHex,ns.floatNaN,ns.floatExp,ns.float];Ew.schema=Iw});var Ul=y(function($w){var Pw=q(),Dw=pt(),Ow=ft();function Bl(e){return typeof e==="bigint"||Number.isInteger(e)}var vn=({value:e})=>JSON.stringify(e),Tw=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:vn},{identify:(e)=>e==null,createNode:()=>new Pw.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vn},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:vn},{identify:Bl,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})=>Bl(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:vn}],Nw={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Lw=[Dw.map,Ow.seq].concat(Tw,Nw);$w.schema=Lw});var os=y(function(Fw){var Qt=Qe("buffer"),ss=q(),_w=zt(),jw={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Qt.Buffer==="function")return Qt.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 Qt.Buffer==="function")a=o instanceof Qt.Buffer?o.toString("base64"):Qt.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=ss.Scalar.BLOCK_LITERAL),t!==ss.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=Array(l);for(let p=0,f=0;p<l;++p,f+=c)u[p]=a.substr(f,c);a=u.join(t===ss.Scalar.BLOCK_LITERAL?`
|
|
57
|
+
`:" ")}return _w.stringifyString({comment:e,type:t,value:a},n,i,s)}};Fw.binary=jw});var xn=y(function(Hw){var Cn=L(),as=Ae(),Bw=q(),Uw=Oe();function Vl(e,t){if(Cn.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(Cn.isPair(n))continue;else if(Cn.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new as.Pair(new Bw.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
58
|
+
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
59
|
+
${s.comment}`:n.comment}n=i}e.items[r]=Cn.isPair(n)?n:new as.Pair(n)}else t("Expected a sequence for this tag");return e}function Hl(e,t,r){let{replacer:n}=r,i=new Uw.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(as.createPair(a,c,r))}return i}var Vw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Vl,createNode:Hl};Hw.createPairs=Hl;Hw.pairs=Vw;Hw.resolvePairs=Vl});var ls=y(function(Ww){var Kl=L(),cs=xe(),Xt=De(),Yw=Oe(),zl=xn();class He extends Yw.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=He.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(Kl.isPair(n))i=cs.toJS(n.key,"",t),s=cs.toJS(n.value,i,t);else i=cs.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=zl.createPairs(e,t,r),i=new this;return i.items=n.items,i}}He.tag="tag:yaml.org,2002:omap";var Jw={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:He,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=zl.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(Kl.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 He,r)},createNode:(e,t,r)=>He.from(e,t,r)};Ww.YAMLOMap=He;Ww.omap=Jw});var Ql=y(function(Zw){var Gl=q();function Yl({value:e,source:t},r){if(t&&(e?Jl:Wl).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var Jl={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 Gl.Scalar(!0),stringify:Yl},Wl={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 Gl.Scalar(!1),stringify:Yl};Zw.falseTag=Wl;Zw.trueTag=Jl});var Xl=y(function(ok){var rk=q(),us=gt(),nk={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:us.stringifyNumber},ik={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():us.stringifyNumber(e)}},sk={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 rk.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:us.stringifyNumber};ok.float=sk;ok.floatExp=ik;ok.floatNaN=nk});var eu=y(function(gk){var Zl=gt(),Zt=(e)=>typeof e==="bigint"||Number.isInteger(e);function In(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 ds(e,t,r){let{value:n}=e;if(Zt(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return Zl.stringifyNumber(e)}var uk={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>In(e,2,2,r),stringify:(e)=>ds(e,2,"0b")},dk={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>In(e,1,8,r),stringify:(e)=>ds(e,8,"0")},pk={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>In(e,0,10,r),stringify:Zl.stringifyNumber},fk={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>In(e,2,16,r),stringify:(e)=>ds(e,16,"0x")};gk.int=pk;gk.intBin=uk;gk.intHex=fk;gk.intOct=dk});var ps=y(function(wk){var Pn=L(),En=Ae(),An=De();class Ke extends An.YAMLMap{constructor(e){super(e);this.tag=Ke.tag}add(e){let t;if(Pn.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new En.Pair(e.key,null);else t=new En.Pair(e,null);if(!An.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=An.findPair(this.items,e);return!t&&Pn.isPair(r)?Pn.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=An.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new En.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(En.createPair(s,null,r))}return i}}Ke.tag="tag:yaml.org,2002:set";var Sk={collection:"map",identify:(e)=>e instanceof Set,nodeClass:Ke,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Ke.from(e,t,r),resolve(e,t){if(Pn.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new Ke,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};wk.YAMLSet=Ke;wk.set=Sk});var gs=y(function(Ik){var vk=gt();function fs(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 tu(e){let{value:t}=e,r=(o)=>o;if(typeof t==="bigint")r=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return vk.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 Ck={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})=>fs(e,r),stringify:tu},xk={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)=>fs(e,!1),stringify:tu},ru={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(ru.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),u=t[8];if(u&&u!=="Z"){let p=fs(u,!1);if(Math.abs(p)<30)p*=60;l-=60000*p}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Ik.floatTime=xk;Ik.intTime=Ck;Ik.timestamp=ru});var iu=y(function(qk){var Dk=pt(),Ok=kn(),Tk=ft(),Nk=Wt(),Lk=os(),nu=Ql(),ms=Xl(),Dn=eu(),$k=fn(),Mk=ls(),_k=xn(),jk=ps(),hs=gs(),Fk=[Dk.map,Tk.seq,Nk.string,Ok.nullTag,nu.trueTag,nu.falseTag,Dn.intBin,Dn.intOct,Dn.int,Dn.intHex,ms.floatNaN,ms.floatExp,ms.float,Lk.binary,$k.merge,Mk.omap,_k.pairs,jk.set,hs.intTime,hs.floatTime,hs.timestamp];qk.schema=Fk});var gu=y(function(Jk){var cu=pt(),Uk=kn(),lu=ft(),Vk=Wt(),Hk=Xi(),ys=es(),bs=rs(),Kk=ql(),zk=Ul(),uu=os(),er=fn(),du=ls(),pu=xn(),su=iu(),fu=ps(),On=gs(),ou=new Map([["core",Kk.schema],["failsafe",[cu.map,lu.seq,Vk.string]],["json",zk.schema],["yaml11",su.schema],["yaml-1.1",su.schema]]),au={binary:uu.binary,bool:Hk.boolTag,float:ys.float,floatExp:ys.floatExp,floatNaN:ys.floatNaN,floatTime:On.floatTime,int:bs.int,intHex:bs.intHex,intOct:bs.intOct,intTime:On.intTime,map:cu.map,merge:er.merge,null:Uk.nullTag,omap:du.omap,pairs:pu.pairs,seq:lu.seq,set:fu.set,timestamp:On.timestamp},Gk={"tag:yaml.org,2002:binary":uu.binary,"tag:yaml.org,2002:merge":er.merge,"tag:yaml.org,2002:omap":du.omap,"tag:yaml.org,2002:pairs":pu.pairs,"tag:yaml.org,2002:set":fu.set,"tag:yaml.org,2002:timestamp":On.timestamp};function Yk(e,t,r){let n=ou.get(t);if(n&&!e)return r&&!n.includes(er.merge)?n.concat(er.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(ou.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(er.merge);return i.reduce((s,o)=>{let a=typeof o==="string"?au[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(au).map((u)=>JSON.stringify(u)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!s.includes(a))s.push(a);return s},[])}Jk.coreKnownTags=Gk;Jk.getTags=Yk});var ks=y(function(rR){var Ss=L(),Xk=pt(),Zk=ft(),eR=Wt(),Tn=gu(),tR=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class ws{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:s,toStringDefaults:o}){this.compat=Array.isArray(e)?Tn.getTags(e,"compat"):e?Tn.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Tn.coreKnownTags:{},this.tags=Tn.getTags(t,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Ss.MAP,{value:Xk.map}),Object.defineProperty(this,Ss.SCALAR,{value:eR.string}),Object.defineProperty(this,Ss.SEQ,{value:Zk.seq}),this.sortMapEntries=typeof s==="function"?s:s===!0?tR:null}clone(){let e=Object.create(ws.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}rR.Schema=ws});var mu=y(function(oR){var iR=L(),Rs=Gt(),tr=Ht();function sR(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=Rs.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=s(e.commentBefore);r.unshift(tr.indentComment(c,""))}let o=!1,a=null;if(e.contents){if(iR.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let u=s(e.contents.commentBefore);r.push(tr.indentComment(u,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>o=!0,l=Rs.stringify(e.contents,i,()=>a=null,c);if(a)l+=tr.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(Rs.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);if(c.includes(`
|
|
60
|
+
`))r.push("..."),r.push(tr.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(tr.indentComment(s(c),""))}}return r.join(`
|
|
58
61
|
`)+`
|
|
59
|
-
`}
|
|
60
|
-
`;
|
|
62
|
+
`}oR.stringifyDocument=sR});var rr=y(function(mR){var cR=Ut(),mt=on(),ne=L(),lR=Ae(),uR=xe(),dR=ks(),pR=mu(),vs=rn(),fR=Ui(),gR=Vt(),Cs=Bi();class xs{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ne.NODE_TYPE,{value:ne.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 Cs.Directives({version:s});this.setSchema(s,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(xs.prototype,{[ne.NODE_TYPE]:{value:ne.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=ne.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(ht(this.contents))this.contents.add(e)}addIn(e,t){if(ht(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=vs.anchorNames(this);e.anchor=!t||r.has(t)?vs.findNewAnchor(t||"a",r):t}return new cR.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 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);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:u,setAnchors:p,sourceObjects:f}=vs.createNodeAnchors(this,s||"a"),d={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:f},m=gR.createNode(e,l,d);if(o&&ne.isCollection(m))m.flow=!0;return p(),m}createPair(e,t,r={}){let n=this.createNode(e,null,r),i=this.createNode(t,null,r);return new lR.Pair(n,i)}delete(e){return ht(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(mt.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return ht(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return ne.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(mt.isEmptyPath(e))return!t&&ne.isScalar(this.contents)?this.contents.value:this.contents;return ne.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return ne.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(mt.isEmptyPath(e))return this.contents!==void 0;return ne.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=mt.collectionFromPath(this.schema,[e],t);else if(ht(this.contents))this.contents.set(e,t)}setIn(e,t){if(mt.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=mt.collectionFromPath(this.schema,Array.from(e),t);else if(ht(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 Cs.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 Cs.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 dR.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=uR.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"?fR.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 pR.stringifyDocument(this,e)}}function ht(e){if(ne.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}mR.Document=xs});var nr=y(function(bR){class Nn extends Error{constructor(e,t,r,n){super();this.name=e,this.code=r,this.message=n,this.pos=t}}class hu extends Nn{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class yu extends Nn{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var yR=(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)+`…
|
|
63
|
+
`;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+=`:
|
|
61
64
|
|
|
62
|
-
${
|
|
65
|
+
${o}
|
|
63
66
|
${l}
|
|
64
|
-
`}};
|
|
65
|
-
`))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(
|
|
66
|
-
`+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+O;else
|
|
70
|
-
`+
|
|
71
|
-
`+h.comment;else l.comment=h.comment;l.range=[n.offset,g,h.offset]}else l.range=[n.offset,g,g];return l}
|
|
72
|
-
`.repeat(Math.max(1,
|
|
73
|
-
`;for(let g=
|
|
67
|
+
`}};bR.YAMLError=Nn;bR.YAMLParseError=hu;bR.YAMLWarning=yu;bR.prettifyError=yR});var ir=y(function(CR){function vR(e,{flow:t,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,p="",f="",d=!1,m=!1,g=null,h=null,b=null,S=null,C=null,P=null,D=null;for(let R of e){if(m){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")s(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");m=!1}if(g){if(l&&R.type!=="comment"&&R.type!=="newline")s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");g=null}switch(R.type){case"space":if(!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&R.source.includes("\t"))g=R;u=!0;break;case"comment":{if(!u)s(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let _=R.source.substring(1)||" ";if(!p)p=_;else p+=f+_;f="",l=!1;break}case"newline":if(l){if(p)p+=R.source;else if(!P||r!=="seq-item-ind")c=!0}else f+=R.source;if(l=!0,d=!0,h||b)S=R;u=!0;break;case"anchor":if(h)s(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))s(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);h=R,D??(D=R.offset),l=!1,u=!1,m=!0;break;case"tag":{if(b)s(R,"MULTIPLE_TAGS","A node can have at most one tag");b=R,D??(D=R.offset),l=!1,u=!1,m=!0;break}case r:if(h||b)s(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(P)s(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`);P=R,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(t){if(C)s(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);C=R,l=!1,u=!1;break}default:s(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),l=!1,u=!1}}let A=e[e.length-1],O=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(g&&(l&&g.indent<=o||n?.type==="block-map"||n?.type==="block-seq"))s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:P,spaceBefore:c,comment:p,hasNewline:d,anchor:h,tag:b,newlineAfterProp:S,end:O,start:D??O}}CR.resolveProps=vR});var Ln=y(function(IR){function Is(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
68
|
+
`))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(Is(t.key)||Is(t.value))return!0}return!1;default:return!0}}IR.containsNewline=Is});var Es=y(function(DR){var AR=Ln();function PR(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&AR.containsNewline(t))r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}DR.flowIndentCheck=PR});var As=y(function(NR){var bu=L();function TR(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(s,o)=>s===o||bu.isScalar(s)&&bu.isScalar(o)&&s.value===o.value;return t.some((s)=>i(s.key,r))}NR.mapIncludes=TR});var vu=y(function(FR){var Su=Ae(),$R=De(),wu=ir(),MR=Ln(),ku=Es(),_R=As(),Ru="All mapping items must start at the same column";function jR({composeNode:e,composeEmptyNode:t},r,n,i,s){let a=new(s?.nodeClass??$R.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=n.offset,l=null;for(let u of n.items){let{start:p,key:f,sep:d,value:m}=u,g=wu.resolveProps(p,{indicator:"explicit-key-ind",next:f??d?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!g.found;if(h){if(f){if(f.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 f&&f.indent!==n.indent)i(c,"BAD_INDENT",Ru)}if(!g.anchor&&!g.tag&&!d){if(l=g.end,g.comment)if(a.comment)a.comment+=`
|
|
69
|
+
`+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||MR.containsNewline(f))i(f??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(g.found?.indent!==n.indent)i(c,"BAD_INDENT",Ru);r.atKey=!0;let b=g.end,S=f?e(r,f,g,i):t(r,b,p,null,g,i);if(r.schema.compat)ku.flowIndentCheck(n.indent,f,i);if(r.atKey=!1,_R.mapIncludes(r,a.items,S))i(b,"DUPLICATE_KEY","Map keys must be unique");let C=wu.resolveProps(d??[],{indicator:"map-value-ind",next:m,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=C.end,C.found){if(h){if(m?.type==="block-map"&&!C.hasNewline)i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&g.start<C.found.offset-1024)i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let P=m?e(r,m,C,i):t(r,c,d,null,C,i);if(r.schema.compat)ku.flowIndentCheck(n.indent,m,i);c=P.range[2];let D=new Su.Pair(S,P);if(r.options.keepSourceTokens)D.srcToken=u;a.items.push(D)}else{if(h)i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(S.comment)S.comment+=`
|
|
70
|
+
`+C.comment;else S.comment=C.comment;let P=new Su.Pair(S);if(r.options.keepSourceTokens)P.srcToken=u;a.items.push(P)}}if(l&&l<c)i(l,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,c,l??c],a}FR.resolveBlockMap=jR});var Cu=y(function(KR){var BR=Oe(),UR=ir(),VR=Es();function HR({composeNode:e,composeEmptyNode:t},r,n,i,s){let a=new(s?.nodeClass??BR.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=n.offset,l=null;for(let{start:u,value:p}of n.items){let f=UR.resolveProps(u,{indicator:"seq-item-ind",next:p,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||p)if(p?.type==="block-seq")i(f.end,"BAD_INDENT","All sequence items must start at the same column");else i(c,"MISSING_CHAR","Sequence item without - indicator");else{if(l=f.end,f.comment)a.comment=f.comment;continue}let d=p?e(r,p,f,i):t(r,f.end,u,null,f,i);if(r.schema.compat)VR.flowIndentCheck(n.indent,p,i);c=d.range[2],a.items.push(d)}return a.range=[n.offset,c,l??c],a}KR.resolveBlockSeq=HR});var yt=y(function(YR){function GR(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 u=c.substring(1)||" ";if(!i)i=u;else i+=o+u;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}}YR.resolveEnd=GR});var Eu=y(function(nv){var WR=L(),QR=Ae(),xu=De(),XR=Oe(),ZR=yt(),Iu=ir(),ev=Ln(),tv=As(),Ps="Block collections are not allowed within flow collections",Ds=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function rv({composeNode:e,composeEmptyNode:t},r,n,i,s){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=new(s?.nodeClass??(o?xu.YAMLMap:XR.YAMLSeq))(r.schema);l.flow=!0;let u=r.atRoot;if(u)r.atRoot=!1;if(r.atKey)r.atKey=!1;let p=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let b=n.items[h],{start:S,key:C,sep:P,value:D}=b,A=Iu.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:C??P?.[0],offset:p,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!P&&!D){if(h===0&&A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(h<n.items.length-1)i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(A.comment)if(l.comment)l.comment+=`
|
|
71
|
+
`+A.comment;else l.comment=A.comment;p=A.end;continue}if(!o&&r.options.strict&&ev.containsNewline(C))i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===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 O="";e:for(let R of S)switch(R.type){case"comma":case"space":break;case"comment":O=R.source.substring(1);break e;default:break e}if(O){let R=l.items[l.items.length-1];if(WR.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
|
|
72
|
+
`+O;else R.comment=O;A.comment=A.comment.substring(O.length+1)}}}if(!o&&!P&&!A.found){let O=D?e(r,D,A,i):t(r,A.end,P,null,A,i);if(l.items.push(O),p=O.range[2],Ds(D))i(O.range,"BLOCK_IN_FLOW",Ps)}else{r.atKey=!0;let O=A.end,R=C?e(r,C,A,i):t(r,O,S,null,A,i);if(Ds(C))i(R.range,"BLOCK_IN_FLOW",Ps);r.atKey=!1;let _=Iu.resolveProps(P??[],{flow:a,indicator:"map-value-ind",next:D,offset:R.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(_.found){if(!o&&!A.found&&r.options.strict){if(P)for(let v of P){if(v===_.found)break;if(v.type==="newline"){i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<_.found.offset-1024)i(_.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(D)if("source"in D&&D.source?.[0]===":")i(D,"MISSING_CHAR",`Missing space after : in ${a}`);else i(_.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let w=D?e(r,D,_,i):_.found?t(r,_.end,P,null,_,i):null;if(w){if(Ds(D))i(w.range,"BLOCK_IN_FLOW",Ps)}else if(_.comment)if(R.comment)R.comment+=`
|
|
73
|
+
`+_.comment;else R.comment=_.comment;let k=new QR.Pair(R,w);if(r.options.keepSourceTokens)k.srcToken=b;if(o){let v=l;if(tv.mapIncludes(r,v.items,R))i(O,"DUPLICATE_KEY","Map keys must be unique");v.items.push(k)}else{let v=new xu.YAMLMap(r.schema);v.flow=!0,v.items.push(k);let N=(w??R).range;v.range=[R.range[0],N[1],N[2]],l.items.push(v)}p=w?w.range[2]:_.end}}let f=o?"}":"]",[d,...m]=n.end,g=p;if(d?.source===f)g=d.offset+d.source.length;else{let h=a[0].toUpperCase()+a.substring(1),b=u?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;if(i(p,u?"MISSING_CHAR":"BAD_INDENT",b),d&&d.source.length!==1)m.unshift(d)}if(m.length>0){let h=ZR.resolveEnd(m,g,r.options.strict,i);if(h.comment)if(l.comment)l.comment+=`
|
|
74
|
+
`+h.comment;else l.comment=h.comment;l.range=[n.offset,g,h.offset]}else l.range=[n.offset,g,g];return l}nv.resolveFlowCollection=rv});var Au=y(function(fv){var sv=L(),ov=q(),av=De(),cv=Oe(),lv=vu(),uv=Cu(),dv=Eu();function Os(e,t,r,n,i,s){let o=r.type==="block-map"?lv.resolveBlockMap(e,t,r,n,s):r.type==="block-seq"?uv.resolveBlockSeq(e,t,r,n,s):dv.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 pv(e,t,r,n,i){let s=n.tag,o=!s?null:t.directives.tagName(s.source,(f)=>i(s,"TAG_RESOLVE_FAILED",f));if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:d}=n,m=f&&s?f.offset>s.offset?f:s:f??s;if(m&&(!d||d.offset<m.offset))i(m,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===av.YAMLMap.tagName&&a==="map"||o===cv.YAMLSeq.tagName&&a==="seq")return Os(e,t,r,i,o);let c=t.schema.tags.find((f)=>f.tag===o&&f.collection===a);if(!c){let f=t.schema.knownTags[o];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else{if(f)i(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0);else i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0);return Os(e,t,r,i,o)}}let l=Os(e,t,r,i,o,c),u=c.resolve?.(l,(f)=>i(s,"TAG_RESOLVE_FAILED",f),t.options)??l,p=sv.isNode(u)?u:new ov.Scalar(u);if(p.range=l.range,p.tag=o,c?.format)p.format=c.format;return p}fv.composeCollection=pv});var Ns=y(function(bv){var Ts=q();function mv(e,t,r){let n=t.offset,i=hv(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?Ts.Scalar.BLOCK_FOLDED:Ts.Scalar.BLOCK_LITERAL,o=t.source?yv(t.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let h=o[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&o.length>0?`
|
|
75
|
+
`.repeat(Math.max(1,o.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:g,type:s,comment:i.comment,range:[n,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let g=0;g<a;++g){let[h,b]=o[g];if(b===""||b==="\r"){if(i.indent===0&&h.length>c)c=h.length}else{if(h.length<c)r(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)c=h.length;if(u=g,c===0&&!e.atRoot)r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+b.length+1}for(let g=o.length-1;g>=a;--g)if(o[g][0].length>c)a=g+1;let p="",f="",d=!1;for(let g=0;g<u;++g)p+=o[g][0].slice(c)+`
|
|
76
|
+
`;for(let g=u;g<a;++g){let[h,b]=o[g];l+=h.length+b.length+1;let S=b[b.length-1]==="\r";if(S)b=b.slice(0,-1);if(b&&h.length<c){let P=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-b.length-(S?2:1),"BAD_INDENT",P),h=""}if(s===Ts.Scalar.BLOCK_LITERAL)p+=f+h.slice(c)+b,f=`
|
|
74
77
|
`;else if(h.length>c||b[0]==="\t"){if(f===" ")f=`
|
|
75
|
-
`;else if(!
|
|
78
|
+
`;else if(!d&&f===`
|
|
76
79
|
`)f=`
|
|
77
80
|
|
|
78
81
|
`;p+=f+h.slice(c)+b,f=`
|
|
79
|
-
`,
|
|
82
|
+
`,d=!0}else if(b==="")if(f===`
|
|
80
83
|
`)p+=`
|
|
81
84
|
`;else f=`
|
|
82
|
-
`;else p+=f+b,f=" ",
|
|
83
|
-
`+
|
|
85
|
+
`;else p+=f+b,f=" ",d=!1}switch(i.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)p+=`
|
|
86
|
+
`+o[g][0].slice(c);if(p[p.length-1]!==`
|
|
84
87
|
`)p+=`
|
|
85
88
|
`;break;default:p+=`
|
|
86
|
-
`}let m=n+i.length+t.source.length;return{value:p,type:
|
|
87
|
-
`)o
|
|
88
|
-
`;else o
|
|
89
|
+
`}let m=n+i.length+t.source.length;return{value:p,type:s,comment:i.comment,range:[n,m,m]}}function hv({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 f=1;f<i.length;++f){let d=i[f];if(!a&&(d==="-"||d==="+"))a=d;else{let m=Number(d);if(!o&&m)o=m;else if(c===-1)c=e+f}}if(c!==-1)n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",p=i.length;for(let f=1;f<t.length;++f){let d=t[f];switch(d.type){case"space":l=!0;case"newline":p+=d.source.length;break;case"comment":if(r&&!l)n(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");p+=d.source.length,u=d.source.substring(1);break;case"error":n(d,"UNEXPECTED_TOKEN",d.message),p+=d.source.length;break;default:{let m=`Unexpected token in block scalar header: ${d.type}`;n(d,"UNEXPECTED_TOKEN",m);let g=d.source;if(g&&typeof g==="string")p+=g.length}}}return{mode:s,indent:o,chomp:a,comment:u,length:p}}function yv(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}bv.resolveBlockScalar=mv});var $s=y(function(Av){var Ls=q(),wv=yt();function kv(e,t,r){let{offset:n,type:i,source:s,end:o}=e,a,c,l=(f,d,m)=>r(n+f,d,m);switch(i){case"scalar":a=Ls.Scalar.PLAIN,c=Rv(s,l);break;case"single-quoted-scalar":a=Ls.Scalar.QUOTE_SINGLE,c=vv(s,l);break;case"double-quoted-scalar":a=Ls.Scalar.QUOTE_DOUBLE,c=Cv(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 u=n+s.length,p=wv.resolveEnd(o,u,t,r);return{value:c,type:a,comment:p.comment,range:[n,u,p.offset]}}function Rv(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 Pu(e)}function vv(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return Pu(e.slice(1,-1)).replace(/''/g,"'")}function Pu(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===`
|
|
90
|
+
`)s+=o;else o=`
|
|
91
|
+
`;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 Cv(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
|
|
89
92
|
`)continue;if(i===`
|
|
90
|
-
`){let{fold:
|
|
91
|
-
`){
|
|
92
|
-
`){
|
|
93
|
-
`&&!(
|
|
94
|
-
`))r+=n>
|
|
93
|
+
`){let{fold:s,offset:o}=xv(e,n);r+=s,n=o}else if(i==="\\"){let s=e[++n],o=Iv[s];if(o)r+=o;else if(s===`
|
|
94
|
+
`){s=e[n+1];while(s===" "||s==="\t")s=e[++n+1]}else if(s==="\r"&&e[n+1]===`
|
|
95
|
+
`){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+=Ev(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!==`
|
|
96
|
+
`&&!(o==="\r"&&e[n+2]===`
|
|
97
|
+
`))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 xv(e,t){let r="",n=e[t+1];while(n===" "||n==="\t"||n===`
|
|
95
98
|
`||n==="\r"){if(n==="\r"&&e[t+2]!==`
|
|
96
99
|
`)break;if(n===`
|
|
97
100
|
`)r+=`
|
|
98
|
-
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var
|
|
99
|
-
`,r:"\r",t:"\t",v:"\v",N:"
|
|
101
|
+
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var Iv={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Ev(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}}Av.resolveFlowScalar=kv});var Ou=y(function($v){var ze=L(),Du=q(),Dv=Ns(),Ov=$s();function Tv(e,t,r,n){let{value:i,type:s,comment:o,range:a}=t.type==="block-scalar"?Dv.resolveBlockScalar(e,t,n):Ov.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,(p)=>n(r,"TAG_RESOLVE_FAILED",p)):null,l;if(e.options.stringKeys&&e.atKey)l=e.schema[ze.SCALAR];else if(c)l=Nv(e.schema,i,c,r,n);else if(t.type==="scalar")l=Lv(e,i,t,n);else l=e.schema[ze.SCALAR];let u;try{let p=l.resolve(i,(f)=>n(r??t,"TAG_RESOLVE_FAILED",f),e.options);u=ze.isScalar(p)?p:new Du.Scalar(p)}catch(p){let f=p instanceof Error?p.message:String(p);n(r??t,"TAG_RESOLVE_FAILED",f),u=new Du.Scalar(i)}if(u.range=a,u.source=i,s)u.type=s;if(c)u.tag=c;if(l.format)u.format=l.format;if(o)u.comment=o;return u}function Nv(e,t,r,n,i){if(r==="!")return e[ze.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[ze.SCALAR]}function Lv({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[ze.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(n))??r[ze.SCALAR];if(o.tag!==a.tag){let c=t.tagString(o.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}$v.composeScalar=Tv});var Tu=y(function(jv){function _v(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}jv.emptyScalarPosition=_v});var $u=y(function(Gv){var qv=Ut(),Bv=L(),Uv=Au(),Nu=Ou(),Vv=yt(),Hv=Tu(),Kv={composeNode:Lu,composeEmptyNode:Ms};function Lu(e,t,r,n){let i=e.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=r,l,u=!0;switch(t.type){case"alias":if(l=zv(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=Nu.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=Uv.composeCollection(Kv,e,t,r,n),a)l.anchor=a.source.substring(1)}catch(p){let f=p instanceof Error?p.message:String(p);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{let p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",p),u=!1}}if(l??(l=Ms(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&&(!Bv.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&&u)l.srcToken=t;return l}function Ms(e,t,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:Hv.emptyScalarPosition(t,r,n),indent:-1,source:""},p=Nu.composeScalar(e,u,a,l);if(o){if(p.anchor=o.source.substring(1),p.anchor==="")l(o,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)p.spaceBefore=!0;if(s)p.comment=s,p.range[2]=c;return p}function zv({options:e},{offset:t,source:r,end:n},i){let s=new qv.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=Vv.resolveEnd(n,o,e.strict,i);if(s.range=[t,o,a.offset],a.comment)s.comment=a.comment;return s}Gv.composeEmptyNode=Ms;Gv.composeNode=Lu});var _u=y(function(eC){var Wv=rr(),Mu=$u(),Qv=yt(),Xv=ir();function Zv(e,t,{offset:r,start:n,value:i,end:s},o){let a=Object.assign({_directives:t},e),c=new Wv.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Xv.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});if(u.found){if(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline)o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=i?Mu.composeNode(l,i,u,o):Mu.composeEmptyNode(l,u.end,n,null,u,o);let p=c.contents.range[2],f=Qv.resolveEnd(s,p,!1,o);if(f.comment)c.comment=f.comment;return c.range=[r,p,f.offset],c}eC.composeDoc=Zv});var _s=y(function(aC){var rC=Qe("process"),nC=Bi(),iC=rr(),sr=nr(),ju=L(),sC=_u(),oC=yt();function or(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 Fu(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?`
|
|
100
103
|
|
|
101
104
|
`:`
|
|
102
|
-
`)+(
|
|
103
|
-
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(
|
|
104
|
-
${
|
|
105
|
-
${
|
|
106
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
105
|
+
`)+(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 qu{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,i)=>{let s=or(t);if(i)this.warnings.push(new sr.YAMLWarning(s,r,n));else this.errors.push(new sr.YAMLParseError(s,r,n))},this.directives=new nC.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=Fu(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
106
|
+
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(ju.isCollection(i)&&!i.flow&&i.items.length>0){let s=i.items[0];if(ju.isPair(s))s=s.key;let o=s.commentBefore;s.commentBefore=o?`${r}
|
|
107
|
+
${o}`:r}else{let s=i.commentBefore;i.commentBefore=s?`${r}
|
|
108
|
+
${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:Fu(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(rC.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let i=or(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=sC.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 sr.YAMLParseError(or(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 sr.YAMLParseError(or(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=oC.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}
|
|
109
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new sr.YAMLParseError(or(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 iC.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}}}aC.Composer=qu});var Vu=y(function(hC){var lC=Ns(),uC=$s(),dC=nr(),Bu=zt();function pC(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 dC.YAMLParseError([a,a+1],s,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uC.resolveFlowScalar(e,t,n);case"block-scalar":return lC.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function fC(e,t){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=t,a=Bu.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:`
|
|
107
110
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
108
|
-
`),
|
|
109
|
-
`,f=[{type:"block-scalar-header",offset:
|
|
110
|
-
`});return{type:"block-scalar",offset:
|
|
111
|
+
`),u=a.substring(0,l),p=a.substring(l+1)+`
|
|
112
|
+
`,f=[{type:"block-scalar-header",offset:s,indent:n,source:u}];if(!Uu(f,c))f.push({type:"newline",offset:-1,indent:n,source:`
|
|
113
|
+
`});return{type:"block-scalar",offset:s,indent:n,props:f,source:p}}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 gC(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=Bu.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">":mC(e,c);break;case'"':js(e,c,"double-quoted-scalar");break;case"'":js(e,c,"single-quoted-scalar");break;default:js(e,c,"scalar")}}function mC(e,t){let r=t.indexOf(`
|
|
111
114
|
`),n=t.substring(0,r),i=t.substring(r+1)+`
|
|
112
|
-
`;if(e.type==="block-scalar"){let
|
|
113
|
-
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:
|
|
114
|
-
`};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((
|
|
115
|
+
`;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(!Uu(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:o,source:`
|
|
116
|
+
`});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 Uu(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 js(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:`
|
|
117
|
+
`};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})}}}hC.createScalarToken=fC;hC.resolveAsScalar=pC;hC.setScalarValue=gC});var Hu=y(function(kC){var wC=(e)=>("type"in e)?Mn(e):$n(e);function Mn(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=Mn(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=$n(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=$n(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=$n(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 $n({start:e,key:t,sep:r,value:n}){let i="";for(let s of e)i+=s.source;if(t)i+=Mn(t);if(r)for(let s of r)i+=s.source;if(n)i+=Mn(n);return i}kC.stringify=wC});var Gu=y(function(CC){var Fs=Symbol("break visit"),vC=Symbol("skip children"),Ku=Symbol("remove item");function Ge(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};zu(Object.freeze([]),e,t)}Ge.BREAK=Fs;Ge.SKIP=vC;Ge.REMOVE=Ku;Ge.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};Ge.parentCollection=(e,t)=>{let r=Ge.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 zu(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=zu(Object.freeze(e.concat([[i,o]])),s.items[o],r);if(typeof a==="number")o=a-1;else if(a===Fs)return Fs;else if(a===Ku)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}CC.visit=Ge});var _n=y(function(TC){var qs=Vu(),IC=Hu(),EC=Gu(),Bs="\uFEFF",Us="\x02",Vs="\x18",Hs="\x1F",AC=(e)=>!!e&&("items"in e),PC=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function DC(e){switch(e){case Bs:return"<BOM>";case Us:return"<DOC>";case Vs:return"<FLOW_END>";case Hs:return"<SCALAR>";default:return JSON.stringify(e)}}function OC(e){switch(e){case Bs:return"byte-order-mark";case Us:return"doc-mode";case Vs:return"flow-error-end";case Hs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
118
|
`:case`\r
|
|
116
|
-
`: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}
|
|
117
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
118
|
-
\r `),
|
|
119
|
+
`: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}TC.createScalarToken=qs.createScalarToken;TC.resolveAsScalar=qs.resolveAsScalar;TC.setScalarValue=qs.setScalarValue;TC.stringify=IC.stringify;TC.visit=EC.visit;TC.BOM=Bs;TC.DOCUMENT=Us;TC.FLOW_END=Vs;TC.SCALAR=Hs;TC.isCollection=AC;TC.isScalar=PC;TC.prettyToken=DC;TC.tokenType=OC});var zs=y(function(YC){var ar=_n();function le(e){switch(e){case void 0:case" ":case`
|
|
120
|
+
`:case"\r":case"\t":return!0;default:return!1}}var Yu=new Set("0123456789ABCDEFabcdef"),zC=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),jn=new Set(",[]{}"),GC=new Set(` ,[]{}
|
|
121
|
+
\r `),Ks=(e)=>!e||GC.has(e);class Ju{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===`
|
|
119
122
|
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
120
123
|
`;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===`
|
|
121
124
|
`||!n&&!this.atEnd)return e+r+1}return t===`
|
|
122
|
-
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&
|
|
123
|
-
`,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]===
|
|
125
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&le(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(`
|
|
126
|
+
`,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]===ar.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 ar.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==="...")&&le(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&&!le(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===":")&&le(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(Ks),"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("..."))&&le(n[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield ar.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(Ks),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||le(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(`
|
|
124
127
|
`,this.pos);if(n!==-1){while(n!==-1){let i=this.continueScalar(n+1);if(i===-1)break;n=r.indexOf(`
|
|
125
|
-
`,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)=>
|
|
126
|
-
`:e=i,t=0;break;case"\r":{let
|
|
128
|
+
`,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)=>le(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`
|
|
129
|
+
`:e=i,t=0;break;case"\r":{let s=this.buffer[i+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
127
130
|
`)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(`
|
|
128
131
|
`,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===`
|
|
129
|
-
`)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,
|
|
130
|
-
`&&i>=this.pos&&i+1+t>
|
|
132
|
+
`)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===`
|
|
133
|
+
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield ar.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(le(i)||e&&jn.has(i))break;t=r}else if(le(n)){let i=this.buffer[r+1];if(n==="\r")if(i===`
|
|
131
134
|
`)r+=1,n=`
|
|
132
|
-
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&
|
|
133
|
-
`){let
|
|
135
|
+
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&jn.has(i))break;if(n===`
|
|
136
|
+
`){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(e&&jn.has(n))break;t=r}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield ar.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(Ks),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(le(r)||t&&jn.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(!le(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(zC.has(t))t=this.buffer[++e];else if(t==="%"&&Yu.has(this.buffer[e+1])&&Yu.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===`
|
|
134
137
|
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
135
|
-
`)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)}}
|
|
138
|
+
`)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)}}YC.Lexer=Ju});var Gs=y(function(WC){class Wu{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}}}}WC.LineCounter=Wu});var Ys=y(function(ex){var XC=Qe("process"),Qu=_n(),ZC=zs();function Te(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function Xu(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 ed(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 Fn(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 bt(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 qn(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 Zu(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!Te(t.start,"explicit-key-ind")&&!Te(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,ed(t.value))if(t.value.end)qn(t.value.end,t.sep);else t.value.end=t.sep;else qn(t.start,t.sep);delete t.sep}}}class td{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 ZC.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,XC.env.LOG_TOKENS)console.log("|",Qu.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Qu.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")Zu(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&&Xu(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(Xu(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=Fn(this.peek(2)),r=bt(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(`
|
|
136
139
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
-
`,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)){
|
|
140
|
+
`,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)){qn(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(Te(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let s=bt(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(Te(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(ed(t.key)&&!Te(t.sep,"newline")){let s=bt(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(Te(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&&!Te(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)){qn(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||Te(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=Fn(r),i=bt(n);Zu(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(`
|
|
138
141
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
-
`,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=
|
|
142
|
+
`,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=Fn(e),r=bt(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=Fn(e),r=bt(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()}}}ex.Parser=td});var od=y(function(lx){var rd=_s(),rx=rr(),cr=nr(),nx=Gi(),ix=L(),sx=Gs(),nd=Ys();function id(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new sx.LineCounter||null,prettyErrors:t}}function ox(e,t={}){let{lineCounter:r,prettyErrors:n}=id(t),i=new nd.Parser(r?.addNewLine),s=new rd.Composer(t),o=Array.from(s.compose(i.parse(e)));if(n&&r)for(let a of o)a.errors.forEach(cr.prettifyError(e,r)),a.warnings.forEach(cr.prettifyError(e,r));if(o.length>0)return o;return Object.assign([],{empty:!0},s.streamInfo())}function sd(e,t={}){let{lineCounter:r,prettyErrors:n}=id(t),i=new nd.Parser(r?.addNewLine),s=new rd.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 cr.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&r)o.errors.forEach(cr.prettifyError(e,r)),o.warnings.forEach(cr.prettifyError(e,r));return o}function ax(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=sd(e,r);if(!i)return null;if(i.warnings.forEach((s)=>nx.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 cx(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(ix.isDocument(e)&&!n)return e.toString(r);return new rx.Document(e,n,r).toString(r)}lx.parse=ax;lx.parseAllDocuments=ox;lx.parseDocument=sd;lx.stringify=cx});var gx,mx,hx,Js,yx,Ne,bx,Sx,wx,kx,$T,Rx,vx,Cx,Bn,ad,xx,Ix,Ex,Ax,Px,Dx,Ox,Tx,Nx,Lx,$x,Mx,_x,jx,Fx,qx,Bx,Ux,Vx,Hx,Kx,zx,St,Gx,Yx,Jx,Wx,Qx;var Un=G(()=>{gx=_s(),mx=rr(),hx=ks(),Js=nr(),yx=Ut(),Ne=L(),bx=Ae(),Sx=q(),wx=De(),kx=Oe(),$T=_n(),Rx=zs(),vx=Gs(),Cx=Ys(),Bn=od(),ad=qt();xx=gx.Composer,Ix=mx.Document,Ex=hx.Schema,Ax=Js.YAMLError,Px=Js.YAMLParseError,Dx=Js.YAMLWarning,Ox=yx.Alias,Tx=Ne.isAlias,Nx=Ne.isCollection,Lx=Ne.isDocument,$x=Ne.isMap,Mx=Ne.isNode,_x=Ne.isPair,jx=Ne.isScalar,Fx=Ne.isSeq,qx=bx.Pair,Bx=Sx.Scalar,Ux=wx.YAMLMap,Vx=kx.YAMLSeq,Hx=Rx.Lexer,Kx=vx.LineCounter,zx=Cx.Parser,St=Bn.parse,Gx=Bn.parseAllDocuments,Yx=Bn.parseDocument,Jx=Bn.stringify,Wx=ad.visit,Qx=ad.visitAsync});function Vn(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function Xx(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ye(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 lr(e){let{meta:t}=Ye(e);if(!t)throw Error("design-md file is missing YAML frontmatter");let r=St(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=Vn(r.id)??Vn(r.slug)??Xx(s);if(!o)throw Error("design-md frontmatter must include a non-empty 'id' field");let a={id:o,title:s,category:Vn(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=Vn(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((u)=>typeof u==="string"&&u.trim().length>0);if(l.length>0)a.exemptRules=l.map((u)=>u.trim())}if(Array.isArray(r.extractedTokens))a.extractedTokens=r.extractedTokens;if(typeof r.layer==="string")if(cd.includes(r.layer))a.layer=r.layer;else console.warn(`[design-md] ignoring invalid layer "${r.layer}" on id="${a.id}"; expected one of ${cd.join("|")}`);return a}var cd;var ur=G(()=>{Un();cd=["auto","user","override"]});function Le(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function Hn(e){return Object.fromEntries(Object.entries(Le(e)).flatMap(([t,r])=>typeof r==="string"||typeof r==="number"?[[t,String(r)]]:[]))}function ld(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function rI(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function nI(e){let{meta:t,body:r}=Ye(e),n=[],i=[];for(let[s,o]of[t,...rI(r)].entries()){if(!o.trim())continue;let a;try{a=Le(St(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)=>ud.has(c)))i.push(a)}return{sources:i,issues:n}}function iI(e){let t={};for(let[r,n]of Object.entries(Le(e)))if(typeof n==="string")t[r]={fontFamily:n};else{let i={};for(let[s,o]of Object.entries(Le(n)))if(tI.has(s)&&(typeof o==="string"||typeof o==="number"))i[s]=o;t[r]=i}return t}function Ws(e){let{sources:t}=nI(e),r=Object.assign({},...t);if(!Object.keys(r).some((c)=>ud.has(c)))return;let n={colors:Hn(r.colors),typography:iI(r.typography),rounded:Hn(r.rounded),spacing:Object.fromEntries(Object.entries(Le(r.spacing)).flatMap(([c,l])=>typeof l==="string"||typeof l==="number"?[[c,l]]:[])),components:Object.fromEntries(Object.entries(Le(r.components)).map(([c,l])=>[c,Hn(l)]))},i=Object.fromEntries(Object.entries(Le(r.themes)).map(([c,l])=>[c,Hn(l)]));if(Object.keys(i).length)n.themes=i;let s=Le(r.forbidden),o=ld(s.colors),a=ld(s.fonts);if(o.length||a.length)n.forbidden={colors:o,fonts:a};return n}var Zx,eI,ud,tI;var Qs=G(()=>{Un();ur();Zx=["colors","typography","rounded","spacing","components"],eI=["themes","forbidden"],ud=new Set([...Zx,...eI]),tI=new Set(["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","fontFeature","fontVariation"])});function Xs(e){let t=new Set,r=[];for(let{pattern:n,group:i}of sI){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}var sI;var Zs=G(()=>{sI=[{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"}]});import{readFileSync as oI}from"node:fs";function dr(e){let t=oI(e,"utf-8"),{body:r}=Ye(t),n=lr(t),i=Ws(t),s=n.extractedTokens??(i&&Object.keys(i.colors).length?Object.entries(i.colors).map(([a,c])=>({name:a,value:c,group:"color"})):Xs(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}var pr=G(()=>{ur();Qs();Zs()});var eo=G(()=>{pr()});var to=()=>{};var ro=()=>{};function Kn(e){return`# ${e.trim()||"project"} DESIGN
|
|
140
143
|
|
|
141
144
|
Per-project visual contract. Owned by this consumer. UIBot house seeds
|
|
142
145
|
(\`frontend-principles\`, \`control-console\`) are generation defaults only;
|
|
@@ -162,17 +165,17 @@ are surface. Color is for state, not for the current-nav paint. Sentence case.
|
|
|
162
165
|
| warning | #92400E | #FCD34D | needs attention |
|
|
163
166
|
| danger | #B91C1C | #FCA5A5 | failure |
|
|
164
167
|
|
|
165
|
-
Do not paint selected nav with accent wash. Use a 4
|
|
168
|
+
Do not paint selected nav with accent wash. Use a 4–7% mix of text on surface.
|
|
166
169
|
|
|
167
170
|
## Typographic
|
|
168
171
|
|
|
169
172
|
System sans. Tabular numbers for counts. Ladder: 11 / 12 / 13 / 14 / 16 / 20.
|
|
170
|
-
Page title 20px. Body 14px. Helper
|
|
173
|
+
Page title 20px. Body 14px. Helper ≥ 12px. No marketing display serif.
|
|
171
174
|
|
|
172
175
|
## Component
|
|
173
176
|
|
|
174
177
|
- Nav: grouped labels, selected = surface mix, hover = lighter mix.
|
|
175
|
-
- Usage: quota / tasks / hourly as hairline layers. Unknown stays
|
|
178
|
+
- Usage: quota / tasks / hourly as hairline layers. Unknown stays 未知 / n/a.
|
|
176
179
|
Percent windows may use a 4px meter; omitted layers get no zero chart.
|
|
177
180
|
- Empty / loading / error are three states. Do not nest a dashed empty card
|
|
178
181
|
inside a layer card.
|
|
@@ -181,11 +184,11 @@ Page title 20px. Body 14px. Helper \u2265 12px. No marketing display serif.
|
|
|
181
184
|
## Layout
|
|
182
185
|
|
|
183
186
|
4px grid. Radius 3 / 4 / 6 / 8 / 12. Sider ~224px on shell. Content on canvas.
|
|
184
|
-
375 / 768 / 1440. Touch targets
|
|
187
|
+
375 / 768 / 1440. Touch targets ≥ 44px on 375.
|
|
185
188
|
|
|
186
189
|
## Motion
|
|
187
190
|
|
|
188
|
-
|
|
191
|
+
≤ 150ms on color and transform. Honor prefers-reduced-motion. No card fades.
|
|
189
192
|
|
|
190
193
|
## Anti-Pattern
|
|
191
194
|
|
|
@@ -193,22 +196,23 @@ Page title 20px. Body 14px. Helper \u2265 12px. No marketing display serif.
|
|
|
193
196
|
- No purple-gradient SaaS, ALL-CAPS chrome eyebrows, or emoji as icons.
|
|
194
197
|
- No unscoped \`html, body, *\` CSS. Scope tokens to the product root.
|
|
195
198
|
- No second design system beside this file.
|
|
196
|
-
`}var
|
|
199
|
+
`}var dd=G(()=>{pr()});import{fileURLToPath as aI}from"node:url";import{existsSync as cI,readdirSync as lI}from"node:fs";import{join as uI}from"node:path";function zn(e=pd){if(!cI(e))return[];let t=[];for(let r of lI(e).sort()){if(r.startsWith("_")||!r.endsWith(".design.md"))continue;try{t.push(dr(uI(e,r)))}catch(n){console.warn(`[design-md] skipping seed ${r}: ${n.message}`)}}return t}var pd;var fd=G(()=>{pr();pd=aI(new URL("../content",import.meta.url))});import{mkdirSync as gd,writeFileSync as dI}from"node:fs";import{dirname as pI,join as fI}from"node:path";async function md(e,t=globalThis.fetch){let r=e.trim(),n=gI.exec(r);if(n){let i=n[1],s=n[2],o=(n[3]??"").replace(/^\/+|\/+$/g,""),a=`https://api.github.com/repos/${i}/${s}/contents`+(o?`/${o}`:""),c=await t(a,{headers:{accept:"application/vnd.github+json","user-agent":"uibot-design-md-sync"}});if(!c.ok)throw Error(`Failed to list github:${i}/${s}${o?"/"+o:""} (HTTP ${c.status})`);let l=await c.json(),u=Array.isArray(l)?l:[l],p=[];for(let f of u){if(!f||typeof f!=="object")continue;let d=f;if(d.type==="file"&&d.name&&hd(d.name)&&d.download_url)p.push(d.download_url)}if(p.length===0)throw Error(`No *.design.md / design markdown files found at github:${i}/${s}`+(o?`/${o}`:""));return{kind:"github",label:`github:${i}/${s}${o?"/"+o:""}`,fileUrls:p}}if(/^https?:\/\//i.test(r))return{kind:"url",label:r,fileUrls:[r]};throw Error(`Unsupported --from value "${e}". Use github:owner/repo[/path] or an https:// URL.`)}function hd(e){let t=e.toLowerCase();return t.endsWith(".design.md")||t.endsWith(".md")&&!t.startsWith("readme")}function yd(e,t){let{meta:r,body:n}=Ye(e);if(!r)return`---
|
|
197
200
|
sourceUrl: ${JSON.stringify(t.sourceUrl)}
|
|
198
201
|
license: ${JSON.stringify(t.license)}
|
|
199
202
|
---
|
|
200
|
-
${n}`;let i=r.split(/\r?\n/).filter((
|
|
203
|
+
${n}`;let i=r.split(/\r?\n/).filter((s)=>{let o=s.split(":")[0]?.trim().toLowerCase();return o!=="sourceurl"&&o!=="license"&&o!=="origin"});return i.push(`sourceUrl: ${JSON.stringify(t.sourceUrl)}`),i.push(`license: ${JSON.stringify(t.license)}`),i.push("origin: remote"),`---
|
|
201
204
|
${i.join(`
|
|
202
205
|
`)}
|
|
203
206
|
---
|
|
204
207
|
${n?n+(n.endsWith(`
|
|
205
208
|
`)?"":`
|
|
206
|
-
`):""}`}async function
|
|
207
|
-
`)}function Pe(e){if(/^[\w.-]+$/.test(e))return e;return JSON.stringify(e)}var Bu=K(()=>{Yt()});var Rn=K(()=>{gi();Oo();To();Lo();Wt();Lu();Oo();$u();To();Lo();Do();Po();qu();Bu()});import{lstatSync as Dp,mkdirSync as Rs,readFileSync as Op,realpathSync as Tp,writeFileSync as Cs}from"fs";import{basename as Lp,dirname as zn,isAbsolute as Np,resolve as ue,sep as bs}from"path";function tr(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let s of r)n.set(s.name,s);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let i=[],o=new Set;for(let s of e.lockfile.artifacts??[]){o.add(s.name);let a=n.get(s.name);if(!a){i.push({name:s.name,kind:"missing-in-manifest",lockVersion:s.version,detail:`locked ${s.name}@${s.version} not present in registry manifest`});continue}let c=Ud(a);if(c&&c!==s.version)i.push({name:s.name,kind:"version-mismatch",lockVersion:s.version,manifestVersion:c,detail:`${s.name}: lock ${s.version} \u2260 registry ${c}`})}return{ok:i.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:i}}function Ud(e){return e.artifact?.version??e.version}import{readFileSync as Vd,realpathSync as os}from"fs";import{resolve as Ve,relative as Kd,dirname as Hd,extname as zd,sep as Mn}from"path";function Yd(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function _n(e){let t=e.readFile??((c)=>Vd(c,"utf8")),r=new Map,n=(c,l=Ve(e.sourceDir))=>{let d=Kd(l,Ve(c));if(d===".."||d.startsWith(`..${Mn}`)||d.startsWith(Mn))throw Error(`Block dependency outside sourceDir: ${c}`);return d.replaceAll(Mn,"/")},i=(c)=>{if(n(Ve(e.sourceDir,c)),!e.readFile)n(os(Ve(e.sourceDir,c)),os(e.sourceDir));let l=r.get(c);if(l!==void 0)return l;let d=t(Ve(e.sourceDir,c));return r.set(c,d),d},o=(c)=>{let l=new Map,d=(p)=>{if(l.has(p))return;let f=i(p);l.set(p,{path:p,type:Yd(p),content:f});let u=f.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let m of u){let g=n(Ve(e.sourceDir,Hd(p),m[1]??"")),h=zd(g)?[g]:[`${g}.ts`,`${g}.tsx`,`${g}/index.ts`,`${g}/index.tsx`],b;for(let S of h)try{i(S),b=S;break}catch(k){if(k instanceof Error&&k.message.includes("outside sourceDir"))throw k}if(!b)throw Error(`Unresolved block dependency: ${p} -> ${m[1]}`);d(b)}};return d(c),[...l.values()]},s=(c)=>{let l=new Set;for(let d of c){if(typeof d.content!=="string")continue;for(let p of d.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let f=p[1]??"";if(f.startsWith("node:"))continue;let u=f.startsWith("@")?f.split("/").slice(0,2).join("/"):f.split("/")[0]??"";if(u==="react"||u==="react-dom"||u.startsWith("@uibot/"))continue;l.add(u)}}return[...l].sort()},a=[];for(let c of Object.keys(e.catalog)){let l=e.blockFileMap[c];if(l===void 0)continue;let d=e.catalog[c];if(d===void 0)continue;let p=i(l),f=o(l),u=s(f);a.push({name:c,category:d.category,description:d.description,sourceCode:p,files:f,catalogEntry:d,...u.length>0?{dependencies:u}:{}})}return a}function ss(e){return e.flatMap((t)=>_n(t))}import{readdirSync as Gd,readFileSync as Wd,statSync as Jd}from"fs";import{basename as Qd,join as Xd}from"path";var Zd="0.1.0";function rr(e){let{dir:t}=e,r;try{r=Gd(t)}catch{return[]}let n=e.defaultVersion??Zd,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Xd(t,a);try{if(!Jd(c).isFile())continue}catch{continue}let l=Wd(c,"utf8");if(!l.trim())continue;let d=Qd(a).replace(/\.ya?ml$/i,""),p=ep(d),f=tp(d),u=rp(l)??`${f} template`;s.push({name:p,version:n,title:f,description:u,yaml:l,absolutePath:c,templateContract:{name:p,description:u,level:i,category:o,keywords:[p,d.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:np(l)}})}return s.sort((a,c)=>a.name.localeCompare(c.name))}function ft(e){let t=new Map;for(let r of e)for(let n of rr(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 nr(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function Fn(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:nr(e)}}function ep(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function tp(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function rp(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 np(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 ip="0.1.0";function op(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??ip,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function sp(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:op(e,t)}}function as(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((o)=>sp(o,r)),i=(t.templates??[]).map((o)=>Fn(o));return{name:t.name,items:[...n,...i]}}var lp={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},rP=Array.from(new Set(Object.values(lp).flat()));var ir=["component","template","design-guide","example","skill","block","package","theme"],gt=["experimental","candidate","recommended"],cs=["declared","verified","external-consumer"],or=["missing","declared","verified","external-consumer"],sr=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],Ke=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([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 without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var up=["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"],aP=[...up,"radius","font-display","font-body","font-mono"];var gA=new Set(sr),mA=new Set(or);var dp=/^(unknown|unlicensed|none|n\/?a)$/i;function jn(e){let t=e?.trim();if(!t||dp.test(t))return;return t}var pp="uibot.resource.index.v1";class ze extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function Y(e,t){return e<t?-1:e>t?1:0}function _(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 fp(e){let t=_(e).replace(/ /g,"-");if(!t)throw new ze("invalid-resource-source-id",e);return t}function ce(e,t){return`${e}:${fp(t)}`}function ar(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=_(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>Y(r,n)).map(([,r])=>r)}function mt(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 gp(e){let t=jn(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function He(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:ar(e.tags),aliases:ar(e.aliases),capabilities:ar(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(Y),source:gp(e.source),receipt:e.receipt}}function mp(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function hp(e){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 yp(e){let t=new Map;for(let r of Object.keys(e).sort(Y)){let n=e[r];if(!n)continue;let i=ce("component",r);for(let o of ar([r,n.name])){let s=_(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(Y))}}return t}function bp(e,t,r){let n=r.get(_(e))??[];if(n.length===0)throw new ze("dangling-resource-dependency",`${t} -> ${ce("component",e)}`);if(n.length>1)throw new ze("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function Sp(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return ce("template",i);return bp(e,t,r)}function ht(e,t,r){return jn(r?.[e]??t)}function ls(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>Y(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:[ce("template",t)]}))}function us(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=yp(t),c=[];for(let u of Object.keys(t).sort(Y)){let m=t[u];if(!m)continue;let g=ce("component",u),h=ht(g,void 0,s);c.push(He({id:g,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,...h?{license:h}:{}},receipt:mt(Boolean(h))}))}for(let u of Object.keys(r).sort(Y)){let m=r[u];if(!m)continue;let g=ce("template",u),h=ht(g,void 0,s);c.push(He({id:g,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[u,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((b)=>Sp(b,g,a,r)),source:{type:"template-contract",id:u,...h?{license:h}:{}},receipt:mt(Boolean(h))}))}for(let u of[...n].sort((m,g)=>Y(m.id,g.id))){let m=ce("design-guide",u.id),g=ht(m,void 0,s);c.push(He({id:m,kind:"design-guide",title:u.title,description:mp(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:mt(Boolean(g))}))}for(let u of[...i].sort((m,g)=>Y(m.id,g.id))){let m=ce("example",u.id),g=ht(m,u.license,s);c.push(He({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}:{},...g?{license:g}:{}},receipt:mt(Boolean(g))}))}for(let u of[...o].sort((m,g)=>Y(m.id,g.id))){let m=ce("skill",u.id),g=ht(m,void 0,s);c.push(He({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}:{},...g?{license:g}:{}},receipt:mt(Boolean(g))}))}for(let u of e.additional??[])c.push(He(u));c.sort((u,m)=>Y(u.id,m.id));let l=new Set;for(let u of c){if(l.has(u.id))throw new ze("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 ze("dangling-resource-dependency",`${u.id} -> ${m}`);let d=new Map;for(let u of c)for(let m of u.aliases){let g=_(m);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],[m])=>Y(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(Y))]))),f=Object.freeze(c.map(hp));return Object.freeze({schemaVersion:pp,resources:f,aliases:p})}var Rp=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],Cp=Object.freeze(Rp.map((e)=>Object.freeze([...e]))),ds=new Map;for(let e of Cp){let t=Object.freeze([...new Set(e.map(_).filter(Boolean))].sort());for(let r of t)ds.set(r,t)}function qn(e){let t=_(e);return ds.get(t)??Object.freeze([t])}class H extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var Kn=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),kp=Object.freeze(Object.keys(Kn)),ps=new Map(kp.map((e,t)=>[e,t])),fs=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function G(e,t){return e<t?-1:e>t?1:0}function gs(e){return new Set((e??[]).map(_).filter(Boolean))}function Bn(e,t){let r=gs(t);if(r.size===0)return!0;let n=gs(e);return[...r].some((i)=>n.has(i))}function wp(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!Bn(e.tags,t.tags))return!1;if(!Bn(e.category?[e.category]:[],t.categories))return!1;if(!Bn(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function xp(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function le(e,t,r,n=Kn[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function Un(e,t){return e.find((r)=>_(r)===t)}function Vn(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function vp(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],s=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(o[a-1]??r+1)+1,c);o.push(l),s=Math.min(s,l)}if(s>r)return r+1;n=o}return n[t.length]??r+1}function Ep(e,t){let r=_(t),n=[];if(_(e.id)===r)le(n,"exact-id",e.id);if(_(e.title)===r)le(n,"exact-title",e.title);let i=Un(e.aliases,r);if(i)le(n,"alias",i);let o=Un(e.tags,r);if(o)le(n,"tag",o);let s=Un(e.capabilities,r);if(s)le(n,"capability",s);if(e.category&&_(e.category)===r)le(n,"category",e.category);if(!i){let l=qn(r).filter((p)=>p!==r),d=new Set(Vn(e).map(_));if(l.some((p)=>d.has(p)))le(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=_(Vn(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))le(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let d of Vn(e)){let p=_(d);if(p.length<4)continue;let f=vp(r,p,2);if(f<=2&&(!l||f<l.distance||f===l.distance&&G(d,l.value)<0))l={value:d,distance:f}}if(l)le(n,"fuzzy",l.value,Kn.fuzzy-l.distance)}return n.sort((l,d)=>{if(l.score!==d.score)return d.score-l.score;return(ps.get(l.code)??99)-(ps.get(d.code)??99)||G(l.value,d.value)})}function ms(e,t,r){if(t.has(r))return[r];let n=_(r),i=e.aliases[n];if(i?.length)return[...i];let o=new Set;for(let s of qn(n))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(G)}function hs(e,t){return new H("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function cr(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),o=ms(e,t,i);if(o.length===0)throw new H("resource-not-found",i);if(o.length>1)throw hs(i,o);let s=o[0],a=s?t.get(s):void 0;if(!a)throw new H("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!xp(n))throw new H("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new H("resource-query-invalid-limit",String(n.limit));let o=e.resources.filter((s)=>wp(s,n)).map((s)=>{let a=i?Ep(s,i):[];return{resource:s,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||G(s.resource.id,a.resource.id));return n.limit===void 0?o:o.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((f)=>!f.trim()))throw new H("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let f of n){let u=f.trim(),m=ms(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw hs(u,m);else{let g=m[0];if(g)o.add(g)}}let s=new Set,a=new Set,c=new Set,l=[],d=[],p=(f,u)=>{if(s.has(f))return;if(a.has(f)){i.push({id:f,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(f);if(!m){i.push({id:f,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(f),c.add(f);let g=[...m.dependencies].sort((h,b)=>{let S=t.get(h),k=t.get(b);return(fs.get(S?.kind??"")??99)-(fs.get(k?.kind??"")??99)||G(h,b)});for(let h of g)d.push({from:f,to:h,relation:"depends-on"}),p(h,f);a.delete(f),s.add(f),l.push(f)};for(let f of[...o].sort(G))p(f);return{roots:[...o].sort(G),nodes:[...c].sort(G).map((f)=>{let u=t.get(f);if(!u)throw new H("resource-not-found",f);return{id:f,kind:u.kind,maturity:u.receipt.maturity}}),edges:d.sort((f,u)=>G(f.from,u.from)||G(f.to,u.to)),order:l,gaps:i.sort((f,u)=>G(f.id,u.id)||G(f.requiredBy??"",u.requiredBy??"")||G(f.reason,u.reason))}}})}function lr(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");Ap(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((n)=>typeof n.title!=="string"||typeof n.markdown!=="string"||!/^\/(?:en\/)?docs\/[a-z0-9-]+$/.test(n.path))))throw Error("invalid-public-documentation");let r=new Set;for(let n of t.index.resources){if(!n||typeof n.id!=="string"||r.has(n.id)||!ir.includes(n.kind)||!n.id.startsWith(`${n.kind}:`)||typeof n.description!=="string"||typeof n.title!=="string"||!Array.isArray(n.dependencies)||!n.source||!n.receipt||!Array.isArray(n.aliases)||!Array.isArray(n.tags)||!Array.isArray(n.capabilities)||![n.aliases,n.dependencies,n.tags,n.capabilities].every((o)=>o.every((s)=>typeof s==="string"&&s.length<=1000))||!["catalog","template-contract","design-md","example","skill","registry","package","theme"].includes(n.source.type)||typeof n.source.id!=="string"||!gt.includes(n.receipt.maturity)||!cs.includes(n.receipt.level)||!Array.isArray(n.receipt.evidence)||!n.receipt.evidence.every((o)=>typeof o==="string")||!sr.every((o)=>or.includes(n.receipt.checks?.[o])))throw Error("invalid-public-resource");r.add(n.id);let i=t.showcases[n.id];if(!i||i.resourceId!==n.id||typeof i.docs?.zh!=="string"||typeof i.docs?.en!=="string"||!Array.isArray(i.examples)||!Array.isArray(i.distributions))throw Error("invalid-resource-showcase");if(typeof i.title?.zh!=="string"||typeof i.title?.en!=="string"||i.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((s)=>typeof s==="string"))||i.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[n,i]of Object.entries(t.index.aliases))if(!n||!Array.isArray(i)||i.some((o)=>!r.has(o)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((n)=>!r.has(n)))throw Error("unexpected-public-resource-showcase");for(let n of t.index.resources)for(let i of n.dependencies)if(!r.has(i))throw Error("invalid-public-resource-dependency")}function Hn(e){lr(e),e=JSON.parse(JSON.stringify(e));let t=(i)=>{if(i&&typeof i==="object"){for(let o of Object.values(i))t(o);Object.freeze(i)}};t(e);let r=cr(e.index),n=(i)=>{let o=r.get(i),s=e.showcases[o.id];if(!s)throw new H("resource-not-found",o.id);return s};return Object.freeze({...r,docs(i,o="zh",s=1){if(o!=="zh"&&o!=="en")throw Error("unsupported-resource-locale");let a=n(i);return{resourceId:a.resourceId,locale:o,...Ip(a.docs[o],s),release:e.release}},examples(i,o=1){let s=n(i);return{resourceId:s.resourceId,...Pp(s.examples,o),release:e.release}},installPlan(i){let o=n(i);return{resourceId:o.resourceId,distributions:o.distributions,dependencies:r.build([o.resourceId]),release:e.release}}})}var he=24000;function ys(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new H("resource-query-invalid-limit","page is outside the available range")}function Ip(e,t){let r=Math.max(1,Math.ceil(e.length/he));return ys(t,r),{markdown:e.slice((t-1)*he,t*he),page:t,totalPages:r,...t<r?{nextPage:t+1}:{}}}function Pp(e,t){let r=e.flatMap((n)=>Array.from({length:Math.max(1,Math.ceil(n.code.length/he))},(i,o)=>({...n,code:n.code.slice(o*he,(o+1)*he),codeOffset:o*he,codeLength:n.code.length,complete:n.code.length<=he})));return ys(t,r.length),{examples:r.slice(t-1,t),page:t,totalPages:r.length,...t<r.length?{nextPage:t+1}:{}}}function Ap(e){let t=0,r=0,n=new Set,i=(o,s)=>{if(++t>300000||s>64)throw Error("public-resource-budget-exceeded");if(typeof o==="string"){if(r+=new TextEncoder().encode(o).length,r>16777216)throw Error("public-resource-budget-exceeded")}else if(o&&typeof o==="object"){if(n.has(o))throw Error("invalid-public-resource-cycle");let a=Object.getPrototypeOf(o);if(!Array.isArray(o)&&a!==Object.prototype&&a!==null)throw Error("invalid-public-resource-object");n.add(o);for(let[c,l]of Object.entries(o))i(c,s+1),i(l,s+1);n.delete(o)}else if(o!==null&&typeof o!=="boolean"&&(typeof o!=="number"||!Number.isFinite(o)))throw Error("invalid-public-resource-json")};i(e,1)}function $p(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}async function Mp(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function Yn(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await Mp(r,t);return $p(n)}class Gn{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=Yn(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Wn{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var _p="uibot.artifacts.lock.json";function Fp(e){return ue(e,"components","registry")}function jp(e){return ue(e,"templates","registry")}function qp(e,t){if(e.kind==="component")return ue(t.componentsDir??Fp(t.workspaceRoot));return ue(t.templatesDir??jp(t.workspaceRoot))}function Bp(e){return ue(e.workspaceRoot,e.lockfilePath??_p)}function Up(e){try{return JSON.parse(Op(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Vp(e,t){Rs(zn(e),{recursive:!0}),Cs(e,`${JSON.stringify(t,null,2)}
|
|
208
|
-
`,"utf8")}function
|
|
209
|
-
`),t=xs.map((n)=>` ${n.name.padEnd(22)} ${n.summary}`).join(`
|
|
210
|
-
`),
|
|
211
|
-
`)
|
|
209
|
+
`):""}`}async function io(e){let t=e.fetchImpl??globalThis.fetch,r=e.defaultLicense??"UNKNOWN",n=[],i=0,s=0,o;try{o=await md(e.from,t)}catch(a){return{ok:!1,written:0,skipped:0,files:[],error:a instanceof Error?a.message:String(a)}}if(!e.dryRun)gd(e.outDir,{recursive:!0});for(let a of o.fileUrls){let c;try{let m=await t(a,{headers:{"user-agent":"uibot-design-md-sync"}});if(!m.ok){s+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:`HTTP ${m.status}`});continue}c=await m.text()}catch(m){return{ok:!1,written:i,skipped:s,files:n,error:`Network failure fetching ${a}: ${m instanceof Error?m.message:String(m)}`}}let l=new TextEncoder().encode(c).byteLength;if(l>no){s+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:`exceeds ${no} bytes (${l})`});continue}let u=yd(c,{sourceUrl:a,license:r}),p;try{p=lr(u).id}catch(m){s+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:m instanceof Error?m.message:"invalid frontmatter"});continue}let f=`${p}.design.md`,d=fI(e.outDir,f);if(e.dryRun){n.push({id:p,path:d,sourceUrl:a,status:"dry-run"}),i+=1;continue}gd(pI(d),{recursive:!0}),dI(d,u,"utf8"),i+=1,n.push({id:p,path:d,sourceUrl:a,status:"written"})}return{ok:!0,written:i,skipped:s,files:n}}var no=65536,gI;var bd=G(()=>{ur();gI=/^github:([^/]+)\/([^/@]+)(?:\/(.+))?$/i});function so(e){let t=["---"];if(t.push(`id: ${$e(e.id)}`),t.push(`title: ${$e(e.title)}`),t.push(`category: ${$e(e.category)}`),e.tags?.length)t.push(`tags: [${e.tags.map((r)=>$e(r)).join(", ")}]`);if(e.origin)t.push(`origin: ${$e(e.origin)}`);if(e.sourceUrl)t.push(`sourceUrl: ${$e(e.sourceUrl)}`);if(e.exemptRules?.length)t.push(`exemptRules: [${e.exemptRules.map((r)=>$e(r)).join(", ")}]`);if(e.layer)t.push(`layer: ${$e(e.layer)}`);return t.push("---"),t.push(""),t.push(e.body?.trimEnd()??""),t.push(""),t.join(`
|
|
210
|
+
`)}function $e(e){if(/^[\w.-]+$/.test(e))return e;return JSON.stringify(e)}var Sd=G(()=>{ur()});var Gn=G(()=>{ji();eo();to();ro();pr();dd();eo();fd();to();ro();Zs();Qs();bd();Sd()});import{lstatSync as Mf,mkdirSync as ia,readFileSync as _f,realpathSync as jf,writeFileSync as sa}from"node:fs";import{basename as Ff,dirname as wi,isAbsolute as qf,resolve as be,sep as ra}from"node:path";function Rr(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let o of r)n.set(o.name,o);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let i=[],s=new Set;for(let o of e.lockfile.artifacts??[]){s.add(o.name);let a=n.get(o.name);if(!a){i.push({name:o.name,kind:"missing-in-manifest",lockVersion:o.version,detail:`locked ${o.name}@${o.version} not present in registry manifest`});continue}let c=Bp(a);if(c&&c!==o.version)i.push({name:o.name,kind:"version-mismatch",lockVersion:o.version,manifestVersion:c,detail:`${o.name}: lock ${o.version} ≠ registry ${c}`})}return{ok:i.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:i}}function Bp(e){return e.artifact?.version??e.version}import{readFileSync as Up,realpathSync as _o}from"node:fs";import{resolve as Xe,relative as Vp,dirname as Hp,extname as Kp,sep as li}from"node:path";function zp(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function ui(e){let t=e.readFile??((c)=>Up(c,"utf8")),r=new Map,n=(c,l=Xe(e.sourceDir))=>{let u=Vp(l,Xe(c));if(u===".."||u.startsWith(`..${li}`)||u.startsWith(li))throw Error(`Block dependency outside sourceDir: ${c}`);return u.replaceAll(li,"/")},i=(c)=>{if(n(Xe(e.sourceDir,c)),!e.readFile)n(_o(Xe(e.sourceDir,c)),_o(e.sourceDir));let l=r.get(c);if(l!==void 0)return l;let u=t(Xe(e.sourceDir,c));return r.set(c,u),u},s=(c)=>{let l=new Map,u=(p)=>{if(l.has(p))return;let f=i(p);l.set(p,{path:p,type:zp(p),content:f});let d=f.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let m of d){let g=n(Xe(e.sourceDir,Hp(p),m[1]??"")),h=Kp(g)?[g]:[`${g}.ts`,`${g}.tsx`,`${g}/index.ts`,`${g}/index.tsx`],b;for(let S of h)try{i(S),b=S;break}catch(C){if(C instanceof Error&&C.message.includes("outside sourceDir"))throw C}if(!b)throw Error(`Unresolved block dependency: ${p} -> ${m[1]}`);u(b)}};return u(c),[...l.values()]},o=(c)=>{let l=new Set;for(let u of c){if(typeof u.content!=="string")continue;for(let p of u.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let f=p[1]??"";if(f.startsWith("node:"))continue;let d=f.startsWith("@")?f.split("/").slice(0,2).join("/"):f.split("/")[0]??"";if(d==="react"||d==="react-dom"||d.startsWith("@uibot/"))continue;l.add(d)}}return[...l].sort()},a=[];for(let c of Object.keys(e.catalog)){let l=e.blockFileMap[c];if(l===void 0)continue;let u=e.catalog[c];if(u===void 0)continue;let p=i(l),f=s(l),d=o(f);a.push({name:c,category:u.category,description:u.description,sourceCode:p,files:f,catalogEntry:u,...d.length>0?{dependencies:d}:{}})}return a}function jo(e){return e.flatMap((t)=>ui(t))}import{readdirSync as Gp,readFileSync as Yp,statSync as Jp}from"node:fs";import{basename as Wp,join as Qp}from"node:path";var Xp="0.1.0";function vr(e){let{dir:t}=e,r;try{r=Gp(t)}catch{return[]}let n=e.defaultVersion??Xp,i=e.defaultLevel??"L4",s=e.defaultCategory??"template",o=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Qp(t,a);try{if(!Jp(c).isFile())continue}catch{continue}let l=Yp(c,"utf8");if(!l.trim())continue;let u=Wp(a).replace(/\.ya?ml$/i,""),p=Zp(u),f=ef(u),d=tf(l)??`${f} template`;o.push({name:p,version:n,title:f,description:d,yaml:l,absolutePath:c,templateContract:{name:p,description:d,level:i,category:s,keywords:[p,u.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:rf(l)}})}return o.sort((a,c)=>a.name.localeCompare(c.name))}function At(e){let t=new Map;for(let r of e)for(let n of vr(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 Cr(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function di(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:Cr(e)}}function Zp(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function ef(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function tf(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 rf(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 nf="0.1.0";function sf(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??nf,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function of(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:sf(e,t)}}function Fo(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((s)=>of(s,r)),i=(t.templates??[]).map((s)=>di(s));return{name:t.name,items:[...n,...i]}}var lf={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},fP=Array.from(new Set(Object.values(lf).flat()));var xr=["component","template","design-guide","example","skill","block","package","theme"],Pt=["experimental","candidate","recommended"],qo=["declared","verified","external-consumer"],Ir=["missing","declared","verified","external-consumer"],Er=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],Ze=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 uf=["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"],bP=[...uf,"radius","font-display","font-body","font-mono"];var df=/^[A-Za-z0-9_-]{1,100}$/;function pi(e){if(typeof e!=="string"||!df.test(e))throw Error("Invalid application identity")}function Uo(e){return pi(e),{projectId:`app-${e}`,artifactId:`app-${e}`}}function Dt(e){for(let t of[e.projectId,e.artifactId])if(!/^[A-Za-z0-9_-]{1,128}$/.test(t))throw Error("Invalid application identity");return`/apps/${e.projectId}/${e.artifactId}`}function Bo(e){return typeof e==="string"&&e.length<=256&&/^\/(?:[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*)?$/.test(e)}function et(e,t,r=!1){if(typeof e!=="string"||e.length>t||!r&&!e.trim())throw Error("Invalid application document");return e}function ke(e){if(!e||typeof e!=="object"||Array.isArray(e))throw Error("Invalid application document");let t=e;if(Object.keys(t).some((s)=>!["contract","title","entryPath","spec","css","designMd","tsx"].includes(s)))throw Error("Unknown application field");if(t.contract!=="uibot.app.v1"||!Bo(t.entryPath)||!Array.isArray(t.tsx)||t.tsx.length>32)throw Error("Invalid application manifest");let r=new Set,n=new Set,i={contract:"uibot.app.v1",title:et(t.title,200),entryPath:t.entryPath,spec:et(t.spec,2000000),css:et(t.css,128000,!0),designMd:et(t.designMd,128000,!0),tsx:t.tsx.map((s)=>{if(!s||Object.keys(s).some((o)=>!["id","path","title","source"].includes(o)))throw Error("Unknown TSX module field");if(pi(s.id),s.id==="spec"||!Bo(s.path)||r.has(s.id)||n.has(s.path))throw Error("Duplicate or invalid TSX route");return r.add(s.id),n.add(s.path),{id:s.id,path:s.path,title:et(s.title,200),source:et(s.source,1e5)}})};if(JSON.stringify(i).length>2000000)throw Error("Application document exceeds budget");return i}function Re(e){return JSON.stringify(ke(e))}function Vo(e){if(!e||typeof e!=="object")throw Error("Invalid application snapshot");let t=e;if(Dt(t),t.contract!=="uibot.linked-app.v1"||!/^[A-Za-z0-9_-]{1,128}$/.test(t.revisionId)||!Number.isSafeInteger(t.revisionNumber)||t.revisionNumber<1||typeof t.sourceHash!=="string"||!/^[a-f0-9]{64}$/.test(t.sourceHash))throw Error("Invalid application revision");return{contract:"uibot.linked-app.v1",projectId:t.projectId,artifactId:t.artifactId,revisionId:t.revisionId,revisionNumber:t.revisionNumber,sourceHash:t.sourceHash,document:ke(t.document)}}var z0=new Set(Er),G0=new Set(Ir);var pf=/^(unknown|unlicensed|none|n\/?a)$/i;function fi(e){let t=e?.trim();if(!t||pf.test(t))return;return t}var ff="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 Q(e,t){return e<t?-1:e>t?1:0}function B(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function gf(e){let t=B(e).replace(/ /g,"-");if(!t)throw new rt("invalid-resource-source-id",e);return t}function ye(e,t){return`${e}:${gf(t)}`}function Ar(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=B(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>Q(r,n)).map(([,r])=>r)}function Ot(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 mf(e){let t=fi(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:Ar(e.tags),aliases:Ar(e.aliases),capabilities:Ar(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(Q),source:mf(e.source),receipt:e.receipt,...e.solution?{solution:structuredClone(e.solution)}:{}}}function hf(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function yf(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 bf(e){let t=new Map;for(let r of Object.keys(e).sort(Q)){let n=e[r];if(!n)continue;let i=ye("component",r);for(let s of Ar([r,n.name])){let o=B(s),a=t.get(o)??[];if(!a.includes(i))a.push(i);t.set(o,a.sort(Q))}}return t}function Sf(e,t,r){let n=r.get(B(e))??[];if(n.length===0)throw new rt("dangling-resource-dependency",`${t} -> ${ye("component",e)}`);if(n.length>1)throw new rt("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function wf(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return ye("template",i);return Sf(e,t,r)}function Tt(e,t,r){return fi(r?.[e]??t)}function Ho(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>Q(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:[ye("template",t)]}))}function Ko(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],s=e.skills??[],o=e.licenses,a=bf(t),c=[];for(let d of Object.keys(t).sort(Q)){let m=t[d];if(!m)continue;let g=ye("component",d),h=Tt(g,void 0,o);c.push(tt({id:g,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[d,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:d,...h?{license:h}:{}},receipt:Ot(Boolean(h))}))}for(let d of Object.keys(r).sort(Q)){let m=r[d];if(!m)continue;let g=ye("template",d),h=Tt(g,void 0,o);c.push(tt({id:g,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[d,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((b)=>wf(b,g,a,r)),source:{type:"template-contract",id:d,...h?{license:h}:{}},receipt:Ot(Boolean(h))}))}for(let d of[...n].sort((m,g)=>Q(m.id,g.id))){let m=ye("design-guide",d.id),g=Tt(m,void 0,o);c.push(tt({id:m,kind:"design-guide",title:d.title,description:hf(d),category:d.category,tags:d.tags,aliases:[d.id,d.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:d.id,...d.sourceUrl?{url:d.sourceUrl}:{},...g?{license:g}:{}},receipt:Ot(Boolean(g))}))}for(let d of[...i].sort((m,g)=>Q(m.id,g.id))){let m=ye("example",d.id),g=Tt(m,d.license,o);c.push(tt({id:m,kind:"example",title:d.title,description:d.description,...d.category?{category:d.category}:{},tags:d.tags??[],aliases:[d.id,d.title,...d.aliases??[]],capabilities:d.capabilities??[],dependencies:d.dependencies??[],source:{type:"example",id:d.id,...d.version?{version:d.version}:{},...d.sourceUrl?{url:d.sourceUrl}:{},...g?{license:g}:{}},receipt:Ot(Boolean(g))}))}for(let d of[...s].sort((m,g)=>Q(m.id,g.id))){let m=ye("skill",d.id),g=Tt(m,void 0,o);c.push(tt({id:m,kind:"skill",title:d.title,description:d.description?.trim()||d.title,tags:[...d.tags??[],...d.triggers??[]],aliases:[d.id,d.title,...d.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:d.id,...d.version?{version:d.version}:{},...g?{license:g}:{}},receipt:Ot(Boolean(g))}))}for(let d of e.additional??[])c.push(tt(d));c.sort((d,m)=>Q(d.id,m.id));let l=new Set;for(let d of c){if(l.has(d.id))throw new rt("duplicate-resource-id",d.id);l.add(d.id)}for(let d of c)for(let m of d.dependencies)if(!l.has(m))throw new rt("dangling-resource-dependency",`${d.id} -> ${m}`);let u=new Map;for(let d of c)for(let m of d.aliases){let g=B(m);if(!g)continue;let h=u.get(g)??new Set;h.add(d.id),u.set(g,h)}let p=Object.freeze(Object.fromEntries([...u.entries()].sort(([d],[m])=>Q(d,m)).map(([d,m])=>[d,Object.freeze([...m].sort(Q))]))),f=Object.freeze(c.map(yf));return Object.freeze({schemaVersion:ff,resources:f,aliases:p})}var kf=[["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","导航","侧边栏"]],Rf=Object.freeze(kf.map((e)=>Object.freeze([...e]))),zo=new Map;for(let e of Rf){let t=Object.freeze([...new Set(e.map(B).filter(Boolean))].sort());for(let r of t)zo.set(r,t)}function gi(e){let t=B(e);return zo.get(t)??Object.freeze([t])}class Y extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var yi=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}),vf=Object.freeze(Object.keys(yi)),Go=new Map(vf.map((e,t)=>[e,t])),Yo=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function X(e,t){return e<t?-1:e>t?1:0}function Jo(e){return new Set((e??[]).map(B).filter(Boolean))}function Fe(e,t){let r=Jo(t);if(r.size===0)return!0;let n=Jo(e);return[...r].some((i)=>n.has(i))}function Cf(e,t){if(!Fe(e.solution?.functions??[],t.functions))return!1;if(!Fe(e.solution?.scenarios??[],t.scenarios))return!1;if(!Fe(e.solution?[e.solution.unit]:[],t.units))return!1;if(!Fe(e.solution?.industries??[],t.industries))return!1;if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!Fe(e.tags,t.tags))return!1;if(!Fe(e.category?[e.category]:[],t.categories))return!1;if(!Fe(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function xf(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 ue(e,t,r,n=yi[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function mi(e,t){return e.find((r)=>B(r)===t)}function hi(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 If(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 Wo(e,t){let r=B(t),n=[];if(B(e.id)===r)ue(n,"exact-id",e.id);if(B(e.title)===r)ue(n,"exact-title",e.title);let i=mi(e.aliases,r);if(i)ue(n,"alias",i);let s=mi(e.tags,r);if(s)ue(n,"tag",s);let o=mi(e.capabilities,r);if(o)ue(n,"capability",o);if(e.category&&B(e.category)===r)ue(n,"category",e.category);if(!i){let l=gi(r).filter((p)=>p!==r),u=new Set(hi(e).map(B));if(l.some((p)=>u.has(p)))ue(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=B(hi(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))ue(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let u of hi(e)){let p=B(u);if(p.length<4)continue;let f=If(r,p,2);if(f<=2&&(!l||f<l.distance||f===l.distance&&X(u,l.value)<0))l={value:u,distance:f}}if(l)ue(n,"fuzzy",l.value,yi.fuzzy-l.distance)}return n.sort((l,u)=>{if(l.score!==u.score)return u.score-l.score;return(Go.get(l.code)??99)-(Go.get(u.code)??99)||X(l.value,u.value)})}function Qo(e,t,r){if(t.has(r))return[r];let n=B(r),i=e.aliases[n];if(i?.length)return[...i];let s=new Set;for(let o of gi(n))for(let a of e.aliases[o]??[])s.add(a);return[...s].sort(X)}function Xo(e,t){return new Y("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function Pr(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),s=Qo(e,t,i);if(s.length===0)throw new Y("resource-not-found",i);if(s.length>1)throw Xo(i,s);let o=s[0],a=o?t.get(o):void 0;if(!a)throw new Y("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!xf(n))throw new Y("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new Y("resource-query-invalid-limit",String(n.limit));let s=e.resources.filter((o)=>Cf(o,n)).filter((o)=>!i||Wo(o,i).length>0).map((o)=>{let a=i?Wo(o,i):[];for(let[c,l]of[[n.functions,"function"],[n.scenarios,"scenario"],[n.units,"unit"],[n.industries,"industry"]])if(c?.length)ue(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||X(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((f)=>!f.trim()))throw new Y("resource-query-empty","at least one build root is required");let i=[],s=new Set;for(let f of n){let d=f.trim(),m=Qo(e,t,d);if(m.length===0)i.push({id:d,reason:"missing-resource"});else if(m.length>1)throw Xo(d,m);else{let g=m[0];if(g)s.add(g)}}let o=new Set,a=new Set,c=new Set,l=[],u=[],p=(f,d)=>{if(o.has(f))return;if(a.has(f)){i.push({id:f,...d?{requiredBy:d}:{},reason:"dependency-cycle"});return}let m=t.get(f);if(!m){i.push({id:f,...d?{requiredBy:d}:{},reason:"missing-resource"});return}a.add(f),c.add(f);let g=[...m.dependencies].sort((h,b)=>{let S=t.get(h),C=t.get(b);return(Yo.get(S?.kind??"")??99)-(Yo.get(C?.kind??"")??99)||X(h,b)});for(let h of g)u.push({from:f,to:h,relation:"depends-on"}),p(h,f);a.delete(f),o.add(f),l.push(f)};for(let f of[...s].sort(X))p(f);return{roots:[...s].sort(X),nodes:[...c].sort(X).map((f)=>{let d=t.get(f);if(!d)throw new Y("resource-not-found",f);return{id:f,kind:d.kind,maturity:d.receipt.maturity}}),edges:u.sort((f,d)=>X(f.from,d.from)||X(f.to,d.to)),order:l,gaps:i.sort((f,d)=>X(f.id,d.id)||X(f.requiredBy??"",d.requiredBy??"")||X(f.reason,d.reason))}}})}function Nt(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");Df(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)||!xr.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/"))||!Pt.includes(i.receipt.maturity)||!qo.includes(i.receipt.level)||!Array.isArray(i.receipt.evidence)||!i.receipt.evidence.every((o)=>typeof o==="string")||!Er.every((o)=>Ir.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 Dr(e){Nt(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=Pr(e.index),n=(i)=>{let s=r.get(i),o=e.showcases[s.id];if(!o)throw new Y("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,...Af(a.docs[s],o),release:e.release}},examples(i,s=1){let o=n(i);return{resourceId:o.resourceId,...Pf(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)=>Ef(o,e.distributionSnapshot,s.resourceId))}}})}function Ef(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 ve=24000;function Zo(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new Y("resource-query-invalid-limit","page is outside the available range")}function Af(e,t){let r=Math.max(1,Math.ceil(e.length/ve));return Zo(t,r),{markdown:e.slice((t-1)*ve,t*ve),page:t,totalPages:r,...t<r?{nextPage:t+1}:{}}}function Pf(e,t){let r=e.flatMap((n)=>Array.from({length:Math.max(1,Math.ceil(n.code.length/ve))},(i,s)=>({...n,code:n.code.slice(s*ve,(s+1)*ve),codeOffset:s*ve,codeLength:n.code.length,complete:n.code.length<=ve})));return Zo(t,r.length),{examples:r.slice(t-1,t),page:t,totalPages:r.length,...t<r.length?{nextPage:t+1}:{}}}function Df(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)}import{createHash as Of}from"node:crypto";var Lr=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Or=/^[a-f0-9]{64}$/,Tr=/^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/,ta=new TextEncoder,Tf=new TextDecoder("utf-8",{fatal:!0});function nt(e){return Of("sha256").update(e).digest("hex")}function de(e){let t=0,r=(i,s)=>{if(++t>400000||s>32)throw Error("snapshot-json-budget-exceeded");if(Array.isArray(i))return i.map((o)=>r(o,s+1));if(i&&typeof i==="object"){if(Object.getPrototypeOf(i)!==Object.prototype)throw Error("snapshot-invalid-json");return Object.fromEntries(Object.keys(i).sort().map((o)=>[o,r(i[o],s+1)]))}if(i===null||typeof i==="string"||typeof i==="boolean"||typeof i==="number"&&Number.isFinite(i))return i;throw Error("snapshot-invalid-json")},n=JSON.stringify(r(e,0));if(ta.encode(n).length>16777216)throw Error("snapshot-json-budget-exceeded");return n}function Nr(e){if(typeof e!=="string"||!/^[a-zA-Z0-9_./-]+$/.test(e)||e.split("/").some((t)=>!t||t==="."||t==="..")||e.startsWith("/"))throw Error(`snapshot-unsafe-path: ${e}`)}function ea(e,t){return Nr(e),{path:e,bytes:t.byteLength,sha256:nt(t)}}function Nf(e){if(typeof e!=="string"||!e.startsWith("@uibot/")||!Lr.test(e.slice(7)))throw Error(`snapshot-external-registry-dependency: ${e}`);return e.slice(7)}function Lf(e,t){if(!Lr.test(e)||t.byteLength>16777216)throw Error("snapshot-invalid-item");let r=JSON.parse(Tf.decode(t));if(r.name!==e||!Array.isArray(r.files)||r.files.length>2000||(r.devDependencies?.length??0)>0)throw Error(`snapshot-invalid-item: ${e}`);let n={};for(let a of r.dependencies??[]){let c=a.lastIndexOf("@"),l=a.slice(0,c),u=a.slice(c+1);if(c<1||!/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/.test(l)||!Tr.test(u)||n[l]&&n[l]!==u)throw Error(`snapshot-unpinned-npm-dependency: ${a}`);n[l]=u}let i=[...new Set((r.registryDependencies??[]).map(Nf))].sort(),s=new Set,o=r.files.map((a)=>{if(typeof a.content!=="string")throw Error(`snapshot-missing-file-content: ${e}`);let c=a.target??a.path;if(Nr(c),s.has(c))throw Error(`snapshot-duplicate-target: ${c}`);return s.add(c),{...ea(a.path,ta.encode(a.content)),target:c}});return{...ea(`r/${e}.json`,t),registryDependencies:i,npmDependencies:n,files:o}}function $f(e,t){let r=new Set,n=new Set,i=(a)=>{if(!Lr.test(a)||!Object.hasOwn(e,a))throw Error(`snapshot-missing-item: ${a}`);if(n.has(a))throw Error(`snapshot-dependency-cycle: ${a}`);if(r.has(a))return;n.add(a);for(let c of e[a].registryDependencies)i(c);n.delete(a),r.add(a)};if(!t.length)throw Error("snapshot-empty-entrypoints");t.forEach(i);let s=new Map,o=new Map;for(let a of r){for(let c of e[a].files){let l=s.get(c.target);if(l&&l!==c.sha256)throw Error(`snapshot-target-conflict: ${c.target}`);s.set(c.target,c.sha256)}for(let[c,l]of Object.entries(e[a].npmDependencies)){if(o.has(c)&&o.get(c)!==l)throw Error(`snapshot-npm-conflict: ${c}`);o.set(c,l)}}return[...r].sort()}function bi(e,t){if(!e||typeof e!=="object")throw Error("snapshot-invalid-manifest");de(e);let r=e,{snapshotId:n,...i}=r;if(r.schemaVersion!=="uibot.distribution.snapshot.v1"||r.namespace!=="@uibot"||r.license!=="MIT AND ISC"||!Tr.test(r.version)||!Or.test(r.bundleHash)||!Or.test(n)||t!==void 0&&t!==n||nt(de(i))!==n)throw Error("snapshot-identity-mismatch");if(!r.items||!r.resources||!Array.isArray(r.licenseFiles)||!r.licenseFiles.length)throw Error("snapshot-invalid-manifest");let s=(a)=>{if(Nr(a.path),!Or.test(a.sha256)||!Number.isSafeInteger(a.bytes)||a.bytes<0||a.bytes>16777216)throw Error("snapshot-invalid-file-digest")},o=new Set;for(let a of r.licenseFiles){if(s(a),!a.path.startsWith("licenses/")||o.has(a.path))throw Error("snapshot-invalid-license");o.add(a.path)}for(let[a,c]of Object.entries(r.items)){if(s(c),!Lr.test(a)||c.path!==`r/${a}.json`||!Array.isArray(c.registryDependencies)||!Array.isArray(c.files)||!c.npmDependencies)throw Error("snapshot-invalid-item");for(let l of c.files)s(l),Nr(l.target);for(let[l,u]of Object.entries(c.npmDependencies))if(!/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/.test(l)||!Tr.test(u))throw Error("snapshot-unpinned-npm-dependency")}for(let a of Object.values(r.resources))if(!Tr.test(a.version)||!Or.test(a.resourceHash)||!Array.isArray(a.entrypoints)||de($f(r.items,a.entrypoints))!==de(a.closure))throw Error("snapshot-resource-closure-mismatch")}function Si(e,t,r,n){bi(e,n);let i=Object.hasOwn(e.resources,t)?e.resources[t]:void 0;if(!i)throw Error(`snapshot-resource-unavailable: ${t}`);let s=(a)=>{let c=r.get(a.path);if(!c||c.byteLength!==a.bytes||nt(c)!==a.sha256)throw Error(`snapshot-file-mismatch: ${a.path}`);return c},o={};for(let a of i.closure){let c=e.items[a],l=Lf(a,s(c));if(de(l)!==de(c))throw Error(`snapshot-item-metadata-mismatch: ${a}`);Object.assign(o,c.npmDependencies)}return e.licenseFiles.forEach(s),{snapshotId:e.snapshotId,resourceId:t,closure:[...i.closure],npmDependencies:o}}function Bf(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}async function Uf(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function ki(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await Uf(r,t);return Bf(n)}class Ri{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=ki(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class vi{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var Vf="uibot.artifacts.lock.json";function Hf(e){return be(e,"components","registry")}function Kf(e){return be(e,"templates","registry")}function zf(e,t){if(e.kind==="component")return be(t.componentsDir??Hf(t.workspaceRoot));return be(t.templatesDir??Kf(t.workspaceRoot))}function Gf(e){return be(e.workspaceRoot,e.lockfilePath??Vf)}function Yf(e){try{return JSON.parse(_f(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Jf(e,t){ia(wi(e),{recursive:!0}),sa(e,`${JSON.stringify(t,null,2)}
|
|
211
|
+
`,"utf8")}function Wf(e,t){return{version:1,artifacts:[...e.artifacts.filter((n)=>n.name!==t.name),t].sort((n,i)=>n.name.localeCompare(i.name))}}function Qf(e){if(e.kind==="component")return{components:{[e.name]:e.catalogEntry}};return{templates:{[e.name]:e.templateContract}}}class qe extends Error{artifactName;offendingPath;baseDir;constructor(e,t,r){super(`Artifact "${e}" file path escapes workspace: "${t}" resolves outside "${r}"`);this.artifactName=e;this.offendingPath=t;this.baseDir=r;this.name="ArtifactContainmentError"}}function oa(e,t){let r=t.endsWith(ra)?t:t+ra;return e===t||e.startsWith(r)}function na(e){let t=be(e),r=[];while(!0)try{return Mf(t),be(jf(t),...r)}catch(n){if(n.code!=="ENOENT")throw n;let i=wi(t);if(i===t)throw n;r.unshift(Ff(t)),t=i}}function aa(e,t,r,n){try{let i=na(t),s=na(e);if(!oa(s,i))throw new qe(r,n,t)}catch(i){if(i instanceof qe)throw i;throw new qe(r,n,t)}}function J(e,t,r){if(e.includes("\x00"))throw new qe(r,e,t);if(qf(e))throw new qe(r,e,t);let n=be(t,e);if(!oa(n,t))throw new qe(r,e,t);return aa(n,t,r,e),n}function Xf(e,t){let r=[];for(let n of e.files){let i=n.target??n.path;r.push(J(i,t,e.name))}return r}function $r(e,t){let r=be(t.workspaceRoot),n=zf(e,t);aa(n,r,e.name,n);let i=J(e.name,n,e.name),s=Xf(e,i),o=[];for(let p=0;p<e.files.length;p++){let f=e.files[p],d=s[p];ia(wi(d),{recursive:!0}),sa(d,f.content??"","utf8"),o.push(d)}let a={name:e.name,version:e.version,source:t.source??"registry",installedAt:new Date().toISOString()},c=Gf(t),l=Yf(c),u=Wf(l,a);return Jf(c,u),{artifactLock:a,catalogPatch:Qf(e),writtenFiles:o}}import{createHash as RI,randomUUID as lo}from"node:crypto";import{existsSync as Me,mkdirSync as uo,readFileSync as xd,renameSync as vI,unlinkSync as gr,writeFileSync as po}from"node:fs";import{dirname as Id,resolve as Ed}from"node:path";function it(e){let t={_:[]};for(let r=0;r<e.length;r+=1){let n=e[r];if(!n.startsWith("--")){t._.push(n);continue}let i=n.slice(2),s=i.indexOf("=");if(s>=0){t[i.slice(0,s)]=i.slice(s+1);continue}let o=e[r+1];if(o!==void 0&&!o.startsWith("--"))t[i]=o,r+=1;else t[i]=!0}return t}function E(e,t){let r=e[t];return typeof r==="string"?r:void 0}import{createHash as wd}from"node:crypto";import{existsSync as oo,readFileSync as kd}from"node:fs";import{resolve as ie}from"node:path";import{pathToFileURL as Rd}from"node:url";function vd(e){for(let t of e)if(oo(t))return t;return null}function ao(e){if(e)return/^[a-z]+:/i.test(e)?new URL(e):Rd(ie(e));let t=[ie(__uibotDir,"resources/bundle.json"),ie(__uibotDir,"../../../public/resources/bundle.json")].find(oo);if(!t)throw Error("snapshot-bundle-unavailable");return Rd(t)}function fr(e=process.cwd()){return vd([ie(e,"examples/templates"),ie(__uibotDir,"templates"),ie(__uibotDir,"../../../examples/templates")])}function co(e=process.cwd()){return vd([ie(e,"examples/shells"),ie(__uibotDir,"shells"),ie(__uibotDir,"../../../examples/shells")])}function kI(e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){if(t[n])throw Error(`duplicate built-in catalog source id: ${n}`);t[n]=i}return t}async function Cd(e){if(e){let u=ao(e);if(u.protocol==="file:"){let O=kd(u);if(O.length>16777216)throw Error("public-resource-source-too-large");let R=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(O));Nt(R);let{release:_,schemaVersion:w,distributionSnapshot:k,...v}=R;if(wd("sha256").update(JSON.stringify(v)).digest("hex")!==R.release.sourceHash)throw Error("public-resource-source-hash-mismatch");return Dr(R)}if(u.protocol!=="https:"&&!(u.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(u.hostname)))throw Error("public-resource-source-must-use-https");let p=await fetch(u,{signal:AbortSignal.timeout(1e4),redirect:"error"});if(!p.ok)throw Error(`public-resource-source-http-${p.status}`);let f=p.body?.getReader();if(!f)throw Error("public-resource-source-empty");let d=[],m=0;try{for(;;){let{value:O,done:R}=await f.read();if(R)break;if(m+=O.byteLength,m>16777216)throw Error("public-resource-source-too-large");d.push(O)}}finally{await f.cancel()}let g=new Uint8Array(m),h=0;for(let O of d)g.set(O,h),h+=O.byteLength;let b=new TextDecoder("utf-8",{fatal:!0}).decode(g),S=JSON.parse(b);Nt(S);let{release:C,schemaVersion:P,distributionSnapshot:D,...A}=S;if(wd("sha256").update(JSON.stringify(A)).digest("hex")!==S.release.sourceHash)throw Error("public-resource-source-hash-mismatch");return Dr(S)}let t=[ie(__uibotDir,"resources/bundle.json"),ie(__uibotDir,"../../../public/resources/bundle.json")].find(oo);if(t){let u=JSON.parse(kd(t,"utf8"));return Nt(u),Dr(u)}let[r,n,i]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-studio"),Promise.resolve().then(() => (Gn(),{}))]),s=[],o=fr();if(o)s.push({dir:o});let a=co();if(a)s.push({dir:a,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let c=At(s),l=Object.fromEntries(c.map((u)=>[u.name,u.templateContract]));return Pr(Ko({components:kI([r.CATALOG_ENTRIES,n.STUDIO_CATALOG_ENTRIES]),templates:l,designGuides:zn(ie(__uibotDir,"../../design-md/content")),examples:Ho(l)}))}var wt=(e)=>RI("sha256").update(e).digest("hex");function kt(e){let t=new URL(e);if(t.username||t.password||t.search||t.hash||t.pathname!=="/"||t.protocol!=="https:"&&!(t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname)))throw Error("Application backend must be HTTPS or loopback, with no path or credentials");return t.origin}async function CI(e,t={}){let[r,...n]=e,i=it(n),s=Ed(E(i,"cwd")??t.cwd??process.cwd()),o=t.env??process.env,a=t.log??console.log,c=E(i,"mode")==="json",l=(w)=>a(JSON.stringify({contract:"uibot.cli.app.v1",ok:!0,result:w},null,c?void 0:2)),u=(w)=>J(w,s,"application workspace"),p=u("uibot.app.json"),f=u(".uibot/app-pending.json"),d=u(".uibot/app-link.json"),m=(w)=>JSON.parse(xd(w,"utf8")),g=()=>ke(m(p));function h(w,k,v=!1){let N=w.slice(s.length+1);u(N),uo(Id(w),{recursive:!0}),u(N);let Z=`${JSON.stringify(k,null,2)}
|
|
212
|
+
`;if(v)return po(w,Z,{flag:"wx",mode:384});let he=u(`${N}.${lo()}.tmp`);po(he,Z,{flag:"wx",mode:384});try{u(N),vI(he,w)}finally{if(Me(he))gr(he)}}function b(){let w=m(d);if(w.contract!=="uibot.app-link.v1"||!/^[a-f0-9]{64}$/.test(w.sourceHash)||typeof w.revisionId!=="string"||!Number.isSafeInteger(w.revisionNumber)||w.revisionNumber<1)throw Error("Invalid application link");return Dt(w),kt(w.url),{contract:w.contract,url:kt(w.url),projectId:w.projectId,artifactId:w.artifactId,revisionId:w.revisionId,revisionNumber:w.revisionNumber,sourceHash:w.sourceHash}}async function S(w,k={}){let v=o.UIBOT_CONTROL_PLANE_AUTH_BEARER??o.UIBOT_STUDIO_AUTH_BEARER,N=new Headers(k.headers);if(N.set("accept","application/json"),v)N.set("authorization",`Bearer ${v}`);if(k.body)N.set("content-type","application/json");return(t.fetcher??fetch)(w,{...k,headers:N,redirect:"error",signal:AbortSignal.timeout(15000),cache:"no-store"})}let C=(w)=>`${kt(w.url)}/api/studio/creation${Dt(w)}`;async function P(w){if(!w.ok)throw Error(`Application HTTP ${w.status}`);let k=w.body?.getReader();if(!k)throw Error("Invalid application response");let v=[],N=0;try{while(!0){let{done:kr,value:Lo}=await k.read();if(kr)break;if(N+=Lo.length,N>8000000)throw await k.cancel(),Error("Oversized application response");v.push(Lo)}}finally{k.releaseLock()}let Z=new Uint8Array(N),he=0;for(let kr of v)Z.set(kr,he),he+=kr.length;let wr;try{wr=Vo(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(Z)))}catch{throw Error("Invalid application response")}if(wt(Re(wr.document))!==wr.sourceHash)throw Error("Application content hash mismatch");return wr}function D(w,k){if(w.projectId!==k.projectId||w.artifactId!==k.artifactId)throw Error("Application identity mismatch")}function A(w,k){D(w,k),h(d,{contract:w.contract,url:w.url,projectId:w.projectId,artifactId:w.artifactId,revisionId:k.revisionId,revisionNumber:k.revisionNumber,sourceHash:k.sourceHash})}async function O(w){h(f,w,!0);let k;try{k=await S(w.create?`${w.link.url}/api/studio/creation/apps`:`${C(w.link)}/revisions`,{method:"POST",body:JSON.stringify(w.body)})}catch{throw Error("Write outcome unknown. Keep the original operation; run uibot app reconcile. Do not resend.")}if(!k.ok){if([400,401,403,404,409,413,422].includes(k.status))gr(f);throw Error(`Application HTTP ${k.status}; local edits retained`)}let v=await P(k);if(wt(Re(ke(w.body.document)))!==v.sourceHash)throw Error("Save confirmation does not match original input");A(w.link,v),gr(f),l(v)}async function R(){let w=b();if(Me(f))throw Error("An application write is unresolved; reconcile it first");let k=Re(g());if(wt(k)!==w.sourceHash)throw Error("Local application has unsaved changes; pull refused");let v=await S(`${C(w)}/live`,{headers:{"if-none-match":`"uibot-linked-${w.revisionId}"`}});if(v.status===304){l({unchanged:!0,revisionId:w.revisionId});return}let N=await P(v);if(Re(g())!==k)throw Error("Local edits changed during pull; preserved");if(N.projectId!==w.projectId||N.artifactId!==w.artifactId)throw Error("Application identity mismatch");if(N.revisionNumber<w.revisionNumber||N.revisionNumber===w.revisionNumber&&N.revisionId!==w.revisionId)throw Error("Stale application revision");if(N.revisionId===w.revisionId&&(N.sourceHash!==w.sourceHash||N.revisionNumber!==w.revisionNumber))throw Error("Immutable revision changed");h(p,N.document),A(w,N),l(N)}let _;try{if(!r||r==="help")return l({commands:["init","create","list","link","status","pull","push","watch","reconcile","open","export"]}),0;if(r==="list"){let k=kt(E(i,"url")??b().url),v=await S(`${k}/api/studio/creation/apps`);if(!v.ok)throw Error(`Application HTTP ${v.status}`);return l(await v.json()),0}if(r==="status"){let k=b();return l({...k,dirty:wt(Re(g()))!==k.sourceHash,pendingOperationId:Me(f)?m(f).operationId:null}),0}if(r==="open"){let k=b(),v=new URL(E(i,"editor-url")??"http://localhost:3203/apps");if(v.username||v.password||!["https:","http:"].includes(v.protocol))throw Error("Invalid editor URL");return v.searchParams.set("project",k.projectId),v.searchParams.set("app",k.artifactId),l({editorUrl:v.href}),0}uo(s,{recursive:!0});let w=u(".uibot/app-cli.lock");if(uo(Id(w),{recursive:!0}),u(".uibot/app-cli.lock"),po(w,JSON.stringify({pid:process.pid}),{flag:"wx",mode:384}),_=w,r==="init"){let k=E(i,"template")??"shadcn-admin";if(!/^[A-Za-z0-9_-]+$/.test(k))throw Error("Invalid template name");let v=fr();if(!v)throw Error("Built-in templates unavailable");let N=xd(Ed(v,`${k}.yaml`),"utf8"),Z={contract:"uibot.app.v1",title:E(i,"title")??"UIBot Admin",entryPath:"/",spec:N,css:"",designMd:"",tsx:[]};return h(p,ke(Z),!0),l({file:p,template:k}),0}if(r==="export"){let k=u(E(i,"out")??"uibot.app.export.json");return h(k,g(),!0),l({file:k}),0}if(r==="reconcile"){let k=m(f);if(k.contract!=="uibot.app-pending.v1"||typeof k.operationId!=="string")throw Error("Invalid pending operation");let v=await P(await S(`${C(k.link)}/operations/${encodeURIComponent(k.operationId)}`)),N=ke(k.body.document);if(v.sourceHash!==wt(Re(N)))throw Error("Operation receipt does not match original input");return A(k.link,v),gr(f),l({reconciled:!0,...v}),0}if(Me(f))throw Error("Unresolved application write; run uibot app reconcile");if(r==="create"){if(Me(d))throw Error("This workspace is already linked");let k=g(),v=lo(),N=Uo(v),Z=E(i,"project-id")??N.projectId,he={contract:"uibot.app-link.v1",url:kt(E(i,"url")??"http://localhost:3202"),...N,projectId:Z};return await O({contract:"uibot.app-pending.v1",link:he,operationId:v,create:!0,body:{operationId:v,document:k,...E(i,"project-id")?{projectId:Z}:{}}}),0}if(r==="link"){if(Me(d))throw Error("This workspace is already linked");let k={contract:"uibot.app-link.v1",url:kt(E(i,"url")??"http://localhost:3202"),projectId:E(i,"project-id")??"",artifactId:E(i,"app-id")??""},v=await P(await S(C(k)));if(D(k,v),Me(p)&&wt(Re(g()))!==v.sourceHash)throw Error("Local application differs; link refused without overwriting");if(!Me(p))h(p,v.document,!0);return A(k,v),l(v),0}if(r==="push"){let k=b(),v=lo();return await O({contract:"uibot.app-pending.v1",link:k,operationId:v,create:!1,body:{operationId:v,expectedRevisionId:k.revisionId,document:g()}}),0}if(r==="pull")return await R(),0;if(r==="watch"){let k=Number(E(i,"interval")??"1000");if(!Number.isSafeInteger(k)||k<250||k>60000)throw Error("Invalid polling interval");let v=new AbortController,N=()=>v.abort();process.once("SIGINT",N),process.once("SIGTERM",N);try{while(!v.signal.aborted&&!t.signal?.aborted)await R(),await new Promise((Z)=>setTimeout(Z,k))}finally{process.removeListener("SIGINT",N),process.removeListener("SIGTERM",N)}return 0}throw Error(`Unknown application command: ${r}`)}catch(w){let k=w instanceof Error?w.message:"Application command failed";return(t.error??console.error)(JSON.stringify({contract:"uibot.cli.app.v1",ok:!1,error:k})),1}finally{if(_)gr(_)}}async function Ad(e,t={}){try{return await CI(e,t)}catch(r){return(t.error??console.error)(JSON.stringify({contract:"uibot.cli.app.v1",ok:!1,error:r instanceof Error?r.message:"Application command failed"})),1}}var xI={string:"value","positive-integer":"n","resource-kind":"kind","resource-maturity":"maturity"};function II(e){let t=e.positionals.map((n)=>{let i=`${n.name}${"variadic"in n&&n.variadic?"...":""}`;return n.required?`<${i}>`:`[${i}]`}),r=e.options.map((n)=>`[--${n.name} <${xI[n.type]}${"cliEncoding"in n&&n.cliEncoding==="comma-separated"?",...":""}>]`);return[e.name,...t,...r,"[--mode <text|json>]","[--dense]"].join(" ")}var EI=Ze.map((e)=>({name:e.name,usage:`${II(e)}${e.name==="install-plan"?" [--snapshot <sha256>] [--export <directory> | --verify <directory>]":""}`,summary:e.summary,group:"resources"})),AI=[...EI,{name:"snapshot-serve",usage:"snapshot-serve <directory> [--port <n>]",summary:"Verify and serve a saved registry closure on loopback without upstream fallback.",group:"artifacts"},{name:"app",usage:"app <init|create|list|link|status|pull|push|watch|reconcile|open|export> [--cwd <dir>] [--url <backend>] [--project-id <id>] [--app-id <id>] [--mode json]",summary:"Create, edit and follow one versioned application with protected local drafts.",group:"project"},{name:"list",usage:"list [--registry <url>]",summary:"List installable artifact registry entries.",group:"artifacts"},{name:"add",usage:"add <name> [--registry <url>] [--cwd <dir>]",summary:"Install an artifact and its registry dependencies.",group:"artifacts"},{name:"publish",usage:"publish [--out <dir>] [--name <manifest-name>]",summary:"Publish the built-in artifact registry to a directory.",group:"artifacts"},{name:"design-md sync",usage:"design-md sync --from <github:owner/repo|https-url> [--cwd <dir>] [--mode json]",summary:"Pull remote design-md with source and license stamps.",group:"design"},{name:"regressions reverify",usage:"regressions reverify [--cwd <dir>] [--skill <id>] [--mode json]",summary:"Re-run resolved regressions and reactivate failures.",group:"skills"},{name:"skills promote",usage:"skills promote <id> [--cwd <dir>] [--mode json]",summary:"Mark a skill promoted and append its usage receipt.",group:"skills"},{name:"skills rollback",usage:"skills rollback <id> [--cwd <dir>] [--mode json]",summary:"Roll back a promoted skill marker with a usage receipt.",group:"skills"},{name:"project export",usage:"project export <dir> [--cwd <dir>] [--mode json]",summary:"Copy project-local .uibot state to a directory.",group:"project"},{name:"link",usage:"link --spec-dir <relative-dir> [--source-dir <dir>] [--cwd <dir>] [--force] [--mode json]",summary:"Register consumer Spec dir + digest pin (L2 Linked).",group:"linked"},{name:"sync push",usage:"sync push [--from <dir>] [--cwd <dir>] [--mode json]",summary:"Copy YAML Spec + lock digest from sourceDir into consumer.",group:"linked"},{name:"sync pull",usage:"sync pull [--to <dir>] [--cwd <dir>] [--mode json]",summary:"Copy YAML Spec from consumer back to sourceDir.",group:"linked"},{name:"doctor",usage:"doctor [--cwd <dir>] [--registry <url>] [--mode json]",summary:"Compare the artifact lockfile with its registry.",group:"diagnostics"},{name:"init",usage:"init <dir> [--template <name>] | init --into <existing-app> [--force] [--mode json]",summary:"Scaffold a project, or L1 Embed recipe into an existing app.",group:"project"}],Pd=Object.freeze(AI.map((e)=>Object.freeze(e))),PI=["--mode <text|json> Structured output mode for resource commands.","--dense Compact resource payloads without changing ids/order/codes.","--source <url> Query an explicit versioned public resource bundle (HTTPS or loopback).","--registry <url> Artifact registry base URL.","--cwd <dir> Workspace root (default: cwd).","--out <dir> Output directory for publish.","--from <src> Remote source for design-md sync, or local Spec source for sync push.","--to <dir> Local Spec destination for sync pull.","--spec-dir <dir> Relative consumer Spec directory for link.","--source-dir <dir> Local studio/CP Spec directory recorded by link.","--control-plane-url <url> Hosted CP base URL for remote Spec sync (no secrets).","--project-id <id> Remote Spec project id (default: default).","--force Overwrite existing .uibot/link.json or init --into files.","--into <dir> Existing app root for L1 Embed scaffold (requires package.json).","--spec-path <rel> Relative Spec YAML path for init --into (default: src/pages/home.uibot.yaml).","--mount-path <rel> Relative mount snippet path for init --into.","--template <name> Template name for greenfield init."];function fo(){let e=Pd.map((n)=>` uibot ${n.usage}`).join(`
|
|
213
|
+
`),t=Pd.map((n)=>` ${n.name.padEnd(22)} ${n.summary}`).join(`
|
|
214
|
+
`),r=PI.map((n)=>` ${n}`).join(`
|
|
215
|
+
`);return`uibot — UIBot resource and artifact CLI
|
|
212
216
|
|
|
213
217
|
Usage:
|
|
214
218
|
${e}
|
|
@@ -218,30 +222,30 @@ ${t}
|
|
|
218
222
|
|
|
219
223
|
Flags:
|
|
220
224
|
${r}
|
|
221
|
-
`}var
|
|
222
|
-
`,"utf8"),n.push(i);for(let
|
|
223
|
-
`,"utf8"),n.push(
|
|
224
|
-
`,"utf-8")}list(e){let t=
|
|
225
|
-
`).filter(Boolean).map((r)=>{try{return JSON.parse(r)}catch{return null}}).filter((r)=>r!==null)}catch{return[]}}active(e){return this.list(e).filter((t)=>t.status==="active")}markResolved(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),
|
|
225
|
+
`}var Yn="http://127.0.0.1:3202/api/registry";async function Dd(e,t){if(!e)throw Error("uibot add: missing artifact name");let r=t.registry??Yn,n=t.log??((l)=>console.log(l)),i=t.sources??[new Ri({registryUrl:r,priority:0})],s=new vi(i),o=[],a=new Set,c=[e];while(c.length>0){let l=c.shift();if(a.has(l))continue;a.add(l);let u=await s.resolve(l);if(!u)throw Error(`Artifact '${l}' not found in ${r}`);let p=$r(u.artifact,{workspaceRoot:t.workspaceRoot,source:r});o.push({name:u.artifact.name,version:u.artifact.version,files:p.writtenFiles.length});let f=u.artifact.kind==="template"?"template":"component";n(`Installed ${f} ${u.artifact.name}@${u.artifact.version} → ${p.writtenFiles.length} files`);let d=u.artifact.kind==="component"?u.artifact.registryDependencies:void 0;for(let m of d??[])if(!a.has(m))c.push(m)}return{installed:o}}async function Od(e={}){let t=e.registry??Yn,r=e.fetchManifest??((s)=>ki(s)),n=e.log??((s)=>console.log(s)),i=await r(t);for(let s of i.items)n(`${s.name} ${s.kind} ${s.title??""}`);return i}import{mkdirSync as DI,writeFileSync as Td}from"node:fs";import{resolve as go}from"node:path";function OI(e,t){let r=go(e,"artifacts");DI(r,{recursive:!0});let n=[],i=go(e,"registry.json");Td(i,`${JSON.stringify(t,null,2)}
|
|
226
|
+
`,"utf8"),n.push(i);for(let s of t.items){let o=go(r,`${s.name}.json`);Td(o,`${JSON.stringify(s,null,2)}
|
|
227
|
+
`,"utf8"),n.push(o)}return n}async function Nd(e){let t=e.log??((s)=>console.log(s)),r=e.sources;if(!r){if(!e.blockFileMap||!e.catalog||!e.sourceDir)throw Error("uibot publish: provide either `sources` or `blockFileMap` + `catalog` + `sourceDir`");r=ui({sourceDir:e.sourceDir,blockFileMap:e.blockFileMap,catalog:e.catalog,...e.readFile?{readFile:e.readFile}:{}})}let n=Fo(r,{name:e.manifestName??"local",...e.templates?.length?{templates:e.templates}:{}}),i=[];if(e.writeArtifacts)e.writeArtifacts(e.out,n);else i.push(...OI(e.out,n));return t(`Published ${n.items.length} artifacts → ${e.out}`),{manifest:n,writtenFiles:i}}Gn();import{join as TI}from"node:path";async function Ld(e){let t=e.cwd??process.cwd(),r=TI(t,".uibot","design-md"),n=await io({from:e.from,outDir:r,...e.license?{defaultLicense:e.license}:{},...e.dryRun?{dryRun:!0}:{}});if(e.mode==="json")console.log(JSON.stringify(n,null,2));else if(!n.ok)console.error(`uibot design-md sync: ${n.error??"failed"}`);else{console.log(`synced ${n.written} file(s) → ${r}`+(n.skipped?` (skipped ${n.skipped})`:""));for(let i of n.files)if(i.status==="written"||i.status==="dry-run")console.log(` + ${i.id} ← ${i.sourceUrl}`);else console.log(` - skip ${i.sourceUrl}: ${i.reason??""}`)}return{code:n.ok?0:1,result:n}}import{readdirSync as rE,existsSync as Hd,readFileSync as nE}from"node:fs";import{join as Kd}from"node:path";Un();import{fileURLToPath as MI}from"node:url";var _I=MI(new URL("../content",import.meta.url));import{appendFileSync as FI,existsSync as $d,mkdirSync as qI,readFileSync as BI,writeFileSync as Md}from"node:fs";import{join as _d}from"node:path";function jd(e,t){return _d(e,".uibot","skills",t)}function Jn(e,t){return _d(jd(e,t),"regressions.jsonl")}class Wn{options;constructor(e){this.options=e}append(e){let t=jd(this.options.rootDir,e.skillId);if(!$d(t))qI(t,{recursive:!0});FI(Jn(this.options.rootDir,e.skillId),JSON.stringify(e)+`
|
|
228
|
+
`,"utf-8")}list(e){let t=Jn(this.options.rootDir,e);if(!$d(t))return[];try{return BI(t,"utf-8").split(`
|
|
229
|
+
`).filter(Boolean).map((r)=>{try{return JSON.parse(r)}catch{return null}}).filter((r)=>r!==null)}catch{return[]}}active(e){return this.list(e).filter((t)=>t.status==="active")}markResolved(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),s=new Date().toISOString(),o=n.map((c)=>{if(i.has(c.id)&&c.status==="active")return{...c,status:"resolved",resolvedBy:r,resolvedAt:s};return c}),a=Jn(this.options.rootDir,e);Md(a,o.map((c)=>JSON.stringify(c)).join(`
|
|
226
230
|
`)+`
|
|
227
|
-
`,"utf-8")}markActive(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),
|
|
231
|
+
`,"utf-8")}markActive(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),s=new Date().toISOString(),o=n.map((c)=>{if(i.has(c.id)&&c.status==="resolved")return{...c,status:"active",context:[c.context,`reactivated@${s}: ${r}`].filter(Boolean).join(" | ")};return c}),a=Jn(this.options.rootDir,e);Md(a,o.map((c)=>JSON.stringify(c)).join(`
|
|
228
232
|
`)+`
|
|
229
|
-
`,"utf-8")}resolved(e){return this.list(e).filter((t)=>t.status==="resolved")}}
|
|
230
|
-
`).filter((
|
|
231
|
-
`,"utf8")}function
|
|
233
|
+
`,"utf-8")}resolved(e){return this.list(e).filter((t)=>t.status==="resolved")}}ji();import{createHash as KI}from"node:crypto";function Rt(e,t){return KI("sha256").update(JSON.stringify([e,t])).digest("hex")}function mo(e){return typeof e==="number"&&Number.isFinite(e)&&e>=0&&e<=1}var zI=new Set(["rule-scan","structural-heuristic","model-text","model-screenshot","legacy-provider","unassessed"]),GI=new Set(["empty-input","invalid-score","provider-failed","provider-not-run","invalid-evidence","screenshot-unavailable","timeout"]);async function Fd(e,t,r){let n=Rt(t,r),i=(s)=>({status:"unavailable",method:"unassessed",subjectHash:n,reason:s});if(!t.trim())return i("empty-input");try{if(e.evaluate){let o=await e.evaluate(t,r);if(!o||o.subjectHash!==n||!zI.has(o.method))return i("invalid-evidence");if(o.status==="scored"&&o.method!=="unassessed"&&mo(o.score))return{status:"scored",method:o.method,subjectHash:n,score:o.score};if(o.status==="unavailable"&&o.score===void 0&&GI.has(o.reason))return{status:"unavailable",method:o.method,subjectHash:n,reason:o.reason};return i("invalid-evidence")}let s=await e(t,r);return mo(s)?{status:"scored",method:"legacy-provider",subjectHash:n,score:s}:i("invalid-score")}catch{return i("provider-failed")}}var YI=[{label:"_js operator",re:/_js\s*:/g},{label:"_secret operator",re:/_secret\s*:/g},{label:"external URL",re:/https?:\/\/[^\s'"]+/g}];function JI(e,t){let r=[];for(let{label:n,re:i}of YI){let s=(e.match(i)??[]).length,o=(t.match(i)??[]).length;if(o>s)r.push(`New ${n} introduced (${s} → ${o})`)}return r}var Je={layout:["PageLayout","Card","Box","Tabs","Drawer","Modal"],nav:["PageSiderMenu","Breadcrumb","MenuLink","Link"],data:["Table","List","Stat"],form:["Form","Form.Input","Form.Select","Form.TextArea","Form.Checkbox"],feedback:["Toast","Dialog","Skeleton"],content:["Heading","Paragraph","Markdown","Divider"],action:["Button"]},WI=["Form.Submit","Button"];function QI(e){let t=Object.values(Je).filter((d)=>d.some((m)=>e.includes(m))).length,r=Object.keys(Je).length,n=Math.min(1,t/(r*0.7)),i=e.split(`
|
|
234
|
+
`).filter((d)=>d.trim().length>0).map((d)=>d.match(/^(\s*)/)?.[1]?.length??0),s=i.length>0?Math.max(...i):0,o=Math.min(1,s/12),a=Je.form.some((d)=>e.includes(d)),c=WI.some((d)=>e.includes(d)),l=!a?1:c?1:0.4,u=[...Je.layout,...Je.data].some((d)=>e.includes(d)),p=[...Je.content,...Je.action].some((d)=>e.includes(d)),f=u&&p?1:u||p?0.6:0.2;return n*0.35+o*0.15+l*0.2+f*0.3}function qd(e){let t=/```ya?ml[\s\S]*?```/i.test(e),r=/\bpage\s*:/i.test(e),n=/\bblocks\s*:/i.test(e);if(t)return 1;if(r&&n)return 0.9;if(r||n)return 0.5;return 0}function Bd(e,t,r){return e*0.4+t*0.35+r*0.25}class vt{visualScoreProvider;constructor(e={}){this.visualScoreProvider=e.visualScoreProvider??void 0}async run(e,t){let r=qd(t),n=e.expectedBlocks.filter((a)=>t.toLowerCase().includes(a.toLowerCase())),i=e.expectedBlocks.length===0?1:n.length/e.expectedBlocks.length,s=this.visualScoreProvider?await Fd(this.visualScoreProvider,t,e.intent):this.structuralEvidence(t,e.intent),o=s.status==="scored"?s.score:0;return{renderable:r,schemaValid:i,visualHeuristic:o,visualEvidence:s,overallScore:Bd(r,i,o),safetyOk:!0}}runSync(e,t){let r=qd(t),n=e.expectedBlocks.filter((a)=>t.toLowerCase().includes(a.toLowerCase())),i=e.expectedBlocks.length===0?1:n.length/e.expectedBlocks.length,s=this.visualScoreProvider?{status:"unavailable",method:"unassessed",subjectHash:Rt(t,e.intent),reason:"provider-not-run"}:this.structuralEvidence(t,e.intent),o=s.status==="scored"?s.score:0;return{renderable:r,schemaValid:i,visualHeuristic:o,visualEvidence:s,overallScore:Bd(r,i,o),safetyOk:!0}}structuralEvidence(e,t){let r=Rt(e,t);return e.trim()?{status:"scored",method:"structural-heuristic",subjectHash:r,score:QI(e)}:{status:"unavailable",method:"unassessed",subjectHash:r,reason:"empty-input"}}checkSafetyRegressions(e,t){return JI(e,t)}}function XI(e={}){if(e.runner)return e.runner;return new vt(e.visualScoreProvider!==void 0?{visualScoreProvider:e.visualScoreProvider}:{})}async function Qn(e,t,r={}){return XI(r).run(e,t)}var Vd="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",T$=new RegExp(`["']?\\b(?:${Vd})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),N$=new RegExp(`^\\s*-?\\s*(?:${Vd})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function iE(e){let t=Kd(e,".uibot","skills");if(!Hd(t))return[];return rE(t,{withFileTypes:!0}).filter((r)=>r.isDirectory()).map((r)=>r.name)}function sE(e,t){let r=Kd(e,".uibot","skills",t,"SKILL.md");if(!Hd(r))return"";return nE(r,"utf8")}async function zd(e={}){let t=e.cwd??process.cwd(),r=new Wn({rootDir:t}),n=e.skillId?[e.skillId]:iE(t),i=[],s=0,o=0;for(let c of n){let l=r.resolved(c),u=sE(t,c),p=[];for(let f of l){s+=1;let d={id:f.id,intent:f.intent||"regression-reverify",expectedBlocks:f.expectedBlocks??[],skillId:c},m=await Qn(d,u),g=(f.expectedBlocks?.length??0)===0||m.schemaValid>=0.99,h=m.renderable>=0.5||!f.intent.trim();if(!g||!h||m.overallScore<0.3)p.push(f.id),o+=1,i.push({skillId:c,id:f.id,action:"reactivated",reason:`overallScore=${m.overallScore.toFixed(3)} schemaValid=${m.schemaValid.toFixed(3)}`});else i.push({skillId:c,id:f.id,action:"pass"})}if(p.length>0)r.markActive(c,p,"reverify-failed")}let a={ok:!0,checked:s,reactivated:o,details:i};if(e.mode==="json")console.log(JSON.stringify(a,null,2));else{console.log(`reverify: checked ${s}, reactivated ${o}`);for(let c of i)if(c.action==="reactivated")console.log(` ! ${c.skillId}/${c.id} → active (${c.reason})`)}return{code:0,result:a}}import{appendFileSync as oE,existsSync as Xn,mkdirSync as Yd,readFileSync as aE,writeFileSync as Gd,cpSync as cE}from"node:fs";import{join as _e,dirname as lE}from"node:path";function uE(e){return _e(e,".uibot","cli-usage.jsonl")}function Ct(e,t){let r=uE(e);Yd(lE(r),{recursive:!0}),oE(r,JSON.stringify({...t,at:new Date().toISOString()})+`
|
|
235
|
+
`,"utf8")}function Jd(e,t){return _e(e,".uibot","skills",t)}async function Wd(e,t={}){let r=t.cwd??process.cwd(),n=Jd(r,e);if(!Xn(n)){let s={ok:!1,error:`skill not found: ${e}`};if(t.mode==="json")console.log(JSON.stringify(s));else console.error(`uibot skills promote: ${s.error}`);return Ct(r,{command:"skills.promote",id:e,ok:!1}),1}let i=_e(n,"SKILL.md");if(Xn(i))Gd(_e(n,"SKILL.promoted.md"),aE(i,"utf8"));if(Gd(_e(n,"PROMOTED"),JSON.stringify({id:e,promotedAt:new Date().toISOString()},null,2)),Ct(r,{command:"skills.promote",id:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,id:e,action:"promoted"}));else console.log(`promoted skill ${e}`);return 0}async function Qd(e,t={}){let r=t.cwd??process.cwd(),n=Jd(r,e),i=_e(n,"PROMOTED");if(!Xn(i)){let o={ok:!1,error:`no promotion marker for skill: ${e}`};if(t.mode==="json")console.log(JSON.stringify(o));else console.error(`uibot skills rollback: ${o.error}`);return Ct(r,{command:"skills.rollback",id:e,ok:!1}),1}let{unlinkSync:s}=await import("node:fs");if(s(i),Ct(r,{command:"skills.rollback",id:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,id:e,action:"rolled-back"}));else console.log(`rolled back skill ${e}`);return 0}async function Xd(e,t={}){let r=t.cwd??process.cwd(),n=_e(r,".uibot");if(!Xn(n)){let i={ok:!1,error:"no .uibot directory in workspace"};if(t.mode==="json")console.log(JSON.stringify(i));else console.error(`uibot project export: ${i.error}`);return Ct(r,{command:"project.export",outDir:e,ok:!1}),1}if(Yd(e,{recursive:!0}),cE(n,_e(e,".uibot"),{recursive:!0}),Ct(r,{command:"project.export",outDir:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,outDir:e}));else console.log(`exported project state → ${e}`);return 0}import{existsSync as dE,readFileSync as pE}from"node:fs";import{resolve as fE}from"node:path";var gE=process.env.UIBOT_REGISTRY_URL?.trim()||"http://127.0.0.1:3202/api/registry/registry.json";async function Zd(e={}){let t=e.cwd??process.cwd(),r=fE(t,e.lockfilePath??"uibot.artifacts.lock.json"),n=e.mode??"text",i=null,s=!1;if(!dE(r))s=!0;else try{i=JSON.parse(pE(r,"utf8"))}catch{s=!0}let o=e.manifest;if(!o){let c=e.registry??gE,l=e.fetchImpl??fetch;try{let u=await l(c);if(!u.ok){let p={ok:!1,error:`registry HTTP ${u.status}`,url:c};if(n==="json")console.log(JSON.stringify(p));else console.error(`uibot doctor: failed to fetch registry ${c} (${u.status})`);return 1}o=await u.json()}catch(u){let p=u instanceof Error?u.message:String(u),f="start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor";if(n==="json")console.log(JSON.stringify({ok:!1,error:p,url:c,exitCode:1,hint:"start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor"}));else console.error(`uibot doctor: cannot reach registry ${c}`),console.error(` ${p}`),console.error(" hint: start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor");return 1}}if(s){let c=Rr({lockfile:null,manifest:o,lockfilePath:r});if(n==="json")console.log(JSON.stringify({...c,exitCode:2}));else console.error(`uibot doctor: no lockfile at ${r}`);return 2}let a=Rr({lockfile:i,manifest:o,lockfilePath:r});if(n==="json")console.log(JSON.stringify({...a,exitCode:a.ok?0:1}));else if(a.ok)console.log(`uibot doctor: ok (${a.lockCount} locked, registry ${a.registryName??"?"})`);else{console.error(`uibot doctor: drift detected (${a.drifts.length})`);for(let c of a.drifts)console.error(` - ${c.detail}`)}return a.ok?0:1}import{existsSync as mr,mkdirSync as bo,writeFileSync as ep,readdirSync as mE,readFileSync as hE,statSync as yE}from"node:fs";import{dirname as tp,isAbsolute as bE,join as xt,relative as SE,resolve as ei,sep as wE}from"node:path";Gn();class se extends Error{constructor(e){super(e);this.name="InitIntoError"}}var kE="src/pages/home.uibot.yaml",RE="src/uibot-mount.example.tsx",vE="uibot.embed.md",rp=["@uibot/contracts","@uibot/compiler","@uibot/runtime","@uibot/renderer-react"],CE=`/**
|
|
232
236
|
* Minimal UIBot control-plane entry (scaffold from \`uibot init\`).
|
|
233
237
|
* Wire with your monorepo's createExampleControlPlane or a custom assembly.
|
|
234
238
|
*
|
|
235
239
|
* Smoke: \`bunx tsc --noEmit control-plane.ts\` after pointing imports at your packages.
|
|
236
240
|
*/
|
|
237
241
|
export async function main(): Promise<void> {
|
|
238
|
-
console.log("uibot project scaffold ready
|
|
242
|
+
console.log("uibot project scaffold ready — wire createExampleControlPlane here");
|
|
239
243
|
}
|
|
240
244
|
|
|
241
245
|
if (import.meta.main) {
|
|
242
246
|
void main();
|
|
243
247
|
}
|
|
244
|
-
`,
|
|
248
|
+
`,xE=`version: "2.0"
|
|
245
249
|
pages:
|
|
246
250
|
- id: home
|
|
247
251
|
path: /
|
|
@@ -258,7 +262,7 @@ pages:
|
|
|
258
262
|
- type: Button
|
|
259
263
|
props:
|
|
260
264
|
label: Get started
|
|
261
|
-
`,
|
|
265
|
+
`,IE=`version: "2.0"
|
|
262
266
|
pages:
|
|
263
267
|
- id: home
|
|
264
268
|
path: /
|
|
@@ -277,9 +281,9 @@ pages:
|
|
|
277
281
|
type: Paragraph
|
|
278
282
|
props:
|
|
279
283
|
text: Keep this *.uibot.yaml beside your routes; host owns router/session/ACL.
|
|
280
|
-
`;function
|
|
281
|
-
* L1 Embed mount example
|
|
282
|
-
* Proof: examples/vite-react-live
|
|
284
|
+
`;function EE(e){return`/**
|
|
285
|
+
* L1 Embed mount example — copy into a route component.
|
|
286
|
+
* Proof: examples/vite-react-live · smoke:external-consumer --phase app-runtime
|
|
283
287
|
*
|
|
284
288
|
* Spec file (edit / rename as needed): ${e}
|
|
285
289
|
*
|
|
@@ -292,7 +296,7 @@ import type { Catalog, UIBotSpec } from "@uibot/contracts";
|
|
|
292
296
|
import { createElement } from "react";
|
|
293
297
|
import { createRoot } from "react-dom/client";
|
|
294
298
|
|
|
295
|
-
// Replace with YAML
|
|
299
|
+
// Replace with YAML→JSON load, or import a typed Spec module.
|
|
296
300
|
const SPEC: UIBotSpec = {
|
|
297
301
|
version: "2.0",
|
|
298
302
|
pages: [
|
|
@@ -309,7 +313,7 @@ const SPEC: UIBotSpec = {
|
|
|
309
313
|
{
|
|
310
314
|
id: "heading",
|
|
311
315
|
type: "Heading",
|
|
312
|
-
props: { text: "compileSpec
|
|
316
|
+
props: { text: "compileSpec → createLiveRuntimeAdapter → renderer" },
|
|
313
317
|
},
|
|
314
318
|
],
|
|
315
319
|
},
|
|
@@ -344,14 +348,14 @@ export async function mountUIBot(rootEl: HTMLElement, registry: unknown): Promis
|
|
|
344
348
|
}),
|
|
345
349
|
);
|
|
346
350
|
}
|
|
347
|
-
`}function
|
|
351
|
+
`}function AE(e,t){let r=rp.join(" ");return`# UIBot L1 Embed
|
|
348
352
|
|
|
349
353
|
Scaffolded with \`uibot init --into\`.
|
|
350
354
|
|
|
351
355
|
## Install App Runtime
|
|
352
356
|
|
|
353
357
|
\`\`\`bash
|
|
354
|
-
# From a release-set / tarball / future npm
|
|
358
|
+
# From a release-set / tarball / future npm — pin versions your release uses.
|
|
355
359
|
pnpm add ${r}
|
|
356
360
|
# or: bun add ${r}
|
|
357
361
|
\`\`\`
|
|
@@ -363,7 +367,7 @@ Apps must **not** depend on Studio or \`@uibot/application\`.
|
|
|
363
367
|
| Path | Role |
|
|
364
368
|
|------|------|
|
|
365
369
|
| \`${e}\` | Starter \`*.uibot.yaml\` Spec beside routes |
|
|
366
|
-
| \`${t}\` | \`compileSpec\`
|
|
370
|
+
| \`${t}\` | \`compileSpec\` → \`createLiveRuntimeAdapter\` → renderer |
|
|
367
371
|
| \`DESIGN.md\` | This project's visual contract. Generate reads it; UIBot house seeds do not replace it. |
|
|
368
372
|
|
|
369
373
|
## Mount
|
|
@@ -382,23 +386,23 @@ Apps must **not** depend on Studio or \`@uibot/application\`.
|
|
|
382
386
|
\`uibot link --spec-dir <rel>\` then \`uibot sync push|pull\` for Spec-as-code sync.
|
|
383
387
|
|
|
384
388
|
See \`docs/product/progressive-adoption.md\`.
|
|
385
|
-
`}async function
|
|
386
|
-
`),i("control-plane.ts",
|
|
387
|
-
`);return i("README.md",`# ${
|
|
389
|
+
`}async function np(e){let t=e.log??((u)=>console.log(u)),r=ei(e.dir);bo(r,{recursive:!0});let n=[],i=(u,p)=>{let f=xt(r,u);bo(tp(f),{recursive:!0}),ep(f,p,"utf8"),n.push(f)};i("package.json",`${JSON.stringify({name:Zn(r),private:!0,type:"module",scripts:{start:"bun run control-plane.ts"}},null,2)}
|
|
390
|
+
`),i("control-plane.ts",CE),i("DESIGN.md",Kn(Zn(r)));let s=zn(),a=["frontend-principles","control-console"].map((u)=>s.find((p)=>p.id===u)).filter((u)=>Boolean(u));for(let u of a){let p=xt(".uibot","design-md",`${u.id}.design.md`);i(p,so(u))}let c=TE(),l=!1;if(c){let u=vr({dir:c}),p=(e.template?u.find((f)=>f.name===e.template):u.find((f)=>f.name==="saas-landing")??u[0])??null;if(p){let f=Cr(p),d=$r(f,{workspaceRoot:r,source:"uibot-init"});n.push(...d.writtenFiles),n.push(xt(r,"uibot.artifacts.lock.json")),l=!0,t(`seeded template ${p.name}`)}}if(!l)i(xt("templates","demo.yaml"),xE),i("uibot.artifacts.lock.json",`${JSON.stringify({version:1,artifacts:[]},null,2)}
|
|
391
|
+
`);return i("README.md",`# ${Zn(r)}
|
|
388
392
|
|
|
389
393
|
Scaffolded with \`uibot init\`.
|
|
390
394
|
|
|
391
|
-
- \`templates/\` or \`templates/registry/\`
|
|
392
|
-
- \`DESIGN.md\`
|
|
393
|
-
- \`.uibot/design-md/\`
|
|
394
|
-
- \`control-plane.ts\`
|
|
395
|
+
- \`templates/\` or \`templates/registry/\` — starter UIBot specs
|
|
396
|
+
- \`DESIGN.md\` — this project's visual contract (consumer-owned)
|
|
397
|
+
- \`.uibot/design-md/\` — UIBot house seeds (\`frontend-principles\` + \`control-console\`)
|
|
398
|
+
- \`control-plane.ts\` — wire your control-plane assembly
|
|
395
399
|
|
|
396
400
|
Next: point dependencies at \`@uibot/*\` packages and run the control-plane.
|
|
397
|
-
`),t(`initialized project at ${r} (${n.length} files)`),{dir:r,files:n}}function
|
|
401
|
+
`),t(`initialized project at ${r} (${n.length} files)`),{dir:r,files:n}}function ip(e){let t=e.log??((n)=>console.log(n)),r=e.error??((n)=>console.error(n));try{let n=PE(e.into);DE(n);let i=yo(e.specPath??kE,"specPath"),s=yo(e.mountPath??RE,"mountPath"),o=yo(e.recipePath??vE,"recipePath"),a=ho(i,n,"specPath"),c=ho(s,n,"mountPath"),l=ho(o,n,"recipePath"),u="DESIGN.md",p=xt(n,u),f=mr(p),d=[{abs:a,rel:i,content:IE},{abs:c,rel:s,content:EE(i)},{abs:l,rel:o,content:AE(i,s)}];if(!f)d.push({abs:p,rel:u,content:Kn(Zn(n))});if(!e.force){let b=d.filter((S)=>mr(S.abs)).map((S)=>S.rel);if(b.length>0)throw new se(`refusing to overwrite existing files (pass --force): ${b.join(", ")}`)}let m=[];for(let b of d)bo(tp(b.abs),{recursive:!0}),ep(b.abs,b.content.endsWith(`
|
|
398
402
|
`)?b.content:`${b.content}
|
|
399
|
-
`,"utf8"),m.push(b.abs);let g=[...
|
|
400
|
-
`,"utf8"),t}function
|
|
403
|
+
`,"utf8"),m.push(b.abs);let g=[...rp],h={ok:!0,into:n,files:m.map((b)=>OE(n,b)),dependencies:g};if(e.mode==="json")t(JSON.stringify(h));else{t(`initialized L1 Embed into ${n}`);for(let b of h.files)t(` + ${b}`);if(t(`App Runtime deps: ${g.join(" ")}`),f)t("kept existing DESIGN.md");t(`See ${o} for the copy-paste recipe.`)}return{code:0,into:n,files:m,dependencies:g}}catch(n){let i=n instanceof Error?n.message:String(n);if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:i}));else r(`uibot init --into: ${i}`);return{code:1,error:i}}}function PE(e){if(!e||e.includes("\x00"))throw new se("--into path is invalid");let t=ei(e);if(!mr(t))throw new se(`directory does not exist: ${t}`);let r;try{r=yE(t)}catch{throw new se(`cannot stat --into path: ${t}`)}if(!r.isDirectory())throw new se(`--into must be a directory: ${t}`);return t}function DE(e){let t=xt(e,"package.json");if(!mr(t))throw new se(`missing package.json in ${e} (refuse to scaffold non-app dir)`);try{let r=hE(t,"utf8");JSON.parse(r)}catch{throw new se(`invalid package.json in ${e}`)}}function ho(e,t,r){if(!e||e.includes("\x00"))throw new se(`${r} is invalid`);if(bE(e))throw new se(`${r} must be a relative path (got absolute: ${e})`);try{return J(e,t,r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new se(`${r} escapes app root: ${i}`)}}function yo(e,t){let r=e.split(/[/\\]/).join("/");if(!r||r.includes("\x00"))throw new se(`${t} is invalid`);return r}function OE(e,t){return SE(e,t).split(wE).join("/")}function Zn(e){return(e.replace(/\/+$/,"").split("/").pop()||"uibot-app").replace(/[^a-zA-Z0-9._-]/g,"-")}function TE(){let e=[ei(process.cwd(),"examples/templates"),ei(__uibotDir,"../../../../examples/templates")];for(let t of e)if(mr(t))try{if(mE(t).some((r)=>r.endsWith(".yaml")||r.endsWith(".yml")))return t}catch{}return null}import{existsSync as So,mkdirSync as wo,readFileSync as NE,writeFileSync as LE}from"node:fs";import{dirname as sp,isAbsolute as op,join as Ro,relative as $E,resolve as ti,sep as ko}from"node:path";var vo="uibot.link.v1",Co=Ro(".uibot","link.json"),ME=Ro(".uibot","spec.lock");class M extends Error{constructor(e){super(e);this.name="LinkPathError"}}function _E(e,t){let r=t.endsWith(ko)?t:t+ko;return e===t||e.startsWith(r)}function ri(e,t,r){if(!e||e.includes("\x00"))throw new M(`${r} is invalid`);if(op(e))throw new M(`${r} must be a relative path (got absolute: ${e})`);try{return J(e,t,r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new M(`${r} escapes consumer root: ${i}`)}}function xo(e,t){if(!e||e.includes("\x00"))throw new M("sourceDir is invalid");return op(e)?ti(e):ti(t,e)}function hr(e){if(!e||e.includes("\x00"))throw new M("controlPlaneUrl is invalid");let t;try{t=new URL(e.trim())}catch{throw new M(`controlPlaneUrl is not a valid URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new M(`controlPlaneUrl must be http(s) (got ${t.protocol})`);if(t.username||t.password)throw new M("controlPlaneUrl must not embed credentials; use UIBOT_CONTROL_PLANE_AUTH_BEARER / UIBOT_STUDIO_AUTH_BEARER");let r=t.pathname.replace(/\/+$/,"");return`${t.origin}${r==="/"?"":r}`}function yr(e){let t=e.trim();if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(t))throw new M(`projectId invalid (expected /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/, got ${JSON.stringify(e)})`);return t}function ni(e){return Ro(e,Co)}function ii(e){let t=ni(e);if(!So(t))throw new M(`missing ${Co}; run \`uibot link\` first`);let r=JSON.parse(NE(t,"utf8"));if(r.schema!==vo)throw new M(`unsupported link schema: ${String(r.schema)}`);if(!r.consumerRoot||!r.specDir||!r.lockPath)throw new M("link.json missing required fields");if(r.controlPlaneUrl)r.controlPlaneUrl=hr(r.controlPlaneUrl);if(r.projectId)r.projectId=yr(r.projectId);return r}function Io(e){let t=ni(e.consumerRoot);wo(sp(t),{recursive:!0});let r={schema:vo,consumerRoot:e.consumerRoot,specDir:e.specDir,...e.sourceDir?{sourceDir:e.sourceDir}:{},...e.controlPlaneUrl?{controlPlaneUrl:e.controlPlaneUrl}:{},...e.projectId?{projectId:e.projectId}:{},digest:e.digest,lockPath:e.lockPath,createdAt:e.createdAt,...e.updatedAt?{updatedAt:e.updatedAt}:{}};return LE(t,`${JSON.stringify(r,null,2)}
|
|
404
|
+
`,"utf8"),t}function ap(e){let t=e.log??((s)=>console.log(s)),r=e.error??((s)=>console.error(s)),n=ti(e.cwd??process.cwd()),i=e.lockPath??ME;try{ri(e.specDir,n,"specDir"),ri(i,n,"lockPath");let s=ni(n);if(So(s)&&!e.force){let g=`${Co} already exists (pass --force to overwrite)`;if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:g}));else r(`uibot link: ${g}`);return{code:1}}let o;if(e.sourceDir)o=xo(e.sourceDir,n);let a;if(e.controlPlaneUrl)a=hr(e.controlPlaneUrl);let c;if(e.projectId)c=yr(e.projectId);let l=new Date().toISOString(),u=So(s)?ii(n):void 0,p={schema:vo,consumerRoot:n,specDir:e.specDir.split(/[/\\]/).join("/"),...o?{sourceDir:o}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},digest:u?.digest??null,lockPath:i.split(/[/\\]/).join("/"),createdAt:u?.createdAt??l,updatedAt:l},f=ti(n,p.specDir);if(!_E(f,n))throw new M("specDir escapes consumer root");wo(f,{recursive:!0}),wo(sp(ni(n)),{recursive:!0});let d=Io(p),m={ok:!0,path:d,consumerRoot:p.consumerRoot,specDir:p.specDir,sourceDir:p.sourceDir??null,controlPlaneUrl:p.controlPlaneUrl??null,projectId:p.projectId??null,digest:p.digest,lockPath:p.lockPath};if(e.mode==="json")t(JSON.stringify(m));else{if(t(`linked consumer → ${d}`),t(` specDir: ${p.specDir}`),p.sourceDir)t(` sourceDir: ${p.sourceDir}`);if(p.controlPlaneUrl)t(` controlPlaneUrl: ${p.controlPlaneUrl}`);if(p.projectId)t(` projectId: ${p.projectId}`);t(` digest: ${p.digest??"(unset — run uibot sync push|pull)"}`)}return{code:0,config:p}}catch(s){let o=s instanceof Error?s.message:String(s);if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:o}));else r(`uibot link: ${o}`);return{code:1}}}function me(e){return ri(e.specDir,e.consumerRoot,"specDir")}function cp(e){return ri(e.lockPath,e.consumerRoot,"lockPath")}function It(e,t){return $E(e,t).split(ko).join("/")}import{createHash as jE}from"node:crypto";import{copyFileSync as FE,existsSync as br,mkdirSync as We,readdirSync as qE,readFileSync as up,statSync as BE,unlinkSync as UE,writeFileSync as dp}from"node:fs";import{dirname as Po,join as VE,relative as HE,resolve as pp,sep as lp}from"node:path";var KE="uibot.spec.lock.v1",fp="uibot.spec.sync.v1",zE="/api/studio/spec-sync",gp=/\.ya?ml$/i;function Eo(e,t){let r=t.endsWith(lp)?t:t+lp;return e===t||e.startsWith(r)}function ai(e){if(!br(e))return[];let t=[],r=(n)=>{for(let i of qE(n,{withFileTypes:!0})){if(i.name==="node_modules"||i.name===".git")continue;let s=VE(n,i.name);if(i.isDirectory()){r(s);continue}if(i.isFile()&&gp.test(i.name))t.push(s)}};return r(e),t.sort((n,i)=>n.localeCompare(i))}function Ao(e){return jE("sha256").update(e).digest("hex")}function GE(e){let t=ai(e).map((i)=>{let s=It(e,i),o=Ao(up(i));return{path:s,sha256:o}}),r=t.map((i)=>`${i.path}
|
|
401
405
|
${i.sha256}`).join(`
|
|
402
|
-
`);return{digest:`sha256:${
|
|
403
|
-
`,"utf8")}function On(e,t){if(!Zt(e)||!LE(e).isDirectory())throw new D(`source Spec directory not found: ${e}`);Be(t,{recursive:!0});let r=[];for(let n of Ln(e)){let i=ME(e,n),o=de(i,t,"sync");Be(Qo(o),{recursive:!0}),OE(n,o),r.push(dt(t,o))}return{copied:r,removedNone:!0}}function BE(e,t){Be(t,{recursive:!0});let r=[],n=new Set;for(let i of e){if(!i.path||i.path.includes("\x00")||typeof i.content!=="string")throw new D("remote Spec file entry is invalid");if(!kd.test(i.path))throw new D(`remote Spec path is not YAML: ${i.path}`);let o=de(i.path,t,"sync");Be(Qo(o),{recursive:!0}),Sd(o,i.content,"utf8");let s=dt(t,o);n.add(s),r.push(s)}for(let i of Ln(t)){let o=dt(t,i);if(!n.has(o))NE(i)}return{copied:r.sort((i,o)=>i.localeCompare(o))}}function UE(e){return Ln(e).map((t)=>{let r=bd(t,"utf8");return{path:dt(e,t),content:r,sha256:Jo(r)}})}function Tn(e,t){let r=t??e.sourceDir;if(!r)throw new D("no sourceDir: pass --from <dir> (push) / --to <dir> (pull), or re-run `uibot link --source-dir <dir>` (or configure --control-plane-url)");let n=Yo(r,e.consumerRoot),i={...e,sourceDir:n,updatedAt:new Date().toISOString()};return{sourceDir:n,config:i}}function VE(e=process.env){return e.UIBOT_CONTROL_PLANE_AUTH_BEARER?.trim()||e.UIBOT_STUDIO_AUTH_BEARER?.trim()||""||void 0}function KE(e,t){let r=Qt(e),n=t?Xt(t):"default",i=new URL(`${r}${FE}`);return i.searchParams.set("projectId",n),i.toString()}async function wd(e){let t={accept:"application/json"};if(e.bearer)t.authorization=`Bearer ${e.bearer}`;let r={method:e.method,headers:t};if(e.method==="PUT")t["content-type"]="application/json",r={...r,body:JSON.stringify(e.body)};let n;try{n=await e.fetchImpl(e.url,r)}catch(s){let a=s instanceof Error?s.message:String(s);throw new D(`control-plane request failed: ${a}`)}if(n.status<200||n.status>=300){let s="";try{let a=await n.text();s=a?`: ${a.slice(0,240)}`:""}catch{}throw new D(`control-plane Spec sync HTTP ${n.status}${s}`)}let i;try{i=await n.json()}catch{throw new D("control-plane Spec sync returned non-JSON body")}let o=i;if(!o||o.schema!==Cd||!Array.isArray(o.files))throw new D("control-plane Spec sync response missing uibot.spec.sync.v1 shape");return o}function xd(e,t){let r=t.env??process.env,n=t.controlPlaneUrl??e.controlPlaneUrl;if(!n)return null;let i=t.projectId??e.projectId,o=Qt(n),s={...e,controlPlaneUrl:o,...i?{projectId:Xt(i)}:{},updatedAt:new Date().toISOString()},a=VE(r);return{config:s,url:KE(o,s.projectId),...a?{bearer:a}:{}}}function De(e,t,r,n){let i=e.log??((s)=>console.log(s)),o=e.error??((s)=>console.error(s));if(e.mode==="json")i(JSON.stringify({ok:t,...r}));else if(t)for(let s of n)i(s);else o(`uibot sync: ${String(r.error??"failed")}`);return t?0:1}function pt(e){let t=ae(e),r=hd(e),{digest:n,files:i}=jE(t),o={schema:_E,digest:n,files:i,updatedAt:new Date().toISOString()};qE(r,o);let s={...e,digest:n,updatedAt:o.updatedAt};return Go(s),{config:s,lock:o}}async function vd(e={}){try{let t=Rd(e.cwd??process.cwd()),r=Dn(t);if(r={...r,consumerRoot:t},e.from){let{sourceDir:d,config:p}=Tn(r,e.from);if(!Wo(ae(p),p.consumerRoot))throw new D("specDir escapes consumer root");let f=ae(p),{copied:u}=On(d,f),{config:m,lock:g}=pt(p);return De(e,!0,{action:"push",mode:"local",from:d,to:f,copied:u,digest:g.digest,lockPath:m.lockPath},[`sync push: ${u.length} YAML file(s) ${d} \u2192 ${f}`,`digest: ${g.digest}`])}let n=xd(r,e);if(n&&!e.from){let d=e.fetchImpl??fetch,p=await wd({url:n.url,method:"GET",...n.bearer?{bearer:n.bearer}:{},fetchImpl:d}),f=ae(n.config);if(!Wo(f,n.config.consumerRoot))throw new D("specDir escapes consumer root");let{copied:u}=BE(p.files,f),{config:m,lock:g}=pt(n.config);return De(e,!0,{action:"push",mode:"remote",from:n.url,to:f,copied:u,remoteDigest:p.digest,digest:g.digest,lockPath:m.lockPath,projectId:p.projectId},[`sync push (remote): ${u.length} YAML file(s) ${n.url} \u2192 ${f}`,`digest: ${g.digest}`])}let{sourceDir:i,config:o}=Tn(r,e.from);if(!Wo(ae(o),o.consumerRoot))throw new D("specDir escapes consumer root");let s=ae(o),{copied:a}=On(i,s),{config:c,lock:l}=pt(o);return De(e,!0,{action:"push",mode:"local",from:i,to:s,copied:a,digest:l.digest,lockPath:c.lockPath},[`sync push: ${a.length} YAML file(s) ${i} \u2192 ${s}`,`digest: ${l.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return De(e,!1,{action:"push",error:r},[])}}async function Ed(e={}){try{let t=Rd(e.cwd??process.cwd()),r=Dn(t);r={...r,consumerRoot:t};let n=e.to??e.from;if(n){let{sourceDir:f,config:u}=Tn(r,n),m=ae(u);if(!Zt(m))throw new D(`consumer specDir not found: ${m}`);Be(f,{recursive:!0});let{copied:g}=On(m,f),{config:h,lock:b}=pt(u);return De(e,!0,{action:"pull",mode:"local",from:m,to:f,copied:g,digest:b.digest,lockPath:h.lockPath},[`sync pull: ${g.length} YAML file(s) ${m} \u2192 ${f}`,`digest: ${b.digest}`])}let i=xd(r,e);if(i){let f=ae(i.config);if(!Zt(f))throw new D(`consumer specDir not found: ${f}`);let u=UE(f),m=e.fetchImpl??fetch,g=await wd({url:i.url,method:"PUT",...i.bearer?{bearer:i.bearer}:{},body:{schema:Cd,files:u},fetchImpl:m}),{config:h,lock:b}=pt(i.config);return De(e,!0,{action:"pull",mode:"remote",from:f,to:i.url,copied:u.map((S)=>S.path),remoteDigest:g.digest,digest:b.digest,lockPath:h.lockPath,projectId:g.projectId},[`sync pull (remote): ${u.length} YAML file(s) ${f} \u2192 ${i.url}`,`digest: ${b.digest}`])}let o=e.to??e.from,{sourceDir:s,config:a}=Tn(r,o),c=ae(a);if(!Zt(c))throw new D(`consumer specDir not found: ${c}`);Be(s,{recursive:!0});let{copied:l}=On(c,s),{config:d,lock:p}=pt(a);return De(e,!0,{action:"pull",mode:"local",from:c,to:s,copied:l,digest:p.digest,lockPath:d.lockPath},[`sync pull: ${l.length} YAML file(s) ${c} \u2192 ${s}`,`digest: ${p.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return De(e,!1,{action:"pull",error:r},[])}}function Nn(e){let t={_:[]};for(let r=0;r<e.length;r+=1){let n=e[r];if(!n.startsWith("--")){t._.push(n);continue}let i=n.slice(2),o=i.indexOf("=");if(o>=0){t[i.slice(0,o)]=i.slice(o+1);continue}let s=e[r+1];if(s!==void 0&&!s.startsWith("--"))t[i]=s,r+=1;else t[i]=!0}return t}function I(e,t){let r=e[t];return typeof r==="string"?r:void 0}var Pd="uibot.resource.envelope.v1",$N=["resource-cli-invalid-mode","resource-cli-invalid-argument","resource-cli-internal-error"];class U extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceCliError"}}function Xo(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},...e.tags.length?{tags:e.tags}:{},...e.capabilities.length?{capabilities:e.capabilities}:{},...e.dependencies.length?{dependencies:e.dependencies}:{},source:e.source,maturity:e.receipt.maturity,receiptLevel:e.receipt.level,...e.receipt.evidence.length?{evidence:e.receipt.evidence}:{}}}function HE(e){return{id:e.resource.id,score:e.score,reasons:e.reasons,resource:Xo(e.resource)}}function Ad(){return typeof crypto.randomUUID==="function"?crypto.randomUUID():`resource-${Date.now().toString(36)}`}function Dd(e,t){return{dense:t,encoding:t?"dense-v1":"full",resourceIndexSchemaVersion:e.manifest().schemaVersion}}function zE(e,t,r,n){return{schemaVersion:Pd,requestId:r.requestId??Ad(),command:e,ok:!0,data:t,meta:Dd(r.queryService,n)}}function YE(e,t,r,n){let i=t instanceof H||t instanceof U?t.code:"resource-cli-internal-error",o=t instanceof H||t instanceof U?t.detail:"resource command failed";return{schemaVersion:Pd,requestId:r.requestId??Ad(),command:e,ok:!1,error:{code:i,message:`${i}: ${o}`,detail:o},meta:Dd(r.queryService,n)}}function $n(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string")throw new U("resource-cli-invalid-argument",`--${t} requires a value`);let n=r.split(",").map((i)=>i.trim()).filter(Boolean);if(n.length===0)throw new U("resource-cli-invalid-argument",`--${t} is empty`);return n}function Id(e,t,r){let n=$n(e,t);if(!n)return;for(let i of n)if(!r.includes(i))throw new U("resource-cli-invalid-argument",`--${t}=${i}; expected one of ${r.join(",")}`);return n}function GE(e){let t=Id(e,"kind",ir),r=$n(e,"tag"),n=$n(e,"category"),i=$n(e,"capability"),o=Id(e,"maturity",gt),s=I(e,"limit"),a;if(e.limit!==void 0){if(!s||!/^\d+$/.test(s)||Number(s)<=0)throw new U("resource-cli-invalid-argument",`--limit=${s??"<missing>"}; expected a positive integer`);a=Number(s)}let c=e._.join(" ").trim();return{...c?{text:c}:{},...t?{kinds:t}:{},...r?{tags:r}:{},...n?{categories:n}:{},...i?{capabilities:i}:{},...o?{maturities:o}:{},...a!==void 0?{limit:a}:{}}}function WE(e,t,r){if(e==="manifest"){let n=t;for(let i of n.index.resources)r(`${i.id} ${i.kind} ${i.receipt.maturity} ${i.title}`);return}if(e==="search"){let n=t;for(let i of n.matches)r(`${i.resource.id} ${i.score} ${i.reasons.map((o)=>o.code).join(",")} ${i.resource.title}`);return}r(JSON.stringify(t,null,2))}async function Zo(e,t,r){let n=Nn(t),i=r.log??((d)=>console.log(d)),o=r.errorLog??((d)=>console.error(d)),s=n.dense,a=s===!0,c=I(n,"mode"),l=c??"text";try{let d=Ke.find((g)=>g.name===e),p=new Set(["mode","dense",...d.options.map((g)=>g.name)]),f=Object.keys(n).find((g)=>g!=="_"&&!p.has(g));if(f)throw new U("resource-cli-invalid-argument",`unsupported flag --${f} for ${e}`);if(n.mode!==void 0&&c===void 0)throw new U("resource-cli-invalid-mode","--mode requires text or json");if(l!=="text"&&l!=="json")throw new U("resource-cli-invalid-mode",`${l}; expected text or json`);if(s!==void 0&&s!==!0)throw new U("resource-cli-invalid-argument","--dense does not take a value");if(r.sourceError)throw r.sourceError;let u;switch(e){case"manifest":{if(n._.length>0)throw new U("resource-cli-invalid-argument","manifest does not accept positionals");let g=r.queryService.manifest();u={operations:Ke,index:a?{schemaVersion:g.schemaVersion,resources:g.resources.map(Xo),aliasLookup:Object.entries(g.aliases)}:g};break}case"search":{let g=r.queryService.search(GE(n));u={matches:a?g.map(HE):g};break}case"get":{if(n._.length!==1)throw new U("resource-cli-invalid-argument","get requires exactly one id or quoted alias");let g=r.queryService.get(n._[0]);u={resource:a?Xo(g):g};break}case"docs":case"examples":case"install-plan":{if(n._.length!==1)throw new U("resource-cli-invalid-argument",`${e} requires one resource id`);let g=n._[0],h=I(n,"locale")??"zh";if(e==="docs"&&h!=="zh"&&h!=="en")throw new U("resource-cli-invalid-argument","--locale requires zh or en");if(!(e==="docs"?r.queryService.docs:e==="examples"?r.queryService.examples:r.queryService.installPlan))throw new U("resource-cli-invalid-argument",`${e} is unavailable in this resource source`);let S=I(n,"page"),k=S===void 0?void 0:Number(S);if(n.page!==void 0&&(!Number.isSafeInteger(k)||(k??0)<1))throw new U("resource-cli-invalid-argument","--page requires a positive integer");u=e==="docs"?r.queryService.docs?.(g,h,k):e==="examples"?r.queryService.examples?.(g,k):r.queryService.installPlan?.(g);break}case"build":{u={plan:r.queryService.build(n._)};break}}let m=zE(e,u,r,a);if(l==="json")i(JSON.stringify(m));else WE(e,u,i);return 0}catch(d){let p=d instanceof Error?d:Error(String(d)),f=YE(e,p,r,a);if(l==="json"||c!==void 0)i(JSON.stringify(f));else o(f.error.message);return 1}}import{createHash as JE}from"crypto";import{existsSync as Od,readFileSync as QE}from"fs";import{resolve as ge}from"path";function Td(e){for(let t of e)if(Od(t))return t;return null}function es(e=process.cwd()){return Td([ge(e,"examples/templates"),ge(import.meta.dir,"templates"),ge(import.meta.dir,"../../../examples/templates")])}function ts(e=process.cwd()){return Td([ge(e,"examples/shells"),ge(import.meta.dir,"shells"),ge(import.meta.dir,"../../../examples/shells")])}function XE(e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){if(t[n])throw Error(`duplicate built-in catalog source id: ${n}`);t[n]=i}return t}async function Ld(e){if(e){let d=new URL(e);if(d.protocol!=="https:"&&!(d.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(d.hostname)))throw Error("public-resource-source-must-use-https");let p=await fetch(d,{signal:AbortSignal.timeout(1e4),redirect:"error"});if(!p.ok)throw Error(`public-resource-source-http-${p.status}`);let f=p.body?.getReader();if(!f)throw Error("public-resource-source-empty");let u=[],m=0;try{for(;;){let{value:x,done:O}=await f.read();if(O)break;if(m+=x.byteLength,m>16777216)throw Error("public-resource-source-too-large");u.push(x)}}finally{await f.cancel()}let g=new Uint8Array(m),h=0;for(let x of u)g.set(x,h),h+=x.byteLength;let b=new TextDecoder("utf-8",{fatal:!0}).decode(g),S=JSON.parse(b);lr(S);let{release:k,schemaVersion:v,...E}=S;if(JE("sha256").update(JSON.stringify(E)).digest("hex")!==S.release.sourceHash)throw Error("public-resource-source-hash-mismatch");return Hn(S)}let t=[ge(import.meta.dir,"resources/bundle.json"),ge(import.meta.dir,"../../../public/resources/bundle.json")].find(Od);if(t){let d=JSON.parse(QE(t,"utf8"));return lr(d),Hn(d)}let[r,n,i]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-studio"),Promise.resolve().then(() => (Rn(),{}))]),o=[],s=es();if(s)o.push({dir:s});let a=ts();if(a)o.push({dir:a,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let c=ft(o),l=Object.fromEntries(c.map((d)=>[d.name,d.templateContract]));return cr(us({components:XE([r.CATALOG_ENTRIES,n.STUDIO_CATALOG_ENTRIES]),templates:l,designGuides:Sn(ge(import.meta.dir,"../../design-md/content")),examples:ls(l)}))}async function ZE(){let[e,t,r,n]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-shadcn/registry-source"),import("@uibot/blocks-studio"),import("@uibot/blocks-studio/registry-source")]);return ss([{sourceDir:t.SOURCE_DIR,blockFileMap:t.BLOCK_FILE,catalog:e.CATALOG_ENTRIES},{sourceDir:n.SOURCE_DIR,blockFileMap:n.BLOCK_FILE,catalog:r.STUDIO_CATALOG_ENTRIES}])}function ee(e,t){if(I(e,"mode")==="json")console.log(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:t}));else console.error(t);return 1}async function Nd(e){if(e[0]==="resource")return Nd(e.slice(1));let[t,...r]=e,n=Nn(r),i=I(n,"registry");switch(t){case"manifest":case"search":case"get":case"build":case"docs":case"examples":case"install-plan":{let o=I(n,"source"),s=r.indexOf("--source"),a=s>=0?r.filter((c,l)=>l!==s&&l!==s+1):r.filter((c)=>!c.startsWith("--source="));try{let c=await Ld(o);return Zo(t,a,{queryService:c})}catch(c){return Zo(t,a,{queryService:{manifest:()=>({schemaVersion:"uibot.resource.index.v1",resources:[],aliases:{}}),search:()=>[],get:()=>{throw Error("unavailable")},build:()=>{throw Error("unavailable")}},sourceError:c instanceof Error?c:Error("resource source unavailable")})}}case"list":return await Es({...i?{registry:i}:{}}),0;case"add":{let o=n._[0];if(!o)return ee(n,"uibot add: missing artifact <name>");return await vs(o,{...i?{registry:i}:{},workspaceRoot:I(n,"cwd")??process.cwd()}),0}case"publish":{let o=await ZE(),s=[],a=es();if(a)s.push({dir:a});let c=ts();if(c)s.push({dir:c,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let l=ft(s);return await Ps({out:I(n,"out")??"dist/registry",manifestName:I(n,"name")??"uibot",sources:o,...l.length?{templates:l}:{}}),0}case"design-md":{if(n._[0]!=="sync")return ee(n,"uibot design-md: expected subcommand 'sync'");let s=I(n,"from");if(!s)return ee(n,"uibot design-md sync: missing --from <github:owner/repo|https-url>");let c=I(n,"mode")==="json"?"json":"text",l=I(n,"license"),{code:d}=await Uu({from:s,cwd:I(n,"cwd")??process.cwd(),mode:c,...l?{license:l}:{},dryRun:n["dry-run"]===!0});return d}case"regressions":{if(n._[0]!=="reverify")return ee(n,"uibot regressions: expected subcommand 'reverify'");let s=I(n,"mode")==="json"?"json":"text",a=I(n,"skill"),{code:c}=await ed({cwd:I(n,"cwd")??process.cwd(),mode:s,...a?{skillId:a}:{}});return c}case"skills":{let o=n._[0],s=n._[1],a=I(n,"mode")==="json"?"json":"text",c=I(n,"cwd")??process.cwd();if(o==="promote"){if(!s)return ee(n,"uibot skills promote: missing <id>");return id(s,{cwd:c,mode:a})}if(o==="rollback"){if(!s)return ee(n,"uibot skills rollback: missing <id>");return od(s,{cwd:c,mode:a})}return ee(n,"uibot skills: expected promote|rollback <id>")}case"project":{let o=n._[0],s=n._[1];if(o!=="export"||!s)return ee(n,"uibot project: expected export <dir>");let a=I(n,"mode")==="json"?"json":"text";return sd(s,{cwd:I(n,"cwd")??process.cwd(),mode:a})}case"link":{let o=I(n,"spec-dir")??n._[0];if(!o||typeof o!=="string")return ee(n,"uibot link: missing --spec-dir <relative-dir> (or positional <spec-dir>)");let s=I(n,"source-dir"),a=I(n,"control-plane-url"),c=I(n,"project-id"),l=I(n,"lock-path"),{code:d}=md({cwd:I(n,"cwd")??process.cwd(),specDir:o,...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},...l?{lockPath:l}:{},force:n.force===!0,mode:I(n,"mode")==="json"?"json":"text"});return d}case"sync":{let o=n._[0];if(o!=="push"&&o!=="pull")return ee(n,"uibot sync: expected subcommand 'push' or 'pull'");let s=I(n,"mode")==="json"?"json":"text",a=I(n,"cwd")??process.cwd(),c=I(n,"from"),l=I(n,"to"),d=I(n,"control-plane-url"),p=I(n,"project-id");if(o==="push")return vd({cwd:a,mode:s,...c?{from:c}:{},...d?{controlPlaneUrl:d}:{},...p?{projectId:p}:{}});return Ed({cwd:a,mode:s,...l?{to:l}:{},...c&&!l?{from:c}:{},...d?{controlPlaneUrl:d}:{},...p?{projectId:p}:{}})}case"doctor":{let o=I(n,"registry");return ad({cwd:I(n,"cwd")??process.cwd(),mode:I(n,"mode")==="json"?"json":"text",...o?{registry:o}:{}})}case"init":{let o=I(n,"into");if(o){let c=I(n,"spec-path"),l=I(n,"mount-path"),{code:d}=pd({into:o,...c?{specPath:c}:{},...l?{mountPath:l}:{},force:n.force===!0,mode:I(n,"mode")==="json"?"json":"text"});return d}let s=n._[0];if(!s)return ee(n,"uibot init: missing <dir> (or use --into <existing-app>)");let a=I(n,"template");return await dd({dir:s,...a?{template:a}:{}}),0}case"help":case"--help":case"-h":case void 0:return console.log(Jn()),0;default:{let o=`uibot: unknown command '${t}'`;if(I(n,"mode")==="json")return ee(n,o);return console.error(`${o}
|
|
404
|
-
`),console.error(
|
|
406
|
+
`);return{digest:`sha256:${Ao(r||"empty")}`,files:t}}function YE(e,t){We(Po(e),{recursive:!0}),dp(e,`${JSON.stringify(t,null,2)}
|
|
407
|
+
`,"utf8")}function si(e,t){if(!br(e)||!BE(e).isDirectory())throw new M(`source Spec directory not found: ${e}`);We(t,{recursive:!0});let r=[];for(let n of ai(e)){let i=HE(e,n),s=J(i,t,"sync");We(Po(s),{recursive:!0}),FE(n,s),r.push(It(t,s))}return{copied:r,removedNone:!0}}function JE(e,t){We(t,{recursive:!0});let r=[],n=new Set;for(let i of e){if(!i.path||i.path.includes("\x00")||typeof i.content!=="string")throw new M("remote Spec file entry is invalid");if(!gp.test(i.path))throw new M(`remote Spec path is not YAML: ${i.path}`);let s=J(i.path,t,"sync");We(Po(s),{recursive:!0}),dp(s,i.content,"utf8");let o=It(t,s);n.add(o),r.push(o)}for(let i of ai(t)){let s=It(t,i);if(!n.has(s))UE(i)}return{copied:r.sort((i,s)=>i.localeCompare(s))}}function WE(e){return ai(e).map((t)=>{let r=up(t,"utf8");return{path:It(e,t),content:r,sha256:Ao(r)}})}function oi(e,t){let r=t??e.sourceDir;if(!r)throw new M("no sourceDir: pass --from <dir> (push) / --to <dir> (pull), or re-run `uibot link --source-dir <dir>` (or configure --control-plane-url)");let n=xo(r,e.consumerRoot),i={...e,sourceDir:n,updatedAt:new Date().toISOString()};return{sourceDir:n,config:i}}function QE(e=process.env){return e.UIBOT_CONTROL_PLANE_AUTH_BEARER?.trim()||e.UIBOT_STUDIO_AUTH_BEARER?.trim()||""||void 0}function XE(e,t){let r=hr(e),n=t?yr(t):"default",i=new URL(`${r}${zE}`);return i.searchParams.set("projectId",n),i.toString()}async function mp(e){let t={accept:"application/json"};if(e.bearer)t.authorization=`Bearer ${e.bearer}`;let r={method:e.method,headers:t};if(e.method==="PUT")t["content-type"]="application/json",r={...r,body:JSON.stringify(e.body)};let n;try{n=await e.fetchImpl(e.url,r)}catch(o){let a=o instanceof Error?o.message:String(o);throw new M(`control-plane request failed: ${a}`)}if(n.status<200||n.status>=300){let o="";try{let a=await n.text();o=a?`: ${a.slice(0,240)}`:""}catch{}throw new M(`control-plane Spec sync HTTP ${n.status}${o}`)}let i;try{i=await n.json()}catch{throw new M("control-plane Spec sync returned non-JSON body")}let s=i;if(!s||s.schema!==fp||!Array.isArray(s.files))throw new M("control-plane Spec sync response missing uibot.spec.sync.v1 shape");return s}function hp(e,t){let r=t.env??process.env,n=t.controlPlaneUrl??e.controlPlaneUrl;if(!n)return null;let i=t.projectId??e.projectId,s=hr(n),o={...e,controlPlaneUrl:s,...i?{projectId:yr(i)}:{},updatedAt:new Date().toISOString()},a=QE(r);return{config:o,url:XE(s,o.projectId),...a?{bearer:a}:{}}}function je(e,t,r,n){let i=e.log??((o)=>console.log(o)),s=e.error??((o)=>console.error(o));if(e.mode==="json")i(JSON.stringify({ok:t,...r}));else if(t)for(let o of n)i(o);else s(`uibot sync: ${String(r.error??"failed")}`);return t?0:1}function Et(e){let t=me(e),r=cp(e),{digest:n,files:i}=GE(t),s={schema:KE,digest:n,files:i,updatedAt:new Date().toISOString()};YE(r,s);let o={...e,digest:n,updatedAt:s.updatedAt};return Io(o),{config:o,lock:s}}async function yp(e={}){try{let t=pp(e.cwd??process.cwd()),r=ii(t);if(r={...r,consumerRoot:t},e.from){let{sourceDir:u,config:p}=oi(r,e.from);if(!Eo(me(p),p.consumerRoot))throw new M("specDir escapes consumer root");let f=me(p),{copied:d}=si(u,f),{config:m,lock:g}=Et(p);return je(e,!0,{action:"push",mode:"local",from:u,to:f,copied:d,digest:g.digest,lockPath:m.lockPath},[`sync push: ${d.length} YAML file(s) ${u} → ${f}`,`digest: ${g.digest}`])}let n=hp(r,e);if(n&&!e.from){let u=e.fetchImpl??fetch,p=await mp({url:n.url,method:"GET",...n.bearer?{bearer:n.bearer}:{},fetchImpl:u}),f=me(n.config);if(!Eo(f,n.config.consumerRoot))throw new M("specDir escapes consumer root");let{copied:d}=JE(p.files,f),{config:m,lock:g}=Et(n.config);return je(e,!0,{action:"push",mode:"remote",from:n.url,to:f,copied:d,remoteDigest:p.digest,digest:g.digest,lockPath:m.lockPath,projectId:p.projectId},[`sync push (remote): ${d.length} YAML file(s) ${n.url} → ${f}`,`digest: ${g.digest}`])}let{sourceDir:i,config:s}=oi(r,e.from);if(!Eo(me(s),s.consumerRoot))throw new M("specDir escapes consumer root");let o=me(s),{copied:a}=si(i,o),{config:c,lock:l}=Et(s);return je(e,!0,{action:"push",mode:"local",from:i,to:o,copied:a,digest:l.digest,lockPath:c.lockPath},[`sync push: ${a.length} YAML file(s) ${i} → ${o}`,`digest: ${l.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return je(e,!1,{action:"push",error:r},[])}}async function bp(e={}){try{let t=pp(e.cwd??process.cwd()),r=ii(t);r={...r,consumerRoot:t};let n=e.to??e.from;if(n){let{sourceDir:f,config:d}=oi(r,n),m=me(d);if(!br(m))throw new M(`consumer specDir not found: ${m}`);We(f,{recursive:!0});let{copied:g}=si(m,f),{config:h,lock:b}=Et(d);return je(e,!0,{action:"pull",mode:"local",from:m,to:f,copied:g,digest:b.digest,lockPath:h.lockPath},[`sync pull: ${g.length} YAML file(s) ${m} → ${f}`,`digest: ${b.digest}`])}let i=hp(r,e);if(i){let f=me(i.config);if(!br(f))throw new M(`consumer specDir not found: ${f}`);let d=WE(f),m=e.fetchImpl??fetch,g=await mp({url:i.url,method:"PUT",...i.bearer?{bearer:i.bearer}:{},body:{schema:fp,files:d},fetchImpl:m}),{config:h,lock:b}=Et(i.config);return je(e,!0,{action:"pull",mode:"remote",from:f,to:i.url,copied:d.map((S)=>S.path),remoteDigest:g.digest,digest:b.digest,lockPath:h.lockPath,projectId:g.projectId},[`sync pull (remote): ${d.length} YAML file(s) ${f} → ${i.url}`,`digest: ${b.digest}`])}let s=e.to??e.from,{sourceDir:o,config:a}=oi(r,s),c=me(a);if(!br(c))throw new M(`consumer specDir not found: ${c}`);We(o,{recursive:!0});let{copied:l}=si(c,o),{config:u,lock:p}=Et(a);return je(e,!0,{action:"pull",mode:"local",from:c,to:o,copied:l,digest:p.digest,lockPath:u.lockPath},[`sync pull: ${l.length} YAML file(s) ${c} → ${o}`,`digest: ${p.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return je(e,!1,{action:"pull",error:r},[])}}var wp="uibot.resource.envelope.v1";class F extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceCliError"}}function Do(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},...e.agentKit?{agentKit:e.agentKit}:{},...e.tags.length?{tags:e.tags}:{},...e.capabilities.length?{capabilities:e.capabilities}:{},...e.dependencies.length?{dependencies:e.dependencies}:{},...e.solution?{solution:e.solution}:{},source:e.source,maturity:e.receipt.maturity,receiptLevel:e.receipt.level,...e.receipt.evidence.length?{evidence:e.receipt.evidence}:{}}}function ZE(e){return{id:e.resource.id,score:e.score,reasons:e.reasons,resource:Do(e.resource)}}function kp(){return typeof crypto.randomUUID==="function"?crypto.randomUUID():`resource-${Date.now().toString(36)}`}function Rp(e,t){return{dense:t,encoding:t?"dense-v1":"full",resourceIndexSchemaVersion:e.manifest().schemaVersion}}function eA(e,t,r,n){return{schemaVersion:wp,requestId:r.requestId??kp(),command:e,ok:!0,data:t,meta:Rp(r.queryService,n)}}function tA(e,t,r,n){let i=t instanceof Y||t instanceof F?t.code:"resource-cli-internal-error",s=t instanceof Y||t instanceof F?t.detail:"resource command failed";return{schemaVersion:wp,requestId:r.requestId??kp(),command:e,ok:!1,error:{code:i,message:`${i}: ${s}`,detail:s},meta:Rp(r.queryService,n)}}function Sr(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string")throw new F("resource-cli-invalid-argument",`--${t} requires a value`);let n=r.split(",").map((i)=>i.trim()).filter(Boolean);if(n.length===0)throw new F("resource-cli-invalid-argument",`--${t} is empty`);return n}function Sp(e,t,r){let n=Sr(e,t);if(!n)return;for(let i of n)if(!r.includes(i))throw new F("resource-cli-invalid-argument",`--${t}=${i}; expected one of ${r.join(",")}`);return n}function rA(e){let t=Sp(e,"kind",xr),r=Sr(e,"tag"),n=Sr(e,"category"),i=Sr(e,"capability"),s=Sp(e,"maturity",Pt),o=E(e,"limit"),a;if(e.limit!==void 0){if(!o||!/^\d+$/.test(o)||Number(o)<=0)throw new F("resource-cli-invalid-argument",`--limit=${o??"<missing>"}; expected a positive integer`);a=Number(o)}let c=e._.join(" ").trim();return{...c?{text:c}:{},...t?{kinds:t}:{},...r?{tags:r}:{},...Object.fromEntries([["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].flatMap(([l,u])=>{let p=Sr(e,l);return p?[[u,p]]:[]})),...n?{categories:n}:{},...i?{capabilities:i}:{},...s?{maturities:s}:{},...a!==void 0?{limit:a}:{}}}function nA(e,t,r){if(e==="manifest"){let n=t;for(let i of n.index.resources)r(`${i.id} ${i.kind} ${i.receipt.maturity} ${i.title}`);return}if(e==="search"){let n=t;for(let i of n.matches)r(`${i.resource.id} ${i.score} ${i.reasons.map((s)=>s.code).join(",")} ${i.resource.title}`);return}r(JSON.stringify(t,null,2))}async function Oo(e,t,r){let n=it(t),i=r.log??((u)=>console.log(u)),s=r.errorLog??((u)=>console.error(u)),o=n.dense,a=o===!0,c=E(n,"mode"),l=c??"text";try{let u=Ze.find((g)=>g.name===e),p=new Set([...e==="install-plan"?["export","verify","snapshot"]:[],"mode","dense",...u.options.map((g)=>g.name)]),f=Object.keys(n).find((g)=>g!=="_"&&!p.has(g));if(f)throw new F("resource-cli-invalid-argument",`unsupported flag --${f} for ${e}`);if(n.mode!==void 0&&c===void 0)throw new F("resource-cli-invalid-mode","--mode requires text or json");if(l!=="text"&&l!=="json")throw new F("resource-cli-invalid-mode",`${l}; expected text or json`);if(o!==void 0&&o!==!0)throw new F("resource-cli-invalid-argument","--dense does not take a value");if(r.sourceError)throw r.sourceError;let d;switch(e){case"manifest":{if(n._.length>0)throw new F("resource-cli-invalid-argument","manifest does not accept positionals");let g=r.queryService.manifest();d={operations:Ze,index:a?{schemaVersion:g.schemaVersion,resources:g.resources.map(Do),aliasLookup:Object.entries(g.aliases)}:g};break}case"search":{let g=r.queryService.search(rA(n));d={matches:a?g.map(ZE):g};break}case"get":{if(n._.length!==1)throw new F("resource-cli-invalid-argument","get requires exactly one id or quoted alias");let g=r.queryService.get(n._[0]);d={resource:a?Do(g):g};break}case"docs":case"examples":case"install-plan":{if(n._.length!==1)throw new F("resource-cli-invalid-argument",`${e} requires one resource id`);let g=n._[0],h=E(n,"snapshot");if(n.snapshot!==void 0&&(!h||!/^[a-f0-9]{64}$/.test(h)))throw new F("resource-cli-invalid-argument","--snapshot requires a SHA-256 identity");let b=(O,R)=>{let _=O;if(h&&(R?_.snapshot?.snapshotId:_.snapshotId)!==h)throw new F("resource-cli-invalid-argument","snapshot-identity-mismatch")},S=n.export!==void 0?"export":n.verify!==void 0?"verify":void 0;if(n.export!==void 0&&n.verify!==void 0)throw new F("resource-cli-invalid-argument","choose --export or --verify");if(S&&(!E(n,S)||!r.snapshotAction))throw new F("resource-cli-invalid-argument",`--${S} requires a directory and CLI snapshot support`);if(S==="verify"){try{d=await r.snapshotAction(S,E(n,S),g,null),b(d,!1)}catch(O){throw new F("resource-cli-invalid-argument",O instanceof Error?O.message:"snapshot verification failed")}break}let C=E(n,"locale")??"zh";if(e==="docs"&&C!=="zh"&&C!=="en")throw new F("resource-cli-invalid-argument","--locale requires zh or en");if(!(e==="docs"?r.queryService.docs:e==="examples"?r.queryService.examples:r.queryService.installPlan))throw new F("resource-cli-invalid-argument",`${e} is unavailable in this resource source`);let D=E(n,"page"),A=D===void 0?void 0:Number(D);if(n.page!==void 0&&(!Number.isSafeInteger(A)||(A??0)<1))throw new F("resource-cli-invalid-argument","--page requires a positive integer");if(d=e==="docs"?r.queryService.docs?.(g,C,A):e==="examples"?r.queryService.examples?.(g,A):r.queryService.installPlan?.(g),e==="install-plan")b(d,!0);if(S==="export")try{d=await r.snapshotAction(S,E(n,S),g,d)}catch(O){throw new F("resource-cli-invalid-argument",O instanceof Error?O.message:"snapshot export failed")}break}case"build":{d={plan:r.queryService.build(n._)};break}}let m=eA(e,d,r,a);if(l==="json")i(JSON.stringify(m));else nA(e,d,i);return 0}catch(u){let p=u instanceof Error?u:Error(String(u)),f=tA(e,p,r,a);if(l==="json"||c!==void 0)i(JSON.stringify(f));else s(f.error.message);return 1}}import{existsSync as iA,lstatSync as xp,mkdirSync as sA,readFileSync as To,writeFileSync as oA}from"node:fs";import{createServer as aA}from"node:http";import{once as cA}from"node:events";import{resolve as Ip,dirname as ci}from"node:path";var Ep=new TextDecoder("utf-8",{fatal:!0});function vp(e){try{return xp(e)}catch(t){if(t.code==="ENOENT")return;throw t}}async function Cp(e){if(e.protocol==="file:"){let a=To(e);if(a.length>16777216)throw Error("snapshot-file-too-large");return a}if(e.protocol!=="https:"&&!(e.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(e.hostname)))throw Error("snapshot-source-must-use-https-or-loopback");let t=await fetch(e,{signal:AbortSignal.timeout(1e4),redirect:"error"});if(!t.ok)throw Error(`snapshot-source-http-${t.status}`);let r=t.body?.getReader();if(!r)throw Error("snapshot-source-empty");let n=[],i=0;try{for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.byteLength,i>16777216)throw Error("snapshot-file-too-large");n.push(c)}}finally{await r.cancel()}let s=new Uint8Array(i),o=0;for(let a of n)s.set(a,o),o+=a.byteLength;return s}function Ap(e,t){if(e.byteLength>16777216)throw Error("snapshot-file-too-large");let r=JSON.parse(Ep.decode(e));return bi(r,t),r}function Pp(e,t){let r=Object.hasOwn(e.resources,t)?e.resources[t]:void 0;if(!r)throw Error(`snapshot-resource-unavailable: ${t}`);return[...r.closure.map((n)=>e.items[n].path),...e.licenseFiles.map((n)=>n.path)]}async function Dp(e,t,r){if(!e.snapshot)throw Error("snapshot-resource-unavailable");let n=new URL(e.snapshot.manifestPath,t),i=await Cp(n),s=Ap(i,e.snapshot.snapshotId),{snapshotId:o,manifestPath:a,...c}=e.snapshot;if(s.bundleHash!==e.release.sourceHash||de(s.resources[e.resourceId])!==de(c))throw Error("snapshot-bundle-mismatch");let l=new Map,u=i.byteLength;for(let m of Pp(s,e.resourceId)){let g=await Cp(new URL(m,n));if(u+=g.byteLength,u>134217728)throw Error("snapshot-total-budget-exceeded");l.set(m,g)}let p=Si(s,e.resourceId,l,e.snapshot.snapshotId);l.set("snapshot.json",i),l.set("selection.json",new TextEncoder().encode(de({schemaVersion:"uibot.distribution.selection.v1",resourceId:e.resourceId,snapshotId:s.snapshotId})));let f=Ip(r),d=[...l].map(([m,g])=>{let h=J(m,f,"distribution-snapshot"),b=ci(h);for(;;){let C=vp(b);if(C&&(!C.isDirectory()||C.isSymbolicLink()))throw Error("snapshot-invalid-destination");if(b===f||b===ci(b))break;b=ci(b)}let S=vp(h);if(S&&(!S.isFile()||S.size!==g.byteLength||nt(To(h))!==nt(g)))throw Error(`snapshot-local-file-conflict: ${m}`);return{target:h,bytes:g}});for(let{target:m,bytes:g}of d)if(sA(ci(m),{recursive:!0}),!iA(m))oA(m,g,{flag:"wx"});return{...p,directory:f,entrypoints:s.resources[e.resourceId].entrypoints}}function No(e,t){let r=Ip(e),n=(u)=>{let p=J(u,r,"distribution-snapshot"),f=xp(p);if(!f.isFile()||f.size>16777216)throw Error("snapshot-invalid-saved-file");return To(p)},i=JSON.parse(Ep.decode(n("selection.json")));if(i.schemaVersion!=="uibot.distribution.selection.v1"||t!==void 0&&t!==i.resourceId)throw Error("snapshot-selection-mismatch");let s=n("snapshot.json"),o=Ap(s,i.snapshotId),a=new Map,c=s.length;for(let u of Pp(o,i.resourceId)){let p=n(u);if(c+=p.length,c>134217728)throw Error("snapshot-total-budget-exceeded");a.set(u,p)}return{...Si(o,i.resourceId,a,i.snapshotId),entrypoints:o.resources[i.resourceId].entrypoints,files:a}}async function Op(e,t){let r=No(e),n=aA((o,a)=>{if(!["GET","HEAD"].includes(o.method??"")){a.writeHead(405).end();return}let c=r.files.get((o.url??"").split("?")[0].slice(1));if(!c){a.writeHead(404).end();return}a.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),a.end(o.method==="HEAD"?void 0:c)});n.listen(t,"127.0.0.1"),await cA(n,"listening");let i=n.address();if(!i||typeof i==="string")throw Error("snapshot-server-address-unavailable");let s=`http://127.0.0.1:${i.port}`;return{server:n,snapshotId:r.snapshotId,registry:{"@uibot":`${s}/r/{name}.json`},command:`bunx shadcn@4.23.0 add ${r.entrypoints.map((o)=>`${s}/r/${o}.json`).join(" ")}`}}async function lA(){let[e,t,r,n]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-shadcn/registry-source"),import("@uibot/blocks-studio"),import("@uibot/blocks-studio/registry-source")]);return jo([{sourceDir:t.SOURCE_DIR,blockFileMap:t.BLOCK_FILE,catalog:e.CATALOG_ENTRIES},{sourceDir:n.SOURCE_DIR,blockFileMap:n.BLOCK_FILE,catalog:r.STUDIO_CATALOG_ENTRIES}])}function oe(e,t){if(E(e,"mode")==="json")console.log(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:t}));else console.error(t);return 1}async function Tp(e){if(e[0]==="app")return Ad(e.slice(1));if(e[0]==="resource")return Tp(e.slice(1));let[t,...r]=e,n=it(r),i=E(n,"registry");switch(t){case"manifest":case"search":case"get":case"build":case"docs":case"examples":case"install-plan":{let s=E(n,"source"),o=r.indexOf("--source"),a=o>=0?r.filter((c,l)=>l!==o&&l!==o+1):r.filter((c)=>!c.startsWith("--source="));try{let c=await Cd(n.verify?void 0:s);return Oo(t,a,{queryService:c,snapshotAction:async(l,u,p,f)=>{if(l==="verify"){let{files:d,...m}=No(u,p);return m}return Dp(f,ao(s),u)}})}catch(c){return Oo(t,a,{queryService:{manifest:()=>({schemaVersion:"uibot.resource.index.v1",resources:[],aliases:{}}),search:()=>[],get:()=>{throw Error("unavailable")},build:()=>{throw Error("unavailable")}},sourceError:c instanceof Error?c:Error("resource source unavailable")})}}case"snapshot-serve":{if(n._.length!==1||Object.keys(n).some((c)=>!["_","port"].includes(c)))throw Error("snapshot-serve requires one directory and optional --port");let s=Number(E(n,"port")??"4444");if(!Number.isSafeInteger(s)||s<0||s>65535)throw Error("invalid snapshot server port");let{server:o,...a}=await Op(n._[0],s);return console.log(JSON.stringify(a,null,2)),await new Promise(()=>{}),0}case"list":return await Od({...i?{registry:i}:{}}),0;case"add":{let s=n._[0];if(!s)return oe(n,"uibot add: missing artifact <name>");return await Dd(s,{...i?{registry:i}:{},workspaceRoot:E(n,"cwd")??process.cwd()}),0}case"publish":{let s=await lA(),o=[],a=fr();if(a)o.push({dir:a});let c=co();if(c)o.push({dir:c,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let l=At(o);return await Nd({out:E(n,"out")??"dist/registry",manifestName:E(n,"name")??"uibot",sources:s,...l.length?{templates:l}:{}}),0}case"design-md":{if(n._[0]!=="sync")return oe(n,"uibot design-md: expected subcommand 'sync'");let o=E(n,"from");if(!o)return oe(n,"uibot design-md sync: missing --from <github:owner/repo|https-url>");let c=E(n,"mode")==="json"?"json":"text",l=E(n,"license"),{code:u}=await Ld({from:o,cwd:E(n,"cwd")??process.cwd(),mode:c,...l?{license:l}:{},dryRun:n["dry-run"]===!0});return u}case"regressions":{if(n._[0]!=="reverify")return oe(n,"uibot regressions: expected subcommand 'reverify'");let o=E(n,"mode")==="json"?"json":"text",a=E(n,"skill"),{code:c}=await zd({cwd:E(n,"cwd")??process.cwd(),mode:o,...a?{skillId:a}:{}});return c}case"skills":{let s=n._[0],o=n._[1],a=E(n,"mode")==="json"?"json":"text",c=E(n,"cwd")??process.cwd();if(s==="promote"){if(!o)return oe(n,"uibot skills promote: missing <id>");return Wd(o,{cwd:c,mode:a})}if(s==="rollback"){if(!o)return oe(n,"uibot skills rollback: missing <id>");return Qd(o,{cwd:c,mode:a})}return oe(n,"uibot skills: expected promote|rollback <id>")}case"project":{let s=n._[0],o=n._[1];if(s!=="export"||!o)return oe(n,"uibot project: expected export <dir>");let a=E(n,"mode")==="json"?"json":"text";return Xd(o,{cwd:E(n,"cwd")??process.cwd(),mode:a})}case"link":{let s=E(n,"spec-dir")??n._[0];if(!s||typeof s!=="string")return oe(n,"uibot link: missing --spec-dir <relative-dir> (or positional <spec-dir>)");let o=E(n,"source-dir"),a=E(n,"control-plane-url"),c=E(n,"project-id"),l=E(n,"lock-path"),{code:u}=ap({cwd:E(n,"cwd")??process.cwd(),specDir:s,...o?{sourceDir:o}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},...l?{lockPath:l}:{},force:n.force===!0,mode:E(n,"mode")==="json"?"json":"text"});return u}case"sync":{let s=n._[0];if(s!=="push"&&s!=="pull")return oe(n,"uibot sync: expected subcommand 'push' or 'pull'");let o=E(n,"mode")==="json"?"json":"text",a=E(n,"cwd")??process.cwd(),c=E(n,"from"),l=E(n,"to"),u=E(n,"control-plane-url"),p=E(n,"project-id");if(s==="push")return yp({cwd:a,mode:o,...c?{from:c}:{},...u?{controlPlaneUrl:u}:{},...p?{projectId:p}:{}});return bp({cwd:a,mode:o,...l?{to:l}:{},...c&&!l?{from:c}:{},...u?{controlPlaneUrl:u}:{},...p?{projectId:p}:{}})}case"doctor":{let s=E(n,"registry");return Zd({cwd:E(n,"cwd")??process.cwd(),mode:E(n,"mode")==="json"?"json":"text",...s?{registry:s}:{}})}case"init":{let s=E(n,"into");if(s){let c=E(n,"spec-path"),l=E(n,"mount-path"),{code:u}=ip({into:s,...c?{specPath:c}:{},...l?{mountPath:l}:{},force:n.force===!0,mode:E(n,"mode")==="json"?"json":"text"});return u}let o=n._[0];if(!o)return oe(n,"uibot init: missing <dir> (or use --into <existing-app>)");let a=E(n,"template");return await np({dir:o,...a?{template:a}:{}}),0}case"help":case"--help":case"-h":case void 0:return console.log(fo()),0;default:{let s=`uibot: unknown command '${t}'`;if(E(n,"mode")==="json")return oe(n,s);return console.error(`${s}
|
|
408
|
+
`),console.error(fo()),1}}}if(Qe.main==Qe.module)Tp(process.argv.slice(2)).then((e)=>{if(e!==0)process.exit(e)}).catch((e)=>{console.error(e instanceof Error?e.message:String(e)),process.exit(1)});export{Tp as main};
|