view-contracts 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/view-contracts.bundle.mjs +148 -153
  2. package/dist/view-contracts.bundle.mjs.map +4 -4
  3. package/package.json +10 -4
  4. package/renderers/react/README.md +19 -3
  5. package/renderers/react/element-config.meta.json +23 -0
  6. package/renderers/react/elementMap.ts +55 -0
  7. package/renderers/react/elements.yaml +87 -0
  8. package/renderers/react/index.ts +2 -0
  9. package/renderers/react/lowering/lowerToJsx.ts +397 -0
  10. package/renderers/react/paths.ts +10 -0
  11. package/renderers/react/renderComponents.ts +65 -0
  12. package/renderers/react/renderRuntime.ts +134 -0
  13. package/renderers/react/routes.yaml +3 -2
  14. package/{src/renderer → renderers}/react/runtime/actionRuntime.ts +3 -3
  15. package/renderers/react/runtime/dispatch.ts +21 -0
  16. package/renderers/react/runtime/index.ts +5 -0
  17. package/{src/renderer → renderers}/react/runtime/style.ts +35 -8
  18. package/renderers/react/runtime/types.ts +63 -0
  19. package/renderers/react/templates/components-index.ts.hbs +5 -0
  20. package/renderers/react/templates/dispatch.ts.hbs +22 -0
  21. package/renderers/react/templates/handlers.ts.hbs +4 -0
  22. package/renderers/react/templates/runtime-types.ts.hbs +5 -0
  23. package/renderers/react/templates/style-helpers.ts.hbs +2 -0
  24. package/renderers/react/templates/theme.css.hbs +2 -0
  25. package/src/generated/schema/lowering-style-properties.ts +36 -0
  26. package/src/generated/schema/react-renderer-element-config.ts +26 -0
  27. package/src/renderer/react/runtime/components.tsx +0 -216
  28. package/src/renderer/react/runtime/index.ts +0 -4
  29. package/src/renderer/react/runtime/shared.tsx +0 -53
  30. package/src/renderer/react/runtime/types.ts +0 -46
  31. /package/{src/renderer → renderers}/react/runtime/theme.css +0 -0
@@ -1,32 +1,54 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __banner_createRequire } from 'module';
3
3
  const require = __banner_createRequire(import.meta.url);
