@storybook/addon-a11y 8.7.0-alpha.0 → 9.0.0-alpha.1

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
@@ -6,7 +6,7 @@ var previewApi = require('storybook/internal/preview-api');
6
6
  var test = require('@storybook/test');
7
7
  var global = require('@storybook/global');
8
8
 
9
- var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __esm=(fn,res)=>function(){return fn&&(res=(0, fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0});};function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var wrapAnsi16,wrapAnsi256,wrapAnsi16m,styles,foregroundColorNames,backgroundColorNames,ansiStyles,ansi_styles_default,init_ansi_styles=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/ansi-styles/index.js"(){wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Object.keys(styles.modifier),foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor),[...foregroundColorNames,...backgroundColorNames];ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;}});var level,colorSupport,supportsColor,browser_default,init_browser=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/supports-color/browser.js"(){level=(()=>{if(navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;}});function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
9
+ var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __esm=(fn,res)=>function(){return fn&&(res=(0, fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0});};function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var wrapAnsi16,wrapAnsi256,wrapAnsi16m,styles,foregroundColorNames,backgroundColorNames,ansiStyles,ansi_styles_default,init_ansi_styles=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/ansi-styles/index.js"(){wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Object.keys(styles.modifier),foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor),[...foregroundColorNames,...backgroundColorNames];ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;}});var level,colorSupport,supportsColor,browser_default,init_browser=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/supports-color/browser.js"(){level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;}});function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
10
10
  `:`
11
11
  `)+postfix,endIndex=index+1,index=string.indexOf(`
12
12
  `,endIndex);}while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}var init_utilities=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/utilities.js"(){}});function createChalk(options){return chalkFactory(options)}var stdoutColor,stderrColor,GENERATOR,STYLER,IS_EMPTY,levelMapping,styles2,applyOptions,chalkFactory,getModelAnsi,usedModels,proto,createStyler,createBuilder,applyStyle,chalk,source_default,init_source=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/index.js"(){init_ansi_styles();init_browser();init_utilities();(({stdout:stdoutColor,stderr:stderrColor}=browser_default)),GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles2=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level;},chalkFactory=options=>{let chalk2=(...strings)=>strings.join(" ");return applyOptions(chalk2,options),Object.setPrototypeOf(chalk2,createChalk.prototype),chalk2};Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[styleName,style]of Object.entries(ansi_styles_default))styles2[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles2.visible={get(){let builder=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};getModelAnsi=(model,level2,type,...arguments_)=>model==="rgb"?level2==="ansi16m"?ansi_styles_default[type].ansi16m(...arguments_):level2==="ansi256"?ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)):ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)):model==="hex"?getModelAnsi("rgb",level2,type,...ansi_styles_default.hexToRgb(...arguments_)):ansi_styles_default[type][model](...arguments_),usedModels=["rgb","hex","ansi256"];for(let model of usedModels){styles2[model]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"color",...arguments_),ansi_styles_default.color.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles2[bgModel]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"bgColor",...arguments_),ansi_styles_default.bgColor.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};}proto=Object.defineProperties(()=>{},{...styles2,level:{enumerable:!0,get(){return this[GENERATOR].level},set(level2){this[GENERATOR].level=level2;}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder[GENERATOR]=self,builder[STYLER]=_styler,builder[IS_EMPTY]=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self[IS_EMPTY]?"":string;let styler=self[STYLER];if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.includes("\x1B"))for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
package/dist/index.mjs CHANGED
@@ -3,6 +3,6 @@ import { addons, definePreview } from 'storybook/internal/preview-api';
3
3
  import { expect } from '@storybook/test';
4
4
  import { global } from '@storybook/global';
5
5
 
6
- var preview_exports={};__export(preview_exports,{experimental_afterEach:()=>experimental_afterEach,initialGlobals:()=>initialGlobals,parameters:()=>parameters});var ADDON_ID="storybook/a11y",PARAM_KEY="a11y",RESULT=`${ADDON_ID}/result`,REQUEST=`${ADDON_ID}/request`,RUNNING=`${ADDON_ID}/running`,ERROR=`${ADDON_ID}/error`,MANUAL=`${ADDON_ID}/manual`;var EVENTS={RESULT,REQUEST,RUNNING,ERROR,MANUAL};var{document}=global,channel=addons.getChannel(),defaultParameters={config:{},options:{}},disabledRules=["region"],queue=[],isRunning=!1,runNext=async()=>{if(queue.length===0){isRunning=!1;return}isRunning=!0;let next=queue.shift();next&&await next(),runNext();},run=async(input=defaultParameters)=>{let{default:axe}=await import('axe-core'),{element="body",config={},options={}}=input,htmlElement=document.querySelector(element)??document.body;if(!htmlElement)return;axe.reset();let configWithDefault={...config,rules:[...disabledRules.map(id=>({id,enabled:!1})),...config?.rules??[]]};return axe.configure(configWithDefault),new Promise((resolve,reject)=>{let task=async()=>{try{let result=await axe.run(htmlElement,options);resolve(result);}catch(error){reject(error);}};queue.push(task),isRunning||runNext();})};channel.on(EVENTS.MANUAL,async(storyId,input=defaultParameters)=>{try{let result=await run(input),resultJson=JSON.parse(JSON.stringify(result));channel.emit(EVENTS.RESULT,resultJson,storyId);}catch(error){channel.emit(EVENTS.ERROR,error);}});function getIsVitestStandaloneRun(){try{return import.meta.env.VITEST_STORYBOOK==="false"}catch{return !1}}var vitestMatchersExtended=!1,experimental_afterEach=async({reporting,parameters:parameters2,globals})=>{let a11yParameter=parameters2.a11y,a11yGlobals=globals.a11y,shouldRunEnvironmentIndependent=a11yParameter?.manual!==!0&&a11yParameter?.disable!==!0&&a11yParameter?.test!=="off"&&a11yGlobals?.manual!==!0,getMode=()=>{switch(a11yParameter?.test){case"todo":return "warning";case"error":default:return "failed"}};if(shouldRunEnvironmentIndependent)try{let result=await run(a11yParameter);if(result){let hasViolations=(result?.violations.length??0)>0;if(reporting.addReport({type:"a11y",version:1,result,status:hasViolations?getMode():"passed"}),getIsVitestStandaloneRun()&&hasViolations&&getMode()==="failed"){if(!vitestMatchersExtended){let{toHaveNoViolations}=await import('./matchers-K6QHBOFC.mjs');expect.extend({toHaveNoViolations}),vitestMatchersExtended=!0;}expect(result).toHaveNoViolations();}}}catch(e){if(reporting.addReport({type:"a11y",version:1,result:{error:e},status:"failed"}),getIsVitestStandaloneRun())throw e}},initialGlobals={a11y:{manual:!1}},parameters={a11y:{test:"todo"}};var index_default=()=>definePreview(preview_exports);
6
+ var preview_exports={};__export(preview_exports,{experimental_afterEach:()=>experimental_afterEach,initialGlobals:()=>initialGlobals,parameters:()=>parameters});var ADDON_ID="storybook/a11y",PARAM_KEY="a11y",RESULT=`${ADDON_ID}/result`,REQUEST=`${ADDON_ID}/request`,RUNNING=`${ADDON_ID}/running`,ERROR=`${ADDON_ID}/error`,MANUAL=`${ADDON_ID}/manual`;var EVENTS={RESULT,REQUEST,RUNNING,ERROR,MANUAL};var{document}=global,channel=addons.getChannel(),defaultParameters={config:{},options:{}},disabledRules=["region"],queue=[],isRunning=!1,runNext=async()=>{if(queue.length===0){isRunning=!1;return}isRunning=!0;let next=queue.shift();next&&await next(),runNext();},run=async(input=defaultParameters)=>{let{default:axe}=await import('axe-core'),{element="body",config={},options={}}=input,htmlElement=document.querySelector(element)??document.body;if(!htmlElement)return;axe.reset();let configWithDefault={...config,rules:[...disabledRules.map(id=>({id,enabled:!1})),...config?.rules??[]]};return axe.configure(configWithDefault),new Promise((resolve,reject)=>{let task=async()=>{try{let result=await axe.run(htmlElement,options);resolve(result);}catch(error){reject(error);}};queue.push(task),isRunning||runNext();})};channel.on(EVENTS.MANUAL,async(storyId,input=defaultParameters)=>{try{let result=await run(input),resultJson=JSON.parse(JSON.stringify(result));channel.emit(EVENTS.RESULT,resultJson,storyId);}catch(error){channel.emit(EVENTS.ERROR,error);}});function getIsVitestStandaloneRun(){try{return import.meta.env.VITEST_STORYBOOK==="false"}catch{return !1}}var vitestMatchersExtended=!1,experimental_afterEach=async({reporting,parameters:parameters2,globals})=>{let a11yParameter=parameters2.a11y,a11yGlobals=globals.a11y,shouldRunEnvironmentIndependent=a11yParameter?.manual!==!0&&a11yParameter?.disable!==!0&&a11yParameter?.test!=="off"&&a11yGlobals?.manual!==!0,getMode=()=>{switch(a11yParameter?.test){case"todo":return "warning";case"error":default:return "failed"}};if(shouldRunEnvironmentIndependent)try{let result=await run(a11yParameter);if(result){let hasViolations=(result?.violations.length??0)>0;if(reporting.addReport({type:"a11y",version:1,result,status:hasViolations?getMode():"passed"}),getIsVitestStandaloneRun()&&hasViolations&&getMode()==="failed"){if(!vitestMatchersExtended){let{toHaveNoViolations}=await import('./matchers-TIWVOQAP.mjs');expect.extend({toHaveNoViolations}),vitestMatchersExtended=!0;}expect(result).toHaveNoViolations();}}}catch(e){if(reporting.addReport({type:"a11y",version:1,result:{error:e},status:"failed"}),getIsVitestStandaloneRun())throw e}},initialGlobals={a11y:{manual:!1}},parameters={a11y:{test:"todo"}};var index_default=()=>definePreview(preview_exports);
7
7
 
8
8
  export { PARAM_KEY, index_default as default };
@@ -1,4 +1,4 @@
1
- var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles.modifier);var foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor);[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var level=(()=>{if(navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
1
+ var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles.modifier);var foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor);[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
2
2
  `:`
3
3
  `)+postfix,endIndex=index+1,index=string.indexOf(`
4
4
  `,endIndex);}while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}var{stdout:stdoutColor,stderr:stderrColor}=browser_default,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles2=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level;};var chalkFactory=options=>{let chalk2=(...strings)=>strings.join(" ");return applyOptions(chalk2,options),Object.setPrototypeOf(chalk2,createChalk.prototype),chalk2};function createChalk(options){return chalkFactory(options)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[styleName,style]of Object.entries(ansi_styles_default))styles2[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles2.visible={get(){let builder=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};var getModelAnsi=(model,level2,type,...arguments_)=>model==="rgb"?level2==="ansi16m"?ansi_styles_default[type].ansi16m(...arguments_):level2==="ansi256"?ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)):ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)):model==="hex"?getModelAnsi("rgb",level2,type,...ansi_styles_default.hexToRgb(...arguments_)):ansi_styles_default[type][model](...arguments_),usedModels=["rgb","hex","ansi256"];for(let model of usedModels){styles2[model]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"color",...arguments_),ansi_styles_default.color.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles2[bgModel]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"bgColor",...arguments_),ansi_styles_default.bgColor.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};}var proto=Object.defineProperties(()=>{},{...styles2,level:{enumerable:!0,get(){return this[GENERATOR].level},set(level2){this[GENERATOR].level=level2;}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder[GENERATOR]=self,builder[STYLER]=_styler,builder[IS_EMPTY]=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self[IS_EMPTY]?"":string;let styler=self[STYLER];if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.includes("\x1B"))for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
@@ -1,6 +1,6 @@
1
1
  import './chunk-CEH6MNVV.mjs';
2
2
 
3
- var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles.modifier);var foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor);[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var level=(()=>{if(navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
3
+ var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles.modifier);var foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor);[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
4
4
  `:`
5
5
  `)+postfix,endIndex=index+1,index=string.indexOf(`
6
6
  `,endIndex);}while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}var{stdout:stdoutColor,stderr:stderrColor}=browser_default,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles2=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level;};var chalkFactory=options=>{let chalk2=(...strings)=>strings.join(" ");return applyOptions(chalk2,options),Object.setPrototypeOf(chalk2,createChalk.prototype),chalk2};function createChalk(options){return chalkFactory(options)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[styleName,style]of Object.entries(ansi_styles_default))styles2[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles2.visible={get(){let builder=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};var getModelAnsi=(model,level2,type,...arguments_)=>model==="rgb"?level2==="ansi16m"?ansi_styles_default[type].ansi16m(...arguments_):level2==="ansi256"?ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)):ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)):model==="hex"?getModelAnsi("rgb",level2,type,...ansi_styles_default.hexToRgb(...arguments_)):ansi_styles_default[type][model](...arguments_),usedModels=["rgb","hex","ansi256"];for(let model of usedModels){styles2[model]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"color",...arguments_),ansi_styles_default.color.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles2[bgModel]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"bgColor",...arguments_),ansi_styles_default.bgColor.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};}var proto=Object.defineProperties(()=>{},{...styles2,level:{enumerable:!0,get(){return this[GENERATOR].level},set(level2){this[GENERATOR].level=level2;}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder[GENERATOR]=self,builder[STYLER]=_styler,builder[IS_EMPTY]=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self[IS_EMPTY]?"":string;let styler=self[STYLER];if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.includes("\x1B"))for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
@@ -22,7 +22,7 @@ var process4__default = /*#__PURE__*/_interopDefault(process4);
22
22
  var tty__default = /*#__PURE__*/_interopDefault(tty);
23
23
  var path2__default = /*#__PURE__*/_interopDefault(path2);
24
24
 
25
- var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a2,b)=>(typeof require<"u"?require:a2)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_windows=__commonJS({"../../node_modules/isexe/windows.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function checkPathExt(path6,options){var pathext=options.pathExt!==void 0?options.pathExt:process.env.PATHEXT;if(!pathext||(pathext=pathext.split(";"),pathext.indexOf("")!==-1))return !0;for(var i2=0;i2<pathext.length;i2++){var p=pathext[i2].toLowerCase();if(p&&path6.substr(-p.length).toLowerCase()===p)return !0}return !1}function checkStat(stat,path6,options){return !stat.isSymbolicLink()&&!stat.isFile()?!1:checkPathExt(path6,options)}function isexe(path6,options,cb){fs.stat(path6,function(er,stat){cb(er,er?!1:checkStat(stat,path6,options));});}function sync(path6,options){return checkStat(fs.statSync(path6),path6,options)}}});var require_mode=__commonJS({"../../node_modules/isexe/mode.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function isexe(path6,options,cb){fs.stat(path6,function(er,stat){cb(er,er?!1:checkStat(stat,options));});}function sync(path6,options){return checkStat(fs.statSync(path6),options)}function checkStat(stat,options){return stat.isFile()&&checkMode(stat,options)}function checkMode(stat,options){var mod=stat.mode,uid=stat.uid,gid=stat.gid,myUid=options.uid!==void 0?options.uid:process.getuid&&process.getuid(),myGid=options.gid!==void 0?options.gid:process.getgid&&process.getgid(),u2=parseInt("100",8),g=parseInt("010",8),o2=parseInt("001",8),ug=u2|g,ret=mod&o2||mod&g&&gid===myGid||mod&u2&&uid===myUid||mod&ug&&myUid===0;return ret}}});var require_isexe=__commonJS({"../../node_modules/isexe/index.js"(exports,module){__require("fs");var core;process.platform==="win32"||global.TESTING_WINDOWS?core=require_windows():core=require_mode();module.exports=isexe;isexe.sync=sync;function isexe(path6,options,cb){if(typeof options=="function"&&(cb=options,options={}),!cb){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(resolve,reject){isexe(path6,options||{},function(er,is){er?reject(er):resolve(is);});})}core(path6,options||{},function(er,is){er&&(er.code==="EACCES"||options&&options.ignoreErrors)&&(er=null,is=!1),cb(er,is);});}function sync(path6,options){try{return core.sync(path6,options||{})}catch(er){if(options&&options.ignoreErrors||er.code==="EACCES")return !1;throw er}}}});var require_which=__commonJS({"../../node_modules/cross-spawn/node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path6=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i2=>new Promise((resolve,reject)=>{if(i2===pathEnv.length)return opt.all&&found.length?resolve(found):reject(getNotFoundError(cmd));let ppRaw=pathEnv[i2],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path6.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve(subStep(p,i2,0));}),subStep=(p,i2,ii)=>new Promise((resolve,reject)=>{if(ii===pathExt.length)return resolve(step(i2+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve(p+ext);return resolve(subStep(p,i2,ii+1))});});return cb?step(0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i2=0;i2<pathEnv.length;i2++){let ppRaw=pathEnv[i2],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path6.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync;}});var require_path_key=__commonJS({"../../node_modules/path-key/index.js"(exports,module){var pathKey2=(options={})=>{let environment=options.env||process.env;return (options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey2;module.exports.default=pathKey2;}});var require_resolveCommand=__commonJS({"../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){var path6=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd);}catch{}let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path6.delimiter:void 0});}catch{}finally{shouldSwitchCwd&&process.chdir(cwd);}return resolved&&(resolved=path6.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand;}});var require_escape=__commonJS({"../../node_modules/cross-spawn/lib/util/escape.js"(exports,module){var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(\\*)"/g,'$1$1\\"'),arg=arg.replace(/(\\*)$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,"^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument;}});var require_shebang_regex=__commonJS({"../../node_modules/shebang-regex/index.js"(exports,module){module.exports=/^#!(.*)/;}});var require_shebang_command=__commonJS({"../../node_modules/shebang-command/index.js"(exports,module){var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path6,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path6.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary};}});var require_readShebang=__commonJS({"../../node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd);}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang;}});var require_parse=__commonJS({"../../node_modules/cross-spawn/lib/parse.js"(exports,module){var path6=__require("path"),resolveCommand=require_resolveCommand(),escape=require_escape(),readShebang=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand(parsed);let shebang=parsed.file&&readShebang(parsed.file);return shebang?(parsed.args.unshift(parsed.file),parsed.command=shebang,resolveCommand(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path6.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0;}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=parse;}});var require_enoent=__commonJS({"../../node_modules/cross-spawn/lib/enoent.js"(exports,module){var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)};}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError};}});var require_cross_spawn=__commonJS({"../../node_modules/cross-spawn/index.js"(exports,module){var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn2(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync2(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn2;module.exports.spawn=spawn2;module.exports.sync=spawnSync2;module.exports._parse=parse;module.exports._enoent=enoent;}});function isPlainObject(value){if(typeof value!="object"||value===null)return !1;let prototype=Object.getPrototypeOf(value);return (prototype===null||prototype===Object.prototype||Object.getPrototypeOf(prototype)===null)&&!(Symbol.toStringTag in value)&&!(Symbol.iterator in value)}var safeNormalizeFileUrl=(file,name)=>{let fileString=normalizeFileUrl(normalizeDenoExecPath(file));if(typeof fileString!="string")throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);return fileString},normalizeDenoExecPath=file=>isDenoExecPath(file)?file.toString():file,isDenoExecPath=file=>typeof file!="string"&&file&&Object.getPrototypeOf(file)===String.prototype,normalizeFileUrl=file=>file instanceof URL?url.fileURLToPath(file):file;var normalizeParameters=(rawFile,rawArguments=[],rawOptions={})=>{let filePath=safeNormalizeFileUrl(rawFile,"First argument"),[commandArguments,options]=isPlainObject(rawArguments)?[[],rawArguments]:[rawArguments,rawOptions];if(!Array.isArray(commandArguments))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);if(commandArguments.some(commandArgument=>typeof commandArgument=="object"&&commandArgument!==null))throw new TypeError(`Second argument must be an array of strings: ${commandArguments}`);let normalizedArguments=commandArguments.map(String),nullByteArgument=normalizedArguments.find(normalizedArgument=>normalizedArgument.includes("\0"));if(nullByteArgument!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`);if(!isPlainObject(options))throw new TypeError(`Last argument must be an options object: ${options}`);return [filePath,normalizedArguments,options]};var{toString:objectToString}=Object.prototype,isArrayBuffer=value=>objectToString.call(value)==="[object ArrayBuffer]",isUint8Array=value=>objectToString.call(value)==="[object Uint8Array]",bufferToUint8Array=buffer=>new Uint8Array(buffer.buffer,buffer.byteOffset,buffer.byteLength),textEncoder=new TextEncoder,stringToUint8Array=string=>textEncoder.encode(string),textDecoder=new TextDecoder,uint8ArrayToString=uint8Array=>textDecoder.decode(uint8Array),joinToString=(uint8ArraysOrStrings,encoding)=>uint8ArraysToStrings(uint8ArraysOrStrings,encoding).join(""),uint8ArraysToStrings=(uint8ArraysOrStrings,encoding)=>{if(encoding==="utf8"&&uint8ArraysOrStrings.every(uint8ArrayOrString=>typeof uint8ArrayOrString=="string"))return uint8ArraysOrStrings;let decoder=new string_decoder.StringDecoder(encoding),strings=uint8ArraysOrStrings.map(uint8ArrayOrString=>typeof uint8ArrayOrString=="string"?stringToUint8Array(uint8ArrayOrString):uint8ArrayOrString).map(uint8Array=>decoder.write(uint8Array)),finalString=decoder.end();return finalString===""?strings:[...strings,finalString]},joinToUint8Array=uint8ArraysOrStrings=>uint8ArraysOrStrings.length===1&&isUint8Array(uint8ArraysOrStrings[0])?uint8ArraysOrStrings[0]:concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings)),stringsToUint8Arrays=uint8ArraysOrStrings=>uint8ArraysOrStrings.map(uint8ArrayOrString=>typeof uint8ArrayOrString=="string"?stringToUint8Array(uint8ArrayOrString):uint8ArrayOrString),concatUint8Arrays=uint8Arrays=>{let result=new Uint8Array(getJoinLength(uint8Arrays)),index=0;for(let uint8Array of uint8Arrays)result.set(uint8Array,index),index+=uint8Array.length;return result},getJoinLength=uint8Arrays=>{let joinLength=0;for(let uint8Array of uint8Arrays)joinLength+=uint8Array.length;return joinLength};var isTemplateString=templates=>Array.isArray(templates)&&Array.isArray(templates.raw),parseTemplates=(templates,expressions)=>{let tokens=[];for(let[index,template]of templates.entries())tokens=parseTemplate({templates,expressions,tokens,index,template});if(tokens.length===0)throw new TypeError("Template script must not be empty");let[file,...commandArguments]=tokens;return [file,commandArguments,{}]},parseTemplate=({templates,expressions,tokens,index,template})=>{if(template===void 0)throw new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`);let{nextTokens,leadingWhitespaces,trailingWhitespaces}=splitByWhitespaces(template,templates.raw[index]),newTokens=concatTokens(tokens,nextTokens,leadingWhitespaces);if(index===expressions.length)return newTokens;let expression=expressions[index],expressionTokens=Array.isArray(expression)?expression.map(expression2=>parseExpression(expression2)):[parseExpression(expression)];return concatTokens(newTokens,expressionTokens,trailingWhitespaces)},splitByWhitespaces=(template,rawTemplate)=>{if(rawTemplate.length===0)return {nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let nextTokens=[],templateStart=0,leadingWhitespaces=DELIMITERS.has(rawTemplate[0]);for(let templateIndex=0,rawIndex=0;templateIndex<template.length;templateIndex+=1,rawIndex+=1){let rawCharacter=rawTemplate[rawIndex];if(DELIMITERS.has(rawCharacter))templateStart!==templateIndex&&nextTokens.push(template.slice(templateStart,templateIndex)),templateStart=templateIndex+1;else if(rawCharacter==="\\"){let nextRawCharacter=rawTemplate[rawIndex+1];nextRawCharacter===`
25
+ var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a2,b)=>(typeof require<"u"?require:a2)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_windows=__commonJS({"../../node_modules/isexe/windows.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function checkPathExt(path6,options){var pathext=options.pathExt!==void 0?options.pathExt:process.env.PATHEXT;if(!pathext||(pathext=pathext.split(";"),pathext.indexOf("")!==-1))return !0;for(var i2=0;i2<pathext.length;i2++){var p=pathext[i2].toLowerCase();if(p&&path6.substr(-p.length).toLowerCase()===p)return !0}return !1}function checkStat(stat,path6,options){return !stat.isSymbolicLink()&&!stat.isFile()?!1:checkPathExt(path6,options)}function isexe(path6,options,cb){fs.stat(path6,function(er,stat){cb(er,er?!1:checkStat(stat,path6,options));});}function sync(path6,options){return checkStat(fs.statSync(path6),path6,options)}}});var require_mode=__commonJS({"../../node_modules/isexe/mode.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function isexe(path6,options,cb){fs.stat(path6,function(er,stat){cb(er,er?!1:checkStat(stat,options));});}function sync(path6,options){return checkStat(fs.statSync(path6),options)}function checkStat(stat,options){return stat.isFile()&&checkMode(stat,options)}function checkMode(stat,options){var mod=stat.mode,uid=stat.uid,gid=stat.gid,myUid=options.uid!==void 0?options.uid:process.getuid&&process.getuid(),myGid=options.gid!==void 0?options.gid:process.getgid&&process.getgid(),u2=parseInt("100",8),g=parseInt("010",8),o2=parseInt("001",8),ug=u2|g,ret=mod&o2||mod&g&&gid===myGid||mod&u2&&uid===myUid||mod&ug&&myUid===0;return ret}}});var require_isexe=__commonJS({"../../node_modules/isexe/index.js"(exports,module){__require("fs");var core;process.platform==="win32"||global.TESTING_WINDOWS?core=require_windows():core=require_mode();module.exports=isexe;isexe.sync=sync;function isexe(path6,options,cb){if(typeof options=="function"&&(cb=options,options={}),!cb){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(resolve,reject){isexe(path6,options||{},function(er,is){er?reject(er):resolve(is);});})}core(path6,options||{},function(er,is){er&&(er.code==="EACCES"||options&&options.ignoreErrors)&&(er=null,is=!1),cb(er,is);});}function sync(path6,options){try{return core.sync(path6,options||{})}catch(er){if(options&&options.ignoreErrors||er.code==="EACCES")return !1;throw er}}}});var require_which=__commonJS({"../../node_modules/cross-spawn/node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path6=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i2=>new Promise((resolve,reject)=>{if(i2===pathEnv.length)return opt.all&&found.length?resolve(found):reject(getNotFoundError(cmd));let ppRaw=pathEnv[i2],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path6.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve(subStep(p,i2,0));}),subStep=(p,i2,ii)=>new Promise((resolve,reject)=>{if(ii===pathExt.length)return resolve(step(i2+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve(p+ext);return resolve(subStep(p,i2,ii+1))});});return cb?step(0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i2=0;i2<pathEnv.length;i2++){let ppRaw=pathEnv[i2],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path6.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync;}});var require_path_key=__commonJS({"../../node_modules/path-key/index.js"(exports,module){var pathKey2=(options={})=>{let environment=options.env||process.env;return (options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey2;module.exports.default=pathKey2;}});var require_resolveCommand=__commonJS({"../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){var path6=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd);}catch{}let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path6.delimiter:void 0});}catch{}finally{shouldSwitchCwd&&process.chdir(cwd);}return resolved&&(resolved=path6.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand;}});var require_escape=__commonJS({"../../node_modules/cross-spawn/lib/util/escape.js"(exports,module){var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,"^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument;}});var require_shebang_regex=__commonJS({"../../node_modules/shebang-regex/index.js"(exports,module){module.exports=/^#!(.*)/;}});var require_shebang_command=__commonJS({"../../node_modules/shebang-command/index.js"(exports,module){var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path6,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path6.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary};}});var require_readShebang=__commonJS({"../../node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd);}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang;}});var require_parse=__commonJS({"../../node_modules/cross-spawn/lib/parse.js"(exports,module){var path6=__require("path"),resolveCommand=require_resolveCommand(),escape=require_escape(),readShebang=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand(parsed);let shebang=parsed.file&&readShebang(parsed.file);return shebang?(parsed.args.unshift(parsed.file),parsed.command=shebang,resolveCommand(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path6.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0;}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=parse;}});var require_enoent=__commonJS({"../../node_modules/cross-spawn/lib/enoent.js"(exports,module){var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)};}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError};}});var require_cross_spawn=__commonJS({"../../node_modules/cross-spawn/index.js"(exports,module){var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn2(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync2(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn2;module.exports.spawn=spawn2;module.exports.sync=spawnSync2;module.exports._parse=parse;module.exports._enoent=enoent;}});function isPlainObject(value){if(typeof value!="object"||value===null)return !1;let prototype=Object.getPrototypeOf(value);return (prototype===null||prototype===Object.prototype||Object.getPrototypeOf(prototype)===null)&&!(Symbol.toStringTag in value)&&!(Symbol.iterator in value)}var safeNormalizeFileUrl=(file,name)=>{let fileString=normalizeFileUrl(normalizeDenoExecPath(file));if(typeof fileString!="string")throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);return fileString},normalizeDenoExecPath=file=>isDenoExecPath(file)?file.toString():file,isDenoExecPath=file=>typeof file!="string"&&file&&Object.getPrototypeOf(file)===String.prototype,normalizeFileUrl=file=>file instanceof URL?url.fileURLToPath(file):file;var normalizeParameters=(rawFile,rawArguments=[],rawOptions={})=>{let filePath=safeNormalizeFileUrl(rawFile,"First argument"),[commandArguments,options]=isPlainObject(rawArguments)?[[],rawArguments]:[rawArguments,rawOptions];if(!Array.isArray(commandArguments))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);if(commandArguments.some(commandArgument=>typeof commandArgument=="object"&&commandArgument!==null))throw new TypeError(`Second argument must be an array of strings: ${commandArguments}`);let normalizedArguments=commandArguments.map(String),nullByteArgument=normalizedArguments.find(normalizedArgument=>normalizedArgument.includes("\0"));if(nullByteArgument!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`);if(!isPlainObject(options))throw new TypeError(`Last argument must be an options object: ${options}`);return [filePath,normalizedArguments,options]};var{toString:objectToString}=Object.prototype,isArrayBuffer=value=>objectToString.call(value)==="[object ArrayBuffer]",isUint8Array=value=>objectToString.call(value)==="[object Uint8Array]",bufferToUint8Array=buffer=>new Uint8Array(buffer.buffer,buffer.byteOffset,buffer.byteLength),textEncoder=new TextEncoder,stringToUint8Array=string=>textEncoder.encode(string),textDecoder=new TextDecoder,uint8ArrayToString=uint8Array=>textDecoder.decode(uint8Array),joinToString=(uint8ArraysOrStrings,encoding)=>uint8ArraysToStrings(uint8ArraysOrStrings,encoding).join(""),uint8ArraysToStrings=(uint8ArraysOrStrings,encoding)=>{if(encoding==="utf8"&&uint8ArraysOrStrings.every(uint8ArrayOrString=>typeof uint8ArrayOrString=="string"))return uint8ArraysOrStrings;let decoder=new string_decoder.StringDecoder(encoding),strings=uint8ArraysOrStrings.map(uint8ArrayOrString=>typeof uint8ArrayOrString=="string"?stringToUint8Array(uint8ArrayOrString):uint8ArrayOrString).map(uint8Array=>decoder.write(uint8Array)),finalString=decoder.end();return finalString===""?strings:[...strings,finalString]},joinToUint8Array=uint8ArraysOrStrings=>uint8ArraysOrStrings.length===1&&isUint8Array(uint8ArraysOrStrings[0])?uint8ArraysOrStrings[0]:concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings)),stringsToUint8Arrays=uint8ArraysOrStrings=>uint8ArraysOrStrings.map(uint8ArrayOrString=>typeof uint8ArrayOrString=="string"?stringToUint8Array(uint8ArrayOrString):uint8ArrayOrString),concatUint8Arrays=uint8Arrays=>{let result=new Uint8Array(getJoinLength(uint8Arrays)),index=0;for(let uint8Array of uint8Arrays)result.set(uint8Array,index),index+=uint8Array.length;return result},getJoinLength=uint8Arrays=>{let joinLength=0;for(let uint8Array of uint8Arrays)joinLength+=uint8Array.length;return joinLength};var isTemplateString=templates=>Array.isArray(templates)&&Array.isArray(templates.raw),parseTemplates=(templates,expressions)=>{let tokens=[];for(let[index,template]of templates.entries())tokens=parseTemplate({templates,expressions,tokens,index,template});if(tokens.length===0)throw new TypeError("Template script must not be empty");let[file,...commandArguments]=tokens;return [file,commandArguments,{}]},parseTemplate=({templates,expressions,tokens,index,template})=>{if(template===void 0)throw new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`);let{nextTokens,leadingWhitespaces,trailingWhitespaces}=splitByWhitespaces(template,templates.raw[index]),newTokens=concatTokens(tokens,nextTokens,leadingWhitespaces);if(index===expressions.length)return newTokens;let expression=expressions[index],expressionTokens=Array.isArray(expression)?expression.map(expression2=>parseExpression(expression2)):[parseExpression(expression)];return concatTokens(newTokens,expressionTokens,trailingWhitespaces)},splitByWhitespaces=(template,rawTemplate)=>{if(rawTemplate.length===0)return {nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let nextTokens=[],templateStart=0,leadingWhitespaces=DELIMITERS.has(rawTemplate[0]);for(let templateIndex=0,rawIndex=0;templateIndex<template.length;templateIndex+=1,rawIndex+=1){let rawCharacter=rawTemplate[rawIndex];if(DELIMITERS.has(rawCharacter))templateStart!==templateIndex&&nextTokens.push(template.slice(templateStart,templateIndex)),templateStart=templateIndex+1;else if(rawCharacter==="\\"){let nextRawCharacter=rawTemplate[rawIndex+1];nextRawCharacter===`
26
26
  `?(templateIndex-=1,rawIndex+=1):nextRawCharacter==="u"&&rawTemplate[rawIndex+2]==="{"?rawIndex=rawTemplate.indexOf("}",rawIndex+3):rawIndex+=ESCAPE_LENGTH[nextRawCharacter]??1;}}let trailingWhitespaces=templateStart===template.length;return trailingWhitespaces||nextTokens.push(template.slice(templateStart)),{nextTokens,leadingWhitespaces,trailingWhitespaces}},DELIMITERS=new Set([" "," ","\r",`
27
27
  `]),ESCAPE_LENGTH={x:3,u:5},concatTokens=(tokens,nextTokens,isSeparated)=>isSeparated||tokens.length===0||nextTokens.length===0?[...tokens,...nextTokens]:[...tokens.slice(0,-1),`${tokens.at(-1)}${nextTokens[0]}`,...nextTokens.slice(1)],parseExpression=expression=>{let typeOfExpression=typeof expression;if(typeOfExpression==="string")return expression;if(typeOfExpression==="number")return String(expression);if(isPlainObject(expression)&&("stdout"in expression||"isMaxBuffer"in expression))return getSubprocessResult(expression);throw expression instanceof child_process.ChildProcess||Object.prototype.toString.call(expression)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${typeOfExpression}" in template expression`)},getSubprocessResult=({stdout})=>{if(typeof stdout=="string")return stdout;if(isUint8Array(stdout))return uint8ArrayToString(stdout);throw stdout===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof stdout}" stdout in template expression`)};var isStandardStream=stream=>STANDARD_STREAMS.includes(stream),STANDARD_STREAMS=[process4__default.default.stdin,process4__default.default.stdout,process4__default.default.stderr],STANDARD_STREAMS_ALIASES=["stdin","stdout","stderr"],getStreamName=fdNumber=>STANDARD_STREAMS_ALIASES[fdNumber]??`stdio[${fdNumber}]`;var normalizeFdSpecificOptions=options=>{let optionsCopy={...options};for(let optionName of FD_SPECIFIC_OPTIONS)optionsCopy[optionName]=normalizeFdSpecificOption(options,optionName);return optionsCopy},normalizeFdSpecificOption=(options,optionName)=>{let optionBaseArray=Array.from({length:getStdioLength(options)+1}),optionArray=normalizeFdSpecificValue(options[optionName],optionBaseArray,optionName);return addDefaultValue(optionArray,optionName)},getStdioLength=({stdio})=>Array.isArray(stdio)?Math.max(stdio.length,STANDARD_STREAMS_ALIASES.length):STANDARD_STREAMS_ALIASES.length,normalizeFdSpecificValue=(optionValue,optionArray,optionName)=>isPlainObject(optionValue)?normalizeOptionObject(optionValue,optionArray,optionName):optionArray.fill(optionValue),normalizeOptionObject=(optionValue,optionArray,optionName)=>{for(let fdName of Object.keys(optionValue).sort(compareFdName))for(let fdNumber of parseFdName(fdName,optionName,optionArray))optionArray[fdNumber]=optionValue[fdName];return optionArray},compareFdName=(fdNameA,fdNameB)=>getFdNameOrder(fdNameA)<getFdNameOrder(fdNameB)?1:-1,getFdNameOrder=fdName=>fdName==="stdout"||fdName==="stderr"?0:fdName==="all"?2:1,parseFdName=(fdName,optionName,optionArray)=>{if(fdName==="ipc")return [optionArray.length-1];let fdNumber=parseFd(fdName);if(fdNumber===void 0||fdNumber===0)throw new TypeError(`"${optionName}.${fdName}" is invalid.
28
28
  It must be "${optionName}.stdout", "${optionName}.stderr", "${optionName}.all", "${optionName}.ipc", or "${optionName}.fd3", "${optionName}.fd4" (and so on).`);if(fdNumber>=optionArray.length)throw new TypeError(`"${optionName}.${fdName}" is invalid: that file descriptor does not exist.
package/dist/preview.js CHANGED
@@ -4,7 +4,7 @@ var test = require('@storybook/test');
4
4
  var previewApi = require('storybook/internal/preview-api');
5
5
  var global = require('@storybook/global');
6
6
 
7
- var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __esm=(fn,res)=>function(){return fn&&(res=(0, fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0});};function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var wrapAnsi16,wrapAnsi256,wrapAnsi16m,styles,foregroundColorNames,backgroundColorNames,ansiStyles,ansi_styles_default,init_ansi_styles=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/ansi-styles/index.js"(){wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Object.keys(styles.modifier),foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor),[...foregroundColorNames,...backgroundColorNames];ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;}});var level,colorSupport,supportsColor,browser_default,init_browser=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/supports-color/browser.js"(){level=(()=>{if(navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;}});function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
7
+ var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __esm=(fn,res)=>function(){return fn&&(res=(0, fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0});};function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var wrapAnsi16,wrapAnsi256,wrapAnsi16m,styles,foregroundColorNames,backgroundColorNames,ansiStyles,ansi_styles_default,init_ansi_styles=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/ansi-styles/index.js"(){wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Object.keys(styles.modifier),foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor),[...foregroundColorNames,...backgroundColorNames];ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;}});var level,colorSupport,supportsColor,browser_default,init_browser=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/vendor/supports-color/browser.js"(){level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){let brand=navigator.userAgentData.brands.find(({brand:brand2})=>brand2==="Chromium");if(brand&&brand.version>93)return 3}return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},browser_default=supportsColor;}});function stringReplaceAll(string,substring,replacer){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.slice(endIndex,gotCR?index-1:index)+prefix+(gotCR?`\r
8
8
  `:`
9
9
  `)+postfix,endIndex=index+1,index=string.indexOf(`
10
10
  `,endIndex);}while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}var init_utilities=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/utilities.js"(){}});function createChalk(options){return chalkFactory(options)}var stdoutColor,stderrColor,GENERATOR,STYLER,IS_EMPTY,levelMapping,styles2,applyOptions,chalkFactory,getModelAnsi,usedModels,proto,createStyler,createBuilder,applyStyle,chalk,source_default,init_source=__esm({"../../node_modules/vitest-axe/node_modules/chalk/source/index.js"(){init_ansi_styles();init_browser();init_utilities();(({stdout:stdoutColor,stderr:stderrColor}=browser_default)),GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles2=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level;},chalkFactory=options=>{let chalk2=(...strings)=>strings.join(" ");return applyOptions(chalk2,options),Object.setPrototypeOf(chalk2,createChalk.prototype),chalk2};Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[styleName,style]of Object.entries(ansi_styles_default))styles2[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles2.visible={get(){let builder=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};getModelAnsi=(model,level2,type,...arguments_)=>model==="rgb"?level2==="ansi16m"?ansi_styles_default[type].ansi16m(...arguments_):level2==="ansi256"?ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)):ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)):model==="hex"?getModelAnsi("rgb",level2,type,...ansi_styles_default.hexToRgb(...arguments_)):ansi_styles_default[type][model](...arguments_),usedModels=["rgb","hex","ansi256"];for(let model of usedModels){styles2[model]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"color",...arguments_),ansi_styles_default.color.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles2[bgModel]={get(){let{level:level2}=this;return function(...arguments_){let styler=createStyler(getModelAnsi(model,levelMapping[level2],"bgColor",...arguments_),ansi_styles_default.bgColor.close,this[STYLER]);return createBuilder(this,styler,this[IS_EMPTY])}}};}proto=Object.defineProperties(()=>{},{...styles2,level:{enumerable:!0,get(){return this[GENERATOR].level},set(level2){this[GENERATOR].level=level2;}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder[GENERATOR]=self,builder[STYLER]=_styler,builder[IS_EMPTY]=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self[IS_EMPTY]?"":string;let styler=self[STYLER];if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.includes("\x1B"))for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
package/dist/preview.mjs CHANGED
@@ -2,6 +2,6 @@ import { expect } from '@storybook/test';
2
2
  import { addons } from 'storybook/internal/preview-api';
3
3
  import { global } from '@storybook/global';
4
4
 
5
- var ADDON_ID="storybook/a11y";var RESULT=`${ADDON_ID}/result`,REQUEST=`${ADDON_ID}/request`,RUNNING=`${ADDON_ID}/running`,ERROR=`${ADDON_ID}/error`,MANUAL=`${ADDON_ID}/manual`;var EVENTS={RESULT,REQUEST,RUNNING,ERROR,MANUAL};var{document}=global,channel=addons.getChannel(),defaultParameters={config:{},options:{}},disabledRules=["region"],queue=[],isRunning=!1,runNext=async()=>{if(queue.length===0){isRunning=!1;return}isRunning=!0;let next=queue.shift();next&&await next(),runNext();},run=async(input=defaultParameters)=>{let{default:axe}=await import('axe-core'),{element="body",config={},options={}}=input,htmlElement=document.querySelector(element)??document.body;if(!htmlElement)return;axe.reset();let configWithDefault={...config,rules:[...disabledRules.map(id=>({id,enabled:!1})),...config?.rules??[]]};return axe.configure(configWithDefault),new Promise((resolve,reject)=>{let task=async()=>{try{let result=await axe.run(htmlElement,options);resolve(result);}catch(error){reject(error);}};queue.push(task),isRunning||runNext();})};channel.on(EVENTS.MANUAL,async(storyId,input=defaultParameters)=>{try{let result=await run(input),resultJson=JSON.parse(JSON.stringify(result));channel.emit(EVENTS.RESULT,resultJson,storyId);}catch(error){channel.emit(EVENTS.ERROR,error);}});function getIsVitestStandaloneRun(){try{return import.meta.env.VITEST_STORYBOOK==="false"}catch{return !1}}var vitestMatchersExtended=!1,experimental_afterEach=async({reporting,parameters:parameters2,globals})=>{let a11yParameter=parameters2.a11y,a11yGlobals=globals.a11y,shouldRunEnvironmentIndependent=a11yParameter?.manual!==!0&&a11yParameter?.disable!==!0&&a11yParameter?.test!=="off"&&a11yGlobals?.manual!==!0,getMode=()=>{switch(a11yParameter?.test){case"todo":return "warning";case"error":default:return "failed"}};if(shouldRunEnvironmentIndependent)try{let result=await run(a11yParameter);if(result){let hasViolations=(result?.violations.length??0)>0;if(reporting.addReport({type:"a11y",version:1,result,status:hasViolations?getMode():"passed"}),getIsVitestStandaloneRun()&&hasViolations&&getMode()==="failed"){if(!vitestMatchersExtended){let{toHaveNoViolations}=await import('./matchers-57EZJSQE.mjs');expect.extend({toHaveNoViolations}),vitestMatchersExtended=!0;}expect(result).toHaveNoViolations();}}}catch(e){if(reporting.addReport({type:"a11y",version:1,result:{error:e},status:"failed"}),getIsVitestStandaloneRun())throw e}},initialGlobals={a11y:{manual:!1}},parameters={a11y:{test:"todo"}};
5
+ var ADDON_ID="storybook/a11y";var RESULT=`${ADDON_ID}/result`,REQUEST=`${ADDON_ID}/request`,RUNNING=`${ADDON_ID}/running`,ERROR=`${ADDON_ID}/error`,MANUAL=`${ADDON_ID}/manual`;var EVENTS={RESULT,REQUEST,RUNNING,ERROR,MANUAL};var{document}=global,channel=addons.getChannel(),defaultParameters={config:{},options:{}},disabledRules=["region"],queue=[],isRunning=!1,runNext=async()=>{if(queue.length===0){isRunning=!1;return}isRunning=!0;let next=queue.shift();next&&await next(),runNext();},run=async(input=defaultParameters)=>{let{default:axe}=await import('axe-core'),{element="body",config={},options={}}=input,htmlElement=document.querySelector(element)??document.body;if(!htmlElement)return;axe.reset();let configWithDefault={...config,rules:[...disabledRules.map(id=>({id,enabled:!1})),...config?.rules??[]]};return axe.configure(configWithDefault),new Promise((resolve,reject)=>{let task=async()=>{try{let result=await axe.run(htmlElement,options);resolve(result);}catch(error){reject(error);}};queue.push(task),isRunning||runNext();})};channel.on(EVENTS.MANUAL,async(storyId,input=defaultParameters)=>{try{let result=await run(input),resultJson=JSON.parse(JSON.stringify(result));channel.emit(EVENTS.RESULT,resultJson,storyId);}catch(error){channel.emit(EVENTS.ERROR,error);}});function getIsVitestStandaloneRun(){try{return import.meta.env.VITEST_STORYBOOK==="false"}catch{return !1}}var vitestMatchersExtended=!1,experimental_afterEach=async({reporting,parameters:parameters2,globals})=>{let a11yParameter=parameters2.a11y,a11yGlobals=globals.a11y,shouldRunEnvironmentIndependent=a11yParameter?.manual!==!0&&a11yParameter?.disable!==!0&&a11yParameter?.test!=="off"&&a11yGlobals?.manual!==!0,getMode=()=>{switch(a11yParameter?.test){case"todo":return "warning";case"error":default:return "failed"}};if(shouldRunEnvironmentIndependent)try{let result=await run(a11yParameter);if(result){let hasViolations=(result?.violations.length??0)>0;if(reporting.addReport({type:"a11y",version:1,result,status:hasViolations?getMode():"passed"}),getIsVitestStandaloneRun()&&hasViolations&&getMode()==="failed"){if(!vitestMatchersExtended){let{toHaveNoViolations}=await import('./matchers-7Z3WT2CE.mjs');expect.extend({toHaveNoViolations}),vitestMatchersExtended=!0;}expect(result).toHaveNoViolations();}}}catch(e){if(reporting.addReport({type:"a11y",version:1,result:{error:e},status:"failed"}),getIsVitestStandaloneRun())throw e}},initialGlobals={a11y:{manual:!1}},parameters={a11y:{test:"todo"}};
6
6
 
7
7
  export { experimental_afterEach, initialGlobals, parameters };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-a11y",
3
- "version": "8.7.0-alpha.0",
3
+ "version": "9.0.0-alpha.1",
4
4
  "description": "Test component compliance with web accessibility standards",
5
5
  "keywords": [
6
6
  "a11y",
@@ -66,8 +66,8 @@
66
66
  "prep": "jiti ../../../scripts/prepare/addon-bundle.ts"
67
67
  },
68
68
  "dependencies": {
69
- "@storybook/addon-highlight": "8.7.0-alpha.0",
70
- "@storybook/test": "8.7.0-alpha.0",
69
+ "@storybook/addon-highlight": "9.0.0-alpha.1",
70
+ "@storybook/test": "9.0.0-alpha.1",
71
71
  "axe-core": "^4.2.0"
72
72
  },
73
73
  "devDependencies": {
@@ -85,7 +85,7 @@
85
85
  "vitest-axe": "^0.1.0"
86
86
  },
87
87
  "peerDependencies": {
88
- "storybook": "^8.7.0-alpha.0"
88
+ "storybook": "^9.0.0-alpha.1"
89
89
  },
90
90
  "publishConfig": {
91
91
  "access": "public"