@spree/cli 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
- var Dy=Object.create;var Fo=Object.defineProperty;var Ly=Object.getOwnPropertyDescriptor;var By=Object.getOwnPropertyNames;var zy=Object.getPrototypeOf,My=Object.prototype.hasOwnProperty;var be=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Fy=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var P=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Gy=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of By(t))!My.call(e,n)&&n!==r&&Fo(e,n,{get:()=>t[n],enumerable:!(i=Ly(t,n))||i.enumerable});return e};var L=(e,t,r)=>(r=e!=null?Dy(zy(e)):{},Gy(t||!e||!e.__esModule?Fo(r,"default",{value:e,enumerable:!0}):r,e));var m,p=Fy(()=>{m={spree_admin_sdk_range:"^1.0.0-rc.1",spree_dashboard_core_range:"^1.0.0-rc.1",spree_dashboard_ui_range:"^1.0.0-rc.1"}});var gr=P(Jn=>{"use strict";p();var ni=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Yn=class extends ni{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Jn.CommanderError=ni;Jn.InvalidArgumentError=Yn});var si=P(Zn=>{"use strict";p();var{InvalidArgumentError:Ny}=gr(),Xn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Ny(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Vy(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Zn.Argument=Xn;Zn.humanReadableArgName=Vy});var ts=P(es=>{"use strict";p();var{humanReadableArgName:Hy}=si(),Qn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>Hy(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[])}),r.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[]),n.get(a).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(l,h){return r.formatItem(l,i,h,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],o=r.commandDescription(t);o.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(o),n),""]));let c=r.visibleArguments(t).map(l=>s(r.styleArgumentTerm(r.argumentTerm(l)),r.styleArgumentDescription(r.argumentDescription(l))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),l=>l.helpGroupHeading??"Options:").forEach((l,h)=>{let y=l.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),r.showGlobalOptions){let l=r.visibleGlobalOptions(t).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList("Global Options:",l,r))}return this.groupItems(t.commands,r.visibleCommands(t),l=>l.helpGroup()||"Commands:").forEach((l,h)=>{let y=l.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),a.join(`
4
+ var Ly=Object.create;var Fo=Object.defineProperty;var By=Object.getOwnPropertyDescriptor;var zy=Object.getOwnPropertyNames;var My=Object.getPrototypeOf,Fy=Object.prototype.hasOwnProperty;var be=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Gy=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var P=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Uy=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zy(t))!Fy.call(e,n)&&n!==r&&Fo(e,n,{get:()=>t[n],enumerable:!(i=By(t,n))||i.enumerable});return e};var L=(e,t,r)=>(r=e!=null?Ly(My(e)):{},Uy(t||!e||!e.__esModule?Fo(r,"default",{value:e,enumerable:!0}):r,e));var m,p=Gy(()=>{m={spree_admin_sdk_range:"^1.0.0-rc.1",spree_dashboard_core_range:"^1.0.0-rc.2",spree_dashboard_ui_range:"^1.0.0-rc.2"}});var gr=P(Jn=>{"use strict";p();var ni=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Yn=class extends ni{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Jn.CommanderError=ni;Jn.InvalidArgumentError=Yn});var si=P(Zn=>{"use strict";p();var{InvalidArgumentError:Vy}=gr(),Xn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Vy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hy(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Zn.Argument=Xn;Zn.humanReadableArgName=Hy});var ts=P(es=>{"use strict";p();var{humanReadableArgName:Wy}=si(),Qn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>Wy(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[])}),r.forEach(s=>{let a=i(s);n.has(a)||n.set(a,[]),n.get(a).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(l,h){return r.formatItem(l,i,h,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],o=r.commandDescription(t);o.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(o),n),""]));let c=r.visibleArguments(t).map(l=>s(r.styleArgumentTerm(r.argumentTerm(l)),r.styleArgumentDescription(r.argumentDescription(l))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),l=>l.helpGroupHeading??"Options:").forEach((l,h)=>{let y=l.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),r.showGlobalOptions){let l=r.visibleGlobalOptions(t).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));a=a.concat(this.formatItemList("Global Options:",l,r))}return this.groupItems(t.commands,r.visibleCommands(t),l=>l.helpGroup()||"Commands:").forEach((l,h)=>{let y=l.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));a=a.concat(this.formatItemList(h,y,r))}),a.join(`
5
5
  `)}displayWidth(t){return Go(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,i,n){let a=" ".repeat(2);if(!i)return a+t;let o=t.padEnd(r+t.length-n.displayWidth(t)),c=2,u=(this.helpWidth??80)-r-c-2,l;return u<this.minWidthToWrap||n.preformatted(i)?l=i:l=n.boxWrap(i,u).replace(/\n/g,`
6
6
  `+" ".repeat(r+c)),a+o+" ".repeat(c)+l.replace(/\n/g,`
7
7
  ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(a=>{let o=a.match(n);if(o===null){s.push("");return}let c=[o.shift()],d=this.displayWidth(c[0]);o.forEach(u=>{let l=this.displayWidth(u);if(d+l<=r){c.push(u),d+=l;return}s.push(c.join(""));let h=u.trimStart();c=[h],d=this.displayWidth(h)}),s.push(c.join(""))}),s.join(`
8
- `)}};function Go(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}es.Help=Qn;es.stripColor=Go});var ss=P(ns=>{"use strict";p();var{InvalidArgumentError:Wy}=gr(),rs=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=Ky(t);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(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Wy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Uo(this.name().replace(/^no-/,"")):Uo(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},is=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return r.negate===(s===t)}};function Uo(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Ky(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(r=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let a=s[0],o=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${o}
8
+ `)}};function Go(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}es.Help=Qn;es.stripColor=Go});var ss=P(ns=>{"use strict";p();var{InvalidArgumentError:Ky}=gr(),rs=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=Yy(t);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(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Ky(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Uo(this.name().replace(/^no-/,"")):Uo(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},is=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return r.negate===(s===t)}};function Uo(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Yy(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(r=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let a=s[0],o=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${o}
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
11
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(a)?new Error(`${o}
12
12
  - too many short flags`):n.test(a)?new Error(`${o}
13
13
  - too many long flags`):new Error(`${o}
14
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}ns.Option=rs;ns.DualOptions=is});var Vo=P(No=>{"use strict";p();function Yy(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=t.length;i++)r[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=e.length;n++){let s=1;e[n-1]===t[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[e.length][t.length]}function Jy(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let i=[],n=3,s=.4;return t.forEach(a=>{if(a.length<=1)return;let o=Yy(e,a),c=Math.max(e.length,a.length);(c-o)/c>s&&(o<n?(n=o,i=[a]):o===n&&i.push(a))}),i.sort((a,o)=>a.localeCompare(o)),r&&(i=i.map(a=>`--${a}`)),i.length>1?`
14
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}ns.Option=rs;ns.DualOptions=is});var Vo=P(No=>{"use strict";p();function Jy(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=t.length;i++)r[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=e.length;n++){let s=1;e[n-1]===t[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[e.length][t.length]}function Xy(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let i=[],n=3,s=.4;return t.forEach(a=>{if(a.length<=1)return;let o=Jy(e,a),c=Math.max(e.length,a.length);(c-o)/c>s&&(o<n?(n=o,i=[a]):o===n&&i.push(a))}),i.sort((a,o)=>a.localeCompare(o)),r&&(i=i.map(a=>`--${a}`)),i.length>1?`
15
15
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
16
- (Did you mean ${i[0]}?)`:""}No.suggestSimilar=Jy});var Yo=P(ds=>{"use strict";p();var Xy=be("events").EventEmitter,as=be("child_process"),et=be("path"),ai=be("fs"),D=be("process"),{Argument:Zy,humanReadableArgName:Qy}=si(),{CommanderError:os}=gr(),{Help:eg,stripColor:tg}=ts(),{Option:Ho,DualOptions:rg}=ss(),{suggestSimilar:Wo}=Vo(),ps=class e extends Xy{constructor(t){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=t||"",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:r=>D.stdout.write(r),writeErr:r=>D.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>D.stdout.isTTY?D.stdout.columns:void 0,getErrHelpWidth:()=>D.stderr.isTTY?D.stderr.columns:void 0,getOutHasColors:()=>cs()??(D.stdout.isTTY&&D.stdout.hasColors?.()),getErrHasColors:()=>cs()??(D.stderr.isTTY&&D.stderr.hasColors?.()),stripColor:r=>tg(r)},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(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,a,o]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return n&&(c.description(n),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,o&&c.arguments(o),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new eg,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
17
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Zy(t,r)}argument(t,r,i,n){let s=this.createArgument(t,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,n,s]=i.match(/([^ ]+) *(.*)/),a=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),a&&o.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=o,(t||r)&&this._initCommandGroup(o),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),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(t,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ (Did you mean ${i[0]}?)`:""}No.suggestSimilar=Xy});var Yo=P(ds=>{"use strict";p();var Zy=be("events").EventEmitter,as=be("child_process"),et=be("path"),ai=be("fs"),D=be("process"),{Argument:Qy,humanReadableArgName:eg}=si(),{CommanderError:os}=gr(),{Help:tg,stripColor:rg}=ts(),{Option:Ho,DualOptions:ig}=ss(),{suggestSimilar:Wo}=Vo(),ps=class e extends Zy{constructor(t){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=t||"",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:r=>D.stdout.write(r),writeErr:r=>D.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>D.stdout.isTTY?D.stdout.columns:void 0,getErrHelpWidth:()=>D.stderr.isTTY?D.stderr.columns:void 0,getOutHasColors:()=>cs()??(D.stdout.isTTY&&D.stdout.hasColors?.()),getErrHasColors:()=>cs()??(D.stderr.isTTY&&D.stderr.hasColors?.()),stripColor:r=>rg(r)},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(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,a,o]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return n&&(c.description(n),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,o&&c.arguments(o),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new tg,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
17
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Qy(t,r)}argument(t,r,i,n){let s=this.createArgument(t,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,n,s]=i.match(/([^ ]+) *(.*)/),a=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),a&&o.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=o,(t||r)&&this._initCommandGroup(o),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),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(t,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
18
18
  Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,i){this._exitCallback&&this._exitCallback(new os(t,r,i)),D.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new Ho(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let a=`${n} ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
19
19
  - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),i=r(t).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),i=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,a,o)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let c=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,c,a):s!==null&&t.variadic&&(s=t._collectValue(s,c)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,o)};return this.on("option:"+r,s=>{let a=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let a=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,a,"env")}),this}_optionEx(t,r,i,n,s){if(typeof r=="object"&&r instanceof Ho)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,i);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(s).argParser(n);else if(n instanceof RegExp){let o=n;n=(c,d)=>{let u=o.exec(c);return u?u[0]:d},a.default(s).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,i,n){return this._optionEx({},t,r,i,n)}requiredOption(t,r,i,n){return this._optionEx({mandatory:!0},t,r,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,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(t=!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=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,i){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(r=i.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){D.versions?.electron&&(r.from="electron");let n=D.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=D.argv),this.rawArgs=t.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":D.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return this._parseCommand([],i),this}async parseAsync(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);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
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(t,r,i){if(ai.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
@@ -23,25 +23,25 @@ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._life
23
23
  - ${n}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(u,l){let h=et.resolve(u,l);if(ai.existsSync(h))return h;if(n.includes(et.extname(l)))return;let y=n.find(g=>ai.existsSync(`${h}${g}`));if(y)return`${h}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=t._executableFile||`${this._name}-${t._name}`,o=this._executableDir||"";if(this._scriptPath){let u;try{u=ai.realpathSync(this._scriptPath)}catch{u=this._scriptPath}o=et.resolve(et.dirname(u),o)}if(o){let u=s(o,a);if(!u&&!t._executableFile&&this._scriptPath){let l=et.basename(this._scriptPath,et.extname(this._scriptPath));l!==this._name&&(u=s(o,`${l}-${t._name}`))}a=u||a}i=n.includes(et.extname(a));let c;D.platform!=="win32"?i?(r.unshift(a),r=Ko(D.execArgv).concat(r),c=as.spawn(D.argv[0],r,{stdio:"inherit"})):c=as.spawn(a,r,{stdio:"inherit"}):(this._checkForMissingExecutable(a,o,t._name),r.unshift(a),r=Ko(D.execArgv).concat(r),c=as.spawn(D.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(l=>{D.on(l,()=>{c.killed===!1&&c.exitCode===null&&c.kill(l)})});let d=this._exitCallback;c.on("close",u=>{u=u??1,d?d(new os(u,"commander.executeSubCommandAsync","(close)")):D.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(a,o,t._name);else if(u.code==="EACCES")throw new Error(`'${a}' not executable`);if(!d)D.exit(1);else{let l=new os(1,"commander.executeSubCommandAsync","(error)");l.nestedError=u,d(l)}}),this.runningCommand=c}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,s)=>{let a=n;if(n!==null&&i.parseArg){let o=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;a=this._callParseArg(i,n,s,o)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((a,o)=>t(i,o,a),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),r[n]=s}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:s,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,r))}),n}_parseCommand(t,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),r=i.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),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,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function s(u){return u.length>1&&u[0]==="-"}let a=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(l=>l.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):!1,o=null,c=null,d=0;for(;d<t.length||c;){let u=c??t[d++];if(c=null,u==="--"){n===i&&n.push(u),n.push(...t.slice(d));break}if(o&&(!s(u)||a(u))){this.emit(`option:${o.name()}`,u);continue}if(o=null,s(u)){let l=this._findOption(u);if(l){if(l.required){let h=t[d++];h===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,h)}else if(l.optional){let h=null;d<t.length&&(!s(t[d])||a(t[d]))&&(h=t[d++]),this.emit(`option:${l.name()}`,h)}else this.emit(`option:${l.name()}`);o=l.variadic?l:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let l=this._findOption(`-${u[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,u.slice(2)):(this.emit(`option:${l.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let l=u.indexOf("="),h=this._findOption(u.slice(0,l));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,u.slice(l+1));continue}}if(n===r&&s(u)&&!(this.commands.length===0&&a(u))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(u)){r.push(u),i.push(...t.slice(d));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...t.slice(d));break}else if(this._defaultCommandName){i.push(u,...t.slice(d));break}}if(this._passThroughOptions){n.push(u,...t.slice(d));break}n.push(u)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
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=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in D.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,D.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new rg(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=a=>{let o=a.attributeName(),c=this.getOptionValue(o),d=this.options.find(l=>l.negate&&o===l.attributeName()),u=this.options.find(l=>!l.negate&&o===l.attributeName());return d&&(d.presetArg===void 0&&c===!1||d.presetArg!==void 0&&c===d.presetArg)?d:u||a},n=a=>{let o=i(a),c=o.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},s=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(o=>o.long).map(o=>o.long);n=n.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);r=Wo(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),r=Wo(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
27
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Qy(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=et.basename(t,et.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,s;return r?(i=o=>this._outputConfiguration.writeErr(o),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=o=>this._outputConfiguration.writeOut(o),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:o=>(n||(o=this._outputConfiguration.stripColor(o)),i(o)),hasColors:n,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(D.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ `),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in D.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,D.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ig(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=a=>{let o=a.attributeName(),c=this.getOptionValue(o),d=this.options.find(l=>l.negate&&o===l.attributeName()),u=this.options.find(l=>!l.negate&&o===l.attributeName());return d&&(d.presetArg===void 0&&c===!1||d.presetArg!==void 0&&c===d.presetArg)?d:u||a},n=a=>{let o=i(a),c=o.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},s=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(o=>o.long).map(o=>o.long);n=n.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);r=Wo(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),r=Wo(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
27
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>eg(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=et.basename(t,et.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,s;return r?(i=o=>this._outputConfiguration.writeErr(o),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=o=>this._outputConfiguration.writeOut(o),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:o=>(n||(o=this._outputConfiguration.stripColor(o)),i(o)),hasColors:n,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(D.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
28
28
  Expecting one of '${i.join("', '")}'`);let n=`${t}Help`;return this.on(n,s=>{let a;typeof r=="function"?a=r({error:s.error,command:s.command}):a=r,a&&s.write(`${a}
29
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ko(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function cs(){if(D.env.NO_COLOR||D.env.FORCE_COLOR==="0"||D.env.FORCE_COLOR==="false")return!1;if(D.env.FORCE_COLOR||D.env.CLICOLOR_FORCE!==void 0)return!0}ds.Command=ps;ds.useColor=cs});var Qo=P(we=>{"use strict";p();var{Argument:Jo}=si(),{Command:us}=Yo(),{CommanderError:ig,InvalidArgumentError:Xo}=gr(),{Help:ng}=ts(),{Option:Zo}=ss();we.program=new us;we.createCommand=e=>new us(e);we.createOption=(e,t)=>new Zo(e,t);we.createArgument=(e,t)=>new Jo(e,t);we.Command=us;we.Option=Zo;we.Argument=Jo;we.Help=ng;we.CommanderError=ig;we.InvalidArgumentError=Xo;we.InvalidOptionArgumentError=Xo});var J=P((P$,ls)=>{"use strict";p();var pi=process||{},ip=pi.argv||[],oi=pi.env||{},sg=!(oi.NO_COLOR||ip.includes("--no-color"))&&(!!oi.FORCE_COLOR||ip.includes("--color")||pi.platform==="win32"||(pi.stdout||{}).isTTY&&oi.TERM!=="dumb"||!!oi.CI),ag=(e,t,r=e)=>i=>{let n=""+i,s=n.indexOf(t,e.length);return~s?e+og(n,t,r,s)+t:e+n+t},og=(e,t,r,i)=>{let n="",s=0;do n+=e.substring(s,i)+r,s=i+t.length,i=e.indexOf(t,s);while(~i);return n+e.substring(s)},np=(e=sg)=>{let t=e?ag:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};ls.exports=np();ls.exports.createColors=np});var fs=P((U$,bp)=>{"use strict";p();var gs={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},kg={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},vg={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?gs.up():"");return e&&(t+=gs.left),t}};bp.exports={cursor:gs,scroll:kg,erase:vg,beep:"\x07"}});var pc=P((Zj,oc)=>{"use strict";p();oc.exports=ac;ac.sync=Yf;var nc=be("fs");function Kf(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function sc(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Kf(t,r)}function ac(e,t,r){nc.stat(e,function(i,n){r(i,i?!1:sc(n,e,t))})}function Yf(e,t){return sc(nc.statSync(e),e,t)}});var mc=P((eP,lc)=>{"use strict";p();lc.exports=dc;dc.sync=Jf;var cc=be("fs");function dc(e,t,r){cc.stat(e,function(i,n){r(i,i?!1:uc(n,t))})}function Jf(e,t){return uc(cc.statSync(e),t)}function uc(e,t){return e.isFile()&&Xf(e,t)}function Xf(e,t){var r=e.mode,i=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),c=parseInt("010",8),d=parseInt("001",8),u=o|c,l=r&d||r&c&&n===a||r&o&&i===s||r&u&&s===0;return l}});var yc=P((iP,hc)=>{"use strict";p();var rP=be("fs"),Ii;process.platform==="win32"||global.TESTING_WINDOWS?Ii=pc():Ii=mc();hc.exports=Is;Is.sync=Zf;function Is(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Is(e,t||{},function(s,a){s?n(s):i(a)})})}Ii(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function Zf(e,t){try{return Ii.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vc=P((sP,kc)=>{"use strict";p();var zt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",gc=be("path"),Qf=zt?";":":",fc=yc(),_c=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),bc=(e,t)=>{let r=t.colon||Qf,i=e.match(/\//)||zt&&e.match(/\\/)?[""]:[...zt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=zt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=zt?n.split(r):[""];return zt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},qc=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:s}=bc(e,t),a=[],o=d=>new Promise((u,l)=>{if(d===i.length)return t.all&&a.length?u(a):l(_c(e));let h=i[d],y=/^".*"$/.test(h)?h.slice(1,-1):h,g=gc.join(y,e),b=!y&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;u(c(b,d,0))}),c=(d,u,l)=>new Promise((h,y)=>{if(l===n.length)return h(o(u+1));let g=n[l];fc(d+g,{pathExt:s},(b,$)=>{if(!b&&$)if(t.all)a.push(d+g);else return h(d+g);return h(c(d,u,l+1))})});return r?o(0).then(d=>r(null,d),r):o(0)},e_=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=bc(e,t),s=[];for(let a=0;a<r.length;a++){let o=r[a],c=/^".*"$/.test(o)?o.slice(1,-1):o,d=gc.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let l=0;l<i.length;l++){let h=u+i[l];try{if(fc.sync(h,{pathExt:n}))if(t.all)s.push(h);else return h}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw _c(e)};kc.exports=qc;qc.sync=e_});var xc=P((oP,Os)=>{"use strict";p();var wc=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Os.exports=wc;Os.exports.default=wc});var Ec=P((cP,Ac)=>{"use strict";p();var Sc=be("path"),t_=vc(),r_=xc();function $c(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let a;try{a=t_.sync(e.command,{path:r[r_({env:r})],pathExt:t?Sc.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return a&&(a=Sc.resolve(n?e.options.cwd:"",a)),a}function i_(e){return $c(e)||$c(e,!0)}Ac.exports=i_});var jc=P((uP,Ls)=>{"use strict";p();var Ds=/([()\][%!^"`<>&|;, *?])/g;function n_(e){return e=e.replace(Ds,"^$1"),e}function s_(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Ds,"^$1"),t&&(e=e.replace(Ds,"^$1")),e}Ls.exports.command=n_;Ls.exports.argument=s_});var Tc=P((mP,Pc)=>{"use strict";p();Pc.exports=/^#!(.*)/});var Rc=P((yP,Cc)=>{"use strict";p();var a_=Tc();Cc.exports=(e="")=>{let t=e.match(a_);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var Oc=P((fP,Ic)=>{"use strict";p();var Bs=be("fs"),o_=Rc();function p_(e){let r=Buffer.alloc(150),i;try{i=Bs.openSync(e,"r"),Bs.readSync(i,r,0,150,0),Bs.closeSync(i)}catch{}return o_(r.toString())}Ic.exports=p_});var zc=P((bP,Bc)=>{"use strict";p();var c_=be("path"),Dc=Ec(),Lc=jc(),d_=Oc(),u_=process.platform==="win32",l_=/\.(?:com|exe)$/i,m_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h_(e){e.file=Dc(e);let t=e.file&&d_(e.file);return t?(e.args.unshift(e.file),e.command=t,Dc(e)):e.file}function y_(e){if(!u_)return e;let t=h_(e),r=!l_.test(t);if(e.options.forceShell||r){let i=m_.test(t);e.command=c_.normalize(e.command),e.command=Lc.command(e.command),e.args=e.args.map(s=>Lc.argument(s,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function g_(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:y_(i)}Bc.exports=g_});var Gc=P((kP,Fc)=>{"use strict";p();var zs=process.platform==="win32";function Ms(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function f_(e,t){if(!zs)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let s=Mc(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function Mc(e,t){return zs&&e===1&&!t.file?Ms(t.original,"spawn"):null}function __(e,t){return zs&&e===1&&!t.file?Ms(t.original,"spawnSync"):null}Fc.exports={hookChildProcess:f_,verifyENOENT:Mc,verifyENOENTSync:__,notFoundError:Ms}});var Vc=P((wP,Mt)=>{"use strict";p();var Uc=be("child_process"),Fs=zc(),Gs=Gc();function Nc(e,t,r){let i=Fs(e,t,r),n=Uc.spawn(i.command,i.args,i.options);return Gs.hookChildProcess(n,i),n}function b_(e,t,r){let i=Fs(e,t,r),n=Uc.spawnSync(i.command,i.args,i.options);return n.error=n.error||Gs.verifyENOENTSync(n.status,i),n}Mt.exports=Nc;Mt.exports.spawn=Nc;Mt.exports.sync=b_;Mt.exports._parse=Fs;Mt.exports._enoent=Gs});var ho=P(ir=>{"use strict";p();Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_COLOR_MAP=void 0;ir.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var mo=class{constructor(t=ir.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,r){let i=this.colorMap[t];this.text+=i!==void 0?`${i}${r}${this.colorMap.reset}`:r}renderConsole(){return this.text}};ir.default=mo});var Mr=P(ie=>{"use strict";p();Object.defineProperty(ie,"__esModule",{value:!0});ie.DEFAULT_HEADER_ALIGNMENT=ie.DEFAULT_ROW_ALIGNMENT=ie.DEFAULT_HEADER_FONT_COLOR=ie.DEFAULT_ROW_FONT_COLOR=ie.COLORS=ie.ALIGNMENTS=ie.DEFAULT_TABLE_STYLE=ie.DEFAULT_ROW_SEPARATOR=ie.DEFAULT_COLUMN_LEN=void 0;ie.DEFAULT_COLUMN_LEN=20;ie.DEFAULT_ROW_SEPARATOR=!1;ie.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};ie.ALIGNMENTS=["right","left","center"];ie.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];ie.DEFAULT_ROW_FONT_COLOR="white";ie.DEFAULT_HEADER_FONT_COLOR="white_bold";ie.DEFAULT_ROW_ALIGNMENT="right";ie.DEFAULT_HEADER_ALIGNMENT="center"});var Xm=P(yo=>{"use strict";p();Object.defineProperty(yo,"__esModule",{value:!0});var zx=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];yo.default=zx});var Zm=P(go=>{"use strict";p();Object.defineProperty(go,"__esModule",{value:!0});var Mx=(e,t,r)=>{let i=0,n,s=r;if(e<t[0].first||e>t[s].last)return 0;for(;s>=i;)if(n=Math.floor((i+s)/2),e>t[n].last)i=n+1;else if(e<t[n].first)s=n-1;else return 1;return 0};go.default=Mx});var fo=P(Fr=>{"use strict";p();var eh=Fr&&Fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fr,"__esModule",{value:!0});var Qm=eh(Xm()),Fx=eh(Zm()),Gx=e=>e===0?0:e<32||e>=127&&e<160?-1:(0,Fx.default)(e,Qm.default,Qm.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));Fr.default=Gx});var th=P(Gr=>{"use strict";p();var Ux=Gr&&Gr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gr,"__esModule",{value:!0});var Nx=Ux(fo()),Vx=e=>{let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),n=(0,Nx.default)(i);if(n<0)return-1;t+=n}return t};Gr.default=Vx});var ih=P(kt=>{"use strict";p();var rh=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kt,"__esModule",{value:!0});kt.wcswidth=kt.wcwidth=void 0;var Hx=rh(th());kt.wcswidth=Hx.default;var Wx=rh(fo());kt.wcwidth=Wx.default});var _o=P(Ct=>{"use strict";p();Object.defineProperty(Ct,"__esModule",{value:!0});Ct.findWidthInConsole=Ct.stripAnsi=void 0;var Kx=ih(),Yx=/\x1b\[\d{1,3}(;\d{1,3})*m/g,Jx=e=>e.replace(Yx,"");Ct.stripAnsi=Jx;var Xx=(e,t)=>{let r=0;return e=(0,Ct.stripAnsi)(e),t&&Object.entries(t).forEach(([i,n])=>{let s=new RegExp(i,"g");r+=(e.match(s)||[]).length*n,e=e.replace(i,"")}),r+=(0,Kx.wcswidth)(e),r};Ct.findWidthInConsole=Xx});var qo=P(Ye=>{"use strict";p();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.biggestWordInSentence=Ye.textWithPadding=Ye.splitTextIntoTextsOfMinLen=void 0;var bo=_o(),Zx=(e,t,r)=>{let i=[];return e.split(/[\n\r]/).forEach(s=>{let a=s.split(" "),o=[],c=0;a.forEach(d=>{let u=(0,bo.findWidthInConsole)(d,r);c+u<=t?(c+=u+1,o.push(d)):(o.length>0&&i.push(o.join(" ")),o=[d],c=u+1)}),i.push(o.join(" "))}),i};Ye.splitTextIntoTextsOfMinLen=Zx;var Qx=(e,t,r,i)=>{let n=(0,bo.findWidthInConsole)(e,i),s=Math.floor((r-n)/2),a=r-s-n;if(r<n){let o=(0,Ye.splitTextIntoTextsOfMinLen)(e,r);return o.length===1?e:o.map(c=>(0,Ye.textWithPadding)(c,t,r,i)).join(`
30
- `)}switch(t){case"left":return e.concat(" ".repeat(r-n));case"center":return" ".repeat(s).concat(e).concat(" ".repeat(a));default:return" ".repeat(r-n).concat(e)}};Ye.textWithPadding=Qx;var e0=(e,t)=>e.split(" ").reduce((r,i)=>Math.max(r,(0,bo.findWidthInConsole)(i,t)),0);Ye.biggestWordInSentence=e0});var Ur=P(V=>{"use strict";p();Object.defineProperty(V,"__esModule",{value:!0});V.getWidthLimitedColumnsArray=V.createHeaderAsRow=V.renderTableHorizontalBorders=V.findLenOfColumn=V.createRow=V.createColumFromOnlyName=V.createTableHorizontalBorders=V.convertRawRowOptionsToStandard=V.evaluateCellText=V.cellText=void 0;var nh=_o(),ko=qo(),vo=Mr(),nr=(e,t)=>Math.max(e,t),t0=e=>e==null?"":`${e}`;V.cellText=t0;var r0=(e,t)=>t?`${t(e)}`:(0,V.cellText)(e);V.evaluateCellText=r0;var i0=e=>{if(e)return{color:e.color,separator:e.separator||vo.DEFAULT_ROW_SEPARATOR}};V.convertRawRowOptionsToStandard=i0;var n0=({left:e,mid:t,right:r,other:i},n)=>{let s=e;return n.forEach(a=>{s+=i.repeat(a+2),s+=t}),s=s.slice(0,-t.length),s+=r,s};V.createTableHorizontalBorders=n0;var s0=e=>({name:e,title:e});V.createColumFromOnlyName=s0;var a0=(e,t,r)=>({color:e,separator:r,text:t});V.createRow=a0;var o0=(e,t,r)=>{let i=e.name,n=e.title,s=e.transform,a=nr(0,e.minLen||0);return e.maxLen?(a=nr(a,nr(e.maxLen,(0,ko.biggestWordInSentence)(n,r))),a=t.reduce((o,c)=>nr(o,(0,ko.biggestWordInSentence)((0,V.evaluateCellText)(c.text[i],s),r)),a),a):(a=nr(a,(0,nh.findWidthInConsole)(n,r)),t.forEach(o=>{a=nr(a,(0,nh.findWidthInConsole)((0,V.evaluateCellText)(o.text[i],s),r))}),a)};V.findLenOfColumn=o0;var p0=(e,t)=>(0,V.createTableHorizontalBorders)(e,t);V.renderTableHorizontalBorders=p0;var c0=(e,t)=>{let r=vo.DEFAULT_HEADER_FONT_COLOR,i=e(r,{},!1);return t.forEach(n=>{i.text[n.name]=n.title}),i};V.createHeaderAsRow=c0;var d0=(e,t,r)=>{let i={};return e.forEach(n=>{i[n.name]=(0,ko.splitTextIntoTextsOfMinLen)((0,V.cellText)(t.text[n.name]),n.length||vo.DEFAULT_COLUMN_LEN,r)}),i};V.getWidthLimitedColumnsArray=d0});var sh=P(ot=>{"use strict";p();Object.defineProperty(ot,"__esModule",{value:!0});ot.rawColumnToInternalColumn=ot.objIfExists=void 0;var u0=Mr(),l0=(e,t)=>t?{[e]:t}:{};ot.objIfExists=l0;var m0=(e,t)=>{var r;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(r=e.title)!==null&&r!==void 0?r:e.name},(0,ot.objIfExists)("color",e.color||t?.color)),(0,ot.objIfExists)("maxLen",e.maxLen||t?.maxLen)),(0,ot.objIfExists)("minLen",e.minLen||t?.minLen)),{alignment:e.alignment||t?.alignment||u0.DEFAULT_ROW_ALIGNMENT,transform:e.transform})};ot.rawColumnToInternalColumn=m0});var ah=P(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.preProcessRows=sr.preProcessColumns=void 0;var h0=Ur(),y0=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.columns.some(i=>i.name===t.name)||(e.addColumn(Object.assign(Object.assign({},t),e.defaultColumnOptions)),e.rows.forEach((i,n,s)=>{let a=s.map(o=>o.text);i.text[t.name]=t.function(i.text,n,a)}))})},g0=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},f0=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},_0=e=>{e.columns.forEach(t=>{t.length=(0,h0.findLenOfColumn)(t,e.rows,e.charLength)})},b0=e=>{y0(e),f0(e),g0(e),_0(e)};sr.preProcessColumns=b0;var q0=e=>{let t=e.rows.filter(r=>e.filterFunction(r.text)).sort((r,i)=>e.sortFunction(r.text,i.text));e.rows=t};sr.preProcessRows=q0});var wo=P(Ee=>{"use strict";p();var ph=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.printSimpleTable=Ee.renderSimpleTable=Ee.renderTable=void 0;var ch=ph(ho()),dh=qo(),De=Mr(),vt=Ur(),k0=ph(xo()),oh=ah(),v0=(e,t,r,i,n,s,a,o)=>{let c=new ch.default(a);return c.addCharsWithColor("",e.vertical),t.forEach(d=>{let l=r<i[d.name].length?(0,vt.cellText)(i[d.name][r]):"";c.addCharsWithColor(De.DEFAULT_ROW_FONT_COLOR," "),c.addCharsWithColor(n&&De.DEFAULT_HEADER_FONT_COLOR||d.color||s.color,(0,dh.textWithPadding)(l,d.alignment||De.DEFAULT_ROW_ALIGNMENT,d.length||De.DEFAULT_COLUMN_LEN,o)),c.addCharsWithColor("",` ${e.vertical}`)}),c.renderConsole()},uh=(e,t,r,i,n,s)=>{let a=(0,vt.getWidthLimitedColumnsArray)(t,r,s),o=Object.values(a).reduce((d,u)=>Math.max(d,u.length),0),c=[];for(let d=0;d<o;d+=1){let u=v0(e,t,d,a,n,r,i,s);c.push(u)}return c},w0=(e,t)=>{let r=Object.assign(Object.assign({},e),{text:Object.assign({},e.text)}),i={};return t.filter(n=>!!n.transform).forEach(n=>{i[n.name]=n.transform}),Object.keys(i).forEach(n=>{r.text[n]=i[n](r.text[n])}),r},x0=(e,t)=>{let r=[],i=w0(t,e.columns);return r=r.concat(uh(e.tableStyle,e.columns,i,e.colorMap,void 0,e.charLength)),r},S0=e=>{let t=[];if(e.title===void 0)return t;let r=()=>{let s=(a,o)=>a+o+2+1;return e.columns.map(a=>a.length||De.DEFAULT_COLUMN_LEN).reduce(s,1)},i=(0,dh.textWithPadding)(e.title,De.DEFAULT_HEADER_ALIGNMENT,r()),n=new ch.default(e.colorMap);return n.addCharsWithColor(De.DEFAULT_HEADER_FONT_COLOR,i),t.push(n.renderConsole()),t},$0=e=>{let t=[];t.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(i=>i.length||De.DEFAULT_COLUMN_LEN)));let r=(0,vt.createHeaderAsRow)(vt.createRow,e.columns);return t=t.concat(uh(e.tableStyle,e.columns,r,e.colorMap,!0)),t.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(i=>i.length||De.DEFAULT_COLUMN_LEN))),t},A0=e=>{let t=[];return t.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(r=>r.length||De.DEFAULT_COLUMN_LEN))),t},E0=(e,t)=>{let r=[],i=e.rows.length-1;return e.rows.indexOf(t)!==i&&t.separator&&r.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(s=>s.length||De.DEFAULT_COLUMN_LEN))),r},j0=e=>{(0,oh.preProcessColumns)(e),(0,oh.preProcessRows)(e);let t=[];return S0(e).forEach(r=>t.push(r)),$0(e).forEach(r=>t.push(r)),e.rows.forEach(r=>{x0(e,r).forEach(i=>t.push(i)),E0(e,r).forEach(i=>t.push(i))}),A0(e).forEach(r=>t.push(r)),t.join(`
31
- `)};Ee.renderTable=j0;var P0=(e,t)=>{let r=new k0.default(t);return r.addRows(e),(0,Ee.renderTable)(r)};Ee.renderSimpleTable=P0;var T0=(e,t)=>{console.log((0,Ee.renderSimpleTable)(e,t))};Ee.printSimpleTable=T0});var xo=P(Eo=>{"use strict";p();Object.defineProperty(Eo,"__esModule",{value:!0});var C0=ho(),Ln=Mr(),So=Ur(),$o=sh(),R0=wo(),I0=()=>0,O0=()=>!0,Ao=class{initSimple(t){this.columns=t.map(r=>({name:r,title:r,alignment:Ln.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var r;this.title=t.title||this.title,this.tableStyle=Object.assign(Object.assign({},this.tableStyle),t.style),this.sortFunction=t.sort||this.sortFunction,this.filterFunction=t.filter||this.filterFunction,this.enabledColumns=t.enabledColumns||this.enabledColumns,this.disabledColumns=t.disabledColumns||this.disabledColumns,this.computedColumns=t.computedColumns||this.computedColumns,this.columns=((r=t.columns)===null||r===void 0?void 0:r.map(i=>(0,$o.rawColumnToInternalColumn)(i,t.defaultColumnOptions)))||this.columns,this.rowSeparator=t.rowSeparator||this.rowSeparator,this.charLength=t.charLength||this.charLength,this.defaultColumnOptions=t.defaultColumnOptions||this.defaultColumnOptions,t.shouldDisableColors?this.colorMap={}:t.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Ln.DEFAULT_TABLE_STYLE,this.filterFunction=O0,this.sortFunction=I0,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Ln.DEFAULT_ROW_SEPARATOR,this.colorMap=C0.DEFAULT_COLOR_MAP,this.charLength={},this.defaultColumnOptions=void 0,this.transforms={},t instanceof Array?this.initSimple(t):typeof t=="object"&&t!==null&&this.initDetailed(t)}createColumnFromRow(t){let r=this.columns.map(i=>i.name);Object.keys(t).forEach(i=>{r.includes(i)||this.columns.push((0,$o.rawColumnToInternalColumn)((0,So.createColumFromOnlyName)(i),this.defaultColumnOptions))})}addColumn(t){let r=typeof t=="string"?(0,So.createColumFromOnlyName)(t):t;this.columns.push((0,$o.rawColumnToInternalColumn)(r,this.defaultColumnOptions))}addColumns(t){t.forEach(r=>{this.addColumn(r)})}addRow(t,r){this.createColumnFromRow(t),this.rows.push((0,So.createRow)(r?.color||Ln.DEFAULT_ROW_FONT_COLOR,t,r?.separator!==void 0?r.separator:this.rowSeparator))}addRows(t,r){t.forEach(i=>{this.addRow(i,r)})}clearRows(){this.rows=[]}renderTable(){return(0,R0.renderTable)(this)}};Eo.default=Ao});var mh=P(Nr=>{"use strict";p();var D0=Nr&&Nr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nr,"__esModule",{value:!0});var L0=D0(xo()),lh=Ur(),jo=class{constructor(t){this.table=new L0.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,r){return this.table.addRow(t,(0,lh.convertRawRowOptionsToStandard)(r)),this}addRows(t,r){return this.table.addRows(t,(0,lh.convertRawRowOptionsToStandard)(r)),this}clearRows(){return this.table.clearRows(),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Nr.default=jo});var Vr=P(Je=>{"use strict";p();var B0=Je&&Je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Je,"__esModule",{value:!0});Je.renderTable=Je.printTable=Je.Table=void 0;var z0=B0(mh());Je.Table=z0.default;var hh=wo();Object.defineProperty(Je,"printTable",{enumerable:!0,get:function(){return hh.printSimpleTable}});Object.defineProperty(Je,"renderTable",{enumerable:!0,get:function(){return hh.renderSimpleTable}})});p();p();var ep=L(Qo(),1),{program:b$,createCommand:q$,createArgument:k$,createOption:v$,CommanderError:w$,InvalidArgumentError:x$,InvalidOptionArgumentError:S$,Command:tp,Argument:$$,Option:rp,Help:A$}=ep.default;var Ry=L(J(),1);p();import me from"fs";import ce from"path";import{fileURLToPath as Ax}from"url";p();p();import{styleText as _s}from"util";import{stdout as bs,stdin as kp}from"process";import*as dt from"readline";import wg from"readline";p();p();p();p();var sp=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),ap=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,op=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var pg=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,cg=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,pp=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,dg=/\t{1,1000}/y,cp=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),ug=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,lg=new RegExp("\\p{M}+","gu"),mg={limit:1/0,ellipsis:""},dp=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?dp(n,mg,r).width:0),a=0,o=r.controlWidth??0,c=r.tabWidth??8,d=r.emojiWidth??2,u=2,l=r.regularWidth??1,h=r.wideWidth??u,y=[[ug,l],[pg,a],[cg,o],[dg,c],[cp,d],[pp,h]],g=0,b=0,$=e.length,S=0,A=!1,q=$,O=Math.max(0,i-s),E=0,N=0,R=0,B=0;e:for(;;){if(N>E||b>=$&&b>g){let z=e.slice(E,N)||e.slice(g,b);S=0;for(let Y of z.replaceAll(lg,"")){let j=Y.codePointAt(0)||0;if(ap(j)?B=u:op(j)?B=h:B=l,R+B>O&&(q=Math.min(q,Math.max(E,g)+S)),R+B>i){A=!0;break e}S+=Y.length,R+=B}E=N=0}if(b>=$)break e;for(let z=0,Y=y.length;z<Y;z++){let[j,Xe]=y[z];if(j.lastIndex=b,j.test(e)){if(S=j===pp?sp(e.slice(b,j.lastIndex)):j===cp?1:j.lastIndex-b,B=S*Xe,R+B>O&&(q=Math.min(q,b+Math.floor((O-R)/Xe))),R+B>i){A=!0;break e}R+=B,E=g,N=b,b=g=j.lastIndex;continue e}}b+=1}return{width:A?O:R,index:A?q:$,truncated:A,ellipsed:A&&i>=s}},up=dp;var hg={limit:1/0,ellipsis:"",ellipsisWidth:0},yg=(e,t={})=>up(e,hg,t).width,le=yg;var ci="\x1B",gp="\x9B",gg=39,hs="\x07",fp="[",fg="]",_p="m",ys=`${fg}8;;`,lp=new RegExp(`(?:\\${fp}(?<code>\\d+)m|\\${ys}(?<uri>.*)${hs})`,"y"),mp=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},hp=e=>`${ci}${fp}${e}${_p}`,yp=e=>`${ci}${ys}${e}${hs}`,ms=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,a=e.at(-1),o=a===void 0?0:le(a),c=i.next(),d=i.next(),u=0;for(;!c.done;){let l=c.value,h=le(l);o+h<=r?e[e.length-1]+=l:(e.push(l),o=0),(l===ci||l===gp)&&(n=!0,s=t.startsWith(ys,u+1)),n?s?l===hs&&(n=!1,s=!1):l===_p&&(n=!1):(o+=h,o===r&&!d.done&&(e.push(""),o=0)),c=d,d=i.next(),u+=l.length}a=e.at(-1),!o&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},_g=e=>{let t=e.split(" "),r=t.length;for(;r&&!le(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},bg=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,a=e.split(" "),o=[""],c=0;for(let l=0;l<a.length;l++){let h=a[l];if(r.trim!==!1){let g=o.at(-1)??"",b=g.trimStart();g.length!==b.length&&(o[o.length-1]=b,c=le(b))}l!==0&&(c>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),c=0),(c||r.trim===!1)&&(o[o.length-1]+=" ",c++));let y=le(h);if(r.hard&&y>t){let g=t-c,b=1+Math.floor((y-g-1)/t);Math.floor((y-1)/t)<b&&o.push(""),ms(o,h,t),c=le(o.at(-1)??"");continue}if(c+y>t&&c&&y){if(r.wordWrap===!1&&c<t){ms(o,h,t),c=le(o.at(-1)??"");continue}o.push(""),c=0}if(c+y>t&&r.wordWrap===!1){ms(o,h,t),c=le(o.at(-1)??"");continue}o[o.length-1]+=h,c+=y}r.trim!==!1&&(o=o.map(l=>_g(l)));let d=o.join(`
32
- `),u=!1;for(let l=0;l<d.length;l++){let h=d[l];if(i+=h,u)u=!1;else if(u=h>="\uD800"&&h<="\uDBFF",u)continue;if(h===ci||h===gp){lp.lastIndex=l+1;let g=lp.exec(d)?.groups;if(g?.code!==void 0){let b=Number.parseFloat(g.code);n=b===gg?void 0:b}else g?.uri!==void 0&&(s=g.uri.length===0?void 0:g.uri)}if(d[l+1]===`
29
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ko(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function cs(){if(D.env.NO_COLOR||D.env.FORCE_COLOR==="0"||D.env.FORCE_COLOR==="false")return!1;if(D.env.FORCE_COLOR||D.env.CLICOLOR_FORCE!==void 0)return!0}ds.Command=ps;ds.useColor=cs});var Qo=P(we=>{"use strict";p();var{Argument:Jo}=si(),{Command:us}=Yo(),{CommanderError:ng,InvalidArgumentError:Xo}=gr(),{Help:sg}=ts(),{Option:Zo}=ss();we.program=new us;we.createCommand=e=>new us(e);we.createOption=(e,t)=>new Zo(e,t);we.createArgument=(e,t)=>new Jo(e,t);we.Command=us;we.Option=Zo;we.Argument=Jo;we.Help=sg;we.CommanderError=ng;we.InvalidArgumentError=Xo;we.InvalidOptionArgumentError=Xo});var J=P((T$,ls)=>{"use strict";p();var pi=process||{},ip=pi.argv||[],oi=pi.env||{},ag=!(oi.NO_COLOR||ip.includes("--no-color"))&&(!!oi.FORCE_COLOR||ip.includes("--color")||pi.platform==="win32"||(pi.stdout||{}).isTTY&&oi.TERM!=="dumb"||!!oi.CI),og=(e,t,r=e)=>i=>{let n=""+i,s=n.indexOf(t,e.length);return~s?e+pg(n,t,r,s)+t:e+n+t},pg=(e,t,r,i)=>{let n="",s=0;do n+=e.substring(s,i)+r,s=i+t.length,i=e.indexOf(t,s);while(~i);return n+e.substring(s)},np=(e=ag)=>{let t=e?og:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};ls.exports=np();ls.exports.createColors=np});var fs=P((N$,bp)=>{"use strict";p();var gs={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},vg={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},wg={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?gs.up():"");return e&&(t+=gs.left),t}};bp.exports={cursor:gs,scroll:vg,erase:wg,beep:"\x07"}});var pc=P((Qj,oc)=>{"use strict";p();oc.exports=ac;ac.sync=Jf;var nc=be("fs");function Yf(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function sc(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Yf(t,r)}function ac(e,t,r){nc.stat(e,function(i,n){r(i,i?!1:sc(n,e,t))})}function Jf(e,t){return sc(nc.statSync(e),e,t)}});var mc=P((tP,lc)=>{"use strict";p();lc.exports=dc;dc.sync=Xf;var cc=be("fs");function dc(e,t,r){cc.stat(e,function(i,n){r(i,i?!1:uc(n,t))})}function Xf(e,t){return uc(cc.statSync(e),t)}function uc(e,t){return e.isFile()&&Zf(e,t)}function Zf(e,t){var r=e.mode,i=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),c=parseInt("010",8),d=parseInt("001",8),u=o|c,l=r&d||r&c&&n===a||r&o&&i===s||r&u&&s===0;return l}});var yc=P((nP,hc)=>{"use strict";p();var iP=be("fs"),Ii;process.platform==="win32"||global.TESTING_WINDOWS?Ii=pc():Ii=mc();hc.exports=Is;Is.sync=Qf;function Is(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Is(e,t||{},function(s,a){s?n(s):i(a)})})}Ii(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function Qf(e,t){try{return Ii.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vc=P((aP,kc)=>{"use strict";p();var zt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",gc=be("path"),e_=zt?";":":",fc=yc(),_c=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),bc=(e,t)=>{let r=t.colon||e_,i=e.match(/\//)||zt&&e.match(/\\/)?[""]:[...zt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=zt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=zt?n.split(r):[""];return zt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},qc=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:s}=bc(e,t),a=[],o=d=>new Promise((u,l)=>{if(d===i.length)return t.all&&a.length?u(a):l(_c(e));let h=i[d],y=/^".*"$/.test(h)?h.slice(1,-1):h,g=gc.join(y,e),b=!y&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;u(c(b,d,0))}),c=(d,u,l)=>new Promise((h,y)=>{if(l===n.length)return h(o(u+1));let g=n[l];fc(d+g,{pathExt:s},(b,$)=>{if(!b&&$)if(t.all)a.push(d+g);else return h(d+g);return h(c(d,u,l+1))})});return r?o(0).then(d=>r(null,d),r):o(0)},t_=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=bc(e,t),s=[];for(let a=0;a<r.length;a++){let o=r[a],c=/^".*"$/.test(o)?o.slice(1,-1):o,d=gc.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let l=0;l<i.length;l++){let h=u+i[l];try{if(fc.sync(h,{pathExt:n}))if(t.all)s.push(h);else return h}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw _c(e)};kc.exports=qc;qc.sync=t_});var xc=P((pP,Os)=>{"use strict";p();var wc=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Os.exports=wc;Os.exports.default=wc});var Ec=P((dP,Ac)=>{"use strict";p();var Sc=be("path"),r_=vc(),i_=xc();function $c(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let a;try{a=r_.sync(e.command,{path:r[i_({env:r})],pathExt:t?Sc.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return a&&(a=Sc.resolve(n?e.options.cwd:"",a)),a}function n_(e){return $c(e)||$c(e,!0)}Ac.exports=n_});var jc=P((lP,Ls)=>{"use strict";p();var Ds=/([()\][%!^"`<>&|;, *?])/g;function s_(e){return e=e.replace(Ds,"^$1"),e}function a_(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Ds,"^$1"),t&&(e=e.replace(Ds,"^$1")),e}Ls.exports.command=s_;Ls.exports.argument=a_});var Tc=P((hP,Pc)=>{"use strict";p();Pc.exports=/^#!(.*)/});var Rc=P((gP,Cc)=>{"use strict";p();var o_=Tc();Cc.exports=(e="")=>{let t=e.match(o_);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var Oc=P((_P,Ic)=>{"use strict";p();var Bs=be("fs"),p_=Rc();function c_(e){let r=Buffer.alloc(150),i;try{i=Bs.openSync(e,"r"),Bs.readSync(i,r,0,150,0),Bs.closeSync(i)}catch{}return p_(r.toString())}Ic.exports=c_});var zc=P((qP,Bc)=>{"use strict";p();var d_=be("path"),Dc=Ec(),Lc=jc(),u_=Oc(),l_=process.platform==="win32",m_=/\.(?:com|exe)$/i,h_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function y_(e){e.file=Dc(e);let t=e.file&&u_(e.file);return t?(e.args.unshift(e.file),e.command=t,Dc(e)):e.file}function g_(e){if(!l_)return e;let t=y_(e),r=!m_.test(t);if(e.options.forceShell||r){let i=h_.test(t);e.command=d_.normalize(e.command),e.command=Lc.command(e.command),e.args=e.args.map(s=>Lc.argument(s,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function f_(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:g_(i)}Bc.exports=f_});var Gc=P((vP,Fc)=>{"use strict";p();var zs=process.platform==="win32";function Ms(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function __(e,t){if(!zs)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let s=Mc(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function Mc(e,t){return zs&&e===1&&!t.file?Ms(t.original,"spawn"):null}function b_(e,t){return zs&&e===1&&!t.file?Ms(t.original,"spawnSync"):null}Fc.exports={hookChildProcess:__,verifyENOENT:Mc,verifyENOENTSync:b_,notFoundError:Ms}});var Vc=P((xP,Mt)=>{"use strict";p();var Uc=be("child_process"),Fs=zc(),Gs=Gc();function Nc(e,t,r){let i=Fs(e,t,r),n=Uc.spawn(i.command,i.args,i.options);return Gs.hookChildProcess(n,i),n}function q_(e,t,r){let i=Fs(e,t,r),n=Uc.spawnSync(i.command,i.args,i.options);return n.error=n.error||Gs.verifyENOENTSync(n.status,i),n}Mt.exports=Nc;Mt.exports.spawn=Nc;Mt.exports.sync=q_;Mt.exports._parse=Fs;Mt.exports._enoent=Gs});var ho=P(ir=>{"use strict";p();Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_COLOR_MAP=void 0;ir.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var mo=class{constructor(t=ir.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,r){let i=this.colorMap[t];this.text+=i!==void 0?`${i}${r}${this.colorMap.reset}`:r}renderConsole(){return this.text}};ir.default=mo});var Mr=P(ie=>{"use strict";p();Object.defineProperty(ie,"__esModule",{value:!0});ie.DEFAULT_HEADER_ALIGNMENT=ie.DEFAULT_ROW_ALIGNMENT=ie.DEFAULT_HEADER_FONT_COLOR=ie.DEFAULT_ROW_FONT_COLOR=ie.COLORS=ie.ALIGNMENTS=ie.DEFAULT_TABLE_STYLE=ie.DEFAULT_ROW_SEPARATOR=ie.DEFAULT_COLUMN_LEN=void 0;ie.DEFAULT_COLUMN_LEN=20;ie.DEFAULT_ROW_SEPARATOR=!1;ie.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};ie.ALIGNMENTS=["right","left","center"];ie.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];ie.DEFAULT_ROW_FONT_COLOR="white";ie.DEFAULT_HEADER_FONT_COLOR="white_bold";ie.DEFAULT_ROW_ALIGNMENT="right";ie.DEFAULT_HEADER_ALIGNMENT="center"});var Xm=P(yo=>{"use strict";p();Object.defineProperty(yo,"__esModule",{value:!0});var Mx=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];yo.default=Mx});var Zm=P(go=>{"use strict";p();Object.defineProperty(go,"__esModule",{value:!0});var Fx=(e,t,r)=>{let i=0,n,s=r;if(e<t[0].first||e>t[s].last)return 0;for(;s>=i;)if(n=Math.floor((i+s)/2),e>t[n].last)i=n+1;else if(e<t[n].first)s=n-1;else return 1;return 0};go.default=Fx});var fo=P(Fr=>{"use strict";p();var eh=Fr&&Fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fr,"__esModule",{value:!0});var Qm=eh(Xm()),Gx=eh(Zm()),Ux=e=>e===0?0:e<32||e>=127&&e<160?-1:(0,Gx.default)(e,Qm.default,Qm.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));Fr.default=Ux});var th=P(Gr=>{"use strict";p();var Nx=Gr&&Gr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gr,"__esModule",{value:!0});var Vx=Nx(fo()),Hx=e=>{let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),n=(0,Vx.default)(i);if(n<0)return-1;t+=n}return t};Gr.default=Hx});var ih=P(kt=>{"use strict";p();var rh=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kt,"__esModule",{value:!0});kt.wcswidth=kt.wcwidth=void 0;var Wx=rh(th());kt.wcswidth=Wx.default;var Kx=rh(fo());kt.wcwidth=Kx.default});var _o=P(Ct=>{"use strict";p();Object.defineProperty(Ct,"__esModule",{value:!0});Ct.findWidthInConsole=Ct.stripAnsi=void 0;var Yx=ih(),Jx=/\x1b\[\d{1,3}(;\d{1,3})*m/g,Xx=e=>e.replace(Jx,"");Ct.stripAnsi=Xx;var Zx=(e,t)=>{let r=0;return e=(0,Ct.stripAnsi)(e),t&&Object.entries(t).forEach(([i,n])=>{let s=new RegExp(i,"g");r+=(e.match(s)||[]).length*n,e=e.replace(i,"")}),r+=(0,Yx.wcswidth)(e),r};Ct.findWidthInConsole=Zx});var qo=P(Ye=>{"use strict";p();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.biggestWordInSentence=Ye.textWithPadding=Ye.splitTextIntoTextsOfMinLen=void 0;var bo=_o(),Qx=(e,t,r)=>{let i=[];return e.split(/[\n\r]/).forEach(s=>{let a=s.split(" "),o=[],c=0;a.forEach(d=>{let u=(0,bo.findWidthInConsole)(d,r);c+u<=t?(c+=u+1,o.push(d)):(o.length>0&&i.push(o.join(" ")),o=[d],c=u+1)}),i.push(o.join(" "))}),i};Ye.splitTextIntoTextsOfMinLen=Qx;var e0=(e,t,r,i)=>{let n=(0,bo.findWidthInConsole)(e,i),s=Math.floor((r-n)/2),a=r-s-n;if(r<n){let o=(0,Ye.splitTextIntoTextsOfMinLen)(e,r);return o.length===1?e:o.map(c=>(0,Ye.textWithPadding)(c,t,r,i)).join(`
30
+ `)}switch(t){case"left":return e.concat(" ".repeat(r-n));case"center":return" ".repeat(s).concat(e).concat(" ".repeat(a));default:return" ".repeat(r-n).concat(e)}};Ye.textWithPadding=e0;var t0=(e,t)=>e.split(" ").reduce((r,i)=>Math.max(r,(0,bo.findWidthInConsole)(i,t)),0);Ye.biggestWordInSentence=t0});var Ur=P(V=>{"use strict";p();Object.defineProperty(V,"__esModule",{value:!0});V.getWidthLimitedColumnsArray=V.createHeaderAsRow=V.renderTableHorizontalBorders=V.findLenOfColumn=V.createRow=V.createColumFromOnlyName=V.createTableHorizontalBorders=V.convertRawRowOptionsToStandard=V.evaluateCellText=V.cellText=void 0;var nh=_o(),ko=qo(),vo=Mr(),nr=(e,t)=>Math.max(e,t),r0=e=>e==null?"":`${e}`;V.cellText=r0;var i0=(e,t)=>t?`${t(e)}`:(0,V.cellText)(e);V.evaluateCellText=i0;var n0=e=>{if(e)return{color:e.color,separator:e.separator||vo.DEFAULT_ROW_SEPARATOR}};V.convertRawRowOptionsToStandard=n0;var s0=({left:e,mid:t,right:r,other:i},n)=>{let s=e;return n.forEach(a=>{s+=i.repeat(a+2),s+=t}),s=s.slice(0,-t.length),s+=r,s};V.createTableHorizontalBorders=s0;var a0=e=>({name:e,title:e});V.createColumFromOnlyName=a0;var o0=(e,t,r)=>({color:e,separator:r,text:t});V.createRow=o0;var p0=(e,t,r)=>{let i=e.name,n=e.title,s=e.transform,a=nr(0,e.minLen||0);return e.maxLen?(a=nr(a,nr(e.maxLen,(0,ko.biggestWordInSentence)(n,r))),a=t.reduce((o,c)=>nr(o,(0,ko.biggestWordInSentence)((0,V.evaluateCellText)(c.text[i],s),r)),a),a):(a=nr(a,(0,nh.findWidthInConsole)(n,r)),t.forEach(o=>{a=nr(a,(0,nh.findWidthInConsole)((0,V.evaluateCellText)(o.text[i],s),r))}),a)};V.findLenOfColumn=p0;var c0=(e,t)=>(0,V.createTableHorizontalBorders)(e,t);V.renderTableHorizontalBorders=c0;var d0=(e,t)=>{let r=vo.DEFAULT_HEADER_FONT_COLOR,i=e(r,{},!1);return t.forEach(n=>{i.text[n.name]=n.title}),i};V.createHeaderAsRow=d0;var u0=(e,t,r)=>{let i={};return e.forEach(n=>{i[n.name]=(0,ko.splitTextIntoTextsOfMinLen)((0,V.cellText)(t.text[n.name]),n.length||vo.DEFAULT_COLUMN_LEN,r)}),i};V.getWidthLimitedColumnsArray=u0});var sh=P(ot=>{"use strict";p();Object.defineProperty(ot,"__esModule",{value:!0});ot.rawColumnToInternalColumn=ot.objIfExists=void 0;var l0=Mr(),m0=(e,t)=>t?{[e]:t}:{};ot.objIfExists=m0;var h0=(e,t)=>{var r;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(r=e.title)!==null&&r!==void 0?r:e.name},(0,ot.objIfExists)("color",e.color||t?.color)),(0,ot.objIfExists)("maxLen",e.maxLen||t?.maxLen)),(0,ot.objIfExists)("minLen",e.minLen||t?.minLen)),{alignment:e.alignment||t?.alignment||l0.DEFAULT_ROW_ALIGNMENT,transform:e.transform})};ot.rawColumnToInternalColumn=h0});var ah=P(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.preProcessRows=sr.preProcessColumns=void 0;var y0=Ur(),g0=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.columns.some(i=>i.name===t.name)||(e.addColumn(Object.assign(Object.assign({},t),e.defaultColumnOptions)),e.rows.forEach((i,n,s)=>{let a=s.map(o=>o.text);i.text[t.name]=t.function(i.text,n,a)}))})},f0=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},_0=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},b0=e=>{e.columns.forEach(t=>{t.length=(0,y0.findLenOfColumn)(t,e.rows,e.charLength)})},q0=e=>{g0(e),_0(e),f0(e),b0(e)};sr.preProcessColumns=q0;var k0=e=>{let t=e.rows.filter(r=>e.filterFunction(r.text)).sort((r,i)=>e.sortFunction(r.text,i.text));e.rows=t};sr.preProcessRows=k0});var wo=P(Ee=>{"use strict";p();var ph=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.printSimpleTable=Ee.renderSimpleTable=Ee.renderTable=void 0;var ch=ph(ho()),dh=qo(),De=Mr(),vt=Ur(),v0=ph(xo()),oh=ah(),w0=(e,t,r,i,n,s,a,o)=>{let c=new ch.default(a);return c.addCharsWithColor("",e.vertical),t.forEach(d=>{let l=r<i[d.name].length?(0,vt.cellText)(i[d.name][r]):"";c.addCharsWithColor(De.DEFAULT_ROW_FONT_COLOR," "),c.addCharsWithColor(n&&De.DEFAULT_HEADER_FONT_COLOR||d.color||s.color,(0,dh.textWithPadding)(l,d.alignment||De.DEFAULT_ROW_ALIGNMENT,d.length||De.DEFAULT_COLUMN_LEN,o)),c.addCharsWithColor("",` ${e.vertical}`)}),c.renderConsole()},uh=(e,t,r,i,n,s)=>{let a=(0,vt.getWidthLimitedColumnsArray)(t,r,s),o=Object.values(a).reduce((d,u)=>Math.max(d,u.length),0),c=[];for(let d=0;d<o;d+=1){let u=w0(e,t,d,a,n,r,i,s);c.push(u)}return c},x0=(e,t)=>{let r=Object.assign(Object.assign({},e),{text:Object.assign({},e.text)}),i={};return t.filter(n=>!!n.transform).forEach(n=>{i[n.name]=n.transform}),Object.keys(i).forEach(n=>{r.text[n]=i[n](r.text[n])}),r},S0=(e,t)=>{let r=[],i=x0(t,e.columns);return r=r.concat(uh(e.tableStyle,e.columns,i,e.colorMap,void 0,e.charLength)),r},$0=e=>{let t=[];if(e.title===void 0)return t;let r=()=>{let s=(a,o)=>a+o+2+1;return e.columns.map(a=>a.length||De.DEFAULT_COLUMN_LEN).reduce(s,1)},i=(0,dh.textWithPadding)(e.title,De.DEFAULT_HEADER_ALIGNMENT,r()),n=new ch.default(e.colorMap);return n.addCharsWithColor(De.DEFAULT_HEADER_FONT_COLOR,i),t.push(n.renderConsole()),t},A0=e=>{let t=[];t.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(i=>i.length||De.DEFAULT_COLUMN_LEN)));let r=(0,vt.createHeaderAsRow)(vt.createRow,e.columns);return t=t.concat(uh(e.tableStyle,e.columns,r,e.colorMap,!0)),t.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(i=>i.length||De.DEFAULT_COLUMN_LEN))),t},E0=e=>{let t=[];return t.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(r=>r.length||De.DEFAULT_COLUMN_LEN))),t},j0=(e,t)=>{let r=[],i=e.rows.length-1;return e.rows.indexOf(t)!==i&&t.separator&&r.push((0,vt.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(s=>s.length||De.DEFAULT_COLUMN_LEN))),r},P0=e=>{(0,oh.preProcessColumns)(e),(0,oh.preProcessRows)(e);let t=[];return $0(e).forEach(r=>t.push(r)),A0(e).forEach(r=>t.push(r)),e.rows.forEach(r=>{S0(e,r).forEach(i=>t.push(i)),j0(e,r).forEach(i=>t.push(i))}),E0(e).forEach(r=>t.push(r)),t.join(`
31
+ `)};Ee.renderTable=P0;var T0=(e,t)=>{let r=new v0.default(t);return r.addRows(e),(0,Ee.renderTable)(r)};Ee.renderSimpleTable=T0;var C0=(e,t)=>{console.log((0,Ee.renderSimpleTable)(e,t))};Ee.printSimpleTable=C0});var xo=P(Eo=>{"use strict";p();Object.defineProperty(Eo,"__esModule",{value:!0});var R0=ho(),Ln=Mr(),So=Ur(),$o=sh(),I0=wo(),O0=()=>0,D0=()=>!0,Ao=class{initSimple(t){this.columns=t.map(r=>({name:r,title:r,alignment:Ln.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var r;this.title=t.title||this.title,this.tableStyle=Object.assign(Object.assign({},this.tableStyle),t.style),this.sortFunction=t.sort||this.sortFunction,this.filterFunction=t.filter||this.filterFunction,this.enabledColumns=t.enabledColumns||this.enabledColumns,this.disabledColumns=t.disabledColumns||this.disabledColumns,this.computedColumns=t.computedColumns||this.computedColumns,this.columns=((r=t.columns)===null||r===void 0?void 0:r.map(i=>(0,$o.rawColumnToInternalColumn)(i,t.defaultColumnOptions)))||this.columns,this.rowSeparator=t.rowSeparator||this.rowSeparator,this.charLength=t.charLength||this.charLength,this.defaultColumnOptions=t.defaultColumnOptions||this.defaultColumnOptions,t.shouldDisableColors?this.colorMap={}:t.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Ln.DEFAULT_TABLE_STYLE,this.filterFunction=D0,this.sortFunction=O0,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Ln.DEFAULT_ROW_SEPARATOR,this.colorMap=R0.DEFAULT_COLOR_MAP,this.charLength={},this.defaultColumnOptions=void 0,this.transforms={},t instanceof Array?this.initSimple(t):typeof t=="object"&&t!==null&&this.initDetailed(t)}createColumnFromRow(t){let r=this.columns.map(i=>i.name);Object.keys(t).forEach(i=>{r.includes(i)||this.columns.push((0,$o.rawColumnToInternalColumn)((0,So.createColumFromOnlyName)(i),this.defaultColumnOptions))})}addColumn(t){let r=typeof t=="string"?(0,So.createColumFromOnlyName)(t):t;this.columns.push((0,$o.rawColumnToInternalColumn)(r,this.defaultColumnOptions))}addColumns(t){t.forEach(r=>{this.addColumn(r)})}addRow(t,r){this.createColumnFromRow(t),this.rows.push((0,So.createRow)(r?.color||Ln.DEFAULT_ROW_FONT_COLOR,t,r?.separator!==void 0?r.separator:this.rowSeparator))}addRows(t,r){t.forEach(i=>{this.addRow(i,r)})}clearRows(){this.rows=[]}renderTable(){return(0,I0.renderTable)(this)}};Eo.default=Ao});var mh=P(Nr=>{"use strict";p();var L0=Nr&&Nr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nr,"__esModule",{value:!0});var B0=L0(xo()),lh=Ur(),jo=class{constructor(t){this.table=new B0.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,r){return this.table.addRow(t,(0,lh.convertRawRowOptionsToStandard)(r)),this}addRows(t,r){return this.table.addRows(t,(0,lh.convertRawRowOptionsToStandard)(r)),this}clearRows(){return this.table.clearRows(),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Nr.default=jo});var Vr=P(Je=>{"use strict";p();var z0=Je&&Je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Je,"__esModule",{value:!0});Je.renderTable=Je.printTable=Je.Table=void 0;var M0=z0(mh());Je.Table=M0.default;var hh=wo();Object.defineProperty(Je,"printTable",{enumerable:!0,get:function(){return hh.printSimpleTable}});Object.defineProperty(Je,"renderTable",{enumerable:!0,get:function(){return hh.renderSimpleTable}})});p();p();var ep=L(Qo(),1),{program:q$,createCommand:k$,createArgument:v$,createOption:w$,CommanderError:x$,InvalidArgumentError:S$,InvalidOptionArgumentError:$$,Command:tp,Argument:A$,Option:rp,Help:E$}=ep.default;var Iy=L(J(),1);p();import me from"fs";import ce from"path";import{fileURLToPath as Ex}from"url";p();p();import{styleText as _s}from"util";import{stdout as bs,stdin as kp}from"process";import*as dt from"readline";import xg from"readline";p();p();p();p();var sp=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),ap=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,op=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var cg=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,dg=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,pp=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,ug=/\t{1,1000}/y,cp=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),lg=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,mg=new RegExp("\\p{M}+","gu"),hg={limit:1/0,ellipsis:""},dp=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?dp(n,hg,r).width:0),a=0,o=r.controlWidth??0,c=r.tabWidth??8,d=r.emojiWidth??2,u=2,l=r.regularWidth??1,h=r.wideWidth??u,y=[[lg,l],[cg,a],[dg,o],[ug,c],[cp,d],[pp,h]],g=0,b=0,$=e.length,S=0,A=!1,q=$,O=Math.max(0,i-s),E=0,N=0,R=0,B=0;e:for(;;){if(N>E||b>=$&&b>g){let z=e.slice(E,N)||e.slice(g,b);S=0;for(let Y of z.replaceAll(mg,"")){let j=Y.codePointAt(0)||0;if(ap(j)?B=u:op(j)?B=h:B=l,R+B>O&&(q=Math.min(q,Math.max(E,g)+S)),R+B>i){A=!0;break e}S+=Y.length,R+=B}E=N=0}if(b>=$)break e;for(let z=0,Y=y.length;z<Y;z++){let[j,Xe]=y[z];if(j.lastIndex=b,j.test(e)){if(S=j===pp?sp(e.slice(b,j.lastIndex)):j===cp?1:j.lastIndex-b,B=S*Xe,R+B>O&&(q=Math.min(q,b+Math.floor((O-R)/Xe))),R+B>i){A=!0;break e}R+=B,E=g,N=b,b=g=j.lastIndex;continue e}}b+=1}return{width:A?O:R,index:A?q:$,truncated:A,ellipsed:A&&i>=s}},up=dp;var yg={limit:1/0,ellipsis:"",ellipsisWidth:0},gg=(e,t={})=>up(e,yg,t).width,le=gg;var ci="\x1B",gp="\x9B",fg=39,hs="\x07",fp="[",_g="]",_p="m",ys=`${_g}8;;`,lp=new RegExp(`(?:\\${fp}(?<code>\\d+)m|\\${ys}(?<uri>.*)${hs})`,"y"),mp=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},hp=e=>`${ci}${fp}${e}${_p}`,yp=e=>`${ci}${ys}${e}${hs}`,ms=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,a=e.at(-1),o=a===void 0?0:le(a),c=i.next(),d=i.next(),u=0;for(;!c.done;){let l=c.value,h=le(l);o+h<=r?e[e.length-1]+=l:(e.push(l),o=0),(l===ci||l===gp)&&(n=!0,s=t.startsWith(ys,u+1)),n?s?l===hs&&(n=!1,s=!1):l===_p&&(n=!1):(o+=h,o===r&&!d.done&&(e.push(""),o=0)),c=d,d=i.next(),u+=l.length}a=e.at(-1),!o&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},bg=e=>{let t=e.split(" "),r=t.length;for(;r&&!le(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},qg=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,a=e.split(" "),o=[""],c=0;for(let l=0;l<a.length;l++){let h=a[l];if(r.trim!==!1){let g=o.at(-1)??"",b=g.trimStart();g.length!==b.length&&(o[o.length-1]=b,c=le(b))}l!==0&&(c>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),c=0),(c||r.trim===!1)&&(o[o.length-1]+=" ",c++));let y=le(h);if(r.hard&&y>t){let g=t-c,b=1+Math.floor((y-g-1)/t);Math.floor((y-1)/t)<b&&o.push(""),ms(o,h,t),c=le(o.at(-1)??"");continue}if(c+y>t&&c&&y){if(r.wordWrap===!1&&c<t){ms(o,h,t),c=le(o.at(-1)??"");continue}o.push(""),c=0}if(c+y>t&&r.wordWrap===!1){ms(o,h,t),c=le(o.at(-1)??"");continue}o[o.length-1]+=h,c+=y}r.trim!==!1&&(o=o.map(l=>bg(l)));let d=o.join(`
32
+ `),u=!1;for(let l=0;l<d.length;l++){let h=d[l];if(i+=h,u)u=!1;else if(u=h>="\uD800"&&h<="\uDBFF",u)continue;if(h===ci||h===gp){lp.lastIndex=l+1;let g=lp.exec(d)?.groups;if(g?.code!==void 0){let b=Number.parseFloat(g.code);n=b===fg?void 0:b}else g?.uri!==void 0&&(s=g.uri.length===0?void 0:g.uri)}if(d[l+1]===`
33
33
  `){s&&(i+=yp(""));let y=n?mp(n):void 0;n&&y&&(i+=hp(y))}else h===`
34
- `&&(n&&mp(n)&&(i+=hp(n)),s&&(i+=yp(s)))}return i},qg=/\r?\n/;function ze(e,t,r){return String(e).normalize().split(qg).map(i=>bg(i,t,r)).join(`
35
- `)}var oe=L(fs(),1);import{ReadStream as qp}from"tty";function ui(e,t,r){if(!r.some(a=>!a.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),s=i<0?n:i>n?0:i;return r[s]?.disabled?ui(s,t<0?-1:1,r):s}var xg=["up","down","left","right","space","enter","cancel"],Sg=["January","February","March","April","May","June","July","August","September","October","November","December"],te={actions:new Set(xg),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,accessible:void 0,date:{monthNames:[...Sg],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function $g(e){if(e!==void 0)return e;if(te.accessible!==void 0)return te.accessible;let t=process.env.ACCESSIBLE;return t!==void 0&&t!==""&&t!=="0"&&t!=="false"}function qs(e,t){if(typeof e=="string")return te.aliases.get(e)===t;for(let r of e)if(r!==void 0&&qs(r,t))return!0;return!1}function Ag(e,t){if(e===t)return;let r=e.split(`
34
+ `&&(n&&mp(n)&&(i+=hp(n)),s&&(i+=yp(s)))}return i},kg=/\r?\n/;function ze(e,t,r){return String(e).normalize().split(kg).map(i=>qg(i,t,r)).join(`
35
+ `)}var oe=L(fs(),1);import{ReadStream as qp}from"tty";function ui(e,t,r){if(!r.some(a=>!a.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),s=i<0?n:i>n?0:i;return r[s]?.disabled?ui(s,t<0?-1:1,r):s}var Sg=["up","down","left","right","space","enter","cancel"],$g=["January","February","March","April","May","June","July","August","September","October","November","December"],te={actions:new Set(Sg),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,accessible:void 0,date:{monthNames:[...$g],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function Ag(e){if(e!==void 0)return e;if(te.accessible!==void 0)return te.accessible;let t=process.env.ACCESSIBLE;return t!==void 0&&t!==""&&t!=="0"&&t!=="false"}function qs(e,t){if(typeof e=="string")return te.aliases.get(e)===t;for(let r of e)if(r!==void 0&&qs(r,t))return!0;return!1}function Eg(e,t){if(e===t)return;let r=e.split(`
36
36
  `),i=t.split(`
37
- `),n=Math.max(r.length,i.length),s=[];for(let a=0;a<n;a++)r[a]!==i[a]&&s.push(a);return{lines:s,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var Eg=globalThis.process.platform.startsWith("win"),li=Symbol("clack:cancel");function F(e){return e===li}function di(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function vp({input:e=kp,output:t=bs,overwrite:r=!0,hideCursor:i=!0}={}){let n=dt.createInterface({input:e,output:t,prompt:"",tabSize:1});dt.emitKeypressEvents(e,n),e instanceof qp&&e.isTTY&&e.setRawMode(!0);let s=(a,{name:o,sequence:c})=>{let d=String(a);if(qs([d,o,c],"cancel")){i&&t.write(oe.cursor.show),process.exit(0);return}if(!r)return;dt.moveCursor(t,o==="return"?0:-1,o==="return"?-1:0,()=>{dt.clearLine(t,1,()=>{e.once("keypress",s)})})};return i&&t.write(oe.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),i&&t.write(oe.cursor.show),e instanceof qp&&e.isTTY&&!Eg&&e.setRawMode(!1),n.terminal=!1,n.close()}}var fr=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,ks=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function _r(e,t,r,i=r,n=r,s){let a=fr(e??bs);return ze(t,a-r.length,{hard:!0,trim:!1}).split(`
37
+ `),n=Math.max(r.length,i.length),s=[];for(let a=0;a<n;a++)r[a]!==i[a]&&s.push(a);return{lines:s,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var jg=globalThis.process.platform.startsWith("win"),li=Symbol("clack:cancel");function F(e){return e===li}function di(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function vp({input:e=kp,output:t=bs,overwrite:r=!0,hideCursor:i=!0}={}){let n=dt.createInterface({input:e,output:t,prompt:"",tabSize:1});dt.emitKeypressEvents(e,n),e instanceof qp&&e.isTTY&&e.setRawMode(!0);let s=(a,{name:o,sequence:c})=>{let d=String(a);if(qs([d,o,c],"cancel")){i&&t.write(oe.cursor.show),process.exit(0);return}if(!r)return;dt.moveCursor(t,o==="return"?0:-1,o==="return"?-1:0,()=>{dt.clearLine(t,1,()=>{e.once("keypress",s)})})};return i&&t.write(oe.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),i&&t.write(oe.cursor.show),e instanceof qp&&e.isTTY&&!jg&&e.setRawMode(!1),n.terminal=!1,n.close()}}var fr=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,ks=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function _r(e,t,r,i=r,n=r,s){let a=fr(e??bs);return ze(t,a-r.length,{hard:!0,trim:!1}).split(`
38
38
  `).map((o,c,d)=>{let u=s?s(o,c):o;return c===0?`${i}${u}`:c===d.length-1?`${n}${u}`:`${r}${u}`}).join(`
39
- `)}function wp(e,t){if("~standard"in e){let r=e["~standard"].validate(t);return r instanceof Promise?r.then(i=>i.issues?.at(0)?.message):r.issues?.at(0)?.message}return e(t)}var It=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";get accessible(){return $g(this.opts.accessible)}constructor(t,r=!0){let{input:i=kp,output:n=bs,render:s,signal:a,...o}=t;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=a,this.input=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let i=this._subscribers.get(t)??[];i.push(r),this._subscribers.set(t,i)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let i=this._subscribers.get(t)??[],n=[];for(let s of i)s.cb(...r),s.once&&n.push(()=>i.splice(i.indexOf(s),1));for(let s of n)s()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(li);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=wg.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),di(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(oe.cursor.show),this.output.off("resize",this.render),di(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(oe.cursor.show),this.output.off("resize",this.render),di(this.input,!1),t(li)})})}_isActionKey(t,r){return t===" "}_shouldSubmit(t,r){return!0}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,r){this.userInput=t??"",this.emit("userInput",this.userInput),r&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}async onKeypress(t,r){if(this.state!=="validating"){if(this._track&&r.name!=="return"&&(r.name&&this._isActionKey(t,r)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&te.aliases.has(r.name)&&this.emit("cursor",te.aliases.get(r.name)),te.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t,r),r?.name==="return"&&this._shouldSubmit(t,r)){if(this.opts.validate){let i=wp(this.opts.validate,this.value),n;i instanceof Promise?(this.state="validating",this.render(),n=await i):n=i,n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}qs([t,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
39
+ `)}function wp(e,t){if("~standard"in e){let r=e["~standard"].validate(t);return r instanceof Promise?r.then(i=>i.issues?.at(0)?.message):r.issues?.at(0)?.message}return e(t)}var It=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";get accessible(){return Ag(this.opts.accessible)}constructor(t,r=!0){let{input:i=kp,output:n=bs,render:s,signal:a,...o}=t;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=a,this.input=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let i=this._subscribers.get(t)??[];i.push(r),this._subscribers.set(t,i)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let i=this._subscribers.get(t)??[],n=[];for(let s of i)s.cb(...r),s.once&&n.push(()=>i.splice(i.indexOf(s),1));for(let s of n)s()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(li);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=xg.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),di(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(oe.cursor.show),this.output.off("resize",this.render),di(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(oe.cursor.show),this.output.off("resize",this.render),di(this.input,!1),t(li)})})}_isActionKey(t,r){return t===" "}_shouldSubmit(t,r){return!0}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,r){this.userInput=t??"",this.emit("userInput",this.userInput),r&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}async onKeypress(t,r){if(this.state!=="validating"){if(this._track&&r.name!=="return"&&(r.name&&this._isActionKey(t,r)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&te.aliases.has(r.name)&&this.emit("cursor",te.aliases.get(r.name)),te.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t,r),r?.name==="return"&&this._shouldSubmit(t,r)){if(this.opts.validate){let i=wp(this.opts.validate,this.value),n;i instanceof Promise?(this.state="validating",this.render(),n=await i):n=i,n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}qs([t,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
40
40
  `),di(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=ze(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
41
- `).length-1;this.output.write(oe.cursor.move(-999,t*-1))}render(){let t=ze(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(oe.cursor.hide);else{let r=Ag(this._prevFrame,t),i=ks(this.output);if(this.restoreCursor(),r){let n=Math.max(0,r.numLinesAfter-i),s=Math.max(0,r.numLinesBefore-i),a=r.lines.find(o=>o>=n);if(a===void 0){this._prevFrame=t;return}if(r.lines.length===1){this.output.write(oe.cursor.move(0,a-s)),this.output.write(oe.erase.lines(1));let o=t.split(`
41
+ `).length-1;this.output.write(oe.cursor.move(-999,t*-1))}render(){let t=ze(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(oe.cursor.hide);else{let r=Eg(this._prevFrame,t),i=ks(this.output);if(this.restoreCursor(),r){let n=Math.max(0,r.numLinesAfter-i),s=Math.max(0,r.numLinesBefore-i),a=r.lines.find(o=>o>=n);if(a===void 0){this._prevFrame=t;return}if(r.lines.length===1){this.output.write(oe.cursor.move(0,a-s)),this.output.write(oe.erase.lines(1));let o=t.split(`
42
42
  `);this.output.write(o[a]),this._prevFrame=t,this.output.write(oe.cursor.move(0,o.length-a-1));return}else if(r.lines.length>1){if(n<s)a=n;else{let c=a-s;c>0&&this.output.write(oe.cursor.move(0,c))}this.output.write(oe.erase.down());let o=t.split(`
43
43
  `).slice(a);this.output.write(o.join(`
44
- `)),this._prevFrame=t;return}}this.output.write(oe.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var mi=class extends It{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(oe.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var xp=class extends It{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${_s(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor,this.cursor+1),s=r.slice(this.cursor+1);return`${i}${_s("inverse",n)}${s}`}clear(){this._clearUserInput()}constructor({mask:t,...r}){super(r),this._mask=t??"\u2022",this.on("userInput",i=>{this._setValue(i)}),this.on("finalize",()=>{this.value===void 0&&(this.value="")})}},Sp=class extends It{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let t=this._selectedValue;this.value=t===void 0?void 0:t.value}constructor(t){super(t,!1),this.options=t.options;let r=this.options.findIndex(({value:n})=>n===t.initialValue),i=r===-1?0:r;this.cursor=this.options[i]?.disabled?ui(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=ui(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ui(this.cursor,1,this.options);break}this.changeValue()})}};var hi=class extends It{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),i=t.slice(this.cursor,this.cursor+1),n=t.slice(this.cursor+1);return`${r}${_s("inverse",i)}${n}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as f,stripVTControlCharacters as cA}from"util";import xe from"process";var br=L(fs(),1);import{existsSync as hA,lstatSync as yA,readdirSync as gA}from"fs";import{dirname as _A,join as bA}from"path";function jg(){return xe.platform!=="win32"?xe.env.TERM!=="linux":!!xe.env.CI||!!xe.env.WT_SESSION||!!xe.env.TERMINUS_SUBLIME||xe.env.ConEmuTask==="{cmd::Cmder}"||xe.env.TERM_PROGRAM==="Terminus-Sublime"||xe.env.TERM_PROGRAM==="vscode"||xe.env.TERM==="xterm-256color"||xe.env.TERM==="alacritty"||xe.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var vs=jg(),Pg=()=>process.env.CI==="true";var G=(e,t)=>vs?e:t,$p=G("\u25C6","*"),jp=G("\u25A0","x"),Pp=G("\u25B2","x"),fi=G("\u25C7","o"),Tg=G("\u250C","T"),T=G("\u2502","|"),Me=G("\u2514","\u2014"),qA=G("\u2510","T"),kA=G("\u2518","\u2014"),ws=G("\u25CF",">"),gi=G("\u25CB"," "),vA=G("\u25FB","[\u2022]"),wA=G("\u25FC","[+]"),xA=G("\u25FB","[ ]"),Cg=G("\u25AA","\u2022"),Ap=G("\u2500","-"),Rg=G("\u256E","+"),Ig=G("\u251C","+"),Og=G("\u256F","+"),Dg=G("\u2570","+"),SA=G("\u256D","+"),Lg=G("\u25CF","\u2022"),Bg=G("\u25C6","*"),zg=G("\u25B2","!"),Mg=G("\u25A0","x"),_i=e=>{switch(e){case"initial":case"active":return f("cyan",$p);case"cancel":return f("red",jp);case"error":return f("yellow",Pp);case"submit":return f("green",fi);case"validating":return f("dim",$p)}},Fg=e=>{switch(e){case"initial":case"active":return f("cyan",T);case"cancel":return f("red",T);case"error":return f("yellow",T);case"submit":return f("green",T)}};function Gg(e,t){let r=[`${t?`${f("cyan",T)} `:""}${e.join(" \u2022 ")}`];return t&&r.push(f("cyan",Me)),r}var Ep=(e,t,r,i,n,s=!1)=>{let a=t,o=0;if(s)for(let c=i-1;c>=r;c--){let d=e[c];if(d&&(a-=d.length),o++,a<=n)break}else for(let c=r;c<i;c++){let d=e[c];if(d&&(a-=d.length),o++,a<=n)break}return{lineCount:a,removals:o}},Ug=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{let o=fr(i)-s,c=ks(i),d=f("dim","..."),u=Math.max(c-a,0),l=Math.max(Math.min(n,u),5),h=0;e>=l-3&&(h=Math.max(Math.min(e-l+3,t.length-l),0));let y=l<t.length&&h>0,g=l<t.length&&h+l<t.length,b=Math.min(h+l,t.length),$=[],S=0;y&&S++,g&&S++;let A=h+(y?1:0),q=b-(g?1:0);for(let E=A;E<q;E++){let N=t[E],R=N?r(N,E===e):"",B=ze(R,o,{hard:!0,trim:!1}).split(`
44
+ `)),this._prevFrame=t;return}}this.output.write(oe.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var mi=class extends It{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(oe.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var xp=class extends It{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${_s(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor,this.cursor+1),s=r.slice(this.cursor+1);return`${i}${_s("inverse",n)}${s}`}clear(){this._clearUserInput()}constructor({mask:t,...r}){super(r),this._mask=t??"\u2022",this.on("userInput",i=>{this._setValue(i)}),this.on("finalize",()=>{this.value===void 0&&(this.value="")})}},Sp=class extends It{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let t=this._selectedValue;this.value=t===void 0?void 0:t.value}constructor(t){super(t,!1),this.options=t.options;let r=this.options.findIndex(({value:n})=>n===t.initialValue),i=r===-1?0:r;this.cursor=this.options[i]?.disabled?ui(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=ui(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ui(this.cursor,1,this.options);break}this.changeValue()})}};var hi=class extends It{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),i=t.slice(this.cursor,this.cursor+1),n=t.slice(this.cursor+1);return`${r}${_s("inverse",i)}${n}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as f,stripVTControlCharacters as dA}from"util";import xe from"process";var br=L(fs(),1);import{existsSync as yA,lstatSync as gA,readdirSync as fA}from"fs";import{dirname as bA,join as qA}from"path";function Pg(){return xe.platform!=="win32"?xe.env.TERM!=="linux":!!xe.env.CI||!!xe.env.WT_SESSION||!!xe.env.TERMINUS_SUBLIME||xe.env.ConEmuTask==="{cmd::Cmder}"||xe.env.TERM_PROGRAM==="Terminus-Sublime"||xe.env.TERM_PROGRAM==="vscode"||xe.env.TERM==="xterm-256color"||xe.env.TERM==="alacritty"||xe.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var vs=Pg(),Tg=()=>process.env.CI==="true";var G=(e,t)=>vs?e:t,$p=G("\u25C6","*"),jp=G("\u25A0","x"),Pp=G("\u25B2","x"),fi=G("\u25C7","o"),Cg=G("\u250C","T"),T=G("\u2502","|"),Me=G("\u2514","\u2014"),kA=G("\u2510","T"),vA=G("\u2518","\u2014"),ws=G("\u25CF",">"),gi=G("\u25CB"," "),wA=G("\u25FB","[\u2022]"),xA=G("\u25FC","[+]"),SA=G("\u25FB","[ ]"),Rg=G("\u25AA","\u2022"),Ap=G("\u2500","-"),Ig=G("\u256E","+"),Og=G("\u251C","+"),Dg=G("\u256F","+"),Lg=G("\u2570","+"),$A=G("\u256D","+"),Bg=G("\u25CF","\u2022"),zg=G("\u25C6","*"),Mg=G("\u25B2","!"),Fg=G("\u25A0","x"),_i=e=>{switch(e){case"initial":case"active":return f("cyan",$p);case"cancel":return f("red",jp);case"error":return f("yellow",Pp);case"submit":return f("green",fi);case"validating":return f("dim",$p)}},Gg=e=>{switch(e){case"initial":case"active":return f("cyan",T);case"cancel":return f("red",T);case"error":return f("yellow",T);case"submit":return f("green",T)}};function Ug(e,t){let r=[`${t?`${f("cyan",T)} `:""}${e.join(" \u2022 ")}`];return t&&r.push(f("cyan",Me)),r}var Ep=(e,t,r,i,n,s=!1)=>{let a=t,o=0;if(s)for(let c=i-1;c>=r;c--){let d=e[c];if(d&&(a-=d.length),o++,a<=n)break}else for(let c=r;c<i;c++){let d=e[c];if(d&&(a-=d.length),o++,a<=n)break}return{lineCount:a,removals:o}},Ng=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{let o=fr(i)-s,c=ks(i),d=f("dim","..."),u=Math.max(c-a,0),l=Math.max(Math.min(n,u),5),h=0;e>=l-3&&(h=Math.max(Math.min(e-l+3,t.length-l),0));let y=l<t.length&&h>0,g=l<t.length&&h+l<t.length,b=Math.min(h+l,t.length),$=[],S=0;y&&S++,g&&S++;let A=h+(y?1:0),q=b-(g?1:0);for(let E=A;E<q;E++){let N=t[E],R=N?r(N,E===e):"",B=ze(R,o,{hard:!0,trim:!1}).split(`
45
45
  `);$.push(B),S+=B.length}if(S>u){let E=0,N=0,R=S,B=e-A,z=u,Y=()=>Ep($,R,0,B,z),j=()=>Ep($,R,B+1,$.length,z,!0);y?({lineCount:R,removals:E}=Y(),R>z&&(g||(z-=1),{lineCount:R,removals:N}=j())):(g||(z-=1),{lineCount:R,removals:N}=j(),R>z&&(z-=1,{lineCount:R,removals:E}=Y())),E>0&&(y=!0,$.splice(0,E)),N>0&&(g=!0,$.splice($.length-N,N))}let O=[];y&&O.push(d);for(let E of $)for(let N of E)O.push(N);return g&&O.push(d),O};var ut=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new mi({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??te.withGuide,n=`${_i(this.state)} `,s=i?`${f("gray",T)} `:"",a=_r(e.output,e.message,s,n),o=`${i?`${f("gray",T)}
46
46
  `:""}${a}
47
47
  `,c=this.value?t:r;switch(this.state){case"submit":{let d=i?`${f("gray",T)} `:"";return`${o}${d}${f("dim",c)}`}case"cancel":{let d=i?`${f("gray",T)} `:"";return`${o}${d}${f(["strikethrough","dim"],c)}${i?`
@@ -49,23 +49,23 @@ ${f("gray",T)}`:""}`}default:{let d=i?`${f("cyan",T)} `:"",u=i?f("cyan",Me):"";
49
49
  ${f("cyan",T)} `:`
50
50
  `:` ${f("dim","/")} `}${this.value?`${f("dim",gi)} ${f("dim",r)}`:`${f("green",ws)} ${r}`}
51
51
  ${u}
52
- `}}}}).prompt()};var $A=[`${f("dim","\u2191/\u2193")} to navigate`,`${f("dim","Space:")} select`,`${f("dim","Enter:")} confirm`];var k={message:(e=[],{symbol:t=f("gray",T),secondarySymbol:r=f("gray",T),output:i=process.stdout,spacing:n=1,withGuide:s}={})=>{let a=[],o=s??te.withGuide,c=o?r:"",d=o?`${t} `:"",u=o?`${r} `:"";for(let h=0;h<n;h++)a.push(c);let l=Array.isArray(e)?e:e.split(`
52
+ `}}}}).prompt()};var AA=[`${f("dim","\u2191/\u2193")} to navigate`,`${f("dim","Space:")} select`,`${f("dim","Enter:")} confirm`];var k={message:(e=[],{symbol:t=f("gray",T),secondarySymbol:r=f("gray",T),output:i=process.stdout,spacing:n=1,withGuide:s}={})=>{let a=[],o=s??te.withGuide,c=o?r:"",d=o?`${t} `:"",u=o?`${r} `:"";for(let h=0;h<n;h++)a.push(c);let l=Array.isArray(e)?e:e.split(`
53
53
  `);if(l.length>0){let[h,...y]=l;h.length>0?a.push(`${d}${h}`):a.push(o?t:"");for(let g of y)g.length>0?a.push(`${u}${g}`):a.push(o?r:"")}i.write(`${a.join(`
54
54
  `)}
55
- `)},info:(e,t)=>{k.message(e,{...t,symbol:f("blue",Lg)})},success:(e,t)=>{k.message(e,{...t,symbol:f("green",Bg)})},step:(e,t)=>{k.message(e,{...t,symbol:f("green",fi)})},warn:(e,t)=>{k.message(e,{...t,symbol:f("yellow",zg)})},warning:(e,t)=>{k.warn(e,t)},error:(e,t)=>{k.message(e,{...t,symbol:f("red",Mg)})}},C=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??te.withGuide?`${f("gray",Me)} `:"";r.write(`${i}${f("red",e)}
55
+ `)},info:(e,t)=>{k.message(e,{...t,symbol:f("blue",Bg)})},success:(e,t)=>{k.message(e,{...t,symbol:f("green",zg)})},step:(e,t)=>{k.message(e,{...t,symbol:f("green",fi)})},warn:(e,t)=>{k.message(e,{...t,symbol:f("yellow",Mg)})},warning:(e,t)=>{k.warn(e,t)},error:(e,t)=>{k.message(e,{...t,symbol:f("red",Fg)})}},C=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??te.withGuide?`${f("gray",Me)} `:"";r.write(`${i}${f("red",e)}
56
56
 
57
- `)},bi=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??te.withGuide?`${f("gray",Tg)} `:"";r.write(`${i}${e}
57
+ `)},bi=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??te.withGuide?`${f("gray",Cg)} `:"";r.write(`${i}${e}
58
58
  `)},Ot=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??te.withGuide?`${f("gray",T)}
59
59
  ${f("gray",Me)} `:"";r.write(`${i}${e}
60
60
 
61
- `)};var Ng=e=>e,Vg=(e,t,r)=>{let i={hard:!0,trim:!1},n=ze(e,t,i).split(`
62
- `),s=n.reduce((c,d)=>Math.max(le(d),c),0),a=n.map(r).reduce((c,d)=>Math.max(le(d),c),0),o=t-(a-s);return ze(e,o,i)},H=(e="",t="",r)=>{let i=r?.output??xe.stdout,n=r?.withGuide??te.withGuide,s=r?.format??Ng,a=["",...Vg(e,fr(i)-6,s).split(`
61
+ `)};var Vg=e=>e,Hg=(e,t,r)=>{let i={hard:!0,trim:!1},n=ze(e,t,i).split(`
62
+ `),s=n.reduce((c,d)=>Math.max(le(d),c),0),a=n.map(r).reduce((c,d)=>Math.max(le(d),c),0),o=t-(a-s);return ze(e,o,i)},H=(e="",t="",r)=>{let i=r?.output??xe.stdout,n=r?.withGuide??te.withGuide,s=r?.format??Vg,a=["",...Hg(e,fr(i)-6,s).split(`
63
63
  `).map(s),""],o=le(t),c=Math.max(a.reduce((h,y)=>{let g=le(y);return g>h?g:h},0),o)+2,d=a.map(h=>`${f("gray",T)} ${h}${" ".repeat(c-le(h))}${f("gray",T)}`).join(`
64
64
  `),u=n?`${f("gray",T)}
65
- `:"",l=n?Ig:Dg;i.write(`${u}${f("green",fi)} ${f("reset",t)} ${f("gray",Ap.repeat(Math.max(c-o-1,1))+Rg)}
65
+ `:"",l=n?Og:Lg;i.write(`${u}${f("green",fi)} ${f("reset",t)} ${f("gray",Ap.repeat(Math.max(c-o-1,1))+Ig)}
66
66
  ${d}
67
- ${f("gray",l+Ap.repeat(c+2)+Og)}
68
- `)},qi=e=>new xp({validate:e.validate,mask:e.mask??Cg,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??te.withGuide,r=`${t?`${f("gray",T)}
67
+ ${f("gray",l+Ap.repeat(c+2)+Dg)}
68
+ `)},qi=e=>new xp({validate:e.validate,mask:e.mask??Rg,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??te.withGuide,r=`${t?`${f("gray",T)}
69
69
  `:""}${_i(this.state)} ${e.message}
70
70
  `,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let s=t?`${f("yellow",T)} `:"",a=t?`${f("yellow",Me)} `:"",o=n??"";return e.clearOnError&&this.clear(),`${r.trim()}
71
71
  ${s}${o}
@@ -73,23 +73,23 @@ ${a}${f("yellow",this.error)}
73
73
  `}case"submit":{let s=t?`${f("gray",T)} `:"",a=n?f("dim",n):"";return`${r}${s}${a}`}case"cancel":{let s=t?`${f("gray",T)} `:"",a=n?f(["strikethrough","dim"],n):"";return`${r}${s}${a}${n&&t?`
74
74
  ${f("gray",T)}`:""}`}default:{let s=t?`${f("cyan",T)} `:"",a=t?f("cyan",Me):"";return`${r}${s}${i}
75
75
  ${a}
76
- `}}}}).prompt();var Hg=e=>f("magenta",e),M=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:i,errorMessage:n,frames:s=vs?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=vs?80:120,signal:o,...c}={})=>{let d=Pg(),u,l,h=!1,y=!1,g="",b,$=performance.now(),S=fr(r),A=c?.styleFrame??Hg,q=K=>{let he=K>1?n??te.messages.error:i??te.messages.cancel;y=K===1,h&&(Pe(he,K),y&&typeof t=="function"&&t())},O=()=>q(2),E=()=>q(1),N=()=>{process.on("uncaughtExceptionMonitor",O),process.on("unhandledRejection",O),process.on("SIGINT",E),process.on("SIGTERM",E),process.on("exit",q),o&&o.addEventListener("abort",E)},R=()=>{process.removeListener("uncaughtExceptionMonitor",O),process.removeListener("unhandledRejection",O),process.removeListener("SIGINT",E),process.removeListener("SIGTERM",E),process.removeListener("exit",q),o&&o.removeEventListener("abort",E)},B=()=>{if(b===void 0)return;d&&r.write(`
76
+ `}}}}).prompt();var Wg=e=>f("magenta",e),M=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:i,errorMessage:n,frames:s=vs?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=vs?80:120,signal:o,...c}={})=>{let d=Tg(),u,l,h=!1,y=!1,g="",b,$=performance.now(),S=fr(r),A=c?.styleFrame??Wg,q=K=>{let he=K>1?n??te.messages.error:i??te.messages.cancel;y=K===1,h&&(Pe(he,K),y&&typeof t=="function"&&t())},O=()=>q(2),E=()=>q(1),N=()=>{process.on("uncaughtExceptionMonitor",O),process.on("unhandledRejection",O),process.on("SIGINT",E),process.on("SIGTERM",E),process.on("exit",q),o&&o.addEventListener("abort",E)},R=()=>{process.removeListener("uncaughtExceptionMonitor",O),process.removeListener("unhandledRejection",O),process.removeListener("SIGINT",E),process.removeListener("SIGTERM",E),process.removeListener("exit",q),o&&o.removeEventListener("abort",E)},B=()=>{if(b===void 0)return;d&&r.write(`
77
77
  `);let K=ze(b,S,{hard:!0,trim:!1}).split(`
78
78
  `);K.length>1&&r.write(br.cursor.up(K.length-1)),r.write(br.cursor.to(0)),r.write(br.erase.down())},z=K=>K.replace(/\.+$/,""),Y=K=>{let he=(performance.now()-K)/1e3,Ze=Math.floor(he/60),Qe=Math.floor(he%60);return Ze>0?`[${Ze}m ${Qe}s]`:`[${Qe}s]`},j=c.withGuide??te.withGuide,Xe=(K="")=>{h=!0,u=vp({output:r}),g=z(K),$=performance.now(),j&&r.write(`${f("gray",T)}
79
- `);let he=0,Ze=0;N(),l=setInterval(()=>{if(d&&g===b)return;B(),b=g;let Qe=A(s[he]),ii;if(d)ii=`${Qe} ${g}...`;else if(e==="timer")ii=`${Qe} ${g} ${Y($)}`;else{let Oy=".".repeat(Math.floor(Ze)).slice(0,3);ii=`${Qe} ${g}${Oy}`}let Iy=ze(ii,S,{hard:!0,trim:!1});r.write(Iy),he=he+1<s.length?he+1:0,Ze=Ze<4?Ze+.125:0},a)},Pe=(K="",he=0,Ze=!1)=>{if(!h)return;h=!1,clearInterval(l),B();let Qe=he===0?f("green",fi):he===1?f("red",jp):f("red",Pp);g=K??g,Ze||(e==="timer"?r.write(`${Qe} ${g} ${Y($)}
79
+ `);let he=0,Ze=0;N(),l=setInterval(()=>{if(d&&g===b)return;B(),b=g;let Qe=A(s[he]),ii;if(d)ii=`${Qe} ${g}...`;else if(e==="timer")ii=`${Qe} ${g} ${Y($)}`;else{let Dy=".".repeat(Math.floor(Ze)).slice(0,3);ii=`${Qe} ${g}${Dy}`}let Oy=ze(ii,S,{hard:!0,trim:!1});r.write(Oy),he=he+1<s.length?he+1:0,Ze=Ze<4?Ze+.125:0},a)},Pe=(K="",he=0,Ze=!1)=>{if(!h)return;h=!1,clearInterval(l),B();let Qe=he===0?f("green",fi):he===1?f("red",jp):f("red",Pp);g=K??g,Ze||(e==="timer"?r.write(`${Qe} ${g} ${Y($)}
80
80
  `):r.write(`${Qe} ${g}
81
- `)),R(),u()};return{start:Xe,stop:(K="")=>Pe(K,0),message:(K="")=>{g=z(K??g)},cancel:(K="")=>Pe(K,1),error:(K="")=>Pe(K,2),clear:()=>Pe("",0,!0),get isCancelled(){return y}}},AA={light:G("\u2500","-"),heavy:G("\u2501","="),block:G("\u2588","#")};var Wg=[`${f("dim","\u2191/\u2193")} to navigate`,`${f("dim","Enter:")} confirm`],yi=(e,t)=>e.includes(`
81
+ `)),R(),u()};return{start:Xe,stop:(K="")=>Pe(K,0),message:(K="")=>{g=z(K??g)},cancel:(K="")=>Pe(K,1),error:(K="")=>Pe(K,2),clear:()=>Pe("",0,!0),get isCancelled(){return y}}},EA={light:G("\u2500","-"),heavy:G("\u2501","="),block:G("\u2588","#")};var Kg=[`${f("dim","\u2191/\u2193")} to navigate`,`${f("dim","Enter:")} confirm`],yi=(e,t)=>e.includes(`
82
82
  `)?e.split(`
83
83
  `).map(r=>t(r)).join(`
84
- `):t(e),ki=e=>{let t=(i,n)=>{if(i===void 0)return"";let s=i.label??String(i.value);switch(n){case"disabled":return`${f("gray",gi)} ${yi(s,a=>f("gray",a))}${i.hint?` ${f("dim",`(${i.hint??"disabled"})`)}`:""}`;case"selected":return`${yi(s,a=>f("dim",a))}`;case"active":return`${f("green",ws)} ${s}${i.hint?` ${f("dim",`(${i.hint})`)}`:""}`;case"cancelled":return`${yi(s,a=>f(["strikethrough","dim"],a))}`;default:return`${f("dim",gi)} ${yi(s,a=>f("dim",a))}`}},r=e.showInstructions??!0;return new Sp({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let i=e.withGuide??te.withGuide,n=`${_i(this.state)} `,s=`${Fg(this.state)} `,a=_r(e.output,e.message,s,n),o=`${i?`${f("gray",T)}
84
+ `):t(e),ki=e=>{let t=(i,n)=>{if(i===void 0)return"";let s=i.label??String(i.value);switch(n){case"disabled":return`${f("gray",gi)} ${yi(s,a=>f("gray",a))}${i.hint?` ${f("dim",`(${i.hint??"disabled"})`)}`:""}`;case"selected":return`${yi(s,a=>f("dim",a))}`;case"active":return`${f("green",ws)} ${s}${i.hint?` ${f("dim",`(${i.hint})`)}`:""}`;case"cancelled":return`${yi(s,a=>f(["strikethrough","dim"],a))}`;default:return`${f("dim",gi)} ${yi(s,a=>f("dim",a))}`}},r=e.showInstructions??!0;return new Sp({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let i=e.withGuide??te.withGuide,n=`${_i(this.state)} `,s=`${Gg(this.state)} `,a=_r(e.output,e.message,s,n),o=`${i?`${f("gray",T)}
85
85
  `:""}${a}
86
86
  `;switch(this.state){case"submit":{let c=i?`${f("gray",T)} `:"",d=_r(e.output,t(this.options[this.cursor],"selected"),c);return`${o}${d}`}case"cancel":{let c=i?`${f("gray",T)} `:"",d=_r(e.output,t(this.options[this.cursor],"cancelled"),c);return`${o}${d}${i?`
87
87
  ${f("gray",T)}`:""}`}default:{let c=i?`${f("cyan",T)} `:"",d=o.split(`
88
- `).length,u=r?Gg(Wg,i):i?[f("cyan",Me)]:[],l=u.join(`
89
- `),h=u.length+1;return`${o}${c}${Ug({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:c.length,rowPadding:d+h,style:(y,g)=>t(y,y.disabled?"disabled":g?"active":"inactive")}).join(`
88
+ `).length,u=r?Ug(Kg,i):i?[f("cyan",Me)]:[],l=u.join(`
89
+ `),h=u.length+1;return`${o}${c}${Ng({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:c.length,rowPadding:d+h,style:(y,g)=>t(y,y.disabled?"disabled":g?"active":"inactive")}).join(`
90
90
  ${c}`)}
91
91
  ${l}
92
- `}}}}).prompt()};var EA=`${f("gray",T)} `;var ye=e=>new hi({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??te.withGuide,r=`${`${t?`${f("gray",T)}
92
+ `}}}}).prompt()};var jA=`${f("gray",T)} `;var ye=e=>new hi({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??te.withGuide,r=`${`${t?`${f("gray",T)}
93
93
  `:""}${_i(this.state)} `}${e.message}
94
94
  `,i=e.placeholder&&e.placeholder.length>0?f("inverse",e.placeholder[0])+f("dim",e.placeholder.slice(1)):f(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,s=this.value??"";switch(this.state){case"validating":{let a=t?`${f("cyan",T)} `:"",o=t?f("cyan",Me):"",c=f("dim",n),d=f("dim","Validating...");return`${r}${a}${c}
95
95
  ${o} ${d}
@@ -99,59 +99,59 @@ ${c}${a}
99
99
  `}case"submit":{let a=s?`${t?" ":""}${f("dim",s)}`:"",o=t?f("gray",T):"";return`${r}${o}${a}`}case"cancel":{let a=s?` ${f(["strikethrough","dim"],s)}`:"",o=t?f("gray",T):"";return`${r}${o}${a}${s.trim()?`
100
100
  ${o}`:""}`}default:{let a=t?`${f("cyan",T)} `:"",o=t?f("cyan",Me):"";return`${r}${a}${n}
101
101
  ${o}
102
- `}}}}).prompt();p();p();p();function ee(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}p();p();import{fileURLToPath as Kg}from"url";var Dt=(e,t)=>{let r=Ss(Yg(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Yg=e=>xs(e)?e.toString():e,xs=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Ss=e=>e instanceof URL?Kg(e):e;var vi=(e,t=[],r={})=>{let i=Dt(e,"First argument"),[n,s]=ee(t)?[[],t]:[t,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let a=n.map(String),o=a.find(c=>c.includes("\0"));if(o!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${o}`);if(!ee(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[i,a,s]};p();import{ChildProcess as rf}from"child_process";p();import{StringDecoder as Jg}from"string_decoder";var{toString:Tp}=Object.prototype,Cp=e=>Tp.call(e)==="[object ArrayBuffer]",se=e=>Tp.call(e)==="[object Uint8Array]",tt=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Xg=new TextEncoder,Rp=e=>Xg.encode(e),Zg=new TextDecoder,wi=e=>Zg.decode(e),Ip=(e,t)=>Qg(e,t).join(""),Qg=(e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;let r=new Jg(t),i=e.map(s=>typeof s=="string"?Rp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},qr=e=>e.length===1&&se(e[0])?e[0]:$s(ef(e)),ef=e=>e.map(t=>typeof t=="string"?Rp(t):t),$s=e=>{let t=new Uint8Array(tf(e)),r=0;for(let i of e)t.set(i,r),r+=i.length;return t},tf=e=>{let t=0;for(let r of e)t+=r.length;return t};var Bp=e=>Array.isArray(e)&&Array.isArray(e.raw),zp=(e,t)=>{let r=[];for(let[s,a]of e.entries())r=nf({templates:e,expressions:t,tokens:r,index:s,template:a});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return[i,n,{}]},nf=({templates:e,expressions:t,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[i]}`);let{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:o}=sf(n,e.raw[i]),c=Dp(r,s,a);if(i===t.length)return c;let d=t[i],u=Array.isArray(d)?d.map(l=>Lp(l)):[Lp(d)];return Dp(c,u,o)},sf=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],i=0,n=Op.has(t[0]);for(let a=0,o=0;a<e.length;a+=1,o+=1){let c=t[o];if(Op.has(c))i!==a&&r.push(e.slice(i,a)),i=a+1;else if(c==="\\"){let d=t[o+1];d===`
103
- `?(a-=1,o+=1):d==="u"&&t[o+2]==="{"?o=t.indexOf("}",o+3):o+=af[d]??1}}let s=i===e.length;return s||r.push(e.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},Op=new Set([" "," ","\r",`
104
- `]),af={x:3,u:5},Dp=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Lp=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(ee(e)&&("stdout"in e||"isMaxBuffer"in e))return of(e);throw e instanceof rf||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},of=({stdout:e})=>{if(typeof e=="string")return e;if(se(e))return wi(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};p();import{spawnSync as uv}from"child_process";p();p();p();p();import{debuglog as pf}from"util";p();import As from"process";var Te=e=>xi.includes(e),xi=[As.stdin,As.stdout,As.stderr],Se=["stdin","stdout","stderr"],Si=e=>Se[e]??`stdio[${e}]`;var Fp=e=>{let t={...e};for(let r of Ps)t[r]=Es(e,r);return t},Es=(e,t)=>{let r=Array.from({length:cf(e)+1}),i=df(e[t],r,t);return yf(i,t)},cf=({stdio:e})=>Array.isArray(e)?Math.max(e.length,Se.length):Se.length,df=(e,t,r)=>ee(e)?uf(e,t,r):t.fill(e),uf=(e,t,r)=>{for(let i of Object.keys(e).sort(lf))for(let n of mf(i,r,t))t[n]=e[i];return t},lf=(e,t)=>Mp(e)<Mp(t)?1:-1,Mp=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,mf=(e,t,r)=>{if(e==="ipc")return[r.length-1];let i=js(e);if(i===void 0||i===0)throw new TypeError(`"${t}.${e}" is invalid.
102
+ `}}}}).prompt();p();p();p();function ee(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}p();p();import{fileURLToPath as Yg}from"url";var Dt=(e,t)=>{let r=Ss(Jg(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Jg=e=>xs(e)?e.toString():e,xs=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Ss=e=>e instanceof URL?Yg(e):e;var vi=(e,t=[],r={})=>{let i=Dt(e,"First argument"),[n,s]=ee(t)?[[],t]:[t,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let a=n.map(String),o=a.find(c=>c.includes("\0"));if(o!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${o}`);if(!ee(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[i,a,s]};p();import{ChildProcess as nf}from"child_process";p();import{StringDecoder as Xg}from"string_decoder";var{toString:Tp}=Object.prototype,Cp=e=>Tp.call(e)==="[object ArrayBuffer]",se=e=>Tp.call(e)==="[object Uint8Array]",tt=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Zg=new TextEncoder,Rp=e=>Zg.encode(e),Qg=new TextDecoder,wi=e=>Qg.decode(e),Ip=(e,t)=>ef(e,t).join(""),ef=(e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;let r=new Xg(t),i=e.map(s=>typeof s=="string"?Rp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},qr=e=>e.length===1&&se(e[0])?e[0]:$s(tf(e)),tf=e=>e.map(t=>typeof t=="string"?Rp(t):t),$s=e=>{let t=new Uint8Array(rf(e)),r=0;for(let i of e)t.set(i,r),r+=i.length;return t},rf=e=>{let t=0;for(let r of e)t+=r.length;return t};var Bp=e=>Array.isArray(e)&&Array.isArray(e.raw),zp=(e,t)=>{let r=[];for(let[s,a]of e.entries())r=sf({templates:e,expressions:t,tokens:r,index:s,template:a});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return[i,n,{}]},sf=({templates:e,expressions:t,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[i]}`);let{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:o}=af(n,e.raw[i]),c=Dp(r,s,a);if(i===t.length)return c;let d=t[i],u=Array.isArray(d)?d.map(l=>Lp(l)):[Lp(d)];return Dp(c,u,o)},af=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],i=0,n=Op.has(t[0]);for(let a=0,o=0;a<e.length;a+=1,o+=1){let c=t[o];if(Op.has(c))i!==a&&r.push(e.slice(i,a)),i=a+1;else if(c==="\\"){let d=t[o+1];d===`
103
+ `?(a-=1,o+=1):d==="u"&&t[o+2]==="{"?o=t.indexOf("}",o+3):o+=of[d]??1}}let s=i===e.length;return s||r.push(e.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},Op=new Set([" "," ","\r",`
104
+ `]),of={x:3,u:5},Dp=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Lp=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(ee(e)&&("stdout"in e||"isMaxBuffer"in e))return pf(e);throw e instanceof nf||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},pf=({stdout:e})=>{if(typeof e=="string")return e;if(se(e))return wi(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};p();import{spawnSync as lv}from"child_process";p();p();p();p();import{debuglog as cf}from"util";p();import As from"process";var Te=e=>xi.includes(e),xi=[As.stdin,As.stdout,As.stderr],Se=["stdin","stdout","stderr"],Si=e=>Se[e]??`stdio[${e}]`;var Fp=e=>{let t={...e};for(let r of Ps)t[r]=Es(e,r);return t},Es=(e,t)=>{let r=Array.from({length:df(e)+1}),i=uf(e[t],r,t);return gf(i,t)},df=({stdio:e})=>Array.isArray(e)?Math.max(e.length,Se.length):Se.length,uf=(e,t,r)=>ee(e)?lf(e,t,r):t.fill(e),lf=(e,t,r)=>{for(let i of Object.keys(e).sort(mf))for(let n of hf(i,r,t))t[n]=e[i];return t},mf=(e,t)=>Mp(e)<Mp(t)?1:-1,Mp=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,hf=(e,t,r)=>{if(e==="ipc")return[r.length-1];let i=js(e);if(i===void 0||i===0)throw new TypeError(`"${t}.${e}" is invalid.
105
105
  It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(i>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
106
- Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},js=e=>{if(e==="all")return e;if(Se.includes(e))return Se.indexOf(e);let t=hf.exec(e);if(t!==null)return Number(t[1])},hf=/^fd(\d+)$/,yf=(e,t)=>e.map(r=>r===void 0?ff[t]:r),gf=pf("execa").enabled?"full":"none",ff={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:gf,stripFinalNewline:!0},Ps=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],rt=(e,t)=>t==="ipc"?e.at(-1):e[t];var Lt=({verbose:e},t)=>Ts(e,t)!=="none",Bt=({verbose:e},t)=>!["none","short"].includes(Ts(e,t)),Gp=({verbose:e},t)=>{let r=Ts(e,t);return $i(r)?r:void 0},Ts=(e,t)=>t===void 0?_f(e):rt(e,t),_f=e=>e.find(t=>$i(t))??Ai.findLast(t=>e.includes(t)),$i=e=>typeof e=="function",Ai=["none","short","full"];p();import{inspect as Mf}from"util";p();import{platform as bf}from"process";import{stripVTControlCharacters as qf}from"util";var Up=(e,t)=>{let r=[e,...t],i=r.join(" "),n=r.map(s=>$f(Np(s))).join(" ");return{command:i,escapedCommand:n}},kr=e=>qf(e).split(`
106
+ Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},js=e=>{if(e==="all")return e;if(Se.includes(e))return Se.indexOf(e);let t=yf.exec(e);if(t!==null)return Number(t[1])},yf=/^fd(\d+)$/,gf=(e,t)=>e.map(r=>r===void 0?_f[t]:r),ff=cf("execa").enabled?"full":"none",_f={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ff,stripFinalNewline:!0},Ps=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],rt=(e,t)=>t==="ipc"?e.at(-1):e[t];var Lt=({verbose:e},t)=>Ts(e,t)!=="none",Bt=({verbose:e},t)=>!["none","short"].includes(Ts(e,t)),Gp=({verbose:e},t)=>{let r=Ts(e,t);return $i(r)?r:void 0},Ts=(e,t)=>t===void 0?bf(e):rt(e,t),bf=e=>e.find(t=>$i(t))??Ai.findLast(t=>e.includes(t)),$i=e=>typeof e=="function",Ai=["none","short","full"];p();import{inspect as Ff}from"util";p();import{platform as qf}from"process";import{stripVTControlCharacters as kf}from"util";var Up=(e,t)=>{let r=[e,...t],i=r.join(" "),n=r.map(s=>Af(Np(s))).join(" ");return{command:i,escapedCommand:n}},kr=e=>kf(e).split(`
107
107
  `).map(t=>Np(t)).join(`
108
- `),Np=e=>e.replaceAll(wf,t=>kf(t)),kf=e=>{let t=xf[e];if(t!==void 0)return t;let r=e.codePointAt(0),i=r.toString(16);return r<=Sf?`\\u${i.padStart(4,"0")}`:`\\U${i}`},vf=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},wf=vf(),xf={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Sf=65535,$f=e=>Af.test(e)?e:bf==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,Af=/^[\w./-]+$/;p();p();p();import Vp from"process";function Cs(){let{env:e}=Vp,{TERM:t,TERM_PROGRAM:r}=e;return Vp.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Hp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Wp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Ef={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},jf={...Hp,...Wp},Pf={...Hp,...Ef},Tf=Cs(),Cf=Tf?jf:Pf,Ei=Cf,mE=Object.entries(Wp);p();import Rf from"tty";var If=Rf?.WriteStream?.prototype?.hasColors?.()??!1,w=(e,t)=>{if(!If)return n=>n;let r=`\x1B[${e}m`,i=`\x1B[${t}m`;return n=>{let s=n+"",a=s.indexOf(i);if(a===-1)return r+s+i;let o=r,c=0,u=(t===22?i:"")+r;for(;a!==-1;)o+=s.slice(c,a)+u,c=a+i.length,a=s.indexOf(i,c);return o+=s.slice(c)+i,o}},fE=w(0,0),Kp=w(1,22),_E=w(2,22),bE=w(3,23),qE=w(4,24),kE=w("4:2",24),vE=w("4:3",24),wE=w("4:4",24),xE=w("4:5",24),SE=w(53,55),$E=w(7,27),AE=w(8,28),EE=w(9,29),jE=w(30,39),PE=w(31,39),TE=w(32,39),CE=w(33,39),RE=w(34,39),IE=w(35,39),OE=w(36,39),DE=w(37,39),ji=w(90,39),LE=w(40,49),BE=w(41,49),zE=w(42,49),ME=w(43,49),FE=w(44,49),GE=w(45,49),UE=w(46,49),NE=w(47,49),VE=w(100,49),Yp=w(91,39),HE=w(92,39),Jp=w(93,39),WE=w(94,39),KE=w(95,39),YE=w(96,39),JE=w(97,39),XE=w(101,49),ZE=w(102,49),QE=w(103,49),ej=w(104,49),tj=w(105,49),rj=w(106,49),ij=w(107,49),nj=w("58;5;0",59),sj=w("58;5;1",59),aj=w("58;5;2",59),oj=w("58;5;3",59),pj=w("58;5;4",59),cj=w("58;5;5",59),dj=w("58;5;6",59),uj=w("58;5;7",59),lj=w("58;5;8",59),mj=w("58;5;9",59),hj=w("58;5;10",59),yj=w("58;5;11",59),gj=w("58;5;12",59),fj=w("58;5;13",59),_j=w("58;5;14",59),bj=w("58;5;15",59);var Qp=({type:e,message:t,timestamp:r,piped:i,commandId:n,result:{failed:s=!1}={},options:{reject:a=!0}})=>{let o=Of(r),c=Df[e]({failed:s,reject:a,piped:i}),d=Lf[e]({reject:a});return`${ji(`[${o}]`)} ${ji(`[${n}]`)} ${d(c)} ${d(t)}`},Of=e=>`${Pi(e.getHours(),2)}:${Pi(e.getMinutes(),2)}:${Pi(e.getSeconds(),2)}.${Pi(e.getMilliseconds(),3)}`,Pi=(e,t)=>String(e).padStart(t,"0"),Xp=({failed:e,reject:t})=>e?t?Ei.cross:Ei.warning:Ei.tick,Df={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Xp,duration:Xp},Zp=e=>e,Lf={command:()=>Kp,output:()=>Zp,ipc:()=>Zp,error:({reject:e})=>e?Yp:Jp,duration:()=>ji};p();var ec=(e,t,r)=>{let i=Gp(t,r);return e.map(({verboseLine:n,verboseObject:s})=>Bf(n,s,i)).filter(n=>n!==void 0).map(n=>zf(n)).join("")},Bf=(e,t,r)=>{if(r===void 0)return e;let i=r(e,t);if(typeof i=="string")return i},zf=e=>e.endsWith(`
108
+ `),Np=e=>e.replaceAll(xf,t=>vf(t)),vf=e=>{let t=Sf[e];if(t!==void 0)return t;let r=e.codePointAt(0),i=r.toString(16);return r<=$f?`\\u${i.padStart(4,"0")}`:`\\U${i}`},wf=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},xf=wf(),Sf={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},$f=65535,Af=e=>Ef.test(e)?e:qf==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,Ef=/^[\w./-]+$/;p();p();p();import Vp from"process";function Cs(){let{env:e}=Vp,{TERM:t,TERM_PROGRAM:r}=e;return Vp.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Hp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Wp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},jf={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Pf={...Hp,...Wp},Tf={...Hp,...jf},Cf=Cs(),Rf=Cf?Pf:Tf,Ei=Rf,hE=Object.entries(Wp);p();import If from"tty";var Of=If?.WriteStream?.prototype?.hasColors?.()??!1,w=(e,t)=>{if(!Of)return n=>n;let r=`\x1B[${e}m`,i=`\x1B[${t}m`;return n=>{let s=n+"",a=s.indexOf(i);if(a===-1)return r+s+i;let o=r,c=0,u=(t===22?i:"")+r;for(;a!==-1;)o+=s.slice(c,a)+u,c=a+i.length,a=s.indexOf(i,c);return o+=s.slice(c)+i,o}},_E=w(0,0),Kp=w(1,22),bE=w(2,22),qE=w(3,23),kE=w(4,24),vE=w("4:2",24),wE=w("4:3",24),xE=w("4:4",24),SE=w("4:5",24),$E=w(53,55),AE=w(7,27),EE=w(8,28),jE=w(9,29),PE=w(30,39),TE=w(31,39),CE=w(32,39),RE=w(33,39),IE=w(34,39),OE=w(35,39),DE=w(36,39),LE=w(37,39),ji=w(90,39),BE=w(40,49),zE=w(41,49),ME=w(42,49),FE=w(43,49),GE=w(44,49),UE=w(45,49),NE=w(46,49),VE=w(47,49),HE=w(100,49),Yp=w(91,39),WE=w(92,39),Jp=w(93,39),KE=w(94,39),YE=w(95,39),JE=w(96,39),XE=w(97,39),ZE=w(101,49),QE=w(102,49),ej=w(103,49),tj=w(104,49),rj=w(105,49),ij=w(106,49),nj=w(107,49),sj=w("58;5;0",59),aj=w("58;5;1",59),oj=w("58;5;2",59),pj=w("58;5;3",59),cj=w("58;5;4",59),dj=w("58;5;5",59),uj=w("58;5;6",59),lj=w("58;5;7",59),mj=w("58;5;8",59),hj=w("58;5;9",59),yj=w("58;5;10",59),gj=w("58;5;11",59),fj=w("58;5;12",59),_j=w("58;5;13",59),bj=w("58;5;14",59),qj=w("58;5;15",59);var Qp=({type:e,message:t,timestamp:r,piped:i,commandId:n,result:{failed:s=!1}={},options:{reject:a=!0}})=>{let o=Df(r),c=Lf[e]({failed:s,reject:a,piped:i}),d=Bf[e]({reject:a});return`${ji(`[${o}]`)} ${ji(`[${n}]`)} ${d(c)} ${d(t)}`},Df=e=>`${Pi(e.getHours(),2)}:${Pi(e.getMinutes(),2)}:${Pi(e.getSeconds(),2)}.${Pi(e.getMilliseconds(),3)}`,Pi=(e,t)=>String(e).padStart(t,"0"),Xp=({failed:e,reject:t})=>e?t?Ei.cross:Ei.warning:Ei.tick,Lf={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Xp,duration:Xp},Zp=e=>e,Bf={command:()=>Kp,output:()=>Zp,ipc:()=>Zp,error:({reject:e})=>e?Yp:Jp,duration:()=>ji};p();var ec=(e,t,r)=>{let i=Gp(t,r);return e.map(({verboseLine:n,verboseObject:s})=>zf(n,s,i)).filter(n=>n!==void 0).map(n=>Mf(n)).join("")},zf=(e,t,r)=>{if(r===void 0)return e;let i=r(e,t);if(typeof i=="string")return i},Mf=e=>e.endsWith(`
109
109
  `)?e:`${e}
110
- `;var Fe=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:i,result:n})=>{let s=Ff({type:e,result:n,verboseInfo:i}),a=Gf(t,s),o=ec(a,i,r);o!==""&&console.warn(o.slice(0,-1))},Ff=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=!1,...s}}})=>({type:e,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:t,options:s}),Gf=(e,t)=>e.split(`
111
- `).map(r=>Uf({...t,message:r})),Uf=e=>({verboseLine:Qp(e),verboseObject:e}),Ti=e=>{let t=typeof e=="string"?e:Mf(e);return kr(t).replaceAll(" "," ".repeat(Nf))},Nf=2;var tc=(e,t)=>{Lt(t)&&Fe({type:"command",verboseMessage:e,verboseInfo:t})};p();var rc=(e,t,r)=>{Wf(e);let i=Vf(e);return{verbose:e,escapedCommand:t,commandId:i,rawOptions:r}},Vf=e=>Lt({verbose:e})?Hf++:void 0,Hf=0n,Wf=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Ai.includes(t)&&!$i(t)){let r=Ai.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};p();import{hrtime as ic}from"process";var Ci=()=>ic.bigint(),Rs=e=>Number(ic.bigint()-e)/1e6;var Ri=(e,t,r)=>{let i=Ci(),{command:n,escapedCommand:s}=Up(e,t),a=Es(r,"verbose"),o=rc(a,s,{...r});return tc(s,o),{command:n,escapedCommand:s,startTime:i,verboseInfo:o}};p();var ru=L(Vc(),1);import Pb from"path";import tu from"process";p();import Li from"process";import xt from"path";p();function Oi(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}p();import{promisify as q_}from"util";import{execFile as k_,execFileSync as jP}from"child_process";import Hc from"path";import{fileURLToPath as v_}from"url";var CP=q_(k_);function Di(e){return e instanceof URL?v_(e):e}function Wc(e){return{*[Symbol.iterator](){let t=Hc.resolve(Di(e)),r;for(;r!==t;)yield t,r=t,t=Hc.resolve(t,"..")}}}var RP=10*1024*1024;var w_=({cwd:e=Li.cwd(),path:t=Li.env[Oi()],preferLocal:r=!0,execPath:i=Li.execPath,addExecPath:n=!0}={})=>{let s=xt.resolve(Di(e)),a=[],o=t.split(xt.delimiter);return r&&x_(a,o,s),n&&S_(a,o,i,s),t===""||t===xt.delimiter?`${a.join(xt.delimiter)}${t}`:[...a,t].join(xt.delimiter)},x_=(e,t,r)=>{for(let i of Wc(r)){let n=xt.join(i,"node_modules/.bin");t.includes(n)||e.push(n)}},S_=(e,t,r,i)=>{let n=xt.resolve(i,Di(r),"..");t.includes(n)||e.push(n)},Kc=({env:e=Li.env,...t}={})=>{e={...e};let r=Oi({env:e});return t.path=e[r],e[r]=w_(t),e};p();import{setTimeout as M_}from"timers/promises";p();var Yc=(e,t,r)=>{let i=r?wr:vr,n=e instanceof Ce?{}:{cause:e};return new i(t,n)},Ce=class extends Error{},Jc=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Zc,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Xc=e=>Bi(e)&&Zc in e,Zc=Symbol("isExecaError"),Bi=e=>Object.prototype.toString.call(e)==="[object Error]",vr=class extends Error{};Jc(vr,vr.name);var wr=class extends Error{};Jc(wr,wr.name);p();import{constants as xr}from"os";p();import{constants as j_}from"os";p();var Qc=()=>{let e=td-ed+1;return Array.from({length:e},$_)},$_=(e,t)=>({name:`SIGRT${t+1}`,number:ed+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ed=34,td=64;p();import{constants as A_}from"os";p();var rd=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Us=()=>{let e=Qc();return[...rd,...e].map(E_)},E_=({name:e,number:t,description:r,action:i,forced:n=!1,standard:s})=>{let{signals:{[e]:a}}=A_,o=a!==void 0;return{name:e,number:o?a:t,description:r,supported:o,action:i,forced:n,standard:s}};var P_=()=>{let e=Us();return Object.fromEntries(e.map(T_))},T_=({name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a})=>[e,{name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a}],id=P_(),C_=()=>{let e=Us(),t=65,r=Array.from({length:t},(i,n)=>R_(n,e));return Object.assign({},...r)},R_=(e,t)=>{let r=I_(e,t);if(r===void 0)return{};let{name:i,description:n,supported:s,action:a,forced:o,standard:c}=r;return{[e]:{name:i,number:e,description:n,supported:s,action:a,forced:o,standard:c}}},I_=(e,t)=>{let r=t.find(({name:i})=>j_.signals[i]===e);return r!==void 0?r:t.find(i=>i.number===e)},rT=C_();var sd=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return od(e,t)},ad=e=>e===0?e:od(e,"`subprocess.kill()`'s argument"),od=(e,t)=>{if(Number.isInteger(e))return O_(e,t);if(typeof e=="string")return L_(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
112
- ${Ns()}`)},O_=(e,t)=>{if(nd.has(e))return nd.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
113
- ${Ns()}`)},D_=()=>new Map(Object.entries(xr.signals).reverse().map(([e,t])=>[t,e])),nd=D_(),L_=(e,t)=>{if(e in xr.signals)return e;throw e.toUpperCase()in xr.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
114
- ${Ns()}`)},Ns=()=>`Available signal names: ${B_()}.
115
- Available signal numbers: ${z_()}.`,B_=()=>Object.keys(xr.signals).sort().map(e=>`'${e}'`).join(", "),z_=()=>[...new Set(Object.values(xr.signals).sort((e,t)=>e-t))].join(", "),zi=e=>id[e].description;var pd=e=>{if(e===!1)return e;if(e===!0)return F_;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},F_=1e3*5,cd=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:i,context:n,controller:s},a,o)=>{let{signal:c,error:d}=G_(a,o,r);U_(d,i);let u=e(c);return N_({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:u,context:n,controller:s}),u},G_=(e,t,r)=>{let[i=r,n]=Bi(e)?[void 0,e]:[e,t];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Bi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return{signal:ad(i),error:n}},U_=(e,t)=>{e!==void 0&&t.reject(e)},N_=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:a})=>{t===i&&n&&Vs({kill:e,forceKillAfterDelay:r,context:s,controllerSignal:a.signal})},Vs=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:i})=>{if(t!==!1)try{await M_(t,void 0,{signal:i}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};p();p();import{once as V_}from"events";var Mi=async(e,t)=>{e.aborted||await V_(e,"abort",{signal:t})};var dd=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},ud=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:i,controller:n})=>t===void 0||r?[]:[H_(e,t,i,n)],H_=async(e,t,r,{signal:i})=>{throw await Mi(t,i),r.terminationReason??="cancel",e.kill(),t.reason};p();p();import{scheduler as mb}from"timers/promises";p();import{promisify as db}from"util";p();var Ft=({methodName:e,isSubprocess:t,ipc:r,isConnected:i})=>{W_(e,t,r),Hs(e,t,i)},W_=(e,t,r)=>{if(!r)throw new Error(`${Re(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Hs=(e,t,r)=>{if(!r)throw new Error(`${Re(e,t)} cannot be used: the ${lt(t)} has already exited or disconnected.`)},ld=e=>{throw new Error(`${Re("getOneMessage",e)} could not complete: the ${lt(e)} exited or disconnected.`)},md=e=>{throw new Error(`${Re("sendMessage",e)} failed: the ${lt(e)} is sending a message too, instead of listening to incoming messages.
110
+ `;var Fe=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:i,result:n})=>{let s=Gf({type:e,result:n,verboseInfo:i}),a=Uf(t,s),o=ec(a,i,r);o!==""&&console.warn(o.slice(0,-1))},Gf=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=!1,...s}}})=>({type:e,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:t,options:s}),Uf=(e,t)=>e.split(`
111
+ `).map(r=>Nf({...t,message:r})),Nf=e=>({verboseLine:Qp(e),verboseObject:e}),Ti=e=>{let t=typeof e=="string"?e:Ff(e);return kr(t).replaceAll(" "," ".repeat(Vf))},Vf=2;var tc=(e,t)=>{Lt(t)&&Fe({type:"command",verboseMessage:e,verboseInfo:t})};p();var rc=(e,t,r)=>{Kf(e);let i=Hf(e);return{verbose:e,escapedCommand:t,commandId:i,rawOptions:r}},Hf=e=>Lt({verbose:e})?Wf++:void 0,Wf=0n,Kf=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Ai.includes(t)&&!$i(t)){let r=Ai.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};p();import{hrtime as ic}from"process";var Ci=()=>ic.bigint(),Rs=e=>Number(ic.bigint()-e)/1e6;var Ri=(e,t,r)=>{let i=Ci(),{command:n,escapedCommand:s}=Up(e,t),a=Es(r,"verbose"),o=rc(a,s,{...r});return tc(s,o),{command:n,escapedCommand:s,startTime:i,verboseInfo:o}};p();var ru=L(Vc(),1);import Tb from"path";import tu from"process";p();import Li from"process";import xt from"path";p();function Oi(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}p();import{promisify as k_}from"util";import{execFile as v_,execFileSync as PP}from"child_process";import Hc from"path";import{fileURLToPath as w_}from"url";var RP=k_(v_);function Di(e){return e instanceof URL?w_(e):e}function Wc(e){return{*[Symbol.iterator](){let t=Hc.resolve(Di(e)),r;for(;r!==t;)yield t,r=t,t=Hc.resolve(t,"..")}}}var IP=10*1024*1024;var x_=({cwd:e=Li.cwd(),path:t=Li.env[Oi()],preferLocal:r=!0,execPath:i=Li.execPath,addExecPath:n=!0}={})=>{let s=xt.resolve(Di(e)),a=[],o=t.split(xt.delimiter);return r&&S_(a,o,s),n&&$_(a,o,i,s),t===""||t===xt.delimiter?`${a.join(xt.delimiter)}${t}`:[...a,t].join(xt.delimiter)},S_=(e,t,r)=>{for(let i of Wc(r)){let n=xt.join(i,"node_modules/.bin");t.includes(n)||e.push(n)}},$_=(e,t,r,i)=>{let n=xt.resolve(i,Di(r),"..");t.includes(n)||e.push(n)},Kc=({env:e=Li.env,...t}={})=>{e={...e};let r=Oi({env:e});return t.path=e[r],e[r]=x_(t),e};p();import{setTimeout as F_}from"timers/promises";p();var Yc=(e,t,r)=>{let i=r?wr:vr,n=e instanceof Ce?{}:{cause:e};return new i(t,n)},Ce=class extends Error{},Jc=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Zc,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Xc=e=>Bi(e)&&Zc in e,Zc=Symbol("isExecaError"),Bi=e=>Object.prototype.toString.call(e)==="[object Error]",vr=class extends Error{};Jc(vr,vr.name);var wr=class extends Error{};Jc(wr,wr.name);p();import{constants as xr}from"os";p();import{constants as P_}from"os";p();var Qc=()=>{let e=td-ed+1;return Array.from({length:e},A_)},A_=(e,t)=>({name:`SIGRT${t+1}`,number:ed+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ed=34,td=64;p();import{constants as E_}from"os";p();var rd=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Us=()=>{let e=Qc();return[...rd,...e].map(j_)},j_=({name:e,number:t,description:r,action:i,forced:n=!1,standard:s})=>{let{signals:{[e]:a}}=E_,o=a!==void 0;return{name:e,number:o?a:t,description:r,supported:o,action:i,forced:n,standard:s}};var T_=()=>{let e=Us();return Object.fromEntries(e.map(C_))},C_=({name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a})=>[e,{name:e,number:t,description:r,supported:i,action:n,forced:s,standard:a}],id=T_(),R_=()=>{let e=Us(),t=65,r=Array.from({length:t},(i,n)=>I_(n,e));return Object.assign({},...r)},I_=(e,t)=>{let r=O_(e,t);if(r===void 0)return{};let{name:i,description:n,supported:s,action:a,forced:o,standard:c}=r;return{[e]:{name:i,number:e,description:n,supported:s,action:a,forced:o,standard:c}}},O_=(e,t)=>{let r=t.find(({name:i})=>P_.signals[i]===e);return r!==void 0?r:t.find(i=>i.number===e)},iT=R_();var sd=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return od(e,t)},ad=e=>e===0?e:od(e,"`subprocess.kill()`'s argument"),od=(e,t)=>{if(Number.isInteger(e))return D_(e,t);if(typeof e=="string")return B_(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
112
+ ${Ns()}`)},D_=(e,t)=>{if(nd.has(e))return nd.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
113
+ ${Ns()}`)},L_=()=>new Map(Object.entries(xr.signals).reverse().map(([e,t])=>[t,e])),nd=L_(),B_=(e,t)=>{if(e in xr.signals)return e;throw e.toUpperCase()in xr.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
114
+ ${Ns()}`)},Ns=()=>`Available signal names: ${z_()}.
115
+ Available signal numbers: ${M_()}.`,z_=()=>Object.keys(xr.signals).sort().map(e=>`'${e}'`).join(", "),M_=()=>[...new Set(Object.values(xr.signals).sort((e,t)=>e-t))].join(", "),zi=e=>id[e].description;var pd=e=>{if(e===!1)return e;if(e===!0)return G_;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},G_=1e3*5,cd=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:i,context:n,controller:s},a,o)=>{let{signal:c,error:d}=U_(a,o,r);N_(d,i);let u=e(c);return V_({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:u,context:n,controller:s}),u},U_=(e,t,r)=>{let[i=r,n]=Bi(e)?[void 0,e]:[e,t];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Bi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return{signal:ad(i),error:n}},N_=(e,t)=>{e!==void 0&&t.reject(e)},V_=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:a})=>{t===i&&n&&Vs({kill:e,forceKillAfterDelay:r,context:s,controllerSignal:a.signal})},Vs=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:i})=>{if(t!==!1)try{await F_(t,void 0,{signal:i}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};p();p();import{once as H_}from"events";var Mi=async(e,t)=>{e.aborted||await H_(e,"abort",{signal:t})};var dd=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},ud=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:i,controller:n})=>t===void 0||r?[]:[W_(e,t,i,n)],W_=async(e,t,r,{signal:i})=>{throw await Mi(t,i),r.terminationReason??="cancel",e.kill(),t.reason};p();p();import{scheduler as hb}from"timers/promises";p();import{promisify as ub}from"util";p();var Ft=({methodName:e,isSubprocess:t,ipc:r,isConnected:i})=>{K_(e,t,r),Hs(e,t,i)},K_=(e,t,r)=>{if(!r)throw new Error(`${Re(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Hs=(e,t,r)=>{if(!r)throw new Error(`${Re(e,t)} cannot be used: the ${lt(t)} has already exited or disconnected.`)},ld=e=>{throw new Error(`${Re("getOneMessage",e)} could not complete: the ${lt(e)} exited or disconnected.`)},md=e=>{throw new Error(`${Re("sendMessage",e)} failed: the ${lt(e)} is sending a message too, instead of listening to incoming messages.
116
116
  This can be fixed by both sending a message and listening to incoming messages at the same time:
117
117
 
118
118
  const [receivedMessage] = await Promise.all([
119
119
  ${Re("getOneMessage",e)},
120
120
  ${Re("sendMessage",e,"message, {strict: true}")},
121
- ]);`)},Fi=(e,t)=>new Error(`${Re("sendMessage",t)} failed when sending an acknowledgment response to the ${lt(t)}.`,{cause:e}),hd=e=>{throw new Error(`${Re("sendMessage",e)} failed: the ${lt(e)} is not listening to incoming messages.`)},yd=e=>{throw new Error(`${Re("sendMessage",e)} failed: the ${lt(e)} exited without listening to incoming messages.`)},gd=()=>new Error(`\`cancelSignal\` aborted: the ${lt(!0)} disconnected.`),fd=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},_d=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${Re(t,r)} cannot be used: the ${lt(r)} is disconnecting.`,{cause:e})},bd=({error:e,methodName:t,isSubprocess:r,message:i})=>{if(K_(e))throw new Error(`${Re(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:e})},K_=({code:e,message:t})=>Y_.has(e)||J_.some(r=>t.includes(r)),Y_=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),J_=["could not be cloned","circular structure","call stack size exceeded"],Re=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${X_(t)}${e}(${r})`,X_=e=>e?"":"subprocess.",lt=e=>e?"parent process":"subprocess",Gt=e=>{e.connected&&e.disconnect()};p();p();var Ge=()=>{let e={},t=new Promise((r,i)=>{Object.assign(e,{resolve:r,reject:i})});return Object.assign(t,e)};p();var Ui=(e,t="stdin")=>{let{options:i,fileDescriptors:n}=Ue.get(e),s=qd(n,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(kd(s,t,i,!0));return a},Ut=(e,t="stdout")=>{let{options:i,fileDescriptors:n}=Ue.get(e),s=qd(n,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(kd(s,t,i,!1));return a},Ue=new WeakMap,qd=(e,t,r)=>{let i=Z_(t,r);return Q_(i,t,r,e),i},Z_=(e,t)=>{let r=js(e);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Sr(t)}" must not be "${e}".
121
+ ]);`)},Fi=(e,t)=>new Error(`${Re("sendMessage",t)} failed when sending an acknowledgment response to the ${lt(t)}.`,{cause:e}),hd=e=>{throw new Error(`${Re("sendMessage",e)} failed: the ${lt(e)} is not listening to incoming messages.`)},yd=e=>{throw new Error(`${Re("sendMessage",e)} failed: the ${lt(e)} exited without listening to incoming messages.`)},gd=()=>new Error(`\`cancelSignal\` aborted: the ${lt(!0)} disconnected.`),fd=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},_d=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${Re(t,r)} cannot be used: the ${lt(r)} is disconnecting.`,{cause:e})},bd=({error:e,methodName:t,isSubprocess:r,message:i})=>{if(Y_(e))throw new Error(`${Re(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:e})},Y_=({code:e,message:t})=>J_.has(e)||X_.some(r=>t.includes(r)),J_=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),X_=["could not be cloned","circular structure","call stack size exceeded"],Re=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Z_(t)}${e}(${r})`,Z_=e=>e?"":"subprocess.",lt=e=>e?"parent process":"subprocess",Gt=e=>{e.connected&&e.disconnect()};p();p();var Ge=()=>{let e={},t=new Promise((r,i)=>{Object.assign(e,{resolve:r,reject:i})});return Object.assign(t,e)};p();var Ui=(e,t="stdin")=>{let{options:i,fileDescriptors:n}=Ue.get(e),s=qd(n,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(kd(s,t,i,!0));return a},Ut=(e,t="stdout")=>{let{options:i,fileDescriptors:n}=Ue.get(e),s=qd(n,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(kd(s,t,i,!1));return a},Ue=new WeakMap,qd=(e,t,r)=>{let i=Q_(t,r);return eb(i,t,r,e),i},Q_=(e,t)=>{let r=js(e);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Sr(t)}" must not be "${e}".
122
122
  It must be ${i} or "fd3", "fd4" (and so on).
123
- It is optional and defaults to "${n}".`)},Q_=(e,t,r,i)=>{let n=i[vd(e)];if(n===void 0)throw new TypeError(`"${Sr(r)}" must not be ${t}. That file descriptor does not exist.
124
- Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${Sr(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${Sr(r)}" must not be ${t}. It must be a writable stream, not readable.`)},kd=(e,t,r,i)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=eb(e,r);return`The "${n}: ${Gi(s)}" option is incompatible with using "${Sr(i)}: ${Gi(t)}".
125
- Please set this option with "pipe" instead.`},eb=(e,{stdin:t,stdout:r,stderr:i,stdio:n})=>{let s=vd(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},vd=e=>e==="all"?1:e,Sr=e=>e?"to":"from",Gi=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";p();import{once as ab}from"events";p();import{addAbortListener as tb}from"events";var St=(e,t,r)=>{let i=e.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(e.setMaxListeners(i+t),tb(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};p();import{EventEmitter as nb}from"events";p();import{once as rb}from"events";import{scheduler as ib}from"timers/promises";p();var Ni=(e,t)=>{t&&Ws(e)},Ws=e=>{e.refCounted()},Vi=(e,t)=>{t&&Ks(e)},Ks=e=>{e.unrefCounted()},wd=(e,t)=>{t&&(Ks(e),Ks(e))},xd=(e,t)=>{t&&(Ws(e),Ws(e))};var Sd=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i},n)=>{if(Ed(n)||Pd(n))return;Hi.has(e)||Hi.set(e,[]);let s=Hi.get(e);if(s.push(n),!(s.length>1))for(;s.length>0;){await jd(e,i,n),await ib.yield();let a=await Ad({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",a),i.emit("message:done")}},$d=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Ys();let s=Hi.get(e);for(;s?.length>0;)await rb(i,"message:done");e.removeListener("message",n),xd(t,r),i.connected=!1,i.emit("disconnect")},Hi=new WeakMap;var mt=(e,t,r)=>{if(Wi.has(e))return Wi.get(e);let i=new nb;return i.connected=!0,Wi.set(e,i),sb({ipcEmitter:i,anyProcess:e,channel:t,isSubprocess:r}),i},Wi=new WeakMap,sb=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:i})=>{let n=Sd.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e});t.on("message",n),t.once("disconnect",$d.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e,boundOnMessage:n})),wd(r,i)},Ki=e=>{let t=Wi.get(e);return t===void 0?e.channel!==null:t.connected};var Td=({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=mt(e,t,r),a=Xi(e,s);return{id:ob++,type:Ji,message:i,hasListeners:a}},ob=0n,Cd=(e,t)=>{if(!(t?.type!==Ji||t.hasListeners))for(let{id:r}of e)r!==void 0&&Yi[r].resolve({isDeadlock:!0,hasListeners:!1})},Ad=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(e?.type!==Ji||!t.connected)return e;let{id:s,message:a}=e,o={id:s,type:Id,message:Xi(t,n)};try{await Zi({anyProcess:t,channel:r,isSubprocess:i,ipc:!0},o)}catch(c){n.emit("strict:error",c)}return a},Ed=e=>{if(e?.type!==Id)return!1;let{id:t,message:r}=e;return Yi[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Rd=async(e,t,r)=>{if(e?.type!==Ji)return;let i=Ge();Yi[e.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:a}=await Promise.race([i,pb(t,r,n)]);s&&md(r),a||hd(r)}finally{n.abort(),delete Yi[e.id]}},Yi={},pb=async(e,t,{signal:r})=>{St(e,1,r),await ab(e,"disconnect",{signal:r}),yd(t)},Ji="execa:ipc:request",Id="execa:ipc:response";var Od=(e,t,r)=>{$r.has(e)||$r.set(e,new Set);let i=$r.get(e),n=Ge(),s=r?t.id:void 0,a={onMessageSent:n,id:s};return i.add(a),{outgoingMessages:i,outgoingMessage:a}},Dd=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},jd=async(e,t,r)=>{for(;!Xi(e,t)&&$r.get(e)?.size>0;){let i=[...$r.get(e)];Cd(i,r),await Promise.all(i.map(({onMessageSent:n})=>n))}},$r=new WeakMap,Xi=(e,t)=>t.listenerCount("message")>cb(e),cb=e=>Ue.has(e)&&!rt(Ue.get(e).options.buffer,"ipc")?1:0;var Zi=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},n,{strict:s=!1}={})=>{let a="sendMessage";return Ft({methodName:a,isSubprocess:r,ipc:i,isConnected:e.connected}),ub({anyProcess:e,channel:t,methodName:a,isSubprocess:r,message:n,strict:s})},ub=async({anyProcess:e,channel:t,methodName:r,isSubprocess:i,message:n,strict:s})=>{let a=Td({anyProcess:e,channel:t,isSubprocess:i,message:n,strict:s}),o=Od(e,a,s);try{await Xs({anyProcess:e,methodName:r,isSubprocess:i,wrappedMessage:a,message:n})}catch(c){throw Gt(e),c}finally{Dd(o)}},Xs=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=lb(e);try{await Promise.all([Rd(i,e,r),s(i)])}catch(a){throw _d({error:a,methodName:t,isSubprocess:r}),bd({error:a,methodName:t,isSubprocess:r,message:n}),a}},lb=e=>{if(Js.has(e))return Js.get(e);let t=db(e.send.bind(e));return Js.set(e,t),t},Js=new WeakMap;var Bd=(e,t)=>{let r="cancelSignal";return Hs(r,!1,e.connected),Xs({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Md,message:t},message:t})},zd=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>(await hb({anyProcess:e,channel:t,isSubprocess:r,ipc:i}),Zs.signal),hb=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>{if(!Ld){if(Ld=!0,!i){fd();return}if(t===null){Ys();return}mt(e,t,r),await mb.yield()}},Ld=!1,Pd=e=>e?.type!==Md?!1:(Zs.abort(e.message),!0),Md="execa:ipc:cancel",Ys=()=>{Zs.abort(gd())},Zs=new AbortController;var Fd=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:i})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Gd=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[yb({subprocess:e,cancelSignal:t,forceKillAfterDelay:i,context:n,controller:s})]:[],yb=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Mi(t,n);let s=gb(t);throw await Bd(e,s),Vs({kill:e.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",t.reason},gb=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};p();import{setTimeout as fb}from"timers/promises";var Ud=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Nd=(e,t,r,i)=>t===0||t===void 0?[]:[_b(e,t,r,i)],_b=async(e,t,r,{signal:i})=>{throw await fb(t,void 0,{signal:i}),r.terminationReason??="timeout",e.kill(),new Ce};p();import{execPath as bb,execArgv as qb}from"process";import Vd from"path";var Hd=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Wd=(e,t,{node:r=!1,nodePath:i=bb,nodeOptions:n=qb.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:a,...o})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Dt(i,'The "nodePath" option'),d=Vd.resolve(s,c),u={...o,nodePath:d,node:r,cwd:s};if(!r)return[e,t,u];if(Vd.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...n,e,...t],{ipc:!0,...u,shell:!1}]};p();import{serialize as kb}from"v8";var Kd=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xb[r](e)}},vb=e=>{try{kb(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},wb=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},xb={advanced:vb,json:wb},Yd=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};p();var Xd=({encoding:e})=>{if(Qs.has(e))return;let t=$b(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Qi(e)}\`.
123
+ It is optional and defaults to "${n}".`)},eb=(e,t,r,i)=>{let n=i[vd(e)];if(n===void 0)throw new TypeError(`"${Sr(r)}" must not be ${t}. That file descriptor does not exist.
124
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${Sr(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${Sr(r)}" must not be ${t}. It must be a writable stream, not readable.`)},kd=(e,t,r,i)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=tb(e,r);return`The "${n}: ${Gi(s)}" option is incompatible with using "${Sr(i)}: ${Gi(t)}".
125
+ Please set this option with "pipe" instead.`},tb=(e,{stdin:t,stdout:r,stderr:i,stdio:n})=>{let s=vd(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},vd=e=>e==="all"?1:e,Sr=e=>e?"to":"from",Gi=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";p();import{once as ob}from"events";p();import{addAbortListener as rb}from"events";var St=(e,t,r)=>{let i=e.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(e.setMaxListeners(i+t),rb(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};p();import{EventEmitter as sb}from"events";p();import{once as ib}from"events";import{scheduler as nb}from"timers/promises";p();var Ni=(e,t)=>{t&&Ws(e)},Ws=e=>{e.refCounted()},Vi=(e,t)=>{t&&Ks(e)},Ks=e=>{e.unrefCounted()},wd=(e,t)=>{t&&(Ks(e),Ks(e))},xd=(e,t)=>{t&&(Ws(e),Ws(e))};var Sd=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i},n)=>{if(Ed(n)||Pd(n))return;Hi.has(e)||Hi.set(e,[]);let s=Hi.get(e);if(s.push(n),!(s.length>1))for(;s.length>0;){await jd(e,i,n),await nb.yield();let a=await Ad({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",a),i.emit("message:done")}},$d=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Ys();let s=Hi.get(e);for(;s?.length>0;)await ib(i,"message:done");e.removeListener("message",n),xd(t,r),i.connected=!1,i.emit("disconnect")},Hi=new WeakMap;var mt=(e,t,r)=>{if(Wi.has(e))return Wi.get(e);let i=new sb;return i.connected=!0,Wi.set(e,i),ab({ipcEmitter:i,anyProcess:e,channel:t,isSubprocess:r}),i},Wi=new WeakMap,ab=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:i})=>{let n=Sd.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e});t.on("message",n),t.once("disconnect",$d.bind(void 0,{anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:e,boundOnMessage:n})),wd(r,i)},Ki=e=>{let t=Wi.get(e);return t===void 0?e.channel!==null:t.connected};var Td=({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=mt(e,t,r),a=Xi(e,s);return{id:pb++,type:Ji,message:i,hasListeners:a}},pb=0n,Cd=(e,t)=>{if(!(t?.type!==Ji||t.hasListeners))for(let{id:r}of e)r!==void 0&&Yi[r].resolve({isDeadlock:!0,hasListeners:!1})},Ad=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(e?.type!==Ji||!t.connected)return e;let{id:s,message:a}=e,o={id:s,type:Id,message:Xi(t,n)};try{await Zi({anyProcess:t,channel:r,isSubprocess:i,ipc:!0},o)}catch(c){n.emit("strict:error",c)}return a},Ed=e=>{if(e?.type!==Id)return!1;let{id:t,message:r}=e;return Yi[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Rd=async(e,t,r)=>{if(e?.type!==Ji)return;let i=Ge();Yi[e.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:a}=await Promise.race([i,cb(t,r,n)]);s&&md(r),a||hd(r)}finally{n.abort(),delete Yi[e.id]}},Yi={},cb=async(e,t,{signal:r})=>{St(e,1,r),await ob(e,"disconnect",{signal:r}),yd(t)},Ji="execa:ipc:request",Id="execa:ipc:response";var Od=(e,t,r)=>{$r.has(e)||$r.set(e,new Set);let i=$r.get(e),n=Ge(),s=r?t.id:void 0,a={onMessageSent:n,id:s};return i.add(a),{outgoingMessages:i,outgoingMessage:a}},Dd=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},jd=async(e,t,r)=>{for(;!Xi(e,t)&&$r.get(e)?.size>0;){let i=[...$r.get(e)];Cd(i,r),await Promise.all(i.map(({onMessageSent:n})=>n))}},$r=new WeakMap,Xi=(e,t)=>t.listenerCount("message")>db(e),db=e=>Ue.has(e)&&!rt(Ue.get(e).options.buffer,"ipc")?1:0;var Zi=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},n,{strict:s=!1}={})=>{let a="sendMessage";return Ft({methodName:a,isSubprocess:r,ipc:i,isConnected:e.connected}),lb({anyProcess:e,channel:t,methodName:a,isSubprocess:r,message:n,strict:s})},lb=async({anyProcess:e,channel:t,methodName:r,isSubprocess:i,message:n,strict:s})=>{let a=Td({anyProcess:e,channel:t,isSubprocess:i,message:n,strict:s}),o=Od(e,a,s);try{await Xs({anyProcess:e,methodName:r,isSubprocess:i,wrappedMessage:a,message:n})}catch(c){throw Gt(e),c}finally{Dd(o)}},Xs=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=mb(e);try{await Promise.all([Rd(i,e,r),s(i)])}catch(a){throw _d({error:a,methodName:t,isSubprocess:r}),bd({error:a,methodName:t,isSubprocess:r,message:n}),a}},mb=e=>{if(Js.has(e))return Js.get(e);let t=ub(e.send.bind(e));return Js.set(e,t),t},Js=new WeakMap;var Bd=(e,t)=>{let r="cancelSignal";return Hs(r,!1,e.connected),Xs({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Md,message:t},message:t})},zd=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>(await yb({anyProcess:e,channel:t,isSubprocess:r,ipc:i}),Zs.signal),yb=async({anyProcess:e,channel:t,isSubprocess:r,ipc:i})=>{if(!Ld){if(Ld=!0,!i){fd();return}if(t===null){Ys();return}mt(e,t,r),await hb.yield()}},Ld=!1,Pd=e=>e?.type!==Md?!1:(Zs.abort(e.message),!0),Md="execa:ipc:cancel",Ys=()=>{Zs.abort(gd())},Zs=new AbortController;var Fd=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:i})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Gd=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[gb({subprocess:e,cancelSignal:t,forceKillAfterDelay:i,context:n,controller:s})]:[],gb=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Mi(t,n);let s=fb(t);throw await Bd(e,s),Vs({kill:e.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",t.reason},fb=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};p();import{setTimeout as _b}from"timers/promises";var Ud=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Nd=(e,t,r,i)=>t===0||t===void 0?[]:[bb(e,t,r,i)],bb=async(e,t,r,{signal:i})=>{throw await _b(t,void 0,{signal:i}),r.terminationReason??="timeout",e.kill(),new Ce};p();import{execPath as qb,execArgv as kb}from"process";import Vd from"path";var Hd=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Wd=(e,t,{node:r=!1,nodePath:i=qb,nodeOptions:n=kb.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:a,...o})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Dt(i,'The "nodePath" option'),d=Vd.resolve(s,c),u={...o,nodePath:d,node:r,cwd:s};if(!r)return[e,t,u];if(Vd.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...n,e,...t],{ipc:!0,...u,shell:!1}]};p();import{serialize as vb}from"v8";var Kd=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Sb[r](e)}},wb=e=>{try{vb(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},xb=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},Sb={advanced:wb,json:xb},Yd=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};p();var Xd=({encoding:e})=>{if(Qs.has(e))return;let t=Ab(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Qi(e)}\`.
126
126
  Please rename it to ${Qi(t)}.`);let r=[...Qs].map(i=>Qi(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Qi(e)}\`.
127
- Please rename it to one of: ${r}.`)},Sb=new Set(["utf8","utf16le"]),qe=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Qs=new Set([...Sb,...qe]),$b=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Jd)return Jd[t];if(Qs.has(t))return t},Jd={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Qi=e=>typeof e=="string"?`"${e}"`:String(e);p();import{statSync as Ab}from"fs";import Eb from"path";import jb from"process";var Zd=(e=Qd())=>{let t=Dt(e,'The "cwd" option');return Eb.resolve(t)},Qd=()=>{try{return jb.cwd()}catch(e){throw e.message=`The current directory does not exist.
128
- ${e.message}`,e}},eu=(e,t)=>{if(t===Qd())return e;let r;try{r=Ab(t)}catch(i){return`The "cwd" option is invalid: ${t}.
127
+ Please rename it to one of: ${r}.`)},$b=new Set(["utf8","utf16le"]),qe=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Qs=new Set([...$b,...qe]),Ab=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Jd)return Jd[t];if(Qs.has(t))return t},Jd={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Qi=e=>typeof e=="string"?`"${e}"`:String(e);p();import{statSync as Eb}from"fs";import jb from"path";import Pb from"process";var Zd=(e=Qd())=>{let t=Dt(e,'The "cwd" option');return jb.resolve(t)},Qd=()=>{try{return Pb.cwd()}catch(e){throw e.message=`The current directory does not exist.
128
+ ${e.message}`,e}},eu=(e,t)=>{if(t===Qd())return e;let r;try{r=Eb(t)}catch(i){return`The "cwd" option is invalid: ${t}.
129
129
  ${i.message}
130
130
  ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
131
- ${e}`};var en=(e,t,r)=>{r.cwd=Zd(r.cwd);let[i,n,s]=Wd(e,t,r),{command:a,args:o,options:c}=ru.default._parse(i,n,s),d=Fp(c),u=Tb(d);return Ud(u),Xd(u),Kd(u),dd(u),Fd(u),u.shell=Ss(u.shell),u.env=Cb(u),u.killSignal=sd(u.killSignal),u.forceKillAfterDelay=pd(u.forceKillAfterDelay),u.lines=u.lines.map((l,h)=>l&&!qe.has(u.encoding)&&u.buffer[h]),tu.platform==="win32"&&Pb.basename(a,".exe")==="cmd"&&o.unshift("/q"),{file:a,commandArguments:o,options:u}},Tb=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=!0,cleanup:a=!0,all:o=!1,windowsHide:c=!0,killSignal:d="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:l=!1,ipcInput:h,ipc:y=h!==void 0||l,serialization:g="advanced",...b})=>({...b,extendEnv:e,preferLocal:t,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:a,all:o,windowsHide:c,killSignal:d,forceKillAfterDelay:u,gracefulCancel:l,ipcInput:h,ipc:y,serialization:g}),Cb=({env:e,extendEnv:t,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let a=t?{...tu.env,...e}:e;return r||i?Kc({env:a,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):a};p();var tn=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];p();p();import{inspect as lq}from"util";p();function Nt(e){if(typeof e=="string")return Rb(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Ib(e)}var Rb=e=>e.at(-1)===iu?e.slice(0,e.at(-2)===nu?-2:-1):e,Ib=e=>e.at(-1)===Ob?e.subarray(0,e.at(-2)===Db?-2:-1):e,iu=`
132
- `,Ob=iu.codePointAt(0),nu="\r",Db=nu.codePointAt(0);p();p();import{on as pq}from"events";import{finished as cq}from"stream/promises";p();p();function Ie(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function ea(e,{checkOpen:t=!0}={}){return Ie(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function $t(e,{checkOpen:t=!0}={}){return Ie(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function ta(e,t){return ea(e,t)&&$t(e,t)}p();p();var Lb=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),ra=class{#t;#r;#e=!1;#i=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#s();return this.#i=this.#i?this.#i.then(t,t):t(),this.#i}return(t){let r=()=>this.#n(t);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#i=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#i=void 0,this.#e=!0,this.#t.releaseLock()),t}async#n(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},ia=Symbol();function su(){return this[ia].next()}Object.defineProperty(su,"name",{value:"next"});function au(e){return this[ia].return(e)}Object.defineProperty(au,"name",{value:"return"});var Bb=Object.create(Lb,{next:{enumerable:!0,configurable:!0,writable:!0,value:su},return:{enumerable:!0,configurable:!0,writable:!0,value:au}});function na({preventCancel:e=!1}={}){let t=this.getReader(),r=new ra(t,e),i=Object.create(Bb);return i[ia]=r,i}p();var ou=e=>{if($t(e,{checkOpen:!1})&&Ar.on!==void 0)return Mb(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(zb.call(e)==="[object ReadableStream]")return na.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:zb}=Object.prototype,Mb=async function*(e){let t=new AbortController,r={};Fb(e,t,r);try{for await(let[i]of Ar.on(e,"data",{signal:t.signal}))yield i}catch(i){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw i}finally{e.destroy()}},Fb=async(e,t,r)=>{try{await Ar.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(i){r.error=i}finally{t.abort()}},Ar={};p();p();p();var Vt=async(e,{init:t,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,finalize:o},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let d=ou(e),u=t();u.length=0;try{for await(let l of d){let h=Ub(l),y=r[h](l,u);du({convertedChunk:y,state:u,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:c})}return Gb({state:u,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,maxBuffer:c}),o(u)}catch(l){let h=typeof l=="object"&&l!==null?l:new Error(l);throw h.bufferedData=o(u),h}},Gb=({state:e,getSize:t,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let a=n(e);a!==void 0&&du({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:i,maxBuffer:s})},du=({convertedChunk:e,state:t,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let a=r(e),o=t.length+a;if(o<=s){pu(e,t,n,o);return}let c=i(e,s-t.length);throw c!==void 0&&pu(c,t,n,s),new Ne},pu=(e,t,r,i)=>{t.contents=r(e,t,i),t.length=i},Ub=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=cu.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&cu.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:cu}=Object.prototype,Ne=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};p();var it=e=>e,Er=()=>{},rn=({contents:e})=>e,nn=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},sn=e=>e.length;async function an(e,t){return Vt(e,Wb,t)}var Nb=()=>({contents:[]}),Vb=()=>1,Hb=(e,{contents:t})=>(t.push(e),t),Wb={init:Nb,convertChunk:{string:it,buffer:it,arrayBuffer:it,dataView:it,typedArray:it,others:it},getSize:Vb,truncateChunk:Er,addChunk:Hb,getFinalChunk:Er,finalize:rn};p();async function on(e,t){return Vt(e,rq,t)}var Kb=()=>({contents:new ArrayBuffer(0)}),Yb=e=>Jb.encode(e),Jb=new TextEncoder,uu=e=>new Uint8Array(e),lu=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Xb=(e,t)=>e.slice(0,t),Zb=(e,{contents:t,length:r},i)=>{let n=yu()?eq(t,i):Qb(t,i);return new Uint8Array(n).set(e,r),n},Qb=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(hu(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},eq=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:hu(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},hu=e=>mu**Math.ceil(Math.log(e)/Math.log(mu)),mu=2,tq=({contents:e,length:t})=>yu()?e:e.slice(0,t),yu=()=>"resize"in ArrayBuffer.prototype,rq={init:Kb,convertChunk:{string:Yb,buffer:uu,arrayBuffer:uu,dataView:lu,typedArray:lu,others:nn},getSize:sn,truncateChunk:Xb,addChunk:Zb,getFinalChunk:Er,finalize:tq};p();async function cn(e,t){return Vt(e,oq,t)}var iq=()=>({contents:"",textDecoder:new TextDecoder}),pn=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),nq=(e,{contents:t})=>t+e,sq=(e,t)=>e.slice(0,t),aq=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},oq={init:iq,convertChunk:{string:it,buffer:pn,arrayBuffer:pn,dataView:pn,typedArray:pn,others:nn},getSize:sn,truncateChunk:sq,addChunk:nq,getFinalChunk:aq,finalize:rn};Object.assign(Ar,{on:pq,finished:cq});var gu=({error:e,stream:t,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(e instanceof Ne))throw e;if(s==="all")return e;let a=dq(r,i,n);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},dq=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",fu=(e,t,r)=>{if(t.length!==r)return;let i=new Ne;throw i.maxBufferInfo={fdNumber:"ipc"},i},_u=(e,t)=>{let{streamName:r,threshold:i,unit:n}=uq(e,t);return`Command's ${r} was larger than ${i} ${n}`},uq=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=e;delete e.maxBufferInfo;let n=rt(t,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Si(r),threshold:n,unit:i}},bu=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(i=>i!==null&&i.length>dn(r)),qu=(e,t,r)=>{if(!t)return e;let i=dn(r);return e.length>i?e.slice(0,i):e},dn=([,e])=>e;var vu=({stdio:e,all:t,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:a,escapedCommand:o,timedOut:c,isCanceled:d,isGracefullyCanceled:u,isMaxBuffer:l,isForcefullyTerminated:h,forceKillAfterDelay:y,killSignal:g,maxBuffer:b,timeout:$,cwd:S})=>{let A=i?.code,q=mq({originalError:i,timedOut:c,timeout:$,isMaxBuffer:l,maxBuffer:b,errorCode:A,signal:n,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:u,isForcefullyTerminated:h,forceKillAfterDelay:y,killSignal:g}),O=yq(i,S),E=O===void 0?"":`
133
- ${O}`,N=`${q}: ${o}${E}`,R=t===void 0?[e[2],e[1]]:[t],B=[N,...R,...e.slice(3),r.map(z=>gq(z)).join(`
134
- `)].map(z=>kr(Nt(fq(z)))).filter(Boolean).join(`
135
-
136
- `);return{originalMessage:O,shortMessage:N,message:B}},mq=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:a,signalDescription:o,exitCode:c,isCanceled:d,isGracefullyCanceled:u,isForcefullyTerminated:l,forceKillAfterDelay:h,killSignal:y})=>{let g=hq(l,h);return t?`Command timed out after ${r} milliseconds${g}`:u?a===void 0?`Command was gracefully canceled with exit code ${c}`:l?`Command was gracefully canceled${g}`:`Command was gracefully canceled with ${a} (${o})`:d?`Command was canceled${g}`:i?`${_u(e,n)}${g}`:s!==void 0?`Command failed with ${s}${g}`:l?`Command was killed with ${y} (${zi(y)})${g}`:a!==void 0?`Command was killed with ${a} (${o})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},hq=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",yq=(e,t)=>{if(e instanceof Ce)return;let r=Xc(e)?e.originalMessage:String(e?.message??e),i=kr(eu(r,t));return i===""?void 0:i},gq=e=>typeof e=="string"?e:lq(e),fq=e=>Array.isArray(e)?e.map(t=>Nt(ku(t))).filter(Boolean).join(`
137
- `):ku(e),ku=e=>typeof e=="string"?e:se(e)?wi(e):"";var un=({command:e,escapedCommand:t,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:a})=>wu({command:e,escapedCommand:t,cwd:s,durationMs:Rs(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Ht=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:a})=>jr({error:e,command:t,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:a}),jr=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:d,signal:u,stdio:l,all:h,ipcOutput:y,options:{timeoutDuration:g,timeout:b=g,forceKillAfterDelay:$,killSignal:S,cwd:A,maxBuffer:q},isSync:O})=>{let{exitCode:E,signal:N,signalDescription:R}=bq(d,u),{originalMessage:B,shortMessage:z,message:Y}=vu({stdio:l,all:h,ipcOutput:y,originalError:e,signal:N,signalDescription:R,exitCode:E,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,forceKillAfterDelay:$,killSignal:S,maxBuffer:q,timeout:b,cwd:A}),j=Yc(e,Y,O);return Object.assign(j,_q({error:j,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:E,signal:N,signalDescription:R,stdio:l,all:h,ipcOutput:y,cwd:A,originalMessage:B,shortMessage:z})),j},_q=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:d,signal:u,signalDescription:l,stdio:h,all:y,ipcOutput:g,cwd:b,originalMessage:$,shortMessage:S})=>wu({shortMessage:S,originalMessage:$,command:t,escapedCommand:r,cwd:b,durationMs:Rs(i),failed:!0,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isTerminated:u!==void 0,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:d,signal:u,signalDescription:l,code:e.cause?.code,stdout:h[1],stderr:h[2],all:y,stdio:h,ipcOutput:g,pipedFrom:[]}),wu=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),bq=(e,t)=>{let r=e===null?void 0:e,i=t===null?void 0:t,n=i===void 0?void 0:zi(t);return{exitCode:r,signal:i,signalDescription:n}};p();p();p();p();var xu=e=>Number.isFinite(e)?e:0;function qq(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(xu(e*1e3)%1e3),nanoseconds:Math.trunc(xu(e*1e6)%1e3)}}function kq(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function sa(e){switch(typeof e){case"number":{if(Number.isFinite(e))return qq(e);break}case"bigint":return kq(e)}throw new TypeError("Expected a finite number or bigint")}var vq=e=>e===0||e===0n,wq=(e,t)=>t===1||t===1n?e:`${e}s`,xq=1e-7,Sq=24n*60n*60n*1000n;function aa(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let i=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let n=[],s=(u,l)=>{let h=Math.floor(u*10**l+xq);return(Math.round(h)/10**l).toFixed(l)},a=(u,l,h,y)=>{if(!((n.length===0||!t.colonNotation)&&vq(u)&&!(t.colonNotation&&h==="m"))){if(y??=String(u),t.colonNotation){let g=y.includes(".")?y.split(".")[0].length:y.length,b=n.length>0?2:1;y="0".repeat(Math.max(0,b-g))+y}else y+=t.verbose?" "+wq(l,u):h;n.push(y)}},o=sa(e),c=BigInt(o.days);if(t.hideYearAndDays?a(BigInt(c)*24n+BigInt(o.hours),"hour","h"):(t.hideYear?a(c,"day","d"):(a(c/365n,"year","y"),a(c%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let u=Number(o.seconds),l=Number(o.milliseconds),h=Number(o.microseconds),y=Number(o.nanoseconds);if(a(u,"second","s"),t.formatSubMilliseconds)a(l,"millisecond","ms"),a(h,"microsecond","\xB5s"),a(y,"nanosecond","ns");else{let g=l+h/1e3+y/1e6,b=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,$=g>=1?Math.round(g):Math.ceil(g),S=1e3-10**-b,A=b?Math.min(g,S).toFixed(b):Math.min($,S);a(Number.parseFloat(A),"millisecond","ms",A)}}else{let u=(r?Number(e%Sq):e)/1e3%60,l=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,h=s(u,l),y=t.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");a(Number.parseFloat(y),"second","s",y)}if(n.length===0)return i+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(n=n.slice(0,Math.max(t.unitCount,1))),i+n.join(d)}p();var Su=(e,t)=>{e.failed&&Fe({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var $u=(e,t)=>{Lt(t)&&(Su(e,t),$q(e,t))},$q=(e,t)=>{let r=`(done in ${aa(e.durationMs)})`;Fe({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var Wt=(e,t,{reject:r})=>{if($u(e,t),e.failed&&r)throw e;return e};p();import{readFileSync as Qu}from"fs";p();p();p();var ju=(e,t)=>At(e)?"asyncGenerator":Cu(e)?"generator":ln(e)?"fileUrl":Tq(e)?"filePath":Iq(e)?"webStream":Ie(e,{checkOpen:!1})?"native":se(e)?"uint8Array":Oq(e)?"asyncIterable":Dq(e)?"iterable":ca(e)?Pu({transform:e},t):Pq(e)?Aq(e,t):"native",Aq=(e,t)=>ta(e.transform,{checkOpen:!1})?Eq(e,t):ca(e.transform)?Pu(e,t):jq(e,t),Eq=(e,t)=>(Tu(e,t,"Duplex stream"),"duplex"),Pu=(e,t)=>(Tu(e,t,"web TransformStream"),"webTransform"),Tu=({final:e,binary:t,objectMode:r},i,n)=>{Au(e,`${i}.final`,n),Au(t,`${i}.binary`,n),oa(r,`${i}.objectMode`)},Au=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},jq=({transform:e,final:t,binary:r,objectMode:i},n)=>{if(e!==void 0&&!Eu(e))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ta(t,{checkOpen:!1}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(ca(t))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Eu(t))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return oa(r,`${n}.binary`),oa(i,`${n}.objectMode`),At(e)||At(t)?"asyncGenerator":"generator"},oa=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},Eu=e=>At(e)||Cu(e),At=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",Cu=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",Pq=e=>ee(e)&&(e.transform!==void 0||e.final!==void 0),ln=e=>Object.prototype.toString.call(e)==="[object URL]",Ru=e=>ln(e)&&e.protocol!=="file:",Tq=e=>ee(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Cq.has(t))&&pa(e.file),Cq=new Set(["file","append"]),pa=e=>typeof e=="string",Iu=(e,t)=>e==="native"&&typeof t=="string"&&!Rq.has(t),Rq=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ou=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",mn=e=>Object.prototype.toString.call(e)==="[object WritableStream]",Iq=e=>Ou(e)||mn(e),ca=e=>Ou(e?.readable)&&mn(e?.writable),Oq=e=>Du(e)&&typeof e[Symbol.asyncIterator]=="function",Dq=e=>Du(e)&&typeof e[Symbol.iterator]=="function",Du=e=>typeof e=="object"&&e!==null,$e=new Set(["generator","asyncGenerator","duplex","webTransform"]),hn=new Set(["fileUrl","filePath","fileNumber"]),da=new Set(["fileUrl","filePath"]),Lu=new Set([...da,"webStream","nodeStream"]),Bu=new Set(["webTransform","duplex"]),ht={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};p();var ua=(e,t,r,i)=>i==="output"?Lq(e,t,r):Bq(e,t,r),Lq=(e,t,r)=>{let i=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:i,readableObjectMode:e??i}},Bq=(e,t,r)=>{let i=t===0?e===!0:r[t-1].value.readableObjectMode,n=t!==r.length-1&&(e??i);return{writableObjectMode:i,readableObjectMode:n}},zu=(e,t)=>{let r=e.findLast(({type:i})=>$e.has(i));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Mu=(e,t,r,i)=>[...e.filter(({type:n})=>!$e.has(n)),...zq(e,t,r,i)],zq=(e,t,r,{encoding:i})=>{let n=e.filter(({type:a})=>$e.has(a)),s=Array.from({length:n.length});for(let[a,o]of Object.entries(n))s[a]=Mq({stdioItem:o,index:Number(a),newTransforms:s,optionName:t,direction:r,encoding:i});return Nq(s,r)},Mq=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:i,optionName:n,direction:s,encoding:a})=>t==="duplex"?Fq({stdioItem:e,optionName:n}):t==="webTransform"?Gq({stdioItem:e,index:r,newTransforms:i,direction:s}):Uq({stdioItem:e,index:r,newTransforms:i,direction:s,encoding:a}),Fq=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:i}}},Gq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:a}=ee(t)?t:{transform:t},{writableObjectMode:o,readableObjectMode:c}=ua(a,r,i,n);return{...e,value:{transform:s,writableObjectMode:o,readableObjectMode:c}}},Uq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:a,final:o,binary:c=!1,preserveNewlines:d=!1,objectMode:u}=ee(t)?t:{transform:t},l=c||qe.has(s),{writableObjectMode:h,readableObjectMode:y}=ua(u,r,i,n);return{...e,value:{transform:a,final:o,binary:l,preserveNewlines:d,writableObjectMode:h,readableObjectMode:y}}},Nq=(e,t)=>t==="input"?e.reverse():e;p();import la from"process";var Fu=(e,t,r)=>{let i=e.map(n=>Vq(n,t));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??Kq},Vq=({type:e,value:t},r)=>Hq[r]??Gu[e](t),Hq=["input","output","output"],Kt=()=>{},ma=()=>"input",Gu={generator:Kt,asyncGenerator:Kt,fileUrl:Kt,filePath:Kt,iterable:ma,asyncIterable:ma,uint8Array:ma,webStream:e=>mn(e)?"output":"input",nodeStream(e){return $t(e,{checkOpen:!1})?ea(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Kt,duplex:Kt,native(e){let t=Wq(e);if(t!==void 0)return t;if(Ie(e,{checkOpen:!1}))return Gu.nodeStream(e)}},Wq=e=>{if([0,la.stdin].includes(e))return"input";if([1,2,la.stdout,la.stderr].includes(e))return"output"},Kq="output";p();p();var Uu=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Nu=({stdio:e,ipc:t,buffer:r,...i},n,s)=>{let a=Yq(e,i).map((o,c)=>Vu(o,c));return s?Xq(a,r,n):Uu(a,t)},Yq=(e,t)=>{if(e===void 0)return Se.map(i=>t[i]);if(Jq(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Se.map(i=>`\`${i}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,Se.length);return Array.from({length:r},(i,n)=>e[n])},Jq=e=>Se.some(t=>e[t]!==void 0),Vu=(e,t)=>Array.isArray(e)?e.map(r=>Vu(r,t)):e??(t>=Se.length?"ignore":"pipe"),Xq=(e,t,r)=>e.map((i,n)=>!t[n]&&n!==0&&!Bt(r,n)&&Zq(i)?"ignore":i),Zq=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");p();import{readFileSync as Qq}from"fs";import ek from"tty";var Wu=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||t!=="native"?e:s?tk({stdioItem:e,fdNumber:i,direction:n}):nk({stdioItem:e,fdNumber:i}),tk=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i,direction:n})=>{let s=rk({value:t,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(Ie(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},rk=({value:e,optionName:t,fdNumber:r,direction:i})=>{let n=ik(e,r);if(n!==void 0){if(i==="output")return{type:"fileNumber",value:n,optionName:t};if(ek.isatty(n))throw new TypeError(`The \`${t}: ${Gi(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:tt(Qq(n)),optionName:t}}},ik=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=xi.indexOf(e);if(r!==-1)return r},nk=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i})=>t==="inherit"?{type:"nodeStream",value:Hu(i,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:Hu(t,t,r),optionName:r}:Ie(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,Hu=(e,t,r)=>{let i=xi[e];if(i===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return i};p();var Ku=({input:e,inputFile:t},r)=>r===0?[...sk(e),...ok(t)]:[],sk=e=>e===void 0?[]:[{type:ak(e),value:e,optionName:"input"}],ak=e=>{if($t(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(se(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},ok=e=>e===void 0?[]:[{...pk(e),optionName:"inputFile"}],pk=e=>{if(ln(e))return{type:"fileUrl",value:e};if(pa(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};p();var Yu=e=>e.filter((t,r)=>e.every((i,n)=>t.value!==i.value||r>=n||t.type==="generator"||t.type==="asyncGenerator")),Ju=({stdioItem:{type:e,value:t,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let a=ck(n,e);if(a.length!==0){if(s){dk({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});return}if(Lu.has(e))return Xu({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});Bu.has(e)&&lk({otherStdioItems:a,type:e,value:t,optionName:r})}},ck=(e,t)=>e.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===t).map((n=>({...n,direction:r})))),dk=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{da.has(t)&&Xu({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})},Xu=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{let s=e.filter(o=>uk(o,r));if(s.length===0)return;let a=s.find(o=>o.direction!==n);return Zu(a,i,t),n==="output"?s[0].stream:void 0},uk=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,lk=({otherStdioItems:e,type:t,value:r,optionName:i})=>{let n=e.find(({value:{transform:s}})=>s===r.transform);Zu(n,i,t)},Zu=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ht[r]} that is the same.`)};var yn=(e,t,r,i)=>{let s=Nu(t,r,i).map((o,c)=>mk({stdioOption:o,fdNumber:c,options:t,isSync:i})),a=kk({initialFileDescriptors:s,addProperties:e,options:t,isSync:i});return t.stdio=a.map(({stdioItems:o})=>xk(o)),a},mk=({stdioOption:e,fdNumber:t,options:r,isSync:i})=>{let n=Si(t),{stdioItems:s,isStdioArray:a}=hk({stdioOption:e,fdNumber:t,options:r,optionName:n}),o=Fu(s,t,n),c=s.map(l=>Wu({stdioItem:l,isStdioArray:a,fdNumber:t,direction:o,isSync:i})),d=Mu(c,n,o,r),u=zu(d,o);return qk(d,u),{direction:o,objectMode:u,stdioItems:d}},hk=({stdioOption:e,fdNumber:t,options:r,optionName:i})=>{let s=[...(Array.isArray(e)?e:[e]).map(c=>yk(c,i)),...Ku(r,t)],a=Yu(s),o=a.length>1;return gk(a,o,i),_k(a),{stdioItems:a,isStdioArray:o}},yk=(e,t)=>({type:ju(e,t),value:e,optionName:t}),gk=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:i,optionName:n}of e)if(fk.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},fk=new Set(["ignore","ipc"]),_k=e=>{for(let t of e)bk(t)},bk=({type:e,value:t,optionName:r})=>{if(Ru(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
138
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Iu(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},qk=(e,t)=>{if(!t)return;let r=e.find(({type:i})=>hn.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},kk=({initialFileDescriptors:e,addProperties:t,options:r,isSync:i})=>{let n=[];try{for(let s of e)n.push(vk({fileDescriptor:s,fileDescriptors:n,addProperties:t,options:r,isSync:i}));return n}catch(s){throw ha(n),s}},vk=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:a})=>{let o=r.map(c=>wk({stdioItem:c,addProperties:n,direction:e,options:s,fileDescriptors:i,isSync:a}));return{direction:e,objectMode:t,stdioItems:o}},wk=({stdioItem:e,addProperties:t,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let a=Ju({stdioItem:e,direction:r,fileDescriptors:n,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[r][e.type](e,i)}},ha=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!Te(r)&&r.destroy()},xk=e=>{if(e.length>1)return e.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var tl=(e,t)=>yn($k,e,t,!0),Ve=({type:e,optionName:t})=>{rl(t,ht[e])},Sk=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&rl(e,`"${t}"`),{}),rl=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},el={generator(){},asyncGenerator:Ve,webStream:Ve,nodeStream:Ve,webTransform:Ve,duplex:Ve,asyncIterable:Ve,native:Sk},$k={input:{...el,fileUrl:({value:e})=>({contents:[tt(Qu(e))]}),filePath:({value:{file:e}})=>({contents:[tt(Qu(e))]}),fileNumber:Ve,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...el,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:Ve,string:Ve,uint8Array:Ve}};p();var nt=(e,{stripFinalNewline:t},r)=>ya(t,r)&&e!==void 0&&!Array.isArray(e)?Nt(e):e,ya=(e,t)=>t==="all"?e[1]||e[2]:e[t];p();p();import{Transform as Wk,getDefaultHighWaterMark as ml}from"stream";p();var gn=(e,t,r,i)=>e||r?void 0:nl(t,i),fa=(e,t,r)=>r?e.flatMap(i=>il(i,t)):il(e,t),il=(e,t)=>{let{transform:r,final:i}=nl(t,{});return[...r(e),...i()]},nl=(e,t)=>(t.previousChunks="",{transform:Ak.bind(void 0,t,e),final:jk.bind(void 0,t)}),Ak=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=e,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
139
- `){let a=Ek(r,s,t,e),o=r.slice(n+1,s+1-a);i.length>0&&(o=ga(i,o),i=""),yield o,n=s}n!==r.length-1&&(i=ga(i,r.slice(n+1))),e.previousChunks=i},Ek=(e,t,r,i)=>r?0:(i.isWindowsNewline=t!==0&&e[t-1]==="\r",i.isWindowsNewline?2:1),jk=function*({previousChunks:e}){e.length>0&&(yield e)},sl=({binary:e,preserveNewlines:t,readableObjectMode:r,state:i})=>e||t||r?void 0:{transform:Pk.bind(void 0,i)},Pk=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof t=="string"?Tk:Rk;if(t.at(-1)===n){yield t;return}yield s(t,e?i:r)},ga=(e,t)=>`${e}${t}`,Tk={windowsNewline:`\r
131
+ ${e}`};var en=(e,t,r)=>{r.cwd=Zd(r.cwd);let[i,n,s]=Wd(e,t,r),{command:a,args:o,options:c}=ru.default._parse(i,n,s),d=Fp(c),u=Cb(d);return Ud(u),Xd(u),Kd(u),dd(u),Fd(u),u.shell=Ss(u.shell),u.env=Rb(u),u.killSignal=sd(u.killSignal),u.forceKillAfterDelay=pd(u.forceKillAfterDelay),u.lines=u.lines.map((l,h)=>l&&!qe.has(u.encoding)&&u.buffer[h]),tu.platform==="win32"&&Tb.basename(a,".exe")==="cmd"&&o.unshift("/q"),{file:a,commandArguments:o,options:u}},Cb=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=!0,cleanup:a=!0,all:o=!1,windowsHide:c=!0,killSignal:d="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:l=!1,ipcInput:h,ipc:y=h!==void 0||l,serialization:g="advanced",...b})=>({...b,extendEnv:e,preferLocal:t,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:a,all:o,windowsHide:c,killSignal:d,forceKillAfterDelay:u,gracefulCancel:l,ipcInput:h,ipc:y,serialization:g}),Rb=({env:e,extendEnv:t,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let a=t?{...tu.env,...e}:e;return r||i?Kc({env:a,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):a};p();var tn=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];p();p();import{inspect as mq}from"util";p();function Nt(e){if(typeof e=="string")return Ib(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Ob(e)}var Ib=e=>e.at(-1)===iu?e.slice(0,e.at(-2)===nu?-2:-1):e,Ob=e=>e.at(-1)===Db?e.subarray(0,e.at(-2)===Lb?-2:-1):e,iu=`
132
+ `,Db=iu.codePointAt(0),nu="\r",Lb=nu.codePointAt(0);p();p();import{on as cq}from"events";import{finished as dq}from"stream/promises";p();p();function Ie(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function ea(e,{checkOpen:t=!0}={}){return Ie(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function $t(e,{checkOpen:t=!0}={}){return Ie(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function ta(e,t){return ea(e,t)&&$t(e,t)}p();p();var Bb=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),ra=class{#t;#r;#e=!1;#i=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#s();return this.#i=this.#i?this.#i.then(t,t):t(),this.#i}return(t){let r=()=>this.#n(t);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#i=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#i=void 0,this.#e=!0,this.#t.releaseLock()),t}async#n(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},ia=Symbol();function su(){return this[ia].next()}Object.defineProperty(su,"name",{value:"next"});function au(e){return this[ia].return(e)}Object.defineProperty(au,"name",{value:"return"});var zb=Object.create(Bb,{next:{enumerable:!0,configurable:!0,writable:!0,value:su},return:{enumerable:!0,configurable:!0,writable:!0,value:au}});function na({preventCancel:e=!1}={}){let t=this.getReader(),r=new ra(t,e),i=Object.create(zb);return i[ia]=r,i}p();var ou=e=>{if($t(e,{checkOpen:!1})&&Ar.on!==void 0)return Fb(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Mb.call(e)==="[object ReadableStream]")return na.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Mb}=Object.prototype,Fb=async function*(e){let t=new AbortController,r={};Gb(e,t,r);try{for await(let[i]of Ar.on(e,"data",{signal:t.signal}))yield i}catch(i){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw i}finally{e.destroy()}},Gb=async(e,t,r)=>{try{await Ar.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(i){r.error=i}finally{t.abort()}},Ar={};p();p();p();var Vt=async(e,{init:t,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,finalize:o},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let d=ou(e),u=t();u.length=0;try{for await(let l of d){let h=Nb(l),y=r[h](l,u);du({convertedChunk:y,state:u,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:c})}return Ub({state:u,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:a,maxBuffer:c}),o(u)}catch(l){let h=typeof l=="object"&&l!==null?l:new Error(l);throw h.bufferedData=o(u),h}},Ub=({state:e,getSize:t,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let a=n(e);a!==void 0&&du({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:i,maxBuffer:s})},du=({convertedChunk:e,state:t,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let a=r(e),o=t.length+a;if(o<=s){pu(e,t,n,o);return}let c=i(e,s-t.length);throw c!==void 0&&pu(c,t,n,s),new Ne},pu=(e,t,r,i)=>{t.contents=r(e,t,i),t.length=i},Nb=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=cu.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&cu.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:cu}=Object.prototype,Ne=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};p();var it=e=>e,Er=()=>{},rn=({contents:e})=>e,nn=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},sn=e=>e.length;async function an(e,t){return Vt(e,Kb,t)}var Vb=()=>({contents:[]}),Hb=()=>1,Wb=(e,{contents:t})=>(t.push(e),t),Kb={init:Vb,convertChunk:{string:it,buffer:it,arrayBuffer:it,dataView:it,typedArray:it,others:it},getSize:Hb,truncateChunk:Er,addChunk:Wb,getFinalChunk:Er,finalize:rn};p();async function on(e,t){return Vt(e,iq,t)}var Yb=()=>({contents:new ArrayBuffer(0)}),Jb=e=>Xb.encode(e),Xb=new TextEncoder,uu=e=>new Uint8Array(e),lu=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Zb=(e,t)=>e.slice(0,t),Qb=(e,{contents:t,length:r},i)=>{let n=yu()?tq(t,i):eq(t,i);return new Uint8Array(n).set(e,r),n},eq=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(hu(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},tq=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:hu(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},hu=e=>mu**Math.ceil(Math.log(e)/Math.log(mu)),mu=2,rq=({contents:e,length:t})=>yu()?e:e.slice(0,t),yu=()=>"resize"in ArrayBuffer.prototype,iq={init:Yb,convertChunk:{string:Jb,buffer:uu,arrayBuffer:uu,dataView:lu,typedArray:lu,others:nn},getSize:sn,truncateChunk:Zb,addChunk:Qb,getFinalChunk:Er,finalize:rq};p();async function cn(e,t){return Vt(e,pq,t)}var nq=()=>({contents:"",textDecoder:new TextDecoder}),pn=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),sq=(e,{contents:t})=>t+e,aq=(e,t)=>e.slice(0,t),oq=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},pq={init:nq,convertChunk:{string:it,buffer:pn,arrayBuffer:pn,dataView:pn,typedArray:pn,others:nn},getSize:sn,truncateChunk:aq,addChunk:sq,getFinalChunk:oq,finalize:rn};Object.assign(Ar,{on:cq,finished:dq});var gu=({error:e,stream:t,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(e instanceof Ne))throw e;if(s==="all")return e;let a=uq(r,i,n);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},uq=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",fu=(e,t,r)=>{if(t.length!==r)return;let i=new Ne;throw i.maxBufferInfo={fdNumber:"ipc"},i},_u=(e,t)=>{let{streamName:r,threshold:i,unit:n}=lq(e,t);return`Command's ${r} was larger than ${i} ${n}`},lq=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=e;delete e.maxBufferInfo;let n=rt(t,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Si(r),threshold:n,unit:i}},bu=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(i=>i!==null&&i.length>dn(r)),qu=(e,t,r)=>{if(!t)return e;let i=dn(r);return e.length>i?e.slice(0,i):e},dn=([,e])=>e;var vu=({stdio:e,all:t,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:a,escapedCommand:o,timedOut:c,isCanceled:d,isGracefullyCanceled:u,isMaxBuffer:l,isForcefullyTerminated:h,forceKillAfterDelay:y,killSignal:g,maxBuffer:b,timeout:$,cwd:S})=>{let A=i?.code,q=hq({originalError:i,timedOut:c,timeout:$,isMaxBuffer:l,maxBuffer:b,errorCode:A,signal:n,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:u,isForcefullyTerminated:h,forceKillAfterDelay:y,killSignal:g}),O=gq(i,S),E=O===void 0?"":`
133
+ ${O}`,N=`${q}: ${o}${E}`,R=t===void 0?[e[2],e[1]]:[t],B=[N,...R,...e.slice(3),r.map(z=>fq(z)).join(`
134
+ `)].map(z=>kr(Nt(_q(z)))).filter(Boolean).join(`
135
+
136
+ `);return{originalMessage:O,shortMessage:N,message:B}},hq=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:a,signalDescription:o,exitCode:c,isCanceled:d,isGracefullyCanceled:u,isForcefullyTerminated:l,forceKillAfterDelay:h,killSignal:y})=>{let g=yq(l,h);return t?`Command timed out after ${r} milliseconds${g}`:u?a===void 0?`Command was gracefully canceled with exit code ${c}`:l?`Command was gracefully canceled${g}`:`Command was gracefully canceled with ${a} (${o})`:d?`Command was canceled${g}`:i?`${_u(e,n)}${g}`:s!==void 0?`Command failed with ${s}${g}`:l?`Command was killed with ${y} (${zi(y)})${g}`:a!==void 0?`Command was killed with ${a} (${o})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},yq=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",gq=(e,t)=>{if(e instanceof Ce)return;let r=Xc(e)?e.originalMessage:String(e?.message??e),i=kr(eu(r,t));return i===""?void 0:i},fq=e=>typeof e=="string"?e:mq(e),_q=e=>Array.isArray(e)?e.map(t=>Nt(ku(t))).filter(Boolean).join(`
137
+ `):ku(e),ku=e=>typeof e=="string"?e:se(e)?wi(e):"";var un=({command:e,escapedCommand:t,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:a})=>wu({command:e,escapedCommand:t,cwd:s,durationMs:Rs(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Ht=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:a})=>jr({error:e,command:t,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:a}),jr=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:d,signal:u,stdio:l,all:h,ipcOutput:y,options:{timeoutDuration:g,timeout:b=g,forceKillAfterDelay:$,killSignal:S,cwd:A,maxBuffer:q},isSync:O})=>{let{exitCode:E,signal:N,signalDescription:R}=qq(d,u),{originalMessage:B,shortMessage:z,message:Y}=vu({stdio:l,all:h,ipcOutput:y,originalError:e,signal:N,signalDescription:R,exitCode:E,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,forceKillAfterDelay:$,killSignal:S,maxBuffer:q,timeout:b,cwd:A}),j=Yc(e,Y,O);return Object.assign(j,bq({error:j,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:E,signal:N,signalDescription:R,stdio:l,all:h,ipcOutput:y,cwd:A,originalMessage:B,shortMessage:z})),j},bq=({error:e,command:t,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:d,signal:u,signalDescription:l,stdio:h,all:y,ipcOutput:g,cwd:b,originalMessage:$,shortMessage:S})=>wu({shortMessage:S,originalMessage:$,command:t,escapedCommand:r,cwd:b,durationMs:Rs(i),failed:!0,timedOut:n,isCanceled:s,isGracefullyCanceled:a,isTerminated:u!==void 0,isMaxBuffer:o,isForcefullyTerminated:c,exitCode:d,signal:u,signalDescription:l,code:e.cause?.code,stdout:h[1],stderr:h[2],all:y,stdio:h,ipcOutput:g,pipedFrom:[]}),wu=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),qq=(e,t)=>{let r=e===null?void 0:e,i=t===null?void 0:t,n=i===void 0?void 0:zi(t);return{exitCode:r,signal:i,signalDescription:n}};p();p();p();p();var xu=e=>Number.isFinite(e)?e:0;function kq(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(xu(e*1e3)%1e3),nanoseconds:Math.trunc(xu(e*1e6)%1e3)}}function vq(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function sa(e){switch(typeof e){case"number":{if(Number.isFinite(e))return kq(e);break}case"bigint":return vq(e)}throw new TypeError("Expected a finite number or bigint")}var wq=e=>e===0||e===0n,xq=(e,t)=>t===1||t===1n?e:`${e}s`,Sq=1e-7,$q=24n*60n*60n*1000n;function aa(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let i=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let n=[],s=(u,l)=>{let h=Math.floor(u*10**l+Sq);return(Math.round(h)/10**l).toFixed(l)},a=(u,l,h,y)=>{if(!((n.length===0||!t.colonNotation)&&wq(u)&&!(t.colonNotation&&h==="m"))){if(y??=String(u),t.colonNotation){let g=y.includes(".")?y.split(".")[0].length:y.length,b=n.length>0?2:1;y="0".repeat(Math.max(0,b-g))+y}else y+=t.verbose?" "+xq(l,u):h;n.push(y)}},o=sa(e),c=BigInt(o.days);if(t.hideYearAndDays?a(BigInt(c)*24n+BigInt(o.hours),"hour","h"):(t.hideYear?a(c,"day","d"):(a(c/365n,"year","y"),a(c%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let u=Number(o.seconds),l=Number(o.milliseconds),h=Number(o.microseconds),y=Number(o.nanoseconds);if(a(u,"second","s"),t.formatSubMilliseconds)a(l,"millisecond","ms"),a(h,"microsecond","\xB5s"),a(y,"nanosecond","ns");else{let g=l+h/1e3+y/1e6,b=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,$=g>=1?Math.round(g):Math.ceil(g),S=1e3-10**-b,A=b?Math.min(g,S).toFixed(b):Math.min($,S);a(Number.parseFloat(A),"millisecond","ms",A)}}else{let u=(r?Number(e%$q):e)/1e3%60,l=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,h=s(u,l),y=t.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");a(Number.parseFloat(y),"second","s",y)}if(n.length===0)return i+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(n=n.slice(0,Math.max(t.unitCount,1))),i+n.join(d)}p();var Su=(e,t)=>{e.failed&&Fe({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var $u=(e,t)=>{Lt(t)&&(Su(e,t),Aq(e,t))},Aq=(e,t)=>{let r=`(done in ${aa(e.durationMs)})`;Fe({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var Wt=(e,t,{reject:r})=>{if($u(e,t),e.failed&&r)throw e;return e};p();import{readFileSync as Qu}from"fs";p();p();p();var ju=(e,t)=>At(e)?"asyncGenerator":Cu(e)?"generator":ln(e)?"fileUrl":Cq(e)?"filePath":Oq(e)?"webStream":Ie(e,{checkOpen:!1})?"native":se(e)?"uint8Array":Dq(e)?"asyncIterable":Lq(e)?"iterable":ca(e)?Pu({transform:e},t):Tq(e)?Eq(e,t):"native",Eq=(e,t)=>ta(e.transform,{checkOpen:!1})?jq(e,t):ca(e.transform)?Pu(e,t):Pq(e,t),jq=(e,t)=>(Tu(e,t,"Duplex stream"),"duplex"),Pu=(e,t)=>(Tu(e,t,"web TransformStream"),"webTransform"),Tu=({final:e,binary:t,objectMode:r},i,n)=>{Au(e,`${i}.final`,n),Au(t,`${i}.binary`,n),oa(r,`${i}.objectMode`)},Au=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Pq=({transform:e,final:t,binary:r,objectMode:i},n)=>{if(e!==void 0&&!Eu(e))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ta(t,{checkOpen:!1}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(ca(t))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Eu(t))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return oa(r,`${n}.binary`),oa(i,`${n}.objectMode`),At(e)||At(t)?"asyncGenerator":"generator"},oa=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},Eu=e=>At(e)||Cu(e),At=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",Cu=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",Tq=e=>ee(e)&&(e.transform!==void 0||e.final!==void 0),ln=e=>Object.prototype.toString.call(e)==="[object URL]",Ru=e=>ln(e)&&e.protocol!=="file:",Cq=e=>ee(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Rq.has(t))&&pa(e.file),Rq=new Set(["file","append"]),pa=e=>typeof e=="string",Iu=(e,t)=>e==="native"&&typeof t=="string"&&!Iq.has(t),Iq=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ou=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",mn=e=>Object.prototype.toString.call(e)==="[object WritableStream]",Oq=e=>Ou(e)||mn(e),ca=e=>Ou(e?.readable)&&mn(e?.writable),Dq=e=>Du(e)&&typeof e[Symbol.asyncIterator]=="function",Lq=e=>Du(e)&&typeof e[Symbol.iterator]=="function",Du=e=>typeof e=="object"&&e!==null,$e=new Set(["generator","asyncGenerator","duplex","webTransform"]),hn=new Set(["fileUrl","filePath","fileNumber"]),da=new Set(["fileUrl","filePath"]),Lu=new Set([...da,"webStream","nodeStream"]),Bu=new Set(["webTransform","duplex"]),ht={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};p();var ua=(e,t,r,i)=>i==="output"?Bq(e,t,r):zq(e,t,r),Bq=(e,t,r)=>{let i=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:i,readableObjectMode:e??i}},zq=(e,t,r)=>{let i=t===0?e===!0:r[t-1].value.readableObjectMode,n=t!==r.length-1&&(e??i);return{writableObjectMode:i,readableObjectMode:n}},zu=(e,t)=>{let r=e.findLast(({type:i})=>$e.has(i));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Mu=(e,t,r,i)=>[...e.filter(({type:n})=>!$e.has(n)),...Mq(e,t,r,i)],Mq=(e,t,r,{encoding:i})=>{let n=e.filter(({type:a})=>$e.has(a)),s=Array.from({length:n.length});for(let[a,o]of Object.entries(n))s[a]=Fq({stdioItem:o,index:Number(a),newTransforms:s,optionName:t,direction:r,encoding:i});return Vq(s,r)},Fq=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:i,optionName:n,direction:s,encoding:a})=>t==="duplex"?Gq({stdioItem:e,optionName:n}):t==="webTransform"?Uq({stdioItem:e,index:r,newTransforms:i,direction:s}):Nq({stdioItem:e,index:r,newTransforms:i,direction:s,encoding:a}),Gq=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:i}}},Uq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:a}=ee(t)?t:{transform:t},{writableObjectMode:o,readableObjectMode:c}=ua(a,r,i,n);return{...e,value:{transform:s,writableObjectMode:o,readableObjectMode:c}}},Nq=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:a,final:o,binary:c=!1,preserveNewlines:d=!1,objectMode:u}=ee(t)?t:{transform:t},l=c||qe.has(s),{writableObjectMode:h,readableObjectMode:y}=ua(u,r,i,n);return{...e,value:{transform:a,final:o,binary:l,preserveNewlines:d,writableObjectMode:h,readableObjectMode:y}}},Vq=(e,t)=>t==="input"?e.reverse():e;p();import la from"process";var Fu=(e,t,r)=>{let i=e.map(n=>Hq(n,t));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??Yq},Hq=({type:e,value:t},r)=>Wq[r]??Gu[e](t),Wq=["input","output","output"],Kt=()=>{},ma=()=>"input",Gu={generator:Kt,asyncGenerator:Kt,fileUrl:Kt,filePath:Kt,iterable:ma,asyncIterable:ma,uint8Array:ma,webStream:e=>mn(e)?"output":"input",nodeStream(e){return $t(e,{checkOpen:!1})?ea(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Kt,duplex:Kt,native(e){let t=Kq(e);if(t!==void 0)return t;if(Ie(e,{checkOpen:!1}))return Gu.nodeStream(e)}},Kq=e=>{if([0,la.stdin].includes(e))return"input";if([1,2,la.stdout,la.stderr].includes(e))return"output"},Yq="output";p();p();var Uu=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Nu=({stdio:e,ipc:t,buffer:r,...i},n,s)=>{let a=Jq(e,i).map((o,c)=>Vu(o,c));return s?Zq(a,r,n):Uu(a,t)},Jq=(e,t)=>{if(e===void 0)return Se.map(i=>t[i]);if(Xq(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Se.map(i=>`\`${i}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,Se.length);return Array.from({length:r},(i,n)=>e[n])},Xq=e=>Se.some(t=>e[t]!==void 0),Vu=(e,t)=>Array.isArray(e)?e.map(r=>Vu(r,t)):e??(t>=Se.length?"ignore":"pipe"),Zq=(e,t,r)=>e.map((i,n)=>!t[n]&&n!==0&&!Bt(r,n)&&Qq(i)?"ignore":i),Qq=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");p();import{readFileSync as ek}from"fs";import tk from"tty";var Wu=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||t!=="native"?e:s?rk({stdioItem:e,fdNumber:i,direction:n}):sk({stdioItem:e,fdNumber:i}),rk=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i,direction:n})=>{let s=ik({value:t,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(Ie(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},ik=({value:e,optionName:t,fdNumber:r,direction:i})=>{let n=nk(e,r);if(n!==void 0){if(i==="output")return{type:"fileNumber",value:n,optionName:t};if(tk.isatty(n))throw new TypeError(`The \`${t}: ${Gi(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:tt(ek(n)),optionName:t}}},nk=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=xi.indexOf(e);if(r!==-1)return r},sk=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:i})=>t==="inherit"?{type:"nodeStream",value:Hu(i,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:Hu(t,t,r),optionName:r}:Ie(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,Hu=(e,t,r)=>{let i=xi[e];if(i===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return i};p();var Ku=({input:e,inputFile:t},r)=>r===0?[...ak(e),...pk(t)]:[],ak=e=>e===void 0?[]:[{type:ok(e),value:e,optionName:"input"}],ok=e=>{if($t(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(se(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},pk=e=>e===void 0?[]:[{...ck(e),optionName:"inputFile"}],ck=e=>{if(ln(e))return{type:"fileUrl",value:e};if(pa(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};p();var Yu=e=>e.filter((t,r)=>e.every((i,n)=>t.value!==i.value||r>=n||t.type==="generator"||t.type==="asyncGenerator")),Ju=({stdioItem:{type:e,value:t,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let a=dk(n,e);if(a.length!==0){if(s){uk({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});return}if(Lu.has(e))return Xu({otherStdioItems:a,type:e,value:t,optionName:r,direction:i});Bu.has(e)&&mk({otherStdioItems:a,type:e,value:t,optionName:r})}},dk=(e,t)=>e.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===t).map((n=>({...n,direction:r})))),uk=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{da.has(t)&&Xu({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})},Xu=({otherStdioItems:e,type:t,value:r,optionName:i,direction:n})=>{let s=e.filter(o=>lk(o,r));if(s.length===0)return;let a=s.find(o=>o.direction!==n);return Zu(a,i,t),n==="output"?s[0].stream:void 0},lk=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,mk=({otherStdioItems:e,type:t,value:r,optionName:i})=>{let n=e.find(({value:{transform:s}})=>s===r.transform);Zu(n,i,t)},Zu=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ht[r]} that is the same.`)};var yn=(e,t,r,i)=>{let s=Nu(t,r,i).map((o,c)=>hk({stdioOption:o,fdNumber:c,options:t,isSync:i})),a=vk({initialFileDescriptors:s,addProperties:e,options:t,isSync:i});return t.stdio=a.map(({stdioItems:o})=>Sk(o)),a},hk=({stdioOption:e,fdNumber:t,options:r,isSync:i})=>{let n=Si(t),{stdioItems:s,isStdioArray:a}=yk({stdioOption:e,fdNumber:t,options:r,optionName:n}),o=Fu(s,t,n),c=s.map(l=>Wu({stdioItem:l,isStdioArray:a,fdNumber:t,direction:o,isSync:i})),d=Mu(c,n,o,r),u=zu(d,o);return kk(d,u),{direction:o,objectMode:u,stdioItems:d}},yk=({stdioOption:e,fdNumber:t,options:r,optionName:i})=>{let s=[...(Array.isArray(e)?e:[e]).map(c=>gk(c,i)),...Ku(r,t)],a=Yu(s),o=a.length>1;return fk(a,o,i),bk(a),{stdioItems:a,isStdioArray:o}},gk=(e,t)=>({type:ju(e,t),value:e,optionName:t}),fk=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:i,optionName:n}of e)if(_k.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},_k=new Set(["ignore","ipc"]),bk=e=>{for(let t of e)qk(t)},qk=({type:e,value:t,optionName:r})=>{if(Ru(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
138
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Iu(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},kk=(e,t)=>{if(!t)return;let r=e.find(({type:i})=>hn.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},vk=({initialFileDescriptors:e,addProperties:t,options:r,isSync:i})=>{let n=[];try{for(let s of e)n.push(wk({fileDescriptor:s,fileDescriptors:n,addProperties:t,options:r,isSync:i}));return n}catch(s){throw ha(n),s}},wk=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:a})=>{let o=r.map(c=>xk({stdioItem:c,addProperties:n,direction:e,options:s,fileDescriptors:i,isSync:a}));return{direction:e,objectMode:t,stdioItems:o}},xk=({stdioItem:e,addProperties:t,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let a=Ju({stdioItem:e,direction:r,fileDescriptors:n,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[r][e.type](e,i)}},ha=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!Te(r)&&r.destroy()},Sk=e=>{if(e.length>1)return e.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var tl=(e,t)=>yn(Ak,e,t,!0),Ve=({type:e,optionName:t})=>{rl(t,ht[e])},$k=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&rl(e,`"${t}"`),{}),rl=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},el={generator(){},asyncGenerator:Ve,webStream:Ve,nodeStream:Ve,webTransform:Ve,duplex:Ve,asyncIterable:Ve,native:$k},Ak={input:{...el,fileUrl:({value:e})=>({contents:[tt(Qu(e))]}),filePath:({value:{file:e}})=>({contents:[tt(Qu(e))]}),fileNumber:Ve,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...el,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:Ve,string:Ve,uint8Array:Ve}};p();var nt=(e,{stripFinalNewline:t},r)=>ya(t,r)&&e!==void 0&&!Array.isArray(e)?Nt(e):e,ya=(e,t)=>t==="all"?e[1]||e[2]:e[t];p();p();import{Transform as Kk,getDefaultHighWaterMark as ml}from"stream";p();var gn=(e,t,r,i)=>e||r?void 0:nl(t,i),fa=(e,t,r)=>r?e.flatMap(i=>il(i,t)):il(e,t),il=(e,t)=>{let{transform:r,final:i}=nl(t,{});return[...r(e),...i()]},nl=(e,t)=>(t.previousChunks="",{transform:Ek.bind(void 0,t,e),final:Pk.bind(void 0,t)}),Ek=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=e,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
139
+ `){let a=jk(r,s,t,e),o=r.slice(n+1,s+1-a);i.length>0&&(o=ga(i,o),i=""),yield o,n=s}n!==r.length-1&&(i=ga(i,r.slice(n+1))),e.previousChunks=i},jk=(e,t,r,i)=>r?0:(i.isWindowsNewline=t!==0&&e[t-1]==="\r",i.isWindowsNewline?2:1),Pk=function*({previousChunks:e}){e.length>0&&(yield e)},sl=({binary:e,preserveNewlines:t,readableObjectMode:r,state:i})=>e||t||r?void 0:{transform:Tk.bind(void 0,i)},Tk=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof t=="string"?Ck:Ik;if(t.at(-1)===n){yield t;return}yield s(t,e?i:r)},ga=(e,t)=>`${e}${t}`,Ck={windowsNewline:`\r
140
140
  `,unixNewline:`
141
141
  `,LF:`
142
- `,concatBytes:ga},Ck=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},Rk={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Ck};p();import{Buffer as Ik}from"buffer";var al=(e,t)=>e?void 0:Ok.bind(void 0,t),Ok=function*(e,t){if(typeof t!="string"&&!se(t)&&!Ik.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},ol=(e,t)=>e?Dk.bind(void 0,t):Lk.bind(void 0,t),Dk=function*(e,t){pl(e,t),yield t},Lk=function*(e,t){if(pl(e,t),typeof t!="string"&&!se(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},pl=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
142
+ `,concatBytes:ga},Rk=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},Ik={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Rk};p();import{Buffer as Ok}from"buffer";var al=(e,t)=>e?void 0:Dk.bind(void 0,t),Dk=function*(e,t){if(typeof t!="string"&&!se(t)&&!Ok.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},ol=(e,t)=>e?Lk.bind(void 0,t):Bk.bind(void 0,t),Lk=function*(e,t){pl(e,t),yield t},Bk=function*(e,t){if(pl(e,t),typeof t!="string"&&!se(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},pl=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
143
143
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
144
- if (condition) { yield value; }`)};p();import{Buffer as Bk}from"buffer";import{StringDecoder as zk}from"string_decoder";var fn=(e,t,r)=>{if(r)return;if(e)return{transform:Mk.bind(void 0,new TextEncoder)};let i=new zk(t);return{transform:Fk.bind(void 0,i),final:Gk.bind(void 0,i)}},Mk=function*(e,t){Bk.isBuffer(t)?yield tt(t):typeof t=="string"?yield e.encode(t):yield t},Fk=function*(e,t){yield se(t)?e.write(t):t},Gk=function*(e){let t=e.end();t!==""&&(yield t)};p();import{callbackify as cl}from"util";var _a=cl(async(e,t,r,i)=>{t.currentIterable=e(...r);try{for await(let n of t.currentIterable)i.push(n)}finally{delete t.currentIterable}}),_n=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=Nk}=t[r];for await(let n of i(e))yield*_n(n,t,r+1)},dl=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Uk(r,Number(t),e)},Uk=async function*(e,t,r){if(e!==void 0)for await(let i of e())yield*_n(i,r,t+1)},ul=cl(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Nk=function*(e){yield e};p();var ba=(e,t,r,i)=>{try{for(let n of e(...t))r.push(n);i()}catch(n){i(n)}},ll=(e,t)=>[...t.flatMap(r=>[...Et(r,e,0)]),...Pr(e)],Et=function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=Hk}=t[r];for(let n of i(e))yield*Et(n,t,r+1)},Pr=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Vk(r,Number(t),e)},Vk=function*(e,t,r){if(e!==void 0)for(let i of e())yield*Et(i,r,t+1)},Hk=function*(e){yield e};var qa=({value:e,value:{transform:t,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:a})=>{let o={},c=hl(e,a,s),d=At(t),u=At(r),l=d?_a.bind(void 0,_n,o):ba.bind(void 0,Et),h=d||u?_a.bind(void 0,dl,o):ba.bind(void 0,Pr),y=d||u?ul.bind(void 0,o):void 0;return{stream:new Wk({writableObjectMode:i,writableHighWaterMark:ml(i),readableObjectMode:n,readableHighWaterMark:ml(n),transform(b,$,S){l([b,c,0],this,S)},flush(b){h([c],this,b)},destroy:y})}},bn=(e,t,r,i)=>{let n=t.filter(({type:a})=>a==="generator"),s=i?n.reverse():n;for(let{value:a,optionName:o}of s){let c=hl(a,r,o);e=ll(c,e)}return e},hl=({transform:e,final:t,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},a,o)=>{let c={};return[{transform:al(i,o)},fn(r,a,i),gn(r,s,i,c),{transform:e,final:t},{transform:ol(n,o)},sl({binary:r,preserveNewlines:s,readableObjectMode:n,state:c})].filter(Boolean)};var yl=(e,t)=>{for(let r of Kk(e))Yk(e,r,t)},Kk=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),Yk=(e,t,r)=>{let{stdioItems:i}=e[t],n=i.filter(({contents:o})=>o!==void 0);if(n.length===0)return;if(t!==0){let[{type:o,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ht[o]} with synchronous methods.`)}let a=n.map(({contents:o})=>o).map(o=>Jk(o,i));r.input=qr(a)},Jk=(e,t)=>{let r=bn(e,t,"utf8",!0);return Xk(r),qr(r)},Xk=e=>{let t=e.find(r=>typeof r!="string"&&!se(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};p();import{writeFileSync as tv,appendFileSync as rv}from"fs";p();var qn=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:i})=>i!=="all"&&Bt(r,i)&&!qe.has(t)&&Zk(i)&&(e.some(({type:n,value:s})=>n==="native"&&Qk.has(s))||e.every(({type:n})=>$e.has(n))),Zk=e=>e===1||e===2,Qk=new Set(["pipe","overlapped"]),gl=async(e,t,r,i)=>{for await(let n of e)ev(t)||_l(n,r,i)},fl=(e,t,r)=>{for(let i of e)_l(i,t,r)},ev=e=>e._readableState.pipes.length>0,_l=(e,t,r)=>{let i=Ti(e);Fe({type:"output",verboseMessage:i,fdNumber:t,verboseInfo:r})};var bl=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(t===null)return{output:Array.from({length:3})};let s={},a=new Set([]);return{output:t.map((c,d)=>iv({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:i,verboseInfo:n},r)),...s}},iv=({result:e,fileDescriptors:t,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:a},{buffer:o,encoding:c,lines:d,stripFinalNewline:u,maxBuffer:l})=>{if(e===null)return;let h=qu(e,s,l),y=tt(h),{stdioItems:g,objectMode:b}=t[r],$=nv([y],g,c,i),{serializedResult:S,finalResult:A=S}=sv({chunks:$,objectMode:b,encoding:c,lines:d,stripFinalNewline:u,fdNumber:r});av({serializedResult:S,fdNumber:r,state:i,verboseInfo:a,encoding:c,stdioItems:g,objectMode:b});let q=o[r]?A:void 0;try{return i.error===void 0&&ov(S,g,n),q}catch(O){return i.error=O,q}},nv=(e,t,r,i)=>{try{return bn(e,t,r,!1)}catch(n){return i.error=n,e}},sv=({chunks:e,objectMode:t,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:qr(e)};let a=Ip(e,r);return i[s]?{serializedResult:a,finalResult:fa(a,!n[s],t)}:{serializedResult:a}},av=({serializedResult:e,fdNumber:t,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:a})=>{if(!qn({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:t}))return;let o=fa(e,!1,a);try{fl(o,t,i)}catch(c){r.error??=c}},ov=(e,t,r)=>{for(let{path:i,append:n}of t.filter(({type:s})=>hn.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?rv(i,e):(r.add(s),tv(i,e))}};p();var ql=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,nt(t,r,"all")]:Array.isArray(t)?[nt(e,r,"all"),...t]:se(e)&&se(t)?$s([e,t]):`${e}${t}`};p();p();import{once as ka}from"events";var kl=async(e,t)=>{let[r,i]=await pv(e);return t.isForcefullyTerminated??=!1,[r,i]},pv=async e=>{let[t,r]=await Promise.allSettled([ka(e,"spawn"),ka(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?vl(e):r.value},vl=async e=>{try{return await ka(e,"exit")}catch{return vl(e)}},wl=async e=>{let[t,r]=await e;if(!cv(t,r)&&va(t,r))throw new Ce;return[t,r]},cv=(e,t)=>e===void 0&&t===void 0,va=(e,t)=>e!==0||t!==null;var xl=({error:e,status:t,signal:r,output:i},{maxBuffer:n})=>{let s=dv(e,t,r),a=s?.code==="ETIMEDOUT",o=bu(s,i,n);return{resultError:s,exitCode:t,signal:r,timedOut:a,isMaxBuffer:o}},dv=(e,t,r)=>e!==void 0?e:va(t,r)?new Ce:void 0;var Sl=(e,t,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:a,startTime:o,verboseInfo:c,options:d,fileDescriptors:u}=lv(e,t,r),l=yv({file:i,commandArguments:n,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:u,startTime:o});return Wt(l,c,d)},lv=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=Ri(e,t,r),o=mv(r),{file:c,commandArguments:d,options:u}=en(e,t,o);hv(u);let l=tl(u,a);return{file:c,commandArguments:d,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:u,fileDescriptors:l}},mv=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,hv=({ipc:e,ipcInput:t,detached:r,cancelSignal:i})=>{t&&kn("ipcInput"),e&&kn("ipc: true"),r&&kn("detached: true"),i&&kn("cancelSignal")},kn=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},yv=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:a,startTime:o})=>{let c=gv({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:a,startTime:o});if(c.failed)return c;let{resultError:d,exitCode:u,signal:l,timedOut:h,isMaxBuffer:y}=xl(c,r),{output:g,error:b=d}=bl({fileDescriptors:a,syncResult:c,options:r,isMaxBuffer:y,verboseInfo:s}),$=g.map((A,q)=>nt(A,r,q)),S=nt(ql(g,r),r,"all");return _v({error:b,exitCode:u,signal:l,timedOut:h,isMaxBuffer:y,stdio:$,all:S,options:r,command:i,escapedCommand:n,startTime:o})},gv=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:a})=>{try{yl(s,r);let o=fv(r);return uv(...tn(e,t,o))}catch(o){return Ht({error:o,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:a,isSync:!0})}},fv=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:dn(t)}),_v=({error:e,exitCode:t,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:a,options:o,command:c,escapedCommand:d,startTime:u})=>e===void 0?un({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:o,startTime:u}):jr({error:e,command:c,escapedCommand:d,timedOut:i,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:n,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:s,all:a,ipcOutput:[],options:o,startTime:u,isSync:!0});p();import{setMaxListeners as sx}from"events";import{spawn as ax}from"child_process";p();import Pl from"process";p();import{once as wa,on as bv}from"events";var $l=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0,filter:s}={})=>(Ft({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Ki(e)}),qv({anyProcess:e,channel:t,isSubprocess:r,filter:s,reference:n})),qv=async({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:n})=>{Ni(t,n);let s=mt(e,t,r),a=new AbortController;try{return await Promise.race([kv(s,i,a),vv(s,r,a),wv(s,r,a)])}catch(o){throw Gt(e),o}finally{a.abort(),Vi(t,n)}},kv=async(e,t,{signal:r})=>{if(t===void 0){let[i]=await wa(e,"message",{signal:r});return i}for await(let[i]of bv(e,"message",{signal:r}))if(t(i))return i},vv=async(e,t,{signal:r})=>{await wa(e,"disconnect",{signal:r}),ld(t)},wv=async(e,t,{signal:r})=>{let[i]=await wa(e,"strict:error",{signal:r});throw Fi(i,t)};p();import{once as El,on as xv}from"events";var jl=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0}={})=>xa({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),xa=({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Ft({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Ki(e)}),Ni(t,s);let a=mt(e,t,r),o=new AbortController,c={};return Sv(e,a,o),$v({ipcEmitter:a,isSubprocess:r,controller:o,state:c}),Av({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:r,shouldAwait:n,controller:o,state:c,reference:s})},Sv=async(e,t,r)=>{try{await El(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},$v=async({ipcEmitter:e,isSubprocess:t,controller:r,state:i})=>{try{let[n]=await El(e,"strict:error",{signal:r.signal});i.error=Fi(n,t),r.abort()}catch{}},Av=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:a,reference:o}){try{for await(let[c]of xv(r,"message",{signal:s.signal}))Al(a),yield c}catch{Al(a)}finally{s.abort(),Vi(t,o),i||Gt(e),n&&await e}},Al=({error:e})=>{if(e)throw e};var Tl=(e,{ipc:t})=>{Object.assign(e,Rl(e,!1,t))},Cl=()=>{let e=Pl,t=!0,r=Pl.channel!==void 0;return{...Rl(e,t,r),getCancelSignal:zd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},Rl=(e,t,r)=>({sendMessage:Zi.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:$l.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:jl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});p();import{ChildProcess as Ev}from"child_process";import{PassThrough as jv,Readable as Pv,Writable as Tv,Duplex as Cv}from"stream";var Il=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:a})=>{ha(i);let o=new Ev;Rv(o,i),Object.assign(o,{readable:Iv,writable:Ov,duplex:Dv});let c=Ht({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:!1}),d=Lv(c,a,n);return{subprocess:o,promise:d}},Rv=(e,t)=>{let r=Tr(),i=Tr(),n=Tr(),s=Array.from({length:t.length-3},Tr),a=Tr(),o=[r,i,n,...s];Object.assign(e,{stdin:r,stdout:i,stderr:n,all:a,stdio:o})},Tr=()=>{let e=new jv;return e.end(),e},Iv=()=>new Pv({read(){}}),Ov=()=>new Tv({write(){}}),Dv=()=>new Cv({read(){},write(){}}),Lv=async(e,t,r)=>Wt(e,t,r);p();import{createReadStream as Ol,createWriteStream as Dl}from"fs";import{Buffer as Bv}from"buffer";import{Readable as Cr,Writable as zv,Duplex as Mv}from"stream";var Bl=(e,t)=>yn(Fv,e,t,!1),Rr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ht[e]}.`)},Ll={fileNumber:Rr,generator:qa,asyncGenerator:qa,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let i=t||r;return{stream:Mv.fromWeb(e,{objectMode:i})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Fv={input:{...Ll,fileUrl:({value:e})=>({stream:Ol(e)}),filePath:({value:{file:e}})=>({stream:Ol(e)}),webStream:({value:e})=>({stream:Cr.fromWeb(e)}),iterable:({value:e})=>({stream:Cr.from(e)}),asyncIterable:({value:e})=>({stream:Cr.from(e)}),string:({value:e})=>({stream:Cr.from(e)}),uint8Array:({value:e})=>({stream:Cr.from(Bv.from(e))})},output:{...Ll,fileUrl:({value:e})=>({stream:Dl(e)}),filePath:({value:{file:e,append:t}})=>({stream:Dl(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:zv.fromWeb(e)}),iterable:Rr,asyncIterable:Rr,string:Rr,uint8Array:Rr}};p();p();import{on as Gv,once as zl}from"events";import{PassThrough as Uv,getDefaultHighWaterMark as Nv}from"stream";import{finished as Gl}from"stream/promises";function jt(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let n of e)$a(n);let t=e.some(({readableObjectMode:n})=>n),r=Vv(e,t),i=new Sa({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of e)i.add(n);return i}var Vv=(e,t)=>{if(e.length===0)return Nv(t);let r=e.filter(({readableObjectMode:i})=>i===t).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},Sa=class extends Uv{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(t){if($a(t),this.#t.has(t))return;this.#t.add(t),this.#i??=Hv(this,this.#t,this.#s);let r=Yv({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(t,r),t.pipe(this,{end:!1})}async remove(t){if($a(t),!this.#t.has(t))return!1;let r=this.#n.get(t);return r===void 0?!1:(this.#n.delete(t),t.unpipe(this),await r,!0)}},Hv=async(e,t,r)=>{vn(e,Ml);let i=new AbortController;try{await Promise.race([Wv(e,i),Kv(e,t,r,i)])}finally{i.abort(),vn(e,-Ml)}},Wv=async(e,{signal:t})=>{try{await Gl(e,{signal:t,cleanup:!0})}catch(r){throw Ul(e,r),r}},Kv=async(e,t,r,{signal:i})=>{for await(let[n]of Gv(e,"unpipe",{signal:i}))t.has(n)&&n.emit(r)},$a=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Yv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:a})=>{vn(e,Fl);let o=new AbortController;try{await Promise.race([Jv(s,t,o),Xv({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:o}),Zv({stream:t,streams:r,ended:i,aborted:n,unpipeEvent:a,controller:o})])}finally{o.abort(),vn(e,-Fl)}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?Aa(e):Qv(e))},Jv=async(e,t,{signal:r})=>{try{await e,r.aborted||Aa(t)}catch(i){r.aborted||Ul(t,i)}},Xv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await Gl(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&i.add(t)}catch(a){if(s.aborted||!r.has(t))return;Nl(a)?n.add(t):Vl(e,a)}},Zv=async({stream:e,streams:t,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await zl(e,n,{signal:s}),!e.readable)return zl(s,"abort",{signal:s});t.delete(e),r.delete(e),i.delete(e)},Qv=e=>{e.writable&&e.end()},Ul=(e,t)=>{Nl(t)?Aa(e):Vl(e,t)},Nl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Aa=e=>{(e.readable||e.writable)&&e.destroy()},Vl=(e,t)=>{e.destroyed||(e.once("error",ew),e.destroy(t))},ew=()=>{},vn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Ml=2,Fl=1;p();import{finished as Hl}from"stream/promises";var Yt=(e,t)=>{e.pipe(t),tw(e,t),rw(e,t)},tw=async(e,t)=>{if(!(Te(e)||Te(t))){try{await Hl(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Ea(t)}},Ea=e=>{e.writable&&e.end()},rw=async(e,t)=>{if(!(Te(e)||Te(t))){try{await Hl(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ja(e)}},ja=e=>{e.readable&&e.destroy()};var Wl=(e,t,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:a}]of Object.entries(t)){for(let{stream:o}of s.filter(({type:c})=>$e.has(c)))iw(e,o,a,n);for(let{stream:o}of s.filter(({type:c})=>!$e.has(c)))sw({subprocess:e,stream:o,direction:a,fdNumber:n,pipeGroups:i,controller:r})}for(let[n,s]of i.entries()){let a=s.length===1?s[0]:jt(s);Yt(a,n)}},iw=(e,t,r,i)=>{r==="output"?Yt(e.stdio[i],t):Yt(t,e.stdio[i]);let n=nw[i];n!==void 0&&(e[n]=t),e.stdio[i]=t},nw=["stdin","stdout","stderr"],sw=({subprocess:e,stream:t,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(t===void 0)return;aw(t,s);let[a,o]=r==="output"?[t,e.stdio[i]]:[e.stdio[i],t],c=n.get(a)??[];n.set(a,[...c,o])},aw=(e,{signal:t})=>{Te(e)&&St(e,ow,t)},ow=2;p();import{addAbortListener as dw}from"events";p();p();var Pt=[];Pt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Pt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Pt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wn=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Pa=Symbol.for("signal-exit emitter"),Ta=globalThis,pw=Object.defineProperty.bind(Object),Ca=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ta[Pa])return Ta[Pa];pw(Ta,Pa,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let i=this.listeners[t],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(t,r,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let s of this.listeners[t])n=s(r,i)===!0||n;return t==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},xn=class{},cw=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ra=class extends xn{onExit(){return()=>{}}load(){}unload(){}},Ia=class extends xn{#t=Oa.platform==="win32"?"SIGINT":"SIGHUP";#r=new Ca;#e;#i;#s;#n={};#a=!1;constructor(t){super(),this.#e=t,this.#n={};for(let r of Pt)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||t.kill(t.pid,o)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,r){if(!wn(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,t),()=>{this.#r.removeListener(i,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let t of Pt)try{let r=this.#n[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#o(t)}}unload(){this.#a&&(this.#a=!1,Pt.forEach(t=>{let r=this.#n[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1)}#o(t){return wn(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let i=this.#i;if(t==="exit"&&wn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,t,...r)}},Oa=globalThis.process,{onExit:Kl,load:d2,unload:u2}=cw(wn(Oa)?new Ia(Oa):new Ra);var Yl=(e,{cleanup:t,detached:r},{signal:i})=>{if(!t||r)return;let n=Kl(()=>{e.kill()});dw(i,()=>{n()})};p();p();var Xl=({source:e,sourcePromise:t,boundOptions:r,createNested:i},...n)=>{let s=Ci(),{destination:a,destinationStream:o,destinationError:c,from:d,unpipeSignal:u}=uw(r,i,n),{sourceStream:l,sourceError:h}=mw(e,d),{options:y,fileDescriptors:g}=Ue.get(e);return{sourcePromise:t,sourceStream:l,sourceOptions:y,sourceError:h,destination:a,destinationStream:o,destinationError:c,unpipeSignal:u,fileDescriptors:g,startTime:s}},uw=(e,t,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:a}={}}=lw(e,t,...r),o=Ui(i,s);return{destination:i,destinationStream:o,from:n,unpipeSignal:a}}catch(i){return{destinationError:i}}},lw=(e,t,r,...i)=>{if(Array.isArray(r))return{destination:t(Jl,e)(r,...i),pipeOptions:e};if(typeof r=="string"||r instanceof URL||xs(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,a]=vi(r,...i);return{destination:t(Jl)(n,s,a),pipeOptions:a}}if(Ue.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Jl=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),mw=(e,t)=>{try{return{sourceStream:Ut(e,t)}}catch(r){return{sourceError:r}}};p();var Ql=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:a})=>{let o=hw({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i});if(o!==void 0)throw Da({error:o,fileDescriptors:n,sourceOptions:s,startTime:a})},hw=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i})=>{if(t!==void 0&&i!==void 0)return i;if(i!==void 0)return ja(e),i;if(t!==void 0)return Ea(r),t},Da=({error:e,fileDescriptors:t,sourceOptions:r,startTime:i})=>Ht({error:e,command:Zl,escapedCommand:Zl,fileDescriptors:t,options:r,startTime:i,isSync:!1}),Zl="source.pipe(destination)";p();var em=async e=>{let[{status:t,reason:r,value:i=r},{status:n,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(i)||a.pipedFrom.push(i),n==="rejected")throw a;if(t==="rejected")throw i;return a};p();import{finished as yw}from"stream/promises";var tm=(e,t,r)=>{let i=Sn.has(t)?fw(e,t):gw(e,t);return St(e,bw,r.signal),St(t,qw,r.signal),_w(t),i},gw=(e,t)=>{let r=jt([e]);return Yt(r,t),Sn.set(t,r),r},fw=(e,t)=>{let r=Sn.get(t);return r.add(e),r},_w=async e=>{try{await yw(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Sn.delete(e)},Sn=new WeakMap,bw=2,qw=1;p();import{aborted as kw}from"util";var rm=(e,t)=>e===void 0?[]:[vw(e,t)],vw=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await kw(e,t),await r.remove(t);let a=new Error("Pipe canceled by `unpipeSignal` option.");throw Da({error:a,fileDescriptors:i,sourceOptions:n,startTime:s})};var $n=(e,...t)=>{if(ee(t[0]))return $n.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...i}=Xl(e,...t),n=ww({...i,destination:r});return n.pipe=$n.bind(void 0,{...e,source:r,sourcePromise:n,boundOptions:{}}),n},ww=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:a,unpipeSignal:o,fileDescriptors:c,startTime:d})=>{let u=xw(e,n);Ql({sourceStream:t,sourceError:i,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:r,startTime:d});let l=new AbortController;try{let h=tm(t,s,l);return await Promise.race([em(u),...rm(o,{sourceStream:t,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:d})])}finally{l.abort()}},xw=(e,t)=>Promise.allSettled([e,t]);p();p();p();import{setImmediate as Tw}from"timers/promises";p();import{on as Sw}from"events";import{getDefaultHighWaterMark as $w}from"stream";var An=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let a=new AbortController;return Aw(t,a),nm({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&i,encoding:n,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},Aw=async(e,t)=>{try{await e}catch{}finally{t.abort()}},La=({stream:e,onStreamEnd:t,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let a=new AbortController;Ew(t,a,e);let o=e.readableObjectMode&&!s;return nm({stream:e,controller:a,binary:i==="buffer",shouldEncode:!o,encoding:i,shouldSplit:!o&&r,preserveNewlines:!n})},Ew=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},nm=({stream:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})=>{let o=Sw(e,"data",{signal:t.signal,highWaterMark:im,highWatermark:im});return jw({onStdoutChunk:o,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})},Ba=$w(!0),im=Ba,jw=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a}){let o=Pw({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a});try{for await(let[c]of e)yield*Et(c,o,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Pr(o)}},Pw=({binary:e,shouldEncode:t,encoding:r,shouldSplit:i,preserveNewlines:n})=>[fn(e,r,!t),gn(e,n,!i,{})].filter(Boolean);var sm=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:a,allMixed:o,stripFinalNewline:c,verboseInfo:d,streamInfo:u})=>{let l=Cw({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:o,verboseInfo:d,streamInfo:u});if(!n){await Promise.all([Rw(e),l]);return}let h=ya(c,r),y=La({stream:e,onStreamEnd:t,lines:a,encoding:i,stripFinalNewline:h,allMixed:o}),[g]=await Promise.all([Iw({stream:e,iterable:y,fdNumber:r,encoding:i,maxBuffer:s,lines:a}),l]);return g},Cw=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!qn({stdioItems:a[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let o=La({stream:e,onStreamEnd:t,lines:!0,encoding:i,stripFinalNewline:!0,allMixed:n});await gl(o,e,r,s)},Rw=async e=>{await Tw(),e.readableFlowing===null&&e.resume()},Iw=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:a})=>{try{return t||a?await an(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await on(r,{maxBuffer:s})):await cn(r,{maxBuffer:s})}catch(o){return am(gu({error:o,stream:e,readableObjectMode:t,lines:a,encoding:n,fdNumber:i}))}},za=async e=>{try{return await e}catch(t){return am(t)}},am=({bufferedData:e})=>Cp(e)?new Uint8Array(e):e;p();import{finished as Ow}from"stream/promises";var Ir=async(e,t,r,{isSameDirection:i,stopOnExit:n=!1}={})=>{let s=Dw(e,r),a=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],Ow(e,{cleanup:!0,signal:a.signal})])}catch(o){s.stdinCleanedUp||zw(o,t,r,i)}finally{a.abort()}},Dw=(e,{originalStreams:[t],subprocess:r})=>{let i={stdinCleanedUp:!1};return e===t&&Lw(e,r,i),i},Lw=(e,t,r)=>{let{_destroy:i}=e;e._destroy=(...n)=>{Bw(t,r),i.call(e,...n)}},Bw=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},zw=(e,t,r,i)=>{if(!Mw(e,t,r,i))throw e},Mw=(e,t,r,i=!0)=>r.propagating?om(e)||En(e):(r.propagating=!0,Ma(r,t)===i?om(e):En(e)),Ma=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",En=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",om=e=>e?.code==="EPIPE";var pm=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>e.stdio.map((c,d)=>Fa({stream:c,fdNumber:d,encoding:t,buffer:r[d],maxBuffer:i[d],lines:n[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:o})),Fa=async({stream:e,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:c,streamInfo:d})=>{if(!e)return;let u=Ir(e,t,d);if(Ma(d,t)){await u;return}let[l]=await Promise.all([sm({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:c,streamInfo:d}),u]);return l};var cm=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?jt([e,t].filter(Boolean)):void 0,dm=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>Fa({...Fw(e,r),fdNumber:"all",encoding:t,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:Gw(e),stripFinalNewline:s,verboseInfo:a,streamInfo:o}),Fw=({stdout:e,stderr:t,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:r,buffer:s}},Gw=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;p();import{once as Uw}from"events";p();p();var um=e=>Bt(e,"ipc"),lm=(e,t)=>{let r=Ti(e);Fe({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var mm=async({subprocess:e,buffer:t,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let a=um(s),o=rt(t,"ipc"),c=rt(r,"ipc");for await(let d of xa({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:i,shouldAwait:!1,reference:!0}))o&&(fu(e,n,c),n.push(d)),a&&lm(d,s);return n},hm=async(e,t)=>(await Promise.allSettled([e]),t);var ym=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:c,stripFinalNewline:d,ipc:u,ipcInput:l},context:h,verboseInfo:y,fileDescriptors:g,originalStreams:b,onInternalError:$,controller:S})=>{let A=kl(e,h),q={originalStreams:b,fileDescriptors:g,subprocess:e,exitPromise:A,propagating:!1},O=pm({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:y,streamInfo:q}),E=dm({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:y,streamInfo:q}),N=[],R=mm({subprocess:e,buffer:r,maxBuffer:i,ipc:u,ipcOutput:N,verboseInfo:y}),B=Nw(b,e,q),z=Vw(g,q);try{return await Promise.race([Promise.all([{},wl(A),Promise.all(O),E,R,Yd(e,l),...B,...z]),$,Hw(e,S),...Nd(e,s,h,S),...ud({subprocess:e,cancelSignal:a,gracefulCancel:o,context:h,controller:S}),...Gd({subprocess:e,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:c,context:h,controller:S})])}catch(Y){return h.terminationReason??="other",Promise.all([{error:Y},A,Promise.all(O.map(j=>za(j))),za(E),hm(R,N),Promise.allSettled(B),Promise.allSettled(z)])}},Nw=(e,t,r)=>e.map((i,n)=>i===t.stdio[n]?void 0:Ir(i,n,r)),Vw=(e,t)=>e.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>Ie(s,{checkOpen:!1})&&!Te(s)).map(({type:n,value:s,stream:a=s})=>Ir(a,i,t,{isSameDirection:$e.has(n),stopOnExit:n==="native"}))),Hw=async(e,{signal:t})=>{let[r]=await Uw(e,"error",{signal:t});throw r};p();p();var gm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Or=(e,t,r)=>{let i=e[r];i.has(t)||i.set(t,[]);let n=i.get(t),s=Ge();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Jt=async({resolve:e,promises:t},r)=>{e();let[i]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!i};p();import{Readable as Ww}from"stream";import{callbackify as Kw}from"util";p();import{finished as fm}from"stream/promises";var Ga=async e=>{if(e!==void 0)try{await Ua(e)}catch{}},_m=async e=>{if(e!==void 0)try{await Na(e)}catch{}},Ua=async e=>{await fm(e,{cleanup:!0,readable:!1,writable:!0})},Na=async e=>{await fm(e,{cleanup:!0,readable:!0,writable:!1})},jn=async(e,t)=>{if(await e,t)throw t},Pn=(e,t,r)=>{r&&!En(r)?e.destroy(r):t&&e.destroy()};var bm=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,binary:n=!0,preserveNewlines:s=!0}={})=>{let a=n||qe.has(r),{subprocessStdout:o,waitReadableDestroy:c}=Va(e,i,t),{readableEncoding:d,readableObjectMode:u,readableHighWaterMark:l}=Ha(o,a),{read:h,onStdoutDataDone:y}=Wa({subprocessStdout:o,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),g=new Ww({read:h,destroy:Kw(Ya.bind(void 0,{subprocessStdout:o,subprocess:e,waitReadableDestroy:c})),highWaterMark:l,objectMode:u,encoding:d});return Ka({subprocessStdout:o,onStdoutDataDone:y,readable:g,subprocess:e}),g},Va=(e,t,r)=>{let i=Ut(e,t),n=Or(r,i,"readableDestroy");return{subprocessStdout:i,waitReadableDestroy:n}},Ha=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},i)=>i?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Ba},Wa=({subprocessStdout:e,subprocess:t,binary:r,encoding:i,preserveNewlines:n})=>{let s=Ge(),a=An({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return{read(){Yw(this,a,s)},onStdoutDataDone:s}},Yw=async(e,t,r)=>{try{let{value:i,done:n}=await t.next();n?r.resolve():e.push(i)}catch{}},Ka=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Na(e),await i,await Ga(n),await t,r.readable&&r.push(null)}catch(s){await Ga(n),qm(r,s)}},Ya=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},i)=>{await Jt(r,t)&&(qm(e,i),await jn(t,i))},qm=(e,t)=>{Pn(e,e.readable,t)};p();import{Writable as Jw}from"stream";import{callbackify as km}from"util";var vm=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=Ja(e,r,t),a=new Jw({...Xa(i,e,n),destroy:km(Qa.bind(void 0,{subprocessStdin:i,subprocess:e,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Za(i,a),a},Ja=(e,t,r)=>{let i=Ui(e,t),n=Or(r,i,"writableFinal"),s=Or(r,i,"writableDestroy");return{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},Xa=(e,t,r)=>({write:Xw.bind(void 0,e),final:km(Zw.bind(void 0,e,t,r))}),Xw=(e,t,r,i)=>{e.write(t,r)?i():e.once("drain",i)},Zw=async(e,t,r)=>{await Jt(r,t)&&(e.writable&&e.end(),await t)},Za=async(e,t,r)=>{try{await Ua(e),t.writable&&t.end()}catch(i){await _m(r),wm(t,i)}},Qa=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Jt(r,t),await Jt(i,t)&&(wm(e,n),await jn(t,n))},wm=(e,t)=>{Pn(e,e.writable,t)};p();import{Duplex as Qw}from"stream";import{callbackify as ex}from"util";var xm=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,to:n,binary:s=!0,preserveNewlines:a=!0}={})=>{let o=s||qe.has(r),{subprocessStdout:c,waitReadableDestroy:d}=Va(e,i,t),{subprocessStdin:u,waitWritableFinal:l,waitWritableDestroy:h}=Ja(e,n,t),{readableEncoding:y,readableObjectMode:g,readableHighWaterMark:b}=Ha(c,o),{read:$,onStdoutDataDone:S}=Wa({subprocessStdout:c,subprocess:e,binary:o,encoding:r,preserveNewlines:a}),A=new Qw({read:$,...Xa(u,e,l),destroy:ex(tx.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:d,waitWritableFinal:l,waitWritableDestroy:h})),readableHighWaterMark:b,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:g,writableObjectMode:u.writableObjectMode,encoding:y});return Ka({subprocessStdout:c,onStdoutDataDone:S,readable:A,subprocess:e,subprocessStdin:u}),Za(u,A,c),A},tx=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},a)=>{await Promise.all([Ya({subprocessStdout:e,subprocess:r,waitReadableDestroy:i},a),Qa({subprocessStdin:t,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},a)])};p();var eo=(e,t,{from:r,binary:i=!1,preserveNewlines:n=!1}={})=>{let s=i||qe.has(t),a=Ut(e,r),o=An({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:n});return rx(o,a,e)},rx=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Sm=(e,{encoding:t})=>{let r=gm();e.readable=bm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=vm.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=xm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=eo.bind(void 0,e,t),e[Symbol.asyncIterator]=eo.bind(void 0,e,t,{})};p();var $m=(e,t)=>{for(let[r,i]of nx){let n=i.value.bind(t);Reflect.defineProperty(e,r,{...i,value:n})}},ix=(async()=>{})().constructor.prototype,nx=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ix,e)]);var Am=(e,t,r,i)=>{let{file:n,commandArguments:s,command:a,escapedCommand:o,startTime:c,verboseInfo:d,options:u,fileDescriptors:l}=ox(e,t,r),{subprocess:h,promise:y}=cx({file:n,commandArguments:s,options:u,startTime:c,verboseInfo:d,command:a,escapedCommand:o,fileDescriptors:l});return h.pipe=$n.bind(void 0,{source:h,sourcePromise:y,boundOptions:{},createNested:i}),$m(h,y),Ue.set(h,{options:u,fileDescriptors:l}),h},ox=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=Ri(e,t,r),{file:o,commandArguments:c,options:d}=en(e,t,r),u=px(d),l=Bl(u,a);return{file:o,commandArguments:c,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:u,fileDescriptors:l}},px=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},cx=({file:e,commandArguments:t,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:a,fileDescriptors:o})=>{let c;try{c=ax(...tn(e,t,r))}catch(g){return Il({error:g,command:s,escapedCommand:a,fileDescriptors:o,options:r,startTime:i,verboseInfo:n})}let d=new AbortController;sx(Number.POSITIVE_INFINITY,d.signal);let u=[...c.stdio];Wl(c,o,d),Yl(c,r,d);let l={},h=Ge();c.kill=cd.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:l,controller:d}),c.all=cm(c,r),Sm(c,r),Tl(c,r);let y=dx({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:o,originalStreams:u,command:s,escapedCommand:a,context:l,onInternalError:h,controller:d});return{subprocess:c,promise:y}},dx=async({subprocess:e,options:t,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:a,escapedCommand:o,context:c,onInternalError:d,controller:u})=>{let[l,[h,y],g,b,$]=await ym({subprocess:e,options:t,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:d,controller:u});u.abort(),d.resolve();let S=g.map((O,E)=>nt(O,t,E)),A=nt(b,t,"all"),q=ux({errorInfo:l,exitCode:h,signal:y,stdio:S,all:A,ipcOutput:$,context:c,options:t,command:a,escapedCommand:o,startTime:r});return Wt(q,i,t)},ux=({errorInfo:e,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,context:a,options:o,command:c,escapedCommand:d,startTime:u})=>"error"in e?jr({error:e.error,command:c,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Ne,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,options:o,startTime:u,isSync:!1}):un({command:c,escapedCommand:d,stdio:i,all:n,ipcOutput:s,options:o,startTime:u});p();var Tn=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([i,n])=>[i,lx(i,e[i],n)]));return{...e,...r}},lx=(e,t,r)=>mx.has(e)&&ee(t)&&ee(r)?{...t,...r}:r,mx=new Set(["env",...Ps]);var yt=(e,t,r,i)=>{let n=(a,o,c)=>yt(a,o,r,c),s=(...a)=>hx({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:i,createNested:n},...a);return i!==void 0&&i(s,n,t),s},hx=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...a)=>{if(ee(s))return n(e,Tn(r,s),i);let{file:o,commandArguments:c,options:d,isSync:u}=yx({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:r});return u?Sl(o,c,d):Am(o,c,d,n)},yx=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=Bp(t)?zp(t,r):[t,...r],[a,o,c]=vi(...s),d=Tn(Tn(i,n),c),{file:u=a,commandArguments:l=o,options:h=d,isSync:y=!1}=e({file:a,commandArguments:o,options:d});return{file:u,commandArguments:l,options:h,isSync:y}};p();var Em=({file:e,commandArguments:t})=>Pm(e,t),jm=({file:e,commandArguments:t})=>({...Pm(e,t),isSync:!0}),Pm=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...i]=gx(e);return{file:r,commandArguments:i}},gx=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let i of t.split(fx)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i)}return r},fx=/ +/g;p();var Tm=(e,t,r)=>{e.sync=t(_x,r),e.s=e.sync},Cm=({options:e})=>Rm(e),_x=({options:e})=>({...Rm(e),isSync:!0}),Rm=e=>({options:{...bx(e),...e}}),bx=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Im={preferLocal:!0};var Z=yt(()=>({})),jz=yt(()=>({isSync:!0})),gt=yt(Em),Pz=yt(jm),Tz=yt(Hd),Cz=yt(Cm,{},Im,Tm),{sendMessage:Rz,getOneMessage:Iz,getEachMessage:Oz,getCancelSignal:Dz}=Cl();var _e=L(J(),1);p();var er=L(J(),1);import fe from"fs";import wx from"os";import ge from"path";p();p();import Oe from"fs";import st from"path";function v(e=process.cwd()){let t=qx(e),r=st.join(t,"docker-compose.yml");if(!Oe.existsSync(r))throw new Error(`Not a Spree project directory. No docker-compose.yml found.
145
- Run this command from a directory created with create-spree-app.`);let i=kx(t);return{mode:"docker",projectDir:t,port:i}}var Om=["server","backend"];function Xt(e){return Om.find(t=>Oe.existsSync(st.join(e,t)))??"server"}function qx(e){let t=st.basename(e);if(!Om.includes(t))return e;let r=st.dirname(e),i=new RegExp(`\\./${t}:/rails(:\\w+)?(\\s|$)`,"m");for(let n of["docker-compose.yml","docker-compose.dev.yml"]){let s=st.join(r,n);if(Oe.existsSync(s))try{if(i.test(Oe.readFileSync(s,"utf-8")))return r}catch{}}return e}function He(e){let t=st.join(e,".env");if(!Oe.existsSync(t))return!1;try{let r=Oe.readFileSync(t,"utf-8");return/^\s*SPREE_PATH\s*=/m.test(r)}catch{return!1}}function We(e){let t=st.join(e,"docker-compose.yml");if(!Oe.existsSync(t))return!1;try{return/^\s*build\s*:/m.test(Oe.readFileSync(t,"utf-8"))}catch{return!1}}function Rn(e){try{let r=Oe.readFileSync(st.join(e,".env"),"utf-8").match(/^SPREE_SAMPLE_DATA=(true|false)\b/m);return r?r[1]==="true":void 0}catch{return}}function kx(e){let t=st.join(e,".env");if(!Oe.existsSync(t))return 3e3;let i=Oe.readFileSync(t,"utf-8").match(/^SPREE_PORT=(\d+)/m);return i?Number(i[1]):3e3}p();var Dm=L(J(),1);async function X(e,t,r){return Z("docker",["compose",...e],{cwd:t,...r})}async function Zt(e,t){try{await X(["up","-d","--no-deps","web"],e,{stdio:t?.stdio??"inherit"})}catch{}}async function pe(e,t,r){return(await ro(["bin/rails",e],t,{env:r})).split(`
144
+ if (condition) { yield value; }`)};p();import{Buffer as zk}from"buffer";import{StringDecoder as Mk}from"string_decoder";var fn=(e,t,r)=>{if(r)return;if(e)return{transform:Fk.bind(void 0,new TextEncoder)};let i=new Mk(t);return{transform:Gk.bind(void 0,i),final:Uk.bind(void 0,i)}},Fk=function*(e,t){zk.isBuffer(t)?yield tt(t):typeof t=="string"?yield e.encode(t):yield t},Gk=function*(e,t){yield se(t)?e.write(t):t},Uk=function*(e){let t=e.end();t!==""&&(yield t)};p();import{callbackify as cl}from"util";var _a=cl(async(e,t,r,i)=>{t.currentIterable=e(...r);try{for await(let n of t.currentIterable)i.push(n)}finally{delete t.currentIterable}}),_n=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=Vk}=t[r];for await(let n of i(e))yield*_n(n,t,r+1)},dl=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Nk(r,Number(t),e)},Nk=async function*(e,t,r){if(e!==void 0)for await(let i of e())yield*_n(i,r,t+1)},ul=cl(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Vk=function*(e){yield e};p();var ba=(e,t,r,i)=>{try{for(let n of e(...t))r.push(n);i()}catch(n){i(n)}},ll=(e,t)=>[...t.flatMap(r=>[...Et(r,e,0)]),...Pr(e)],Et=function*(e,t,r){if(r===t.length){yield e;return}let{transform:i=Wk}=t[r];for(let n of i(e))yield*Et(n,t,r+1)},Pr=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Hk(r,Number(t),e)},Hk=function*(e,t,r){if(e!==void 0)for(let i of e())yield*Et(i,r,t+1)},Wk=function*(e){yield e};var qa=({value:e,value:{transform:t,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:a})=>{let o={},c=hl(e,a,s),d=At(t),u=At(r),l=d?_a.bind(void 0,_n,o):ba.bind(void 0,Et),h=d||u?_a.bind(void 0,dl,o):ba.bind(void 0,Pr),y=d||u?ul.bind(void 0,o):void 0;return{stream:new Kk({writableObjectMode:i,writableHighWaterMark:ml(i),readableObjectMode:n,readableHighWaterMark:ml(n),transform(b,$,S){l([b,c,0],this,S)},flush(b){h([c],this,b)},destroy:y})}},bn=(e,t,r,i)=>{let n=t.filter(({type:a})=>a==="generator"),s=i?n.reverse():n;for(let{value:a,optionName:o}of s){let c=hl(a,r,o);e=ll(c,e)}return e},hl=({transform:e,final:t,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},a,o)=>{let c={};return[{transform:al(i,o)},fn(r,a,i),gn(r,s,i,c),{transform:e,final:t},{transform:ol(n,o)},sl({binary:r,preserveNewlines:s,readableObjectMode:n,state:c})].filter(Boolean)};var yl=(e,t)=>{for(let r of Yk(e))Jk(e,r,t)},Yk=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),Jk=(e,t,r)=>{let{stdioItems:i}=e[t],n=i.filter(({contents:o})=>o!==void 0);if(n.length===0)return;if(t!==0){let[{type:o,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ht[o]} with synchronous methods.`)}let a=n.map(({contents:o})=>o).map(o=>Xk(o,i));r.input=qr(a)},Xk=(e,t)=>{let r=bn(e,t,"utf8",!0);return Zk(r),qr(r)},Zk=e=>{let t=e.find(r=>typeof r!="string"&&!se(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};p();import{writeFileSync as rv,appendFileSync as iv}from"fs";p();var qn=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:i})=>i!=="all"&&Bt(r,i)&&!qe.has(t)&&Qk(i)&&(e.some(({type:n,value:s})=>n==="native"&&ev.has(s))||e.every(({type:n})=>$e.has(n))),Qk=e=>e===1||e===2,ev=new Set(["pipe","overlapped"]),gl=async(e,t,r,i)=>{for await(let n of e)tv(t)||_l(n,r,i)},fl=(e,t,r)=>{for(let i of e)_l(i,t,r)},tv=e=>e._readableState.pipes.length>0,_l=(e,t,r)=>{let i=Ti(e);Fe({type:"output",verboseMessage:i,fdNumber:t,verboseInfo:r})};var bl=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(t===null)return{output:Array.from({length:3})};let s={},a=new Set([]);return{output:t.map((c,d)=>nv({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:i,verboseInfo:n},r)),...s}},nv=({result:e,fileDescriptors:t,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:a},{buffer:o,encoding:c,lines:d,stripFinalNewline:u,maxBuffer:l})=>{if(e===null)return;let h=qu(e,s,l),y=tt(h),{stdioItems:g,objectMode:b}=t[r],$=sv([y],g,c,i),{serializedResult:S,finalResult:A=S}=av({chunks:$,objectMode:b,encoding:c,lines:d,stripFinalNewline:u,fdNumber:r});ov({serializedResult:S,fdNumber:r,state:i,verboseInfo:a,encoding:c,stdioItems:g,objectMode:b});let q=o[r]?A:void 0;try{return i.error===void 0&&pv(S,g,n),q}catch(O){return i.error=O,q}},sv=(e,t,r,i)=>{try{return bn(e,t,r,!1)}catch(n){return i.error=n,e}},av=({chunks:e,objectMode:t,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:qr(e)};let a=Ip(e,r);return i[s]?{serializedResult:a,finalResult:fa(a,!n[s],t)}:{serializedResult:a}},ov=({serializedResult:e,fdNumber:t,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:a})=>{if(!qn({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:t}))return;let o=fa(e,!1,a);try{fl(o,t,i)}catch(c){r.error??=c}},pv=(e,t,r)=>{for(let{path:i,append:n}of t.filter(({type:s})=>hn.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?iv(i,e):(r.add(s),rv(i,e))}};p();var ql=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,nt(t,r,"all")]:Array.isArray(t)?[nt(e,r,"all"),...t]:se(e)&&se(t)?$s([e,t]):`${e}${t}`};p();p();import{once as ka}from"events";var kl=async(e,t)=>{let[r,i]=await cv(e);return t.isForcefullyTerminated??=!1,[r,i]},cv=async e=>{let[t,r]=await Promise.allSettled([ka(e,"spawn"),ka(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?vl(e):r.value},vl=async e=>{try{return await ka(e,"exit")}catch{return vl(e)}},wl=async e=>{let[t,r]=await e;if(!dv(t,r)&&va(t,r))throw new Ce;return[t,r]},dv=(e,t)=>e===void 0&&t===void 0,va=(e,t)=>e!==0||t!==null;var xl=({error:e,status:t,signal:r,output:i},{maxBuffer:n})=>{let s=uv(e,t,r),a=s?.code==="ETIMEDOUT",o=bu(s,i,n);return{resultError:s,exitCode:t,signal:r,timedOut:a,isMaxBuffer:o}},uv=(e,t,r)=>e!==void 0?e:va(t,r)?new Ce:void 0;var Sl=(e,t,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:a,startTime:o,verboseInfo:c,options:d,fileDescriptors:u}=mv(e,t,r),l=gv({file:i,commandArguments:n,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:u,startTime:o});return Wt(l,c,d)},mv=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=Ri(e,t,r),o=hv(r),{file:c,commandArguments:d,options:u}=en(e,t,o);yv(u);let l=tl(u,a);return{file:c,commandArguments:d,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:u,fileDescriptors:l}},hv=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,yv=({ipc:e,ipcInput:t,detached:r,cancelSignal:i})=>{t&&kn("ipcInput"),e&&kn("ipc: true"),r&&kn("detached: true"),i&&kn("cancelSignal")},kn=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},gv=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:a,startTime:o})=>{let c=fv({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:a,startTime:o});if(c.failed)return c;let{resultError:d,exitCode:u,signal:l,timedOut:h,isMaxBuffer:y}=xl(c,r),{output:g,error:b=d}=bl({fileDescriptors:a,syncResult:c,options:r,isMaxBuffer:y,verboseInfo:s}),$=g.map((A,q)=>nt(A,r,q)),S=nt(ql(g,r),r,"all");return bv({error:b,exitCode:u,signal:l,timedOut:h,isMaxBuffer:y,stdio:$,all:S,options:r,command:i,escapedCommand:n,startTime:o})},fv=({file:e,commandArguments:t,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:a})=>{try{yl(s,r);let o=_v(r);return lv(...tn(e,t,o))}catch(o){return Ht({error:o,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:a,isSync:!0})}},_v=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:dn(t)}),bv=({error:e,exitCode:t,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:a,options:o,command:c,escapedCommand:d,startTime:u})=>e===void 0?un({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:o,startTime:u}):jr({error:e,command:c,escapedCommand:d,timedOut:i,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:n,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:s,all:a,ipcOutput:[],options:o,startTime:u,isSync:!0});p();import{setMaxListeners as ax}from"events";import{spawn as ox}from"child_process";p();import Pl from"process";p();import{once as wa,on as qv}from"events";var $l=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0,filter:s}={})=>(Ft({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Ki(e)}),kv({anyProcess:e,channel:t,isSubprocess:r,filter:s,reference:n})),kv=async({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:n})=>{Ni(t,n);let s=mt(e,t,r),a=new AbortController;try{return await Promise.race([vv(s,i,a),wv(s,r,a),xv(s,r,a)])}catch(o){throw Gt(e),o}finally{a.abort(),Vi(t,n)}},vv=async(e,t,{signal:r})=>{if(t===void 0){let[i]=await wa(e,"message",{signal:r});return i}for await(let[i]of qv(e,"message",{signal:r}))if(t(i))return i},wv=async(e,t,{signal:r})=>{await wa(e,"disconnect",{signal:r}),ld(t)},xv=async(e,t,{signal:r})=>{let[i]=await wa(e,"strict:error",{signal:r});throw Fi(i,t)};p();import{once as El,on as Sv}from"events";var jl=({anyProcess:e,channel:t,isSubprocess:r,ipc:i},{reference:n=!0}={})=>xa({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),xa=({anyProcess:e,channel:t,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Ft({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Ki(e)}),Ni(t,s);let a=mt(e,t,r),o=new AbortController,c={};return $v(e,a,o),Av({ipcEmitter:a,isSubprocess:r,controller:o,state:c}),Ev({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:r,shouldAwait:n,controller:o,state:c,reference:s})},$v=async(e,t,r)=>{try{await El(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Av=async({ipcEmitter:e,isSubprocess:t,controller:r,state:i})=>{try{let[n]=await El(e,"strict:error",{signal:r.signal});i.error=Fi(n,t),r.abort()}catch{}},Ev=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:a,reference:o}){try{for await(let[c]of Sv(r,"message",{signal:s.signal}))Al(a),yield c}catch{Al(a)}finally{s.abort(),Vi(t,o),i||Gt(e),n&&await e}},Al=({error:e})=>{if(e)throw e};var Tl=(e,{ipc:t})=>{Object.assign(e,Rl(e,!1,t))},Cl=()=>{let e=Pl,t=!0,r=Pl.channel!==void 0;return{...Rl(e,t,r),getCancelSignal:zd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},Rl=(e,t,r)=>({sendMessage:Zi.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:$l.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:jl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});p();import{ChildProcess as jv}from"child_process";import{PassThrough as Pv,Readable as Tv,Writable as Cv,Duplex as Rv}from"stream";var Il=({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:a})=>{ha(i);let o=new jv;Iv(o,i),Object.assign(o,{readable:Ov,writable:Dv,duplex:Lv});let c=Ht({error:e,command:t,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:!1}),d=Bv(c,a,n);return{subprocess:o,promise:d}},Iv=(e,t)=>{let r=Tr(),i=Tr(),n=Tr(),s=Array.from({length:t.length-3},Tr),a=Tr(),o=[r,i,n,...s];Object.assign(e,{stdin:r,stdout:i,stderr:n,all:a,stdio:o})},Tr=()=>{let e=new Pv;return e.end(),e},Ov=()=>new Tv({read(){}}),Dv=()=>new Cv({write(){}}),Lv=()=>new Rv({read(){},write(){}}),Bv=async(e,t,r)=>Wt(e,t,r);p();import{createReadStream as Ol,createWriteStream as Dl}from"fs";import{Buffer as zv}from"buffer";import{Readable as Cr,Writable as Mv,Duplex as Fv}from"stream";var Bl=(e,t)=>yn(Gv,e,t,!1),Rr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ht[e]}.`)},Ll={fileNumber:Rr,generator:qa,asyncGenerator:qa,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let i=t||r;return{stream:Fv.fromWeb(e,{objectMode:i})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Gv={input:{...Ll,fileUrl:({value:e})=>({stream:Ol(e)}),filePath:({value:{file:e}})=>({stream:Ol(e)}),webStream:({value:e})=>({stream:Cr.fromWeb(e)}),iterable:({value:e})=>({stream:Cr.from(e)}),asyncIterable:({value:e})=>({stream:Cr.from(e)}),string:({value:e})=>({stream:Cr.from(e)}),uint8Array:({value:e})=>({stream:Cr.from(zv.from(e))})},output:{...Ll,fileUrl:({value:e})=>({stream:Dl(e)}),filePath:({value:{file:e,append:t}})=>({stream:Dl(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:Mv.fromWeb(e)}),iterable:Rr,asyncIterable:Rr,string:Rr,uint8Array:Rr}};p();p();import{on as Uv,once as zl}from"events";import{PassThrough as Nv,getDefaultHighWaterMark as Vv}from"stream";import{finished as Gl}from"stream/promises";function jt(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let n of e)$a(n);let t=e.some(({readableObjectMode:n})=>n),r=Hv(e,t),i=new Sa({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of e)i.add(n);return i}var Hv=(e,t)=>{if(e.length===0)return Vv(t);let r=e.filter(({readableObjectMode:i})=>i===t).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},Sa=class extends Nv{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(t){if($a(t),this.#t.has(t))return;this.#t.add(t),this.#i??=Wv(this,this.#t,this.#s);let r=Jv({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(t,r),t.pipe(this,{end:!1})}async remove(t){if($a(t),!this.#t.has(t))return!1;let r=this.#n.get(t);return r===void 0?!1:(this.#n.delete(t),t.unpipe(this),await r,!0)}},Wv=async(e,t,r)=>{vn(e,Ml);let i=new AbortController;try{await Promise.race([Kv(e,i),Yv(e,t,r,i)])}finally{i.abort(),vn(e,-Ml)}},Kv=async(e,{signal:t})=>{try{await Gl(e,{signal:t,cleanup:!0})}catch(r){throw Ul(e,r),r}},Yv=async(e,t,r,{signal:i})=>{for await(let[n]of Uv(e,"unpipe",{signal:i}))t.has(n)&&n.emit(r)},$a=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Jv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:a})=>{vn(e,Fl);let o=new AbortController;try{await Promise.race([Xv(s,t,o),Zv({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:o}),Qv({stream:t,streams:r,ended:i,aborted:n,unpipeEvent:a,controller:o})])}finally{o.abort(),vn(e,-Fl)}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?Aa(e):ew(e))},Xv=async(e,t,{signal:r})=>{try{await e,r.aborted||Aa(t)}catch(i){r.aborted||Ul(t,i)}},Zv=async({passThroughStream:e,stream:t,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await Gl(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&i.add(t)}catch(a){if(s.aborted||!r.has(t))return;Nl(a)?n.add(t):Vl(e,a)}},Qv=async({stream:e,streams:t,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await zl(e,n,{signal:s}),!e.readable)return zl(s,"abort",{signal:s});t.delete(e),r.delete(e),i.delete(e)},ew=e=>{e.writable&&e.end()},Ul=(e,t)=>{Nl(t)?Aa(e):Vl(e,t)},Nl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Aa=e=>{(e.readable||e.writable)&&e.destroy()},Vl=(e,t)=>{e.destroyed||(e.once("error",tw),e.destroy(t))},tw=()=>{},vn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Ml=2,Fl=1;p();import{finished as Hl}from"stream/promises";var Yt=(e,t)=>{e.pipe(t),rw(e,t),iw(e,t)},rw=async(e,t)=>{if(!(Te(e)||Te(t))){try{await Hl(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Ea(t)}},Ea=e=>{e.writable&&e.end()},iw=async(e,t)=>{if(!(Te(e)||Te(t))){try{await Hl(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ja(e)}},ja=e=>{e.readable&&e.destroy()};var Wl=(e,t,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:a}]of Object.entries(t)){for(let{stream:o}of s.filter(({type:c})=>$e.has(c)))nw(e,o,a,n);for(let{stream:o}of s.filter(({type:c})=>!$e.has(c)))aw({subprocess:e,stream:o,direction:a,fdNumber:n,pipeGroups:i,controller:r})}for(let[n,s]of i.entries()){let a=s.length===1?s[0]:jt(s);Yt(a,n)}},nw=(e,t,r,i)=>{r==="output"?Yt(e.stdio[i],t):Yt(t,e.stdio[i]);let n=sw[i];n!==void 0&&(e[n]=t),e.stdio[i]=t},sw=["stdin","stdout","stderr"],aw=({subprocess:e,stream:t,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(t===void 0)return;ow(t,s);let[a,o]=r==="output"?[t,e.stdio[i]]:[e.stdio[i],t],c=n.get(a)??[];n.set(a,[...c,o])},ow=(e,{signal:t})=>{Te(e)&&St(e,pw,t)},pw=2;p();import{addAbortListener as uw}from"events";p();p();var Pt=[];Pt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Pt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Pt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wn=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Pa=Symbol.for("signal-exit emitter"),Ta=globalThis,cw=Object.defineProperty.bind(Object),Ca=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ta[Pa])return Ta[Pa];cw(Ta,Pa,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let i=this.listeners[t],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(t,r,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let s of this.listeners[t])n=s(r,i)===!0||n;return t==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},xn=class{},dw=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ra=class extends xn{onExit(){return()=>{}}load(){}unload(){}},Ia=class extends xn{#t=Oa.platform==="win32"?"SIGINT":"SIGHUP";#r=new Ca;#e;#i;#s;#n={};#a=!1;constructor(t){super(),this.#e=t,this.#n={};for(let r of Pt)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||t.kill(t.pid,o)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,r){if(!wn(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,t),()=>{this.#r.removeListener(i,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let t of Pt)try{let r=this.#n[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#o(t)}}unload(){this.#a&&(this.#a=!1,Pt.forEach(t=>{let r=this.#n[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1)}#o(t){return wn(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let i=this.#i;if(t==="exit"&&wn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,t,...r)}},Oa=globalThis.process,{onExit:Kl,load:u2,unload:l2}=dw(wn(Oa)?new Ia(Oa):new Ra);var Yl=(e,{cleanup:t,detached:r},{signal:i})=>{if(!t||r)return;let n=Kl(()=>{e.kill()});uw(i,()=>{n()})};p();p();var Xl=({source:e,sourcePromise:t,boundOptions:r,createNested:i},...n)=>{let s=Ci(),{destination:a,destinationStream:o,destinationError:c,from:d,unpipeSignal:u}=lw(r,i,n),{sourceStream:l,sourceError:h}=hw(e,d),{options:y,fileDescriptors:g}=Ue.get(e);return{sourcePromise:t,sourceStream:l,sourceOptions:y,sourceError:h,destination:a,destinationStream:o,destinationError:c,unpipeSignal:u,fileDescriptors:g,startTime:s}},lw=(e,t,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:a}={}}=mw(e,t,...r),o=Ui(i,s);return{destination:i,destinationStream:o,from:n,unpipeSignal:a}}catch(i){return{destinationError:i}}},mw=(e,t,r,...i)=>{if(Array.isArray(r))return{destination:t(Jl,e)(r,...i),pipeOptions:e};if(typeof r=="string"||r instanceof URL||xs(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,a]=vi(r,...i);return{destination:t(Jl)(n,s,a),pipeOptions:a}}if(Ue.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Jl=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),hw=(e,t)=>{try{return{sourceStream:Ut(e,t)}}catch(r){return{sourceError:r}}};p();var Ql=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:a})=>{let o=yw({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i});if(o!==void 0)throw Da({error:o,fileDescriptors:n,sourceOptions:s,startTime:a})},yw=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:i})=>{if(t!==void 0&&i!==void 0)return i;if(i!==void 0)return ja(e),i;if(t!==void 0)return Ea(r),t},Da=({error:e,fileDescriptors:t,sourceOptions:r,startTime:i})=>Ht({error:e,command:Zl,escapedCommand:Zl,fileDescriptors:t,options:r,startTime:i,isSync:!1}),Zl="source.pipe(destination)";p();var em=async e=>{let[{status:t,reason:r,value:i=r},{status:n,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(i)||a.pipedFrom.push(i),n==="rejected")throw a;if(t==="rejected")throw i;return a};p();import{finished as gw}from"stream/promises";var tm=(e,t,r)=>{let i=Sn.has(t)?_w(e,t):fw(e,t);return St(e,qw,r.signal),St(t,kw,r.signal),bw(t),i},fw=(e,t)=>{let r=jt([e]);return Yt(r,t),Sn.set(t,r),r},_w=(e,t)=>{let r=Sn.get(t);return r.add(e),r},bw=async e=>{try{await gw(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Sn.delete(e)},Sn=new WeakMap,qw=2,kw=1;p();import{aborted as vw}from"util";var rm=(e,t)=>e===void 0?[]:[ww(e,t)],ww=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await vw(e,t),await r.remove(t);let a=new Error("Pipe canceled by `unpipeSignal` option.");throw Da({error:a,fileDescriptors:i,sourceOptions:n,startTime:s})};var $n=(e,...t)=>{if(ee(t[0]))return $n.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...i}=Xl(e,...t),n=xw({...i,destination:r});return n.pipe=$n.bind(void 0,{...e,source:r,sourcePromise:n,boundOptions:{}}),n},xw=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:a,unpipeSignal:o,fileDescriptors:c,startTime:d})=>{let u=Sw(e,n);Ql({sourceStream:t,sourceError:i,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:r,startTime:d});let l=new AbortController;try{let h=tm(t,s,l);return await Promise.race([em(u),...rm(o,{sourceStream:t,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:d})])}finally{l.abort()}},Sw=(e,t)=>Promise.allSettled([e,t]);p();p();p();import{setImmediate as Cw}from"timers/promises";p();import{on as $w}from"events";import{getDefaultHighWaterMark as Aw}from"stream";var An=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let a=new AbortController;return Ew(t,a),nm({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&i,encoding:n,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},Ew=async(e,t)=>{try{await e}catch{}finally{t.abort()}},La=({stream:e,onStreamEnd:t,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let a=new AbortController;jw(t,a,e);let o=e.readableObjectMode&&!s;return nm({stream:e,controller:a,binary:i==="buffer",shouldEncode:!o,encoding:i,shouldSplit:!o&&r,preserveNewlines:!n})},jw=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},nm=({stream:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})=>{let o=$w(e,"data",{signal:t.signal,highWaterMark:im,highWatermark:im});return Pw({onStdoutChunk:o,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a})},Ba=Aw(!0),im=Ba,Pw=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a}){let o=Tw({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:a});try{for await(let[c]of e)yield*Et(c,o,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Pr(o)}},Tw=({binary:e,shouldEncode:t,encoding:r,shouldSplit:i,preserveNewlines:n})=>[fn(e,r,!t),gn(e,n,!i,{})].filter(Boolean);var sm=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:a,allMixed:o,stripFinalNewline:c,verboseInfo:d,streamInfo:u})=>{let l=Rw({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:o,verboseInfo:d,streamInfo:u});if(!n){await Promise.all([Iw(e),l]);return}let h=ya(c,r),y=La({stream:e,onStreamEnd:t,lines:a,encoding:i,stripFinalNewline:h,allMixed:o}),[g]=await Promise.all([Ow({stream:e,iterable:y,fdNumber:r,encoding:i,maxBuffer:s,lines:a}),l]);return g},Rw=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!qn({stdioItems:a[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let o=La({stream:e,onStreamEnd:t,lines:!0,encoding:i,stripFinalNewline:!0,allMixed:n});await gl(o,e,r,s)},Iw=async e=>{await Cw(),e.readableFlowing===null&&e.resume()},Ow=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:a})=>{try{return t||a?await an(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await on(r,{maxBuffer:s})):await cn(r,{maxBuffer:s})}catch(o){return am(gu({error:o,stream:e,readableObjectMode:t,lines:a,encoding:n,fdNumber:i}))}},za=async e=>{try{return await e}catch(t){return am(t)}},am=({bufferedData:e})=>Cp(e)?new Uint8Array(e):e;p();import{finished as Dw}from"stream/promises";var Ir=async(e,t,r,{isSameDirection:i,stopOnExit:n=!1}={})=>{let s=Lw(e,r),a=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],Dw(e,{cleanup:!0,signal:a.signal})])}catch(o){s.stdinCleanedUp||Mw(o,t,r,i)}finally{a.abort()}},Lw=(e,{originalStreams:[t],subprocess:r})=>{let i={stdinCleanedUp:!1};return e===t&&Bw(e,r,i),i},Bw=(e,t,r)=>{let{_destroy:i}=e;e._destroy=(...n)=>{zw(t,r),i.call(e,...n)}},zw=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},Mw=(e,t,r,i)=>{if(!Fw(e,t,r,i))throw e},Fw=(e,t,r,i=!0)=>r.propagating?om(e)||En(e):(r.propagating=!0,Ma(r,t)===i?om(e):En(e)),Ma=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",En=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",om=e=>e?.code==="EPIPE";var pm=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>e.stdio.map((c,d)=>Fa({stream:c,fdNumber:d,encoding:t,buffer:r[d],maxBuffer:i[d],lines:n[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:o})),Fa=async({stream:e,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:c,streamInfo:d})=>{if(!e)return;let u=Ir(e,t,d);if(Ma(d,t)){await u;return}let[l]=await Promise.all([sm({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:c,streamInfo:d}),u]);return l};var cm=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?jt([e,t].filter(Boolean)):void 0,dm=({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>Fa({...Gw(e,r),fdNumber:"all",encoding:t,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:Uw(e),stripFinalNewline:s,verboseInfo:a,streamInfo:o}),Gw=({stdout:e,stderr:t,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:r,buffer:s}},Uw=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;p();import{once as Nw}from"events";p();p();var um=e=>Bt(e,"ipc"),lm=(e,t)=>{let r=Ti(e);Fe({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var mm=async({subprocess:e,buffer:t,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let a=um(s),o=rt(t,"ipc"),c=rt(r,"ipc");for await(let d of xa({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:i,shouldAwait:!1,reference:!0}))o&&(fu(e,n,c),n.push(d)),a&&lm(d,s);return n},hm=async(e,t)=>(await Promise.allSettled([e]),t);var ym=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:c,stripFinalNewline:d,ipc:u,ipcInput:l},context:h,verboseInfo:y,fileDescriptors:g,originalStreams:b,onInternalError:$,controller:S})=>{let A=kl(e,h),q={originalStreams:b,fileDescriptors:g,subprocess:e,exitPromise:A,propagating:!1},O=pm({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:y,streamInfo:q}),E=dm({subprocess:e,encoding:t,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:y,streamInfo:q}),N=[],R=mm({subprocess:e,buffer:r,maxBuffer:i,ipc:u,ipcOutput:N,verboseInfo:y}),B=Vw(b,e,q),z=Hw(g,q);try{return await Promise.race([Promise.all([{},wl(A),Promise.all(O),E,R,Yd(e,l),...B,...z]),$,Ww(e,S),...Nd(e,s,h,S),...ud({subprocess:e,cancelSignal:a,gracefulCancel:o,context:h,controller:S}),...Gd({subprocess:e,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:c,context:h,controller:S})])}catch(Y){return h.terminationReason??="other",Promise.all([{error:Y},A,Promise.all(O.map(j=>za(j))),za(E),hm(R,N),Promise.allSettled(B),Promise.allSettled(z)])}},Vw=(e,t,r)=>e.map((i,n)=>i===t.stdio[n]?void 0:Ir(i,n,r)),Hw=(e,t)=>e.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>Ie(s,{checkOpen:!1})&&!Te(s)).map(({type:n,value:s,stream:a=s})=>Ir(a,i,t,{isSameDirection:$e.has(n),stopOnExit:n==="native"}))),Ww=async(e,{signal:t})=>{let[r]=await Nw(e,"error",{signal:t});throw r};p();p();var gm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Or=(e,t,r)=>{let i=e[r];i.has(t)||i.set(t,[]);let n=i.get(t),s=Ge();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Jt=async({resolve:e,promises:t},r)=>{e();let[i]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!i};p();import{Readable as Kw}from"stream";import{callbackify as Yw}from"util";p();import{finished as fm}from"stream/promises";var Ga=async e=>{if(e!==void 0)try{await Ua(e)}catch{}},_m=async e=>{if(e!==void 0)try{await Na(e)}catch{}},Ua=async e=>{await fm(e,{cleanup:!0,readable:!1,writable:!0})},Na=async e=>{await fm(e,{cleanup:!0,readable:!0,writable:!1})},jn=async(e,t)=>{if(await e,t)throw t},Pn=(e,t,r)=>{r&&!En(r)?e.destroy(r):t&&e.destroy()};var bm=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,binary:n=!0,preserveNewlines:s=!0}={})=>{let a=n||qe.has(r),{subprocessStdout:o,waitReadableDestroy:c}=Va(e,i,t),{readableEncoding:d,readableObjectMode:u,readableHighWaterMark:l}=Ha(o,a),{read:h,onStdoutDataDone:y}=Wa({subprocessStdout:o,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),g=new Kw({read:h,destroy:Yw(Ya.bind(void 0,{subprocessStdout:o,subprocess:e,waitReadableDestroy:c})),highWaterMark:l,objectMode:u,encoding:d});return Ka({subprocessStdout:o,onStdoutDataDone:y,readable:g,subprocess:e}),g},Va=(e,t,r)=>{let i=Ut(e,t),n=Or(r,i,"readableDestroy");return{subprocessStdout:i,waitReadableDestroy:n}},Ha=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},i)=>i?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Ba},Wa=({subprocessStdout:e,subprocess:t,binary:r,encoding:i,preserveNewlines:n})=>{let s=Ge(),a=An({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return{read(){Jw(this,a,s)},onStdoutDataDone:s}},Jw=async(e,t,r)=>{try{let{value:i,done:n}=await t.next();n?r.resolve():e.push(i)}catch{}},Ka=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Na(e),await i,await Ga(n),await t,r.readable&&r.push(null)}catch(s){await Ga(n),qm(r,s)}},Ya=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},i)=>{await Jt(r,t)&&(qm(e,i),await jn(t,i))},qm=(e,t)=>{Pn(e,e.readable,t)};p();import{Writable as Xw}from"stream";import{callbackify as km}from"util";var vm=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=Ja(e,r,t),a=new Xw({...Xa(i,e,n),destroy:km(Qa.bind(void 0,{subprocessStdin:i,subprocess:e,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Za(i,a),a},Ja=(e,t,r)=>{let i=Ui(e,t),n=Or(r,i,"writableFinal"),s=Or(r,i,"writableDestroy");return{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},Xa=(e,t,r)=>({write:Zw.bind(void 0,e),final:km(Qw.bind(void 0,e,t,r))}),Zw=(e,t,r,i)=>{e.write(t,r)?i():e.once("drain",i)},Qw=async(e,t,r)=>{await Jt(r,t)&&(e.writable&&e.end(),await t)},Za=async(e,t,r)=>{try{await Ua(e),t.writable&&t.end()}catch(i){await _m(r),wm(t,i)}},Qa=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Jt(r,t),await Jt(i,t)&&(wm(e,n),await jn(t,n))},wm=(e,t)=>{Pn(e,e.writable,t)};p();import{Duplex as ex}from"stream";import{callbackify as tx}from"util";var xm=({subprocess:e,concurrentStreams:t,encoding:r},{from:i,to:n,binary:s=!0,preserveNewlines:a=!0}={})=>{let o=s||qe.has(r),{subprocessStdout:c,waitReadableDestroy:d}=Va(e,i,t),{subprocessStdin:u,waitWritableFinal:l,waitWritableDestroy:h}=Ja(e,n,t),{readableEncoding:y,readableObjectMode:g,readableHighWaterMark:b}=Ha(c,o),{read:$,onStdoutDataDone:S}=Wa({subprocessStdout:c,subprocess:e,binary:o,encoding:r,preserveNewlines:a}),A=new ex({read:$,...Xa(u,e,l),destroy:tx(rx.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:d,waitWritableFinal:l,waitWritableDestroy:h})),readableHighWaterMark:b,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:g,writableObjectMode:u.writableObjectMode,encoding:y});return Ka({subprocessStdout:c,onStdoutDataDone:S,readable:A,subprocess:e,subprocessStdin:u}),Za(u,A,c),A},rx=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},a)=>{await Promise.all([Ya({subprocessStdout:e,subprocess:r,waitReadableDestroy:i},a),Qa({subprocessStdin:t,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},a)])};p();var eo=(e,t,{from:r,binary:i=!1,preserveNewlines:n=!1}={})=>{let s=i||qe.has(t),a=Ut(e,r),o=An({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:n});return ix(o,a,e)},ix=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Sm=(e,{encoding:t})=>{let r=gm();e.readable=bm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=vm.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=xm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=eo.bind(void 0,e,t),e[Symbol.asyncIterator]=eo.bind(void 0,e,t,{})};p();var $m=(e,t)=>{for(let[r,i]of sx){let n=i.value.bind(t);Reflect.defineProperty(e,r,{...i,value:n})}},nx=(async()=>{})().constructor.prototype,sx=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(nx,e)]);var Am=(e,t,r,i)=>{let{file:n,commandArguments:s,command:a,escapedCommand:o,startTime:c,verboseInfo:d,options:u,fileDescriptors:l}=px(e,t,r),{subprocess:h,promise:y}=dx({file:n,commandArguments:s,options:u,startTime:c,verboseInfo:d,command:a,escapedCommand:o,fileDescriptors:l});return h.pipe=$n.bind(void 0,{source:h,sourcePromise:y,boundOptions:{},createNested:i}),$m(h,y),Ue.set(h,{options:u,fileDescriptors:l}),h},px=(e,t,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:a}=Ri(e,t,r),{file:o,commandArguments:c,options:d}=en(e,t,r),u=cx(d),l=Bl(u,a);return{file:o,commandArguments:c,command:i,escapedCommand:n,startTime:s,verboseInfo:a,options:u,fileDescriptors:l}},cx=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},dx=({file:e,commandArguments:t,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:a,fileDescriptors:o})=>{let c;try{c=ox(...tn(e,t,r))}catch(g){return Il({error:g,command:s,escapedCommand:a,fileDescriptors:o,options:r,startTime:i,verboseInfo:n})}let d=new AbortController;ax(Number.POSITIVE_INFINITY,d.signal);let u=[...c.stdio];Wl(c,o,d),Yl(c,r,d);let l={},h=Ge();c.kill=cd.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:l,controller:d}),c.all=cm(c,r),Sm(c,r),Tl(c,r);let y=ux({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:o,originalStreams:u,command:s,escapedCommand:a,context:l,onInternalError:h,controller:d});return{subprocess:c,promise:y}},ux=async({subprocess:e,options:t,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:a,escapedCommand:o,context:c,onInternalError:d,controller:u})=>{let[l,[h,y],g,b,$]=await ym({subprocess:e,options:t,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:d,controller:u});u.abort(),d.resolve();let S=g.map((O,E)=>nt(O,t,E)),A=nt(b,t,"all"),q=lx({errorInfo:l,exitCode:h,signal:y,stdio:S,all:A,ipcOutput:$,context:c,options:t,command:a,escapedCommand:o,startTime:r});return Wt(q,i,t)},lx=({errorInfo:e,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,context:a,options:o,command:c,escapedCommand:d,startTime:u})=>"error"in e?jr({error:e.error,command:c,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Ne,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:i,all:n,ipcOutput:s,options:o,startTime:u,isSync:!1}):un({command:c,escapedCommand:d,stdio:i,all:n,ipcOutput:s,options:o,startTime:u});p();var Tn=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([i,n])=>[i,mx(i,e[i],n)]));return{...e,...r}},mx=(e,t,r)=>hx.has(e)&&ee(t)&&ee(r)?{...t,...r}:r,hx=new Set(["env",...Ps]);var yt=(e,t,r,i)=>{let n=(a,o,c)=>yt(a,o,r,c),s=(...a)=>yx({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:i,createNested:n},...a);return i!==void 0&&i(s,n,t),s},yx=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...a)=>{if(ee(s))return n(e,Tn(r,s),i);let{file:o,commandArguments:c,options:d,isSync:u}=gx({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:r});return u?Sl(o,c,d):Am(o,c,d,n)},gx=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=Bp(t)?zp(t,r):[t,...r],[a,o,c]=vi(...s),d=Tn(Tn(i,n),c),{file:u=a,commandArguments:l=o,options:h=d,isSync:y=!1}=e({file:a,commandArguments:o,options:d});return{file:u,commandArguments:l,options:h,isSync:y}};p();var Em=({file:e,commandArguments:t})=>Pm(e,t),jm=({file:e,commandArguments:t})=>({...Pm(e,t),isSync:!0}),Pm=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...i]=fx(e);return{file:r,commandArguments:i}},fx=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let i of t.split(_x)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i)}return r},_x=/ +/g;p();var Tm=(e,t,r)=>{e.sync=t(bx,r),e.s=e.sync},Cm=({options:e})=>Rm(e),bx=({options:e})=>({...Rm(e),isSync:!0}),Rm=e=>({options:{...qx(e),...e}}),qx=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Im={preferLocal:!0};var Z=yt(()=>({})),Pz=yt(()=>({isSync:!0})),gt=yt(Em),Tz=yt(jm),Cz=yt(Hd),Rz=yt(Cm,{},Im,Tm),{sendMessage:Iz,getOneMessage:Oz,getEachMessage:Dz,getCancelSignal:Lz}=Cl();var _e=L(J(),1);p();var er=L(J(),1);import fe from"fs";import xx from"os";import ge from"path";p();p();import Oe from"fs";import st from"path";function v(e=process.cwd()){let t=kx(e),r=st.join(t,"docker-compose.yml");if(!Oe.existsSync(r))throw new Error(`Not a Spree project directory. No docker-compose.yml found.
145
+ Run this command from a directory created with create-spree-app.`);let i=vx(t);return{mode:"docker",projectDir:t,port:i}}var Om=["server","backend"];function Xt(e){return Om.find(t=>Oe.existsSync(st.join(e,t)))??"server"}function kx(e){let t=st.basename(e);if(!Om.includes(t))return e;let r=st.dirname(e),i=new RegExp(`\\./${t}:/rails(:\\w+)?(\\s|$)`,"m");for(let n of["docker-compose.yml","docker-compose.dev.yml"]){let s=st.join(r,n);if(Oe.existsSync(s))try{if(i.test(Oe.readFileSync(s,"utf-8")))return r}catch{}}return e}function He(e){let t=st.join(e,".env");if(!Oe.existsSync(t))return!1;try{let r=Oe.readFileSync(t,"utf-8");return/^\s*SPREE_PATH\s*=/m.test(r)}catch{return!1}}function We(e){let t=st.join(e,"docker-compose.yml");if(!Oe.existsSync(t))return!1;try{return/^\s*build\s*:/m.test(Oe.readFileSync(t,"utf-8"))}catch{return!1}}function Rn(e){try{let r=Oe.readFileSync(st.join(e,".env"),"utf-8").match(/^SPREE_SAMPLE_DATA=(true|false)\b/m);return r?r[1]==="true":void 0}catch{return}}function vx(e){let t=st.join(e,".env");if(!Oe.existsSync(t))return 3e3;let i=Oe.readFileSync(t,"utf-8").match(/^SPREE_PORT=(\d+)/m);return i?Number(i[1]):3e3}p();var Dm=L(J(),1);async function X(e,t,r){return Z("docker",["compose",...e],{cwd:t,...r})}async function Zt(e,t){try{await X(["up","-d","--no-deps","web"],e,{stdio:t?.stdio??"inherit"})}catch{}}async function pe(e,t,r){return(await ro(["bin/rails",e],t,{env:r})).split(`
146
146
  `).filter(n=>!n.startsWith("[")).join(`
147
147
  `).trim()}async function Ae(e){try{let{stdout:t}=await Z("docker",["compose","config","--services"],{cwd:e}),r=t.split(`
148
148
  `).map(n=>n.trim()),i=["web","worker"].filter(n=>r.includes(n));return i.length>0?i:["web"]}catch{return["web"]}}async function Lm(e){let{stdout:t}=await Z("docker",["compose","ps","-a","-q"],{cwd:e});return t.trim().length>0}async function at(e,t){let{stdout:r}=await Z("docker",["compose","ps",e,"--format","{{.State}}"],{cwd:t});return r.split(`
149
149
  `).some(i=>i.trim()==="running")}async function Qt(e,t,r={}){let{service:i="web",tty:n=!0,detach:s=!1,env:a}=r,o=["compose","exec"];if(s&&o.push("-d"),n||o.push("-T"),a)for(let[c,d]of Object.entries(a))o.push("-e",`${c}=${d}`);o.push(i,...e),await Z("docker",o,{cwd:t,stdio:"inherit"})}async function to(e,t,r={}){let{service:i="web",env:n,captureStderr:s=!1}=r,a=["compose","run","--rm"];if(n)for(let[c,d]of Object.entries(n))a.push("-e",`${c}=${d}`);a.push(i,...e),await Z("docker",a,{cwd:t,...s?{stdin:"inherit",stdout:"inherit",stderr:["pipe","inherit"]}:{stdio:"inherit"}})}async function In(e,t){let r=t?.stdio??"pipe";await X(["up","-d","--wait","postgres"],e,{stdio:r}),await X(["run","--rm","--build","web","bin/rails","db:prepare"],e,{stdio:r})}async function Bm(e,t={}){let{service:r="web",edgeHint:i}=t;return await at(r,e)?"exec":(He(e)&&(C([`The ${r} container is not running, and this is a monorepo edge project.`,`Run ${Dm.default.bold("pnpm server:dev")} from the monorepo root${i?` \u2014 ${i}`:""}.`].join(`
150
- `)),process.exit(1)),k.info(`${r} container is not running \u2014 using a one-off container (\`docker compose run\`) instead.`),"run")}async function U(e,t,r={}){let{service:i="web",env:n}=r;await Bm(t,r)==="exec"?await Qt(e,t,{service:i,env:n}):await to(e,t,{service:i,env:n})}async function ro(e,t,r={}){let{service:i="web",env:n}=r,s=await Bm(t,r),a=["compose",s];if(s==="run"&&a.push("--rm"),a.push("-T"),n)for(let[c,d]of Object.entries(n))a.push("-e",`${c}=${d}`);a.push(i,...e);let o;for(let c=0;c<5;c++)try{let{stdout:d}=await Z("docker",a,{cwd:t});return d}catch(d){if(o=d,!vx(d))throw d;await new Promise(u=>setTimeout(u,2e3))}throw o}function vx(e){let t=e instanceof Error?e.message:String(e);return/is not running/i.test(t)||/no such container/i.test(t)||/container .* is restarting/i.test(t)}async function Dr(e,t){await Z("docker",["compose","logs","-f",e],{cwd:t,stdio:"inherit"})}var io=`http://localhost:${3e3}`,ft=class extends Error{};function zm(){return process.env.XDG_CONFIG_HOME?ge.join(process.env.XDG_CONFIG_HOME,"spree"):ge.join(wx.homedir(),".config","spree")}function Tt(){return ge.join(zm(),"config.json")}function tr(e){return e?.code==="ENOENT"}function Lr(){let e;try{e=fe.readFileSync(Tt(),"utf-8")}catch(t){if(tr(t))return{profiles:{}};throw t}try{let t=JSON.parse(e);return{...t,profiles:t.profiles??{}}}catch{let t=`${Tt()}.bak`;try{fe.renameSync(Tt(),t)}catch{}return process.stderr.write(`${er.default.yellow(`warning: ${Tt()} was not valid JSON; moved it to ${t} and starting fresh.`)}
150
+ `)),process.exit(1)),k.info(`${r} container is not running \u2014 using a one-off container (\`docker compose run\`) instead.`),"run")}async function U(e,t,r={}){let{service:i="web",env:n}=r;await Bm(t,r)==="exec"?await Qt(e,t,{service:i,env:n}):await to(e,t,{service:i,env:n})}async function ro(e,t,r={}){let{service:i="web",env:n}=r,s=await Bm(t,r),a=["compose",s];if(s==="run"&&a.push("--rm"),a.push("-T"),n)for(let[c,d]of Object.entries(n))a.push("-e",`${c}=${d}`);a.push(i,...e);let o;for(let c=0;c<5;c++)try{let{stdout:d}=await Z("docker",a,{cwd:t});return d}catch(d){if(o=d,!wx(d))throw d;await new Promise(u=>setTimeout(u,2e3))}throw o}function wx(e){let t=e instanceof Error?e.message:String(e);return/is not running/i.test(t)||/no such container/i.test(t)||/container .* is restarting/i.test(t)}async function Dr(e,t){await Z("docker",["compose","logs","-f",e],{cwd:t,stdio:"inherit"})}var io=`http://localhost:${3e3}`,ft=class extends Error{};function zm(){return process.env.XDG_CONFIG_HOME?ge.join(process.env.XDG_CONFIG_HOME,"spree"):ge.join(xx.homedir(),".config","spree")}function Tt(){return ge.join(zm(),"config.json")}function tr(e){return e?.code==="ENOENT"}function Lr(){let e;try{e=fe.readFileSync(Tt(),"utf-8")}catch(t){if(tr(t))return{profiles:{}};throw t}try{let t=JSON.parse(e);return{...t,profiles:t.profiles??{}}}catch{let t=`${Tt()}.bak`;try{fe.renameSync(Tt(),t)}catch{}return process.stderr.write(`${er.default.yellow(`warning: ${Tt()} was not valid JSON; moved it to ${t} and starting fresh.`)}
151
151
  `),{profiles:{}}}}function no(e){fe.mkdirSync(zm(),{recursive:!0,mode:448}),Mm(Tt(),`${JSON.stringify(e,null,2)}
152
152
  `)}function Mm(e,t){fe.writeFileSync(e,t,{mode:384}),fe.chmodSync(e,384)}function rr(e){return ge.join(e,".spree","credentials.json")}function so(e){return ge.join(e,".spree","setup-complete")}function Fm(e){let t=so(e);fe.mkdirSync(ge.dirname(t),{recursive:!0,mode:448}),ao(ge.join(ge.dirname(t),".gitignore")),fe.writeFileSync(t,`${new Date().toISOString()}
153
153
  `)}function Gm(e){return ge.join(e,".spree","admin-email")}function Um(e,t){let r=Gm(e);fe.mkdirSync(ge.dirname(r),{recursive:!0,mode:448}),ao(ge.join(ge.dirname(r),".gitignore")),fe.writeFileSync(r,`${t}
154
- `)}function Nm(e){try{return fe.readFileSync(Gm(e),"utf-8").trim()||null}catch(t){if(tr(t))return null;throw t}}function xx(e){let t;try{t=fe.readFileSync(rr(e),"utf-8")}catch(r){if(tr(r))return null;throw r}try{return JSON.parse(t)}catch{return null}}function Sx(e,t){let r=rr(e),i=ge.dirname(r);fe.mkdirSync(i,{recursive:!0,mode:448}),ao(ge.join(i,".gitignore")),Mm(r,`${JSON.stringify(t,null,2)}
154
+ `)}function Nm(e){try{return fe.readFileSync(Gm(e),"utf-8").trim()||null}catch(t){if(tr(t))return null;throw t}}function Sx(e){let t;try{t=fe.readFileSync(rr(e),"utf-8")}catch(r){if(tr(r))return null;throw r}try{return JSON.parse(t)}catch{return null}}function $x(e,t){let r=rr(e),i=ge.dirname(r);fe.mkdirSync(i,{recursive:!0,mode:448}),ao(ge.join(i,".gitignore")),Mm(r,`${JSON.stringify(t,null,2)}
155
155
  `)}function ao(e){let t="";try{t=fe.readFileSync(e,"utf-8")}catch(i){if(!tr(i))throw i}t.split(`
156
156
  `).some(i=>i.trim()==="*")||fe.writeFileSync(e,t&&!t.endsWith(`
157
157
  `)?`${t}
@@ -161,18 +161,18 @@ Run this command from a directory created with create-spree-app.`);let i=kx(t);r
161
161
  ${er.default.dim(o)}`:`Could not mint an API key via the dev stack. Is it running? Start it with \`spree dev\`.
162
162
  ${er.default.dim(a.split(`
163
163
  `)[0])}`)}let i=t.keyType==="publishable"?"pk_":"sk_",n=r.match(new RegExp(`${i}[A-Za-z0-9_-]+`))?.[0];if(!n)throw new ft("Could not mint an API key via the dev stack. Is it running? Start it with `spree dev`.");return n}async function po(e,t,r=!1){r||process.stderr.write(`${er.default.dim("No credentials found \u2014 minting a read-only API key via the dev stack...")}
164
- `);let i=await oo(e,{name:"@spree/cli (auto)",keyType:"secret",scopes:["read_all"],replace:!0}),n={baseUrl:`http://localhost:${t}`,token:i,scopes:["read_all"],mintedAt:new Date().toISOString()};return Sx(e,n),r||process.stderr.write(`${er.default.dim("Saved to .spree/credentials.json (scopes: read_all)")}
165
- `),n}async function Br(e,t={}){let{allowMint:r=!0,cwd:i=process.cwd()}=t,n=Lr(),s=e.baseUrl,a=e.apiKey,o;if(a&&(o={apiKey:a,source:"flags"}),!o&&e.profile){let u=n.profiles[e.profile];if(!u)throw new ft(`Unknown profile "${e.profile}". Run \`spree auth login --profile ${e.profile}\` to create it.`);o={baseUrl:u.baseUrl,apiKey:u.token,source:"profile",profileName:e.profile}}if(!o&&process.env.SPREE_API_KEY&&(o={baseUrl:process.env.SPREE_BASE_URL,apiKey:process.env.SPREE_API_KEY,source:"env"}),!o){let u,l=0;try{let h=v(i);u=h.projectDir,l=h.port}catch{}if(u){let h=`http://localhost:${l}`,y=!s||s.replace(/\/$/,"")===h,g=xx(u);!g&&r&&y&&(g=await po(u,l)),g&&(o={baseUrl:g.baseUrl,apiKey:g.token,source:"project",scopes:g.scopes})}}if(!o&&n.defaultProfile){let u=n.profiles[n.defaultProfile];u&&(o={baseUrl:u.baseUrl,apiKey:u.token,source:"profile",profileName:n.defaultProfile})}let c=s??o?.baseUrl,d=o?.apiKey;if(!c&&(o?.source==="flags"||o?.source==="env")&&(c=io),!c||!d)throw new ft(["No Admin API credentials found. Provide them via one of (host and key resolve together per source):"," - flags: --api-key <sk_...> (host defaults to "+io+"; pass --base-url for a remote store)"," - env: SPREE_API_KEY (host defaults to "+io+"; set SPREE_BASE_URL for a remote store)"," - project: run inside a Spree project with the dev stack up (auto-mints a read-only key)"," - profile: spree auth login --profile <name>"].join(`
164
+ `);let i=await oo(e,{name:"@spree/cli (auto)",keyType:"secret",scopes:["read_all"],replace:!0}),n={baseUrl:`http://localhost:${t}`,token:i,scopes:["read_all"],mintedAt:new Date().toISOString()};return $x(e,n),r||process.stderr.write(`${er.default.dim("Saved to .spree/credentials.json (scopes: read_all)")}
165
+ `),n}async function Br(e,t={}){let{allowMint:r=!0,cwd:i=process.cwd()}=t,n=Lr(),s=e.baseUrl,a=e.apiKey,o;if(a&&(o={apiKey:a,source:"flags"}),!o&&e.profile){let u=n.profiles[e.profile];if(!u)throw new ft(`Unknown profile "${e.profile}". Run \`spree auth login --profile ${e.profile}\` to create it.`);o={baseUrl:u.baseUrl,apiKey:u.token,source:"profile",profileName:e.profile}}if(!o&&process.env.SPREE_API_KEY&&(o={baseUrl:process.env.SPREE_BASE_URL,apiKey:process.env.SPREE_API_KEY,source:"env"}),!o){let u,l=0;try{let h=v(i);u=h.projectDir,l=h.port}catch{}if(u){let h=`http://localhost:${l}`,y=!s||s.replace(/\/$/,"")===h,g=Sx(u);!g&&r&&y&&(g=await po(u,l)),g&&(o={baseUrl:g.baseUrl,apiKey:g.token,source:"project",scopes:g.scopes})}}if(!o&&n.defaultProfile){let u=n.profiles[n.defaultProfile];u&&(o={baseUrl:u.baseUrl,apiKey:u.token,source:"profile",profileName:n.defaultProfile})}let c=s??o?.baseUrl,d=o?.apiKey;if(!c&&(o?.source==="flags"||o?.source==="env")&&(c=io),!c||!d)throw new ft(["No Admin API credentials found. Provide them via one of (host and key resolve together per source):"," - flags: --api-key <sk_...> (host defaults to "+io+"; pass --base-url for a remote store)"," - env: SPREE_API_KEY (host defaults to "+io+"; set SPREE_BASE_URL for a remote store)"," - project: run inside a Spree project with the dev stack up (auto-mints a read-only key)"," - profile: spree auth login --profile <name>"].join(`
166
166
  `));return{baseUrl:c,apiKey:d,source:o?.source??"flags",profileName:o?.profileName,tokenPrefix:On(d),scopes:o?.scopes}}var co={dashboard:{dir:"dashboard",template:"dashboard-starter",templateEnvVar:"SPREE_DASHBOARD_TEMPLATE",port:5173,label:"Dashboard"},"seller-dashboard":{dir:"seller-dashboard",template:"seller-dashboard-starter",templateEnvVar:"SPREE_SELLER_DASHBOARD_TEMPLATE",port:5174,label:"Seller Panel"}};function Hm(e){e.command("add").description("Add an optional component to your project").argument("<thing>","Component to add: dashboard or seller-dashboard").option("--template <src>","Starter template: git URL or local path (default: the template bundled with the CLI; env SPREE_DASHBOARD_TEMPLATE / SPREE_SELLER_DASHBOARD_TEMPLATE overrides)").option("--no-install","Skip dependency install").option("--quiet","Skip the final summary note (for wrapping tools that print their own)").action(async(t,r)=>{let i=co[t];i||(console.error(`
167
167
  ${_e.default.red("Error:")} Unknown component: ${t}. Try: ${Object.keys(co).join(", ")}
168
- `),process.exit(2)),bi(_e.default.bgCyan(_e.default.black(` Spree ${i.label} `)));let n=v();await Ex(n,i,{template:r.template??process.env[i.templateEnvVar]??jx(i),install:r.install,quiet:r.quiet}),Ot("Done!")})}async function Ex(e,t,r){let i=ce.join(e.projectDir,"apps",t.dir),n=ce.join(i,".env.local");if(me.existsSync(i)){let o=Wm(e.projectDir,t.dir,e.port);if(o==="untouched"){k.warn(`${_e.default.bold(`apps/${t.dir}/`)} already exists. Nothing to do.`);return}k.info(`${o==="written"?"Wrote missing":"Repaired"} ${_e.default.bold(`apps/${t.dir}/.env.local`)}. Nothing else to do.`);return}let s=M();s.start(`Fetching ${t.label.toLowerCase()} starter...`);try{await Tx(r.template,i),Px(i)}catch(o){s.stop("Fetch failed."),k.error(o instanceof Error?o.message:String(o)),process.exit(1)}s.stop(`Created ${_e.default.cyan(`apps/${t.dir}/`)}`),Km(n,e.port);let a=_t(e.projectDir,i);if(r.install){s.start(`Installing dependencies with ${a}...`);try{await Z(a,["install"],{cwd:i}),s.stop("Dependencies installed."),await uo(i)}catch(o){s.stop(_e.default.yellow(`${a} install failed \u2014 run it manually in apps/${t.dir}/.`)),k.warn(o instanceof Error?o.message:String(o))}}r.quiet||H(["Start it with:",` ${_e.default.cyan(`${a==="npm"?"npx":a} spree dev`)}`,` ${_e.default.dim("# runs the API and the dashboard together")}`,...r.install?[]:[` ${_e.default.dim(`# install dependencies first: cd apps/${t.dir} && ${a} install`)}`],"",`Then open ${_e.default.bold(`http://localhost:${t.port}`)} and sign in.`].join(`
169
- `),`${t.label} added!`)}function jx(e){let t=ce.dirname(Ax(import.meta.url)),r=[ce.resolve(t,"../../templates",e.template),ce.resolve(t,"templates",e.template)];for(let i of r)if(me.existsSync(ce.join(i,"package.json")))return i;console.error(`
168
+ `),process.exit(2)),bi(_e.default.bgCyan(_e.default.black(` Spree ${i.label} `)));let n=v();await jx(n,i,{template:r.template??process.env[i.templateEnvVar]??Px(i),install:r.install,quiet:r.quiet}),Ot("Done!")})}async function jx(e,t,r){let i=ce.join(e.projectDir,"apps",t.dir),n=ce.join(i,".env.local");if(me.existsSync(i)){let o=Wm(e.projectDir,t.dir,e.port);if(o==="untouched"){k.warn(`${_e.default.bold(`apps/${t.dir}/`)} already exists. Nothing to do.`);return}k.info(`${o==="written"?"Wrote missing":"Repaired"} ${_e.default.bold(`apps/${t.dir}/.env.local`)}. Nothing else to do.`);return}let s=M();s.start(`Fetching ${t.label.toLowerCase()} starter...`);try{await Cx(r.template,i),Tx(i)}catch(o){s.stop("Fetch failed."),k.error(o instanceof Error?o.message:String(o)),process.exit(1)}s.stop(`Created ${_e.default.cyan(`apps/${t.dir}/`)}`),Km(n,e.port);let a=_t(e.projectDir,i);if(r.install){s.start(`Installing dependencies with ${a}...`);try{await Z(a,["install"],{cwd:i}),s.stop("Dependencies installed."),await uo(i)}catch(o){s.stop(_e.default.yellow(`${a} install failed \u2014 run it manually in apps/${t.dir}/.`)),k.warn(o instanceof Error?o.message:String(o))}}r.quiet||H(["Start it with:",` ${_e.default.cyan(`${a==="npm"?"npx":a} spree dev`)}`,` ${_e.default.dim("# runs the API and the dashboard together")}`,...r.install?[]:[` ${_e.default.dim(`# install dependencies first: cd apps/${t.dir} && ${a} install`)}`],"",`Then open ${_e.default.bold(`http://localhost:${t.port}`)} and sign in.`].join(`
169
+ `),`${t.label} added!`)}function Px(e){let t=ce.dirname(Ex(import.meta.url)),r=[ce.resolve(t,"../../templates",e.template),ce.resolve(t,"templates",e.template)];for(let i of r)if(me.existsSync(ce.join(i,"package.json")))return i;console.error(`
170
170
  ${_e.default.red("Error:")} Bundled ${e.label.toLowerCase()} template not found. In the monorepo, run ${_e.default.cyan("pnpm build")} in packages/cli first (it generates the templates), or pass --template <path|git-url>.
171
- `),process.exit(1)}async function uo(e){await Z("node",["--input-type=module","-e","const { resolveConfig } = await import('vite'); await resolveConfig({}, 'serve')"],{cwd:e,reject:!1})}function Px(e){let t=ce.join(e,"gitignore.template");me.existsSync(t)&&me.renameSync(t,ce.join(e,".gitignore"))}async function Tx(e,t){if(me.existsSync(e)&&me.statSync(e).isDirectory()){me.cpSync(e,t,{recursive:!0,filter:r=>{let i=ce.basename(r);return i!=="node_modules"&&i!=="dist"&&i!==".git"}});return}await Z("git",["clone","--depth","1","--",e,t]),me.rmSync(ce.join(t,".git"),{recursive:!0,force:!0})}var Vm=/^VITE_SPREE_API_URL=(https?:\/\/localhost\S*)$/m;function Wm(e,t,r){let i=ce.join(e,"apps",t);if(!me.existsSync(ce.join(i,"package.json")))return"untouched";let n=ce.join(i,".env.local"),s;try{s=me.readFileSync(n,"utf-8")}catch(a){if(!tr(a))throw a;return Km(n,r),"written"}return Vm.test(s)?(me.writeFileSync(n,s.replace(Vm,`VITE_API_PROXY_TARGET=http://localhost:${r}`)),"repaired"):"untouched"}var lo=Object.values(co).map(e=>e.dir);function Dn(e,t){let r="untouched";for(let i of lo){let n=Wm(e,i,t);n!=="untouched"&&(r=n)}return r}function Km(e,t){me.writeFileSync(e,["# Dev-server proxy target \u2014 where Vite forwards /api and /rails (your","# Rails backend). The SPA stays same-origin with the API: the SDK uses","# relative URLs and the proxy bridges the port gap.","#","# Do NOT set VITE_SPREE_API_URL for local dev \u2014 it switches the SDK to","# absolute cross-origin URLs, which breaks on CORS and the SameSite=Lax","# auth cookie. Set it only when building for a deploy where the","# dashboard is hosted on a different origin than the API.","#","# No credentials belong in this file \u2014 every VITE_-prefixed value is","# compiled into the client bundle.",`VITE_API_PROXY_TARGET=http://localhost:${t}`,""].join(`
172
- `))}function _t(e,t){for(let r of[t,e]){if(me.existsSync(ce.join(r,"pnpm-lock.yaml")))return"pnpm";if(me.existsSync(ce.join(r,"yarn.lock")))return"yarn";if(me.existsSync(ce.join(r,"package-lock.json")))return"npm"}return"pnpm"}p();p();function x(e){if(!e)return;let t={};return e.expand?.length&&(t.expand=e.expand.join(",")),e.fields?.length&&(t.fields=e.fields.join(",")),Object.keys(t).length>0?t:void 0}function Cx(e){return e===!1?!1:{maxRetries:e?.maxRetries??2,retryOnStatus:e?.retryOnStatus??[429,500,502,503,504],baseDelay:e?.baseDelay??300,maxDelay:e?.maxDelay??1e4,retryOnNetworkError:e?.retryOnNetworkError??!0}}var Rx=new Set(["page","limit","expand","sort","fields"]);function _(e){let t={};for(let[r,i]of Object.entries(e))if(i!==void 0){if(Rx.has(r)){t[r]=Array.isArray(i)?i.join(","):i;continue}if(r.startsWith("q[")){t[r]=i;continue}if(Array.isArray(i)){let n=r.endsWith("[]")?r.slice(0,-2):r;t[`q[${n}][]`]=i}else t[`q[${r}]`]=i}return t}var qt=class extends Error{code;status;details;constructor(e,t){super(e.error.message),this.name="SpreeError",this.code=e.error.code,this.status=t,this.details=e.error.details}};function Ym(e,t){let r=t.baseDelay*2**e,i=Math.random()*t.baseDelay;return Math.min(r+i,t.maxDelay)}function Jm(e){return new Promise(t=>setTimeout(t,e))}function Ix(){return`spree-sdk-retry-${crypto.randomUUID()}`}function Ox(e,t,r,i){return e==="GET"||e==="HEAD"||i?r.retryOnStatus.includes(t):t===429}function Dx(e,t,r){return t.retryOnNetworkError?e==="GET"||e==="HEAD"||r:!1}function Lx(e,t,r,i){return async function(s,a,o={}){let{token:c,spreeToken:d,idempotencyKey:u,headers:l={},body:h,params:y}=o,g=o.locale??i?.locale,b=o.currency??i?.currency,$=o.country??i?.country,S=o.channel??i?.channel,A=typeof window<"u"?window.location.origin:void 0,q=e.baseUrl||A;if(!q)throw new TypeError("sdk-core: baseUrl is required in non-browser environments (no window.location to resolve relative URLs against)");let O=new URL(`${e.baseUrl}${t}${a}`,q);y&&Object.entries(y).forEach(([Y,j])=>{if(j!==void 0)if(Array.isArray(j))for(let Xe of j)O.searchParams.append(Y,String(Xe));else O.searchParams.set(Y,String(j))});let E={"Content-Type":"application/json",...l};r.headerValue&&(E[r.headerName]=r.headerValue),c&&(E.Authorization=`Bearer ${c}`),d&&(E["x-spree-token"]=d),g&&(E["x-spree-locale"]=g),b&&(E["x-spree-currency"]=b),$&&(E["x-spree-country"]=$),S&&(E["x-spree-channel"]=S);let R=u??(s!=="GET"&&s!=="HEAD"&&e.retryConfig?Ix():void 0);R&&(E["Idempotency-Key"]=R);let B=!!R,z=e.retryConfig?e.retryConfig.maxRetries+1:1;for(let Y=0;Y<z;Y++)try{let j=await e.fetchFn(O.toString(),{method:s,headers:E,body:h?JSON.stringify(h):void 0,credentials:e.credentials});if(!j.ok){if(!(Y>=z-1)&&e.retryConfig&&Ox(s,j.status,e.retryConfig,B)){let K=j.headers.get("Retry-After"),he=K?Math.min(parseInt(K,10)*1e3,e.retryConfig.maxDelay):Ym(Y,e.retryConfig);await Jm(he);continue}let Pe=await j.json().catch(()=>null);throw typeof Pe?.error?.code=="string"&&typeof Pe.error.message=="string"?new qt(Pe,j.status):new qt({error:{code:"http_error",message:`Request failed with status ${j.status}`}},j.status)}return j.status===204?void 0:j.status===202?j.headers.get("content-type")?.includes("application/json")?j.json():void 0:j.json()}catch(j){if(j instanceof qt)throw j;if(!(Y>=z-1)&&e.retryConfig&&Dx(s,e.retryConfig,B)){let Pe=Ym(Y,e.retryConfig);await Jm(Pe);continue}throw j}throw new Error("Unexpected end of retry loop")}}var bt={product:"/products",variant:"/variants",order:"/orders",customer:"/customers",category:"/categories",collection:"/collections",option_type:"/option_types"},Bx=class{request;constructor(e){this.request=e}parentScopedCustomFields(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields`,{...i,params:r?_(r):void 0}),get:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields/${r}`,i),create:(t,r,i)=>this.request("POST",`${e}/${t}/custom_fields`,{...i,body:r}),update:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/custom_fields/${r}`,{...n,body:i}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/custom_fields/${r}`,i)}}parentScopedTranslations(e){return{get:(t,r)=>this.request("GET",`${e}/${t}/translations`,r).then(i=>i.data)}}productMembership(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/products`,{...i,params:r?_(r):void 0}),create:(t,r,i)=>this.request("POST",`${e}/${t}/products`,{...i,body:{product_ids:r}}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/products`,{...i,body:{product_ids:r}})}}positionedProductMembership(e){return{...this.productMembership(e),reposition:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/products/${r}/reposition`,{...n,body:i})}}customFields(e,t){let r=bt[e];if(!r)throw new Error(`Unknown custom-field owner type: ${e}. Add it to CUSTOM_FIELD_OWNER_PATHS.`);let i=this.parentScopedCustomFields(r);return{list:(n,s)=>i.list(t,n,s),get:(n,s)=>i.get(t,n,s),create:(n,s)=>i.create(t,n,s),update:(n,s,a)=>i.update(t,n,s,a),delete:(n,s)=>i.delete(t,n,s)}}customFieldDefinitions={list:(e,t)=>this.request("GET","/custom_field_definitions",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/custom_field_definitions/${e}`,t),resourceTypes:e=>this.request("GET","/custom_field_definitions/resource_types",e),create:(e,t)=>this.request("POST","/custom_field_definitions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/custom_field_definitions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/custom_field_definitions/${e}`,t)};auth={login:(e,t)=>this.request("POST","/auth/login",{...t,body:e}),refresh:e=>this.request("POST","/auth/refresh",e),logout:e=>this.request("POST","/auth/logout",e),providers:e=>this.request("GET","/auth/providers",e),lookupInvitation:(e,t,r)=>this.request("GET",`/auth/invitations/${e}/lookup`,{...r,params:{token:t}}),acceptInvitation:(e,t,r,i)=>this.request("POST",`/auth/invitations/${e}/accept`,{...i,params:{token:t},body:r}),setupStatus:e=>this.request("GET","/auth/setup",e),setupCountries:e=>this.request("GET","/auth/setup/countries",e),completeSetup:(e,t)=>this.request("POST","/auth/setup",{...t,body:e}),requestPasswordReset:(e,t)=>this.request("POST","/auth/password_resets",{...t,body:e}),resetPassword:(e,t,r)=>this.request("PATCH",`/auth/password_resets/${encodeURIComponent(e)}`,{...r,body:t})};me={get:e=>this.request("GET","/me",e),update:(e,t)=>this.request("PATCH","/me",{...t,body:e})};reporting={query:(e,t)=>this.request("POST","/reporting/query",{...t,body:e}),schema:e=>this.request("GET","/reporting/schema",e),savedReports:{list:(e,t)=>this.request("GET","/reporting/saved_reports",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/reporting/saved_reports/${e}`,t),create:(e,t)=>this.request("POST","/reporting/saved_reports",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/reporting/saved_reports/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/reporting/saved_reports/${e}`,t)}};dashboard={counters:(e,t)=>this.request("GET","/dashboard/counters",{...t,params:e})};store={get:e=>this.request("GET","/store",e),update:(e,t)=>this.request("PATCH","/store",{...t,body:e}),dataSources:e=>this.request("GET","/store/data_sources",e).then(t=>t.data)};locales={list:e=>this.request("GET","/locales",e).then(t=>t.data)};translatableResources={list:e=>this.request("GET","/translatable_resources",e).then(t=>t.data)};translations={coverage:(e,t,r)=>{let{page:i,limit:n,search:s,...a}=t??{};return this.request("GET","/translations",{...r,params:{resource_type:e,...i===void 0?{}:{page:i},...n===void 0?{}:{limit:n},...s===void 0?{}:{search:s},..._(a)}})},batch:(e,t)=>this.request("POST","/translations/batch",{...t,body:{translations:e}}).then(r=>r.data)};products={list:(e,t)=>this.request("GET","/products",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/products/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/products",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/products/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/products/${e}`,t),clone:(e,t)=>this.request("POST",`/products/${e}/clone`,t),approve:(e,t)=>this.request("PATCH",`/products/${e}/approve`,t),reject:(e,t,r)=>this.request("PATCH",`/products/${e}/reject`,{...r,body:t}),bulkStatusUpdate:(e,t)=>this.request("POST","/products/bulk_status_update",{...t,body:e}),bulkAddToCategories:(e,t)=>this.request("POST","/products/bulk_add_to_categories",{...t,body:e}),bulkRemoveFromCategories:(e,t)=>this.request("POST","/products/bulk_remove_from_categories",{...t,body:e}),bulkAddToCollections:(e,t)=>this.request("POST","/products/bulk_add_to_collections",{...t,body:e}),bulkRemoveFromCollections:(e,t)=>this.request("POST","/products/bulk_remove_from_collections",{...t,body:e}),bulkAddToChannels:(e,t)=>this.request("POST","/products/bulk_add_to_channels",{...t,body:e}),bulkRemoveFromChannels:(e,t)=>this.request("POST","/products/bulk_remove_from_channels",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/products/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/products/bulk_remove_tags",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/products/bulk_destroy",{...t,body:e}),media:{list:(e,t,r)=>this.request("GET",`/products/${e}/media`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/media`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/media/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/media/${t}`,r)},digitalAssets:{list:(e,t,r)=>this.request("GET",`/products/${e}/digital_assets`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/digital_assets`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/digital_assets/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/digital_assets/${t}`,r),providers:(e,t)=>this.request("GET",`/products/${e}/digital_assets/providers`,t)},variants:{list:(e,t,r)=>this.request("GET",`/products/${e}/variants`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/products/${e}/variants`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/variants/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/variants/${t}`,r),media:{list:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}/media`,{...i,params:r?_(r):void 0}),create:(e,t,r,i)=>this.request("POST",`/products/${e}/variants/${t}/media`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/products/${e}/variants/${t}/media/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/products/${e}/variants/${t}/media/${r}`,i)}},customFields:this.parentScopedCustomFields(bt.product),translations:this.parentScopedTranslations("/products")};digitalLinks={list:(e,t)=>this.request("GET","/digital_links",{...t,params:e?_(e):void 0}),retrieve:(e,t)=>this.request("GET",`/digital_links/${e}`,t),reset:(e,t)=>this.request("PATCH",`/digital_links/${e}/reset`,t)};orders={list:(e,t)=>this.request("GET","/orders",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/orders/${e}`,t),complete:(e,t,r)=>this.request("PATCH",`/orders/${e}/complete`,{...r,body:t}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/cancel`,{...r,body:t}),approve:(e,t)=>this.request("PATCH",`/orders/${e}/approve`,t),resendConfirmation:(e,t)=>this.request("POST",`/orders/${e}/resend_confirmation`,t),resendDigitalLinks:(e,t)=>this.request("POST",`/orders/${e}/resend_digital_links`,t),giftCards:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/gift_cards`,{...r,body:t}),remove:(e,t,r)=>this.request("DELETE",`/orders/${e}/gift_cards/${t}`,r)},storeCredits:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/store_credits`,{...r,body:t}),remove:(e,t)=>this.request("DELETE",`/orders/${e}/store_credits`,t)},items:{list:(e,t,r)=>this.request("GET",`/orders/${e}/items`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/items/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/items`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/items/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/items/${t}`,r)},fulfillments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/fulfillments`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/fulfill`,{...i,body:r}),markDelivered:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/mark_delivered`,{...i,body:r}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/cancel`,r),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/labels/${r}`,i)},deliveries:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/deliveries`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),markDelivered:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}/mark_delivered`,{...n,body:i})},split:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/split`,{...i,body:r})},returns:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/returns`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/returns/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/receive`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/refund`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/cancel`,{...i,body:r}),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/returns/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/returns/${t}/labels/${r}`,i)}},exchanges:{list:(e,t,r)=>this.request("GET",`/orders/${e}/exchanges`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/exchanges/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/exchanges`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/receive`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/fulfill`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/cancel`,{...i,body:r})},claims:{list:(e,t,r)=>this.request("GET",`/orders/${e}/claims`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/claims/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/claims`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/claims/${t}/approve`,r),resolve:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/resolve`,{...i,body:r}),deny:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/deny`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/cancel`,{...i,body:r})},payments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/payments`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/payments/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/payments`,{...r,body:t}),capture:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/capture`,r),void:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/void`,r)},refunds:{list:(e,t,r)=>this.request("GET",`/orders/${e}/refunds`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/orders/${e}/refunds`,{...r,body:t})},taxLines:{list:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines/${t}`,r)},discounts:{list:(e,t,r)=>this.request("GET",`/orders/${e}/discounts`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/discounts/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/discounts`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/discounts/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discounts/${t}`,r)},discountCodes:{create:(e,t,r)=>this.request("POST",`/orders/${e}/discount_codes`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discount_codes/${encodeURIComponent(t)}`,r)},fees:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fees`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/fees/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/fees`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fees/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/fees/${t}`,r)},customFields:this.parentScopedCustomFields(bt.order)};optionTypes={list:(e,t)=>this.request("GET","/option_types",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/option_types/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/option_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/option_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/option_types/${e}`,t),customFields:this.parentScopedCustomFields(bt.option_type),translations:this.parentScopedTranslations("/option_types")};deliveryMethods={list:(e,t)=>this.request("GET","/delivery_methods",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_methods/${e}`,t),create:(e,t)=>this.request("POST","/delivery_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_methods/${e}`,t),calculators:e=>this.request("GET","/delivery_methods/calculators",e),fulfillmentProviders:e=>this.request("GET","/delivery_methods/fulfillment_providers",e),rateProviders:e=>this.request("GET","/delivery_methods/rate_providers",e),rules:{list:(e,t)=>this.request("GET",`/delivery_methods/${e}/rules`,t),create:(e,t,r)=>this.request("POST",`/delivery_methods/${e}/rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_methods/${e}/rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_methods/${e}/rules/${t}`,r)},ruleTypes:e=>this.request("GET","/delivery_method_rules/types",e)};deliveryProfiles={list:(e,t)=>this.request("GET","/delivery_profiles",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_profiles/${e}`,t),create:(e,t)=>this.request("POST","/delivery_profiles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_profiles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_profiles/${e}`,t),kinds:e=>this.request("GET","/delivery_profiles/kinds",e),originGroups:{list:(e,t)=>this.request("GET",`/delivery_profiles/${e}/origin_groups`,t),create:(e,t,r)=>this.request("POST",`/delivery_profiles/${e}/origin_groups`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_profiles/${e}/origin_groups/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_profiles/${e}/origin_groups/${t}`,r)}};trackingCarriers={list:e=>this.request("GET","/tracking_carriers",e)};deliveryZones={list:(e,t)=>this.request("GET","/delivery_zones",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/delivery_zones/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/delivery_zones",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_zones/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_zones/${e}`,t)};packageTypes={list:(e,t)=>this.request("GET","/package_types",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/package_types/${e}`,t),create:(e,t)=>this.request("POST","/package_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/package_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/package_types/${e}`,t)};paymentMethods={list:(e,t)=>this.request("GET","/payment_methods",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/payment_methods/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/payment_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/payment_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/payment_methods/${e}`,t),types:e=>this.request("GET","/payment_methods/types",e)};integrations={list:(e,t)=>this.request("GET","/integrations",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/integrations/${e}`,t),create:(e,t)=>this.request("POST","/integrations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/integrations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/integrations/${e}`,t),types:e=>this.request("GET","/integrations/types",e),test:(e,t)=>this.request("POST",`/integrations/${e}/test`,t)};priceLists={list:(e,t)=>this.request("GET","/price_lists",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/price_lists/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/price_lists",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/price_lists/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/price_lists/${e}`,t),products:this.productMembership("/price_lists"),activate:(e,t)=>this.request("PATCH",`/price_lists/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/price_lists/${e}/deactivate`,t),ruleTypes:e=>this.request("GET","/price_lists/price_rule_types",e)};prices={list:(e,t)=>this.request("GET","/prices",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/prices/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/prices",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/prices/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/prices/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/prices/bulk_upsert",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/prices/bulk_destroy",{...t,body:e})};promotions={list:(e,t)=>this.request("GET","/promotions",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/promotions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/promotions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/promotions/${e}`,t),actions:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_actions`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_actions/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_actions/${t}`,r)},rules:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_rules/${t}`,r)},couponCodes:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes/${t}`,r)}};promotionActions={types:e=>this.request("GET","/promotion_actions/types",e),calculators:(e,t)=>this.request("GET","/promotion_actions/calculators",{...t,params:{type:e}})};promotionRules={types:e=>this.request("GET","/promotion_rules/types",e)};tags={list:(e,t)=>this.request("GET","/tags",{...t,params:e})};customerGroups={list:(e,t)=>this.request("GET","/customer_groups",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/customer_groups/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/customer_groups",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customer_groups/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customer_groups/${e}`,t)};sellers={list:(e,t)=>this.request("GET","/sellers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/sellers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/sellers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/sellers/${e}`,t),invite:(e,t,r)=>this.request("POST",`/sellers/${e}/invite`,{...r,body:t}),approve:(e,t,r)=>this.request("PATCH",`/sellers/${e}/approve`,{...r,body:t}),onboarding:(e,t)=>this.request("GET",`/sellers/${e}/onboarding`,t),reopenOnboarding:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reopen_onboarding`,{...r,body:t}),team:{list:(e,t)=>this.request("GET",`/sellers/${e}/team`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/team/${t}`,r)},invitations:{list:(e,t)=>this.request("GET",`/sellers/${e}/invitations`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/invitations/${t}`,r),resend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/invitations/${t}/resend`,r),acceptanceLink:(e,t,r)=>this.request("GET",`/sellers/${e}/invitations/${t}/acceptance_link`,r)},requirementSubmissions:{list:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions/${t}`,r),accept:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/accept`,{...i,body:r}),reject:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/reject`,{...i,body:r}),waive:(e,t,r)=>this.request("POST",`/sellers/${e}/requirement_submissions`,{...r,body:t})},suspend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/suspend`,{...r,body:t}),reject:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reject`,{...r,body:t}),balances:(e,t)=>this.request("GET",`/sellers/${e}/balances`,t),settle:(e,t)=>this.request("POST",`/sellers/${e}/payouts`,t)};sellerRequirements={list:(e,t)=>this.request("GET","/seller_requirements",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/seller_requirements/${e}`,t),create:(e,t)=>this.request("POST","/seller_requirements",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/seller_requirements/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/seller_requirements/${e}`,t),types:e=>this.request("GET","/seller_requirements/types",e)};commissionRates={list:(e,t)=>this.request("GET","/commission_rates",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_rates/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/commission_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/commission_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/commission_rates/${e}`,t),ruleTypes:e=>this.request("GET","/commission_rates/rule_types",e)};commissionLines={list:(e,t)=>this.request("GET","/commission_lines",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_lines/${e}`,{...r,params:x(t)})};orderGroups={list:(e,t)=>this.request("GET","/order_groups",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/order_groups/${e}`,{...r,params:x(t)})};sellerTransfers={list:(e,t)=>this.request("GET","/seller_transfers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_transfers/${e}`,{...r,params:x(t)})};sellerPayouts={list:(e,t)=>this.request("GET","/seller_payouts",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_payouts/${e}`,{...r,params:x(t)}),complete:(e,t,r)=>this.request("PATCH",`/seller_payouts/${e}/complete`,{...r,body:t})};giftCards={list:(e,t)=>this.request("GET","/gift_cards",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/gift_cards/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/gift_cards",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/gift_cards/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/gift_cards/${e}`,t)};storeCredits={list:(e,t)=>this.request("GET","/store_credits",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/store_credits/${e}`,{...r,params:x(t)}),events:{list:(e,t,r)=>this.request("GET",`/store_credits/${e}/events`,{...r,params:t?_(t):void 0})}};returns={list:(e,t)=>this.request("GET","/returns",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/returns/${e}`,{...r,params:x(t)})};exchanges={list:(e,t)=>this.request("GET","/exchanges",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/exchanges/${e}`,{...r,params:x(t)})};claims={list:(e,t)=>this.request("GET","/claims",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/claims/${e}`,{...r,params:x(t)})};giftCardBatches={list:(e,t)=>this.request("GET","/gift_card_batches",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/gift_card_batches/${e}`,t),create:(e,t)=>this.request("POST","/gift_card_batches",{...t,body:e})};taxRates={list:(e,t)=>this.request("GET","/tax_rates",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_rates/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/tax_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_rates/${e}`,t)};taxProviders={list:e=>this.request("GET","/tax_providers",e)};payoutProviders={list:e=>this.request("GET","/payout_providers",e)};companies={list:(e,t)=>this.request("GET","/companies",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/companies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/companies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/companies/${e}`,t),addresses:{list:(e,t,r)=>this.request("GET",`/companies/${e}/addresses`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/addresses`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/addresses/${t}`,r),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/addresses/${t}`,r)},memberships:{list:(e,t,r)=>this.request("GET",`/companies/${e}/memberships`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/memberships`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/memberships/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/memberships/${t}`,r)},invitations:{list:(e,t,r)=>this.request("GET",`/companies/${e}/invitations`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/invitations/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/invitations/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers/${t}/validate`,r)},taxExemptionCertificates:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_exemption_certificates`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_exemption_certificates`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,body:r}),verify:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/verify`,r),revoke:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/revoke`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_exemption_certificates/${t}`,r)}};catalogs={list:(e,t)=>this.request("GET","/catalogs",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/catalogs/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/catalogs",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/catalogs/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/catalogs/${e}`,t),products:this.productMembership("/catalogs"),activate:(e,t)=>this.request("PATCH",`/catalogs/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/catalogs/${e}/deactivate`,t),importProducts:(e,t)=>this.request("POST",`/catalogs/${e}/import_products`,t),assign:(e,t,r)=>this.request("POST",`/catalogs/${e}/assign`,{...r,body:t}),quantityRules:{upsert:(e,t,r)=>this.request("PUT",`/catalogs/${e}/quantity_rules`,{...r,body:t})},orderMinimums:{list:(e,t,r)=>this.request("GET",`/catalogs/${e}/order_minimums`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/catalogs/${e}/order_minimums`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/catalogs/${e}/order_minimums/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/catalogs/${e}/order_minimums/${t}`,r)}};catalogAssignments={delete:(e,t)=>this.request("DELETE",`/catalog_assignments/${e}`,t)};exports={list:(e,t)=>this.request("GET","/exports",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/exports/${e}`,t),create:(e,t)=>this.request("POST","/exports",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/exports/${e}`,t)};imports={list:(e,t)=>this.request("GET","/imports",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/imports/${e}`,t),create:(e,t)=>this.request("POST","/imports",{...t,body:e}),completeMapping:(e,t,r)=>this.request("PATCH",`/imports/${e}/complete_mapping`,{...r,body:t??{}}),retryFailedRows:(e,t)=>this.request("PATCH",`/imports/${e}/retry_failed_rows`,t),delete:(e,t)=>this.request("DELETE",`/imports/${e}`,t),rows:{list:(e,t,r)=>this.request("GET",`/imports/${e}/rows`,{...r,params:t?_(t):void 0})}};customers={list:(e,t)=>this.request("GET","/customers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}`,{...r,params:x(t)}),creditCards:{list:(e,t,r)=>this.request("GET",`/customers/${e}/credit_cards`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/credit_cards/${t}`,{...i,params:x(r)}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/credit_cards/${t}`,r)},create:(e,t)=>this.request("POST","/customers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customers/${e}`,t),export:(e,t)=>this.request("GET",`/customers/${e}/export`,t),anonymize:(e,t)=>this.request("POST",`/customers/${e}/anonymize`,t),bulkAddToGroups:(e,t)=>this.request("POST","/customers/bulk_add_to_groups",{...t,body:e}),bulkRemoveFromGroups:(e,t)=>this.request("POST","/customers/bulk_remove_from_groups",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/customers/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/customers/bulk_remove_tags",{...t,body:e}),addresses:{list:(e,t,r)=>this.request("GET",`/customers/${e}/addresses`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/addresses/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/addresses`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/addresses/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers/${t}/validate`,r)},storeCredits:{list:(e,t,r)=>this.request("GET",`/customers/${e}/store_credits`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/store_credits/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/store_credits`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/store_credits/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/store_credits/${t}`,r)},customFields:this.parentScopedCustomFields(bt.customer)};media={list:(e,t)=>this.request("GET","/media",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/media/${e}`,t),create:(e,t)=>this.request("POST","/media",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/media/${e}`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/media/${e}`,{...r,params:t?.detach?{detach:"true"}:void 0}),usage:(e,t)=>this.request("GET",`/media/${e}/usage`,t)};categories={list:(e,t)=>this.request("GET","/categories",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/categories/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/categories/${e}`,t),reposition:(e,t,r)=>this.request("PATCH",`/categories/${e}/reposition`,{...r,body:t}),products:this.positionedProductMembership("/categories"),customFields:this.parentScopedCustomFields(bt.category),translations:this.parentScopedTranslations("/categories")};collections={list:(e,t)=>this.request("GET","/collections",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/collections/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/collections",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/collections/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/collections/${e}`,t),products:this.positionedProductMembership("/collections"),customFields:this.parentScopedCustomFields(bt.collection),translations:this.parentScopedTranslations("/collections")};collectionRules={types:e=>this.request("GET","/collection_rules/types",e)};variants={list:(e,t)=>this.request("GET","/variants",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/variants/${e}`,{...r,params:x(t)}),customFields:this.parentScopedCustomFields(bt.variant)};productTypes={list:(e,t)=>this.request("GET","/product_types",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/product_types/${e}`,t),create:(e,t)=>this.request("POST","/product_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/product_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/product_types/${e}`,t),applyToProducts:(e,t)=>this.request("POST",`/product_types/${e}/apply_to_products`,t)};taxCategories={list:(e,t)=>this.request("GET","/tax_categories",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_categories/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/tax_categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_categories/${e}`,t)};policies={list:(e,t)=>this.request("GET","/policies",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/policies/${e}`,t),create:(e,t)=>this.request("POST","/policies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/policies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/policies/${e}`,t)};returnReasons={list:(e,t)=>this.request("GET","/return_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/return_reasons/${e}`,t),create:(e,t)=>this.request("POST","/return_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/return_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/return_reasons/${e}`,t)};claimReasons={list:(e,t)=>this.request("GET","/claim_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/claim_reasons/${e}`,t),create:(e,t)=>this.request("POST","/claim_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/claim_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/claim_reasons/${e}`,t)};orderCancellationReasons={list:(e,t)=>this.request("GET","/order_cancellation_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/order_cancellation_reasons/${e}`,t),create:(e,t)=>this.request("POST","/order_cancellation_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/order_cancellation_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/order_cancellation_reasons/${e}`,t)};refundReasons={list:(e,t)=>this.request("GET","/refund_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/refund_reasons/${e}`,t),create:(e,t)=>this.request("POST","/refund_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/refund_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/refund_reasons/${e}`,t)};channels={list:(e,t)=>this.request("GET","/channels",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/channels",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/channels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/channels/${e}`,t),addProducts:(e,t,r)=>this.request("POST",`/channels/${e}/add_products`,{...r,body:t}),removeProducts:(e,t,r)=>this.request("POST",`/channels/${e}/remove_products`,{...r,body:t}),orderRoutingRules:{list:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/channels/${e}/order_routing_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/channels/${e}/order_routing_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/channels/${e}/order_routing_rules/${t}`,r)}};orderRoutingRules={types:e=>this.request("GET","/order_routing_rules/types",e)};markets={list:(e,t)=>this.request("GET","/markets",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/markets/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/markets",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/markets/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/markets/${e}`,t)};stockLocations={list:(e,t)=>this.request("GET","/stock_locations",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_locations/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/stock_locations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_locations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_locations/${e}`,t)};stockLevels={list:(e,t)=>this.request("GET","/stock_levels",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_levels/${e}`,{...r,params:x(t)}),update:(e,t,r)=>this.request("PATCH",`/stock_levels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_levels/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/stock_levels/bulk_upsert",{...t,body:e})};stockMovements={list:(e,t)=>this.request("GET","/stock_movements",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_movements/${e}`,{...r,params:x(t)})};stockTransfers={list:(e,t)=>this.request("GET","/stock_transfers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_transfers/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/stock_transfers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_transfers/${e}`,t),markReady:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_ready`,t),markInTransit:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/mark_in_transit`,{...r,body:t}),markDraft:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/stock_transfers/${e}/stock_receipts`,{...r,params:x(t)}),get:(e,t,r,i)=>this.request("GET",`/stock_transfers/${e}/stock_receipts/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/stock_transfers/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/cancel`,{...r,body:t})};suppliers={list:(e,t)=>this.request("GET","/suppliers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/suppliers/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/suppliers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/suppliers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/suppliers/${e}`,t)};purchaseOrders={list:(e,t)=>this.request("GET","/purchase_orders",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/purchase_orders/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/purchase_orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/purchase_orders/${e}`,t),markOrdered:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_ordered`,t),markDraft:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/purchase_orders/${e}/stock_receipts`,{...r,params:x(t)}),get:(e,t,r,i)=>this.request("GET",`/purchase_orders/${e}/stock_receipts/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/purchase_orders/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/cancel`,{...r,body:t})};countries={list:(e,t)=>this.request("GET","/countries",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/countries/${e}`,{...r,params:x(t)})};directUploads={create:(e,t)=>this.request("POST","/direct_uploads",{...t,body:e})};adminUsers={list:(e,t)=>this.request("GET","/admin_users",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/admin_users/${e}`,{...r,params:x(t)}),update:(e,t,r)=>this.request("PATCH",`/admin_users/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/admin_users/${e}`,t)};invitations={list:(e,t)=>this.request("GET","/invitations",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/invitations/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/invitations",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/invitations/${e}`,t),resend:(e,t)=>this.request("PATCH",`/invitations/${e}/resend`,t),acceptanceLink:(e,t)=>this.request("GET",`/invitations/${e}/acceptance_link`,t)};apiKeys={list:(e,t)=>this.request("GET","/api_keys",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/api_keys/${e}`,{...r,params:x(t)}),current:e=>this.request("GET","/api_keys/current",e??{}),create:(e,t)=>this.request("POST","/api_keys",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/api_keys/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/api_keys/${e}`,t),revoke:(e,t)=>this.request("PATCH",`/api_keys/${e}/revoke`,t)};allowedOrigins={list:(e,t)=>this.request("GET","/allowed_origins",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/allowed_origins/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/allowed_origins",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/allowed_origins/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/allowed_origins/${e}`,t)};emailTemplates={list:(e,t)=>this.request("GET","/email_templates",{...t,params:e}),get:(e,t,r)=>this.request("GET",`/email_templates/${e}`,{...r,params:{...x(t),...t?.language?{language:t.language}:{}}}),revert:(e,t,r)=>this.request("DELETE",`/email_templates/${e}`,{...r,params:t}),draft:{update:(e,t,r)=>this.request("PUT",`/email_templates/${e}/draft`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/email_templates/${e}/draft`,{...r,params:t})},publish:(e,t,r)=>this.request("POST",`/email_templates/${e}/publication`,{...r,body:t??{}}),preview:(e,t,r)=>this.request("POST",`/email_templates/${e}/preview`,{...r,body:t??{}}),sendTest:(e,t,r)=>this.request("POST",`/email_templates/${e}/test_email`,{...r,body:t??{}}),sampleRecords:{list:(e,t,r)=>this.request("GET",`/email_templates/${e}/sample_records`,{...r,params:t})},revisions:{list:(e,t,r)=>this.request("GET",`/email_templates/${e}/revisions`,{...r,params:t?(({language:i,...n})=>({..._(n),...i?{language:i}:{}}))(t):void 0}),restore:(e,t,r,i)=>this.request("POST",`/email_templates/${e}/revisions/${t}/restoration`,{...i,body:r??{}})}};webhookEvents={list:e=>this.request("GET","/webhook_events",e)};webhookEndpoints={list:(e,t)=>this.request("GET","/webhook_endpoints",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/webhook_endpoints",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/webhook_endpoints/${e}`,t),sendTest:(e,t)=>this.request("POST",`/webhook_endpoints/${e}/send_test`,t),enable:(e,t)=>this.request("PATCH",`/webhook_endpoints/${e}/enable`,t),disable:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}/disable`,{...r,body:t}),deliveries:{list:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries/${t}`,r),redeliver:(e,t,r)=>this.request("POST",`/webhook_endpoints/${e}/deliveries/${t}/redeliver`,r)}};roles={list:(e,t)=>this.request("GET","/roles",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/roles/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/roles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/roles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/roles/${e}`,t)};permissions={list:e=>this.request("GET","/permissions",e)}};function zr(e){let t=e.baseUrl.replace(/\/$/,""),r=e.fetch||fetch.bind(globalThis),i=Cx(e.retry),n={baseUrl:t,fetchFn:r,retryConfig:i,credentials:e.credentials??"include"},s=e.jwtToken,a=e.storeId,o=null,c="/api/v3/admin",d=async(h,y,g={})=>{let b={};a&&!y.startsWith("/auth/")&&(b["X-Spree-Store-Id"]=a);let $={...g,headers:{...b,...g.headers}},S=()=>{let A=e.secretKey?{headerName:"X-Spree-Api-Key",headerValue:e.secretKey}:{headerName:"Authorization",headerValue:s?`Bearer ${s}`:""};return Lx(n,c,A)(h,y,$)};try{return await S()}catch(A){if(A instanceof qt&&A.status===401&&o&&!y.includes("/auth/")&&await o())return S();throw A}},u=new Bx(d),l=Object.create(u);return l.setStore=h=>{a=h},l.setToken=h=>{s=h},l.onUnauthorized=h=>{o=h},l}var Eh=L(Vr(),1),Le=L(J(),1);p();var yh=L(J(),1);import M0 from"fs";var Po=Symbol("no-body");async function gh(e){if(e===void 0)return Po;let t;if(e==="-")t=await F0();else if(e.startsWith("@")){let r=e.slice(1);try{t=M0.readFileSync(r,"utf-8")}catch(i){throw i?.code==="ENOENT"?new Error(`Request body file not found: ${r}`):new Error(`Could not read request body file ${r}: ${i.message}`)}}else t=e;try{return JSON.parse(t)}catch{let r=e==="-"?" (from stdin)":e.startsWith("@")?` (${e.slice(1)})`:"";throw new Error(`Request body is not valid JSON${r}`)}}async function F0(){process.stdin.isTTY&&process.stderr.write(`${yh.default.dim("Reading request body from stdin \u2014 paste JSON and press Ctrl-D...")}
173
- `);let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString("utf-8")}p();var To=L(Vr(),1),ke=L(J(),1);function Hr(e,t="json"){if(e!=null){if(t==="table"){let r=N0(e);if(r){(0,To.printTable)(r.map(fh));return}let i=fh(e);(0,To.printTable)(Object.entries(i).map(([n,s])=>({field:n,value:s})));return}process.stdout.isTTY?process.stdout.write(`${U0(JSON.stringify(e,null,2))}
171
+ `),process.exit(1)}async function uo(e){await Z("node",["--input-type=module","-e","const { resolveConfig } = await import('vite'); await resolveConfig({}, 'serve')"],{cwd:e,reject:!1})}function Tx(e){let t=ce.join(e,"gitignore.template");me.existsSync(t)&&me.renameSync(t,ce.join(e,".gitignore"))}async function Cx(e,t){if(me.existsSync(e)&&me.statSync(e).isDirectory()){me.cpSync(e,t,{recursive:!0,filter:r=>{let i=ce.basename(r);return i!=="node_modules"&&i!=="dist"&&i!==".git"}});return}await Z("git",["clone","--depth","1","--",e,t]),me.rmSync(ce.join(t,".git"),{recursive:!0,force:!0})}var Vm=/^VITE_SPREE_API_URL=(https?:\/\/localhost\S*)$/m;function Wm(e,t,r){let i=ce.join(e,"apps",t);if(!me.existsSync(ce.join(i,"package.json")))return"untouched";let n=ce.join(i,".env.local"),s;try{s=me.readFileSync(n,"utf-8")}catch(a){if(!tr(a))throw a;return Km(n,r),"written"}return Vm.test(s)?(me.writeFileSync(n,s.replace(Vm,`VITE_API_PROXY_TARGET=http://localhost:${r}`)),"repaired"):"untouched"}var lo=Object.values(co).map(e=>e.dir);function Dn(e,t){let r="untouched";for(let i of lo){let n=Wm(e,i,t);n!=="untouched"&&(r=n)}return r}function Km(e,t){me.writeFileSync(e,["# Dev-server proxy target \u2014 where Vite forwards /api and /rails (your","# Rails backend). The SPA stays same-origin with the API: the SDK uses","# relative URLs and the proxy bridges the port gap.","#","# Do NOT set VITE_SPREE_API_URL for local dev \u2014 it switches the SDK to","# absolute cross-origin URLs, which breaks on CORS and the SameSite=Lax","# auth cookie. Set it only when building for a deploy where the","# dashboard is hosted on a different origin than the API.","#","# No credentials belong in this file \u2014 every VITE_-prefixed value is","# compiled into the client bundle.",`VITE_API_PROXY_TARGET=http://localhost:${t}`,""].join(`
172
+ `))}function _t(e,t){for(let r of[t,e]){if(me.existsSync(ce.join(r,"pnpm-lock.yaml")))return"pnpm";if(me.existsSync(ce.join(r,"yarn.lock")))return"yarn";if(me.existsSync(ce.join(r,"package-lock.json")))return"npm"}return"pnpm"}p();p();function x(e){if(!e)return;let t={};return e.expand?.length&&(t.expand=e.expand.join(",")),e.fields?.length&&(t.fields=e.fields.join(",")),Object.keys(t).length>0?t:void 0}function Rx(e){return e===!1?!1:{maxRetries:e?.maxRetries??2,retryOnStatus:e?.retryOnStatus??[429,500,502,503,504],baseDelay:e?.baseDelay??300,maxDelay:e?.maxDelay??1e4,retryOnNetworkError:e?.retryOnNetworkError??!0}}var Ix=new Set(["page","limit","expand","sort","fields"]);function _(e){let t={};for(let[r,i]of Object.entries(e))if(i!==void 0){if(Ix.has(r)){t[r]=Array.isArray(i)?i.join(","):i;continue}if(r.startsWith("q[")){t[r]=i;continue}if(Array.isArray(i)){let n=r.endsWith("[]")?r.slice(0,-2):r;t[`q[${n}][]`]=i}else t[`q[${r}]`]=i}return t}var qt=class extends Error{code;status;details;constructor(e,t){super(e.error.message),this.name="SpreeError",this.code=e.error.code,this.status=t,this.details=e.error.details}};function Ym(e,t){let r=t.baseDelay*2**e,i=Math.random()*t.baseDelay;return Math.min(r+i,t.maxDelay)}function Jm(e){return new Promise(t=>setTimeout(t,e))}function Ox(){return`spree-sdk-retry-${crypto.randomUUID()}`}function Dx(e,t,r,i){return e==="GET"||e==="HEAD"||i?r.retryOnStatus.includes(t):t===429}function Lx(e,t,r){return t.retryOnNetworkError?e==="GET"||e==="HEAD"||r:!1}function Bx(e,t,r,i){return async function(s,a,o={}){let{token:c,spreeToken:d,idempotencyKey:u,headers:l={},body:h,params:y}=o,g=o.locale??i?.locale,b=o.currency??i?.currency,$=o.country??i?.country,S=o.channel??i?.channel,A=typeof window<"u"?window.location.origin:void 0,q=e.baseUrl||A;if(!q)throw new TypeError("sdk-core: baseUrl is required in non-browser environments (no window.location to resolve relative URLs against)");let O=new URL(`${e.baseUrl}${t}${a}`,q);y&&Object.entries(y).forEach(([Y,j])=>{if(j!==void 0)if(Array.isArray(j))for(let Xe of j)O.searchParams.append(Y,String(Xe));else O.searchParams.set(Y,String(j))});let E={"Content-Type":"application/json",...l};r.headerValue&&(E[r.headerName]=r.headerValue),c&&(E.Authorization=`Bearer ${c}`),d&&(E["x-spree-token"]=d),g&&(E["x-spree-locale"]=g),b&&(E["x-spree-currency"]=b),$&&(E["x-spree-country"]=$),S&&(E["x-spree-channel"]=S);let R=u??(s!=="GET"&&s!=="HEAD"&&e.retryConfig?Ox():void 0);R&&(E["Idempotency-Key"]=R);let B=!!R,z=e.retryConfig?e.retryConfig.maxRetries+1:1;for(let Y=0;Y<z;Y++)try{let j=await e.fetchFn(O.toString(),{method:s,headers:E,body:h?JSON.stringify(h):void 0,credentials:e.credentials});if(!j.ok){if(!(Y>=z-1)&&e.retryConfig&&Dx(s,j.status,e.retryConfig,B)){let K=j.headers.get("Retry-After"),he=K?Math.min(parseInt(K,10)*1e3,e.retryConfig.maxDelay):Ym(Y,e.retryConfig);await Jm(he);continue}let Pe=await j.json().catch(()=>null);throw typeof Pe?.error?.code=="string"&&typeof Pe.error.message=="string"?new qt(Pe,j.status):new qt({error:{code:"http_error",message:`Request failed with status ${j.status}`}},j.status)}return j.status===204?void 0:j.status===202?j.headers.get("content-type")?.includes("application/json")?j.json():void 0:j.json()}catch(j){if(j instanceof qt)throw j;if(!(Y>=z-1)&&e.retryConfig&&Lx(s,e.retryConfig,B)){let Pe=Ym(Y,e.retryConfig);await Jm(Pe);continue}throw j}throw new Error("Unexpected end of retry loop")}}var bt={product:"/products",variant:"/variants",order:"/orders",customer:"/customers",category:"/categories",collection:"/collections",option_type:"/option_types"},zx=class{request;constructor(e){this.request=e}parentScopedCustomFields(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields`,{...i,params:r?_(r):void 0}),get:(t,r,i)=>this.request("GET",`${e}/${t}/custom_fields/${r}`,i),create:(t,r,i)=>this.request("POST",`${e}/${t}/custom_fields`,{...i,body:r}),update:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/custom_fields/${r}`,{...n,body:i}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/custom_fields/${r}`,i)}}parentScopedTranslations(e){return{get:(t,r)=>this.request("GET",`${e}/${t}/translations`,r).then(i=>i.data)}}productMembership(e){return{list:(t,r,i)=>this.request("GET",`${e}/${t}/products`,{...i,params:r?_(r):void 0}),create:(t,r,i)=>this.request("POST",`${e}/${t}/products`,{...i,body:{product_ids:r}}),delete:(t,r,i)=>this.request("DELETE",`${e}/${t}/products`,{...i,body:{product_ids:r}})}}positionedProductMembership(e){return{...this.productMembership(e),reposition:(t,r,i,n)=>this.request("PATCH",`${e}/${t}/products/${r}/reposition`,{...n,body:i})}}customFields(e,t){let r=bt[e];if(!r)throw new Error(`Unknown custom-field owner type: ${e}. Add it to CUSTOM_FIELD_OWNER_PATHS.`);let i=this.parentScopedCustomFields(r);return{list:(n,s)=>i.list(t,n,s),get:(n,s)=>i.get(t,n,s),create:(n,s)=>i.create(t,n,s),update:(n,s,a)=>i.update(t,n,s,a),delete:(n,s)=>i.delete(t,n,s)}}customFieldDefinitions={list:(e,t)=>this.request("GET","/custom_field_definitions",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/custom_field_definitions/${e}`,t),resourceTypes:e=>this.request("GET","/custom_field_definitions/resource_types",e),create:(e,t)=>this.request("POST","/custom_field_definitions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/custom_field_definitions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/custom_field_definitions/${e}`,t)};auth={login:(e,t)=>this.request("POST","/auth/login",{...t,body:e}),refresh:e=>this.request("POST","/auth/refresh",e),logout:e=>this.request("POST","/auth/logout",e),providers:e=>this.request("GET","/auth/providers",e),lookupInvitation:(e,t,r)=>this.request("GET",`/auth/invitations/${e}/lookup`,{...r,params:{token:t}}),acceptInvitation:(e,t,r,i)=>this.request("POST",`/auth/invitations/${e}/accept`,{...i,params:{token:t},body:r}),setupStatus:e=>this.request("GET","/auth/setup",e),setupCountries:e=>this.request("GET","/auth/setup/countries",e),completeSetup:(e,t)=>this.request("POST","/auth/setup",{...t,body:e}),requestPasswordReset:(e,t)=>this.request("POST","/auth/password_resets",{...t,body:e}),resetPassword:(e,t,r)=>this.request("PATCH",`/auth/password_resets/${encodeURIComponent(e)}`,{...r,body:t})};me={get:e=>this.request("GET","/me",e),update:(e,t)=>this.request("PATCH","/me",{...t,body:e})};reporting={query:(e,t)=>this.request("POST","/reporting/query",{...t,body:e}),schema:e=>this.request("GET","/reporting/schema",e),savedReports:{list:(e,t)=>this.request("GET","/reporting/saved_reports",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/reporting/saved_reports/${e}`,t),create:(e,t)=>this.request("POST","/reporting/saved_reports",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/reporting/saved_reports/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/reporting/saved_reports/${e}`,t)}};dashboard={counters:(e,t)=>this.request("GET","/dashboard/counters",{...t,params:e})};store={get:e=>this.request("GET","/store",e),update:(e,t)=>this.request("PATCH","/store",{...t,body:e}),dataSources:e=>this.request("GET","/store/data_sources",e).then(t=>t.data)};locales={list:e=>this.request("GET","/locales",e).then(t=>t.data)};translatableResources={list:e=>this.request("GET","/translatable_resources",e).then(t=>t.data)};translations={coverage:(e,t,r)=>{let{page:i,limit:n,search:s,...a}=t??{};return this.request("GET","/translations",{...r,params:{resource_type:e,...i===void 0?{}:{page:i},...n===void 0?{}:{limit:n},...s===void 0?{}:{search:s},..._(a)}})},batch:(e,t)=>this.request("POST","/translations/batch",{...t,body:{translations:e}}).then(r=>r.data)};products={list:(e,t)=>this.request("GET","/products",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/products/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/products",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/products/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/products/${e}`,t),clone:(e,t)=>this.request("POST",`/products/${e}/clone`,t),approve:(e,t)=>this.request("PATCH",`/products/${e}/approve`,t),reject:(e,t,r)=>this.request("PATCH",`/products/${e}/reject`,{...r,body:t}),bulkStatusUpdate:(e,t)=>this.request("POST","/products/bulk_status_update",{...t,body:e}),bulkAddToCategories:(e,t)=>this.request("POST","/products/bulk_add_to_categories",{...t,body:e}),bulkRemoveFromCategories:(e,t)=>this.request("POST","/products/bulk_remove_from_categories",{...t,body:e}),bulkAddToCollections:(e,t)=>this.request("POST","/products/bulk_add_to_collections",{...t,body:e}),bulkRemoveFromCollections:(e,t)=>this.request("POST","/products/bulk_remove_from_collections",{...t,body:e}),bulkAddToChannels:(e,t)=>this.request("POST","/products/bulk_add_to_channels",{...t,body:e}),bulkRemoveFromChannels:(e,t)=>this.request("POST","/products/bulk_remove_from_channels",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/products/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/products/bulk_remove_tags",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/products/bulk_destroy",{...t,body:e}),media:{list:(e,t,r)=>this.request("GET",`/products/${e}/media`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/media`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/media/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/media/${t}`,r)},digitalAssets:{list:(e,t,r)=>this.request("GET",`/products/${e}/digital_assets`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/products/${e}/digital_assets`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/digital_assets/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/digital_assets/${t}`,r),providers:(e,t)=>this.request("GET",`/products/${e}/digital_assets/providers`,t)},variants:{list:(e,t,r)=>this.request("GET",`/products/${e}/variants`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/products/${e}/variants`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/products/${e}/variants/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/products/${e}/variants/${t}`,r),media:{list:(e,t,r,i)=>this.request("GET",`/products/${e}/variants/${t}/media`,{...i,params:r?_(r):void 0}),create:(e,t,r,i)=>this.request("POST",`/products/${e}/variants/${t}/media`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/products/${e}/variants/${t}/media/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/products/${e}/variants/${t}/media/${r}`,i)}},customFields:this.parentScopedCustomFields(bt.product),translations:this.parentScopedTranslations("/products")};digitalLinks={list:(e,t)=>this.request("GET","/digital_links",{...t,params:e?_(e):void 0}),retrieve:(e,t)=>this.request("GET",`/digital_links/${e}`,t),reset:(e,t)=>this.request("PATCH",`/digital_links/${e}/reset`,t)};orders={list:(e,t)=>this.request("GET","/orders",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/orders/${e}`,t),complete:(e,t,r)=>this.request("PATCH",`/orders/${e}/complete`,{...r,body:t}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/cancel`,{...r,body:t}),approve:(e,t)=>this.request("PATCH",`/orders/${e}/approve`,t),resendConfirmation:(e,t)=>this.request("POST",`/orders/${e}/resend_confirmation`,t),resendDigitalLinks:(e,t)=>this.request("POST",`/orders/${e}/resend_digital_links`,t),giftCards:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/gift_cards`,{...r,body:t}),remove:(e,t,r)=>this.request("DELETE",`/orders/${e}/gift_cards/${t}`,r)},storeCredits:{apply:(e,t,r)=>this.request("POST",`/orders/${e}/store_credits`,{...r,body:t}),remove:(e,t)=>this.request("DELETE",`/orders/${e}/store_credits`,t)},items:{list:(e,t,r)=>this.request("GET",`/orders/${e}/items`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/items/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/items`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/items/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/items/${t}`,r)},fulfillments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/fulfillments`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/fulfill`,{...i,body:r}),markDelivered:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/mark_delivered`,{...i,body:r}),cancel:(e,t,r)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/cancel`,r),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/labels/${r}`,i)},deliveries:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/fulfillments/${t}/deliveries`,{...i,body:r}),update:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,{...n,body:i}),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/fulfillments/${t}/deliveries/${r}`,i),markDelivered:(e,t,r,i,n)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/deliveries/${r}/mark_delivered`,{...n,body:i})},split:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fulfillments/${t}/split`,{...i,body:r})},returns:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/returns`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/returns/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/receive`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/refund`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/cancel`,{...i,body:r}),labels:{list:(e,t,r)=>this.request("GET",`/orders/${e}/returns/${t}/labels`,r),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/returns/${t}/labels/${r}`,i),create:(e,t,r,i)=>this.request("POST",`/orders/${e}/returns/${t}/labels`,{...i,body:r}),refund:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/returns/${t}/labels/${r}/refund`,i),delete:(e,t,r,i)=>this.request("DELETE",`/orders/${e}/returns/${t}/labels/${r}`,i)}},exchanges:{list:(e,t,r)=>this.request("GET",`/orders/${e}/exchanges`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/exchanges/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/exchanges`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/approve`,r),receive:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/receive`,{...i,body:r}),fulfill:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/fulfill`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/exchanges/${t}/cancel`,{...i,body:r})},claims:{list:(e,t,r)=>this.request("GET",`/orders/${e}/claims`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/claims/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/claims`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}`,{...i,body:r}),approve:(e,t,r)=>this.request("PATCH",`/orders/${e}/claims/${t}/approve`,r),resolve:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/resolve`,{...i,body:r}),deny:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/deny`,{...i,body:r}),cancel:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/claims/${t}/cancel`,{...i,body:r})},payments:{list:(e,t,r)=>this.request("GET",`/orders/${e}/payments`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/orders/${e}/payments/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/orders/${e}/payments`,{...r,body:t}),capture:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/capture`,r),void:(e,t,r)=>this.request("PATCH",`/orders/${e}/payments/${t}/void`,r)},refunds:{list:(e,t,r)=>this.request("GET",`/orders/${e}/refunds`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/orders/${e}/refunds`,{...r,body:t})},taxLines:{list:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/tax_lines/${t}`,r)},discounts:{list:(e,t,r)=>this.request("GET",`/orders/${e}/discounts`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/discounts/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/discounts`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/discounts/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discounts/${t}`,r)},discountCodes:{create:(e,t,r)=>this.request("POST",`/orders/${e}/discount_codes`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/discount_codes/${encodeURIComponent(t)}`,r)},fees:{list:(e,t,r)=>this.request("GET",`/orders/${e}/fees`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/orders/${e}/fees/${t}`,r),create:(e,t,r)=>this.request("POST",`/orders/${e}/fees`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/orders/${e}/fees/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/orders/${e}/fees/${t}`,r)},customFields:this.parentScopedCustomFields(bt.order)};optionTypes={list:(e,t)=>this.request("GET","/option_types",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/option_types/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/option_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/option_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/option_types/${e}`,t),customFields:this.parentScopedCustomFields(bt.option_type),translations:this.parentScopedTranslations("/option_types")};deliveryMethods={list:(e,t)=>this.request("GET","/delivery_methods",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_methods/${e}`,t),create:(e,t)=>this.request("POST","/delivery_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_methods/${e}`,t),calculators:e=>this.request("GET","/delivery_methods/calculators",e),fulfillmentProviders:e=>this.request("GET","/delivery_methods/fulfillment_providers",e),rateProviders:e=>this.request("GET","/delivery_methods/rate_providers",e),rules:{list:(e,t)=>this.request("GET",`/delivery_methods/${e}/rules`,t),create:(e,t,r)=>this.request("POST",`/delivery_methods/${e}/rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_methods/${e}/rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_methods/${e}/rules/${t}`,r)},ruleTypes:e=>this.request("GET","/delivery_method_rules/types",e)};deliveryProfiles={list:(e,t)=>this.request("GET","/delivery_profiles",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/delivery_profiles/${e}`,t),create:(e,t)=>this.request("POST","/delivery_profiles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_profiles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_profiles/${e}`,t),kinds:e=>this.request("GET","/delivery_profiles/kinds",e),originGroups:{list:(e,t)=>this.request("GET",`/delivery_profiles/${e}/origin_groups`,t),create:(e,t,r)=>this.request("POST",`/delivery_profiles/${e}/origin_groups`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/delivery_profiles/${e}/origin_groups/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/delivery_profiles/${e}/origin_groups/${t}`,r)}};trackingCarriers={list:e=>this.request("GET","/tracking_carriers",e)};deliveryZones={list:(e,t)=>this.request("GET","/delivery_zones",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/delivery_zones/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/delivery_zones",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/delivery_zones/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/delivery_zones/${e}`,t)};packageTypes={list:(e,t)=>this.request("GET","/package_types",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/package_types/${e}`,t),create:(e,t)=>this.request("POST","/package_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/package_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/package_types/${e}`,t)};paymentMethods={list:(e,t)=>this.request("GET","/payment_methods",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/payment_methods/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/payment_methods",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/payment_methods/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/payment_methods/${e}`,t),types:e=>this.request("GET","/payment_methods/types",e)};integrations={list:(e,t)=>this.request("GET","/integrations",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/integrations/${e}`,t),create:(e,t)=>this.request("POST","/integrations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/integrations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/integrations/${e}`,t),types:e=>this.request("GET","/integrations/types",e),test:(e,t)=>this.request("POST",`/integrations/${e}/test`,t)};priceLists={list:(e,t)=>this.request("GET","/price_lists",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/price_lists/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/price_lists",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/price_lists/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/price_lists/${e}`,t),products:this.productMembership("/price_lists"),activate:(e,t)=>this.request("PATCH",`/price_lists/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/price_lists/${e}/deactivate`,t),ruleTypes:e=>this.request("GET","/price_lists/price_rule_types",e)};prices={list:(e,t)=>this.request("GET","/prices",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/prices/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/prices",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/prices/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/prices/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/prices/bulk_upsert",{...t,body:e}),bulkDestroy:(e,t)=>this.request("DELETE","/prices/bulk_destroy",{...t,body:e})};promotions={list:(e,t)=>this.request("GET","/promotions",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/promotions",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/promotions/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/promotions/${e}`,t),actions:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_actions/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_actions`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_actions/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_actions/${t}`,r)},rules:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/promotion_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/promotions/${e}/promotion_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/promotions/${e}/promotion_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/promotions/${e}/promotion_rules/${t}`,r)},couponCodes:{list:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/promotions/${e}/coupon_codes/${t}`,r)}};promotionActions={types:e=>this.request("GET","/promotion_actions/types",e),calculators:(e,t)=>this.request("GET","/promotion_actions/calculators",{...t,params:{type:e}})};promotionRules={types:e=>this.request("GET","/promotion_rules/types",e)};tags={list:(e,t)=>this.request("GET","/tags",{...t,params:e})};customerGroups={list:(e,t)=>this.request("GET","/customer_groups",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/customer_groups/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/customer_groups",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customer_groups/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customer_groups/${e}`,t)};sellers={list:(e,t)=>this.request("GET","/sellers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/sellers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/sellers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/sellers/${e}`,t),invite:(e,t,r)=>this.request("POST",`/sellers/${e}/invite`,{...r,body:t}),approve:(e,t,r)=>this.request("PATCH",`/sellers/${e}/approve`,{...r,body:t}),onboarding:(e,t)=>this.request("GET",`/sellers/${e}/onboarding`,t),reopenOnboarding:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reopen_onboarding`,{...r,body:t}),team:{list:(e,t)=>this.request("GET",`/sellers/${e}/team`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/team/${t}`,r)},invitations:{list:(e,t)=>this.request("GET",`/sellers/${e}/invitations`,t),remove:(e,t,r)=>this.request("DELETE",`/sellers/${e}/invitations/${t}`,r),resend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/invitations/${t}/resend`,r),acceptanceLink:(e,t,r)=>this.request("GET",`/sellers/${e}/invitations/${t}/acceptance_link`,r)},requirementSubmissions:{list:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/sellers/${e}/requirement_submissions/${t}`,r),accept:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/accept`,{...i,body:r}),reject:(e,t,r,i)=>this.request("PATCH",`/sellers/${e}/requirement_submissions/${t}/reject`,{...i,body:r}),waive:(e,t,r)=>this.request("POST",`/sellers/${e}/requirement_submissions`,{...r,body:t})},suspend:(e,t,r)=>this.request("PATCH",`/sellers/${e}/suspend`,{...r,body:t}),reject:(e,t,r)=>this.request("PATCH",`/sellers/${e}/reject`,{...r,body:t}),balances:(e,t)=>this.request("GET",`/sellers/${e}/balances`,t),settle:(e,t)=>this.request("POST",`/sellers/${e}/payouts`,t)};sellerRequirements={list:(e,t)=>this.request("GET","/seller_requirements",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/seller_requirements/${e}`,t),create:(e,t)=>this.request("POST","/seller_requirements",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/seller_requirements/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/seller_requirements/${e}`,t),types:e=>this.request("GET","/seller_requirements/types",e)};commissionRates={list:(e,t)=>this.request("GET","/commission_rates",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_rates/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/commission_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/commission_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/commission_rates/${e}`,t),ruleTypes:e=>this.request("GET","/commission_rates/rule_types",e)};commissionLines={list:(e,t)=>this.request("GET","/commission_lines",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/commission_lines/${e}`,{...r,params:x(t)})};orderGroups={list:(e,t)=>this.request("GET","/order_groups",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/order_groups/${e}`,{...r,params:x(t)})};sellerTransfers={list:(e,t)=>this.request("GET","/seller_transfers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_transfers/${e}`,{...r,params:x(t)})};sellerPayouts={list:(e,t)=>this.request("GET","/seller_payouts",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/seller_payouts/${e}`,{...r,params:x(t)}),complete:(e,t,r)=>this.request("PATCH",`/seller_payouts/${e}/complete`,{...r,body:t})};giftCards={list:(e,t)=>this.request("GET","/gift_cards",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/gift_cards/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/gift_cards",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/gift_cards/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/gift_cards/${e}`,t)};storeCredits={list:(e,t)=>this.request("GET","/store_credits",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/store_credits/${e}`,{...r,params:x(t)}),events:{list:(e,t,r)=>this.request("GET",`/store_credits/${e}/events`,{...r,params:t?_(t):void 0})}};returns={list:(e,t)=>this.request("GET","/returns",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/returns/${e}`,{...r,params:x(t)})};exchanges={list:(e,t)=>this.request("GET","/exchanges",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/exchanges/${e}`,{...r,params:x(t)})};claims={list:(e,t)=>this.request("GET","/claims",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/claims/${e}`,{...r,params:x(t)})};giftCardBatches={list:(e,t)=>this.request("GET","/gift_card_batches",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/gift_card_batches/${e}`,t),create:(e,t)=>this.request("POST","/gift_card_batches",{...t,body:e})};taxRates={list:(e,t)=>this.request("GET","/tax_rates",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_rates/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/tax_rates",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_rates/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_rates/${e}`,t)};taxProviders={list:e=>this.request("GET","/tax_providers",e)};payoutProviders={list:e=>this.request("GET","/payout_providers",e)};companies={list:(e,t)=>this.request("GET","/companies",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/companies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/companies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/companies/${e}`,t),addresses:{list:(e,t,r)=>this.request("GET",`/companies/${e}/addresses`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/addresses`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/addresses/${t}`,r),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/addresses/${t}`,r)},memberships:{list:(e,t,r)=>this.request("GET",`/companies/${e}/memberships`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/companies/${e}/memberships`,{...r,body:t}),get:(e,t,r)=>this.request("GET",`/companies/${e}/memberships/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/memberships/${t}`,r)},invitations:{list:(e,t,r)=>this.request("GET",`/companies/${e}/invitations`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/invitations/${t}`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/invitations/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/companies/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/companies/${e}/tax_identifiers/${t}/validate`,r)},taxExemptionCertificates:{list:(e,t,r)=>this.request("GET",`/companies/${e}/tax_exemption_certificates`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/companies/${e}/tax_exemption_certificates`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}`,{...i,body:r}),verify:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/verify`,r),revoke:(e,t,r)=>this.request("PATCH",`/companies/${e}/tax_exemption_certificates/${t}/revoke`,r),delete:(e,t,r)=>this.request("DELETE",`/companies/${e}/tax_exemption_certificates/${t}`,r)}};catalogs={list:(e,t)=>this.request("GET","/catalogs",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/catalogs/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/catalogs",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/catalogs/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/catalogs/${e}`,t),products:this.productMembership("/catalogs"),activate:(e,t)=>this.request("PATCH",`/catalogs/${e}/activate`,t),deactivate:(e,t)=>this.request("PATCH",`/catalogs/${e}/deactivate`,t),importProducts:(e,t)=>this.request("POST",`/catalogs/${e}/import_products`,t),assign:(e,t,r)=>this.request("POST",`/catalogs/${e}/assign`,{...r,body:t}),quantityRules:{upsert:(e,t,r)=>this.request("PUT",`/catalogs/${e}/quantity_rules`,{...r,body:t})},orderMinimums:{list:(e,t,r)=>this.request("GET",`/catalogs/${e}/order_minimums`,{...r,params:t?_(t):void 0}),create:(e,t,r)=>this.request("POST",`/catalogs/${e}/order_minimums`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/catalogs/${e}/order_minimums/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/catalogs/${e}/order_minimums/${t}`,r)}};catalogAssignments={delete:(e,t)=>this.request("DELETE",`/catalog_assignments/${e}`,t)};exports={list:(e,t)=>this.request("GET","/exports",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/exports/${e}`,t),create:(e,t)=>this.request("POST","/exports",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/exports/${e}`,t)};imports={list:(e,t)=>this.request("GET","/imports",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/imports/${e}`,t),create:(e,t)=>this.request("POST","/imports",{...t,body:e}),completeMapping:(e,t,r)=>this.request("PATCH",`/imports/${e}/complete_mapping`,{...r,body:t??{}}),retryFailedRows:(e,t)=>this.request("PATCH",`/imports/${e}/retry_failed_rows`,t),delete:(e,t)=>this.request("DELETE",`/imports/${e}`,t),rows:{list:(e,t,r)=>this.request("GET",`/imports/${e}/rows`,{...r,params:t?_(t):void 0})}};customers={list:(e,t)=>this.request("GET","/customers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}`,{...r,params:x(t)}),creditCards:{list:(e,t,r)=>this.request("GET",`/customers/${e}/credit_cards`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/credit_cards/${t}`,{...i,params:x(r)}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/credit_cards/${t}`,r)},create:(e,t)=>this.request("POST","/customers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/customers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/customers/${e}`,t),export:(e,t)=>this.request("GET",`/customers/${e}/export`,t),anonymize:(e,t)=>this.request("POST",`/customers/${e}/anonymize`,t),bulkAddToGroups:(e,t)=>this.request("POST","/customers/bulk_add_to_groups",{...t,body:e}),bulkRemoveFromGroups:(e,t)=>this.request("POST","/customers/bulk_remove_from_groups",{...t,body:e}),bulkAddTags:(e,t)=>this.request("POST","/customers/bulk_add_tags",{...t,body:e}),bulkRemoveTags:(e,t)=>this.request("POST","/customers/bulk_remove_tags",{...t,body:e}),addresses:{list:(e,t,r)=>this.request("GET",`/customers/${e}/addresses`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/addresses/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/addresses`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/addresses/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/addresses/${t}`,r)},taxIdentifiers:{list:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/customers/${e}/tax_identifiers/${t}`,r),create:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/tax_identifiers/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/tax_identifiers/${t}`,r),validate:(e,t,r)=>this.request("POST",`/customers/${e}/tax_identifiers/${t}/validate`,r)},storeCredits:{list:(e,t,r)=>this.request("GET",`/customers/${e}/store_credits`,{...r,params:t?_(t):void 0}),get:(e,t,r,i)=>this.request("GET",`/customers/${e}/store_credits/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/customers/${e}/store_credits`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/customers/${e}/store_credits/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/customers/${e}/store_credits/${t}`,r)},customFields:this.parentScopedCustomFields(bt.customer)};media={list:(e,t)=>this.request("GET","/media",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/media/${e}`,t),create:(e,t)=>this.request("POST","/media",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/media/${e}`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/media/${e}`,{...r,params:t?.detach?{detach:"true"}:void 0}),usage:(e,t)=>this.request("GET",`/media/${e}/usage`,t)};categories={list:(e,t)=>this.request("GET","/categories",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/categories/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/categories/${e}`,t),reposition:(e,t,r)=>this.request("PATCH",`/categories/${e}/reposition`,{...r,body:t}),products:this.positionedProductMembership("/categories"),customFields:this.parentScopedCustomFields(bt.category),translations:this.parentScopedTranslations("/categories")};collections={list:(e,t)=>this.request("GET","/collections",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/collections/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/collections",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/collections/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/collections/${e}`,t),products:this.positionedProductMembership("/collections"),customFields:this.parentScopedCustomFields(bt.collection),translations:this.parentScopedTranslations("/collections")};collectionRules={types:e=>this.request("GET","/collection_rules/types",e)};variants={list:(e,t)=>this.request("GET","/variants",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/variants/${e}`,{...r,params:x(t)}),customFields:this.parentScopedCustomFields(bt.variant)};productTypes={list:(e,t)=>this.request("GET","/product_types",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/product_types/${e}`,t),create:(e,t)=>this.request("POST","/product_types",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/product_types/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/product_types/${e}`,t),applyToProducts:(e,t)=>this.request("POST",`/product_types/${e}/apply_to_products`,t)};taxCategories={list:(e,t)=>this.request("GET","/tax_categories",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/tax_categories/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/tax_categories",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/tax_categories/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/tax_categories/${e}`,t)};policies={list:(e,t)=>this.request("GET","/policies",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/policies/${e}`,t),create:(e,t)=>this.request("POST","/policies",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/policies/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/policies/${e}`,t)};returnReasons={list:(e,t)=>this.request("GET","/return_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/return_reasons/${e}`,t),create:(e,t)=>this.request("POST","/return_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/return_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/return_reasons/${e}`,t)};claimReasons={list:(e,t)=>this.request("GET","/claim_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/claim_reasons/${e}`,t),create:(e,t)=>this.request("POST","/claim_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/claim_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/claim_reasons/${e}`,t)};orderCancellationReasons={list:(e,t)=>this.request("GET","/order_cancellation_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/order_cancellation_reasons/${e}`,t),create:(e,t)=>this.request("POST","/order_cancellation_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/order_cancellation_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/order_cancellation_reasons/${e}`,t)};refundReasons={list:(e,t)=>this.request("GET","/refund_reasons",{...t,params:e?_(e):void 0}),get:(e,t)=>this.request("GET",`/refund_reasons/${e}`,t),create:(e,t)=>this.request("POST","/refund_reasons",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/refund_reasons/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/refund_reasons/${e}`,t)};channels={list:(e,t)=>this.request("GET","/channels",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/channels",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/channels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/channels/${e}`,t),addProducts:(e,t,r)=>this.request("POST",`/channels/${e}/add_products`,{...r,body:t}),removeProducts:(e,t,r)=>this.request("POST",`/channels/${e}/remove_products`,{...r,body:t}),orderRoutingRules:{list:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/channels/${e}/order_routing_rules/${t}`,r),create:(e,t,r)=>this.request("POST",`/channels/${e}/order_routing_rules`,{...r,body:t}),update:(e,t,r,i)=>this.request("PATCH",`/channels/${e}/order_routing_rules/${t}`,{...i,body:r}),delete:(e,t,r)=>this.request("DELETE",`/channels/${e}/order_routing_rules/${t}`,r)}};orderRoutingRules={types:e=>this.request("GET","/order_routing_rules/types",e)};markets={list:(e,t)=>this.request("GET","/markets",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/markets/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/markets",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/markets/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/markets/${e}`,t)};stockLocations={list:(e,t)=>this.request("GET","/stock_locations",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_locations/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/stock_locations",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_locations/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_locations/${e}`,t)};stockLevels={list:(e,t)=>this.request("GET","/stock_levels",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_levels/${e}`,{...r,params:x(t)}),update:(e,t,r)=>this.request("PATCH",`/stock_levels/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_levels/${e}`,t),bulkUpsert:(e,t)=>this.request("POST","/stock_levels/bulk_upsert",{...t,body:e})};stockMovements={list:(e,t)=>this.request("GET","/stock_movements",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_movements/${e}`,{...r,params:x(t)})};stockTransfers={list:(e,t)=>this.request("GET","/stock_transfers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/stock_transfers/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/stock_transfers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/stock_transfers/${e}`,t),markReady:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_ready`,t),markInTransit:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/mark_in_transit`,{...r,body:t}),markDraft:(e,t)=>this.request("PATCH",`/stock_transfers/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/stock_transfers/${e}/stock_receipts`,{...r,params:x(t)}),get:(e,t,r,i)=>this.request("GET",`/stock_transfers/${e}/stock_receipts/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/stock_transfers/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/stock_transfers/${e}/cancel`,{...r,body:t})};suppliers={list:(e,t)=>this.request("GET","/suppliers",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/suppliers/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/suppliers",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/suppliers/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/suppliers/${e}`,t)};purchaseOrders={list:(e,t)=>this.request("GET","/purchase_orders",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/purchase_orders/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/purchase_orders",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/purchase_orders/${e}`,t),markOrdered:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_ordered`,t),markDraft:(e,t)=>this.request("PATCH",`/purchase_orders/${e}/mark_draft`,t),close:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/close`,{...r,body:t}),stockReceipts:{list:(e,t,r)=>this.request("GET",`/purchase_orders/${e}/stock_receipts`,{...r,params:x(t)}),get:(e,t,r,i)=>this.request("GET",`/purchase_orders/${e}/stock_receipts/${t}`,{...i,params:x(r)}),create:(e,t,r)=>this.request("POST",`/purchase_orders/${e}/stock_receipts`,{...r,body:t})},cancel:(e,t,r)=>this.request("PATCH",`/purchase_orders/${e}/cancel`,{...r,body:t})};countries={list:(e,t)=>this.request("GET","/countries",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/countries/${e}`,{...r,params:x(t)})};directUploads={create:(e,t)=>this.request("POST","/direct_uploads",{...t,body:e})};adminUsers={list:(e,t)=>this.request("GET","/admin_users",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/admin_users/${e}`,{...r,params:x(t)}),update:(e,t,r)=>this.request("PATCH",`/admin_users/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/admin_users/${e}`,t)};invitations={list:(e,t)=>this.request("GET","/invitations",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/invitations/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/invitations",{...t,body:e}),delete:(e,t)=>this.request("DELETE",`/invitations/${e}`,t),resend:(e,t)=>this.request("PATCH",`/invitations/${e}/resend`,t),acceptanceLink:(e,t)=>this.request("GET",`/invitations/${e}/acceptance_link`,t)};apiKeys={list:(e,t)=>this.request("GET","/api_keys",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/api_keys/${e}`,{...r,params:x(t)}),current:e=>this.request("GET","/api_keys/current",e??{}),create:(e,t)=>this.request("POST","/api_keys",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/api_keys/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/api_keys/${e}`,t),revoke:(e,t)=>this.request("PATCH",`/api_keys/${e}/revoke`,t)};allowedOrigins={list:(e,t)=>this.request("GET","/allowed_origins",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/allowed_origins/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/allowed_origins",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/allowed_origins/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/allowed_origins/${e}`,t)};emailTemplates={list:(e,t)=>this.request("GET","/email_templates",{...t,params:e}),get:(e,t,r)=>this.request("GET",`/email_templates/${e}`,{...r,params:{...x(t),...t?.language?{language:t.language}:{}}}),revert:(e,t,r)=>this.request("DELETE",`/email_templates/${e}`,{...r,params:t}),draft:{update:(e,t,r)=>this.request("PUT",`/email_templates/${e}/draft`,{...r,body:t}),delete:(e,t,r)=>this.request("DELETE",`/email_templates/${e}/draft`,{...r,params:t})},publish:(e,t,r)=>this.request("POST",`/email_templates/${e}/publication`,{...r,body:t??{}}),preview:(e,t,r)=>this.request("POST",`/email_templates/${e}/preview`,{...r,body:t??{}}),sendTest:(e,t,r)=>this.request("POST",`/email_templates/${e}/test_email`,{...r,body:t??{}}),sampleRecords:{list:(e,t,r)=>this.request("GET",`/email_templates/${e}/sample_records`,{...r,params:t})},revisions:{list:(e,t,r)=>this.request("GET",`/email_templates/${e}/revisions`,{...r,params:t?(({language:i,...n})=>({..._(n),...i?{language:i}:{}}))(t):void 0}),restore:(e,t,r,i)=>this.request("POST",`/email_templates/${e}/revisions/${t}/restoration`,{...i,body:r??{}})}};webhookEvents={list:e=>this.request("GET","/webhook_events",e)};webhookEndpoints={list:(e,t)=>this.request("GET","/webhook_endpoints",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/webhook_endpoints",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/webhook_endpoints/${e}`,t),sendTest:(e,t)=>this.request("POST",`/webhook_endpoints/${e}/send_test`,t),enable:(e,t)=>this.request("PATCH",`/webhook_endpoints/${e}/enable`,t),disable:(e,t,r)=>this.request("PATCH",`/webhook_endpoints/${e}/disable`,{...r,body:t}),deliveries:{list:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries`,{...r,params:t?_(t):void 0}),get:(e,t,r)=>this.request("GET",`/webhook_endpoints/${e}/deliveries/${t}`,r),redeliver:(e,t,r)=>this.request("POST",`/webhook_endpoints/${e}/deliveries/${t}/redeliver`,r)}};roles={list:(e,t)=>this.request("GET","/roles",{...t,params:e?_(e):void 0}),get:(e,t,r)=>this.request("GET",`/roles/${e}`,{...r,params:x(t)}),create:(e,t)=>this.request("POST","/roles",{...t,body:e}),update:(e,t,r)=>this.request("PATCH",`/roles/${e}`,{...r,body:t}),delete:(e,t)=>this.request("DELETE",`/roles/${e}`,t)};permissions={list:e=>this.request("GET","/permissions",e)}};function zr(e){let t=e.baseUrl.replace(/\/$/,""),r=e.fetch||fetch.bind(globalThis),i=Rx(e.retry),n={baseUrl:t,fetchFn:r,retryConfig:i,credentials:e.credentials??"include"},s=e.jwtToken,a=e.storeId,o=null,c="/api/v3/admin",d=async(h,y,g={})=>{let b={};a&&!y.startsWith("/auth/")&&(b["X-Spree-Store-Id"]=a);let $={...g,headers:{...b,...g.headers}},S=()=>{let A=e.secretKey?{headerName:"X-Spree-Api-Key",headerValue:e.secretKey}:{headerName:"Authorization",headerValue:s?`Bearer ${s}`:""};return Bx(n,c,A)(h,y,$)};try{return await S()}catch(A){if(A instanceof qt&&A.status===401&&o&&!y.includes("/auth/")&&await o())return S();throw A}},u=new zx(d),l=Object.create(u);return l.setStore=h=>{a=h},l.setToken=h=>{s=h},l.onUnauthorized=h=>{o=h},l}var Eh=L(Vr(),1),Le=L(J(),1);p();var yh=L(J(),1);import F0 from"fs";var Po=Symbol("no-body");async function gh(e){if(e===void 0)return Po;let t;if(e==="-")t=await G0();else if(e.startsWith("@")){let r=e.slice(1);try{t=F0.readFileSync(r,"utf-8")}catch(i){throw i?.code==="ENOENT"?new Error(`Request body file not found: ${r}`):new Error(`Could not read request body file ${r}: ${i.message}`)}}else t=e;try{return JSON.parse(t)}catch{let r=e==="-"?" (from stdin)":e.startsWith("@")?` (${e.slice(1)})`:"";throw new Error(`Request body is not valid JSON${r}`)}}async function G0(){process.stdin.isTTY&&process.stderr.write(`${yh.default.dim("Reading request body from stdin \u2014 paste JSON and press Ctrl-D...")}
173
+ `);let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString("utf-8")}p();var To=L(Vr(),1),ke=L(J(),1);function Hr(e,t="json"){if(e!=null){if(t==="table"){let r=V0(e);if(r){(0,To.printTable)(r.map(fh));return}let i=fh(e);(0,To.printTable)(Object.entries(i).map(([n,s])=>({field:n,value:s})));return}process.stdout.isTTY?process.stdout.write(`${N0(JSON.stringify(e,null,2))}
174
174
  `):process.stdout.write(`${JSON.stringify(e)}
175
- `)}}var G0=/("(?:\\.|[^"\\])*"(\s*:)?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function U0(e){return e.replace(G0,(t,r,i,n,s)=>r!==void 0?i?ke.default.cyan(r.slice(0,-i.length))+i:ke.default.green(r):n!==void 0?ke.default.yellow(n):s!==void 0?ke.default.yellow(s):t)}function N0(e){return Array.isArray(e)?e:e&&typeof e=="object"&&Array.isArray(e.data)?e.data:null}function fh(e){let t={};for(let[r,i]of Object.entries(e))i===null||["string","number","boolean"].includes(typeof i)?t[r]=i:Array.isArray(i)?t[r]=`[${i.length}]`:t[r]="{\u2026}";return t}function Rt(e,t={}){if(e instanceof qt){let i=e.details?`
175
+ `)}}var U0=/("(?:\\.|[^"\\])*"(\s*:)?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function N0(e){return e.replace(U0,(t,r,i,n,s)=>r!==void 0?i?ke.default.cyan(r.slice(0,-i.length))+i:ke.default.green(r):n!==void 0?ke.default.yellow(n):s!==void 0?ke.default.yellow(s):t)}function V0(e){return Array.isArray(e)?e:e&&typeof e=="object"&&Array.isArray(e.data)?e.data:null}function fh(e){let t={};for(let[r,i]of Object.entries(e))i===null||["string","number","boolean"].includes(typeof i)?t[r]=i:Array.isArray(i)?t[r]=`[${i.length}]`:t[r]="{\u2026}";return t}function Rt(e,t={}){if(e instanceof qt){let i=e.details?`
176
176
  ${JSON.stringify({details:e.details},null,2)}`:"";process.stderr.write(`${ke.default.red(`${e.code}:`)} ${e.message}${i}
177
177
  `);let n=e.details?.required_scope;typeof n=="string"&&process.stderr.write(`${ke.default.dim(`Hint: this key lacks \`${n}\`. Create one that has it and use it:`)}
178
178
  ${ke.default.dim(` spree api-key create --type secret --scopes ${n}`)}
@@ -916,8 +916,8 @@ shape a stock location uses.
916
916
  readable. Refused with a 422 while a purchase order still points at it.
917
917
 
918
918
 
919
- **Required scope:** \`write_purchasing\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"204":{description:"supplier deleted"}}}}},components:{schemas:{PaginationMeta:{type:"object",properties:{page:{type:"integer"},limit:{type:"integer"},count:{type:"integer",description:"Total number of records"},pages:{type:"integer",description:"Total number of pages"},from:{type:"integer",description:"Index of first record on this page"},to:{type:"integer",description:"Index of last record on this page"},in:{type:"integer",description:"Number of records on this page"},previous:{type:"integer",nullable:!0,description:"Previous page number"},next:{type:"integer",nullable:!0,description:"Next page number"}},required:["page","limit","count","pages","from","to","in"]},ErrorResponse:{type:"object",properties:{error:{type:"object",properties:{code:{type:"string"},message:{type:"string"},details:{type:"object",description:"Field-specific validation errors",nullable:!0}},required:["code","message"]}},required:["error"]},AuthResponse:{type:"object",properties:{token:{type:"string",description:"JWT access token"},user:{$ref:"#/components/schemas/AdminUser"}},required:["token","user"]},PermissionRule:{type:"object",description:"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.",properties:{allow:{type:"boolean",description:"true for `can`, false for `cannot`"},actions:{type:"array",items:{type:"string"},description:'Action names, e.g. ["read", "update"] or ["manage"]'},subjects:{type:"array",items:{type:"string"},description:'Subject short names, e.g. ["product"] or ["all"]'},has_conditions:{type:"boolean",description:"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},required:["allow","actions","subjects","has_conditions"]},ImportSchemaField:{type:"object",description:"A canonical column of an import type, including per-store custom field columns",properties:{name:{type:"string",description:"Canonical field name used in mappings"},label:{type:"string",description:"Human-readable label"},required:{type:"boolean",description:"Whether the field must be mapped before processing"}},required:["name","label","required"]},CheckoutRequirement:{type:"object",properties:{step:{type:"string",description:"Checkout step this requirement belongs to"},field:{type:"string",description:"Field that needs to be satisfied"},message:{type:"string",description:"Human-readable requirement message"}},required:["step","field","message"]},CartWarning:{type:"object",description:"A warning about a cart issue (e.g., item removed due to stock change)",properties:{code:{type:"string",description:"Machine-readable warning code"},message:{type:"string",description:"Human-readable warning message"},line_item_id:{type:"string",nullable:!0,description:"Prefixed line item ID (when applicable)"},variant_id:{type:"string",nullable:!0,description:"Prefixed variant ID (when applicable)"},item_index:{type:"integer",nullable:!0,description:"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},required:["code","message"]},FulfillmentManifestItem:{type:"object",description:"An item within a fulfillment \u2014 which line item and how many units are in this fulfillment",properties:{item_id:{type:"string",description:"Line item ID"},variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer",description:"Quantity in this fulfillment"}},required:["item_id","variant_id","quantity"]},AdminUserRoleAssignment:{type:"object",description:"A role assignment for the current store on a staff member",properties:{id:{type:"string",description:"Prefixed role ID"},name:{type:"string",description:"Role name"}},required:["id","name"]},AdminUserStore:{type:"object",description:"A store the staff member can access through a role assignment",properties:{id:{type:"string",description:"Prefixed store ID"},name:{type:"string",description:"Store name"},code:{type:"string",description:"Store code"}},required:["id","name","code"]},PreferenceField:{type:"object",description:"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.",properties:{key:{type:"string"},type:{type:"string",description:"string | text | password | integer | decimal | boolean | array | hash"},default:{description:"Default value (any JSON type), null when there is no default",nullable:!0}},required:["key","type"]},PromotionActionCalculator:{type:"object",description:"The action's nested calculator (when the action carries one \u2014 null for actions like `free_shipping`)",properties:{type:{type:"string",description:"Wire shorthand for the calculator subclass"},label:{type:"string"},preferences:{type:"object",additionalProperties:!0},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}}},required:["type","label","preferences","preference_schema"]},PromotionActionLineItem:{type:"object",description:"One row in a `create_line_items` action \u2014 the variant added to the order and how many",properties:{variant_id:{type:"string"},quantity:{type:"integer"}},required:["variant_id","quantity"]},MeResponse:{type:"object",description:"Current admin user profile and serialized permissions",properties:{user:{$ref:"#/components/schemas/AdminUser"},permissions:{type:"array",items:{$ref:"#/components/schemas/PermissionRule"}}},required:["user","permissions"]},Actor:{type:"object",properties:{id:{type:"string"},type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},label:{type:"string",nullable:!0}},required:["id","type","label"],"x-typelizer":!0},Address:{type:"object",properties:{id:{type:"string"},label:{type:"string",nullable:!0},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string"},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},city:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},country_name:{type:"string"},country_code:{type:"string"},state_text:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},quick_checkout:{type:"boolean"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"},state_abbr:{type:"string",nullable:!0},country_iso:{type:"string"},state_name:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},latitude:{type:"number",nullable:!0},longitude:{type:"number",nullable:!0},customer_id:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0}},required:["id","label","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","metadata","created_at","updated_at","latitude","longitude","customer_id","owner_id","owner_type"],"x-typelizer":!0},AdminUser:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},selected_locale:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0},roles:{type:"array",items:{$ref:"#/components/schemas/AdminUserRoleAssignment"}},stores:{type:"array",items:{$ref:"#/components/schemas/AdminUserStore"}}},required:["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":!0},AllowedOrigin:{type:"object",properties:{id:{type:"string"},origin:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","origin","created_at","updated_at"],"x-typelizer":!0},ApiKey:{type:"object",properties:{id:{type:"string"},name:{type:"string"},key_type:{type:"string",enum:["publishable","secret"]},token_prefix:{type:"string",nullable:!0},scopes:{type:"array",items:{type:"string"}},created_at:{type:"string"},updated_at:{type:"string"},revoked_at:{type:"string",nullable:!0},last_used_at:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},plaintext_token:{type:"string",nullable:!0},created_by_email:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by_label:{type:"string",nullable:!0}},required:["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email","created_by_type","created_by_label"],"x-typelizer":!0},AppliedPromotion:{type:"object",properties:{id:{type:"string"},promotion_id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":!0},Cart:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},preferred_stock_location_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_number_required:{type:"boolean"},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},token:{type:"string"},email:{type:"string",nullable:!0},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},warnings:{type:"array",items:{$ref:"#/components/schemas/CartWarning"}},coupon_code:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},adjustment_total:{type:"string",nullable:!0},display_adjustment_total:{type:"string",nullable:!0},discount_total:{type:"string",nullable:!0},display_discount_total:{type:"string",nullable:!0},tax_total:{type:"string",nullable:!0},display_tax_total:{type:"string",nullable:!0},included_tax_total:{type:"string",nullable:!0},display_included_tax_total:{type:"string",nullable:!0},additional_tax_total:{type:"string",nullable:!0},display_additional_tax_total:{type:"string",nullable:!0},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},gift_card_total:{type:"string",nullable:!0},display_gift_card_total:{type:"string",nullable:!0},amount_due:{type:"string",nullable:!0},display_amount_due:{type:"string",nullable:!0},delivery_total:{type:"string",nullable:!0},display_delivery_total:{type:"string",nullable:!0},fee_total:{type:"string",nullable:!0},display_fee_total:{type:"string",nullable:!0},store_credit_total:{type:"string",nullable:!0},display_store_credit_total:{type:"string",nullable:!0},covered_by_store_credit:{type:"boolean"},current_step:{type:"string"},completed_steps:{type:"array",items:{type:"string"}},requirements:{type:"array",items:{$ref:"#/components/schemas/CheckoutRequirement"}},order_minimum:{type:"number",nullable:!0},order_minimum_shortfall:{type:"number",nullable:!0},below_order_minimum:{type:"boolean",nullable:!0},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},shipping_eq_billing_address:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},completed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}}},required:["id","market_id","channel_id","preferred_stock_location_id","company_id","company_name","po_number_required","po_document_filename","po_document_byte_size","number","token","email","customer_note","po_number","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","order_minimum","order_minimum_shortfall","below_order_minimum","freight_summary","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":!0},CatalogAssignment:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},catalog_id:{type:"string"},assignable_type:{type:"string"},assignable_id:{type:"string"},assignable_name:{type:"string",nullable:!0}},required:["id","created_at","catalog_id","assignable_type","assignable_id","assignable_name"],"x-typelizer":!0},CatalogOrderMinimum:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"}},required:["id","currency","created_at","updated_at","amount","display_amount"],"x-typelizer":!0},CatalogPrice:{type:"object",properties:{id:{type:"string",nullable:!0},label:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},currency:{type:"string"},source:{type:"string",enum:["explicit","automatic","base"]},break_count:{type:"number"},amount:{type:"string"},display_amount:{type:"string"},tiers:{type:"array",items:{$ref:"#/components/schemas/CatalogPriceTier"}}},required:["id","label","sku","currency","source","break_count","amount","display_amount","tiers"],"x-typelizer":!0},CatalogPriceTier:{type:"object",properties:{min_quantity:{type:"number"},display_amount:{type:"string"},amount:{type:"string"}},required:["min_quantity","display_amount","amount"],"x-typelizer":!0},CatalogProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},quantity_rule:{allOf:[{$ref:"#/components/schemas/CatalogProductTerm"}],nullable:!0},catalog_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},CatalogProductTerm:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},product_name:{type:"string",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},mixed:{type:"boolean"}},required:["id","product_id","product_name","minimum_order_quantity","order_multiple","mixed"],"x-typelizer":!0},CatalogQuantityRule:{type:"object",properties:{id:{type:"string"},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant_id:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},product_name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","minimum_order_quantity","order_multiple","created_at","updated_at","variant_id","variant_sku","product_name","options_text"],"x-typelizer":!0},Catalog:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},active:{type:"boolean"},position:{type:"number",nullable:!0},metadata:{type:"object",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},products_count:{type:"number"},pricing_strategy:{type:"string"},order_minimums:{type:"array",items:{$ref:"#/components/schemas/CatalogOrderMinimum"}},price_list:{$ref:"#/components/schemas/PriceList"},assignments:{type:"array",items:{$ref:"#/components/schemas/CatalogAssignment"}}},required:["id","name","description","active","position","metadata","minimum_order_quantity","order_multiple","created_at","updated_at","products_count","pricing_strategy"],"x-typelizer":!0},Category:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},depth:{type:"number"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},children_count:{type:"number"},parent_id:{type:"string",nullable:!0},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},is_root:{type:"boolean"},is_child:{type:"boolean"},is_leaf:{type:"boolean"},parent:{$ref:"#/components/schemas/Category"},children:{type:"array",items:{$ref:"#/components/schemas/Category"}},ancestors:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},external_references:{type:"object"},translations:{type:"object"},metadata:{type:"object"},pretty_name:{type:"string"},lft:{type:"number"},rgt:{type:"number"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","external_references","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":!0},Channel:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string"},active:{type:"boolean"},default:{type:"boolean"},storefront_access:{type:"string"},guest_checkout:{type:"boolean"},preferred_storefront_access:{type:"string",nullable:!0},preferred_guest_checkout:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_order_routing_strategy:{type:"string",nullable:!0,description:"Order routing strategy; null inherits the store setting. Built-in: rules. Extensions may register more."},stock_location_ids:{type:"array",items:{type:"string"}},default_catalog_id:{type:"string",nullable:!0}},required:["id","name","code","active","default","storefront_access","guest_checkout","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","preferred_order_routing_strategy","stock_location_ids","default_catalog_id"],"x-typelizer":!0},ClaimLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},send_replacement:{type:"boolean"},description:{type:"string",nullable:!0},refund_amount:{type:"string"},paid_amount:{type:"string"},pre_tax_amount:{type:"string"},included_tax_total:{type:"string"},additional_tax_total:{type:"string"},tax_total:{type:"string"},display_refund_amount:{type:"string"},variant_id:{type:"string",nullable:!0},replacement_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},replacement_variant:{$ref:"#/components/schemas/Variant"}},required:["id","quantity","send_replacement","description","refund_amount","paid_amount","pre_tax_amount","included_tax_total","additional_tax_total","tax_total","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":!0},ClaimReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Claim:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["open","approved","resolved","denied","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},resolution:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},approved_at:{type:"string",nullable:!0},resolved_at:{type:"string",nullable:!0},denied_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ClaimReason"},claim_line_items:{type:"array",items:{$ref:"#/components/schemas/ClaimLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id","created_by_type"],"x-typelizer":!0},CollectionRule:{type:"object",properties:{id:{type:"string"},value:{type:"string",nullable:!0},match_policy:{type:"string",enum:["is_equal_to","is_not_equal_to","contains","does_not_contain"]},type:{type:"string",description:"Rule type. Built-in: tag, available_on, sale. Extensions may register more."}},required:["id","value","match_policy","type"],"x-typelizer":!0},Collection:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},sort_order:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},products_count:{type:"number"},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},translations:{type:"object"},automatic:{type:"boolean"},rules_match_policy:{type:"string",enum:["all","any"]},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},rules:{type:"array",items:{$ref:"#/components/schemas/CollectionRule"}}},required:["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":!0},CommissionLine:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["percentage","fixed"]},currency:{type:"string"},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},rate:{type:"string"},tax_rate:{type:"string"},amount:{type:"string"},tax_amount:{type:"string"},total:{type:"string"},display_amount:{type:"string"},display_tax_amount:{type:"string"},display_total:{type:"string"},order_id:{type:"string"},seller_id:{type:"string"},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},commission_rate_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},commission_rate:{$ref:"#/components/schemas/CommissionRate"}},required:["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","total","display_amount","display_tax_amount","display_total","order_id","seller_id","line_item_id","fulfillment_id","commission_rate_id","seller_name"],"x-typelizer":!0},CommissionRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},enabled:{type:"boolean"},position:{type:"number"},kind:{type:"string",enum:["percentage","fixed"]},tax_inclusive:{type:"boolean"},include_shipping:{type:"boolean"},metadata:{type:"object",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},value:{type:"string"},commission_tax_rate:{type:"string",nullable:!0},amounts:{type:"object"},bounds:{type:"object"},global:{type:"boolean"},rules:{type:"array",items:{$ref:"#/components/schemas/CommissionRule"}}},required:["id","name","code","enabled","position","kind","tax_inclusive","include_shipping","metadata","deleted_at","created_at","updated_at","value","commission_tax_rate","amounts","bounds","global","rules"],"x-typelizer":!0},CommissionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: seller_rule, category_rule, product_rule, item_total_rule. Extensions may register more."},commission_rate_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"object",nullable:!0},seller_ids:{type:"object",nullable:!0},category_ids:{type:"object",nullable:!0},sellers:{type:"array",items:{$ref:"#/components/schemas/Seller"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}}},required:["id","created_at","updated_at","type","commission_rate_id","preferences","preference_schema","product_ids","seller_ids","category_ids"],"x-typelizer":!0},CompanyInvitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},expires_at:{type:"string",nullable:!0},company_id:{type:"string"},status:{type:"string",enum:["pending","accepted","revoked","expired"]},accepted_at:{type:"string",nullable:!0},revoked_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","email","expires_at","company_id","status","accepted_at","revoked_at","created_at","updated_at"],"x-typelizer":!0},CompanyMembership:{type:"object",properties:{id:{type:"string"},company_id:{type:"string"},customer_id:{type:"string"},email:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","company_id","customer_id","email","created_at","updated_at"],"x-typelizer":!0},Company:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["company","division"]},po_number_required:{type:"boolean"},parent_id:{type:"string",nullable:!0},ancestors:{type:"object"},external_references:{type:"object"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},children_count:{type:"number"},members_count:{type:"number"},children:{type:"array",items:{$ref:"#/components/schemas/Company"}},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},memberships:{type:"array",items:{$ref:"#/components/schemas/CompanyMembership"}}},required:["id","name","kind","po_number_required","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"x-typelizer":!0},ConsentRecord:{type:"object",properties:{id:{type:"string"},purpose:{type:"string"},source:{type:"string",enum:["checkout","registration","account","admin","newsletter","anonymization","unknown","import","storefront"]},accepted:{type:"boolean"},email:{type:"string",nullable:!0},ip_address:{type:"string",nullable:!0},created_at:{type:"string"},recorded_at:{type:"string",nullable:!0},documents:{type:"object"}},required:["id","purpose","source","accepted","email","ip_address","created_at","recorded_at","documents"],"x-typelizer":!0},Country:{type:"object",properties:{iso:{type:"string"},iso3:{type:"string"},name:{type:"string"},states_required:{type:"boolean"},zipcode_required:{type:"boolean"},states:{type:"array",items:{$ref:"#/components/schemas/State"}},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0}},required:["iso","iso3","name","states_required","zipcode_required"],"x-typelizer":!0},CouponCode:{type:"object",properties:{id:{type:"string"},code:{type:"string"},state:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},promotion_id:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":!0},CreditCard:{type:"object",properties:{id:{type:"string"},brand:{type:"string"},last4:{type:"string"},month:{type:"number"},year:{type:"number"},name:{type:"string",nullable:!0},default:{type:"boolean"},gateway_payment_profile_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},payment_method_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":!0},CustomFieldDefinition:{type:"object",properties:{id:{type:"string"},namespace:{type:"string"},key:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},storefront_visible:{type:"boolean"},searchable:{type:"boolean"},sortable:{type:"boolean"},filter_key:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},resource_type:{type:"string",description:"Shorthand of the resource the field attaches to, for example product, variant, order, customer or category. Discover the full list from the resource_types endpoint; extensions may register more."}},required:["id","namespace","key","label","field_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at","resource_type"],"x-typelizer":!0},CustomField:{type:"object",properties:{id:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},key:{type:"string"},value:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},storefront_visible:{type:"boolean"},custom_field_definition_id:{type:"string"}},required:["id","label","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":!0},CustomerGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},customers_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":!0},Customer:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},accepts_email_marketing:{type:"boolean"},email_marketing_consent_updated_at:{type:"string",nullable:!0},full_name:{type:"string"},available_store_credit_total:{type:"string"},display_available_store_credit_total:{type:"string"},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},default_billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},default_shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},newsletter_subscriber:{allOf:[{$ref:"#/components/schemas/NewsletterSubscriber"}],nullable:!0},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},failed_attempts:{type:"number"},metadata:{type:"object"},email_marketing_consent_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},anonymized_at:{type:"string",nullable:!0},anonymized:{type:"boolean"},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},default_billing_address_id:{type:"string",nullable:!0},default_shipping_address_id:{type:"string",nullable:!0},orders_count:{type:"number"},total_spent:{type:"string"},display_total_spent:{type:"string"},last_order_completed_at:{type:"string",nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},store_credits:{type:"array",items:{$ref:"#/components/schemas/StoreCredit"}},customer_group_ids:{type:"array",items:{type:"string"}},companies:{type:"array",items:{$ref:"#/components/schemas/Company"}}},required:["id","email","first_name","last_name","phone","accepts_email_marketing","email_marketing_consent_updated_at","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","email_marketing_consent_source","created_at","updated_at","anonymized_at","anonymized","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":!0},DashboardCounter:{type:"object",properties:{key:{type:"string",description:"Registered counter name. The dashboard translates it; built-in: orders_to_fulfill, payments_to_collect, open_returns, open_exchanges, open_claims, low_stock_items, out_of_stock_items."},value:{type:"number"},link:{type:"object",nullable:!0,description:"The list filter that shows exactly the rows counted, or null when no list can."},nav:{type:"string",nullable:!0,description:"Sidebar entry key this count badges, or null."}},required:["key","value","link","nav"],"x-typelizer":!0},DataRequest:{type:"object",properties:{id:{type:"string"},number:{type:"string"},kind:{type:"string",enum:["access","erasure"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},requested_at:{type:"string",nullable:!0},completed_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},email:{type:"string"},error_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},requested_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"}},required:["id","number","kind","status","requested_at","completed_at","expires_at","email","error_message","created_at","updated_at","customer_id","requested_by_id"],"x-typelizer":!0},DeliveryMethodRule:{type:"object",properties:{id:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more."},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"array",items:{type:"string"}}},required:["id","active","created_at","updated_at","type","preferences","preference_schema","product_ids"],"x-typelizer":!0},DeliveryMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},estimated_transit_business_days_min:{type:"number",nullable:!0},estimated_transit_business_days_max:{type:"number",nullable:!0},digital:{type:"boolean"},pickup:{type:"boolean"},pickup_point:{type:"boolean"},admin_name:{type:"string",nullable:!0},storefront_visible:{type:"boolean"},tracking_url:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},available_to_sellers:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},services:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodService"}},rules:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodRule"}},tax_category_id:{type:"string",nullable:!0},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_zone_id:{type:"string",nullable:!0},stock_location_ids:{type:"array",items:{type:"string"}},fulfillment_provider:{type:"string",description:"Fulfillment provider. Built-in: manual, digital, pickup, pickup_point. Provider gems register more (e.g. easy_post)."},pickup_point_provider:{type:"string",nullable:!0,description:"Pickup point network. None built in; provider gems register them."},rate_provider:{type:"string",nullable:!0,description:"Rate provider; null prices through the calculator. Built-in: internal, freight. Provider gems register more (e.g. easy_post)."},calculator_type:{type:"string",nullable:!0},calculator_preferences:{type:"object",nullable:!0}},required:["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","storefront_visible","tracking_url","markup_flat","markup_percent","available_to_sellers","created_at","updated_at","deleted_at","seller_id","seller_name","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","fulfillment_provider","pickup_point_provider","rate_provider","calculator_type","calculator_preferences"],"x-typelizer":!0},DeliveryMethodService:{type:"object",properties:{id:{type:"string"},carrier:{type:"string"},service:{type:"string"},label:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},position:{type:"number"}},required:["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":!0},DeliveryOriginGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},stock_location_ids:{type:"array",items:{type:"string"}},delivery_zones_count:{type:"number"},delivery_methods_count:{type:"number"}},required:["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":!0},DeliveryProfile:{type:"object",properties:{id:{type:"string"},name:{type:"string"},default:{type:"boolean"},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Profile kind. Built-in: shipping, digital. Extensions may register more."},digital:{type:"boolean"},offers_pickup:{type:"boolean"},offers_shipping:{type:"boolean"},stock_location_ids:{type:"array",items:{type:"string"}},origin_groups:{type:"object"},products_count:{type:"number"},delivery_methods_count:{type:"number"},delivery_zones_count:{type:"number"}},required:["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":!0},DeliveryRate:{type:"object",properties:{id:{type:"string"},delivery_method_id:{type:"string"},name:{type:"string"},selected:{type:"boolean"},cost:{type:"string"},total:{type:"string"},additional_tax_total:{type:"string"},included_tax_total:{type:"string"},tax_total:{type:"string"},carrier:{type:"string",nullable:!0},service_level:{type:"string",nullable:!0},estimated_delivery_date:{type:"string",nullable:!0},unpriced:{type:"boolean"},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},display_cost:{type:"string"},display_total:{type:"string"},display_additional_tax_total:{type:"string"},display_included_tax_total:{type:"string"},display_tax_total:{type:"string"},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","unpriced","freight_summary","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":!0},Delivery:{type:"object",properties:{id:{type:"string"},tracking_number:{type:"string"},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},status:{type:"string",enum:["pending","pre_transit","in_transit","out_for_delivery","available_for_pickup","delivered","return_to_sender","failure","unknown"]},tracking_url:{type:"string",nullable:!0},estimated_delivery_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},details:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},shipping_label_id:{type:"string",nullable:!0}},required:["id","tracking_number","carrier","carrier_name","service","status","tracking_url","estimated_delivery_at","delivered_at","details","created_at","updated_at","shipping_label_id"],"x-typelizer":!0},DeliveryZoneMember:{type:"object",properties:{id:{type:"string"},member_type:{type:"string",enum:["country","state","postal_code"]},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},postal_code_prefix:{type:"string",nullable:!0},postal_code_from:{type:"string",nullable:!0},postal_code_to:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","state_name","created_at","updated_at"],"x-typelizer":!0},DeliveryZone:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},members:{type:"array",items:{$ref:"#/components/schemas/DeliveryZoneMember"}},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_method_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":!0},DigitalAsset:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},authorized_clicks:{type:"number",nullable:!0},authorized_days:{type:"number",nullable:!0},byte_size:{type:"number",nullable:!0},provider_settings:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},provider_type:{type:"string",nullable:!0,description:"Digital asset provider; null is an uploaded file. Built-in: file. Extensions may register more."},provider_name:{type:"string",description:"Digital asset provider name. Built-in: File. Extensions may register more."},download_url:{type:"string",nullable:!0},effective_authorized_clicks:{type:"number"},effective_authorized_days:{type:"number"}},required:["id","variant_id","filename","content_type","authorized_clicks","authorized_days","byte_size","provider_settings","created_at","updated_at","provider_type","provider_name","download_url","effective_authorized_clicks","effective_authorized_days"],"x-typelizer":!0},DigitalLink:{type:"object",properties:{id:{type:"string"},access_counter:{type:"number"},filename:{type:"string"},content_type:{type:"string"},download_url:{type:"string"},expires_at:{type:"string",nullable:!0},authorizable:{type:"boolean"},expired:{type:"boolean"},access_limit_exceeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","access_counter","filename","content_type","download_url","expires_at","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":!0},Discount:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{type:"string",enum:["promotion","manual"]},code:{type:"string",nullable:!0},value_type:{type:"string",nullable:!0},value:{type:"string",nullable:!0},promotion_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},ExchangeLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},original_price:{type:"string"},new_variant_price:{type:"string"},price_difference:{type:"string"},original_tax_total:{type:"string"},new_tax_total:{type:"string"},original_variant_id:{type:"string",nullable:!0},new_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},original_variant:{$ref:"#/components/schemas/Variant"},new_variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_tax_total","new_tax_total","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},Exchange:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","fulfilled","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},price_difference:{type:"string"},display_price_difference:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},fulfilled_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},exchange_line_items:{type:"array",items:{$ref:"#/components/schemas/ExchangeLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type"],"x-typelizer":!0},Export:{type:"object",properties:{id:{type:"string"},number:{type:"string"},format:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},done:{type:"boolean"},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},download_url:{type:"string",nullable:!0}},required:["id","number","format","created_at","updated_at","type","user_id","done","store_id","seller_id","seller_name","filename","byte_size","download_url"],"x-typelizer":!0},Fee:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{anyOf:[{type:"string",enum:["surcharge","handling","gift_wrap","cod","payment","duty","exchange"]},{type:"string"}],description:"What sort of charge this is. `duty` is a customs duty on a cross-border order and is not taxed; the other kinds are. Extensions may register further kinds."},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},FreightSummaryLine:{type:"object",properties:{variant_id:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},name:{type:"string",nullable:!0},units:{type:"number"},cartons:{type:"number",nullable:!0},pallets:{type:"number",nullable:!0},units_per_carton:{type:"number",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},complete:{type:"boolean"},weight_per_carton:{type:"string",nullable:!0},volume:{type:"string"},weight:{type:"string"}},required:["variant_id","sku","name","units","cartons","pallets","units_per_carton","cartons_per_pallet","complete","weight_per_carton","volume","weight"],"x-typelizer":!0},FreightSummary:{type:"object",properties:{total_units:{type:"number"},total_cartons:{type:"number"},total_pallets:{type:"number",nullable:!0},total_volume:{type:"string"},total_weight:{type:"string"},complete:{type:"boolean"},lines:{type:"array",items:{$ref:"#/components/schemas/FreightSummaryLine"}}},required:["total_units","total_cartons","total_pallets","total_volume","total_weight","complete","lines"],"x-typelizer":!0},FulfillmentItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},status:{anyOf:[{type:"string",enum:["on_hand","backordered","shipped","returned"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":!0},Fulfillment:{type:"object",properties:{id:{type:"string"},number:{type:"string"},tracking:{type:"string",nullable:!0},tracking_url:{type:"string",nullable:!0},pickup_point_data:{type:"object",nullable:!0},selected_delivery_rate_id:{type:"string",nullable:!0},unpriced:{type:"boolean"},cost:{type:"string"},display_cost:{type:"string"},total:{type:"string"},display_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},status:{anyOf:[{type:"string",enum:["unfulfilled","fulfilled","delivered","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},fulfillment_type:{type:"string",enum:["shipping","digital","pickup","pickup_point"]},fulfilled_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentManifestItem"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},stock_location:{$ref:"#/components/schemas/StockLocation"},delivery_rates:{type:"array",items:{$ref:"#/components/schemas/DeliveryRate"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},adjustment_total:{type:"string"},pre_tax_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},provider_generates_labels:{type:"boolean"},fulfillment_items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentItem"}},order:{$ref:"#/components/schemas/Order"}},required:["id","number","tracking","tracking_url","pickup_point_data","selected_delivery_rate_id","unpriced","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","delivered_at","items","deliveries","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","labels","provider_generates_labels"],"x-typelizer":!0},GiftCardBatch:{type:"object",properties:{id:{type:"string"},codes_count:{type:"number"},currency:{type:"string",nullable:!0},prefix:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0}},required:["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":!0},GiftCard:{type:"object",properties:{id:{type:"string"},code:{type:"string"},status:{anyOf:[{type:"string",enum:["active","partially_redeemed","redeemed","canceled","expired"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_authorized:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},expires_at:{type:"string",nullable:!0},redeemed_at:{type:"string",nullable:!0},expired:{type:"boolean"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"},gift_card_batch:{$ref:"#/components/schemas/GiftCardBatch"},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}}},required:["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":!0},ImportMapping:{type:"object",properties:{id:{type:"string"},schema_field:{type:"string"},file_column:{type:"string",nullable:!0},required:{type:"boolean"}},required:["id","schema_field","file_column","required"],"x-typelizer":!0},ImportRow:{type:"object",properties:{id:{type:"string"},row_number:{type:"number"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},validation_errors:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},import_id:{type:"string",nullable:!0},item_type:{type:"string",nullable:!0},item_id:{type:"string",nullable:!0},data:{type:"object"}},required:["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":!0},Import:{type:"object",properties:{id:{type:"string"},number:{type:"string"},rows_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0,description:"Import type. Built-in: products, product_translations, customers, price_list_prices. Extensions may register more."},status:{anyOf:[{type:"string",enum:["pending","mapping","completed_mapping","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},processing_errors:{type:"string",nullable:!0},preferred_delimiter:{type:"string"},price_list_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},original_filename:{type:"string",nullable:!0},original_byte_size:{type:"number",nullable:!0},original_file_url:{type:"string",nullable:!0},completed_rows_count:{type:"number"},failed_rows_count:{type:"number"},schema_fields:{type:"array",items:{$ref:"#/components/schemas/ImportSchemaField"}},csv_headers:{type:"array",items:{type:"string"}},sample_row:{type:"object"},mappings:{type:"array",items:{$ref:"#/components/schemas/ImportMapping"}}},required:["id","number","rows_count","created_at","updated_at","type","status","store_id","seller_id","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","price_list_id","seller_name","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":!0},Integration:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Integration type, registered by the provider gem that owns it (for example the EasyPost provider). Core ships none."},group:{type:"string",nullable:!0},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":!0},InvitationAcceptanceLink:{type:"object",properties:{id:{type:"string"},acceptance_url:{type:"string"}},required:["id","acceptance_url"],"x-typelizer":!0},Invitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},created_at:{type:"string"},updated_at:{type:"string"},expires_at:{type:"string"},role_id:{type:"string"},role_name:{type:"string"},inviter_email:{type:"string"},invitee_exists:{type:"boolean"},store:{type:"object"}},required:["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","invitee_exists","store"],"x-typelizer":!0},LineItem:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string"},seller_id:{type:"string",nullable:!0},preorder:{type:"boolean"},preorder_ships_at:{type:"string",nullable:!0},quantity:{type:"number"},currency:{type:"string"},name:{type:"string"},slug:{type:"string"},options_text:{type:"string"},price:{type:"string"},display_price:{type:"string"},total:{type:"string"},display_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},discounted_amount:{type:"string"},display_discounted_amount:{type:"string"},display_compare_at_amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},digital_links:{type:"array",items:{$ref:"#/components/schemas/DigitalLink"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},price_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},catalog_price:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},price_list_name:{type:"string",nullable:!0},catalog_id:{type:"string",nullable:!0},catalog_name:{type:"string",nullable:!0},cost_price:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},tax_category:{$ref:"#/components/schemas/TaxCategory"}},required:["id","variant_id","seller_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","price_source","created_at","updated_at","catalog_price","price_list_id","price_list_name","catalog_id","catalog_name","cost_price","tax_category_id"],"x-typelizer":!0},Market:{type:"object",properties:{id:{type:"string"},name:{type:"string"},currency:{type:"string"},default_locale:{type:"string"},tax_inclusive:{type:"boolean"},default:{type:"boolean"},country_codes:{type:"array",items:{type:"string"}},country_isos:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},created_at:{type:"string"},updated_at:{type:"string"},tax_provider:{type:"string",nullable:!0,description:"Tax provider; null uses the store default. Built-in: internal. Provider gems register more."}},required:["id","name","currency","default_locale","tax_inclusive","default","country_codes","country_isos","supported_locales","created_at","updated_at","tax_provider"],"x-typelizer":!0},Media:{type:"object",properties:{id:{type:"string"},product_id:{type:"string",nullable:!0},variant_ids:{type:"array",items:{type:"string"}},position:{type:"number"},alt:{type:"string",nullable:!0},media_type:{type:"string",enum:["image","video","external_video"]},focal_point_x:{type:"number",nullable:!0},focal_point_y:{type:"number",nullable:!0},external_video_url:{type:"string",nullable:!0},video_provider:{type:"string",nullable:!0},video_embed_url:{type:"string",nullable:!0},video_url:{type:"string",nullable:!0},poster_url:{type:"string",nullable:!0},original_url:{type:"string",nullable:!0},mini_url:{type:"string",nullable:!0},small_url:{type:"string",nullable:!0},medium_url:{type:"string",nullable:!0},large_url:{type:"string",nullable:!0},xlarge_url:{type:"string",nullable:!0},og_image_url:{type:"string",nullable:!0},external_references:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},attached:{type:"boolean"},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},embed_url:{type:"string",nullable:!0},signed_id:{type:"string",nullable:!0},viewable_id:{type:"string",nullable:!0},download_url:{type:"string",nullable:!0},metadata:{type:"object"},viewable_type:{type:"string",nullable:!0}},required:["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","video_provider","video_embed_url","video_url","poster_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","external_references","created_at","updated_at","attached","filename","content_type","byte_size","embed_url","signed_id","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":!0},MembershipProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0}},required:["id","name","thumbnail_url"],"x-typelizer":!0},NewsletterSubscriber:{type:"object",properties:{id:{type:"string"},email:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},verified:{type:"boolean"},verified_at:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0}},required:["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":!0},OptionType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},kind:{type:"string",enum:["dropdown","color_swatch","buttons"]},translations:{type:"object"},metadata:{type:"object"},filterable:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":!0},OptionValue:{type:"object",properties:{id:{type:"string"},option_type_id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},color_code:{type:"string",nullable:!0},option_type_name:{type:"string"},option_type_label:{type:"string"},image_url:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},option_type:{$ref:"#/components/schemas/OptionType"}},required:["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":!0},OrderCancellationReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},OrderGroup:{type:"object",properties:{id:{type:"string"},number:{type:"string"},email:{type:"string",nullable:!0},currency:{type:"string"},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},seller_count:{type:"number"},includes_first_party:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}}},required:["id","number","email","currency","total","display_total","item_total","display_item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","confirmation_delivered","store_owner_notification_delivered","created_at","updated_at","payments"],"x-typelizer":!0},OrderRoutingRule:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: preferred_location, default_location, minimize_splits. Extensions may register more."},channel_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema"],"x-typelizer":!0},Order:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},withdrawal_period_ends_at:{type:"string",nullable:!0},within_withdrawal_period:{type:"boolean"},cart_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},email:{type:"string"},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},coupon_code:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},item_total:{type:"string"},display_item_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},total:{type:"string"},display_total:{type:"string"},gift_card_total:{type:"string"},display_gift_card_total:{type:"string"},amount_due:{type:"string"},display_amount_due:{type:"string"},delivery_total:{type:"string"},display_delivery_total:{type:"string"},fee_total:{type:"string"},display_fee_total:{type:"string"},store_credit_total:{type:"string"},display_store_credit_total:{type:"string"},covered_by_store_credit:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},fulfillments:{type:"array",items:{$ref:"#/components/schemas/Fulfillment"}},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},gift_card:{allOf:[{$ref:"#/components/schemas/GiftCard"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},external_references:{type:"object"},status:{type:"string",enum:["draft","placed","canceled"]},last_ip_address:{type:"string",nullable:!0},considered_risky:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},payment_total:{type:"string"},display_payment_total:{type:"string"},metadata:{type:"object"},cancel_note:{type:"string",nullable:!0},commission_amount_total:{type:"string"},display_commission_amount_total:{type:"string"},commission_tax_total:{type:"string"},display_commission_tax_total:{type:"string"},commission_total:{type:"string"},display_commission_total:{type:"string"},canceled_at:{type:"string",nullable:!0},approved_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_stock_location_id:{type:"string",nullable:!0},po_document_url:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},order_group_id:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},approver_id:{type:"string",nullable:!0},approver_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},approver:{$ref:"#/components/schemas/Actor"},canceler_id:{type:"string",nullable:!0},canceler_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},canceler:{$ref:"#/components/schemas/Actor"},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},cancel_reason_id:{type:"string",nullable:!0},cancel_reason_name:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}},cart:{$ref:"#/components/schemas/Cart"},channel:{$ref:"#/components/schemas/Channel"},preferred_stock_location:{$ref:"#/components/schemas/StockLocation"},payment_methods:{type:"array",items:{$ref:"#/components/schemas/PaymentMethod"}},customer:{$ref:"#/components/schemas/Customer"},cancel_reason:{$ref:"#/components/schemas/OrderCancellationReason"},returns:{type:"array",items:{$ref:"#/components/schemas/Return"}},exchanges:{type:"array",items:{$ref:"#/components/schemas/Exchange"}},claims:{type:"array",items:{$ref:"#/components/schemas/Claim"}},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0}},required:["id","market_id","withdrawal_period_ends_at","within_withdrawal_period","cart_id","channel_id","company_id","company_name","po_document_filename","po_document_byte_size","number","email","customer_note","po_number","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","external_references","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","cancel_note","commission_amount_total","display_commission_amount_total","commission_tax_total","display_commission_tax_total","commission_total","display_commission_total","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","po_document_url","seller_id","order_group_id","tags","internal_note","internal_note_html","approver_id","approver_type","canceler_id","canceler_type","created_by_id","created_by_type","cancel_reason_id","cancel_reason_name","customer_id","freight_summary"],"x-typelizer":!0},PackageType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["box","envelope","carton","pallet","container"]},length:{type:"string",nullable:!0},width:{type:"string",nullable:!0},height:{type:"string",nullable:!0},weight:{type:"string",nullable:!0},max_weight:{type:"string",nullable:!0},default:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},volume:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0}},required:["id","name","kind","length","width","height","weight","max_weight","default","metadata","created_at","updated_at","dimensions_unit","weight_unit","volume","seller_id","seller_name"],"x-typelizer":!0},PaymentMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},type:{type:"string",description:"Payment method type. Built-in: check, store_credit, custom_payment_source_method, bogus (test only); payment provider gems register their own, for example stripe."},session_required:{type:"boolean"},source_required:{type:"boolean"},metadata:{type:"object"},active:{type:"boolean"},auto_capture:{type:"boolean",nullable:!0},capture_method:{type:"string",enum:["checkout","on_dispatch","manual"],nullable:!0},resolved_capture_method:{type:"string",enum:["checkout","on_dispatch","manual"]},storefront_visible:{type:"boolean"},position:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","description","type","session_required","source_required","metadata","active","auto_capture","capture_method","resolved_capture_method","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":!0},Payment:{type:"object",properties:{id:{type:"string"},payment_method_id:{type:"string"},response_code:{type:"string",nullable:!0},number:{type:"string"},status:{anyOf:[{type:"string",enum:["checkout","processing","pending","completed","failed","void","invalid"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},amount:{type:"string"},display_amount:{type:"string"},source_type:{type:"string",nullable:!0,enum:["credit_card","store_credit","payment_source"]},source_id:{type:"string",nullable:!0},source:{anyOf:[{$ref:"#/components/schemas/CreditCard"},{$ref:"#/components/schemas/StoreCredit"},{$ref:"#/components/schemas/PaymentSource"}],nullable:!0},payment_method:{$ref:"#/components/schemas/PaymentMethod"},metadata:{type:"object"},avs_response:{type:"string",nullable:!0},cvv_response_code:{type:"string",nullable:!0},cvv_response_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},captured_amount:{type:"string"},order_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}}},required:["id","payment_method_id","response_code","number","status","amount","display_amount","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":!0},PaymentSource:{type:"object",properties:{id:{type:"string"},gateway_payment_profile_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":!0},PaymentSplit:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},authorized_amount:{type:"string"},display_authorized_amount:{type:"string"},captured_amount:{type:"string"},display_captured_amount:{type:"string"},refunded_amount:{type:"string"},display_refunded_amount:{type:"string"},claimed_amount:{type:"string"},display_claimed_amount:{type:"string"},net_captured_amount:{type:"string"},display_net_captured_amount:{type:"string"},refundable_amount:{type:"string"},display_refundable_amount:{type:"string"},payment_id:{type:"string"},payment_number:{type:"string",nullable:!0},order_id:{type:"string"},order_number:{type:"string",nullable:!0}},required:["id","currency","created_at","updated_at","authorized_amount","display_authorized_amount","captured_amount","display_captured_amount","refunded_amount","display_refunded_amount","claimed_amount","display_claimed_amount","net_captured_amount","display_net_captured_amount","refundable_amount","display_refundable_amount","payment_id","payment_number","order_id","order_number"],"x-typelizer":!0},Permission:{type:"object",properties:{key:{type:"string"},resource:{type:"string"},kind:{type:"string",enum:["read","write"]},group:{type:"string"},group_label:{type:"string"},label:{type:"string"},description:{type:"string"}},required:["key","resource","kind","group","group_label","label","description"],"x-typelizer":!0},Policy:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},body:{type:"string",nullable:!0},body_html:{type:"string",nullable:!0},updated_at:{type:"string"},created_at:{type:"string"}},required:["id","name","slug","body","body_html","updated_at","created_at"],"x-typelizer":!0},PriceAdjustmentTier:{type:"object",properties:{id:{type:"string"},min_quantity:{type:"number"},percentage:{type:"string"}},required:["id","min_quantity","percentage"],"x-typelizer":!0},PriceHistory:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_in_cents:{type:"number"},currency:{type:"string"},display_amount:{type:"string"},recorded_at:{type:"string"},variant_id:{type:"string"},price_id:{type:"string"},compare_at_amount:{type:"string",nullable:!0},created_at:{type:"string"}},required:["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":!0},PriceListProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},price_list_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},PriceList:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["draft","active","inactive","scheduled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},position:{type:"number"},match_policy:{type:"string",enum:["all","any"]},adjust_compare_at:{type:"boolean"},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},price_adjustment_percentage:{type:"string",nullable:!0},automatic_pricing:{type:"boolean"},currently_active:{type:"boolean"},products_count:{type:"number"},prices_count:{type:"number"},price_adjustment_tiers:{type:"array",items:{$ref:"#/components/schemas/PriceAdjustmentTier"}},price_rules:{type:"array",items:{$ref:"#/components/schemas/PriceRule"}}},required:["id","name","description","status","position","match_policy","adjust_compare_at","starts_at","ends_at","deleted_at","created_at","updated_at","price_adjustment_percentage","automatic_pricing","currently_active","products_count","prices_count","price_adjustment_tiers"],"x-typelizer":!0},PriceRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: channel_rule, customer_group_rule, market_rule, user_rule, volume_rule, zone_rule. Extensions may register more."},price_list_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","created_at","updated_at","type","price_list_id","preferences","preference_schema"],"x-typelizer":!0},Price:{type:"object",properties:{id:{type:"string"},amount:{type:"string",nullable:!0},amount_in_cents:{type:"number",nullable:!0},compare_at_amount:{type:"string",nullable:!0},compare_at_amount_in_cents:{type:"number",nullable:!0},currency:{type:"string",nullable:!0},display_amount:{type:"string",nullable:!0},display_compare_at_amount:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},min_quantity:{type:"number"},variant_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","min_quantity","variant_id","created_at","updated_at"],"x-typelizer":!0},ProductPublication:{type:"object",properties:{id:{type:"string"},published_at:{type:"string",nullable:!0},unpublished_at:{type:"string",nullable:!0},product_id:{type:"string"},channel_id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":!0},Product:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},variant_count:{type:"number"},available_on:{type:"string",nullable:!0},preorder_ships_at:{type:"string",nullable:!0},purchasable:{type:"boolean"},preorder:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},available:{type:"boolean"},description:{type:"string",nullable:!0},description_html:{type:"string",nullable:!0},default_variant_id:{type:"string"},buy_box_variant_id:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},variants:{type:"array",items:{$ref:"#/components/schemas/Variant"}},default_variant:{$ref:"#/components/schemas/Variant"},option_types:{type:"array",items:{$ref:"#/components/schemas/OptionType"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},translations:{type:"object"},status:{anyOf:[{type:"string",enum:["draft","active","archived","proposed","rejected"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},metadata:{type:"object"},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},submission:{allOf:[{$ref:"#/components/schemas/ProductSubmission"}],nullable:!0},seller_name:{type:"string",nullable:!0},product_type_id:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},digital_assets:{type:"array",items:{$ref:"#/components/schemas/DigitalAsset"}},collections:{type:"array",items:{$ref:"#/components/schemas/Collection"}},product_publications:{type:"array",items:{$ref:"#/components/schemas/ProductPublication"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},product_type:{$ref:"#/components/schemas/ProductType"}},required:["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","buy_box_variant_id","thumbnail_url","tags","price","original_price","seller_id","external_references","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","seller_name","product_type_id","tax_category_id"],"x-typelizer":!0},ProductSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","approved","rejected","withdrawn"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},review_note:{type:"string",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},product_id:{type:"string"},metadata:{type:"object",nullable:!0},updated_at:{type:"string"},submitted_by_id:{type:"string",nullable:!0},reviewed_by_id:{type:"string",nullable:!0},reviewed_by_name:{type:"string",nullable:!0},auto_approved:{type:"boolean"}},required:["id","status","review_note","reviewed_at","created_at","product_id","metadata","updated_at","submitted_by_id","reviewed_by_id","reviewed_by_name","auto_approved"],"x-typelizer":!0},ProductTypeCustomFieldDefinition:{type:"object",properties:{id:{type:"string"},key:{type:"string"},namespace:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},required:{type:"boolean"},sort_order:{type:"number"}},required:["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":!0},ProductType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},translations:{type:"object"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},option_type_ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}},custom_field_definitions:{type:"array",items:{$ref:"#/components/schemas/ProductTypeCustomFieldDefinition"}}},required:["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":!0},PromotionAction:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Action type. Built-in: create_adjustment, create_item_adjustments, create_line_items, free_shipping. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},calculator:{allOf:[{$ref:"#/components/schemas/PromotionActionCalculator"}],nullable:!0},line_items:{type:"array",items:{$ref:"#/components/schemas/PromotionActionLineItem"},nullable:!0}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","calculator","line_items"],"x-typelizer":!0},PromotionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: currency, country, channel, market, item_total, product, customer, customer_group, first_order, customer_logged_in, one_use_per_user, category, option_value. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},product_ids:{type:"array",items:{type:"string"},nullable:!0},category_ids:{type:"array",items:{type:"string"},nullable:!0},customer_ids:{type:"array",items:{type:"string"},nullable:!0},option_value_ids:{type:"array",items:{type:"string"},nullable:!0},products:{type:"array",items:{$ref:"#/components/schemas/Product"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","product_ids","category_ids","customer_ids","option_value_ids"],"x-typelizer":!0},Promotion:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},usage_limit:{type:"number",nullable:!0},match_policy:{type:"string",enum:["all","any"]},path:{type:"string",nullable:!0},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"number",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},action_ids:{type:"array",items:{type:"string"}},rule_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":!0},PurchaseOrderItem:{type:"object",properties:{id:{type:"string"},quantity_ordered:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},currency:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},unit_cost:{type:"string"},total_cost:{type:"string"},display_unit_cost:{type:"string"},display_total_cost:{type:"string"},purchase_order_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_ordered","quantity_received","quantity_rejected","quantity_over","outstanding","currency","created_at","updated_at","unit_cost","total_cost","display_unit_cost","display_total_cost","purchase_order_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},PurchaseOrder:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{type:"string"},currency:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},ordered_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},expected_at:{type:"string",nullable:!0},cancel_by:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_ordered_total:{type:"number"},editable:{type:"boolean"},subtotal:{type:"string"},display_subtotal:{type:"string"},supplier_id:{type:"string",nullable:!0},destination_location_id:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/PurchaseOrderItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},supplier:{$ref:"#/components/schemas/Supplier"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","status","currency","reference","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","ordered_at","received_at","closed_short_at","created_at","updated_at","expected_at","cancel_by","closed_short","quantity_ordered_total","editable","subtotal","display_subtotal","supplier_id","destination_location_id"],"x-typelizer":!0},RefundReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Refund:{type:"object",properties:{id:{type:"string"},transaction_id:{type:"string",nullable:!0},amount:{type:"string",nullable:!0},payment_id:{type:"string",nullable:!0},refund_reason_id:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},tax_amount:{type:"string"},refunder_id:{type:"string",nullable:!0},refunder_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},refunder:{$ref:"#/components/schemas/Actor"},payment:{$ref:"#/components/schemas/Payment"}},required:["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at","tax_amount","refunder_id","refunder_type"],"x-typelizer":!0},ReturnLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},included_tax_total:{type:"string"},additional_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},refund_amount:{type:"string"},display_refund_amount:{type:"string"},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},line_item:{$ref:"#/components/schemas/LineItem"},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}}},required:["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","included_tax_total","additional_tax_total","tax_total","display_tax_total","refund_amount","display_refund_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},ReturnReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Return:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","refunded","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},refund_tax_total:{type:"string"},display_refund_tax_total:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},refunded_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},return_line_items:{type:"array",items:{$ref:"#/components/schemas/ReturnLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},refunded_total:{type:"string"},display_refunded_total:{type:"string"},refundable_total:{type:"string"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}}},required:["id","number","status","order_id","reason_id","refund_total","display_refund_total","refund_tax_total","display_refund_tax_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type","refunded_total","display_refunded_total","refundable_total","documents","labels","deliveries"],"x-typelizer":!0},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},permissions:{type:"array",items:{type:"string"}},mutable:{type:"boolean"},users_count:{type:"number"}},required:["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":!0},SavedReport:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},query:{type:"object"},seeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},user_id:{type:"string",nullable:!0},author_name:{type:"string",nullable:!0}},required:["id","name","description","query","seeded","created_at","updated_at","user_id","author_name"],"x-typelizer":!0},SellerBalance:{type:"object",properties:{currency:{type:"string"},settlement_currency:{type:"string"},converted:{type:"boolean"},seller_id:{type:"string"},earned:{type:"string"},display_earned:{type:"string"},payable:{type:"string"},display_payable:{type:"string"},paid:{type:"string"},display_paid:{type:"string"},balance:{type:"string"},display_balance:{type:"string"},pending:{type:"string"},display_pending:{type:"string"}},required:["currency","settlement_currency","converted","seller_id","earned","display_earned","payable","display_payable","paid","display_paid","balance","display_balance","pending","display_pending"],"x-typelizer":!0},SellerPayout:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},reference:{type:"string",nullable:!0},metadata:{type:"object"},period_start:{type:"string",nullable:!0},period_end:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},seller_id:{type:"string"},seller_name:{type:"string",nullable:!0},transfers_count:{type:"number"},provider:{type:"string",description:"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},required:["id","status","currency","reference","metadata","period_start","period_end","created_at","updated_at","amount","display_amount","seller_id","seller_name","transfers_count","provider"],"x-typelizer":!0},SellerRequirement:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},required:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},preferences:{type:"object"},custom_field_definition_ids:{type:"array",items:{type:"string"}},allow_multiple:{type:"boolean"},accepts_submissions:{type:"boolean"},reviewed_by_operator:{type:"boolean"}},required:["id","position","active","required","metadata","created_at","updated_at","kind","name","description","preferences","custom_field_definition_ids","allow_multiple","accepts_submissions","reviewed_by_operator"],"x-typelizer":!0},SellerRequirementStatus:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},required:{type:"boolean"},position:{type:"number"},status:{type:"string",enum:["complete","incomplete","pending","rejected"]},action_url:{type:"string",nullable:!0},blocker:{type:"object",nullable:!0},blocking:{type:"boolean"},required_policy_name:{type:"string",nullable:!0},submission:{$ref:"#/components/schemas/SellerRequirementSubmission"},published_policy:{$ref:"#/components/schemas/Policy"}},required:["id","kind","name","description","required","position","status","action_url","blocker","blocking","required_policy_name"],"x-typelizer":!0},SellerRequirementSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted","rejected","waived"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},note:{type:"string",nullable:!0},review_note:{type:"string",nullable:!0},reference:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string"},requirement_id:{type:"string"},requirement_name:{type:"string"},file_url:{type:"string",nullable:!0},file_name:{type:"string",nullable:!0}},required:["id","status","note","review_note","reference","metadata","reviewed_at","created_at","updated_at","seller_id","requirement_id","requirement_name","file_url","file_name"],"x-typelizer":!0},Seller:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},about:{type:"string"},about_html:{type:"string"},logo_url:{type:"string",nullable:!0},square_logo_url:{type:"string",nullable:!0},cover_photo_url:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["pending","invited","canceled","onboarding","ready_for_review","approved","rejected","suspended"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},contact_email:{type:"string",nullable:!0},billing_email:{type:"string",nullable:!0},tax_remittance:{type:"string"},payouts_schedule_interval:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},holiday_mode_until:{type:"string",nullable:!0},terms_accepted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},minimum_payout_amount:{type:"string",nullable:!0},on_holiday:{type:"boolean"},sellable:{type:"boolean"},products_count:{type:"number"},users_count:{type:"number"},onboarding_progress:{type:"object"},onboarding_complete:{type:"boolean"},legal_name:{type:"string",nullable:!0},registration_number:{type:"string",nullable:!0},billing_address:{$ref:"#/components/schemas/Address"},returns_address:{$ref:"#/components/schemas/Address"}},required:["id","name","slug","about","about_html","logo_url","square_logo_url","cover_photo_url","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","on_holiday","sellable","products_count","users_count","onboarding_progress","onboarding_complete","legal_name","registration_number"],"x-typelizer":!0},SellerTeamMember:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0}},required:["id","email","first_name","last_name","full_name","created_at","updated_at","avatar_url"],"x-typelizer":!0},SellerTransfer:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["earning","refund_reversal"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},reference:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},settled_amount:{type:"string",nullable:!0},settled_currency:{type:"string",nullable:!0},converted:{type:"boolean"},seller_id:{type:"string"},order_id:{type:"string",nullable:!0},payout_id:{type:"string",nullable:!0},reversed_from_id:{type:"string",nullable:!0},refund_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0},provider:{type:"string",description:"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},required:["id","kind","status","currency","reference","metadata","created_at","updated_at","amount","display_amount","settled_amount","settled_currency","converted","seller_id","order_id","payout_id","reversed_from_id","refund_id","seller_name","order_number","provider"],"x-typelizer":!0},SetupTask:{type:"object",properties:{name:{type:"string"},done:{type:"boolean"}},required:["name","done"],"x-typelizer":!0},ShippingLabel:{type:"object",properties:{id:{type:"string"},source:{type:"string",enum:["purchased","uploaded"]},status:{anyOf:[{type:"string",enum:["purchased","refund_requested","refunded"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},tracking_number:{type:"string",nullable:!0},currency:{type:"string",nullable:!0},format:{type:"string",nullable:!0},external_id:{type:"string",nullable:!0},metadata:{type:"object"},refunded_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},owner_id:{type:"string"},owner_type:{type:"string",enum:["fulfillment","return"]},cost:{type:"string"},display_cost:{type:"string"},integration_id:{type:"string",nullable:!0},file_pending:{type:"boolean"},download_url:{type:"string",nullable:!0}},required:["id","source","status","carrier","carrier_name","service","tracking_number","currency","format","external_id","metadata","refunded_at","created_at","updated_at","owner_id","owner_type","cost","display_cost","integration_id","file_pending","download_url"],"x-typelizer":!0},State:{type:"object",properties:{abbr:{type:"string"},name:{type:"string"}},required:["abbr","name"],"x-typelizer":!0},StockLevel:{type:"object",properties:{id:{type:"string"},count_on_hand:{type:"number"},backorderable:{type:"boolean"},stock_location_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},external_references:{type:"object"},metadata:{type:"object"},reserved_count:{type:"number"},incoming_count:{type:"number"},purchasable_count:{type:"number"},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_location_name:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},allocated_count:{type:"number"},available_count:{type:"number"},stock_location:{$ref:"#/components/schemas/StockLocation"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","count_on_hand","backorderable","stock_location_id","variant_id","external_references","metadata","reserved_count","incoming_count","purchasable_count","variant_name","variant_sku","created_at","updated_at","stock_location_name","product_id","options_text","thumbnail_url","allocated_count","available_count"],"x-typelizer":!0},StockLocation:{type:"object",properties:{id:{type:"string"},name:{type:"string"},address1:{type:"string",nullable:!0},city:{type:"string",nullable:!0},zipcode:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},state_text:{type:"string",nullable:!0},pickup_ready_in_minutes:{type:"number",nullable:!0},pickup_instructions:{type:"string",nullable:!0},external_references:{type:"object"},admin_name:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},active:{type:"boolean"},default:{type:"boolean"},backorderable_default:{type:"boolean"},propagate_all_variants:{type:"boolean"},kind:{anyOf:[{type:"string",enum:["warehouse","store","fulfillment_center"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},pickup_enabled:{type:"boolean"},pickup_stock_policy:{type:"string",enum:["local","any"]},returns_enabled:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"}},required:["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","external_references","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","returns_enabled","created_at","updated_at","seller_id","seller_name"],"x-typelizer":!0},StockMovement:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},kind:{type:"string",nullable:!0,enum:["received","allocated","shipped","released","adjusted"]},reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_level_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},stock_location_name:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},return_id:{type:"string",nullable:!0},exchange_id:{type:"string",nullable:!0},stock_transfer_id:{type:"string",nullable:!0},stock_receipt_id:{type:"string",nullable:!0},purchase_order_id:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0},return_number:{type:"string",nullable:!0},exchange_number:{type:"string",nullable:!0},stock_transfer_number:{type:"string",nullable:!0},purchase_order_number:{type:"string",nullable:!0},unit_cost:{type:"string",nullable:!0},display_unit_cost:{type:"string",nullable:!0}},required:["id","quantity","kind","reason","created_at","updated_at","stock_level_id","stock_location_id","stock_location_name","variant_id","variant_name","variant_sku","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id","stock_receipt_id","purchase_order_id","order_number","return_number","exchange_number","stock_transfer_number","purchase_order_number","unit_cost","display_unit_cost"],"x-typelizer":!0},StockReceiptItem:{type:"object",properties:{id:{type:"string"},quantity_accepted:{type:"number"},quantity_rejected:{type:"number"},rejection_reason:{type:"string",nullable:!0,enum:["damaged","wrong_item","expired","other"]},notes:{type:"string",nullable:!0},line_type:{type:"string",enum:["purchase_order_item","stock_transfer_item"]},line_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_accepted","quantity_rejected","rejection_reason","notes","line_type","line_id","variant_id","product_id","variant_name","variant_sku","thumbnail_url"],"x-typelizer":!0},StockReceipt:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},quantity_accepted_total:{type:"number"},quantity_rejected_total:{type:"number"},received_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},receivable_type:{type:"string",enum:["purchase_order","stock_transfer"]},receivable_id:{type:"string"},received_by_id:{type:"string",nullable:!0},received_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},received_by:{$ref:"#/components/schemas/Actor"},items_count:{type:"number"},items:{type:"array",items:{$ref:"#/components/schemas/StockReceiptItem"}}},required:["id","number","reference","notes","metadata","quantity_accepted_total","quantity_rejected_total","received_at","created_at","updated_at","receivable_type","receivable_id","received_by_id","received_by_type","items_count"],"x-typelizer":!0},StockReservation:{type:"object",properties:{id:{type:"string"},stock_level_id:{type:"string"},line_item_id:{type:"string"},order_id:{type:"string"},variant_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},quantity:{type:"number"},expires_at:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","stock_level_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":!0},StockTransferItem:{type:"object",properties:{id:{type:"string"},quantity_shipped:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},stock_transfer_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_shipped","quantity_received","quantity_rejected","quantity_over","outstanding","created_at","updated_at","stock_transfer_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},StockTransfer:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},source_location_id:{type:"string"},destination_location_id:{type:"string"},status:{type:"string"},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},shipped_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_shipped_total:{type:"number"},editable:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/StockTransferItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},source_location:{$ref:"#/components/schemas/StockLocation"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","reference","created_at","updated_at","source_location_id","destination_location_id","status","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","shipped_at","received_at","closed_short_at","deleted_at","closed_short","quantity_shipped_total","editable"],"x-typelizer":!0},StoreCreditEvent:{type:"object",properties:{id:{type:"string"},action:{type:"string"},authorization_code:{type:"string",nullable:!0},display_action:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},store_credit_id:{type:"string"},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0}},required:["id","action","authorization_code","display_action","amount","display_amount","created_at","updated_at","store_credit_id","originator_type","originator_id"],"x-typelizer":!0},StoreCredit:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},currency:{type:"string"},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount_authorized:{type:"string"},outstanding:{type:"boolean"},display_amount_authorized:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"}},required:["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","amount_authorized","outstanding","display_amount_authorized","customer_id","created_by_id","originator_type","originator_id"],"x-typelizer":!0},Store:{type:"object",properties:{id:{type:"string"},metadata:{type:"object"},name:{type:"string"},code:{type:"string"},preferred_storefront_url:{type:"string",nullable:!0},default_currency:{type:"string"},default_locale:{type:"string"},default_country_code:{type:"string",nullable:!0},mail_from_address:{type:"string",nullable:!0},customer_support_email:{type:"string",nullable:!0},new_order_notifications_email:{type:"string",nullable:!0},preferred_send_consumer_transactional_emails:{type:"boolean"},preferred_email_accent_color:{type:"string",nullable:!0},preferred_email_background_color:{type:"string",nullable:!0},preferred_email_card_color:{type:"string",nullable:!0},preferred_email_text_color:{type:"string",nullable:!0},preferred_email_heading_color:{type:"string",nullable:!0},preferred_email_font:{type:"string",nullable:!0,enum:["inter","system","helvetica","georgia","roboto","lato","merriweather"]},preferred_admin_locale:{type:"string",nullable:!0},preferred_timezone:{type:"string"},preferred_weight_unit:{type:"string",enum:["g","kg","lb","oz"]},preferred_unit_system:{type:"string"},preferred_storefront_access:{type:"string"},preferred_guest_checkout:{type:"boolean"},preferred_always_include_confirm_step:{type:"boolean"},preferred_company_field_enabled:{type:"boolean"},preferred_address_requires_company:{type:"boolean"},preferred_address_requires_phone:{type:"boolean"},preferred_capture_method:{type:"string"},preferred_track_inventory_levels:{type:"boolean"},preferred_stock_reservations_enabled:{type:"boolean"},preferred_low_stock_threshold:{type:"number"},preferred_tax_using_ship_address:{type:"boolean"},preferred_track_price_history:{type:"boolean"},preferred_show_products_without_price:{type:"boolean"},preferred_disable_sku_validation:{type:"boolean"},preferred_pricing_provider:{type:"string"},preferred_inventory_provider:{type:"string"},preferred_pricing_provider_failure_policy:{type:"string"},preferred_inventory_provider_failure_policy:{type:"string"},preferred_default_payouts_schedule_interval:{type:"string"},preferred_auto_approve_sellers:{type:"boolean"},preferred_auto_approve_seller_products:{type:"boolean"},preferred_send_seller_transactional_emails:{type:"boolean"},preferred_document_number_format:{type:"string"},preferred_order_number_prefix:{type:"string"},preferred_order_number_suffix:{type:"string"},preferred_order_number_sequence_start:{type:"number"},preferred_limit_digital_download_count:{type:"boolean"},preferred_digital_asset_authorized_clicks:{type:"number"},preferred_limit_digital_download_days:{type:"boolean"},preferred_digital_asset_authorized_days:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferred_order_routing_strategy:{type:"string",description:"Order routing strategy. Built-in: rules. Extensions may register more."},preferred_payout_provider:{type:"string",nullable:!0,description:"Payout provider; null uses the installation default. Built-in: system. Provider gems register more (e.g. stripe)."},order_number_sequence_started:{type:"boolean"},preferred_default_minimum_payout_amount:{type:"number"},preferred_default_commission_tax_rate:{type:"number"},url:{type:"string"},api_url:{type:"string"},setup_tasks:{type:"array",items:{$ref:"#/components/schemas/SetupTask"}},supported_currencies:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},available_locales:{type:"array",items:{type:"string"}},logo_url:{type:"string",nullable:!0},mailer_logo_url:{type:"string",nullable:!0}},required:["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","default_country_code","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_email_accent_color","preferred_email_background_color","preferred_email_card_color","preferred_email_text_color","preferred_email_heading_color","preferred_email_font","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_always_include_confirm_step","preferred_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_low_stock_threshold","preferred_tax_using_ship_address","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_pricing_provider","preferred_inventory_provider","preferred_pricing_provider_failure_policy","preferred_inventory_provider_failure_policy","preferred_default_payouts_schedule_interval","preferred_auto_approve_sellers","preferred_auto_approve_seller_products","preferred_send_seller_transactional_emails","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","preferred_limit_digital_download_count","preferred_digital_asset_authorized_clicks","preferred_limit_digital_download_days","preferred_digital_asset_authorized_days","created_at","updated_at","preferred_order_routing_strategy","preferred_payout_provider","order_number_sequence_started","preferred_default_minimum_payout_amount","preferred_default_commission_tax_rate","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":!0},Supplier:{type:"object",properties:{id:{type:"string"},name:{type:"string"},contact_name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},city:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},purchase_orders_count:{type:"number"},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},can_be_deleted:{type:"boolean"}},required:["id","name","contact_name","email","phone","notes","address1","address2","city","state_name","state_code","country_code","postal_code","purchase_orders_count","metadata","created_at","updated_at","deleted_at","can_be_deleted"],"x-typelizer":!0},TaxCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},tax_code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},is_default:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":!0},TaxExemptionCertificate:{type:"object",properties:{id:{type:"string"},certificate_number:{type:"string"},reason_code:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","verified","expired","revoked"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},issuing_authority:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},issued_at:{type:"string"},expires_at:{type:"string"},verified_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},company_id:{type:"string"},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},active:{type:"boolean"},lapsed:{type:"boolean"},can_be_deleted:{type:"boolean"},document_filename:{type:"string",nullable:!0},document_byte_size:{type:"number",nullable:!0},document_url:{type:"string",nullable:!0}},required:["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":!0},TaxIdentifier:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Tax identifier kind, keyed to a registered validator. Built-in: eu_vat. Extensions may register more."},value:{type:"string"},validation_status:{type:"string",nullable:!0,enum:["pending","verified","unverified","unavailable","unsupported"]},validation_evidence:{type:"object",nullable:!0},source:{type:"string",nullable:!0,enum:["override","company","customer"]},validated_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},validatable:{type:"boolean"},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0}},required:["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"x-typelizer":!0},TaxLine:{type:"object",properties:{id:{type:"string"},label:{type:"string"},included:{type:"boolean"},credit:{type:"boolean"},rate:{type:"string"},tax_rate_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},fee_id:{type:"string",nullable:!0},return_line_item_id:{type:"string",nullable:!0},claim_line_item_id:{type:"string",nullable:!0},exchange_line_item_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},provider_id:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},data:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},original_tax_line_id:{type:"string",nullable:!0}},required:["id","label","included","credit","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","return_line_item_id","claim_line_item_id","exchange_line_item_id","amount","display_amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at","original_tax_line_id"],"x-typelizer":!0},TaxRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},included_in_price:{type:"boolean"},show_rate_in_label:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},amount:{type:"string"},amount_percentage:{type:"number",nullable:!0},tax_category_id:{type:"string",nullable:!0},store_id:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0}},required:["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"x-typelizer":!0},Variant:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},sku:{type:"string",nullable:!0},options_text:{type:"string"},track_inventory:{type:"boolean"},media_count:{type:"number"},preorder_ships_at:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},preorder:{type:"boolean"},weight:{type:"number",nullable:!0},height:{type:"number",nullable:!0},width:{type:"number",nullable:!0},depth:{type:"number",nullable:!0},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},purchase_unit:{type:"string",nullable:!0,enum:["unit","carton"]},units_per_carton:{type:"number",nullable:!0},price:{$ref:"#/components/schemas/Price"},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},metadata:{type:"object"},position:{type:"number"},cost_price:{type:"string",nullable:!0},cost_currency:{type:"string",nullable:!0},barcode:{type:"string",nullable:!0},backorder_limit:{type:"number",nullable:!0},hs_code:{type:"string",nullable:!0},country_of_origin:{type:"string",nullable:!0},customs_description:{type:"string",nullable:!0},carton_weight:{type:"string",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preorderable:{type:"boolean"},tax_category_id:{type:"string",nullable:!0},carton_package_type_id:{type:"string",nullable:!0},units_per_pallet:{type:"number",nullable:!0},available_stock:{type:"number",nullable:!0},reserved_quantity:{type:"number"},total_on_hand:{type:"number",nullable:!0},product_name:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},prices:{type:"array",items:{$ref:"#/components/schemas/Price"}},stock_levels:{type:"array",items:{$ref:"#/components/schemas/StockLevel"}}},required:["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","weight_unit","dimensions_unit","minimum_order_quantity","order_multiple","purchase_unit","units_per_carton","price","original_price","seller_id","option_values","external_references","metadata","position","cost_price","cost_currency","barcode","backorder_limit","hs_code","country_of_origin","customs_description","carton_weight","cartons_per_pallet","deleted_at","created_at","updated_at","preorderable","tax_category_id","carton_package_type_id","units_per_pallet","available_stock","reserved_quantity","total_on_hand","product_name","delivery_profile_id"],"x-typelizer":!0},WebhookDelivery:{type:"object",properties:{id:{type:"string"},event_name:{type:"string"},event_id:{type:"string",nullable:!0},response_code:{type:"number",nullable:!0},execution_time:{type:"number",nullable:!0},error_type:{type:"string",nullable:!0},request_errors:{type:"string",nullable:!0},response_body:{type:"string",nullable:!0},success:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivered_at:{type:"string",nullable:!0},payload:{type:"object",nullable:!0},webhook_endpoint_id:{type:"string"},webhook_endpoint_url:{type:"string"}},required:["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":!0},WebhookEndpoint:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},url:{type:"string"},active:{type:"boolean"},subscriptions:{type:"array",items:{type:"string"}},disabled_reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},disabled_at:{type:"string",nullable:!0},secret_key:{type:"string",nullable:!0},last_delivery_at:{type:"string",nullable:!0},recent_delivery_count:{type:"number"},recent_failure_count:{type:"number"},total_delivery_count:{type:"number"},successful_delivery_count:{type:"number"},failed_delivery_count:{type:"number"}},required:["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":!0},WebhookEvent:{type:"object",properties:{name:{type:"string"},group:{type:"string"},credential_permission:{type:"string",nullable:!0},credential:{type:"boolean"},deprecated:{type:"boolean"},replaced_by:{type:"string",nullable:!0}},required:["name","group","credential_permission","credential","deprecated","replaced_by"]},EmailTemplateDraft:{type:"object",properties:{id:{type:"string"},subject:{type:"string",nullable:!0},body:{type:"string"},lock_version:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},updated_by_id:{type:"string",nullable:!0},updated_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},updated_by:{$ref:"#/components/schemas/Actor"}},required:["id","subject","body","lock_version","created_at","updated_at","updated_by_id","updated_by_type"],"x-typelizer":!0},EmailTemplatePreview:{type:"object",properties:{id:{type:"string",nullable:!0},subject:{type:"string"},html:{type:"string"},text:{type:"string"},email_key:{type:"string"},variables:{type:"object"}},required:["id","subject","html","text","email_key","variables"],"x-typelizer":!0},EmailTemplateRevision:{type:"object",properties:{id:{type:"string"},subject:{type:"string",nullable:!0},body:{type:"string"},created_at:{type:"string"},published_by_id:{type:"string",nullable:!0},published_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},published_by:{$ref:"#/components/schemas/Actor"}},required:["id","subject","body","created_at","published_by_id","published_by_type"],"x-typelizer":!0},EmailTemplateSampleRecord:{type:"object",properties:{id:{type:"string"},label:{type:"string"},created_at:{type:"string"}},required:["id","label","created_at"],"x-typelizer":!0},EmailTemplate:{type:"object",properties:{id:{type:"string"},key:{type:"string"},subject:{type:"string",nullable:!0},body:{type:"string"},language:{type:"string"},customized_languages:{type:"array",items:{type:"string"}},kind:{type:"string",enum:["email","layout","partial"]},customized:{type:"boolean"},published_at:{type:"string",nullable:!0},default_subject:{type:"string",nullable:!0},default_body:{type:"string"},published_language:{type:"string",nullable:!0},default_changed:{type:"boolean"},base_subject:{type:"string",nullable:!0},base_body:{type:"string",nullable:!0},draft:{allOf:[{$ref:"#/components/schemas/EmailTemplateDraft"}],nullable:!0}},required:["id","key","subject","body","language","customized_languages","kind","customized","published_at","default_subject","default_body","published_language","default_changed","base_subject","base_body","draft"],"x-typelizer":!0}}}};var wh=new Set(["get","post","put","patch","delete"]);function Mn(){return kh}function H0(e){let t=e.description?.match(/\*\*Required scope:\*\* (.+?) \(for API-key authentication\)\./);return t?t[1].replaceAll("`",""):"\u2014"}function xh(e,t={}){let r=[];for(let[i,n]of Object.entries(e.paths)){let s=i.replace("/api/v3/admin","")||"/";for(let[a,o]of Object.entries(n)){if(!wh.has(a))continue;if(t.resource){let d=s.split("/")[1]??"";if(d!==t.resource&&!d.startsWith(t.resource))continue}let c=o.summary??"";t.search&&!`${a} ${s} ${c}`.toLowerCase().includes(t.search.toLowerCase())||r.push({method:a.toUpperCase(),path:s,scope:H0(o),summary:c})}}return r}function Sh(e,t){let r=t.trim().split(/\s+/),i=r.length>1?r[0].toLowerCase():void 0,n=r.length>1?r[1]:r[0],s=Wr(n),a=vh(e,i,o=>o===s);return a.length>0?a:vh(e,i,o=>W0(o,s))}function vh(e,t,r){let i=[];for(let[n,s]of Object.entries(e.paths)){let a=n.replace("/api/v3/admin","")||"/";if(r(a))for(let[o,c]of Object.entries(s))wh.has(o)&&(t&&o!==t||i.push({method:o.toUpperCase(),path:a,summary:c.summary,description:c.description,parameters:or(c.parameters,e),requestBody:or(c.requestBody,e),responses:or(c.responses,e)}))}return i}function W0(e,t){if(e===t)return!0;let r=e.split("/"),i=t.split("/");return r.length!==i.length?!1:r.every((n,s)=>n.startsWith("{")&&n.endsWith("}")?i[s].length>0:n===i[s])}var K0=8;function or(e,t,r=[]){if(Array.isArray(e))return e.map(a=>or(a,t,r));if(!e||typeof e!="object")return e;let i=e,n=i.$ref;if(typeof n=="string"){let a=n.replace("#/components/schemas/","");return r.includes(a)||r.length>=K0||!(a in t.components.schemas)?{$ref:n}:or(t.components.schemas[a],t,[...r,a])}let s={};for(let[a,o]of Object.entries(i))s[a]=or(o,t,r);return s}function Y0(e,t){return[...t,e]}function jh(e){return e.option("--profile <name>","use a saved profile (see `spree auth`)").option("--base-url <url>","store URL (overrides profile/env/project)").option("--api-key <key>","secret API key (prefer SPREE_API_KEY \u2014 flags leak into shell history)").option("--store-id <id>","X-Spree-Store-Id for hosts serving multiple stores")}function Ph(){return new rp("--format <format>","output format").choices(["json","table"]).default("json")}function $h(e){return jh(e).addOption(Ph())}async function Ah(e){let t=await Br({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile});return{client:zr({baseUrl:t.baseUrl,secretKey:t.apiKey,...e.storeId?{storeId:e.storeId}:{}}),credentials:t}}function Th(e){let t=e.command("api").description("Call the Admin API directly (generic get/post/patch/delete)");t.addHelpText("after",["","Examples:"," spree api get /products -q status_eq=active --limit 10",` spree api post /products -d '{"name":"Classic Tee","prices":[{"currency":"USD","amount":"29.99"}]}'`," spree api get /orders/ord_x8k2J9aQ --expand items,payments","","Discover the surface (offline, no server needed):"," spree api endpoints --search <term> # find endpoints + required scopes",' spree api schema "POST /orders" # request/response schema for one operation'," spree completion zsh # tab-completion for paths, filters, scopes"].join(`
920
- `)),$h(t.command("get <path>").description("GET an Admin API path, e.g. `spree api get /products -q status_eq=active`").option("-q, --query <expr>","Ransack predicate key=value (repeatable)",Y0,[]).option("--sort <fields>","sort, e.g. -created_at").option("--page <n>","page number").option("--limit <n>","page size (max 100)").option("--expand <relations>","expand relations, e.g. variants,variants.prices").option("--fields <fields>","sparse fields, e.g. id,name")).action(async(r,i)=>{let n;try{let s=bh(i),{client:a,credentials:o}=await Ah(i);n=o.baseUrl;let c=await a.request("GET",Wr(r),{params:s});Hr(c,i.format)}catch(s){Rt(s,{baseUrl:n})}});for(let r of["post","patch","delete"])$h(t.command(`${r} <path>`).description(`${r.toUpperCase()} an Admin API path`).option("-d, --data <json>","request body: inline JSON, @file, or '-' for stdin")).action(async(i,n)=>{let s;try{let a=await gh(n.data),{client:o,credentials:c}=await Ah(n);s=c.baseUrl;let d=await o.request(r.toUpperCase(),Wr(i),{...a===Po?{}:{body:a}});Hr(d,n.format)}catch(a){Rt(a,{baseUrl:s})}});t.command("endpoints").description("List Admin API endpoints with their required scopes").option("--resource <name>","filter by first path segment, e.g. orders").option("--search <term>","filter by method, path, or summary").addOption(Ph()).action(r=>{let i=xh(Mn(),{resource:r.resource,search:r.search});if(i.length===0){process.stderr.write(`No endpoints match.
919
+ **Required scope:** \`write_purchasing\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"204":{description:"supplier deleted"}}}}},components:{schemas:{PaginationMeta:{type:"object",properties:{page:{type:"integer"},limit:{type:"integer"},count:{type:"integer",description:"Total number of records"},pages:{type:"integer",description:"Total number of pages"},from:{type:"integer",description:"Index of first record on this page"},to:{type:"integer",description:"Index of last record on this page"},in:{type:"integer",description:"Number of records on this page"},previous:{type:"integer",nullable:!0,description:"Previous page number"},next:{type:"integer",nullable:!0,description:"Next page number"}},required:["page","limit","count","pages","from","to","in"]},ErrorResponse:{type:"object",properties:{error:{type:"object",properties:{code:{type:"string"},message:{type:"string"},details:{type:"object",description:"Field-specific validation errors",nullable:!0}},required:["code","message"]}},required:["error"]},AuthResponse:{type:"object",properties:{token:{type:"string",description:"JWT access token"},user:{$ref:"#/components/schemas/AdminUser"}},required:["token","user"]},PermissionRule:{type:"object",description:"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.",properties:{allow:{type:"boolean",description:"true for `can`, false for `cannot`"},actions:{type:"array",items:{type:"string"},description:'Action names, e.g. ["read", "update"] or ["manage"]'},subjects:{type:"array",items:{type:"string"},description:'Subject short names, e.g. ["product"] or ["all"]'},has_conditions:{type:"boolean",description:"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},required:["allow","actions","subjects","has_conditions"]},ImportSchemaField:{type:"object",description:"A canonical column of an import type, including per-store custom field columns",properties:{name:{type:"string",description:"Canonical field name used in mappings"},label:{type:"string",description:"Human-readable label"},required:{type:"boolean",description:"Whether the field must be mapped before processing"}},required:["name","label","required"]},CheckoutRequirement:{type:"object",properties:{step:{type:"string",description:"Checkout step this requirement belongs to"},field:{type:"string",description:"Field that needs to be satisfied"},message:{type:"string",description:"Human-readable requirement message"}},required:["step","field","message"]},CartWarning:{type:"object",description:"A warning about a cart issue (e.g., item removed due to stock change)",properties:{code:{type:"string",description:"Machine-readable warning code"},message:{type:"string",description:"Human-readable warning message"},line_item_id:{type:"string",nullable:!0,description:"Prefixed line item ID (when applicable)"},variant_id:{type:"string",nullable:!0,description:"Prefixed variant ID (when applicable)"},item_index:{type:"integer",nullable:!0,description:"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},required:["code","message"]},FulfillmentManifestItem:{type:"object",description:"An item within a fulfillment \u2014 which line item and how many units are in this fulfillment",properties:{item_id:{type:"string",description:"Line item ID"},variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer",description:"Quantity in this fulfillment"}},required:["item_id","variant_id","quantity"]},AdminUserRoleAssignment:{type:"object",description:"A role assignment for the current store on a staff member",properties:{id:{type:"string",description:"Prefixed role ID"},name:{type:"string",description:"Role name"}},required:["id","name"]},AdminUserStore:{type:"object",description:"A store the staff member can access through a role assignment",properties:{id:{type:"string",description:"Prefixed store ID"},name:{type:"string",description:"Store name"},code:{type:"string",description:"Store code"}},required:["id","name","code"]},PreferenceField:{type:"object",description:"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.",properties:{key:{type:"string"},type:{type:"string",description:"string | text | password | integer | decimal | boolean | array | hash"},default:{description:"Default value (any JSON type), null when there is no default",nullable:!0}},required:["key","type"]},PromotionActionCalculator:{type:"object",description:"The action's nested calculator (when the action carries one \u2014 null for actions like `free_shipping`)",properties:{type:{type:"string",description:"Wire shorthand for the calculator subclass"},label:{type:"string"},preferences:{type:"object",additionalProperties:!0},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}}},required:["type","label","preferences","preference_schema"]},PromotionActionLineItem:{type:"object",description:"One row in a `create_line_items` action \u2014 the variant added to the order and how many",properties:{variant_id:{type:"string"},quantity:{type:"integer"}},required:["variant_id","quantity"]},MeResponse:{type:"object",description:"Current admin user profile and serialized permissions",properties:{user:{$ref:"#/components/schemas/AdminUser"},permissions:{type:"array",items:{$ref:"#/components/schemas/PermissionRule"}}},required:["user","permissions"]},Actor:{type:"object",properties:{id:{type:"string"},type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},label:{type:"string",nullable:!0}},required:["id","type","label"],"x-typelizer":!0},Address:{type:"object",properties:{id:{type:"string"},label:{type:"string",nullable:!0},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string"},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},city:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},country_name:{type:"string"},country_code:{type:"string"},state_text:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},quick_checkout:{type:"boolean"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"},state_abbr:{type:"string",nullable:!0},country_iso:{type:"string"},state_name:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},latitude:{type:"number",nullable:!0},longitude:{type:"number",nullable:!0},customer_id:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0}},required:["id","label","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","metadata","created_at","updated_at","latitude","longitude","customer_id","owner_id","owner_type"],"x-typelizer":!0},AdminUser:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},selected_locale:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0},roles:{type:"array",items:{$ref:"#/components/schemas/AdminUserRoleAssignment"}},stores:{type:"array",items:{$ref:"#/components/schemas/AdminUserStore"}}},required:["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":!0},AllowedOrigin:{type:"object",properties:{id:{type:"string"},origin:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","origin","created_at","updated_at"],"x-typelizer":!0},ApiKey:{type:"object",properties:{id:{type:"string"},name:{type:"string"},key_type:{type:"string",enum:["publishable","secret"]},token_prefix:{type:"string",nullable:!0},scopes:{type:"array",items:{type:"string"}},created_at:{type:"string"},updated_at:{type:"string"},revoked_at:{type:"string",nullable:!0},last_used_at:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},plaintext_token:{type:"string",nullable:!0},created_by_email:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by_label:{type:"string",nullable:!0}},required:["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email","created_by_type","created_by_label"],"x-typelizer":!0},AppliedPromotion:{type:"object",properties:{id:{type:"string"},promotion_id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":!0},Cart:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},preferred_stock_location_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_number_required:{type:"boolean"},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},token:{type:"string"},email:{type:"string",nullable:!0},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},warnings:{type:"array",items:{$ref:"#/components/schemas/CartWarning"}},coupon_code:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},adjustment_total:{type:"string",nullable:!0},display_adjustment_total:{type:"string",nullable:!0},discount_total:{type:"string",nullable:!0},display_discount_total:{type:"string",nullable:!0},tax_total:{type:"string",nullable:!0},display_tax_total:{type:"string",nullable:!0},included_tax_total:{type:"string",nullable:!0},display_included_tax_total:{type:"string",nullable:!0},additional_tax_total:{type:"string",nullable:!0},display_additional_tax_total:{type:"string",nullable:!0},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},gift_card_total:{type:"string",nullable:!0},display_gift_card_total:{type:"string",nullable:!0},amount_due:{type:"string",nullable:!0},display_amount_due:{type:"string",nullable:!0},delivery_total:{type:"string",nullable:!0},display_delivery_total:{type:"string",nullable:!0},fee_total:{type:"string",nullable:!0},display_fee_total:{type:"string",nullable:!0},store_credit_total:{type:"string",nullable:!0},display_store_credit_total:{type:"string",nullable:!0},covered_by_store_credit:{type:"boolean"},current_step:{type:"string"},completed_steps:{type:"array",items:{type:"string"}},requirements:{type:"array",items:{$ref:"#/components/schemas/CheckoutRequirement"}},order_minimum:{type:"number",nullable:!0},order_minimum_shortfall:{type:"number",nullable:!0},below_order_minimum:{type:"boolean",nullable:!0},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},shipping_eq_billing_address:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},completed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}}},required:["id","market_id","channel_id","preferred_stock_location_id","company_id","company_name","po_number_required","po_document_filename","po_document_byte_size","number","token","email","customer_note","po_number","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","order_minimum","order_minimum_shortfall","below_order_minimum","freight_summary","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":!0},CatalogAssignment:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},catalog_id:{type:"string"},assignable_type:{type:"string"},assignable_id:{type:"string"},assignable_name:{type:"string",nullable:!0}},required:["id","created_at","catalog_id","assignable_type","assignable_id","assignable_name"],"x-typelizer":!0},CatalogOrderMinimum:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"}},required:["id","currency","created_at","updated_at","amount","display_amount"],"x-typelizer":!0},CatalogPrice:{type:"object",properties:{id:{type:"string",nullable:!0},label:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},currency:{type:"string"},source:{type:"string",enum:["explicit","automatic","base"]},break_count:{type:"number"},amount:{type:"string"},display_amount:{type:"string"},tiers:{type:"array",items:{$ref:"#/components/schemas/CatalogPriceTier"}}},required:["id","label","sku","currency","source","break_count","amount","display_amount","tiers"],"x-typelizer":!0},CatalogPriceTier:{type:"object",properties:{min_quantity:{type:"number"},display_amount:{type:"string"},amount:{type:"string"}},required:["min_quantity","display_amount","amount"],"x-typelizer":!0},CatalogProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},quantity_rule:{allOf:[{$ref:"#/components/schemas/CatalogProductTerm"}],nullable:!0},catalog_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},CatalogProductTerm:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},product_name:{type:"string",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},mixed:{type:"boolean"}},required:["id","product_id","product_name","minimum_order_quantity","order_multiple","mixed"],"x-typelizer":!0},CatalogQuantityRule:{type:"object",properties:{id:{type:"string"},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant_id:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},product_name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","minimum_order_quantity","order_multiple","created_at","updated_at","variant_id","variant_sku","product_name","options_text"],"x-typelizer":!0},Catalog:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},active:{type:"boolean"},position:{type:"number",nullable:!0},metadata:{type:"object",nullable:!0},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},products_count:{type:"number"},pricing_strategy:{type:"string"},order_minimums:{type:"array",items:{$ref:"#/components/schemas/CatalogOrderMinimum"}},price_list:{$ref:"#/components/schemas/PriceList"},assignments:{type:"array",items:{$ref:"#/components/schemas/CatalogAssignment"}}},required:["id","name","description","active","position","metadata","minimum_order_quantity","order_multiple","created_at","updated_at","products_count","pricing_strategy"],"x-typelizer":!0},Category:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},depth:{type:"number"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},children_count:{type:"number"},parent_id:{type:"string",nullable:!0},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},is_root:{type:"boolean"},is_child:{type:"boolean"},is_leaf:{type:"boolean"},parent:{$ref:"#/components/schemas/Category"},children:{type:"array",items:{$ref:"#/components/schemas/Category"}},ancestors:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},external_references:{type:"object"},translations:{type:"object"},metadata:{type:"object"},pretty_name:{type:"string"},lft:{type:"number"},rgt:{type:"number"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","external_references","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":!0},Channel:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string"},active:{type:"boolean"},default:{type:"boolean"},storefront_access:{type:"string"},guest_checkout:{type:"boolean"},preferred_storefront_access:{type:"string",nullable:!0},preferred_guest_checkout:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_order_routing_strategy:{type:"string",nullable:!0,description:"Order routing strategy; null inherits the store setting. Built-in: rules. Extensions may register more."},stock_location_ids:{type:"array",items:{type:"string"}},default_catalog_id:{type:"string",nullable:!0}},required:["id","name","code","active","default","storefront_access","guest_checkout","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","preferred_order_routing_strategy","stock_location_ids","default_catalog_id"],"x-typelizer":!0},ClaimLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},send_replacement:{type:"boolean"},description:{type:"string",nullable:!0},refund_amount:{type:"string"},paid_amount:{type:"string"},pre_tax_amount:{type:"string"},included_tax_total:{type:"string"},additional_tax_total:{type:"string"},tax_total:{type:"string"},display_refund_amount:{type:"string"},variant_id:{type:"string",nullable:!0},replacement_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},replacement_variant:{$ref:"#/components/schemas/Variant"}},required:["id","quantity","send_replacement","description","refund_amount","paid_amount","pre_tax_amount","included_tax_total","additional_tax_total","tax_total","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":!0},ClaimReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Claim:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["open","approved","resolved","denied","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},resolution:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},approved_at:{type:"string",nullable:!0},resolved_at:{type:"string",nullable:!0},denied_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ClaimReason"},claim_line_items:{type:"array",items:{$ref:"#/components/schemas/ClaimLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id","created_by_type"],"x-typelizer":!0},CollectionRule:{type:"object",properties:{id:{type:"string"},value:{type:"string",nullable:!0},match_policy:{type:"string",enum:["is_equal_to","is_not_equal_to","contains","does_not_contain"]},type:{type:"string",description:"Rule type. Built-in: tag, available_on, sale. Extensions may register more."}},required:["id","value","match_policy","type"],"x-typelizer":!0},Collection:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},sort_order:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},products_count:{type:"number"},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},translations:{type:"object"},automatic:{type:"boolean"},rules_match_policy:{type:"string",enum:["all","any"]},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},rules:{type:"array",items:{$ref:"#/components/schemas/CollectionRule"}}},required:["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":!0},CommissionLine:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["percentage","fixed"]},currency:{type:"string"},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},rate:{type:"string"},tax_rate:{type:"string"},amount:{type:"string"},tax_amount:{type:"string"},total:{type:"string"},display_amount:{type:"string"},display_tax_amount:{type:"string"},display_total:{type:"string"},order_id:{type:"string"},seller_id:{type:"string"},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},commission_rate_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},commission_rate:{$ref:"#/components/schemas/CommissionRate"}},required:["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","total","display_amount","display_tax_amount","display_total","order_id","seller_id","line_item_id","fulfillment_id","commission_rate_id","seller_name"],"x-typelizer":!0},CommissionRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},enabled:{type:"boolean"},position:{type:"number"},kind:{type:"string",enum:["percentage","fixed"]},tax_inclusive:{type:"boolean"},include_shipping:{type:"boolean"},metadata:{type:"object",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},value:{type:"string"},commission_tax_rate:{type:"string",nullable:!0},amounts:{type:"object"},bounds:{type:"object"},global:{type:"boolean"},rules:{type:"array",items:{$ref:"#/components/schemas/CommissionRule"}}},required:["id","name","code","enabled","position","kind","tax_inclusive","include_shipping","metadata","deleted_at","created_at","updated_at","value","commission_tax_rate","amounts","bounds","global","rules"],"x-typelizer":!0},CommissionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: seller_rule, category_rule, product_rule, item_total_rule. Extensions may register more."},commission_rate_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"object",nullable:!0},seller_ids:{type:"object",nullable:!0},category_ids:{type:"object",nullable:!0},sellers:{type:"array",items:{$ref:"#/components/schemas/Seller"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}}},required:["id","created_at","updated_at","type","commission_rate_id","preferences","preference_schema","product_ids","seller_ids","category_ids"],"x-typelizer":!0},CompanyInvitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},expires_at:{type:"string",nullable:!0},company_id:{type:"string"},status:{type:"string",enum:["pending","accepted","revoked","expired"]},accepted_at:{type:"string",nullable:!0},revoked_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","email","expires_at","company_id","status","accepted_at","revoked_at","created_at","updated_at"],"x-typelizer":!0},CompanyMembership:{type:"object",properties:{id:{type:"string"},company_id:{type:"string"},customer_id:{type:"string"},email:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","company_id","customer_id","email","created_at","updated_at"],"x-typelizer":!0},Company:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["company","division"]},po_number_required:{type:"boolean"},parent_id:{type:"string",nullable:!0},ancestors:{type:"object"},external_references:{type:"object"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},children_count:{type:"number"},members_count:{type:"number"},children:{type:"array",items:{$ref:"#/components/schemas/Company"}},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},memberships:{type:"array",items:{$ref:"#/components/schemas/CompanyMembership"}}},required:["id","name","kind","po_number_required","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"x-typelizer":!0},ConsentRecord:{type:"object",properties:{id:{type:"string"},purpose:{type:"string"},source:{type:"string",enum:["checkout","registration","account","admin","newsletter","anonymization","unknown","import","storefront"]},accepted:{type:"boolean"},email:{type:"string",nullable:!0},ip_address:{type:"string",nullable:!0},created_at:{type:"string"},recorded_at:{type:"string",nullable:!0},documents:{type:"object"}},required:["id","purpose","source","accepted","email","ip_address","created_at","recorded_at","documents"],"x-typelizer":!0},Country:{type:"object",properties:{iso:{type:"string"},iso3:{type:"string"},name:{type:"string"},states_required:{type:"boolean"},zipcode_required:{type:"boolean"},states:{type:"array",items:{$ref:"#/components/schemas/State"}},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0}},required:["iso","iso3","name","states_required","zipcode_required"],"x-typelizer":!0},CouponCode:{type:"object",properties:{id:{type:"string"},code:{type:"string"},state:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},promotion_id:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":!0},CreditCard:{type:"object",properties:{id:{type:"string"},brand:{type:"string"},last4:{type:"string"},month:{type:"number"},year:{type:"number"},name:{type:"string",nullable:!0},default:{type:"boolean"},gateway_payment_profile_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},payment_method_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":!0},CustomFieldDefinition:{type:"object",properties:{id:{type:"string"},namespace:{type:"string"},key:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},storefront_visible:{type:"boolean"},searchable:{type:"boolean"},sortable:{type:"boolean"},filter_key:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},resource_type:{type:"string",description:"Shorthand of the resource the field attaches to, for example product, variant, order, customer or category. Discover the full list from the resource_types endpoint; extensions may register more."}},required:["id","namespace","key","label","field_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at","resource_type"],"x-typelizer":!0},CustomField:{type:"object",properties:{id:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},key:{type:"string"},value:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},storefront_visible:{type:"boolean"},custom_field_definition_id:{type:"string"}},required:["id","label","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":!0},CustomerGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},customers_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":!0},Customer:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},accepts_email_marketing:{type:"boolean"},email_marketing_consent_updated_at:{type:"string",nullable:!0},full_name:{type:"string"},available_store_credit_total:{type:"string"},display_available_store_credit_total:{type:"string"},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},default_billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},default_shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},newsletter_subscriber:{allOf:[{$ref:"#/components/schemas/NewsletterSubscriber"}],nullable:!0},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},failed_attempts:{type:"number"},metadata:{type:"object"},email_marketing_consent_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},anonymized_at:{type:"string",nullable:!0},anonymized:{type:"boolean"},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},default_billing_address_id:{type:"string",nullable:!0},default_shipping_address_id:{type:"string",nullable:!0},orders_count:{type:"number"},total_spent:{type:"string"},display_total_spent:{type:"string"},last_order_completed_at:{type:"string",nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},store_credits:{type:"array",items:{$ref:"#/components/schemas/StoreCredit"}},customer_group_ids:{type:"array",items:{type:"string"}},companies:{type:"array",items:{$ref:"#/components/schemas/Company"}}},required:["id","email","first_name","last_name","phone","accepts_email_marketing","email_marketing_consent_updated_at","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","email_marketing_consent_source","created_at","updated_at","anonymized_at","anonymized","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":!0},DashboardCounter:{type:"object",properties:{key:{type:"string",description:"Registered counter name. The dashboard translates it; built-in: orders_to_fulfill, payments_to_collect, open_returns, open_exchanges, open_claims, low_stock_items, out_of_stock_items."},value:{type:"number"},link:{type:"object",nullable:!0,description:"The list filter that shows exactly the rows counted, or null when no list can."},nav:{type:"string",nullable:!0,description:"Sidebar entry key this count badges, or null."}},required:["key","value","link","nav"],"x-typelizer":!0},DataRequest:{type:"object",properties:{id:{type:"string"},number:{type:"string"},kind:{type:"string",enum:["access","erasure"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},requested_at:{type:"string",nullable:!0},completed_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},email:{type:"string"},error_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},requested_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"}},required:["id","number","kind","status","requested_at","completed_at","expires_at","email","error_message","created_at","updated_at","customer_id","requested_by_id"],"x-typelizer":!0},DeliveryMethodRule:{type:"object",properties:{id:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more."},preferences:{type:"object"},preference_schema:{type:"object"},product_ids:{type:"array",items:{type:"string"}}},required:["id","active","created_at","updated_at","type","preferences","preference_schema","product_ids"],"x-typelizer":!0},DeliveryMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},estimated_transit_business_days_min:{type:"number",nullable:!0},estimated_transit_business_days_max:{type:"number",nullable:!0},digital:{type:"boolean"},pickup:{type:"boolean"},pickup_point:{type:"boolean"},admin_name:{type:"string",nullable:!0},storefront_visible:{type:"boolean"},tracking_url:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},available_to_sellers:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},services:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodService"}},rules:{type:"array",items:{$ref:"#/components/schemas/DeliveryMethodRule"}},tax_category_id:{type:"string",nullable:!0},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_zone_id:{type:"string",nullable:!0},stock_location_ids:{type:"array",items:{type:"string"}},fulfillment_provider:{type:"string",description:"Fulfillment provider. Built-in: manual, digital, pickup, pickup_point. Provider gems register more (e.g. easy_post)."},pickup_point_provider:{type:"string",nullable:!0,description:"Pickup point network. None built in; provider gems register them."},rate_provider:{type:"string",nullable:!0,description:"Rate provider; null prices through the calculator. Built-in: internal, freight. Provider gems register more (e.g. easy_post)."},calculator_type:{type:"string",nullable:!0},calculator_preferences:{type:"object",nullable:!0}},required:["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","storefront_visible","tracking_url","markup_flat","markup_percent","available_to_sellers","created_at","updated_at","deleted_at","seller_id","seller_name","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","fulfillment_provider","pickup_point_provider","rate_provider","calculator_type","calculator_preferences"],"x-typelizer":!0},DeliveryMethodService:{type:"object",properties:{id:{type:"string"},carrier:{type:"string"},service:{type:"string"},label:{type:"string",nullable:!0},markup_flat:{type:"string",nullable:!0},markup_percent:{type:"string",nullable:!0},position:{type:"number"}},required:["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":!0},DeliveryOriginGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},stock_location_ids:{type:"array",items:{type:"string"}},delivery_zones_count:{type:"number"},delivery_methods_count:{type:"number"}},required:["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":!0},DeliveryProfile:{type:"object",properties:{id:{type:"string"},name:{type:"string"},default:{type:"boolean"},position:{type:"number",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Profile kind. Built-in: shipping, digital. Extensions may register more."},digital:{type:"boolean"},offers_pickup:{type:"boolean"},offers_shipping:{type:"boolean"},stock_location_ids:{type:"array",items:{type:"string"}},origin_groups:{type:"object"},products_count:{type:"number"},delivery_methods_count:{type:"number"},delivery_zones_count:{type:"number"}},required:["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":!0},DeliveryRate:{type:"object",properties:{id:{type:"string"},delivery_method_id:{type:"string"},name:{type:"string"},selected:{type:"boolean"},cost:{type:"string"},total:{type:"string"},additional_tax_total:{type:"string"},included_tax_total:{type:"string"},tax_total:{type:"string"},carrier:{type:"string",nullable:!0},service_level:{type:"string",nullable:!0},estimated_delivery_date:{type:"string",nullable:!0},unpriced:{type:"boolean"},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0},display_cost:{type:"string"},display_total:{type:"string"},display_additional_tax_total:{type:"string"},display_included_tax_total:{type:"string"},display_tax_total:{type:"string"},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","unpriced","freight_summary","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":!0},Delivery:{type:"object",properties:{id:{type:"string"},tracking_number:{type:"string"},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},status:{type:"string",enum:["pending","pre_transit","in_transit","out_for_delivery","available_for_pickup","delivered","return_to_sender","failure","unknown"]},tracking_url:{type:"string",nullable:!0},estimated_delivery_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},details:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},shipping_label_id:{type:"string",nullable:!0}},required:["id","tracking_number","carrier","carrier_name","service","status","tracking_url","estimated_delivery_at","delivered_at","details","created_at","updated_at","shipping_label_id"],"x-typelizer":!0},DeliveryZoneMember:{type:"object",properties:{id:{type:"string"},member_type:{type:"string",enum:["country","state","postal_code"]},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},postal_code_prefix:{type:"string",nullable:!0},postal_code_from:{type:"string",nullable:!0},postal_code_to:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","state_name","created_at","updated_at"],"x-typelizer":!0},DeliveryZone:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},members:{type:"array",items:{$ref:"#/components/schemas/DeliveryZoneMember"}},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string"},delivery_origin_group_id:{type:"string",nullable:!0},delivery_method_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":!0},DigitalAsset:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},authorized_clicks:{type:"number",nullable:!0},authorized_days:{type:"number",nullable:!0},byte_size:{type:"number",nullable:!0},provider_settings:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},provider_type:{type:"string",nullable:!0,description:"Digital asset provider; null is an uploaded file. Built-in: file. Extensions may register more."},provider_name:{type:"string",description:"Digital asset provider name. Built-in: File. Extensions may register more."},download_url:{type:"string",nullable:!0},effective_authorized_clicks:{type:"number"},effective_authorized_days:{type:"number"}},required:["id","variant_id","filename","content_type","authorized_clicks","authorized_days","byte_size","provider_settings","created_at","updated_at","provider_type","provider_name","download_url","effective_authorized_clicks","effective_authorized_days"],"x-typelizer":!0},DigitalLink:{type:"object",properties:{id:{type:"string"},access_counter:{type:"number"},filename:{type:"string"},content_type:{type:"string"},download_url:{type:"string"},expires_at:{type:"string",nullable:!0},authorizable:{type:"boolean"},expired:{type:"boolean"},access_limit_exceeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","access_counter","filename","content_type","download_url","expires_at","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":!0},Discount:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{type:"string",enum:["promotion","manual"]},code:{type:"string",nullable:!0},value_type:{type:"string",nullable:!0},value:{type:"string",nullable:!0},promotion_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},ExchangeLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},original_price:{type:"string"},new_variant_price:{type:"string"},price_difference:{type:"string"},original_tax_total:{type:"string"},new_tax_total:{type:"string"},original_variant_id:{type:"string",nullable:!0},new_variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},original_variant:{$ref:"#/components/schemas/Variant"},new_variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_tax_total","new_tax_total","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},Exchange:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","fulfilled","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},price_difference:{type:"string"},display_price_difference:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},fulfilled_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},exchange_line_items:{type:"array",items:{$ref:"#/components/schemas/ExchangeLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type"],"x-typelizer":!0},Export:{type:"object",properties:{id:{type:"string"},number:{type:"string"},format:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},done:{type:"boolean"},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},filename:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},download_url:{type:"string",nullable:!0}},required:["id","number","format","created_at","updated_at","type","user_id","done","store_id","seller_id","seller_name","filename","byte_size","download_url"],"x-typelizer":!0},Fee:{type:"object",properties:{id:{type:"string"},label:{type:"string"},kind:{anyOf:[{type:"string",enum:["surcharge","handling","gift_wrap","cod","payment","duty","exchange"]},{type:"string"}],description:"What sort of charge this is. `duty` is a customs duty on a cross-border order and is not taxed; the other kinds are. Extensions may register further kinds."},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":!0},FreightSummaryLine:{type:"object",properties:{variant_id:{type:"string",nullable:!0},sku:{type:"string",nullable:!0},name:{type:"string",nullable:!0},units:{type:"number"},cartons:{type:"number",nullable:!0},pallets:{type:"number",nullable:!0},units_per_carton:{type:"number",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},complete:{type:"boolean"},weight_per_carton:{type:"string",nullable:!0},volume:{type:"string"},weight:{type:"string"}},required:["variant_id","sku","name","units","cartons","pallets","units_per_carton","cartons_per_pallet","complete","weight_per_carton","volume","weight"],"x-typelizer":!0},FreightSummary:{type:"object",properties:{total_units:{type:"number"},total_cartons:{type:"number"},total_pallets:{type:"number",nullable:!0},total_volume:{type:"string"},total_weight:{type:"string"},complete:{type:"boolean"},lines:{type:"array",items:{$ref:"#/components/schemas/FreightSummaryLine"}}},required:["total_units","total_cartons","total_pallets","total_volume","total_weight","complete","lines"],"x-typelizer":!0},FulfillmentItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},status:{anyOf:[{type:"string",enum:["on_hand","backordered","shipped","returned"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},name:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0}},required:["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":!0},Fulfillment:{type:"object",properties:{id:{type:"string"},number:{type:"string"},tracking:{type:"string",nullable:!0},tracking_url:{type:"string",nullable:!0},pickup_point_data:{type:"object",nullable:!0},selected_delivery_rate_id:{type:"string",nullable:!0},unpriced:{type:"boolean"},cost:{type:"string"},display_cost:{type:"string"},total:{type:"string"},display_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},status:{anyOf:[{type:"string",enum:["unfulfilled","fulfilled","delivered","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},fulfillment_type:{type:"string",enum:["shipping","digital","pickup","pickup_point"]},fulfilled_at:{type:"string",nullable:!0},delivered_at:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentManifestItem"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},stock_location:{$ref:"#/components/schemas/StockLocation"},delivery_rates:{type:"array",items:{$ref:"#/components/schemas/DeliveryRate"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},adjustment_total:{type:"string"},pre_tax_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},provider_generates_labels:{type:"boolean"},fulfillment_items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentItem"}},order:{$ref:"#/components/schemas/Order"}},required:["id","number","tracking","tracking_url","pickup_point_data","selected_delivery_rate_id","unpriced","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","delivered_at","items","deliveries","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","labels","provider_generates_labels"],"x-typelizer":!0},GiftCardBatch:{type:"object",properties:{id:{type:"string"},codes_count:{type:"number"},currency:{type:"string",nullable:!0},prefix:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0}},required:["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":!0},GiftCard:{type:"object",properties:{id:{type:"string"},code:{type:"string"},status:{anyOf:[{type:"string",enum:["active","partially_redeemed","redeemed","canceled","expired"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_authorized:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},expires_at:{type:"string",nullable:!0},redeemed_at:{type:"string",nullable:!0},expired:{type:"boolean"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"},gift_card_batch:{$ref:"#/components/schemas/GiftCardBatch"},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}}},required:["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":!0},ImportMapping:{type:"object",properties:{id:{type:"string"},schema_field:{type:"string"},file_column:{type:"string",nullable:!0},required:{type:"boolean"}},required:["id","schema_field","file_column","required"],"x-typelizer":!0},ImportRow:{type:"object",properties:{id:{type:"string"},row_number:{type:"number"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},validation_errors:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},import_id:{type:"string",nullable:!0},item_type:{type:"string",nullable:!0},item_id:{type:"string",nullable:!0},data:{type:"object"}},required:["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":!0},Import:{type:"object",properties:{id:{type:"string"},number:{type:"string"},rows_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",nullable:!0,description:"Import type. Built-in: products, product_translations, customers, price_list_prices. Extensions may register more."},status:{anyOf:[{type:"string",enum:["pending","mapping","completed_mapping","processing","completed","failed"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},store_id:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},owner_type:{type:"string",nullable:!0},owner_id:{type:"string",nullable:!0},user_id:{type:"string",nullable:!0},processing_errors:{type:"string",nullable:!0},preferred_delimiter:{type:"string"},price_list_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},original_filename:{type:"string",nullable:!0},original_byte_size:{type:"number",nullable:!0},original_file_url:{type:"string",nullable:!0},completed_rows_count:{type:"number"},failed_rows_count:{type:"number"},schema_fields:{type:"array",items:{$ref:"#/components/schemas/ImportSchemaField"}},csv_headers:{type:"array",items:{type:"string"}},sample_row:{type:"object"},mappings:{type:"array",items:{$ref:"#/components/schemas/ImportMapping"}}},required:["id","number","rows_count","created_at","updated_at","type","status","store_id","seller_id","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","price_list_id","seller_name","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":!0},Integration:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Integration type, registered by the provider gem that owns it (for example the EasyPost provider). Core ships none."},group:{type:"string",nullable:!0},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":!0},InvitationAcceptanceLink:{type:"object",properties:{id:{type:"string"},acceptance_url:{type:"string"}},required:["id","acceptance_url"],"x-typelizer":!0},Invitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},created_at:{type:"string"},updated_at:{type:"string"},expires_at:{type:"string"},role_id:{type:"string"},role_name:{type:"string"},inviter_email:{type:"string"},invitee_exists:{type:"boolean"},store:{type:"object"}},required:["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","invitee_exists","store"],"x-typelizer":!0},LineItem:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string"},seller_id:{type:"string",nullable:!0},preorder:{type:"boolean"},preorder_ships_at:{type:"string",nullable:!0},quantity:{type:"number"},currency:{type:"string"},name:{type:"string"},slug:{type:"string"},options_text:{type:"string"},price:{type:"string"},display_price:{type:"string"},total:{type:"string"},display_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},discounted_amount:{type:"string"},display_discounted_amount:{type:"string"},display_compare_at_amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},digital_links:{type:"array",items:{$ref:"#/components/schemas/DigitalLink"}},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}},metadata:{type:"object"},price_source:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},catalog_price:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},price_list_name:{type:"string",nullable:!0},catalog_id:{type:"string",nullable:!0},catalog_name:{type:"string",nullable:!0},cost_price:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},tax_category:{$ref:"#/components/schemas/TaxCategory"}},required:["id","variant_id","seller_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","price_source","created_at","updated_at","catalog_price","price_list_id","price_list_name","catalog_id","catalog_name","cost_price","tax_category_id"],"x-typelizer":!0},Market:{type:"object",properties:{id:{type:"string"},name:{type:"string"},currency:{type:"string"},default_locale:{type:"string"},tax_inclusive:{type:"boolean"},default:{type:"boolean"},country_codes:{type:"array",items:{type:"string"}},country_isos:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},created_at:{type:"string"},updated_at:{type:"string"},tax_provider:{type:"string",nullable:!0,description:"Tax provider; null uses the store default. Built-in: internal. Provider gems register more."}},required:["id","name","currency","default_locale","tax_inclusive","default","country_codes","country_isos","supported_locales","created_at","updated_at","tax_provider"],"x-typelizer":!0},Media:{type:"object",properties:{id:{type:"string"},product_id:{type:"string",nullable:!0},variant_ids:{type:"array",items:{type:"string"}},position:{type:"number"},alt:{type:"string",nullable:!0},media_type:{type:"string",enum:["image","video","external_video"]},focal_point_x:{type:"number",nullable:!0},focal_point_y:{type:"number",nullable:!0},external_video_url:{type:"string",nullable:!0},video_provider:{type:"string",nullable:!0},video_embed_url:{type:"string",nullable:!0},video_url:{type:"string",nullable:!0},poster_url:{type:"string",nullable:!0},original_url:{type:"string",nullable:!0},mini_url:{type:"string",nullable:!0},small_url:{type:"string",nullable:!0},medium_url:{type:"string",nullable:!0},large_url:{type:"string",nullable:!0},xlarge_url:{type:"string",nullable:!0},og_image_url:{type:"string",nullable:!0},external_references:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},attached:{type:"boolean"},filename:{type:"string",nullable:!0},content_type:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},embed_url:{type:"string",nullable:!0},signed_id:{type:"string",nullable:!0},viewable_id:{type:"string",nullable:!0},download_url:{type:"string",nullable:!0},metadata:{type:"object"},viewable_type:{type:"string",nullable:!0}},required:["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","video_provider","video_embed_url","video_url","poster_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","external_references","created_at","updated_at","attached","filename","content_type","byte_size","embed_url","signed_id","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":!0},MembershipProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0}},required:["id","name","thumbnail_url"],"x-typelizer":!0},NewsletterSubscriber:{type:"object",properties:{id:{type:"string"},email:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},verified:{type:"boolean"},verified_at:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0}},required:["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":!0},OptionType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},kind:{type:"string",enum:["dropdown","color_swatch","buttons"]},translations:{type:"object"},metadata:{type:"object"},filterable:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":!0},OptionValue:{type:"object",properties:{id:{type:"string"},option_type_id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},color_code:{type:"string",nullable:!0},option_type_name:{type:"string"},option_type_label:{type:"string"},image_url:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},option_type:{$ref:"#/components/schemas/OptionType"}},required:["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":!0},OrderCancellationReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},OrderGroup:{type:"object",properties:{id:{type:"string"},number:{type:"string"},email:{type:"string",nullable:!0},currency:{type:"string"},total:{type:"string",nullable:!0},display_total:{type:"string",nullable:!0},item_total:{type:"string",nullable:!0},display_item_total:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},seller_count:{type:"number"},includes_first_party:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}}},required:["id","number","email","currency","total","display_total","item_total","display_item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","confirmation_delivered","store_owner_notification_delivered","created_at","updated_at","payments"],"x-typelizer":!0},OrderRoutingRule:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: preferred_location, default_location, minimize_splits. Extensions may register more."},channel_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema"],"x-typelizer":!0},Order:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},withdrawal_period_ends_at:{type:"string",nullable:!0},within_withdrawal_period:{type:"boolean"},cart_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},company_id:{type:"string",nullable:!0},company_name:{type:"string",nullable:!0},po_document_filename:{type:"string",nullable:!0},po_document_byte_size:{type:"number",nullable:!0},number:{type:"string"},email:{type:"string"},customer_note:{type:"string",nullable:!0},po_number:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},coupon_code:{type:"string",nullable:!0},fulfillment_status:{type:"string",nullable:!0,enum:["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},payment_status:{type:"string",nullable:!0,enum:["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},completed_at:{type:"string",nullable:!0},item_total:{type:"string"},display_item_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},total:{type:"string"},display_total:{type:"string"},gift_card_total:{type:"string"},display_gift_card_total:{type:"string"},amount_due:{type:"string"},display_amount_due:{type:"string"},delivery_total:{type:"string"},display_delivery_total:{type:"string"},fee_total:{type:"string"},display_fee_total:{type:"string"},store_credit_total:{type:"string"},display_store_credit_total:{type:"string"},covered_by_store_credit:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},fulfillments:{type:"array",items:{$ref:"#/components/schemas/Fulfillment"}},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},gift_card:{allOf:[{$ref:"#/components/schemas/GiftCard"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},external_references:{type:"object"},status:{type:"string",enum:["draft","placed","canceled"]},last_ip_address:{type:"string",nullable:!0},considered_risky:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},payment_total:{type:"string"},display_payment_total:{type:"string"},metadata:{type:"object"},cancel_note:{type:"string",nullable:!0},commission_amount_total:{type:"string"},display_commission_amount_total:{type:"string"},commission_tax_total:{type:"string"},display_commission_tax_total:{type:"string"},commission_total:{type:"string"},display_commission_total:{type:"string"},canceled_at:{type:"string",nullable:!0},approved_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_stock_location_id:{type:"string",nullable:!0},po_document_url:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},order_group_id:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},internal_note_html:{type:"string",nullable:!0},approver_id:{type:"string",nullable:!0},approver_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},approver:{$ref:"#/components/schemas/Actor"},canceler_id:{type:"string",nullable:!0},canceler_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},canceler:{$ref:"#/components/schemas/Actor"},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},cancel_reason_id:{type:"string",nullable:!0},cancel_reason_name:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},applied_promotions:{type:"array",items:{$ref:"#/components/schemas/AppliedPromotion"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}},cart:{$ref:"#/components/schemas/Cart"},channel:{$ref:"#/components/schemas/Channel"},preferred_stock_location:{$ref:"#/components/schemas/StockLocation"},payment_methods:{type:"array",items:{$ref:"#/components/schemas/PaymentMethod"}},customer:{$ref:"#/components/schemas/Customer"},cancel_reason:{$ref:"#/components/schemas/OrderCancellationReason"},returns:{type:"array",items:{$ref:"#/components/schemas/Return"}},exchanges:{type:"array",items:{$ref:"#/components/schemas/Exchange"}},claims:{type:"array",items:{$ref:"#/components/schemas/Claim"}},freight_summary:{allOf:[{$ref:"#/components/schemas/FreightSummary"}],nullable:!0}},required:["id","market_id","withdrawal_period_ends_at","within_withdrawal_period","cart_id","channel_id","company_id","company_name","po_document_filename","po_document_byte_size","number","email","customer_note","po_number","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","external_references","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","cancel_note","commission_amount_total","display_commission_amount_total","commission_tax_total","display_commission_tax_total","commission_total","display_commission_total","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","po_document_url","seller_id","order_group_id","tags","internal_note","internal_note_html","approver_id","approver_type","canceler_id","canceler_type","created_by_id","created_by_type","cancel_reason_id","cancel_reason_name","customer_id","freight_summary"],"x-typelizer":!0},PackageType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},kind:{type:"string",enum:["box","envelope","carton","pallet","container"]},length:{type:"string",nullable:!0},width:{type:"string",nullable:!0},height:{type:"string",nullable:!0},weight:{type:"string",nullable:!0},max_weight:{type:"string",nullable:!0},default:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},volume:{type:"string",nullable:!0},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0}},required:["id","name","kind","length","width","height","weight","max_weight","default","metadata","created_at","updated_at","dimensions_unit","weight_unit","volume","seller_id","seller_name"],"x-typelizer":!0},PaymentMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},type:{type:"string",description:"Payment method type. Built-in: check, store_credit, custom_payment_source_method, bogus (test only); payment provider gems register their own, for example stripe."},session_required:{type:"boolean"},source_required:{type:"boolean"},metadata:{type:"object"},active:{type:"boolean"},auto_capture:{type:"boolean",nullable:!0},capture_method:{type:"string",enum:["checkout","on_dispatch","manual"],nullable:!0},resolved_capture_method:{type:"string",enum:["checkout","on_dispatch","manual"]},storefront_visible:{type:"boolean"},position:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","description","type","session_required","source_required","metadata","active","auto_capture","capture_method","resolved_capture_method","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":!0},Payment:{type:"object",properties:{id:{type:"string"},payment_method_id:{type:"string"},response_code:{type:"string",nullable:!0},number:{type:"string"},status:{anyOf:[{type:"string",enum:["checkout","processing","pending","completed","failed","void","invalid"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},amount:{type:"string"},display_amount:{type:"string"},source_type:{type:"string",nullable:!0,enum:["credit_card","store_credit","payment_source"]},source_id:{type:"string",nullable:!0},source:{anyOf:[{$ref:"#/components/schemas/CreditCard"},{$ref:"#/components/schemas/StoreCredit"},{$ref:"#/components/schemas/PaymentSource"}],nullable:!0},payment_method:{$ref:"#/components/schemas/PaymentMethod"},metadata:{type:"object"},avs_response:{type:"string",nullable:!0},cvv_response_code:{type:"string",nullable:!0},cvv_response_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},captured_amount:{type:"string"},order_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},payment_splits:{type:"array",items:{$ref:"#/components/schemas/PaymentSplit"}}},required:["id","payment_method_id","response_code","number","status","amount","display_amount","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":!0},PaymentSource:{type:"object",properties:{id:{type:"string"},gateway_payment_profile_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":!0},PaymentSplit:{type:"object",properties:{id:{type:"string"},currency:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},authorized_amount:{type:"string"},display_authorized_amount:{type:"string"},captured_amount:{type:"string"},display_captured_amount:{type:"string"},refunded_amount:{type:"string"},display_refunded_amount:{type:"string"},claimed_amount:{type:"string"},display_claimed_amount:{type:"string"},net_captured_amount:{type:"string"},display_net_captured_amount:{type:"string"},refundable_amount:{type:"string"},display_refundable_amount:{type:"string"},payment_id:{type:"string"},payment_number:{type:"string",nullable:!0},order_id:{type:"string"},order_number:{type:"string",nullable:!0}},required:["id","currency","created_at","updated_at","authorized_amount","display_authorized_amount","captured_amount","display_captured_amount","refunded_amount","display_refunded_amount","claimed_amount","display_claimed_amount","net_captured_amount","display_net_captured_amount","refundable_amount","display_refundable_amount","payment_id","payment_number","order_id","order_number"],"x-typelizer":!0},Permission:{type:"object",properties:{key:{type:"string"},resource:{type:"string"},kind:{type:"string",enum:["read","write"]},group:{type:"string"},group_label:{type:"string"},label:{type:"string"},description:{type:"string"}},required:["key","resource","kind","group","group_label","label","description"],"x-typelizer":!0},Policy:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},body:{type:"string",nullable:!0},body_html:{type:"string",nullable:!0},updated_at:{type:"string"},created_at:{type:"string"}},required:["id","name","slug","body","body_html","updated_at","created_at"],"x-typelizer":!0},PriceAdjustmentTier:{type:"object",properties:{id:{type:"string"},min_quantity:{type:"number"},percentage:{type:"string"}},required:["id","min_quantity","percentage"],"x-typelizer":!0},PriceHistory:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_in_cents:{type:"number"},currency:{type:"string"},display_amount:{type:"string"},recorded_at:{type:"string"},variant_id:{type:"string"},price_id:{type:"string"},compare_at_amount:{type:"string",nullable:!0},created_at:{type:"string"}},required:["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":!0},PriceListProduct:{type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail_url:{type:"string",nullable:!0},price_list_variants:{type:"array",items:{$ref:"#/components/schemas/CatalogPrice"}}},required:["id","name","thumbnail_url"],"x-typelizer":!0},PriceList:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["draft","active","inactive","scheduled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},position:{type:"number"},match_policy:{type:"string",enum:["all","any"]},adjust_compare_at:{type:"boolean"},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},price_adjustment_percentage:{type:"string",nullable:!0},automatic_pricing:{type:"boolean"},currently_active:{type:"boolean"},products_count:{type:"number"},prices_count:{type:"number"},price_adjustment_tiers:{type:"array",items:{$ref:"#/components/schemas/PriceAdjustmentTier"}},price_rules:{type:"array",items:{$ref:"#/components/schemas/PriceRule"}}},required:["id","name","description","status","position","match_policy","adjust_compare_at","starts_at","ends_at","deleted_at","created_at","updated_at","price_adjustment_percentage","automatic_pricing","currently_active","products_count","prices_count","price_adjustment_tiers"],"x-typelizer":!0},PriceRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: channel_rule, customer_group_rule, market_rule, user_rule, volume_rule, zone_rule. Extensions may register more."},price_list_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","created_at","updated_at","type","price_list_id","preferences","preference_schema"],"x-typelizer":!0},Price:{type:"object",properties:{id:{type:"string"},amount:{type:"string",nullable:!0},amount_in_cents:{type:"number",nullable:!0},compare_at_amount:{type:"string",nullable:!0},compare_at_amount_in_cents:{type:"number",nullable:!0},currency:{type:"string",nullable:!0},display_amount:{type:"string",nullable:!0},display_compare_at_amount:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},min_quantity:{type:"number"},variant_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","min_quantity","variant_id","created_at","updated_at"],"x-typelizer":!0},ProductPublication:{type:"object",properties:{id:{type:"string"},published_at:{type:"string",nullable:!0},unpublished_at:{type:"string",nullable:!0},product_id:{type:"string"},channel_id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":!0},Product:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},variant_count:{type:"number"},available_on:{type:"string",nullable:!0},preorder_ships_at:{type:"string",nullable:!0},purchasable:{type:"boolean"},preorder:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},available:{type:"boolean"},description:{type:"string",nullable:!0},description_html:{type:"string",nullable:!0},default_variant_id:{type:"string"},buy_box_variant_id:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},variants:{type:"array",items:{$ref:"#/components/schemas/Variant"}},default_variant:{$ref:"#/components/schemas/Variant"},option_types:{type:"array",items:{$ref:"#/components/schemas/OptionType"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},translations:{type:"object"},status:{anyOf:[{type:"string",enum:["draft","active","archived","proposed","rejected"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},metadata:{type:"object"},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},submission:{allOf:[{$ref:"#/components/schemas/ProductSubmission"}],nullable:!0},seller_name:{type:"string",nullable:!0},product_type_id:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},digital_assets:{type:"array",items:{$ref:"#/components/schemas/DigitalAsset"}},collections:{type:"array",items:{$ref:"#/components/schemas/Collection"}},product_publications:{type:"array",items:{$ref:"#/components/schemas/ProductPublication"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},product_type:{$ref:"#/components/schemas/ProductType"}},required:["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","buy_box_variant_id","thumbnail_url","tags","price","original_price","seller_id","external_references","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","seller_name","product_type_id","tax_category_id"],"x-typelizer":!0},ProductSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","approved","rejected","withdrawn"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},review_note:{type:"string",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},product_id:{type:"string"},metadata:{type:"object",nullable:!0},updated_at:{type:"string"},submitted_by_id:{type:"string",nullable:!0},reviewed_by_id:{type:"string",nullable:!0},reviewed_by_name:{type:"string",nullable:!0},auto_approved:{type:"boolean"}},required:["id","status","review_note","reviewed_at","created_at","product_id","metadata","updated_at","submitted_by_id","reviewed_by_id","reviewed_by_name","auto_approved"],"x-typelizer":!0},ProductTypeCustomFieldDefinition:{type:"object",properties:{id:{type:"string"},key:{type:"string"},namespace:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},required:{type:"boolean"},sort_order:{type:"number"}},required:["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":!0},ProductType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},translations:{type:"object"},products_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},option_type_ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}},custom_field_definitions:{type:"array",items:{$ref:"#/components/schemas/ProductTypeCustomFieldDefinition"}}},required:["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":!0},PromotionAction:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Action type. Built-in: create_adjustment, create_item_adjustments, create_line_items, free_shipping. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},calculator:{allOf:[{$ref:"#/components/schemas/PromotionActionCalculator"}],nullable:!0},line_items:{type:"array",items:{$ref:"#/components/schemas/PromotionActionLineItem"},nullable:!0}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","calculator","line_items"],"x-typelizer":!0},PromotionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string",description:"Rule type. Built-in: currency, country, channel, market, item_total, product, customer, customer_group, first_order, customer_logged_in, one_use_per_user, category, option_value. Extensions may register more."},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},product_ids:{type:"array",items:{type:"string"},nullable:!0},category_ids:{type:"array",items:{type:"string"},nullable:!0},customer_ids:{type:"array",items:{type:"string"},nullable:!0},option_value_ids:{type:"array",items:{type:"string"},nullable:!0},products:{type:"array",items:{$ref:"#/components/schemas/Product"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","product_ids","category_ids","customer_ids","option_value_ids"],"x-typelizer":!0},Promotion:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},usage_limit:{type:"number",nullable:!0},match_policy:{type:"string",enum:["all","any"]},path:{type:"string",nullable:!0},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"number",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},action_ids:{type:"array",items:{type:"string"}},rule_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":!0},PurchaseOrderItem:{type:"object",properties:{id:{type:"string"},quantity_ordered:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},currency:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},unit_cost:{type:"string"},total_cost:{type:"string"},display_unit_cost:{type:"string"},display_total_cost:{type:"string"},purchase_order_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_ordered","quantity_received","quantity_rejected","quantity_over","outstanding","currency","created_at","updated_at","unit_cost","total_cost","display_unit_cost","display_total_cost","purchase_order_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},PurchaseOrder:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{type:"string"},currency:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},ordered_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},expected_at:{type:"string",nullable:!0},cancel_by:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_ordered_total:{type:"number"},editable:{type:"boolean"},subtotal:{type:"string"},display_subtotal:{type:"string"},supplier_id:{type:"string",nullable:!0},destination_location_id:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/PurchaseOrderItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},supplier:{$ref:"#/components/schemas/Supplier"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","status","currency","reference","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","ordered_at","received_at","closed_short_at","created_at","updated_at","expected_at","cancel_by","closed_short","quantity_ordered_total","editable","subtotal","display_subtotal","supplier_id","destination_location_id"],"x-typelizer":!0},RefundReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Refund:{type:"object",properties:{id:{type:"string"},transaction_id:{type:"string",nullable:!0},amount:{type:"string",nullable:!0},payment_id:{type:"string",nullable:!0},refund_reason_id:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},tax_amount:{type:"string"},refunder_id:{type:"string",nullable:!0},refunder_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},refunder:{$ref:"#/components/schemas/Actor"},payment:{$ref:"#/components/schemas/Payment"}},required:["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at","tax_amount","refunder_id","refunder_type"],"x-typelizer":!0},ReturnLineItem:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},received_quantity:{type:"number"},resellable:{type:"boolean"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},included_tax_total:{type:"string"},additional_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},refund_amount:{type:"string"},display_refund_amount:{type:"string"},variant_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_item_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},created_at:{type:"string"},updated_at:{type:"string"},line_item:{$ref:"#/components/schemas/LineItem"},tax_lines:{type:"array",items:{$ref:"#/components/schemas/TaxLine"}}},required:["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","included_tax_total","additional_tax_total","tax_total","display_tax_total","refund_amount","display_refund_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":!0},ReturnReason:{type:"object",properties:{id:{type:"string"},name:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},can_be_deleted:{type:"boolean"}},required:["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":!0},Return:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{anyOf:[{type:"string",enum:["requested","approved","received","refunded","canceled"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},order_id:{type:"string",nullable:!0},reason_id:{type:"string",nullable:!0},refund_total:{type:"string"},display_refund_total:{type:"string"},refund_tax_total:{type:"string"},display_refund_tax_total:{type:"string"},approved_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},refunded_at:{type:"string",nullable:!0},canceled_at:{type:"string",nullable:!0},reason:{$ref:"#/components/schemas/ReturnReason"},return_line_items:{type:"array",items:{$ref:"#/components/schemas/ReturnLineItem"}},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},stock_location_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},created_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},created_by:{$ref:"#/components/schemas/Actor"},refunded_total:{type:"string"},display_refunded_total:{type:"string"},refundable_total:{type:"string"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}},documents:{type:"object"},labels:{type:"array",items:{$ref:"#/components/schemas/ShippingLabel"}},deliveries:{type:"array",items:{$ref:"#/components/schemas/Delivery"}}},required:["id","number","status","order_id","reason_id","refund_total","display_refund_total","refund_tax_total","display_refund_tax_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type","refunded_total","display_refunded_total","refundable_total","documents","labels","deliveries"],"x-typelizer":!0},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},permissions:{type:"array",items:{type:"string"}},mutable:{type:"boolean"},users_count:{type:"number"}},required:["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":!0},SavedReport:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},query:{type:"object"},seeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},user_id:{type:"string",nullable:!0},author_name:{type:"string",nullable:!0}},required:["id","name","description","query","seeded","created_at","updated_at","user_id","author_name"],"x-typelizer":!0},SellerBalance:{type:"object",properties:{currency:{type:"string"},settlement_currency:{type:"string"},converted:{type:"boolean"},seller_id:{type:"string"},earned:{type:"string"},display_earned:{type:"string"},payable:{type:"string"},display_payable:{type:"string"},paid:{type:"string"},display_paid:{type:"string"},balance:{type:"string"},display_balance:{type:"string"},pending:{type:"string"},display_pending:{type:"string"}},required:["currency","settlement_currency","converted","seller_id","earned","display_earned","payable","display_payable","paid","display_paid","balance","display_balance","pending","display_pending"],"x-typelizer":!0},SellerPayout:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},reference:{type:"string",nullable:!0},metadata:{type:"object"},period_start:{type:"string",nullable:!0},period_end:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},seller_id:{type:"string"},seller_name:{type:"string",nullable:!0},transfers_count:{type:"number"},provider:{type:"string",description:"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},required:["id","status","currency","reference","metadata","period_start","period_end","created_at","updated_at","amount","display_amount","seller_id","seller_name","transfers_count","provider"],"x-typelizer":!0},SellerRequirement:{type:"object",properties:{id:{type:"string"},position:{type:"number"},active:{type:"boolean"},required:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},preferences:{type:"object"},custom_field_definition_ids:{type:"array",items:{type:"string"}},allow_multiple:{type:"boolean"},accepts_submissions:{type:"boolean"},reviewed_by_operator:{type:"boolean"}},required:["id","position","active","required","metadata","created_at","updated_at","kind","name","description","preferences","custom_field_definition_ids","allow_multiple","accepts_submissions","reviewed_by_operator"],"x-typelizer":!0},SellerRequirementStatus:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},name:{type:"string"},description:{type:"string",nullable:!0},required:{type:"boolean"},position:{type:"number"},status:{type:"string",enum:["complete","incomplete","pending","rejected"]},action_url:{type:"string",nullable:!0},blocker:{type:"object",nullable:!0},blocking:{type:"boolean"},required_policy_name:{type:"string",nullable:!0},submission:{$ref:"#/components/schemas/SellerRequirementSubmission"},published_policy:{$ref:"#/components/schemas/Policy"}},required:["id","kind","name","description","required","position","status","action_url","blocker","blocking","required_policy_name"],"x-typelizer":!0},SellerRequirementSubmission:{type:"object",properties:{id:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","accepted","rejected","waived"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},note:{type:"string",nullable:!0},review_note:{type:"string",nullable:!0},reference:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},reviewed_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string"},requirement_id:{type:"string"},requirement_name:{type:"string"},file_url:{type:"string",nullable:!0},file_name:{type:"string",nullable:!0}},required:["id","status","note","review_note","reference","metadata","reviewed_at","created_at","updated_at","seller_id","requirement_id","requirement_name","file_url","file_name"],"x-typelizer":!0},Seller:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},about:{type:"string"},about_html:{type:"string"},logo_url:{type:"string",nullable:!0},square_logo_url:{type:"string",nullable:!0},cover_photo_url:{type:"string",nullable:!0},status:{anyOf:[{type:"string",enum:["pending","invited","canceled","onboarding","ready_for_review","approved","rejected","suspended"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},contact_email:{type:"string",nullable:!0},billing_email:{type:"string",nullable:!0},tax_remittance:{type:"string"},payouts_schedule_interval:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},holiday_mode_until:{type:"string",nullable:!0},terms_accepted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},minimum_payout_amount:{type:"string",nullable:!0},on_holiday:{type:"boolean"},sellable:{type:"boolean"},products_count:{type:"number"},users_count:{type:"number"},onboarding_progress:{type:"object"},onboarding_complete:{type:"boolean"},legal_name:{type:"string",nullable:!0},registration_number:{type:"string",nullable:!0},billing_address:{$ref:"#/components/schemas/Address"},returns_address:{$ref:"#/components/schemas/Address"}},required:["id","name","slug","about","about_html","logo_url","square_logo_url","cover_photo_url","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","on_holiday","sellable","products_count","users_count","onboarding_progress","onboarding_complete","legal_name","registration_number"],"x-typelizer":!0},SellerTeamMember:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},avatar_url:{type:"string",nullable:!0}},required:["id","email","first_name","last_name","full_name","created_at","updated_at","avatar_url"],"x-typelizer":!0},SellerTransfer:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["earning","refund_reversal"]},status:{anyOf:[{type:"string",enum:["pending","processing","completed","failed","unresolved"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},currency:{type:"string"},reference:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},settled_amount:{type:"string",nullable:!0},settled_currency:{type:"string",nullable:!0},converted:{type:"boolean"},seller_id:{type:"string"},order_id:{type:"string",nullable:!0},payout_id:{type:"string",nullable:!0},reversed_from_id:{type:"string",nullable:!0},refund_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0},provider:{type:"string",description:"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},required:["id","kind","status","currency","reference","metadata","created_at","updated_at","amount","display_amount","settled_amount","settled_currency","converted","seller_id","order_id","payout_id","reversed_from_id","refund_id","seller_name","order_number","provider"],"x-typelizer":!0},SetupTask:{type:"object",properties:{name:{type:"string"},done:{type:"boolean"}},required:["name","done"],"x-typelizer":!0},ShippingLabel:{type:"object",properties:{id:{type:"string"},source:{type:"string",enum:["purchased","uploaded"]},status:{anyOf:[{type:"string",enum:["purchased","refund_requested","refunded"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},carrier:{type:"string",nullable:!0},carrier_name:{type:"string",nullable:!0},service:{type:"string",nullable:!0},tracking_number:{type:"string",nullable:!0},currency:{type:"string",nullable:!0},format:{type:"string",nullable:!0},external_id:{type:"string",nullable:!0},metadata:{type:"object"},refunded_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},owner_id:{type:"string"},owner_type:{type:"string",enum:["fulfillment","return"]},cost:{type:"string"},display_cost:{type:"string"},integration_id:{type:"string",nullable:!0},file_pending:{type:"boolean"},download_url:{type:"string",nullable:!0}},required:["id","source","status","carrier","carrier_name","service","tracking_number","currency","format","external_id","metadata","refunded_at","created_at","updated_at","owner_id","owner_type","cost","display_cost","integration_id","file_pending","download_url"],"x-typelizer":!0},State:{type:"object",properties:{abbr:{type:"string"},name:{type:"string"}},required:["abbr","name"],"x-typelizer":!0},StockLevel:{type:"object",properties:{id:{type:"string"},count_on_hand:{type:"number"},backorderable:{type:"boolean"},stock_location_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},external_references:{type:"object"},metadata:{type:"object"},reserved_count:{type:"number"},incoming_count:{type:"number"},purchasable_count:{type:"number"},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_location_name:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},allocated_count:{type:"number"},available_count:{type:"number"},stock_location:{$ref:"#/components/schemas/StockLocation"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","count_on_hand","backorderable","stock_location_id","variant_id","external_references","metadata","reserved_count","incoming_count","purchasable_count","variant_name","variant_sku","created_at","updated_at","stock_location_name","product_id","options_text","thumbnail_url","allocated_count","available_count"],"x-typelizer":!0},StockLocation:{type:"object",properties:{id:{type:"string"},name:{type:"string"},address1:{type:"string",nullable:!0},city:{type:"string",nullable:!0},zipcode:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},state_text:{type:"string",nullable:!0},pickup_ready_in_minutes:{type:"number",nullable:!0},pickup_instructions:{type:"string",nullable:!0},external_references:{type:"object"},admin_name:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},active:{type:"boolean"},default:{type:"boolean"},backorderable_default:{type:"boolean"},propagate_all_variants:{type:"boolean"},kind:{anyOf:[{type:"string",enum:["warehouse","store","fulfillment_center"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},pickup_enabled:{type:"boolean"},pickup_stock_policy:{type:"string",enum:["local","any"]},returns_enabled:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},seller_id:{type:"string",nullable:!0},seller_name:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"}},required:["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","external_references","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","returns_enabled","created_at","updated_at","seller_id","seller_name"],"x-typelizer":!0},StockMovement:{type:"object",properties:{id:{type:"string"},quantity:{type:"number"},kind:{type:"string",nullable:!0,enum:["received","allocated","shipped","released","adjusted"]},reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},stock_level_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},stock_location_name:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},return_id:{type:"string",nullable:!0},exchange_id:{type:"string",nullable:!0},stock_transfer_id:{type:"string",nullable:!0},stock_receipt_id:{type:"string",nullable:!0},purchase_order_id:{type:"string",nullable:!0},order_number:{type:"string",nullable:!0},return_number:{type:"string",nullable:!0},exchange_number:{type:"string",nullable:!0},stock_transfer_number:{type:"string",nullable:!0},purchase_order_number:{type:"string",nullable:!0},unit_cost:{type:"string",nullable:!0},display_unit_cost:{type:"string",nullable:!0}},required:["id","quantity","kind","reason","created_at","updated_at","stock_level_id","stock_location_id","stock_location_name","variant_id","variant_name","variant_sku","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id","stock_receipt_id","purchase_order_id","order_number","return_number","exchange_number","stock_transfer_number","purchase_order_number","unit_cost","display_unit_cost"],"x-typelizer":!0},StockReceiptItem:{type:"object",properties:{id:{type:"string"},quantity_accepted:{type:"number"},quantity_rejected:{type:"number"},rejection_reason:{type:"string",nullable:!0,enum:["damaged","wrong_item","expired","other"]},notes:{type:"string",nullable:!0},line_type:{type:"string",enum:["purchase_order_item","stock_transfer_item"]},line_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_accepted","quantity_rejected","rejection_reason","notes","line_type","line_id","variant_id","product_id","variant_name","variant_sku","thumbnail_url"],"x-typelizer":!0},StockReceipt:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},metadata:{type:"object"},quantity_accepted_total:{type:"number"},quantity_rejected_total:{type:"number"},received_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},receivable_type:{type:"string",enum:["purchase_order","stock_transfer"]},receivable_id:{type:"string"},received_by_id:{type:"string",nullable:!0},received_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},received_by:{$ref:"#/components/schemas/Actor"},items_count:{type:"number"},items:{type:"array",items:{$ref:"#/components/schemas/StockReceiptItem"}}},required:["id","number","reference","notes","metadata","quantity_accepted_total","quantity_rejected_total","received_at","created_at","updated_at","receivable_type","receivable_id","received_by_id","received_by_type","items_count"],"x-typelizer":!0},StockReservation:{type:"object",properties:{id:{type:"string"},stock_level_id:{type:"string"},line_item_id:{type:"string"},order_id:{type:"string"},variant_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},quantity:{type:"number"},expires_at:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","stock_level_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":!0},StockTransferItem:{type:"object",properties:{id:{type:"string"},quantity_shipped:{type:"number"},quantity_received:{type:"number"},quantity_rejected:{type:"number"},quantity_over:{type:"number"},outstanding:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},stock_transfer_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},product_id:{type:"string",nullable:!0},variant_name:{type:"string",nullable:!0},variant_sku:{type:"string",nullable:!0},options_text:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0}},required:["id","quantity_shipped","quantity_received","quantity_rejected","quantity_over","outstanding","created_at","updated_at","stock_transfer_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":!0},StockTransfer:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},source_location_id:{type:"string"},destination_location_id:{type:"string"},status:{type:"string"},notes:{type:"string",nullable:!0},metadata:{type:"object"},close_reason:{type:"string",nullable:!0},items_count:{type:"number"},quantity_received_total:{type:"number"},quantity_rejected_total:{type:"number"},shipped_at:{type:"string",nullable:!0},received_at:{type:"string",nullable:!0},closed_short_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},closed_short:{type:"boolean"},quantity_shipped_total:{type:"number"},editable:{type:"boolean"},items:{type:"array",items:{$ref:"#/components/schemas/StockTransferItem"}},stock_receipts:{type:"array",items:{$ref:"#/components/schemas/StockReceipt"}},source_location:{$ref:"#/components/schemas/StockLocation"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","reference","created_at","updated_at","source_location_id","destination_location_id","status","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","shipped_at","received_at","closed_short_at","deleted_at","closed_short","quantity_shipped_total","editable"],"x-typelizer":!0},StoreCreditEvent:{type:"object",properties:{id:{type:"string"},action:{type:"string"},authorization_code:{type:"string",nullable:!0},display_action:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},store_credit_id:{type:"string"},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0}},required:["id","action","authorization_code","display_action","amount","display_amount","created_at","updated_at","store_credit_id","originator_type","originator_id"],"x-typelizer":!0},StoreCredit:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},currency:{type:"string"},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},amount_authorized:{type:"string"},outstanding:{type:"boolean"},display_amount_authorized:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},originator_type:{type:"string",nullable:!0},originator_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"}},required:["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","amount_authorized","outstanding","display_amount_authorized","customer_id","created_by_id","originator_type","originator_id"],"x-typelizer":!0},Store:{type:"object",properties:{id:{type:"string"},metadata:{type:"object"},name:{type:"string"},code:{type:"string"},preferred_storefront_url:{type:"string",nullable:!0},default_currency:{type:"string"},default_locale:{type:"string"},default_country_code:{type:"string",nullable:!0},mail_from_address:{type:"string",nullable:!0},customer_support_email:{type:"string",nullable:!0},new_order_notifications_email:{type:"string",nullable:!0},preferred_send_consumer_transactional_emails:{type:"boolean"},preferred_email_accent_color:{type:"string",nullable:!0},preferred_email_background_color:{type:"string",nullable:!0},preferred_email_card_color:{type:"string",nullable:!0},preferred_email_text_color:{type:"string",nullable:!0},preferred_email_heading_color:{type:"string",nullable:!0},preferred_email_font:{type:"string",nullable:!0,enum:["inter","system","helvetica","georgia","roboto","lato","merriweather"]},preferred_admin_locale:{type:"string",nullable:!0},preferred_timezone:{type:"string"},preferred_weight_unit:{type:"string",enum:["g","kg","lb","oz"]},preferred_unit_system:{type:"string"},preferred_storefront_access:{type:"string"},preferred_guest_checkout:{type:"boolean"},preferred_always_include_confirm_step:{type:"boolean"},preferred_company_field_enabled:{type:"boolean"},preferred_address_requires_company:{type:"boolean"},preferred_address_requires_phone:{type:"boolean"},preferred_capture_method:{type:"string"},preferred_track_inventory_levels:{type:"boolean"},preferred_stock_reservations_enabled:{type:"boolean"},preferred_low_stock_threshold:{type:"number"},preferred_tax_using_ship_address:{type:"boolean"},preferred_track_price_history:{type:"boolean"},preferred_show_products_without_price:{type:"boolean"},preferred_disable_sku_validation:{type:"boolean"},preferred_pricing_provider:{type:"string"},preferred_inventory_provider:{type:"string"},preferred_pricing_provider_failure_policy:{type:"string"},preferred_inventory_provider_failure_policy:{type:"string"},preferred_default_payouts_schedule_interval:{type:"string"},preferred_auto_approve_sellers:{type:"boolean"},preferred_auto_approve_seller_products:{type:"boolean"},preferred_send_seller_transactional_emails:{type:"boolean"},preferred_document_number_format:{type:"string"},preferred_order_number_prefix:{type:"string"},preferred_order_number_suffix:{type:"string"},preferred_order_number_sequence_start:{type:"number"},preferred_limit_digital_download_count:{type:"boolean"},preferred_digital_asset_authorized_clicks:{type:"number"},preferred_limit_digital_download_days:{type:"boolean"},preferred_digital_asset_authorized_days:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferred_order_routing_strategy:{type:"string",description:"Order routing strategy. Built-in: rules. Extensions may register more."},preferred_payout_provider:{type:"string",nullable:!0,description:"Payout provider; null uses the installation default. Built-in: system. Provider gems register more (e.g. stripe)."},order_number_sequence_started:{type:"boolean"},preferred_default_minimum_payout_amount:{type:"number"},preferred_default_commission_tax_rate:{type:"number"},url:{type:"string"},api_url:{type:"string"},setup_tasks:{type:"array",items:{$ref:"#/components/schemas/SetupTask"}},supported_currencies:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},available_locales:{type:"array",items:{type:"string"}},logo_url:{type:"string",nullable:!0},mailer_logo_url:{type:"string",nullable:!0}},required:["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","default_country_code","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_email_accent_color","preferred_email_background_color","preferred_email_card_color","preferred_email_text_color","preferred_email_heading_color","preferred_email_font","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_always_include_confirm_step","preferred_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_low_stock_threshold","preferred_tax_using_ship_address","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_pricing_provider","preferred_inventory_provider","preferred_pricing_provider_failure_policy","preferred_inventory_provider_failure_policy","preferred_default_payouts_schedule_interval","preferred_auto_approve_sellers","preferred_auto_approve_seller_products","preferred_send_seller_transactional_emails","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","preferred_limit_digital_download_count","preferred_digital_asset_authorized_clicks","preferred_limit_digital_download_days","preferred_digital_asset_authorized_days","created_at","updated_at","preferred_order_routing_strategy","preferred_payout_provider","order_number_sequence_started","preferred_default_minimum_payout_amount","preferred_default_commission_tax_rate","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":!0},Supplier:{type:"object",properties:{id:{type:"string"},name:{type:"string"},contact_name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},notes:{type:"string",nullable:!0},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},city:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},purchase_orders_count:{type:"number"},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},can_be_deleted:{type:"boolean"}},required:["id","name","contact_name","email","phone","notes","address1","address2","city","state_name","state_code","country_code","postal_code","purchase_orders_count","metadata","created_at","updated_at","deleted_at","can_be_deleted"],"x-typelizer":!0},TaxCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},tax_code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},is_default:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":!0},TaxExemptionCertificate:{type:"object",properties:{id:{type:"string"},certificate_number:{type:"string"},reason_code:{type:"string"},status:{anyOf:[{type:"string",enum:["pending","verified","expired","revoked"]},{type:"string"}],description:"The values listed are the built-in ones; extensions may add more."},issuing_authority:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},issued_at:{type:"string"},expires_at:{type:"string"},verified_at:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},company_id:{type:"string"},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},active:{type:"boolean"},lapsed:{type:"boolean"},can_be_deleted:{type:"boolean"},document_filename:{type:"string",nullable:!0},document_byte_size:{type:"number",nullable:!0},document_url:{type:"string",nullable:!0}},required:["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":!0},TaxIdentifier:{type:"object",properties:{id:{type:"string"},kind:{type:"string",description:"Tax identifier kind, keyed to a registered validator. Built-in: eu_vat. Extensions may register more."},value:{type:"string"},validation_status:{type:"string",nullable:!0,enum:["pending","verified","unverified","unavailable","unsupported"]},validation_evidence:{type:"object",nullable:!0},source:{type:"string",nullable:!0,enum:["override","company","customer"]},validated_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},validatable:{type:"boolean"},customer_id:{type:"string",nullable:!0},cart_id:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0}},required:["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"x-typelizer":!0},TaxLine:{type:"object",properties:{id:{type:"string"},label:{type:"string"},included:{type:"boolean"},credit:{type:"boolean"},rate:{type:"string"},tax_rate_id:{type:"string",nullable:!0},line_item_id:{type:"string",nullable:!0},fulfillment_id:{type:"string",nullable:!0},fee_id:{type:"string",nullable:!0},return_line_item_id:{type:"string",nullable:!0},claim_line_item_id:{type:"string",nullable:!0},exchange_line_item_id:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},provider_id:{type:"string",nullable:!0},metadata:{type:"object",nullable:!0},taxability_reason:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0},data:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},original_tax_line_id:{type:"string",nullable:!0}},required:["id","label","included","credit","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","return_line_item_id","claim_line_item_id","exchange_line_item_id","amount","display_amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at","original_tax_line_id"],"x-typelizer":!0},TaxRate:{type:"object",properties:{id:{type:"string"},name:{type:"string"},included_in_price:{type:"boolean"},show_rate_in_label:{type:"boolean"},metadata:{type:"object",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},deleted_at:{type:"string",nullable:!0},amount:{type:"string"},amount_percentage:{type:"number",nullable:!0},tax_category_id:{type:"string",nullable:!0},store_id:{type:"string",nullable:!0},country_code:{type:"string",nullable:!0},state_code:{type:"string",nullable:!0}},required:["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"x-typelizer":!0},Variant:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},sku:{type:"string",nullable:!0},options_text:{type:"string"},track_inventory:{type:"boolean"},media_count:{type:"number"},preorder_ships_at:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},preorder:{type:"boolean"},weight:{type:"number",nullable:!0},height:{type:"number",nullable:!0},width:{type:"number",nullable:!0},depth:{type:"number",nullable:!0},weight_unit:{type:"string",enum:["g","kg","lb","oz"]},dimensions_unit:{type:"string",enum:["mm","cm","in","ft"]},minimum_order_quantity:{type:"number",nullable:!0},order_multiple:{type:"number",nullable:!0},purchase_unit:{type:"string",nullable:!0,enum:["unit","carton"]},units_per_carton:{type:"number",nullable:!0},price:{$ref:"#/components/schemas/Price"},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},seller_id:{type:"string",nullable:!0},seller:{$ref:"#/components/schemas/Seller"},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},external_references:{type:"object"},metadata:{type:"object"},position:{type:"number"},cost_price:{type:"string",nullable:!0},cost_currency:{type:"string",nullable:!0},barcode:{type:"string",nullable:!0},backorder_limit:{type:"number",nullable:!0},hs_code:{type:"string",nullable:!0},country_of_origin:{type:"string",nullable:!0},customs_description:{type:"string",nullable:!0},carton_weight:{type:"string",nullable:!0},cartons_per_pallet:{type:"number",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preorderable:{type:"boolean"},tax_category_id:{type:"string",nullable:!0},carton_package_type_id:{type:"string",nullable:!0},units_per_pallet:{type:"number",nullable:!0},available_stock:{type:"number",nullable:!0},reserved_quantity:{type:"number"},total_on_hand:{type:"number",nullable:!0},product_name:{type:"string"},delivery_profile_id:{type:"string",nullable:!0},prices:{type:"array",items:{$ref:"#/components/schemas/Price"}},stock_levels:{type:"array",items:{$ref:"#/components/schemas/StockLevel"}}},required:["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","weight_unit","dimensions_unit","minimum_order_quantity","order_multiple","purchase_unit","units_per_carton","price","original_price","seller_id","option_values","external_references","metadata","position","cost_price","cost_currency","barcode","backorder_limit","hs_code","country_of_origin","customs_description","carton_weight","cartons_per_pallet","deleted_at","created_at","updated_at","preorderable","tax_category_id","carton_package_type_id","units_per_pallet","available_stock","reserved_quantity","total_on_hand","product_name","delivery_profile_id"],"x-typelizer":!0},WebhookDelivery:{type:"object",properties:{id:{type:"string"},event_name:{type:"string"},event_id:{type:"string",nullable:!0},response_code:{type:"number",nullable:!0},execution_time:{type:"number",nullable:!0},error_type:{type:"string",nullable:!0},request_errors:{type:"string",nullable:!0},response_body:{type:"string",nullable:!0},success:{type:"boolean",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},delivered_at:{type:"string",nullable:!0},payload:{type:"object",nullable:!0},webhook_endpoint_id:{type:"string"},webhook_endpoint_url:{type:"string"}},required:["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":!0},WebhookEndpoint:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},url:{type:"string"},active:{type:"boolean"},subscriptions:{type:"array",items:{type:"string"}},disabled_reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},disabled_at:{type:"string",nullable:!0},secret_key:{type:"string",nullable:!0},last_delivery_at:{type:"string",nullable:!0},recent_delivery_count:{type:"number"},recent_failure_count:{type:"number"},total_delivery_count:{type:"number"},successful_delivery_count:{type:"number"},failed_delivery_count:{type:"number"}},required:["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":!0},WebhookEvent:{type:"object",properties:{name:{type:"string"},group:{type:"string"},credential_permission:{type:"string",nullable:!0},credential:{type:"boolean"},deprecated:{type:"boolean"},replaced_by:{type:"string",nullable:!0}},required:["name","group","credential_permission","credential","deprecated","replaced_by"]},EmailTemplateDraft:{type:"object",properties:{id:{type:"string"},subject:{type:"string",nullable:!0},body:{type:"string"},lock_version:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},updated_by_id:{type:"string",nullable:!0},updated_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},updated_by:{$ref:"#/components/schemas/Actor"}},required:["id","subject","body","lock_version","created_at","updated_at","updated_by_id","updated_by_type"],"x-typelizer":!0},EmailTemplatePreview:{type:"object",properties:{id:{type:"string",nullable:!0},subject:{type:"string"},html:{type:"string"},text:{type:"string"},email_key:{type:"string"},variables:{type:"object"}},required:["id","subject","html","text","email_key","variables"],"x-typelizer":!0},EmailTemplateRevision:{type:"object",properties:{id:{type:"string"},subject:{type:"string",nullable:!0},body:{type:"string"},created_at:{type:"string"},published_by_id:{type:"string",nullable:!0},published_by_type:{anyOf:[{type:"string",enum:["admin_user","api_key"]},{type:"string"}],nullable:!0,description:"The values listed are the built-in ones; extensions may add more."},published_by:{$ref:"#/components/schemas/Actor"}},required:["id","subject","body","created_at","published_by_id","published_by_type"],"x-typelizer":!0},EmailTemplateSampleRecord:{type:"object",properties:{id:{type:"string"},label:{type:"string"},created_at:{type:"string"}},required:["id","label","created_at"],"x-typelizer":!0},EmailTemplate:{type:"object",properties:{id:{type:"string"},key:{type:"string"},subject:{type:"string",nullable:!0},body:{type:"string"},language:{type:"string"},customized_languages:{type:"array",items:{type:"string"}},kind:{type:"string",enum:["email","layout","partial"]},customized:{type:"boolean"},published_at:{type:"string",nullable:!0},default_subject:{type:"string",nullable:!0},default_body:{type:"string"},published_language:{type:"string",nullable:!0},default_changed:{type:"boolean"},base_subject:{type:"string",nullable:!0},base_body:{type:"string",nullable:!0},draft:{allOf:[{$ref:"#/components/schemas/EmailTemplateDraft"}],nullable:!0}},required:["id","key","subject","body","language","customized_languages","kind","customized","published_at","default_subject","default_body","published_language","default_changed","base_subject","base_body","draft"],"x-typelizer":!0}}}};var wh=new Set(["get","post","put","patch","delete"]);function Mn(){return kh}function W0(e){let t=e.description?.match(/\*\*Required scope:\*\* (.+?) \(for API-key authentication\)\./);return t?t[1].replaceAll("`",""):"\u2014"}function xh(e,t={}){let r=[];for(let[i,n]of Object.entries(e.paths)){let s=i.replace("/api/v3/admin","")||"/";for(let[a,o]of Object.entries(n)){if(!wh.has(a))continue;if(t.resource){let d=s.split("/")[1]??"";if(d!==t.resource&&!d.startsWith(t.resource))continue}let c=o.summary??"";t.search&&!`${a} ${s} ${c}`.toLowerCase().includes(t.search.toLowerCase())||r.push({method:a.toUpperCase(),path:s,scope:W0(o),summary:c})}}return r}function Sh(e,t){let r=t.trim().split(/\s+/),i=r.length>1?r[0].toLowerCase():void 0,n=r.length>1?r[1]:r[0],s=Wr(n),a=vh(e,i,o=>o===s);return a.length>0?a:vh(e,i,o=>K0(o,s))}function vh(e,t,r){let i=[];for(let[n,s]of Object.entries(e.paths)){let a=n.replace("/api/v3/admin","")||"/";if(r(a))for(let[o,c]of Object.entries(s))wh.has(o)&&(t&&o!==t||i.push({method:o.toUpperCase(),path:a,summary:c.summary,description:c.description,parameters:or(c.parameters,e),requestBody:or(c.requestBody,e),responses:or(c.responses,e)}))}return i}function K0(e,t){if(e===t)return!0;let r=e.split("/"),i=t.split("/");return r.length!==i.length?!1:r.every((n,s)=>n.startsWith("{")&&n.endsWith("}")?i[s].length>0:n===i[s])}var Y0=8;function or(e,t,r=[]){if(Array.isArray(e))return e.map(a=>or(a,t,r));if(!e||typeof e!="object")return e;let i=e,n=i.$ref;if(typeof n=="string"){let a=n.replace("#/components/schemas/","");return r.includes(a)||r.length>=Y0||!(a in t.components.schemas)?{$ref:n}:or(t.components.schemas[a],t,[...r,a])}let s={};for(let[a,o]of Object.entries(i))s[a]=or(o,t,r);return s}function J0(e,t){return[...t,e]}function jh(e){return e.option("--profile <name>","use a saved profile (see `spree auth`)").option("--base-url <url>","store URL (overrides profile/env/project)").option("--api-key <key>","secret API key (prefer SPREE_API_KEY \u2014 flags leak into shell history)").option("--store-id <id>","X-Spree-Store-Id for hosts serving multiple stores")}function Ph(){return new rp("--format <format>","output format").choices(["json","table"]).default("json")}function $h(e){return jh(e).addOption(Ph())}async function Ah(e){let t=await Br({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile});return{client:zr({baseUrl:t.baseUrl,secretKey:t.apiKey,...e.storeId?{storeId:e.storeId}:{}}),credentials:t}}function Th(e){let t=e.command("api").description("Call the Admin API directly (generic get/post/patch/delete)");t.addHelpText("after",["","Examples:"," spree api get /products -q status_eq=active --limit 10",` spree api post /products -d '{"name":"Classic Tee","prices":[{"currency":"USD","amount":"29.99"}]}'`," spree api get /orders/ord_x8k2J9aQ --expand items,payments","","Discover the surface (offline, no server needed):"," spree api endpoints --search <term> # find endpoints + required scopes",' spree api schema "POST /orders" # request/response schema for one operation'," spree completion zsh # tab-completion for paths, filters, scopes"].join(`
920
+ `)),$h(t.command("get <path>").description("GET an Admin API path, e.g. `spree api get /products -q status_eq=active`").option("-q, --query <expr>","Ransack predicate key=value (repeatable)",J0,[]).option("--sort <fields>","sort, e.g. -created_at").option("--page <n>","page number").option("--limit <n>","page size (max 100)").option("--expand <relations>","expand relations, e.g. variants,variants.prices").option("--fields <fields>","sparse fields, e.g. id,name")).action(async(r,i)=>{let n;try{let s=bh(i),{client:a,credentials:o}=await Ah(i);n=o.baseUrl;let c=await a.request("GET",Wr(r),{params:s});Hr(c,i.format)}catch(s){Rt(s,{baseUrl:n})}});for(let r of["post","patch","delete"])$h(t.command(`${r} <path>`).description(`${r.toUpperCase()} an Admin API path`).option("-d, --data <json>","request body: inline JSON, @file, or '-' for stdin")).action(async(i,n)=>{let s;try{let a=await gh(n.data),{client:o,credentials:c}=await Ah(n);s=c.baseUrl;let d=await o.request(r.toUpperCase(),Wr(i),{...a===Po?{}:{body:a}});Hr(d,n.format)}catch(a){Rt(a,{baseUrl:s})}});t.command("endpoints").description("List Admin API endpoints with their required scopes").option("--resource <name>","filter by first path segment, e.g. orders").option("--search <term>","filter by method, path, or summary").addOption(Ph()).action(r=>{let i=xh(Mn(),{resource:r.resource,search:r.search});if(i.length===0){process.stderr.write(`No endpoints match.
921
921
  `),process.exitCode=1;return}if(r.format==="table"){(0,Eh.printTable)(i.map(n=>({Method:n.method,Path:n.path,Scope:n.scope,Summary:n.summary})));return}Hr(i,"json")}),t.command("schema <operation>").description('Show the request/response schema for an operation, e.g. `spree api schema "POST /products"`').action(r=>{let i=Sh(Mn(),r);if(i.length===0){process.stderr.write(`No operation matches "${r}". Try \`spree api endpoints --search ${r.split(/\s+/).pop()}\`.
922
922
  `),process.exitCode=1;return}let n=/\s/.test(r.trim());Hr(n&&i.length===1?i[0]:i,"json")}),jh(t.command("status").description("Show resolved credentials, server reachability, and the bundled spec version")).action(async r=>{try{let i=await Br({baseUrl:r.baseUrl,apiKey:r.apiKey,profile:r.profile},{allowMint:!1}),n=await Kr(i.baseUrl,i.apiKey),s=Mn(),a=zn(n),o=[`${Le.default.bold("Base URL:")} ${i.baseUrl}`,`${Le.default.bold("Credentials:")} ${i.source}${i.profileName?` (${i.profileName})`:""}, key ${i.tokenPrefix}${Le.default.dim("\u2026")}`],c=n.status==="unreachable"||n.status==="unauthorized"?null:await qh(i.baseUrl,i.apiKey);c!==null?o.push(`${Le.default.bold("Scopes:")} ${c.length?c.join(", "):Le.default.dim("(none)")}`):i.scopes?.length&&o.push(`${Le.default.bold("Scopes:")} ${i.scopes.join(", ")} ${Le.default.dim("(local snapshot from mint time \u2014 may be stale)")}`),o.push(`${Le.default.bold("Server:")} ${a}`),o.push(`${Le.default.bold("Bundled spec:")} ${s.info?.version??"unknown"} ${Le.default.dim("(spree api endpoints/schema reflect this snapshot, not the live server)")}`),process.stdout.write(`${o.join(`
923
923
  `)}
@@ -927,13 +927,13 @@ readable. Refused with a 422 while a purchase order still points at it.
927
927
  `),process.exit(2));let i=r.baseUrl;if(!i){let d=await ye({message:"Store URL:",placeholder:"https://store.example.com",validate(u){if(!u)return"URL is required";if(!/^https?:\/\//.test(u))return"Must start with http:// or https://"}});F(d)&&(C("Cancelled."),process.exit(130)),i=d}i=i.replace(/\/$/,"");let n=await qi({message:"Secret API key (sk_...):",validate(d){if(!d)return"Key is required";if(!d.startsWith("sk_"))return"Admin API keys start with sk_"}});F(n)&&(C("Cancelled."),process.exit(130));let s=n,a=M();a.start("Validating credentials...");let o=await Kr(i,s);o.status==="unauthorized"&&(a.stop(ae.default.red("The server rejected this key (401). Check the key and try again.")),process.exit(2)),o.status==="unreachable"&&(a.stop(ae.default.red(`Could not reach ${i}: ${o.message}`)),process.exit(2)),a.stop(o.storeName?`Connected to ${ae.default.bold(o.storeName)}.`:"Credentials accepted (key lacks read_settings, so the store name is hidden \u2014 that is fine).");let c=Lr();c.profiles[r.profile]={baseUrl:i,token:s},c.defaultProfile||=r.profile,no(c),H([`${ae.default.bold("Profile:")} ${r.profile}${c.defaultProfile===r.profile?ae.default.dim(" (default)"):""}`,`${ae.default.bold("Base URL:")} ${i}`,`${ae.default.bold("Key:")} ${On(s)}${ae.default.dim("\u2026")}`,"",ae.default.dim(`Saved to ${Tt()}`)].join(`
928
928
  `),"Logged in")}),t.command("status").description("Show which credentials `spree api` would use, and verify them").option("--profile <name>","check a specific profile").action(async r=>{let i;try{i=await Br({profile:r.profile},{allowMint:!1})}catch(o){Rt(o)}let n=M();n.start("Checking server...");let s=await Kr(i.baseUrl,i.apiKey);n.stop("");let a=zn(s);H([`${ae.default.bold("Source:")} ${i.source}${i.profileName?` (${i.profileName})`:""}`,`${ae.default.bold("Base URL:")} ${i.baseUrl}`,`${ae.default.bold("Key:")} ${i.tokenPrefix}${ae.default.dim("\u2026")}`,...i.scopes?[`${ae.default.bold("Scopes:")} ${i.scopes.join(", ")}`]:[],`${ae.default.bold("Server:")} ${a}`].join(`
929
929
  `),"Auth status"),Bn(s)&&(process.exitCode=1)}),t.command("logout").description("Remove a saved profile (or the project credentials)").option("--profile <name>","profile to remove","default").option("--project","remove .spree/credentials.json from the current project instead").action(async r=>{if(r.project){let n;try{n=v().projectDir}catch(a){Rt(a)}(await import("fs")).rmSync(rr(n),{force:!0}),k.success("Removed project credentials. The next `spree api` call mints a fresh read-only key.");return}let i=Lr();if(!i.profiles[r.profile]){let n=Object.keys(i.profiles),s=n.length?` Saved profiles: ${n.join(", ")}.`:" No profiles are saved.";process.stderr.write(`${ae.default.red("error:")} no profile named "${r.profile}".${s}
930
- `),process.exit(2)}delete i.profiles[r.profile],i.defaultProfile===r.profile&&(i.defaultProfile=Object.keys(i.profiles)[0]),no(i),k.success(`Removed profile "${r.profile}". The key itself stays active \u2014 revoke it with \`spree api-key revoke\` or in the admin.`)}),t.command("list").description("List saved profiles").action(()=>{let r=Lr(),i=Object.keys(r.profiles);if(i.length===0){k.info("No profiles saved. Run `spree auth login` to add one.");return}(0,Ih.printTable)(i.map(n=>({Profile:r.defaultProfile===n?`${n} *`:n,"Base URL":r.profiles[n].baseUrl,Key:`${On(r.profiles[n].token)}\u2026`})))})}p();import Yr from"fs";import pr from"path";var de=L(J(),1);function Dh(e){e.command("build").description("Rebuild the dev image (after Dockerfile / .ruby-version changes)").option("--reset-bundle","also wipe the bundle_cache volume to re-seed gems").option("--yes","skip confirmation prompts (for CI)").option("--production","build the production image instead \u2014 includes apps/dashboard when present").option("--tag <tag>","image tag for --production (default: <project>-spree:latest)").action(async t=>{if(t.production){await eS(v().projectDir,t.tag);return}await J0(t)})}async function J0(e){let t=v();if(He(t.projectDir)&&(C(["This project uses SPREE_PATH for monorepo development.",`Use ${de.default.bold("pnpm server:build")} from the monorepo root instead of ${de.default.bold("spree build")}.`,"It builds against the edge compose overlay the running stack was started with."].join(`
930
+ `),process.exit(2)}delete i.profiles[r.profile],i.defaultProfile===r.profile&&(i.defaultProfile=Object.keys(i.profiles)[0]),no(i),k.success(`Removed profile "${r.profile}". The key itself stays active \u2014 revoke it with \`spree api-key revoke\` or in the admin.`)}),t.command("list").description("List saved profiles").action(()=>{let r=Lr(),i=Object.keys(r.profiles);if(i.length===0){k.info("No profiles saved. Run `spree auth login` to add one.");return}(0,Ih.printTable)(i.map(n=>({Profile:r.defaultProfile===n?`${n} *`:n,"Base URL":r.profiles[n].baseUrl,Key:`${On(r.profiles[n].token)}\u2026`})))})}p();import Yr from"fs";import pr from"path";var de=L(J(),1);function Dh(e){e.command("build").description("Rebuild the dev image (after Dockerfile / .ruby-version changes)").option("--reset-bundle","also wipe the bundle_cache volume to re-seed gems").option("--yes","skip confirmation prompts (for CI)").option("--production","build the production image instead \u2014 includes apps/dashboard when present").option("--tag <tag>","image tag for --production (default: <project>-spree:latest)").action(async t=>{if(t.production){await tS(v().projectDir,t.tag);return}await X0(t)})}async function X0(e){let t=v();if(He(t.projectDir)&&(C(["This project uses SPREE_PATH for monorepo development.",`Use ${de.default.bold("pnpm server:build")} from the monorepo root instead of ${de.default.bold("spree build")}.`,"It builds against the edge compose overlay the running stack was started with."].join(`
931
931
  `)),process.exit(1)),We(t.projectDir)||(console.error(`
932
932
  ${de.default.red("Error:")} docker-compose.yml has no \`build:\` section. Run ${de.default.bold("spree eject")} first to switch to a build-from-source stack.
933
- `),process.exit(1)),e.resetBundle){if(!e.yes){let i=await ut({message:"Wipe the bundle_cache volume? Any gems added via `spree bundle add` since the last image build will be lost.",initialValue:!1});(F(i)||!i)&&(C("Build cancelled."),process.exit(0))}let r=M();r.start("Wiping bundle_cache volume...");try{await X(["down"],t.projectDir,{stdio:"ignore"});let n=`${await tS(t.projectDir)}_bundle_cache`;await rS(n,t.projectDir)?(await Z("docker",["volume","rm",n],{cwd:t.projectDir,stdio:"ignore"}),r.stop("bundle_cache volume wiped.")):r.stop(`bundle_cache volume not present (looked for ${n}).`)}catch(i){throw r.stop("Failed to wipe bundle_cache volume."),i}}console.log(`
933
+ `),process.exit(1)),e.resetBundle){if(!e.yes){let i=await ut({message:"Wipe the bundle_cache volume? Any gems added via `spree bundle add` since the last image build will be lost.",initialValue:!1});(F(i)||!i)&&(C("Build cancelled."),process.exit(0))}let r=M();r.start("Wiping bundle_cache volume...");try{await X(["down"],t.projectDir,{stdio:"ignore"});let n=`${await rS(t.projectDir)}_bundle_cache`;await iS(n,t.projectDir)?(await Z("docker",["volume","rm",n],{cwd:t.projectDir,stdio:"ignore"}),r.stop("bundle_cache volume wiped.")):r.stop(`bundle_cache volume not present (looked for ${n}).`)}catch(i){throw r.stop("Failed to wipe bundle_cache volume."),i}}console.log(`
934
934
  ${de.default.bold("Rebuilding dev image...")}
935
935
  `),await X(["build",...await Ae(t.projectDir)],t.projectDir,{stdio:"inherit"}),H([`Image rebuilt. Start the stack with ${de.default.bold("spree dev")}.`,e.resetBundle?`On next boot, gems will re-seed into a fresh ${de.default.dim("bundle_cache")} volume.`:""].filter(Boolean).join(`
936
- `),"Build complete")}function X0(e,t){let r=Xt(e),i=pr.join(e,r),n=pr.join(i,"Dockerfile");if(!Yr.existsSync(n))throw new Error(`No ${r}/Dockerfile found. Is this a create-spree-app project?`);let s=t??`${pr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}-spree:latest`,a=Yr.existsSync(pr.join(e,"apps","dashboard","package.json"));return/\.spree-custom-(app|dashboard)\b/.test(Yr.readFileSync(n,"utf-8"))?(Z0(e),{args:["build",e,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"custom":"stock-or-none"}):{args:["build",i,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"unsupported-dockerfile":"stock-or-none"}}function Z0(e){let t=pr.join(e,".dockerignore");Yr.existsSync(t)||Yr.writeFileSync(t,Q0)}var Q0=`# Build context for server/Dockerfile (repo root): keep it to sources.
936
+ `),"Build complete")}function Z0(e,t){let r=Xt(e),i=pr.join(e,r),n=pr.join(i,"Dockerfile");if(!Yr.existsSync(n))throw new Error(`No ${r}/Dockerfile found. Is this a create-spree-app project?`);let s=t??`${pr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}-spree:latest`,a=Yr.existsSync(pr.join(e,"apps","dashboard","package.json"));return/\.spree-custom-(app|dashboard)\b/.test(Yr.readFileSync(n,"utf-8"))?(Q0(e),{args:["build",e,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"custom":"stock-or-none"}):{args:["build",i,"-f",n,"-t",s],imageTag:s,apiDir:r,dashboard:a?"unsupported-dockerfile":"stock-or-none"}}function Q0(e){let t=pr.join(e,".dockerignore");Yr.existsSync(t)||Yr.writeFileSync(t,eS)}var eS=`# Build context for server/Dockerfile (repo root): keep it to sources.
937
937
  **/node_modules
938
938
  **/.git
939
939
  .spree
@@ -949,12 +949,12 @@ backend/log
949
949
  backend/tmp
950
950
  backend/storage
951
951
  backend/.env*
952
- `;async function eS(e,t){let r;try{r=X0(e,t)}catch(i){console.error(`
952
+ `;async function tS(e,t){let r;try{r=Z0(e,t)}catch(i){console.error(`
953
953
  ${de.default.red("Error:")} ${i instanceof Error?i.message:String(i)}
954
954
  `),process.exit(1)}r.dashboard==="custom"?k.info(`Including your dashboard from ${de.default.bold("apps/dashboard/")} (built in-image).`):r.dashboard==="unsupported-dockerfile"&&k.warn(`${de.default.bold("apps/dashboard/")} exists, but ${de.default.bold(`${r.apiDir}/Dockerfile`)} predates dashboard support \u2014 the image will NOT include your dashboard. Update the Dockerfile from the spree-starter template to bake it in.`),console.log(`
955
955
  ${de.default.bold(`Building production image ${r.imageTag}...`)}
956
956
  `),await Z("docker",r.args,{cwd:e,stdio:"inherit"}),H([`Run it: ${de.default.cyan(`docker run --rm -p 3000:3000 ${r.imageTag}`)}`,`Push it: ${de.default.cyan(`docker tag ${r.imageTag} <registry>/<repo> && docker push <registry>/<repo>`)}`,r.dashboard!=="unsupported-dockerfile"?`Dashboard: served at ${de.default.bold("/dashboard")} on the same origin as the API.`:""].filter(Boolean).join(`
957
- `),"Production image built")}async function tS(e){try{let{stdout:t}=await Z("docker",["compose","config","--format","json"],{cwd:e}),r=JSON.parse(t);if(r.name)return r.name}catch{}return pr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}async function rS(e,t){try{return await Z("docker",["volume","inspect",e],{cwd:t,stdio:"ignore"}),!0}catch{return!1}}p();function Lh(e){e.command("bundle").description("Run a bundler command (`bundle \u2026`) inside the web container").argument("<args...>","arguments to pass to bundle").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bundle",...t],r.projectDir,{edgeHint:"the edge stack heals gem drift on boot"})})}p();var Bh=["/admin_users","/allowed_origins","/api_keys","/auth","/catalogs","/categories","/channels","/claim_reasons","/collection_rules","/collections","/commission_lines","/commission_rates","/companies","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/email_templates","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/media","/option_types","/order_cancellation_reasons","/order_routing_rules","/orders","/package_types","/payment_methods","/permissions","/policies","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/purchase_orders","/refund_reasons","/return_reasons","/roles","/seller_payouts","/seller_requirements","/sellers","/stock_levels","/stock_locations","/stock_movements","/stock_transfers","/store","/store_credits","/suppliers","/tags","/tax_rates","/translatable_resources","/translations","/webhook_endpoints","/webhook_events"];var zh=["bash","zsh","fish"],nS=["eq","not_eq","cont","not_cont","start","end","in","not_in","gt","gteq","lt","lteq","null","not_null","present","blank"],sS=["get","post","patch","delete","endpoints","schema","status"],aS=["read_all","write_all","read_orders","write_orders","read_products","write_products","read_media","write_media","read_promotions","write_promotions","read_customers","write_customers","read_payments","write_payments","read_fulfillments","write_fulfillments","read_refunds","write_refunds","read_gift_cards","write_gift_cards","read_store_credits","write_store_credits","read_stock","write_stock","read_categories","write_categories","read_collections","write_collections","read_settings","write_settings","read_webhooks","write_webhooks","read_api_keys","write_api_keys","read_staff","write_staff","read_dashboard"];function oS(e){let[t,r,...i]=e,n=e[e.length-1]??"",s=e[e.length-2]??"";if(e.length<=1)return Fn(["api","auth",...pS],n);if((s==="-q"||s==="--query")&&n.includes("_")&&!n.includes("=")){let a=n.slice(0,n.lastIndexOf("_")+1);return nS.map(o=>`${a}${o}=`)}if(s==="--scopes"){let a=n.includes(",")?n.slice(n.lastIndexOf(",")+1):n,o=n.slice(0,n.length-a.length);return Fn(aS,a).map(c=>o+c)}if(t==="api"){if(e.length===2)return Fn(sS,n);if(["get","post","patch","delete","schema"].includes(r)&&i.length<=1)return Fn(Bh,n)}return[]}var pS=["api-key","dev","console","migrate"];function Fn(e,t){return t?e.filter(r=>r.startsWith(t)):e}function cS(e){return e==="fish"?`# spree fish completion \u2014 eval "$(spree completion fish)"
957
+ `),"Production image built")}async function rS(e){try{let{stdout:t}=await Z("docker",["compose","config","--format","json"],{cwd:e}),r=JSON.parse(t);if(r.name)return r.name}catch{}return pr.basename(e).toLowerCase().replace(/[^a-z0-9_-]/g,"")}async function iS(e,t){try{return await Z("docker",["volume","inspect",e],{cwd:t,stdio:"ignore"}),!0}catch{return!1}}p();function Lh(e){e.command("bundle").description("Run a bundler command (`bundle \u2026`) inside the web container").argument("<args...>","arguments to pass to bundle").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bundle",...t],r.projectDir,{edgeHint:"the edge stack heals gem drift on boot"})})}p();var Bh=["/admin_users","/allowed_origins","/api_keys","/auth","/catalogs","/categories","/channels","/claim_reasons","/collection_rules","/collections","/commission_lines","/commission_rates","/companies","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/email_templates","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/media","/option_types","/order_cancellation_reasons","/order_routing_rules","/orders","/package_types","/payment_methods","/permissions","/policies","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/purchase_orders","/refund_reasons","/return_reasons","/roles","/seller_payouts","/seller_requirements","/sellers","/stock_levels","/stock_locations","/stock_movements","/stock_transfers","/store","/store_credits","/suppliers","/tags","/tax_rates","/translatable_resources","/translations","/webhook_endpoints","/webhook_events"];var zh=["bash","zsh","fish"],sS=["eq","not_eq","cont","not_cont","start","end","in","not_in","gt","gteq","lt","lteq","null","not_null","present","blank"],aS=["get","post","patch","delete","endpoints","schema","status"],oS=["read_all","write_all","read_orders","write_orders","read_products","write_products","read_media","write_media","read_promotions","write_promotions","read_customers","write_customers","read_payments","write_payments","read_fulfillments","write_fulfillments","read_refunds","write_refunds","read_gift_cards","write_gift_cards","read_store_credits","write_store_credits","read_stock","write_stock","read_categories","write_categories","read_collections","write_collections","read_settings","write_settings","read_webhooks","write_webhooks","read_api_keys","write_api_keys","read_staff","write_staff","read_dashboard"];function pS(e){let[t,r,...i]=e,n=e[e.length-1]??"",s=e[e.length-2]??"";if(e.length<=1)return Fn(["api","auth",...cS],n);if((s==="-q"||s==="--query")&&n.includes("_")&&!n.includes("=")){let a=n.slice(0,n.lastIndexOf("_")+1);return sS.map(o=>`${a}${o}=`)}if(s==="--scopes"){let a=n.includes(",")?n.slice(n.lastIndexOf(",")+1):n,o=n.slice(0,n.length-a.length);return Fn(oS,a).map(c=>o+c)}if(t==="api"){if(e.length===2)return Fn(aS,n);if(["get","post","patch","delete","schema"].includes(r)&&i.length<=1)return Fn(Bh,n)}return[]}var cS=["api-key","dev","console","migrate"];function Fn(e,t){return t?e.filter(r=>r.startsWith(t)):e}function dS(e){return e==="fish"?`# spree fish completion \u2014 eval "$(spree completion fish)"
958
958
  function __spree_complete
959
959
  set -l tokens (commandline -opc) (commandline -ct)
960
960
  spree __complete $tokens[2..-1]
@@ -974,17 +974,17 @@ _spree() {
974
974
  }
975
975
  complete -F _spree spree
976
976
  `}function Mh(e){e.command("completion <shell>").description("Output a shell completion script (bash, zsh, or fish)").action(t=>{if(!zh.includes(t)){process.stderr.write(`Unsupported shell "${t}". Choose one of: ${zh.join(", ")}.
977
- `),process.exitCode=2;return}process.stdout.write(cS(t))}),e.command("__complete",{hidden:!0}).allowUnknownOption().argument("[words...]").action(t=>{for(let r of oS(t??[]))process.stdout.write(`${r}
978
- `)})}p();function Fh(e){e.command("console").description("Open Rails console").action(async()=>{let t=v();await U(["bin/rails","console"],t.projectDir,{edgeHint:"then open the console"})})}p();var Be=L(J(),1);var dS=["bin/rails","db:drop","db:create","spree:install:migrations","db:migrate","db:seed"];function Gh(e){e.command("db:reset").description("Drop, create, migrate, and seed the dev database (destructive; self-heals a running stack)").option("--yes","skip the confirmation prompt (for CI)").action(async t=>{let r=v(),i=a=>{C(a.join(`
977
+ `),process.exitCode=2;return}process.stdout.write(dS(t))}),e.command("__complete",{hidden:!0}).allowUnknownOption().argument("[words...]").action(t=>{for(let r of pS(t??[]))process.stdout.write(`${r}
978
+ `)})}p();function Fh(e){e.command("console").description("Open Rails console").action(async()=>{let t=v();await U(["bin/rails","console"],t.projectDir,{edgeHint:"then open the console"})})}p();var Be=L(J(),1);var uS=["bin/rails","db:drop","db:create","spree:install:migrations","db:migrate","db:seed"];function Gh(e){e.command("db:reset").description("Drop, create, migrate, and seed the dev database (destructive; self-heals a running stack)").option("--yes","skip the confirmation prompt (for CI)").action(async t=>{let r=v(),i=a=>{C(a.join(`
979
979
  `)),process.exit(1)};if(He(r.projectDir)&&i(["This is a monorepo edge project (SPREE_PATH set in .env).",`Reset the dev database from the monorepo root with ${Be.default.bold("pnpm server:setup")}`,"(or the relevant `pnpm server:*` script) \u2014 the project-local compose is not the","running config here."]),!t.yes){let a=await ut({message:"This will drop the spree_development database. Continue?",initialValue:!1});(F(a)||!a)&&(C("Cancelled."),process.exit(0))}let n,s;try{s=await Ae(r.projectDir),n=(await Promise.all(s.map(o=>at(o,r.projectDir)))).some(Boolean)}catch(a){return i(["Could not inspect the Docker stack from this directory.",` ${Be.default.dim(String(a.message).split(`
980
- `)[0])}`,"",`Run ${Be.default.bold("spree db:reset")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}if(n){let a=M();a.start("Stopping the app to release database connections..."),await X(["stop",...s],r.projectDir),a.stop("App stopped.")}try{await to(dS,r.projectDir,{captureStderr:!0})}catch(a){let o=String(a.stderr??a.message??"");throw/being accessed by other users|55006/.test(o)&&i(["Could not drop spree_development \u2014 another client is still connected.",`A database client (TablePlus, DataGrip, psql) may be connected on port ${Be.default.bold("5433")}.`,"Disconnect it, then re-run `spree db:reset`.",...n?["",`Bring the stack back up with ${Be.default.bold("spree dev")}.`]:[]]),a}k.success("Database reset."),n&&H(`Bring the stack back up with ${Be.default.bold("spree dev")}.`,"Done")}),e.command("db:console").description("Open a psql session against the dev database").action(async()=>{let t=v(),r;try{r=await at("postgres",t.projectDir)}catch(i){C(["Could not inspect the Docker stack from this directory.",` ${Be.default.dim(String(i.message).split(`
980
+ `)[0])}`,"",`Run ${Be.default.bold("spree db:reset")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}if(n){let a=M();a.start("Stopping the app to release database connections..."),await X(["stop",...s],r.projectDir),a.stop("App stopped.")}try{await to(uS,r.projectDir,{captureStderr:!0})}catch(a){let o=String(a.stderr??a.message??"");throw/being accessed by other users|55006/.test(o)&&i(["Could not drop spree_development \u2014 another client is still connected.",`A database client (TablePlus, DataGrip, psql) may be connected on port ${Be.default.bold("5433")}.`,"Disconnect it, then re-run `spree db:reset`.",...n?["",`Bring the stack back up with ${Be.default.bold("spree dev")}.`]:[]]),a}k.success("Database reset."),n&&H(`Bring the stack back up with ${Be.default.bold("spree dev")}.`,"Done")}),e.command("db:console").description("Open a psql session against the dev database").action(async()=>{let t=v(),r;try{r=await at("postgres",t.projectDir)}catch(i){C(["Could not inspect the Docker stack from this directory.",` ${Be.default.dim(String(i.message).split(`
981
981
  `)[0])}`,"",`Run ${Be.default.bold("spree db:console")} from your project root, and make sure Docker is running.`].join(`
982
982
  `)),process.exit(1)}r||(C(["Postgres is not running.",`Start the stack with ${Be.default.bold("spree dev")}, then re-run ${Be.default.bold("spree db:console")}.`].join(`
983
- `)),process.exit(1)),await Qt(["psql","-U","postgres","spree_development"],t.projectDir,{service:"postgres"})})}p();import Vh from"fs";var ue=L(J(),1);p();import{spawn as uS}from"child_process";import Co from"fs";import cr from"path";var Jr=L(J(),1);function wt(e){return Co.existsSync(cr.join(e,"apps","dashboard","package.json"))}function Xr(e){let t=cr.join(e,"apps","dashboard");return Co.existsSync(cr.join(t,"package.json"))&&Co.existsSync(cr.join(t,"node_modules"))}function Gn(e){let t=cr.join(e,"apps","dashboard");k.warn(`${Jr.default.bold("apps/dashboard/")} has no dependencies installed \u2014 skipping its dev server. Install them (cd apps/dashboard && ${_t(e,t)} install) and rerun.`)}var lS=Jr.default.dim("dashboard | "),mS=new RegExp("\x1B\\[[0-9;]*m","g");function Un(e){if(!Xr(e))return null;let t=cr.join(e,"apps","dashboard"),r=_t(e,t),i=process.platform==="win32",n=uS(r,["run","dev"],{cwd:t,stdio:["ignore","pipe","pipe"],detached:!i,shell:i}),s=`http://localhost:${5173}`,a=!1,o=()=>{},c=new Promise(y=>{o=y}),d=y=>{a=!0,clearTimeout(u),o(y)},u=setTimeout(()=>d(s),3e4);u.unref();let l=(y,g)=>{let b="";y.on("data",$=>{b+=$.toString();let S=b.split(`
984
- `);b=S.pop()??"";for(let A of S)if(g.write(`${lS}${A}
985
- `),!a){let q=A.replace(mS,"").match(/Local:\s+(http:\/\/\S+?)\/?\s*$/);q&&d(q[1])}})};n.stdout&&l(n.stdout,process.stdout),n.stderr&&l(n.stderr,process.stderr);let h=!1;return n.on("error",y=>{d(s),k.warn(`Could not start the dashboard dev server (${y.message}) \u2014 start it manually with ${Jr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),n.on("exit",(y,g)=>{d(s),!h&&g===null&&y!==null&&y!==0&&y!==130&&k.warn(`The dashboard dev server exited (code ${y}) \u2014 restart it with ${Jr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),{url:c,stop:()=>{if(h=!0,d(s),!(n.exitCode!==null||n.killed)){if(!i&&n.pid)try{process.kill(-n.pid,"SIGTERM");return}catch{}n.kill("SIGTERM")}}}}p();import dr from"fs";import{platform as yS}from"os";import Zr from"path";var Q=L(J(),1);var gS=3e3,Uh=12e4;function Nh(e){e.command("init").description("First-run setup: start services, seed the database, configure API keys").option("--no-sample-data","skip loading sample data on scripted installs (see --admin-email)").option("--no-open","skip opening browser").option("--admin-email <email>","scripted installs only: seed an admin account instead of printing the setup link").option("--admin-password <password>","password for the admin account seeded by --admin-email").action(async t=>{await Ro(t)})}async function Ro(e){let t=v(),{adminEmail:r,adminPassword:i}=wS(e),n=e.sampleData&&(Rn(t.projectDir)??!0);k.step("Pulling latest images..."),await X(["pull"],t.projectDir,{stdio:"inherit"});let s=M();We(t.projectDir)&&(s.start("Preparing the development database..."),await In(t.projectDir),s.stop("Development database ready.")),s.start("Starting Docker services..."),await Zt(t.projectDir,{stdio:"ignore"}),await X(["up","-d"],t.projectDir),s.stop("Docker services started."),s.start("Waiting for Spree to be ready..."),await _S(t.port),s.stop("Spree is ready."),s.start("Seeding database...");let o=(await pe("db:seed",t.projectDir,r&&i?{ADMIN_EMAIL:r,ADMIN_PASSWORD:i}:void 0)).match(/\/setup\?token=(\S+)/)?.[1];s.stop("Database seeded."),r&&i&&Um(t.projectDir,r),s.start("Configuring API keys...");let c=await bS(t.projectDir);vS(t.projectDir,c);let d=await kS(t.projectDir,t.port);s.stop("API keys configured.");for(let A of["dashboard","seller-dashboard","storefront"])await fS(t.projectDir,A);Dn(t.projectDir,t.port);let u=n&&!!(r&&i);u?(s.start("Loading sample data..."),await pe("spree:load_sample_data",t.projectDir),s.stop("Sample data loaded.")):n&&k.info('Sample data: tick "Load sample data" on the setup screen, or run `spree sample-data` any time later.'),s.start("Indexing products for search..."),await pe("spree:search:reindex",t.projectDir),s.stop("Search index ready."),Fm(t.projectDir);let l=Xr(t.projectDir);wt(t.projectDir)&&!l&&Gn(t.projectDir);let h=l?`http://localhost:${5173}`:`http://localhost:${t.port}/dashboard`,y=r&&i?[` Email: ${r}`,` Password: ${i}`]:[` ${Q.default.dim("Create your admin account (and load sample data, if you like):")}`,` ${Q.default.cyan(o?`${h}/setup?token=${o}`:"run `spree run bin/rails spree:setup:token` for the setup link")}`],g=l?[Q.default.bold("Admin Dashboard"),` ${Q.default.cyan(`http://localhost:${5173}`)}`,...y,` ${Q.default.dim("Live-reloading from apps/dashboard/")}`]:[Q.default.bold("Admin Dashboard"),` ${Q.default.cyan(`http://localhost:${t.port}/dashboard`)}`,...y,` ${Q.default.dim(wt(t.projectDir)?"Built-in dashboard \u2014 apps/dashboard/ runs once its dependencies are installed":`Built-in dashboard \u2014 run ${Q.default.bold("spree add dashboard")} to customize it`)}`],b=u&&qS(t.projectDir)?[Q.default.bold("Wholesale portal (B2B demo)"),` ${Q.default.cyan(`http://localhost:${3001}/wholesale`)} ${Q.default.dim("\u2014 needs the storefront dev server running")}`,` ${Q.default.dim('Register a buyer, then approve them in the admin (add to the "Wholesale" customer group)')}`,""]:[];H(["",...g,"",Q.default.bold("Store API"),` ${Q.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,` Publishable key: ${Q.default.cyan(c)}`,"",...b,Q.default.bold("Admin API"),` ${Q.default.cyan(`http://localhost:${t.port}/api/v3/admin`)}`,` Secret key: ${Q.default.cyan(d)}`,` ${Q.default.dim("Saved to .spree/credentials.json")}`,""].join(`
986
- `),"Your Spree store is ready!");let $=l?Un(t.projectDir):null,S=()=>{$?.stop(),process.exit(130)};process.once("SIGINT",S);try{if(e.open){let A=$?await $.url:h,q=o?`${A.replace(/\/$/,"")}/setup?token=${o}`:A;await xS(q)}k.info(`Streaming logs (Ctrl+C to stop)...
987
- `),await Dr("web",t.projectDir)}finally{process.removeListener("SIGINT",S),$?.stop()}}async function fS(e,t){let r=Zr.join(e,"apps",t);if(!dr.existsSync(Zr.join(r,"package.json"))||dr.existsSync(Zr.join(r,"node_modules")))return;let i=_t(e,r),n=M();n.start(`Installing apps/${t}/ dependencies with ${i}...`);try{await Z(i,["install"],{cwd:r}),n.stop(`apps/${t}/ dependencies installed.`)}catch(s){n.stop(Q.default.yellow(`${i} install failed \u2014 run it manually in apps/${t}/.`)),k.warn(s instanceof Error?s.message:String(s))}}async function _S(e){let t=`http://localhost:${e}/up`,r=Date.now();for(;Date.now()-r<Uh;){try{if((await fetch(t)).ok)return}catch{}await new Promise(i=>setTimeout(i,gS))}throw new Error(`Spree did not become healthy within ${Uh/1e3}s`)}async function bS(e){let t=await pe("spree:cli:ensure_api_key",e),r=t.match(/pk_[A-Za-z0-9_-]+/);if(!r)throw new Error(`Could not extract API key from Rails output: ${t}`);return r[0]}function qS(e){let t=Zr.join(e,"apps","storefront",".env.local");try{return dr.readFileSync(t,"utf-8").match(/^SPREE_WHOLESALE_CHANNEL=(\S+)/m)?.[1]??null}catch{return null}}async function kS(e,t){let{token:r}=await po(e,t,!0);return r}function vS(e,t){let r=Zr.join(e,"apps","storefront",".env.local");if(!dr.existsSync(r))return;let i=dr.readFileSync(r,"utf-8");dr.writeFileSync(r,i.replace(/^SPREE_PUBLISHABLE_KEY=.*/m,`SPREE_PUBLISHABLE_KEY=${t}`))}function wS(e){let{adminEmail:t,adminPassword:r}=e;return t&&!t.includes("@")&&(C(`Invalid --admin-email: ${t}`),process.exit(1)),r&&r.length<8&&(C("Invalid --admin-password: use at least 8 characters."),process.exit(1)),!!t!=!!r&&(C("Pass both --admin-email and --admin-password, or neither."),process.exit(1)),{adminEmail:t,adminPassword:r}}async function xS(e){let t=yS(),r=t==="darwin"?"open":t==="win32"?"start":"xdg-open";try{await gt(`${r} ${e}`,{stdio:"ignore"})}catch{}}function Wh(e){e.command("dev").description("Run the app in the foreground \u2014 the API, plus the Admin Dashboard dev server when apps/dashboard exists; Ctrl+C stops them").action(async()=>{let t=v();if(He(t.projectDir)&&(C(["This project uses SPREE_PATH for monorepo development.",`Use ${ue.default.bold("pnpm server:dev")} from the monorepo root instead of ${ue.default.bold("spree dev")}.`,"It loads the edge compose overlay and sets SPREE_PATH so the Spree gems resolve to the monorepo source."].join(`
983
+ `)),process.exit(1)),await Qt(["psql","-U","postgres","spree_development"],t.projectDir,{service:"postgres"})})}p();import Vh from"fs";var ue=L(J(),1);p();import{spawn as lS}from"child_process";import Co from"fs";import cr from"path";var Jr=L(J(),1);function wt(e){return Co.existsSync(cr.join(e,"apps","dashboard","package.json"))}function Xr(e){let t=cr.join(e,"apps","dashboard");return Co.existsSync(cr.join(t,"package.json"))&&Co.existsSync(cr.join(t,"node_modules"))}function Gn(e){let t=cr.join(e,"apps","dashboard");k.warn(`${Jr.default.bold("apps/dashboard/")} has no dependencies installed \u2014 skipping its dev server. Install them (cd apps/dashboard && ${_t(e,t)} install) and rerun.`)}var mS=Jr.default.dim("dashboard | "),hS=new RegExp("\x1B\\[[0-9;]*m","g");function Un(e){if(!Xr(e))return null;let t=cr.join(e,"apps","dashboard"),r=_t(e,t),i=process.platform==="win32",n=lS(r,["run","dev"],{cwd:t,stdio:["ignore","pipe","pipe"],detached:!i,shell:i}),s=`http://localhost:${5173}`,a=!1,o=()=>{},c=new Promise(y=>{o=y}),d=y=>{a=!0,clearTimeout(u),o(y)},u=setTimeout(()=>d(s),3e4);u.unref();let l=(y,g)=>{let b="";y.on("data",$=>{b+=$.toString();let S=b.split(`
984
+ `);b=S.pop()??"";for(let A of S)if(g.write(`${mS}${A}
985
+ `),!a){let q=A.replace(hS,"").match(/Local:\s+(http:\/\/\S+?)\/?\s*$/);q&&d(q[1])}})};n.stdout&&l(n.stdout,process.stdout),n.stderr&&l(n.stderr,process.stderr);let h=!1;return n.on("error",y=>{d(s),k.warn(`Could not start the dashboard dev server (${y.message}) \u2014 start it manually with ${Jr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),n.on("exit",(y,g)=>{d(s),!h&&g===null&&y!==null&&y!==0&&y!==130&&k.warn(`The dashboard dev server exited (code ${y}) \u2014 restart it with ${Jr.default.bold(`cd apps/dashboard && ${r} run dev`)}. The API keeps running.`)}),{url:c,stop:()=>{if(h=!0,d(s),!(n.exitCode!==null||n.killed)){if(!i&&n.pid)try{process.kill(-n.pid,"SIGTERM");return}catch{}n.kill("SIGTERM")}}}}p();import dr from"fs";import{platform as gS}from"os";import Zr from"path";var Q=L(J(),1);var fS=3e3,Uh=12e4;function Nh(e){e.command("init").description("First-run setup: start services, seed the database, configure API keys").option("--no-sample-data","skip loading sample data on scripted installs (see --admin-email)").option("--no-open","skip opening browser").option("--admin-email <email>","scripted installs only: seed an admin account instead of printing the setup link").option("--admin-password <password>","password for the admin account seeded by --admin-email").action(async t=>{await Ro(t)})}async function Ro(e){let t=v(),{adminEmail:r,adminPassword:i}=xS(e),n=e.sampleData&&(Rn(t.projectDir)??!0);k.step("Pulling latest images..."),await X(["pull"],t.projectDir,{stdio:"inherit"});let s=M();We(t.projectDir)&&(s.start("Preparing the development database..."),await In(t.projectDir),s.stop("Development database ready.")),s.start("Starting Docker services..."),await Zt(t.projectDir,{stdio:"ignore"}),await X(["up","-d"],t.projectDir),s.stop("Docker services started."),s.start("Waiting for Spree to be ready..."),await bS(t.port),s.stop("Spree is ready."),s.start("Seeding database...");let o=(await pe("db:seed",t.projectDir,r&&i?{ADMIN_EMAIL:r,ADMIN_PASSWORD:i}:void 0)).match(/\/setup\?token=(\S+)/)?.[1];s.stop("Database seeded."),r&&i&&Um(t.projectDir,r),s.start("Configuring API keys...");let c=await qS(t.projectDir);wS(t.projectDir,c);let d=await vS(t.projectDir,t.port);s.stop("API keys configured.");for(let A of["dashboard","seller-dashboard","storefront"])await _S(t.projectDir,A);Dn(t.projectDir,t.port);let u=n&&!!(r&&i);u?(s.start("Loading sample data..."),await pe("spree:load_sample_data",t.projectDir),s.stop("Sample data loaded.")):n&&k.info('Sample data: tick "Load sample data" on the setup screen, or run `spree sample-data` any time later.'),s.start("Indexing products for search..."),await pe("spree:search:reindex",t.projectDir),s.stop("Search index ready."),Fm(t.projectDir);let l=Xr(t.projectDir);wt(t.projectDir)&&!l&&Gn(t.projectDir);let h=l?`http://localhost:${5173}`:`http://localhost:${t.port}/dashboard`,y=r&&i?[` Email: ${r}`,` Password: ${i}`]:[` ${Q.default.dim("Create your admin account (and load sample data, if you like):")}`,` ${Q.default.cyan(o?`${h}/setup?token=${o}`:"run `spree run bin/rails spree:setup:token` for the setup link")}`],g=l?[Q.default.bold("Admin Dashboard"),` ${Q.default.cyan(`http://localhost:${5173}`)}`,...y,` ${Q.default.dim("Live-reloading from apps/dashboard/")}`]:[Q.default.bold("Admin Dashboard"),` ${Q.default.cyan(`http://localhost:${t.port}/dashboard`)}`,...y,` ${Q.default.dim(wt(t.projectDir)?"Built-in dashboard \u2014 apps/dashboard/ runs once its dependencies are installed":`Built-in dashboard \u2014 run ${Q.default.bold("spree add dashboard")} to customize it`)}`],b=u&&kS(t.projectDir)?[Q.default.bold("Wholesale portal (B2B demo)"),` ${Q.default.cyan(`http://localhost:${3001}/wholesale`)} ${Q.default.dim("\u2014 needs the storefront dev server running")}`,` ${Q.default.dim('Register a buyer, then approve them in the admin (add to the "Wholesale" customer group)')}`,""]:[];H(["",...g,"",Q.default.bold("Store API"),` ${Q.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,` Publishable key: ${Q.default.cyan(c)}`,"",...b,Q.default.bold("Admin API"),` ${Q.default.cyan(`http://localhost:${t.port}/api/v3/admin`)}`,` Secret key: ${Q.default.cyan(d)}`,` ${Q.default.dim("Saved to .spree/credentials.json")}`,""].join(`
986
+ `),"Your Spree store is ready!");let $=l?Un(t.projectDir):null,S=()=>{$?.stop(),process.exit(130)};process.once("SIGINT",S);try{if(e.open){let A=$?await $.url:h,q=o?`${A.replace(/\/$/,"")}/setup?token=${o}`:A;await SS(q)}k.info(`Streaming logs (Ctrl+C to stop)...
987
+ `),await Dr("web",t.projectDir)}finally{process.removeListener("SIGINT",S),$?.stop()}}async function _S(e,t){let r=Zr.join(e,"apps",t);if(!dr.existsSync(Zr.join(r,"package.json"))||dr.existsSync(Zr.join(r,"node_modules")))return;let i=_t(e,r),n=M();n.start(`Installing apps/${t}/ dependencies with ${i}...`);try{await Z(i,["install"],{cwd:r}),n.stop(`apps/${t}/ dependencies installed.`)}catch(s){n.stop(Q.default.yellow(`${i} install failed \u2014 run it manually in apps/${t}/.`)),k.warn(s instanceof Error?s.message:String(s))}}async function bS(e){let t=`http://localhost:${e}/up`,r=Date.now();for(;Date.now()-r<Uh;){try{if((await fetch(t)).ok)return}catch{}await new Promise(i=>setTimeout(i,fS))}throw new Error(`Spree did not become healthy within ${Uh/1e3}s`)}async function qS(e){let t=await pe("spree:cli:ensure_api_key",e),r=t.match(/pk_[A-Za-z0-9_-]+/);if(!r)throw new Error(`Could not extract API key from Rails output: ${t}`);return r[0]}function kS(e){let t=Zr.join(e,"apps","storefront",".env.local");try{return dr.readFileSync(t,"utf-8").match(/^SPREE_WHOLESALE_CHANNEL=(\S+)/m)?.[1]??null}catch{return null}}async function vS(e,t){let{token:r}=await po(e,t,!0);return r}function wS(e,t){let r=Zr.join(e,"apps","storefront",".env.local");if(!dr.existsSync(r))return;let i=dr.readFileSync(r,"utf-8");dr.writeFileSync(r,i.replace(/^SPREE_PUBLISHABLE_KEY=.*/m,`SPREE_PUBLISHABLE_KEY=${t}`))}function xS(e){let{adminEmail:t,adminPassword:r}=e;return t&&!t.includes("@")&&(C(`Invalid --admin-email: ${t}`),process.exit(1)),r&&r.length<8&&(C("Invalid --admin-password: use at least 8 characters."),process.exit(1)),!!t!=!!r&&(C("Pass both --admin-email and --admin-password, or neither."),process.exit(1)),{adminEmail:t,adminPassword:r}}async function SS(e){let t=gS(),r=t==="darwin"?"open":t==="win32"?"start":"xdg-open";try{await gt(`${r} ${e}`,{stdio:"ignore"})}catch{}}function Wh(e){e.command("dev").description("Run the app in the foreground \u2014 the API, plus the Admin Dashboard dev server when apps/dashboard exists; Ctrl+C stops them").action(async()=>{let t=v();if(He(t.projectDir)&&(C(["This project uses SPREE_PATH for monorepo development.",`Use ${ue.default.bold("pnpm server:dev")} from the monorepo root instead of ${ue.default.bold("spree dev")}.`,"It loads the edge compose overlay and sets SPREE_PATH so the Spree gems resolve to the monorepo source."].join(`
988
988
  `)),process.exit(1)),Dn(t.projectDir,t.port),!We(t.projectDir)&&!Vh.existsSync(so(t.projectDir))&&!Vh.existsSync(rr(t.projectDir))){let o=Rn(t.projectDir)!==void 0;if(!o)try{o=!await Lm(t.projectDir)}catch{}if(o){k.info("First run detected \u2014 completing setup automatically."),await Ro({sampleData:!0,open:!0});return}}let r=wt(t.projectDir)&&Xr(t.projectDir);wt(t.projectDir)&&!r&&Gn(t.projectDir),H(["",...r?[ue.default.bold("Admin Dashboard"),` ${ue.default.cyan(`http://localhost:${5173}`)}`,...Hh(t.projectDir),` ${ue.default.dim("Live-reloading from apps/dashboard/")}`]:[ue.default.bold("Admin Dashboard"),` ${ue.default.dim(`Not installed \u2014 add it with ${ue.default.bold("spree add dashboard")}`)}`,...Hh(t.projectDir)],"",ue.default.bold("Store API"),` ${ue.default.cyan(`http://localhost:${t.port}/api/v3/store`)}`,""].join(`
989
989
  `),"Spree Commerce"),k.info(`Starting services \u2014 ${r?"API + dashboard logs":"API logs"} stream below. ${ue.default.bold("Ctrl+C")} stops them (databases keep running; ${ue.default.bold("spree stop")} shuts everything down).
990
990
  `);let i=()=>{};process.on("SIGINT",i);let n,s=null;try{await Zt(t.projectDir),s=r?Un(t.projectDir):null,n=await X(["up",...await Ae(t.projectDir)],t.projectDir,{stdio:"inherit",reject:!1})}finally{s?.stop(),process.off("SIGINT",i)}let a=n.exitCode??0;a!==0&&a!==130&&(C(`docker compose exited with code ${a} \u2014 see the output above.`),process.exit(a)),Ot(`${r?"API + dashboard":"API"} stopped. Databases keep running \u2014 ${ue.default.bold("spree stop")} shuts everything down.`)})}function Hh(e){let t=Nm(e);return t?[` Email: ${t}`,` Password: ${ue.default.dim("chosen during spree init")}`]:[` ${ue.default.dim("Create your admin account with the setup link from `spree init`")}`]}p();import ur from"fs";import Io from"path";var ve=L(J(),1);function Kh(e){e.command("eject").description("Switch to the dev compose: bind-mount the Rails app with hot reload").action(async()=>{let t=v(),r=Xt(t.projectDir),i=Io.join(t.projectDir,r);ur.existsSync(i)||(console.error(`
@@ -995,8 +995,8 @@ ${ve.default.red("Error:")} No docker-compose.dev.yml found.
995
995
  ${ve.default.bold(`Switching to dev compose (bind-mounts ./${r})...`)}
996
996
  `),console.log(`${ve.default.bold("Preparing the development database...")}
997
997
  `),await In(t.projectDir,{stdio:"inherit"}),await X(["up","-d"],t.projectDir,{stdio:"inherit"}),H([`The Rails API is now bind-mounted from ${ve.default.bold(`./${r}`)} \u2014 edits are live.`,"",`The dev stack uses its own ${ve.default.bold("spree_development")} database (just`,`created and seeded). Load demo products with ${ve.default.bold("spree sample-data")}.`,"","You can now customize:",` ${ve.default.dim(`${r}/app/`)} \u2014 models, controllers, services (instant reload)`,` ${ve.default.dim(`${r}/config/`)} \u2014 Rails configuration (instant reload)`,` ${ve.default.dim(`${r}/Gemfile`)} \u2014 add gems via ${ve.default.bold("spree bundle add <gem>")}`,"",`Rebuild only on Dockerfile / .ruby-version changes: ${ve.default.bold("spree build")}`].join(`
998
- `),"Ejected!")})}p();import AS from"crypto";import je from"fs";import mr from"path";var ei=L(J(),1);p();import SS from"crypto";import lr from"fs";import Qr from"path";var Do=["ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY","ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY","ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT"],Yh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Oo(e=32){let t="";for(let r=0;r<e;r++)t+=Yh[SS.randomInt(Yh.length)];return t}function Lo(){return{ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY:Oo(),ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY:Oo(),ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT:Oo()}}function Jh(e){return Do.map(t=>`${t}=${e[t]}`).join(`
999
- `)}function Xh(e){return new RegExp(`^[ \\t]*(?:export[ \\t]+)?${e}[ \\t]*=(.*)$`,"m")}function $S(e){let t=e.trim(),r=t.match(/^(['"])(.*?)\1/);return r?r[2]:t.replace(/(^|\s)#.*$/,"").trim()}function Zh(e){return Do.filter(t=>{let r=e.match(Xh(t));return r?$S(r[1]).length>0:!1})}function Qh(e){let t=Qr.join(e,"config"),r=[];lr.existsSync(Qr.join(t,"credentials.yml.enc"))&&r.push("config/credentials.yml.enc");let i=Qr.join(t,"credentials");if(lr.existsSync(i))for(let n of lr.readdirSync(i))n.endsWith(".yml.enc")&&r.push(`config/credentials/${n}`);return r}function ey(e,t){let r=e,i=[];for(let n of Do){let s=Xh(n);s.test(r)?r=r.replace(s,`${n}=${t[n]}`):i.push(n)}return i.length>0&&(r.length>0&&!r.endsWith(`
998
+ `),"Ejected!")})}p();import ES from"crypto";import je from"fs";import mr from"path";var ei=L(J(),1);p();import $S from"crypto";import lr from"fs";import Qr from"path";var Do=["ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY","ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY","ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT"],Yh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Oo(e=32){let t="";for(let r=0;r<e;r++)t+=Yh[$S.randomInt(Yh.length)];return t}function Lo(){return{ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY:Oo(),ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY:Oo(),ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT:Oo()}}function Jh(e){return Do.map(t=>`${t}=${e[t]}`).join(`
999
+ `)}function Xh(e){return new RegExp(`^[ \\t]*(?:export[ \\t]+)?${e}[ \\t]*=(.*)$`,"m")}function AS(e){let t=e.trim(),r=t.match(/^(['"])(.*?)\1/);return r?r[2]:t.replace(/(^|\s)#.*$/,"").trim()}function Zh(e){return Do.filter(t=>{let r=e.match(Xh(t));return r?AS(r[1]).length>0:!1})}function Qh(e){let t=Qr.join(e,"config"),r=[];lr.existsSync(Qr.join(t,"credentials.yml.enc"))&&r.push("config/credentials.yml.enc");let i=Qr.join(t,"credentials");if(lr.existsSync(i))for(let n of lr.readdirSync(i))n.endsWith(".yml.enc")&&r.push(`config/credentials/${n}`);return r}function ey(e,t){let r=e,i=[];for(let n of Do){let s=Xh(n);s.test(r)?r=r.replace(s,`${n}=${t[n]}`):i.push(n)}return i.length>0&&(r.length>0&&!r.endsWith(`
1000
1000
  `)&&(r+=`
1001
1001
  `),r+=`# Active Record encryption \u2014 back these up; never change them once data is encrypted
1002
1002
  `,r+=`${i.map(n=>`${n}=${t[n]}`).join(`
@@ -1005,31 +1005,31 @@ ${ve.default.bold(`Switching to dev compose (bind-mounts ./${r})...`)}
1005
1005
  value = ENV["ACTIVE_RECORD_ENCRYPTION_#{key.upcase}"].presence ||
1006
1006
  credentials.dig(:active_record_encryption, key).presence
1007
1007
  config.active_record.encryption[key] = value if value
1008
- end`;var ES="https://spreecommerce.org/docs/developer/deployment/environment_variables#active-record-encryption";function iy(e){e.command("encryption").description("Manage Active Record encryption keys").command("init").description("Generate Active Record encryption keys and add them to .env (never overwrites existing keys)").option("--print","only print a fresh set of keys (e.g. for your hosting provider)").addHelpText("after",`
1008
+ end`;var jS="https://spreecommerce.org/docs/developer/deployment/environment_variables#active-record-encryption";function iy(e){e.command("encryption").description("Manage Active Record encryption keys").command("init").description("Generate Active Record encryption keys and add them to .env (never overwrites existing keys)").option("--print","only print a fresh set of keys (e.g. for your hosting provider)").addHelpText("after",`
1009
1009
  Spree encrypts webhook signing keys, payment gateway customer ids and OAuth tokens
1010
1010
  at rest only when these keys are set. Once data is encrypted, never change them \u2014
1011
1011
  encrypted rows become unreadable. There is deliberately no --force.`).action(r=>{if(r.print){process.stdout.write(`${Jh(Lo())}
1012
- `);return}jS(v().projectDir)})}function jS(e){let t=mr.join(e,".env"),r=je.existsSync(t)?je.readFileSync(t,"utf-8"):"",i=Zh(r),n=Xt(e);if(We(e)&&!ty(mr.join(e,n))&&k.warn(`${n}/config doesn't read these env vars yet. Add this inside the Application class in ${n}/config/application.rb:
1012
+ `);return}PS(v().projectDir)})}function PS(e){let t=mr.join(e,".env"),r=je.existsSync(t)?je.readFileSync(t,"utf-8"):"",i=Zh(r),n=Xt(e);if(We(e)&&!ty(mr.join(e,n))&&k.warn(`${n}/config doesn't read these env vars yet. Add this inside the Application class in ${n}/config/application.rb:
1013
1013
 
1014
1014
  `+ei.default.dim(ry)),i.length>0){k.warn(`.env already sets ${i.join(", ")} \u2014 leaving it unchanged.
1015
1015
  Changing encryption keys makes data encrypted with them unreadable.`+(i.length<3?"\nAdd the missing values by hand (`spree encryption init --print`).":""));return}let a=Qh(mr.join(e,n));if(a.length>0){k.warn(`${n} has Rails credentials (${a.join(", ")}) \u2014 leaving .env unchanged.
1016
1016
  If they hold active_record_encryption keys, env vars would take precedence and make
1017
1017
  data encrypted with those keys unreadable. Check with \`bin/rails credentials:show\`;
1018
- if they hold none, add fresh keys to .env by hand (\`spree encryption init --print\`).`);return}PS(t,ey(r,Lo())),k.success("Added Active Record encryption keys to .env."),H([`1. Recreate the containers to load the new .env: ${ei.default.cyan("spree dev")}`,` (${ei.default.cyan("spree restart")} keeps the old environment).`,"2. Back up the three values in your secret manager \u2014"," losing them makes encrypted data unreadable.","3. Production: set the three env vars on your host before deploying",` (a separate set: ${ei.default.cyan("spree encryption init --print")}) and never change them.`,"",ES].join(`
1019
- `),"Next steps")}function PS(e,t){let r=je.existsSync(e)?je.realpathSync(e):e,i=je.existsSync(r)?je.statSync(r).mode&511:384,n=AS.randomBytes(6).toString("hex"),s=mr.join(mr.dirname(r),`.${mr.basename(r)}.${n}.tmp`),a=!1;try{let o=je.openSync(s,"wx",i);a=!0;try{je.writeFileSync(o,t)}finally{je.closeSync(o)}je.chmodSync(s,i),je.renameSync(s,r)}catch(o){throw a&&je.rmSync(s,{force:!0}),o}}p();function ny(e){e.command("exec").description("Run an arbitrary command inside the web container").argument("<command...>","command and arguments to run").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(t,r.projectDir)})}p();var TS=new Set(["migration","controller","scaffold","scaffold_controller","mailer","job","channel","helper","resource","integration_test","system_test","task","generator","benchmark"]);function sy(e){e.command("generate").alias("g").description("Run a generator (Spree generators auto-prefixed; Rails built-ins forwarded as-is)").argument("<name>","generator name (`model`, `model_decorator`, `migration`, \u2026)").argument("[args...]","arguments to pass to the generator").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=v(),n=t.includes(":")||TS.has(t)?t:`spree:${t}`;await U(["bin/rails","g",n,...r],i.projectDir)})}p();var Nn=L(J(),1);function ay(e){e.command("logs").description("Stream service logs").argument("[service]","service name (e.g. web)","web").action(async t=>{let r=v();if(t==="worker"&&!(await Ae(r.projectDir)).includes("worker")){k.info(`This project has no ${Nn.default.bold("worker")} service \u2014 jobs run inside the web process (Solid Queue in Puma). Streaming ${Nn.default.bold("web")} logs; the job dashboard is at ${Nn.default.cyan(`http://localhost:${r.port}/jobs`)}.`),await Dr("web",r.projectDir);return}await Dr(t,r.projectDir)})}p();var ti=L(J(),1);function oy(e){e.command("migrate").description("Install pending Spree migrations from gems, then run them (`spree:install:migrations` + `db:migrate`)").argument("[args...]","extra args forwarded to db:migrate").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await at("web",r.projectDir)?(console.log(`
1018
+ if they hold none, add fresh keys to .env by hand (\`spree encryption init --print\`).`);return}TS(t,ey(r,Lo())),k.success("Added Active Record encryption keys to .env."),H([`1. Recreate the containers to load the new .env: ${ei.default.cyan("spree dev")}`,` (${ei.default.cyan("spree restart")} keeps the old environment).`,"2. Back up the three values in your secret manager \u2014"," losing them makes encrypted data unreadable.","3. Production: set the three env vars on your host before deploying",` (a separate set: ${ei.default.cyan("spree encryption init --print")}) and never change them.`,"",jS].join(`
1019
+ `),"Next steps")}function TS(e,t){let r=je.existsSync(e)?je.realpathSync(e):e,i=je.existsSync(r)?je.statSync(r).mode&511:384,n=ES.randomBytes(6).toString("hex"),s=mr.join(mr.dirname(r),`.${mr.basename(r)}.${n}.tmp`),a=!1;try{let o=je.openSync(s,"wx",i);a=!0;try{je.writeFileSync(o,t)}finally{je.closeSync(o)}je.chmodSync(s,i),je.renameSync(s,r)}catch(o){throw a&&je.rmSync(s,{force:!0}),o}}p();function ny(e){e.command("exec").description("Run an arbitrary command inside the web container").argument("<command...>","command and arguments to run").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(t,r.projectDir)})}p();var CS=new Set(["migration","controller","scaffold","scaffold_controller","mailer","job","channel","helper","resource","integration_test","system_test","task","generator","benchmark"]);function sy(e){e.command("generate").alias("g").description("Run a generator (Spree generators auto-prefixed; Rails built-ins forwarded as-is)").argument("<name>","generator name (`model`, `model_decorator`, `migration`, \u2026)").argument("[args...]","arguments to pass to the generator").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=v(),n=t.includes(":")||CS.has(t)?t:`spree:${t}`;await U(["bin/rails","g",n,...r],i.projectDir)})}p();var Nn=L(J(),1);function ay(e){e.command("logs").description("Stream service logs").argument("[service]","service name (e.g. web)","web").action(async t=>{let r=v();if(t==="worker"&&!(await Ae(r.projectDir)).includes("worker")){k.info(`This project has no ${Nn.default.bold("worker")} service \u2014 jobs run inside the web process (Solid Queue in Puma). Streaming ${Nn.default.bold("web")} logs; the job dashboard is at ${Nn.default.cyan(`http://localhost:${r.port}/jobs`)}.`),await Dr("web",r.projectDir);return}await Dr(t,r.projectDir)})}p();var ti=L(J(),1);function oy(e){e.command("migrate").description("Install pending Spree migrations from gems, then run them (`spree:install:migrations` + `db:migrate`)").argument("[args...]","extra args forwarded to db:migrate").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await at("web",r.projectDir)?(console.log(`
1020
1020
  ${ti.default.bold("\u2192 Installing pending Spree migrations from gems...")}`),await Qt(["bin/rails","spree:install:migrations"],r.projectDir),console.log(`
1021
1021
  ${ti.default.bold("\u2192 Running db:migrate...")}`),await Qt(["bin/rails","db:migrate",...t],r.projectDir)):(console.log(`
1022
- ${ti.default.bold("\u2192 Installing + running pending Spree migrations...")}`),await U(["bin/rails","spree:install:migrations","db:migrate",...t],r.projectDir,{edgeHint:"the edge boot installs and runs pending migrations itself"})),H(`Run ${ti.default.bold("spree migrate:status")} to inspect the migration log.`,"Migrations up to date")}),e.command("migrate:rollback").description("Roll back the last migration (`STEP=n` to roll back n steps)").argument("[args...]","extra args forwarded to db:rollback (e.g. STEP=2)").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rails","db:rollback",...t],r.projectDir)}),e.command("migrate:status").description("Show migration status (`bin/rails db:migrate:status`)").action(async()=>{let t=v();await U(["bin/rails","db:migrate:status"],t.projectDir)})}p();import{platform as CS}from"os";function py(e){e.command("open").description("Open the admin dashboard in the browser").action(async()=>{let t=v(),r=wt(t.projectDir)?`http://localhost:${5173}`:`http://localhost:${t.port}/dashboard`,i=CS();await gt(`${i==="darwin"?"open":i==="win32"?"start":"xdg-open"} ${r}`)})}p();import zo from"fs";import yr from"path";import{fileURLToPath as RS}from"url";var W=L(J(),1);p();var cy=m;p();import ct from"fs";import Vn from"path";function uy(e){let{src:t,dst:r,vars:i,skip:n,force:s}=e;if(!ct.existsSync(t))throw new Error(`Template source not found: ${t}`);if(ct.existsSync(r)){if(ct.readdirSync(r).length>0&&!s)throw new Error(`Destination ${r} is not empty. Pass force=true to overwrite.`)}else ct.mkdirSync(r,{recursive:!0});ly(t,r,"",i,n)}function ly(e,t,r,i,n){let s=Vn.join(e,r);for(let a of ct.readdirSync(s,{withFileTypes:!0})){let o=r?`${r}/${a.name}`:a.name;if(n?.(o))continue;let c=my(Bo(a.name,i)),d=Vn.join(e,o);if(a.isDirectory()){let g=r?`${dy(r,i)}/${c}`:c,b=Vn.join(t,g);ct.mkdirSync(b,{recursive:!0}),ly(e,t,o,i,n);continue}let u=c.endsWith(".tt"),l=u?c.slice(0,-3):c,h=r?`${dy(r,i)}/${l}`:l,y=Vn.join(t,h);if(u){let g=ct.readFileSync(d,"utf8");ct.writeFileSync(y,Bo(g,i))}else ct.copyFileSync(d,y)}}function Bo(e,t){return e.replace(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g,(r,i)=>Object.hasOwn(t,i)?t[i]:r)}function dy(e,t){return e.split("/").map(r=>my(Bo(r,t))).join("/")}function my(e){if(e.includes("/")||e.includes("\\")||e==="..")throw new Error(`Template variable produced an unsafe path segment: "${e}"`);return e}var IS="../../templates/plugin",Hn=["MIT","Apache-2.0","BSD-3-Clause"];function yy(e){e.command("plugin").description("Scaffold and manage Spree plugins (dashboard + Rails engine)").command("new").description("Scaffold a new Spree plugin monorepo (dashboard plugin half today; Rails engine coming soon)").argument("[name]","Plugin name (e.g. brands). If omitted, you will be prompted.").option("--ruby-name <name>","Ruby gem name (default: spree_<name>)").option("--module-name <name>","Ruby module / TS namespace (default: PascalCase of the gem name)").option("--npm-scope <scope>","npm scope, e.g. @acme (default: unscoped)").option("--author <name>","Author name (default: git config user.name)").option("--author-email <email>","Author email (default: git config user.email)").option("--license <license>",`License: ${Hn.join(", ")} (default: MIT)`).option("-y, --yes","Non-interactive: accept the default for every prompt not answered by a flag",!1).option("--no-dashboard","Skip the dashboard plugin half").option("--no-engine","Skip the Rails engine half (currently always skipped \u2014 engine support coming soon)").option("--no-install","Skip running pnpm install").option("--force","Overwrite a non-empty destination directory").action(async(r,i)=>{bi(W.default.bgCyan(W.default.black(" Spree Plugin Scaffolder ")));let n=await OS(r,i);F(n)&&(C("Scaffolding cancelled."),process.exit(0));let s=yr.resolve(process.cwd(),n.name);zo.existsSync(s)&&zo.readdirSync(s).length>0&&!i.force&&(C(`Destination ${W.default.bold(s)} is not empty. Choose a different name or rerun with ${W.default.cyan("--force")}.`),process.exit(1));let a=LS(n),o=GS(),c=M();c.start(`Scaffolding ${W.default.cyan(n.name)}...`);try{uy({src:o,dst:s,vars:a,skip:BS(n),force:i.force})}catch(d){c.stop("Scaffolding failed."),k.error(d instanceof Error?d.message:String(d)),process.exit(1)}c.stop(`Created ${W.default.cyan(s)}`),i.install?await zS(s,n):k.info(W.default.dim("Skipping dependency install \u2014 run them yourself when ready.")),MS(n,s,i.install),Ot("Happy hacking!")})}async function OS(e,t){let r=q=>{if(!q)return"Required";if(!/^[a-z][a-z0-9-]*$/.test(q))return'Use lowercase letters, digits, and dashes (e.g. "brands" or "loyalty-points")'};if(e!==void 0){let q=r(e);q&&(k.error(`Invalid plugin name ${W.default.bold(e)}: ${q}`),process.exit(2))}e===void 0&&t.yes&&(k.error("Pass the plugin name as an argument when using --yes: spree plugin new <name> -y"),process.exit(2));let i=e??await ye({message:"Plugin name",placeholder:"brands",validate:r});if(F(i))return i;let n=`spree_${i.replace(/-/g,"_")}`,s=await hr({flag:"--ruby-name",flagValue:t.rubyName,fallback:n,yes:t.yes,validate:q=>q&&/^[a-z][a-z0-9_]*$/.test(q)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")',prompt:()=>ye({message:"Ruby gem name",placeholder:n,initialValue:n,validate:q=>q&&/^[a-z][a-z0-9_]*$/.test(q)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")'})});if(F(s))return s;let a=FS(s),o=await hr({flag:"--module-name",flagValue:t.moduleName,fallback:a,yes:t.yes,validate:q=>q&&/^[A-Z][A-Za-z0-9]*$/.test(q)?void 0:'PascalCase (e.g. "SpreeBrands")',prompt:()=>ye({message:"Ruby module / TS namespace",placeholder:a,initialValue:a,validate:q=>q&&/^[A-Z][A-Za-z0-9]*$/.test(q)?void 0:'PascalCase (e.g. "SpreeBrands")'})});if(F(o))return o;let c=q=>!q||/^@[a-z0-9][a-z0-9-]*$/.test(q)?void 0:"Must start with @ and contain lowercase letters/digits/dashes",d=await hr({flag:"--npm-scope",flagValue:t.npmScope,fallback:"",yes:t.yes,validate:c,prompt:()=>ye({message:"npm scope (optional, leave blank for unscoped)",placeholder:"@my-org",initialValue:"",validate:c})});if(F(d))return d;let u=t.author===void 0?await hy("user.name"):void 0,l=await hr({flag:"--author",flagValue:t.author,fallback:u,yes:t.yes,validate:q=>q?void 0:"Required",prompt:()=>ye({message:"Author name",placeholder:"Jane Developer",initialValue:u??"",validate:q=>q?void 0:"Required"})});if(F(l))return l;let h=q=>q&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(q)?void 0:"Enter a valid email",y=t.authorEmail===void 0?await hy("user.email"):void 0,g=await hr({flag:"--author-email",flagValue:t.authorEmail,fallback:y,yes:t.yes,validate:h,prompt:()=>ye({message:"Author email",placeholder:"jane@example.com",initialValue:y??"",validate:h})});if(F(g))return g;let b=q=>q&&Hn.includes(q)?void 0:`Must be one of: ${Hn.join(", ")}`,$=await hr({flag:"--license",flagValue:t.license,fallback:"MIT",yes:t.yes,validate:b,prompt:()=>ki({message:"License",options:Hn.map(q=>({value:q,label:q})),initialValue:"MIT"})});if(F($))return $;let S=t.dashboard===!1?!1:t.yes||await DS("Include dashboard plugin?",!0);if(F(S))return S;let A=!1;return t.engine!==!1&&k.warn("Rails engine generation is coming in a future release. For now, scaffold the dashboard half here and use `spree-extension create` for the Ruby side."),!S&&!A&&(C("Nothing to scaffold (dashboard half declined)."),process.exit(1)),{name:i,rubyName:s,moduleName:o,npmScope:d.trim(),authorName:l,authorEmail:g,license:$,includeDashboard:S,includeEngine:A}}async function DS(e,t){return await ut({message:e,initialValue:t})}async function hr(e){if(e.flagValue!==void 0){let t=e.validate(e.flagValue);return t&&(k.error(`Invalid value for ${W.default.cyan(e.flag)}: ${t}`),process.exit(2)),e.flagValue}if(e.yes){let t=e.validate(e.fallback);return(e.fallback===void 0||t)&&(k.error(`--yes could not resolve a default for ${W.default.cyan(e.flag)}`+(t?` (${t})`:"")+` \u2014 pass ${W.default.cyan(e.flag)} explicitly.`),process.exit(2)),e.fallback}return e.prompt()}async function hy(e){try{let{stdout:t}=await gt(`git config --get ${e}`);return t.trim()||void 0}catch{return}}function LS(e){let t=e.npmScope?`${e.npmScope}/${e.name}`:e.name;return{name:e.name,plugin_name:e.name,ruby_name:e.rubyName,module_name:e.moduleName,npm_scope:e.npmScope,npm_package_name:t,npm_dashboard_package:e.npmScope?`${e.npmScope}/${e.name}-dashboard`:`${e.name}-dashboard`,author_name:e.authorName,author_email:e.authorEmail,license:e.license,year:String(new Date().getFullYear()),...cy}}function BS(e){let t=!e.includeDashboard,r=!e.includeEngine;return i=>!!(t&&(i==="packages/dashboard"||i.startsWith("packages/dashboard/"))||r&&(i==="engine"||i.startsWith("engine/")))}async function zS(e,t){let r=M();if(t.includeDashboard){r.start("Running pnpm install...");try{await gt("pnpm install",{cwd:e,stdio:"pipe"}),r.stop("pnpm install complete.")}catch(i){r.stop(W.default.yellow("pnpm install failed \u2014 run it manually.")),k.warn(i instanceof Error?i.message:String(i))}}if(t.includeEngine){r.start("Running bundle install in engine/...");try{await gt("bundle install",{cwd:yr.join(e,"engine"),stdio:"pipe"}),r.stop("bundle install complete.")}catch(i){r.stop(W.default.yellow("bundle install failed \u2014 run it manually.")),k.warn(i instanceof Error?i.message:String(i))}}}function MS(e,t,r){let i=[""];i.push(W.default.bold("Next steps")),i.push(` ${W.default.dim("cd")} ${yr.relative(process.cwd(),t)||"."}`),r||(e.includeDashboard&&i.push(` ${W.default.dim("pnpm")} install`),e.includeEngine&&i.push(` ${W.default.dim("cd engine && bundle")} install && ${W.default.dim("cd ..")}`)),e.includeDashboard&&(i.push(""),i.push(W.default.bold("Dashboard plugin")),i.push(` Edit ${W.default.cyan("packages/dashboard/src/index.tsx")} to register nav entries and slot widgets.`),i.push(` Add pages as file routes in ${W.default.cyan("packages/dashboard/src/routes/")} \u2014 compiled into the host's typed route tree.`),i.push(` See ${W.default.cyan("https://spreecommerce.org/docs/developer/dashboard/plugins/overview")}`)),e.includeEngine&&(i.push(""),i.push(W.default.bold("Rails engine")),i.push(` Edit ${W.default.cyan(`engine/app/controllers/spree/api/v3/admin/${e.rubyName}_controller.rb`)}`),i.push(` See ${W.default.cyan("https://spreecommerce.org/docs/developer/contributing/creating-an-extension")}`)),i.push(""),H(i.join(`
1023
- `),"Your plugin is scaffolded.")}function FS(e){return e.split(/[_-]/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function GS(){let e=yr.dirname(RS(import.meta.url)),t=[yr.resolve(e,IS),yr.resolve(e,"templates/plugin")];for(let r of t)if(zo.existsSync(r))return r;throw new Error(`Plugin template not found. Looked in:
1022
+ ${ti.default.bold("\u2192 Installing + running pending Spree migrations...")}`),await U(["bin/rails","spree:install:migrations","db:migrate",...t],r.projectDir,{edgeHint:"the edge boot installs and runs pending migrations itself"})),H(`Run ${ti.default.bold("spree migrate:status")} to inspect the migration log.`,"Migrations up to date")}),e.command("migrate:rollback").description("Roll back the last migration (`STEP=n` to roll back n steps)").argument("[args...]","extra args forwarded to db:rollback (e.g. STEP=2)").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rails","db:rollback",...t],r.projectDir)}),e.command("migrate:status").description("Show migration status (`bin/rails db:migrate:status`)").action(async()=>{let t=v();await U(["bin/rails","db:migrate:status"],t.projectDir)})}p();import{platform as RS}from"os";function py(e){e.command("open").description("Open the admin dashboard in the browser").action(async()=>{let t=v(),r=wt(t.projectDir)?`http://localhost:${5173}`:`http://localhost:${t.port}/dashboard`,i=RS();await gt(`${i==="darwin"?"open":i==="win32"?"start":"xdg-open"} ${r}`)})}p();import zo from"fs";import yr from"path";import{fileURLToPath as IS}from"url";var W=L(J(),1);p();var cy=m;p();import ct from"fs";import Vn from"path";function uy(e){let{src:t,dst:r,vars:i,skip:n,force:s}=e;if(!ct.existsSync(t))throw new Error(`Template source not found: ${t}`);if(ct.existsSync(r)){if(ct.readdirSync(r).length>0&&!s)throw new Error(`Destination ${r} is not empty. Pass force=true to overwrite.`)}else ct.mkdirSync(r,{recursive:!0});ly(t,r,"",i,n)}function ly(e,t,r,i,n){let s=Vn.join(e,r);for(let a of ct.readdirSync(s,{withFileTypes:!0})){let o=r?`${r}/${a.name}`:a.name;if(n?.(o))continue;let c=my(Bo(a.name,i)),d=Vn.join(e,o);if(a.isDirectory()){let g=r?`${dy(r,i)}/${c}`:c,b=Vn.join(t,g);ct.mkdirSync(b,{recursive:!0}),ly(e,t,o,i,n);continue}let u=c.endsWith(".tt"),l=u?c.slice(0,-3):c,h=r?`${dy(r,i)}/${l}`:l,y=Vn.join(t,h);if(u){let g=ct.readFileSync(d,"utf8");ct.writeFileSync(y,Bo(g,i))}else ct.copyFileSync(d,y)}}function Bo(e,t){return e.replace(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g,(r,i)=>Object.hasOwn(t,i)?t[i]:r)}function dy(e,t){return e.split("/").map(r=>my(Bo(r,t))).join("/")}function my(e){if(e.includes("/")||e.includes("\\")||e==="..")throw new Error(`Template variable produced an unsafe path segment: "${e}"`);return e}var OS="../../templates/plugin",Hn=["MIT","Apache-2.0","BSD-3-Clause"];function yy(e){e.command("plugin").description("Scaffold and manage Spree plugins (dashboard + Rails engine)").command("new").description("Scaffold a new Spree plugin monorepo (dashboard plugin half today; Rails engine coming soon)").argument("[name]","Plugin name (e.g. brands). If omitted, you will be prompted.").option("--ruby-name <name>","Ruby gem name (default: spree_<name>)").option("--module-name <name>","Ruby module / TS namespace (default: PascalCase of the gem name)").option("--npm-scope <scope>","npm scope, e.g. @acme (default: unscoped)").option("--author <name>","Author name (default: git config user.name)").option("--author-email <email>","Author email (default: git config user.email)").option("--license <license>",`License: ${Hn.join(", ")} (default: MIT)`).option("-y, --yes","Non-interactive: accept the default for every prompt not answered by a flag",!1).option("--no-dashboard","Skip the dashboard plugin half").option("--no-engine","Skip the Rails engine half (currently always skipped \u2014 engine support coming soon)").option("--no-install","Skip running pnpm install").option("--force","Overwrite a non-empty destination directory").action(async(r,i)=>{bi(W.default.bgCyan(W.default.black(" Spree Plugin Scaffolder ")));let n=await DS(r,i);F(n)&&(C("Scaffolding cancelled."),process.exit(0));let s=yr.resolve(process.cwd(),n.name);zo.existsSync(s)&&zo.readdirSync(s).length>0&&!i.force&&(C(`Destination ${W.default.bold(s)} is not empty. Choose a different name or rerun with ${W.default.cyan("--force")}.`),process.exit(1));let a=BS(n),o=US(),c=M();c.start(`Scaffolding ${W.default.cyan(n.name)}...`);try{uy({src:o,dst:s,vars:a,skip:zS(n),force:i.force})}catch(d){c.stop("Scaffolding failed."),k.error(d instanceof Error?d.message:String(d)),process.exit(1)}c.stop(`Created ${W.default.cyan(s)}`),i.install?await MS(s,n):k.info(W.default.dim("Skipping dependency install \u2014 run them yourself when ready.")),FS(n,s,i.install),Ot("Happy hacking!")})}async function DS(e,t){let r=q=>{if(!q)return"Required";if(!/^[a-z][a-z0-9-]*$/.test(q))return'Use lowercase letters, digits, and dashes (e.g. "brands" or "loyalty-points")'};if(e!==void 0){let q=r(e);q&&(k.error(`Invalid plugin name ${W.default.bold(e)}: ${q}`),process.exit(2))}e===void 0&&t.yes&&(k.error("Pass the plugin name as an argument when using --yes: spree plugin new <name> -y"),process.exit(2));let i=e??await ye({message:"Plugin name",placeholder:"brands",validate:r});if(F(i))return i;let n=`spree_${i.replace(/-/g,"_")}`,s=await hr({flag:"--ruby-name",flagValue:t.rubyName,fallback:n,yes:t.yes,validate:q=>q&&/^[a-z][a-z0-9_]*$/.test(q)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")',prompt:()=>ye({message:"Ruby gem name",placeholder:n,initialValue:n,validate:q=>q&&/^[a-z][a-z0-9_]*$/.test(q)?void 0:'Use lowercase letters, digits, and underscores (e.g. "spree_brands")'})});if(F(s))return s;let a=GS(s),o=await hr({flag:"--module-name",flagValue:t.moduleName,fallback:a,yes:t.yes,validate:q=>q&&/^[A-Z][A-Za-z0-9]*$/.test(q)?void 0:'PascalCase (e.g. "SpreeBrands")',prompt:()=>ye({message:"Ruby module / TS namespace",placeholder:a,initialValue:a,validate:q=>q&&/^[A-Z][A-Za-z0-9]*$/.test(q)?void 0:'PascalCase (e.g. "SpreeBrands")'})});if(F(o))return o;let c=q=>!q||/^@[a-z0-9][a-z0-9-]*$/.test(q)?void 0:"Must start with @ and contain lowercase letters/digits/dashes",d=await hr({flag:"--npm-scope",flagValue:t.npmScope,fallback:"",yes:t.yes,validate:c,prompt:()=>ye({message:"npm scope (optional, leave blank for unscoped)",placeholder:"@my-org",initialValue:"",validate:c})});if(F(d))return d;let u=t.author===void 0?await hy("user.name"):void 0,l=await hr({flag:"--author",flagValue:t.author,fallback:u,yes:t.yes,validate:q=>q?void 0:"Required",prompt:()=>ye({message:"Author name",placeholder:"Jane Developer",initialValue:u??"",validate:q=>q?void 0:"Required"})});if(F(l))return l;let h=q=>q&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(q)?void 0:"Enter a valid email",y=t.authorEmail===void 0?await hy("user.email"):void 0,g=await hr({flag:"--author-email",flagValue:t.authorEmail,fallback:y,yes:t.yes,validate:h,prompt:()=>ye({message:"Author email",placeholder:"jane@example.com",initialValue:y??"",validate:h})});if(F(g))return g;let b=q=>q&&Hn.includes(q)?void 0:`Must be one of: ${Hn.join(", ")}`,$=await hr({flag:"--license",flagValue:t.license,fallback:"MIT",yes:t.yes,validate:b,prompt:()=>ki({message:"License",options:Hn.map(q=>({value:q,label:q})),initialValue:"MIT"})});if(F($))return $;let S=t.dashboard===!1?!1:t.yes||await LS("Include dashboard plugin?",!0);if(F(S))return S;let A=!1;return t.engine!==!1&&k.warn("Rails engine generation is coming in a future release. For now, scaffold the dashboard half here and use `spree-extension create` for the Ruby side."),!S&&!A&&(C("Nothing to scaffold (dashboard half declined)."),process.exit(1)),{name:i,rubyName:s,moduleName:o,npmScope:d.trim(),authorName:l,authorEmail:g,license:$,includeDashboard:S,includeEngine:A}}async function LS(e,t){return await ut({message:e,initialValue:t})}async function hr(e){if(e.flagValue!==void 0){let t=e.validate(e.flagValue);return t&&(k.error(`Invalid value for ${W.default.cyan(e.flag)}: ${t}`),process.exit(2)),e.flagValue}if(e.yes){let t=e.validate(e.fallback);return(e.fallback===void 0||t)&&(k.error(`--yes could not resolve a default for ${W.default.cyan(e.flag)}`+(t?` (${t})`:"")+` \u2014 pass ${W.default.cyan(e.flag)} explicitly.`),process.exit(2)),e.fallback}return e.prompt()}async function hy(e){try{let{stdout:t}=await gt(`git config --get ${e}`);return t.trim()||void 0}catch{return}}function BS(e){let t=e.npmScope?`${e.npmScope}/${e.name}`:e.name;return{name:e.name,plugin_name:e.name,ruby_name:e.rubyName,module_name:e.moduleName,npm_scope:e.npmScope,npm_package_name:t,npm_dashboard_package:e.npmScope?`${e.npmScope}/${e.name}-dashboard`:`${e.name}-dashboard`,author_name:e.authorName,author_email:e.authorEmail,license:e.license,year:String(new Date().getFullYear()),...cy}}function zS(e){let t=!e.includeDashboard,r=!e.includeEngine;return i=>!!(t&&(i==="packages/dashboard"||i.startsWith("packages/dashboard/"))||r&&(i==="engine"||i.startsWith("engine/")))}async function MS(e,t){let r=M();if(t.includeDashboard){r.start("Running pnpm install...");try{await gt("pnpm install",{cwd:e,stdio:"pipe"}),r.stop("pnpm install complete.")}catch(i){r.stop(W.default.yellow("pnpm install failed \u2014 run it manually.")),k.warn(i instanceof Error?i.message:String(i))}}if(t.includeEngine){r.start("Running bundle install in engine/...");try{await gt("bundle install",{cwd:yr.join(e,"engine"),stdio:"pipe"}),r.stop("bundle install complete.")}catch(i){r.stop(W.default.yellow("bundle install failed \u2014 run it manually.")),k.warn(i instanceof Error?i.message:String(i))}}}function FS(e,t,r){let i=[""];i.push(W.default.bold("Next steps")),i.push(` ${W.default.dim("cd")} ${yr.relative(process.cwd(),t)||"."}`),r||(e.includeDashboard&&i.push(` ${W.default.dim("pnpm")} install`),e.includeEngine&&i.push(` ${W.default.dim("cd engine && bundle")} install && ${W.default.dim("cd ..")}`)),e.includeDashboard&&(i.push(""),i.push(W.default.bold("Dashboard plugin")),i.push(` Edit ${W.default.cyan("packages/dashboard/src/index.tsx")} to register nav entries and slot widgets.`),i.push(` Add pages as file routes in ${W.default.cyan("packages/dashboard/src/routes/")} \u2014 compiled into the host's typed route tree.`),i.push(` See ${W.default.cyan("https://spreecommerce.org/docs/developer/dashboard/plugins/overview")}`)),e.includeEngine&&(i.push(""),i.push(W.default.bold("Rails engine")),i.push(` Edit ${W.default.cyan(`engine/app/controllers/spree/api/v3/admin/${e.rubyName}_controller.rb`)}`),i.push(` See ${W.default.cyan("https://spreecommerce.org/docs/developer/contributing/creating-an-extension")}`)),i.push(""),H(i.join(`
1023
+ `),"Your plugin is scaffolded.")}function GS(e){return e.split(/[_-]/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function US(){let e=yr.dirname(IS(import.meta.url)),t=[yr.resolve(e,OS),yr.resolve(e,"templates/plugin")];for(let r of t)if(zo.existsSync(r))return r;throw new Error(`Plugin template not found. Looked in:
1024
1024
  ${t.join(`
1025
1025
  `)}
1026
1026
 
1027
- Reinstall @spree/cli to fix.`)}p();function gy(e){e.command("rails").description("Run a Rails command (`bin/rails \u2026`) inside the web container").argument("<args...>","arguments to pass to bin/rails").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rails",...t],r.projectDir)})}p();function fy(e){e.command("rake").description("Run a rake task (`bin/rake \u2026`) inside the web container").argument("<args...>","task name and arguments").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rake",...t],r.projectDir)})}p();function _y(e){e.command("restart").description("Restart web + worker in place (does not reload Gemfile or compose changes)").action(async()=>{let t=v(),r=M();r.start("Restarting web + worker...");try{await X(["restart",...await Ae(t.projectDir)],t.projectDir),r.stop("Services restarted.")}catch(i){throw r.stop("Restart failed."),i}})}p();function by(e){e.command("routes").description("Show Rails routes (`bin/rails routes`)").argument("[args...]","arguments to pass to bin/rails routes").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rails","routes",...t],r.projectDir)})}p();function qy(e){e.command("rspec").description("Run RSpec tests (`bundle exec rspec \u2026`) inside the web container").argument("[args...]","files, line numbers, and flags to pass to rspec").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bundle","exec","rspec",...t],r.projectDir,{env:{RAILS_ENV:"test"},edgeHint:"then re-run spree rspec"})})}p();function ky(e){e.command("sample-data").description("Load sample data (products, categories, images)").action(async()=>{let t=v(),r=M();r.start("Loading sample data..."),await pe("spree:load_sample_data",t.projectDir),r.stop("Sample data loaded.")})}p();function vy(e){e.command("seed").description("Seed the database").action(async()=>{let t=v(),r=M();r.start("Seeding database..."),await pe("db:seed",t.projectDir),r.stop("Database seeded.")})}p();function wy(e){e.command("shell").alias("bash").description("Open an interactive bash shell inside the web container").action(async()=>{let t=v();await U(["bash"],t.projectDir,{edgeHint:"then open the shell"})})}p();function xy(e){e.command("stop").description("Stop services").action(async()=>{let t=v(),r=M();r.start("Stopping services..."),await X(["stop"],t.projectDir),r.stop("Services stopped.")})}p();function Sy(e){e.command("task").description("Run a Spree rake task (auto-prefixes `spree:`)").argument("<name>","task name (without `spree:` prefix)").argument("[args...]","arguments to pass to the task").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=v();await U(["bin/rake",`spree:${t}`,...r],i.projectDir)})}p();import Wn from"fs";import ri from"path";var ne=L(J(),1);function jy(e){$y(e.command("upgrade").description("Upgrade Spree: the server (image or gems), migrations, data backfills and @spree/* packages")).action(Ay),$y(e.command("update",{hidden:!0})).action(async t=>{k.warn(`${ne.default.bold("spree update")} is deprecated and will be removed in a future release \u2014 use ${ne.default.bold("spree upgrade")}.`),await Ay(t)})}function $y(e){return e.option("--plan","list the data backfills a run would execute \u2014 for the installed Spree version, or the --to version (DRY_RUN=1); runs nothing else").option("--step <id>","run a single rake step by id (runs nothing else)").option("--to <version>","explicit target version (auto-detected from installed gem otherwise)").option("--yes","skip prompts on automated steps")}async function Ay(e){let t=v();if(await VS(t.projectDir),e.plan||e.step){await Mo(t.projectDir,e),e.plan||Ey(t.projectDir);return}if(We(t.projectDir)){let r=await HS(t.projectDir,e);await KS(t.projectDir,e),await Mo(t.projectDir,e),r&&await NS(t.projectDir)}else await US(t.projectDir,e),await Mo(t.projectDir,e);await ZS(t.projectDir,e),Ey(t.projectDir)}async function Kn(e,t){if(t.yes)return!0;let r=await ut({message:e,initialValue:!0});return F(r)&&(C("Upgrade aborted."),process.exit(0)),r}async function US(e,t){if(!await Kn("Pull the latest Spree image and recreate the containers?",t)){k.info("Skipping the image pull.");return}k.step(ne.default.bold("docker compose pull")),await X(["pull"],e,{stdio:"inherit"}),k.step(ne.default.bold("Recreating containers and running migrations")),await Zt(e),await X(["up","-d","--wait"],e,{stdio:"inherit"})}async function NS(e){await at("web",e)&&(k.step(ne.default.bold("Restarting the app to load the updated gems")),await X(["restart",...await Ae(e)],e,{stdio:"inherit"}))}async function VS(e){let t=r=>{C(r.join(`
1027
+ Reinstall @spree/cli to fix.`)}p();function gy(e){e.command("rails").description("Run a Rails command (`bin/rails \u2026`) inside the web container").argument("<args...>","arguments to pass to bin/rails").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rails",...t],r.projectDir)})}p();function fy(e){e.command("rake").description("Run a rake task (`bin/rake \u2026`) inside the web container").argument("<args...>","task name and arguments").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rake",...t],r.projectDir)})}p();function _y(e){e.command("restart").description("Restart web + worker in place (does not reload Gemfile or compose changes)").action(async()=>{let t=v(),r=M();r.start("Restarting web + worker...");try{await X(["restart",...await Ae(t.projectDir)],t.projectDir),r.stop("Services restarted.")}catch(i){throw r.stop("Restart failed."),i}})}p();function by(e){e.command("routes").description("Show Rails routes (`bin/rails routes`)").argument("[args...]","arguments to pass to bin/rails routes").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bin/rails","routes",...t],r.projectDir)})}p();function qy(e){e.command("rspec").description("Run RSpec tests (`bundle exec rspec \u2026`) inside the web container").argument("[args...]","files, line numbers, and flags to pass to rspec").allowUnknownOption(!0).passThroughOptions(!0).action(async t=>{let r=v();await U(["bundle","exec","rspec",...t],r.projectDir,{env:{RAILS_ENV:"test"},edgeHint:"then re-run spree rspec"})})}p();function ky(e){e.command("sample-data").description("Load sample data (products, categories, images)").action(async()=>{let t=v(),r=M();r.start("Loading sample data..."),await pe("spree:load_sample_data",t.projectDir),r.stop("Sample data loaded.")})}p();function vy(e){e.command("seed").description("Seed the database").action(async()=>{let t=v(),r=M();r.start("Seeding database..."),await pe("db:seed",t.projectDir),r.stop("Database seeded.")})}p();function wy(e){e.command("shell").alias("bash").description("Open an interactive bash shell inside the web container").action(async()=>{let t=v();await U(["bash"],t.projectDir,{edgeHint:"then open the shell"})})}p();function xy(e){e.command("stop").description("Stop services").action(async()=>{let t=v(),r=M();r.start("Stopping services..."),await X(["stop"],t.projectDir),r.stop("Services stopped.")})}p();function Sy(e){e.command("task").description("Run a Spree rake task (auto-prefixes `spree:`)").argument("<name>","task name (without `spree:` prefix)").argument("[args...]","arguments to pass to the task").allowUnknownOption(!0).passThroughOptions(!0).action(async(t,r)=>{let i=v();await U(["bin/rake",`spree:${t}`,...r],i.projectDir)})}p();import Wn from"fs";import ri from"path";var ne=L(J(),1);function Py(e){$y(e.command("upgrade").description("Upgrade Spree: the server (image or gems), @spree/* packages, migrations and data backfills")).action(Ay),$y(e.command("update",{hidden:!0})).action(async t=>{k.warn(`${ne.default.bold("spree update")} is deprecated and will be removed in a future release \u2014 use ${ne.default.bold("spree upgrade")}.`),await Ay(t)})}function $y(e){return e.option("--plan","list the data backfills a run would execute \u2014 for the installed Spree version, or the --to version (DRY_RUN=1); runs nothing else").option("--step <id>","run a single rake step by id (runs nothing else)").option("--to <version>","explicit target version (auto-detected from installed gem otherwise)").option("--yes","skip prompts on automated steps")}async function Ay(e){let t=v();if(await WS(t.projectDir),e.plan||e.step){await Mo(t.projectDir,e),e.plan||jy(t.projectDir);return}if(We(t.projectDir)){let r=await KS(t.projectDir,e);await Ey(t.projectDir,e),await JS(t.projectDir,e),await Mo(t.projectDir,e),r&&await HS(t.projectDir)}else{let r=await NS(t.projectDir,e);await Ey(t.projectDir,e),r&&await VS(t.projectDir),await Mo(t.projectDir,e)}jy(t.projectDir)}async function Kn(e,t){if(t.yes)return!0;let r=await ut({message:e,initialValue:!0});return F(r)&&(C("Upgrade aborted."),process.exit(0)),r}async function NS(e,t){return await Kn("Pull the latest Spree image and recreate the containers?",t)?(k.step(ne.default.bold("docker compose pull")),await X(["pull"],e,{stdio:"inherit"}),!0):(k.info("Skipping the image pull."),!1)}async function VS(e){k.step(ne.default.bold("Recreating containers and running migrations")),await Zt(e),await X(["up","-d","--wait"],e,{stdio:"inherit"})}async function HS(e){await at("web",e)&&(k.step(ne.default.bold("Restarting the app to load the updated gems")),await X(["restart",...await Ae(e)],e,{stdio:"inherit"}))}async function WS(e){let t=r=>{C(r.join(`
1028
1028
  `)),process.exit(1)};He(e)&&t(["This is a monorepo edge project (SPREE_PATH set in .env).",`Run the upgrade from the monorepo root with ${ne.default.bold("pnpm server:*")} \u2014 the`,"project-local docker-compose.yml is not the running config here."]);try{await at("web",e)}catch(r){t(["Could not inspect the Docker stack from this directory.",` ${ne.default.dim(String(r.message).split(`
1029
- `)[0])}`,"",`Run ${ne.default.bold("spree upgrade")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}}async function HS(e,t){if(!await Kn("Run `bundle update` to bump Spree gems?",t))return k.info("Skipping `bundle update`."),!1;let r=await WS(e);if(r.length===0)throw new Error('No Spree gems detected in Gemfile.lock. Confirm the project has `gem "spree"` (or `spree_core`) in its Gemfile.');return k.step(ne.default.bold(`bundle update ${r.join(" ")}`)),await U(["bundle","update",...r],e),!0}async function WS(e){try{return(await ro(["bundle","list","--name-only"],e)).split(`
1029
+ `)[0])}`,"",`Run ${ne.default.bold("spree upgrade")} from your project root (the directory holding the`,".env with SECRET_KEY_BASE), and make sure Docker is running."])}}async function KS(e,t){if(!await Kn("Run `bundle update` to bump Spree gems?",t))return k.info("Skipping `bundle update`."),!1;let r=await YS(e);if(r.length===0)throw new Error('No Spree gems detected in Gemfile.lock. Confirm the project has `gem "spree"` (or `spree_core`) in its Gemfile.');return k.step(ne.default.bold(`bundle update ${r.join(" ")}`)),await U(["bundle","update",...r],e),!0}async function YS(e){try{return(await ro(["bundle","list","--name-only"],e)).split(`
1030
1030
  `).map(r=>r.trim()).filter(r=>r.startsWith("spree"))}catch(t){let r=t;throw new Error("Could not list gems in the web container \u2014 the bundle looks out of sync.\nRun `spree bundle install` first, then re-run `spree upgrade`."+(r.stderr?.trim()?`
1031
1031
 
1032
- ${r.stderr.trim()}`:""))}}async function KS(e,t){if(!await Kn("Install + run pending migrations?",t)){k.info("Skipping migrations.");return}k.step(ne.default.bold("spree:install:migrations + db:migrate")),await U(["bin/rails","spree:install:migrations","db:migrate"],e)}async function Mo(e,t){let r={};t.plan&&(r.DRY_RUN="1"),t.step&&(r.STEP=t.step),t.to&&(r.TO=t.to),k.step(ne.default.bold("spree:upgrade")),await U(["bin/rake","spree:upgrade"],e,{env:r})}var YS=/^[\^~<>=\d*]|^latest$|^next$/;function JS(e){try{let t=JSON.parse(Wn.readFileSync(ri.join(e,"package.json"),"utf-8"));return Object.entries({...t.dependencies,...t.devDependencies}).filter(([r,i])=>r.startsWith("@spree/")&&YS.test(i)).map(([r])=>r)}catch{return[]}}function XS(e,t,r,i){return e!=="yarn"?["update",...t]:[i,r].some(s=>Wn.existsSync(ri.join(s,".yarnrc.yml")))?["up","-R",...t]:["upgrade",...t]}async function ZS(e,t){let r=[".",...lo.map(i=>ri.join("apps",i))].map(i=>({relative:i,dir:ri.join(e,i)})).map(i=>({...i,packages:JS(i.dir)})).filter(i=>i.packages.length>0);if(r.length!==0){if(!await Kn("Update the @spree/* packages of the project and admin apps?",t)){k.info("Skipping the @spree/* packages.");return}for(let i of r){let n=_t(e,i.dir),s=XS(n,i.packages,e,i.dir);k.step(`${ne.default.bold(`${n} ${s.join(" ")}`)} ${ne.default.dim(`in ${i.relative}`)}`),await Z(n,s,{cwd:i.dir,stdio:"inherit"}),i.relative!=="."&&await uo(i.dir)}}}function QS(e){let t="Update @spree/sdk in any storefront or integration consuming the API",r=ri.join(e,"apps","storefront","package.json");if(!Wn.existsSync(r))return t;try{let i=JSON.parse(Wn.readFileSync(r,"utf-8")),n=i.dependencies?.["@spree/sdk"]??i.devDependencies?.["@spree/sdk"];return n?`Update @spree/sdk in apps/storefront (currently ${n}) to the release matching the new Spree version`:t}catch{return t}}function Ey(e){H([`The manifest only ran ${ne.default.bold("rake-automatable")} steps.`,"","Don't forget the manual parts from the upgrade doc:",` ${ne.default.dim("- Compare your scheduled jobs (config/recurring.yml) with the upgrade guide")}`,` ${ne.default.dim(`- ${QS(e)}`)}`,` ${ne.default.dim("- Review the behavior changes listed in the upgrade guide")}`,` ${ne.default.dim("- Audit custom decorators against renamed APIs")}`,"",`Full checklist: ${ne.default.cyan("https://spreecommerce.org/docs/developer/upgrades/quickstart")}`].join(`
1033
- `),"Next steps")}p();var Py=L(J(),1);function Ty(e){e.command("user").description("Manage admin users").command("create").description("Create an admin user").option("--email <email>","admin email").option("--password <password>","admin password").action(async r=>{let i=v(),n=r.email,s=r.password;if(!n){let o=await ye({message:"Admin email:",placeholder:"admin@example.com",validate(c){if(!c)return"Email is required";if(!c.includes("@"))return"Invalid email"}});F(o)&&(C("Cancelled."),process.exit(0)),n=o}if(!s){let o=await qi({message:"Admin password:",validate(c){if(!c||c.length<6)return"Password must be at least 6 characters"}});F(o)&&(C("Cancelled."),process.exit(0)),s=o}let a=M();a.start("Creating admin user..."),await pe("spree:cli:create_admin",i.projectDir,{EMAIL:n,PASSWORD:s}),a.stop("Admin user created."),k.success(`Email: ${Py.default.cyan(n)}`)})}p();import{createRequire as e$}from"module";var t$=e$(import.meta.url),Cy=t$("../package.json").version;var I=new tp().name("spree").description("CLI for managing Spree Commerce projects").version(Cy).enablePositionalOptions().showSuggestionAfterError(!0).showHelpAfterError("(run `spree --help` for usage)").exitOverride(e=>{(e.code.startsWith("commander.help")||e.code==="commander.version")&&process.exit(0),process.exit(2)});Nh(I);Hm(I);Wh(I);xy(I);_y(I);ay(I);Kh(I);Dh(I);sy(I);oy(I);Gh(I);by(I);jy(I);ny(I);gy(I);Lh(I);fy(I);Sy(I);qy(I);Fh(I);wy(I);Ty(I);Rh(I);iy(I);py(I);vy(I);ky(I);yy(I);Th(I);Oh(I);Mh(I);async function r$(){try{await I.parseAsync()}catch(e){e instanceof Error&&"code"in e&&(e.code==="commander.helpDisplayed"||e.code==="commander.version")&&process.exit(0),e instanceof Error&&"code"in e&&String(e.code).startsWith("commander.")&&process.exit(2);let t=e instanceof Error&&e.constructor.name==="CredentialError"?2:1,r=e instanceof Error?e.message:"An unexpected error occurred.";console.error(`
1034
- ${Ry.default.red("Error:")} ${r}
1035
- `),process.exit(t)}}r$();
1032
+ ${r.stderr.trim()}`:""))}}async function JS(e,t){if(!await Kn("Install + run pending migrations?",t)){k.info("Skipping migrations.");return}k.step(ne.default.bold("spree:install:migrations + db:migrate")),await U(["bin/rails","spree:install:migrations","db:migrate"],e)}async function Mo(e,t){let r={};t.plan&&(r.DRY_RUN="1"),t.step&&(r.STEP=t.step),t.to&&(r.TO=t.to),k.step(ne.default.bold("spree:upgrade")),await U(["bin/rake","spree:upgrade"],e,{env:r})}var XS=/^[\^~<>=\d*]|^latest$|^next$/;function ZS(e){try{let t=JSON.parse(Wn.readFileSync(ri.join(e,"package.json"),"utf-8"));return Object.entries({...t.dependencies,...t.devDependencies}).filter(([r,i])=>r.startsWith("@spree/")&&XS.test(i)).map(([r])=>r)}catch{return[]}}function QS(e,t,r,i){return e!=="yarn"?["update",...t]:[i,r].some(s=>Wn.existsSync(ri.join(s,".yarnrc.yml")))?["up","-R",...t]:["upgrade",...t]}async function Ey(e,t){let r=[".",...lo.map(i=>ri.join("apps",i))].map(i=>({relative:i,dir:ri.join(e,i)})).map(i=>({...i,packages:ZS(i.dir)})).filter(i=>i.packages.length>0);if(r.length!==0){if(!await Kn("Update the @spree/* packages of the project and admin apps?",t)){k.info("Skipping the @spree/* packages.");return}for(let i of r){let n=_t(e,i.dir),s=QS(n,i.packages,e,i.dir);k.step(`${ne.default.bold(`${n} ${s.join(" ")}`)} ${ne.default.dim(`in ${i.relative}`)}`),await Z(n,s,{cwd:i.dir,stdio:"inherit"}),i.relative!=="."&&await uo(i.dir)}}}function e$(e){let t="Update @spree/sdk in any storefront or integration consuming the API",r=ri.join(e,"apps","storefront","package.json");if(!Wn.existsSync(r))return t;try{let i=JSON.parse(Wn.readFileSync(r,"utf-8")),n=i.dependencies?.["@spree/sdk"]??i.devDependencies?.["@spree/sdk"];return n?`Update @spree/sdk in apps/storefront (currently ${n}) to the release matching the new Spree version`:t}catch{return t}}function jy(e){H([`The manifest only ran ${ne.default.bold("rake-automatable")} steps.`,"","Don't forget the manual parts from the upgrade doc:",` ${ne.default.dim("- Compare your scheduled jobs (config/recurring.yml) with the upgrade guide")}`,` ${ne.default.dim(`- ${e$(e)}`)}`,` ${ne.default.dim("- Review the behavior changes listed in the upgrade guide")}`,` ${ne.default.dim("- Audit custom decorators against renamed APIs")}`,"",`Full checklist: ${ne.default.cyan("https://spreecommerce.org/docs/developer/upgrades/quickstart")}`].join(`
1033
+ `),"Next steps")}p();var Ty=L(J(),1);function Cy(e){e.command("user").description("Manage admin users").command("create").description("Create an admin user").option("--email <email>","admin email").option("--password <password>","admin password").action(async r=>{let i=v(),n=r.email,s=r.password;if(!n){let o=await ye({message:"Admin email:",placeholder:"admin@example.com",validate(c){if(!c)return"Email is required";if(!c.includes("@"))return"Invalid email"}});F(o)&&(C("Cancelled."),process.exit(0)),n=o}if(!s){let o=await qi({message:"Admin password:",validate(c){if(!c||c.length<6)return"Password must be at least 6 characters"}});F(o)&&(C("Cancelled."),process.exit(0)),s=o}let a=M();a.start("Creating admin user..."),await pe("spree:cli:create_admin",i.projectDir,{EMAIL:n,PASSWORD:s}),a.stop("Admin user created."),k.success(`Email: ${Ty.default.cyan(n)}`)})}p();import{createRequire as t$}from"module";var r$=t$(import.meta.url),Ry=r$("../package.json").version;var I=new tp().name("spree").description("CLI for managing Spree Commerce projects").version(Ry).enablePositionalOptions().showSuggestionAfterError(!0).showHelpAfterError("(run `spree --help` for usage)").exitOverride(e=>{(e.code.startsWith("commander.help")||e.code==="commander.version")&&process.exit(0),process.exit(2)});Nh(I);Hm(I);Wh(I);xy(I);_y(I);ay(I);Kh(I);Dh(I);sy(I);oy(I);Gh(I);by(I);Py(I);ny(I);gy(I);Lh(I);fy(I);Sy(I);qy(I);Fh(I);wy(I);Cy(I);Rh(I);iy(I);py(I);vy(I);ky(I);yy(I);Th(I);Oh(I);Mh(I);async function i$(){try{await I.parseAsync()}catch(e){e instanceof Error&&"code"in e&&(e.code==="commander.helpDisplayed"||e.code==="commander.version")&&process.exit(0),e instanceof Error&&"code"in e&&String(e.code).startsWith("commander.")&&process.exit(2);let t=e instanceof Error&&e.constructor.name==="CredentialError"?2:1,r=e instanceof Error?e.message:"An unexpected error occurred.";console.error(`
1034
+ ${Iy.default.red("Error:")} ${r}
1035
+ `),process.exit(t)}}i$();