4
- var fi=Object.create;var Kn=Object.defineProperty;var di=Object.getOwnPropertyDescriptor;var mi=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,gi=Object.prototype.hasOwnProperty;var Ne=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var ge=(o,e)=>()=>{try{return e||o((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var wi=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of mi(e))!gi.call(o,r)&&r!==t&&Kn(o,r,{get:()=>e[r],enumerable:!(i=di(e,r))||i.enumerable});return o};var xi=(o,e,t)=>(t=o!=null?fi(hi(o)):{},wi(e||!o||!o.__esModule?Kn(t,"default",{value:o,enumerable:!0}):t,o));var Re=ge(yn=>{var Ze=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},xn=class extends Ze{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};yn.CommanderError=Ze;yn.InvalidArgumentError=xn});var en=ge(vn=>{var{InvalidArgumentError:yi}=Re(),_n=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new yi(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _i(o){let e=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+e+">":"["+e+"]"}vn.Argument=_n;vn.humanReadableArgName=_i});var bn=ge(An=>{var{humanReadableArgName:vi}=en(),Cn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(r=>!r._hidden),i=e._getHelpCommand();return i&&!i._hidden&&t.push(i),this.sortSubcommands&&t.sort((r,a)=>r.name().localeCompare(a.name())),t}compareOptions(e,t){let i=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");return i(e).localeCompare(i(t))}visibleOptions(e){let t=e.options.filter(r=>!r.hidden),i=e._getHelpOption();if(i&&!i.hidden){let r=i.short&&e._findOption(i.short),a=i.long&&e._findOption(i.long);!r&&!a?t.push(i):i.long&&!a?t.push(e.createOption(i.long,i.description)):i.short&&!r&&t.push(e.createOption(i.short,i.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let i=e.parent;i;i=i.parent){let r=i.options.filter(a=>!a.hidden);t.push(...r)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(i=>vi(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,r)=>Math.max(i,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(r)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,r)=>Math.max(i,this.displayWidth(t.styleOptionTerm(t.optionTerm(r)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((i,r)=>Math.max(i,this.displayWidth(t.styleOptionTerm(t.optionTerm(r)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,r)=>Math.max(i,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(r)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let r=e.parent;r;r=r.parent)i=r.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,t,i){return t.length===0?[]:[i.styleTitle(e),...t,""]}groupItems(e,t,i){let r=new Map;return e.forEach(a=>{let c=i(a);r.has(c)||r.set(c,[])}),t.forEach(a=>{let c=i(a);r.has(c)||r.set(c,[]),r.get(c).push(a)}),r}formatHelp(e,t){let i=t.padWidth(e,t),r=t.helpWidth??80;function a(u,f){return t.formatItem(u,i,f,t)}let c=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],l=t.commandDescription(e);l.length>0&&(c=c.concat([t.boxWrap(t.styleCommandDescription(l),r),""]));let p=t.visibleArguments(e).map(u=>a(t.styleArgumentTerm(t.argumentTerm(u)),t.styleArgumentDescription(t.argumentDescription(u))));if(c=c.concat(this.formatItemList("Arguments:",p,t)),this.groupItems(e.options,t.visibleOptions(e),u=>u.helpGroupHeading??"Options:").forEach((u,f)=>{let E=u.map(k=>a(t.styleOptionTerm(t.optionTerm(k)),t.styleOptionDescription(t.optionDescription(k))));c=c.concat(this.formatItemList(f,E,t))}),t.showGlobalOptions){let u=t.visibleGlobalOptions(e).map(f=>a(t.styleOptionTerm(t.optionTerm(f)),t.styleOptionDescription(t.optionDescription(f))));c=c.concat(this.formatItemList("Global Options:",u,t))}return this.groupItems(e.commands,t.visibleCommands(e),u=>u.helpGroup()||"Commands:").forEach((u,f)=>{let E=u.map(k=>a(t.styleSubcommandTerm(t.subcommandTerm(k)),t.styleSubcommandDescription(t.subcommandDescription(k))));c=c.concat(this.formatItemList(f,E,t))}),c.join(`
5
- `)}displayWidth(e){return zn(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,i,r){let c=" ".repeat(2);if(!i)return c+e;let l=e.padEnd(t+e.length-r.displayWidth(e)),p=2,h=(this.helpWidth??80)-t-p-2,u;return h<this.minWidthToWrap||r.preformatted(i)?u=i:u=r.boxWrap(i,h).replace(/\n/g,`
6
- `+" ".repeat(t+p)),c+l+" ".repeat(p)+u.replace(/\n/g,`
7
- ${c}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,a=[];return i.forEach(c=>{let l=c.match(r);if(l===null){a.push("");return}let p=[l.shift()],m=this.displayWidth(p[0]);l.forEach(h=>{let u=this.displayWidth(h);if(m+u<=t){p.push(h),m+=u;return}a.push(p.join(""));let f=h.trimStart();p=[f],m=this.displayWidth(f)}),a.push(p.join(""))}),a.join(`
8
- `)}};function zn(o){let e=/\x1b\[\d*(;\d*)*m/g;return o.replace(e,"")}An.Help=Cn;An.stripColor=zn});var In=ge(Sn=>{var{InvalidArgumentError:Ci}=Re(),On=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=Ai(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new Ci(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Xn(this.name().replace(/^no-/,"")):Xn(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},En=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){let i=t.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,a=r!==void 0?r:!1;return t.negate===(a===e)}};function Xn(o){return o.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Ai(o){let e,t,i=/^-[^-]$/,r=/^--[^-]/,a=o.split(/[ |,]+/).concat("guard");if(i.test(a[0])&&(e=a.shift()),r.test(a[0])&&(t=a.shift()),!e&&i.test(a[0])&&(e=a.shift()),!e&&r.test(a[0])&&(e=t,t=a.shift()),a[0].startsWith("-")){let c=a[0],l=`option creation failed due to '${c}' in option flags '${o}'`;throw/^-[^-][^-]/.test(c)?new Error(`${l}
4
+ var Ka=Object.create;var Ni=Object.defineProperty;var za=Object.getOwnPropertyDescriptor;var Qa=Object.getOwnPropertyNames;var Xa=Object.getPrototypeOf,Za=Object.prototype.hasOwnProperty;var we=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var D=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var el=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qa(e))!Za.call(n,i)&&i!==t&&Ni(n,i,{get:()=>e[i],enumerable:!(r=za(e,i))||r.enumerable});return n};var Ri=(n,e,t)=>(t=n!=null?Ka(Xa(n)):{},el(e||!n||!n.__esModule?Ni(t,"default",{value:n,enumerable:!0}):t,n));var At=D(ar=>{var sn=class extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},sr=class extends sn{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};ar.CommanderError=sn;ar.InvalidArgumentError=sr});var an=D(cr=>{var{InvalidArgumentError:tl}=At(),lr=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new tl(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function nl(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}cr.Argument=lr;cr.humanReadableArgName=nl});var fr=D(pr=>{var{humanReadableArgName:rl}=an(),ur=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!i&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!i&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let i=r.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>rl(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return t.length===0?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let i=new Map;return e.forEach(s=>{let a=r(s);i.has(a)||i.set(a,[])}),t.forEach(s=>{let a=r(s);i.has(a)||i.set(a,[]),i.get(a).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(u,d){return t.formatItem(u,r,d,t)}let a=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],l=t.commandDescription(e);l.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(l),i),""]));let p=t.visibleArguments(e).map(u=>s(t.styleArgumentTerm(t.argumentTerm(u)),t.styleArgumentDescription(t.argumentDescription(u))));if(a=a.concat(this.formatItemList("Arguments:",p,t)),this.groupItems(e.options,t.visibleOptions(e),u=>u.helpGroupHeading??"Options:").forEach((u,d)=>{let v=u.map(E=>s(t.styleOptionTerm(t.optionTerm(E)),t.styleOptionDescription(t.optionDescription(E))));a=a.concat(this.formatItemList(d,v,t))}),t.showGlobalOptions){let u=t.visibleGlobalOptions(e).map(d=>s(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));a=a.concat(this.formatItemList("Global Options:",u,t))}return this.groupItems(e.commands,t.visibleCommands(e),u=>u.helpGroup()||"Commands:").forEach((u,d)=>{let v=u.map(E=>s(t.styleSubcommandTerm(t.subcommandTerm(E)),t.styleSubcommandDescription(t.subcommandDescription(E))));a=a.concat(this.formatItemList(d,v,t))}),a.join(`
5
+ `)}displayWidth(e){return Mi(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,i){let a=" ".repeat(2);if(!r)return a+e;let l=e.padEnd(t+e.length-i.displayWidth(e)),p=2,h=(this.helpWidth??80)-t-p-2,u;return h<this.minWidthToWrap||i.preformatted(r)?u=r:u=i.boxWrap(r,h).replace(/\n/g,`
6
+ `+" ".repeat(t+p)),a+l+" ".repeat(p)+u.replace(/\n/g,`
7
+ ${a}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return r.forEach(a=>{let l=a.match(i);if(l===null){s.push("");return}let p=[l.shift()],c=this.displayWidth(p[0]);l.forEach(h=>{let u=this.displayWidth(h);if(c+u<=t){p.push(h),c+=u;return}s.push(p.join(""));let d=h.trimStart();p=[d],c=this.displayWidth(d)}),s.push(p.join(""))}),s.join(`
8
+ `)}};function Mi(n){let e=/\x1b\[\d*(;\d*)*m/g;return n.replace(e,"")}pr.Help=ur;pr.stripColor=Mi});var gr=D(mr=>{var{InvalidArgumentError:il}=At(),hr=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=ol(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new il(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ti(this.name().replace(/^no-/,"")):Ti(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},dr=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let i=this.negativeOptions.get(r).presetArg,s=i!==void 0?i:!1;return t.negate===(s===e)}};function Ti(n){return n.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ol(n){let e,t,r=/^-[^-]$/,i=/^--[^-]/,s=n.split(/[ |,]+/).concat("guard");if(r.test(s[0])&&(e=s.shift()),i.test(s[0])&&(t=s.shift()),!e&&r.test(s[0])&&(e=s.shift()),!e&&i.test(s[0])&&(e=t,t=s.shift()),s[0].startsWith("-")){let a=s[0],l=`option creation failed due to '${a}' in option flags '${n}'`;throw/^-[^-][^-]/.test(a)?new Error(`${l}
9
9
  - a short flag is a single dash and a single character
10
10
  - either use a single dash and a single character (for a short flag)
11
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(c)?new Error(`${l}
12
- - too many short flags`):r.test(c)?new Error(`${l}
11
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(a)?new Error(`${l}
12
+ - too many short flags`):i.test(a)?new Error(`${l}
13
13
  - too many long flags`):new Error(`${l}
14
- - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${o}'.`);return{shortFlag:e,longFlag:t}}Sn.Option=On;Sn.DualOptions=En});var Zn=ge(Qn=>{function bi(o,e){if(Math.abs(o.length-e.length)>3)return Math.max(o.length,e.length);let t=[];for(let i=0;i<=o.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=o.length;r++){let a=1;o[r-1]===e[i-1]?a=0:a=1,t[r][i]=Math.min(t[r-1][i]+1,t[r][i-1]+1,t[r-1][i-1]+a),r>1&&i>1&&o[r-1]===e[i-2]&&o[r-2]===e[i-1]&&(t[r][i]=Math.min(t[r][i],t[r-2][i-2]+1))}return t[o.length][e.length]}function Oi(o,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=o.startsWith("--");t&&(o=o.slice(2),e=e.map(c=>c.slice(2)));let i=[],r=3,a=.4;return e.forEach(c=>{if(c.length<=1)return;let l=bi(o,c),p=Math.max(o.length,c.length);(p-l)/p>a&&(l<r?(r=l,i=[c]):l===r&&i.push(c))}),i.sort((c,l)=>c.localeCompare(l)),t&&(i=i.map(c=>`--${c}`)),i.length>1?`
15
- (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
16
- (Did you mean ${i[0]}?)`:""}Qn.suggestSimilar=Oi});var it=ge(Rn=>{var Ei=Ne("node:events").EventEmitter,Tn=Ne("node:child_process"),le=Ne("node:path"),nn=Ne("node:fs"),M=Ne("node:process"),{Argument:Si,humanReadableArgName:Ii}=en(),{CommanderError:kn}=Re(),{Help:Ti,stripColor:ki}=bn(),{Option:et,DualOptions:Pi}=In(),{suggestSimilar:nt}=Zn(),Pn=class o extends Ei{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>M.stdout.write(t),writeErr:t=>M.stderr.write(t),outputError:(t,i)=>i(t),getOutHelpWidth:()=>M.stdout.isTTY?M.stdout.columns:void 0,getErrHelpWidth:()=>M.stderr.isTTY?M.stderr.columns:void 0,getOutHasColors:()=>Nn()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>Nn()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:t=>ki(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,i){let r=t,a=i;typeof r=="object"&&r!==null&&(a=r,r=null),a=a||{};let[,c,l]=e.match(/([^ ]+) *(.*)/),p=this.createCommand(c);return r&&(p.description(r),p._executableHandler=!0),a.isDefault&&(this._defaultCommandName=p._name),p._hidden=!!(a.noHelp||a.hidden),p._executableFile=a.executableFile||null,l&&p.arguments(l),this._registerCommand(p),p.parent=this,p.copyInheritedSettings(this),r?this:p}createCommand(e){return new o(e)}createHelp(){return Object.assign(new Ti,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
17
- - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Si(e,t)}argument(e,t,i,r){let a=this.createArgument(e,t);return typeof i=="function"?a.default(r).argParser(i):a.default(i),this.addArgument(a),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,r,a]=i.match(/([^ ]+) *(.*)/),c=t??"display help for command",l=this.createCommand(r);return l.helpOption(!1),a&&l.arguments(a),c&&l.description(c),this._addImplicitHelpCommand=!0,this._helpCommand=l,(e||t)&&this._initCommandGroup(l),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
18
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,i){this._exitCallback&&this._exitCallback(new kn(e,t,i)),M.exit(e)}action(e){let t=i=>{let r=this.registeredArguments.length,a=i.slice(0,r);return this._storeOptionsAsProperties?a[r]=this:a[r]=this.opts(),a.push(this),e.apply(this,a)};return this._actionHandler=t,this}createOption(e,t){return new et(e,t)}_callParseArg(e,t,i,r){try{return e.parseArg(t,i)}catch(a){if(a.code==="commander.invalidArgument"){let c=`${r} ${a.message}`;this.error(c,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
19
- - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=r=>[r.name()].concat(r.aliases()),i=t(e).find(r=>this._findCommand(r));if(i){let r=t(this._findCommand(i)).join("|"),a=t(e).join("|");throw new Error(`cannot add command '${a}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),i=e.attributeName();if(e.negate){let a=e.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let r=(a,c,l)=>{a==null&&e.presetArg!==void 0&&(a=e.presetArg);let p=this.getOptionValue(i);a!==null&&e.parseArg?a=this._callParseArg(e,a,p,c):a!==null&&e.variadic&&(a=e._collectValue(a,p)),a==null&&(e.negate?a=!1:e.isBoolean()||e.optional?a=!0:a=""),this.setOptionValueWithSource(i,a,l)};return this.on("option:"+t,a=>{let c=`error: option '${e.flags}' argument '${a}' is invalid.`;r(a,c,"cli")}),e.envVar&&this.on("optionEnv:"+t,a=>{let c=`error: option '${e.flags}' value '${a}' from env '${e.envVar}' is invalid.`;r(a,c,"env")}),this}_optionEx(e,t,i,r,a){if(typeof t=="object"&&t instanceof et)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(t,i);if(c.makeOptionMandatory(!!e.mandatory),typeof r=="function")c.default(a).argParser(r);else if(r instanceof RegExp){let l=r;r=(p,m)=>{let h=l.exec(p);return h?h[0]:m},c.default(a).argParser(r)}else c.default(r);return this.addOption(c)}option(e,t,i,r){return this._optionEx({},e,t,i,r)}requiredOption(e,t,i,r){return this._optionEx({mandatory:!0},e,t,i,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,i){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(t=i.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){M.versions?.electron&&(t.from="electron");let r=M.execArgv??[];(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))&&(t.from="eval")}e===void 0&&(e=M.argv),this.rawArgs=e.slice();let i;switch(t.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":M.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,t){this._prepareForParse();let i=this._prepareUserArgs(e,t);return this._parseCommand([],i),this}async parseAsync(e,t){this._prepareForParse();let i=this._prepareUserArgs(e,t);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
20
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,i){if(nn.existsSync(e))return;let r=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${e}' does not exist
21
- - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
14
+ - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${n}'.`);return{shortFlag:e,longFlag:t}}mr.Option=hr;mr.DualOptions=dr});var Vi=D(Di=>{function sl(n,e){if(Math.abs(n.length-e.length)>3)return Math.max(n.length,e.length);let t=[];for(let r=0;r<=n.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=e.length;r++)for(let i=1;i<=n.length;i++){let s=1;n[i-1]===e[r-1]?s=0:s=1,t[i][r]=Math.min(t[i-1][r]+1,t[i][r-1]+1,t[i-1][r-1]+s),i>1&&r>1&&n[i-1]===e[r-2]&&n[i-2]===e[r-1]&&(t[i][r]=Math.min(t[i][r],t[i-2][r-2]+1))}return t[n.length][e.length]}function al(n,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=n.startsWith("--");t&&(n=n.slice(2),e=e.map(a=>a.slice(2)));let r=[],i=3,s=.4;return e.forEach(a=>{if(a.length<=1)return;let l=sl(n,a),p=Math.max(n.length,a.length);(p-l)/p>s&&(l<i?(i=l,r=[a]):l===i&&r.push(a))}),r.sort((a,l)=>a.localeCompare(l)),t&&(r=r.map(a=>`--${a}`)),r.length>1?`
15
+ (Did you mean one of ${r.join(", ")}?)`:r.length===1?`
16
+ (Did you mean ${r[0]}?)`:""}Di.suggestSimilar=al});var qi=D(br=>{var ll=we("node:events").EventEmitter,vr=we("node:child_process"),Re=we("node:path"),ln=we("node:fs"),q=we("node:process"),{Argument:cl,humanReadableArgName:ul}=an(),{CommanderError:_r}=At(),{Help:pl,stripColor:fl}=fr(),{Option:Fi,DualOptions:hl}=gr(),{suggestSimilar:Hi}=Vi(),yr=class n extends ll{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>q.stdout.write(t),writeErr:t=>q.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>q.stdout.isTTY?q.stdout.columns:void 0,getErrHelpWidth:()=>q.stderr.isTTY?q.stderr.columns:void 0,getOutHasColors:()=>wr()??(q.stdout.isTTY&&q.stdout.hasColors?.()),getErrHasColors:()=>wr()??(q.stderr.isTTY&&q.stderr.hasColors?.()),stripColor:t=>fl(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let i=t,s=r;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,a,l]=e.match(/([^ ]+) *(.*)/),p=this.createCommand(a);return i&&(p.description(i),p._executableHandler=!0),s.isDefault&&(this._defaultCommandName=p._name),p._hidden=!!(s.noHelp||s.hidden),p._executableFile=s.executableFile||null,l&&p.arguments(l),this._registerCommand(p),p.parent=this,p.copyInheritedSettings(this),i?this:p}createCommand(e){return new n(e)}createHelp(){return Object.assign(new pl,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
17
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new cl(e,t)}argument(e,t,r,i){let s=this.createArgument(e,t);return typeof r=="function"?s.default(i).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let r=e??"help [command]",[,i,s]=r.match(/([^ ]+) *(.*)/),a=t??"display help for command",l=this.createCommand(i);return l.helpOption(!1),s&&l.arguments(s),a&&l.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=l,(e||t)&&this._initCommandGroup(l),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
18
+ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new _r(e,t,r)),q.exit(e)}action(e){let t=r=>{let i=this.registeredArguments.length,s=r.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new Fi(e,t)}_callParseArg(e,t,r,i){try{return e.parseArg(t,r)}catch(s){if(s.code==="commander.invalidArgument"){let a=`${i} ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
19
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),r=t(e).find(i=>this._findCommand(i));if(r){let i=t(this._findCommand(r)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");let i=(s,a,l)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let p=this.getOptionValue(r);s!==null&&e.parseArg?s=this._callParseArg(e,s,p,a):s!==null&&e.variadic&&(s=e._collectValue(s,p)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(r,s,l)};return this.on("option:"+t,s=>{let a=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,a,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let a=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,a,"env")}),this}_optionEx(e,t,r,i,s){if(typeof t=="object"&&t instanceof Fi)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(t,r);if(a.makeOptionMandatory(!!e.mandatory),typeof i=="function")a.default(s).argParser(i);else if(i instanceof RegExp){let l=i;i=(p,c)=>{let h=l.exec(p);return h?h[0]:c},a.default(s).argParser(i)}else a.default(i);return this.addOption(a)}option(e,t,r,i){return this._optionEx({},e,t,r,i)}requiredOption(e,t,r,i){return this._optionEx({mandatory:!0},e,t,r,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(e)!==void 0&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){q.versions?.electron&&(t.from="electron");let i=q.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(t.from="eval")}e===void 0&&(e=q.argv),this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":q.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
20
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(ln.existsSync(e))return;let i=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
21
+ - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
22
22
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
23
- - ${r}`;throw new Error(a)}_executeSubCommand(e,t){t=t.slice();let i=!1,r=[".js",".ts",".tsx",".mjs",".cjs"];function a(h,u){let f=le.resolve(h,u);if(nn.existsSync(f))return f;if(r.includes(le.extname(u)))return;let E=r.find(k=>nn.existsSync(`${f}${k}`));if(E)return`${f}${E}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=e._executableFile||`${this._name}-${e._name}`,l=this._executableDir||"";if(this._scriptPath){let h;try{h=nn.realpathSync(this._scriptPath)}catch{h=this._scriptPath}l=le.resolve(le.dirname(h),l)}if(l){let h=a(l,c);if(!h&&!e._executableFile&&this._scriptPath){let u=le.basename(this._scriptPath,le.extname(this._scriptPath));u!==this._name&&(h=a(l,`${u}-${e._name}`))}c=h||c}i=r.includes(le.extname(c));let p;M.platform!=="win32"?i?(t.unshift(c),t=tt(M.execArgv).concat(t),p=Tn.spawn(M.argv[0],t,{stdio:"inherit"})):p=Tn.spawn(c,t,{stdio:"inherit"}):(this._checkForMissingExecutable(c,l,e._name),t.unshift(c),t=tt(M.execArgv).concat(t),p=Tn.spawn(M.execPath,t,{stdio:"inherit"})),p.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{M.on(u,()=>{p.killed===!1&&p.exitCode===null&&p.kill(u)})});let m=this._exitCallback;p.on("close",h=>{h=h??1,m?m(new kn(h,"commander.executeSubCommandAsync","(close)")):M.exit(h)}),p.on("error",h=>{if(h.code==="ENOENT")this._checkForMissingExecutable(c,l,e._name);else if(h.code==="EACCES")throw new Error(`'${c}' not executable`);if(!m)M.exit(1);else{let u=new kn(1,"commander.executeSubCommandAsync","(error)");u.nestedError=h,m(u)}}),this.runningCommand=p}_dispatchSubcommand(e,t,i){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,r,"preSubcommand"),a=this._chainOrCall(a,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(i));else return r._parseCommand(t,i)}),a}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,r,a)=>{let c=r;if(r!==null&&i.parseArg){let l=`error: command-argument value '${r}' is invalid for argument '${i.name()}'.`;c=this._callParseArg(i,r,a,l)}return c};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((i,r)=>{let a=i.defaultValue;i.variadic?r<this.args.length?(a=this.args.slice(r),i.parseArg&&(a=a.reduce((c,l)=>e(i,l,c),i.defaultValue))):a===void 0&&(a=[]):r<this.args.length&&(a=this.args[r],i.parseArg&&(a=e(i,a,i.defaultValue))),t[r]=a}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let i=e,r=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[t]!==void 0).forEach(a=>{a._lifeCycleHooks[t].forEach(c=>{r.push({hookedCommand:a,callback:c})})}),t==="postAction"&&r.reverse(),r.forEach(a=>{i=this._chainOrCall(i,()=>a.callback(a.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,t,i){let r=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(a=>{r=this._chainOrCall(r,()=>a(this,t))}),r}_parseCommand(e,t){let i=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),t=i.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let c;return c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent&&(c=this._chainOrCall(c,()=>{this.parent.emit(a,e,t)})),c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent?.listenerCount(a))r(),this._processArguments(),this.parent.emit(a,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let r=i.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let r=e.find(a=>i.conflictsWith.includes(a.attributeName()));r&&this._conflictingOption(i,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],i=[],r=t;function a(h){return h.length>1&&h[0]==="-"}let c=h=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(h)?!this._getCommandAndAncestors().some(u=>u.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,l=null,p=null,m=0;for(;m<e.length||p;){let h=p??e[m++];if(p=null,h==="--"){r===i&&r.push(h),r.push(...e.slice(m));break}if(l&&(!a(h)||c(h))){this.emit(`option:${l.name()}`,h);continue}if(l=null,a(h)){let u=this._findOption(h);if(u){if(u.required){let f=e[m++];f===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,f)}else if(u.optional){let f=null;m<e.length&&(!a(e[m])||c(e[m]))&&(f=e[m++]),this.emit(`option:${u.name()}`,f)}else this.emit(`option:${u.name()}`);l=u.variadic?u:null;continue}}if(h.length>2&&h[0]==="-"&&h[1]!=="-"){let u=this._findOption(`-${h[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,h.slice(2)):(this.emit(`option:${u.name()}`),p=`-${h.slice(2)}`);continue}}if(/^--[^=]+=/.test(h)){let u=h.indexOf("="),f=this._findOption(h.slice(0,u));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,h.slice(u+1));continue}}if(r===t&&a(h)&&!(this.commands.length===0&&c(h))&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&i.length===0){if(this._findCommand(h)){t.push(h),i.push(...e.slice(m));break}else if(this._getHelpCommand()&&h===this._getHelpCommand().name()){t.push(h,...e.slice(m));break}else if(this._defaultCommandName){i.push(h,...e.slice(m));break}}if(this._passThroughOptions){r.push(h,...e.slice(m));break}r.push(h)}return{operands:t,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let i=0;i<t;i++){let r=this.options[i].attributeName();e[r]=r===this._versionOptionName?this._version:this[r]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
23
+ - ${i}`;throw new Error(s)}_executeSubCommand(e,t){t=t.slice();let r=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(h,u){let d=Re.resolve(h,u);if(ln.existsSync(d))return d;if(i.includes(Re.extname(u)))return;let v=i.find(E=>ln.existsSync(`${d}${E}`));if(v)return`${d}${v}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=e._executableFile||`${this._name}-${e._name}`,l=this._executableDir||"";if(this._scriptPath){let h;try{h=ln.realpathSync(this._scriptPath)}catch{h=this._scriptPath}l=Re.resolve(Re.dirname(h),l)}if(l){let h=s(l,a);if(!h&&!e._executableFile&&this._scriptPath){let u=Re.basename(this._scriptPath,Re.extname(this._scriptPath));u!==this._name&&(h=s(l,`${u}-${e._name}`))}a=h||a}r=i.includes(Re.extname(a));let p;q.platform!=="win32"?r?(t.unshift(a),t=Bi(q.execArgv).concat(t),p=vr.spawn(q.argv[0],t,{stdio:"inherit"})):p=vr.spawn(a,t,{stdio:"inherit"}):(this._checkForMissingExecutable(a,l,e._name),t.unshift(a),t=Bi(q.execArgv).concat(t),p=vr.spawn(q.execPath,t,{stdio:"inherit"})),p.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{q.on(u,()=>{p.killed===!1&&p.exitCode===null&&p.kill(u)})});let c=this._exitCallback;p.on("close",h=>{h=h??1,c?c(new _r(h,"commander.executeSubCommandAsync","(close)")):q.exit(h)}),p.on("error",h=>{if(h.code==="ENOENT")this._checkForMissingExecutable(a,l,e._name);else if(h.code==="EACCES")throw new Error(`'${a}' not executable`);if(!c)q.exit(1);else{let u=new _r(1,"commander.executeSubCommandAsync","(error)");u.nestedError=h,c(u)}}),this.runningCommand=p}_dispatchSubcommand(e,t,r){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(r));else return i._parseCommand(t,r)}),s}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,i,s)=>{let a=i;if(i!==null&&r.parseArg){let l=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;a=this._callParseArg(r,i,s,l)}return a};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,i)=>{let s=r.defaultValue;r.variadic?i<this.args.length?(s=this.args.slice(i),r.parseArg&&(s=s.reduce((a,l)=>e(r,l,a),r.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],r.parseArg&&(s=e(r,s,r.defaultValue))),t[i]=s}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(a=>{i.push({hookedCommand:s,callback:a})})}),t==="postAction"&&i.reverse(),i.forEach(s=>{r=this._chainOrCall(r,()=>s.callback(s.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let i=e;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(s=>{i=this._chainOrCall(i,()=>s(this,t))}),i}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(s,e,t)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(r=>{let i=r.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(r=>r.conflictsWith.length>0).forEach(r=>{let i=e.find(s=>r.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(r,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],i=t;function s(h){return h.length>1&&h[0]==="-"}let a=h=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(h)?!this._getCommandAndAncestors().some(u=>u.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,l=null,p=null,c=0;for(;c<e.length||p;){let h=p??e[c++];if(p=null,h==="--"){i===r&&i.push(h),i.push(...e.slice(c));break}if(l&&(!s(h)||a(h))){this.emit(`option:${l.name()}`,h);continue}if(l=null,s(h)){let u=this._findOption(h);if(u){if(u.required){let d=e[c++];d===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,d)}else if(u.optional){let d=null;c<e.length&&(!s(e[c])||a(e[c]))&&(d=e[c++]),this.emit(`option:${u.name()}`,d)}else this.emit(`option:${u.name()}`);l=u.variadic?u:null;continue}}if(h.length>2&&h[0]==="-"&&h[1]!=="-"){let u=this._findOption(`-${h[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,h.slice(2)):(this.emit(`option:${u.name()}`),p=`-${h.slice(2)}`);continue}}if(/^--[^=]+=/.test(h)){let u=h.indexOf("="),d=this._findOption(h.slice(0,u));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,h.slice(u+1));continue}}if(i===t&&s(h)&&!(this.commands.length===0&&a(h))&&(i=r),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(h)){t.push(h),r.push(...e.slice(c));break}else if(this._getHelpCommand()&&h===this._getHelpCommand().name()){t.push(h,...e.slice(c));break}else if(this._defaultCommandName){r.push(h,...e.slice(c));break}}if(this._passThroughOptions){i.push(h,...e.slice(c));break}i.push(h)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let i=this.options[r].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
24
24
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
25
25
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
26
- `),this.outputHelp({error:!0}));let i=t||{},r=i.exitCode||1,a=i.code||"commander.error";this._exit(r,a,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in M.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,M.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Pi(this.options),t=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&t(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(r=>!t(r)).forEach(r=>{this.setOptionValueWithSource(r,i.implied[r],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let i=c=>{let l=c.attributeName(),p=this.getOptionValue(l),m=this.options.find(u=>u.negate&&l===u.attributeName()),h=this.options.find(u=>!u.negate&&l===u.attributeName());return m&&(m.presetArg===void 0&&p===!1||m.presetArg!==void 0&&p===m.presetArg)?m:h||c},r=c=>{let l=i(c),p=l.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${l.envVar}'`:`option '${l.flags}'`},a=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],a=this;do{let c=a.createHelp().visibleOptions(a).filter(l=>l.long).map(l=>l.long);r=r.concat(c),a=a.parent}while(a&&!a._enablePositionalOptions);t=nt(e,r)}let i=`error: unknown option '${e}'${t}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,i=t===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${i} but got ${e.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(a=>{r.push(a.name()),a.alias()&&r.push(a.alias())}),t=nt(e,r)}let i=`error: unknown command '${e}'${t}`;this.error(i,{code:"commander.unknownCommand"})}version(e,t,i){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",i=i||"output the version number";let r=this.createOption(t,i);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
27
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${r}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(i=>Ii(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=le.basename(e,le.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),i=this._getOutputContext(e);t.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let r=t.formatHelp(this,t);return i.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let t=!!e.error,i,r,a;return t?(i=l=>this._outputConfiguration.writeErr(l),r=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(i=l=>this._outputConfiguration.writeOut(l),r=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:t,write:l=>(r||(l=this._outputConfiguration.stripColor(l)),i(l)),hasColors:r,helpWidth:a}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let i=this._getOutputContext(e),r={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(c=>c.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let a=this.helpInformation({error:i.error});if(t&&(a=t(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(c=>c.emit("afterAllHelp",r))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(M.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
28
- Expecting one of '${i.join("', '")}'`);let r=`${e}Help`;return this.on(r,a=>{let c;typeof t=="function"?c=t({error:a.error,command:a.command}):c=t,c&&a.write(`${c}
29
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(r=>t.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function tt(o){return o.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",r="9229",a;return(a=e.match(/^(--inspect(-brk)?)$/))!==null?t=a[1]:(a=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=a[1],/^\d+$/.test(a[3])?r=a[3]:i=a[3]):(a=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=a[1],i=a[3],r=a[4]),t&&r!=="0"?`${t}=${i}:${parseInt(r)+1}`:e})}function Nn(){if(M.env.NO_COLOR||M.env.FORCE_COLOR==="0"||M.env.FORCE_COLOR==="false")return!1;if(M.env.FORCE_COLOR||M.env.CLICOLOR_FORCE!==void 0)return!0}Rn.Command=Pn;Rn.useColor=Nn});var at=ge(ne=>{var{Argument:rt}=en(),{Command:$n}=it(),{CommanderError:Ni,InvalidArgumentError:ot}=Re(),{Help:Ri}=bn(),{Option:st}=In();ne.program=new $n;ne.createCommand=o=>new $n(o);ne.createOption=(o,e)=>new st(o,e);ne.createArgument=(o,e)=>new rt(o,e);ne.Command=$n;ne.Option=st;ne.Argument=rt;ne.Help=Ri;ne.CommanderError=Ni;ne.InvalidArgumentError=ot;ne.InvalidOptionArgumentError=ot});var ct=xi(at(),1),{program:oo,createCommand:so,createArgument:ao,createOption:co,CommanderError:lo,InvalidArgumentError:uo,InvalidOptionArgumentError:po,Command:lt,Argument:fo,Option:mo,Help:ho}=ct.default;var ut=`# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json
26
+ `),this.outputHelp({error:!0}));let r=t||{},i=r.exitCode||1,s=r.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in q.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,q.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new hl(this.options),t=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=a=>{let l=a.attributeName(),p=this.getOptionValue(l),c=this.options.find(u=>u.negate&&l===u.attributeName()),h=this.options.find(u=>!u.negate&&l===u.attributeName());return c&&(c.presetArg===void 0&&p===!1||c.presetArg!==void 0&&p===c.presetArg)?c:h||a},i=a=>{let l=r(a),p=l.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${l.envVar}'`:`option '${l.flags}'`},s=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(l=>l.long).map(l=>l.long);i=i.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);t=Hi(e,i)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),t=Hi(e,i)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let i=this.createOption(t,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
27
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(r=>ul(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Re.basename(e,Re.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let i=t.formatHelp(this,t);return r.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,r,i,s;return t?(r=l=>this._outputConfiguration.writeErr(l),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=l=>this._outputConfiguration.writeOut(l),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:l=>(i||(l=this._outputConfiguration.stripColor(l)),r(l)),hasColors:i,helpWidth:s}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let r=this._getOutputContext(e),i={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:r.error});if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(q.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
28
+ Expecting one of '${r.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let a;typeof t=="function"?a=t({error:s.error,command:s.command}):a=t,a&&s.write(`${a}
29
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Bi(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],i=s[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}function wr(){if(q.env.NO_COLOR||q.env.FORCE_COLOR==="0"||q.env.FORCE_COLOR==="false")return!1;if(q.env.FORCE_COLOR||q.env.CLICOLOR_FORCE!==void 0)return!0}br.Command=yr;br.useColor=wr});var Wi=D(ge=>{var{Argument:ji}=an(),{Command:xr}=qi(),{CommanderError:dl,InvalidArgumentError:$i}=At(),{Help:ml}=fr(),{Option:Gi}=gr();ge.program=new xr;ge.createCommand=n=>new xr(n);ge.createOption=(n,e)=>new Gi(n,e);ge.createArgument=(n,e)=>new ji(n,e);ge.Command=xr;ge.Option=Gi;ge.Argument=ji;ge.Help=ml;ge.CommanderError=dl;ge.InvalidArgumentError=$i;ge.InvalidOptionArgumentError=$i});var ae=D(fe=>{"use strict";fe.__esModule=!0;fe.extend=Wo;fe.indexOf=yc;fe.escapeExpression=wc;fe.isEmpty=bc;fe.createFrame=xc;fe.blockParams=Sc;fe.appendContextPath=Cc;var mc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},gc=/[&<>"'`=]/g,vc=/[&<>"'`=]/;function _c(n){return mc[n]}function Wo(n){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&(n[t]=arguments[e][t]);return n}var Tr=Object.prototype.toString;fe.toString=Tr;var Mr=function(e){return typeof e=="function"};Mr(/x/)&&(fe.isFunction=Mr=function(n){return typeof n=="function"&&Tr.call(n)==="[object Function]"});fe.isFunction=Mr;var Uo=Array.isArray||function(n){return n&&typeof n=="object"?Tr.call(n)==="[object Array]":!1};fe.isArray=Uo;function yc(n,e){for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function wc(n){if(typeof n!="string"){if(n&&n.toHTML)return n.toHTML();if(n==null)return"";if(!n)return n+"";n=""+n}return vc.test(n)?n.replace(gc,_c):n}function bc(n){return!n&&n!==0?!0:!!(Uo(n)&&n.length===0)}function xc(n){var e=Wo({},n);return e._parent=n,e}function Sc(n,e){return n.path=e,n}function Cc(n,e){return(n?n+".":"")+e}});var he=D((mn,Jo)=>{"use strict";mn.__esModule=!0;var Dr=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Vr(n,e){var t=e&&e.loc,r=void 0,i=void 0,s=void 0,a=void 0;t&&(r=t.start.line,i=t.end.line,s=t.start.column,a=t.end.column,n+=" - "+r+":"+s);for(var l=Error.prototype.constructor.call(this,n),p=0;p<Dr.length;p++)this[Dr[p]]=l[Dr[p]];Error.captureStackTrace&&Error.captureStackTrace(this,Vr);try{t&&(this.lineNumber=r,this.endLineNumber=i,Object.defineProperty?(Object.defineProperty(this,"column",{value:s,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=s,this.endColumn=a))}catch{}}Vr.prototype=new Error;mn.default=Vr;Jo.exports=mn.default});var Ko=D((gn,Yo)=>{"use strict";gn.__esModule=!0;var Fr=ae();gn.default=function(n){n.registerHelper("blockHelperMissing",function(e,t){var r=t.inverse,i=t.fn;if(e===!0)return i(this);if(e===!1||e==null)return r(this);if(Fr.isArray(e))return e.length>0?(t.ids&&(t.ids=[t.name]),n.helpers.each(e,t)):r(this);if(t.data&&t.ids){var s=Fr.createFrame(t.data);s.contextPath=Fr.appendContextPath(t.data.contextPath,t.name),t={data:s}}return i(e,t)})};Yo.exports=gn.default});var Qo=D((vn,zo)=>{"use strict";vn.__esModule=!0;function Ac(n){return n&&n.__esModule?n:{default:n}}var Rt=ae(),Ec=he(),kc=Ac(Ec);vn.default=function(n){n.registerHelper("each",function(e,t){if(!t)throw new kc.default("Must pass iterator to #each");var r=t.fn,i=t.inverse,s=0,a="",l=void 0,p=void 0;t.data&&t.ids&&(p=Rt.appendContextPath(t.data.contextPath,t.ids[0])+"."),Rt.isFunction(e)&&(e=e.call(this)),t.data&&(l=Rt.createFrame(t.data));function c(E,R,Y){l&&(l.key=E,l.index=R,l.first=R===0,l.last=!!Y,p&&(l.contextPath=p+E)),a=a+r(e[E],{data:l,blockParams:Rt.blockParams([e[E],E],[p+E,null])})}if(e&&typeof e=="object")if(Rt.isArray(e))for(var h=e.length;s<h;s++)s in e&&c(s,s,s===e.length-1);else if(typeof Symbol=="function"&&e[Symbol.iterator]){for(var u=[],d=e[Symbol.iterator](),v=d.next();!v.done;v=d.next())u.push(v.value);e=u;for(var h=e.length;s<h;s++)c(s,s,s===e.length-1)}else(function(){var E=void 0;Object.keys(e).forEach(function(R){E!==void 0&&c(E,s-1),E=R,s++}),E!==void 0&&c(E,s-1,!0)})();return s===0&&(a=i(this)),a})};zo.exports=vn.default});var Zo=D((_n,Xo)=>{"use strict";_n.__esModule=!0;function Oc(n){return n&&n.__esModule?n:{default:n}}var Pc=he(),Ic=Oc(Pc);_n.default=function(n){n.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new Ic.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Xo.exports=_n.default});var rs=D((yn,ns)=>{"use strict";yn.__esModule=!0;function Lc(n){return n&&n.__esModule?n:{default:n}}var es=ae(),Nc=he(),ts=Lc(Nc);yn.default=function(n){n.registerHelper("if",function(e,t){if(arguments.length!=2)throw new ts.default("#if requires exactly one argument");return es.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||es.isEmpty(e)?t.inverse(this):t.fn(this)}),n.registerHelper("unless",function(e,t){if(arguments.length!=2)throw new ts.default("#unless requires exactly one argument");return n.helpers.if.call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})};ns.exports=yn.default});var os=D((wn,is)=>{"use strict";wn.__esModule=!0;wn.default=function(n){n.registerHelper("log",function(){for(var e=[void 0],t=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)e.push(arguments[r]);var i=1;t.hash.level!=null?i=t.hash.level:t.data&&t.data.level!=null&&(i=t.data.level),e[0]=i,n.log.apply(n,e)})};is.exports=wn.default});var as=D((bn,ss)=>{"use strict";bn.__esModule=!0;bn.default=function(n){n.registerHelper("lookup",function(e,t,r){return e&&r.lookupProperty(e,t)})};ss.exports=bn.default});var cs=D((xn,ls)=>{"use strict";xn.__esModule=!0;function Rc(n){return n&&n.__esModule?n:{default:n}}var Mt=ae(),Mc=he(),Tc=Rc(Mc);xn.default=function(n){n.registerHelper("with",function(e,t){if(arguments.length!=2)throw new Tc.default("#with requires exactly one argument");Mt.isFunction(e)&&(e=e.call(this));var r=t.fn;if(Mt.isEmpty(e))return t.inverse(this);var i=t.data;return t.data&&t.ids&&(i=Mt.createFrame(t.data),i.contextPath=Mt.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:i,blockParams:Mt.blockParams([e],[i&&i.contextPath])})})};ls.exports=xn.default});var Hr=D(Sn=>{"use strict";Sn.__esModule=!0;Sn.registerDefaultHelpers=zc;Sn.moveHelperToHooks=Qc;function Je(n){return n&&n.__esModule?n:{default:n}}var Dc=Ko(),Vc=Je(Dc),Fc=Qo(),Hc=Je(Fc),Bc=Zo(),qc=Je(Bc),jc=rs(),$c=Je(jc),Gc=os(),Wc=Je(Gc),Uc=as(),Jc=Je(Uc),Yc=cs(),Kc=Je(Yc);function zc(n){Vc.default(n),Hc.default(n),qc.default(n),$c.default(n),Wc.default(n),Jc.default(n),Kc.default(n)}function Qc(n,e,t){n.helpers[e]&&(n.hooks[e]=n.helpers[e],t||(n.helpers[e]=void 0))}});var ps=D((Cn,us)=>{"use strict";Cn.__esModule=!0;var Xc=ae();Cn.default=function(n){n.registerDecorator("inline",function(e,t,r,i){var s=e;return t.partials||(t.partials={},s=function(a,l){var p=r.partials;r.partials=Xc.extend({},p,t.partials);var c=e(a,l);return r.partials=p,c}),t.partials[i.args[0]]=i.fn,s})};us.exports=Cn.default});var fs=D(Br=>{"use strict";Br.__esModule=!0;Br.registerDefaultDecorators=nu;function Zc(n){return n&&n.__esModule?n:{default:n}}var eu=ps(),tu=Zc(eu);function nu(n){tu.default(n)}});var qr=D((An,hs)=>{"use strict";An.__esModule=!0;var ru=ae(),ct={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var t=ru.indexOf(ct.methodMap,e.toLowerCase());t>=0?e=t:e=parseInt(e,10)}return e},log:function(e){if(e=ct.lookupLevel(e),typeof console<"u"&&ct.lookupLevel(ct.level)<=e){var t=ct.methodMap[e];console[t]||(t="log");for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];console[t].apply(console,i)}}};An.default=ct;hs.exports=An.default});var jr=D(Tt=>{"use strict";Tt.__esModule=!0;Tt.createProtoAccessControl=au;Tt.resultIsAllowed=lu;Tt.resetLoggedProperties=uu;function iu(n){return n&&n.__esModule?n:{default:n}}var ds=ae(),ou=qr(),su=iu(ou),En=Object.create(null);function au(n){var e=Object.create(null);e.__proto__=!1,ds.extend(e,n.allowedProtoProperties);var t=Object.create(null);return t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1,t.__lookupSetter__=!1,ds.extend(t,n.allowedProtoMethods),{properties:{whitelist:e,defaultValue:n.allowProtoPropertiesByDefault},methods:{whitelist:t,defaultValue:n.allowProtoMethodsByDefault}}}function lu(n,e,t){return ms(typeof n=="function"?e.methods:e.properties,t)}function ms(n,e){return n.whitelist[e]!==void 0?n.whitelist[e]===!0:n.defaultValue!==void 0?n.defaultValue:(cu(e),!1)}function cu(n){En[n]!==!0&&(En[n]=!0,su.default.log("error",'Handlebars: Access has been denied to resolve the property "'+n+`" because it is not an "own property" of its parent.
30
+ You can add a runtime option to disable the check or this warning:
31
+ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function uu(){Object.keys(En).forEach(function(n){delete En[n]})}});var On=D(Se=>{"use strict";Se.__esModule=!0;Se.HandlebarsEnvironment=Wr;function gs(n){return n&&n.__esModule?n:{default:n}}var Ye=ae(),pu=he(),$r=gs(pu),fu=Hr(),hu=fs(),du=qr(),kn=gs(du),mu=jr(),gu="4.7.9";Se.VERSION=gu;var vu=8;Se.COMPILER_REVISION=vu;var _u=7;Se.LAST_COMPATIBLE_COMPILER_REVISION=_u;var yu={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Se.REVISION_CHANGES=yu;var Gr="[object Object]";function Wr(n,e,t){this.helpers=n||{},this.partials=e||{},this.decorators=t||{},fu.registerDefaultHelpers(this),hu.registerDefaultDecorators(this)}Wr.prototype={constructor:Wr,logger:kn.default,log:kn.default.log,registerHelper:function(e,t){if(Ye.toString.call(e)===Gr){if(t)throw new $r.default("Arg not supported with multiple helpers");Ye.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(Ye.toString.call(e)===Gr)Ye.extend(this.partials,e);else{if(typeof t>"u")throw new $r.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(Ye.toString.call(e)===Gr){if(t)throw new $r.default("Arg not supported with multiple decorators");Ye.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){mu.resetLoggedProperties()}};var wu=kn.default.log;Se.log=wu;Se.createFrame=Ye.createFrame;Se.logger=kn.default});var _s=D((Pn,vs)=>{"use strict";Pn.__esModule=!0;function Ur(n){this.string=n}Ur.prototype.toString=Ur.prototype.toHTML=function(){return""+this.string};Pn.default=Ur;vs.exports=Pn.default});var ys=D(Jr=>{"use strict";Jr.__esModule=!0;Jr.wrapHelper=bu;function bu(n,e){if(typeof n!="function")return n;var t=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),n.apply(this,arguments)};return t}});var As=D(je=>{"use strict";je.__esModule=!0;je.checkRevision=ku;je.template=Ou;je.wrapProgram=In;je.resolvePartial=Pu;je.invokePartial=Iu;je.noop=Ss;function xu(n){return n&&n.__esModule?n:{default:n}}function Su(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}var Cu=ae(),ut=Su(Cu),Au=he(),De=xu(Au),Ve=On(),ws=Hr(),Eu=ys(),bs=jr();function ku(n){var e=n&&n[0]||1,t=Ve.COMPILER_REVISION;if(!(e>=Ve.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Ve.COMPILER_REVISION))if(e<Ve.LAST_COMPATIBLE_COMPILER_REVISION){var r=Ve.REVISION_CHANGES[t],i=Ve.REVISION_CHANGES[e];throw new De.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+i+").")}else throw new De.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").")}function Ou(n,e){if(!e)throw new De.default("No environment passed to template");if(!n||!n.main)throw new De.default("Unknown template object: "+typeof n);n.main.decorator=n.main_d,e.VM.checkRevision(n.compiler);var t=n.compiler&&n.compiler[0]===7;function r(a,l,p){p.hash&&(l=ut.extend({},l,p.hash),p.ids&&(p.ids[0]=!0)),a=e.VM.resolvePartial.call(this,a,l,p),p.hooks=this.hooks,p.protoAccessControl=this.protoAccessControl;var c=e.VM.invokePartial.call(this,a,l,p);if(c==null&&e.compile&&(p.partials[p.name]=e.compile(a,n.compilerOptions,e),c=p.partials[p.name](l,p)),c!=null){if(p.indent){for(var h=c.split(`
32
+ `),u=0,d=h.length;u<d&&!(!h[u]&&u+1===d);u++)h[u]=p.indent+h[u];c=h.join(`
33
+ `)}return c}else throw new De.default("The partial "+p.name+" could not be compiled when running in runtime-only mode")}var i={strict:function(l,p,c){if(!l||!(p in l))throw new De.default('"'+p+'" not defined in '+l,{loc:c});return i.lookupProperty(l,p)},lookupProperty:function(l,p){var c=l[p];if(c==null||Object.prototype.hasOwnProperty.call(l,p)||bs.resultIsAllowed(c,i.protoAccessControl,p))return c},lookup:function(l,p){for(var c=l.length,h=0;h<c;h++){var u=l[h]&&i.lookupProperty(l[h],p);if(u!=null)return u}},lambda:function(l,p){return typeof l=="function"?l.call(p):l},escapeExpression:ut.escapeExpression,invokePartial:r,fn:function(l){var p=n[l];return p.decorator=n[l+"_d"],p},programs:[],program:function(l,p,c,h,u){var d=this.programs[l],v=this.fn(l);return p||u||h||c?d=In(this,l,v,p,c,h,u):d||(d=this.programs[l]=In(this,l,v)),d},data:function(l,p){for(;l&&p--;)l=l._parent;return l},mergeIfNeeded:function(l,p){var c=l||p;return l&&p&&l!==p&&(c=ut.extend({},p,l)),c},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:n.compiler};function s(a){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=l.data;s._setup(l),!l.partial&&n.useData&&(p=Lu(a,p));var c=void 0,h=n.useBlockParams?[]:void 0;n.useDepths&&(l.depths?c=a!=l.depths[0]?[a].concat(l.depths):l.depths:c=[a]);function u(d){return""+n.main(i,d,i.helpers,i.partials,p,h,c)}return u=Cs(n.main,u,i,l.depths||[],p,h),u(a,l)}return s.isTop=!0,s._setup=function(a){if(a.partial)i.protoAccessControl=a.protoAccessControl,i.helpers=a.helpers,i.partials=a.partials,i.decorators=a.decorators,i.hooks=a.hooks;else{var l={};xs(l,e.helpers,i),xs(l,a.helpers,i),i.helpers=l,n.usePartial&&(i.partials=i.mergeIfNeeded(a.partials,e.partials)),(n.usePartial||n.useDecorators)&&(i.decorators=ut.extend({},e.decorators,a.decorators)),i.hooks={},i.protoAccessControl=bs.createProtoAccessControl(a);var p=a.allowCallsToHelperMissing||t;ws.moveHelperToHooks(i,"helperMissing",p),ws.moveHelperToHooks(i,"blockHelperMissing",p)}},s._child=function(a,l,p,c){if(n.useBlockParams&&!p)throw new De.default("must pass block params");if(n.useDepths&&!c)throw new De.default("must pass parent depths");return In(i,a,n[a],l,0,p,c)},s}function In(n,e,t,r,i,s,a){function l(p){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],h=a;return a&&p!=a[0]&&!(p===n.nullContext&&a[0]===null)&&(h=[p].concat(a)),t(n,p,n.helpers,n.partials,c.data||r,s&&[c.blockParams].concat(s),h)}return l=Cs(t,l,n,a,r,s),l.program=e,l.depth=a?a.length:0,l.blockParams=i||0,l}function Pu(n,e,t){return n?!n.call&&!t.name&&(t.name=n,n=Ln(t.partials,n)):t.name==="@partial-block"?n=Ln(t.data,"partial-block"):n=Ln(t.partials,t.name),n}function Iu(n,e,t){var r=Ln(t.data,"partial-block");t.partial=!0,t.ids&&(t.data.contextPath=t.ids[0]||t.data.contextPath);var i=void 0;if(t.fn&&t.fn!==Ss&&(function(){t.data=Ve.createFrame(t.data);var s=t.fn;i=t.data["partial-block"]=function(l){var p=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return p.data=Ve.createFrame(p.data),p.data["partial-block"]=r,s(l,p)},s.partials&&(t.partials=ut.extend({},t.partials,s.partials))})(),n===void 0&&i&&(n=i),n===void 0)throw new De.default("The partial "+t.name+" could not be found");if(n instanceof Function)return n(e,t)}function Ss(){return""}function Ln(n,e){if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e]}function Lu(n,e){return(!e||!("root"in e))&&(e=e?Ve.createFrame(e):{},e.root=n),e}function Cs(n,e,t,r,i,s){if(n.decorator){var a={};e=n.decorator(e,a,t,r&&r[0],i,s,r),ut.extend(e,a)}return e}function xs(n,e,t){e&&Object.keys(e).forEach(function(r){var i=e[r];n[r]=Nu(i,t)})}function Nu(n,e){var t=e.lookupProperty;return Eu.wrapHelper(n,function(r){return r.lookupProperty=t,r})}});var Yr=D((Nn,Es)=>{"use strict";Nn.__esModule=!0;Nn.default=function(n){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;n.noConflict=function(){return globalThis.Handlebars===n&&(globalThis.Handlebars=e),n}};Es.exports=Nn.default});var Ls=D((Rn,Is)=>{"use strict";Rn.__esModule=!0;function zr(n){return n&&n.__esModule?n:{default:n}}function Qr(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}var Ru=On(),ks=Qr(Ru),Mu=_s(),Tu=zr(Mu),Du=he(),Vu=zr(Du),Fu=ae(),Kr=Qr(Fu),Hu=As(),Os=Qr(Hu),Bu=Yr(),qu=zr(Bu);function Ps(){var n=new ks.HandlebarsEnvironment;return Kr.extend(n,ks),n.SafeString=Tu.default,n.Exception=Vu.default,n.Utils=Kr,n.escapeExpression=Kr.escapeExpression,n.VM=Os,n.template=function(e){return Os.template(e,n)},n}var Dt=Ps();Dt.create=Ps;qu.default(Dt);Dt.default=Dt;Rn.default=Dt;Is.exports=Rn.default});var Xr=D((Mn,Rs)=>{"use strict";Mn.__esModule=!0;var Ns={helpers:{helperExpression:function(e){return e.type==="SubExpression"||(e.type==="MustacheStatement"||e.type==="BlockStatement")&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return e.parts.length===1&&!Ns.helpers.scopedId(e)&&!e.depth}}};Mn.default=Ns;Rs.exports=Mn.default});var Ts=D((Tn,Ms)=>{"use strict";Tn.__esModule=!0;var ju=(function(){var n={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(i,s,a,l,p,c,h){var u=c.length-1;switch(p){case 1:return c[u-1];case 2:this.$=l.prepareProgram(c[u]);break;case 3:this.$=c[u];break;case 4:this.$=c[u];break;case 5:this.$=c[u];break;case 6:this.$=c[u];break;case 7:this.$=c[u];break;case 8:this.$=c[u];break;case 9:this.$={type:"CommentStatement",value:l.stripComment(c[u]),strip:l.stripFlags(c[u],c[u]),loc:l.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:c[u],value:c[u],loc:l.locInfo(this._$)};break;case 11:this.$=l.prepareRawBlock(c[u-2],c[u-1],c[u],this._$);break;case 12:this.$={path:c[u-3],params:c[u-2],hash:c[u-1]};break;case 13:this.$=l.prepareBlock(c[u-3],c[u-2],c[u-1],c[u],!1,this._$);break;case 14:this.$=l.prepareBlock(c[u-3],c[u-2],c[u-1],c[u],!0,this._$);break;case 15:this.$={open:c[u-5],path:c[u-4],params:c[u-3],hash:c[u-2],blockParams:c[u-1],strip:l.stripFlags(c[u-5],c[u])};break;case 16:this.$={path:c[u-4],params:c[u-3],hash:c[u-2],blockParams:c[u-1],strip:l.stripFlags(c[u-5],c[u])};break;case 17:this.$={path:c[u-4],params:c[u-3],hash:c[u-2],blockParams:c[u-1],strip:l.stripFlags(c[u-5],c[u])};break;case 18:this.$={strip:l.stripFlags(c[u-1],c[u-1]),program:c[u]};break;case 19:var d=l.prepareBlock(c[u-2],c[u-1],c[u],c[u],!1,this._$),v=l.prepareProgram([d],c[u-1].loc);v.chained=!0,this.$={strip:c[u-2].strip,program:v,chain:!0};break;case 20:this.$=c[u];break;case 21:this.$={path:c[u-1],strip:l.stripFlags(c[u-2],c[u])};break;case 22:this.$=l.prepareMustache(c[u-3],c[u-2],c[u-1],c[u-4],l.stripFlags(c[u-4],c[u]),this._$);break;case 23:this.$=l.prepareMustache(c[u-3],c[u-2],c[u-1],c[u-4],l.stripFlags(c[u-4],c[u]),this._$);break;case 24:this.$={type:"PartialStatement",name:c[u-3],params:c[u-2],hash:c[u-1],indent:"",strip:l.stripFlags(c[u-4],c[u]),loc:l.locInfo(this._$)};break;case 25:this.$=l.preparePartialBlock(c[u-2],c[u-1],c[u],this._$);break;case 26:this.$={path:c[u-3],params:c[u-2],hash:c[u-1],strip:l.stripFlags(c[u-4],c[u])};break;case 27:this.$=c[u];break;case 28:this.$=c[u];break;case 29:this.$={type:"SubExpression",path:c[u-3],params:c[u-2],hash:c[u-1],loc:l.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:c[u],loc:l.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:l.id(c[u-2]),value:c[u],loc:l.locInfo(this._$)};break;case 32:this.$=l.id(c[u-1]);break;case 33:this.$=c[u];break;case 34:this.$=c[u];break;case 35:this.$={type:"StringLiteral",value:c[u],original:c[u],loc:l.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(c[u]),original:Number(c[u]),loc:l.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:c[u]==="true",original:c[u]==="true",loc:l.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:l.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:l.locInfo(this._$)};break;case 40:this.$=c[u];break;case 41:this.$=c[u];break;case 42:this.$=l.preparePath(!0,c[u],this._$);break;case 43:this.$=l.preparePath(!1,c[u],this._$);break;case 44:c[u-2].push({part:l.id(c[u]),original:c[u],separator:c[u-1]}),this.$=c[u-2];break;case 45:this.$=[{part:l.id(c[u]),original:c[u]}];break;case 46:this.$=[];break;case 47:c[u-1].push(c[u]);break;case 48:this.$=[];break;case 49:c[u-1].push(c[u]);break;case 50:this.$=[];break;case 51:c[u-1].push(c[u]);break;case 58:this.$=[];break;case 59:c[u-1].push(c[u]);break;case 64:this.$=[];break;case 65:c[u-1].push(c[u]);break;case 70:this.$=[];break;case 71:c[u-1].push(c[u]);break;case 78:this.$=[];break;case 79:c[u-1].push(c[u]);break;case 82:this.$=[];break;case 83:c[u-1].push(c[u]);break;case 86:this.$=[];break;case 87:c[u-1].push(c[u]);break;case 90:this.$=[];break;case 91:c[u-1].push(c[u]);break;case 94:this.$=[];break;case 95:c[u-1].push(c[u]);break;case 98:this.$=[c[u]];break;case 99:c[u-1].push(c[u]);break;case 100:this.$=[c[u]];break;case 101:c[u-1].push(c[u]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(i,s){throw new Error(i)},parse:function(i){var s=this,a=[0],l=[null],p=[],c=this.table,h="",u=0,d=0,v=0,E=2,R=1;this.lexer.setInput(i),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var Y=this.lexer.yylloc;p.push(Y);var V=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function G(j){a.length=a.length-2*j,l.length=l.length-j,p.length=p.length-j}function le(){var j;return j=s.lexer.lex()||1,typeof j!="number"&&(j=s.symbols_[j]||j),j}for(var B,X,K,te,Jt,Ge,ye={},xe,ue,He,Ee;;){if(K=a[a.length-1],this.defaultActions[K]?te=this.defaultActions[K]:((B===null||typeof B>"u")&&(B=le()),te=c[K]&&c[K][B]),typeof te>"u"||!te.length||!te[0]){var ke="";if(!v){Ee=[];for(xe in c[K])this.terminals_[xe]&&xe>2&&Ee.push("'"+this.terminals_[xe]+"'");this.lexer.showPosition?ke="Parse error on line "+(u+1)+`:
34
+ `+this.lexer.showPosition()+`
35
+ Expecting `+Ee.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ke="Parse error on line "+(u+1)+": Unexpected "+(B==1?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ke,{text:this.lexer.match,token:this.terminals_[B]||B,line:this.lexer.yylineno,loc:Y,expected:Ee})}}if(te[0]instanceof Array&&te.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+B);switch(te[0]){case 1:a.push(B),l.push(this.lexer.yytext),p.push(this.lexer.yylloc),a.push(te[1]),B=null,X?(B=X,X=null):(d=this.lexer.yyleng,h=this.lexer.yytext,u=this.lexer.yylineno,Y=this.lexer.yylloc,v>0&&v--);break;case 2:if(ue=this.productions_[te[1]][1],ye.$=l[l.length-ue],ye._$={first_line:p[p.length-(ue||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(ue||1)].first_column,last_column:p[p.length-1].last_column},V&&(ye._$.range=[p[p.length-(ue||1)].range[0],p[p.length-1].range[1]]),Ge=this.performAction.call(ye,h,d,u,this.yy,te[1],l,p),typeof Ge<"u")return Ge;ue&&(a=a.slice(0,-1*ue*2),l=l.slice(0,-1*ue),p=p.slice(0,-1*ue)),a.push(this.productions_[te[1]][0]),l.push(ye.$),p.push(ye._$),He=c[a[a.length-2]][a[a.length-1]],a.push(He);break;case 3:return!0}}return!0}},e=(function(){var r={EOF:1,parseError:function(s,a){if(this.yy.parser)this.yy.parser.parseError(s,a);else throw new Error(s)},setInput:function(s){return this._input=s,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var a=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a-1),this.offset-=a;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var c=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-a]),this},more:function(){return this._more=!0,this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
36
+ `+a+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,l,p,c,h;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),d=0;d<u.length&&(l=this._input.match(this.rules[u[d]]),!(l&&(!a||l[0].length>a[0].length)&&(a=l,p=d,!this.options.flex)));d++);return a?(h=a[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],s=this.performAction.call(this,this.yy,this,u[p],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
37
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return typeof s<"u"?s:this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(s){this.begin(s)}};return r.options={},r.performAction=function(s,a,l,p){function c(u,d){return a.yytext=a.yytext.substring(u,a.yyleng-d+u)}var h=p;switch(l){case 0:if(a.yytext.slice(-2)==="\\\\"?(c(0,1),this.begin("mu")):a.yytext.slice(-1)==="\\"?(c(0,1),this.begin("emu")):this.begin("mu"),a.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(c(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(a.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return a.yytext=c(1,2).replace(/\\"/g,'"'),80;break;case 32:return a.yytext=c(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return a.yytext=a.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},r.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],r.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},r})();n.lexer=e;function t(){this.yy={}}return t.prototype=n,n.Parser=t,new t})();Tn.default=ju;Ms.exports=Tn.default});var Hn=D((Fn,Fs)=>{"use strict";Fn.__esModule=!0;function $u(n){return n&&n.__esModule?n:{default:n}}var Gu=he(),Zr=$u(Gu);function Dn(){this.parents=[]}Dn.prototype={constructor:Dn,mutating:!1,acceptKey:function(e,t){var r=this.accept(e[t]);if(this.mutating){if(r&&!Dn.prototype[r.type])throw new Zr.default('Unexpected node type "'+r.type+'" found when accepting '+t+" on "+e.type);e[t]=r}},acceptRequired:function(e,t){if(this.acceptKey(e,t),!e[t])throw new Zr.default(e.type+" requires "+t)},acceptArray:function(e){for(var t=0,r=e.length;t<r;t++)this.acceptKey(e,t),e[t]||(e.splice(t,1),t--,r--)},accept:function(e){if(e){if(!this[e.type])throw new Zr.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var t=this[e.type](e);if(this.current=this.parents.shift(),!this.mutating||t)return t;if(t!==!1)return e}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:Vn,Decorator:Vn,BlockStatement:Ds,DecoratorBlock:Ds,PartialStatement:Vs,PartialBlockStatement:function(e){Vs.call(this,e),this.acceptKey(e,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:Vn,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,"value")}};function Vn(n){this.acceptRequired(n,"path"),this.acceptArray(n.params),this.acceptKey(n,"hash")}function Ds(n){Vn.call(this,n),this.acceptKey(n,"program"),this.acceptKey(n,"inverse")}function Vs(n){this.acceptRequired(n,"name"),this.acceptArray(n.params),this.acceptKey(n,"hash")}Fn.default=Dn;Fs.exports=Fn.default});var Bs=D((Bn,Hs)=>{"use strict";Bn.__esModule=!0;function Wu(n){return n&&n.__esModule?n:{default:n}}var Uu=Hn(),Ju=Wu(Uu);function Ce(){var n=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=n}Ce.prototype=new Ju.default;Ce.prototype.Program=function(n){var e=!this.options.ignoreStandalone,t=!this.isRootSeen;this.isRootSeen=!0;for(var r=n.body,i=0,s=r.length;i<s;i++){var a=r[i],l=this.accept(a);if(l){var p=ei(r,i,t),c=ti(r,i,t),h=l.openStandalone&&p,u=l.closeStandalone&&c,d=l.inlineStandalone&&p&&c;l.close&&Ke(r,i,!0),l.open&&$e(r,i,!0),e&&d&&(Ke(r,i),$e(r,i)&&a.type==="PartialStatement"&&(a.indent=/([ \t]+$)/.exec(r[i-1].original)[1])),e&&h&&(Ke((a.program||a.inverse).body),$e(r,i)),e&&u&&(Ke(r,i),$e((a.inverse||a.program).body))}}return n};Ce.prototype.BlockStatement=Ce.prototype.DecoratorBlock=Ce.prototype.PartialBlockStatement=function(n){this.accept(n.program),this.accept(n.inverse);var e=n.program||n.inverse,t=n.program&&n.inverse,r=t,i=t;if(t&&t.chained)for(r=t.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var s={open:n.openStrip.open,close:n.closeStrip.close,openStandalone:ti(e.body),closeStandalone:ei((r||e).body)};if(n.openStrip.close&&Ke(e.body,null,!0),t){var a=n.inverseStrip;a.open&&$e(e.body,null,!0),a.close&&Ke(r.body,null,!0),n.closeStrip.open&&$e(i.body,null,!0),!this.options.ignoreStandalone&&ei(e.body)&&ti(r.body)&&($e(e.body),Ke(r.body))}else n.closeStrip.open&&$e(e.body,null,!0);return s};Ce.prototype.Decorator=Ce.prototype.MustacheStatement=function(n){return n.strip};Ce.prototype.PartialStatement=Ce.prototype.CommentStatement=function(n){var e=n.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}};function ei(n,e,t){e===void 0&&(e=n.length);var r=n[e-1],i=n[e-2];if(!r)return t;if(r.type==="ContentStatement")return(i||!t?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(r.original)}function ti(n,e,t){e===void 0&&(e=-1);var r=n[e+1],i=n[e+2];if(!r)return t;if(r.type==="ContentStatement")return(i||!t?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(r.original)}function Ke(n,e,t){var r=n[e==null?0:e+1];if(!(!r||r.type!=="ContentStatement"||!t&&r.rightStripped)){var i=r.value;r.value=r.value.replace(t?/^\s+/:/^[ \t]*\r?\n?/,""),r.rightStripped=r.value!==i}}function $e(n,e,t){var r=n[e==null?n.length-1:e-1];if(!(!r||r.type!=="ContentStatement"||!t&&r.leftStripped)){var i=r.value;return r.value=r.value.replace(t?/\s+$/:/[ \t]+$/,""),r.leftStripped=r.value!==i,r.leftStripped}}Bn.default=Ce;Hs.exports=Bn.default});var qs=D(ve=>{"use strict";ve.__esModule=!0;ve.SourceLocation=zu;ve.id=Qu;ve.stripFlags=Xu;ve.stripComment=Zu;ve.preparePath=ep;ve.prepareMustache=tp;ve.prepareRawBlock=np;ve.prepareBlock=rp;ve.prepareProgram=ip;ve.preparePartialBlock=op;function Yu(n){return n&&n.__esModule?n:{default:n}}var Ku=he(),ni=Yu(Ku);function ri(n,e){if(e=e.path?e.path.original:e,n.path.original!==e){var t={loc:n.path.loc};throw new ni.default(n.path.original+" doesn't match "+e,t)}}function zu(n,e){this.source=n,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}}function Qu(n){return/^\[.*\]$/.test(n)?n.substring(1,n.length-1):n}function Xu(n,e){return{open:n.charAt(2)==="~",close:e.charAt(e.length-3)==="~"}}function Zu(n){return n.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function ep(n,e,t){t=this.locInfo(t);for(var r=n?"@":"",i=[],s=0,a=0,l=e.length;a<l;a++){var p=e[a].part,c=e[a].original!==p;if(r+=(e[a].separator||"")+p,!c&&(p===".."||p==="."||p==="this")){if(i.length>0)throw new ni.default("Invalid path: "+r,{loc:t});p===".."&&s++}else i.push(p)}return{type:"PathExpression",data:n,depth:s,parts:i,original:r,loc:t}}function tp(n,e,t,r,i,s){var a=r.charAt(3)||r.charAt(2),l=a!=="{"&&a!=="&",p=/\*/.test(r);return{type:p?"Decorator":"MustacheStatement",path:n,params:e,hash:t,escaped:l,strip:i,loc:this.locInfo(s)}}function np(n,e,t,r){ri(n,t),r=this.locInfo(r);var i={type:"Program",body:e,strip:{},loc:r};return{type:"BlockStatement",path:n.path,params:n.params,hash:n.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:r}}function rp(n,e,t,r,i,s){r&&r.path&&ri(n,r);var a=/\*/.test(n.open);e.blockParams=n.blockParams;var l=void 0,p=void 0;if(t){if(a)throw new ni.default("Unexpected inverse block on decorator",t);t.chain&&(t.program.body[0].closeStrip=r.strip),p=t.strip,l=t.program}return i&&(i=l,l=e,e=i),{type:a?"DecoratorBlock":"BlockStatement",path:n.path,params:n.params,hash:n.hash,program:e,inverse:l,openStrip:n.strip,inverseStrip:p,closeStrip:r&&r.strip,loc:this.locInfo(s)}}function ip(n,e){if(!e&&n.length){var t=n[0].loc,r=n[n.length-1].loc;t&&r&&(e={source:t.source,start:{line:t.start.line,column:t.start.column},end:{line:r.end.line,column:r.end.column}})}return{type:"Program",body:n,strip:{},loc:e}}function op(n,e,t,r){return ri(n,t),{type:"PartialBlockStatement",name:n.path,params:n.params,hash:n.hash,program:e,openStrip:n.strip,closeStrip:t&&t.strip,loc:this.locInfo(r)}}});var $s=D(Ft=>{"use strict";Ft.__esModule=!0;Ft.parseWithoutProcessing=js;Ft.parse=dp;function sp(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function si(n){return n&&n.__esModule?n:{default:n}}var ap=Ts(),ii=si(ap),lp=Bs(),cp=si(lp),up=qs(),pp=sp(up),fp=he(),Vt=si(fp),hp=ae();Ft.parser=ii.default;var qn={};hp.extend(qn,pp);function js(n,e){if(n.type==="Program")return mp(n),n;ii.default.yy=qn,qn.locInfo=function(r){return new qn.SourceLocation(e&&e.srcName,r)};var t=ii.default.parse(n);return t}function dp(n,e){var t=js(n,e),r=new cp.default(e);return r.accept(t)}function mp(n){oi(n)}function oi(n){if(n!=null){if(Array.isArray(n)){n.forEach(oi);return}if(typeof n=="object"){if(n.type==="PathExpression"){if(!gp(n.depth))throw new Vt.default("Invalid AST: PathExpression.depth must be an integer");if(!Array.isArray(n.parts))throw new Vt.default("Invalid AST: PathExpression.parts must be an array");for(var e=0;e<n.parts.length;e++)if(typeof n.parts[e]!="string")throw new Vt.default("Invalid AST: PathExpression.parts must only contain strings")}else if(n.type==="NumberLiteral"){if(typeof n.value!="number"||!isFinite(n.value))throw new Vt.default("Invalid AST: NumberLiteral.value must be a number")}else if(n.type==="BooleanLiteral"&&typeof n.value!="boolean")throw new Vt.default("Invalid AST: BooleanLiteral.value must be a boolean");Object.keys(n).forEach(function(t){t!=="loc"&&oi(n[t])})}}}function gp(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n&&n>=0}});var Js=D(jt=>{"use strict";jt.__esModule=!0;jt.Compiler=ai;jt.precompile=wp;jt.compile=bp;function Ws(n){return n&&n.__esModule?n:{default:n}}var vp=he(),Bt=Ws(vp),qt=ae(),_p=Xr(),Ht=Ws(_p),yp=[].slice;function ai(){}ai.prototype={compiler:ai,equals:function(e){var t=this.opcodes.length;if(e.opcodes.length!==t)return!1;for(var r=0;r<t;r++){var i=this.opcodes[r],s=e.opcodes[r];if(i.opcode!==s.opcode||!Us(i.args,s.args))return!1}t=this.children.length;for(var r=0;r<t;r++)if(!this.children[r].equals(e.children[r]))return!1;return!0},guid:0,compile:function(e,t){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=t,this.stringParams=t.stringParams,this.trackIds=t.trackIds,t.blockParams=t.blockParams||[],t.knownHelpers=qt.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},t.knownHelpers),this.accept(e)},compileProgram:function(e){var t=new this.compiler,r=t.compile(e,this.options),i=this.guid++;return this.usePartial=this.usePartial||r.usePartial,this.children[i]=r,this.useDepths=this.useDepths||r.useDepths,i},accept:function(e){if(!this[e.type])throw new Bt.default("Unknown type: "+e.type,e);this.sourceNode.unshift(e);var t=this[e.type](e);return this.sourceNode.shift(),t},Program:function(e){this.options.blockParams.unshift(e.blockParams);for(var t=e.body,r=t.length,i=0;i<r;i++)this.accept(t[i]);return this.options.blockParams.shift(),this.isSimple=r===1,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){Gs(e);var t=e.program,r=e.inverse;t=t&&this.compileProgram(t),r=r&&this.compileProgram(r);var i=this.classifySexpr(e);i==="helper"?this.helperSexpr(e,t,r):i==="simple"?(this.simpleSexpr(e),this.opcode("pushProgram",t),this.opcode("pushProgram",r),this.opcode("emptyHash"),this.opcode("blockValue",e.path.original)):(this.ambiguousSexpr(e,t,r),this.opcode("pushProgram",t),this.opcode("pushProgram",r),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(e){var t=e.program&&this.compileProgram(e.program),r=this.setupFullMustacheParams(e,t,void 0),i=e.path;this.useDecorators=!0,this.opcode("registerDecorator",r.length,i.original)},PartialStatement:function(e){this.usePartial=!0;var t=e.program;t&&(t=this.compileProgram(e.program));var r=e.params;if(r.length>1)throw new Bt.default("Unsupported number of partial arguments: "+r.length,e);r.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):r.push({type:"PathExpression",parts:[],depth:0}));var i=e.name.original,s=e.name.type==="SubExpression";s&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var a=e.indent||"";this.options.preventIndent&&a&&(this.opcode("appendContent",a),a=""),this.opcode("invokePartial",s,i,a),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){Gs(e);var t=this.classifySexpr(e);t==="simple"?this.simpleSexpr(e):t==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,r){var i=e.path,s=i.parts[0],a=t!=null||r!=null;this.opcode("getContext",i.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",r),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",s,a)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,t,r){var i=this.setupFullMustacheParams(e,t,r),s=e.path,a=s.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",i.length,a);else{if(this.options.knownHelpersOnly)throw new Bt.default("You specified knownHelpersOnly, but used the unknown helper "+a,e);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",i.length,s.original,Ht.default.helpers.simpleId(s))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var t=e.parts[0],r=Ht.default.helpers.scopedId(e),i=!e.depth&&!r&&this.blockParamIndex(t);i?this.opcode("lookupBlockParam",i,e.parts):t?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,r):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var t=e.pairs,r=0,i=t.length;for(this.opcode("pushHash");r<i;r++)this.pushParam(t[r].value);for(;r--;)this.opcode("assignToHash",t[r].key);this.opcode("popHash")},opcode:function(e){this.opcodes.push({opcode:e,args:yp.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){var t=Ht.default.helpers.simpleId(e.path),r=t&&!!this.blockParamIndex(e.path.parts[0]),i=!r&&Ht.default.helpers.helperExpression(e),s=!r&&(i||t);if(s&&!i){var a=e.path.parts[0],l=this.options;l.knownHelpers[a]?i=!0:l.knownHelpersOnly&&(s=!1)}return i?"helper":s?"ambiguous":"simple"},pushParams:function(e){for(var t=0,r=e.length;t<r;t++)this.pushParam(e[t])},pushParam:function(e){var t=e.value!=null?e.value:e.original||"";if(this.stringParams)t.replace&&(t=t.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),e.depth&&this.addDepth(e.depth),this.opcode("getContext",e.depth||0),this.opcode("pushStringParam",t,e.type),e.type==="SubExpression"&&this.accept(e);else{if(this.trackIds){var r=void 0;if(e.parts&&!Ht.default.helpers.scopedId(e)&&!e.depth&&(r=this.blockParamIndex(e.parts[0])),r){var i=e.parts.slice(1).join(".");this.opcode("pushId","BlockParam",r,i)}else t=e.original||t,t.replace&&(t=t.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",e.type,t)}this.accept(e)}},setupFullMustacheParams:function(e,t,r,i){var s=e.params;return this.pushParams(s),this.opcode("pushProgram",t),this.opcode("pushProgram",r),e.hash?this.accept(e.hash):this.opcode("emptyHash",i),s},blockParamIndex:function(e){for(var t=0,r=this.options.blockParams.length;t<r;t++){var i=this.options.blockParams[t],s=i&&qt.indexOf(i,e);if(i&&s>=0)return[t,s]}}};function wp(n,e,t){if(n==null||typeof n!="string"&&n.type!=="Program")throw new Bt.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var r=t.parse(n,e),i=new t.Compiler().compile(r,e);return new t.JavaScriptCompiler().compile(i,e)}function bp(n,e,t){if(e===void 0&&(e={}),n==null||typeof n!="string"&&n.type!=="Program")throw new Bt.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);e=qt.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var r=void 0;function i(){var a=t.parse(n,e),l=new t.Compiler().compile(a,e),p=new t.JavaScriptCompiler().compile(l,e,void 0,!0);return t.template(p)}function s(a,l){return r||(r=i()),r.call(this,a,l)}return s._setup=function(a){return r||(r=i()),r._setup(a)},s._child=function(a,l,p,c){return r||(r=i()),r._child(a,l,p,c)},s}function Us(n,e){if(n===e)return!0;if(qt.isArray(n)&&qt.isArray(e)&&n.length===e.length){for(var t=0;t<n.length;t++)if(!Us(n[t],e[t]))return!1;return!0}}function Gs(n){if(!n.path.parts){var e=n.path;n.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}});var Ks=D(li=>{var Ys="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");li.encode=function(n){if(0<=n&&n<Ys.length)return Ys[n];throw new TypeError("Must be between 0 and 63: "+n)};li.decode=function(n){var e=65,t=90,r=97,i=122,s=48,a=57,l=43,p=47,c=26,h=52;return e<=n&&n<=t?n-e:r<=n&&n<=i?n-r+c:s<=n&&n<=a?n-s+h:n==l?62:n==p?63:-1}});var pi=D(ui=>{var zs=Ks(),ci=5,Qs=1<<ci,Xs=Qs-1,Zs=Qs;function xp(n){return n<0?(-n<<1)+1:(n<<1)+0}function Sp(n){var e=(n&1)===1,t=n>>1;return e?-t:t}ui.encode=function(e){var t="",r,i=xp(e);do r=i&Xs,i>>>=ci,i>0&&(r|=Zs),t+=zs.encode(r);while(i>0);return t};ui.decode=function(e,t,r){var i=e.length,s=0,a=0,l,p;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(p=zs.decode(e.charCodeAt(t++)),p===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));l=!!(p&Zs),p&=Xs,s=s+(p<<a),a+=ci}while(l);r.value=Sp(s),r.rest=t}});var ht=D(oe=>{function Cp(n,e,t){if(e in n)return n[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}oe.getArg=Cp;var ea=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ap=/^data:.+\,.+$/;function $t(n){var e=n.match(ea);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}oe.urlParse=$t;function pt(n){var e="";return n.scheme&&(e+=n.scheme+":"),e+="//",n.auth&&(e+=n.auth+"@"),n.host&&(e+=n.host),n.port&&(e+=":"+n.port),n.path&&(e+=n.path),e}oe.urlGenerate=pt;function fi(n){var e=n,t=$t(n);if(t){if(!t.path)return n;e=t.path}for(var r=oe.isAbsolute(e),i=e.split(/\/+/),s,a=0,l=i.length-1;l>=0;l--)s=i[l],s==="."?i.splice(l,1):s===".."?a++:a>0&&(s===""?(i.splice(l+1,a),a=0):(i.splice(l,2),a--));return e=i.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,pt(t)):e}oe.normalize=fi;function ta(n,e){n===""&&(n="."),e===""&&(e=".");var t=$t(e),r=$t(n);if(r&&(n=r.path||"/"),t&&!t.scheme)return r&&(t.scheme=r.scheme),pt(t);if(t||e.match(Ap))return e;if(r&&!r.host&&!r.path)return r.host=e,pt(r);var i=e.charAt(0)==="/"?e:fi(n.replace(/\/+$/,"")+"/"+e);return r?(r.path=i,pt(r)):i}oe.join=ta;oe.isAbsolute=function(n){return n.charAt(0)==="/"||ea.test(n)};function Ep(n,e){n===""&&(n="."),n=n.replace(/\/$/,"");for(var t=0;e.indexOf(n+"/")!==0;){var r=n.lastIndexOf("/");if(r<0||(n=n.slice(0,r),n.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(n.length+1)}oe.relative=Ep;var na=(function(){var n=Object.create(null);return!("__proto__"in n)})();function ra(n){return n}function kp(n){return ia(n)?"$"+n:n}oe.toSetString=na?ra:kp;function Op(n){return ia(n)?n.slice(1):n}oe.fromSetString=na?ra:Op;function ia(n){if(!n)return!1;var e=n.length;if(e<9||n.charCodeAt(e-1)!==95||n.charCodeAt(e-2)!==95||n.charCodeAt(e-3)!==111||n.charCodeAt(e-4)!==116||n.charCodeAt(e-5)!==111||n.charCodeAt(e-6)!==114||n.charCodeAt(e-7)!==112||n.charCodeAt(e-8)!==95||n.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(n.charCodeAt(t)!==36)return!1;return!0}function Pp(n,e,t){var r=ft(n.source,e.source);return r!==0||(r=n.originalLine-e.originalLine,r!==0)||(r=n.originalColumn-e.originalColumn,r!==0||t)||(r=n.generatedColumn-e.generatedColumn,r!==0)||(r=n.generatedLine-e.generatedLine,r!==0)?r:ft(n.name,e.name)}oe.compareByOriginalPositions=Pp;function Ip(n,e,t){var r=n.generatedLine-e.generatedLine;return r!==0||(r=n.generatedColumn-e.generatedColumn,r!==0||t)||(r=ft(n.source,e.source),r!==0)||(r=n.originalLine-e.originalLine,r!==0)||(r=n.originalColumn-e.originalColumn,r!==0)?r:ft(n.name,e.name)}oe.compareByGeneratedPositionsDeflated=Ip;function ft(n,e){return n===e?0:n===null?1:e===null?-1:n>e?1:-1}function Lp(n,e){var t=n.generatedLine-e.generatedLine;return t!==0||(t=n.generatedColumn-e.generatedColumn,t!==0)||(t=ft(n.source,e.source),t!==0)||(t=n.originalLine-e.originalLine,t!==0)||(t=n.originalColumn-e.originalColumn,t!==0)?t:ft(n.name,e.name)}oe.compareByGeneratedPositionsInflated=Lp;function Np(n){return JSON.parse(n.replace(/^\)]}'[^\n]*\n/,""))}oe.parseSourceMapInput=Np;function Rp(n,e,t){if(e=e||"",n&&(n[n.length-1]!=="/"&&e[0]!=="/"&&(n+="/"),e=n+e),t){var r=$t(t);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var i=r.path.lastIndexOf("/");i>=0&&(r.path=r.path.substring(0,i+1))}e=ta(pt(r),e)}return fi(e)}oe.computeSourceURL=Rp});var mi=D(oa=>{var hi=ht(),di=Object.prototype.hasOwnProperty,ze=typeof Map<"u";function Fe(){this._array=[],this._set=ze?new Map:Object.create(null)}Fe.fromArray=function(e,t){for(var r=new Fe,i=0,s=e.length;i<s;i++)r.add(e[i],t);return r};Fe.prototype.size=function(){return ze?this._set.size:Object.getOwnPropertyNames(this._set).length};Fe.prototype.add=function(e,t){var r=ze?e:hi.toSetString(e),i=ze?this.has(e):di.call(this._set,r),s=this._array.length;(!i||t)&&this._array.push(e),i||(ze?this._set.set(e,s):this._set[r]=s)};Fe.prototype.has=function(e){if(ze)return this._set.has(e);var t=hi.toSetString(e);return di.call(this._set,t)};Fe.prototype.indexOf=function(e){if(ze){var t=this._set.get(e);if(t>=0)return t}else{var r=hi.toSetString(e);if(di.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')};Fe.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};Fe.prototype.toArray=function(){return this._array.slice()};oa.ArraySet=Fe});var la=D(aa=>{var sa=ht();function Mp(n,e){var t=n.generatedLine,r=e.generatedLine,i=n.generatedColumn,s=e.generatedColumn;return r>t||r==t&&s>=i||sa.compareByGeneratedPositionsInflated(n,e)<=0}function jn(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}jn.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};jn.prototype.add=function(e){Mp(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};jn.prototype.toArray=function(){return this._sorted||(this._array.sort(sa.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};aa.MappingList=jn});var gi=D(ca=>{var Gt=pi(),ne=ht(),$n=mi().ArraySet,Tp=la().MappingList;function _e(n){n||(n={}),this._file=ne.getArg(n,"file",null),this._sourceRoot=ne.getArg(n,"sourceRoot",null),this._skipValidation=ne.getArg(n,"skipValidation",!1),this._sources=new $n,this._names=new $n,this._mappings=new Tp,this._sourcesContents=null}_e.prototype._version=3;_e.fromSourceMap=function(e){var t=e.sourceRoot,r=new _e({file:e.file,sourceRoot:t});return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,t!=null&&(s.source=ne.relative(t,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),r.addMapping(s)}),e.sources.forEach(function(i){var s=i;t!==null&&(s=ne.relative(t,i)),r._sources.has(s)||r._sources.add(s);var a=e.sourceContentFor(i);a!=null&&r.setSourceContent(i,a)}),r};_e.prototype.addMapping=function(e){var t=ne.getArg(e,"generated"),r=ne.getArg(e,"original",null),i=ne.getArg(e,"source",null),s=ne.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:i,name:s})};_e.prototype.setSourceContent=function(e,t){var r=e;this._sourceRoot!=null&&(r=ne.relative(this._sourceRoot,r)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ne.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[ne.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};_e.prototype.applySourceMap=function(e,t,r){var i=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=ne.relative(s,i));var a=new $n,l=new $n;this._mappings.unsortedForEach(function(p){if(p.source===i&&p.originalLine!=null){var c=e.originalPositionFor({line:p.originalLine,column:p.originalColumn});c.source!=null&&(p.source=c.source,r!=null&&(p.source=ne.join(r,p.source)),s!=null&&(p.source=ne.relative(s,p.source)),p.originalLine=c.line,p.originalColumn=c.column,c.name!=null&&(p.name=c.name))}var h=p.source;h!=null&&!a.has(h)&&a.add(h);var u=p.name;u!=null&&!l.has(u)&&l.add(u)},this),this._sources=a,this._names=l,e.sources.forEach(function(p){var c=e.sourceContentFor(p);c!=null&&(r!=null&&(p=ne.join(r,p)),s!=null&&(p=ne.relative(s,p)),this.setSourceContent(p,c))},this)};_e.prototype._validateMapping=function(e,t,r,i){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!r&&!i)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:i}))}};_e.prototype._serializeMappings=function(){for(var e=0,t=1,r=0,i=0,s=0,a=0,l="",p,c,h,u,d=this._mappings.toArray(),v=0,E=d.length;v<E;v++){if(c=d[v],p="",c.generatedLine!==t)for(e=0;c.generatedLine!==t;)p+=";",t++;else if(v>0){if(!ne.compareByGeneratedPositionsInflated(c,d[v-1]))continue;p+=","}p+=Gt.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(u=this._sources.indexOf(c.source),p+=Gt.encode(u-a),a=u,p+=Gt.encode(c.originalLine-1-i),i=c.originalLine-1,p+=Gt.encode(c.originalColumn-r),r=c.originalColumn,c.name!=null&&(h=this._names.indexOf(c.name),p+=Gt.encode(h-s),s=h)),l+=p}return l};_e.prototype._generateSourcesContent=function(e,t){return e.map(function(r){if(!this._sourcesContents)return null;t!=null&&(r=ne.relative(t,r));var i=ne.toSetString(r);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};_e.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};_e.prototype.toString=function(){return JSON.stringify(this.toJSON())};ca.SourceMapGenerator=_e});var ua=D(Qe=>{Qe.GREATEST_LOWER_BOUND=1;Qe.LEAST_UPPER_BOUND=2;function vi(n,e,t,r,i,s){var a=Math.floor((e-n)/2)+n,l=i(t,r[a],!0);return l===0?a:l>0?e-a>1?vi(a,e,t,r,i,s):s==Qe.LEAST_UPPER_BOUND?e<r.length?e:-1:a:a-n>1?vi(n,a,t,r,i,s):s==Qe.LEAST_UPPER_BOUND?a:n<0?-1:n}Qe.search=function(e,t,r,i){if(t.length===0)return-1;var s=vi(-1,t.length,e,t,r,i||Qe.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&r(t[s],t[s-1],!0)===0;)--s;return s}});var fa=D(pa=>{function _i(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function Dp(n,e){return Math.round(n+Math.random()*(e-n))}function yi(n,e,t,r){if(t<r){var i=Dp(t,r),s=t-1;_i(n,i,r);for(var a=n[r],l=t;l<r;l++)e(n[l],a)<=0&&(s+=1,_i(n,s,l));_i(n,s+1,l);var p=s+1;yi(n,e,t,p-1),yi(n,e,p+1,r)}}pa.quickSort=function(n,e){yi(n,e,0,n.length-1)}});var da=D(Gn=>{var L=ht(),wi=ua(),dt=mi().ArraySet,Vp=pi(),Wt=fa().quickSort;function J(n,e){var t=n;return typeof n=="string"&&(t=L.parseSourceMapInput(n)),t.sections!=null?new be(t,e):new ie(t,e)}J.fromSourceMap=function(n,e){return ie.fromSourceMap(n,e)};J.prototype._version=3;J.prototype.__generatedMappings=null;Object.defineProperty(J.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});J.prototype.__originalMappings=null;Object.defineProperty(J.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});J.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return r===";"||r===","};J.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};J.GENERATED_ORDER=1;J.ORIGINAL_ORDER=2;J.GREATEST_LOWER_BOUND=1;J.LEAST_UPPER_BOUND=2;J.prototype.eachMapping=function(e,t,r){var i=t||null,s=r||J.GENERATED_ORDER,a;switch(s){case J.GENERATED_ORDER:a=this._generatedMappings;break;case J.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;a.map(function(p){var c=p.source===null?null:this._sources.at(p.source);return c=L.computeSourceURL(l,c,this._sourceMapURL),{source:c,generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:p.name===null?null:this._names.at(p.name)}},this).forEach(e,i)};J.prototype.allGeneratedPositionsFor=function(e){var t=L.getArg(e,"line"),r={source:L.getArg(e,"source"),originalLine:t,originalColumn:L.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var i=[],s=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",L.compareByOriginalPositions,wi.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(e.column===void 0)for(var l=a.originalLine;a&&a.originalLine===l;)i.push({line:L.getArg(a,"generatedLine",null),column:L.getArg(a,"generatedColumn",null),lastColumn:L.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var p=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==p;)i.push({line:L.getArg(a,"generatedLine",null),column:L.getArg(a,"generatedColumn",null),lastColumn:L.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return i};Gn.SourceMapConsumer=J;function ie(n,e){var t=n;typeof n=="string"&&(t=L.parseSourceMapInput(n));var r=L.getArg(t,"version"),i=L.getArg(t,"sources"),s=L.getArg(t,"names",[]),a=L.getArg(t,"sourceRoot",null),l=L.getArg(t,"sourcesContent",null),p=L.getArg(t,"mappings"),c=L.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);a&&(a=L.normalize(a)),i=i.map(String).map(L.normalize).map(function(h){return a&&L.isAbsolute(a)&&L.isAbsolute(h)?L.relative(a,h):h}),this._names=dt.fromArray(s.map(String),!0),this._sources=dt.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(h){return L.computeSourceURL(a,h,e)}),this.sourceRoot=a,this.sourcesContent=l,this._mappings=p,this._sourceMapURL=e,this.file=c}ie.prototype=Object.create(J.prototype);ie.prototype.consumer=J;ie.prototype._findSourceIndex=function(n){var e=n;if(this.sourceRoot!=null&&(e=L.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==n)return t;return-1};ie.fromSourceMap=function(e,t){var r=Object.create(ie.prototype),i=r._names=dt.fromArray(e._names.toArray(),!0),s=r._sources=dt.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=t,r._absoluteSources=r._sources.toArray().map(function(v){return L.computeSourceURL(r.sourceRoot,v,t)});for(var a=e._mappings.toArray().slice(),l=r.__generatedMappings=[],p=r.__originalMappings=[],c=0,h=a.length;c<h;c++){var u=a[c],d=new ha;d.generatedLine=u.generatedLine,d.generatedColumn=u.generatedColumn,u.source&&(d.source=s.indexOf(u.source),d.originalLine=u.originalLine,d.originalColumn=u.originalColumn,u.name&&(d.name=i.indexOf(u.name)),p.push(d)),l.push(d)}return Wt(r.__originalMappings,L.compareByOriginalPositions),r};ie.prototype._version=3;Object.defineProperty(ie.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function ha(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}ie.prototype._parseMappings=function(e,t){for(var r=1,i=0,s=0,a=0,l=0,p=0,c=e.length,h=0,u={},d={},v=[],E=[],R,Y,V,G,le;h<c;)if(e.charAt(h)===";")r++,h++,i=0;else if(e.charAt(h)===",")h++;else{for(R=new ha,R.generatedLine=r,G=h;G<c&&!this._charIsMappingSeparator(e,G);G++);if(Y=e.slice(h,G),V=u[Y],V)h+=Y.length;else{for(V=[];h<G;)Vp.decode(e,h,d),le=d.value,h=d.rest,V.push(le);if(V.length===2)throw new Error("Found a source, but no line and column");if(V.length===3)throw new Error("Found a source and line, but no column");u[Y]=V}R.generatedColumn=i+V[0],i=R.generatedColumn,V.length>1&&(R.source=l+V[1],l+=V[1],R.originalLine=s+V[2],s=R.originalLine,R.originalLine+=1,R.originalColumn=a+V[3],a=R.originalColumn,V.length>4&&(R.name=p+V[4],p+=V[4])),E.push(R),typeof R.originalLine=="number"&&v.push(R)}Wt(E,L.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,Wt(v,L.compareByOriginalPositions),this.__originalMappings=v};ie.prototype._findMapping=function(e,t,r,i,s,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return wi.search(e,t,s,a)};ie.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};ie.prototype.originalPositionFor=function(e){var t={generatedLine:L.getArg(e,"line"),generatedColumn:L.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",L.compareByGeneratedPositionsDeflated,L.getArg(e,"bias",J.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var s=L.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=L.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var a=L.getArg(i,"name",null);return a!==null&&(a=this._names.at(a)),{source:s,line:L.getArg(i,"originalLine",null),column:L.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};ie.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ie.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var i=e;this.sourceRoot!=null&&(i=L.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=L.urlParse(this.sourceRoot))){var a=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')};ie.prototype.generatedPositionFor=function(e){var t=L.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:L.getArg(e,"line"),originalColumn:L.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",L.compareByOriginalPositions,L.getArg(e,"bias",J.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===r.source)return{line:L.getArg(s,"generatedLine",null),column:L.getArg(s,"generatedColumn",null),lastColumn:L.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Gn.BasicSourceMapConsumer=ie;function be(n,e){var t=n;typeof n=="string"&&(t=L.parseSourceMapInput(n));var r=L.getArg(t,"version"),i=L.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new dt,this._names=new dt;var s={line:-1,column:0};this._sections=i.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var l=L.getArg(a,"offset"),p=L.getArg(l,"line"),c=L.getArg(l,"column");if(p<s.line||p===s.line&&c<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=l,{generatedOffset:{generatedLine:p+1,generatedColumn:c+1},consumer:new J(L.getArg(a,"map"),e)}})}be.prototype=Object.create(J.prototype);be.prototype.constructor=J;be.prototype._version=3;Object.defineProperty(be.prototype,"sources",{get:function(){for(var n=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)n.push(this._sections[e].consumer.sources[t]);return n}});be.prototype.originalPositionFor=function(e){var t={generatedLine:L.getArg(e,"line"),generatedColumn:L.getArg(e,"column")},r=wi.search(t,this._sections,function(s,a){var l=s.generatedLine-a.generatedOffset.generatedLine;return l||s.generatedColumn-a.generatedOffset.generatedColumn}),i=this._sections[r];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};be.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};be.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r],s=i.consumer.sourceContentFor(e,!0);if(s)return s}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};be.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(r.consumer._findSourceIndex(L.getArg(e,"source"))!==-1){var i=r.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(r.generatedOffset.generatedLine-1),column:i.column+(r.generatedOffset.generatedLine===i.line?r.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};be.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var i=this._sections[r],s=i.consumer._generatedMappings,a=0;a<s.length;a++){var l=s[a],p=i.consumer._sources.at(l.source);p=L.computeSourceURL(i.consumer.sourceRoot,p,this._sourceMapURL),this._sources.add(p),p=this._sources.indexOf(p);var c=null;l.name&&(c=i.consumer._names.at(l.name),this._names.add(c),c=this._names.indexOf(c));var h={source:p,generatedLine:l.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(i.generatedOffset.generatedLine===l.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:c};this.__generatedMappings.push(h),typeof h.originalLine=="number"&&this.__originalMappings.push(h)}Wt(this.__generatedMappings,L.compareByGeneratedPositionsDeflated),Wt(this.__originalMappings,L.compareByOriginalPositions)};Gn.IndexedSourceMapConsumer=be});var ga=D(ma=>{var Fp=gi().SourceMapGenerator,Wn=ht(),Hp=/(\r?\n)/,Bp=10,mt="$$$isSourceNode$$$";function de(n,e,t,r,i){this.children=[],this.sourceContents={},this.line=n??null,this.column=e??null,this.source=t??null,this.name=i??null,this[mt]=!0,r!=null&&this.add(r)}de.fromStringWithSourceMap=function(e,t,r){var i=new de,s=e.split(Hp),a=0,l=function(){var d=E(),v=E()||"";return d+v;function E(){return a<s.length?s[a++]:void 0}},p=1,c=0,h=null;return t.eachMapping(function(d){if(h!==null)if(p<d.generatedLine)u(h,l()),p++,c=0;else{var v=s[a]||"",E=v.substr(0,d.generatedColumn-c);s[a]=v.substr(d.generatedColumn-c),c=d.generatedColumn,u(h,E),h=d;return}for(;p<d.generatedLine;)i.add(l()),p++;if(c<d.generatedColumn){var v=s[a]||"";i.add(v.substr(0,d.generatedColumn)),s[a]=v.substr(d.generatedColumn),c=d.generatedColumn}h=d},this),a<s.length&&(h&&u(h,l()),i.add(s.splice(a).join(""))),t.sources.forEach(function(d){var v=t.sourceContentFor(d);v!=null&&(r!=null&&(d=Wn.join(r,d)),i.setSourceContent(d,v))}),i;function u(d,v){if(d===null||d.source===void 0)i.add(v);else{var E=r?Wn.join(r,d.source):d.source;i.add(new de(d.originalLine,d.originalColumn,E,v,d.name))}}};de.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[mt]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};de.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[mt]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};de.prototype.walk=function(e){for(var t,r=0,i=this.children.length;r<i;r++)t=this.children[r],t[mt]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};de.prototype.join=function(e){var t,r,i=this.children.length;if(i>0){for(t=[],r=0;r<i-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this};de.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[mt]?r.replaceRight(e,t):typeof r=="string"?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this};de.prototype.setSourceContent=function(e,t){this.sourceContents[Wn.toSetString(e)]=t};de.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][mt]&&this.children[t].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),t=0,r=i.length;t<r;t++)e(Wn.fromSetString(i[t]),this.sourceContents[i[t]])};de.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};de.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new Fp(e),i=!1,s=null,a=null,l=null,p=null;return this.walk(function(c,h){t.code+=c,h.source!==null&&h.line!==null&&h.column!==null?((s!==h.source||a!==h.line||l!==h.column||p!==h.name)&&r.addMapping({source:h.source,original:{line:h.line,column:h.column},generated:{line:t.line,column:t.column},name:h.name}),s=h.source,a=h.line,l=h.column,p=h.name,i=!0):i&&(r.addMapping({generated:{line:t.line,column:t.column}}),s=null,i=!1);for(var u=0,d=c.length;u<d;u++)c.charCodeAt(u)===Bp?(t.line++,t.column=0,u+1===d?(s=null,i=!1):i&&r.addMapping({source:h.source,original:{line:h.line,column:h.column},generated:{line:t.line,column:t.column},name:h.name})):t.column++}),this.walkSourceContents(function(c,h){r.setSourceContent(c,h)}),{code:t.code,map:r}};ma.SourceNode=de});var va=D(Un=>{Un.SourceMapGenerator=gi().SourceMapGenerator;Un.SourceMapConsumer=da().SourceMapConsumer;Un.SourceNode=ga().SourceNode});var ba=D((Jn,wa)=>{"use strict";Jn.__esModule=!0;var xi=ae(),Xe=void 0;try{(typeof define!="function"||!define.amd)&&(_a=va(),Xe=_a.SourceNode)}catch{}var _a;Xe||(Xe=function(n,e,t,r){this.src="",r&&this.add(r)},Xe.prototype={add:function(e){xi.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){xi.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function bi(n,e,t){if(xi.isArray(n)){for(var r=[],i=0,s=n.length;i<s;i++)r.push(e.wrap(n[i],t));return r}else if(typeof n=="boolean"||typeof n=="number")return n+"";return n}function ya(n){this.srcFile=n,this.source=[]}ya.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,t){this.source.unshift(this.wrap(e,t))},push:function(e,t){this.source.push(this.wrap(e,t))},merge:function(){var e=this.empty();return this.each(function(t){e.add([" ",t,`
38
+ `])}),e},each:function(e){for(var t=0,r=this.source.length;t<r;t++)e(this.source[t])},empty:function(){var e=this.currentLocation||{start:{}};return new Xe(e.start.line,e.start.column,this.srcFile)},wrap:function(e){var t=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return e instanceof Xe?e:(e=bi(e,this,t),new Xe(t.start.line,t.start.column,this.srcFile,e))},functionCall:function(e,t,r){return r=this.generateList(r),this.wrap([e,t?"."+t+"(":"(",r,")"])},quotedString:function(e){return'"'+(e+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(e){var t=this,r=[];Object.keys(e).forEach(function(s){var a=bi(e[s],t);a!=="undefined"&&r.push([t.quotedString(s),":",a])});var i=this.generateList(r);return i.prepend("{"),i.add("}"),i},generateList:function(e){for(var t=this.empty(),r=0,i=e.length;r<i;r++)r&&t.add(","),t.add(bi(e[r],this));return t},generateArray:function(e){var t=this.generateList(e);return t.prepend("["),t.add("]"),t}};Jn.default=ya;wa.exports=Jn.default});var Ea=D((Yn,Aa)=>{"use strict";Yn.__esModule=!0;function Ca(n){return n&&n.__esModule?n:{default:n}}var xa=On(),qp=he(),Si=Ca(qp),jp=ae(),$p=ba(),Sa=Ca($p);function gt(n){this.value=n}function vt(){}vt.prototype={nameLookup:function(e,t){return this.internalNameLookup(e,t)},depthedLookup:function(e){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(e),")"]},compilerInfo:function(){var e=xa.COMPILER_REVISION,t=xa.REVISION_CHANGES[e];return[e,t]},appendToBuffer:function(e,t,r){return jp.isArray(e)||(e=[e]),e=this.source.wrap(e,t),this.environment.isSimple?["return ",e,";"]:r?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(e,t){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",e,",",JSON.stringify(t),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(e,t,r,i){this.environment=e,this.options=t,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!r,this.context=r||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,t),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var s=e.opcodes,a=void 0,l=void 0,p=void 0,c=void 0;for(p=0,c=s.length;p<c;p++)a=s[p],this.source.currentLocation=a.loc,l=l||a.loc,this[a.opcode].apply(this,a.args);if(this.source.currentLocation=l,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new Si.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
39
+ `]),this.decorators.push("return fn;"),i?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
40
+ `),this.decorators.push(`}
41
+ `),this.decorators=this.decorators.merge()));var h=this.createFunctionContext(i);if(this.isChild)return h;var u={compiler:this.compilerInfo(),main:h};this.decorators&&(u.main_d=this.decorators,u.useDecorators=!0);var d=this.context,v=d.programs,E=d.decorators;for(p=0,c=v.length;p<c;p++)u[p]=v[p],E[p]&&(u[p+"_d"]=E[p],u.useDecorators=!0);return this.environment.usePartial&&(u.usePartial=!0),this.options.data&&(u.useData=!0),this.useDepths&&(u.useDepths=!0),this.useBlockParams&&(u.useBlockParams=!0),this.options.compat&&(u.compat=!0),i?u.compilerOptions=this.options:(u.compiler=JSON.stringify(u.compiler),this.source.currentLocation={start:{line:1,column:0}},u=this.objectLiteral(u),t.srcName?(u=u.toStringWithSourceMap({file:t.destName}),u.map=u.map&&u.map.toString()):u=u.toString()),u},preamble:function(){this.lastContext=0,this.source=new Sa.default(this.options.srcName),this.decorators=new Sa.default(this.options.srcName)},createFunctionContext:function(e){var t=this,r="",i=this.stackVars.concat(this.registers.list);i.length>0&&(r+=", "+i.join(", "));var s=0;Object.keys(this.aliases).forEach(function(p){var c=t.aliases[p];c.children&&c.referenceCount>1&&(r+=", alias"+ ++s+"="+p,c.children[0]="alias"+s)}),this.lookupPropertyFunctionIsUsed&&(r+=", "+this.lookupPropertyFunctionVarDeclaration());var a=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths");var l=this.mergeSource(r);return e?(a.push(l),Function.apply(this,a)):this.source.wrap(["function(",a.join(","),`) {
42
+ `,l,"}"])},mergeSource:function(e){var t=this.environment.isSimple,r=!this.forceBuffer,i=void 0,s=void 0,a=void 0,l=void 0;return this.source.each(function(p){p.appendToBuffer?(a?p.prepend(" + "):a=p,l=p):(a&&(s?a.prepend("buffer += "):i=!0,l.add(";"),a=l=void 0),s=!0,t||(r=!1))}),r?a?(a.prepend("return "),l.add(";")):s||this.source.push('return "";'):(e+=", buffer = "+(i?"":this.initializeBuffer()),a?(a.prepend("return buffer + "),l.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(i?"":`;
43
+ `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
44
+ lookupProperty = container.lookupProperty || function(parent, propertyName) {
45
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
46
+ return parent[propertyName];
47
+ }
48
+ return undefined
49
+ }
50
+ `.trim()},blockValue:function(e){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs(e,0,r);var i=this.popStack();r.splice(1,0,i),this.push(this.source.functionCall(t,"call",r))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs("",0,t,!0),this.flushInline();var r=this.topStack();t.splice(1,0,r),this.pushSource(["if (!",this.lastHelper,") { ",r," = ",this.source.functionCall(e,"call",t),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(t){return[" != null ? ",t,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,r,i){var s=0;!i&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[s++])):this.pushContext(),this.resolvePath("context",e,s,t,r)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",t,1)},lookupData:function(e,t,r){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",t,0,!0,r)},resolvePath:function(e,t,r,i,s){var a=this;if(this.options.strict||this.options.assumeObjects){this.push(Gp(this.options.strict&&s,this,t,r,e));return}for(var l=t.length,p=function(h){a.replaceStack(function(u){var d=a.nameLookup(u,t[h],e);return i?[" && ",d]:[" != null ? ",d," : ",u]})},c=r;c<l;c++)p(c)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,t){this.pushContext(),this.pushString(t),t!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,t){var r=this.nameLookup("decorators",t,"decorator"),i=this.setupHelperArgs(t,e);this.decorators.push(["var decorator = ",r,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+t+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",i])," || fn;"])},invokeHelper:function(e,t,r){var i=this.popStack(),s=this.setupHelper(e,t),a=[];r&&a.push(s.name),a.push(i),this.options.strict||a.push(this.aliasable("container.hooks.helperMissing"));var l=["(",this.itemsSeparatedBy(a,"||"),")"],p=this.source.functionCall(l,"call",s.callParams);this.push(p)},itemsSeparatedBy:function(e,t){var r=[];r.push(e[0]);for(var i=1;i<e.length;i++)r.push(t,e[i]);return r},invokeKnownHelper:function(e,t){var r=this.setupHelper(e,t);this.push(this.source.functionCall(r.name,"call",r.callParams))},invokeAmbiguous:function(e,t){this.useRegister("helper");var r=this.popStack();this.emptyHash();var i=this.setupHelper(0,e,t),s=this.lastHelper=this.nameLookup("helpers",e,"helper"),a=["(","(helper = ",s," || ",r,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function(e,t,r){var i=[],s=this.setupParams(t,1,i);e&&(t=this.popStack(),delete s.name),r&&(s.indent=JSON.stringify(r)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",e?i.unshift(t):i.unshift(this.nameLookup("partials",t,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},assignToHash:function(e){var t=this.popStack(),r=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),r=this.popStack());var a=this.hash;r&&(a.contexts[e]=r),i&&(a.types[e]=i),s&&(a.ids[e]=s),a.values[e]=t},pushId:function(e,t,r){e==="BlockParam"?this.pushStackLiteral("blockParams["+t[0]+"].path["+t[1]+"]"+(r?" + "+JSON.stringify("."+r):"")):e==="PathExpression"?this.pushString(t):e==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:vt,compileChildren:function(e,t){for(var r=e.children,i=void 0,s=void 0,a=0,l=r.length;a<l;a++){i=r[a],s=new this.compiler;var p=this.matchExistingProgram(i);if(p==null){var c=this.context.programs.push("")-1;i.index=c,i.name="program"+c,this.context.programs[c]=s.compile(i,t,this.context,!this.precompile),this.context.decorators[c]=s.decorators,this.context.environments[c]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=p.index,i.name="program"+p.index,this.useDepths=this.useDepths||p.useDepths,this.useBlockParams=this.useBlockParams||p.useBlockParams}},matchExistingProgram:function(e){for(var t=0,r=this.context.environments.length;t<r;t++){var i=this.context.environments[t];if(i&&i.equals(e))return i}},programExpression:function(e){var t=this.environment.children[e],r=[t.index,"data",t.blockParams];return(this.useBlockParams||this.useDepths)&&r.push("blockParams"),this.useDepths&&r.push("depths"),"container.program("+r.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof gt||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new gt(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var t=["("],r=void 0,i=void 0,s=void 0;if(!this.isInline())throw new Si.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof gt)r=[a.value],t=["(",r],s=!0;else{i=!0;var l=this.incrStack();t=["((",this.push(l)," = ",a,")"],r=this.topStack()}var p=e.call(this,r);s||this.popStack(),i&&this.stackSlot--,this.push(t.concat(p,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,r=e.length;t<r;t++){var i=e[t];if(i instanceof gt)this.compileStack.push(i);else{var s=this.incrStack();this.pushSource([s," = ",i,";"]),this.compileStack.push(s)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var t=this.isInline(),r=(t?this.inlineStack:this.compileStack).pop();if(!e&&r instanceof gt)return r.value;if(!t){if(!this.stackSlot)throw new Si.default("Invalid stack pop");this.stackSlot--}return r},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,t=e[e.length-1];return t instanceof gt?t.value:t},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var t=this.aliases[e];return t?(t.referenceCount++,t):(t=this.aliases[e]=this.source.wrap(e),t.aliasable=!0,t.referenceCount=1,t)},setupHelper:function(e,t,r){var i=[],s=this.setupHelperArgs(t,e,i,r),a=this.nameLookup("helpers",t,"helper"),l=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:a,callParams:[l].concat(i)}},setupParams:function(e,t,r){var i={},s=[],a=[],l=[],p=!r,c=void 0;p&&(r=[]),i.name=this.quotedString(e),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var h=this.popStack(),u=this.popStack();(u||h)&&(i.fn=u||"container.noop",i.inverse=h||"container.noop");for(var d=t;d--;)c=this.popStack(),r[d]=c,this.trackIds&&(l[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),s[d]=this.popStack());return p&&(i.args=this.source.generateArray(r)),this.trackIds&&(i.ids=this.source.generateArray(l)),this.stringParams&&(i.types=this.source.generateArray(a),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},setupHelperArgs:function(e,t,r,i){var s=this.setupParams(e,t,r);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),r.push("options"),["options=",s]):r?(r.push(s),""):s}};(function(){for(var n="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=vt.RESERVED_WORDS={},t=0,r=n.length;t<r;t++)e[n[t]]=!0})();vt.isValidJavaScriptVariableName=function(n){return!vt.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)};function Gp(n,e,t,r,i){var s=e.popStack(),a=t.length;n&&a--;for(var l=r;l<a;l++)s=e.nameLookup(s,t[l],i);return n?[e.aliasable("container.strict"),"(",s,", ",e.quotedString(t[a]),", ",JSON.stringify(e.source.currentLocation)," )"]:s}Yn.default=vt;Aa.exports=Yn.default});var Pa=D((Kn,Oa)=>{"use strict";Kn.__esModule=!0;function Ut(n){return n&&n.__esModule?n:{default:n}}var Wp=Ls(),Up=Ut(Wp),Jp=Xr(),Yp=Ut(Jp),Ci=$s(),Ai=Js(),Kp=Ea(),zp=Ut(Kp),Qp=Hn(),Xp=Ut(Qp),Zp=Yr(),ef=Ut(Zp),tf=Up.default.create;function ka(){var n=tf();return n.compile=function(e,t){return Ai.compile(e,t,n)},n.precompile=function(e,t){return Ai.precompile(e,t,n)},n.AST=Yp.default,n.Compiler=Ai.Compiler,n.JavaScriptCompiler=zp.default,n.Parser=Ci.parser,n.parse=Ci.parse,n.parseWithoutProcessing=Ci.parseWithoutProcessing,n}var _t=ka();_t.create=ka;ef.default(_t);_t.Visitor=Xp.default;_t.default=_t;Kn.default=_t;Oa.exports=Kn.default});var Ia=D(zn=>{"use strict";zn.__esModule=!0;zn.print=sf;zn.PrintVisitor=ee;function nf(n){return n&&n.__esModule?n:{default:n}}var rf=Hn(),of=nf(rf);function sf(n){return new ee().accept(n)}function ee(){this.padding=0}ee.prototype=new of.default;ee.prototype.pad=function(n){for(var e="",t=0,r=this.padding;t<r;t++)e+=" ";return e+=n+`
51
+ `,e};ee.prototype.Program=function(n){var e="",t=n.body,r=void 0,i=void 0;if(n.blockParams){var s="BLOCK PARAMS: [";for(r=0,i=n.blockParams.length;r<i;r++)s+=" "+n.blockParams[r];s+=" ]",e+=this.pad(s)}for(r=0,i=t.length;r<i;r++)e+=this.accept(t[r]);return this.padding--,e};ee.prototype.MustacheStatement=function(n){return this.pad("{{ "+this.SubExpression(n)+" }}")};ee.prototype.Decorator=function(n){return this.pad("{{ DIRECTIVE "+this.SubExpression(n)+" }}")};ee.prototype.BlockStatement=ee.prototype.DecoratorBlock=function(n){var e="";return e+=this.pad((n.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(n)),n.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(n.program),this.padding--),n.inverse&&(n.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(n.inverse),this.padding--,n.program&&this.padding--),this.padding--,e};ee.prototype.PartialStatement=function(n){var e="PARTIAL:"+n.name.original;return n.params[0]&&(e+=" "+this.accept(n.params[0])),n.hash&&(e+=" "+this.accept(n.hash)),this.pad("{{> "+e+" }}")};ee.prototype.PartialBlockStatement=function(n){var e="PARTIAL BLOCK:"+n.name.original;return n.params[0]&&(e+=" "+this.accept(n.params[0])),n.hash&&(e+=" "+this.accept(n.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(n.program),this.padding--,this.pad("{{> "+e+" }}")};ee.prototype.ContentStatement=function(n){return this.pad("CONTENT[ '"+n.value+"' ]")};ee.prototype.CommentStatement=function(n){return this.pad("{{! '"+n.value+"' }}")};ee.prototype.SubExpression=function(n){for(var e=n.params,t=[],r=void 0,i=0,s=e.length;i<s;i++)t.push(this.accept(e[i]));return e="["+t.join(", ")+"]",r=n.hash?" "+this.accept(n.hash):"",this.accept(n.path)+" "+e+r};ee.prototype.PathExpression=function(n){var e=n.parts.join("/");return(n.data?"@":"")+"PATH:"+e};ee.prototype.StringLiteral=function(n){return'"'+n.value+'"'};ee.prototype.NumberLiteral=function(n){return"NUMBER{"+n.value+"}"};ee.prototype.BooleanLiteral=function(n){return"BOOLEAN{"+n.value+"}"};ee.prototype.UndefinedLiteral=function(){return"UNDEFINED"};ee.prototype.NullLiteral=function(){return"NULL"};ee.prototype.Hash=function(n){for(var e=n.pairs,t=[],r=0,i=e.length;r<i;r++)t.push(this.accept(e[r]));return"HASH{"+t.join(", ")+"}"};ee.prototype.HashPair=function(n){return n.key+"="+this.accept(n.value)}});var Ma=D((Vd,Ra)=>{var Qn=Pa().default,Na=Ia();Qn.PrintVisitor=Na.PrintVisitor;Qn.print=Na.print;Ra.exports=Qn;function La(n,e){var t=we("fs"),r=t.readFileSync(e,"utf8");n.exports=Qn.compile(r)}typeof we<"u"&&we.extensions&&(we.extensions[".handlebars"]=La,we.extensions[".hbs"]=La)});var Ui=Ri(Wi(),1),{program:$f,createCommand:Gf,createArgument:Wf,createOption:Uf,CommanderError:Jf,InvalidArgumentError:Yf,InvalidOptionArgumentError:Kf,Command:Ji,Argument:zf,Option:Qf,Help:Xf}=Ui.default;var Yi=`# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json
30
52
  cli_contracts: 0.1.0
31
53
 
32
54
  info:
@@ -227,7 +249,7 @@ command_sets:
227
249
  encoding: utf-8
228
250
  '1':
229
251
  description: Build failed.
230
- `,pt=`{
252
+ `,Ki=`{
231
253
  "cli_contracts": "0.1.0",
232
254
  "info": {
233
255
  "title": "view-contracts CLI",
@@ -515,126 +537,89 @@ command_sets:
515
537
  }
516
538
  }
517
539
  }
518
- }`;function ft(o,e){let t=new lt;t.name("view-contracts").version(e,"-V, --version").description("View contract compiler and renderer toolchain."),t.command("compile").description("Compile .view.tsx files to View IR.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(c,l)=>{await o.compile(c,l.optsWithGlobals())});let i=t.command("render");i.command("react").description("Generate React components from View IR.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(c,l)=>{await o.renderReact(c,l.optsWithGlobals())}),i.command("bridge").description("Generate view \u2194 ViewModel bridge registry.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(c,l)=>{await o.renderBridge(c,l.optsWithGlobals())}),t.command("build").description("Full view pipeline (compile + render runtime + render react + bridge).").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(c,l)=>{await o.build(c,l.optsWithGlobals())});let r=t.command("contracts");return r.command("generate").description("Generate ViewModel types from OpenAPI via micro-contracts.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(c,l)=>{await o.contractsGenerate(c,l.optsWithGlobals())}),r.command("check").description("Lint OpenAPI screen contracts via micro-contracts.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(c,l)=>{await o.contractsCheck(c,l.optsWithGlobals())}),t.command("catalog").command("build").description("Build static catalog HTML for design review.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").option("-o, --output <path>","Output HTML path (defaults to dist/catalog.html next to bindings).").action(async(c,l)=>{await o.catalogBuild(c,l.optsWithGlobals())}),t.command("extract").description("Extract contract specification for this CLI tool.").argument("[commands...]","Command IDs to extract. Use dot notation.").option("-a, --all","Extract all commands.",!1).option("--include-meta","Include extraction metadata.",!0).option("-F, --format <format>","Output format (yaml or json).","yaml").action(async(c,l,p)=>{c.length===0&&!l.all&&(process.stderr.write(JSON.stringify({code:"INVALID_ARGS",message:"Specify command IDs or use --all"})+`
519
- `),process.exit(2));let m=l.format||"yaml",h=JSON.parse(pt),u=l.all?[]:c;if(u.length===0)if(m==="json"){let f={};l.includeMeta&&(f._meta={source:"embedded",type:"cli-contracts/extract",extractedAt:new Date().toISOString(),specVersion:h.cli_contracts??"0.1.0",commands:["view-contracts.compile","view-contracts.render.react","view-contracts.render.bridge","view-contracts.build","view-contracts.contracts.generate","view-contracts.contracts.check","view-contracts.catalog.build"]}),Object.assign(f,h),process.stdout.write(JSON.stringify(f,null,2)+`
520
- `)}else{let f=[];if(f.push("# view-contracts extract"),f.push("# source: embedded"),f.push("# type: cli-contracts/command-extract"),l.includeMeta){f.push("---"),f.push("source: embedded"),f.push("type: cli-contracts/command-extract"),f.push("extractedAt: "+new Date().toISOString()),f.push("spec_version: "+(h.cli_contracts??"0.1.0")),f.push("commands:");for(let E of["view-contracts.compile","view-contracts.render.react","view-contracts.render.bridge","view-contracts.build","view-contracts.contracts.generate","view-contracts.contracts.check","view-contracts.catalog.build"])f.push(" - "+E)}f.push("---"),f.push(ut),process.stdout.write(f.join(`
540
+ }`;function zi(n,e){let t=new Ji;t.name("view-contracts").version(e,"-V, --version").description("View contract compiler and renderer toolchain."),t.command("compile").description("Compile .view.tsx files to View IR.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(a,l)=>{await n.compile(a,l.optsWithGlobals())});let r=t.command("render");r.command("react").description("Generate React components from View IR.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(a,l)=>{await n.renderReact(a,l.optsWithGlobals())}),r.command("bridge").description("Generate view \u2194 ViewModel bridge registry.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(a,l)=>{await n.renderBridge(a,l.optsWithGlobals())}),t.command("build").description("Full view pipeline (compile + render runtime + render react + bridge).").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(a,l)=>{await n.build(a,l.optsWithGlobals())});let i=t.command("contracts");return i.command("generate").description("Generate ViewModel types from OpenAPI via micro-contracts.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(a,l)=>{await n.contractsGenerate(a,l.optsWithGlobals())}),i.command("check").description("Lint OpenAPI screen contracts via micro-contracts.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").action(async(a,l)=>{await n.contractsCheck(a,l.optsWithGlobals())}),t.command("catalog").command("build").description("Build static catalog HTML for design review.").option("-c, --config <path>","Path to view-contracts.config.yaml (discovered upward from cwd when omitted).").option("-o, --output <path>","Output HTML path (defaults to dist/catalog.html next to bindings).").action(async(a,l)=>{await n.catalogBuild(a,l.optsWithGlobals())}),t.command("extract").description("Extract contract specification for this CLI tool.").argument("[commands...]","Command IDs to extract. Use dot notation.").option("-a, --all","Extract all commands.",!1).option("--include-meta","Include extraction metadata.",!0).option("-F, --format <format>","Output format (yaml or json).","yaml").action(async(a,l,p)=>{a.length===0&&!l.all&&(process.stderr.write(JSON.stringify({code:"INVALID_ARGS",message:"Specify command IDs or use --all"})+`
541
+ `),process.exit(2));let c=l.format||"yaml",h=JSON.parse(Ki),u=l.all?[]:a;if(u.length===0)if(c==="json"){let d={};l.includeMeta&&(d._meta={source:"embedded",type:"cli-contracts/extract",extractedAt:new Date().toISOString(),specVersion:h.cli_contracts??"0.1.0",commands:["view-contracts.compile","view-contracts.render.react","view-contracts.render.bridge","view-contracts.build","view-contracts.contracts.generate","view-contracts.contracts.check","view-contracts.catalog.build"]}),Object.assign(d,h),process.stdout.write(JSON.stringify(d,null,2)+`
542
+ `)}else{let d=[];if(d.push("# view-contracts extract"),d.push("# source: embedded"),d.push("# type: cli-contracts/command-extract"),l.includeMeta){d.push("---"),d.push("source: embedded"),d.push("type: cli-contracts/command-extract"),d.push("extractedAt: "+new Date().toISOString()),d.push("spec_version: "+(h.cli_contracts??"0.1.0")),d.push("commands:");for(let v of["view-contracts.compile","view-contracts.render.react","view-contracts.render.bridge","view-contracts.build","view-contracts.contracts.generate","view-contracts.contracts.check","view-contracts.catalog.build"])d.push(" - "+v)}d.push("---"),d.push(Yi),process.stdout.write(d.join(`
521
543
  `)+`
522
- `)}else{let f={cli_contracts:h.cli_contracts,info:h.info,command_sets:{}},E=f.command_sets;for(let[k,L]of Object.entries(h.command_sets??{})){let te=L.commands;if(!te)continue;let D={};for(let[G,ie]of Object.entries(te)){let J=k+"."+G;u.some(W=>W===G||W===J||G.startsWith(W+"."))&&(D[G]=ie)}if(Object.keys(D).length>0){let G={...L};G.commands=D,E[k]=G}}h.components&&(f.components=h.components),process.stdout.write(JSON.stringify(f,null,2)+`
523
- `)}process.exit(0)}),t}import{writeFile as Ur,mkdir as Jr}from"node:fs/promises";import{resolve as xe,dirname as li}from"node:path";import{spawn as ui}from"node:child_process";import{fileURLToPath as Yr}from"node:url";import{readFile as Ui}from"node:fs/promises";import{basename as Ji,relative as Yi,resolve as Ki}from"node:path";import{readFileSync as Di}from"node:fs";import{dirname as gt,resolve as Fi}from"node:path";import S from"typescript";var dt=new Set(["App","Box","Button","Checkbox","Column","Divider","Drawer","Field","Form","Heading","Icon","IconButton","Image","Link","List","ListItem","Modal","Page","Popover","Progress","Radio","Row","SafeArea","ScrollArea","Select","Spacer","Spinner","Stack","Switch","Text","TextArea","TextInput","Tooltip"]);import{readFileSync as $i}from"node:fs";import{resolve as Li}from"node:path";import F from"typescript";function Ln(o,e){let t=new Map;for(let i of o.statements){if(!F.isImportDeclaration(i)||!i.importClause?.namedBindings||!F.isStringLiteral(i.moduleSpecifier)||!F.isNamedImports(i.importClause.namedBindings))continue;let r=i.moduleSpecifier.text;r.endsWith(".tsx")||(r=`${r}.tsx`);let a=Li(e,r);for(let c of i.importClause.namedBindings.elements)t.set(c.name.text,a)}return t}function Mi(o){if(!F.isObjectBindingPattern(o.name)||o.name.elements.length===0)return null;let e=o.name.elements[0];return!F.isBindingElement(e)||!F.isIdentifier(e.name)?null:e.name.text}function Vi(o){if(F.isParenthesizedExpression(o))return o.expression;if(F.isJsxElement(o)||F.isJsxSelfClosingElement(o)||F.isJsxFragment(o))return o;if(F.isBlock(o)&&o.statements.length===1){let e=o.statements[0];if(F.isReturnStatement(e)&&e.expression)return F.isParenthesizedExpression(e.expression)?e.expression.expression:e.expression}return null}function mt(o){if(!F.isIdentifier(o.expression)||o.expression.text!=="view"||o.arguments.length!==1)return null;let e=o.arguments[0];if(!F.isArrowFunction(e)&&!F.isFunctionExpression(e))return null;let t="__noop";if(e.parameters.length===1){let r=Mi(e.parameters[0]);if(r)t=r;else if(F.isIdentifier(e.parameters[0].name))t=e.parameters[0].name.text;else return null}else if(e.parameters.length>1)return null;let i=Vi(e.body);return i?{paramName:t,jsxRoot:i}:null}function ht(o,e){let t=$i(o,"utf-8"),i=F.createSourceFile(o,t,F.ScriptTarget.Latest,!0,F.ScriptKind.TSX),r=null;function a(c){if(F.isVariableStatement(c))for(let l of c.declarationList.declarations){if(!F.isIdentifier(l.name)||l.name.text!==e||!l.initializer||!F.isCallExpression(l.initializer))continue;let p=mt(l.initializer);p&&(r=p)}if(F.isExportAssignment(c)&&c.isExportEquals===!1&&c.expression&&F.isCallExpression(c.expression)){let l=mt(c.expression);l&&e==="default"&&(r=l)}F.forEachChild(c,a)}return a(i),r}function Mn(o){return o.join(".")}function Vn(o){if(S.isIdentifier(o))return[o.text];if(S.isPropertyAccessExpression(o)){let e=Vn(o.expression);return e?[...e,o.name.text]:null}return null}function ji(o){return typeof o=="object"&&o!==null&&"kind"in o&&o.kind==="binding"}function wt(o,e){if(e.length===0)return o;let t=e.join(".");return{kind:"binding",path:o.path?`${o.path}.${t}`:t,scope:o.scope}}function tn(o,e){let t=Vn(o);if(!t)return null;if(t[0]in e.propBindings)return wt(e.propBindings[t[0]],t.slice(1));if(t[0]===e.vmName)return{kind:"binding",path:Mn(t.slice(1))};let i=e.scopes[e.scopes.length-1];return i&&t[0]===i?{kind:"binding",path:Mn(t.slice(1)),scope:i}:null}function Hi(o,e){let t,i={};for(let r of o.properties){if(!S.isPropertyAssignment(r)||!S.isIdentifier(r.name))continue;let a=r.name.text;if(a==="name"&&S.isStringLiteral(r.initializer)){t=r.initializer.text;continue}if(a==="params"&&S.isObjectLiteralExpression(r.initializer))for(let c of r.initializer.properties){if(!S.isPropertyAssignment(c)||!S.isIdentifier(c.name))continue;let l=rn(c.initializer,e);l!==null&&(i[c.name.text]=l)}}return t?Object.keys(i).length>0?{kind:"action",name:t,params:i}:{kind:"action",name:t}:null}function rn(o,e){if(S.isStringLiteral(o)||S.isNoSubstitutionTemplateLiteral(o))return o.text;if(o.kind===S.SyntaxKind.TrueKeyword)return!0;if(o.kind===S.SyntaxKind.FalseKeyword)return!1;if(S.isNumericLiteral(o))return Number(o.text);if(o.kind===S.SyntaxKind.NullKeyword)return null;let t=tn(o,e);if(t)return t;if(S.isObjectLiteralExpression(o)){let i=Hi(o,e);if(i)return i;let r={};for(let a of o.properties){if(!S.isPropertyAssignment(a)||!S.isIdentifier(a.name))continue;let c=rn(a.initializer,e);c!==null&&(r[a.name.text]=c)}return{kind:"literal",value:r}}if(S.isArrayLiteralExpression(o)){let i=[];for(let r of o.elements){if(!S.isExpression(r))continue;let a=rn(r,e);a!==null&&i.push(a)}return i}return null}function Bi(o){return S.isIdentifier(o)?o.text:S.isPropertyAccessExpression(o)&&S.isIdentifier(o.name)?o.name.text:null}function xt(o){return o.getText()}function yt(o,e){let t=[];for(let i of o){if(S.isJsxText(i)){let r=i.getText().trim();r&&t.push({kind:"text",value:r});continue}if(S.isJsxExpression(i)&&i.expression){let r=tn(i.expression,e);if(r){t.push(r);continue}let a=_t(i.expression,e);a&&(Array.isArray(a)?t.push(...a):t.push(a));continue}if(S.isJsxElement(i)||S.isJsxSelfClosingElement(i)){let r=$e(i,e);r&&t.push(r)}}return t}function Gi(o,e){if(o.length===0)return null;let t=o[0];return t in e.propBindings?wt(e.propBindings[t],o.slice(1)):t===e.vmName?{kind:"binding",path:Mn(o.slice(1))}:null}function _t(o,e){if(S.isParenthesizedExpression(o))return _t(o.expression,e);if(S.isCallExpression(o)&&S.isPropertyAccessExpression(o.expression)){let i=Vn(o.expression.expression),r=o.expression.name.text;if(i&&r==="map"&&o.arguments.length>=1){let a=Gi(i,e);if(!a)return null;let c=o.arguments[0];if(!S.isArrowFunction(c)&&!S.isFunctionExpression(c))return e.errors.push("map callback must be an arrow function"),null;let l=c.parameters;if(l.length!==1||!S.isIdentifier(l[0].name))return e.errors.push("map callback must have a single item parameter"),null;let p=l[0].name.text,m={...e,scopes:[...e.scopes,p]},h=null,u=S.isParenthesizedExpression(c.body)?c.body.expression:c.body;if(S.isBlock(c.body))return e.errors.push("map callback body must be a JSX expression, not a block"),null;if(S.isJsxElement(u)||S.isJsxSelfClosingElement(u)?h=$e(u,m):S.isJsxFragment(u)&&(h=Dn(u,m)),!h)return null;let f;if(S.isJsxElement(u)||S.isJsxSelfClosingElement(u)){let E=S.isJsxElement(u)?u.openingElement.attributes:u.attributes;for(let k of E.properties)if(!(!S.isJsxAttribute(k)||xt(k.name)!=="key"||!k.initializer)&&S.isJsxExpression(k.initializer)&&k.initializer.expression){let L=tn(k.initializer.expression,m);L&&(f=L)}}return{kind:"map",source:a,item:p,key:f,body:h}}}if(S.isJsxElement(o)||S.isJsxSelfClosingElement(o))return $e(o,e);let t=tn(o,e);return t||null}function Dn(o,e){return{kind:"fragment",children:yt(o.children,e)}}function qi(o,e,t){let i=t.viewImports.get(o);if(!i)return null;let r=ht(i,o);if(!r)return t.errors.push(`View component "${o}" is imported but has no view() export`),null;let a=Di(i,"utf-8"),c=S.createSourceFile(i,a,S.ScriptTarget.Latest,!0,S.ScriptKind.TSX),l=Ln(c,gt(i)),p=new Map([...t.viewImports,...l]),m={...t.propBindings};for(let[u,f]of Object.entries(e))ji(f)&&(m[u]=f);let h={...t,vmName:r.paramName,propBindings:m,scopes:[],viewImports:p};return S.isJsxElement(r.jsxRoot)||S.isJsxSelfClosingElement(r.jsxRoot)?$e(r.jsxRoot,h):S.isJsxFragment(r.jsxRoot)?Dn(r.jsxRoot,h):null}function $e(o,e){let t=S.isJsxElement(o)?o.openingElement:o,i=Bi(t.tagName);if(!i)return e.errors.push("Unsupported JSX tag expression"),null;let r={};for(let c of t.attributes.properties){if(!S.isJsxAttribute(c))continue;let l=xt(c.name);if(l!=="key"){if(!c.initializer){r[l]=!0;continue}if(S.isStringLiteral(c.initializer)){r[l]=c.initializer.text;continue}if(S.isJsxExpression(c.initializer)&&c.initializer.expression){let p=rn(c.initializer.expression,e);p!==null&&(r[l]=p)}}}if(!e.allowedComponents.has(i)){let c=qi(i,r,e);return c||(e.errors.push(`Component "${i}" is not in the allowed registry`),null)}let a=S.isJsxElement(o)?yt(o.children,e):[];return{kind:"component",name:i,props:r,children:a}}function Wi(o){let e=null;function t(i){if(S.isCallExpression(i)&&S.isIdentifier(i.expression)&&i.expression.text==="screen"&&i.arguments.length===1&&(S.isArrowFunction(i.arguments[0])||S.isFunctionExpression(i.arguments[0]))){let r=i.arguments[0],a="unknown";if(i.typeArguments&&i.typeArguments.length===1){let l=i.typeArguments[0];S.isTypeReferenceNode(l)&&S.isIdentifier(l.typeName)&&(a=l.typeName.text)}let c=r.body;if(S.isParenthesizedExpression(c))(S.isJsxElement(c.expression)||S.isJsxSelfClosingElement(c.expression))&&(e={viewModel:a,jsxRoot:c.expression});else if(S.isJsxElement(c)||S.isJsxSelfClosingElement(c))e={viewModel:a,jsxRoot:c};else if(S.isBlock(c)&&c.statements.length===1){let l=c.statements[0];S.isReturnStatement(l)&&l.expression&&(S.isParenthesizedExpression(l.expression)?e={viewModel:a,jsxRoot:l.expression.expression}:e={viewModel:a,jsxRoot:l.expression})}}S.forEachChild(i,t)}return t(o),e}function vt(o,e,t,i={}){let r=new Set(dt);for(let u of i.allowlistExtra??[])r.add(u);let a=Fi(e),c=gt(a),l=S.createSourceFile(a,o,S.ScriptTarget.Latest,!0,S.ScriptKind.TSX),p={vmName:"vm",scopes:[],propBindings:{},errors:[],viewImports:Ln(l,c),allowedComponents:r},m=Wi(l);if(!m)return{viewModel:"unknown",exportName:t,root:{kind:"fragment",children:[]},errors:["No screen<T>() default export found"]};let h=S.isJsxElement(m.jsxRoot)||S.isJsxSelfClosingElement(m.jsxRoot)?$e(m.jsxRoot,p):S.isJsxFragment(m.jsxRoot)?Dn(m.jsxRoot,p):null;return h?{viewModel:m.viewModel,exportName:t,root:h,errors:p.errors}:(p.errors.push("screen() callback must return a single JSX root element"),{viewModel:m.viewModel,exportName:t,root:{kind:"fragment",children:[]},errors:p.errors})}async function zi(o,e={}){let t=await Ui(o.sourcePath,"utf-8"),i=o.exportName??Ji(o.sourcePath,".view.tsx"),r=vt(t,o.sourcePath,i,{allowlistExtra:e.allowlistExtra});if(r.errors.length>0)throw new Error(`Compile errors in ${o.sourcePath}:
524
- ${r.errors.map(a=>` - ${a}`).join(`
525
- `)}`);return{version:1,source:Yi(process.cwd(),Ki(o.sourcePath)),viewModel:r.viewModel,exportName:r.exportName,root:r.root}}async function Ct(o,e={}){let t=[];for(let i of o)t.push(await zi(i,e));return t}import{access as ar,readFile as Bt}from"node:fs/promises";import{dirname as on,relative as cr,resolve as q}from"node:path";var Xi=Object.create,At=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,Zi=Object.getOwnPropertyNames,er=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,j=(o,e)=>()=>(e||(o((e={exports:{}}).exports,e),o=null),e.exports),tr=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var r=Zi(e),a=0,c=r.length,l;a<c;a++)l=r[a],!nr.call(o,l)&&l!==t&&At(o,l,{get:(p=>e[p]).bind(null,l),enumerable:!(i=Qi(e,l))||i.enumerable});return o},ir=(o,e,t)=>(t=o!=null?Xi(er(o)):{},tr(e||!o||!o.__esModule?At(t,"default",{value:o,enumerable:!0}):t,o)),Le=j(((o,e)=>{function t(p){return typeof p>"u"||p===null}function i(p){return typeof p=="object"&&p!==null}function r(p){return Array.isArray(p)?p:t(p)?[]:[p]}function a(p,m){if(m){let h=Object.keys(m);for(let u=0,f=h.length;u<f;u+=1){let E=h[u];p[E]=m[E]}}return p}function c(p,m){let h="";for(let u=0;u<m;u+=1)h+=p;return h}function l(p){return p===0&&Number.NEGATIVE_INFINITY===1/p}e.exports.isNothing=t,e.exports.isObject=i,e.exports.toArray=r,e.exports.repeat=c,e.exports.isNegativeZero=l,e.exports.extend=a})),Me=j(((o,e)=>{function t(r,a){let c="",l=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(c+='in "'+r.mark.name+'" '),c+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!a&&r.mark.snippet&&(c+=`
544
+ `)}else{let d={cli_contracts:h.cli_contracts,info:h.info,command_sets:{}},v=d.command_sets;for(let[E,R]of Object.entries(h.command_sets??{})){let Y=R.commands;if(!Y)continue;let V={};for(let[G,le]of Object.entries(Y)){let B=E+"."+G;u.some(X=>X===G||X===B||G.startsWith(X+"."))&&(V[G]=le)}if(Object.keys(V).length>0){let G={...R};G.commands=V,v[E]=G}}h.components&&(d.components=h.components),process.stdout.write(JSON.stringify(d,null,2)+`
545
+ `)}process.exit(0)}),t}import{writeFile as If,mkdir as Lf}from"node:fs/promises";import{resolve as et,dirname as Ua}from"node:path";import{spawn as Ja}from"node:child_process";import{fileURLToPath as Nf}from"node:url";import{readFile as Ol}from"node:fs/promises";import{basename as Pl,relative as Il,resolve as Ll}from"node:path";import{readFileSync as wl}from"node:fs";import{dirname as Zi,resolve as bl}from"node:path";import O from"typescript";var cn=new Set(["App","Box","Button","Checkbox","Column","Divider","Drawer","Field","Form","Heading","Icon","IconButton","Image","Link","List","ListItem","Modal","Page","Popover","Progress","Radio","Row","SafeArea","ScrollArea","Select","Spacer","Spinner","Stack","Switch","Text","TextArea","TextInput","Tooltip"]);import{readFileSync as gl}from"node:fs";import{resolve as vl}from"node:path";import W from"typescript";function Sr(n,e){let t=new Map;for(let r of n.statements){if(!W.isImportDeclaration(r)||!r.importClause?.namedBindings||!W.isStringLiteral(r.moduleSpecifier)||!W.isNamedImports(r.importClause.namedBindings))continue;let i=r.moduleSpecifier.text;i.endsWith(".tsx")||(i=`${i}.tsx`);let s=vl(e,i);for(let a of r.importClause.namedBindings.elements)t.set(a.name.text,s)}return t}function _l(n){if(!W.isObjectBindingPattern(n.name)||n.name.elements.length===0)return null;let e=n.name.elements[0];return!W.isBindingElement(e)||!W.isIdentifier(e.name)?null:e.name.text}function yl(n){if(W.isParenthesizedExpression(n))return n.expression;if(W.isJsxElement(n)||W.isJsxSelfClosingElement(n)||W.isJsxFragment(n))return n;if(W.isBlock(n)&&n.statements.length===1){let e=n.statements[0];if(W.isReturnStatement(e)&&e.expression)return W.isParenthesizedExpression(e.expression)?e.expression.expression:e.expression}return null}function Qi(n){if(!W.isIdentifier(n.expression)||n.expression.text!=="view"||n.arguments.length!==1)return null;let e=n.arguments[0];if(!W.isArrowFunction(e)&&!W.isFunctionExpression(e))return null;let t="__noop";if(e.parameters.length===1){let i=_l(e.parameters[0]);if(i)t=i;else if(W.isIdentifier(e.parameters[0].name))t=e.parameters[0].name.text;else return null}else if(e.parameters.length>1)return null;let r=yl(e.body);return r?{paramName:t,jsxRoot:r}:null}function Xi(n,e){let t=gl(n,"utf-8"),r=W.createSourceFile(n,t,W.ScriptTarget.Latest,!0,W.ScriptKind.TSX),i=null;function s(a){if(W.isVariableStatement(a))for(let l of a.declarationList.declarations){if(!W.isIdentifier(l.name)||l.name.text!==e||!l.initializer||!W.isCallExpression(l.initializer))continue;let p=Qi(l.initializer);p&&(i=p)}if(W.isExportAssignment(a)&&a.isExportEquals===!1&&a.expression&&W.isCallExpression(a.expression)){let l=Qi(a.expression);l&&e==="default"&&(i=l)}W.forEachChild(a,s)}return s(r),i}function Cr(n){return n.join(".")}function Ar(n){if(O.isIdentifier(n))return[n.text];if(O.isPropertyAccessExpression(n)){let e=Ar(n.expression);return e?[...e,n.name.text]:null}return null}function xl(n){return typeof n=="object"&&n!==null&&"kind"in n&&n.kind==="binding"}function eo(n,e){if(e.length===0)return n;let t=e.join(".");return{kind:"binding",path:n.path?`${n.path}.${t}`:t,scope:n.scope}}function un(n,e){let t=Ar(n);if(!t)return null;if(t[0]in e.propBindings)return eo(e.propBindings[t[0]],t.slice(1));if(t[0]===e.vmName)return{kind:"binding",path:Cr(t.slice(1))};let r=e.scopes[e.scopes.length-1];return r&&t[0]===r?{kind:"binding",path:Cr(t.slice(1)),scope:r}:null}function Sl(n,e){let t,r={};for(let i of n.properties){if(!O.isPropertyAssignment(i)||!O.isIdentifier(i.name))continue;let s=i.name.text;if(s==="name"&&O.isStringLiteral(i.initializer)){t=i.initializer.text;continue}if(s==="params"&&O.isObjectLiteralExpression(i.initializer))for(let a of i.initializer.properties){if(!O.isPropertyAssignment(a)||!O.isIdentifier(a.name))continue;let l=pn(a.initializer,e);l!==null&&(r[a.name.text]=l)}}return t?Object.keys(r).length>0?{kind:"action",name:t,params:r}:{kind:"action",name:t}:null}function pn(n,e){if(O.isStringLiteral(n)||O.isNoSubstitutionTemplateLiteral(n))return n.text;if(n.kind===O.SyntaxKind.TrueKeyword)return!0;if(n.kind===O.SyntaxKind.FalseKeyword)return!1;if(O.isNumericLiteral(n))return Number(n.text);if(n.kind===O.SyntaxKind.NullKeyword)return null;let t=un(n,e);if(t)return t;if(O.isObjectLiteralExpression(n)){let r=Sl(n,e);if(r)return r;let i={};for(let s of n.properties){if(!O.isPropertyAssignment(s)||!O.isIdentifier(s.name))continue;let a=pn(s.initializer,e);a!==null&&(i[s.name.text]=a)}return{kind:"literal",value:i}}if(O.isArrayLiteralExpression(n)){let r=[];for(let i of n.elements){if(!O.isExpression(i))continue;let s=pn(i,e);s!==null&&r.push(s)}return r}return null}function Cl(n){return O.isIdentifier(n)?n.text:O.isPropertyAccessExpression(n)&&O.isIdentifier(n.name)?n.name.text:null}function to(n){return n.getText()}function no(n,e){let t=[];for(let r of n){if(O.isJsxText(r)){let i=r.getText().trim();i&&t.push({kind:"text",value:i});continue}if(O.isJsxExpression(r)&&r.expression){let i=un(r.expression,e);if(i){t.push(i);continue}let s=ro(r.expression,e);s&&(Array.isArray(s)?t.push(...s):t.push(s));continue}if(O.isJsxElement(r)||O.isJsxSelfClosingElement(r)){let i=Et(r,e);i&&t.push(i)}}return t}function Al(n,e){if(n.length===0)return null;let t=n[0];return t in e.propBindings?eo(e.propBindings[t],n.slice(1)):t===e.vmName?{kind:"binding",path:Cr(n.slice(1))}:null}function ro(n,e){if(O.isParenthesizedExpression(n))return ro(n.expression,e);if(O.isCallExpression(n)&&O.isPropertyAccessExpression(n.expression)){let r=Ar(n.expression.expression),i=n.expression.name.text;if(r&&i==="map"&&n.arguments.length>=1){let s=Al(r,e);if(!s)return null;let a=n.arguments[0];if(!O.isArrowFunction(a)&&!O.isFunctionExpression(a))return e.errors.push("map callback must be an arrow function"),null;let l=a.parameters;if(l.length!==1||!O.isIdentifier(l[0].name))return e.errors.push("map callback must have a single item parameter"),null;let p=l[0].name.text,c={...e,scopes:[...e.scopes,p]},h=null,u=O.isParenthesizedExpression(a.body)?a.body.expression:a.body;if(O.isBlock(a.body))return e.errors.push("map callback body must be a JSX expression, not a block"),null;if(O.isJsxElement(u)||O.isJsxSelfClosingElement(u)?h=Et(u,c):O.isJsxFragment(u)&&(h=Er(u,c)),!h)return null;let d;if(O.isJsxElement(u)||O.isJsxSelfClosingElement(u)){let v=O.isJsxElement(u)?u.openingElement.attributes:u.attributes;for(let E of v.properties)if(!(!O.isJsxAttribute(E)||to(E.name)!=="key"||!E.initializer)&&O.isJsxExpression(E.initializer)&&E.initializer.expression){let R=un(E.initializer.expression,c);R&&(d=R)}}return{kind:"map",source:s,item:p,key:d,body:h}}}if(O.isJsxElement(n)||O.isJsxSelfClosingElement(n))return Et(n,e);let t=un(n,e);return t||null}function Er(n,e){return{kind:"fragment",children:no(n.children,e)}}function El(n,e,t){let r=t.viewImports.get(n);if(!r)return null;let i=Xi(r,n);if(!i)return t.errors.push(`View component "${n}" is imported but has no view() export`),null;let s=wl(r,"utf-8"),a=O.createSourceFile(r,s,O.ScriptTarget.Latest,!0,O.ScriptKind.TSX),l=Sr(a,Zi(r)),p=new Map([...t.viewImports,...l]),c={...t.propBindings};for(let[u,d]of Object.entries(e))xl(d)&&(c[u]=d);let h={...t,vmName:i.paramName,propBindings:c,scopes:[],viewImports:p};return O.isJsxElement(i.jsxRoot)||O.isJsxSelfClosingElement(i.jsxRoot)?Et(i.jsxRoot,h):O.isJsxFragment(i.jsxRoot)?Er(i.jsxRoot,h):null}function Et(n,e){let t=O.isJsxElement(n)?n.openingElement:n,r=Cl(t.tagName);if(!r)return e.errors.push("Unsupported JSX tag expression"),null;let i={};for(let a of t.attributes.properties){if(!O.isJsxAttribute(a))continue;let l=to(a.name);if(l!=="key"){if(!a.initializer){i[l]=!0;continue}if(O.isStringLiteral(a.initializer)){i[l]=a.initializer.text;continue}if(O.isJsxExpression(a.initializer)&&a.initializer.expression){let p=pn(a.initializer.expression,e);p!==null&&(i[l]=p)}}}if(!e.allowedComponents.has(r)){let a=El(r,i,e);return a||(e.errors.push(`Component "${r}" is not in the allowed registry`),null)}let s=O.isJsxElement(n)?no(n.children,e):[];return{kind:"component",name:r,props:i,children:s}}function kl(n){let e=null;function t(r){if(O.isCallExpression(r)&&O.isIdentifier(r.expression)&&r.expression.text==="screen"&&r.arguments.length===1&&(O.isArrowFunction(r.arguments[0])||O.isFunctionExpression(r.arguments[0]))){let i=r.arguments[0],s="unknown";if(r.typeArguments&&r.typeArguments.length===1){let l=r.typeArguments[0];O.isTypeReferenceNode(l)&&O.isIdentifier(l.typeName)&&(s=l.typeName.text)}let a=i.body;if(O.isParenthesizedExpression(a))(O.isJsxElement(a.expression)||O.isJsxSelfClosingElement(a.expression))&&(e={viewModel:s,jsxRoot:a.expression});else if(O.isJsxElement(a)||O.isJsxSelfClosingElement(a))e={viewModel:s,jsxRoot:a};else if(O.isBlock(a)&&a.statements.length===1){let l=a.statements[0];O.isReturnStatement(l)&&l.expression&&(O.isParenthesizedExpression(l.expression)?e={viewModel:s,jsxRoot:l.expression.expression}:e={viewModel:s,jsxRoot:l.expression})}}O.forEachChild(r,t)}return t(n),e}function io(n,e,t,r={}){let i=new Set(cn);for(let u of r.allowlistExtra??[])i.add(u);let s=bl(e),a=Zi(s),l=O.createSourceFile(s,n,O.ScriptTarget.Latest,!0,O.ScriptKind.TSX),p={vmName:"vm",scopes:[],propBindings:{},errors:[],viewImports:Sr(l,a),allowedComponents:i},c=kl(l);if(!c)return{viewModel:"unknown",exportName:t,root:{kind:"fragment",children:[]},errors:["No screen<T>() default export found"]};let h=O.isJsxElement(c.jsxRoot)||O.isJsxSelfClosingElement(c.jsxRoot)?Et(c.jsxRoot,p):O.isJsxFragment(c.jsxRoot)?Er(c.jsxRoot,p):null;return h?{viewModel:c.viewModel,exportName:t,root:h,errors:p.errors}:(p.errors.push("screen() callback must return a single JSX root element"),{viewModel:c.viewModel,exportName:t,root:{kind:"fragment",children:[]},errors:p.errors})}async function Nl(n,e={}){let t=await Ol(n.sourcePath,"utf-8"),r=n.exportName??Pl(n.sourcePath,".view.tsx"),i=io(t,n.sourcePath,r,{allowlistExtra:e.allowlistExtra});if(i.errors.length>0)throw new Error(`Compile errors in ${n.sourcePath}:
546
+ ${i.errors.map(s=>` - ${s}`).join(`
547
+ `)}`);return{version:1,source:Il(process.cwd(),Ll(n.sourcePath)),viewModel:i.viewModel,exportName:i.exportName,root:i.root}}async function oo(n,e={}){let t=[];for(let r of n)t.push(await Nl(r,e));return t}import{access as $l,readFile as Eo}from"node:fs/promises";import{dirname as fn,relative as Gl,resolve as re}from"node:path";var Rl=Object.create,so=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Tl=Object.getOwnPropertyNames,Dl=Object.getPrototypeOf,Vl=Object.prototype.hasOwnProperty,U=(n,e)=>()=>(e||(n((e={exports:{}}).exports,e),n=null),e.exports),Fl=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=Tl(e),s=0,a=i.length,l;s<a;s++)l=i[s],!Vl.call(n,l)&&l!==t&&so(n,l,{get:(p=>e[p]).bind(null,l),enumerable:!(r=Ml(e,l))||r.enumerable});return n},Hl=(n,e,t)=>(t=n!=null?Rl(Dl(n)):{},Fl(e||!n||!n.__esModule?so(t,"default",{value:n,enumerable:!0}):t,n)),kt=U(((n,e)=>{function t(p){return typeof p>"u"||p===null}function r(p){return typeof p=="object"&&p!==null}function i(p){return Array.isArray(p)?p:t(p)?[]:[p]}function s(p,c){if(c){let h=Object.keys(c);for(let u=0,d=h.length;u<d;u+=1){let v=h[u];p[v]=c[v]}}return p}function a(p,c){let h="";for(let u=0;u<c;u+=1)h+=p;return h}function l(p){return p===0&&Number.NEGATIVE_INFINITY===1/p}e.exports.isNothing=t,e.exports.isObject=r,e.exports.toArray=i,e.exports.repeat=a,e.exports.isNegativeZero=l,e.exports.extend=s})),Ot=U(((n,e)=>{function t(i,s){let a="",l=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(a+='in "'+i.mark.name+'" '),a+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!s&&i.mark.snippet&&(a+=`
526
548
 
527
- `+r.mark.snippet),l+" "+c):l}function i(r,a){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=a,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(a){return this.name+": "+t(this,a)},e.exports=i})),rr=j(((o,e)=>{var t=Le();function i(c,l,p,m,h){let u="",f="",E=Math.floor(h/2)-1;return m-l>E&&(u=" ... ",l=m-E+u.length),p-m>E&&(f=" ...",p=m+E-f.length),{str:u+c.slice(l,p).replace(/\t/g,"\u2192")+f,pos:m-l+u.length}}function r(c,l){return t.repeat(" ",l-c.length)+c}function a(c,l){if(l=Object.create(l||null),!c.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);let p=/\r?\n|\r|\0/g,m=[0],h=[],u,f=-1;for(;u=p.exec(c.buffer);)h.push(u.index),m.push(u.index+u[0].length),c.position<=u.index&&f<0&&(f=m.length-2);f<0&&(f=m.length-1);let E="",k=Math.min(c.line+l.linesAfter,h.length).toString().length,L=l.maxLength-(l.indent+k+3);for(let D=1;D<=l.linesBefore&&!(f-D<0);D++){let G=i(c.buffer,m[f-D],h[f-D],c.position-(m[f]-m[f-D]),L);E=t.repeat(" ",l.indent)+r((c.line-D+1).toString(),k)+" | "+G.str+`
528
- `+E}let te=i(c.buffer,m[f],h[f],c.position,L);E+=t.repeat(" ",l.indent)+r((c.line+1).toString(),k)+" | "+te.str+`
529
- `,E+=t.repeat("-",l.indent+k+3+te.pos)+`^
530
- `;for(let D=1;D<=l.linesAfter&&!(f+D>=h.length);D++){let G=i(c.buffer,m[f+D],h[f+D],c.position-(m[f]-m[f+D]),L);E+=t.repeat(" ",l.indent)+r((c.line+D+1).toString(),k)+" | "+G.str+`
531
- `}return E.replace(/\n$/,"")}e.exports=a})),K=j(((o,e)=>{var t=Me(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function a(l){let p={};return l!==null&&Object.keys(l).forEach(function(m){l[m].forEach(function(h){p[String(h)]=m})}),p}function c(l,p){if(p=p||{},Object.keys(p).forEach(function(m){if(i.indexOf(m)===-1)throw new t('Unknown option "'+m+'" is met in definition of "'+l+'" YAML type.')}),this.options=p,this.tag=l,this.kind=p.kind||null,this.resolve=p.resolve||function(){return!0},this.construct=p.construct||function(m){return m},this.instanceOf=p.instanceOf||null,this.predicate=p.predicate||null,this.represent=p.represent||null,this.representName=p.representName||null,this.defaultStyle=p.defaultStyle||null,this.multi=p.multi||!1,this.styleAliases=a(p.styleAliases||null),r.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+l+'" YAML type.')}e.exports=c})),bt=j(((o,e)=>{var t=Me(),i=K();function r(l,p){let m=[];return l[p].forEach(function(h){let u=m.length;m.forEach(function(f,E){f.tag===h.tag&&f.kind===h.kind&&f.multi===h.multi&&(u=E)}),m[u]=h}),m}function a(){let l={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function p(m){m.multi?(l.multi[m.kind].push(m),l.multi.fallback.push(m)):l[m.kind][m.tag]=l.fallback[m.tag]=m}for(let m=0,h=arguments.length;m<h;m+=1)arguments[m].forEach(p);return l}function c(l){return this.extend(l)}c.prototype.extend=function(p){let m=[],h=[];if(p instanceof i)h.push(p);else if(Array.isArray(p))h=h.concat(p);else if(p&&(Array.isArray(p.implicit)||Array.isArray(p.explicit)))p.implicit&&(m=m.concat(p.implicit)),p.explicit&&(h=h.concat(p.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");m.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),h.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let u=Object.create(c.prototype);return u.implicit=(this.implicit||[]).concat(m),u.explicit=(this.explicit||[]).concat(h),u.compiledImplicit=r(u,"implicit"),u.compiledExplicit=r(u,"explicit"),u.compiledTypeMap=a(u.compiledImplicit,u.compiledExplicit),u},e.exports=c})),Ot=j(((o,e)=>{e.exports=new(K())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})})),Et=j(((o,e)=>{e.exports=new(K())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})})),St=j(((o,e)=>{e.exports=new(K())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})})),It=j(((o,e)=>{e.exports=new(bt())({explicit:[Ot(),Et(),St()]})})),Tt=j(((o,e)=>{var t=K();function i(c){if(c===null)return!0;let l=c.length;return l===1&&c==="~"||l===4&&(c==="null"||c==="Null"||c==="NULL")}function r(){return null}function a(c){return c===null}e.exports=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})})),kt=j(((o,e)=>{var t=K();function i(c){if(c===null)return!1;let l=c.length;return l===4&&(c==="true"||c==="True"||c==="TRUE")||l===5&&(c==="false"||c==="False"||c==="FALSE")}function r(c){return c==="true"||c==="True"||c==="TRUE"}function a(c){return Object.prototype.toString.call(c)==="[object Boolean]"}e.exports=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:{lowercase:function(c){return c?"true":"false"},uppercase:function(c){return c?"TRUE":"FALSE"},camelcase:function(c){return c?"True":"False"}},defaultStyle:"lowercase"})})),Pt=j(((o,e)=>{var t=Le(),i=K();function r(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function a(u){return u>=48&&u<=55}function c(u){return u>=48&&u<=57}function l(u){if(u===null)return!1;let f=u.length,E=0,k=!1;if(!f)return!1;let L=u[E];if((L==="-"||L==="+")&&(L=u[++E]),L==="0"){if(E+1===f)return!0;if(L=u[++E],L==="b"){for(E++;E<f;E++){if(L=u[E],L!=="0"&&L!=="1")return!1;k=!0}return k&&Number.isFinite(p(u))}if(L==="x"){for(E++;E<f;E++){if(!r(u.charCodeAt(E)))return!1;k=!0}return k&&Number.isFinite(p(u))}if(L==="o"){for(E++;E<f;E++){if(!a(u.charCodeAt(E)))return!1;k=!0}return k&&Number.isFinite(p(u))}}for(;E<f;E++){if(!c(u.charCodeAt(E)))return!1;k=!0}return k?Number.isFinite(p(u)):!1}function p(u){let f=u,E=1,k=f[0];if((k==="-"||k==="+")&&(k==="-"&&(E=-1),f=f.slice(1),k=f[0]),f==="0")return 0;if(k==="0"){if(f[1]==="b")return E*parseInt(f.slice(2),2);if(f[1]==="x")return E*parseInt(f.slice(2),16);if(f[1]==="o")return E*parseInt(f.slice(2),8)}return E*parseInt(f,10)}function m(u){return p(u)}function h(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!t.isNegativeZero(u)}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:l,construct:m,predicate:h,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),Nt=j(((o,e)=>{var t=Le(),i=K(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),a=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c(u){return u===null||!r.test(u)?!1:Number.isFinite(parseFloat(u,10))?!0:a.test(u)}function l(u){let f=u.toLowerCase(),E=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?E===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:E*parseFloat(f,10)}var p=/^[-+]?[0-9]+e/;function m(u,f){if(isNaN(u))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(u))return"-0.0";let E=u.toString(10);return p.test(E)?E.replace("e",".e"):E}function h(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||t.isNegativeZero(u))}e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:l,predicate:h,represent:m,defaultStyle:"lowercase"})})),Rt=j(((o,e)=>{e.exports=It().extend({implicit:[Tt(),kt(),Pt(),Nt()]})})),$t=j(((o,e)=>{e.exports=Rt()})),Lt=j(((o,e)=>{var t=K(),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function a(p){return p===null?!1:i.exec(p)!==null||r.exec(p)!==null}function c(p){let m=0,h=null,u=i.exec(p);if(u===null&&(u=r.exec(p)),u===null)throw new Error("Date resolve error");let f=+u[1],E=+u[2]-1,k=+u[3];if(!u[4])return new Date(Date.UTC(f,E,k));let L=+u[4],te=+u[5],D=+u[6];if(u[7]){for(m=u[7].slice(0,3);m.length<3;)m+="0";m=+m}if(u[9]){let ie=+u[10],J=+(u[11]||0);h=(ie*60+J)*6e4,u[9]==="-"&&(h=-h)}let G=new Date(Date.UTC(f,E,k,L,te,D,m));return h&&G.setTime(G.getTime()-h),G}function l(p){return p.toISOString()}e.exports=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:a,construct:c,instanceOf:Date,represent:l})})),Mt=j(((o,e)=>{var t=K();function i(r){return r==="<<"||r===null}e.exports=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i})})),Vt=j(((o,e)=>{var t=K(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
532
- \r`;function r(p){if(p===null)return!1;let m=0,h=p.length,u=i;for(let f=0;f<h;f++){let E=u.indexOf(p.charAt(f));if(!(E>64)){if(E<0)return!1;m+=6}}return m%8===0}function a(p){let m=p.replace(/[\r\n=]/g,""),h=m.length,u=i,f=0,E=[];for(let L=0;L<h;L++)L%4===0&&L&&(E.push(f>>16&255),E.push(f>>8&255),E.push(f&255)),f=f<<6|u.indexOf(m.charAt(L));let k=h%4*6;return k===0?(E.push(f>>16&255),E.push(f>>8&255),E.push(f&255)):k===18?(E.push(f>>10&255),E.push(f>>2&255)):k===12&&E.push(f>>4&255),new Uint8Array(E)}function c(p){let m="",h=0,u=p.length,f=i;for(let k=0;k<u;k++)k%3===0&&k&&(m+=f[h>>18&63],m+=f[h>>12&63],m+=f[h>>6&63],m+=f[h&63]),h=(h<<8)+p[k];let E=u%3;return E===0?(m+=f[h>>18&63],m+=f[h>>12&63],m+=f[h>>6&63],m+=f[h&63]):E===2?(m+=f[h>>10&63],m+=f[h>>4&63],m+=f[h<<2&63],m+=f[64]):E===1&&(m+=f[h>>2&63],m+=f[h<<4&63],m+=f[64],m+=f[64]),m}function l(p){return Object.prototype.toString.call(p)==="[object Uint8Array]"}e.exports=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:a,predicate:l,represent:c})})),Dt=j(((o,e)=>{var t=K(),i=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function a(l){if(l===null)return!0;let p=[],m=l;for(let h=0,u=m.length;h<u;h+=1){let f=m[h],E=!1;if(r.call(f)!=="[object Object]")return!1;let k;for(k in f)if(i.call(f,k))if(!E)E=!0;else return!1;if(!E)return!1;if(p.indexOf(k)===-1)p.push(k);else return!1}return!0}function c(l){return l!==null?l:[]}e.exports=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:a,construct:c})})),Ft=j(((o,e)=>{var t=K(),i=Object.prototype.toString;function r(c){if(c===null)return!0;let l=c,p=new Array(l.length);for(let m=0,h=l.length;m<h;m+=1){let u=l[m];if(i.call(u)!=="[object Object]")return!1;let f=Object.keys(u);if(f.length!==1)return!1;p[m]=[f[0],u[f[0]]]}return!0}function a(c){if(c===null)return[];let l=c,p=new Array(l.length);for(let m=0,h=l.length;m<h;m+=1){let u=l[m],f=Object.keys(u);p[m]=[f[0],u[f[0]]]}return p}e.exports=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:a})})),jt=j(((o,e)=>{var t=K(),i=Object.prototype.hasOwnProperty;function r(c){if(c===null)return!0;let l=c;for(let p in l)if(i.call(l,p)&&l[p]!==null)return!1;return!0}function a(c){return c!==null?c:{}}e.exports=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:a})})),Fn=j(((o,e)=>{e.exports=$t().extend({implicit:[Lt(),Mt()],explicit:[Vt(),Dt(),Ft(),jt()]})})),or=j(((o,e)=>{var t=Le(),i=Me(),r=rr(),a=Fn(),c=Object.prototype.hasOwnProperty,l=1,p=2,m=3,h=4,u=1,f=2,E=3,k=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,L=/[\x85\u2028\u2029]/,te=/[,\[\]{}]/,D=/^(?:!|!!|![0-9A-Za-z-]+!)$/,G=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ie(n){return Object.prototype.toString.call(n)}function J(n){return n===10||n===13}function W(n){return n===9||n===32}function Y(n){return n===9||n===32||n===10||n===13}function pe(n){return n===44||n===91||n===93||n===123||n===125}function ln(n){if(n>=48&&n<=57)return n-48;let d=n|32;return d>=97&&d<=102?d-97+10:-1}function un(n){return n===120?2:n===117?4:n===85?8:0}function je(n){return n>=48&&n<=57?n-48:-1}function Oe(n){switch(n){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
533
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function pn(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}function Ee(n,d,x){d==="__proto__"?Object.defineProperty(n,d,{configurable:!0,enumerable:!0,writable:!0,value:x}):n[d]=x}var He=new Array(256),Se=new Array(256);for(let n=0;n<256;n++)He[n]=Oe(n)?1:0,Se[n]=Oe(n);function U(n,d){this.input=n,this.filename=d.filename||null,this.schema=d.schema||a,this.onWarning=d.onWarning||null,this.legacy=d.legacy||!1,this.json=d.json||!1,this.listener=d.listener||null,this.maxDepth=typeof d.maxDepth=="number"?d.maxDepth:100,this.maxMergeSeqLength=typeof d.maxMergeSeqLength=="number"?d.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=n.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Be(n,d){let x={name:n.filename,buffer:n.input.slice(0,-1),position:n.position,line:n.line,column:n.position-n.lineStart};return x.snippet=r(x),new i(d,x)}function P(n,d){throw Be(n,d)}function ye(n,d){n.onWarning&&n.onWarning.call(null,Be(n,d))}function re(n,d,x){let v=n.anchorMapTransactions;if(v.length!==0){let w=v[v.length-1];c.call(w,d)||(w[d]={existed:c.call(n.anchorMap,d),value:n.anchorMap[d]})}n.anchorMap[d]=x}function fn(n){n.anchorMapTransactions.push(Object.create(null))}function he(n){let d=n.anchorMapTransactions.pop(),x=n.anchorMapTransactions;if(x.length===0)return;let v=x[x.length-1],w=Object.keys(d);for(let O=0,s=w.length;O<s;O+=1){let g=w[O];c.call(v,g)||(v[g]=d[g])}}function dn(n){let d=n.anchorMapTransactions.pop(),x=Object.keys(d);for(let v=x.length-1;v>=0;v-=1){let w=d[x[v]];w.existed?n.anchorMap[x[v]]=w.value:delete n.anchorMap[x[v]]}}function Ie(n){return{position:n.position,line:n.line,lineStart:n.lineStart,lineIndent:n.lineIndent,firstTabInLine:n.firstTabInLine,tag:n.tag,anchor:n.anchor,kind:n.kind,result:n.result}}function _e(n,d){n.position=d.position,n.line=d.line,n.lineStart=d.lineStart,n.lineIndent=d.lineIndent,n.firstTabInLine=d.firstTabInLine,n.tag=d.tag,n.anchor=d.anchor,n.kind=d.kind,n.result=d.result}var Ge={YAML:function(d,x,v){d.version!==null&&P(d,"duplication of %YAML directive"),v.length!==1&&P(d,"YAML directive accepts exactly one argument");let w=/^([0-9]+)\.([0-9]+)$/.exec(v[0]);w===null&&P(d,"ill-formed argument of the YAML directive");let O=parseInt(w[1],10),s=parseInt(w[2],10);O!==1&&P(d,"unacceptable YAML version of the document"),d.version=v[0],d.checkLineBreaks=s<2,s!==1&&s!==2&&ye(d,"unsupported YAML version of the document")},TAG:function(d,x,v){let w;v.length!==2&&P(d,"TAG directive accepts exactly two arguments");let O=v[0];w=v[1],D.test(O)||P(d,"ill-formed tag handle (first argument) of the TAG directive"),c.call(d.tagMap,O)&&P(d,'there is a previously declared suffix for "'+O+'" tag handle'),G.test(w)||P(d,"ill-formed tag prefix (second argument) of the TAG directive");try{w=decodeURIComponent(w)}catch{P(d,"tag prefix is malformed: "+w)}d.tagMap[O]=w}};function X(n,d,x,v){if(d<x){let w=n.input.slice(d,x);if(v)for(let O=0,s=w.length;O<s;O+=1){let g=w.charCodeAt(O);g===9||g>=32&&g<=1114111||P(n,"expected valid JSON character")}else k.test(w)&&P(n,"the stream contains non-printable characters");n.result+=w}}function fe(n,d,x,v){t.isObject(x)||P(n,"cannot merge mappings; the provided source object is unacceptable");let w=Object.keys(x);for(let O=0,s=w.length;O<s;O+=1){let g=w[O];c.call(d,g)||(Ee(d,g,x[g]),v[g]=!0)}}function oe(n,d,x,v,w,O,s,g,b){if(Array.isArray(w)){w=Array.prototype.slice.call(w);for(let y=0,_=w.length;y<_;y+=1)Array.isArray(w[y])&&P(n,"nested arrays are not supported inside keys"),typeof w=="object"&&ie(w[y])==="[object Object]"&&(w[y]="[object Object]")}if(typeof w=="object"&&ie(w)==="[object Object]"&&(w="[object Object]"),w=String(w),d===null&&(d={}),v==="tag:yaml.org,2002:merge")if(Array.isArray(O)){O.length>n.maxMergeSeqLength&&P(n,"merge sequence length exceeded maxMergeSeqLength ("+n.maxMergeSeqLength+")");let y=new Set;for(let _=0,A=O.length;_<A;_+=1){let C=O[_];y.has(C)||(y.add(C),fe(n,d,C,x))}}else fe(n,d,O,x);else!n.json&&!c.call(x,w)&&c.call(d,w)&&(n.line=s||n.line,n.lineStart=g||n.lineStart,n.position=b||n.position,P(n,"duplicated mapping key")),Ee(d,w,O),delete x[w];return d}function ve(n){let d=n.input.charCodeAt(n.position);d===10?n.position++:d===13?(n.position++,n.input.charCodeAt(n.position)===10&&n.position++):P(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}function B(n,d,x){let v=0,w=n.input.charCodeAt(n.position);for(;w!==0;){for(;W(w);)w===9&&n.firstTabInLine===-1&&(n.firstTabInLine=n.position),w=n.input.charCodeAt(++n.position);if(d&&w===35)do w=n.input.charCodeAt(++n.position);while(w!==10&&w!==13&&w!==0);if(J(w))for(ve(n),w=n.input.charCodeAt(n.position),v++,n.lineIndent=0;w===32;)n.lineIndent++,w=n.input.charCodeAt(++n.position);else break}return x!==-1&&v!==0&&n.lineIndent<x&&ye(n,"deficient indentation"),v}function Ce(n){let d=n.position,x=n.input.charCodeAt(d);return!!((x===45||x===46)&&x===n.input.charCodeAt(d+1)&&x===n.input.charCodeAt(d+2)&&(d+=3,x=n.input.charCodeAt(d),x===0||Y(x)))}function se(n,d){d===1?n.result+=" ":d>1&&(n.result+=t.repeat(`
534
- `,d-1))}function qe(n,d,x){let v,w,O,s,g,b,y=n.kind,_=n.result,A=n.input.charCodeAt(n.position);if(Y(A)||pe(A)||A===35||A===38||A===42||A===33||A===124||A===62||A===39||A===34||A===37||A===64||A===96)return!1;if(A===63||A===45){let C=n.input.charCodeAt(n.position+1);if(Y(C)||x&&pe(C))return!1}for(n.kind="scalar",n.result="",v=w=n.position,O=!1;A!==0;){if(A===58){let C=n.input.charCodeAt(n.position+1);if(Y(C)||x&&pe(C))break}else if(A===35){if(Y(n.input.charCodeAt(n.position-1)))break}else{if(n.position===n.lineStart&&Ce(n)||x&&pe(A))break;if(J(A))if(s=n.line,g=n.lineStart,b=n.lineIndent,B(n,!1,-1),n.lineIndent>=d){O=!0,A=n.input.charCodeAt(n.position);continue}else{n.position=w,n.line=s,n.lineStart=g,n.lineIndent=b;break}}O&&(X(n,v,w,!1),se(n,n.line-s),v=w=n.position,O=!1),W(A)||(w=n.position+1),A=n.input.charCodeAt(++n.position)}return X(n,v,w,!1),n.result?!0:(n.kind=y,n.result=_,!1)}function We(n,d){let x,v,w=n.input.charCodeAt(n.position);if(w!==39)return!1;for(n.kind="scalar",n.result="",n.position++,x=v=n.position;(w=n.input.charCodeAt(n.position))!==0;)if(w===39)if(X(n,x,n.position,!0),w=n.input.charCodeAt(++n.position),w===39)x=n.position,n.position++,v=n.position;else return!0;else J(w)?(X(n,x,v,!0),se(n,B(n,!1,d)),x=v=n.position):n.position===n.lineStart&&Ce(n)?P(n,"unexpected end of the document within a single quoted scalar"):(n.position++,W(w)||(v=n.position));P(n,"unexpected end of the stream within a single quoted scalar")}function Te(n,d){let x,v,w,O=n.input.charCodeAt(n.position);if(O!==34)return!1;for(n.kind="scalar",n.result="",n.position++,x=v=n.position;(O=n.input.charCodeAt(n.position))!==0;){if(O===34)return X(n,x,n.position,!0),n.position++,!0;if(O===92){if(X(n,x,n.position,!0),O=n.input.charCodeAt(++n.position),J(O))B(n,!1,d);else if(O<256&&He[O])n.result+=Se[O],n.position++;else if((w=un(O))>0){let s=w,g=0;for(;s>0;s--)O=n.input.charCodeAt(++n.position),(w=ln(O))>=0?g=(g<<4)+w:P(n,"expected hexadecimal character");n.result+=pn(g),n.position++}else P(n,"unknown escape sequence");x=v=n.position}else J(O)?(X(n,x,v,!0),se(n,B(n,!1,d)),x=v=n.position):n.position===n.lineStart&&Ce(n)?P(n,"unexpected end of the document within a double quoted scalar"):(n.position++,W(O)||(v=n.position))}P(n,"unexpected end of the stream within a double quoted scalar")}function Ue(n,d){let x=!0,v,w,O,s=n.tag,g,b=n.anchor,y,_,A,C,T=Object.create(null),I,N,R,$=n.input.charCodeAt(n.position);if($===91)y=93,C=!1,g=[];else if($===123)y=125,C=!0,g={};else return!1;for(n.anchor!==null&&re(n,n.anchor,g),$=n.input.charCodeAt(++n.position);$!==0;){if(B(n,!0,d),$=n.input.charCodeAt(n.position),$===y)return n.position++,n.tag=s,n.anchor=b,n.kind=C?"mapping":"sequence",n.result=g,!0;x?$===44&&P(n,"expected the node content, but found ','"):P(n,"missed comma between flow collection entries"),N=I=R=null,_=A=!1,$===63&&Y(n.input.charCodeAt(n.position+1))&&(_=A=!0,n.position++,B(n,!0,d)),v=n.line,w=n.lineStart,O=n.position,ce(n,d,l,!1,!0),N=n.tag,I=n.result,B(n,!0,d),$=n.input.charCodeAt(n.position),(A||n.line===v)&&$===58&&(_=!0,$=n.input.charCodeAt(++n.position),B(n,!0,d),ce(n,d,l,!1,!0),R=n.result),C?oe(n,g,T,N,I,R,v,w,O):_?g.push(oe(n,null,T,N,I,R,v,w,O)):g.push(I),B(n,!0,d),$=n.input.charCodeAt(n.position),$===44?(x=!0,$=n.input.charCodeAt(++n.position)):x=!1}P(n,"unexpected end of the stream within a flow collection")}function Je(n,d){let x,v=u,w=!1,O=!1,s=d,g=0,b=!1,y,_=n.input.charCodeAt(n.position);if(_===124)x=!1;else if(_===62)x=!0;else return!1;for(n.kind="scalar",n.result="";_!==0;)if(_=n.input.charCodeAt(++n.position),_===43||_===45)u===v?v=_===43?E:f:P(n,"repeat of a chomping mode identifier");else if((y=je(_))>=0)y===0?P(n,"bad explicit indentation width of a block scalar; it cannot be less than one"):O?P(n,"repeat of an indentation width identifier"):(s=d+y-1,O=!0);else break;if(W(_)){do _=n.input.charCodeAt(++n.position);while(W(_));if(_===35)do _=n.input.charCodeAt(++n.position);while(!J(_)&&_!==0)}for(;_!==0;){for(ve(n),n.lineIndent=0,_=n.input.charCodeAt(n.position);(!O||n.lineIndent<s)&&_===32;)n.lineIndent++,_=n.input.charCodeAt(++n.position);if(!O&&n.lineIndent>s&&(s=n.lineIndent),J(_)){g++;continue}if(!O&&s===0&&P(n,"missing indentation for block scalar"),n.lineIndent<s){v===E?n.result+=t.repeat(`
535
- `,w?1+g:g):v===u&&w&&(n.result+=`
536
- `);break}x?W(_)?(b=!0,n.result+=t.repeat(`
537
- `,w?1+g:g)):b?(b=!1,n.result+=t.repeat(`
538
- `,g+1)):g===0?w&&(n.result+=" "):n.result+=t.repeat(`
539
- `,g):n.result+=t.repeat(`
540
- `,w?1+g:g),w=!0,O=!0,g=0;let A=n.position;for(;!J(_)&&_!==0;)_=n.input.charCodeAt(++n.position);X(n,A,n.position,!1)}return!0}function ae(n,d){let x=n.tag,v=n.anchor,w=[],O=!1;if(n.firstTabInLine!==-1)return!1;n.anchor!==null&&re(n,n.anchor,w);let s=n.input.charCodeAt(n.position);for(;s!==0&&(n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,P(n,"tab characters must not be used in indentation")),!(s!==45||!Y(n.input.charCodeAt(n.position+1))));){if(O=!0,n.position++,B(n,!0,-1)&&n.lineIndent<=d){w.push(null),s=n.input.charCodeAt(n.position);continue}let g=n.line;if(ce(n,d,m,!1,!0),w.push(n.result),B(n,!0,-1),s=n.input.charCodeAt(n.position),(n.line===g||n.lineIndent>d)&&s!==0)P(n,"bad indentation of a sequence entry");else if(n.lineIndent<d)break}return O?(n.tag=x,n.anchor=v,n.kind="sequence",n.result=w,!0):!1}function Ye(n,d,x){let v,w,O,s,g=n.tag,b=n.anchor,y={},_=Object.create(null),A=null,C=null,T=null,I=!1,N=!1;if(n.firstTabInLine!==-1)return!1;n.anchor!==null&&re(n,n.anchor,y);let R=n.input.charCodeAt(n.position);for(;R!==0;){!I&&n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,P(n,"tab characters must not be used in indentation"));let $=n.input.charCodeAt(n.position+1),H=n.line;if((R===63||R===58)&&Y($))R===63?(I&&(oe(n,y,_,A,C,null,w,O,s),A=C=T=null),N=!0,I=!0,v=!0):I?(I=!1,v=!0):P(n,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),n.position+=1,R=$;else{if(w=n.line,O=n.lineStart,s=n.position,!ce(n,x,p,!1,!0))break;if(n.line===H){for(R=n.input.charCodeAt(n.position);W(R);)R=n.input.charCodeAt(++n.position);if(R===58)R=n.input.charCodeAt(++n.position),Y(R)||P(n,"a whitespace character is expected after the key-value separator within a block mapping"),I&&(oe(n,y,_,A,C,null,w,O,s),A=C=T=null),N=!0,I=!1,v=!1,A=n.tag,C=n.result;else if(N)P(n,"can not read an implicit mapping pair; a colon is missed");else return n.tag=g,n.anchor=b,!0}else if(N)P(n,"can not read a block mapping entry; a multiline key may not be an implicit key");else return n.tag=g,n.anchor=b,!0}if((n.line===H||n.lineIndent>d)&&(I&&(w=n.line,O=n.lineStart,s=n.position),ce(n,d,h,!0,v)&&(I?C=n.result:T=n.result),I||(oe(n,y,_,A,C,T,w,O,s),A=C=T=null),B(n,!0,-1),R=n.input.charCodeAt(n.position)),(n.line===H||n.lineIndent>d)&&R!==0)P(n,"bad indentation of a mapping entry");else if(n.lineIndent<d)break}return I&&oe(n,y,_,A,C,null,w,O,s),N&&(n.tag=g,n.anchor=b,n.kind="mapping",n.result=y),N}function mn(n){let d=!1,x=!1,v,w,O=n.input.charCodeAt(n.position);if(O!==33)return!1;n.tag!==null&&P(n,"duplication of a tag property"),O=n.input.charCodeAt(++n.position),O===60?(d=!0,O=n.input.charCodeAt(++n.position)):O===33?(x=!0,v="!!",O=n.input.charCodeAt(++n.position)):v="!";let s=n.position;if(d){do O=n.input.charCodeAt(++n.position);while(O!==0&&O!==62);n.position<n.length?(w=n.input.slice(s,n.position),O=n.input.charCodeAt(++n.position)):P(n,"unexpected end of the stream within a verbatim tag")}else{for(;O!==0&&!Y(O);)O===33&&(x?P(n,"tag suffix cannot contain exclamation marks"):(v=n.input.slice(s-1,n.position+1),D.test(v)||P(n,"named tag handle cannot contain such characters"),x=!0,s=n.position+1)),O=n.input.charCodeAt(++n.position);w=n.input.slice(s,n.position),te.test(w)&&P(n,"tag suffix cannot contain flow indicator characters")}w&&!G.test(w)&&P(n,"tag name cannot contain such characters: "+w);try{w=decodeURIComponent(w)}catch{P(n,"tag name is malformed: "+w)}return d?n.tag=w:c.call(n.tagMap,v)?n.tag=n.tagMap[v]+w:v==="!"?n.tag="!"+w:v==="!!"?n.tag="tag:yaml.org,2002:"+w:P(n,'undeclared tag handle "'+v+'"'),!0}function Ke(n){let d=n.input.charCodeAt(n.position);if(d!==38)return!1;n.anchor!==null&&P(n,"duplication of an anchor property"),d=n.input.charCodeAt(++n.position);let x=n.position;for(;d!==0&&!Y(d)&&!pe(d);)d=n.input.charCodeAt(++n.position);return n.position===x&&P(n,"name of an anchor node must contain at least one character"),n.anchor=n.input.slice(x,n.position),!0}function ze(n){let d=n.input.charCodeAt(n.position);if(d!==42)return!1;d=n.input.charCodeAt(++n.position);let x=n.position;for(;d!==0&&!Y(d)&&!pe(d);)d=n.input.charCodeAt(++n.position);n.position===x&&P(n,"name of an alias node must contain at least one character");let v=n.input.slice(x,n.position);return c.call(n.anchorMap,v)||P(n,'unidentified alias "'+v+'"'),n.result=n.anchorMap[v],B(n,!0,-1),!0}function hn(n,d,x,v){let w=Ie(n);return fn(n),_e(n,d),n.tag=null,n.anchor=null,n.kind=null,n.result=null,Ye(n,x,v)&&n.kind==="mapping"?(he(n),!0):(dn(n),_e(n,w),!1)}function ce(n,d,x,v,w){let O,s,g=1,b=!1,y=!1,_=null,A,C,T;n.depth>=n.maxDepth&&P(n,"nesting exceeded maxDepth ("+n.maxDepth+")"),n.depth+=1,n.listener!==null&&n.listener("open",n),n.tag=null,n.anchor=null,n.kind=null,n.result=null;let I=O=s=h===x||m===x;if(v&&B(n,!0,-1)&&(b=!0,n.lineIndent>d?g=1:n.lineIndent===d?g=0:n.lineIndent<d&&(g=-1)),g===1)for(;;){let N=n.input.charCodeAt(n.position),R=Ie(n);if(b&&(N===33&&n.tag!==null||N===38&&n.anchor!==null)||!mn(n)&&!Ke(n))break;_===null&&(_=R),B(n,!0,-1)?(b=!0,s=I,n.lineIndent>d?g=1:n.lineIndent===d?g=0:n.lineIndent<d&&(g=-1)):s=!1}if(s&&(s=b||w),g===1||h===x)if(l===x||p===x?C=d:C=d+1,T=n.position-n.lineStart,g===1)if(s&&(ae(n,T)||Ye(n,T,C))||Ue(n,C))y=!0;else{let N=n.input.charCodeAt(n.position);_!==null&&I&&!s&&N!==124&&N!==62&&hn(n,_,_.position-_.lineStart,C)||O&&Je(n,C)||We(n,C)||Te(n,C)?y=!0:ze(n)?(y=!0,(n.tag!==null||n.anchor!==null)&&P(n,"alias node should not have any properties")):qe(n,C,l===x)&&(y=!0,n.tag===null&&(n.tag="?")),n.anchor!==null&&re(n,n.anchor,n.result)}else g===0&&(y=s&&ae(n,T));if(n.tag===null)n.anchor!==null&&re(n,n.anchor,n.result);else if(n.tag==="?"){n.result!==null&&n.kind!=="scalar"&&P(n,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+n.kind+'"');for(let N=0,R=n.implicitTypes.length;N<R;N+=1)if(A=n.implicitTypes[N],A.resolve(n.result)){n.result=A.construct(n.result),n.tag=A.tag,n.anchor!==null&&re(n,n.anchor,n.result);break}}else if(n.tag!=="!"){if(c.call(n.typeMap[n.kind||"fallback"],n.tag))A=n.typeMap[n.kind||"fallback"][n.tag];else{A=null;let N=n.typeMap.multi[n.kind||"fallback"];for(let R=0,$=N.length;R<$;R+=1)if(n.tag.slice(0,N[R].tag.length)===N[R].tag){A=N[R];break}}A||P(n,"unknown tag !<"+n.tag+">"),n.result!==null&&A.kind!==n.kind&&P(n,"unacceptable node kind for !<"+n.tag+'> tag; it should be "'+A.kind+'", not "'+n.kind+'"'),A.resolve(n.result,n.tag)?(n.result=A.construct(n.result,n.tag),n.anchor!==null&&re(n,n.anchor,n.result)):P(n,"cannot resolve a node with !<"+n.tag+"> explicit tag")}return n.listener!==null&&n.listener("close",n),n.depth-=1,n.tag!==null||n.anchor!==null||y}function gn(n){let d=n.position,x=!1,v;for(n.version=null,n.checkLineBreaks=n.legacy,n.tagMap=Object.create(null),n.anchorMap=Object.create(null);(v=n.input.charCodeAt(n.position))!==0&&(B(n,!0,-1),v=n.input.charCodeAt(n.position),!(n.lineIndent>0||v!==37));){x=!0,v=n.input.charCodeAt(++n.position);let w=n.position;for(;v!==0&&!Y(v);)v=n.input.charCodeAt(++n.position);let O=n.input.slice(w,n.position),s=[];for(O.length<1&&P(n,"directive name must not be less than one character in length");v!==0;){for(;W(v);)v=n.input.charCodeAt(++n.position);if(v===35){do v=n.input.charCodeAt(++n.position);while(v!==0&&!J(v));break}if(J(v))break;for(w=n.position;v!==0&&!Y(v);)v=n.input.charCodeAt(++n.position);s.push(n.input.slice(w,n.position))}v!==0&&ve(n),c.call(Ge,O)?Ge[O](n,O,s):ye(n,'unknown document directive "'+O+'"')}if(B(n,!0,-1),n.lineIndent===0&&n.input.charCodeAt(n.position)===45&&n.input.charCodeAt(n.position+1)===45&&n.input.charCodeAt(n.position+2)===45?(n.position+=3,B(n,!0,-1)):x&&P(n,"directives end mark is expected"),ce(n,n.lineIndent-1,h,!1,!0),B(n,!0,-1),n.checkLineBreaks&&L.test(n.input.slice(d,n.position))&&ye(n,"non-ASCII line breaks are interpreted as content"),n.documents.push(n.result),n.position===n.lineStart&&Ce(n)){n.input.charCodeAt(n.position)===46&&(n.position+=3,B(n,!0,-1));return}n.position<n.length-1&&P(n,"end of the stream or a document separator is expected")}function Xe(n,d){n=String(n),d=d||{},n.length!==0&&(n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=`
541
- `),n.charCodeAt(0)===65279&&(n=n.slice(1)));let x=new U(n,d),v=n.indexOf("\0");for(v!==-1&&(x.position=v,P(x,"null byte is not allowed in input")),x.input+="\0";x.input.charCodeAt(x.position)===32;)x.lineIndent+=1,x.position+=1;for(;x.position<x.length-1;)gn(x);return x.documents}function Qe(n,d,x){d!==null&&typeof d=="object"&&typeof x>"u"&&(x=d,d=null);let v=Xe(n,x);if(typeof d!="function")return v;for(let w=0,O=v.length;w<O;w+=1)d(v[w])}function wn(n,d){let x=Xe(n,d);if(x.length!==0){if(x.length===1)return x[0];throw new i("expected a single document in the stream, but found more")}}e.exports.loadAll=Qe,e.exports.load=wn})),sr=j(((o,e)=>{var t=Le(),i=Me(),r=Fn(),a=Object.prototype.toString,c=Object.prototype.hasOwnProperty,l=65279,p=9,m=10,h=13,u=32,f=33,E=34,k=35,L=37,te=38,D=39,G=42,ie=44,J=45,W=58,Y=61,pe=62,ln=63,un=64,je=91,Oe=93,pn=96,Ee=123,He=124,Se=125,U={};U[0]="\\0",U[7]="\\a",U[8]="\\b",U[9]="\\t",U[10]="\\n",U[11]="\\v",U[12]="\\f",U[13]="\\r",U[27]="\\e",U[34]='\\"',U[92]="\\\\",U[133]="\\N",U[160]="\\_",U[8232]="\\L",U[8233]="\\P";var Be=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],P=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ye(s,g){if(g===null)return{};let b={},y=Object.keys(g);for(let _=0,A=y.length;_<A;_+=1){let C=y[_],T=String(g[C]);C.slice(0,2)==="!!"&&(C="tag:yaml.org,2002:"+C.slice(2));let I=s.compiledTypeMap.fallback[C];I&&c.call(I.styleAliases,T)&&(T=I.styleAliases[T]),b[C]=T}return b}function re(s){let g,b,y=s.toString(16).toUpperCase();if(s<=255)g="x",b=2;else if(s<=65535)g="u",b=4;else if(s<=4294967295)g="U",b=8;else throw new i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+g+t.repeat("0",b-y.length)+y}var fn=1,he=2;function dn(s){this.schema=s.schema||r,this.indent=Math.max(1,s.indent||2),this.noArrayIndent=s.noArrayIndent||!1,this.skipInvalid=s.skipInvalid||!1,this.flowLevel=t.isNothing(s.flowLevel)?-1:s.flowLevel,this.styleMap=ye(this.schema,s.styles||null),this.sortKeys=s.sortKeys||!1,this.lineWidth=s.lineWidth||80,this.noRefs=s.noRefs||!1,this.noCompatMode=s.noCompatMode||!1,this.condenseFlow=s.condenseFlow||!1,this.quotingType=s.quotingType==='"'?he:fn,this.forceQuotes=s.forceQuotes||!1,this.replacer=typeof s.replacer=="function"?s.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ie(s,g){let b=t.repeat(" ",g),y=0,_="",A=s.length;for(;y<A;){let C,T=s.indexOf(`
542
- `,y);T===-1?(C=s.slice(y),y=A):(C=s.slice(y,T+1),y=T+1),C.length&&C!==`
543
- `&&(_+=b),_+=C}return _}function _e(s,g){return`
544
- `+t.repeat(" ",s.indent*g)}function Ge(s,g){for(let b=0,y=s.implicitTypes.length;b<y;b+=1)if(s.implicitTypes[b].resolve(g))return!0;return!1}function X(s){return s===u||s===p}function fe(s){return s>=32&&s<=126||s>=161&&s<=55295&&s!==8232&&s!==8233||s>=57344&&s<=65533&&s!==l||s>=65536&&s<=1114111}function oe(s){return fe(s)&&s!==l&&s!==h&&s!==m}function ve(s,g,b){let y=oe(s),_=y&&!X(s);return(b?y:y&&s!==ie&&s!==je&&s!==Oe&&s!==Ee&&s!==Se)&&s!==k&&!(g===W&&!_)||oe(g)&&!X(g)&&s===k||g===W&&_}function B(s){return fe(s)&&s!==l&&!X(s)&&s!==J&&s!==ln&&s!==W&&s!==ie&&s!==je&&s!==Oe&&s!==Ee&&s!==Se&&s!==k&&s!==te&&s!==G&&s!==f&&s!==He&&s!==Y&&s!==pe&&s!==D&&s!==E&&s!==L&&s!==un&&s!==pn}function Ce(s){return!X(s)&&s!==W}function se(s,g){let b=s.charCodeAt(g),y;return b>=55296&&b<=56319&&g+1<s.length&&(y=s.charCodeAt(g+1),y>=56320&&y<=57343)?(b-55296)*1024+y-56320+65536:b}function qe(s){return/^\n* /.test(s)}var We=1,Te=2,Ue=3,Je=4,ae=5;function Ye(s,g,b,y,_,A,C,T){let I,N=0,R=null,$=!1,H=!1,Yn=y!==-1,ke=-1,Pe=B(se(s,0))&&Ce(se(s,s.length-1));if(g||C)for(I=0;I<s.length;N>=65536?I+=2:I++){if(N=se(s,I),!fe(N))return ae;Pe=Pe&&ve(N,R,T),R=N}else{for(I=0;I<s.length;N>=65536?I+=2:I++){if(N=se(s,I),N===m)$=!0,Yn&&(H=H||I-ke-1>y&&s[ke+1]!==" ",ke=I);else if(!fe(N))return ae;Pe=Pe&&ve(N,R,T),R=N}H=H||Yn&&I-ke-1>y&&s[ke+1]!==" "}return!$&&!H?Pe&&!C&&!_(s)?We:A===he?ae:Te:b>9&&qe(s)?ae:C?A===he?ae:Te:H?Je:Ue}function mn(s,g,b,y,_){s.dump=(function(){if(g.length===0)return s.quotingType===he?'""':"''";if(!s.noCompatMode&&(Be.indexOf(g)!==-1||P.test(g)))return s.quotingType===he?'"'+g+'"':"'"+g+"'";let A=s.indent*Math.max(1,b),C=s.lineWidth===-1?-1:Math.max(Math.min(s.lineWidth,40),s.lineWidth-A),T=y||s.flowLevel>-1&&b>=s.flowLevel;function I(N){return Ge(s,N)}switch(Ye(g,T,s.indent,C,I,s.quotingType,s.forceQuotes&&!y,_)){case We:return g;case Te:return"'"+g.replace(/'/g,"''")+"'";case Ue:return"|"+Ke(g,s.indent)+ze(Ie(g,A));case Je:return">"+Ke(g,s.indent)+ze(Ie(hn(g,C),A));case ae:return'"'+gn(g,C)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function Ke(s,g){let b=qe(s)?String(g):"",y=s[s.length-1]===`
545
- `;return b+(y&&(s[s.length-2]===`
546
- `||s===`
547
- `)?"+":y?"":"-")+`
548
- `}function ze(s){return s[s.length-1]===`
549
- `?s.slice(0,-1):s}function hn(s,g){let b=/(\n+)([^\n]*)/g,y=(function(){let T=s.indexOf(`
550
- `);return T=T!==-1?T:s.length,b.lastIndex=T,ce(s.slice(0,T),g)})(),_=s[0]===`
551
- `||s[0]===" ",A,C;for(;C=b.exec(s);){let T=C[1],I=C[2];A=I[0]===" ",y+=T+(!_&&!A&&I!==""?`
552
- `:"")+ce(I,g),_=A}return y}function ce(s,g){if(s===""||s[0]===" ")return s;let b=/ [^ ]/g,y,_=0,A,C=0,T=0,I="";for(;y=b.exec(s);)T=y.index,T-_>g&&(A=C>_?C:T,I+=`
553
- `+s.slice(_,A),_=A+1),C=T;return I+=`
554
- `,s.length-_>g&&C>_?I+=s.slice(_,C)+`
555
- `+s.slice(C+1):I+=s.slice(_),I.slice(1)}function gn(s){let g="",b=0;for(let y=0;y<s.length;b>=65536?y+=2:y++){b=se(s,y);let _=U[b];!_&&fe(b)?(g+=s[y],b>=65536&&(g+=s[y+1])):g+=_||re(b)}return g}function Xe(s,g,b){let y="",_=s.tag;for(let A=0,C=b.length;A<C;A+=1){let T=b[A];s.replacer&&(T=s.replacer.call(b,String(A),T)),(x(s,g,T,!1,!1)||typeof T>"u"&&x(s,g,null,!1,!1))&&(y!==""&&(y+=","+(s.condenseFlow?"":" ")),y+=s.dump)}s.tag=_,s.dump="["+y+"]"}function Qe(s,g,b,y){let _="",A=s.tag;for(let C=0,T=b.length;C<T;C+=1){let I=b[C];s.replacer&&(I=s.replacer.call(b,String(C),I)),(x(s,g+1,I,!0,!0,!1,!0)||typeof I>"u"&&x(s,g+1,null,!0,!0,!1,!0))&&((!y||_!=="")&&(_+=_e(s,g)),s.dump&&m===s.dump.charCodeAt(0)?_+="-":_+="- ",_+=s.dump)}s.tag=A,s.dump=_||"[]"}function wn(s,g,b){let y="",_=s.tag,A=Object.keys(b);for(let C=0,T=A.length;C<T;C+=1){let I="";y!==""&&(I+=", "),s.condenseFlow&&(I+='"');let N=A[C],R=b[N];s.replacer&&(R=s.replacer.call(b,N,R)),x(s,g,N,!1,!1)&&(s.dump.length>1024&&(I+="? "),I+=s.dump+(s.condenseFlow?'"':"")+":"+(s.condenseFlow?"":" "),x(s,g,R,!1,!1)&&(I+=s.dump,y+=I))}s.tag=_,s.dump="{"+y+"}"}function n(s,g,b,y){let _="",A=s.tag,C=Object.keys(b);if(s.sortKeys===!0)C.sort();else if(typeof s.sortKeys=="function")C.sort(s.sortKeys);else if(s.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let T=0,I=C.length;T<I;T+=1){let N="";(!y||_!=="")&&(N+=_e(s,g));let R=C[T],$=b[R];if(s.replacer&&($=s.replacer.call(b,R,$)),!x(s,g+1,R,!0,!0,!0))continue;let H=s.tag!==null&&s.tag!=="?"||s.dump&&s.dump.length>1024;H&&(s.dump&&m===s.dump.charCodeAt(0)?N+="?":N+="? "),N+=s.dump,H&&(N+=_e(s,g)),x(s,g+1,$,!0,H)&&(s.dump&&m===s.dump.charCodeAt(0)?N+=":":N+=": ",N+=s.dump,_+=N)}s.tag=A,s.dump=_||"{}"}function d(s,g,b){let y=b?s.explicitTypes:s.implicitTypes;for(let _=0,A=y.length;_<A;_+=1){let C=y[_];if((C.instanceOf||C.predicate)&&(!C.instanceOf||typeof g=="object"&&g instanceof C.instanceOf)&&(!C.predicate||C.predicate(g))){if(b?C.multi&&C.representName?s.tag=C.representName(g):s.tag=C.tag:s.tag="?",C.represent){let T=s.styleMap[C.tag]||C.defaultStyle,I;if(a.call(C.represent)==="[object Function]")I=C.represent(g,T);else if(c.call(C.represent,T))I=C.represent[T](g,T);else throw new i("!<"+C.tag+'> tag resolver accepts not "'+T+'" style');s.dump=I}return!0}}return!1}function x(s,g,b,y,_,A,C){s.tag=null,s.dump=b,d(s,b,!1)||d(s,b,!0);let T=a.call(s.dump),I=y;y&&(y=s.flowLevel<0||s.flowLevel>g);let N=T==="[object Object]"||T==="[object Array]",R,$;if(N&&(R=s.duplicates.indexOf(b),$=R!==-1),(s.tag!==null&&s.tag!=="?"||$||s.indent!==2&&g>0)&&(_=!1),$&&s.usedDuplicates[R])s.dump="*ref_"+R;else{if(N&&$&&!s.usedDuplicates[R]&&(s.usedDuplicates[R]=!0),T==="[object Object]")y&&Object.keys(s.dump).length!==0?(n(s,g,s.dump,_),$&&(s.dump="&ref_"+R+s.dump)):(wn(s,g,s.dump),$&&(s.dump="&ref_"+R+" "+s.dump));else if(T==="[object Array]")y&&s.dump.length!==0?(s.noArrayIndent&&!C&&g>0?Qe(s,g-1,s.dump,_):Qe(s,g,s.dump,_),$&&(s.dump="&ref_"+R+s.dump)):(Xe(s,g,s.dump),$&&(s.dump="&ref_"+R+" "+s.dump));else if(T==="[object String]")s.tag!=="?"&&mn(s,s.dump,g,A,I);else{if(T==="[object Undefined]")return!1;if(s.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+T)}if(s.tag!==null&&s.tag!=="?"){let H=encodeURI(s.tag[0]==="!"?s.tag.slice(1):s.tag).replace(/!/g,"%21");s.tag[0]==="!"?H="!"+H:H.slice(0,18)==="tag:yaml.org,2002:"?H="!!"+H.slice(18):H="!<"+H+">",s.dump=H+" "+s.dump}}return!0}function v(s,g){let b=[],y=[];w(s,b,y);let _=y.length;for(let A=0;A<_;A+=1)g.duplicates.push(b[y[A]]);g.usedDuplicates=new Array(_)}function w(s,g,b){if(s!==null&&typeof s=="object"){let y=g.indexOf(s);if(y!==-1)b.indexOf(y)===-1&&b.push(y);else if(g.push(s),Array.isArray(s))for(let _=0,A=s.length;_<A;_+=1)w(s[_],g,b);else{let _=Object.keys(s);for(let A=0,C=_.length;A<C;A+=1)w(s[_[A]],g,b)}}}function O(s,g){g=g||{};let b=new dn(g);b.noRefs||v(s,b);let y=s;return b.replacer&&(y=b.replacer.call({"":y},"",y)),x(b,0,y,!0,!0)?b.dump+`
556
- `:""}e.exports.dump=O})),Ht=ir(j(((o,e)=>{var t=or(),i=sr();function r(a,c){return function(){throw new Error("Function yaml."+a+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}e.exports.Type=K(),e.exports.Schema=bt(),e.exports.FAILSAFE_SCHEMA=It(),e.exports.JSON_SCHEMA=Rt(),e.exports.CORE_SCHEMA=$t(),e.exports.DEFAULT_SCHEMA=Fn(),e.exports.load=t.load,e.exports.loadAll=t.loadAll,e.exports.dump=i.dump,e.exports.YAMLException=Me(),e.exports.types={binary:Vt(),float:Nt(),map:St(),null:Tt(),pairs:Ft(),set:jt(),timestamp:Lt(),bool:kt(),int:Pt(),merge:Mt(),omap:Dt(),seq:Et(),str:Ot()},e.exports.safeLoad=r("safeLoad","load"),e.exports.safeLoadAll=r("safeLoadAll","loadAll"),e.exports.safeDump=r("safeDump","dump")}))(),1),{Type:Vo,Schema:Do,FAILSAFE_SCHEMA:Fo,JSON_SCHEMA:jo,CORE_SCHEMA:Ho,DEFAULT_SCHEMA:Bo,load:Go,loadAll:qo,dump:Wo,YAMLException:Uo,types:Jo,safeLoad:Yo,safeLoadAll:Ko,safeDump:zo}=Ht.default,jn=Ht.default;async function lr(o=process.cwd()){let e=q(o);for(;;){let t=q(e,"view-contracts.config.yaml");try{return await ar(t),t}catch{let i=on(e);if(i===e)return null;e=i}}}async function de(o){if(o)return q(o);let e=await lr();if(!e)throw new Error("view-contracts.config.yaml not found. Pass -c <path> or run from a project directory.");return e}async function we(o){let e=q(o),t=await Bt(e,"utf-8"),i=jn.load(t);return ur(e,i)}function ur(o,e){let t=ue(o);return{...e,openapi:q(t,e.openapi),bindings:q(t,e.bindings),microContractsConfig:q(t,e.microContractsConfig),viewsDir:q(t,e.viewsDir),generated:{contractDir:q(t,e.generated.contractDir),actions:q(t,e.generated.actions),bridge:q(t,e.generated.bridge),reactDir:q(t,e.generated.reactDir)},componentsModule:e.componentsModule?q(t,e.componentsModule):void 0,themeModule:e.themeModule?q(t,e.themeModule):void 0}}async function Ve(o){let e=await Bt(q(o),"utf-8");return jn.load(e)}function Gt(o,e){return q(o.generated.reactDir,`${e.screenName}.generated.tsx`)}function ue(o){return on(q(o))}function qt(o,e,t){let i=q(on(t),"../components/index.ts"),r=cr(on(q(t)),i);return r.startsWith(".")||(r=`./${r}`),r.replace(/\.tsx?$/,".js")}import{relative as pr}from"node:path";function Wt(o,e){return pr(o,e).split("\\").join("/")}function Q(o){return" ".repeat(o)}function De(o,e="vm"){let t=o.scope??e;return o.path?`${t}.${o.path}`:t}function Bn(o,e=!1){let t=e?" as ActionDescriptor":"";if(!o.params||Object.keys(o.params).length===0)return`{ name: ${JSON.stringify(o.name)} }${t}`;let i=Object.entries(o.params).map(([r,a])=>`${r}: ${Gn(a,0)}`).join(", ");return`{ name: ${JSON.stringify(o.name)}, params: { ${i} } }${t}`}function Hn(o,e,t=!1){if(o===null)return"null";if(typeof o=="string")return JSON.stringify(o);if(typeof o=="number"||typeof o=="boolean")return String(o);if(Array.isArray(o))return`[
557
- ${o.map(i=>`${Q(e+1)}${Hn(i,e+1,t)}`).join(`,
549
+ `+i.mark.snippet),l+" "+a):l}function r(i,s){Error.call(this),this.name="YAMLException",this.reason=i,this.mark=s,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(s){return this.name+": "+t(this,s)},e.exports=r})),Bl=U(((n,e)=>{var t=kt();function r(a,l,p,c,h){let u="",d="",v=Math.floor(h/2)-1;return c-l>v&&(u=" ... ",l=c-v+u.length),p-c>v&&(d=" ...",p=c+v-d.length),{str:u+a.slice(l,p).replace(/\t/g,"\u2192")+d,pos:c-l+u.length}}function i(a,l){return t.repeat(" ",l-a.length)+a}function s(a,l){if(l=Object.create(l||null),!a.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);let p=/\r?\n|\r|\0/g,c=[0],h=[],u,d=-1;for(;u=p.exec(a.buffer);)h.push(u.index),c.push(u.index+u[0].length),a.position<=u.index&&d<0&&(d=c.length-2);d<0&&(d=c.length-1);let v="",E=Math.min(a.line+l.linesAfter,h.length).toString().length,R=l.maxLength-(l.indent+E+3);for(let V=1;V<=l.linesBefore&&!(d-V<0);V++){let G=r(a.buffer,c[d-V],h[d-V],a.position-(c[d]-c[d-V]),R);v=t.repeat(" ",l.indent)+i((a.line-V+1).toString(),E)+" | "+G.str+`
550
+ `+v}let Y=r(a.buffer,c[d],h[d],a.position,R);v+=t.repeat(" ",l.indent)+i((a.line+1).toString(),E)+" | "+Y.str+`
551
+ `,v+=t.repeat("-",l.indent+E+3+Y.pos)+`^
552
+ `;for(let V=1;V<=l.linesAfter&&!(d+V>=h.length);V++){let G=r(a.buffer,c[d+V],h[d+V],a.position-(c[d]-c[d+V]),R);v+=t.repeat(" ",l.indent)+i((a.line+V+1).toString(),E)+" | "+G.str+`
553
+ `}return v.replace(/\n$/,"")}e.exports=s})),se=U(((n,e)=>{var t=Ot(),r=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];function s(l){let p={};return l!==null&&Object.keys(l).forEach(function(c){l[c].forEach(function(h){p[String(h)]=c})}),p}function a(l,p){if(p=p||{},Object.keys(p).forEach(function(c){if(r.indexOf(c)===-1)throw new t('Unknown option "'+c+'" is met in definition of "'+l+'" YAML type.')}),this.options=p,this.tag=l,this.kind=p.kind||null,this.resolve=p.resolve||function(){return!0},this.construct=p.construct||function(c){return c},this.instanceOf=p.instanceOf||null,this.predicate=p.predicate||null,this.represent=p.represent||null,this.representName=p.representName||null,this.defaultStyle=p.defaultStyle||null,this.multi=p.multi||!1,this.styleAliases=s(p.styleAliases||null),i.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+l+'" YAML type.')}e.exports=a})),ao=U(((n,e)=>{var t=Ot(),r=se();function i(l,p){let c=[];return l[p].forEach(function(h){let u=c.length;c.forEach(function(d,v){d.tag===h.tag&&d.kind===h.kind&&d.multi===h.multi&&(u=v)}),c[u]=h}),c}function s(){let l={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function p(c){c.multi?(l.multi[c.kind].push(c),l.multi.fallback.push(c)):l[c.kind][c.tag]=l.fallback[c.tag]=c}for(let c=0,h=arguments.length;c<h;c+=1)arguments[c].forEach(p);return l}function a(l){return this.extend(l)}a.prototype.extend=function(p){let c=[],h=[];if(p instanceof r)h.push(p);else if(Array.isArray(p))h=h.concat(p);else if(p&&(Array.isArray(p.implicit)||Array.isArray(p.explicit)))p.implicit&&(c=c.concat(p.implicit)),p.explicit&&(h=h.concat(p.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(d){if(!(d instanceof r))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(d.loadKind&&d.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(d.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),h.forEach(function(d){if(!(d instanceof r))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let u=Object.create(a.prototype);return u.implicit=(this.implicit||[]).concat(c),u.explicit=(this.explicit||[]).concat(h),u.compiledImplicit=i(u,"implicit"),u.compiledExplicit=i(u,"explicit"),u.compiledTypeMap=s(u.compiledImplicit,u.compiledExplicit),u},e.exports=a})),lo=U(((n,e)=>{e.exports=new(se())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})})),co=U(((n,e)=>{e.exports=new(se())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})})),uo=U(((n,e)=>{e.exports=new(se())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})})),po=U(((n,e)=>{e.exports=new(ao())({explicit:[lo(),co(),uo()]})})),fo=U(((n,e)=>{var t=se();function r(a){if(a===null)return!0;let l=a.length;return l===1&&a==="~"||l===4&&(a==="null"||a==="Null"||a==="NULL")}function i(){return null}function s(a){return a===null}e.exports=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})})),ho=U(((n,e)=>{var t=se();function r(a){if(a===null)return!1;let l=a.length;return l===4&&(a==="true"||a==="True"||a==="TRUE")||l===5&&(a==="false"||a==="False"||a==="FALSE")}function i(a){return a==="true"||a==="True"||a==="TRUE"}function s(a){return Object.prototype.toString.call(a)==="[object Boolean]"}e.exports=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:{lowercase:function(a){return a?"true":"false"},uppercase:function(a){return a?"TRUE":"FALSE"},camelcase:function(a){return a?"True":"False"}},defaultStyle:"lowercase"})})),mo=U(((n,e)=>{var t=kt(),r=se();function i(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function s(u){return u>=48&&u<=55}function a(u){return u>=48&&u<=57}function l(u){if(u===null)return!1;let d=u.length,v=0,E=!1;if(!d)return!1;let R=u[v];if((R==="-"||R==="+")&&(R=u[++v]),R==="0"){if(v+1===d)return!0;if(R=u[++v],R==="b"){for(v++;v<d;v++){if(R=u[v],R!=="0"&&R!=="1")return!1;E=!0}return E&&Number.isFinite(p(u))}if(R==="x"){for(v++;v<d;v++){if(!i(u.charCodeAt(v)))return!1;E=!0}return E&&Number.isFinite(p(u))}if(R==="o"){for(v++;v<d;v++){if(!s(u.charCodeAt(v)))return!1;E=!0}return E&&Number.isFinite(p(u))}}for(;v<d;v++){if(!a(u.charCodeAt(v)))return!1;E=!0}return E?Number.isFinite(p(u)):!1}function p(u){let d=u,v=1,E=d[0];if((E==="-"||E==="+")&&(E==="-"&&(v=-1),d=d.slice(1),E=d[0]),d==="0")return 0;if(E==="0"){if(d[1]==="b")return v*parseInt(d.slice(2),2);if(d[1]==="x")return v*parseInt(d.slice(2),16);if(d[1]==="o")return v*parseInt(d.slice(2),8)}return v*parseInt(d,10)}function c(u){return p(u)}function h(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!t.isNegativeZero(u)}e.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:l,construct:c,predicate:h,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),go=U(((n,e)=>{var t=kt(),r=se(),i=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function a(u){return u===null||!i.test(u)?!1:Number.isFinite(parseFloat(u,10))?!0:s.test(u)}function l(u){let d=u.toLowerCase(),v=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?v===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:v*parseFloat(d,10)}var p=/^[-+]?[0-9]+e/;function c(u,d){if(isNaN(u))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(u))return"-0.0";let v=u.toString(10);return p.test(v)?v.replace("e",".e"):v}function h(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||t.isNegativeZero(u))}e.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:a,construct:l,predicate:h,represent:c,defaultStyle:"lowercase"})})),vo=U(((n,e)=>{e.exports=po().extend({implicit:[fo(),ho(),mo(),go()]})})),_o=U(((n,e)=>{e.exports=vo()})),yo=U(((n,e)=>{var t=se(),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function s(p){return p===null?!1:r.exec(p)!==null||i.exec(p)!==null}function a(p){let c=0,h=null,u=r.exec(p);if(u===null&&(u=i.exec(p)),u===null)throw new Error("Date resolve error");let d=+u[1],v=+u[2]-1,E=+u[3];if(!u[4])return new Date(Date.UTC(d,v,E));let R=+u[4],Y=+u[5],V=+u[6];if(u[7]){for(c=u[7].slice(0,3);c.length<3;)c+="0";c=+c}if(u[9]){let le=+u[10],B=+(u[11]||0);h=(le*60+B)*6e4,u[9]==="-"&&(h=-h)}let G=new Date(Date.UTC(d,v,E,R,Y,V,c));return h&&G.setTime(G.getTime()-h),G}function l(p){return p.toISOString()}e.exports=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:a,instanceOf:Date,represent:l})})),wo=U(((n,e)=>{var t=se();function r(i){return i==="<<"||i===null}e.exports=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})})),bo=U(((n,e)=>{var t=se(),r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
554
+ \r`;function i(p){if(p===null)return!1;let c=0,h=p.length,u=r;for(let d=0;d<h;d++){let v=u.indexOf(p.charAt(d));if(!(v>64)){if(v<0)return!1;c+=6}}return c%8===0}function s(p){let c=p.replace(/[\r\n=]/g,""),h=c.length,u=r,d=0,v=[];for(let R=0;R<h;R++)R%4===0&&R&&(v.push(d>>16&255),v.push(d>>8&255),v.push(d&255)),d=d<<6|u.indexOf(c.charAt(R));let E=h%4*6;return E===0?(v.push(d>>16&255),v.push(d>>8&255),v.push(d&255)):E===18?(v.push(d>>10&255),v.push(d>>2&255)):E===12&&v.push(d>>4&255),new Uint8Array(v)}function a(p){let c="",h=0,u=p.length,d=r;for(let E=0;E<u;E++)E%3===0&&E&&(c+=d[h>>18&63],c+=d[h>>12&63],c+=d[h>>6&63],c+=d[h&63]),h=(h<<8)+p[E];let v=u%3;return v===0?(c+=d[h>>18&63],c+=d[h>>12&63],c+=d[h>>6&63],c+=d[h&63]):v===2?(c+=d[h>>10&63],c+=d[h>>4&63],c+=d[h<<2&63],c+=d[64]):v===1&&(c+=d[h>>2&63],c+=d[h<<4&63],c+=d[64],c+=d[64]),c}function l(p){return Object.prototype.toString.call(p)==="[object Uint8Array]"}e.exports=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:s,predicate:l,represent:a})})),xo=U(((n,e)=>{var t=se(),r=Object.prototype.hasOwnProperty,i=Object.prototype.toString;function s(l){if(l===null)return!0;let p=[],c=l;for(let h=0,u=c.length;h<u;h+=1){let d=c[h],v=!1;if(i.call(d)!=="[object Object]")return!1;let E;for(E in d)if(r.call(d,E))if(!v)v=!0;else return!1;if(!v)return!1;if(p.indexOf(E)===-1)p.push(E);else return!1}return!0}function a(l){return l!==null?l:[]}e.exports=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:s,construct:a})})),So=U(((n,e)=>{var t=se(),r=Object.prototype.toString;function i(a){if(a===null)return!0;let l=a,p=new Array(l.length);for(let c=0,h=l.length;c<h;c+=1){let u=l[c];if(r.call(u)!=="[object Object]")return!1;let d=Object.keys(u);if(d.length!==1)return!1;p[c]=[d[0],u[d[0]]]}return!0}function s(a){if(a===null)return[];let l=a,p=new Array(l.length);for(let c=0,h=l.length;c<h;c+=1){let u=l[c],d=Object.keys(u);p[c]=[d[0],u[d[0]]]}return p}e.exports=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:s})})),Co=U(((n,e)=>{var t=se(),r=Object.prototype.hasOwnProperty;function i(a){if(a===null)return!0;let l=a;for(let p in l)if(r.call(l,p)&&l[p]!==null)return!1;return!0}function s(a){return a!==null?a:{}}e.exports=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:s})})),kr=U(((n,e)=>{e.exports=_o().extend({implicit:[yo(),wo()],explicit:[bo(),xo(),So(),Co()]})})),ql=U(((n,e)=>{var t=kt(),r=Ot(),i=Bl(),s=kr(),a=Object.prototype.hasOwnProperty,l=1,p=2,c=3,h=4,u=1,d=2,v=3,E=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,R=/[\x85\u2028\u2029]/,Y=/[,\[\]{}]/,V=/^(?:!|!!|![0-9A-Za-z-]+!)$/,G=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function le(o){return Object.prototype.toString.call(o)}function B(o){return o===10||o===13}function X(o){return o===9||o===32}function K(o){return o===9||o===32||o===10||o===13}function te(o){return o===44||o===91||o===93||o===123||o===125}function Jt(o){if(o>=48&&o<=57)return o-48;let m=o|32;return m>=97&&m<=102?m-97+10:-1}function Ge(o){return o===120?2:o===117?4:o===85?8:0}function ye(o){return o>=48&&o<=57?o-48:-1}function xe(o){switch(o){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
555
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function ue(o){return o<=65535?String.fromCharCode(o):String.fromCharCode((o-65536>>10)+55296,(o-65536&1023)+56320)}function He(o,m,y){m==="__proto__"?Object.defineProperty(o,m,{configurable:!0,enumerable:!0,writable:!0,value:y}):o[m]=y}var Ee=new Array(256),ke=new Array(256);for(let o=0;o<256;o++)Ee[o]=xe(o)?1:0,ke[o]=xe(o);function j(o,m){this.input=o,this.filename=m.filename||null,this.schema=m.schema||s,this.onWarning=m.onWarning||null,this.legacy=m.legacy||!1,this.json=m.json||!1,this.listener=m.listener||null,this.maxDepth=typeof m.maxDepth=="number"?m.maxDepth:100,this.maxMergeSeqLength=typeof m.maxMergeSeqLength=="number"?m.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=o.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Yt(o,m){let y={name:o.filename,buffer:o.input.slice(0,-1),position:o.position,line:o.line,column:o.position-o.lineStart};return y.snippet=i(y),new r(m,y)}function N(o,m){throw Yt(o,m)}function tt(o,m){o.onWarning&&o.onWarning.call(null,Yt(o,m))}function Oe(o,m,y){let x=o.anchorMapTransactions;if(x.length!==0){let _=x[x.length-1];a.call(_,m)||(_[m]={existed:a.call(o.anchorMap,m),value:o.anchorMap[m]})}o.anchorMap[m]=y}function er(o){o.anchorMapTransactions.push(Object.create(null))}function We(o){let m=o.anchorMapTransactions.pop(),y=o.anchorMapTransactions;if(y.length===0)return;let x=y[y.length-1],_=Object.keys(m);for(let k=0,f=_.length;k<f;k+=1){let g=_[k];a.call(x,g)||(x[g]=m[g])}}function tr(o){let m=o.anchorMapTransactions.pop(),y=Object.keys(m);for(let x=y.length-1;x>=0;x-=1){let _=m[y[x]];_.existed?o.anchorMap[y[x]]=_.value:delete o.anchorMap[y[x]]}}function bt(o){return{position:o.position,line:o.line,lineStart:o.lineStart,lineIndent:o.lineIndent,firstTabInLine:o.firstTabInLine,tag:o.tag,anchor:o.anchor,kind:o.kind,result:o.result}}function nt(o,m){o.position=m.position,o.line=m.line,o.lineStart=m.lineStart,o.lineIndent=m.lineIndent,o.firstTabInLine=m.firstTabInLine,o.tag=m.tag,o.anchor=m.anchor,o.kind=m.kind,o.result=m.result}var Kt={YAML:function(m,y,x){m.version!==null&&N(m,"duplication of %YAML directive"),x.length!==1&&N(m,"YAML directive accepts exactly one argument");let _=/^([0-9]+)\.([0-9]+)$/.exec(x[0]);_===null&&N(m,"ill-formed argument of the YAML directive");let k=parseInt(_[1],10),f=parseInt(_[2],10);k!==1&&N(m,"unacceptable YAML version of the document"),m.version=x[0],m.checkLineBreaks=f<2,f!==1&&f!==2&&tt(m,"unsupported YAML version of the document")},TAG:function(m,y,x){let _;x.length!==2&&N(m,"TAG directive accepts exactly two arguments");let k=x[0];_=x[1],V.test(k)||N(m,"ill-formed tag handle (first argument) of the TAG directive"),a.call(m.tagMap,k)&&N(m,'there is a previously declared suffix for "'+k+'" tag handle'),G.test(_)||N(m,"ill-formed tag prefix (second argument) of the TAG directive");try{_=decodeURIComponent(_)}catch{N(m,"tag prefix is malformed: "+_)}m.tagMap[k]=_}};function pe(o,m,y,x){if(m<y){let _=o.input.slice(m,y);if(x)for(let k=0,f=_.length;k<f;k+=1){let g=_.charCodeAt(k);g===9||g>=32&&g<=1114111||N(o,"expected valid JSON character")}else E.test(_)&&N(o,"the stream contains non-printable characters");o.result+=_}}function Be(o,m,y,x){t.isObject(y)||N(o,"cannot merge mappings; the provided source object is unacceptable");let _=Object.keys(y);for(let k=0,f=_.length;k<f;k+=1){let g=_[k];a.call(m,g)||(He(m,g,y[g]),x[g]=!0)}}function Pe(o,m,y,x,_,k,f,g,A){if(Array.isArray(_)){_=Array.prototype.slice.call(_);for(let w=0,b=_.length;w<b;w+=1)Array.isArray(_[w])&&N(o,"nested arrays are not supported inside keys"),typeof _=="object"&&le(_[w])==="[object Object]"&&(_[w]="[object Object]")}if(typeof _=="object"&&le(_)==="[object Object]"&&(_="[object Object]"),_=String(_),m===null&&(m={}),x==="tag:yaml.org,2002:merge")if(Array.isArray(k)){k.length>o.maxMergeSeqLength&&N(o,"merge sequence length exceeded maxMergeSeqLength ("+o.maxMergeSeqLength+")");let w=new Set;for(let b=0,C=k.length;b<C;b+=1){let S=k[b];w.has(S)||(w.add(S),Be(o,m,S,y))}}else Be(o,m,k,y);else!o.json&&!a.call(y,_)&&a.call(m,_)&&(o.line=f||o.line,o.lineStart=g||o.lineStart,o.position=A||o.position,N(o,"duplicated mapping key")),He(m,_,k),delete y[_];return m}function rt(o){let m=o.input.charCodeAt(o.position);m===10?o.position++:m===13?(o.position++,o.input.charCodeAt(o.position)===10&&o.position++):N(o,"a line break is expected"),o.line+=1,o.lineStart=o.position,o.firstTabInLine=-1}function Z(o,m,y){let x=0,_=o.input.charCodeAt(o.position);for(;_!==0;){for(;X(_);)_===9&&o.firstTabInLine===-1&&(o.firstTabInLine=o.position),_=o.input.charCodeAt(++o.position);if(m&&_===35)do _=o.input.charCodeAt(++o.position);while(_!==10&&_!==13&&_!==0);if(B(_))for(rt(o),_=o.input.charCodeAt(o.position),x++,o.lineIndent=0;_===32;)o.lineIndent++,_=o.input.charCodeAt(++o.position);else break}return y!==-1&&x!==0&&o.lineIndent<y&&tt(o,"deficient indentation"),x}function it(o){let m=o.position,y=o.input.charCodeAt(m);return!!((y===45||y===46)&&y===o.input.charCodeAt(m+1)&&y===o.input.charCodeAt(m+2)&&(m+=3,y=o.input.charCodeAt(m),y===0||K(y)))}function Ie(o,m){m===1?o.result+=" ":m>1&&(o.result+=t.repeat(`
556
+ `,m-1))}function zt(o,m,y){let x,_,k,f,g,A,w=o.kind,b=o.result,C=o.input.charCodeAt(o.position);if(K(C)||te(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96)return!1;if(C===63||C===45){let S=o.input.charCodeAt(o.position+1);if(K(S)||y&&te(S))return!1}for(o.kind="scalar",o.result="",x=_=o.position,k=!1;C!==0;){if(C===58){let S=o.input.charCodeAt(o.position+1);if(K(S)||y&&te(S))break}else if(C===35){if(K(o.input.charCodeAt(o.position-1)))break}else{if(o.position===o.lineStart&&it(o)||y&&te(C))break;if(B(C))if(f=o.line,g=o.lineStart,A=o.lineIndent,Z(o,!1,-1),o.lineIndent>=m){k=!0,C=o.input.charCodeAt(o.position);continue}else{o.position=_,o.line=f,o.lineStart=g,o.lineIndent=A;break}}k&&(pe(o,x,_,!1),Ie(o,o.line-f),x=_=o.position,k=!1),X(C)||(_=o.position+1),C=o.input.charCodeAt(++o.position)}return pe(o,x,_,!1),o.result?!0:(o.kind=w,o.result=b,!1)}function Qt(o,m){let y,x,_=o.input.charCodeAt(o.position);if(_!==39)return!1;for(o.kind="scalar",o.result="",o.position++,y=x=o.position;(_=o.input.charCodeAt(o.position))!==0;)if(_===39)if(pe(o,y,o.position,!0),_=o.input.charCodeAt(++o.position),_===39)y=o.position,o.position++,x=o.position;else return!0;else B(_)?(pe(o,y,x,!0),Ie(o,Z(o,!1,m)),y=x=o.position):o.position===o.lineStart&&it(o)?N(o,"unexpected end of the document within a single quoted scalar"):(o.position++,X(_)||(x=o.position));N(o,"unexpected end of the stream within a single quoted scalar")}function xt(o,m){let y,x,_,k=o.input.charCodeAt(o.position);if(k!==34)return!1;for(o.kind="scalar",o.result="",o.position++,y=x=o.position;(k=o.input.charCodeAt(o.position))!==0;){if(k===34)return pe(o,y,o.position,!0),o.position++,!0;if(k===92){if(pe(o,y,o.position,!0),k=o.input.charCodeAt(++o.position),B(k))Z(o,!1,m);else if(k<256&&Ee[k])o.result+=ke[k],o.position++;else if((_=Ge(k))>0){let f=_,g=0;for(;f>0;f--)k=o.input.charCodeAt(++o.position),(_=Jt(k))>=0?g=(g<<4)+_:N(o,"expected hexadecimal character");o.result+=ue(g),o.position++}else N(o,"unknown escape sequence");y=x=o.position}else B(k)?(pe(o,y,x,!0),Ie(o,Z(o,!1,m)),y=x=o.position):o.position===o.lineStart&&it(o)?N(o,"unexpected end of the document within a double quoted scalar"):(o.position++,X(k)||(x=o.position))}N(o,"unexpected end of the stream within a double quoted scalar")}function Xt(o,m){let y=!0,x,_,k,f=o.tag,g,A=o.anchor,w,b,C,S,I=Object.create(null),P,M,T,H=o.input.charCodeAt(o.position);if(H===91)w=93,S=!1,g=[];else if(H===123)w=125,S=!0,g={};else return!1;for(o.anchor!==null&&Oe(o,o.anchor,g),H=o.input.charCodeAt(++o.position);H!==0;){if(Z(o,!0,m),H=o.input.charCodeAt(o.position),H===w)return o.position++,o.tag=f,o.anchor=A,o.kind=S?"mapping":"sequence",o.result=g,!0;y?H===44&&N(o,"expected the node content, but found ','"):N(o,"missed comma between flow collection entries"),M=P=T=null,b=C=!1,H===63&&K(o.input.charCodeAt(o.position+1))&&(b=C=!0,o.position++,Z(o,!0,m)),x=o.line,_=o.lineStart,k=o.position,Ne(o,m,l,!1,!0),M=o.tag,P=o.result,Z(o,!0,m),H=o.input.charCodeAt(o.position),(C||o.line===x)&&H===58&&(b=!0,H=o.input.charCodeAt(++o.position),Z(o,!0,m),Ne(o,m,l,!1,!0),T=o.result),S?Pe(o,g,I,M,P,T,x,_,k):b?g.push(Pe(o,null,I,M,P,T,x,_,k)):g.push(P),Z(o,!0,m),H=o.input.charCodeAt(o.position),H===44?(y=!0,H=o.input.charCodeAt(++o.position)):y=!1}N(o,"unexpected end of the stream within a flow collection")}function Zt(o,m){let y,x=u,_=!1,k=!1,f=m,g=0,A=!1,w,b=o.input.charCodeAt(o.position);if(b===124)y=!1;else if(b===62)y=!0;else return!1;for(o.kind="scalar",o.result="";b!==0;)if(b=o.input.charCodeAt(++o.position),b===43||b===45)u===x?x=b===43?v:d:N(o,"repeat of a chomping mode identifier");else if((w=ye(b))>=0)w===0?N(o,"bad explicit indentation width of a block scalar; it cannot be less than one"):k?N(o,"repeat of an indentation width identifier"):(f=m+w-1,k=!0);else break;if(X(b)){do b=o.input.charCodeAt(++o.position);while(X(b));if(b===35)do b=o.input.charCodeAt(++o.position);while(!B(b)&&b!==0)}for(;b!==0;){for(rt(o),o.lineIndent=0,b=o.input.charCodeAt(o.position);(!k||o.lineIndent<f)&&b===32;)o.lineIndent++,b=o.input.charCodeAt(++o.position);if(!k&&o.lineIndent>f&&(f=o.lineIndent),B(b)){g++;continue}if(!k&&f===0&&N(o,"missing indentation for block scalar"),o.lineIndent<f){x===v?o.result+=t.repeat(`
557
+ `,_?1+g:g):x===u&&_&&(o.result+=`
558
+ `);break}y?X(b)?(A=!0,o.result+=t.repeat(`
559
+ `,_?1+g:g)):A?(A=!1,o.result+=t.repeat(`
560
+ `,g+1)):g===0?_&&(o.result+=" "):o.result+=t.repeat(`
561
+ `,g):o.result+=t.repeat(`
562
+ `,_?1+g:g),_=!0,k=!0,g=0;let C=o.position;for(;!B(b)&&b!==0;)b=o.input.charCodeAt(++o.position);pe(o,C,o.position,!1)}return!0}function Le(o,m){let y=o.tag,x=o.anchor,_=[],k=!1;if(o.firstTabInLine!==-1)return!1;o.anchor!==null&&Oe(o,o.anchor,_);let f=o.input.charCodeAt(o.position);for(;f!==0&&(o.firstTabInLine!==-1&&(o.position=o.firstTabInLine,N(o,"tab characters must not be used in indentation")),!(f!==45||!K(o.input.charCodeAt(o.position+1))));){if(k=!0,o.position++,Z(o,!0,-1)&&o.lineIndent<=m){_.push(null),f=o.input.charCodeAt(o.position);continue}let g=o.line;if(Ne(o,m,c,!1,!0),_.push(o.result),Z(o,!0,-1),f=o.input.charCodeAt(o.position),(o.line===g||o.lineIndent>m)&&f!==0)N(o,"bad indentation of a sequence entry");else if(o.lineIndent<m)break}return k?(o.tag=y,o.anchor=x,o.kind="sequence",o.result=_,!0):!1}function en(o,m,y){let x,_,k,f,g=o.tag,A=o.anchor,w={},b=Object.create(null),C=null,S=null,I=null,P=!1,M=!1;if(o.firstTabInLine!==-1)return!1;o.anchor!==null&&Oe(o,o.anchor,w);let T=o.input.charCodeAt(o.position);for(;T!==0;){!P&&o.firstTabInLine!==-1&&(o.position=o.firstTabInLine,N(o,"tab characters must not be used in indentation"));let H=o.input.charCodeAt(o.position+1),Q=o.line;if((T===63||T===58)&&K(H))T===63?(P&&(Pe(o,w,b,C,S,null,_,k,f),C=S=I=null),M=!0,P=!0,x=!0):P?(P=!1,x=!0):N(o,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),o.position+=1,T=H;else{if(_=o.line,k=o.lineStart,f=o.position,!Ne(o,y,p,!1,!0))break;if(o.line===Q){for(T=o.input.charCodeAt(o.position);X(T);)T=o.input.charCodeAt(++o.position);if(T===58)T=o.input.charCodeAt(++o.position),K(T)||N(o,"a whitespace character is expected after the key-value separator within a block mapping"),P&&(Pe(o,w,b,C,S,null,_,k,f),C=S=I=null),M=!0,P=!1,x=!1,C=o.tag,S=o.result;else if(M)N(o,"can not read an implicit mapping pair; a colon is missed");else return o.tag=g,o.anchor=A,!0}else if(M)N(o,"can not read a block mapping entry; a multiline key may not be an implicit key");else return o.tag=g,o.anchor=A,!0}if((o.line===Q||o.lineIndent>m)&&(P&&(_=o.line,k=o.lineStart,f=o.position),Ne(o,m,h,!0,x)&&(P?S=o.result:I=o.result),P||(Pe(o,w,b,C,S,I,_,k,f),C=S=I=null),Z(o,!0,-1),T=o.input.charCodeAt(o.position)),(o.line===Q||o.lineIndent>m)&&T!==0)N(o,"bad indentation of a mapping entry");else if(o.lineIndent<m)break}return P&&Pe(o,w,b,C,S,null,_,k,f),M&&(o.tag=g,o.anchor=A,o.kind="mapping",o.result=w),M}function nr(o){let m=!1,y=!1,x,_,k=o.input.charCodeAt(o.position);if(k!==33)return!1;o.tag!==null&&N(o,"duplication of a tag property"),k=o.input.charCodeAt(++o.position),k===60?(m=!0,k=o.input.charCodeAt(++o.position)):k===33?(y=!0,x="!!",k=o.input.charCodeAt(++o.position)):x="!";let f=o.position;if(m){do k=o.input.charCodeAt(++o.position);while(k!==0&&k!==62);o.position<o.length?(_=o.input.slice(f,o.position),k=o.input.charCodeAt(++o.position)):N(o,"unexpected end of the stream within a verbatim tag")}else{for(;k!==0&&!K(k);)k===33&&(y?N(o,"tag suffix cannot contain exclamation marks"):(x=o.input.slice(f-1,o.position+1),V.test(x)||N(o,"named tag handle cannot contain such characters"),y=!0,f=o.position+1)),k=o.input.charCodeAt(++o.position);_=o.input.slice(f,o.position),Y.test(_)&&N(o,"tag suffix cannot contain flow indicator characters")}_&&!G.test(_)&&N(o,"tag name cannot contain such characters: "+_);try{_=decodeURIComponent(_)}catch{N(o,"tag name is malformed: "+_)}return m?o.tag=_:a.call(o.tagMap,x)?o.tag=o.tagMap[x]+_:x==="!"?o.tag="!"+_:x==="!!"?o.tag="tag:yaml.org,2002:"+_:N(o,'undeclared tag handle "'+x+'"'),!0}function tn(o){let m=o.input.charCodeAt(o.position);if(m!==38)return!1;o.anchor!==null&&N(o,"duplication of an anchor property"),m=o.input.charCodeAt(++o.position);let y=o.position;for(;m!==0&&!K(m)&&!te(m);)m=o.input.charCodeAt(++o.position);return o.position===y&&N(o,"name of an anchor node must contain at least one character"),o.anchor=o.input.slice(y,o.position),!0}function nn(o){let m=o.input.charCodeAt(o.position);if(m!==42)return!1;m=o.input.charCodeAt(++o.position);let y=o.position;for(;m!==0&&!K(m)&&!te(m);)m=o.input.charCodeAt(++o.position);o.position===y&&N(o,"name of an alias node must contain at least one character");let x=o.input.slice(y,o.position);return a.call(o.anchorMap,x)||N(o,'unidentified alias "'+x+'"'),o.result=o.anchorMap[x],Z(o,!0,-1),!0}function rr(o,m,y,x){let _=bt(o);return er(o),nt(o,m),o.tag=null,o.anchor=null,o.kind=null,o.result=null,en(o,y,x)&&o.kind==="mapping"?(We(o),!0):(tr(o),nt(o,_),!1)}function Ne(o,m,y,x,_){let k,f,g=1,A=!1,w=!1,b=null,C,S,I;o.depth>=o.maxDepth&&N(o,"nesting exceeded maxDepth ("+o.maxDepth+")"),o.depth+=1,o.listener!==null&&o.listener("open",o),o.tag=null,o.anchor=null,o.kind=null,o.result=null;let P=k=f=h===y||c===y;if(x&&Z(o,!0,-1)&&(A=!0,o.lineIndent>m?g=1:o.lineIndent===m?g=0:o.lineIndent<m&&(g=-1)),g===1)for(;;){let M=o.input.charCodeAt(o.position),T=bt(o);if(A&&(M===33&&o.tag!==null||M===38&&o.anchor!==null)||!nr(o)&&!tn(o))break;b===null&&(b=T),Z(o,!0,-1)?(A=!0,f=P,o.lineIndent>m?g=1:o.lineIndent===m?g=0:o.lineIndent<m&&(g=-1)):f=!1}if(f&&(f=A||_),g===1||h===y)if(l===y||p===y?S=m:S=m+1,I=o.position-o.lineStart,g===1)if(f&&(Le(o,I)||en(o,I,S))||Xt(o,S))w=!0;else{let M=o.input.charCodeAt(o.position);b!==null&&P&&!f&&M!==124&&M!==62&&rr(o,b,b.position-b.lineStart,S)||k&&Zt(o,S)||Qt(o,S)||xt(o,S)?w=!0:nn(o)?(w=!0,(o.tag!==null||o.anchor!==null)&&N(o,"alias node should not have any properties")):zt(o,S,l===y)&&(w=!0,o.tag===null&&(o.tag="?")),o.anchor!==null&&Oe(o,o.anchor,o.result)}else g===0&&(w=f&&Le(o,I));if(o.tag===null)o.anchor!==null&&Oe(o,o.anchor,o.result);else if(o.tag==="?"){o.result!==null&&o.kind!=="scalar"&&N(o,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+o.kind+'"');for(let M=0,T=o.implicitTypes.length;M<T;M+=1)if(C=o.implicitTypes[M],C.resolve(o.result)){o.result=C.construct(o.result),o.tag=C.tag,o.anchor!==null&&Oe(o,o.anchor,o.result);break}}else if(o.tag!=="!"){if(a.call(o.typeMap[o.kind||"fallback"],o.tag))C=o.typeMap[o.kind||"fallback"][o.tag];else{C=null;let M=o.typeMap.multi[o.kind||"fallback"];for(let T=0,H=M.length;T<H;T+=1)if(o.tag.slice(0,M[T].tag.length)===M[T].tag){C=M[T];break}}C||N(o,"unknown tag !<"+o.tag+">"),o.result!==null&&C.kind!==o.kind&&N(o,"unacceptable node kind for !<"+o.tag+'> tag; it should be "'+C.kind+'", not "'+o.kind+'"'),C.resolve(o.result,o.tag)?(o.result=C.construct(o.result,o.tag),o.anchor!==null&&Oe(o,o.anchor,o.result)):N(o,"cannot resolve a node with !<"+o.tag+"> explicit tag")}return o.listener!==null&&o.listener("close",o),o.depth-=1,o.tag!==null||o.anchor!==null||w}function ir(o){let m=o.position,y=!1,x;for(o.version=null,o.checkLineBreaks=o.legacy,o.tagMap=Object.create(null),o.anchorMap=Object.create(null);(x=o.input.charCodeAt(o.position))!==0&&(Z(o,!0,-1),x=o.input.charCodeAt(o.position),!(o.lineIndent>0||x!==37));){y=!0,x=o.input.charCodeAt(++o.position);let _=o.position;for(;x!==0&&!K(x);)x=o.input.charCodeAt(++o.position);let k=o.input.slice(_,o.position),f=[];for(k.length<1&&N(o,"directive name must not be less than one character in length");x!==0;){for(;X(x);)x=o.input.charCodeAt(++o.position);if(x===35){do x=o.input.charCodeAt(++o.position);while(x!==0&&!B(x));break}if(B(x))break;for(_=o.position;x!==0&&!K(x);)x=o.input.charCodeAt(++o.position);f.push(o.input.slice(_,o.position))}x!==0&&rt(o),a.call(Kt,k)?Kt[k](o,k,f):tt(o,'unknown document directive "'+k+'"')}if(Z(o,!0,-1),o.lineIndent===0&&o.input.charCodeAt(o.position)===45&&o.input.charCodeAt(o.position+1)===45&&o.input.charCodeAt(o.position+2)===45?(o.position+=3,Z(o,!0,-1)):y&&N(o,"directives end mark is expected"),Ne(o,o.lineIndent-1,h,!1,!0),Z(o,!0,-1),o.checkLineBreaks&&R.test(o.input.slice(m,o.position))&&tt(o,"non-ASCII line breaks are interpreted as content"),o.documents.push(o.result),o.position===o.lineStart&&it(o)){o.input.charCodeAt(o.position)===46&&(o.position+=3,Z(o,!0,-1));return}o.position<o.length-1&&N(o,"end of the stream or a document separator is expected")}function rn(o,m){o=String(o),m=m||{},o.length!==0&&(o.charCodeAt(o.length-1)!==10&&o.charCodeAt(o.length-1)!==13&&(o+=`
563
+ `),o.charCodeAt(0)===65279&&(o=o.slice(1)));let y=new j(o,m),x=o.indexOf("\0");for(x!==-1&&(y.position=x,N(y,"null byte is not allowed in input")),y.input+="\0";y.input.charCodeAt(y.position)===32;)y.lineIndent+=1,y.position+=1;for(;y.position<y.length-1;)ir(y);return y.documents}function on(o,m,y){m!==null&&typeof m=="object"&&typeof y>"u"&&(y=m,m=null);let x=rn(o,y);if(typeof m!="function")return x;for(let _=0,k=x.length;_<k;_+=1)m(x[_])}function or(o,m){let y=rn(o,m);if(y.length!==0){if(y.length===1)return y[0];throw new r("expected a single document in the stream, but found more")}}e.exports.loadAll=on,e.exports.load=or})),jl=U(((n,e)=>{var t=kt(),r=Ot(),i=kr(),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,l=65279,p=9,c=10,h=13,u=32,d=33,v=34,E=35,R=37,Y=38,V=39,G=42,le=44,B=45,X=58,K=61,te=62,Jt=63,Ge=64,ye=91,xe=93,ue=96,He=123,Ee=124,ke=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";var Yt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],N=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function tt(f,g){if(g===null)return{};let A={},w=Object.keys(g);for(let b=0,C=w.length;b<C;b+=1){let S=w[b],I=String(g[S]);S.slice(0,2)==="!!"&&(S="tag:yaml.org,2002:"+S.slice(2));let P=f.compiledTypeMap.fallback[S];P&&a.call(P.styleAliases,I)&&(I=P.styleAliases[I]),A[S]=I}return A}function Oe(f){let g,A,w=f.toString(16).toUpperCase();if(f<=255)g="x",A=2;else if(f<=65535)g="u",A=4;else if(f<=4294967295)g="U",A=8;else throw new r("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+g+t.repeat("0",A-w.length)+w}var er=1,We=2;function tr(f){this.schema=f.schema||i,this.indent=Math.max(1,f.indent||2),this.noArrayIndent=f.noArrayIndent||!1,this.skipInvalid=f.skipInvalid||!1,this.flowLevel=t.isNothing(f.flowLevel)?-1:f.flowLevel,this.styleMap=tt(this.schema,f.styles||null),this.sortKeys=f.sortKeys||!1,this.lineWidth=f.lineWidth||80,this.noRefs=f.noRefs||!1,this.noCompatMode=f.noCompatMode||!1,this.condenseFlow=f.condenseFlow||!1,this.quotingType=f.quotingType==='"'?We:er,this.forceQuotes=f.forceQuotes||!1,this.replacer=typeof f.replacer=="function"?f.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function bt(f,g){let A=t.repeat(" ",g),w=0,b="",C=f.length;for(;w<C;){let S,I=f.indexOf(`
564
+ `,w);I===-1?(S=f.slice(w),w=C):(S=f.slice(w,I+1),w=I+1),S.length&&S!==`
565
+ `&&(b+=A),b+=S}return b}function nt(f,g){return`
566
+ `+t.repeat(" ",f.indent*g)}function Kt(f,g){for(let A=0,w=f.implicitTypes.length;A<w;A+=1)if(f.implicitTypes[A].resolve(g))return!0;return!1}function pe(f){return f===u||f===p}function Be(f){return f>=32&&f<=126||f>=161&&f<=55295&&f!==8232&&f!==8233||f>=57344&&f<=65533&&f!==l||f>=65536&&f<=1114111}function Pe(f){return Be(f)&&f!==l&&f!==h&&f!==c}function rt(f,g,A){let w=Pe(f),b=w&&!pe(f);return(A?w:w&&f!==le&&f!==ye&&f!==xe&&f!==He&&f!==ke)&&f!==E&&!(g===X&&!b)||Pe(g)&&!pe(g)&&f===E||g===X&&b}function Z(f){return Be(f)&&f!==l&&!pe(f)&&f!==B&&f!==Jt&&f!==X&&f!==le&&f!==ye&&f!==xe&&f!==He&&f!==ke&&f!==E&&f!==Y&&f!==G&&f!==d&&f!==Ee&&f!==K&&f!==te&&f!==V&&f!==v&&f!==R&&f!==Ge&&f!==ue}function it(f){return!pe(f)&&f!==X}function Ie(f,g){let A=f.charCodeAt(g),w;return A>=55296&&A<=56319&&g+1<f.length&&(w=f.charCodeAt(g+1),w>=56320&&w<=57343)?(A-55296)*1024+w-56320+65536:A}function zt(f){return/^\n* /.test(f)}var Qt=1,xt=2,Xt=3,Zt=4,Le=5;function en(f,g,A,w,b,C,S,I){let P,M=0,T=null,H=!1,Q=!1,Li=w!==-1,St=-1,Ct=Z(Ie(f,0))&&it(Ie(f,f.length-1));if(g||S)for(P=0;P<f.length;M>=65536?P+=2:P++){if(M=Ie(f,P),!Be(M))return Le;Ct=Ct&&rt(M,T,I),T=M}else{for(P=0;P<f.length;M>=65536?P+=2:P++){if(M=Ie(f,P),M===c)H=!0,Li&&(Q=Q||P-St-1>w&&f[St+1]!==" ",St=P);else if(!Be(M))return Le;Ct=Ct&&rt(M,T,I),T=M}Q=Q||Li&&P-St-1>w&&f[St+1]!==" "}return!H&&!Q?Ct&&!S&&!b(f)?Qt:C===We?Le:xt:A>9&&zt(f)?Le:S?C===We?Le:xt:Q?Zt:Xt}function nr(f,g,A,w,b){f.dump=(function(){if(g.length===0)return f.quotingType===We?'""':"''";if(!f.noCompatMode&&(Yt.indexOf(g)!==-1||N.test(g)))return f.quotingType===We?'"'+g+'"':"'"+g+"'";let C=f.indent*Math.max(1,A),S=f.lineWidth===-1?-1:Math.max(Math.min(f.lineWidth,40),f.lineWidth-C),I=w||f.flowLevel>-1&&A>=f.flowLevel;function P(M){return Kt(f,M)}switch(en(g,I,f.indent,S,P,f.quotingType,f.forceQuotes&&!w,b)){case Qt:return g;case xt:return"'"+g.replace(/'/g,"''")+"'";case Xt:return"|"+tn(g,f.indent)+nn(bt(g,C));case Zt:return">"+tn(g,f.indent)+nn(bt(rr(g,S),C));case Le:return'"'+ir(g,S)+'"';default:throw new r("impossible error: invalid scalar style")}})()}function tn(f,g){let A=zt(f)?String(g):"",w=f[f.length-1]===`
567
+ `;return A+(w&&(f[f.length-2]===`
568
+ `||f===`
569
+ `)?"+":w?"":"-")+`
570
+ `}function nn(f){return f[f.length-1]===`
571
+ `?f.slice(0,-1):f}function rr(f,g){let A=/(\n+)([^\n]*)/g,w=(function(){let I=f.indexOf(`
572
+ `);return I=I!==-1?I:f.length,A.lastIndex=I,Ne(f.slice(0,I),g)})(),b=f[0]===`
573
+ `||f[0]===" ",C,S;for(;S=A.exec(f);){let I=S[1],P=S[2];C=P[0]===" ",w+=I+(!b&&!C&&P!==""?`
574
+ `:"")+Ne(P,g),b=C}return w}function Ne(f,g){if(f===""||f[0]===" ")return f;let A=/ [^ ]/g,w,b=0,C,S=0,I=0,P="";for(;w=A.exec(f);)I=w.index,I-b>g&&(C=S>b?S:I,P+=`
575
+ `+f.slice(b,C),b=C+1),S=I;return P+=`
576
+ `,f.length-b>g&&S>b?P+=f.slice(b,S)+`
577
+ `+f.slice(S+1):P+=f.slice(b),P.slice(1)}function ir(f){let g="",A=0;for(let w=0;w<f.length;A>=65536?w+=2:w++){A=Ie(f,w);let b=j[A];!b&&Be(A)?(g+=f[w],A>=65536&&(g+=f[w+1])):g+=b||Oe(A)}return g}function rn(f,g,A){let w="",b=f.tag;for(let C=0,S=A.length;C<S;C+=1){let I=A[C];f.replacer&&(I=f.replacer.call(A,String(C),I)),(y(f,g,I,!1,!1)||typeof I>"u"&&y(f,g,null,!1,!1))&&(w!==""&&(w+=","+(f.condenseFlow?"":" ")),w+=f.dump)}f.tag=b,f.dump="["+w+"]"}function on(f,g,A,w){let b="",C=f.tag;for(let S=0,I=A.length;S<I;S+=1){let P=A[S];f.replacer&&(P=f.replacer.call(A,String(S),P)),(y(f,g+1,P,!0,!0,!1,!0)||typeof P>"u"&&y(f,g+1,null,!0,!0,!1,!0))&&((!w||b!=="")&&(b+=nt(f,g)),f.dump&&c===f.dump.charCodeAt(0)?b+="-":b+="- ",b+=f.dump)}f.tag=C,f.dump=b||"[]"}function or(f,g,A){let w="",b=f.tag,C=Object.keys(A);for(let S=0,I=C.length;S<I;S+=1){let P="";w!==""&&(P+=", "),f.condenseFlow&&(P+='"');let M=C[S],T=A[M];f.replacer&&(T=f.replacer.call(A,M,T)),y(f,g,M,!1,!1)&&(f.dump.length>1024&&(P+="? "),P+=f.dump+(f.condenseFlow?'"':"")+":"+(f.condenseFlow?"":" "),y(f,g,T,!1,!1)&&(P+=f.dump,w+=P))}f.tag=b,f.dump="{"+w+"}"}function o(f,g,A,w){let b="",C=f.tag,S=Object.keys(A);if(f.sortKeys===!0)S.sort();else if(typeof f.sortKeys=="function")S.sort(f.sortKeys);else if(f.sortKeys)throw new r("sortKeys must be a boolean or a function");for(let I=0,P=S.length;I<P;I+=1){let M="";(!w||b!=="")&&(M+=nt(f,g));let T=S[I],H=A[T];if(f.replacer&&(H=f.replacer.call(A,T,H)),!y(f,g+1,T,!0,!0,!0))continue;let Q=f.tag!==null&&f.tag!=="?"||f.dump&&f.dump.length>1024;Q&&(f.dump&&c===f.dump.charCodeAt(0)?M+="?":M+="? "),M+=f.dump,Q&&(M+=nt(f,g)),y(f,g+1,H,!0,Q)&&(f.dump&&c===f.dump.charCodeAt(0)?M+=":":M+=": ",M+=f.dump,b+=M)}f.tag=C,f.dump=b||"{}"}function m(f,g,A){let w=A?f.explicitTypes:f.implicitTypes;for(let b=0,C=w.length;b<C;b+=1){let S=w[b];if((S.instanceOf||S.predicate)&&(!S.instanceOf||typeof g=="object"&&g instanceof S.instanceOf)&&(!S.predicate||S.predicate(g))){if(A?S.multi&&S.representName?f.tag=S.representName(g):f.tag=S.tag:f.tag="?",S.represent){let I=f.styleMap[S.tag]||S.defaultStyle,P;if(s.call(S.represent)==="[object Function]")P=S.represent(g,I);else if(a.call(S.represent,I))P=S.represent[I](g,I);else throw new r("!<"+S.tag+'> tag resolver accepts not "'+I+'" style');f.dump=P}return!0}}return!1}function y(f,g,A,w,b,C,S){f.tag=null,f.dump=A,m(f,A,!1)||m(f,A,!0);let I=s.call(f.dump),P=w;w&&(w=f.flowLevel<0||f.flowLevel>g);let M=I==="[object Object]"||I==="[object Array]",T,H;if(M&&(T=f.duplicates.indexOf(A),H=T!==-1),(f.tag!==null&&f.tag!=="?"||H||f.indent!==2&&g>0)&&(b=!1),H&&f.usedDuplicates[T])f.dump="*ref_"+T;else{if(M&&H&&!f.usedDuplicates[T]&&(f.usedDuplicates[T]=!0),I==="[object Object]")w&&Object.keys(f.dump).length!==0?(o(f,g,f.dump,b),H&&(f.dump="&ref_"+T+f.dump)):(or(f,g,f.dump),H&&(f.dump="&ref_"+T+" "+f.dump));else if(I==="[object Array]")w&&f.dump.length!==0?(f.noArrayIndent&&!S&&g>0?on(f,g-1,f.dump,b):on(f,g,f.dump,b),H&&(f.dump="&ref_"+T+f.dump)):(rn(f,g,f.dump),H&&(f.dump="&ref_"+T+" "+f.dump));else if(I==="[object String]")f.tag!=="?"&&nr(f,f.dump,g,C,P);else{if(I==="[object Undefined]")return!1;if(f.skipInvalid)return!1;throw new r("unacceptable kind of an object to dump "+I)}if(f.tag!==null&&f.tag!=="?"){let Q=encodeURI(f.tag[0]==="!"?f.tag.slice(1):f.tag).replace(/!/g,"%21");f.tag[0]==="!"?Q="!"+Q:Q.slice(0,18)==="tag:yaml.org,2002:"?Q="!!"+Q.slice(18):Q="!<"+Q+">",f.dump=Q+" "+f.dump}}return!0}function x(f,g){let A=[],w=[];_(f,A,w);let b=w.length;for(let C=0;C<b;C+=1)g.duplicates.push(A[w[C]]);g.usedDuplicates=new Array(b)}function _(f,g,A){if(f!==null&&typeof f=="object"){let w=g.indexOf(f);if(w!==-1)A.indexOf(w)===-1&&A.push(w);else if(g.push(f),Array.isArray(f))for(let b=0,C=f.length;b<C;b+=1)_(f[b],g,A);else{let b=Object.keys(f);for(let C=0,S=b.length;C<S;C+=1)_(f[b[C]],g,A)}}}function k(f,g){g=g||{};let A=new tr(g);A.noRefs||x(f,A);let w=f;return A.replacer&&(w=A.replacer.call({"":w},"",w)),y(A,0,w,!0,!0)?A.dump+`
578
+ `:""}e.exports.dump=k})),Ao=Hl(U(((n,e)=>{var t=ql(),r=jl();function i(s,a){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+a+" instead, which is now safe by default.")}}e.exports.Type=se(),e.exports.Schema=ao(),e.exports.FAILSAFE_SCHEMA=po(),e.exports.JSON_SCHEMA=vo(),e.exports.CORE_SCHEMA=_o(),e.exports.DEFAULT_SCHEMA=kr(),e.exports.load=t.load,e.exports.loadAll=t.loadAll,e.exports.dump=r.dump,e.exports.YAMLException=Ot(),e.exports.types={binary:bo(),float:go(),map:uo(),null:fo(),pairs:So(),set:Co(),timestamp:yo(),bool:ho(),int:mo(),merge:wo(),omap:xo(),seq:co(),str:lo()},e.exports.safeLoad=i("safeLoad","load"),e.exports.safeLoadAll=i("safeLoadAll","loadAll"),e.exports.safeDump=i("safeDump","dump")}))(),1),{Type:wh,Schema:bh,FAILSAFE_SCHEMA:xh,JSON_SCHEMA:Sh,CORE_SCHEMA:Ch,DEFAULT_SCHEMA:Ah,load:Eh,loadAll:kh,dump:Oh,YAMLException:Ph,types:Ih,safeLoad:Lh,safeLoadAll:Nh,safeDump:Rh}=Ao.default,Pt=Ao.default;async function Wl(n=process.cwd()){let e=re(n);for(;;){let t=re(e,"view-contracts.config.yaml");try{return await $l(t),t}catch{let r=fn(e);if(r===e)return null;e=r}}}async function qe(n){if(n)return re(n);let e=await Wl();if(!e)throw new Error("view-contracts.config.yaml not found. Pass -c <path> or run from a project directory.");return e}async function Ue(n){let e=re(n),t=await Eo(e,"utf-8"),r=Pt.load(t);return Ul(e,r)}function Ul(n,e){let t=Me(n);return{...e,openapi:re(t,e.openapi),bindings:re(t,e.bindings),microContractsConfig:re(t,e.microContractsConfig),viewsDir:re(t,e.viewsDir),generated:{contractDir:re(t,e.generated.contractDir),actions:re(t,e.generated.actions),bridge:re(t,e.generated.bridge),reactDir:re(t,e.generated.reactDir)},componentsModule:e.componentsModule?re(t,e.componentsModule):void 0,themeModule:e.themeModule?re(t,e.themeModule):void 0}}async function It(n){let e=await Eo(re(n),"utf-8");return Pt.load(e)}function ko(n,e){return re(n.generated.reactDir,`${e.screenName}.generated.tsx`)}function Me(n){return fn(re(n))}function Oo(n,e,t){let r=re(fn(t),"../components/index.ts"),i=Gl(fn(re(t)),r);return i.startsWith(".")||(i=`./${i}`),i.replace(/\.tsx?$/,".js")}import{relative as Jl}from"node:path";function Po(n,e){return Jl(n,e).split("\\").join("/")}import{resolve as Zl}from"node:path";import{readFileSync as Yl}from"node:fs";import{createRequire as Kl}from"node:module";import{dirname as Or,resolve as zl}from"node:path";import{fileURLToPath as Ql}from"node:url";var ot;function Te(){if(ot)return ot;let n=Kl(import.meta.url);try{return ot=Or(n.resolve("view-contracts/package.json")),ot}catch{let e=Or(Ql(import.meta.url));for(;;){try{let r=zl(e,"package.json");if(JSON.parse(Yl(r,"utf8")).name==="view-contracts")return ot=e,ot}catch{}let t=Or(e);if(t===e)break;e=t}throw new Error("view-contracts package root not found")}}import{readFile as Xl}from"node:fs/promises";async function Io(n){return Pt.load(await Xl(n,"utf-8"))}function Lo(n,e,t){for(let r of n)if(!e.has(r))throw new Error(`${t}: unknown element "${r}" \u2014 not in spec/ui-dsl.schema.json vocabulary`)}function No(n,e,t){for(let[r,i]of Object.entries(n))for(let s of e)if(i[s]===void 0||i[s]===null||i[s]==="")throw new Error(`${t}: element "${r}" is missing required "${String(s)}"`)}var zh=Te();var Ro="renderers/react/elements.yaml",Pr=null;function ec(n){Lo(Object.keys(n.elements),cn,Ro),No(n.elements,["tag"],Ro)}async function Mo(n){if(!n&&Pr)return Pr;let e=n??Zl(Te(),"renderers/react/elements.yaml"),t=await Io(e);return ec(t),n||(Pr=t),t}var To=new Set(["align","aspectRatio","axis","background","border","clip","contentAlign","direction","fontWeight","foreground","gap","headingLevel","height","justify","lineLimit","maxHeight","maxWidth","minHeight","minWidth","opacity","padding","radius","scroll","selfAlign","shadow","textAlign","textOverflow","textStyle","variant","weight","width","size"]);function F(n){return" ".repeat(n)}function Nt(n,e="vm"){let t=n.scope??e;return n.path?`${t}.${n.path}`:t}function dn(n,e=!1){let t=e?" as ActionDescriptor":"";if(!n.params||Object.keys(n.params).length===0)return`{ name: ${JSON.stringify(n.name)} }${t}`;let r=Object.entries(n.params).map(([i,s])=>`${i}: ${lt(s,0)}`).join(", ");return`{ name: ${JSON.stringify(n.name)}, params: { ${r} } }${t}`}function Ir(n,e,t=!1){if(n===null)return"null";if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return String(n);if(Array.isArray(n))return`[
579
+ ${n.map(r=>`${F(e+1)}${Ir(r,e+1,t)}`).join(`,
558
580
  `)}
559
- ${Q(e)}]`;if(typeof o=="object"&&o!==null){let i=o;return"kind"in i&&i.kind==="action"?Bn(i,t):`{
560
- ${Object.entries(i).map(([a,c])=>`${a}: ${Hn(c,e+1,t)}`).map(a=>`${Q(e+1)}${a}`).join(`,
581
+ ${F(e)}]`;if(typeof n=="object"&&n!==null){let r=n;return"kind"in r&&r.kind==="action"?dn(r,t):`{
582
+ ${Object.entries(r).map(([s,a])=>`${s}: ${Ir(a,e+1,t)}`).map(s=>`${F(e+1)}${s}`).join(`,
561
583
  `)}
562
- ${Q(e)}}`}return"undefined"}function Gn(o,e,t=!1){if(o===null)return"null";if(typeof o=="string")return JSON.stringify(o);if(typeof o=="number"||typeof o=="boolean")return String(o);if(Array.isArray(o))return`[
563
- ${o.map(i=>`${Q(e+1)}${Gn(i,e+1,t)}`).join(`,
584
+ ${F(e)}}`}return"undefined"}function lt(n,e,t=!1){if(n===null)return"null";if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return String(n);if(Array.isArray(n))return`[
585
+ ${n.map(r=>`${F(e+1)}${lt(r,e+1,t)}`).join(`,
564
586
  `)}
565
- ${Q(e)}]`;if(typeof o=="object"&&o!==null&&"kind"in o){if(o.kind==="binding")return De(o);if(o.kind==="action")return Bn(o,t);if(o.kind==="literal")return Hn(o.value,e,t)}return"undefined"}function Ut(o,e,t){if(o.length===0)return"";let i=t??"vm";return o.map(a=>{if(a.kind==="text"){let c=a.value;return c?`${Q(e)}{${JSON.stringify(c)}}`:""}return a.kind==="binding"?`${Q(e)}{${De(a,i)}}`:a.kind==="map"?dr(a,e):a.kind==="fragment"?Ut(a.children,e,t):qn(a,e,t)}).filter(Boolean).join(`
566
- `)}function fr(o,e){let t=e??"vm";return Object.entries(o).map(([i,r])=>i==="action"&&typeof r=="object"&&r!==null&&"kind"in r&&r.kind==="action"?`${i}={${Bn(r,!0)}}`:typeof r=="object"&&r!==null&&"kind"in r&&r.kind==="binding"?`${i}={${De(r,t)}}`:i==="children"?"":`${i}={${Gn(r,0,i==="columns")}}`).join(" ")}function dr(o,e){let t=o.item,i=qn(o.body,e+1,t);if(o.key){let r=` key={${De(o.key,t)}}`;i=i.replace(/^( +<\w+)/,`$1${r}`)}return`${Q(e)}{${De(o.source)}.map((${t}) => (
587
+ ${F(e)}]`;if(typeof n=="object"&&n!==null&&"kind"in n){if(n.kind==="binding")return Nt(n);if(n.kind==="action")return dn(n,t);if(n.kind==="literal")return Ir(n.value,e,t)}return"undefined"}function at(n,e){let t=n[e];if(t!=null){if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="object"&&"kind"in t&&t.kind==="literal")return t.value}}function $(n,e){let t=n[e];if(t!=null)return lt(t,0)}function Vo(n){let e=Object.entries(n).filter(([r])=>To.has(r));return e.length===0?"{}":`{ ${e.map(([r,i])=>`${r}: ${lt(i,0)}`).join(", ")} }`}function tc(n,e){if(!n.flex)return"";let t=["display: 'flex'",`flexDirection: '${n.flex==="column"?"column":"row"}'`];return e.align&&t.push(`alignItems: mapAlign(${$(e,"align")})`),e.justify&&t.push(`justifyContent: mapJustify(${$(e,"justify")})`),`, ${t.join(", ")}`}function Lr(n,e){let t=Vo(e),r=tc(n,e);if(n.flexGrowProp&&e[n.flexGrowProp]){let i=$(e,n.flexGrowProp);return`style={{ ...commonStyle(${t})${r}, flexGrow: ${i} ?? 1 }}`}return r?`style={{ ...commonStyle(${t})${r} }}`:`style={commonStyle(${t})}`}function nc(n,e){let t=n.action??n[e==="onClick"?"onClick":"onSubmit"];if(!t||typeof t!="object"||!("kind"in t)||t.kind!=="action")return;let r=dn(t,!0);return e==="onSubmit"?`onSubmit={(e) => { e.preventDefault(); void dispatchAction(${r}); }}`:`onClick={() => { void dispatchAction(${r}); }}`}function Nr(n,e,t){let r=n.className??"";if(n.tag==="dynamic-heading"&&t!==void 0)return`className="ui-heading ui-heading-${t}"`;if(n.variantClass){let i=at(e,"variant");if(typeof i=="string")return`className="${r} ui-button-${i}"`;let s=$(e,"variant");return s?`className={\`${r} ui-button-\${${s} ?? 'secondary'}\`}`:`className="${r} ui-button-secondary"`}if(n.wrapProp&&at(e,n.wrapProp)===!0)return`className="${r} ui-wrap"`;if(n.sizeClass&&e.size){let i=$(e,"size");return`className={\`${n.className} ${n.sizeClass}-\${${i} ?? 'md'}\`}`}return`className="${r}"`}function rc(n,e,t){let r=at(e,"label"),i=at(e,"help"),s=at(e,"error"),a=$(e,"label"),l=$(e,"help"),p=$(e,"error"),c=[`${F(t)}<label className="ui-field">`];return typeof r=="string"?c.push(`${F(t+1)}<span className="ui-field-label">{${JSON.stringify(r)}}</span>`):a&&c.push(`${F(t+1)}{${a} ? <span className="ui-field-label">{${a}}</span> : null}`),c.push(`${F(t+1)}${n}`),typeof i=="string"?c.push(`${F(t+1)}<span className="ui-field-help">{${JSON.stringify(i)}}</span>`):l&&c.push(`${F(t+1)}{${l} ? <span className="ui-field-help">{${l}}</span> : null}`),typeof s=="string"?c.push(`${F(t+1)}<span className="ui-field-error">{${JSON.stringify(s)}}</span>`):p&&c.push(`${F(t+1)}{${p} ? <span className="ui-field-error">{${p}}</span> : null}`),c.push(`${F(t)}</label>`),c.join(`
588
+ `)}function ic(n,e){let t=$(n,"name")??'""',r=$(n,"label")??'""',i=n.checked?`defaultChecked={${$(n,"checked")}}`:"",s=n.enabled?`disabled={${$(n,"enabled")} === false}`:"";return`${F(e)}<label className="ui-check">
589
+ ${F(e+1)}<input type="checkbox" name={${t}} ${i} ${s} />
590
+ ${F(e+1)}<span>{${r}}</span>
591
+ ${F(e)}</label>`}function Do(n,e){let t=n.options;if(!t||typeof t!="object"||!("kind"in t))return"";if(t.kind==="literal"&&Array.isArray(t.value))return t.value.map(s=>`${F(e+1)}<option key={${JSON.stringify(s.value)}} value={${JSON.stringify(s.value)}}>{${JSON.stringify(s.label)}}</option>`).join(`
592
+ `);let r=lt(t,0);return`${F(e+1)}{${r}.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}`}function oc(n,e,t){let r=[Nr(n,e),Lr(n,e)];return e.name&&r.push(`name={${$(e,"name")}}`),e.placeholder&&r.push(`placeholder={${$(e,"placeholder")}}`),n.inputType&&r.push(`type={${$(e,"type")??JSON.stringify(n.inputType)}}`),e.required&&r.push(`required={${$(e,"required")}}`),e.readonly&&r.push(`readOnly={${$(e,"readonly")}}`),e.enabled&&r.push(`disabled={${$(e,"enabled")} === false}`),e.rows&&r.push(`rows={${$(e,"rows")??"4"}`),`${F(t)}<${n.tag} ${r.join(" ")} />`}function hn(n,e,t,r){let i=[];if(n.ariaHidden&&i.push("aria-hidden"),e.id&&i.push(`id={${$(e,"id")}}`),e.role?i.push(`role={${$(e,"role")}}`):n.defaultRole&&i.push(`role="${n.defaultRole}"`),n.ariaLabel&&(e.ariaLabel?i.push(`aria-label={${$(e,"ariaLabel")}}`):e.label?i.push(`aria-label={${$(e,"label")}}`):e.title&&i.push(`aria-label={${$(e,"title")}}`)),n.actionEvent){let s=nc(e,n.actionEvent);s&&i.push(s)}return n.tag==="button"&&e.enabled&&i.push(`disabled={${$(e,"enabled")} === false}`),n.tag==="a"&&e.href&&i.push(`href={${$(e,"href")}}`),n.tag==="button"&&i.push(`type={${$(e,"type")??'"button"'}}`),i.push(Nr(n,e,r)),i.push(Lr(n,e)),`<${t} ${i.join(" ")}`}function st(n,e,t){if(e.visible===void 0)return n;let r=$(e,"visible");return`${F(t)}{${r} !== false ? (
593
+ ${n}
594
+ ${F(t)}) : null}`}function Rr(n,e,t,r){if(n.length===0)return"";let i=r??"vm";return n.map(a=>{if(a.kind==="text"){let l=a.value;return l?`${F(e)}{${JSON.stringify(l)}}`:""}return a.kind==="binding"?`${F(e)}{${Nt(a,i)}}`:a.kind==="map"?sc(a,e,t):a.kind==="fragment"?Rr(a.children,e,t,r):a.kind==="component"?t(a,e,r):""}).filter(Boolean).join(`
595
+ `)}function sc(n,e,t){let r=n.item,i=t(n.body,e+1,r);if(n.key){let s=` key={${Nt(n.key,r)}}`;i=i.replace(/^( +)<(\w+)/,`$1<$2${s}`)}return`${F(e)}{${Nt(n.source)}.map((${r}) => (
567
596
  ${i}
568
- ${Q(e)}))}`}function qn(o,e,t){let i=fr(o.props,t),r=i?` ${i}`:"",a=Ut(o.children,e+1,t);return a?`${Q(e)}<${o.name}${r}>
597
+ ${F(e)}))}`}function ac(n,e,t,r,i){let s=n.props,a=Rr(n.children,t+1,i,r);if(e.checkbox)return st(ic(s,t),s,t);if(e.fieldWrap){let h=e.tag,u;if(e.optionsProp&&s[e.optionsProp]){let d=hn(e,s,h);u=`${F(t+1)}${d}>
598
+ ${Do(s,t+2)}
599
+ ${F(t+1)}</${h}>`}else u=oc(e,s,t+1);return st(rc(u,s,t),s,t)}if(e.tag==="dynamic-heading"){let h=at(s,"level");if(typeof h=="number"){let v=Math.min(6,Math.max(1,h)),E=`h${v}`,R=hn(e,s,E,v),Y=a?`${F(t)}${R}>
600
+ ${a}
601
+ ${F(t)}</${E}>`:`${F(t)}${R} />`;return st(Y,s,t)}let u=$(s,"level")??"2",d=a?`${F(t+1)}{(() => { const __level = Math.min(6, Math.max(1, ${u} ?? 2)); const Tag = ('h' + __level) as keyof JSX.IntrinsicElements; return <Tag className={\`ui-heading ui-heading-\${__level}\`} style={commonStyle(${Vo(s)})}>{/* children below */}</Tag>; })()}`:"";return st(d||`${F(t)}<h2 ${Nr(e,s,2)} ${Lr(e,s)} />`,s,t)}let l=e.tag;if(e.void)return st(`${F(t)}${hn(e,s,l)} />`,s,t);let p=hn(e,s,l),c;return!a&&e.optionsProp&&s[e.optionsProp]?c=`${F(t)}${p}>
602
+ ${Do(s,t+1)}
603
+ ${F(t)}</${l}>`:a?c=`${F(t)}${p}>
569
604
  ${a}
570
- ${Q(e)}</${o.name}>`:`${Q(e)}<${o.name}${r} />`}function sn(o,e){if(o.kind==="component"){e.add(o.name);for(let t of o.children)sn(t,e);return}if(o.kind==="map"&&sn(o.body,e),o.kind==="fragment")for(let t of o.children)sn(t,e)}function mr(o){let e=new Set;return sn(o.root,e),[...e].sort().join(", ")}function hr(o,e){let t=o.exportName.replace(/View$/,"")||o.exportName,i=t.charAt(0).toUpperCase()+t.slice(1),r=o.root.kind==="component"?o.root:null;if(!r)throw new Error(`View IR root must be a component node (${o.source})`);let a=qn(r,2),c=mr(o);return`/**
571
- * Auto-generated React component from ${o.source}
605
+ ${F(t)}</${l}>`:c=`${F(t)}${p} />`,st(c,s,t)}function lc(n,e){let t=e??"vm";return Object.entries(n).map(([r,i])=>r==="action"&&typeof i=="object"&&i!==null&&"kind"in i&&i.kind==="action"?`${r}={${dn(i,!0)}}`:typeof i=="object"&&i!==null&&"kind"in i&&i.kind==="binding"?`${r}={${Nt(i,t)}}`:r==="children"?"":`${r}={${lt(i,0,r==="columns")}}`).join(" ")}function cc(n,e,t,r){let i=lc(n.props,t),s=i?` ${i}`:"",a=Rr(n.children,e+1,r,t);return a?`${F(e)}<${n.name}${s}>
606
+ ${a}
607
+ ${F(e)}</${n.name}>`:`${F(e)}<${n.name}${s} />`}function Fo(n,e,t){return n in e.elements&&!t.includes(n)}function Lt(n,e,t,r){if(n.kind==="component"){Fo(n.name,e,t)||r.add(n.name);for(let i of n.children)Lt(i,e,t,r);return}if(n.kind==="map"&&Lt(n.body,e,t,r),n.kind==="fragment")for(let i of n.children)Lt(i,e,t,r)}function Ho(n,e){let t=(r,i,s)=>Fo(r.name,n,e)?ac(r,n.elements[r.name],i,s,t):cc(r,i,s,t);return t}async function uc(n,e){let t=await Mo(e.elementMapPath),r=e.allowlistExtra??[],i=n.exportName.replace(/View$/,"")||n.exportName,s=i.charAt(0).toUpperCase()+i.slice(1),a=n.root.kind==="component"?n.root:null;if(!a)throw new Error(`View IR root must be a component node (${n.source})`);let p=Ho(t,r)(a,2),c=new Set;Lt(n.root,t,r,c);let h=[...c].sort(),u=["import type { ReactElement } from 'react';","import { dispatchAction } from '../runtime/dispatch.js';","import { commonStyle, mapAlign, mapJustify } from '../components/style-helpers.js';",`import type { ${n.viewModel}, ActionDescriptor } from '../contracts';`];return h.length>0&&u.push(`import { ${h.join(", ")} } from '${e.componentsImportFrom}';`),`/**
608
+ * Auto-generated React component from ${n.source}
572
609
  * DO NOT EDIT \u2014 regenerate with: view-contracts render react
573
610
  */
574
- import type { ReactElement } from 'react';
575
- import {
576
- ${c},
577
- } from '${e.componentsImportFrom}';
578
- import type { ${o.viewModel}, ActionDescriptor } from '../contracts';
611
+ ${u.join(`
612
+ `)}
579
613
 
580
- export function ${i}({ vm }: { vm: ${o.viewModel} }): ReactElement {
614
+ export function ${s}({ vm }: { vm: ${n.viewModel} }): ReactElement {
581
615
  return (
582
- ${a}
616
+ ${p}
583
617
  );
584
618
  }
585
- `}async function Jt(o,e,t){let{writeFile:i,mkdir:r}=await import("node:fs/promises"),{dirname:a}=await import("node:path"),c=hr(o,t);await r(a(e),{recursive:!0}),await i(e,c,"utf-8")}import{cp as br,readFile as me,writeFile as Z,mkdir as Zt,stat as Or}from"node:fs/promises";import{resolve as V}from"node:path";import{readFile as Yt}from"node:fs/promises";import{createRequire as gr}from"node:module";import{dirname as wr,resolve as zt}from"node:path";var Kt=/^@import\s+['"](.+?)['"]\s*;/gm,xr=gr(import.meta.url);async function yr(o,e){return o.startsWith("@")||!o.startsWith(".")&&!o.startsWith("/")?xr.resolve(o):zt(e,o)}async function Xt(o){let e=zt(o),t=await Yt(e,"utf-8"),i=wr(e);for(let r of t.matchAll(Kt)){let a=r[0],c=r[1];if(!c)continue;let l=await yr(c,i),p=await Yt(l,"utf-8");t=t.replace(a,`${p}
586
- `)}return t.replace(Kt,"").trim()}import{readFileSync as _r}from"node:fs";import{createRequire as vr}from"node:module";import{dirname as Wn,resolve as Cr}from"node:path";import{fileURLToPath as Ar}from"node:url";var Ae;function Qt(){if(Ae)return Ae;let o=vr(import.meta.url);try{return Ae=Wn(o.resolve("view-contracts/package.json")),Ae}catch{let e=Wn(Ar(import.meta.url));for(;;){try{let i=Cr(e,"package.json");if(JSON.parse(_r(i,"utf8")).name==="view-contracts")return Ae=e,Ae}catch{}let t=Wn(e);if(t===e)break;e=t}throw new Error("view-contracts package root not found")}}var ei=Qt(),Er=`/** Auto-generated component barrel \u2014 DO NOT EDIT */
587
- export * from './core.js';
588
- export * from './extensions.js';
589
- export type { TableColumn } from './extensions.js';
590
- `,Sr=`/** Auto-generated component primitives \u2014 DO NOT EDIT */
591
- export * from './ui-components.js';
592
- export { commonStyle, isHidden, toneClass } from './style.js';
593
- export type { Action, CommonProps, Option } from './types.js';
594
- `,Ir=`/** Auto-generated action wiring \u2014 DO NOT EDIT */
595
- import type { DispatchableAction } from '../runtime/types.js';
596
- import { dispatchAction } from '../runtime/dispatch.js';
597
-
598
- export async function dispatchPreviewAction(action?: DispatchableAction): Promise<void> {
599
- if (!action) return;
600
- await dispatchAction(action);
601
- }
602
- `,Tr=`/** Auto-generated runtime dispatcher \u2014 DO NOT EDIT */
603
- import type { DispatchableAction } from './types.js';
604
-
605
- type ActionHandler = (action: DispatchableAction) => void | Promise<void>;
606
-
607
- let handler: ActionHandler | undefined;
608
-
609
- export function registerActionHandler(nextHandler: ActionHandler): void {
610
- handler = nextHandler;
611
- }
612
-
613
- export async function dispatchAction(action: DispatchableAction): Promise<void> {
614
- if (handler) {
615
- await handler(action);
616
- return;
617
- }
618
- if (action.name === 'navigate' && typeof action.params?.to === 'string') {
619
- window.location.href = action.params.to;
620
- return;
621
- }
622
- window.dispatchEvent(new CustomEvent('view-contracts:action', { detail: action }));
623
- }
624
- `,kr=`/** Auto-generated \u2014 DO NOT EDIT */
625
- export interface DispatchableAction {
626
- name: string;
627
- params?: Record<string, unknown>;
628
- }
629
- `;function ni(){return V(ei,"src/renderer/react/runtime")}function Pr(){return V(ei,"src/generated/schema")}async function an(o){try{return await Or(o),!0}catch{return!1}}function Fe(o){return o.replaceAll("../../../generated/schema/","./schema/").replace(/import type { ViewAction } from '@view-contracts\/core';\n/,`export interface ViewAction { name: string; params?: Record<string, unknown> }
630
- `).replace(/import type { ViewAction } from '@view-contracts\/core'/,"export interface ViewAction { name: string; params?: Record<string, unknown> }")}async function Nr(o){let e=ni(),t=Pr();if(await an(t)){let c=V(o,"schema");await br(t,c,{recursive:!0});for(let l of["dsl-properties.ts","tokens.ts","schema-document.ts","index.ts"]){let p=V(c,l);await an(p)&&await Z(p,Fe(await me(p,"utf-8")),"utf-8")}}let i=Fe(await me(V(e,"components.tsx"),"utf-8"));await Z(V(o,"ui-components.tsx"),i,"utf-8");let r=Fe(await me(V(e,"style.ts"),"utf-8"));await Z(V(o,"style.ts"),r,"utf-8");let a=Fe(await me(V(e,"types.ts"),"utf-8"));if(await Z(V(o,"types.ts"),a,"utf-8"),await an(V(e,"shared.tsx"))){let c=Fe(await me(V(e,"shared.tsx"),"utf-8"));await Z(V(o,"shared.tsx"),c,"utf-8")}await Z(V(o,"actionRuntime.ts"),Ir,"utf-8"),await Z(V(o,"core.ts"),Sr,"utf-8")}async function Rr(o,e){let t=V(ni(),"theme.css"),i=await Xt(t),r=V(o,"src/theme.extensions.css");await an(r)&&(i+=`
631
-
632
- ${await me(r,"utf-8")}`),await Z(e,`/** Auto-generated theme \u2014 DO NOT EDIT */
633
- ${i}
634
- `,"utf-8")}async function ti(o,e){let t=ue(o),i=V(e.generated.reactDir,"../components"),r=V(e.generated.reactDir,"../runtime"),a=V(t,"src/components");await Zt(i,{recursive:!0}),await Zt(r,{recursive:!0}),await Nr(i);for(let m of["extensions.tsx","sample-types.ts"]){let h=V(a,m),u=V(i,m);await Z(u,await me(h,"utf-8"),"utf-8")}let c=V(t,"src/runtime/handlers.ts"),p=`/** Auto-generated from src/runtime/handlers.ts \u2014 DO NOT EDIT */
635
- import type { DispatchableAction } from './types.js';
619
+ `}async function Bo(n,e,t){let{writeFile:r,mkdir:i}=await import("node:fs/promises"),{dirname:s}=await import("node:path"),a=await uc(n,t);await i(s(e),{recursive:!0}),await r(e,a,"utf-8")}import{readFile as yt,writeFile as Ae,mkdir as Fa,stat as cf,cp as uf,unlink as pf}from"node:fs/promises";import{resolve as z}from"node:path";import{readFile as qo}from"node:fs/promises";import{createRequire as pc}from"node:module";import{dirname as fc,resolve as $o}from"node:path";var jo=/^@import\s+['"](.+?)['"]\s*;/gm,hc=pc(import.meta.url);async function dc(n,e){return n.startsWith("@")||!n.startsWith(".")&&!n.startsWith("/")?hc.resolve(n):$o(e,n)}async function Go(n){let e=$o(n),t=await qo(e,"utf-8"),r=fc(e);for(let i of t.matchAll(jo)){let s=i[0],a=i[1];if(!a)continue;let l=await dc(a,r),p=await qo(l,"utf-8");t=t.replace(s,`${p}
620
+ `)}return t.replace(jo,"").trim()}var Da=Ri(Ma(),1);import{readFile as af}from"node:fs/promises";import{resolve as lf}from"node:path";var Ta=new Map;async function Ze(n,e,t){let r=lf(n,e),i=Ta.get(r);if(!i){let s=await af(r,"utf-8");i=Da.default.compile(s,{noEscape:!0}),Ta.set(r,i)}return i(t)}import{resolve as Va}from"node:path";function Ei(n){return n??Va(Te(),"renderers/react/templates")}function ki(){return Va(Te(),"renderers/react/runtime")}var ff=Te();function hf(){return z(ff,"src/generated/schema")}async function Xn(n){try{return await cf(n),!0}catch{return!1}}function Oi(n){return n.split("../../../src/generated/schema/").join("./schema/")}async function df(n){let e=hf();if(!await Xn(e))return;let t=z(n,"schema");await uf(e,t,{recursive:!0});for(let r of["dsl-properties.ts","tokens.ts","schema-document.ts","index.ts"]){let i=z(t,r);await Xn(i)&&await Ae(i,Oi(await yt(i,"utf-8")),"utf-8")}}async function mf(n){let e=ki(),t=Oi(await yt(z(e,"style.ts"),"utf-8"));await Ae(z(n,"style.ts"),t,"utf-8");let r=Oi(await yt(z(e,"types.ts"),"utf-8"));await Ae(z(n,"types.ts"),r,"utf-8")}async function gf(n,e,t){let r=z(ki(),"theme.css"),i=await Go(r),s=z(n,"src/theme.extensions.css");await Xn(s)&&(i+=`
636
621
 
637
- ${(await me(c,"utf-8")).replace(/export async function handleAppAction\(action:\s*\{[\s\S]*?\}\)/,"export async function handleAppAction(action: DispatchableAction)")}`;await Z(V(r,"handlers.ts"),p,"utf-8"),await Z(V(i,"index.ts"),Er,"utf-8"),await Rr(t,V(e.generated.reactDir,"../theme.css")),await Z(V(r,"types.ts"),kr,"utf-8"),await Z(V(r,"dispatch.ts"),Tr,"utf-8"),console.log(` components \u2192 ${i}`),console.log(` theme \u2192 ${V(e.generated.reactDir,"../theme.css")}`)}import{access as $r,writeFile as ee,mkdir as cn}from"node:fs/promises";import{resolve as z,dirname as ii}from"node:path";async function Un(o){try{return await $r(o),!0}catch{return!1}}var be={preview:5173,app:5174,built:4174},ri=`{
622
+ ${await yt(s,"utf-8")}`);let a=await Ze(Ei(t),"theme.css.hbs",{themeCss:i});await Ae(e,a,"utf-8")}async function vf(n){for(let e of["ui-components.tsx","core.ts","actionRuntime.ts","shared.tsx","shared.ts"]){let t=z(n,e);await Xn(t)&&await pf(t)}}async function Ha(n,e){let t=Me(n),r=e.rendererTemplatesDir?z(t,e.rendererTemplatesDir):void 0,i=Ei(r),s=z(e.generated.reactDir,"../components"),a=z(e.generated.reactDir,"../runtime"),l=z(t,"src/components");await Fa(s,{recursive:!0}),await Fa(a,{recursive:!0}),await vf(s),await df(s),await mf(s),await Ae(z(s,"style-helpers.ts"),await Ze(i,"style-helpers.ts.hbs",{}),"utf-8"),await Ae(z(s,"index.ts"),await Ze(i,"components-index.ts.hbs",{}),"utf-8");for(let h of["extensions.tsx","sample-types.ts"]){let u=z(l,h),d=await yt(u,"utf-8");h==="sample-types.ts"&&(d=d.replace("from './core.js'","from './types.js'")),await Ae(z(s,h),d,"utf-8")}let p=z(t,"src/runtime/handlers.ts"),c=(await yt(p,"utf-8")).replace(/export async function handleAppAction\(action:\s*\{[\s\S]*?\}\)/,"export async function handleAppAction(action: DispatchableAction)");await Ae(z(a,"handlers.ts"),await Ze(i,"handlers.ts.hbs",{handlersBody:c}),"utf-8"),await gf(t,z(e.generated.reactDir,"../theme.css"),r),await Ae(z(a,"types.ts"),await Ze(i,"runtime-types.ts.hbs",{}),"utf-8"),await Ae(z(a,"dispatch.ts"),await Ze(i,"dispatch.ts.hbs",{}),"utf-8"),console.log(` components \u2192 ${s}`),console.log(` theme \u2192 ${z(e.generated.reactDir,"../theme.css")}`)}import{access as _f,writeFile as me,mkdir as Zn}from"node:fs/promises";import{resolve as ce,dirname as Ba}from"node:path";async function Pi(n){try{return await _f(n),!0}catch{return!1}}var wt={preview:5173,app:5174,built:4174},qa=`{
638
623
  "name": "admin-dashboard",
639
624
  "private": true,
640
625
  "type": "module",
@@ -661,8 +646,8 @@ ${(await me(c,"utf-8")).replace(/export async function handleAppAction\(action:\
661
646
  "vite": "^6.4.1"
662
647
  }
663
648
  }
664
- `,Lr=`import '../src/main.tsx';
665
- `,Mr=`<!doctype html>
649
+ `,yf=`import '../src/main.tsx';
650
+ `,wf=`<!doctype html>
666
651
  <html lang="en">
667
652
  <head>
668
653
  <meta charset="UTF-8" />
@@ -674,7 +659,7 @@ ${(await me(c,"utf-8")).replace(/export async function handleAppAction\(action:\
674
659
  <script type="module" src="./app-main.tsx"></script>
675
660
  </body>
676
661
  </html>
677
- `,Vr=`<!doctype html>
662
+ `,bf=`<!doctype html>
678
663
  <html lang="en">
679
664
  <head>
680
665
  <meta charset="UTF-8" />
@@ -686,16 +671,26 @@ ${(await me(c,"utf-8")).replace(/export async function handleAppAction\(action:\
686
671
  <script type="module" src="/.vite/preview-main.tsx"></script>
687
672
  </body>
688
673
  </html>
689
- `,Dr=`import '../src/theme.extensions.css';
674
+ `,xf=`import '../src/theme.extensions.css';
690
675
  import '../views/preview.entry.tsx';
691
- `,Fr=`/** Auto-generated preview component barrel \u2014 DO NOT EDIT */
692
- export * from '../../../src/renderer/react/runtime/index.js';
676
+ `,Sf=`/** Auto-generated preview component barrel \u2014 DO NOT EDIT */
677
+ export * from '../../../src/generated/preview/vocabulary.js';
678
+ export {
679
+ commonStyle,
680
+ isHidden,
681
+ toneClass,
682
+ mapAlign,
683
+ mapJustify,
684
+ registerPreviewActions,
685
+ clearPreviewActions,
686
+ dispatchPreviewAction,
687
+ } from '../../../renderers/react/runtime/index.js';
693
688
  export * from '../src/components/extensions.js';
694
- `;function jr(o){let t=o.views.filter(a=>a.targets.includes("react"))[0];if(!t)throw new Error("No react target views in bindings \u2014 cannot scaffold app entry.");let i=t.screenName,r=`${i.charAt(0).toLowerCase()}${i.slice(1)}Mock`;return`import React from 'react';
689
+ `;function Cf(n){let t=n.views.filter(s=>s.targets.includes("react"))[0];if(!t)throw new Error("No react target views in bindings \u2014 cannot scaffold app entry.");let r=t.screenName,i=`${r.charAt(0).toLowerCase()}${r.slice(1)}Mock`;return`import React from 'react';
695
690
  import ReactDOM from 'react-dom/client';
696
691
  import '../generated/theme.css';
697
- import { ${i} } from '../generated/react/${i}.generated';
698
- import { ${r} } from '../generated/mock';
692
+ import { ${r} } from '../generated/react/${r}.generated';
693
+ import { ${i} } from '../generated/mock';
699
694
  import { registerActionHandler } from '../generated/runtime/dispatch';
700
695
  import { handleAppAction } from '../generated/runtime/handlers';
701
696
 
@@ -703,24 +698,24 @@ registerActionHandler(handleAppAction);
703
698
 
704
699
  ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
705
700
  <React.StrictMode>
706
- <${i} vm={${r}} />
701
+ <${r} vm={${i}} />
707
702
  </React.StrictMode>,
708
703
  );
709
- `}var Hr=`/** Hand-written action handlers \u2014 edit src/runtime/handlers.ts */
704
+ `}var Af=`/** Hand-written action handlers \u2014 edit src/runtime/handlers.ts */
710
705
  import type { DispatchableAction } from './types.js';
711
706
 
712
707
  export async function handleAppAction(action: DispatchableAction): Promise<void> {
713
708
  console.log('[app action]', action);
714
709
  }
715
- `;function Br(){return`/** Fixed dev server ports \u2014 single source of truth for this example. */
716
- export const PREVIEW_PORT = ${be.preview};
717
- export const APP_PORT = ${be.app};
718
- export const BUILT_PORT = ${be.built};
719
- `}function Gr(){return`# Fixed dev server ports \u2014 keep in sync with dev.ports.ts
720
- PREVIEW_PORT=${be.preview}
721
- APP_PORT=${be.app}
722
- BUILT_PORT=${be.built}
723
- `}function qr(){return`import { defineConfig } from 'vite';
710
+ `;function Ef(){return`/** Fixed dev server ports \u2014 single source of truth for this example. */
711
+ export const PREVIEW_PORT = ${wt.preview};
712
+ export const APP_PORT = ${wt.app};
713
+ export const BUILT_PORT = ${wt.built};
714
+ `}function kf(){return`# Fixed dev server ports \u2014 keep in sync with dev.ports.ts
715
+ PREVIEW_PORT=${wt.preview}
716
+ APP_PORT=${wt.app}
717
+ BUILT_PORT=${wt.built}
718
+ `}function Of(){return`import { defineConfig } from 'vite';
724
719
  import react from '@vitejs/plugin-react';
725
720
  import path from 'node:path';
726
721
  import { fileURLToPath } from 'node:url';
@@ -752,7 +747,7 @@ export default defineConfig({
752
747
  },
753
748
  },
754
749
  });
755
- `}function Wr(){return`import path from 'node:path';
750
+ `}function Pf(){return`import path from 'node:path';
756
751
  import { defineConfig } from 'vite';
757
752
  import react from '@vitejs/plugin-react';
758
753
  import { fileURLToPath } from 'node:url';
@@ -775,7 +770,7 @@ export default defineConfig({
775
770
  { find: '@view-contracts/core', replacement: path.join(repoRoot, 'packages/core/src/index.ts') },
776
771
  { find: '@view-contracts/runtime', replacement: path.join(repoRoot, 'packages/runtime/src/index.ts') },
777
772
  { find: '@view-contracts/components', replacement: path.join(viteDir, 'preview-components.ts') },
778
- { find: '@view-contracts/theme', replacement: path.join(repoRoot, 'src/renderer/react/runtime/theme.css') },
773
+ { find: '@view-contracts/theme', replacement: path.join(repoRoot, 'renderers/react/runtime/theme.css') },
779
774
  { find: '@view-contracts/preview', replacement: path.join(repoRoot, 'src/preview/index.ts') },
780
775
  ],
781
776
  },
@@ -796,10 +791,10 @@ export default defineConfig({
796
791
  },
797
792
  },
798
793
  });
799
- `}async function oi(o,e,t){let i=ue(o),r=z(i,".vite");await cn(r,{recursive:!0});let a=z(i,"package.json");await Un(a)?await ee(a,`${ri}
800
- `,"utf-8"):await ee(a,`${ri}
801
- `,"utf-8"),await ee(z(r,"index.html"),Mr,"utf-8"),await ee(z(r,"preview.html"),Vr,"utf-8"),await ee(z(r,"preview-main.tsx"),Dr,"utf-8"),await ee(z(r,"app-main.tsx"),Lr,"utf-8"),await ee(z(r,"preview-components.ts"),Fr,"utf-8"),await ee(z(r,"vite.config.ts"),qr(),"utf-8"),await ee(z(r,"vite.preview.config.ts"),Wr(),"utf-8"),await ee(z(i,"dev.ports.ts"),Br(),"utf-8");let c=z(i,"scripts");await cn(c,{recursive:!0}),await ee(z(c,"ports.sh"),Gr(),"utf-8");let l=z(i,"src/main.tsx");await Un(l)||(await cn(ii(l),{recursive:!0}),await ee(l,jr(t),"utf-8"));let p=z(i,"src/runtime/handlers.ts");await Un(p)||(await cn(ii(p),{recursive:!0}),await ee(p,Hr,"utf-8")),console.log(` scaffold \u2192 ${r}/`)}async function si(o){await new Promise((e,t)=>{let i=ui("npx",["micro-contracts",...o],{stdio:"inherit"});i.on("error",t),i.on("close",r=>{r===0?e():t(new Error(`micro-contracts exited with code ${r}`))})})}async function Kr(o){await new Promise((e,t)=>{let i=ui("npx",["tsx",...o],{stdio:"inherit"});i.on("error",t),i.on("close",r=>{r===0?e():t(new Error(`catalog build exited with code ${r}`))})})}async function Jn(o){let e=await we(o),t=await Ve(e.bindings),i=ue(o),r=await Ct(t.views.map(a=>({sourcePath:xe(i,a.source),exportName:a.exportName,screenName:a.screenName})),{allowlistExtra:e.allowlistExtra});return new Map(t.views.map((a,c)=>[a.screenName,r[c]]))}async function ai(o,e){let t=await we(o),i=await Ve(t.bindings);for(let r of i.views){if(!r.targets.includes("react"))continue;let a=e.get(r.screenName);if(!a)throw new Error(`Missing View IR for ${r.screenName}`);let c=Gt(t,r),l=qt(o,t,c);await Jt(a,c,{componentsImportFrom:l}),console.log(` ${r.exportName} \u2192 ${c}`)}}async function ci(o){let e=await we(o),t=await Ve(e.bindings),i=ue(o),a=["// Auto-generated view bridge registry \u2014 DO NOT EDIT",`// Generated from ${Wt(i,e.bindings)}`,"","export const viewBridgeRegistry = {"];for(let c of t.views)a.push(` ${c.screenConst}: {`),a.push(` id: ${JSON.stringify(c.id)},`),a.push(` screenId: ${JSON.stringify(c.screenId)},`),a.push(` screenName: ${JSON.stringify(c.screenName)},`),a.push(` route: ${JSON.stringify(c.route)},`),a.push(` operationId: ${JSON.stringify(c.operationId)},`),a.push(` viewModel: ${JSON.stringify(c.viewModel)},`),a.push(` source: ${JSON.stringify(c.source)},`),a.push(` targets: ${JSON.stringify(c.targets)},`),a.push(" },");a.push("} as const;",""),a.push("export type ViewBridgeKey = keyof typeof viewBridgeRegistry;",""),await Jr(li(xe(e.generated.bridge)),{recursive:!0}),await Ur(xe(e.generated.bridge),a.join(`
802
- `),"utf-8"),console.log(`Bridge registry \u2192 ${e.generated.bridge} (${t.views.length} view(s))`)}var pi={compile:async(o,e)=>{let t=await Jn(await de(o.config));console.log(`Compiled ${t.size} view(s) to View IR (in-memory)`)},renderReact:async(o,e)=>{let t=await de(o.config),i=await Jn(t);await ai(t,i)},renderBridge:async(o,e)=>{await ci(await de(o.config))},build:async(o,e)=>{let t=await de(o.config),i=await we(t),r=await Ve(i.bindings),a=await Jn(t);console.log(`Compiled ${a.size} view(s) to View IR (in-memory)`),await ti(t,i),await ai(t,a),await ci(t),await oi(t,i,r)},contractsGenerate:async(o,e)=>{let t=await we(await de(o.config));await si(["generate","-c",t.microContractsConfig]),console.log("Contracts generated via micro-contracts")},contractsCheck:async(o,e)=>{let t=await we(await de(o.config));await si(["lint","-c",t.microContractsConfig])},catalogBuild:async(o,e)=>{let t=await de(o.config),i=ue(t),r=o.output?xe(String(o.output)):xe(i,"dist/catalog.html"),a=xe(i,"tsconfig.catalog.json"),{existsSync:c}=await import("node:fs");if(!c(a))throw new Error(`Missing ${a}. Add tsconfig.catalog.json with @view-contracts/components paths for catalog SSR.`);let l=xe(li(Yr(import.meta.url)),"../catalog/run.ts");await Kr(["--tsconfig",a,l,r,t]),console.log(`Catalog \u2192 ${r}`)}};var zr={version:"0.1.0"};ft(pi,zr.version).parseAsync(process.argv).catch(o=>{console.error(o instanceof Error?o.message:o),process.exit(1)});
794
+ `}async function ja(n,e,t){let r=Me(n),i=ce(r,".vite");await Zn(i,{recursive:!0});let s=ce(r,"package.json");await Pi(s)?await me(s,`${qa}
795
+ `,"utf-8"):await me(s,`${qa}
796
+ `,"utf-8"),await me(ce(i,"index.html"),wf,"utf-8"),await me(ce(i,"preview.html"),bf,"utf-8"),await me(ce(i,"preview-main.tsx"),xf,"utf-8"),await me(ce(i,"app-main.tsx"),yf,"utf-8"),await me(ce(i,"preview-components.ts"),Sf,"utf-8"),await me(ce(i,"vite.config.ts"),Of(),"utf-8"),await me(ce(i,"vite.preview.config.ts"),Pf(),"utf-8"),await me(ce(r,"dev.ports.ts"),Ef(),"utf-8");let a=ce(r,"scripts");await Zn(a,{recursive:!0}),await me(ce(a,"ports.sh"),kf(),"utf-8");let l=ce(r,"src/main.tsx");await Pi(l)||(await Zn(Ba(l),{recursive:!0}),await me(l,Cf(t),"utf-8"));let p=ce(r,"src/runtime/handlers.ts");await Pi(p)||(await Zn(Ba(p),{recursive:!0}),await me(p,Af,"utf-8")),console.log(` scaffold \u2192 ${i}/`)}async function $a(n){await new Promise((e,t)=>{let r=Ja("npx",["micro-contracts",...n],{stdio:"inherit"});r.on("error",t),r.on("close",i=>{i===0?e():t(new Error(`micro-contracts exited with code ${i}`))})})}async function Rf(n){await new Promise((e,t)=>{let r=Ja("npx",["tsx",...n],{stdio:"inherit"});r.on("error",t),r.on("close",i=>{i===0?e():t(new Error(`catalog build exited with code ${i}`))})})}async function Ii(n){let e=await Ue(n),t=await It(e.bindings),r=Me(n),i=await oo(t.views.map(s=>({sourcePath:et(r,s.source),exportName:s.exportName,screenName:s.screenName})),{allowlistExtra:e.allowlistExtra});return new Map(t.views.map((s,a)=>[s.screenName,i[a]]))}async function Ga(n,e){let t=await Ue(n),r=await It(t.bindings);for(let i of r.views){if(!i.targets.includes("react"))continue;let s=e.get(i.screenName);if(!s)throw new Error(`Missing View IR for ${i.screenName}`);let a=ko(t,i),l=Oo(n,t,a);await Bo(s,a,{componentsImportFrom:l,allowlistExtra:t.allowlistExtra}),console.log(` ${i.exportName} \u2192 ${a}`)}}async function Wa(n){let e=await Ue(n),t=await It(e.bindings),r=Me(n),s=["// Auto-generated view bridge registry \u2014 DO NOT EDIT",`// Generated from ${Po(r,e.bindings)}`,"","export const viewBridgeRegistry = {"];for(let a of t.views)s.push(` ${a.screenConst}: {`),s.push(` id: ${JSON.stringify(a.id)},`),s.push(` screenId: ${JSON.stringify(a.screenId)},`),s.push(` screenName: ${JSON.stringify(a.screenName)},`),s.push(` route: ${JSON.stringify(a.route)},`),s.push(` operationId: ${JSON.stringify(a.operationId)},`),s.push(` viewModel: ${JSON.stringify(a.viewModel)},`),s.push(` source: ${JSON.stringify(a.source)},`),s.push(` targets: ${JSON.stringify(a.targets)},`),s.push(" },");s.push("} as const;",""),s.push("export type ViewBridgeKey = keyof typeof viewBridgeRegistry;",""),await Lf(Ua(et(e.generated.bridge)),{recursive:!0}),await If(et(e.generated.bridge),s.join(`
797
+ `),"utf-8"),console.log(`Bridge registry \u2192 ${e.generated.bridge} (${t.views.length} view(s))`)}var Ya={compile:async(n,e)=>{let t=await Ii(await qe(n.config));console.log(`Compiled ${t.size} view(s) to View IR (in-memory)`)},renderReact:async(n,e)=>{let t=await qe(n.config),r=await Ii(t);await Ga(t,r)},renderBridge:async(n,e)=>{await Wa(await qe(n.config))},build:async(n,e)=>{let t=await qe(n.config),r=await Ue(t),i=await It(r.bindings),s=await Ii(t);console.log(`Compiled ${s.size} view(s) to View IR (in-memory)`),await Ha(t,r),await Ga(t,s),await Wa(t),await ja(t,r,i)},contractsGenerate:async(n,e)=>{let t=await Ue(await qe(n.config));await $a(["generate","-c",t.microContractsConfig]),console.log("Contracts generated via micro-contracts")},contractsCheck:async(n,e)=>{let t=await Ue(await qe(n.config));await $a(["lint","-c",t.microContractsConfig])},catalogBuild:async(n,e)=>{let t=await qe(n.config),r=Me(t),i=n.output?et(String(n.output)):et(r,"dist/catalog.html"),s=et(r,"tsconfig.catalog.json"),{existsSync:a}=await import("node:fs");if(!a(s))throw new Error(`Missing ${s}. Add tsconfig.catalog.json with @view-contracts/components paths for catalog SSR.`);let l=et(Ua(Nf(import.meta.url)),"../catalog/run.ts");await Rf(["--tsconfig",s,l,i,t]),console.log(`Catalog \u2192 ${i}`)}};var Mf={version:"0.2.0"};zi(Ya,Mf.version).parseAsync(process.argv).catch(n=>{console.error(n instanceof Error?n.message:n),process.exit(1)});
803
798
  /*! Bundled license information:
804
799
 
805
800
  js-yaml/dist/js-yaml.mjs: